Пример #1
0
        public void set_image(Game_Unit unit, Game_Unit target, int i)
        {
            TactileLibrary.Item_Data item_data = target.actor.items[i];
            if (item_data.non_equipment)
            {
                Icon.texture = null;
                Name.text    = "";
                Uses.text    = "";
                Slash.text   = "";
                Use_Max.text = "";
            }
            else
            {
                bool can_steal = unit.can_steal_item(target, i);
                TactileLibrary.Data_Equipment item = item_data.to_equipment;
                // Icon
                Icon.texture = Global.Content.Load <Texture2D>(@"Graphics/Icons/" + item.Image_Name);
                Icon.index   = item.Image_Index;
                // Name
                Name.text = item.Name;
                // Uses
                Uses.text    = item_data.Uses < 0 ? "--" : item_data.Uses.ToString();
                Slash.text   = "/";
                Use_Max.text = item.Uses < 0 ? "--" : item.Uses.ToString();

                set_text_color(can_steal);
            }
        }
Пример #2
0
        protected override void set_text(TactileLibrary.Data_Equipment item, bool battle_scene)
        {
            int x = 8;

            Got     = new TextSprite();
            Got.loc = new Vector2(x, 8);
            Got.SetFont(Config.UI_FONT, Global.Content,
                        battle_scene ? "CombatBlue" : "White");
            Got.text   = got_text();
            x         += Got.text_width;
            A_Name     = new TextSprite();
            A_Name.loc = new Vector2(x, 8);
            A_Name.SetFont(Config.UI_FONT, Global.Content,
                           battle_scene ? "CombatBlue" : "Blue");
            A_Name.text = aname_text(item.Name, item);
            x          += A_Name.text_width + 1;
            Icon.loc    = new Vector2(x, 8);
            x          += 17;
            Broke       = new TextSprite();
            Broke.loc   = new Vector2(x, 8);
            Broke.SetFont(Config.UI_FONT, Global.Content, "White");
            Broke.text = broke_text();
            x         += Broke.text_width;
            Width      = x + 8 + (x % 8 != 0 ? (8 - x % 8) : 0);
        }
Пример #3
0
        protected void set_text(TactileLibrary.Data_Equipment item, Game_Unit unit, bool battle_scene)
        {
            int x = 8;

            Icon.loc = new Vector2(x, 8);
            if (((TactileLibrary.Data_Item)item).Stat_Boost[(int)TactileLibrary.Boosts.WLvl] > 0 ||
                ((TactileLibrary.Data_Item)item).Stat_Boost[(int)TactileLibrary.Boosts.WExp] > 0)
            {
                var weapon = unit.actor.items[unit.actor.equipped - 1].to_weapon;
                x              += 16;
                WLvl_Icon       = new Weapon_Type_Icon();
                WLvl_Icon.index = unit.actor.valid_weapon_type_of(weapon).IconIndex;
                WLvl_Icon.loc   = new Vector2(x, 8);
            }
            x         += 17;
            A_Name     = new TextSprite();
            A_Name.loc = new Vector2(x, 8);
            A_Name.SetFont(Config.UI_FONT, Global.Content,
                           battle_scene ? "CombatBlue" : "White");
            A_Name.text = "" + ((TactileLibrary.Data_Item)item).Boost_Text;
            string pow = "";

            // Changes POW to relevant
            switch (unit.actor.power_type())
            {
            case Power_Types.Strength:
                pow = "Strength";
                break;

            case Power_Types.Magic:
                pow = "Magic";
                break;

            case Power_Types.Power:
                pow = "Power";
                break;
            }
            A_Name.text = Regex.Replace(A_Name.text, @"POW", pow);
            x          += Font_Data.text_width(A_Name.text, Config.UI_FONT) + 1;
            Broke       = new TextSprite();
            Width       = x + 8 + (x % 8 != 0 ? (8 - x % 8) : 0);
        }
Пример #4
0
        protected virtual void set_text(TactileLibrary.Data_Equipment item, bool battle_scene)
        {
            int x = battle_scene ? 23 : 8;

            A_Name     = new TextSprite();
            A_Name.loc = new Vector2(x, 8);
            A_Name.SetFont(Config.UI_FONT, Global.Content,
                           battle_scene ? "CombatBlue" : "Blue");
            A_Name.text = string.Format("{0} {1}", item.capitalizedArticle, item.Name);
            x          += A_Name.text_width;
            Icon.loc    = new Vector2(battle_scene ? 7 : 1 + x, 8);
            if (!battle_scene)
            {
                x += 15;
            }
            Broke     = new TextSprite();
            Broke.loc = new Vector2(x, 8);
            Broke.SetFont(Config.UI_FONT, Global.Content, "White");
            Broke.text = " broke!";
            x         += Broke.text_width;
            Width      = x + 8 + (x % 8 != 0 ? (8 - x % 8) : 0);
        }
Пример #5
0
 protected override string aname_text(string item_name, TactileLibrary.Data_Equipment item)
 {
     return(string.Format("{0} {1}", item.capitalizedArticle, item_name));
 }
