- added 'defaultterrain' option to terrain parser for mods that want to have

a different default terrain than a generic solid surface.
- added format char processing to A_Print(Bold) and all printable messages
  that can be defined in DECORATE.
- Fixed: The railgun code ignored MF3_ALWAYSPUFF.
- added desaturated translations.
- added optional state parameters to A_ReFire and A_GunFlash and A_CountdownArg.


SVN r1921 (trunk)
This commit is contained in:
Christoph Oelckers 2009-10-16 16:04:19 +00:00
commit 8b27bd1434
15 changed files with 219 additions and 65 deletions

View file

@ -206,7 +206,7 @@ void P_BringUpWeapon (player_t *player)
//
//---------------------------------------------------------------------------
void P_FireWeapon (player_t *player)
void P_FireWeapon (player_t *player, FState *state)
{
AWeapon *weapon;
@ -225,7 +225,11 @@ void P_FireWeapon (player_t *player)
player->mo->PlayAttacking ();
weapon->bAltFire = false;
P_SetPsprite (player, ps_weapon, weapon->GetAtkState(!!player->refire));
if (state == NULL)
{
state = weapon->GetAtkState(!!player->refire);
}
P_SetPsprite (player, ps_weapon, state);
if (!(weapon->WeaponFlags & WIF_NOALERT))
{
P_NoiseAlert (player->mo, player->mo, false);
@ -238,7 +242,7 @@ void P_FireWeapon (player_t *player)
//
//---------------------------------------------------------------------------
void P_FireWeaponAlt (player_t *player)
void P_FireWeaponAlt (player_t *player, FState *state)
{
AWeapon *weapon;
@ -258,8 +262,12 @@ void P_FireWeaponAlt (player_t *player)
player->mo->PlayAttacking ();
weapon->bAltFire = true;
if (state == NULL)
{
state = weapon->GetAltAtkState(!!player->refire);
}
P_SetPsprite (player, ps_weapon, weapon->GetAltAtkState(!!player->refire));
P_SetPsprite (player, ps_weapon, state);
if (!(weapon->WeaponFlags & WIF_NOALERT))
{
P_NoiseAlert (player->mo, player->mo, false);
@ -456,7 +464,7 @@ void P_CheckWeaponFire (player_t *player)
if (!player->attackdown || !(weapon->WeaponFlags & WIF_NOAUTOFIRE))
{
player->attackdown = true;
P_FireWeapon (player);
P_FireWeapon (player, NULL);
return;
}
}
@ -465,7 +473,7 @@ void P_CheckWeaponFire (player_t *player)
if (!player->attackdown || !(weapon->WeaponFlags & WIF_NOAUTOFIRE))
{
player->attackdown = true;
P_FireWeaponAlt (player);
P_FireWeaponAlt (player, NULL);
return;
}
}
@ -507,7 +515,15 @@ void P_CheckWeaponSwitch (player_t *player)
//
//---------------------------------------------------------------------------
DEFINE_ACTION_FUNCTION(AInventory, A_ReFire)
DEFINE_ACTION_FUNCTION_PARAMS(AInventory, A_ReFire)
{
ACTION_PARAM_START(1)
ACTION_PARAM_STATE(state, 0);
A_ReFire(self, state);
}
void A_ReFire(AActor *self, FState *state)
{
player_t *player = self->player;
@ -520,14 +536,14 @@ DEFINE_ACTION_FUNCTION(AInventory, A_ReFire)
&& player->PendingWeapon == WP_NOCHANGE && player->health)
{
player->refire++;
P_FireWeapon (player);
P_FireWeapon (player, state);
}
else if ((player->cmd.ucmd.buttons&BT_ALTATTACK)
&& player->ReadyWeapon->bAltFire
&& player->PendingWeapon == WP_NOCHANGE && player->health)
{
player->refire++;
P_FireWeaponAlt (player);
P_FireWeaponAlt (player, state);
}
else
{
@ -661,8 +677,11 @@ DEFINE_ACTION_FUNCTION(AInventory, A_Raise)
//
// A_GunFlash
//
DEFINE_ACTION_FUNCTION(AInventory, A_GunFlash)
DEFINE_ACTION_FUNCTION_PARAMS(AInventory, A_GunFlash)
{
ACTION_PARAM_START(1)
ACTION_PARAM_STATE(flash, 0);
player_t *player = self->player;
if (NULL == player)
@ -671,9 +690,11 @@ DEFINE_ACTION_FUNCTION(AInventory, A_GunFlash)
}
player->mo->PlayAttacking2 ();
FState * flash=NULL;
if (player->ReadyWeapon->bAltFire) flash = player->ReadyWeapon->FindState(NAME_AltFlash);
if (flash == NULL) flash = player->ReadyWeapon->FindState(NAME_Flash);
if (flash == NULL)
{
if (player->ReadyWeapon->bAltFire) flash = player->ReadyWeapon->FindState(NAME_AltFlash);
if (flash == NULL) flash = player->ReadyWeapon->FindState(NAME_Flash);
}
P_SetPsprite (player, ps_flash, flash);
}