@Override
 public void endEffect(Effect effect) {
   super.endEffect(effect);
   AttackCalcObserver observer = effect.getAttackStatusObserver(position);
   if (observer != null)
     effect.getEffected().getObserveController().removeAttackCalcObserver(observer);
 }
  @Override
  public void startEffect(final Effect effect) {
    super.startEffect(effect);

    AttackStatusObserver observer =
        new AttackStatusObserver(count, AttackStatus.CRITICAL) {

          private int myCount = 0;

          @Override
          public boolean checkAttackerStatus(AttackStatus status) {
            if (status == AttackStatus.CRITICAL) {
              if (myCount++ < count) {
                return true;
              } else effect.getEffected().getEffectController().removeEffect(effect.getSkillId());
            }
            return false;
          }
        };

    effect.getEffected().getObserveController().addAttackCalcObserver(observer);
    effect.setAttackStatusObserver(observer, position);
  }
Ejemplo n.º 3
0
 @Override
 public void calculate(Effect effect) {
   super.calculate(effect, StatEnum.STUMBLE_RESISTANCE, SpellStatus.STUMBLE);
 }
Ejemplo n.º 4
0
 public EffectHealCPPercent(Env env, EffectTemplate template) {
   super(env, template);
   _ignoreCpEff = template.getParam().getBool("ignoreCpEff", true);
 }
Ejemplo n.º 5
0
 @Override
 public void endEffect(Effect effect) {
   float healRate = effect.getEffected().getController().getHealRate();
   effect.getEffected().getController().setHealRate(healRate - percent / 100);
   super.endEffect(effect);
 }