Skip to content

Commit

Permalink
Add X2Condition_RevivalProtocol to source.
Browse files Browse the repository at this point in the history
  • Loading branch information
ps2guides committed Nov 28, 2024
1 parent 5a471c8 commit 65189ab
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//---------------------------------------------------------------------------------------
// FILE: X2Condition_RevivalProtocol.uc
// AUTHOR: Joshua Bouscher
//
//---------------------------------------------------------------------------------------
// Copyright (c) 2016 Firaxis Games, Inc. All rights reserved.
//---------------------------------------------------------------------------------------
class X2Condition_RevivalProtocol extends X2Condition;

event name CallMeetsCondition(XComGameState_BaseObject kTarget)
{
local XComGameState_Unit TargetUnit;

TargetUnit = XComGameState_Unit(kTarget);
if (TargetUnit == none)
return 'AA_NotAUnit';

if (!TargetUnit.GetMyTemplate().bCanBeRevived || TargetUnit.IsBeingCarried() )
return 'AA_UnitIsImmune';

if (TargetUnit.IsPanicked() || TargetUnit.IsUnconscious() || TargetUnit.IsDisoriented() || TargetUnit.IsDazed())
return 'AA_Success';

return 'AA_UnitIsNotImpaired';
}

event name CallMeetsConditionWithSource(XComGameState_BaseObject kTarget, XComGameState_BaseObject kSource)
{
local XComGameState_Unit SourceUnit, TargetUnit;

SourceUnit = XComGameState_Unit(kSource);
TargetUnit = XComGameState_Unit(kTarget);

if (SourceUnit == none || TargetUnit == none)
return 'AA_NotAUnit';

if (SourceUnit.ControllingPlayer == TargetUnit.ControllingPlayer)
return 'AA_Success';

return 'AA_UnitIsHostile';
}
3 changes: 3 additions & 0 deletions X2WOTCCommunityHighlander/X2WOTCCommunityHighlander.x2proj
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,9 @@
<Content Include="Src\XComGame\Classes\X2ChosenActionTemplate.uc">
<SubType>Content</SubType>
</Content>
<Content Include="Src\XComGame\Classes\X2Condition_RevivalProtocol.uc">
<SubType>Content</SubType>
</Content>
<Content Include="Src\XComGame\Classes\X2Condition_StasisLanceTarget.uc">
<SubType>Content</SubType>
</Content>
Expand Down

0 comments on commit 65189ab

Please sign in to comment.