crystallizer

random tech spawn chance now scales with levels clear (zero chance after level 10)
  (it used to scale with total tech acquired, but you probably will not even notice this change)

tech: crystallizer - mods produce ice-IX crystals when they die

tech pulse and tech slow light now work together for laser beam,
 (I think it is pretty dangerous to try them together though)
This commit is contained in:
landgreen
2021-05-08 07:35:25 -07:00
parent 59b124392c
commit ce169ba860
8 changed files with 104 additions and 65 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -445,17 +445,17 @@ const b = {
} }
} }
}, },
pulse(charge, angle = m.angle) { pulse(charge, angle = m.angle, where = m.pos) {
let best; let best;
let explosionRadius = 6 * charge let explosionRadius = 6 * charge
let range = 5000 let range = 5000
const path = [{ const path = [{
x: m.pos.x + 20 * Math.cos(angle), x: where.x + 20 * Math.cos(angle),
y: m.pos.y + 20 * Math.sin(angle) y: where.y + 20 * Math.sin(angle)
}, },
{ {
x: m.pos.x + range * Math.cos(angle), x: where.x + range * Math.cos(angle),
y: m.pos.y + range * Math.sin(angle) y: where.y + range * Math.sin(angle)
} }
]; ];
const vertexCollision = function(v1, v1End, domain) { const vertexCollision = function(v1, v1End, domain) {
@@ -4477,7 +4477,6 @@ const b = {
this.do = () => {}; this.do = () => {};
if (tech.isPulseLaser) { if (tech.isPulseLaser) {
this.fire = () => { this.fire = () => {
const drain = 0.01 * tech.isLaserDiode / b.fireCD const drain = 0.01 * tech.isLaserDiode / b.fireCD
if (m.energy > drain) { if (m.energy > drain) {
m.energy -= m.fieldRegen m.energy -= m.fieldRegen
@@ -4487,6 +4486,35 @@ const b = {
} }
} }
} }
if (tech.historyLaser) {
this.do = () => {
const len = 1 + 2 * tech.historyLaser
const spacing = Math.ceil(40 - 9 * tech.historyLaser)
if (this.charge > 0) {
//draw charge level
ctx.fillStyle = `rgba(255,0,0,${0.09 * Math.sqrt(this.charge)})`;
ctx.beginPath();
const mag = 4.5 * Math.sqrt(this.charge)
for (let i = 0; i < len; i++) {
const history = m.history[(m.cycle - i * spacing) % 600]
const off = history.yOff - 24.2859
ctx.moveTo(history.position.x, history.position.y - off);
ctx.ellipse(history.position.x, history.position.y - off, mag, mag * 0.5, history.angle, 0, 2 * Math.PI)
}
ctx.fill();
//fire
if (!input.fire) {
m.fireCDcycle = m.cycle + 10; // cool down
for (let i = 1; i < len; i++) {
const history = m.history[(m.cycle - i * spacing) % 600]
const off = history.yOff - 24.2859
b.pulse(1.4 * this.charge, history.angle, { x: history.position.x, y: history.position.y - off })
}
this.charge = 0;
}
}
};
} else {
this.do = () => { this.do = () => {
if (this.charge > 0) { if (this.charge > 0) {
//draw charge level //draw charge level
@@ -4494,6 +4522,7 @@ const b = {
ctx.beginPath(); ctx.beginPath();
ctx.arc(m.pos.x, m.pos.y, 4.2 * Math.sqrt(this.charge), 0, 2 * Math.PI); ctx.arc(m.pos.x, m.pos.y, 4.2 * Math.sqrt(this.charge), 0, 2 * Math.PI);
ctx.fill(); ctx.fill();
//fire
if (!input.fire) { if (!input.fire) {
m.fireCDcycle = m.cycle + 10; // cool down m.fireCDcycle = m.cycle + 10; // cool down
if (tech.beamSplitter) { if (tech.beamSplitter) {
@@ -4507,6 +4536,8 @@ const b = {
} }
} }
}; };
}
} else if (tech.beamSplitter) { } else if (tech.beamSplitter) {
this.fire = this.fireSplit this.fire = this.fireSplit
} else if (tech.historyLaser) { } else if (tech.historyLaser) {
@@ -4532,13 +4563,9 @@ const b = {
b.laser(); b.laser();
} }
}, },
// laser(where = { firePulse() {
// x: m.pos.x + 20 * Math.cos(m.angle),
// y: m.pos.y + 20 * Math.sin(m.angle) },
// }, whereEnd = {
// x: where.x + 3000 * Math.cos(m.angle),
// y: where.y + 3000 * Math.sin(m.angle)
// }, dmg = tech.laserDamage, reflections = tech.laserReflections, isThickBeam = false, push = 1) {
fireSplit() { fireSplit() {
if (m.energy < tech.laserFieldDrain) { if (m.energy < tech.laserFieldDrain) {
m.fireCDcycle = m.cycle + 100; // cool down if out of energy m.fireCDcycle = m.cycle + 100; // cool down if out of energy

View File

@@ -12,17 +12,19 @@ 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(90) // level.difficultyIncrease(30)
// simulation.zoomScale = 1000; // simulation.zoomScale = 1000;
// simulation.setZoom(); // simulation.setZoom();
// m.setField("metamaterial cloaking") // m.setField("metamaterial cloaking")
// b.giveGuns("wave beam") // b.giveGuns("wave beam")
// b.giveGuns("laser")
// tech.isExplodeRadio = true // tech.isExplodeRadio = true
// tech.giveTech("phase velocity") // tech.giveTech("pulse")
// for (let i = 0; i < 1; i++) tech.giveTech("crystallizer")
// for (let i = 0; i < 3; i++) tech.giveTech("packet length") // for (let i = 0; i < 3; i++) tech.giveTech("packet length")
// for (let i = 0; i < 3; i++) tech.giveTech("bound state") // for (let i = 0; i < 3; i++) tech.giveTech("bound state")
// for (let i = 0; i < 3; i++) tech.giveTech("propagation") // for (let i = 0; i < 3; i++) tech.giveTech("propagation")
// for (let i = 0; i < 3; i++) tech.giveTech("amplitude") // for (let i = 0; i < 9; i++) tech.giveTech("slow light")
level.intro(); //starting level level.intro(); //starting level
// level.testing(); //not in rotation // level.testing(); //not in rotation

View File

@@ -1053,6 +1053,11 @@ const mobs = {
this.alive = false; //triggers mob removal in mob[i].replace(i) this.alive = false; //triggers mob removal in mob[i].replace(i)
if (this.isDropPowerUp) { if (this.isDropPowerUp) {
if (tech.iceIXOnDeath && this.isSlowed && Math.random() > 0.5) {
for (let i = 0, len = 3 * Math.sqrt(this.mass) * tech.iceIXOnDeath; i < len; i++) b.iceIX(3, Math.random() * 2 * Math.PI, this.position)
}
if (tech.deathSpawnsFromBoss || (tech.deathSpawns && this.isDropPowerUp)) { if (tech.deathSpawnsFromBoss || (tech.deathSpawns && this.isDropPowerUp)) {
const spawns = tech.deathSpawns + tech.deathSpawnsFromBoss const spawns = tech.deathSpawns + tech.deathSpawnsFromBoss
const len = Math.min(12, spawns * Math.ceil(Math.random() * simulation.difficulty * spawns)) const len = Math.min(12, spawns * Math.ceil(Math.random() * simulation.difficulty * spawns))

View File

@@ -115,7 +115,9 @@ const powerUps = {
if (tech.isDeathAvoid && document.getElementById("tech-anthropic")) { if (tech.isDeathAvoid && document.getElementById("tech-anthropic")) {
document.getElementById("tech-anthropic").innerHTML = `-${powerUps.research.count}` document.getElementById("tech-anthropic").innerHTML = `-${powerUps.research.count}`
} }
if (tech.renormalization && Math.random() < 0.37 && amount < 0) powerUps.spawn(m.pos.x, m.pos.y, "research"); if (tech.renormalization && Math.random() < 0.37 && amount < 0) {
for (let i = 0, len = -amount; i < len; i++) powerUps.spawn(m.pos.x, m.pos.y, "research");
}
if (tech.isRerollHaste) { if (tech.isRerollHaste) {
if (powerUps.research.count === 0) { if (powerUps.research.count === 0) {
tech.researchHaste = 0.66; tech.researchHaste = 0.66;
@@ -532,7 +534,8 @@ const powerUps = {
powerUps.spawn(x, y, "gun"); powerUps.spawn(x, y, "gun");
return; return;
} }
if (Math.random() < 0.0027 * (22 - tech.totalCount)) { //a new tech has a low chance for each not acquired tech up to 25 // if (Math.random() < 0.0027 * (22 - tech.totalCount)) { //a new tech has a low chance for each not acquired tech up to 25
if (Math.random() < 0.005 * (10 - level.levelsCleared)) { //a new tech has a low chance that decreases in later levels
powerUps.spawn(x, y, "tech"); powerUps.spawn(x, y, "tech");
return; return;
} }

View File

@@ -606,7 +606,7 @@ const spawn = {
me.seeAtDistance2 = 200000 //1400000; me.seeAtDistance2 = 200000 //1400000;
me.cellMassMax = 70 me.cellMassMax = 70
me.stroke = "transparent" me.stroke = "transparent"
me.collisionFilter.mask = cat.player | cat.bullet | cat.body //| cat.map //"rgba(255,60,0,0.3)" me.collisionFilter.mask = cat.player | cat.bullet //| cat.body //| cat.map //"rgba(255,60,0,0.3)"
// Matter.Body.setDensity(me, 0.0014) // normal density is 0.001 // Matter.Body.setDensity(me, 0.0014) // normal density is 0.001
Matter.Body.setAngularVelocity(me, 0.12 * (Math.random() - 0.5)) Matter.Body.setAngularVelocity(me, 0.12 * (Math.random() - 0.5))
// spawn.shield(me, x, y, 1); // spawn.shield(me, x, y, 1);
@@ -687,7 +687,7 @@ const spawn = {
me.seeAtDistance2 = 1000000; me.seeAtDistance2 = 1000000;
me.accelMag = 0.0005 * simulation.accelScale; me.accelMag = 0.0005 * simulation.accelScale;
Matter.Body.setDensity(me, 0.00035); //normal is 0.001 Matter.Body.setDensity(me, 0.00035); //normal is 0.001
me.collisionFilter.mask = cat.bullet | cat.player | cat.body me.collisionFilter.mask = cat.bullet | cat.player //| cat.body
me.memory = Infinity; me.memory = Infinity;
me.seePlayerFreq = 30 me.seePlayerFreq = 30
me.lockedOn = null; me.lockedOn = null;
@@ -3168,7 +3168,7 @@ const spawn = {
me.memory = Infinity; me.memory = Infinity;
me.frictionAir = 0.01; me.frictionAir = 0.01;
me.accelMag = 0.00004 * simulation.accelScale; me.accelMag = 0.00004 * simulation.accelScale;
me.collisionFilter.mask = cat.player | cat.bullet | cat.body me.collisionFilter.mask = cat.player | cat.bullet //| cat.body
spawn.shield(me, x, y, 1); spawn.shield(me, x, y, 1);
const rangeInnerVsOuter = Math.random() const rangeInnerVsOuter = Math.random()

View File

@@ -877,7 +877,7 @@
count: 0, count: 0,
frequency: 2, frequency: 2,
allowed() { allowed() {
return (tech.haveGunCheck("missiles") || tech.isIncendiary || (tech.haveGunCheck("grenades") && !tech.isNeutronBomb) || tech.haveGunCheck("vacuum bomb") || tech.isPulseLaser || tech.isMissileField || tech.boomBotCount > 1) && !tech.sporesOnDeath && !tech.nailsDeathMob && !tech.botSpawner && !tech.isMobBlockFling return (tech.haveGunCheck("missiles") || tech.isIncendiary || (tech.haveGunCheck("grenades") && !tech.isNeutronBomb) || tech.haveGunCheck("vacuum bomb") || tech.isPulseLaser || tech.isMissileField || tech.boomBotCount > 1) && !tech.sporesOnDeath && !tech.nailsDeathMob && !tech.botSpawner && !tech.isMobBlockFling && !tech.iceIXOnDeath
}, },
requires: "an explosive damage source, no other mob death tech", requires: "an explosive damage source, no other mob death tech",
effect: () => { effect: () => {
@@ -887,6 +887,23 @@
tech.isExplodeMob = false; tech.isExplodeMob = false;
} }
}, },
{
name: "crystallizer",
description: "after <strong class='color-s'>frozen</strong> mobs <strong>die</strong><br>they have a chance shatter into <strong class='color-s'>ice IX</strong> crystals",
maxCount: 9,
count: 0,
frequency: 2,
allowed() {
return (tech.isIceCrystals || tech.isSporeFreeze || tech.isIceField || tech.relayIce || tech.blockingIce > 1) && !tech.sporesOnDeath && !tech.isExplodeMob && !tech.botSpawner && !tech.isMobBlockFling && !tech.nailsDeathMob
},
requires: "a localized freeze effect, no other mob death tech",
effect() {
tech.iceIXOnDeath++
},
remove() {
tech.iceIXOnDeath = 0
}
},
{ {
name: "impact shear", name: "impact shear",
description: "mobs release a <strong>nail</strong> when they <strong>die</strong><br><em>nails target nearby mobs</em>", description: "mobs release a <strong>nail</strong> when they <strong>die</strong><br><em>nails target nearby mobs</em>",
@@ -894,7 +911,7 @@
count: 0, count: 0,
frequency: 2, frequency: 2,
allowed() { allowed() {
return !tech.sporesOnDeath && !tech.isExplodeMob && !tech.botSpawner && !tech.isMobBlockFling return !tech.sporesOnDeath && !tech.isExplodeMob && !tech.botSpawner && !tech.isMobBlockFling && !tech.iceIXOnDeath
}, },
requires: "no other mob death tech", requires: "no other mob death tech",
effect: () => { effect: () => {
@@ -911,7 +928,7 @@
count: 0, count: 0,
frequency: 2, frequency: 2,
allowed() { allowed() {
return !tech.nailsDeathMob && !tech.isExplodeMob && !tech.botSpawner && !tech.isMobBlockFling return !tech.nailsDeathMob && !tech.isExplodeMob && !tech.botSpawner && !tech.isMobBlockFling && !tech.iceIXOnDeath
}, },
requires: "no other mob death tech", requires: "no other mob death tech",
effect() { effect() {
@@ -988,7 +1005,7 @@
frequency: 1, frequency: 1,
isBotTech: true, isBotTech: true,
allowed() { allowed() {
return !tech.sporesOnDeath && !tech.nailsDeathMob && !tech.isExplodeMob && !tech.isMobBlockFling return !tech.sporesOnDeath && !tech.nailsDeathMob && !tech.isExplodeMob && !tech.isMobBlockFling && !tech.iceIXOnDeath
}, },
requires: "no other mob death tech", requires: "no other mob death tech",
effect() { effect() {
@@ -1504,7 +1521,7 @@
frequency: 4, frequency: 4,
frequencyDefault: 4, frequencyDefault: 4,
allowed() { allowed() {
return tech.throwChargeRate > 1 && !tech.nailsDeathMob && !tech.sporesOnDeath && !tech.isExplodeMob && !tech.botSpawner return tech.throwChargeRate > 1 && !tech.nailsDeathMob && !tech.sporesOnDeath && !tech.isExplodeMob && !tech.botSpawner && !tech.iceIXOnDeath
}, },
requires: "mass driver, no other mob death tech", requires: "mass driver, no other mob death tech",
effect() { effect() {
@@ -4460,7 +4477,7 @@
count: 0, count: 0,
frequency: 2, frequency: 2,
allowed() { allowed() {
return tech.haveGunCheck("laser") && tech.laserReflections < 3 && !tech.beamSplitter && !tech.isPulseLaser && !tech.isWideLaser return tech.haveGunCheck("laser") && tech.laserReflections < 3 && !tech.beamSplitter && !tech.isWideLaser
}, },
requires: "laser, not specular reflection, diffraction grating, diffuse beam", requires: "laser, not specular reflection, diffraction grating, diffuse beam",
effect() { effect() {
@@ -4488,7 +4505,7 @@
count: 0, count: 0,
frequency: 2, frequency: 2,
allowed() { allowed() {
return tech.haveGunCheck("laser") && tech.laserReflections < 3 && !tech.isWideLaser && !tech.historyLaser return tech.haveGunCheck("laser") && tech.laserReflections < 3 && !tech.isWideLaser
}, },
requires: "laser, not specular reflection, not diffuse", requires: "laser, not specular reflection, not diffuse",
effect() { effect() {
@@ -6622,5 +6639,6 @@
waveBeamSpeed: null, waveBeamSpeed: null,
wavePacketAmplitude: null, wavePacketAmplitude: null,
waveLengthRange: null, waveLengthRange: null,
isCollisionRealitySwitch: null isCollisionRealitySwitch: null,
iceIXOnDeath: null
} }

View File

@@ -1,13 +1,11 @@
******************************************************** NEXT PATCH ******************************************************** ******************************************************** NEXT PATCH ********************************************************
new COMMUNITY LEVEL vats by Dablux on discord!
(also the community map order wasn't randomizing right and was giving an extra level before the final boss)
******************************************************** BUGS ******************************************************** ******************************************************** BUGS ********************************************************
(once) CPT gun only rewound 0.25 seconds (once) CPT gun only rewound 0.25 seconds
after a randomize run (non-unityary) after a randomize run (non-unitary)
had enough energy had enough energy
increase the width on the grid by a few pixels so that very small screens or people with odd fonts don't goto a new line increase the width on the grid by a few pixels so that very small screens or people with odd fonts don't goto a new line
@@ -39,25 +37,11 @@ is there a way to check if the player is stuck inside the map or block
(repeatable almost every time) bug - mines spawn extra mines when fired at thin map wall while jumping (repeatable almost every time) bug - mines spawn extra mines when fired at thin map wall while jumping
******************************************************** TODO ******************************************************** ******************************************************** TODO ********************************************************
make all of a packet have the same angle
also position? but how
spawn the entire packet in an instant
wave tech: delay similar to quantum foam
firing makes the entire packet, but with a delay?
wave tech: dispersion - add noise and damage to waves
wave tech: chirp - amplitude and damage increases towards the end of the wavePacket
wave tech: wave bullets are removed after doing damage, but they do something
more damage, explode, freeze,
taking damage randomizes your run
power ups disappear after 3-5 seconds power ups disappear after 3-5 seconds
only apply to drops from killing mobs only apply to drops from killing mobs
+duplication 20% +duplication 20%
tech: mobs that die while frozen produce ice-IX bullets
tech: picking up heal power ups when at full health does harm equal to the heal values tech: picking up heal power ups when at full health does harm equal to the heal values
benefit on pick up: benefit on pick up:
get ammo get ammo