public GroundAssault(Battle battle) { this.battle = battle; AddControl(new Border(0, 0, 320, 200, ColorScheme.Green, Backgrounds.Assault, 0)); AddControl(new Label(24, 16, "UFO GROUND ASSAULT", Font.Large, ColorScheme.Aqua)); AddControl(new Label(40, 16, battle.Craft.Destination.Name, Font.Large, ColorScheme.Aqua)); AddControl(new Label(56, 16, $"CRAFT> {battle.Craft.Name}", Font.Large, ColorScheme.Aqua)); var nextTop = 72; var instructions = new[] { "Explore landing site and, if possible, gain entry to the UFO.", "Mission will be successful when all enemy units have been", "eliminated or neutralized. Recovery of UFO, artifacts and", "alien corpses can then be initiated. To abort the mission", "return XCom operatives to transport vehicle and click on", "the 'Abort Mission' icon." }; foreach (var instruction in instructions) { var top = nextTop; nextTop += 8; AddControl(new Label(top, 16, instruction, Font.Normal, ColorScheme.Aqua)); } AddControl(new Button(164, 100, 120, 20, "OK", ColorScheme.Aqua, Font.Normal, OnOk)); }
public Battlescape(Battle battle) { this.battle = battle; AddControl(new Overlay(Overlays.BattlescapeControls, 4)); AddControl(new ClickArea(144, 0, 48, 56, OnLeftWeapon)); AddControl(new ClickArea(144, 272, 48, 56, OnRightWeapon)); AddControl(new ClickArea(144, 48, 32, 16, OnMoveUp)); AddControl(new ClickArea(160, 48, 32, 16, OnMoveDown)); AddControl(new ClickArea(144, 80, 32, 16, OnLevelUp)); AddControl(new ClickArea(160, 80, 32, 16, OnLevelDown)); AddControl(new ClickArea(144, 112, 32, 16, OnMiniMap)); AddControl(new ClickArea(160, 112, 32, 16, OnToggleCrouch)); AddControl(new ClickArea(144, 144, 32, 16, OnInventory)); AddControl(new ClickArea(160, 144, 32, 16, OnCenterOnActiveUnit)); AddControl(new ClickArea(144, 176, 32, 16, OnNextUnit)); AddControl(new ClickArea(160, 176, 32, 16, OnDoneAndNextUnit)); AddControl(new ClickArea(144, 208, 32, 16, OnToggleLevelView)); AddControl(new ClickArea(160, 208, 32, 16, OnOptions)); AddControl(new ClickArea(144, 240, 32, 16, OnEndTurn)); AddControl(new ClickArea(160, 240, 32, 16, OnAbortMission)); AddControl(new ClickArea(176, 48, 30, 12, OnOptionNoReserve)); AddControl(new ClickArea(188, 48, 30, 12, OnOptionReserveAimedShot)); AddControl(new ClickArea(176, 78, 30, 12, OnOptionReserveSnapShot)); AddControl(new ClickArea(188, 78, 30, 12, OnOptionReserveAutoShot)); AddControl(new ClickArea(176, 108, 164, 24, OnUnitStatistics)); hoverScroll.OnScrollUp += battle.Map.ScrollUp; hoverScroll.OnScrollDown += battle.Map.ScrollDown; hoverScroll.OnScrollLeft += battle.Map.ScrollLeft; hoverScroll.OnScrollRight += battle.Map.ScrollRight; }
public ViewSoldierStatistics(Battle battle, BattleSoldier soldier) { this.battle = battle; AddControl(new Overlay(Overlays.SoldierStatistics, 4)); AddControl(new Label(4, Label.Center, $"{soldier.Rank} {soldier.Name}", Font.Large, ColorScheme.Green)); AddRow(31, "TIME UNITS", soldier.TimeUnits, soldier.MaxTimeUnits, 48); AddRow(41, "ENERGY", soldier.Energy, soldier.MaxEnergy, 144); AddRow(51, "HEALTH", soldier.Health, soldier.MaxHealth, 32); AddRow(61, "FATAL WOUNDS", soldier.TotalFatalWounds, soldier.TotalFatalWounds, 32); AddRow(71, "BRAVERY", soldier.Bravery, soldier.Soldier.Statistics.Bravery, 247, 249); AddRow(81, "MORALE", soldier.Morale, soldier.MaxMorale, 247, 249); AddRow(91, "REACTIONS", soldier.Reactions, soldier.Soldier.Statistics.Reactions, 96); AddRow(101, "FIRING ACCURACY", soldier.FiringAccuracy, soldier.Soldier.Statistics.FiringAccuracy, 128); AddRow(111, "THROWING ACCURACY", soldier.ThrowingAccuracy, soldier.Soldier.Statistics.ThrowingAccuracy, 160); AddRow(121, "STRENGTH", soldier.Strength, soldier.Soldier.Statistics.Strength, 147); if (soldier.Soldier.HasPsiSkill) { AddRow(131, "PSIONIC STRENGTH", soldier.PsionicStrength, soldier.Soldier.Statistics.PsionicStrength, 176); AddRow(141, "PSIONIC SKLIL", soldier.PsionicSkill, soldier.Soldier.Statistics.PsionicSkill, 176); } AddRow(151, "FRONT ARMOR", soldier.FrontArmor, soldier.Soldier.FrontArmor, 1); AddRow(161, "LEFT ARMOR", soldier.LeftArmor, soldier.Soldier.LeftArmor, 1); AddRow(171, "RIGHT ARMOR", soldier.RightArmor, soldier.Soldier.RightArmor, 1); AddRow(181, "REAR ARMOR", soldier.RearArmor, soldier.Soldier.RearArmor, 1); AddRow(191, "UNDER ARMOR", soldier.UnderArmor, soldier.Soldier.UnderArmor, 1); }
public DisplayTurn(Battle battle) { this.battle = battle; AddControl(new Border(0, 0, 320, 200, ColorScheme.White, Backgrounds.Turn, 1)); AddControl(new Label(68, Label.Center, "UFO", Font.Large, ColorScheme.White)); AddControl(new Label(92, Label.Center, $"TURN> {battle.Turn}", Font.Large, ColorScheme.White)); AddControl(new Label(108, Label.Center, "SIDE> Xcom", Font.Large, ColorScheme.White)); AddControl(new Label(132, Label.Center, "Press button to continue", Font.Large, ColorScheme.White)); }
public Inventory(Battle battle, BattleSoldier soldier, List<BattleItem> ground, bool isInitialInventory) { this.battle = battle; this.soldier = soldier; this.ground = ground; this.isInitialInventory = isInitialInventory; CalculateGroundViews(); AddControl(new Overlay(Overlays.Tactical, 4)); AddControl(new ClickArea(1, 238, 35, 23, OnOk)); AddControl(new ClickArea(1, 274, 23, 23, OnPreviousSoldier)); AddControl(new ClickArea(1, 298, 23, 23, OnNextSoldier)); AddControl(new ClickArea(32, 288, 33, 26, OnUnloadWeapon)); AddControl(new ClickArea(137, 288, 33, 15, OnNextGroundView)); AddControl(new Label(0, 0, soldier.Soldier.Name, Font.Large, ColorScheme.Green)); AddControl(new Label(32, 16, "RIGHT SHOULDER", Font.Normal, ColorScheme.Green)); AddControl(new Label(32, 112, "LEFT SHOULDER", Font.Normal, ColorScheme.Green)); AddControl(new Label(56, 0, "RIGHT HAND", Font.Normal, ColorScheme.Green)); AddControl(new Label(56, 128, "LEFT HAND", Font.Normal, ColorScheme.Green)); AddControl(new Label(112, 0, "RIGHT LEG", Font.Normal, ColorScheme.Green)); AddControl(new Label(112, 128, "LEFT LEG", Font.Normal, ColorScheme.Green)); AddControl(new Label(32, 192, "BACK PACK", Font.Normal, ColorScheme.Green)); AddControl(new Label(96, 192, "BELT", Font.Normal, ColorScheme.Green)); AddControl(new Label(143, 0, "GROUND", Font.Normal, ColorScheme.Green)); AddControl(new ClickGridArea(40, 16, 2, 1, OnClickRightShoulder)); AddControl(new ClickGridArea(40, 112, 2, 1, OnClickLeftShoulder)); AddControl(new ClickArea(64, 0, 32, 48, OnClickRightHand)); AddControl(new ClickArea(64, 128, 32, 48, OnClickLeftHand)); AddControl(new ClickGridArea(120, 0, 2, 1, OnClickRightLeg)); AddControl(new ClickGridArea(120, 128, 2, 1, OnClickLeftLeg)); AddControl(new ClickGridArea(40, 192, 3, 3, OnClickBackPack)); AddControl(new ClickGridArea(104, 192, 4, 2, OnClickBelt)); AddControl(new ClickGridArea(152, 0, 20, 3, OnClickGround)); if (!isInitialInventory) { AddControl(new Label(24, 250, "TUs>", Font.Normal, ColorScheme.Green)); AddControl(new DynamicLabel(24, 270, () => $"{soldier.TimeUnits}", Font.Normal, ColorScheme.Orange)); } AddControl(new Overlay(soldier.Soldier.Paperdoll, 4)); }