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
This commit is contained in:
landgreen
2022-05-08 06:39:19 -07:00
parent d74e7b53fe
commit 127a074b33
7 changed files with 108 additions and 53 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -5146,11 +5146,11 @@ const b = {
let knock, spread let knock, spread
if (input.down) { if (input.down) {
spread = 0.65 spread = 0.65
m.fireCDcycle = m.cycle + Math.floor(60 * b.fireCDscale) // cool down m.fireCDcycle = m.cycle + Math.floor(69 * b.fireCDscale) // cool down
if (tech.isShotgunImmune && m.immuneCycle < m.cycle + Math.floor(60 * b.fireCDscale)) m.immuneCycle = m.cycle + Math.floor(60 * b.fireCDscale); //player is immune to damage for 30 cycles if (tech.isShotgunImmune && m.immuneCycle < m.cycle + Math.floor(60 * b.fireCDscale)) m.immuneCycle = m.cycle + Math.floor(60 * b.fireCDscale); //player is immune to damage for 30 cycles
knock = 0.01 knock = 0.01
} else { } else {
m.fireCDcycle = m.cycle + Math.floor(47 * b.fireCDscale) // cool down m.fireCDcycle = m.cycle + Math.floor(53 * b.fireCDscale) // cool down
if (tech.isShotgunImmune && m.immuneCycle < m.cycle + Math.floor(47 * b.fireCDscale)) m.immuneCycle = m.cycle + Math.floor(47 * b.fireCDscale); //player is immune to damage for 30 cycles if (tech.isShotgunImmune && m.immuneCycle < m.cycle + Math.floor(47 * b.fireCDscale)) m.immuneCycle = m.cycle + Math.floor(47 * b.fireCDscale); //player is immune to damage for 30 cycles
spread = 1.3 spread = 1.3
knock = 0.1 knock = 0.1
@@ -5496,8 +5496,8 @@ const b = {
name: "matter wave", name: "matter wave",
description: "emit a <strong>wave packet</strong> of oscillating particles<br>that propagates through <strong>solids</strong>", description: "emit a <strong>wave packet</strong> of oscillating particles<br>that propagates through <strong>solids</strong>",
ammo: 0, ammo: 0,
ammoPack: 120, ammoPack: 115,
defaultAmmoPack: 120, defaultAmmoPack: 115,
have: false, have: false,
wavePacketCycle: 0, wavePacketCycle: 0,
delay: 40, delay: 40,

View File

@@ -16,15 +16,17 @@ 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.isHorizontalFlipped = true // simulation.isHorizontalFlipped = true
// m.setField("time dilation") // m.setField("plasma torch")
// b.giveGuns("grenades") // b.giveGuns("grenades")
// tech.giveTech("rocket-propelled grenade") // tech.giveTech("rocket-propelled grenade")
// tech.giveTech("electric armor") // tech.giveTech("electric armor")
// tech.giveTech("MIRV") // tech.giveTech("plasma ball")
// tech.giveTech("capacitor bank") // tech.giveTech("rule 30")
// tech.giveTech("rotary cannon") // for (let i = 0; i < 10; i++) tech.giveTech("replication")
// tech.giveTech("decoherence")
// tech.giveTech("pneumatic actuator") // 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 = 0; i < 15; i++) tech.giveTech()
// for (let i = 10; i < tech.tech.length; i++) { tech.tech[i].isBanished = true } // for (let i = 10; i < tech.tech.length; i++) { tech.tech[i].isBanished = true }
// powerUps.research.changeRerolls(100000) // powerUps.research.changeRerolls(100000)
@@ -2646,8 +2648,8 @@ const level = {
m.addHealth(Infinity) m.addHealth(Infinity)
// spawn.starter(1900, -500, 200) //big boy // spawn.starter(1900, -500, 200) //big boy
for (let i = 0; i < 10; ++i) spawn.launcher(1900, -500) // for (let i = 0; i < 10; ++i) spawn.launcher(1900, -500)
// spawn.slashBoss(1900, -500) spawn.slashBoss(1900, -500)
// spawn.launcherBoss(3200, -500) // spawn.launcherBoss(3200, -500)
// spawn.laserTargetingBoss(1700, -500) // spawn.laserTargetingBoss(1700, -500)
// spawn.powerUpBoss(1900, -500) // spawn.powerUpBoss(1900, -500)

View File

@@ -2108,6 +2108,7 @@ const m = {
Matter.Composite.remove(engine.world, m.plasmaBall); Matter.Composite.remove(engine.world, m.plasmaBall);
} }
if (tech.isPlasmaBall) { 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, { m.plasmaBall = Bodies.circle(m.pos.x + 10 * Math.cos(m.angle), m.pos.y + 10 * Math.sin(m.angle), 1, {
// collisionFilter: { // collisionFilter: {
// group: 0, // group: 0,
@@ -2120,12 +2121,12 @@ const m = {
isPopping: false, isPopping: false,
isAttached: false, isAttached: false,
isOn: false, isOn: false,
drain: 0.0011, drain: 0.0017,
radiusLimit: 10, radiusLimit: 10,
damage: 0.8, damage: 0.8,
setPositionToNose() { setPositionToNose() {
const nose = { x: m.pos.x + 10 * Math.cos(m.angle), y: m.pos.y + 10 * Math.sin(m.angle) } 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() { fire() {
this.isAttached = false; this.isAttached = false;
@@ -2149,6 +2150,7 @@ const m = {
this.isPopping = false this.isPopping = false
}, },
do() { do() {
// console.log(this.circleRadius)
if (this.isOn) { if (this.isOn) {
//collisions with map //collisions with map
if (Matter.Query.collides(this, map).length > 0) { if (Matter.Query.collides(this, map).length > 0) {
@@ -2203,12 +2205,13 @@ const m = {
//damage nearby mobs //damage nearby mobs
const dmg = this.damage * m.dmgScale const dmg = this.damage * m.dmgScale
const arcList = [] 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++) { for (let i = 0, len = mob.length; i < len; i++) {
if (mob[i].alive && (!mob[i].isBadTarget || mob[i].isMobBullet)) { if (mob[i].alive && (!mob[i].isBadTarget || mob[i].isMobBullet)) {
const sub = Vector.magnitude(Vector.sub(this.position, mob[i].position)) const sub = Vector.magnitude(Vector.sub(this.position, mob[i].position))
if (sub < this.circleRadius + mob[i].radius) { if (sub < damageRadius + mob[i].radius) {
if (!this.isAttached && !mob[i].isMobBullet) this.isPopping = true // if (!this.isAttached && !mob[i].isMobBullet) this.isPopping = true
mob[i].damage(dmg); mob[i].damage(dmg);
if (mob[i].speed > 5) { if (mob[i].speed > 5) {
Matter.Body.setVelocity(mob[i], { //friction Matter.Body.setVelocity(mob[i], { //friction
@@ -2271,7 +2274,7 @@ const m = {
} }
//graphics //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 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() const alpha = this.alpha + 0.1 * Math.random()
gradient.addColorStop(0, `rgba(255,255,255,${alpha})`); gradient.addColorStop(0, `rgba(255,255,255,${alpha})`);

View File

@@ -479,6 +479,11 @@ const spawn = {
Matter.Body.scale(this, 0.1, 0.1); 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 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 } else if (this.mode !== 3) { //all three modes at once
this.cycle = 0; 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 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 ? // if (!this.isShielded) spawn.shield(this, x, y, 1); //regen shield here ?
this.modeDo = this.modeAll this.modeDo = this.modeAll
if (tech.isGunCycle) {
b.inventoryGun++;
if (b.inventoryGun > b.inventory.length - 1) b.inventoryGun = 0;
simulation.switchGun();
}
} }
// } // }
}; };

View File

@@ -4814,7 +4814,7 @@ const tech = {
{ {
name: "electric armor", name: "electric armor",
// description: "<strong class='color-e'>explosions</strong> do no <strong class='color-harm'>harm</strong><br> while your <strong class='color-f'>energy</strong> is above <strong>98%</strong>", // description: "<strong class='color-e'>explosions</strong> do no <strong class='color-harm'>harm</strong><br> while your <strong class='color-f'>energy</strong> is above <strong>98%</strong>",
description: "<strong class='color-e'>explosion</strong> <strong class='color-harm'>harm</strong> is reduce by <strong>99%</strong>, but<br>they drain <strong>15</strong> <strong class='color-f'>energy</strong> and have more force", description: "<strong class='color-e'>explosion</strong> <strong class='color-harm'>harm</strong> is reduced by <strong>99%</strong>, but<br>they drain <strong>15</strong> <strong class='color-f'>energy</strong> and have more force",
isGunTech: true, isGunTech: true,
maxCount: 1, maxCount: 1,
count: 0, count: 0,
@@ -7760,6 +7760,68 @@ const tech = {
}, },
remove() {} 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 `<span id = "cellular-rule-id${this.id}" style = "letter-spacing: 0px;font-size: 50%;line-height: normal;">${this.outputText()}</span>`
},
outputText() {
let text = ""
for (let j = 0; j < this.state.length; j++) {
text += "<p style = 'margin-bottom: -11px;'>"
for (let i = 0; i < this.state[j].length; i++) {
if (this.state[j][i]) {
text += "⬛" //"█" //"■"
} else {
text += "⬜" //"&nbsp;&nbsp;&nbsp;&nbsp;" //"□"
}
}
text += "</p>"
}
return text
},
},
{ {
name: "discount", name: "discount",
description: "get 3 random <strong class='color-j'>JUNK</strong> <strong class='color-m'>tech</strong> for the price of 1!", description: "get 3 random <strong class='color-j'>JUNK</strong> <strong class='color-m'>tech</strong> for the price of 1!",
@@ -7853,12 +7915,12 @@ const tech = {
mob[i].death(); mob[i].death();
} }
} }
for (let i = powerUp.length - 1; i > -1; i--) { // for (let i = powerUp.length - 1; i > -1; i--) {
if (powerUp[i].name !== "ammo") { // if (powerUp[i].name !== "ammo") {
Matter.Composite.remove(engine.world, powerUp[i]); // Matter.Composite.remove(engine.world, powerUp[i]);
powerUp.splice(i, 1); // powerUp.splice(i, 1);
} // }
} // }
}, },
remove() {} remove() {}
}, },
@@ -9538,7 +9600,7 @@ const tech = {
}, },
{ {
name: "NFT", name: "NFT",
descriptionFunction() { return `buy your current game seed: <strong style = 'font-size:130%;'>${Math.initialSeed}</strong><br><em>no one is allow to use your seeds<br>if they use them they are gonna get in trouble</em><br>your seeds: <span style = 'font-size:70%;'>${localSettings.personalSeeds.join()}</span>` }, descriptionFunction() { return `buy your current game seed: <strong style = 'font-size:130%;'>${Math.initialSeed}</strong><br><em>no one is allowed to use your seeds<br>if they use them they are gonna get in trouble</em><br>your seeds: <span style = 'font-size:70%;'>${localSettings.personalSeeds.join()}</span>` },
maxCount: 1, maxCount: 1,
count: 0, count: 0,
frequency: 0, frequency: 0,

View File

@@ -1,25 +1,16 @@
******************************************************** NEXT PATCH ************************************************** ******************************************************** NEXT PATCH **************************************************
electric reactive armor renamed electric armor plasma ball damage radius is 2x bigger
reduce harm from explosions by 99%, drain 15 energy, map collisions radius is unchanged
and greatly increase knock back it no longer pops after hitting mobs
it does look like you can go through some thin walls, energy drain is 50% higher
but that's how it is in the real world, so not a bug
grenades have 40% more ammo JUNK tech: rule 30
time dilation generates 12->18 energy/s generalist cycles guns with final boss phases
******************************************************** TODO ******************************************************** ******************************************************** 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 add foam tech that makes foam stronger vs. shields
tech: eternalism - don't pause time during draft 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 nonrefundable tech don't display, this is confusing
maybe they can show up but greyed out or something 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 guntech fire a bullet that fires nail fragments after 1s in the same direction as the original bullet
like overwatch roadhog like overwatch roadhog