diff --git a/.DS_Store b/.DS_Store index c44dc7c..20063e5 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/js/bullet.js b/js/bullet.js index 1a4a158..85167e2 100644 --- a/js/bullet.js +++ b/js/bullet.js @@ -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() { }, diff --git a/js/tech.js b/js/tech.js index 02e454e..e63d9c5 100644 --- a/js/tech.js +++ b/js/tech.js @@ -4368,7 +4368,7 @@ //************************************************** { name: "bremsstrahlung", - description: "blocking with standing wave harmonics
does damage to mobs", + description: "blocking does damage to mobs", isFieldTech: true, maxCount: 9, count: 0, diff --git a/todo.txt b/todo.txt index e711bc9..cae17fd 100644 --- a/todo.txt +++ b/todo.txt @@ -36,6 +36,11 @@ fix door.isOpen actually meaning isClosed? ******************************************************** TODO ******************************************************** +edit foam gun text + +apply the new gun.do functions to other guns + rail gun + tech plasma field - plasma field becomes an aoe damage field with the same radius 200% more energy drain, 100% more damage draw a square (or two) that rapidly spins