${b.guns[gun].description}
`
text += powerUps.gunText(choose, `powerUps.choose('gun',${choose})`)
+
+ //consider not adding guns the player currently has?
+
+
}
for (let i = 0; i < localSettings.entanglement.techIndexes.length; i++) { //add tech
let choose = localSettings.entanglement.techIndexes[i]
@@ -1566,32 +1525,34 @@ const powerUps = {
powerUp.splice(index, 1);
}
},
- directSpawn(x, y, target, moving = true, mode = null, size = powerUps[target].size()) {
+ directSpawn(x, y, target, moving = true, mode = null, size = powerUps[target].size(), isDuplicated = false) {
let index = powerUp.length;
- target = powerUps[target];
- powerUp[index] = Matter.Bodies.polygon(x, y, 0, size, {
+ let properties = {
density: 0.001,
frictionAir: 0.03,
restitution: 0.85,
- inertia: Infinity, //prevents rotation
collisionFilter: {
group: 0,
category: cat.powerUp,
mask: cat.map | cat.powerUp
},
- color: target.color,
- effect: target.effect,
- name: target.name,
+ color: powerUps[target].color,
+ effect: powerUps[target].effect,
+ name: powerUps[target].name,
size: size
- });
- if (mode) powerUp[index].mode = mode
- if (moving) {
- Matter.Body.setVelocity(powerUp[index], {
- x: (Math.random() - 0.5) * 15,
- y: Math.random() * -9 - 3
- });
}
- Composite.add(engine.world, powerUp[index]); //add to world
+ let polygonSides
+ if (isDuplicated) {
+ polygonSides = tech.isPowerUpsVanish ? 3 : Math.floor(4 + 2 * Math.random())
+ properties.isDuplicated = true
+ } else {
+ properties.inertia = Infinity //prevents rotation for circles only
+ polygonSides = 0
+ }
+ powerUp[index] = Matter.Bodies.polygon(x, y, polygonSides, size, properties);
+ if (mode) powerUp[index].mode = mode
+ if (moving) Matter.Body.setVelocity(powerUp[index], { x: (Math.random() - 0.5) * 15, y: Math.random() * -9 - 3 });
+ Composite.add(engine.world, powerUp[index]);
},
spawn(x, y, target, moving = true, mode = null, size = powerUps[target].size()) {
if (
@@ -1601,7 +1562,7 @@ const powerUps = {
if (tech.isBoostReplaceAmmo && target === 'ammo') target = 'boost'
powerUps.directSpawn(x, y, target, moving, mode, size)
if (Math.random() < tech.duplicationChance()) {
- powerUps.directSpawn(x, y, target, moving, mode, size)
+ powerUps.directSpawn(x, y, target, moving, mode, size, true)
powerUp[powerUp.length - 1].isDuplicated = true
// if (tech.isPowerUpsVanish) powerUp[powerUp.length - 1].endCycle = simulation.cycle + 300
}
diff --git a/js/simulation.js b/js/simulation.js
index 4094dc5..d927992 100644
--- a/js/simulation.js
+++ b/js/simulation.js
@@ -1003,9 +1003,13 @@ const simulation = {
}
}
};
- fallCheck(mob);
fallCheck(body);
fallCheck(powerUp, true);
+ let i = mob.length;
+ while (i--) {
+ if (mob[i].position.y > simulation.fallHeight) mob[i].death();
+ }
+
}
}
},
diff --git a/js/tech.js b/js/tech.js
index 378502a..c15c5db 100644
--- a/js/tech.js
+++ b/js/tech.js
@@ -236,7 +236,7 @@ const tech = {
if (m.coupling && (m.fieldMode === 0 || m.fieldMode === 5)) dmg *= 1 + 0.015 * m.coupling
if (m.isSneakAttack && m.sneakAttackCycle + Math.min(120, 0.5 * (m.cycle - m.enterCloakCycle)) > m.cycle) dmg *= 4.33 * (1 + 0.033 * m.coupling)
if (tech.deathSkipTime) dmg *= 1 + 0.6 * tech.deathSkipTime
- if (tech.isTechDebt) dmg *= tech.totalCount > 2 ? Math.pow(0.85, tech.totalCount - 20) : 4 - 0.15 * tech.totalCount // if (tech.isTechDebt) dmg *= Math.min(Math.pow(0.85, tech.totalCount - 20), 4 - 0.15 * tech.totalCount)
+ if (tech.isTechDebt) dmg *= tech.totalCount > 20 ? Math.pow(0.85, tech.totalCount - 20) : 4 - 0.15 * tech.totalCount // if (tech.isTechDebt) dmg *= Math.min(Math.pow(0.85, tech.totalCount - 20), 4 - 0.15 * tech.totalCount)
if (tech.isFlipFlopDamage && tech.isFlipFlopOn) dmg *= 1.555
if (tech.isAnthropicDamage && tech.isDeathAvoidedThisLevel) dmg *= 2.3703599
if (tech.isDupDamage) dmg *= 1 + Math.min(1, tech.duplicationChance())
@@ -259,7 +259,7 @@ const tech = {
return dmg
},
duplicationChance() {
- return Math.min(1, Math.max(0, (tech.isPowerUpsVanish ? 0.12 : 0) + (tech.isStimulatedEmission ? 0.15 : 0) + tech.duplication + tech.duplicateChance + 0.05 * tech.isExtraGunField + m.duplicateChance + tech.fieldDuplicate + tech.cloakDuplication + (tech.isAnthropicTech && tech.isDeathAvoidedThisLevel ? 0.5 : 0) + tech.isQuantumEraserDuplication * (1 - 0.016 * (simulation.difficultyMode ** 2))))
+ return Math.min(1, Math.max(0, (tech.isPowerUpsVanish ? 0.13 : 0) + (tech.isStimulatedEmission ? 0.15 : 0) + tech.duplication + tech.duplicateChance + 0.05 * tech.isExtraGunField + m.duplicateChance + tech.fieldDuplicate + tech.cloakDuplication + (tech.isAnthropicTech && tech.isDeathAvoidedThisLevel ? 0.5 : 0) + tech.isQuantumEraserDuplication * (1 - 0.016 * (simulation.difficultyMode ** 2))))
},
isScaleMobsWithDuplication: false,
maxDuplicationEvent() {
@@ -3517,7 +3517,8 @@ const tech = {
{
name: "technical debt",
descriptionFunction() {
- return `