pulsar balance

This commit is contained in:
landgreen
2021-03-08 05:11:09 -08:00
parent 5f68bc687f
commit 25865c1532
4 changed files with 21 additions and 23 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -11,7 +11,7 @@ const spawn = {
"launcher", "launcher", "launcher", "launcher",
"springer", "springer", "springer", "springer",
"sucker", "sucker", "sucker", "sucker",
"pulsar", "pulsar", "pulsar", "pulsar", "pulsar", //briefly high chance to show from a few days "pulsar", "pulsar", "pulsar", "pulsar", "pulsar", "pulsar",
"chaser", "chaser",
"sniper", "sniper",
"spinner", "spinner",
@@ -1491,9 +1491,8 @@ const spawn = {
me.vertices[1].y = me.position.y + Math.sin(me.angle) * me.radius; me.vertices[1].y = me.position.y + Math.sin(me.angle) * me.radius;
me.fireCycle = 0 me.fireCycle = 0
me.fireTarget = { x: 0, y: 0 } me.fireTarget = { x: 0, y: 0 }
me.pulseRadius = Math.min(500, 300 + simulation.difficulty) me.pulseRadius = Math.min(400, 200 + simulation.difficulty * 3)
me.frictionAir = 0.01; me.fireDelay = Math.max(70, 220 - simulation.difficulty * 2)
me.fireDelay = Math.min(90, 210 - simulation.difficulty)
me.isFiring = false me.isFiring = false
me.onHit = function() {}; me.onHit = function() {};
me.canSeeTarget = function() { me.canSeeTarget = function() {
@@ -1502,7 +1501,7 @@ const spawn = {
x: Math.cos(this.angle), x: Math.cos(this.angle),
y: Math.sin(this.angle) y: Math.sin(this.angle)
}, diff); //the dot product of diff and dir will return how much over lap between the vectors }, diff); //the dot product of diff and dir will return how much over lap between the vectors
if (dot < 0.97 || Matter.Query.ray(map, this.fireTarget, this.position).length !== 0) { //if not looking at target if (dot < 0.97 || Matter.Query.ray(map, this.fireTarget, this.position).length !== 0 || Matter.Query.ray(body, this.fireTarget, this.position).length !== 0) { //if not looking at target
this.isFiring = false this.isFiring = false
return false return false
} else { } else {
@@ -1513,7 +1512,6 @@ const spawn = {
this.seePlayerByLookingAt(); this.seePlayerByLookingAt();
this.checkStatus(); this.checkStatus();
if (!m.isBodiesAsleep && this.seePlayer.recall) { if (!m.isBodiesAsleep && this.seePlayer.recall) {
if (this.isFiring) { if (this.isFiring) {
if (this.fireCycle > this.fireDelay) { //fire if (this.fireCycle > this.fireDelay) { //fire
if (!this.canSeeTarget()) return if (!this.canSeeTarget()) return
@@ -1527,22 +1525,27 @@ const spawn = {
x: this.fireTarget.x, x: this.fireTarget.x,
y: this.fireTarget.y, y: this.fireTarget.y,
radius: this.pulseRadius, radius: this.pulseRadius,
color: "rgba(255,0,100,0.8)", color: "rgba(255,0,100,0.6)",
time: simulation.drawTime time: simulation.drawTime
}); });
} else { //delay before firing } else { //delay before firing
this.fireCycle++ this.fireCycle++
if (!(simulation.cycle % 3)) { if (!(simulation.cycle % 3)) {
if (!this.canSeeTarget()) return //if can't see stop firing if (!this.canSeeTarget()) return //if can't see stop firing
//draw explosion outline //draw explosion outline
ctx.beginPath(); ctx.beginPath();
ctx.arc(this.fireTarget.x, this.fireTarget.y, this.pulseRadius, 0, 2 * Math.PI); ctx.arc(this.fireTarget.x, this.fireTarget.y, this.pulseRadius, 0, 2 * Math.PI); //* this.fireCycle / this.fireDelay
ctx.fillStyle = "rgba(255,0,100,0.05)"; ctx.fillStyle = "rgba(255,0,100,0.1)";
ctx.fill(); ctx.fill();
//draw path from mob to explosion
ctx.beginPath();
ctx.moveTo(this.vertices[1].x, this.vertices[1].y)
ctx.lineTo(this.fireTarget.x, this.fireTarget.y)
ctx.setLineDash([40 * Math.random(), 200 * Math.random()]);
ctx.lineWidth = 2; ctx.lineWidth = 2;
ctx.strokeStyle = "rgba(255,0,100,0.5)"; ctx.strokeStyle = "rgba(255,0,100,0.5)";
ctx.stroke(); ctx.stroke();
ctx.setLineDash([0, 0]);
} }
} }
} else { //aim at player } else { //aim at player
@@ -1550,19 +1553,19 @@ const spawn = {
//rotate towards fireAngle //rotate towards fireAngle
const angle = this.angle + Math.PI / 2; const angle = this.angle + Math.PI / 2;
const c = Math.cos(angle) * this.fireDir.x + Math.sin(angle) * this.fireDir.y; const c = Math.cos(angle) * this.fireDir.x + Math.sin(angle) * this.fireDir.y;
const threshold = 0.03; const threshold = 0.04;
if (c > threshold) { if (c > threshold) {
this.torque += 0.000001 * this.inertia; this.torque += 0.0000015 * this.inertia;
} else if (c < -threshold) { } else if (c < -threshold) {
this.torque -= 0.000001 * this.inertia; this.torque -= 0.0000015 * this.inertia;
} else { //fire } else { //fire
this.fireTarget = { x: player.position.x, y: player.position.y } unit = Vector.mult(Vector.normalise(Vector.sub(this.vertices[1], this.position)), this.distanceToPlayer() - 100)
this.fireTarget = Vector.add(this.vertices[1], unit)
if (!this.canSeeTarget()) return if (!this.canSeeTarget()) return
Matter.Body.setAngularVelocity(this, 0) Matter.Body.setAngularVelocity(this, 0)
this.fireLockCount = 0 this.fireLockCount = 0
this.isFiring = true this.isFiring = true
this.fireCycle = 0 this.fireCycle = 0
} }
} }
} }

View File

@@ -2844,7 +2844,7 @@
allowed() { allowed() {
return tech.isBulletsLastLonger > 1 return tech.isBulletsLastLonger > 1
}, },
requires: "Lorentzian topology", requires: "anti-shear topology",
effect() { effect() {
tech.isDamageFromBulletCount = true tech.isDamageFromBulletCount = true
}, },

View File

@@ -1,10 +1,5 @@
******************************************************** NEXT PATCH ******************************************************** ******************************************************** NEXT PATCH ********************************************************
new mob: pulsar - aims at player and does damage in an circle
(set to 3x chance to show up until the next patch)
several tech that were nonrefundable now can be removed and refunded
added several bug fixes
******************************************************** BUGS ******************************************************** ******************************************************** BUGS ********************************************************
@@ -51,12 +46,12 @@ use the floor of portal sensor on the player? to unstuck player
******************************************************** TODO ******************************************************** ******************************************************** TODO ********************************************************
pulsar boss, ignores line of site, but a longer fire CD
remove pulsar from high chance to show on next patch
mob bullets that blow up mob bullets that blow up
draw outline of exploded region, 2 seconds later damage player in region and remove bullet draw outline of exploded region, 2 seconds later damage player in region and remove bullet
holding down the field button on fields that don't have a normal field graphic shows a field arc outline to indicate grabbing blocks
mob sniper: draw aim graphics before fire mob sniper: draw aim graphics before fire