complex spinstatistics
tech: active cooling - 15% faster fire rate for each gun in your inventory tech: specialist - spawn a random power up for each gun in your inventory (not available in custom, requires tech: generalist) tech: complex spin-statistics - become immune to harm for 1s every 7s requires Pauli exclusion even less difficulty ramp after killing final boss
This commit is contained in:
181
js/bullet.js
181
js/bullet.js
@@ -36,6 +36,68 @@ const b = {
|
||||
if (mech.holdingTarget) mech.drop();
|
||||
}
|
||||
},
|
||||
giveGuns(gun = "random", ammoPacks = 10) {
|
||||
if (tech.isOneGun) b.removeAllGuns();
|
||||
if (gun === "random") {
|
||||
//find what guns player doesn't have
|
||||
options = []
|
||||
for (let i = 0, len = b.guns.length; i < len; i++) {
|
||||
if (!b.guns[i].have) options.push(i)
|
||||
}
|
||||
if (options.length === 0) return
|
||||
//randomly pick from list of possible guns
|
||||
gun = options[Math.floor(Math.random() * options.length)]
|
||||
}
|
||||
if (gun === "all") {
|
||||
b.activeGun = 0;
|
||||
b.inventoryGun = 0;
|
||||
for (let i = 0; i < b.guns.length; i++) {
|
||||
b.inventory[i] = i;
|
||||
b.guns[i].have = true;
|
||||
b.guns[i].ammo = Math.floor(b.guns[i].ammoPack * ammoPacks);
|
||||
}
|
||||
} else {
|
||||
if (isNaN(gun)) { //find gun by name
|
||||
let found = false;
|
||||
for (let i = 0; i < b.guns.length; i++) {
|
||||
if (gun === b.guns[i].name) {
|
||||
gun = i
|
||||
found = true;
|
||||
break
|
||||
}
|
||||
}
|
||||
if (!found) return //if no gun found don't give a gun
|
||||
}
|
||||
if (!b.guns[gun].have) b.inventory.push(gun);
|
||||
b.guns[gun].have = true;
|
||||
b.guns[gun].ammo = Math.floor(b.guns[gun].ammoPack * ammoPacks);
|
||||
if (b.activeGun === null) b.activeGun = gun //if no active gun switch to new gun
|
||||
}
|
||||
simulation.makeGunHUD();
|
||||
b.setFireCD();
|
||||
},
|
||||
removeGun(gun, isRemoveSelection = false) {
|
||||
for (let i = 0; i < b.guns.length; i++) {
|
||||
if (b.guns[i].name === gun) {
|
||||
b.guns[i].have = false
|
||||
for (let j = 0; j < b.inventory.length; j++) {
|
||||
if (b.inventory[j] === i) {
|
||||
b.inventory.splice(j, 1)
|
||||
break
|
||||
}
|
||||
}
|
||||
if (b.inventory.length) {
|
||||
b.activeGun = b.inventory[0];
|
||||
} else {
|
||||
b.activeGun = null;
|
||||
}
|
||||
simulation.makeGunHUD();
|
||||
if (isRemoveSelection) b.guns.splice(i, 1) //also remove gun from gun pool array
|
||||
break
|
||||
}
|
||||
}
|
||||
b.setFireCD();
|
||||
},
|
||||
removeAllGuns() {
|
||||
b.inventory = []; //removes guns and ammo
|
||||
for (let i = 0, len = b.guns.length; i < len; ++i) {
|
||||
@@ -89,6 +151,7 @@ const b = {
|
||||
fireCD: 1,
|
||||
setFireCD() {
|
||||
b.fireCD = tech.fireRate * tech.slowFire * tech.researchHaste * tech.aimDamage / tech.fastTime
|
||||
if (tech.isFireRateForGuns) b.fireCD *= Math.pow(0.85, b.inventory.length)
|
||||
},
|
||||
fireAttributes(dir, rotate = true) {
|
||||
if (rotate) {
|
||||
@@ -1213,12 +1276,12 @@ const b = {
|
||||
});
|
||||
|
||||
if (tech.isLaserPush) { //push mobs away
|
||||
console.log(-0.003 * Math.min(4, best.who.mass), dmg)
|
||||
// console.log(-0.003 * Math.min(4, best.who.mass), dmg)
|
||||
const index = path.length - 1
|
||||
// const force = Vector.mult(Vector.normalise(Vector.sub(path[Math.max(0, index - 1)], path[index])), -0.003 * Math.min(4, best.who.mass))
|
||||
// const push = -0.004 / (1 + tech.beamSplitter + tech.wideLaser + tech.historyLaser)
|
||||
// console.log(push)
|
||||
const force = Vector.mult(Vector.normalise(Vector.sub(path[index], path[Math.max(0, index - 1)])), 0.004 * push * Math.min(4, best.who.mass))
|
||||
const force = Vector.mult(Vector.normalise(Vector.sub(path[index], path[Math.max(0, index - 1)])), 0.003 * push * Math.min(6, best.who.mass))
|
||||
Matter.Body.applyForce(best.who, path[index], force)
|
||||
// Matter.Body.setVelocity(best.who, { //friction
|
||||
// x: best.who.velocity.x * 0.7,
|
||||
@@ -1975,13 +2038,13 @@ const b = {
|
||||
// **************************************************************************************************
|
||||
// **************************************************************************************************
|
||||
respawnBots() {
|
||||
for (let i = 0; i < tech.laserBotCount; i++) b.laserBot()
|
||||
for (let i = 0; i < tech.nailBotCount; i++) b.nailBot()
|
||||
for (let i = 0; i < tech.foamBotCount; i++) b.foamBot()
|
||||
for (let i = 0; i < tech.boomBotCount; i++) b.boomBot()
|
||||
for (let i = 0; i < tech.orbitBotCount; i++) b.orbitBot()
|
||||
for (let i = 0; i < tech.plasmaBotCount; i++) b.plasmaBot()
|
||||
for (let i = 0; i < tech.missileBotCount; i++) b.missileBot()
|
||||
for (let i = 0; i < tech.laserBotCount; i++) b.laserBot({ x: mech.pos.x + 50 * (Math.random() - 0.5), y: mech.pos.y + 50 * (Math.random() - 0.5) }, false)
|
||||
for (let i = 0; i < tech.nailBotCount; i++) b.nailBot({ x: mech.pos.x + 50 * (Math.random() - 0.5), y: mech.pos.y + 50 * (Math.random() - 0.5) }, false)
|
||||
for (let i = 0; i < tech.foamBotCount; i++) b.foamBot({ x: mech.pos.x + 50 * (Math.random() - 0.5), y: mech.pos.y + 50 * (Math.random() - 0.5) }, false)
|
||||
for (let i = 0; i < tech.boomBotCount; i++) b.boomBot({ x: mech.pos.x + 50 * (Math.random() - 0.5), y: mech.pos.y + 50 * (Math.random() - 0.5) }, false)
|
||||
for (let i = 0; i < tech.orbitBotCount; i++) b.orbitBot({ x: mech.pos.x + 50 * (Math.random() - 0.5), y: mech.pos.y + 50 * (Math.random() - 0.5) }, false)
|
||||
for (let i = 0; i < tech.plasmaBotCount; i++) b.plasmaBot({ x: mech.pos.x + 50 * (Math.random() - 0.5), y: mech.pos.y + 50 * (Math.random() - 0.5) }, false)
|
||||
for (let i = 0; i < tech.missileBotCount; i++) b.missileBot({ x: mech.pos.x + 50 * (Math.random() - 0.5), y: mech.pos.y + 50 * (Math.random() - 0.5) }, false)
|
||||
if (tech.isIntangible && mech.isCloak) {
|
||||
for (let i = 0; i < bullet.length; i++) {
|
||||
if (bullet[i].botType) bullet[i].collisionFilter.mask = cat.map | cat.bullet | cat.mobBullet | cat.mobShield
|
||||
@@ -1993,7 +2056,7 @@ const b = {
|
||||
b.laserBot(where)
|
||||
if (isKeep) tech.laserBotCount++;
|
||||
} else if (Math.random() < 0.25 && isAll) {
|
||||
b.orbitBot();
|
||||
b.orbitBot(where);
|
||||
if (isKeep) tech.orbitBotCount++;
|
||||
} else if (Math.random() < 0.33) {
|
||||
b.nailBot(where)
|
||||
@@ -2006,8 +2069,8 @@ const b = {
|
||||
if (isKeep) tech.boomBotCount++;
|
||||
}
|
||||
},
|
||||
nailBot(position = { x: mech.pos.x + 50 * (Math.random() - 0.5), y: mech.pos.y + 50 * (Math.random() - 0.5) }) {
|
||||
simulation.makeTextLog(`<span class='color-var'>b</span>.nailBot()`);
|
||||
nailBot(position = { x: mech.pos.x + 50 * (Math.random() - 0.5), y: mech.pos.y + 50 * (Math.random() - 0.5) }, isConsole = true) {
|
||||
if (isConsole) simulation.makeTextLog(`<span class='color-var'>b</span>.nailBot()`);
|
||||
const me = bullet.length;
|
||||
const dir = mech.angle;
|
||||
const RADIUS = (12 + 4 * Math.random())
|
||||
@@ -2062,8 +2125,8 @@ const b = {
|
||||
})
|
||||
World.add(engine.world, bullet[me]); //add bullet to world
|
||||
},
|
||||
missileBot(position = { x: mech.pos.x + 50 * (Math.random() - 0.5), y: mech.pos.y + 50 * (Math.random() - 0.5) }) {
|
||||
simulation.makeTextLog(`<span class='color-var'>b</span>.missileBot()`);
|
||||
missileBot(position = { x: mech.pos.x + 50 * (Math.random() - 0.5), y: mech.pos.y + 50 * (Math.random() - 0.5) }, isConsole = true) {
|
||||
if (isConsole) simulation.makeTextLog(`<span class='color-var'>b</span>.missileBot()`);
|
||||
const me = bullet.length;
|
||||
bullet[me] = Bodies.rectangle(position.x, position.y, 28, 11, {
|
||||
botType: "foam",
|
||||
@@ -2112,8 +2175,8 @@ const b = {
|
||||
})
|
||||
World.add(engine.world, bullet[me]); //add bullet to world
|
||||
},
|
||||
foamBot(position = { x: mech.pos.x + 50 * (Math.random() - 0.5), y: mech.pos.y + 50 * (Math.random() - 0.5) }) {
|
||||
simulation.makeTextLog(`<span class='color-var'>b</span>.foamBot()`);
|
||||
foamBot(position = { x: mech.pos.x + 50 * (Math.random() - 0.5), y: mech.pos.y + 50 * (Math.random() - 0.5) }, isConsole = true) {
|
||||
if (isConsole) simulation.makeTextLog(`<span class='color-var'>b</span>.foamBot()`);
|
||||
const me = bullet.length;
|
||||
const dir = mech.angle;
|
||||
const RADIUS = (10 + 5 * Math.random())
|
||||
@@ -2167,8 +2230,8 @@ const b = {
|
||||
})
|
||||
World.add(engine.world, bullet[me]); //add bullet to world
|
||||
},
|
||||
laserBot(position = { x: mech.pos.x + 50 * (Math.random() - 0.5), y: mech.pos.y + 50 * (Math.random() - 0.5) }) {
|
||||
simulation.makeTextLog(`<span class='color-var'>b</span>.laserBot()`);
|
||||
laserBot(position = { x: mech.pos.x + 50 * (Math.random() - 0.5), y: mech.pos.y + 50 * (Math.random() - 0.5) }, isConsole = true) {
|
||||
if (isConsole) simulation.makeTextLog(`<span class='color-var'>b</span>.laserBot()`);
|
||||
const me = bullet.length;
|
||||
const dir = mech.angle;
|
||||
const RADIUS = (14 + 6 * Math.random())
|
||||
@@ -2252,8 +2315,8 @@ const b = {
|
||||
})
|
||||
World.add(engine.world, bullet[me]); //add bullet to world
|
||||
},
|
||||
boomBot(position = { x: mech.pos.x + 50 * (Math.random() - 0.5), y: mech.pos.y + 50 * (Math.random() - 0.5) }) {
|
||||
simulation.makeTextLog(`<span class='color-var'>b</span>.boomBot()`);
|
||||
boomBot(position = { x: mech.pos.x + 50 * (Math.random() - 0.5), y: mech.pos.y + 50 * (Math.random() - 0.5) }, isConsole = true) {
|
||||
if (isConsole) simulation.makeTextLog(`<span class='color-var'>b</span>.boomBot()`);
|
||||
const me = bullet.length;
|
||||
const dir = mech.angle;
|
||||
const RADIUS = (7 + 2 * Math.random())
|
||||
@@ -2331,8 +2394,8 @@ const b = {
|
||||
})
|
||||
World.add(engine.world, bullet[me]); //add bullet to world
|
||||
},
|
||||
plasmaBot(position = { x: mech.pos.x + 50 * (Math.random() - 0.5), y: mech.pos.y + 50 * (Math.random() - 0.5) }) {
|
||||
simulation.makeTextLog(`<span class='color-var'>b</span>.plasmaBot()`);
|
||||
plasmaBot(position = { x: mech.pos.x + 50 * (Math.random() - 0.5), y: mech.pos.y + 50 * (Math.random() - 0.5) }, isConsole = true) {
|
||||
if (isConsole) simulation.makeTextLog(`<span class='color-var'>b</span>.plasmaBot()`);
|
||||
const me = bullet.length;
|
||||
const dir = mech.angle;
|
||||
const RADIUS = 21
|
||||
@@ -2516,8 +2579,8 @@ const b = {
|
||||
})
|
||||
World.add(engine.world, bullet[me]); //add bullet to world
|
||||
},
|
||||
orbitBot(position = mech.pos) {
|
||||
simulation.makeTextLog(`<span class='color-var'>b</span>.orbitBot()`);
|
||||
orbitBot(position = mech.pos, isConsole = true) {
|
||||
if (isConsole) simulation.makeTextLog(`<span class='color-var'>b</span>.orbitBot()`);
|
||||
const me = bullet.length;
|
||||
bullet[me] = Bodies.polygon(position.x, position.y, 9, 12, {
|
||||
isUpgraded: tech.isOrbitBotUpgrade,
|
||||
@@ -2616,66 +2679,6 @@ const b = {
|
||||
// ******************************** Guns *********************************************
|
||||
// **************************************************************************************************
|
||||
// **************************************************************************************************
|
||||
giveGuns(gun = "random", ammoPacks = 10) {
|
||||
if (tech.isOneGun) b.removeAllGuns();
|
||||
if (gun === "random") {
|
||||
//find what guns player doesn't have
|
||||
options = []
|
||||
for (let i = 0, len = b.guns.length; i < len; i++) {
|
||||
if (!b.guns[i].have) options.push(i)
|
||||
}
|
||||
if (options.length === 0) return
|
||||
//randomly pick from list of possible guns
|
||||
gun = options[Math.floor(Math.random() * options.length)]
|
||||
}
|
||||
if (gun === "all") {
|
||||
b.activeGun = 0;
|
||||
b.inventoryGun = 0;
|
||||
for (let i = 0; i < b.guns.length; i++) {
|
||||
b.inventory[i] = i;
|
||||
b.guns[i].have = true;
|
||||
b.guns[i].ammo = Math.floor(b.guns[i].ammoPack * ammoPacks);
|
||||
}
|
||||
} else {
|
||||
if (isNaN(gun)) { //find gun by name
|
||||
let found = false;
|
||||
for (let i = 0; i < b.guns.length; i++) {
|
||||
if (gun === b.guns[i].name) {
|
||||
gun = i
|
||||
found = true;
|
||||
break
|
||||
}
|
||||
}
|
||||
if (!found) return //if no gun found don't give a gun
|
||||
}
|
||||
if (!b.guns[gun].have) b.inventory.push(gun);
|
||||
b.guns[gun].have = true;
|
||||
b.guns[gun].ammo = Math.floor(b.guns[gun].ammoPack * ammoPacks);
|
||||
if (b.activeGun === null) b.activeGun = gun //if no active gun switch to new gun
|
||||
}
|
||||
simulation.makeGunHUD();
|
||||
},
|
||||
removeGun(gun, isRemoveSelection = false) {
|
||||
for (let i = 0; i < b.guns.length; i++) {
|
||||
if (b.guns[i].name === gun) {
|
||||
b.guns[i].have = false
|
||||
for (let j = 0; j < b.inventory.length; j++) {
|
||||
if (b.inventory[j] === i) {
|
||||
b.inventory.splice(j, 1)
|
||||
break
|
||||
}
|
||||
}
|
||||
if (b.inventory.length) {
|
||||
b.activeGun = b.inventory[0];
|
||||
} else {
|
||||
b.activeGun = null;
|
||||
}
|
||||
simulation.makeGunHUD();
|
||||
if (isRemoveSelection) b.guns.splice(i, 1) //also remove gun from gun pool array
|
||||
break
|
||||
}
|
||||
}
|
||||
},
|
||||
guns: [{
|
||||
name: "nail gun",
|
||||
description: "use compressed air to fire a stream of <strong>nails</strong><br><strong>delay</strong> after firing <strong>decreases</strong> as you shoot",
|
||||
@@ -4017,7 +4020,7 @@ const b = {
|
||||
b.laser(where, {
|
||||
x: where.x + 3000 * Math.cos(angle),
|
||||
y: where.y + 3000 * Math.sin(angle)
|
||||
}, dmg, 0, true, 0.4)
|
||||
}, dmg, 0, true, 0.3)
|
||||
for (let i = 1; i < tech.wideLaser; i++) {
|
||||
let whereOff = Vector.add(where, {
|
||||
x: i * off * Math.cos(angle + Math.PI / 2),
|
||||
@@ -4026,7 +4029,7 @@ const b = {
|
||||
b.laser(whereOff, {
|
||||
x: whereOff.x + 3000 * Math.cos(angle),
|
||||
y: whereOff.y + 3000 * Math.sin(angle)
|
||||
}, dmg, 0, true, 0.4)
|
||||
}, dmg, 0, true, 0.3)
|
||||
whereOff = Vector.add(where, {
|
||||
x: i * off * Math.cos(angle - Math.PI / 2),
|
||||
y: i * off * Math.sin(angle - Math.PI / 2)
|
||||
@@ -4034,7 +4037,7 @@ const b = {
|
||||
b.laser(whereOff, {
|
||||
x: whereOff.x + 3000 * Math.cos(angle),
|
||||
y: whereOff.y + 3000 * Math.sin(angle)
|
||||
}, dmg, 0, true, 0.4)
|
||||
}, dmg, 0, true, 0.3)
|
||||
}
|
||||
ctx.stroke();
|
||||
ctx.globalAlpha = 1;
|
||||
@@ -4071,7 +4074,7 @@ const b = {
|
||||
}, {
|
||||
x: mech.pos.x + 3000 * Math.cos(mech.angle),
|
||||
y: mech.pos.y + 3000 * Math.sin(mech.angle)
|
||||
}, dmg, 0, true, 0.3);
|
||||
}, dmg, 0, true, 0.2);
|
||||
for (let i = 1; i < len; i++) {
|
||||
const history = mech.history[(mech.cycle - i * spacing) % 600]
|
||||
b.laser({
|
||||
@@ -4080,7 +4083,7 @@ const b = {
|
||||
}, {
|
||||
x: history.position.x + 3000 * Math.cos(history.angle),
|
||||
y: history.position.y + 3000 * Math.sin(history.angle) - mech.yPosDifference
|
||||
}, dmg, 0, true, 0.3);
|
||||
}, dmg, 0, true, 0.2);
|
||||
}
|
||||
ctx.stroke();
|
||||
}
|
||||
|
||||
@@ -201,8 +201,7 @@ const build = {
|
||||
<text x="5" y="18">copy build url</text>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
</div>`;
|
||||
</div>`;
|
||||
for (let i = 0, len = b.inventory.length; i < len; i++) {
|
||||
text += `<div class="pause-grid-module"><div class="grid-title"><div class="circle-grid gun"></div> ${b.guns[b.inventory[i]].name} - <span style="font-size:100%;font-weight: 100;">${b.guns[b.inventory[i]].ammo}</span></div> ${b.guns[b.inventory[i]].description}</div>`
|
||||
}
|
||||
@@ -744,6 +743,7 @@ window.addEventListener("keydown", function(event) {
|
||||
break
|
||||
}
|
||||
if (simulation.testing) {
|
||||
if (event.key === "X") mech.death(); //only uppercase
|
||||
switch (event.key.toLowerCase()) {
|
||||
case "o":
|
||||
simulation.isAutoZoom = false;
|
||||
@@ -826,9 +826,6 @@ window.addEventListener("keydown", function(event) {
|
||||
case "u":
|
||||
level.nextLevel();
|
||||
break
|
||||
case "X": //capital X to make it hard to die
|
||||
mech.death();
|
||||
break
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -61,7 +61,7 @@ const level = {
|
||||
b.respawnBots();
|
||||
mech.resetHistory();
|
||||
if (tech.isArmorFromPowerUps) {
|
||||
const gain = Math.min(0.04 * powerUps.totalPowerUps, 0.40)
|
||||
const gain = Math.min(0.03 * powerUps.totalPowerUps, 0.42)
|
||||
tech.armorFromPowerUps += gain
|
||||
mech.setMaxHealth();
|
||||
// if (powerUps.totalPowerUps) simulation.makeTextLog("<span style='font-size:115%;'> max health increased by " + (gain * 100).toFixed(0) + "%</span>", 300)
|
||||
|
||||
19
js/player.js
19
js/player.js
@@ -429,7 +429,6 @@ const mech = {
|
||||
}
|
||||
simulation.isTextLogOpen = true;
|
||||
simulation.makeTextLog("simulation.amplitude <span class='color-symbol'>=</span> null");
|
||||
|
||||
}, 6 * swapPeriod);
|
||||
|
||||
} else if (mech.alive) { //normal death code here
|
||||
@@ -482,8 +481,10 @@ const mech = {
|
||||
},
|
||||
baseHealth: 1,
|
||||
setMaxHealth() {
|
||||
mech.maxHealth = mech.baseHealth + tech.bonusHealth + tech.armorFromPowerUps
|
||||
if (mech.health > mech.maxHealth) mech.health = mech.maxHealth;
|
||||
const set = mech.baseHealth + tech.bonusHealth + tech.armorFromPowerUps
|
||||
simulation.makeTextLog(`<span class='color-var'>mech</span>.maxHealth <span class='color-symbol'>=</span> ${set}`)
|
||||
mech.maxHealth = set
|
||||
if(mech.health > mech.maxHealth) mech.health = mech.maxHealth;
|
||||
mech.displayHealth();
|
||||
},
|
||||
|
||||
@@ -604,7 +605,9 @@ const mech = {
|
||||
},
|
||||
damage(dmg) {
|
||||
if (tech.isRewindAvoidDeath && mech.energy > 0.66) {
|
||||
mech.rewind(Math.floor(Math.min(299, 137 * mech.energy)))
|
||||
const steps = Math.floor(Math.min(299, 137 * mech.energy))
|
||||
simulation.makeTextLog(`<span class='color-var'>mech</span>.rewind(${steps})`)
|
||||
mech.rewind(steps)
|
||||
return
|
||||
}
|
||||
mech.lastHarmCycle = mech.cycle
|
||||
@@ -621,8 +624,7 @@ const mech = {
|
||||
if (tech.isDeathAvoid && powerUps.research.research && !tech.isDeathAvoidedThisLevel) {
|
||||
tech.isDeathAvoidedThisLevel = true
|
||||
powerUps.research.changeRerolls(-1)
|
||||
simulation.makeTextLog(`<span class='color-var'>mech</span>.<span class='color-r'>research</span><span class='color-symbol'>--</span>
|
||||
<br>${powerUps.research.research}`)
|
||||
simulation.makeTextLog(`<span class='color-var'>mech</span>.<span class='color-r'>research</span><span class='color-symbol'>--</span><br>${powerUps.research.research}`)
|
||||
for (let i = 0; i < 6; i++) {
|
||||
powerUps.spawn(mech.pos.x, mech.pos.y, "heal", false);
|
||||
}
|
||||
@@ -655,9 +657,7 @@ const mech = {
|
||||
powerUps.research.changeRerolls(-1)
|
||||
simulation.makeTextLog(`<span class='color-var'>mech</span>.<span class='color-r'>research</span><span class='color-symbol'>--</span>
|
||||
<br>${powerUps.research.research}`)
|
||||
for (let i = 0; i < 6; i++) {
|
||||
powerUps.spawn(mech.pos.x, mech.pos.y, "heal", false);
|
||||
}
|
||||
for (let i = 0; i < 6; i++) powerUps.spawn(mech.pos.x + 10 * Math.random(), mech.pos.y + 10 * Math.random(), "heal", false);
|
||||
mech.immuneCycle = mech.cycle + 360 //disable this.immuneCycle bonus seconds
|
||||
simulation.wipe = function() { //set wipe to have trails
|
||||
ctx.fillStyle = "rgba(255,255,255,0.03)";
|
||||
@@ -900,6 +900,7 @@ const mech = {
|
||||
},
|
||||
setMaxEnergy() {
|
||||
mech.maxEnergy = (tech.isMaxEnergyTech ? 0.5 : 1) + tech.bonusEnergy + tech.healMaxEnergyBonus
|
||||
simulation.makeTextLog(`<span class='color-var'>mech</span>.maxEnergy <span class='color-symbol'>=</span> ${mech.maxEnergy}`)
|
||||
},
|
||||
fieldMeterColor: "#0cf",
|
||||
drawFieldMeter(bgColor = "rgba(0, 0, 0, 0.4)", range = 60) {
|
||||
|
||||
@@ -6,10 +6,10 @@ const powerUps = {
|
||||
if (type === "gun") {
|
||||
b.giveGuns(index)
|
||||
let text = `b.giveGuns("<span class='color-text'>${b.guns[index].name}</span>")`
|
||||
if (b.inventory.length === 1) text += `<br>input.key.gun <span class='color-symbol'>=</span> ["<span class='color-text'>MouseLeft</span>"]`
|
||||
if (b.inventory.length === 1) text += `<br>input.key.gun<span class='color-symbol'>:</span> ["<span class='color-text'>MouseLeft</span>"]`
|
||||
if (b.inventory.length === 2) text += `
|
||||
<br>input.key.nextGun <span class='color-symbol'>=</span> ["<span class='color-text'>${input.key.nextGun}</span>","<span class='color-text'>MouseWheel</span>"]
|
||||
<br>input.key.previousGun <span class='color-symbol'>=</span> ["<span class='color-text'>${input.key.previousGun}</span>","<span class='color-text'>MouseWheel</span>"]`
|
||||
<br>input.key.nextGun<span class='color-symbol'>:</span> ["<span class='color-text'>${input.key.nextGun}</span>","<span class='color-text'>MouseWheel</span>"]
|
||||
<br>input.key.previousGun<span class='color-symbol'>:</span> ["<span class='color-text'>${input.key.previousGun}</span>","<span class='color-text'>MouseWheel</span>"]`
|
||||
simulation.makeTextLog(text);
|
||||
} else if (type === "field") {
|
||||
mech.setField(index)
|
||||
@@ -489,7 +489,7 @@ const powerUps = {
|
||||
powerUps.spawn(x, y, "ammo");
|
||||
return;
|
||||
}
|
||||
if (Math.random() < 0.0015 * (3 - b.inventory.length)) { //a new gun has a low chance for each not acquired gun up to 3
|
||||
if (Math.random() < 0.001 * (3 - b.inventory.length)) { //a new gun has a low chance for each not acquired gun up to 3
|
||||
powerUps.spawn(x, y, "gun");
|
||||
return;
|
||||
}
|
||||
@@ -520,7 +520,7 @@ const powerUps = {
|
||||
function powerUpChance(chanceToFail) {
|
||||
if (Math.random() * chanceToFail < powerUps.randomPowerUpCounter) {
|
||||
powerUps.randomPowerUpCounter = 0;
|
||||
if (Math.random() < 0.95) {
|
||||
if (Math.random() < 0.97) {
|
||||
powerUps.spawn(x, y, "tech")
|
||||
} else {
|
||||
powerUps.spawn(x, y, "gun")
|
||||
@@ -565,25 +565,17 @@ const powerUps = {
|
||||
powerUps.spawn(x, y, "gun", false); //first gun
|
||||
} else if (tech.totalCount === 0) { //first tech
|
||||
powerUps.spawn(x, y, "tech", false);
|
||||
} else if (b.inventory.length < 2) { //second gun or extra ammo
|
||||
if (Math.random() < 0.5) {
|
||||
} else if (b.inventory.length === 1) { //second gun or extra ammo
|
||||
if (Math.random() < 0.4) {
|
||||
powerUps.spawn(x, y, "gun", false);
|
||||
} else {
|
||||
powerUps.spawn(x, y, "ammo", false);
|
||||
powerUps.spawn(x, y, "ammo", false);
|
||||
powerUps.spawn(x, y, "ammo", false);
|
||||
powerUps.spawn(x, y, "ammo", false);
|
||||
for (let i = 0; i < 5; i++) powerUps.spawn(x, y, "ammo", false);
|
||||
}
|
||||
} else {
|
||||
powerUps.spawnRandomPowerUp(x, y);
|
||||
powerUps.spawnRandomPowerUp(x, y);
|
||||
powerUps.spawnRandomPowerUp(x, y);
|
||||
powerUps.spawnRandomPowerUp(x, y);
|
||||
for (let i = 0; i < 4; i++) powerUps.spawnRandomPowerUp(x, y);
|
||||
}
|
||||
} else {
|
||||
powerUps.spawnRandomPowerUp(x, y);
|
||||
powerUps.spawnRandomPowerUp(x, y);
|
||||
powerUps.spawnRandomPowerUp(x, y);
|
||||
for (let i = 0; i < 3; i++) powerUps.spawnRandomPowerUp(x, y);
|
||||
}
|
||||
},
|
||||
ejectTech(choose = 'random') {
|
||||
|
||||
@@ -576,19 +576,19 @@ const simulation = {
|
||||
let delay = 500
|
||||
const step = 150
|
||||
setTimeout(function() {
|
||||
simulation.makeTextLog(`input.key.up <span class='color-symbol'>=</span> ["<span class='color-text'>${input.key.up}</span>", "<span class='color-text'>ArrowUp</span>"]`);
|
||||
simulation.makeTextLog(`input.key.up<span class='color-symbol'>:</span> ["<span class='color-text'>${input.key.up}</span>", "<span class='color-text'>ArrowUp</span>"]`);
|
||||
}, delay);
|
||||
delay += step
|
||||
setTimeout(function() {
|
||||
simulation.makeTextLog(`input.key.left <span class='color-symbol'>=</span> ["<span class='color-text'>${input.key.left}</span>", "<span class='color-text'>ArrowLeft</span>"]`);
|
||||
simulation.makeTextLog(`input.key.left<span class='color-symbol'>:</span> ["<span class='color-text'>${input.key.left}</span>", "<span class='color-text'>ArrowLeft</span>"]`);
|
||||
}, delay);
|
||||
delay += step
|
||||
setTimeout(function() {
|
||||
simulation.makeTextLog(`input.key.down <span class='color-symbol'>=</span> ["<span class='color-text'>${input.key.down}</span>", "<span class='color-text'>ArrowDown</span>"]`);
|
||||
simulation.makeTextLog(`input.key.down<span class='color-symbol'>:</span> ["<span class='color-text'>${input.key.down}</span>", "<span class='color-text'>ArrowDown</span>"]`);
|
||||
}, delay);
|
||||
delay += step
|
||||
setTimeout(function() {
|
||||
simulation.makeTextLog(`input.key.right <span class='color-symbol'>=</span> ["<span class='color-text'>${input.key.right}</span>", "<span class='color-text'>ArrowRight</span>"]`);
|
||||
simulation.makeTextLog(`input.key.right<span class='color-symbol'>:</span> ["<span class='color-text'>${input.key.right}</span>", "<span class='color-text'>ArrowRight</span>"]`);
|
||||
}, delay);
|
||||
delay += 1000
|
||||
setTimeout(function() {
|
||||
@@ -596,7 +596,7 @@ const simulation = {
|
||||
}, delay);
|
||||
delay += step
|
||||
setTimeout(function() {
|
||||
simulation.makeTextLog(`input.key.field <span class='color-symbol'>=</span> ["<span class='color-text'>${input.key.field}</span>", "<span class='color-text'>MouseRight</span>"]`);
|
||||
simulation.makeTextLog(`input.key.field<span class='color-symbol'>:</span> ["<span class='color-text'>${input.key.field}</span>", "<span class='color-text'>MouseRight</span>"]`);
|
||||
}, delay);
|
||||
// delay += step
|
||||
// setTimeout(function() {
|
||||
@@ -790,6 +790,9 @@ const simulation = {
|
||||
}
|
||||
|
||||
if (!(simulation.cycle % 420)) { //once every 7 seconds
|
||||
|
||||
if (tech.cyclicImmunity && mech.immuneCycle < mech.cycle + tech.cyclicImmunity) mech.immuneCycle = mech.cycle + tech.cyclicImmunity; //player is immune to collision damage for 60 cycles
|
||||
|
||||
fallCheck = function(who, save = false) {
|
||||
let i = who.length;
|
||||
while (i--) {
|
||||
|
||||
@@ -101,7 +101,7 @@ const spawn = {
|
||||
level.exit.x = 5500;
|
||||
level.exit.y = -330;
|
||||
//ramp up damage
|
||||
for (let i = 0; i < 2; i++) level.difficultyIncrease(simulation.difficultyMode)
|
||||
// for (let i = 0; i < 2; i++) level.difficultyIncrease(simulation.difficultyMode)
|
||||
|
||||
//set game to the next highest difficulty level if not on why
|
||||
if (simulation.difficultyMode < 6) {
|
||||
|
||||
93
js/tech.js
93
js/tech.js
@@ -81,7 +81,7 @@ const tech = {
|
||||
if (tech.isLowEnergyDamage) dmg *= 1 + Math.max(0, 1 - mech.energy) * 0.5
|
||||
if (tech.isMaxEnergyTech) dmg *= 1.4
|
||||
if (tech.isEnergyNoAmmo) dmg *= 1.5
|
||||
if (tech.isDamageForGuns) dmg *= 1 + 0.1 * b.inventory.length
|
||||
if (tech.isDamageForGuns) dmg *= 1 + 0.13 * b.inventory.length
|
||||
if (tech.isLowHealthDmg) dmg *= 1 + 0.6 * Math.max(0, 1 - mech.health)
|
||||
if (tech.isHarmDamage && mech.lastHarmCycle + 600 > mech.cycle) dmg *= 3;
|
||||
if (tech.isEnergyLoss) dmg *= 1.5;
|
||||
@@ -146,7 +146,7 @@ const tech = {
|
||||
},
|
||||
{
|
||||
name: "arsenal",
|
||||
description: "increase <strong class='color-d'>damage</strong> by <strong>10%</strong><br>for each <strong class='color-g'>gun</strong> in your inventory",
|
||||
description: "increase <strong class='color-d'>damage</strong> by <strong>13%</strong><br>for each <strong class='color-g'>gun</strong> in your inventory",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
@@ -160,26 +160,71 @@ const tech = {
|
||||
tech.isDamageForGuns = false;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "active cooling",
|
||||
description: "<strong>15%</strong> decreased <strong><em>delay</em></strong> after firing<br>for each <strong class='color-g'>gun</strong> in your inventory",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
return b.inventory.length > 1
|
||||
},
|
||||
requires: "at least 2 guns",
|
||||
effect() {
|
||||
tech.isFireRateForGuns = true;
|
||||
b.setFireCD();
|
||||
},
|
||||
remove() {
|
||||
tech.isFireRateForGuns = false;
|
||||
b.setFireCD();
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "generalist",
|
||||
description: "<strong>spawn</strong> 6 <strong class='color-g'>guns</strong>, but you can't <strong>switch</strong> <strong class='color-g'>guns</strong><br><strong class='color-g'>guns</strong> cycle automatically with each new level",
|
||||
description: "spawn <strong>6</strong> <strong class='color-g'>guns</strong>, but you can't <strong>switch</strong> <strong class='color-g'>guns</strong><br><strong class='color-g'>guns</strong> cycle automatically with each new level",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
isNonRefundable: true,
|
||||
allowed() {
|
||||
return tech.isDamageForGuns
|
||||
return tech.isDamageForGuns || tech.isFireRateForGuns
|
||||
},
|
||||
requires: "arsenal",
|
||||
requires: "arsenal or cyclic rate boost",
|
||||
effect() {
|
||||
tech.isGunCycle = true;
|
||||
for (let i = 0; i < 6; i++) {
|
||||
powerUps.spawn(mech.pos.x, mech.pos.y, "gun");
|
||||
}
|
||||
for (let i = 0; i < 6; i++) powerUps.spawn(mech.pos.x + 10 * Math.random(), mech.pos.y + 10 * Math.random(), "gun");
|
||||
},
|
||||
remove() {
|
||||
tech.isGunCycle = false;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "specialist",
|
||||
description: "for every <strong class='color-g'>gun</strong> in your inventory spawn a<br><strong class='color-h'>heal</strong>, <strong class='color-r'>research</strong>, <strong class='color-f'>field</strong>, <strong class='color-g'>ammo</strong>, or <strong class='color-m'>tech</strong>",
|
||||
maxCount: 1, //random power up
|
||||
count: 0,
|
||||
isNonRefundable: true,
|
||||
isCustomHide: true,
|
||||
allowed() {
|
||||
return tech.isGunCycle
|
||||
},
|
||||
requires: "generalist",
|
||||
effect() {
|
||||
for (let i = 0; i < b.inventory.length; i++) {
|
||||
if (Math.random() < 0.2) {
|
||||
powerUps.spawn(mech.pos.x + 10 * Math.random(), mech.pos.y + 10 * Math.random(), "tech");
|
||||
} else if (Math.random() < 0.25) {
|
||||
powerUps.spawn(mech.pos.x + 10 * Math.random(), mech.pos.y + 10 * Math.random(), "field");
|
||||
} else if (Math.random() < 0.33) {
|
||||
powerUps.spawn(mech.pos.x + 10 * Math.random(), mech.pos.y + 10 * Math.random(), "heal");
|
||||
} else if (Math.random() < 0.5) {
|
||||
powerUps.spawn(mech.pos.x + 10 * Math.random(), mech.pos.y + 10 * Math.random(), "ammo");
|
||||
} else {
|
||||
powerUps.spawn(mech.pos.x + 10 * Math.random(), mech.pos.y + 10 * Math.random(), "research");
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
remove() {}
|
||||
},
|
||||
{
|
||||
name: "logistics",
|
||||
description: "<strong class='color-g'>ammo</strong> power ups give <strong>200%</strong> <strong class='color-g'>ammo</strong><br>but <strong class='color-g'>ammo</strong> is only added to your <strong>current gun</strong>",
|
||||
@@ -617,7 +662,7 @@ const tech = {
|
||||
},
|
||||
{
|
||||
name: "laser-bot",
|
||||
description: "a bot uses <strong class='color-f'>energy</strong> to emit a <strong class='color-laser'>laser</strong><br>targeting nearby mobs",
|
||||
description: "a bot uses <strong class='color-f'>energy</strong> to emit a <strong class='color-laser'>laser</strong> beam<br>that targets nearby mobs",
|
||||
maxCount: 9,
|
||||
count: 0,
|
||||
allowed() {
|
||||
@@ -932,7 +977,7 @@ const tech = {
|
||||
},
|
||||
{
|
||||
name: "Pauli exclusion",
|
||||
description: `<strong>immune</strong> to <strong class='color-harm'>harm</strong> for an extra <strong>0.75</strong> seconds<br>after receiving <strong class='color-harm'>harm</strong> from a <strong>collision</strong>`,
|
||||
description: `after receiving <strong class='color-harm'>harm</strong> from a <strong>collision</strong> become<br><strong>immune</strong> to <strong class='color-harm'>harm</strong> for an extra <strong>0.75</strong> seconds`,
|
||||
maxCount: 9,
|
||||
count: 0,
|
||||
allowed() {
|
||||
@@ -947,6 +992,22 @@ const tech = {
|
||||
tech.collisionImmuneCycles = 25;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "complex spin-statistics",
|
||||
description: `become <strong>immune</strong> to <strong class='color-harm'>harm</strong> for <strong>+1</strong> second<br>once every <strong>7</strong> seconds`,
|
||||
maxCount: 3,
|
||||
count: 0,
|
||||
allowed() {
|
||||
return true //tech.collisionImmuneCycles > 30
|
||||
},
|
||||
requires: "",
|
||||
effect() {
|
||||
tech.cyclicImmunity += 60 - this.count * 6;
|
||||
},
|
||||
remove() {
|
||||
tech.cyclicImmunity = 0;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "ablative drones",
|
||||
description: "rebuild your broken parts as <strong>drones</strong><br>chance to occur after receiving <strong class='color-harm'>harm</strong>",
|
||||
@@ -1102,7 +1163,7 @@ const tech = {
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
return (tech.iceEnergy || tech.isWormholeEnergy || tech.isPiezo || tech.isRailEnergyGain) && tech.energyRegen !== 0.004
|
||||
return (tech.iceEnergy || tech.isWormholeEnergy || tech.isPiezo || tech.isRailEnergyGain) && tech.energyRegen !== 0.004 && !tech.isEnergyHealth
|
||||
},
|
||||
requires: "piezoelectricity, Penrose, half-wave, or thermoelectric, but not time crystals",
|
||||
effect: () => {
|
||||
@@ -1403,7 +1464,7 @@ const tech = {
|
||||
},
|
||||
{
|
||||
name: "inductive coupling",
|
||||
description: "for each unused <strong>power up</strong> at the end of a <strong>level</strong><br>add 4 <strong>max</strong> <strong class='color-h'>health</strong> <em>(up to 40 health per level)</em>",
|
||||
description: "for each unused <strong>power up</strong> at the end of a <strong>level</strong><br>add 3 <strong>max</strong> <strong class='color-h'>health</strong> <em>(up to 42 health per level)</em>",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
@@ -1520,9 +1581,7 @@ const tech = {
|
||||
requires: "at least 2 research",
|
||||
effect() {
|
||||
tech.isImmortal = true;
|
||||
for (let i = 0; i < 4; i++) {
|
||||
powerUps.spawn(mech.pos.x, mech.pos.y, "research", false);
|
||||
}
|
||||
for (let i = 0; i < 4; i++) powerUps.spawn(mech.pos.x + Math.random() * 10, mech.pos.y + Math.random() * 10, "research", false);
|
||||
},
|
||||
remove() {
|
||||
tech.isImmortal = false;
|
||||
@@ -3996,5 +4055,7 @@ const tech = {
|
||||
isLaserMine: null,
|
||||
isAmmoFoamSize: null,
|
||||
isIceIX: null,
|
||||
isDupDamage: null
|
||||
isDupDamage: null,
|
||||
isFireRateForGuns: null,
|
||||
cyclicImmunity: null
|
||||
}
|
||||
Reference in New Issue
Block a user