void DisplayArmorType(bool isModifiable, ISArmor tempArmor)
        {
            string returnString = "";

            if(!_armorTypeOptionsLoaded && isModifiable)
            {
                return;
            }

            int itemIndex = 0;

            if(tempArmor.ArmorType != null)
            {
                itemIndex = _armorTypeDatabase.GetIndex(tempArmor.ArmorType.Name);
            }

            if(itemIndex == -1)
            {
                itemIndex = 0;
            }

            if(isModifiable)
            {
                _armorTypeSelectedIndex = EditorGUILayout.Popup ("Armor Type", itemIndex, _armorTypeOptions);
                tempArmor.ArmorType = _armorTypeDatabase.Get (_armorTypeSelectedIndex);
            }
            else
            {
                EditorGUILayout.LabelField("Armor Type", tempArmor.ArmorType.Name);
            }
        }
示例#2
0
 void CreateItemButton()
 {
     if (GUILayout.Button("Create " + itemType))
     {
         tempArmor   = new ISArmor();
         showDetails = true;
     }
 }
 void ListArmor()
 {
     for(int i = 0; i < _armorDatabase.Count; i++)
     {
         if(GUILayout.Button(_armorDatabase.Get(i).Name, GUILayout.Width(_listViewButtonWidth), GUILayout.Height(_listViewButtonHeight)))
         {
             _selectedIndex = i;
             _tempArmor   = new ISArmor(_armorDatabase.Get(i));
             displayState = DisplayState.DisplayDatabaseEntry;
         }
     }
 }
        bool IsArmorFormComplete(ISArmor tempArmor)
        {
            IsItemFormComplete (tempArmor);
            if(tempArmor.InventorySprite == null)
            {
                EditorUtility.DisplayDialog("Weapon not given an inventory sprite",
                                            "You must give the weapon an inventory sprite before saving.",
                                            "Okay");
                return false;
            }

            return true;
        }
        void EditArmor(ISArmor tempArmor)
        {
            EditCommonItem (tempArmor);

            tempArmor.ArmorRating 	= EditorGUILayout.IntField("Armor Rating", tempArmor.ArmorRating);
            if(tempArmor.ArmorRating < 0) tempArmor.ArmorRating = 0;

            tempArmor.MaxDurability = EditorGUILayout.IntField("Max Durability", tempArmor.MaxDurability);
            if(tempArmor.MaxDurability < 1) tempArmor.MaxDurability = 1;

            DisplayArmorType (true, tempArmor);
            DisplayArmorLocation (true, tempArmor);

            tempArmor.Prefab 		= EditorGUILayout.ObjectField ("Prefab", tempArmor.Prefab, typeof(GameObject), false) as GameObject;
        }
示例#6
0
        public void ListView()
        {
            _scrollPos = GUILayout.BeginScrollView(_scrollPos, "Box", GUILayout.ExpandHeight(true), GUILayout.Width(_listViewWidth));

            for (int i = 0; i < Database.Count; i++)
            {
                if (GUILayout.Button(Database.Get(i).Name, "box", GUILayout.Width(_listViewWidth - 10)))
                {
                    _selectedIndex = i;
                    tempArmor      = new ISArmor(Database.Get(i));
                    showDetails    = true;
                }
            }
            //       DisplayButtons();
            EditorGUILayout.EndScrollView();
        }
        void ViewArmor(ISArmor tempArmor)
        {
            ViewCommonItem (tempArmor);

            EditorGUILayout.LabelField("Max Durability", tempArmor.MaxDurability.ToString());
            EditorGUILayout.LabelField("Armor Rating", tempArmor.ArmorRating.ToString());

            DisplayArmorType (false, tempArmor);
            DisplayArmorLocation (false, tempArmor);

            if(_tempArmor.Prefab == null)
            {
                EditorGUILayout.LabelField ("Prefab", "Empty");
            }
            else
            {
                EditorGUILayout.LabelField ("Prefab", tempArmor.Prefab.name);
            }
        }
