This commit is contained in:
nashmuhandes 2017-02-26 19:31:46 +08:00
commit fd056f26fd
26 changed files with 428 additions and 328 deletions

View file

@ -389,6 +389,7 @@ enum ActorFlag7
MF7_SMASHABLE = 0x04000000, // dies if hitting the floor.
MF7_NOSHIELDREFLECT = 0x08000000, // will not be reflected by shields.
MF7_FORCEZERORADIUSDMG = 0x10000000, // passes zero radius damage on to P_DamageMobj, this is necessary in some cases where DoSpecialDamage gets overrideen.
MF7_NOINFIGHTSPECIES = 0x20000000, // don't start infights with one's own species.
};
// --- mobj.renderflags ---

View file

@ -880,7 +880,7 @@ CCMD(linetarget)
if (CheckCheatmode () || players[consoleplayer].mo == NULL) return;
C_AimLine(&t, false);
if (t.linetarget)
C_PrintInfo(t.linetarget);
C_PrintInfo(t.linetarget, argv.argc() > 1 && atoi(argv[1]) != 0);
else
Printf("No target found\n");
}
@ -893,7 +893,7 @@ CCMD(info)
if (CheckCheatmode () || players[consoleplayer].mo == NULL) return;
C_AimLine(&t, true);
if (t.linetarget)
C_PrintInfo(t.linetarget);
C_PrintInfo(t.linetarget, !(argv.argc() > 1 && atoi(argv[1]) == 0));
else
Printf("No target found. Info cannot find actors that have "
"the NOBLOCKMAP flag or have height/radius of 0.\n");
@ -902,7 +902,7 @@ CCMD(info)
CCMD(myinfo)
{
if (CheckCheatmode () || players[consoleplayer].mo == NULL) return;
C_PrintInfo(players[consoleplayer].mo);
C_PrintInfo(players[consoleplayer].mo, true);
}
typedef bool (*ActorTypeChecker) (AActor *);

View file

@ -39,7 +39,7 @@
#include "c_functions.h"
void C_PrintInfo(AActor *target)
void C_PrintInfo(AActor *target, bool verbose)
{
if (target->player)
Printf("Player=%s, ", target->player->userinfo.GetName());
@ -47,7 +47,7 @@ void C_PrintInfo(AActor *target)
target->GetClass()->TypeName.GetChars(),
target->health,
target->SpawnHealth());
PrintMiscActorInfo(target);
if (verbose) PrintMiscActorInfo(target);
}
void C_AimLine(FTranslatedLineTarget *t, bool nonshootable)

View file

@ -34,6 +34,6 @@
void C_PrintInv(AActor *target);
void C_AimLine(FTranslatedLineTarget *t, bool nonshootable);
void C_PrintInfo(AActor *target);
void C_PrintInfo(AActor *target, bool verbose);
struct FTranslatedLineTarget;

View file

@ -811,6 +811,10 @@ void D_Display ()
{
StatusBar->DrawBottomStuff (HUD_AltHud);
if (DrawFSHUD || automapactive) DrawHUD();
if (players[consoleplayer].camera && players[consoleplayer].camera->player)
{
StatusBar->DrawCrosshair();
}
StatusBar->Draw (HUD_AltHud);
StatusBar->DrawTopStuff (HUD_AltHud);
}

View file

@ -449,7 +449,13 @@ DEFINE_EVENT_LOOPER(WorldLightning)
DEFINE_EVENT_LOOPER(WorldTick)
// declarations
IMPLEMENT_CLASS(DStaticEventHandler, false, false);
IMPLEMENT_CLASS(DStaticEventHandler, false, true);
IMPLEMENT_POINTERS_START(DStaticEventHandler)
IMPLEMENT_POINTER(next)
IMPLEMENT_POINTER(prev)
IMPLEMENT_POINTERS_END
IMPLEMENT_CLASS(DEventHandler, false, false);
IMPLEMENT_CLASS(DBaseEvent, false, false)
IMPLEMENT_CLASS(DRenderEvent, false, false)

View file

@ -76,7 +76,7 @@ void E_SerializeEvents(FSerializer& arc);
class DStaticEventHandler : public DObject // make it a part of normal GC process
{
DECLARE_CLASS(DStaticEventHandler, DObject)
DECLARE_CLASS(DStaticEventHandler, DObject);
HAS_OBJECT_POINTERS
public:
DStaticEventHandler()

View file

@ -348,6 +348,10 @@ CCMD (weapnext)
StatusBar->AttachMessage(new DHUDMessageFadeOut(SmallFont, SendItemUse->GetTag(),
1.5f, 0.90f, 0, 0, (EColorRange)*nametagcolor, 2.f, 0.35f), MAKE_ID( 'W', 'E', 'P', 'N' ));
}
if (SendItemUse != players[consoleplayer].ReadyWeapon)
{
S_Sound(CHAN_AUTO, "misc/weaponchange", 1.0, ATTN_NONE);
}
}
CCMD (weapprev)
@ -359,6 +363,10 @@ CCMD (weapprev)
StatusBar->AttachMessage(new DHUDMessageFadeOut(SmallFont, SendItemUse->GetTag(),
1.5f, 0.90f, 0, 0, (EColorRange)*nametagcolor, 2.f, 0.35f), MAKE_ID( 'W', 'E', 'P', 'N' ));
}
if (SendItemUse != players[consoleplayer].ReadyWeapon)
{
S_Sound(CHAN_AUTO, "misc/weaponchange", 1.0, ATTN_NONE);
}
}
CCMD (invnext)
@ -368,6 +376,7 @@ CCMD (invnext)
if (who == NULL)
return;
auto old = who->InvSel;
if (who->InvSel != NULL)
{
if ((next = who->InvSel->NextInv()) != NULL)
@ -391,6 +400,10 @@ CCMD (invnext)
1.5f, 0.80f, 0, 0, (EColorRange)*nametagcolor, 2.f, 0.35f), MAKE_ID('S','I','N','V'));
}
who->player->inventorytics = 5*TICRATE;
if (old != who->InvSel)
{
S_Sound(CHAN_AUTO, "misc/invchange", 1.0, ATTN_NONE);
}
}
CCMD (invprev)
@ -400,6 +413,7 @@ CCMD (invprev)
if (who == NULL)
return;
auto old = who->InvSel;
if (who->InvSel != NULL)
{
if ((item = who->InvSel->PrevInv()) != NULL)
@ -421,6 +435,10 @@ CCMD (invprev)
1.5f, 0.80f, 0, 0, (EColorRange)*nametagcolor, 2.f, 0.35f), MAKE_ID('S','I','N','V'));
}
who->player->inventorytics = 5*TICRATE;
if (old != who->InvSel)
{
S_Sound(CHAN_AUTO, "misc/invchange", 1.0, ATTN_NONE);
}
}
CCMD (invuseall)

