Esempio n. 1
0
    public OrcControl(ref IOrcMovementLogic control, ref IMove orcMove, ref Animator animator, ref IOrcAttackLogic orcAttackLogic,
                      ref IRotateObject rotator, ref IInvertoryLogic invertoryLogic)
    {
        this.control        = control;
        meleeLogic          = orcAttackLogic;
        this.invertoryLogic = invertoryLogic;

        this.orcRotator           = rotator;
        this.orcRotator.CanRotate = true;

        // Movement FSM
        IOrcMovementState walking      = new OrcWalkState(1.2f, true, ref orcMove, EOrcMovementStates.Walking, ref this.control, ref animator);
        IOrcMovementState driveUpState = new OrcDrivenUpState(5, 2, false, ref orcMove, EOrcMovementStates.DrivenUp, ref this.control);
        IOrcMovementState fallState    = new OrcFallState(2, Vector3.down, false, ref orcMove, EOrcMovementStates.Falling, ref this.control, ref animator);

        fSMmovement = new OrcFSMMovement(ref this.control);
        fSMmovement.AddState(walking);
        fSMmovement.AddState(driveUpState);
        fSMmovement.AddState(fallState);
        fSMmovement.SetDefaultState(walking);

        // Combat melee
        IOrcCombatState idleState   = new OrcMeleeIdle(true, ref orcAttackLogic, EOrcCombatState.Idle);
        IOrcCombatState attackState = new OrcAttackState(false, ref orcAttackLogic, EOrcCombatState.Attacking, ref invertoryLogic, ref animator);

        fSMmeleeCombat = new OrcFSMCombat(ref orcAttackLogic);
        fSMmeleeCombat.AddState(idleState);
        fSMmeleeCombat.AddState(attackState);
        fSMmeleeCombat.SetDefaultState(idleState);

        if (this.invertoryLogic.HasInputModel)
        {
            this.invertoryLogic.InputInfo.SelectedWeaponIndex = 0;
        }
    }
Esempio n. 2
0
 public AIOrcAttackLogic(Transform character, ref IAIAttackInput attackInput, float attackDistance, ref IOrcMovementLogic movementLogic)
 {
     this.attackInput    = attackInput;
     this.attackDistance = attackDistance;
     this.movementLogic  = movementLogic;
     this.character      = character;
 }
Esempio n. 3
0
 public OrcWalkState(float movementSpeed, bool concurrentCanRun, ref IMove orcMove, EOrcMovementStates currentStateID, ref IOrcMovementLogic control, ref Animator animator)
 {
     this.movementSpeed    = movementSpeed;
     this.concurrentCanRun = concurrentCanRun;
     this.orcMove          = orcMove;
     this.currentStateID   = currentStateID;
     this.control          = control;
     this.animator         = animator;
 }
Esempio n. 4
0
 public OrcDrivenUpState(float speedOfDrivenUp, float timeToWaitForWakeUp, bool concurrentCanRun,
                         ref IMove orcMove, EOrcMovementStates currentStateID, ref IOrcMovementLogic control)
 {
     this.speedofDrivenUp     = speedOfDrivenUp;
     this.timeToWaitForWakeUp = timeToWaitForWakeUp;
     this.concurrentCanRun    = concurrentCanRun;
     this.orcMove             = orcMove;
     this.currentStateID      = currentStateID;
     this.control             = control;
     this.elapsedTime         = 0;
 }
Esempio n. 5
0
 public OrcFallState(float lastMoveMultiplier, Vector3 fallVector, bool concurrentCanRun,
                     ref IMove orcMove, EOrcMovementStates currentStateID, ref IOrcMovementLogic control, ref Animator animator)
 {
     this.lastMoveMultiplier = lastMoveMultiplier;
     this.gravityVector      = fallVector;
     this.concurrentCanRun   = concurrentCanRun;
     this.orcMove            = orcMove;
     this.currentStateID     = currentStateID;
     this.control            = control;
     this.animator           = animator;
 }
Esempio n. 6
0
 public OrcFSMMovement(ref IOrcMovementLogic control)
 {
     this.control = control;
     this.states  = new List <IState <IOrcMovementLogic, EOrcMovementStates> >();
 }
Esempio n. 7
0
 public AIOrcInput(IOrcMovementLogic orcMovementInput, IOrcAttackLogic orcAttackInput, NavMeshAgent agent)
 {
     this.orcMovementInput = orcMovementInput;
     this.orcAttackInput   = orcAttackInput;
     this.agent            = agent;
 }