DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ OnAnimationPhaseStarted()

override void RemoteDetonatorReceiver::OnAnimationPhaseStarted ( string animSource,
float phase )
protected

См. определение в файле RemoteDetonator.c строка 371

372{
373 OFF = 0,
374 LIT,
375}
376
377class RemoteDetonator : Inventory_Base
378{
379 const string COLOR_LED_OFF = "#(argb,8,8,3)color(0,0,0,1.0,co)";
380 const string COLOR_LED_LIT = "#(argb,8,8,3)color(1,0,0,1.0,co)";
381 const string SELECTION_NAME_LED = "LED";
382
384
385 bool IsKit()
386 {
387 return true;
388 }
389
390 void UpdateLED(ERemoteDetonatorLEDState pState, bool pForced = false)
391 {
392 int selectionIdx = GetHiddenSelectionIndex(SELECTION_NAME_LED);
393
394 switch (pState)
395 {
397 SetObjectTexture(selectionIdx, COLOR_LED_LIT);
398 break;
399 default:
400 SetObjectTexture(selectionIdx, COLOR_LED_OFF);
401 }
402
403 m_LastLEDState = pState;
404 SetSynchDirty();
405 }
406
407 override void SetActions()
408 {
409 super.SetActions();
410
413 }
414}
415
416class RemoteDetonatorTrigger : RemoteDetonator
417{
418 protected const string ANIM_PHASE_TRIGGER = "trigger";
419
420 protected bool m_LED;
421 protected ref RemotelyActivatedItemBehaviour m_RAIB;
422
424 {
425 m_RAIB = new RemotelyActivatedItemBehaviour(this);
426 m_RAIB.SetTrigger();
427
428 RegisterNetSyncVariableInt("m_RAIB.m_PairDeviceNetIdLow");
429 RegisterNetSyncVariableInt("m_RAIB.m_PairDeviceNetIdHigh");
430 RegisterNetSyncVariableInt("m_LastLEDState", 0, EnumTools.GetEnumSize(ERemoteDetonatorLEDState));
431
433 }
434
435 override bool IsKit()
436 {
437 return false;
438 }
439
440 override void OnVariablesSynchronized()
441 {
442 super.OnVariablesSynchronized();
443
444 if (m_RAIB)
445 {
446 m_RAIB.OnVariableSynchronized();
447 }
448
450 }
451
452 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
453 {
454 super.EEItemLocationChanged(oldLoc, newLoc);
455
456 if (m_RAIB)
457 {
458 m_RAIB.Pair();
459 }
460 }
461
462 override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
463 {
464 return m_RAIB;
465 }
466
467 override void OnCEUpdate()
468 {
469 super.OnCEUpdate();
470
471 if (!IsRuined() && IsConnected() && GetControlledDevice())
472 {
473 if (vector.DistanceSq(GetPosition(), GetControlledDevice().GetPosition()) <= Math.SqrFloat(UAMaxDistances.EXPLOSIVE_REMOTE_ACTIVATION))
474 {
476
477 return;
478 }
479 }
480
482 }
483
484 override void PairRemote(notnull EntityAI trigger)
485 {
486 m_RAIB.Pair(trigger);
487 }
488
489 override void UnpairRemote()
490 {
492 m_RAIB.Unpair();
493 }
494
495 override void OnActivatedByItem(notnull ItemBase item)
496 {
497 if (GetGame().IsServer())
498 {
499 if (m_RAIB.IsPaired() && !IsRuined())
500 {
501 ItemBase device = ItemBase.Cast(GetControlledDevice());
502 if (device && vector.DistanceSq(GetPosition(), device.GetPosition()) <= Math.SqrFloat(UAMaxDistances.EXPLOSIVE_REMOTE_ACTIVATION))
503 {
504 device.OnActivatedByItem(this);
505 }
506 }
507 }
508 }
509
510 void SetControlledDevice(EntityAI pDevice)
511 {
512 m_RAIB.Pair(pDevice);
513 }
514
515 bool IsConnected()
516 {
517 return m_RAIB.IsPaired();
518 }
519
521 {
522 return m_RAIB.GetPairDevice();
523 }
524
525 static RemoteDetonatorTrigger SpawnInPlayerHands(notnull EntityAI pEntity, EntityAI deviceToPair = null)
526 {
527 string type = "RemoteDetonatorTrigger";
529 PlayerBase player = PlayerBase.Cast(pEntity);
530 if (player)
531 {
532 ItemBase inHandsItem = player.GetItemInHands();
533 if (inHandsItem)
534 {
535 if (deviceToPair)
536 {
537 ReplaceDetonatorItemOnArmLambda onArmLambda = new ReplaceDetonatorItemOnArmLambda(inHandsItem, type);
538 onArmLambda.SetPairDevice(deviceToPair);
539 MiscGameplayFunctions.TurnItemIntoItemEx(player, onArmLambda);
540 }
541 else
542 {
543 ReplaceDetonatorItemLambda lambda = new ReplaceDetonatorItemLambda(inHandsItem, type);
544 MiscGameplayFunctions.TurnItemIntoItemEx(player, lambda);
545 }
546
547
548 rdt = RemoteDetonatorTrigger.Cast(player.GetItemInHands());
549 }
550 else
551 rdt = RemoteDetonatorTrigger.Cast(player.GetHumanInventory().CreateInHands(type));
552
554 if (player.GetItemInHands())
555 player.GetItemAccessor().OnItemInHandsChanged();
556 }
557
558 return rdt;
559 }
560
561 override void OnAnimationPhaseStarted(string animSource, float phase)
562 {
563 if (animSource == ANIM_PHASE_TRIGGER)
564 {
565 if (phase > 0.01)
566 {
568 }
569 }
570 }
571
572 override void SetActions()
573 {
574 super.SetActions();
575
577
578 AddAction(ActionAttachOnTrap);
580 AddAction(ActionTriggerRemotely);
581 }
582
583#ifdef DIAG_DEVELOPER
584 override protected string GetDebugText()
585 {
586 string debug_output;
587 debug_output += string.Format("low net id: %1\n", m_RAIB.GetPairDeviceNetIdLow());
588 debug_output += string.Format("high net id: %1\n", m_RAIB.GetPairDeviceNetIdHigh());
589 debug_output += string.Format("pair device: %1\n", m_RAIB.GetPairDevice());
590 return debug_output;
591 }
592#endif
593}
594
595class RemoteDetonatorReceiver : RemoteDetonator
596{
598 {
600 }
601
602 override bool IsKit()
603 {
604 return false;
605 }
606
607 override void OnWasDetached(EntityAI parent, int slot_id)
608 {
610 }
611
612 override void EEKilled(Object killer)
613 {
614 super.EEKilled(killer);
615
617 }
618
619 override void SetActions()
620 {
621 super.SetActions();
622
625 }
626}
627
629{
630 override void CopyOldPropertiesToNew(notnull EntityAI old_item, EntityAI new_item)
631 {
632 super.CopyOldPropertiesToNew(old_item, new_item);
633
634 MiscGameplayFunctions.TransferItemProperties(old_item, new_item);
635 }
636}
637
638class ReplaceDetonatorItemOnArmLambda : ReplaceDetonatorItemLambda
639{
640 EntityAI m_PairDevice
641
642 void SetPairDevice(EntityAI device)
643 {
644 m_PairDevice = device;
645 }
646
647 override void OnSuccess(EntityAI new_item)
648 {
649 super.OnSuccess(new_item);
650
651 RemoteDetonator detonator = RemoteDetonator.Cast(new_item);
652 if (detonator)
653 {
654 ExplosivesBase explosive = ExplosivesBase.Cast(m_PairDevice);
655 if (explosive)
656 {
657 ItemBase receiver = ItemBase.Cast(explosive.GetInventory().CreateAttachment("RemoteDetonatorReceiver"));
658 if (receiver)
659 {
660 MiscGameplayFunctions.TransferItemProperties(detonator, receiver);
661 receiver.LockToParent();
662 explosive.SetTakeable(false);
663 explosive.PairWithDevice(detonator);
664 explosive.Arm();
665 }
666 }
667 }
668 }
669
670 override void OnAbort()
671 {
672 ExplosivesBase explosive = ExplosivesBase.Cast(m_PairDevice);
673 if (explosive)
674 {
675 explosive.LockTriggerSlots();
676 explosive.SetTakeable(true);
677 }
678 }
679}
680
682{
683 override void OnSuccess(EntityAI new_item)
684 {
685 super.OnSuccess(new_item);
686
687 RemoteDetonator detonator = RemoteDetonator.Cast(m_OldItem);
688 if (detonator)
689 {
690 if (detonator.GetRemotelyActivatedItemBehaviour())
691 {
692 ExplosivesBase explosive = ExplosivesBase.Cast(detonator.GetRemotelyActivatedItemBehaviour().GetPairDevice());
693 if (explosive)
694 {
695 explosive.Disarm();
696 }
697 }
698 }
699 }
700
701 override void OnAbort()
702 {
703 super.OnAbort();
704
705 RemoteDetonator detonator = RemoteDetonator.Cast(m_OldItem);
706 if (detonator)
707 {
708 if (detonator.GetRemotelyActivatedItemBehaviour())
709 {
710 ExplosivesBase explosive = ExplosivesBase.Cast(detonator.GetRemotelyActivatedItemBehaviour().GetPairDevice());
711 if (explosive)
712 {
713 explosive.LockExplosivesSlots();
714 }
715 }
716 }
717 }
718}
class LogManager EntityAI
ActionAttachExplosivesTriggerCB ActionContinuousBaseCB ActionAttachExplosivesTrigger()
Определения ActionAttachExplosivesTrigger.c:11
ActionDisarmExplosiveWithRemoteDetonatorCB ActionDisarmExplosiveCB ActionDisarmExplosiveWithRemoteDetonator()
ActionDisarmExplosiveWithRemoteDetonatorUnpairedCB ActionDisarmExplosiveCB ActionDisarmExplosiveWithRemoteDetonatorUnpaired()
void AddAction(typename actionName)
Определения AdvancedCommunication.c:220
void RemoveAction(typename actionName)
Определения AdvancedCommunication.c:252
void SetActions()
Определения AdvancedCommunication.c:213
class EconomyOutputStrings OFF
override void EEKilled(Object killer)
Определения ExplosivesBase.c:100
void ExplosivesBase()
Определения ExplosivesBase.c:42
class GP5GasMask extends MaskBase ItemBase
const string COLOR_LED_OFF
Определения Land_Underground_Panel.c:21
void UpdateLED(string selection, string color)
Определения Land_Underground_Panel.c:331
string GetDebugText()
Определения ModifierBase.c:71
void UpdateLED(ERemoteDetonatorLEDState pState, bool pForced=false)
Определения RemoteDetonator.c:20
RemoteDetonatorTrigger RemoteDetonator RemoteDetonatorReceiver()
Определения RemoteDetonator.c:227
bool IsKit()
Определения RemoteDetonator.c:15
ERemoteDetonatorLEDState m_LastLEDState
Определения RemoteDetonator.c:13
ERemoteDetonatorLEDState
Определения RemoteDetonator.c:2
@ LIT
Определения RemoteDetonator.c:4
const string COLOR_LED_LIT
Определения RemoteDetonator.c:10
override void OnWasDetached(EntityAI parent, int slot_id)
Определения RemoteDetonator.c:237
const string SELECTION_NAME_LED
Определения RemoteDetonator.c:11
ReplaceDetonatorItemLambda ReplaceItemWithNewLambdaBase SetPairDevice(EntityAI device)
Определения RemoteDetonator.c:272
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
Определения RemoteDetonator.c:82
override void SetActions()
Определения RemoteDetonator.c:202
EntityAI GetControlledDevice()
Определения RemoteDetonator.c:150
static RemoteDetonatorTrigger SpawnInPlayerHands(notnull EntityAI pEntity, EntityAI deviceToPair=null)
Определения RemoteDetonator.c:155
override void OnActivatedByItem(notnull ItemBase item)
Определения RemoteDetonator.c:125
bool m_LED
Определения RemoteDetonator.c:50
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
Определения RemoteDetonator.c:92
void SetControlledDevice(EntityAI pDevice)
Определения RemoteDetonator.c:140
override void OnCEUpdate()
Определения RemoteDetonator.c:97
override void OnAnimationPhaseStarted(string animSource, float phase)
Определения RemoteDetonator.c:191
override void UnpairRemote()
Определения RemoteDetonator.c:119
const string ANIM_PHASE_TRIGGER
Определения RemoteDetonator.c:48
void RemoteDetonatorTrigger()
Определения RemoteDetonator.c:53
ref RemotelyActivatedItemBehaviour m_RAIB
Определения RemoteDetonator.c:51
override bool IsKit()
Определения RemoteDetonator.c:65
override void PairRemote(notnull EntityAI trigger)
Определения RemoteDetonator.c:114
bool IsConnected()
Определения RemoteDetonator.c:145
override void OnVariablesSynchronized()
Определения RemoteDetonator.c:70
override void CopyOldPropertiesToNew(notnull EntityAI old_item, EntityAI new_item)
Определения RemoteDetonator.c:260
override void OnSuccess(EntityAI new_item)
Определения RemoteDetonator.c:313
override void OnAbort()
Определения RemoteDetonator.c:331
void OnAbort()
Step Out - notification on abort.
Определения ReplaceItemWithNewLambdaBase.c:226
void OnSuccess(EntityAI new_item)
Step H. - notification on finish.
Определения ReplaceItemWithNewLambdaBase.c:216
void CopyOldPropertiesToNew(notnull EntityAI old_item, EntityAI new_item)
Step E. copy properties from old object to the created one.
Определения ReplaceItemWithNewLambdaBase.c:185
base class for transformation operations (creating one item from another)
Определения ReplaceItemWithNewLambdaBase.c:5
class LOD Object
proto native CGame GetGame()
class JsonUndergroundAreaTriggerData GetPosition
Определения UndergroundAreaLoader.c:9
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.