Skip to content

Draft: Bullet

Christian Petersen edited this page Feb 10, 2017 · 2 revisions

The Bullet enum contains bullet types used by the game.

It is primarily used by CBaseEntity's FireBullets method to determine which skill setting to use for damage, and which damage type(s) to use. It also affects material type effects.

Note that FireBullets will draw decals for monster bullets, but not player bullets. This is because player bullets are normally handled by the game's client side prediction code, which will locally handle effects. Regardless of what value you pass for the draw argument, if the entity FireBullets is called on is a player, it will never draw decals.

HTML documentation can be found here.

Constants

BULLET_NONE

Skill Value Damage types
None DMG_CLUB

No bullet. Always deals 50 melee damage, and creates impact decals on glass surfaces only.

BULLET_PLAYER_9MM

Skill Value Damage types
sk_plr_9mm_bullet DMG_BULLET

9mm bullet. The Glock/Beretta pistol uses this.

BULLET_PLAYER_MP5

Skill Value Damage types
sk_plr_9mmAR_bullet DMG_BULLET

MP5 bullet. The MP5 uses this.

BULLET_PLAYER_SAW

Skill Value Damage types
sk_556_bullet DMG_BULLET

5.56 NATO bullet. The M249 SAW and M16 use this.

BULLET_PLAYER_SNIPER

Skill Value Damage types
sk_plr_762_bullet DMG_SNIPER

7.62 NATO bullet. The sniper rifle uses this.

BULLET_PLAYER_357

Skill Value Damage types
sk_plr_357_bullet DMG_BULLET

.357 revolver bullet. The Python uses this.

BULLET_PLAYER_EAGLE

Skill Value Damage types
(sk_plr_357_bullet) / 3 * 2 DMG_BULLET

.357 revolver bullet. The Desert Eagle uses this. This is the same skill value, modified for the Eagle's speed over damage advantage.

BULLET_PLAYER_BUCKSHOT

Skill Value Damage types
sk_plr_buckshot DMG_BULLET, DMG_LAUNCH

12 gauge buckshot shell. The shotgun uses this. The shotgun passes in a value of 8 for the number of bullets to fire to simulate 8 pellets in the shell in single shot mode, and 14 for weaponmode_shotgun's double barreled secondary attack.

BULLET_PLAYER_CROWBAR

Skill Value Damage types
sk_plr_9mm_bullet DMG_BULLET

Crowbar swipe. Since FireBullets is not meant to be used by the crowbar, this will use 9mm bullet settings instead.

BULLET_PLAYER_CROWBAR_ELECTRIC

Skill Value Damage types
sk_plr_9mm_bullet DMG_BULLET

Crowbar swipe. Since FireBullets is not meant to be used by the crowbar, this will use 9mm bullet settings instead.

BULLET_PLAYER_CUSTOMDAMAGE

Skill Value Damage types
None DMG_BULLET

Used in conjunction with custom bullet damage (the iDamage argument).

BULLET_MONSTER_9MM

Skill Value Damage types
sk_9mm_bullet DMG_BULLET

Monster 9mm bullet.

BULLET_MONSTER_MP5

Skill Value Damage types
sk_9mmAR_bullet DMG_BULLET

Monster MP5 bullet.

BULLET_MONSTER_SAW

Skill Value Damage types
sk_556_bullet DMG_BULLET

Monster 5.56 NATO bullet.

BULLET_MONSTER_SAW

Skill Value Damage types
sk_556_bullet DMG_BULLET

Monster 5.56 NATO bullet. Uses the same skill setting as player 5.56 bullets.

BULLET_MONSTER_12MM

Skill Value Damage types
sk_12mm_bullet DMG_BULLET

Monster 12mm bullet. Used for large guns like the Apache's machine gun and fixed gun emplacements.

BULLET_MONSTER_EAGLE

Skill Value Damage types
sk_otis_bullet DMG_BULLET

Monster .357 revolver bullet.

BULLET_MONSTER_SNIPER

Skill Value Damage types
sk_massassin_sniper DMG_SNIPER

Monster 7.62 NATO bullet.

BULLET_MONSTER_BUCKSHOT

Skill Value Damage types
sk_grunt_buckshot DMG_BULLET, DMG_LAUNCH

Monster 12 gauge buckshot shell. All monsters currently use the sk_hgrunt_pellets skill setting to determine how many pellets are fired.

DECAL_SCORCH_MARK

Skill Value Damage types
sk_plr_9mm_bullet DMG_BULLET

Decal scorch mark. This constant isn't used by FireBullets, and will fall back to the default of using the player's 9mm settings.


The following types will also launch enemies (DMG_LAUNCH) if custom damage is specified, and the bullet type is not BULLET_PLAYER_CUSTOMDAMAGE:

If custom damage is specified, and the bullet type is not BULLET_PLAYER_CUSTOMDAMAGE, monsters will always gib if the damage value is greater than their max health. If not, they will never gib.

Clone this wiki locally