From 127a074b332c7ec46a3f7ba06c5430983cb78487 Mon Sep 17 00:00:00 2001 From: landgreen Date: Sun, 8 May 2022 06:39:19 -0700 Subject: [PATCH] rule 30 plasma ball damage radius is 2x bigger map collisions radius is unchanged it no longer pops after hitting mobs energy drain is 50% higher JUNK tech: rule 30 generalist cycles guns with final boss phases --- .DS_Store | Bin 6148 -> 6148 bytes js/bullet.js | 8 +++--- js/level.js | 16 ++++++----- js/player.js | 15 ++++++---- js/spawn.js | 10 +++++++ js/tech.js | 78 +++++++++++++++++++++++++++++++++++++++++++++------ todo.txt | 34 ++++------------------ 7 files changed, 108 insertions(+), 53 deletions(-) diff --git a/.DS_Store b/.DS_Store index 7ef5901852940485120503558bc62f56966a9868..be90e934cf3793b620ad0d1745ec444f14ebe6e4 100644 GIT binary patch delta 22 dcmZoMXffEJ$;_wave packet of oscillating particles
that propagates through solids", ammo: 0, - ammoPack: 120, - defaultAmmoPack: 120, + ammoPack: 115, + defaultAmmoPack: 115, have: false, wavePacketCycle: 0, delay: 40, diff --git a/js/level.js b/js/level.js index 6dc8694..5436c7a 100644 --- a/js/level.js +++ b/js/level.js @@ -16,15 +16,17 @@ const level = { start() { if (level.levelsCleared === 0) { //this code only runs on the first level // simulation.isHorizontalFlipped = true - // m.setField("time dilation") + // m.setField("plasma torch") // b.giveGuns("grenades") // tech.giveTech("rocket-propelled grenade") // tech.giveTech("electric armor") - // tech.giveTech("MIRV") - // tech.giveTech("capacitor bank") - // tech.giveTech("rotary cannon") + // tech.giveTech("plasma ball") + // tech.giveTech("rule 30") + // for (let i = 0; i < 10; i++) tech.giveTech("replication") + // tech.giveTech("decoherence") // tech.giveTech("pneumatic actuator") - // for (let i = 0; i < 1; i++) powerUps.directSpawn(450, -50, "tech"); + // for (let i = 0; i < 10; i++) powerUps.directSpawn(450, -50, "tech"); + // for (let i = 0; i < 10; i++) powerUps.directSpawn(450, -50, "research"); // for (let i = 0; i < 15; i++) tech.giveTech() // for (let i = 10; i < tech.tech.length; i++) { tech.tech[i].isBanished = true } // powerUps.research.changeRerolls(100000) @@ -2646,8 +2648,8 @@ const level = { m.addHealth(Infinity) // spawn.starter(1900, -500, 200) //big boy - for (let i = 0; i < 10; ++i) spawn.launcher(1900, -500) - // spawn.slashBoss(1900, -500) + // for (let i = 0; i < 10; ++i) spawn.launcher(1900, -500) + spawn.slashBoss(1900, -500) // spawn.launcherBoss(3200, -500) // spawn.laserTargetingBoss(1700, -500) // spawn.powerUpBoss(1900, -500) diff --git a/js/player.js b/js/player.js index fa16024..2a6b399 100644 --- a/js/player.js +++ b/js/player.js @@ -2108,6 +2108,7 @@ const m = { Matter.Composite.remove(engine.world, m.plasmaBall); } if (tech.isPlasmaBall) { + const circleRadiusScale = 2 m.plasmaBall = Bodies.circle(m.pos.x + 10 * Math.cos(m.angle), m.pos.y + 10 * Math.sin(m.angle), 1, { // collisionFilter: { // group: 0, @@ -2120,12 +2121,12 @@ const m = { isPopping: false, isAttached: false, isOn: false, - drain: 0.0011, + drain: 0.0017, radiusLimit: 10, damage: 0.8, setPositionToNose() { const nose = { x: m.pos.x + 10 * Math.cos(m.angle), y: m.pos.y + 10 * Math.sin(m.angle) } - Matter.Body.setPosition(this, Vector.add(nose, Vector.mult(Vector.normalise(Vector.sub(nose, m.pos)), this.circleRadius))); + Matter.Body.setPosition(this, Vector.add(nose, Vector.mult(Vector.normalise(Vector.sub(nose, m.pos)), circleRadiusScale * this.circleRadius))); }, fire() { this.isAttached = false; @@ -2149,6 +2150,7 @@ const m = { this.isPopping = false }, do() { + // console.log(this.circleRadius) if (this.isOn) { //collisions with map if (Matter.Query.collides(this, map).length > 0) { @@ -2203,12 +2205,13 @@ const m = { //damage nearby mobs const dmg = this.damage * m.dmgScale const arcList = [] - const dischargeRange = 150 + 1600 * tech.plasmaDischarge + 1.3 * this.circleRadius + const damageRadius = circleRadiusScale * this.circleRadius + const dischargeRange = 150 + 1600 * tech.plasmaDischarge + 1.3 * damageRadius for (let i = 0, len = mob.length; i < len; i++) { if (mob[i].alive && (!mob[i].isBadTarget || mob[i].isMobBullet)) { const sub = Vector.magnitude(Vector.sub(this.position, mob[i].position)) - if (sub < this.circleRadius + mob[i].radius) { - if (!this.isAttached && !mob[i].isMobBullet) this.isPopping = true + if (sub < damageRadius + mob[i].radius) { + // if (!this.isAttached && !mob[i].isMobBullet) this.isPopping = true mob[i].damage(dmg); if (mob[i].speed > 5) { Matter.Body.setVelocity(mob[i], { //friction @@ -2271,7 +2274,7 @@ const m = { } //graphics - const radius = this.circleRadius * (0.99 + 0.02 * Math.random()) + 3 * Math.random() + const radius = circleRadiusScale * this.circleRadius * (0.99 + 0.02 * Math.random()) + 3 * Math.random() const gradient = ctx.createRadialGradient(this.position.x, this.position.y, 0, this.position.x, this.position.y, radius); const alpha = this.alpha + 0.1 * Math.random() gradient.addColorStop(0, `rgba(255,255,255,${alpha})`); diff --git a/js/spawn.js b/js/spawn.js index 9688754..99a2a38 100644 --- a/js/spawn.js +++ b/js/spawn.js @@ -479,6 +479,11 @@ const spawn = { Matter.Body.scale(this, 0.1, 0.1); Matter.Body.setDensity(me, 100 * density); //extra dense //normal is 0.001 //makes effective life much larger } + if (tech.isGunCycle) { + b.inventoryGun++; + if (b.inventoryGun > b.inventory.length - 1) b.inventoryGun = 0; + simulation.switchGun(); + } } } else if (this.mode !== 3) { //all three modes at once this.cycle = 0; @@ -495,6 +500,11 @@ const spawn = { this.rotateVelocity = 0.001 * (player.position.x > this.position.x ? 1 : -1) //rotate so that the player can get away // if (!this.isShielded) spawn.shield(this, x, y, 1); //regen shield here ? this.modeDo = this.modeAll + if (tech.isGunCycle) { + b.inventoryGun++; + if (b.inventoryGun > b.inventory.length - 1) b.inventoryGun = 0; + simulation.switchGun(); + } } // } }; diff --git a/js/tech.js b/js/tech.js index fa56668..b840e2d 100644 --- a/js/tech.js +++ b/js/tech.js @@ -4814,7 +4814,7 @@ const tech = { { name: "electric armor", // description: "explosions do no harm
while your energy is above 98%", - description: "explosion harm is reduce by 99%, but
they drain 15 energy and have more force", + description: "explosion harm is reduced by 99%, but
they drain 15 energy and have more force", isGunTech: true, maxCount: 1, count: 0, @@ -7760,6 +7760,68 @@ const tech = { }, remove() {} }, + { + name: "rule 30", + maxCount: 1, + count: 0, + frequency: 0, + isJunk: true, + allowed() { + return true + }, + requires: "", + effect() { + powerUps.spawn(m.pos.x - 50 + 100 * (Math.random() - 0.5), m.pos.y + 100 * (Math.random() - 0.5), "research"); + }, + remove() {}, + state: [ + [false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false] + ], + rule30(state, a, b, c) { + if (state[a] && state[b] && state[c]) return false; // TTT => F + if (state[a] && state[b] && !state[c]) return false; // TTF => F + if (state[a] && !state[b] && state[c]) return false; //TFT => F + if (state[a] && !state[b] && !state[c]) return true; //TFF => T + if (!state[a] && state[b] && state[c]) return true; //FTT => T + if (!state[a] && state[b] && !state[c]) return true; //FTF => T + if (!state[a] && !state[b] && state[c]) return true; //FFT => T + if (!state[a] && !state[b] && !state[c]) return false; //FFF => F + }, + id: 0, + descriptionFunction() { + const loop = () => { + if ((simulation.paused || simulation.isChoosing) && m.alive && !build.isExperimentSelection) { //&& (!simulation.isChoosing || this.count === 0) + let b = []; //produce next row + b.push(this.rule30(this.state[this.state.length - 1], this.state[this.state.length - 1].length - 1, 0, 1)); //left edge wrap around + for (let i = 1; i < this.state[this.state.length - 1].length - 1; i++) { //apply rule to the rest of the array + b.push(this.rule30(this.state[this.state.length - 1], i - 1, i, i + 1)); + } + b.push(this.rule30(this.state[this.state.length - 1], this.state[this.state.length - 1].length - 2, this.state[this.state.length - 1].length - 1, 0)); //right edge wrap around + this.state.push(b) + if (document.getElementById(`cellular-rule-id${this.id}`)) document.getElementById(`cellular-rule-id${this.id}`).innerHTML = this.outputText() //convert to squares and send HTML + setTimeout(() => { loop() }, 500); + } + } + setTimeout(() => { loop() }, 500); + this.id++ + return `${this.outputText()}` + }, + outputText() { + let text = "" + for (let j = 0; j < this.state.length; j++) { + text += "

