diff --git a/index.html b/index.html
index df7764d..4c6cfa1 100644
--- a/index.html
+++ b/index.html
@@ -285,12 +285,19 @@
-
+
+
+
+
+
+
+
diff --git a/js/bullets.js b/js/bullets.js
index 2a625fe..b9ca8b3 100644
--- a/js/bullets.js
+++ b/js/bullets.js
@@ -76,6 +76,7 @@ const b = {
isModEnergyDamage: null,
isModBotSpawner: null,
modWaveHelix: null,
+ isModSporeFollow: null,
modOnHealthChange() { //used with acid mod
if (b.isModAcidDmg && mech.health > 0.8) {
b.modAcidDmg = 0.7
@@ -216,7 +217,7 @@ const b = {
allowed() {
return b.isModLowHealthDmg
},
- requires: "quasistatic equilibrium",
+ requires: "negative feedback",
effect() {
b.isModHarmDamage = true;
},
@@ -1163,6 +1164,22 @@ const b = {
b.isModFastSpores = false
}
},
+ {
+ name: "diplochory",
+ description: "spores use the player for dispersal
until they locate a viable host",
+ maxCount: 1,
+ count: 0,
+ allowed() {
+ return b.haveGunCheck("spores") || b.modSporesOnDeath > 0 || b.isModStomp || b.isModSporeField
+ },
+ requires: "spores",
+ effect() {
+ b.isModSporeFollow = true
+ },
+ remove() {
+ b.isModSporeFollow = false
+ }
+ },
{
name: "redundant systems",
description: "drone collisions no longer reduce their lifespan",
@@ -2004,14 +2021,17 @@ const b = {
category: cat.bullet,
mask: cat.map | cat.mob | cat.mobBullet | cat.mobShield //no collide with body
},
- endCycle: game.cycle + Math.floor((660 + Math.floor(Math.random() * 240)) * b.isModBulletsLastLonger),
+ endCycle: game.cycle + Math.floor((660 + Math.floor(Math.random() * 360)) * b.isModBulletsLastLonger),
minDmgSpeed: 0,
- onDmg(who) {
- // mobs.statusPoison(who, 0.5, 180) // (2.2) * 1.3 * 30/180 // 6 ticks (3 seconds)
+ playerOffPosition: { //used when following player to keep spores separate
+ x: 100 * (Math.random() - 0.5),
+ y: 100 * (Math.random() - 0.5)
+ },
+ onDmg() {
this.endCycle = 0; //bullet ends cycle after doing damage
},
onEnd() {},
- lookFrequency: 97 + Math.floor(77 * Math.random()),
+ lookFrequency: 97 + Math.floor(93 * Math.random()),
do() {
//find mob targets
if (!(game.cycle % this.lookFrequency)) {
@@ -2034,9 +2054,17 @@ const b = {
}
//accelerate towards mobs
if (this.lockedOn && this.lockedOn.alive) {
- this.force = Vector.mult(Vector.normalise(Vector.sub(this.position, this.lockedOn.position)), -this.mass * this.thrust)
- // this.force.x -= THRUST * this.lockedOn.x
- // this.force.y -= THRUST * this.lockedOn.y
+ this.force = Vector.mult(Vector.normalise(Vector.sub(this.lockedOn.position, this.position)), this.mass * this.thrust)
+
+ } else if (b.isModSporeFollow && this.lockedOn !== undefined) { //move towards player
+ //checking for undefined means that the spores don't go after the player until it has looked and not found a target
+ const dx = this.position.x - mech.pos.x;
+ const dy = this.position.y - mech.pos.y;
+ if (dx * dx + dy * dy > 10000) {
+ this.force = Vector.mult(Vector.normalise(Vector.sub(mech.pos, Vector.add(this.playerOffPosition, this.position))), this.mass * this.thrust)
+ }
+ // this.force = Vector.mult(Vector.normalise(Vector.sub(mech.pos, this.position)), this.mass * this.thrust)
+
} else {
this.force.y += this.mass * 0.0001; //gravity
}
@@ -2646,10 +2674,11 @@ const b = {
mech.fireCDcycle = mech.cycle + Math.floor(3 * b.modFireRate); // cool down
const dir = mech.angle
const SPEED = 10
- const wiggleMag = mech.crouch ? 5 : 12
+ const wiggleMag = mech.crouch ? 6 : 12
+ const size = 5 * b.modBulletSize * (b.modWaveHelix === 1 ? 1 : 0.7)
for (let i = 0; i < b.modWaveHelix; i++) {
const me = bullet.length;
- bullet[me] = Bodies.polygon(mech.pos.x + 25 * Math.cos(dir), mech.pos.y + 25 * Math.sin(dir), 7, 5 * b.modBulletSize, {
+ bullet[me] = Bodies.polygon(mech.pos.x + 25 * Math.cos(dir), mech.pos.y + 25 * Math.sin(dir), 7, size, {
angle: dir,
cycle: -0.5,
endCycle: game.cycle + Math.floor((b.isModWaveReflect ? 480 : 120) * b.isModBulletsLastLonger),
@@ -2681,7 +2710,7 @@ const b = {
for (let i = 0; i < q.length; i++) {
slowCheck = 0.3;
Matter.Body.setPosition(this, Vector.add(this.position, q[i].velocity)) //move with the medium
- let dmg = b.dmgScale * 0.43 / Math.sqrt(q[i].mass) * (b.modWaveHelix ? 0.6 : 1) //1 - 0.4 = 0.6 for helix mod 40% damage reduction
+ let dmg = b.dmgScale * 0.43 / Math.sqrt(q[i].mass) * (b.modWaveHelix === 1 ? 1 : 0.6) //1 - 0.4 = 0.6 for helix mod 40% damage reduction
q[i].damage(dmg);
q[i].foundPlayer();
game.drawList.push({ //add dmg to draw queue
diff --git a/js/player.js b/js/player.js
index c67876e..4a28073 100644
--- a/js/player.js
+++ b/js/player.js
@@ -978,7 +978,7 @@ const mech = {
x: powerUp[i].velocity.x * 0.11,
y: powerUp[i].velocity.y * 0.11
});
- if (dist2 < 5000) { //use power up if it is close enough
+ if (dist2 < 5000 && !game.isChoosing) { //use power up if it is close enough
if (b.isModMassEnergy) mech.energy = mech.fieldEnergyMax * 2;
Matter.Body.setVelocity(player, { //player knock back, after grabbing power up
x: player.velocity.x + ((powerUp[i].velocity.x * powerUp[i].mass) / player.mass) * 0.3,
@@ -1061,7 +1061,6 @@ const mech = {
}
},
pushMobsFacing() { // find mobs in range and in direction looking
-
for (let i = 0, len = mob.length; i < len; ++i) {
if (
Vector.magnitude(Vector.sub(mob[i].position, player.position)) - mob[i].radius < mech.fieldRange &&
@@ -1304,7 +1303,7 @@ const mech = {
mech.grabPowerUp();
mech.lookForPickUp(180);
- const DRAIN = 0.0023
+ const DRAIN = 0.0017
if (mech.energy > DRAIN) {
mech.energy -= DRAIN;
if (mech.energy < DRAIN) {
@@ -1472,7 +1471,7 @@ const mech = {
y: best.y
};
if (best.who.alive) {
- const dmg = 0.5 * b.dmgScale; //********** SCALE DAMAGE HERE *********************
+ const dmg = 0.55 * b.dmgScale; //********** SCALE DAMAGE HERE *********************
best.who.damage(dmg);
best.who.locatePlayer();
@@ -1546,7 +1545,7 @@ const mech = {
},
{
name: "negative mass field",
- description: "use energy to nullify gravity
reduce harm by 75% while field is active", //
launch larger blocks at much higher speeds
+ description: "use energy to nullify gravity
reduce harm by 80% while field is active", //
launch larger blocks at much higher speeds
fieldDrawRadius: 0,
isEasyToAim: true,
effect: () => {
@@ -1565,7 +1564,7 @@ const mech = {
mech.lookForPickUp();
const DRAIN = 0.00035
if (mech.energy > DRAIN) {
- mech.fieldDamageResistance = 0.25; // 1 - 0.75
+ mech.fieldDamageResistance = 0.2; // 1 - 0.8
// mech.pushMobs360();
//repulse mobs
@@ -1813,7 +1812,7 @@ const mech = {
mech.grabPowerUp();
mech.lookForPickUp();
- const DRAIN = (0.0005 + 0.0001 * player.speed) * (mech.fireCDcycle > mech.cycle ? 9 / b.modRenormalization : 1) //game.mouseDown
+ const DRAIN = (0.0004 + 0.00007 * player.speed) * (mech.fireCDcycle > mech.cycle ? 7 / b.modRenormalization : 1) //game.mouseDown
if (mech.energy > DRAIN) {
mech.energy -= DRAIN;
if (mech.energy < 0.001) {
diff --git a/js/powerups.js b/js/powerups.js
index bfb5bfd..2ffa226 100644
--- a/js/powerups.js
+++ b/js/powerups.js
@@ -25,7 +25,7 @@ const powerUps = {
game.isChoosing = false; //stops p from un pausing on key down
requestAnimationFrame(cycle);
},
- cancel(what) {
+ cancel() {
document.body.style.cursor = "none";
document.getElementById("choose-grid").style.display = "none"
document.getElementById("choose-background").style.display = "none"
diff --git a/todo.txt b/todo.txt
index 1d72872..a6b64e0 100644
--- a/todo.txt
+++ b/todo.txt
@@ -1,11 +1,18 @@
-mod - your damage scales with current energy
-mod - 10% chance after killing a mob to gain a bot
- that follows you until you exit the map
-mod - move extra fast with less energy cost in time dilation
-mod - double helix fire two wave bullets, but they do 40% less damage
+
+mod - spores follow player
************** TODO - n-gon **************
+player health becomes NaN
+occurred a few times at higher levels
+ game.dmgScale, game.healScale not corrupted
+
+mod - killing a stunned mob gives something
+ ammo or heal power up?
+
+mod - scale squirrel cage rotor with current energy
+ is variable speed going to be hard to deal with?
+
boss level for timeSkipBoss because of game instability for boss on normal levels
boss level needs to be very simple (maybe no other mobs, or no random mobs)