diff options
author | syeyoung <cyong06@naver.com> | 2021-01-27 19:01:40 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-01-27 19:01:40 +0900 |
commit | 4dc9da6c2b23d145583ef528260cc7023a60bdfa (patch) | |
tree | 2916b02e3866b03a98092fd38406e3954b552b7c /src/main/java/kr/syeyoung/dungeonsguide/roomprocessor | |
parent | b5cbefcccf5ae5b7d156b181c5cefdcee3861ab8 (diff) | |
download | Skyblock-Dungeons-Guide-4dc9da6c2b23d145583ef528260cc7023a60bdfa.tar.gz Skyblock-Dungeons-Guide-4dc9da6c2b23d145583ef528260cc7023a60bdfa.tar.bz2 Skyblock-Dungeons-Guide-4dc9da6c2b23d145583ef528260cc7023a60bdfa.zip |
BONZO
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/roomprocessor')
4 files changed, 65 insertions, 12 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorBonzo.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorBonzo.java new file mode 100644 index 00000000..56957135 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorBonzo.java @@ -0,0 +1,62 @@ +package kr.syeyoung.dungeonsguide.roomprocessor.bossfight; + +import kr.syeyoung.dungeonsguide.utils.TextUtils; +import net.minecraft.client.entity.EntityOtherPlayerMP; +import net.minecraft.entity.item.EntityArmorStand; +import net.minecraftforge.event.entity.living.LivingEvent; + +import java.util.ArrayList; +import java.util.List; + +public class BossfightProcessorBonzo extends GeneralBossfightProcessor { + public BossfightProcessorBonzo() { + addPhase(GeneralBossfightProcessor.PhaseData.builder() + .phase("start") + .signatureMsg("§r§c[BOSS] Bonzo§r§f: Gratz for making it this far, but I’m basically unbeatable.§r") + .nextPhase("fight-1").build() + ); + addPhase(GeneralBossfightProcessor.PhaseData.builder() + .phase("fight-1") + .signatureMsg("§r§c[BOSS] Bonzo§r§f: I can summon lots of undead! Check this out.§r") + .nextPhase("first-defeat").build() + ); + addPhase(GeneralBossfightProcessor.PhaseData.builder() + .phase("first-defeat") + .signatureMsg("§r§c[BOSS] Bonzo§r§f: Oh I'm dead!§r").signatureMsg("§r§c[BOSS] Bonzo§r§f: Hoho, looks like you killed me!§r") + .nextPhase("fight-2").build() + ); + addPhase(GeneralBossfightProcessor.PhaseData.builder() + .phase("fight-2") + .signatureMsg("§r§c[BOSS] Bonzo§r§f: Sike§r").signatureMsg("§r§c[BOSS] Bonzo§r§f: I can revive myself and become much stronger!§r") + .nextPhase("final-defeat").build() + ); + addPhase(GeneralBossfightProcessor.PhaseData.builder() + .phase("final-defeat") + .signatureMsg("§r§c[BOSS] Bonzo§r§f: Alright, maybe I'm just weak after all..§r").build() + ); + } + + + @Override + public List<HealthData> getHealths() { + List<HealthData> healths = new ArrayList<HealthData>(); + long health = 0; + if (bonzoStand != null) { + String name = TextUtils.stripColor(bonzoStand.getName()); + String healthPart = name.split(" ")[2]; + health = TextUtils.reverseFormat(healthPart.substring(0, healthPart.length() - 1)); + System.out.println(healthPart.substring(0, healthPart.length() - 1) + " / "+ health); + } + healths.add(new HealthData("Bonzo", (int) health,250000 , this.getCurrentPhase().startsWith("fight-"))); + return healths; + } + + private EntityArmorStand bonzoStand; + @Override + public void onEntitySpawn(LivingEvent.LivingUpdateEvent updateEvent) { + if (updateEvent.entityLiving.getName().startsWith("§c§lBonzo§r ") && updateEvent.entityLiving instanceof EntityArmorStand) { + System.out.println(updateEvent.entityLiving.getName()); + bonzoStand = (EntityArmorStand) updateEvent.entityLiving; + } + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorLivid.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorLivid.java index 78dfd060..fa18262d 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorLivid.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorLivid.java @@ -33,6 +33,6 @@ public class BossfightProcessorLivid extends GeneralBossfightProcessor { @Override public List<HealthData> getHealths() { ArrayList<HealthData> healthData = new ArrayList<HealthData>(); - return super.getHealths(); + return healthData; } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/GeneralBossfightProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/GeneralBossfightProcessor.java index 2b1ce71c..f7fa009b 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/GeneralBossfightProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/GeneralBossfightProcessor.java @@ -10,15 +10,12 @@ import net.minecraftforge.event.entity.living.LivingEvent; import java.util.*; -public class GeneralBossfightProcessor implements BossfightProcessor { +public abstract class GeneralBossfightProcessor implements BossfightProcessor { private Map<String, PhaseData> phases = new HashMap<String, PhaseData>(); private PhaseData currentPhase = null; @Getter @Setter - private int bossMaxHealth = 100; - @Getter - @Setter private String name; private World world; @@ -44,13 +41,6 @@ public class GeneralBossfightProcessor implements BossfightProcessor { return phases; } - @Override - public List<HealthData> getHealths() { - ArrayList<HealthData> arr = new ArrayList<HealthData>(); - arr.add(new HealthData(name, (int) (bossMaxHealth * BossStatus.healthScale), bossMaxHealth)); - return arr; - } - @Override public String getCurrentPhase() { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/HealthData.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/HealthData.java index 66a727dd..9a9ed82b 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/HealthData.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/HealthData.java @@ -11,4 +11,5 @@ public class HealthData { private String name; private int health; private int maxHealth; + private boolean attackable; } |