pilot wave field

mod - mass -energy
player dies if health goes to NaN
This commit is contained in:
landgreen
2020-04-12 09:20:15 -07:00
parent c57ae9d7fd
commit 42b1c2e07a
8 changed files with 293 additions and 141 deletions

View File

@@ -78,6 +78,7 @@ const b = {
modWaveHelix: null, modWaveHelix: null,
isModSporeFollow: null, isModSporeFollow: null,
isModNailPoison: null, isModNailPoison: null,
isModEnergyHealth: null,
modOnHealthChange() { //used with acid mod modOnHealthChange() { //used with acid mod
if (b.isModAcidDmg && mech.health > 0.8) { if (b.isModAcidDmg && mech.health > 0.8) {
b.modAcidDmg = 0.5 b.modAcidDmg = 0.5
@@ -557,15 +558,35 @@ const b = {
b.isModEntanglement = false; b.isModEntanglement = false;
} }
}, },
{
name: "mass-energy equivalence",
description: "your <strong class='color-f'>energy</strong> replaces your <strong>health</strong><br>you can't <strong>die</strong> if your <strong class='color-f'>energy</strong> is above <strong>zero</strong>",
maxCount: 1,
count: 0,
allowed() {
return !b.isModPiezo
},
requires: "not piezoelectricity",
effect: () => {
mech.health = 0
b.modOnHealthChange();
mech.displayHealth();
b.isModEnergyHealth = true;
},
remove() {
b.isModEnergyHealth = false;
mech.health = mech.energy;
}
},
{ {
name: "piezoelectricity", name: "piezoelectricity",
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", 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, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
return true return !b.isModEnergyHealth
}, },
requires: "", requires: "not mass-energy equivalence",
effect() { effect() {
b.isModPiezo = true; b.isModPiezo = true;
mech.energy = mech.fieldEnergyMax; mech.energy = mech.fieldEnergyMax;
@@ -678,7 +699,7 @@ const b = {
} }
}, },
{ {
name: "mass-energy equivalence", name: "pair production",
description: "<strong>power ups</strong> overfill your <strong class='color-f'>energy</strong><br>temporarily gain <strong>twice</strong> your maximum", description: "<strong>power ups</strong> overfill your <strong class='color-f'>energy</strong><br>temporarily gain <strong>twice</strong> your maximum",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
@@ -822,7 +843,7 @@ const b = {
}, },
{ {
name: "depleted uranium rounds", name: "depleted uranium rounds",
description: `your <strong>bullets</strong> are <strong>+13%</strong> larger<br>increased mass and physical <strong class='color-d'>damage</strong>`, description: `your <strong>bullets</strong> are <strong>+16%</strong> larger<br>increased mass and physical <strong class='color-d'>damage</strong>`,
count: 0, count: 0,
maxCount: 9, maxCount: 9,
allowed() { allowed() {
@@ -830,7 +851,7 @@ const b = {
}, },
requires: "minigun, shotgun, super balls", requires: "minigun, shotgun, super balls",
effect() { effect() {
b.modBulletSize += 0.13 b.modBulletSize += 0.16
}, },
remove() { remove() {
b.modBulletSize = 1; b.modBulletSize = 1;
@@ -2042,8 +2063,7 @@ const b = {
}, },
onEnd() {}, onEnd() {},
do() { do() {
//find mob targets if (!(game.cycle % this.lookFrequency)) { //find mob targets
if (!(game.cycle % this.lookFrequency)) {
this.closestTarget = null; this.closestTarget = null;
this.lockedOn = null; this.lockedOn = null;
let closeDist = Infinity; let closeDist = Infinity;
@@ -2061,8 +2081,8 @@ const b = {
} }
} }
} }
//accelerate towards mobs
if (this.lockedOn && this.lockedOn.alive) { if (this.lockedOn && this.lockedOn.alive) { //accelerate towards mobs
this.force = Vector.mult(Vector.normalise(Vector.sub(this.lockedOn.position, this.position)), this.mass * this.thrust) this.force = Vector.mult(Vector.normalise(Vector.sub(this.lockedOn.position, this.position)), this.mass * this.thrust)
} else if (b.isModSporeFollow && this.lockedOn !== undefined) { //move towards player } else if (b.isModSporeFollow && this.lockedOn !== undefined) { //move towards player
//checking for undefined means that the spores don't go after the player until it has looked and not found a target //checking for undefined means that the spores don't go after the player until it has looked and not found a target
@@ -2097,7 +2117,7 @@ const b = {
friction: 0, friction: 0,
frictionAir: 0.10, frictionAir: 0.10,
restitution: 0.3, restitution: 0.3,
dmg: 0.2, //damage done in addition to the damage from momentum dmg: 0.18, //damage done in addition to the damage from momentum
lookFrequency: 10 + Math.floor(7 * Math.random()), lookFrequency: 10 + Math.floor(7 * Math.random()),
endCycle: game.cycle + 120 * b.isModBulletsLastLonger, //Math.floor((1200 + 420 * Math.random()) * b.isModBulletsLastLonger), endCycle: game.cycle + 120 * b.isModBulletsLastLonger, //Math.floor((1200 + 420 * Math.random()) * b.isModBulletsLastLonger),
classType: "bullet", classType: "bullet",

View File

@@ -686,31 +686,30 @@ const game = {
} }
}, },
checks() { checks() {
if (mech.pos.y > game.fallHeight) { // if 4000px deep
if (game.difficultyMode > 2) {
mech.death();
} else {
Matter.Body.setVelocity(player, {
x: 0,
y: 0
});
Matter.Body.setPosition(player, {
x: level.enter.x + 50,
y: level.enter.y - 20
});
// Matter.Body.setPosition(player, {
// x: player.position.x,
// y: -7000
// });
// game.noCameraScroll()
mech.energy = 0;
if (game.difficultyMode === 2) mech.damage(0.3);
if (game.difficultyMode === 1) mech.damage(0.1);
}
}
if (!(mech.cycle % 60)) { //once a second if (!(mech.cycle % 60)) { //once a second
if (mech.pos.y > game.fallHeight) { // if 4000px deep
if (game.difficultyMode > 2) {
mech.death();
} else {
Matter.Body.setVelocity(player, {
x: 0,
y: 0
});
Matter.Body.setPosition(player, {
x: level.enter.x + 50,
y: level.enter.y - 20
});
// Matter.Body.setPosition(player, {
// x: player.position.x,
// y: -7000
// });
// game.noCameraScroll()
if (game.difficultyMode === 2) mech.damage(0.3);
if (game.difficultyMode === 1) mech.damage(0.1);
mech.energy = 0;
}
}
if (b.isModEnergyDamage) { if (b.isModEnergyDamage) {
document.getElementById("mod-capacitor").innerHTML = `(+${(mech.energy/0.05).toFixed(0)}%)` document.getElementById("mod-capacitor").innerHTML = `(+${(mech.energy/0.05).toFixed(0)}%)`

View File

@@ -458,6 +458,35 @@ document.body.addEventListener("mousedown", (e) => {
} }
}); });
document.body.addEventListener("mouseenter", (e) => { //prevents mouse getting stuck when leaving the window
// console.log(e)
if (e.which === 1) {
game.mouseDown = true;
} else {
game.mouseDown = false;
}
if (e.which === 3) {
game.mouseDownRight = true;
} else {
game.mouseDownRight = false;
}
});
document.body.addEventListener("mouseleave", (e) => { //prevents mouse getting stuck when leaving the window
// console.log(e)
if (e.which === 1) {
game.mouseDown = true;
} else {
game.mouseDown = false;
}
if (e.which === 3) {
game.mouseDownRight = true;
} else {
game.mouseDownRight = false;
}
});
//keyboard input //keyboard input
const keys = []; const keys = [];
document.body.addEventListener("keydown", (e) => { document.body.addEventListener("keydown", (e) => {
@@ -537,14 +566,14 @@ function cycle() {
} }
game.loop(); game.loop();
if (isNaN(mech.health)) { // if (isNaN(mech.health) || isNaN(mech.energy)) {
console.log(`mech.health = ${mech.health}`) // console.log(`mech.health = ${mech.health}`)
game.paused = true; // game.paused = true;
game.replaceTextLog = true; // game.replaceTextLog = true;
build.pauseGrid() // build.pauseGrid()
document.body.style.cursor = "auto"; // document.body.style.cursor = "auto";
alert("health is NaN, please report this bug to the discord \n https://discordapp.com/invite/2eC9pgJ") // alert("health is NaN, please report this bug to the discord \n https://discordapp.com/invite/2eC9pgJ")
} // }
// for (let i = 0, len = loop.length; i < len; i++) { // for (let i = 0, len = loop.length; i < len; i++) {
// loop[i]() // loop[i]()
// } // }

View File

@@ -16,10 +16,9 @@ const level = {
if (level.levelsCleared === 0) { //this code only runs on the first level if (level.levelsCleared === 0) { //this code only runs on the first level
// level.difficultyIncrease(9) // level.difficultyIncrease(9)
// b.giveGuns("vacuum bomb") // b.giveGuns("vacuum bomb")
// mech.setField("pilot wave") mech.setField("pilot wave")
// mech.energy = 0.1; // b.giveMod("energy");
// b.giveMod("negative feedback"); // b.giveMod("Born rule");
// b.giveMod("photovoltaics");
level.intro(); //starting level level.intro(); //starting level
// level.testing(); // level.testing();

View File

@@ -494,10 +494,12 @@ const mech = {
} }
}, },
addHealth(heal) { addHealth(heal) {
mech.health += heal * game.healScale; if (!b.isModEnergyHealth) {
if (mech.health > mech.maxHealth) mech.health = mech.maxHealth; mech.health += heal * game.healScale;
b.modOnHealthChange(); if (mech.health > mech.maxHealth) mech.health = mech.maxHealth;
mech.displayHealth(); b.modOnHealthChange();
mech.displayHealth();
}
}, },
defaultFPSCycle: 0, //tracks when to return to normal fps defaultFPSCycle: 0, //tracks when to return to normal fps
collisionImmuneCycle: 0, //used in engine collisionImmuneCycle: 0, //used in engine
@@ -522,41 +524,73 @@ const mech = {
} }
dmg *= mech.fieldDamageResistance dmg *= mech.fieldDamageResistance
if (!b.modEnergyRegen) dmg *= 0.5 //0.22 + 0.78 * mech.energy //77% damage reduction at zero energy if (b.modEnergyRegen === 0) dmg *= 0.5 //0.22 + 0.78 * mech.energy //77% damage reduction at zero energy
if (b.isModEntanglement && b.inventory[0] === b.activeGun) { if (b.isModEntanglement && b.inventory[0] === b.activeGun) {
for (let i = 0, len = b.inventory.length; i < len; i++) { for (let i = 0, len = b.inventory.length; i < len; i++) {
dmg *= 0.84 // 1 - 0.16 dmg *= 0.84 // 1 - 0.16
} }
} }
if (b.isModEnergyHealth) {
mech.energy -= dmg;
if (mech.energy < 0 || isNaN(mech.energy)) {
if (b.isModDeathAvoid && !b.isModDeathAvoidOnCD) { //&& Math.random() < 0.5
b.isModDeathAvoidOnCD = true;
mech.energy += dmg //undo the damage
if (mech.energy < 0.05) mech.energy = 0.05
mech.collisionImmuneCycle = mech.cycle + 30 //disable this.collisionImmuneCycle bonus seconds
mech.health -= dmg; game.wipe = function () { //set wipe to have trails
if (mech.health < 0) { ctx.fillStyle = "rgba(255,255,255,0.02)";
if (b.isModDeathAvoid && !b.isModDeathAvoidOnCD) { //&& Math.random() < 0.5 ctx.fillRect(0, 0, canvas.width, canvas.height);
b.isModDeathAvoidOnCD = true;
mech.health += dmg //undo the damage
if (mech.health < 0.05) mech.health = 0.05
mech.collisionImmuneCycle = mech.cycle + 30 //disable this.collisionImmuneCycle bonus seconds
game.wipe = function () { //set wipe to have trails
ctx.fillStyle = "rgba(255,255,255,0.02)";
ctx.fillRect(0, 0, canvas.width, canvas.height);
}
setTimeout(function () {
game.wipe = function () { //set wipe to normal
ctx.clearRect(0, 0, canvas.width, canvas.height);
} }
// game.replaceTextLog = true; setTimeout(function () {
// game.makeTextLog("death avoided", 360); game.wipe = function () { //set wipe to normal
b.isModDeathAvoidOnCD = false; ctx.clearRect(0, 0, canvas.width, canvas.height);
}, 3000); }
// game.replaceTextLog = true;
// game.makeTextLog("death avoided", 360);
b.isModDeathAvoidOnCD = false;
}, 3000);
return; return;
} else { } else {
mech.health = 0; mech.health = 0;
mech.death(); mech.energy = 0;
return; mech.death();
return;
}
}
} else {
mech.health -= dmg;
if (mech.health < 0 || isNaN(mech.health)) {
if (b.isModDeathAvoid && !b.isModDeathAvoidOnCD) { //&& Math.random() < 0.5
b.isModDeathAvoidOnCD = true;
mech.health += dmg //undo the damage
if (mech.health < 0.05) mech.health = 0.05
mech.collisionImmuneCycle = mech.cycle + 30 //disable this.collisionImmuneCycle bonus seconds
game.wipe = function () { //set wipe to have trails
ctx.fillStyle = "rgba(255,255,255,0.02)";
ctx.fillRect(0, 0, canvas.width, canvas.height);
}
setTimeout(function () {
game.wipe = function () { //set wipe to normal
ctx.clearRect(0, 0, canvas.width, canvas.height);
}
// game.replaceTextLog = true;
// game.makeTextLog("death avoided", 360);
b.isModDeathAvoidOnCD = false;
}, 3000);
return;
} else {
mech.health = 0;
mech.death();
return;
}
} }
} }
b.modOnHealthChange(); b.modOnHealthChange();
mech.displayHealth(); mech.displayHealth();
document.getElementById("dmg").style.transition = "opacity 0s"; document.getElementById("dmg").style.transition = "opacity 0s";
@@ -1891,63 +1925,130 @@ const mech = {
} }
} }
}, },
// { {
// name: "pilot wave", name: "pilot wave",
// description: "push stuff", description: "use <strong class='color-f'>energy</strong> to push <strong>blocks</strong> with your mouse<br>energy <strong>drain</strong> is lower in your <strong>line of sight</strong>",
// isEasyToAim: false, isEasyToAim: false,
// effect: () => { effect: () => {
// game.replaceTextLog = true; //allow text over write game.replaceTextLog = true; //allow text over write
// mech.lastMouseInGame = { mech.fieldPhase = 0;
// x: game.mouseInGame.x, mech.fieldPosition = {
// y: game.mouseInGame.y x: game.mouseInGame.x,
// } y: game.mouseInGame.y
// mech.drop(); }
// mech.fieldPhase = 0; mech.lastFieldPosition = {
// mech.hold = function () { x: game.mouseInGame.x,
// if ((keys[32] || game.mouseDownRight && mech.fieldCDcycle < mech.cycle)) { //not hold but field button is pressed y: game.mouseInGame.y
// mech.grabPowerUp(); }
// //disable if player is inside field mech.fieldOn = false;
mech.fieldRadius = 0;
mech.drop();
mech.hold = function () {
if ((keys[32] || game.mouseDownRight && mech.fieldCDcycle < mech.cycle)) { //not hold but field button is pressed
// const radius = 100
// if (mech.energy > 0.05) {
// // && Vector.magnitude(Vector.sub(game.mouseInGame, player.position)) > radius * 1.5
// //find mouse velocity
// const diff = Vector.sub(game.mouseInGame, mech.lastMouseInGame)
// const velocity = Vector.mult(Vector.normalise(diff), Math.min(Vector.magnitude(diff), 60)) //limit velocity
// //find nearby blocks
// for (let i = 0, len = body.length; i < len; ++i) {
// if (Vector.magnitude(Vector.sub(body[i].position, game.mouseInGame)) < radius) {
// // Matter.Query.collides(body, bodies) // if (Matter.Query.ray(map, game.mouseInGame, player.position).length === 0){
// Matter.Body.setVelocity(body[i], velocity); //give block mouse velocity
// body[i].force.y -= body[i].mass * game.g; //antigravity // } else {
// //maybe give blocks some weak attraction to mouse // mech.fieldOn = false;
// } // }
// }
// ctx.beginPath(); if (!mech.fieldOn) {
// const rotate = mech.cycle * 0.008; mech.fieldOn = true;
// mech.fieldPhase += 0.2 // - 0.5 * Math.sqrt(Math.min(mech.energy, 1)); mech.fieldPosition = { //smooth the mouse position
// const off1 = 1 + 0.06 * Math.sin(mech.fieldPhase); x: game.mouseInGame.x,
// const off2 = 1 - 0.06 * Math.sin(mech.fieldPhase); y: game.mouseInGame.y
// ctx.beginPath(); }
// ctx.ellipse(game.mouseInGame.x, game.mouseInGame.y, radius * off1, radius * off2, rotate, 0, 2 * Math.PI); mech.lastFieldPosition = { //used to find velocity of field changes
// // ctx.arc(game.mouseInGame.x, game.mouseInGame.y, this.fieldRange, 0, 2 * Math.PI); x: mech.fieldPosition.x,
// ctx.fillStyle = "#eef"; y: mech.fieldPosition.y
// ctx.globalCompositeOperation = "difference"; }
// ctx.fill(); } else {
// ctx.strokeStyle = "#000"; mech.lastFieldPosition = { //used to find velocity of field changes
// ctx.lineWidth = 1; x: mech.fieldPosition.x,
// ctx.stroke(); y: mech.fieldPosition.y
// ctx.globalCompositeOperation = "source-over"; }
// } const smooth = 0.97
// } mech.fieldPosition = { //smooth the mouse position
// mech.lastMouseInGame = { //constantly log last mouse position so you can calc mouse velocity x: mech.fieldPosition.x * smooth + game.mouseInGame.x * (1 - smooth),
// x: game.mouseInGame.x, y: mech.fieldPosition.y * smooth + game.mouseInGame.y * (1 - smooth),
// y: game.mouseInGame.y }
// } }
// mech.drawFieldMeter() // Matter.Query.ray(map, game.mouseInGame, player.position).length === 0
// } //make it so the field only works in line of sight
// } // make the field not get stuck on map when there in no line of site
// }, // maybe track the last mouse position, and revert to smooting towards it when mouse leaves line of site
// if (Matter.Query.ray(map, mech.fieldPosition, player.position).length === 0)
mech.grabPowerUp();
//disable if player is inside field
if (mech.energy > 0.01) {
// && Vector.magnitude(Vector.sub(game.mouseInGame, player.position)) > radius * 1.5 //disable effect when near player
//find mouse velocity
const diff = Vector.sub(mech.fieldPosition, mech.lastFieldPosition)
const speed = Vector.magnitude(diff)
const velocity = Vector.mult(Vector.normalise(diff), Math.min(speed, 60)) //limit velocity
let radius = Math.max(50, 250 - 1.5 * speed) //change radius proportional to mouse speed //run a smoothing function?
let isVisible = true
if (Matter.Query.ray(map, mech.fieldPosition, player.position).length !== 0) {
isVisible = false
radius *= 0.2
}
smooth = 0.9
mech.fieldRadius = mech.fieldRadius * smooth + radius * (1 - smooth)
//find nearby blocks
for (let i = 0, len = body.length; i < len; ++i) {
if (Vector.magnitude(Vector.sub(body[i].position, mech.fieldPosition)) < mech.fieldRadius) {
// Matter.Query.collides(player, [body[i]]).length === 0) { //block is not touching player, for no flying
// (Matter.Query.ray(map, game.mouseInGame, player.position).length === 0 ? 1 : 4)
const DRAIN = speed * body[i].mass * 0.00002 * (isVisible ? 1 : 4)
if (mech.energy > DRAIN) {
mech.energy -= DRAIN;
Matter.Body.setVelocity(body[i], velocity); //give block mouse velocity
body[i].force.y -= body[i].mass * game.g; //remove gravity effects
} else {
mech.fieldOn = false
mech.fieldCDcycle = mech.cycle + 120;
mech.fieldRadius = 0
break
}
}
}
ctx.beginPath();
const rotate = mech.cycle * 0.008;
mech.fieldPhase += 0.2 // - 0.5 * Math.sqrt(Math.min(mech.energy, 1));
const off1 = 1 + 0.06 * Math.sin(mech.fieldPhase);
const off2 = 1 - 0.06 * Math.sin(mech.fieldPhase);
ctx.beginPath();
ctx.ellipse(mech.fieldPosition.x, mech.fieldPosition.y, 1.2 * mech.fieldRadius * off1, 1.2 * mech.fieldRadius * off2, rotate, 0, 2 * Math.PI);
// ctx.ellipse(game.mouseInGame.x, game.mouseInGame.y, radius * off1, radius * off2, -rotate, 0, 2 * Math.PI);
// ctx.arc(game.mouseInGame.x, game.mouseInGame.y, this.fieldRange, 0, 2 * Math.PI);
ctx.fillStyle = "#fff"; //"#eef";
ctx.globalCompositeOperation = "exclusion"; //"exclusion" "difference";
ctx.fill();
ctx.globalCompositeOperation = "source-over";
ctx.beginPath();
ctx.ellipse(mech.fieldPosition.x, mech.fieldPosition.y, 1.2 * mech.fieldRadius * off1, 1.2 * mech.fieldRadius * off2, rotate, 0, mech.energy * 2 * Math.PI);
ctx.strokeStyle = "#000";
ctx.lineWidth = 4;
ctx.stroke();
} else {
mech.fieldOn = false
mech.fieldCDcycle = mech.cycle + 120;
mech.fieldRadius = 0
}
} else {
mech.fieldOn = false
mech.fieldRadius = 0
}
mech.drawFieldMeter()
}
}
},
], ],
}; };

