field balance and graphics

This commit is contained in:
landgreen
2019-10-04 19:09:23 -07:00
parent 1fec76f4e6
commit 0a834d87a7

View File

@@ -497,6 +497,7 @@ const mech = {
this.fieldRegen = 0.0015; this.fieldRegen = 0.0015;
this.fieldCDcycle = 0; this.fieldCDcycle = 0;
this.isStealth = false; this.isStealth = false;
player.collisionFilter.mask = 0x010011 //0x010011 is normal
this.holdingMassScale = 0.5; this.holdingMassScale = 0.5;
this.throwChargeRate = 2; this.throwChargeRate = 2;
this.throwChargeMax = 50; this.throwChargeMax = 50;
@@ -873,9 +874,6 @@ const mech = {
ctx.arc(mech.pos.x, mech.pos.y + 15, mech.grabRange, 0, 2 * Math.PI); ctx.arc(mech.pos.x, mech.pos.y + 15, mech.grabRange, 0, 2 * Math.PI);
ctx.fillStyle = "rgba(255,255,255," + (0.5 + 0.17 * Math.random()) + ")"; ctx.fillStyle = "rgba(255,255,255," + (0.5 + 0.17 * Math.random()) + ")";
ctx.fill(); ctx.fill();
ctx.strokeStyle = "#000"
ctx.lineWidth = 2;
ctx.stroke();
function slow(who, friction = 0) { function slow(who, friction = 0) {
for (let i = 0, len = who.length; i < len; ++i) { for (let i = 0, len = who.length; i < len; ++i) {
@@ -1127,10 +1125,10 @@ const mech = {
}, },
() => { () => {
mech.fieldMode = 6; mech.fieldMode = 6;
game.makeTextLog("<strong style='font-size:30px;'>Dimensional Phasing</strong><br> (right mouse or space bar) <p>player can pass through enemies while field is active.<br>player is invisible while field is active.</p>", 1200); game.makeTextLog("<strong style='font-size:30px;'>Phase Decoherence Field</strong><br> (right mouse or space bar) <p>phase through enemies while field is active<br>can't see or be seen outside field while field is active</p>", 1200);
mech.setHoldDefaults(); mech.setHoldDefaults();
// mech.fieldShieldingScale = 3; // mech.fieldShieldingScale = 3;
// mech.grabRange = 220 mech.grabRange = 220
mech.hold = function () { mech.hold = function () {
mech.isStealth = false //isStealth is checked in mob foundPlayer() mech.isStealth = false //isStealth is checked in mob foundPlayer()
@@ -1140,12 +1138,12 @@ const mech = {
mech.holding(); mech.holding();
mech.throw(); mech.throw();
} else if ((keys[32] || game.mouseDownRight) && mech.fieldCDcycle < game.cycle) { } else if ((keys[32] || game.mouseDownRight) && mech.fieldCDcycle < game.cycle) {
const DRAIN = 0.004 //mech.fieldRegen = 0.0015 const DRAIN = 0.002 //mech.fieldRegen = 0.0015
if (mech.fieldMeter > DRAIN) { if (mech.fieldMeter > DRAIN) {
mech.fieldMeter -= DRAIN; mech.fieldMeter -= DRAIN;
mech.isStealth = true //isStealth is checked in mob foundPlayer() mech.isStealth = true //isStealth is checked in mob foundPlayer()
player.collisionFilter.mask = 0x010001 //0x010011 is normals player.collisionFilter.mask = 0x000001 //0x010011 is normals
// if (mech.crouch) { // if (mech.crouch) {
// mech.grabRange = mech.grabRange * 0.96 + 400 * 0.04; // mech.grabRange = mech.grabRange * 0.96 + 400 * 0.04;
@@ -1163,6 +1161,7 @@ const mech = {
ctx.lineWidth = 2; ctx.lineWidth = 2;
ctx.stroke(); ctx.stroke();
// mech.pushMobs360(150); // mech.pushMobs360(150);
mech.grabPowerUp(); mech.grabPowerUp();
mech.lookForPickUp(); mech.lookForPickUp();