Weapon Table
Base:0x004d7a00 (weapon_table)Entry size:
0x48 bytes (72 bytes)Count: 54 weapons
Struct Layout
Key Fields
| Offset | Field | Type | Description |
|---|---|---|---|
| 0x00 | ammo | i32 | Magazine size |
| 0x04 | reload_time | float | Reload duration (seconds) |
| 0x08 | projectile_count | i32 | Projectiles per shot (shotguns) |
| 0x0c | spread_angle | float | Spread per shot (radians) |
| 0x10 | base_damage | float | Damage per projectile |
| 0x14 | fire_rate | float | Shots per second |
| 0x18 | ammo_class | i32 | Ammo type (affects reload/effects) |
| 0x1c | shot_cooldown | float | Time between shots |
| 0x20 | projectile_type | i32 | Projectile pool type ID |
Weapon Examples
Pistol (Weapon ID 1)
Shotgun (Weapon ID 3)
Gauss Gun (Weapon ID 6)
Player Weapon State
Weapon state is embedded in the player struct: Base:player_health + 0x29c (within player pool)
Current Weapon
| Offset | Field | Type | Description |
|---|---|---|---|
| 0x29c | weapon_id | i32 | Current weapon ID (1-54) |
| 0x2a0 | clip_size | float | Magazine capacity (copied from table) |
| 0x2a4 | reload_active | u8 | 1 if currently reloading |
| 0x2a8 | ammo | float | Current ammo count |
| 0x2ac | reload_timer | float | Reload countdown |
| 0x2b0 | shot_cooldown | float | Fire rate cooldown |
| 0x2b4 | reload_timer_max | float | Total reload duration |
Alt Weapon (Swap State)
| Offset | Field | Type | Description |
|---|---|---|---|
| 0x2b8 | alt_weapon_id | i32 | Swapped-out weapon ID |
| 0x2bc | alt_clip_size | float | Saved magazine size |
| 0x2c0 | alt_reload_active | u8 | Saved reload flag |
| 0x2c4 | alt_ammo | float | Saved ammo count |
| 0x2c8 | alt_reload_timer | float | Saved reload timer |
| 0x2cc | alt_shot_cooldown | float | Saved fire cooldown |
| 0x2d0 | alt_reload_timer_max | float | Saved reload duration |
alt_* fields.
Weapon Assignment
Theweapon_assign_player function copies table data to player state:
Weapon Fire Logic
Key steps inplayer_fire_weapon:
- Check cooldown:
if (shot_cooldown > 0) return; - Check ammo:
if (ammo <= 0) start_reload(); - Spawn projectiles: Loop
projectile_counttimes with spread - Decrement ammo:
ammo -= 1.0; - Set cooldown:
shot_cooldown = weapon_table[weapon_id].shot_cooldown; - Trigger effects: Muzzle flash, SFX
Weapon ID Map
Ballistic (1-7)
Ballistic (1-7)
- 0x01: Pistol
- 0x02: Assault Rifle
- 0x03: Shotgun
- 0x04: Sawed-off Shotgun
- 0x05: Submachine Gun
- 0x06: Gauss Gun
- 0x07: Mean Minigun
Energy (8-11, 15-17)
Energy (8-11, 15-17)
- 0x08: Flamethrower
- 0x09: Plasma Rifle
- 0x0a: Multi-Plasma
- 0x0b: Plasma Minigun
- 0x0e: Plasma Shotgun
- 0x13: Pulse Gun
- 0x15: Ion Rifle
- 0x16: Ion Minigun
- 0x17: Ion Cannon
Explosive (12-14, 18, 28)
Explosive (12-14, 18, 28)
- 0x0c: Rocket Launcher
- 0x0d: Seeker Rockets
- 0x11: Mini-Rocket Swarmers
- 0x12: Rocket Minigun
- 0x1c: Plasma Cannon
Special (24-43)
Special (24-43)
- 0x18: Shrinkifier 5k
- 0x19: Blade Gun
- 0x1d: Splitter Gun
- 0x1e: Gauss Shotgun
- 0x1f: Ion Shotgun
- 0x29: Plague Spreader
- 0x2a: Bubblegun
- 0x2b: Rainbow Gun
Weapon Modifiers
Fire Bullets Bonus
Whenplayer_fire_bullets_timer > 0, all projectiles are forced to type 0x2d (fire):
Perk Multipliers
Angry Reloader (perk 50):- On reload complete, spawn radial plasma burst
reload_time *= 0.5
shot_cooldown *= 0.75
Related Pages
Entity Structures
Projectile pool layout
Perk Structures
Weapon-modifying perks
Player Struct
Complete player state documentation