Higgs
tech: Higgs mechanism - you can't move when firing, reduce harm by 60% when firing removed Galilean group damage immunity graphic is more obvious
This commit is contained in:
43
js/bullet.js
43
js/bullet.js
@@ -7,7 +7,9 @@ const b = {
|
||||
inventoryGun: 0,
|
||||
inventory: [], //list of what guns player has // 0 starts with basic gun
|
||||
setFireMethod() {
|
||||
if (tech.isFireNotMove) {
|
||||
if (tech.isFireMoveLock) {
|
||||
b.fire = b.fireFloat
|
||||
} else if (tech.isFireNotMove) {
|
||||
b.fire = b.fireNotMove
|
||||
} else {
|
||||
b.fire = b.fireNormal
|
||||
@@ -75,6 +77,45 @@ const b = {
|
||||
if (mech.holdingTarget) mech.drop();
|
||||
}
|
||||
},
|
||||
fireFloat() {
|
||||
//added && player.speed < 0.5 && mech.onGround *************************
|
||||
if (input.fire && (!input.field || mech.fieldFire) && b.inventory.length) {
|
||||
if (mech.fireCDcycle < mech.cycle) {
|
||||
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}.<span class='color-gun'>ammo</span><span class='color-symbol'>:</span> 0`);
|
||||
}
|
||||
mech.fireCDcycle = mech.cycle + 30; //fire cooldown
|
||||
}
|
||||
if (mech.holdingTarget) mech.drop();
|
||||
}
|
||||
Matter.Body.setVelocity(player, {
|
||||
x: 0,
|
||||
y: -55 * player.mass * simulation.g //undo gravity before it is added
|
||||
});
|
||||
player.force.x = 0
|
||||
player.force.y = 0
|
||||
}
|
||||
},
|
||||
giveGuns(gun = "random", ammoPacks = 10) {
|
||||
if (tech.isOneGun) b.removeAllGuns();
|
||||
if (gun === "random") {
|
||||
|
||||
@@ -1005,10 +1005,8 @@ const mobs = {
|
||||
if (this.shield) dmg *= 0.075
|
||||
|
||||
//energy and heal drain should be calculated after damage boosts
|
||||
if (tech.energySiphon && dmg !== Infinity && this.dropPowerUp) {
|
||||
mech.energy += Math.min(this.health, dmg) * tech.energySiphon
|
||||
// if (mech.energy > mech.maxEnergy) mech.energy = mech.maxEnergy
|
||||
}
|
||||
if (tech.energySiphon && dmg !== Infinity && this.dropPowerUp) mech.energy += Math.min(this.health, dmg) * tech.energySiphon
|
||||
|
||||
if (tech.healthDrain && dmg !== Infinity && this.dropPowerUp) {
|
||||
mech.addHealth(Math.min(this.health, dmg) * tech.healthDrain)
|
||||
if (mech.health > mech.maxHealth) mech.health = mech.maxHealth
|
||||
|
||||
@@ -502,7 +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.isFireMoveLock && input.fire) dmg *= 0.4;
|
||||
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
|
||||
}
|
||||
@@ -789,7 +789,7 @@ const mech = {
|
||||
|
||||
//draw body
|
||||
ctx.save();
|
||||
ctx.globalAlpha = (mech.immuneCycle < mech.cycle) ? 1 : 0.7
|
||||
ctx.globalAlpha = (mech.immuneCycle < mech.cycle) ? 1 : 0.5
|
||||
ctx.translate(mech.pos.x, mech.pos.y);
|
||||
mech.calcLeg(Math.PI, -3);
|
||||
mech.drawLeg("#4a4a4a");
|
||||
|
||||
141
js/tech.js
141
js/tech.js
@@ -363,21 +363,93 @@ const tech = {
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "Galilean group",
|
||||
description: "reduce <strong class='color-harm'>harm</strong> by <strong>50%</strong> when at <strong>rest</strong>",
|
||||
name: "Higgs mechanism",
|
||||
description: "<strong>movement</strong> isn't possible while <strong>firing</strong><br>reduce <strong class='color-harm'>harm</strong> by <strong>60%</strong> when <strong>firing</strong>",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
return tech.isFireNotMove
|
||||
return true
|
||||
},
|
||||
requires: "inertial frame",
|
||||
effect() {
|
||||
tech.isRestHarm = true
|
||||
requires: "",
|
||||
effect: () => {
|
||||
tech.isFireMoveLock = true;
|
||||
b.setFireMethod();
|
||||
},
|
||||
remove() {
|
||||
tech.isRestHarm = false;
|
||||
if (tech.isFireMoveLock) {
|
||||
tech.isFireMoveLock = false
|
||||
b.setFireMethod();
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "squirrel-cage rotor",
|
||||
description: "<strong>move</strong> and <strong>jump</strong> about <strong>25%</strong> faster",
|
||||
maxCount: 9,
|
||||
count: 0,
|
||||
allowed() {
|
||||
return true
|
||||
},
|
||||
requires: "",
|
||||
effect() { // good with melee builds, content skipping builds
|
||||
tech.squirrelFx += 0.2;
|
||||
tech.squirrelJump += 0.09;
|
||||
mech.setMovement()
|
||||
},
|
||||
remove() {
|
||||
tech.squirrelFx = 1;
|
||||
tech.squirrelJump = 1;
|
||||
mech.setMovement()
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "Newton's 1st law",
|
||||
description: "moving at high <strong>speeds</strong> reduces <strong class='color-harm'>harm</strong><br>by up to <strong>50%</strong>",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
return mech.Fx > 0.016 && !tech.isEnergyHealth
|
||||
},
|
||||
requires: "speed increase, not mass-energy equivalence",
|
||||
effect() {
|
||||
tech.isSpeedHarm = true
|
||||
},
|
||||
remove() {
|
||||
tech.isSpeedHarm = false
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "Newton's 2nd law",
|
||||
description: "moving at high <strong>speeds</strong> increases <strong class='color-d'>damage</strong><br> by up to <strong>33%</strong>",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
return mech.Fx > 0.016
|
||||
},
|
||||
requires: "speed increase",
|
||||
effect() {
|
||||
tech.isSpeedDamage = true
|
||||
},
|
||||
remove() {
|
||||
tech.isSpeedDamage = false
|
||||
}
|
||||
},
|
||||
// {
|
||||
// name: "Galilean group",
|
||||
// description: "reduce <strong class='color-harm'>harm</strong> by <strong>50%</strong> when at <strong>rest</strong>",
|
||||
// maxCount: 1,
|
||||
// count: 0,
|
||||
// allowed() {
|
||||
// return tech.isFireNotMove || tech.isFireMoveLock
|
||||
// },
|
||||
// requires: "inertial frame or Higgs mechanism",
|
||||
// effect() {
|
||||
// tech.isRestHarm = true
|
||||
// },
|
||||
// remove() {
|
||||
// tech.isRestHarm = false;
|
||||
// }
|
||||
// },
|
||||
{
|
||||
name: "kinetic bombardment",
|
||||
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",
|
||||
@@ -914,58 +986,6 @@ const tech = {
|
||||
},
|
||||
remove() {}
|
||||
},
|
||||
{
|
||||
name: "squirrel-cage rotor",
|
||||
description: "<strong>move</strong> and <strong>jump</strong> about <strong>25%</strong> faster",
|
||||
maxCount: 9,
|
||||
count: 0,
|
||||
allowed() {
|
||||
return true
|
||||
},
|
||||
requires: "",
|
||||
effect() { // good with melee builds, content skipping builds
|
||||
tech.squirrelFx += 0.2;
|
||||
tech.squirrelJump += 0.09;
|
||||
mech.setMovement()
|
||||
},
|
||||
remove() {
|
||||
tech.squirrelFx = 1;
|
||||
tech.squirrelJump = 1;
|
||||
mech.setMovement()
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "Newton's 1st law",
|
||||
description: "moving at high <strong>speeds</strong> reduces <strong class='color-harm'>harm</strong><br>by up to <strong>50%</strong>",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
return mech.Fx > 0.016 && !tech.isEnergyHealth
|
||||
},
|
||||
requires: "speed increase, not mass-energy equivalence",
|
||||
effect() {
|
||||
tech.isSpeedHarm = true
|
||||
},
|
||||
remove() {
|
||||
tech.isSpeedHarm = false
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "Newton's 2nd law",
|
||||
description: "moving at high <strong>speeds</strong> increases <strong class='color-d'>damage</strong><br> by up to <strong>33%</strong>",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
return mech.Fx > 0.016
|
||||
},
|
||||
requires: "speed increase",
|
||||
effect() {
|
||||
tech.isSpeedDamage = true
|
||||
},
|
||||
remove() {
|
||||
tech.isSpeedDamage = false
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "mass driver",
|
||||
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>",
|
||||
@@ -4113,5 +4133,6 @@ const tech = {
|
||||
cyclicImmunity: null,
|
||||
isTechDamage: null,
|
||||
isFireNotMove: null,
|
||||
isRestHarm: null
|
||||
isRestHarm: null,
|
||||
isFireMoveLock: null
|
||||
}
|
||||
Reference in New Issue
Block a user