mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-25 21:41:03 +00:00
- added Gez's infinite ammo powerup and random spawner fix patches.
- reduced size of Hexen's flames to fix bug in Deathkings MAP01. - added checks for sidedef scaling values SVN r1648 (trunk)
This commit is contained in:
parent
93742aca31
commit
d04ffd57f8
9 changed files with 81 additions and 40 deletions
|
@ -1,4 +1,7 @@
|
|||
June 7, 2009 (Changes by Graf Zahl)
|
||||
- added Gez's infinite ammo powerup and random spawner fix patches.
|
||||
- reduced size of Hexen's flames to fix bug in Deathkings MAP01.
|
||||
- added checks for sidedef scaling values
|
||||
- Added Karate Chris's poison cloud fix.
|
||||
|
||||
June 6, 2009
|
||||
|
|
|
@ -179,11 +179,12 @@ typedef enum
|
|||
CF_TIMEFREEZE = 1 << 15, // Player has an active time freezer
|
||||
CF_DRAIN = 1 << 16, // Player owns a drain powerup
|
||||
CF_REGENERATION = 1 << 17, // Player owns a regeneration artifact
|
||||
CF_HIGHJUMP = 1 << 18, // more Skulltag flags. Implemetation not guaranteed though. ;)
|
||||
CF_HIGHJUMP = 1 << 18, // more Skulltag flags. Implementation not guaranteed though. ;)
|
||||
CF_REFLECTION = 1 << 19,
|
||||
CF_PROSPERITY = 1 << 20,
|
||||
CF_DOUBLEFIRINGSPEED= 1 << 21,
|
||||
CF_DOUBLEFIRINGSPEED= 1 << 21, // Player owns a double firing speed artifact
|
||||
CF_EXTREMELYDEAD = 1 << 22, // [RH] Reliably let the status bar know about extreme deaths.
|
||||
CF_INFINITEAMMO = 1 << 23, // Player owns an infinite ammo artifact
|
||||
} cheat_t;
|
||||
|
||||
#define WPIECE1 1
|
||||
|
|
|
@ -184,7 +184,7 @@ static void SpawnFly(AActor *self, const PClass *spawntype, FSoundID sound)
|
|||
if (di->Name != NAME_None)
|
||||
{
|
||||
n -= di->amount; // logically, none of the -1 values have survived by now.
|
||||
if (n > -1) di = di->Next; // If we get into the negatives, we've reached the end of the list.
|
||||
if ((di->Next != NULL) && (n > -1)) di = di->Next; else n = -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1836,3 +1836,39 @@ void APowerMorph::EndEffect( )
|
|||
// Unmorph suceeded
|
||||
Player = NULL;
|
||||
}
|
||||
|
||||
// Infinite Ammo Powerup -----------------------------------------------------
|
||||
|
||||
IMPLEMENT_CLASS(APowerInfiniteAmmo)
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// APowerInfiniteAmmo :: InitEffect
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
void APowerInfiniteAmmo::InitEffect( )
|
||||
{
|
||||
if (Owner== NULL || Owner->player == NULL)
|
||||
return;
|
||||
|
||||
// Give the player infinite ammo
|
||||
Owner->player->cheats |= CF_INFINITEAMMO;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// APowerInfiniteAmmo :: EndEffect
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
void APowerInfiniteAmmo::EndEffect( )
|
||||
{
|
||||
// Nothing to do if there's no owner.
|
||||
if (Owner != NULL && Owner->player != NULL)
|
||||
{
|
||||
// Take away the limitless ammo
|
||||
Owner->player->cheats &= ~CF_INFINITEAMMO;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,6 @@ class ARandomSpawner : public AActor
|
|||
int n=0;
|
||||
|
||||
Super::PostBeginPlay();
|
||||
|
||||
drop = di = GetDropItems();
|
||||
if (di != NULL)
|
||||
{
|
||||
|
@ -52,7 +51,7 @@ class ARandomSpawner : public AActor
|
|||
if (di->Name != NAME_None)
|
||||
{
|
||||
n -= di->amount;
|
||||
if (di->Next != NULL) di = di->Next; else n=0;
|
||||
if ((di->Next != NULL) && (n > -1)) di = di->Next; else n = -1;
|
||||
}
|
||||
}
|
||||
// So now we can spawn the dropped item.
|
||||
|
@ -81,6 +80,22 @@ class ARandomSpawner : public AActor
|
|||
newmobj->tracer = tracer;
|
||||
newmobj->CopyFriendliness(this, false);
|
||||
if (!(flags & MF_DROPPED)) newmobj->flags &= ~MF_DROPPED;
|
||||
|
||||
// Handle special altitude flags
|
||||
if (newmobj->flags & MF_SPAWNCEILING)
|
||||
{
|
||||
newmobj->z = newmobj->ceilingz - newmobj->height;
|
||||
}
|
||||
else if (newmobj->flags2 & MF2_SPAWNFLOAT)
|
||||
{
|
||||
fixed_t space = newmobj->ceilingz - newmobj->height - newmobj->floorz;
|
||||
if (space > 48*FRACUNIT)
|
||||
{
|
||||
space -= 40*FRACUNIT;
|
||||
newmobj->z = MulScale8 (space, pr_randomspawn()) + newmobj->floorz + 40*FRACUNIT;
|
||||
}
|
||||
}
|
||||
|
||||
// Special1 is used to count how many recursions we're in.
|
||||
if (newmobj->IsKindOf(PClass::FindClass("RandomSpawner")))
|
||||
newmobj->special1 = ++special1;
|
||||
|
|
|
@ -404,7 +404,7 @@ bool AWeapon::CheckAmmo (int fireMode, bool autoSwitch, bool requireAmmo)
|
|||
int count1, count2;
|
||||
int enough, enoughmask;
|
||||
|
||||
if (dmflags & DF_INFINITE_AMMO)
|
||||
if ((dmflags & DF_INFINITE_AMMO) || (Owner->player->cheats & CF_INFINITEAMMO))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -462,7 +462,7 @@ bool AWeapon::CheckAmmo (int fireMode, bool autoSwitch, bool requireAmmo)
|
|||
|
||||
bool AWeapon::DepleteAmmo (bool altFire, bool checkEnough)
|
||||
{
|
||||
if (!(dmflags & DF_INFINITE_AMMO))
|
||||
if (!((dmflags & DF_INFINITE_AMMO) || (Owner->player->cheats & CF_INFINITEAMMO)))
|
||||
{
|
||||
if (checkEnough && !CheckAmmo (altFire ? AltFire : PrimaryFire, false))
|
||||
{
|
||||
|
|
|
@ -794,11 +794,11 @@ struct side_t
|
|||
|
||||
void SetTextureXScale(int which, fixed_t scale)
|
||||
{
|
||||
textures[which].xscale = scale;
|
||||
textures[which].xscale = scale <= 0? FRACUNIT : scale;
|
||||
}
|
||||
void SetTextureXScale(fixed_t scale)
|
||||
{
|
||||
textures[top].xscale = textures[mid].xscale = textures[bottom].xscale = scale;
|
||||
textures[top].xscale = textures[mid].xscale = textures[bottom].xscale = scale <= 0? FRACUNIT : scale;
|
||||
}
|
||||
fixed_t GetTextureXScale(int which) const
|
||||
{
|
||||
|
@ -807,11 +807,11 @@ struct side_t
|
|||
|
||||
void SetTextureYScale(int which, fixed_t scale)
|
||||
{
|
||||
textures[which].yscale = scale;
|
||||
textures[which].yscale = scale <= 0? FRACUNIT : scale;
|
||||
}
|
||||
void SetTextureYScale(fixed_t scale)
|
||||
{
|
||||
textures[top].yscale = textures[mid].yscale = textures[bottom].yscale = scale;
|
||||
textures[top].yscale = textures[mid].yscale = textures[bottom].yscale = scale <= 0? FRACUNIT : scale;
|
||||
}
|
||||
fixed_t GetTextureYScale(int which) const
|
||||
{
|
||||
|
|
|
@ -58,6 +58,7 @@ ACTOR FlameSmall : SwitchableDecoration 10501
|
|||
SpawnID 97
|
||||
+NOTELEPORT
|
||||
+INVISIBLE
|
||||
Radius 15
|
||||
RenderStyle Add
|
||||
States
|
||||
{
|
||||
|
@ -90,6 +91,7 @@ ACTOR FlameLarge : SwitchableDecoration 10503
|
|||
SpawnID 99
|
||||
+NOTELEPORT
|
||||
+INVISIBLE
|
||||
Radius 15
|
||||
RenderStyle Add
|
||||
States
|
||||
{
|
||||
|
|
|
@ -109,17 +109,11 @@ ACTOR HexenArmor : Armor native
|
|||
+Inventory.UNDROPPABLE
|
||||
}
|
||||
|
||||
ACTOR DehackedPickup : Inventory native
|
||||
{
|
||||
}
|
||||
ACTOR DehackedPickup : Inventory native {}
|
||||
|
||||
ACTOR FakeInventory : Inventory native
|
||||
{
|
||||
}
|
||||
ACTOR FakeInventory : Inventory native {}
|
||||
|
||||
ACTOR CustomInventory : Inventory native
|
||||
{
|
||||
}
|
||||
ACTOR CustomInventory : Inventory native {}
|
||||
|
||||
Actor Health : Inventory native
|
||||
{
|
||||
|
@ -148,9 +142,7 @@ ACTOR PowerupGiver : Inventory native
|
|||
Inventory.PickupSound "misc/p_pkup"
|
||||
}
|
||||
|
||||
ACTOR Powerup : Inventory native
|
||||
{
|
||||
}
|
||||
ACTOR Powerup : Inventory native {}
|
||||
|
||||
ACTOR PowerInvulnerable : Powerup native
|
||||
{
|
||||
|
@ -170,9 +162,7 @@ ACTOR PowerInvisibility : Powerup native
|
|||
Powerup.Duration -60
|
||||
}
|
||||
|
||||
ACTOR PowerGhost : PowerInvisibility native
|
||||
{
|
||||
}
|
||||
ACTOR PowerGhost : PowerInvisibility native {}
|
||||
|
||||
ACTOR PowerShadow : PowerInvisibility native
|
||||
{
|
||||
|
@ -199,9 +189,7 @@ ACTOR PowerLightAmp : Powerup native
|
|||
Powerup.Duration -120
|
||||
}
|
||||
|
||||
ACTOR PowerTorch : PowerLightAmp native
|
||||
{
|
||||
}
|
||||
ACTOR PowerTorch : PowerLightAmp native {}
|
||||
|
||||
ACTOR PowerFlight : Powerup native
|
||||
{
|
||||
|
@ -290,23 +278,22 @@ ACTOR PowerRegeneration : Powerup native
|
|||
Powerup.Duration -120
|
||||
}
|
||||
|
||||
ACTOR PowerHighJump : Powerup native
|
||||
{
|
||||
}
|
||||
ACTOR PowerHighJump : Powerup native {}
|
||||
|
||||
ACTOR PowerDoubleFiringSpeed : Powerup native
|
||||
{
|
||||
}
|
||||
ACTOR PowerDoubleFiringSpeed : Powerup native {}
|
||||
|
||||
ACTOR PowerMorph : Powerup native
|
||||
{
|
||||
Powerup.Duration -40
|
||||
}
|
||||
|
||||
ACTOR MapRevealer : Inventory native
|
||||
ACTOR PowerInfiniteAmmo : Powerup native
|
||||
{
|
||||
Powerup.Duration -30
|
||||
}
|
||||
|
||||
ACTOR MapRevealer : Inventory native {}
|
||||
|
||||
ACTOR PuzzleItem : Inventory native
|
||||
{
|
||||
+NOGRAVITY
|
||||
|
@ -342,7 +329,4 @@ Actor WeaponHolder : Inventory native
|
|||
+INVENTORY.UNDROPPABLE
|
||||
}
|
||||
|
||||
Actor WeaponPiece : Inventory native
|
||||
{
|
||||
}
|
||||
|
||||
Actor WeaponPiece : Inventory native {}
|
||||
|
|
Loading…
Reference in a new issue