This commit is contained in:
Christoph Oelckers 2013-08-12 21:16:41 +02:00
commit 16f239536a
18 changed files with 64 additions and 22 deletions

View file

@ -236,7 +236,7 @@ enum
MF4_RANDOMIZE = 0x00000010, // Missile has random initial tic count
MF4_NOSKIN = 0x00000020, // Player cannot use skins
MF4_FIXMAPTHINGPOS = 0x00000040, // Fix this actor's position when spawned as a map thing
MF4_ACTLIKEBRIDGE = 0x00000080, // Pickups can "stand" on this actor
MF4_ACTLIKEBRIDGE = 0x00000080, // Pickups can "stand" on this actor / cannot be moved by any sector action.
MF4_STRIFEDAMAGE = 0x00000100, // Strife projectiles only do up to 4x damage, not 8x
MF4_CANUSEWALLS = 0x00000200, // Can activate 'use' specials
@ -266,7 +266,7 @@ enum
// --- mobj.flags5 ---
MF5_DONTDRAIN = 0x00000001, // cannot be drained health from.
/* = 0x00000002, */
/* = 0x00000002, reserved for use by scripting branch */
MF5_NODROPOFF = 0x00000004, // cannot drop off under any circumstances.
MF5_NOFORWARDFALL = 0x00000008, // Does not make any actor fall forward by being damaged by this
MF5_COUNTSECRET = 0x00000010, // From Doom 64: actor acts like a secret
@ -284,7 +284,7 @@ enum
MF5_NEVERFAST = 0x00010000, // never uses 'fast' attacking logic
MF5_ALWAYSRESPAWN = 0x00020000, // always respawns, regardless of skill setting
MF5_NEVERRESPAWN = 0x00040000, // never respawns, regardless of skill setting
MF5_DONTRIP = 0x00080000, // Ripping projectiles explode when hittin this actor
MF5_DONTRIP = 0x00080000, // Ripping projectiles explode when hitting this actor
MF5_NOINFIGHTING = 0x00100000, // This actor doesn't switch target when it's hurt
MF5_NOINTERACTION = 0x00200000, // Thing is completely excluded from any gameplay related checks
MF5_NOTIMEFREEZE = 0x00400000, // Actor is not affected by time freezer
@ -334,6 +334,11 @@ enum
MF6_NOTONAUTOMAP = 0x40000000, // will not be shown on automap with the 'scanner' powerup.
MF6_RELATIVETOFLOOR = 0x80000000, // [RC] Make flying actors be affected by lifts.
// --- mobj.flags6 ---
MF7_NEVERTARGET = 0x00000001, // can not be targetted at all, even if monster friendliness is considered.
MF7_NOTELESTOMP = 0x00000002, // cannot telefrag under any circumstances (even when set by MAPINFO)
// --- mobj.renderflags ---
RF_XFLIP = 0x0001, // Flip sprite horizontally
@ -838,6 +843,7 @@ public:
DWORD flags4; // [RH] Even more flags!
DWORD flags5; // OMG! We need another one.
DWORD flags6; // Shit! Where did all the flags go?
DWORD flags7; //
// [BB] If 0, everybody can see the actor, if > 0, only members of team (VisibleToTeam-1) can see it.
DWORD VisibleToTeam;

View file

@ -1300,7 +1300,7 @@ void D_DoAdvanceDemo (void)
gamestate = GS_DEMOSCREEN;
pagename = gameinfo.titlePage;
pagetic = (int)(gameinfo.titleTime * TICRATE);
S_StartMusic (gameinfo.titleMusic);
S_ChangeMusic (gameinfo.titleMusic, gameinfo.titleOrder, false);
demosequence = 3;
pagecount = 0;
C_HideConsole ();

View file

