Weapon Asset (BO1)

From COD Engine Research
Jump to: navigation, search

The purpose of the weapon asset should be fairly obvious, but the structure not so much. The weapon asset on Black Ops 1 continues on the Modern Warfare 2 idea of the "WeaponVariantDef". In fact the Black Ops 1 weapondef appears to be related to the MW2 structure more than the WaW one. On Xbox 360 the WeaponVariantDef is 0xE4 bytes, while the WeaponDef is 0x808.

enum weapFireType_t : int
{
  WEAPON_FIRETYPE_FULLAUTO = 0x0,
  WEAPON_FIRETYPE_SINGLESHOT = 0x1,
  WEAPON_FIRETYPE_BURSTFIRE2 = 0x2,
  WEAPON_FIRETYPE_BURSTFIRE3 = 0x3,
  WEAPON_FIRETYPE_BURSTFIRE4 = 0x4,
  WEAPON_FIRETYPE_STACKED_FIRE = 0x5,
  WEAPON_FIRETYPE_MINIGUN = 0x6,
  WEAPON_FIRETYPE_MAX
};

enum weapInventoryType_t : int
{
  WEAPINVENTORY_PRIMARY = 0,
  WEAPINVENTORY_OFFHAND = 1,
  WEAPINVENTORY_ITEM = 2,
  WEAPINVENTORY_ALTMODE = 3,
  WEAPINVENTORY_MELEE = 4,
  WEAPINVENTORY_MAX
};

enum PenetrateType
{
  PENETRATE_TYPE_NONE = 0x0,
  PENETRATE_TYPE_SMALL = 0x1,
  PENETRATE_TYPE_MEDIUM = 0x2,
  PENETRATE_TYPE_LARGE = 0x3,
  PENETRATE_TYPE_COUNT = 0x4
};

enum activeReticleType_t : int
{
  VEH_ACTIVE_RETICLE_NONE = 0,
  VEH_ACTIVE_RETICLE_PIP_ON_A_STICK = 1,
  VEH_ACTIVE_RETICLE_BOUNCING_DIAMOND = 2,
  VEH_ACTIVE_RETICLE_MAX
};

enum weapType_t : int
{
  WEAPTYPE_BULLET = 0,
  WEAPTYPE_GRENADE = 1,
  WEAPTYPE_PROJECTILE = 2,
  WEAPTYPE_BINOCULARS = 3,
  WEAPTYPE_GAS = 4,
  WEAPTYPE_BOMB = 5,
  WEAPTYPE_MINE = 6,
  WEAPTYPE_MELEE = 7,
  WEAPTYPE_MAX
};

enum weapClass_t : int
{
  WEAPCLASS_RIFLE = 0,
  WEAPCLASS_MG = 1,
  WEAPCLASS_SMG = 2,
  WEAPCLASS_SPREAD = 3,
  WEAPCLASS_PISTOL = 4,
  WEAPCLASS_GRENADE = 5,
  WEAPCLASS_ROCKETLAUNCHER = 6,
  WEAPCLASS_TURRET = 7,
  WEAPCLASS_NON_PLAYER = 8,
  WEAPCLASS_GAS = 9,
  WEAPCLASS_ITEM = 10,
  WEAPCLASS_MELEE = 11,
  WEAPCLASS_KILLSTREAK_ALT_STORED = 12,
  WEAPCLASS_MAX
};

enum OffhandClass : int
{
  OFFHAND_CLASS_NONE = 0,
  OFFHAND_CLASS_FRAG_GRENADE = 1,
  OFFHAND_CLASS_SMOKE_GRENADE = 2,
  OFFHAND_CLASS_FLASH_GRENADE = 3,
  OFFHAND_CLASS_GEAR = 4,
  OFFHAND_CLASS_MAX
};

enum weapProjExplosion_t
{
  WEAPPROJEXP_GRENADE = 0x0,
  WEAPPROJEXP_ROCKET = 0x1,
  WEAPPROJEXP_FLASHBANG = 0x2,
  WEAPPROJEXP_NONE = 0x3,
  WEAPPROJEXP_DUD = 0x4,
  WEAPPROJEXP_SMOKE = 0x5,
  WEAPPROJEXP_HEAVY = 0x6,
  WEAPPROJEXP_FIRE = 0x7,
  WEAPPROJEXP_NAPALMBLOB = 0x8,
  WEAPPROJEXP_BOLT = 0x9,
  WEAPPROJEXP_NUM = 0x7
};

enum WeapStickinessType
{
  WEAPSTICKINESS_NONE = 0x0,
  WEAPSTICKINESS_ALL = 0x1,
  WEAPSTICKINESS_ALL_NO_PLAYERS = 0x2,
  WEAPSTICKINESS_GROUND = 0x3,
  WEAPSTICKINESS_GROUND_WITH_YAW = 0x4,
  WEAPSTICKINESS_FLESH = 0x5,
  WEAPSTICKINESS_COUNT = 0x6
};

