protected override void Initialize(AgentAction action)
    {
        base.Initialize(action);

        MoveOk = true;

        Action = action as AgentActionAttackWhirl;

        CrossFade(Action.Data.AnimName, 0.2f);

        UpdateFinalRotation();

        Owner.BlackBoard.MotionType = E_MotionType.Walk;

        RotationProgress = 0;

        TimeToEndState = AnimEngine[Action.Data.AnimName].length * 0.9f + Time.timeSinceLevelLoad;
        NoHitTimer     = Time.timeSinceLevelLoad + 0.75f;

        Owner.PlayLoopSound(Owner.BerserkSound, 1, AnimEngine[Action.Data.AnimName].length - 1, 0.5f, 0.9f);

        TimeToStartEffect = Time.timeSinceLevelLoad + 1;
        TimeToEndEffect   = Time.timeSinceLevelLoad + AnimEngine[Action.Data.AnimName].length - 1;

        MaxSpeed = 2;
    }
    protected override AgentAction MakeAgentAction()
    {
        AgentActionAttackWhirl agentAction = AgentActionFactory.Get(AgentActionType.ATTACK_WHIRL, Owner) as AgentActionAttackWhirl;

        agentAction.data = Owner.AnimSet.GetWhirlAttackAnim();
        return(agentAction);
    }
Exemple #3
0
    void DoAttackAction()
    {
        Action = null;

        Action      = AgentActionFactory.Create(AgentActionFactory.E_Type.E_ATTACK_WHIRL) as AgentActionAttackWhirl;
        Action.Data = Owner.AnimSet.GetWhirlAttackAnim();
        Owner.BlackBoard.AddAction(Action);
    }
    override public void OnDeactivate()
    {
        if (Action != null)
        {
            Action.SetSuccess();
            Action = null;
        }

        Owner.BlackBoard.Speed = 0;
        if (Effect != null)
        {
            CombatEffectsManager.Instance.ReturnWhirlEffect(Effect);
        }

        Effect = null;

        base.OnDeactivate();

        // Time.timeScale = 1;
    }
Exemple #5
0
    protected override void Initialize(AgentAction action)
    {
        base.Initialize(action);
        _agentAction = Owner.BlackBoard.curAction as AgentActionAttackWhirl;

        _moveOk = true;
        CrossFade(_agentAction.data.animName, 0.2f);
        UpdateFinalRotation();
        Owner.BlackBoard.motionType = MotionType.WALK;
        _rotationProgress           = 0;
        _timeToEndState             = Owner.AnimEngine[_agentAction.data.animName].length * 0.9f + Time.timeSinceLevelLoad;
        _hitTimer = Time.timeSinceLevelLoad + 0.75f;

        // Owner.PlayLoopSound(Owner.BerserkSound, 1, AnimEngine[Action.Data.AnimName].length - 1, 0.5f, 0.9f);

        TimeToStartEffect = Time.timeSinceLevelLoad + 1;
        TimeToEndEffect   = Time.timeSinceLevelLoad + Owner.AnimEngine[_agentAction.data.animName].length - 1;

        _maxSpeed = 2;
    }
Exemple #6
0
    static public AgentAction Create(E_Type type)
    {
        int index = (int)type;

        AgentAction a;

        if (m_UnusedActions[index].Count > 0)
        {
            a = m_UnusedActions[index].Dequeue();
        }
        else
        {
            switch (type)
            {
            case E_Type.E_IDLE:
                a = new AgentActionIdle();
                break;

            case E_Type.E_MOVE:
                a = new AgentActionMove();
                break;

            case E_Type.E_GOTO:
                a = new AgentActionGoTo();
                break;

            case E_Type.E_COMBAT_MOVE:
                a = new AgentActioCombatMove();
                break;

            case E_Type.E_ATTACK:
                a = new AgentActionAttack();
                break;

            case E_Type.E_ATTACK_ROLL:
                a = new AgentActionAttackRoll();
                break;

            case E_Type.E_ATTACK_WHIRL:
                a = new AgentActionAttackWhirl();
                break;

            case E_Type.E_INJURY:
                a = new AgentActionInjury();
                break;

            case E_Type.E_DAMAGE_BLOCKED:
                a = new AgentActionDamageBlocked();
                break;

            case E_Type.E_BLOCK:
                a = new AgentActionBlock();
                break;

            case E_Type.E_ROLL:
                a = new AgentActionRoll();
                break;

            case E_Type.E_INCOMMING_ATTACK:
                a = new AgentActionIncommingAttack();
                break;

            case E_Type.E_WEAPON_SHOW:
                a = new AgentActionWeaponShow();
                break;

            case E_Type.Rotate:
                a = new AgentActionRotate();
                break;

            case E_Type.E_USE_LEVER:
                a = new AgentActionUseLever();
                break;

            case E_Type.E_PLAY_ANIM:
                a = new AgentActionPlayAnim();
                break;

            case E_Type.E_PLAY_IDLE_ANIM:
                a = new AgentActionPlayIdleAnim();
                break;

            case E_Type.E_DEATH:
                a = new AgentActionDeath();
                break;

            case E_Type.E_KNOCKDOWN:
                a = new AgentActionKnockdown();
                break;

            case E_Type.Teleport:
                a = new AgentActionTeleport();
                break;

            default:
                Debug.LogError("no AgentAction to create");
                return(null);
            }
        }
        a.Reset();
        a.SetActive();

        // DEBUG !!!!!!
        m_ActionsInAction.Add(a);
        return(a);
    }