ground state mod
This commit is contained in:
@@ -69,6 +69,7 @@ const b = {
|
||||
isModStunField: null,
|
||||
isModHarmDamage: null,
|
||||
isModAlphaRadiation: null,
|
||||
modEnergyRegen: null,
|
||||
modOnHealthChange() { //used with acid mod
|
||||
if (b.isModAcidDmg && mech.health > 0.8) {
|
||||
b.modAcidDmg = 0.7
|
||||
@@ -274,7 +275,7 @@ const b = {
|
||||
},
|
||||
{
|
||||
name: "mass driver",
|
||||
description: "<strong>objects</strong> do <strong>3x</strong> more <strong class='color-d'>damage</strong> to mobs<br>charge <strong>throws</strong> in <strong>3x</strong> less time",
|
||||
description: "<strong>blocks</strong> do <strong>3x</strong> more <strong class='color-d'>damage</strong> to mobs<br>charge <strong>throws</strong> in <strong>3x</strong> less time",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
@@ -450,7 +451,7 @@ const b = {
|
||||
},
|
||||
{
|
||||
name: "acute stress response",
|
||||
description: "increase <strong class='color-d'>damage</strong> by <strong>50%</strong><br>no <strong class='color-f'>energy</strong> for <strong>5 seconds</strong> after a mob <strong>dies</strong>",
|
||||
description: "increase <strong class='color-d'>damage</strong> by <strong>33%</strong><br>but, after a mob <strong>dies</strong> lose <strong>1/2</strong> your <strong class='color-f'>energy</strong>",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
@@ -568,8 +569,8 @@ const b = {
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "entanglement",
|
||||
description: "<strong>13%</strong> less <strong>harm</strong> for each gun in your <strong>inventory</strong><br> while your <strong>first gun</strong> is equipped",
|
||||
name: "entanglement <span id = 'mod-entanglement'></span>",
|
||||
description: "<strong>16%</strong> less <strong>harm</strong> for each gun in your <strong>inventory</strong><br> while your <strong>first gun</strong> is equipped",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
@@ -583,9 +584,27 @@ const b = {
|
||||
b.isModEntanglement = false;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "ground state",
|
||||
description: "reduce <strong>harm</strong> by <strong>67%</strong><br>you <strong>no longer</strong> passively regenerate <strong class='color-f'>energy</strong>",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
return true
|
||||
},
|
||||
requires: "",
|
||||
effect: () => {
|
||||
b.modEnergyRegen = 0;
|
||||
mech.fieldRegen = b.modEnergyRegen;
|
||||
},
|
||||
remove() {
|
||||
b.modEnergyRegen = 0.005;
|
||||
mech.fieldRegen = b.modEnergyRegen;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "piezoelectricity",
|
||||
description: "<strong>colliding</strong> with mobs fills your <strong class='color-f'>energy</strong><br><strong>10%</strong> less <strong>harm</strong> from mob collisions",
|
||||
description: "<strong>colliding</strong> with mobs fills your <strong class='color-f'>energy</strong><br><strong>15%</strong> less <strong>harm</strong> from mob collisions",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
@@ -602,7 +621,7 @@ const b = {
|
||||
},
|
||||
{
|
||||
name: "energy conservation",
|
||||
description: "gain <strong class='color-f'>energy</strong> proportional to <strong class='color-d'>damage</strong> done",
|
||||
description: "<strong>15%</strong> of <strong class='color-d'>damage</strong> done is recovered as <strong class='color-f'>energy</strong>",
|
||||
maxCount: 9,
|
||||
count: 0,
|
||||
allowed() {
|
||||
@@ -619,7 +638,7 @@ const b = {
|
||||
},
|
||||
{
|
||||
name: "entropy exchange",
|
||||
description: "<strong class='color-h'>heal</strong> proportional to <strong class='color-d'>damage</strong> done",
|
||||
description: "<strong class='color-h'>heal</strong> for <strong>1.5%</strong> of <strong class='color-d'>damage</strong> done",
|
||||
maxCount: 9,
|
||||
count: 0,
|
||||
allowed() {
|
||||
@@ -810,6 +829,10 @@ const b = {
|
||||
},
|
||||
requires: "more than 6 mods",
|
||||
effect: () => {
|
||||
//remove bullets //mostly to get rid of bots
|
||||
for (let i = 0; i < bullet.length; ++i) Matter.World.remove(engine.world, bullet[i]);
|
||||
bullet = [];
|
||||
|
||||
let count = b.modCount
|
||||
if (b.isModNoAmmo) count - 6 //remove the 6 bonus mods when getting rid of leveraged investment
|
||||
for (let i = 0; i < count; i++) { // spawn new mods
|
||||
@@ -822,8 +845,6 @@ const b = {
|
||||
//nothing to undo
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
name: "ice crystal nucleation",
|
||||
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",
|
||||
@@ -1915,7 +1936,7 @@ const b = {
|
||||
lockedOn: null,
|
||||
isFollowMouse: true,
|
||||
onDmg(who) {
|
||||
mobs.statusSlow(who, 30)
|
||||
mobs.statusSlow(who, 60)
|
||||
this.endCycle = game.cycle
|
||||
if (b.isModAlphaRadiation) mobs.statusPoison(who, 0.1, 180)
|
||||
},
|
||||
@@ -2302,7 +2323,7 @@ const b = {
|
||||
if (b.isModIceCrystals && mech.energy > 0.01) {
|
||||
mech.energy -= mech.fieldRegen + 0.007
|
||||
bullet[me].onDmg = function (who) {
|
||||
mobs.statusSlow(who, 60)
|
||||
mobs.statusSlow(who, 30)
|
||||
};
|
||||
//ice muzzleFlash
|
||||
ctx.fillStyle = "rgb(0,100,255)";
|
||||
|
||||
@@ -140,7 +140,7 @@ function collisionChecks(event) {
|
||||
let dmg = Math.min(Math.max(0.025 * Math.sqrt(mob[k].mass), 0.05), 0.3) * game.dmgScale; //player damage is capped at 0.3*dmgScale of 1.0
|
||||
if (b.isModPiezo) {
|
||||
mech.energy = mech.fieldEnergyMax;
|
||||
dmg *= 0.9
|
||||
dmg *= 0.85
|
||||
}
|
||||
mech.damage(dmg);
|
||||
if (mob[k].onHit) mob[k].onHit(k);
|
||||
|
||||
19
js/game.js
19
js/game.js
@@ -145,6 +145,18 @@ const game = {
|
||||
// document.getElementById(b.activeGun).style.fontSize = "30px";
|
||||
if (document.getElementById(b.activeGun)) document.getElementById(b.activeGun).style.opacity = "1";
|
||||
}
|
||||
|
||||
if (b.isModEntanglement && document.getElementById("mod-entanglement")) {
|
||||
if (b.inventory[0] === b.activeGun) {
|
||||
let lessDamage = 1
|
||||
for (let i = 0, len = b.inventory.length; i < len; i++) {
|
||||
lessDamage *= 0.87 // 1 - 0.13
|
||||
}
|
||||
document.getElementById("mod-entanglement").innerHTML = " " + ((1 - lessDamage) * 100).toFixed(0) + "%"
|
||||
} else {
|
||||
document.getElementById("mod-entanglement").innerHTML = " 0%"
|
||||
}
|
||||
}
|
||||
},
|
||||
updateGunHUD() {
|
||||
for (let i = 0, len = b.inventory.length; i < len; ++i) {
|
||||
@@ -685,12 +697,7 @@ const game = {
|
||||
mech.energy += mech.fieldEnergyMax * 0.07
|
||||
if (mech.energy > mech.fieldEnergyMax) mech.energy = mech.fieldEnergyMax;
|
||||
}
|
||||
if (b.isModHealthRecovery) {
|
||||
mech.addHealth(0.01)
|
||||
}
|
||||
if (b.isModEnergyLoss) {
|
||||
mech.energy = 0.05;
|
||||
}
|
||||
if (b.isModHealthRecovery) mech.addHealth(0.01)
|
||||
}
|
||||
|
||||
if (!(game.cycle % 420)) { //once every 7 seconds
|
||||
|
||||
@@ -16,7 +16,7 @@ const level = {
|
||||
// level.difficultyIncrease(9)
|
||||
// b.giveGuns("ice IX")
|
||||
// mech.setField("time dilation field")
|
||||
// b.giveMod("quantum immortality");
|
||||
// b.giveMod("ground state");
|
||||
// b.giveMod("reflective cavity");
|
||||
|
||||
level.intro(); //starting level
|
||||
@@ -965,9 +965,9 @@ const level = {
|
||||
spawn.mapRect(5450, -775, 100, 875); //right building wall
|
||||
spawn.bodyRect(4850, -750, 300, 25, 0.8);
|
||||
spawn.bodyRect(3925, -1400, 100, 150, 0.8);
|
||||
spawn.mapRect(3450, -1250, 1100, 50);
|
||||
spawn.mapRect(3450, -1250, 1090, 50);
|
||||
// spawn.mapRect(3450, -1225, 50, 75);
|
||||
spawn.mapRect(4500, -1225, 50, 390);
|
||||
spawn.mapRect(4500, -1250, 50, 415);
|
||||
spawn.mapRect(3450, -725, 1500, 50);
|
||||
spawn.mapRect(5100, -725, 400, 50);
|
||||
spawn.mapRect(4500, -735, 50, 635);
|
||||
|
||||
@@ -985,7 +985,7 @@ const mobs = {
|
||||
if (this.shield) dmg *= 0.04
|
||||
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.isModEnergyLoss) dmg *= 1.5;
|
||||
if (b.isModEnergyLoss) dmg *= 1.33;
|
||||
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.modEnergySiphon && dmg !== Infinity) mech.energy += Math.min(this.health, dmg) * b.modEnergySiphon
|
||||
if (b.modHealthDrain && dmg !== Infinity) mech.addHealth(Math.min(this.health, dmg) * b.modHealthDrain)
|
||||
@@ -1010,6 +1010,7 @@ const mobs = {
|
||||
this.removeConsBB();
|
||||
this.alive = false; //triggers mob removal in mob[i].replace(i)
|
||||
if (this.dropPowerUp) {
|
||||
if (b.isModEnergyLoss) mech.energy /= 2;
|
||||
powerUps.spawnRandomPowerUp(this.position.x, this.position.y, this.mass, radius);
|
||||
mech.lastKillCycle = mech.cycle; //tracks the last time a kill was made, mostly used in game.checks()
|
||||
if (Math.random() < b.modSporesOnDeath) {
|
||||
|
||||
215
js/player.js
215
js/player.js
@@ -503,12 +503,32 @@ const mech = {
|
||||
collisionImmuneCycle: 0, //used in engine
|
||||
damage(dmg) {
|
||||
mech.lastHarmCycle = mech.cycle
|
||||
|
||||
//chance to build a drone on damage from mod
|
||||
if (b.isModDroneOnDamage) {
|
||||
const len = (dmg - 0.06 * Math.random()) * 40
|
||||
for (let i = 0; i < len; i++) {
|
||||
if (Math.random() < 0.75) b.drone() //spawn drone
|
||||
}
|
||||
}
|
||||
if (b.isModMineOnDamage && dmg > 0.005 + 0.1 * Math.random()) {
|
||||
b.mine({
|
||||
x: mech.pos.x,
|
||||
y: mech.pos.y - 80
|
||||
}, {
|
||||
x: 0,
|
||||
y: 0
|
||||
})
|
||||
}
|
||||
|
||||
dmg *= mech.fieldDamageResistance
|
||||
if (!b.modEnergyRegen) dmg *= 0.33 //0.22 + 0.78 * mech.energy //77% damage reduction at zero energy
|
||||
if (b.isModEntanglement && b.inventory[0] === b.activeGun) {
|
||||
for (let i = 0, len = b.inventory.length; i < len; i++) {
|
||||
dmg *= 0.87 // 1 - 0.13
|
||||
dmg *= 0.84 // 1 - 0.16
|
||||
}
|
||||
}
|
||||
|
||||
mech.health -= dmg;
|
||||
if (mech.health < 0) {
|
||||
if (b.isModDeathAvoid && !b.isModDeathAvoidOnCD) { //&& Math.random() < 0.5
|
||||
@@ -542,25 +562,6 @@ const mech = {
|
||||
document.getElementById("dmg").style.transition = "opacity 0s";
|
||||
document.getElementById("dmg").style.opacity = 0.1 + Math.min(0.6, dmg * 4);
|
||||
|
||||
//chance to build a drone on damage from mod
|
||||
if (b.isModDroneOnDamage) {
|
||||
const len = (dmg - 0.06 * Math.random()) * 40
|
||||
for (let i = 0; i < len; i++) {
|
||||
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
|
||||
if (dmg > 0.05) {
|
||||
if (dmg > 0.07 && mech.holdingMassScale > 0.2) mech.drop(); //drop block if holding
|
||||
@@ -737,7 +738,7 @@ const mech = {
|
||||
},
|
||||
setHoldDefaults() {
|
||||
if (mech.energy < mech.fieldEnergyMax) mech.energy = mech.fieldEnergyMax;
|
||||
mech.fieldRegen = 0.001;
|
||||
mech.fieldRegen = b.modEnergyRegen;
|
||||
mech.fieldMeterColor = "#0cf"
|
||||
mech.fieldShieldingScale = 1;
|
||||
mech.fieldDamageResistance = 1;
|
||||
@@ -783,6 +784,7 @@ const mech = {
|
||||
},
|
||||
drop() {
|
||||
if (mech.isHolding) {
|
||||
mech.fieldCDcycle = mech.cycle + 15;
|
||||
mech.isHolding = false;
|
||||
mech.throwCharge = 0;
|
||||
mech.definePlayerMass()
|
||||
@@ -975,10 +977,7 @@ const mech = {
|
||||
y: powerUp[i].velocity.y * 0.11
|
||||
});
|
||||
if (dist2 < 5000) { //use power up if it is close enough
|
||||
if (b.isModMassEnergy) {
|
||||
mech.energy = mech.fieldEnergyMax * 1.5;
|
||||
// mech.addHealth(0.01);
|
||||
}
|
||||
if (b.isModMassEnergy) mech.energy = mech.fieldEnergyMax * 1.5;
|
||||
Matter.Body.setVelocity(player, { //player knock back, after grabbing power up
|
||||
x: player.velocity.x + ((powerUp[i].velocity.x * powerUp[i].mass) / player.mass) * 0.3,
|
||||
y: player.velocity.y + ((powerUp[i].velocity.y * powerUp[i].mass) / player.mass) * 0.3
|
||||
@@ -1109,7 +1108,7 @@ const mech = {
|
||||
// }
|
||||
// },
|
||||
lookForPickUp() { //find body to pickup
|
||||
mech.energy -= mech.fieldRegen;
|
||||
if (mech.energy > mech.fieldRegen) mech.energy -= mech.fieldRegen;
|
||||
const grabbing = {
|
||||
targetIndex: null,
|
||||
targetRange: 150,
|
||||
@@ -1211,12 +1210,14 @@ const mech = {
|
||||
mech.drawHold(mech.holdingTarget);
|
||||
mech.holding();
|
||||
mech.throwBlock();
|
||||
} else if ((keys[32] || game.mouseDownRight && mech.energy > 0.05 && mech.fieldCDcycle < mech.cycle)) { //not hold but field button is pressed
|
||||
mech.drawField();
|
||||
} else if ((keys[32] || game.mouseDownRight && mech.fieldCDcycle < mech.cycle)) { //not hold but field button is pressed
|
||||
mech.grabPowerUp();
|
||||
mech.lookForPickUp();
|
||||
if (mech.energy > 0.05) {
|
||||
mech.drawField();
|
||||
mech.pushMobsFacing();
|
||||
} else if (mech.holdingTarget && mech.fieldCDcycle < mech.cycle && mech.energy > 0.05) { //holding, but field button is released
|
||||
}
|
||||
} else if (mech.holdingTarget && mech.fieldCDcycle < mech.cycle) { //holding, but field button is released
|
||||
mech.pickUp();
|
||||
} else {
|
||||
mech.holdingTarget = null; //clears holding target (this is so you only pick up right after the field button is released and a hold target exists)
|
||||
@@ -1244,7 +1245,10 @@ const mech = {
|
||||
mech.drawHold(mech.holdingTarget);
|
||||
mech.holding();
|
||||
mech.throwBlock();
|
||||
} else if ((keys[32] || game.mouseDownRight && mech.energy > 0.05 && mech.fieldCDcycle < mech.cycle)) { //not hold but field button is pressed
|
||||
} else if ((keys[32] || game.mouseDownRight && mech.fieldCDcycle < mech.cycle)) { //not hold but field button is pressed
|
||||
mech.grabPowerUp();
|
||||
mech.lookForPickUp();
|
||||
if (mech.energy > 0.05) {
|
||||
//draw field
|
||||
if (mech.holdingTarget) {
|
||||
ctx.fillStyle = "rgba(110,170,200," + (0.06 + 0.03 * Math.random()) + ")";
|
||||
@@ -1269,11 +1273,9 @@ const mech = {
|
||||
cp1y = mech.pos.y + curve * mech.fieldRange * Math.sin(a)
|
||||
ctx.quadraticCurveTo(cp1x, cp1y, mech.pos.x + 1 * mech.fieldRange * Math.cos(mech.angle - Math.PI * mech.fieldArc), mech.pos.y + 1 * mech.fieldRange * Math.sin(mech.angle - Math.PI * mech.fieldArc))
|
||||
ctx.fill();
|
||||
|
||||
mech.grabPowerUp();
|
||||
mech.lookForPickUp();
|
||||
mech.pushMobsFacing();
|
||||
} else if (mech.holdingTarget && mech.fieldCDcycle < mech.cycle && mech.energy > 0.05) { //holding, but field button is released
|
||||
}
|
||||
} else if (mech.holdingTarget && mech.fieldCDcycle < mech.cycle) { //holding, but field button is released
|
||||
mech.pickUp();
|
||||
} else {
|
||||
mech.holdingTarget = null; //clears holding target (this is so you only pick up right after the field button is released and a hold target exists)
|
||||
@@ -1297,10 +1299,17 @@ const mech = {
|
||||
mech.holding();
|
||||
mech.throwBlock();
|
||||
} else if ((keys[32] || game.mouseDownRight) && mech.fieldCDcycle < mech.cycle) {
|
||||
mech.grabPowerUp();
|
||||
mech.lookForPickUp(180);
|
||||
|
||||
const DRAIN = 0.0023
|
||||
if (mech.energy > DRAIN) {
|
||||
mech.energy -= DRAIN;
|
||||
|
||||
if (mech.energy < 0) {
|
||||
mech.fieldCDcycle = mech.cycle + 60;
|
||||
mech.energy = 0;
|
||||
mech.wakeCheck();
|
||||
}
|
||||
//draw field everywhere
|
||||
ctx.globalCompositeOperation = "saturation"
|
||||
// ctx.fillStyle = "rgba(100,200,230," + (0.25 + 0.06 * Math.random()) + ")";
|
||||
@@ -1330,14 +1339,8 @@ const mech = {
|
||||
}
|
||||
}
|
||||
game.cycle--; //pause all functions that depend on game cycle increasing
|
||||
|
||||
mech.grabPowerUp();
|
||||
mech.lookForPickUp(180);
|
||||
} else {
|
||||
mech.wakeCheck();
|
||||
mech.fieldCDcycle = mech.cycle + 120;
|
||||
}
|
||||
} else if (mech.holdingTarget && mech.fieldCDcycle < mech.cycle && mech.energy > 0.05) { //holding, but field button is released
|
||||
} else if (mech.holdingTarget && mech.fieldCDcycle < mech.cycle) { //holding, but field button is released
|
||||
mech.wakeCheck();
|
||||
mech.pickUp();
|
||||
} else {
|
||||
@@ -1361,14 +1364,15 @@ const mech = {
|
||||
mech.holding();
|
||||
mech.throwBlock();
|
||||
} else if ((keys[32] || game.mouseDownRight) && mech.fieldCDcycle < mech.cycle) { //not hold but field button is pressed
|
||||
mech.grabPowerUp();
|
||||
mech.lookForPickUp();
|
||||
const DRAIN = 0.0005
|
||||
if (mech.energy > DRAIN) {
|
||||
mech.energy -= DRAIN;
|
||||
mech.grabPowerUp();
|
||||
mech.lookForPickUp();
|
||||
// mech.pushMobs360();
|
||||
// mech.pushMobsFacing();
|
||||
|
||||
if (mech.energy < 0) {
|
||||
mech.fieldCDcycle = mech.cycle + 60;
|
||||
mech.energy = 0;
|
||||
}
|
||||
//calculate laser collision
|
||||
let best;
|
||||
let range = b.isModPlasmaRange * (175 + (mech.crouch ? 450 : 350) * Math.sqrt(Math.random())) //+ 100 * Math.sin(mech.cycle * 0.3);
|
||||
@@ -1503,10 +1507,8 @@ const mech = {
|
||||
// ctx.fillStyle = "rgba(255,0,255,0.05)"
|
||||
// ctx.fill();
|
||||
// mech.pushBody360(100); //disabled because doesn't work at short range
|
||||
} else {
|
||||
mech.fieldCDcycle = mech.cycle + 120; //if out of energy
|
||||
}
|
||||
} else if (mech.holdingTarget && mech.fieldCDcycle < mech.cycle && mech.energy > 0.05) { //holding, but field button is released
|
||||
} else if (mech.holdingTarget && mech.fieldCDcycle < mech.cycle) { //holding, but field button is released
|
||||
mech.pickUp();
|
||||
} else {
|
||||
mech.holdingTarget = null; //clears holding target (this is so you only pick up right after the field button is released and a hold target exists)
|
||||
@@ -1532,11 +1534,11 @@ const mech = {
|
||||
mech.holding();
|
||||
mech.throwBlock();
|
||||
} else if ((keys[32] || game.mouseDownRight) && mech.fieldCDcycle < mech.cycle) { //push away
|
||||
mech.grabPowerUp();
|
||||
mech.lookForPickUp();
|
||||
const DRAIN = 0.00035
|
||||
if (mech.energy > DRAIN) {
|
||||
mech.fieldDamageResistance = 0.33; // 1 - 0.66
|
||||
mech.grabPowerUp();
|
||||
mech.lookForPickUp();
|
||||
// mech.pushMobs360();
|
||||
|
||||
//repulse mobs
|
||||
@@ -1582,7 +1584,10 @@ const mech = {
|
||||
zeroG(powerUp, this.fieldDrawRadius);
|
||||
zeroG(body, this.fieldDrawRadius);
|
||||
}
|
||||
|
||||
if (mech.energy < 0) {
|
||||
mech.fieldCDcycle = mech.cycle + 60;
|
||||
mech.energy = 0;
|
||||
}
|
||||
//add extra friction for horizontal motion
|
||||
if (keys[65] || keys[68] || keys[37] || keys[39]) {
|
||||
Matter.Body.setVelocity(player, {
|
||||
@@ -1630,11 +1635,8 @@ const mech = {
|
||||
}
|
||||
}
|
||||
ctx.globalCompositeOperation = "source-over";
|
||||
} else {
|
||||
//trigger cool down
|
||||
mech.fieldCDcycle = mech.cycle + 120;
|
||||
}
|
||||
} else if (mech.holdingTarget && mech.fieldCDcycle < mech.cycle && mech.energy > 0.05) { //holding, but field button is released
|
||||
} else if (mech.holdingTarget && mech.fieldCDcycle < mech.cycle) { //holding, but field button is released
|
||||
mech.pickUp();
|
||||
this.fieldDrawRadius = 0
|
||||
} else {
|
||||
@@ -1655,7 +1657,7 @@ const mech = {
|
||||
mech.drawHold(mech.holdingTarget);
|
||||
mech.holding();
|
||||
mech.throwBlock();
|
||||
} else if (((keys[32] || game.mouseDownRight) && mech.fieldCDcycle < mech.cycle && mech.energy > 0)) { //not hold but field button is pressed
|
||||
} else if ((keys[32] || game.mouseDownRight) && mech.fieldCDcycle < mech.cycle) { //not hold but field button is pressed
|
||||
mech.grabPowerUp();
|
||||
mech.lookForPickUp();
|
||||
} else if (mech.holdingTarget && mech.fieldCDcycle < mech.cycle) { //holding, but field button is released
|
||||
@@ -1690,7 +1692,7 @@ const mech = {
|
||||
description: "excess <strong class='color-f'>energy</strong> used to build <strong>drones</strong><br><strong>2x</strong> <strong class='color-f'>energy</strong> regeneration",
|
||||
isEasyToAim: true,
|
||||
effect: () => {
|
||||
mech.fieldRegen *= 2;
|
||||
// mech.fieldRegen *= 2;
|
||||
mech.hold = function () {
|
||||
if (mech.energy > mech.fieldEnergyMax - 0.02 && mech.fieldCDcycle < mech.cycle) {
|
||||
if (b.isModSporeField) {
|
||||
@@ -1725,16 +1727,19 @@ const mech = {
|
||||
mech.drawHold(mech.holdingTarget);
|
||||
mech.holding();
|
||||
mech.throwBlock();
|
||||
} else if ((keys[32] || game.mouseDownRight && mech.energy > 0.1 && mech.fieldCDcycle < mech.cycle)) { //not hold but field button is pressed
|
||||
mech.drawField();
|
||||
} else if ((keys[32] || game.mouseDownRight && mech.fieldCDcycle < mech.cycle)) { //not hold but field button is pressed
|
||||
mech.grabPowerUp();
|
||||
mech.lookForPickUp();
|
||||
if (mech.energy > 0.05) {
|
||||
mech.drawField();
|
||||
mech.pushMobsFacing();
|
||||
} else if (mech.holdingTarget && mech.fieldCDcycle < mech.cycle && mech.energy > 0.05) { //holding, but field button is released
|
||||
}
|
||||
} else if (mech.holdingTarget && mech.fieldCDcycle < mech.cycle) { //holding, but field button is released
|
||||
mech.pickUp();
|
||||
} else {
|
||||
mech.holdingTarget = null; //clears holding target (this is so you only pick up right after the field button is released and a hold target exists)
|
||||
}
|
||||
mech.energy += mech.fieldRegen;
|
||||
mech.drawFieldMeter()
|
||||
}
|
||||
}
|
||||
@@ -1745,7 +1750,6 @@ const mech = {
|
||||
isEasyToAim: true,
|
||||
effect: () => {
|
||||
mech.fieldMeterColor = "#fff"
|
||||
|
||||
mech.hold = function () {
|
||||
mech.isStealth = false //isStealth disables most uses of foundPlayer()
|
||||
player.collisionFilter.mask = cat.body | cat.map | cat.mob | cat.mobBullet | cat.mobShield //normal collisions
|
||||
@@ -1754,10 +1758,16 @@ const mech = {
|
||||
mech.holding();
|
||||
mech.throwBlock();
|
||||
} else if ((keys[32] || game.mouseDownRight) && mech.fieldCDcycle < mech.cycle) {
|
||||
mech.grabPowerUp();
|
||||
mech.lookForPickUp();
|
||||
|
||||
const DRAIN = 0.0001 + 0.00017 * player.speed
|
||||
if (mech.energy > DRAIN) {
|
||||
mech.energy -= DRAIN;
|
||||
|
||||
if (mech.energy < 0) {
|
||||
mech.fieldCDcycle = mech.cycle + 60;
|
||||
mech.energy = 0;
|
||||
}
|
||||
mech.isStealth = true //isStealth disables most uses of foundPlayer()
|
||||
player.collisionFilter.mask = cat.map
|
||||
|
||||
@@ -1771,9 +1781,6 @@ const mech = {
|
||||
ctx.lineWidth = 2;
|
||||
ctx.stroke();
|
||||
|
||||
mech.grabPowerUp();
|
||||
mech.lookForPickUp();
|
||||
|
||||
let inPlayer = Matter.Query.region(mob, player.bounds)
|
||||
if (inPlayer.length > 0) {
|
||||
for (let i = 0; i < inPlayer.length; i++) {
|
||||
@@ -1808,10 +1815,8 @@ const mech = {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
mech.fieldCDcycle = mech.cycle + 120;
|
||||
}
|
||||
} else if (mech.holdingTarget && mech.fieldCDcycle < mech.cycle && mech.energy > 0.05) { //holding, but field button is released
|
||||
} else if (mech.holdingTarget && mech.fieldCDcycle < mech.cycle) { //holding, but field button is released
|
||||
mech.pickUp();
|
||||
} else {
|
||||
mech.holdingTarget = null; //clears holding target (this is so you only pick up right after the field button is released and a hold target exists)
|
||||
@@ -1835,78 +1840,8 @@ const mech = {
|
||||
ctx.lineWidth = 1;
|
||||
ctx.stroke();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
// {
|
||||
// name: "code injection field",
|
||||
// description: "capture an enemy in your field for 3 seconds<br>rewrite thier behavior to target your enemies",
|
||||
// effect: () => {
|
||||
// mech.fieldMode = 7;
|
||||
// mech.fieldText();
|
||||
// mech.setHoldDefaults();
|
||||
// mech.hackProgress = 0;
|
||||
// mech.hold = function () {
|
||||
// mech.isStealth = false //isStealth is checked in mob foundPlayer()
|
||||
// player.collisionFilter.mask = 0x010011
|
||||
// if (mech.isHolding) {
|
||||
// mech.hackProgress = 0
|
||||
// mech.drawHold(mech.holdingTarget);
|
||||
// mech.holding();
|
||||
// mech.throwBlock();
|
||||
// } else if ((keys[32] || game.mouseDownRight) && mech.fieldCDcycle < mech.cycle) {
|
||||
// const DRAIN = 0.0005
|
||||
// if (mech.energy > DRAIN) {
|
||||
// mech.energy -= DRAIN;
|
||||
|
||||
// //try to hack a mob
|
||||
// for (let i = 0, len = mob.length; i < len; ++i) {
|
||||
// if (
|
||||
// Vector.magnitude(Vector.sub(mob[i].position, this.pos)) < this.fieldRange &&
|
||||
// this.lookingAt(mob[i]) &&
|
||||
// Matter.Query.ray(map, mob[i].position, this.pos).length === 0
|
||||
// ) {
|
||||
// if (mech.hackProgress > 180) { //hack the mob
|
||||
// mech.energy = 0;
|
||||
// mob[i].hackedTarget = null;
|
||||
// mob[i].seePlayerFreq = Math.round((30 + 30 * Math.random()) * game.lookFreqScale)
|
||||
// mob[i].do = function () {
|
||||
// this.healthBar();
|
||||
// this.hacked();
|
||||
// }
|
||||
// } else { //hold the mob still
|
||||
// mech.hackProgress++
|
||||
// range = this.fieldRange * 0.9
|
||||
// Matter.Body.setPosition(mob[i], {
|
||||
// x: mech.pos.x + range * Math.cos(mech.angle),
|
||||
// y: mech.pos.y + range * Math.sin(mech.angle),
|
||||
// });
|
||||
// Matter.Body.setVelocity(mob[i], player.velocity);
|
||||
// }
|
||||
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
// mech.pushBodyFacing();
|
||||
// mech.drawField();
|
||||
// mech.grabPowerUp();
|
||||
// mech.lookForPickUp();
|
||||
// } else {
|
||||
// mech.hackProgress = 0
|
||||
// mech.fieldCDcycle = mech.cycle + 120;
|
||||
// }
|
||||
// } else if (mech.holdingTarget && mech.fireCDcycle < mech.cycle && mech.energy > 0.05) { //holding, but field button is released
|
||||
// mech.pickUp();
|
||||
// mech.hackProgress = 0
|
||||
// } else {
|
||||
// mech.hackProgress = 0
|
||||
// mech.holdingTarget = null; //clears holding target (this is so you only pick up right after the field button is released and a hold target exists)
|
||||
// }
|
||||
// mech.drawFieldMeter()
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
],
|
||||
};
|
||||
7
todo.txt
7
todo.txt
@@ -1,3 +1,10 @@
|
||||
new mod - ground state: reduce harm by 77% but you don't regen energy
|
||||
negative feedback, entanglement, fluoroantimonic acid now indicate effects with text
|
||||
entanglement 13% -> 16% damage reduction
|
||||
piezoelectricity 10% -> 15% harm reduction
|
||||
acute stress response now does 33% damage and drains 50% energy once when a mob dies
|
||||
|
||||
|
||||
|
||||
************** TODO - n-gon **************
|
||||
|
||||
|
||||
Reference in New Issue
Block a user