Added "<weapon> has no ammo." messages.

This commit is contained in:
Marisa the Magician 2019-09-29 18:19:18 +02:00
commit e0d01f730e
2 changed files with 16 additions and 0 deletions

View file

@ -160,6 +160,8 @@ M_LCLIP = "L Clip";
M_RCLIP = "R Clip";
M_NAME = "Name";
M_HEALTH = "Health";
M_NOAMMO = "%s has no ammo.";
M_NOAMMO2 = "%s have no ammo.";
/* Menus */
FLAK_BTOP1 = "Standard";
FLAK_BTOP2 = "Beta";
@ -383,6 +385,8 @@ M_LCLIP = "Cargador Izq.";
M_RCLIP = "Cargador Dch.";
M_NAME = "Nombre";
M_HEALTH = "Salud";
M_NOAMMO = "%s no tiene munición.";
M_NOAMMO2 = "%s no tienen munición.";
/* Menus */
FLAK_BTOP1 = "Estándar";
FLAK_BTOP2 = "Beta";

View file

@ -1288,6 +1288,7 @@ Class UTWeapon : Weapon
{
int DropAmmo;
bool bExtraPickup;
transient int lastnoammotic;
Property DropAmmo: DropAmmo;
@ -1435,6 +1436,17 @@ Class UTWeapon : Weapon
roll = 0;
}
override bool CheckAmmo( int fireMode, bool autoSwitch, bool requireAmmo, int ammocount )
{
bool rslt = Super.CheckAmmo(fireMode,autoSwitch,requireAmmo,ammocount);
if ( (gametic > lastnoammotic) && !rslt && !autoSwitch && !requireAmmo && Owner.CheckLocalView() )
{
lastnoammotic = gametic;
Console.Printf(StringTable.Localize((Amount>1)?"$M_NOAMMO2":"$M_NOAMMO"),GetTag());
}
return rslt;
}
Default
{
Weapon.BobStyle "Smooth";