diff --git a/xivsupport/src/main/java/gg/xp/xivsupport/events/actlines/events/AbilityUsedEvent.java b/xivsupport/src/main/java/gg/xp/xivsupport/events/actlines/events/AbilityUsedEvent.java index c5327343a8ea..246f998e610a 100644 --- a/xivsupport/src/main/java/gg/xp/xivsupport/events/actlines/events/AbilityUsedEvent.java +++ b/xivsupport/src/main/java/gg/xp/xivsupport/events/actlines/events/AbilityUsedEvent.java @@ -16,12 +16,14 @@ public class AbilityUsedEvent extends BaseEvent implements HasSourceEntity, HasT private final XivCombatant caster; private final XivCombatant target; private final List effects; + private final long sequenceId; - public AbilityUsedEvent(XivAbility ability, XivCombatant caster, XivCombatant target, List effects) { + public AbilityUsedEvent(XivAbility ability, XivCombatant caster, XivCombatant target, List effects, long sequenceId) { this.ability = ability; this.caster = caster; this.target = target; this.effects = effects; + this.sequenceId = sequenceId; } public XivAbility getAbility() { @@ -42,8 +44,13 @@ public List getEffects() { return Collections.unmodifiableList(effects); } + // TODO: not accurate, need to account for parries and stuff public long getDamage() { return effects.stream().filter(effect -> effect instanceof DamageEffect).map(DamageEffect.class::cast) .mapToLong(DamageEffect::getAmount).sum(); } + + public long getSequenceId() { + return sequenceId; + } } diff --git a/xivsupport/src/main/java/gg/xp/xivsupport/events/actlines/parsers/FieldMapper.java b/xivsupport/src/main/java/gg/xp/xivsupport/events/actlines/parsers/FieldMapper.java index a26c21acf1fa..205d2eba850c 100644 --- a/xivsupport/src/main/java/gg/xp/xivsupport/events/actlines/parsers/FieldMapper.java +++ b/xivsupport/src/main/java/gg/xp/xivsupport/events/actlines/parsers/FieldMapper.java @@ -100,7 +100,7 @@ private String getRawField(int fieldIndex) { return rawLineSplit[fieldIndex]; } - private long getRawHex(int fieldIndex) { + public long getRawHex(int fieldIndex) { String rawField = getRawField(fieldIndex); if (rawField.isEmpty()) { return -1; diff --git a/xivsupport/src/main/java/gg/xp/xivsupport/events/actlines/parsers/Line21Parser.java b/xivsupport/src/main/java/gg/xp/xivsupport/events/actlines/parsers/Line21Parser.java index 7348406b0adc..2812c0e88e8d 100644 --- a/xivsupport/src/main/java/gg/xp/xivsupport/events/actlines/parsers/Line21Parser.java +++ b/xivsupport/src/main/java/gg/xp/xivsupport/events/actlines/parsers/Line21Parser.java @@ -23,7 +23,8 @@ protected Event convert(FieldMapper fields, int lineNumber, ZonedDateTim fields.getAbility(Fields.abilityId, Fields.abilityName), fields.getEntity(Fields.casterId, Fields.casterName), fields.getEntity(Fields.targetId, Fields.targetName), - fields.getAbilityEffects(Fields.targetName.ordinal() + 3, 8) + fields.getAbilityEffects(Fields.targetName.ordinal() + 3, 8), + fields.getRawHex(44) ); } } diff --git a/xivsupport/src/main/java/gg/xp/xivsupport/events/actlines/parsers/Line22Parser.java b/xivsupport/src/main/java/gg/xp/xivsupport/events/actlines/parsers/Line22Parser.java index afdbb8d52752..7618a4cd862c 100644 --- a/xivsupport/src/main/java/gg/xp/xivsupport/events/actlines/parsers/Line22Parser.java +++ b/xivsupport/src/main/java/gg/xp/xivsupport/events/actlines/parsers/Line22Parser.java @@ -23,7 +23,8 @@ protected Event convert(FieldMapper fields, int lineNumber, ZonedDateTim fields.getAbility(Fields.abilityId, Fields.abilityName), fields.getEntity(Fields.casterId, Fields.casterName), fields.getEntity(Fields.targetId, Fields.targetName), - fields.getAbilityEffects(Fields.targetName.ordinal() + 3, 8) + fields.getAbilityEffects(Fields.targetName.ordinal() + 3, 8), + fields.getRawHex(44) ); } } diff --git a/xivsupport/src/test/java/gg/xp/xivsupport/events/actlines/Line21Test.java b/xivsupport/src/test/java/gg/xp/xivsupport/events/actlines/Line21Test.java index 47040d432bcc..409ce171dfc9 100644 --- a/xivsupport/src/test/java/gg/xp/xivsupport/events/actlines/Line21Test.java +++ b/xivsupport/src/test/java/gg/xp/xivsupport/events/actlines/Line21Test.java @@ -18,7 +18,7 @@ public void positiveTest() { Assert.assertEquals(event.getAbility().getId(), 0x200524E); Assert.assertEquals(event.getSource().getId(), 0x107361AF); Assert.assertEquals(event.getTarget().getId(), 0x107361AD); - + Assert.assertEquals(event.getSequenceId(), 0x000BACE5); Assert.assertEquals(event.getAbility().getName(), "Item_524E"); Assert.assertEquals(event.getSource().getName(), "Foo Bar"); Assert.assertEquals(event.getTarget().getName(), "The Target"); diff --git a/xivsupport/src/test/java/gg/xp/xivsupport/events/actlines/Line22Test.java b/xivsupport/src/test/java/gg/xp/xivsupport/events/actlines/Line22Test.java index 53b0d542b5a8..cf7f41dbec5a 100644 --- a/xivsupport/src/test/java/gg/xp/xivsupport/events/actlines/Line22Test.java +++ b/xivsupport/src/test/java/gg/xp/xivsupport/events/actlines/Line22Test.java @@ -18,6 +18,7 @@ public void positiveTest() { Assert.assertEquals(event.getAbility().getId(), 0x200524E); Assert.assertEquals(event.getSource().getId(), 0x107361AF); Assert.assertEquals(event.getTarget().getId(), 0x107361AD); + Assert.assertEquals(event.getSequenceId(), 0x000BACE5); Assert.assertEquals(event.getAbility().getName(), "Item_524E"); Assert.assertEquals(event.getSource().getName(), "Foo Bar");