enum weaponIconRatioType_t
{
  WEAPON_ICON_RATIO_1TO1 = 0x0,
  WEAPON_ICON_RATIO_2TO1 = 0x1,
  WEAPON_ICON_RATIO_4TO1 = 0x2,
  WEAPON_ICON_RATIO_COUNT = 0x3
};

enum ammoCounterClipType_t
{
  AMMO_COUNTER_CLIP_NONE = 0x0,
  AMMO_COUNTER_CLIP_MAGAZINE = 0x1,
  AMMO_COUNTER_CLIP_SHORTMAGAZINE = 0x2,
  AMMO_COUNTER_CLIP_SHOTGUN = 0x3,
  AMMO_COUNTER_CLIP_ROCKET = 0x4,
  AMMO_COUNTER_CLIP_BELTFED = 0x5,
  AMMO_COUNTER_CLIP_ALTWEAPON = 0x6,
  AMMO_COUNTER_CLIP_COUNT = 0x7
};

enum weapOverlayReticle_t
{
  WEAPOVERLAYRETICLE_NONE = 0x0,
  WEAPOVERLAYRETICLE_CROSSHAIR = 0x1,
  WEAPOVERLAYRETICLE_NUM = 0x2
};

enum clipType_t
{
  WEAPCLIPTYPE_BOTTOM = 0,
  WEAPCLIPTYPE_TOP = 1,
  WEAPCLIPTYPE_LEFT = 2,
  WEAPCLIPTYPE_DP28 = 3,
  WEAPCLIPTYPE_PTRS = 4,
  WEAPCLIPTYPE_LMG = 5,
  WEAPCLIPTYPE_COUNT
};

enum WeapOverlayInteface_t
{
  WEAPOVERLAYINTERFACE_NONE = 0x0,
  WEAPOVERLAYINTERFACE_JAVELIN = 0x1,
  WEAPOVERLAYINTERFACE_TURRETSCOPE = 0x2,
  WEAPOVERLAYINTERFACECOUNT = 0x3
};

enum weapStance_t
{
  WEAPSTANCE_STAND = 0x0,
  WEAPSTANCE_DUCK = 0x1,
  WEAPSTANCE_PRONE = 0x2,
  WEAPSTANCE_NUM = 0x3
};

enum ImpactType
{
  IMPACT_TYPE_NONE = 0,
  IMPACT_TYPE_BULLET_SMALL = 1,
  IMPACT_TYPE_BULLET_LARGE = 2,
  IMPACT_TYPE_BULLET_AP = 3,
  IMPACT_TYPE_BULLET_XTREME = 4,
  IMPACT_TYPE_SHOTGUN = 5,
  IMPACT_TYPE_GRENADE_BOUNCE = 6,
  IMPACT_TYPE_GRENADE_EXPLODE = 7,
  IMPACT_TYPE_RIFLE_GRENADE = 8,
  IMPACT_TYPE_ROCKET_EXPLODE = 9,
  IMPACT_TYPE_ROCKET_EXPLODE_XTREME = 10,
  IMPACT_TYPE_PROJECTILE_DUD = 11,
  IMPACT_TYPE_MORTAR_SHELL = 12,
  IMPACT_TYPE_TANK_SHELL = 13,
  IMPACT_TYPE_BOLT = 14,
  IMPACT_TYPE_BLADE = 15,
  IMPACT_TYPE_MAX
};

enum guidedMissileType_t
{
  MISSILE_GUIDANCE_NONE = 0x0,
  MISSILE_GUIDANCE_SIDEWINDER = 0x1,
  MISSILE_GUIDANCE_HELLFIRE = 0x2,
  MISSILE_GUIDANCE_JAVELIN = 0x3,
  MISSILE_GUIDANCE_BALLISTIC = 0x4,
  MISSILE_GUIDANCE_WIRE = 0x5,
  MISSILE_GUIDANCE_TV = 0x6,
  MISSILE_GUIDANCE_MAX
};

enum surfaceNames_t
{
  bark,
  brick,
  carpet,
  cloth,
  concrete,
  dirt,
  flesh,
  foliage,
  glass,
  grass,
  gravel,
  ice,
  metal,
  mud,
  paper,
  plaster,
  rock,
  sand,
  snow,
  water,
  wood,
  asphalt,
  ceramic,
  plastic,
  rubber,
  cushion,
  fruit,
  paintedmetal,
  player,
  tallgrass,
  opaqueglass
};

