public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); m_PlantType = (PlantType)reader.ReadInt(); m_PlantHue = (PlantHue)reader.ReadInt(); m_ShowType = reader.ReadBool(); if (Weight != 1.0) { Weight = 1.0; } if (version < 1) { Stackable = true; } if (version < 2 && PlantHueInfo.IsCrossable(m_PlantHue)) { m_PlantHue |= PlantHue.Reproduces; } }
public static bool ConsumeReeds(Container cont, PlantHue hue, int amount) { List <SoftenedReeds> reeds = GetReeds(cont, hue); if (GetTotalReeds(reeds, hue) >= amount) { for (int i = 0; i < reeds.Count; i++) { SoftenedReeds reed = reeds[i]; if (amount >= reed.Amount) { amount -= reed.Amount; reed.Delete(); } else { reed.Amount -= amount; break; } } return(true); } else { return(false); } }
public PlantClippings(PlantHue hue) : base(0x4022) { m_PlantHue = hue; InvalidatePlantHue(); Stackable = true; }
public void PlantSeed(Mobile from, Seed seed) { if (m_PlantStatus >= PlantStatus.FullGrownPlant) { LabelTo(from, 1061919); // You must use a seed on a bowl of dirt! } else if (!IsUsableBy(from)) { LabelTo(from, 1061921); // The bowl of dirt must be in your pack, or you must lock it down. } else if (m_PlantStatus != PlantStatus.BowlOfDirt) { from.SendLocalizedMessage(1080389, "#" + GetLocalizedPlantStatus().ToString()); // This bowl of dirt already has a ~1_val~ in it! } else if (m_PlantSystem.Water < 2) { LabelTo(from, 1061920); // The dirt in this bowl needs to be softened first. } else { m_PlantType = seed.PlantType; m_PlantHue = seed.PlantHue; m_ShowType = seed.ShowType; seed.Delete(); PlantStatus = PlantStatus.Seed; m_PlantSystem.Reset(false); LabelTo(from, 1061922); // You plant the seed in the bowl of dirt. } }
public SoftenedReeds(PlantHue hue) : base(0x4006) { m_PlantHue = hue; InvalidatePlantHue(); Stackable = true; }
public static bool ConsumeReeds( Container cont, PlantHue hue, int amount ) { List<SoftenedReeds> reeds = GetReeds( cont, hue ); if ( GetTotalReeds( reeds, hue ) >= amount ) { for ( int i = 0; i < reeds.Count; i++ ) { SoftenedReeds reed = reeds[i]; if ( amount >= reed.Amount ) { amount -= reed.Amount; reed.Delete(); } else { reed.Amount -= amount; break; } } return true; } else { return false; } }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); switch (version) { case 1: { m_Level = (SecureLevel)reader.ReadInt(); goto case 0; } case 0: { if (version < 1) { m_Level = SecureLevel.CoOwners; } m_PlantStatus = (PlantStatus)reader.ReadInt(); m_PlantType = (PlantType)reader.ReadInt(); m_PlantHue = (PlantHue)reader.ReadInt(); m_ShowType = reader.ReadBool(); if (m_PlantStatus < PlantStatus.DecorativePlant) { m_PlantSystem = new PlantSystem(this, reader); } break; } } }
private PlantHueInfo(int hue, int name, PlantHue plantHue, int gumpHue) { m_Hue = hue; m_Name = name; m_PlantHue = plantHue; m_GumpHue = gumpHue; }
private PlantPigmentHueInfo(PlantHue planthue, int hue, int name, PlantPigmentHue pigmentHue) { this.m_PlantHue = planthue; this.m_Hue = hue; this.m_Name = name; this.m_PlantPigmentHue = pigmentHue; }
public SoftenedReeds( int amount, PlantHue plantHue ) : base(0x4006) { PlantHue = plantHue; Stackable = true; Weight = 1.0; Amount = amount; }
public SoftenedReeds(int amount, PlantHue plantHue) : base(0x4006) { PlantHue = plantHue; Stackable = true; Weight = 1.0; Amount = amount; }
public PlantClippings( int amount, PlantHue plantHue ) : base(0x4022) { PlantHue = plantHue; Stackable = true; Weight = 1.0; Amount = amount; }
public DryReeds(int amount, PlantHue plantHue) : base(0x1BD5) { PlantHue = plantHue; Stackable = true; Weight = 1.0; Amount = amount; }
public PlantPigment( int amount, PlantHue plantHue ) : base(0xF04) { PlantHue = plantHue; Stackable = true; Weight = 1.0; Amount = amount; }
public DryReeds( int amount, PlantHue plantHue ) : base(0x1BD5) { PlantHue = plantHue; Stackable = true; Weight = 1.0; Amount = amount; }
public PlantPigment(int amount, PlantHue plantHue) : base(0xF04) { PlantHue = plantHue; Stackable = true; Weight = 1.0; Amount = amount; }
public PlantClippings(int amount, PlantHue plantHue) : base(0x4022) { PlantHue = plantHue; Stackable = true; Weight = 1.0; Amount = amount; }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int v = reader.ReadInt(); if(v > 0) m_PlantHue = (PlantHue)reader.ReadInt(); }
public static PlantHueInfo GetInfo( PlantHue plantHue ) { PlantHueInfo info = null; if (m_Table.TryGetValue(plantHue, out info)) return info; else return m_Table[PlantHue.Plain]; }
public static PlantHueInfo GetInfo( PlantHue plantHue ) { PlantHueInfo info = m_Table[plantHue] as PlantHueInfo; if ( info != null ) return info; else return (PlantHueInfo)m_Table[PlantHue.Plain]; }
public NaturalDye(int amount, PlantHue plantHue) : base(0x182B) { PlantHue = plantHue; Stackable = false; Weight = 1.0; Amount = amount; m_UsesRemaining = 5; }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); _ = reader.ReadInt(); _PlantType = (PlantType)reader.ReadInt(); _PlantHue = (PlantHue)reader.ReadInt(); _ShowType = reader.ReadBool(); }
public NaturalDye( int amount, PlantHue plantHue ) : base(0x182B) { PlantHue = plantHue; Stackable = false; Weight = 1.0; Amount = amount; m_UsesRemaining = 5; }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); /*int version = */ reader.ReadInt(); m_PlantHue = (PlantHue) reader.ReadInt(); }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); /*int version = */ reader.ReadInt(); m_PlantHue = (PlantHue)reader.ReadInt(); }
public static PlantResourceInfo GetInfo( PlantType plantType, PlantHue plantHue ) { foreach ( PlantResourceInfo info in m_ResourceList ) { if ( info.PlantType == plantType && info.PlantHue == plantHue ) return info; } return null; }
public Seed( PlantType plantType, PlantHue plantHue, bool showType ) : base( 0xDCF ) { Weight = 1.0; m_PlantType = plantType; m_PlantHue = plantHue; m_ShowType = showType; Hue = PlantHueInfo.GetInfo( plantHue ).Hue; }
public Seed(PlantType plantType, PlantHue plantHue, bool showType) : base(0xDCF) { Weight = 1.0; m_PlantType = plantType; m_PlantHue = plantHue; m_ShowType = showType; Hue = PlantHueInfo.GetInfo(plantHue).Hue; }
public static PlantHueInfo GetInfo( PlantHue plantHue ) { PlantHueInfo info; m_Table.TryGetValue( plantHue, out info ); if ( info != null ) return info; else return m_Table[PlantHue.Plain] as PlantHueInfo; }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int v = reader.ReadInt(); if (v > 0) { m_PlantHue = (PlantHue)reader.ReadInt(); } }
public static int GetTotalReeds(List <SoftenedReeds> reeds, PlantHue hue) { int total = 0; for (int i = 0; i < reeds.Count; i++) { total += reeds[i].Amount; } return(total); }
public static PlantHueInfo GetInfo(PlantHue plantHue) { if (m_Table.TryGetValue(plantHue, out PlantHueInfo info)) { return(info); } else { return(m_Table[PlantHue.Plain]); } }
public static PlantHueInfo GetInfo(PlantHue plantHue) { PlantHueInfo info = null; if (m_Table.TryGetValue(plantHue, out info)) { return(info); } return(m_Table[PlantHue.Plain]); }
public Seed(PlantType plantType, PlantHue plantHue, bool showType = false) : base(0xDCF) { Weight = 1.0; Stackable = Core.SA; m_PlantType = plantType; m_PlantHue = plantHue; m_ShowType = showType; Hue = PlantHueInfo.GetInfo(plantHue).Hue; }
public Seed(PlantType plantType, PlantHue plantHue, bool showType) : base(0xDCF) { this.Weight = 1.0; this.Stackable = Core.SA; this.m_PlantType = plantType; this.m_PlantHue = plantHue; this.m_ShowType = showType; this.Hue = PlantHueInfo.GetInfo(plantHue).Hue; }
public static PlantResourceInfo GetInfo(PlantType plantType, PlantHue plantHue) { foreach (PlantResourceInfo info in m_ResourceList) { if (info.PlantType == plantType && info.PlantHue == plantHue) { return(info); } } return(null); }
public Seed(PlantType plantType, PlantHue plantHue, bool showType) : base(0xDCF) { m_PlantType = plantType; m_PlantHue = plantHue; m_ShowType = showType; if (PlantType == PlantType.Hedge) { Name = "a solen seed"; m_PlantHue = PlantHue.None; //for safety } Hue = PlantHueInfo.GetInfo(plantHue).Hue; }
public static int ConvertHue(PlantHue hue) { // 0x455, 0x481, 0x66D, 0x21, // 0x59B, 0x42, 0x53D, 0x5, // 0x8A5, 0x38, 0x46F, 0x2B, // 0xD, 0x10, // 0x486, 0x48E, 0x489, 0x495, // 0x0 //convert from distro plant hue switch (hue) { case PlantHue.Black: return(0); //Black = 0x455 case PlantHue.White: return(1); //White = 0x481, case PlantHue.Red: return(2); //Red = 0x66D, case PlantHue.BrightRed: return(3); //BrightRed = 0x21, case PlantHue.Green: return(4); //Green = 0x59B, case PlantHue.BrightGreen: return(5); //BrightGreen = 0x42, case PlantHue.Blue: return(6); //Blue = 0x53D, case PlantHue.BrightBlue: return(7); //BrightBlue = 0x5, case PlantHue.Yellow: return(8); //Yellow = 0x8A5, case PlantHue.BrightYellow: return(9); //BrightYellow = 0x38, case PlantHue.Orange: return(10); //Orange = 0x46F, case PlantHue.BrightOrange: return(11); //BrightOrange = 0x2B, case PlantHue.Purple: return(12); //Purple = 0xD, case PlantHue.BrightPurple: return(13); //BrightPurple = 0x10, case PlantHue.Magenta: return(14); //RareMagenta = 0x486, case PlantHue.Pink: return(15); //RarePink = 0x48E, case PlantHue.FireRed: return(16); //RareFireRed = 0x489 case PlantHue.Aqua: return(17); //RareAqua = 0x495, case PlantHue.Plain: return(18); //Plain = 0, default: return(18); //Plain } }
public static PlantPigment Mix(Mobile from, PlantHue hue1, PlantHue hue2) { if (PlantHueInfo.IsSaturated(hue2)) { // This pigment is saturated and cannot be mixed further. from.SendLocalizedMessage(1112125); } else if (hue1 == hue2) { // You decide not to waste pigments by mixing two identical colors. from.SendLocalizedMessage(1112242); } else if (PlantHueInfo.GetNotBright(hue1) == PlantHueInfo.GetNotBright(hue2)) { // You decide not to waste pigments by mixing variations of the same hue. from.SendLocalizedMessage(1112243); } else { PlantHue resultant = (hue1 | hue2); if ((resultant & PlantHue.Plain & ~PlantHue.Crossable) != 0) { if ((resultant & (PlantHue.Black | PlantHue.White)) != 0) { /* Mixing plain pigments with the white and black mutant color * pigments will turn them into the new hues, which are saturated. */ resultant |= PlantHue.Saturated; } else { /* Mixing plain pigments with the normal color pigments will turn * them into the matching bright color pigment. */ resultant &= ~PlantHue.Plain; resultant |= PlantHue.Bright | PlantHue.Crossable; } } else if ((resultant & PlantHue.White) != 0) { resultant &= ~PlantHue.White & ~PlantHue.Bright; resultant |= PlantHue.Ice; } else if ((resultant & PlantHue.Black) != 0) { resultant &= ~PlantHue.Black & ~PlantHue.Bright; resultant |= PlantHue.Dark; } return(new PlantPigment(resultant)); } return(null); }
public static PlantHueInfo GetInfo(PlantHue plantHue) { PlantHueInfo info = m_Table[plantHue] as PlantHueInfo; if (info != null) { return(info); } else { return((PlantHueInfo)m_Table[PlantHue.Plain]); } }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); switch (version) { case 1: m_PlantHue = (PlantHue)reader.ReadInt(); break; } }
/// <summary> /// Adds a seed to the list /// </summary> /// <param name="hue"></param> /// <param name="amount"></param> public void Add(PlantHue hue, int amount) { foreach (SeedHue si in Hues) { if (si.Hue == hue) { si.Amount += amount; return; } } Hues.Add(new SeedHue(hue, amount)); Hues.Sort(new PlantHueComparer()); }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); switch (version) { case 1: this.m_PlantHue = (PlantHue)reader.ReadInt(); break; } }
public override void OnSingleClick(Mobile from) { if (m_PlantStatus >= PlantStatus.DeadTwigs) { base.OnSingleClick(from); } else if (m_PlantStatus >= PlantStatus.FullGrownPlant) { PlantTypeInfo typeInfo = PlantTypeInfo.GetInfo(m_PlantType); if (m_PlantStatus < PlantStatus.DecorativePlant) { if (typeInfo.ContainsPlant) { LabelTo(from, string.Format("{0} {1} {2}", m_PlantSystem.GetLocalizedHealth(), PlantHue.ToString().ToLower(), PlantType.ToString().ToLower())); } else { LabelTo(from, string.Format("{0} bright {1} {2} plant", m_PlantSystem.GetLocalizedHealth(), PlantHue.ToString().ToLower(), PlantType.ToString().ToLower())); } } else { LabelTo(from, string.Format("Decorative {0} {1}", PlantHue.ToString().ToLower(), PlantType.ToString().ToLower())); } } else if (m_PlantStatus >= PlantStatus.Seed) { if (m_ShowType) { PlantTypeInfo typeInfo = PlantTypeInfo.GetInfo(m_PlantType); if (typeInfo.ContainsPlant && m_PlantStatus == PlantStatus.Plant) { LabelTo(from, string.Format("Bowl of {0} dirt with a {1} {2} {3}", m_PlantSystem.GetLocalizedDirtStatus().ToLower(), m_PlantSystem.GetLocalizedHealth().ToLower(), PlantHue.ToString().ToLower(), PlantType.ToString().ToLower())); } else { LabelTo(from, string.Format("Bowl of {0} dirt with a {1} {2} {3} {4}", m_PlantSystem.GetLocalizedDirtStatus().ToLower(), m_PlantSystem.GetLocalizedHealth().ToLower(), PlantHue.ToString().ToLower(), GetLocalizedPlantStatus().ToLower(), PlantType.ToString().ToLower())); } } else { LabelTo(from, string.Format("Bowl of {0} dirt with a {1} {2} {3}", m_PlantSystem.GetLocalizedDirtStatus().ToLower(), m_PlantSystem.GetLocalizedHealth().ToLower(), PlantHue.ToString().ToLower(), GetLocalizedPlantStatus().ToLower())); } } else { LabelTo(from, string.Format("Bowl of {0} dirt ", m_PlantSystem.GetLocalizedDirtStatus().ToLower())); } }
public void InvalidatePlantHue() { PlantHueInfo info = PlantHueInfo.GetInfo(m_PlantHue); if (info == null) { m_PlantHue = PlantHue.Plain; Hue = 0; } else Hue = info.Hue; InvalidateProperties(); }
public SoftenedReeds( PlantHue plantHue ) : this(1, plantHue) { }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); switch ( version ) { case 1: { this.m_Level = (SecureLevel)reader.ReadInt(); goto case 0; } case 0: { if (version < 1) this.m_Level = SecureLevel.CoOwners; this.m_PlantStatus = (PlantStatus)reader.ReadInt(); this.m_PlantType = (PlantType)reader.ReadInt(); this.m_PlantHue = (PlantHue)reader.ReadInt(); this.m_ShowType = reader.ReadBool(); if (this.m_PlantStatus < PlantStatus.DecorativePlant) this.m_PlantSystem = new PlantSystem(this, reader); break; } } m_Instances.Add(this); }
public static int GetTotalReeds( Container cont, PlantHue hue ) { return GetTotalReeds( GetReeds( cont, hue ), hue ); }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); m_PlantType = (PlantType)reader.ReadInt(); m_PlantHue = (PlantHue)reader.ReadInt(); m_ShowType = reader.ReadBool(); if ( Weight != 1.0 ) Weight = 1.0; }
public void PlantSeed( Mobile from, Seed seed ) { if ( m_PlantStatus >= PlantStatus.FullGrownPlant ) { LabelTo( from, 1061919 ); // You must use a seed on a bowl of dirt! } else if ( !IsUsableBy( from ) ) { LabelTo( from, 1061921 ); // The bowl of dirt must be in your pack, or you must lock it down. } else if ( m_PlantStatus != PlantStatus.BowlOfDirt ) { from.SendLocalizedMessage( 1080389, "#" + GetLocalizedPlantStatus().ToString() ); // This bowl of dirt already has a ~1_val~ in it! } else if ( m_PlantSystem.Water < 2 ) { LabelTo( from, 1061920 ); // The dirt in this bowl needs to be softened first. } else { m_PlantType = seed.PlantType; m_PlantHue = seed.PlantHue; m_ShowType = seed.ShowType; seed.Consume(); PlantStatus = PlantStatus.Seed; m_PlantSystem.Reset( false ); LabelTo( from, 1061922 ); // You plant the seed in the bowl of dirt. } }
public static int GetTotalReeds( List<SoftenedReeds> reeds, PlantHue hue ) { int total = 0; for ( int i = 0; i < reeds.Count; i++ ) total += reeds[i].Amount; return total; }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); switch ( version ) { case 2: case 1: { m_Level = (SecureLevel) reader.ReadInt(); goto case 0; } case 0: { if ( version < 1 ) m_Level = SecureLevel.CoOwners; m_PlantStatus = (PlantStatus) reader.ReadInt(); m_PlantType = (PlantType) reader.ReadInt(); m_PlantHue = (PlantHue) reader.ReadInt(); m_ShowType = reader.ReadBool(); if ( m_PlantStatus < PlantStatus.DecorativePlant ) m_PlantSystem = new PlantSystem( this, reader ); if ( version < 2 && PlantHueInfo.IsCrossable( m_PlantHue ) ) m_PlantHue |= PlantHue.Reproduces; break; } } m_Instances.Add( this ); }
public static PlantPigmentHue HueFromPlantHue(PlantHue hue) { if (hue == PlantHue.None || hue == PlantHue.Plain) return PlantPigmentHue.Plain; foreach (KeyValuePair<PlantPigmentHue, PlantPigmentHueInfo> kvp in m_Table) { if (kvp.Value.PlantHue == hue) return kvp.Key; } return PlantPigmentHue.Plain; }
public PlantSystem( PlantItem plant, GenericReader reader ) { m_Plant = plant; int version = reader.ReadInt(); m_FertileDirt = reader.ReadBool(); if ( version >= 1 ) m_NextGrowth = reader.ReadDateTime(); else m_NextGrowth = reader.ReadDeltaTime(); m_GrowthIndicator = (PlantGrowthIndicator)reader.ReadInt(); m_Water = reader.ReadInt(); m_Hits = reader.ReadInt(); m_Infestation = reader.ReadInt(); m_Fungus = reader.ReadInt(); m_Poison = reader.ReadInt(); m_Disease = reader.ReadInt(); m_PoisonPotion = reader.ReadInt(); m_CurePotion = reader.ReadInt(); m_HealPotion = reader.ReadInt(); m_StrengthPotion = reader.ReadInt(); m_Pollinated = reader.ReadBool(); m_SeedType = (PlantType)reader.ReadInt(); m_SeedHue = (PlantHue)reader.ReadInt(); m_AvailableSeeds = reader.ReadInt(); m_LeftSeeds = reader.ReadInt(); m_AvailableResources = reader.ReadInt(); m_LeftResources = reader.ReadInt(); if ( version < 2 && PlantHueInfo.IsCrossable( m_SeedHue ) ) m_SeedHue |= PlantHue.Reproduces; }
public static List<SoftenedReeds> GetReeds( Container cont, PlantHue hue ) { return GetReeds( cont.FindItemsByType<SoftenedReeds>(), hue ); }
public static int ConvertHue( PlantHue hue ) { // 0x455, 0x481, 0x66D, 0x21, // 0x59B, 0x42, 0x53D, 0x5, // 0x8A5, 0x38, 0x46F, 0x2B, // 0xD, 0x10, // 0x486, 0x48E, 0x489, 0x495, // 0x0 //convert from distro plant hue switch( hue ) { case PlantHue.Black : return 0 ; //Black = 0x455 case PlantHue.White : return 1 ; //White = 0x481, case PlantHue.Red : return 2 ; //Red = 0x66D, case PlantHue.BrightRed : return 3 ; //BrightRed = 0x21, case PlantHue.Green : return 4 ; //Green = 0x59B, case PlantHue.BrightGreen : return 5 ; //BrightGreen = 0x42, case PlantHue.Blue : return 6 ; //Blue = 0x53D, case PlantHue.BrightBlue : return 7 ; //BrightBlue = 0x5, case PlantHue.Yellow : return 8 ; //Yellow = 0x8A5, case PlantHue.BrightYellow : return 9 ; //BrightYellow = 0x38, case PlantHue.Orange : return 10; //Orange = 0x46F, case PlantHue.BrightOrange : return 11; //BrightOrange = 0x2B, case PlantHue.Purple : return 12; //Purple = 0xD, case PlantHue.BrightPurple : return 13; //BrightPurple = 0x10, case PlantHue.Magenta : return 14; //RareMagenta = 0x486, case PlantHue.Pink : return 15; //RarePink = 0x48E, case PlantHue.FireRed : return 16; //RareFireRed = 0x489 case PlantHue.Aqua : return 17; //RareAqua = 0x495, case PlantHue.Plain : return 18; //Plain = 0, default : return 18; //Plain } }
public static List<SoftenedReeds> GetReeds( List<SoftenedReeds> reeds, PlantHue hue ) { List<SoftenedReeds> validReeds = new List<SoftenedReeds>(); for ( int i = 0; i < reeds.Count; i++ ) { SoftenedReeds reed = reeds[i]; if ( reed.PlantHue == hue ) validReeds.Add( reed ); } return validReeds; }