This commit is contained in:
landgreen
2021-04-24 06:42:43 -07:00
parent c7c025244e
commit f6d02d579f
4 changed files with 58 additions and 44 deletions

View File

@@ -21,41 +21,8 @@ const b = {
},
fire() {},
fireNormal() {
if (input.fire && m.fireCDcycle < m.cycle && (!input.field || m.fieldFire) && b.inventory.length) {
if (b.guns[b.activeGun].ammo > 0) {
b.fireWithAmmo()
} else {
b.outOfAmmo()
}
if (m.holdingTarget) m.drop();
}
b.guns[b.activeGun].do();
},
fireNotMove() { //added && player.speed < 0.5 && m.onGround
if (input.fire && m.fireCDcycle < m.cycle && (!input.field || m.fieldFire) && b.inventory.length && player.speed < 0.5 && m.onGround && Math.abs(m.yOff - m.yOffGoal) < 1) {
if (b.guns[b.activeGun].ammo > 0) {
b.fireWithAmmo()
} else {
b.outOfAmmo()
}
if (m.holdingTarget) m.drop();
}
b.guns[b.activeGun].do();
},
fireNotMoveAlwaysFire() { //added && player.speed < 0.5 && m.onGround //removed input.fire && (!input.field || m.fieldFire)
if (m.fireCDcycle < m.cycle && b.inventory.length && player.speed < 0.5 && m.onGround && Math.abs(m.yOff - m.yOffGoal) < 1) {
if (b.guns[b.activeGun].ammo > 0) {
b.fireWithAmmo()
} else {
b.outOfAmmo()
}
if (m.holdingTarget) m.drop();
}
b.guns[b.activeGun].do();
},
fireFloat() { //added && player.speed < 0.5 && m.onGround
if (input.fire && (!input.field || m.fieldFire) && b.inventory.length) {
if (m.fireCDcycle < m.cycle) {
if (b.inventory.length) {
if (input.fire && m.fireCDcycle < m.cycle && (!input.field || m.fieldFire)) {
if (b.guns[b.activeGun].ammo > 0) {
b.fireWithAmmo()
} else {
@@ -63,14 +30,55 @@ const b = {
}
if (m.holdingTarget) m.drop();
}
Matter.Body.setVelocity(player, {
x: 0,
y: -55 * player.mass * simulation.g //undo gravity before it is added
});
player.force.x = 0
player.force.y = 0
b.guns[b.activeGun].do();
}
},
fireNotMove() { //added && player.speed < 0.5 && m.onGround
if (b.inventory.length) {
if (input.fire && m.fireCDcycle < m.cycle && (!input.field || m.fieldFire) && player.speed < 0.5 && m.onGround && Math.abs(m.yOff - m.yOffGoal) < 1) {
if (b.guns[b.activeGun].ammo > 0) {
b.fireWithAmmo()
} else {
b.outOfAmmo()
}
if (m.holdingTarget) m.drop();
}
b.guns[b.activeGun].do();
}
},
fireNotMoveAlwaysFire() { //added && player.speed < 0.5 && m.onGround //removed input.fire && (!input.field || m.fieldFire)
if (b.inventory.length) {
if (m.fireCDcycle < m.cycle && player.speed < 0.5 && m.onGround && Math.abs(m.yOff - m.yOffGoal) < 1) {
if (b.guns[b.activeGun].ammo > 0) {
b.fireWithAmmo()
} else {
b.outOfAmmo()
}
if (m.holdingTarget) m.drop();
}
b.guns[b.activeGun].do();
}
},
fireFloat() { //added && player.speed < 0.5 && m.onGround
if (b.inventory.length) {
if (input.fire && (!input.field || m.fieldFire)) {
if (m.fireCDcycle < m.cycle) {
if (b.guns[b.activeGun].ammo > 0) {
b.fireWithAmmo()
} else {
b.outOfAmmo()
}
if (m.holdingTarget) m.drop();
}
Matter.Body.setVelocity(player, {
x: 0,
y: -55 * player.mass * simulation.g //undo gravity before it is added
});
player.force.x = 0
player.force.y = 0
}
b.guns[b.activeGun].do();
}
b.guns[b.activeGun].do();
},
fireWithAmmo() { //triggers after firing when you have ammo
b.guns[b.activeGun].fire();
@@ -110,13 +118,13 @@ const b = {
gun = options[Math.floor(Math.random() * options.length)]
}
if (gun === "all") {
b.activeGun = 0;
b.inventoryGun = 0;
for (let i = 0; i < b.guns.length; i++) {
b.inventory[i] = i;
b.guns[i].have = true;
b.guns[i].ammo = Math.floor(b.guns[i].ammoPack * ammoPacks);
}
b.activeGun = 0;
} else {
if (isNaN(gun)) { //find gun by name
let found = false;
@@ -3193,6 +3201,7 @@ const b = {
this.fire = this.fireNormal
}
},
do() {},
fire() {
},

View File

@@ -4368,7 +4368,7 @@
//**************************************************
{
name: "bremsstrahlung",
description: "<strong>blocking</strong> with <strong>standing wave harmonics</strong><br> does <strong class='color-d'>damage</strong> to mobs",
description: "<strong>blocking</strong> does <strong class='color-d'>damage</strong> to mobs",
isFieldTech: true,
maxCount: 9,
count: 0,