foam bug fixes

This commit is contained in:
landgreen
2021-04-25 04:41:30 -07:00
parent f6d02d579f
commit 07a78743be
5 changed files with 27 additions and 51 deletions

View File

@@ -140,7 +140,10 @@ const b = {
if (!b.guns[gun].have) b.inventory.push(gun); if (!b.guns[gun].have) b.inventory.push(gun);
b.guns[gun].have = true; b.guns[gun].have = true;
b.guns[gun].ammo = Math.floor(b.guns[gun].ammoPack * ammoPacks); b.guns[gun].ammo = Math.floor(b.guns[gun].ammoPack * ammoPacks);
if (b.activeGun === null) b.activeGun = gun //if no active gun switch to new gun if (b.activeGun === null) {
b.activeGun = gun //if no active gun switch to new gun
if (b.guns[b.activeGun].charge) b.guns[b.activeGun].charge = 0; //set foam charge to zero if foam is a new gun
}
} }
simulation.makeGunHUD(); simulation.makeGunHUD();
b.setFireCD(); b.setFireCD();
@@ -4046,14 +4049,27 @@ const b = {
name: "foam", name: "foam",
description: "spray bubbly foam that <strong>sticks</strong> to mobs<br><strong class='color-s'>slows</strong> mobs and does <strong class='color-d'>damage</strong> over time", description: "spray bubbly foam that <strong>sticks</strong> to mobs<br><strong class='color-s'>slows</strong> mobs and does <strong class='color-d'>damage</strong> over time",
ammo: 0, ammo: 0,
ammoPack: 36, ammoPack: 30,
have: false, have: false,
charge: 0, charge: 0,
isCharging: false, isDischarge: false,
do() { do() {
if (this.charge > 0 && !input.fire) { if (this.charge > 0) {
//draw charge level
ctx.fillStyle = "rgba(0,50,50,0.2)";
ctx.beginPath();
ctx.arc(m.pos.x + 35 * Math.cos(m.angle), m.pos.y + 35 * Math.sin(m.angle), 10 * Math.sqrt(this.charge), 0, 2 * Math.PI);
ctx.fill();
if (this.isDischarge) {
this.charge-- this.charge--
this.fireFoam() this.fireFoam()
m.fireCDcycle = m.cycle + 1; //disable firing and adding more charge
} else if (!input.fire) {
this.isDischarge = true;
}
} else {
this.isDischarge = false
} }
}, },
fire() { fire() {
@@ -4091,45 +4107,6 @@ const b = {
b.foam(position, Vector.rotate(velocity, spread), radius) b.foam(position, Vector.rotate(velocity, spread), radius)
} }
} }
// fire() {
// let radius, spread
// if (m.crouch) {
// spread = 0.2 * (Math.random() - 0.5)
// radius = 10 + 5 * Math.random() + (tech.isAmmoFoamSize && this.ammo < 300) * 12
// m.fireCDcycle = m.cycle + Math.floor(15 * b.fireCD); // cool down
// } else {
// spread = 0.5 * (Math.random() - 0.5)
// radius = 4 + 6 * Math.random() + (tech.isAmmoFoamSize && this.ammo < 300) * 12
// m.fireCDcycle = m.cycle + Math.floor(5 * b.fireCD); // cool down
// }
// const SPEED = 18 - radius * 0.4;
// const dir = m.angle + 0.15 * (Math.random() - 0.5)
// const velocity = {
// x: SPEED * Math.cos(dir),
// y: SPEED * Math.sin(dir)
// }
// const position = {
// x: m.pos.x + 30 * Math.cos(m.angle),
// y: m.pos.y + 30 * Math.sin(m.angle)
// }
// if (tech.foamFutureFire) {
// simulation.drawList.push({ //add dmg to draw queue
// x: position.x,
// y: position.y,
// radius: 5,
// color: "rgba(0,0,0,0.1)",
// time: 15 * tech.foamFutureFire
// });
// setTimeout(() => {
// if (!simulation.paused) {
// b.foam(position, Vector.rotate(velocity, spread), radius)
// bullet[bullet.length - 1].damage = (1 + 1.27 * tech.foamFutureFire) * (tech.isFastFoam ? 0.048 : 0.012) //double damage
// }
// }, 250 * tech.foamFutureFire);
// } else {
// b.foam(position, Vector.rotate(velocity, spread), radius)
// }
// }
}, { }, {
name: "rail gun", name: "rail gun",
description: "use <strong class='color-f'>energy</strong> to launch a high-speed <strong>dense</strong> rod<br><strong>hold</strong> left mouse to charge, <strong>release</strong> to fire", description: "use <strong class='color-f'>energy</strong> to launch a high-speed <strong>dense</strong> rod<br><strong>hold</strong> left mouse to charge, <strong>release</strong> to fire",

View File

@@ -18,7 +18,7 @@ const level = {
// m.setField("nano-scale manufacturing") // m.setField("nano-scale manufacturing")
// b.giveGuns("foam") // b.giveGuns("foam")
// tech.isExplodeRadio = true // tech.isExplodeRadio = true
// for (let i = 0; i < 1; i++) tech.giveTech("dynamo-bot") // for (let i = 0; i < 9; i++) tech.giveTech("auto-loading heuristics")
// tech.giveTech("superfluidity") // tech.giveTech("superfluidity")
// tech.giveTech("ice crystal nucleation") // tech.giveTech("ice crystal nucleation")
// tech.giveTech("needle gun") // tech.giveTech("needle gun")

View File

@@ -355,6 +355,7 @@ const simulation = {
switchGun() { switchGun() {
if (tech.isCrouchAmmo) tech.isCrouchAmmo = 1 //this prevents hacking the tech by switching guns if (tech.isCrouchAmmo) tech.isCrouchAmmo = 1 //this prevents hacking the tech by switching guns
b.activeGun = b.inventory[b.inventoryGun]; b.activeGun = b.inventory[b.inventoryGun];
if (b.guns[b.activeGun].charge) b.guns[b.activeGun].charge = 0; //if switching into foam set charge to 0
simulation.updateGunHUD(); simulation.updateGunHUD();
simulation.boldActiveGunHUD(); simulation.boldActiveGunHUD();
}, },

View File

@@ -5018,7 +5018,7 @@
isBadRandomOption: true, isBadRandomOption: true,
isExperimentalMode: true, isExperimentalMode: true,
allowed() { allowed() {
return build.isExperimentSelection && !m.isShipMode && m.fieldUpgrades[m.fieldMode].name !== "negative mass field" return build.isExperimentSelection && !m.isShipMode && m.fieldUpgrades[m.fieldMode].name !== "negative mass field" && !tech.isFireNotMove
}, },
requires: "", requires: "",
effect() { effect() {

View File

@@ -1,8 +1,5 @@
******************************************************** NEXT PATCH ******************************************************** ******************************************************** NEXT PATCH ********************************************************
apomixis spawns 8 bosses (up from 4)
foam gun now charges up until you release the fire button
******************************************************** BUGS ******************************************************** ******************************************************** BUGS ********************************************************
@@ -36,7 +33,8 @@ fix door.isOpen actually meaning isClosed?
******************************************************** TODO ******************************************************** ******************************************************** TODO ********************************************************
edit foam gun text edit foam gun text?
add a foam charge meter would be nice
apply the new gun.do functions to other guns apply the new gun.do functions to other guns
rail gun rail gun