diff --git a/index.html b/index.html index 0ce53a3..15483fc 100644 --- a/index.html +++ b/index.html @@ -11,7 +11,7 @@ - + n-gon diff --git a/js/level.js b/js/level.js index 18e9fa1..1d9c42b 100644 --- a/js/level.js +++ b/js/level.js @@ -229,7 +229,7 @@ const level = { difficultyIncrease(num = 1) { for (let i = 0; i < num; i++) { simulation.difficulty++ - m.dmgScale *= 0.905; //damage done by player decreases each level + m.dmgScale *= 0.9; //damage done by player decreases each level if (simulation.accelScale < 6) simulation.accelScale *= 1.024 //mob acceleration increases each level if (simulation.CDScale > 0.15) simulation.CDScale *= 0.964 //mob CD time decreases each level } @@ -240,7 +240,7 @@ const level = { difficultyDecrease(num = 1) { //used in easy mode for simulation.reset() for (let i = 0; i < num; i++) { simulation.difficulty-- - m.dmgScale /= 0.905; //damage done by player decreases each level + m.dmgScale /= 0.9; //damage done by player decreases each level if (simulation.accelScale > 1) simulation.accelScale /= 1.024 //mob acceleration increases each level if (simulation.CDScale < 1) simulation.CDScale /= 0.964 //mob CD time decreases each level } diff --git a/js/player.js b/js/player.js index bda442f..66d2136 100644 --- a/js/player.js +++ b/js/player.js @@ -1627,7 +1627,7 @@ const m = { ctx.lineTo(m.knee.x, m.knee.y); ctx.lineTo(m.foot.x, m.foot.y); ctx.strokeStyle = stroke; - ctx.lineWidth = 6 + 2 * Math.sin(m.cycle * 0.0075 + Math.PI); + ctx.lineWidth = 6 + 2 * Math.sin(m.cycle * 0.01 + Math.PI); ctx.stroke(); //toe lines @@ -1650,7 +1650,7 @@ const m = { ctx.arc(m.foot.x, m.foot.y, 6, 0, 2 * Math.PI); ctx.fillStyle = "#345"; ctx.fill(); - ctx.lineWidth = 3 + 3 * Math.sin(m.cycle * 0.0075 + Math.PI); + ctx.lineWidth = 3 + 3 * Math.sin(m.cycle * 0.01 + Math.PI); ctx.stroke(); ctx.restore(); } diff --git a/js/tech.js b/js/tech.js index a03faf4..b265f58 100644 --- a/js/tech.js +++ b/js/tech.js @@ -2,7 +2,6 @@ const tech = { totalCount: null, removeCount: 0, setupAllTech() { - tech.damage = 1 for (let i = 0, len = tech.tech.length; i < len; i++) { tech.tech[i].isLost = false tech.tech[i].isBanished = false @@ -29,9 +28,8 @@ const tech = { } } } - // tech.removeJunkTechFromPool(); - // tech.removeLoreTechFromPool(); - // tech.addLoreTechToPool(); + + tech.damage = 1 tech.junkChance = 0; tech.extraMaxHealth = 0; tech.totalCount = 0; @@ -255,7 +253,7 @@ const tech = { return dmg }, duplicationChance() { - return Math.min(1, Math.max(0, (tech.isPowerUpsVanish ? 0.13 : 0) + (tech.isStimulatedEmission ? 0.17 : 0) + tech.duplication + tech.duplicateChance + 0.05 * tech.isExtraGunField + m.duplicateChance + tech.fieldDuplicate + 0.08 * tech.isDuplicateMobs + tech.cloakDuplication + (tech.isAnthropicTech && tech.isDeathAvoidedThisLevel ? 0.6 : 0))) + return Math.min(1, Math.max(0, (tech.isPowerUpsVanish ? 0.13 : 0) + (tech.isStimulatedEmission ? 0.2 : 0) + tech.duplication + tech.duplicateChance + 0.05 * tech.isExtraGunField + m.duplicateChance + tech.fieldDuplicate + 0.08 * tech.isDuplicateMobs + tech.cloakDuplication + (tech.isAnthropicTech && tech.isDeathAvoidedThisLevel ? 0.6 : 0))) }, isScaleMobsWithDuplication: false, maxDuplicationEvent() { @@ -404,7 +402,7 @@ const tech = { tech.isCollisionRealitySwitch = true; }, remove() { - if (this.count) tech.damage /= this.damage + if (this.count && m.alive) tech.damage /= this.damage tech.isCollisionRealitySwitch = false; } }, @@ -431,7 +429,7 @@ const tech = { }, { name: "diaphragm", - description: "every 6 seconds your damage taken cycles
between 0.9x and 0.2x damage taken", + description: "every 4 seconds your damage taken cycles
between 0.9x and 0.2x damage taken", maxCount: 1, count: 0, frequency: 2, @@ -649,7 +647,7 @@ const tech = { }, { name: "ordnance", - description: "2x guntech frequency
spawn a gun and +6% JUNKtech chance", + description: "spawn a gun, gain 2x guntech frequency
+6% JUNKtech chance", maxCount: 1, count: 0, frequency: 1, @@ -795,7 +793,7 @@ const tech = { { name: "applied science", description: `get a random guntech
for each of your guns`, //spawn ${powerUps.orb.research(1)} and - maxCount: 9, + maxCount: 1, count: 0, isNonRefundable: true, frequency: 2, @@ -843,10 +841,11 @@ const tech = { { name: "supply chain", descriptionFunction() { - return `2x current ammo for all your guns
3x applied science frequency` + return `spawn a gun
spawn 2x current ${powerUps.orb.ammo(1)}` }, maxCount: 9, count: 0, + isNonRefundable: true, frequency: 1, frequencyDefault: 1, allowed() { @@ -854,27 +853,36 @@ const tech = { }, requires: "", effect() { + //count ammo + let ammoCount = 0 for (let i = 0; i < b.guns.length; i++) { - if (b.guns[i].have) b.guns[i].ammo = Math.floor(2 * b.guns[i].ammo) - } - simulation.makeGunHUD(); - for (let i = 0, len = tech.tech.length; i < len; i++) { - if (tech.tech[i].name === "applied science") tech.tech[i].frequency *= 3 + if (b.guns[i].have && b.guns[i].ammo !== Infinity) ammoCount += b.guns[i].ammo / b.guns[i].ammoPack } + console.log(ammoCount) + powerUps.spawnDelay("ammo", Math.ceil(ammoCount)) + powerUps.spawn(m.pos.x, m.pos.y, "gun"); + // powerUps.spawnDelay("coupling", m.coupling * 2) + // for (let i = 0; i < b.guns.length; i++) { + // if (b.guns[i].have) b.guns[i].ammo = Math.floor(2 * b.guns[i].ammo) + // } + // simulation.makeGunHUD(); + // for (let i = 0, len = tech.tech.length; i < len; i++) { + // if (tech.tech[i].name === "applied science") tech.tech[i].frequency *= 4 + // } }, remove() { - if (this.count) { - for (let j = 0; j < this.count; j++) { - for (let i = 0; i < b.guns.length; i++) { - if (b.guns[i].have) b.guns[i].ammo = Math.floor(0.5 * b.guns[i].ammo) - } - } - simulation.makeGunHUD(); - - for (let i = 0, len = tech.tech.length; i < len; i++) { - if (tech.tech[i].name === "applied science") tech.tech[i].frequency = 2 - } - } + // if (this.count) { + // m.couplingChange(-this.count * 10) + // for (let j = 0; j < this.count; j++) { + // for (let i = 0; i < b.guns.length; i++) { + // if (b.guns[i].have) b.guns[i].ammo = Math.floor(0.5 * b.guns[i].ammo) + // } + // } + // simulation.makeGunHUD(); + // for (let i = 0, len = tech.tech.length; i < len; i++) { + // if (tech.tech[i].name === "applied science") tech.tech[i].frequency = 2 + // } + // } } }, { @@ -1020,7 +1028,7 @@ const tech = { tech.isEnergyNoAmmo = true; }, remove() { - if (this.count) tech.damage /= this.damage + if (this.count && m.alive) tech.damage /= this.damage tech.isEnergyNoAmmo = false; } }, @@ -1136,7 +1144,7 @@ const tech = { this.damageSoFar.push(damage) }, remove() { - for (let i = 0; i < this.damageSoFar.length; i++) tech.damage /= this.damageSoFar[i] + if (this.count && m.alive) for (let i = 0; i < this.damageSoFar.length; i++) tech.damage /= this.damageSoFar[i] this.damageSoFar.length = 0 } }, @@ -1271,7 +1279,7 @@ const tech = { b.setFireCD(); }, remove() { - if (this.count) tech.damage /= this.damage + if (this.count && m.alive) tech.damage /= this.damage tech.slowFire = 1; b.setFireCD(); } @@ -1302,7 +1310,7 @@ const tech = { }, remove() { tech.isCloakingDamage = false - if (this.count > 0) { + if (this.count && m.alive) { tech.damage /= this.damage powerUps.research.changeRerolls(2) } @@ -2851,7 +2859,7 @@ const tech = { m.setMaxEnergy() }, remove() { - if (this.count) tech.damage /= this.damage + if (this.count && m.alive) tech.damage /= this.damage tech.isMaxEnergyTech = false; m.setMaxEnergy() } @@ -2873,7 +2881,7 @@ const tech = { tech.isEnergyLoss = true; }, remove() { - if (this.count) tech.damage /= this.damage + if (this.count && m.alive) tech.damage /= this.damage tech.isEnergyLoss = false; } }, @@ -3154,7 +3162,7 @@ const tech = { tech.isTechDamage = true; }, remove() { - if (this.count) tech.damage /= this.damage + if (this.count && m.alive) tech.damage /= this.damage tech.isTechDamage = false; } }, @@ -3184,7 +3192,7 @@ const tech = { } }, remove() { - if (this.count) { + if (this.count && m.alive) { tech.damage /= this.damage for (let i = 0; i < powerUp.length; i++) { if (powerUp[i].name === "heal") { @@ -3745,7 +3753,7 @@ const tech = { tech.isNoDraftPause = true }, remove() { - if (this.count) tech.damage /= this.damage + if (this.count && m.alive) tech.damage /= this.damage tech.isNoDraftPause = false } }, @@ -3807,9 +3815,7 @@ const tech = { refundAmount: 0, remove() { tech.extraChoices = 0; - if (this.count > 0) { - tech.damage /= this.damage - } + if (this.count && m.alive) tech.damage /= this.damage } }, { @@ -3940,7 +3946,7 @@ const tech = { }, refundAmount: 0, remove() { - if (this.count > 0) { + if (this.count && m.alive) { tech.damage /= this.damage if (this.refundAmount > 0) tech.removeJunkTechFromPool(this.refundAmount) } @@ -4410,7 +4416,7 @@ const tech = { }, { name: "stimulated emission", - description: "+19% chance to duplicate spawned power ups,
collisions eject a random tech", + description: "+20% chance to duplicate spawned power ups,
collisions eject a random tech", maxCount: 1, count: 0, frequency: 1, @@ -4682,7 +4688,7 @@ const tech = { tech.damage *= (1 + this.damage) }, remove() { - if (this.count) tech.damage /= (1 + this.damage) + if (this.count && m.alive) tech.damage /= (1 + this.damage) } }, { @@ -8247,7 +8253,7 @@ const tech = { b.setFireCD(); }, remove() { - if (this.count) tech.damage /= this.damage + if (this.count && m.alive) tech.damage /= this.damage tech.aimDamage = 1 b.setFireCD(); } @@ -9229,7 +9235,7 @@ const tech = { tech.damage *= this.damage }, remove() { - if (this.count > 0) tech.damage /= this.damage + if (this.count && m.alive) tech.damage /= this.damage } }, { diff --git a/todo.txt b/todo.txt index f17a915..92b2a01 100644 --- a/todo.txt +++ b/todo.txt @@ -1,32 +1,17 @@ ******************************************************** NEXT PATCH ************************************************** -added CSS style for "remove/eject" keyword -tech: deprecated - gain 1.05x damage for each tech removed this game -tech: externality - 1.1x damage, removing this gives 40 ammo power ups -paradigm shift no longer has a 3% failure rate - minus 3->4 health - it can remove applied science tech -removing strange loop gives a random removetech +switched github pages hosting folder + https://landgreen.github.io/sidescroller/ -> https://landgreen.github.io/n-gon/ + -tech: marginal utility - give a specific gun 2x ammo per ammo power up -tech: interest - research, ammo, coupling, health increases by 6% at the start of each level -tech: Pareto efficiency - give each gun randomly 5x or 0.2x ammo per ammo power up +player damage reduction adjustment: 0.905x -> 0.9x per level per difficulty mode (1,2,4,5) + on easy that's 0.30 -> 0.28 by level 12 (a 6% player damage nerf) + on why that's 0.0025 -> 0.001797 by level 12 (a 28% player damage nerf) -aperture 6->4s cycles between 1 to 2 -> 0.8 to 3 damage -mass-energy no longer has a reduction in defense effects - but it costs 2 research now -1st ionization energy 11->14 max energy per heal -colony: 1.5->1.6x spores 40->33% chance to spawn something different -laser cost formula changed to be independent of field regen - this makes the effects of cost and fire rate 33% bigger - free-electron laser 3.5->3x energy cost -options exchange - the first time you click cancel it randomizes choices - allows a free trigger from other cancel tech -pseudoscience gets 3->2 free researches -alternator harpoon has 0->0.03x energy cost -coupling for pilot wave gives 1.04->1.05x block damage +you can only get applied science 9->1 time +supply chain - spawns a gun, but doesn't give applied science frequency -several bugs fixes +bug fixes *********************************************************** TODO *****************************************************