protected override void DoInvestigating()
        {
            MovementDirection = NpcSensorSound.GetNewestSoundPosition() - Mover.transform.root.position;

            Mover.MoveTowardsDirection(MovementDirection);
            noEnemySightRoutine.UpdateSightRoutine(MovementDirection);
        }
 public CowboyBehavior(Mover mover, HandController handController, Health health,
                       NpcSensorSight npcSensorSight, NpcSensorSound npcSensorSound)
     : base(mover, handController, health, npcSensorSight, npcSensorSound)
 {
     HealthRetreatTolerance = 0;
     noEnemySightRoutine    = new LookAroundSightRoutine(Mover);
     DistanceSwitchFromAttackingToEngaging = 6f;
     DistanceSwitchFromEngagingToAttacking = 5f;
 }
 public OpStrategy(Mover mover, HandController handController, Health health,
                   NpcSensorSight npcSensorSight, NpcSensorSound npcSensorSound) : base(mover, handController,
                                                                                        health, npcSensorSight, npcSensorSound)
 {
     HealthRetreatTolerance    = 400;
     retreatingMovementRoutine = new RetreatWhileDodgingMovementRoutine(Mover);
     engagingMovementRoutine   = new AdvanceWhileDodgingMovementRoutine(Mover);
     noEnemySightRoutine       = new LookAroundSightRoutine(Mover);
 }
 public CamperBehavior(Mover mover, HandController handController, Health health,
                       NpcSensorSight npcSensorSight, NpcSensorSound npcSensorSound) : base(mover, handController,
                                                                                            health, npcSensorSight, npcSensorSound)
 {
     HealthRetreatTolerance    = 600;
     retreatingMovementRoutine = new RetreatWhileDodgingMovementRoutine(Mover);
     noEnemySightRoutine       = new LookAroundSightRoutine(Mover);
     isCamping = false;
 }
Beispiel #5
0
		public CarefulBehavior(Mover mover, HandController handController, Health health,
			NpcSensorSight npcSensorSight, NpcSensorSound npcSensorSound) : base(mover, handController,
			health, npcSensorSight, npcSensorSound)
		{
			noEnemySightRoutine = new LookAroundSightRoutine(Mover);

			HealthRetreatTolerance = 800;
			DistanceSwitchFromAttackingToEngaging = 20f;
			DistanceSwitchFromEngagingToAttacking = 19f;
		}
 protected BaseNpcBehavior(Mover mover, HandController handController
                           , Health health, NpcSensorSight npcSensorSight, NpcSensorSound npcSensorSound)
 {
     currentState      = State.Idle;
     Mover             = mover;
     HandController    = handController;
     Health            = health;
     NpcSensorSight    = npcSensorSight;
     MovementDirection = new Vector3();
     NpcSensorSound    = npcSensorSound;
 }
Beispiel #7
0
		protected override void DoInvestigating()
		{
			MovementDirection = NpcSensorSound.GetNewestSoundPosition() - Mover.transform.root.position;
			Mover.RotateTowardsDirection(MovementDirection);
			
			if (!(Health.HealthPoints < HealthRetreatTolerance)) return;
			
			if(!IsOutsideOfZone)
				Mover.MoveTowardsDirection(-MovementDirection);
			else
				Mover.MoveTowardsDirection(MovementDirection);
		}
        private void InitializeComponent()
        {
            health    = GetComponent <Health>();
            mover     = GetComponent <Mover>();
            destroyer = GetComponent <RootDestroyer>();

            var rootTransform = transform.root;

            npcSensorSight = rootTransform.GetComponentInChildren <NpcSensorSight>();
            npcSensorSound = rootTransform.GetComponentInChildren <NpcSensorSound>();
            hitSensor      = rootTransform.GetComponentInChildren <HitSensor>();
            handController = hand.GetComponent <HandController>();

            npcDeathEventChannel = GameObject.FindWithTag(Tags.GameController).GetComponent <NpcDeathEventChannel>();
            hitEventChannel      = GameObject.FindWithTag(Tags.GameController).GetComponent <HitEventChannel>();
        }