diff --git a/src/generated/resources/data/vampirism/advancements/vampire/resurrect.json b/src/generated/resources/data/vampirism/advancements/vampire/resurrect.json new file mode 100644 index 0000000000..10e3a9e225 --- /dev/null +++ b/src/generated/resources/data/vampirism/advancements/vampire/resurrect.json @@ -0,0 +1,43 @@ +{ + "parent": "vampirism:vampire/become_vampire", + "criteria": { + "main": { + "conditions": { + "type": "LEVEL", + "faction": "vampirism:vampire", + "level": 1 + }, + "trigger": "vampirism:faction" + }, + "resurrected": { + "conditions": { + "action": "RESURRECT" + }, + "trigger": "vampirism:vampire_action" + } + }, + "display": { + "announce_to_chat": true, + "description": { + "translate": "advancement.vampirism.resurrect.desc" + }, + "frame": "task", + "hidden": true, + "icon": { + "item": "vampirism:soul_orb_vampire" + }, + "show_toast": true, + "title": { + "translate": "advancement.vampirism.resurrect" + } + }, + "requirements": [ + [ + "resurrected" + ], + [ + "main" + ] + ], + "sends_telemetry_event": true +} \ No newline at end of file diff --git a/src/main/java/de/teamlapen/vampirism/advancements/critereon/VampireActionCriterionTrigger.java b/src/main/java/de/teamlapen/vampirism/advancements/critereon/VampireActionCriterionTrigger.java index 24b4492ffe..ca0e6dd7cf 100644 --- a/src/main/java/de/teamlapen/vampirism/advancements/critereon/VampireActionCriterionTrigger.java +++ b/src/main/java/de/teamlapen/vampirism/advancements/critereon/VampireActionCriterionTrigger.java @@ -49,7 +49,7 @@ protected Instance createInstance(@NotNull JsonObject json, @NotNull ContextAwar } public enum Action { - SNIPED_IN_BAT, POISONOUS_BITE, PERFORM_RITUAL_INFUSION, BAT, SUCK_BLOOD, NONE, KILL_FROZEN_HUNTER + SNIPED_IN_BAT, POISONOUS_BITE, PERFORM_RITUAL_INFUSION, BAT, SUCK_BLOOD, NONE, KILL_FROZEN_HUNTER, RESURRECT } static class Instance extends AbstractCriterionTriggerInstance { diff --git a/src/main/java/de/teamlapen/vampirism/data/provider/AdvancementProvider.java b/src/main/java/de/teamlapen/vampirism/data/provider/AdvancementProvider.java index 41ce0a17f4..16375c1dd4 100644 --- a/src/main/java/de/teamlapen/vampirism/data/provider/AdvancementProvider.java +++ b/src/main/java/de/teamlapen/vampirism/data/provider/AdvancementProvider.java @@ -165,6 +165,12 @@ public void generate(@NotNull Advancement root, HolderLookup.@NotNull Provider h .addCriterion("flower", VampireActionCriterionTrigger.builder(VampireActionCriterionTrigger.Action.PERFORM_RITUAL_INFUSION)) .addCriterion("main", FactionCriterionTrigger.level(VReference.VAMPIRE_FACTION, 1)) .save(consumer, REFERENCE.MODID + ":vampire/blood_cult"); + Advancement resurrect = Advancement.Builder.advancement() + .display(ModItems.SOUL_ORB_VAMPIRE.get(), Component.translatable("advancement.vampirism.resurrect"), Component.translatable("advancement.vampirism.resurrect.desc"), null, FrameType.TASK, true, true, true) + .parent(become_vampire) + .addCriterion("resurrected", VampireActionCriterionTrigger.builder(VampireActionCriterionTrigger.Action.RESURRECT)) + .addCriterion("main", FactionCriterionTrigger.level(VReference.VAMPIRE_FACTION, 1)) + .save(consumer, REFERENCE.MODID + ":vampire/resurrect"); Advancement extra_storage = Advancement.Builder.advancement() .display(ModBlocks.BLOOD_CONTAINER.get(), Component.translatable("advancement.vampirism.extra_storage"), Component.translatable("advancement.vampirism.extra_storage.desc"), null, FrameType.TASK, true, true, true) .parent(first_blood) diff --git a/src/main/java/de/teamlapen/vampirism/entity/player/vampire/VampirePlayer.java b/src/main/java/de/teamlapen/vampirism/entity/player/vampire/VampirePlayer.java index cc9532ce04..fe1e18ffaa 100644 --- a/src/main/java/de/teamlapen/vampirism/entity/player/vampire/VampirePlayer.java +++ b/src/main/java/de/teamlapen/vampirism/entity/player/vampire/VampirePlayer.java @@ -1058,6 +1058,9 @@ public void tryResurrect() { } this.player.addEffect(new MobEffectInstance(ModEffects.NEONATAL.get(), duration)); this.player.awardStat(ModStats.resurrected); + if (this.player instanceof ServerPlayer serverPlayer) { + ModAdvancements.TRIGGER_VAMPIRE_ACTION.trigger(serverPlayer, VampireActionCriterionTrigger.Action.RESURRECT); + } } else { if (this.isRemote()) { this.setDBNOTimer(-1); diff --git a/src/main/resources/assets/vampirism/lang/en_us.json b/src/main/resources/assets/vampirism/lang/en_us.json index d4e55db38b..21854edd5d 100644 --- a/src/main/resources/assets/vampirism/lang/en_us.json +++ b/src/main/resources/assets/vampirism/lang/en_us.json @@ -239,6 +239,8 @@ "advancement.vampirism.hunter_kill_mother.desc": "You've proven your mettle as a true hunter by conquering the 'Ancient Remains' and dealing a blow to vampiric power.", "advancement.vampirism.vampire_kill_mother": "Ancient Dominion", "advancement.vampirism.vampire_kill_mother.desc": "You've have vanquishing the local source of power, a questionable accomplishment.", + "advancement.vampirism.resurrect": "I always come back", + "advancement.vampirism.resurrect.desc": "Resurrect as a vampire", "__comment": "effect", "effect.vampirism.sunscreen": "Sunscreen", "effect.vampirism.thirst": "Thirst",