restitution doesn't work with pilot wave

pilot wave energy is back to it's old energy settings
tech: restitution - now only triggers power ups from blocks thrown by the player
  (this makes pilot wave and naturally falling blocks not spawn power ups. flywheel will work if a block was thrown in the last 3 seconds)

standing wave harmonic has reduced blocking recoil
This commit is contained in:
landgreen
2021-05-16 06:36:23 -07:00
parent feeba5156c
commit 14dfc4a145
8 changed files with 32 additions and 28 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -190,7 +190,7 @@ function collisionChecks(event) {
let dmg = 0.075 * b.dmgScale * v * obj.mass * tech.throwChargeRate; let dmg = 0.075 * b.dmgScale * v * obj.mass * tech.throwChargeRate;
if (mob[k].isShielded) dmg *= 0.6 if (mob[k].isShielded) dmg *= 0.6
mob[k].damage(dmg, true); mob[k].damage(dmg, true);
if (tech.isBlockPowerUps && !mob[k].alive && mob[k].isDropPowerUp) { if (tech.isBlockPowerUps && !mob[k].alive && mob[k].isDropPowerUp && m.throwCycle > m.cycle) {
let type = tech.isEnergyNoAmmo ? "heal" : "ammo" let type = tech.isEnergyNoAmmo ? "heal" : "ammo"
if (Math.random() < 0.4) { if (Math.random() < 0.4) {
type = "heal" type = "heal"

View File

@@ -15,12 +15,12 @@ const level = {
// level.difficultyIncrease(30) // level.difficultyIncrease(30)
// simulation.zoomScale = 1000; // simulation.zoomScale = 1000;
// simulation.setZoom(); // simulation.setZoom();
m.setField("pilot wave") // m.setField("pilot wave")
// b.giveGuns("wave beam") // b.giveGuns("wave beam")
// b.giveGuns("laser") // b.giveGuns("laser")
// tech.isExplodeRadio = true // tech.isExplodeRadio = true
// tech.giveTech("pulse") // tech.giveTech("pulse")
tech.giveTech("potential well") // tech.giveTech("potential well")
// 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("propagation") // for (let i = 0; i < 3; i++) tech.giveTech("propagation")
// for (let i = 0; i < 3; i++) tech.giveTech("bound state") // for (let i = 0; i < 3; i++) tech.giveTech("bound state")

View File

@@ -937,6 +937,7 @@ const m = {
holdingTarget: null, holdingTarget: null,
timeSkipLastCycle: 0, timeSkipLastCycle: 0,
// these values are set on reset by setHoldDefaults() // these values are set on reset by setHoldDefaults()
blockingRecoil: 4,
grabPowerUpRange2: 0, grabPowerUpRange2: 0,
isFieldActive: false, isFieldActive: false,
fieldRange: 155, fieldRange: 155,
@@ -978,6 +979,7 @@ const m = {
m.duplicateChance = 0 m.duplicateChance = 0
powerUps.setDo(); powerUps.setDo();
m.grabPowerUpRange2 = 156000; m.grabPowerUpRange2 = 156000;
m.blockingRecoil = 4;
m.fieldRange = 155; m.fieldRange = 155;
m.fieldFire = false; m.fieldFire = false;
m.fieldCDcycle = 0; m.fieldCDcycle = 0;
@@ -1174,6 +1176,7 @@ const m = {
} }
m.throwCharge = 0; m.throwCharge = 0;
m.throwCycle = m.cycle + 180 //used to detect if a block was thrown in the last 3 seconds
Matter.Body.setVelocity(m.holdingTarget, { Matter.Body.setVelocity(m.holdingTarget, {
x: player.velocity.x * 0.5 + Math.cos(m.angle) * speed, x: player.velocity.x * 0.5 + Math.cos(m.angle) * speed,
y: player.velocity.y * 0.5 + Math.sin(m.angle) * speed y: player.velocity.y * 0.5 + Math.sin(m.angle) * speed
@@ -1310,13 +1313,13 @@ const m = {
}); });
if (m.crouch) { if (m.crouch) {
Matter.Body.setVelocity(player, { Matter.Body.setVelocity(player, {
x: player.velocity.x + 0.4 * unit.x * massRoot, x: player.velocity.x + 0.1 * m.blockingRecoil * unit.x * massRoot,
y: player.velocity.y + 0.4 * unit.y * massRoot y: player.velocity.y + 0.1 * m.blockingRecoil * unit.y * massRoot
}); });
} else { } else {
Matter.Body.setVelocity(player, { Matter.Body.setVelocity(player, {
x: player.velocity.x + 5 * unit.x * massRoot, x: player.velocity.x + m.blockingRecoil * unit.x * massRoot,
y: player.velocity.y + 5 * unit.y * massRoot y: player.velocity.y + m.blockingRecoil * unit.y * massRoot
}); });
} }
} else { } else {
@@ -1488,11 +1491,12 @@ const m = {
}, },
{ {
name: "standing wave harmonics", name: "standing wave harmonics",
description: "<strong>3</strong> oscillating <strong>shields</strong> are permanently active<br><strong>blocking</strong> drains <strong class='color-f'>energy</strong> with no <strong>cool down</strong><br>reduce <strong class='color-harm'>harm</strong> by <strong>25%</strong>", description: "<strong>3</strong> oscillating <strong>shields</strong> are permanently active<br><strong>blocking</strong> drains <strong class='color-f'>energy</strong> with no <strong>cool down</strong><br>reduce <strong class='color-harm'>harm</strong> and blocking <strong>recoil</strong> by <strong>25%</strong>",
effect: () => { effect: () => {
// m.fieldHarmReduction = 0.80; // m.fieldHarmReduction = 0.80;
m.fieldBlockCD = 0; m.fieldBlockCD = 0;
m.fieldHarmReduction = 0.75; m.fieldHarmReduction = 0.75;
m.blockingRecoil = 1 //4 is normal
m.fieldRange = 175 + 175 * 0.25 * tech.frequencyResonance m.fieldRange = 175 + 175 * 0.25 * tech.frequencyResonance
m.fieldShieldingScale = Math.pow(0.5, tech.frequencyResonance) m.fieldShieldingScale = Math.pow(0.5, tech.frequencyResonance)
m.hold = function() { m.hold = function() {
@@ -2306,7 +2310,7 @@ const m = {
for (let i = 0, len = body.length; i < len; ++i) { for (let i = 0, len = body.length; i < len; ++i) {
if (Vector.magnitude(Vector.sub(body[i].position, m.fieldPosition)) < m.fieldRadius && !body[i].isNotHoldable) { if (Vector.magnitude(Vector.sub(body[i].position, m.fieldPosition)) < m.fieldRadius && !body[i].isNotHoldable) {
const DRAIN = speed * body[i].mass * 0.00001 * (1 + m.energy * m.energy) //drain more energy when you have more energy const DRAIN = speed * body[i].mass * 0.000013 // * (1 + m.energy * m.energy) //drain more energy when you have more energy
if (m.energy > DRAIN) { if (m.energy > DRAIN) {
m.energy -= DRAIN; m.energy -= DRAIN;
Matter.Body.setVelocity(body[i], velocity); //give block mouse velocity Matter.Body.setVelocity(body[i], velocity); //give block mouse velocity
@@ -2983,7 +2987,7 @@ const m = {
let dmg = 0.05 * b.dmgScale * v * obj.mass * tech.throwChargeRate; let dmg = 0.05 * b.dmgScale * v * obj.mass * tech.throwChargeRate;
if (mob[k].isShielded) dmg *= 0.35 if (mob[k].isShielded) dmg *= 0.35
mob[k].damage(dmg, true); mob[k].damage(dmg, true);
if (tech.isBlockPowerUps && !mob[k].alive && mob[k].isDropPowerUp) { if (tech.isBlockPowerUps && !mob[k].alive && mob[k].isDropPowerUp && m.throwCycle > m.cycle) {
let type = tech.isEnergyNoAmmo ? "heal" : "ammo" let type = tech.isEnergyNoAmmo ? "heal" : "ammo"
if (Math.random() < 0.4) { if (Math.random() < 0.4) {
type = "heal" type = "heal"

View File

@@ -10,8 +10,8 @@ const spawn = {
"stabber", "stabber", "stabber", "stabber",
"launcher", "launcher", "launcher", "launcher",
"springer", "springer", "springer", "springer",
"sucker", "sucker",
"pulsar", "pulsar", "pulsar", "pulsar",
"sucker",
"chaser", "chaser",
"sniper", "sniper",
"spinner", "spinner",

View File

@@ -84,6 +84,8 @@
if (options.length > 0) { if (options.length > 0) {
let newTech = options[Math.floor(Math.random() * options.length)] let newTech = options[Math.floor(Math.random() * options.length)]
tech.giveTech(newTech) tech.giveTech(newTech)
simulation.makeTextLog(`<span class='color-var'>tech</span>.giveTech("<span class='color-text'>${tech.tech[newTech].name}</span>")<em> //random tech</em>`);
} }
} else { } else {
if (isNaN(index)) { //find index by name if (isNaN(index)) { //find index by name
@@ -98,6 +100,7 @@
if (!found) return //if name not found don't give any tech if (!found) return //if name not found don't give any tech
} }
if (tech.isMetaAnalysis && tech.tech[index].isJunk) { if (tech.isMetaAnalysis && tech.tech[index].isJunk) {
simulation.makeTextLog(`//tech: meta-analysis replaced junk tech with random tech`);
tech.giveTech('random') tech.giveTech('random')
for (let i = 0; i < 2; i++) powerUps.spawn(m.pos.x + 10 * Math.random(), m.pos.y + 10 * Math.random(), "research"); for (let i = 0; i < 2; i++) powerUps.spawn(m.pos.x + 10 * Math.random(), m.pos.y + 10 * Math.random(), "research");
return return
@@ -1480,7 +1483,7 @@
}, },
{ {
name: "restitution", name: "restitution",
description: "mobs killed by collisions with <strong>blocks</strong><br>spawn a <strong class='color-h'>heal</strong>, <strong class='color-g'>ammo</strong>, or <strong class='color-r'>research</strong>", description: "if a <strong>block</strong> you threw kills a mob<br>spawn a <strong class='color-h'>heal</strong>, <strong class='color-g'>ammo</strong>, or <strong class='color-r'>research</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
frequency: 4, frequency: 4,
@@ -3115,7 +3118,7 @@
const index = powerUps.tech.choiceLog[powerUps.tech.choiceLog.length - i - 1] const index = powerUps.tech.choiceLog[powerUps.tech.choiceLog.length - i - 1]
if (index !== powerUps.lastTechIndex && tech.tech[index].count < tech.tech[index].maxCount && tech.tech[index].allowed() && tech.tech[index].name !== "backward induction") { if (index !== powerUps.lastTechIndex && tech.tech[index].count < tech.tech[index].maxCount && tech.tech[index].allowed() && tech.tech[index].name !== "backward induction") {
tech.giveTech(index) tech.giveTech(index)
simulation.makeTextLog(`<span class='color-var'>tech</span>.giveTech("<span class='color-text'>${tech.tech[index].name}</span>") <em>// backward induction</em>`); simulation.makeTextLog(`<span class='color-var'>tech</span>.giveTech("<span class='color-text'>${tech.tech[index].name}</span>") <em> //backward induction</em>`);
} }
} }
}, },
@@ -3922,7 +3925,7 @@
}, },
{ {
name: "water shielding", name: "water shielding",
description: "increase <strong>neutron bomb's</strong> range by <strong>20%</strong><br>player is <strong>immune</strong> to its harmful effects", description: "increase <strong>neutron bomb's</strong> range by <strong>20%</strong><br>you are <strong>immune</strong> to its harmful effects",
isGunTech: true, isGunTech: true,
maxCount: 1, maxCount: 1,
count: 0, count: 0,
@@ -4067,7 +4070,7 @@
}, },
{ {
name: "diplochory", name: "diplochory",
description: "<strong class='color-p' style='letter-spacing: 2px;'>spores</strong> use the player for <strong>dispersal</strong><br>until they <strong>locate</strong> a viable host", description: "<strong class='color-p' style='letter-spacing: 2px;'>spores</strong> use you for <strong>dispersal</strong><br>until they <strong>locate</strong> a viable host",
isGunTech: true, isGunTech: true,
maxCount: 1, maxCount: 1,
count: 0, count: 0,

View File

@@ -165,7 +165,7 @@ summary {
z-index: 12; z-index: 12;
background-color: #444; background-color: #444;
display: none; display: none;
grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
grid-auto-rows: minmax(auto, auto); grid-auto-rows: minmax(auto, auto);
font-size: 1.3em; font-size: 1.3em;
/* box-shadow: 0px 0px 40px 20px rgba(255, 255, 255, 0.25); */ /* box-shadow: 0px 0px 40px 20px rgba(255, 255, 255, 0.25); */
@@ -200,7 +200,7 @@ summary {
margin: 0px; margin: 0px;
display: none; display: none;
grid-template-columns: 316px; grid-template-columns: 320px;
/* grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); */ /* grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); */
grid-auto-rows: minmax(auto, auto); grid-auto-rows: minmax(auto, auto);
grid-gap: 0px; grid-gap: 0px;
@@ -239,7 +239,7 @@ summary {
background-color: var(--build-bg-color); background-color: var(--build-bg-color);
display: none; display: none;
grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
grid-auto-flow: row; grid-auto-flow: row;
grid-auto-rows: minmax(auto, auto); grid-auto-rows: minmax(auto, auto);
grid-gap: 0px; grid-gap: 0px;

View File

@@ -1,13 +1,10 @@
******************************************************** NEXT PATCH ******************************************************** ******************************************************** NEXT PATCH ********************************************************
pilot is back to it's previous speed, and spawning at mouse pilot wave energy is back to it's old energy settings
pilot wave uses 50% less energy when you are low on energy, but it uses more energy then normal when you have more energy tech: restitution - now only triggers power ups from blocks thrown by the player
pilot wave tech (this makes pilot wave and naturally falling blocks not spawn power ups. flywheel will work if a block was thrown in the last 3 seconds)
lost: time crystals, Lorentz transformation, annihilation
gained: degenerate matter - 60% harm reduction while field is active
tech: potential well - blocks in pilot wave drift into the center of the field with a much higher force
this lets you hold larger blocks and flick them much faster
standing wave harmonic has reduced blocking recoil
******************************************************** BUGS ******************************************************** ******************************************************** BUGS ********************************************************
@@ -25,8 +22,6 @@ tech: strange attractor before at least 1 other tech
crashed on this crashed on this
https://landgreen.github.io/sidescroller/index.html?&gun0=rail%20gun&tech1=mass%20driver&tech2=restitution&tech3=flywheel&tech4=Pauli%20exclusion&tech5=mass-energy%20equivalence&tech6=1st%20ionization%20energy&tech7=electrolytes&tech8=negative%20feedback&tech9=entropy%20exchange&tech10=anthropic%20principle&tech11=renormalization&tech12=Bayesian%20statistics&tech13=bubble%20fusion&tech14=replication&tech15=replication&tech16=futures%20exchange&tech17=commodities%20exchange&tech18=correlated%20damage&tech19=parthenogenesis&tech21=cardinality&tech22=half-wave%20rectifier&tech23=pair%20production&tech24=Lorentz%20transformation&tech25=time%20crystals&tech26=undefined&tech27=undefined&tech28=undefined&tech29=undefined&tech30=undefined&tech31=undefined&tech32=undefined&field=pilot%20wave&difficulty=6 https://landgreen.github.io/sidescroller/index.html?&gun0=rail%20gun&tech1=mass%20driver&tech2=restitution&tech3=flywheel&tech4=Pauli%20exclusion&tech5=mass-energy%20equivalence&tech6=1st%20ionization%20energy&tech7=electrolytes&tech8=negative%20feedback&tech9=entropy%20exchange&tech10=anthropic%20principle&tech11=renormalization&tech12=Bayesian%20statistics&tech13=bubble%20fusion&tech14=replication&tech15=replication&tech16=futures%20exchange&tech17=commodities%20exchange&tech18=correlated%20damage&tech19=parthenogenesis&tech21=cardinality&tech22=half-wave%20rectifier&tech23=pair%20production&tech24=Lorentz%20transformation&tech25=time%20crystals&tech26=undefined&tech27=undefined&tech28=undefined&tech29=undefined&tech30=undefined&tech31=undefined&tech32=undefined&field=pilot%20wave&difficulty=6
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
you have to press z once to get copy to work for simulation.enableConstructMode() sometimes you have to press z once to get copy to work for simulation.enableConstructMode() sometimes
not sure how to reproduce, but it happens often on the first draw not sure how to reproduce, but it happens often on the first draw
@@ -55,9 +50,11 @@ is there a way to check if the player is stuck inside the map or block
******************************************************** TODO ******************************************************** ******************************************************** TODO ********************************************************
pause should show the last in game console message
Make ice crystal + rivet gun/needle gun launch freezing rivets/needles with increased energy drain Make ice crystal + rivet gun/needle gun launch freezing rivets/needles with increased energy drain
WIMPS are cool, but the 2-3 research isn't enough incentive WIMPS are cool, but the 2-3 research isn't enough incentive?
tech: pilot wave is projected from the player, not the mouse tech: pilot wave is projected from the player, not the mouse
give pilot wave a buff? give pilot wave a buff?