From 0c319d3049fe42de83e1b507d25d6de2eaf80018 Mon Sep 17 00:00:00 2001 From: landgreen Date: Wed, 25 Nov 2020 05:00:09 -0800 Subject: [PATCH] pause menu on selection you can see your build while in the power up selection menu balance - metamaterial cloaking field gives 111% more damage (up from 66%) mod: Newton's 1st law - harm reduction when moving fast (thanks NoHaxJustPi) mod: Newton's 2nd law - damage increase while moving fast --- js/bullet.js | 14 +++++++------- js/index.js | 9 ++++----- js/mods.js | 47 +++++++++++++++++++++++++++++++++++++++++------ js/player.js | 15 ++++++++------- js/powerup.js | 2 ++ js/spawn.js | 6 +++--- todo.txt | 38 +++++++++++++++++--------------------- 7 files changed, 82 insertions(+), 49 deletions(-) diff --git a/js/bullet.js b/js/bullet.js index 960c2cc..e57cc1f 100644 --- a/js/bullet.js +++ b/js/bullet.js @@ -3362,21 +3362,21 @@ const b = { } else { mech.fireCDcycle = mech.cycle mech.energy -= mech.fieldRegen + mod.laserFieldDrain * mod.isLaserDiode - const dmg = 0.25 * mod.laserDamage // 3.5 * 0.55 = 200% more damage + const dmg = 0.5 * mod.laserDamage // 3.5 * 0.55 = 200% more damage ctx.strokeStyle = "#f00"; let spacing, len if (mod.wideLaser === 3) { ctx.lineWidth = 2 - spacing = 1 - len = 19 + mod.historyLaser * 10 + spacing = 2 + len = 10 + mod.historyLaser * 5 } else if (mod.wideLaser === 4) { ctx.lineWidth = 3 spacing = 1 - len = 29 + mod.historyLaser * 10 + len = 15 + mod.historyLaser * 5 } else { ctx.lineWidth = 1 - spacing = 3 - len = 9 + mod.historyLaser * 10 + spacing = 5 + len = 5 + mod.historyLaser * 5 } ctx.beginPath(); b.laser({ @@ -3386,7 +3386,7 @@ const b = { x: mech.pos.x + 3000 * Math.cos(mech.angle), y: mech.pos.y + 3000 * Math.sin(mech.angle) }, dmg, 0, true); - for (let i = 0; i < len; i++) { + for (let i = 1; i < len; i++) { const history = mech.history[(mech.cycle - i * spacing) % 300] b.laser({ x: history.position.x + 20 * Math.cos(history.angle), diff --git a/js/index.js b/js/index.js index f9cd0f4..654628b 100644 --- a/js/index.js +++ b/js/index.js @@ -177,11 +177,10 @@ const build = { } }, pauseGrid() { - let text = ` -
- PAUSED               press P to resume -
-
+ let text = "" + if (!game.isChoosing) text += `
+ PAUSED               press P to resume
+
damage increase: ${((mod.damageFromMods()-1)*100).toFixed(0)}%
harm reduction: ${((1-mech.harmReduction())*100).toFixed(0)}%
fire delay decrease: ${((1-b.fireCD)*100).toFixed(0)}% diff --git a/js/mods.js b/js/mods.js index 0b94be1..b72270b 100644 --- a/js/mods.js +++ b/js/mods.js @@ -95,6 +95,7 @@ const mod = { if (mod.isRerollDamage) dmg *= 1 + 0.04 * powerUps.reroll.rerolls if (mod.isOneGun && b.inventory.length < 2) dmg *= 1.25 if (mod.isNoFireDamage && mech.cycle > mech.fireCDcycle + 120) dmg *= 1.5 + if (mod.isSpeedDamage) dmg *= 1 + Math.min(0.33, player.speed * 0.011) return dmg * mod.slowFire * mod.aimDamage }, totalBots() { @@ -818,6 +819,38 @@ const mod = { mech.setMovement() } }, + { + name: "Newton's 1st law", + description: "moving at high speeds reduces harm
by up to 50%", + maxCount: 1, + count: 0, + allowed() { + return mech.Fx > 0.016 + }, + requires: "speed increase", + effect() { + mod.isSpeedHarm = true + }, + remove() { + mod.isSpeedHarm = false + } + }, + { + name: "Newton's 2nd law", + description: "moving at high speeds increases damage
by up to 33%", + maxCount: 1, + count: 0, + allowed() { + return mech.Fx > 0.016 + }, + requires: "speed increase", + effect() { + mod.isSpeedDamage = true + }, + remove() { + mod.isSpeedDamage = false + } + }, { name: "Pauli exclusion", description: `immune to harm for 0.5 seconds longer
after receiving harm from a collision`, @@ -2534,7 +2567,7 @@ const mod = { }, { name: "diffraction grating", - description: `your laser gains 2 diverging beams
decrease laser damage by 10%`, + description: `your laser gains 2 diverging beams
decrease individual beam damage by 10%`, maxCount: 9, count: 0, allowed() { @@ -2622,7 +2655,7 @@ const mod = { } }, remove() { - this.description = "laser beam is spread into your recent past
increase total beam damage by 200%" + this.description = "laser beam is spread into your recent past
increase total laser damage by 200%" mod.historyLaser = 0 for (i = 0, len = b.guns.length; i < len; i++) { //find which gun if (b.guns[i].name === "laser") b.guns[i].chooseFireMethod() @@ -2885,7 +2918,7 @@ const mod = { }, requires: "standing wave harmonics", effect() { - mod.blockDmg += 0.7 //if you change this value also update the for loop in the electricity graphics in mech.pushMass + mod.blockDmg += 0.75 //if you change this value also update the for loop in the electricity graphics in mech.pushMass }, remove() { mod.blockDmg = 0; @@ -2901,8 +2934,8 @@ const mod = { }, requires: "standing wave harmonics", effect() { - mech.fieldRange += 175 * 0.17 - mech.fieldShieldingScale *= 0.6 + mech.fieldRange += 175 * 0.2 + mech.fieldShieldingScale *= 0.55 }, remove() { mech.fieldRange = 175; @@ -3359,5 +3392,7 @@ const mod = { overfillDrain: null, isNeutronSlow: null, isRailAreaDamage: null, - historyLaser: null + historyLaser: null, + isSpeedHarm: null, + isSpeedDamage: null } \ No newline at end of file diff --git a/js/player.js b/js/player.js index 2e82147..fee5509 100644 --- a/js/player.js +++ b/js/player.js @@ -135,6 +135,11 @@ const mech = { transY: 0, history: [], //tracks the last second of player position move() { + mech.pos.x = player.position.x; + mech.pos.y = playerBody.position.y - mech.yOff; + mech.Vx = player.velocity.x; + mech.Vy = player.velocity.y; + //tracks the last second of player information // console.log(mech.history) mech.history.splice(mech.cycle % 300, 1, { @@ -152,11 +157,6 @@ const mech = { }); // const back = 59 // 59 looks at 1 second ago //29 looks at 1/2 a second ago // historyIndex = (mech.cycle - back) % 60 - - mech.pos.x = player.position.x; - mech.pos.y = playerBody.position.y - mech.yOff; - mech.Vx = player.velocity.x; - mech.Vy = player.velocity.y; }, transSmoothX: 0, transSmoothY: 0, @@ -459,6 +459,7 @@ const mech = { harmReduction() { let dmg = 1 dmg *= mech.fieldHarmReduction + if (mod.isSpeedHarm) dmg *= 1 - Math.min(player.speed * 0.018, 0.5) if (mod.isSlowFPS) dmg *= 0.85 if (mod.isPiezo) dmg *= 0.85 if (mod.isHarmReduce && mech.fieldUpgrades[mech.fieldMode].name === "negative mass field" && mech.isFieldActive) dmg *= 0.6 @@ -1768,13 +1769,13 @@ const mech = { }, { name: "metamaterial cloaking", //"weak photonic coupling" "electromagnetically induced transparency" "optical non-coupling" "slow light field" "electro-optic transparency" - description: "cloak after not using your gun or field
while cloaked mobs can't see you
increase damage by 66%", + description: "cloak after not using your gun or field
while cloaked mobs can't see you
increase damage by 111%", effect: () => { mech.fieldFire = true; mech.fieldMeterColor = "#fff"; mech.fieldPhase = 0; mech.isCloak = false - mech.fieldDamage = 1.66 + mech.fieldDamage = 2.11 // 1 + 111/100 mech.fieldDrawRadius = 0 const drawRadius = 1000 diff --git a/js/powerup.js b/js/powerup.js index d734d96..13f75be 100644 --- a/js/powerup.js +++ b/js/powerup.js @@ -33,6 +33,7 @@ const powerUps = { } game.paused = true; game.isChoosing = true; //stops p from un pausing on key down + build.pauseGrid() }, endDraft() { if (mod.manyWorlds && powerUps.reroll.rerolls < 1) { @@ -42,6 +43,7 @@ const powerUps = { document.getElementById("choose-background").style.display = "none" document.body.style.cursor = "none"; document.body.style.overflow = "hidden" + build.unPauseGrid() game.paused = false; game.isChoosing = false; //stops p from un pausing on key down mech.immuneCycle = mech.cycle + 60; //player is immune to collision damage for 30 cycles diff --git a/js/spawn.js b/js/spawn.js index f9a25c1..2f3d2c2 100644 --- a/js/spawn.js +++ b/js/spawn.js @@ -94,7 +94,7 @@ const spawn = { me.frictionAir = 0.01; me.memory = Infinity; me.locatePlayer(); - const density = 1 + const density = 0.95 Matter.Body.setDensity(me, density); //extra dense //normal is 0.001 //makes effective life much larger // spawn.shield(me, x, y, 1); me.onDeath = function() { @@ -104,7 +104,7 @@ const spawn = { }; me.onDamage = function() {}; me.cycle = 420; - me.endCycle = 720; + me.endCycle = 780; me.mode = 0; me.do = function() { Matter.Body.setPosition(this, { //hold position @@ -173,7 +173,7 @@ const spawn = { this.modeSuck() this.modeLasers() } - me.spawnInterval = 362 + me.spawnInterval = 395 me.modeSpawns = function() { if (!(this.cycle % this.spawnInterval) && !mech.isBodiesAsleep && mob.length < 40) { if (this.mode !== 3) Matter.Body.setAngularVelocity(this, 0.1) diff --git a/todo.txt b/todo.txt index 81395e8..9297561 100644 --- a/todo.txt +++ b/todo.txt @@ -1,15 +1,14 @@ *********** NEXT PATCH *********** +you can see your build while in the power up selection menu +balance - metamaterial cloaking field gives 111% more damage (up from 66%) -balance: mod capacitor - gives 1% damage for every 7% energy (was 5.5%) -some fixes on community level detour -added a once every 7 second check to try to undo the crouch bug - (I have no idea how to crouch bug is happening, so I can't even test this fix) - -mod: slow light propagation - laser is divided into your past, and increase total damage by 200% - let me know about balance (is this too strong or too weak) +mod: Newton's 1st law - harm reduction when moving fast (thanks NoHaxJustPi) +mod: Newton's 2nd law - damage increase while moving fast ************** BUGS ************** +(always) make it so that when you are immune to harm you can either jump on mobs or you pass through them + (4+ reports before potential fix) bug - crouch and worm hole? -> crouch locked in players have extra gravity might be from the short jump code @@ -25,11 +24,17 @@ mod: slow light propagation - laser is divided into your past, and increase tota ************** TODO ************** - mod - if you take damage and you have full energy remove your energy and go back in time 1 second - for time dilation field? - check to see if your previous location is clear or mobs, blocks - go back proportional to your energy - pause game, switch the game.loop to cycle backwards in player position until energy runs out + +time dilation - slow down the game engine by 1/2, but run an extra player cycle to simulate slow motion + +flavor - your bullets destroy blocks + this isn't really a bonus, so maybe just add this as flavor to another mod/field + +mod - if you take damage and you have full energy remove your energy and go back in time 1 second + for time dilation field? + check to see if your previous location is clear or mobs, blocks + go back proportional to your energy + pause game, switch the game.loop to cycle backwards in player position until energy runs out mod plasma : plasma length increases then decreases as you hold down the field button (like stabbing with a spear) grows to 1.5 longer after 0.3 seconds, then returns to normal length over 1 second, until field is pressed again @@ -47,12 +52,8 @@ mod laser history or double thickness beam technology - player data logging - mod/field - pressing field while crouched sends the player back in time mod for time dilation? - mod - When you fire your laser also fire from where you were 1/2 a second in the past - stacking mod each stack produces another laser from farther in the past - drains extra energy could be used in mob targeting build a new type of attraction for mobs if mobs can't see player, they check to see if they can see where the player was in the history @@ -66,8 +67,6 @@ using a reroll gives 3 options for mods, and 3 options for guns/fields/mods adjust css to make 2 columns of 3 can't use with cardinality -Laser mod: For each reflection of laser, damage increases by 10% - new power up - increase damage and fire speed, for 15 seconds named boost? enabled by a mod? @@ -93,9 +92,6 @@ add an ending to the game Mod: "Solar Power": Energy regeneration is doubled while standing still run in the 1 second check -mod: take less harm if you are in the air - require squirrel cage rotor - mechanic - remove a random mod as a condition for picking up a really good mod mechanic - do something for 2 seconds after firing