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();
            }
        }
示例#2
0
        public virtual void set_images(Game_Unit unit)
        {
            Hp1.text  = "--";
            Dmg1.text = "--";
            Hit1.text = "--";
            Crt1.text = "--";

            var stats = new BattlerStats(unit.id);

            Hp1.text   = unit.hp.ToString();
            ASpd1.text = unit.atk_spd().ToString();

            if (stats.has_non_staff_weapon)
            {
                Dmg1.text = stats.dmg().ToString();
                Hit1.text = stats.hit().ToString();
                Crt1.text = stats.crt().ToString();
            }

            Hp2.text   = "--";
            Dmg2.text  = "--";
            Hit2.text  = "--";
            Crt2.text  = "--";
            ASpd2.text = "--";

            var player_unit = Global.game_map.get_selected_unit();

            if (player_unit != null)
            {
                Hp2.text   = player_unit.hp.ToString();
                ASpd2.text = player_unit.atk_spd().ToString();

                if (player_unit.actor.weapon != null)
                {
                    if (!player_unit.actor.weapon.is_staff())
                    {
                        var combat = Combat.combat_stats(player_unit.id, unit.id, player_unit.min_range());

                        stats = new BattlerStats(player_unit.id);

                        Dmg2.text = combat[1].ToString();
                        Hit2.text = combat[0].ToString();
                        Crt2.text = combat[2].ToString();

                        Dmg1.text = "--";
                        Hit1.text = "--";
                        Crt1.text = "--";
                        if (combat[4] != null)
                        {
                            Dmg1.text = combat[5].ToString();
                            Hit1.text = combat[4].ToString();
                            Crt1.text = combat[6].ToString();
                        }
                    }
                }
            }
        }
示例#3
0
        public override void set_images(Game_Unit unit)
        {
            base.set_images(unit);

            var stats = new Calculations.Stats.BattlerStats(unit.id);

            Def.text  = stats.def().ToString();
            Res.text  = stats.res().ToString();
            Dod.text  = stats.dodge().ToString();
            ASpd.text = unit.atk_spd().ToString();
        }
示例#4
0
        public Unit_Page_4(Game_Unit unit)
        {
            var stats = new Calculations.Stats.BattlerStats(unit.id);

            // If the unit has a weapon equipped
            bool has_weapon = stats.has_weapon;
            // If said weapon is not a staff
            bool non_staff = stats.has_non_staff_weapon;

            // Atk
            Atk     = new RightAdjustedText();
            Atk.loc = new Vector2(24, 0);
            Atk.SetFont(Config.UI_FONT, Global.Content, "Blue");
            Atk.text = !non_staff ? "--" : stats.dmg().ToString();
            // Atk
            Hit     = new RightAdjustedText();
            Hit.loc = new Vector2(56, 0);
            Hit.SetFont(Config.UI_FONT, Global.Content, "Blue");
            Hit.text = !non_staff ? "--" : stats.hit().ToString();
            // Avoid
            Avoid     = new RightAdjustedText();
            Avoid.loc = new Vector2(88, 0);
            Avoid.SetFont(Config.UI_FONT, Global.Content, "Blue");
            Avoid.text = stats.avo().ToString();
            // Crit
            Crit     = new RightAdjustedText();
            Crit.loc = new Vector2(120, 0);
            Crit.SetFont(Config.UI_FONT, Global.Content, "Blue");
            Crit.text = !non_staff ? "--" : stats.crt().ToString();
            // Dod
            Dod     = new RightAdjustedText();
            Dod.loc = new Vector2(144, 0);
            Dod.SetFont(Config.UI_FONT, Global.Content, "Blue");
            Dod.text = stats.dodge().ToString();
            // AS
            AS     = new RightAdjustedText();
            AS.loc = new Vector2(176, 0);
            AS.SetFont(Config.UI_FONT, Global.Content, "Blue");
            AS.text = unit.atk_spd().ToString();
            // Rng
            Rng = new RightAdjustedText();
            Rng.SetFont(Config.UI_FONT, Global.Content, "Blue");
            if (!has_weapon)
            {
                Rng.loc  = new Vector2(212, 0);
                Rng.text = "--";
            }
            else
            {
                int min_range = unit.min_range();
                int max_range = unit.max_range();
                if (unit.actor.weapon.Mag_Range)
                {
                    Rng.loc  = new Vector2(216, 0);
                    Rng.text = "Mag/2";
                }
                else if (min_range == max_range)
                {
                    Rng.loc  = new Vector2(208, 0);
                    Rng.text = min_range.ToString();
                }
                else
                {
                    Rng.loc  = new Vector2(216, 0);
                    Rng.text = min_range.ToString() + "-" + max_range.ToString();
                }
            }
        }