-
Notifications
You must be signed in to change notification settings - Fork 6
NEW API + EVENT HOOKS (While_Leeching + Resource Tracker/Thresholds) #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 1.20-Forge
Are you sure you want to change the base?
Changes from all commits
ff6fb59
bf52165
7336969
62bcd68
2559965
211c0ff
6ec6525
c0a0476
5aece79
1fdcb7f
f06bf30
e83314d
0ee8eb6
c364377
26310f1
5976286
308fd77
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| package com.robertx22.mine_and_slash.aoe_data.database.exile_effects.adders; | ||
|
|
||
| import com.robertx22.mine_and_slash.saveclasses.unit.ResourceType; | ||
| import com.robertx22.library_of_exile.registry.ExileRegistryInit; | ||
| import com.robertx22.mine_and_slash.aoe_data.database.ailments.Ailments; | ||
| import com.robertx22.mine_and_slash.aoe_data.database.exile_effects.ExileEffectBuilder; | ||
|
|
@@ -36,8 +37,10 @@ | |
|
|
||
| import java.util.ArrayList; | ||
| import java.util.Arrays; | ||
| import java.util.EnumMap; | ||
| import java.util.List; | ||
| import java.util.UUID; | ||
| import java.util.Map; | ||
|
|
||
| import static net.minecraft.world.entity.ai.attributes.Attributes.*; | ||
|
|
||
|
|
@@ -68,6 +71,8 @@ public class ModEffects implements ExileRegistryInit { | |
| public static EffectCtx BLIND = new EffectCtx("blind", "Blind", Elements.Shadow, EffectType.negative); | ||
| public static EffectCtx STUN = new EffectCtx("stun", "Stun", Elements.Physical, EffectType.negative); | ||
| public static EffectCtx GALE_FORCE = new EffectCtx("gale_force", "Gale Force", Elements.Physical, EffectType.beneficial); | ||
| public static EffectCtx WRATH_OF_THE_JUGGERNAUT = new EffectCtx("wrath_of_the_juggernaut", "Wrath of the Juggernaut", Elements.Physical, EffectType.beneficial); | ||
| public static EffectCtx BURNOUT = new EffectCtx("burnout", "Burnout", Elements.Physical, EffectType.negative); | ||
|
|
||
| // these could be used for map affixes | ||
| public static EffectCtx SLOW = new EffectCtx("slow", "Lethargy", Elements.Physical, EffectType.negative); | ||
|
|
@@ -100,6 +105,50 @@ public static List<EffectCtx> getCurses() { | |
|
|
||
| public static int ESSENCE_OF_FROST_MAX_STACKS = 5; | ||
|
|
||
| // ---------- Helper ---------- | ||
| private static EffectCtx state(String id, String name, Elements elem) { | ||
| return new EffectCtx(id, name, elem, EffectType.beneficial); | ||
| } | ||
| private static EffectCtx statePhysical(String id, String name) { | ||
| return state(id, name, Elements.Physical); | ||
| } | ||
|
|
||
| // Pretty names for resources (UI text) | ||
| private static final Map<ResourceType, String> RES_NAME = Map.of( | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In next PR after you move thresholds generation into
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had figured that leeching was hardcoded and wouldn't need datapack functionality, unless you want me to use datadriven resource types. |
||
| ResourceType.health, "Health", | ||
| ResourceType.mana, "Mana", | ||
| ResourceType.energy, "Energy", | ||
| ResourceType.magic_shield, "Magic Shield", | ||
| ResourceType.blood, "Blood" | ||
| ); | ||
|
|
||
| // Suggested elements per resource (only used for coloring/category) | ||
|
|
||
| // ---------- Generic flags ---------- | ||
| public static final EffectCtx LEECHING_STATE = state( | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In next PR after you move thresholds generation into |
||
| "leeching_state", "Leeching (State)", Elements.Physical | ||
| ); | ||
| public static final EffectCtx REGEN_STATE = state( | ||
| "regen_state", "Regenerating (State)", Elements.Physical | ||
| ); | ||
|
|
||
| // ---------- Per-resource flags (generated) ---------- | ||
| public static final EnumMap<ResourceType, EffectCtx> LEECHING_STATE_BY_RES = new EnumMap<>(ResourceType.class); | ||
| public static final EnumMap<ResourceType, EffectCtx> REGEN_STATE_BY_RES = new EnumMap<>(ResourceType.class); | ||
|
|
||
| static { | ||
| for (var rt : RES_NAME.keySet()) { | ||
| var nice = RES_NAME.get(rt); | ||
|
|
||
| LEECHING_STATE_BY_RES.put( | ||
| rt, statePhysical("leeching_" + rt.id + "_state", "Leeching " + nice) | ||
| ); | ||
| REGEN_STATE_BY_RES.put( | ||
| rt, statePhysical("regen_" + rt.id + "_state", "Regenerating " + nice) | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| public static void init() { | ||
|
|
||
| } | ||
|
|
@@ -359,6 +408,22 @@ public void registerAll() { | |
| .addTags(EffectTags.song, EffectTags.offensive) | ||
| .build(); | ||
|
|
||
| ExileEffectBuilder.of(WRATH_OF_THE_JUGGERNAUT) | ||
| .vanillaStat(VanillaStatData.create(ATTACK_SPEED, 0.30F, ModType.MORE, UUID.fromString("0c7a6e2c-5e5c-4f2f-9e3b-2a8e3c1a1f30"))) | ||
| .vanillaStat(VanillaStatData.create(KNOCKBACK_RESISTANCE, 1.0F, ModType.FLAT, UUID.fromString("a9d9c9f2-9f0f-4521-9c3e-9f7a1c2b5e11"))) | ||
| .stat(10, 10, DefenseStats.DAMAGE_REDUCTION.get(), ModType.FLAT) | ||
| .stat(100, 100, SpellChangeStats.COOLDOWN_REDUCTION_PER_SPELL_TAG.get(SpellTags.weapon_skill), ModType.FLAT) | ||
| .spell(SpellBuilder.forEffect() | ||
| .buildForEffect()) | ||
| .addTags(EffectTags.offensive) | ||
| .maxStacks(1) | ||
| .build(); | ||
|
|
||
| ExileEffectBuilder.of(BURNOUT) | ||
| .maxStacks(1) | ||
| .addTags(EffectTags.negative) | ||
| .build(); | ||
|
|
||
|
|
||
| ExileEffectBuilder.of(REJUVENATE) | ||
| .maxStacks(5) | ||
|
|
@@ -385,6 +450,24 @@ public void registerAll() { | |
| .tick(20D)) | ||
| .buildForEffect()) | ||
| .build(); | ||
|
|
||
| // (NEW) Leeching & Healing | ||
| ExileEffectBuilder.of(LEECHING_STATE) | ||
| .maxStacks(1) | ||
| .build(); | ||
|
|
||
| ExileEffectBuilder.of(REGEN_STATE) | ||
| .maxStacks(1) | ||
| .build(); | ||
|
|
||
| // Register per-resource flags | ||
| for (EffectCtx ctx : LEECHING_STATE_BY_RES.values()) { | ||
| ExileEffectBuilder.of(ctx).maxStacks(1).build(); | ||
| } | ||
|
|
||
| for (EffectCtx ctx : REGEN_STATE_BY_RES.values()) { | ||
| ExileEffectBuilder.of(ctx).maxStacks(1).build(); | ||
| } | ||
|
|
||
| ExileEffectBuilder.of(BLIZZARD_REDUCE_HEAL_STRENGTH) | ||
| .maxStacks(1) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has to be done as method overload