forked from X2CommunityCore/X2WOTCCommunityHighlander
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add X2Condition_RevivalProtocol to source.
- Loading branch information
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
X2WOTCCommunityHighlander/Src/XComGame/Classes/X2Condition_RevivalProtocol.uc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters