extruder balance

extruder: leftovers still exist when field isn't active
  range and damage are all slightly decreased
  energy drain is greatly increased
This commit is contained in:
landgreen
2020-12-14 04:14:50 -08:00
parent 92c5670369
commit 4e74b8ac30
4 changed files with 96 additions and 144 deletions

View File

@@ -679,124 +679,85 @@ const b = {
World.add(engine.world, bullet[me]); //add bullet to world World.add(engine.world, bullet[me]); //add bullet to world
}, },
lastAngle: 0, lastAngle: 0,
wasExtruderOn: false,
isExtruderOn: false,
extruder() { extruder() {
const color = "#f07" const DRAIN = 0.0007 + mech.fieldRegen
const DRAIN = 0.00014 + mech.fieldRegen
if (mech.energy > DRAIN) { if (mech.energy > DRAIN) {
mech.energy -= DRAIN mech.energy -= DRAIN
if (mech.energy < 0) { if (mech.energy < 0) {
mech.fieldCDcycle = mech.cycle + 120; mech.fieldCDcycle = mech.cycle + 120;
mech.energy = 0; mech.energy = 0;
} }
ctx.lineWidth = 5; const SPEED = 10
ctx.strokeStyle = color const me = bullet.length;
ctx.beginPath(); //draw all the wave bullets const where = Vector.add(mech.pos, player.velocity)
for (let i = 0, len = bullet.length; i < len; i++) { bullet[me] = Bodies.polygon(where.x + 20 * Math.cos(mech.angle), where.y + 20 * Math.sin(mech.angle), 3, 0.01, {
if (bullet[i].isBranch) { cycle: -0.5,
ctx.stroke(); isWave: true,
ctx.beginPath(); //draw all the wave bullets endCycle: game.cycle + 10 + 40 * mod.isPlasmaRange,
} else if (bullet[i].isWave) ctx.lineTo(bullet[i].position.x, bullet[i].position.y) inertia: Infinity,
} frictionAir: 0,
ctx.lineTo(mech.pos.x + 15 * Math.cos(mech.angle), mech.pos.y + 15 * Math.sin(mech.angle)) isInHole: true, //this keeps the bullet from entering wormholes
ctx.stroke(); minDmgSpeed: 0,
} else { dmg: b.dmgScale * 1.25, //damage also changes when you divide by mob.mass on in .do()
mech.fireCDcycle = mech.cycle + 60; // cool down classType: "bullet",
for (let i = 0, len = bullet.length; i < len; i++) { //remove all bullets isBranch: false,
if (bullet[i].isWave) { restitution: 0,
bullet[i].isWave = false collisionFilter: {
bullet[i].endCycle = 0 // category: 0,
} // mask: 0, //cat.mob | cat.mobBullet | cat.mobShield
} category: cat.bullet,
return mask: cat.map, //cat.mob | cat.mobBullet | cat.mobShield
} },
beforeDmg() {},
const SPEED = 13 onEnd() {},
const me = bullet.length; do() {
const where = Vector.add(mech.pos, player.velocity) if (!mech.isBodiesAsleep) {
bullet[me] = Bodies.polygon(where.x + 20 * Math.cos(mech.angle), where.y + 20 * Math.sin(mech.angle), 3, 0.01, { if (this.endCycle < game.cycle + 1) this.isWave = false
cycle: -0.5, if (Matter.Query.point(map, this.position).length) { //check if inside map
isWave: true, this.isBranch = true;
endCycle: game.cycle + 50 * mod.isPlasmaRange, } else { //check if inside a body
inertia: Infinity, const q = Matter.Query.point(mob, this.position)
frictionAir: 0, for (let i = 0; i < q.length; i++) {
isInHole: true, //this keeps the bullet from entering wormholes Matter.Body.setVelocity(q[i], {
minDmgSpeed: 0, x: q[i].velocity.x * 0.7,
dmg: b.dmgScale * 1.4, //damage also changes when you divide by mob.mass on in .do() y: q[i].velocity.y * 0.7
isJustReflected: false, });
classType: "bullet", Matter.Body.setPosition(this, Vector.add(this.position, q[i].velocity)) //move with the medium
isBranch: false, let dmg = this.dmg / Math.min(10, q[i].mass)
restitution: 0, q[i].damage(dmg);
collisionFilter: { q[i].foundPlayer();
// category: 0, game.drawList.push({ //add dmg to draw queue
// mask: 0, //cat.mob | cat.mobBullet | cat.mobShield x: this.position.x,
category: cat.bullet, y: this.position.y,
mask: cat.map, //cat.mob | cat.mobBullet | cat.mobShield radius: Math.log(2 * dmg + 1.1) * 40,
}, color: "rgba(255, 0, 119, 0.5)",
beforeDmg() {}, time: game.drawTime
onEnd() {}, });
do() { }
mech.fireCDcycle = mech.cycle //this is here to trigger cloaking field
if (!input.field) {
this.endCycle = 0;
this.isWave = false
return
}
if (!mech.isBodiesAsleep) {
if (this.endCycle < game.cycle + 1) this.isWave = false
if (Matter.Query.point(map, this.position).length) { //check if inside map
this.isBranch = true;
// for (let i = 0, len = bullet.length; i < len; i++) { //remove all bullets
// if (bullet[i].isWave && bullet[i].cycle > this.cycle) {
// bullet[i].isWave = false
// bullet[i].endCycle = 0
// }
// }
} else { //check if inside a body
const q = Matter.Query.point(mob, this.position)
for (let i = 0; i < q.length; i++) {
Matter.Body.setVelocity(q[i], {
x: q[i].velocity.x * 0.7,
y: q[i].velocity.y * 0.7
});
Matter.Body.setPosition(this, Vector.add(this.position, q[i].velocity)) //move with the medium
let dmg = this.dmg / Math.min(10, q[i].mass)
q[i].damage(dmg);
q[i].foundPlayer();
game.drawList.push({ //add dmg to draw queue
x: this.position.x,
y: this.position.y,
radius: Math.log(2 * dmg + 1.4) * 40,
color: color,
time: game.drawTime
});
} }
this.cycle++
const wiggleMag = (mech.crouch ? 6 : 12) * Math.cos(game.cycle * 0.09)
const wiggle = Vector.mult(transverse, wiggleMag * Math.cos(this.cycle * 0.36)) //+ wiggleMag * Math.cos(game.cycle * 0.3))
const velocity = Vector.mult(player.velocity, 0.25) //move with player
Matter.Body.setPosition(this, Vector.add(velocity, Vector.add(this.position, wiggle)))
// Matter.Body.setPosition(this, Vector.add(this.position, wiggle))
} }
this.cycle++
const wiggleMag = (mech.crouch ? 6 : 12) * Math.cos(game.cycle * 0.09)
const wiggle = Vector.mult(transverse, wiggleMag * Math.cos(this.cycle * 0.36)) //+ wiggleMag * Math.cos(game.cycle * 0.3))
const velocity = Vector.mult(player.velocity, 0.3) //move with player
Matter.Body.setPosition(this, Vector.add(velocity, Vector.add(this.position, wiggle)))
// Matter.Body.setPosition(this, Vector.add(this.position, wiggle))
} }
} });
}); World.add(engine.world, bullet[me]); //add bullet to world
World.add(engine.world, bullet[me]); //add bullet to world Matter.Body.setVelocity(bullet[me], {
Matter.Body.setVelocity(bullet[me], { x: SPEED * Math.cos(mech.angle),
x: SPEED * Math.cos(mech.angle), y: SPEED * Math.sin(mech.angle)
y: SPEED * Math.sin(mech.angle) });
}); const transverse = Vector.normalise(Vector.perp(bullet[me].velocity))
const transverse = Vector.normalise(Vector.perp(bullet[me].velocity)) if (180 - Math.abs(Math.abs(b.lastAngle - mech.angle) - 180) > 0.3) bullet[me].isBranch = true; //don't draw stroke for this bullet
const angleDifference = 180 - Math.abs(Math.abs(b.lastAngle - mech.angle) - 180); //find the difference between current and previous angle b.lastAngle = mech.angle //track last angle for the above angle difference calculation
b.lastAngle = mech.angle if (!mech.wasExtruderOn) bullet[me].isBranch = true;
if (angleDifference > 0.5) { //don't draw stroke for this bullet mech.isExtruderOn = true
bullet[me].isBranch = true; } else {
// for (let i = 0, len = bullet.length; i < len; i++) { //remove all bullets mech.isExtruderOn = false
// if (bullet[i].isWave) {
// bullet[i].isWave = false
// bullet[i].endCycle = 0
// }
// }
// return
} }
}, },
plasma() { plasma() {

View File

@@ -16,9 +16,9 @@ const level = {
// level.difficultyIncrease(19) // level.difficultyIncrease(19)
// game.zoomScale = 1000; // game.zoomScale = 1000;
// game.setZoom(); // game.setZoom();
// mech.setField("plasma torch") mech.setField("plasma torch")
// b.giveGuns("wave beam") // b.giveGuns("wave beam")
// mod.giveMod("micro-extruder") mod.giveMod("micro-extruder")
// for (let i = 0; i < 15; i++) mod.giveMod("supply chain") // for (let i = 0; i < 15; i++) mod.giveMod("supply chain")

View File

@@ -1660,6 +1660,28 @@ const mech = {
} }
mech.drawFieldMeter("rgba(0, 0, 0, 0.2)") mech.drawFieldMeter("rgba(0, 0, 0, 0.2)")
if (mod.isExtruder) {
if (input.field) {
mech.wasExtruderOn = true
} else {
mech.wasExtruderOn = false
}
ctx.lineWidth = 5;
ctx.strokeStyle = "#f07"
ctx.beginPath(); //draw all the wave bullets
for (let i = 0, len = bullet.length; i < len; i++) {
if (bullet[i].isWave) {
if (bullet[i].isBranch) {
ctx.stroke();
ctx.beginPath(); //draw all the wave bullets
} else {
ctx.lineTo(bullet[i].position.x, bullet[i].position.y)
}
}
}
if (mech.wasExtruderOn && mech.isExtruderOn) ctx.lineTo(mech.pos.x + 15 * Math.cos(mech.angle), mech.pos.y + 15 * Math.sin(mech.angle))
ctx.stroke();
}
} }
} }
}, },

