Skip to content

Commit

Permalink
Prevent classes not enabled for stat progression getting stat points
Browse files Browse the repository at this point in the history
  • Loading branch information
Musashi1584 committed Mar 19, 2020
1 parent 5e5ff3d commit 931ff49
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 10 deletions.
Binary file added Assets/loadout_icon_holocron.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/loadout_icon_lightsaber.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/loadout_icon_saberstaff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions XCOM2RPGOverhaul.XCOM_sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# XCOM ModBuddy Solution File, Format Version 11.00
VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{5DAE07AF-E217-45C1-8DE7-FF99D6011E8A}") = "XCOM2RPGOverhaul", "XCOM2RPGOverhaul\XCOM2RPGOverhaul.x2proj", "{219CE4B8-DA1D-49EB-A9A2-A7B292DF97F9}"
Project("{5DAE07AF-E217-45C1-8DE7-FF99D6011E8A}") = "XCOM2RPGOverhaul", "XCOM2RPGOverhaul\XCOM2RPGOverhaul.x2proj", "{CAB424DD-00A4-4960-8665-EA8DA48FB8E1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|XCOM 2 = Debug|XCOM 2
Default|XCOM 2 = Default|XCOM 2
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{219CE4B8-DA1D-49EB-A9A2-A7B292DF97F9}.Debug|XCOM 2.ActiveCfg = Debug|XCOM 2
{219CE4B8-DA1D-49EB-A9A2-A7B292DF97F9}.Debug|XCOM 2.Build.0 = Debug|XCOM 2
{219CE4B8-DA1D-49EB-A9A2-A7B292DF97F9}.Default|XCOM 2.ActiveCfg = Default|XCOM 2
{219CE4B8-DA1D-49EB-A9A2-A7B292DF97F9}.Default|XCOM 2.Build.0 = Default|XCOM 2
{CAB424DD-00A4-4960-8665-EA8DA48FB8E1}.Debug|XCOM 2.ActiveCfg = Debug|XCOM 2
{CAB424DD-00A4-4960-8665-EA8DA48FB8E1}.Debug|XCOM 2.Build.0 = Debug|XCOM 2
{CAB424DD-00A4-4960-8665-EA8DA48FB8E1}.Default|XCOM 2.ActiveCfg = Default|XCOM 2
{CAB424DD-00A4-4960-8665-EA8DA48FB8E1}.Default|XCOM 2.Build.0 = Default|XCOM 2
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Binary file modified XCOM2RPGOverhaul.v12.XCOM_suo
Binary file not shown.
Binary file modified XCOM2RPGOverhaul/Content/UILibrary_RPG.upk
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ static function EventListenerReturn OnCompleteRespecSoldier(Object EventData, Ob

UnitState = XComGameState_Unit(EventSource);

if (UnitState != none &&
UnitState.GetMyTemplateName() == 'Soldier' &&
default.EnableClassForStatProgression.Find(UnitState.GetSoldierClassTemplateName()) != INDEX_NONE
if (UnitState != none && IsClassEnabled(UnitState)
)
{
SpentSoldierSP = GetSpentSoldierSP(UnitState);
Expand Down Expand Up @@ -110,7 +108,7 @@ static function EventListenerReturn OnUnitRankUp(Object EventData, Object EventS

UnitState = XComGameState_Unit(EventData);

if (UnitState != none)
if (UnitState != none && IsClassEnabled(UnitState))
{
StatPointsPerPromotion = GetClassStatPointsPerPromition(UnitState);
BonusStatPointsNaturalAptitude = class'StatUIHelper'.static.GetBonusStatPointsFromNaturalAptitude(UnitState);
Expand Down Expand Up @@ -141,7 +139,7 @@ static function EventListenerReturn OnArmoryMainMenuUpdate(Object EventData, Obj
UnitState = XComGameState_Unit(`XCOMHISTORY.GetGameStateForObjectID(MainMenu.GetUnitRef().ObjectID));
UnitState.GetUnitValue('StatPoints', StatPointsValue);

if (default.EnableClassForStatProgression.Find(UnitState.GetSoldierClassTemplateName()) != INDEX_NONE)
if (UnitState != none && IsClassEnabled(UnitState))
{
StatUIButton = MainMenu.Spawn(class'UIListItemString', List.ItemContainer).InitListItem(class'UIBarMemorial_Details'.default.m_strSoldierStats);
StatUIButton.MCName = 'ArmoryMainMenu_StatUIButton';
Expand Down Expand Up @@ -232,3 +230,8 @@ static function int GetSoldierSP(XComGameState_Unit UnitState)
UnitState.GetUnitValue('StatPoints', StatPointsValue);
return int(StatPointsValue.fValue);
}

static function bool IsClassEnabled(XComGameState_Unit UnitState)
{
return (default.EnableClassForStatProgression.Find(UnitState.GetSoldierClassTemplateName()) != INDEX_NONE);
}

0 comments on commit 931ff49

Please sign in to comment.