Skip to content

Commit 10c6b0b

Browse files
authored
v2.5.20241101.05 Update
2 parents 93b5a1d + 2a2dce6 commit 10c6b0b

File tree

7 files changed

+57
-18
lines changed

7 files changed

+57
-18
lines changed

Assets/Scripts/Global/CloudServices.cs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,26 @@ private void Start()
2020
AnalyticsService.Instance.StartDataCollection();
2121
}
2222

23-
async void Awake()
23+
private async void Awake()
2424
{
25+
await InitializeUnityServices();
2526
await InitializeRemoteConfigAsync();
26-
await RemoteConfigService.Instance.FetchConfigsAsync(new UserAttributes(), new AppAttributes());
27+
}
28+
29+
async Task InitializeUnityServices()
30+
{
31+
if (UnityServices.State == ServicesInitializationState.Uninitialized)
32+
{
33+
await UnityServices.InitializeAsync();
34+
}
2735
}
2836

2937
async Task InitializeRemoteConfigAsync()
3038
{
31-
// initialize handlers for unity game services / remote config
32-
await UnityServices.InitializeAsync();
39+
if (RemoteConfigService.Instance.requestStatus == ConfigRequestStatus.None)
40+
{
41+
await RemoteConfigService.Instance.FetchConfigsAsync(new UserAttributes(), new AppAttributes());
42+
}
3343
}
3444
}
3545

Assets/Scripts/Global/Global.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ public class Global : MonoBehaviour {
1212

1313
private static bool isAlreadyInitialized;
1414

15-
public static string CurrentVersion = "v2.5.20241101.04";
16-
public static int CurrentVersionInt = 102504004; // literal(10) XwingVersion(25) Update#(increments) Patch#(increments)
15+
public static string CurrentVersion = "v2.5.20241101.05";
16+
public static int CurrentVersionInt = 102504005; // literal(10) XwingVersion(25) Update#(increments) Patch#(increments)
1717
public static int LatestVersionInt = 0;
1818

1919
public static SquadBuilder SquadBuilder { get; set;}

Assets/Scripts/Model/Content/SecondEdition/Pilots/FO/XiClassLightShuttle/AgentTierny.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,14 @@ public override void WhenAssigned()
126126
Host.OnAttackStartAsAttacker += CheckAlliedStress;
127127
GenericShip.OnFaceupCritCardReadyToBeDealtGlobal += CheckRemoveBrokenTrust;
128128
Host.OnAttackFinish += CheckRemoveBrokenTrust;
129-
Host.OnAttackFinishAsAttacker += CheckRemoveBrokenTrust;
130129
}
131-
130+
132131
public override void WhenRemoved()
133132
{
134133
Host.OnCheckIsFriendly -= TreatAsAllied;
135134
Host.OnAttackStartAsAttacker -= CheckAlliedStress;
136135
GenericShip.OnFaceupCritCardReadyToBeDealtGlobal -= CheckRemoveBrokenTrust;
137-
Host.OnAttackFinishAsAttacker -= CheckRemoveBrokenTrust;
136+
Host.OnAttackFinish -= CheckRemoveBrokenTrust;
138137
}
139138

140139
public void CheckRemoveBrokenTrust(GenericShip ship)

Assets/Scripts/Model/Content/SecondEdition/Pilots/Scum/YV666LightFreighter/MoraloEval.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ private void CheckAbility(ref bool shouldBeDestroyed, Direction direction)
7070
HostShip.SpendCharge();
7171
shouldBeDestroyed = false;
7272

73-
Messages.ShowInfo(HostShip.PilotInfo.PilotName + " has been moved to the Reserve");
73+
Messages.ShowInfo($"{HostShip.PilotInfo.PilotName} has been moved to Reserve");
7474

7575
Roster.MoveToReserve(HostShip);
7676

@@ -92,7 +92,7 @@ private void SetupShip(object sender, System.EventArgs e)
9292
var subphase = Phases.StartTemporarySubPhaseNew<SetupShipMidgameSubPhase>(
9393
"Setup",
9494
delegate {
95-
Messages.ShowInfo(HostShip.PilotInfo.PilotName + " has returned to the play area");
95+
Messages.ShowInfo($"{HostShip.PilotInfo.PilotName} has returned to the play area");
9696
Triggers.FinishTrigger();
9797
}
9898
);

Assets/Scripts/Model/Roster/ShipRoster.cs

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
using System.Collections;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using UnityEngine;
1+
using GameCommands;
2+
using Obstacles;
53
using Players;
4+
using Remote;
65
using Ship;
76
using SquadBuilderNS;
87
using System;
9-
using GameCommands;
10-
using Obstacles;
11-
using Remote;
8+
using System.Collections;
9+
using System.Collections.Generic;
10+
using System.Linq;
11+
using UnityEngine;
12+
using Upgrade;
13+
using UpgradesList.SecondEdition;
1214

1315
public static partial class Roster
1416
{
@@ -410,6 +412,8 @@ public static void MoveToReserve(GenericShip ship)
410412
AllUnits.Remove("ShipId:" + ship.ShipId);
411413
ship.Owner.Units.Remove("ShipId:" + ship.ShipId);
412414

415+
DisableUpgrades(ship);
416+
413417
Reserve.Add(ship);
414418
}
415419

@@ -422,6 +426,8 @@ public static void ReturnFromReserve(GenericShip ship)
422426
AllUnits.Add("ShipId:" + ship.ShipId, ship);
423427
ship.Owner.Units.Add("ShipId:" + ship.ShipId, ship);
424428

429+
EnableUpgrades(ship);
430+
425431
Reserve.Remove(ship);
426432
}
427433

@@ -432,4 +438,26 @@ public static void ToggleCalculatingStatus(PlayerNo playerNo, bool isActive)
432438
Roster.GetPlayer(playerNo).PlayerInfoPanel.transform.Find("StatusPanel").gameObject.SetActive(isActive);
433439
}
434440

441+
public static void DisableUpgrades(GenericShip ship)
442+
{
443+
foreach (GenericUpgrade upgrade in ship.UpgradeBar.GetUpgradesOnlyFaceup()) {
444+
if(!ReserveUpgrades(upgrade))
445+
upgrade.DeactivateAbility();
446+
}
447+
}
448+
449+
public static void EnableUpgrades(GenericShip ship)
450+
{
451+
foreach (GenericUpgrade upgrade in ship.UpgradeBar.GetUpgradesOnlyFaceup())
452+
{
453+
if (!ReserveUpgrades(upgrade))
454+
upgrade.ActivateAbility();
455+
}
456+
}
457+
458+
// Return true if upgrade allows moving to Reserve, this is to prevent deactivating the ability to return from reserve
459+
public static bool ReserveUpgrades(GenericUpgrade upgrade)
460+
{
461+
return upgrade is BobaFett;
462+
}
435463
}

Assets/Scripts/Model/Rules/RulesList/IonizationRule.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ private static void RegisterRemoveIonization(GenericShip ship)
3535
{
3636
if (BoardTools.Board.IsOffTheBoard(ship)) return;
3737

38+
ship.AssignedManeuver.IsIonManeuver = true;
39+
3840
ship.OnMovementExecuted -= RegisterRemoveIonization;
3941

4042
Triggers.RegisterTrigger(new Trigger
216 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)