Exemple #1
0
    // private void Update()
    // {
    //     if (currentTime == thinkTime)
    //         Attack();

    //     currentTime -= Time.deltaTime;
    // }

    private void Attack()
    {
        Critter mine  = Referee.Instance.AttackerCritter;
        Critter enemy = Referee.Instance.DefenderCritter;

        Skill[] moves = mine.MoveSet;
        int     ind   = rand.Next(moves.Length);

        Skill skill = moves[ind];

        string msg;

        if (skill is AttackSkill)
        {
            float damage = mine.AttackDamage(skill as AttackSkill, enemy);
            Referee.Instance.CritterPlayer.TakeDamage(damage);

            msg = $"Used {skill.Name} \nDamage {damage}";
        }
        else
        {
            SupportSkill supportSkill = skill as SupportSkill;
            supportSkill.Use(mine);

            msg = $"Selected {skill.Name} \n{mine.LastUpgraded}";
        }

        EndAction(msg);
    }
Exemple #2
0
    private void Support(SupportSkill supportSkill)
    {
        supportSkill.Use(Referee.Instance.AttackerCritter);

        string msg = $"Selected {supportSkill.Name} \n{Referee.Instance.AttackerCritter.LastUpgraded}";

        EndAction(msg);
    }