OpenMoHAA 0.82.0
Loading...
Searching...
No Matches
weapon.h
1/*
2===========================================================================
3Copyright (C) 2024 the OpenMoHAA team
4
5This file is part of OpenMoHAA source code.
6
7OpenMoHAA source code is free software; you can redistribute it
8and/or modify it under the terms of the GNU General Public License as
9published by the Free Software Foundation; either version 2 of the License,
10or (at your option) any later version.
11
12OpenMoHAA source code is distributed in the hope that it will be
13useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with OpenMoHAA source code; if not, write to the Free Software
19Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20===========================================================================
21*/
22
23// weapon.h: Header file for Weapon class. The weapon class is the base class for
24// all weapons in Sin. Any entity created from a class derived from the weapon
25// class will be usable by any Sentient (players and monsters) as a weapon.
26//
27
28#pragma once
29
30#include "g_local.h"
31#include "item.h"
32#include "ammo.h"
33#include "queue.h"
34#include "sentient.h"
35#include "../fgame/scriptmaster.h"
36
37extern Event EV_Weapon_Shoot;
38extern Event EV_Weapon_SetAmmoClipSize;
39extern Event EV_Weapon_SetAmmoInClip;
40extern Event EV_Weapon_FireDelay;
41extern Event EV_Weapon_SetProjectile;
42extern Event EV_Weapon_SetBulletDamage;
43extern Event EV_Weapon_SetBulletLarge;
44extern Event EV_Weapon_SetTracerSpeed;
45extern Event EV_Weapon_SetBulletKnockback;
46extern Event EV_Weapon_SetBulletThroughWood;
47extern Event EV_Weapon_SetBulletThroughMetal;
48extern Event EV_Weapon_SetBulletCount;
49extern Event EV_Weapon_SetBulletRange;
50extern Event EV_Weapon_SetBulletSpread;
51extern Event EV_Weapon_SetTracerFrequency;
52extern Event EV_Weapon_GiveStartingAmmo;
53extern Event EV_Weapon_SetMeansOfDeath;
54
55typedef enum {
56 FT_NONE,
57 FT_BULLET,
58 FT_FAKEBULLET,
59 FT_PROJECTILE,
60 FT_MELEE,
61 FT_SPECIAL_PROJECTILE,
62 FT_CLICKITEM,
63 FT_HEAVY,
64 FT_LANDMINE,
65 FT_DEFUSE,
66} firetype_t;
67
68typedef enum {
69 WEAPON_READY,
70 WEAPON_FIRING,
71 WEAPON_LOWERING,
72 WEAPON_RAISING,
73 WEAPON_HOLSTERED,
74 WEAPON_RELOADING,
75 WEAPON_CHANGING
76} weaponstate_t;
77
78typedef enum {
79 RANGE_SHORT,
80 RANGE_MEDIUM,
81 RANGE_LONG,
82 RANGE_SNIPER,
83 RANGE_NUM_RANGES
84} AIRanges;
85
86#define INITIALIZE_WEAPONMODE_VAR(var, value) \
87 { \
88 int _ii; \
89 for (_ii = 0; _ii < MAX_FIREMODES; _ii++) { \
90 var[_ii] = value; \
91 } \
92 }
93
94static const unsigned int MAX_WEAPON_ANIM_SLOTS = 4;
95
96class Player;
97
98class Weapon : public Item
99{
100protected:
101 int m_iAnimSlot;
102 qboolean attached; // Is this weapon attached to something?
103 float nextweaponsoundtime; // The next time this weapon should sound off
104 float m_fLastFireTime;
105 firemode_t m_eLastFireMode;
106 str current_attachToTag; // The current name of the tag to attach itself to on the owner
107 str attachToTag_main; // Tag to use when weapon is wielded in the main hand
108 str attachToTag_offhand; // ...offhand hand
109 str holster_attachToTag; // Tag to use when weapon is put away
110 float lastScale; // Used for attaching to holster
111 Vector lastAngles; // Used for attaching to holster
112 qboolean lastValid; // Used for attaching to holster
113 qboolean auto_putaway; // Weapon will put itself away when out of ammo
114 qboolean use_no_ammo; // Weapon will be able to be used when it has no ammo
115 qboolean crosshair; // Whether or not to display a crosshair with this weapon
116 int m_iZoom;
117 float m_fZoomSpreadMult;
118 qboolean m_bAutoZoom;
119 qboolean m_bSemiAuto;
120
121protected:
122 float maxrange; // maximum effective firing distance (for AI)
123 float minrange; // minimum safe firing distance (for AI)
124 str viewmodel; // View model of the weapon (not used in FAKK)
125 weaponstate_t weaponstate; // current state of the weapon
126 int rank; // rank of the weapon (relative to other weapons)
127 int order; // The order of this weapon in the inventory
128 SentientPtr last_owner; // The last owner of the weapon
129 float last_owner_trigger_time; // The time when the last owner may re-pickup this weapon
130 qboolean notdroppable; // makes the weapon not able to be dropped
131 int aimanim; // The aim animation to use for this weapon (so it shoots straight)
132 int aimframe; // The aim frame to use for this weapon (so it shoots straight)
133 Vector holsterOffset; // Angles to set the weapon to when it's holstered
134 Vector holsterAngles; // Angles to set the weapon to when it's holstered
135 float holsterScale; // Scale the weapon should be set to when it's holstered
136 float next_noise_time; // next time weapon will alert actors
137 float next_noammo_time; // next time we can play out of ammo sound
138 float next_maxmovement_time;
139
140 qboolean m_bShouldReload;
141
142 // Starting loadout
143 Container<str> m_additionalStartAmmoTypes;
144 Container<int> m_additionalStartAmmoAmounts;
145 Container<str> m_startItems;
146
147 // Each of these arrays is used to describe the properties of the weapon
148 // in its primary(index 0) and alternate(index 1) mode
149
150 float fire_delay[MAX_FIREMODES];
151 str ammo_type[MAX_FIREMODES]; // The type of ammo used
152 int ammorequired[MAX_FIREMODES]; // The amount of ammo required to fire this weapon
153 int startammo[MAX_FIREMODES]; // The starting amount of ammo when the weapon is picked up
154 str projectileModel[MAX_FIREMODES]; // The model of the projectile fired
155 float bulletdamage[MAX_FIREMODES]; // The amount of damate a single bullet causes
156 float bulletcount[MAX_FIREMODES]; // The number of bullets the weapon fires
157 int bulletlarge[MAX_FIREMODES]; // The number of bullets the weapon fires
158 float bulletrange[MAX_FIREMODES]; // The range of the bullet
159 float bulletknockback[MAX_FIREMODES]; // The amount of knockback a bullet causes
160 float bulletthroughwood[MAX_FIREMODES]; // The amount of knockback a bullet causes
161 float bulletthroughmetal[MAX_FIREMODES]; // The amount of knockback a bullet causes
162 float projectilespeed[MAX_FIREMODES]; // The speed of the projectile fired
163 Vector bulletspread[MAX_FIREMODES]; // The amount of spread bullets can have
164 Vector bulletspreadmax[MAX_FIREMODES]; // The max amount of spread bullets can have
165 firetype_t firetype[MAX_FIREMODES]; // The type of fire (projectile or bullet)
166 int ammo_clip_size[MAX_FIREMODES]; // The amount of rounds the clip can hold
167 int ammo_in_clip[MAX_FIREMODES]; // The current amount of ammo in the clip
168 float max_charge_time[MAX_FIREMODES]; // The max amount of time the weapon may be charged.
169 float min_charge_time[MAX_FIREMODES]; // The min amount of time the weapon may be charged.
170 meansOfDeath_t meansofdeath[MAX_FIREMODES]; // The means of death for this mode
171 qboolean loopfire[MAX_FIREMODES]; // The weapon loopfires and will not idle when shooting
172 str worldhitspawn[MAX_FIREMODES]; // The models to spawn when the weapon strikes the world
173 int tracerfrequency[MAX_FIREMODES];
174 int tracercount[MAX_FIREMODES];
175 float tracerspeed[MAX_FIREMODES];
176 Vector viewkickmin[MAX_FIREMODES];
177 Vector viewkickmax[MAX_FIREMODES];
178 qboolean quiet[MAX_FIREMODES];
179 float m_fFireSpreadMultAmount[MAX_FIREMODES];
180 float m_fFireSpreadMultFalloff[MAX_FIREMODES];
181 float m_fFireSpreadMultCap[MAX_FIREMODES];
182 float m_fFireSpreadMultTimeCap[MAX_FIREMODES];
183 float m_fFireSpreadMultTime[MAX_FIREMODES];
184 float m_fFireSpreadMult[MAX_FIREMODES];
185 qboolean m_bShareClip;
186 qboolean m_bCanPartialReload;
187
188 qboolean autoaim; // Whether or not the weapon will autoaim
189 float charge_fraction; // Fraction of a charge up time
190 qboolean putaway; // This is set to true by the state system to signal a weapon to be putaway
191 firemode_t firemodeindex;
192 int weapon_class;
193 const_str m_csWeaponGroup;
194 //
195 // Movement speed
196 //
197 float m_fMovementSpeed;
198 float m_fMaxFireMovement;
199 float m_fZoomMovement;
200 //
201 // Special sounds
202 //
203 str m_sAmmoPickupSound;
204 str m_NoAmmoSound;
205 str m_sMaxMovementSound;
206 // Weapon subtype
207 int m_iWeaponSubtype;
208 //
209 // Weapon animations
210 //
211 int m_iNumFireAnims;
212 int m_iCurrentFireAnim;
213 str m_sTagBarrel;
214 //
215 // Cook variables
216 //
217 float m_fCookTime;
218 firemode_t m_eCookModeIndex;
219 qboolean m_bSecondaryAmmoInHud;
220
221public:
222 //
223 // Stats variables
224 //
225 int m_iNumShotsFired;
226 int m_iNumHits;
227 int m_iNumHeadShots;
228 int m_iNumTorsoShots;
229 int m_iNumLeftLegShots;
230 int m_iNumRightLegShots;
231 int m_iNumGroinShots;
232 int m_iNumLeftArmShots;
233 int m_iNumRightArmShots;
234 AIRanges mAIRange;
235 SafePtr<Entity> aim_target;
236
237protected:
238 friend class Player;
239 friend class PlayerBot;
240 friend class Sentient;
241
242 void SetMaxRangeEvent(Event *ev);
243 void SetMinRangeEvent(Event *ev);
244 void SetSecondaryAmmo(const char *type, int amount, int startamount);
245
246 void DetachGun(void);
247 void AttachGun(weaponhand_t hand, qboolean holstering = qfalse);
248 qboolean IsSecondaryWeapon(void);
249 void PickupWeapon(Event *ev);
250 void DoneRaising(Event *ev);
251 void DoneFiring(Event *ev);
252 void Idle(Event *ev);
253 void IdleInit(Event *ev);
254 void FillAmmoClip(Event *ev);
255 void EmptyAmmoClip(Event *ev);
256 void AddToAmmoClip(Event *ev);
257 void DoneReloading(Event *ev);
258 virtual void ApplyFireKickback(const Vector& org, float kickback);
259 void SetAimAnim(Event *ev);
260 virtual void Shoot(Event *ev);
261 void Secondary(Event *ev);
262 void SetFireType(Event *ev);
263 void SetAIRange(Event *ev);
264 void SetProjectile(Event *ev);
265 void SetDMProjectile(Event *ev);
266 void SetBulletDamage(Event *ev);
267 void SetBulletLarge(Event *ev); // Added in 2.0
268 void SetTracerSpeed(Event *ev); // Added in 2.0
269 void SetDMBulletDamage(Event *ev);
270 void SetBulletRange(Event *ev);
271 void SetDMBulletRange(Event *ev);
272 void SetBulletKnockback(Event *ev);
273 void SetDMBulletKnockback(Event *ev);
274 void SetBulletThroughWood(Event *ev); // Added in 2.0
275 void SetBulletThroughMetal(Event *ev); // Added in 2.0
276 void SetBulletCount(Event *ev);
277 void SetDMBulletCount(Event *ev);
278 void SetBulletSpread(Event *ev);
279 void SetDMBulletSpread(Event *ev);
280 void SetZoomSpreadMult(Event *ev);
281 void SetDMZoomSpreadMult(Event *ev);
282 void SetFireSpreadMult(Event *ev);
283 void SetDMFireSpreadMult(Event *ev);
284 void SetTracerFrequency(Event *ev);
285 void SetAutoPutaway(Event *ev);
286 void SetRange(Event *ev);
287 void SetWeaponType(Event *ev);
288 void SetWeaponGroup(Event *ev);
289 void SetUseNoAmmo(Event *ev);
290 void MainAttachToTag(Event *ev);
291 void OffHandAttachToTag(Event *ev);
292 void HolsterAttachToTag(Event *ev);
293 void SetHolsterOffset(Event *ev);
294 void SetHolsterAngles(Event *ev);
295 void SetHolsterScale(Event *ev);
296 void SetWorldHitSpawn(Event *ev);
297 void SetViewKick(Event *ev);
298 void SetMovementSpeed(Event *ev);
299 void SetDMMovementSpeed(Event *ev);
300 void SetMaxFireMovement(Event *ev); // Added in 2.0
301 void SetZoomMovement(Event *ev); // Added in 2.0
302 void EventAmmoPickupSound(Event *ev);
303 void EventNoAmmoSound(Event *ev);
304 void EventMaxMovementSound(Event *ev); // Added in 2.0
305 //====
306 // Added in 2.0
307 void SetNumFireAnims(Event *ev);
308 void SetWeaponSubtype(Event *ev);
309 void SetCookTime(Event *ev);
310 void SetCurrentFireAnim(Event *ev);
311 void SetSecondaryAmmoInHud(Event *ev);
312 //====
313 void ShowInfo(float fDot, float fDist) override;
314
315public:
316 CLASS_PROTOTYPE(Weapon);
317
318 Weapon();
319 Weapon(const char *file);
320 ~Weapon();
321
322 void Delete(void) override;
323 int GetRank(void);
324 int GetOrder(void);
325
326 int GetWeaponClass(void) const;
327
328 const_str GetWeaponGroup(void) const;
329
330 void SetItemSlot(int slot);
331 void SetRank(int order, int rank);
332 void SetRankEvent(Event *ev);
333 float GetMaxRange(void);
334 float GetMinRange(void);
335
336 qboolean GetPutaway(void);
337
338 void SetPutAway(qboolean p);
339
340 void SetMaxRange(float val);
341 void SetMinRange(float val);
342 void ForceIdle(void);
343 virtual qboolean SetWeaponAnim(const char *anim, Event *ev = NULL);
344 qboolean SetWeaponAnim(const char *anim, Event &ev);
345 void SetWeaponAnimEvent(Event *ev);
346 void SetWeaponIdleAnim(void);
347 void SetWeaponIdleAnimEvent(Event *ev);
348 virtual void StopWeaponAnim(void);
349
350 void SetAmmoRequired(Event *ev);
351 void SetDMAmmoRequired(Event *ev);
352 void SetStartAmmo(Event *ev);
353 void SetDMStartAmmo(Event *ev);
354 int GetStartAmmo(firemode_t mode);
355 int GetMaxAmmo(firemode_t mode);
356 str GetAmmoType(firemode_t mode);
357 firetype_t GetFireType(firemode_t mode);
358 void SetAmmoType(Event *ev);
359 void SetAmmoAmount(int amount, firemode_t mode);
360 void UseAmmo(int amount, firemode_t mode);
361 void SetAmmoClipSize(Event *ev);
362 void SetAmmoInClip(Event *ev);
363 void SetShareClip(Event *ev);
364 void SetTagBarrel(const char *tagBarrel); // Added in 2.0
365 str GetTagBarrel() const; // Added in 2.0
366 void SetModels(const char *world, const char *view);
367 void SetOwner(Sentient *ent) override;
368 void SetMaxChargeTime(Event *ev);
369 void SetMinChargeTime(Event *ev);
370 float GetMinChargeTime(firemode_t);
371 float GetMaxChargeTime(firemode_t);
372 int AmmoAvailable(firemode_t mode);
373 qboolean UnlimitedAmmo(firemode_t mode);
374 qboolean HasAmmo(firemode_t mode);
375 qboolean HasAmmoInClip(firemode_t mode);
376 int GetClipSize(firemode_t mode);
377
378 qboolean CheckReload(firemode_t mode);
379 qboolean ShouldReload(void);
380 void SetShouldReload(qboolean should_reload);
381 void StartReloading(void);
382
383 virtual qboolean ReadyToFire(firemode_t mode, qboolean playsound = qtrue);
384 qboolean MuzzleClear(void);
385
386 void PutAway(void);
387 qboolean Drop(void) override;
388 void Fire(firemode_t mode);
389 void Charge(firemode_t mode);
390 void OnOverCookedWarning(Event *ev); // Added in 2.0
391 void OnOverCooked(Event *ev); // Added in 2.0
392 void ReleaseFire(firemode_t mode, float chargetime);
393 const char *GetFireAnim() const; // Added in 2.0
394 void ClientFireDone(void);
395 qboolean Removable(void) override;
396 qboolean Pickupable(Entity *other) override;
397 virtual void DetachFromOwner(void);
398 void AttachToOwner(weaponhand_t hand);
399 void WeaponSound(Event *ev);
400 virtual void GetMuzzlePosition(
401 vec3_t position, vec3_t vBarrelPos = NULL, vec3_t forward = NULL, vec3_t right = NULL, vec3_t up = NULL
402 );
403 qboolean AutoChange(void);
404 int ClipAmmo(firemode_t mode);
405 qboolean IsDroppable(void);
406 virtual float FireDelay(firemode_t mode);
407 virtual void SetFireDelay(Event *ev);
408 void SetDMFireDelay(Event *ev);
409
410 weaponstate_t GetState(void);
411 void ForceState(weaponstate_t state);
412
413 void NotDroppableEvent(Event *ev);
414 void GiveStartingAmmoToOwner(Event *ev);
415 void AutoAim(Event *ev);
416 void Crosshair(Event *ev);
417 void DMCrosshair(Event *ev);
418 void SetZoom(Event *ev);
419 void SetSemiAuto(Event *ev);
420 void AttachToHand(Event *ev);
421 void SetCantPartialReload(Event *ev);
422 void SetDMCantPartialReload(Event *ev);
423 void AddAdditionalStartAmmo(Event *ev); // Added in 2.0
424 void AddStartItem(Event *ev); // Added in 2.0
425 void SetQuiet(Event *ev);
426 void SetLoopFire(Event *ev);
427 virtual void SpecialFireProjectile(
428 Vector pos, Vector forward, Vector right, Vector up, Entity *owner, str projectileModel, float charge_fraction
429 );
430
431 virtual void AttachToHolster(weaponhand_t hand);
432 str GetCurrentAttachToTag(void);
433 void SetCurrentAttachToTag(str s);
434 str GetHolsterTag(void);
435 qboolean GetUseNoAmmo(void);
436
437 int GetZoom(void);
438 qboolean GetAutoZoom(void);
439 void SetMeansOfDeath(Event *ev);
440 meansOfDeath_t GetMeansOfDeath(firemode_t mode);
441 void SetAimTarget(Entity *);
442 void SetIdleState(int state); // Added in 2.0
443 void WorldHitSpawn(firemode_t mode, Vector org, Vector angles, float life);
444 void MakeNoise(Event *ev);
445 void FallingAngleAdjust(Event *ev);
446 float GetMovementSpeed() const;
447 qboolean GetUseCrosshair() const;
448
449 virtual bool IsCarryableTurret() const; // Added in 2.0
450
451 void Archive(Archiver& arc) override;
452
453 //
454 // Added in OPM
455 //
456 Listener *GetScriptOwner(void) override;
457 float GetBulletRange(firemode_t firemode);
458 float GetSpreadFactor(firemode_t firemode);
459 float GetChargeFraction(void) const;
460 firemode_t GetFireMode(void);
461 qboolean IsSemiAuto(void);
462 void DoneAnimating(Event *ev);
463 void EventGetPutaway(Event *ev);
464
465 float GetMaxFireMovementMult() const;
466 float GetZoomMovement() const;
467 float GetMaxFireMovement() const;
468};
469
470inline void Weapon::Archive(Archiver& arc)
471{
472 Item::Archive(arc);
473
474 arc.ArchiveInteger(&m_iAnimSlot);
475 arc.ArchiveBoolean(&attached);
476 arc.ArchiveFloat(&nextweaponsoundtime);
477 arc.ArchiveFloat(&m_fLastFireTime);
478 ArchiveEnum(m_eLastFireMode, firemode_t);
479 arc.ArchiveString(&current_attachToTag);
480 arc.ArchiveString(&attachToTag_main);
481 arc.ArchiveString(&attachToTag_offhand);
482 arc.ArchiveString(&holster_attachToTag);
483 arc.ArchiveFloat(&lastScale);
484 arc.ArchiveVector(&lastAngles);
485 arc.ArchiveBoolean(&lastValid);
486 arc.ArchiveBoolean(&auto_putaway);
487 arc.ArchiveBoolean(&use_no_ammo);
488 arc.ArchiveBoolean(&crosshair);
489 arc.ArchiveInteger(&m_iZoom);
490 arc.ArchiveFloat(&m_fZoomSpreadMult);
491 arc.ArchiveBoolean(&m_bAutoZoom);
492 arc.ArchiveBoolean(&m_bSemiAuto);
493 arc.ArchiveSafePointer(&aim_target);
494 arc.ArchiveFloat(&maxrange);
495 arc.ArchiveFloat(&minrange);
496 arc.ArchiveString(&viewmodel);
497
498 ArchiveEnum(weaponstate, weaponstate_t);
499
500 arc.ArchiveInteger(&rank);
501 arc.ArchiveInteger(&order);
502 arc.ArchiveSafePointer(&last_owner);
503 arc.ArchiveFloat(&last_owner_trigger_time);
504 arc.ArchiveBoolean(&notdroppable);
505 arc.ArchiveInteger(&aimanim);
506 arc.ArchiveInteger(&aimframe);
507 arc.ArchiveVector(&holsterOffset);
508 arc.ArchiveVector(&holsterAngles);
509 arc.ArchiveFloat(&holsterScale);
510 arc.ArchiveFloat(&next_noise_time);
511 arc.ArchiveFloat(&next_noammo_time);
512 arc.ArchiveFloat(&next_maxmovement_time);
513
514 arc.ArchiveBoolean(&m_bShouldReload);
515
516 m_additionalStartAmmoTypes.Archive(arc);
517 m_additionalStartAmmoTypes.Archive(arc);
518 m_additionalStartAmmoAmounts.Archive(arc);
519
520 arc.ArchiveFloat(&fire_delay[0]);
521 arc.ArchiveFloat(&fire_delay[1]);
522 arc.ArchiveString(&ammo_type[0]);
523 arc.ArchiveString(&ammo_type[1]);
524 arc.ArchiveInteger(&ammorequired[0]);
525 arc.ArchiveInteger(&ammorequired[1]);
526 arc.ArchiveInteger(&startammo[0]);
527 arc.ArchiveInteger(&startammo[1]);
528 arc.ArchiveString(&projectileModel[0]);
529 arc.ArchiveString(&projectileModel[1]);
530 arc.ArchiveFloat(&bulletdamage[0]);
531 arc.ArchiveFloat(&bulletdamage[1]);
532 arc.ArchiveInteger(&bulletlarge[0]);
533 arc.ArchiveInteger(&bulletlarge[1]);
534 arc.ArchiveFloat(&bulletcount[0]);
535 arc.ArchiveFloat(&bulletcount[1]);
536 arc.ArchiveFloat(&bulletrange[0]);
537 arc.ArchiveFloat(&bulletrange[1]);
538 arc.ArchiveFloat(&bulletknockback[0]);
539 arc.ArchiveFloat(&bulletknockback[1]);
540 arc.ArchiveFloat(&bulletthroughwood[0]);
541 arc.ArchiveFloat(&bulletthroughwood[1]);
542 arc.ArchiveFloat(&bulletthroughmetal[0]);
543 arc.ArchiveFloat(&bulletthroughmetal[1]);
544 arc.ArchiveFloat(&projectilespeed[0]);
545 arc.ArchiveFloat(&projectilespeed[1]);
546 arc.ArchiveVector(&bulletspread[0]);
547 arc.ArchiveVector(&bulletspread[1]);
548 arc.ArchiveVector(&bulletspreadmax[0]);
549 arc.ArchiveVector(&bulletspreadmax[1]);
550 arc.ArchiveString(&worldhitspawn[0]);
551 arc.ArchiveString(&worldhitspawn[1]);
552 arc.ArchiveInteger(&tracerfrequency[0]);
553 arc.ArchiveInteger(&tracerfrequency[1]);
554 arc.ArchiveInteger(&tracercount[0]);
555 arc.ArchiveInteger(&tracercount[1]);
556 arc.ArchiveFloat(&tracerspeed[0]);
557 arc.ArchiveFloat(&tracerspeed[1]);
558 arc.ArchiveVector(&viewkickmin[0]);
559 arc.ArchiveVector(&viewkickmin[1]);
560 arc.ArchiveVector(&viewkickmax[0]);
561 arc.ArchiveVector(&viewkickmax[1]);
562 arc.ArchiveBoolean(&quiet[0]);
563 arc.ArchiveBoolean(&quiet[1]);
564 arc.ArchiveFloat(&m_fFireSpreadMultAmount[0]);
565 arc.ArchiveFloat(&m_fFireSpreadMultAmount[1]);
566 arc.ArchiveFloat(&m_fFireSpreadMultFalloff[0]);
567 arc.ArchiveFloat(&m_fFireSpreadMultFalloff[1]);
568 arc.ArchiveFloat(&m_fFireSpreadMultCap[0]);
569 arc.ArchiveFloat(&m_fFireSpreadMultCap[1]);
570 arc.ArchiveFloat(&m_fFireSpreadMultTimeCap[0]);
571 arc.ArchiveFloat(&m_fFireSpreadMultTimeCap[1]);
572 arc.ArchiveFloat(&m_fFireSpreadMultTime[0]);
573 arc.ArchiveFloat(&m_fFireSpreadMultTime[1]);
574 arc.ArchiveFloat(&m_fFireSpreadMult[0]);
575 arc.ArchiveFloat(&m_fFireSpreadMult[1]);
576
577 ArchiveEnum(firetype[0], firetype_t);
578 ArchiveEnum(firetype[1], firetype_t);
579
580 arc.ArchiveInteger(&ammo_clip_size[0]);
581 arc.ArchiveInteger(&ammo_clip_size[1]);
582 arc.ArchiveInteger(&ammo_in_clip[0]);
583 arc.ArchiveInteger(&ammo_in_clip[1]);
584 arc.ArchiveFloat(&max_charge_time[0]);
585 arc.ArchiveFloat(&max_charge_time[1]);
586 arc.ArchiveFloat(&min_charge_time[0]);
587 arc.ArchiveFloat(&min_charge_time[1]);
588
589 ArchiveEnum(meansofdeath[0], meansOfDeath_t);
590 ArchiveEnum(meansofdeath[1], meansOfDeath_t);
591
592 arc.ArchiveBoolean(&loopfire[0]);
593 arc.ArchiveBoolean(&loopfire[1]);
594 arc.ArchiveBoolean(&m_bShareClip);
595 arc.ArchiveBoolean(&m_bCanPartialReload);
596 arc.ArchiveBoolean(&autoaim);
597 arc.ArchiveFloat(&charge_fraction);
598 arc.ArchiveBoolean(&putaway);
599
600 ArchiveEnum(firemodeindex, firemode_t);
601
602 arc.ArchiveInteger(&weapon_class);
603 Director.ArchiveString(arc, m_csWeaponGroup);
604 arc.ArchiveFloat(&m_fMovementSpeed);
605 arc.ArchiveFloat(&m_fMaxFireMovement);
606 arc.ArchiveFloat(&m_fZoomMovement);
607 arc.ArchiveString(&m_sAmmoPickupSound);
608 arc.ArchiveString(&m_NoAmmoSound);
609 arc.ArchiveString(&m_sMaxMovementSound);
610 arc.ArchiveInteger(&m_iNumShotsFired);
611 arc.ArchiveInteger(&m_iNumHits);
612 arc.ArchiveInteger(&m_iNumHeadShots);
613 arc.ArchiveInteger(&m_iNumTorsoShots);
614 arc.ArchiveInteger(&m_iNumLeftLegShots);
615 arc.ArchiveInteger(&m_iNumRightLegShots);
616 arc.ArchiveInteger(&m_iNumGroinShots);
617 arc.ArchiveInteger(&m_iNumLeftArmShots);
618 arc.ArchiveInteger(&m_iNumRightArmShots);
619 arc.ArchiveInteger(&m_iNumFireAnims);
620 arc.ArchiveInteger(&m_iCurrentFireAnim);
621 arc.ArchiveString(&m_sTagBarrel);
622
623 ArchiveEnum(mAIRange, AIRanges);
624
625 arc.ArchiveInteger(&m_iWeaponSubtype);
626 arc.ArchiveFloat(&m_fCookTime);
627 ArchiveEnum(m_eCookModeIndex, firemode_t);
628 arc.ArchiveBoolean(&m_bSecondaryAmmoInHud);
629}
630
631typedef SafePtr<Weapon> WeaponPtr;
Definition archive.h:86
Definition container.h:85
Definition entity.h:203
Definition listener.h:246
Definition listener.h:450
Definition player.h:127
Definition safeptr.h:160
Definition vector.h:61
Definition str.h:77
Definition puff.c:88