Exemplo n.º 1
0
 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);
         };
     }
 }
Exemplo n.º 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);
     };
 }