enum offhandSlot_t
{
  OFFHAND_SLOT_NONE = 0,
  OFFHAND_SLOT_LETAHL = 1,
  OFFHAND_SLOT_TACTICAL = 2,
  OFFHAND_SLOT_EQUIPMENT = 3,
  OFFHAND_SLOT_SPECIFIC_USE = 4,
  OFFHAND_SLOT_NUM
};

enum offhandClass_t
{
  OFFHAND_CLASS_NONE = 0x0,
  OFFHAND_CLASS_FRAG_GRENADE = 0x1,
  OFFHAND_CLASS_SMOKE_GRENADE = 0x2,
  OFFHAND_CLASS_FLASH_GRENADE = 0x3,
  OFFHAND_CLASS_COUNT = 0x4
};

enum rotateType_t
{
  WEAPROTATE_BOTH_AXIS,
  WEAPROTATE_ONE_AXIS,
  WEAPROTATE_CYLINDER,
  WAEPROTATE_COUNT
};

#pragma pack(push, 4)
struct ProjectileExplosionEffect
{
  FxEffectDef * projExplosionEffect;
  bool projExplosionEffectForceNormalUp;
};

struct FlameTable
{
  float streamChunkGravityStart;
  float streamChunkGravityEnd;
  float streamChunkMaxSize;
  float streamChunkStartSize;
  float streamChunkEndSize;
  float streamChunkStartSizeRand;
  float streamChunkEndSizeRand;
  float streamChunkDistScalar;
  float streamChunkDistSwayScale;
  float streamChunkDistSwayVelMax;
  float streamChunkSpeed;
  float streamChunkDecel;
  float streamChunkVelocityAddScale;
  float streamChunkDuration;
  float streamChunkDurationScaleMaxVelocity;
  float streamChunkDurationVelScalar;
  float streamChunkSizeSpeedScale;
  float streamChunkSizeAgeScale;
  float streamChunkSpawnFireIntervalStart;
  float streamChunkSpawnFireIntervalEnd;
  float streamChunkSpawnFireMinLifeFrac;
  float streamChunkSpawnFireMaxLifeFrac;
  float streamChunkFireMinLifeFrac;
  float streamChunkFireMinLifeFracStart;
  float streamChunkFireMinLifeFracEnd;
  float streamChunkDripsMinLifeFrac;
  float streamChunkDripsMinLifeFracStart;
  float streamChunkDripsMinLifeFracEnd;
  float streamChunkRotationRange;
  float streamSizeRandSinWave;
  float streamSizeRandCosWave;
  float streamDripsChunkInterval;
  float streamDripsChunkMinFrac;
  float streamDripsChunkRandFrac;
  float streamSmokeChunkInterval;
  float streamSmokeChunkMinFrac;
  float streamSmokeChunkRandFrac;
  float streamChunkCullDistSizeFrac;
  float streamChunkCullMinLife;
  float streamChunkCullMaxLife;
  float streamFuelSizeStart;
  float streamFuelSizeEnd;
  float streamFuelLength;
  float streamFuelNumSegments;
  float streamFuelAnimLoopTime;
  float streamFlameSizeStart;
  float streamFlameSizeEnd;
  float streamFlameLength;
  float streamFlameNumSegments;
  float streamFlameAnimLoopTime;
  float streamPrimaryLightRadius;
  float streamPrimaryLightRadiusFlutter;
  float streamPrimaryLightColor[3];
  float streamPrimaryLightFlutterColor[3];
  float fireLife;
  float fireLifeRand;
  float fireSpeedScale;
  float fireSpeedScaleRand;
  float fireVelocityAddZ;
  float fireVelocityAddZRand;
  float fireVelocityAddSideways;
  float fireGravity;
  float fireGravityEnd;
  float fireMaxRotVel;
  float fireFriction;
  float fireEndSizeAdd;
  float fireStartSizeScale;
  float fireEndSizeScale;
  float dripsLife;
  float dripsLifeRand;
  float dripsSpeedScale;
  float dripsSpeedScaleRand;
  float dripsVelocityAddZ;
  float dripsVelocityAddZRand;
  float dripsVelocityAddSideways;
  float dripsGravity;
  float dripsGravityEnd;
  float dripsMaxRotVel;
  float dripsFriction;
  float dripsEndSizeAdd;
  float dripsStartSizeScale;
  float dripsEndSizeScale;
  float smokeLife;
  float smokeLifeRand;
  float smokeSpeedScale;
  float smokeVelocityAddZ;
  float smokeGravity;
  float smokeGravityEnd;
  float smokeMaxRotation;
  float smokeMaxRotVel;
  float smokeFriction;
  float smokeEndSizeAdd;
  float smokeStartSizeAdd;
  float smokeOriginSizeOfsZScale;
  float smokeOriginOfsZ;
  float smokeFadein;
  float smokeFadeout;
  float smokeMaxAlpha;
  float smokeBrightness;
  float smokeOriginOffset;
  float collisionSpeedScale;
  float collisionVolumeScale;
  const char * name;
  Material * fire;
  Material * smoke;
  Material * heat;
  Material * drips;
  Material * streamFuel;
  Material * streamFuel2;
  Material * streamFlame;
  Material * streamFlame2;
  snd_alias_list_name flameOffLoopSound;
  snd_alias_list_name flameIgniteSound;
  snd_alias_list_name flameOnLoopSound;
  snd_alias_list_name flameCooldownSound;
};

