public UndeadAIHAndler(World w, HackyMWAIInfo hackinfo, HackyMWAI hai, Player player) { world = w; hackyAIInfo = hackinfo; hackyAI = hai; this.Player = player; }
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); } }