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
This commit is contained in:
landgreen
2020-11-25 05:00:09 -08:00
parent 313a9f861f
commit 0c319d3049
7 changed files with 82 additions and 49 deletions

View File

@@ -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),

View File

@@ -177,11 +177,10 @@ const build = {
}
},
pauseGrid() {
let text = `
<div class="pause-grid-module">
<span style="font-size:1.5em;font-weight: 600;">PAUSED</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; press P to resume
</div>
<div class="pause-grid-module" style = "font-size: 13px;line-height: 120%;padding: 5px;">
let text = ""
if (!game.isChoosing) text += `<div class="pause-grid-module">
<span style="font-size:1.5em;font-weight: 600;">PAUSED</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; press P to resume</div>
<div class="pause-grid-module" style = "font-size: 13px;line-height: 120%;padding: 5px;">
<strong class='color-d'>damage</strong> increase: ${((mod.damageFromMods()-1)*100).toFixed(0)}%
<br><strong class='color-harm'>harm</strong> reduction: ${((1-mech.harmReduction())*100).toFixed(0)}%
<br><strong>fire delay</strong> decrease: ${((1-b.fireCD)*100).toFixed(0)}%

View File

@@ -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 <strong>speeds</strong> reduces <strong class='color-harm'>harm</strong><br>by up to <strong>50%</strong>",
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 <strong>speeds</strong> increases <strong class='color-d'>damage</strong><br> by up to <strong>33%</strong>",
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: `<strong>immune</strong> to <strong class='color-harm'>harm</strong> for <strong>0.5</strong> seconds longer<br>after receiving <strong class='color-harm'>harm</strong> from a collision`,
@@ -2534,7 +2567,7 @@ const mod = {
},
{
name: "diffraction grating",
description: `your <strong>laser</strong> gains <strong>2 diverging</strong> beams<br>decrease laser <strong class='color-d'>damage</strong> by <strong>10%</strong>`,
description: `your <strong>laser</strong> gains <strong>2 diverging</strong> beams<br>decrease individual beam <strong class='color-d'>damage</strong> by <strong>10%</strong>`,
maxCount: 9,
count: 0,
allowed() {
@@ -2622,7 +2655,7 @@ const mod = {
}
},
remove() {
this.description = "<strong>laser</strong> beam is <strong>spread</strong> into your recent <strong>past</strong><br>increase total beam <strong class='color-d'>damage</strong> by <strong>200%</strong>"
this.description = "<strong>laser</strong> beam is <strong>spread</strong> into your recent <strong>past</strong><br>increase total laser <strong class='color-d'>damage</strong> by <strong>200%</strong>"
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
}

View File

@@ -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: "<strong class='color-cloaked'>cloak</strong> after not using your gun or field<br>while <strong class='color-cloaked'>cloaked</strong> mobs can't see you<br>increase <strong class='color-d'>damage</strong> by <strong>66%</strong>",
description: "<strong class='color-cloaked'>cloak</strong> after not using your gun or field<br>while <strong class='color-cloaked'>cloaked</strong> mobs can't see you<br>increase <strong class='color-d'>damage</strong> by <strong>111%</strong>",
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

View File

@@ -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

View File

@@ -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)

View File

@@ -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