wave beam

several small wave beam tech adjustments
I lost track of what I did
This commit is contained in:
landgreen
2021-05-04 07:03:13 -07:00
parent 76c591ef61
commit c10e110a5d
5 changed files with 115 additions and 113 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -3609,19 +3609,16 @@ const b = {
} }
}, { }, {
name: "wave beam", name: "wave beam",
description: "emit a <strong>wavelet</strong> of <strong>oscillating</strong> particles<br>that propagate through <strong>solids</strong>", description: "emit a <strong>wave packet</strong> of <strong>oscillating</strong> particles<br>that propagate through <strong>solids</strong>",
ammo: 0, ammo: 0,
ammoPack: 82, ammoPack: 75,
have: false, have: false,
packetCounter: 0, wavePacketCycle: 0,
delay: 44, delay: 40,
do() { do() {
if (this.packetCounter && !input.fire) { if (this.wavePacketCycle && !input.fire) {
this.packetCounter++; this.wavePacketCycle = 0;
if (this.packetCounter > 36) { // 36 is one wave packet m.fireCDcycle = m.cycle + Math.floor(this.delay * b.fireCD); // cool down
m.fireCDcycle = m.cycle + Math.floor(this.delay * b.fireCD); // cool down
this.packetCounter = 0;
}
} }
}, },
damage: 1, damage: 1,
@@ -3631,13 +3628,13 @@ const b = {
bullet[me] = Bodies.polygon(m.pos.x + 25 * Math.cos(m.angle), m.pos.y + 25 * Math.sin(m.angle), 7, 3.5, { bullet[me] = Bodies.polygon(m.pos.x + 25 * Math.cos(m.angle), m.pos.y + 25 * Math.sin(m.angle), 7, 3.5, {
angle: m.angle, angle: m.angle,
cycle: -0.5, cycle: -0.5,
endCycle: simulation.cycle + Math.floor((tech.waveReflections ? Infinity : 4.3 * tech.wavePacketLength) * tech.isBulletsLastLonger), // - this.packetCounter + tech.wavePacketLength, //- this.packetCounter + this.packetLength makes the entire packet go away at the same time endCycle: simulation.cycle + Math.floor((tech.waveReflections ? Infinity : 4.3 * tech.wavePacketLength) * tech.isBulletsLastLonger),
inertia: Infinity, inertia: Infinity,
frictionAir: 0, frictionAir: 0,
slow: 0, slow: 0,
amplitude: (m.crouch ? 10 : 20) * tech.waveAmplitude * Math.sin(this.packetCounter * tech.wavePacketFrequency) * ((i % 2) ? -1 : 1), //(tech.isImaginaryWave ? 1 : -1) amplitude: (m.crouch ? 10 : 20) * Math.sin(this.wavePacketCycle * tech.wavePacketFrequency) * ((i % 2) ? -1 : 1),
minDmgSpeed: 0, minDmgSpeed: 0,
dmg: b.dmgScale * tech.waveBeamDamage * tech.waveAmplitude * tech.wavePacketLength / 36, //control damage also when you divide by mob.mass //* (tech.isImaginaryWave ? 3 : 1) dmg: b.dmgScale * tech.waveBeamDamage * tech.wavePacketDamage, //also control damage when you divide by mob.mass
classType: "bullet", classType: "bullet",
collisionFilter: { collisionFilter: {
category: 0, category: 0,
@@ -3679,9 +3676,6 @@ const b = {
}, },
wiggle() { wiggle() {
this.cycle++ this.cycle++
// const where = Vector.mult(transverse, this.amplitude * Math.cos(this.cycle * 0.35)) // 36
// const where = Vector.mult(transverse, 0.5 * this.amplitude * Math.cos(this.cycle * 0.15)) //36
// const where = Vector.mult(transverse, 0.15 * this.amplitude * Math.cos(this.cycle * 0.05)) //36
const where = Vector.mult(transverse, this.amplitude * Math.cos(this.cycle * tech.waveFrequency)) const where = Vector.mult(transverse, this.amplitude * Math.cos(this.cycle * tech.waveFrequency))
Matter.Body.setPosition(this, Vector.add(this.position, where)) Matter.Body.setPosition(this, Vector.add(this.position, where))
} }
@@ -3694,7 +3688,7 @@ const b = {
waveSpeedBody = 1.9 waveSpeedBody = 1.9
} }
if (tech.waveReflections) { if (tech.waveReflections) {
const range = 100 / Math.sqrt(tech.waveFrequency) const range = 100
bullet[me].reflectCycle = range bullet[me].reflectCycle = range
bullet[me].do = function() { bullet[me].do = function() {
if (!m.isBodiesAsleep) { if (!m.isBodiesAsleep) {
@@ -3723,10 +3717,10 @@ const b = {
const transverse = Vector.normalise(Vector.perp(bullet[me].velocity)) const transverse = Vector.normalise(Vector.perp(bullet[me].velocity))
} }
//fire some of bullets then delay for a while //fire some of bullets then delay for a while
this.packetCounter++ this.wavePacketCycle++
if (this.packetCounter > tech.wavePacketLength) { if (this.wavePacketCycle > tech.wavePacketLength) {
m.fireCDcycle = m.cycle + Math.floor(this.delay * b.fireCD); // cool down m.fireCDcycle = m.cycle + Math.floor(this.delay * b.fireCD); // cool down
this.packetCounter = 0; this.wavePacketCycle = 0;
} }
} }
}, { }, {

View File

@@ -17,14 +17,12 @@ const level = {
// simulation.setZoom(); // simulation.setZoom();
// m.setField("nano-scale manufacturing") // m.setField("nano-scale manufacturing")
// b.giveGuns("wave beam") // b.giveGuns("wave beam")
// b.giveGuns("foam")
// tech.isExplodeRadio = true // tech.isExplodeRadio = true
// for (let i = 0; i < 1; i++) tech.giveTech("amplitude")
// tech.giveTech("aerogel")
// for (let i = 0; i < 1; i++) tech.giveTech("wavelength")
// tech.giveTech("phase velocity") // tech.giveTech("phase velocity")
// tech.giveTech("imaginary") // for (let i = 0; i < 3; i++) tech.giveTech("wavelength")
// for (let i = 0; i < 2; i++) tech.giveTech("least action") // for (let i = 0; i < 1; i++) tech.giveTech("bound state")
// for (let i = 0; i < 3; i++) tech.giveTech("propagation")
// for (let i = 0; i < 3; i++) tech.giveTech("amplitude")
// tech.isExplodeRadio = true; // tech.isExplodeRadio = true;
// tech.isMineSentry = true // tech.isMineSentry = true
@@ -1110,13 +1108,13 @@ const level = {
spawn.mapRect(6700, -1800, 800, 2600); //right wall spawn.mapRect(6700, -1800, 800, 2600); //right wall
spawn.mapRect(level.exit.x, level.exit.y + 20, 100, 100); //exit bump spawn.mapRect(level.exit.x, level.exit.y + 20, 100, 100); //exit bump
// spawn.starter(1900, -500, 200) //big boy spawn.starter(1900, -500, 200) //big boy
// spawn.grower(1900, -500) // spawn.grower(1900, -500)
// spawn.pulsarBoss(1900, -500) // spawn.pulsarBoss(1900, -500)
// spawn.shooterBoss(1900, -500) // spawn.shooterBoss(1900, -500)
// spawn.launcherBoss(1200, -500) // spawn.launcherBoss(1200, -500)
// spawn.laserTargetingBoss(1600, -400) // spawn.laserTargetingBoss(1600, -400)
spawn.striker(1600, -500) // spawn.striker(1600, -500)
// spawn.laserTargetingBoss(1700, -120) // spawn.laserTargetingBoss(1700, -120)
// spawn.bomberBoss(1400, -500) // spawn.bomberBoss(1400, -500)
// spawn.ghoster(1800, -120) // spawn.ghoster(1800, -120)

View File

@@ -3612,9 +3612,93 @@
tech.bulletSize = 1; tech.bulletSize = 1;
} }
}, },
{
name: "bound state",
description: "instead of dissipating normally<br>wave packets <strong>reflect</strong> backwards <strong>2</strong> times",
isGunTech: true,
maxCount: 9,
count: 0,
frequency: 2,
allowed() {
return tech.haveGunCheck("wave beam") && tech.wavePacketLength === 36
},
requires: "wave beam, not wavelength",
effect() {
tech.waveReflections += 2
// tech.waveFrequency = 0.2
},
remove() {
tech.waveReflections = 0
// tech.waveFrequency = 0.35 //this is also set in "wavelength"
}
},
{
name: "wavelength",
description: "wave packet <strong>length</strong> and <strong>duration</strong><br>is increased by <strong>50%</strong>", // description: "holding fire allows the <strong>wave beam</strong> to emits a second <strong>packet</strong><br>at zero ammo cost",
isGunTech: true,
maxCount: 9,
count: 0,
frequency: 2,
allowed() {
return tech.haveGunCheck("wave beam") && !tech.waveReflections
},
requires: "wave beam, not bound state",
effect() {
const scale = 1.5
tech.wavePacketLength *= scale //if you change this to not be 36 update /36 in wave .dmg
tech.wavePacketFrequency /= scale
// tech.wavePacketLength = tech.wavePacketFrequency * 420 //36 //how many wave packets are released // double this to emit 2 packets
// tech.waveFrequency *= 0.8
},
remove() {
tech.wavePacketFrequency = 0.088 //shorten wave packet
tech.wavePacketLength = tech.wavePacketFrequency * 408 //36.96 //how many wave packets are released // double this to emit 2 packets
// tech.waveFrequency = 0.35 //this is also set in "bound state" //increase -> shrink amplitude, add more nodes
}
},
{
name: "amplitude",
description: "wave packet <strong>amplitude</strong> is <strong>33%</strong> higher<br>wave <strong class='color-d'>damage</strong> is increased by <strong>33%</strong>",
isGunTech: true,
maxCount: 3,
count: 0,
frequency: 2,
allowed() {
return tech.haveGunCheck("wave beam")
},
requires: "wave beam",
effect() {
tech.waveFrequency *= 0.5
tech.wavePacketDamage *= 1.33
},
remove() {
tech.waveFrequency = 0.35
tech.wavePacketDamage = 1
}
},
{
name: "propagation",
description: "wave packet propagation <strong>speed</strong> is <strong>25%</strong> slower<br>wave <strong class='color-d'>damage</strong> is increased by <strong>50%</strong>",
isGunTech: true,
maxCount: 3,
count: 0,
frequency: 2,
allowed() {
return tech.haveGunCheck("wave beam")
},
requires: "wave beam",
effect() {
tech.waveBeamSpeed *= 0.75;
tech.waveBeamDamage += 0.55 * 0.5
},
remove() {
tech.waveBeamSpeed = 10;
tech.waveBeamDamage = 0.55 //this sets base wave beam damage
}
},
{ {
name: "phase velocity", name: "phase velocity",
description: "wavelets <strong>propagate</strong> faster in solids", description: "wave beam <strong>propagates</strong> faster through solids<br>up by <strong>3000%</strong> in the map and <strong>760%</strong> in blocks",
isGunTech: true, isGunTech: true,
maxCount: 1, maxCount: 1,
count: 0, count: 0,
@@ -3630,87 +3714,9 @@
tech.isPhaseVelocity = false; tech.isPhaseVelocity = false;
} }
}, },
{
name: "bound state",
description: "instead of dissipating normally<br>wavelets <strong>reflect</strong> backwards <strong>2</strong> times",
isGunTech: true,
maxCount: 9,
count: 0,
frequency: 2,
allowed() {
return tech.haveGunCheck("wave beam")
},
requires: "wave beam",
effect() {
tech.waveReflections += 2
},
remove() {
tech.waveReflections = 0
}
},
{
name: "wavelength",
description: "wavelet <strong>length</strong> and <strong>duration</strong><br>is increased by <strong>50%</strong>", // description: "holding fire allows the <strong>wave beam</strong> to emits a second <strong>packet</strong><br>at zero ammo cost",
isGunTech: true,
maxCount: 9,
count: 0,
frequency: 2,
allowed() {
return tech.haveGunCheck("wave beam")
},
requires: "wave beam",
effect() {
tech.wavePacketLength *= 1.5 //if you change this to not be 36 update /36 in wave .dmg
tech.wavePacketFrequency *= 0.66666
tech.waveFrequency *= 0.9
},
remove() {
tech.wavePacketLength = 36
tech.waveFrequency = 0.35
tech.wavePacketFrequency = 0.088
}
},
{
name: "amplitude",
description: "wavelet <strong>amplitude</strong> is <strong>33%</strong> higher<br>wave <strong class='color-d'>damage</strong> is increased by <strong>33%</strong>",
isGunTech: true,
maxCount: 3,
count: 0,
frequency: 2,
allowed() {
return tech.haveGunCheck("wave beam")
},
requires: "wave beam",
effect() {
tech.waveAmplitude += 0.33
},
remove() {
tech.waveAmplitude = 1
}
},
{
name: "propagation",
description: "wavelet <strong>propagation speed</strong> is <strong>25%</strong> slower<br>wave <strong class='color-d'>damage</strong> is increased by <strong>50%</strong>",
isGunTech: true,
maxCount: 3,
count: 0,
frequency: 2,
allowed() {
return tech.haveGunCheck("wave beam")
},
requires: "wave beam",
effect() {
tech.waveBeamSpeed -= 2.5;
tech.waveBeamDamage += 0.55 * 0.5
},
remove() {
tech.waveBeamSpeed = 10;
tech.waveBeamDamage = 0.55 //this sets base wave beam damage
}
},
// { // {
// name: "imaginary", // name: "imaginary",
// description: "the <strong>wavelet</strong> is limited to a <strong>single</strong> strand<br>wave <strong class='color-d'>damage</strong> is increased by <strong>300%</strong>", // description: "the <strong>wavePacket</strong> is limited to a <strong>single</strong> strand<br>wave <strong class='color-d'>damage</strong> is increased by <strong>300%</strong>",
// isGunTech: true, // isGunTech: true,
// maxCount: 1, // maxCount: 1,
// count: 0, // count: 0,
@@ -6568,5 +6574,5 @@
wavePacketLength: null, wavePacketLength: null,
isImaginaryWave: null, isImaginaryWave: null,
waveBeamSpeed: null, waveBeamSpeed: null,
waveAmplitude: null, wavePacketAmplitude: null,
} }

View File

@@ -1,8 +1,11 @@
******************************************************** NEXT PATCH ******************************************************** ******************************************************** NEXT PATCH ********************************************************
several small wave beam tech adjustments
******************************************************** BUGS ******************************************************** ******************************************************** BUGS ********************************************************
power ups don't float up in acid anymore?
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
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
@@ -33,12 +36,13 @@ is there a way to check if the player is stuck inside the map or block
******************************************************** TODO ******************************************************** ******************************************************** TODO ********************************************************
wave tech: delay similar to foam
wave tech: dispersion - add noise and damage to waves wave tech: dispersion - add noise and damage to waves
wave tech: chirp - amplitude increases with time 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, stun radiation
make a system to show current gun damage in pause menu? tech: mobs that die while frozen produce ice-IX bullets
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: