public virtual void set_images(Game_Unit unit)
        {
            Atk.text = "--";
            Hit.text = "--";
            Crt.text = "--";

            BattlerStats stats  = new BattlerStats(unit.id);
            int          atkSpd = unit.atk_spd();

            if (unit.is_on_siege())
            {
                var siege = unit.items[Siege_Engine.SiegeInventoryIndex];
                if (siege.is_weapon)
                {
                    stats  = new BattlerStats(unit.id, siege.to_weapon);
                    atkSpd = unit.atk_spd(siege.to_weapon.Max_Range, siege.to_weapon);
                }
            }

            AtkSpd.text = atkSpd.ToString();

            if (stats.has_non_staff_weapon)
            {
                Atk.text = stats.dmg().ToString();
                Hit.text = stats.hit().ToString();
                Crt.text = stats.crt().ToString();
            }
        }
Esempio n. 2
0
        public override void set_images(Game_Unit unit)
        {
            Game_Actor actor = unit.actor;

            // Stats
            switch (actor.power_type())
            {
            case Power_Types.Strength:
                PowNode.set_label("Str");
                break;

            case Power_Types.Magic:
                PowNode.set_label("Mag");
                break;

            default:
                PowNode.set_label("Pow");
                break;
            }

            SiegeBg.visible = !unit.actor.is_full_items && unit.is_on_siege();

            // Refresh UI nodes
            refresh(unit);
        }
Esempio n. 3
0
        public void set_images(Game_Unit unit, bool full_inventory, bool drops_item)
        {
            Game_Actor actor = unit.actor;

            Icons.Clear();
            if (full_inventory)
            {
                Weapon_Name.text = "";
                int equipped = -1;
                // Show siege engine first if possible and inventory has space
                if (!actor.is_full_items && unit.is_on_siege())
                {
                    var siege = unit.items[Siege_Engine.SiegeInventoryIndex];
                    if (siege.is_weapon)
                    {
                        add_icon(siege, Siege_Engine.SiegeInventoryIndex,
                                 actor.num_items, false);
                    }
                }

                if (equipped_first() && actor.equipped != 0)
                {
                    equipped = actor.equipped - 1;
                    add_icon(actor.items[equipped], equipped, actor.num_items, drops_item);
                }
                for (int i = 0; i < actor.items.Count; i++)
                {
                    if (i == equipped)
                    {
                        continue;
                    }
                    add_icon(actor.items[i], i, actor.num_items, drops_item);
                }
            }
            else
            {
                if (actor.weapon == null)
                {
                    Weapon_Name.text = "Unarmed";
                }
                else
                {
                    Data_Weapon item = actor.weapon;
                    Weapon_Name.text = item.Name;
                    Icons.Add(new Item_Icon_Sprite());
                    if (Global.content_exists(@"Graphics/Icons/" + item.Image_Name))
                    {
                        Icons[Icons.Count - 1].texture = Global.Content.Load <Texture2D>(@"Graphics/Icons/" + item.Image_Name);
                    }
                    Icons[Icons.Count - 1].index   = item.Image_Index;
                    Icons[Icons.Count - 1].loc     = new Vector2(0, 0);
                    Icons[Icons.Count - 1].scissor = scissor();
                }
            }
        }