struct WeaponDef
{
  const char * AIOverlayDescription;
  XModel * * gunModel;
  XModel * handModel;
  const char * modeName;
  ScriptString (*noteTrackSoundMapKeys[0x14]);
  ScriptString (*notetrackSoundMapValues[0x14]);
  int playerAnimType;
  weapType_t weaponType;
  weapClass_t weaponClass;
  PenetrateType penetrateType;
  ImpactType impactType;
  weapInventoryType_t inventoryType;
  weapFireType_t fireType;
  clipType_t clipType;
            int unknown1;
  const char * parentWeaponName;
  int jamFireTime;
  int tracerFrequency;
  float tracerWidth;
  float tracerLength;
  int overheatWeapon;
  float overheatRate;
  float cooldownRate;
  float overheatEndVal;
  bool coolWhileFiring;
  bool fuelTankWeapon;
  int tankLifeTime;
  offhandClass_t offhandClass;
  offhandSlot_t offhandSlot;
  weapStance_t stance;
  FxEffectDef * viewFlashEffect;
  FxEffectDef * worldFlashEffect;
  snd_alias_list_name pickupSound;
  snd_alias_list_name pickupSoundPlayer;
  snd_alias_list_name ammoPickupSound;
  snd_alias_list_name ammoPickupSoundPlayer;
  snd_alias_list_name projectileSound;
  snd_alias_list_name pullbackSound;
  snd_alias_list_name pullbackSoundPlayer;
  snd_alias_list_name fireSound;
  snd_alias_list_name fireSoundPlayer;
  snd_alias_list_name loopFireSound;
  snd_alias_list_name loopFireSoundPlayer;
  snd_alias_list_name loopFireEndSound;
  snd_alias_list_name loopFireEndSoundPlayer;
  snd_alias_list_name stopFireSound;
  snd_alias_list_name stopFireSoundPlayer;
  snd_alias_list_name lastShotSound;
  snd_alias_list_name lastShotSoundPlayer;
  snd_alias_list_name emptyFireSound;
  snd_alias_list_name emptyFireSoundPlayer;
  snd_alias_list_name crackSound;
  snd_alias_list_name whizbySound;
  snd_alias_list_name meleeSwipeSound;
  snd_alias_list_name meleeSwipeSoundPlayer;
  snd_alias_list_name meleeHitSound;
  snd_alias_list_name meleeMissSound;
  snd_alias_list_name rechamberSound;
  snd_alias_list_name rechamberSoundPlayer;
  snd_alias_list_name reloadSound;
  snd_alias_list_name reloadSoundPlayer;
  snd_alias_list_name reloadEmptySound;
  snd_alias_list_name reloadEmptySoundPlayer;
  snd_alias_list_name reloadStartSound;
  snd_alias_list_name reloadStartSoundPlayer;
  snd_alias_list_name reloadEndSound;
  snd_alias_list_name reloadEndSoundPlayer;
  snd_alias_list_name rotateLoopSound;
  snd_alias_list_name rotateLoopSoundPlayer;
  snd_alias_list_name deploySound;
  snd_alias_list_name deploySoundPlayer;
  snd_alias_list_name finishDeploySound;
  snd_alias_list_name finishDeploySoundPlayer;
  snd_alias_list_name breakdownSound;
  snd_alias_list_name breakdownSoundPlayer;
  snd_alias_list_name finishBreakdownSound;
  snd_alias_list_name finishBreakdownSoundPlayer;
  snd_alias_list_name detonateSound;
  snd_alias_list_name detonateSoundPlayer;
  snd_alias_list_name nightVisionWearSound;
  snd_alias_list_name nightVisionWearSoundPlayer;
  snd_alias_list_name nightVisionRemoveSound;
  snd_alias_list_name nightVisionRemoveSoundPlayer;
  snd_alias_list_name altSwitchSound;
  snd_alias_list_name altSwitchSoundPlayer;
  snd_alias_list_name raiseSound;
  snd_alias_list_name raiseSoundPlayer;
  snd_alias_list_name firstRaiseSound;
  snd_alias_list_name firstRaiseSoundPlayer;
  snd_alias_list_name putawaySound;
  snd_alias_list_name putawaySoundPlayer;
  snd_alias_list_name overheatSound;
  snd_alias_list_name overheatSoundPlayer;
  snd_alias_list_name adsZoomSound;
  snd_alias_list_name *bounceSound;     //Refer to surfaceNames_t
  const char * standMountedWeapdef;
  const char * crouchMountedWeapdef;
  const char * proneMountedWeapdef;
  unsigned int standMountedWeapIndex;
  unsigned int crouchMountedWeapIndex;
  unsigned int proneMountedWeapIndex;
  FxEffectDef * viewShellEjectEffect;
  FxEffectDef * worldShellEjectEffect;
  FxEffectDef * viewLastShotEjectEffect;
  FxEffectDef * worldLastShotEjectEffect;
  Material *reticleCenter;
  Material *reticleSide;
  int iReticleCenterSize;
  int iReticleSideSize;
  int iReticleMinOfs;
  activeReticleType_t activeReticleType;
  float vStandMove[3];
  float vStandRot[3];
  float vDuckedOfs[3];
  float vDuckedMove[3];
  float vDuckedSprintOfs[3];
  float vDuckedSprintRot[3];
  float vDuckedSprintBob[2];
  float duckedSprintScale;
  float vSprintOfs[3];
  float vSprintRot[3];
  float vSprintBob[2];
  float sprintScale;
  float vLowReadyOfs[3];
  float vLowReadyRot[3];
  float vDTPOfs[3];
  float vDTPRot[3];
  float vDTPBob[2];
  float DTPScale;
  float vMantleOfs[3];
  float vMantleRot[3];
  float vSlideOfs[3];
  float vSlideRot[3];
  float vDuckedRot[3];
  float vProneOfs[3];
  float vProneMove[3];
  float vProneRot[3];
  float vStrafeMove[3];
  float vStrafeRot[3];
  float fPosMoveRate;
  float fPosProneMoveRate;
  float fStandMoveMinSpeed;
  float fDuckedMoveMinSpeed;
  float fProneMoveMinSpeed;
  float fPosRotRate;
  float fPosProneRotRate;
  float fStandRotMinSpeed;
  float fDuckedRotMinSpeed;
  float fProneRotMinSpeed;
  XModel *worldModel[16];
  XModel *worldClipModel;
  XModel *rocketModel;
  XModel *mountedModel;
  XModel *additionalMeleeModel;
  Material * hudIcon;
  weaponIconRatioType_t hudIconRatio;
  Material * indicatorIcon;
  weaponIconRatioType_t indicatorIconRatio;
  Material * ammoCounterIcon;
  weaponIconRatioType_t ammoCounterIconRatio;
  ammoCounterClipType_t ammoCounterClip;
  int iStartAmmo;
               int unknown2;
  int iMaxAmmo;
  int shotCount;
  const char *szSharedAmmoCapName;
  int iSharedAmmoCapIndex;
  int iSharedAmmoCap;
  bool unlimitedAmmo;
  bool ammoCountClipRelative;
  int damage;
  float damageDuration;
  float damageInterval;
  int playerDamage;
  int iMeleeDamage;
  int iDamageType;
  ScriptString explosionTag;
  int iFireDelay;
  int iMeleeDelay;
  int meleeChargeDelay;
  int iDetonateDelay;
  int iSpinUpTime;
  int iSpinDownTime;
  float spinRate;
  snd_alias_list_name spinLoopSound;
  snd_alias_list_name spinLoopSoundPlayer;
  snd_alias_list_name startSpinSound;
  snd_alias_list_name startSpinSoundPlayer;
  snd_alias_list_name stopSpinSound;
  snd_alias_list_name stopSpinSoundPlayer;
  int iFireTime;
  int iLastFireTime;
  int iRechamberTime;
  int iRechamberBoltTime;
  int iHoldFireTime;
  int iDetonateTime;
  int iMeleeTime;
  int meleeChargeTime;
         char unknown3[8];
  int reloadShowRocketTime;
            int unknown4;
  int iReloadAddTime;
  int iReloadEmptyAddTime;
  int iReloadQuickAddTime;
  int iReloadQuickEmptyAddTime;
  int iReloadStartTime;
  int iReloadStartAddTime;
  int iReloadEndTime;
  int iDropTime;
  int iRaiseTime;
  int iAltDropTime;
  int iQuickDropTime;
  int iQuickRaiseTime;
  int iFirstRaiseTime;
  int iEmptyRaiseTime;
  int iEmptyDropTime;
  int sprintInTime;
  int sprintLoopTime;
  int sprintOutTime;
  int lowReadyInTime;
  int lowReadyLoopTime;
  int lowReadyOutTime;
  int contFireInTime;
  int contFireLoopTime;
  int contFireOutTime;
  int DTPInTime;
  int DTPLoopTime;
  int DTPOutTime;
  int slideInTime;
  int deployTime;
  int breakdownTime;
  int nightVisionWearTime;
  int nightVisionWearTimeFadeOutEnd;
  int nightVisionWearTimePowerUp;
  int nightVisionRemoveTime;
  int nightVisionRemoveTimePowerDown;
  int nightVisionRemoveTimeFadeInStart;
  int fuseTime;
  int aifuseTime;
  int lockOnRadius;
  int lockOnSpeed;
  bool requireLockonToFire;
  bool noAdsWhenMagEmpty;
  bool avoidDropCleanup;
  int stackFire;
  float stackFireSpread;
  float stackFireAccuracyDecay;
  snd_alias_list_name stackSound;
  float autoAimRange;
  float aimAssistRange;
  bool mountableWeapon;
  float aimPadding;
  float enemyCrosshairRange;
  bool crosshairColorChange;
  float moveSpeedScale;
  float adsMoveSpeedScale;
  float sprintDurationScale;
  weapOverlayReticle_t adsOverlayReticle;
  weapOverlayInterface_t adsOverlayInterface;
  float adsOverlayWidth;
  float adsOverlayHeight;
  float fAdsBobFactor;
  float fAdsViewBobMult;
  float fHipSpreadStandMin;
  float fHipSpreadDuckedMin;
  float fHipSpreadProneMin;
  float hipSpreadStandMax;
  float hipSpreadDuckedMax;
  float hipSpreadProneMax;
  float fHipSpreadDecayRate;
  float fHipSpreadFireAdd;
  float fHipSpreadTurnAdd;
  float fHipSpreadMoveAdd;
  float fHipSpreadDuckedDecay;
  float fHipSpreadProneDecay;
  float fHipReticleSidePos;
  float fAdsIdleAmount;
  float fHipIdleAmount;
  float adsIdleSpeed;
  float hipIdleSpeed;
  float fIdleCrouchFactor;
  float fIdleProneFactor;
  float fGunMaxPitch;
  float fGunMaxYaw;
  float swayMaxAngle;
  float swayLerpSpeed;
  float swayPitchScale;
  float swayYawScale;
  float swayHorizScale;
  float swayVertScale;
  float swayShellShockScale;
  float adsSwayMaxAngle;
  float adsSwayLerpSpeed;
  float adsSwayPitchScale;
  float adsSwayYawScale;
  bool sharedAmmo;
  bool rifleBullet;
  bool armorPiercing
  bool boltAction;
  bool useAltTagFlash;
  bool useAntiLagRewind;
  bool isCarriedKillstreakWeapon;
  bool aimDownSight;
  bool rechamberWhileAds;
  bool reloadWhileAds;
  float adsViewErrorMin;
  float adsViewErrorMax;
  bool cookOffHold;
  bool clipOnly;
  bool canUseInVehicle;
  bool noDropsOrRaises;
  bool adsFire;
  bool cancelAutoHolsterWhenEmpty;
  bool suppressAmmoReserveDisplay;
  bool laserSightDuringNightvision;
  bool hideThirdPerson;
  bool explodeOnGround;
  bool throwBack;
  bool retrievable;
  bool dieOnRespawn;
  bool noThirdPersonDropsOrRaises;
  bool continuousFire;
  bool noPing;
  bool forceBounce;
  bool useDroppedModelAsStowed;
  bool noQuickDropWhenEmpty;
  bool keepCrosshairWhenAds;
  bool useOnlyAltWeaponHideTagsInAltMode;
  Material *killIcon;
  weaponIconRatioType_t killIconRatio;
  bool flipKillIcon;
  bool noPartialReload;
  bool segmentedReload;
  bool noADSAutoReload;
  int iReloadAmmoAdd;
  int iReloadStartAdd;
  const char * grenadeWeapon;
  const char * dualWieldWeapon;
  int iDropAmmoMin;
  int iDropAmmoMax;
  int iDropClipAmmoMin;
  int iDropClipAmmoMax;
  bool blocksProne;
  bool showIndicator;
  int isRollingGrenade; 
  int iExplosionRadius;
  int iExplosionRadiusMin;
  int iIndicatorRadius;
  int iExplosionInnerDamage;
  int iExplosionOuterDamage;
  float damageConeAngle;
  int iProjectileSpeed;
  int iProjectileSpeedUp;
  int iProjectileSpeedRelativeUp;
  int iProjectileSpeedForward;
  int iProjectileActivateDist;
  float projLifetime;
  float timeToAccelerate;
  float projectileCurvature;
  XModel *projectileModel;
  weapProjExposion_t projExplosion;
  ProjectileExplosionEffect projExplosionEffect[5];
  FxEffectDef * projDudEffect;
  snd_alias_list_name projExplosionSound;
  snd_alias_list_name projDudSound;
  snd_alias_list_name mortarShellSound;
  snd_alias_list_name tankShellSound;
  bool projImpactExplode;
  bool bulletImpactExplode;
  WeapStickinessType stickiness;
  rotateType_t rotateType;
  bool plantable;
  bool hasDetonator;
  bool timedDetonation;
  bool noCrumpleMissile;
  bool rotate;
  bool keepRolling; 
  bool holdButtonToThrow;
  bool offhandHoldIsCancelable;
  bool freezeMovementWhenFiring;
  float lowAmmoWarningThreshold;
  float meleeChargeRange;
  bool useAsMelee;
  bool isCameraSensor;
  bool isAcousticSensor;
            int unknown5;
  FxEffectDef * projTrailEffect;
  float vPorjectileColor[3];
  guidedMissileType_t guidedMissileType;
  float maxSteeringAccel;
  int projIgnitionDelay;
  FxEffectDef *projIgnitionEffect;
  snd_alias_list_name projIgnitionSound;
  float fAdsAimPitch;
  float fAdsCrosshairInFrac;
  float fAdsCrosshairOutFrac;
  int adsGunKickReducedKickBullets;
  float adsGunKickReducedKickPercent;
  float fAdsGunKickPitchMin;
  float fAdsGunKickPitchMax;
  float fAdsGunKickYawMin;
  float fAdsGunKickYawMax;
  float fAdsGunKickAccel;
  float fAdsGunKickSpeedMax;
  float fAdsGunKickSpeedDecay;
  float fAdsGunKickStaticDecay;
  float fAdsViewKickPitchMin;
  float fAdsViewKickPitchMax;
  float fAdsViewKickYawMin;
  float fAdsViewKickYawMax;
  float fAdsViewScatterMin;
  float fAdsViewScatterMax;
  float fAdsSpread;
  int hipGunKickReducedKickBullets;
  float hipGunKickReducedKickPercent;
  float fHipGunKickPitchMin;
  float fHipGunKickPitchMax;
  float fHipGunKickYawMin;
  float fHipGunKickYawMax;
  float fHipGunKickAccel;
  float fHipGunKickSpeedMax;
  float fHipGunKickSpeedDecay;
  float fHipGunKickStaticDecay;
  float fHipViewKickPitchMin;
  float fHipViewKickPitchMax;
  float fHipViewKickYawMin;
  float fHipViewKickYawMax;
  float fHipViewScatterMin;
  float fHipViewScatterMax;
  float fightDist;
  float maxDist;
  const char * aiVsAiAccuracyGraphName;
  const char * aiVsPlayerAccuracyGraphName;
  vec2_t * aiVsAiAccuracyGraphKnots;
  vec2_t * aiVsPlayerAccuracyGraphKnots;
  vec2_t * aiVsAiOriginalAccuracyGraphKnots;
  vec2_t * aiVsPlayerOriginalAccuracyGraphKnots;
  int aiVsAiAccuracyGraphKnotCount;
  int aiVsPlayerAccuracyGraphKnotCount;
  int aiVsAiOriginalAccuracyGraphKnotCount;
  int aiVsPlayerOriginalAccuracyGraphKnotCount;
  int iPositionReloadTransTime;
  float leftArc;
  float rightArc;
  float topArc;
  float bottomArc;
  float accuracy;
  float aiSpread;
  float playerSpread;
  float minTurnSpeed[2];
  float maxTurnSpeed[2];
  float pitchConvergenceTime;
  float yawConvergenceTime;
  float suppressTime;
  float maxRange;
  float fAnimHorRotateInc;
  float fPlayerPositionDist;
  const char *szUseHintString;
  const char *dropHintString;
  int iUseHintStringIndex;
  int dropHintStringIndex;
  float horizViewJitter;
  float vertViewJitter;
  const char *szScript;
  int minDamage;
  int minPlayerDamage;
  float fMaxDamageRange;
  float fMinDamageRange;
  float destabilizationRateTime;
  float destabilizationCurvatureMax;
  int destabilizeDistance;
  float * locationDamageMultipliers;      //Refer to bodyParts_t
  const char *fireRumble;
  const char *meleeImpactRumble;
  const char *reloadRumble;
  float adsDofStart;
  float adsDofEnd;
  float hipDofStart;
  float hipDofEnd;
  float scanSpeed;
  float scanAccel;
  int scanPauseTime;
  const char * flameTableFirstPerson;
  const char * flameTableThirdPerson;
  FlameTable * firstPersonFlameTable;
  FlameTable * thirdPersonFlameTable;
  FxEffectDef * tagFx_preparationEffect;
  FxEffectDef * tagFlash_preparationEffect;
  bool doGibbing;
  float maxGibDistance;
};
#pragma pack(pop)

struct XAnimsList
{
  const char * szDefaultXAnim;
  const char * szIdleXAnim;
  const char * szEmptyIdleXAnim;
  const char * szFireXAnim;
  const char * szHoldFireXAnim;
  const char * szLastShotXAnim;
  const char * szRechamberXAnim;
  const char * szMeleeXAnim;
  const char * szMeleeChargeXAnim;
  const char * szReloadXAnim;
  const char * szReloadRightXAnim;
  const char * szReloadEmptyXAnim;
  const char * szReloadStartXAnim;
  const char * szReloadEndXAnim;
  const char * szReloadQuickXAnim;
  const char * szReloadQuickEmptyXAnim;
  const char * szRaiseXAnim;
  const char * szFirstRaiseXAnim;
  const char * szDropXAnim;
  const char * szAltRaiseXAnim;
  const char * szAltDropXAnim;
  const char * szQuickRaiseXAnim;
  const char * szQuickDropXAnim;
  const char * szEmptyRaiseXAnim;
  const char * szEmptyDropXAnim;
  const char * szSprintInXAnim;
  const char * szSprintLoopXAnim;
  const char * szSprintOutXAnim;
  const char * szSprintInEmtpyXAnim;
  const char * szSprintLoopEmptyXAnim;
  const char * szSprintOutEmptyXAnim;
  const char * szLowReadyInXAnim;
  const char * szLowReadyLoopXAnim;
  const char * szLowReadyOutXAnim;
  const char * szContFireInXAnim;
  const char * szContFireLoopXAnim;
  const char * szContFireOutXAnim;
  const char * szDeployXAnim;
  const char * szBreakdownXAnim;
  const char * szDetonateXAnim;
  const char * szNightVisionWearXAnim;
  const char * szNightVisionRemoveXAnim;
  const char * szAdsFireXAnim;
  const char * szAdsLastShotXAnim;
  const char * szAdsRechamberXAnim;
  const char * szDTPInXAnim;
  const char * szDTPLoopXAnim;
  const char * szDTPOutXAnim;
  const char * szDTPInEmtpyXAnim;
  const char * szDTPLoopEmptyXAnim;
  const char * szDTPOutEmptyXAnim;
  const char * szSlideInXAnim;
  const char * szMantleXAnim;
  const char * szSprintCameraXAnim;
  const char * szDTPInCameraXAnim;
  const char * szDTPLoopCameraXAnim;
  const char * szDTPOutCameraXAnim;
  const char * szMantleCameraXAnim;
  const char * szFireLeftXAnim;
  const char * szLastShotLeftXAnim;
  const char * szIdleLeftXAnim;
  const char * szEmptyIdleXAnim;
  const char * szReloadEmptyLeftXAnim;
  const char * szReloadLeftXAnim;
  const char * szADSUpXAnim;
  const char * szADSDownXAnim;
};

#pragma pack(push, 4)
struct WeaponVariantDef
{
  char * szInternalName;
          int unknown1;
  WeaponDef * WeaponDef;
  char * szDisplayName;
  XAnimsList * szXAnims;
  const char * altWeapon;
  ScriptString (*hideTags[0x20]);
          int unknown2;
  int iClipSize;
  int iReloadTime;
  int iReloadEmptyTime;
  int iReloadQuickTime;
  int iReloadQuickEmptyTime;
  int iAdsTransInTime;
  int iAdsTransOutTime;
  int iAltRaiseTime;
  const char *szAmmoName;
  int iAmmoIndex;
  const char *szClipName;
  int iClipIndex;
  float aimAssistRangeAds;
  float adsSwayHorizScale;
  float adsSwayVertScale;
  float fAdsViewKickCenterSpeed;
  float fHipViewKickCenterSpeed;
  float fAdsZoomFov[3];
  float adsZoomInFrac;
  float adsZoomOutFrac;
  float adsOverlayAlphaScale;
          int unknown3;
          int unknown4;
  bool silenced;
  bool dualMag;
  bool fullMetalJacket;
  bool hollowPoint;
  bool rapidFire;
  Material * AdsOverlayShader;
  Material * AdsOverlayShaderLowRes;
  Material * dpadIcon;
  weaponIconRatioType_t dpadIconRatio;
  float ikLeftHandOffset[3];
  float ikLeftHandRotation[3];
  float ikLeftHandProneOffset[3];
  float ikLeftHandProneRotation[3];
  float ikLeftHandUiViewerOffset[3];
  float ikLeftHandUiViewerRotation[3];
};
#pragma pack(pop)

Source Format

The weapon source files are raw text files with no extension, located at "raw/weapons/sp/" for SP weapons and "raw/weapons/mp/" for MP weapons. They use the same format as many other assets, with each setting name and value separated by a back-slash. The first setting identifies the file, and for weapons the identifier string is "WEAPONFILE".