예제 #1
0
        public IGrabableItem CreatePotion(PotionItemData potion)
        {
            potion.Processed = true;
            var initializator = new PotionInitializer
            {
                PotionPower = potion.PotionPower
            };

            return(builder.Factories.PotionFactories[currentDescriptor.InCategoryIndex].Create(initializator));
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #4
0
        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;
            }
        }
예제 #5
0
        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;
        }
예제 #6
0
        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);
        }
예제 #7
0
 public ItemData CreatePotion(PotionItemData potion)
 {
     currentTile.GrabableItems.Add(potion);
     return(potion);
 }
예제 #8
0
        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;
        }
예제 #9
0
        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;
        }