diff --git a/js/bullet.js b/js/bullet.js
index 46c35b6..5557896 100644
--- a/js/bullet.js
+++ b/js/bullet.js
@@ -22,15 +22,14 @@ const b = {
}
} else {
if (mod.isAmmoFromHealth) {
- if (mech.health > 0.05) {
- mech.damage(Math.max(0.01, mod.isAmmoFromHealth * mech.health));
+ if (mech.health > 2 * mod.isAmmoFromHealth * mech.maxHealth) {
+ mech.damage(mod.isAmmoFromHealth * mech.maxHealth);
powerUps.spawn(mech.pos.x, mech.pos.y, "ammo");
if (Math.random() < mod.bayesian) powerUps.spawn(mech.pos.x, mech.pos.y, "ammo");
} else {
game.replaceTextLog = true;
game.makeTextLog("not enough health for catabolism to produce ammo", 120);
}
-
} else {
game.replaceTextLog = true;
game.makeTextLog("
NO AMMO
Q, E, and mouse wheel change weapons
", 200);
@@ -496,15 +495,11 @@ const b = {
this.endCycle = 0; //bullet ends cycle after doing damage
},
onEnd() {
- if (mod.isMutualism && this.isMutualismActive) {
- if (mod.isEnergyHealth) {
- mech.energy += 0.01;
- } else {
- mech.health += 0.01
- if (mech.health > mech.maxHealth) mech.health = mech.maxHealth;
- mod.onHealthChange();
- mech.displayHealth();
- }
+ if (mod.isMutualism && this.isMutualismActive && !mod.isEnergyHealth) {
+ mech.health += 0.01
+ if (mech.health > mech.maxHealth) mech.health = mech.maxHealth;
+ mod.onHealthChange();
+ mech.displayHealth();
}
},
do() {
@@ -551,18 +546,11 @@ const b = {
});
World.add(engine.world, bullet[bIndex]); //add bullet to world
- if (mod.isMutualism) {
- if (mod.isEnergyHealth) {
- if (mech.energy > 0.02) {
- mech.energy -= 0.01; //energy takes an extra 25% damage for balancing purposes
- bullet[bIndex].isMutualismActive = true
- }
- } else if (mech.health > 0.02) {
- mech.health -= 0.01
- mod.onHealthChange();
- mech.displayHealth();
- bullet[bIndex].isMutualismActive = true
- }
+ if (mod.isMutualism && mech.health > 0.02) {
+ mech.health -= 0.01
+ mod.onHealthChange();
+ mech.displayHealth();
+ bullet[bIndex].isMutualismActive = true
}
},
iceIX(speed = 0, spread = 2 * Math.PI) {
@@ -772,7 +760,12 @@ const b = {
onDmg(who) {
if (!this.target && who.alive) {
this.target = who;
- if (Matter.Query.collides(this, [who]).length > 0) {
+ if (who.radius < 20) {
+ 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
} else {
@@ -843,6 +836,8 @@ const b = {
Matter.Body.setPosition(this, Vector.add(Vector.add(rotate, this.target.velocity), this.target.position))
}
Matter.Body.setVelocity(this.target, Vector.mult(this.target.velocity, 0.9))
+ Matter.Body.setAngularVelocity(this.target, this.target.angularVelocity * 0.9);
+
// Matter.Body.setAngularVelocity(this.target, this.target.angularVelocity * 0.9)
if (this.target.isShielded) {
this.target.damage(b.dmgScale * 0.005, true); //shield damage bypass
@@ -1092,8 +1087,8 @@ const b = {
//randomize position relative to player
if (Math.random() < 0.15) {
this.offPlayer = {
- x: 100 * (Math.random() - 0.5),
- y: 90 * (Math.random() - 0.5),
+ x: 120 * (Math.random() - 0.5),
+ y: 120 * (Math.random() - 0.5) - 20,
}
}
}
@@ -1182,7 +1177,7 @@ const b = {
},
guns: [{
name: "minigun",
- description: "rapidly fire a stream of small bullets",
+ description: "rapidly fire a stream of small bullets
fire delay decreases as you shoot",
ammo: 0,
ammoPack: 75,
defaultAmmoPack: 75,
@@ -1211,7 +1206,7 @@ const b = {
bullet[me].onDmg = function (who) {
mobs.statusSlow(who, 30)
};
- mech.energy -= mech.fieldRegen + 0.007
+ mech.energy -= mech.fieldRegen + 0.0075
if (mech.energy < 0.02) {
mech.fireCDcycle = mech.cycle + 60; // cool down
}
@@ -1219,7 +1214,6 @@ const b = {
bullet[me].do = function () {
this.force.y += this.mass * 0.0003;
};
-
}
},
{
@@ -1353,7 +1347,7 @@ const b = {
count: 0, //used to track how many shots are in a volley before a big CD
lastFireCycle: 0, //use to remember how longs its been since last fire, used to reset count
fire() {
- function makeFlechette(angle = mech.angle) {
+ function makeFlechette(angle = mech.angle + 0.02 * (Math.random() - 0.5)) {
const me = bullet.length;
bullet[me] = Bodies.rectangle(mech.pos.x + 40 * Math.cos(mech.angle), mech.pos.y + 40 * Math.sin(mech.angle), 45, 1.4, b.fireAttributes(angle));
bullet[me].collisionFilter.mask = cat.body; //cat.mobShield | //cat.map | cat.body |
@@ -1914,7 +1908,6 @@ const b = {
}
}
-
const mobCollisions = Matter.Query.collides(this, mob)
if (mobCollisions.length) {
onCollide(this)
@@ -2320,7 +2313,7 @@ const b = {
mech.fireCDcycle = Infinity //can't fire until mouse is released
const lastCharge = this.charge
let chargeRate = (mech.crouch) ? 0.975 : 0.987
- chargeRate *= Math.pow(b.fireCD, 0.04)
+ chargeRate *= Math.pow(b.fireCD, 0.03)
this.charge = this.charge * chargeRate + (1 - chargeRate) // this.charge converges to 1
mech.energy -= (this.charge - lastCharge) * 0.28 //energy drain is proportional to charge gained, but doesn't stop normal mech.fieldRegen
@@ -2679,7 +2672,7 @@ const b = {
const 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(60 * b.fireCD); // cool down
+ mech.fireCDcycle = mech.cycle + Math.floor(50 * b.fireCD); // cool down
if (mod.isPulseStun) {
const range = 100 + 2000 * energy
diff --git a/js/engine.js b/js/engine.js
index dfc4a65..1420f9e 100644
--- a/js/engine.js
+++ b/js/engine.js
@@ -175,7 +175,9 @@ function collisionChecks(event) {
y: mob[k].velocity.y - 8 * Math.sin(angle)
});
- if (mod.isAnnihilation && !mob[k].shield && !mob[k].isShielded) {
+ if (mod.isAnnihilation && !mob[k].shield && !mob[k].isShielded && mech.energy > 0.2) {
+ mech.energy -= 0.2
+ mech.immuneCycle = 0; //player doesn't go immune to collision damage
mob[k].death();
game.drawList.push({
//add dmg to draw queue
@@ -207,6 +209,7 @@ function collisionChecks(event) {
// console.log(obj.dmg / (0.15 * obj.mass * Vector.magnitude(Vector.sub(mob[k].velocity, obj.velocity))))
if (mod.isCrit && !mob[k].seePlayer.recall && !mob[k].shield) dmg *= 5
mob[k].foundPlayer();
+ console.log(dmg)
mob[k].damage(dmg);
// console.log(dmg)
obj.onDmg(mob[k]); //some bullets do actions when they hits things, like despawn
diff --git a/js/game.js b/js/game.js
index f7e7321..d963dcf 100644
--- a/js/game.js
+++ b/js/game.js
@@ -499,6 +499,7 @@ const game = {
mod.setupAllMods(); //sets mods to default values
b.setFireCD();
game.updateModHUD();
+ powerUps.totalPowerUps = 0;
powerUps.reroll.rerolls = 0;
mech.maxHealth = 1
mech.maxEnergy = 1
@@ -645,21 +646,19 @@ const game = {
}
}
- if (mod.isMutualism) {
+ if (mod.isMutualism && !mod.isEnergyHealth) {
for (let i = 0; i < bullet.length; i++) {
if (bullet[i].isMutualismActive) {
- if (mod.isEnergyHealth) {
- mech.energy += 0.01;
- } else {
- mech.health += 0.01
- if (mech.health > mech.maxHealth) mech.health = mech.maxHealth;
- mod.onHealthChange();
- mech.displayHealth();
- }
+ mech.health += 0.01
+ if (mech.health > mech.maxHealth) mech.health = mech.maxHealth;
+ mod.onHealthChange();
+ mech.displayHealth();
}
}
}
+ powerUps.totalPowerUps = powerUp.length
+
//if player is holding something this remembers it before it gets deleted
let holdTarget;
if (mech.holdingTarget) {
diff --git a/js/level.js b/js/level.js
index eb3f10d..fc2f255 100644
--- a/js/level.js
+++ b/js/level.js
@@ -17,12 +17,12 @@ const level = {
// game.enableConstructMode() //used to build maps in testing mode
// level.difficultyIncrease(9)
// mech.setField("time dilation field")
- // mod.giveMod("timelike world line");
- // mod.giveMod("Lorentz transformation");
+ // mod.giveMod("logistics");
+ // mod.giveMod("negative temperature");
- b.giveGuns("minigun")
+ // b.giveGuns("flechettes")
// b.giveGuns("spores")
- // mech.setField("pilot wave")
+ // mech.setField("negative mass field")
// mech.setField("phase decoherence field")
level.intro(); //starting level
@@ -56,6 +56,11 @@ const level = {
for (let i = 0; i < mod.foamBotCount; i++) {
b.foamBot()
}
+ if (mod.isArmorFromPowerUps) {
+ // for (let i = 0; i < powerUps.totalPowerUps; i++) {}
+ mech.maxHealth += 0.03 * powerUps.totalPowerUps
+ game.makeTextLog(" max health increased by " + (0.05 * powerUps.totalPowerUps * 100).toFixed(0) + "%", 300)
+ }
},
isBuildRun: false,
difficultyIncrease(num = 1) {
@@ -188,7 +193,7 @@ const level = {
// spawn.launcherBoss(1200, -500)
// spawn.laserTargetingBoss(1600, -400)
// spawn.spawner(1600, -500)
- spawn.sniper(1700, -120)
+ spawn.sniper(1700, -120, 50)
// spawn.sniper(1600, -120)
// spawn.sniper(1800, -120)
// spawn.cellBossCulture(1600, -500)
diff --git a/js/mods.js b/js/mods.js
index 475ee0a..88b41d8 100644
--- a/js/mods.js
+++ b/js/mods.js
@@ -76,7 +76,7 @@ const mod = {
if (mod.isEnergyLoss) dmg *= 1.33;
if (mod.isRest && player.speed < 1) dmg *= 1.20;
if (mod.isEnergyDamage) dmg *= 1 + mech.energy / 5.5;
- if (mod.isDamageFromBulletCount) dmg *= 1 + bullet.length * 0.007
+ if (mod.isDamageFromBulletCount) dmg *= 1 + bullet.length * 0.006
return dmg * mod.slowFire
},
onHealthChange() { //used with acid mod
@@ -111,42 +111,6 @@ const mod = {
},
mods: [{
- name: "heal",
- description: "spawn 6 heal power ups",
- maxCount: 9,
- count: 0,
- isNonRefundable: true,
- allowed() {
- return true
- },
- requires: "",
- effect() {
- for (let i = 0; i < 6; i++) {
- powerUps.spawn(mech.pos.x, mech.pos.y, "heal");
- if (Math.random() < mod.bayesian) powerUps.spawn(mech.pos.x, mech.pos.y, "heal");
- }
- },
- remove() {}
- },
- {
- name: "ammo",
- description: "spawn 6 ammo power ups",
- maxCount: 9,
- count: 0,
- isNonRefundable: true,
- allowed() {
- return true
- },
- requires: "",
- effect() {
- for (let i = 0; i < 6; i++) {
- powerUps.spawn(mech.pos.x, mech.pos.y, "ammo");
- if (Math.random() < mod.bayesian) powerUps.spawn(mech.pos.x, mech.pos.y, "ammo");
- }
- },
- remove() {}
- },
- {
name: "capacitor",
// nameInfo: "",
description: "increase damage based on stored energy
+1% damage for every 5.5% energy",
@@ -296,22 +260,6 @@ const mod = {
b.setFireCD();
}
},
- {
- name: "desublimated ammunition",
- description: "use 50% less ammo when crouching",
- maxCount: 1,
- count: 0,
- allowed() {
- return true
- },
- requires: "",
- effect() {
- mod.noAmmo = 1
- },
- remove() {
- mod.noAmmo = 0;
- }
- },
{
name: "mass driver",
description: "blocks do 2x more damage to mobs
charge throws more quickly for less energy",
@@ -381,7 +329,7 @@ const mod = {
},
{
name: "scrap bots",
- description: "+12% chance to build a bot after killing a mob
the bot will follow you until you exit the map",
+ 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() {
@@ -396,11 +344,11 @@ const mod = {
}
},
{
- name: "self-replication",
+ name: "bot replication",
description: "duplicate your permanent bots
remove 80% of your ammo",
maxCount: 1,
count: 0,
- isNonRefundable: true,
+ // isNonRefundable: true,
allowed() {
return mod.foamBotCount + mod.nailBotCount + mod.laserBotCount > 2
},
@@ -720,22 +668,6 @@ const mod = {
mod.energySiphon = 0;
}
},
- {
- name: "entropy exchange",
- description: "heal for +1.5% of damage done",
- maxCount: 9,
- count: 0,
- allowed() {
- return !mod.isEnergyHealth
- },
- requires: "not mass-energy equivalence",
- effect() {
- mod.healthDrain += 0.015;
- },
- remove() {
- mod.healthDrain = 0;
- }
- },
{
name: "overcharge",
description: "increase your maximum energy by +50%",
@@ -753,6 +685,22 @@ const mod = {
mech.maxEnergy = 1;
}
},
+ {
+ name: "entropy exchange",
+ description: "heal for +1.5% of damage done",
+ maxCount: 9,
+ count: 0,
+ allowed() {
+ return !mod.isEnergyHealth
+ },
+ requires: "not mass-energy equivalence",
+ effect() {
+ mod.healthDrain += 0.015;
+ },
+ remove() {
+ mod.healthDrain = 0;
+ }
+ },
{
name: "supersaturation",
description: "increase your maximum health by +50%",
@@ -788,6 +736,22 @@ const mod = {
mod.recursiveHealing = 1;
}
},
+ {
+ name: "crystallized armor",
+ description: "increase maximum health by 3% for each
unused power up at the end of a level",
+ maxCount: 1,
+ count: 0,
+ allowed() {
+ return !mod.isEnergyHealth
+ },
+ requires: "not mass-energy equivalence",
+ effect() {
+ mod.isArmorFromPowerUps = true;
+ },
+ remove() {
+ mod.isArmorFromPowerUps = false;
+ }
+ },
{
name: "pair production",
description: "power ups overfill your energy
temporarily gain twice your max energy",
@@ -807,7 +771,7 @@ const mod = {
},
{
name: "Bayesian inference",
- description: "37% chance for double power ups to drop
ammo will no longer spawn from mobs",
+ description: "40% chance for double power ups to drop
ammo will no longer spawn from mobs",
maxCount: 1,
count: 0,
allowed() {
@@ -815,15 +779,35 @@ const mod = {
},
requires: "",
effect: () => {
- mod.bayesian = 0.37;
+ mod.bayesian = 0.40;
},
remove() {
mod.bayesian = 0;
}
},
+ {
+ name: "logistics",
+ description: "ammo power ups add to your current gun
spawn 4 ammo",
+ maxCount: 1,
+ count: 0,
+ allowed() {
+ return true
+ },
+ requires: "",
+ effect() {
+ mod.isAmmoForGun = true;
+ for (let i = 0; i < 4; i++) {
+ powerUps.spawn(mech.pos.x, mech.pos.y, "ammo");
+ if (Math.random() < mod.bayesian) powerUps.spawn(mech.pos.x, mech.pos.y, "ammo");
+ }
+ },
+ remove() {
+ mod.isAmmoForGun = false;
+ }
+ },
{
name: "catabolism",
- description: "gain ammo when you fire while out of ammo
drains 3% of current remaining health",
+ description: "gain ammo when you fire while out of ammo
drains 2% of max health",
maxCount: 1,
count: 0,
allowed() {
@@ -831,12 +815,28 @@ const mod = {
},
requires: "not mass-energy equivalence",
effect: () => {
- mod.isAmmoFromHealth = 0.03;
+ mod.isAmmoFromHealth = 0.02;
},
remove() {
mod.isAmmoFromHealth = 0;
}
},
+ {
+ name: "desublimated ammunition",
+ description: "use 50% less ammo when crouching",
+ maxCount: 1,
+ count: 0,
+ allowed() {
+ return true
+ },
+ requires: "",
+ effect() {
+ mod.noAmmo = 1
+ },
+ remove() {
+ mod.noAmmo = 0;
+ }
+ },
{
name: "cardinality",
description: "2 extra choices when selecting power ups",
@@ -858,7 +858,6 @@ const mod = {
description: "spawn 5 mods
power ups are limited to one choice",
maxCount: 1,
count: 0,
- // isNonRefundable: true,
allowed() {
return !mod.isExtraChoice
},
@@ -940,11 +939,14 @@ const mod = {
},
requires: "more than 6 mods",
effect: () => {
- //remove bullets //mostly to get rid of bots
+ //remove bullets //to get rid of bots
for (let i = 0; i < bullet.length; ++i) Matter.World.remove(engine.world, bullet[i]);
bullet = [];
- let count = mod.totalCount + 1
+ let count = 0 //count mods
+ for (let i = 0, len = mod.mods.length; i < len; i++) { // spawn new mods power ups
+ if (!mod.mods[i].isNonRefundable) count += mod.mods[i].count
+ }
if (mod.isDeterminism) count -= 5 //remove the 5 bonus mods when getting rid of determinism
mod.setupAllMods(); // remove all mods
for (let i = 0; i < count; i++) { // spawn new mods power ups
@@ -1003,7 +1005,7 @@ const mod = {
},
{
name: "microstates",
- description: "+7% damage for every 10 active bullets",
+ description: "+6% damage for every 10 active bullets",
maxCount: 1,
count: 0,
allowed() {
@@ -1040,7 +1042,7 @@ const mod = {
},
{
name: "depleted uranium rounds",
- description: `your bullets are +16% larger
increased mass and physical damage`,
+ description: `your bullets are +18% larger
increased mass and physical damage`,
count: 0,
maxCount: 9,
allowed() {
@@ -1048,7 +1050,7 @@ const mod = {
},
requires: "minigun, shotgun, super balls",
effect() {
- mod.bulletSize += 0.16
+ mod.bulletSize += 0.18
},
remove() {
mod.bulletSize = 1;
@@ -1515,7 +1517,7 @@ const mod = {
maxCount: 1,
count: 0,
allowed() {
- return mod.haveGunCheck("spores") || mod.sporesOnDeath > 0 || mod.isSporeField
+ return (mod.haveGunCheck("spores") || mod.sporesOnDeath > 0 || mod.isSporeField) && !mod.isEnergyHealth
},
requires: "spores",
effect() {
@@ -1720,7 +1722,7 @@ const mod = {
},
{
name: "degenerate matter",
- description: "negative mass field
harm reduction is increased to 80%",
+ description: "harm reduction from negative mass field
is increased from 60% to 80%",
maxCount: 1,
count: 0,
allowed() {
@@ -1738,7 +1740,7 @@ const mod = {
},
{
name: "annihilation",
- description: "after touching mobs, they are annihilated",
+ description: "after touching mobs, they are annihilated
drains 20% of base energy",
maxCount: 1,
count: 0,
allowed() {
@@ -1753,8 +1755,8 @@ const mod = {
}
},
{
- name: "Hawking radiation",
- description: "negative mass field leaks virtual particles
mobs inside the field take damage",
+ name: "negative temperature",
+ description: "negative mass field uses energy
to freeze mobs caught in it's effect",
maxCount: 1,
count: 0,
allowed() {
@@ -1762,10 +1764,10 @@ const mod = {
},
requires: "negative mass field",
effect() {
- mod.isHawking = true;
+ mod.isFreezeMobs = true;
},
remove() {
- mod.isHawking = 0;
+ mod.isFreezeMobs = false;
}
},
{
@@ -1899,6 +1901,93 @@ const mod = {
mod.isPilotFreeze = false
}
},
+ {
+ name: "heals",
+ description: "spawn 6 heal power ups",
+ maxCount: 9,
+ count: 0,
+ isNonRefundable: true,
+ allowed() {
+ return true
+ },
+ requires: "",
+ effect() {
+ for (let i = 0; i < 6; i++) {
+ powerUps.spawn(mech.pos.x, mech.pos.y, "heal");
+ if (Math.random() < mod.bayesian) powerUps.spawn(mech.pos.x, mech.pos.y, "heal");
+ }
+ },
+ remove() {}
+ },
+ {
+ name: "ammo",
+ description: "spawn 6 ammo power ups",
+ maxCount: 9,
+ count: 0,
+ isNonRefundable: true,
+ allowed() {
+ return true
+ },
+ requires: "",
+ effect() {
+ for (let i = 0; i < 6; i++) {
+ powerUps.spawn(mech.pos.x, mech.pos.y, "ammo");
+ if (Math.random() < mod.bayesian) powerUps.spawn(mech.pos.x, mech.pos.y, "ammo");
+ }
+ },
+ remove() {}
+ },
+
+ {
+ name: "rerolls",
+ description: "spawn 6 reroll power ups",
+ maxCount: 9,
+ count: 0,
+ isNonRefundable: true,
+ allowed() {
+ return true
+ },
+ requires: "",
+ effect() {
+ for (let i = 0; i < 6; i++) {
+ powerUps.spawn(mech.pos.x, mech.pos.y, "reroll");
+ if (Math.random() < mod.bayesian) powerUps.spawn(mech.pos.x, mech.pos.y, "reroll");
+ }
+ },
+ remove() {}
+ },
+ {
+ name: "gun",
+ description: "spawn a gun power up",
+ maxCount: 9,
+ count: 0,
+ isNonRefundable: true,
+ allowed() {
+ return true
+ },
+ requires: "",
+ effect() {
+ powerUps.spawn(mech.pos.x, mech.pos.y, "gun");
+ if (Math.random() < mod.bayesian) powerUps.spawn(mech.pos.x, mech.pos.y, "gun");
+ },
+ remove() {}
+ },
+ {
+ name: "field",
+ description: "spawn a field power up",
+ maxCount: 9,
+ count: 0,
+ isNonRefundable: true,
+ allowed() {
+ return true
+ },
+ requires: "",
+ effect() {
+ powerUps.spawn(mech.pos.x, mech.pos.y, "field");
+ if (Math.random() < mod.bayesian) powerUps.spawn(mech.pos.x, mech.pos.y, "field");
+ },
+ remove() {}
+ },
],
//variables use for gun mod upgrades
fireRate: null,
@@ -1954,7 +2043,7 @@ const mod = {
isMineAmmoBack: null,
isPlasmaRange: null,
isRailNails: null,
- isHawking: null,
+ isFreezeMobs: null,
babyMissiles: null,
isIceCrystals: null,
throwChargeRate: null,
@@ -1991,4 +2080,6 @@ const mod = {
squirrelJump: null,
fastTimeJump: null,
isFastDot: null,
+ isArmorFromPowerUps: null,
+ isAmmoForGun: null
}
\ No newline at end of file
diff --git a/js/player.js b/js/player.js
index ca2794b..1e2f799 100644
--- a/js/player.js
+++ b/js/player.js
@@ -554,7 +554,7 @@ const mech = {
document.getElementById("dmg").style.opacity = 0.1 + Math.min(0.6, dmg * 4);
}
- if (dmg > 0.2 * mech.holdingMassScale) mech.drop(); //drop block if holding
+ if (dmg > 0.06 / mech.holdingMassScale) mech.drop(); //drop block if holding
const normalFPS = function () {
if (mech.defaultFPSCycle < mech.cycle) { //back to default values
@@ -1468,6 +1468,20 @@ const mech = {
y: player.velocity.y * 0.98
});
}
+ if (mod.isFreezeMobs) {
+ const ICE_DRAIN = 0.00015
+ for (let i = 0, len = mob.length; i < len; i++) {
+ if (mob[i].distanceToPlayer() + mob[i].radius < this.fieldDrawRadius && !mob[i].shield && !mob[i].isShielded) {
+ if (mech.energy > ICE_DRAIN) {
+ this.fieldDrawRadius -= 2;
+ mech.energy -= ICE_DRAIN;
+ mobs.statusSlow(mob[i], 45)
+ } else {
+ break;
+ }
+ }
+ }
+ }
//draw zero-G range
ctx.beginPath();
@@ -1475,31 +1489,6 @@ const mech = {
ctx.fillStyle = "#f5f5ff";
ctx.globalCompositeOperation = "difference";
ctx.fill();
- if (mod.isHawking) {
- for (let i = 0, len = mob.length; i < len; i++) {
- if (mob[i].distanceToPlayer2() < this.fieldDrawRadius * this.fieldDrawRadius && Matter.Query.ray(map, mech.pos, mob[i].position).length === 0 && Matter.Query.ray(body, mech.pos, mob[i].position).length === 0) {
- mob[i].damage(b.dmgScale * 0.085);
- mob[i].locatePlayer();
- //draw electricity
- const sub = Vector.sub(mob[i].position, mech.pos)
- const unit = Vector.normalise(sub);
- const steps = 6
- const step = Vector.magnitude(sub) / steps;
- ctx.beginPath();
- let x = mech.pos.x + 30 * unit.x;
- let y = mech.pos.y + 30 * unit.y;
- ctx.moveTo(x, y);
- for (let i = 0; i < steps; i++) {
- x += step * (unit.x + 0.7 * (Math.random() - 0.5))
- y += step * (unit.y + 0.7 * (Math.random() - 0.5))
- ctx.lineTo(x, y);
- }
- ctx.lineWidth = 1;
- ctx.strokeStyle = "rgba(0,255,0,0.5)" //"#fff";
- ctx.stroke();
- }
- }
- }
ctx.globalCompositeOperation = "source-over";
}
} else if (mech.holdingTarget && mech.fieldCDcycle < mech.cycle) { //holding, but field button is released
diff --git a/js/powerup.js b/js/powerup.js
index 11f46aa..de7b2e6 100644
--- a/js/powerup.js
+++ b/js/powerup.js
@@ -1,6 +1,7 @@
let powerUp = [];
const powerUps = {
+ totalPowerUps: 0, //used for mods that count power ups at the end of a level
choose(type, index) {
if (type === "gun") {
b.giveGuns(index)
@@ -110,16 +111,21 @@ const powerUps = {
//only get ammo for guns player has
let target;
if (b.inventory.length > 0) {
- //add ammo to a gun in inventory
- target = b.guns[b.inventory[Math.floor(Math.random() * (b.inventory.length))]];
- //try 3 more times to give ammo to a gun with ammo, not Infinity
- if (target.ammo === Infinity) {
- target = b.guns[b.inventory[Math.floor(Math.random() * (b.inventory.length))]]
+ if (mod.isAmmoForGun) {
+ target = b.guns[b.activeGun];
+ } else {
+ //find a gun in your inventory
+ target = b.guns[b.inventory[Math.floor(Math.random() * (b.inventory.length))]];
+ //try 3 more times to give ammo to a gun with ammo, not Infinity
if (target.ammo === Infinity) {
target = b.guns[b.inventory[Math.floor(Math.random() * (b.inventory.length))]]
- if (target.ammo === Infinity) target = b.guns[b.inventory[Math.floor(Math.random() * (b.inventory.length))]]
+ if (target.ammo === Infinity) {
+ target = b.guns[b.inventory[Math.floor(Math.random() * (b.inventory.length))]]
+ if (target.ammo === Infinity) target = b.guns[b.inventory[Math.floor(Math.random() * (b.inventory.length))]]
+ }
}
}
+ //give ammo
if (target.ammo === Infinity) {
if (mech.energy < mech.maxEnergy) mech.energy = mech.maxEnergy;
if (!game.lastLogTime) game.makeTextLog("+energy", 300);
diff --git a/js/spawn.js b/js/spawn.js
index 4d107be..8eb97c3 100644
--- a/js/spawn.js
+++ b/js/spawn.js
@@ -900,7 +900,7 @@ const spawn = {
Matter.Body.rotate(me, Math.random() * Math.PI * 2);
me.accelMag = 0.0005 * game.accelScale;
me.seePlayerFreq = Math.floor(25 * game.lookFreqScale);
- me.memory = 600;
+ me.memory = 420;
me.restitution = 1;
me.frictionAir = 0.05;
me.frictionStatic = 0;
@@ -1009,7 +1009,7 @@ const spawn = {
// hitting player
if (best.who === player) {
if (mech.immuneCycle < mech.cycle) {
- const dmg = 0.0005 * game.dmgScale;
+ const dmg = 0.002 * game.dmgScale;
mech.damage(dmg);
//draw damage
ctx.fillStyle = color;
@@ -1801,7 +1801,7 @@ const spawn = {
};
Matter.Body.setDensity(me, 0.00005); //normal is 0.001
me.timeLeft = 420 * (0.8 + 0.4 * Math.random());
- me.accelMag = 0.00015 * (0.8 + 0.4 * Math.random()) * game.accelScale;
+ me.accelMag = 0.00017 * (0.8 + 0.4 * Math.random()) * game.accelScale;
me.frictionAir = 0.01 * (0.8 + 0.4 * Math.random());
me.restitution = 0.5;
me.leaveBody = false;
diff --git a/todo.txt b/todo.txt
index e7ad04e..b7ea3a3 100644
--- a/todo.txt
+++ b/todo.txt
@@ -1,9 +1,25 @@
-mod flechettes do all DoT damage in 1/2 a second
-minigun increases fire speed as you hold the fire button
+added mods to spawn a gun, a field, and rerolls
+added mod that gives max health for leftover power ups
+ this mod has some interesting interactions with other mods
+mod annihilation now uses 20% of base energy and doesn't trigger damage immunity
+mod Hawking radiation removed
+mod negative temperature: freezed mobs in range of negative mass field, but drain energy
+mod: logistics
+ ammo power ups are added to your current gun
+ spawn 4 ammo immediately
************** TODO - n-gon **************
+very high speed projectile that checks for collisions in future positions to avoid tunneling
+
+make a visual indication of max health
+
+mod: give a gun auto aiming
+ minigun?
+
+ice status effect lasts twice as long
+
shrink font on small screens (so you can see 5 options on power ups)
graphic idea: bezier curve that moves smoothly from mob to mob