123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193 |
- package me.km.effects;
- import java.util.ArrayList;
- import me.km.effects.active.*;
- import me.km.skills.Skill;
- public enum Effect
- {
- // comments indicate, that events aren't in active oder passive effect packages
- // passive effects
- ENCHANTER , // me.kt.custom.CustomEnchanting
- LESS_HUNGER , // me.kt.environment.EnvironmentTick
- LESS_THIRST , // me.kt.environment.EnvironmentAPI
- LESS_ENERGY_USE , // me.kt.environment.EnvironmentAPI
- LESS_COLD , // me.kt.environment.EnvironmentAPI
- FASTER_MANA , // me.kt.environment.EnvironmentAPI
- BREED_COW ,
- BREED_PIG ,
- BREED_SHEEP ,
- BREED_RABBIT ,
- BREED_CHICKEN ,
- BREED_HORSE ,
- BREED_MUSHROOMCOW ,
- GRAVEL_SAND_DIGGER ,
- MORE_MINERALS ,
- MORE_CROPS ,
- TREE_PICKER ,
- MORE_SAPLINGS ,
- CAKE_POWER ,
- SNEAKING ,
- SCENT ,
- MUGGING ,
- FAST_DIGGING ,
- XP_COLLECTOR ,
- MORE_DROPS ,
- FASTER_ARROWS ,
- ARROW_SAVER ,
- MORE_AXE_DAMAGE ,
- MORE_HOE_DAMAGE ,
- MORE_PICKAXE_DAMAGE ,
- MORE_SHOVEL_DAMAGE ,
- MORE_SWORD_DAMAGE ,
- MORE_DAGGER_DAMAGE ,
- MORE_HAMMER_DAMAGE ,
- MORE_STICK_DAMAGE ,
- FISHING ,
- POTION_SAVER ,
- BREWING ,
- CAULDRON_FILLING ,
- SMELTING ,
- NO_POISON ,
- LESS_FALL_DAMAGE ,
- LESS_DAMAGE ,
- SMITH ,
- FAST_ENDERPEARL_SHOOT ,
- PEARL_SAVER ,
- NO_ENDERPEARL_DAMAGE ,
- GOLD_WASHER ,
- GOLD_RUSH ,
- USE_WAND ,
- LESS_ITEM_LOSS ,
- NO_ARMOR_DROPPING ,
-
- // active effects
- ARCANE_SHOT (ArcaneShot.class),
- BLINDING_SHOT (BlindingShot.class),
- BUNNY_HOP (BunnyHop.class),
- CALL_BACK (CallBack.class),
- CLUSTER_BOMB (ClusterBomb.class),
- DAY (Day.class),
- DOOMED (Doomed.class),
- EARTHQUAKE (Earthquake.class),
- ELEVATION (Elevation.class),
- ELVISH_HORN (ElvishHorn.class),
- ENDERCHEST (Enderchest.class),
- EXPLOSION (Explosion.class),
- FALL_IMMUNITY (FallImmunity.class),
- FIRE (Fire.class),
- FIREBALL (Fireball.class),
- FIRE_SHOT (FireShot.class),
- FLYING (Flying.class),
- FREEZE (Freeze.class),
- GRAPPLING_HOOK (GrapplingHook.class),
- HARM (Harm.class),
- HARVEST (Harvest.class),
- HEAL (Heal.class),
- HEAL_RAIN (HealRain.class),
- HEARTS (Hearts.class),
- HEART_SEEKER (HeartSeeker.class),
- IMMORTALITY (Immortality.class),
- INVISIBILITY (Invisibility.class),
- JUMP (Jump.class),
- KICK (Kick.class),
- LEAF_COCOON (LeafCocoon.class),
- LOCK_PICK (LockPick.class),
- LUCKY (Lucky.class),
- MUSKET (Musket.class),
- NAIL_DOWN (NailDown.class),
- NAIL_TRAP (NailTrap.class),
- NET_TRAP (NetTrap.class),
- NIGHT (Night.class),
- POISON (Poison.class),
- POISONED_BLADE (PoisonedBlade.class),
- POISON_VOLLEY (PoisonVolley.class),
- POWER (Power.class),
- POWER_ATTACK (PowerAttack.class),
- PULL (Pull.class),
- PUSH (Push.class),
- QUICK_SHOT (QuickShot.class),
- RAIN (Rain.class),
- RAPID_FIRE (RapidFire.class),
- ROOTING (Rooting.class),
- SHADOW (Shadow.class),
- SHADOW_HIT (ShadowHit.class),
- SHADOW_STEP (ShadowStep.class),
- SILENCE (Silence.class),
- SLOWING_SHOT (SlowingShot.class),
- SMOKE_BOMB (SmokeBomb.class),
- SPRINT (Sprint.class),
- STONE (Stone.class),
- SUN (Sun.class),
- TELEPORT_PLAYER (TeleportPlayer.class),
- THOR (Thor.class),
- UNLUCKY (Unlucky.class),
- VINE_TRAP (VineTrap.class),
- WORKBENCH (Workbench.class);
-
- private final ArrayList<Skill> skills;
- private final Class<? extends ActiveEffectBase> c;
- private final boolean active;
-
- Effect(Class<? extends ActiveEffectBase> c)
- {
- skills = new ArrayList<>();
- this.active = c != null;
- this.c = c;
- }
-
- Effect()
- {
- this(null);
- }
-
- public void addSkill(Skill s)
- {
- skills.add(s);
- }
-
- public ArrayList<Skill> getSkills()
- {
- return skills;
- }
-
- public void clearSkills()
- {
- skills.clear();
- }
-
- public boolean isActive()
- {
- return active;
- }
-
- public int getManaCost(int power)
- {
- if(c != null)
- {
- try
- {
- return c.newInstance().getManaCost(power);
- }
- catch(InstantiationException | IllegalAccessException ex)
- {
- return 0;
- }
- }
- return 0;
- }
-
- public Class<? extends ActiveEffectBase> getEffectBase()
- {
- return c;
- }
-
- public String getEffectString()
- {
- if(c == null)
- {
- return null;
- }
- return c.getSimpleName();
- }
- }
|