" + for (let i = 0; i < this.state[j].length; i++) { + if (this.state[j][i]) { + text += "⬛" //"█" //"■" + } else { + text += "⬜" //"    " //"□" + } + } + text += "

" + } + return text + }, + }, { name: "discount", description: "get 3 random JUNK tech for the price of 1!", @@ -7853,12 +7915,12 @@ const tech = { mob[i].death(); } } - for (let i = powerUp.length - 1; i > -1; i--) { - if (powerUp[i].name !== "ammo") { - Matter.Composite.remove(engine.world, powerUp[i]); - powerUp.splice(i, 1); - } - } + // for (let i = powerUp.length - 1; i > -1; i--) { + // if (powerUp[i].name !== "ammo") { + // Matter.Composite.remove(engine.world, powerUp[i]); + // powerUp.splice(i, 1); + // } + // } }, remove() {} }, @@ -9538,7 +9600,7 @@ const tech = { }, { name: "NFT", - descriptionFunction() { return `buy your current game seed: ${Math.initialSeed}
no one is allow to use your seeds
if they use them they are gonna get in trouble

your seeds: ${localSettings.personalSeeds.join()}` }, + descriptionFunction() { return `buy your current game seed: ${Math.initialSeed}
no one is allowed to use your seeds
if they use them they are gonna get in trouble

