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 (b.guns[b.activeGun].ammo > 0) {
b.guns[b.activeGun].fire();
if (mod.noAmmo && mech.crouch) {
if (mod.noAmmo % 2) {
if (mod.isCrouchAmmo && mech.crouch) {
if (mod.isCrouchAmmo % 2) {
b.guns[b.activeGun].ammo--;
game.updateGunHUD();
}
mod.noAmmo++ //makes the no ammo toggle off and on
mod.isCrouchAmmo++ //makes the no ammo toggle off and on
} else {
b.guns[b.activeGun].ammo--;
game.updateGunHUD();
@@ -507,7 +507,6 @@ const b = {
if (mod.isMutualism && this.isMutualismActive && !mod.isEnergyHealth) {
mech.health += 0.01
if (mech.health > mech.maxHealth) mech.health = mech.maxHealth;
mod.onHealthChange();
mech.displayHealth();
}
},
@@ -588,7 +587,6 @@ const b = {
if (mod.isMutualism && mech.health > 0.02) {
mech.health -= 0.01
mod.onHealthChange();
mech.displayHealth();
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)
let closeDist = Infinity;
for (let i = 0, len = powerUp.length; i < len; ++i) {
@@ -1126,7 +1124,7 @@ const b = {
//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) {
mech.energy -= DRAIN;
if (mech.energy < 0) {
@@ -1537,7 +1535,7 @@ const b = {
},
{
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,
ammoPack: 9,
have: false,

View File

@@ -204,7 +204,7 @@ function collisionChecks(event) {
//mob + bullet collisions
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)));
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
mob[k].foundPlayer();
mob[k].damage(dmg);

View File

@@ -241,7 +241,6 @@ const game = {
}
}
document.getElementById("mods").innerHTML = text
mod.onHealthChange()
},
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" />
@@ -278,7 +277,7 @@ const game = {
}
},
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];
game.updateGunHUD();
game.boldActiveGunHUD();
@@ -645,7 +644,7 @@ const game = {
}
for (i = 0, len = b.guns.length; i < len; i++) { //find which gun is 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
game.updateGunHUD();
break;
@@ -658,7 +657,6 @@ const game = {
if (bullet[i].isMutualismActive) {
mech.health += 0.01
if (mech.health > mech.maxHealth) mech.health = mech.maxHealth;
mod.onHealthChange();
mech.displayHealth();
}
}

View File

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

View File

@@ -13,8 +13,8 @@ const level = {
// game.enableConstructMode() //used to build maps in testing mode
// level.difficultyIncrease(9)
// mech.isStealth = true;
// mod.giveMod("supply chain");
b.giveGuns("ice IX")
// mod.giveMod("superfluidity");
// b.giveGuns("ice IX")
// mech.setField("plasma torch")
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
if (mod.isHealLowHealth && mech.health < mech.maxHealth * 0.5) {
mech.health = mech.maxHealth * 0.5
mod.onHealthChange();
mech.displayHealth();
}
},
@@ -2082,7 +2081,7 @@ const level = {
if (target.velocity.y > 30) {
Matter.Body.setVelocity(target, {
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 {
Matter.Body.setVelocity(target, {

View File

@@ -233,7 +233,7 @@ const mobs = {
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() {
const dx = this.position.x - player.position.x;
const dy = this.position.y - player.position.y;
@@ -974,7 +974,7 @@ const mobs = {
dmg *= mod.damageFromMods()
//mobs specific damage changes
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
//energy and heal drain should be calculated after damage boosts

View File

@@ -71,37 +71,19 @@ const mod = {
},
damageFromMods() {
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.isHarmDamage && mech.lastHarmCycle + 300 > mech.cycle) dmg *= 2;
if (mod.isLowHealthDmg) dmg *= 1 + 0.4 * Math.max(0, 1 - mech.health)
if (mod.isHarmDamage && mech.lastHarmCycle + 600 > mech.cycle) dmg *= 2;
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.isEnergyDamage) dmg *= 1 + mech.energy / 5.5;
if (mod.isDamageFromBulletCount) dmg *= 1 + bullet.length * 0.006
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: [{
name: "capacitor",
// 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,
count: 0,
allowed() {
@@ -115,10 +97,26 @@ const mod = {
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",
// 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,
count: 0,
allowed() {
@@ -134,7 +132,7 @@ const mod = {
},
{
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,
count: 0,
allowed() {
@@ -150,7 +148,7 @@ const mod = {
},
{
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,
count: 0,
allowed() {
@@ -165,14 +163,30 @@ const mod = {
}
},
{
name: "negative feedback",
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>",
name: "fluoroantimonic acid",
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,
count: 0,
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() {
mod.isLowHealthDmg = true; //used in mob.damage()
},
@@ -182,7 +196,7 @@ const mod = {
},
{
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,
count: 0,
allowed() {
@@ -197,19 +211,20 @@ const mod = {
}
},
{
name: "acute stress response",
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>",
name: "electrostatic discharge",
description: "increase <strong class='color-d'>damage</strong> by <strong>25%</strong><br><strong>25%</strong> increased <strong>delay</strong> after firing",
maxCount: 1,
count: 0,
allowed() {
return !mod.isEnergyHealth
return true
},
requires: "not mass-energy equivalence",
effect() {
mod.isEnergyLoss = true;
mod.slowFire = 1.25
b.setFireCD();
},
remove() {
mod.isEnergyLoss = false;
mod.slowFire = 1;
b.setFireCD();
}
},
{
@@ -230,26 +245,9 @@ const mod = {
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",
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,
count: 0,
allowed() {
@@ -263,6 +261,78 @@ const mod = {
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",
description: "a bot fires <strong>nails</strong> at targets in line of sight",
@@ -448,110 +518,6 @@ const mod = {
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",
description: "<strong>jump</strong> higher and <strong>move</strong> faster",
@@ -574,7 +540,7 @@ const mod = {
},
{
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,
count: 0,
allowed() {
@@ -589,9 +555,25 @@ const mod = {
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",
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,
count: 0,
allowed() {
@@ -613,7 +595,7 @@ const mod = {
game.boldActiveGunHUD();
}, 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,
count: 0,
allowed() {
@@ -631,31 +613,6 @@ const mod = {
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",
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;
}
},
{
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",
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;
}
},
{
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",
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() {
mech.maxHealth = 1;
mod.onHealthChange();
mech.displayHealth();
}
},
@@ -765,7 +776,7 @@ const mod = {
maxCount: 9,
count: 0,
allowed() {
return mech.maxHealth > 1
return mech.maxHealth > 1 || mod.isArmorFromPowerUps
},
requires: "increased max health",
effect() {
@@ -833,7 +844,7 @@ const mod = {
},
requires: "",
effect: () => {
mod.bayesian = 0.40;
mod.bayesian = 0.4;
},
remove() {
mod.bayesian = 0;
@@ -841,7 +852,7 @@ const mod = {
},
{
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,
count: 0,
allowed() {
@@ -850,7 +861,7 @@ const mod = {
requires: "at least 2 guns",
effect() {
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");
if (Math.random() < mod.bayesian) powerUps.spawn(mech.pos.x, mech.pos.y, "ammo");
}
@@ -861,7 +872,7 @@ const mod = {
},
{
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,
count: 0,
isNonRefundable: true,
@@ -903,15 +914,31 @@ const mod = {
},
requires: "",
effect() {
mod.noAmmo = 1
mod.isCrouchAmmo = true
},
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",
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,
count: 0,
allowed() {
@@ -927,7 +954,7 @@ const mod = {
},
{
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,
count: 0,
isNonRefundable: true,
@@ -948,7 +975,7 @@ const mod = {
},
{
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,
count: 0,
isNonRefundable: true,
@@ -969,7 +996,7 @@ const mod = {
},
{
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,
count: 0,
allowed() {
@@ -1059,7 +1086,7 @@ const mod = {
},
{
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,
count: 0,
isNonRefundable: true,
@@ -1106,7 +1133,7 @@ const mod = {
},
{
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,
count: 0,
allowed() {
@@ -1120,29 +1147,6 @@ const mod = {
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",
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",
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,
count: 0,
allowed() {
@@ -1354,7 +1358,7 @@ const mod = {
},
{
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,
count: 0,
allowed() {
@@ -1404,7 +1408,7 @@ const mod = {
},
{
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,
count: 0,
allowed() {
@@ -1452,7 +1456,7 @@ const mod = {
},
{
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,
count: 0,
allowed() {
@@ -1520,7 +1524,7 @@ const mod = {
},
{
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,
count: 0,
allowed() {
@@ -1632,7 +1636,7 @@ const mod = {
},
{
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,
count: 0,
allowed() {
@@ -1697,7 +1701,7 @@ const mod = {
},
{
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,
count: 0,
allowed() {
@@ -1851,7 +1855,7 @@ const mod = {
},
{
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,
count: 0,
allowed() {
@@ -2056,7 +2060,7 @@ const mod = {
},
{
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,
count: 0,
allowed() {
@@ -2072,8 +2076,7 @@ const mod = {
},
{
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: "while <strong>phase decoherence field</strong> is active<br>mobs that <strong>overlap</strong> with the player are <strong>stunned</strong>",
description: "mobs that <strong>touch</strong> the <strong>phased</strong> player<br> are <strong>stunned</strong> for <strong>4</strong> seconds",
maxCount: 1,
count: 0,
allowed() {
@@ -2160,7 +2163,7 @@ const mod = {
},
{
name: "gun",
description: "spawn a <strong>gun</strong> power up",
description: "spawn a <strong class='color-g'>gun</strong> power up",
maxCount: 9,
count: 0,
isNonRefundable: true,
@@ -2197,15 +2200,13 @@ const mod = {
bulletSize: null,
energySiphon: null,
healthDrain: null,
noAmmo: null,
isCrouchAmmo: null,
isBulletsLastLonger: null,
isImmortal: null,
sporesOnDeath: null,
isImmuneExplosion: null,
isExplodeMob: null,
isDroneOnDamage: null,
// isMineOnDamage: null,
acidDmg: null,
isAcidDmg: null,
isAnnihilation: null,
recursiveHealing: null,
@@ -2292,5 +2293,7 @@ const mod = {
isSporeFreeze: null,
isShotgunRecoil: null,
isHealLowHealth: null,
isAoESlow: null
isAoESlow: null,
isHarmArmor: null,
isTurret: null
}

View File

@@ -431,7 +431,6 @@ const mech = {
if (!mod.isEnergyHealth) {
mech.health += heal * game.healScale;
if (mech.health > mech.maxHealth) mech.health = mech.maxHealth;
mod.onHealthChange();
mech.displayHealth();
}
},
@@ -441,7 +440,9 @@ const mech = {
let dmg = 1
dmg *= mech.fieldHarmReduction
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.isTurret && mech.crouch) dmg /= 2;
if (mod.isEntanglement && b.inventory[0] === b.activeGun) {
for (let i = 0, len = b.inventory.length; i < len; i++) {
dmg *= 0.84 // 1 - 0.16
@@ -452,23 +453,12 @@ const mech = {
damage(dmg) {
mech.lastHarmCycle = mech.cycle
//chance to build a drone on damage from mod
if (mod.isDroneOnDamage) {
if (mod.isDroneOnDamage) { //chance to build a drone on damage from mod
const len = (dmg - 0.06 * Math.random()) * 40
for (let i = 0; i < len; i++) {
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) {
mech.energy -= dmg;
@@ -525,7 +515,6 @@ const mech = {
return;
}
}
mod.onHealthChange();
mech.displayHealth();
document.getElementById("dmg").style.transition = "opacity 0s";
document.getElementById("dmg").style.opacity = 0.1 + Math.min(0.6, dmg * 4);
@@ -1301,7 +1290,7 @@ const mech = {
},
{
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,
effect: () => {
// mech.fieldRegen *= 2;
@@ -1449,9 +1438,9 @@ const mech = {
const ICE_DRAIN = 0.00015
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 (mech.energy > ICE_DRAIN) {
this.fieldDrawRadius -= 2;
if (mech.energy > ICE_DRAIN * 2) {
mech.energy -= ICE_DRAIN;
this.fieldDrawRadius -= 2;
mobs.statusSlow(mob[i], 45)
} else {
break;

View File

@@ -393,12 +393,31 @@ const powerUps = {
return;
}
},
randomPowerUpCounter: 0,
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()
}
}
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()
if (game.difficultyMode > 2 && level.levelsCleared % 2 == 0) spawnPowerUps() //why? has an extra power up on even numbered levels
} else {
spawnHealthAmmo()
}
function spawnHealthAmmo() {
if (mech.health < 0.65 && !mod.isEnergyHealth) {
powerUps.spawn(x, y, "heal");
powerUps.spawn(x, y, "heal");
@@ -411,34 +430,17 @@ const powerUps = {
powerUps.spawn(x, y, "ammo");
}
}
}
function spawnPowerUps() {
if (mech.fieldMode === 0) {
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")
if (Math.random() < mod.bayesian) powerUps.spawn(x, y, "mod")
} else if (Math.random() < 0.5) {
} else {
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;
}
.color-g {
color: hsl(218, 100%, 27%);
letter-spacing: 1px;
}
.color-r {
color: #f7b;
letter-spacing: 1px;
@@ -485,6 +490,20 @@ em {
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 {
background: #0cf;
}

View File

@@ -1,21 +1,27 @@
negentropy - heals player to 50% max health at the end of a level
crystallized armor - give 5% (was 4%) max health for a power up
mod - superfluidity: AoE freeze effect
bomberBoss's bombs split into 3 bombs on later levels
mod - pair production only works for nano-scale manufacturing, but gives 3x (up from 2x) max energy
press Z+X in testing mode to trigger player death
drones stop auto grabbing power ups when you have crystallized armor
mod - non-Newtonian armor: take 50% less harm for 10 seconds after getting hit
radiative equilibrium damage lasts 10s after getting hit (up from 5s)
fluoroantimonic acid mod simplified- now gives 40% damage when your base health is above 100%
mod - gun turret: take 50% less harm while crouched
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 **************
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
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
mod: electricity damages mobs that get near the bullet
get ammo back if it hits mobs