123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- class ActionCPRCB : ActionContinuousBaseCB
- {
- private const float REPEAT_AFTER_SEC = 1;
-
- override void CreateActionComponent()
- {
- m_ActionData.m_ActionComponent = new CAContinuousRepeat(REPEAT_AFTER_SEC);
- }
- };
- class ActionCPR: ActionContinuousBase
- {
- void ActionCPR()
- {
- m_CallbackClass = ActionCPRCB;
- m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_CPR;
- m_FullBody = true;
- m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;
- m_SpecialtyWeight = UASoftSkillsWeight.ROUGH_HIGH;
- m_Text = "#cpr";
- }
-
- override typename GetInputType()
- {
- return ContinuousInteractActionInput;
- }
-
- override void OnStartClient(ActionData action_data)
- {
- action_data.m_Player.TryHideItemInHands(true);
- }
-
- override void OnStartServer(ActionData action_data)
- {
- super.OnStartServer(action_data);
-
- action_data.m_Player.TryHideItemInHands(true);
- }
-
- override void CreateConditionComponents()
- {
- m_ConditionItem = new CCINone;
- m_ConditionTarget = new CCTMan(UAMaxDistances.DEFAULT);
- }
- override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
- {
- PlayerBase other_player = PlayerBase.Cast(target.GetObject());
- bool holds_heavy_item = item && item.IsHeavyBehaviour();
- return other_player.IsUnconscious() && !holds_heavy_item;
- }
-
- /*override void OnFinishProgressClient(ActionData action_data)
- {
- action_data.m_Player.TryHideItemInHands(false);
- }*/
-
- override void OnFinishProgressServer(ActionData action_data)
- {
- PlayerBase other_player = PlayerBase.Cast(action_data.m_Target.GetObject());
- other_player.GiveShock(5);
- }
-
- override void OnExecuteServer(ActionData action_data)
- {
- }
-
- override void OnEndServer( ActionData action_data )
- {
- super.OnEndServer(action_data);
-
- if ( action_data.m_Player ) action_data.m_Player.TryHideItemInHands(false);
- }
-
- override void OnEndClient( ActionData action_data )
- {
- if ( action_data.m_Player ) action_data.m_Player.TryHideItemInHands(false);
- }
- };
|