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