48 int animEvent = GetAnimEvent() & 0x0000ffff;
49 int evShl = m_eventID << 16;
50 return evShl | animEvent;
56 int packedType = GetPackedType();
57 ctx.Write(packedType);
59 ctx.Write(m_magazine);
62 string DumpToString ()
64 string res =
"{ WpnEv id=" +
typename.EnumToString(
WeaponEventID, GetEventID());
66 res = res +
" mag=" +
Object.GetDebugName(m_magazine);
88 void WeaponEventTriggerToJam (
DayZPlayer p = NULL, Magazine m = NULL) { m_eventID =
WeaponEventID.TRIGGER_JAM; }
94 void WeaponEventTriggerAutoStart (
DayZPlayer p = NULL, Magazine m = NULL) { m_eventID =
WeaponEventID.TRIGGER_AUTO_START; }
100 void WeaponEventTriggerAutoEnd (
DayZPlayer p = NULL, Magazine m = NULL) { m_eventID =
WeaponEventID.TRIGGER_AUTO_END; }
106 void WeaponEventLoad1Bullet (
DayZPlayer p = NULL, Magazine m = NULL) { m_eventID =
WeaponEventID.LOAD1_BULLET; }
112 void WeaponEventContinuousLoadBulletStart (
DayZPlayer p = NULL, Magazine m = NULL) { m_eventID =
WeaponEventID.CONTINUOUS_LOADBULLET_START; }
118 void WeaponEventContinuousLoadBulletEnd (
DayZPlayer p = NULL, Magazine m = NULL) { m_eventID =
WeaponEventID.CONTINUOUS_LOADBULLET_END; }
130 void WeaponEventAttachMagazine (
DayZPlayer p = NULL, Magazine m = NULL) { m_eventID =
WeaponEventID.ATTACH_MAGAZINE; }
136 void WeaponEventUnjammingFailedTimeout (
DayZPlayer p = NULL, Magazine m = NULL) { m_eventID =
WeaponEventID.UNJAMMING_FAILED_TIMEOUT; }
142 void WeaponEventUnjammingTimeout (
DayZPlayer p = NULL, Magazine m = NULL) { m_eventID =
WeaponEventID.UNJAMMING_TIMEOUT; }
155 super.ReadFromContext(ctx);
156 m_dst.ReadFromContext(ctx);
160 super.WriteToContext(ctx);
161 m_dst.WriteToContext(ctx);
173 super.ReadFromContext(ctx);
175 m_dst.ReadFromContext(ctx);
179 super.WriteToContext(ctx);
180 m_dst.WriteToContext(ctx);
187 void WeaponEventHumanCommandActionFinished (
DayZPlayer p = NULL, Magazine m = NULL) { m_eventID =
WeaponEventID.HUMANCOMMAND_ACTION_FINISHED; }
193 void WeaponEventHumanCommandActionAborted (
DayZPlayer p = NULL, Magazine m = NULL) { m_eventID =
WeaponEventID.HUMANCOMMAND_ACTION_ABORTED; }
199 void WeaponEventReloadTimeout (
DayZPlayer p = NULL, Magazine m = NULL) { m_eventID =
WeaponEventID.RELOAD_TIMEOUT; }
205 void WeaponEventDryFireTimeout (
DayZPlayer p = NULL, Magazine m = NULL) { m_eventID =
WeaponEventID.DRY_FIRE_TIMEOUT; }
212 void WeaponEventSetNextMuzzleMode (
DayZPlayer p = NULL, Magazine m = NULL) { m_eventID =
WeaponEventID.SET_NEXT_MUZZLE_MODE; }
219 override int GetAnimEvent () {
return m_type; }
228 case WeaponEventID.MECHANISM:
return new WeaponEventMechanism(p, m);
229 case WeaponEventID.TRIGGER:
return new WeaponEventTrigger(p, m);
230 case WeaponEventID.TRIGGER_JAM:
return new WeaponEventTriggerToJam(p, m);
231 case WeaponEventID.LOAD1_BULLET:
return new WeaponEventLoad1Bullet(p, m);
232 case WeaponEventID.CONTINUOUS_LOADBULLET_START:
return new WeaponEventContinuousLoadBulletStart(p, m);
233 case WeaponEventID.CONTINUOUS_LOADBULLET_END:
return new WeaponEventContinuousLoadBulletEnd(p, m);
235 case WeaponEventID.ATTACH_MAGAZINE:
return new WeaponEventAttachMagazine(p, m);
236 case WeaponEventID.UNJAMMING_FAILED_TIMEOUT:
return new WeaponEventUnjammingFailedTimeout(p, m);
237 case WeaponEventID.UNJAMMING_TIMEOUT:
return new WeaponEventUnjammingTimeout(p, m);
238 case WeaponEventID.DETACH_MAGAZINE:
return new WeaponEventDetachMagazine(p, m);
239 case WeaponEventID.SWAP_MAGAZINE:
return new WeaponEventSwapMagazine(p, m);
240 case WeaponEventID.HUMANCOMMAND_ACTION_FINISHED:
return new WeaponEventHumanCommandActionFinished(p, m);
241 case WeaponEventID.HUMANCOMMAND_ACTION_ABORTED:
return new WeaponEventHumanCommandActionAborted(p, m);
242 case WeaponEventID.RELOAD_TIMEOUT:
return new WeaponEventReloadTimeout(p, m);
243 case WeaponEventID.DRY_FIRE_TIMEOUT:
return new WeaponEventDryFireTimeout(p, m);
244 case WeaponEventID.SET_NEXT_MUZZLE_MODE:
return new WeaponEventSetNextMuzzleMode(p, m);
255 case WeaponEvents.ATTACHMENT_HIDE:
return new WeaponEventAnimAttachmentHide(p, m);
256 case WeaponEvents.ATTACHMENT_SHOW:
return new WeaponEventAnimAttachmentShow(p, m);
257 case WeaponEvents.BULLET_EJECT:
return new WeaponEventAnimBulletEject(p, m);
258 case WeaponEvents.BULLET_HIDE:
return new WeaponEventAnimBulletHide(p, m);
259 case WeaponEvents.BULLET_HIDE2:
return new WeaponEventAnimBulletHide2(p, m);
260 case WeaponEvents.BULLET_IN_CHAMBER:
return new WeaponEventAnimBulletInChamber(p, m);
261 case WeaponEvents.BULLET_IN_MAGAZINE:
return new WeaponEventAnimBulletInMagazine(p, m);
262 case WeaponEvents.BULLET_SHOW:
return new WeaponEventAnimBulletShow(p, m);
263 case WeaponEvents.BULLET_SHOW2:
return new WeaponEventAnimBulletShow2(p, m);
264 case WeaponEvents.CANUNJAM_END:
return new WeaponEventAnimCanUnjamEnd(p, m);
265 case WeaponEvents.CANUNJAM_START:
return new WeaponEventAnimCanUnjamStart(p, m);
266 case WeaponEvents.COCKED:
return new WeaponEventAnimCocked(p, m);
267 case WeaponEvents.MAGAZINE_ATTACHED:
return new WeaponEventAnimMagazineAttached(p, m);
268 case WeaponEvents.MAGAZINE_DETACHED:
return new WeaponEventAnimMagazineDetached(p, m);
269 case WeaponEvents.MAGAZINE_HIDE:
return new WeaponEventAnimMagazineHide(p, m);
270 case WeaponEvents.MAGAZINE_SHOW:
return new WeaponEventAnimMagazineShow(p, m);
271 case WeaponEvents.SLIDER_OPEN:
return new WeaponEventAnimSliderOpen(p, m);
272 case WeaponEvents.UNJAMMED:
return new WeaponEventAnimUnjammed(p, m);
273 case WeaponEvents.HAMMER_UNCOCKED:
return new WeaponEventAnimHammerUncocked(p, m);
274 case WeaponEvents.HAMMER_COCKED:
return new WeaponEventAnimHammerCocked(p, m);
275 case WeaponEvents.CYLINDER_ROTATE:
return new WeaponEventCylinderRotate(p, m);
284 ctx.Read(packedType);
293 b.ReadFromContext(ctx);
299 void WeaponEventAnimAttachmentHide (
DayZPlayer p = NULL, Magazine m = NULL) { m_type =
WeaponEvents.ATTACHMENT_HIDE; }
304 void WeaponEventAnimAttachmentShow (
DayZPlayer p = NULL, Magazine m = NULL) { m_type =
WeaponEvents.ATTACHMENT_SHOW; }
309 void WeaponEventAnimBulletEject (
DayZPlayer p = NULL, Magazine m = NULL)
318 ItemBase weapon = player.GetItemInHands();
320 if (weapon && weapon.GetOverheatingValue() > 0)
326 suppressor = weapon_base.GetAttachedSuppressor();
328 ItemBase.PlayBulletCasingEjectParticles(weapon,
"", weapon, suppressor,
"CfgWeapons" );
336 void WeaponEventCylinderRotate (
DayZPlayer p = NULL, Magazine m = NULL) { m_type =
WeaponEvents.CYLINDER_ROTATE; }
341 void WeaponEventAnimBulletHide (
DayZPlayer p = NULL, Magazine m = NULL) { m_type =
WeaponEvents.BULLET_HIDE; }
346 void WeaponEventAnimBulletHide2 (
DayZPlayer p = NULL, Magazine m = NULL) { m_type =
WeaponEvents.BULLET_HIDE2; }
351 void WeaponEventAnimBulletInChamber (
DayZPlayer p = NULL, Magazine m = NULL) { m_type =
WeaponEvents.BULLET_IN_CHAMBER; }
356 void WeaponEventAnimBulletInMagazine (
DayZPlayer p = NULL, Magazine m = NULL) { m_type =
WeaponEvents.BULLET_IN_MAGAZINE; }
361 void WeaponEventAnimBulletShow (
DayZPlayer p = NULL, Magazine m = NULL) { m_type =
WeaponEvents.BULLET_SHOW; }
366 void WeaponEventAnimBulletShow2 (
DayZPlayer p = NULL, Magazine m = NULL) { m_type =
WeaponEvents.BULLET_SHOW2; }
371 void WeaponEventAnimCanUnjamEnd (
DayZPlayer p = NULL, Magazine m = NULL) { m_type =
WeaponEvents.CANUNJAM_END; }
376 void WeaponEventAnimCanUnjamStart (
DayZPlayer p = NULL, Magazine m = NULL) { m_type =
WeaponEvents.CANUNJAM_START; }
386 void WeaponEventAnimMagazineAttached (
DayZPlayer p = NULL, Magazine m = NULL) { m_type =
WeaponEvents.MAGAZINE_ATTACHED; }
391 void WeaponEventAnimMagazineDetached (
DayZPlayer p = NULL, Magazine m = NULL) { m_type =
WeaponEvents.MAGAZINE_DETACHED; }
396 void WeaponEventAnimMagazineHide (
DayZPlayer p = NULL, Magazine m = NULL) { m_type =
WeaponEvents.MAGAZINE_HIDE; }
401 void WeaponEventAnimMagazineShow (
DayZPlayer p = NULL, Magazine m = NULL) { m_type =
WeaponEvents.MAGAZINE_SHOW; }
406 void WeaponEventAnimSliderOpen (
DayZPlayer p = NULL, Magazine m = NULL) { m_type =
WeaponEvents.SLIDER_OPEN; }
417 void WeaponEventAnimHammerUncocked (
DayZPlayer p = NULL, Magazine m = NULL) { m_type =
WeaponEvents.HAMMER_UNCOCKED; }
422 void WeaponEventAnimHammerCocked (
DayZPlayer p = NULL, Magazine m = NULL) { m_type =
WeaponEvents.HAMMER_COCKED; }