diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..d994099 Binary files /dev/null and b/.DS_Store differ diff --git a/Effekte Challenge V2/src/main/java/com/xonics/classes/Effekt.java b/Effekte Challenge V2/src/main/java/com/xonics/classes/Effekt.java new file mode 100644 index 0000000..fe6ffe3 --- /dev/null +++ b/Effekte Challenge V2/src/main/java/com/xonics/classes/Effekt.java @@ -0,0 +1,28 @@ +package com.xonics.classes; + +import org.bukkit.potion.PotionEffectType; + +public class Effekt { + + private PotionEffectType ieffect; + private EffektTyp ieTyp; + + public Effekt(PotionEffectType effect, EffektTyp eTyp) { + this.ieffect = effect; + this.ieTyp = eTyp; + } + + public PotionEffectType getEffect() { + return this.ieffect; + } + + public EffektTyp getEffektTyp() { + return this.ieTyp; + } +} + +enum EffektTyp { + GOOD, + BAD, + NEUTRAL +} diff --git a/Effekte Challenge V2/src/main/java/com/xonics/classes/EffektLibrary.java b/Effekte Challenge V2/src/main/java/com/xonics/classes/EffektLibrary.java new file mode 100644 index 0000000..8090ebe --- /dev/null +++ b/Effekte Challenge V2/src/main/java/com/xonics/classes/EffektLibrary.java @@ -0,0 +1,59 @@ +package com.xonics.classes; + +import java.util.List; +import org.bukkit.potion.PotionEffectType; + +public class EffektLibrary { + + private static List effects = List.of( + new Effekt(PotionEffectType.SPEED, EffektTyp.GOOD), + new Effekt(PotionEffectType.SLOWNESS, EffektTyp.BAD), + new Effekt(PotionEffectType.JUMP_BOOST, EffektTyp.GOOD), + new Effekt(PotionEffectType.OOZING, EffektTyp.NEUTRAL), + new Effekt(PotionEffectType.FIRE_RESISTANCE, EffektTyp.GOOD), + new Effekt(PotionEffectType.INSTANT_DAMAGE, EffektTyp.BAD), + new Effekt(PotionEffectType.INSTANT_HEALTH, EffektTyp.GOOD), + new Effekt(PotionEffectType.HUNGER, EffektTyp.BAD), + new Effekt(PotionEffectType.INVISIBILITY, EffektTyp.GOOD), + new Effekt(PotionEffectType.LEVITATION, EffektTyp.BAD), + new Effekt(PotionEffectType.NIGHT_VISION, EffektTyp.GOOD), + new Effekt(PotionEffectType.POISON, EffektTyp.BAD), + new Effekt(PotionEffectType.REGENERATION, EffektTyp.GOOD), + new Effekt(PotionEffectType.STRENGTH, EffektTyp.GOOD), + new Effekt(PotionEffectType.WEAKNESS, EffektTyp.BAD), + new Effekt(PotionEffectType.WITHER, EffektTyp.BAD), + new Effekt(PotionEffectType.INFESTED, EffektTyp.NEUTRAL), + new Effekt(PotionEffectType.HASTE, EffektTyp.GOOD), + new Effekt(PotionEffectType.MINING_FATIGUE, EffektTyp.BAD), + new Effekt(PotionEffectType.STRENGTH, EffektTyp.GOOD), + new Effekt(PotionEffectType.NAUSEA, EffektTyp.BAD), + new Effekt(PotionEffectType.RESISTANCE, EffektTyp.GOOD), + new Effekt(PotionEffectType.WATER_BREATHING, EffektTyp.GOOD), + new Effekt(PotionEffectType.INVISIBILITY, EffektTyp.NEUTRAL), + new Effekt(PotionEffectType.BLINDNESS, EffektTyp.BAD), + new Effekt(PotionEffectType.NIGHT_VISION, EffektTyp.NEUTRAL), + new Effekt(PotionEffectType.HUNGER, EffektTyp.BAD), + new Effekt(PotionEffectType.HEALTH_BOOST, EffektTyp.GOOD), + new Effekt(PotionEffectType.ABSORPTION, EffektTyp.GOOD), + new Effekt(PotionEffectType.SATURATION, EffektTyp.GOOD), + new Effekt(PotionEffectType.GLOWING, EffektTyp.NEUTRAL), + new Effekt(PotionEffectType.LUCK, EffektTyp.NEUTRAL), + new Effekt(PotionEffectType.UNLUCK, EffektTyp.NEUTRAL), + new Effekt(PotionEffectType.CONDUIT_POWER, EffektTyp.GOOD), + new Effekt(PotionEffectType.DOLPHINS_GRACE, EffektTyp.GOOD), + new Effekt(PotionEffectType.BAD_OMEN, EffektTyp.BAD), + new Effekt(PotionEffectType.HERO_OF_THE_VILLAGE, EffektTyp.GOOD)); + + public static List getEffects() { + return effects; + } + + public static Effekt getEffectByIndex(int index) { + return effects.get(index); + } + + public static int getEffectCount() { + return effects.size(); + } + +} \ No newline at end of file diff --git a/Effekte Challenge V2/src/main/java/com/xonics/classes/EffektRevolver.java b/Effekte Challenge V2/src/main/java/com/xonics/classes/EffektRevolver.java new file mode 100644 index 0000000..6fef47a --- /dev/null +++ b/Effekte Challenge V2/src/main/java/com/xonics/classes/EffektRevolver.java @@ -0,0 +1,48 @@ +package com.xonics.classes; + +import java.util.ArrayList; +import java.util.Collections; + +public class EffektRevolver { + + private int roundSlots; + private int roundsShot; + private boolean isEmpty; + private ArrayList chamber = new ArrayList(); + + public EffektRevolver(int roundSlots) { + this.roundSlots = roundSlots; + this.roundsShot = 0; + this.isEmpty = true; + } + + public void loadRevolver() { + if (this.isEmpty) { + + this.roundsShot = 0; + + ArrayList randomZahlen = new ArrayList<>(); + + for (int i = 0; i < EffektLibrary.getEffectCount(); i++) { + randomZahlen.add(i); + } + + Collections.shuffle(randomZahlen); + + for (int i = 0; i < roundSlots; i++) { + this.chamber.add(EffektLibrary.getEffectByIndex(randomZahlen.get(i))); + } + this.isEmpty = false; + } + + } + + public Effekt shoot() { + if (!this.isEmpty && this.roundsShot < this.roundSlots) { + int chamberNumber = this.roundsShot; + this.roundsShot++; + return this.chamber.get(chamberNumber); + } + return null; + } +} diff --git a/Effekte Challenge V2/target/classes/com/xonics/classes/Effekt.class b/Effekte Challenge V2/target/classes/com/xonics/classes/Effekt.class new file mode 100644 index 0000000..a1a1a9f Binary files /dev/null and b/Effekte Challenge V2/target/classes/com/xonics/classes/Effekt.class differ diff --git a/Effekte Challenge V2/target/classes/com/xonics/classes/EffektLibrary.class b/Effekte Challenge V2/target/classes/com/xonics/classes/EffektLibrary.class new file mode 100644 index 0000000..871e44c Binary files /dev/null and b/Effekte Challenge V2/target/classes/com/xonics/classes/EffektLibrary.class differ diff --git a/Effekte Challenge V2/target/classes/com/xonics/classes/EffektRevolver.class b/Effekte Challenge V2/target/classes/com/xonics/classes/EffektRevolver.class new file mode 100644 index 0000000..f0fdbf8 Binary files /dev/null and b/Effekte Challenge V2/target/classes/com/xonics/classes/EffektRevolver.class differ diff --git a/Effekte Challenge V2/target/classes/com/xonics/classes/EffektTyp.class b/Effekte Challenge V2/target/classes/com/xonics/classes/EffektTyp.class new file mode 100644 index 0000000..b830c7e Binary files /dev/null and b/Effekte Challenge V2/target/classes/com/xonics/classes/EffektTyp.class differ diff --git a/Effekte Challenge V2/target/classes/com/xonics/ef/listeners/PlayerListener.class b/Effekte Challenge V2/target/classes/com/xonics/ef/listeners/PlayerListener.class new file mode 100644 index 0000000..4ee0617 Binary files /dev/null and b/Effekte Challenge V2/target/classes/com/xonics/ef/listeners/PlayerListener.class differ diff --git a/Effekte Challenge V2/target/classes/com/xonics/ef/main.class b/Effekte Challenge V2/target/classes/com/xonics/ef/main.class new file mode 100644 index 0000000..0fc67b4 Binary files /dev/null and b/Effekte Challenge V2/target/classes/com/xonics/ef/main.class differ diff --git a/Effekte Challenge V2/target/classes/com/xonics/ef/managers/PluginManager.class b/Effekte Challenge V2/target/classes/com/xonics/ef/managers/PluginManager.class new file mode 100644 index 0000000..86f40a1 Binary files /dev/null and b/Effekte Challenge V2/target/classes/com/xonics/ef/managers/PluginManager.class differ diff --git a/Effekte Challenge V2/target/classes/com/xonics/ef/utils/Utils.class b/Effekte Challenge V2/target/classes/com/xonics/ef/utils/Utils.class new file mode 100644 index 0000000..86bc214 Binary files /dev/null and b/Effekte Challenge V2/target/classes/com/xonics/ef/utils/Utils.class differ