mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-11-29 15:12:11 +00:00
Merge branch 'master' of https://github.com/raa-eruanna/qzdoom into qzdoom
This commit is contained in:
commit
563b64b5e3
25 changed files with 115 additions and 62 deletions
|
@ -713,7 +713,7 @@ public:
|
||||||
virtual bool UseInventory (AInventory *item);
|
virtual bool UseInventory (AInventory *item);
|
||||||
|
|
||||||
// Tosses an item out of the inventory.
|
// Tosses an item out of the inventory.
|
||||||
AInventory *DropInventory (AInventory *item);
|
AInventory *DropInventory (AInventory *item, int amt = -1);
|
||||||
|
|
||||||
// Removes all items from the inventory.
|
// Removes all items from the inventory.
|
||||||
void ClearInventory();
|
void ClearInventory();
|
||||||
|
|
|
@ -55,7 +55,7 @@ struct event_t
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
typedef enum
|
enum gameaction_t : int
|
||||||
{
|
{
|
||||||
ga_nothing,
|
ga_nothing,
|
||||||
ga_loadlevel,
|
ga_loadlevel,
|
||||||
|
@ -75,7 +75,7 @@ typedef enum
|
||||||
ga_screenshot,
|
ga_screenshot,
|
||||||
ga_togglemap,
|
ga_togglemap,
|
||||||
ga_fullconsole,
|
ga_fullconsole,
|
||||||
} gameaction_t;
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2271,6 +2271,9 @@ void Net_DoCommand (int type, BYTE **stream, int player)
|
||||||
case DEM_INVDROP:
|
case DEM_INVDROP:
|
||||||
{
|
{
|
||||||
DWORD which = ReadLong (stream);
|
DWORD which = ReadLong (stream);
|
||||||
|
int amt = -1;
|
||||||
|
|
||||||
|
if (type == DEM_INVDROP) amt = ReadLong(stream);
|
||||||
|
|
||||||
if (gamestate == GS_LEVEL && !paused
|
if (gamestate == GS_LEVEL && !paused
|
||||||
&& players[player].playerstate != PST_DEAD)
|
&& players[player].playerstate != PST_DEAD)
|
||||||
|
@ -2288,7 +2291,7 @@ void Net_DoCommand (int type, BYTE **stream, int player)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
players[player].mo->DropInventory (item);
|
players[player].mo->DropInventory (item, amt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2764,10 +2767,13 @@ void Net_SkipCommand (int type, BYTE **stream)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DEM_INVUSE:
|
case DEM_INVUSE:
|
||||||
case DEM_INVDROP:
|
|
||||||
skip = 4;
|
skip = 4;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case DEM_INVDROP:
|
||||||
|
skip = 8;
|
||||||
|
break;
|
||||||
|
|
||||||
case DEM_GENERICCHEAT:
|
case DEM_GENERICCHEAT:
|
||||||
case DEM_DROPPLAYER:
|
case DEM_DROPPLAYER:
|
||||||
case DEM_FOV:
|
case DEM_FOV:
|
||||||
|
|
|
@ -501,7 +501,7 @@ PInt::PInt(unsigned int size, bool unsign, bool compatible)
|
||||||
MemberOnly = (size < 4);
|
MemberOnly = (size < 4);
|
||||||
if (!unsign)
|
if (!unsign)
|
||||||
{
|
{
|
||||||
int maxval = (1 << ((8 * size) - 1)) - 1;
|
int maxval = (1u << ((8 * size) - 1)) - 1; // compute as unsigned to prevent overflow before -1
|
||||||
int minval = -maxval - 1;
|
int minval = -maxval - 1;
|
||||||
Symbols.AddSymbol(new PSymbolConstNumeric(NAME_Min, this, minval));
|
Symbols.AddSymbol(new PSymbolConstNumeric(NAME_Min, this, minval));
|
||||||
Symbols.AddSymbol(new PSymbolConstNumeric(NAME_Max, this, maxval));
|
Symbols.AddSymbol(new PSymbolConstNumeric(NAME_Max, this, maxval));
|
||||||
|
@ -509,7 +509,7 @@ PInt::PInt(unsigned int size, bool unsign, bool compatible)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Symbols.AddSymbol(new PSymbolConstNumeric(NAME_Min, this, 0u));
|
Symbols.AddSymbol(new PSymbolConstNumeric(NAME_Min, this, 0u));
|
||||||
Symbols.AddSymbol(new PSymbolConstNumeric(NAME_Max, this, (1u << (8 * size)) - 1));
|
Symbols.AddSymbol(new PSymbolConstNumeric(NAME_Max, this, (1u << ((8 * size) - 1))));
|
||||||
}
|
}
|
||||||
SetOps();
|
SetOps();
|
||||||
}
|
}
|
||||||
|
@ -3219,16 +3219,24 @@ PClass *PClass::CreateDerivedClass(FName name, unsigned int size)
|
||||||
|
|
||||||
const PClass *existclass = FindClass(name);
|
const PClass *existclass = FindClass(name);
|
||||||
|
|
||||||
// This is a placeholder so fill it in
|
if (existclass != nullptr)
|
||||||
if (existclass != NULL && existclass->Size == (unsigned)-1)
|
|
||||||
{
|
{
|
||||||
type = const_cast<PClass*>(existclass);
|
// This is a placeholder so fill it in
|
||||||
if (!IsDescendantOf(type->ParentClass))
|
if (existclass->Size == TentativeClass)
|
||||||
{
|
{
|
||||||
I_Error("%s must inherit from %s but doesn't.", name.GetChars(), type->ParentClass->TypeName.GetChars());
|
type = const_cast<PClass*>(existclass);
|
||||||
|
if (!IsDescendantOf(type->ParentClass))
|
||||||
|
{
|
||||||
|
I_Error("%s must inherit from %s but doesn't.", name.GetChars(), type->ParentClass->TypeName.GetChars());
|
||||||
|
}
|
||||||
|
DPrintf(DMSG_SPAMMY, "Defining placeholder class %s\n", name.GetChars());
|
||||||
|
notnew = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// a different class with the same name already exists. Let the calling code deal with this.
|
||||||
|
return nullptr;
|
||||||
}
|
}
|
||||||
DPrintf(DMSG_SPAMMY, "Defining placeholder class %s\n", name.GetChars());
|
|
||||||
notnew = true;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -64,7 +64,7 @@ typedef enum
|
||||||
// The current state of the game: whether we are
|
// The current state of the game: whether we are
|
||||||
// playing, gazing at the intermission screen,
|
// playing, gazing at the intermission screen,
|
||||||
// the game final animation, or a demo.
|
// the game final animation, or a demo.
|
||||||
typedef enum
|
enum gamestate_t : int
|
||||||
{
|
{
|
||||||
GS_LEVEL,
|
GS_LEVEL,
|
||||||
GS_INTERMISSION,
|
GS_INTERMISSION,
|
||||||
|
@ -79,7 +79,7 @@ typedef enum
|
||||||
GS_FORCEWIPEFADE = -2,
|
GS_FORCEWIPEFADE = -2,
|
||||||
GS_FORCEWIPEBURN = -3,
|
GS_FORCEWIPEBURN = -3,
|
||||||
GS_FORCEWIPEMELT = -4
|
GS_FORCEWIPEMELT = -4
|
||||||
} gamestate_t;
|
};
|
||||||
|
|
||||||
extern gamestate_t gamestate;
|
extern gamestate_t gamestate;
|
||||||
|
|
||||||
|
|
|
@ -241,6 +241,7 @@ FString BackupSaveName;
|
||||||
|
|
||||||
bool SendLand;
|
bool SendLand;
|
||||||
const AInventory *SendItemUse, *SendItemDrop;
|
const AInventory *SendItemUse, *SendItemDrop;
|
||||||
|
int SendItemDropAmount;
|
||||||
|
|
||||||
EXTERN_CVAR (Int, team)
|
EXTERN_CVAR (Int, team)
|
||||||
|
|
||||||
|
@ -457,12 +458,14 @@ CCMD (invdrop)
|
||||||
if (players[consoleplayer].mo)
|
if (players[consoleplayer].mo)
|
||||||
{
|
{
|
||||||
SendItemDrop = players[consoleplayer].mo->InvSel;
|
SendItemDrop = players[consoleplayer].mo->InvSel;
|
||||||
|
SendItemDropAmount = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CCMD (weapdrop)
|
CCMD (weapdrop)
|
||||||
{
|
{
|
||||||
SendItemDrop = players[consoleplayer].ReadyWeapon;
|
SendItemDrop = players[consoleplayer].ReadyWeapon;
|
||||||
|
SendItemDropAmount = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
CCMD (drop)
|
CCMD (drop)
|
||||||
|
@ -470,6 +473,7 @@ CCMD (drop)
|
||||||
if (argv.argc() > 1 && who != NULL)
|
if (argv.argc() > 1 && who != NULL)
|
||||||
{
|
{
|
||||||
SendItemDrop = who->FindInventory(argv[1]);
|
SendItemDrop = who->FindInventory(argv[1]);
|
||||||
|
SendItemDropAmount = argv.argc() > 2 ? atoi(argv[2]) : -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -762,6 +766,7 @@ void G_BuildTiccmd (ticcmd_t *cmd)
|
||||||
{
|
{
|
||||||
Net_WriteByte (DEM_INVDROP);
|
Net_WriteByte (DEM_INVDROP);
|
||||||
Net_WriteLong (SendItemDrop->InventoryID);
|
Net_WriteLong (SendItemDrop->InventoryID);
|
||||||
|
Net_WriteLong(SendItemDropAmount);
|
||||||
SendItemDrop = NULL;
|
SendItemDrop = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -94,6 +94,7 @@ extern AActor *bodyque[BODYQUESIZE];
|
||||||
extern int bodyqueslot;
|
extern int bodyqueslot;
|
||||||
class AInventory;
|
class AInventory;
|
||||||
extern const AInventory *SendItemUse, *SendItemDrop;
|
extern const AInventory *SendItemUse, *SendItemDrop;
|
||||||
|
extern int SendItemDropAmount;
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -776,7 +776,7 @@ void G_DoCompleted (void)
|
||||||
AM_Stop ();
|
AM_Stop ();
|
||||||
|
|
||||||
wminfo.finished_ep = level.cluster - 1;
|
wminfo.finished_ep = level.cluster - 1;
|
||||||
wminfo.LName0 = TexMan[TexMan.CheckForTexture(level.info->PName, FTexture::TEX_MiscPatch)];
|
wminfo.LName0 = TexMan.CheckForTexture(level.info->PName, FTexture::TEX_MiscPatch);
|
||||||
wminfo.current = level.MapName;
|
wminfo.current = level.MapName;
|
||||||
|
|
||||||
if (deathmatch &&
|
if (deathmatch &&
|
||||||
|
@ -792,12 +792,12 @@ void G_DoCompleted (void)
|
||||||
if (nextinfo == NULL || strncmp (nextlevel, "enDSeQ", 6) == 0)
|
if (nextinfo == NULL || strncmp (nextlevel, "enDSeQ", 6) == 0)
|
||||||
{
|
{
|
||||||
wminfo.next = nextlevel;
|
wminfo.next = nextlevel;
|
||||||
wminfo.LName1 = NULL;
|
wminfo.LName1.SetInvalid();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wminfo.next = nextinfo->MapName;
|
wminfo.next = nextinfo->MapName;
|
||||||
wminfo.LName1 = TexMan[TexMan.CheckForTexture(nextinfo->PName, FTexture::TEX_MiscPatch)];
|
wminfo.LName1 = TexMan.CheckForTexture(nextinfo->PName, FTexture::TEX_MiscPatch);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -411,6 +411,11 @@ void M_SetMenu(FName menu, int param)
|
||||||
C_DoCommand("menu_quit");
|
C_DoCommand("menu_quit");
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
case NAME_EndGameMenu:
|
||||||
|
// The separate menu class no longer exists but the name still needs support for existing mods.
|
||||||
|
void ActivateEndGameMenu();
|
||||||
|
ActivateEndGameMenu();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// End of special checks
|
// End of special checks
|
||||||
|
|
|
@ -125,17 +125,8 @@ CCMD (menu_quit)
|
||||||
//
|
//
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
||||||
CCMD (menu_endgame)
|
void ActivateEndGameMenu()
|
||||||
{ // F7
|
{
|
||||||
if (!usergame)
|
|
||||||
{
|
|
||||||
S_Sound (CHAN_VOICE | CHAN_UI, "menu/invalid", snd_menuvolume, ATTN_NONE);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//M_StartControlPanel (true);
|
|
||||||
S_Sound (CHAN_VOICE | CHAN_UI, "menu/activate", snd_menuvolume, ATTN_NONE);
|
|
||||||
|
|
||||||
FString tempstring = GStrings(netgame ? "NETEND" : "ENDGAME");
|
FString tempstring = GStrings(netgame ? "NETEND" : "ENDGAME");
|
||||||
DMenu *newmenu = CreateMessageBoxMenu(CurrentMenu, tempstring, 0, false, NAME_None, []()
|
DMenu *newmenu = CreateMessageBoxMenu(CurrentMenu, tempstring, 0, false, NAME_None, []()
|
||||||
{
|
{
|
||||||
|
@ -149,6 +140,20 @@ CCMD (menu_endgame)
|
||||||
M_ActivateMenu(newmenu);
|
M_ActivateMenu(newmenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CCMD (menu_endgame)
|
||||||
|
{ // F7
|
||||||
|
if (!usergame)
|
||||||
|
{
|
||||||
|
S_Sound (CHAN_VOICE | CHAN_UI, "menu/invalid", snd_menuvolume, ATTN_NONE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//M_StartControlPanel (true);
|
||||||
|
S_Sound (CHAN_VOICE | CHAN_UI, "menu/activate", snd_menuvolume, ATTN_NONE);
|
||||||
|
|
||||||
|
ActivateEndGameMenu();
|
||||||
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
|
|
@ -671,6 +671,7 @@ xx(Optionsmenu)
|
||||||
xx(Quitmenu)
|
xx(Quitmenu)
|
||||||
xx(Savemenu)
|
xx(Savemenu)
|
||||||
xx(Playermenu)
|
xx(Playermenu)
|
||||||
|
xx(EndGameMenu)
|
||||||
|
|
||||||
xx(Playerbox)
|
xx(Playerbox)
|
||||||
xx(Team)
|
xx(Team)
|
||||||
|
|
|
@ -3663,13 +3663,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_DropInventory)
|
||||||
{
|
{
|
||||||
PARAM_SELF_PROLOGUE(AActor);
|
PARAM_SELF_PROLOGUE(AActor);
|
||||||
PARAM_CLASS(drop, AInventory);
|
PARAM_CLASS(drop, AInventory);
|
||||||
|
PARAM_INT_DEF(amount);
|
||||||
|
|
||||||
if (drop)
|
if (drop)
|
||||||
{
|
{
|
||||||
AInventory *inv = self->FindInventory(drop);
|
AInventory *inv = self->FindInventory(drop);
|
||||||
if (inv)
|
if (inv)
|
||||||
{
|
{
|
||||||
self->DropInventory(inv);
|
self->DropInventory(inv, amount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -1035,14 +1035,14 @@ DEFINE_ACTION_FUNCTION(AActor, UseInventory)
|
||||||
//
|
//
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
||||||
AInventory *AActor::DropInventory (AInventory *item)
|
AInventory *AActor::DropInventory (AInventory *item, int amt)
|
||||||
{
|
{
|
||||||
AInventory *drop = nullptr;
|
AInventory *drop = nullptr;
|
||||||
IFVIRTUALPTR(item, AInventory, CreateTossable)
|
IFVIRTUALPTR(item, AInventory, CreateTossable)
|
||||||
{
|
{
|
||||||
VMValue params[1] = { (DObject*)item };
|
VMValue params[] = { (DObject*)item, amt };
|
||||||
VMReturn ret((void**)&drop);
|
VMReturn ret((void**)&drop);
|
||||||
GlobalVMStack.Call(func, params, 1, &ret, 1, nullptr);
|
GlobalVMStack.Call(func, params, countof(params), &ret, 1, nullptr);
|
||||||
}
|
}
|
||||||
if (drop == nullptr) return NULL;
|
if (drop == nullptr) return NULL;
|
||||||
drop->SetOrigin(PosPlusZ(10.), false);
|
drop->SetOrigin(PosPlusZ(10.), false);
|
||||||
|
@ -1059,7 +1059,8 @@ DEFINE_ACTION_FUNCTION(AActor, DropInventory)
|
||||||
{
|
{
|
||||||
PARAM_SELF_PROLOGUE(AActor);
|
PARAM_SELF_PROLOGUE(AActor);
|
||||||
PARAM_OBJECT_NOT_NULL(item, AInventory);
|
PARAM_OBJECT_NOT_NULL(item, AInventory);
|
||||||
ACTION_RETURN_OBJECT(self->DropInventory(item));
|
PARAM_INT_DEF(amt);
|
||||||
|
ACTION_RETURN_OBJECT(self->DropInventory(item, amt));
|
||||||
}
|
}
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
|
@ -851,7 +851,10 @@ void InitThingdef()
|
||||||
fieldptr = new PField("playeringame", parray, VARF_Native | VARF_Static | VARF_ReadOnly, (intptr_t)&playeringame);
|
fieldptr = new PField("playeringame", parray, VARF_Native | VARF_Static | VARF_ReadOnly, (intptr_t)&playeringame);
|
||||||
Namespaces.GlobalNamespace->Symbols.AddSymbol(fieldptr);
|
Namespaces.GlobalNamespace->Symbols.AddSymbol(fieldptr);
|
||||||
|
|
||||||
fieldptr = new PField("gameaction", TypeUInt8, VARF_Native | VARF_Static, (intptr_t)&gameaction);
|
fieldptr = new PField("gameaction", TypeUInt32, VARF_Native | VARF_Static, (intptr_t)&gameaction);
|
||||||
|
Namespaces.GlobalNamespace->Symbols.AddSymbol(fieldptr);
|
||||||
|
|
||||||
|
fieldptr = new PField("gamestate", TypeSInt32, VARF_Native | VARF_Static | VARF_ReadOnly, (intptr_t)&gamestate);
|
||||||
Namespaces.GlobalNamespace->Symbols.AddSymbol(fieldptr);
|
Namespaces.GlobalNamespace->Symbols.AddSymbol(fieldptr);
|
||||||
|
|
||||||
fieldptr = new PField("skyflatnum", TypeTextureID, VARF_Native | VARF_Static | VARF_ReadOnly, (intptr_t)&skyflatnum);
|
fieldptr = new PField("skyflatnum", TypeTextureID, VARF_Native | VARF_Static | VARF_ReadOnly, (intptr_t)&skyflatnum);
|
||||||
|
|
|
@ -836,7 +836,7 @@ public:
|
||||||
{
|
{
|
||||||
int y = WI_TITLEY * CleanYfac;
|
int y = WI_TITLEY * CleanYfac;
|
||||||
|
|
||||||
y = WI_DrawName(y, wbs->LName0, lnametexts[0]);
|
y = WI_DrawName(y, TexMan(wbs->LName0), lnametexts[0]);
|
||||||
|
|
||||||
// Adjustment for different font sizes for map name and 'finished'.
|
// Adjustment for different font sizes for map name and 'finished'.
|
||||||
y -= ((mapname.mFont->GetHeight() - finished.mFont->GetHeight()) * CleanYfac) / 4;
|
y -= ((mapname.mFont->GetHeight() - finished.mFont->GetHeight()) * CleanYfac) / 4;
|
||||||
|
@ -866,7 +866,7 @@ public:
|
||||||
|
|
||||||
y = WI_DrawPatchText(y, &entering, "WI_ENTERING");
|
y = WI_DrawPatchText(y, &entering, "WI_ENTERING");
|
||||||
y += entering.mFont->GetHeight() * CleanYfac / 4;
|
y += entering.mFont->GetHeight() * CleanYfac / 4;
|
||||||
WI_DrawName(y, wbs->LName1, lnametexts[1]);
|
WI_DrawName(y, TexMan(wbs->LName1), lnametexts[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -51,8 +51,8 @@ struct wbstartstruct_t
|
||||||
FString current; // [RH] Name of map just finished
|
FString current; // [RH] Name of map just finished
|
||||||
FString next; // next level, [RH] actual map name
|
FString next; // next level, [RH] actual map name
|
||||||
|
|
||||||
FTexture *LName0;
|
FTextureID LName0;
|
||||||
FTexture *LName1;
|
FTextureID LName1;
|
||||||
|
|
||||||
int maxkills;
|
int maxkills;
|
||||||
int maxitems;
|
int maxitems;
|
||||||
|
|
|
@ -496,7 +496,7 @@ class Actor : Thinker native
|
||||||
native bool TakeInventory(class<Inventory> itemclass, int amount, bool fromdecorate = false, bool notakeinfinite = false);
|
native bool TakeInventory(class<Inventory> itemclass, int amount, bool fromdecorate = false, bool notakeinfinite = false);
|
||||||
native Inventory FindInventory(class<Inventory> itemtype, bool subclass = false);
|
native Inventory FindInventory(class<Inventory> itemtype, bool subclass = false);
|
||||||
native Inventory GiveInventoryType(class<Inventory> itemtype);
|
native Inventory GiveInventoryType(class<Inventory> itemtype);
|
||||||
native Inventory DropInventory (Inventory item);
|
native Inventory DropInventory (Inventory item, int amt = -1);
|
||||||
native bool UseInventory(Inventory item);
|
native bool UseInventory(Inventory item);
|
||||||
native void ObtainInventory(Actor other);
|
native void ObtainInventory(Actor other);
|
||||||
native bool GiveAmmo (Class<Ammo> type, int amount);
|
native bool GiveAmmo (Class<Ammo> type, int amount);
|
||||||
|
@ -788,7 +788,7 @@ class Actor : Thinker native
|
||||||
native void A_SpawnDebris(class<Actor> spawntype, bool transfer_translation = false, double mult_h = 1, double mult_v = 1);
|
native void A_SpawnDebris(class<Actor> spawntype, bool transfer_translation = false, double mult_h = 1, double mult_v = 1);
|
||||||
native void A_SpawnParticle(color color1, int flags = 0, int lifetime = 35, double size = 1, double angle = 0, double xoff = 0, double yoff = 0, double zoff = 0, double velx = 0, double vely = 0, double velz = 0, double accelx = 0, double accely = 0, double accelz = 0, double startalphaf = 1, double fadestepf = -1, double sizestep = 0);
|
native void A_SpawnParticle(color color1, int flags = 0, int lifetime = 35, double size = 1, double angle = 0, double xoff = 0, double yoff = 0, double zoff = 0, double velx = 0, double vely = 0, double velz = 0, double accelx = 0, double accely = 0, double accelz = 0, double startalphaf = 1, double fadestepf = -1, double sizestep = 0);
|
||||||
native void A_ExtChase(bool usemelee, bool usemissile, bool playactive = true, bool nightmarefast = false);
|
native void A_ExtChase(bool usemelee, bool usemissile, bool playactive = true, bool nightmarefast = false);
|
||||||
native void A_DropInventory(class<Inventory> itemtype);
|
native void A_DropInventory(class<Inventory> itemtype, int amount);
|
||||||
native void A_SetBlend(color color1, double alpha, int tics, color color2 = 0);
|
native void A_SetBlend(color color1, double alpha, int tics, color color2 = 0);
|
||||||
deprecated native void A_ChangeFlag(string flagname, bool value);
|
deprecated native void A_ChangeFlag(string flagname, bool value);
|
||||||
native void A_ChangeCountFlags(int kill = FLAG_NO_CHANGE, int item = FLAG_NO_CHANGE, int secret = FLAG_NO_CHANGE);
|
native void A_ChangeCountFlags(int kill = FLAG_NO_CHANGE, int item = FLAG_NO_CHANGE, int secret = FLAG_NO_CHANGE);
|
||||||
|
|
|
@ -1033,6 +1033,18 @@ enum PaletteFlashFlags
|
||||||
PF_HAZARD = 8,
|
PF_HAZARD = 8,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum EGameState
|
||||||
|
{
|
||||||
|
GS_LEVEL,
|
||||||
|
GS_INTERMISSION,
|
||||||
|
GS_FINALE,
|
||||||
|
GS_DEMOSCREEN,
|
||||||
|
GS_FULLCONSOLE,
|
||||||
|
GS_HIDECONSOLE,
|
||||||
|
GS_STARTUP,
|
||||||
|
GS_TITLELEVEL,
|
||||||
|
}
|
||||||
|
|
||||||
enum EGameAction
|
enum EGameAction
|
||||||
{
|
{
|
||||||
ga_nothing,
|
ga_nothing,
|
||||||
|
|
|
@ -173,9 +173,9 @@ class Ammo : Inventory
|
||||||
//
|
//
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
||||||
override Inventory CreateTossable()
|
override Inventory CreateTossable(int amt)
|
||||||
{
|
{
|
||||||
Inventory copy = Super.CreateTossable();
|
Inventory copy = Super.CreateTossable(amt);
|
||||||
if (copy != null)
|
if (copy != null)
|
||||||
{ // Do not increase ammo by dropping it and picking it back up at
|
{ // Do not increase ammo by dropping it and picking it back up at
|
||||||
// certain skill levels.
|
// certain skill levels.
|
||||||
|
@ -306,9 +306,9 @@ class BackpackItem : Inventory
|
||||||
//
|
//
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
||||||
override Inventory CreateTossable ()
|
override Inventory CreateTossable (int amount)
|
||||||
{
|
{
|
||||||
let pack = BackpackItem(Super.CreateTossable());
|
let pack = BackpackItem(Super.CreateTossable(-1));
|
||||||
if (pack != NULL)
|
if (pack != NULL)
|
||||||
{
|
{
|
||||||
pack.bDepleted = true;
|
pack.bDepleted = true;
|
||||||
|
|
|
@ -489,7 +489,7 @@ class HexenArmor : Armor
|
||||||
//
|
//
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
||||||
override Inventory CreateTossable ()
|
override Inventory CreateTossable (int amount)
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,9 +120,9 @@ class HealthPickup : Inventory
|
||||||
//
|
//
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
||||||
override Inventory CreateTossable ()
|
override Inventory CreateTossable (int amount)
|
||||||
{
|
{
|
||||||
Inventory copy = Super.CreateTossable ();
|
Inventory copy = Super.CreateTossable (-1);
|
||||||
if (copy != NULL)
|
if (copy != NULL)
|
||||||
{
|
{
|
||||||
copy.health = health;
|
copy.health = health;
|
||||||
|
|
|
@ -440,7 +440,7 @@ class Inventory : Actor native
|
||||||
//
|
//
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
||||||
virtual Inventory CreateTossable ()
|
virtual Inventory CreateTossable (int amt = -1)
|
||||||
{
|
{
|
||||||
// If self actor lacks a SpawnState, don't drop it. (e.g. A base weapon
|
// If self actor lacks a SpawnState, don't drop it. (e.g. A base weapon
|
||||||
// like the fist can't be dropped because you'll never see it.)
|
// like the fist can't be dropped because you'll never see it.)
|
||||||
|
@ -448,7 +448,7 @@ class Inventory : Actor native
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (bUndroppable || bUntossable || Owner == NULL || Amount <= 0)
|
if (bUndroppable || bUntossable || Owner == NULL || Amount <= 0 || amt == 0)
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -462,11 +462,13 @@ class Inventory : Actor native
|
||||||
let copy = Inventory(Spawn (GetClass(), Owner.Pos, NO_REPLACE));
|
let copy = Inventory(Spawn (GetClass(), Owner.Pos, NO_REPLACE));
|
||||||
if (copy != NULL)
|
if (copy != NULL)
|
||||||
{
|
{
|
||||||
|
amt = clamp(amt, 1, Amount);
|
||||||
|
|
||||||
copy.MaxAmount = MaxAmount;
|
copy.MaxAmount = MaxAmount;
|
||||||
copy.Amount = 1;
|
copy.Amount = amt;
|
||||||
copy.DropTime = 30;
|
copy.DropTime = 30;
|
||||||
copy.bSpecial = copy.bSolid = false;
|
copy.bSpecial = copy.bSolid = false;
|
||||||
Amount--;
|
Amount -= amt;
|
||||||
}
|
}
|
||||||
return copy;
|
return copy;
|
||||||
}
|
}
|
||||||
|
|
|
@ -174,7 +174,7 @@ class Powerup : Inventory
|
||||||
//
|
//
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
||||||
override Inventory CreateTossable ()
|
override Inventory CreateTossable (int amount)
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -435,7 +435,7 @@ class Weapon : StateProvider native
|
||||||
//
|
//
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
||||||
override Inventory CreateTossable ()
|
override Inventory CreateTossable (int amt)
|
||||||
{
|
{
|
||||||
// Only drop the weapon that is meant to be placed in a level. That is,
|
// Only drop the weapon that is meant to be placed in a level. That is,
|
||||||
// only drop the weapon that normally gives you ammo.
|
// only drop the weapon that normally gives you ammo.
|
||||||
|
@ -443,9 +443,9 @@ class Weapon : StateProvider native
|
||||||
Default.AmmoGive1 == 0 && Default.AmmoGive2 == 0 &&
|
Default.AmmoGive1 == 0 && Default.AmmoGive2 == 0 &&
|
||||||
(SisterWeapon.Default.AmmoGive1 > 0 || SisterWeapon.Default.AmmoGive2 > 0))
|
(SisterWeapon.Default.AmmoGive1 > 0 || SisterWeapon.Default.AmmoGive2 > 0))
|
||||||
{
|
{
|
||||||
return SisterWeapon.CreateTossable ();
|
return SisterWeapon.CreateTossable (amt);
|
||||||
}
|
}
|
||||||
let copy = Weapon(Super.CreateTossable ());
|
let copy = Weapon(Super.CreateTossable (-1));
|
||||||
|
|
||||||
if (copy != NULL)
|
if (copy != NULL)
|
||||||
{
|
{
|
||||||
|
|
|
@ -79,7 +79,7 @@ class Coin : Inventory
|
||||||
//
|
//
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
||||||
override Inventory CreateTossable ()
|
override Inventory CreateTossable (int amt)
|
||||||
{
|
{
|
||||||
Coin tossed;
|
Coin tossed;
|
||||||
|
|
||||||
|
@ -87,17 +87,20 @@ class Coin : Inventory
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (Amount >= 50)
|
if (amt == -1) amt = Amount >= 50? 50 : Amount >= 25? 25 : Amount >= 10? 10 : 1;
|
||||||
|
else if (amt > Amount) amt = Amount;
|
||||||
|
if (amt > 25)
|
||||||
{
|
{
|
||||||
Amount -= 50;
|
Amount -= amt;
|
||||||
tossed = Coin(Spawn("Gold50"));
|
tossed = Coin(Spawn("Gold50"));
|
||||||
|
tossed.Amount = amt;
|
||||||
}
|
}
|
||||||
else if (Amount >= 25)
|
else if (amt > 10)
|
||||||
{
|
{
|
||||||
Amount -= 25;
|
Amount -= 25;
|
||||||
tossed = Coin(Spawn("Gold25"));
|
tossed = Coin(Spawn("Gold25"));
|
||||||
}
|
}
|
||||||
else if (Amount >= 10)
|
else if (amt > 1)
|
||||||
{
|
{
|
||||||
Amount -= 10;
|
Amount -= 10;
|
||||||
tossed = Coin(Spawn("Gold10"));
|
tossed = Coin(Spawn("Gold10"));
|
||||||
|
|
Loading…
Reference in a new issue