sentry
mini black hole mobs travel through walls mod: radioactive contamination - after a mob or shield dies, leftover radiation spreads to a nearby mob mod: half-wave rectifier - railgun overfills with energy when you charge instead of draining removed rail gun mod - frame dragging bug fixed - rail gun bugs out when your charge speed gets very low mod: sentry - mines are modified to automatically fire nails at nearby targets for 12 seconds
This commit is contained in:
32
js/mob.js
32
js/mob.js
@@ -156,7 +156,7 @@ const mobs = {
|
||||
who.status.push({
|
||||
effect() {
|
||||
if ((game.cycle - this.startCycle) % 30 === 0) {
|
||||
let dmg = b.dmgScale * tickDamage
|
||||
let dmg = b.dmgScale * this.dmg
|
||||
who.damage(dmg);
|
||||
game.drawList.push({ //add dmg to draw queue
|
||||
x: who.position.x + (Math.random() - 0.5) * who.radius * 0.5,
|
||||
@@ -172,7 +172,8 @@ const mobs = {
|
||||
}
|
||||
},
|
||||
endEffect() {},
|
||||
// type: "DoT",
|
||||
dmg: tickDamage,
|
||||
type: "dot",
|
||||
endCycle: game.cycle + cycles,
|
||||
startCycle: game.cycle
|
||||
})
|
||||
@@ -1060,6 +1061,33 @@ const mobs = {
|
||||
powerUps.spawn(this.position.x, this.position.y, type);
|
||||
}
|
||||
}
|
||||
if (true) {
|
||||
//look for dots and spread them
|
||||
let dmgTotal = 0
|
||||
for (let i = 0, len = this.status.length; i < len; i++) {
|
||||
if (this.status[i].type === "dot") dmgTotal += this.status[i].dmg * (this.status[i].endCycle - game.cycle)
|
||||
}
|
||||
if (dmgTotal > 0) { //look for closest mob
|
||||
let closestRadius = 500;
|
||||
let closestIndex = null;
|
||||
for (let i = 0, len = mob.length; i < len; ++i) {
|
||||
const radius = Vector.magnitude(Vector.sub(this.position, mob[i].position))
|
||||
if (mob[i].alive && !mob[i].isShielded && radius < closestRadius) {
|
||||
closestRadius = radius
|
||||
closestIndex = i
|
||||
}
|
||||
}
|
||||
if (closestIndex) mobs.statusDoT(mob[closestIndex], dmgTotal / 180, 180)
|
||||
//draw AOE
|
||||
// game.drawList.push({ //add dmg to draw queue
|
||||
// x: this.position.x,
|
||||
// y: this.position.y,
|
||||
// radius: radius,
|
||||
// color: "rgba(0,80,80,0.03)",
|
||||
// time: 15
|
||||
// });
|
||||
}
|
||||
}
|
||||
},
|
||||
removeConsBB() {
|
||||
for (let i = 0, len = consBB.length; i < len; ++i) {
|
||||
|
||||
Reference in New Issue
Block a user