public BrewingState( Mobile brewer, BaseTool tool ) { m_Brewer = brewer; m_Tool = tool; m_Type = PotionType.Drink; // default potion type m_Bottle = 3626; }
public Potion(PotionType p, int level) { texture = 'P'; maxStackSize = 5; currentStackSize = 1; value = 10 * level; weight = 2; if (level < 2) { name = "Potion of " + p.ToString(); } else { name = "Potion of " + p.ToString() + " +" + level; } if (p == PotionType.Healing) { HealthIncrease += 100 * level; } else if (p == PotionType.Mana) { ManaIncrease += 100 * level; } else if (p == PotionType.Vigor) { StaminaIncrease += 100 * level; } }
public void ChangeColor(PotionType potionType) { var potionMaterial = ""; if (potionType == PotionType.NONE || potionType == PotionType.MISTAKE) { potionMaterial = "mistake"; } else if (potionType == PotionType.GREEN) { potionMaterial = "greenMat"; } else if (potionType == PotionType.BLUE) { potionMaterial = "blueMat"; } else if (potionType == PotionType.RED) { potionMaterial = "redMat"; } //change potion material GetComponent <Renderer>().material = Resources.Load(potionMaterial, typeof(Material)) as Material; //change bubble material //bubbles.GetComponent<Renderer>().material = Resources.Load(potionMaterial, typeof(Material)) as Material; //change splash material //splash.GetComponent<Renderer>().material = Resources.Load(potionMaterial, typeof(Material)) as Material; }
public void TogglePotion(string potionTypeStr) { PotionType potion = Utils.ParseEnum <PotionType>(potionTypeStr); CurrentPlayer.TogglePotion(potion); UnlockAchievement(ACHIEVEMENT_SWITCH_POTIONS); }
public Item(int id, string name, PotionType type, int price, EffectStrength es) { this.id = id; this.name = name; this.price = price; switch (type) { case PotionType.health: effect = new HealthEffect(); break; case PotionType.buff: effect = new BuffEffect(); break; case PotionType.damage: effect = new DamageEffect(); break; default: effect = new HealthEffect(); break; } this.es = es; }
private void OnTriggerEnter(Collider otherCollider) { Cauldron cauldron = otherCollider.GetComponent <Cauldron>(); if (cauldron != null && cauldron.GetPotionType() != PotionType.NONE) { type = cauldron.GetPotionType(); cauldron.Reset(); Debug.Log("The cauldron is of type: " + cauldron.GetPotionType()); Debug.Log("This bottle is now of type " + type); switch (type) { case PotionType.GREEN: ChangeColor("greenMat"); break; case PotionType.BLUE: ChangeColor("blueMat"); break; case PotionType.RED: ChangeColor("redMat"); break; case PotionType.MISTAKE: ChangeColor("mistake"); break; default: ChangeColor("default"); break; } } }
IEnumerator AnimatePotion(PotionType potionType) { PlayerAvatar avatar = CurrentPlayer.PlayerAvatar; Sprite potionSprite = CardTextures.PotionSpriteLookup[potionType]; avatar.PotionSprite = potionSprite; avatar.ShowPotionImage = true; switch (potionType) { case PotionType.FrekenKraken: yield return(AnimateFrekenKrakenCR()); break; case PotionType.TemptressShield: yield return(AnimateTemptressShieldCR()); break; case PotionType.BasicSword: yield return(AnimateBasicSwordCR()); break; } avatar.ShowPotionImage = false; }
public void PotionUse(int currentHealth, int maxHealth, PotionType potion) { double healingPoint; switch ((int)potion) { case 0: healingPoint = Math.Floor(maxHealth * 0.3); currentHealth += (int)healingPoint; if (currentHealth > maxHealth) { currentHealth = maxHealth; } return; case 1: healingPoint = Math.Floor(maxHealth * 0.5); currentHealth += (int)healingPoint; if (currentHealth > maxHealth) { currentHealth = maxHealth; } return; case 2: currentHealth = maxHealth; return; } }
public Potion(string name) { Name = name; if (name.ToUpper().Contains("HEALTH")) { Type = PotionType.Health; Boost = (int)HealthBoost.Low; } if (name.ToUpper().Contains("STRENGTH")) { Type = PotionType.Strength; Boost = (int)DefenseBoost.Low; } if (name.ToUpper().Contains("DEFENSE")) { Type = PotionType.Defense; Boost = (int)DefenseBoost.Low; } if (name.ToUpper().Contains("SPEED")) { Type = PotionType.Speed; Boost = 1; } }
public PotionData GetPotionData(PotionType type, PotionSize size) { switch (type) { case PotionType.Health: return(new HealthPotionData(size)); case PotionType.Mana: return(new ManaPotionData(size)); case PotionType.Restoration: return(new RestorationPotionData(size)); case PotionType.Stamina: return(new StaminaPotionData(size)); case PotionType.Paralyze: return(new ParalyzePotionData(size)); case PotionType.Freeze: return(new FreezePotionData(size)); case PotionType.Hunger: return(new HungerPotionData(size)); case PotionType.Blind: return(new BlindPotionData(size)); default: throw new ArgumentException($"Unknown potion type: {type}", nameof(type)); } }
void Brew() { potionType = recipeBook.GetBrewingResult(ingredients); ingredients.Clear(); Debug.Log("Potion type is " + potionType); gameObject.GetComponent <Potion>().ChangeColor(potionType); }
/// <summary> // /// </summary> /// <param name="potionType"></param> public Potion(PotionType potionType) { this.id = PotionsConstants.CurrentId; PotionsConstants.CurrentId++; this.xpBonus = PotionsConstants.DefaultStat; this.healthBonus = PotionsConstants.DefaultStat; this.damageBonus = PotionsConstants.DefaultStat; this.marketPrice = PotionsConstants.MarketPrice; this.sellPrice = PotionsConstants.ResellPrice; this.type = potionType; switch (potionType) { case PotionType.HealthPotion: this.healthBonus = GenerataRandomValue(PotionType.HealthPotion); break; case PotionType.XpPotion: this.xpBonus = GenerataRandomValue(PotionType.XpPotion); break; case PotionType.BonusDamagePotion: this.damageBonus = GenerataRandomValue(PotionType.BonusDamagePotion); break; default: break; } }
/// <summary> /// Creates a (base) instance of Potion/ /// </summary> /// <param name="aType">The type of potion</param> /// <param name="aName">The name of the potion.</param> /// <param name="aColor">The color of the potion.</param> public Potion(PotionType aPotionType, PotionStrength aPotionStrength, string aName, Colour aColor) : base(ItemType.Potion, aName, '!', aColor) { PotionType = aPotionType; PotionStrength = aPotionStrength; }
public static Potion FromDamage(int damage) { PotionType type = PotionTypeHelper.GetByDamageValue(damage & POTION_BIT); Potion potion; if (type == null || (type == PotionType.Water && damage != 0)) { potion = new Potion(damage & NAME_BIT); } else { int level = (damage & TIER_BIT) >> TIER_SHIFT; level++; potion = new Potion(type, level); } if ((damage & SPLASH_BIT) > 0) { potion = potion.Splash(); } if ((damage & EXTENDED_BIT) > 0) { potion = potion.Extend(); } return(potion); }
public ISPotion() { _effect = 0; _prefab = null; potionType = PotionType.None; }
public Potion(PotionType theType) : base(ItemType.Potion) { potionType = theType; stackable = true; name = ""; switch (theType) { case PotionType.Health: texture = GameManager.GetInstance().GetTexture(@"Items\potion-red"); name = "dark red"; break; case PotionType.Magic: texture = GameManager.GetInstance().GetTexture(@"Items\potion-blue"); name = "swirly blue"; break; case PotionType.Poison: texture = GameManager.GetInstance().GetTexture(@"Items\potion-green"); name = "bubbly green"; break; case PotionType.Speed: texture = GameManager.GetInstance().GetTexture(@"Items\potion-orange"); name = "fizzy orange"; break; } name += " potion"; }
private string GetUnknownPotionText() { List <PotionType> unknownTypes = GetUnknownPotionTypes(); type = unknownTypes[Random.Range(0, unknownTypes.Count())]; switch ((PotionType)type) { case PotionType.WHITE: return("Ghost White Potion"); case PotionType.RED: return("Blood Red Potion"); case PotionType.GREEN: return("Emerald Green Potion"); case PotionType.YELLOW: return("Canary Yellow Potion"); case PotionType.BROWN: return("Mud Brown Potion"); case PotionType.PURPLE: return("Royal Purple Potion"); case PotionType.BLUE: return("Sky Blue Potion"); case PotionType.ORANGE: return("Orange Potion"); default: return("What?!?!?"); } }
public void Clone(ISPotion potion) { base.Clone(potion); _effect = potion.EffectAmount; potionType = potion.potionType; _prefab = potion.Prefab; }
public void ReInit() { potionType = potionTypes[UnityEngine.Random.Range(0, potionTypes.Count)]; icon = potionType.icon; meshRenderer.material.color = potionType.color; boxCollider.enabled = true; isTaken = false; }
public void Reset() { Debug.Log("Resetting cauldron."); potionType = PotionType.NONE; ingredients.Clear(); Debug.Log("Potion component: " + gameObject.GetComponent <Potion>()); gameObject.GetComponent <Potion>().Reset(); }
public static Potion GeneratePotion() { var values = Enum.GetValues(typeof(PotionType)); var random = new Random(); PotionType randomType = (PotionType)values.GetValue(random.Next(values.Length)); return(new Potion(randomType)); }
private bool IsBuffActive(PotionType type) { return((from potion in potions where potion.TypeList.Contains(type) from buff in ObjectManager.Player.Buffs where buff.Name == potion.Name && buff.IsActive select potion).Any()); }
public Potion(SaveData data) : base(data) { color = (PotionColor)data.GetIntValue(SaveKeyColor); type = (PotionType)data.GetIntValue(SaveKeyType); size = (PotionSize)data.GetIntValue(SaveKeySize); potionData = DataFactory.GetPotionData(type, size); }
public static System.Action <int, int> NewSetPriceCallback(PotionType PotionType) { return((int delta, int newValue) => { GameData.singleton.potionPrices[(int)PotionType] = newValue; Debug.Log("Selling " + PotionType + " for " + GameData.singleton.potionPrices[(int)PotionType]); }); }
private static bool IsBuffActive(PotionType type) { return((from potion in _potions where potion.TypeList.Contains(type) from buff in MyHero.Buffs where buff.Name == potion.Name && buff.IsActive select potion).Any()); }
private static void CastPotion(PotionType type) { var itemSlot = Player.InventoryItems.FirstOrDefault(item => item.Id == (type == PotionType.Health ? ItemId.Health_Potion : ItemId.Mana_Potion) || (item.Id == (ItemId)2010) || (item.Id == ItemId.Crystalline_Flask && item.Charges > 0)); if (itemSlot != null) { Player.Spellbook.CastSpell(itemSlot.SpellSlot, Player); } }
public Potion(PotionType type, int level) : this(type) { Debug.Assert(type != default(PotionType), "Type cannot be null"); Debug.Assert(type != PotionType.Water, "Water bottles don't have a level!"); Debug.Assert(level > 0 && level < 3, "Level must be 1 or 2"); this.level = level; }
public void itemAbility() { if (item != PotionType.NONE) { SendMessage("usePotion", this); item = PotionType.NONE; } }
// CONSTRUCTORS public Potion(bool instantiating, byte graphic = 235, ItemType type = ItemType.Potion, double volume = 0.016, bool hollow = false, DamageType damageType = DamageType.Blunt) : base(graphic, type, volume, hollow, damageType) { potionType = DeterminePotionType(); ForeColor = Program.Identification.PotionColors[potionType]; effect = DetermineEffect(); Rarity = DetermineRarity(); }
public Potion(string assetName, PotionType potionType, PotionPower potionPower, int stackCount = 1, int stackSize = 10, int layer = 0) : base(assetName, stackSize, layer) { this.potionType = potionType; this.potionPower = potionPower; this.stackCount = stackCount; setPotionPower(); SetId(); }
private InventorySlot GetPotionSlot(PotionType type) { return((from potion in potions where potion.TypeList.Contains(type) from item in ObjectManager.Player.InventoryItems where item.Id == potion.ItemId && item.Charges >= potion.MinCharges select item).FirstOrDefault()); }
/// <summary> /// The structure that defines potions. /// </summary> /// <param name="potionName">The name of the potion.</param> /// <param name="potionType">The type of status potion.</param> /// <param name="statAdjustment">The status asjustment applied.</param> /// <param name="description">The description of the potion.</param> /// <param name="damage">The damaged caused by the potion.</param> public Potion(string potionName, PotionType potionType, double statAdjustment, string description, double damage = 0) { Name = potionName; Description = description; Type = potionType; StatAdjustment = statAdjustment; Damage = damage; }
private static InventorySlot GetPotionSlot(PotionType type) { return((from potion in _potions where potion.TypeList.Contains(type) from item in MyHero.InventoryItems where item.Id == potion.ItemId && item.Charges >= potion.MinCharges select item).FirstOrDefault()); }
private static bool IsBuffActive(PotionType type) { return (from potion in _potions where potion.TypeList.Contains(type) from buff in MyHero.Buffs where buff.Name == potion.Name && buff.IsActive select potion).Any(); }
private InventorySlot GetPotionSlot(PotionType type) { return (from potion in _potions where potion.TypeList.Contains(type) from item in ObjectManager.Player.InventoryItems where item.Id == potion.ItemId && item.Charges >= potion.MinCharges select item).FirstOrDefault(); }
private bool IsBuffActive(PotionType type) { return (from potion in potions where potion.TypeList.Contains(type) from buff in ObjectManager.Player.Buffs where buff.Name == potion.Name && buff.IsActive select potion).Any(); }
public static bool IsInstant(this PotionType type) { var attrib = type.GetAttribute <PotionTypeInfoAttribute>(); var effect = attrib.Effect; var et = PotionEffectType.GetById(effect); return(et == null || et.IsInstant()); }
private bool IsBuffActive(PotionType type) { return (_potions.Where(potion => potion.TypeList.Contains(type)) .Any( potion => ObjectManager.Player.Buffs.Any( b => b.Name.Equals(potion.BuffName, StringComparison.OrdinalIgnoreCase)))); }
public Potion(PotionType type) { this.PotionType = type; this.IsEquippable = false; this.IsEquipped = false; this.BaseValue = 200; //TODO PROPERLY LATER this.Category = InventoryCategory.POTION; this.Stackable = false; this.TotalAmount = 1; }
public void setPotionType (PotionType type) { base.init(); this.type = type; setDescription(type.getDescription()); switch (type) { case PotionType.HEALTH: setSprite(health); break; case PotionType.ARMOR: setSprite(armor); break; case PotionType.AGILITY: setSprite(agility); break; case PotionType.STRENGTH: setSprite(strength); break; default: Debug.Log("Unknown Potion Type"); break; } }
public HealingPotion(PotionType type) { if (type == PotionType.Regular) { AmountToHeal = 30; } if (type == PotionType.Lesser) { AmountToHeal = 15; } if (type == PotionType.Greater) { AmountToHeal = 45; } }
public StrBuffPotion(PotionType type) { if (type == PotionType.Lesser) { AmountStrBuffed = 5; DurationInTurns = 3; } if (type == PotionType.Regular) { AmountStrBuffed = 10; DurationInTurns = 5; } if (type == PotionType.Greater) { AmountStrBuffed = 15; DurationInTurns = 8; } }
public void LearnToIdentify(PotionType type) { potionIdentification.Add(new PotionIdentification() { PotionType = type }); //Go through each potion within the actor's inventory and see if there's a new type foreach(var potion in this.Actor.Inventory.Inventory.GetObjectsByGroup(InventoryCategory.POTION)) { if (potion.GetType() == typeof(Potion)) { //Was it unknown? var cPotion = potion as Potion; if (!cPotion.IsIdentified && cPotion.PotionType == type) { cPotion.IsIdentified = true; } } } }
public Potion(PotionType potionType, string name, int points) { this.potionType = potionType; this.points = points; this.name = name; }
public static bool isPotionAlreadyDrinked (PotionType type) { return drinkedPotions[type]; }
private bool IsBuffActive(PotionType type) { return _potions.Where(potion => potion.TypeList.Contains(type)) .Any(potion => ObjectManager.Player.IsBuffActive(potion.BuffName)); }
public int ReadFormula( AlchemicalFormula formula ) { m_Name = formula.PotionName; m_Type = formula.PotionType; m_Bottle = formula.Bottle; Array.Copy( formula.IngredientTypes, m_IngredientTypes, m_IngredientTypes.Length ); for ( int i=0; i<m_IngredientTypes.Length; i++ ) { if ( m_IngredientTypes[i] == null ) continue; Item instance = (Item)Activator.CreateInstance(m_IngredientTypes[i]); // saves us some space if (!(instance is IAlchemyIngredient)) return -2; IAlchemyIngredient alchemyingredient = instance as IAlchemyIngredient; switch ( (int)m_Type ) { case (int)PotionType.Drink: { if ( !(instance is IDrinkIngredient) || !((IDrinkIngredient)instance).CanUse( m_Brewer )) return -1; // don't know how to use that ingredient break; } case (int)PotionType.Bomb: { if ( !(instance is IBombIngredient) || !((IBombIngredient)instance).CanUse( m_Brewer )) return -1; // don't know how to use that ingredient break; } case (int)PotionType.Oil: { if ( !(instance is IOilIngredient) || !((IOilIngredient)instance).CanUse( m_Brewer )) return -1; // don't know how to use that ingredient break; } } m_IngredientPictures[i] = instance.ItemID; m_IngredientHues[i] = instance.Hue; AddIngredient( m_IngredientTypes[i], true ); // skip update } UpdateEffects(); return 1; // success }
public void DisplayPotionType() { potionType = (PotionType)EditorGUILayout.EnumPopup("Potion Type", potionType); }
public Potion(string name, int potency, PotionType type = PotionType.None) : base(name) { Type = type; Potency = potency; }
protected Potion(string id, decimal price, double weight, int bonus, PotionType type) : base(id, price, weight) { this.PotionType = type; this.Bonus = bonus; }
public Potion(string setName, PotionType setType) { name = setName; type = setType; }
public Potion(string name, int points, PotionType type) { this.name = name; this.points = points; this.potionType = type; }
private static void CastPotion(PotionType type) { try { player.Spellbook.CastSpell(player.InventoryItems.First( item => item.Id == (type == PotionType.Health ? (ItemId) 2003 : (ItemId) 2004) || (item.Id == (ItemId) 2010) || (item.Id == (ItemId) 2041 && item.Charges > 0)).SpellSlot); } catch (Exception) { } }
public bool UsePotion(PotionType type) { bool flag = Engine.UsePotion(type); if (!flag) { Engine.AddTextMessage(string.Format("You do not have any {0} potions!", type.ToString().ToLower()), Engine.DefaultFont, Hues.Load(0x22)); } return flag; }
public bool CanIdentifyPotion(PotionType type) { return (potionIdentification.Any(pi => pi.PotionType == type)); }
public static bool UsePotion(PotionType type) { Mobile player = World.Player; if ((player != null) && !player.Ghost) { Item backpack = player.Backpack; if (backpack != null) { Item[] itemArray = backpack.FindItems(new ItemIDValidator(new int[] { 0xf06 + type })); int index = 0; while (index < itemArray.Length) { Item item2 = itemArray[index]; return item2.Use(); } } } return false; }
private static void LoginComplete(PacketReader pvSrc) { Music.Stop(); Engine.Unlock(); Engine.m_Loading = false; Engine.m_Ingame = true; Cursor.Hourglass = false; Gumps.Desktop.Children.Clear(); int gameWidth = Engine.GameWidth; int gameHeight = Engine.GameHeight; int num3 = gameWidth / 0x30; int num4 = gameHeight / 0x30; int num5 = (num3 * 0x30) - 4; int num6 = (num4 * 0x30) - 4; int num7 = (gameWidth - num5) / 2; int num8 = (gameHeight - num6) / 2; for (int i = 0; i < num3; i++) { Gumps.Desktop.Children.Add(new GSpellPlaceholder(num7 + (i * 0x30), -54)); Gumps.Desktop.Children.Add(new GSpellPlaceholder(num7 + (i * 0x30), (gameHeight + 6) + 4)); } for (int j = 0; j < num4; j++) { Gumps.Desktop.Children.Add(new GSpellPlaceholder(-54, num8 + (j * 0x30))); Gumps.Desktop.Children.Add(new GSpellPlaceholder((gameWidth + 6) + 4, num8 + (j * 0x30))); } Gumps.Desktop.Children.Add(new GSpellPlaceholder(-54, -54)); Gumps.Desktop.Children.Add(new GSpellPlaceholder((gameWidth + 6) + 4, -54)); Gumps.Desktop.Children.Add(new GSpellPlaceholder(-54, (gameHeight + 6) + 4)); Gumps.Desktop.Children.Add(new GSpellPlaceholder((gameWidth + 6) + 4, (gameHeight + 6) + 4)); Gumps.Desktop.Children.Add(new GDesktopBorder()); Gumps.Desktop.Children.Add(new GBandageTimer()); Gumps.Desktop.Children.Add(new GMapTracker()); Gumps.Desktop.Children.Add(new GQuestArrow()); Gumps.Desktop.Children.Add(new GPingDisplay()); Gumps.Desktop.Children.Add(new GParticleCounter()); Gumps.Desktop.Children.Add(new GTransparencyGump()); Reagent[] reagents = Spells.Reagents; int length = reagents.Length; if ((Engine.ServerFeatures != null) && !Engine.Features.AOS) { length = 8; } PotionType[] typeArray = new PotionType[] { PotionType.Yellow, PotionType.Orange, PotionType.Red, PotionType.Purple }; ItemIDValidator[] list = new ItemIDValidator[(length + 1) + typeArray.Length]; for (int k = 0; k < length; k++) { list[k] = new ItemIDValidator(new int[] { reagents[k].ItemID }); } for (int m = 0; m < typeArray.Length; m++) { list[length + m] = new ItemIDValidator(new int[] { 0xf06 + typeArray[m] }); } list[length + typeArray.Length] = new ItemIDValidator(new int[] { 0xe21, 0xee9 }); Gumps.Desktop.Children.Add(new GItemCounters(list)); CharData charData = World.CharData; Mobile player = World.Player; if ((player != null) && (player.Name.Length > 0)) { charData.Name = player.Name; } if ((Engine.m_ServerName != null) && (Engine.m_ServerName.Length > 0)) { charData.Shard = Engine.m_ServerName; } foreach (GumpLayout layout in charData.Layout) { switch (layout.Type) { case 0: { GSpellIcon toAdd = new GSpellIcon(layout.Extra - 1) { X = layout.X, Y = layout.Y }; Gumps.Desktop.Children.Add(toAdd); break; } case 1: if (!Engine.m_SkillsOpen) { Network.Send(new PQuerySkills()); Engine.m_SkillsOpen = true; Engine.m_SkillsGump = new GSkills(); Engine.m_SkillsGump.X = layout.X; Engine.m_SkillsGump.Y = layout.Y; Engine.m_SkillsGump.Width = layout.Width; Engine.m_SkillsGump.Height = layout.Height; Gumps.Desktop.Children.Add(Engine.m_SkillsGump); } break; case 2: { Mobile mobile2 = World.FindMobile(layout.Extra); if (mobile2 != null) { Network.Send(new POpenPaperdoll(mobile2.Serial)); mobile2.PaperdollX = layout.X; mobile2.PaperdollY = layout.Y; } break; } case 3: { Skill skill = Engine.Skills[layout.Extra]; if (skill != null) { GSkillIcon icon2 = new GSkillIcon(skill) { X = layout.X, Y = layout.Y }; Gumps.Desktop.Children.Add(icon2); } break; } } } charData.Save(); Engine.DrawNow(); Engine.StartPings(); Network.Send(new POpenPaperdoll()); World.Player.QueryStats(); }