nail balance, difficulty ramp scaling

mod: rail road ties - nails are 40% bigger
This commit is contained in:
landgreen
2020-08-30 13:15:34 -07:00
parent 00859f15ed
commit a0db3ffa12
5 changed files with 51 additions and 33 deletions

View File

@@ -972,13 +972,15 @@ const b = {
}, },
nail(pos, velocity, dmg = 0) { nail(pos, velocity, dmg = 0) {
const me = bullet.length; const me = bullet.length;
bullet[me] = Bodies.rectangle(pos.x, pos.y, 25, 2, b.fireAttributes(Math.atan2(velocity.y, velocity.x))); // bullet[me] = Bodies.rectangle(pos.x, pos.y, 25, 2, b.fireAttributes(Math.atan2(velocity.y, velocity.x)));
bullet[me] = Bodies.rectangle(pos.x, pos.y, 25 * mod.biggerNails, 2 * mod.biggerNails, b.fireAttributes(Math.atan2(velocity.y, velocity.x)));
Matter.Body.setVelocity(bullet[me], velocity); Matter.Body.setVelocity(bullet[me], velocity);
World.add(engine.world, bullet[me]); //add bullet to world World.add(engine.world, bullet[me]); //add bullet to world
bullet[me].endCycle = game.cycle + 60 + 18 * Math.random(); bullet[me].endCycle = game.cycle + 60 + 18 * Math.random();
bullet[me].dmg = dmg bullet[me].dmg = dmg
bullet[me].onDmg = function (who) { bullet[me].onDmg = function (who) {
if (mod.isNailPoison) mobs.statusDoT(who, dmg * 0.15, 180) // one tick every 30 cycles if (mod.isNailPoison) mobs.statusDoT(who, dmg * 0.22, 120) // one tick every 30 cycles
}; };
bullet[me].do = function () {}; bullet[me].do = function () {};
}, },
@@ -1550,7 +1552,7 @@ const b = {
CD = 2 CD = 2
} else { } else {
if (this.nextFireCycle + 1 < mech.cycle) this.startingHoldCycle = mech.cycle //reset if not constantly firing if (this.nextFireCycle + 1 < mech.cycle) this.startingHoldCycle = mech.cycle //reset if not constantly firing
CD = Math.max(5 - 0.06 * (mech.cycle - this.startingHoldCycle), 2) //CD scales with cycles fire is held down CD = Math.max(7.5 - 0.06 * (mech.cycle - this.startingHoldCycle), 2) //CD scales with cycles fire is held down
this.nextFireCycle = mech.cycle + CD * b.fireCD //predict next fire cycle if the fire button is held down this.nextFireCycle = mech.cycle + CD * b.fireCD //predict next fire cycle if the fire button is held down
} }
} else { } else {
@@ -1560,19 +1562,21 @@ const b = {
} }
mech.fireCDcycle = mech.cycle + Math.floor(CD * b.fireCD); // cool down mech.fireCDcycle = mech.cycle + Math.floor(CD * b.fireCD); // cool down
const speed = 28 + 8 * Math.random() + 6 * mod.nailInstantFireRate const speed = 28 + 7 * Math.random() + 9 * mod.nailInstantFireRate
const angle = mech.angle + (Math.random() - 0.5) * (Math.random() - 0.5) * (mech.crouch ? 1.35 : 3.2) / CD const angle = mech.angle + (Math.random() - 0.5) * (Math.random() - 0.5) * (mech.crouch ? 1.35 : 3.2) / CD
const dmg = 0.9
b.nail({ b.nail({
x: mech.pos.x + 23 * Math.cos(mech.angle), x: mech.pos.x + 30 * Math.cos(mech.angle),
y: mech.pos.y + 23 * Math.sin(mech.angle) y: mech.pos.y + 30 * Math.sin(mech.angle)
}, { }, {
x: mech.Vx / 2 + speed * Math.cos(angle), x: mech.Vx / 2 + speed * Math.cos(angle),
y: mech.Vy / 2 + speed * Math.sin(angle) y: mech.Vy / 2 + speed * Math.sin(angle)
}, 0.9) //position, velocity, damage }, dmg) //position, velocity, damage
if (mod.isIceCrystals) { if (mod.isIceCrystals) {
bullet[bullet.length - 1].onDmg = function (who) { bullet[bullet.length - 1].onDmg = function (who) {
mobs.statusSlow(who, 30) mobs.statusSlow(who, 30)
if (mod.isNailPoison) mobs.statusDoT(who, dmg * 0.22, 120) // one tick every 30 cycles
}; };
mech.energy -= mech.fieldRegen + 0.008 mech.energy -= mech.fieldRegen + 0.008
if (mech.energy < 0.02) mech.fireCDcycle = mech.cycle + 60; // cool down if (mech.energy < 0.02) mech.fireCDcycle = mech.cycle + 60; // cool down
@@ -1736,7 +1740,7 @@ const b = {
}, },
{ {
name: "flechettes", name: "flechettes",
description: "fire a volley of <strong class='color-p'>uranium-235</strong> <strong>needles</strong><br>does <strong class='color-d'>damage</strong> over <strong>3</strong> seconds", description: "fire a volley of <strong class='color-p'>uranium-235</strong> <strong>needles</strong><br>does <strong class='color-p'>radioactive</strong> <strong class='color-d'>damage</strong> over <strong>3</strong> seconds",
ammo: 0, ammo: 0,
ammoPack: 45, ammoPack: 45,
defaultAmmoPack: 45, defaultAmmoPack: 45,

View File

@@ -1869,7 +1869,7 @@ const level = {
// spawn.mapRect(-1950, -400, 100, 25); // spawn.mapRect(-1950, -400, 100, 25);
spawn.mapRect(-3150, 50, 775, 100); spawn.mapRect(-3150, 50, 775, 100);
spawn.mapRect(-2600, -250, 775, 100); spawn.mapRect(-2600, -250, 775, 100);
spawn.bodyRect(-1350, -100, 100, 100, 1, spawn.propsSlide); //weight spawn.bodyRect(-1450, -125, 125, 125, 1, spawn.propsSlide); //weight
spawn.bodyRect(-1800, 0, 300, 100, 1, spawn.propsHoist); //hoist spawn.bodyRect(-1800, 0, 300, 100, 1, spawn.propsHoist); //hoist
cons[cons.length] = Constraint.create({ cons[cons.length] = Constraint.create({
pointA: { pointA: {
@@ -1881,7 +1881,7 @@ const level = {
length: 1 length: 1
}); });
spawn.bodyRect(400, 500, 100, 100, 1, spawn.propsSlide); //weight spawn.bodyRect(600, 525, 125, 125, 1, spawn.propsSlide); //weight
spawn.bodyRect(800, 600, 300, 100, 1, spawn.propsHoist); //hoist spawn.bodyRect(800, 600, 300, 100, 1, spawn.propsHoist); //hoist
cons[cons.length] = Constraint.create({ cons[cons.length] = Constraint.create({
pointA: { pointA: {
@@ -2496,7 +2496,7 @@ const level = {
spawn.mapRect(-400, -2000, 3700, 250); //Ground spawn.mapRect(-400, -2000, 3700, 250); //Ground
spawn.mapRect(2475, -1150, 1225, 250); spawn.mapRect(2475, -1150, 1225, 250);
spawn.mapRect(500, -1150, 1175, 250); //Ground level 3 spawn.mapRect(500, -1150, 1175, 250); //Ground level 3
spawn.mapRect(350, -180, 4450, 1255); // Last ground spawn.mapRect(350, -180, 4600, 1255); // Last ground
spawn.mapRect(-400, -458, 750, 3337); //mur left sous-sol spawn.mapRect(-400, -458, 750, 3337); //mur left sous-sol
spawn.mapRect(-2850, -3375, 5300, 1375); spawn.mapRect(-2850, -3375, 5300, 1375);
spawn.mapRect(-2850, -4200, 8000, 825); spawn.mapRect(-2850, -4200, 8000, 825);
@@ -3171,9 +3171,9 @@ const level = {
game.difficulty++ game.difficulty++
game.dmgScale += 0.3; //damage done by mobs increases each level game.dmgScale += 0.3; //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.027 //mob acceleration increases each level if (game.accelScale < 5) game.accelScale *= 1.027 //mob acceleration increases each level
game.lookFreqScale *= 0.975 //mob cycles between looks decreases each level if (game.lookFreqScale > 0.2) game.lookFreqScale *= 0.975 //mob cycles between looks decreases each level
game.CDScale *= 0.966 //mob CD time decreases each level if (game.CDScale > 0.2) game.CDScale *= 0.966 //mob CD time decreases each level
} }
game.healScale = 1 / (1 + game.difficulty * 0.07) //a higher denominator makes for lower heals // mech.health += heal * game.healScale; game.healScale = 1 / (1 + game.difficulty * 0.07) //a higher denominator makes for lower heals // mech.health += heal * game.healScale;
}, },
@@ -3183,9 +3183,9 @@ const level = {
game.dmgScale -= 0.3; //damage done by mobs increases each level game.dmgScale -= 0.3; //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.027 //mob acceleration increases each level if (game.accelScale > 0.2) game.accelScale /= 1.027 //mob acceleration increases each level
game.lookFreqScale /= 0.975 //mob cycles between looks decreases each level if (game.lookFreqScale < 5) game.lookFreqScale /= 0.975 //mob cycles between looks decreases each level
game.CDScale /= 0.966 //mob CD time decreases each level if (game.CDScale < 5) game.CDScale /= 0.966 //mob CD time decreases each level
} }
if (game.difficulty < 1) game.difficulty = 0; if (game.difficulty < 1) game.difficulty = 0;
game.healScale = 1 / (1 + game.difficulty * 0.07) game.healScale = 1 / (1 + game.difficulty * 0.07)
@@ -3215,6 +3215,8 @@ const level = {
if (level.onLevel > level.levels.length - 1) level.onLevel = 0; if (level.onLevel > level.levels.length - 1) level.onLevel = 0;
level.difficultyIncrease(game.difficultyMode) //increase difficulty based on modes level.difficultyIncrease(game.difficultyMode) //increase difficulty based on modes
if (level.levelsCleared > level.levels.length) level.difficultyIncrease(game.difficultyMode) if (level.levelsCleared > level.levels.length) level.difficultyIncrease(game.difficultyMode)
if (level.levelsCleared > level.levels.length * 1.5) level.difficultyIncrease(game.difficultyMode)
if (level.levelsCleared > level.levels.length * 2) level.difficultyIncrease(game.difficultyMode)
if (game.isEasyMode && level.levelsCleared % 2) level.difficultyDecrease(1); if (game.isEasyMode && level.levelsCleared % 2) level.difficultyDecrease(1);
game.clearNow = true; //triggers in game.clearMap to remove all physics bodies and setup for new map game.clearNow = true; //triggers in game.clearMap to remove all physics bodies and setup for new map
}, },

View File

@@ -1372,7 +1372,7 @@ const mod = {
}, },
{ {
name: "pneumatic actuator", name: "pneumatic actuator",
description: "<strong>nail gun</strong> takes <strong>50%</strong> less time to ramp up<br>to it's shortest <strong>delay</strong> after firing", description: "<strong>nail gun</strong> takes <strong>45%</strong> less time to ramp up<br>to it's shortest <strong>delay</strong> after firing",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -1388,7 +1388,7 @@ const mod = {
}, },
{ {
name: "powder-actuated", name: "powder-actuated",
description: "<strong>nail gun</strong> takes <strong>no</strong> time to ramp up<br>nails have a <strong>20%</strong> faster muzzle <strong>speed</strong>", description: "<strong>nail gun</strong> takes <strong>no</strong> time to ramp up<br>nails have a <strong>30%</strong> faster muzzle <strong>speed</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -1529,7 +1529,7 @@ const mod = {
}, },
{ {
name: "super sized", name: "super sized",
description: `your <strong>super balls</strong> are <strong>22%</strong> larger<br>increased mass and physical <strong class='color-d'>damage</strong>`, description: `your <strong>super balls</strong> are <strong>22%</strong> larger<br>increases mass and physical <strong class='color-d'>damage</strong>`,
count: 0, count: 0,
maxCount: 9, maxCount: 9,
allowed() { allowed() {
@@ -1855,11 +1855,11 @@ const mod = {
}, },
{ {
name: "irradiated nails", name: "irradiated nails",
description: "<strong>nails</strong> are made with a <strong class='color-p'>cobalt-60</strong> alloy<br><strong>66%</strong> extra <strong class='color-d'>damage</strong> over <strong>6</strong> seconds", description: "<strong>nails</strong> are made with a <strong class='color-p'>cobalt-60</strong> alloy<br><strong>85%</strong> <strong class='color-p'>radioactive</strong> <strong class='color-d'>damage</strong> over <strong>2</strong> seconds",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
return mod.nailBotCount + mod.grenadeFragments + mod.nailsDeathMob / 2 + (mod.haveGunCheck("mine") + mod.isRailNails + mod.isNailShot + (mod.haveGunCheck("nail gun") && !mod.isIceCrystals)) * 2 > 1 return mod.nailBotCount + mod.grenadeFragments + mod.nailsDeathMob / 2 + (mod.haveGunCheck("mine") + mod.isRailNails + mod.isNailShot + mod.haveGunCheck("nail gun")) * 2 > 1
}, },
requires: "nails", requires: "nails",
effect() { effect() {
@@ -1869,6 +1869,22 @@ const mod = {
mod.isNailPoison = false; mod.isNailPoison = false;
} }
}, },
{
name: "railroad ties",
description: "<strong>nails</strong> are <strong>80%</strong> <strong>larger</strong><br>increases physical <strong class='color-d'>damage</strong> by about <strong>25%</strong>",
maxCount: 1,
count: 0,
allowed() {
return mod.nailBotCount + mod.grenadeFragments + mod.nailsDeathMob / 2 + (mod.haveGunCheck("mine") + mod.isRailNails + mod.isNailShot + mod.haveGunCheck("nail gun")) * 2 > 1
},
requires: "nails",
effect() {
mod.biggerNails += 0.8
},
remove() {
mod.biggerNails = 1
}
},
{ {
name: "mycelial fragmentation", name: "mycelial fragmentation",
description: "<strong class='color-p' style='letter-spacing: 2px;'>sporangium</strong> release an extra <strong class='color-p' style='letter-spacing: 2px;'>spore</strong><br> once a <strong>second</strong> during their <strong>growth</strong> phase", description: "<strong class='color-p' style='letter-spacing: 2px;'>sporangium</strong> release an extra <strong class='color-p' style='letter-spacing: 2px;'>spore</strong><br> once a <strong>second</strong> during their <strong>growth</strong> phase",

View File

@@ -303,7 +303,7 @@ const mech = {
} }
if (mod.isDeterminism) totalMods -= 3 //remove the bonus mods if (mod.isDeterminism) totalMods -= 3 //remove the bonus mods
if (mod.isSuperDeterminism) totalMods -= 2 //remove the bonus mods if (mod.isSuperDeterminism) totalMods -= 2 //remove the bonus mods
totalMods = totalMods * 1.15 + 1 // a few extra to make it stronger
const totalGuns = b.inventory.length //count guns const totalGuns = b.inventory.length //count guns
function randomizeMods() { function randomizeMods() {

View File

@@ -1,16 +1,11 @@
zoom now only works in testing mode with keys: i / o mod: rail road ties - nails are 40% bigger
minigun is now nailgun (higher damage, lower ammo)
mod: pneumatic actuator - nail gun's ramp up time is 50% shorter
mod: powder-actuated - removes ramp up time and increases nail speed
removed mod depleted uranium
mod: super size - larger super balls
************** TODO - n-gon ************** ************** TODO - n-gon **************
mod: railroad ties - nails are larger and do more damage map element - player rotates a rotor that makes a platform go up or down
reduce damage by 80%, but lose ammo when you get hit
foam needs a new mod foam needs a new mod
is the foam mod colloidal foam fun? is the foam mod colloidal foam fun?
@@ -28,7 +23,8 @@ getting stuck above a mob can immobilize player
use mac automator to speed up your n-gon -> git sync use mac automator to speed up your n-gon -> git sync
considering removing the perfect diamagnetism field from the game considering removing the perfect diamagnetism field from the game
perfect diamagnetism be able to grab and launch mobs or just rework perfect diamagnetism
perfect diamagnetism be able to grab and launch mobs
Gun: Launch yourself at high speed to the enemy, gaining temporary invincibility while in the air and for 3 seconds after landing. Upon impact, trigger a large explosion. Gun: Launch yourself at high speed to the enemy, gaining temporary invincibility while in the air and for 3 seconds after landing. Upon impact, trigger a large explosion.