bug fixes and balance

This commit is contained in:
landgreen
2020-01-06 04:49:00 -08:00
parent b9bd15aac8
commit cd4d75acdc
3 changed files with 32 additions and 35 deletions

View File

@@ -363,7 +363,7 @@ const b = {
}
}
},
bulletActions() {
bulletActions() { //run in main loop
//remove bullet if at end cycle for that bullet
let i = bullet.length;
while (i--) {
@@ -961,7 +961,7 @@ const b = {
name: "shotgun", //1
description: "fire a <strong>burst</strong> of short range bullets<br><em>crouch to reduce recoil</em>",
ammo: 0,
ammoPack: 5,
ammoPack: 6,
have: false,
isStarterGun: true,
fire() {
@@ -997,7 +997,7 @@ const b = {
name: "super balls", //2
description: "fire <strong>five</strong> balls in a wide arc<br>balls <strong>bounce</strong> with no momentum loss",
ammo: 0,
ammoPack: 4,
ammoPack: 5,
have: false,
isStarterGun: true,
fire() {
@@ -1069,7 +1069,7 @@ const b = {
name: "wave beam", //4
description: "emit a <strong>sine wave</strong> of oscillating particles<br>particles propagate through <strong>walls</strong>",
ammo: 0,
ammoPack: 30,
ammoPack: 32,
have: false,
isStarterGun: true,
fire() {
@@ -1084,7 +1084,7 @@ const b = {
inertia: Infinity,
frictionAir: 0,
minDmgSpeed: 0,
dmg: 0.2, //damage done in addition to the damage from momentum
dmg: 0.3, //damage done in addition to the damage from momentum
classType: "bullet",
collisionFilter: {
category: cat.bullet,
@@ -1420,7 +1420,7 @@ const b = {
name: "flak", //7
description: "fire a cluster of short range projectiles<br><strong class='color-e'>explodes</strong> on contact or after half a second",
ammo: 0,
ammoPack: 5,
ammoPack: 6,
have: false,
isStarterGun: true,
fire() {
@@ -1473,10 +1473,9 @@ const b = {
bullet[me].totalCycles = 100;
bullet[me].endCycle = game.cycle + Math.floor(mech.crouch ? 120 : 80);
bullet[me].restitution = 0.5;
bullet[me].explodeRad = 290;
bullet[me].explodeRad = 310;
bullet[me].onEnd = b.explode; //makes bullet do explosive damage before despawn
bullet[me].minDmgSpeed = 1;
Matter.Body.setDensity(bullet[me], 0.0002);
bullet[me].onDmg = function () {
this.endCycle = 0; //bullet ends cycle after doing damage //this also triggers explosion
};
@@ -1598,7 +1597,7 @@ const b = {
name: "ferro frag", //10
description: "fire a <strong>grenade</strong> that ejects nails<br>nails are magnetically <strong>attracted</strong> to enemies",
ammo: 0,
ammoPack: 3,
ammoPack: 4,
have: false,
isStarterGun: false,
fire() {
@@ -1713,7 +1712,7 @@ const b = {
name: "drones", //12
description: "deploy drones that <strong>crash</strong> into enemies<br>collisions reduce drone <strong>cycles</strong> by 1 second",
ammo: 0,
ammoPack: 5,
ammoPack: 8,
have: false,
isStarterGun: true,
fire() {

View File

@@ -849,7 +849,6 @@ const level = {
spawn.bodyRect(1425, -1110, 115, 25, 0.9); //block on far left building
spawn.bodyRect(1540, -1110, 300, 25, 0.9); //block on far left building
if (game.difficulty > 2) spawn.shooterBoss(2200, -1300);
spawn.randomSmallMob(1300, -70);
spawn.randomSmallMob(3200, -100);
spawn.randomSmallMob(4450, -100);
@@ -867,6 +866,7 @@ const level = {
spawn.randomMob(-100, -900, -0.2);
spawn.randomBoss(3700, -1500, 0.4);
spawn.randomBoss(1700, -900, 0.4);
if (game.difficulty > 3) spawn.shooterBoss(2200, -1300);
},
highrise() {
level.defaultZoom = 1500
@@ -1009,8 +1009,6 @@ const level = {
spawn.bodyRect(-3570, -1800, 50, 50);
spawn.bodyRect(-2970, -2250, 50, 50);
if (game.difficulty < 4) spawn.bodyRect(-3760, -2400, 50, 50);
spawn.bodyRect(-3080, -2250, 40, 40);
spawn.bodyRect(-3420, -650, 50, 50);
@@ -1045,6 +1043,7 @@ const level = {
spawn.randomMob(-550, -100, -0.1);
spawn.randomBoss(-3250, -2700, 0.2);
spawn.randomBoss(-2450, -1100, 0);
if (game.difficulty < 4) spawn.bodyRect(-3760, -2400, 50, 50);
},
warehouse() {
level.defaultZoom = 1300
@@ -1344,8 +1343,24 @@ const level = {
spawn.mapRect(3000, -2000 * 0.25, 2000 - 300, 50); //1st floor
spawn.spawnStairs(3000 + 2000 - 50, 0, 4, 250, 350, true); //stairs ground
// tether ball
if (game.difficulty > 2) {
spawn.randomSmallMob(4575, -560, 1);
spawn.randomSmallMob(1315, -880, 1);
spawn.randomSmallMob(800, -600);
spawn.randomSmallMob(-100, -1600);
spawn.randomMob(4100, -225, 0.8);
spawn.randomMob(-250, -700, 0.8);
spawn.randomMob(4500, -225, 0.15);
spawn.randomMob(3250, -225, 0.15);
spawn.randomMob(-100, -225, 0.1);
spawn.randomMob(1150, -225, 0.15);
spawn.randomMob(2000, -225, 0.15);
spawn.randomMob(450, -225, 0.15);
spawn.randomMob(100, -1200, 1);
spawn.randomMob(950, -1150, -0.1);
spawn.randomBoss(1800, -800, -0.2);
spawn.randomBoss(4150, -1000, 0.6);
if (game.difficulty > 2) { // tether ball
level.fillBG.push({
x: 2495,
y: -500,
@@ -1365,23 +1380,6 @@ const level = {
//chance to spawn a ring of exploding mobs around this boss
if (game.difficulty > 4) spawn.nodeBoss(2850, -80, "spawns", 8, 20, 105);
}
spawn.randomSmallMob(4575, -560, 1);
spawn.randomSmallMob(1315, -880, 1);
spawn.randomSmallMob(800, -600);
spawn.randomSmallMob(-100, -1600);
spawn.randomMob(4100, -225, 0.8);
spawn.randomMob(-250, -700, 0.8);
spawn.randomMob(4500, -225, 0.15);
spawn.randomMob(3250, -225, 0.15);
spawn.randomMob(-100, -225, 0.1);
spawn.randomMob(1150, -225, 0.15);
spawn.randomMob(2000, -225, 0.15);
spawn.randomMob(450, -225, 0.15);
spawn.randomMob(100, -1200, 1);
spawn.randomMob(950, -1150, -0.1);
spawn.randomBoss(1800, -800, -0.2);
spawn.randomBoss(4150, -1000, 0.6);
},
//*****************************************************************************************************************
//*****************************************************************************************************************

View File

@@ -79,7 +79,7 @@ const powerUps = {
mech.fieldMeter = mech.fieldEnergyMax;
if (!game.lastLogTime) game.makeTextLog("<span style='font-size:115%;'><span class='color-f'>+energy</span></span>", 300);
} else {
let ammo = Math.ceil((target.ammoPack * (1 + 0.05 * Math.random())));
let ammo = Math.ceil((target.ammoPack * (1 + 0.1 * Math.random())));
if (level.isBuildRun) ammo = Math.floor(ammo * 1.1) //extra ammo on build run because no ammo from getting a new gun
target.ammo += ammo;
game.updateGunHUD();
@@ -207,7 +207,7 @@ const powerUps = {
game.makeTextLog("<span style='font-size:110%;'>+" + ammo + " ammo for " + b.guns[ammoTarget].name + "</span>", 300);
},
spawnRandomPowerUp(x, y) { //mostly used after mob dies
if (Math.random() * Math.random() - 0.25 > Math.sqrt(mech.health) || Math.random() < 0.04) { //spawn heal chance is higher at low health
if (Math.random() * Math.random() - 0.3 > Math.sqrt(mech.health) || Math.random() < 0.035) { //spawn heal chance is higher at low health
powerUps.spawn(x, y, "heal");
if (Math.random() < b.isModBayesian) powerUps.spawn(x, y, "heal");
return;
@@ -222,7 +222,7 @@ const powerUps = {
if (Math.random() < b.isModBayesian) powerUps.spawn(x, y, "gun");
return;
}
if (Math.random() < 0.0031 * (10 - b.modCount)) { //a new mod has a low chance for each not acquired mod up to 7
if (Math.random() < 0.0032 * (10 - b.modCount)) { //a new mod has a low chance for each not acquired mod up to 7
powerUps.spawn(x, y, "mod");
if (Math.random() < b.isModBayesian) powerUps.spawn(x, y, "mod");
return;