protected override void update_end(int temp_index)
 {
     Mult1.update();
     Mult2.update();
     WTA1.update();
     WTA2.update();
     Icon1.update();
     Icon2.update();
 }
        public override void draw(SpriteBatch sprite_batch)
        {
            sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);
            Window.draw(sprite_batch, -Loc);
            draw_data(sprite_batch);
            sprite_batch.End();

            Icon1.draw(sprite_batch, -Loc);
            Icon2.draw(sprite_batch, -Loc);

            sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);
            WTA1.draw(sprite_batch, -Loc);
            WTA2.draw(sprite_batch, -Loc);
            Mult1.draw(sprite_batch, -Loc);
            Mult2.draw(sprite_batch, -Loc);
            sprite_batch.End();
        }
        protected override void set_images()
        {
            Icon1.flash = false;
            Icon2.flash = false;
            Mult1.value = 0;
            Mult2.value = 0;
            WTA1.set_effectiveness(1);
            WTA2.set_effectiveness(1);
            Game_Unit         unit   = get_unit();
            Game_Actor        actor1 = unit.actor;
            Combat_Map_Object target =
                Global.game_map.attackable_map_object(this.target);
            Game_Unit  target_unit    = null;
            Game_Actor actor2         = null;
            bool       is_target_unit = false;

            if (target.is_unit())
            {
                is_target_unit = true;
                target_unit    = (Game_Unit)target;
                actor2         = target_unit.actor;
                Window.team2   = target_unit.team;
            }
            else
            {
                Window.team2 = target.team;
            }
            int distance = combat_distance(unit.id, this.target);

            // Get weapon data
            TactileLibrary.Data_Weapon weapon1 = actor1.weapon, weapon2 = null;
            if (is_target_unit)
            {
                weapon2 = actor2.weapon;
            }
            // Weapon triangle arrows
            WTA1.value = 0;
            WTA2.value = 0;
            WeaponTriangle tri = WeaponTriangle.Nothing;

            if (is_target_unit)
            {
                tri = Combat.weapon_triangle(unit, target_unit, weapon1, weapon2, distance);
            }
            if (tri != WeaponTriangle.Nothing)
            {
                WTA1.value = tri;
                if (weapon2 != null)
                {
                    WTA2.value = Combat.reverse_wta(tri);
                }
            }

            List <int?> combat_stats = get_combat_stats(unit.id, this.target, distance);

            Stats = new List <Sprite>();
            for (int i = 0; i < stat_rows * 2; i++)
            {
                RightAdjustedText text = new RightAdjustedText();
                Stats.Add(text);
                text.draw_offset = new Vector2(68 - (48 * (i / 4)), 4 + ((i % 4 + 1) * LINE_HEIGHT));
                text.SetFont(Config.UI_FONT, Global.Content, "Blue");
                text.text = "0";
            }
            // Sets first units's stats //
            Name1.draw_offset = new Vector2(44, 4);
            Name1.text        = actor1.name;
            Name1.offset      = new Vector2(Name1.text_width / 2, 0);
            // Multiplier
            Mult1.value = Mult1.get_multi(unit, target, weapon1, distance);
            // Icon
            Icon1.index   = weapon1.Image_Index;
            Icon1.texture = Global.Content.Load <Texture2D>(@"Graphics/Icons/" + weapon1.Image_Name);
            if (weapon1.effective_multiplier(unit, target_unit) > 1)
            {
                Icon1.flash = true;
            }
            float effectiveness = weapon1.effective_multiplier(unit, target_unit, false);

            WTA1.set_effectiveness((int)effectiveness,
                                   is_target_unit && target_unit.halve_effectiveness());
            // Hp
            if (actor1.hp >= Math.Pow(10, Global.BattleSceneConfig.StatusHpCounterValues))
            {
                ((RightAdjustedText)Stats[0]).text = "--";
            }
            else
            {
                ((RightAdjustedText)Stats[0]).text = actor1.hp.ToString();
            }
            // Dmg
            ((RightAdjustedText)Stats[1]).text = combat_stats[1].ToString();
            // Hit
            if (combat_stats[0] >= 100)
            {
                ((RightAdjustedText)Stats[2]).SetFont("Blue_100", Global.Content);
            }
            ((RightAdjustedText)Stats[2]).text = combat_stats[0].ToString();
            // Crt
            if (combat_stats[2] >= 100)
            {
                ((RightAdjustedText)Stats[3]).SetFont("Blue_100", Global.Content);
            }
            ((RightAdjustedText)Stats[3]).text = combat_stats[2].ToString();
            // Sets second units's stats //
            string name2 = is_target_unit ? actor2.name : target.name;

            Name2.draw_offset = new Vector2(28, 4 + (Window.rows + 1) * LINE_HEIGHT);
            Name2.offset      = new Vector2(Font_Data.text_width(name2, Config.UI_FONT) / 2, 0);
            Name2.text        = name2;
            // Icon
            if (weapon2 != null)
            {
                Target_Weapon.text        = weapon2.Name;
                Target_Weapon.draw_offset = new Vector2(
                    32 - Target_Weapon.text_width / 2, 4 + (Window.rows + 2) * LINE_HEIGHT);
                Icon2.index   = weapon2.Image_Index;
                Icon2.texture = Global.Content.Load <Texture2D>(@"Graphics/Icons/" + weapon2.Image_Name);
                if (weapon2.effective_multiplier(target_unit, unit) > 1)
                {
                    Icon2.flash = true;
                }
                effectiveness = weapon2.effective_multiplier(target_unit, unit, false);
                WTA2.set_effectiveness((int)effectiveness, unit.halve_effectiveness());
            }
            else
            {
                Target_Weapon.draw_offset = new Vector2(
                    32 - Font_Data.text_width("---", Config.UI_FONT) / 2, 4 + (Window.rows + 2) * LINE_HEIGHT);
                Target_Weapon.text = "---";
                Icon2.texture      = null;
            }
            // Hp
            //int target_hp = is_target_unit ? actor2.hp : ((Destroyable_Object)target).hp; //Debug

            if (target.hp >= Math.Pow(10, Global.BattleSceneConfig.StatusHpCounterValues))
            {
                ((RightAdjustedText)Stats[4]).text = "--";
            }
            else
            {
                ((RightAdjustedText)Stats[4]).text = target.hp.ToString();
            }
            if (is_target_unit && can_counter(unit, target_unit, weapon1, distance))
            {
                // Multiplier
                Mult2.value = Mult2.get_multi(target_unit, unit, weapon2, distance);
                // Dmg
                ((RightAdjustedText)Stats[5]).text = combat_stats[5].ToString();
                // Hit
                if (combat_stats[4] >= 100)
                {
                    ((RightAdjustedText)Stats[6]).SetFont("Blue_100", Global.Content);
                }
                ((RightAdjustedText)Stats[6]).text = combat_stats[4].ToString();
                // Crt
                if (combat_stats[6] >= 100)
                {
                    ((RightAdjustedText)Stats[7]).SetFont("Blue_100", Global.Content);
                }
                ((RightAdjustedText)Stats[7]).text = combat_stats[6].ToString();
            }
            else
            {
                ((RightAdjustedText)Stats[5]).text = "--";
                ((RightAdjustedText)Stats[6]).text = "--";
                ((RightAdjustedText)Stats[7]).text = "--";
            }
            refresh();
        }