rebalancing why
This commit is contained in:
@@ -101,7 +101,7 @@
|
|||||||
<option value="0">easy</option>
|
<option value="0">easy</option>
|
||||||
<option value="1" selected>normal</option>
|
<option value="1" selected>normal</option>
|
||||||
<option value="2">hard</option>
|
<option value="2">hard</option>
|
||||||
<option value="6">why...</option>
|
<option value="4">why...</option>
|
||||||
</select>
|
</select>
|
||||||
<br>
|
<br>
|
||||||
<label for="body-damage" title="allow damage from the ground and large fast moving blocks">collision damage from blocks:</label>
|
<label for="body-damage" title="allow damage from the ground and large fast moving blocks">collision damage from blocks:</label>
|
||||||
|
|||||||
@@ -257,7 +257,7 @@ const b = {
|
|||||||
},
|
},
|
||||||
effect() {
|
effect() {
|
||||||
b.isModDroneOnDamage = true;
|
b.isModDroneOnDamage = true;
|
||||||
for (let i = 0; i < 3; i++) {
|
for (let i = 0; i < 4; i++) {
|
||||||
b.drone() //spawn drone
|
b.drone() //spawn drone
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -696,7 +696,7 @@ const b = {
|
|||||||
if (!b.isModImmuneExplosion && mech.fieldMeter > 0.1) {
|
if (!b.isModImmuneExplosion && mech.fieldMeter > 0.1) {
|
||||||
mech.damage(radius * 0.0002);
|
mech.damage(radius * 0.0002);
|
||||||
} else {
|
} else {
|
||||||
mech.fieldMeter -= radius * 0.0006
|
mech.fieldMeter -= Math.max(radius * 0.0006, 0.1)
|
||||||
}
|
}
|
||||||
knock = Vector.mult(Vector.normalise(sub), -Math.sqrt(dmg) * player.mass / 30);
|
knock = Vector.mult(Vector.normalise(sub), -Math.sqrt(dmg) * player.mass / 30);
|
||||||
player.force.x += knock.x;
|
player.force.x += knock.x;
|
||||||
@@ -1305,34 +1305,33 @@ const b = {
|
|||||||
name: "shotgun", //1
|
name: "shotgun", //1
|
||||||
description: "fire a <strong>burst</strong> of short range bullets<br><em>crouch to reduce recoil</em>",
|
description: "fire a <strong>burst</strong> of short range bullets<br><em>crouch to reduce recoil</em>",
|
||||||
ammo: 0,
|
ammo: 0,
|
||||||
ammoPack: 6,
|
ammoPack: 8,
|
||||||
have: false,
|
have: false,
|
||||||
isStarterGun: true,
|
isStarterGun: true,
|
||||||
fire() {
|
fire() {
|
||||||
mech.fireCDcycle = mech.cycle + Math.floor((mech.crouch ? 50 : 35) * b.modFireRate); // cool down
|
mech.fireCDcycle = mech.cycle + Math.floor((mech.crouch ? 55 : 30) * b.modFireRate); // cool down
|
||||||
|
|
||||||
b.muzzleFlash(35);
|
b.muzzleFlash(35);
|
||||||
// mobs.alert(650);
|
// mobs.alert(650);
|
||||||
const side = 11 * b.modBulletSize
|
const side = 13 * b.modBulletSize
|
||||||
for (let i = 0; i < 9; i++) {
|
for (let i = 0; i < 11; i++) {
|
||||||
const me = bullet.length;
|
const me = bullet.length;
|
||||||
const dir = mech.angle + (Math.random() - 0.5) * (mech.crouch ? 0.22 : 0.7)
|
const dir = mech.angle + (Math.random() - 0.5) * (mech.crouch ? 0.35 : 1.1)
|
||||||
bullet[me] = Bodies.rectangle(mech.pos.x + 35 * Math.cos(mech.angle) + 15 * (Math.random() - 0.5), mech.pos.y + 35 * Math.sin(mech.angle) + 15 * (Math.random() - 0.5), side, side, b.fireAttributes(dir));
|
bullet[me] = Bodies.rectangle(mech.pos.x + 35 * Math.cos(mech.angle) + 15 * (Math.random() - 0.5), mech.pos.y + 35 * Math.sin(mech.angle) + 15 * (Math.random() - 0.5), side, side, b.fireAttributes(dir));
|
||||||
World.add(engine.world, bullet[me]); //add bullet to world
|
World.add(engine.world, bullet[me]); //add bullet to world
|
||||||
const SPEED = 40 + Math.random() * 11
|
const SPEED = 50 + Math.random() * 10
|
||||||
Matter.Body.setVelocity(bullet[me], {
|
Matter.Body.setVelocity(bullet[me], {
|
||||||
x: SPEED * Math.cos(dir),
|
x: SPEED * Math.cos(dir),
|
||||||
y: SPEED * Math.sin(dir)
|
y: SPEED * Math.sin(dir)
|
||||||
});
|
});
|
||||||
bullet[me].endCycle = game.cycle + 55
|
bullet[me].endCycle = game.cycle + 55
|
||||||
bullet[me].frictionAir = 0.03;
|
bullet[me].frictionAir = 0.04;
|
||||||
bullet[me].do = function () {
|
bullet[me].do = function () {
|
||||||
this.force.y += this.mass * 0.001;
|
this.force.y += this.mass * 0.001;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//knock back
|
//knock back
|
||||||
const KNOCK = ((mech.crouch) ? 0.013 : 0.15) * b.modBulletSize * b.modBulletSize
|
const KNOCK = ((mech.crouch) ? 0.01 : 0.08) * b.modBulletSize * b.modBulletSize
|
||||||
player.force.x -= KNOCK * Math.cos(mech.angle)
|
player.force.x -= KNOCK * Math.cos(mech.angle)
|
||||||
player.force.y -= KNOCK * Math.sin(mech.angle) * 0.3 //reduce knock back in vertical direction to stop super jumps
|
player.force.y -= KNOCK * Math.sin(mech.angle) * 0.3 //reduce knock back in vertical direction to stop super jumps
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -465,6 +465,7 @@ const game = {
|
|||||||
game.difficultyMode = 1
|
game.difficultyMode = 1
|
||||||
level.difficultyDecrease(6); //if this stops being -6 change in build.calculateCustomDifficulty()
|
level.difficultyDecrease(6); //if this stops being -6 change in build.calculateCustomDifficulty()
|
||||||
}
|
}
|
||||||
|
if (game.difficultyMode === 4) level.difficultyIncrease(6)
|
||||||
|
|
||||||
game.clearNow = true;
|
game.clearNow = true;
|
||||||
document.getElementById("text-log").style.opacity = 0;
|
document.getElementById("text-log").style.opacity = 0;
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
/* TODO: *******************************************
|
/* TODO: *******************************************
|
||||||
*****************************************************
|
*****************************************************
|
||||||
|
|
||||||
|
mod: bullets neutralize forward mob velocity on hit
|
||||||
|
|
||||||
boss: bacteria boss, duplicates when player is in range
|
boss: bacteria boss, duplicates when player is in range
|
||||||
|
|
||||||
mod: remove all guns from the game, but double health, shields, and damage
|
mod: remove all guns from the game, but double health, shields, and damage
|
||||||
@@ -327,7 +329,11 @@ const build = {
|
|||||||
spawn.setSpawnList(); //gives random mobs, not starter
|
spawn.setSpawnList(); //gives random mobs, not starter
|
||||||
game.startGame();
|
game.startGame();
|
||||||
let difficulty = build.list.length * game.difficultyMode - 1
|
let difficulty = build.list.length * game.difficultyMode - 1
|
||||||
if (game.difficultyMode === 0) difficulty = build.list.length * 1 - 6 - 1
|
if (game.difficultyMode === 0) {
|
||||||
|
difficulty = build.list.length * 1 - 6 - 1
|
||||||
|
game.isEasyMode = true;
|
||||||
|
}
|
||||||
|
if (game.difficultyMode === 4) level.difficultyIncrease(6)
|
||||||
level.difficultyIncrease(difficulty)
|
level.difficultyIncrease(difficulty)
|
||||||
|
|
||||||
level.isBuildRun = true;
|
level.isBuildRun = true;
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ const level = {
|
|||||||
// if (level.isBuildRun) num++
|
// if (level.isBuildRun) num++
|
||||||
for (let i = 0; i < num; i++) {
|
for (let i = 0; i < num; i++) {
|
||||||
game.difficulty++
|
game.difficulty++
|
||||||
game.dmgScale += 0.135; //damage done by mobs increases each level
|
game.dmgScale += 0.11; //damage done by mobs increases each level
|
||||||
b.dmgScale *= 0.93; //damage done by player decreases each level
|
b.dmgScale *= 0.93; //damage done by player decreases each level
|
||||||
game.accelScale *= 1.02 //mob acceleration increases each level
|
game.accelScale *= 1.02 //mob acceleration increases each level
|
||||||
game.lookFreqScale *= 0.98 //mob cycles between looks decreases each level
|
game.lookFreqScale *= 0.98 //mob cycles between looks decreases each level
|
||||||
@@ -61,7 +61,7 @@ const level = {
|
|||||||
difficultyDecrease(num = 1) { //used in easy mode for game.reset()
|
difficultyDecrease(num = 1) { //used in easy mode for game.reset()
|
||||||
for (let i = 0; i < num; i++) {
|
for (let i = 0; i < num; i++) {
|
||||||
game.difficulty--
|
game.difficulty--
|
||||||
game.dmgScale -= 0.135; //damage done by mobs increases each level
|
game.dmgScale -= 0.11; //damage done by mobs increases each level
|
||||||
if (game.dmgScale < 0.1) game.dmgScale = 0.1;
|
if (game.dmgScale < 0.1) game.dmgScale = 0.1;
|
||||||
b.dmgScale /= 0.93; //damage done by player decreases each level
|
b.dmgScale /= 0.93; //damage done by player decreases each level
|
||||||
game.accelScale /= 1.02 //mob acceleration increases each level
|
game.accelScale /= 1.02 //mob acceleration increases each level
|
||||||
|
|||||||
@@ -474,7 +474,7 @@ const mech = {
|
|||||||
|
|
||||||
//chance to build a drone on damage from mod
|
//chance to build a drone on damage from mod
|
||||||
if (b.isModDroneOnDamage) {
|
if (b.isModDroneOnDamage) {
|
||||||
const len = (dmg - 0.08 + 0.05 * Math.random()) / 0.05
|
const len = (dmg - 0.06 + 0.07 * Math.random()) / 0.05
|
||||||
for (let i = 0; i < len; i++) {
|
for (let i = 0; i < len; i++) {
|
||||||
if (Math.random() < 0.6) b.drone() //spawn drone
|
if (Math.random() < 0.6) b.drone() //spawn drone
|
||||||
}
|
}
|
||||||
|
|||||||
13
js/spawn.js
13
js/spawn.js
@@ -160,7 +160,7 @@ const spawn = {
|
|||||||
me.frictionAir = 0.012
|
me.frictionAir = 0.012
|
||||||
me.seePlayerFreq = Math.floor(11 + 7 * Math.random())
|
me.seePlayerFreq = Math.floor(11 + 7 * Math.random())
|
||||||
me.seeAtDistance2 = 1400000;
|
me.seeAtDistance2 = 1400000;
|
||||||
me.cellMassMax = 80
|
me.cellMassMax = 70
|
||||||
|
|
||||||
me.collisionFilter.mask = cat.player | cat.bullet
|
me.collisionFilter.mask = cat.player | cat.bullet
|
||||||
Matter.Body.setDensity(me, 0.0005) // normal density is 0.001 // this reduces life by half and decreases knockback
|
Matter.Body.setDensity(me, 0.0005) // normal density is 0.001 // this reduces life by half and decreases knockback
|
||||||
@@ -504,8 +504,11 @@ const spawn = {
|
|||||||
|
|
||||||
//when player is inside event horizon
|
//when player is inside event horizon
|
||||||
if (Vector.magnitude(Vector.sub(this.position, player.position)) < eventHorizon && !mech.isStealth) {
|
if (Vector.magnitude(Vector.sub(this.position, player.position)) < eventHorizon && !mech.isStealth) {
|
||||||
mech.damage(0.00015 * game.dmgScale);
|
if (mech.fieldMeter > 0.1) {
|
||||||
if (mech.fieldMeter > 0.1) mech.fieldMeter -= 0.0045
|
mech.fieldMeter -= 0.005
|
||||||
|
} else {
|
||||||
|
mech.damage(0.0002 * game.dmgScale);
|
||||||
|
}
|
||||||
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);
|
||||||
@@ -600,7 +603,7 @@ const spawn = {
|
|||||||
//when player is inside event horizon
|
//when player is inside event horizon
|
||||||
if (Vector.magnitude(Vector.sub(this.position, player.position)) < eventHorizon && !mech.isStealth) {
|
if (Vector.magnitude(Vector.sub(this.position, player.position)) < eventHorizon && !mech.isStealth) {
|
||||||
if (mech.fieldMeter > 0.1) {
|
if (mech.fieldMeter > 0.1) {
|
||||||
mech.fieldMeter -= 0.0055
|
mech.fieldMeter -= 0.0075
|
||||||
} else {
|
} else {
|
||||||
mech.damage(0.0003 * game.dmgScale);
|
mech.damage(0.0003 * game.dmgScale);
|
||||||
}
|
}
|
||||||
@@ -1235,7 +1238,7 @@ const spawn = {
|
|||||||
this.attraction();
|
this.attraction();
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
shield(target, x, y, chance = Math.min(0.01 + game.difficulty * 0.01, 0.3)) {
|
shield(target, x, y, chance = Math.min(0.02 + game.difficulty * 0.005, 0.2)) {
|
||||||
if (this.allowShields && Math.random() < chance) {
|
if (this.allowShields && Math.random() < chance) {
|
||||||
mobs.spawn(x, y, 9, target.radius + 30, "rgba(220,220,255,0.9)");
|
mobs.spawn(x, y, 9, target.radius + 30, "rgba(220,220,255,0.9)");
|
||||||
let me = mob[mob.length - 1];
|
let me = mob[mob.length - 1];
|
||||||
|
|||||||
Reference in New Issue
Block a user