diff --git a/.DS_Store b/.DS_Store
index 7ef5901..be90e93 100644
Binary files a/.DS_Store and b/.DS_Store differ
diff --git a/js/bullet.js b/js/bullet.js
index 6523c9c..c82b684 100644
--- a/js/bullet.js
+++ b/js/bullet.js
@@ -5146,11 +5146,11 @@ const b = {
let knock, spread
if (input.down) {
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
knock = 0.01
} 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
spread = 1.3
knock = 0.1
@@ -5496,8 +5496,8 @@ const b = {
name: "matter wave",
description: "emit a 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}