View file

@ -1136,10 +1136,6 @@ void DrawHUD()
i=DrawAmmo(CPlayer, hudwidth-5, i);
if (hud_showweapons) DrawWeapons(CPlayer, hudwidth - 5, i);
DrawInventory(CPlayer, 144, hudheight-28);
if (CPlayer->camera && CPlayer->camera->player)
{
StatusBar->DrawCrosshair();
}
if (idmypos) DrawCoordinates(CPlayer);
DrawTime();

View file

@ -67,7 +67,8 @@ DMenu *CreateMessageBoxMenu(DMenu *parent, const char *message, int messagemode,
{
auto c = PClass::FindClass("MessageBoxMenu");
auto p = c->CreateNew();
VMValue params[] = { p, parent, FString(message), messagemode, playsound, action.GetIndex(), reinterpret_cast<void*>(handler) };
const FString msg = '$' == message[0] ? GStrings(message + 1) : message;
VMValue params[] = { p, parent, msg, messagemode, playsound, action.GetIndex(), reinterpret_cast<void*>(handler) };
auto f = dyn_cast<PFunction>(c->Symbols.FindSymbol("Init", false));
GlobalVMStack.Call(f->Variants[0].Implementation, params, countof(params), nullptr, 0);

View file

@ -654,6 +654,7 @@ xx(Goodbye)
xx(Require)
xx(Exclude)
xx(Userstring)
xx(Sky)
// Special menus
xx(Mainmenu)

View file

@ -1715,6 +1715,9 @@ bool AActor::OkayToSwitchTarget (AActor *other)
}
}
if ((flags7 & MF7_NOINFIGHTSPECIES) && GetSpecies() == target->GetSpecies())
return false; // Don't fight own species.
if ((other->flags3 & MF3_NOTARGET) &&
(other->tid != TIDtoHate || TIDtoHate == 0) &&
!IsHostile (other))

View file

@ -112,7 +112,7 @@ void P_BloodSplatter (const DVector3 &pos, AActor *originator, DAngle hitangle);
void P_BloodSplatter2 (const DVector3 &pos, AActor *originator, DAngle hitangle);
void P_RipperBlood (AActor *mo, AActor *bleeder);
int P_GetThingFloorType (AActor *thing);
void P_ExplodeMissile (AActor *missile, line_t *explodeline, AActor *target);
void P_ExplodeMissile (AActor *missile, line_t *explodeline, AActor *target, bool onsky = false);
AActor *P_OldSpawnMissile(AActor *source, AActor *owner, AActor *dest, PClassActor *type);
AActor *P_SpawnMissile (AActor* source, AActor* dest, PClassActor *type, AActor* owner = NULL);

View file

