back up before adjusting keycodes

This commit is contained in:
landgreen
2020-10-08 16:40:28 -07:00
parent dd8df8f563
commit 649d7858b3
5 changed files with 45 additions and 33 deletions

View File

@@ -166,8 +166,8 @@ const b = {
}, },
explosion(where, radius) { // typically explode is used for some bullets with .onEnd explosion(where, radius) { // typically explode is used for some bullets with .onEnd
let dist, sub, knock; let dist, sub, knock;
let dmg = radius * 0.01; let dmg = radius * 0.013;
if (mod.isExplosionHarm) radius *= 1.35 if (mod.isExplosionHarm) radius *= 1.43 // sqrt(2)radius for 2x more area
if (mod.isSmallExplosion) { if (mod.isSmallExplosion) {
radius *= 0.5 radius *= 0.5
dmg *= 1.5 dmg *= 1.5
@@ -198,12 +198,11 @@ const b = {
if (mod.isImmuneExplosion) { if (mod.isImmuneExplosion) {
const mitigate = Math.min(1, Math.max(1 - mech.energy * 0.6, 0)) const mitigate = Math.min(1, Math.max(1 - mech.energy * 0.6, 0))
mech.damage(mitigate * radius * (mod.isExplosionHarm) ? 0.0004 : 0.0001); mech.damage(mitigate * radius * (mod.isExplosionHarm ? 0.0004 : 0.0001));
} else { } else {
mech.damage(radius * (mod.isExplosionHarm) ? 0.0004 : 0.0001); mech.damage(radius * (mod.isExplosionHarm ? 0.0004 : 0.0001));
} }
// if (!(mod.isImmuneExplosion && mech.energy > 0.97)) { // if (!(mod.isImmuneExplosion && mech.energy > 0.97)) {
// if (mod.isExplosionHarm) { // if (mod.isExplosionHarm) {
// mech.damage(radius * 0.0004); //300% more player damage from explosions // mech.damage(radius * 0.0004); //300% more player damage from explosions
@@ -806,8 +805,8 @@ const b = {
this.endCycle = game.cycle this.endCycle = game.cycle
if (mod.isHeavyWater) mobs.statusDoT(who, 0.15, 300) if (mod.isHeavyWater) mobs.statusDoT(who, 0.15, 300)
if (mod.iceEnergy && !who.shield && !who.isShielded && who.dropPowerUp && !who.alive) { if (mod.iceEnergy && !who.shield && !who.isShielded && who.dropPowerUp && !who.alive) {
mech.energy += mod.iceEnergy * 0.66 mech.energy += mod.iceEnergy * 0.66 * mech.maxEnergy
mech.addHealth(mod.iceEnergy * 0.03) mech.addHealth(mod.iceEnergy * 0.04)
} }
}, },
onEnd() {}, onEnd() {},
@@ -1990,8 +1989,8 @@ const b = {
name: "flechettes", name: "flechettes",
description: "fire a volley of <strong class='color-p'>uranium-235</strong> <strong>needles</strong><br>does <strong class='color-p'>radioactive</strong> <strong class='color-d'>damage</strong> over <strong>3</strong> seconds", description: "fire a volley of <strong class='color-p'>uranium-235</strong> <strong>needles</strong><br>does <strong class='color-p'>radioactive</strong> <strong class='color-d'>damage</strong> over <strong>3</strong> seconds",
ammo: 0, ammo: 0,
ammoPack: 45, ammoPack: 55,
defaultAmmoPack: 45, defaultAmmoPack: 55,
have: false, have: false,
count: 0, //used to track how many shots are in a volley before a big CD count: 0, //used to track how many shots are in a volley before a big CD
lastFireCycle: 0, //use to remember how longs its been since last fire, used to reset count lastFireCycle: 0, //use to remember how longs its been since last fire, used to reset count
@@ -2018,9 +2017,9 @@ const b = {
this.immuneList.push(who.id) this.immuneList.push(who.id)
who.foundPlayer(); who.foundPlayer();
if (mod.isFastDot) { if (mod.isFastDot) {
mobs.statusDoT(who, 3.9, 30) mobs.statusDoT(who, 4, 30)
} else { } else {
mobs.statusDoT(who, 0.65, mod.isSlowDot ? 360 : 180) mobs.statusDoT(who, 0.66, mod.isSlowDot ? 360 : 180)
} }
game.drawList.push({ //add dmg to draw queue game.drawList.push({ //add dmg to draw queue
x: this.position.x, x: this.position.x,
@@ -2072,7 +2071,7 @@ const b = {
makeFlechette(mech.angle - 0.02 - 0.005 * Math.random()) makeFlechette(mech.angle - 0.02 - 0.005 * Math.random())
} }
const CD = (mech.crouch) ? 68 : 35 const CD = (mech.crouch) ? 60 : 30
if (this.lastFireCycle + CD < mech.cycle) this.count = 0 //reset count if it cycles past the CD if (this.lastFireCycle + CD < mech.cycle) this.count = 0 //reset count if it cycles past the CD
this.lastFireCycle = mech.cycle this.lastFireCycle = mech.cycle
if (this.count > ((mech.crouch) ? 7 : 1)) { if (this.count > ((mech.crouch) ? 7 : 1)) {

View File

@@ -584,6 +584,7 @@ document.body.addEventListener("mouseleave", (e) => { //prevents mouse getting s
//keyboard input //keyboard input
const keys = []; const keys = [];
document.body.addEventListener("keydown", (e) => { document.body.addEventListener("keydown", (e) => {
console.log(e.keyCode)
keys[e.keyCode] = true; keys[e.keyCode] = true;
if (mech.alive) game.keyPress(); if (mech.alive) game.keyPress();
}); });

View File

@@ -3842,25 +3842,25 @@ const level = {
for (let i = 0; i < num; i++) { for (let i = 0; i < num; i++) {
game.difficulty++ game.difficulty++
game.dmgScale += 0.37; //damage done by mobs increases each level game.dmgScale += 0.37; //damage done by mobs increases each level
b.dmgScale *= 0.92; //damage done by player decreases each level b.dmgScale *= 0.93; //damage done by player decreases each level
if (game.accelScale < 5) game.accelScale *= 1.027 //mob acceleration increases each level if (game.accelScale < 5) game.accelScale *= 1.02 //mob acceleration increases each level
if (game.lookFreqScale > 0.2) game.lookFreqScale *= 0.975 //mob cycles between looks decreases each level if (game.lookFreqScale > 0.2) game.lookFreqScale *= 0.98 //mob cycles between looks decreases each level
if (game.CDScale > 0.2) game.CDScale *= 0.966 //mob CD time decreases each level if (game.CDScale > 0.2) game.CDScale *= 0.97 //mob CD time decreases each level
} }
game.healScale = 1 / (1 + game.difficulty * 0.07) //a higher denominator makes for lower heals // mech.health += heal * game.healScale; game.healScale = 1 / (1 + game.difficulty * 0.06) //a higher denominator makes for lower heals // mech.health += heal * game.healScale;
}, },
difficultyDecrease(num = 1) { //used in easy mode for game.reset() difficultyDecrease(num = 1) { //used in easy mode for game.reset()
for (let i = 0; i < num; i++) { for (let i = 0; i < num; i++) {
game.difficulty-- game.difficulty--
game.dmgScale -= 0.37; //damage done by mobs increases each level game.dmgScale -= 0.37; //damage done by mobs increases each level
if (game.dmgScale < 0.1) game.dmgScale = 0.1; if (game.dmgScale < 0.1) game.dmgScale = 0.1;
b.dmgScale /= 0.92; //damage done by player decreases each level b.dmgScale /= 0.93; //damage done by player decreases each level
if (game.accelScale > 0.2) game.accelScale /= 1.027 //mob acceleration increases each level if (game.accelScale > 0.2) game.accelScale /= 1.02 //mob acceleration increases each level
if (game.lookFreqScale < 5) game.lookFreqScale /= 0.975 //mob cycles between looks decreases each level if (game.lookFreqScale < 5) game.lookFreqScale /= 0.98 //mob cycles between looks decreases each level
if (game.CDScale < 5) game.CDScale /= 0.966 //mob CD time decreases each level if (game.CDScale < 5) game.CDScale /= 0.97 //mob CD time decreases each level
} }
if (game.difficulty < 1) game.difficulty = 0; if (game.difficulty < 1) game.difficulty = 0;
game.healScale = 1 / (1 + game.difficulty * 0.07) game.healScale = 1 / (1 + game.difficulty * 0.06)
}, },
difficultyText(mode = document.getElementById("difficulty-select").value) { difficultyText(mode = document.getElementById("difficulty-select").value) {
if (mode === "0") { if (mode === "0") {

View File

@@ -83,7 +83,7 @@ const mod = {
damageFromMods() { damageFromMods() {
let dmg = mech.fieldDamage let dmg = mech.fieldDamage
// if (mod.aimDamage>1) // if (mod.aimDamage>1)
if (mod.isEnergyNoAmmo) dmg *= 1.4 if (mod.isEnergyNoAmmo) dmg *= 1.5
if (mod.isDamageForGuns) dmg *= 1 + 0.07 * b.inventory.length if (mod.isDamageForGuns) dmg *= 1 + 0.07 * b.inventory.length
if (mod.isLowHealthDmg) dmg *= 1 + 0.6 * Math.max(0, 1 - mech.health) if (mod.isLowHealthDmg) dmg *= 1 + 0.6 * Math.max(0, 1 - mech.health)
if (mod.isHarmDamage && mech.lastHarmCycle + 600 > mech.cycle) dmg *= 2; if (mod.isHarmDamage && mech.lastHarmCycle + 600 > mech.cycle) dmg *= 2;
@@ -133,7 +133,7 @@ const mod = {
}, },
{ {
name: "exciton-lattice", name: "exciton-lattice",
description: `increase <strong class='color-d'>damage</strong> by <strong>40%</strong>, but<br><strong class='color-g'>ammo</strong> will no longer <strong>spawn</strong>`, description: `increase <strong class='color-d'>damage</strong> by <strong>50%</strong>, but<br><strong class='color-g'>ammo</strong> will no longer <strong>spawn</strong>`,
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -420,7 +420,7 @@ const mod = {
}, },
{ {
name: "ammonium nitrate", name: "ammonium nitrate",
description: "increase <strong class='color-e'>explosive</strong> <strong>area</strong> by <strong>60%</strong>, but<br>you take <strong>300%</strong> more <strong class='color-harm'>harm</strong> from <strong class='color-e'>explosions</strong>", description: "increase <strong class='color-e'>explosive</strong> <strong>area</strong> by <strong>100%</strong>, but<br>you take <strong>400%</strong> more <strong class='color-harm'>harm</strong> from <strong class='color-e'>explosions</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -1217,7 +1217,7 @@ const mod = {
}, },
{ {
name: "stimulated emission", name: "stimulated emission",
description: "<strong>8%</strong> chance to <strong>duplicate</strong> spawned <strong>power ups</strong>", description: "<strong>9%</strong> chance to <strong>duplicate</strong> spawned <strong>power ups</strong>",
maxCount: 9, maxCount: 9,
count: 0, count: 0,
allowed() { allowed() {
@@ -1225,12 +1225,12 @@ const mod = {
}, },
requires: "", requires: "",
effect: () => { effect: () => {
mod.duplicateChance += 0.08 mod.duplicateChance += 0.09
game.draw.powerUp = game.draw.powerUpBonus //change power up draw game.draw.powerUp = game.draw.powerUpBonus //change power up draw
}, },
remove() { remove() {
mod.duplicateChance -= 0.08 * this.count mod.duplicateChance -= 0.09 * this.count
if (!mod.duplicateChance) game.draw.powerUp = game.draw.powerUpNormal if (!mod.duplicateChance) game.draw.powerUp = game.draw.powerUpNormal
} }
}, },
@@ -2220,8 +2220,8 @@ const mod = {
}, },
{ {
name: "thermoelectric effect", name: "thermoelectric effect",
description: "<strong>killing</strong> mobs with <strong>ice IX</strong> gives <strong>3%</strong> <strong class='color-h'>health</strong><br>and overfills your <strong class='color-f'>energy</strong> by <strong>66%</strong>", description: "<strong>killing</strong> mobs with <strong>ice IX</strong> gives <strong>4%</strong> <strong class='color-h'>health</strong><br>and overloads <strong class='color-f'>energy</strong> by <strong>100%</strong> of your max",
maxCount: 3, maxCount: 9,
count: 0, count: 0,
allowed() { allowed() {
return (mod.haveGunCheck("ice IX") || mod.isIceField) && !mod.isHeavyWater return (mod.haveGunCheck("ice IX") || mod.isIceField) && !mod.isHeavyWater
@@ -2660,7 +2660,7 @@ const mod = {
}, },
{ {
name: "pair production", name: "pair production",
description: "<strong>power ups</strong> overfill your <strong class='color-f'>energy</strong><br>temporarily gain <strong>3x</strong> your maximum <strong class='color-f'>energy</strong>", description: "<strong>power ups</strong> overload your <strong class='color-f'>energy</strong><br>by <strong>300%</strong> of your maximum <strong class='color-f'>energy</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {

View File

@@ -1,8 +1,20 @@
ice IX mod: thermoelectric effect - when ice IX kills a mob heal 3% and regen 66% energy
ice IX thermoelectric energy 66% -> 100%, heal 3%->4%
************** TODO - n-gon ************** ************** TODO - n-gon **************
all explosions based guns seem weak, buff damage? redo key press around e.key
https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent
time dilation mod rework brain storm
take no damage
can fire
2x move jump fire while field is active
33% move jump fire always
vacuum bomb applies status effect to mobs that makes blocks attracted to them vacuum bomb applies status effect to mobs that makes blocks attracted to them