diff --git a/js/bullet.js b/js/bullet.js index 4fa4ded..cb4071f 100644 --- a/js/bullet.js +++ b/js/bullet.js @@ -76,13 +76,17 @@ const b = { } }, fireProps(cd, speed, dir, me) { - mech.fireCDcycle = mech.cycle + Math.floor(cd * mod.fireRate); // cool down + mech.fireCDcycle = mech.cycle + Math.floor(cd * b.fireCD); // cool down Matter.Body.setVelocity(bullet[me], { x: mech.Vx / 2 + speed * Math.cos(dir), y: mech.Vy / 2 + speed * Math.sin(dir) }); World.add(engine.world, bullet[me]); //add bullet to world }, + fireCD: 1, + setFireCD() { + b.fireCD = mod.fireRate * mod.slowFire * (mod.isTimeSkip ? 0.66 : 1) + }, fireAttributes(dir, rotate = true) { if (rotate) { return { @@ -1216,13 +1220,13 @@ const b = { fire() { let knock, spread if (mech.crouch) { - mech.fireCDcycle = mech.cycle + Math.floor(55 * mod.fireRate); // cool down - if (mod.isShotgunImmune) mech.immuneCycle = mech.cycle + Math.floor(55 * mod.fireRate); //player is immune to collision damage for 30 cycles + mech.fireCDcycle = mech.cycle + Math.floor(55 * b.fireCD); // cool down + if (mod.isShotgunImmune) mech.immuneCycle = mech.cycle + Math.floor(55 * b.fireCD); //player is immune to collision damage for 30 cycles spread = 0.75 knock = 0.01 * mod.bulletSize * mod.bulletSize } else { - mech.fireCDcycle = mech.cycle + Math.floor(45 * mod.fireRate); // cool down - if (mod.isShotgunImmune) mech.immuneCycle = mech.cycle + Math.floor(45 * mod.fireRate); //player is immune to collision damage for 30 cycles + mech.fireCDcycle = mech.cycle + Math.floor(45 * b.fireCD); // cool down + if (mod.isShotgunImmune) mech.immuneCycle = mech.cycle + Math.floor(45 * b.fireCD); //player is immune to collision damage for 30 cycles spread = 1.3 knock = 0.08 * mod.bulletSize * mod.bulletSize } @@ -1281,7 +1285,7 @@ const b = { isEasyToAim: true, fire() { const SPEED = mech.crouch ? 40 : 30 - mech.fireCDcycle = mech.cycle + Math.floor((mech.crouch ? 28 : 20) * mod.fireRate); // cool down + mech.fireCDcycle = mech.cycle + Math.floor((mech.crouch ? 28 : 20) * b.fireCD); // cool down if (mod.oneSuperBall) { let dir = mech.angle const me = bullet.length; @@ -1415,7 +1419,7 @@ const b = { this.lastFireCycle = mech.cycle if (this.count > ((mech.crouch) ? 7 : 1)) { this.count = 0 - mech.fireCDcycle = mech.cycle + Math.floor(CD * mod.fireRate); // cool down + mech.fireCDcycle = mech.cycle + Math.floor(CD * b.fireCD); // cool down const who = bullet[bullet.length - 1] Matter.Body.setDensity(who, 0.00001); @@ -1442,7 +1446,7 @@ const b = { } else { this.count++ - mech.fireCDcycle = mech.cycle + Math.floor(3 * mod.fireRate); // cool down + mech.fireCDcycle = mech.cycle + Math.floor(3 * b.fireCD); // cool down } @@ -1457,7 +1461,7 @@ const b = { isStarterGun: true, isEasyToAim: false, fire() { - mech.fireCDcycle = mech.cycle + Math.floor(3 * mod.fireRate); // cool down + mech.fireCDcycle = mech.cycle + Math.floor(3 * b.fireCD); // cool down const dir = mech.angle const SPEED = 10 let wiggleMag @@ -1598,7 +1602,7 @@ const b = { fire() { if (mod.is3Missiles) { if (mech.crouch) { - mech.fireCDcycle = mech.cycle + 60 * mod.fireRate; // cool down + mech.fireCDcycle = mech.cycle + 60 * b.fireCD; // cool down const direction = { x: Math.cos(mech.angle), y: Math.sin(mech.angle) @@ -1614,7 +1618,7 @@ const b = { bullet[bullet.length - 1].force.y += push.y * (i - 1); } } else { - mech.fireCDcycle = mech.cycle + 45 * mod.fireRate; // cool down + mech.fireCDcycle = mech.cycle + 45 * b.fireCD; // cool down const direction = { x: Math.cos(mech.angle), y: Math.sin(mech.angle) @@ -1631,13 +1635,13 @@ const b = { } } } else { - mech.fireCDcycle = mech.cycle + Math.floor(mech.crouch ? 45 : 30) * mod.fireRate; // cool down + mech.fireCDcycle = mech.cycle + Math.floor(mech.crouch ? 45 : 30) * b.fireCD; // cool down b.missile({ x: mech.pos.x + 40 * Math.cos(mech.angle), y: mech.pos.y + 40 * Math.sin(mech.angle) - 3 }, mech.angle + (0.5 - Math.random()) * (mech.crouch ? 0 : 0.2), - -3 * (0.5 - Math.random()) + (mech.crouch ? 25 : -8) * mod.fireRate, + -3 * (0.5 - Math.random()) + (mech.crouch ? 25 : -8) * b.fireCD, 1, mod.babyMissiles) bullet[bullet.length - 1].force.y += 0.0006; //a small push down at first to make it seem like the missile is briefly falling } @@ -1653,7 +1657,7 @@ const b = { isStarterGun: true, isEasyToAim: false, fire() { - mech.fireCDcycle = mech.cycle + Math.floor((mech.crouch ? 25 : 10) * mod.fireRate); // cool down + mech.fireCDcycle = mech.cycle + Math.floor((mech.crouch ? 25 : 10) * b.fireCD); // cool down b.muzzleFlash(30); const SPEED = mech.crouch ? 29 : 25 const END = Math.floor(mech.crouch ? 30 : 18); @@ -2043,7 +2047,7 @@ const b = { x: speed * Math.cos(mech.angle), y: speed * Math.sin(mech.angle) }, 0, mod.isMineAmmoBack) - mech.fireCDcycle = mech.cycle + Math.floor((mech.crouch ? 70 : 45) * mod.fireRate); // cool down + mech.fireCDcycle = mech.cycle + Math.floor((mech.crouch ? 70 : 45) * b.fireCD); // cool down } }, { @@ -2173,7 +2177,7 @@ const b = { isEasyToAim: true, fire() { b.drone(mech.crouch ? 45 : 1) - mech.fireCDcycle = mech.cycle + Math.floor((mech.crouch ? 13 : 5) * mod.fireRate); // cool down + mech.fireCDcycle = mech.cycle + Math.floor((mech.crouch ? 13 : 5) * b.fireCD); // cool down } }, { @@ -2187,10 +2191,10 @@ const b = { fire() { if (mech.crouch) { b.iceIX(10, 0.3) - mech.fireCDcycle = mech.cycle + Math.floor(10 * mod.fireRate); // cool down + mech.fireCDcycle = mech.cycle + Math.floor(10 * b.fireCD); // cool down } else { b.iceIX(2) - mech.fireCDcycle = mech.cycle + Math.floor(3 * mod.fireRate); // cool down + mech.fireCDcycle = mech.cycle + Math.floor(3 * b.fireCD); // cool down } } @@ -2204,7 +2208,7 @@ const b = { isStarterGun: true, isEasyToAim: false, fire() { - mech.fireCDcycle = mech.cycle + Math.floor((mech.crouch ? 20 : 6) * mod.fireRate); // cool down + mech.fireCDcycle = mech.cycle + Math.floor((mech.crouch ? 20 : 6) * b.fireCD); // cool down const radius = mech.crouch ? 10 + 7 * Math.random() : 4 + 6 * Math.random() //(4 + (mech.crouch ? 15 : 6) * Math.random()) const dir = mech.angle + 0.2 * (Math.random() - 0.5) const position = { @@ -2333,7 +2337,7 @@ const b = { mech.fireCDcycle = Infinity //can't fire until mouse is released const lastCharge = this.charge let chargeRate = (mech.crouch) ? 0.975 : 0.987 - chargeRate *= Math.pow(mod.fireRate, 0.04) + chargeRate *= Math.pow(b.fireCD, 0.04) this.charge = this.charge * chargeRate + (1 - chargeRate) // this.charge converges to 1 mech.energy -= (this.charge - lastCharge) * 0.28 //energy drain is proportional to charge gained, but doesn't stop normal mech.fieldRegen @@ -2694,7 +2698,7 @@ const b = { const energy = 0.3 * Math.min(mech.energy, 1.75) mech.energy -= energy * mod.isLaserDiode if (best.who) b.explosion(path[1], 1000 * energy, true) - mech.fireCDcycle = mech.cycle + Math.floor(60 * mod.fireRate); // cool down + mech.fireCDcycle = mech.cycle + Math.floor(60 * b.fireCD); // cool down if (mod.isPulseStun) { const range = 100 + 2000 * energy diff --git a/js/game.js b/js/game.js index c4eb2e7..0110313 100644 --- a/js/game.js +++ b/js/game.js @@ -497,6 +497,7 @@ const game = { b.activeGun = null; mod.setupAllMods(); //sets mods to default values + b.setFireCD(); game.updateModHUD(); powerUps.reroll.rerolls = 0; mech.maxHealth = 1 diff --git a/js/mods.js b/js/mods.js index ddc0279..6816e1e 100644 --- a/js/mods.js +++ b/js/mods.js @@ -77,7 +77,7 @@ const mod = { if (mod.isRest && player.speed < 1) dmg *= 1.20; if (mod.isEnergyDamage) dmg *= 1 + mech.energy / 5.5; if (mod.isDamageFromBulletCount) dmg *= 1 + bullet.length * 0.007 - return dmg + return dmg * mod.slowFire }, onHealthChange() { //used with acid mod if (mod.isAcidDmg && mech.health > 0.8) { @@ -227,7 +227,7 @@ const mod = { }, { name: "auto-loading heuristics", - description: "your delay after firing is +15% shorter", + description: "+20% decreased delay after firing", maxCount: 9, count: 0, allowed() { @@ -235,10 +235,29 @@ const mod = { }, requires: "", effect() { - mod.fireRate *= 0.85 + mod.fireRate *= 0.8 + b.setFireCD(); }, remove() { mod.fireRate = 1; + b.setFireCD(); + } + }, + { + name: "electrostatic shots", + description: "33% increased damage
33% increased delay after firing", + maxCount: 1, + count: 0, + allowed() { + return true + }, + effect() { + mod.slowFire = 1.33 + b.setFireCD(); + }, + remove() { + mod.slowFire = 1; + b.setFireCD(); } }, { @@ -1592,7 +1611,7 @@ const mod = { }, { name: "timelike world line", - description: "time dilation increases your time rate by 2x
while energy drain is decreased by 2x", + description: "time dilation increases your time rate by 2x
33% decreased delay after firing", maxCount: 1, count: 0, allowed() { @@ -1601,9 +1620,11 @@ const mod = { requires: "time dilation field", effect() { mod.isTimeSkip = true; + b.setFireCD(); }, remove() { mod.isTimeSkip = false; + b.setFireCD(); } }, { @@ -1889,5 +1910,6 @@ const mod = { manyWorlds: null, isDamageFromBulletCount: null, isLaserDiode: null, - isNailShot: null + isNailShot: null, + slowFire: null } \ No newline at end of file diff --git a/js/player.js b/js/player.js index b3b41da..238655a 100644 --- a/js/player.js +++ b/js/player.js @@ -1340,7 +1340,7 @@ const mech = { y: mech.pos.y + 40 * Math.sin(mech.angle) - 3 }, mech.angle + (0.5 - Math.random()) * (mech.crouch ? 0 : 0.2), - -3 * (0.5 - Math.random()) + (mech.crouch ? 25 : -8) * mod.fireRate, + -3 * (0.5 - Math.random()) + (mech.crouch ? 25 : -8) * b.fireCD, 1, mod.babyMissiles) } else if (mod.isIceField) { // mech.fieldCDcycle = mech.cycle + 17; // set cool down to prevent +energy from making huge numbers of drones @@ -1747,7 +1747,7 @@ const mech = { // mech.draw(); mech.walk_cycle += mech.flipLegs * mech.Vx; // mech.hold(); - mech.energy += 0.5 * DRAIN; //x1 to undo the energy drain from time speed up, x1.5 to cut energy drain in half + mech.energy += DRAIN; // 1 to undo the energy drain from time speed up, 0.5 to cut energy drain in half b.fire(); // b.bulletRemove(); b.bulletDo(); diff --git a/todo.txt b/todo.txt index f70def1..82e9914 100644 --- a/todo.txt +++ b/todo.txt @@ -1,10 +1,7 @@ -above level 20 boss power ups only drop on even levels -removed mod ablative mines (was buggy, and too similar to ablative drones) -flechettes get stuck in walls -flechettes do no damage to mobs on hit -flechettes do more damage over time, and have more ammo -mod - flechettes pierce mobs -mod - mutualism: each spore does 2x damage but they borrow 1% life from player + +mod - electrostatic shots: 33 increased damage and 33% increased delay after firing +mod - time-like world line now also gives 33% reduced delay after firing (even when the field isn't active) +mod auto-loading heuristics now gives 20% reduced delay after firing (up from 15%) ************** TODO - n-gon **************