//private bool m_AdminInUse; public TownStone(POMI Pomi) : base(0xED4) { m_Pomi = Pomi; m_Citoyens = new ArrayList(); m_Candidats = new ArrayList(); m_HLL = new ArrayList(); m_Allies = new ArrayList(); m_Paix = new ArrayList(); m_Guerre = new ArrayList(); m_Neutre = new ArrayList(); m_Maire = null; m_Conseiller = null; m_Ambassadeur = null; m_Capitaine = null; m_Gardes = new ArrayList(); m_gardes_pnj = new ArrayList(); m_MaireCloak = null; m_ConseillerCloak = null; m_AmbassadeurCloak = null; m_CapitaineCloak = null; m_CapitaineBook = null; m_GardeCloak = new ArrayList(); Name = "Pierre de ville"; m_Nom = "Sans nom"; m_Votants = new ArrayList(); m_Elections = new ArrayList(); m_Resultats = new ArrayList(); m_ElecDelay = TimeSpan.FromDays(14.0); m_EndDate = DateTime.Now + m_ElecDelay; m_ElecTimer = new ElectionTimer(this, m_ElecDelay); m_ElecTimer.Start(); m_MaxDistance = 100; //m_AdminInUse = false; }
//private bool m_AdminInUse; public TownStone(POMI Pomi) : base( 0xED4 ) { m_Pomi = Pomi; m_Citoyens = new ArrayList(); m_Candidats = new ArrayList(); m_HLL = new ArrayList(); m_Allies = new ArrayList(); m_Paix = new ArrayList(); m_Guerre = new ArrayList(); m_Neutre = new ArrayList(); m_Maire = null; m_Conseiller = null; m_Ambassadeur = null; m_Capitaine = null; m_Gardes = new ArrayList(); m_gardes_pnj = new ArrayList(); m_MaireCloak = null; m_ConseillerCloak = null; m_AmbassadeurCloak = null; m_CapitaineCloak = null; m_CapitaineBook = null; m_GardeCloak = new ArrayList(); Name = "Pierre de ville"; m_Nom = "Sans nom"; m_Votants = new ArrayList(); m_Elections = new ArrayList(); m_Resultats = new ArrayList(); m_ElecDelay = TimeSpan.FromDays( 14.0 ); m_EndDate = DateTime.Now + m_ElecDelay; m_ElecTimer = new ElectionTimer(this, m_ElecDelay); m_ElecTimer.Start(); m_MaxDistance = 100; //m_AdminInUse = false; }
// Méthode pour vérifier qu'un joueur soit bien citoyen d'une ville donnée public static bool IsPlayerCitizenOf(Mobile from, string town) { if (from == null) { return(false); } POMI thePomi = POMI.FindPomi(); if (thePomi == null) { return(false); } foreach (object v in thePomi.Villes) { if (v == null || !(v is TownStone)) { continue; } TownStone ville = (TownStone)v; if (ville.Nom.ToLower() == town.ToLower()) { return(ville.Citoyens.Contains(from)); } } return(false); }
// Scriptiz : méthode pour vérifier si un point se trouve à l'intérieur de la ville d'un PJ public static bool IsPointInPlayerTown(PlayerMobile from, Point2D location) { if (from == null) { return(false); } ArrayList villesPomi = POMI.FindPomi().Villes; TownStone ts = null; foreach (object o in villesPomi) { if (o is TownStone) { ts = (TownStone)o; } if (ts != null) { if (ts.Citoyens.Contains(from) && ts.Map == from.Map) { double distance = Math.Sqrt(Math.Pow(ts.Location.X - location.X, 2) + Math.Pow(ts.Location.Y - location.Y, 2)); if (distance > ts.MaxDistance) { from.SendMessage("Vous ne pouvez pas bâtir en dehors de votre ville."); return(false); } } } } return(true); }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); switch (version) { case 1: { m_VilleRace = (VilleRaciale)reader.ReadByte(); goto case 0; } case 0: { m_Citoyens = reader.ReadMobileList(); m_Candidats = reader.ReadMobileList(); m_HLL = reader.ReadMobileList(); m_Gardes = reader.ReadMobileList(); m_gardes_pnj = reader.ReadItemList(); m_Maire = (PlayerMobile)reader.ReadMobile(); m_Conseiller = (PlayerMobile)reader.ReadMobile(); m_Ambassadeur = (PlayerMobile)reader.ReadMobile(); m_Capitaine = (PlayerMobile)reader.ReadMobile(); m_Pomi = (POMI)reader.ReadItem(); m_MaireCloak = (PomiCloak)reader.ReadItem(); m_ConseillerCloak = (PomiCloak)reader.ReadItem(); m_AmbassadeurCloak = (PomiCloak)reader.ReadItem(); m_CapitaineCloak = (PomiCloak)reader.ReadItem(); m_CapitaineBook = (CapitaineBook)reader.ReadItem(); m_GardeCloak = reader.ReadItemList(); m_Nom = reader.ReadString(); m_Charte0 = reader.ReadString(); m_Charte1 = reader.ReadString(); m_Charte2 = reader.ReadString(); m_Charte3 = reader.ReadString(); m_Charte4 = reader.ReadString(); m_Charte5 = reader.ReadString(); m_Charte6 = reader.ReadString(); m_Charte7 = reader.ReadString(); m_Votants = reader.ReadMobileList(); m_Elections = reader.ReadMobileList(); m_Resultats = reader.ReadMobileList(); m_EndDate = reader.ReadDateTime(); m_ElecTimer = new ElectionTimer(this, m_EndDate - DateTime.Now); m_ElecTimer.Start(); m_ElecDelay = reader.ReadTimeSpan(); m_MaxDistance = reader.ReadInt(); m_Allies = reader.ReadItemList(); m_Paix = reader.ReadItemList(); m_Guerre = reader.ReadItemList(); m_Neutre = reader.ReadItemList(); m_Box = (TownBox)reader.ReadItem(); break; } } }
/** * Scriptiz : divers ajouts pour le POMI */ // Scriptiz : méthode pour trouver la pierre POMI principale (celle qui a le plus de villes) public static POMI FindPomi() { POMI mainPomi = null; foreach (Item i in World.Items.Values) { if (i is POMI) { if (mainPomi == null) { mainPomi = (POMI)i; } else if (((POMI)i).Villes.Count > mainPomi.Villes.Count) { mainPomi = (POMI)i; } } } return(mainPomi); }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); switch ( version ) { case 1: { m_VilleRace = (VilleRaciale)reader.ReadByte(); goto case 0; } case 0: { m_Citoyens = reader.ReadMobileList(); m_Candidats = reader.ReadMobileList(); m_HLL = reader.ReadMobileList(); m_Gardes = reader.ReadMobileList(); m_gardes_pnj = reader.ReadItemList(); m_Maire = (PlayerMobile)reader.ReadMobile(); m_Conseiller = (PlayerMobile)reader.ReadMobile(); m_Ambassadeur = (PlayerMobile)reader.ReadMobile(); m_Capitaine = (PlayerMobile)reader.ReadMobile(); m_Pomi = (POMI)reader.ReadItem(); m_MaireCloak = (PomiCloak)reader.ReadItem(); m_ConseillerCloak = (PomiCloak)reader.ReadItem(); m_AmbassadeurCloak = (PomiCloak)reader.ReadItem(); m_CapitaineCloak = (PomiCloak)reader.ReadItem(); m_CapitaineBook = (CapitaineBook)reader.ReadItem(); m_GardeCloak = reader.ReadItemList(); m_Nom = reader.ReadString(); m_Charte0 = reader.ReadString(); m_Charte1 = reader.ReadString(); m_Charte2 = reader.ReadString(); m_Charte3 = reader.ReadString(); m_Charte4 = reader.ReadString(); m_Charte5 = reader.ReadString(); m_Charte6 = reader.ReadString(); m_Charte7 = reader.ReadString(); m_Votants = reader.ReadMobileList(); m_Elections = reader.ReadMobileList(); m_Resultats = reader.ReadMobileList(); m_EndDate = reader.ReadDateTime(); m_ElecTimer = new ElectionTimer(this, m_EndDate - DateTime.Now); m_ElecTimer.Start(); m_ElecDelay = reader.ReadTimeSpan(); m_MaxDistance = reader.ReadInt(); m_Allies = reader.ReadItemList(); m_Paix = reader.ReadItemList(); m_Guerre = reader.ReadItemList(); m_Neutre = reader.ReadItemList(); m_Box = (TownBox)reader.ReadItem(); break; } } }
public gumpAdminPOMI(Mobile from, POMI cible) : base(0,0) { Closable = true; Dragable = true; int i = 50; int j = 0; // POMI Pomicible = (POMI)cible; AddPage(0); AddBackground( 0, 0, 295, 400, 5054); AddBackground( 15, 15, 265, 370, 3500); AddLabel( 100, 30, 0, string.Format( "VILLES POMI")); if (cible.Villes.Count <= 0) { from.SendMessage("Il n'y a pas de ville sur cette pierre POMI! [Count = " + cible.Villes.Count +" ]"); } else { foreach(TownStone ville in cible.Villes) { AddLabel( 30 ,(10+i), 0, (j +"- " +ville.Name) ); i=i+15; j++; } } }