private void ChangeState(eCampaignCharacterState newState, bool ignoreDeath = false) { eCampaignCharacterState previousState = _state; _state = newState; if (_currentHandler != null && !_currentHandler.IsFinished) { _currentHandler.End(newState); CodeObjectManager.GetCharacterStateManager(_currentHandler.GetType()).Destroy(_currentHandler); } System.Type handlerType = _stateHandlers[State]; _currentHandler = (CharacterStateHandler)CodeObjectManager.GetCharacterStateManager(handlerType).GetNext(); _currentHandler.Controller = _controller; _currentHandler.MoveController = _moveController; //_currentHandler.Stats = _statsComponent; _currentHandler.Locomotion = LocomotionComponent; _currentHandler.Combat = _combatController; _currentHandler.ViewRPC = _viewRPC; //_currentHandler.EffectReceiver = _effectReceiver; _currentHandler.Conditions = _conditionComponent; _currentHandler.Targeting = _targetingComponent; _currentHandler.Character = this; _currentHandler.Begin(previousState); _moveController.SetPlaybackSpeed(1.0f); }
public override void Begin(eCampaignCharacterState previousState) { base.Begin(previousState); GameObject target = Targeting.AttackTarget; if (target != null) { CharacterComponent targetCharacter = target.GetComponent <CharacterComponent>(); if (targetCharacter != null && targetCharacter.Model != null && targetCharacter.Model.team == eTeamId.Interactable) { return; } } if (!IsPlayingAttack || previousState != eCampaignCharacterState.AttackTarget) { Combat.ResetAttackSequence(); RefreshComboAttack(); _hasStartedFirstAttack = false; if (!Combat.CanMoveAndAttack) { _canInterruptMove = false; } } Locomotion.ShouldIgnoreRotation = true; SetDesiredAnimationState(global::MoveController.CombatantMoveState.kAttackTarget); }
public virtual void Begin(eCampaignCharacterState previousState) { if (Character != null) { _previousMaxSpeed = Character.Model.speed; } IsPlayer = (Controller is PlayerController); }
public override void End(eCampaignCharacterState newState) { base.End(newState); string audioName = Character.Model.audioName; if (!string.IsNullOrEmpty(audioName)) { FusionAudio.PostCharacterAnimation(audioName, "Run", false); } }
public override void Begin(eCampaignCharacterState previousState) { base.Begin(previousState); SetDesiredAnimationState(global::MoveController.CombatantMoveState.kLocomotion); string audioName = Character.Model.audioName; if (!string.IsNullOrEmpty(audioName)) { FusionAudio.PostCharacterAnimation(audioName, "Run", true); } }
public override void End(eCampaignCharacterState newState) { if (Character == null || Character.Model == null) { return; } string audioName = Character.Model.audioName; if (!string.IsNullOrEmpty(audioName)) { FusionAudio.PostCharacterAnimation(audioName, "Idle", false); } }
public override void Begin(eCampaignCharacterState previousState) { SetDesiredAnimationState(global::MoveController.CombatantMoveState.kIdle); if (Character == null || Character.Model == null) { return; } string audioName = Character.Model.audioName; if (!string.IsNullOrEmpty(audioName)) { FusionAudio.PostCharacterAnimation(audioName, "Idle", true); } }
public override void Begin(eCampaignCharacterState previousState) { base.Begin(previousState); SetDesiredAnimationState(global::MoveController.CombatantMoveState.kLocomotion); if (Targeting == null) { return; } GameObject target = Targeting.AttackTarget; if (target == null) { SetState(eCampaignCharacterState.Idle); return; } //BaseStatsComponent targetStats = target.GetComponent<BaseStatsComponent>(); bool is_interactable = false; CharacterComponent targetCharacter = target.GetComponent <CharacterComponent>(); is_interactable = targetCharacter != null && targetCharacter.Model.team == eTeamId.Interactable; bool is_area = target.GetComponent <LTCameraTrigger>() != null; if (is_interactable || is_area) { Locomotion.Destination = target.transform.position; // Hotfix_LT.Messenger.Raise(Hotfix_LT.EventName.PlayerMoveSyncManagerMove, Locomotion.Destination); //GlobalUtils.CallStaticHotfix("Hotfix_LT.MessengerAdapter", "PlayerMoveSyncManagerMove", Locomotion.Destination); } else { IInteractable interactableStats = (IInteractable)target.GetComponent(typeof(IInteractable)); if (interactableStats != null && interactableStats.Interactable != null) { Locomotion.Destination = interactableStats.Interactable.GetClosestInteractionPoint(Character.transform.position); } } if (Controller != null) { m_ChaseStartLocation = Controller.transform.position; } }
public override void End(eCampaignCharacterState newState) { base.End(newState); if (newState != eCampaignCharacterState.AttackTarget) { Locomotion.ShouldIgnoreRotation = false; Locomotion.MaxSpeed = Character.Model.speed; Combat.CancelAttack(); if (Combat.CanMoveAndAttack) { //AnimController.SetFloat(eCharacterAnimationParameter.Attacking, 0.0f); } MoveController.SetPlaybackSpeed(1.0f); } }
public override void End(eCampaignCharacterState newState) { base.End(newState); }
public override void Begin(eCampaignCharacterState previousState) { SetDesiredAnimationState(global::MoveController.CombatantMoveState.kIdle); }
protected void SetState(eCampaignCharacterState state) { Character.State = state; }
public CharacterStateHandlerAttribute(eCampaignCharacterState stateToHandle) { handledState = stateToHandle; }
public virtual void End(eCampaignCharacterState newState) { IsFinished = true; }