protected override void set_images() { Game_Unit target = Global.game_map.units[this.target]; Window.rows = Math.Max(1, target.actor.num_items); Items.Clear(); for (int i = 0; i < Math.Max(1, target.actor.num_items); i++) { draw_item(target, i); } // Sets Name // Name.text = target.actor.name; // Map Sprite // if (target.is_rescued) { Rescue_Icon.visible = true; Rescue_Icon.src_rect = new Rectangle( (target.team - 1) * (Rescue_Icon.texture.Width / Constants.Team.NUM_TEAMS), 0, Rescue_Icon.texture.Width / Constants.Team.NUM_TEAMS, Rescue_Icon.texture.Height); Target_Sprite.texture = null; } else { Rescue_Icon.visible = false; 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; } refresh(); }
protected override void set_pages() { for (int i = 0; i < Team.Count; i++) { Game_Unit unit = Global.game_map.units[Team[i]]; Game_Actor actor = unit.actor; int y = i * Y_Per_Row; // Add map sprite Map_Sprites.Add(new Character_Sprite()); Map_Sprites[i].facing_count = 3; Map_Sprites[i].frame_count = 3; Map_Sprites[i].texture = Scene_Map.get_team_map_sprite(unit.team, unit.map_sprite_name); Map_Sprites[i].offset = new Vector2( (Map_Sprites[i].texture.Width / Map_Sprites[i].frame_count) / 2, (Map_Sprites[i].texture.Height / Map_Sprites[i].facing_count) - 8); Map_Sprites[i].loc = new Vector2(32, y + 16 + Offset_Y) + new Vector2(Unit_Scissor_Rect.X, Unit_Scissor_Rect.Y); Map_Sprites[i].stereoscopic = Config.UNIT_WINDOW_DEPTH; Map_Sprites[i].mirrored = unit.has_flipped_map_sprite; // Name Names.Add(new TextSprite()); Names[i].loc = new Vector2(40, y + Offset_Y) + new Vector2(Unit_Scissor_Rect.X, Unit_Scissor_Rect.Y); Names[i].SetFont(Config.UI_FONT, Global.Content, "White"); Names[i].text = unit.actor.name; Names[i].stereoscopic = Config.UNIT_WINDOW_DEPTH; // Page 1 Page_Imgs[0].Add(new SoloAnim_Page(unit)); Page_Imgs[0][i].loc = new Vector2(data_width * 0, y + Offset_Y) + new Vector2(Data_Scissor_Rect.X, Data_Scissor_Rect.Y); } }
internal void set_map_sprite_texture(int team, string name) { MapSprite.texture = Scene_Map.get_team_map_sprite(team, name); if (MapSprite.texture != null) { MapSprite.offset = new Vector2( (MapSprite.texture.Width / MapSprite.frame_count) / 2, (MapSprite.texture.Height / MapSprite.facing_count) - 8); } }
protected virtual void set_map_sprite_texture(bool deployed, string name) { int team = deployed ? Constants.Team.PLAYER_TEAM : 0; MapSprite.texture = Scene_Map.get_team_map_sprite(team, name); if (MapSprite.texture != null) { MapSprite.offset = new Vector2( (MapSprite.texture.Width / MapSprite.frame_count) / 2, (MapSprite.texture.Height / MapSprite.facing_count) - 8); } }
private void set_images() { if (Team_Windows.Count == 0) { Cursor.loc = TEAM_WINDOW_LOC; Cursor.height = 8; } else { Cursor.loc = Team_Windows[Index].loc; Cursor.height = (Groups[Index].Value + 1) * 16 + 8; } int leader_id = -1; if (Groups.Count > 0) { leader_id = Global.game_map.team_leaders[Groups[Index].Key]; } if (leader_id == -1 || Global.game_map.unit_defeated(leader_id) || Global.game_map.unit_escaped(leader_id)) { Leader_Name.text = ""; Lvl.text = "--"; Hp.text = "--"; Hp_Max.text = "--"; Rating.text = "--"; Map_Sprite.texture = null; Face.set_actor(""); LeaderWeapon.set_image(null, null); } else { Game_Unit unit = Global.game_map.units[leader_id]; Leader_Name.text = unit.actor.name; Leader_Name.offset.X = Leader_Name.text_width / 2; Lvl.text = unit.actor.level.ToString(); Hp.text = unit.actor.hp.ToString(); Hp_Max.text = unit.actor.maxhp.ToString(); Rating.text = unit.rating().ToString(); Map_Sprite.texture = Scene_Map.get_team_map_sprite(unit.team, unit.map_sprite_name); if (Map_Sprite.texture != null) { Map_Sprite.offset = new Vector2( (Map_Sprite.texture.Width / Map_Sprite.frame_count) / 2, (Map_Sprite.texture.Height / Map_Sprite.facing_count) - 8); } Map_Sprite.mirrored = unit.has_flipped_map_sprite; Face.set_actor(unit.actor); Face.mirrored = false; LeaderWeapon.set_image(unit.actor, unit.actor.weapon); } }
protected override void set_map_sprite_texture(bool deployed, string name) { MapSprite.texture = Scene_Map.get_team_map_sprite( Constants.Team.PLAYER_TEAM, name); if (MapSprite.texture != null) { MapSprite.offset = new Vector2( (MapSprite.texture.Width / MapSprite.frame_count) / 2, (MapSprite.texture.Height / MapSprite.facing_count) - 8); } int alpha = deployed ? 255 : 128; MapSprite.tint = new Color(alpha, alpha, alpha, 255); }
public void set_map_sprite(string filename, int team) { MapSprite.texture = Scene_Map.get_team_map_sprite( team, filename); MapSprite.mirrored = Constants.Team.flipped_map_sprite(team); if (MapSprite.texture != null) { MapSprite.offset = new Vector2( (MapSprite.texture.Width / MapSprite.frame_count) / 2, (MapSprite.texture.Height / MapSprite.facing_count) - 8); } MapSprite.frame = Global.game_system.unit_anim_idle_frame; }
protected override void set_images() { Game_Unit target = Global.game_map.units[this.target]; // Map Sprites // Unit_Sprite.texture = Scene_Map.get_team_map_sprite(target.team, target.map_sprite_name); if (Unit_Sprite.texture != null) { Unit_Sprite.offset = new Vector2( (Unit_Sprite.texture.Width / Unit_Sprite.frame_count) / 2, (Unit_Sprite.texture.Height / Unit_Sprite.facing_count) - 8); } Unit_Sprite.mirrored = target.has_flipped_map_sprite; // Text Name.text = target.actor.name; Hp.text = target.actor.hp.ToString(); MaxHp.text = target.actor.maxhp.ToString(); refresh(); }
protected override void set_images() { Game_Unit unit = get_unit(); Game_Actor actor1 = unit.actor; Game_Unit target = Global.game_map.units[this.target]; Game_Actor actor2 = target.actor; // Get weapon data // This is dancing, why do we need weapons? //Yeti 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; Stats = new List <TextSprite>(); for (int i = 0; i < 3; i++) { Stats.Add(i % 2 == 0 ? new RightAdjustedText() : new TextSprite()); Stats[i].offset = new Vector2(-24 - ((i / 2) * 24), -24); Stats[i].SetFont(Config.UI_FONT, Global.Content, (i % 2 == 0 ? "Blue" : "White")); } Stats[1].text = "/"; Stats[0].offset = new Vector2(-48, -24); Stats[1].offset = new Vector2(-48, -24); Stats[2].offset = new Vector2(-72, -24); // Hp Stats[0].text = actor2.hp.ToString(); // Max Hp Stats[2].text = actor2.maxhp.ToString(); refresh(); }
protected override void set_images() { // Drop if (mode == 1) { return; } Game_Unit unit = get_unit(); Game_Unit target = Global.game_map.units[this.target]; Rescue_Icon.visible = false; switch (mode) { // Take case 2: target = Global.game_map.units[Global.game_map.units[this.target].rescuing]; Rescue_Icon.visible = true; Rescue_Icon.src_rect = new Rectangle((target.team - 1) * (Rescue_Icon.texture.Width / Constants.Team.NUM_TEAMS), 0, Rescue_Icon.texture.Width / Constants.Team.NUM_TEAMS, Rescue_Icon.texture.Height); break; // Give case 3: unit = target; target = Global.game_map.units[get_unit().rescuing]; Rescue_Icon.visible = true; Rescue_Icon.src_rect = new Rectangle((target.team - 1) * (Rescue_Icon.texture.Width / Constants.Team.NUM_TEAMS), 0, Rescue_Icon.texture.Width / Constants.Team.NUM_TEAMS, Rescue_Icon.texture.Height); break; // Protect case 5: Game_Unit temp = unit; unit = target; target = temp; break; } // Map Sprites // Unit_Sprite.texture = Scene_Map.get_team_map_sprite(unit.team, unit.map_sprite_name); if (Unit_Sprite.texture != null) { Unit_Sprite.offset = new Vector2( (Unit_Sprite.texture.Width / Unit_Sprite.frame_count) / 2, (Unit_Sprite.texture.Height / Unit_Sprite.facing_count) - 8); } Unit_Sprite.mirrored = unit.has_flipped_map_sprite; if (Rescue_Icon.visible) { Rescue_Icon.draw_offset = Target_Sprite.draw_offset - new Vector2(16, 24); } else { Target_Sprite.texture = Scene_Map.get_team_map_sprite(target.team, target.map_sprite_name); if (Target_Sprite.texture != null) { 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; } // Text Name1.text = unit.actor.name; Name2.text = target.actor.name; Aid_Value.text = unit.aid().ToString(); Con_Value.text = target.stat(Stat_Labels.Con).ToString(); refresh(); }
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; // 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; Unit_Sprite.texture = Scene_Map.get_team_map_sprite(unit.team, unit.map_sprite_name); Unit_Sprite.offset = new Vector2( (Unit_Sprite.texture.Width / Unit_Sprite.frame_count) / 2, (Unit_Sprite.texture.Height / Unit_Sprite.facing_count) - 8); Unit_Sprite.mirrored = unit.has_flipped_map_sprite; // Sets Name // Name.offset = new Vector2(-(32), -(8)); Name.text = actor2.name; Unit_Name.offset = new Vector2(-(32), -(8 + 48)); Unit_Name.text = actor1.name; Stats = new List <TextSprite>(); // Healing if (Mode == Staff_Target_Mode.Heal) { 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")); } for (int i = 5; i < 10; i++) { Stats.Add(i % 2 == 1 ? new RightAdjustedText() : new TextSprite()); Stats[i].offset = new Vector2(-(48 + (((i - 5) / 2) * 24)), -72); Stats[i].SetFont(Config.UI_FONT, Global.Content, (i % 2 == 1 ? "Blue" : "White")); } int heal = unit.sacrifice_heal_amount(target); Stats[1].text = "-"; Stats[6].text = "-"; Stats[3].text = "/"; Stats[8].text = "/"; // Hp Stats[0].text = actor2.hp.ToString(); Stats[5].text = actor1.hp.ToString(); // New Hp Stats[2].text = (actor2.hp + heal).ToString(); Stats[7].text = (actor1.hp - heal).ToString(); // Max Hp Stats[4].text = actor2.maxhp.ToString(); Stats[9].text = actor1.maxhp.ToString(); // Status StatLabels[1].text = ""; StatLabels[3].text = ""; } refresh(); } }
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(); } }