JUNK tech: meteor shower - take a shower, but meteors instead of water
JUNK tech: discount - get 3 random JUNK tech for the price of 1!

bug fixes

I'll be off line until Saturday, so please don't submit any bug reports until I return
This commit is contained in:
landgreen
2022-03-31 05:32:09 -07:00
parent 62eb66a002
commit 92b5065f71
5 changed files with 107 additions and 25 deletions

View File

@@ -124,7 +124,7 @@ function collisionChecks(event) {
m.eyeFillColor = m.fieldMeterColor //'#0cf' m.eyeFillColor = m.fieldMeterColor //'#0cf'
if (!tech.isFlipFlopHarm) m.damage(dmg); if (!tech.isFlipFlopHarm) m.damage(dmg);
} }
m.setMaxHealth(); if (tech.isFlipFlopHealth) m.setMaxHealth();
} else { } else {
m.damage(dmg); //normal damage m.damage(dmg); //normal damage
} }

View File

@@ -18,7 +18,7 @@ const level = {
// m.setField("metamaterial cloaking") // m.setField("metamaterial cloaking")
// b.giveGuns("harpoon") // b.giveGuns("harpoon")
// tech.giveTech("grappling hook") // tech.giveTech("grappling hook")
// tech.giveTech("railgun") tech.giveTech("discount")
// tech.giveTech("shape-memory alloy") // tech.giveTech("shape-memory alloy")
// for (let i = 0; i < 2; i++) powerUps.directSpawn(0, 0, "tech"); // for (let i = 0; i < 2; i++) powerUps.directSpawn(0, 0, "tech");
// for (let i = 0; i < 2; i++) tech.giveTech("corona discharge") // for (let i = 0; i < 2; i++) tech.giveTech("corona discharge")
@@ -48,6 +48,8 @@ const level = {
// lore.unlockTesting(); // lore.unlockTesting();
// tech.giveTech("tinker"); //show junk tech in experiment mode // tech.giveTech("tinker"); //show junk tech in experiment mode
// tech.giveRandomJUNK()
// tech.giveRandomJUNK()
} else { } else {
spawn.setSpawnList(); //picks a couple mobs types for a themed random mob spawns spawn.setSpawnList(); //picks a couple mobs types for a themed random mob spawns
// spawn.pickList = ["focuser", "focuser"] // spawn.pickList = ["focuser", "focuser"]
@@ -108,8 +110,11 @@ const level = {
// if (tech.isFlipFlopLevelReset && !tech.isFlipFlopOn) { // if (tech.isFlipFlopLevelReset && !tech.isFlipFlopOn) {
if ((tech.isRelay || tech.isFlipFlop) && !tech.isFlipFlopOn) { if ((tech.isRelay || tech.isFlipFlop) && !tech.isFlipFlopOn) {
tech.isFlipFlopOn = true tech.isFlipFlopOn = true
m.setMaxHealth() if (tech.isFlipFlopHealth) m.setMaxHealth()
if (tech.isRelayEnergy) {
m.setMaxEnergy() m.setMaxEnergy()
m.energy += 2
}
m.eyeFillColor = m.fieldMeterColor m.eyeFillColor = m.fieldMeterColor
simulation.makeTextLog(`tech.isFlipFlopOn <span class='color-symbol'>=</span> true`); simulation.makeTextLog(`tech.isFlipFlopOn <span class='color-symbol'>=</span> true`);
} }

View File

@@ -889,8 +889,10 @@ const powerUps = {
if (document.getElementById("tech-switch")) document.getElementById("tech-switch").innerHTML = ` = <strong>ON</strong>` if (document.getElementById("tech-switch")) document.getElementById("tech-switch").innerHTML = ` = <strong>ON</strong>`
m.eyeFillColor = m.fieldMeterColor //'#0cf' m.eyeFillColor = m.fieldMeterColor //'#0cf'
} }
if (tech.isRelayEnergy) {
m.setMaxEnergy(); m.setMaxEnergy();
m.setMaxHealth(); m.energy += 2
}
} }
}, },
// giveRandomAmmo() { // giveRandomAmmo() {

View File

@@ -122,6 +122,15 @@ const tech = {
} }
} }
}, },
giveRandomJUNK() {
const list = []
for (let i = 0; i < tech.tech.length; i++) {
if (tech.tech[i].isJunk) list.push(tech.tech[i].name)
}
let name = list[Math.floor(Math.random() * list.length)]
tech.giveTech(name)
simulation.makeTextLog(`<span class='color-var'>tech</span>.giveTech("<span class='color-text'>${name}</span>")<em>`);
},
giveTech(index = 'random') { giveTech(index = 'random') {
if (index === 'random') { if (index === 'random') {
let options = []; let options = [];
@@ -1659,8 +1668,8 @@ const tech = {
description: "if <strong>flip-flop</strong> is in the <strong class='color-flop'>OFF</strong> state<br>take <strong>0</strong> <strong class='color-harm'>harm</strong> from collisions with mobs", description: "if <strong>flip-flop</strong> is in the <strong class='color-flop'>OFF</strong> state<br>take <strong>0</strong> <strong class='color-harm'>harm</strong> from collisions with mobs",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
frequency: 3, frequency: 4,
frequencyDefault: 3, frequencyDefault: 4,
allowed() { allowed() {
return tech.isFlipFlop return tech.isFlipFlop
}, },
@@ -1677,8 +1686,8 @@ const tech = {
description: "if <strong>flip-flop</strong> is in the <strong class='color-flop'>ON</strong> state<br>increase your <strong>maximum</strong> <strong class='color-h'>health</strong> by <strong>200</strong>", description: "if <strong>flip-flop</strong> is in the <strong class='color-flop'>ON</strong> state<br>increase your <strong>maximum</strong> <strong class='color-h'>health</strong> by <strong>200</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
frequency: 3, frequency: 4,
frequencyDefault: 3, frequencyDefault: 4,
allowed() { allowed() {
return tech.isFlipFlop && !tech.isEnergyHealth return tech.isFlipFlop && !tech.isEnergyHealth
}, },
@@ -1736,8 +1745,8 @@ const tech = {
description: "if in the <strong class='color-flop'>ON</strong> state<br>do <strong>55.5%</strong> more <strong class='color-d'>damage</strong>", description: "if in the <strong class='color-flop'>ON</strong> state<br>do <strong>55.5%</strong> more <strong class='color-d'>damage</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
frequency: 3, frequency: 4,
frequencyDefault: 3, frequencyDefault: 4,
allowed() { allowed() {
return tech.isFlipFlop || tech.isRelay return tech.isFlipFlop || tech.isRelay
}, },
@@ -1754,8 +1763,8 @@ const tech = {
description: "if <strong class='color-flop'>ON</strong> regen <strong>20</strong> <strong class='color-f'>energy</strong> per second<br>if <strong class='color-flop'>OFF</strong> drain <strong>1</strong> <strong class='color-f'>energy</strong> per second", description: "if <strong class='color-flop'>ON</strong> regen <strong>20</strong> <strong class='color-f'>energy</strong> per second<br>if <strong class='color-flop'>OFF</strong> drain <strong>1</strong> <strong class='color-f'>energy</strong> per second",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
frequency: 3, frequency: 4,
frequencyDefault: 3, frequencyDefault: 4,
allowed() { allowed() {
return tech.isFlipFlop || tech.isRelay return tech.isFlipFlop || tech.isRelay
}, },
@@ -1810,8 +1819,8 @@ const tech = {
description: "if <strong>relay switch</strong> is in the <strong class='color-flop'>ON</strong> state<br>increase your <strong>maximum</strong> <strong class='color-f'>energy</strong> by <strong>200</strong>", description: "if <strong>relay switch</strong> is in the <strong class='color-flop'>ON</strong> state<br>increase your <strong>maximum</strong> <strong class='color-f'>energy</strong> by <strong>200</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
frequency: 3, frequency: 4,
frequencyDefault: 3, frequencyDefault: 4,
allowed() { allowed() {
return tech.isRelay return tech.isRelay
}, },
@@ -1849,8 +1858,8 @@ const tech = {
description: "if <strong>relay switch</strong> is in the <strong class='color-flop'>ON</strong> state<br>condense <strong>4-13</strong> <strong class='color-s'>ice IX</strong> crystals every second", description: "if <strong>relay switch</strong> is in the <strong class='color-flop'>ON</strong> state<br>condense <strong>4-13</strong> <strong class='color-s'>ice IX</strong> crystals every second",
maxCount: 9, maxCount: 9,
count: 0, count: 0,
frequency: 3, frequency: 4,
frequencyDefault: 3, frequencyDefault: 4,
allowed() { allowed() {
return tech.isRelay return tech.isRelay
}, },
@@ -7502,6 +7511,66 @@ const tech = {
}, },
remove() {} remove() {}
}, },
{
name: "discount",
description: "get 3 random <strong class='color-j'>JUNK</strong> <strong class='color-m'>tech</strong> for the price of 1!",
maxCount: 1,
count: 0,
frequency: 0,
isJunk: true,
isNonRefundable: true,
allowed() {
return true
},
requires: "",
effect() {
tech.giveRandomJUNK()
tech.giveRandomJUNK()
tech.giveRandomJUNK()
},
remove() {}
},
{
name: "meteor shower",
description: "take a shower, but meteors instead of water",
maxCount: 1,
count: 0,
frequency: 0,
isJunk: true,
isNonRefundable: true,
allowed() {
return true
},
requires: "",
effect() {
setInterval(() => {
fireBlock = function(xPos, yPos) {
const index = body.length
spawn.bodyRect(xPos, yPos, 20 + 50 * Math.random(), 20 + 50 * Math.random());
const bodyBullet = body[body.length - 1]
Matter.Body.setVelocity(body[index], { x: 5 * (Math.random() - 0.5), y: 10 * (Math.random() - 0.5) });
body[index].collisionFilter.category = cat.body;
body[index].collisionFilter.mask = cat.player | cat.map | cat.body | cat.bullet | cat.mob | cat.mobBullet
body[index].classType = "body";
Composite.add(engine.world, body[index]); //add to world
setTimeout(() => { //remove block
for (let i = 0; i < body.length; i++) {
if (body[i] === bodyBullet) {
Matter.Composite.remove(engine.world, body[i]);
body.splice(i, 1);
}
}
}, 3000 + Math.floor(6000 * Math.random()));
}
fireBlock(player.position.x + 600 * (Math.random() - 0.5), player.position.y - 500 - 500 * Math.random());
// for (let i = 0, len = Math.random(); i < len; i++) {
// }
}, 1000);
},
remove() {}
},
{ {
name: "Higgs phase transition", name: "Higgs phase transition",
description: "instantly spawn 3 <strong class='color-m'>tech</strong>, but add a chance to<br>remove everything with a 5 minute <strong>half-life</strong>", description: "instantly spawn 3 <strong class='color-m'>tech</strong>, but add a chance to<br>remove everything with a 5 minute <strong>half-life</strong>",
@@ -8041,7 +8110,7 @@ const tech = {
}, },
{ {
name: "hidden variable", name: "hidden variable",
description: `spawn ${powerUps.orb.heal(15)}<br>but hide your <strong class='color-h'>health</strong> bar`, description: `spawn ${powerUps.orb.heal(20)}<br>but hide your <strong class='color-h'>health</strong> bar`,
maxCount: 1, maxCount: 1,
count: 0, count: 0,
frequency: 0, frequency: 0,
@@ -8054,7 +8123,7 @@ const tech = {
effect() { effect() {
document.getElementById("health").style.display = "none" document.getElementById("health").style.display = "none"
document.getElementById("health-bg").style.display = "none" document.getElementById("health-bg").style.display = "none"
for (let i = 0; i < 15; i++) powerUps.spawn(m.pos.x + 160 * (Math.random() - 0.5), m.pos.y + 160 * (Math.random() - 0.5), "heal"); for (let i = 0; i < 20; i++) powerUps.spawn(m.pos.x + 160 * (Math.random() - 0.5), m.pos.y + 160 * (Math.random() - 0.5), "heal");
}, },
remove() {} remove() {}
}, },
@@ -8076,6 +8145,7 @@ const tech = {
setTimeout(() => { setTimeout(() => {
simulation.drawCircle = savedfunction simulation.drawCircle = savedfunction
canvas.width = canvas.width //clears the canvas // works on chrome at least canvas.width = canvas.width //clears the canvas // works on chrome at least
powerUps.spawn(m.pos.x, m.pos.y, "tech");
}, 10000); }, 10000);
// for (;;) {} //freezes the tab // for (;;) {} //freezes the tab

View File

@@ -1,15 +1,20 @@
******************************************************** NEXT PATCH ************************************************** ******************************************************** NEXT PATCH **************************************************
tech lithium-ion - give 200 max energy when relay is ON JUNK tech: meteor shower - take a shower, but meteors instead of water
tech shape-memory alloy - give 200 max health when flip-flop is ON JUNK tech: discount - get 3 random JUNK tech for the price of 1!
NOR gate now prevents damage when in the OFF state (previously ON) to work well with shape-memory alloy
harpoon crouch mode now retracts at 30% greater distance than normal with no targeting bug fixes
more bug fixes of course I'll be off line until Saturday, so please don't submit any bug reports until I return
******************************************************** TODO ******************************************************** ******************************************************** TODO ********************************************************
tech mines: mines fire _____ instead of nails
needles
super balls?
foam?
plasma ball plasma ball
gently scale damage with circleRadius gently scale damage with circleRadius
balance corona discharge balance corona discharge