mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-01-18 07:02:03 +00:00
- Added a simple check for abstract weapon classes so that I can properly define
the DoomWeapon base class. - Fixed: When the Tome of Power runs out it must also set any pending weapon back to their regular state. SVN r521 (trunk)
This commit is contained in:
parent
725c6d195e
commit
6e5b1f1182
5 changed files with 36 additions and 17 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
April 29, 2007 (Changes by Graf Zahl)
|
||||||
|
- Added a simple check for abstract weapon classes so that I can properly define
|
||||||
|
the DoomWeapon base class.
|
||||||
|
- Fixed: When the Tome of Power runs out it must also set any pending weapon
|
||||||
|
back to their regular state.
|
||||||
|
|
||||||
April 27, 2007 (Changes by Graf Zahl)
|
April 27, 2007 (Changes by Graf Zahl)
|
||||||
- Added damage factors that allows to make monsters more or less resistant
|
- Added damage factors that allows to make monsters more or less resistant
|
||||||
to specific damage types.
|
to specific damage types.
|
||||||
|
|
|
@ -1108,13 +1108,21 @@ void APowerWeaponLevel2::EndEffect ()
|
||||||
{
|
{
|
||||||
player_t *player = Owner != NULL ? Owner->player : NULL;
|
player_t *player = Owner != NULL ? Owner->player : NULL;
|
||||||
|
|
||||||
if (player != NULL &&
|
if (player != NULL)
|
||||||
player->ReadyWeapon != NULL &&
|
{
|
||||||
|
|
||||||
|
if (player->ReadyWeapon != NULL &&
|
||||||
player->ReadyWeapon->WeaponFlags & WIF_POWERED_UP)
|
player->ReadyWeapon->WeaponFlags & WIF_POWERED_UP)
|
||||||
{
|
{
|
||||||
player->ReadyWeapon->EndPowerup ();
|
player->ReadyWeapon->EndPowerup ();
|
||||||
}
|
}
|
||||||
// BorderTopRefresh = screen->GetPageCount ();
|
if (player->PendingWeapon != NULL &&
|
||||||
|
player->PendingWeapon->WeaponFlags & WIF_POWERED_UP &&
|
||||||
|
player->PendingWeapon->SisterWeapon != NULL)
|
||||||
|
{
|
||||||
|
player->PendingWeapon = player->PendingWeapon->SisterWeapon;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Player Speed Trail (used by the Speed Powerup) ----------------------------
|
// Player Speed Trail (used by the Speed Powerup) ----------------------------
|
||||||
|
|
|
@ -486,6 +486,7 @@ void AWeapon::EndPowerup ()
|
||||||
{
|
{
|
||||||
if (GetReadyState() != SisterWeapon->GetReadyState())
|
if (GetReadyState() != SisterWeapon->GetReadyState())
|
||||||
{
|
{
|
||||||
|
if (Owner->player->PendingWeapon != NULL)
|
||||||
Owner->player->PendingWeapon = SisterWeapon;
|
Owner->player->PendingWeapon = SisterWeapon;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -4361,12 +4361,22 @@ void FinishThingdef()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isRuntimeActor)
|
if (isRuntimeActor)
|
||||||
|
{
|
||||||
|
FState * ready = ti->ActorInfo->FindState(NAME_Ready);
|
||||||
|
FState * select = ti->ActorInfo->FindState(NAME_Select);
|
||||||
|
FState * deselect = ti->ActorInfo->FindState(NAME_Deselect);
|
||||||
|
FState * fire = ti->ActorInfo->FindState(NAME_Fire);
|
||||||
|
|
||||||
|
// Consider any weapon without any valid state abstract and don't output a warning
|
||||||
|
// This is for creating base classes for weapon groups that only set up some properties.
|
||||||
|
if (ready || select || deselect || fire)
|
||||||
{
|
{
|
||||||
// Do some consistency checks. If these states are undefined the weapon cannot work!
|
// Do some consistency checks. If these states are undefined the weapon cannot work!
|
||||||
if (!ti->ActorInfo->FindState(NAME_Ready)) I_Error("Weapon %s doesn't define a ready state.\n", ti->TypeName.GetChars());
|
if (!ready) I_Error("Weapon %s doesn't define a ready state.\n", ti->TypeName.GetChars());
|
||||||
if (!ti->ActorInfo->FindState(NAME_Select)) I_Error("Weapon %s doesn't define a select state.\n", ti->TypeName.GetChars());
|
if (!select) I_Error("Weapon %s doesn't define a select state.\n", ti->TypeName.GetChars());
|
||||||
if (!ti->ActorInfo->FindState(NAME_Deselect)) I_Error("Weapon %s doesn't define a deselect state.\n", ti->TypeName.GetChars());
|
if (!deselect) I_Error("Weapon %s doesn't define a deselect state.\n", ti->TypeName.GetChars());
|
||||||
if (!ti->ActorInfo->FindState(NAME_Fire)) I_Error("Weapon %s doesn't define a fire state.\n", ti->TypeName.GetChars());
|
if (!fire) I_Error("Weapon %s doesn't define a fire state.\n", ti->TypeName.GetChars());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,12 +12,6 @@ ACTOR DoomWeapon : Weapon
|
||||||
LightDone:
|
LightDone:
|
||||||
SHTG E 0 A_Light0
|
SHTG E 0 A_Light0
|
||||||
Stop
|
Stop
|
||||||
Ready: // get around the consistency checks
|
|
||||||
Deselect:
|
|
||||||
Select:
|
|
||||||
Fire:
|
|
||||||
TNT1 A 0
|
|
||||||
Stop
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue