3 [
Attribute(
desc:
"Name of the action for which user will wait befor transfering the shell to the mortar - f.e. CharacterFire which is LMB")]
6 [
Attribute(
desc:
"Name of the signal that will be used to adjust the volume of the fired projectile based on the number of used charge rings")]
9 [
Attribute(
"45 85 0",
desc:
"Minimum (X) and maximum (Y) vertical angle for the mortar's muzzle")]
34 [
Attribute(
desc:
"Position and rotation that will be used to play animation of dropping the shell")]
35 protected ref PointInfo m_LoaderPosition;
37 [
Attribute(
desc:
"Position and rotation that will be used to play animation of dropping the shell but from the left side")]
38 protected ref
PointInfo m_LoaderPositionLeft;
41 protected SCR_MortarShellGadgetComponent m_ShellComponent;
46 protected bool m_bLoadedFromLeftSide;
47 protected bool m_bBeingLoaded;
49 protected const string ANIM_EVENT_NAME_FIRE =
"MortarFireReady";
50 protected const string ANIM_EVENT_NAME_START =
"MortarFireStart";
51 protected const string ANIM_EVENT_NAME_END =
"Event_DetachCharacter";
52 protected const string ANIM_VARIABLE_FIRING =
"Firing";
53 protected const string ANIM_VARIABLE_LEFT_SIDE =
"IsLeftSide";
54 protected const string ANIM_BIND_COMMAND =
"CMD_Item_Action";
55 protected const string ANIM_ENTRY_POINT =
"FireMasterControl";
56 protected const string ANIM_BINDING_NAME =
"Weapon";
67 SCR_WeaponAttachmentsStorageComponent attachmentStorage = SCR_WeaponAttachmentsStorageComponent.Cast(owner.
FindComponent(SCR_WeaponAttachmentsStorageComponent));
68 if (attachmentStorage)
69 attachmentStorage.m_OnItemAddedToSlotInvoker.Insert(
OnShellLoaded);
72 m_LoaderPosition.Init(owner);
74 if (m_LoaderPositionLeft)
75 m_LoaderPositionLeft.Init(owner);
87 return m_bBeingLoaded;
93 m_bBeingLoaded = newState;
104 weaponManager.GetCurrentMuzzleTransform(transform);
123 SCR_MortarShellGadgetComponent shellGadget = SCR_MortarShellGadgetComponent.Cast(item.
FindComponent(SCR_MortarShellGadgetComponent));
140 void LoadShell(notnull SCR_MortarShellGadgetComponent shellComp, notnull
ChimeraCharacter character,
float fuzeTime = -1,
bool fromLeftSide =
false)
153 if (shellComp.IsUsingTimeFuze())
157 shellComp.SetFuzeTime(fuzeTime);
162 float timeToDetonation = shellComp.GetTimeToDetonation(elevation,
false);
163 shellComp.SetFuzeTime(timeToDetonation);
167 SCR_WeaponBlastComponent weaponBlastComponent = SCR_WeaponBlastComponent.Cast(
GetOwner().FindComponent(SCR_WeaponBlastComponent));
168 if (weaponBlastComponent)
169 weaponBlastComponent.OverrideInstigator(character);
172 if (!
data.GetFirePowerSignalName().IsEmpty() && signalsMgr)
174 int signalId = signalsMgr.AddOrFindSignal(
data.GetFirePowerSignalName());
176 signalsMgr.SetSignalValue(signalId, shellComp.GetCurentChargeRingConfig()[0]);
179 m_bBeingLoaded =
true;
184 shellComp.SetLoadedState(
true,
this);
185 m_bLoadedFromLeftSide = fromLeftSide;
191 m_MortarFireStart = -1;
193 if (!animationComponent)
198 RplComponent loaderRplComp = character.GetRplComponent();
210 m_ShellComponent = shellComp;
214 int itemActionId = animationComponent.BindCommand(ANIM_BIND_COMMAND);
219 animParams.SetAlignmentPoint(m_LoaderPositionLeft);
221 animParams.SetAlignmentPoint(m_LoaderPosition);
223 animParams.SetAllowMovementDuringAction(
false);
224 animParams.SetKeepInHandAfterSuccess(
false);
225 animParams.SetKeepGadgetVisible(
true);
226 animParams.SetIsMainUserOfTheItem(
false);
227 animParams.SetCommandID(itemActionId);
228 animParams.SetItemGraphEntryPoint(ANIM_ENTRY_POINT);
229 animParams.SetCharGraphBindingName(ANIM_BINDING_NAME);
249 if (!animationComponent)
256 const vector angleLimit =
data.GetVerticalAngleLimits();
258 animationComponent.SetAnimAimY(elevation);
260 TAnimGraphVariable varId = animationComponent.BindVariableBool(ANIM_VARIABLE_LEFT_SIDE);
262 animationComponent.SetSharedVariableBool(varId, loadedFromLeftSide,
true);
272 m_bBeingLoaded =
false;
274 if (animationComponent)
277 animationComponent.SetBoolVariable(varId,
true);
281 if (!projectileEntity)
284 SCR_MortarShellGadgetComponent shellComp = SCR_MortarShellGadgetComponent.Cast(projectileEntity.
FindComponent(SCR_MortarShellGadgetComponent));
286 shellComp.OnShellFired(
this);
292 if (!blamedCharacter)
295 BaseProjectileComponent projectileComp = BaseProjectileComponent.Cast(projectileEntity.
FindComponent(BaseProjectileComponent));
299 projectileComp.GetInstigator().SetInstigator(blamedCharacter);
309 if (!blamedCharacter)
312 AIControlComponent aiControlComp = controller.GetAIControlComponent();
314 return blamedCharacter;
316 AIAgent agent = aiControlComp.GetControlAIAgent();
322 return blamedCharacter;
325 if (!currentWaypoint)
326 return blamedCharacter;
332 return blamedCharacter;
340 if (!animationComponent)
343 animationComponent.SetBoolVariable(varId,
false);
362 if (animEventType == m_MortarFireEnd && controller)
365 if (!animationComponent)
370 commandHandler.FinishItemUse(
false);
379 if (camera && camera.GetOverrideDirectBoneMode() != 0)
380 camera.OverrideDirectBoneMode(0);
387 if (!m_ShellComponent)
390 if (animEventType != m_MortarFireReady)
401 if (
data && m_ShellComponent.SetLoadedState(
true,
this,
data.GetFireActionName(), owner))
413 if (camera && camera.GetOverrideDirectBoneMode() == 0)
428 if (!m_ShellComponent)
432 m_ShellComponent.UpdateVisibility(m_ShellComponent.GetMode());
433 m_ShellComponent.SetLoadedState(
false);
438 SCR_InventoryStorageManagerComponent playerInventory = SCR_InventoryStorageManagerComponent.Cast(
m_CharController.GetInventoryStorageManager());
439 if (!playerInventory)
442 SCR_WeaponAttachmentsStorageComponent weaponAttachmentStorage = SCR_WeaponAttachmentsStorageComponent.Cast(
GetOwner().FindComponent(SCR_WeaponAttachmentsStorageComponent));
443 if (!weaponAttachmentStorage)
446 SCR_InvEquipAnyItemCB inventoryCallBack =
new SCR_InvEquipAnyItemCB();
447 IEntity shellEntity = m_ShellComponent.GetOwner();
449 playerInventory.TryAssigningNextItemToQuickSlot(shellEntity, equipCallback: inventoryCallBack, equipNewItem:
true);
451 playerInventory.TryMoveItemToStorage(shellEntity, weaponAttachmentStorage, cb: inventoryCallBack);
452 m_ShellComponent = null;
455 if (!animationComponent)
460 animationComponent.SetVariableBool(varId,
true);
470 m_bBeingLoaded =
false;
481 if (camera && camera.GetOverrideDirectBoneMode() != 0)
483 camera.OverrideDirectBoneMode(0);
487 if (!m_ShellComponent)
491 m_ShellComponent.UpdateVisibility(m_ShellComponent.GetMode());
493 m_ShellComponent.SetLoadedState(
false);
494 m_ShellComponent = null;
501 RplComponent loaderRplComp = RplComponent.Cast(
Replication.FindItem(loaderRplId));
505 RplComponent shellRplComp = RplComponent.Cast(
Replication.FindItem(shellRplId));
513 IEntity shell = shellRplComp.GetEntity();
521 SCR_MortarShellGadgetComponent mortarShellComp = SCR_MortarShellGadgetComponent.Cast(shell.
FindComponent(SCR_MortarShellGadgetComponent));
522 if (!mortarShellComp)
525 mortarShellComp.SetFuzeTime(fuseTime);
526 mortarShellComp.SetLoadedState(
true,
this);
527 m_bBeingLoaded =
true;
ArmaReforgerScripted GetGame()
SCR_CharacterSoundComponentClass GetComponentData()
SCR_CharacterControllerComponent m_CharController
void OnAnimationEnded(IEntity item, bool successful, ItemUseParameters animParams)
Get all prefabs that have the spawner data
void SetAnimationAttributes(notnull CharacterControllerComponent controller, bool loadedFromLeftSide)
vector GetMuzzleDirection()
void OnShellLoaded(IEntity item, int slotID)
ChimeraCharacter FindResponsibleCharacter(notnull SCR_CharacterControllerComponent controller)
void ResetRecoilAnimationVariable(TAnimGraphVariable varId)
Method used to reset the animation variable to its default value.
void LoadShell(notnull SCR_MortarShellGadgetComponent shellComp, notnull ChimeraCharacter character, float fuzeTime=-1, bool fromLeftSide=false)
void TransferShellToMortar()
void SynchronizeLoaderData(RplId loaderRplId, RplId shellRplId, float fuseTime, bool loadedFromLeftSide)
float GetMuzzleElevation()
void SetLoadingState(bool newState)
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
TurretControllerComponent m_TurretController
proto external int SetEventMask(notnull IEntity owner, int mask)
void Rpc(func method, void p0=NULL, void p1=NULL, void p2=NULL, void p3=NULL, void p4=NULL, void p5=NULL, void p6=NULL, void p7=NULL)
proto external Managed FindComponent(typename typeName)
PointInfo - allows to define position.
Replication item identifier.
int GetFirstPlayerLeaderID()
static RplComponent GetEntityRplComponent(notnull IEntity entity)
vector m_vVerticalAngleLimits
string m_sFirePowerSignalName
string GetFireActionName()
string GetFirePowerSignalName()
vector GetVerticalAngleLimits()
OnItemWeaponFiredInvoker GetOnWeaponFired()
IEntity GetOwner()
Owner entity of the fuel tank.
override void EOnInit(IEntity owner)
event void OnAnimationEvent(AnimationEventID animEventType, AnimationEventID animUserString, int intParam, float timeFromStart, float timeToEnd)
SCR_FieldOfViewSettings Attribute
EntityEvent
Various entity events.
void RplRpc(RplChannel channel, RplRcver rcver, RplCondition condition=RplCondition.None, string customConditionName="")
RplChannel
Communication channel. Reliable is guaranteed to be delivered. Unreliable not.
proto native vector Vector(float x, float y, float z)