Ejemplo n.º 1
0
 private void ClearCappedGrowths(
     int[] gainedStats, int[] currentLevelStats, int[] growths)
 {
     for (int i = 0; i < growths.Length; i++)
     {
         if (growths[i] >= 0)
         {
             // If the stat is already capped
             if (Actor.get_capped(i, gainedStats[i] + currentLevelStats[i]))
             {
                 growths[i] = 0;
             }
         }
         else
         {
             // If the stat is already 0
             if (Actor.stat(i) + gainedStats[i] + currentLevelStats[i] == 0)
             {
                 growths[i] = 0;
             }
         }
     }
 }
Ejemplo n.º 2
0
        protected override void set_images()
        {
            if (Mode != Staff_Target_Mode.Torch)
            {
                Game_Unit  unit     = get_unit();
                Game_Actor actor1   = unit.actor;
                Game_Unit  target   = Global.game_map.units[this.target];
                Game_Actor actor2   = target.actor;
                int        distance = Global.game_map.combat_distance(unit.id, target.id);
                // Get weapon data
                TactileLibrary.Data_Weapon weapon1 = actor1.weapon, weapon2 = actor2.weapon;
                // Map Sprite //
                Target_Sprite.texture = Scene_Map.get_team_map_sprite(target.team, target.map_sprite_name);
                Target_Sprite.offset  = new Vector2(
                    (Target_Sprite.texture.Width / Target_Sprite.frame_count) / 2,
                    (Target_Sprite.texture.Height / Target_Sprite.facing_count) - 8);
                Target_Sprite.mirrored = target.has_flipped_map_sprite;
                // Sets Name //
                Name.offset = new Vector2(-(32), -(8));
                Name.text   = actor2.name;

                var stats = new Calculations.Stats.CombatStats(
                    unit.id, target.id, distance: distance);
                var target_stats = new Calculations.Stats.CombatStats(
                    target.id, unit.id, distance: distance);
                Stats = new List <TextSprite>();
                // Healing
                if (Mode == Staff_Target_Mode.Heal)
                {
                    List <int> status_heal = unit.actor.weapon.healable_statuses(target);
                    Window.height = status_heal.Count > 0 ? 64 : 48;
                    for (int i = 0; i < 5; i++)
                    {
                        Stats.Add(i % 2 == 0 ? new RightAdjustedText() : new TextSprite());
                        Stats[i].offset = new Vector2(-(48 + ((i / 2) * 24)), -24);
                        Stats[i].SetFont(Config.UI_FONT, Global.Content, (i % 2 == 0 ? "Blue" : "White"));
                    }
                    bool hp_restore = unit.actor.weapon.Heals();
                    if (hp_restore)
                    {
                        Stats[1].text = "-";
                    }
                    Stats[3].text = "/";
                    if (hp_restore)
                    {
                        // Hp
                        Stats[0].text = actor2.hp.ToString();
                        // New Hp
                        Stats[2].text = Math.Min(actor2.hp + stats.dmg(), actor2.maxhp).ToString();
                    }
                    else
                    {
                        // Hp
                        Stats[2].text = actor2.hp.ToString();
                    }
                    // Max Hp
                    Stats[4].text = actor2.maxhp.ToString();
                    // Status
                    Status_Icons.Clear();
                    StatLabels[1].text = "";
                    if (status_heal.Count > 0)
                    {
                        StatLabels[1].SetFont(Config.UI_FONT);
                        StatLabels[1].text = "Cond";
                        for (int i = 0; i < status_heal.Count; i++)
                        {
                            Status_Icons.Add(new Status_Icon_Sprite());
                            Status_Icons[Status_Icons.Count - 1].texture = Global.Content.Load <Texture2D>(@"Graphics/Icons/Statuses");
                            Status_Icons[Status_Icons.Count - 1].size    = new Vector2(16, 16);
                            Status_Icons[Status_Icons.Count - 1].offset  = new Vector2(-(32 + (i * 16)), -40);
                            Status_Icons[Status_Icons.Count - 1].index   = Global.data_statuses[status_heal[i]].Image_Index;
                            Status_Icons[Status_Icons.Count - 1].counter = actor2.state_turns_left(status_heal[i]);
                        }
                    }
                }
                // Status Inflict
                else if (Mode == Staff_Target_Mode.Status_Inflict)
                {
                    for (int i = 0; i < 2; i++)
                    {
                        Stats.Add(new RightAdjustedText());
                        Stats[i].offset = new Vector2(-88, -(24 + i * 16));
                        Stats[i].SetFont(Config.UI_FONT, Global.Content, "Blue");
                    }
                    // Hp
                    Stats[0].text = target_stats.res().ToString();
                    // New Hp
                    Stats[1].text = Math.Min(100, stats.hit()).ToString();
                }
                // Barrier
                if (Mode == Staff_Target_Mode.Barrier)
                {
                    for (int i = 0; i < 3; i++)
                    {
                        Stats.Add(i % 2 == 0 ? new RightAdjustedText() : new TextSprite());
                        Stats[i].offset = new Vector2(-(48 + ((i / 2) * 24)), -24);
                        Stats[i].SetFont(Config.UI_FONT, Global.Content, (i % 2 == 0 ? "Blue" : "Yellow"));
                    }
                    Stats[1].text = "-";
                    // Res
                    Stats[0].text = (actor2.stat(Stat_Labels.Res) +
                                     target.temporary_stat_buff(TactileLibrary.Buffs.Res)).ToString();
                    // New Res
                    Stats[2].text = (actor2.stat(Stat_Labels.Res) +
                                     Constants.Combat.BARRIER_BONUS).ToString();
                }
                refresh();
            }
        }
Ejemplo n.º 3
0
 internal Actor_Metrics(Game_Actor actor)
 {
     Id        = actor.id;
     Name      = actor.is_generic_actor ? actor.name_full : Global.data_actors[actor.id].Name;
     ClassId   = actor.class_id;
     ClassName = actor.class_name_full;
     Level     = actor.level;
     Exp       = actor.exp;
     Hp        = actor.hp;
     Stats     = Enumerable.Range(0, Enum_Values.GetEnumCount(typeof(Stat_Labels))).Select(x => actor.stat(x)).ToArray();
     Items     = actor.items.Select(x => new Item_Data(x)).ToArray();
     ItemNames = actor.items.Select(x => x.non_equipment ? "-----" : x.name).ToArray();
     Supports  = new Dictionary <int, int>(actor.supports);
     Bond      = actor.bond;
     Lives     = actor.lives;
 }