less gun mods when you have many guns
This commit is contained in:
69
js/mods.js
69
js/mods.js
@@ -63,6 +63,15 @@ const mod = {
|
|||||||
|
|
||||||
// },
|
// },
|
||||||
haveGunCheck(name) {
|
haveGunCheck(name) {
|
||||||
|
if (
|
||||||
|
!build.isCustomSelection &&
|
||||||
|
b.inventory.length > 2 &&
|
||||||
|
name !== b.guns[b.activeGun].name &&
|
||||||
|
Math.random() < -0.1 + 0.1 * (b.inventory.length + mod.isGunCycle * 2) //lower chance of mods specific to a gun if you have lots of guns
|
||||||
|
) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0, len = b.inventory.length; i < len; i++) {
|
for (i = 0, len = b.inventory.length; i < len; i++) {
|
||||||
if (b.guns[b.inventory[i]].name === name) return true
|
if (b.guns[b.inventory[i]].name === name) return true
|
||||||
}
|
}
|
||||||
@@ -70,7 +79,7 @@ const mod = {
|
|||||||
},
|
},
|
||||||
damageFromMods() {
|
damageFromMods() {
|
||||||
let dmg = 1
|
let dmg = 1
|
||||||
if (mod.isDamageForGuns) dmg *= 1 + 0.07 * b.inventory.length
|
if (mod.isDamageForGuns) dmg *= 1 + 0.066 * b.inventory.length
|
||||||
if (mod.isLowHealthDmg) dmg *= 1 + 0.5 * Math.max(0, 1 - mech.health)
|
if (mod.isLowHealthDmg) dmg *= 1 + 0.5 * Math.max(0, 1 - mech.health)
|
||||||
if (mod.isHarmDamage && mech.lastHarmCycle + 600 > mech.cycle) dmg *= 2;
|
if (mod.isHarmDamage && mech.lastHarmCycle + 600 > mech.cycle) dmg *= 2;
|
||||||
if (mod.isEnergyLoss) dmg *= 1.33;
|
if (mod.isEnergyLoss) dmg *= 1.33;
|
||||||
@@ -751,32 +760,6 @@ const mod = {
|
|||||||
mod.isHarmFreeze = false;
|
mod.isHarmFreeze = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "entanglement",
|
|
||||||
nameInfo: "<span id = 'mod-entanglement'></span>",
|
|
||||||
addNameInfo() {
|
|
||||||
setTimeout(function () {
|
|
||||||
game.boldActiveGunHUD();
|
|
||||||
}, 1000);
|
|
||||||
},
|
|
||||||
description: "while your <strong>first gun</strong> is equipped<br>reduce <strong class='color-harm'>harm</strong> by <strong>13%</strong> for each of your <strong class='color-g'>guns</strong>",
|
|
||||||
maxCount: 1,
|
|
||||||
count: 0,
|
|
||||||
allowed() {
|
|
||||||
return b.inventory.length > 1 && !mod.isEnergyHealth
|
|
||||||
},
|
|
||||||
requires: "at least 2 guns",
|
|
||||||
effect() {
|
|
||||||
mod.isEntanglement = true
|
|
||||||
setTimeout(function () {
|
|
||||||
game.boldActiveGunHUD();
|
|
||||||
}, 1000);
|
|
||||||
|
|
||||||
},
|
|
||||||
remove() {
|
|
||||||
mod.isEntanglement = false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: "piezoelectricity",
|
name: "piezoelectricity",
|
||||||
description: "<strong>colliding</strong> with mobs fills your <strong class='color-f'>energy</strong><br><strong>15%</strong> less <strong class='color-harm'>harm</strong> from mob collisions",
|
description: "<strong>colliding</strong> with mobs fills your <strong class='color-f'>energy</strong><br><strong>15%</strong> less <strong class='color-harm'>harm</strong> from mob collisions",
|
||||||
@@ -1057,9 +1040,35 @@ const mod = {
|
|||||||
mod.bayesian = 0;
|
mod.bayesian = 0;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "entanglement",
|
||||||
|
nameInfo: "<span id = 'mod-entanglement'></span>",
|
||||||
|
addNameInfo() {
|
||||||
|
setTimeout(function () {
|
||||||
|
game.boldActiveGunHUD();
|
||||||
|
}, 1000);
|
||||||
|
},
|
||||||
|
description: "while your <strong>first</strong> <strong class='color-g'>gun</strong> is equipped<br>reduce <strong class='color-harm'>harm</strong> by <strong>13%</strong> for each of your <strong class='color-g'>guns</strong>",
|
||||||
|
maxCount: 1,
|
||||||
|
count: 0,
|
||||||
|
allowed() {
|
||||||
|
return b.inventory.length > 1 && !mod.isEnergyHealth
|
||||||
|
},
|
||||||
|
requires: "at least 2 guns",
|
||||||
|
effect() {
|
||||||
|
mod.isEntanglement = true
|
||||||
|
setTimeout(function () {
|
||||||
|
game.boldActiveGunHUD();
|
||||||
|
}, 1000);
|
||||||
|
|
||||||
|
},
|
||||||
|
remove() {
|
||||||
|
mod.isEntanglement = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "arsenal",
|
name: "arsenal",
|
||||||
description: "increase <strong class='color-d'>damage</strong> by <strong>7%</strong><br>for each <strong class='color-g'>gun</strong> in your inventory",
|
description: "increase <strong class='color-d'>damage</strong> by <strong>6.6%</strong><br>for each <strong class='color-g'>gun</strong> in your inventory",
|
||||||
maxCount: 1,
|
maxCount: 1,
|
||||||
count: 0,
|
count: 0,
|
||||||
allowed() {
|
allowed() {
|
||||||
@@ -1075,7 +1084,7 @@ const mod = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "generalist",
|
name: "generalist",
|
||||||
description: "<strong>spawn</strong> 3 <strong class='color-g'>gun</strong>, but you can't <strong>switch</strong> <strong class='color-g'>guns</strong><br>automatically cycle <strong class='color-g'>guns</strong> with each new level",
|
description: "<strong>spawn</strong> 5 <strong class='color-g'>guns</strong>, but you can't <strong>switch</strong> <strong class='color-g'>guns</strong><br><strong class='color-g'>guns</strong> cycle automatically with each new level",
|
||||||
maxCount: 1,
|
maxCount: 1,
|
||||||
count: 0,
|
count: 0,
|
||||||
isNonRefundable: true,
|
isNonRefundable: true,
|
||||||
@@ -1085,7 +1094,7 @@ const mod = {
|
|||||||
requires: "arsenal",
|
requires: "arsenal",
|
||||||
effect() {
|
effect() {
|
||||||
mod.isGunCycle = true;
|
mod.isGunCycle = true;
|
||||||
for (let i = 0; i < 3; i++) {
|
for (let i = 0; i < 5; i++) {
|
||||||
powerUps.spawn(mech.pos.x, mech.pos.y, "gun");
|
powerUps.spawn(mech.pos.x, mech.pos.y, "gun");
|
||||||
if (Math.random() < mod.bayesian) powerUps.spawn(mech.pos.x, mech.pos.y, "gun");
|
if (Math.random() < mod.bayesian) powerUps.spawn(mech.pos.x, mech.pos.y, "gun");
|
||||||
}
|
}
|
||||||
|
|||||||
11
todo.txt
11
todo.txt
@@ -1,14 +1,7 @@
|
|||||||
In the first 4 levels: added a much higher chance of getting a second gun
|
|
||||||
or extra ammo if you don't get a second gun
|
|
||||||
|
|
||||||
mod - arsenal: +7% damage for each gun in your inventory
|
|
||||||
|
|
||||||
mod- generalist: spawn 2 guns, but you can't switch guns
|
|
||||||
at the start of each level switch guns
|
|
||||||
requires arsenal
|
|
||||||
|
|
||||||
************** TODO - n-gon **************
|
************** TODO - n-gon **************
|
||||||
|
|
||||||
|
Mod: "Instant Acceleration": Minigun instantly starts firing at max fire rate, skipping the accelerated fire rate stage.
|
||||||
|
|
||||||
level Boss: fractal Sierpiński triangle
|
level Boss: fractal Sierpiński triangle
|
||||||
https://en.wikipedia.org/wiki/Sierpi%C5%84ski_triangle
|
https://en.wikipedia.org/wiki/Sierpi%C5%84ski_triangle
|
||||||
spawns a 1/2 size version of the boss, this version can also spawn a smaller version, but it is capped at some size level
|
spawns a 1/2 size version of the boss, this version can also spawn a smaller version, but it is capped at some size level
|
||||||
|
|||||||
Reference in New Issue
Block a user