void tmr_Tick(object sender, EventArgs e) { CheckProjectileCollisions(); RemoveDeadGuys();// remove dead mobs before they sense/react to anything... RemoveDeadProjectiles(); CheckForLoot(); foreach (Mob m in monsters) { List <Locateable> thingsICanSee = FindAllLocateablesInRadius(m); m.Sense(thingsICanSee); List <Mob> mobsICanSee = FindAllMobsInRadius(m); m.Sense(mobsICanSee); MobAction act = m.React(1.0); } List <Locateable> thingsLinkCanSee = FindAllLocateablesInRadius(link); link.Sense(thingsLinkCanSee); List <Mob> mobsLinkCanSee = FindAllMobsInRadius(link); link.Sense(mobsLinkCanSee); MobAction actLink = link.React(1.0); foreach (Projectile proj in projectiles) { proj.Move(1.0); } GameInfo gi = new GameInfo(); gi.Link = link; gi.Monsters = link.Contacts; gi.Map = link.Map; gi.Projectiles = projectiles; gi.Msg = obituary; if (Update != null) { // Notify the Form that the Game status has changed... Update(gi); } obituary = "";// clear out the obituary for the next round of deaths to come }
public override void Read() { EID = Int; mobAction = (MobAction)SByte; JumpBoost = Int; }
public override void Read(Stream str) { EID = ReadInt(str); mobAction = (MobAction)ReadSByte(str); }