brainstorming

powerUpBoss no longer gets invulnerability after death
  but powerUpBossBaby still has it

tech: brainstorming - randomize your tech choice menu every 2s for 10s
JUNK tech: brainstorm - randomize your tech choice menu every 0.5s for 10s
This commit is contained in:
landgreen
2021-12-16 05:34:04 -08:00
parent bd87000277
commit 1a5a395992
6 changed files with 142 additions and 55 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -20,7 +20,7 @@ const level = {
// b.giveGuns("drones")
// b.giveGuns("nail gun")
// b.giveGuns("harpoon")
// tech.giveTech("needle gun")
// tech.giveTech("brainstorming")
// tech.giveTech("nanowires")
// tech.giveTech("relativistic momentum")
// for (let i = 0; i < 2; i++) tech.giveTech("refractory metal")
@@ -2344,8 +2344,8 @@ const level = {
// spawn.launcherBoss(3200, -500)
// spawn.laserTargetingBoss(1700, -500)
spawn.powerUpBoss(3200, -500)
spawn.powerUpBossBaby(3200, -500)
// spawn.powerUpBoss(3200, -500)
// spawn.powerUpBossBaby(3200, -500)
// spawn.snakeBoss(1700, -500)
// spawn.streamBoss(3200, -500)
// spawn.pulsarBoss(1700, -500)
@@ -2367,7 +2367,7 @@ const level = {
// for (let i = 0; i < 10; ++i) spawn.bodyRect(1600 + 5, -500, 30, 40);
// for (let i = 0; i < 5; i++) spawn.focuser(1900, -500)
spawn.pulsar(1900, -500)
// spawn.pulsar(1900, -500)
// spawn.shield(mob[mob.length - 1], 1900, -500, 1);
// mob[mob.length - 1].isShielded = true
// spawn.nodeGroup(1200, 0, "grenadier")

View File

@@ -734,7 +734,28 @@ const powerUps = {
}
}
if (tech.isBrainstorm && !tech.isBrainstormActive && !simulation.isChoosing) {
tech.isBrainstormActive = true
let count = 0
requestAnimationFrame(cycle);
function cycle() {
count++
if (count < 600 && simulation.isChoosing) {
if (!(count % tech.brainStormDelay)) {
powerUps.tech.effect();
document.getElementById("choose-grid").style.pointerEvents = "auto"; //turn off the normal 500ms delay
document.body.style.cursor = "auto";
document.getElementById("choose-grid").style.transitionDuration = "0s";
}
requestAnimationFrame(cycle);
} else {
tech.isBrainstormActive = false
}
}
}
//add in research button or pseudoscience button
if (tech.isJunkResearch && powerUps.research.currentRerollCount < 3) {
tech.junkResearchNumber = Math.floor(5 * Math.random())
text += `<div class="choose-grid-module" onclick="powerUps.research.use('tech')"><div class="grid-title"> <span style="position:relative;">`
@@ -747,8 +768,26 @@ const powerUps = {
text += `</span>&nbsp; <span class='research-select'>${tech.isResearchReality?"<span class='alt'>alternate reality</span>": "research"}</span></div></div>`
}
// if (tech.isBrainstorm && tech.isBrainstormActive < 4) {
// setTimeout(() => {
// if (simulation.isChoosing) {
// tech.isBrainstormActive++
// powerUps.tech.effect();
// //turn off the normal 500ms delay
// document.getElementById("choose-grid").style.pointerEvents = "auto";
// document.body.style.cursor = "auto";
// document.getElementById("choose-grid").style.transitionDuration = "0s";
// } else {
// tech.isBrainstormActive = 0;
// }
// }, 1000);
// } else {
// tech.isBrainstormActive = 0;
// }
document.getElementById("choose-grid").innerHTML = text
powerUps.showDraft();
} else if (tech.isBanish) {
for (let i = 0, len = tech.tech.length; i < len; i++) {
if (tech.tech[i].name === "decoherence") powerUps.ejectTech(i)

View File

@@ -1269,7 +1269,7 @@ const spawn = {
me.isBoss = true;
me.frictionAir = 0.01
me.seeAtDistance2 = 1000000;
me.accelMag = 0.0005 * simulation.accelScale;
me.accelMag = 0.0002 + 0.0004 * simulation.accelScale;
Matter.Body.setDensity(me, 0.00035); //normal is 0.001
me.collisionFilter.mask = cat.bullet | cat.player //| cat.body
me.memory = Infinity;
@@ -1284,11 +1284,11 @@ const spawn = {
me.foundPlayer();
}
me.damageReduction = 0.25 / (tech.isScaleMobsWithDuplication ? 1 + tech.duplicationChance() : 1)
me.isInvulnerable = true
me.startingDamageReduction = me.damageReduction
me.damageReduction = 0
me.invulnerabilityCountDown = 60 + simulation.difficulty * 2
me.damageReduction = 0.2 / (tech.isScaleMobsWithDuplication ? 1 + tech.duplicationChance() : 1)
// me.isInvulnerable = true
// me.startingDamageReduction = me.damageReduction
// me.damageReduction = 0
// me.invulnerabilityCountDown = 60 + simulation.difficulty * 2
me.onHit = function() { //run this function on hitting player
if (powerUps.ejectTech()) {
@@ -1310,22 +1310,22 @@ const spawn = {
for (let i = 0; i < powerUp.length; i++) powerUp[i].collisionFilter.mask = cat.map | cat.powerUp
};
me.do = function() {
if (this.isInvulnerable) {
if (this.invulnerabilityCountDown > 0) {
this.invulnerabilityCountDown--
ctx.beginPath();
let vertices = this.vertices;
ctx.moveTo(vertices[0].x, vertices[0].y);
for (let j = 1; j < vertices.length; j++) ctx.lineTo(vertices[j].x, vertices[j].y);
ctx.lineTo(vertices[0].x, vertices[0].y);
ctx.lineWidth = 20;
ctx.strokeStyle = "rgba(255,255,255,0.7)";
ctx.stroke();
} else {
this.isInvulnerable = false
this.damageReduction = this.startingDamageReduction
}
}
// if (this.isInvulnerable) {
// if (this.invulnerabilityCountDown > 0) {
// this.invulnerabilityCountDown--
// ctx.beginPath();
// let vertices = this.vertices;
// ctx.moveTo(vertices[0].x, vertices[0].y);
// for (let j = 1; j < vertices.length; j++) ctx.lineTo(vertices[j].x, vertices[j].y);
// ctx.lineTo(vertices[0].x, vertices[0].y);
// ctx.lineWidth = 20;
// ctx.strokeStyle = "rgba(255,255,255,0.7)";
// ctx.stroke();
// } else {
// this.isInvulnerable = false
// this.damageReduction = this.startingDamageReduction
// }
// }
this.stroke = `hsl(0,0%,${80 + 25 * Math.sin(simulation.cycle * 0.01)}%)`
//steal all power ups
for (let i = 0; i < Math.min(powerUp.length, this.vertices.length); i++) {

View File

@@ -2093,7 +2093,7 @@ const tech = {
requires: "not mass-energy",
effect() {
tech.isPiezo = true;
if (simulation.isTextLogOpen) m.energy += 20.48;
// if (simulation.isTextLogOpen) m.energy += 20.48;
},
remove() {
tech.isPiezo = false;
@@ -2485,8 +2485,8 @@ const tech = {
description: "increase <strong class='color-d'>damage</strong> by <strong>5%</strong><br>for every <strong>10</strong> <strong class='color-h'>health</strong> below <strong>100</strong>",
maxCount: 1,
count: 0,
frequency: 2,
frequencyDefault: 2,
frequency: 1,
frequencyDefault: 1,
allowed() {
return m.health < 0.6 || build.isExperimentSelection
},
@@ -2521,8 +2521,8 @@ const tech = {
description: "<strong class='color-h'>heal</strong> for <strong>3%</strong> of <strong class='color-d'>damage</strong> done<br>take <strong>10%</strong> more <strong class='color-harm'>harm</strong>",
maxCount: 9,
count: 0,
frequency: 2,
frequencyDefault: 2,
frequency: 1,
frequencyDefault: 1,
isHealTech: true,
allowed() {
return !tech.isEnergyHealth
@@ -2789,12 +2789,12 @@ const tech = {
description: `<strong class='color-r'>researched</strong> or <strong>canceled</strong> <strong class='color-m'>tech</strong> won't <strong>reoccur</strong> <br>spawn ${powerUps.orb.research(9)}`,
maxCount: 1,
count: 0,
frequency: 2,
frequencyDefault: 2,
frequency: 1,
frequencyDefault: 1,
allowed() {
return (powerUps.research.count > 2 || build.isExperimentSelection) && !tech.isSuperDeterminism
return !tech.isSuperDeterminism
},
requires: "not determinism, at least 3 research",
requires: "not superdeterminism",
effect() {
tech.isBanish = true
for (let i = 0; i < 9; i++) powerUps.spawn(m.pos.x + 40 * (Math.random() - 0.5), m.pos.y + 40 * (Math.random() - 0.5), "research", false);
@@ -2815,9 +2815,9 @@ const tech = {
frequency: 2,
frequencyDefault: 2,
allowed() {
return (powerUps.research.count > 2 || build.isExperimentSelection) && !tech.isSuperDeterminism
return (powerUps.research.count > 3 || build.isExperimentSelection) && !tech.isSuperDeterminism
},
requires: "at least 3 research and not superdeterminism",
requires: "at least 4 research and not superdeterminism",
effect() {
tech.renormalization = true;
},
@@ -2873,9 +2873,9 @@ const tech = {
frequency: 2,
frequencyDefault: 2,
allowed() {
return powerUps.research.count > 3 || build.isExperimentSelection
return powerUps.research.count > 5 || build.isExperimentSelection
},
requires: "at least 4 research",
requires: "at least 6 research",
effect() {
tech.isRerollDamage = true;
},
@@ -2901,6 +2901,27 @@ const tech = {
tech.isJunkResearch = false;
}
},
{
name: "brainstorming",
description: "the <strong class='color-m'>tech</strong> choice menu <strong>randomizes</strong><br>every <strong>2</strong> seconds for <strong>10</strong> seconds",
maxCount: 1,
count: 0,
frequency: 1,
frequencyDefault: 1,
allowed() {
return true
},
requires: "",
effect() {
tech.isBrainstorm = true
tech.isBrainstormActive = false
tech.brainStormDelay = 120
},
remove() {
tech.isBrainstorm = false
tech.isBrainstormActive = false
}
},
{
name: "Born rule",
description: "<strong>remove</strong> all current <strong class='color-m'>tech</strong><br>spawn new <strong class='color-m'>tech</strong> to replace them",
@@ -3352,9 +3373,9 @@ const tech = {
isNonRefundable: true,
isBadRandomOption: true,
allowed() {
return (tech.totalCount > 3) && !tech.isSuperDeterminism
return (tech.totalCount > 3) && tech.duplicationChance() > 0 && !tech.isSuperDeterminism
},
requires: "NOT EXPERIMENT MODE, at least 4 tech, not superdeterminism",
requires: "NOT EXPERIMENT MODE, some duplication, at least 4 tech, not superdeterminism",
effect: () => {
const removeTotal = tech.removeTech()
for (let i = 0; i < removeTotal + 1; i++) powerUps.spawn(m.pos.x + 60 * (Math.random() - 0.5), m.pos.y + 60 * (Math.random() - 0.5), "tech");
@@ -3628,7 +3649,7 @@ const tech = {
frequency: 2,
frequencyDefault: 2,
allowed() {
return (tech.isNeedles || tech.isNeedleShot) && !tech.isNeedleIce
return ((tech.haveGunCheck("nail gun") && tech.isNeedles) || (tech.isNeedleShot && tech.haveGunCheck("shotgun"))) && !tech.isNeedleIce
},
requires: "needle gun, needle-shot, not needle ice",
effect() {
@@ -7178,6 +7199,29 @@ const tech = {
// },
// remove() {}
// },
{
name: "brainstorm",
description: "the <strong class='color-m'>tech</strong> choice menu <strong>randomizes</strong><br>every <strong>0.5</strong> seconds for <strong>10</strong> seconds",
maxCount: 1,
count: 0,
frequency: 0,
frequencyDefault: 0,
isExperimentHide: true,
isJunk: true,
allowed() {
return true
},
requires: "",
effect() {
tech.isBrainstorm = true
tech.isBrainstormActive = false
tech.brainStormDelay = 30
},
remove() {
tech.isBrainstorm = false
tech.isBrainstormActive = false
}
},
{
name: "catabolysis",
description: `set your <strong>maximum</strong> <strong class='color-h'>health</strong> to <strong>1</strong><br><strong>double</strong> your current <strong class='color-ammo'>ammo</strong> <strong>10</strong> times`,
@@ -9116,5 +9160,8 @@ const tech = {
isWormholeMapIgnore: null,
isLessDamageReduction: null,
nailSize: null,
needleTunnel: null
needleTunnel: null,
isBrainstorm: null,
isBrainstormActive: null,
brainStormDelay: null
}

View File

@@ -1,15 +1,19 @@
******************************************************** NEXT PATCH **************************************************
powerUpBoss & powerUpBossBaby go invulnerable for a second after they die
powerUpBossBaby is even smaller, and a bit slower
growBoss goes invulnerable for a second after one of it dies
shieldingBoss makes shields that are 50% stronger, shieldingBoss has 40% lower health
powerUpBoss no longer gets invulnerability after death
but powerUpBossBaby still has it
tech: brainstorming - randomize your tech choice menu every 2s for 10s
JUNK tech: brainstorm - randomize your tech choice menu every 0.5s for 10s
******************************************************** TODO ********************************************************
tech: heal power ups spawn as research instead
research heals for 10 health
using research does 10 damage
tech: basic research - heal power ups spawn as research power ups instead, and using research heals you (needs to be pretty low, like 3% health)
tech: maintenance - heals no longer spawn, but using research heals you 100%
pulsar mobs retarget too easily
also they drift around too much
electric motors: increases movement speed and jump height, but jumping and moving costs energy
overwrite the key event listeners?
@@ -22,9 +26,6 @@ bug once: switching from shotgun to harpoon somehow set b.activeGun to not defi
quasarBoss: inverted pulsar boss that hits everything except where its aiming
pulsar mobs retarget too easily
also they drift around too much
intro map: diegeticly draw a mouse with field highlighted
also indicate space?
dynamically adjust drawing after picking up a gun
@@ -35,8 +36,8 @@ increase mass and movement speed at the same time
m.defaultMass = 4.5
m.definePlayerMass()
tech selection menu choices randomize every second
JUNK tech?
tech selection menu choices randomize every 1 second
cycles for 10 cycles before it stops cycling
new late game level that is easier if you can: platform well, jump high, immune to slime, wormhole through walls, fly fast
climb vertically to avoid rising slime