Skip to content

Commit

Permalink
Battle Banner ranged haste
Browse files Browse the repository at this point in the history
  • Loading branch information
ZsoltMolnarrr committed Apr 10, 2024
1 parent 698dd3a commit 9476527
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# 1.2.0

- Migrate to latest Spell Power Attributes API
- Battle Banner now also provides ranged attack haste (configurable)

# 1.1.3

Expand Down
1 change: 1 addition & 0 deletions src/main/java/net/paladins/config/EffectsConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

public class EffectsConfig {
public float battle_banner_attack_speed_bonus = 0.4F;
public float battle_banner_ranged_haste_bonus = 0.4F;
public float battle_banner_spell_haste_bonus = 0.4F;
public float battle_banner_knockback_resistance_bonus = 0.5F;
}
15 changes: 12 additions & 3 deletions src/main/java/net/paladins/effect/Effects.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,30 @@ public class Effects {
public static StatusEffect JUDGEMENT = new JudgementStatusEffect(StatusEffectCategory.HARMFUL, 0xffffcc);
public static StatusEffect ABSORPTION = new PriestAbsorptionStatusEffect(StatusEffectCategory.BENEFICIAL, 0xffffcc);

public static String BATTLE_BANNER_BOOST_UUID = "052f3166-8a43-11ed-a1eb-0242ac120002";

public static void register() {
BATTLE_BANNER
.addAttributeModifier(EntityAttributes.GENERIC_ATTACK_SPEED,
"052f3166-8a43-11ed-a1eb-0242ac120002",
BATTLE_BANNER_BOOST_UUID,
PaladinsMod.effectsConfig.value.battle_banner_attack_speed_bonus,
EntityAttributeModifier.Operation.MULTIPLY_BASE)
.addAttributeModifier(SpellPowerMechanics.HASTE.attribute,
"052f3166-8a43-11ed-a1eb-0242ac120002",
BATTLE_BANNER_BOOST_UUID,
PaladinsMod.effectsConfig.value.battle_banner_spell_haste_bonus,
EntityAttributeModifier.Operation.MULTIPLY_BASE)
.addAttributeModifier(EntityAttributes.GENERIC_KNOCKBACK_RESISTANCE,
"052f3166-8a43-11ed-a1eb-0242ac120002",
BATTLE_BANNER_BOOST_UUID,
PaladinsMod.effectsConfig.value.battle_banner_knockback_resistance_bonus,
EntityAttributeModifier.Operation.MULTIPLY_BASE)
;
var rangedHasteAttribute = Registries.ATTRIBUTE.get(new Identifier("ranged_weapon", "haste"));
if (rangedHasteAttribute != null) {
BATTLE_BANNER.addAttributeModifier(rangedHasteAttribute,
BATTLE_BANNER_BOOST_UUID,
PaladinsMod.effectsConfig.value.battle_banner_ranged_haste_bonus,
EntityAttributeModifier.Operation.MULTIPLY_BASE);
}

Synchronized.configure(DIVINE_PROTECTION, true);
Synchronized.configure(JUDGEMENT, true);
Expand Down

0 comments on commit 9476527

Please sign in to comment.