bug fixes

bremsstrahlung does extra damage to shields

bug fixes
This commit is contained in:
landgreen
2022-05-10 15:29:22 -07:00
parent 5938e06148
commit c65e163b6f
6 changed files with 40 additions and 28 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -3202,7 +3202,7 @@ const b = {
}
}
//aoe damage to mobs
const dmg = (0.12 + 0.04 * tech.isFastDrones) * m.dmgScale * tech.droneRadioDamage * tech.radioactiveDamage
let dmg = (0.12 + 0.04 * tech.isFastDrones) * m.dmgScale * tech.droneRadioDamage * tech.radioactiveDamage
for (let i = 0, len = mob.length; i < len; i++) {
if (Vector.magnitude(Vector.sub(mob[i].position, this.position)) < this.radioRadius + mob[i].radius) {
if (Matter.Query.ray(map, mob[i].position, this.position).length > 0) dmg *= 0.25 //reduce damage if a wall is in the way

View File

@@ -2648,8 +2648,8 @@ const level = {
m.addHealth(Infinity)
// spawn.starter(1900, -500, 200) //big boy
// for (let i = 0; i < 10; ++i) spawn.launcher(1900, -500)
spawn.slashBoss(1900, -500)
for (let i = 0; i < 10; ++i) spawn.launcher(1900, -500)
// spawn.slashBoss(1900, -500)
// spawn.launcherBoss(3200, -500)
// spawn.laserTargetingBoss(1700, -500)
// spawn.powerUpBoss(1900, -500)

View File

@@ -1026,7 +1026,6 @@ const m = {
y: Math.sin(m.angle)
};
//the dot product of diff and dir will return how much over lap between the vectors
// console.log(Vector.dot(dir, diff))
if (Vector.dot(dir, diff) > m.fieldThreshold) {
return true;
}
@@ -1046,7 +1045,6 @@ const m = {
}
},
// setMovement() {
// console.log('hi')
// m.Fx = tech.baseFx * tech.squirrelFx * (tech.isFastTime ? 1.5 : 1);
// m.jumpForce = tech.baseJumpForce * tech.squirrelJump * (tech.isFastTime ? 1.13 : 1)
// },
@@ -1333,11 +1331,21 @@ const m = {
const unit = Vector.normalise(Vector.sub(player.position, who.position))
if (tech.blockDmg) {
Matter.Body.setVelocity(who, { x: 0.5 * who.velocity.x, y: 0.5 * who.velocity.y });
if (tech.isBlockRadiation && !who.isShielded && !who.isMobBullet) {
mobs.statusDoT(who, tech.blockDmg * m.dmgScale * 4 / 12, 360) //200% increase -> x (1+2) //over 7s -> 360/30 = 12 half seconds -> 3/12
if (who.isShielded) {
for (let i = 0, len = mob.length; i < len; i++) {
if (mob[i].id === who.shieldID) mob[i].damage(tech.blockDmg * m.dmgScale * (tech.isBlockRadiation ? 6 : 2), true)
}
} else if (tech.isBlockRadiation) {
if (who.isMobBullet) {
who.damage(tech.blockDmg * m.dmgScale * 3, true)
} else {
mobs.statusDoT(who, tech.blockDmg * m.dmgScale * 4 / 12, 360) //200% increase -> x (1+2) //over 7s -> 360/30 = 12 half seconds -> 3/12
}
} else {
who.damage(tech.blockDmg * m.dmgScale, true)
}
//draw electricity
const step = 40
ctx.beginPath();
@@ -1665,11 +1673,31 @@ const m = {
}
if (tech.blockDmg) { //electricity
Matter.Body.setVelocity(mob[i], { x: 0.5 * mob[i].velocity.x, y: 0.5 * mob[i].velocity.y });
if (tech.isBlockRadiation && !mob[i].isShielded && !mob[i].isMobBullet) {
mobs.statusDoT(mob[i], tech.blockDmg * m.dmgScale * 4 / 12, 360) //200% increase -> x (1+2) //over 7s -> 360/30 = 12 half seconds -> 3/12
if (mob[i].isShielded) {
for (let j = 0, len = mob.length; j < len; j++) {
if (mob[j].id === mob[i].shieldID) mob[j].damage(tech.blockDmg * m.dmgScale * (tech.isBlockRadiation ? 6 : 2), true)
}
} else if (tech.isBlockRadiation) {
if (mob[i].isMobBullet) {
mob[i].damage(tech.blockDmg * m.dmgScale * 3, true)
} else {
mobs.statusDoT(mob[i], tech.blockDmg * m.dmgScale * 4 / 12, 360) //200% increase -> x (1+2) //over 7s -> 360/30 = 12 half seconds -> 3/12
}
} else {
mob[i].damage(tech.blockDmg * m.dmgScale)
mob[i].damage(tech.blockDmg * m.dmgScale, true)
}
// if (mob[i].isShielded) {
// for (let j = 0, len = mob.length; j < len; j++) {
// if (mob[j].id === mob[i].shieldID) mob[j].damage(tech.blockDmg * m.dmgScale * (tech.isBlockRadiation ? 3 : 1), true)
// }
// } else {
// if (tech.isBlockRadiation && !mob[i].isMobBullet) {
// mobs.statusDoT(mob[i], tech.blockDmg * m.dmgScale * 4 / 12, 360) //200% increase -> x (1+2) //over 7s -> 360/30 = 12 half seconds -> 3/12
// } else {
// mob[i].damage(tech.blockDmg * m.dmgScale)
// }
// }
const step = 40
ctx.beginPath();
for (let i = 0, len = 0.8 * tech.blockDmg; i < len; i++) {
@@ -2160,7 +2188,6 @@ const m = {
this.isPopping = false
},
do() {
// console.log(this.circleRadius)
if (this.isOn) {
//collisions with map
if (Matter.Query.collides(this, map).length > 0) {
@@ -2327,10 +2354,7 @@ const m = {
});
Composite.add(engine.world, m.plasmaBall);
// m.plasmaBall.startingVertices = m.plasmaBall.vertices.slice();
// console.log(m.plasmaBall.startingVertices, m.plasmaBall.vertices)
m.hold = function() {
if (m.isHolding) {
m.drawHold(m.holdingTarget);
@@ -2388,7 +2412,6 @@ const m = {
// if (player.velocity.y > 7) player.force.y -= 0.95 * player.mass * simulation.g //less gravity when falling fast
// player.force.y -= Math.min(0.95, 0.05 * floatScale) * player.mass * simulation.g; //undo some gravity on up or down
// console.log(friction)
//float
const slowY = (player.velocity.y > 0) ? Math.max(0.8, 1 - 0.002 * player.velocity.y * player.velocity.y) : Math.max(0.98, 1 - 0.001 * Math.abs(player.velocity.y)) //down : up
@@ -2786,7 +2809,6 @@ const m = {
// ctx.clip();
// }
m.hold = function() {
// console.log(m.holdingTarget)
if (m.isHolding) {
m.drawHold(m.holdingTarget);
m.holding();
@@ -3560,7 +3582,6 @@ const m = {
// if (input.field && m.fieldCDcycle < m.cycle) { //not hold but field button is pressed
// const justPastMouse = Vector.add(Vector.mult(Vector.normalise(Vector.sub(simulation.mouseInGame, m.pos)), 50), simulation.mouseInGame)
// const scale = 60
// // console.log(Matter.Query.region(map, bounds))
// const sub = Vector.sub(simulation.mouseInGame, m.pos)
// const mag = Vector.magnitude(sub)
// const drain = tech.isFreeWormHole ? 0 : 0.06 + 0.006 * Math.sqrt(mag)
@@ -3778,7 +3799,6 @@ const m = {
]
//
Matter.Body.setVertices(player, Matter.Vertices.create(points, player))
// console.log(circle)
player.parts.pop()
player.parts.pop()
player.parts.pop()
@@ -3793,9 +3813,7 @@ const m = {
// const circle = Bodies.polygon(player.position.x, player.position.x, 30, 30)
// player.parts[0] = circle
// console.log(player.parts[0])
// Matter.Body.setVertices(player.parts[0], Matter.Vertices.create(points, player.parts[0]))
// console.log(player.parts[0].vertices)
m.spin = 0
// m.groundControl = () => {} //disable entering ground
m.onGround = false
@@ -3846,7 +3864,6 @@ const m = {
m.Vy = player.velocity.y;
//tracks the last 10s of player information
// console.log(m.history)
m.history.splice(m.cycle % 600, 1, {
position: {
x: player.position.x,

View File

@@ -5572,6 +5572,7 @@ const spawn = {
me.shieldTargetID = target.id
target.isShielded = true;
target.shieldID = me.id
me.onDeath = function() {
//clear isShielded status from target
for (let i = 0, len = mob.length; i < len; i++) {

View File

@@ -1,13 +1,7 @@
******************************************************** NEXT PATCH **************************************************
tech: cherenkov radiation - bremsstrahlung damage is increased by 300% over 6 seconds
bremsstrahlung does 2->3 damage, and also applies to block collisions
bremsstrahlung does extra damage to shields
tech: nuclear transmutation - radiation sources do 70% more damage and harm
enthalpy now drops heal power ups instead of directly healing you
foam-shot has 13->15 particles, is slower, and less spread
bug fixes
******************************************************** TODO ********************************************************