minor balance changes
This commit is contained in:
@@ -735,7 +735,7 @@ const b = {
|
|||||||
bullet[me].charge = 0;
|
bullet[me].charge = 0;
|
||||||
bullet[me].do = function () {
|
bullet[me].do = function () {
|
||||||
if (this.isCharging) {
|
if (this.isCharging) {
|
||||||
if ((!game.mouseDown && this.charge > 0.4)) { //fire on mouse release
|
if ((!game.mouseDown && this.charge > 0.6)) { //fire on mouse release
|
||||||
this.isCharging = false
|
this.isCharging = false
|
||||||
mech.fireCDcycle = mech.cycle + 2; // set fire cool down
|
mech.fireCDcycle = mech.cycle + 2; // set fire cool down
|
||||||
Matter.Body.scale(this, 8000, 8000) // show the bullet by scaling it up (don't judge me... I know this is a bad way to do it)
|
Matter.Body.scale(this, 8000, 8000) // show the bullet by scaling it up (don't judge me... I know this is a bad way to do it)
|
||||||
|
|||||||
@@ -405,7 +405,7 @@ const game = {
|
|||||||
addGravity(body, game.g);
|
addGravity(body, game.g);
|
||||||
player.force.y += player.mass * mech.gravity;
|
player.force.y += player.mass * mech.gravity;
|
||||||
},
|
},
|
||||||
reset() {
|
reset() { //run on first run, and each later run after you die
|
||||||
b.inventory = []; //removes guns and ammo
|
b.inventory = []; //removes guns and ammo
|
||||||
for (let i = 0, len = b.guns.length; i < len; ++i) {
|
for (let i = 0, len = b.guns.length; i < len; ++i) {
|
||||||
b.guns[i].have = false;
|
b.guns[i].have = false;
|
||||||
|
|||||||
95
js/level.js
95
js/level.js
@@ -14,7 +14,6 @@ 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(5)
|
|
||||||
// b.giveGuns(1)
|
// b.giveGuns(1)
|
||||||
// mech.fieldUpgrades[2].effect();
|
// mech.fieldUpgrades[2].effect();
|
||||||
// b.giveMod(13)
|
// b.giveMod(13)
|
||||||
@@ -38,95 +37,8 @@ const level = {
|
|||||||
game.draw.setPaths();
|
game.draw.setPaths();
|
||||||
},
|
},
|
||||||
isBuildRun: false,
|
isBuildRun: false,
|
||||||
builds: [ // choose 5 total: guns, mods, and field
|
|
||||||
() => {
|
|
||||||
mech.fieldUpgrades[2].effect();
|
|
||||||
b.giveMod(5)
|
|
||||||
b.giveMod(12)
|
|
||||||
b.giveMod(15)
|
|
||||||
b.giveMod(18)
|
|
||||||
game.replaceTextLog = true;
|
|
||||||
game.makeTextLog("<h2>build: wild melee</h2>", 300);
|
|
||||||
},
|
|
||||||
() => {
|
|
||||||
b.giveGuns(13)
|
|
||||||
// mech.fieldUpgrades[5].effect();
|
|
||||||
b.giveMod(7)
|
|
||||||
b.giveMod(16)
|
|
||||||
b.giveMod(17)
|
|
||||||
game.replaceTextLog = true;
|
|
||||||
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)
|
|
||||||
mech.fieldUpgrades[4].effect();
|
|
||||||
b.giveMod(4)
|
|
||||||
b.giveMod(5)
|
|
||||||
b.giveMod(19)
|
|
||||||
game.replaceTextLog = true;
|
|
||||||
game.makeTextLog("<h2>build: anti-air</h2>", 300);
|
|
||||||
},
|
|
||||||
() => {
|
|
||||||
b.giveMod(6)
|
|
||||||
b.giveMod(7)
|
|
||||||
b.giveMod(12)
|
|
||||||
b.giveMod(13)
|
|
||||||
b.giveMod(14)
|
|
||||||
game.replaceTextLog = true;
|
|
||||||
game.makeTextLog("<h2>build: fastball</h2>", 300);
|
|
||||||
},
|
|
||||||
() => {
|
|
||||||
b.giveGuns(5)
|
|
||||||
mech.fieldUpgrades[6].effect();
|
|
||||||
b.giveMod(1)
|
|
||||||
b.giveMod(8)
|
|
||||||
b.giveMod(15)
|
|
||||||
game.replaceTextLog = true;
|
|
||||||
game.makeTextLog("<h2>build: stealth</h2>", 300);
|
|
||||||
},
|
|
||||||
() => {
|
|
||||||
b.giveGuns(2)
|
|
||||||
mech.fieldUpgrades[1].effect();
|
|
||||||
b.giveMod(8)
|
|
||||||
b.giveMod(9)
|
|
||||||
b.giveMod(11)
|
|
||||||
game.replaceTextLog = true;
|
|
||||||
game.makeTextLog("<h2>build: time out</h2>", 300);
|
|
||||||
},
|
|
||||||
() => {
|
|
||||||
b.giveGuns(0)
|
|
||||||
mech.fieldUpgrades[5].effect();
|
|
||||||
b.giveMod(7)
|
|
||||||
b.giveMod(5)
|
|
||||||
b.giveMod(18)
|
|
||||||
game.replaceTextLog = true;
|
|
||||||
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) {
|
|
||||||
level.builds[build]()
|
|
||||||
game.difficulty = 6;
|
|
||||||
level.isBuildRun = true
|
|
||||||
},
|
|
||||||
difficultyIncrease(num = 1) {
|
difficultyIncrease(num = 1) {
|
||||||
|
// if (level.isBuildRun) num++
|
||||||
for (let i = 0; i < num; i++) {
|
for (let i = 0; i < num; i++) {
|
||||||
game.dmgScale += 0.2; //damage done by mobs increases each level
|
game.dmgScale += 0.2; //damage done by mobs increases each level
|
||||||
b.dmgScale *= 0.95; //damage done by player decreases each level
|
b.dmgScale *= 0.95; //damage done by player decreases each level
|
||||||
@@ -1558,7 +1470,10 @@ const level = {
|
|||||||
//enter when player isn't falling
|
//enter when player isn't falling
|
||||||
if (player.velocity.y < 0.1) {
|
if (player.velocity.y < 0.1) {
|
||||||
game.difficulty++;
|
game.difficulty++;
|
||||||
if (game.difficulty > 1) level.difficultyIncrease()
|
if (game.difficulty > 1) {
|
||||||
|
level.difficultyIncrease()
|
||||||
|
if (level.isBuildRun) level.difficultyIncrease()
|
||||||
|
}
|
||||||
//cycles map to next level
|
//cycles map to next level
|
||||||
level.levelsCleared++;
|
level.levelsCleared++;
|
||||||
level.onLevel++;
|
level.onLevel++;
|
||||||
|
|||||||
@@ -898,9 +898,7 @@ const mobs = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
damage(dmg) {
|
damage(dmg) {
|
||||||
console.log(dmg, "before")
|
|
||||||
dmg /= Math.sqrt(this.mass)
|
dmg /= Math.sqrt(this.mass)
|
||||||
console.log(dmg, "after")
|
|
||||||
if (b.isModLowHealthDmg) dmg *= (3 / (2 + mech.health)) //up to 50% dmg at zero player health
|
if (b.isModLowHealthDmg) dmg *= (3 / (2 + mech.health)) //up to 50% dmg at zero player health
|
||||||
if (b.isModFarAwayDmg) dmg *= 1 + Math.sqrt(Math.max(1000, Math.min(3500, this.distanceToPlayer())) - 1000) * 0.01 //up to 50% dmg at max range of 3500
|
if (b.isModFarAwayDmg) dmg *= 1 + Math.sqrt(Math.max(1000, Math.min(3500, this.distanceToPlayer())) - 1000) * 0.01 //up to 50% dmg at max range of 3500
|
||||||
if (dmg !== Infinity) {
|
if (dmg !== Infinity) {
|
||||||
@@ -909,7 +907,7 @@ const mobs = {
|
|||||||
}
|
}
|
||||||
this.health -= dmg
|
this.health -= dmg
|
||||||
//this.fill = this.color + this.health + ')';
|
//this.fill = this.color + this.health + ')';
|
||||||
if (this.health < 0.01) this.death();
|
if (this.health < 0.05) this.death();
|
||||||
this.onDamage(this); //custom damage effects
|
this.onDamage(this); //custom damage effects
|
||||||
},
|
},
|
||||||
onDamage() {
|
onDamage() {
|
||||||
|
|||||||
Reference in New Issue
Block a user