示例#8
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetButtonDown("Pause_Toggle"))
        {
            if (!CameraManipulation.x)
            {
                CameraManipulation.z     = false;
                CameraManipulation.pause = false;
            }
            if (CameraManipulation.x)
            {
                CameraManipulation.z = true;
            }
        }


        if (AlphaMenu.HaveLoaded)
        {
            for (int cnt = 1; cnt < GameInformation.Inv_A_T; cnt++)
            {
                ISArmor isa     = ADB.Get(GameInformation.Inventory_A_IDs[cnt]);
                Armor   myArmor = new Armor();
                myArmor.Name           = isa.Name;
                myArmor.ItemID         = I_A_ID;
                myArmor.Burden         = isa.ISBurden;
                myArmor.Equipment_Slot = isa.EquipmentSlot;
                myArmor.Min_Armor_Rate = (int)isa.Armor.x;
                myArmor.Max_Armor_Rate = (int)isa.Armor.y;
                myArmor.Durability     = isa.Durability;
                myArmor.Max_Durability = isa.MaxDurability;
                myArmor.Value          = isa.ISValue;
                GameInformation.InventoryArmors.Add(myArmor);
                inv_t++;
            }
            for (int cnt = 1; cnt < GameInformation.Inv_W_T; cnt++)
            {
                ISWeapon isw      = WDB.Get(GameInformation.Inventory_W_IDs[cnt]);
                Weapon   myWeapon = new Weapon();
                myWeapon.ItemID            = I_W_ID;
                myWeapon.Name              = isw.Name;
                myWeapon.Burden            = isw.ISBurden;
                myWeapon.Equipment_Slot    = isw.EquipmentSlot;
                myWeapon.Min_Damage        = isw.MinDamage;
                myWeapon.Durability        = isw.Durability;
                myWeapon.Max_Durability    = isw.MaxDurability;
                myWeapon.Value             = isw.ISValue;
                myWeapon.Equipment_Element = isw.EQElement;
                myWeapon.Equipment_Type    = isw.EquipmentType;
                myWeapon.Equipment_Range   = isw.EquipmentRange;
                GameInformation.InventoryWeapons.Add(myWeapon);
                inv_t++;
            }
            for (int cnt = 1; cnt < GameInformation.Inv_P_T; cnt++)
            {
                ISPotion isp      = PDB.Get(GameInformation.Inventory_P_IDs[cnt]);
                Potion   myPotion = new Potion();
                myPotion.Item_ID   = I_P_ID;
                myPotion.Value     = isp.ISValue;
                myPotion.Cool_Down = isp.CoolDownTime;
                myPotion.Max_Stack = isp.MaxStack;
                myPotion.Name      = isp.Name;
                GameInformation.InventoryPotions.Add(myPotion);
                inv_t++;
            }
            AlphaMenu.HaveLoaded = false;
        }
    }
