public IGrabableItem CreatePotion(PotionItemData potion) { potion.Processed = true; var initializator = new PotionInitializer { PotionPower = potion.PotionPower }; return(builder.Factories.PotionFactories[currentDescriptor.InCategoryIndex].Create(initializator)); }
private IList <PotionItemData> ReadPotionsData(BinaryReader r) { var c = new PotionItemData[Data.PotionsCount]; for (int i = 0; i < Data.PotionsCount; i++) { c[i] = ParsePotionData(r); } return(c); }
private PotionItemData ParsePotionData(BinaryReader r) { var p = new PotionItemData(); p.NextObjectID = r.ReadUInt16(); ushort data = r.ReadUInt16(); p.IsImportant = (data >> 15) == 1; p.ItemTypeIndex = (data >> 8) & sevenBitsMask; p.PotionPower = data & eightBitsMask; return(p); }
private void OnWizardOtherButton() { Object selected = Selection.activeObject; if (Selection.activeObject.GetType() == typeof(PotionItemData)) { PotionItemData potion = selected as PotionItemData; potion.name = name; potion.description = description; potion.isQuestItem = isQuestItem; potion.strenght = strenght; potion.constitution = constitution; potion.intelligence = intelligence; potion.dexterity = dexterity; potion.life = life; potion.mana = mana; } }
private void OnWizardCreate() { PotionItemData potion = CreateInstance <PotionItemData>(); AssetDatabase.CreateAsset(potion, "Assets/Datas/Potions/" + name + ".asset"); potion.name = name; potion.description = description; potion.isQuestItem = isQuestItem; potion.strenght = strenght; potion.constitution = constitution; potion.intelligence = intelligence; potion.dexterity = dexterity; potion.life = life; potion.mana = mana; AssetDatabase.SaveAssets(); EditorUtility.FocusProjectWindow(); Selection.activeObject = potion; }
private void PotionField() { if (potionItem == null) { potionItem = CreateInstance <PotionItemData>(); } GUILayout.BeginHorizontal(); potionItem.name = EditorGUILayout.TextField("Potion name", potionItem.name); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); potionItem.description = EditorGUILayout.TextField("Potion description", potionItem.description); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); potionItem.isQuestItem = EditorGUILayout.Toggle("Is quest item", potionItem.isQuestItem); GUILayout.EndHorizontal(); GUILayout.Space(10); GUILayout.BeginHorizontal(); potionItem.weight = EditorGUILayout.IntSlider("Weight", potionItem.weight, 0, 999, GUILayout.ExpandWidth(false)); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); potionItem.value = EditorGUILayout.IntSlider("Value", potionItem.value, 0, 999, GUILayout.ExpandWidth(false)); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); potionItem.levelRequired = EditorGUILayout.IntSlider("Level required", potionItem.levelRequired, 0, 999, GUILayout.ExpandWidth(false)); GUILayout.EndHorizontal(); GUILayout.Space(10); //GUILayout.BeginHorizontal(); //potionItem.numberOfUse = EditorGUILayout.IntSlider("Number of use", potionItem.numberOfUse, 1, 99, GUILayout.ExpandWidth(false)); //GUILayout.EndHorizontal(); GUILayout.Space(10); GUILayout.BeginHorizontal(); potionItem.strenght = EditorGUILayout.IntSlider("Strenght", potionItem.strenght, 0, 99, GUILayout.ExpandWidth(false)); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); potionItem.constitution = EditorGUILayout.IntSlider("Constitution", potionItem.constitution, 0, 99, GUILayout.ExpandWidth(false)); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); potionItem.intelligence = EditorGUILayout.IntSlider("Intelligence", potionItem.intelligence, 0, 99, GUILayout.ExpandWidth(false)); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); potionItem.dexterity = EditorGUILayout.IntSlider("Dexterity", potionItem.dexterity, 0, 99, GUILayout.ExpandWidth(false)); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); potionItem.life = EditorGUILayout.IntSlider("Life", potionItem.life, 0, 99, GUILayout.ExpandWidth(false)); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); potionItem.mana = EditorGUILayout.IntSlider("Mana", potionItem.mana, 0, 99, GUILayout.ExpandWidth(false)); GUILayout.EndHorizontal(); GUILayout.Space(50); }
public ItemData CreatePotion(PotionItemData potion) { currentTile.GrabableItems.Add(potion); return(potion); }
private PotionItemData ParsePotionData(BinaryReader r) { var p = new PotionItemData(); p.NextObjectID = r.ReadUInt16(); ushort data = r.ReadUInt16(); p.IsImportant = (data >> 15) == 1; p.ItemTypeIndex = (data >> 8) & sevenBitsMask; p.PotionPower = data & eightBitsMask; return p; }
private IList<PotionItemData> ReadPotionsData(BinaryReader r) { var c = new PotionItemData[Data.PotionsCount]; for (int i = 0; i < Data.PotionsCount; i++) c[i] = ParsePotionData(r); return c; }