Ejemplo n.º 1
0
    /// <summary>
    /// Skill Name: Dragon Stance
    /// Effect: Boost attacks significantly in a short time. when select a char to boost, if select mathial itself
    /// heal itself, if select other, boost him.
    /// If not select anychar in adjust time, cast skill on a random char
    /// *Note:
    /// </summary>
    /// <param name="isCastWhenAdjustTime"></param>
    private void SkillCasting_DragonStance(bool isCastWhenAdjustTime)
    {
        if (mouseIsDown)
        {
            return;
        }
        if (!isCastWhenAdjustTime)
        {
            GetComponent <Health>().AddHealth(shotPower);
        }
        RaycastHit2D hit = Physics2D.Raycast(Camera.main.ScreenToWorldPoint(Input.mousePosition), Vector2.zero);

        if (Input.GetMouseButtonDown(0))
        {
            bool isCharacter = (hit.collider.GetComponent <Prisoner>() != null);
            if (hit.collider != null && isCharacter)
            {
                ShootingSkill skill = hit.transform.gameObject.GetComponent <ShootingSkill>();
                if (skill.GetComponent <Prisoner>() == this.GetComponent <Prisoner>())
                {
                    GetComponent <Health>().AddHealth(shotPower);
                }
                else
                {
                    skill.bIsBoosted = true;
                }
                needleAdjustTime          = 0f;
                bIsSkillUsedThisCharge    = true;
                bIsSkillCastEffectShowing = false;
            }
        }
    }
Ejemplo n.º 2
0
 //---------------------------------------------------------------
 private void FindNotYetSkillUsersToDelaySkill()
 {
     Prisoner[] prisonerArray = this.GetComponent <Prisoner>().GetPrisonerArray();
     foreach (Prisoner thisPrisoner in prisonerArray)
     {
         //if the prisoner just shooting is not this prisoner
         if (prisonerJustUsedSkill.name != thisPrisoner.name)
         {
             //if not this prisoner, increase the waiting time to shot
             ShootingSkill skill = thisPrisoner.GetComponent <ShootingSkill>();
             skill.DelayAfterOtherPrisonerShot();
         }
     }
 }