예제 #1
0
 public void doActionTwo()
 {
     if (combatController.isAction)
     {
         return;
     }
     if (up)
     {
         combatController.doGrappleLaunch();
     }
     else
     {
         TatsuAction action = actions.special1;
         if (prevAction == actions.special1 && !combatController.onCooldown)
         {
             print("special2");
             action = actions.special2;
         }
         else if (prevAction == actions.special2 && !combatController.onCooldown && aOne)
         {
             action = actions.jab;
         }
         prevAction = action;
         combatController.Action(action);
     }
 }
예제 #2
0
        void HandleKnockback(TatsuAction _action, GameObject _parent)
        {
            float   multiplierIndex = maxHP - hp;
            float   multiplier      = _action.ActionTypes._launchMultiplierCurve.Evaluate(multiplierIndex);
            Vector2 direction       = _parent.GetComponent <DemoScene>().faceDirection;
            Vector2 launchDirection = _action.ActionTypes.launchDirection;

            launchDirection = new Vector2(launchDirection.x * direction.x, launchDirection.y);

            GetComponent <Rigidbody2D>().velocity = Vector2.zero;
            GetComponent <Rigidbody2D>().velocity = launchDirection * knockbackMultiplier;
            _parent.GetComponent <CharacterController2D>().move(launchDirection);
        }
예제 #3
0
    public void doActionOne()
    {
        if (combatController.isAction)
        {
            return;
        }
        TatsuAction action = actions.jab;

        if (prevAction == actions.jab && !combatController.onCooldown)
        {
//			print("follow up1");
            action = actions.jab2;
        }
        else if (prevAction == actions.jab2 && !combatController.onCooldown)
        {
//			print("follow up2");
            action = actions.jab3;
        }
        prevAction = action;
        combatController.Action(action);
    }
        //Perform the given _action TatsuAction
        public void Action(TatsuAction _action)
        {
            //don't continue if other actions are currently taking place
            if (isAction || onCooldown)
            {
                return;
            }

            isAction = true;
            string myName = _action._name;
            string myTag  = _action._tag;

            GameObject hitBoxObject = (GameObject)Instantiate(_action.hitbox, transform);

            Destroy(hitBoxObject, _action.lifeTime);

            hitBoxObject.name = myTag;
            hitBoxObject.GetComponent <TatsuHitbox>().setTag(myTag, _action.ActionTypes);
            previousAction = _action;
            playerDemo.PlayAnimation(myName);
            actionCountdown = _action.followUpTimer;
            onCooldown      = true;
            _cooldown       = _action.coolDown;
        }