Exemple #1
0
 public virtual void Activate(int x, int y)
 {
     Debug.Log("Activate:" + Name);
     CharacterBhv.Instantiator.PopIcon(Helper.GetSpriteFromSpriteSheet("Sprites/IconsSkill_" + IconId), CharacterBhv.transform.position);
     CharacterBhv.StartCoroutine(Helper.ExecuteAfterDelay(PlayerPrefsHelper.GetSpeed(), () =>
     {
         CharacterBhv.LosePa(PaNeeded);
         return(true);
     }));
     _isDebuffed = false;
     if (CooldownType == CooldownType.Normal)
     {
         Cooldown       = CooldownMax + 1;
         EffectDuration = EffectDurationMax;
         if (Effect != SkillEffect.None)
         {
             CharacterBhv.GainSkillEffect(Effect);
         }
     }
     else if (CooldownType == CooldownType.OnceAFight)
     {
         Cooldown       = -1;
         EffectDuration = EffectDurationMax;
         if (Effect != SkillEffect.None)
         {
             CharacterBhv.GainSkillEffect(Effect);
         }
     }
     CharacterBhv.SkinContainer.OrientToTarget(CharacterBhv.X - x);
     GameObject.Find(Constants.GoSceneBhvName).GetComponent <FightSceneBhv>().ManagePlayerButtons();
 }