anthropic

mob orbitals can now be destroyed, but it takes a very large amount of damage

laser-bot upgrade: gives 75% damage, range, and energy efficiency  (was 400% damage, but they ran out of energy too fast)
boom-bots are now smart about not hurting the player with explosions while doing the most damage

tech: strong anthropic principle - after anthropic principle prevents your death do 137.03599 extra damage for the rest of the level
This commit is contained in:
landgreen
2021-02-24 04:57:52 -08:00
parent 6fdbc0ea7e
commit 01b1286764
8 changed files with 157 additions and 113 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -304,6 +304,9 @@ const b = {
} }
} }
}, },
explosionRange() {
return tech.explosiveRadius * (tech.isExplosionHarm ? 1.8 : 1) * (tech.isSmallExplosion ? 0.8 : 1) * (tech.isExplodeRadio ? 1.25 : 1)
},
explosion(where, radius) { // typically explode is used for some bullets with .onEnd explosion(where, radius) { // typically explode is used for some bullets with .onEnd
radius *= tech.explosiveRadius radius *= tech.explosiveRadius
let dist, sub, knock; let dist, sub, knock;
@@ -664,7 +667,7 @@ const b = {
} }
bullet[me].do = function() { bullet[me].do = function() {
const suckCycles = 40 const suckCycles = 40
if (simulation.cycle > this.endCycle - suckCycles || Matter.Query.collides(this, map).length || Matter.Query.collides(this, body).length) { //suck if (!m.isBodiesAsleep && simulation.cycle > this.endCycle - suckCycles || Matter.Query.collides(this, map).length || Matter.Query.collides(this, body).length) { //suck
const that = this const that = this
function suck(who, radius = that.explodeRad * 3.2) { function suck(who, radius = that.explodeRad * 3.2) {
@@ -726,7 +729,7 @@ const b = {
this.force.y += this.mass * 0.0025; //extra gravity for harder arcs this.force.y += this.mass * 0.0025; //extra gravity for harder arcs
const suckCycles = 40 const suckCycles = 40
if (simulation.cycle > this.endCycle - suckCycles) { //suck if (!m.isBodiesAsleep && simulation.cycle > this.endCycle - suckCycles) { //suck
const that = this const that = this
function suck(who, radius = that.explodeRad * 3.2) { function suck(who, radius = that.explodeRad * 3.2) {
@@ -2597,17 +2600,19 @@ const b = {
frictionStatic: 0, frictionStatic: 0,
frictionAir: 0.008 * (1 + 0.3 * Math.random()), frictionAir: 0.008 * (1 + 0.3 * Math.random()),
restitution: 0.5 * (1 + 0.5 * Math.random()), restitution: 0.5 * (1 + 0.5 * Math.random()),
dmg: 0, // 0.14 //damage done in addition to the damage from momentum
minDmgSpeed: 2,
lookFrequency: 40 + Math.floor(7 * Math.random()) - 10 * tech.isLaserBotUpgrade,
drainThreshold: tech.isEnergyHealth ? 0.6 : 0.4,
acceleration: 0.0015 * (1 + 0.3 * Math.random()), acceleration: 0.0015 * (1 + 0.3 * Math.random()),
range: 700 * (1 + 0.1 * Math.random()) + 500 * tech.isLaserBotUpgrade,
playerRange: 150 + Math.floor(30 * Math.random()), playerRange: 150 + Math.floor(30 * Math.random()),
offPlayer: { offPlayer: {
x: 0, x: 0,
y: 0, y: 0,
}, },
dmg: 0, //damage done in addition to the damage from momentum
minDmgSpeed: 2,
lookFrequency: 40 + Math.floor(7 * Math.random()) - 10 * tech.isLaserBotUpgrade,
range: (700 + 400 * tech.isLaserBotUpgrade) * (1 + 0.1 * Math.random()),
drainThreshold: tech.isEnergyHealth ? 0.6 : 0.4,
drain: 0.7 - 0.52 * tech.isLaserBotUpgrade,
laserDamage: 0.38 + 0.29 * tech.isLaserBotUpgrade,
endCycle: Infinity, endCycle: Infinity,
classType: "bullet", classType: "bullet",
collisionFilter: { collisionFilter: {
@@ -2655,8 +2660,8 @@ const b = {
} }
//hit target with laser //hit target with laser
if (this.lockedOn && this.lockedOn.alive && m.energy > this.drainThreshold) { if (this.lockedOn && this.lockedOn.alive && m.energy > this.drainThreshold) {
m.energy -= tech.laserFieldDrain * tech.isLaserDiode * 0.7 m.energy -= tech.laserFieldDrain * tech.isLaserDiode * this.drain
b.laser(this.vertices[0], this.lockedOn.position, b.dmgScale * (0.38 * tech.laserDamage + this.isUpgraded * 0.25), tech.laserReflections, false, 0.4) //tech.laserDamage = 0.16 b.laser(this.vertices[0], this.lockedOn.position, b.dmgScale * this.laserDamage * tech.laserDamage, tech.laserReflections, false, 0.4) //tech.laserDamage = 0.16
// laser(where = { // laser(where = {
// x: m.pos.x + 20 * Math.cos(m.angle), // x: m.pos.x + 20 * Math.cos(m.angle),
// y: m.pos.y + 20 * Math.sin(m.angle) // y: m.pos.y + 20 * Math.sin(m.angle)
@@ -2712,13 +2717,17 @@ const b = {
}, },
onEnd() {}, onEnd() {},
do() { do() {
if (this.explode) { const distanceToPlayer = Vector.magnitude(Vector.sub(this.position, player.position))
b.explosion(this.position, this.explode); //makes bullet do explosive damage at end
this.explode = 0;
}
const distanceToPlayer = Vector.magnitude(Vector.sub(this.position, m.pos))
if (distanceToPlayer > 100) { //if far away move towards player if (distanceToPlayer > 100) { //if far away move towards player
this.force = Vector.mult(Vector.normalise(Vector.sub(m.pos, this.position)), this.mass * this.acceleration) if (this.explode) {
if (tech.isImmuneExplosion && m.energy > 1.43) {
b.explosion(this.position, this.explode);
} else {
b.explosion(this.position, Math.max(0, Math.min(this.explode, (distanceToPlayer - 70) / b.explosionRange())));
}
this.explode = 0;
}
this.force = Vector.mult(Vector.normalise(Vector.sub(player.position, this.position)), this.mass * this.acceleration)
} else if (distanceToPlayer < 250) { //close to player } else if (distanceToPlayer < 250) { //close to player
Matter.Body.setVelocity(this, Vector.add(Vector.mult(this.velocity, 0.90), Vector.mult(player.velocity, 0.17))); //add player's velocity Matter.Body.setVelocity(this, Vector.add(Vector.mult(this.velocity, 0.90), Vector.mult(player.velocity, 0.17))); //add player's velocity
//find targets //find targets
@@ -3220,7 +3229,7 @@ const b = {
}, },
{ {
name: "shotgun", name: "shotgun",
description: "fire a <strong>burst</strong> of short range <strong> bullets</strong>", description: "fire a wide <strong>burst</strong> of short range <strong> bullets</strong>",
ammo: 0, ammo: 0,
ammoPack: 5.5, ammoPack: 5.5,
defaultAmmoPack: 5.5, defaultAmmoPack: 5.5,

View File

@@ -109,7 +109,7 @@ function collisionChecks(event) {
return return
} }
m.damage(dmg); m.damage(dmg);
if (tech.isPiezo) m.energy += 4; if (tech.isPiezo) m.energy += 20.48;
if (tech.isBayesian) powerUps.ejectTech() if (tech.isBayesian) powerUps.ejectTech()
if (mob[k].onHit) mob[k].onHit(k); if (mob[k].onHit) mob[k].onHit(k);
m.immuneCycle = m.cycle + tech.collisionImmuneCycles; //player is immune to collision damage for 30 cycles m.immuneCycle = m.cycle + tech.collisionImmuneCycles; //player is immune to collision damage for 30 cycles

View File

@@ -12,10 +12,10 @@ const level = {
start() { start() {
if (level.levelsCleared === 0) { //this code only runs on the first level if (level.levelsCleared === 0) { //this code only runs on the first level
// simulation.enableConstructMode() //used to build maps in testing mode // simulation.enableConstructMode() //used to build maps in testing mode
// level.difficultyIncrease(20) // level.difficultyIncrease(40)
// simulation.zoomScale = 1000; // simulation.zoomScale = 1000;
// simulation.setZoom(); // simulation.setZoom();
// m.setField("plasma torch") // m.setField("nano-scale manufacturing")
// b.giveGuns("nail gun") // b.giveGuns("nail gun")
// tech.isExplodeRadio = true // tech.isExplodeRadio = true
// for (let i = 0; i < 1; i++) tech.giveTech("dynamo-bot") // for (let i = 0; i < 1; i++) tech.giveTech("dynamo-bot")
@@ -770,7 +770,7 @@ const level = {
mapB.portalPair = mapA mapB.portalPair = mapA
return [portalA, portalB, mapA, mapB] return [portalA, portalB, mapA, mapB]
}, },
hazard(x, y, width, height, damage = 0.0008, color = "hsla(160, 100%, 35%,0.75)", isOptical = false) { hazard(x, y, width, height, damage = 0.003, color = "hsla(160, 100%, 35%,0.75)", isOptical = false) {
return { return {
min: { min: {
x: x, x: x,
@@ -786,21 +786,24 @@ const level = {
isOn: true, isOn: true,
query() { query() {
if (this.isOn && this.height > 0 && Matter.Query.region([player], this).length && !(m.isCloak && isOptical)) { if (this.isOn && this.height > 0 && Matter.Query.region([player], this).length && !(m.isCloak && isOptical)) {
if (damage < 0.02) { const drain = 0.003 + m.fieldRegen
m.damage(damage) if (m.energy > drain) {
} else if (m.immuneCycle < m.cycle) { m.energy -= drain
m.immuneCycle = m.cycle + tech.collisionImmuneCycles; } else {
m.damage(damage) if (damage < 0.02) {
simulation.drawList.push({ //add dmg to draw queue m.damage(damage)
x: player.position.x, } else if (m.immuneCycle < m.cycle) {
y: player.position.y, m.immuneCycle = m.cycle + tech.collisionImmuneCycles;
radius: damage * 1500, m.damage(damage)
color: simulation.mobDmgColor, simulation.drawList.push({ //add dmg to draw queue
time: 20 x: player.position.x,
}); y: player.position.y,
radius: damage * 1500,
color: simulation.mobDmgColor,
time: 20
});
}
} }
const drain = 0.005
if (m.energy > drain) m.energy -= drain
//float //float
if (!isOptical) { if (!isOptical) {
@@ -910,7 +913,7 @@ const level = {
//start a conversation based on the number of conversations seen //start a conversation based on the number of conversations seen
if (!simulation.isCheating && localSettings.loreCount < lore.conversation.length) lore.conversation[localSettings.loreCount]() if (!simulation.isCheating && localSettings.loreCount < lore.conversation.length) lore.conversation[localSettings.loreCount]()
const hazardSlime = level.hazard(-1800, 150, 3600, 650, 0.01, "hsla(160, 100%, 35%,0.75)") const hazardSlime = level.hazard(-1800, 150, 3600, 650, 0.004, "hsla(160, 100%, 35%,0.75)")
const circle = { const circle = {
x: 0, x: 0,
y: -500, y: -500,
@@ -957,7 +960,7 @@ const level = {
ctx.beginPath(); ctx.beginPath();
const step = Math.PI / 20 const step = Math.PI / 20
const horizontalStep = 85 const horizontalStep = 85
if (simulation.isCheating) phase += 0.003 //(m.pos.x - circle.x) * 0.0005 //0.05 * Math.sin(simulation.cycle * 0.030) if (simulation.isCheating) phase += 0.01 //(m.pos.x - circle.x) * 0.0005 //0.05 * Math.sin(simulation.cycle * 0.030)
// const sway = 5 * Math.cos(simulation.cycle * 0.007) // const sway = 5 * Math.cos(simulation.cycle * 0.007)
sway.x = sway.x * 0.995 + 0.005 * (m.pos.x - circle.x) * 0.05 //+ 0.04 * Math.cos(simulation.cycle * 0.01) sway.x = sway.x * 0.995 + 0.005 * (m.pos.x - circle.x) * 0.05 //+ 0.04 * Math.cos(simulation.cycle * 0.01)
sway.y = 2.5 * Math.sin(simulation.cycle * 0.015) sway.y = 2.5 * Math.sin(simulation.cycle * 0.015)
@@ -1099,8 +1102,8 @@ const level = {
// spawn.streamBoss(1600, -500) // spawn.streamBoss(1600, -500)
// spawn.cellBossCulture(1600, -500) // spawn.cellBossCulture(1600, -500)
// spawn.cellBossCulture(1600, -500) // spawn.cellBossCulture(1600, -500)
// simulation.difficulty = 66 // simulation.difficulty = 30
// spawn.orbitalBoss(1600, -500) spawn.orbitalBoss(1600, -500)
// spawn.beamer(1200, -500) // spawn.beamer(1200, -500)
// spawn.shield(mob[mob.length - 1], 1800, -120, 1); // spawn.shield(mob[mob.length - 1], 1800, -120, 1);

View File

@@ -304,7 +304,6 @@ const m = {
}, },
alive: false, alive: false,
switchWorlds() { switchWorlds() {
//count tech
const totalGuns = b.inventory.length - tech.isRewindGun //count guns, but not CPT gun const totalGuns = b.inventory.length - tech.isRewindGun //count guns, but not CPT gun
simulation.isTextLogOpen = false; //prevent console spam simulation.isTextLogOpen = false; //prevent console spam
//remove all tech and count current tech total //remove all tech and count current tech total
@@ -312,8 +311,9 @@ const m = {
for (let i = 0, len = tech.tech.length; i < len; i++) { for (let i = 0, len = tech.tech.length; i < len; i++) {
if ( if (
!tech.tech[i].isNonRefundable && !tech.tech[i].isNonRefundable &&
!tech.tech[i].isLore &&
tech.tech[i].name !== "many-worlds" && tech.tech[i].name !== "many-worlds" &&
tech.tech[i].name !== "perturbation theory" tech.tech[i].name !== "decoherence"
) { ) {
totalTech += tech.tech[i].count totalTech += tech.tech[i].count
tech.tech[i].remove(); tech.tech[i].remove();
@@ -321,10 +321,10 @@ const m = {
tech.tech[i].count = 0 tech.tech[i].count = 0
} }
} }
lore.techCount = 0; // lore.techCount = 0;
// tech.removeLoreTechFromPool();
// tech.addLoreTechToPool();
tech.removeJunkTechFromPool(); tech.removeJunkTechFromPool();
tech.removeLoreTechFromPool();
tech.addLoreTechToPool();
tech.armorFromPowerUps = 0; tech.armorFromPowerUps = 0;
tech.totalCount = 0; tech.totalCount = 0;
const randomBotCount = b.totalBots() const randomBotCount = b.totalBots()
@@ -334,7 +334,7 @@ const m = {
bullet = []; bullet = [];
//randomize health //randomize health
m.health = 0.7 + Math.random() m.health = m.health * (1 + 0.5 * (Math.random() - 0.5))
if (m.health > 1) m.health = 1; if (m.health > 1) m.health = 1;
m.displayHealth(); m.displayHealth();
@@ -344,7 +344,11 @@ const m = {
//track ammo/ ammoPack count //track ammo/ ammoPack count
let ammoCount = 0 let ammoCount = 0
for (let i = 0, len = b.inventory.length; i < len; i++) { for (let i = 0, len = b.inventory.length; i < len; i++) {
if (b.guns[b.inventory[i]].ammo !== Infinity) ammoCount += b.guns[b.inventory[i]].ammo / b.guns[b.inventory[i]].ammoPack if (b.guns[b.inventory[i]].ammo !== Infinity) {
ammoCount += b.guns[b.inventory[i]].ammo / b.guns[b.inventory[i]].ammoPack
} else {
ammoCount += 5
}
} }
//removes guns and ammo //removes guns and ammo
b.inventory = []; b.inventory = [];
@@ -369,6 +373,7 @@ const m = {
for (let i = 0, len = tech.tech.length; i < len; i++) { for (let i = 0, len = tech.tech.length; i < len; i++) {
if (tech.tech[i].count < tech.tech[i].maxCount && if (tech.tech[i].count < tech.tech[i].maxCount &&
!tech.tech[i].isBadRandomOption && !tech.tech[i].isBadRandomOption &&
!tech.tech[i].isLore &&
tech.tech[i].allowed() && tech.tech[i].allowed() &&
(!tech.tech[i].isJunk || Math.random() < 0.25)) options.push(i); (!tech.tech[i].isJunk || Math.random() < 0.25)) options.push(i);
// !tech.tech[i].isNonRefundable && // !tech.tech[i].isNonRefundable &&
@@ -489,13 +494,13 @@ const m = {
let dmg = 1 let dmg = 1
dmg *= m.fieldHarmReduction dmg *= m.fieldHarmReduction
if (tech.isImmortal) dmg *= 0.84 if (tech.isImmortal) dmg *= 0.84
if (tech.isHarmReduceAfterKill) dmg *= (m.lastKillCycle + 300 > m.cycle) ? 0.33 : 1.33 if (tech.isHarmReduceAfterKill) dmg *= (m.lastKillCycle + 300 > m.cycle) ? 0.25 : 1.25
if (tech.healthDrain) dmg *= 1 + 2.667 * tech.healthDrain //tech.healthDrain = 0.03 at one stack //cause more damage if (tech.healthDrain) dmg *= 1 + 2.667 * tech.healthDrain //tech.healthDrain = 0.03 at one stack //cause more damage
if (tech.squirrelFx !== 1) dmg *= 1 + (tech.squirrelFx - 1) / 5 //cause more damage if (tech.squirrelFx !== 1) dmg *= 1 + (tech.squirrelFx - 1) / 5 //cause more damage
if (tech.isBlockHarm && m.isHolding) dmg *= 0.2 if (tech.isBlockHarm && m.isHolding) dmg *= 0.2
if (tech.isSpeedHarm) dmg *= 1 - Math.min(player.speed * 0.0185, 0.55) if (tech.isSpeedHarm) dmg *= 1 - Math.min(player.speed * 0.0185, 0.55)
if (tech.isSlowFPS) dmg *= 0.8 if (tech.isSlowFPS) dmg *= 0.8
if (tech.isPiezo) dmg *= 0.85 // if (tech.isPiezo) dmg *= 0.85
if (tech.isHarmReduce && m.fieldUpgrades[m.fieldMode].name === "negative mass field" && m.isFieldActive) dmg *= 0.5 if (tech.isHarmReduce && m.fieldUpgrades[m.fieldMode].name === "negative mass field" && m.isFieldActive) dmg *= 0.5
if (tech.isBotArmor) dmg *= 0.94 ** b.totalBots() if (tech.isBotArmor) dmg *= 0.94 ** b.totalBots()
if (tech.isHarmArmor && m.lastHarmCycle + 600 > m.cycle) dmg *= 0.33; if (tech.isHarmArmor && m.lastHarmCycle + 600 > m.cycle) dmg *= 0.33;
@@ -631,6 +636,7 @@ const m = {
m.energy -= dmg; m.energy -= dmg;
if (m.energy < 0 || isNaN(m.energy)) { //taking deadly damage if (m.energy < 0 || isNaN(m.energy)) { //taking deadly damage
if (tech.isDeathAvoid && powerUps.research.count && !tech.isDeathAvoidedThisLevel) { if (tech.isDeathAvoid && powerUps.research.count && !tech.isDeathAvoidedThisLevel) {
tech.isDeathAvoidedThisLevel = true tech.isDeathAvoidedThisLevel = true
powerUps.research.changeRerolls(-1) powerUps.research.changeRerolls(-1)
simulation.makeTextLog(`<span class='color-var'>m</span>.<span class='color-r'>research</span><span class='color-symbol'>--</span><br>${powerUps.research.count}`) simulation.makeTextLog(`<span class='color-var'>m</span>.<span class='color-r'>research</span><span class='color-symbol'>--</span><br>${powerUps.research.count}`)
@@ -1505,7 +1511,7 @@ const m = {
description: "use <strong class='color-f'>energy</strong> to <strong>block</strong> mobs<br>excess <strong class='color-f'>energy</strong> used to build <strong>drones</strong><br><strong>double</strong> your default <strong class='color-f'>energy</strong> regeneration", description: "use <strong class='color-f'>energy</strong> to <strong>block</strong> mobs<br>excess <strong class='color-f'>energy</strong> used to build <strong>drones</strong><br><strong>double</strong> your default <strong class='color-f'>energy</strong> regeneration",
effect: () => { effect: () => {
m.hold = function() { m.hold = function() {
if (m.energy > m.maxEnergy - 0.02 && m.fieldCDcycle < m.cycle && !input.field && bullet.length < 200) { if (m.energy > m.maxEnergy - 0.02 && m.fieldCDcycle < m.cycle && !input.field && bullet.length < 200 && (m.cycle % 2)) {
if (tech.isSporeField) { if (tech.isSporeField) {
// const len = Math.floor(5 + 4 * Math.random()) // const len = Math.floor(5 + 4 * Math.random())
const len = Math.ceil(m.energy * 10) const len = Math.ceil(m.energy * 10)
@@ -2664,7 +2670,7 @@ const m = {
player.position.x > level.exit.x && player.position.x > level.exit.x &&
player.position.x < level.exit.x + 100 && player.position.x < level.exit.x + 100 &&
player.position.y > level.exit.y - 150 && player.position.y > level.exit.y - 150 &&
player.position.y < level.exit.y - 40 player.position.y < level.exit.y + 40
) { ) {
level.nextLevel() level.nextLevel()
} }
@@ -2773,6 +2779,7 @@ const m = {
ctx.restore(); ctx.restore();
} }
//fix collisions //fix collisions
collisionChecks = (event) => { collisionChecks = (event) => {
const pairs = event.pairs; const pairs = event.pairs;
@@ -2803,7 +2810,7 @@ const m = {
return return
} }
m.damage(dmg); m.damage(dmg);
if (tech.isPiezo) m.energy += 4; if (tech.isPiezo) m.energy += 20.48;
if (tech.isBayesian) powerUps.ejectTech() if (tech.isBayesian) powerUps.ejectTech()
if (mob[k].onHit) mob[k].onHit(k); if (mob[k].onHit) mob[k].onHit(k);
m.immuneCycle = m.cycle + tech.collisionImmuneCycles; //player is immune to collision damage for 30 cycles m.immuneCycle = m.cycle + tech.collisionImmuneCycles; //player is immune to collision damage for 30 cycles

View File

@@ -82,8 +82,8 @@ const spawn = {
} }
} }
}, },
//, "historyBoss", "shooterBoss", "cellBossCulture", "bomberBoss", "spiderBoss", "launcherBoss", "laserTargetingBoss", "powerUpBoss", "snakeBoss", "streamBoss"
randomLevelBoss(x, y, options = ["orbitalBoss", "historyBoss", "shooterBoss", "cellBossCulture", "bomberBoss", "spiderBoss", "launcherBoss", "laserTargetingBoss", "powerUpBoss", "snakeBoss", "streamBoss"]) { randomLevelBoss(x, y, options = ["orbitalBoss"]) {
// other bosses: suckerBoss, laserBoss, tetherBoss, //these need a particular level to work so they are not included in the random pool // other bosses: suckerBoss, laserBoss, tetherBoss, //these need a particular level to work so they are not included in the random pool
spawn[options[Math.floor(Math.random() * options.length)]](x, y) spawn[options[Math.floor(Math.random() * options.length)]](x, y)
}, },
@@ -2688,11 +2688,11 @@ const spawn = {
mobs.spawn(who.position.x, who.position.y, 8, 12, "rgb(255,0,150)"); mobs.spawn(who.position.x, who.position.y, 8, 12, "rgb(255,0,150)");
let me = mob[mob.length - 1]; let me = mob[mob.length - 1];
me.stroke = "transparent"; me.stroke = "transparent";
// Matter.Body.setDensity(me, 0.00004); //normal is 0.001 Matter.Body.setDensity(me, 0.1); //normal is 0.001
me.leaveBody = false; me.leaveBody = false;
me.dropPowerUp = false; me.dropPowerUp = false;
me.showHealthBar = false; me.showHealthBar = false;
me.isShielded = true // me.isShielded = true
me.collisionFilter.category = cat.mobBullet; me.collisionFilter.category = cat.mobBullet;
me.collisionFilter.mask = cat.bullet; //cat.player | cat.map | cat.body me.collisionFilter.mask = cat.bullet; //cat.player | cat.map | cat.body
me.do = function() { me.do = function() {
@@ -2709,14 +2709,15 @@ const spawn = {
} }
Matter.Body.setPosition(this, Vector.add(who.position, Vector.mult(orbit, radius))) //bullets move with player Matter.Body.setPosition(this, Vector.add(who.position, Vector.mult(orbit, radius))) //bullets move with player
//damage player //damage player
if (Matter.Query.collides(this, [player]).length > 0 && !m.isCloak) { if (Matter.Query.collides(this, [player]).length > 0 && !(m.isCloak && tech.isIntangible)) {
m.damage(0.035 * simulation.dmgScale); m.damage(0.035 * simulation.dmgScale);
this.death(); this.death();
} }
}; };
}, },
orbitalBoss(x, y, radius = 88) { orbitalBoss(x, y, radius = 88) {
const nodes = Math.floor(3 + 1 * Math.sqrt(simulation.difficulty)) const nodeBalance = Math.random()
const nodes = Math.min(15, Math.floor(1 + 5 * nodeBalance + 0.75 * Math.sqrt(simulation.difficulty)))
mobs.spawn(x, y, nodes, radius, "rgb(255,0,150)"); mobs.spawn(x, y, nodes, radius, "rgb(255,0,150)");
let me = mob[mob.length - 1]; let me = mob[mob.length - 1];
me.isBoss = true; me.isBoss = true;
@@ -2724,23 +2725,24 @@ const spawn = {
me.stroke = "transparent"; //used for drawGhost me.stroke = "transparent"; //used for drawGhost
me.seeAtDistance2 = 2000000; me.seeAtDistance2 = 2000000;
me.accelMag = Math.floor(10 * (Math.random() + 4.5)) * 0.00001 * simulation.accelScale;
me.frictionAir = 0.005;
me.accelMag = 0.00016 * simulation.accelScale;
me.memory = Infinity; me.memory = Infinity;
me.frictionAir = 0.01;
me.accelMag = 0.00004 * simulation.accelScale;
me.collisionFilter.mask = cat.player | cat.bullet me.collisionFilter.mask = cat.player | cat.bullet
spawn.shield(me, x, y, 1); spawn.shield(me, x, y, 1);
let speed = (0.006 + 0.002 * Math.sqrt(simulation.difficulty)) * ((Math.random() < 0.5) ? 1 : -1) const rangeInnerVsOuter = Math.random()
let range = radius + 125 + 250 * Math.random() + nodes * 5 let speed = (0.003 + 0.0015 * Math.sqrt(simulation.difficulty)) * ((Math.random() < 0.5) ? 1 : -1)
let range = radius + 150 + 200 * rangeInnerVsOuter + nodes * 5
for (let i = 0; i < nodes; i++) spawn.orbital(me, range, i / nodes * 2 * Math.PI, speed) for (let i = 0; i < nodes; i++) spawn.orbital(me, range, i / nodes * 2 * Math.PI, speed)
const orbitalIndexes = [] //find indexes for all the current nodes const orbitalIndexes = [] //find indexes for all the current nodes
for (let i = 0; i < nodes; i++) orbitalIndexes.push(mob.length - 1 - i) for (let i = 0; i < nodes; i++) orbitalIndexes.push(mob.length - 1 - i)
// add orbitals for each orbital // add orbitals for each orbital
range = 70 + Math.max(0, 140 * Math.random() - nodes * 3) range = Math.max(60, 150 - nodes * 3 - rangeInnerVsOuter * 80)
speed = speed * (1.5 + 2 * Math.random()) speed = speed * (1.25 + 2 * Math.random())
const subNodes = Math.max(2, Math.floor(6 - 5 * nodeBalance + 0.5 * Math.sqrt(simulation.difficulty)))
for (let j = 0; j < nodes; j++) { for (let j = 0; j < nodes; j++) {
for (let i = 0, len = nodes - 1; i < len; i++) spawn.orbital(mob[orbitalIndexes[j]], range, i / len * 2 * Math.PI, speed) for (let i = 0, len = subNodes; i < len; i++) spawn.orbital(mob[orbitalIndexes[j]], range, i / len * 2 * Math.PI, speed)
} }
me.onDeath = function() { me.onDeath = function() {
powerUps.spawnBossPowerUp(this.position.x, this.position.y) powerUps.spawnBossPowerUp(this.position.x, this.position.y)

View File

@@ -109,6 +109,7 @@
}, },
damageFromTech() { damageFromTech() {
let dmg = m.fieldDamage let dmg = m.fieldDamage
if (tech.isAnthropicDamage && tech.isDeathAvoidedThisLevel) dmg *= 2.37
if (tech.isDamageAfterKill) dmg *= (m.lastKillCycle + 300 > m.cycle) ? 1.5 : 0.5 if (tech.isDamageAfterKill) dmg *= (m.lastKillCycle + 300 > m.cycle) ? 1.5 : 0.5
if (tech.isTechDamage) dmg *= 2 if (tech.isTechDamage) dmg *= 2
if (tech.isDupDamage) dmg *= 1 + Math.min(1, tech.duplicationChance()) if (tech.isDupDamage) dmg *= 1 + Math.min(1, tech.duplicationChance())
@@ -891,7 +892,7 @@
}, },
{ {
name: "laser-bot upgrade", name: "laser-bot upgrade",
description: "<strong>convert</strong> all your bots to <strong>laser-bots</strong><br><strong>400%</strong> increased <strong>laser-bot</strong> <strong class='color-laser'>laser</strong> <strong class='color-d'>damage</strong>", description: "<strong>convert</strong> all your bots to <strong>laser-bots</strong><br><strong>75%</strong> improved <strong class='color-d'>damage</strong>, efficiency, and range", // <strong>400%</strong> increased <strong>laser-bot</strong> <strong class='color-laser'>laser</strong> <strong class='color-d'>damage</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -1334,16 +1335,16 @@
}, },
{ {
name: "piezoelectricity", name: "piezoelectricity",
description: "<strong>colliding</strong> with mobs gives you <strong>400</strong> <strong class='color-f'>energy</strong><br>reduce <strong class='color-harm'>harm</strong> by <strong>15%</strong>", description: "<strong>colliding</strong> with mobs gives you <strong>2048</strong> <strong class='color-f'>energy</strong>", //<br>reduce <strong class='color-harm'>harm</strong> by <strong>15%</strong>
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
return !tech.isEnergyHealth return !tech.isEnergyHealth && m.harmReduction() < 1
}, },
requires: "not mass-energy equivalence", requires: "not mass-energy equivalence, some harm reduction",
effect() { effect() {
tech.isPiezo = true; tech.isPiezo = true;
m.energy += 4; m.energy += 20.48;
}, },
remove() { remove() {
tech.isPiezo = false; tech.isPiezo = false;
@@ -1603,7 +1604,7 @@
}, },
{ {
name: "torpor", name: "torpor",
description: "if a mob has <strong>died</strong> in the last <strong>5 seconds</strong><br>reduce <strong class='color-harm'>harm</strong> by <strong>66%</strong> else increase it by <strong>50%</strong>", description: "if a mob has <strong>died</strong> in the last <strong>5 seconds</strong><br>reduce <strong class='color-harm'>harm</strong> by <strong>75%</strong> else increase it by <strong>25%</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -1808,6 +1809,22 @@
tech.isDeathAvoid = false; tech.isDeathAvoid = false;
} }
}, },
{
name: "strong anthropic principle",
description: "after <strong>anthropic principle</strong> prevents your <strong>death</strong><br>increase <strong class='color-d'>damage</strong> by <strong>137.03599%</strong> on that level",
maxCount: 1,
count: 0,
allowed() {
return tech.isDeathAvoid
},
requires: "anthropic principle",
effect() {
tech.isAnthropicDamage = true
},
remove() {
tech.isAnthropicDamage = false
}
},
{ {
name: "quantum immortality", name: "quantum immortality",
description: "after <strong>dying</strong>, continue in an <strong>alternate reality</strong><br>reduce <strong class='color-harm'>harm</strong> by <strong>16%</strong>", //spawn <strong>4</strong> <strong class='color-r'>research</strong> description: "after <strong>dying</strong>, continue in an <strong>alternate reality</strong><br>reduce <strong class='color-harm'>harm</strong> by <strong>16%</strong>", //spawn <strong>4</strong> <strong class='color-r'>research</strong>
@@ -1843,7 +1860,7 @@
}, },
{ {
name: "decoherence", name: "decoherence",
description: "enter an <strong>alternate reality</strong> after you <strong class='color-r'>research</strong><br>spawn <strong>9</strong> <strong class='color-r'>research</strong> immediately", description: "enter an <strong>alternate reality</strong> after you <strong class='color-r'>research</strong><br>spawn <strong>9</strong> <strong class='color-r'>research</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -1885,7 +1902,7 @@
requires: "not determinism, at least 3 research", requires: "not determinism, at least 3 research",
effect() { effect() {
tech.isBanish = true tech.isBanish = true
for (let i = 0; i < 5; i++) powerUps.spawn(m.pos.x, m.pos.y, "research", false); for (let i = 0; i < 5; i++) powerUps.spawn(m.pos.x + 60 * (Math.random() - 0.5), m.pos.y + 60 * (Math.random() - 0.5), "research", false);
}, },
remove() { remove() {
tech.isBanish = false tech.isBanish = false
@@ -1970,7 +1987,7 @@
tech.setupAllTech(); // remove all tech tech.setupAllTech(); // remove all tech
tech.addLoreTechToPool(); tech.addLoreTechToPool();
for (let i = 0; i < count; i++) { // spawn new tech power ups for (let i = 0; i < count; i++) { // spawn new tech power ups
powerUps.spawn(m.pos.x, m.pos.y, "tech"); powerUps.spawn(m.pos.x + 60 * (Math.random() - 0.5), m.pos.y + 60 * (Math.random() - 0.5), "tech");
} }
//have state is checked in m.death() //have state is checked in m.death()
}, },
@@ -2293,7 +2310,7 @@
effect: () => { effect: () => {
tech.isDeterminism = true; tech.isDeterminism = true;
//if you change the six also change it in Born rule //if you change the six also change it in Born rule
for (let i = 0; i < 5; i++) powerUps.spawn(m.pos.x, m.pos.y, "tech"); for (let i = 0; i < 5; i++) powerUps.spawn(m.pos.x + 60 * (Math.random() - 0.5), m.pos.y + 60 * (Math.random() - 0.5), "tech");
}, },
remove() { remove() {
tech.isDeterminism = false; tech.isDeterminism = false;
@@ -2312,9 +2329,8 @@
requires: "determinism, not unified field theory", requires: "determinism, not unified field theory",
effect: () => { effect: () => {
tech.isSuperDeterminism = true; tech.isSuperDeterminism = true;
for (let i = 0; i < 7; i++) { //if you change the six also change it in Born rule //if you change the six also change it in Born rule
powerUps.spawn(m.pos.x, m.pos.y, "tech"); for (let i = 0; i < 7; i++) powerUps.spawn(m.pos.x + 60 * (Math.random() - 0.5), m.pos.y + 60 * (Math.random() - 0.5), "tech");
}
}, },
remove() { remove() {
tech.isSuperDeterminism = false; tech.isSuperDeterminism = false;
@@ -2331,9 +2347,9 @@
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
return (b.totalBots() > 5 || m.fieldUpgrades[m.fieldMode].name === "nano-scale manufacturing" || m.fieldUpgrades[m.fieldMode].name === "plasma torch" || m.fieldUpgrades[m.fieldMode].name === "pilot wave") && !tech.isEnergyHealth && !tech.isRewindAvoidDeath //build.isExperimentSelection || return (b.totalBots() > 3 || m.fieldUpgrades[m.fieldMode].name === "nano-scale manufacturing" || m.fieldUpgrades[m.fieldMode].name === "plasma torch" || m.fieldUpgrades[m.fieldMode].name === "pilot wave") && !tech.isEnergyHealth && !tech.isRewindAvoidDeath //build.isExperimentSelection ||
}, },
requires: "bots > 5, plasma torch, nano-scale, pilot wave, not mass-energy equivalence, CPT", requires: "bots > 3, plasma torch, nano-scale, pilot wave, not mass-energy equivalence, CPT",
effect() { effect() {
tech.isRewindGun = true tech.isRewindGun = true
b.guns.push(b.gunRewind) b.guns.push(b.gunRewind)
@@ -4212,7 +4228,7 @@
}, },
requires: "", requires: "",
effect() { effect() {
for (let i = 0; i < 6; i++) powerUps.spawn(m.pos.x, m.pos.y, "heal"); for (let i = 0; i < 6; i++) powerUps.spawn(m.pos.x + 60 * (Math.random() - 0.5), m.pos.y + 60 * (Math.random() - 0.5), "heal");
this.count-- this.count--
}, },
remove() {} remove() {}
@@ -4230,7 +4246,7 @@
}, },
requires: "not exciton lattice", requires: "not exciton lattice",
effect() { effect() {
for (let i = 0; i < 6; i++) powerUps.spawn(m.pos.x, m.pos.y, "ammo"); for (let i = 0; i < 6; i++) powerUps.spawn(m.pos.x + 60 * (Math.random() - 0.5), m.pos.y + 60 * (Math.random() - 0.5), "ammo");
this.count-- this.count--
}, },
remove() {} remove() {}
@@ -4248,7 +4264,7 @@
}, },
requires: "not superdeterminism", requires: "not superdeterminism",
effect() { effect() {
for (let i = 0; i < 4; i++) powerUps.spawn(m.pos.x, m.pos.y, "research"); for (let i = 0; i < 4; i++) powerUps.spawn(m.pos.x + 60 * (Math.random() - 0.5), m.pos.y + 60 * (Math.random() - 0.5), "research");
this.count-- this.count--
}, },
remove() {} remove() {}
@@ -4510,27 +4526,27 @@
}, },
remove() {} remove() {}
}, },
{ // {
name: "lubrication", // name: "lubrication",
description: "reduce block density and friction for this level", // description: "reduce block density and friction for this level",
maxCount: 9, // maxCount: 9,
count: 0, // count: 0,
numberInPool: 0, // numberInPool: 0,
isNonRefundable: true, // isNonRefundable: true,
isExperimentHide: true, // isExperimentHide: true,
isJunk: true, // isJunk: true,
allowed() { // allowed() {
return true // return true
}, // },
requires: "", // requires: "",
effect() { // effect() {
for (let i = 0; i < body.length; i++) { // for (let i = 0; i < body.length; i++) {
Matter.Body.setDensity(body[i], 0.0001) // 0.001 is normal // Matter.Body.setDensity(body[i], 0.0001) // 0.001 is normal
body[i].friction = 0.01 // body[i].friction = 0.01
} // }
}, // },
remove() {} // remove() {}
}, // },
{ {
name: "pitch", name: "pitch",
description: "oscillate the pitch of your world", description: "oscillate the pitch of your world",
@@ -5356,5 +5372,6 @@
isDamageAfterKill: null, isDamageAfterKill: null,
isHarmReduceAfterKill: null, isHarmReduceAfterKill: null,
isSwitchReality: null, isSwitchReality: null,
isResearchReality: null isResearchReality: null,
isAnthropicDamage: null
} }

View File

@@ -1,11 +1,14 @@
******************************************************** NEXT PATCH ******************************************************** ******************************************************** NEXT PATCH ********************************************************
tech: decoherence - switch realities after you research, spawn 9 research power ups mob orbitals can now be destroyed, but it takes a very large amount of damage
laser-bot upgrade: gives 75% damage, range, and energy efficiency (was 400% damage, but they ran out of energy too fast)
boom-bots are now smart about not hurting the player with explosions while doing the most damage
tech: strong anthropic principle - after anthropic principle prevents your death do 137.03599 extra damage for the rest of the level
******************************************************** BUGS ******************************************************** ******************************************************** BUGS ********************************************************
ship mode can old exit a level in the top part of the exit
use the floor of portal sensor on the player? to unstuck player use the floor of portal sensor on the player? to unstuck player
(only once on my computer) once every 7 second check isn't running code (only once on my computer) once every 7 second check isn't running code
@@ -32,6 +35,15 @@ use the floor of portal sensor on the player? to unstuck player
******************************************************** TODO ******************************************************** ******************************************************** TODO ********************************************************
tech: after using anthropic principle do 200% more damage for the rest of the level
use ship tech to make a mob mode
differences from ship to mob
graphics
take no damage from mob collision
It would be cool if you could exit mob mode
decrease healing effects by 50% decrease healing effects by 50%
decrease level scaling healing reduction decrease level scaling healing reduction
net effect: healing at difficulty 40 (level 10 hard) should be 25% higher then current levels net effect: healing at difficulty 40 (level 10 hard) should be 25% higher then current levels
@@ -44,7 +56,6 @@ bosses should have 2x health, but only do about 50 health damage
boss flag cut damage done to boss by 20x <---- boss flag cut damage done to boss by 20x <----
make bosses not have extra density make bosses not have extra density
tech: spawn a bot after taking collision damage tech: spawn a bot after taking collision damage
tech: standing wave freezes the mobs it hits tech: standing wave freezes the mobs it hits
@@ -63,11 +74,6 @@ map: laboratory
a button that spawns a heal. a button that spawns a heal.
final boss: hide boss after spawning mobs
reduce health by 1/3?
tech: after using anthropic principle do 100% more damage for the rest of the level
mechanic: immune to next collision mechanic: immune to next collision
track number of possible collisions, if number is > 0 immune and -- track number of possible collisions, if number is > 0 immune and --
graphical indication? (recolor health bar while immune) graphical indication? (recolor health bar while immune)