buffs to cloak

This commit is contained in:
landgreen
2020-09-19 19:26:29 -07:00
parent f334372281
commit 33fa0898fb
5 changed files with 22 additions and 18 deletions

View File

@@ -105,7 +105,7 @@
<option value="4">why...</option> <option value="4">why...</option>
</select> </select>
<br> <br>
<label for="community-maps" title="adds in 2 maps written by n-gon player: Francois">include community maps:</label> <label for="community-maps" title="adds in maps written by n-gon player: Francois">include community maps:</label>
<input type="checkbox" id="community-maps" name="community-maps" style="width:17px; height:17px;"> <input type="checkbox" id="community-maps" name="community-maps" style="width:17px; height:17px;">
<!-- <br> <!-- <br>
<label for="body-damage" title="allow damage from the ground and large fast moving blocks">collision damage from blocks:</label> <label for="body-damage" title="allow damage from the ground and large fast moving blocks">collision damage from blocks:</label>

View File

@@ -878,7 +878,7 @@ const game = {
// if (mod.isEnergyDamage) { // if (mod.isEnergyDamage) {
// document.getElementById("mod-capacitor").innerHTML = `(+${(mech.energy/0.05).toFixed(0)}%)` // document.getElementById("mod-capacitor").innerHTML = `(+${(mech.energy/0.05).toFixed(0)}%)`
// } // }
// if (mod.isRest) { // if (mod.restDamage) {
// if (player.speed < 1) { // if (player.speed < 1) {
// document.getElementById("mod-rest").innerHTML = `(+20%)` // document.getElementById("mod-rest").innerHTML = `(+20%)`
// } else { // } else {

View File

@@ -4,6 +4,7 @@ const mod = {
for (let i = 0, len = mod.mods.length; i < len; i++) { for (let i = 0, len = mod.mods.length; i < len; i++) {
mod.mods[i].remove(); mod.mods[i].remove();
mod.mods[i].count = 0 mod.mods[i].count = 0
if (mod.mods[i].isLost) mod.mods[i].isLost = false;
} }
mod.armorFromPowerUps = 0; mod.armorFromPowerUps = 0;
mod.totalCount = 0; mod.totalCount = 0;
@@ -87,7 +88,7 @@ const mod = {
if (mod.isHarmDamage && mech.lastHarmCycle + 600 > mech.cycle) dmg *= 2; if (mod.isHarmDamage && mech.lastHarmCycle + 600 > mech.cycle) dmg *= 2;
if (mod.isEnergyLoss) dmg *= 1.37; if (mod.isEnergyLoss) dmg *= 1.37;
if (mod.isAcidDmg && mech.health > 1) dmg *= 1.4; if (mod.isAcidDmg && mech.health > 1) dmg *= 1.4;
if (mod.isRest && player.speed < 1) dmg *= 1.20; if (mod.restDamage > 1 && player.speed < 1) dmg *= mod.restDamage
if (mod.isEnergyDamage) dmg *= 1 + mech.energy / 5.5; if (mod.isEnergyDamage) dmg *= 1 + mech.energy / 5.5;
if (mod.isDamageFromBulletCount) dmg *= 1 + bullet.length * 0.0038 if (mod.isDamageFromBulletCount) dmg *= 1 + bullet.length * 0.0038
if (mod.isRerollDamage) dmg *= 1 + 0.05 * powerUps.reroll.rerolls if (mod.isRerollDamage) dmg *= 1 + 0.05 * powerUps.reroll.rerolls
@@ -162,18 +163,18 @@ const mod = {
}, },
{ {
name: "rest frame", name: "rest frame",
description: "increase <strong class='color-d'>damage</strong> by <strong>20%</strong><br>when not <strong>moving</strong>", description: "increase <strong class='color-d'>damage</strong> by <strong>25%</strong><br>when not <strong>moving</strong>",
maxCount: 1, maxCount: 6,
count: 0, count: 0,
allowed() { allowed() {
return true return true
}, },
requires: "", requires: "",
effect: () => { effect: () => {
mod.isRest = true mod.restDamage += 0.25
}, },
remove() { remove() {
mod.isRest = false; mod.restDamage = 1;
} }
}, },
{ {
@@ -1261,7 +1262,7 @@ const mod = {
}, },
{ {
name: "determinism", name: "determinism",
description: "spawn <strong>5</strong> <strong class='color-m'>mods</strong><br><strong class='color-m'>mods</strong>, <strong class='color-f'>fields</strong>, and <strong class='color-g'>guns</strong> have only <strong>1 choice</strong>", description: "spawn <strong>4</strong> <strong class='color-m'>mods</strong><br><strong class='color-m'>mods</strong>, <strong class='color-f'>fields</strong>, and <strong class='color-g'>guns</strong> have only <strong>1 choice</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
isNonRefundable: true, isNonRefundable: true,
@@ -1271,7 +1272,7 @@ const mod = {
requires: "not cardinality", requires: "not cardinality",
effect: () => { effect: () => {
mod.isDeterminism = true; mod.isDeterminism = true;
for (let i = 0; i < 5; i++) { //if you change the six also change it in Born rule for (let i = 0; i < 4; i++) { //if you change the six also change it in Born rule
powerUps.spawn(mech.pos.x, mech.pos.y, "mod"); powerUps.spawn(mech.pos.x, mech.pos.y, "mod");
} }
}, },
@@ -1281,7 +1282,7 @@ const mod = {
}, },
{ {
name: "superdeterminism", name: "superdeterminism",
description: "spawn <strong>4</strong> <strong class='color-m'>mods</strong><br><strong class='color-r'>rerolls</strong>, <strong class='color-g'>guns</strong>, and <strong class='color-f'>fields</strong> no longer <strong>spawn</strong>", description: "spawn <strong>3</strong> <strong class='color-m'>mods</strong><br><strong class='color-r'>rerolls</strong>, <strong class='color-g'>guns</strong>, and <strong class='color-f'>fields</strong> no longer <strong>spawn</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
isNonRefundable: true, isNonRefundable: true,
@@ -1291,7 +1292,7 @@ const mod = {
requires: "determinism", requires: "determinism",
effect: () => { effect: () => {
mod.isSuperDeterminism = true; mod.isSuperDeterminism = true;
for (let i = 0; i < 4; i++) { //if you change the six also change it in Born rule for (let i = 0; i < 3; i++) { //if you change the six also change it in Born rule
powerUps.spawn(mech.pos.x, mech.pos.y, "mod"); powerUps.spawn(mech.pos.x, mech.pos.y, "mod");
} }
}, },
@@ -2726,7 +2727,7 @@ const mod = {
isEnergyHealth: null, isEnergyHealth: null,
isPulseStun: null, isPulseStun: null,
isPilotFreeze: null, isPilotFreeze: null,
isRest: null, restDamage: null,
isRPG: null, isRPG: null,
is3Missiles: null, is3Missiles: null,
isDeterminism: null, isDeterminism: null,

View File

@@ -1690,7 +1690,7 @@ const mech = {
mech.grabPowerUp(); mech.grabPowerUp();
mech.lookForPickUp(180); mech.lookForPickUp(180);
const DRAIN = 0.001 const DRAIN = 0.0008
if (mech.energy > DRAIN) { if (mech.energy > DRAIN) {
mech.energy -= DRAIN; mech.energy -= DRAIN;
if (mech.energy < DRAIN) { if (mech.energy < DRAIN) {
@@ -1768,13 +1768,14 @@ const mech = {
}, },
{ {
name: "metamaterial cloaking", //"weak photonic coupling" "electromagnetically induced transparency" "optical non-coupling" "slow light field" "electro-optic transparency" name: "metamaterial cloaking", //"weak photonic coupling" "electromagnetically induced transparency" "optical non-coupling" "slow light field" "electro-optic transparency"
description: "<strong class='color-cloaked'>cloak</strong> after not using your gun or field<br>while <strong class='color-cloaked'>cloaked</strong> mobs can't see you<br>increase <strong class='color-d'>damage</strong> by <strong>33%</strong>", description: "<strong class='color-cloaked'>cloak</strong> after not using your gun or field<br>while <strong class='color-cloaked'>cloaked</strong> mobs can't see you<br>increase <strong class='color-d'>damage</strong> by <strong>66%</strong>",
effect: () => { effect: () => {
mech.fieldFire = true; mech.fieldFire = true;
mech.fieldMeterColor = "#fff"; mech.fieldMeterColor = "#fff";
mech.fieldPhase = 0; mech.fieldPhase = 0;
mech.isCloak = false mech.isCloak = false
mech.fieldDamage = 1.33 mech.fieldDamage = 1.66
const drawRadius = 900
mech.hold = function () { mech.hold = function () {
if (mech.isHolding) { if (mech.isHolding) {
@@ -1805,7 +1806,7 @@ const mech = {
ctx.fillStyle = "#000" ctx.fillStyle = "#000"
ctx.fill(); ctx.fill();
for (let i = 0, len = mob.length; i < len; ++i) { for (let i = 0, len = mob.length; i < len; ++i) {
if (Vector.magnitude(Vector.sub(mob[i].position, mech.pos)) < 850) { if (Vector.magnitude(Vector.sub(mob[i].position, mech.pos)) < drawRadius) {
mobs.statusStun(mob[i], 120) mobs.statusStun(mob[i], 120)
} }
} }
@@ -1833,7 +1834,7 @@ const mech = {
} }
if (mech.isCloak) { if (mech.isCloak) {
this.fieldRange = this.fieldRange * 0.9 + 0.1 * 800 this.fieldRange = this.fieldRange * 0.9 + 0.1 * drawRadius
drawField(this.fieldRange) drawField(this.fieldRange)
} else { } else {
if (this.fieldRange < 3000) { if (this.fieldRange < 3000) {
@@ -2113,7 +2114,7 @@ const mech = {
for (let i = 0, len = body.length; i < len; ++i) { for (let i = 0, len = body.length; i < len; ++i) {
if (Vector.magnitude(Vector.sub(body[i].position, mech.fieldPosition)) < mech.fieldRadius && !body[i].isNotHoldable) { if (Vector.magnitude(Vector.sub(body[i].position, mech.fieldPosition)) < mech.fieldRadius && !body[i].isNotHoldable) {
const DRAIN = speed * body[i].mass * 0.000015 const DRAIN = speed * body[i].mass * 0.000013
if (mech.energy > DRAIN) { if (mech.energy > DRAIN) {
mech.energy -= DRAIN; mech.energy -= DRAIN;
Matter.Body.setVelocity(body[i], velocity); //give block mouse velocity Matter.Body.setVelocity(body[i], velocity); //give block mouse velocity

View File

@@ -3,6 +3,8 @@
************** TODO - n-gon ************** ************** TODO - n-gon **************
add some more computer / AI stuff to the level lore text
mod - mines stun targets nearby when they explode mod - mines stun targets nearby when they explode
cloaking field mods cloaking field mods