foam damage mod
This commit is contained in:
71
js/bullet.js
71
js/bullet.js
@@ -624,7 +624,7 @@ const b = {
|
||||
onDmg(who) {
|
||||
mobs.statusSlow(who, 60)
|
||||
this.endCycle = game.cycle
|
||||
if (mod.isHeavyWater) mobs.statusDoT(who, 0.1, 180)
|
||||
if (mod.isHeavyWater) mobs.statusDoT(who, 0.1, 300)
|
||||
},
|
||||
onEnd() {},
|
||||
do() {
|
||||
@@ -681,7 +681,7 @@ const b = {
|
||||
friction: 0.05,
|
||||
frictionAir: 0,
|
||||
restitution: 1,
|
||||
dmg: 0.28, //damage done in addition to the damage from momentum
|
||||
dmg: 0.24, //damage done in addition to the damage from momentum
|
||||
lookFrequency: 80 + Math.floor(23 * Math.random()),
|
||||
endCycle: game.cycle + Math.floor((1100 + 420 * Math.random()) * mod.isBulletsLastLonger),
|
||||
classType: "bullet",
|
||||
@@ -794,13 +794,14 @@ const b = {
|
||||
radius *= Math.sqrt(mod.bulletSize)
|
||||
const me = bullet.length;
|
||||
bullet[me] = Bodies.polygon(position.x, position.y, 20, radius, {
|
||||
angle: 0,
|
||||
// angle: 0,
|
||||
density: 0.00005, // 0.001 is normal density
|
||||
inertia: Infinity,
|
||||
frictionAir: 0.003,
|
||||
friction: 0.2,
|
||||
restitution: 0.2,
|
||||
dmg: 0.1, //damage done in addition to the damage from momentum
|
||||
// friction: 0.2,
|
||||
// restitution: 0.2,
|
||||
dmg: mod.isFastFoam ? 0.02 : 0.0055, //damage done in addition to the damage from momentum
|
||||
scale: 1 - 0.005 / mod.isBulletsLastLonger * (mod.isFastFoam ? 1.7 : 1),
|
||||
classType: "bullet",
|
||||
collisionFilter: {
|
||||
category: cat.bullet,
|
||||
@@ -845,31 +846,6 @@ const b = {
|
||||
onEnd() {},
|
||||
do() {
|
||||
if (!mech.isBodiesAsleep) { //if time dilation isn't active
|
||||
//check for touching map
|
||||
|
||||
// if (Matter.Query.collides(this, map).length > 0) {
|
||||
if (Matter.Query.point(map, this.position).length > 0) {
|
||||
const slow = 0.85
|
||||
Matter.Body.setVelocity(this, {
|
||||
x: this.velocity.x * slow,
|
||||
y: this.velocity.y * slow
|
||||
});
|
||||
const SCALE = 0.96
|
||||
Matter.Body.scale(this, SCALE, SCALE);
|
||||
this.radius *= SCALE;
|
||||
// } else if (Matter.Query.collides(this, body).length > 0) {
|
||||
} else if (Matter.Query.point(body, this.position).length > 0) {
|
||||
const slow = 0.9
|
||||
Matter.Body.setVelocity(this, {
|
||||
x: this.velocity.x * slow,
|
||||
y: this.velocity.y * slow
|
||||
});
|
||||
const SCALE = 0.96
|
||||
Matter.Body.scale(this, SCALE, SCALE);
|
||||
this.radius *= SCALE;
|
||||
} else {
|
||||
this.force.y += this.mass * 0.00008; //gravity
|
||||
}
|
||||
if (this.count < 20) {
|
||||
this.count++
|
||||
//grow
|
||||
@@ -878,9 +854,8 @@ const b = {
|
||||
this.radius *= SCALE;
|
||||
} else {
|
||||
//shrink
|
||||
const SCALE = 1 - 0.005 / mod.isBulletsLastLonger
|
||||
Matter.Body.scale(this, SCALE, SCALE);
|
||||
this.radius *= SCALE;
|
||||
Matter.Body.scale(this, this.scale, this.scale);
|
||||
this.radius *= this.scale;
|
||||
if (this.radius < 8) this.endCycle = 0;
|
||||
}
|
||||
|
||||
@@ -896,13 +871,13 @@ const b = {
|
||||
|
||||
// Matter.Body.setAngularVelocity(this.target, this.target.angularVelocity * 0.9)
|
||||
if (this.target.isShielded) {
|
||||
this.target.damage(b.dmgScale * 0.005, true); //shield damage bypass
|
||||
this.target.damage(b.dmgScale * this.dmg, true); //shield damage bypass
|
||||
//shrink if mob is shielded
|
||||
const SCALE = 1 - 0.018 / mod.isBulletsLastLonger
|
||||
Matter.Body.scale(this, SCALE, SCALE);
|
||||
this.radius *= SCALE;
|
||||
} else {
|
||||
this.target.damage(b.dmgScale * 0.005);
|
||||
this.target.damage(b.dmgScale * this.dmg);
|
||||
}
|
||||
} else if (this.target !== null) { //look for a new target
|
||||
this.target = null
|
||||
@@ -931,7 +906,27 @@ const b = {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else if (Matter.Query.point(map, this.position).length > 0) { //slow when touching map or blocks
|
||||
const slow = 0.85
|
||||
Matter.Body.setVelocity(this, {
|
||||
x: this.velocity.x * slow,
|
||||
y: this.velocity.y * slow
|
||||
});
|
||||
const SCALE = 0.96
|
||||
Matter.Body.scale(this, SCALE, SCALE);
|
||||
this.radius *= SCALE;
|
||||
// } else if (Matter.Query.collides(this, body).length > 0) {
|
||||
} else if (Matter.Query.point(body, this.position).length > 0) {
|
||||
const slow = 0.9
|
||||
Matter.Body.setVelocity(this, {
|
||||
x: this.velocity.x * slow,
|
||||
y: this.velocity.y * slow
|
||||
});
|
||||
const SCALE = 0.96
|
||||
Matter.Body.scale(this, SCALE, SCALE);
|
||||
this.radius *= SCALE;
|
||||
} else {
|
||||
this.force.y += this.mass * 0.00008; //gravity
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1843,7 +1838,7 @@ const b = {
|
||||
// check if inside a mob
|
||||
q = Matter.Query.point(mob, this.position)
|
||||
for (let i = 0; i < q.length; i++) {
|
||||
let dmg = b.dmgScale * 0.40 / Math.sqrt(q[i].mass) * (mod.waveHelix === 1 ? 1 : 0.6) //1 - 0.4 = 0.6 for helix mod 40% damage reduction
|
||||
let dmg = b.dmgScale * 0.36 / Math.sqrt(q[i].mass) * (mod.waveHelix === 1 ? 1 : 0.66) //1 - 0.4 = 0.6 for helix mod 40% damage reduction
|
||||
q[i].damage(dmg);
|
||||
q[i].foundPlayer();
|
||||
game.drawList.push({ //add dmg to draw queue
|
||||
|
||||
@@ -202,9 +202,7 @@ function collisionChecks(event) {
|
||||
}
|
||||
//mob + bullet collisions
|
||||
if (obj.classType === "bullet" && obj.speed > obj.minDmgSpeed) {
|
||||
// const dmg = b.dmgScale * (obj.dmg + 0.15 * obj.mass * Vector.magnitude(Vector.sub(mob[k].velocity, obj.velocity)));
|
||||
let dmg = b.dmgScale * (obj.dmg + 0.15 * obj.mass * Vector.magnitude(Vector.sub(mob[k].velocity, obj.velocity)))
|
||||
// console.log(dmg)
|
||||
if (mod.isCrit && !mob[k].seePlayer.recall && !mob[k].shield) dmg *= 5
|
||||
mob[k].foundPlayer();
|
||||
mob[k].damage(dmg);
|
||||
@@ -223,7 +221,6 @@ function collisionChecks(event) {
|
||||
const v = Vector.magnitude(Vector.sub(mob[k].velocity, obj.velocity));
|
||||
if (v > 9) {
|
||||
let dmg = 0.06 * b.dmgScale * v * obj.mass * mod.throwChargeRate;
|
||||
if (mod.isCrit && !mob[k].seePlayer.recall && !mob[k].shield) dmg *= 5
|
||||
if (mob[k].isShielded) dmg *= 0.35
|
||||
mob[k].damage(dmg, true);
|
||||
if (mob[k].distanceToPlayer2() < 1000000) mob[k].foundPlayer();
|
||||
|
||||
70
js/mods.js
70
js/mods.js
@@ -79,7 +79,7 @@ const mod = {
|
||||
},
|
||||
damageFromMods() {
|
||||
let dmg = 1
|
||||
if (mod.isDamageForGuns) dmg *= 1 + 0.066 * b.inventory.length
|
||||
if (mod.isDamageForGuns) dmg *= 1 + 0.07 * b.inventory.length
|
||||
if (mod.isLowHealthDmg) dmg *= 1 + 0.5 * Math.max(0, 1 - mech.health)
|
||||
if (mod.isHarmDamage && mech.lastHarmCycle + 600 > mech.cycle) dmg *= 2;
|
||||
if (mod.isEnergyLoss) dmg *= 1.33;
|
||||
@@ -175,22 +175,6 @@ const mod = {
|
||||
mod.isFarAwayDmg = false;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "fracture analysis",
|
||||
description: "increase <strong class='color-d'>damage</strong> by <strong>400%</strong><br>for mobs that are <strong>unaware</strong> of you",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
return true
|
||||
},
|
||||
requires: "",
|
||||
effect() {
|
||||
mod.isCrit = true;
|
||||
},
|
||||
remove() {
|
||||
mod.isCrit = false;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "fluoroantimonic acid",
|
||||
description: "increase <strong class='color-d'>damage</strong> by <strong>40%</strong><br>when your base <strong>health</strong> is above <strong>100%</strong>",
|
||||
@@ -1068,7 +1052,7 @@ const mod = {
|
||||
},
|
||||
{
|
||||
name: "arsenal",
|
||||
description: "increase <strong class='color-d'>damage</strong> by <strong>6.6%</strong><br>for each <strong class='color-g'>gun</strong> in your inventory",
|
||||
description: "increase <strong class='color-d'>damage</strong> by <strong>7%</strong><br>for each <strong class='color-g'>gun</strong> in your inventory",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
@@ -1610,7 +1594,7 @@ const mod = {
|
||||
},
|
||||
{
|
||||
name: "wave packet",
|
||||
description: "<strong>wave beam</strong> emits <strong>two</strong> oscillating particles<br>decrease wave <strong class='color-d'>damage</strong> by <strong>40%</strong>",
|
||||
description: "<strong>wave beam</strong> emits <strong>two</strong> oscillating particles<br>decrease wave <strong class='color-d'>damage</strong> by <strong>33%</strong>",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
@@ -1969,7 +1953,7 @@ const mod = {
|
||||
},
|
||||
{
|
||||
name: "heavy water",
|
||||
description: "<strong>ice IX</strong> is synthesized with an extra neutron<br>does <strong class='color-p'>radioactive</strong> <strong class='color-d'>damage</strong> over <strong>3</strong> seconds",
|
||||
description: "<strong>ice IX</strong> is synthesized with an extra neutron<br>does <strong class='color-p'>radioactive</strong> <strong class='color-d'>damage</strong> over <strong>5</strong> seconds",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
@@ -1999,6 +1983,22 @@ const mod = {
|
||||
mod.isFoamGrowOnDeath = false;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "colloidal foam",
|
||||
description: "increase <strong>foam</strong> <strong class='color-d'>damage</strong> by <strong>200%</strong><br><strong>foam</strong> dissipates <strong>50%</strong> faster",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
return mod.haveGunCheck("foam") || mod.foamBotCount > 2
|
||||
},
|
||||
requires: "foam",
|
||||
effect() {
|
||||
mod.isFastFoam = true
|
||||
},
|
||||
remove() {
|
||||
mod.isFastFoam = false;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "frame-dragging",
|
||||
description: "<strong>slow time</strong> while charging the <strong>rail gun</strong><br>charging no longer drains <strong class='color-f'>energy</strong>",
|
||||
@@ -2138,7 +2138,7 @@ const mod = {
|
||||
},
|
||||
{
|
||||
name: "timelike world line",
|
||||
description: "<strong>time dilation</strong> doubles your time <strong>rate</strong><br>and makes you <strong>immune</strong> to <strong class='color-harm'>harm</strong>",
|
||||
description: "<strong>time dilation</strong> doubles your relative time <strong>rate</strong><br>and makes you <strong>immune</strong> to <strong class='color-harm'>harm</strong>",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
@@ -2156,7 +2156,7 @@ const mod = {
|
||||
},
|
||||
{
|
||||
name: "Lorentz transformation",
|
||||
description: "<strong>move</strong>, <strong>jump</strong>, and <strong>shoot</strong> <strong>33%</strong> faster",
|
||||
description: "permanently increase your relative time rate<br><strong>move</strong>, <strong>jump</strong>, and <strong>shoot</strong> <strong>33%</strong> faster",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
@@ -2194,7 +2194,7 @@ const mod = {
|
||||
},
|
||||
{
|
||||
name: "plasma-bot",
|
||||
description: "a bot uses <strong class='color-f'>energy</strong> to emit short range <strong>plasma</strong><br>plasma <strong class='color-d'>damages</strong> and <strong>pushes</strong> mobs",
|
||||
description: "a bot uses <strong class='color-f'>energy</strong> to emit short range <strong>plasma</strong><br>that <strong class='color-d'>damages</strong> and <strong>pushes</strong> mobs",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
@@ -2389,6 +2389,22 @@ const mod = {
|
||||
mod.superposition = false;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "fracture analysis",
|
||||
description: "bullet impacts do <strong>500%</strong> <strong class='color-d'>damage</strong><br>to mobs that are <strong>unaware</strong> of you or <strong>stunned</strong>",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
return mod.isStunField || mech.fieldUpgrades[mech.fieldMode].name === "phase decoherence field"
|
||||
},
|
||||
requires: "phase decoherence field or flux pinning",
|
||||
effect() {
|
||||
mod.isCrit = true;
|
||||
},
|
||||
remove() {
|
||||
mod.isCrit = false;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "Bose Einstein condensate",
|
||||
description: "<strong>mobs</strong> in superposition with the <strong>pilot wave</strong><br>are <strong class='color-s'>frozen</strong> for <strong>2</strong> seconds",
|
||||
@@ -2420,6 +2436,7 @@ const mod = {
|
||||
powerUps.spawn(mech.pos.x, mech.pos.y, "heal");
|
||||
if (Math.random() < mod.bayesian) powerUps.spawn(mech.pos.x, mech.pos.y, "heal");
|
||||
}
|
||||
this.count--
|
||||
},
|
||||
remove() {}
|
||||
},
|
||||
@@ -2438,6 +2455,7 @@ const mod = {
|
||||
powerUps.spawn(mech.pos.x, mech.pos.y, "ammo");
|
||||
if (Math.random() < mod.bayesian) powerUps.spawn(mech.pos.x, mech.pos.y, "ammo");
|
||||
}
|
||||
this.count--
|
||||
},
|
||||
remove() {}
|
||||
},
|
||||
@@ -2457,6 +2475,7 @@ const mod = {
|
||||
powerUps.spawn(mech.pos.x, mech.pos.y, "reroll");
|
||||
if (Math.random() < mod.bayesian) powerUps.spawn(mech.pos.x, mech.pos.y, "reroll");
|
||||
}
|
||||
this.count--
|
||||
},
|
||||
remove() {}
|
||||
},
|
||||
@@ -2473,6 +2492,7 @@ const mod = {
|
||||
effect() {
|
||||
powerUps.spawn(mech.pos.x, mech.pos.y, "gun");
|
||||
if (Math.random() < mod.bayesian) powerUps.spawn(mech.pos.x, mech.pos.y, "gun");
|
||||
this.count--
|
||||
},
|
||||
remove() {}
|
||||
},
|
||||
@@ -2489,6 +2509,7 @@ const mod = {
|
||||
effect() {
|
||||
powerUps.spawn(mech.pos.x, mech.pos.y, "field");
|
||||
if (Math.random() < mod.bayesian) powerUps.spawn(mech.pos.x, mech.pos.y, "field");
|
||||
this.count--
|
||||
},
|
||||
remove() {}
|
||||
},
|
||||
@@ -2610,5 +2631,6 @@ const mod = {
|
||||
isDroneGrab: null,
|
||||
isOneGun: null,
|
||||
isDamageForGuns: null,
|
||||
isGunCycle: null
|
||||
isGunCycle: null,
|
||||
isFastFoam: null
|
||||
}
|
||||
@@ -496,8 +496,6 @@ const powerUps = {
|
||||
if (Math.random() < mod.bayesian) powerUps.spawn(x, y, "gun")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
chooseRandomPowerUp(x, y) { //100% chance to drop a random power up //used in spawn.debris
|
||||
if (Math.random() < 0.5) {
|
||||
@@ -526,6 +524,8 @@ const powerUps = {
|
||||
} 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);
|
||||
}
|
||||
} else {
|
||||
powerUps.spawnRandomPowerUp(x, y);
|
||||
|
||||
Reference in New Issue
Block a user