frequency
some tech now has 2x,3x,4x frequency of showing up (most tech is at 1x, a few are at 2x if they have a rare requirement to unlock) reworked junk and lore tech systems (might be some new bugs) tech that used to just summon a power up now also increases tech frequency removed the 4 perpetual techs maybe fixed immune boss bug on detours level
This commit is contained in:
28
js/bullet.js
28
js/bullet.js
@@ -3922,11 +3922,10 @@ const b = {
|
||||
ammoPack: 36,
|
||||
have: false,
|
||||
fire() {
|
||||
if (tech.foamFutureFire) {
|
||||
m.fireCDcycle = m.cycle + Math.floor((m.crouch ? 15 : 5) * b.fireCD); // cool down
|
||||
const radius = (m.crouch ? 10 + 5 * Math.random() : 4 + 6 * Math.random()) + (tech.isAmmoFoamSize && this.ammo < 300) * 12
|
||||
const SPEED = 18 - radius * 0.4;
|
||||
const dir = m.angle + 0.2 * (Math.random() - 0.5)
|
||||
const dir = m.angle + 0.15 * (Math.random() - 0.5)
|
||||
const velocity = {
|
||||
x: SPEED * Math.cos(dir),
|
||||
y: SPEED * Math.sin(dir)
|
||||
@@ -3935,35 +3934,22 @@ const b = {
|
||||
x: m.pos.x + 30 * Math.cos(m.angle),
|
||||
y: m.pos.y + 30 * Math.sin(m.angle)
|
||||
}
|
||||
if (tech.foamFutureFire) {
|
||||
simulation.drawList.push({ //add dmg to draw queue
|
||||
x: position.x,
|
||||
y: position.y,
|
||||
radius: 5,
|
||||
color: "rgba(0,0,0,0.1)",
|
||||
time: 18 * tech.foamFutureFire
|
||||
time: 15 * tech.foamFutureFire
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
if (!simulation.paused) {
|
||||
b.foam(position, velocity, radius)
|
||||
bullet[bullet.length - 1].damage = (1 + 1.53 * tech.foamFutureFire) * (tech.isFastFoam ? 0.048 : 0.012) //double damage
|
||||
b.foam(position, Vector.rotate(velocity, 0.5 * (Math.random() - 0.5)), radius)
|
||||
bullet[bullet.length - 1].damage = (1 + 1.43 * tech.foamFutureFire) * (tech.isFastFoam ? 0.048 : 0.012) //double damage
|
||||
}
|
||||
}, 300 * tech.foamFutureFire);
|
||||
|
||||
}, 250 * tech.foamFutureFire);
|
||||
} else {
|
||||
m.fireCDcycle = m.cycle + Math.floor((m.crouch ? 15 : 5) * b.fireCD); // cool down
|
||||
const radius = (m.crouch ? 10 + 5 * Math.random() : 4 + 6 * Math.random()) + (tech.isAmmoFoamSize && this.ammo < 300) * 12
|
||||
const SPEED = 18 - radius * 0.4;
|
||||
const dir = m.angle + 0.2 * (Math.random() - 0.5)
|
||||
const velocity = {
|
||||
x: SPEED * Math.cos(dir),
|
||||
y: SPEED * Math.sin(dir)
|
||||
}
|
||||
const position = {
|
||||
x: m.pos.x + 30 * Math.cos(m.angle),
|
||||
y: m.pos.y + 30 * Math.sin(m.angle)
|
||||
}
|
||||
b.foam(position, velocity, radius)
|
||||
b.foam(position, Vector.rotate(velocity, 0.5 * (Math.random() - 0.5)), radius)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -138,7 +138,7 @@ function collisionChecks(event) {
|
||||
y: mob[k].velocity.y - 8 * Math.sin(angle)
|
||||
});
|
||||
|
||||
if (tech.isAnnihilation && !mob[k].shield && !mob[k].isShielded && mob[k].dropPowerUp && m.energy > 0.34 * m.maxEnergy) {
|
||||
if (tech.isAnnihilation && !mob[k].shield && !mob[k].isShielded && !mob[k].isBoss && mob[k].dropPowerUp && m.energy > 0.34 * m.maxEnergy) {
|
||||
m.energy -= 0.33 * m.maxEnergy
|
||||
m.immuneCycle = 0; //player doesn't go immune to collision damage
|
||||
mob[k].death();
|
||||
|
||||
12
js/index.js
12
js/index.js
@@ -485,7 +485,9 @@ const build = {
|
||||
removeOne();
|
||||
}
|
||||
simulation.isCheating = true;
|
||||
tech.removeLoreTechFromPool();
|
||||
for (let i = 0, len = tech.tech.length; i < len; i++) {
|
||||
if (tech.tech[i].isLore) tech.tech[i].frequency = 0;
|
||||
}
|
||||
document.body.style.cursor = "none";
|
||||
document.body.style.overflow = "hidden"
|
||||
document.getElementById("experiment-grid").style.display = "none"
|
||||
@@ -766,7 +768,13 @@ window.addEventListener("keydown", function(event) {
|
||||
if (simulation.isConstructionMode) document.getElementById("construct").style.display = 'inline'
|
||||
if (!simulation.isCheating) {
|
||||
simulation.isCheating = true;
|
||||
tech.removeLoreTechFromPool();
|
||||
lore.techCount = 0;
|
||||
for (let i = 0, len = tech.tech.length; i < len; i++) {
|
||||
if (tech.tech[i].isLore) {
|
||||
tech.tech[i].frequency = 0;
|
||||
tech.tech[i].count = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
simulation.makeTextLog(
|
||||
`<table class="pause-table">
|
||||
|
||||
34
js/level.js
34
js/level.js
@@ -12,7 +12,7 @@ const level = {
|
||||
start() {
|
||||
if (level.levelsCleared === 0) { //this code only runs on the first level
|
||||
// simulation.enableConstructMode() //used to build maps in testing mode
|
||||
// level.difficultyIncrease(5)
|
||||
// level.difficultyIncrease(25)
|
||||
// simulation.zoomScale = 1000;
|
||||
// simulation.setZoom();
|
||||
// m.setField("nano-scale manufacturing")
|
||||
@@ -56,7 +56,6 @@ const level = {
|
||||
// level.basement(); //fan 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 = 7
|
||||
@@ -101,16 +100,16 @@ const level = {
|
||||
const len = Math.floor((m.maxHealth - m.health) / 0.5)
|
||||
for (let i = 0; i < len; i++) powerUps.spawn(player.position.x + 60 * (Math.random() - 0.5), player.position.y + 60 * (Math.random() - 0.5), "heal", false);
|
||||
}
|
||||
if (tech.isPerpetualReroll) powerUps.spawn(player.position.x + 60 * (Math.random() - 0.5), player.position.y + 60 * (Math.random() - 0.5), "research", false);
|
||||
if (tech.isPerpetualAmmo) {
|
||||
for (let i = 0; i < 2; i++) powerUps.spawn(player.position.x + 60 * (Math.random() - 0.5), player.position.y + 60 * (Math.random() - 0.5), "ammo", false);
|
||||
}
|
||||
if (tech.isPerpetualHeal) {
|
||||
for (let i = 0; i < 2; i++) powerUps.spawn(player.position.x + 60 * (Math.random() - 0.5), player.position.y + 60 * (Math.random() - 0.5), "heal", false);
|
||||
}
|
||||
if (tech.isPerpetualStun) {
|
||||
for (let i = 0; i < mob.length; i++) mobs.statusStun(mob[i], 780)
|
||||
}
|
||||
// if (tech.isPerpetualReroll) powerUps.spawn(player.position.x + 60 * (Math.random() - 0.5), player.position.y + 60 * (Math.random() - 0.5), "research", false);
|
||||
// if (tech.isPerpetualAmmo) {
|
||||
// for (let i = 0; i < 3; i++) powerUps.spawn(player.position.x + 60 * (Math.random() - 0.5), player.position.y + 60 * (Math.random() - 0.5), "ammo", false);
|
||||
// }
|
||||
// if (tech.isPerpetualHeal) {
|
||||
// for (let i = 0; i < 3; i++) powerUps.spawn(player.position.x + 60 * (Math.random() - 0.5), player.position.y + 60 * (Math.random() - 0.5), "heal", false);
|
||||
// }
|
||||
// if (tech.isPerpetualStun) {
|
||||
// for (let i = 0; i < mob.length; i++) mobs.statusStun(mob[i], 780)
|
||||
// }
|
||||
if (tech.isFlipFlopHarm && tech.isFlipFlopLevelReset && !tech.isFlipFlopOn) {
|
||||
tech.isFlipFlopOn = true
|
||||
simulation.makeTextLog(`tech.isFlipFlopOn <span class='color-symbol'>=</span> true`);
|
||||
@@ -4027,7 +4026,11 @@ const level = {
|
||||
// if (simulation.difficulty > 4) spawn.nodeGroup(8000, 630, "spawns", 8, 20, 105);
|
||||
// } else {
|
||||
spawn.randomLevelBoss(8000, 630, ["shooterBoss", "launcherBoss", "laserTargetingBoss", "spiderBoss", "laserBoss", "bomberBoss", "orbitalBoss"]);
|
||||
let me = mob[mob.length - 1];
|
||||
//find level boss index
|
||||
let me
|
||||
for (let i = 0, len = mob.length; i < len; i++) {
|
||||
if (mob[i].isBoss) me = mob[i]
|
||||
}
|
||||
me.onDeath = function() {
|
||||
this.removeCons(); //remove constraint
|
||||
spawnCouloirEnHaut()
|
||||
@@ -4036,7 +4039,10 @@ const level = {
|
||||
// }
|
||||
} else {
|
||||
spawn.randomLevelBoss(8000, 630, ["shooterBoss"]);
|
||||
let me = mob[mob.length - 1];
|
||||
let me
|
||||
for (let i = 0, len = mob.length; i < len; i++) {
|
||||
if (mob[i].isBoss) me = mob[i]
|
||||
}
|
||||
me.onDeath = function() {
|
||||
spawnCouloirEnHaut()
|
||||
doorSortieSalle.isOpen = false;
|
||||
|
||||
16
js/player.js
16
js/player.js
@@ -310,9 +310,16 @@ const m = {
|
||||
//remove all tech and count current tech total
|
||||
let totalTech = 0;
|
||||
for (let i = 0, len = tech.tech.length; i < len; i++) {
|
||||
if (!tech.tech[i].isLore) {
|
||||
if (tech.tech[i].isJunk) {
|
||||
tech.tech[i].frequency = 0
|
||||
} else if (tech.tech[i].frequencyDefault) {
|
||||
tech.tech[i].frequency = tech.tech[i].frequencyDefault
|
||||
} else {
|
||||
tech.tech[i].frequency = 1
|
||||
}
|
||||
if (
|
||||
!tech.tech[i].isNonRefundable &&
|
||||
!tech.tech[i].isLore &&
|
||||
tech.tech[i].name !== "many-worlds" &&
|
||||
tech.tech[i].name !== "decoherence"
|
||||
) {
|
||||
@@ -322,10 +329,11 @@ const m = {
|
||||
tech.tech[i].count = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
// lore.techCount = 0;
|
||||
// tech.removeLoreTechFromPool();
|
||||
// tech.addLoreTechToPool();
|
||||
tech.removeJunkTechFromPool();
|
||||
// tech.removeJunkTechFromPool();
|
||||
tech.armorFromPowerUps = 0;
|
||||
tech.totalCount = 0;
|
||||
const randomBotCount = b.totalBots()
|
||||
@@ -508,7 +516,7 @@ const m = {
|
||||
if (tech.isHarmArmor && m.lastHarmCycle + 600 > m.cycle) dmg *= 0.33;
|
||||
if (tech.isNoFireDefense && m.cycle > m.fireCDcycle + 120) dmg *= 0.34
|
||||
if (tech.energyRegen === 0) dmg *= 0.34
|
||||
if (tech.isTurret && m.crouch) dmg *= 0.5;
|
||||
if (tech.isTurret && m.crouch) dmg *= 0.55;
|
||||
if (tech.isFireMoveLock && input.fire) dmg *= 0.4;
|
||||
if (tech.isEntanglement && b.inventory[0] === b.activeGun) {
|
||||
for (let i = 0, len = b.inventory.length; i < len; i++) dmg *= 0.87 // 1 - 0.15
|
||||
@@ -2833,7 +2841,7 @@ const m = {
|
||||
y: mob[k].velocity.y - 8 * Math.sin(angle)
|
||||
});
|
||||
|
||||
if (tech.isAnnihilation && !mob[k].shield && !mob[k].isShielded && mob[k].dropPowerUp && m.energy > 0.34 * m.maxEnergy) {
|
||||
if (tech.isAnnihilation && !mob[k].shield && !mob[k].isShielded && !mob[k].isBoss && mob[k].dropPowerUp && m.energy > 0.34 * m.maxEnergy) {
|
||||
m.energy -= 0.33 * m.maxEnergy
|
||||
m.immuneCycle = 0; //player doesn't go immune to collision damage
|
||||
mob[k].death();
|
||||
|
||||
@@ -288,18 +288,14 @@ const powerUps = {
|
||||
let options = [];
|
||||
for (let i = 0; i < tech.tech.length; i++) {
|
||||
if (tech.tech[i].count < tech.tech[i].maxCount && i !== skip1 && i !== skip2 && i !== skip3 && i !== skip4 && tech.tech[i].allowed()) {
|
||||
options.push(i);
|
||||
for (let j = 0, len = tech.tech[i].frequency; j < len; j++) options.push(i);
|
||||
}
|
||||
}
|
||||
powerUps.tech.lastTotalChoices = options.length //this is recorded so that banish can know how many tech were available
|
||||
|
||||
if (tech.isBanish) { //remove banished tech from last selection
|
||||
for (let i = 0; i < powerUps.tech.banishLog.length; i++) {
|
||||
for (let j = 0; j < options.length; j++) {
|
||||
if (powerUps.tech.banishLog[i] === options[j]) {
|
||||
options.splice(j, 1)
|
||||
break
|
||||
}
|
||||
if (powerUps.tech.banishLog[i] === options[j]) options.splice(j, 1)
|
||||
}
|
||||
}
|
||||
} else { //remove repeats from last selection
|
||||
@@ -308,10 +304,7 @@ const powerUps = {
|
||||
for (let i = 0; i < totalChoices; i++) { //repeat for each choice from the last selection
|
||||
if (options.length > totalChoices) {
|
||||
for (let j = 0, len = options.length; j < len; j++) {
|
||||
if (powerUps.tech.choiceLog[powerUps.tech.choiceLog.length - 1 - i] === options[j]) {
|
||||
options.splice(j, 1) //remove previous choice from option pool
|
||||
break
|
||||
}
|
||||
if (powerUps.tech.choiceLog[powerUps.tech.choiceLog.length - 1 - i] === options[j]) options.splice(j, 1) //remove previous choice from option pool
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
70
js/spawn.js
70
js/spawn.js
@@ -105,13 +105,12 @@ const spawn = {
|
||||
level.levels.push("null")
|
||||
level.exit.x = 5500;
|
||||
level.exit.y = -330;
|
||||
simulation.makeTextLog(`<span class="lore-text">undefined</span> <span class='color-symbol'>=</span> ${lore.techCount}/${lore.techGoal}<br>level.levels.push("null")`);
|
||||
simulation.makeTextLog(`<span class="lore-text">undefined</span> <span class='color-symbol'>=</span> ${lore.techCount}/${lore.techGoal}<br>level.levels.push("<span class='lore-text'>null</span>")`);
|
||||
//remove block map element so exit is clear
|
||||
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
|
||||
} else { //reset game
|
||||
let count = 0
|
||||
|
||||
function loop() {
|
||||
@@ -133,50 +132,15 @@ const spawn = {
|
||||
if (!simulation.testing) requestAnimationFrame(loop);
|
||||
}
|
||||
requestAnimationFrame(loop);
|
||||
|
||||
// setTimeout(() => {
|
||||
// if (simulation.paused || simulation.testing) isEnding = false
|
||||
// simulation.makeTextLog(`simulation.complete()`);
|
||||
// let delay = 2000
|
||||
// for (let i = 0; i < 1; i += 0.01 + 0.2 * Math.random() * Math.random()) {
|
||||
// setTimeout(function() {
|
||||
// if (!simulation.paused && !simulation.testing) simulation.makeTextLog(`simulation.analysis <span class='color-symbol'>=</span> ${(i).toFixed(3)}`);
|
||||
// }, delay);
|
||||
// delay += 1000
|
||||
// }
|
||||
// setTimeout(function() {
|
||||
// if (isEnding) simulation.makeTextLog(`simulation.analysis <span class='color-symbol'>=</span> 1`);
|
||||
// setTimeout(() => {
|
||||
// if (isEnding) simulation.makeTextLog(`<span class="lore-text">undefined</span> <span class='color-symbol'>=</span> ${lore.techCount}/10`);
|
||||
// setTimeout(() => {
|
||||
// if (isEnding) {
|
||||
// if (isEnding) simulation.makeTextLog(`World.clear(engine.world)`);
|
||||
// setTimeout(() => { if (isEnding) m.death() }, 4000);
|
||||
// }
|
||||
// }, 3000);
|
||||
// }, 2000);
|
||||
// }, delay);
|
||||
// }, 5000);
|
||||
}
|
||||
//ramp up damage
|
||||
for (let i = 0; i < 3; i++) level.difficultyIncrease(simulation.difficultyMode)
|
||||
|
||||
//set game to the next highest difficulty level if not on why
|
||||
// if (simulation.difficultyMode < 6) {
|
||||
// if (simulation.difficultyMode === 0) {
|
||||
// simulation.difficultyMode = 1
|
||||
// } else if (simulation.difficultyMode === 1) {
|
||||
// simulation.difficultyMode = 2
|
||||
// } else if (simulation.difficultyMode === 2) {
|
||||
// simulation.difficultyMode = 4
|
||||
// } else {
|
||||
// simulation.difficultyMode = 6
|
||||
// }
|
||||
// document.getElementById("difficulty-select").value = simulation.difficultyMode
|
||||
// localSettings.difficultyMode = simulation.difficultyMode
|
||||
// localStorage.setItem("localSettings", JSON.stringify(localSettings)); //update local storage
|
||||
// simulation.makeTextLog(`<span class='color-var'>simulation</span>.difficultyMode<span class='color-symbol'>++</span>`);
|
||||
// }
|
||||
// for (let i = 0; i < 3; i++)
|
||||
level.difficultyIncrease(simulation.difficultyMode) //ramp up damage
|
||||
//remove power Ups, to avoid spamming console
|
||||
function removeAll(array) {
|
||||
for (let i = 0; i < array.length; ++i) Matter.World.remove(engine.world, array[i]);
|
||||
}
|
||||
removeAll(powerUp);
|
||||
powerUp = [];
|
||||
|
||||
//pull in particles
|
||||
for (let i = 0, len = body.length; i < len; ++i) {
|
||||
@@ -186,12 +150,7 @@ const spawn = {
|
||||
}
|
||||
//damage all mobs
|
||||
for (let i = 0, len = mob.length; i < len; ++i) {
|
||||
if (mob[i] !== this) {
|
||||
mob[i].damage(Infinity, true);
|
||||
|
||||
// const velocity = Vector.mult(Vector.normalise(Vector.sub(this.position, mob[i].position)), -65)
|
||||
// Matter.Body.setVelocity(mob[i], Vector.add(mob[i].velocity, velocity));
|
||||
}
|
||||
if (mob[i] !== this) mob[i].damage(Infinity, true);
|
||||
}
|
||||
|
||||
//draw stuff
|
||||
@@ -204,7 +163,6 @@ const spawn = {
|
||||
time: 5 * (len - i + 1)
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
me.onDamage = function() {};
|
||||
me.cycle = 420;
|
||||
@@ -1242,7 +1200,6 @@ const spawn = {
|
||||
};
|
||||
me.awake = function() {
|
||||
this.checkStatus();
|
||||
|
||||
//health bar needs to be here because the position is being set
|
||||
const h = this.radius * 0.3;
|
||||
const w = this.radius * 2;
|
||||
@@ -1267,8 +1224,8 @@ const spawn = {
|
||||
ctx.setLineDash([125 * Math.random(), 125 * Math.random()]);
|
||||
// ctx.lineDashOffset = 6*(simulation.cycle % 215);
|
||||
if (this.distanceToPlayer() < this.laserRange) {
|
||||
if (m.energy > 0.003) m.energy -= 0.003
|
||||
if (m.immuneCycle < m.cycle && m.energy < 0.1) m.damage(0.0003 * simulation.dmgScale);
|
||||
if (m.energy > 0.002) m.energy -= 0.002
|
||||
if (m.immuneCycle < m.cycle) m.damage(0.0001 * simulation.dmgScale);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(eye.x, eye.y);
|
||||
ctx.lineTo(m.pos.x, m.pos.y);
|
||||
@@ -1295,7 +1252,6 @@ const spawn = {
|
||||
Matter.Body.setPosition(this, { x: history.position.x, y: history.position.y - history.yOff + 24.2859 }) //bullets move with player
|
||||
}
|
||||
}
|
||||
|
||||
me.do = function() {
|
||||
if (this.seePlayer.recall || (!(simulation.cycle % this.seePlayerFreq) && this.distanceToPlayer2() < this.seeAtDistance2 && !m.isCloak)) {
|
||||
setTimeout(() => {
|
||||
|
||||
866
js/tech.js
866
js/tech.js
File diff suppressed because it is too large
Load Diff
16
todo.txt
16
todo.txt
@@ -1,10 +1,14 @@
|
||||
******************************************************** NEXT PATCH ********************************************************
|
||||
|
||||
tech: flip-flip - does nothing, except toggle on collisions
|
||||
tech: NOR gate - when flip-flip is ON take 0 harm from collisions
|
||||
tech: NAND gate - when flip-flip is ON do 55.5% damage
|
||||
tech: transistor - when flip-flop is ON regen 22 energy/s, when OFF drain 3.1 energy /s
|
||||
tech: shift registers - set flip-flop to ON with a new level
|
||||
some tech now has 2x,3x,4x frequency of showing up
|
||||
(most tech is at 1x, a few are at 2x if they have a rare requirement to unlock)
|
||||
reworked junk and lore tech systems
|
||||
(might be some new bugs)
|
||||
|
||||
tech that used to just summon a power up now also increases tech frequency
|
||||
removed the 4 perpetual techs
|
||||
|
||||
maybe fixed immune boss bug on detours level
|
||||
|
||||
******************************************************** BUGS ********************************************************
|
||||
|
||||
@@ -50,8 +54,6 @@ use the floor of portal sensor on the player? to unstuck player
|
||||
|
||||
******************************************************** TODO ********************************************************
|
||||
|
||||
flip-flop: 13% dup chance while ON
|
||||
|
||||
tech- foam is attracted to mobs
|
||||
use a gravitational attraction model?
|
||||
could foam be attracted to other foam bullets too?
|
||||
|
||||
Reference in New Issue
Block a user