builds, drone balance, recursive heal mod fixed

This commit is contained in:
landgreen
2019-12-02 05:24:43 -08:00
parent 65977ce5aa
commit 349a6cf211
5 changed files with 61 additions and 46 deletions

View File

@@ -100,7 +100,7 @@ const b = {
}, },
{ {
name: "ceramic plating", name: "ceramic plating",
description: "<strong>immune</strong> to <strong class='color-e'>explosions</strong> and enemy fields", description: "<strong>immune</strong> to <strong class='color-e'>explosions</strong><br> <strong>immune</strong> to enemy field effects",
have: false, //5 have: false, //5
effect: () => { effect: () => {
b.isModAoEImmunity = true; //good for guns with explosions b.isModAoEImmunity = true; //good for guns with explosions
@@ -167,6 +167,7 @@ const b = {
description: "<strong class='color-h'>healing</strong> power ups bring you to <strong>full health</strong>", description: "<strong class='color-h'>healing</strong> power ups bring you to <strong>full health</strong>",
have: false, //13 have: false, //13
effect: () => { // good with ablative synthesis, melee builds effect: () => { // good with ablative synthesis, melee builds
b.isModFullHeal = true
} }
}, },
{ {
@@ -174,7 +175,6 @@ const b = {
description: "<strong>launch blocks</strong> at much higher speeds<br>carry more massive blocks", description: "<strong>launch blocks</strong> at much higher speeds<br>carry more massive blocks",
have: false, //14 have: false, //14
effect: () => { // good with guns that run out of ammo effect: () => { // good with guns that run out of ammo
b.isModFullHeal = true
mech.throwChargeRate = 4; mech.throwChargeRate = 4;
mech.throwChargeMax = 150; mech.throwChargeMax = 150;
mech.holdingMassScale = 0.05; //can hold heavier blocks with lower cost to jumping mech.holdingMassScale = 0.05; //can hold heavier blocks with lower cost to jumping
@@ -200,7 +200,7 @@ const b = {
}, },
{ {
name: "kinetic bombardment", name: "kinetic bombardment",
description: "do extra <strong class='color-d'>damage</strong> from farther away<br><em>up to 50% increase at about 30 steps away</em>", description: "do extra <strong class='color-d'>damage</strong> from a distance<br><em>up to 50% increase at about 30 steps away</em>",
have: false, //17 have: false, //17
effect: () => { // good with annihilation, melee builds effect: () => { // good with annihilation, melee builds
b.isModFarAwayDmg = true; //used in mob.damage() b.isModFarAwayDmg = true; //used in mob.damage()
@@ -224,7 +224,7 @@ const b = {
}, },
{ {
name: "monogamy", name: "monogamy",
description: "equipping your first gun reduces <strong class='color-d'>damage</strong> taken<br>scales by <strong>7%</strong> for each gun in your inventory", description: "using your first gun reduces <strong class='color-d'>damage</strong> taken<br>scales by <strong>7%</strong> for each gun in your inventory",
have: false, //20 have: false, //20
effect: () => { // good with long term planning effect: () => { // good with long term planning
b.isModMonogamy = true b.isModMonogamy = true
@@ -1563,9 +1563,9 @@ const b = {
friction: 0.05, friction: 0.05,
frictionAir: 0.0005, frictionAir: 0.0005,
restitution: 1, restitution: 1,
dmg: 0.14 + b.modExtraDmg, //damage done in addition to the damage from momentum dmg: 0.13 + b.modExtraDmg, //damage done in addition to the damage from momentum
lookFrequency: 79 + Math.floor(37 * Math.random()), lookFrequency: 83 + Math.floor(41 * Math.random()),
endCycle: game.cycle + Math.floor((960 + 360 * Math.random()) * b.isModBulletsLastLonger), endCycle: game.cycle + Math.floor((900 + 360 * Math.random()) * b.isModBulletsLastLonger),
classType: "bullet", classType: "bullet",
collisionFilter: { collisionFilter: {
category: 0x000100, 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); b.drawOneBullet(bullet[me].vertices);
} }
}, },

View File

@@ -14,10 +14,10 @@ const level = {
start() { start() {
if (level.levelsCleared === 0) { if (level.levelsCleared === 0) {
// game.difficulty = 6; //for testing to simulate possible mobs spawns // game.difficulty = 6; //for testing to simulate possible mobs spawns
// level.startBuildRun(6) // level.startBuildRun(2)
// b.giveGuns(11) // b.giveGuns(11)
// mech.fieldUpgrades[2].effect(); // mech.fieldUpgrades[2].effect();
// b.giveMod(20) // b.giveMod(13)
// spawn.pickList = ["ghoster", "ghoster"] // spawn.pickList = ["ghoster", "ghoster"]
this.intro(); //starting level this.intro(); //starting level
@@ -41,30 +41,39 @@ const level = {
builds: [ // choose 5 total: guns, mods, and field builds: [ // choose 5 total: guns, mods, and field
() => { () => {
mech.fieldUpgrades[2].effect(); mech.fieldUpgrades[2].effect();
b.giveMod(6) b.giveMod(5)
b.giveMod(8) b.giveMod(12)
b.giveMod(9)
b.giveMod(15) b.giveMod(15)
b.giveMod(18)
game.replaceTextLog = true; game.replaceTextLog = true;
game.makeTextLog("<h2>build: melee</h2>", 300); game.makeTextLog("<h2>build: wild melee</h2>", 300);
}, },
() => { () => {
b.giveGuns(13) b.giveGuns(13)
mech.fieldUpgrades[5].effect(); // mech.fieldUpgrades[5].effect();
b.giveMod(8) b.giveMod(7)
b.giveMod(3) b.giveMod(16)
b.giveMod(11) b.giveMod(17)
game.replaceTextLog = true; game.replaceTextLog = true;
game.makeTextLog("<h2>build: drones</h2>", 300); game.makeTextLog("<h2>build: hive master</h2><em>zoom in and out with +/-</em>", 300);
},
() => {
// b.giveGuns(13)
mech.fieldUpgrades[5].effect();
b.giveMod(6)
b.giveMod(8)
b.giveMod(9)
game.replaceTextLog = true;
game.makeTextLog("<h2>build: drone close range</h2>", 300);
}, },
() => { () => {
b.giveGuns(8) b.giveGuns(8)
mech.fieldUpgrades[4].effect(); mech.fieldUpgrades[4].effect();
b.giveMod(4) b.giveMod(4)
b.giveMod(5) b.giveMod(5)
b.giveMod(16) b.giveMod(19)
game.replaceTextLog = true; game.replaceTextLog = true;
game.makeTextLog("<h2>build: flak</h2>", 300); game.makeTextLog("<h2>build: anti-air</h2>", 300);
}, },
() => { () => {
b.giveMod(6) b.giveMod(6)
@@ -73,7 +82,7 @@ const level = {
b.giveMod(13) b.giveMod(13)
b.giveMod(14) b.giveMod(14)
game.replaceTextLog = true; game.replaceTextLog = true;
game.makeTextLog("<h2>build: block thrower</h2>", 300); game.makeTextLog("<h2>build: fastball</h2>", 300);
}, },
() => { () => {
b.giveGuns(5) b.giveGuns(5)
@@ -82,7 +91,7 @@ const level = {
b.giveMod(8) b.giveMod(8)
b.giveMod(15) b.giveMod(15)
game.replaceTextLog = true; game.replaceTextLog = true;
game.makeTextLog("<h2>build: stealth shotgun</h2>", 300); game.makeTextLog("<h2>build: stealth</h2>", 300);
}, },
() => { () => {
b.giveGuns(2) b.giveGuns(2)
@@ -102,6 +111,15 @@ const level = {
game.replaceTextLog = true; game.replaceTextLog = true;
game.makeTextLog("<h2>build: laser tag</h2>", 300); game.makeTextLog("<h2>build: laser tag</h2>", 300);
}, },
() => {
b.giveGuns(12)
mech.fieldUpgrades[6].effect();
b.giveMod(3)
b.giveMod(6)
b.giveMod(7)
game.replaceTextLog = true;
game.makeTextLog("<h2>build: phased spores</h2>", 300);
},
], ],
startBuildRun(build) { startBuildRun(build) {
level.builds[build]() level.builds[build]()

View File

@@ -234,19 +234,19 @@ const mobs = {
if (!b.isModAoEImmunity) { if (!b.isModAoEImmunity) {
mech.damage(0.0003 * game.dmgScale); mech.damage(0.0003 * game.dmgScale);
if (mech.fieldMeter > 0.1) mech.fieldMeter -= 0.005 if (mech.fieldMeter > 0.1) mech.fieldMeter -= 0.005
} ctx.beginPath();
ctx.beginPath(); ctx.moveTo(this.position.x, this.position.y);
ctx.moveTo(this.position.x, this.position.y); ctx.lineTo(mech.pos.x, mech.pos.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.lineTo(mech.pos.x + (Math.random() - 0.5) * 3000, mech.pos.y + (Math.random() - 0.5) * 3000); ctx.lineWidth = 2;
ctx.lineWidth = 2; ctx.strokeStyle = "rgb(255,0,170)";
ctx.strokeStyle = "rgb(255,0,170)"; ctx.stroke();
ctx.stroke();
ctx.beginPath(); ctx.beginPath();
ctx.arc(mech.pos.x, mech.pos.y, 40, 0, 2 * Math.PI); ctx.arc(mech.pos.x, mech.pos.y, 40, 0, 2 * Math.PI);
ctx.fillStyle = "rgba(255,0,170,0.15)"; ctx.fillStyle = "rgba(255,0,170,0.15)";
ctx.fill(); ctx.fill();
}
} }
ctx.beginPath(); ctx.beginPath();
ctx.arc(this.position.x, this.position.y, this.laserRange * 0.9, 0, 2 * Math.PI); ctx.arc(this.position.x, this.position.y, this.laserRange * 0.9, 0, 2 * Math.PI);

View File

@@ -431,7 +431,7 @@ const mech = {
}, },
addHealth(heal) { addHealth(heal) {
this.health += heal; this.health += heal;
if (this.health > 1) this.health = 1; if (this.health > 1 || b.isModFullHeal) this.health = 1;
this.displayHealth(); this.displayHealth();
}, },
defaultFPSCycle: 0, //tracks when to return to normal fps defaultFPSCycle: 0, //tracks when to return to normal fps
@@ -1445,6 +1445,7 @@ const mech = {
if (mech.fieldMeter === 1) { if (mech.fieldMeter === 1) {
mech.fieldMeter -= 0.43; mech.fieldMeter -= 0.43;
b.guns[gunIndex].fire() //spawn drone 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) { if (mech.isHolding) {
mech.drawHold(mech.holdingTarget); mech.drawHold(mech.holdingTarget);

View File

@@ -456,11 +456,9 @@ const spawn = {
this.healthBar(); this.healthBar();
//when player is inside event horizon //when player is inside event horizon
if (Matter.Vector.magnitude(Matter.Vector.sub(this.position, player.position)) < eventHorizon) { if (Matter.Vector.magnitude(Matter.Vector.sub(this.position, player.position)) < eventHorizon && !b.isModAoEImmunity) {
if (!b.isModAoEImmunity) { mech.damage(0.00015 * game.dmgScale);
mech.damage(0.00015 * game.dmgScale); if (mech.fieldMeter > 0.1) mech.fieldMeter -= 0.01
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); 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.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); 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.fillStyle = "rgba(0,0,0,0.05)";
ctx.fill(); ctx.fill();
//when player is inside event horizon //when player is inside event horizon
if (Matter.Vector.magnitude(Matter.Vector.sub(this.position, player.position)) < eventHorizon) { if (Matter.Vector.magnitude(Matter.Vector.sub(this.position, player.position)) < eventHorizon && !b.isModAoEImmunity) {
if (!b.isModAoEImmunity) { mech.damage(0.00015 * game.dmgScale);
mech.damage(0.00015 * game.dmgScale); if (mech.fieldMeter > 0.1) mech.fieldMeter -= 0.01
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); 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.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; player.force.y -= 1.2 * Math.sin(angle) * player.mass * game.g;