diff --git a/js/bullet.js b/js/bullet.js
index 0eaf526..887c5d2 100644
--- a/js/bullet.js
+++ b/js/bullet.js
@@ -6,7 +6,15 @@ const b = {
activeGun: null, //current gun in use by player
inventoryGun: 0,
inventory: [], //list of what guns player has // 0 starts with basic gun
- fire() {
+ setFireMethod() {
+ if (tech.isFireNotMove) {
+ b.fire = b.fireNotMove
+ } else {
+ b.fire = b.fireNormal
+ }
+ },
+ fire() {},
+ fireNormal() {
if (input.fire && mech.fireCDcycle < mech.cycle && (!input.field || mech.fieldFire) && b.inventory.length) {
if (b.guns[b.activeGun].ammo > 0) {
b.guns[b.activeGun].fire();
@@ -36,6 +44,37 @@ const b = {
if (mech.holdingTarget) mech.drop();
}
},
+ fireNotMove() {
+ //added && player.speed < 0.5 && mech.onGround *************************
+ if (input.fire && mech.fireCDcycle < mech.cycle && (!input.field || mech.fieldFire) && b.inventory.length && player.speed < 0.5 && mech.onGround && Math.abs(mech.yOff - mech.yOffGoal) < 1) {
+ if (b.guns[b.activeGun].ammo > 0) {
+ b.guns[b.activeGun].fire();
+ if (tech.isCrouchAmmo && mech.crouch) {
+ if (tech.isCrouchAmmo % 2) {
+ b.guns[b.activeGun].ammo--;
+ simulation.updateGunHUD();
+ }
+ tech.isCrouchAmmo++ //makes the no ammo toggle off and on
+ } else {
+ b.guns[b.activeGun].ammo--;
+ simulation.updateGunHUD();
+ }
+ } else {
+ if (tech.isAmmoFromHealth) {
+ if (mech.health > 0.05) {
+ mech.damage(0.05 / mech.harmReduction()); // /mech.harmReduction() undoes damage increase from difficulty
+ if (!(tech.isRewindAvoidDeath && mech.energy > 0.66)) { //don't give ammo if CPT triggered
+ for (let i = 0; i < 3; i++) powerUps.spawn(mech.pos.x, mech.pos.y, "ammo");
+ }
+ }
+ } else {
+ simulation.makeTextLog(`${b.guns[b.activeGun].name}.ammo: 0`);
+ }
+ mech.fireCDcycle = mech.cycle + 30; //fire cooldown
+ }
+ if (mech.holdingTarget) mech.drop();
+ }
+ },
giveGuns(gun = "random", ammoPacks = 10) {
if (tech.isOneGun) b.removeAllGuns();
if (gun === "random") {
@@ -152,6 +191,7 @@ const b = {
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)
+ if (tech.isFireNotMove) b.fireCD *= 0.33
},
fireAttributes(dir, rotate = true) {
if (rotate) {
diff --git a/js/index.js b/js/index.js
index 0683237..8df2cd6 100644
--- a/js/index.js
+++ b/js/index.js
@@ -186,7 +186,7 @@ const build = {
fire delay decrease: ${((1-b.fireCD)*100).toFixed(0)}%
duplication chance: ${(Math.min(1,tech.duplicationChance())*100).toFixed(0)}%
-
research: ${powerUps.research.research}
+
research: ${powerUps.research.count}
health: (${(mech.health*100).toFixed(0)} / ${(mech.maxHealth*100).toFixed(0)}) energy: (${(mech.energy*100).toFixed(0)} / ${(mech.maxEnergy*100).toFixed(0)})
position: (${player.position.x.toFixed(1)}, ${player.position.y.toFixed(1)}) velocity: (${player.velocity.x.toFixed(1)}, ${player.velocity.y.toFixed(1)})
mouse: (${simulation.mouseInGame.x.toFixed(1)}, ${simulation.mouseInGame.y.toFixed(1)}) mass: ${player.mass.toFixed(1)}
diff --git a/js/level.js b/js/level.js
index 0e8212d..28f1ace 100644
--- a/js/level.js
+++ b/js/level.js
@@ -82,7 +82,7 @@ const level = {
powerUps.spawn(mech.pos.x + 60 * (Math.random() - 0.5), mech.pos.y + 60 * (Math.random() - 0.5), "heal", false);
}
if (tech.isPerpetualStun) {
- for (let i = 0; i < mob.length; i++) mobs.statusStun(mob[i], 60 * 8)
+ for (let i = 0; i < mob.length; i++) mobs.statusStun(mob[i], 600)
}
if (tech.isGunCycle) {
b.inventoryGun++;
diff --git a/js/player.js b/js/player.js
index 6dc5531..527bc80 100644
--- a/js/player.js
+++ b/js/player.js
@@ -464,7 +464,7 @@ const mech = {
displayHealth() {
id = document.getElementById("health");
// health display follows a x^1.5 rule to make it seem like the player has lower health, this makes the player feel more excitement
- id.style.width = Math.floor(300 * Math.pow(mech.health, 1.5)) + "px";
+ id.style.width = Math.floor(300 * mech.maxHealth * Math.pow(mech.health / mech.maxHealth, 1.4)) + "px";
//css animation blink if health is low
if (mech.health < 0.3) {
id.classList.add("low-health");
@@ -482,6 +482,7 @@ const mech = {
baseHealth: 1,
setMaxHealth() {
mech.maxHealth = mech.baseHealth + tech.bonusHealth + tech.armorFromPowerUps
+ document.getElementById("health-bg").style.width = `${Math.floor(300*mech.maxHealth)}px`
simulation.makeTextLog(`mech.maxHealth = ${mech.maxHealth.toFixed(2)}`)
if (mech.health > mech.maxHealth) mech.health = mech.maxHealth;
mech.displayHealth();
@@ -501,6 +502,7 @@ const mech = {
if (tech.isNoFireDefense && mech.cycle > mech.fireCDcycle + 120) dmg *= 0.6
if (tech.energyRegen === 0) dmg *= 0.4
if (tech.isTurret && mech.crouch) dmg *= 0.5;
+ if (tech.isRestHarm && player.speed < 1) dmg *= 0.5;
if (tech.isEntanglement && b.inventory[0] === b.activeGun) {
for (let i = 0, len = b.inventory.length; i < len; i++) dmg *= 0.87 // 1 - 0.15
}
@@ -620,10 +622,10 @@ const mech = {
if (tech.isEnergyHealth) {
mech.energy -= dmg;
if (mech.energy < 0 || isNaN(mech.energy)) { //taking deadly damage
- if (tech.isDeathAvoid && powerUps.research.research && !tech.isDeathAvoidedThisLevel) {
+ if (tech.isDeathAvoid && powerUps.research.count && !tech.isDeathAvoidedThisLevel) {
tech.isDeathAvoidedThisLevel = true
powerUps.research.changeRerolls(-1)
- simulation.makeTextLog(`mech.research--
${powerUps.research.research}`)
+ simulation.makeTextLog(`mech.research--
${powerUps.research.count}`)
for (let i = 0; i < 6; i++) {
powerUps.spawn(mech.pos.x, mech.pos.y, "heal", false);
}
@@ -650,12 +652,12 @@ const mech = {
dmg *= mech.harmReduction()
mech.health -= dmg;
if (mech.health < 0 || isNaN(mech.health)) {
- if (tech.isDeathAvoid && powerUps.research.research > 0 && !tech.isDeathAvoidedThisLevel) { //&& Math.random() < 0.5
+ if (tech.isDeathAvoid && powerUps.research.count > 0 && !tech.isDeathAvoidedThisLevel) { //&& Math.random() < 0.5
tech.isDeathAvoidedThisLevel = true
mech.health = 0.05
powerUps.research.changeRerolls(-1)
simulation.makeTextLog(`mech.research--
-
${powerUps.research.research}`)
+
${powerUps.research.count}`)
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
diff --git a/js/powerup.js b/js/powerup.js
index a9bd482..e903eec 100644
--- a/js/powerup.js
+++ b/js/powerup.js
@@ -56,7 +56,7 @@ const powerUps = {
simulation.makeTextLog(`powerUps.tech.length: ${Math.max(0,powerUps.tech.lastTotalChoices - powerUps.tech.banishLog.length)}`)
}
}
- if (tech.manyWorlds && powerUps.research.research === 0) {
+ if (tech.manyWorlds && powerUps.research.count === 0) {
for (let i = 0; i < 2; i++) powerUps.spawn(mech.pos.x + 40 * (Math.random() - 0.5), mech.pos.y + 40 * (Math.random() - 0.5), "research", false);
}
document.getElementById("choose-grid").style.display = "none"
@@ -70,7 +70,7 @@ const powerUps = {
requestAnimationFrame(cycle);
},
research: {
- research: 0,
+ count: 0,
name: "research",
color: "#f7b",
size() {
@@ -80,17 +80,17 @@ const powerUps = {
powerUps.research.changeRerolls(1)
},
changeRerolls(amount) {
- powerUps.research.research += amount
- if (powerUps.research.research < 0) {
- powerUps.research.research = 0
- } else {
- simulation.makeTextLog(`powerUps.research.research += ${amount}`) //
${powerUps.research.research}
+ if (amount !== 0) {
+ powerUps.research.count += amount
+ if (powerUps.research.count < 0) {
+ powerUps.research.count = 0
+ } else {
+ simulation.makeTextLog(`powerUps.research.count += ${amount}`) //
${powerUps.research.count}
+ }
}
-
-
if (tech.isRerollBots) {
const limit = 5
- for (; powerUps.research.research > limit - 1; powerUps.research.research -= limit) {
+ for (; powerUps.research.count > limit - 1; powerUps.research.count -= limit) {
b.randomBot()
if (tech.renormalization) {
for (let i = 0; i < limit; i++) {
@@ -103,11 +103,11 @@ const powerUps = {
}
}
if (tech.isDeathAvoid && document.getElementById("tech-anthropic")) {
- document.getElementById("tech-anthropic").innerHTML = `-${powerUps.research.research}`
+ document.getElementById("tech-anthropic").innerHTML = `-${powerUps.research.count}`
}
if (tech.renormalization && Math.random() < 0.37 && amount < 0) powerUps.spawn(mech.pos.x, mech.pos.y, "research");
if (tech.isRerollHaste) {
- if (powerUps.research.research === 0) {
+ if (powerUps.research.count === 0) {
tech.researchHaste = 0.66;
b.setFireCD();
} else {
@@ -119,7 +119,7 @@ const powerUps = {
use(type) { //runs when you actually research a list of selections, type can be field, gun, or tech
powerUps.research.changeRerolls(-1)
// simulation.makeTextLog(`mech.research--
- //
${powerUps.research.research}`)
+ //
${powerUps.research.count}`)
if (tech.isBanish && type === 'tech') { // banish researched tech
const banishLength = tech.isDeterminism ? 1 : 3 + tech.isExtraChoice * 2
if (powerUps.tech.choiceLog.length > banishLength || powerUps.tech.choiceLog.length === banishLength) { //I'm not sure this check is needed
@@ -248,12 +248,12 @@ const powerUps = {
powerUps.field.choiceLog.push(choice2)
powerUps.field.choiceLog.push(choice3)
- if (powerUps.research.research) {
+ if (powerUps.research.count) {
text += `