Skip to content

Commit

Permalink
Merge LW Version 1.5 to Community Highlander 1.5.
Browse files Browse the repository at this point in the history
  • Loading branch information
MalucoMarinero committed Aug 28, 2017
2 parents 5e173c0 + b8090d8 commit b0c1b68
Show file tree
Hide file tree
Showing 20 changed files with 4,215 additions and 558 deletions.
20 changes: 17 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ All notable changes to Vanilla Behaviour will be documented in this file.
(#249)
- Add config for reinforcement patrol zones when not in scamper/red alert (#252)
- Add config for AI behaviour regarding AOE Targeting and Visibility (#260)
- Add config for Ever Vigilant being excluded when unit burning or impaired
(#276)

### Modding Exposures
- Remove const from plot and parcel definition arrays (#199)
Expand All @@ -211,6 +213,8 @@ All notable changes to Vanilla Behaviour will be documented in this file.
provision of an AlertTile (#198)
- Move CameraAction for X2Effect_MindControl and into the OnRemovedFn so mods
can decide on the visualization (#246)
- Move contents of FinalizeHackAbility_BuildGameState into a static helper
function so it can be called from other hack abilities. (#282)

### Improvements
- Flying Enemies path searching improved to use unlimited search depth on
Expand Down Expand Up @@ -254,6 +258,12 @@ All notable changes to Vanilla Behaviour will be documented in this file.
- Empty out pending loot for units killed by explosives (#112)
- Visualization Fixes for Hacking to accomodate effect addition/removal better
than vanilla does (#242)
- Fix rescued soldier VIPs becoming wounded because the VIP proxy unit had less
max HP than actual soldier. (#277)
- Show Defense stat on UISoldierHeader, hiding hack stat for PsiOps to prevent
overflow. (#280)
- Alter Tactical Interrupt Handling for Movement. (#284)
- Improve handling of event ticking when units change team. (#286)

### Fixes
- Fix for Restart Mission (#227)
Expand Down Expand Up @@ -293,9 +303,13 @@ All notable changes to Vanilla Behaviour will be documented in this file.
future mission. (#257)
- Fix issue where wounded units could recover health permanently when deployed
in an Avenger mission, resulting in a bad UnitState. (#258)



- Allow Escape key to cancel hacks. (#278)
- Fix Divide by Zero errors in hacking UI. (#279)
- Fix GetHackDefenseForTarget when hack defense drops below zero. (#281)
- Fix Grapple not resetting bSteppingOutOfCover. (#283)
- When handling loot, check for existing BattleDataState and HQState on the
current state object. (#285)
- Ensure max objective count correctly spawns in SelectObjectiveSpawns (#287)



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ function int GetVersionNumber(optional out int Major, optional out int Minor, op
defaultproperties
{
MajorVersion = 1;
MinorVersion = 4;
MinorVersion = 5;
}

25 changes: 19 additions & 6 deletions X2CommunityHighlander/Src/XComGame/Classes/Helpers_LW.uc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// PURPOSE: Extra helper functions/data. Cannot add new data to native classes (e.g. Helpers)
// so we need a new one.
//---------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------

class Helpers_LW extends Object config(GameCore) dependson(Engine);

Expand Down Expand Up @@ -50,7 +50,7 @@ var config bool EnableCivilianYellOnPreMove;
// out of LoS from a green unit, and that neighboring tile that they would have LoS from is the tile they will use to
// peek. The unit will appear to be out of LoS of any unit, but any action that alerts that nearby pod will suddenly
// bring you into LoS and activate the pod when it begins peeking. Examples are a nearby out-of-los pod activating when you
// shoot at another pod you can see from concealment, or a nearby pod activating despite no aliens being in LoS when you
// shoot at another pod you can see from concealment, or a nearby pod activating despite no aliens being in LoS when you
// break concealment by hacking an objective (which alerts all pods).
var config bool NoPeekInYellowAlert;
// End Issue #122
Expand Down Expand Up @@ -82,7 +82,7 @@ var config array<name> GrenadeRequiresWorldEffectToAffectUnit;
// End Issue #48

// Returns 'true' if the given mission type should enable the radius manager (e.g. the thingy
// that controls rescue rings on civvies). This is done through a config var that lists the
// that controls rescue rings on civvies). This is done through a config var that lists the
// desired mission types for extensibility.

// Start Issue #176
Expand All @@ -94,7 +94,7 @@ var config bool EnableRestartMissionButtonInIronman;
// A list of replacement projectile sound effects mapping a projectile element to a sound cue name.
//
// 'ProjectileName' can have one of two forms:
//
//
// 1) (Preferred), the full path of the object archetype of the projectile element you want to modify. This is the
// name as it appears in the Unreal Editor X2UnifiedProjectile "Projectile Elements" array, without the surrounding
// X2UnifiedProjectileElement''. That is, for the vanilla beam assault rifle, the path for the element with the
Expand All @@ -109,7 +109,7 @@ var config bool EnableRestartMissionButtonInIronman;
// actually index 15 at runtime.
//
// The first form is preferred because it is always the same regardless of hit/miss settings that may impact the
// index on some projectiles, making it impossible to statically provide the right index. The second form is
// index on some projectiles, making it impossible to statically provide the right index. The second form is
// still provided for backwards compatibility.
//
// The fire or death sound is the name of a sound cue loaded into the sound manager system. See the SoundCuePaths
Expand Down Expand Up @@ -173,6 +173,19 @@ var config bool ClampGrazeMinDamage;
var config bool CumulativeRupture;
// End Issue #228

// Start Issue #276
// Configure ever vigilant trigger behavior: If these flags are set EV will not proc when a unit is impaired or
// burning, respectively.
var config bool EverVigilantExcludeImpaired;
var config bool EverVigilantExcludeBurning;
// End Issue #276

// Start Issue #277
// If this flag is set then set the HP for soldier VIP proxies to have the same HP as the original soldier.
// This addresses an issue where the soldier has more HP than the proxy and becomes wounded even if the proxy
// was not wounded, simply because the soldier HP was greater than the proxy.
var config bool UseUnitHPForProxies;
// End Issue #277

simulated static function class<object> LWCheckForRecursiveOverride(class<object> ClassToCheck)
{
Expand All @@ -181,7 +194,7 @@ simulated static function class<object> LWCheckForRecursiveOverride(class<object
local bool NeedsCheck;
local name BestClassName;

BestClassName = name(string(ClassToCheck));
BestClassName = name(string(ClassToCheck));
CurrentBestClass = ClassToCheck;
NeedsCheck = true;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//---------------------------------------------------------------------------------------
// FILE: LWXComGameVersionTemplate.uc
// AUTHOR: tracktwo (Pavonis Interactive)
// PURPOSE: Version information for the LW2 XComGame replacement.
//
// PURPOSE: Version information for the LW2 XComGame replacement.
//
// This is implemented as a template to allow mods to detect whether the LW2 XComGame replacement
// is installed, independent of LW2 itself. It's a template to avoid needing to compile against any
// new sources to get mods to build (which would then crash the game if it tried to access a function
Expand Down Expand Up @@ -57,6 +57,5 @@ function int GetVersionNumber(optional out int Major, optional out int Minor, op
defaultproperties
{
MajorVersion = 1;
MinorVersion = 4;
MinorVersion = 5;
}

78 changes: 47 additions & 31 deletions X2CommunityHighlander/Src/XComGame/Classes/UIHackingScreen.uc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// PURPOSE: Displays hacking overlay during tactical missions.
//---------------------------------------------------------------------------------------
// Copyright (c) 2016 Firaxis Games, Inc. All rights reserved.
//---------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------

class UIHackingScreen extends UIScreen;

Expand All @@ -23,6 +23,7 @@ var float m_hackDuration;
var bool m_SkullJacking;
var bool m_SkullMining;
var bool m_hackStarted;
var bool m_hackCanceled; // Issue #278
var bool bWaitingForInput;
var int m_rewardsTaken;

Expand Down Expand Up @@ -91,7 +92,7 @@ simulated function InitScreen(XComPlayerController InitController, UIMovie InitM
m_SkullJacking = (HackAbilityTemplate.FinalizeAbilityName == 'FinalizeSKULLJACK');
m_SkullMining = (HackAbilityTemplate.FinalizeAbilityName == 'FinalizeSKULLMINE');
MC.FunctionNum("SetScreenType", (m_SkullJacking || m_SkullMining) ? 1 : 0);

//set up the advent splash screen text
MC.BeginFunctionOp("SetAdventStartScreen");
MC.QueueString(m_AdventName);
Expand All @@ -111,6 +112,8 @@ simulated function InitScreen(XComPlayerController InitController, UIMovie InitM
HackOffense = class'X2AbilityToHitCalc_Hacking'.static.GetHackAttackForUnit(UnitState, FinalizeHackAbility);
HackDefense = class'X2AbilityToHitCalc_Hacking'.static.GetHackDefenseForTarget(HackTargetObject);

//`LOG ("Hack Defense is" @ HackDefense);

// always select the first selectable hack reward (the one in slot 1)
SelectedHackRewardOption = 1;
HighlightedHackRewardOption = -1;
Expand Down Expand Up @@ -162,7 +165,7 @@ simulated function OnInit()
{
ButtonMC.Invoke("setStyle", AsParamArray);
// (kmartinez) Array was storing a copy of the object, so I had to remove it, modify it,
// then add it back in.
// then add it back in.
AsParamArray.RemoveItem(GeneralASValue);
GeneralASValue.Type = AS_String;
GeneralASValue.s = class 'UIUtilities_Input'.static.GetBackButtonIcon();
Expand Down Expand Up @@ -233,14 +236,14 @@ simulated function PopulateResultsInfo()
}

AS_SetResultInfo(
i,
false,
i,
false,
Template.GetFriendlyName(),
Template.RewardImagePath,
Template.GetDescription(HackTargetObject),
strRewardUnlockedLabel,
strUnlockChanceLabel,
GetHackChance(i) $ "\%",
strRewardUnlockedLabel,
strUnlockChanceLabel,
GetHackChance(i) $ "\%",
Template.bBadThing,
FailText);
}
Expand All @@ -253,15 +256,15 @@ simulated function PopulateResultsInfo()
simulated function float GetHackChance(int RewardIndex)
{
local X2HackRewardTemplate Template;
Template = HackRewards[RewardIndex];
if( Template.bBadThing )
{
`Assert(SelectedHackRewardOption != 0);
return 100.0 - GetHackChance(SelectedHackRewardOption);
}
else if( Template.MinHackSuccess == 0 )
else if( Template.MinHackSuccess == 0 || HackDefense < 1) // Issue #279 - attempted bugfix for d by 0 errors
{
return 100.0;
}
Expand All @@ -277,11 +280,10 @@ simulated function PopulateSoldierInfo()
local XGUnit Unit;
Unit = XGUnit(UnitState.GetVisualizer());
//AS_SetSoldierInfo(class'UIUtilities_Text'.static.GetColoredText(Caps(`GET_RANK_STR(Unit.GetCharacterRank(), Unit.GetVisualizedGameState().GetSoldierClassTemplateName())), euiState_Faded, 17),
// Issue #107
AS_SetSoldierInfo(class'UIUtilities_Text'.static.GetColoredText(Caps(class'LWUtilities_Ranks'.static.GetRankName(Unit.GetCharacterRank(), Unit.GetVisualizedGameState().GetSoldierClassTemplateName(), UnitState)), euiState_Faded, 17),
class'UIUtilities_Text'.static.GetColoredText(Caps(UnitState.GetName(eNameType_Full)), eUIState_Normal, 22),
//AS_SetSoldierInfo(class'UIUtilities_Text'.static.GetColoredText(Caps(`GET_RANK_STR(Unit.GetCharacterRank(), Unit.GetVisualizedGameState().GetSoldierClassTemplateName())), euiState_Faded, 17),
AS_SetSoldierInfo(class'UIUtilities_Text'.static.GetColoredText(Caps(class'LWUtilities_Ranks'.static.GetRankName(Unit.GetCharacterRank(), Unit.GetVisualizedGameState().GetSoldierClassTemplateName(), UnitState)), euiState_Faded, 17),
class'UIUtilities_Text'.static.GetColoredText(Caps(UnitState.GetName(eNameType_Full)), eUIState_Normal, 22),
class'UIUtilities_Text'.static.GetColoredText(Caps(UnitState.GetNickName(false)), eUIState_Header, 30),
//class'UIUtilities_Image'.static.GetRankIcon(Unit.GetCharacterRank(), Unit.GetVisualizedGameState().GetSoldierClassTemplateName()),
// Issue #107
Expand Down Expand Up @@ -310,7 +312,7 @@ simulated function PopulateEnemyInfo()
factionName = m_strAlienInfoTitle;
}
AS_SetEnemyInfo(class'UIUtilities_Text'.static.GetColoredText(Caps(factionName), euiState_Faded, 17),
AS_SetEnemyInfo(class'UIUtilities_Text'.static.GetColoredText(Caps(factionName), euiState_Faded, 17),
class'UIUtilities_Text'.static.GetColoredText(Caps(TargetUnit.GetName(eNameType_Full)), eUIState_Normal, 22),
"img:///" $ template.strHackIconImage,
strHackAbilityLabel,
Expand All @@ -319,7 +321,7 @@ simulated function PopulateEnemyInfo()
else
{
VisActor = XComInteractiveLevelActor(ObjectState.GetVisualizer());
AS_SetEnemyInfo("",
AS_SetEnemyInfo("",
class'UIUtilities_Text'.static.GetColoredText(Caps(ObjectState.GetLootingName()), eUIState_Normal, 22),
"img:///" $ class'Object'.static.PathName(VisActor.HackingIcon),
strHackAbilityLabel,
Expand All @@ -331,11 +333,25 @@ simulated function bool OnCancel(optional string arg = "")
{
local XComGameStateContext_Ability CancelContext;

`assert(!m_hackStarted);
// Start Issue #278
// PI Mods: The input handler code only prevents cancellation with the mouse on the cancel button after
// a hack is started, it doesn't prevent the ESC key from triggering OnCancel, so this assertion may often
// fire. Just turn off the assert and guard the cancellation context in a check for hackStarted so we don't
// block impatient players.
// `assert(!m_hackStarted);
`assert(CancelHackAbility != none);

CancelContext = class'XComGameStateContext_Ability'.static.BuildContextFromAbility(CancelHackAbility, OriginalContext.InputContext.PrimaryTarget.ObjectID);
`GAMERULES.SubmitGameStateContext(CancelContext);
// PI Mods: Don't submit a cancel context if the hack has already been started: this refunds the cooldown
// so players could bypass CDs by quickly hitting ESC after starting a hack. Also don't re-cancel if it
// has already been canceled (e.g. by players spamming the ESC key) to avoid multiple cancel states
// from being submitted and potentially restoring multiple charges.
if (!m_hackStarted && !m_hackCanceled)
{
CancelContext = class'XComGameStateContext_Ability'.static.BuildContextFromAbility(CancelHackAbility, OriginalContext.InputContext.PrimaryTarget.ObjectID);
`GAMERULES.SubmitGameStateContext(CancelContext);
m_hackCanceled = true;
}
// End Issue #278

ClearTimer('StartScaryComputerLoopAkEvent');

Expand Down Expand Up @@ -376,7 +392,7 @@ simulated function bool OnUnrealCommand(int ucmd, int ActionMask)
// Ignore releases, just pay attention to presses.
if ( !CheckInputIsReleaseOrDirectionRepeat(ucmd, ActionMask) )
return true;

if( bWaitingForInput )
{
HackEnded();
Expand All @@ -388,7 +404,7 @@ simulated function bool OnUnrealCommand(int ucmd, int ActionMask)
case (class'UIUtilities_Input'.const.FXS_BUTTON_A) :
case (class'UIUtilities_Input'.const.FXS_KEY_ENTER):
case (class'UIUtilities_Input'.const.FXS_KEY_SPACEBAR):

if( !m_hackStarted )
{
InitiateHack();
Expand All @@ -411,7 +427,7 @@ simulated function bool OnUnrealCommand(int ucmd, int ActionMask)
HighlightedHackRewardOption = 1;
RefreshPreviewState();
break;

case class'UIUtilities_Input'.const.FXS_VIRTUAL_LSTICK_RIGHT:
case class'UIUtilities_Input'.const.FXS_DPAD_RIGHT:
SelectedHackRewardOption = 2;
Expand Down Expand Up @@ -453,7 +469,7 @@ simulated function OnCommand( string cmd, string arg )
OnHackingRewardUnlocked(m_rewardsTaken);
}
m_rewardsTaken++;

break;

case "SelectReward":
Expand Down Expand Up @@ -599,14 +615,14 @@ simulated function AS_SetChooseRewards(string buttonLabel)
simulated function AS_SetResultInfo(
int rewardID,
bool bUnlocked,
string unlockTitle,
string unlockImage,
string unlockDescription,
string unlockLabel,
string unlockChanceLabel,
string unlockChance,
int rewardID,
bool bUnlocked,
string unlockTitle,
string unlockImage,
string unlockDescription,
string unlockLabel,
string unlockChanceLabel,
string unlockChance,
bool bBadThing,
string failText)
{
Expand Down
Loading

0 comments on commit b0c1b68

Please sign in to comment.