mod turret mode

This commit is contained in:
landgreen
2020-07-06 17:29:36 -07:00
parent 00933c9f7e
commit ef28029415
11 changed files with 329 additions and 318 deletions

View File

@@ -10,12 +10,12 @@ const b = {
if (game.mouseDown && mech.fireCDcycle < mech.cycle && (!(keys[32] || game.mouseDownRight) || mech.fieldFire) && b.inventory.length) { if (game.mouseDown && mech.fireCDcycle < mech.cycle && (!(keys[32] || game.mouseDownRight) || mech.fieldFire) && b.inventory.length) {
if (b.guns[b.activeGun].ammo > 0) { if (b.guns[b.activeGun].ammo > 0) {
b.guns[b.activeGun].fire(); b.guns[b.activeGun].fire();
if (mod.noAmmo && mech.crouch) { if (mod.isCrouchAmmo && mech.crouch) {
if (mod.noAmmo % 2) { if (mod.isCrouchAmmo % 2) {
b.guns[b.activeGun].ammo--; b.guns[b.activeGun].ammo--;
game.updateGunHUD(); game.updateGunHUD();
} }
mod.noAmmo++ //makes the no ammo toggle off and on mod.isCrouchAmmo++ //makes the no ammo toggle off and on
} else { } else {
b.guns[b.activeGun].ammo--; b.guns[b.activeGun].ammo--;
game.updateGunHUD(); game.updateGunHUD();
@@ -507,7 +507,6 @@ const b = {
if (mod.isMutualism && this.isMutualismActive && !mod.isEnergyHealth) { if (mod.isMutualism && this.isMutualismActive && !mod.isEnergyHealth) {
mech.health += 0.01 mech.health += 0.01
if (mech.health > mech.maxHealth) mech.health = mech.maxHealth; if (mech.health > mech.maxHealth) mech.health = mech.maxHealth;
mod.onHealthChange();
mech.displayHealth(); mech.displayHealth();
} }
}, },
@@ -588,7 +587,6 @@ const b = {
if (mod.isMutualism && mech.health > 0.02) { if (mod.isMutualism && mech.health > 0.02) {
mech.health -= 0.01 mech.health -= 0.01
mod.onHealthChange();
mech.displayHealth(); mech.displayHealth();
bullet[bIndex].isMutualismActive = true bullet[bIndex].isMutualismActive = true
} }
@@ -728,7 +726,7 @@ const b = {
} }
} }
} }
if (!this.lockedOn) { if (!this.lockedOn && !mod.isAmmoFromHealth) {
//grab a power up if it is (ammo) or (a heal when player is low) //grab a power up if it is (ammo) or (a heal when player is low)
let closeDist = Infinity; let closeDist = Infinity;
for (let i = 0, len = powerUp.length; i < len; ++i) { for (let i = 0, len = powerUp.length; i < len; ++i) {
@@ -1126,7 +1124,7 @@ const b = {
//fire plasma at target //fire plasma at target
const DRAIN = 0.0017 const DRAIN = 0.002
if (this.lockedOn && this.lockedOn.alive && mech.energy > DRAIN && mech.fieldCDcycle < mech.cycle) { if (this.lockedOn && this.lockedOn.alive && mech.energy > DRAIN && mech.fieldCDcycle < mech.cycle) {
mech.energy -= DRAIN; mech.energy -= DRAIN;
if (mech.energy < 0) { if (mech.energy < 0) {
@@ -1537,7 +1535,7 @@ const b = {
}, },
{ {
name: "shotgun", name: "shotgun",
description: "fire a <strong>burst</strong> of short range bullets<br><em>crouch to reduce recoil</em>", description: "fire a <strong>burst</strong> of short range <strong> bullets</strong> <br><em>crouch to reduce recoil</em>",
ammo: 0, ammo: 0,
ammoPack: 9, ammoPack: 9,
have: false, have: false,

View File

@@ -204,7 +204,7 @@ function collisionChecks(event) {
//mob + bullet collisions //mob + bullet collisions
if (obj.classType === "bullet" && obj.speed > obj.minDmgSpeed) { if (obj.classType === "bullet" && obj.speed > obj.minDmgSpeed) {
// const dmg = b.dmgScale * (obj.dmg + 0.15 * obj.mass * Vector.magnitude(Vector.sub(mob[k].velocity, obj.velocity))); // const dmg = b.dmgScale * (obj.dmg + 0.15 * obj.mass * Vector.magnitude(Vector.sub(mob[k].velocity, obj.velocity)));
let dmg = b.dmgScale * (obj.dmg + mod.acidDmg + 0.15 * obj.mass * Vector.magnitude(Vector.sub(mob[k].velocity, obj.velocity))) let dmg = b.dmgScale * (obj.dmg + 0.15 * obj.mass * Vector.magnitude(Vector.sub(mob[k].velocity, obj.velocity)))
if (mod.isCrit && !mob[k].seePlayer.recall && !mob[k].shield) dmg *= 5 if (mod.isCrit && !mob[k].seePlayer.recall && !mob[k].shield) dmg *= 5
mob[k].foundPlayer(); mob[k].foundPlayer();
mob[k].damage(dmg); mob[k].damage(dmg);

View File

@@ -241,7 +241,6 @@ const game = {
} }
} }
document.getElementById("mods").innerHTML = text document.getElementById("mods").innerHTML = text
mod.onHealthChange()
}, },
replaceTextLog: true, replaceTextLog: true,
// <!-- <path d="M832.41,106.64 V323.55 H651.57 V256.64 c0-82.5,67.5-150,150-150 Z" fill="#789" stroke="none" /> // <!-- <path d="M832.41,106.64 V323.55 H651.57 V256.64 c0-82.5,67.5-150,150-150 Z" fill="#789" stroke="none" />
@@ -278,7 +277,7 @@ const game = {
} }
}, },
switchGun() { switchGun() {
if (mod.noAmmo) mod.noAmmo = 1 //this prevents hacking the mod by switching guns if (mod.isCrouchAmmo) mod.isCrouchAmmo = 1 //this prevents hacking the mod by switching guns
b.activeGun = b.inventory[b.inventoryGun]; b.activeGun = b.inventory[b.inventoryGun];
game.updateGunHUD(); game.updateGunHUD();
game.boldActiveGunHUD(); game.boldActiveGunHUD();
@@ -645,7 +644,7 @@ const game = {
} }
for (i = 0, len = b.guns.length; i < len; i++) { //find which gun is mine for (i = 0, len = b.guns.length; i < len; i++) { //find which gun is mine
if (b.guns[i].name === "mine") { if (b.guns[i].name === "mine") {
if (mod.noAmmo) count = Math.ceil(count / 2) if (mod.isCrouchAmmo) count = Math.ceil(count / 2)
b.guns[i].ammo += count b.guns[i].ammo += count
game.updateGunHUD(); game.updateGunHUD();
break; break;
@@ -658,7 +657,6 @@ const game = {
if (bullet[i].isMutualismActive) { if (bullet[i].isMutualismActive) {
mech.health += 0.01 mech.health += 0.01
if (mech.health > mech.maxHealth) mech.health = mech.maxHealth; if (mech.health > mech.maxHealth) mech.health = mech.maxHealth;
mod.onHealthChange();
mech.displayHealth(); mech.displayHealth();
} }
} }

View File

@@ -68,7 +68,6 @@ const build = {
b.activeGun = b.inventory[0] //set first gun to active gun b.activeGun = b.inventory[0] //set first gun to active gun
game.makeGunHUD(); game.makeGunHUD();
} }
mod.onHealthChange();
} }
}, },
pauseGrid() { pauseGrid() {
@@ -292,8 +291,6 @@ const build = {
}, },
startBuildRun() { startBuildRun() {
build.isCustomSelection = false; build.isCustomSelection = false;
mod.onHealthChange()
spawn.setSpawnList(); //gives random mobs, not starter mobs spawn.setSpawnList(); //gives random mobs, not starter mobs
spawn.setSpawnList(); spawn.setSpawnList();
if (b.inventory.length > 0) { if (b.inventory.length > 0) {

View File

@@ -13,8 +13,8 @@ const level = {
// game.enableConstructMode() //used to build maps in testing mode // game.enableConstructMode() //used to build maps in testing mode
// level.difficultyIncrease(9) // level.difficultyIncrease(9)
// mech.isStealth = true; // mech.isStealth = true;
// mod.giveMod("supply chain"); // mod.giveMod("superfluidity");
b.giveGuns("ice IX") // b.giveGuns("ice IX")
// mech.setField("plasma torch") // mech.setField("plasma torch")
level.intro(); //starting level level.intro(); //starting level
@@ -1955,7 +1955,6 @@ const level = {
game.clearNow = true; //triggers in game.clearMap to remove all physics bodies and setup for new map game.clearNow = true; //triggers in game.clearMap to remove all physics bodies and setup for new map
if (mod.isHealLowHealth && mech.health < mech.maxHealth * 0.5) { if (mod.isHealLowHealth && mech.health < mech.maxHealth * 0.5) {
mech.health = mech.maxHealth * 0.5 mech.health = mech.maxHealth * 0.5
mod.onHealthChange();
mech.displayHealth(); mech.displayHealth();
} }
}, },
@@ -2082,7 +2081,7 @@ const level = {
if (target.velocity.y > 30) { if (target.velocity.y > 30) {
Matter.Body.setVelocity(target, { Matter.Body.setVelocity(target, {
x: target.velocity.x + (Math.random() - 0.5) * 2, x: target.velocity.x + (Math.random() - 0.5) * 2,
y: -23 //gentle bounce if coming down super fast y: -15 //gentle bounce if coming down super fast
}); });
} else { } else {
Matter.Body.setVelocity(target, { Matter.Body.setVelocity(target, {

View File

@@ -233,7 +233,7 @@ const mobs = {
if (this.status[j].endCycle < game.cycle) this.status.splice(j, 1); if (this.status[j].endCycle < game.cycle) this.status.splice(j, 1);
} }
}, },
seeAtDistance2: 4000000, //sqrt(4000000) = 2000 = max seeing range seeAtDistance2: Infinity, //sqrt(4000000) = 2000 = max seeing range
distanceToPlayer() { distanceToPlayer() {
const dx = this.position.x - player.position.x; const dx = this.position.x - player.position.x;
const dy = this.position.y - player.position.y; const dy = this.position.y - player.position.y;
@@ -974,7 +974,7 @@ const mobs = {
dmg *= mod.damageFromMods() dmg *= mod.damageFromMods()
//mobs specific damage changes //mobs specific damage changes
dmg /= Math.sqrt(this.mass) dmg /= Math.sqrt(this.mass)
if (this.shield) dmg *= 0.04 if (this.shield) dmg *= 0.05
if (mod.isFarAwayDmg) dmg *= 1 + Math.sqrt(Math.max(500, Math.min(3000, this.distanceToPlayer())) - 500) * 0.0067 //up to 50% dmg at max range of 3500 if (mod.isFarAwayDmg) dmg *= 1 + Math.sqrt(Math.max(500, Math.min(3000, this.distanceToPlayer())) - 500) * 0.0067 //up to 50% dmg at max range of 3500
//energy and heal drain should be calculated after damage boosts //energy and heal drain should be calculated after damage boosts

View File

@@ -71,37 +71,19 @@ const mod = {
}, },
damageFromMods() { damageFromMods() {
let dmg = 1 let dmg = 1
if (mod.isLowHealthDmg) dmg *= (3 / (2 + Math.min(mech.health, 1))) //up to 50% dmg at zero player health //if this changes all update display in modonHealthChange() if (mod.isLowHealthDmg) dmg *= 1 + 0.4 * Math.max(0, 1 - mech.health)
if (mod.isHarmDamage && mech.lastHarmCycle + 300 > mech.cycle) dmg *= 2; if (mod.isHarmDamage && mech.lastHarmCycle + 600 > mech.cycle) dmg *= 2;
if (mod.isEnergyLoss) dmg *= 1.33; if (mod.isEnergyLoss) dmg *= 1.33;
if (mod.isAcidDmg && mech.health > 1) dmg *= 1.4;
if (mod.isRest && player.speed < 1) dmg *= 1.20; if (mod.isRest && player.speed < 1) dmg *= 1.20;
if (mod.isEnergyDamage) dmg *= 1 + mech.energy / 5.5; if (mod.isEnergyDamage) dmg *= 1 + mech.energy / 5.5;
if (mod.isDamageFromBulletCount) dmg *= 1 + bullet.length * 0.006 if (mod.isDamageFromBulletCount) dmg *= 1 + bullet.length * 0.006
return dmg * mod.slowFire return dmg * mod.slowFire
}, },
onHealthChange() { //used with acid mod
if (mod.isAcidDmg) {
if (mech.health > 0.8) {
mod.acidDmg = 0.5
if (!build.isCustomSelection) {
setTimeout(function () {
if (document.getElementById("mod-acid")) document.getElementById("mod-acid").innerHTML = " (on)"
}, 10);
}
} else {
mod.acidDmg = 0
if (!build.isCustomSelection) {
setTimeout(function () {
if (document.getElementById("mod-acid")) document.getElementById("mod-acid").innerHTML = " (off)"
}, 10);
}
}
}
},
mods: [{ mods: [{
name: "capacitor", name: "capacitor",
// nameInfo: "<span id='mod-capacitor'></span>", // nameInfo: "<span id='mod-capacitor'></span>",
description: "increase <strong class='color-d'>damage</strong> based on stored <strong class='color-f'>energy</strong><br><strong>1%</strong> <strong class='color-d'>damage</strong> for every <strong>5.5%</strong> <strong class='color-f'>energy</strong>", description: "increase <strong class='color-d'>damage</strong> by <strong>1%</strong><br>for every <strong>5.5%</strong> stored <strong class='color-f'>energy</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -115,10 +97,26 @@ const mod = {
mod.isEnergyDamage = false; mod.isEnergyDamage = false;
} }
}, },
{
name: "acute stress response",
description: "increase <strong class='color-d'>damage</strong> by <strong>33%</strong><br>after a mob <strong>dies</strong> drain <strong>33%</strong> <strong class='color-f'>energy</strong>",
maxCount: 1,
count: 0,
allowed() {
return !mod.isEnergyHealth
},
requires: "not mass-energy equivalence",
effect() {
mod.isEnergyLoss = true;
},
remove() {
mod.isEnergyLoss = false;
}
},
{ {
name: "rest frame", name: "rest frame",
// nameInfo: "<span id='mod-rest'></span>", // nameInfo: "<span id='mod-rest'></span>",
description: "increase <strong class='color-d'>damage</strong> by <strong>20%</strong> when not <strong>moving</strong>", description: "increase <strong class='color-d'>damage</strong> by <strong>20%</strong><br>when not <strong>moving</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -134,7 +132,7 @@ const mod = {
}, },
{ {
name: "kinetic bombardment", name: "kinetic bombardment",
description: "do up to <strong>33%</strong> more <strong class='color-d'>damage</strong> at a <strong>distance</strong><br><em>increase maxes out at about 40 steps away</em>", description: "increase <strong class='color-d'>damage</strong> by up to <strong>33%</strong><br>at a <strong>distance</strong> of 40 steps from the target",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -150,7 +148,7 @@ const mod = {
}, },
{ {
name: "fracture analysis", name: "fracture analysis",
description: "<strong>bullets</strong> do <strong>5x</strong> <strong class='color-d'>damage</strong> to <strong>unaware</strong> mobs<br><em>unaware mobs don't have a health bar</em>", description: "increase <strong class='color-d'>damage</strong> by <strong>400%</strong><br>for mobs that are <strong>unaware</strong> of you",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -165,14 +163,30 @@ const mod = {
} }
}, },
{ {
name: "negative feedback", name: "fluoroantimonic acid",
description: "do extra <strong class='color-d'>damage</strong> at <strong>low health</strong><br><em>up to <strong>50%</strong> increase when near death</em>", description: "increase <strong class='color-d'>damage</strong> by <strong>40%</strong><br>when your base <strong>health</strong> is above <strong>100%</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
return mech.health < 0.8 || build.isCustomSelection return mech.maxHealth > 1;
}, },
requires: "health below 80%", requires: "health above 100%",
effect() {
mod.isAcidDmg = true;
},
remove() {
mod.isAcidDmg = false;
}
},
{
name: "negative feedback",
description: "increase <strong class='color-d'>damage</strong> by <strong>4%</strong><br>for each <strong>10%</strong> missing <strong>health</strong>",
maxCount: 1,
count: 0,
allowed() {
return mech.health < 0.6 || build.isCustomSelection
},
requires: "health below 60%",
effect() { effect() {
mod.isLowHealthDmg = true; //used in mob.damage() mod.isLowHealthDmg = true; //used in mob.damage()
}, },
@@ -182,7 +196,7 @@ const mod = {
}, },
{ {
name: "radiative equilibrium", name: "radiative equilibrium",
description: "after receiving any <strong>harm</strong><br>do <strong>2x</strong> <strong class='color-d'>damage</strong> for <strong>5 seconds</strong>", description: "increase <strong class='color-d'>damage</strong> by <strong>100%</strong><br>for <strong>10 seconds</strong> after receiving <strong>harm</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -197,19 +211,20 @@ const mod = {
} }
}, },
{ {
name: "acute stress response", name: "electrostatic discharge",
description: "increase <strong class='color-d'>damage</strong> by <strong>33%</strong><br>but, after a mob <strong>dies</strong> lose <strong>1/3</strong> your <strong class='color-f'>energy</strong>", description: "increase <strong class='color-d'>damage</strong> by <strong>25%</strong><br><strong>25%</strong> increased <strong>delay</strong> after firing",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
return !mod.isEnergyHealth return true
}, },
requires: "not mass-energy equivalence",
effect() { effect() {
mod.isEnergyLoss = true; mod.slowFire = 1.25
b.setFireCD();
}, },
remove() { remove() {
mod.isEnergyLoss = false; mod.slowFire = 1;
b.setFireCD();
} }
}, },
{ {
@@ -230,26 +245,9 @@ const mod = {
b.setFireCD(); b.setFireCD();
} }
}, },
{
name: "electrostatic discharge",
description: "<strong>25%</strong> increased <strong class='color-d'>damage</strong><br><strong>25%</strong> increased <strong>delay</strong> after firing",
maxCount: 1,
count: 0,
allowed() {
return true
},
effect() {
mod.slowFire = 1.25
b.setFireCD();
},
remove() {
mod.slowFire = 1;
b.setFireCD();
}
},
{ {
name: "mass driver", name: "mass driver",
description: "<strong>blocks</strong> do <strong>2x</strong> more <strong class='color-d'>damage</strong> to mobs<br>charge <strong>throws</strong> more <strong>quickly</strong> for less <strong class='color-f'>energy</strong>", description: "increase <strong>block</strong> collision <strong class='color-d'>damage</strong> by <strong>100%</strong><br>charge <strong>throws</strong> more <strong>quickly</strong> for less <strong class='color-f'>energy</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -263,6 +261,78 @@ const mod = {
mod.throwChargeRate = 1 mod.throwChargeRate = 1
} }
}, },
{
name: "reaction inhibitor",
description: "mobs spawn with <strong>12%</strong> less <strong>health</strong>",
maxCount: 3,
count: 0,
allowed() {
return true
},
requires: "",
effect: () => {
mod.mobSpawnWithHealth *= 0.88
//set all mobs at full health to 0.85
for (let i = 0; i < mob.length; i++) {
if (mob.health > mod.mobSpawnWithHealth) mob.health = mod.mobSpawnWithHealth
}
},
remove() {
mod.mobSpawnWithHealth = 1;
}
},
{
name: "zoospore vector",
description: "mobs produce <strong class='color-p' style='letter-spacing: 2px;'>spores</strong> when they <strong>die</strong><br><strong>11%</strong> chance",
maxCount: 9,
count: 0,
allowed() {
return true
},
requires: "",
effect() {
mod.sporesOnDeath += 0.11;
for (let i = 0; i < 10; i++) {
b.spore(mech.pos)
}
},
remove() {
mod.sporesOnDeath = 0;
}
},
{
name: "thermal runaway",
description: "mobs <strong class='color-e'>explode</strong> when they <strong>die</strong><br><em>be careful</em>",
maxCount: 1,
count: 0,
allowed() {
return true
},
requires: "",
effect: () => {
mod.isExplodeMob = true;
},
remove() {
mod.isExplodeMob = false;
}
},
{
name: "impact shear",
description: "mobs release <strong>2</strong> <strong>nails</strong> when they <strong>die</strong><br>nails target nearby mobs",
maxCount: 9,
count: 0,
allowed() {
return true
},
requires: "",
effect: () => {
mod.nailsDeathMob += 2
},
remove() {
mod.nailsDeathMob = 0;
}
},
{ {
name: "nail-bot", name: "nail-bot",
description: "a bot fires <strong>nails</strong> at targets in line of sight", description: "a bot fires <strong>nails</strong> at targets in line of sight",
@@ -448,110 +518,6 @@ const mod = {
mod.isDroneOnDamage = false; mod.isDroneOnDamage = false;
} }
}, },
{
name: "zoospore vector",
description: "mobs produce <strong class='color-p' style='letter-spacing: 2px;'>spores</strong> when they <strong>die</strong><br><strong>11%</strong> chance",
maxCount: 9,
count: 0,
allowed() {
return true
},
requires: "",
effect() {
mod.sporesOnDeath += 0.11;
for (let i = 0; i < 10; i++) {
b.spore(mech.pos)
}
},
remove() {
mod.sporesOnDeath = 0;
}
},
{
name: "thermal runaway",
description: "mobs <strong class='color-e'>explode</strong> when they <strong>die</strong><br><em>be careful</em>",
maxCount: 1,
count: 0,
allowed() {
return true
},
requires: "",
effect: () => {
mod.isExplodeMob = true;
},
remove() {
mod.isExplodeMob = false;
}
},
{
name: "impact shear",
description: "mobs release <strong>2</strong> <strong>nails</strong> when they <strong>die</strong><br>nails target nearby mobs",
maxCount: 9,
count: 0,
allowed() {
return true
},
requires: "",
effect: () => {
mod.nailsDeathMob += 2
},
remove() {
mod.nailsDeathMob = 0;
}
},
{
name: "reaction inhibitor",
description: "mobs spawn with <strong>12%</strong> less <strong>health</strong>",
maxCount: 3,
count: 0,
allowed() {
return true
},
requires: "",
effect: () => {
mod.mobSpawnWithHealth *= 0.88
//set all mobs at full health to 0.85
for (let i = 0; i < mob.length; i++) {
if (mob.health > mod.mobSpawnWithHealth) mob.health = mod.mobSpawnWithHealth
}
},
remove() {
mod.mobSpawnWithHealth = 1;
}
},
{
name: "scrap recycling",
description: "<strong class='color-h'>heal</strong> up to <strong>1%</strong> of max health every second<br>active for <strong>5 seconds</strong> after any mob <strong>dies</strong>",
maxCount: 1,
count: 0,
allowed() {
return !mod.isEnergyHealth
},
requires: "not mass-energy equivalence",
effect() {
mod.isHealthRecovery = true;
},
remove() {
mod.isHealthRecovery = false;
}
},
{
name: "waste energy recovery",
description: "regen <strong>6%</strong> of max <strong class='color-f'>energy</strong> every second<br>active for <strong>5 seconds</strong> after any mob <strong>dies</strong>",
maxCount: 1,
count: 0,
allowed() {
return true
},
requires: "",
effect() {
mod.isEnergyRecovery = true;
},
remove() {
mod.isEnergyRecovery = false;
}
},
{ {
name: "squirrel-cage rotor", name: "squirrel-cage rotor",
description: "<strong>jump</strong> higher and <strong>move</strong> faster", description: "<strong>jump</strong> higher and <strong>move</strong> faster",
@@ -574,7 +540,7 @@ const mod = {
}, },
{ {
name: "Pauli exclusion", name: "Pauli exclusion",
description: `after being <strong>harmed</strong> from a collision<br><strong>immune</strong> to <strong>harm</strong> for <strong>1</strong> second`, description: `after receiving <strong>harm</strong> from a collision<br><strong>immune</strong> to <strong>harm</strong> for <strong>1</strong> second`,
maxCount: 9, maxCount: 9,
count: 0, count: 0,
allowed() { allowed() {
@@ -589,9 +555,25 @@ const mod = {
mod.collisionImmuneCycles = 15; mod.collisionImmuneCycles = 15;
} }
}, },
{
name: "non-Newtonian armor",
description: "for <strong>10 seconds</strong> after receiving <strong>harm</strong><br>reduce <strong>harm</strong> by <strong>50%</strong>",
maxCount: 1,
count: 0,
allowed() {
return !mod.isEnergyHealth
},
requires: "not mass-energy equivalence",
effect() {
mod.isHarmArmor = true;
},
remove() {
mod.isHarmArmor = false;
}
},
{ {
name: "clock gating", name: "clock gating",
description: `reduce all <strong>harm</strong> by <strong>15%</strong><br><strong>slow</strong> <strong>time</strong> by <strong>50%</strong> after receiving <strong>harm</strong>`, description: `<strong>slow</strong> <strong>time</strong> by <strong>50%</strong> after receiving <strong>harm</strong><br>reduce <strong>harm</strong> by <strong>15%</strong>`,
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -613,7 +595,7 @@ const mod = {
game.boldActiveGunHUD(); game.boldActiveGunHUD();
}, 1000); }, 1000);
}, },
description: "<strong>16%</strong> less <strong>harm</strong> for each gun in your <strong>inventory</strong><br> while your <strong>first gun</strong> is equipped", description: "while your <strong>first gun</strong> is equipped<br>reduce <strong>harm</strong> by <strong>16%</strong> for each of your <strong class='color-g'>guns</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -631,31 +613,6 @@ const mod = {
mod.isEntanglement = false; mod.isEntanglement = false;
} }
}, },
{
name: "mass-energy equivalence",
description: "<strong class='color-f'>energy</strong> protects you instead of <strong>health</strong><br><strong>harm reduction</strong> effects provide <strong>no</strong> benefit",
// description: "you can't <strong>die</strong> if your <strong class='color-f'>energy</strong> is above <strong>zero</strong><br>your <strong>health</strong> is permanently set to <strong>zero</strong>",
maxCount: 1,
count: 0,
allowed() {
return !mod.isPiezo && !mod.isEnergyLoss
},
requires: "not piezoelectricity<br>or acute stress response",
effect: () => {
mech.health = 0
mod.onHealthChange();
mech.displayHealth();
document.getElementById("health-bg").style.display = "none"
document.getElementById("dmg").style.backgroundColor = "#0cf";
mod.isEnergyHealth = true;
},
remove() {
mod.isEnergyHealth = false;
document.getElementById("health-bg").style.display = "inline"
document.getElementById("dmg").style.backgroundColor = "#f67";
mech.health = mech.energy;
}
},
{ {
name: "piezoelectricity", name: "piezoelectricity",
description: "<strong>colliding</strong> with mobs fills your <strong class='color-f'>energy</strong><br><strong>15%</strong> less <strong>harm</strong> from mob collisions", description: "<strong>colliding</strong> with mobs fills your <strong class='color-f'>energy</strong><br><strong>15%</strong> less <strong>harm</strong> from mob collisions",
@@ -691,6 +648,29 @@ const mod = {
mech.fieldRegen = mod.energyRegen; mech.fieldRegen = mod.energyRegen;
} }
}, },
{
name: "mass-energy equivalence",
description: "<strong class='color-f'>energy</strong> protects you instead of <strong>health</strong><br><strong>harm reduction</strong> effects provide <strong>no</strong> benefit",
maxCount: 1,
count: 0,
allowed() {
return !mod.isPiezo
},
requires: "not piezoelectricity<br>or acute stress response",
effect: () => {
mech.health = 0
mech.displayHealth();
document.getElementById("health-bg").style.display = "none"
document.getElementById("dmg").style.backgroundColor = "#0cf";
mod.isEnergyHealth = true;
},
remove() {
mod.isEnergyHealth = false;
document.getElementById("health-bg").style.display = "inline"
document.getElementById("dmg").style.backgroundColor = "#f67";
mech.health = mech.energy;
}
},
{ {
name: "energy conservation", name: "energy conservation",
description: "<strong>13%</strong> of <strong class='color-d'>damage</strong> done recovered as <strong class='color-f'>energy</strong>", description: "<strong>13%</strong> of <strong class='color-d'>damage</strong> done recovered as <strong class='color-f'>energy</strong>",
@@ -724,6 +704,38 @@ const mod = {
mech.maxEnergy = 1; mech.maxEnergy = 1;
} }
}, },
{
name: "waste energy recovery",
description: "regen <strong>6%</strong> of max <strong class='color-f'>energy</strong> every second<br>active for <strong>5 seconds</strong> after any mob <strong>dies</strong>",
maxCount: 1,
count: 0,
allowed() {
return true
},
requires: "",
effect() {
mod.isEnergyRecovery = true;
},
remove() {
mod.isEnergyRecovery = false;
}
},
{
name: "scrap recycling",
description: "<strong class='color-h'>heal</strong> up to <strong>1%</strong> of max health every second<br>active for <strong>5 seconds</strong> after any mob <strong>dies</strong>",
maxCount: 1,
count: 0,
allowed() {
return !mod.isEnergyHealth
},
requires: "not mass-energy equivalence",
effect() {
mod.isHealthRecovery = true;
},
remove() {
mod.isHealthRecovery = false;
}
},
{ {
name: "entropy exchange", name: "entropy exchange",
description: "<strong class='color-h'>heal</strong> for <strong>1.5%</strong> of <strong class='color-d'>damage</strong> done", description: "<strong class='color-h'>heal</strong> for <strong>1.5%</strong> of <strong class='color-d'>damage</strong> done",
@@ -755,7 +767,6 @@ const mod = {
}, },
remove() { remove() {
mech.maxHealth = 1; mech.maxHealth = 1;
mod.onHealthChange();
mech.displayHealth(); mech.displayHealth();
} }
}, },
@@ -765,7 +776,7 @@ const mod = {
maxCount: 9, maxCount: 9,
count: 0, count: 0,
allowed() { allowed() {
return mech.maxHealth > 1 return mech.maxHealth > 1 || mod.isArmorFromPowerUps
}, },
requires: "increased max health", requires: "increased max health",
effect() { effect() {
@@ -833,7 +844,7 @@ const mod = {
}, },
requires: "", requires: "",
effect: () => { effect: () => {
mod.bayesian = 0.40; mod.bayesian = 0.4;
}, },
remove() { remove() {
mod.bayesian = 0; mod.bayesian = 0;
@@ -841,7 +852,7 @@ const mod = {
}, },
{ {
name: "logistics", name: "logistics",
description: "<strong>ammo</strong> power ups add to your <strong>current gun</strong><br>spawn <strong>4 ammo</strong>", description: "<strong>ammo</strong> power ups add to your <strong>current gun</strong><br>spawn <strong>5 ammo</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -850,7 +861,7 @@ const mod = {
requires: "at least 2 guns", requires: "at least 2 guns",
effect() { effect() {
mod.isAmmoForGun = true; mod.isAmmoForGun = true;
for (let i = 0; i < 4; i++) { for (let i = 0; i < 5; i++) {
powerUps.spawn(mech.pos.x, mech.pos.y, "ammo"); powerUps.spawn(mech.pos.x, mech.pos.y, "ammo");
if (Math.random() < mod.bayesian) powerUps.spawn(mech.pos.x, mech.pos.y, "ammo"); if (Math.random() < mod.bayesian) powerUps.spawn(mech.pos.x, mech.pos.y, "ammo");
} }
@@ -861,7 +872,7 @@ const mod = {
}, },
{ {
name: "supply chain", name: "supply chain",
description: "double your current <strong>ammo</strong> for all <strong>guns</strong>", description: "double your current <strong>ammo</strong> for all <strong class='color-g'>guns</strong>",
maxCount: 9, maxCount: 9,
count: 0, count: 0,
isNonRefundable: true, isNonRefundable: true,
@@ -903,15 +914,31 @@ const mod = {
}, },
requires: "", requires: "",
effect() { effect() {
mod.noAmmo = 1 mod.isCrouchAmmo = true
}, },
remove() { remove() {
mod.noAmmo = 0; mod.isCrouchAmmo = false;
}
},
{
name: "gun turret",
description: "reduce <strong>harm</strong> by <strong>50%</strong> when <strong>crouching</strong>",
maxCount: 1,
count: 0,
allowed() {
return mod.isCrouchAmmo
},
requires: "desublimated ammunition",
effect() {
mod.isTurret = true
},
remove() {
mod.isTurret = false;
} }
}, },
{ {
name: "cardinality", name: "cardinality",
description: "<strong>2</strong> extra <strong>choices</strong> for <strong class='color-m'>mods</strong>, <strong>guns</strong>, and <strong>fields</strong>", description: "<strong>2</strong> extra <strong>choices</strong> for <strong class='color-m'>mods</strong>, <strong class='color-g'>guns</strong>, and <strong>fields</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -927,7 +954,7 @@ const mod = {
}, },
{ {
name: "determinism", name: "determinism",
description: "spawn <strong>5</strong> <strong class='color-m'>mods</strong><br><strong>power ups</strong> are limited to <strong>one choice</strong>", description: "spawn <strong>5</strong> <strong class='color-m'>mods</strong><br><strong class='color-m'>mods</strong>, <strong class='color-g'>guns</strong>, and <strong>fields</strong> have only <strong>1 choice</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
isNonRefundable: true, isNonRefundable: true,
@@ -948,7 +975,7 @@ const mod = {
}, },
{ {
name: "superdeterminism", name: "superdeterminism",
description: "spawn <strong>4</strong> <strong class='color-m'>mods</strong><br><strong class='color-r'>rerolls</strong>, <strong>guns</strong>, and <strong>fields</strong> will no longer <strong>spawn</strong>", description: "spawn <strong>4</strong> <strong class='color-m'>mods</strong><br><strong class='color-r'>rerolls</strong>, <strong class='color-g'>guns</strong>, and <strong>fields</strong> no longer <strong>spawn</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
isNonRefundable: true, isNonRefundable: true,
@@ -969,7 +996,7 @@ const mod = {
}, },
{ {
name: "many-worlds", name: "many-worlds",
description: "after choosing a <strong class='color-m'>mod</strong>, <strong>gun</strong>, or <strong>field</strong><br>spawn a <strong class='color-r'>reroll</strong>, if you have none", description: "after choosing a <strong class='color-m'>mod</strong>, <strong class='color-g'>gun</strong>, or <strong>field</strong><br>spawn a <strong class='color-r'>reroll</strong>, if you have none",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -1059,7 +1086,7 @@ const mod = {
}, },
{ {
name: "reallocation", name: "reallocation",
description: "convert <strong>1</strong> random <strong class='color-m'>mod</strong> into <strong>2</strong> new <strong>guns</strong><br><em>recursive mods lose all stacks</em>", description: "convert <strong>1</strong> random <strong class='color-m'>mod</strong> into <strong>2</strong> new <strong class='color-g'>guns</strong><br><em>recursive mods lose all stacks</em>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
isNonRefundable: true, isNonRefundable: true,
@@ -1106,7 +1133,7 @@ const mod = {
}, },
{ {
name: "microstates", name: "microstates",
description: "<strong>6%</strong> <strong class='color-d'>damage</strong> for every <strong>10</strong> active <strong>bullets</strong>", description: "increase <strong class='color-d'>damage</strong> by <strong>6%</strong><br>for every <strong>10</strong> active <strong>bullets</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -1120,29 +1147,6 @@ const mod = {
mod.isDamageFromBulletCount = false mod.isDamageFromBulletCount = false
} }
}, },
{
name: "fluoroantimonic acid",
nameInfo: "<span id='mod-acid'></span>",
addNameInfo() {
mod.onHealthChange();
},
description: "each <strong>bullet</strong> does instant <strong class='color-p'>acid</strong> <strong class='color-d'>damage</strong><br><strong>active</strong> when you are above <strong>80%</strong> base health",
maxCount: 1,
count: 0,
allowed() {
return (mech.health > 0.8 || build.isCustomSelection) &&
(mod.haveGunCheck("mine") || mod.haveGunCheck("minigun") || mod.haveGunCheck("shotgun") || mod.haveGunCheck("super balls") || mod.haveGunCheck("spores") || mod.haveGunCheck("drones") || mod.haveGunCheck("ice IX"))
},
requires: "health above 80%",
effect() {
mod.isAcidDmg = true;
},
remove() {
mod.acidDmg = 0;
mod.isAcidDmg = false;
game.playerDmgColor = "rgba(0,0,0,0.7)"
}
},
{ {
name: "depleted uranium rounds", name: "depleted uranium rounds",
description: `your <strong>bullets</strong> are <strong>18%</strong> larger<br>increased mass and physical <strong class='color-d'>damage</strong>`, description: `your <strong>bullets</strong> are <strong>18%</strong> larger<br>increased mass and physical <strong class='color-d'>damage</strong>`,
@@ -1306,7 +1310,7 @@ const mod = {
}, },
{ {
name: "6s half-life", name: "6s half-life",
description: "<strong>flechette</strong> needles made of <strong class='color-p'>plutonium-238</strong><br><strong>2x</strong> <strong class='color-d'>damage</strong> spread over <strong>6</strong> seconds", description: "<strong>flechette</strong> needles made of <strong class='color-p'>plutonium-238</strong><br>increase <strong class='color-d'>damage</strong> by <strong>100%</strong> over <strong>6</strong> seconds",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -1354,7 +1358,7 @@ const mod = {
}, },
{ {
name: "wave packet", name: "wave packet",
description: "<strong>wave beam</strong> emits <strong>two</strong> oscillating particles<br>wave particles do <strong>40%</strong> less <strong class='color-d'>damage</strong>", description: "<strong>wave beam</strong> emits <strong>two</strong> oscillating particles<br>decrease wave <strong class='color-d'>damage</strong> by <strong>40%</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -1404,7 +1408,7 @@ const mod = {
}, },
{ {
name: "high explosives", name: "high explosives",
description: "<strong class='color-e'>explosions</strong> do <strong>20%</strong> more <strong class='color-d'>damage</strong><br><strong class='color-e'>explosive</strong> area is <strong>44% larger</strong>", description: "increase <strong class='color-e'>explosion</strong> <strong class='color-d'>damage</strong> by <strong>20%</strong><br><strong class='color-e'>explosive</strong> area is <strong>44% larger</strong>",
maxCount: 3, maxCount: 3,
count: 0, count: 0,
allowed() { allowed() {
@@ -1452,7 +1456,7 @@ const mod = {
}, },
{ {
name: "MIRV", name: "MIRV",
description: "launch <strong>3</strong> small <strong>missiles</strong> instead of 1<br><strong>1.5x</strong> increase in <strong>delay</strong> after firing", description: "launch <strong>3</strong> small <strong>missiles</strong> instead of <strong>1</strong> <br><strong>1.5x</strong> increase in <strong>delay</strong> after firing",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -1520,7 +1524,7 @@ const mod = {
}, },
{ {
name: "electromagnetic pulse", name: "electromagnetic pulse",
description: "<strong>vacuum bomb's </strong> <strong class='color-e'>explosion</strong> destroys <strong>shields</strong><br>and does <strong>20%</strong> more <strong class='color-d'>damage</strong>", description: "<strong>vacuum bomb's </strong> <strong class='color-e'>explosion</strong> destroys <strong>shields</strong><br>increase bomb <strong class='color-d'>damage</strong> by <strong>20%</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -1632,7 +1636,7 @@ const mod = {
}, },
{ {
name: "mutualism", name: "mutualism",
description: "<strong class='color-p' style='letter-spacing: 2px;'>spores</strong> do <strong>2x</strong> <strong class='color-d'>damage</strong><br><strong class='color-p' style='letter-spacing: 2px;'>spores</strong> borrow <strong>1%</strong> <strong>health</strong> until they <strong>die</strong>", description: "increase <strong class='color-p' style='letter-spacing: 2px;'>spore</strong> <strong class='color-d'>damage</strong> by <strong>100%</strong><br><strong class='color-p' style='letter-spacing: 2px;'>spores</strong> borrow <strong>1%</strong> <strong>health</strong> until they <strong>die</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -1697,7 +1701,7 @@ const mod = {
}, },
{ {
name: "heavy water", name: "heavy water",
description: "<strong>ice IX</strong> is synthesized with an extra neutron<br>does <strong class='color-p'>radioactive</strong> <strong class='color-d'>damage</strong> over 3 seconds", description: "<strong>ice IX</strong> is synthesized with an extra neutron<br>does <strong class='color-p'>radioactive</strong> <strong class='color-d'>damage</strong> over <strong>3</strong> seconds",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -1851,7 +1855,7 @@ const mod = {
}, },
{ {
name: "timelike world line", name: "timelike world line",
description: "<strong>time dilation</strong> increases your time <strong>rate</strong> by <strong>2x</strong><br> and makes you <strong>immune</strong> to <strong>harm</strong>", description: "<strong>time dilation</strong> doubles your time <strong>rate</strong><br>and makes you <strong>immune</strong> to <strong>harm</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -2056,7 +2060,7 @@ const mod = {
}, },
{ {
name: "renormalization", name: "renormalization",
description: "<strong>phase decoherence</strong> adds <strong>visibility</strong> to bullets<br><strong>5x</strong> less <strong class='color-f'>energy</strong> drain when <strong>firing</strong>", description: "<strong>phase decoherence</strong> adds <strong>visibility</strong> to bullets<br><strong>80%</strong> less <strong class='color-f'>energy</strong> drain when <strong>firing</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -2072,8 +2076,7 @@ const mod = {
}, },
{ {
name: "superposition", name: "superposition",
// description: "<strong>phase decoherence field</strong> applies a <strong>stun</strong><br> to unshielded <strong>mobs</strong> for <strong>2</strong> seconds", description: "mobs that <strong>touch</strong> the <strong>phased</strong> player<br> are <strong>stunned</strong> for <strong>4</strong> seconds",
description: "while <strong>phase decoherence field</strong> is active<br>mobs that <strong>overlap</strong> with the player are <strong>stunned</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -2160,7 +2163,7 @@ const mod = {
}, },
{ {
name: "gun", name: "gun",
description: "spawn a <strong>gun</strong> power up", description: "spawn a <strong class='color-g'>gun</strong> power up",
maxCount: 9, maxCount: 9,
count: 0, count: 0,
isNonRefundable: true, isNonRefundable: true,
@@ -2197,15 +2200,13 @@ const mod = {
bulletSize: null, bulletSize: null,
energySiphon: null, energySiphon: null,
healthDrain: null, healthDrain: null,
noAmmo: null, isCrouchAmmo: null,
isBulletsLastLonger: null, isBulletsLastLonger: null,
isImmortal: null, isImmortal: null,
sporesOnDeath: null, sporesOnDeath: null,
isImmuneExplosion: null, isImmuneExplosion: null,
isExplodeMob: null, isExplodeMob: null,
isDroneOnDamage: null, isDroneOnDamage: null,
// isMineOnDamage: null,
acidDmg: null,
isAcidDmg: null, isAcidDmg: null,
isAnnihilation: null, isAnnihilation: null,
recursiveHealing: null, recursiveHealing: null,
@@ -2292,5 +2293,7 @@ const mod = {
isSporeFreeze: null, isSporeFreeze: null,
isShotgunRecoil: null, isShotgunRecoil: null,
isHealLowHealth: null, isHealLowHealth: null,
isAoESlow: null isAoESlow: null,
isHarmArmor: null,
isTurret: null
} }

View File

@@ -431,7 +431,6 @@ const mech = {
if (!mod.isEnergyHealth) { if (!mod.isEnergyHealth) {
mech.health += heal * game.healScale; mech.health += heal * game.healScale;
if (mech.health > mech.maxHealth) mech.health = mech.maxHealth; if (mech.health > mech.maxHealth) mech.health = mech.maxHealth;
mod.onHealthChange();
mech.displayHealth(); mech.displayHealth();
} }
}, },
@@ -441,7 +440,9 @@ const mech = {
let dmg = 1 let dmg = 1
dmg *= mech.fieldHarmReduction dmg *= mech.fieldHarmReduction
dmg *= mod.isSlowFPS ? 0.85 : 1 dmg *= mod.isSlowFPS ? 0.85 : 1
if (mod.isHarmArmor && mech.lastHarmCycle + 600 > mech.cycle) dmg *= 0.5;
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.5 //0.22 + 0.78 * mech.energy //77% damage reduction at zero energy
if (mod.isTurret && mech.crouch) dmg /= 2;
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++) {
dmg *= 0.84 // 1 - 0.16 dmg *= 0.84 // 1 - 0.16
@@ -452,23 +453,12 @@ const mech = {
damage(dmg) { damage(dmg) {
mech.lastHarmCycle = mech.cycle mech.lastHarmCycle = mech.cycle
//chance to build a drone on damage from mod if (mod.isDroneOnDamage) { //chance to build a drone on damage from mod
if (mod.isDroneOnDamage) {
const len = (dmg - 0.06 * Math.random()) * 40 const len = (dmg - 0.06 * Math.random()) * 40
for (let i = 0; i < len; i++) { for (let i = 0; i < len; i++) {
if (Math.random() < 0.5) b.drone() //spawn drone if (Math.random() < 0.5) b.drone() //spawn drone
} }
} }
// if (mod.isMineOnDamage && dmg > 0.004 + 0.05 * Math.random()) {
// b.mine({
// x: mech.pos.x,
// y: mech.pos.y - 80
// }, {
// x: 0,
// y: 0
// })
// }
if (mod.isEnergyHealth) { if (mod.isEnergyHealth) {
mech.energy -= dmg; mech.energy -= dmg;
@@ -525,7 +515,6 @@ const mech = {
return; return;
} }
} }
mod.onHealthChange();
mech.displayHealth(); mech.displayHealth();
document.getElementById("dmg").style.transition = "opacity 0s"; document.getElementById("dmg").style.transition = "opacity 0s";
document.getElementById("dmg").style.opacity = 0.1 + Math.min(0.6, dmg * 4); document.getElementById("dmg").style.opacity = 0.1 + Math.min(0.6, dmg * 4);
@@ -1301,7 +1290,7 @@ const mech = {
}, },
{ {
name: "nano-scale manufacturing", name: "nano-scale manufacturing",
description: "excess <strong class='color-f'>energy</strong> used to build <strong>drones</strong><br><strong>2x</strong> <strong class='color-f'>energy</strong> regeneration", description: "excess <strong class='color-f'>energy</strong> used to build <strong>drones</strong><br><strong class='color-f'>energy</strong> regeneration is <strong>doubled</strong>",
isEasyToAim: true, isEasyToAim: true,
effect: () => { effect: () => {
// mech.fieldRegen *= 2; // mech.fieldRegen *= 2;
@@ -1449,9 +1438,9 @@ const mech = {
const ICE_DRAIN = 0.00015 const ICE_DRAIN = 0.00015
for (let i = 0, len = mob.length; i < len; i++) { for (let i = 0, len = mob.length; i < len; i++) {
if (mob[i].distanceToPlayer() + mob[i].radius < this.fieldDrawRadius && !mob[i].shield && !mob[i].isShielded) { if (mob[i].distanceToPlayer() + mob[i].radius < this.fieldDrawRadius && !mob[i].shield && !mob[i].isShielded) {
if (mech.energy > ICE_DRAIN) { if (mech.energy > ICE_DRAIN * 2) {
this.fieldDrawRadius -= 2;
mech.energy -= ICE_DRAIN; mech.energy -= ICE_DRAIN;
this.fieldDrawRadius -= 2;
mobs.statusSlow(mob[i], 45) mobs.statusSlow(mob[i], 45)
} else { } else {
break; break;

View File

@@ -393,23 +393,41 @@ const powerUps = {
return; return;
} }
}, },
randomPowerUpCounter: 0,
spawnBossPowerUp(x, y) { //boss spawns field and gun mod upgrades spawnBossPowerUp(x, y) { //boss spawns field and gun mod upgrades
if (level.levelsCleared < 20 || level.levelsCleared % 2 == 0) { //drop only on even levels above level 20
if (game.difficultyMode > 1 || Math.random() < 0.66) { //easy and normal have only a 66% chance for a power up if (game.difficultyMode < 2) { //easy and normal mode
powerUps.randomPowerUpCounter += 0.5;
} else if (game.difficultyMode === 3) { //hard mode
powerUps.randomPowerUpCounter += 1;
} else { //why mode
powerUps.randomPowerUpCounter += 1.33;
if (Math.random() < 0.6) { //why mode gets a free power up chance
powerUps.randomPowerUpCounter *= 0.5
spawnPowerUps() spawnPowerUps()
if (game.difficultyMode > 2 && level.levelsCleared % 2 == 0) spawnPowerUps() //why? has an extra power up on even numbered levels }
} else { }
if (mech.health < 0.65 && !mod.isEnergyHealth) {
const chance = Math.max(level.levelsCleared, 10) * 0.1 //1 until level 10, then 1.1, 1.2, 1.3, ...
if (Math.random() * chance < powerUps.randomPowerUpCounter) {
powerUps.randomPowerUpCounter = 0;
spawnPowerUps()
} else {
spawnHealthAmmo()
}
function spawnHealthAmmo() {
if (mech.health < 0.65 && !mod.isEnergyHealth) {
powerUps.spawn(x, y, "heal");
powerUps.spawn(x, y, "heal");
if (Math.random() < mod.bayesian) {
powerUps.spawn(x, y, "heal"); powerUps.spawn(x, y, "heal");
powerUps.spawn(x, y, "heal"); powerUps.spawn(x, y, "heal");
if (Math.random() < mod.bayesian) {
powerUps.spawn(x, y, "heal");
powerUps.spawn(x, y, "heal");
}
} else if (!mod.bayesian) {
powerUps.spawn(x, y, "ammo");
powerUps.spawn(x, y, "ammo");
} }
} else if (!mod.bayesian) {
powerUps.spawn(x, y, "ammo");
powerUps.spawn(x, y, "ammo");
} }
} }
@@ -417,28 +435,12 @@ const powerUps = {
if (mech.fieldMode === 0) { if (mech.fieldMode === 0) {
powerUps.spawn(x, y, "field") powerUps.spawn(x, y, "field")
if (Math.random() < mod.bayesian) powerUps.spawn(x, y, "field") if (Math.random() < mod.bayesian) powerUps.spawn(x, y, "field")
} else if (Math.random() < 0.9) { } else if (Math.random() < 0.94) {
powerUps.spawn(x, y, "mod") powerUps.spawn(x, y, "mod")
if (Math.random() < mod.bayesian) powerUps.spawn(x, y, "mod") if (Math.random() < mod.bayesian) powerUps.spawn(x, y, "mod")
} else if (Math.random() < 0.5) { } else {
powerUps.spawn(x, y, "gun") powerUps.spawn(x, y, "gun")
if (Math.random() < mod.bayesian) powerUps.spawn(x, y, "gun") if (Math.random() < mod.bayesian) powerUps.spawn(x, y, "gun")
} else if (mech.health < 0.65 && !mod.isEnergyHealth || mod.bayesian) {
powerUps.spawn(x, y, "heal");
powerUps.spawn(x, y, "heal");
powerUps.spawn(x, y, "heal");
powerUps.spawn(x, y, "heal");
if (Math.random() < mod.bayesian) {
powerUps.spawn(x, y, "heal");
powerUps.spawn(x, y, "heal");
powerUps.spawn(x, y, "heal");
powerUps.spawn(x, y, "heal");
}
} else {
powerUps.spawn(x, y, "ammo");
powerUps.spawn(x, y, "ammo");
powerUps.spawn(x, y, "ammo");
powerUps.spawn(x, y, "ammo");
} }
} }

View File

@@ -459,6 +459,11 @@ em {
letter-spacing: 1px; letter-spacing: 1px;
} }
.color-g {
color: hsl(218, 100%, 27%);
letter-spacing: 1px;
}
.color-r { .color-r {
color: #f7b; color: #f7b;
letter-spacing: 1px; letter-spacing: 1px;
@@ -485,6 +490,20 @@ em {
margin-bottom: -5px; margin-bottom: -5px;
} }
.circle-gun-mod {
box-shadow: 0 0 0 3px #025;
}
/* .circle-grid-gun {
width: 10px;
height: 10px;
border-radius: 50%;
display: inline-block;
margin-bottom: 0px;
background: #025;
box-shadow: 0 0 0 8px hsl(253, 80%, 67%);
} */
.field { .field {
background: #0cf; background: #0cf;
} }

View File

@@ -1,21 +1,27 @@
negentropy - heals player to 50% max health at the end of a level drones stop auto grabbing power ups when you have crystallized armor
crystallized armor - give 5% (was 4%) max health for a power up mod - non-Newtonian armor: take 50% less harm for 10 seconds after getting hit
mod - superfluidity: AoE freeze effect radiative equilibrium damage lasts 10s after getting hit (up from 5s)
bomberBoss's bombs split into 3 bombs on later levels fluoroantimonic acid mod simplified- now gives 40% damage when your base health is above 100%
mod - pair production only works for nano-scale manufacturing, but gives 3x (up from 2x) max energy mod - gun turret: take 50% less harm while crouched
press Z+X in testing mode to trigger player death
boss mob power up drop rework:
easy and normal have about a 66% chance
hard has a 100% chance
why has a 133% chance, plus a bonus 60% chance for a second power up
if you miss a roll, your odds double on the next roll
for each level above level 10 you need to roll 10% higher to get a power up
************** TODO - n-gon ************** ************** TODO - n-gon **************
plasma field gets longer as you hold it longer field that pushes blocks and mobs away
charges up on mouse down and triggers on mouse up
drain mana while charging up
maybe push effect should last 10 cycles to give a more gentle feeling
mod - AoE radiation might work when the effect ends mod - AoE radiation might work when the effect ends
or maybe just anytime another mob is near or maybe just anytime another mob is near
wave beam: mod - longitudinal waves (bullets oscillate fast /slow not up/down)
trigger on crouch?
medium caliber gun in between minigun and rail gun medium caliber gun in between minigun and rail gun
mod: electricity damages mobs that get near the bullet mod: electricity damages mobs that get near the bullet
get ammo back if it hits mobs get ammo back if it hits mobs