@ -5277,20 +5277,22 @@ bool P_UseTraverse(AActor *usething, const DVector2 &start, const DVector2 &end,
// [RH] Check for things to talk with or use a puzzle item on
if (!in->isaline)
{
if (usething == in->d.thing)
AActor * const mobj = in->d.thing;
if (mobj == usething)
continue;
// Check thing
// Check for puzzle item use or USESPECIAL flag
// Extended to use the same activationtype mechanism as BUMPSPECIAL does
if (in->d.thing->flags5 & MF5_USESPECIAL || in->d.thing->special == UsePuzzleItem)
if (mobj->flags5 & MF5_USESPECIAL || mobj->special == UsePuzzleItem)
{
if (P_ActivateThingSpecial(in->d.thing, usething))
if (P_ActivateThingSpecial(mobj, usething))
return true;
}
IFVIRTUALPTR(usething, AActor, Used)
IFVIRTUALPTR(mobj, AActor, Used)
{
VMValue params[] = { usething, in->d.thing };
VMValue params[] = { mobj, usething };
int ret;
VMReturn vret(&ret);
GlobalVMStack.Call(func, params, 2, &vret, 1);

View file

@ -1805,7 +1805,7 @@ bool AActor::Massacre ()
//
//----------------------------------------------------------------------------
void P_ExplodeMissile (AActor *mo, line_t *line, AActor *target)
void P_ExplodeMissile (AActor *mo, line_t *line, AActor *target, bool onsky)
{
if (mo->flags3 & MF3_EXPLOCOUNT)
{
@ -1833,11 +1833,15 @@ void P_ExplodeMissile (AActor *mo, line_t *line, AActor *target)
}
if (nextstate == NULL) nextstate = mo->FindState(NAME_Death);
if (line != NULL && line->special == Line_Horizon && !(mo->flags3 & MF3_SKYEXPLODE))
if (onsky || (line != NULL && line->special == Line_Horizon))
{
// [RH] Don't explode missiles on horizon lines.
mo->Destroy ();
return;
if (!(mo->flags3 & MF3_SKYEXPLODE))
{
// [RH] Don't explode missiles on horizon lines.
mo->Destroy();
return;
}
nextstate = mo->FindState(NAME_Death, NAME_Sky);
}
if (line != NULL && cl_missiledecals)
@ -2558,26 +2562,32 @@ double P_XYMovement (AActor *mo, DVector2 scroll)
}
explode:
// explode a missile
if (!(mo->flags3 & MF3_SKYEXPLODE))
{
bool onsky = false;
if (tm.ceilingline &&
tm.ceilingline->backsector &&
tm.ceilingline->backsector->GetTexture(sector_t::ceiling) == skyflatnum &&
mo->Z() >= tm.ceilingline->backsector->ceilingplane.ZatPoint(mo->PosRelative(tm.ceilingline)))
{
// Hack to prevent missiles exploding against the sky.
// Does not handle sky floors.
mo->Destroy ();
return Oldfloorz;
if (!(mo->flags3 & MF3_SKYEXPLODE))
{
// Hack to prevent missiles exploding against the sky.
// Does not handle sky floors.
mo->Destroy();
return Oldfloorz;
}
else onsky = true;
}
// [RH] Don't explode on horizon lines.
if (mo->BlockingLine != NULL && mo->BlockingLine->special == Line_Horizon)
{
mo->Destroy ();
return Oldfloorz;
if (!(mo->flags3 & MF3_SKYEXPLODE))
{
mo->Destroy();
return Oldfloorz;
}
else onsky = true;
}
}
P_ExplodeMissile (mo, mo->BlockingLine, BlockingMobj);
P_ExplodeMissile (mo, mo->BlockingLine, BlockingMobj, onsky);
return Oldfloorz;
}
else
@ -2956,15 +2966,20 @@ void P_ZMovement (AActor *mo, double oldfloorz)
}
else
{
if (mo->floorpic == skyflatnum && !(mo->flags3 & MF3_SKYEXPLODE))
bool onsky = false;
if (mo->floorpic == skyflatnum)
{
// [RH] Just remove the missile without exploding it
// if this is a sky floor.
mo->Destroy ();
return;
if (!(mo->flags3 & MF3_SKYEXPLODE))
{
// [RH] Just remove the missile without exploding it
// if this is a sky floor.
mo->Destroy();
return;
}
else onsky = true;
}
P_HitFloor (mo);
P_ExplodeMissile (mo, NULL, NULL);
P_ExplodeMissile (mo, NULL, NULL, onsky);
return;
}
}
@ -3057,12 +3072,17 @@ void P_ZMovement (AActor *mo, double oldfloorz)
{
return;
}
if (mo->ceilingpic == skyflatnum && !(mo->flags3 & MF3_SKYEXPLODE))
bool onsky = false;
if (mo->ceilingpic == skyflatnum)
{
mo->Destroy ();
return;
if (!(mo->flags3 & MF3_SKYEXPLODE))
{
mo->Destroy();
return;
}
else onsky = true;
}
P_ExplodeMissile (mo, NULL, NULL);
P_ExplodeMissile (mo, NULL, NULL, onsky);
return;
}
}

View file

@ -467,7 +467,8 @@ static void DoSectorDamage(AActor *actor, sector_t *sec, int amount, FName type,
return;
}
P_DamageMobj (actor, NULL, NULL, amount, type);
int dflags = (flags & DAMAGE_NO_ARMOR) ? DMG_NO_ARMOR : 0;
P_DamageMobj (actor, NULL, NULL, amount, type, dflags);
}
void P_SectorDamage(int tag, int amount, FName type, PClassActor *protectClass, int flags)

View file

@ -77,6 +77,7 @@ const double CARRYFACTOR = 3 / 32.;
#define DAMAGE_NONPLAYERS 2
#define DAMAGE_IN_AIR 4
#define DAMAGE_SUBCLASSES_PROTECT 8
#define DAMAGE_NO_ARMOR 16
// [RH] If a deathmatch game, checks to see if noexit is enabled.

View file

@ -317,6 +317,7 @@ static FFlagDef ActorFlagDefs[]=
DEFINE_FLAG(MF7, SMASHABLE, AActor, flags7),
DEFINE_FLAG(MF7, NOSHIELDREFLECT, AActor, flags7),
DEFINE_FLAG(MF7, FORCEZERORADIUSDMG, AActor, flags7),
DEFINE_FLAG(MF7, NOINFIGHTSPECIES, AActor, flags7),
// Effect flags
DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects),
@ -916,7 +917,7 @@ void InitThingdef()
fieldptr = new PField("gametic", TypeSInt32, VARF_Native | VARF_Static | VARF_ReadOnly, (intptr_t)&gametic);
Namespaces.GlobalNamespace->Symbols.AddSymbol(fieldptr);
fieldptr = new PField("demoplayback", TypeSInt32, VARF_Native | VARF_Static | VARF_ReadOnly, (intptr_t)&demoplayback);
fieldptr = new PField("demoplayback", TypeBool, VARF_Native | VARF_Static | VARF_ReadOnly, (intptr_t)&demoplayback);
Namespaces.GlobalNamespace->Symbols.AddSymbol(fieldptr);
fieldptr = new PField("BackbuttonTime", TypeSInt32, VARF_Native | VARF_Static, (intptr_t)&BackbuttonTime);

View file

