ice IX, ablative mines

This commit is contained in:
landgreen
2020-03-27 05:38:14 -07:00
parent 2fb3d761a1
commit ad950d2cc2
9 changed files with 155 additions and 94 deletions

View File

@@ -17,6 +17,7 @@ const b = {
isModImmuneExplosion: null, isModImmuneExplosion: null,
isModExplodeMob: null, isModExplodeMob: null,
isModDroneOnDamage: null, isModDroneOnDamage: null,
isModMineOnDamage: null,
modAcidDmg: null, modAcidDmg: null,
isModAcidDmg: null, isModAcidDmg: null,
annihilation: null, annihilation: null,
@@ -55,7 +56,7 @@ const b = {
modWaveSpeedBody: null, modWaveSpeedBody: null,
isModSporeField: null, isModSporeField: null,
isModMissileField: null, isModMissileField: null,
isModSwarmField: null, isModIceField: null,
isModFlechetteMultiShot: null, isModFlechetteMultiShot: null,
isModMineAmmoBack: null, isModMineAmmoBack: null,
isModPlasmaRange: null, isModPlasmaRange: null,
@@ -70,11 +71,26 @@ const b = {
isModAlphaRadiation: null, isModAlphaRadiation: null,
modOnHealthChange() { //used with acid mod modOnHealthChange() { //used with acid mod
if (b.isModAcidDmg && mech.health > 0.8) { if (b.isModAcidDmg && mech.health > 0.8) {
game.playerDmgColor = "rgba(0,80,80,0.9)"
b.modAcidDmg = 0.7 b.modAcidDmg = 0.7
if (!build.isCustomSelection) {
setTimeout(function () {
if (document.getElementById("mod-acid")) document.getElementById("mod-acid").innerHTML = " (on)"
}, 10);
}
} else { } else {
game.playerDmgColor = "rgba(0,0,0,0.7)"
b.modAcidDmg = 0 b.modAcidDmg = 0
if (!build.isCustomSelection) {
setTimeout(function () {
if (document.getElementById("mod-acid")) document.getElementById("mod-acid").innerHTML = " (off)"
}, 10);
}
}
if (b.isModLowHealthDmg) {
if (!build.isCustomSelection) {
setTimeout(function () {
if (document.getElementById("mod-low-health-damage")) document.getElementById("mod-low-health-damage").innerHTML = " +" + (((3 / (2 + Math.min(mech.health, 1))) - 1) * 100).toFixed(0) + "%"
}, 10);
}
} }
}, },
mods: [{ mods: [{
@@ -126,7 +142,7 @@ const b = {
} }
}, },
{ {
name: "fluoroantimonic acid", name: "fluoroantimonic acid<span id='mod-acid'></span>",
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", 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, maxCount: 1,
count: 0, count: 0,
@@ -145,7 +161,7 @@ const b = {
} }
}, },
{ {
name: "negative feedback", name: "negative feedback<span id='mod-low-health-damage'></span>",
description: "do extra <strong class='color-d'>damage</strong> at low health<br><em>up to <strong>50%</strong> increase when near death</em>", description: "do extra <strong class='color-d'>damage</strong> at low health<br><em>up to <strong>50%</strong> increase when near death</em>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
@@ -193,12 +209,12 @@ const b = {
} }
}, },
{ {
name: "electric reactive armour", name: "electric reactive armor",
description: "<strong class='color-e'>explosions</strong> drain your <strong class='color-f'>energy</strong><br>instead of <strong>harming</strong> you", description: "<strong class='color-e'>explosions</strong> drain your <strong class='color-f'>energy</strong><br>instead of <strong>harming</strong> you",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
return b.modExplosionRadius > 1 return b.modExplosionRadius > 1 || b.isModExplodeMob
}, },
requires: "high explosives", requires: "high explosives",
effect: () => { effect: () => {
@@ -307,7 +323,7 @@ const b = {
} }
}, },
{ {
name: "ablative synthesis", name: "ablative drones",
description: "rebuild your broken parts as <strong>drones</strong><br>chance to occur after being <strong>harmed</strong>", description: "rebuild your broken parts as <strong>drones</strong><br>chance to occur after being <strong>harmed</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
@@ -325,15 +341,38 @@ const b = {
b.isModDroneOnDamage = false; b.isModDroneOnDamage = false;
} }
}, },
{
name: "ablative mines",
description: "rebuild your broken parts as a <strong>mine</strong><br>chance to occur after being <strong>harmed</strong>",
maxCount: 1,
count: 0,
allowed() {
return true
},
requires: "",
effect() {
b.isModMineOnDamage = true;
b.mine({
x: mech.pos.x,
y: mech.pos.y - 80
}, {
x: 0,
y: 0
})
},
remove() {
b.isModMineOnDamage = false;
}
},
{ {
name: "Lorentzian topology", name: "Lorentzian topology",
description: "your <strong>bullets</strong> last <strong>+33% longer</strong>", description: "your <strong>bullets</strong> last <strong>+33% longer</strong>",
maxCount: 3, maxCount: 3,
count: 0, count: 0,
allowed() { allowed() {
return mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" || b.haveGunCheck("spores") || b.haveGunCheck("drones") || b.haveGunCheck("super balls") || b.haveGunCheck("foam") || b.haveGunCheck("wave beam") || b.haveGunCheck("swarm") return mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" || b.haveGunCheck("spores") || b.haveGunCheck("drones") || b.haveGunCheck("super balls") || b.haveGunCheck("foam") || b.haveGunCheck("wave beam") || b.haveGunCheck("ice IX")
}, },
requires: "drones, spores, super balls,<br> foam, wave beam, or swarm", requires: "drones, spores, super balls,<br> foam, wave beam, or ice IX",
effect() { effect() {
b.isModBulletsLastLonger += 0.33 b.isModBulletsLastLonger += 0.33
}, },
@@ -787,7 +826,7 @@ const b = {
{ {
name: "ice crystal nucleation", name: "ice crystal nucleation",
description: "your <strong>minigun</strong> uses <strong class='color-f'>energy</strong> to condense<br><strong>bullets</strong> from water vapor that <strong>slow</strong> mobs", description: "your <strong>minigun</strong> uses <strong class='color-f'>energy</strong> to condense<br>unlimited <strong class='color-s'>freezing</strong> <strong>bullets</strong> from water vapor",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -820,7 +859,7 @@ const b = {
}, },
{ {
name: "shotgun spin-statistics", name: "shotgun spin-statistics",
description: "firing the <strong>shotgun</strong> makes you <br><strong>immune</strong> to collisions for <strong>1/2</strong> a second", description: "firing the <strong>shotgun</strong> makes you <br><strong>immune</strong> to collisions for <strong>1 second</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -1022,7 +1061,7 @@ const b = {
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
return b.haveGunCheck("drones") || (mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" && !(b.isModSporeField || b.isModMissileField || b.isModSwarmField)) return b.haveGunCheck("drones") || (mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" && !(b.isModSporeField || b.isModMissileField || b.isModIceField))
}, },
requires: "drones", requires: "drones",
effect() { effect() {
@@ -1033,14 +1072,14 @@ const b = {
} }
}, },
{ {
name: "alpha radiation", name: "heavy water",
description: "the <strong>swarm</strong> bots deliver a dose of<br><strong class='color-p'>radioactive</strong> <strong class='color-d'>damage</strong> over 3 seconds", description: "<strong>ice IX</strong> is synthesized with unstable isotopes<br>does <strong class='color-p'>radioactive</strong> <strong class='color-d'>damage</strong> over 3 seconds",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
return b.haveGunCheck("swarm") || (mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" && b.isModSwarmField) return b.haveGunCheck("ice IX") || (mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" && b.isModIceField)
}, },
requires: "swarm", requires: "ice IX",
effect() { effect() {
b.isModAlphaRadiation = true b.isModAlphaRadiation = true
}, },
@@ -1188,7 +1227,7 @@ const b = {
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
return mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" && !(b.isModMissileField || b.isModSwarmField) return mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" && !(b.isModMissileField || b.isModIceField)
}, },
requires: "nano-scale manufacturing", requires: "nano-scale manufacturing",
effect() { effect() {
@@ -1204,7 +1243,7 @@ const b = {
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
return mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" && !(b.isModSporeField || b.isModSwarmField) return mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" && !(b.isModSporeField || b.isModIceField)
}, },
requires: "nano-scale manufacturing", requires: "nano-scale manufacturing",
effect() { effect() {
@@ -1215,8 +1254,8 @@ const b = {
} }
}, },
{ {
name: "swarm manufacturing", name: "ice IX manufacturing",
description: "<strong>nano-scale manufacturing</strong> is repurposed<br>excess <strong class='color-f'>energy</strong> used to construct <strong>swarm</strong> bots", description: "<strong>nano-scale manufacturing</strong> is repurposed<br>excess <strong class='color-f'>energy</strong> used to synthesize <strong>ice IX</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -1224,10 +1263,10 @@ const b = {
}, },
requires: "nano-scale manufacturing", requires: "nano-scale manufacturing",
effect() { effect() {
b.isModSwarmField = true; b.isModIceField = true;
}, },
remove() { remove() {
b.isModSwarmField = false; b.isModIceField = false;
} }
}, },
{ {
@@ -1474,7 +1513,7 @@ const b = {
if (dist < radius) { if (dist < radius) {
if (b.isModImmuneExplosion) { if (b.isModImmuneExplosion) {
const drain = Math.max(radius * 0.0004, 0.2) const drain = Math.max(radius * 0.0003, 0.15)
if (mech.energy > drain) { if (mech.energy > drain) {
mech.energy -= drain mech.energy -= drain
} else { } else {
@@ -1853,18 +1892,18 @@ const b = {
}); });
World.add(engine.world, bullet[bIndex]); //add bullet to world World.add(engine.world, bullet[bIndex]); //add bullet to world
}, },
swarm(speed = 0, spread = 2 * Math.PI) { iceIX(speed = 0, spread = 2 * Math.PI) {
const me = bullet.length; const me = bullet.length;
const THRUST = 0.004 const THRUST = 0.004
const dir = mech.angle + spread * (Math.random() - 0.5); const dir = mech.angle + spread * (Math.random() - 0.5);
const RADIUS = 17 * b.modBulletSize const RADIUS = 18 * b.modBulletSize
bullet[me] = Bodies.polygon(mech.pos.x + 30 * Math.cos(mech.angle), mech.pos.y + 30 * Math.sin(mech.angle), 3, RADIUS, { bullet[me] = Bodies.polygon(mech.pos.x + 30 * Math.cos(mech.angle), mech.pos.y + 30 * Math.sin(mech.angle), 3, RADIUS, {
angle: dir - Math.PI, angle: dir - Math.PI,
inertia: Infinity, inertia: Infinity,
friction: 0, friction: 0,
frictionAir: 0.10, frictionAir: 0.10,
restitution: 0.2, restitution: 0.2,
dmg: 0.3, //damage done in addition to the damage from momentum dmg: 0.25, //damage done in addition to the damage from momentum
lookFrequency: 10 + Math.floor(7 * Math.random()), lookFrequency: 10 + Math.floor(7 * Math.random()),
endCycle: game.cycle + 90 * b.isModBulletsLastLonger, //Math.floor((1200 + 420 * Math.random()) * b.isModBulletsLastLonger), endCycle: game.cycle + 90 * b.isModBulletsLastLonger, //Math.floor((1200 + 420 * Math.random()) * b.isModBulletsLastLonger),
classType: "bullet", classType: "bullet",
@@ -1876,6 +1915,7 @@ const b = {
lockedOn: null, lockedOn: null,
isFollowMouse: true, isFollowMouse: true,
onDmg(who) { onDmg(who) {
mobs.statusSlow(who, 30)
this.endCycle = game.cycle this.endCycle = game.cycle
if (b.isModAlphaRadiation) mobs.statusPoison(who, 0.08, 180) if (b.isModAlphaRadiation) mobs.statusPoison(who, 0.08, 180)
}, },
@@ -1884,7 +1924,7 @@ const b = {
// this.force.y += this.mass * 0.0002; // this.force.y += this.mass * 0.0002;
//find mob targets //find mob targets
if (!(game.cycle % this.lookFrequency)) { if (!(game.cycle % this.lookFrequency)) {
const scale = 0.9; const scale = 1 - 0.1 / b.isModBulletsLastLonger //0.9 * b.isModBulletsLastLonger;
Matter.Body.scale(this, scale, scale); Matter.Body.scale(this, scale, scale);
this.lockedOn = null; this.lockedOn = null;
let closeDist = Infinity; let closeDist = Infinity;
@@ -2282,19 +2322,29 @@ const b = {
name: "shotgun", //1 name: "shotgun", //1
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 bullets<br><em>crouch to reduce recoil</em>",
ammo: 0, ammo: 0,
ammoPack: 8, ammoPack: 11,
have: false, have: false,
isStarterGun: true, isStarterGun: true,
isEasyToAim: true, isEasyToAim: true,
fire() { fire() {
mech.fireCDcycle = mech.cycle + Math.floor((mech.crouch ? 55 : 30) * b.modFireRate); // cool down let knock, spread
if (b.isModShotgunImmune) mech.collisionImmuneCycle = mech.cycle + 30; //player is immune to collision damage for 30 cycles if (mech.crouch) {
mech.fireCDcycle = mech.cycle + Math.floor(55 * b.modFireRate); // cool down
spread = 0.75
knock = 0.01 * b.modBulletSize * b.modBulletSize
} else {
mech.fireCDcycle = mech.cycle + Math.floor(45 * b.modFireRate); // cool down
spread = 1.3
knock = 0.08 * b.modBulletSize * b.modBulletSize
}
player.force.x -= knock * Math.cos(mech.angle)
player.force.y -= knock * Math.sin(mech.angle) * 0.3 //reduce knock back in vertical direction to stop super jumps
if (b.isModShotgunImmune) mech.collisionImmuneCycle = mech.cycle + 60; //player is immune to collision damage for 30 cycles
b.muzzleFlash(35); b.muzzleFlash(35);
// mobs.alert(650); const side = 19 * b.modBulletSize
const side = 13 * b.modBulletSize for (let i = 0; i < 15; i++) {
for (let i = 0; i < 12; i++) {
const me = bullet.length; const me = bullet.length;
const dir = mech.angle + (Math.random() - 0.5) * (mech.crouch ? 0.40 : 1.2) const dir = mech.angle + (Math.random() - 0.5) * spread
bullet[me] = Bodies.rectangle(mech.pos.x + 35 * Math.cos(mech.angle) + 15 * (Math.random() - 0.5), mech.pos.y + 35 * Math.sin(mech.angle) + 15 * (Math.random() - 0.5), side, side, b.fireAttributes(dir)); bullet[me] = Bodies.rectangle(mech.pos.x + 35 * Math.cos(mech.angle) + 15 * (Math.random() - 0.5), mech.pos.y + 35 * Math.sin(mech.angle) + 15 * (Math.random() - 0.5), side, side, b.fireAttributes(dir));
World.add(engine.world, bullet[me]); //add bullet to world World.add(engine.world, bullet[me]); //add bullet to world
const SPEED = 50 + Math.random() * 10 const SPEED = 50 + Math.random() * 10
@@ -2302,17 +2352,15 @@ const b = {
x: SPEED * Math.cos(dir), x: SPEED * Math.cos(dir),
y: SPEED * Math.sin(dir) y: SPEED * Math.sin(dir)
}); });
bullet[me].endCycle = game.cycle + 55 bullet[me].endCycle = game.cycle + 40
bullet[me].frictionAir = 0.04; bullet[me].minDmgSpeed = 20
// bullet[me].dmg = 0.1
bullet[me].frictionAir = 0.034;
bullet[me].do = function () { bullet[me].do = function () {
this.force.y += this.mass * 0.001; const scale = 1 - 0.035 / b.isModBulletsLastLonger
Matter.Body.scale(this, scale, scale);
}; };
} }
//knock back
const KNOCK = ((mech.crouch) ? 0.01 : 0.07) * b.modBulletSize * b.modBulletSize
player.force.x -= KNOCK * Math.cos(mech.angle)
player.force.y -= KNOCK * Math.sin(mech.angle) * 0.3 //reduce knock back in vertical direction to stop super jumps
} }
}, },
{ {
@@ -2824,8 +2872,8 @@ const b = {
} }
}, },
{ {
name: "swarm", //11 name: "ice IX", //11
description: "rapidly deploy <strong>short-lived</strong> bots<br>that <strong>seek</strong> out nearby mobs", description: "synthesize <strong>short-lived</strong> ice crystals<br>crystals <strong>seek</strong> out and <strong class='color-s'>freeze</strong> mobs",
ammo: 0, ammo: 0,
ammoPack: 80, ammoPack: 80,
have: false, have: false,
@@ -2833,10 +2881,10 @@ const b = {
isEasyToAim: true, isEasyToAim: true,
fire() { fire() {
if (mech.crouch) { if (mech.crouch) {
b.swarm(20, 0.3) b.iceIX(20, 0.3)
mech.fireCDcycle = mech.cycle + Math.floor(10 * b.modFireRate); // cool down mech.fireCDcycle = mech.cycle + Math.floor(10 * b.modFireRate); // cool down
} else { } else {
b.swarm(2) b.iceIX(2)
mech.fireCDcycle = mech.cycle + Math.floor(3 * b.modFireRate); // cool down mech.fireCDcycle = mech.cycle + Math.floor(3 * b.modFireRate); // cool down
} }
@@ -2844,7 +2892,7 @@ const b = {
}, },
{ {
name: "foam", //12 name: "foam", //12
description: "spray bubbly foam that <strong>sticks</strong> to mobs<br>does <strong class='color-d'>damage</strong> over time and <strong>slows</strong> movement", description: "spray bubbly foam that <strong>sticks</strong> to mobs<br><strong class='color-s'>slows</strong> mobs and does <strong class='color-d'>damage</strong> over time",
ammo: 0, ammo: 0,
ammoPack: 35, ammoPack: 35,
have: false, have: false,

View File

@@ -177,6 +177,7 @@ const game = {
} }
} }
document.getElementById("mods").innerHTML = text document.getElementById("mods").innerHTML = text
b.modOnHealthChange()
}, },
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" />
@@ -468,6 +469,7 @@ const game = {
game.difficulty = 0; game.difficulty = 0;
game.difficultyMode = Number(document.getElementById("difficulty-select").value) game.difficultyMode = Number(document.getElementById("difficulty-select").value)
level.isBuildRun = false; level.isBuildRun = false;
build.isCustomSelection = false;
if (game.difficultyMode === 0) { if (game.difficultyMode === 0) {
game.isEasyMode = true; game.isEasyMode = true;
game.difficultyMode = 1 game.difficultyMode = 1

View File

@@ -71,7 +71,7 @@ const build = {
document.getElementById("pause-grid-left").style.display = "none" document.getElementById("pause-grid-left").style.display = "none"
document.getElementById("pause-grid-right").style.display = "none" document.getElementById("pause-grid-right").style.display = "none"
}, },
isCustomSelection: false, isCustomSelection: true,
choosePowerUp(who, index, type) { choosePowerUp(who, index, type) {
if (type === "gun") { if (type === "gun") {
let isDeselect = false let isDeselect = false
@@ -189,6 +189,7 @@ const build = {
}); });
}, },
reset() { reset() {
build.isCustomSelection = true;
mech.setField(0) mech.setField(0)
b.inventory = []; //removes guns and ammo b.inventory = []; //removes guns and ammo
@@ -201,7 +202,6 @@ const build = {
game.makeGunHUD(); game.makeGunHUD();
b.setupAllMods(); b.setupAllMods();
build.isCustomSelection = true;
build.populateGrid(); build.populateGrid();
document.getElementById("field-0").classList.add("build-field-selected"); document.getElementById("field-0").classList.add("build-field-selected");
document.getElementById("build-grid").style.display = "grid" document.getElementById("build-grid").style.display = "grid"
@@ -209,6 +209,8 @@ const build = {
startBuildRun() { startBuildRun() {
build.isCustomSelection = false; build.isCustomSelection = false;
b.modOnHealthChange()
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) {
@@ -242,6 +244,7 @@ document.getElementById("build-button").addEventListener("click", () => { //setu
level.isBuildRun = true; level.isBuildRun = true;
game.startGame(); //starts game, but pauses it game.startGame(); //starts game, but pauses it
build.isCustomSelection = true;
game.paused = true; game.paused = true;
build.reset(); build.reset();
}); });

View File

@@ -14,7 +14,7 @@ const level = {
start() { start() {
if (level.levelsCleared === 0) { if (level.levelsCleared === 0) {
// level.difficultyIncrease(9) // level.difficultyIncrease(9)
// b.giveGuns("swarm") b.giveGuns("shotgun")
// mech.setField("time dilation field") // mech.setField("time dilation field")
// b.giveMod("quantum immortality"); // b.giveMod("quantum immortality");
// b.giveMod("reflective cavity"); // b.giveMod("reflective cavity");

View File

@@ -124,8 +124,8 @@ const mobs = {
let dmg = b.dmgScale * tickDamage let dmg = b.dmgScale * tickDamage
who.damage(dmg); who.damage(dmg);
game.drawList.push({ //add dmg to draw queue game.drawList.push({ //add dmg to draw queue
x: who.position.x, x: who.position.x + (Math.random() - 0.5) * who.radius * 0.5,
y: who.position.y, y: who.position.y + (Math.random() - 0.5) * who.radius * 0.5,
radius: Math.log(2 * dmg + 1.1) * 40, radius: Math.log(2 * dmg + 1.1) * 40,
color: "rgba(0,80,80,0.9)", color: "rgba(0,80,80,0.9)",
time: game.drawTime time: game.drawTime
@@ -983,7 +983,7 @@ const mobs = {
if (!this.isShielded || isBypassShield) { if (!this.isShielded || isBypassShield) {
dmg /= Math.sqrt(this.mass) dmg /= Math.sqrt(this.mass)
if (this.shield) dmg *= 0.04 if (this.shield) dmg *= 0.04
if (b.isModLowHealthDmg) dmg *= (3 / (2 + mech.health)) //up to 50% dmg at zero player health if (b.isModLowHealthDmg) 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 (b.isModHarmDamage && mech.lastHarmCycle + 300 > mech.cycle) dmg *= 2; if (b.isModHarmDamage && mech.lastHarmCycle + 300 > mech.cycle) dmg *= 2;
if (b.isModEnergyLoss) dmg *= 1.5; if (b.isModEnergyLoss) dmg *= 1.5;
if (b.isModFarAwayDmg) 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 (b.isModFarAwayDmg) dmg *= 1 + Math.sqrt(Math.max(500, Math.min(3000, this.distanceToPlayer())) - 500) * 0.0067 //up to 50% dmg at max range of 3500

View File

@@ -469,7 +469,7 @@ const mech = {
} }
}, },
health: 0, health: 0,
maxHealth: null, //set in game.reset() maxHealth: 1, //set in game.reset()
drawHealth() { drawHealth() {
if (mech.health < 1) { if (mech.health < 1) {
ctx.fillStyle = "rgba(100, 100, 100, 0.5)"; ctx.fillStyle = "rgba(100, 100, 100, 0.5)";
@@ -549,6 +549,17 @@ const mech = {
if (Math.random() < 0.75) b.drone() //spawn drone if (Math.random() < 0.75) b.drone() //spawn drone
} }
} }
if (b.isModMineOnDamage && dmg > 0.05 + 0.5 * Math.random()) {
b.mine({
x: mech.pos.x,
y: mech.pos.y - 80
}, {
x: 0,
y: 0
})
}
// freeze game and display a full screen red color // freeze game and display a full screen red color
if (dmg > 0.05) { if (dmg > 0.05) {
@@ -696,7 +707,7 @@ const mech = {
ctx.restore(); ctx.restore();
}, },
// ********************************************* // *********************************************
// **************** holding ******************** // **************** fields *********************
// ********************************************* // *********************************************
closest: { closest: {
dist: 1000, dist: 1000,
@@ -1683,15 +1694,15 @@ const mech = {
mech.hold = function () { mech.hold = function () {
if (mech.energy > mech.fieldEnergyMax - 0.02 && mech.fieldCDcycle < mech.cycle) { if (mech.energy > mech.fieldEnergyMax - 0.02 && mech.fieldCDcycle < mech.cycle) {
if (b.isModSporeField) { if (b.isModSporeField) {
mech.fieldCDcycle = mech.cycle + 17; // set cool down to prevent +energy from making huge numbers of drones mech.fieldCDcycle = mech.cycle + 10; // set cool down to prevent +energy from making huge numbers of drones
const len = Math.floor(6 + 3 * Math.random()) const len = Math.floor(6 + 4 * Math.random())
mech.energy -= len * 0.07; mech.energy -= len * 0.06;
for (let i = 0; i < len; i++) { for (let i = 0; i < len; i++) {
b.spore(player) b.spore(player)
} }
} else if (b.isModMissileField) { } else if (b.isModMissileField) {
mech.fieldCDcycle = mech.cycle + 17; // set cool down to prevent +energy from making huge numbers of drones mech.fieldCDcycle = mech.cycle + 10; // set cool down to prevent +energy from making huge numbers of drones
mech.energy -= 0.5; mech.energy -= 0.44;
b.missile({ b.missile({
x: mech.pos.x + 40 * Math.cos(mech.angle), x: mech.pos.x + 40 * Math.cos(mech.angle),
y: mech.pos.y + 40 * Math.sin(mech.angle) - 3 y: mech.pos.y + 40 * Math.sin(mech.angle) - 3
@@ -1699,13 +1710,13 @@ const mech = {
mech.angle + (0.5 - Math.random()) * (mech.crouch ? 0 : 0.2), mech.angle + (0.5 - Math.random()) * (mech.crouch ? 0 : 0.2),
-3 * (0.5 - Math.random()) + (mech.crouch ? 25 : -8) * b.modFireRate, -3 * (0.5 - Math.random()) + (mech.crouch ? 25 : -8) * b.modFireRate,
1, b.modBabyMissiles) 1, b.modBabyMissiles)
} else if (b.isModSwarmField) { } else if (b.isModIceField) {
// mech.fieldCDcycle = mech.cycle + 17; // set cool down to prevent +energy from making huge numbers of drones // mech.fieldCDcycle = mech.cycle + 17; // set cool down to prevent +energy from making huge numbers of drones
mech.energy -= 0.05; mech.energy -= 0.055;
b.swarm(1) b.iceIX(1)
} else { } else {
mech.fieldCDcycle = mech.cycle + 17; // set cool down to prevent +energy from making huge numbers of drones mech.fieldCDcycle = mech.cycle + 10; // set cool down to prevent +energy from making huge numbers of drones
mech.energy -= 0.33; mech.energy -= 0.34;
b.drone(1) b.drone(1)
} }

View File

@@ -241,7 +241,7 @@ const powerUps = {
if (Math.random() < b.isModBayesian) powerUps.spawn(x, y, "mod"); if (Math.random() < b.isModBayesian) powerUps.spawn(x, y, "mod");
return; return;
} }
if (Math.random() < 0.002) { if (Math.random() < 0.006) {
powerUps.spawn(x, y, "field"); powerUps.spawn(x, y, "field");
if (Math.random() < b.isModBayesian) powerUps.spawn(x, y, "field"); if (Math.random() < b.isModBayesian) powerUps.spawn(x, y, "field");
return; return;
@@ -251,16 +251,18 @@ const powerUps = {
if (mech.fieldMode === 0) { if (mech.fieldMode === 0) {
powerUps.spawn(x, y, "field") powerUps.spawn(x, y, "field")
if (Math.random() < b.isModBayesian) powerUps.spawn(x, y, "field") if (Math.random() < b.isModBayesian) powerUps.spawn(x, y, "field")
} else if (Math.random() < 0.85) { } else if (Math.random() < 0.9) {
powerUps.spawn(x, y, "mod") powerUps.spawn(x, y, "mod")
if (Math.random() < b.isModBayesian) powerUps.spawn(x, y, "mod") if (Math.random() < b.isModBayesian) powerUps.spawn(x, y, "mod")
} else if (Math.random() < 0.35) { } else if (Math.random() < 0.5) {
powerUps.spawn(x, y, "gun") powerUps.spawn(x, y, "gun")
if (Math.random() < b.isModBayesian) powerUps.spawn(x, y, "gun") if (Math.random() < b.isModBayesian) powerUps.spawn(x, y, "gun")
} else if (Math.random() < 0.5) { // } else if (Math.random() < 0.5) {
powerUps.spawn(x, y, "field"); // powerUps.spawn(x, y, "field");
if (Math.random() < b.isModBayesian) powerUps.spawn(x, y, "field"); // if (Math.random() < b.isModBayesian) powerUps.spawn(x, y, "field");
} else if (mech.health < 0.7) { } else if (mech.health < 0.65) {
powerUps.spawn(x, y, "heal");
powerUps.spawn(x, y, "heal");
powerUps.spawn(x, y, "heal"); powerUps.spawn(x, y, "heal");
powerUps.spawn(x, y, "heal"); powerUps.spawn(x, y, "heal");
powerUps.spawn(x, y, "heal"); powerUps.spawn(x, y, "heal");
@@ -268,17 +270,19 @@ const powerUps = {
if (Math.random() < b.isModBayesian) { if (Math.random() < b.isModBayesian) {
powerUps.spawn(x, y, "heal"); powerUps.spawn(x, y, "heal");
powerUps.spawn(x, y, "heal"); powerUps.spawn(x, y, "heal");
powerUps.spawn(x, y, "heal");
} }
} else if (!b.isModNoAmmo) { } else if (!b.isModNoAmmo) {
powerUps.spawn(x, y, "ammo"); powerUps.spawn(x, y, "ammo");
powerUps.spawn(x, y, "ammo"); powerUps.spawn(x, y, "ammo");
powerUps.spawn(x, y, "ammo"); powerUps.spawn(x, y, "ammo");
powerUps.spawn(x, y, "ammo"); powerUps.spawn(x, y, "ammo");
powerUps.spawn(x, y, "ammo");
if (Math.random() < b.isModBayesian) { if (Math.random() < b.isModBayesian) {
powerUps.spawn(x, y, "ammo"); powerUps.spawn(x, y, "ammo");
powerUps.spawn(x, y, "ammo"); powerUps.spawn(x, y, "ammo");
powerUps.spawn(x, y, "ammo");
} }
} }
}, },
chooseRandomPowerUp(x, y) { //100% chance to drop a random power up //used in spawn.debris chooseRandomPowerUp(x, y) { //100% chance to drop a random power up //used in spawn.debris

View File

@@ -416,6 +416,11 @@ em {
letter-spacing: 1px; letter-spacing: 1px;
} }
.color-s {
color: #04f;
letter-spacing: 1px;
}
.color-d { .color-d {
color: #f03; color: #f03;
letter-spacing: 1px; letter-spacing: 1px;

View File

@@ -1,23 +1,12 @@
**New Patch** shotgun hits harder up close and weaker far away
gun - swarm(although I'd like to think up a better name) swarm is now called ice IX and it freezes mobs
mod - alpha radiation - swarm does DOT damage mod - ablative mines
mod - nano-scale field makes swarm bots acid and negative feedback now tell you when they are active
mod - radiation equilibrium - do extra damage after getting hit
laserBoss has a locked rotation, and rotates backwards at high levels
minigun - +20% ammo
laser - +10 damage
************** TODO - n-gon ************** ************** TODO - n-gon **************
power up - player controlled bot power up that actives on pick up MOB stabber - extends one vector like the shooter, but quickly in order to stab
controls and camera follow the bot
bot can explore
bot can attack?
by crashing into things?
with laser or nails?
ends when field is activated? or fire? or bot gets hit
mod - frag grenades fire nails on explosion mod - frag grenades fire nails on explosion
@@ -45,6 +34,7 @@ mod - mines become a turret that fires nails
dash - mod when pressing left or right on the ground, teleport to the right until you find an obstruction dash - mod when pressing left or right on the ground, teleport to the right until you find an obstruction
do repeated horizontal zone queries until they hit map or block do repeated horizontal zone queries until they hit map or block
up to a max range of like 10 player widths up to a max range of like 10 player widths
this didn't work as a field, but maybe as a gun?
mod - blocks stun mobs mod - blocks stun mobs
mod or field - turn blocks into spores or drones mod or field - turn blocks into spores or drones
@@ -59,6 +49,7 @@ bug - getting stuck in crouch mode
once right after selecting a mod with lots of blocks around once right after selecting a mod with lots of blocks around
I don't think I was holding a block I don't think I was holding a block
might have been standing on a block... not sure might have been standing on a block... not sure
running mech.definePlayerMass() fixes it
settings - auto aim at nearest mob settings - auto aim at nearest mob
settings - custom keys binding settings - custom keys binding
@@ -72,9 +63,6 @@ gun - buff vacuum bomb
mod - double explosions? mod - double explosions?
mod - doesn't suck player in? mod - doesn't suck player in?
mod - DoT damage after exploding mod - DoT damage after exploding
mod - make bodies destroyable
they drop ammo and heals
mod - energy recharges faster when not moving mod - energy recharges faster when not moving
@@ -102,7 +90,7 @@ atmosphere levels: change the pace, give the user a rest between combat
in the final level you see your self at the starting level, with the wires in the final level you see your self at the starting level, with the wires
you shoot your self to wake up? you shoot your self to wake up?
mob: targeting laser, then a high speed, no gravity bullet MOB sniper - targeting laser, then a high speed, no gravity bullet
mod - status effects last 1 second longer mod - status effects last 1 second longer
wait until you have more status effects written wait until you have more status effects written