laser mod beam splitter

laser mod: beam splitter - laser is split into diverging beams, but does 10% less damage
This commit is contained in:
landgreen
2020-10-03 10:25:05 -07:00
parent b22bd12529
commit b1f4109827
3 changed files with 39 additions and 13 deletions

View File

@@ -3230,8 +3230,7 @@ const b = {
mech.energy -= mech.fieldRegen + mod.laserFieldDrain * mod.isLaserDiode
if (mod.isWideLaser) {
const off = 8
const dmg = 0.6 * mod.laserDamage // 5 * 0.4 = 200% more damage
// ctx.lineCap = 'butt';
const dmg = 0.4 * mod.laserDamage // 5 * 0.4 = 200% more damage
b.laser({
x: mech.pos.x + 20 * Math.cos(mech.angle),
y: mech.pos.y + 20 * Math.sin(mech.angle)
@@ -3252,7 +3251,18 @@ const b = {
y: i * off * Math.sin(mech.angle - Math.PI / 2)
}), mech.angle, dmg, 0, true)
}
// ctx.lineCap = 'round';
} else if (mod.beamSplitter) {
let dmg = mod.laserDamage * 0.9
const where = {
x: mech.pos.x + 20 * Math.cos(mech.angle),
y: mech.pos.y + 20 * Math.sin(mech.angle)
}
b.laser(where, mech.angle, dmg)
for (let i = 1; i < 1 + mod.beamSplitter; i++) {
b.laser(where, mech.angle + i * 0.2, dmg)
b.laser(where, mech.angle - i * 0.2, dmg)
dmg *= 0.9
}
} else {
b.laser()
}

View File

@@ -2352,24 +2352,39 @@ const mod = {
mod.laserFieldDrain = 0.0012;
}
},
{
name: "beam splitter",
description: `your <strong>laser</strong> is <strong>split</strong> into diverging beams<br>decrease <strong class='color-d'>damage</strong> by <strong>10%</strong>`,
maxCount: 9,
count: 0,
allowed() {
return mod.haveGunCheck("laser") && !mod.isWideLaser
},
requires: "laser, not specular reflection",
effect() {
mod.beamSplitter++
},
remove() {
mod.beamSplitter = 0
}
},
{
name: "diffuse beam",
description: "<strong>laser</strong> beam is <strong>wider</strong> but doesn't <strong>reflect</strong><br>increase <strong class='color-d'>damage</strong> and <strong class='color-f'>energy</strong> drain by <strong>150%</strong>",
description: "<strong>laser</strong> beam is <strong>wider</strong> and doesn't <strong>reflect</strong><br>increase <strong class='color-d'>damage</strong> by <strong>100%</strong>",
maxCount: 1,
count: 0,
allowed() {
return mod.haveGunCheck("laser") && mod.laserReflections < 3
return mod.haveGunCheck("laser") && mod.laserReflections < 3 && !mod.beamSplitter
},
requires: "laser, not specular reflection",
effect() {
mod.isWideLaser = true
mod.laserFieldDrain = 0.0012 * 2.5 //base is 0.002
},
remove() {
mod.isWideLaser = false
mod.laserFieldDrain = 0.0012;
}
},
// {
// name: "waste heat recovery",
// description: "<strong>laser</strong> <strong class='color-d'>damage</strong> grows by <strong>400%</strong> as you fire<br>but you periodically <strong>eject</strong> your <strong class='color-h'>health</strong>",
@@ -2973,5 +2988,6 @@ const mod = {
aimDamage: null,
isNoFireDefense: null,
isNoFireDamage: null,
duplicateChance: null
duplicateChance: null,
beamSplitter: null
}