diff --git a/js/bullet.js b/js/bullet.js
index af4fac3..94143ba 100644
--- a/js/bullet.js
+++ b/js/bullet.js
@@ -369,7 +369,7 @@ const b = {
stillCount: 0,
isArmed: false,
endCycle: Infinity,
- lookFrequency: 41 + Math.floor(23 * Math.random()),
+ lookFrequency: 0,
range: 700,
onDmg() {},
do() {
@@ -423,26 +423,33 @@ const b = {
if (this.stillCount > 25) this.arm();
},
arm() {
- this.isArmed = true
- game.drawList.push({
- //add dmg to draw queue
- x: this.position.x,
- y: this.position.y,
- radius: 10,
- color: "#f00",
- time: 4
- });
-
+ this.lookFrequency = game.cycle + 60
this.do = function () { //overwrite the do method for this bullet
this.force.y += this.mass * 0.002; //extra gravity
- if (!(game.cycle % this.lookFrequency)) { //find mob targets
- for (let i = 0, len = mob.length; i < len; ++i) {
- if (Vector.magnitudeSquared(Vector.sub(this.position, mob[i].position)) < 500000 &&
- mob[i].dropPowerUp &&
- Matter.Query.ray(map, this.position, mob[i].position).length === 0 &&
- Matter.Query.ray(body, this.position, mob[i].position).length === 0) {
- this.endCycle = 0 //end life if mob is near and visible
- if (Math.random() < 0.8) isAmmoBack = false; //20% chance to get ammo back after detonation
+
+ if (game.cycle > this.lookFrequency) {
+ this.isArmed = true
+ this.lookFrequency = 50 + Math.floor(27 * Math.random())
+ game.drawList.push({
+ //add dmg to draw queue
+ x: this.position.x,
+ y: this.position.y,
+ radius: 10,
+ color: "#f00",
+ time: 4
+ });
+ this.do = function () { //overwrite the do method for this bullet
+ this.force.y += this.mass * 0.002; //extra gravity
+ if (!(game.cycle % this.lookFrequency)) { //find mob targets
+ for (let i = 0, len = mob.length; i < len; ++i) {
+ if (Vector.magnitudeSquared(Vector.sub(this.position, mob[i].position)) < 500000 &&
+ mob[i].dropPowerUp &&
+ Matter.Query.ray(map, this.position, mob[i].position).length === 0 &&
+ Matter.Query.ray(body, this.position, mob[i].position).length === 0) {
+ this.endCycle = 0 //end life if mob is near and visible
+ if (Math.random() < 0.8) isAmmoBack = false; //20% chance to get ammo back after detonation
+ }
+ }
}
}
}
@@ -726,7 +733,7 @@ const b = {
let closeDist = Infinity;
for (let i = 0, len = powerUp.length; i < len; ++i) {
if (
- ((powerUp[i].name !== "field" && powerUp[i].name !== "heal") || (powerUp[i].name === "heal" && mech.health < 0.9)) &&
+ ((powerUp[i].name !== "field" && powerUp[i].name !== "heal") || (powerUp[i].name === "heal" && mech.health < 0.9 * mech.maxHealth)) &&
Matter.Query.ray(map, this.position, powerUp[i].position).length === 0 &&
Matter.Query.ray(body, this.position, powerUp[i].position).length === 0
) {
@@ -2714,32 +2721,40 @@ const b = {
v1: null,
v2: null
};
- vertexCollision(path[0], path[1], mob);
- vertexCollision(path[0], path[1], map);
- vertexCollision(path[0], path[1], body);
- if (best.dist2 != Infinity) { //if hitting something
- path[path.length - 1] = {
- x: best.x,
- y: best.y
- };
+ if (mod.isPulseAim) { //find mobs in line of sight
+ for (let i = 0, len = mob.length; i < len; i++) {
+ if (Vector.magnitude(Vector.sub(path[0], mob[i].position)) < 2200 &&
+ Matter.Query.ray(map, path[0], mob[i].position).length === 0 &&
+ Matter.Query.ray(body, path[0], mob[i].position).length === 0) {
+ best.who = mob[i]
+ path[path.length - 1] = mob[i].position
+ break
+ }
+ }
}
-
- //use energy to explode
- let energy;
- if (mod.isRapidPulse) {
- energy = 0.02 + 0.06 * Math.min(mech.energy, 1.75)
- if (mech.energy < energy) return
+ if (!best.who) {
+ vertexCollision(path[0], path[1], mob);
+ vertexCollision(path[0], path[1], map);
+ vertexCollision(path[0], path[1], body);
+ if (best.dist2 != Infinity) { //if hitting something
+ path[path.length - 1] = {
+ x: best.x,
+ y: best.y
+ };
+ }
+ }
+ let energy
+ if (mod.isPulseAim) {
+ energy = 0.25 * Math.min(mech.energy, 1.75)
mech.energy -= energy * mod.isLaserDiode
- if (best.who) b.explosion(path[1], 2000 * energy, true)
- mech.fireCDcycle = mech.cycle + Math.floor(15 * b.fireCD); // cool down
+ if (best.who) b.explosion(path[1], 1000 * energy, true)
+ mech.fireCDcycle = mech.cycle + Math.floor(25 * b.fireCD); // cool down
} else {
energy = 0.3 * Math.min(mech.energy, 1.75)
mech.energy -= energy * mod.isLaserDiode
if (best.who) b.explosion(path[1], 1000 * energy, true)
mech.fireCDcycle = mech.cycle + Math.floor(50 * b.fireCD); // cool down
}
-
-
if (mod.isPulseStun) {
const range = 100 + 2000 * energy
for (let i = 0, len = mob.length; i < len; ++i) {
diff --git a/js/level.js b/js/level.js
index 36fa4ea..8c2b641 100644
--- a/js/level.js
+++ b/js/level.js
@@ -17,9 +17,10 @@ const level = {
// game.enableConstructMode() //used to build maps in testing mode
// level.difficultyIncrease(9)
// mech.isStealth = true;
- // mod.giveMod("necrophoresis");
- // b.giveGuns("foam")
- // mech.setField("time dilation field")
+ // mod.giveMod("logistics");
+ // mod.giveMod("supply chain");
+ // b.giveGuns("pulse")
+ // mech.setField("phase decoherence field")
level.intro(); //starting level
// level.testing();
diff --git a/js/mob.js b/js/mob.js
index 97be741..3e07b52 100644
--- a/js/mob.js
+++ b/js/mob.js
@@ -188,7 +188,7 @@ const mobs = {
onHit: undefined,
alive: true,
index: i,
- health: 1,
+ health: mod.mobSpawnWithHealth,
showHealthBar: true,
accelMag: 0.001 * game.accelScale,
cd: 0, //game cycle when cooldown will be over
@@ -972,7 +972,7 @@ const mobs = {
this.health -= dmg
//this.fill = this.color + this.health + ')';
this.onDamage(dmg); //custom damage effects
- if (this.health < mod.mobDieAtHealth && this.alive) this.death();
+ if (this.health < 0.05 && this.alive) this.death();
}
},
onDamage() {
diff --git a/js/mods.js b/js/mods.js
index bdcd1d8..5f597a4 100644
--- a/js/mods.js
+++ b/js/mods.js
@@ -113,7 +113,7 @@ const mod = {
mods: [{
name: "capacitor",
// nameInfo: "",
- description: "increase damage based on stored energy
+1% damage for every 5.5% energy",
+ description: "increase damage based on stored energy
1% damage for every 5.5% energy",
maxCount: 1,
count: 0,
allowed() {
@@ -227,7 +227,7 @@ const mod = {
},
{
name: "auto-loading heuristics",
- description: "+20% decreased delay after firing",
+ description: "20% decreased delay after firing",
maxCount: 9,
count: 0,
allowed() {
@@ -244,7 +244,7 @@ const mod = {
}
},
{
- name: "electrostatic shots",
+ name: "electrostatic discharge",
description: "25% increased damage
25% increased delay after firing",
maxCount: 1,
count: 0,
@@ -329,7 +329,7 @@ const mod = {
},
{
name: "scrap bots",
- description: "+12% chance to build a bot after killing a mob
the bot only functions until the end of the level",
+ description: "12% chance to build a bot after killing a mob
the bot only functions until the end of the level",
maxCount: 6,
count: 0,
allowed() {
@@ -421,7 +421,7 @@ const mod = {
},
{
name: "zoospore vector",
- description: "mobs produce spores when they die
+11% chance",
+ description: "mobs produce spores when they die
11% chance",
maxCount: 9,
count: 0,
allowed() {
@@ -456,7 +456,7 @@ const mod = {
},
{
name: "impact shear",
- description: "mobs release +2 nails when they die
nails target nearby mobs",
+ description: "mobs release 2 nails when they die
nails target nearby mobs",
maxCount: 9,
count: 0,
allowed() {
@@ -472,18 +472,23 @@ const mod = {
},
{
name: "reaction inhibitor",
- description: "mobs die if their life goes below 12%",
- maxCount: 1,
+ description: "mobs spawn with 12% less health",
+ maxCount: 3,
count: 0,
allowed() {
return true
},
requires: "",
effect: () => {
- mod.mobDieAtHealth = 0.15
+ mod.mobSpawnWithHealth *= 0.88
+
+ //set all mobs at full health to 0.85
+ for (let i = 0; i < mob.length; i++) {
+ if (mob.health > mod.mobSpawnWithHealth) mob.health = mod.mobSpawnWithHealth
+ }
},
remove() {
- mod.mobDieAtHealth = 0.05;
+ mod.mobSpawnWithHealth = 1;
}
},
{
@@ -540,7 +545,7 @@ const mod = {
},
{
name: "Pauli exclusion",
- description: `immune to harm for +1 seconds
activates after being harmed from a collision`,
+ description: `immune to harm for 1 seconds
activates after being harmed from a collision`,
maxCount: 9,
count: 0,
allowed() {
@@ -654,7 +659,7 @@ const mod = {
},
{
name: "energy conservation",
- description: "+13% of damage done recovered as energy",
+ description: "13% of damage done recovered as energy",
maxCount: 9,
count: 0,
allowed() {
@@ -670,7 +675,7 @@ const mod = {
},
{
name: "overcharge",
- description: "increase your maximum energy by +50%",
+ description: "increase your maximum energy by 50%",
maxCount: 9,
count: 0,
allowed() {
@@ -687,7 +692,7 @@ const mod = {
},
{
name: "entropy exchange",
- description: "heal for +1.5% of damage done",
+ description: "heal for 1.5% of damage done",
maxCount: 9,
count: 0,
allowed() {
@@ -703,7 +708,7 @@ const mod = {
},
{
name: "supersaturation",
- description: "increase your maximum health by +50%",
+ description: "increase your maximum health by 50%",
maxCount: 9,
count: 0,
allowed() {
@@ -754,7 +759,7 @@ const mod = {
},
{
name: "recursive healing",
- description: "healing power ups trigger +1 more time",
+ description: "healing power ups trigger 1 more time",
maxCount: 9,
count: 0,
allowed() {
@@ -837,6 +842,24 @@ const mod = {
mod.isAmmoForGun = false;
}
},
+ {
+ name: "supply chain",
+ description: "double your current ammo for all gun",
+ maxCount: 9,
+ count: 0,
+ isNonRefundable: true,
+ allowed() {
+ return mod.isAmmoForGun
+ },
+ requires: "logistics",
+ effect() {
+ for (let i = 0; i < b.guns.length; i++) {
+ if (b.guns[i].have) b.guns[i].ammo = Math.floor(2 * b.guns[i].ammo)
+ }
+ game.makeGunHUD();
+ },
+ remove() {}
+ },
{
name: "catabolism",
description: "gain ammo when you fire while out of ammo
drains 2% of max health",
@@ -987,7 +1010,7 @@ const mod = {
description: "remove all current mods
spawn new mods to replace them",
maxCount: 1,
count: 0,
- isNonRefundable: true,
+ // isNonRefundable: true,
allowed() {
return (mod.totalCount > 6) && !build.isCustomSelection
},
@@ -1045,7 +1068,7 @@ const mod = {
//**************************************************
{
name: "Lorentzian topology",
- description: "your bullets last +33% longer",
+ description: "your bullets last 33% longer",
maxCount: 3,
count: 0,
allowed() {
@@ -1061,7 +1084,7 @@ const mod = {
},
{
name: "microstates",
- description: "+6% damage for every 10 active bullets",
+ description: "6% damage for every 10 active bullets",
maxCount: 1,
count: 0,
allowed() {
@@ -1098,7 +1121,7 @@ const mod = {
},
{
name: "depleted uranium rounds",
- description: `your bullets are +18% larger
increased mass and physical damage`,
+ description: `your bullets are 18% larger
increased mass and physical damage`,
count: 0,
maxCount: 9,
allowed() {
@@ -1195,7 +1218,7 @@ const mod = {
},
{
name: "super duper",
- description: "fire +2 additional super balls",
+ description: "fire 2 additional super balls",
maxCount: 9,
count: 0,
allowed() {
@@ -1357,7 +1380,7 @@ const mod = {
},
{
name: "high explosives",
- description: "explosions do +20% more damage
explosive area is +44% larger",
+ description: "explosions do 20% more damage
explosive area is 44% larger",
maxCount: 3,
count: 0,
allowed() {
@@ -1389,7 +1412,7 @@ const mod = {
},
{
name: "recursion",
- description: "after missiles explode
they launch +1 smaller missile",
+ description: "after missiles explode
they launch 1 smaller missile",
maxCount: 9,
count: 0,
allowed() {
@@ -1441,7 +1464,7 @@ const mod = {
},
{
name: "fragmentation grenade",
- description: "grenades are loaded with +5 nails
on detonation nails are ejected towards mobs",
+ description: "grenades are loaded with 5 nails
on detonation nails are ejected towards mobs",
maxCount: 9,
count: 0,
allowed() {
@@ -1505,7 +1528,7 @@ const mod = {
},
{
name: "inertial confinement",
- description: "neutron bomb's initial detonation
stuns nearby mobs for +1 seconds",
+ description: "neutron bomb's initial detonation
stuns nearby mobs for 1 seconds",
maxCount: 3,
count: 0,
allowed() {
@@ -1699,7 +1722,7 @@ const mod = {
},
{
name: "specular reflection",
- description: "laser beams gain +1 reflection
+50% laser damage and energy drain",
+ description: "laser beams gain 1 reflection
50% laser damage and energy drain",
maxCount: 9,
count: 0,
allowed() {
@@ -1733,22 +1756,23 @@ const mod = {
mod.isPulseStun = false;
}
},
- // {
- // name: "aim",
- // description: "pulse explosions aim",
- // maxCount: 1,
- // count: 0,
- // allowed() {
- // return mod.haveGunCheck("pulse")
- // },
- // requires: "pulse",
- // effect() {
- // mod.isPulseAim = true;
- // },
- // remove() {
- // mod.isPulseAim = false;
- // }
- // },
+
+ {
+ name: "neocognitron",
+ description: "pulse automatically aims at a nearby mob
50% decreased delay after firing",
+ maxCount: 1,
+ count: 0,
+ allowed() {
+ return mod.haveGunCheck("pulse")
+ },
+ requires: "pulse",
+ effect() {
+ mod.isPulseAim = true;
+ },
+ remove() {
+ mod.isPulseAim = false;
+ }
+ },
// {
// name: "fast ignition",
// description: "pulse explosions more efficient
delay after firing is shorter",
@@ -1771,7 +1795,7 @@ const mod = {
//**************************************************
{
name: "flux pinning",
- description: "blocking with perfect diamagnetism
stuns mobs for +1 second",
+ description: "blocking with perfect diamagnetism
stuns mobs for 1 second",
maxCount: 9,
count: 0,
allowed() {
@@ -2150,7 +2174,7 @@ const mod = {
laserDamage: null,
laserFieldDrain: null,
isAmmoFromHealth: null,
- mobDieAtHealth: null,
+ mobSpawnWithHealth: null,
isEnergyRecovery: null,
isHealthRecovery: null,
isEnergyLoss: null,
@@ -2205,7 +2229,7 @@ const mod = {
isArmorFromPowerUps: null,
isAmmoForGun: null,
isRapidPulse: null,
- // isPulseAim: null,
+ isPulseAim: null,
isSporeFreeze: null,
isShotgunRecoil: null,
isHealLowHealth: null
diff --git a/js/player.js b/js/player.js
index a4bce4a..67ce6b3 100644
--- a/js/player.js
+++ b/js/player.js
@@ -1760,7 +1760,7 @@ const mech = {
// }
function drawField(radius) {
- radius *= 0.9 + 1 * mech.energy;
+ radius *= 0.9 + 1.5 * mech.energy * mech.energy;
const rotate = mech.cycle * 0.005;
mech.fieldPhase += 0.5 - 0.5 * Math.sqrt(Math.max(0.01, Math.min(mech.energy, 1)));
const off1 = 1 + 0.06 * Math.sin(mech.fieldPhase);
@@ -1801,9 +1801,10 @@ const mech = {
mech.lookForPickUp();
if (mech.fieldCDcycle < mech.cycle) {
+ // game.draw.bodyFill = "transparent"
+ // game.draw.bodyStroke = "transparent"
-
- const DRAIN = 0.0003 + 0.00015 * player.speed + ((!mod.renormalization && mech.fireCDcycle > mech.cycle) ? 0.005 : 0.001)
+ const DRAIN = 0.0002 + 0.0001 * player.speed + ((!mod.renormalization && mech.fireCDcycle > mech.cycle) ? 0.005 : 0.001)
if (mech.energy > DRAIN) {
mech.energy -= DRAIN;
// if (mech.energy < 0.001) {
diff --git a/js/powerup.js b/js/powerup.js
index 127a344..72559a2 100644
--- a/js/powerup.js
+++ b/js/powerup.js
@@ -388,7 +388,7 @@ const powerUps = {
if (Math.random() < mod.bayesian) powerUps.spawn(x, y, "field");
return;
}
- if (Math.random() < 0.005) {
+ if (Math.random() < 0.01) {
powerUps.spawn(x, y, "reroll");
if (Math.random() < mod.bayesian) powerUps.spawn(x, y, "reroll");
return;
diff --git a/todo.txt b/todo.txt
index 620e576..e09fbb8 100644
--- a/todo.txt
+++ b/todo.txt
@@ -1,27 +1,20 @@
-damage immunity after a collisions is reduced from 1/2s to 1/4s
-freezing status effects only last 1/4 as long on boss mobs
-mod - shotgun 66% increased fire rate and recoil
-mod - slowly heal when below 25% health
-mod - superdeterminism spawn 4 mods, but rerolls, fields, and guns no longer spawn
-foam mod, necrophoresis now aims the foam bullets, which makes it more effective at groups
-flechettes mod, piercing needles now goes through blocks as well as mobs
-mod - spawn 3 ammo, rerolls, or heals after destroying a shield
-
+rerolls drop 60% more often
+mines delay a 1/2 second longer before they arm
+mod: supply chain - doubles your current ammo, requires mod:logistics
+mod: neocognitron - pulse auto aiming
************** TODO - n-gon **************
-physics question: why don't the bound states of fields spread out. What is making them bound.
-mobs killed by _____ always drops ammo
- issues getting the code to work
-
-rework reaction inhibitor to spawn mobs with 12% less life, rather then killing them at 12%
-
-levels: make a function in the main game loop that runs level specific code
- reset the level function as each new level loads
+phase field still isn't fun
+ rework renormalization mod as well
+ does phase field need the stealth flag?
mod: use the stealth flag from the phase decoherence field
maybe trigger it along with the damage immunity CD
+levels: make a function in the main game loop that runs level specific code
+ reset the level function as each new level loads
+
mod: efficient shielding (requires standing wave harmonics field)
lowers force applied when blocking mobs (instead of flinging them away, you push them like with plasma torch), but uses less energy to block mobs
and making it so liquid nitrogen and uranium reactor core have that effect in a radius around the player instead of on contact