negative mass field
plasma field does 20% more damage, but can no longer block bremsstrahlung radiation only apply to the harmonic field, and does a bit less damage negative mass field moves faster horizontally can't block can hold mroe massive blocks, but can't throw them fast takes 0.5 dmg while active
This commit is contained in:
@@ -524,22 +524,6 @@ const b = {
|
|||||||
b.isModPiezo = false;
|
b.isModPiezo = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "bremsstrahlung radiation",
|
|
||||||
description: "when your <strong>field blocks</strong> it also does <strong class='color-d'>damage</strong>",
|
|
||||||
maxCount: 9,
|
|
||||||
count: 0,
|
|
||||||
allowed() {
|
|
||||||
return mech.fieldUpgrades[mech.fieldMode].name !== "time dilation field" && mech.fieldUpgrades[mech.fieldMode].name !== "phase decoherence field" && !(b.isModHawking && mech.fieldUpgrades[mech.fieldMode].name === "negative mass field")
|
|
||||||
},
|
|
||||||
requires: "not time dilation field<br><strong>requires</strong> not phase decoherence field",
|
|
||||||
effect() {
|
|
||||||
b.modBlockDmg += 0.7 //if you change this value also update the for loop in the electricity graphics in mech.pushMass
|
|
||||||
},
|
|
||||||
remove() {
|
|
||||||
b.modBlockDmg = 0;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: "energy conservation",
|
name: "energy conservation",
|
||||||
description: "gain <strong class='color-f'>energy</strong> proportional to <strong class='color-d'>damage</strong> done",
|
description: "gain <strong class='color-f'>energy</strong> proportional to <strong class='color-d'>damage</strong> done",
|
||||||
@@ -1095,6 +1079,22 @@ const b = {
|
|||||||
b.isModHawking = 0;
|
b.isModHawking = 0;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "bremsstrahlung radiation",
|
||||||
|
description: "<strong>blocking</strong> with <strong>standing wave harmonics</strong><br><strong class='color-d'>damages</strong> the blocked mob ",
|
||||||
|
maxCount: 9,
|
||||||
|
count: 0,
|
||||||
|
allowed() {
|
||||||
|
return mech.fieldUpgrades[mech.fieldMode].name === "standing wave harmonics"
|
||||||
|
},
|
||||||
|
requires: "standing wave harmonics",
|
||||||
|
effect() {
|
||||||
|
b.modBlockDmg += 0.6 //if you change this value also update the for loop in the electricity graphics in mech.pushMass
|
||||||
|
},
|
||||||
|
remove() {
|
||||||
|
b.modBlockDmg = 0;
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "frequency resonance",
|
name: "frequency resonance",
|
||||||
description: "<strong>standing wave harmonics</strong> shield is retuned<br>increase <strong>size</strong> and <strong>blocking</strong> efficiency by <strong>30%</strong>",
|
description: "<strong>standing wave harmonics</strong> shield is retuned<br>increase <strong>size</strong> and <strong>blocking</strong> efficiency by <strong>30%</strong>",
|
||||||
|
|||||||
@@ -205,6 +205,8 @@ function collisionChecks(event) {
|
|||||||
if (mob[k].isShielded) dmg *= 0.5
|
if (mob[k].isShielded) dmg *= 0.5
|
||||||
mob[k].damage(dmg, true);
|
mob[k].damage(dmg, true);
|
||||||
if (mob[k].distanceToPlayer2() < 1000000) mob[k].foundPlayer();
|
if (mob[k].distanceToPlayer2() < 1000000) mob[k].foundPlayer();
|
||||||
|
// mobs.statusStun(mob[k], 120)
|
||||||
|
|
||||||
game.drawList.push({
|
game.drawList.push({
|
||||||
//add dmg to draw queue
|
//add dmg to draw queue
|
||||||
x: pairs[i].activeContacts[0].vertex.x,
|
x: pairs[i].activeContacts[0].vertex.x,
|
||||||
|
|||||||
11
js/mobs.js
11
js/mobs.js
@@ -79,13 +79,13 @@ const mobs = {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
statusStun(who, cycles = 120) {
|
statusStun(who, cycles = 180) {
|
||||||
if (!who.shield && !who.isShielded) {
|
if (!who.shield && !who.isShielded) {
|
||||||
Matter.Body.setVelocity(who, {
|
Matter.Body.setVelocity(who, {
|
||||||
x: who.velocity.x * 0.8,
|
x: who.velocity.x * 0.5,
|
||||||
y: who.velocity.y * 0.8
|
y: who.velocity.y * 0.5
|
||||||
});
|
});
|
||||||
Matter.Body.setAngularVelocity(who, who.angularVelocity * 0.8);
|
Matter.Body.setAngularVelocity(who, who.angularVelocity * 0.5);
|
||||||
//remove other "stun" effects on this mob
|
//remove other "stun" effects on this mob
|
||||||
let i = who.status.length
|
let i = who.status.length
|
||||||
while (i--) {
|
while (i--) {
|
||||||
@@ -98,8 +98,7 @@ const mobs = {
|
|||||||
x: who.position.x + 100 * (Math.random() - 0.5),
|
x: who.position.x + 100 * (Math.random() - 0.5),
|
||||||
y: who.position.y + 100 * (Math.random() - 0.5)
|
y: who.position.y + 100 * (Math.random() - 0.5)
|
||||||
}
|
}
|
||||||
who.force.y += who.mass * 0.001 //extra gravity
|
if (who.velocity.y < 2) who.force.y += who.mass * 0.0005 //extra gravity
|
||||||
|
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
ctx.moveTo(who.vertices[0].x, who.vertices[0].y);
|
ctx.moveTo(who.vertices[0].x, who.vertices[0].y);
|
||||||
for (let j = 1, len = who.vertices.length; j < len; ++j) {
|
for (let j = 1, len = who.vertices.length; j < len; ++j) {
|
||||||
|
|||||||
43
js/player.js
43
js/player.js
@@ -458,6 +458,7 @@ const mech = {
|
|||||||
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
|
||||||
damage(dmg) {
|
damage(dmg) {
|
||||||
|
dmg *= mech.fieldDamageResistance
|
||||||
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.9
|
dmg *= 0.9
|
||||||
@@ -670,6 +671,7 @@ const mech = {
|
|||||||
fieldRegen: 0,
|
fieldRegen: 0,
|
||||||
fieldMode: 0,
|
fieldMode: 0,
|
||||||
fieldFire: false,
|
fieldFire: false,
|
||||||
|
fieldDamageResistance: 1,
|
||||||
holdingMassScale: 0,
|
holdingMassScale: 0,
|
||||||
throwChargeRate: 0,
|
throwChargeRate: 0,
|
||||||
throwChargeMax: 0,
|
throwChargeMax: 0,
|
||||||
@@ -682,6 +684,7 @@ const mech = {
|
|||||||
if (mech.energy < mech.fieldEnergyMax) mech.energy = mech.fieldEnergyMax;
|
if (mech.energy < mech.fieldEnergyMax) mech.energy = mech.fieldEnergyMax;
|
||||||
mech.fieldRegen = 0.001;
|
mech.fieldRegen = 0.001;
|
||||||
mech.fieldShieldingScale = 1;
|
mech.fieldShieldingScale = 1;
|
||||||
|
mech.fieldDamageResistance = 1;
|
||||||
mech.fieldFire = false;
|
mech.fieldFire = false;
|
||||||
mech.fieldCDcycle = 0;
|
mech.fieldCDcycle = 0;
|
||||||
mech.isStealth = false;
|
mech.isStealth = false;
|
||||||
@@ -1223,7 +1226,8 @@ const mech = {
|
|||||||
mech.energy -= DRAIN;
|
mech.energy -= DRAIN;
|
||||||
mech.grabPowerUp();
|
mech.grabPowerUp();
|
||||||
mech.lookForPickUp();
|
mech.lookForPickUp();
|
||||||
mech.pushMobs360();
|
// mech.pushMobs360();
|
||||||
|
// mech.pushMobsFacing();
|
||||||
|
|
||||||
//calculate laser collision
|
//calculate laser collision
|
||||||
let best;
|
let best;
|
||||||
@@ -1297,7 +1301,7 @@ const mech = {
|
|||||||
y: best.y
|
y: best.y
|
||||||
};
|
};
|
||||||
if (best.who.alive) {
|
if (best.who.alive) {
|
||||||
const dmg = 0.4 * b.dmgScale; //********** SCALE DAMAGE HERE *********************
|
const dmg = 0.5 * b.dmgScale; //********** SCALE DAMAGE HERE *********************
|
||||||
best.who.damage(dmg);
|
best.who.damage(dmg);
|
||||||
best.who.locatePlayer();
|
best.who.locatePlayer();
|
||||||
|
|
||||||
@@ -1354,10 +1358,10 @@ const mech = {
|
|||||||
ctx.lineWidth = 2 * Math.random();
|
ctx.lineWidth = 2 * Math.random();
|
||||||
ctx.stroke();
|
ctx.stroke();
|
||||||
//draw shield around player
|
//draw shield around player
|
||||||
ctx.beginPath();
|
// ctx.beginPath();
|
||||||
ctx.arc(mech.pos.x, mech.pos.y, mech.fieldRange * 0.75, 0, 2 * Math.PI);
|
// ctx.arc(mech.pos.x, mech.pos.y, mech.fieldRange * 0.75, 0, 2 * Math.PI);
|
||||||
ctx.fillStyle = "rgba(255,0,255,0.05)"
|
// ctx.fillStyle = "rgba(255,0,255,0.05)"
|
||||||
ctx.fill();
|
// ctx.fill();
|
||||||
// mech.pushBody360(100); //disabled because doesn't work at short range
|
// mech.pushBody360(100); //disabled because doesn't work at short range
|
||||||
} else {
|
} else {
|
||||||
mech.fieldCDcycle = mech.cycle + 120; //if out of energy
|
mech.fieldCDcycle = mech.cycle + 120; //if out of energy
|
||||||
@@ -1373,16 +1377,17 @@ const mech = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "negative mass field",
|
name: "negative mass field",
|
||||||
description: "use <strong class='color-f'>energy</strong> to nullify <strong style='letter-spacing: 12px;'>gravity</strong><br><strong>launch</strong> larger blocks at much higher speeds",
|
description: "use <strong class='color-f'>energy</strong> to nullify <strong style='letter-spacing: 12px;'>gravity</strong><br>and reduce <strong>harm</strong> by <strong>50%</strong>", //<br><strong>launch</strong> larger blocks at much higher speeds
|
||||||
fieldDrawRadius: 0,
|
fieldDrawRadius: 0,
|
||||||
isEasyToAim: true,
|
isEasyToAim: true,
|
||||||
effect: () => {
|
effect: () => {
|
||||||
mech.fieldFire = true;
|
mech.fieldFire = true;
|
||||||
mech.throwChargeRate = 3;
|
// mech.throwChargeRate = 3;
|
||||||
mech.throwChargeMax = 110;
|
// mech.throwChargeMax = 110;
|
||||||
mech.holdingMassScale = 0.03; //can hold heavier blocks with lower cost to jumping
|
mech.holdingMassScale = 0.03; //can hold heavier blocks with lower cost to jumping
|
||||||
|
|
||||||
mech.hold = function () {
|
mech.hold = function () {
|
||||||
|
mech.fieldDamageResistance = 1;
|
||||||
if (mech.isHolding) {
|
if (mech.isHolding) {
|
||||||
mech.drawHold(mech.holdingTarget);
|
mech.drawHold(mech.holdingTarget);
|
||||||
mech.holding();
|
mech.holding();
|
||||||
@@ -1390,9 +1395,23 @@ const mech = {
|
|||||||
} else if ((keys[32] || game.mouseDownRight) && mech.fieldCDcycle < mech.cycle) { //push away
|
} else if ((keys[32] || game.mouseDownRight) && mech.fieldCDcycle < mech.cycle) { //push away
|
||||||
const DRAIN = 0.00035
|
const DRAIN = 0.00035
|
||||||
if (mech.energy > DRAIN) {
|
if (mech.energy > DRAIN) {
|
||||||
|
mech.fieldDamageResistance = 0.5;
|
||||||
mech.grabPowerUp();
|
mech.grabPowerUp();
|
||||||
mech.lookForPickUp();
|
mech.lookForPickUp();
|
||||||
mech.pushMobs360();
|
// mech.pushMobs360();
|
||||||
|
|
||||||
|
//repulse mobs
|
||||||
|
// for (let i = 0, len = mob.length; i < len; ++i) {
|
||||||
|
// sub = Vector.sub(mob[i].position, mech.pos);
|
||||||
|
// dist2 = Vector.magnitudeSquared(sub);
|
||||||
|
// if (dist2 < this.fieldDrawRadius * this.fieldDrawRadius) {
|
||||||
|
// const force = Vector.mult(Vector.perp(Vector.normalise(sub)), 0.002)
|
||||||
|
// mob[i].force.x = force.x
|
||||||
|
// mob[i].force.y = force.y
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
//look for nearby objects to make zero-g
|
//look for nearby objects to make zero-g
|
||||||
function zeroG(who, range, mag = 1.06) {
|
function zeroG(who, range, mag = 1.06) {
|
||||||
for (let i = 0, len = who.length; i < len; ++i) {
|
for (let i = 0, len = who.length; i < len; ++i) {
|
||||||
@@ -1428,7 +1447,7 @@ const mech = {
|
|||||||
//add extra friction for horizontal motion
|
//add extra friction for horizontal motion
|
||||||
if (keys[65] || keys[68] || keys[37] || keys[39]) {
|
if (keys[65] || keys[68] || keys[37] || keys[39]) {
|
||||||
Matter.Body.setVelocity(player, {
|
Matter.Body.setVelocity(player, {
|
||||||
x: player.velocity.x * 0.95,
|
x: player.velocity.x * 0.99,
|
||||||
y: player.velocity.y * 0.97
|
y: player.velocity.y * 0.97
|
||||||
});
|
});
|
||||||
} else { //slow rise and fall
|
} else { //slow rise and fall
|
||||||
@@ -1447,7 +1466,7 @@ const mech = {
|
|||||||
if (b.isModHawking) {
|
if (b.isModHawking) {
|
||||||
for (let i = 0, len = mob.length; i < len; i++) {
|
for (let i = 0, len = mob.length; i < len; i++) {
|
||||||
if (mob[i].distanceToPlayer2() < this.fieldDrawRadius * this.fieldDrawRadius && Matter.Query.ray(map, mech.pos, mob[i].position).length === 0 && Matter.Query.ray(body, mech.pos, mob[i].position).length === 0) {
|
if (mob[i].distanceToPlayer2() < this.fieldDrawRadius * this.fieldDrawRadius && Matter.Query.ray(map, mech.pos, mob[i].position).length === 0 && Matter.Query.ray(body, mech.pos, mob[i].position).length === 0) {
|
||||||
mob[i].damage(b.dmgScale * 0.08);
|
mob[i].damage(b.dmgScale * 0.085);
|
||||||
mob[i].locatePlayer();
|
mob[i].locatePlayer();
|
||||||
|
|
||||||
//draw electricity
|
//draw electricity
|
||||||
|
|||||||
@@ -236,12 +236,12 @@ const powerUps = {
|
|||||||
if (Math.random() < b.isModBayesian) powerUps.spawn(x, y, "gun");
|
if (Math.random() < b.isModBayesian) powerUps.spawn(x, y, "gun");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (Math.random() < 0.0027 * (14 - b.modCount)) { //a new mod has a low chance for each not acquired mod up to 15
|
if (Math.random() < 0.0027 * (15 - b.modCount)) { //a new mod has a low chance for each not acquired mod up to 15
|
||||||
powerUps.spawn(x, y, "mod");
|
powerUps.spawn(x, y, "mod");
|
||||||
if (Math.random() < b.isModBayesian) powerUps.spawn(x, y, "mod");
|
if (Math.random() < b.isModBayesian) powerUps.spawn(x, y, "mod");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (Math.random() < 0.003) {
|
if (Math.random() < 0.002) {
|
||||||
powerUps.spawn(x, y, "field");
|
powerUps.spawn(x, y, "field");
|
||||||
if (Math.random() < b.isModBayesian) powerUps.spawn(x, y, "field");
|
if (Math.random() < b.isModBayesian) powerUps.spawn(x, y, "field");
|
||||||
return;
|
return;
|
||||||
@@ -251,13 +251,13 @@ const powerUps = {
|
|||||||
if (mech.fieldMode === 0) {
|
if (mech.fieldMode === 0) {
|
||||||
powerUps.spawn(x, y, "field")
|
powerUps.spawn(x, y, "field")
|
||||||
if (Math.random() < b.isModBayesian) powerUps.spawn(x, y, "field")
|
if (Math.random() < b.isModBayesian) powerUps.spawn(x, y, "field")
|
||||||
} else if (Math.random() < 0.80) {
|
} else if (Math.random() < 0.85) {
|
||||||
powerUps.spawn(x, y, "mod")
|
powerUps.spawn(x, y, "mod")
|
||||||
if (Math.random() < b.isModBayesian) powerUps.spawn(x, y, "mod")
|
if (Math.random() < b.isModBayesian) powerUps.spawn(x, y, "mod")
|
||||||
} else if (Math.random() < 0.35) {
|
} else if (Math.random() < 0.35) {
|
||||||
powerUps.spawn(x, y, "gun")
|
powerUps.spawn(x, y, "gun")
|
||||||
if (Math.random() < b.isModBayesian) powerUps.spawn(x, y, "gun")
|
if (Math.random() < b.isModBayesian) powerUps.spawn(x, y, "gun")
|
||||||
} else if (Math.random() < 0.65) {
|
} else if (Math.random() < 0.5) {
|
||||||
powerUps.spawn(x, y, "field");
|
powerUps.spawn(x, y, "field");
|
||||||
if (Math.random() < b.isModBayesian) powerUps.spawn(x, y, "field");
|
if (Math.random() < b.isModBayesian) powerUps.spawn(x, y, "field");
|
||||||
} else if (mech.health < 0.7) {
|
} else if (mech.health < 0.7) {
|
||||||
|
|||||||
36
todo.txt
36
todo.txt
@@ -1,26 +1,20 @@
|
|||||||
************** TODO - n-gon **************
|
************** TODO - n-gon **************
|
||||||
|
|
||||||
|
bug - mech.fieldShieldingScale doesn't reset when switching fields
|
||||||
|
|
||||||
|
negative mass field needs a buff
|
||||||
|
no longer blocks, but the player takes 50% less damage from all sources while the field is active
|
||||||
|
allow player to hold larger block, but give throwing blocks at high speed for no energy to a mob
|
||||||
|
|
||||||
|
mod - blocks stun mobs
|
||||||
|
mod - throwing blocks at full power converts the block into nails
|
||||||
|
would this cause problems for block based puzzles?
|
||||||
mod or field - turn blocks into spores or drones
|
mod or field - turn blocks into spores or drones
|
||||||
|
|
||||||
mod - robot that attack nearby mobs, and delivers a stun status effect
|
mod - robot that attack nearby mobs, and delivers a stun status effect
|
||||||
use laser bot code for the attack
|
use laser bot code for the attack
|
||||||
large and 5 sided?
|
large and 5 sided?
|
||||||
|
|
||||||
consider using the "e" key for picking up blocks and just q for gun swaps
|
|
||||||
good for: plasma torch, time dilation, negative mass
|
|
||||||
bad for: basic, nano-scale, harmonic
|
|
||||||
|
|
||||||
mod - status effects last 1 second longer
|
|
||||||
wait until you have more status effects written
|
|
||||||
|
|
||||||
mod - time dilation - Quantum Recovery
|
|
||||||
Expending all your energy while using the field will
|
|
||||||
cause the player to go back in time to 3 seconds before the field was activated
|
|
||||||
resets ammo?, health, position, velocity
|
|
||||||
need to track player info in game.checks() in an array
|
|
||||||
put the array in the time field object
|
|
||||||
cause the player to go back in time when the field was first activated (easier then going back to 3 seconds before)
|
|
||||||
|
|
||||||
bug - getting stuck in crouch mode
|
bug - getting stuck in crouch mode
|
||||||
press T to see it visually
|
press T to see it visually
|
||||||
happened twice to me so far
|
happened twice to me so far
|
||||||
@@ -86,6 +80,18 @@ atmosphere levels: change the pace, give the user a rest between combat
|
|||||||
|
|
||||||
mob: targeting laser, then a high speed, no gravity bullet
|
mob: targeting laser, then a high speed, no gravity bullet
|
||||||
|
|
||||||
|
mod - status effects last 1 second longer
|
||||||
|
wait until you have more status effects written
|
||||||
|
|
||||||
|
mod - time dilation - Quantum Recovery
|
||||||
|
Expending all your energy while using the field will
|
||||||
|
cause the player to go back in time to 3 seconds before the field was activated
|
||||||
|
resets ammo?, health, position, velocity
|
||||||
|
need to track player info in game.checks() in an array
|
||||||
|
put the array in the time field object
|
||||||
|
cause the player to go back in time when the field was first activated (easier then going back to 3 seconds before)
|
||||||
|
|
||||||
|
|
||||||
css transition for pause menu
|
css transition for pause menu
|
||||||
|
|
||||||
field that pushes everything back, and can destroy smaller blocks
|
field that pushes everything back, and can destroy smaller blocks
|
||||||
|
|||||||
Reference in New Issue
Block a user