added allowed requirements for mod selection
This commit is contained in:
112
js/bullets.js
112
js/bullets.js
@@ -33,6 +33,7 @@ const b = {
|
|||||||
modCollisionImmuneCycles: null,
|
modCollisionImmuneCycles: null,
|
||||||
modBlockDmg: null,
|
modBlockDmg: null,
|
||||||
isModPiezo: null,
|
isModPiezo: null,
|
||||||
|
isModFastDrones: null,
|
||||||
setModDefaults() {
|
setModDefaults() {
|
||||||
b.modCount = 0;
|
b.modCount = 0;
|
||||||
b.modFireRate = 1;
|
b.modFireRate = 1;
|
||||||
@@ -44,6 +45,7 @@ const b = {
|
|||||||
b.modHealthDrain = 0;
|
b.modHealthDrain = 0;
|
||||||
b.modNoAmmo = 0;
|
b.modNoAmmo = 0;
|
||||||
b.isModBulletsLastLonger = 1;
|
b.isModBulletsLastLonger = 1;
|
||||||
|
b.isModFastDrones = false;
|
||||||
b.isModImmortal = false;
|
b.isModImmortal = false;
|
||||||
b.modSpores = 0;
|
b.modSpores = 0;
|
||||||
b.modAcidDmg = 0;
|
b.modAcidDmg = 0;
|
||||||
@@ -86,6 +88,9 @@ const b = {
|
|||||||
description: `your <strong>bullets</strong> are +13% larger<br>increased mass and physical <strong class='color-d'>damage</strong>`,
|
description: `your <strong>bullets</strong> are +13% larger<br>increased mass and physical <strong class='color-d'>damage</strong>`,
|
||||||
count: 0,
|
count: 0,
|
||||||
maxCount: 9,
|
maxCount: 9,
|
||||||
|
allowed() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
effect() {
|
effect() {
|
||||||
b.modBulletSize += 0.13
|
b.modBulletSize += 0.13
|
||||||
}
|
}
|
||||||
@@ -95,6 +100,9 @@ const b = {
|
|||||||
description: "each <strong>bullet</strong> does extra chemical <strong class='color-d'>damage</strong><br>only <strong>active</strong> when you are above <strong>90% health</strong>",
|
description: "each <strong>bullet</strong> does extra chemical <strong class='color-d'>damage</strong><br>only <strong>active</strong> when you are above <strong>90% health</strong>",
|
||||||
maxCount: 1,
|
maxCount: 1,
|
||||||
count: 0,
|
count: 0,
|
||||||
|
allowed() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
effect() {
|
effect() {
|
||||||
b.isModAcidDmg = true;
|
b.isModAcidDmg = true;
|
||||||
b.modOnHealthChange();
|
b.modOnHealthChange();
|
||||||
@@ -105,6 +113,9 @@ const b = {
|
|||||||
description: "<strong>5x</strong> physical <strong class='color-d'>damage</strong> to unaware enemies<br><em>unaware enemies don't have a health bar</em>",
|
description: "<strong>5x</strong> physical <strong class='color-d'>damage</strong> to unaware enemies<br><em>unaware enemies don't have a health bar</em>",
|
||||||
maxCount: 1,
|
maxCount: 1,
|
||||||
count: 0,
|
count: 0,
|
||||||
|
allowed() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
effect() {
|
effect() {
|
||||||
b.isModCrit = true;
|
b.isModCrit = true;
|
||||||
}
|
}
|
||||||
@@ -114,6 +125,9 @@ const b = {
|
|||||||
description: "do up to 33% more <strong class='color-d'>damage</strong> at a distance<br><em>increase maxes out at about 40 steps away</em>",
|
description: "do up to 33% more <strong class='color-d'>damage</strong> at a distance<br><em>increase maxes out at about 40 steps away</em>",
|
||||||
maxCount: 1,
|
maxCount: 1,
|
||||||
count: 0,
|
count: 0,
|
||||||
|
allowed() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
effect() {
|
effect() {
|
||||||
b.isModFarAwayDmg = true; //used in mob.damage()
|
b.isModFarAwayDmg = true; //used in mob.damage()
|
||||||
}
|
}
|
||||||
@@ -123,6 +137,9 @@ const b = {
|
|||||||
description: "do extra <strong class='color-d'>damage</strong> at low health<br><em>up to 50% increase when near death</em>",
|
description: "do extra <strong class='color-d'>damage</strong> at low health<br><em>up to 50% increase when near death</em>",
|
||||||
maxCount: 1,
|
maxCount: 1,
|
||||||
count: 0,
|
count: 0,
|
||||||
|
allowed() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
effect() {
|
effect() {
|
||||||
b.isModLowHealthDmg = true; //used in mob.damage()
|
b.isModLowHealthDmg = true; //used in mob.damage()
|
||||||
}
|
}
|
||||||
@@ -132,6 +149,9 @@ const b = {
|
|||||||
description: "the radius of <strong class='color-e'>explosions</strong> are +20% <strong>larger</strong><br>immune to <strong>harm</strong> from <strong class='color-e'>explosions</strong>",
|
description: "the radius of <strong class='color-e'>explosions</strong> are +20% <strong>larger</strong><br>immune to <strong>harm</strong> from <strong class='color-e'>explosions</strong>",
|
||||||
maxCount: 3,
|
maxCount: 3,
|
||||||
count: 0,
|
count: 0,
|
||||||
|
allowed() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
effect: () => {
|
effect: () => {
|
||||||
b.modExplosionRadius += 0.2;
|
b.modExplosionRadius += 0.2;
|
||||||
b.isModImmuneExplosion = true;
|
b.isModImmuneExplosion = true;
|
||||||
@@ -142,6 +162,9 @@ const b = {
|
|||||||
description: "your <strong>delay</strong> after firing is +14% <strong>shorter</strong>",
|
description: "your <strong>delay</strong> after firing is +14% <strong>shorter</strong>",
|
||||||
maxCount: 3,
|
maxCount: 3,
|
||||||
count: 0,
|
count: 0,
|
||||||
|
allowed() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
effect() {
|
effect() {
|
||||||
b.modFireRate *= 0.86
|
b.modFireRate *= 0.86
|
||||||
}
|
}
|
||||||
@@ -151,6 +174,9 @@ const b = {
|
|||||||
description: "use 50% less <strong>ammo</strong> when <strong>crouching</strong>",
|
description: "use 50% less <strong>ammo</strong> when <strong>crouching</strong>",
|
||||||
maxCount: 1,
|
maxCount: 1,
|
||||||
count: 0,
|
count: 0,
|
||||||
|
allowed() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
effect() {
|
effect() {
|
||||||
b.modNoAmmo = 1
|
b.modNoAmmo = 1
|
||||||
}
|
}
|
||||||
@@ -160,6 +186,9 @@ const b = {
|
|||||||
description: "your <strong>bullets</strong> last +33% <strong>longer</strong>",
|
description: "your <strong>bullets</strong> last +33% <strong>longer</strong>",
|
||||||
maxCount: 3,
|
maxCount: 3,
|
||||||
count: 0,
|
count: 0,
|
||||||
|
allowed() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
effect() {
|
effect() {
|
||||||
b.isModBulletsLastLonger += 0.33
|
b.isModBulletsLastLonger += 0.33
|
||||||
}
|
}
|
||||||
@@ -169,6 +198,9 @@ const b = {
|
|||||||
description: "enemies discharge <strong style='letter-spacing: 2px;'>spores</strong> on <strong>death</strong><br>+11% chance",
|
description: "enemies discharge <strong style='letter-spacing: 2px;'>spores</strong> on <strong>death</strong><br>+11% chance",
|
||||||
maxCount: 9,
|
maxCount: 9,
|
||||||
count: 0,
|
count: 0,
|
||||||
|
allowed() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
effect() {
|
effect() {
|
||||||
b.modSpores += 0.11;
|
b.modSpores += 0.11;
|
||||||
for (let i = 0; i < 10; i++) {
|
for (let i = 0; i < 10; i++) {
|
||||||
@@ -181,6 +213,9 @@ const b = {
|
|||||||
description: "a bot <strong>defends</strong> the space around you<br>uses a <strong>short range</strong> laser that drains <strong class='color-f'>energy</strong>",
|
description: "a bot <strong>defends</strong> the space around you<br>uses a <strong>short range</strong> laser that drains <strong class='color-f'>energy</strong>",
|
||||||
maxCount: 9,
|
maxCount: 9,
|
||||||
count: 0,
|
count: 0,
|
||||||
|
allowed() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
effect() {
|
effect() {
|
||||||
b.modLaserBotCount++;
|
b.modLaserBotCount++;
|
||||||
b.laserBot();
|
b.laserBot();
|
||||||
@@ -191,6 +226,9 @@ const b = {
|
|||||||
description: "a bot fires <strong>nails</strong> at targets in line of sight",
|
description: "a bot fires <strong>nails</strong> at targets in line of sight",
|
||||||
maxCount: 9,
|
maxCount: 9,
|
||||||
count: 0,
|
count: 0,
|
||||||
|
allowed() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
effect() {
|
effect() {
|
||||||
b.modNailBotCount++;
|
b.modNailBotCount++;
|
||||||
b.nailBot();
|
b.nailBot();
|
||||||
@@ -201,6 +239,9 @@ const b = {
|
|||||||
description: "rebuild your broken parts as <strong>drones</strong><br>chance to occur after being <strong>harmed</strong>",
|
description: "rebuild your broken parts as <strong>drones</strong><br>chance to occur after being <strong>harmed</strong>",
|
||||||
maxCount: 1,
|
maxCount: 1,
|
||||||
count: 0,
|
count: 0,
|
||||||
|
allowed() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
effect() {
|
effect() {
|
||||||
b.isModDroneOnDamage = true;
|
b.isModDroneOnDamage = true;
|
||||||
for (let i = 0; i < 3; i++) {
|
for (let i = 0; i < 3; i++) {
|
||||||
@@ -213,6 +254,9 @@ const b = {
|
|||||||
description: "when your <strong>field blocks</strong> it also does <strong class='color-d'>damage</strong>",
|
description: "when your <strong>field blocks</strong> it also does <strong class='color-d'>damage</strong>",
|
||||||
maxCount: 9,
|
maxCount: 9,
|
||||||
count: 0,
|
count: 0,
|
||||||
|
allowed() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
effect() {
|
effect() {
|
||||||
b.modBlockDmg += 0.7 //if you change this value also update the for loop in the electricity graphics in mech.pushMass
|
b.modBlockDmg += 0.7 //if you change this value also update the for loop in the electricity graphics in mech.pushMass
|
||||||
}
|
}
|
||||||
@@ -222,6 +266,9 @@ const b = {
|
|||||||
description: "using your first gun reduces <strong>harm</strong><br>scales by <strong>10%</strong> for each gun in your inventory",
|
description: "using your first gun reduces <strong>harm</strong><br>scales by <strong>10%</strong> for each gun in your inventory",
|
||||||
maxCount: 1,
|
maxCount: 1,
|
||||||
count: 0,
|
count: 0,
|
||||||
|
allowed() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
effect() {
|
effect() {
|
||||||
b.isModEntanglement = true
|
b.isModEntanglement = true
|
||||||
}
|
}
|
||||||
@@ -231,6 +278,9 @@ const b = {
|
|||||||
description: "<strong>jump</strong> higher and <strong>move</strong> faster<br>reduced <strong>harm</strong> from <strong>falling</strong> ",
|
description: "<strong>jump</strong> higher and <strong>move</strong> faster<br>reduced <strong>harm</strong> from <strong>falling</strong> ",
|
||||||
maxCount: 1,
|
maxCount: 1,
|
||||||
count: 0,
|
count: 0,
|
||||||
|
allowed() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
effect() { // good with melee builds, content skipping builds
|
effect() { // good with melee builds, content skipping builds
|
||||||
b.modSquirrelFx = 1.2;
|
b.modSquirrelFx = 1.2;
|
||||||
mech.Fx = 0.015 * b.modSquirrelFx;
|
mech.Fx = 0.015 * b.modSquirrelFx;
|
||||||
@@ -242,6 +292,9 @@ const b = {
|
|||||||
description: "unable to <strong>collide</strong> with enemies for +2 second<br>activates after being <strong>harmed</strong> from a collision",
|
description: "unable to <strong>collide</strong> with enemies for +2 second<br>activates after being <strong>harmed</strong> from a collision",
|
||||||
maxCount: 9,
|
maxCount: 9,
|
||||||
count: 0,
|
count: 0,
|
||||||
|
allowed() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
effect() {
|
effect() {
|
||||||
b.modCollisionImmuneCycles += 120;
|
b.modCollisionImmuneCycles += 120;
|
||||||
mech.collisionImmune = mech.cycle + b.modCollisionImmuneCycles; //player is immune to collision damage for 30 cycles
|
mech.collisionImmune = mech.cycle + b.modCollisionImmuneCycles; //player is immune to collision damage for 30 cycles
|
||||||
@@ -252,6 +305,9 @@ const b = {
|
|||||||
description: "after <strong>touching</strong> enemies, they are annihilated",
|
description: "after <strong>touching</strong> enemies, they are annihilated",
|
||||||
maxCount: 1,
|
maxCount: 1,
|
||||||
count: 0,
|
count: 0,
|
||||||
|
allowed() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
effect() {
|
effect() {
|
||||||
b.isModAnnihilation = true
|
b.isModAnnihilation = true
|
||||||
}
|
}
|
||||||
@@ -261,6 +317,9 @@ const b = {
|
|||||||
description: "<strong>colliding</strong> with enemies fills your <strong class='color-f'>energy</strong>",
|
description: "<strong>colliding</strong> with enemies fills your <strong class='color-f'>energy</strong>",
|
||||||
maxCount: 1,
|
maxCount: 1,
|
||||||
count: 0,
|
count: 0,
|
||||||
|
allowed() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
effect() {
|
effect() {
|
||||||
b.isModPiezo = true;
|
b.isModPiezo = true;
|
||||||
mech.fieldMeter = mech.fieldEnergyMax;
|
mech.fieldMeter = mech.fieldEnergyMax;
|
||||||
@@ -271,6 +330,9 @@ const b = {
|
|||||||
description: "gain <strong class='color-f'>energy</strong> proportional to <strong class='color-d'>damage</strong> done",
|
description: "gain <strong class='color-f'>energy</strong> proportional to <strong class='color-d'>damage</strong> done",
|
||||||
maxCount: 3,
|
maxCount: 3,
|
||||||
count: 0,
|
count: 0,
|
||||||
|
allowed() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
effect() {
|
effect() {
|
||||||
b.modEnergySiphon += 0.15;
|
b.modEnergySiphon += 0.15;
|
||||||
mech.fieldMeter = mech.fieldEnergyMax
|
mech.fieldMeter = mech.fieldEnergyMax
|
||||||
@@ -281,6 +343,9 @@ const b = {
|
|||||||
description: "<strong class='color-h'>heal</strong> proportional to <strong class='color-d'>damage</strong> done",
|
description: "<strong class='color-h'>heal</strong> proportional to <strong class='color-d'>damage</strong> done",
|
||||||
maxCount: 3,
|
maxCount: 3,
|
||||||
count: 0,
|
count: 0,
|
||||||
|
allowed() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
effect() {
|
effect() {
|
||||||
b.modHealthDrain += 0.015;
|
b.modHealthDrain += 0.015;
|
||||||
}
|
}
|
||||||
@@ -290,6 +355,9 @@ const b = {
|
|||||||
description: "charge <strong class='color-f'>energy</strong> <strong>+33%</strong> beyond your <strong>maximum</strong>",
|
description: "charge <strong class='color-f'>energy</strong> <strong>+33%</strong> beyond your <strong>maximum</strong>",
|
||||||
maxCount: 9,
|
maxCount: 9,
|
||||||
count: 0,
|
count: 0,
|
||||||
|
allowed() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
effect() {
|
effect() {
|
||||||
mech.fieldEnergyMax += 0.33
|
mech.fieldEnergyMax += 0.33
|
||||||
mech.fieldMeter += 0.33
|
mech.fieldMeter += 0.33
|
||||||
@@ -300,6 +368,9 @@ const b = {
|
|||||||
description: "<strong class='color-h'>heal</strong> <strong>+33%</strong> beyond your <strong>max health</strong>",
|
description: "<strong class='color-h'>heal</strong> <strong>+33%</strong> beyond your <strong>max health</strong>",
|
||||||
maxCount: 9,
|
maxCount: 9,
|
||||||
count: 0,
|
count: 0,
|
||||||
|
allowed() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
effect() {
|
effect() {
|
||||||
mech.maxHealth += 0.33
|
mech.maxHealth += 0.33
|
||||||
mech.addHealth(0.33)
|
mech.addHealth(0.33)
|
||||||
@@ -310,6 +381,9 @@ const b = {
|
|||||||
description: "<strong class='color-h'>healing</strong> power ups trigger one extra time.",
|
description: "<strong class='color-h'>healing</strong> power ups trigger one extra time.",
|
||||||
maxCount: 9,
|
maxCount: 9,
|
||||||
count: 0,
|
count: 0,
|
||||||
|
allowed() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
effect() {
|
effect() {
|
||||||
b.modRecursiveHealing += 1
|
b.modRecursiveHealing += 1
|
||||||
}
|
}
|
||||||
@@ -319,6 +393,9 @@ const b = {
|
|||||||
description: "power ups fill your <strong class='color-f'>energy</strong> and <strong class='color-h'>heal</strong> for +5%",
|
description: "power ups fill your <strong class='color-f'>energy</strong> and <strong class='color-h'>heal</strong> for +5%",
|
||||||
maxCount: 1,
|
maxCount: 1,
|
||||||
count: 0,
|
count: 0,
|
||||||
|
allowed() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
effect: () => {
|
effect: () => {
|
||||||
b.isModMassEnergy = true // used in mech.grabPowerUp
|
b.isModMassEnergy = true // used in mech.grabPowerUp
|
||||||
mech.fieldMeter = mech.fieldEnergyMax
|
mech.fieldMeter = mech.fieldEnergyMax
|
||||||
@@ -329,6 +406,9 @@ const b = {
|
|||||||
description: "after <strong>dying</strong>, continue in an <strong>alternate reality</strong><br><em>guns, ammo, field, and mods are randomized</em>",
|
description: "after <strong>dying</strong>, continue in an <strong>alternate reality</strong><br><em>guns, ammo, field, and mods are randomized</em>",
|
||||||
maxCount: 1,
|
maxCount: 1,
|
||||||
count: 0,
|
count: 0,
|
||||||
|
allowed() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
effect() {
|
effect() {
|
||||||
b.isModImmortal = true;
|
b.isModImmortal = true;
|
||||||
}
|
}
|
||||||
@@ -338,6 +418,9 @@ const b = {
|
|||||||
description: "<strong>20%</strong> chance for double <strong>power ups</strong> to drop<br>one fewer <strong>choice</strong> when selecting <strong>power ups</strong>",
|
description: "<strong>20%</strong> chance for double <strong>power ups</strong> to drop<br>one fewer <strong>choice</strong> when selecting <strong>power ups</strong>",
|
||||||
maxCount: 1,
|
maxCount: 1,
|
||||||
count: 0,
|
count: 0,
|
||||||
|
allowed() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
effect: () => {
|
effect: () => {
|
||||||
b.isModBayesian = 0.20;
|
b.isModBayesian = 0.20;
|
||||||
}
|
}
|
||||||
@@ -347,6 +430,9 @@ const b = {
|
|||||||
description: "one extra <strong>choice</strong> when selecting <strong>power ups</strong>",
|
description: "one extra <strong>choice</strong> when selecting <strong>power ups</strong>",
|
||||||
maxCount: 1,
|
maxCount: 1,
|
||||||
count: 0,
|
count: 0,
|
||||||
|
allowed() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
effect: () => {
|
effect: () => {
|
||||||
b.isModFourOptions = true;
|
b.isModFourOptions = true;
|
||||||
}
|
}
|
||||||
@@ -356,6 +442,9 @@ const b = {
|
|||||||
description: "<strong>remove</strong> all current <strong class='color-m'>mods</strong><br>spawn new <strong class='color-m'>mods</strong> to replace them",
|
description: "<strong>remove</strong> all current <strong class='color-m'>mods</strong><br>spawn new <strong class='color-m'>mods</strong> to replace them",
|
||||||
maxCount: 1,
|
maxCount: 1,
|
||||||
count: 0,
|
count: 0,
|
||||||
|
allowed() {
|
||||||
|
return (b.modCount > 6)
|
||||||
|
},
|
||||||
effect: () => {
|
effect: () => {
|
||||||
for (let i = 0; i < b.modCount; i++) { // spawn new mods
|
for (let i = 0; i < b.modCount; i++) { // spawn new mods
|
||||||
powerUps.spawn(mech.pos.x, mech.pos.y, "mod");
|
powerUps.spawn(mech.pos.x, mech.pos.y, "mod");
|
||||||
@@ -364,12 +453,25 @@ const b = {
|
|||||||
//have state is checked in mech.death()
|
//have state is checked in mech.death()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "accelerated drones", //7
|
||||||
|
description: "your <strong>drones</strong> accelerate 50% <strong>faster</strong>",
|
||||||
|
maxCount: 1,
|
||||||
|
count: 0,
|
||||||
|
allowed() {
|
||||||
|
return b.haveGunCheck("drones")
|
||||||
|
},
|
||||||
|
effect() {
|
||||||
|
b.isModFastDrones = true
|
||||||
|
}
|
||||||
|
},
|
||||||
],
|
],
|
||||||
giveMod(index = 'random') {
|
giveMod(index = 'random') {
|
||||||
if (index === 'random') {
|
if (index === 'random') {
|
||||||
let options = [];
|
let options = [];
|
||||||
for (let i = 0; i < b.mods.length; i++) {
|
for (let i = 0; i < b.mods.length; i++) {
|
||||||
if (b.mods[i].count < b.mods[i].maxCount) options.push(i);
|
if (b.mods[i].count < b.mods[i].maxCount && b.mods[i].allowed())
|
||||||
|
options.push(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
// give a random mod from the mods I don't have
|
// give a random mod from the mods I don't have
|
||||||
@@ -384,6 +486,12 @@ const b = {
|
|||||||
game.updateModHUD();
|
game.updateModHUD();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
haveGunCheck(name) {
|
||||||
|
for (i = 0, len = b.inventory.length; i < len; i++) {
|
||||||
|
if (b.guns[b.inventory[i]].name === name) return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
},
|
||||||
activeGun: null, //current gun in use by player
|
activeGun: null, //current gun in use by player
|
||||||
inventoryGun: 0,
|
inventoryGun: 0,
|
||||||
inventory: [], //list of what guns player has // 0 starts with basic gun
|
inventory: [], //list of what guns player has // 0 starts with basic gun
|
||||||
@@ -817,7 +925,7 @@ const b = {
|
|||||||
},
|
},
|
||||||
drone(speed = 1) {
|
drone(speed = 1) {
|
||||||
const me = bullet.length;
|
const me = bullet.length;
|
||||||
const THRUST = 0.0015
|
const THRUST = b.isModFastDrones ? 0.003 : 0.0015
|
||||||
const dir = mech.angle + 0.2 * (Math.random() - 0.5);
|
const dir = mech.angle + 0.2 * (Math.random() - 0.5);
|
||||||
const RADIUS = (4.5 + 3 * Math.random()) * b.modBulletSize
|
const RADIUS = (4.5 + 3 * Math.random()) * b.modBulletSize
|
||||||
bullet[me] = Bodies.polygon(mech.pos.x + 30 * Math.cos(mech.angle), mech.pos.y + 30 * Math.sin(mech.angle), 8, RADIUS, {
|
bullet[me] = Bodies.polygon(mech.pos.x + 30 * Math.cos(mech.angle), mech.pos.y + 30 * Math.sin(mech.angle), 8, RADIUS, {
|
||||||
|
|||||||
17
js/index.js
17
js/index.js
@@ -2,6 +2,23 @@
|
|||||||
/* TODO: *******************************************
|
/* TODO: *******************************************
|
||||||
*****************************************************
|
*****************************************************
|
||||||
|
|
||||||
|
field that pushes everything back, and can destroy smaller blocks
|
||||||
|
converts blocks into ammo power ups
|
||||||
|
|
||||||
|
give mods a requirement
|
||||||
|
check for require before choosing mods displayed in selection
|
||||||
|
require: {
|
||||||
|
type: "gun"
|
||||||
|
name: "drone"
|
||||||
|
}
|
||||||
|
drones move faster
|
||||||
|
require: {
|
||||||
|
type: "mod"
|
||||||
|
name: "high explosives"
|
||||||
|
}
|
||||||
|
immunity to explosions
|
||||||
|
remove immunity from high explosives, but buff explosion radius a bit
|
||||||
|
|
||||||
mod: make player invisible when...
|
mod: make player invisible when...
|
||||||
use the flag from phase field
|
use the flag from phase field
|
||||||
|
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ const powerUps = {
|
|||||||
return 45;
|
return 45;
|
||||||
},
|
},
|
||||||
effect() {
|
effect() {
|
||||||
function doNotHave(who, skip1 = -1, skip2 = -1, skip3 = -1) {
|
function pick(who, skip1 = -1, skip2 = -1, skip3 = -1) {
|
||||||
let options = [];
|
let options = [];
|
||||||
for (let i = 1; i < who.length; i++) {
|
for (let i = 1; i < who.length; i++) {
|
||||||
if (i !== mech.fieldMode && i !== skip1 && i !== skip2 && i !== skip3) options.push(i);
|
if (i !== mech.fieldMode && i !== skip1 && i !== skip2 && i !== skip3) options.push(i);
|
||||||
@@ -106,19 +106,19 @@ const powerUps = {
|
|||||||
if (options.length > 0) return options[Math.floor(Math.random() * options.length)]
|
if (options.length > 0) return options[Math.floor(Math.random() * options.length)]
|
||||||
}
|
}
|
||||||
|
|
||||||
let choice1 = doNotHave(mech.fieldUpgrades)
|
let choice1 = pick(mech.fieldUpgrades)
|
||||||
let choice2 = doNotHave(mech.fieldUpgrades, choice1)
|
let choice2 = pick(mech.fieldUpgrades, choice1)
|
||||||
let choice3 = -1
|
let choice3 = -1
|
||||||
if (choice1 > -1) {
|
if (choice1 > -1) {
|
||||||
let text = `<div class='cancel' onclick='powerUps.cancel()'>✕</div><h3 style = 'color:#fff; text-align:left; margin: 0px;'>choose a field</h3>`
|
let text = `<div class='cancel' onclick='powerUps.cancel()'>✕</div><h3 style = 'color:#fff; text-align:left; margin: 0px;'>choose a field</h3>`
|
||||||
text += `<div class="choose-grid-module" onclick="powerUps.choose('field',${choice1})"><div class="grid-title"><div class="circle-grid field"></div> ${mech.fieldUpgrades[choice1].name}</div> ${mech.fieldUpgrades[choice1].description}</div>`
|
text += `<div class="choose-grid-module" onclick="powerUps.choose('field',${choice1})"><div class="grid-title"><div class="circle-grid field"></div> ${mech.fieldUpgrades[choice1].name}</div> ${mech.fieldUpgrades[choice1].description}</div>`
|
||||||
if (choice2 > -1) text += `<div class="choose-grid-module" onclick="powerUps.choose('field',${choice2})"><div class="grid-title"><div class="circle-grid field"></div> ${mech.fieldUpgrades[choice2].name}</div> ${mech.fieldUpgrades[choice2].description}</div>`
|
if (choice2 > -1) text += `<div class="choose-grid-module" onclick="powerUps.choose('field',${choice2})"><div class="grid-title"><div class="circle-grid field"></div> ${mech.fieldUpgrades[choice2].name}</div> ${mech.fieldUpgrades[choice2].description}</div>`
|
||||||
if (!b.isModBayesian) {
|
if (!b.isModBayesian) {
|
||||||
choice3 = doNotHave(mech.fieldUpgrades, choice1, choice2)
|
choice3 = pick(mech.fieldUpgrades, choice1, choice2)
|
||||||
if (choice3 > -1) text += `<div class="choose-grid-module" onclick="powerUps.choose('field',${choice3})"><div class="grid-title"><div class="circle-grid field"></div> ${mech.fieldUpgrades[choice3].name}</div> ${mech.fieldUpgrades[choice3].description}</div>`
|
if (choice3 > -1) text += `<div class="choose-grid-module" onclick="powerUps.choose('field',${choice3})"><div class="grid-title"><div class="circle-grid field"></div> ${mech.fieldUpgrades[choice3].name}</div> ${mech.fieldUpgrades[choice3].description}</div>`
|
||||||
}
|
}
|
||||||
if (b.isModFourOptions) {
|
if (b.isModFourOptions) {
|
||||||
let choice4 = doNotHave(mech.fieldUpgrades, choice1, choice2, choice3)
|
let choice4 = pick(mech.fieldUpgrades, choice1, choice2, choice3)
|
||||||
if (choice4 > -1) text += `<div class="choose-grid-module" onclick="powerUps.choose('field',${choice4})"><div class="grid-title"><div class="circle-grid field"></div> ${mech.fieldUpgrades[choice4].name}</div> ${mech.fieldUpgrades[choice4].description}</div>`
|
if (choice4 > -1) text += `<div class="choose-grid-module" onclick="powerUps.choose('field',${choice4})"><div class="grid-title"><div class="circle-grid field"></div> ${mech.fieldUpgrades[choice4].name}</div> ${mech.fieldUpgrades[choice4].description}</div>`
|
||||||
}
|
}
|
||||||
// text += `<div style = 'color:#fff'>${game.SVGrightMouse} activate the shield with the right mouse<br>fields shield you from damage <br>and let you pick up and throw blocks</div>`
|
// text += `<div style = 'color:#fff'>${game.SVGrightMouse} activate the shield with the right mouse<br>fields shield you from damage <br>and let you pick up and throw blocks</div>`
|
||||||
@@ -136,12 +136,13 @@ const powerUps = {
|
|||||||
return 42;
|
return 42;
|
||||||
},
|
},
|
||||||
effect() {
|
effect() {
|
||||||
function doNotHave(who, skip1 = -1, skip2 = -1, skip3 = -1) {
|
function pick(skip1 = -1, skip2 = -1, skip3 = -1) {
|
||||||
let options = [];
|
let options = [];
|
||||||
for (let i = 0; i < who.length; i++) {
|
for (let i = 0; i < b.mods.length; i++) {
|
||||||
if (who[i].count < who[i].maxCount &&
|
if (
|
||||||
|
b.mods[i].count < b.mods[i].maxCount &&
|
||||||
i !== skip1 && i !== skip2 && i !== skip3 &&
|
i !== skip1 && i !== skip2 && i !== skip3 &&
|
||||||
(b.modCount > 4 || who[i].name !== "Born rule")
|
b.mods[i].allowed()
|
||||||
) {
|
) {
|
||||||
options.push(i);
|
options.push(i);
|
||||||
}
|
}
|
||||||
@@ -149,19 +150,19 @@ const powerUps = {
|
|||||||
if (options.length > 0) return options[Math.floor(Math.random() * options.length)]
|
if (options.length > 0) return options[Math.floor(Math.random() * options.length)]
|
||||||
}
|
}
|
||||||
|
|
||||||
let choice1 = doNotHave(b.mods)
|
let choice1 = pick()
|
||||||
let choice2 = doNotHave(b.mods, choice1)
|
let choice2 = pick(choice1)
|
||||||
let choice3 = -1
|
let choice3 = -1
|
||||||
if (choice1 > -1) {
|
if (choice1 > -1) {
|
||||||
let text = "<div class='cancel' onclick='powerUps.cancel()'>✕</div><h3 style = 'color:#fff; text-align:left; margin: 0px;'>choose a mod</h3>"
|
let text = "<div class='cancel' onclick='powerUps.cancel()'>✕</div><h3 style = 'color:#fff; text-align:left; margin: 0px;'>choose a mod</h3>"
|
||||||
text += `<div class="choose-grid-module" onclick="powerUps.choose('mod',${choice1})"><div class="grid-title"><div class="circle-grid mod"></div> ${b.mods[choice1].name}</div> ${b.mods[choice1].description}</div>`
|
text += `<div class="choose-grid-module" onclick="powerUps.choose('mod',${choice1})"><div class="grid-title"><div class="circle-grid mod"></div> ${b.mods[choice1].name}</div> ${b.mods[choice1].description}</div>`
|
||||||
if (choice2 > -1) text += `<div class="choose-grid-module" onclick="powerUps.choose('mod',${choice2})"><div class="grid-title"><div class="circle-grid mod"></div> ${b.mods[choice2].name}</div> ${b.mods[choice2].description}</div>`
|
if (choice2 > -1) text += `<div class="choose-grid-module" onclick="powerUps.choose('mod',${choice2})"><div class="grid-title"><div class="circle-grid mod"></div> ${b.mods[choice2].name}</div> ${b.mods[choice2].description}</div>`
|
||||||
if (!b.isModBayesian) {
|
if (!b.isModBayesian) {
|
||||||
choice3 = doNotHave(b.mods, choice1, choice2)
|
choice3 = pick(choice1, choice2)
|
||||||
if (choice3 > -1) text += `<div class="choose-grid-module" onclick="powerUps.choose('mod',${choice3})"><div class="grid-title"><div class="circle-grid mod"></div> ${b.mods[choice3].name}</div> ${b.mods[choice3].description}</div>`
|
if (choice3 > -1) text += `<div class="choose-grid-module" onclick="powerUps.choose('mod',${choice3})"><div class="grid-title"><div class="circle-grid mod"></div> ${b.mods[choice3].name}</div> ${b.mods[choice3].description}</div>`
|
||||||
}
|
}
|
||||||
if (b.isModFourOptions) {
|
if (b.isModFourOptions) {
|
||||||
let choice4 = doNotHave(b.mods, choice1, choice2, choice3)
|
let choice4 = pick(choice1, choice2, choice3)
|
||||||
if (choice4 > -1) text += `<div class="choose-grid-module" onclick="powerUps.choose('mod',${choice4})"><div class="grid-title"><div class="circle-grid mod"></div> ${b.mods[choice4].name}</div> ${b.mods[choice4].description}</div>`
|
if (choice4 > -1) text += `<div class="choose-grid-module" onclick="powerUps.choose('mod',${choice4})"><div class="grid-title"><div class="circle-grid mod"></div> ${b.mods[choice4].name}</div> ${b.mods[choice4].description}</div>`
|
||||||
}
|
}
|
||||||
document.getElementById("choose-grid").innerHTML = text
|
document.getElementById("choose-grid").innerHTML = text
|
||||||
@@ -178,7 +179,7 @@ const powerUps = {
|
|||||||
return 35;
|
return 35;
|
||||||
},
|
},
|
||||||
effect() {
|
effect() {
|
||||||
function doNotHave(who, skip1 = -1, skip2 = -1, skip3 = -1) {
|
function pick(who, skip1 = -1, skip2 = -1, skip3 = -1) {
|
||||||
let options = [];
|
let options = [];
|
||||||
for (let i = 0; i < who.length; i++) {
|
for (let i = 0; i < who.length; i++) {
|
||||||
if (!who[i].have && i !== skip1 && i !== skip2 && i !== skip3) options.push(i);
|
if (!who[i].have && i !== skip1 && i !== skip2 && i !== skip3) options.push(i);
|
||||||
@@ -186,19 +187,19 @@ const powerUps = {
|
|||||||
if (options.length > 0) return options[Math.floor(Math.random() * options.length)]
|
if (options.length > 0) return options[Math.floor(Math.random() * options.length)]
|
||||||
}
|
}
|
||||||
|
|
||||||
let choice1 = doNotHave(b.guns)
|
let choice1 = pick(b.guns)
|
||||||
let choice2 = doNotHave(b.guns, choice1)
|
let choice2 = pick(b.guns, choice1)
|
||||||
let choice3 = -1
|
let choice3 = -1
|
||||||
if (choice1 > -1) {
|
if (choice1 > -1) {
|
||||||
let text = "<div class='cancel' onclick='powerUps.cancel()'>✕</div><h3 style = 'color:#fff; text-align:left; margin: 0px;'>choose a gun</h3>"
|
let text = "<div class='cancel' onclick='powerUps.cancel()'>✕</div><h3 style = 'color:#fff; text-align:left; margin: 0px;'>choose a gun</h3>"
|
||||||
text += `<div class="choose-grid-module" onclick="powerUps.choose('gun',${choice1})"><div class="grid-title"><div class="circle-grid gun"></div> ${b.guns[choice1].name}</div> ${b.guns[choice1].description}</div>`
|
text += `<div class="choose-grid-module" onclick="powerUps.choose('gun',${choice1})"><div class="grid-title"><div class="circle-grid gun"></div> ${b.guns[choice1].name}</div> ${b.guns[choice1].description}</div>`
|
||||||
if (choice2 > -1) text += `<div class="choose-grid-module" onclick="powerUps.choose('gun',${choice2})"><div class="grid-title"><div class="circle-grid gun"></div> ${b.guns[choice2].name}</div> ${b.guns[choice2].description}</div>`
|
if (choice2 > -1) text += `<div class="choose-grid-module" onclick="powerUps.choose('gun',${choice2})"><div class="grid-title"><div class="circle-grid gun"></div> ${b.guns[choice2].name}</div> ${b.guns[choice2].description}</div>`
|
||||||
if (!b.isModBayesian) {
|
if (!b.isModBayesian) {
|
||||||
choice3 = doNotHave(b.guns, choice1, choice2)
|
choice3 = pick(b.guns, choice1, choice2)
|
||||||
if (choice3 > -1) text += `<div class="choose-grid-module" onclick="powerUps.choose('gun',${choice3})"><div class="grid-title"><div class="circle-grid gun"></div> ${b.guns[choice3].name}</div> ${b.guns[choice3].description}</div>`
|
if (choice3 > -1) text += `<div class="choose-grid-module" onclick="powerUps.choose('gun',${choice3})"><div class="grid-title"><div class="circle-grid gun"></div> ${b.guns[choice3].name}</div> ${b.guns[choice3].description}</div>`
|
||||||
}
|
}
|
||||||
if (b.isModFourOptions) {
|
if (b.isModFourOptions) {
|
||||||
let choice4 = doNotHave(b.guns, choice1, choice2, choice3)
|
let choice4 = pick(b.guns, choice1, choice2, choice3)
|
||||||
if (choice4 > -1) text += `<div class="choose-grid-module" onclick="powerUps.choose('gun',${choice4})"><div class="grid-title"><div class="circle-grid gun"></div> ${b.guns[choice4].name}</div> ${b.guns[choice4].description}</div>`
|
if (choice4 > -1) text += `<div class="choose-grid-module" onclick="powerUps.choose('gun',${choice4})"><div class="grid-title"><div class="circle-grid gun"></div> ${b.guns[choice4].name}</div> ${b.guns[choice4].description}</div>`
|
||||||
}
|
}
|
||||||
document.getElementById("choose-grid").innerHTML = text
|
document.getElementById("choose-grid").innerHTML = text
|
||||||
|
|||||||
Reference in New Issue
Block a user