mod - super ball stun, ice crystal mod uses energy
This commit is contained in:
@@ -766,7 +766,7 @@ const b = {
|
||||
|
||||
{
|
||||
name: "ice crystal nucleation",
|
||||
description: "your <strong>minigun</strong> condenses <strong>unlimited ammo</strong><br>ice bullets made from water vapor <strong>slow</strong> mobs",
|
||||
description: "your <strong>minigun</strong> uses <strong class='color-f'>energy</strong> to condense<br><strong>bullets</strong> from water vapor that <strong>slow</strong> mobs",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
@@ -815,7 +815,7 @@ const b = {
|
||||
},
|
||||
{
|
||||
name: "super duper",
|
||||
description: "fire <strong>+2</strong> additional <strong>super ball</strong>",
|
||||
description: "fire <strong>+2</strong> additional <strong>super balls</strong>",
|
||||
maxCount: 9,
|
||||
count: 0,
|
||||
allowed() {
|
||||
@@ -831,7 +831,7 @@ const b = {
|
||||
},
|
||||
{
|
||||
name: "super ball",
|
||||
description: "fire a single <strong>huge</strong> super <strong>ball</strong>",
|
||||
description: "fire one <strong>large</strong> super <strong>ball</strong><br>that <strong>stuns</strong> mobs for <strong>2</strong> second",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
@@ -1251,8 +1251,8 @@ const b = {
|
||||
game.updateGunHUD();
|
||||
}
|
||||
} else {
|
||||
if (b.isModAmmoFromHealth && mech.health > b.isModAmmoFromHealth) {
|
||||
mech.damage(b.isModAmmoFromHealth * mech.health);
|
||||
if (b.isModAmmoFromHealth && mech.health > 0.05) {
|
||||
mech.damage(Math.max(0.01, b.isModAmmoFromHealth * mech.health));
|
||||
powerUps.spawn(mech.pos.x, mech.pos.y, "ammo");
|
||||
if (Math.random() < b.isModBayesian) powerUps.spawn(mech.pos.x, mech.pos.y, "ammo");
|
||||
}
|
||||
@@ -2123,12 +2123,14 @@ const b = {
|
||||
bullet[me].endCycle = game.cycle + 70;
|
||||
bullet[me].dmg = 0.07;
|
||||
bullet[me].frictionAir = mech.crouch ? 0.007 : 0.01;
|
||||
if (b.isModIceCrystals) {
|
||||
if (b.isModIceCrystals && mech.energy > 0.01) {
|
||||
mech.energy -= mech.fieldRegen + 0.007
|
||||
bullet[me].onDmg = function (who) {
|
||||
mobs.statusSlow(who, 60)
|
||||
};
|
||||
//ice muzzleFlash
|
||||
ctx.fillStyle = "rgb(0,100,255)";
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.arc(mech.pos.x + 35 * Math.cos(mech.angle), mech.pos.y + 35 * Math.sin(mech.angle), 15, 0, 2 * Math.PI);
|
||||
ctx.fill();
|
||||
@@ -2192,7 +2194,7 @@ const b = {
|
||||
if (b.modOneSuperBall) {
|
||||
let dir = mech.angle
|
||||
const me = bullet.length;
|
||||
bullet[me] = Bodies.polygon(mech.pos.x + 30 * Math.cos(mech.angle), mech.pos.y + 30 * Math.sin(mech.angle), 12, 22 * b.modBulletSize, b.fireAttributes(dir, false));
|
||||
bullet[me] = Bodies.polygon(mech.pos.x + 30 * Math.cos(mech.angle), mech.pos.y + 30 * Math.sin(mech.angle), 12, 20 * b.modBulletSize, b.fireAttributes(dir, false));
|
||||
World.add(engine.world, bullet[me]); //add bullet to world
|
||||
Matter.Body.setVelocity(bullet[me], {
|
||||
x: SPEED * Math.cos(dir),
|
||||
@@ -2206,6 +2208,9 @@ const b = {
|
||||
bullet[me].do = function () {
|
||||
this.force.y += this.mass * 0.001;
|
||||
};
|
||||
bullet[me].onDmg = function (who) {
|
||||
mobs.statusStun(who, 120) // (2.3) * 2 / 14 ticks (2x damage over 7 seconds)
|
||||
};
|
||||
} else {
|
||||
b.muzzleFlash(20);
|
||||
const SPREAD = mech.crouch ? 0.08 : 0.15
|
||||
@@ -2261,12 +2266,10 @@ const b = {
|
||||
bullet[me].endCycle = game.cycle + 180;
|
||||
bullet[me].dmg = 0;
|
||||
bullet[me].onDmg = function (who) {
|
||||
if (!who.isShielded) {
|
||||
if (b.isModDotFlechette) {
|
||||
mobs.statusPoison(who, 0.33, 360) // (2.3) * 2 / 14 ticks (2x damage over 7 seconds)
|
||||
} else {
|
||||
mobs.statusPoison(who, 0.33, 180) // (2.3) / 6 ticks (3 seconds)
|
||||
}
|
||||
if (b.isModDotFlechette) {
|
||||
mobs.statusPoison(who, 0.33, 360) // (2.3) * 2 / 14 ticks (2x damage over 7 seconds)
|
||||
} else {
|
||||
mobs.statusPoison(who, 0.33, 180) // (2.3) / 6 ticks (3 seconds)
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
94
js/mobs.js
94
js/mobs.js
@@ -79,13 +79,13 @@ const mobs = {
|
||||
})
|
||||
}
|
||||
},
|
||||
statusStun(who, cycles = 60) {
|
||||
statusStun(who, cycles = 120) {
|
||||
if (!who.shield && !who.isShielded) {
|
||||
Matter.Body.setVelocity(who, {
|
||||
x: 0,
|
||||
y: 0
|
||||
x: who.velocity.x * 0.8,
|
||||
y: who.velocity.y * 0.8
|
||||
});
|
||||
Matter.Body.setAngularVelocity(who, 0);
|
||||
Matter.Body.setAngularVelocity(who, who.angularVelocity * 0.8);
|
||||
//remove other "stun" effects on this mob
|
||||
let i = who.status.length
|
||||
while (i--) {
|
||||
@@ -98,7 +98,7 @@ const mobs = {
|
||||
x: who.position.x + 100 * (Math.random() - 0.5),
|
||||
y: who.position.y + 100 * (Math.random() - 0.5)
|
||||
}
|
||||
who.force.y += who.mass * 0.002 //extra gravity
|
||||
who.force.y += who.mass * 0.001 //extra gravity
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(who.vertices[0].x, who.vertices[0].y);
|
||||
@@ -117,49 +117,53 @@ const mobs = {
|
||||
}
|
||||
},
|
||||
statusPoison(who, tickDamage, cycles = 180) {
|
||||
who.status.push({
|
||||
effect() {
|
||||
if ((game.cycle - this.startCycle) % 30 === 0) {
|
||||
let dmg = b.dmgScale * tickDamage
|
||||
who.damage(dmg);
|
||||
game.drawList.push({ //add dmg to draw queue
|
||||
x: who.position.x,
|
||||
y: who.position.y,
|
||||
radius: Math.log(2 * dmg + 1.1) * 40,
|
||||
color: "rgba(0,80,80,0.9)",
|
||||
time: game.drawTime
|
||||
});
|
||||
}
|
||||
},
|
||||
type: "poison",
|
||||
endCycle: game.cycle + cycles,
|
||||
startCycle: game.cycle
|
||||
})
|
||||
if (!who.isShielded) {
|
||||
who.status.push({
|
||||
effect() {
|
||||
if ((game.cycle - this.startCycle) % 30 === 0) {
|
||||
let dmg = b.dmgScale * tickDamage
|
||||
who.damage(dmg);
|
||||
game.drawList.push({ //add dmg to draw queue
|
||||
x: who.position.x,
|
||||
y: who.position.y,
|
||||
radius: Math.log(2 * dmg + 1.1) * 40,
|
||||
color: "rgba(0,80,80,0.9)",
|
||||
time: game.drawTime
|
||||
});
|
||||
}
|
||||
},
|
||||
type: "poison",
|
||||
endCycle: game.cycle + cycles,
|
||||
startCycle: game.cycle
|
||||
})
|
||||
}
|
||||
},
|
||||
statusBurn(who, tickDamage, cycles = 90 + Math.floor(90 * Math.random())) {
|
||||
//remove other "burn" effects on this mob
|
||||
let i = who.status.length
|
||||
while (i--) {
|
||||
if (who.status[i].type === "burn") who.status.splice(i, 1);
|
||||
if (!who.isShielded) {
|
||||
//remove other "burn" effects on this mob
|
||||
let i = who.status.length
|
||||
while (i--) {
|
||||
if (who.status[i].type === "burn") who.status.splice(i, 1);
|
||||
}
|
||||
who.status.push({
|
||||
effect() {
|
||||
if ((game.cycle - this.startCycle) % 15 === 0) {
|
||||
let dmg = b.dmgScale * tickDamage * 0.5 * (1 + Math.random())
|
||||
who.damage(dmg);
|
||||
game.drawList.push({ //add dmg to draw queue
|
||||
x: who.position.x,
|
||||
y: who.position.y,
|
||||
radius: Math.log(2 * dmg + 1.1) * 40,
|
||||
color: `rgba(255,${Math.floor(255*Math.random())},0,0.9)`,
|
||||
time: game.drawTime
|
||||
});
|
||||
}
|
||||
},
|
||||
type: "burn",
|
||||
endCycle: game.cycle + cycles,
|
||||
startCycle: game.cycle
|
||||
})
|
||||
}
|
||||
who.status.push({
|
||||
effect() {
|
||||
if ((game.cycle - this.startCycle) % 15 === 0) {
|
||||
let dmg = b.dmgScale * tickDamage * 0.5 * (1 + Math.random())
|
||||
who.damage(dmg);
|
||||
game.drawList.push({ //add dmg to draw queue
|
||||
x: who.position.x,
|
||||
y: who.position.y,
|
||||
radius: Math.log(2 * dmg + 1.1) * 40,
|
||||
color: `rgba(255,${Math.floor(255*Math.random())},0,0.9)`,
|
||||
time: game.drawTime
|
||||
});
|
||||
}
|
||||
},
|
||||
type: "burn",
|
||||
endCycle: game.cycle + cycles,
|
||||
startCycle: game.cycle
|
||||
})
|
||||
},
|
||||
|
||||
//**********************************************************************************************
|
||||
|
||||
3
todo.txt
3
todo.txt
@@ -1,7 +1,6 @@
|
||||
************** TODO - n-gon **************
|
||||
|
||||
mod - super balls fire one ball at a time
|
||||
ammo and fire rate is improved by the number of balls fired
|
||||
mod or field - turn blocks into spores or drones
|
||||
|
||||
mod - robot that attack nearby mobs, and delivers a stun status effect
|
||||
use laser bot code for the attack
|
||||
|
||||
Reference in New Issue
Block a user