示例#9
0
    void OnGUI()
    {
//			GUI.skin = PlayerUI;
//		GUI.Box (new Rect (Screen.width - 100,Screen.height - 50,100,50),"Body Count : " + GameInformation.BodyCount.ToString());


        // Variables
        bool IsDestruction_Magic  = false;
        bool IsDebuff_Magic       = false;
        bool IsSupport_Magic      = false;
        bool IsDefensive_Magic    = false;
        bool IsMelee_Offence      = false;
        bool IsMelee_Defence      = false;
        bool IsSurvival_Instincts = false;
        bool IsRanged_Offence     = false;
        bool IsRanged_Support     = false;
        bool IsExpertiseMenu      = true;

        //		//GuiFunctions inside the Expertise Menu
        GUILayout.BeginHorizontal("Box");
        GUILayout.BeginVertical( );

        GUILayout.Label("Max Expertise Points : " + GameInformation.Max_Expertise_Points.ToString());


        //Magic
        GUILayout.BeginHorizontal();
        GUILayout.Label("Destructive Magic : " + GameInformation.Magic_Offense.ToString());
        if (GUILayout.Button("+"))
        {
            if (!IsDestruction_Magic)
            {
                IsDestruction_Magic = true;
            }
        }
        GUILayout.EndHorizontal();
        GUILayout.BeginHorizontal();

        GUILayout.Label("Debuff Magic : " + GameInformation.Magic_Debuff.ToString());

        if (GUILayout.Button("+"))
        {
            if (!IsDebuff_Magic)
            {
                IsDebuff_Magic = true;
            }
        }
        GUILayout.EndHorizontal();
        GUILayout.BeginHorizontal();
        GUILayout.Label("Defensive Magic : " + GameInformation.Magic_Deffence.ToString());
        if (GUILayout.Button("+"))
        {
            if (!IsDefensive_Magic)
            {
                IsDefensive_Magic = true;
            }
        }
        GUILayout.EndHorizontal();
        GUILayout.BeginHorizontal();
        GUILayout.Label("Support Magic : " + GameInformation.Magic_Support.ToString());

        if (GUILayout.Button("+"))
        {
            if (!IsSupport_Magic)
            {
                IsSupport_Magic = true;
            }
        }
        GUILayout.EndHorizontal();
        GUILayout.BeginHorizontal();


        //Melee

        GUILayout.Label("Melee Tacttics : " + GameInformation.Melee_Offence.ToString());
        if (GUILayout.Button("+"))
        {
            if (!IsMelee_Offence)
            {
                IsMelee_Offence = true;
            }
            else
            {
                IsMelee_Offence = false;
            }
        }
        GUILayout.EndHorizontal();
        GUILayout.BeginHorizontal();
        GUILayout.Label("Defensive Techniques : " + GameInformation.Melee_Defence.ToString());
        if (GUILayout.Button("+"))
        {
            if (!IsMelee_Defence)
            {
                IsMelee_Defence = true;
            }
        }
        GUILayout.EndHorizontal();
        GUILayout.BeginHorizontal();
        //Ranged
        GUILayout.Label("Ranged Techniques : " + GameInformation.Ranged_Offence.ToString());

        if (GUILayout.Button("+"))
        {
            if (!IsRanged_Offence)
            {
                IsRanged_Offence = true;
            }
        }
        GUILayout.EndHorizontal();
        GUILayout.BeginHorizontal();
        GUILayout.Label("Ranged Support : " + GameInformation.Ranged_Support.ToString());
        if (GUILayout.Button("+"))
        {
            if (!IsRanged_Support)
            {
                IsRanged_Support = true;
            }
        }
        GUILayout.EndHorizontal();
        GUILayout.EndVertical();

        if (IsMelee_Offence)
        {
            GUILayout.BeginHorizontal( );
            GUILayout.Label("1st Strike ");
            if (GameInformation.Melee_Offence == 200)
            {
                GUILayout.Button("/");
            }
            else
            {
                GUILayout.Button("X");
            }
            GUILayout.EndHorizontal();
        }
        GUILayout.EndHorizontal();



        if (GUI.Button(new Rect(225, 175, Screen.width / 8, 20), "IncreaseLevel"))
        {
            AddExperience.AddExp();
        }

        if (GUI.Button(new Rect(225, 205, Screen.width / 8, 20), "Additem A"))
        {
            I_A_ID = Random.Range(0, ADB.Count);
            ISArmor    isa = ADB.Get(I_A_ID);
            GameObject A   = new GameObject();
            A.name = isa.Name;
            Armor myArmor = A.AddComponent <Armor>();
            myArmor.Name           = isa.Name;
            myArmor.ItemID         = I_A_ID;
            myArmor.Burden         = isa.ISBurden;
            myArmor.Equipment_Slot = isa.EquipmentSlot;
            myArmor.Min_Armor_Rate = (int)isa.Armor.x;
            myArmor.Max_Armor_Rate = (int)isa.Armor.y;
            myArmor.Durability     = isa.Durability;
            myArmor.Max_Durability = isa.MaxDurability;
            myArmor.Value          = isa.ISValue;
            GameInformation.InventoryArmors.Add(myArmor);
            inv_t++;
        }

        if (GUI.Button(new Rect(225, 225, Screen.width / 8, 20), "Additem W"))
        {
            I_W_ID = Random.Range(0, WDB.Count);
            ISWeapon isw      = WDB.Get(I_W_ID);
            Weapon   myweapon = new Weapon();
            myweapon.ItemID            = I_W_ID;
            myweapon.Name              = isw.Name;
            myweapon.Burden            = isw.ISBurden;
            myweapon.Equipment_Slot    = isw.EquipmentSlot;
            myweapon.Min_Damage        = isw.MinDamage;
            myweapon.Durability        = isw.Durability;
            myweapon.Max_Durability    = isw.MaxDurability;
            myweapon.Value             = isw.ISValue;
            myweapon.Equipment_Element = isw.EQElement;
            myweapon.Equipment_Type    = isw.EquipmentType;
            myweapon.Equipment_Range   = isw.EquipmentRange;
            GameInformation.InventoryWeapons.Add(myweapon);
            inv_t++;
        }
        if (GUI.Button(new Rect(225, 245, Screen.width / 8, 20), "Additem P"))
        {
            I_P_ID = Random.Range(0, PDB.Count);
            ISPotion isp      = PDB.Get(I_P_ID);
            Potion   myPotion = new Potion();
            myPotion.Item_ID   = I_P_ID;
            myPotion.Value     = isp.ISValue;
            myPotion.Cool_Down = isp.CoolDownTime;
            myPotion.Max_Stack = isp.MaxStack;
            myPotion.Name      = isp.Name;
            GameInformation.InventoryPotions.Add(myPotion);
            inv_t++;
        }
        GUILayout.BeginHorizontal();
        GUILayout.Space(150);
        GUILayout.Label("Inv");
        GUILayout.EndHorizontal();

        //PlayerStats
        GUILayout.BeginVertical("Box");
        if (GameInformation.Stat_Points > 0)
        {
            GUILayout.Label("Player Name : " + GameInformation.PlayerName);
            GUILayout.Label("Player Level : " + GameInformation.PlayerLevel.ToString());
            GUILayout.Label("Stat Points : " + GameInformation.Stat_Points.ToString());
            GUILayout.BeginHorizontal( );
            GUILayout.Label("Vitality : " + GameInformation.Vitality);

            if (GUILayout.Button("-"))
            {
                GameInformation.Vitality--;
                GameInformation.Stat_Points++;
                if (GameInformation.Vitality < 0)
                {
                    GameInformation.Stat_Points--;
                    GameInformation.Vitality++;
//							PlayerUIManager.StatAdjustment ();
                }
            }
            if (GUILayout.Button("+"))
            {
                GameInformation.Vitality++;
                GameInformation.Stat_Points--;
//						PlayerUIManager.StatAdjustment ();
            }
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal( );
            GUILayout.Label("Endurance : " + GameInformation.Endurance);

            if (GUILayout.Button("-"))
            {
                GameInformation.Endurance--;
                GameInformation.Stat_Points++;
                if (GameInformation.Endurance < 0)
                {
                    GameInformation.Stat_Points--;
                    GameInformation.Endurance++;
//							PlayerUIManager.StatAdjustment ();
                }
            }
            if (GUILayout.Button("+"))
            {
                GameInformation.Endurance++;
                GameInformation.Stat_Points--;
//						PlayerUIManager.StatAdjustment ();
            }
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal( );
            GUILayout.Label("Dexetry : " + GameInformation.Dexetry);

            if (GUILayout.Button("-"))
            {
                GameInformation.Dexetry--;
                GameInformation.Stat_Points++;
                if (GameInformation.Dexetry < 0)
                {
                    GameInformation.Stat_Points--;
                    GameInformation.Dexetry++;
                }
            }
            if (GUILayout.Button("+"))
            {
                GameInformation.Dexetry++;
                GameInformation.Stat_Points--;
            }

            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal( );
            GUILayout.Label("Intellect : " + GameInformation.Intellect);

            if (GUILayout.Button("-"))
            {
                GameInformation.Intellect--;
                GameInformation.Stat_Points++;
                if (GameInformation.Intellect < 0)
                {
                    GameInformation.Stat_Points--;
                    GameInformation.Intellect++;
//							PlayerUIManager.StatAdjustment ();
                }
            }
            if (GUILayout.Button("+"))
            {
                GameInformation.Intellect++;
                GameInformation.Stat_Points--;
//						PlayerUIManager.StatAdjustment ();
            }
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal( );
            GUILayout.Label("Strenght : " + GameInformation.Strength);

            if (GUILayout.Button("-"))
            {
                GameInformation.Strength--;
                GameInformation.Stat_Points++;
                if (GameInformation.Strength < 0)
                {
                    GameInformation.Stat_Points--;
                    GameInformation.Strength++;
                }
            }
            if (GUILayout.Button("+"))
            {
                GameInformation.Strength++;
                GameInformation.Stat_Points--;
            }
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal( );
            GUILayout.Label("Aim : " + GameInformation.Aim);

            if (GUILayout.Button("-"))
            {
                GameInformation.Aim--;
                GameInformation.Stat_Points++;
                if (GameInformation.Aim < 0)
                {
                    GameInformation.Stat_Points--;
                    GameInformation.Aim++;
                }
            }
            if (GUILayout.Button("+"))
            {
                GameInformation.Aim++;
                GameInformation.Stat_Points--;
            }
            GUILayout.EndHorizontal();
            GUILayout.Label("Money : " + GameInformation.Currency.ToString());
            GUILayout.Label("RequiredXp : " + GameInformation.RequiredXP.ToString());
            GUILayout.Label("Current Xp : " + GameInformation.CurrentXp.ToString());
            GUILayout.EndVertical();
        }


        //Statpoints Controls if stat points reach zero
        if (GameInformation.Stat_Points == 0)
        {
            GUILayout.Label("Player Name : " + GameInformation.PlayerName);
            GUILayout.Label("Player Level : " + GameInformation.PlayerLevel.ToString());
            GUILayout.Label("Stat Points : " + GameInformation.Stat_Points.ToString());
            GUILayout.BeginHorizontal( );
            GUILayout.Label("Vitality : " + GameInformation.Vitality);

            if (GUILayout.Button("-"))
            {
                GameInformation.Vitality--;
                GameInformation.Stat_Points++;
                if (GameInformation.Vitality < 0)
                {
                    GameInformation.Stat_Points--;
                    GameInformation.Vitality++;
                }
            }
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal( );
            GUILayout.Label("Endurance : " + GameInformation.Endurance);

            if (GUILayout.Button("-"))
            {
                GameInformation.Endurance--;
                GameInformation.Stat_Points++;

                if (GameInformation.Endurance < 0)
                {
                    GameInformation.Stat_Points--;
                    GameInformation.Endurance++;
                }
            }
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal( );
            GUILayout.Label("Dexetry : " + GameInformation.Dexetry);

            if (GUILayout.Button("-"))
            {
                GameInformation.Dexetry--;
                GameInformation.Stat_Points++;
                if (GameInformation.Dexetry < 0)
                {
                    GameInformation.Stat_Points--;
                    GameInformation.Dexetry++;
                }
            }
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal( );
            GUILayout.Label("Intellect : " + GameInformation.Intellect);

            if (GUILayout.Button("-"))
            {
                GameInformation.Intellect--;
                GameInformation.Stat_Points++;
                if (GameInformation.Intellect < 0)
                {
                    GameInformation.Stat_Points--;
                    GameInformation.Intellect++;
                }
            }
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal( );
            GUILayout.Label("Strength : " + GameInformation.Strength);

            if (GUILayout.Button("-"))
            {
                GameInformation.Strength--;
                GameInformation.Stat_Points++;
                if (GameInformation.Strength < 0)
                {
                    GameInformation.Stat_Points--;
                    GameInformation.Strength++;
                }
            }
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal( );
            GUILayout.Label("Aim : " + GameInformation.Aim);

            if (GUILayout.Button("-"))
            {
                GameInformation.Aim--;
                GameInformation.Stat_Points++;
                if (GameInformation.Aim < 0)
                {
                    GameInformation.Stat_Points--;
                    GameInformation.Aim++;
                }
            }
            GUILayout.EndHorizontal();
            GUILayout.Label("Money : " + GameInformation.Currency.ToString());
            GUILayout.Label("RequiredXp : " + GameInformation.RequiredXP.ToString());
            GUILayout.Label("Current Xp : " + GameInformation.CurrentXp.ToString());

            GUILayout.EndVertical();
        }
        //PauseMenu Controls
        if (GUI.Button(new Rect(225, 305, Screen.width / 8, 20), "Resume"))
        {
            if (!CameraManipulation.x)
            {
                CameraManipulation.z     = false;
                CameraManipulation.pause = false;
            }
            if (CameraManipulation.x)
            {
                CameraManipulation.z = true;
            }
            PlayerUIManager.StatAdjustment();
        }
        if (GUI.Button(new Rect(225, 325, Screen.width / 8, 20), "Exit"))
        {
            Time.timeScale = 1;
            Application.LoadLevel("MainMenu");
            DestroyObject(gameObject);
        }
        if (GUI.Button(new Rect(225, 350, Screen.width / 8, 20), "Save"))
        {
            SaveInformation.Save();
            Debug.Log(GameInformation.RequiredXP);
        }

        WindowPlaceHolder = GUILayout.Window(WindowID, WindowPlaceHolder, _inventory, "Inventory");
    }
        void NullTempEntries()
        {
            _tempWeapon 					= null;
            _tempArmor						= null;
            _tempItem						= null;

            _tempQuality					= null;
            _tempQualityOld					= null;

            _tempWeaponType					= null;
            _tempWeaponTypeOld				= null;

            _tempAttackType					= null;
            _tempAttackTypeOld				= null;

            _tempArmorType					= null;
            _tempArmorTypeOld				= null;

            _tempArmorLocation				= null;
            _tempArmorLocationOld			= null;
        }