diff --git a/.DS_Store b/.DS_Store
index 8a002ec..51d2d37 100644
Binary files a/.DS_Store and b/.DS_Store differ
diff --git a/js/bullet.js b/js/bullet.js
index b38856c..7bd9a00 100644
--- a/js/bullet.js
+++ b/js/bullet.js
@@ -22,9 +22,11 @@ const b = {
}
} else {
if (mod.isAmmoFromHealth) {
- if (mech.health > 2 * mod.isAmmoFromHealth * mech.maxHealth) {
- mech.damage(mod.isAmmoFromHealth * mech.maxHealth / mech.harmReduction());
- if (!(mod.isRewindAvoidDeath && mech.energy > 0.66)) powerUps.spawn(mech.pos.x, mech.pos.y, "ammo"); //don't give ammo if CPT triggered
+ if (mech.health > 0.05) {
+ mech.damage(0.05 / mech.harmReduction()); // /mech.harmReduction() undoes damage increase from difficulty
+ if (!(mod.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 {
game.replaceTextLog = true;
game.makeTextLog("not enough health for catabolism to produce ammo", 120);
@@ -35,9 +37,7 @@ const b = {
}
mech.fireCDcycle = mech.cycle + 30; //fire cooldown
}
- if (mech.holdingTarget) {
- mech.drop();
- }
+ if (mech.holdingTarget) mech.drop();
}
},
removeAllGuns() {
@@ -307,7 +307,7 @@ const b = {
const me = bullet.length;
bullet[me] = Bodies.circle(where.x, where.y, 15, b.fireAttributes(angle, false));
Matter.Body.setDensity(bullet[me], 0.0005);
- bullet[me].explodeRad = 275;
+ bullet[me].explodeRad = 300;
bullet[me].onEnd = function() {
b.explosion(this.position, this.explodeRad); //makes bullet do explosive damage at end
if (mod.fragments) b.targetedNail(this.position, mod.fragments * 5)
@@ -316,7 +316,7 @@ const b = {
bullet[me].beforeDmg = function() {
this.endCycle = 0; //bullet ends cycle after doing damage //this also triggers explosion
};
- speed = mech.crouch ? 43 : 32
+ speed = mech.crouch ? 46 : 32
Matter.Body.setVelocity(bullet[me], {
x: mech.Vx / 2 + speed * Math.cos(angle),
y: mech.Vy / 2 + speed * Math.sin(angle)
@@ -681,19 +681,21 @@ const b = {
lastAngle: 0,
wasExtruderOn: false,
isExtruderOn: false,
+ didExtruderDrain: false,
+ canExtruderFire: true,
extruder() {
const DRAIN = 0.0007 + mech.fieldRegen
- if (mech.energy > DRAIN) {
+ if (mech.energy > DRAIN && b.canExtruderFire) {
mech.energy -= DRAIN
if (mech.energy < 0) {
mech.fieldCDcycle = mech.cycle + 120;
mech.energy = 0;
}
- mech.isExtruderOn = true
+ b.isExtruderOn = true
const SPEED = 10
const me = bullet.length;
const where = Vector.add(mech.pos, player.velocity)
- bullet[me] = Bodies.polygon(where.x + 20 * Math.cos(mech.angle), where.y + 20 * Math.sin(mech.angle), 3, 0.01, {
+ bullet[me] = Bodies.polygon(where.x + 20 * Math.cos(mech.angle), where.y + 20 * Math.sin(mech.angle), 4, 0.01, {
cycle: -0.5,
isWave: true,
endCycle: game.cycle + 10 + 40 * mod.isPlasmaRange,
@@ -755,7 +757,9 @@ const b = {
const transverse = Vector.normalise(Vector.perp(bullet[me].velocity))
if (180 - Math.abs(Math.abs(b.lastAngle - mech.angle) - 180) > 0.3) bullet[me].isBranch = true; //don't draw stroke for this bullet
b.lastAngle = mech.angle //track last angle for the above angle difference calculation
- if (!mech.wasExtruderOn) bullet[me].isBranch = true;
+ if (!b.wasExtruderOn) bullet[me].isBranch = true;
+ } else {
+ b.canExtruderFire = false;
}
},
plasma() {
@@ -1336,7 +1340,7 @@ const b = {
const THRUST = 0.004
const dir = mech.angle + spread * (Math.random() - 0.5);
const RADIUS = 18
- bullet[me] = Bodies.polygon(mech.pos.x + 30 * Math.cos(mech.angle), mech.pos.y + 30 * Math.sin(mech.angle), 4, 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,
inertia: Infinity,
friction: 0,
diff --git a/js/game.js b/js/game.js
index 1fd5551..d9b7938 100644
--- a/js/game.js
+++ b/js/game.js
@@ -595,6 +595,9 @@ const game = {
}
}
+ if (mod.isEndLevelPowerUp) {
+ for (let i = 0; i < powerUp.length; i++) powerUp[i].effect();
+ }
powerUps.totalPowerUps = powerUp.length
let holdTarget; //if player is holding something this remembers it before it gets deleted
@@ -752,8 +755,31 @@ const game = {
//check for double crouch
//crouch playerHead.position.y - player.position.y = 9.7 //positive
//standing playerHead.position.y - player.position.y = -30 //negative
+ // mech.undoCrouch()
if (!mech.crouch && ((playerHead.position.y - player.position.y) > 0)) {
- // mech.undoCrouch()
+ Matter.Body.translate(playerHead, {
+ x: 0,
+ y: 40
+ });
+ if ((playerHead.position.y - player.position.y) > 0) {
+ Matter.Body.translate(playerHead, {
+ x: 0,
+ y: 40
+ });
+ if ((playerHead.position.y - player.position.y) > 0) {
+ Matter.Body.translate(playerHead, {
+ x: 0,
+ y: 40
+ });
+ if ((playerHead.position.y - player.position.y) > 0) {
+ Matter.Body.translate(playerHead, {
+ x: 0,
+ y: 40
+ });
+ }
+ }
+ }
+ } else if (mech.crouch && ((playerHead.position.y - player.position.y) > 10)) {
Matter.Body.translate(playerHead, {
x: 0,
y: 40
diff --git a/js/index.js b/js/index.js
index 24f1661..aefdc73 100644
--- a/js/index.js
+++ b/js/index.js
@@ -196,6 +196,12 @@ const build = {
damage difficulty scale: ${(b.dmgScale*100).toFixed(2) }%
harm difficulty scale: ${(game.dmgScale*100).toFixed(0)}%
heal difficulty scale: ${(game.healScale*100).toFixed(1)}%
+
+
`;
let countGuns = 0
let countMods = 0
@@ -217,15 +223,15 @@ const build = {
if (mod.mods[i].isFieldMod) {
text += `
-
-
+
+
${mod.mods[i].name} ${isCount}
${mod.mods[i].description}
`
} else if (mod.mods[i].isGunMod) {
text += `
-
-
+
+
${mod.mods[i].name} ${isCount}
${mod.mods[i].description}
`
} else {
@@ -299,15 +305,19 @@ const build = {
if (mod.mods[i].isFieldMod) {
modID.innerHTML = `
-
-
+
+
${mod.mods[i].name} ${isCount}
${mod.mods[i].description}`
+
+ //
+ //
+ // border: #fff solid 0px;
} else if (mod.mods[i].isGunMod) {
modID.innerHTML = `
-
-
+
+
${mod.mods[i].name} ${isCount}
${mod.mods[i].description}`
} else {
@@ -319,7 +329,7 @@ const build = {
modID.setAttribute("onClick", `javascript: build.choosePowerUp(this,${i},'mod')`);
}
} else {
- modID.innerHTML = `requires: ${mod.mods[i].requires}`
+ modID.innerHTML = ` ${mod.mods[i].name}
requires: ${mod.mods[i].requires}`
if (!modID.classList.contains("build-grid-disabled")) {
modID.classList.add("build-grid-disabled");
modID.onclick = null
@@ -343,7 +353,7 @@ const build = {
reset
-