@ -567,7 +567,7 @@ bool DCanvas::ParseDrawTextureTags(FTexture *img, double x, double y, DWORD tag,
parms->colorOverlay = 0;
parms->alphaChannel = false;
parms->flipX = false;
parms->shadowAlpha = 0;
//parms->shadowAlpha = 0;
parms->shadowColor = 0;
parms->virtWidth = this->GetWidth();
parms->virtHeight = this->GetHeight();
@ -840,7 +840,7 @@ bool DCanvas::ParseDrawTextureTags(FTexture *img, double x, double y, DWORD tag,
break;
case DTA_ShadowAlpha:
parms->shadowAlpha = (float)MIN(1., ListGetDouble(tags));
//parms->shadowAlpha = (float)MIN(1., ListGetDouble(tags));
break;
case DTA_ShadowColor:
@ -851,12 +851,12 @@ bool DCanvas::ParseDrawTextureTags(FTexture *img, double x, double y, DWORD tag,
boolval = ListGetInt(tags);
if (boolval)
{
parms->shadowAlpha = 0.5;
//parms->shadowAlpha = 0.5;
parms->shadowColor = 0;
}
else
{
parms->shadowAlpha = 0;
//parms->shadowAlpha = 0;
}
break;

View file

@ -162,7 +162,7 @@ struct DrawParms
uint32 colorOverlay;
INTBOOL alphaChannel;
INTBOOL flipX;
float shadowAlpha;
//float shadowAlpha;
int shadowColor;
INTBOOL keepratio;
INTBOOL masked;

View file

@ -60,6 +60,14 @@ CVAR(Bool, wi_showtotaltime, true, CVAR_ARCHIVE)
CVAR(Bool, wi_noautostartmap, false, CVAR_USERINFO | CVAR_ARCHIVE)
CVAR(Int, wi_autoadvance, 0, CVAR_SERVERINFO)
// States for the intermission
enum EState
{
NoState = -1,
StatCount,
ShowNextLoc,
LeavingIntermission
};
static const char *WI_Cmd[] = {
"Background",
@ -84,67 +92,8 @@ static const char *WI_Cmd[] = {
NULL
};
struct FPatchInfo
struct FInterBackground
{
FFont *mFont;
FTexture *mPatch;
EColorRange mColor;
void Init(FGIFont &gifont)
{
if (gifont.color == NAME_Null)
{
mPatch = TexMan[gifont.fontname]; // "entering"
mColor = mPatch == NULL ? CR_UNTRANSLATED : CR_UNDEFINED;
mFont = NULL;
}
else
{
mFont = V_GetFont(gifont.fontname);
mColor = V_FindFontColor(gifont.color);
mPatch = NULL;
}
if (mFont == NULL)
{
mFont = BigFont;
}
}
};
class FIntermissionScreen
{
public:
// States for the intermission
enum EState
{
NoState = -1,
StatCount,
ShowNextLoc,
LeavingIntermission
};
enum EValues
{
// GLOBAL LOCATIONS
WI_TITLEY = 2,
// SINGPLE-PLAYER STUFF
SP_STATSX = 50,
SP_STATSY = 50,
SP_TIMEX = 8,
SP_TIMEY = (200 - 32),
// NET GAME STUFF
NG_STATSY = 50,
};
// These animation variables, structures, etc. are used for the
// DOOM/Ultimate DOOM intermission screen animations. This is
// totally different from any sprite or texture/flat animations
@ -168,18 +117,6 @@ public:
};
// States for single-player
enum ESPState
{
SP_KILLS = 0,
SP_ITEMS = 2,
SP_SECRET = 4,
SP_FRAGS = 6,
SP_TIME = 8,
};
static const int SHOWNEXTLOCDELAY = 4; // in seconds
struct yahpt_t
{
int x, y;
@ -189,16 +126,9 @@ public:
{
int x; // x/y coordinate pair structure
int y;
char level[9];
FString Level;
};
//
// Animation.
// There is another anim_t used in p_spec.
// (which is why I have renamed this one!)
//
struct in_anim_t
{
int type; // Made an int so I can use '|'
@ -207,7 +137,7 @@ public:
int data; // ALWAYS: n/a, RANDOM: period deviation (<256)
TArray<FTexture*> frames; // actual graphics for frames of animations
// following must be initialized to zero before use!
// following must be initialized to zero before use!
int nexttic; // next value of bcnt (used in conjunction with period)
int ctr; // next frame number to animate
int state; // used by RANDOM and LEVEL when animating
@ -224,71 +154,21 @@ public:
}
};
private:
TArray<lnode_t> lnodes;
TArray<in_anim_t> anims;
int acceleratestage; // used to accelerate or skip a stage
bool playerready[MAXPLAYERS];
int me; // wbs->pnum
EState state; // specifies current state
wbstartstruct_t *wbs; // contains information passed into intermission
wbplayerstruct_t* Plrs[MAXPLAYERS]; // wbs->plyr[]
int cnt; // used for general timing
int bcnt; // used for timing of background animation
int cnt_kills[MAXPLAYERS];
int cnt_items[MAXPLAYERS];
int cnt_secret[MAXPLAYERS];
int cnt_frags[MAXPLAYERS];
int cnt_deaths[MAXPLAYERS];
int cnt_time;
int cnt_total_time;
int cnt_par;
int cnt_pause;
int total_frags;
int total_deaths;
bool noautostartmap;
int dofrags;
int ng_state;
//
// GRAPHICS
//
FPatchInfo mapname;
FPatchInfo finished;
FPatchInfo entering;
int bcnt = 0; // used for timing of background animation
TArray<FTexture *> yah; // You Are Here graphic
FTexture* splat; // splat
FTexture* sp_secret; // "secret"
FTexture* kills; // "Kills", "Scrt", "Items", "Frags"
FTexture* secret;
FTexture* items;
FTexture* frags;
FTexture* timepic; // Time sucks.
FTexture* par;
FTexture* sucks;
FTexture* killers; // "killers", "victims"
FTexture* victims;
FTexture* total; // "Total", your face, your dead face
FTexture* p; // Player graphic
FTexture* lnames[2]; // Name graphics of each level (centered)
// [RH] Info to dynamically generate the level name graphics
FString lnametexts[2];
FTexture *background;
bool snl_pointeron = false;
int player_deaths[MAXPLAYERS];
int sp_state;
//
// CODE
//
FTexture* splat = nullptr; // splat
FTexture *background = nullptr;
wbstartstruct_t *wbs;
public:
FInterBackground(wbstartstruct_t *wbst)
{
wbs = wbst;
};
//====================================================================
//
// Loads the background - either from a single texture
@ -298,22 +178,23 @@ public:
// MAPINFO.
//
//====================================================================
static bool IsExMy(const char * name)
bool IsExMy(const char * name)
{
// Only check for the first 3 episodes. They are the only ones with default intermission scripts.
// Level names can be upper- and lower case so use tolower to check!
return (tolower(name[0])=='e' && name[1]>='1' && name[1]<='3' && tolower(name[2])=='m');
return (tolower(name[0]) == 'e' && name[1] >= '1' && name[1] <= '3' && tolower(name[2]) == 'm');
}
void WI_LoadBackground(bool isenterpic)
bool LoadBackground(bool isenterpic)
{
const char *lumpname = NULL;
char buffer[10];
in_anim_t an;
lnode_t pt;
FTextureID texture;
bool noautostartmap = false;
bcnt=0;
bcnt = 0;
texture.SetInvalid();
if (isenterpic)
@ -327,10 +208,10 @@ public:
}
// Try to get a default if nothing specified
if (lumpname == NULL || lumpname[0]==0)
if (lumpname == NULL || lumpname[0] == 0)
{
lumpname = NULL;
switch(gameinfo.gametype)
switch (gameinfo.gametype)
{
case GAME_Chex:
case GAME_Doom:
@ -343,24 +224,24 @@ public:
lumpname = buffer;
}
}
if (!lumpname)
if (!lumpname)
{
if (isenterpic)
if (isenterpic)
{
// One special case needs to be handled here!
// If going from E1-E3 to E4 the default should be used, not the exit pic.
// Not if the exit pic is user defined!
if (level.info->ExitPic.IsNotEmpty()) return;
if (level.info->ExitPic.IsNotEmpty()) return false;
// E1-E3 need special treatment when playing Doom 1.
if (!(gameinfo.flags & GI_MAPxx))
{
// not if the last level is not from the first 3 episodes
if (!IsExMy(wbs->current)) return;
if (!IsExMy(wbs->current)) return false;
// not if the next level is one of the first 3 episodes
if (IsExMy(wbs->next)) return;
if (IsExMy(wbs->next)) return false;
}
}
lumpname = "INTERPIC";
@ -376,22 +257,22 @@ public:
lumpname = buffer;
}
}
if (!lumpname)
if (!lumpname)
{
if (isenterpic) return;
if (isenterpic) return false;
lumpname = "FLOOR16";
}
break;
case GAME_Hexen:
if (isenterpic) return;
if (isenterpic) return false;
lumpname = "INTERPIC";
break;
case GAME_Strife:
default:
// Strife doesn't have an intermission pic so choose something neutral.
if (isenterpic) return;
if (isenterpic) return false;
lumpname = gameinfo.BorderFlat;
break;
}
@ -400,7 +281,7 @@ public:
{
// shouldn't happen!
background = NULL;
return;
return false;
}
lnodes.Clear();
@ -409,21 +290,21 @@ public:
splat = NULL;
// a name with a starting '$' indicates an intermission script
if (*lumpname!='$')
if (*lumpname != '$')
{
texture = TexMan.CheckForTexture(lumpname, FTexture::TEX_MiscPatch, FTextureManager::TEXMAN_TryAny);
}
else
{
int lumpnum=Wads.CheckNumForFullName(lumpname+1, true);
if (lumpnum>=0)
int lumpnum = Wads.CheckNumForFullName(lumpname + 1, true);
if (lumpnum >= 0)
{
FScanner sc(lumpnum);
while (sc.GetString())
{
an.Reset();
int caseval = sc.MustMatchString(WI_Cmd);
switch(caseval)
switch (caseval)
{
case 0: // Background
sc.MustGetString();
@ -449,8 +330,7 @@ public:
while (!sc.CheckString("}"))
{
sc.MustGetString();
strncpy(pt.level, sc.String,8);
pt.level[8] = 0;
pt.Level = sc.String;
sc.MustGetNumber();
pt.x = sc.Number;
sc.MustGetNumber();
@ -478,7 +358,7 @@ public:
case 8: // IfLeaving
an.type = ANIM_IFLEAVING;
goto readanimation;
case 9: // IfNotLeaving
an.type = ANIM_IFNOTLEAVING;
goto readanimation;
@ -503,7 +383,7 @@ public:
sc.MustGetString();
an.LevelName = sc.String;
sc.MustGetString();
caseval=sc.MustMatchString(WI_Cmd);
caseval = sc.MustMatchString(WI_Cmd);
default:
switch (caseval)
@ -563,13 +443,14 @@ public:
}
}
}
else
else
{
Printf("Intermission script %s not found!\n", lumpname+1);
Printf("Intermission script %s not found!\n", lumpname + 1);
texture = TexMan.GetTexture("INTERPIC", FTexture::TEX_MiscPatch);
}
}
background=TexMan[texture];
background = TexMan[texture];
return noautostartmap;
}
//====================================================================
@ -579,11 +460,12 @@ public:
//
//====================================================================
void WI_updateAnimatedBack()
void updateAnimatedBack()
{
unsigned int i;
for(i=0;i<anims.Size();i++)
bcnt++;
for (i = 0; i<anims.Size(); i++)
{
in_anim_t * a = &anims[i];
switch (a->type & ANIM_TYPE)
@ -591,19 +473,19 @@ public:
case ANIM_ALWAYS:
if (bcnt >= a->nexttic)
{
if (++a->ctr >= (int)a->frames.Size())
if (++a->ctr >= (int)a->frames.Size())
{
if (a->data==0) a->ctr = 0;
if (a->data == 0) a->ctr = 0;
else a->ctr--;
}
a->nexttic = bcnt + a->period;
}
break;
case ANIM_PIC:
a->ctr = 0;
break;
}
}
}
@ -614,11 +496,11 @@ public:
//
//====================================================================
void WI_drawBackground()
void drawBackground(int state, bool drawsplat, bool snl_pointeron)
{
unsigned int i;
double animwidth=320; // For a flat fill or clear background scale animations to 320x200
double animheight=200;
double animwidth = 320; // For a flat fill or clear background scale animations to 320x200
double animheight = 200;
if (background)
{
@ -630,20 +512,20 @@ public:
// placing the animations precisely where they belong on the base pic
animwidth = background->GetScaledWidthDouble();
animheight = background->GetScaledHeightDouble();
screen->FillBorder (NULL);
screen->FillBorder(NULL);
screen->DrawTexture(background, 0, 0, DTA_Fullscreen, true, TAG_DONE);
}
else
else
{
screen->FlatFill(0, 0, SCREENWIDTH, SCREENHEIGHT, background);
}
}
else
else
{
screen->Clear(0,0, SCREENWIDTH, SCREENHEIGHT, 0, 0);
screen->Clear(0, 0, SCREENWIDTH, SCREENHEIGHT, 0, 0);
}
for(i=0;i<anims.Size();i++)
for (i = 0; i<anims.Size(); i++)
{
in_anim_t * a = &anims[i];
level_info_t * li;
@ -686,28 +568,216 @@ public:
break;
}
if (a->ctr >= 0)
screen->DrawTexture(a->frames[a->ctr], a->loc.x, a->loc.y,
DTA_VirtualWidthF, animwidth, DTA_VirtualHeightF, animheight, TAG_DONE);
screen->DrawTexture(a->frames[a->ctr], a->loc.x, a->loc.y,
DTA_VirtualWidthF, animwidth, DTA_VirtualHeightF, animheight, TAG_DONE);
}
if (drawsplat)
{
for (i = 0; i<lnodes.Size(); i++)
{
level_info_t * li = FindLevelInfo(lnodes[i].Level);
if (li && li->flags & LEVEL_VISITED) drawOnLnode(i, &splat, 1); // draw a splat on taken cities.
}
}
// draw flashing ptr
if (snl_pointeron && yah.Size())
{
unsigned int v = MapToIndex(wbs->next);
// Draw only if it points to a valid level on the current screen!
if (v<lnodes.Size()) drawOnLnode(v, &yah[0], yah.Size());
}
}
private:
//====================================================================
//
// Draws the splats and the 'You are here' arrows
//
//====================================================================
int MapToIndex(const char *map)
{
unsigned int i;
for (i = 0; i < lnodes.Size(); i++)
{
if (!lnodes[i].Level.CompareNoCase(map))
break;
}
return i;
}
//====================================================================
//
// Draws the splats and the 'You are here' arrows
//
//====================================================================
void drawOnLnode(int n, FTexture * c[], int numc)
{
int i;
for (i = 0; i<numc; i++)
{
int left;
int top;
int right;
int bottom;
right = c[i]->GetScaledWidth();
bottom = c[i]->GetScaledHeight();
left = lnodes[n].x - c[i]->GetScaledLeftOffset();
top = lnodes[n].y - c[i]->GetScaledTopOffset();
right += left;
bottom += top;
if (left >= 0 && right < 320 && top >= 0 && bottom < 200)
{
screen->DrawTexture(c[i], lnodes[n].x, lnodes[n].y, DTA_320x200, true, TAG_DONE);
break;
}
}
}
//====================================================================
//
// Draws a single character with a shadow
//
//====================================================================
};
int WI_DrawCharPatch (FFont *font, int charcode, int x, int y, EColorRange translation=CR_UNTRANSLATED, bool nomove=false)
struct FPatchInfo
{
FFont *mFont;
FTexture *mPatch;
EColorRange mColor;
void Init(FGIFont &gifont)
{
int width;
font->GetChar(charcode, &width);
screen->DrawChar(font, translation, x, y, charcode,
nomove ? DTA_CleanNoMove : DTA_Clean, true,
DTA_ShadowAlpha, (gameinfo.gametype & GAME_DoomChex) ? 0 : 0.5,
TAG_DONE);
return x - width;
if (gifont.color == NAME_Null)
{
mPatch = TexMan[gifont.fontname]; // "entering"
mColor = mPatch == NULL ? CR_UNTRANSLATED : CR_UNDEFINED;
mFont = NULL;
}
else
{
mFont = V_GetFont(gifont.fontname);
mColor = V_FindFontColor(gifont.color);
mPatch = NULL;
}
if (mFont == NULL)
{
mFont = BigFont;
}
}
};
class FIntermissionScreen
{
public:
enum EValues
{
// GLOBAL LOCATIONS
WI_TITLEY = 2,
// SINGPLE-PLAYER STUFF
SP_STATSX = 50,
SP_STATSY = 50,
SP_TIMEX = 8,
SP_TIMEY = (200 - 32),
// NET GAME STUFF
NG_STATSY = 50,
};
// States for single-player
enum ESPState
{
SP_KILLS = 0,
SP_ITEMS = 2,
SP_SECRET = 4,
SP_FRAGS = 6,
SP_TIME = 8,
};
static const int SHOWNEXTLOCDELAY = 4; // in seconds
//
// Animation.
// There is another anim_t used in p_spec.
// (which is why I have renamed this one!)
//
FInterBackground *bg;
int acceleratestage; // used to accelerate or skip a stage
bool playerready[MAXPLAYERS];
int me; // wbs->pnum
int bcnt;
EState state; // specifies current state
wbstartstruct_t *wbs; // contains information passed into intermission
wbplayerstruct_t* Plrs[MAXPLAYERS]; // wbs->plyr[]
int cnt; // used for general timing
int cnt_kills[MAXPLAYERS];
int cnt_items[MAXPLAYERS];
int cnt_secret[MAXPLAYERS];
int cnt_frags[MAXPLAYERS];
int cnt_deaths[MAXPLAYERS];
int cnt_time;
int cnt_total_time;
int cnt_par;
int cnt_pause;
int total_frags;
int total_deaths;
bool noautostartmap;
int dofrags;
int ng_state;
float shadowalpha;
//
// GRAPHICS
//
FPatchInfo mapname;
FPatchInfo finished;
FPatchInfo entering;
FTexture* sp_secret; // "secret"
FTexture* kills; // "Kills", "Scrt", "Items", "Frags"
FTexture* secret;
FTexture* items;
FTexture* frags;
FTexture* timepic; // Time sucks.
FTexture* par;
FTexture* sucks;
FTexture* killers; // "killers", "victims"
FTexture* victims;
FTexture* total; // "Total", your face, your dead face
FTexture* p; // Player graphic
FTexture* lnames[2]; // Name graphics of each level (centered)
// [RH] Info to dynamically generate the level name graphics
FString lnametexts[2];
bool snl_pointeron = false;
int player_deaths[MAXPLAYERS];
int sp_state;
//
// CODE
//
//====================================================================
//
@ -745,6 +815,20 @@ public:
return maxy;
}
//====================================================================
//
// Draws a single character with a shadow
//
//====================================================================
int WI_DrawCharPatch(FFont *font, int charcode, int x, int y, EColorRange translation = CR_UNTRANSLATED, bool nomove = false)
{
int width;
font->GetChar(charcode, &width);
screen->DrawChar(font, translation, x, y, charcode, nomove ? DTA_CleanNoMove : DTA_Clean, true, TAG_DONE);
return x - width;
}
//====================================================================
//
// Draws a level name with the big font
@ -871,57 +955,6 @@ public:
}
//====================================================================
//
// Draws the splats and the 'You are here' arrows
//
//====================================================================
int WI_MapToIndex (const char *map)
{
unsigned int i;
for (i = 0; i < lnodes.Size(); i++)
{
if (!strnicmp (lnodes[i].level, map, 8))
break;
}
return i;
}
//====================================================================
//
// Draws the splats and the 'You are here' arrows
//
//====================================================================
void WI_drawOnLnode( int n, FTexture * c[] ,int numc)
{
int i;
for(i=0;i<numc;i++)
{
int left;
int top;
int right;
int bottom;
right = c[i]->GetScaledWidth();
bottom = c[i]->GetScaledHeight();
left = lnodes[n].x - c[i]->GetScaledLeftOffset();
top = lnodes[n].y - c[i]->GetScaledTopOffset();
right += left;
bottom += top;
if (left >= 0 && right < 320 && top >= 0 && bottom < 200)
{
screen->DrawTexture (c[i], lnodes[n].x, lnodes[n].y, DTA_320x200, true, TAG_DONE);
break;
}
}
}
//====================================================================
//
// Draws a number.
@ -1134,7 +1167,7 @@ public:
state = ShowNextLoc;
acceleratestage = 0;
cnt = SHOWNEXTLOCDELAY * TICRATE;
WI_LoadBackground(true);
bg->LoadBackground(true);
}
void WI_updateShowNextLoc ()
@ -1147,26 +1180,7 @@ public:
void WI_drawShowNextLoc(void)
{
unsigned int i;
WI_drawBackground();
if (splat)
{
for (i=0 ; i<lnodes.Size() ; i++)
{
level_info_t * li = FindLevelInfo (lnodes[i].level);
if (li && li->flags & LEVEL_VISITED) WI_drawOnLnode(i, &splat,1); // draw a splat on taken cities.
}
}
// draw flashing ptr
if (snl_pointeron && yah.Size())
{
unsigned int v = WI_MapToIndex (wbs->next);
// Draw only if it points to a valid level on the current screen!
if (v<lnodes.Size()) WI_drawOnLnode (v, &yah[0], yah.Size());
}
bg->drawBackground(state, true, snl_pointeron);
// draws which level you are entering..
WI_drawEL ();
@ -1345,7 +1359,7 @@ public:
player_t *sortedplayers[MAXPLAYERS];
// draw animated background
WI_drawBackground();
bg->drawBackground(state, false, false);
y = WI_drawLF();
@ -1649,7 +1663,7 @@ public:
FTexture *readyico = TexMan.FindTexture("READYICO");
// draw animated background
WI_drawBackground();
bg->drawBackground(state, false, false);
y = WI_drawLF();
@ -1899,8 +1913,8 @@ public:
lh = IntermissionFont->GetHeight() * 3 / 2;
// draw animated background
WI_drawBackground();
bg->drawBackground(state, false, false);
WI_drawLF();
if (gameinfo.gametype & GAME_DoomChex)
@ -2090,12 +2104,15 @@ public:
if (li) lnametexts[1] = li->LookupLevelName();
else lnametexts[1] = "";
WI_LoadBackground(false);
bg = new FInterBackground(wbs);
noautostartmap = bg->LoadBackground(false);
}
void WI_unloadData ()
{
// [RH] The texture data gets unloaded at pre-map time, so there's nothing to do here
if (bg != nullptr) delete bg;
bg = nullptr;
return;
}
@ -2156,7 +2173,7 @@ static FIntermissionScreen WI_Screen;
void WI_Ticker()
{
WI_Screen.WI_updateAnimatedBack();
WI_Screen.bg->updateAnimatedBack();
WI_Screen.WI_Ticker();
}

