thermoelectric balance
ice IX mod: thermoelectric effect - when ice IX kills a mob heal 3% and regen 66% energy
This commit is contained in:
88
js/bullet.js
88
js/bullet.js
@@ -801,10 +801,14 @@ const b = {
|
||||
lockedOn: null,
|
||||
isFollowMouse: true,
|
||||
onDmg(who) {
|
||||
console.log(who.alive)
|
||||
mobs.statusSlow(who, 60)
|
||||
this.endCycle = game.cycle
|
||||
if (mod.isHeavyWater) mobs.statusDoT(who, 0.1, 300)
|
||||
if (mod.iceEnergy && !who.shield) mech.energy += mod.iceEnergy //&& mech.energy < mech.maxEnergy
|
||||
if (mod.isHeavyWater) mobs.statusDoT(who, 0.15, 300)
|
||||
if (mod.iceEnergy && !who.shield && !who.isShielded && who.dropPowerUp && !who.alive) {
|
||||
mech.energy += mod.iceEnergy * 0.66
|
||||
mech.addHealth(mod.iceEnergy * 0.03)
|
||||
}
|
||||
},
|
||||
onEnd() {},
|
||||
do() {
|
||||
@@ -1836,85 +1840,6 @@ const b = {
|
||||
this.nextFireCycle = mech.cycle + CD * b.fireCD //predict next fire cycle if the fire button is held down
|
||||
}
|
||||
mech.fireCDcycle = mech.cycle + Math.floor(CD * b.fireCD); // cool down
|
||||
|
||||
|
||||
// const range = 2000
|
||||
// const totalBullets = 6
|
||||
// const angleStep = (mech.crouch ? 0.06 : 0.25) / totalBullets
|
||||
// let dir = mech.angle - angleStep * totalBullets / 2;
|
||||
// for (let i = 0; i < totalBullets; i++) {
|
||||
// dir += angleStep
|
||||
// const vertexCollision = function (v1, v1End, domain) {
|
||||
// for (let i = 0; i < domain.length; ++i) {
|
||||
// let vertices = domain[i].vertices;
|
||||
// const len = vertices.length - 1;
|
||||
// for (let j = 0; j < len; j++) {
|
||||
// results = game.checkLineIntersection(v1, v1End, vertices[j], vertices[j + 1]);
|
||||
// if (results.onLine1 && results.onLine2) {
|
||||
// const dx = v1.x - results.x;
|
||||
// const dy = v1.y - results.y;
|
||||
// const dist2 = dx * dx + dy * dy;
|
||||
// if (dist2 < best.dist2 && (!domain[i].mob || domain[i].alive)) {
|
||||
// best = {
|
||||
// x: results.x,
|
||||
// y: results.y,
|
||||
// dist2: dist2,
|
||||
// who: domain[i],
|
||||
// v1: vertices[j],
|
||||
// v2: vertices[j + 1]
|
||||
// };
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// results = game.checkLineIntersection(v1, v1End, vertices[0], vertices[len]);
|
||||
// if (results.onLine1 && results.onLine2) {
|
||||
// const dx = v1.x - results.x;
|
||||
// const dy = v1.y - results.y;
|
||||
// const dist2 = dx * dx + dy * dy;
|
||||
// if (dist2 < best.dist2 && (!domain[i].mob || domain[i].alive)) {
|
||||
// best = {
|
||||
// x: results.x,
|
||||
// y: results.y,
|
||||
// dist2: dist2,
|
||||
// who: domain[i],
|
||||
// v1: vertices[0],
|
||||
// v2: vertices[len]
|
||||
// };
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// };
|
||||
// const path = [{
|
||||
// x: mech.pos.x,
|
||||
// y: mech.pos.y
|
||||
// },
|
||||
// {
|
||||
// x: mech.pos.x + range * Math.cos(dir),
|
||||
// y: mech.pos.y + range * Math.sin(dir)
|
||||
// }
|
||||
// ];
|
||||
// let best = {
|
||||
// x: null,
|
||||
// y: null,
|
||||
// dist2: Infinity,
|
||||
// who: null,
|
||||
// v1: null,
|
||||
// v2: null
|
||||
// };
|
||||
// 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);
|
||||
|
||||
// if (best.dist2 !== Infinity) { //if hitting something
|
||||
// b.explosion({
|
||||
// x: best.x,
|
||||
// y: best.y
|
||||
// }, (mech.crouch ? 95 : 75) + (Math.random() - 0.5) * 50);
|
||||
// } else {
|
||||
// b.explosion(path[path.length - 1], (mech.crouch ? 95 : 75) + (Math.random() - 0.5) * 50);
|
||||
// }
|
||||
// }
|
||||
|
||||
const speed = 30 + 6 * Math.random() + 9 * mod.nailInstantFireRate
|
||||
const angle = mech.angle + (Math.random() - 0.5) * (Math.random() - 0.5) * (mech.crouch ? 1.35 : 3.2) / CD
|
||||
const dmg = 0.9
|
||||
@@ -1925,7 +1850,6 @@ const b = {
|
||||
x: mech.Vx / 2 + speed * Math.cos(angle),
|
||||
y: mech.Vy / 2 + speed * Math.sin(angle)
|
||||
}, dmg) //position, velocity, damage
|
||||
|
||||
if (mod.isIceCrystals) {
|
||||
bullet[bullet.length - 1].onDmg = function (who) {
|
||||
mobs.statusSlow(who, 30)
|
||||
|
||||
@@ -23,8 +23,8 @@ const level = {
|
||||
// mod.giveMod("eddy current brake")
|
||||
|
||||
|
||||
// level.intro(); //starting level
|
||||
level.testing(); //not in rotation
|
||||
level.intro(); //starting level
|
||||
// level.testing(); //not in rotation
|
||||
// level.template() //not in rotation
|
||||
// level.testChamber() //less mobs, more puzzle
|
||||
// level.sewers();
|
||||
@@ -141,6 +141,7 @@ const level = {
|
||||
spawn.mapRect(level.exit.x, level.exit.y + 20, 100, 100); //exit bump
|
||||
// spawn.boost(1500, 0, 900);
|
||||
|
||||
spawn.starter(1600, -500)
|
||||
// spawn.bomberBoss(2900, -500)
|
||||
// spawn.launcherBoss(1200, -500)
|
||||
// spawn.laserTargetingBoss(1600, -400)
|
||||
@@ -150,12 +151,11 @@ const level = {
|
||||
// spawn.sniper(1800, -120)
|
||||
// spawn.sniper(2200, -120)
|
||||
// spawn.cellBossCulture(1600, -500)
|
||||
// spawn.starter(1600, -500)
|
||||
// spawn.powerUpBoss(1600, -500)
|
||||
// spawn.shield(mob[mob.length - 1], 1200, -500, 1);
|
||||
|
||||
// spawn.nodeBoss(1200, -500, "launcher")
|
||||
spawn.snakeBoss(1200, -500)
|
||||
// spawn.snakeBoss(1200, -500)
|
||||
// spawn.timeSkipBoss(2900, -500)
|
||||
// spawn.randomMob(1600, -500)
|
||||
},
|
||||
|
||||
10
js/mods.js
10
js/mods.js
@@ -2208,7 +2208,7 @@ const mod = {
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
return mod.haveGunCheck("ice IX") || mod.isIceField
|
||||
return (mod.haveGunCheck("ice IX") || mod.isIceField) && !mod.iceEnergy
|
||||
},
|
||||
requires: "ice IX",
|
||||
effect() {
|
||||
@@ -2220,15 +2220,15 @@ const mod = {
|
||||
},
|
||||
{
|
||||
name: "thermoelectric effect",
|
||||
description: "<strong>ice IX</strong> bullets give you <strong>7%</strong> <strong class='color-f'>energy</strong><br>after they <strong>collide</strong> with mobs",
|
||||
maxCount: 9,
|
||||
description: "<strong>killing</strong> mobs with <strong>ice IX</strong> gives <strong>3%</strong> <strong class='color-h'>health</strong><br>and overfills your <strong class='color-f'>energy</strong> by <strong>66%</strong>",
|
||||
maxCount: 3,
|
||||
count: 0,
|
||||
allowed() {
|
||||
return mod.haveGunCheck("ice IX") || mod.isIceField
|
||||
return (mod.haveGunCheck("ice IX") || mod.isIceField) && !mod.isHeavyWater
|
||||
},
|
||||
requires: "ice IX",
|
||||
effect() {
|
||||
mod.iceEnergy += 0.07
|
||||
mod.iceEnergy++
|
||||
},
|
||||
remove() {
|
||||
mod.iceEnergy = 0;
|
||||
|
||||
Reference in New Issue
Block a user