DayZ 1.24
Loading...
Searching...
No Matches
ChainedDropAndRestrainLambda Class Reference
Inheritance diagram for ChainedDropAndRestrainLambda:
[legend]
Collaboration diagram for ChainedDropAndRestrainLambda:
[legend]

Private Member Functions

void ChainedDropAndRestrainLambda (EntityAI old_item, string new_item_type, PlayerBase player, bool destroy=false, PlayerBase src_player=null)
 
override void OnSuccess (EntityAI new_item)
 
override void CopyOldPropertiesToNew (notnull EntityAI old_item, EntityAI new_item)
 
- Private Member Functions inherited from DestroyItemInCorpsesHandsAndCreateNewOnGndLambda
override void RemoveOldItemFromLocation ()
 

Private Attributes

PlayerBase m_SourcePlayer
 
ExplosivesBase m_PairedExplosive
 

Detailed Description

Definition at line 146 of file ActionRestrainTarget.c.

Constructor & Destructor Documentation

◆ ChainedDropAndRestrainLambda()

void ChainedDropAndRestrainLambda::ChainedDropAndRestrainLambda ( EntityAI old_item,
string new_item_type,
PlayerBase player,
bool destroy = false,
PlayerBase src_player = null )
inlineprivate

Definition at line 151 of file ActionRestrainTarget.c.

References m_SourcePlayer.

Member Function Documentation

◆ CopyOldPropertiesToNew()

override void ChainedDropAndRestrainLambda::CopyOldPropertiesToNew ( notnull EntityAI old_item,
EntityAI new_item )
inlineprivate

Definition at line 183 of file ActionRestrainTarget.c.

184 {
185 super.CopyOldPropertiesToNew(old_item, new_item);
187 if (trigger)
188 m_PairedExplosive = ExplosivesBase.Cast(trigger.GetControlledDevice());
189 }

References m_PairedExplosive.

◆ OnSuccess()

override void ChainedDropAndRestrainLambda::OnSuccess ( EntityAI new_item)
inlineprivate

Definition at line 156 of file ActionRestrainTarget.c.

157 {
158 super.OnSuccess(new_item);
159
161 {
162 m_PairedExplosive.UnpairRemote();
164 ib.PairWithDevice(m_PairedExplosive);
165 m_PairedExplosive.Arm();
166 }
167
168 // as soon as previous op is finish, start another one
169 EntityAI item_in_hands_source = m_SourcePlayer.GetHumanInventory().GetEntityInHands();
171 {
172 string new_item_name = MiscGameplayFunctions.ObtainRestrainItemTargetClassname(item_in_hands_source);
174 if (m_SourcePlayer)
175 m_SourcePlayer.LocalReplaceItemInHandsWithNewElsewhere(lambda);
176 else
177 Error("ChainedDropAndRestrainLambda: missing source player!");
178 }
179 else
180 Error("ChainedDropAndRestrainLambda: missing source item in hands!");
181 }
void RestrainTargetPlayerLambda(EntityAI old_item, string new_item_type, PlayerBase player)
DayZPlayer m_Player
Definition Hand_Events.c:42
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90

References Error(), m_PairedExplosive, m_Player, m_SourcePlayer, and RestrainTargetPlayerLambda().

Member Data Documentation

◆ m_PairedExplosive

ExplosivesBase ChainedDropAndRestrainLambda::m_PairedExplosive
private

Definition at line 149 of file ActionRestrainTarget.c.

Referenced by CopyOldPropertiesToNew(), and OnSuccess().

◆ m_SourcePlayer

PlayerBase ChainedDropAndRestrainLambda::m_SourcePlayer
private

Definition at line 148 of file ActionRestrainTarget.c.

Referenced by ChainedDropAndRestrainLambda(), and OnSuccess().


The documentation for this class was generated from the following file: