testchamber changes, heal power size scales

This commit is contained in:
landgreen
2020-07-24 07:23:57 -07:00
parent e30f63ad94
commit b6e9410bad
7 changed files with 146 additions and 128 deletions

View File

@@ -2104,7 +2104,7 @@ const b = {
for (let i = 0, len = mob.length; i < len; ++i) {
if (mob[i].shield) {
const dist = Vector.magnitude(Vector.sub(this.position, mob[i].position)) - mob[i].radius;
if (dist < this.explodeRad) mob[i].health *= 0.8
if (dist < this.explodeRad) mob[i].health *= 0.2
}
}
const dist = Vector.magnitude(Vector.sub(this.position, player.position))
@@ -2669,7 +2669,7 @@ const b = {
} else if (mech.energy > 0.005) { // charging on mouse down
mech.fireCDcycle = Infinity //can't fire until mouse is released
const lastCharge = this.charge
let chargeRate = (mech.crouch) ? 0.975 : 0.987
let chargeRate = (mech.crouch) ? 0.98 : 0.984
chargeRate *= Math.pow(b.fireCD, 0.03)
this.charge = this.charge * chargeRate + (1 - chargeRate) // this.charge converges to 1
if (mod.isRailTimeSlow) {
@@ -2950,6 +2950,7 @@ const b = {
}
}
},
{
name: "pulse",
description: "convert <strong>25%</strong> of your <strong class='color-f'>energy</strong> into a pulsed laser<br>instantly initiates a fusion <strong class='color-e'>explosion</strong>",
@@ -3101,6 +3102,41 @@ const b = {
}
},
// {
// name: "maser",
// description: "emit a <strong>beam</strong> of collimated coherent <strong>light</strong><br>drains <strong class='color-f'>energy</strong> instead of ammunition",
// ammo: 0,
// ammoPack: Infinity,
// have: false,
// isEasyToAim: false,
// fire() {
// if (mech.energy < 0.002) {
// mech.fireCDcycle = mech.cycle + 100; // cool down if out of energy
// } else {
// // mech.energy -= mech.fieldRegen + 0.002 * mod.isLaserDiode
// let range = 2000
// const looking = Vector.mult(Vector.rotate({
// x: 1,
// y: 0
// }, mech.angle), range)
// const endpoint = Matter.Vector.add(mech.pos, looking)
// const hits = Matter.Query.ray(body, mech.pos, endpoint, 100)
// for (let i = 0; i < hits.length; i++) {
// }
// // console.log(hits, target, range)
// //draw beam
// ctx.beginPath();
// ctx.moveTo(mech.pos.x, mech.pos.y);
// ctx.lineTo(endpoint.x, endpoint.y);
// ctx.stroke();
// }
// }
// },
// {
// name: "dwarf star", //14
// description: "drop a mine that gravitational pulls in matter",
// ammo: 0,

View File

@@ -18,7 +18,7 @@ const level = {
// mech.isStealth = true;
// mod.giveMod("bot upgrades");
// mod.nailBotCount += 10
// b.giveGuns("ice IX")
// b.giveGuns("maser")
// mech.setField("plasma torch")
// level.testing();
@@ -50,8 +50,8 @@ const level = {
mech.maxHealth += 0.05 * powerUps.totalPowerUps
if (powerUps.totalPowerUps) game.makeTextLog("<span style='font-size:115%;'> max health increased by " + (0.05 * powerUps.totalPowerUps * 100).toFixed(0) + "%</span>", 300)
}
if (mod.isHealLowHealth && mech.health < mech.maxHealth * 0.66 * game.healScale) {
mech.health = mech.maxHealth * 0.66 * game.healScale
if (mod.isHealLowHealth && mech.health < mech.maxHealth * game.healScale) {
mech.health = mech.maxHealth * game.healScale
mech.displayHealth();
}
},
@@ -188,15 +188,15 @@ const level = {
spawn.mapRect(level.exit.x, level.exit.y + 20, 100, 20);
level.defaultZoom = 2000
game.zoomTransition(level.defaultZoom)
document.body.style.backgroundColor = "#444";
document.body.style.backgroundColor = "#d5d5d5";
level.fillBG.push({ //full map white
x: -375,
y: -3700,
width: 2975,
height: 3800,
color: "#ddd"
});
// level.fillBG.push({ //full map white
// x: -375,
// y: -3700,
// width: 2975,
// height: 3800,
// color: "#ddd"
// });
level.fillBG.push({ //exit room
x: -300,
@@ -223,13 +223,13 @@ const level = {
const portal3 = level.portal({
x: 1850,
y: -550
y: -585
}, -Math.PI / 2, { //up
x: 2425,
y: -600
}, -2 * Math.PI / 3) //up left
const hazard = level.hazard(175, -2050, 1050, 10, 0.15, "hsl(0, 100%, 50%)") //laser
const hazard2 = level.hazard(1775, -2550, 150, 10, 0.15, "hsl(0, 100%, 50%)") //laser
const hazard = level.hazard(350, -2025, 700, 10, 0.4, "hsl(0, 100%, 50%)") //laser
const hazard2 = level.hazard(1775, -2550, 150, 10, 0.4, "hsl(0, 100%, 50%)") //laser
const button = level.button(2100, -2600)
level.custom = () => {
@@ -287,11 +287,13 @@ const level = {
powerUps.chooseRandomPowerUp(powerUpPos[1].x, powerUpPos[1].y);
//outer wall
spawn.mapRect(-500, -3800, 200, 4000); //left map wall
spawn.mapRect(2500, -2975, 200, 2825); //right map middle wall above right portal
spawn.mapRect(-1400, -3800, 1100, 3900); //left map wall
spawn.mapRect(2500, -2975, 1200, 2825); //right map middle wall above right portal
spawn.mapRect(2700, -3600, 1000, 3650);
// far far right wall right of portals
// spawn.mapRect(2500, -1425, 200, 1275); // below right portal
spawn.mapRect(-400, -3800, 3100, 200); //map ceiling
spawn.mapRect(-400, 0, 3100, 200); //floor
spawn.mapRect(-1400, -4800, 5100, 1200); //map ceiling
spawn.mapRect(-1400, 0, 5100, 1200); //floor
//lower entrance /exit
// spawn.mapRect(300, -550, 50, 350); //right entrance wall
@@ -299,19 +301,26 @@ const level = {
// spawn.mapRect(1075, -100, 575, 200);
// spawn.bodyRect(312, -200, 25, 200);
// spawn.bodyRect(1775, -75, 100, 100);
spawn.mapRect(1075, -375, 50, 225);
spawn.bodyRect(1087, -150, 25, 150);
spawn.mapRect(300, -375, 50, 225);
spawn.bodyRect(312, -150, 25, 140);
spawn.mapRect(300, -10, 50, 50);
//upper entrance / exit
spawn.mapRect(-400, -1050, 750, 50);
spawn.mapRect(300, -1050, 50, 300);
spawn.bodyRect(312, -750, 25, 200);
spawn.bodyRect(312, -750, 25, 190);
spawn.mapRect(300, -560, 50, 50);
// spawn.mapRect(1400, -1025, 50, 300);
// spawn.mapRect(1400, -1025, 50, 825);
spawn.mapRect(600, -600, 275, 75);
spawn.bodyRect(675, -725, 125, 125);
spawn.mapRect(1075, -1050, 550, 400);
spawn.mapRect(-400, -550, 2175, 250);
// spawn.mapRect(1075, -1050, 550, 400);
// spawn.mapRect(1150, -1000, 150, 575);
spawn.mapRect(1150, -1000, 250, 575);
spawn.mapRect(1600, -550, 175, 250);
spawn.mapRect(-400, -550, 1800, 250);
spawn.mapRect(-200, -1700, 150, 25); //platform above exit room
spawn.mapRect(-200, -1325, 350, 25);
@@ -319,7 +328,8 @@ const level = {
// spawn.mapRect(1425, -550, 350, 250);
spawn.mapRect(1925, -550, 500, 250);
spawn.mapRect(2425, -450, 100, 150);
spawn.mapRect(1750, -360, 225, 60);
spawn.mapRect(1750, -390, 225, 90);
//portal 1 bottom
spawn.mapRect(2525, -200, 175, 250); //right portal back wall
@@ -333,14 +343,15 @@ const level = {
spawn.mapRect(1400, -3625, 50, 200);
spawn.mapRect(350, -3625, 50, 225);
spawn.mapRect(350, -3260, 50, 60);
spawn.bodyRect(362, -3400, 25, 140);
// spawn.bodyRect(362, -3400, 25, 140);
spawn.mapRect(200, -3250, 1250, 50);
spawn.mapRect(1400, -3260, 50, 310);
spawn.bodyRect(1412, -3425, 25, 165);
spawn.mapRect(-150, -3000, 150, 25);
spawn.mapRect(-350, -2750, 175, 200);
// spawn.mapRect(-150, -3000, 150, 25);
// spawn.mapRect(-350, -2925, 175, 25);
spawn.mapRect(-150, -2925, 150, 25);
//portal 2
spawn.mapRect(-300, -2600, 300, 675); //left platform
@@ -350,18 +361,18 @@ const level = {
spawn.mapRect(0, -1975, 175, 50);
spawn.mapRect(1225, -1975, 175, 50);
spawn.mapRect(150, -2150, 25, 225);
spawn.mapRect(1225, -2150, 25, 225);
spawn.mapRect(150, -2100, 200, 175);
spawn.mapRect(1050, -2100, 200, 175);
//mobs
spawn.randomMob(1075, -3500, 0);
spawn.randomMob(1075, -3500, -0.3);
// spawn.randomMob(-75, -3425, 0.2);
spawn.randomMob(1475, -225, 0);
spawn.randomMob(2075, -150, 0);
spawn.randomMob(2175, -700, 0);
spawn.randomMob(-75, -850, 0.1);
spawn.randomMob(1300, -600, 0.1);
spawn.randomMob(550, -3400, 0.1);
spawn.randomMob(1475, -225, -0.3);
spawn.randomMob(2075, -150, -0.2);
spawn.randomMob(2175, -700, -0.2);
spawn.randomMob(-75, -850, -0.1);
spawn.randomMob(1300, -600, -0.1);
spawn.randomMob(550, -3400, 0);
if (game.difficulty > 50) {
spawn.randomMob(2300, -2775, -0.5);
spawn.randomMob(600, -925, -0.5);
@@ -370,7 +381,7 @@ const level = {
spawn.randomMob(-75, -1475, 0);
spawn.randomBoss(600, -2600, 0);
}
if (game.difficulty < 30) {
if (game.difficulty < 32) {
spawn.randomMob(700, -1650, 0);
spawn.randomMob(600, -3500, 0.2);
spawn.randomMob(-75, -1175, 0.2);
@@ -604,7 +615,7 @@ const level = {
spawn.mapRect(level.exit.x, level.exit.y + 20, 100, 100); //exit bump
spawn.boost(1500, 0, 900);
spawn.bomberBoss(2900, -500)
// spawn.bomberBoss(2900, -500)
// spawn.launcherBoss(1200, -500)
// spawn.laserTargetingBoss(1600, -400)
// spawn.spawner(1600, -500)
@@ -613,7 +624,7 @@ const level = {
// spawn.sniper(1800, -120)
// spawn.sniper(2200, -120)
// spawn.cellBossCulture(1600, -500)
// spawn.shooter(1600, -500)
spawn.starter(1600, -500, 60)
// spawn.striker(1600, -500)
// spawn.shield(mob[mob.length - 1], 1200, -500, 1);

View File

@@ -1007,7 +1007,7 @@ const mobs = {
this.removeConsBB();
this.alive = false; //triggers mob removal in mob[i].replace(i)
if (this.dropPowerUp) {
if (mod.isEnergyLoss) mech.energy *= 0.66;
if (mod.isEnergyLoss) mech.energy *= 0.75;
powerUps.spawnRandomPowerUp(this.position.x, this.position.y);
mech.lastKillCycle = mech.cycle; //tracks the last time a kill was made, mostly used in game.checks()
if (Math.random() < mod.sporesOnDeath) {

View File

@@ -91,9 +91,9 @@ const mod = {
maxCount: 1,
count: 0,
allowed() {
return true
return mech.maxEnergy > 1 || mod.isEnergyRecovery || mod.isPiezo || mod.energySiphon > 0
},
requires: "",
requires: "increased energy regen or max energy",
effect: () => {
mod.isEnergyDamage = true // used in mech.grabPowerUp
},
@@ -103,7 +103,7 @@ const mod = {
},
{
name: "acute stress response",
description: "increase <strong class='color-d'>damage</strong> by <strong>33%</strong><br>after a mob <strong>dies</strong> drain <strong>33%</strong> <strong class='color-f'>energy</strong>",
description: "increase <strong class='color-d'>damage</strong> by <strong>33%</strong><br>if a mob <strong>dies</strong> drain stored <strong class='color-f'>energy</strong> by <strong>25%</strong>",
maxCount: 1,
count: 0,
allowed() {
@@ -232,16 +232,16 @@ const mod = {
},
{
name: "Ψ(t) collapse",
description: "<strong>33%</strong> decreased <strong>delay</strong> after firing<br>if you have no <strong class='color-r'>rerolls</strong>",
description: "<strong>40%</strong> decreased <strong>delay</strong> after firing<br>if you have no <strong class='color-r'>rerolls</strong>",
maxCount: 1,
count: 0,
allowed() {
return powerUps.reroll.rerolls === 0
return powerUps.reroll.rerolls === 0 && !mod.manyWorlds
},
requires: "no rerolls",
effect() {
mod.isRerollHaste = true;
mod.rerollHaste = 0.666;
mod.rerollHaste = 0.6;
b.setFireCD();
},
remove() {
@@ -269,7 +269,7 @@ const mod = {
},
{
name: "auto-loading heuristics",
description: "<strong>20%</strong> decreased <strong>delay</strong> after firing",
description: "<strong>25%</strong> decreased <strong>delay</strong> after firing",
maxCount: 9,
count: 0,
allowed() {
@@ -277,7 +277,7 @@ const mod = {
},
requires: "",
effect() {
mod.fireRate *= 0.8
mod.fireRate *= 0.75
b.setFireCD();
},
remove() {
@@ -441,23 +441,6 @@ const mod = {
mod.laserBotCount = 0;
}
},
{
name: "plasma-bot",
description: "a bot uses <strong class='color-f'>energy</strong> to emit short range <strong>plasma</strong><br>plasma <strong class='color-d'>damages</strong> and <strong>pushes</strong> mobs",
maxCount: 1,
count: 0,
allowed() {
return mech.fieldUpgrades[mech.fieldMode].name === "plasma torch"
},
requires: "plasma torch",
effect() {
mod.plasmaBotCount++;
b.plasmaBot();
},
remove() {
mod.plasmaBotCount = 0;
}
},
{
name: "bot fabrication",
description: "anytime you collect <strong>4</strong> <strong class='color-r'>rerolls</strong><br>use them to build a random <strong>bot</strong>",
@@ -531,7 +514,7 @@ const mod = {
},
{
name: "bot replication",
description: "<strong>duplicate</strong> your permanent <strong>bots</strong><br>remove <strong>90%</strong> of your <strong class='color-g'>ammo</strong>",
description: "<strong>duplicate</strong> your permanent <strong>bots</strong><br>remove <strong>all</strong> of your <strong class='color-g'>ammo</strong>",
maxCount: 1,
count: 0,
// isNonRefundable: true,
@@ -542,9 +525,7 @@ const mod = {
effect() {
//remove ammo
for (let i = 0, len = b.guns.length; i < len; ++i) {
if (b.guns[i].ammo != Infinity) {
b.guns[i].ammo = Math.floor(b.guns[i].ammo * 0.1);
}
if (b.guns[i].ammo != Infinity) b.guns[i].ammo = 0;
}
game.updateGunHUD();
//double bots
@@ -577,9 +558,9 @@ const mod = {
maxCount: 1,
count: 0,
allowed() {
return true
return mech.harmReduction() < 1
},
requires: "",
requires: "some harm reduction",
effect() {
mod.isDroneOnDamage = true;
for (let i = 0; i < 4; i++) {
@@ -812,7 +793,7 @@ const mod = {
},
{
name: "waste energy recovery",
description: "regen <strong>6%</strong> of max <strong class='color-f'>energy</strong> every second<br>active for <strong>5 seconds</strong> after any mob <strong>dies</strong>",
description: "if a mob has <strong>died</strong> in the last <strong>5 seconds</strong><br>regen <strong>6%</strong> of max <strong class='color-f'>energy</strong> every second",
maxCount: 1,
count: 0,
allowed() {
@@ -828,7 +809,7 @@ const mod = {
},
{
name: "scrap recycling",
description: "<strong class='color-h'>heal</strong> up to <strong>1%</strong> of max health every second<br>active for <strong>5 seconds</strong> after any mob <strong>dies</strong>",
description: "if a mob has <strong>died</strong> in the last <strong>5 seconds</strong><br><strong class='color-h'>heal</strong> up to <strong>1%</strong> of max health every second",
maxCount: 1,
count: 0,
allowed() {
@@ -925,19 +906,19 @@ const mod = {
// }
// },
{
name: "recursive healing",
description: "<strong class='color-h'>healing</strong> <strong>power ups</strong> trigger <strong>1</strong> more time",
maxCount: 9,
name: "adiabatic healing",
description: "<strong class='color-h'>heal</strong> <strong>power ups</strong> are <strong>100%</strong> more effective",
maxCount: 3,
count: 0,
allowed() {
return (mech.health < 0.7 || build.isCustomSelection) && !mod.isEnergyHealth
},
requires: "not mass-energy equivalence",
effect() {
mod.recursiveHealing += 1
mod.largerHeals++;
},
remove() {
mod.recursiveHealing = 1;
mod.largerHeals = 1;
}
},
{
@@ -1147,9 +1128,9 @@ const mod = {
maxCount: 1,
count: 0,
allowed() {
return !mod.isSuperDeterminism
return !mod.isSuperDeterminism && !mod.isRerollHaste
},
requires: "not superdeterminism",
requires: "not superdeterminism or Ψ(t) collapse",
effect: () => {
mod.manyWorlds = true;
},
@@ -2062,6 +2043,23 @@ const mod = {
mod.isPlasmaRange = 1;
}
},
{
name: "plasma-bot",
description: "a bot uses <strong class='color-f'>energy</strong> to emit short range <strong>plasma</strong><br>plasma <strong class='color-d'>damages</strong> and <strong>pushes</strong> mobs",
maxCount: 1,
count: 0,
allowed() {
return mech.fieldUpgrades[mech.fieldMode].name === "plasma torch"
},
requires: "plasma torch",
effect() {
mod.plasmaBotCount++;
b.plasmaBot();
},
remove() {
mod.plasmaBotCount = 0;
}
},
{
name: "degenerate matter",
description: "reduce <strong class='color-harm'>harm</strong> by <strong>40%</strong><br>while <strong>negative mass field</strong> is active",
@@ -2361,7 +2359,7 @@ const mod = {
isDroneOnDamage: null,
isAcidDmg: null,
isAnnihilation: null,
recursiveHealing: null,
largerHeals: null,
squirrelFx: null,
isCrit: null,
bayesian: null,

View File

@@ -454,27 +454,21 @@ const mech = {
return dmg
},
damage(dmg) {
// , noTransition = false
mech.lastHarmCycle = mech.cycle
if (mod.isDroneOnDamage) { //chance to build a drone on damage from mod
const len = (dmg - 0.06 * Math.random()) * 40
for (let i = 0; i < len; i++) {
if (Math.random() < 0.5) b.drone() //spawn drone
}
}
if (mod.isEnergyHealth) {
mech.energy -= dmg;
if (mech.energy < 0 || isNaN(mech.energy)) {
if (mod.isDeathAvoid && powerUps.reroll.rerolls) { //&& Math.random() < 0.5
mech.energy -= dmg * 1.2; //20% extra damage for energy as health for balance reasons
if (mech.energy < 0 || isNaN(mech.energy)) { //taking deadly damage
if (mod.isDeathAvoid && powerUps.reroll.rerolls) {
powerUps.reroll.changeRerolls(-1)
mech.energy = mech.maxEnergy
// if (mech.energy < 0.05) mech.energy = 0.05
mech.immuneCycle = mech.cycle + 120 //disable this.immuneCycle bonus seconds
game.makeTextLog(`<span style='font-size:115%;'> <strong>death</strong> avoided<br><strong>1/${powerUps.reroll.rerolls}</strong> <strong class='color-r'>rerolls</strong> consumed</span>`, 420)
game.wipe = function () { //set wipe to have trails
ctx.fillStyle = "rgba(255,255,255,0.03)";
ctx.fillRect(0, 0, canvas.width, canvas.height);
@@ -486,7 +480,7 @@ const mech = {
}, 2000);
return;
} else {
} else { //death
mech.health = 0;
mech.energy = 0;
mech.death();

View File

@@ -106,12 +106,11 @@ const powerUps = {
name: "heal",
color: "#0eb",
size() {
return 40 * Math.sqrt(0.1 + Math.random() * 0.5);
return 40 * (game.healScale ** 0.25) * Math.sqrt(mod.largerHeals) * Math.sqrt(0.1 + Math.random() * 0.5); //(game.healScale ** 0.25) gives a smaller radius as heal scale goes down
},
effect() {
if (!mod.isEnergyHealth && mech.alive) {
let heal = 0
for (let i = 0; i < mod.recursiveHealing; i++) heal += ((this.size / 40) ** 2)
const heal = mod.largerHeals * (this.size / 40 / Math.sqrt(mod.largerHeals) / (game.healScale ** 0.25)) ** 2 //heal scale is undone here because heal scale is properly affected on mech.addHealth()
if (heal > 0) {
game.makeTextLog("<div class='circle heal'></div> &nbsp; <span style='font-size:115%;'> <strong style = 'letter-spacing: 2px;'>heal</strong> " + (Math.min(mech.maxHealth - mech.health, heal) * game.healScale * 100).toFixed(0) + "%</span>", 300)
mech.addHealth(heal);
@@ -432,7 +431,7 @@ const powerUps = {
if (game.difficultyMode < 2) { //easy and normal mode
powerUps.randomPowerUpCounter += 0.5;
} else if (game.difficultyMode === 3) { //hard mode
} else if (game.difficultyMode === 2) { //hard mode
powerUps.randomPowerUpCounter += 1;
} else { //why mode
powerUps.randomPowerUpCounter += 1.33;