perpetual mods

4 new mods: perpetual ammo/rerolls/heals - get that power up at the start of each level
            also perpetual stun: stuns all mobs for 8 seconds at the start
This commit is contained in:
landgreen
2020-11-27 17:20:15 -08:00
parent 6c5928c052
commit dd43d9413b
8 changed files with 106 additions and 31 deletions

View File

@@ -104,8 +104,8 @@ function collisionChecks(event) {
mech.immuneCycle = mech.cycle + mod.collisionImmuneCycles; //player is immune to collision damage for 30 cycles mech.immuneCycle = mech.cycle + mod.collisionImmuneCycles; //player is immune to collision damage for 30 cycles
mob[k].foundPlayer(); mob[k].foundPlayer();
let dmg = Math.min(Math.max(0.025 * Math.sqrt(mob[k].mass), 0.05), 0.3) * game.dmgScale; //player damage is capped at 0.3*dmgScale of 1.0 let dmg = Math.min(Math.max(0.025 * Math.sqrt(mob[k].mass), 0.05), 0.3) * game.dmgScale; //player damage is capped at 0.3*dmgScale of 1.0
if (mod.isPiezo) mech.energy += mech.maxEnergy * 2;
mech.damage(dmg); mech.damage(dmg);
if (mod.isPiezo) mech.energy += mech.maxEnergy * 2;
if (mod.isBayesian) powerUps.ejectMod() if (mod.isBayesian) powerUps.ejectMod()
if (mob[k].onHit) mob[k].onHit(k); if (mob[k].onHit) mob[k].onHit(k);
//extra kick between player and mob //this section would be better with forces but they don't work... //extra kick between player and mob //this section would be better with forces but they don't work...

View File

@@ -200,7 +200,7 @@ const build = {
let countMods = 0 let countMods = 0
for (let i = 0, len = b.guns.length; i < len; i++) { for (let i = 0, len = b.guns.length; i < len; i++) {
if (b.guns[i].have) { if (b.guns[i].have) {
text += `<div class="pause-grid-module"><div class="grid-title"><div class="circle-grid gun"></div> &nbsp; ${b.guns[i].name}</div> ${b.guns[i].description}</div>` text += `<div class="pause-grid-module"><div class="grid-title"><div class="circle-grid gun"></div> &nbsp; ${b.guns[i].name} - <span style="font-size:100%;font-weight: 100;">${b.guns[i].ammo}</span></div> ${b.guns[i].description}</div>`
countGuns++ countGuns++
} }
} }

View File

@@ -82,6 +82,18 @@ const level = {
powerUps.spawn(mech.pos.x + 60 * (Math.random() - 0.5), mech.pos.y + 60 * (Math.random() - 0.5), "heal", false); powerUps.spawn(mech.pos.x + 60 * (Math.random() - 0.5), mech.pos.y + 60 * (Math.random() - 0.5), "heal", false);
} }
} }
if (mod.isPerpetualReroll) powerUps.spawn(mech.pos.x + 60 * (Math.random() - 0.5), mech.pos.y + 60 * (Math.random() - 0.5), "reroll", false);
if (mod.isPerpetualAmmo) {
powerUps.spawn(mech.pos.x + 60 * (Math.random() - 0.5), mech.pos.y + 60 * (Math.random() - 0.5), "ammo", false);
powerUps.spawn(mech.pos.x + 60 * (Math.random() - 0.5), mech.pos.y + 60 * (Math.random() - 0.5), "ammo", false);
}
if (mod.isPerpetualHeal) {
powerUps.spawn(mech.pos.x + 60 * (Math.random() - 0.5), mech.pos.y + 60 * (Math.random() - 0.5), "heal", false);
powerUps.spawn(mech.pos.x + 60 * (Math.random() - 0.5), mech.pos.y + 60 * (Math.random() - 0.5), "heal", false);
}
if (mod.isPerpetualStun) {
for (let i = 0; i < mob.length; i++) mobs.statusStun(mob[i], 60 * 8)
}
if (mod.isGunCycle) { if (mod.isGunCycle) {
b.inventoryGun++; b.inventoryGun++;
if (b.inventoryGun > b.inventory.length - 1) b.inventoryGun = 0; if (b.inventoryGun > b.inventory.length - 1) b.inventoryGun = 0;

View File

@@ -987,9 +987,9 @@ const mod = {
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
return mech.fieldUpgrades[mech.fieldMode].name !== "nano-scale manufacturing" && mech.fieldUpgrades[mech.fieldMode].name !== "standing wave harmonics" && !mod.isEnergyHealth && !mod.isEnergyLoss return (mech.fieldUpgrades[mech.fieldMode].name !== "nano-scale manufacturing" || mech.maxEnergy > 1) && mech.fieldUpgrades[mech.fieldMode].name !== "standing wave harmonics" && !mod.isEnergyHealth && !mod.isEnergyLoss && !mod.isPiezo
}, },
requires: "not nano-scale manufacturing, not mass-energy equivalence, not standing wave harmonics, not acute stress response", requires: "not nano-scale manufacturing, mass-energy equivalence, standing wave harmonics, acute stress response, piezoelectricity",
effect() { effect() {
mod.isTimeAvoidDeath = true; mod.isTimeAvoidDeath = true;
}, },
@@ -1003,9 +1003,9 @@ const mod = {
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
return !mod.isEnergyHealth return !mod.isEnergyHealth && !mod.isTimeAvoidDeath
}, },
requires: "not mass-energy equivalence", requires: "not mass-energy equivalence, CPT reversal",
effect() { effect() {
mod.isPiezo = true; mod.isPiezo = true;
mech.energy += mech.maxEnergy * 2; mech.energy += mech.maxEnergy * 2;
@@ -1016,11 +1016,11 @@ const mod = {
}, },
{ {
name: "ground state", name: "ground state",
description: "reduce <strong class='color-harm'>harm</strong> by <strong>50%</strong><br>you <strong>no longer</strong> passively regenerate <strong class='color-f'>energy</strong>", description: "reduce <strong class='color-harm'>harm</strong> by <strong>60%</strong><br>you <strong>no longer</strong> passively regenerate <strong class='color-f'>energy</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
return mod.isPiezo && !mod.timeEnergyRegen return mod.isPiezo && mod.energyRegen > 0.001
}, },
requires: "piezoelectricity", requires: "piezoelectricity",
effect: () => { effect: () => {
@@ -1559,7 +1559,7 @@ const mod = {
}, },
{ {
name: "quantum immortality", name: "quantum immortality",
description: "after <strong>dying</strong>, continue in an <strong>alternate reality</strong><br>spawn <strong>5</strong> <strong class='color-r'>rerolls</strong>", description: "after <strong>dying</strong>, continue in an <strong>alternate reality</strong><br>spawn <strong>4</strong> <strong class='color-r'>rerolls</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -1568,9 +1568,8 @@ const mod = {
requires: "at least 2 rerolls", requires: "at least 2 rerolls",
effect() { effect() {
mod.isImmortal = true; mod.isImmortal = true;
for (let i = 0; i < 5; i++) { powerUps.spawn(mech.pos.x, mech.pos.y, "reroll", false);
powerUps.spawn(mech.pos.x, mech.pos.y, "reroll", false); for (let i = 0; i < 4; i++) {}
}
}, },
remove() { remove() {
mod.isImmortal = false; mod.isImmortal = false;
@@ -1635,6 +1634,70 @@ const mod = {
}, },
remove() {} remove() {}
}, },
{
name: "perpetual rerolls",
description: "find <strong>1</strong> <strong class='color-r'>reroll</strong> power up<br>at the start of each <strong>level</strong>",
maxCount: 1,
count: 0,
allowed() {
return !mod.isSuperDeterminism && !mod.isPerpetualHeal && !mod.isPerpetualAmmo && !mod.isPerpetualStun
},
requires: "only 1 perpetual effect, not superdeterminism",
effect() {
mod.isPerpetualReroll = true
},
remove() {
mod.isPerpetualReroll = false
}
},
{
name: "perpetual heals",
description: "find <strong>2</strong> <strong class='color-h'>heal</strong> power ups<br>at the start of each <strong>level</strong>",
maxCount: 1,
count: 0,
allowed() {
return !mod.isPerpetualReroll && !mod.isPerpetualAmmo && !mod.isPerpetualStun
},
requires: "only 1 perpetual effect",
effect() {
mod.isPerpetualHeal = true
},
remove() {
mod.isPerpetualHeal = false
}
},
{
name: "perpetual ammo",
description: "find <strong>2</strong> <strong class='color-g'>ammo</strong> power ups<br>at the start of each <strong>level</strong>",
maxCount: 1,
count: 0,
allowed() {
return !mod.isPerpetualReroll && !mod.isPerpetualHeal && !mod.isPerpetualReroll && !mod.isPerpetualStun
},
requires: "only 1 perpetual effect, not exciton lattice",
effect() {
mod.isPerpetualAmmo = true
},
remove() {
mod.isPerpetualAmmo = false
}
},
{
name: "perpetual stun",
description: "<strong>stun</strong> all mobs for up to <strong>8</strong> seconds<br>at the start of each <strong>level</strong>",
maxCount: 1,
count: 0,
allowed() {
return !mod.isPerpetualReroll && !mod.isPerpetualHeal && !mod.isPerpetualAmmo
},
requires: "only 1 perpetual effect",
effect() {
mod.isPerpetualStun = true
},
remove() {
mod.isPerpetualStun = false
}
},
//************************************************** //**************************************************
//************************************************** gun //************************************************** gun
//************************************************** mods //************************************************** mods
@@ -2774,9 +2837,9 @@ const mod = {
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
return mod.isStunField || mod.oneSuperBall || mod.isCloakStun || mod.orbitBotCount > 1 return mod.isStunField || mod.oneSuperBall || mod.isCloakStun || mod.orbitBotCount > 1 || mod.isPerpetualStun
}, },
requires: "flux pinning or super ball<br>or flashbang", requires: "a stun effect",
effect() { effect() {
mod.isCrit = true; mod.isCrit = true;
}, },
@@ -2830,7 +2893,7 @@ const mod = {
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
return mech.fieldUpgrades[mech.fieldMode].name === "time dilation field" return mech.fieldUpgrades[mech.fieldMode].name === "time dilation field" && mod.energyRegen !== 0;
}, },
requires: "time dilation field", requires: "time dilation field",
effect: () => { effect: () => {
@@ -3193,10 +3256,9 @@ const mod = {
}, },
remove() {} remove() {}
}, },
{ {
name: "rerolls", name: "rerolls",
description: "spawn <strong>5</strong> <strong class='color-r'>reroll</strong> power ups", description: "spawn <strong>4</strong> <strong class='color-r'>reroll</strong> power ups",
maxCount: 9, maxCount: 9,
count: 0, count: 0,
isNonRefundable: true, isNonRefundable: true,
@@ -3206,7 +3268,7 @@ const mod = {
}, },
requires: "not superdeterminism", requires: "not superdeterminism",
effect() { effect() {
for (let i = 0; i < 5; i++) { for (let i = 0; i < 4; i++) {
powerUps.spawn(mech.pos.x, mech.pos.y, "reroll"); powerUps.spawn(mech.pos.x, mech.pos.y, "reroll");
} }
this.count-- this.count--
@@ -3401,7 +3463,6 @@ const mod = {
isWideLaser: null, isWideLaser: null,
wideLaser: null, wideLaser: null,
isPulseLaser: null, isPulseLaser: null,
timeEnergyRegen: null,
isRadioactive: null, isRadioactive: null,
isRailEnergyGain: null, isRailEnergyGain: null,
isMineSentry: null, isMineSentry: null,
@@ -3412,5 +3473,9 @@ const mod = {
historyLaser: null, historyLaser: null,
isSpeedHarm: null, isSpeedHarm: null,
isSpeedDamage: null, isSpeedDamage: null,
isTimeSkip: null isTimeSkip: null,
isPerpetualReroll: null,
isPerpetualAmmo: null,
isPerpetualHeal: null,
isPerpetualStun: null
} }

View File

@@ -272,8 +272,7 @@ const mech = {
}, },
alive: false, alive: false,
death() { death() {
if (mod.isImmortal) { //if player has the immortality buff, spawn on the same level with randomized stats if (mod.isImmortal) { //if player has the immortality buff, spawn on the same level with randomized damage
//count mods //count mods
let totalMods = 0; let totalMods = 0;
for (let i = 0; i < mod.mods.length; i++) { for (let i = 0; i < mod.mods.length; i++) {
@@ -466,7 +465,7 @@ const mech = {
if (mod.isBotArmor) dmg *= 0.95 ** mod.totalBots() if (mod.isBotArmor) dmg *= 0.95 ** mod.totalBots()
if (mod.isHarmArmor && mech.lastHarmCycle + 600 > mech.cycle) dmg *= 0.5; if (mod.isHarmArmor && mech.lastHarmCycle + 600 > mech.cycle) dmg *= 0.5;
if (mod.isNoFireDefense && mech.cycle > mech.fireCDcycle + 120) dmg *= 0.6 if (mod.isNoFireDefense && mech.cycle > mech.fireCDcycle + 120) dmg *= 0.6
if (mod.energyRegen === 0) dmg *= 0.5 //0.22 + 0.78 * mech.energy //77% damage reduction at zero energy if (mod.energyRegen === 0) dmg *= 0.4 //0.22 + 0.78 * mech.energy //77% damage reduction at zero energy
if (mod.isTurret && mech.crouch) dmg *= 0.5; if (mod.isTurret && mech.crouch) dmg *= 0.5;
if (mod.isEntanglement && b.inventory[0] === b.activeGun) { if (mod.isEntanglement && b.inventory[0] === b.activeGun) {
for (let i = 0, len = b.inventory.length; i < len; i++) { for (let i = 0, len = b.inventory.length; i < len; i++) {
@@ -1832,7 +1831,7 @@ const mech = {
} }
//120 cycles after shooting (or using field) enable cloak //120 cycles after shooting (or using field) enable cloak
if (mech.energy < 0.05 && mech.fireCDcycle < mech.cycle) mech.fireCDcycle = mech.cycle if (mech.energy < 0.05 && mech.fireCDcycle < mech.cycle && !input.fire) mech.fireCDcycle = mech.cycle
if (mech.fireCDcycle + 50 < mech.cycle) { if (mech.fireCDcycle + 50 < mech.cycle) {
if (!mech.isCloak) { if (!mech.isCloak) {
mech.isCloak = true //enter cloak mech.isCloak = true //enter cloak

View File

@@ -2262,7 +2262,7 @@ const spawn = {
// this.explode(); // this.explode();
// }; // };
me.collisionFilter.mask = cat.bullet | cat.player | cat.mob me.collisionFilter.mask = cat.bullet | cat.player | cat.mob
me.accelMag = 0.0006 * game.accelScale; me.accelMag = 0.0004 * game.accelScale;
me.leaveBody = false; me.leaveBody = false;
me.frictionAir = 0.02; me.frictionAir = 0.02;
me.isSnakeTail = true; me.isSnakeTail = true;

View File

@@ -248,7 +248,7 @@ summary {
.grid-title { .grid-title {
padding-bottom: 6px; padding-bottom: 6px;
font-size: 1.3em; font-size: 1.4em;
font-weight: 600; font-weight: 600;
} }
@@ -510,6 +510,7 @@ em {
padding: 2px; padding: 2px;
border-radius: 4px; border-radius: 4px;
letter-spacing: 1px; letter-spacing: 1px;
font-weight: 100;
} }
.color-r { .color-r {

View File

@@ -1,10 +1,7 @@
*********** NEXT PATCH *********** *********** NEXT PATCH ***********
mod: CPT reversal - avoid damage by rewinding to your past, but use up all your energy 4 new mods: perpetual ammo/rerolls/heals - get that power up at the start of each level
requires wormhole or time dilation also perpetual stun: stuns all mobs for 8 seconds at the start
several minor buffs to wormhole
small changes to mob distribution on a few maps
************** BUGS ************** ************** BUGS **************
@@ -47,6 +44,7 @@ time dilation - slow down the game engine by 1/2, but run an extra player cycle
flavor - your bullets destroy blocks flavor - your bullets destroy blocks
this isn't really a bonus, so maybe just add this as flavor to another mod/field/gun this isn't really a bonus, so maybe just add this as flavor to another mod/field/gun
a chance for destroyed blocks to drop ammo?
mod plasma : plasma length increases then decreases as you hold down the field button (like stabbing with a spear) 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 grows to 1.5 longer after 0.3 seconds, then returns to normal length over 1 second, until field is pressed again