weapon_{shotgun,rpg}: add punchangle

HLWeapon: draw ammo2 icon
This commit is contained in:
Marco Cawthorne 2024-07-26 14:51:01 -07:00
parent 9027d19fa7
commit f52e61dbd0
Signed by: eukara
GPG key ID: CE2032F0A2882A22
3 changed files with 23 additions and 0 deletions

View file

@ -50,6 +50,7 @@ HLWeapon:NSWeapon
int m_iHudSlotPos; int m_iHudSlotPos;
string m_ammoIcon; string m_ammoIcon;
string m_ammo2Icon;
string m_crossHair; string m_crossHair;
NSWeapon m_nextWeapon; NSWeapon m_nextWeapon;
virtual void UpdateGUI(void); virtual void UpdateGUI(void);
@ -129,6 +130,12 @@ HLWeapon::AddedToInventory(void)
m_ammoIcon = sprintf("%s.ammo", strtolower(classname)); m_ammoIcon = sprintf("%s.ammo", strtolower(classname));
} }
m_ammo2Icon = GetDefString("ammoIcon");
if (m_ammo2Icon == "") {
m_ammo2Icon = sprintf("%s.ammo2", strtolower(classname));
}
m_crossHair = GetDefString("crosshair"); m_crossHair = GetDefString("crosshair");
if (m_crossHair == "") { if (m_crossHair == "") {
@ -139,6 +146,10 @@ HLWeapon::AddedToInventory(void)
m_ammoIcon = __NULL__; m_ammoIcon = __NULL__;
} }
if (m_ammo2Icon == "none") {
m_ammo2Icon = __NULL__;
}
if (m_crossHair == "none") { if (m_crossHair == "none") {
m_crossHair = __NULL__; m_crossHair = __NULL__;
} }
@ -185,6 +196,12 @@ HLWeapon::UpdateGUI(void)
if (m_secondaryAmmoType && m_primaryAmmoType != m_secondaryAmmoType) { if (m_secondaryAmmoType && m_primaryAmmoType != m_secondaryAmmoType) {
ourOwner.a_ammo3 = ourOwner.GetReserveAmmo(m_secondaryAmmoType); ourOwner.a_ammo3 = ourOwner.GetReserveAmmo(m_secondaryAmmoType);
HUD_DrawAmmo3(); HUD_DrawAmmo3();
/* draw ammo icon */
if (m_ammo2Icon) {
vector ammoPos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 74];
HLSprite_Draw_RGBA(m_ammo2Icon, ammoPos, g_hud_color, pSeatLocal->m_flAmmo2Alpha, true);
}
} }
} }

View file

@ -95,9 +95,11 @@ entityDef damage_rocketSplash
entityDef fireInfo_rpg entityDef fireInfo_rpg
{ {
"def_onFire" "projectile_rocket" "def_onFire" "projectile_rocket"
"punchAngle" "-10 0 0"
} }
entityDef fireInfo_rpg_homing entityDef fireInfo_rpg_homing
{ {
"def_onFire" "projectile_rocket_homing" "def_onFire" "projectile_rocket_homing"
"punchAngle" "-10 0 0"
} }

View file

@ -62,6 +62,7 @@ entityDef fireInfo_shotgun
"def_onFire" "projectile_shotgun" "def_onFire" "projectile_shotgun"
"ammoPerShot" "1" "ammoPerShot" "1"
"fireRate" "0.75" "fireRate" "0.75"
"punchAngle" "-5 0 0"
"model_flash" "sprites/muzzleflash2.spr" "model_flash" "sprites/muzzleflash2.spr"
} }
@ -71,6 +72,7 @@ entityDef fireInfo_altShotgun
"ammoPerShot" "2" "ammoPerShot" "2"
"fireRate" "1.5" "fireRate" "1.5"
"actFire" "2" "actFire" "2"
"punchAngle" "-10 0 0"
"snd_fire" "weapon_shotgun.double" "snd_fire" "weapon_shotgun.double"
"model_flash" "sprites/muzzleflash2.spr" "model_flash" "sprites/muzzleflash2.spr"
} }
@ -97,6 +99,7 @@ entityDef fireInfo_shotgun_mp
"def_onFire" "projectile_shotgun_mp" "def_onFire" "projectile_shotgun_mp"
"ammoPerShot" "1" "ammoPerShot" "1"
"fireRate" "1.25" "fireRate" "1.25"
"punchAngle" "-5 0 0"
"model_flash" "sprites/muzzleflash2.spr" "model_flash" "sprites/muzzleflash2.spr"
} }
@ -105,6 +108,7 @@ entityDef fireInfo_altShotgun_mp
"def_onFire" "projectile_shotgun_alt_mp" "def_onFire" "projectile_shotgun_alt_mp"
"ammoPerShot" "2" "ammoPerShot" "2"
"fireRate" "1.5" "fireRate" "1.5"
"punchAngle" "-10 0 0"
"model_flash" "sprites/muzzleflash2.spr" "model_flash" "sprites/muzzleflash2.spr"
} }