View File

@@ -47,10 +47,14 @@ const powerUps = {
return 40 * Math.sqrt(0.1 + Math.random() * 0.5); return 40 * Math.sqrt(0.1 + Math.random() * 0.5);
}, },
effect() { effect() {
let heal = 0 if (!b.isModEnergyHealth) {
for (let i = 0; i < b.modRecursiveHealing; i++) heal += ((this.size / 40) ** 2) let heal = 0
if (heal > 0) game.makeTextLog("<div class='circle heal'></div> &nbsp; <span style='font-size:115%;'> <strong style = 'letter-spacing: 2px;'>heal</strong> " + (Math.min(mech.maxHealth - mech.health, heal) * game.healScale * 100).toFixed(0) + "%</span>", 300) for (let i = 0; i < b.modRecursiveHealing; i++) heal += ((this.size / 40) ** 2)
mech.addHealth(heal); if (heal > 0) {
game.makeTextLog("<div class='circle heal'></div> &nbsp; <span style='font-size:115%;'> <strong style = 'letter-spacing: 2px;'>heal</strong> " + (Math.min(mech.maxHealth - mech.health, heal) * game.healScale * 100).toFixed(0) + "%</span>", 300)
mech.addHealth(heal);
}
}
} }
}, },
ammo: { ammo: {

View File

@@ -566,7 +566,7 @@ const spawn = {
} }
toMe(body, this.position, this.eventHorizon) toMe(body, this.position, this.eventHorizon)
toMe(mob, this.position, this.eventHorizon) toMe(mob, this.position, this.eventHorizon)
toMe(bullet, this.position, this.eventHorizon) // toMe(bullet, this.position, this.eventHorizon)
} }
}; };
me.do = function () { me.do = function () {
@@ -826,7 +826,6 @@ const spawn = {
x: x, x: x,
y: y y: y
} }
me.dmg = 0.14 * game.dmgScale;
me.frictionAir = 0.03; me.frictionAir = 0.03;
// me.torque -= me.inertia * 0.002 // me.torque -= me.inertia * 0.002
Matter.Body.setDensity(me, 0.03); //extra dense //normal is 0.001 //makes effective life much larger Matter.Body.setDensity(me, 0.03); //extra dense //normal is 0.001 //makes effective life much larger
@@ -920,11 +919,12 @@ const spawn = {
if (!mech.isStealth) vertexCollision(where, look, [player]); if (!mech.isStealth) vertexCollision(where, look, [player]);
if (best.who && best.who === player && mech.collisionImmuneCycle < mech.cycle) { if (best.who && best.who === player && mech.collisionImmuneCycle < mech.cycle) {
mech.collisionImmuneCycle = mech.cycle + b.modCollisionImmuneCycles; //player is immune to collision damage for 30 cycles mech.collisionImmuneCycle = mech.cycle + b.modCollisionImmuneCycles; //player is immune to collision damage for 30 cycles
mech.damage(this.dmg); const dmg = 0.14 * game.dmgScale;
mech.damage(dmg);
game.drawList.push({ //add dmg to draw queue game.drawList.push({ //add dmg to draw queue
x: best.x, x: best.x,
y: best.y, y: best.y,
radius: this.dmg * 1500, radius: dmg * 1500,
color: "rgba(80,0,255,0.5)", color: "rgba(80,0,255,0.5)",
time: 20 time: 20
}); });

View File

@@ -1,10 +1,10 @@
mod - spores follow player
mod - nails do 66% extra damage over 6 seconds
************** TODO - n-gon ************** ************** TODO - n-gon **************
mod - energy replaces your health,
field - pilot wave field - pilot wave
while mouse is down blocks (and mobs?) are move with the mouse while mouse is down blocks (and mobs?) are move with the mouse
players can do serious damage by flicking the mouse and firing blocks players can do serious damage by flicking the mouse and firing blocks