unified field theory

unified field theory doesn't require research to cycle fields

game resets after beating final boss (in 20s)
This commit is contained in:
landgreen
2021-01-26 07:28:18 -08:00
parent 829cf134ef
commit e4acaca31c
11 changed files with 191 additions and 122 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -2211,7 +2211,7 @@ const b = {
bullet[me].dmg = tech.isNailRadiation ? 0 : dmg
bullet[me].beforeDmg = function(who) { //beforeDmg is rewritten with ice crystal tech
if (tech.isNailRadiation) mobs.statusDoT(who, dmg * (tech.isFastRadiation ? 2.6 : 0.65), tech.isSlowRadiation ? 240 : (tech.isFastRadiation ? 30 : 120)) // one tick every 30 cycles
if (tech.isNailCrit && !who.shield && Vector.dot(Vector.normalise(Vector.sub(who.position, this.position)), Vector.normalise(this.velocity)) > 0.97) {
if (tech.isNailCrit && !who.shield && Vector.dot(Vector.normalise(Vector.sub(who.position, this.position)), Vector.normalise(this.velocity)) > 0.975) {
b.explosion(this.position, 150 + 30 * Math.random()); //makes bullet do explosive damage at end
}
};
@@ -2922,7 +2922,7 @@ const b = {
}
}
if (!immune) {
if (tech.isNailCrit && !who.shield && Vector.dot(Vector.normalise(Vector.sub(who.position, this.position)), Vector.normalise(this.velocity)) > 0.97) {
if (tech.isNailCrit && !who.shield && Vector.dot(Vector.normalise(Vector.sub(who.position, this.position)), Vector.normalise(this.velocity)) > 0.975) {
b.explosion(this.position, 220 + 30 * Math.random()); //makes bullet do explosive damage at end
}
this.immuneList.push(who.id)
@@ -2984,7 +2984,7 @@ const b = {
});
bullet[me].endCycle = simulation.cycle + 180
bullet[me].beforeDmg = function(who) { //beforeDmg is rewritten with ice crystal tech
if (tech.isNailCrit && !who.shield && Vector.dot(Vector.normalise(Vector.sub(who.position, this.position)), Vector.normalise(this.velocity)) > 0.97) {
if (tech.isNailCrit && !who.shield && Vector.dot(Vector.normalise(Vector.sub(who.position, this.position)), Vector.normalise(this.velocity)) > 0.975) {
b.explosion(this.position, 300 + 30 * Math.random()); //makes bullet do explosive damage at end
}
if (tech.isNailRadiation) mobs.statusDoT(who, 7 * (tech.isFastRadiation ? 12 : 0.3), tech.isSlowRadiation ? 240 : (tech.isFastRadiation ? 30 : 120)) // one tick every 30 cycles
@@ -3036,7 +3036,7 @@ const b = {
if (tech.isIceCrystals) {
bullet[bullet.length - 1].beforeDmg = function(who) {
mobs.statusSlow(who, 30)
if (tech.isNailCrit && !who.shield && Vector.dot(Vector.normalise(Vector.sub(who.position, this.position)), Vector.normalise(this.velocity)) > 0.97) {
if (tech.isNailCrit && !who.shield && Vector.dot(Vector.normalise(Vector.sub(who.position, this.position)), Vector.normalise(this.velocity)) > 0.975) {
b.explosion(this.position, 150 + 30 * Math.random()); //makes bullet do explosive damage at end
}
};

View File

@@ -232,7 +232,7 @@ const build = {
</span>
&nbsp; &nbsp; &nbsp; &nbsp; ${tech.tech[i].name} ${isCount}</div>${tech.tech[i].description}</div></div>`
} else if (tech.tech[i].isLore) {
text += `<div class="pause-grid-module"><div class="grid-title"><div class="circle-grid lore"></div> &nbsp; ${tech.tech[i].name} ${isCount}</div>${tech.tech[i].description}</div></div>`
text += `<div class="pause-grid-module"><div class="grid-title lore-text"><div class="circle-grid lore"></div> &nbsp; ${tech.tech[i].name} ${isCount}</div>${tech.tech[i].description}</div></div>`
} else {
text += `<div class="pause-grid-module"><div class="grid-title"><div class="circle-grid tech"></div> &nbsp; ${tech.tech[i].name} ${isCount}</div>${tech.tech[i].description}</div></div>`
}

View File

@@ -52,8 +52,9 @@ const level = {
// level.stronghold() //fan level
// for (let i = 0; i < 150; i++) tech.addLoreTechToPool();
// powerUps.directSpawn(simulation.mouseInGame.x, simulation.mouseInGame.y, "tech");
// tech.giveTech("undefined")
// lore.techCount = 1
// lore.techCount = 10
// localSettings.loreCount = 1;
// simulation.isCheating = true;
// localSettings.loreCount = undefined;
@@ -376,12 +377,12 @@ const level = {
powerUps.spawn(3350, -75, "ammo");
powerUps.spawn(3925, -50, "ammo");
powerUps.spawn(4550, -75, "ammo");
powerUps.spawn(5225, -50, "ammo");
powerUps.spawn(5475, -350, "ammo");
powerUps.spawn(5625, -350, "ammo");
powerUps.spawn(5575, -425, "ammo");
powerUps.spawn(5550, -400, "ammo");
powerUps.spawn(5575, -425, "ammo");
powerUps.spawn(5025, -50, "ammo");
powerUps.spawn(4975, -350, "ammo");
powerUps.spawn(5125, -350, "ammo");
powerUps.spawn(5075, -425, "ammo");
powerUps.spawn(5050, -400, "ammo");
powerUps.spawn(5075, -425, "ammo");
spawn.mapRect(-1950, 0, 8200, 1800); //ground
spawn.mapRect(-1950, -1500, 1800, 1900); //left wall
@@ -396,7 +397,7 @@ const level = {
spawn.mapRect(5400, -300, 400, 400); //right wall
spawn.mapRect(5700, -3300, 1800, 5100); //right wall
spawn.mapRect(level.exit.x, level.exit.y + 20, 100, 100); //exit bump
spawn.mapRect(5425, -650, 375, 450); //blocking exit
},
gauntlet() {
level.bossKilled = true; //if there is no boss this needs to be true to increase levels

View File

@@ -897,7 +897,7 @@ const m = {
m.calculateFieldThreshold(); //run calculateFieldThreshold after setting fieldArc, used for powerUp grab and mobPush with lookingAt(mob)
m.isBodiesAsleep = true;
m.wakeCheck();
m.setMaxEnergy();
// m.setMaxEnergy();
m.hole = {
isOn: false,
isReady: true,

View File

@@ -327,7 +327,7 @@ const powerUps = {
&nbsp; &nbsp; &nbsp; &nbsp; ${tech.tech[choose].name} ${isCount}</div>${tech.tech[choose].description}</div></div>`
} else if (tech.tech[choose].isLore) {
text += `<div class="choose-grid-module" onclick="powerUps.choose('tech',${choose})"><div class="grid-title"><div class="circle-grid lore"></div> &nbsp; ${tech.tech[choose].name} ${isCount}</div>${tech.tech[choose].description}</div>`
text += `<div class="choose-grid-module" onclick="powerUps.choose('tech',${choose})"><div class="grid-title lore-text"><div class="circle-grid lore"></div> &nbsp; ${tech.tech[choose].name} ${isCount}</div>${tech.tech[choose].description}</div>`
} else {
text += `<div class="choose-grid-module" onclick="powerUps.choose('tech',${choose})"><div class="grid-title"><div class="circle-grid tech"></div> &nbsp; ${tech.tech[choose].name} ${isCount}</div>${tech.tech[choose].description}</div>`
}

View File

@@ -358,13 +358,7 @@ const simulation = {
}
},
switchGun() {
if (tech.isCrouchAmmo) tech.isCrouchAmmo = 1 //this prevents hacking the tech by switching guns
b.activeGun = b.inventory[b.inventoryGun];
simulation.updateGunHUD();
simulation.boldActiveGunHUD();
// m.drop();
if (tech.isGunSwitchField && powerUps.research.count > 0) {
powerUps.research.changeRerolls(-1)
if (tech.isGunSwitchField) {
const energy = m.energy
m.setField((m.fieldMode === m.fieldUpgrades.length - 1) ? 1 : m.fieldMode + 1) //cycle to next field
m.energy = energy //field swap sets energy to max, this undoes that
@@ -373,14 +367,17 @@ const simulation = {
for (let i = tech.tech.length - 1; i > 0; i--) {
if (tech.tech[i].name === "unified field theory") {
const index = (m.fieldMode === m.fieldUpgrades.length - 1) ? 1 : m.fieldMode + 1
tech.tech[i].description = `after switching <strong>guns</strong><br>use a <strong class='color-r'>research</strong> to cycle your <strong class='color-f'>field</strong>
tech.tech[i].description = `switching <strong class='color-g'>guns</strong> also cycles your <strong class='color-f'>field</strong>
<br>(next <strong class='color-f'>field</strong>: ${m.fieldUpgrades[index].name})`
break
}
}
}
if (tech.isCrouchAmmo) tech.isCrouchAmmo = 1 //this prevents hacking the tech by switching guns
b.activeGun = b.inventory[b.inventoryGun];
simulation.updateGunHUD();
simulation.boldActiveGunHUD();
// m.drop();
},
zoom: null,
zoomScale: 1000,
@@ -587,6 +584,7 @@ const simulation = {
m.holdingTarget = null
//set to default field
m.setMaxEnergy();
m.fieldMode = 0;
// simulation.makeTextLog(`${simulation.SVGrightMouse}<strong style='font-size:30px;'> ${m.fieldUpgrades[m.fieldMode].name}</strong><br><span class='faded'></span><br>${m.fieldUpgrades[m.fieldMode].description}`, 600);
// simulation.makeTextLog(`

View File

@@ -99,11 +99,32 @@ const spawn = {
// spawn.shield(me, x, y, 1);
me.onDeath = function() {
//add lore level as next level if player took lore tech earlier in the game
simulation.makeTextLog(`simulation.end()`);
if (lore.techCount > 9 && !simulation.isCheating) {
level.levels.push("null")
level.exit.x = 5500;
level.exit.y = -330;
simulation.makeTextLog(`level.levels.push("null")`) // <br>${powerUps.research.count}
//remove block map element
Matter.World.remove(engine.world, map[map.length - 1]);
map.splice(map.length - 1, 1);
simulation.draw.setPaths(); //redraw map draw path
} else {
//reset game
let delay = 1000
for (let i = 20; i > 0; i--) {
setTimeout(function() {
simulation.makeTextLog(`delay = ${i*1000}`);
}, delay);
delay += 1000
}
delay += 1000
setTimeout(function() {
simulation.makeTextLog(`World.clear(engine.world)`);
setTimeout(function() { m.death() }, 1000);
}, delay);
}
//ramp up damage
for (let i = 0; i < 3; i++) level.difficultyIncrease(simulation.difficultyMode)

View File

@@ -120,7 +120,7 @@ const tech = {
},
tech: [{
name: "integrated armament",
description: "increase <strong class='color-d'>damage</strong> by <strong>25%</strong><br>your inventory can only hold <strong>1 gun</strong>",
description: "increase <strong class='color-d'>damage</strong> by <strong>25%</strong><br>your inventory can only hold 1 <strong class='color-g'>gun</strong>",
maxCount: 1,
count: 0,
allowed() {
@@ -243,7 +243,7 @@ const tech = {
},
{
name: "logistics",
description: "<strong class='color-g'>ammo</strong> power ups give <strong>200%</strong> <strong class='color-g'>ammo</strong><br>but <strong class='color-g'>ammo</strong> is only added to your <strong>current gun</strong>",
description: "<strong class='color-g'>ammo</strong> power ups give <strong>200%</strong> <strong class='color-g'>ammo</strong><br>but <strong class='color-g'>ammo</strong> is only added to your current <strong class='color-g'>gun</strong>",
maxCount: 1,
count: 0,
allowed() {
@@ -1893,6 +1893,38 @@ const tech = {
tech.isMineDrop = false;
}
},
{
name: "unified field theory",
description: "",
maxCount: 1,
count: 0,
allowed() {
return (b.inventory.length > 1) || build.isExperimentSelection && !tech.isSuperDeterminism
},
requires: "at least 2 guns, not superdeterminism",
effect() {
tech.isGunSwitchField = true;
for (let i = tech.tech.length - 1; i > 0; i--) {
if (tech.tech[i].name === "unified field theory") {
const index = (m.fieldMode === m.fieldUpgrades.length - 1) ? 1 : m.fieldMode + 1
tech.tech[i].description = `switching <strong class='color-g'>guns</strong> also cycles your <strong class='color-f'>field</strong>
<br>(next <strong class='color-f'>field</strong>: ${m.fieldUpgrades[index].name})`
break
}
}
},
remove() {
tech.isGunSwitchField = false;
for (let i = tech.tech.length - 1; i > 0; i--) {
if (tech.tech[i].name === "unified field theory") {
const index = (m.fieldMode === m.fieldUpgrades.length - 1) ? 1 : m.fieldMode + 1
tech.tech[i].description = `switching <strong class='color-g'>guns</strong> also cycles your <strong class='color-f'>field</strong>
<br>(next <strong class='color-f'>field</strong>: ${m.fieldUpgrades[index].name})`
break
}
}
}
},
{
name: "cardinality",
description: "<strong class='color-m'>tech</strong>, <strong class='color-f'>fields</strong>, and <strong class='color-g'>guns</strong> have <strong>5</strong> <strong>choices</strong>",
@@ -1936,9 +1968,9 @@ const tech = {
count: 0,
isNonRefundable: true,
allowed() {
return tech.isDeterminism && !tech.manyWorlds
return tech.isDeterminism && !tech.manyWorlds && !tech.isGunSwitchField
},
requires: "determinism",
requires: "determinism, not unified field theory",
effect: () => {
tech.isSuperDeterminism = true;
for (let i = 0; i < 7; i++) { //if you change the six also change it in Born rule
@@ -1985,36 +2017,6 @@ const tech = {
tech.manyWorlds = false;
}
},
{
name: "unified field theory",
description: "after switching <strong>guns</strong><br>use a <strong class='color-r'>research</strong> to cycle your <strong class='color-f'>field</strong>",
maxCount: 1,
count: 0,
allowed() {
return (powerUps.research.count > 1 && b.inventory.length > 1) || build.isExperimentSelection
},
requires: "at least 2 guns, and 2 research",
effect() {
tech.isGunSwitchField = true;
for (let i = tech.tech.length - 1; i > 0; i--) {
if (tech.tech[i].name === "unified field theory") {
const index = (m.fieldMode === m.fieldUpgrades.length - 1) ? 1 : m.fieldMode + 1
tech.tech[i].description = `after switching <strong>guns</strong><br>use a <strong class='color-r'>research</strong> to cycle your <strong class='color-f'>field</strong>
<br>(next <strong class='color-f'>field</strong>: ${m.fieldUpgrades[index].name})`
break
}
}
},
remove() {
tech.isGunSwitchField = false;
for (let i = tech.tech.length - 1; i > 0; i--) {
if (tech.tech[i].name === "unified field theory") {
tech.tech[i].description = "after switching <strong>guns</strong><br>use a <strong class='color-r'>research</strong> to cycle your <strong class='color-f'>field</strong>"
break
}
}
}
},
{
name: "renormalization",
description: "using a <strong class='color-r'>research</strong> for <strong>any</strong> purpose<br>has a <strong>37%</strong> chance to spawn a <strong class='color-r'>research</strong>",
@@ -2042,9 +2044,7 @@ const tech = {
requires: "not determinism, at least 3 research",
effect() {
tech.isBanish = true
for (let i = 0; i < 4; i++) {
powerUps.spawn(m.pos.x, m.pos.y, "research", false);
}
for (let i = 0; i < 4; i++) powerUps.spawn(m.pos.x, m.pos.y, "research", false);
},
remove() {
tech.isBanish = false

150
style.css
View File

@@ -664,55 +664,6 @@ summary {
float: right;
}
.lore {
animation: bgColor 6s linear infinite;
}
@keyframes bgColor {
0% {
background-color: rgb(255, 0, 0)
}
10% {
background-color: rgb(255, 154, 0)
}
20% {
background-color: rgb(208, 222, 33)
}
30% {
background-color: rgb(79, 220, 74)
}
40% {
background-color: rgb(63, 218, 216)
}
50% {
background-color: rgb(47, 201, 226)
}
60% {
background-color: rgb(28, 127, 238)
}
70% {
background-color: rgb(95, 21, 242)
}
80% {
background-color: rgb(186, 12, 248)
}
90% {
background-color: rgb(251, 7, 217)
}
100% {
background-color: rgba(255, 0, 0)
}
}
.box {
padding: 3px 8px 3px 8px;
@@ -737,6 +688,107 @@ summary {
text-align: right;
}
.lore {
animation: bgColor 3.5s linear infinite;
}
.lore-text {
animation: textColor 3s linear infinite;
}
@keyframes bgColor {
0% {
background-color: rgb(63, 218, 216)
}
10% {
background-color: rgb(47, 201, 226)
}
20% {
background-color: rgb(28, 127, 238)
}
30% {
background-color: rgb(95, 21, 242)
}
40% {
background-color: rgb(186, 12, 248)
}
50% {
background-color: rgb(251, 7, 217)
}
60% {
background-color: rgba(255, 0, 0)
}
70% {
background-color: rgb(255, 0, 0)
}
80% {
background-color: rgb(255, 154, 0)
}
90% {
background-color: rgb(208, 222, 33)
}
100% {
background-color: rgb(79, 220, 74)
}
}
@keyframes textColor {
0% {
color: rgb(63, 218, 216)
}
10% {
color: rgb(47, 201, 226)
}
20% {
color: rgb(28, 127, 238)
}
30% {
color: rgb(95, 21, 242)
}
40% {
color: rgb(186, 12, 248)
}
50% {
color: rgb(251, 7, 217)
}
60% {
color: rgba(255, 0, 0)
}
70% {
color: rgb(255, 0, 0)
}
80% {
color: rgb(255, 154, 0)
}
90% {
color: rgb(208, 222, 33)
}
100% {
color: rgb(79, 220, 74)
}
}
/* #console {
font-family: monospace;
font-size: 1.5em;

View File

@@ -1,10 +1,8 @@
******************************************************** NEXT PATCH ********************************************************
iridium-192: now has a wider explosions range and no knock back
nail gun: irradiated nails do about 33% more damage over 2 seconds
nail gun rivet fire rate is 10% slower
nail gun: needles do 10% less damage, but they fire 10% faster
needle tech: ceramic needles - needles pierce shields
unified field theory doesn't require research to cycle fields
game resets after beating final boss (in 20s)
******************************************************** BUGS ********************************************************
@@ -36,9 +34,6 @@ give undefined tech different effects at different localSettings.loreCount value
3. 1/1: reduce max energy and take more harm
4. 1/1: add 5? more levels
tech needles: can pass through shields
or just do extra damage
lore add console command for unlocking testing mode
rename ?
@@ -52,7 +47,6 @@ mechanic: use gun swap as an active ability
push away nearby mobs, but drain energy
produce ammo, but take 1 damage
rewind, still uses energy
cycle to next field, uses a reroll
bot: ice blast, long CD AOE freeze
@@ -400,8 +394,11 @@ chapter 5: no need to fight?
what is special about the null level
why can the player hear the scientists in there?
the wires are the direct unprocessed input to the player's neural net
maybe... player must make a choice? fight or friend?
maybe... player must make a choice?
keep fighting
exit the simulation
enter real world
enter console command to close tab?