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
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
if (mod.isPiezo) mech.energy += mech.maxEnergy * 2;
mech.damage(dmg);
if (mod.isPiezo) mech.energy += mech.maxEnergy * 2;
if (mod.isBayesian) powerUps.ejectMod()
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...

View File

@@ -200,7 +200,7 @@ const build = {
let countMods = 0
for (let i = 0, len = b.guns.length; i < len; i++) {
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++
}
}

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);
}
}
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) {
b.inventoryGun++;
if (b.inventoryGun > b.inventory.length - 1) b.inventoryGun = 0;

View File

@@ -987,9 +987,9 @@ const mod = {
maxCount: 1,
count: 0,
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() {
mod.isTimeAvoidDeath = true;
},
@@ -1003,9 +1003,9 @@ const mod = {
maxCount: 1,
count: 0,
allowed() {
return !mod.isEnergyHealth
return !mod.isEnergyHealth && !mod.isTimeAvoidDeath
},
requires: "not mass-energy equivalence",
requires: "not mass-energy equivalence, CPT reversal",
effect() {
mod.isPiezo = true;
mech.energy += mech.maxEnergy * 2;
@@ -1016,11 +1016,11 @@ const mod = {
},
{
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,
count: 0,
allowed() {
return mod.isPiezo && !mod.timeEnergyRegen
return mod.isPiezo && mod.energyRegen > 0.001
},
requires: "piezoelectricity",
effect: () => {
@@ -1559,7 +1559,7 @@ const mod = {
},
{
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,
count: 0,
allowed() {
@@ -1568,9 +1568,8 @@ const mod = {
requires: "at least 2 rerolls",
effect() {
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() {
mod.isImmortal = false;
@@ -1635,6 +1634,70 @@ const mod = {
},
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
//************************************************** mods
@@ -2774,9 +2837,9 @@ const mod = {
maxCount: 1,
count: 0,
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() {
mod.isCrit = true;
},
@@ -2830,7 +2893,7 @@ const mod = {
maxCount: 1,
count: 0,
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",
effect: () => {
@@ -3193,10 +3256,9 @@ const mod = {
},
remove() {}
},
{
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,
count: 0,
isNonRefundable: true,
@@ -3206,7 +3268,7 @@ const mod = {
},
requires: "not superdeterminism",
effect() {
for (let i = 0; i < 5; i++) {
for (let i = 0; i < 4; i++) {
powerUps.spawn(mech.pos.x, mech.pos.y, "reroll");
}
this.count--
@@ -3401,7 +3463,6 @@ const mod = {
isWideLaser: null,
wideLaser: null,
isPulseLaser: null,
timeEnergyRegen: null,
isRadioactive: null,
isRailEnergyGain: null,
isMineSentry: null,
@@ -3412,5 +3473,9 @@ const mod = {
historyLaser: null,
isSpeedHarm: 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,
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
let totalMods = 0;
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.isHarmArmor && mech.lastHarmCycle + 600 > mech.cycle) dmg *= 0.5;
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.isEntanglement && b.inventory[0] === b.activeGun) {
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
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.isCloak) {
mech.isCloak = true //enter cloak

View File

@@ -2262,7 +2262,7 @@ const spawn = {
// this.explode();
// };
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.frictionAir = 0.02;
me.isSnakeTail = true;