diff --git a/js/bullet.js b/js/bullet.js
index 8559c37..9030363 100644
--- a/js/bullet.js
+++ b/js/bullet.js
@@ -6315,11 +6315,11 @@ const b = {
this.charge += 0.00001
},
grappleFire() {
- const where = {
- x: m.pos.x + 30 * Math.cos(m.angle),
- y: m.pos.y + 30 * Math.sin(m.angle)
- }
const harpoonSize = (tech.isLargeHarpoon ? 1 + 0.1 * Math.sqrt(this.ammo) : 1) //* (input.down ? 0.7 : 1)
+ const where = {
+ x: m.pos.x + harpoonSize * 40 * Math.cos(m.angle),
+ y: m.pos.y + harpoonSize * 40 * Math.sin(m.angle)
+ }
if (tech.extraHarpoons && !input.down) { //multiple harpoons
const SPREAD = 0.06
const len = tech.extraHarpoons + 1
@@ -6353,7 +6353,7 @@ const b = {
}
//look for closest mob in player's LoS
const harpoonSize = (tech.isLargeHarpoon ? 1 + 0.1 * Math.sqrt(this.ammo) : 1) //* (input.down ? 0.7 : 1)
- const totalCycles = 7 * (tech.isFilament ? 1 + 0.01 * Math.min(110, this.ammo) : 1) * Math.sqrt(harpoonSize)
+ const totalCycles = 6 * (tech.isFilament ? 1 + 0.01 * Math.min(110, this.ammo) : 1) * Math.sqrt(harpoonSize)
if (tech.extraHarpoons && !input.down) { //multiple harpoons
const SPREAD = 0.1
@@ -6404,7 +6404,7 @@ const b = {
}
}
if (input.down) {
- b.harpoon(where, closest.target, m.angle, harpoonSize, false, 70)
+ b.harpoon(where, null, m.angle, harpoonSize, true, 1.5 * totalCycles)
} else {
b.harpoon(where, closest.target, m.angle, harpoonSize, true, totalCycles)
}
diff --git a/js/engine.js b/js/engine.js
index d63bb82..b99be55 100644
--- a/js/engine.js
+++ b/js/engine.js
@@ -117,13 +117,14 @@ function collisionChecks(event) {
tech.isFlipFlopOn = false
if (document.getElementById("tech-flip-flop")) document.getElementById("tech-flip-flop").innerHTML = ` = OFF`
m.eyeFillColor = 'transparent'
- if (!tech.isFlipFlopHarm) m.damage(dmg);
+ m.damage(dmg);
} else {
tech.isFlipFlopOn = true //immune to damage this hit, lose immunity for next hit
if (document.getElementById("tech-flip-flop")) document.getElementById("tech-flip-flop").innerHTML = ` = ON`
m.eyeFillColor = m.fieldMeterColor //'#0cf'
- m.damage(dmg);
+ if (!tech.isFlipFlopHarm) m.damage(dmg);
}
+ m.setMaxHealth();
} else {
m.damage(dmg); //normal damage
}
diff --git a/js/level.js b/js/level.js
index edb3e50..0f7b84f 100644
--- a/js/level.js
+++ b/js/level.js
@@ -18,7 +18,8 @@ const level = {
// m.setField("metamaterial cloaking")
// b.giveGuns("harpoon")
// tech.giveTech("grappling hook")
- // tech.giveTech("capacitor bank")
+ // tech.giveTech("railgun")
+ // tech.giveTech("shape-memory alloy")
// for (let i = 0; i < 2; i++) powerUps.directSpawn(0, 0, "tech");
// for (let i = 0; i < 2; i++) tech.giveTech("corona discharge")
// for (let i = 10; i < tech.tech.length; i++) { tech.tech[i].isBanished = true }
@@ -107,6 +108,8 @@ const level = {
// if (tech.isFlipFlopLevelReset && !tech.isFlipFlopOn) {
if ((tech.isRelay || tech.isFlipFlop) && !tech.isFlipFlopOn) {
tech.isFlipFlopOn = true
+ m.setMaxHealth()
+ m.setMaxEnergy()
m.eyeFillColor = m.fieldMeterColor
simulation.makeTextLog(`tech.isFlipFlopOn = true`);
}
diff --git a/js/player.js b/js/player.js
index fbc912c..da2f62d 100644
--- a/js/player.js
+++ b/js/player.js
@@ -491,7 +491,7 @@ const m = {
},
baseHealth: 1,
setMaxHealth() {
- m.maxHealth = m.baseHealth + tech.extraMaxHealth + tech.isFallingDamage //+ tech.bonusHealth
+ m.maxHealth = m.baseHealth + tech.extraMaxHealth + tech.isFallingDamage + 2 * tech.isFlipFlop * tech.isFlipFlopOn * tech.isFlipFlopHealth
document.getElementById("health-bg").style.width = `${Math.floor(300 * m.maxHealth)}px`
simulation.makeTextLog(`m.maxHealth = ${m.maxHealth.toFixed(2)}`)
if (m.health > m.maxHealth) m.health = m.maxHealth;
@@ -962,7 +962,7 @@ const m = {
}
},
setMaxEnergy() {
- m.maxEnergy = (tech.isMaxEnergyTech ? 0.5 : 1) + tech.bonusEnergy + tech.healMaxEnergyBonus + tech.harmonicEnergy + 2 * tech.isGroundState
+ m.maxEnergy = (tech.isMaxEnergyTech ? 0.5 : 1) + tech.bonusEnergy + tech.healMaxEnergyBonus + tech.harmonicEnergy + 2 * tech.isGroundState + 2 * tech.isRelay * tech.isFlipFlopOn * tech.isRelayEnergy
simulation.makeTextLog(`m.maxEnergy = ${(m.maxEnergy.toFixed(2))}`)
},
fieldMeterColor: "#0cf",
diff --git a/js/powerup.js b/js/powerup.js
index 48fd73b..8afd41f 100644
--- a/js/powerup.js
+++ b/js/powerup.js
@@ -889,6 +889,8 @@ const powerUps = {
if (document.getElementById("tech-switch")) document.getElementById("tech-switch").innerHTML = ` = ON`
m.eyeFillColor = m.fieldMeterColor //'#0cf'
}
+ m.setMaxEnergy();
+ m.setMaxHealth();
}
},
// giveRandomAmmo() {
diff --git a/js/tech.js b/js/tech.js
index 2106404..282da77 100644
--- a/js/tech.js
+++ b/js/tech.js
@@ -1656,11 +1656,11 @@ const tech = {
},
{
name: "NOR gate",
- description: "if flip-flop is in the ON state
take 0 harm from collisions with mobs",
+ description: "if flip-flop is in the OFF state
take 0 harm from collisions with mobs",
maxCount: 1,
count: 0,
- frequency: 4,
- frequencyDefault: 4,
+ frequency: 3,
+ frequencyDefault: 3,
allowed() {
return tech.isFlipFlop
},
@@ -1672,6 +1672,26 @@ const tech = {
tech.isFlipFlopHarm = false
}
},
+ {
+ name: "shape-memory alloy",
+ description: "if flip-flop is in the ON state
increase your maximum health by 200",
+ maxCount: 1,
+ count: 0,
+ frequency: 3,
+ frequencyDefault: 3,
+ allowed() {
+ return tech.isFlipFlop && !tech.isEnergyHealth
+ },
+ requires: "flip-flop, not mass-energy equivalence",
+ effect() {
+ tech.isFlipFlopHealth = true;
+ m.setMaxHealth();
+ },
+ remove() {
+ tech.isFlipFlopHealth = false;
+ m.setMaxHealth();
+ }
+ },
{
name: "flip-flop",
link: `flip-flop`,
@@ -1711,6 +1731,42 @@ const tech = {
m.eyeFillColor = 'transparent'
}
},
+ {
+ name: "NAND gate",
+ description: "if in the ON state
do 55.5% more damage",
+ maxCount: 1,
+ count: 0,
+ frequency: 3,
+ frequencyDefault: 3,
+ allowed() {
+ return tech.isFlipFlop || tech.isRelay
+ },
+ requires: "ON/OFF tech",
+ effect() {
+ tech.isFlipFlopDamage = true;
+ },
+ remove() {
+ tech.isFlipFlopDamage = false;
+ }
+ },
+ {
+ name: "transistor",
+ description: "if ON regen 20 energy per second
if OFF drain 1 energy per second",
+ maxCount: 1,
+ count: 0,
+ frequency: 3,
+ frequencyDefault: 3,
+ allowed() {
+ return tech.isFlipFlop || tech.isRelay
+ },
+ requires: "ON/OFF tech",
+ effect() {
+ tech.isFlipFlopEnergy = true;
+ },
+ remove() {
+ tech.isFlipFlopEnergy = false;
+ }
+ },
{
name: "relay switch",
description: `toggle ON and OFF after picking up a power up
unlock advanced tech that runs if ON`,
@@ -1750,39 +1806,23 @@ const tech = {
}
},
{
- name: "NAND gate",
- description: "if in the ON state
do 55.5% more damage",
+ name: "lithium-ion",
+ description: "if relay switch is in the ON state
increase your maximum energy by 200",
maxCount: 1,
count: 0,
- frequency: 4,
- frequencyDefault: 4,
+ frequency: 3,
+ frequencyDefault: 3,
allowed() {
- return tech.isFlipFlop || tech.isRelay
+ return tech.isRelay
},
- requires: "ON/OFF tech",
- effect() {
- tech.isFlipFlopDamage = true;
+ requires: "relay switch",
+ effect: () => {
+ tech.isRelayEnergy = true
+ m.setMaxEnergy()
},
remove() {
- tech.isFlipFlopDamage = false;
- }
- },
- {
- name: "transistor",
- description: "if ON regen 20 energy per second
if OFF drain 1 energy per second",
- maxCount: 1,
- count: 0,
- frequency: 4,
- frequencyDefault: 4,
- allowed() {
- return tech.isFlipFlop || tech.isRelay
- },
- requires: "ON/OFF tech",
- effect() {
- tech.isFlipFlopEnergy = true;
- },
- remove() {
- tech.isFlipFlopEnergy = false;
+ tech.isRelayEnergy = false
+ m.setMaxEnergy()
}
},
// {
@@ -1803,13 +1843,14 @@ const tech = {
// tech.isFlipFlopLevelReset = false;
// }
// },
+
{
name: "thermocouple",
description: "if relay switch is in the ON state
condense 4-13 ice IX crystals every second",
maxCount: 9,
count: 0,
- frequency: 4,
- frequencyDefault: 4,
+ frequency: 3,
+ frequencyDefault: 3,
allowed() {
return tech.isRelay
},
@@ -6707,9 +6748,9 @@ const tech = {
frequency: 2,
frequencyDefault: 2,
allowed() {
- return m.fieldUpgrades[m.fieldMode].name === "plasma torch" && !tech.isExtruder && tech.isPlasmaRange === 1
+ return m.fieldUpgrades[m.fieldMode].name === "plasma torch" && tech.isPlasmaBall
},
- requires: "plasma torch, not extruder, plasma jet",
+ requires: "plasma ball",
effect() {
tech.plasmaDischarge += 0.03
},
@@ -9556,5 +9597,7 @@ const tech = {
isDronesTravel: null,
isTechDebt: null,
isPlasmaBall: null,
- plasmaDischarge: null
+ plasmaDischarge: null,
+ isFlipFlopHealth: null,
+ isRelayEnergy: null,
}
\ No newline at end of file
diff --git a/todo.txt b/todo.txt
index 4cb61bc..4350731 100644
--- a/todo.txt
+++ b/todo.txt
@@ -1,13 +1,12 @@
******************************************************** NEXT PATCH **************************************************
-new community map! - islands by Richard0820
- enable community maps in settings
+tech lithium-ion - give 200 max energy when relay is ON
+tech shape-memory alloy - give 200 max health when flip-flop is ON
+ NOR gate now prevents damage when in the OFF state (previously ON) to work well with shape-memory alloy
-plasma ball
- tech: corona discharge - increase frequency and range of electric discharges
- several bug fixes
+harpoon crouch mode now retracts at 30% greater distance than normal with no targeting
-bug fix for some people that can't store settings between reloads
+more bug fixes of course
******************************************************** TODO ********************************************************
@@ -17,13 +16,19 @@ plasma ball
delay on returning to player is annoying
scale float effect with ball size
tech upgrades
- more electric arcs
greatly improve floating effects while holding
black hole: gives the plasma ball gravity
- suck or stun on explosion?
+ stun on expansion
plasma orb increases in size and power as it eats enemies
while attached?
+tech: frozen mobs die at 10% life
+
+tech: harpoons stick into enemies
+ detonate after a short delay
+ attaches mob to wall if possible
+ firing while harpoon is stuck into an enemy rips it out of them, inflicting damage and stun and pulling them towards you
+
bug: often game puts player position at NaN
try:
cloaking/harpoon grapple on normal, continue past beating the final boss
@@ -49,7 +54,6 @@ bug: harpoon attack gave a mob really high levels of health
bug: maybe I can put in an event listener to reset inputs to false when you tab out to prevent key sticking
-
enemies stuck with foam receive upward force over time
only form aerogel tech?
@@ -61,11 +65,6 @@ Requires: foam + another gun or plasma torch or molecular assembler
Enemies stuck with foam take 25% more damage
should foam bots gets this also or is that too strong
-tech: harpoons stick into enemies
- detonate after a short delay
- attaches mob to wall if possible
- firing while harpoon is stuck into an enemy rips it out of them, inflicting damage and stun and pulling them towards you
-
const ctx = canvas.getContext('2d', {‘willReadFrequently': true});
//deal with game crashes?
@@ -100,11 +99,9 @@ maybe? timing QTE for charging effects, if you fire right before the charge ge
+damage for each different bot type you have
disables bot upgrades?
-tech doing damage refunds up to 50% of damage take in last 10 seconds
+tech: doing damage to mobs refunds up to 50% of damage taken in last 10 seconds
use history[] to manage this?
-tech: frozen mobs die at 10% life
-
make a seed/hash system that controls only the tech/guns/fields shown
URL sharing could include a seed
seed controls:
@@ -122,14 +119,11 @@ tech: spontaneous collapse - very low chance of something to occur
JUNK tech
https://bindingofisaacrebirth.fandom.com/wiki/Damocles
-cloaking field doesn't show energy over max
+bug? cloaking field doesn't show energy over max
run more profiles of n-gon to fix performance issues
reactor
- mineBoss - bounces around and drops mines
- mines explode with a large radius that can trigger other mines
- mines have a short delay before exploding so they don't all go up in the same cycle
life-like cellular automata boss
https://scratch.mit.edu/projects/77724260/
night/day?
@@ -175,14 +169,13 @@ add anticipation to more mob attacks
stabber
striker
-boss that fires giant bullets, that bounce around and chases you
-
can mob bullets damage other mob?
maybe if they switch collisions and classType === "body" or obj.classType === "bullet"
path finding system
figure out how to get friction effects on map/body to apply to player
+also horizontal moving platform?
growBoss and cellBoss are too similar