diff --git a/.gitignore b/.gitignore index b7e7cc9..c25bf7b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ *.lnk BuildCache/ +*.code-workspace **/PublishedFileId.ID *.XCOM_suo *.suo \ No newline at end of file diff --git a/.scripts/build.ps1 b/.scripts/build.ps1 index 174927f..257da08 100644 --- a/.scripts/build.ps1 +++ b/.scripts/build.ps1 @@ -2,7 +2,8 @@ Param( [string] $srcDirectory, # the path that contains your mod's .XCOM_sln [string] $sdkPath, # the path to your SDK installation ending in "XCOM 2 War of the Chosen SDK" [string] $gamePath, # the path to your XCOM 2 installation ending in "XCOM2-WaroftheChosen" - [string] $config # build configuration + [string] $config, # build configuration + [switch] $useHighlanderFromEnv # If present, builds the mod against the Community Highlander, as found in X2EMPT_HIGHLANDER_FOLDER ) $ScriptDirectory = Split-Path $MyInvocation.MyCommand.Path @@ -23,6 +24,17 @@ $builder = [BuildProject]::new("ExtendedInformationRedux3", $srcDirectory, $sdkP # and uncomment the line: # $builder.IncludeSrc("C:\Users\Iridar\Documents\Firaxis ModBuddy\X2WOTCCommunityHighlander\X2WOTCCommunityHighlander\Src") +# Building against Highlander option 3: +# Create an X2EMPT_HIGHLANDER_FOLDER environment variable (if it does not already exist) +# containing the path to your local Highlander repository or the Highlander's mod folder, +# then uncomment the line: +if ($useHighlanderFromEnv) { + # Hid this behind a switch so I don't break your workflow! + # I've been building all my mods like this, very ergonomic + # once it's set up. --Dalo + $builder.IncludeSrc($env:X2EMPT_HIGHLANDER_FOLDER) +} + # Uncomment to use additional global Custom Src to build against. # $builder.IncludeSrc("C:\Users\Iridar\Documents\Firaxis ModBuddy\CustomSrc") diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..4a1d85d --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,17 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "type": "shell", + "command": "build_default.bat -useHighlanderFromEnv", + "problemMatcher": [], + "group": { + "kind": "build", + "isDefault": true + } + } + ] +} \ No newline at end of file diff --git a/ExtendedInformationRedux3.code-workspace.default b/ExtendedInformationRedux3.code-workspace.default new file mode 100644 index 0000000..5f550e0 --- /dev/null +++ b/ExtendedInformationRedux3.code-workspace.default @@ -0,0 +1,20 @@ +{ + "folders": [ + { + "path": "." + }, + { + "name": "XCOM 2", + "path": "Path/To/X2WotC-SDK/Development/SrcOrig" + }, + { + "name": "Highlander", + "path": "Path/To/Highlander/Src" + } + ], + "settings": { + "files.associations": { + "*.int":"ini" + } + } +} \ No newline at end of file diff --git a/ExtendedInformationRedux3/Localization/ExtendedInformationRedux3.int b/ExtendedInformationRedux3/Localization/ExtendedInformationRedux3.int index 05574e9..e2f4b40 100644 --- a/ExtendedInformationRedux3/Localization/ExtendedInformationRedux3.int +++ b/ExtendedInformationRedux3/Localization/ExtendedInformationRedux3.int @@ -66,7 +66,13 @@ sPreviewMinimum_MCMText = "Preview Minimum Damage"; sPreviewHacking_MCMText = "Preview Hacking"; sWarningMessage_MCMText = "Please note any change to Offset might result in bad display!"; sExpectedDamage_MCMText = "Show Expected Damage" +<<<<<<< feature/CoverDRHandling +sExpectedDamage_MCMTooltip = "Enable to see Expected Damage in Shot HUD next to damage. e.g. 'Damage: 3-5 (2.6)'\n\nExpected Damage is a weighted average damage. When aiming at the current enemy with the selected ability, what is the average damage you will do, considering hit chance, crit chance, dodge, graze band, weapon damage with all damage modifiers, and bonus crit damage." +sShowMitigation_MCMText = "Show Armor Mitigation" +sShowMitigation_MCMTooltip = "Enable to include armor mitigation in damage calculations.\n\nBy default, armor mitigation is not shown in the Shot HUD and must be tracked by hand. This option displays a new 'Armor' damage modifier for attacks whose damage would be reduced by armor.\n\nCertain mods may make non-deterministic changes to armor mitigation for a given attack. While the resulting damage modifiers and damage range should still be correct (unless the mod is doing something particularly strange), please be advised that enabling this option may in some cases reduce the accuracy of the values provided by the 'Show Expected Damage' option." +======= sExpectedDamage_MCMTooltip = "Enable to see Expected Damage in ShotHUD next to damage. e.g. 'Damage: 3-5 (2.6)'\n\nExpected Damage is a weighted average damage. When aiming at the current enemy with the selected ability, what is the average damage you will do, considering hit chance, crit chance, dodge, graze band, weapon damage with all damage modifiers, and bonus crit damage." +>>>>>>> main ;DEBUG sDodgeOffsetY_MCMText = "Dodge Offset Y"; diff --git a/ExtendedInformationRedux3/Src/ExtendedInformationRedux3/Classes/DamagePreviewLib.uc b/ExtendedInformationRedux3/Src/ExtendedInformationRedux3/Classes/DamagePreviewLib.uc index 4e7600f..375753e 100644 --- a/ExtendedInformationRedux3/Src/ExtendedInformationRedux3/Classes/DamagePreviewLib.uc +++ b/ExtendedInformationRedux3/Src/ExtendedInformationRedux3/Classes/DamagePreviewLib.uc @@ -49,7 +49,10 @@ class DamagePreviewLib extends Object implements(EI_DamagePreviewHelperAPI); } \\ // Inserts damage item at beginning -`define INSERTDAMITEM(TYPE, NOTBONUS) if (DamageItem.Min!=0 || DamageItem.Max!=0) \\ +`define INSERTDAMITEM(TYPE, NOTBONUS) `INSERTDAMITEM_TOINDEX(`TYPE, 0, `NOTBONUS) + +// Insert damage item at index (if no existing item with same label, else update that one) +`define INSERTDAMITEM_TOINDEX(TYPE, INDEX, NOTBONUS) if (DamageItem.Min!=0 || DamageItem.Max!=0) \\ { \\ i=`{TYPE}Damage.InfoList.Find('Label', DamageItem.Label); \\ if (i!=INDEX_NONE && DamageItem.Label!="") \\ @@ -64,7 +67,7 @@ class DamagePreviewLib extends Object implements(EI_DamagePreviewHelperAPI); } \\ else \\ { \\ - `{TYPE}Damage.InfoList.InsertItem(0, DamageItem); \\ + `{TYPE}Damage.InfoList.InsertItem(min(`INDEX, `{TYPE}Damage.InfoList.Length), DamageItem); \\ `if (`NOTBONUS) `else `{TYPE}Damage.Bonus++; `endif \\ } \\ `{TYPE}Damage.Min+=DamageItem.Min; \\ @@ -82,6 +85,7 @@ class DamagePreviewLib extends Object implements(EI_DamagePreviewHelperAPI); // Inserts weapon damage to both Normal and Crit `define INSERTTOBOTH(WEPDAM) DamageItem.Min=`MINDAM(`WEPDAM); \\ DamageItem.Max=`MAXDAM(`WEPDAM); \\ + OriginalPierce+=`WEPDAM.Pierce; \\ `INSERTDAMITEM(Normal, true); \\ DamageItem.Min=`WEPDAM.Crit; \\ DamageItem.Max=`WEPDAM.Crit; \\ @@ -359,6 +363,14 @@ static function GetWeaponDamagePreview(X2Effect_ApplyWeaponDamage WepDamEffect, //local DamageModifierInfo DamageModInfo; local string AbilityName; + // Begin CHL Issue #1540 - variables for cover DR + local int OriginalMitigation, OriginalPierce; + local int AppliedMandatoryMitigationMin, AppliedMandatoryMitigationMax; + local int MinDamage, MaxDamage; + // End CHL Issue #1540 + + local int IgnoreArmor, IgnoreShields; // CHL Issue #1542 + `TRACE_ENTRY("TargetRef.ObjectID:" @ TargetRef.ObjectID $ ", bAsPrimaryTarget:" @ bAsPrimaryTarget); bDoesDamageIgnoreShields = WepDamEffect.bBypassShields; @@ -613,15 +625,200 @@ static function GetWeaponDamagePreview(X2Effect_ApplyWeaponDamage WepDamEffect, // Tigrik: Add missing damage modifiers. Account for CHL #923 ApplyPostDefaultDamageModifierEffects(History, SourceUnit, TargetUnit, AbilityState, TestEffectParams, DamageItem, DamageItemCrit, NormalDamage, CritDamage, WepDamEffect); + + // Dalo: Start CHL Issue #1542 + IgnoreArmor = WepDamEffect.bIgnoreArmor ? 1 : 0; + IgnoreShields = bDoesDamageIgnoreShields ? 1 : 0; + // Commented out pending the release of CHL PR #1571 + //class'CHHelpers'.static.GetCDO().TriggerOverrideDefenseBypass(AppliedDamageTypes, IgnoreArmor, IgnoreShields, TestEffectParams, WepDamEffect); + `TRACE("Invoked TriggerOverrideDefenseBypass. AbilityState.GetMyFriendlyName():" @ AbilityName $ ", Original Armor/Shield Ignores:" @ WepDamEffect.bIgnoreArmor $ "/" $ bDoesDamageIgnoreShields $ ", Overridden Ignores:" @ IgnoreArmor > 0 $ "/" $ IgnoreShields > 0); + bDoesDamageIgnoreShields = IgnoreShields > 0; + // End CHL Issue #1542 if (!bDoesDamageIgnoreShields) { `TRACE_IF("!bDoesDamageIgnoreShields"); AllowsShield += NormalDamage.Max; } + + // Dalo: Begin CHL Issue #1540 - preview armor DR + // TODO @tigrik-dev: Only run this code if the appropriate MCM option is enabled! + if (true && TargetUnit != none && IgnoreArmor == 0 && NormalDamage.Min > 0) + { + `TRACE_IF("TargetUnit != none && !bIgnoreArmor && NormalDamage.Min > 0"); + // Dalo: The original mitigation (and original minimum mitigation, i.e. 0) + // are shared across both damage values, so can be initialized here. + OriginalMitigation = TargetUnit.GetArmorMitigationForUnitFlag(); + AppliedMandatoryMitigationMin = 0; + AppliedMandatoryMitigationMax = 0; + DamageItem.Label = class'XGLocalizedData'.default.ArmorMitigation; + DamageItemCrit.Label = DamageItem.Label; + DamageItem.Min = NormalDamage.Min; + DamageItem.Max = NormalDamage.Max; + DamageItemCrit.Min = NormalDamage.Min + CritDamage.Min; + DamageItemCrit.Max = NormalDamage.Max + CritDamage.Max; + + MinDamage = DamageItem.Min; + MaxDamage = DamageItem.Max; + `TRACE("First call to CalculateArmorMitigation. AbilityState.GetMyFriendlyName():" @ AbilityName $ ", MinDamage:" @ MinDamage $ ", MaxDamage:" @ MaxDamage); + CalculateArmorMitigation( + OriginalMitigation, + OriginalPierce, + AllowsShield, + TestEffectParams, + WepDamEffect, + AppliedMandatoryMitigationMin, + AppliedMandatoryMitigationMax, + MinDamage, + MaxDamage + ); + DamageItem.Min = MinDamage; + DamageItem.Max = MaxDamage; + `TRACE("Completed first call to CalculateArmorMitigation. AbilityState.GetMyFriendlyName():" @ AbilityName $ ", MinDamage:" @ MinDamage $ ", MaxDamage:" @ MaxDamage); + `INSERTDAMITEM_TOINDEX(Normal, 1); + + MinDamage = DamageItemCrit.Min; + MaxDamage = DamageItemCrit.Max; + `TRACE("Second call to CalculateArmorMitigation. AbilityState.GetMyFriendlyName():" @ AbilityName $ ", MinDamage:" @ MinDamage $ ", MaxDamage:" @ MaxDamage); + CalculateArmorMitigation( + OriginalMitigation, + OriginalPierce, + AllowsShield, + TestEffectParams, + WepDamEffect, + AppliedMandatoryMitigationMin, + AppliedMandatoryMitigationMax, + MinDamage, + MaxDamage + ); + `TRACE("Completed second call to CalculateArmorMitigation. AbilityState.GetMyFriendlyName():" @ AbilityName $ ", MinDamage:" @ MinDamage $ ", MaxDamage:" @ MaxDamage); + // Dalo: Only factor *extra* mitigation (if any) into crit damage! + // Theoretically, I suppose a mod could cause this to overflow. + // I do not know how, but if they do, that's probably fair play? + DamageItemCrit.Min = MinDamage - DamageItem.Min; + DamageItemCrit.Max = MaxDamage - DamageItem.Max; + DamageItem = DamageItemCrit; + `INSERTDAMITEM_TOINDEX(Crit, 1); + `TRACE("Invoked AdjustArmorMitigation. AbilityState.GetMyFriendlyName():" @ AbilityName $ ", NormalDamage:" @ DamageBreakdownToString(NormalDamage) $ ", CritDamage:" @ DamageBreakdownToString(CritDamage)); + } + // End CHL Issue #1540 + `TRACE_EXIT("AbilityState.GetMyFriendlyName():" @ AbilityName $ ", NormalDamage:" @ DamageBreakdownToString(NormalDamage) $ ", CritDamage:" @ DamageBreakdownToString(CritDamage)); } +/** + * Dalo: Helper function to handle CHL #1540. + * + * A port of the #1540 armor preview pipeline to EIR. Results should be + * identical to the code I wrote for the Highlander's {@code X2Effect_ApplyWeaponDamage::GetDamagePreview}, + * but this has been optimized for EIR's codebase... to some extent. + * + * The function operates on only one hit context (normal or critical) in order to minimize code reuse. + * Handling the resulting mitigation item for that context is left to the caller. + * + * Notes: + * - At call time, {@code MinDamage} and {@code MaxDamage} should contain the final unmitigated damage values for its context, + * to more accurately calculate mitigation (e.g. if resisting a percentage of incoming damage). + * - Upon completion, {@code MinDamage} and {@code MaxDamage} will contain the final mitigation values for its context, + * after piercing and minimum mitigation have been applied. + * + * @param OriginalMitigation How much unmodified armor the unit had before we started calculating. + * @param OriginalPierce How much piercing the attack had before we started calculating. + * @param AllowsShield How much shield damage the attack is allowed to deal, required by the CHL helper for issue #743 + * @param TestEffectParams Effect application context, including hit result state. + * @param WepDamEffect Weapon damage effect context (passed to CHL callback; may be unused). + * @param AppliedMandatoryMitigationMin How much mandatory mitigation has been applied to minimum damage by a previous context (to prevent double-dipping). + * @param AppliedMandatoryMitigationMax As above, but for maximum damage. + * @param MinDamage Minimum damage inflicted by the attack in this context. + * @param MaxDamage Maximum damage inflicted by the attack in this context. + */ +static function CalculateArmorMitigation( + int OriginalMitigation, + int OriginalPierce, + int AllowsShield, + EffectAppliedData TestEffectParams, + X2Effect_ApplyWeaponDamage WepDamEffect, + out int AppliedMandatoryMitigationMin, + out int AppliedMandatoryMitigationMax, + out int MinDamage, + out int MaxDamage +) { + // My CH helper expects mitigation data to come in a WDV. + local WeaponDamageValue MinDamagePreview, MaxDamagePreview; + + // It seems that passing struct values as out parameters to a function + // prevents them from being edited by the function, + // so we need a few extra variables to store the data... + local int MinPierce, MaxPierce; + local int MinMitigation, MaxMitigation; + local int MinMandatoryMitigation, MaxMandatoryMitigation; + local int NetMitigationMin, NetMitigationMax; + + // Init the WDVs so the helper can correctly calculate how much damage was prevented. + MinDamagePreview.Damage = MinDamage; + MaxDamagePreview.Damage = MaxDamage; + + // Get adjusted mitigation, piercing, and minimum mitigation + // for the attack's minimum damage. + MinMitigation = OriginalMitigation; + MinPierce = OriginalPierce; + MinMandatoryMitigation = 0; + // Commented out pending the release of CHL PR #1567. + /*class'CHHelpers'.static.GetCDO().TriggerAdjustArmorMitigation( + MinDamage, + MinMitigation, + MinPierce, + MinMandatoryMitigation, // Starts at 0 + TestEffectParams, + WepDamEffect, + // Tells the event handlers that this is a minimum damage preview. + // (The absence of a game state tells them it's *a* damage preview.) + true + );*/ + MinDamagePreview.Spread = MinMitigation; + MinDamagePreview.Pierce = MinPierce; + MinDamagePreview.PlusOne = MinMandatoryMitigation - AppliedMandatoryMitigationMin; + + // Now do the same for the attack's maximum damage. + MaxMitigation = OriginalMitigation; + MaxPierce = OriginalPierce; + MaxMandatoryMitigation = 0; + // Commented out pending the release of CHL PR #1567. + /*class'CHHelpers'.static.GetCDO().TriggerAdjustArmorMitigation( + MaxDamage, + MaxMitigation, + MaxPierce, + MaxMandatoryMitigation, // Starts at 0 + TestEffectParams, + WepDamEffect + );*/ + MaxDamagePreview.Spread = MaxMitigation; + MaxDamagePreview.Pierce = MaxPierce; + MaxDamagePreview.PlusOne = MaxMandatoryMitigation - AppliedMandatoryMitigationMax; + + // Now that we're done adjusting the raw values, let's crunch them into real-(game)-world outcomes! + `TRACE("About to call CalculateMitigatedDamagePreview. Min/MaxMitigation:" @ MinMitigation $ "/" $ MaxMitigation $ ", Min/MaxMandatoryMitigation:" @ MinDamagePreview.PlusOne $ "/" $ MaxDamagePreview.PlusOne $ ", Min/MaxDamage:" @ MinDamage $ "/" $ MaxDamage); + // Go back to using CHHelpers when CHL PR #1567 is released, + // to avoid code duplication and all that stuff. + CalculateMitigatedDamagePreview( + //class'CHHelpers'.static.CalculateMitigatedDamagePreview( + TestEffectParams.TargetStateObjectRef, + MinDamagePreview, + MaxDamagePreview, + AllowsShield, + MinDamage, + MaxDamage, + NetMitigationMin, + NetMitigationMax + ); + + // ... And prepare our output data! + AppliedMandatoryMitigationMin += min(MinMandatoryMitigation, abs(NetMitigationMin)); + AppliedMandatoryMitigationMax += min(MaxMandatoryMitigation, abs(NetMitigationMax)); + MinDamage = NetMitigationMin; + MaxDamage = NetMitigationMax; +} + /** * Tigrik: Add missing damage modifiers. Account for CHL #923 * @@ -637,7 +834,7 @@ static function GetWeaponDamagePreview(X2Effect_ApplyWeaponDamage WepDamEffect, * The function operates on both normal and critical hit contexts by temporarily modifying * {@code ApplyEffectParameters.AbilityResultContext.HitResult}. It computes delta-based changes * using running ("current") damage values to ensure correct stacking behavior, then truncates - * the final differences to match XCOM 2’s integer damage handling. + * the final differences to match XCOM 2�s integer damage handling. * * Damage contributions are recorded into {@code NormalDamage} and {@code CritDamage} via macros * (e.g. {@code ADDDAMITEM}), which merge or insert labeled {@code DamageInfo} entries. @@ -837,7 +1034,7 @@ static function ApplyPreDefaultDamageModifierEffects( * The function operates on both normal and critical hit contexts by temporarily modifying * {@code ApplyEffectParameters.AbilityResultContext.HitResult}. It computes delta-based changes * using running ("current") damage values to ensure correct stacking behavior, then truncates - * the final differences to match XCOM 2’s integer damage handling. + * the final differences to match XCOM 2�s integer damage handling. * * Damage contributions are recorded into {@code NormalDamage} and {@code CritDamage} via macros * (e.g. {@code ADDDAMITEM}), which merge or insert labeled {@code DamageInfo} entries. @@ -1082,4 +1279,65 @@ static function string DamageBreakdownToString(DamageBreakdown DB) static function string DamageInfoToString(DamageInfo Info) { return "{Label=\"" $ Info.Label $ "\", Min=" $ string(Info.Min) $ ", Max=" $ string(Info.Max) $ "}"; +} + +// TODO: Delete this function when CHL PR #1567 is released +// Helper function to calculate mitigated damage for ShotWings/ShotHUD. +// Quick reminder: Spread holds mitigation, PlusOne holds minimum mitigation. +static simulated function CalculateMitigatedDamagePreview(StateObjectReference Target, WeaponDamageValue MinDamageValue, WeaponDamageValue MaxDamageValue, int AllowsShield, out int MinDamage, out int MaxDamage, out int NetMitigationMin, out int NetMitigationMax) +{ + local XComGameStateHistory History; + local XComGameState_Unit TargetUnit; + local int TargetShields; + local int MandatoryDamage; + local int GuaranteedDamageMin, GuaranteedDamageMax; + + History = `XCOMHISTORY; + + if (MinDamageValue.Spread == 0 && MaxDamageValue.Spread == 0 || Target.ObjectId == 0) + { + return; + } + + TargetUnit = XComGameState_Unit(History.GetGameStateForObjectId(Target.ObjectID)); + if (TargetUnit == none) + { + return; + } + + if (!class'X2Effect_ApplyWeaponDamage'.default.NO_MINIMUM_DAMAGE) // Account for issue #321 + { + MandatoryDamage = 1; + } + else + { + MandatoryDamage = 0; + } + GuaranteedDamageMin = MandatoryDamage; + GuaranteedDamageMax = MandatoryDamage; + + // If shields are applicable and not subject to mitigation, + // then we are never guaranteed HP damage, but always + // guaranteed shield damage so let's preview that. + if (AllowsShield > 0 && !class'X2Effect_ApplyWeaponDamage'.default.ARMOR_BEFORE_SHIELD) // From issue #743 + { + TargetShields = TargetUnit.GetCurrentStat(eStat_ShieldHP); + } + if (TargetShields > MandatoryDamage) + { + GuaranteedDamageMin = min(MinDamage, TargetShields); + GuaranteedDamageMax = min(MaxDamage, TargetShields); + } + + // This is a bit condensed from the real damage calculator, so to summarize: + // 1. Subtract piercing from mitigation. + // 2. Don't let mitigation drop below the minimum mitigation. + // 3. Now subtract mitigation from damage. + // 4. Make sure damage is *at least* the guaranteed damage for this attack. + MinDamage = max(MinDamage - max(MinDamageValue.Spread - MinDamageValue.Pierce, MinDamageValue.PlusOne), min(GuaranteedDamageMin, MinDamage)); + MaxDamage = max(MaxDamage - max(MaxDamageValue.Spread - MaxDamageValue.Pierce, MaxDamageValue.PlusOne), min(GuaranteedDamageMax, MaxDamage)); + + // Net mitigation for ShotWings: How much damage did the armor actually prevent? + NetMitigationMin = MinDamage - MinDamageValue.Damage; + NetMitigationMax = MaxDamage - MaxDamageValue.Damage; } \ No newline at end of file diff --git a/build.bat b/build.bat new file mode 100644 index 0000000..e422c76 --- /dev/null +++ b/build.bat @@ -0,0 +1,14 @@ +@echo off + +IF NOT EXIST "%XCOM2SDKPATH%\Development\SrcOrig" ( + echo You need to specify the location of the XCOM 2 WOTC SDK (typically ^\steamapps\common\XCOM 2 War of the Chosen SDK^) in the XCOM2SDKPATH environment variable + exit /b 1 +) + +IF NOT EXIST "%XCOM2GAMEPATH%\Binaries\Win64\XCom2.exe" ( + echo You need to specify the location of the XCOM 2 War of the Chosen game directory (typically ^\steamapps\common\XCOM 2\XCom2-WarOfTheChosen^) in the XCOM2GAMEPATH environment variable + exit /b 1 +) + +rem The trailing backslash after %~dp0 is important, otherwise PowerShell thinks the " is being escaped! +powershell.exe -NonInteractive -ExecutionPolicy Unrestricted -file "%~dp0.scripts\build.ps1" -srcDirectory "%~dp0\" -sdkPath "%XCOM2SDKPATH%" -gamePath "%XCOM2GAMEPATH%" %* diff --git a/build_debug.bat b/build_debug.bat new file mode 100644 index 0000000..19af888 --- /dev/null +++ b/build_debug.bat @@ -0,0 +1,3 @@ +@echo off + +build.bat -config debug %* \ No newline at end of file diff --git a/build_default.bat b/build_default.bat new file mode 100644 index 0000000..d4de9a4 --- /dev/null +++ b/build_default.bat @@ -0,0 +1,3 @@ +@echo off + +build.bat -config default %* \ No newline at end of file diff --git a/clean.bat b/clean.bat new file mode 100644 index 0000000..cb69a7b --- /dev/null +++ b/clean.bat @@ -0,0 +1,14 @@ +@echo off + +IF NOT EXIST "%XCOM2SDKPATH%\Development\SrcOrig" ( + echo You need to specify the location of the XCOM 2 WOTC SDK (typically ^\steamapps\common\XCOM 2 War of the Chosen SDK^) in the XCOM2SDKPATH environment variable + exit /b 1 +) + +IF NOT EXIST "%XCOM2GAMEPATH%\Binaries\Win64\XCom2.exe" ( + echo You need to specify the location of the XCOM 2 War of the Chosen game directory (typically ^\steamapps\common\XCOM 2\XCom2-WarOfTheChosen^) in the XCOM2GAMEPATH environment variable + exit /b 1 +) + +REM The trailing backslash after %~dp0 is important, otherwise PowerShell thinks the " is being escaped! +powershell.exe -NonInteractive -ExecutionPolicy Unrestricted -file "%~dp0.scripts\X2ModBuildCommon\clean.ps1" -srcDirectory "%~dp0\" -sdkPath "%XCOM2SDKPATH%" -gamePath "%XCOM2GAMEPATH%" -modName "ExtendedInformationRedux3"