View file

@ -1566,6 +1566,23 @@ TXT_COMM0 = "Incoming Message";
TXT_COMM1 = "Incoming Message from BlackBird";
AMMO_CLIP = "Bullets";
AMMO_SHELLS = "Shotgun Shells";
AMMO_ROCKETS = "Rockets";
AMMO_CELLS = "Energy Cells";
AMMO_GOLDWAND = "Wand Crystals";
AMMO_CROSSBOW = "Ethereal Arrows";
AMMO_BLASTER = "Claw Orbs";
AMMO_MACE = "Mace Spheres";
AMMO_SKULLROD = "Hellstaff Runes";
AMMO_PHOENIXROD = "Flame Orbs";
AMMO_MANA1 = "Blue Mana";
AMMO_MANA2 = "Green Mana";
$ifgame(chex) AMMO_CLIP = "Mini Zorch Charge";
$ifgame(chex) AMMO_SHELLS = "Large Zorcher Charge";
$ifgame(chex) AMMO_ROCKETS = "Propulsor Charge";
$ifgame(chex) AMMO_CELLS = "Phasing Zorcher Charge";
// Menu Strings
// Main Menu

View file

@ -230,7 +230,6 @@ class Actor : Thinker native
native deprecated double ScaleX;
native deprecated double ScaleY;
//int ConversationRoot; // THe root of the current dialogue;
//FStrifeDialogueNode *Conversation; // [RH] The dialogue to show when this actor is used.;
@ -368,7 +367,7 @@ class Actor : Thinker native
native Vector3 PosRelative(sector sec);
native void HandleSpawnFlags();
native void ExplodeMissile(line lin = null, Actor target = null);
native void ExplodeMissile(line lin = null, Actor target = null, bool onsky = false);
native void RestoreDamage();
native int SpawnHealth();
native void SetDamage(int dmg);

