Esempio n. 1
0
    private IEnumerator TertiaryA()
    {
        PlaySound();
        if (neutral)
        {
            neutral = false;

            float startup  = .4f;
            float active   = .6f;
            float recovery = .1f;
            yield return(new WaitForSeconds(startup));

            //turn hitbox on.
            bigMelee.Activate();
            yield return(new WaitForSeconds(active));

            //hitbox off
            bigMelee.Deactivate();
            yield return(new WaitForSeconds(recovery));

            neutral = true;
            yield return(null);
        }
        else
        {
            yield return(null);
        }
    }
Esempio n. 2
0
        public void AdvanceTime()
        {
            IScheduleable scheduleable = SchedulingSystem.Get();

            if (scheduleable is Player)
            {
                IsPlayerTurn = true;
            }
            else if (scheduleable is Attack)
            {
                Attack attack = scheduleable as Attack;
                attack.Activate();
                AdvanceTime();
            }
            else if (scheduleable is Monster)
            {
                Monster monster = scheduleable as Monster;
                monster.Activate();
                SchedulingSystem.Add(monster);
                AdvanceTime();
            }
            else if (scheduleable is Update)
            {
                Update update = scheduleable as Update;
                update.Activate();
                SchedulingSystem.Add(update);
                AdvanceTime();
            }
        }
Esempio n. 3
0
    IEnumerator Swing()
    {
        anim.SetBool("Attack", true);
        attack.Activate();
        yield return(new WaitForSeconds(liveTime));

        anim.SetBool("Attack", false);
        attack.Deactivate();
    }
Esempio n. 4
0
 public void OnAttack(int id)
 {
     if (id >= 0 && id < attacks.Length)
     {
         currentAttack = attacks[id];
         currentAttack.Activate(wielder);
     }
     else
     {
         throw new System.ArgumentOutOfRangeException("id", "Attack with ID " + id.ToString() + " does not exist on weapon " + this.ToString());
     }
 }
Esempio n. 5
0
    public virtual void StartAttack(AttackDirection direction, AttackTrigger trigger)
    {
        // if we're attacking and can't cancel, then return
        if (isAttacking && !canCancel)
        {
            return;
        }

        // get the movement controller state
        AttackPositionState state;

        if (movementControl.isJumping || movementControl.isFalling)
        {
            state = AttackPositionState.Air;
        }
        else if (movementControl.isDashing)
        {
            state = AttackPositionState.Dash;
        }
        else
        {
            state = AttackPositionState.Neutral;
        }

        if (InputAttackData[state][direction][trigger].Count != 0)
        {
            if (isAttacking && InputAttackData[state][direction][trigger].ContainsKey(currentAttack.attackID))
            {
                // go to the combo action this combination is associated with
                currentAttack = InputAttackData[state][direction][trigger][currentAttack.attackID];
            }
            else if (InputAttackData[state][direction][trigger].ContainsKey(""))
            {
                // go to the non-combo action this combination is associated with
                currentAttack = InputAttackData[state][direction][trigger][""];
            }
            else
            {
                // there is no attack available for this attack, return
                return;
            }

            // start the attack
            isAttacking = true;
            canCancel   = false;
            currentAttack.Activate();
        }
    }
Esempio n. 6
0
 public bool AttackInput() => Attack.Activate(Attack.InputFunction(Key));