cloaking balance

This commit is contained in:
landgreen
2020-09-20 08:31:17 -07:00
parent 33fa0898fb
commit 2c34a7d89d
4 changed files with 62 additions and 24 deletions

View File

@@ -1015,6 +1015,11 @@ const b = {
for (let i = 0; i < mod.foamBotCount; i++) b.foamBot() for (let i = 0; i < mod.foamBotCount; i++) b.foamBot()
for (let i = 0; i < mod.boomBotCount; i++) b.boomBot() for (let i = 0; i < mod.boomBotCount; i++) b.boomBot()
for (let i = 0; i < mod.plasmaBotCount; i++) b.plasmaBot() for (let i = 0; i < mod.plasmaBotCount; i++) b.plasmaBot()
if (mod.isIntangible && mech.isCloak) {
for (let i = 0; i < bullet.length; i++) {
if (bullet[i].botType) bullet[i].collisionFilter.mask = cat.map | cat.bullet | cat.mobBullet | cat.mobShield
}
}
}, },
randomBot(where = mech.pos, isKeep = true) { randomBot(where = mech.pos, isKeep = true) {
if (Math.random() < 0.25) { if (Math.random() < 0.25) {
@@ -1316,7 +1321,7 @@ const b = {
} }
} }
//punch target //punch target
if (this.lockedOn && this.lockedOn.alive) { if (this.lockedOn && this.lockedOn.alive && !mech.isCloak) {
const DIST = Vector.magnitude(Vector.sub(this.vertices[0], this.lockedOn.position)); const DIST = Vector.magnitude(Vector.sub(this.vertices[0], this.lockedOn.position));
if (DIST - this.lockedOn.radius < this.range && if (DIST - this.lockedOn.radius < this.range &&
Matter.Query.ray(map, this.position, this.lockedOn.position).length === 0) { Matter.Query.ray(map, this.position, this.lockedOn.position).length === 0) {

View File

@@ -819,7 +819,7 @@ const mod = {
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
return mod.isStunField || mod.isPulseStun || mod.isNeutronStun || mod.oneSuperBall || mod.isHarmFreeze || mod.isIceField || mod.isIceCrystals || mod.isSporeFreeze || mod.isAoESlow || mod.isFreezeMobs || mod.isPilotFreeze || mod.haveGunCheck("ice IX") return mod.isStunField || mod.isPulseStun || mod.isNeutronStun || mod.oneSuperBall || mod.isHarmFreeze || mod.isIceField || mod.isIceCrystals || mod.isSporeFreeze || mod.isAoESlow || mod.isFreezeMobs || mod.isPilotFreeze || mod.haveGunCheck("ice IX") || mod.isCloakStun
}, },
requires: "a freezing or stunning effect", requires: "a freezing or stunning effect",
effect() { effect() {
@@ -2532,7 +2532,7 @@ const mod = {
}, },
{ {
name: "flashbang", name: "flashbang",
description: "<strong class='color-cloaked'>decloaking</strong> <strong>stuns</strong> nearby mobs for <strong>2</strong> second", description: "<strong class='color-cloaked'>decloaking</strong> <strong>stuns</strong> nearby mobs<br>drains <strong>25%</strong> of your stored <strong class='color-f'>energy</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {

View File

@@ -1775,7 +1775,8 @@ const mech = {
mech.fieldPhase = 0; mech.fieldPhase = 0;
mech.isCloak = false mech.isCloak = false
mech.fieldDamage = 1.66 mech.fieldDamage = 1.66
const drawRadius = 900 mech.fieldDrawRadius = 0
const drawRadius = 1000
mech.hold = function () { mech.hold = function () {
if (mech.isHolding) { if (mech.isHolding) {
@@ -1786,7 +1787,7 @@ const mech = {
} else if ((keys[32] || game.mouseDownRight && mech.fieldCDcycle < mech.cycle)) { //not hold and field button is pressed } else if ((keys[32] || game.mouseDownRight && mech.fieldCDcycle < mech.cycle)) { //not hold and field button is pressed
mech.grabPowerUp(); mech.grabPowerUp();
mech.lookForPickUp(); mech.lookForPickUp();
if (mech.fireCDcycle < mech.cycle) mech.fireCDcycle = mech.cycle - 40 //to disable cloak if (mech.fireCDcycle < mech.cycle) mech.fireCDcycle = mech.cycle //to disable cloak
} else if (mech.holdingTarget && mech.fieldCDcycle < mech.cycle) { //holding target exists, and field button is not pressed } else if (mech.holdingTarget && mech.fieldCDcycle < mech.cycle) { //holding target exists, and field button is not pressed
mech.pickUp(); mech.pickUp();
} else { } else {
@@ -1796,31 +1797,56 @@ const mech = {
//120 cycles after shooting (or using field) enable cloak //120 cycles after shooting (or using field) enable cloak
if (mech.energy < 0.05 && mech.fireCDcycle < mech.cycle) mech.fireCDcycle = mech.cycle if (mech.energy < 0.05 && mech.fireCDcycle < mech.cycle) mech.fireCDcycle = mech.cycle
if (mech.fireCDcycle + 50 < mech.cycle) { if (mech.fireCDcycle + 50 < mech.cycle) {
if (!mech.isCloak) mech.isCloak = true if (!mech.isCloak) {
} else { mech.isCloak = true //enter cloak
if (mech.isCloak) { if (mod.isIntangible) {
for (let i = 0; i < bullet.length; i++) {
if (bullet[i].botType) bullet[i].collisionFilter.mask = cat.map | cat.bullet | cat.mobBullet | cat.mobShield
}
}
}
} else if (mech.isCloak) { //exit cloak
mech.isCloak = false mech.isCloak = false
if (mod.isIntangible) {
for (let i = 0; i < bullet.length; i++) {
if (bullet[i].botType) bullet[i].collisionFilter.mask = cat.map | cat.body | cat.bullet | cat.mob | cat.mobBullet | cat.mobShield
}
}
if (mod.isCloakStun) { //stun nearby mobs after exiting cloak if (mod.isCloakStun) { //stun nearby mobs after exiting cloak
ctx.beginPath(); let isMobsAround = false
ctx.arc(mech.pos.x, mech.pos.y, 800, 0, 2 * Math.PI); const stunRange = mech.fieldDrawRadius * 1.15
ctx.fillStyle = "#000" const drain = 0.25 * mech.energy
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)) < drawRadius) { if (
mobs.statusStun(mob[i], 120) Vector.magnitude(Vector.sub(mob[i].position, mech.pos)) < stunRange &&
Matter.Query.ray(map, mob[i].position, mech.pos).length === 0
) {
isMobsAround = true
mobs.statusStun(mob[i], drain * 500)
} }
} }
if (isMobsAround && mech.energy > drain) {
mech.energy -= drain
game.drawList.push({
x: mech.pos.x,
y: mech.pos.y,
radius: stunRange,
color: "hsla(0,50%,100%,0.5)",
time: 3
});
// ctx.beginPath();
// ctx.arc(mech.pos.x, mech.pos.y, 800, 0, 2 * Math.PI);
// ctx.fillStyle = "#000"
// ctx.fill();
} }
} }
} }
function drawField(radius) { function drawField() {
const energy = Math.max(0.01, Math.min(mech.energy, 1))
radius *= Math.min(1, 0.3 + 0.5 * Math.min(1, energy * energy));
mech.fieldPhase += 0.007 + 0.07 * (1 - energy) mech.fieldPhase += 0.007 + 0.07 * (1 - energy)
const wiggle = 0.15 * Math.sin(mech.fieldPhase * 0.5) const wiggle = 0.15 * Math.sin(mech.fieldPhase * 0.5)
ctx.beginPath(); ctx.beginPath();
ctx.ellipse(mech.pos.x, mech.pos.y, radius * (1 - wiggle), radius * (1 + wiggle), mech.fieldPhase, 0, 2 * Math.PI); ctx.ellipse(mech.pos.x, mech.pos.y, mech.fieldDrawRadius * (1 - wiggle), mech.fieldDrawRadius * (1 + wiggle), mech.fieldPhase, 0, 2 * Math.PI);
if (mech.fireCDcycle > mech.cycle && (keys[32] || game.mouseDownRight)) { if (mech.fireCDcycle > mech.cycle && (keys[32] || game.mouseDownRight)) {
ctx.lineWidth = 5; ctx.lineWidth = 5;
ctx.strokeStyle = `rgba(0, 204, 255,1)` ctx.strokeStyle = `rgba(0, 204, 255,1)`
@@ -1833,13 +1859,16 @@ const mech = {
ctx.clip(); ctx.clip();
} }
const energy = Math.max(0.01, Math.min(mech.energy, 1))
if (mech.isCloak) { if (mech.isCloak) {
this.fieldRange = this.fieldRange * 0.9 + 0.1 * drawRadius this.fieldRange = this.fieldRange * 0.9 + 0.1 * drawRadius
drawField(this.fieldRange) mech.fieldDrawRadius = this.fieldRange * Math.min(1, 0.3 + 0.5 * Math.min(1, energy * energy));
drawField()
} else { } else {
if (this.fieldRange < 3000) { if (this.fieldRange < 3000) {
this.fieldRange += 200 this.fieldRange += 200
drawField(this.fieldRange) mech.fieldDrawRadius = this.fieldRange * Math.min(1, 0.3 + 0.5 * Math.min(1, energy * energy));
drawField()
} }
} }
if (mod.isIntangible) { if (mod.isIntangible) {

View File

@@ -3,6 +3,10 @@
************** TODO - n-gon ************** ************** TODO - n-gon **************
exiting cloak gives +100 bonus damage for 2 seconds
+100 dmg while decloaked
damage mitigation while cloaked
add some more computer / AI stuff to the level lore text 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