your seeds: ${localSettings.personalSeeds.join()}` }, maxCount: 1, count: 0, frequency: 0, diff --git a/todo.txt b/todo.txt index e07ebd8..0ee1a9c 100644 --- a/todo.txt +++ b/todo.txt @@ -1,25 +1,16 @@ ******************************************************** NEXT PATCH ************************************************** -electric reactive armor renamed electric armor - reduce harm from explosions by 99%, drain 15 energy, - and greatly increase knock back - it does look like you can go through some thin walls, - but that's how it is in the real world, so not a bug +plasma ball damage radius is 2x bigger + map collisions radius is unchanged + it no longer pops after hitting mobs + energy drain is 50% higher -grenades have 40% more ammo +JUNK tech: rule 30 -time dilation generates 12->18 energy/s +generalist cycles guns with final boss phases ******************************************************** TODO ******************************************************** -a self referencing tech that switches states every time you access the text of it - switches state with it runs the description function - could be ON/OFF tech - could be JUNK - -gunIndex section at the end seems pointless - merge with the choosing functions? - add foam tech that makes foam stronger vs. shields tech: eternalism - don't pause time during draft @@ -42,19 +33,6 @@ tech expansion: should also make other fields do things nonrefundable tech don't display, this is confusing maybe they can show up but greyed out or something -Tech could probably be indexed, something like running -tech.index = new Map(); -for (let i = 0; i < tech.tech.length; i++) { - tech.index.set(tech.tech.name, tech.tech); -} - -So when you do something like tech.giveTech("nematodes") it can just do -const queriedTech = tech.index.get("nematodes"); -if (queriedTech) { - queriedTech.count++; - queriedTech.effect(); -} - guntech fire a bullet that fires nail fragments after 1s in the same direction as the original bullet like overwatch roadhog