コード例 #1
0
    //Grounded is used to make the player stop controlling and no gravity
    //while the thing runs
    public bool UseSkill(int skillID)
    {
        PlayerSkill skill = playerSkills[skillID];

        if (skill.IsReady())
        {
            skill.Do(this);

            skillsRunning++;

            if (skill.PreventsMovement)
            {
                playerControl.AddSkillPreventingMovement();
            }
            if (skill.PreventsDamage)
            {
                playerControl.AddSkillMakingImune();
            }
            if (skill.MovesPlayer)
            {
                playerControl.AddSkillOverridingMovement();
            }
            if (skill.PreventsUsingSkills)
            {
                playerControl.AddSkillPreventingSkillUsement();
            }

            return(true);
        }

        return(false);;
    }