|
@@ -62,94 +62,96 @@ public enum Effect
|
|
|
NO_ARMOR_DROPPING ,
|
|
|
|
|
|
// active effects
|
|
|
- POISON_VOLLEY (PoisonVolley.class),
|
|
|
- FIRE (Fire.class),
|
|
|
- SHADOW_STEP (ShadowStep.class),
|
|
|
- BLINDING_SHOT (BlindingShot.class),
|
|
|
- KICK (Kick.class),
|
|
|
- CRIPPLE (Cripple.class),
|
|
|
- ELEVATION (Elevation.class),
|
|
|
- SUN (Sun.class),
|
|
|
- IMMORTALITY (Immortality.class),
|
|
|
- LUCKY (Lucky.class),
|
|
|
- POISONED_BLADE (PoisonedBlade.class),
|
|
|
- BUNNY_HOP (BunnyHop.class),
|
|
|
- CONSTANT_POWER (ConstantPower.class),
|
|
|
- ARMOR_PASSER (ArmorPasser.class),
|
|
|
- IMPACT_PUNCH (ImpactPunch.class),
|
|
|
- ENDERCHEST (Enderchest.class),
|
|
|
- NAIL_DOWN (NailDown.class),
|
|
|
- DOOMED (Doomed.class),
|
|
|
- PUSH (Push.class),
|
|
|
- PUSH_UP (PushUp.class),
|
|
|
- HUNGER_PUNCH (HungerPunch.class),
|
|
|
- FIRE_SHOT (FireShot.class),
|
|
|
- PULL (Pull.class),
|
|
|
- HEAL_RAIN (HealRain.class),
|
|
|
- UNLUCKY (Unlucky.class),
|
|
|
- NAIL_TRAP (NailTrap.class),
|
|
|
- NIGHT (Night.class),
|
|
|
- AREA_DAMAGE (AreaDamage.class),
|
|
|
- EARTHQUAKE (Earthquake.class),
|
|
|
- FIREBALL (Fireball.class),
|
|
|
- JUMP (Jump.class),
|
|
|
- THOR (Thor.class),
|
|
|
- GRAPPLING_HOOK (GrapplingHook.class),
|
|
|
- QUICK_SHOT (QuickShot.class),
|
|
|
- CALL_BACK (CallBack.class),
|
|
|
- SHADOW_HIT (ShadowHit.class),
|
|
|
- LOCK_PICK (LockPick.class),
|
|
|
- HEART_SEEKER (HeartSeeker.class),
|
|
|
- TELEPORT_PLAYER (TeleportPlayer.class),
|
|
|
- SPRINT (Sprint.class),
|
|
|
- LIFE_BREAKER (LifeBreaker.class),
|
|
|
- POWER (Power.class),
|
|
|
- MUSKET (Musket.class),
|
|
|
- HEARTS (Hearts.class),
|
|
|
- ROOTING (Rooting.class),
|
|
|
- WORKBENCH (Workbench.class),
|
|
|
- NET_TRAP (NetTrap.class),
|
|
|
- LEAF_COCOON (LeafCocoon.class),
|
|
|
- POISON (Poison.class),
|
|
|
- SMASH (Smash.class),
|
|
|
- LIFE_STEAL (LifeSteal.class),
|
|
|
- SHADOW (Shadow.class),
|
|
|
- SLOWING_SHOT (SlowingShot.class),
|
|
|
- VINE_TRAP (VineTrap.class),
|
|
|
- RAPID_FIRE (RapidFire.class),
|
|
|
- STONE (Stone.class),
|
|
|
- FIRE_PROTECTION_RAIN (FireProtectionRain.class),
|
|
|
- BONE_BREAKER (BoneBreaker.class),
|
|
|
- ARCANE_SHOT (ArcaneShot.class),
|
|
|
- RAIN (Rain.class),
|
|
|
- INVISIBILITY (Invisibility.class),
|
|
|
- DAY (Day.class),
|
|
|
- FLYING (Flying.class),
|
|
|
- EXPLOSION (Explosion.class),
|
|
|
- SMOKE_BOMB (SmokeBomb.class),
|
|
|
- HARVEST (Harvest.class),
|
|
|
- FREEZE (Freeze.class),
|
|
|
- FALL_IMMUNITY (FallImmunity.class),
|
|
|
- ELVISH_HORN (ElvishHorn.class),
|
|
|
- GRAVITY (Gravity.class),
|
|
|
- TELEPORT_BLOCK (TeleportBlock.class),
|
|
|
- CLUSTER_BOMB (ClusterBomb.class),
|
|
|
- HARM (Harm.class),
|
|
|
- SILENCE (Silence.class),
|
|
|
- POWER_ATTACK (PowerAttack.class),
|
|
|
- HEAL (Heal.class),
|
|
|
- JUMP_ATTACK (JumpAttack.class),
|
|
|
- BLOCK_EXPLOSION (BlockExplosion.class);
|
|
|
+ POISON_VOLLEY (new PoisonVolley()),
|
|
|
+ FIRE (new Fire()),
|
|
|
+ SHADOW_STEP (new ShadowStep()),
|
|
|
+ BLINDING_SHOT (new BlindingShot()),
|
|
|
+ KICK (new Kick()),
|
|
|
+ CRIPPLE (new Cripple()),
|
|
|
+ ELEVATION (new Elevation()),
|
|
|
+ SUN (new Sun()),
|
|
|
+ IMMORTALITY (new Immortality()),
|
|
|
+ LUCKY (new Lucky()),
|
|
|
+ POISONED_BLADE (new PoisonedBlade()),
|
|
|
+ BUNNY_HOP (new BunnyHop()),
|
|
|
+ CONSTANT_POWER (new ConstantPower()),
|
|
|
+ ARMOR_PASSER (new ArmorPasser()),
|
|
|
+ IMPACT_PUNCH (new ImpactPunch()),
|
|
|
+ ENDERCHEST (new Enderchest()),
|
|
|
+ NAIL_DOWN (new NailDown()),
|
|
|
+ DOOMED (new Doomed()),
|
|
|
+ PUSH (new Push()),
|
|
|
+ HUNGER_PUNCH (new HungerPunch()),
|
|
|
+ FIRE_SHOT (new FireShot()),
|
|
|
+ PULL (new Pull()),
|
|
|
+ HEAL_RAIN (new HealRain()),
|
|
|
+ UNLUCKY (new Unlucky()),
|
|
|
+ NAIL_TRAP (new NailTrap()),
|
|
|
+ NIGHT (new Night()),
|
|
|
+ AREA_DAMAGE (new AreaDamage()),
|
|
|
+ EARTHQUAKE (new Earthquake()),
|
|
|
+ FIREBALL (new Fireball()),
|
|
|
+ JUMP (new Jump()),
|
|
|
+ PUSH_UP (new PushUp()),
|
|
|
+ THOR (new Thor()),
|
|
|
+ GRAPPLING_HOOK (new GrapplingHook()),
|
|
|
+ QUICK_SHOT (new QuickShot()),
|
|
|
+ CALL_BACK (new CallBack()),
|
|
|
+ SHADOW_HIT (new ShadowHit()),
|
|
|
+ LOCK_PICK (new LockPick()),
|
|
|
+ HEART_SEEKER (new HeartSeeker()),
|
|
|
+ TELEPORT_PLAYER (new TeleportPlayer()),
|
|
|
+ SPRINT (new Sprint()),
|
|
|
+ LIFE_BREAKER (new LifeBreaker()),
|
|
|
+ POWER (new Power()),
|
|
|
+ MUSKET (new Musket()),
|
|
|
+ HEARTS (new Hearts()),
|
|
|
+ ROOTING (new Rooting()),
|
|
|
+ WORKBENCH (new Workbench()),
|
|
|
+ NET_TRAP (new NetTrap()),
|
|
|
+ LEAF_COCOON (new LeafCocoon()),
|
|
|
+ POISON (new Poison()),
|
|
|
+ SMASH (new Smash()),
|
|
|
+ LIFE_STEAL (new LifeSteal()),
|
|
|
+ SHADOW (new Shadow()),
|
|
|
+ SLOWING_SHOT (new SlowingShot()),
|
|
|
+ VINE_TRAP (new VineTrap()),
|
|
|
+ RAPID_FIRE (new RapidFire()),
|
|
|
+ STONE (new Stone()),
|
|
|
+ FIRE_PROTECTION_RAIN (new FireProtectionRain()),
|
|
|
+ BONE_BREAKER (new BoneBreaker()),
|
|
|
+ ARCANE_SHOT (new ArcaneShot()),
|
|
|
+ RAIN (new Rain()),
|
|
|
+ INVISIBILITY (new Invisibility()),
|
|
|
+ DAY (new Day()),
|
|
|
+ FLYING (new Flying()),
|
|
|
+ EXPLOSION (new Explosion()),
|
|
|
+ SMOKE_BOMB (new SmokeBomb()),
|
|
|
+ HARVEST (new Harvest()),
|
|
|
+ FREEZE (new Freeze()),
|
|
|
+ FALL_IMMUNITY (new FallImmunity()),
|
|
|
+ BLOCK_EXPLOSION (new BlockExplosion()),
|
|
|
+ ELVISH_HORN (new ElvishHorn()),
|
|
|
+ GRAVITY (new Gravity()),
|
|
|
+ TELEPORT_BLOCK (new TeleportBlock()),
|
|
|
+ CLUSTER_BOMB (new ClusterBomb()),
|
|
|
+ HARM (new Harm()),
|
|
|
+ SILENCE (new Silence()),
|
|
|
+ POWER_ATTACK (new PowerAttack()),
|
|
|
+ HEAL (new Heal()),
|
|
|
+ JUMP_ATTACK (new JumpAttack());
|
|
|
+
|
|
|
+ private static Effect[] effects = Effect.values();
|
|
|
|
|
|
private final ArrayList<Skill> skills;
|
|
|
- private final Class<? extends ActiveEffectBase> c;
|
|
|
+ private final ActiveEffectBase aeb;
|
|
|
private final boolean active;
|
|
|
|
|
|
- Effect(Class<? extends ActiveEffectBase> c)
|
|
|
+ Effect(ActiveEffectBase aeb)
|
|
|
{
|
|
|
skills = new ArrayList<>();
|
|
|
- this.active = c != null;
|
|
|
- this.c = c;
|
|
|
+ this.active = aeb != null;
|
|
|
+ this.aeb = aeb;
|
|
|
}
|
|
|
|
|
|
Effect()
|
|
@@ -177,33 +179,17 @@ public enum Effect
|
|
|
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()
|
|
|
+ public ActiveEffectBase getEffectInstance()
|
|
|
{
|
|
|
- return c;
|
|
|
+ return aeb;
|
|
|
}
|
|
|
|
|
|
- public String getEffectString()
|
|
|
+ public static Effect getEffect(int id)
|
|
|
{
|
|
|
- if(c == null)
|
|
|
+ if(id < 0 || id >= effects.length)
|
|
|
{
|
|
|
return null;
|
|
|
}
|
|
|
- return c.getSimpleName();
|
|
|
+ return effects[id];
|
|
|
}
|
|
|
}
|