void SendAction() { Action = AgentActionFactory.Create(AgentActionFactory.E_Type.E_ATTACK_ROLL) as AgentActionAttackRoll; Action.Data = Owner.AnimSet.GetRollAttackAnim(); Action.Target = Owner.BlackBoard.DesiredTarget; // Debug.Log("action attack " + (Action.AttackTarget != null ? Action.AttackTarget.name : "no target")); Owner.BlackBoard.ActionAdd(Action); }
override public void OnDeactivate() { // Time.timeScale = 1; Action.SetSuccess(); Action = null; if (Effect != null) { CombatEffectsManager.Instance.ReturnRolllEffect(Effect); } Effect = null; base.OnDeactivate(); }
override protected void Initialize(AgentAction action) { Action = action as AgentActionAttackRoll; State = E_State.Prepare; CrossFade("attackRollStart", 0.4f); base.Initialize(action); Owner.BlackBoard.MotionType = E_MotionType.None; EndOfStateTime = AnimEngine["attackRollStart"].length * 0.95f + Time.timeSinceLevelLoad; NoHitTimer = 0; UpdateFinalRotation(); Owner.Sound.PlayRoll(); }
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); }