View File

@@ -1,37 +1,8 @@
******************************************************** NEXT PATCH ******************************************************** ******************************************************** NEXT PATCH ********************************************************
wave beam damage works better vs. high mass mobs extruder: leftovers still exist when field isn't active
also more damage and ammo range and damage are all slightly decreased
energy drain is greatly increased
mod plasma torch: extruder - plasma torch ejects a thin hot wire, does more damage, but drains more energy
mod: Bose Einstein condensate - freeze mobs inside your field
pilot wave, negative mass field, time dilation field
difficulty - after you clear the finalBoss, difficulty increase per level is now lower
but, when the finalBoss dies difficulty immediately increases greatly
difficulty used to work like this:
(+1 per level) 0,1,2,3,4,5,6,7,8,9,10, (final boss dies)
(+2,3,4 per level) 12,14,16,19,22,25,29,33,37,41, (final boss dies)
(+4 per level) 44,48,52,56 ...
difficulty works like this now:
(+1 per level) 0,1,2,3,4,5,6,7,8,9,10, (final boss dies +5)
(+2 per level) 17,19,21,23,25,27,29,31,33,35, (final boss dies +5)
(+3 per level) 43,46,49,52 ...
difficulty mode scales these numbers
easy: x1, normal: x2, hard: x4, why: x6
each time difficulty increases:
game.dmgScale = 0.38 * game.difficulty //damage done by mobs increases each level
b.dmgScale *= 0.93; // your damage goes down
game.healScale = 1 / (1 + game.difficulty * 0.06) //healing goes down
if (game.accelScale < 5) game.accelScale *= 1.02 //mob acceleration increases each level, but is capped
if (game.lookFreqScale > 0.2) game.lookFreqScale *= 0.98 //mob cycles between looks decreases each level, but is capped
if (game.CDScale > 0.2) game.CDScale *= 0.97 //mob ability cooldown time decreases each level, but is capped
******************************************************** BUGS ******************************************************** ******************************************************** BUGS ********************************************************
@@ -69,8 +40,6 @@ mod and mob are too similar
******************************************************** TODO ******************************************************** ******************************************************** TODO ********************************************************
mod plasma torch: extruder speed is improved
color/highlight field or gun mods in selection menu (or custom) color/highlight field or gun mods in selection menu (or custom)
to show that they are special to show that they are special