16 private IntervalUtil fireInterval =
new IntervalUtil(0.25f, 1.75f);
20 public void advance(
float amount, CombatEngineAPI engine, BeamAPI beam) {
21 CombatEntityAPI target = beam.getDamageTarget();
22 if (target instanceof ShipAPI && beam.getBrightness() >= 1f) {
23 float dur = beam.getDamage().getDpsDuration();
25 if (!wasZero) dur = 0;
26 wasZero = beam.getDamage().getDpsDuration() <= 0;
27 fireInterval.advance(dur);
29 if (fireInterval.intervalElapsed()) {
30 ShipAPI ship = (ShipAPI) target;
31 boolean hitShield = target.getShield() !=
null && target.getShield().isWithinArc(beam.getTo());
32 float pierceChance = ((ShipAPI)target).getHardFluxLevel() - 0.1f;
33 pierceChance *= ship.getMutableStats().getDynamic().getValue(Stats.SHIELD_PIERCED_MULT);
35 boolean piercedShield = hitShield && (float) Math.random() < pierceChance;
38 if (!hitShield || piercedShield) {
39 Vector2f point = beam.getRayEndPrevFrame();
40 float emp = beam.getDamage().getFluxComponent() * 1f;
41 float dam = beam.getDamage().getDamage() * 1f;
42 engine.spawnEmpArcPierceShields(
43 beam.getSource(), point, beam.getDamageTarget(), beam.getDamageTarget(),
48 "tachyon_lance_emp_impact",
50 beam.getFringeColor(),