View file

@ -10,6 +10,7 @@ class Clip : Ammo
Ammo.BackpackAmount 10;
Ammo.BackpackMaxAmount 400;
Inventory.Icon "CLIPA0";
Tag "$AMMO_CLIP";
}
States
{
@ -48,6 +49,7 @@ class RocketAmmo : Ammo
Ammo.BackpackAmount 1;
Ammo.BackpackMaxAmount 100;
Inventory.Icon "ROCKA0";
Tag "$AMMO_ROCKETS";
}
States
{
@ -86,6 +88,7 @@ class Cell : Ammo
Ammo.BackpackAmount 20;
Ammo.BackpackMaxAmount 600;
Inventory.Icon "CELLA0";
Tag "$AMMO_CELLS";
}
States
{
@ -124,6 +127,7 @@ class Shell : Ammo
Ammo.BackpackAmount 4;
Ammo.BackpackMaxAmount 100;
Inventory.Icon "SHELA0";
Tag "$AMMO_SHELLS";
}
States
{

View file

@ -11,6 +11,7 @@ Class GoldWandAmmo : Ammo
Ammo.BackpackAmount 10;
Ammo.BackpackMaxAmount 200;
Inventory.Icon "INAMGLD";
Tag "$AMMO_GOLDWAND";
}
States
{
@ -48,6 +49,7 @@ Class CrossbowAmmo : Ammo
Ammo.BackpackAmount 5;
Ammo.BackpackMaxAmount 100;
Inventory.Icon "INAMBOW";
Tag "$AMMO_CROSSBOW";
}
States
{
@ -85,6 +87,7 @@ Class MaceAmmo : Ammo
Ammo.BackpackAmount 20;
Ammo.BackpackMaxAmount 300;
Inventory.Icon "INAMLOB";
Tag "$AMMO_MACE";
}
States
{
@ -123,6 +126,7 @@ Class BlasterAmmo : Ammo
Ammo.BackpackAmount 10;
Ammo.BackpackMaxAmount 400;
Inventory.Icon "INAMBST";
Tag "$AMMO_BLASTER";
}
States
{
@ -161,6 +165,7 @@ Class SkullRodAmmo : Ammo
Ammo.BackpackAmount 20;
Ammo.BackpackMaxAmount 400;
Inventory.Icon "INAMRAM";
Tag "$AMMO_SKULLROD";
}
States
{
@ -199,6 +204,7 @@ Class PhoenixRodAmmo : Ammo
Ammo.BackpackAmount 1;
Ammo.BackpackMaxAmount 40;
Inventory.Icon "INAMPNX";
Tag "$AMMO_PHOENIXROD";
}
States
{

View file

@ -13,6 +13,7 @@ class Mana1 : Ammo
+FLOATBOB
Inventory.Icon "MAN1I0";
Inventory.PickupMessage "$TXT_MANA_1";
Tag "$AMMO_MANA1";
}
States
{
@ -37,6 +38,7 @@ class Mana2 : Ammo
+FLOATBOB
Inventory.Icon "MAN2G0";
Inventory.PickupMessage "$TXT_MANA_2";
Tag "$AMMO_MANA2";
}
States
{