- Added A_Mushroom compatibility option for Dehacked.

- Added Gez's submission for interhubamount DECORATE property.


SVN r1747 (trunk)
This commit is contained in:
Christoph Oelckers 2009-08-02 15:54:34 +00:00
parent 641f946e32
commit 356e4a0fcc
13 changed files with 30 additions and 10 deletions

View file

@ -1,4 +1,6 @@
August 2, 2009 (Changes by Graf Zahl)
- Added A_Mushroom compatibility option for Dehacked.
- Added Gez's submission for interhubamount DECORATE property.
- Fixed: The big endian version of PalEntry did not add the DWORD d field.
- Fixed: TObjPtr did not use a union to map its 2 pointers together.
- Added a compatibility mode for A_Mushroom. For DECORATE it is an additional

View file

@ -100,6 +100,7 @@ static FCompatOption Options[] =
{ "crossdropoff", COMPATF_CROSSDROPOFF, 0 },
{ "wallrun", COMPATF_WALLRUN, 0 }, // [GZ] Added for CC MAP29
{ "anybossdeath", COMPATF_ANYBOSSDEATH, 0}, // [GZ] Added for UAC_DEAD
{ "mushroom", COMPATF_MUSHROOM, 0},
{ NULL, 0, 0 }
};

View file

@ -466,7 +466,7 @@ CUSTOM_CVAR(Int, compatmode, 0, CVAR_ARCHIVE|CVAR_NOINITCALL)
break;
case 3:
v = COMPATF_TRACE|COMPATF_SOUNDTARGET|COMPATF_BOOMSCROLL;
v = COMPATF_TRACE|COMPATF_SOUNDTARGET|COMPATF_BOOMSCROLL|COMPATF_MUSHROOM;
break;
case 4:
@ -499,6 +499,7 @@ CVAR (Flag, compat_missileclip, compatflags, COMPATF_MISSILECLIP);
CVAR (Flag, compat_crossdropoff,compatflags, COMPATF_CROSSDROPOFF);
CVAR (Flag, compat_anybossdeath,compatflags, COMPATF_ANYBOSSDEATH);
CVAR (Flag, compat_minotaur, compatflags, COMPATF_MINOTAUR);
CVAR (Flag, compat_mushroom, compatflags, COMPATF_MUSHROOM);
//==========================================================================
//

View file

@ -317,6 +317,7 @@ enum
COMPATF_CROSSDROPOFF = 1 << 20, // monsters can't be pushed over dropoffs
COMPATF_ANYBOSSDEATH = 1 << 21, // [GZ] Any monster which calls BOSSDEATH counts for level specials
COMPATF_MINOTAUR = 1 << 22, // Minotaur's floor flame is exploded immediately when feet are clipped
COMPATF_MUSHROOM = 1 << 23, // Force original velocity calculations for A_Mushroom in Dehacked oods.
};
// Emulate old bugs for select maps. These are not exposed by a cvar

View file

@ -149,7 +149,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Mushroom)
target->x = self->x + (i << FRACBITS); // Aim in many directions from source
target->y = self->y + (j << FRACBITS);
target->z = self->z + (P_AproxDistance(i,j) << (FRACBITS+2)); // Aim up fairly high
if (flags == 0 && self->state->Misc1 == 0)
if (flags == 0 && (self->state->Misc1 == 0 || !(i_compatflags & COMPATF_MUSHROOM)))
{
mo = P_SpawnMissile (self, target, spawntype); // Launch fireball
}

View file

