diff --git a/js/bullets.js b/js/bullets.js index eedebab..673d39e 100644 --- a/js/bullets.js +++ b/js/bullets.js @@ -100,7 +100,7 @@ const b = { }, { name: "ceramic plating", - description: "immune to explosions and enemy fields", + description: "immune to explosions
immune to enemy field effects", have: false, //5 effect: () => { b.isModAoEImmunity = true; //good for guns with explosions @@ -167,6 +167,7 @@ const b = { description: "healing power ups bring you to full health", have: false, //13 effect: () => { // good with ablative synthesis, melee builds + b.isModFullHeal = true } }, { @@ -174,7 +175,6 @@ const b = { description: "launch blocks at much higher speeds
carry more massive blocks", have: false, //14 effect: () => { // good with guns that run out of ammo - b.isModFullHeal = true mech.throwChargeRate = 4; mech.throwChargeMax = 150; mech.holdingMassScale = 0.05; //can hold heavier blocks with lower cost to jumping @@ -200,7 +200,7 @@ const b = { }, { name: "kinetic bombardment", - description: "do extra damage from farther away
up to 50% increase at about 30 steps away", + description: "do extra damage from a distance
up to 50% increase at about 30 steps away", have: false, //17 effect: () => { // good with annihilation, melee builds b.isModFarAwayDmg = true; //used in mob.damage() @@ -224,7 +224,7 @@ const b = { }, { name: "monogamy", - description: "equipping your first gun reduces damage taken
scales by 7% for each gun in your inventory", + description: "using your first gun reduces damage taken
scales by 7% for each gun in your inventory", have: false, //20 effect: () => { // good with long term planning b.isModMonogamy = true @@ -1563,9 +1563,9 @@ const b = { friction: 0.05, frictionAir: 0.0005, restitution: 1, - dmg: 0.14 + b.modExtraDmg, //damage done in addition to the damage from momentum - lookFrequency: 79 + Math.floor(37 * Math.random()), - endCycle: game.cycle + Math.floor((960 + 360 * Math.random()) * b.isModBulletsLastLonger), + dmg: 0.13 + b.modExtraDmg, //damage done in addition to the damage from momentum + lookFrequency: 83 + Math.floor(41 * Math.random()), + endCycle: game.cycle + Math.floor((900 + 360 * Math.random()) * b.isModBulletsLastLonger), classType: "bullet", collisionFilter: { category: 0x000100, @@ -1641,7 +1641,7 @@ const b = { } } }) - b.fireProps(mech.crouch ? 19 : 15, mech.crouch ? 35 : 1, dir, me); //cd , speed + b.fireProps(mech.crouch ? 14 : 10, mech.crouch ? 40 : 1, dir, me); //cd , speed b.drawOneBullet(bullet[me].vertices); } }, diff --git a/js/level.js b/js/level.js index 2bbd2fc..04c00dd 100644 --- a/js/level.js +++ b/js/level.js @@ -14,10 +14,10 @@ const level = { start() { if (level.levelsCleared === 0) { // game.difficulty = 6; //for testing to simulate possible mobs spawns - // level.startBuildRun(6) + // level.startBuildRun(2) // b.giveGuns(11) // mech.fieldUpgrades[2].effect(); - // b.giveMod(20) + // b.giveMod(13) // spawn.pickList = ["ghoster", "ghoster"] this.intro(); //starting level @@ -41,30 +41,39 @@ const level = { builds: [ // choose 5 total: guns, mods, and field () => { mech.fieldUpgrades[2].effect(); - b.giveMod(6) - b.giveMod(8) - b.giveMod(9) + b.giveMod(5) + b.giveMod(12) b.giveMod(15) + b.giveMod(18) game.replaceTextLog = true; - game.makeTextLog("

build: melee

", 300); + game.makeTextLog("

build: wild melee

", 300); }, () => { b.giveGuns(13) - mech.fieldUpgrades[5].effect(); - b.giveMod(8) - b.giveMod(3) - b.giveMod(11) + // mech.fieldUpgrades[5].effect(); + b.giveMod(7) + b.giveMod(16) + b.giveMod(17) game.replaceTextLog = true; - game.makeTextLog("

build: drones

", 300); + game.makeTextLog("

build: hive master

zoom in and out with +/-", 300); + }, + () => { + // b.giveGuns(13) + mech.fieldUpgrades[5].effect(); + b.giveMod(6) + b.giveMod(8) + b.giveMod(9) + game.replaceTextLog = true; + game.makeTextLog("

build: drone close range

", 300); }, () => { b.giveGuns(8) mech.fieldUpgrades[4].effect(); b.giveMod(4) b.giveMod(5) - b.giveMod(16) + b.giveMod(19) game.replaceTextLog = true; - game.makeTextLog("

build: flak

", 300); + game.makeTextLog("

build: anti-air

", 300); }, () => { b.giveMod(6) @@ -73,7 +82,7 @@ const level = { b.giveMod(13) b.giveMod(14) game.replaceTextLog = true; - game.makeTextLog("

build: block thrower

", 300); + game.makeTextLog("

build: fastball

", 300); }, () => { b.giveGuns(5) @@ -82,7 +91,7 @@ const level = { b.giveMod(8) b.giveMod(15) game.replaceTextLog = true; - game.makeTextLog("

build: stealth shotgun

", 300); + game.makeTextLog("

build: stealth

", 300); }, () => { b.giveGuns(2) @@ -102,6 +111,15 @@ const level = { game.replaceTextLog = true; game.makeTextLog("

build: laser tag

", 300); }, + () => { + b.giveGuns(12) + mech.fieldUpgrades[6].effect(); + b.giveMod(3) + b.giveMod(6) + b.giveMod(7) + game.replaceTextLog = true; + game.makeTextLog("

build: phased spores

", 300); + }, ], startBuildRun(build) { level.builds[build]() diff --git a/js/mobs.js b/js/mobs.js index 6cfb686..122c697 100644 --- a/js/mobs.js +++ b/js/mobs.js @@ -234,19 +234,19 @@ const mobs = { if (!b.isModAoEImmunity) { mech.damage(0.0003 * game.dmgScale); if (mech.fieldMeter > 0.1) mech.fieldMeter -= 0.005 - } - ctx.beginPath(); - ctx.moveTo(this.position.x, this.position.y); - ctx.lineTo(mech.pos.x, mech.pos.y); - ctx.lineTo(mech.pos.x + (Math.random() - 0.5) * 3000, mech.pos.y + (Math.random() - 0.5) * 3000); - ctx.lineWidth = 2; - ctx.strokeStyle = "rgb(255,0,170)"; - ctx.stroke(); + ctx.beginPath(); + ctx.moveTo(this.position.x, this.position.y); + ctx.lineTo(mech.pos.x, mech.pos.y); + ctx.lineTo(mech.pos.x + (Math.random() - 0.5) * 3000, mech.pos.y + (Math.random() - 0.5) * 3000); + ctx.lineWidth = 2; + ctx.strokeStyle = "rgb(255,0,170)"; + ctx.stroke(); - ctx.beginPath(); - ctx.arc(mech.pos.x, mech.pos.y, 40, 0, 2 * Math.PI); - ctx.fillStyle = "rgba(255,0,170,0.15)"; - ctx.fill(); + ctx.beginPath(); + ctx.arc(mech.pos.x, mech.pos.y, 40, 0, 2 * Math.PI); + ctx.fillStyle = "rgba(255,0,170,0.15)"; + ctx.fill(); + } } ctx.beginPath(); ctx.arc(this.position.x, this.position.y, this.laserRange * 0.9, 0, 2 * Math.PI); diff --git a/js/player.js b/js/player.js index b1c061f..d825954 100644 --- a/js/player.js +++ b/js/player.js @@ -431,7 +431,7 @@ const mech = { }, addHealth(heal) { this.health += heal; - if (this.health > 1) this.health = 1; + if (this.health > 1 || b.isModFullHeal) this.health = 1; this.displayHealth(); }, defaultFPSCycle: 0, //tracks when to return to normal fps @@ -1445,6 +1445,7 @@ const mech = { if (mech.fieldMeter === 1) { mech.fieldMeter -= 0.43; b.guns[gunIndex].fire() //spawn drone + mech.fireCDcycle = mech.cycle + 25; // set fire cool down to prevent +energy from making huge numbers of drones } if (mech.isHolding) { mech.drawHold(mech.holdingTarget); diff --git a/js/spawn.js b/js/spawn.js index c09528b..78b1c3e 100644 --- a/js/spawn.js +++ b/js/spawn.js @@ -456,11 +456,9 @@ const spawn = { this.healthBar(); //when player is inside event horizon - if (Matter.Vector.magnitude(Matter.Vector.sub(this.position, player.position)) < eventHorizon) { - if (!b.isModAoEImmunity) { - mech.damage(0.00015 * game.dmgScale); - if (mech.fieldMeter > 0.1) mech.fieldMeter -= 0.01 - } + if (Matter.Vector.magnitude(Matter.Vector.sub(this.position, player.position)) < eventHorizon && !b.isModAoEImmunity) { + mech.damage(0.00015 * game.dmgScale); + if (mech.fieldMeter > 0.1) mech.fieldMeter -= 0.01 const angle = Math.atan2(player.position.y - this.position.y, player.position.x - this.position.x); player.force.x -= 1.25 * Math.cos(angle) * player.mass * game.g * (mech.onGround ? 1.8 : 1); player.force.y -= 0.96 * player.mass * game.g * Math.sin(angle); @@ -547,11 +545,9 @@ const spawn = { ctx.fillStyle = "rgba(0,0,0,0.05)"; ctx.fill(); //when player is inside event horizon - if (Matter.Vector.magnitude(Matter.Vector.sub(this.position, player.position)) < eventHorizon) { - if (!b.isModAoEImmunity) { - mech.damage(0.00015 * game.dmgScale); - if (mech.fieldMeter > 0.1) mech.fieldMeter -= 0.01 - } + if (Matter.Vector.magnitude(Matter.Vector.sub(this.position, player.position)) < eventHorizon && !b.isModAoEImmunity) { + mech.damage(0.00015 * game.dmgScale); + if (mech.fieldMeter > 0.1) mech.fieldMeter -= 0.01 const angle = Math.atan2(player.position.y - this.position.y, player.position.x - this.position.x); player.force.x -= 1.3 * Math.cos(angle) * player.mass * game.g * (mech.onGround ? 1.7 : 1); player.force.y -= 1.2 * Math.sin(angle) * player.mass * game.g;