public void UseConfig(ChaserControllerConfig config)
 {
     if (config == null)
     {
         return;
     }
     ChaseDistance               = config.chaseDistance;
     WanderSpeedMultiplier       = config.wanderSpeedMultiplier;
     AggroRange                  = config.aggroRange;
     FramesSpentWandering        = config.framesSpentWandering;
     FramesSpentStillAfterWander = config.framesSpentStillAfterWander;
     WanderingFramesVariance     = config.wanderingFramesVariance;
     WanderingStartingCounter    = config.startingCounter;
     if (config.targettingType == TargettingModule.Technique.ByEntityType)
     {
         Entity.EntityType t = config.targetEntityType;
         _targettingModule.CheckEntityCallback = (callingEntity, entityBeingChecked) => {
             if (entityBeingChecked.IsDead)
             {
                 return(false);
             }
             if (!Behaviours.CheckIfEntityInSight(callingEntity, entityBeingChecked))
             {
                 return(false);
             }
             return(entityBeingChecked.Type == t);
         };
     }
 }
Beispiel #2
0
 public SlashController()
 {
     _targettingModule                     = new TargettingModule();
     _targettingModule.SeekRadius          = 2;
     _targettingModule.CheckEntityCallback = (callingEntity, entityBeingChecked) => {
         if (entityBeingChecked.IsDead)
         {
             return(false);
         }
         if (!Behaviours.CheckIfEntityInSight(callingEntity, entityBeingChecked))
         {
             return(false);
         }
         return(entityBeingChecked.Type == Entity.EntityType.Player);
     };
 }