@ -1181,7 +1181,7 @@ void G_PlayerFinishLevel (int player, EFinishLevelType mode, bool resetinventory
while (item != NULL)
{
next = item->Inventory;
if (item->ItemFlags & IF_INTERHUBSTRIP)
if (item->InterHubAmount < 1)
{
item->Destroy ();
}
@ -1190,14 +1190,13 @@ void G_PlayerFinishLevel (int player, EFinishLevelType mode, bool resetinventory
}
if (mode == FINISH_NoHub && !(level.flags2 & LEVEL2_KEEPFULLINVENTORY))
{ // Reduce all owned (visible) inventory to 1 item each
{ // Reduce all owned (visible) inventory to defined maximum interhub amount
for (item = p->mo->Inventory; item != NULL; item = item->Inventory)
{
// There may be depletable items with an amount of 0.
// Those need to stay at 0; the rest get dropped to 1.
if (item->ItemFlags & IF_INVBAR && item->Amount > 1)
// If the player is carrying more samples of an item than allowed, reduce amount accordingly
if (item->ItemFlags & IF_INVBAR && item->Amount > item->InterHubAmount)
{
item->Amount = 1;
item->Amount = item->InterHubAmount;
}
}
}

View file

@ -1340,6 +1340,7 @@ MapFlagHandlers[] =
{ "compat_crossdropoff", MITYPE_COMPATFLAG, COMPATF_CROSSDROPOFF},
{ "compat_anybossdeath", MITYPE_COMPATFLAG, COMPATF_ANYBOSSDEATH},
{ "compat_minotaur", MITYPE_COMPATFLAG, COMPATF_MINOTAUR},
{ "compat_mushroom", MITYPE_COMPATFLAG, COMPATF_MUSHROOM},
{ "cd_start_track", MITYPE_EATNEXT, 0, 0 },
{ "cd_end1_track", MITYPE_EATNEXT, 0, 0 },
{ "cd_end2_track", MITYPE_EATNEXT, 0, 0 },

View file

@ -119,7 +119,7 @@ enum
IF_UNDROPPABLE = 1<<5, // The player cannot manually drop the item
IF_INVBAR = 1<<6, // Item appears in the inventory bar
IF_HUBPOWER = 1<<7, // Powerup is kept when moving in a hub
IF_INTERHUBSTRIP = 1<<8, // Item is removed when travelling between hubs
// IF_INTERHUBSTRIP = 1<<8, // Item is removed when travelling between hubs
IF_ADDITIVETIME = 1<<9, // when picked up while another item is active, time is added instead of replaced.
IF_ALWAYSPICKUP = 1<<10, // For IF_AUTOACTIVATE, MaxAmount=0 items: Always "pick up", even if it doesn't do anything
IF_FANCYPICKUPSOUND = 1<<11, // Play pickup sound in "surround" mode
@ -165,6 +165,7 @@ public:
TObjPtr<AActor> Owner; // Who owns this item? NULL if it's still a pickup.
int Amount; // Amount of item this instance has
int MaxAmount; // Max amount of item this instance can have
int InterHubAmount; // Amount of item that can be kept between hubs or levels
int RespawnTics; // Tics from pickup time to respawn time
FTextureID Icon; // Icon to show on status bar or HUD
int DropTime; // Countdown after dropping

View file

@ -1104,6 +1104,7 @@ static menuitem_t CompatibilityItems[] = {
{ bitflag, "Use Doom heights for missile clipping", {&compatflags}, {0}, {0}, {0}, {(value_t *)COMPATF_MISSILECLIP} },
{ bitflag, "Allow any bossdeath for level special", {&compatflags}, {0}, {0}, {0}, {(value_t *)COMPATF_ANYBOSSDEATH} },
{ bitflag, "No Minotaur floor flames in water", {&compatflags}, {0}, {0}, {0}, {(value_t *)COMPATF_MINOTAUR} },
{ bitflag, "Original A_Mushroom speed in DEH mods", {&compatflags}, {0}, {0}, {0}, {(value_t *)COMPATF_MUSHROOM} },
{ discrete, "Interpolate monster movement", {&nomonsterinterpolation}, {2.0}, {0.0}, {0.0}, {NoYes} },
};

View file

@ -210,6 +210,7 @@ enum
DEPF_HERETICBOUNCE,
DEPF_HEXENBOUNCE,
DEPF_DOOMBOUNCE,
DEPF_INTERHUBSTRIP,
};
enum

View file

@ -253,7 +253,6 @@ static FFlagDef InventoryFlags[] =
DEFINE_FLAG(IF, UNDROPPABLE, AInventory, ItemFlags),
DEFINE_FLAG(IF, INVBAR, AInventory, ItemFlags),
DEFINE_FLAG(IF, HUBPOWER, AInventory, ItemFlags),
DEFINE_FLAG(IF, INTERHUBSTRIP, AInventory, ItemFlags),
DEFINE_FLAG(IF, ALWAYSPICKUP, AInventory, ItemFlags),
DEFINE_FLAG(IF, FANCYPICKUPSOUND, AInventory, ItemFlags),
DEFINE_FLAG(IF, BIGPOWERUP, AInventory, ItemFlags),
@ -264,6 +263,7 @@ static FFlagDef InventoryFlags[] =
DEFINE_FLAG(IF, PERSISTENTPOWER, AInventory, ItemFlags),
DEFINE_DEPRECATED_FLAG(PICKUPFLASH),
DEFINE_DEPRECATED_FLAG(INTERHUBSTRIP),
};
static FFlagDef WeaponFlags[] =

View file

@ -148,6 +148,8 @@ void HandleDeprecatedFlags(AActor *defaults, FActorInfo *info, bool set, int ind
static_cast<AInventory*>(defaults)->PickupFlash = NULL;
}
break;
case DEPF_INTERHUBSTRIP: // Old system was 0 or 1, so if the flag is cleared, assume 1.
static_cast<AInventory*>(defaults)->InterHubAmount = set ? 0 : 1;
default:
break; // silence GCC
}
@ -1220,6 +1222,15 @@ DEFINE_CLASS_PROPERTY(icon, S, Inventory)
}
}
//==========================================================================
//
//==========================================================================
DEFINE_CLASS_PROPERTY(interhubamount, I, Inventory)
{
PROP_INT_PARM(i, 0);
defaults->InterHubAmount = i;
}
//==========================================================================
//
//==========================================================================

View file

@ -2,6 +2,7 @@ ACTOR Inventory native
{
Inventory.Amount 1
Inventory.MaxAmount 1
Inventory.InterHubAmount 1
Inventory.UseSound "misc/invuse"
Inventory.PickupSound "misc/i_pkup"