@ -589,7 +589,7 @@ void APowerInvisibility::DoEffect ()
Super::DoEffect();
// Due to potential interference with other PowerInvisibility items
// the effect has to be refreshed each tic.
fixed_t ts = Strength * (special1 + 1); if (ts > FRACUNIT) ts = FRACUNIT;
fixed_t ts = (Strength/100) * (special1 + 1); if (ts > FRACUNIT) ts = FRACUNIT;
Owner->alpha = clamp<fixed_t>((OPAQUE - ts), 0, OPAQUE);
switch (Mode)
{
@ -669,7 +669,7 @@ int APowerInvisibility::AlterWeaponSprite (visstyle_t *vis)
else if (changed == 1)
{
// something else set the weapon sprite back to opaque but this item is still active.
fixed_t ts = Strength * (special1 + 1); if (ts > FRACUNIT) ts = FRACUNIT;
fixed_t ts = (Strength/100) * (special1 + 1); if (ts > FRACUNIT) ts = FRACUNIT;
vis->alpha = clamp<fixed_t>((OPAQUE - ts), 0, OPAQUE);
switch (Mode)
{
@ -696,7 +696,7 @@ int APowerInvisibility::AlterWeaponSprite (visstyle_t *vis)
// Handling of Strife-like cumulative invisibility powerups, the weapon itself shouldn't become invisible
if ((vis->alpha < TRANSLUC25 && special1 > 0) || (vis->alpha == 0))
{
vis->alpha = clamp<fixed_t>((OPAQUE - Strength), 0, OPAQUE);
vis->alpha = clamp<fixed_t>((OPAQUE - (Strength/100)), 0, OPAQUE);
vis->colormap = SpecialColormaps[INVERSECOLORMAP].Colormap;
}
return -1; // This item is valid so another one shouldn't reset the translucency

View file

@ -134,6 +134,8 @@ enum
IF_RESTRICTABSOLUTELY = 1<<19, // RestrictedTo and ForbiddenTo do not allow pickup in any form by other classes
IF_NEVERRESPAWN = 1<<20, // Never, ever respawns
IF_NOSCREENFLASH = 1<<21, // No pickup flash on the player's screen
IF_TOSSED = 1<<22, // Was spawned by P_DropItem (i.e. as a monster drop)
};

View file

@ -184,6 +184,20 @@ const char* GameInfoBorders[] =
gameinfo.key.color = NAME_Null; \
}
#define GAMEINFOKEY_MUSIC(key, order, variable) \
else if(nextKey.CompareNoCase(variable) == 0) \
{ \
sc.MustGetToken(TK_StringConst); \
gameinfo.order = 0; \
char *colon = strchr (sc.String, ':'); \
if (colon) \
{ \
gameinfo.order = atoi(colon+1); \
*colon = 0; \
} \
gameinfo.key = sc.String; \
}
void FMapInfoParser::ParseGameInfo()
{
@ -286,12 +300,12 @@ void FMapInfoParser::ParseGameInfo()
GAMEINFOKEY_STRINGARRAY(creditPages, "CreditPage", 8, true)
GAMEINFOKEY_STRINGARRAY(PlayerClasses, "addplayerclasses", 0, false)
GAMEINFOKEY_STRINGARRAY(PlayerClasses, "playerclasses", 0, true)
GAMEINFOKEY_STRING(titleMusic, "titleMusic")
GAMEINFOKEY_MUSIC(titleMusic, titleOrder, "titleMusic")
GAMEINFOKEY_FLOAT(titleTime, "titleTime")
GAMEINFOKEY_FLOAT(advisoryTime, "advisoryTime")
GAMEINFOKEY_FLOAT(pageTime, "pageTime")
GAMEINFOKEY_STRING(chatSound, "chatSound")
GAMEINFOKEY_STRING(finaleMusic, "finaleMusic")
GAMEINFOKEY_MUSIC(finaleMusic, finaleOrder, "finaleMusic")
GAMEINFOKEY_CSTRING(finaleFlat, "finaleFlat", 8)
GAMEINFOKEY_STRINGARRAY(finalePages, "finalePage", 8, true)
GAMEINFOKEY_STRINGARRAY(infoPages, "addinfoPage", 8, false)
@ -309,7 +323,7 @@ void FMapInfoParser::ParseGameInfo()
GAMEINFOKEY_COLOR(defaultbloodparticlecolor, "defaultbloodparticlecolor")
GAMEINFOKEY_STRING(backpacktype, "backpacktype")
GAMEINFOKEY_STRING(statusbar, "statusbar")
GAMEINFOKEY_STRING(intermissionMusic, "intermissionMusic")
GAMEINFOKEY_MUSIC(intermissionMusic, intermissionOrder, "intermissionMusic")
GAMEINFOKEY_STRING(CursorPic, "CursorPic")
GAMEINFOKEY_BOOL(noloopfinalemusic, "noloopfinalemusic")
GAMEINFOKEY_BOOL(drawreadthis, "drawreadthis")

View file

@ -91,11 +91,13 @@ struct gameinfo_t
TArray<FName> PlayerClasses;
FString titleMusic;
int titleOrder;
float titleTime;
float advisoryTime;
float pageTime;
FString chatSound;
FString finaleMusic;
int finaleOrder;
char finaleFlat[9];
char borderFlat[9];
char SkyFlatName[9];
@ -114,6 +116,7 @@ struct gameinfo_t
FString backpacktype;
FString statusbar;
FString intermissionMusic;
int intermissionOrder;
FString CursorPic;
DWORD dimcolor;
float dimamount;

View file

@ -80,7 +80,7 @@ void DIntermissionScreen::Init(FIntermissionAction *desc, bool first)
if (desc->mMusic.IsEmpty())
{
// only start the default music if this is the first action in an intermission
if (first) S_ChangeMusic (gameinfo.finaleMusic, 0, desc->mMusicLooping);
if (first) S_ChangeMusic (gameinfo.finaleMusic, gameinfo.finaleOrder, desc->mMusicLooping);
}
else
{

View file

@ -311,6 +311,7 @@ void cht_DoCheat (player_t *player, int cheat)
player->mo->flags4 = player->mo->GetDefault()->flags4;
player->mo->flags5 = player->mo->GetDefault()->flags5;
player->mo->flags6 = player->mo->GetDefault()->flags6;
player->mo->flags7 = player->mo->GetDefault()->flags7;
player->mo->renderflags &= ~RF_INVISIBLE;
player->mo->height = player->mo->GetDefault()->height;
player->mo->radius = player->mo->GetDefault()->radius;

View file

@ -2644,6 +2644,7 @@ static bool P_CheckForResurrection(AActor *self, bool usevilestates)
corpsehit->flags4 = info->flags4;
corpsehit->flags5 = info->flags5;
corpsehit->flags6 = info->flags6;
corpsehit->flags7 = info->flags7;
corpsehit->health = info->health;
corpsehit->target = NULL;
corpsehit->lastenemy = NULL;
@ -3087,6 +3088,7 @@ AInventory *P_DropItem (AActor *source, const PClass *type, int dropamount, int
{
AInventory * inv = static_cast<AInventory *>(mo);
ModifyDropAmount(inv, dropamount);
inv->ItemFlags |= IF_TOSSED;
if (inv->SpecialDropAction (source))
{
// The special action indicates that the item should not spawn

View file

@ -1508,6 +1508,9 @@ bool AActor::OkayToSwitchTarget (AActor *other)
if (other == this)
return false; // [RH] Don't hate self (can happen when shooting barrels)
if (other->flags7 & MF7_NEVERTARGET)
return false; // never EVER target me!
if (!(other->flags & MF_SHOOTABLE))
return false; // Don't attack things that can't be hurt

View file

@ -334,8 +334,7 @@ bool P_TeleportMove (AActor *thing, fixed_t x, fixed_t y, fixed_t z, bool telefr
spechit.Clear ();
bool StompAlwaysFrags = (thing->flags2 & MF2_TELESTOMP) ||
(level.flags & LEVEL_MONSTERSTELEFRAG) || telefrag;
bool StompAlwaysFrags = ((thing->flags2 & MF2_TELESTOMP) || (level.flags & LEVEL_MONSTERSTELEFRAG) || telefrag) && !(thing->flags7 & MF7_NOTELESTOMP);
FBoundingBox box(x, y, thing->radius);
FBlockLinesIterator it(box);

View file

@ -200,8 +200,12 @@ void AActor::Serialize (FArchive &arc)
<< flags3
<< flags4
<< flags5
<< flags6
<< special1
<< flags6;
if (SaveVersion >= 4504)
{
arc << flags7;
}
arc << special1
<< special2
<< health
<< movedir
@ -826,7 +830,7 @@ void AActor::CopyFriendliness (AActor *other, bool changeTarget, bool resetHealt
flags4 = (flags4 & ~(MF4_NOHATEPLAYERS | MF4_BOSSSPAWNED)) | (other->flags4 & (MF4_NOHATEPLAYERS | MF4_BOSSSPAWNED));
FriendPlayer = other->FriendPlayer;
DesignatedTeam = other->DesignatedTeam;
if (changeTarget && other->target != NULL && !(other->target->flags3 & MF3_NOTARGET))
if (changeTarget && other->target != NULL && !(other->target->flags3 & MF3_NOTARGET) && !(other->target->flags7 & MF7_NEVERTARGET))
{
// LastHeard must be set as well so that A_Look can react to the new target if called
LastHeard = target = other->target;
@ -6133,6 +6137,9 @@ void PrintMiscActorInfo(AActor *query)
Printf("\n\tflags6: %x", query->flags6);
for (flagi = 0; flagi <= 31; flagi++)
if (query->flags6 & 1<<flagi) Printf(" %s", FLAG_NAME(1<<flagi, flags6));
Printf("\n\tflags7: %x", query->flags7);
for (flagi = 0; flagi <= 31; flagi++)
if (query->flags7 & 1<<flagi) Printf(" %s", FLAG_NAME(1<<flagi, flags7));
Printf("\nBounce flags: %x\nBounce factors: f:%f, w:%f",
query->BounceFlags, FIXED2FLOAT(query->bouncefactor),
FIXED2FLOAT(query->wallbouncefactor));

View file

@ -452,6 +452,7 @@ bool P_Thing_Raise(AActor *thing)
thing->flags4 = info->flags4;
thing->flags5 = info->flags5;
thing->flags6 = info->flags6;
thing->flags7 = info->flags7;
thing->health = info->health;
thing->target = NULL;
thing->lastenemy = NULL;

View file

@ -237,6 +237,9 @@ static FFlagDef ActorFlags[]=
DEFINE_FLAG(MF6, NOTONAUTOMAP, AActor, flags6),
DEFINE_FLAG(MF6, RELATIVETOFLOOR, AActor, flags6),
DEFINE_FLAG(MF7, NEVERTARGET, AActor, flags7),
DEFINE_FLAG(MF7, NOTELESTOMP, AActor, flags7),
// Effect flags
DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects),
DEFINE_FLAG2(FX_ROCKET, ROCKETTRAIL, AActor, effects),
@ -305,6 +308,7 @@ static FFlagDef InventoryFlags[] =
DEFINE_FLAG(IF, RESTRICTABSOLUTELY, AInventory, ItemFlags),
DEFINE_FLAG(IF, NEVERRESPAWN, AInventory, ItemFlags),
DEFINE_FLAG(IF, NOSCREENFLASH, AInventory, ItemFlags),
DEFINE_FLAG(IF, TOSSED, AInventory, ItemFlags),
DEFINE_DEPRECATED_FLAG(PICKUPFLASH),
DEFINE_DEPRECATED_FLAG(INTERHUBSTRIP),};

View file

@ -1286,7 +1286,8 @@ DEFINE_PROPERTY(clearflags, 0, Actor)
defaults->flags3 =
defaults->flags4 =
defaults->flags5 =
defaults->flags6 = 0;
defaults->flags6 =
defaults->flags7 = 0;
defaults->flags2 &= MF2_ARGSDEFINED; // this flag must not be cleared
}
@ -2113,9 +2114,8 @@ DEFINE_CLASS_PROPERTY_PREFIX(powerup, strength, F, Inventory)
I_Error("\"powerup.strength\" requires an actor of type \"Powerup\"\n");
return;
}
// Puts a percent value in the 0.0..1.0 range
PROP_FIXED_PARM(f, 0);
*pStrength = f / 100;
*pStrength = f;
}
//==========================================================================

View file

@ -76,7 +76,7 @@ const char *GetVersionString();
// Use 4500 as the base git save version, since it's higher than the
// SVN revision ever got.
#define SAVEVER 4503
#define SAVEVER 4504
#define SAVEVERSTRINGIFY2(x) #x
#define SAVEVERSTRINGIFY(x) SAVEVERSTRINGIFY2(x)

View file

@ -1947,7 +1947,7 @@ void WI_Ticker(void)
if (level.info->InterMusic.IsNotEmpty())
S_ChangeMusic(level.info->InterMusic, level.info->intermusicorder);
else
S_ChangeMusic (gameinfo.intermissionMusic.GetChars());
S_ChangeMusic (gameinfo.intermissionMusic.GetChars(), gameinfo.intermissionOrder);
}

View file

@ -300,7 +300,7 @@ ACTOR Actor native //: Thinker
action native A_Quake(int intensity, int duration, int damrad, int tremrad, sound sfx = "world/quake");
action native A_SetTics(int tics);
action native A_SetDamageType(name damagetype);
action native A_DropItem(class<Actor> item, int dropamount = -1, int chance = -1);
action native A_DropItem(class<Actor> item, int dropamount = -1, int chance = 256);
action native A_CheckSightOrRange(float distance, state label);
action native A_CheckRange(float distance, state label);