示例#1
0
 public UndeadAIHAndler(World w, HackyMWAIInfo hackinfo, HackyMWAI hai, Player player)
 {
     world       = w;
     hackyAIInfo = hackinfo;
     hackyAI     = hai;
     this.Player = player;
 }
示例#2
0
        void ITick.Tick(Actor self)
        {
            if (!self.Owner.IsBot)
            {
                return;
            }

            if (--assignRolesTicks <= 0)
            {
                hackyaiinfo     = self.Owner.PlayerActor.Info.TraitInfos <HackyMWAIInfo>().Where(a => a.Type == self.Owner.BotType).First();
                hackyai         = self.Owner.PlayerActor.TraitsImplementing <HackyMWAI>().Where(a => a.Info.Type == self.Owner.BotType).First();
                undeadaihandler = new UndeadAIHAndler(self.World, hackyaiinfo, hackyai, self.Owner);

                if (undeadaihandler == null || hackyai == null || hackyaiinfo == null)
                {
                    return;
                }

                assignRolesTicks = hackyaiinfo.AssignRolesInterval;
                DoStuff(self);
            }
        }