diff --git a/.DS_Store b/.DS_Store
index ccd53dc..b6a3ab9 100644
Binary files a/.DS_Store and b/.DS_Store differ
diff --git a/img/1s half-life.webp b/img/1s half-life.webp
new file mode 100644
index 0000000..e6e3919
Binary files /dev/null and b/img/1s half-life.webp differ
diff --git a/img/1st ionization energy.webp b/img/1st ionization energy.webp
new file mode 100644
index 0000000..95e17b1
Binary files /dev/null and b/img/1st ionization energy.webp differ
diff --git a/img/6s half-life.webp b/img/6s half-life.webp
new file mode 100644
index 0000000..5ecd2c3
Binary files /dev/null and b/img/6s half-life.webp differ
diff --git a/img/Bayesian statistics.webp b/img/Bayesian statistics.webp
new file mode 100644
index 0000000..8dd3651
Binary files /dev/null and b/img/Bayesian statistics.webp differ
diff --git a/img/Bessemer process.webp b/img/Bessemer process.webp
new file mode 100644
index 0000000..bca9b04
Binary files /dev/null and b/img/Bessemer process.webp differ
diff --git a/img/Bitter electromagnet.webp b/img/Bitter electromagnet.webp
new file mode 100644
index 0000000..9d325d3
Binary files /dev/null and b/img/Bitter electromagnet.webp differ
diff --git a/img/Born rule.webp b/img/Born rule.webp
new file mode 100644
index 0000000..dac853b
Binary files /dev/null and b/img/Born rule.webp differ
diff --git a/img/CPT symmetry.webp b/img/CPT symmetry.webp
new file mode 100644
index 0000000..b0f2623
Binary files /dev/null and b/img/CPT symmetry.webp differ
diff --git a/img/Gibbs free energy.webp b/img/Gibbs free energy.webp
new file mode 100644
index 0000000..321c317
Binary files /dev/null and b/img/Gibbs free energy.webp differ
diff --git a/img/Higgs mechanism.webp b/img/Higgs mechanism.webp
new file mode 100644
index 0000000..9edf37b
Binary files /dev/null and b/img/Higgs mechanism.webp differ
diff --git a/img/Hilbert space.webp b/img/Hilbert space.webp
new file mode 100644
index 0000000..676ec7a
Binary files /dev/null and b/img/Hilbert space.webp differ
diff --git a/img/Hilbert spaces.webp b/img/Hilbert spaces.webp
new file mode 100644
index 0000000..4a99cf6
Binary files /dev/null and b/img/Hilbert spaces.webp differ
diff --git a/img/ICBM.webp b/img/ICBM.webp
new file mode 100644
index 0000000..ac2f753
Binary files /dev/null and b/img/ICBM.webp differ
diff --git a/img/K-selection.webp b/img/K-selection.webp
new file mode 100644
index 0000000..79250f3
Binary files /dev/null and b/img/K-selection.webp differ
diff --git a/img/Lorentz transformation.webp b/img/Lorentz transformation.webp
new file mode 100644
index 0000000..c7c52e8
Binary files /dev/null and b/img/Lorentz transformation.webp differ
diff --git a/img/MACHO.webp b/img/MACHO.webp
new file mode 100644
index 0000000..8570ee0
Binary files /dev/null and b/img/MACHO.webp differ
diff --git a/img/MIRV.webp b/img/MIRV.webp
new file mode 100644
index 0000000..32db296
Binary files /dev/null and b/img/MIRV.webp differ
diff --git a/img/Maxwells demon.webp b/img/Maxwells demon.webp
new file mode 100644
index 0000000..9152cad
Binary files /dev/null and b/img/Maxwells demon.webp differ
diff --git a/img/Meissner effect.webp b/img/Meissner effect.webp
new file mode 100644
index 0000000..329bc13
Binary files /dev/null and b/img/Meissner effect.webp differ
diff --git a/img/Monte Carlo method.webp b/img/Monte Carlo method.webp
new file mode 100644
index 0000000..017fb09
Binary files /dev/null and b/img/Monte Carlo method.webp differ
diff --git a/img/NAND gate.webp b/img/NAND gate.webp
new file mode 100644
index 0000000..0525c8b
Binary files /dev/null and b/img/NAND gate.webp differ
diff --git a/img/NOR gate.webp b/img/NOR gate.webp
new file mode 100644
index 0000000..bd71ef3
Binary files /dev/null and b/img/NOR gate.webp differ
diff --git a/img/Newtons 1st law.webp b/img/Newtons 1st law.webp
new file mode 100644
index 0000000..28dc360
Binary files /dev/null and b/img/Newtons 1st law.webp differ
diff --git a/img/Newtons 2nd law.webp b/img/Newtons 2nd law.webp
new file mode 100644
index 0000000..478236d
Binary files /dev/null and b/img/Newtons 2nd law.webp differ
diff --git a/img/Newtons 3rd law.webp b/img/Newtons 3rd law.webp
new file mode 100644
index 0000000..1634991
Binary files /dev/null and b/img/Newtons 3rd law.webp differ
diff --git a/img/Noether violation.webp b/img/Noether violation.webp
new file mode 100644
index 0000000..884d5d2
Binary files /dev/null and b/img/Noether violation.webp differ
diff --git a/img/Occams razor.webp b/img/Occams razor.webp
new file mode 100644
index 0000000..cf6a4d3
Binary files /dev/null and b/img/Occams razor.webp differ
diff --git a/img/Pauli exclusion.webp b/img/Pauli exclusion.webp
new file mode 100644
index 0000000..589abb5
Binary files /dev/null and b/img/Pauli exclusion.webp differ
diff --git a/img/UHMWPE.webp b/img/UHMWPE.webp
new file mode 100644
index 0000000..b893961
Binary files /dev/null and b/img/UHMWPE.webp differ
diff --git a/img/WIMPs.webp b/img/WIMPs.webp
new file mode 100644
index 0000000..66ba2fb
Binary files /dev/null and b/img/WIMPs.webp differ
diff --git a/img/Zenos paradox.webp b/img/Zenos paradox.webp
new file mode 100644
index 0000000..c328496
Binary files /dev/null and b/img/Zenos paradox.webp differ
diff --git a/img/abiogenesis.webp b/img/abiogenesis.webp
new file mode 100644
index 0000000..1e36cbf
Binary files /dev/null and b/img/abiogenesis.webp differ
diff --git a/img/ablative drones.webp b/img/ablative drones.webp
new file mode 100644
index 0000000..78f4c4a
Binary files /dev/null and b/img/ablative drones.webp differ
diff --git a/img/acetone peroxide.webp b/img/acetone peroxide.webp
new file mode 100644
index 0000000..8889d4b
Binary files /dev/null and b/img/acetone peroxide.webp differ
diff --git a/img/active cooling.webp b/img/active cooling.webp
new file mode 100644
index 0000000..0c05fbe
Binary files /dev/null and b/img/active cooling.webp differ
diff --git a/img/ad hoc.webp b/img/ad hoc.webp
new file mode 100644
index 0000000..44a62e3
Binary files /dev/null and b/img/ad hoc.webp differ
diff --git a/img/adiabatic healing.webp b/img/adiabatic healing.webp
new file mode 100644
index 0000000..0e25359
Binary files /dev/null and b/img/adiabatic healing.webp differ
diff --git a/img/aerogel.webp b/img/aerogel.webp
new file mode 100644
index 0000000..a3b9e83
Binary files /dev/null and b/img/aerogel.webp differ
diff --git a/img/affine connection.webp b/img/affine connection.webp
new file mode 100644
index 0000000..fb05fd0
Binary files /dev/null and b/img/affine connection.webp differ
diff --git a/img/alternator.webp b/img/alternator.webp
new file mode 100644
index 0000000..ef2098d
Binary files /dev/null and b/img/alternator.webp differ
diff --git a/img/ammonium nitrate.webp b/img/ammonium nitrate.webp
new file mode 100644
index 0000000..e2fe4e0
Binary files /dev/null and b/img/ammonium nitrate.webp differ
diff --git a/img/amplitude.webp b/img/amplitude.webp
new file mode 100644
index 0000000..6e4e39b
Binary files /dev/null and b/img/amplitude.webp differ
diff --git a/img/annihilation.webp b/img/annihilation.webp
new file mode 100644
index 0000000..4a37c35
Binary files /dev/null and b/img/annihilation.webp differ
diff --git a/img/ansatz.webp b/img/ansatz.webp
new file mode 100644
index 0000000..3b9a4d7
Binary files /dev/null and b/img/ansatz.webp differ
diff --git a/img/anthropic principle.webp b/img/anthropic principle.webp
new file mode 100644
index 0000000..28035f9
Binary files /dev/null and b/img/anthropic principle.webp differ
diff --git a/img/anti-shear topology.webp b/img/anti-shear topology.webp
new file mode 100644
index 0000000..61dcda6
Binary files /dev/null and b/img/anti-shear topology.webp differ
diff --git a/img/anticorrelation.webp b/img/anticorrelation.webp
new file mode 100644
index 0000000..2d6a05e
Binary files /dev/null and b/img/anticorrelation.webp differ
diff --git a/img/antiscience.webp b/img/antiscience.webp
new file mode 100644
index 0000000..057e650
Binary files /dev/null and b/img/antiscience.webp differ
diff --git a/img/apomixis.webp b/img/apomixis.webp
new file mode 100644
index 0000000..1aa7128
Binary files /dev/null and b/img/apomixis.webp differ
diff --git a/img/applied science.webp b/img/applied science.webp
new file mode 100644
index 0000000..aecde79
Binary files /dev/null and b/img/applied science.webp differ
diff --git a/img/arsenal.webp b/img/arsenal.webp
new file mode 100644
index 0000000..3a22e85
Binary files /dev/null and b/img/arsenal.webp differ
diff --git a/img/autocannon.webp b/img/autocannon.webp
new file mode 100644
index 0000000..c8823d1
Binary files /dev/null and b/img/autocannon.webp differ
diff --git a/img/axial flux motor.webp b/img/axial flux motor.webp
new file mode 100644
index 0000000..7065251
Binary files /dev/null and b/img/axial flux motor.webp differ
diff --git a/img/axion.webp b/img/axion.webp
new file mode 100644
index 0000000..3e79c12
Binary files /dev/null and b/img/axion.webp differ
diff --git a/img/band gap.webp b/img/band gap.webp
new file mode 100644
index 0000000..0427cd4
Binary files /dev/null and b/img/band gap.webp differ
diff --git a/img/beta radiation.webp b/img/beta radiation.webp
new file mode 100644
index 0000000..24970c6
Binary files /dev/null and b/img/beta radiation.webp differ
diff --git a/img/booby trap.webp b/img/booby trap.webp
new file mode 100644
index 0000000..f06502f
Binary files /dev/null and b/img/booby trap.webp differ
diff --git a/img/boom-bot upgrade.webp b/img/boom-bot upgrade.webp
new file mode 100644
index 0000000..127b91d
Binary files /dev/null and b/img/boom-bot upgrade.webp differ
diff --git a/img/boom-bot.webp b/img/boom-bot.webp
new file mode 100644
index 0000000..76ee2fd
Binary files /dev/null and b/img/boom-bot.webp differ
diff --git a/img/boson composite.webp b/img/boson composite.webp
new file mode 100644
index 0000000..3f0daa9
Binary files /dev/null and b/img/boson composite.webp differ
diff --git a/img/bot fabrication.webp b/img/bot fabrication.webp
new file mode 100644
index 0000000..8e4efae
Binary files /dev/null and b/img/bot fabrication.webp differ
diff --git a/img/bot manufacturing.webp b/img/bot manufacturing.webp
new file mode 100644
index 0000000..930875f
Binary files /dev/null and b/img/bot manufacturing.webp differ
diff --git a/img/bot prototypes.webp b/img/bot prototypes.webp
new file mode 100644
index 0000000..431a668
Binary files /dev/null and b/img/bot prototypes.webp differ
diff --git a/img/bound state.webp b/img/bound state.webp
new file mode 100644
index 0000000..f134f44
Binary files /dev/null and b/img/bound state.webp differ
diff --git a/img/brainstorming.webp b/img/brainstorming.webp
new file mode 100644
index 0000000..d7d327f
Binary files /dev/null and b/img/brainstorming.webp differ
diff --git a/img/bremsstrahlung.webp b/img/bremsstrahlung.webp
new file mode 100644
index 0000000..d7fe0fc
Binary files /dev/null and b/img/bremsstrahlung.webp differ
diff --git a/img/brushless motor.webp b/img/brushless motor.webp
new file mode 100644
index 0000000..c3b7648
Binary files /dev/null and b/img/brushless motor.webp differ
diff --git a/img/bubble fusion.webp b/img/bubble fusion.webp
new file mode 100644
index 0000000..c45a179
Binary files /dev/null and b/img/bubble fusion.webp differ
diff --git a/img/buckling.webp b/img/buckling.webp
new file mode 100644
index 0000000..17f10fe
Binary files /dev/null and b/img/buckling.webp differ
diff --git a/img/bulk modulus.webp b/img/bulk modulus.webp
new file mode 100644
index 0000000..736fe5b
Binary files /dev/null and b/img/bulk modulus.webp differ
diff --git a/img/cache.webp b/img/cache.webp
new file mode 100644
index 0000000..d0dcbdc
Binary files /dev/null and b/img/cache.webp differ
diff --git a/img/capacitor bank.webp b/img/capacitor bank.webp
new file mode 100644
index 0000000..2f631d6
Binary files /dev/null and b/img/capacitor bank.webp differ
diff --git a/img/catabolism.webp b/img/catabolism.webp
new file mode 100644
index 0000000..3fbfea3
Binary files /dev/null and b/img/catabolism.webp differ
diff --git a/img/causality bombs.webp b/img/causality bombs.webp
new file mode 100644
index 0000000..2b78996
Binary files /dev/null and b/img/causality bombs.webp differ
diff --git a/img/causality bots.webp b/img/causality bots.webp
new file mode 100644
index 0000000..26c9b03
Binary files /dev/null and b/img/causality bots.webp differ
diff --git a/img/ceramics.webp b/img/ceramics.webp
new file mode 100644
index 0000000..6cdd6e6
Binary files /dev/null and b/img/ceramics.webp differ
diff --git a/img/chain reaction.webp b/img/chain reaction.webp
new file mode 100644
index 0000000..3ab476f
Binary files /dev/null and b/img/chain reaction.webp differ
diff --git a/img/charmed baryons.webp b/img/charmed baryons.webp
new file mode 100644
index 0000000..79b6d26
Binary files /dev/null and b/img/charmed baryons.webp differ
diff --git a/img/cherenkov radiation.webp b/img/cherenkov radiation.webp
new file mode 100644
index 0000000..23c6296
Binary files /dev/null and b/img/cherenkov radiation.webp differ
diff --git a/img/clock gating.webp b/img/clock gating.webp
new file mode 100644
index 0000000..03bdc91
Binary files /dev/null and b/img/clock gating.webp differ
diff --git a/img/colony.webp b/img/colony.webp
new file mode 100644
index 0000000..5a6cfee
Binary files /dev/null and b/img/colony.webp differ
diff --git a/img/combinatorial optimization.webp b/img/combinatorial optimization.webp
new file mode 100644
index 0000000..532c597
Binary files /dev/null and b/img/combinatorial optimization.webp differ
diff --git a/img/commodities exchange.webp b/img/commodities exchange.webp
new file mode 100644
index 0000000..edad9af
Binary files /dev/null and b/img/commodities exchange.webp differ
diff --git a/img/compound lens.webp b/img/compound lens.webp
new file mode 100644
index 0000000..1357aef
Binary files /dev/null and b/img/compound lens.webp differ
diff --git a/img/corona discharge.webp b/img/corona discharge.webp
new file mode 100644
index 0000000..196505b
Binary files /dev/null and b/img/corona discharge.webp differ
diff --git a/img/correlated damage.webp b/img/correlated damage.webp
new file mode 100644
index 0000000..cd93b2c
Binary files /dev/null and b/img/correlated damage.webp differ
diff --git a/img/cosmic string.webp b/img/cosmic string.webp
new file mode 100644
index 0000000..51338eb
Binary files /dev/null and b/img/cosmic string.webp differ
diff --git a/img/cross-disciplinary.webp b/img/cross-disciplinary.webp
new file mode 100644
index 0000000..31c94f4
Binary files /dev/null and b/img/cross-disciplinary.webp differ
diff --git a/img/cruise missile.webp b/img/cruise missile.webp
new file mode 100644
index 0000000..d1e9e44
Binary files /dev/null and b/img/cruise missile.webp differ
diff --git a/img/cryodesiccation.webp b/img/cryodesiccation.webp
new file mode 100644
index 0000000..f36e272
Binary files /dev/null and b/img/cryodesiccation.webp differ
diff --git a/img/crystallizer.webp b/img/crystallizer.webp
new file mode 100644
index 0000000..8539db9
Binary files /dev/null and b/img/crystallizer.webp differ
diff --git a/img/dark patterns.webp b/img/dark patterns.webp
new file mode 100644
index 0000000..f147c9e
Binary files /dev/null and b/img/dark patterns.webp differ
diff --git a/img/dazzler.webp b/img/dazzler.webp
new file mode 100644
index 0000000..7ae326c
Binary files /dev/null and b/img/dazzler.webp differ
diff --git a/img/dead reckoning.webp b/img/dead reckoning.webp
new file mode 100644
index 0000000..aca40a0
Binary files /dev/null and b/img/dead reckoning.webp differ
diff --git a/img/decoherence.webp b/img/decoherence.webp
new file mode 100644
index 0000000..82b4650
Binary files /dev/null and b/img/decoherence.webp differ
diff --git a/img/decorrelation.webp b/img/decorrelation.webp
new file mode 100644
index 0000000..8abd942
Binary files /dev/null and b/img/decorrelation.webp differ
diff --git a/img/decoupling.webp b/img/decoupling.webp
new file mode 100644
index 0000000..6776cc3
Binary files /dev/null and b/img/decoupling.webp differ
diff --git a/img/degenerate matter.webp b/img/degenerate matter.webp
new file mode 100644
index 0000000..de58216
Binary files /dev/null and b/img/degenerate matter.webp differ
diff --git a/img/delivery drone.webp b/img/delivery drone.webp
new file mode 100644
index 0000000..91c7477
Binary files /dev/null and b/img/delivery drone.webp differ
diff --git a/img/desublimated ammunition.webp b/img/desublimated ammunition.webp
new file mode 100644
index 0000000..fab54cf
Binary files /dev/null and b/img/desublimated ammunition.webp differ
diff --git a/img/determinism.webp b/img/determinism.webp
new file mode 100644
index 0000000..02b07fb
Binary files /dev/null and b/img/determinism.webp differ
diff --git a/img/diffraction grating.webp b/img/diffraction grating.webp
new file mode 100644
index 0000000..53fed27
Binary files /dev/null and b/img/diffraction grating.webp differ
diff --git a/img/diffuse beam.webp b/img/diffuse beam.webp
new file mode 100644
index 0000000..5402793
Binary files /dev/null and b/img/diffuse beam.webp differ
diff --git a/img/drone repair.webp b/img/drone repair.webp
new file mode 100644
index 0000000..bc4ee46
Binary files /dev/null and b/img/drone repair.webp differ
diff --git a/img/dye laser.webp b/img/dye laser.webp
new file mode 100644
index 0000000..3a9cf69
Binary files /dev/null and b/img/dye laser.webp differ
diff --git a/img/dynamic equilibrium.webp b/img/dynamic equilibrium.webp
new file mode 100644
index 0000000..c26522b
Binary files /dev/null and b/img/dynamic equilibrium.webp differ
diff --git a/img/dynamical systems.webp b/img/dynamical systems.webp
new file mode 100644
index 0000000..825d7fd
Binary files /dev/null and b/img/dynamical systems.webp differ
diff --git a/img/dynamo-bot upgrade.webp b/img/dynamo-bot upgrade.webp
new file mode 100644
index 0000000..15b3d61
Binary files /dev/null and b/img/dynamo-bot upgrade.webp differ
diff --git a/img/dynamo-bot.webp b/img/dynamo-bot.webp
new file mode 100644
index 0000000..71f5d05
Binary files /dev/null and b/img/dynamo-bot.webp differ
diff --git a/img/eddy current brake.webp b/img/eddy current brake.webp
new file mode 100644
index 0000000..9d95e5a
Binary files /dev/null and b/img/eddy current brake.webp differ
diff --git a/img/electric armor.webp b/img/electric armor.webp
new file mode 100644
index 0000000..2ee7dc0
Binary files /dev/null and b/img/electric armor.webp differ
diff --git a/img/electric generator.webp b/img/electric generator.webp
new file mode 100644
index 0000000..9c23ad3
Binary files /dev/null and b/img/electric generator.webp differ
diff --git a/img/electronegativity.webp b/img/electronegativity.webp
new file mode 100644
index 0000000..99c0822
Binary files /dev/null and b/img/electronegativity.webp differ
diff --git a/img/electrostatic induction.webp b/img/electrostatic induction.webp
new file mode 100644
index 0000000..8d1b018
Binary files /dev/null and b/img/electrostatic induction.webp differ
diff --git a/img/elephants toothpaste.webp b/img/elephants toothpaste.webp
new file mode 100644
index 0000000..3e94597
Binary files /dev/null and b/img/elephants toothpaste.webp differ
diff --git a/img/emergence.webp b/img/emergence.webp
new file mode 100644
index 0000000..f7d87e0
Binary files /dev/null and b/img/emergence.webp differ
diff --git a/img/energy conservation.webp b/img/energy conservation.webp
new file mode 100644
index 0000000..9b52335
Binary files /dev/null and b/img/energy conservation.webp differ
diff --git a/img/enthalpy.webp b/img/enthalpy.webp
new file mode 100644
index 0000000..c663288
Binary files /dev/null and b/img/enthalpy.webp differ
diff --git a/img/ergodicity.webp b/img/ergodicity.webp
new file mode 100644
index 0000000..6e82295
Binary files /dev/null and b/img/ergodicity.webp differ
diff --git a/img/ersatz bots.webp b/img/ersatz bots.webp
new file mode 100644
index 0000000..3074c07
Binary files /dev/null and b/img/ersatz bots.webp differ
diff --git a/img/eternalism.webp b/img/eternalism.webp
new file mode 100644
index 0000000..08df1ea
Binary files /dev/null and b/img/eternalism.webp differ
diff --git a/img/exchange symmetry.webp b/img/exchange symmetry.webp
new file mode 100644
index 0000000..15a2c09
Binary files /dev/null and b/img/exchange symmetry.webp differ
diff --git a/img/exciton.webp b/img/exciton.webp
new file mode 100644
index 0000000..d6a99ba
Binary files /dev/null and b/img/exciton.webp differ
diff --git a/img/exothermic process.webp b/img/exothermic process.webp
new file mode 100644
index 0000000..a75216f
Binary files /dev/null and b/img/exothermic process.webp differ
diff --git a/img/expansion.webp b/img/expansion.webp
new file mode 100644
index 0000000..a4645c6
Binary files /dev/null and b/img/expansion.webp differ
diff --git a/img/extruder.webp b/img/extruder.webp
new file mode 100644
index 0000000..eb14af0
Binary files /dev/null and b/img/extruder.webp differ
diff --git a/img/fault tolerance.webp b/img/fault tolerance.webp
new file mode 100644
index 0000000..359b392
Binary files /dev/null and b/img/fault tolerance.webp differ
diff --git a/img/field coupling.webp b/img/field coupling.webp
new file mode 100644
index 0000000..06376a9
Binary files /dev/null and b/img/field coupling.webp differ
diff --git a/img/field/field emitter0.webp b/img/field/field emitter0.webp
new file mode 100644
index 0000000..3ab87f6
Binary files /dev/null and b/img/field/field emitter0.webp differ
diff --git a/img/field/field emitter1.webp b/img/field/field emitter1.webp
new file mode 100644
index 0000000..f92a41c
Binary files /dev/null and b/img/field/field emitter1.webp differ
diff --git a/img/field/field emitter2.webp b/img/field/field emitter2.webp
new file mode 100644
index 0000000..e6ac350
Binary files /dev/null and b/img/field/field emitter2.webp differ
diff --git a/img/field/field emitter3.webp b/img/field/field emitter3.webp
new file mode 100644
index 0000000..dd85734
Binary files /dev/null and b/img/field/field emitter3.webp differ
diff --git a/img/field/field emitter4.webp b/img/field/field emitter4.webp
new file mode 100644
index 0000000..8bff016
Binary files /dev/null and b/img/field/field emitter4.webp differ
diff --git a/img/field/field emitter5.webp b/img/field/field emitter5.webp
new file mode 100644
index 0000000..ef1a667
Binary files /dev/null and b/img/field/field emitter5.webp differ
diff --git a/img/field/field emitter6.webp b/img/field/field emitter6.webp
new file mode 100644
index 0000000..144313a
Binary files /dev/null and b/img/field/field emitter6.webp differ
diff --git a/img/field/field emitter7.webp b/img/field/field emitter7.webp
new file mode 100644
index 0000000..baad4a3
Binary files /dev/null and b/img/field/field emitter7.webp differ
diff --git a/img/field/field emitter8.webp b/img/field/field emitter8.webp
new file mode 100644
index 0000000..4ed2781
Binary files /dev/null and b/img/field/field emitter8.webp differ
diff --git a/img/field/field emitter9.webp b/img/field/field emitter9.webp
new file mode 100644
index 0000000..7b9a847
Binary files /dev/null and b/img/field/field emitter9.webp differ
diff --git a/img/field/metamaterial cloaking.webp b/img/field/metamaterial cloaking.webp
new file mode 100644
index 0000000..2273eab
Binary files /dev/null and b/img/field/metamaterial cloaking.webp differ
diff --git a/img/field/molecular assembler.webp b/img/field/molecular assembler.webp
new file mode 100644
index 0000000..0478e95
Binary files /dev/null and b/img/field/molecular assembler.webp differ
diff --git a/img/field/negative mass.webp b/img/field/negative mass.webp
new file mode 100644
index 0000000..f6f94dd
Binary files /dev/null and b/img/field/negative mass.webp differ
diff --git a/img/field/perfect diamagnetism.webp b/img/field/perfect diamagnetism.webp
new file mode 100644
index 0000000..82a5f1f
Binary files /dev/null and b/img/field/perfect diamagnetism.webp differ
diff --git a/img/field/pilot wave.webp b/img/field/pilot wave.webp
new file mode 100644
index 0000000..b8b54ae
Binary files /dev/null and b/img/field/pilot wave.webp differ
diff --git a/img/field/plasma torch.webp b/img/field/plasma torch.webp
new file mode 100644
index 0000000..95cbaef
Binary files /dev/null and b/img/field/plasma torch.webp differ
diff --git a/img/field/quantum immortality.webp b/img/field/quantum immortality.webp
new file mode 100644
index 0000000..6e730bf
Binary files /dev/null and b/img/field/quantum immortality.webp differ
diff --git a/img/field/squirrel-cage rotor.webp b/img/field/squirrel-cage rotor.webp
new file mode 100644
index 0000000..87209ad
Binary files /dev/null and b/img/field/squirrel-cage rotor.webp differ
diff --git a/img/field/standing wave.webp b/img/field/standing wave.webp
new file mode 100644
index 0000000..5f237b6
Binary files /dev/null and b/img/field/standing wave.webp differ
diff --git a/img/field/time dilation.webp b/img/field/time dilation.webp
new file mode 100644
index 0000000..e7c0cc1
Binary files /dev/null and b/img/field/time dilation.webp differ
diff --git a/img/field/wormhole.webp b/img/field/wormhole.webp
new file mode 100644
index 0000000..ec2fab4
Binary files /dev/null and b/img/field/wormhole.webp differ
diff --git a/img/fine-structure constant.webp b/img/fine-structure constant.webp
new file mode 100644
index 0000000..d070faa
Binary files /dev/null and b/img/fine-structure constant.webp differ
diff --git a/img/fireworks.webp b/img/fireworks.webp
new file mode 100644
index 0000000..b73b126
Binary files /dev/null and b/img/fireworks.webp differ
diff --git a/img/first derivative.webp b/img/first derivative.webp
new file mode 100644
index 0000000..f32d1bd
Binary files /dev/null and b/img/first derivative.webp differ
diff --git a/img/flagella.webp b/img/flagella.webp
new file mode 100644
index 0000000..130ca50
Binary files /dev/null and b/img/flagella.webp differ
diff --git a/img/flame test.webp b/img/flame test.webp
new file mode 100644
index 0000000..c9f5013
Binary files /dev/null and b/img/flame test.webp differ
diff --git a/img/flash freeze.webp b/img/flash freeze.webp
new file mode 100644
index 0000000..bb5d0a0
Binary files /dev/null and b/img/flash freeze.webp differ
diff --git a/img/flip-flop.webp b/img/flip-flop.webp
new file mode 100644
index 0000000..9c0d494
Binary files /dev/null and b/img/flip-flop.webp differ
diff --git a/img/fluoroantimonic acid.webp b/img/fluoroantimonic acid.webp
new file mode 100644
index 0000000..23918ed
Binary files /dev/null and b/img/fluoroantimonic acid.webp differ
diff --git a/img/flux pinning.webp b/img/flux pinning.webp
new file mode 100644
index 0000000..aa2baa0
Binary files /dev/null and b/img/flux pinning.webp differ
diff --git a/img/flywheel.webp b/img/flywheel.webp
new file mode 100644
index 0000000..953e9f2
Binary files /dev/null and b/img/flywheel.webp differ
diff --git a/img/foam fractionation.webp b/img/foam fractionation.webp
new file mode 100644
index 0000000..46b24ab
Binary files /dev/null and b/img/foam fractionation.webp differ
diff --git a/img/foam-bot upgrade.webp b/img/foam-bot upgrade.webp
new file mode 100644
index 0000000..5b729cb
Binary files /dev/null and b/img/foam-bot upgrade.webp differ
diff --git a/img/foam-bot.webp b/img/foam-bot.webp
new file mode 100644
index 0000000..b6a49b7
Binary files /dev/null and b/img/foam-bot.webp differ
diff --git a/img/foam-shot.webp b/img/foam-shot.webp
new file mode 100644
index 0000000..f7ecda9
Binary files /dev/null and b/img/foam-shot.webp differ
diff --git a/img/fracture analysis.webp b/img/fracture analysis.webp
new file mode 100644
index 0000000..0988e9e
Binary files /dev/null and b/img/fracture analysis.webp differ
diff --git a/img/fragmentation.webp b/img/fragmentation.webp
new file mode 100644
index 0000000..ea6c04b
Binary files /dev/null and b/img/fragmentation.webp differ
diff --git a/img/frame-dragging.webp b/img/frame-dragging.webp
new file mode 100644
index 0000000..09b90ba
Binary files /dev/null and b/img/frame-dragging.webp differ
diff --git a/img/free-electron laser.webp b/img/free-electron laser.webp
new file mode 100644
index 0000000..236492f
Binary files /dev/null and b/img/free-electron laser.webp differ
diff --git a/img/freezer burn.webp b/img/freezer burn.webp
new file mode 100644
index 0000000..57750a4
Binary files /dev/null and b/img/freezer burn.webp differ
diff --git a/img/frequency.webp b/img/frequency.webp
new file mode 100644
index 0000000..b8b26a2
Binary files /dev/null and b/img/frequency.webp differ
diff --git a/img/futures exchange.webp b/img/futures exchange.webp
new file mode 100644
index 0000000..8d492ac
Binary files /dev/null and b/img/futures exchange.webp differ
diff --git a/img/gauge.webp b/img/gauge.webp
new file mode 100644
index 0000000..d5c4df4
Binary files /dev/null and b/img/gauge.webp differ
diff --git a/img/generalist.webp b/img/generalist.webp
new file mode 100644
index 0000000..802cbb2
Binary files /dev/null and b/img/generalist.webp differ
diff --git a/img/geodesics.webp b/img/geodesics.webp
new file mode 100644
index 0000000..4cb475b
Binary files /dev/null and b/img/geodesics.webp differ
diff --git a/img/grappling hook.webp b/img/grappling hook.webp
new file mode 100644
index 0000000..4b54ade
Binary files /dev/null and b/img/grappling hook.webp differ
diff --git a/img/ground state.webp b/img/ground state.webp
new file mode 100644
index 0000000..5e6ba80
Binary files /dev/null and b/img/ground state.webp differ
diff --git a/img/gun turret.webp b/img/gun turret.webp
new file mode 100644
index 0000000..ca8bc6c
Binary files /dev/null and b/img/gun turret.webp differ
diff --git a/img/gun/drones.webp b/img/gun/drones.webp
new file mode 100644
index 0000000..6429896
Binary files /dev/null and b/img/gun/drones.webp differ
diff --git a/img/gun/foam.webp b/img/gun/foam.webp
new file mode 100644
index 0000000..69944a5
Binary files /dev/null and b/img/gun/foam.webp differ
diff --git a/img/gun/grenades.webp b/img/gun/grenades.webp
new file mode 100644
index 0000000..6b5e3d1
Binary files /dev/null and b/img/gun/grenades.webp differ
diff --git a/img/gun/harpoon.webp b/img/gun/harpoon.webp
new file mode 100644
index 0000000..fcf8bed
Binary files /dev/null and b/img/gun/harpoon.webp differ
diff --git a/img/gun/laser.webp b/img/gun/laser.webp
new file mode 100644
index 0000000..694a711
Binary files /dev/null and b/img/gun/laser.webp differ
diff --git a/img/gun/mine.webp b/img/gun/mine.webp
new file mode 100644
index 0000000..dc49e3c
Binary files /dev/null and b/img/gun/mine.webp differ
diff --git a/img/gun/missiles.webp b/img/gun/missiles.webp
new file mode 100644
index 0000000..2e822b5
Binary files /dev/null and b/img/gun/missiles.webp differ
diff --git a/img/gun/nail gun.webp b/img/gun/nail gun.webp
new file mode 100644
index 0000000..c8b1743
Binary files /dev/null and b/img/gun/nail gun.webp differ
diff --git a/img/gun/shotgun.webp b/img/gun/shotgun.webp
new file mode 100644
index 0000000..6714812
Binary files /dev/null and b/img/gun/shotgun.webp differ
diff --git a/img/gun/spores.webp b/img/gun/spores.webp
new file mode 100644
index 0000000..3fa7c04
Binary files /dev/null and b/img/gun/spores.webp differ
diff --git a/img/gun/super balls.webp b/img/gun/super balls.webp
new file mode 100644
index 0000000..1daa387
Binary files /dev/null and b/img/gun/super balls.webp differ
diff --git a/img/gun/wave.webp b/img/gun/wave.webp
new file mode 100644
index 0000000..fb115db
Binary files /dev/null and b/img/gun/wave.webp differ
diff --git a/img/heat engine.webp b/img/heat engine.webp
new file mode 100644
index 0000000..7394708
Binary files /dev/null and b/img/heat engine.webp differ
diff --git a/img/heuristics.webp b/img/heuristics.webp
new file mode 100644
index 0000000..1d2db74
Binary files /dev/null and b/img/heuristics.webp differ
diff --git a/img/homeostasis.webp b/img/homeostasis.webp
new file mode 100644
index 0000000..9d107d3
Binary files /dev/null and b/img/homeostasis.webp differ
diff --git a/img/ice crystal nucleation.webp b/img/ice crystal nucleation.webp
new file mode 100644
index 0000000..160876b
Binary files /dev/null and b/img/ice crystal nucleation.webp differ
diff --git a/img/ice-shot.webp b/img/ice-shot.webp
new file mode 100644
index 0000000..4f3169e
Binary files /dev/null and b/img/ice-shot.webp differ
diff --git a/img/ideal gas law.webp b/img/ideal gas law.webp
new file mode 100644
index 0000000..e00129a
Binary files /dev/null and b/img/ideal gas law.webp differ
diff --git a/img/incendiary ammunition.webp b/img/incendiary ammunition.webp
new file mode 100644
index 0000000..643248d
Binary files /dev/null and b/img/incendiary ammunition.webp differ
diff --git a/img/induction furnace.webp b/img/induction furnace.webp
new file mode 100644
index 0000000..af1aac8
Binary files /dev/null and b/img/induction furnace.webp differ
diff --git a/img/inductive charging.webp b/img/inductive charging.webp
new file mode 100644
index 0000000..e3765ea
Binary files /dev/null and b/img/inductive charging.webp differ
diff --git a/img/inertial mass.webp b/img/inertial mass.webp
new file mode 100644
index 0000000..0630900
Binary files /dev/null and b/img/inertial mass.webp differ
diff --git a/img/inflation.webp b/img/inflation.webp
new file mode 100644
index 0000000..1f4374e
Binary files /dev/null and b/img/inflation.webp differ
diff --git a/img/infrared diode.webp b/img/infrared diode.webp
new file mode 100644
index 0000000..e6a0d5a
Binary files /dev/null and b/img/infrared diode.webp differ
diff --git a/img/integrated armament.webp b/img/integrated armament.webp
new file mode 100644
index 0000000..b876da6
Binary files /dev/null and b/img/integrated armament.webp differ
diff --git a/img/integrated circuit.webp b/img/integrated circuit.webp
new file mode 100644
index 0000000..3feb4a4
Binary files /dev/null and b/img/integrated circuit.webp differ
diff --git a/img/invariant.webp b/img/invariant.webp
new file mode 100644
index 0000000..9092bed
Binary files /dev/null and b/img/invariant.webp differ
diff --git a/img/iridescence.webp b/img/iridescence.webp
new file mode 100644
index 0000000..4bdb1e1
Binary files /dev/null and b/img/iridescence.webp differ
diff --git a/img/iridium-192.webp b/img/iridium-192.webp
new file mode 100644
index 0000000..bd58949
Binary files /dev/null and b/img/iridium-192.webp differ
diff --git a/img/irradiated drones.webp b/img/irradiated drones.webp
new file mode 100644
index 0000000..d3f2db5
Binary files /dev/null and b/img/irradiated drones.webp differ
diff --git a/img/irradiated nails.webp b/img/irradiated nails.webp
new file mode 100644
index 0000000..7ce6e2c
Binary files /dev/null and b/img/irradiated nails.webp differ
diff --git a/img/isotropic.webp b/img/isotropic.webp
new file mode 100644
index 0000000..ef8984b
Binary files /dev/null and b/img/isotropic.webp differ
diff --git a/img/junk DNA.webp b/img/junk DNA.webp
new file mode 100644
index 0000000..c8029c6
Binary files /dev/null and b/img/junk DNA.webp differ
diff --git a/img/kinetic bombardment.webp b/img/kinetic bombardment.webp
new file mode 100644
index 0000000..f7cd8b5
Binary files /dev/null and b/img/kinetic bombardment.webp differ
diff --git a/img/laser-bot upgrade.webp b/img/laser-bot upgrade.webp
new file mode 100644
index 0000000..6df8d4e
Binary files /dev/null and b/img/laser-bot upgrade.webp differ
diff --git a/img/laser-bot.webp b/img/laser-bot.webp
new file mode 100644
index 0000000..1e82e9a
Binary files /dev/null and b/img/laser-bot.webp differ
diff --git a/img/laser-mines.webp b/img/laser-mines.webp
new file mode 100644
index 0000000..639f6ca
Binary files /dev/null and b/img/laser-mines.webp differ
diff --git a/img/launch system.webp b/img/launch system.webp
new file mode 100644
index 0000000..8c10eab
Binary files /dev/null and b/img/launch system.webp differ
diff --git a/img/lens.webp b/img/lens.webp
new file mode 100644
index 0000000..1ad4e50
Binary files /dev/null and b/img/lens.webp differ
diff --git a/img/liquid cooling.webp b/img/liquid cooling.webp
new file mode 100644
index 0000000..1f9fb98
Binary files /dev/null and b/img/liquid cooling.webp differ
diff --git a/img/lithium-ion.webp b/img/lithium-ion.webp
new file mode 100644
index 0000000..73ae0e7
Binary files /dev/null and b/img/lithium-ion.webp differ
diff --git a/img/logistics.webp b/img/logistics.webp
new file mode 100644
index 0000000..1b31696
Binary files /dev/null and b/img/logistics.webp differ
diff --git a/img/maintenance.webp b/img/maintenance.webp
new file mode 100644
index 0000000..c6b1da8
Binary files /dev/null and b/img/maintenance.webp differ
diff --git a/img/many-worlds.webp b/img/many-worlds.webp
new file mode 100644
index 0000000..d3028e4
Binary files /dev/null and b/img/many-worlds.webp differ
diff --git a/img/mass driver.webp b/img/mass driver.webp
new file mode 100644
index 0000000..fe943e3
Binary files /dev/null and b/img/mass driver.webp differ
diff --git a/img/mass-energy equivalence.webp b/img/mass-energy equivalence.webp
new file mode 100644
index 0000000..b00a85b
Binary files /dev/null and b/img/mass-energy equivalence.webp differ
diff --git a/img/mechanical resonance.webp b/img/mechanical resonance.webp
new file mode 100644
index 0000000..c609231
Binary files /dev/null and b/img/mechanical resonance.webp differ
diff --git a/img/meta-analysis.webp b/img/meta-analysis.webp
new file mode 100644
index 0000000..3fe80d8
Binary files /dev/null and b/img/meta-analysis.webp differ
diff --git a/img/metastability.webp b/img/metastability.webp
new file mode 100644
index 0000000..2a4e8b1
Binary files /dev/null and b/img/metastability.webp differ
diff --git a/img/microstates.webp b/img/microstates.webp
new file mode 100644
index 0000000..f3794f2
Binary files /dev/null and b/img/microstates.webp differ
diff --git a/img/missile-bot.webp b/img/missile-bot.webp
new file mode 100644
index 0000000..d465f09
Binary files /dev/null and b/img/missile-bot.webp differ
diff --git a/img/mutualism.webp b/img/mutualism.webp
new file mode 100644
index 0000000..e1fb494
Binary files /dev/null and b/img/mutualism.webp differ
diff --git a/img/mycelial fragmentation.webp b/img/mycelial fragmentation.webp
new file mode 100644
index 0000000..7c8f807
Binary files /dev/null and b/img/mycelial fragmentation.webp differ
diff --git a/img/nail-bot upgrade.webp b/img/nail-bot upgrade.webp
new file mode 100644
index 0000000..fc3518a
Binary files /dev/null and b/img/nail-bot upgrade.webp differ
diff --git a/img/nail-bot.webp b/img/nail-bot.webp
new file mode 100644
index 0000000..1b0da80
Binary files /dev/null and b/img/nail-bot.webp differ
diff --git a/img/nail-shot.webp b/img/nail-shot.webp
new file mode 100644
index 0000000..d9743f9
Binary files /dev/null and b/img/nail-shot.webp differ
diff --git a/img/nanowires.webp b/img/nanowires.webp
new file mode 100644
index 0000000..e7c6b61
Binary files /dev/null and b/img/nanowires.webp differ
diff --git a/img/necrophage.webp b/img/necrophage.webp
new file mode 100644
index 0000000..47f7fae
Binary files /dev/null and b/img/necrophage.webp differ
diff --git a/img/needle gun.webp b/img/needle gun.webp
new file mode 100644
index 0000000..b976c12
Binary files /dev/null and b/img/needle gun.webp differ
diff --git a/img/needle ice.webp b/img/needle ice.webp
new file mode 100644
index 0000000..4235695
Binary files /dev/null and b/img/needle ice.webp differ
diff --git a/img/negative entropy.webp b/img/negative entropy.webp
new file mode 100644
index 0000000..734de05
Binary files /dev/null and b/img/negative entropy.webp differ
diff --git a/img/negative feedback.webp b/img/negative feedback.webp
new file mode 100644
index 0000000..e48783b
Binary files /dev/null and b/img/negative feedback.webp differ
diff --git a/img/nematodes.webp b/img/nematodes.webp
new file mode 100644
index 0000000..3fba87f
Binary files /dev/null and b/img/nematodes.webp differ
diff --git a/img/network effect.webp b/img/network effect.webp
new file mode 100644
index 0000000..1084a7e
Binary files /dev/null and b/img/network effect.webp differ
diff --git a/img/neutron bomb.webp b/img/neutron bomb.webp
new file mode 100644
index 0000000..e5ea20f
Binary files /dev/null and b/img/neutron bomb.webp differ
diff --git a/img/neutronium.webp b/img/neutronium.webp
new file mode 100644
index 0000000..fce6535
Binary files /dev/null and b/img/neutronium.webp differ
diff --git a/img/nitroglycerin.webp b/img/nitroglycerin.webp
new file mode 100644
index 0000000..55f5f2e
Binary files /dev/null and b/img/nitroglycerin.webp differ
diff --git a/img/no-cloning theorem.webp b/img/no-cloning theorem.webp
new file mode 100644
index 0000000..25a5c43
Binary files /dev/null and b/img/no-cloning theorem.webp differ
diff --git a/img/non-Newtonian armor.webp b/img/non-Newtonian armor.webp
new file mode 100644
index 0000000..f7e3823
Binary files /dev/null and b/img/non-Newtonian armor.webp differ
diff --git a/img/non-renewables.webp b/img/non-renewables.webp
new file mode 100644
index 0000000..bd4843e
Binary files /dev/null and b/img/non-renewables.webp differ
diff --git a/img/nuclear transmutation.webp b/img/nuclear transmutation.webp
new file mode 100644
index 0000000..ba6b3f9
Binary files /dev/null and b/img/nuclear transmutation.webp differ
diff --git a/img/open-source.webp b/img/open-source.webp
new file mode 100644
index 0000000..44b6a23
Binary files /dev/null and b/img/open-source.webp differ
diff --git a/img/optical amplifier.webp b/img/optical amplifier.webp
new file mode 100644
index 0000000..7fa8051
Binary files /dev/null and b/img/optical amplifier.webp differ
diff --git a/img/options exchange.webp b/img/options exchange.webp
new file mode 100644
index 0000000..6ff2c4f
Binary files /dev/null and b/img/options exchange.webp differ
diff --git a/img/orbital-bot upgrade.webp b/img/orbital-bot upgrade.webp
new file mode 100644
index 0000000..010f6e1
Binary files /dev/null and b/img/orbital-bot upgrade.webp differ
diff --git a/img/orbital-bot.webp b/img/orbital-bot.webp
new file mode 100644
index 0000000..003029a
Binary files /dev/null and b/img/orbital-bot.webp differ
diff --git a/img/ordnance.webp b/img/ordnance.webp
new file mode 100644
index 0000000..f28c241
Binary files /dev/null and b/img/ordnance.webp differ
diff --git a/img/orthocyclic winding.webp b/img/orthocyclic winding.webp
new file mode 100644
index 0000000..770461b
Binary files /dev/null and b/img/orthocyclic winding.webp differ
diff --git a/img/output coupler.webp b/img/output coupler.webp
new file mode 100644
index 0000000..61670f8
Binary files /dev/null and b/img/output coupler.webp differ
diff --git a/img/overcharge.webp b/img/overcharge.webp
new file mode 100644
index 0000000..69f5712
Binary files /dev/null and b/img/overcharge.webp differ
diff --git a/img/pair production.webp b/img/pair production.webp
new file mode 100644
index 0000000..6e6d634
Binary files /dev/null and b/img/pair production.webp differ
diff --git a/img/paradigm shift.webp b/img/paradigm shift.webp
new file mode 100644
index 0000000..4955395
Binary files /dev/null and b/img/paradigm shift.webp differ
diff --git a/img/parasitism.webp b/img/parasitism.webp
new file mode 100644
index 0000000..dbab55b
Binary files /dev/null and b/img/parasitism.webp differ
diff --git a/img/parthenogenesis.webp b/img/parthenogenesis.webp
new file mode 100644
index 0000000..e74f1c5
Binary files /dev/null and b/img/parthenogenesis.webp differ
diff --git a/img/patch.webp b/img/patch.webp
new file mode 100644
index 0000000..dd94f4d
Binary files /dev/null and b/img/patch.webp differ
diff --git a/img/path integral.webp b/img/path integral.webp
new file mode 100644
index 0000000..a81389b
Binary files /dev/null and b/img/path integral.webp differ
diff --git a/img/path integration.webp b/img/path integration.webp
new file mode 100644
index 0000000..7eeb22b
Binary files /dev/null and b/img/path integration.webp differ
diff --git a/img/perimeter defense.webp b/img/perimeter defense.webp
new file mode 100644
index 0000000..a1b4c26
Binary files /dev/null and b/img/perimeter defense.webp differ
diff --git a/img/perturbation theory.webp b/img/perturbation theory.webp
new file mode 100644
index 0000000..6e68752
Binary files /dev/null and b/img/perturbation theory.webp differ
diff --git a/img/phase velocity.webp b/img/phase velocity.webp
new file mode 100644
index 0000000..35875c2
Binary files /dev/null and b/img/phase velocity.webp differ
diff --git a/img/phonon.webp b/img/phonon.webp
new file mode 100644
index 0000000..53f7afe
Binary files /dev/null and b/img/phonon.webp differ
diff --git a/img/piezoelectricity.webp b/img/piezoelectricity.webp
new file mode 100644
index 0000000..25ec3fc
Binary files /dev/null and b/img/piezoelectricity.webp differ
diff --git a/img/pigeonhole principle.webp b/img/pigeonhole principle.webp
new file mode 100644
index 0000000..6a825df
Binary files /dev/null and b/img/pigeonhole principle.webp differ
diff --git a/img/plasma ball.webp b/img/plasma ball.webp
new file mode 100644
index 0000000..b705d71
Binary files /dev/null and b/img/plasma ball.webp differ
diff --git a/img/plasma jet.webp b/img/plasma jet.webp
new file mode 100644
index 0000000..e614269
Binary files /dev/null and b/img/plasma jet.webp differ
diff --git a/img/plasma-bot.webp b/img/plasma-bot.webp
new file mode 100644
index 0000000..9d71d50
Binary files /dev/null and b/img/plasma-bot.webp differ
diff --git a/img/pneumatic actuator.webp b/img/pneumatic actuator.webp
new file mode 100644
index 0000000..9bb5a7f
Binary files /dev/null and b/img/pneumatic actuator.webp differ
diff --git a/img/polyurethane foam.webp b/img/polyurethane foam.webp
new file mode 100644
index 0000000..a875deb
Binary files /dev/null and b/img/polyurethane foam.webp differ
diff --git a/img/pressure vessel.webp b/img/pressure vessel.webp
new file mode 100644
index 0000000..0feb70d
Binary files /dev/null and b/img/pressure vessel.webp differ
diff --git a/img/propagation.webp b/img/propagation.webp
new file mode 100644
index 0000000..7f8fe3c
Binary files /dev/null and b/img/propagation.webp differ
diff --git a/img/propagator.webp b/img/propagator.webp
new file mode 100644
index 0000000..733638b
Binary files /dev/null and b/img/propagator.webp differ
diff --git a/img/pseudoscience.webp b/img/pseudoscience.webp
new file mode 100644
index 0000000..fdee13b
Binary files /dev/null and b/img/pseudoscience.webp differ
diff --git a/img/pulse.webp b/img/pulse.webp
new file mode 100644
index 0000000..6225cde
Binary files /dev/null and b/img/pulse.webp differ
diff --git a/img/pyrotechnics.webp b/img/pyrotechnics.webp
new file mode 100644
index 0000000..7d6457d
Binary files /dev/null and b/img/pyrotechnics.webp differ
diff --git a/img/quantum eraser.webp b/img/quantum eraser.webp
new file mode 100644
index 0000000..fc86480
Binary files /dev/null and b/img/quantum eraser.webp differ
diff --git a/img/quantum immortality.webp b/img/quantum immortality.webp
new file mode 100644
index 0000000..fb07b3c
Binary files /dev/null and b/img/quantum immortality.webp differ
diff --git a/img/quasiparticles.webp b/img/quasiparticles.webp
new file mode 100644
index 0000000..18d3bad
Binary files /dev/null and b/img/quasiparticles.webp differ
diff --git a/img/quenching.webp b/img/quenching.webp
new file mode 100644
index 0000000..ecf7887
Binary files /dev/null and b/img/quenching.webp differ
diff --git a/img/quintessence.webp b/img/quintessence.webp
new file mode 100644
index 0000000..617bb16
Binary files /dev/null and b/img/quintessence.webp differ
diff --git a/img/radiative equilibrium.webp b/img/radiative equilibrium.webp
new file mode 100644
index 0000000..6fd3b3d
Binary files /dev/null and b/img/radiative equilibrium.webp differ
diff --git a/img/radioactive contamination.webp b/img/radioactive contamination.webp
new file mode 100644
index 0000000..347dab4
Binary files /dev/null and b/img/radioactive contamination.webp differ
diff --git a/img/railgun.webp b/img/railgun.webp
new file mode 100644
index 0000000..d80883f
Binary files /dev/null and b/img/railgun.webp differ
diff --git a/img/reaction inhibitor.webp b/img/reaction inhibitor.webp
new file mode 100644
index 0000000..de5a440
Binary files /dev/null and b/img/reaction inhibitor.webp differ
diff --git a/img/recycling.webp b/img/recycling.webp
new file mode 100644
index 0000000..775edc5
Binary files /dev/null and b/img/recycling.webp differ
diff --git a/img/reduced tolerances.webp b/img/reduced tolerances.webp
new file mode 100644
index 0000000..35b4ee8
Binary files /dev/null and b/img/reduced tolerances.webp differ
diff --git a/img/refraction.webp b/img/refraction.webp
new file mode 100644
index 0000000..4901c68
Binary files /dev/null and b/img/refraction.webp differ
diff --git a/img/refractory metal.webp b/img/refractory metal.webp
new file mode 100644
index 0000000..596e82a
Binary files /dev/null and b/img/refractory metal.webp differ
diff --git a/img/regression.webp b/img/regression.webp
new file mode 100644
index 0000000..5102a32
Binary files /dev/null and b/img/regression.webp differ
diff --git a/img/reinforcement learning.webp b/img/reinforcement learning.webp
new file mode 100644
index 0000000..7711853
Binary files /dev/null and b/img/reinforcement learning.webp differ
diff --git a/img/relativistic momentum.webp b/img/relativistic momentum.webp
new file mode 100644
index 0000000..5542265
Binary files /dev/null and b/img/relativistic momentum.webp differ
diff --git a/img/relay switch.webp b/img/relay switch.webp
new file mode 100644
index 0000000..eff6139
Binary files /dev/null and b/img/relay switch.webp differ
diff --git a/img/renormalization.webp b/img/renormalization.webp
new file mode 100644
index 0000000..6b0391b
Binary files /dev/null and b/img/renormalization.webp differ
diff --git a/img/replication.webp b/img/replication.webp
new file mode 100644
index 0000000..e15df43
Binary files /dev/null and b/img/replication.webp differ
diff --git a/img/residual dipolar coupling.webp b/img/residual dipolar coupling.webp
new file mode 100644
index 0000000..5fcb972
Binary files /dev/null and b/img/residual dipolar coupling.webp differ
diff --git a/img/restitution.webp b/img/restitution.webp
new file mode 100644
index 0000000..3ec9f61
Binary files /dev/null and b/img/restitution.webp differ
diff --git a/img/retrocausality.webp b/img/retrocausality.webp
new file mode 100644
index 0000000..17997c7
Binary files /dev/null and b/img/retrocausality.webp differ
diff --git a/img/ricochet.webp b/img/ricochet.webp
new file mode 100644
index 0000000..f970b30
Binary files /dev/null and b/img/ricochet.webp differ
diff --git a/img/rivet gun.webp b/img/rivet gun.webp
new file mode 100644
index 0000000..a94f4f6
Binary files /dev/null and b/img/rivet gun.webp differ
diff --git a/img/robotics.webp b/img/robotics.webp
new file mode 100644
index 0000000..feba476
Binary files /dev/null and b/img/robotics.webp differ
diff --git a/img/rocket-propelled grenade.webp b/img/rocket-propelled grenade.webp
new file mode 100644
index 0000000..1ef1b92
Binary files /dev/null and b/img/rocket-propelled grenade.webp differ
diff --git a/img/rotary cannon.webp b/img/rotary cannon.webp
new file mode 100644
index 0000000..69df5fc
Binary files /dev/null and b/img/rotary cannon.webp differ
diff --git a/img/scrap bots.webp b/img/scrap bots.webp
new file mode 100644
index 0000000..9482b30
Binary files /dev/null and b/img/scrap bots.webp differ
diff --git a/img/scrap refit.webp b/img/scrap refit.webp
new file mode 100644
index 0000000..243fcc7
Binary files /dev/null and b/img/scrap refit.webp differ
diff --git a/img/sentry.webp b/img/sentry.webp
new file mode 100644
index 0000000..eac727d
Binary files /dev/null and b/img/sentry.webp differ
diff --git a/img/shape-memory alloy.webp b/img/shape-memory alloy.webp
new file mode 100644
index 0000000..fc76420
Binary files /dev/null and b/img/shape-memory alloy.webp differ
diff --git a/img/shaped charge.webp b/img/shaped charge.webp
new file mode 100644
index 0000000..c1afd4f
Binary files /dev/null and b/img/shaped charge.webp differ
diff --git a/img/shear stress.webp b/img/shear stress.webp
new file mode 100644
index 0000000..fb9a1e8
Binary files /dev/null and b/img/shear stress.webp differ
diff --git a/img/shock wave.webp b/img/shock wave.webp
new file mode 100644
index 0000000..ff4d945
Binary files /dev/null and b/img/shock wave.webp differ
diff --git a/img/simulated annealing.webp b/img/simulated annealing.webp
new file mode 100644
index 0000000..156dd96
Binary files /dev/null and b/img/simulated annealing.webp differ
diff --git a/img/siphonaptera.webp b/img/siphonaptera.webp
new file mode 100644
index 0000000..afb816d
Binary files /dev/null and b/img/siphonaptera.webp differ
diff --git a/img/slow light.webp b/img/slow light.webp
new file mode 100644
index 0000000..8f98107
Binary files /dev/null and b/img/slow light.webp differ
diff --git a/img/smelting.webp b/img/smelting.webp
new file mode 100644
index 0000000..783d4df
Binary files /dev/null and b/img/smelting.webp differ
diff --git a/img/specular reflection.webp b/img/specular reflection.webp
new file mode 100644
index 0000000..315f7cf
Binary files /dev/null and b/img/specular reflection.webp differ
diff --git a/img/spherical harmonics.webp b/img/spherical harmonics.webp
new file mode 100644
index 0000000..e13f0ef
Binary files /dev/null and b/img/spherical harmonics.webp differ
diff --git a/img/spin-statistics.webp b/img/spin-statistics.webp
new file mode 100644
index 0000000..2f2b470
Binary files /dev/null and b/img/spin-statistics.webp differ
diff --git a/img/spin–statistics theorem.webp b/img/spin–statistics theorem.webp
new file mode 100644
index 0000000..297a2db
Binary files /dev/null and b/img/spin–statistics theorem.webp differ
diff --git a/img/squirrel-cage rotor.webp b/img/squirrel-cage rotor.webp
new file mode 100644
index 0000000..63c2c81
Binary files /dev/null and b/img/squirrel-cage rotor.webp differ
diff --git a/img/stimulated emission.webp b/img/stimulated emission.webp
new file mode 100644
index 0000000..1fa9f74
Binary files /dev/null and b/img/stimulated emission.webp differ
diff --git a/img/strange attractor.webp b/img/strange attractor.webp
new file mode 100644
index 0000000..983778f
Binary files /dev/null and b/img/strange attractor.webp differ
diff --git a/img/stress concentration.webp b/img/stress concentration.webp
new file mode 100644
index 0000000..67b9722
Binary files /dev/null and b/img/stress concentration.webp differ
diff --git a/img/strong anthropic principle.webp b/img/strong anthropic principle.webp
new file mode 100644
index 0000000..ffbfd31
Binary files /dev/null and b/img/strong anthropic principle.webp differ
diff --git a/img/super ball.webp b/img/super ball.webp
new file mode 100644
index 0000000..9c7f945
Binary files /dev/null and b/img/super ball.webp differ
diff --git a/img/super duper.webp b/img/super duper.webp
new file mode 100644
index 0000000..d5e1f2a
Binary files /dev/null and b/img/super duper.webp differ
diff --git a/img/supercritical fission.webp b/img/supercritical fission.webp
new file mode 100644
index 0000000..f727d20
Binary files /dev/null and b/img/supercritical fission.webp differ
diff --git a/img/superdeterminism.webp b/img/superdeterminism.webp
new file mode 100644
index 0000000..d07b9b0
Binary files /dev/null and b/img/superdeterminism.webp differ
diff --git a/img/superfluidity.webp b/img/superfluidity.webp
new file mode 100644
index 0000000..7f0bc3d
Binary files /dev/null and b/img/superfluidity.webp differ
diff --git a/img/supply chain.webp b/img/supply chain.webp
new file mode 100644
index 0000000..29814ef
Binary files /dev/null and b/img/supply chain.webp differ
diff --git a/img/surface tension.webp b/img/surface tension.webp
new file mode 100644
index 0000000..d736c0b
Binary files /dev/null and b/img/surface tension.webp differ
diff --git a/img/surfactant.webp b/img/surfactant.webp
new file mode 100644
index 0000000..9ded9c8
Binary files /dev/null and b/img/surfactant.webp differ
diff --git a/img/symbiosis.webp b/img/symbiosis.webp
new file mode 100644
index 0000000..32b35db
Binary files /dev/null and b/img/symbiosis.webp differ
diff --git a/img/sympathetic resonance.webp b/img/sympathetic resonance.webp
new file mode 100644
index 0000000..5f0a77d
Binary files /dev/null and b/img/sympathetic resonance.webp differ
diff --git a/img/technical debt.webp b/img/technical debt.webp
new file mode 100644
index 0000000..7f5facb
Binary files /dev/null and b/img/technical debt.webp differ
diff --git a/img/tessellation.webp b/img/tessellation.webp
new file mode 100644
index 0000000..4992624
Binary files /dev/null and b/img/tessellation.webp differ
diff --git a/img/thermal runaway.webp b/img/thermal runaway.webp
new file mode 100644
index 0000000..712ad84
Binary files /dev/null and b/img/thermal runaway.webp differ
diff --git a/img/thermocouple.webp b/img/thermocouple.webp
new file mode 100644
index 0000000..d669ea5
Binary files /dev/null and b/img/thermocouple.webp differ
diff --git a/img/thermoelectric effect.webp b/img/thermoelectric effect.webp
new file mode 100644
index 0000000..bc91ec2
Binary files /dev/null and b/img/thermoelectric effect.webp differ
diff --git a/img/time crystals.webp b/img/time crystals.webp
new file mode 100644
index 0000000..5b06557
Binary files /dev/null and b/img/time crystals.webp differ
diff --git a/img/tokamak.webp b/img/tokamak.webp
new file mode 100644
index 0000000..c9e4096
Binary files /dev/null and b/img/tokamak.webp differ
diff --git a/img/torpor.webp b/img/torpor.webp
new file mode 100644
index 0000000..cc1165f
Binary files /dev/null and b/img/torpor.webp differ
diff --git a/img/transdimensional worms.webp b/img/transdimensional worms.webp
new file mode 100644
index 0000000..e01c780
Binary files /dev/null and b/img/transdimensional worms.webp differ
diff --git a/img/transistor.webp b/img/transistor.webp
new file mode 100644
index 0000000..f62e0c3
Binary files /dev/null and b/img/transistor.webp differ
diff --git a/img/triple point.webp b/img/triple point.webp
new file mode 100644
index 0000000..260cba6
Binary files /dev/null and b/img/triple point.webp differ
diff --git a/img/tungsten carbide.webp b/img/tungsten carbide.webp
new file mode 100644
index 0000000..ac6fda4
Binary files /dev/null and b/img/tungsten carbide.webp differ
diff --git a/img/uncertainty principle.webp b/img/uncertainty principle.webp
new file mode 100644
index 0000000..da73750
Binary files /dev/null and b/img/uncertainty principle.webp differ
diff --git a/img/undefined.webp b/img/undefined.webp
new file mode 100644
index 0000000..be435a0
Binary files /dev/null and b/img/undefined.webp differ
diff --git a/img/unified field theory.webp b/img/unified field theory.webp
new file mode 100644
index 0000000..43230ce
Binary files /dev/null and b/img/unified field theory.webp differ
diff --git a/img/vacuum bomb.webp b/img/vacuum bomb.webp
new file mode 100644
index 0000000..50dc56c
Binary files /dev/null and b/img/vacuum bomb.webp differ
diff --git a/img/vacuum fluctuation.webp b/img/vacuum fluctuation.webp
new file mode 100644
index 0000000..c712652
Binary files /dev/null and b/img/vacuum fluctuation.webp differ
diff --git a/img/vacuum permittivity.webp b/img/vacuum permittivity.webp
new file mode 100644
index 0000000..f81f900
Binary files /dev/null and b/img/vacuum permittivity.webp differ
diff --git a/img/virtual particles.webp b/img/virtual particles.webp
new file mode 100644
index 0000000..a02e99c
Binary files /dev/null and b/img/virtual particles.webp differ
diff --git a/img/waste heat recovery.webp b/img/waste heat recovery.webp
new file mode 100644
index 0000000..e291aba
Binary files /dev/null and b/img/waste heat recovery.webp differ
diff --git a/img/water shielding.webp b/img/water shielding.webp
new file mode 100644
index 0000000..3dc396e
Binary files /dev/null and b/img/water shielding.webp differ
diff --git a/img/weak anthropic principle.webp b/img/weak anthropic principle.webp
new file mode 100644
index 0000000..c0ed499
Binary files /dev/null and b/img/weak anthropic principle.webp differ
diff --git a/img/zero point energy.webp b/img/zero point energy.webp
new file mode 100644
index 0000000..b538f77
Binary files /dev/null and b/img/zero point energy.webp differ
diff --git a/img/zoospore vector.webp b/img/zoospore vector.webp
new file mode 100644
index 0000000..8ea12a7
Binary files /dev/null and b/img/zoospore vector.webp differ
diff --git a/img/Ψ(t) collapse.webp b/img/Ψ(t) collapse.webp
new file mode 100644
index 0000000..4a99cf6
Binary files /dev/null and b/img/Ψ(t) collapse.webp differ
diff --git a/index.html b/index.html
index 887db96..7b27943 100644
--- a/index.html
+++ b/index.html
@@ -69,9 +69,13 @@
+
+
+
+
@@ -126,6 +130,7 @@
+
@@ -228,7 +233,7 @@
- Github hosts n-gon's 2.5MB source code.
It's written in JavaScript, CSS, and HTML and uses the matter.js 2-D physics library.
+ Github hosts n-gon's source code.
It's written in JavaScript, CSS, and HTML and uses the matter.js 2-D physics library. Images are generated mostly through midJourney.
diff --git a/js/bullet.js b/js/bullet.js
index ae671f7..9e5d1ac 100644
--- a/js/bullet.js
+++ b/js/bullet.js
@@ -547,7 +547,7 @@ const b = {
y: where.y + range * Math.sin(angle)
}
];
- const vertexCollision = function(v1, v1End, domain) {
+ const vertexCollision = function (v1, v1End, domain) {
for (let i = 0; i < domain.length; ++i) {
let vertices = domain[i].vertices;
const len = vertices.length - 1;
@@ -596,24 +596,24 @@ const b = {
v1: null,
v2: null
};
- if (tech.isPulseAim && !input.down) { //find mobs in line of sight
- let dist = 2200
- for (let i = 0, len = mob.length; i < len; i++) {
- const newDist = Vector.magnitude(Vector.sub(path[0], mob[i].position))
- if (
- explosionRadius < newDist &&
- newDist < dist &&
- !mob[i].isBadTarget &&
- Matter.Query.ray(map, path[0], mob[i].position).length === 0 &&
- Matter.Query.ray(body, path[0], mob[i].position).length === 0 &&
- !mob[i].isInvulnerable
- ) {
- dist = newDist
- best.who = mob[i]
- path[path.length - 1] = mob[i].position
- }
- }
- }
+ // if (tech.isPulseAim && !input.down) { //find mobs in line of sight
+ // let dist = 2200
+ // for (let i = 0, len = mob.length; i < len; i++) {
+ // const newDist = Vector.magnitude(Vector.sub(path[0], mob[i].position))
+ // if (
+ // explosionRadius < newDist &&
+ // newDist < dist &&
+ // !mob[i].isBadTarget &&
+ // Matter.Query.ray(map, path[0], mob[i].position).length === 0 &&
+ // Matter.Query.ray(body, path[0], mob[i].position).length === 0 &&
+ // !mob[i].isInvulnerable
+ // ) {
+ // dist = newDist
+ // best.who = mob[i]
+ // path[path.length - 1] = mob[i].position
+ // }
+ // }
+ // }
if (!best.who) {
vertexCollision(path[0], path[1], mob);
vertexCollision(path[0], path[1], map);
@@ -628,8 +628,14 @@ const b = {
if (best.who) {
b.explosion(path[1], explosionRadius)
const off = explosionRadius * 1.2
- b.explosion({ x: path[1].x + off * (Math.random() - 0.5), y: path[1].y + off * (Math.random() - 0.5) }, explosionRadius)
- b.explosion({ x: path[1].x + off * (Math.random() - 0.5), y: path[1].y + off * (Math.random() - 0.5) }, explosionRadius)
+ b.explosion({
+ x: path[1].x + off * (Math.random() - 0.5),
+ y: path[1].y + off * (Math.random() - 0.5)
+ }, explosionRadius)
+ b.explosion({
+ x: path[1].x + off * (Math.random() - 0.5),
+ y: path[1].y + off * (Math.random() - 0.5)
+ }, explosionRadius)
}
//draw laser beam
ctx.beginPath();
@@ -779,11 +785,16 @@ const b = {
fireworks(where, size) { //can occur after grenades detonate
const cycle = () => {
if (m.alive) {
- if (simulation.paused || m.isBodiesAsleep) { requestAnimationFrame(cycle) } else {
+ if (simulation.paused || m.isBodiesAsleep) {
+ requestAnimationFrame(cycle)
+ } else {
count++
if (count < 110) requestAnimationFrame(cycle);
if (!(count % 10)) {
- const unit = Vector.rotate({ x: 1, y: 0 }, 6.28 * Math.random())
+ const unit = Vector.rotate({
+ x: 1,
+ y: 0
+ }, 6.28 * Math.random())
b.explosion(Vector.add(where, Vector.mult(unit, size * (count * 0.01 + 0.02 * Math.random()))), size * (0.4 + Math.random() * 0.35), `hsla(${360*Math.random()},100%,66%,0.6)`); //makes bullet do explosive damage at end
}
}
@@ -796,11 +807,16 @@ const b = {
const color = `hsla(${360*Math.random()},100%,66%,0.6)`
const cycle = () => {
if (m.alive) {
- if (simulation.paused || m.isBodiesAsleep) { requestAnimationFrame(cycle) } else {
+ if (simulation.paused || m.isBodiesAsleep) {
+ requestAnimationFrame(cycle)
+ } else {
count++
if (count < 21) requestAnimationFrame(cycle);
if (count % 2) {
- const unit = Vector.rotate({ x: 1, y: 0 }, curl * 6.28 * count / 18 + off)
+ const unit = Vector.rotate({
+ x: 1,
+ y: 0
+ }, curl * 6.28 * count / 18 + off)
b.explosion(Vector.add(where, Vector.mult(unit, size * 0.75)), size * 0.7, color); //makes bullet do explosive damage at end
}
}
@@ -816,7 +832,9 @@ const b = {
const range = size * Math.sqrt(b.explosionRange())
const cycle = () => {
if (m.alive) {
- if (simulation.paused || m.isBodiesAsleep) { requestAnimationFrame(cycle) } else {
+ if (simulation.paused || m.isBodiesAsleep) {
+ requestAnimationFrame(cycle)
+ } else {
if (count < 30 && m.alive) requestAnimationFrame(cycle);
if (count === 0) {
const color = `hsla(${360*Math.random()},100%,66%,0.6)`
@@ -825,14 +843,20 @@ const b = {
if (count === 8) {
const color = `hsla(${360*Math.random()},100%,66%,0.6)`
for (let i = 0, len = 6; i < len; i++) {
- const unit = Vector.rotate({ x: 1, y: 0 }, 6.28 * i / len)
+ const unit = Vector.rotate({
+ x: 1,
+ y: 0
+ }, 6.28 * i / len)
b.explosion(Vector.add(where, Vector.mult(unit, 1.1 * range)), size * 0.6, color); //makes bullet do explosive damage at end
}
}
if (count === 16) {
const color = `hsla(${360*Math.random()},100%,66%,0.6)`
for (let i = 0, len = 10; i < len; i++) {
- const unit = Vector.rotate({ x: 1, y: 0 }, 6.28 * i / len)
+ const unit = Vector.rotate({
+ x: 1,
+ y: 0
+ }, 6.28 * i / len)
b.explosion(Vector.add(where, Vector.mult(unit, 1.4 * range)), size * 0.45, color); //makes bullet do explosive damage at end
}
}
@@ -859,14 +883,17 @@ const b = {
},
setGrenadeMode() {
- grenadeDefault = function(where = { x: m.pos.x + 30 * Math.cos(m.angle), y: m.pos.y + 30 * Math.sin(m.angle) }, angle = m.angle, size = 1) {
+ grenadeDefault = function (where = {
+ x: m.pos.x + 30 * Math.cos(m.angle),
+ y: m.pos.y + 30 * Math.sin(m.angle)
+ }, angle = m.angle, size = 1) {
const me = bullet.length;
bullet[me] = Bodies.circle(where.x, where.y, 15, b.fireAttributes(angle, false));
Matter.Body.setDensity(bullet[me], 0.0003);
bullet[me].explodeRad = 300 * size + 100 * tech.isBlockExplode;
bullet[me].onEnd = b.grenadeEnd
bullet[me].minDmgSpeed = 1;
- bullet[me].beforeDmg = function() {
+ bullet[me].beforeDmg = function () {
this.endCycle = 0; //bullet ends cycle after doing damage //this also triggers explosion
};
speed = input.down ? 43 : 32
@@ -876,19 +903,22 @@ const b = {
});
bullet[me].endCycle = simulation.cycle + Math.floor(input.down ? 120 : 80) * tech.isBulletsLastLonger;
bullet[me].restitution = 0.4;
- bullet[me].do = function() {
+ bullet[me].do = function () {
this.force.y += this.mass * 0.0025; //extra gravity for harder arcs
};
Composite.add(engine.world, bullet[me]); //add bullet to world
}
- grenadeRPG = function(where = { x: m.pos.x + 30 * Math.cos(m.angle), y: m.pos.y + 30 * Math.sin(m.angle) }, angle = m.angle, size = 1) {
+ grenadeRPG = function (where = {
+ x: m.pos.x + 30 * Math.cos(m.angle),
+ y: m.pos.y + 30 * Math.sin(m.angle)
+ }, angle = m.angle, size = 1) {
const me = bullet.length;
bullet[me] = Bodies.circle(where.x, where.y, 15, b.fireAttributes(angle, false));
Matter.Body.setDensity(bullet[me], 0.0003);
bullet[me].explodeRad = 300 * size + 100 * tech.isBlockExplode;
bullet[me].onEnd = b.grenadeEnd
bullet[me].minDmgSpeed = 1;
- bullet[me].beforeDmg = function() {
+ bullet[me].beforeDmg = function () {
this.endCycle = 0; //bullet ends cycle after doing damage //this also triggers explosion
};
speed = input.down ? 46 : 32
@@ -905,7 +935,7 @@ const b = {
x: bullet[me].mass * MAG * Math.cos(angle),
y: bullet[me].mass * MAG * Math.sin(angle)
}
- bullet[me].do = function() {
+ bullet[me].do = function () {
this.force.x += this.thrust.x;
this.force.y += this.thrust.y;
if (Matter.Query.collides(this, map).length || Matter.Query.collides(this, body).length) {
@@ -913,14 +943,17 @@ const b = {
}
};
}
- grenadeRPGVacuum = function(where = { x: m.pos.x + 30 * Math.cos(m.angle), y: m.pos.y + 30 * Math.sin(m.angle) }, angle = m.angle, size = 1) {
+ grenadeRPGVacuum = function (where = {
+ x: m.pos.x + 30 * Math.cos(m.angle),
+ y: m.pos.y + 30 * Math.sin(m.angle)
+ }, angle = m.angle, size = 1) {
const me = bullet.length;
bullet[me] = Bodies.circle(where.x, where.y, 15, b.fireAttributes(angle, false));
Matter.Body.setDensity(bullet[me], 0.0003);
bullet[me].explodeRad = 350 * size + Math.floor(Math.random() * 50) + tech.isBlockExplode * 100
bullet[me].onEnd = b.grenadeEnd
bullet[me].minDmgSpeed = 1;
- bullet[me].beforeDmg = function() {
+ bullet[me].beforeDmg = function () {
this.endCycle = 0; //bullet ends cycle after doing damage //this also triggers explosion
};
speed = input.down ? 46 : 32
@@ -937,7 +970,7 @@ const b = {
x: bullet[me].mass * MAG * Math.cos(angle),
y: bullet[me].mass * MAG * Math.sin(angle)
}
- bullet[me].suck = function() {
+ bullet[me].suck = function () {
const suck = (who, radius = this.explodeRad * 3.2) => {
for (i = 0, len = who.length; i < len; i++) {
const sub = Vector.sub(this.position, who[i].position);
@@ -966,7 +999,10 @@ const b = {
suck([player], this.explodeRad * 1.3)
}
- Matter.Body.setVelocity(this, { x: 0, y: 0 }); //keep bomb in place
+ Matter.Body.setVelocity(this, {
+ x: 0,
+ y: 0
+ }); //keep bomb in place
//draw suck
const radius = 2.75 * this.explodeRad * (this.endCycle - simulation.cycle) / this.suckCycles
ctx.fillStyle = "rgba(0,0,0,0.1)";
@@ -974,7 +1010,7 @@ const b = {
ctx.arc(this.position.x, this.position.y, radius, 0, 2 * Math.PI);
ctx.fill();
}
- bullet[me].do = function() {
+ bullet[me].do = function () {
if (simulation.cycle > this.endCycle - this.suckCycles) { //suck
this.do = this.suck
} else if (Matter.Query.collides(this, map).length || Matter.Query.collides(this, body).length) {
@@ -986,17 +1022,20 @@ const b = {
}
};
}
- grenadeVacuum = function(where = { x: m.pos.x + 30 * Math.cos(m.angle), y: m.pos.y + 30 * Math.sin(m.angle) }, angle = m.angle, size = 1) {
+ grenadeVacuum = function (where = {
+ x: m.pos.x + 30 * Math.cos(m.angle),
+ y: m.pos.y + 30 * Math.sin(m.angle)
+ }, angle = m.angle, size = 1) {
const me = bullet.length;
bullet[me] = Bodies.circle(where.x, where.y, 20, b.fireAttributes(angle, false));
Matter.Body.setDensity(bullet[me], 0.0002);
bullet[me].explodeRad = 350 * size + Math.floor(Math.random() * 50) + tech.isBlockExplode * 100
bullet[me].onEnd = b.grenadeEnd
- bullet[me].beforeDmg = function() {
+ bullet[me].beforeDmg = function () {
this.endCycle = 0; //bullet ends cycle after doing damage //this also triggers explosion
};
bullet[me].restitution = 0.4;
- bullet[me].do = function() {
+ bullet[me].do = function () {
this.force.y += this.mass * 0.0025; //extra gravity for harder arcs
const suckCycles = 40
@@ -1058,7 +1097,10 @@ const b = {
Composite.add(engine.world, bullet[me]); //add bullet to world
}
- grenadeNeutron = function(where = { x: m.pos.x + 30 * Math.cos(m.angle), y: m.pos.y + 30 * Math.sin(m.angle) }, angle = m.angle, size = 1) {
+ grenadeNeutron = function (where = {
+ x: m.pos.x + 30 * Math.cos(m.angle),
+ y: m.pos.y + 30 * Math.sin(m.angle)
+ }, angle = m.angle, size = 1) {
const me = bullet.length;
bullet[me] = Bodies.polygon(where.x, where.y, 10, 4, b.fireAttributes(angle, false));
b.fireProps((input.down ? 45 : 25) / Math.pow(0.92, tech.missileCount), input.down ? 35 : 20, angle, me); //cd , speed
@@ -1090,13 +1132,19 @@ const b = {
}
}
- bullet[me].beforeDmg = function() {};
- bullet[me].stuck = function() {};
- bullet[me].do = function() {
+ bullet[me].beforeDmg = function () {};
+ bullet[me].stuck = function () {};
+ bullet[me].do = function () {
const onCollide = () => {
this.collisionFilter.mask = 0; //non collide with everything
- Matter.Body.setVelocity(this, { x: 0, y: 0 });
- if (tech.isRPG) this.thrust = { x: 0, y: 0 }
+ Matter.Body.setVelocity(this, {
+ x: 0,
+ y: 0
+ });
+ if (tech.isRPG) this.thrust = {
+ x: 0,
+ y: 0
+ }
this.do = this.radiationMode;
}
const mobCollisions = Matter.Query.collides(this, mob)
@@ -1113,14 +1161,14 @@ const b = {
//find the relative position for when the mob is at angle zero by undoing the mobs rotation
this.stuckToRelativePosition = Vector.rotate(Vector.sub(this.position, this.stuckTo.position), -this.stuckTo.angle)
}
- this.stuck = function() {
+ this.stuck = function () {
if (this.stuckTo && this.stuckTo.alive) {
const rotate = Vector.rotate(this.stuckToRelativePosition, this.stuckTo.angle) //add in the mob's new angle to the relative position vector
Matter.Body.setPosition(this, Vector.add(Vector.add(rotate, this.stuckTo.velocity), this.stuckTo.position))
Matter.Body.setVelocity(this, this.stuckTo.velocity); //so that it will move properly if it gets unstuck
} else {
this.collisionFilter.mask = cat.map | cat.body | cat.player | cat.mob; //non collide with everything but map
- this.stuck = function() {
+ this.stuck = function () {
this.force.y += this.mass * 0.001;
}
}
@@ -1136,7 +1184,7 @@ const b = {
} else {
this.do = this.radiationMode;
}
- this.stuck = function() {
+ this.stuck = function () {
if (this.stuckTo) {
const rotate = Vector.rotate(this.stuckToRelativePosition, this.stuckTo.angle) //add in the mob's new angle to the relative position vector
Matter.Body.setPosition(this, Vector.add(Vector.add(rotate, this.stuckTo.velocity), this.stuckTo.position))
@@ -1157,7 +1205,7 @@ const b = {
}
}
}
- bullet[me].radiationMode = function() { //the do code after the bullet is stuck on something, projects a damaging radiation field
+ bullet[me].radiationMode = function () { //the do code after the bullet is stuck on something, projects a damaging radiation field
this.stuck(); //runs different code based on what the bullet is stuck to
this.damageRadius = this.damageRadius * 0.85 + 0.15 * this.maxDamageRadius //smooth radius towards max
this.maxDamageRadius -= this.radiusDecay
@@ -1219,14 +1267,17 @@ const b = {
if (tech.isNeutronBomb) {
b.grenade = grenadeNeutron
if (tech.isRPG) {
- b.guns[5].do = function() {}
+ b.guns[5].do = function () {}
} else {
- b.guns[5].do = function() {
+ b.guns[5].do = function () {
if (!input.field && input.down) {
const cycles = 80
const speed = input.down ? 35 : 20 //input.down ? 43 : 32
const g = input.down ? 0.137 : 0.135
- const v = { x: speed * Math.cos(m.angle), y: speed * Math.sin(m.angle) }
+ const v = {
+ x: speed * Math.cos(m.angle),
+ y: speed * Math.sin(m.angle)
+ }
ctx.strokeStyle = "rgba(68, 68, 68, 0.2)" //color.map
ctx.lineWidth = 2
ctx.beginPath()
@@ -1239,7 +1290,7 @@ const b = {
}
}
} else if (tech.isRPG) {
- b.guns[5].do = function() {}
+ b.guns[5].do = function () {}
if (tech.isVacuumBomb) {
b.grenade = grenadeRPGVacuum
} else {
@@ -1247,11 +1298,14 @@ const b = {
}
} else if (tech.isVacuumBomb) {
b.grenade = grenadeVacuum
- b.guns[5].do = function() {
+ b.guns[5].do = function () {
if (!input.field && input.down) {
const cycles = Math.floor(input.down ? 50 : 30) //30
const speed = input.down ? 44 : 35
- const v = { x: speed * Math.cos(m.angle), y: speed * Math.sin(m.angle) }
+ const v = {
+ x: speed * Math.cos(m.angle),
+ y: speed * Math.sin(m.angle)
+ }
ctx.strokeStyle = "rgba(68, 68, 68, 0.2)" //color.map
ctx.lineWidth = 2
ctx.beginPath()
@@ -1264,11 +1318,14 @@ const b = {
}
} else {
b.grenade = grenadeDefault
- b.guns[5].do = function() {
+ b.guns[5].do = function () {
if (!input.field && input.down) {
const cycles = Math.floor(input.down ? 120 : 80) //30
const speed = input.down ? 43 : 32
- const v = { x: speed * Math.cos(m.angle), y: speed * Math.sin(m.angle) } //m.Vy / 2 + removed to make the path less jerky
+ const v = {
+ x: speed * Math.cos(m.angle),
+ y: speed * Math.sin(m.angle)
+ } //m.Vy / 2 + removed to make the path less jerky
ctx.strokeStyle = "rgba(68, 68, 68, 0.2)" //color.map
ctx.lineWidth = 2
ctx.beginPath()
@@ -1426,7 +1483,32 @@ const b = {
grapple(where, angle = m.angle, harpoonSize = 1) {
const me = bullet.length;
const returnRadius = 100 * Math.sqrt(harpoonSize)
- bullet[me] = Bodies.fromVertices(where.x, where.y, [{ x: -50 * harpoonSize, y: 2 * harpoonSize, index: 0, isInternal: false }, { x: -50 * harpoonSize, y: -2 * harpoonSize, index: 1, isInternal: false }, { x: 45 * harpoonSize, y: -3 * harpoonSize, index: 2, isInternal: false }, { x: 50 * harpoonSize, y: 0, index: 3, isInternal: false }, { x: 45 * harpoonSize, y: 3 * harpoonSize, index: 4, isInternal: false }], {
+ bullet[me] = Bodies.fromVertices(where.x, where.y, [{
+ x: -50 * harpoonSize,
+ y: 2 * harpoonSize,
+ index: 0,
+ isInternal: false
+ }, {
+ x: -50 * harpoonSize,
+ y: -2 * harpoonSize,
+ index: 1,
+ isInternal: false
+ }, {
+ x: 45 * harpoonSize,
+ y: -3 * harpoonSize,
+ index: 2,
+ isInternal: false
+ }, {
+ x: 50 * harpoonSize,
+ y: 0,
+ index: 3,
+ isInternal: false
+ }, {
+ x: 45 * harpoonSize,
+ y: 3 * harpoonSize,
+ index: 4,
+ isInternal: false
+ }], {
angle: angle,
friction: 1,
frictionAir: 0.4,
@@ -1441,21 +1523,27 @@ const b = {
minDmgSpeed: 4,
lookFrequency: Math.floor(7 + Math.random() * 3),
density: tech.harpoonDensity, //0.001 is normal for blocks, 0.004 is normal for harpoon, 0.004*6 when buffed
- drain: tech.isRailEnergy ? 0.001 : 0.006,
+ drain: tech.isRailEnergy ? 0.0006 : 0.006,
beforeDmg(who) {
if (tech.isShieldPierce && who.isShielded) { //disable shields
who.isShielded = false
- requestAnimationFrame(() => { who.isShielded = true });
+ requestAnimationFrame(() => {
+ who.isShielded = true
+ });
}
if (tech.fragments) {
b.targetedNail(this.vertices[2], tech.fragments * Math.floor(2 + Math.random()))
}
if (tech.isFoamBall) {
- const radius = 5 + 8 * Math.random()
- const velocity = { x: Math.max(0.5, 2 - radius * 0.1), y: 0 }
- for (let i = 0, len = 2 * this.mass; i < len; i++) {
+ for (let i = 0, len = 4 * this.mass; i < len; i++) {
+ const radius = 5 + 8 * Math.random()
+ const velocity = {
+ x: Math.max(0.5, 2 - radius * 0.1),
+ y: 0
+ }
b.foam(this.position, Vector.rotate(velocity, 6.28 * Math.random()), radius)
}
+ // this.endCycle = 0;
}
},
caughtPowerUp: null,
@@ -1517,11 +1605,11 @@ const b = {
returnToPlayer() {
if (Vector.magnitude(Vector.sub(this.position, m.pos)) < returnRadius) { //near player
this.endCycle = 0;
- if (m.energy < 0.05) {
- m.fireCDcycle = m.cycle + 120; //fire cooldown
- } else if (m.cycle + 25 * b.fireCDscale < m.fireCDcycle) {
- m.fireCDcycle = m.cycle + 35 * b.fireCDscale //lower cd to 25 if it is above 25
- }
+ // if (m.energy < 0.05) {
+ // m.fireCDcycle = m.cycle + 120; //fire cooldown
+ // } else if (m.cycle + 15 * b.fireCDscale < m.fireCDcycle) {
+ // m.fireCDcycle = m.cycle + 15 * b.fireCDscale //lower cd to 25 if it is above 25
+ // }
if (m.energy < 0.05) this.dropCaughtPowerUp()
@@ -1551,14 +1639,20 @@ const b = {
grabPowerUp() { //grab power ups near the tip of the harpoon
if (this.caughtPowerUp) {
Matter.Body.setPosition(this.caughtPowerUp, Vector.add(this.vertices[2], this.velocity))
- Matter.Body.setVelocity(this.caughtPowerUp, { x: 0, y: 0 })
+ Matter.Body.setVelocity(this.caughtPowerUp, {
+ x: 0,
+ y: 0
+ })
} else { //&& simulation.cycle % 2
for (let i = 0, len = powerUp.length; i < len; ++i) {
const radius = powerUp[i].circleRadius + 50
if (Vector.magnitudeSquared(Vector.sub(this.vertices[2], powerUp[i].position)) < radius * radius) {
if (powerUp[i].name !== "heal" || m.health !== m.maxHealth || tech.isOverHeal) {
this.caughtPowerUp = powerUp[i]
- Matter.Body.setVelocity(powerUp[i], { x: 0, y: 0 })
+ Matter.Body.setVelocity(powerUp[i], {
+ x: 0,
+ y: 0
+ })
Matter.Body.setPosition(powerUp[i], this.vertices[2])
powerUp[i].collisionFilter.category = 0
powerUp[i].collisionFilter.mask = 0
@@ -1575,7 +1669,7 @@ const b = {
this.grabPowerUp()
if (this.endCycle < simulation.cycle + 1) { //if at end of lifespan, but player is holding down fire, force retraction
this.endCycle = simulation.cycle + 60
- m.fireCDcycle = m.cycle + 120 // cool down
+ // m.fireCDcycle = m.cycle + 120 // cool down
this.do = this.returnToPlayer
Matter.Body.setDensity(this, 0.0005); //reduce density on return
if (this.angularSpeed < 0.5) this.torque += this.inertia * 0.001 * (Math.random() - 0.5) //(Math.round(Math.random()) ? 1 : -1)
@@ -1607,9 +1701,15 @@ const b = {
}
//grappling hook
if (input.fire && Matter.Query.collides(this, map).length) {
- Matter.Body.setPosition(this, Vector.add(this.position, { x: 20 * Math.cos(this.angle), y: 20 * Math.sin(this.angle) }))
+ Matter.Body.setPosition(this, Vector.add(this.position, {
+ x: 20 * Math.cos(this.angle),
+ y: 20 * Math.sin(this.angle)
+ }))
if (Matter.Query.collides(this, map).length) {
- Matter.Body.setVelocity(this, { x: 0, y: 0 });
+ Matter.Body.setVelocity(this, {
+ x: 0,
+ y: 0
+ });
Matter.Sleeping.set(this, true)
this.endCycle = simulation.cycle + 5
this.dropCaughtPowerUp()
@@ -1621,14 +1721,18 @@ const b = {
})
let dist = Vector.magnitude(sub)
if (input.fire) {
- m.fireCDcycle = m.cycle + 30; // cool down if out of energy
+ // m.fireCDcycle = m.cycle + 30; // cool down if out of energy
+ m.fireCDcycle = m.cycle + 5 + 40 * b.fireCDscale + 60 * (m.energy < 0.05)
this.endCycle = simulation.cycle + 10
if (input.down) { //down
dist = 0
player.force.y += 5 * player.mass * simulation.g;
}
if (m.energy > this.drain) {
- Matter.Body.setVelocity(player, { x: player.velocity.x * 0.8, y: player.velocity.y * 0.8 });
+ Matter.Body.setVelocity(player, {
+ x: player.velocity.x * 0.8,
+ y: player.velocity.y * 0.8
+ });
const pull = Vector.mult(Vector.normalise(sub), 0.0008 * Math.min(Math.max(15, dist), 200))
player.force.x += pull.x
player.force.y += pull.y
@@ -1691,19 +1795,39 @@ const b = {
harpoon(where, target, angle = m.angle, harpoonSize = 1, isReturn = false, totalCycles = 35, isReturnAmmo = true, thrust = 0.1) {
const me = bullet.length;
const returnRadius = 100 * Math.sqrt(harpoonSize)
- bullet[me] = Bodies.fromVertices(where.x, where.y, [{ x: -40 * harpoonSize, y: 2 * harpoonSize, index: 0, isInternal: false }, { x: -40 * harpoonSize, y: -2 * harpoonSize, index: 1, isInternal: false }, { x: 50 * harpoonSize, y: -3 * harpoonSize, index: 3, isInternal: false }, { x: 30 * harpoonSize, y: 2 * harpoonSize, index: 4, isInternal: false }], {
+ bullet[me] = Bodies.fromVertices(where.x, where.y, [{
+ x: -40 * harpoonSize,
+ y: 2 * harpoonSize,
+ index: 0,
+ isInternal: false
+ }, {
+ x: -40 * harpoonSize,
+ y: -2 * harpoonSize,
+ index: 1,
+ isInternal: false
+ }, {
+ x: 50 * harpoonSize,
+ y: -3 * harpoonSize,
+ index: 3,
+ isInternal: false
+ }, {
+ x: 30 * harpoonSize,
+ y: 2 * harpoonSize,
+ index: 4,
+ isInternal: false
+ }], {
cycle: 0,
angle: angle,
friction: 1,
frictionAir: 0.4,
// thrustMag: 0.1,
- drain: tech.isRailEnergy ? 0.001 : 0.006,
+ drain: tech.isRailEnergy ? 0.0006 : 0.006,
turnRate: isReturn ? 0.1 : 0.03, //0.015
drawStringControlMagnitude: 3000 + 5000 * Math.random(),
drawStringFlip: (Math.round(Math.random()) ? 1 : -1),
dmg: 6, //damage done in addition to the damage from momentum
classType: "bullet",
- endCycle: simulation.cycle + totalCycles * 2.5 + 15,
+ endCycle: simulation.cycle + totalCycles * 2.5 + 40,
collisionFilter: {
category: cat.bullet,
mask: tech.isShieldPierce ? cat.map | cat.body | cat.mob | cat.mobBullet : cat.map | cat.body | cat.mob | cat.mobBullet | cat.mobShield,
@@ -1714,7 +1838,9 @@ const b = {
beforeDmg(who) {
if (tech.isShieldPierce && who.isShielded) { //disable shields
who.isShielded = false
- requestAnimationFrame(() => { who.isShielded = true });
+ requestAnimationFrame(() => {
+ who.isShielded = true
+ });
}
if (tech.fragments) {
b.targetedNail(this.vertices[2], tech.fragments * Math.floor(2 + Math.random()))
@@ -1733,11 +1859,15 @@ const b = {
}
if (tech.isFoamBall) {
- const radius = 5 + 8 * Math.random()
- const velocity = { x: Math.max(0.5, 2 - radius * 0.1), y: 0 }
- for (let i = 0, len = 2 * this.mass; i < len; i++) {
+ for (let i = 0, len = 4 * this.mass; i < len; i++) {
+ const radius = 5 + 8 * Math.random()
+ const velocity = {
+ x: Math.max(0.5, 2 - radius * 0.1),
+ y: 0
+ }
b.foam(this.position, Vector.rotate(velocity, 6.28 * Math.random()), radius)
}
+ // this.endCycle = 0;
}
},
caughtPowerUp: null,
@@ -1805,11 +1935,11 @@ const b = {
returnToPlayer() {
if (Vector.magnitude(Vector.sub(this.position, m.pos)) < returnRadius) { //near player
this.endCycle = 0;
- if (m.energy < 0.05) {
- m.fireCDcycle = m.cycle + 120; //fire cooldown
- } else if (m.cycle + 25 * b.fireCDscale < m.fireCDcycle) {
- m.fireCDcycle = m.cycle + 25 * b.fireCDscale //lower cd to 25 if it is above 25
- }
+ // if (m.energy < 0.05) {
+ // m.fireCDcycle = m.cycle + 80 * b.fireCDscale; //fire cooldown is much longer when out of energy
+ // } else if (m.cycle + 20 * b.fireCDscale < m.fireCDcycle) {
+ // if (m.energy > 0.05) m.fireCDcycle = m.cycle + 20 * b.fireCDscale //lower cd to 25 if it is above 25
+ // }
//recoil on catching
const momentum = Vector.mult(Vector.sub(this.velocity, player.velocity), (input.down ? 0.0001 : 0.0002))
player.force.x += momentum.x
@@ -1825,12 +1955,17 @@ const b = {
}
}
} else {
- if (m.energy > this.drain) m.energy -= this.drain
const sub = Vector.sub(this.position, m.pos)
const rangeScale = 1 + 0.000001 * Vector.magnitude(sub) * Vector.magnitude(sub) //return faster when far from player
const returnForce = Vector.mult(Vector.normalise(sub), rangeScale * thrust * this.mass)
- this.force.x -= returnForce.x
- this.force.y -= returnForce.y
+ if (m.energy > this.drain) m.energy -= this.drain
+ if (m.energy < 0.05) {
+ this.force.x -= returnForce.x * 0.15
+ this.force.y -= returnForce.y * 0.15
+ } else { //if (m.cycle + 20 * b.fireCDscale < m.fireCDcycle)
+ this.force.x -= returnForce.x
+ this.force.y -= returnForce.y
+ }
this.grabPowerUp()
}
this.draw();
@@ -1838,7 +1973,10 @@ const b = {
grabPowerUp() { //grab power ups near the tip of the harpoon
if (this.caughtPowerUp) {
Matter.Body.setPosition(this.caughtPowerUp, Vector.add(this.vertices[2], this.velocity))
- Matter.Body.setVelocity(this.caughtPowerUp, { x: 0, y: 0 })
+ Matter.Body.setVelocity(this.caughtPowerUp, {
+ x: 0,
+ y: 0
+ })
} else { //&& simulation.cycle % 2
for (let i = 0, len = powerUp.length; i < len; ++i) {
const radius = powerUp[i].circleRadius + 50
@@ -1846,7 +1984,10 @@ const b = {
if (powerUp[i].name !== "heal" || m.health !== m.maxHealth || tech.isOverHeal) {
powerUp[i].isGrabbed = true
this.caughtPowerUp = powerUp[i]
- Matter.Body.setVelocity(powerUp[i], { x: 0, y: 0 })
+ Matter.Body.setVelocity(powerUp[i], {
+ x: 0,
+ y: 0
+ })
Matter.Body.setPosition(powerUp[i], this.vertices[2])
powerUp[i].collisionFilter.category = 0
powerUp[i].collisionFilter.mask = 0
@@ -1862,11 +2003,11 @@ const b = {
this.cycle++
if (isReturn || target) {
if (isReturn) {
- if (this.cycle > totalCycles || m.energy < 0.05 || !input.fire) { //return to player
+ if (this.cycle > totalCycles) { //return to player //|| !input.fire
this.do = this.returnToPlayer
if (this.angularSpeed < 0.5) this.torque += this.inertia * 0.001 * (Math.random() - 0.5) //(Math.round(Math.random()) ? 1 : -1)
Matter.Sleeping.set(this, false)
- this.endCycle = simulation.cycle + 60
+ this.endCycle = simulation.cycle + 240
const momentum = Vector.mult(Vector.sub(this.velocity, player.velocity), (input.down ? 0.00015 : 0.0003)) //recoil on jerking line
player.force.x += momentum.x
player.force.y += momentum.y
@@ -1879,7 +2020,10 @@ const b = {
}
}
if (target) { //rotate towards the target
- const face = { x: Math.cos(this.angle), y: Math.sin(this.angle) };
+ const face = {
+ x: Math.cos(this.angle),
+ y: Math.sin(this.angle)
+ };
const vectorGoal = Vector.normalise(Vector.sub(this.position, target.position));
if (Vector.cross(vectorGoal, face) > 0) {
Matter.Body.rotate(this, this.turnRate);
@@ -1899,24 +2043,24 @@ const b = {
y: m.Vy / 2 + 600 * thrust * Math.sin(bullet[me].angle)
});
bullet[me].frictionAir = 0.002
- bullet[me].do = function() {
+ bullet[me].do = function () {
if (this.speed < 20) this.force.y += 0.0005 * this.mass;
this.draw();
}
}
if (tech.isHarpoonPowerUp && bullet[me].density > 0.01) {
if (isReturn) {
- bullet[me].draw = function() {
+ bullet[me].draw = function () {
this.drawToggleHarpoon()
this.drawString()
}
} else {
- bullet[me].draw = function() {
+ bullet[me].draw = function () {
this.drawToggleHarpoon()
}
}
} else if (isReturn) {
- bullet[me].draw = function() {
+ bullet[me].draw = function () {
this.drawString()
}
}
@@ -2063,7 +2207,9 @@ const b = {
if (this.endCycle < simulation.cycle + 1) this.isWave = false
if (Matter.Query.point(map, this.position).length) { //check if inside map //|| Matter.Query.point(body, this.position).length
this.isBranch = true;
- this.do = () => { if (this.endCycle < simulation.cycle + 1) this.isWave = false }
+ this.do = () => {
+ if (this.endCycle < simulation.cycle + 1) this.isWave = false
+ }
} else { //check if inside a mob
for (let i = 0, len = mob.length; i < len; i++) {
const dist = Vector.magnitudeSquared(Vector.sub(this.position, mob[i].position))
@@ -2071,9 +2217,15 @@ const b = {
if (dist < radius * radius) {
if (mob[i].speed > 2) {
if (mob[i].isBoss || mob[i].isShielded) {
- Matter.Body.setVelocity(mob[i], { x: mob[i].velocity.x * 0.95, y: mob[i].velocity.y * 0.95 });
+ Matter.Body.setVelocity(mob[i], {
+ x: mob[i].velocity.x * 0.95,
+ y: mob[i].velocity.y * 0.95
+ });
} else {
- Matter.Body.setVelocity(mob[i], { x: mob[i].velocity.x * 0.25, y: mob[i].velocity.y * 0.25 });
+ Matter.Body.setVelocity(mob[i], {
+ x: mob[i].velocity.x * 0.25,
+ y: mob[i].velocity.y * 0.25
+ });
}
}
// Matter.Body.setPosition(this, Vector.add(this.position, mob[i].velocity)) //move with the medium
@@ -2098,7 +2250,9 @@ const b = {
const transverse = Vector.normalise(Vector.perp(bullet[me].velocity))
if (180 - Math.abs(Math.abs(b.lastAngle - m.angle) - 180) > 0.13 || !b.wasExtruderOn) {
bullet[me].isBranch = true; //don't draw stroke for this bullet
- bullet[me].do = function() { if (this.endCycle < simulation.cycle + 1) this.isWave = false }
+ bullet[me].do = function () {
+ if (this.endCycle < simulation.cycle + 1) this.isWave = false
+ }
}
b.lastAngle = m.angle //track last angle for the above angle difference calculation
} else {
@@ -2127,7 +2281,7 @@ const b = {
y: m.pos.y + range * Math.sin(m.angle)
}
];
- const vertexCollision = function(v1, v1End, domain) {
+ const vertexCollision = function (v1, v1End, domain) {
for (let i = 0; i < domain.length; ++i) {
let vertices = domain[i].vertices;
const len = vertices.length - 1;
@@ -2251,9 +2405,22 @@ const b = {
}, dmg = tech.laserDamage, reflections = tech.laserReflections, isThickBeam = false, push = 1) {
const reflectivity = 1 - 1 / (reflections * 3)
let damage = m.dmgScale * dmg
- let best = { x: 1, y: 1, dist2: Infinity, who: null, v1: 1, v2: 1 };
- const path = [{ x: where.x, y: where.y }, { x: whereEnd.x, y: whereEnd.y }];
- const vertexCollision = function(v1, v1End, domain) {
+ let best = {
+ x: 1,
+ y: 1,
+ dist2: Infinity,
+ who: null,
+ v1: 1,
+ v2: 1
+ };
+ const path = [{
+ x: where.x,
+ y: where.y
+ }, {
+ x: whereEnd.x,
+ y: whereEnd.y
+ }];
+ const vertexCollision = function (v1, v1End, domain) {
for (let i = 0; i < domain.length; ++i) {
let vertices = domain[i].vertices;
const len = vertices.length - 1;
@@ -2294,13 +2461,20 @@ const b = {
}
};
- const checkForCollisions = function() {
- best = { x: 1, y: 1, dist2: Infinity, who: null, v1: 1, v2: 1 };
+ const checkForCollisions = function () {
+ best = {
+ x: 1,
+ y: 1,
+ dist2: Infinity,
+ who: null,
+ v1: 1,
+ v2: 1
+ };
vertexCollision(path[path.length - 2], path[path.length - 1], mob);
vertexCollision(path[path.length - 2], path[path.length - 1], map);
vertexCollision(path[path.length - 2], path[path.length - 1], body);
};
- const laserHitMob = function() {
+ const laserHitMob = function () {
if (best.who.alive) {
best.who.locatePlayer();
if (best.who.damageReduction) {
@@ -2329,18 +2503,24 @@ const b = {
}
if (tech.isLaserPush) { //push mobs away
const index = path.length - 1
- Matter.Body.setVelocity(best.who, { x: best.who.velocity.x * 0.97, y: best.who.velocity.y * 0.97 });
+ Matter.Body.setVelocity(best.who, {
+ x: best.who.velocity.x * 0.97,
+ y: best.who.velocity.y * 0.97
+ });
const force = Vector.mult(Vector.normalise(Vector.sub(path[index], path[Math.max(0, index - 1)])), 0.003 * push * Math.min(6, best.who.mass))
Matter.Body.applyForce(best.who, path[index], force)
}
} else if (tech.isLaserPush && best.who.classType === "body") {
const index = path.length - 1
- Matter.Body.setVelocity(best.who, { x: best.who.velocity.x * 0.97, y: best.who.velocity.y * 0.97 });
+ Matter.Body.setVelocity(best.who, {
+ x: best.who.velocity.x * 0.97,
+ y: best.who.velocity.y * 0.97
+ });
const force = Vector.mult(Vector.normalise(Vector.sub(path[index], path[Math.max(0, index - 1)])), 0.003 * push * Math.min(6, best.who.mass))
Matter.Body.applyForce(best.who, path[index], force)
}
};
- const reflection = function() { // https://math.stackexchange.com/questions/13261/how-to-get-a-reflection-vector
+ const reflection = function () { // https://math.stackexchange.com/questions/13261/how-to-get-a-reflection-vector
const n = Vector.perp(Vector.normalise(Vector.sub(best.v1, best.v2)));
const d = Vector.sub(path[path.length - 1], path[path.length - 2]);
const nn = Vector.mult(n, 2 * Vector.dot(d, n));
@@ -2352,7 +2532,10 @@ const b = {
let lastBestOdd
let lastBestEven = best.who //used in hack below
if (best.dist2 !== Infinity) { //if hitting something
- path[path.length - 1] = { x: best.x, y: best.y };
+ path[path.length - 1] = {
+ x: best.x,
+ y: best.y
+ };
laserHitMob();
for (let i = 0; i < reflections; i++) {
reflection();
@@ -2360,7 +2543,10 @@ const b = {
if (best.dist2 !== Infinity) { //if hitting something
lastReflection = best
- path[path.length - 1] = { x: best.x, y: best.y };
+ path[path.length - 1] = {
+ x: best.x,
+ y: best.y
+ };
damage *= reflectivity
laserHitMob();
//I'm not clear on how this works, but it gets rid of a bug where the laser reflects inside a block, often vertically.
@@ -2436,7 +2622,10 @@ const b = {
time: 15
});
},
- laserMine(position, velocity = { x: 0, y: -8 }) {
+ laserMine(position, velocity = {
+ x: 0,
+ y: -8
+ }) {
const me = bullet.length;
bullet[me] = Bodies.polygon(position.x, position.y, 3, 25, {
bulletType: "laser mine",
@@ -2533,7 +2722,10 @@ const b = {
if (tech.isFoamMine) {
for (let i = 0; i < 14; i++) {
const radius = 13 + 8 * Math.random()
- const velocity = { x: 5.5 * Math.random(), y: 0 }
+ const velocity = {
+ x: 5.5 * Math.random(),
+ y: 0
+ }
b.foam(this.position, Vector.rotate(velocity, this.angle + 1.57 + 3 * (Math.random() - 0.5)), radius) //6.28 * Math.random()
}
@@ -2565,7 +2757,10 @@ const b = {
b.foam(this.position, Vector.rotate(velocity, 0.2 * (Math.random() - 0.5)), radius)
} else {
const radius = 7 + 10 * Math.random()
- const velocity = { x: 10 + 8 * Math.random(), y: 0 }
+ const velocity = {
+ x: 10 + 8 * Math.random(),
+ y: 0
+ }
b.foam(this.position, Vector.rotate(velocity, this.angle + 1.57 + 2.8 * (Math.random() - 0.5)), radius) //6.28 * Math.random()
}
}
@@ -2584,18 +2779,27 @@ const b = {
if (collide.length > 0) {
for (let i = 0; i < collide.length; i++) {
if (collide[i].bodyA.collisionFilter.category === cat.map) { // || collide[i].bodyB.collisionFilter.category === cat.map) {
- const angle = Vector.angle(collide[i].normal, { x: 1, y: 0 })
+ const angle = Vector.angle(collide[i].normal, {
+ x: 1,
+ y: 0
+ })
Matter.Body.setAngle(this, Math.atan2(collide[i].tangent.y, collide[i].tangent.x))
//move until touching map again after rotation
for (let j = 0; j < 10; j++) {
if (Matter.Query.collides(this, map).length > 0) { //touching map
if (angle > -0.2 || angle < -1.5) { //don't stick to level ground
- Matter.Body.setVelocity(this, { x: 0, y: 0 });
+ Matter.Body.setVelocity(this, {
+ x: 0,
+ y: 0
+ });
Matter.Body.setStatic(this, true) //don't set to static if not touching map
this.collisionFilter.category = 0
this.collisionFilter.mask = 0 //cat.map | cat.bullet
} else {
- Matter.Body.setVelocity(this, { x: 0, y: 0 });
+ Matter.Body.setVelocity(this, {
+ x: 0,
+ y: 0
+ });
Matter.Body.setAngularVelocity(this, 0)
}
this.arm();
@@ -2624,7 +2828,7 @@ const b = {
arm() {
this.collisionFilter.mask = cat.map | cat.body | cat.mob | cat.mobBullet | cat.mobShield | cat.bullet //can now collide with other bullets
this.lookFrequency = simulation.cycle + 60
- this.do = function() { //overwrite the do method for this bullet
+ this.do = function () { //overwrite the do method for this bullet
this.force.y += this.mass * 0.002; //extra gravity
if (simulation.cycle > this.lookFrequency) {
this.isArmed = true
@@ -2636,7 +2840,7 @@ const b = {
color: "#f00",
time: 4
});
- this.do = function() { //overwrite the do method for this bullet
+ this.do = function () { //overwrite the do method for this bullet
this.force.y += this.mass * 0.002; //extra gravity
if (!(simulation.cycle % this.lookFrequency)) { //find mob targets
const random = 300 * Math.random()
@@ -2651,7 +2855,7 @@ const b = {
if (tech.isMineSentry) {
this.lookFrequency = 6
this.endCycle = simulation.cycle + 1020
- this.do = function() { //overwrite the do method for this bullet
+ this.do = function () { //overwrite the do method for this bullet
this.force.y += this.mass * 0.002; //extra gravity
if (!(simulation.cycle % this.lookFrequency)) { //find mob targets
this.endCycle -= 5
@@ -2698,7 +2902,7 @@ const b = {
thrust: (tech.isSporeFollow ? 0.0012 : 0.00055) * (1 + 0.5 * (Math.random() - 0.5)),
wormSize: wormSize,
wormTail: 1 + Math.max(4, Math.min(wormSize - 2 * tech.wormSize, 30)),
- dmg: (tech.isMutualism ? 8 : 3.2) * wormSize * (tech.isJunkDNA ? 1 + 0.53 * tech.junkCount : 1), //bonus damage from tech.isMutualism //2.5 is extra damage as worm
+ dmg: (tech.isMutualism ? 9.5 : 3.2) * wormSize * (tech.isJunkDNA ? 1 + 0.53 * tech.junkCount : 1),
lookFrequency: 100 + Math.floor(37 * Math.random()),
classType: "bullet",
collisionFilter: {
@@ -2729,7 +2933,7 @@ const b = {
},
onEnd() {
if (tech.isMutualism && this.isMutualismActive && !tech.isEnergyHealth) {
- m.health += 0.01
+ m.health += 0.02
if (m.health > m.maxHealth) m.health = m.maxHealth;
m.displayHealth();
}
@@ -2794,8 +2998,8 @@ const b = {
y: SPEED * Math.sin(ANGLE)
});
Composite.add(engine.world, bullet[bIndex]); //add bullet to world
- if (tech.isMutualism && m.health > 0.02) {
- m.health -= 0.01
+ if (tech.isMutualism && m.health > 0.04) {
+ m.health -= 0.02
m.displayHealth();
bullet[bIndex].isMutualismActive = true
}
@@ -2814,7 +3018,7 @@ const b = {
friction: 0,
frictionAir: 0.025,
thrust: (tech.isSporeFollow ? 0.0011 : 0.0005) * (1 + 0.3 * (Math.random() - 0.5)),
- dmg: (tech.isMutualism ? 16.8 : 7) * (tech.isJunkDNA ? 1 + 0.53 * tech.junkCount : 1), //bonus damage from tech.isMutualism
+ dmg: (tech.isMutualism ? 20 : 7) * (tech.isJunkDNA ? 1 + 0.53 * tech.junkCount : 1), //bonus damage from tech.isMutualism
lookFrequency: 100 + Math.floor(117 * Math.random()),
classType: "bullet",
isSpore: true,
@@ -2834,7 +3038,7 @@ const b = {
},
onEnd() {
if (tech.isMutualism && this.isMutualismActive && !tech.isEnergyHealth) {
- m.health += 0.005
+ m.health += 0.01
if (m.health > m.maxHealth) m.health = m.maxHealth;
m.displayHealth();
}
@@ -2926,13 +3130,16 @@ const b = {
Composite.add(engine.world, bullet[bIndex]); //add bullet to world
if (tech.isMutualism && m.health > 0.01) {
- m.health -= 0.005
+ m.health -= 0.01
m.displayHealth();
bullet[bIndex].isMutualismActive = true
}
}
},
- iceIX(speed = 0, dir = m.angle + Math.PI * 2 * Math.random(), where = { x: m.pos.x + 30 * Math.cos(m.angle), y: m.pos.y + 30 * Math.sin(m.angle) }) {
+ iceIX(speed = 0, dir = m.angle + Math.PI * 2 * Math.random(), where = {
+ x: m.pos.x + 30 * Math.cos(m.angle),
+ y: m.pos.y + 30 * Math.sin(m.angle)
+ }) {
const me = bullet.length;
const THRUST = 0.0018
const RADIUS = 18
@@ -2956,7 +3163,9 @@ const b = {
lockedOn: null,
beforeDmg(who) {
if (tech.iceEnergy && !who.shield && !who.isShielded && who.isDropPowerUp && who.alive && m.immuneCycle < m.cycle) {
- setTimeout(() => { if (!who.alive) m.energy += tech.iceEnergy * 0.8 }, 10);
+ setTimeout(() => {
+ if (!who.alive) m.energy += tech.iceEnergy * 0.8
+ }, 10);
}
mobs.statusSlow(who, tech.iceIXFreezeTime)
this.endCycle = simulation.cycle
@@ -3029,9 +3238,9 @@ const b = {
lockedOn: null,
delay: 50,
cd: simulation.cycle + 10,
- dmg: 0, //radius * (tech.isMutualism ? 2.5 : 1),
+ dmg: 0,
setDamage() { //dmg is set to zero after doing damage once, and set back to normal after jumping
- this.dmg = radius * (tech.isMutualism ? 2.5 : 1) * (tech.isJunkDNA ? 1 + 0.53 * tech.junkCount : 1) //damage done in addition to the damage from momentum //spores do 7 dmg, worms do 18
+ this.dmg = radius * (tech.isMutualism ? 2.9 : 1) * (tech.isJunkDNA ? 1 + 0.53 * tech.junkCount : 1) //damage done in addition to the damage from momentum //spores do 7 dmg, worms do 18
},
beforeDmg(who) {
Matter.Body.setVelocity(this, Vector.mult(Vector.normalise(Vector.sub(this.position, who.position)), 10 + 10 * Math.random())); //push away from target
@@ -3044,17 +3253,22 @@ const b = {
for (let i = 0; i < 2; i++) { //spawn 2 more
const speed = 10 + 5 * Math.random()
const angle = 2 * Math.PI * Math.random()
- b.flea(this.position, { x: speed * Math.cos(angle), y: speed * Math.sin(angle) })
+ b.flea(this.position, {
+ x: speed * Math.cos(angle),
+ y: speed * Math.sin(angle)
+ })
}
}
this.endCycle = 0;
}, 1);
}
- setTimeout(() => { this.dmg = 0 })
+ setTimeout(() => {
+ this.dmg = 0
+ })
},
onEnd() {
if (tech.isMutualism && this.isMutualismActive && !tech.isEnergyHealth) {
- m.health += 0.01
+ m.health += 0.02
if (m.health > m.maxHealth) m.health = m.maxHealth;
m.displayHealth();
}
@@ -3087,7 +3301,10 @@ const b = {
if (tech.isSporeFollow && !this.lockedOn && Matter.Query.ray(map, this.position, m.pos).length === 0) {
this.lockedOn = { //make target player if there are no mobs to target
position: m.pos,
- velocity: { x: 0, y: 0 }
+ velocity: {
+ x: 0,
+ y: 0
+ }
}
}
if (this.lockedOn) { //hop towards mob target
@@ -3109,7 +3326,10 @@ const b = {
}
this.force.y = -(0.03 + 0.08 * Math.random()) * this.mass
}
- Matter.Body.setVelocity(this, { x: 0, y: 0 });
+ Matter.Body.setVelocity(this, {
+ x: 0,
+ y: 0
+ });
this.setDamage() //after jumping damage is no longer zero
}
}
@@ -3117,12 +3337,15 @@ const b = {
Composite.add(engine.world, bullet[me]); //add bullet to world
Matter.Body.setVelocity(bullet[me], velocity);
if (tech.isMutualism && m.health > 0.01) {
- m.health -= 0.005
+ m.health -= 0.01
m.displayHealth();
bullet[bullet.length - 1].isMutualismActive = true
}
},
- drone(where = { x: m.pos.x + 30 * Math.cos(m.angle) + 20 * (Math.random() - 0.5), y: m.pos.y + 30 * Math.sin(m.angle) + 20 * (Math.random() - 0.5) }, speed = 1) {
+ drone(where = {
+ x: m.pos.x + 30 * Math.cos(m.angle) + 20 * (Math.random() - 0.5),
+ y: m.pos.y + 30 * Math.sin(m.angle) + 20 * (Math.random() - 0.5)
+ }, speed = 1) {
const me = bullet.length;
const THRUST = 0.0015
const dir = m.angle + 0.4 * (Math.random() - 0.5);
@@ -3153,7 +3376,10 @@ const b = {
b.explosion(this.position, max * 0.1 + this.isImproved * 110 + 60 * Math.random()); //makes bullet do explosive damage at end
if (tech.isForeverDrones) {
this.endCycle = 0
- b.drone({ x: m.pos.x + 30 * (Math.random() - 0.5), y: m.pos.y + 30 * (Math.random() - 0.5) }, 5)
+ b.drone({
+ x: m.pos.x + 30 * (Math.random() - 0.5),
+ y: m.pos.y + 30 * (Math.random() - 0.5)
+ }, 5)
bullet[bullet.length - 1].endCycle = Infinity
} else {
this.endCycle -= max
@@ -3176,7 +3402,10 @@ const b = {
if (tech.isDroneRespawn && b.inventory.length) {
const who = b.guns[b.activeGun]
if (who.name === "drones" && who.ammo > 0 && mob.length) {
- b.drone({ x: this.position.x, y: this.position.y }, 0)
+ b.drone({
+ x: this.position.x,
+ y: this.position.y
+ }, 0)
if (Math.random() < 0.2) {
b.guns[b.activeGun].ammo--;
simulation.updateGunHUD();
@@ -3327,7 +3556,10 @@ const b = {
y: speed * Math.sin(dir)
});
},
- droneRadioactive(where = { x: m.pos.x + 30 * Math.cos(m.angle) + 20 * (Math.random() - 0.5), y: m.pos.y + 30 * Math.sin(m.angle) + 20 * (Math.random() - 0.5) }, speed = 1) {
+ droneRadioactive(where = {
+ x: m.pos.x + 30 * Math.cos(m.angle) + 20 * (Math.random() - 0.5),
+ y: m.pos.y + 30 * Math.sin(m.angle) + 20 * (Math.random() - 0.5)
+ }, speed = 1) {
const me = bullet.length;
const THRUST = (tech.isFastDrones ? 0.003 : 0.0012) + 0.0005 * (Math.random() - 0.5)
const dir = m.angle + 0.4 * (Math.random() - 0.5);
@@ -3359,7 +3591,10 @@ const b = {
if (tech.isDroneRespawn && b.inventory.length) {
const who = b.guns[b.activeGun]
if (who.name === "drones" && who.ammo > 0 && mob.length) {
- b.droneRadioactive({ x: this.position.x, y: this.position.y }, 0)
+ b.droneRadioactive({
+ x: this.position.x,
+ y: this.position.y
+ }, 0)
if (Math.random() < 0.2) {
b.guns[b.activeGun].ammo--;
simulation.updateGunHUD();
@@ -3720,7 +3955,10 @@ const b = {
if (!this.target && who.alive) {
this.target = who;
if (who.radius < 20) {
- this.targetRelativePosition = { x: 0, y: 0 } //find relative position vector for zero mob rotation
+ this.targetRelativePosition = {
+ x: 0,
+ y: 0
+ } //find relative position vector for zero mob rotation
} else if (Matter.Query.collides(this, [who]).length > 0) {
const normal = Matter.Query.collides(this, [who])[0].normal
this.targetRelativePosition = Vector.rotate(Vector.sub(Vector.sub(this.position, who.position), Vector.mult(normal, -this.radius)), -who.angle) //find relative position vector for zero mob rotation
@@ -3740,7 +3978,10 @@ const b = {
}
}
this.targetVertex = bestVertex
- Matter.Body.setVelocity(this, { x: 0, y: 0 });
+ Matter.Body.setVelocity(this, {
+ x: 0,
+ y: 0
+ });
}
},
onEnd() {},
@@ -3854,7 +4095,10 @@ const b = {
if (this.nextPortCycle < simulation.cycle) { //teleport around if you have tech.isBulletTeleport
this.nextPortCycle = simulation.cycle + this.portFrequency
const range = 13 * Math.sqrt(this.radius) * Math.random()
- Matter.Body.setPosition(this, Vector.add(this.position, Vector.rotate({ x: range, y: 0 }, 2 * Math.PI * Math.random())))
+ Matter.Body.setPosition(this, Vector.add(this.position, Vector.rotate({
+ x: range,
+ y: 0
+ }, 2 * Math.PI * Math.random())))
}
}
});
@@ -3956,7 +4200,7 @@ const b = {
Composite.add(engine.world, bullet[me]); //add bullet to world
bullet[me].endCycle = simulation.cycle + 60 + 18 * Math.random();
bullet[me].dmg = tech.isNailRadiation ? 0 : dmg
- bullet[me].beforeDmg = function(who) { //beforeDmg is rewritten with ice crystal tech
+ bullet[me].beforeDmg = function (who) { //beforeDmg is rewritten with ice crystal tech
if (tech.isNailRadiation) mobs.statusDoT(who, dmg * (tech.isFastRadiation ? 1.3 : 0.44), tech.isSlowRadiation ? 360 : (tech.isFastRadiation ? 60 : 180)) // one tick every 30 cycles
if (tech.isNailCrit) {
if (!who.shield && Vector.dot(Vector.normalise(Vector.sub(who.position, this.position)), Vector.normalise(this.velocity)) > 0.97 - 1 / who.radius) {
@@ -3965,7 +4209,7 @@ const b = {
}
this.ricochet(who)
};
- bullet[me].ricochet = function(who) { //use for normal nails, and ice crystal nails
+ bullet[me].ricochet = function (who) { //use for normal nails, and ice crystal nails
if (tech.isRicochet) {
const targets = [] //target nearby mobs
for (let i = 0, len = mob.length; i < len; i++) {
@@ -3990,7 +4234,7 @@ const b = {
this.dmg += 2
}
}
- bullet[me].do = function() {};
+ bullet[me].do = function () {};
},
needle(angle = m.angle) {
const me = bullet.length;
@@ -4004,7 +4248,7 @@ const b = {
bullet[me].collisionFilter.mask = tech.isShieldPierce ? 0 : cat.mobShield
// bullet[me].turnRate = 0.005 * (Math.random() - 0.5)
bullet[me].isInMap = false
- bullet[me].do = function() {
+ bullet[me].do = function () {
const whom = Matter.Query.collides(this, mob)
if (whom.length && this.speed > 20) { //if touching a mob
for (let i = 0, len = whom.length; i < len; i++) {
@@ -4062,7 +4306,7 @@ const b = {
} else {
bullet[me].endCycle = simulation.cycle + 100;
bullet[me].collisionFilter.mask = tech.isShieldPierce ? cat.body : cat.body | cat.mobShield
- bullet[me].do = function() {
+ bullet[me].do = function () {
const whom = Matter.Query.collides(this, mob)
if (whom.length && this.speed > 20) { //if touching a mob
for (let i = 0, len = whom.length; i < len; i++) {
@@ -4110,7 +4354,7 @@ const b = {
x: 0,
y: 0
});
- this.do = function() {
+ this.do = function () {
if (!Matter.Query.collides(this, map).length) this.force.y += this.mass * 0.001;
}
if (tech.isNeedleIce) {
@@ -4217,14 +4461,38 @@ const b = {
tech.missileBotCount = 0
},
respawnBots() {
- for (let i = 0; i < tech.dynamoBotCount; i++) b.dynamoBot({ x: player.position.x + 50 * (Math.random() - 0.5), y: player.position.y + 50 * (Math.random() - 0.5) }, false)
- for (let i = 0; i < tech.laserBotCount; i++) b.laserBot({ x: player.position.x + 50 * (Math.random() - 0.5), y: player.position.y + 50 * (Math.random() - 0.5) }, false)
- for (let i = 0; i < tech.nailBotCount; i++) b.nailBot({ x: player.position.x + 50 * (Math.random() - 0.5), y: player.position.y + 50 * (Math.random() - 0.5) }, false)
- for (let i = 0; i < tech.foamBotCount; i++) b.foamBot({ x: player.position.x + 50 * (Math.random() - 0.5), y: player.position.y + 50 * (Math.random() - 0.5) }, false)
- for (let i = 0; i < tech.boomBotCount; i++) b.boomBot({ x: player.position.x + 50 * (Math.random() - 0.5), y: player.position.y + 50 * (Math.random() - 0.5) }, false)
- for (let i = 0; i < tech.orbitBotCount; i++) b.orbitBot({ x: player.position.x + 50 * (Math.random() - 0.5), y: player.position.y + 50 * (Math.random() - 0.5) }, false)
- for (let i = 0; i < tech.plasmaBotCount; i++) b.plasmaBot({ x: player.position.x + 50 * (Math.random() - 0.5), y: player.position.y + 50 * (Math.random() - 0.5) }, false)
- for (let i = 0; i < tech.missileBotCount; i++) b.missileBot({ x: player.position.x + 50 * (Math.random() - 0.5), y: player.position.y + 50 * (Math.random() - 0.5) }, false)
+ for (let i = 0; i < tech.dynamoBotCount; i++) b.dynamoBot({
+ x: player.position.x + 50 * (Math.random() - 0.5),
+ y: player.position.y + 50 * (Math.random() - 0.5)
+ }, false)
+ for (let i = 0; i < tech.laserBotCount; i++) b.laserBot({
+ x: player.position.x + 50 * (Math.random() - 0.5),
+ y: player.position.y + 50 * (Math.random() - 0.5)
+ }, false)
+ for (let i = 0; i < tech.nailBotCount; i++) b.nailBot({
+ x: player.position.x + 50 * (Math.random() - 0.5),
+ y: player.position.y + 50 * (Math.random() - 0.5)
+ }, false)
+ for (let i = 0; i < tech.foamBotCount; i++) b.foamBot({
+ x: player.position.x + 50 * (Math.random() - 0.5),
+ y: player.position.y + 50 * (Math.random() - 0.5)
+ }, false)
+ for (let i = 0; i < tech.boomBotCount; i++) b.boomBot({
+ x: player.position.x + 50 * (Math.random() - 0.5),
+ y: player.position.y + 50 * (Math.random() - 0.5)
+ }, false)
+ for (let i = 0; i < tech.orbitBotCount; i++) b.orbitBot({
+ x: player.position.x + 50 * (Math.random() - 0.5),
+ y: player.position.y + 50 * (Math.random() - 0.5)
+ }, false)
+ for (let i = 0; i < tech.plasmaBotCount; i++) b.plasmaBot({
+ x: player.position.x + 50 * (Math.random() - 0.5),
+ y: player.position.y + 50 * (Math.random() - 0.5)
+ }, false)
+ for (let i = 0; i < tech.missileBotCount; i++) b.missileBot({
+ x: player.position.x + 50 * (Math.random() - 0.5),
+ y: player.position.y + 50 * (Math.random() - 0.5)
+ }, false)
if (tech.isIntangible && m.isCloak) {
for (let i = 0; i < bullet.length; i++) {
if (bullet[i].botType) bullet[i].collisionFilter.mask = cat.map | cat.bullet | cat.mobBullet | cat.mobShield
@@ -4403,13 +4671,19 @@ const b = {
}
}
let history = m.history[(m.cycle - this.followDelay) % 600]
- Matter.Body.setPosition(this, { x: history.position.x, y: history.position.y - history.yOff + 24.2859 }) //bullets move with player
+ Matter.Body.setPosition(this, {
+ x: history.position.x,
+ y: history.position.y - history.yOff + 24.2859
+ }) //bullets move with player
}
})
Composite.add(engine.world, bullet[me]); //add bullet to world
b.setDynamoBotDelay()
},
- nailBot(position = { x: player.position.x + 50 * (Math.random() - 0.5), y: player.position.y + 50 * (Math.random() - 0.5) }, isConsole = true) {
+ nailBot(position = {
+ x: player.position.x + 50 * (Math.random() - 0.5),
+ y: player.position.y + 50 * (Math.random() - 0.5)
+ }, isConsole = true) {
if (isConsole) simulation.makeTextLog(`b.nailBot()`);
const me = bullet.length;
const dir = m.angle;
@@ -4474,7 +4748,10 @@ const b = {
})
Composite.add(engine.world, bullet[me]); //add bullet to world
},
- missileBot(position = { x: player.position.x + 50 * (Math.random() - 0.5), y: player.position.y + 50 * (Math.random() - 0.5) }, isConsole = true) {
+ missileBot(position = {
+ x: player.position.x + 50 * (Math.random() - 0.5),
+ y: player.position.y + 50 * (Math.random() - 0.5)
+ }, isConsole = true) {
if (isConsole) simulation.makeTextLog(`b.missileBot()`);
const me = bullet.length;
bullet[me] = Bodies.rectangle(position.x, position.y, 28, 11, {
@@ -4548,7 +4825,10 @@ const b = {
})
Composite.add(engine.world, bullet[me]); //add bullet to world
},
- foamBot(position = { x: player.position.x + 50 * (Math.random() - 0.5), y: player.position.y + 50 * (Math.random() - 0.5) }, isConsole = true) {
+ foamBot(position = {
+ x: player.position.x + 50 * (Math.random() - 0.5),
+ y: player.position.y + 50 * (Math.random() - 0.5)
+ }, isConsole = true) {
if (isConsole) simulation.makeTextLog(`b.foamBot()`);
const me = bullet.length;
const dir = m.angle;
@@ -4603,7 +4883,10 @@ const b = {
})
Composite.add(engine.world, bullet[me]); //add bullet to world
},
- laserBot(position = { x: player.position.x + 50 * (Math.random() - 0.5), y: player.position.y + 50 * (Math.random() - 0.5) }, isConsole = true) {
+ laserBot(position = {
+ x: player.position.x + 50 * (Math.random() - 0.5),
+ y: player.position.y + 50 * (Math.random() - 0.5)
+ }, isConsole = true) {
if (isConsole) simulation.makeTextLog(`b.laserBot()`);
const me = bullet.length;
const dir = m.angle;
@@ -4618,7 +4901,10 @@ const b = {
restitution: 0.5 * (1 + 0.5 * Math.random()),
acceleration: 0.0015 * (1 + 0.3 * Math.random()),
playerRange: 140 + Math.floor(30 * Math.random()) + 2 * b.totalBots(),
- offPlayer: { x: 0, y: 0, },
+ offPlayer: {
+ x: 0,
+ y: 0,
+ },
dmg: 0, //damage done in addition to the damage from momentum
minDmgSpeed: 2,
lookFrequency: 20 + Math.floor(7 * Math.random()) - 13 * tech.isLaserBotUpgrade,
@@ -4687,10 +4973,23 @@ const b = {
const push = 0.4
const reflectivity = 1 - 1 / (tech.laserReflections * 3)
let damage = m.dmgScale * this.laserDamage * tech.laserDamage
- let best = { x: 1, y: 1, dist2: Infinity, who: null, v1: 1, v2: 1 };
- const path = [{ x: this.vertices[0].x, y: this.vertices[0].y }, { x: this.lockedOn.position.x, y: this.lockedOn.position.y }];
+ let best = {
+ x: 1,
+ y: 1,
+ dist2: Infinity,
+ who: null,
+ v1: 1,
+ v2: 1
+ };
+ const path = [{
+ x: this.vertices[0].x,
+ y: this.vertices[0].y
+ }, {
+ x: this.lockedOn.position.x,
+ y: this.lockedOn.position.y
+ }];
- const vertexCollision = function(v1, v1End, domain) {
+ const vertexCollision = function (v1, v1End, domain) {
for (let i = 0; i < domain.length; ++i) {
let vertices = domain[i].vertices;
const len = vertices.length - 1;
@@ -4731,13 +5030,20 @@ const b = {
}
};
- const checkForCollisions = function() {
- best = { x: 1, y: 1, dist2: Infinity, who: null, v1: 1, v2: 1 };
+ const checkForCollisions = function () {
+ best = {
+ x: 1,
+ y: 1,
+ dist2: Infinity,
+ who: null,
+ v1: 1,
+ v2: 1
+ };
vertexCollision(path[path.length - 2], path[path.length - 1], mob);
vertexCollision(path[path.length - 2], path[path.length - 1], map);
vertexCollision(path[path.length - 2], path[path.length - 1], body);
};
- const laserHitMob = function() {
+ const laserHitMob = function () {
if (best.who.alive) {
best.who.locatePlayer();
if (best.who.damageReduction) {
@@ -4766,18 +5072,24 @@ const b = {
}
if (tech.isLaserPush) { //push mobs away
const index = path.length - 1
- Matter.Body.setVelocity(best.who, { x: best.who.velocity.x * 0.97, y: best.who.velocity.y * 0.97 });
+ Matter.Body.setVelocity(best.who, {
+ x: best.who.velocity.x * 0.97,
+ y: best.who.velocity.y * 0.97
+ });
const force = Vector.mult(Vector.normalise(Vector.sub(path[index], path[Math.max(0, index - 1)])), 0.003 * push * Math.min(6, best.who.mass))
Matter.Body.applyForce(best.who, path[index], force)
}
} else if (tech.isLaserPush && best.who.classType === "body") {
const index = path.length - 1
- Matter.Body.setVelocity(best.who, { x: best.who.velocity.x * 0.97, y: best.who.velocity.y * 0.97 });
+ Matter.Body.setVelocity(best.who, {
+ x: best.who.velocity.x * 0.97,
+ y: best.who.velocity.y * 0.97
+ });
const force = Vector.mult(Vector.normalise(Vector.sub(path[index], path[Math.max(0, index - 1)])), 0.003 * push * Math.min(6, best.who.mass))
Matter.Body.applyForce(best.who, path[index], force)
}
};
- const reflection = function() { // https://math.stackexchange.com/questions/13261/how-to-get-a-reflection-vector
+ const reflection = function () { // https://math.stackexchange.com/questions/13261/how-to-get-a-reflection-vector
const n = Vector.perp(Vector.normalise(Vector.sub(best.v1, best.v2)));
const d = Vector.sub(path[path.length - 1], path[path.length - 2]);
const nn = Vector.mult(n, 2 * Vector.dot(d, n));
@@ -4789,14 +5101,20 @@ const b = {
let lastBestOdd
let lastBestEven = best.who //used in hack below
if (best.dist2 !== Infinity) { //if hitting something
- path[path.length - 1] = { x: best.x, y: best.y };
+ path[path.length - 1] = {
+ x: best.x,
+ y: best.y
+ };
laserHitMob();
for (let i = 0; i < tech.laserReflections; i++) {
reflection();
checkForCollisions();
if (best.dist2 !== Infinity) { //if hitting something
lastReflection = best
- path[path.length - 1] = { x: best.x, y: best.y };
+ path[path.length - 1] = {
+ x: best.x,
+ y: best.y
+ };
damage *= reflectivity
laserHitMob();
//I'm not clear on how this works, but it gets rid of a bug where the laser reflects inside a block, often vertically.
@@ -4829,7 +5147,10 @@ const b = {
})
Composite.add(engine.world, bullet[me]); //add bullet to world
},
- boomBot(position = { x: player.position.x + 50 * (Math.random() - 0.5), y: player.position.y + 50 * (Math.random() - 0.5) }, isConsole = true) {
+ boomBot(position = {
+ x: player.position.x + 50 * (Math.random() - 0.5),
+ y: player.position.y + 50 * (Math.random() - 0.5)
+ }, isConsole = true) {
if (isConsole) simulation.makeTextLog(`b.boomBot()`);
const me = bullet.length;
const dir = m.angle;
@@ -4917,7 +5238,10 @@ const b = {
})
Composite.add(engine.world, bullet[me]); //add bullet to world
},
- plasmaBot(position = { x: player.position.x + 50 * (Math.random() - 0.5), y: player.position.y + 50 * (Math.random() - 0.5) }, isConsole = true) {
+ plasmaBot(position = {
+ x: player.position.x + 50 * (Math.random() - 0.5),
+ y: player.position.y + 50 * (Math.random() - 0.5)
+ }, isConsole = true) {
if (isConsole) simulation.makeTextLog(`b.plasmaBot()`);
const me = bullet.length;
const dir = m.angle;
@@ -4992,7 +5316,7 @@ const b = {
y: this.position.y + range * unit.y
}
];
- const vertexCollision = function(v1, v1End, domain) {
+ const vertexCollision = function (v1, v1End, domain) {
for (let i = 0; i < domain.length; ++i) {
let vertices = domain[i].vertices;
const len = vertices.length - 1;
@@ -5151,8 +5475,14 @@ const b = {
if (!m.isCloak) { //if time dilation isn't active
const size = 33
q = Matter.Query.region(mob, {
- min: { x: this.position.x - size, y: this.position.y - size },
- max: { x: this.position.x + size, y: this.position.y + size }
+ min: {
+ x: this.position.x - size,
+ y: this.position.y - size
+ },
+ max: {
+ x: this.position.x + size,
+ y: this.position.y + size
+ }
})
for (let i = 0; i < q.length; i++) {
if (!q[i].isShielded) {
@@ -5293,7 +5623,9 @@ const b = {
b.needle()
function cycle() {
- if (simulation.paused || m.isBodiesAsleep) { requestAnimationFrame(cycle) } else {
+ if (simulation.paused || m.isBodiesAsleep) {
+ requestAnimationFrame(cycle)
+ } else {
count++
if (count % 2) b.needle()
if (count < 7 && m.alive) requestAnimationFrame(cycle);
@@ -5306,7 +5638,9 @@ const b = {
b.needle()
function cycle() {
- if (simulation.paused || m.isBodiesAsleep) { requestAnimationFrame(cycle) } else {
+ if (simulation.paused || m.isBodiesAsleep) {
+ requestAnimationFrame(cycle)
+ } else {
count++
if (count % 2) b.needle()
if (count < 3 && m.alive) requestAnimationFrame(cycle);
@@ -5331,7 +5665,7 @@ const b = {
});
bullet[me].endCycle = simulation.cycle + 180
- bullet[me].beforeDmg = function(who) { //beforeDmg is rewritten with ice crystal tech
+ bullet[me].beforeDmg = function (who) { //beforeDmg is rewritten with ice crystal tech
if (tech.isIncendiary) {
this.endCycle = 0; //bullet ends cycle after hitting a mob and triggers explosion
b.explosion(this.position, 100 + (Math.random() - 0.5) * 20); //makes bullet do explosive damage at end
@@ -5350,7 +5684,7 @@ const b = {
bullet[me].minDmgSpeed = 10
bullet[me].frictionAir = 0.006;
- bullet[me].rotateToVelocity = function() { //rotates bullet to face current velocity?
+ bullet[me].rotateToVelocity = function () { //rotates bullet to face current velocity?
if (this.speed > 7) {
const facing = {
x: Math.cos(this.angle),
@@ -5365,7 +5699,7 @@ const b = {
}
};
if (tech.isIncendiary) {
- bullet[me].do = function() {
+ bullet[me].do = function () {
this.force.y += this.mass * 0.0008
this.rotateToVelocity()
//collide with map
@@ -5375,7 +5709,7 @@ const b = {
}
};
} else {
- bullet[me].do = function() {
+ bullet[me].do = function () {
this.force.y += this.mass * 0.0008
this.rotateToVelocity()
};
@@ -5417,7 +5751,7 @@ const b = {
y: SPEED * Math.sin(m.angle)
});
bullet[me].endCycle = simulation.cycle + 180
- bullet[me].beforeDmg = function(who) { //beforeDmg is rewritten with ice crystal tech
+ bullet[me].beforeDmg = function (who) { //beforeDmg is rewritten with ice crystal tech
if (tech.isIncendiary) {
this.endCycle = 0; //bullet ends cycle after hitting a mob and triggers explosion
b.explosion(this.position, 100 + (Math.random() - 0.5) * 20); //makes bullet do explosive damage at end
@@ -5436,7 +5770,7 @@ const b = {
bullet[me].minDmgSpeed = 10
bullet[me].frictionAir = 0.006;
- bullet[me].rotateToVelocity = function() { //rotates bullet to face current velocity?
+ bullet[me].rotateToVelocity = function () { //rotates bullet to face current velocity?
if (this.speed > 7) {
const facing = {
x: Math.cos(this.angle),
@@ -5451,7 +5785,7 @@ const b = {
}
};
if (tech.isIncendiary) {
- bullet[me].do = function() {
+ bullet[me].do = function () {
this.force.y += this.mass * 0.0008
this.rotateToVelocity()
//collide with map
@@ -5461,7 +5795,7 @@ const b = {
}
};
} else {
- bullet[me].do = function() {
+ bullet[me].do = function () {
this.force.y += this.mass * 0.0008
this.rotateToVelocity()
};
@@ -5507,7 +5841,7 @@ const b = {
y: m.Vy / 2 + speed * Math.sin(angle)
}) //position, velocity, damage
if (tech.isIceCrystals) {
- bullet[bullet.length - 1].beforeDmg = function(who) {
+ bullet[bullet.length - 1].beforeDmg = function (who) {
mobs.statusSlow(who, 60)
if (tech.isNailRadiation) mobs.statusDoT(who, 1 * (tech.isFastRadiation ? 1.3 : 0.44), tech.isSlowRadiation ? 360 : (tech.isFastRadiation ? 60 : 180)) // one tick every 30 cycles
if (tech.isNailCrit) {
@@ -5527,7 +5861,7 @@ const b = {
},
{
name: "shotgun", //1
- description: "fire a wide burst of short range bullets",
+ description: "fire a wide burst of short range bullets
with a low fire rate",
ammo: 0,
ammoPack: 3.5,
defaultAmmoPack: 3.5,
@@ -5576,7 +5910,7 @@ const b = {
if (tech.isShotgunReversed) Matter.Body.setDensity(bullet[me], 0.0015)
// bullet[me].restitution = 0.4
bullet[me].frictionAir = 0.034;
- bullet[me].do = function() {
+ bullet[me].do = function () {
const scale = 1 - 0.034 / tech.isBulletsLastLonger
Matter.Body.scale(this, scale, scale);
};
@@ -5599,10 +5933,10 @@ const b = {
});
if (tech.isIncendiary) {
bullet[me].endCycle = simulation.cycle + 60
- bullet[me].onEnd = function() {
+ bullet[me].onEnd = function () {
b.explosion(this.position, 360 + (Math.random() - 0.5) * 60); //makes bullet do explosive damage at end
}
- bullet[me].beforeDmg = function() {
+ bullet[me].beforeDmg = function () {
this.endCycle = 0; //bullet ends cycle after hitting a mob and triggers explosion
};
} else {
@@ -5612,10 +5946,13 @@ const b = {
// bullet[me].restitution = 0.4
bullet[me].frictionAir = 0.004;
bullet[me].turnMag = 0.04 * Math.pow(tech.bulletSize, 3.75)
- bullet[me].do = function() {
+ bullet[me].do = function () {
this.force.y += this.mass * 0.002
if (this.speed > 6) { //rotates bullet to face current velocity?
- const facing = { x: Math.cos(this.angle), y: Math.sin(this.angle) }
+ const facing = {
+ x: Math.cos(this.angle),
+ y: Math.sin(this.angle)
+ }
if (Vector.cross(Vector.normalise(this.velocity), facing) < 0) {
this.torque += this.turnMag
} else {
@@ -5626,7 +5963,7 @@ const b = {
this.endCycle = 0; //bullet ends cycle after hitting a mob and triggers explosion
}
};
- bullet[me].beforeDmg = function(who) {
+ bullet[me].beforeDmg = function (who) {
if (this.speed > 4) {
if (tech.fragments) {
b.targetedNail(this.position, 6 * tech.fragments * tech.bulletSize)
@@ -5655,13 +5992,13 @@ const b = {
x: speed * Math.cos(dirOff),
y: speed * Math.sin(dirOff)
});
- bullet[me].onEnd = function() {
+ bullet[me].onEnd = function () {
b.explosion(this.position, 150 * (tech.isShotgunReversed ? 1.4 : 1) + (Math.random() - 0.5) * 40); //makes bullet do explosive damage at end
}
- bullet[me].beforeDmg = function() {
+ bullet[me].beforeDmg = function () {
this.endCycle = 0; //bullet ends cycle after hitting a mob and triggers explosion
};
- bullet[me].do = function() {
+ bullet[me].do = function () {
if (Matter.Query.collides(this, map).length) this.endCycle = 0; //bullet ends cycle after hitting a mob and triggers explosion
}
Composite.add(engine.world, bullet[me]); //add bullet to world
@@ -5697,17 +6034,26 @@ const b = {
}
}
} else if (tech.isSporeFlea) {
- const where = { x: m.pos.x + 35 * Math.cos(m.angle), y: m.pos.y + 35 * Math.sin(m.angle) }
+ const where = {
+ x: m.pos.x + 35 * Math.cos(m.angle),
+ y: m.pos.y + 35 * Math.sin(m.angle)
+ }
const number = 2 * (tech.isShotgunReversed ? 1.5 : 1)
for (let i = 0; i < number; i++) {
const angle = m.angle + 0.2 * (Math.random() - 0.5)
const speed = (input.down ? 35 * (1 + 0.05 * Math.random()) : 30 * (1 + 0.15 * Math.random()))
- b.flea(where, { x: speed * Math.cos(angle), y: speed * Math.sin(angle) })
+ b.flea(where, {
+ x: speed * Math.cos(angle),
+ y: speed * Math.sin(angle)
+ })
bullet[bullet.length - 1].setDamage()
}
spray(10); //fires normal shotgun bullets
} else if (tech.isSporeWorm) {
- const where = { x: m.pos.x + 35 * Math.cos(m.angle), y: m.pos.y + 35 * Math.sin(m.angle) }
+ const where = {
+ x: m.pos.x + 35 * Math.cos(m.angle),
+ y: m.pos.y + 35 * Math.sin(m.angle)
+ }
const spread = (input.down ? 0.02 : 0.07)
const number = 3 * (tech.isShotgunReversed ? 1.5 : 1)
let angle = m.angle - (number - 1) * spread * 0.5
@@ -5737,7 +6083,10 @@ const b = {
for (let i = 0; i < number; i++) {
const SPEED = 13 + 4 * Math.random();
const angle = m.angle + spread * (Math.random() - 0.5)
- b.foam(where, { x: SPEED * Math.cos(angle), y: SPEED * Math.sin(angle) }, 8 + 7 * Math.random())
+ b.foam(where, {
+ x: SPEED * Math.cos(angle),
+ y: SPEED * Math.sin(angle)
+ }, 8 + 7 * Math.random())
}
} else if (tech.isNeedles) {
const number = 9 * (tech.isShotgunReversed ? 1.5 : 1)
@@ -5778,11 +6127,11 @@ const b = {
bullet[me].minDmgSpeed = 0;
bullet[me].restitution = 1;
bullet[me].friction = 0;
- bullet[me].do = function() {
+ bullet[me].do = function () {
this.force.y += this.mass * 0.0012;
};
if (tech.isIncendiary) {
- bullet[me].do = function() {
+ bullet[me].do = function () {
this.force.y += this.mass * 0.0012;
if (Matter.Query.collides(this, map).length) {
b.explosion(this.position, this.mass * 280); //makes bullet do explosive damage at end
@@ -5790,21 +6139,24 @@ const b = {
}
};
} else {
- bullet[me].do = function() {
+ bullet[me].do = function () {
this.force.y += this.mass * 0.0012;
};
}
- bullet[me].beforeDmg = function(who) {
- mobs.statusStun(who, 180) // (2.3) * 2 / 14 ticks (2x damage over 7 seconds)
+ bullet[me].beforeDmg = function (who) {
+ mobs.statusStun(who, 120) // (2.3) * 2 / 14 ticks (2x damage over 7 seconds)
if (tech.isIncendiary) {
b.explosion(this.position, this.mass * 280); //makes bullet do explosive damage at end
this.endCycle = 0
}
if (tech.isFoamBall) {
- const radius = 5 + 8 * Math.random()
- // const velocity = { x: Math.max(2, 10 - radius * 0.25), y: 0 }
- const velocity = { x: Math.max(0.5, 2 - radius * 0.1), y: 0 }
for (let i = 0, len = 6 * this.mass; i < len; i++) {
+ const radius = 5 + 8 * Math.random()
+ // const velocity = { x: Math.max(2, 10 - radius * 0.25), y: 0 }
+ const velocity = {
+ x: Math.max(0.5, 2 - radius * 0.1),
+ y: 0
+ }
b.foam(this.position, Vector.rotate(velocity, 6.28 * Math.random()), radius)
}
this.endCycle = 0
@@ -5832,7 +6184,7 @@ const b = {
bullet[me].restitution = 0.99;
bullet[me].friction = 0;
if (tech.isIncendiary) {
- bullet[me].do = function() {
+ bullet[me].do = function () {
this.force.y += this.mass * 0.0012;
if (Matter.Query.collides(this, map).length) {
b.explosion(this.position, this.mass * 280); //makes bullet do explosive damage at end
@@ -5840,19 +6192,22 @@ const b = {
}
};
} else {
- bullet[me].do = function() {
+ bullet[me].do = function () {
this.force.y += this.mass * 0.0012;
};
}
- bullet[me].beforeDmg = function() {
+ bullet[me].beforeDmg = function () {
if (tech.isIncendiary) {
b.explosion(this.position, this.mass * 320 + 70 * Math.random()); //makes bullet do explosive damage at end
this.endCycle = 0
}
if (tech.isFoamBall) {
- const radius = 5 + 8 * Math.random()
- const velocity = { x: Math.max(0.5, 2 - radius * 0.1), y: 0 }
for (let i = 0, len = 6 * this.mass; i < len; i++) {
+ const radius = 5 + 8 * Math.random()
+ const velocity = {
+ x: Math.max(0.5, 2 - radius * 0.1),
+ y: 0
+ }
b.foam(this.position, Vector.rotate(velocity, 6.28 * Math.random()), radius)
}
this.endCycle = 0
@@ -5884,7 +6239,7 @@ const b = {
bullet[me].restitution = 0.99;
bullet[me].friction = 0;
if (tech.isIncendiary) {
- bullet[me].do = function() {
+ bullet[me].do = function () {
this.force.y += this.mass * 0.0012;
if (Matter.Query.collides(this, map).length) {
b.explosion(this.position, this.mass * 280); //makes bullet do explosive damage at end
@@ -5892,19 +6247,22 @@ const b = {
}
};
} else {
- bullet[me].do = function() {
+ bullet[me].do = function () {
this.force.y += this.mass * 0.0012;
};
}
- bullet[me].beforeDmg = function() {
+ bullet[me].beforeDmg = function () {
if (tech.isIncendiary) {
b.explosion(this.position, this.mass * 320 + 70 * Math.random()); //makes bullet do explosive damage at end
this.endCycle = 0
}
if (tech.isFoamBall) {
- const radius = 5 + 8 * Math.random()
- const velocity = { x: Math.max(0.5, 2 - radius * 0.1), y: 0 }
for (let i = 0, len = 6 * this.mass; i < len; i++) {
+ const radius = 5 + 8 * Math.random()
+ const velocity = {
+ x: Math.max(0.5, 2 - radius * 0.1),
+ y: 0
+ }
b.foam(this.position, Vector.rotate(velocity, 6.28 * Math.random()), radius)
}
this.endCycle = 0
@@ -6067,7 +6425,10 @@ const b = {
fire360Longitudinal() {
m.fireCDcycle = m.cycle + Math.floor((input.down ? 4 : 8) * b.fireCDscale * tech.infiniteWaveAmmo); // cool down
this.waves.push({
- position: { x: m.pos.x, y: m.pos.y, },
+ position: {
+ x: m.pos.x,
+ y: m.pos.y,
+ },
radius: 25,
reflection: tech.waveReflections,
expanding: true,
@@ -6131,8 +6492,14 @@ const b = {
this.waves.push({
position: who.position,
angle: angle - halfArc, //used in drawing ctx.arc
- unit1: { x: Math.cos(angle - halfArc), y: Math.sin(angle - halfArc) }, //used for collision
- unit2: { x: Math.cos(angle + halfArc), y: Math.sin(angle + halfArc) }, //used for collision
+ unit1: {
+ x: Math.cos(angle - halfArc),
+ y: Math.sin(angle - halfArc)
+ }, //used for collision
+ unit2: {
+ x: Math.cos(angle + halfArc),
+ y: Math.sin(angle + halfArc)
+ }, //used for collision
arc: halfArc * 2,
radius: 25,
reflection: 1,
@@ -6195,8 +6562,14 @@ const b = {
y: m.pos.y + 25 * Math.sin(m.angle),
},
angle: angle - halfArc, //used in drawing ctx.arc
- unit1: { x: Math.cos(angle - halfArc), y: Math.sin(angle - halfArc) }, //used for collision
- unit2: { x: Math.cos(angle + halfArc), y: Math.sin(angle + halfArc) }, //used for collision
+ unit1: {
+ x: Math.cos(angle - halfArc),
+ y: Math.sin(angle - halfArc)
+ }, //used for collision
+ unit2: {
+ x: Math.cos(angle + halfArc),
+ y: Math.sin(angle + halfArc)
+ }, //used for collision
arc: halfArc * 2,
radius: 25,
reflection: tech.waveReflections,
@@ -6272,13 +6645,16 @@ const b = {
}
});
if (tech.isBulletTeleport) {
- bullet[me].wiggle = function() {
+ bullet[me].wiggle = function () {
this.cycle++
const where = Vector.mult(transverse, this.amplitude * Math.cos(this.cycle * tech.waveFrequency))
if (Math.random() < 0.005) {
if (Math.random() < 0.33) { //randomize position
const scale = 500 * Math.random()
- Matter.Body.setPosition(this, Vector.add({ x: scale * (Math.random() - 0.5), y: scale * (Math.random() - 0.5) }, Vector.add(this.position, where)))
+ Matter.Body.setPosition(this, Vector.add({
+ x: scale * (Math.random() - 0.5),
+ y: scale * (Math.random() - 0.5)
+ }, Vector.add(this.position, where)))
} else { //randomize position in velocity direction
const velocityScale = Vector.mult(this.velocity, 50 * (Math.random() - 0.5))
Matter.Body.setPosition(this, Vector.add(velocityScale, Vector.add(this.position, where)))
@@ -6298,7 +6674,7 @@ const b = {
}
if (tech.waveReflections) {
bullet[me].reflectCycle = totalCycles / tech.waveReflections //tech.waveLengthRange
- bullet[me].do = function() {
+ bullet[me].do = function () {
this.query()
if (this.cycle > this.reflectCycle) {
this.reflectCycle += totalCycles / tech.waveReflections
@@ -6308,7 +6684,7 @@ const b = {
this.wiggle()
}
} else {
- bullet[me].do = function() {
+ bullet[me].do = function () {
this.query()
this.wiggle();
}
@@ -6330,7 +6706,7 @@ const b = {
},
{
name: "missiles", //6
- description: "launch homing missiles that explode",
+ description: "launch homing missiles that target mobs
missiles explode on contact with mobs",
ammo: 0,
ammoPack: 5,
have: false,
@@ -6391,11 +6767,17 @@ const b = {
let count = 0
const fireMissile = () => {
if (input.down) {
- b.missile({ x: m.pos.x + 30 * direction.x, y: m.pos.y + 30 * direction.y }, m.angle, 20, sqrtCountReduction)
+ b.missile({
+ x: m.pos.x + 30 * direction.x,
+ y: m.pos.y + 30 * direction.y
+ }, m.angle, 20, sqrtCountReduction)
bullet[bullet.length - 1].force.x += 0.5 * push.x * (Math.random() - 0.5)
bullet[bullet.length - 1].force.y += 0.004 + 0.5 * push.y * (Math.random() - 0.5)
} else {
- b.missile({ x: m.pos.x + 30 * direction.x, y: m.pos.y + 30 * direction.y }, m.angle, -15, sqrtCountReduction)
+ b.missile({
+ x: m.pos.x + 30 * direction.x,
+ y: m.pos.y + 30 * direction.y
+ }, m.angle, -15, sqrtCountReduction)
bullet[bullet.length - 1].force.x += push.x * (Math.random() - 0.5)
bullet[bullet.length - 1].force.y += 0.005 + push.y * (Math.random() - 0.5)
}
@@ -6414,9 +6796,15 @@ const b = {
requestAnimationFrame(cycle);
} else {
if (input.down) {
- b.missile({ x: m.pos.x + 40 * direction.x, y: m.pos.y + 40 * direction.y }, m.angle, 25)
+ b.missile({
+ x: m.pos.x + 40 * direction.x,
+ y: m.pos.y + 40 * direction.y
+ }, m.angle, 25)
} else {
- b.missile({ x: m.pos.x + 40 * direction.x, y: m.pos.y + 40 * direction.y }, m.angle, -12)
+ b.missile({
+ x: m.pos.x + 40 * direction.x,
+ y: m.pos.y + 40 * direction.y
+ }, m.angle, -12)
bullet[bullet.length - 1].force.y += 0.04 * (Math.random() - 0.2)
}
}
@@ -6431,7 +6819,10 @@ const b = {
fire() {
const countReduction = Math.pow(0.93, tech.missileCount)
m.fireCDcycle = m.cycle + Math.floor((input.down ? 35 : 27) * b.fireCDscale / countReduction); // cool down
- const where = { x: m.pos.x + 30 * Math.cos(m.angle), y: m.pos.y + 30 * Math.sin(m.angle) }
+ const where = {
+ x: m.pos.x + 30 * Math.cos(m.angle),
+ y: m.pos.y + 30 * Math.sin(m.angle)
+ }
const SPREAD = input.down ? 0.12 : 0.2
let angle = m.angle - SPREAD * (tech.missileCount - 1) / 2;
for (let i = 0; i < tech.missileCount; i++) {
@@ -6469,12 +6860,15 @@ const b = {
bullet[me].restitution = 0.3;
bullet[me].minDmgSpeed = 0;
bullet[me].totalSpores = 8 + 2 * tech.isSporeFreeze + 4 * tech.isSporeColony
- bullet[me].stuck = function() {};
- bullet[me].beforeDmg = function() {};
- bullet[me].do = function() {
+ bullet[me].stuck = function () {};
+ bullet[me].beforeDmg = function () {};
+ bullet[me].do = function () {
function onCollide(that) {
that.collisionFilter.mask = 0; //non collide with everything
- Matter.Body.setVelocity(that, { x: 0, y: 0 });
+ Matter.Body.setVelocity(that, {
+ x: 0,
+ y: 0
+ });
that.do = that.grow;
}
@@ -6484,19 +6878,22 @@ const b = {
this.stuckTo = mobCollisions[0].bodyA
if (this.stuckTo.isVerticesChange) {
- this.stuckToRelativePosition = { x: 0, y: 0 }
+ this.stuckToRelativePosition = {
+ x: 0,
+ y: 0
+ }
} else {
//find the relative position for when the mob is at angle zero by undoing the mobs rotation
this.stuckToRelativePosition = Vector.rotate(Vector.sub(this.position, this.stuckTo.position), -this.stuckTo.angle)
}
- this.stuck = function() {
+ this.stuck = function () {
if (this.stuckTo && this.stuckTo.alive) {
const rotate = Vector.rotate(this.stuckToRelativePosition, this.stuckTo.angle) //add in the mob's new angle to the relative position vector
Matter.Body.setPosition(this, Vector.add(Vector.add(rotate, this.stuckTo.velocity), this.stuckTo.position))
Matter.Body.setVelocity(this, this.stuckTo.velocity); //so that it will move properly if it gets unstuck
} else {
this.collisionFilter.mask = cat.map; //non collide with everything but map
- this.stuck = function() {
+ this.stuck = function () {
this.force.y += this.mass * 0.0006;
}
}
@@ -6512,7 +6909,7 @@ const b = {
} else {
this.do = this.grow;
}
- this.stuck = function() {
+ this.stuck = function () {
if (this.stuckTo) {
const rotate = Vector.rotate(this.stuckToRelativePosition, this.stuckTo.angle) //add in the mob's new angle to the relative position vector
Matter.Body.setPosition(this, Vector.add(Vector.add(rotate, this.stuckTo.velocity), this.stuckTo.position))
@@ -6535,7 +6932,7 @@ const b = {
ctx.arc(this.position.x, this.position.y, this.maxRadius, 0, 2 * Math.PI);
ctx.fill();
}
- bullet[me].grow = function() {
+ bullet[me].grow = function () {
this.stuck(); //runs different code based on what the bullet is stuck to
let scale = 1.01
if (tech.isSporeGrowth && !(simulation.cycle % 40)) { //release a spore
@@ -6543,7 +6940,10 @@ const b = {
if (!(simulation.cycle % 80)) {
const speed = 10 + 5 * Math.random()
const angle = 2 * Math.PI * Math.random()
- b.flea(this.position, { x: speed * Math.cos(angle), y: speed * Math.sin(angle) })
+ b.flea(this.position, {
+ x: speed * Math.cos(angle),
+ y: speed * Math.sin(angle)
+ })
}
} else if (tech.isSporeWorm) {
if (!(simulation.cycle % 80)) b.worm(this.position)
@@ -6567,7 +6967,7 @@ const b = {
ctx.fill();
};
//spawn bullets on end
- bullet[me].onEnd = function() {
+ bullet[me].onEnd = function () {
let count = 0 //used in for loop below
const things = [
@@ -6582,7 +6982,10 @@ const b = {
count++ //count as 2 things
const speed = 10 + 5 * Math.random()
const angle = 2 * Math.PI * Math.random()
- b.flea(this.position, { x: speed * Math.cos(angle), y: speed * Math.sin(angle) })
+ b.flea(this.position, {
+ x: speed * Math.cos(angle),
+ y: speed * Math.sin(angle)
+ })
},
() => { // drones
b.drone(this.position)
@@ -6622,7 +7025,7 @@ const b = {
}
}, {
name: "drones", //7
- description: "deploy drones that crash into mobs
crashes reduce their lifespan by 1 second",
+ description: "deploy drones that crash into mobs
or collect nearby power ups", //crashes reduce their lifespan by 1 second
ammo: 0,
ammoPack: 16,
defaultAmmoPack: 16,
@@ -6631,18 +7034,30 @@ const b = {
fire() {
if (tech.isDroneRadioactive) {
if (input.down) {
- b.droneRadioactive({ x: m.pos.x + 30 * Math.cos(m.angle) + 10 * (Math.random() - 0.5), y: m.pos.y + 30 * Math.sin(m.angle) + 10 * (Math.random() - 0.5) }, 45)
+ b.droneRadioactive({
+ x: m.pos.x + 30 * Math.cos(m.angle) + 10 * (Math.random() - 0.5),
+ y: m.pos.y + 30 * Math.sin(m.angle) + 10 * (Math.random() - 0.5)
+ }, 45)
m.fireCDcycle = m.cycle + Math.floor(50 * b.fireCDscale); // cool down
} else {
- b.droneRadioactive({ x: m.pos.x + 30 * Math.cos(m.angle) + 10 * (Math.random() - 0.5), y: m.pos.y + 30 * Math.sin(m.angle) + 10 * (Math.random() - 0.5) }, 10)
+ b.droneRadioactive({
+ x: m.pos.x + 30 * Math.cos(m.angle) + 10 * (Math.random() - 0.5),
+ y: m.pos.y + 30 * Math.sin(m.angle) + 10 * (Math.random() - 0.5)
+ }, 10)
m.fireCDcycle = m.cycle + Math.floor(25 * b.fireCDscale); // cool down
}
} else {
if (input.down) {
- b.drone({ x: m.pos.x + 30 * Math.cos(m.angle) + 10 * (Math.random() - 0.5), y: m.pos.y + 30 * Math.sin(m.angle) + 10 * (Math.random() - 0.5) }, 55)
+ b.drone({
+ x: m.pos.x + 30 * Math.cos(m.angle) + 10 * (Math.random() - 0.5),
+ y: m.pos.y + 30 * Math.sin(m.angle) + 10 * (Math.random() - 0.5)
+ }, 55)
m.fireCDcycle = m.cycle + Math.floor(10 * b.fireCDscale); // cool down
} else {
- b.drone({ x: m.pos.x + 30 * Math.cos(m.angle) + 10 * (Math.random() - 0.5), y: m.pos.y + 30 * Math.sin(m.angle) + 10 * (Math.random() - 0.5) }, 20)
+ b.drone({
+ x: m.pos.x + 30 * Math.cos(m.angle) + 10 * (Math.random() - 0.5),
+ y: m.pos.y + 30 * Math.sin(m.angle) + 10 * (Math.random() - 0.5)
+ }, 20)
m.fireCDcycle = m.cycle + Math.floor(5 * b.fireCDscale); // cool down
}
}
@@ -6758,7 +7173,7 @@ const b = {
name: "harpoon", //9
description: "fire a self-steering harpoon that uses energy
to retract and refund its ammo cost",
ammo: 0,
- ammoPack: 0.6, //update this in railgun tech
+ ammoPack: 1.7, //update this in railgun tech
have: false,
fire() {},
do() {},
@@ -6777,7 +7192,7 @@ const b = {
charge: 0,
railDo() {
if (this.charge > 0) {
- const DRAIN = (tech.isRailEnergy ? 0.00025 : 0.002)
+ const DRAIN = (tech.isRailEnergy ? 0.0002 : 0.002)
//exit railgun charging without firing
if (m.energy < DRAIN) {
// m.energy += 0.025 + this.charge * 22 * this.drain
@@ -6845,7 +7260,10 @@ const b = {
}
//draw little dots near the edge of range
for (let i = 0, len = 10 + 25 * this.charge; i < len; i++) {
- const unit = Vector.rotate({ x: 1, y: 0 }, 6.28 * Math.random())
+ const unit = Vector.rotate({
+ x: 1,
+ y: 0
+ }, 6.28 * Math.random())
const where = Vector.add(m.pos, Vector.mult(unit, range * (0.6 + 0.3 * Math.random())))
simulation.drawList.push({
x: where.x,
@@ -6867,7 +7285,10 @@ const b = {
let targetCount = 0
const SPREAD = 0.06 + 0.05 * (!input.down)
let angle = m.angle - SPREAD * tech.extraHarpoons / 2;
- const dir = { x: Math.cos(angle), y: Math.sin(angle) }; //make a vector for the player's direction of length 1; used in dot product
+ const dir = {
+ x: Math.cos(angle),
+ y: Math.sin(angle)
+ }; //make a vector for the player's direction of length 1; used in dot product
for (let i = 0, len = mob.length; i < len; ++i) {
if (mob[i].alive && !mob[i].isBadTarget && !mob[i].shield && Matter.Query.ray(map, m.pos, mob[i].position).length === 0 && !mob[i].isInvulnerable) {
@@ -6895,7 +7316,10 @@ const b = {
simulation.updateGunHUD();
} else {
//look for closest mob in player's LoS
- const dir = { x: Math.cos(m.angle), y: Math.sin(m.angle) }; //make a vector for the player's direction of length 1; used in dot product
+ const dir = {
+ x: Math.cos(m.angle),
+ y: Math.sin(m.angle)
+ }; //make a vector for the player's direction of length 1; used in dot product
for (let i = 0, len = mob.length; i < len; ++i) {
if (mob[i].alive && !mob[i].isBadTarget && Matter.Query.ray(map, m.pos, mob[i].position).length === 0 && !mob[i].isInvulnerable) {
const dot = Vector.dot(dir, Vector.normalise(Vector.sub(mob[i].position, m.pos))) //the dot product of diff and dir will return how much over lap between the vectors
@@ -6931,13 +7355,13 @@ const b = {
this.charge = 1 - smoothRate + this.charge * smoothRate
if (m.energy > DRAIN) m.energy -= DRAIN
- // console.log((this.charge).toFixed(2))
- // m.energy += (this.charge - previousCharge) * ((tech.isRailEnergy ? 0.5 : -0.3)) //energy drain is proportional to charge gained, but doesn't stop normal m.fieldRegen
-
//draw magnetic field
const X = m.pos.x
const Y = m.pos.y
- const unitVector = { x: Math.cos(m.angle), y: Math.sin(m.angle) }
+ const unitVector = {
+ x: Math.cos(m.angle),
+ y: Math.sin(m.angle)
+ }
const unitVectorPerp = Vector.perp(unitVector)
function magField(mag, arc) {
@@ -6995,7 +7419,9 @@ const b = {
if (tech.crouchAmmoCount) tech.crouchAmmoCount = 1
b.grapple(where, m.angle, harpoonSize)
}
- m.fireCDcycle = m.cycle + Math.floor(75 * b.fireCDscale) // cool down
+ // m.fireCDcycle = m.cycle + Math.floor(75 * b.fireCDscale) // cool down
+ m.fireCDcycle = m.cycle + 5 + 40 * b.fireCDscale + 60 * (m.energy < 0.05)
+
},
harpoonFire() {
const where = {
@@ -7008,12 +7434,15 @@ 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 = 6 * (tech.isFilament ? 1 + 0.012 * Math.min(110, this.ammo) : 1) * Math.sqrt(harpoonSize)
+ const totalCycles = 6.5 * (tech.isFilament ? 1 + 0.013 * Math.min(110, this.ammo) : 1) * Math.sqrt(harpoonSize)
if (tech.extraHarpoons && !input.down) { //multiple harpoons
- const SPREAD = 0.1
+ const SPREAD = 0.2
let angle = m.angle - SPREAD * tech.extraHarpoons / 2;
- const dir = { x: Math.cos(angle), y: Math.sin(angle) }; //make a vector for the player's direction of length 1; used in dot product
+ const dir = {
+ x: Math.cos(angle),
+ y: Math.sin(angle)
+ }; //make a vector for the player's direction of length 1; used in dot product
const range = 450 * (tech.isFilament ? 1 + 0.012 * Math.min(110, this.ammo) : 1)
let targetCount = 0
for (let i = 0, len = mob.length; i < len; ++i) {
@@ -7034,17 +7463,21 @@ const b = {
//if more harpoons and no targets left
if (targetCount < tech.extraHarpoons + 1) {
const num = tech.extraHarpoons - targetCount
- const delay = 7 //Math.floor(Math.max(4, 8 - 0.5 * tech.extraHarpoons))
+ const delay = 1 //Math.floor(Math.max(4, 8 - 0.5 * tech.extraHarpoons))
+ let angle = m.angle - SPREAD * tech.extraHarpoons / 2;
let count = -1
let harpoonDelay = () => {
- if (simulation.paused) { requestAnimationFrame(harpoonDelay) } else {
+ if (simulation.paused) {
+ requestAnimationFrame(harpoonDelay)
+ } else {
count++
if (!(count % delay) && this.ammo > 0) {
this.ammo--
b.harpoon({
x: m.pos.x + 30 * Math.cos(m.angle),
y: m.pos.y + 30 * Math.sin(m.angle)
- }, null, m.angle, harpoonSize, true, totalCycles)
+ }, null, angle, harpoonSize, true, totalCycles)
+ angle += SPREAD
tech.harpoonDensity = 0.004 //0.001 is normal for blocks, 0.004 is normal for harpoon, 0.004*6 when buffed
}
if (count < num * delay && m.alive) requestAnimationFrame(harpoonDelay);
@@ -7054,9 +7487,12 @@ const b = {
}
this.ammo++ //make up for the ammo used up in fire()
simulation.updateGunHUD();
- m.fireCDcycle = m.cycle + 90 // cool down is set when harpoon bullet returns to player
+
} else { //input.down makes a single harpoon with longer range
- const dir = { x: Math.cos(m.angle), y: Math.sin(m.angle) }; //make a vector for the player's direction of length 1; used in dot product
+ const dir = {
+ x: Math.cos(m.angle),
+ y: Math.sin(m.angle)
+ }; //make a vector for the player's direction of length 1; used in dot product
for (let i = 0, len = mob.length; i < len; ++i) {
if (mob[i].alive && !mob[i].isBadTarget && Matter.Query.ray(map, m.pos, mob[i].position).length === 0 && !mob[i].isInvulnerable) {
const dot = Vector.dot(dir, Vector.normalise(Vector.sub(mob[i].position, m.pos))) //the dot product of diff and dir will return how much over lap between the vectors
@@ -7068,13 +7504,13 @@ const b = {
}
}
if (input.down && m.onGround) {
- b.harpoon(where, null, m.angle, harpoonSize, true, 1.5 * totalCycles, (input.down && tech.crouchAmmoCount && (tech.crouchAmmoCount - 1) % 2) ? false : true) // harpoon(where, target, angle = m.angle, harpoonSize = 1, isReturn = false, totalCycles = 35, isReturnAmmo = true) {
+ b.harpoon(where, null, m.angle, harpoonSize, true, 1.6 * totalCycles, (input.down && tech.crouchAmmoCount && (tech.crouchAmmoCount - 1) % 2) ? false : true) // harpoon(where, target, angle = m.angle, harpoonSize = 1, isReturn = false, totalCycles = 35, isReturnAmmo = true) {
} else {
b.harpoon(where, closest.target, m.angle, harpoonSize, true, totalCycles)
}
- m.fireCDcycle = m.cycle + 45 // cool down is set when harpoon bullet returns to player
tech.harpoonDensity = 0.004 //0.001 is normal for blocks, 0.004 is normal for harpoon, 0.004*6 when buffed
}
+ m.fireCDcycle = m.cycle + 5 + 35 * b.fireCDscale + 60 * (m.energy < 0.05) + tech.extraHarpoons // cool down is set when harpoon bullet returns to player
const recoil = Vector.mult(Vector.normalise(Vector.sub(where, m.pos)), input.down ? 0.015 : 0.035)
player.force.x -= recoil.x
player.force.y -= recoil.y
@@ -7083,13 +7519,16 @@ const b = {
name: "mine", //10
description: "toss a proximity mine that sticks to walls
refund undetonated mines on exiting a level", //fires nails at mobs within range
ammo: 0,
- ammoPack: 1.25,
+ ammoPack: 1.7,
have: false,
do() {
if (!input.field && input.down && !tech.isLaserMine) {
const cycles = 60 //30
const speed = 40
- const v = { x: speed * Math.cos(m.angle), y: speed * Math.sin(m.angle) } //m.Vy / 2 + removed to make the path less jerky
+ const v = {
+ x: speed * Math.cos(m.angle),
+ y: speed * Math.sin(m.angle)
+ } //m.Vy / 2 + removed to make the path less jerky
ctx.strokeStyle = "rgba(68, 68, 68, 0.2)" //color.map
ctx.lineWidth = 2
ctx.beginPath()
@@ -7104,21 +7543,36 @@ const b = {
if (input.down) {
if (tech.isLaserMine) {
const speed = 30
- const velocity = { x: speed * Math.cos(m.angle), y: speed * Math.sin(m.angle) }
+ const velocity = {
+ x: speed * Math.cos(m.angle),
+ y: speed * Math.sin(m.angle)
+ }
b.laserMine(m.pos, velocity)
m.fireCDcycle = m.cycle + Math.floor(65 * b.fireCDscale); // cool down
} else {
- const pos = { x: m.pos.x + 30 * Math.cos(m.angle), y: m.pos.y + 30 * Math.sin(m.angle) }
+ const pos = {
+ x: m.pos.x + 30 * Math.cos(m.angle),
+ y: m.pos.y + 30 * Math.sin(m.angle)
+ }
let speed = 36
if (Matter.Query.point(map, pos).length > 0) speed = -2 //don't launch if mine will spawn inside map
- b.mine(pos, { x: speed * Math.cos(m.angle), y: speed * Math.sin(m.angle) }, 0)
+ b.mine(pos, {
+ x: speed * Math.cos(m.angle),
+ y: speed * Math.sin(m.angle)
+ }, 0)
m.fireCDcycle = m.cycle + Math.floor(55 * b.fireCDscale); // cool down
}
} else {
- const pos = { x: m.pos.x + 30 * Math.cos(m.angle), y: m.pos.y + 30 * Math.sin(m.angle) }
+ const pos = {
+ x: m.pos.x + 30 * Math.cos(m.angle),
+ y: m.pos.y + 30 * Math.sin(m.angle)
+ }
let speed = 23
if (Matter.Query.point(map, pos).length > 0) speed = -2 //don't launch if mine will spawn inside map
- b.mine(pos, { x: speed * Math.cos(m.angle), y: speed * Math.sin(m.angle) }, 0)
+ b.mine(pos, {
+ x: speed * Math.cos(m.angle),
+ y: speed * Math.sin(m.angle)
+ }, 0)
m.fireCDcycle = m.cycle + Math.floor(35 * b.fireCDscale); // cool down
}
}
@@ -7213,7 +7667,10 @@ const b = {
for (let i = 0; i < len; i++) {
const history = m.history[(m.cycle - i * spacing) % 600]
const off = history.yOff - 24.2859
- b.pulse(1.65 * this.charge * this.lensDamage, history.angle, { x: history.position.x, y: history.position.y - off })
+ b.pulse(1.65 * this.charge * this.lensDamage, history.angle, {
+ x: history.position.x,
+ y: history.position.y - off
+ })
}
}
this.charge = 0;
@@ -7259,10 +7716,6 @@ const b = {
}
// this.fire = this.firePhoton
},
- // firePhoton() {
- // m.fireCDcycle = m.cycle + Math.floor((tech.isPulseAim ? 25 : 50) * b.fireCDscale); // cool down
- // b.photon({ x: m.pos.x + 23 * Math.cos(m.angle), y: m.pos.y + 23 * Math.sin(m.angle) }, m.angle)
- // },
fireLaser() {
const drain = 0.001 + tech.laserDrain / b.fireCDscale
if (m.energy < drain) {
@@ -7326,7 +7779,10 @@ const b = {
y: 7.5 * Math.sin(m.angle - Math.PI / 2)
}
const dmg = 0.70 * tech.laserDamage / b.fireCDscale * this.lensDamage // 3.5 * 0.55 = 200% more damage
- const where = { x: m.pos.x + 30 * Math.cos(m.angle), y: m.pos.y + 30 * Math.sin(m.angle) }
+ const where = {
+ x: m.pos.x + 30 * Math.cos(m.angle),
+ y: m.pos.y + 30 * Math.sin(m.angle)
+ }
const eye = {
x: m.pos.x + 15 * Math.cos(m.angle),
y: m.pos.y + 15 * Math.sin(m.angle)
diff --git a/js/index.js b/js/index.js
index 070d780..09ec3ba 100644
--- a/js/index.js
+++ b/js/index.js
@@ -1,7 +1,10 @@
"use strict";
//convert text into numbers for seed
-Math.hash = s => { for (var i = 0, h = 9; i < s.length;) h = Math.imul(h ^ s.charCodeAt(i++), 9 ** 9); return h ^ h >>> 9 }
+Math.hash = s => {
+ for (var i = 0, h = 9; i < s.length;) h = Math.imul(h ^ s.charCodeAt(i++), 9 ** 9);
+ return h ^ h >>> 9
+}
// const date1 = new Date()
// console.log(date1.getUTCHours())
@@ -11,7 +14,7 @@ Math.hash = s => { for (var i = 0, h = 9; i < s.length;) h = Math.imul(h ^ s.cha
document.getElementById("seed").placeholder = Math.initialSeed = String(Math.floor(Date.now() % 100000))
Math.seed = Math.abs(Math.hash(Math.initialSeed)) //update randomizer seed in case the player changed it
-Math.seededRandom = function(min = 0, max = 1) { // in order to work 'Math.seed' must NOT be undefined
+Math.seededRandom = function (min = 0, max = 1) { // in order to work 'Math.seed' must NOT be undefined
Math.seed = (Math.seed * 9301 + 49297) % 233280;
return min + Math.seed / 233280 * (max - min);
}
@@ -97,7 +100,7 @@ const color = { //light
//difficulty is 0 easy, 1 normal, 2 hard, 4 why
function getUrlVars() {
let vars = {};
- window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m, k, v) {
+ window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (m, k, v) {
vars[k] = v;
});
return vars;
@@ -122,7 +125,7 @@ window.addEventListener('load', () => {
break;
}
}
- if (found) build.choosePowerUp(document.getElementById(`field-${index}`), index, 'field')
+ if (found) build.choosePowerUp(index, 'field')
}
if (property.substring(0, 3) === "gun") {
let found = false
@@ -134,12 +137,12 @@ window.addEventListener('load', () => {
break;
}
}
- if (found) build.choosePowerUp(document.getElementById(`gun-${index}`), index, 'gun')
+ if (found) build.choosePowerUp(index, 'gun')
}
if (property.substring(0, 4) === "tech") {
for (let i = 0; i < tech.tech.length; i++) {
if (set[property] === tech.tech[i].name) {
- build.choosePowerUp(document.getElementById(`tech-${i}`), i, 'tech', true)
+ build.choosePowerUp(i, 'tech', true)
break;
}
}
@@ -150,13 +153,14 @@ window.addEventListener('load', () => {
lore.setTechGoal()
document.getElementById("difficulty-select-experiment").value = Number(set[property])
}
- if (property === "level") document.getElementById("starting-level").value = Math.max(Number(set[property]) - 1, 0)
- if (property === "noPower") document.getElementById("no-power-ups").checked = Number(set[property])
if (property === "molMode") {
simulation.molecularMode = Number(set[property])
const i = 4 //update experiment text
m.fieldUpgrades[i].description = m.fieldUpgrades[i].setDescription()
- document.getElementById(`field-${i}`).innerHTML = `