Пример #6
0
 protected void set_icon(TactileLibrary.Data_Equipment item)
 {
     Icon         = new Item_Icon_Sprite();
     Icon.texture = Global.Content.Load <Texture2D>(@"Graphics/Icons/" + item.Image_Name);
     Icon.index   = item.Image_Index;
 }
Пример #7
0
        protected void refresh_battle_stats(bool just_stats)
        {
            if (!just_stats)
            {
                foreach (Item_Icon_Sprite icon in Weapon_Icons)
                {
                    icon.texture = null;
                }
                foreach (TextSprite name in Weapon_Names)
                {
                    name.text = "";
                }

                TactileLibrary.Data_Weapon weapon1 = null;
                TactileLibrary.Data_Weapon weapon2 = null;
                WTAs[0].value = 0;
                if (Global.scene.scene_type == "Scene_Dance" || Global.scene.scene_type == "Scene_Promotion")
                {
                    int item_index = -1;
                    if (Global.scene.scene_type == "Scene_Dance")
                    {
                        item_index = Global.game_state.dance_item;
                    }
                    else if (Global.scene.scene_type == "Scene_Promotion")
                    {
                        item_index = Global.game_state.item_used;
                    }
                    if (item_index > -1)
                    {
                        TactileLibrary.Item_Data      item_data = battler_1.actor.items[item_index];
                        TactileLibrary.Data_Equipment item1     = item_data.to_equipment;
                        Weapon_Icons[0].texture  = Global.Content.Load <Texture2D>(@"Graphics/Icons/" + item1.Image_Name);
                        Weapon_Icons[0].index    = item1.Image_Index;
                        Weapon_Names[0].offset.X = Font_Data.text_width(item1.full_name()) / 2;
                        Weapon_Names[0].text     = item1.full_name();
                    }

                    if (battler_2 != null)
                    {
                        WTAs[1].value = 0;
                        weapon2       = battler_2.actor.weapon;
                        if (weapon2 != null)
                        {
                            Weapon_Icons[1].texture  = Global.Content.Load <Texture2D>(@"Graphics/Icons/" + weapon2.Image_Name);
                            Weapon_Icons[1].index    = weapon2.Image_Index;
                            Weapon_Names[1].offset.X = Font_Data.text_width(weapon2.full_name()) / 2;
                            Weapon_Names[1].text     = weapon2.full_name();
                        }
                    }
                }
                else
                {
                    weapon1 = battler_1.actor.weapon;
                    Weapon_Icons[0].texture = Global.Content.Load <Texture2D>(@"Graphics/Icons/" + weapon1.Image_Name);
                    Weapon_Icons[0].index   = weapon1.Image_Index;
                    if (!(Data is Staff_Data) || ((Staff_Data)Data).attack_staff)
                    {
                        Weapon_Icons[0].flash = weapon1.effective_multiplier(battler_1, battler_2) > 1;
                    }
                    Weapon_Names[0].offset.X = Font_Data.text_width(weapon1.full_name()) / 2;
                    Weapon_Names[0].text     = weapon1.full_name();


                    if (battler_2 != null)
                    {
                        WTAs[1].value = 0;
                        weapon2       = battler_2.actor.weapon;
                        if (weapon2 != null)
                        {
                            Weapon_Icons[1].texture = Global.Content.Load <Texture2D>(@"Graphics/Icons/" + weapon2.Image_Name);
                            Weapon_Icons[1].index   = weapon2.Image_Index;
                            if (!(Data is Staff_Data) || ((Staff_Data)Data).attack_staff)
                            {
                                Weapon_Icons[1].flash = weapon2.effective_multiplier(battler_2, battler_1) > 1;
                            }
                            Weapon_Names[1].offset.X = Font_Data.text_width(weapon2.full_name()) / 2;
                            Weapon_Names[1].text     = weapon2.full_name();
                            // Attack Multiplier
                            if (!weapon1.is_staff())
                            {
                            }  // Mults[1].value = Mults[1].get_multi(battler_2, battler_1, weapon2); //Debug
                        }
                        if (!weapon1.is_staff())
                        {
                            // Weapon triangle arrows
                            WeaponTriangle tri = Combat.weapon_triangle(battler_1, battler_2, weapon1, weapon2, Data.Distance);
                            if (tri != WeaponTriangle.Nothing)
                            {
                                WTAs[0].value = tri;
                                if (weapon2 != null)
                                {
                                    WTAs[1].value = Combat.reverse_wta(tri);
                                }
                            }
                            // Attack Multiplier
                            //Mults[0].value = Mults[0].get_multi(battler_1, battler_2, weapon1); //Debug
                        }
                    }
                }
            }
            for (int i = 0; i < Stat_Imgs.Count; i++)
            {
                if (Stats[i] == null)
                {
                    Stat_Imgs[i].text = "--";
                }
                else if (Stats[i] < 0)
                {
                    Stat_Imgs[i].text = "--";
                }
                else
                {
                    Stat_Imgs[i].text = Stats[i].ToString();
                }
            }
        }
Пример #8
0
 protected virtual string aname_text(string item_name, TactileLibrary.Data_Equipment item)
 {
     return(string.Format("{0} {1}", item.article, item_name));
 }