stun and burn balance

This commit is contained in:
landgreen
2020-03-09 06:05:41 -07:00
parent 99f36288a9
commit 014ffdab8f
6 changed files with 97 additions and 65 deletions

View File

@@ -89,7 +89,7 @@ const b = {
}, },
{ {
name: "fluoroantimonic acid", name: "fluoroantimonic acid",
description: "each <strong>bullet</strong> does instant <strong class='color-d'>damage</strong><br><strong>active</strong> when you are above <strong>80%</strong> base health", description: "each <strong>bullet</strong> does instant <strong class='color-p'>acid</strong> <strong class='color-d'>damage</strong><br><strong>active</strong> when you are above <strong>80%</strong> base health",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -1459,7 +1459,7 @@ const b = {
mob[i].force.y += knock.y; mob[i].force.y += knock.y;
radius *= 0.93 //reduced range for each additional explosion target radius *= 0.93 //reduced range for each additional explosion target
damageScale *= 0.8 //reduced damage for each additional explosion target damageScale *= 0.8 //reduced damage for each additional explosion target
// mobs.statusBlind(mob[i]) mobs.statusStun(mob[i])
// if (isBurn) mobs.statusBurn(mob[i], 0.4) // (2.2) * 1.3 * 30/180 // 6 ticks (3 seconds) // if (isBurn) mobs.statusBurn(mob[i], 0.4) // (2.2) * 1.3 * 30/180 // 6 ticks (3 seconds)
} else if (!mob[i].seePlayer.recall && dist < alertRange) { } else if (!mob[i].seePlayer.recall && dist < alertRange) {
mob[i].locatePlayer(); mob[i].locatePlayer();
@@ -1720,7 +1720,7 @@ const b = {
friction: 0, friction: 0,
frictionAir: 0.025, frictionAir: 0.025,
thrust: b.isModFastSpores ? 0.0008 : 0.0004, thrust: b.isModFastSpores ? 0.0008 : 0.0004,
dmg: 0, //2.2, //damage done in addition to the damage from momentum dmg: 2.2, //damage done in addition to the damage from momentum
classType: "bullet", classType: "bullet",
collisionFilter: { collisionFilter: {
category: cat.bullet, category: cat.bullet,
@@ -1728,8 +1728,8 @@ const b = {
}, },
endCycle: game.cycle + Math.floor((660 + Math.floor(Math.random() * 240)) * b.isModBulletsLastLonger), endCycle: game.cycle + Math.floor((660 + Math.floor(Math.random() * 240)) * b.isModBulletsLastLonger),
minDmgSpeed: 0, minDmgSpeed: 0,
onDmg(who) { onDmg() {
mobs.statusPoison(who, 0.5, 180) // (2.2) * 1.3 * 30/180 // 6 ticks (3 seconds) // mobs.statusPoison(who, 0.5, 180) // (2.2) * 1.3 * 30/180 // 6 ticks (3 seconds)
this.endCycle = 0; //bullet ends cycle after doing damage this.endCycle = 0; //bullet ends cycle after doing damage
}, },
onEnd() {}, onEnd() {},
@@ -2104,8 +2104,6 @@ const b = {
isEasyToAim: false, isEasyToAim: false,
fire() { fire() {
const me = bullet.length; const me = bullet.length;
b.muzzleFlash(15);
// if (Math.random() > 0.2) mobs.alert(500);
const dir = mech.angle + (Math.random() - 0.5) * ((mech.crouch) ? 0.03 : 0.1); const dir = mech.angle + (Math.random() - 0.5) * ((mech.crouch) ? 0.03 : 0.1);
bullet[me] = Bodies.rectangle(mech.pos.x + 30 * Math.cos(mech.angle), mech.pos.y + 30 * Math.sin(mech.angle), 20 * b.modBulletSize, 6 * b.modBulletSize, b.fireAttributes(dir)); bullet[me] = Bodies.rectangle(mech.pos.x + 30 * Math.cos(mech.angle), mech.pos.y + 30 * Math.sin(mech.angle), 20 * b.modBulletSize, 6 * b.modBulletSize, b.fireAttributes(dir));
b.fireProps(mech.crouch ? 8 : 4, mech.crouch ? 52 : 38, dir, me); //cd , speed b.fireProps(mech.crouch ? 8 : 4, mech.crouch ? 52 : 38, dir, me); //cd , speed
@@ -2114,8 +2112,15 @@ const b = {
bullet[me].frictionAir = mech.crouch ? 0.007 : 0.01; bullet[me].frictionAir = mech.crouch ? 0.007 : 0.01;
if (b.isModIceCrystals) { if (b.isModIceCrystals) {
bullet[me].onDmg = function (who) { bullet[me].onDmg = function (who) {
if (!who.shield) mobs.statusSlow(who, 60) 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();
} else {
b.muzzleFlash(15);
} }
bullet[me].do = function () { bullet[me].do = function () {
this.force.y += this.mass * 0.0005; this.force.y += this.mass * 0.0005;
@@ -2163,7 +2168,7 @@ const b = {
name: "super balls", //2 name: "super balls", //2
description: "fire <strong>four</strong> balls in a wide arc<br>balls <strong>bounce</strong> with no momentum loss", description: "fire <strong>four</strong> balls in a wide arc<br>balls <strong>bounce</strong> with no momentum loss",
ammo: 0, ammo: 0,
ammoPack: 10, ammoPack: 12,
have: false, have: false,
num: 5, num: 5,
isStarterGun: true, isStarterGun: true,
@@ -2198,10 +2203,10 @@ const b = {
}, },
{ {
name: "fléchettes", //3 name: "fléchettes", //3
description: "fire a <strong>precise</strong> volley of <strong>high velocity</strong> needles<br>needles deliver <strong class='color-p'>chemical</strong> damage over 3 seconds", description: "fire a <strong>precise</strong> volley of <strong>high velocity</strong> needles<br>needles deliver <strong class='color-p'>chemical</strong> <strong class='color-d'>damage</strong> over 3 seconds",
ammo: 0, ammo: 0,
ammoPack: 22, ammoPack: 23,
defaultAmmoPack: 22, defaultAmmoPack: 23,
have: false, have: false,
isStarterGun: true, isStarterGun: true,
isEasyToAim: false, isEasyToAim: false,
@@ -2222,14 +2227,16 @@ const b = {
function makeFlechette(angle = mech.angle) { function makeFlechette(angle = mech.angle) {
const me = bullet.length; const me = bullet.length;
bullet[me] = Bodies.rectangle(mech.pos.x + 40 * Math.cos(mech.angle), mech.pos.y + 40 * Math.sin(mech.angle), 45 * b.modBulletSize, 1.4 * b.modBulletSize, b.fireAttributes(angle)); bullet[me] = Bodies.rectangle(mech.pos.x + 40 * Math.cos(mech.angle), mech.pos.y + 40 * Math.sin(mech.angle), 45 * b.modBulletSize, 1.4 * b.modBulletSize, b.fireAttributes(angle));
Matter.Body.setDensity(bullet[me], 0.0001); //0.001 is normal // Matter.Body.setDensity(bullet[me], 0.0001); //0.001 is normal
bullet[me].endCycle = game.cycle + 180; bullet[me].endCycle = game.cycle + 180;
bullet[me].dmg = 0; bullet[me].dmg = 0;
bullet[me].onDmg = function (who) { bullet[me].onDmg = function (who) {
if (b.isModDotFlechette) { if (!who.isShielded) {
mobs.statusPoison(who, 0.38, 360) // (2.3) * 2 / 14 ticks (2x damage over 7 seconds) if (b.isModDotFlechette) {
} else { mobs.statusPoison(who, 0.33, 360) // (2.3) * 2 / 14 ticks (2x damage over 7 seconds)
mobs.statusPoison(who, 0.38, 180) // (2.3) / 6 ticks (3 seconds) } else {
mobs.statusPoison(who, 0.33, 180) // (2.3) / 6 ticks (3 seconds)
}
} }
}; };
@@ -2590,7 +2597,7 @@ const b = {
}, },
{ {
name: "spores", //10 name: "spores", //10
description: "fire <strong>sporangiums</strong> that discharge <strong class='color-p' style='letter-spacing: 2px;'>spores</strong><br><strong class='color-p' style='letter-spacing: 2px;'>spores</strong> do <strong class='color-d'>damage</strong> over <strong>3</strong> seconds", description: "fire a <strong>sporangium</strong> that discharges <strong class='color-p' style='letter-spacing: 2px;'>spores</strong>",
ammo: 0, ammo: 0,
ammoPack: (game.difficultyMode > 3) ? 3 : 4, ammoPack: (game.difficultyMode > 3) ? 3 : 4,
have: false, have: false,

View File

@@ -184,6 +184,7 @@ function collisionChecks(event) {
// console.log(obj.dmg / (0.15 * obj.mass * Vector.magnitude(Vector.sub(mob[k].velocity, obj.velocity)))) // console.log(obj.dmg / (0.15 * obj.mass * Vector.magnitude(Vector.sub(mob[k].velocity, obj.velocity))))
if (b.isModCrit && !mob[k].seePlayer.recall && !mob[k].shield) dmg *= 5 if (b.isModCrit && !mob[k].seePlayer.recall && !mob[k].shield) dmg *= 5
mob[k].foundPlayer(); mob[k].foundPlayer();
// console.log(dmg)
mob[k].damage(dmg); mob[k].damage(dmg);
obj.onDmg(mob[k]); //some bullets do actions when they hits things, like despawn obj.onDmg(mob[k]); //some bullets do actions when they hits things, like despawn
game.drawList.push({ //add dmg to draw queue game.drawList.push({ //add dmg to draw queue

View File

@@ -13,14 +13,14 @@ const level = {
levelsCleared: 0, levelsCleared: 0,
start() { start() {
if (level.levelsCleared === 0) { if (level.levelsCleared === 0) {
// level.difficultyIncrease(9) level.difficultyIncrease(9)
// b.giveGuns("fléchettes") b.giveGuns("flak")
// mech.setField("phase decoherence field") // mech.setField("phase decoherence field")
// b.giveMod("irradiated needles"); // b.giveMod("irradiated needles");
// b.giveMod("reflective cavity"); // b.giveMod("reflective cavity");
level.intro(); //starting level // level.intro(); //starting level
// level.testingMap(); level.testingMap();
// level.bosses(); // level.bosses();
// level.satellite(); // level.satellite();
// level.skyscrapers(); // level.skyscrapers();

View File

@@ -49,51 +49,72 @@ const mobs = {
} }
}, },
statusSlow(who, cycles = 60) { statusSlow(who, cycles = 60) {
//remove other "slow" effects on this mob if (!who.shield && !who.isShielded) {
let i = who.status.length //remove other "slow" effects on this mob
while (i--) { let i = who.status.length
if (who.status[i].type === "slow") who.status.splice(i, 1); while (i--) {
if (who.status[i].type === "slow") who.status.splice(i, 1);
}
who.status.push({
effect() {
Matter.Body.setVelocity(who, {
x: 0,
y: 0
});
Matter.Body.setAngularVelocity(who, 0);
ctx.beginPath();
ctx.moveTo(who.vertices[0].x, who.vertices[0].y);
for (let j = 1, len = who.vertices.length; j < len; ++j) {
ctx.lineTo(who.vertices[j].x, who.vertices[j].y);
}
ctx.lineTo(who.vertices[0].x, who.vertices[0].y);
ctx.strokeStyle = "rgba(0,100,255,0.5)";
ctx.lineWidth = 30;
ctx.stroke();
ctx.fillStyle = who.fill
ctx.fill();
},
type: "slow",
endCycle: game.cycle + cycles,
})
} }
who.status.push({
effect() {
Matter.Body.setVelocity(who, {
x: 0,
y: 0
});
Matter.Body.setAngularVelocity(who, 0);
ctx.beginPath();
ctx.moveTo(who.vertices[0].x, who.vertices[0].y);
for (let j = 1, len = who.vertices.length; j < len; ++j) {
ctx.lineTo(who.vertices[j].x, who.vertices[j].y);
}
ctx.lineTo(who.vertices[0].x, who.vertices[0].y);
ctx.strokeStyle = "rgba(0,100,255,0.5)";
ctx.lineWidth = 30;
ctx.stroke();
ctx.fillStyle = who.fill
ctx.fill();
},
type: "slow",
endCycle: game.cycle + cycles,
})
}, },
statusBlind(who, cycles = 60) { statusStun(who, cycles = 60) {
//remove other "stun" effects on this mob if (!who.shield && !who.isShielded) {
let i = who.status.length Matter.Body.setVelocity(who, {
while (i--) { x: 0,
if (who.status[i].type === "blind") who.status.splice(i, 1); y: 0
});
Matter.Body.setAngularVelocity(who, 0);
//remove other "stun" effects on this mob
let i = who.status.length
while (i--) {
if (who.status[i].type === "stun") who.status.splice(i, 1);
}
who.status.push({
effect() {
who.seePlayer.yes = false;
who.seePlayer.position = {
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
ctx.beginPath();
ctx.moveTo(who.vertices[0].x, who.vertices[0].y);
for (let j = 1, len = who.vertices.length; j < len; ++j) {
ctx.lineTo(who.vertices[j].x, who.vertices[j].y);
}
ctx.lineTo(who.vertices[0].x, who.vertices[0].y);
ctx.stroke();
ctx.fillStyle = `rgba(${Math.floor(255*Math.random())},${Math.floor(255*Math.random())},${Math.floor(255*Math.random())},0.5)`
// ctx.fillStyle = `rgba(255,255,255,${Math.random()})`
ctx.fill();
},
type: "stun",
endCycle: game.cycle + cycles,
})
} }
who.status.push({
effect() {
// Matter.Body.setVelocity(who, {
// x: 0,
// y: 0
// });
// Matter.Body.setAngularVelocity(who, 0);
},
type: "blind",
endCycle: game.cycle + cycles,
})
}, },
statusPoison(who, tickDamage, cycles = 180) { statusPoison(who, tickDamage, cycles = 180) {
who.status.push({ who.status.push({

View File

@@ -1613,7 +1613,7 @@ const mech = {
if (inPlayer.length > 0) { if (inPlayer.length > 0) {
for (let i = 0; i < inPlayer.length; i++) { for (let i = 0; i < inPlayer.length; i++) {
if (inPlayer[i].shield) { if (inPlayer[i].shield) {
mech.energy -= 0.01; //shields drain player energy mech.energy -= 0.005; //shields drain player energy
//draw outline of shield //draw outline of shield
ctx.fillStyle = `rgba(0, 204, 255,0.6)` ctx.fillStyle = `rgba(0, 204, 255,0.6)`
ctx.fill() ctx.fill()

View File

@@ -24,8 +24,11 @@ mobs - add in a function to the main loops that does injected code for each mob
stun - combine blind, slow stun - combine blind, slow
with increased gravity effects, but how with increased gravity effects, but how
burn effect doesn't look right, too similar to poison burn effect doesn't look right, too similar to poison
burn status could spread to player
mod - grenade explosions stun enemies mod - grenade explosions stun enemies
mod - vacuum bomb does DoT damage after exploding mod - vacuum bomb does DoT damage after exploding
mod - super balls become fire balls?
mod - laser mod has a chance to set things on fire
settings - auto aim at nearest mob settings - auto aim at nearest mob
settings - custom keys binding settings - custom keys binding