can fire while some fields are active

This commit is contained in:
landgreen
2019-10-24 06:41:33 -07:00
parent 22b2f87a75
commit 1a419cef32
4 changed files with 16 additions and 16 deletions

View File

@@ -31,7 +31,7 @@ const b = {
},
() => {
b.mod = 1;
game.makeTextLog("<strong style='font-size:30px;'>Anti-Matter Cores</strong><br> (left click)<p>your <strong>explosions</strong> are 25% larger and do more damage</p>", 1200);
game.makeTextLog("<strong style='font-size:30px;'>Anti-Matter Cores</strong><br> (left click)<p>your <strong>explosions</strong> are larger and do more damage</p>", 1200);
b.setModDefaults(); //at 1.4 gives a flat 40% increase, and increased range, balanced by limited guns and self damage
//testing at 1.3: grenade(+0.3), missiles, flak, M80
b.modExplosionRadius = 1.25; //good for guns with explosions:
@@ -39,7 +39,7 @@ const b = {
},
() => {
b.mod = 2;
game.makeTextLog("<strong style='font-size:30px;'>High Caliber Bullets</strong><br> (left click)<p>your bullets are 7% <strong>larger</strong> and do more physical damage</p>", 1200);
game.makeTextLog("<strong style='font-size:30px;'>High Caliber Bullets</strong><br> (left click)<p>your bullets are <strong>larger</strong> and do more physical damage</p>", 1200);
b.setModDefaults(); //good for guns that do mostly projectile damage:
//testing done at 1.15: one shot(+0.38), rapid fire(+0.25), spray, wave beam(+0.4 adds range and dmg), needles(+0.1)
//testing at 1.08: spray(point blank)(+0.25), one shot(+0.16), wave beam(point blank)(+0.14)
@@ -71,11 +71,6 @@ const b = {
b.modBulletsLastLonger = 1.25
},
// () => {
// b.mod = 7;
// game.makeTextLog("<strong style='font-size:30px;'>Two Phase Processing</strong><br> (left click)<p>You can fire your gun while your <strong>field</strong> is active</p>", 1200);
// b.setModDefaults(); //good with: default field, Time Dilation Field, Negative Mass Field, Phase Decoherence Field
// },
// () => {
// b.mod = 8;
// game.makeTextLog("<strong style='font-size:30px;'>Relativistic Velocity</strong><br> (left click)<p>Your bullets are effected extra by your own velocity</p>", 1200);
// b.setModDefaults(); //good with: one shot, rapid fire, spray, super balls
@@ -101,7 +96,7 @@ const b = {
game.makeGunHUD();
},
fire() {
if (game.mouseDown && mech.fireCDcycle < mech.cycle && !(keys[32] || game.mouseDownRight) && b.inventory.length) {
if (game.mouseDown && mech.fireCDcycle < mech.cycle && (!(keys[32] || game.mouseDownRight) || mech.fieldFire) && b.inventory.length) {
if (b.guns[this.activeGun].ammo > 0) {
b.guns[this.activeGun].fire();
@@ -1062,7 +1057,7 @@ const b = {
name: "spores",
description: "release an orb that discharges spores after 2 seconds<br>spores seek out targets<br>spores can pass through blocks",
ammo: 0,
ammoPack: 6,
ammoPack: 5,
have: false,
fire() {
const me = bullet.length;

View File

@@ -13,9 +13,10 @@ const level = {
start() {
if (game.levelsCleared === 0) {
// game.levelsCleared = 5; //for testing to simulate possible mobs spawns
// b.giveGuns(1) // set a starting gun for testing
// b.giveGuns("all", 1000)
// mech.fieldUpgrades[1]() //give a field power up for testing
// b.giveGuns(3) // set a starting gun for testing
// mech.fieldUpgrades[1](); //give a field power up for testing
// b.mods[6](); //give specific mod
this.intro(); //starting level
// this.testingMap();

View File

@@ -480,6 +480,7 @@ const mech = {
fieldMeter: 0,
fieldRegen: 0,
fieldMode: 0,
fieldFire: false,
holdingMassScale: 0,
throwChargeRate: 0,
throwChargeMax: 0,
@@ -495,6 +496,7 @@ const mech = {
setHoldDefaults() {
this.fieldMeter = 1;
this.fieldRegen = 0.001;
this.fieldFire = false;
this.fieldCDcycle = 0;
this.isStealth = false;
player.collisionFilter.mask = 0x010011 //0x010011 is normal
@@ -877,8 +879,9 @@ const mech = {
},
() => {
mech.fieldMode = 1;
game.makeTextLog("<strong style='font-size:30px;'>Time Dilation Field</strong><br> (right mouse or space bar)<p> stop time while field is active</p>", 1200);
game.makeTextLog("<strong style='font-size:30px;'>Time Dilation Field</strong><br> (right mouse or space bar)<p> stop time while field is active<br> can fire while field is active</p>", 1200);
mech.setHoldDefaults();
mech.fieldFire = true;
mech.grabRange = 130
mech.isBodiesAsleep = false;
mech.hold = function () {
@@ -888,7 +891,7 @@ const mech = {
mech.holding();
mech.throw();
} else if ((keys[32] || game.mouseDownRight) && mech.fieldCDcycle < mech.cycle) {
const DRAIN = 0.0015
const DRAIN = 0.0022
if (mech.fieldMeter > DRAIN) {
mech.fieldMeter -= DRAIN;
@@ -993,9 +996,10 @@ const mech = {
},
() => {
mech.fieldMode = 3;
game.makeTextLog("<strong style='font-size:30px;'>Negative Mass Field</strong><br> (right mouse or space bar)<p> field nullifies gravity<br> player can hold more massive objects</p>", 1200);
game.makeTextLog("<strong style='font-size:30px;'>Negative Mass Field</strong><br> (right mouse or space bar)<p> field nullifies gravity<br> player can hold more massive objects<br>can fire while field is active</p>", 1200);
//<br> <span style='color:#a00;'>decreased</span> field shielding efficiency
mech.setHoldDefaults();
mech.fieldFire = true;
mech.holdingMassScale = 0.05; //can hold heavier blocks with lower cost to jumping
mech.fieldShieldingScale = 2;
// mech.fieldArc = 1; //field covers full 360 degrees
@@ -1083,7 +1087,7 @@ const mech = {
game.makeTextLog("<strong style='font-size:30px;'>Standing Wave Harmonics</strong><br> (right mouse or space bar) <p>oscillating shields always surround player<br> <span style='color:#a00;'>decreased</span> field regeneration</p>", 1200);
mech.setHoldDefaults();
// mech.fieldShieldingScale = 0.5;
mech.fieldRegen *= 0.33;
mech.fieldRegen *= 0.2;
mech.hold = function () {
if (mech.isHolding) {

View File

@@ -93,7 +93,7 @@ const powerUps = {
if (!game.lastLogTime) game.makeTextLog("+energy", 180);
} else {
//ammo given scales as mobs take more hits to kill
const ammo = Math.ceil((target.ammoPack * (0.6 + 0.05 * Math.random())) / b.dmgScale);
const ammo = Math.ceil((target.ammoPack * (0.5 + 0.04 * Math.random())) / b.dmgScale);
target.ammo += ammo;
game.updateGunHUD();
if (!game.lastLogTime) game.makeTextLog("+" + ammo + " ammo: " + target.name, 180);