bug fixes

This commit is contained in:
landgreen
2020-11-08 07:06:40 -08:00
parent e86ec0c37d
commit 30cace60fb
5 changed files with 19 additions and 25 deletions

View File

@@ -2863,8 +2863,8 @@ const b = {
have: false, have: false,
fire() { fire() {
if (mod.isCapacitor) { if (mod.isCapacitor) {
if (mech.energy > 0.16) { if (mech.energy > 0.16 || mod.isRailEnergyGain) {
mech.energy -= 0.16 mech.energy += 0.16 * (mod.isRailEnergyGain ? 1 : -1)
mech.fireCDcycle = mech.cycle + Math.floor(30 * b.fireCD); mech.fireCDcycle = mech.cycle + Math.floor(30 * b.fireCD);
const me = bullet.length; const me = bullet.length;
bullet[me] = Bodies.rectangle(mech.pos.x + 50 * Math.cos(mech.angle), mech.pos.y + 50 * Math.sin(mech.angle), 60, 14, { bullet[me] = Bodies.rectangle(mech.pos.x + 50 * Math.cos(mech.angle), mech.pos.y + 50 * Math.sin(mech.angle), 60, 14, {
@@ -3077,17 +3077,11 @@ const b = {
const previousCharge = this.charge const previousCharge = this.charge
let smoothRate = 0.98 * (mech.crouch ? 0.99 : 1) * (0.98 + 0.02 * b.fireCD) //small b.fireCD = faster shots, b.fireCD=1 = normal shot, big b.fireCD = slower chot let smoothRate = 0.98 * (mech.crouch ? 0.99 : 1) * (0.98 + 0.02 * b.fireCD) //small b.fireCD = faster shots, b.fireCD=1 = normal shot, big b.fireCD = slower chot
this.charge = this.charge * smoothRate + 1 * (1 - smoothRate) this.charge = this.charge * smoothRate + 1 * (1 - smoothRate)
// let chargeRate = (mech.crouch) ? 0.98 : 0.984
// chargeRate *= Math.pow(b.fireCD, 0.03)
// this.charge = this.charge * chargeRate + (1 - chargeRate) // this.charge converges to 1
if (mod.isRailEnergyGain) { if (mod.isRailEnergyGain) {
mech.energy += (this.charge - previousCharge) * 1.66 //energy drain is proportional to charge gained, but doesn't stop normal mech.fieldRegen mech.energy += (this.charge - previousCharge) * 2 //energy drain is proportional to charge gained, but doesn't stop normal mech.fieldRegen
} else { } else {
mech.energy -= (this.charge - previousCharge) * 0.33 //energy drain is proportional to charge gained, but doesn't stop normal mech.fieldRegen mech.energy -= (this.charge - previousCharge) * 0.33 //energy drain is proportional to charge gained, but doesn't stop normal mech.fieldRegen
} }
//draw targeting //draw targeting
let best; let best;
let range = 3000 let range = 3000

View File

@@ -17,8 +17,8 @@ const level = {
// game.zoomScale = 1000; // game.zoomScale = 1000;
// game.setZoom(); // game.setZoom();
// mech.setField("wormhole") // mech.setField("wormhole")
b.giveGuns("mine") // b.giveGuns("mine")
mod.giveMod("sentry") // mod.giveMod("sentry")
level.intro(); //starting level level.intro(); //starting level

View File

@@ -1061,7 +1061,7 @@ const mobs = {
powerUps.spawn(this.position.x, this.position.y, type); powerUps.spawn(this.position.x, this.position.y, type);
} }
} }
if (true) { if (mod.isRadioactive) {
//look for dots and spread them //look for dots and spread them
let dmgTotal = 0 let dmgTotal = 0
for (let i = 0, len = this.status.length; i < len; i++) { for (let i = 0, len = this.status.length; i < len; i++) {
@@ -1077,7 +1077,15 @@ const mobs = {
closestIndex = i closestIndex = i
} }
} }
if (closestIndex) mobs.statusDoT(mob[closestIndex], dmgTotal / 180, 180) if (closestIndex) {
mobs.statusDoT(mob[closestIndex], dmgTotal / 180, 180)
ctx.beginPath();
ctx.moveTo(this.position.x, this.position.y);
ctx.lineTo(mob[closestIndex].position.x, mob[closestIndex].position.y);
ctx.lineWidth = this.radius;
ctx.strokeStyle = "rgba(0,80,80,1)";
ctx.stroke();
}
//draw AOE //draw AOE
// game.drawList.push({ //add dmg to draw queue // game.drawList.push({ //add dmg to draw queue
// x: this.position.x, // x: this.position.x,

View File

@@ -2402,9 +2402,9 @@ const mod = {
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
return mod.haveGunCheck("rail gun") && !mod.isCapacitor return mod.haveGunCheck("rail gun")
}, },
requires: "rail gun, not capacitor bank", requires: "rail gun",
effect() { effect() {
mod.isRailEnergyGain = true; mod.isRailEnergyGain = true;
}, },
@@ -2418,9 +2418,9 @@ const mod = {
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
return mod.haveGunCheck("rail gun") && !mod.isRailEnergyGain return mod.haveGunCheck("rail gun")
}, },
requires: "rail gun, not half-wave rectifier", requires: "rail gun",
effect() { effect() {
mod.isCapacitor = true; mod.isCapacitor = true;
}, },

View File

@@ -1,14 +1,6 @@
*********** NEXT PATCH *********** *********** NEXT PATCH ***********
mini black hole mobs travel through walls
mod: radioactive contamination - after a mob or shield dies, leftover radiation spreads to a nearby mob
mod: half-wave rectifier - railgun overfills with energy when you charge instead of draining
removed rail gun mod - frame dragging
bug fixed - rail gun bugs out when your charge speed gets very low
mod: sentry - mines are modified to automatically fire nails at nearby targets for 12 seconds
************** BUGS ************** ************** BUGS **************