public static Item GetPotion(Mobile from, PotionEffect[] effects) { if (from.Backpack == null) return null; Item[] items = from.Backpack.FindItemsByType(new Type[] { typeof(BasePotion), typeof(PotionKeg) }); foreach (Item item in items) { if (item is BasePotion) { BasePotion potion = (BasePotion)item; if (Array.IndexOf(effects, potion.PotionEffect) >= 0) return potion; } else { PotionKeg keg = (PotionKeg)item; if (keg.Held > 0 && Array.IndexOf(effects, keg.Type) >= 0) return keg; } } return null; }
public BasePotion( int itemID, PotionEffect effect ) : base( itemID ) { m_PotionEffect = effect; Stackable = Core.ML; Weight = 1.0; }
public BasePotion( int itemID, PotionEffect effect ) : base( itemID ) { m_PotionEffect = effect; //Stackable = Core.ML; Stackable = true; Weight = 0.25; }
public BasePotion( int itemID, PotionEffect effect ) : base(itemID) { m_PotionEffect = effect; Stackable = true; Weight = 2.0; }
public BasePotion(int itemID, PotionEffect effect) : base(itemID) { this.m_PotionEffect = effect; this.Stackable = Core.ML; this.Weight = 1.0; }
public BasePotion( int itemID, PotionEffect effect ) : base( itemID ) { m_PotionEffect = effect; Stackable = Core.ML; Weight = 1.0; ItemValue = ItemValue.Common; }
public BasePotion( int itemID, PotionEffect effect ) : base(itemID) { m_PotionEffect = effect; m_Tasters = new ArrayList(); Stackable = false; Weight = 1.0; }
private static Item MakePotionKeg( PotionEffect type, int hue ) { PotionKeg keg = new PotionKeg(); keg.Held = 100; keg.Type = type; keg.Hue = hue; return MakeNewbie( keg ); }
private Item MakePotionKeg(PotionEffect type, int hue) { PotionKeg keg = new PotionKeg(); keg.Held = 100; keg.Type = type; keg.Hue = hue; return keg; }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); switch ( version ) { case 0: { m_Type = (PotionEffect)reader.ReadInt(); m_Held = reader.ReadInt(); break; } } }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); switch( version ) { case 1: case 0: { m_Type = (PotionEffect)reader.ReadInt(); m_Held = reader.ReadInt(); break; } } if( version < 1 ) Timer.DelayCall( TimeSpan.Zero, new TimerCallback( UpdateWeight ) ); }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); switch (version) { case 1: case 0: { m_PotionEffect = (PotionEffect)reader.ReadInt(); break; } } if (version == 0) { Stackable = Core.ML; } }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); switch (version) { case 1: case 0: { m_Type = (PotionEffect)reader.ReadInt(); m_Held = reader.ReadInt(); break; } } if (version < 1) { Timer.DelayCall(TimeSpan.Zero, new TimerCallback(UpdateWeight)); } }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); switch (version) { case 1: case 0: { m_PotionEffect = (PotionEffect)reader.ReadInt(); break; } } if (Weight != 2.0) { Weight = 2.0; } }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); //Version 0 if (version > 0) { m_Type = (PotionEffect)reader.ReadInt(); Held = reader.ReadInt(); } //Version 1 //Version 2 if (version >= 2) { m_MaxHeld = reader.ReadInt(); IsPotionBarrel = reader.ReadBool(); } }
void OnCollisionEnter2D(Collision2D col) { if (col.gameObject.name == "Player") { Destroy(this.gameObject); if (PauseMenuScript.ctrlScript.gameRunning) { if (ManaBarScript.maxMana < ManaBarScript.mana + gain) { float currentGain = ManaBarScript.maxMana - ManaBarScript.mana; GameController.ShowTextEffect(currentGain, text, col.transform); ManaBarScript.mana += currentGain; } else { GameController.ShowTextEffect(gain, text, col.transform); ManaBarScript.mana += gain; } PotionEffect.ActivateEffect(col.transform, manaEffect); } } }
private void completePotion(PotionName p) { switch(p) { case PotionName.None: itemName = "Empty"; itemDescription = "Empty"; weight = 0; value = 0; potionEffect = PotionEffect.None; potency = 0; break; case PotionName.Health: itemName = "Health Potion"; itemDescription = ""; weight = 1; value = 1; potionEffect = PotionEffect.Health; potency = 4; break; case PotionName.Strength: itemName = "Strength Potion"; itemDescription = ""; weight = 1; value = 1; potionEffect = PotionEffect.Strength; potency = 4; break; case PotionName.Dexterity: itemName = "Dexterity Potion"; itemDescription = ""; weight = 1; value = 1; potionEffect = PotionEffect.Dexterity; potency = 4; break; default: break; } }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); switch (version) { case 1: case 0: { m_PotionEffect = (PotionEffect)reader.ReadInt(); m_Poisoner = reader.ReadMobile(); m_Poison = Poison.Deserialize(reader); break; } } if (version == 0) { Stackable = false; } }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); switch (version) { case 1: case 0: { m_Type = (PotionEffect)reader.ReadInt(); m_Held = reader.ReadInt(); m_Level = (SecureLevel)reader.ReadInt(); //RedemptionUO Original value remove line break; } } if (version < 1) { Timer.DelayCall(TimeSpan.Zero, UpdateWeight); } }
public static EodonPotionContext GetContext(Mobile m, PotionEffect effect) { if (m == null) { return(null); } if (Contexts == null || !Contexts.ContainsKey(m) || Contexts[m] == null) { return(null); } for (var index = 0; index < Contexts[m].Count; index++) { var c = Contexts[m][index]; if (c.Type == effect) { return(c); } } return(null); }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); switch (version) { case 1: { m_TypeName = reader.ReadString(); goto case 0; } case 0: { m_Type = (PotionEffect)reader.ReadInt(); m_Held = reader.ReadInt(); break; } } }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); switch (version) { case 0: { m_PotionEffect = (PotionEffect)reader.ReadInt(); break; } case 1: { if (reader.ReadBool()) { m_Tasters = reader.ReadMobileList(); } goto case 0; } } }
public EodonianPotion(int id, PotionEffect effect) : base(id, effect) { }
public static bool IsUnderEffects(Mobile m, PotionEffect effect) { return(GetContext(m, effect) != null); }
public static void RemoveContext(Mobile m, PotionEffect effect) { RemoveContext(m, GetContext(m, effect)); }
public BaseExplosionPotion( PotionEffect effect ) : base(0xF0D, effect) { }
public bool ApplyPotion(PotionEffect effect, bool testOnly, out int message) { if (m_PlantStatus >= PlantStatus.DecorativePlant) { message = 1053049; // This is a decorative plant, it does not need watering! return(false); } if (m_PlantStatus == PlantStatus.BowlOfDirt) { message = 1053066; // You should only pour potions on a plant or seed! return(false); } bool full = false; if (effect == PotionEffect.PoisonGreater || effect == PotionEffect.PoisonDeadly) { if (m_PlantSystem.IsFullPoisonPotion) { full = true; } else if (!testOnly) { m_PlantSystem.PoisonPotion++; } } else if (effect == PotionEffect.CureGreater) { if (m_PlantSystem.IsFullCurePotion) { full = true; } else if (!testOnly) { m_PlantSystem.CurePotion++; } } else if (effect == PotionEffect.HealGreater) { if (m_PlantSystem.IsFullHealPotion) { full = true; } else if (!testOnly) { m_PlantSystem.HealPotion++; } } else if (effect == PotionEffect.StrengthGreater) { if (m_PlantSystem.IsFullStrengthPotion) { full = true; } else if (!testOnly) { m_PlantSystem.StrengthPotion++; } } else if (effect == PotionEffect.PoisonLesser || effect == PotionEffect.Poison || effect == PotionEffect.CureLesser || effect == PotionEffect.Cure || effect == PotionEffect.HealLesser || effect == PotionEffect.Heal || effect == PotionEffect.Strength) { message = 1053068; // This potion is not powerful enough to use on a plant! return(false); } else { message = 1053069; // You can't use that on a plant! return(false); } if (full) { message = 1053065; // The plant is already soaked with this type of potion! return(false); } else { message = 1053067; // You pour the potion over the plant. return(true); } }
private const int ExplosionRange = 2; // How long is the blast radius? public BaseFragmentationPotion( PotionEffect effect ) : base( 0xF0D, effect ) { }
public BaseShatterPotion(PotionEffect effect) : base(0xF0D, effect) { }
public BaseExplodingTarPotion(PotionEffect effect) : base(0xF06, effect) { Hue = 1109; }
public override bool OnDragDrop(Mobile from, Item item) { if (item is BasePotion) { BasePotion pot = (BasePotion)item; int toHold = Math.Min(100 - m_Held, pot.Amount); if (pot.PotionEffect == PotionEffect.Darkglow || pot.PotionEffect == PotionEffect.Parasitic) { from.SendLocalizedMessage(502232); // The keg is not designed to hold that type of object. return(false); } else if (toHold <= 0) { from.SendLocalizedMessage(502233); // The keg will not hold any more! return(false); } else if (m_Held == 0) { if (GiveBottle(from, toHold)) { m_Type = pot.PotionEffect; Held = toHold; from.PlaySound(0x240); from.SendLocalizedMessage(502237); // You place the empty bottle in your backpack. item.Consume(toHold); if (!item.Deleted) { item.Bounce(from); } return(true); } else { from.SendLocalizedMessage(502238); // You don't have room for the empty bottle in your backpack. return(false); } } else if (pot.PotionEffect != m_Type) { from.SendLocalizedMessage(502236); // You decide that it would be a bad idea to mix different types of potions. return(false); } else { if (GiveBottle(from, toHold)) { Held += toHold; from.PlaySound(0x240); from.SendLocalizedMessage(502237); // You place the empty bottle in your backpack. item.Consume(toHold); if (!item.Deleted) { item.Bounce(from); } return(true); } else { from.SendLocalizedMessage(502238); // You don't have room for the empty bottle in your backpack. return(false); } } } else { from.SendLocalizedMessage(502232); // The keg is not designed to hold that type of object. return(false); } }
public BaseMixture(PotionEffect p) : base(0x1FDB, p) { }
public BaseCurePotion( PotionEffect effect ) : base(0xF07, effect) { }
public BasePoisonPotion(PotionEffect effect) : base(0xF0A, effect) { }
public BaseRefreshPotion( PotionEffect effect ) : base( 0xF0B, effect ) { }
public BaseCurePotion(PotionEffect effect) : base(0xF07, effect) { }
public BaseStrengthPotion( PotionEffect effect ) : base( 0xF09, effect ) { }
public BaseManaRefreshPotion( PotionEffect effect ) : base( 0xF0D, effect ) { Hue = 1072; }
public BaseLethargyPotion(PotionEffect effect) : base(0xE24, effect) { Hue = 1278; }
public BaseHealPotion(PotionEffect effect) : base(0xF0C, effect) { }
public override bool OnDragDrop( Mobile from, Item item ) { if ( item is BasePotion ) { BasePotion pot = (BasePotion)item; if (pot.PotionEffect != m_Type && m_Held != 0) from.SendLocalizedMessage(502236); // You decide that it would be a bad idea to mix different types of potions. else if (m_Held >= m_MaxAmount) from.SendLocalizedMessage(502233); // The keg will not hold any more! else if (pot.Amount > (m_MaxAmount - m_Held)) from.SendAsciiMessage("That keg can't contain all those potions!"); else { if ( m_Held == 0) { m_Type = pot.PotionEffect; } int toConsume = m_MaxAmount - m_Held; if (toConsume > pot.Amount) toConsume = pot.Amount; m_Held += toConsume; pot.Consume(toConsume); Bottle emptyBottles = new Bottle(toConsume); if (!from.AddToBackpack(emptyBottles)) { from.SendAsciiMessage(string.Format("You are too heavey, you place the bottle{0} on the ground.", emptyBottles.Amount == 1 ? string.Empty : "s")); emptyBottles.MoveToWorld(from.Location); } else from.SendAsciiMessage(string.Format("You place the empty bottle{0} in your backpack.", emptyBottles.Amount == 1 ? string.Empty : "s")); ColorKeg(); from.PlaySound(0x240); } } else from.SendLocalizedMessage( 502232 ); // The keg is not designed to hold that type of object. //Always return false return false; }
public bool ApplyPotion( PotionEffect effect, bool testOnly, out string message ) { bool full = false; if ( effect == PotionEffect.PoisonGreater || effect == PotionEffect.PoisonDeadly ) { if ( IsFullPoisonPotion ) full = true; else if ( !testOnly ) potPoison++; } else if ( effect == PotionEffect.CureGreater ) { if ( IsFullCurePotion ) full = true; else if ( !testOnly ) potCure++; } else if ( effect == PotionEffect.HealGreater ) { if ( IsFullHealPotion ) full = true; else if ( !testOnly ) potHeal++; } else if ( effect == PotionEffect.StrengthGreater ) { if ( IsFullStrengthPotion ) full = true; else if ( !testOnly ) potStrength++; } else if (effect == PotionEffect.AgilityGreater ) { if ( IsFullAgilityPotion ) full = true; else if ( !testOnly ) potAgility++; } else if ( effect == PotionEffect.PoisonLesser || effect == PotionEffect.Poison || effect == PotionEffect.CureLesser || effect == PotionEffect.Cure || effect == PotionEffect.HealLesser || effect == PotionEffect.Heal || effect == PotionEffect.Strength ) { message = "This potion is not powerful enough to use on a beehive!"; return false; } else { message = "You cannot use that on a beehive!"; return false; } if ( full ) { message = "The beehive is already soaked with this type of potion!"; return false; } else { message = "You pour the potion into the beehive."; return true; } }
private const int ExplosionRange = 5; // How long is the blast radius? public BaseZombieKillerPotion(PotionEffect effect) : base(0xF0D, effect) { }
public override bool OnDragDrop( Mobile from, Item item ) { if ( item is BasePotion ) { BasePotion pot = (BasePotion)item; if ( m_Held == 0 ) { if ( GiveBottle( from ) ) { m_Type = pot.PotionEffect; Held = 1; from.PlaySound( 0x240 ); from.SendLocalizedMessage( 502237 ); // You place the empty bottle in your backpack. item.Delete(); return true; } else { from.SendLocalizedMessage( 502238 ); // You don't have room for the empty bottle in your backpack. return false; } } else if ( pot.PotionEffect != m_Type ) { from.SendLocalizedMessage( 502236 ); // You decide that it would be a bad idea to mix different types of potions. return false; } else if ( m_Held >= 100 ) { from.SendLocalizedMessage( 502233 ); // The keg will not hold any more! return false; } else { if ( GiveBottle( from ) ) { ++Held; item.Delete(); from.PlaySound( 0x240 ); from.SendLocalizedMessage( 502237 ); // You place the empty bottle in your backpack. item.Delete(); return true; } else { from.SendLocalizedMessage( 502238 ); // You don't have room for the empty bottle in your backpack. return false; } } } else { from.SendLocalizedMessage( 502232 ); // The keg is not designed to hold that type of object. return false; } }
public BaseConflagrationPotion(PotionEffect effect) : base(0xF06, effect) { Hue = 0x489; }
//master constructor: set up type, a name, an amount, and size/offset of artwork public PotionEntry( Type type, string name, int amount, int height, int x, int y ) : base( type, new Type[]{ typeof( PotionKeg ) }, name, amount, height, x, y ) { try { BasePotion potion = (BasePotion)Activator.CreateInstance( type ); _Effect = potion.PotionEffect; potion.Delete(); } catch { } }
{ } public BaseRefreshPotion( Serial serial ) : base( serial )
public override void Deserialize( GenericReader reader ) { //handle base StoreEntry deserialization first base.Deserialize( reader ); int version = reader.ReadInt(); switch( version ) { case 0: default: { _Effect = (PotionEffect)reader.ReadInt(); break; } } }//deserialize
public BaseConflagrationPotion( PotionEffect effect ) : base(0xF06, effect) { Hue = 0x489; }
public BaseAgilityPotion(PotionEffect effect) : base(0xF08, effect) { }
public BaseStrengthPotion(PotionEffect effect) : base(0xF09, effect) { }
public BaseManaRefreshPotion(PotionEffect effect) : base(0xF0D, effect) { Hue = 1072; }
public bool ApplyPotion( PotionEffect effect, bool testOnly, out int message ) { if ( m_PlantStatus >= PlantStatus.DecorativePlant ) { message = 1053049; // This is a decorative plant, it does not need watering! return false; } if ( m_PlantStatus == PlantStatus.BowlOfDirt ) { message = 1053066; // You should only pour potions on a plant or seed! return false; } bool full = false; if ( effect == PotionEffect.PoisonGreater || effect == PotionEffect.PoisonDeadly ) { if ( m_PlantSystem.IsFullPoisonPotion ) { full = true; } else if ( !testOnly ) { m_PlantSystem.PoisonPotion++; } } else if ( effect == PotionEffect.CureGreater ) { if ( m_PlantSystem.IsFullCurePotion ) { full = true; } else if ( !testOnly ) { m_PlantSystem.CurePotion++; } } else if ( effect == PotionEffect.HealGreater ) { if ( m_PlantSystem.IsFullHealPotion ) { full = true; } else if ( !testOnly ) { m_PlantSystem.HealPotion++; } } else if ( effect == PotionEffect.StrengthGreater ) { if ( m_PlantSystem.IsFullStrengthPotion ) { full = true; } else if ( !testOnly ) { m_PlantSystem.StrengthPotion++; } } else if ( effect == PotionEffect.PoisonLesser || effect == PotionEffect.Poison || effect == PotionEffect.CureLesser || effect == PotionEffect.Cure || effect == PotionEffect.HealLesser || effect == PotionEffect.Heal || effect == PotionEffect.Strength ) { message = 1053068; // This potion is not powerful enough to use on a plant! return false; } else { message = 1053069; // You can't use that on a plant! return false; } if ( full ) { message = 1053065; // The plant is already soaked with this type of potion! return false; } else { message = 1053067; // You pour the potion over the plant. return true; } }
public BaseAgilityPotion( PotionEffect effect ) : base( 0xF08, effect ) { }
public BaseConfusionBlastPotion(PotionEffect effect) : base(0xF06, effect) { Hue = 0x48D; }
public override bool OnDragDrop(Mobile from, Item item) { if (item is BasePotion) { BasePotion pot = (BasePotion)item; if (m_Held == 0) { if (GiveBottle(from)) { m_Type = pot.PotionEffect; Held = 1; from.PlaySound(0x240); from.SendLocalizedMessage(502237); // You place the empty bottle in your backpack. item.Delete(); return(true); } else { from.SendLocalizedMessage(502238); // You don't have room for the empty bottle in your backpack. return(false); } } else if (pot.PotionEffect != m_Type) { from.SendLocalizedMessage(502236); // You decide that it would be a bad idea to mix different types of potions. return(false); } else if (m_Held >= 100) { from.SendLocalizedMessage(502233); // The keg will not hold any more! return(false); } else { if (GiveBottle(from)) { ++Held; item.Delete(); from.PlaySound(0x240); from.SendLocalizedMessage(502237); // You place the empty bottle in your backpack. item.Delete(); return(true); } else { from.SendLocalizedMessage(502238); // You don't have room for the empty bottle in your backpack. return(false); } } } else { from.SendLocalizedMessage(502232); // The keg is not designed to hold that type of object. return(false); } }
public BaseExplosionPotion(PotionEffect effect) : base(0xF0D, effect) { }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); switch ( version ) { case 1: case 0: { m_PotionEffect = (PotionEffect)reader.ReadInt(); break; } } if( version == 0 ) Stackable = Core.ML; }