From 0a258f95ea6466daa5366065a826c0f78a333411 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 9 Aug 2013 16:25:16 +0200 Subject: [PATCH 01/28] - added gravity property to UDMF things. Positive values are multiplied with the class's gravity property, negative values are used as their absolute. --- specs/udmf_zdoom.txt | 2 ++ src/doomdata.h | 1 + src/p_buildmap.cpp | 1 + src/p_mobj.cpp | 4 ++++ src/p_setup.cpp | 2 ++ src/p_udmf.cpp | 6 ++++++ 6 files changed, 16 insertions(+) diff --git a/specs/udmf_zdoom.txt b/specs/udmf_zdoom.txt index 4fc57f856..a6d8acb5d 100644 --- a/specs/udmf_zdoom.txt +++ b/specs/udmf_zdoom.txt @@ -204,6 +204,8 @@ Note: All fields default to false unless mentioned otherwise. // Parameter is the conversation ID, 0 meaning none. countsecret = ; // Picking up this actor counts as a secret. arg0str = ; // Alternate string-based version of arg0 + gravity = ; // Set per-actor gravity. Positive values are multiplied with the class's property, + // negative values are used as their absolute. Default = 1.0. * Note about arg0str diff --git a/src/doomdata.h b/src/doomdata.h index eeff13e2e..46af9d6a4 100644 --- a/src/doomdata.h +++ b/src/doomdata.h @@ -342,6 +342,7 @@ struct FMapThing int special; int args[5]; int Conversation; + fixed_t gravity; void Serialize (FArchive &); }; diff --git a/src/p_buildmap.cpp b/src/p_buildmap.cpp index 417343f21..f2fd7b0bf 100644 --- a/src/p_buildmap.cpp +++ b/src/p_buildmap.cpp @@ -698,6 +698,7 @@ static int LoadSprites (spritetype *sprites, Xsprite *xsprites, int numsprites, mapthings[count].SkillFilter = 0xffff; mapthings[count].flags = MTF_SINGLE|MTF_COOPERATIVE|MTF_DEATHMATCH; mapthings[count].special = 0; + mapthings[count].gravity = FRACUNIT; if (xsprites != NULL && sprites[i].lotag == 710) { // Blood ambient sound diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 3b11ec415..14607a682 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -4712,6 +4712,10 @@ AActor *P_SpawnMapThing (FMapThing *mthing, int position) mobj->SpawnPoint[2] = mthing->z; mobj->SpawnAngle = mthing->angle; mobj->SpawnFlags = mthing->flags; + if (mthing->gravity < 0) mobj->gravity = -mthing->gravity; + else if (mthing->gravity > 0) mobj->gravity = FixedMul(mobj->gravity, mthing->gravity); + else mobj->flags &= ~MF_NOGRAVITY; + P_FindFloorCeiling(mobj, FFCF_SAMESECTOR | FFCF_ONLY3DFLOORS | FFCF_3DRESTRICT); if (!(mobj->flags2 & MF2_ARGSDEFINED)) diff --git a/src/p_setup.cpp b/src/p_setup.cpp index 2535641a5..784e6946f 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -1750,6 +1750,7 @@ void P_LoadThings (MapData * map) memset (&mti[i], 0, sizeof(mti[i])); + mti[i].gravity = FRACUNIT; mti[i].Conversation = 0; mti[i].SkillFilter = MakeSkill(flags); mti[i].ClassFilter = 0xffff; // Doom map format doesn't have class flags so spawn for all player classes @@ -1825,6 +1826,7 @@ void P_LoadThings2 (MapData * map) mti[i].ClassFilter = (mti[i].flags & MTF_CLASS_MASK) >> MTF_CLASS_SHIFT; mti[i].flags &= ~(MTF_SKILLMASK|MTF_CLASS_MASK); mti[i].Conversation = 0; + mti[i].gravity = FRACUNIT; } delete[] mtp; } diff --git a/src/p_udmf.cpp b/src/p_udmf.cpp index 91e4c8565..6d935ba63 100644 --- a/src/p_udmf.cpp +++ b/src/p_udmf.cpp @@ -475,6 +475,7 @@ public: FString arg0str, arg1str; memset(th, 0, sizeof(*th)); + th->gravity = FRACUNIT; sc.MustGetToken('{'); while (!sc.CheckToken('}')) { @@ -515,6 +516,11 @@ public: th->special = CheckInt(key); break; + case NAME_Gravity: + CHECK_N(Zd | Zdt) + th->gravity = CheckFixed(key); + break; + case NAME_Arg0: case NAME_Arg1: case NAME_Arg2: From a78ad3188bc8ff7361b83460967e3ef5a0391257 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 9 Aug 2013 20:20:23 +0200 Subject: [PATCH 02/28] - added MF5_NOFORWARDFALL flag to prevent attacks from making its victim fall forward randomly. --- src/actor.h | 2 +- src/p_interaction.cpp | 4 +++- src/thingdef/thingdef_data.cpp | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/actor.h b/src/actor.h index 7ec653447..15a135b99 100644 --- a/src/actor.h +++ b/src/actor.h @@ -268,7 +268,7 @@ enum MF5_DONTDRAIN = 0x00000001, // cannot be drained health from. /* = 0x00000002, */ MF5_NODROPOFF = 0x00000004, // cannot drop off under any circumstances. - /* = 0x00000008, */ + 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 MF5_AVOIDINGDROPOFF = 0x00000020, // Used to move monsters away from dropoffs MF5_NODAMAGE = 0x00000040, // Actor can be shot and reacts to being shot but takes no damage diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index 96f04f75c..0ee955a82 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -1143,7 +1143,9 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage, && (pr_damagemobj()&1) // [RH] But only if not too fast and not flying && thrust < 10*FRACUNIT - && !(target->flags & MF_NOGRAVITY)) + && !(target->flags & MF_NOGRAVITY) + && (inflictor == NULL || !(inflictor->flags5 & MF5_NOFORWARDFALL)) + ) { ang += ANG180; thrust *= 4; diff --git a/src/thingdef/thingdef_data.cpp b/src/thingdef/thingdef_data.cpp index 795bcb5cc..455f700df 100644 --- a/src/thingdef/thingdef_data.cpp +++ b/src/thingdef/thingdef_data.cpp @@ -184,6 +184,7 @@ static FFlagDef ActorFlags[]= DEFINE_FLAG(MF5, DONTDRAIN, AActor, flags5), DEFINE_FLAG(MF5, NODROPOFF, AActor, flags5), + DEFINE_FLAG(MF5, NOFORWARDFALL, AActor, flags5), DEFINE_FLAG(MF5, COUNTSECRET, AActor, flags5), DEFINE_FLAG(MF5, NODAMAGE, AActor, flags5), DEFINE_FLAG(MF5, BLOODSPLATTER, AActor, flags5), From 6a07118ea4bbbe3d901693b93300550cc0d2b02a Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 9 Aug 2013 20:35:10 +0200 Subject: [PATCH 03/28] - added ML_BLOCKHITSCAN line flag. --- specs/udmf_zdoom.txt | 1 + src/doomdata.h | 1 + src/namedef.h | 1 + src/p_lnspec.cpp | 1 + src/p_map.cpp | 2 +- src/p_udmf.cpp | 4 ++++ 6 files changed, 9 insertions(+), 1 deletion(-) diff --git a/specs/udmf_zdoom.txt b/specs/udmf_zdoom.txt index a6d8acb5d..3241bf4c8 100644 --- a/specs/udmf_zdoom.txt +++ b/specs/udmf_zdoom.txt @@ -113,6 +113,7 @@ Note: All fields default to false unless mentioned otherwise. blockprojectiles = ;// Line blocks all projectiles blockuse = ; // Line blocks all use actions blocksight = ; // Line blocks monster line of sight + blockhitscan = ; // Line blocks hitscan attacks locknumber = ; // Line special is locked arg0str = ; // Alternate string-based version of arg0 diff --git a/src/doomdata.h b/src/doomdata.h index 46af9d6a4..55903170a 100644 --- a/src/doomdata.h +++ b/src/doomdata.h @@ -153,6 +153,7 @@ enum ELineFlags ML_BLOCKPROJECTILE = 0x01000000, ML_BLOCKUSE = 0x02000000, // blocks all use actions through this line ML_BLOCKSIGHT = 0x04000000, // blocks monster line of sight + ML_BLOCKHITSCAN = 0x08000000, // blocks hitscan attacks }; diff --git a/src/namedef.h b/src/namedef.h index f2d601eb5..f7607400e 100644 --- a/src/namedef.h +++ b/src/namedef.h @@ -465,6 +465,7 @@ xx(blockprojectiles) xx(blockuse) xx(hidden) xx(blocksight) +xx(blockhitscan) xx(Renderstyle) diff --git a/src/p_lnspec.cpp b/src/p_lnspec.cpp index a0164ab82..869fd5169 100644 --- a/src/p_lnspec.cpp +++ b/src/p_lnspec.cpp @@ -2545,6 +2545,7 @@ FUNC(LS_Line_SetBlocking) ML_RAILING, ML_BLOCKUSE, ML_BLOCKSIGHT, + ML_BLOCKHITSCAN, -1 }; diff --git a/src/p_map.cpp b/src/p_map.cpp index 211e03056..da87481d0 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -3563,7 +3563,7 @@ AActor *P_LineAttack (AActor *t1, angle_t angle, fixed_t distance, else tflags = TRACE_NoSky|TRACE_Impact; if (!Trace (t1->x, t1->y, shootz, t1->Sector, vx, vy, vz, distance, - MF_SHOOTABLE, ML_BLOCKEVERYTHING, t1, trace, + MF_SHOOTABLE, ML_BLOCKEVERYTHING|ML_BLOCKHITSCAN, t1, trace, tflags, hitGhosts ? CheckForGhost : CheckForSpectral)) { // hit nothing if (puffDefaults == NULL) diff --git a/src/p_udmf.cpp b/src/p_udmf.cpp index 6d935ba63..fc5964737 100644 --- a/src/p_udmf.cpp +++ b/src/p_udmf.cpp @@ -927,6 +927,10 @@ public: Flag(ld->flags, ML_BLOCKSIGHT, key); continue; + case NAME_blockhitscan: + Flag(ld->flags, ML_BLOCKHITSCAN, key); + continue; + // [Dusk] lock number case NAME_Locknumber: ld->locknumber = CheckInt(key); From 55f637c9069cbce46998488d56cd4e518e4a6045 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 9 Aug 2013 23:40:34 +0200 Subject: [PATCH 04/28] - fixed: When creating colormaps for 3D floors the model sector's fade value must be used when defining a fog volume. --- src/p_3dfloors.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_3dfloors.cpp b/src/p_3dfloors.cpp index 56b34ca0f..51ac24229 100644 --- a/src/p_3dfloors.cpp +++ b/src/p_3dfloors.cpp @@ -60,7 +60,7 @@ FDynamicColormap *F3DFloor::GetColormap() { // If there's no fog in either model or target sector this is easy and fast. - if ((target->ColorMap->Fade == 0 && model->ColorMap->Fade == 0) || (flags & FF_FADEWALLS)) + if ((target->ColorMap->Fade == 0 && model->ColorMap->Fade == 0) || (flags & (FF_FADEWALLS|FF_FOG))) { return model->ColorMap; } From 211d2930029d71921d1c6c0cc65f909908591aac Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 10 Aug 2013 08:53:37 +0200 Subject: [PATCH 05/28] - added MF6_NOTONAUTOMAP flag to exclude things from being shown with the scanner powerup. The IDDT cheat will not be affected by this. --- src/actor.h | 1 + src/am_map.cpp | 176 +++++++++++++++++---------------- src/thingdef/thingdef_data.cpp | 1 + 3 files changed, 91 insertions(+), 87 deletions(-) diff --git a/src/actor.h b/src/actor.h index 15a135b99..768008182 100644 --- a/src/actor.h +++ b/src/actor.h @@ -331,6 +331,7 @@ enum MF6_DOHARMSPECIES = 0x08000000, // Do hurt one's own species with projectiles. MF6_INTRYMOVE = 0x10000000, // Executing P_TryMove MF6_NOTAUTOAIMED = 0x20000000, // Do not subject actor to player autoaim. + MF6_NOTONAUTOMAP = 0x40000000, // will not be shown on automap with the 'scanner' powerup. // --- mobj.renderflags --- diff --git a/src/am_map.cpp b/src/am_map.cpp index 8a4d1cc36..610ba4825 100644 --- a/src/am_map.cpp +++ b/src/am_map.cpp @@ -2356,114 +2356,116 @@ void AM_drawThings () t = sectors[i].thinglist; while (t) { - p.x = t->x >> FRACTOMAPBITS; - p.y = t->y >> FRACTOMAPBITS; - - if (am_showthingsprites > 0 && t->sprite > 0) + if (am_cheat > 0 || !(t->flags6 & MF6_NOTONAUTOMAP)) { - FTexture *texture = NULL; - spriteframe_t *frame; - angle_t rotation = 0; + p.x = t->x >> FRACTOMAPBITS; + p.y = t->y >> FRACTOMAPBITS; - // try all modes backwards until a valid texture has been found. - for(int show = am_showthingsprites; show > 0 && texture == NULL; show--) + if (am_showthingsprites > 0 && t->sprite > 0) { - const spritedef_t& sprite = sprites[t->sprite]; - const size_t spriteIndex = sprite.spriteframes + (show > 1 ? t->frame : 0); + FTexture *texture = NULL; + spriteframe_t *frame; + angle_t rotation = 0; + + // try all modes backwards until a valid texture has been found. + for(int show = am_showthingsprites; show > 0 && texture == NULL; show--) + { + const spritedef_t& sprite = sprites[t->sprite]; + const size_t spriteIndex = sprite.spriteframes + (show > 1 ? t->frame : 0); + + frame = &SpriteFrames[spriteIndex]; + angle_t angle = ANGLE_270 - t->angle; + if (frame->Texture[0] != frame->Texture[1]) angle += (ANGLE_180 / 16); + if (am_rotate == 1 || (am_rotate == 2 && viewactive)) + { + angle += players[consoleplayer].camera->angle - ANGLE_90; + } + rotation = angle >> 28; + + const FTextureID textureID = frame->Texture[show > 2 ? rotation : 0]; + texture = TexMan(textureID); + } + + if (texture == NULL) goto drawTriangle; // fall back to standard display if no sprite can be found. + + const fixed_t spriteScale = 10 * scale_mtof; + + DrawMarker (texture, p.x, p.y, 0, !!(frame->Flip & (1 << rotation)), + spriteScale, spriteScale, 0, FRACUNIT, 0, LegacyRenderStyles[STYLE_Normal]); + } + else + { + drawTriangle: + angle = t->angle; - frame = &SpriteFrames[spriteIndex]; - angle_t angle = ANGLE_270 - t->angle; - if (frame->Texture[0] != frame->Texture[1]) angle += (ANGLE_180 / 16); if (am_rotate == 1 || (am_rotate == 2 && viewactive)) { - angle += players[consoleplayer].camera->angle - ANGLE_90; + AM_rotatePoint (&p.x, &p.y); + angle += ANG90 - players[consoleplayer].camera->angle; } - rotation = angle >> 28; - const FTextureID textureID = frame->Texture[show > 2 ? rotation : 0]; - texture = TexMan(textureID); - } + color = ThingColor; - if (texture == NULL) goto drawTriangle; // fall back to standard display if no sprite can be found. - - const fixed_t spriteScale = 10 * scale_mtof; - - DrawMarker (texture, p.x, p.y, 0, !!(frame->Flip & (1 << rotation)), - spriteScale, spriteScale, 0, FRACUNIT, 0, LegacyRenderStyles[STYLE_Normal]); - } - else - { - drawTriangle: - angle = t->angle; - - if (am_rotate == 1 || (am_rotate == 2 && viewactive)) - { - AM_rotatePoint (&p.x, &p.y); - angle += ANG90 - players[consoleplayer].camera->angle; - } - - color = ThingColor; - - // use separate colors for special thing types - if (t->flags3&MF3_ISMONSTER && !(t->flags&MF_CORPSE)) - { - if (t->flags & MF_FRIENDLY || !(t->flags & MF_COUNTKILL)) color = ThingColor_Friend; - else color = ThingColor_Monster; - } - else if (t->flags&MF_SPECIAL) - { - // Find the key's own color. - // Only works correctly if single-key locks have lower numbers than any-key locks. - // That is the case for all default keys, however. - if (t->IsKindOf(RUNTIME_CLASS(AKey))) + // use separate colors for special thing types + if (t->flags3&MF3_ISMONSTER && !(t->flags&MF_CORPSE)) { - if (G_SkillProperty(SKILLP_EasyKey)) + if (t->flags & MF_FRIENDLY || !(t->flags & MF_COUNTKILL)) color = ThingColor_Friend; + else color = ThingColor_Monster; + } + else if (t->flags&MF_SPECIAL) + { + // Find the key's own color. + // Only works correctly if single-key locks have lower numbers than any-key locks. + // That is the case for all default keys, however. + if (t->IsKindOf(RUNTIME_CLASS(AKey))) { - // Already drawn by AM_drawKeys(), so don't draw again - color.Index = -1; - } - else if (am_showkeys) - { - int P_GetMapColorForKey (AInventory * key); - int c = P_GetMapColorForKey(static_cast(t)); + if (G_SkillProperty(SKILLP_EasyKey)) + { + // Already drawn by AM_drawKeys(), so don't draw again + color.Index = -1; + } + else if (am_showkeys) + { + int P_GetMapColorForKey (AInventory * key); + int c = P_GetMapColorForKey(static_cast(t)); - if (c >= 0) color.FromRGB(RPART(c), GPART(c), BPART(c)); - else color = ThingColor_CountItem; - AM_drawLineCharacter(&CheatKey[0], CheatKey.Size(), 0, 0, color, p.x, p.y); - color.Index = -1; + if (c >= 0) color.FromRGB(RPART(c), GPART(c), BPART(c)); + else color = ThingColor_CountItem; + AM_drawLineCharacter(&CheatKey[0], CheatKey.Size(), 0, 0, color, p.x, p.y); + color.Index = -1; + } + else + { + color = ThingColor_Item; + } } + else if (t->flags&MF_COUNTITEM) + color = ThingColor_CountItem; else - { color = ThingColor_Item; - } } - else if (t->flags&MF_COUNTITEM) - color = ThingColor_CountItem; - else - color = ThingColor_Item; - } - if (color.Index != -1) - { - AM_drawLineCharacter - (thintriangle_guy, NUMTHINTRIANGLEGUYLINES, - 16<= 3) - { - static const mline_t box[4] = + if (color.Index != -1) { - { { -MAPUNIT, -MAPUNIT }, { MAPUNIT, -MAPUNIT } }, - { { MAPUNIT, -MAPUNIT }, { MAPUNIT, MAPUNIT } }, - { { MAPUNIT, MAPUNIT }, { -MAPUNIT, MAPUNIT } }, - { { -MAPUNIT, MAPUNIT }, { -MAPUNIT, -MAPUNIT } }, - }; + AM_drawLineCharacter + (thintriangle_guy, NUMTHINTRIANGLEGUYLINES, + 16<radius >> FRACTOMAPBITS, angle - t->angle, color, p.x, p.y); + if (am_cheat >= 3) + { + static const mline_t box[4] = + { + { { -MAPUNIT, -MAPUNIT }, { MAPUNIT, -MAPUNIT } }, + { { MAPUNIT, -MAPUNIT }, { MAPUNIT, MAPUNIT } }, + { { MAPUNIT, MAPUNIT }, { -MAPUNIT, MAPUNIT } }, + { { -MAPUNIT, MAPUNIT }, { -MAPUNIT, -MAPUNIT } }, + }; + + AM_drawLineCharacter (box, 4, t->radius >> FRACTOMAPBITS, angle - t->angle, color, p.x, p.y); + } } } - t = t->snext; } } diff --git a/src/thingdef/thingdef_data.cpp b/src/thingdef/thingdef_data.cpp index 455f700df..ef0cf2fe1 100644 --- a/src/thingdef/thingdef_data.cpp +++ b/src/thingdef/thingdef_data.cpp @@ -234,6 +234,7 @@ static FFlagDef ActorFlags[]= DEFINE_FLAG(MF6, DOHARMSPECIES, AActor, flags6), DEFINE_FLAG(MF6, POISONALWAYS, AActor, flags6), DEFINE_FLAG(MF6, NOTAUTOAIMED, AActor, flags6), + DEFINE_FLAG(MF6, NOTONAUTOMAP, AActor, flags6), // Effect flags DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects), From 25ec3fb8feeff395576808268254ef46f03de333 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 10 Aug 2013 09:32:55 +0200 Subject: [PATCH 06/28] - added MF6_RELATIVETOFLOOR flag. --- src/actor.h | 1 + src/p_map.cpp | 44 ++++++++++++++++++++++++---------- src/thingdef/thingdef_data.cpp | 1 + 3 files changed, 33 insertions(+), 13 deletions(-) diff --git a/src/actor.h b/src/actor.h index 768008182..bf1b1cc60 100644 --- a/src/actor.h +++ b/src/actor.h @@ -332,6 +332,7 @@ enum MF6_INTRYMOVE = 0x10000000, // Executing P_TryMove MF6_NOTAUTOAIMED = 0x20000000, // Do not subject actor to player autoaim. 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.renderflags --- diff --git a/src/p_map.cpp b/src/p_map.cpp index da87481d0..ee7c63263 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -5047,6 +5047,15 @@ void PIT_FloorDrop (AActor *thing, FChangePosition *cpos) P_CheckFakeFloorTriggers (thing, oldz); } } + else if ((thing->z != oldfloorz && !(thing->flags & MF_NOLIFTDROP))) + { + fixed_t oldz = thing->z; + if ((thing->flags & MF_NOGRAVITY) && (thing->flags6 & MF6_RELATIVETOFLOOR)) + { + thing->z = thing->z - oldfloorz + thing->floorz; + P_CheckFakeFloorTriggers (thing, oldz); + } + } } //============================================================================= @@ -5058,6 +5067,7 @@ void PIT_FloorDrop (AActor *thing, FChangePosition *cpos) void PIT_FloorRaise (AActor *thing, FChangePosition *cpos) { fixed_t oldfloorz = thing->floorz; + fixed_t oldz = thing->z; P_AdjustFloorCeil (thing, cpos); @@ -5072,22 +5082,30 @@ void PIT_FloorRaise (AActor *thing, FChangePosition *cpos) return; // do not move bridge things } intersectors.Clear (); - fixed_t oldz = thing->z; thing->z = thing->floorz; - switch (P_PushUp (thing, cpos)) + } + else + { + if((thing->flags & MF_NOGRAVITY) && (thing->flags6 & MF6_RELATIVETOFLOOR)) { - default: - P_CheckFakeFloorTriggers (thing, oldz); - break; - case 1: - P_DoCrunch (thing, cpos); - P_CheckFakeFloorTriggers (thing, oldz); - break; - case 2: - P_DoCrunch (thing, cpos); - thing->z = oldz; - break; + intersectors.Clear (); + thing->z = thing->z - oldfloorz + thing->floorz; } + else return; + } + switch (P_PushUp (thing, cpos)) + { + default: + P_CheckFakeFloorTriggers (thing, oldz); + break; + case 1: + P_DoCrunch (thing, cpos); + P_CheckFakeFloorTriggers (thing, oldz); + break; + case 2: + P_DoCrunch (thing, cpos); + thing->z = oldz; + break; } } diff --git a/src/thingdef/thingdef_data.cpp b/src/thingdef/thingdef_data.cpp index ef0cf2fe1..c01855eec 100644 --- a/src/thingdef/thingdef_data.cpp +++ b/src/thingdef/thingdef_data.cpp @@ -235,6 +235,7 @@ static FFlagDef ActorFlags[]= DEFINE_FLAG(MF6, POISONALWAYS, AActor, flags6), DEFINE_FLAG(MF6, NOTAUTOAIMED, AActor, flags6), DEFINE_FLAG(MF6, NOTONAUTOMAP, AActor, flags6), + DEFINE_FLAG(MF6, RELATIVETOFLOOR, AActor, flags6), // Effect flags DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects), From 1c889dc9fa6cca04b7c4c491590bebaf5b77c971 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 10 Aug 2013 09:51:48 +0200 Subject: [PATCH 07/28] - let APowerRegeneration use the Strength property to define the amount of regeneration it gives. --- src/g_shared/a_artifacts.cpp | 2 +- wadsrc/static/actors/shared/inventory.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/g_shared/a_artifacts.cpp b/src/g_shared/a_artifacts.cpp index 0de822f62..e05f6071a 100644 --- a/src/g_shared/a_artifacts.cpp +++ b/src/g_shared/a_artifacts.cpp @@ -1697,7 +1697,7 @@ void APowerRegeneration::DoEffect() { if (Owner != NULL && Owner->health > 0 && (level.time & 31) == 0) { - if (P_GiveBody(Owner, 5)) + if (P_GiveBody(Owner, Strength)) { S_Sound(Owner, CHAN_ITEM, "*regenerate", 1, ATTN_NORM ); } diff --git a/wadsrc/static/actors/shared/inventory.txt b/wadsrc/static/actors/shared/inventory.txt index 5f5e20b50..ed113c4df 100644 --- a/wadsrc/static/actors/shared/inventory.txt +++ b/wadsrc/static/actors/shared/inventory.txt @@ -300,6 +300,7 @@ ACTOR PowerDrain : Powerup native ACTOR PowerRegeneration : Powerup native { Powerup.Duration -120 + Powerup.Strength 5 } ACTOR PowerHighJump : Powerup native {} From d438c6c45689a2cc835d40b67736182caf855fb1 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 10 Aug 2013 20:42:34 +0200 Subject: [PATCH 08/28] - fixed typo in Strife spectre's obituary message and added it to the DECORATE definition of the spectre. --- wadsrc/static/actors/strife/alienspectres.txt | 1 + wadsrc/static/language.enu | 2 +- wadsrc/static/language.fr | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wadsrc/static/actors/strife/alienspectres.txt b/wadsrc/static/actors/strife/alienspectres.txt index bdd30d8e4..6e56f680d 100644 --- a/wadsrc/static/actors/strife/alienspectres.txt +++ b/wadsrc/static/actors/strife/alienspectres.txt @@ -20,6 +20,7 @@ ACTOR AlienSpectre1 : SpectralMonster 129 PainSound "alienspectre/pain" DeathSound "alienspectre/death" ActiveSound "alienspectre/active" + Obituary "$OB_ALIENSPECTRE" +NOGRAVITY +FLOAT +SHADOW diff --git a/wadsrc/static/language.enu b/wadsrc/static/language.enu index 8a0a5f4ee..5695ad502 100644 --- a/wadsrc/static/language.enu +++ b/wadsrc/static/language.enu @@ -736,7 +736,7 @@ OB_MACIL = "%o should have never rebelled against Macil."; OB_REBEL = "%o was gunned down by a Rebel."; OB_BEGGAR = "%o was beaten to death by the poor."; OB_PEASANT = "%o should have never picked a fight with a civilian."; -OB_ALIENSPECTE = "%o was struck down by the Spectre."; +OB_ALIENSPECTRE = "%o was struck down by the Spectre."; OB_ENTITY = "%o felt the wrath of The One God."; OB_LOREMASTER = "%o couldn't escape from the Lore Master's grasp."; OB_PROGRAMMER = "%o was deleted by the Programmer."; diff --git a/wadsrc/static/language.fr b/wadsrc/static/language.fr index 354ba2bee..1533a1506 100644 --- a/wadsrc/static/language.fr +++ b/wadsrc/static/language.fr @@ -779,7 +779,7 @@ OB_MACIL = "%o n'aurait jamais du se rebelle contre Macil."; OB_REBEL = "%o a ete abbatu par un Rebel."; OB_BEGGAR = "%o a ete battu a mort par un pauvre."; OB_PEASANT = "%o n'aurait jamais du chercher la bagarre a un civil."; -OB_ALIENSPECTE = "%o a ete terrasse par le Spectre."; +OB_ALIENSPECTRE = "%o a ete terrasse par le Spectre."; OB_ENTITY = "%o a senti le courroux du dieu unique."; OB_LOREMASTER = "%o n'a pu echapper a l'emprise du Maitre des Traditions."; OB_PROGRAMMER = "%o a ete efface par le Programmer."; From 1acbe17876d0f4720d3292bc15ac8b64b568b277 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 10 Aug 2013 21:15:06 +0200 Subject: [PATCH 09/28] - specte typo in language.ptb. --- wadsrc/static/language.ptb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wadsrc/static/language.ptb b/wadsrc/static/language.ptb index 1dc0e36c0..9f7cc4e11 100644 --- a/wadsrc/static/language.ptb +++ b/wadsrc/static/language.ptb @@ -712,7 +712,7 @@ OB_MACIL = "%o should have never rebelled against Macil."; OB_REBEL = "%o was gunned down by a Rebel."; OB_BEGGAR = "%o was beaten to death by the poor."; OB_PEASANT = "%o should have never picked a fight with a civilian."; -OB_ALIENSPECTE = "%o was struck down by the Spectre."; +OB_ALIENSPECTRE = "%o was struck down by the Spectre."; OB_ENTITY = "%o felt the wrath of The One God."; OB_LOREMASTER = "%o couldn't escape from the Lore Master's grasp."; OB_PROGRAMMER = "%o was deleted by the Programmer."; From c7a46492eb6d7e84d5cec98b987496baba5f9467 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 11 Aug 2013 12:41:14 +0200 Subject: [PATCH 10/28] - fixed bad index variable in R_RenderFakeWallRange. --- src/r_segs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/r_segs.cpp b/src/r_segs.cpp index d050d8c3b..4fec863ff 100644 --- a/src/r_segs.cpp +++ b/src/r_segs.cpp @@ -828,7 +828,7 @@ void R_RenderFakeWallRange (drawseg_t *ds, int x1, int x2) { if (sclipTop <= backsector->e->XFloor.lightlist[j].plane.Zat0()) { - lightlist_t *lit = &backsector->e->XFloor.lightlist[i]; + lightlist_t *lit = &backsector->e->XFloor.lightlist[j]; basecolormap = lit->extra_colormap; wallshade = LIGHT2SHADE(curline->sidedef->GetLightLevel(foggy, *lit->p_lightlevel, lit->lightsource == NULL) + r_actualextralight); break; From c5cba70fc8280c51d811991f5b967a2c0c881c64 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 11 Aug 2013 13:36:48 +0200 Subject: [PATCH 11/28] - removed obsolete quit message #defines. --- src/gstrings.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/gstrings.h b/src/gstrings.h index 41e37dbc5..770510cfd 100644 --- a/src/gstrings.h +++ b/src/gstrings.h @@ -42,11 +42,6 @@ extern FStringTable GStrings; -// QuitGame messages -#define NUM_QUITDOOMMESSAGES 14 -#define NUM_QUITSTRIFEMESSAGES 8 -#define NUM_QUITCHEXMESSAGES 7 - extern const char *endmsg[]; From 35764ff3b2ff7dfbce4ddc29780f2de8ba70368f Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 11 Aug 2013 20:39:53 +0200 Subject: [PATCH 12/28] - fixed: Powerup.Strength is a fixed point value, so using it as health amount for PowerRegeneration requires division by FRACUNIT. --- src/g_shared/a_artifacts.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/g_shared/a_artifacts.cpp b/src/g_shared/a_artifacts.cpp index e05f6071a..5c8cd9614 100644 --- a/src/g_shared/a_artifacts.cpp +++ b/src/g_shared/a_artifacts.cpp @@ -1697,7 +1697,7 @@ void APowerRegeneration::DoEffect() { if (Owner != NULL && Owner->health > 0 && (level.time & 31) == 0) { - if (P_GiveBody(Owner, Strength)) + if (P_GiveBody(Owner, Strength/FRACUNIT)) { S_Sound(Owner, CHAN_ITEM, "*regenerate", 1, ATTN_NORM ); } From c0174ea7cdc373ba0b726cfe855465f387a5bc37 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 11 Aug 2013 20:48:08 +0200 Subject: [PATCH 13/28] - Added A_DropItem for DECORATE. --- src/thingdef/thingdef_codeptr.cpp | 16 ++++++++++++++++ wadsrc/static/actors/actor.txt | 1 + 2 files changed, 17 insertions(+) diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index 476c29eaf..456a1d6e3 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -4951,3 +4951,19 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetDamageType) self->DamageType = damagetype; } + +//========================================================================== +// +// A_DropItem +// +//========================================================================== + +DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DropItem) +{ + ACTION_PARAM_START(3); + ACTION_PARAM_CLASS(spawntype, 0); + ACTION_PARAM_INT(amount, 1); + ACTION_PARAM_INT(chance, 2); + + P_DropItem(self, spawntype, amount, chance); +} diff --git a/wadsrc/static/actors/actor.txt b/wadsrc/static/actors/actor.txt index 0ea018422..31051a1a1 100644 --- a/wadsrc/static/actors/actor.txt +++ b/wadsrc/static/actors/actor.txt @@ -300,6 +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 item, int dropamount = -1, int chance = -1); action native A_CheckSightOrRange(float distance, state label); action native A_CheckRange(float distance, state label); From 1b2d8420bb7b83654bb8d1debe3b6222bd48007e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 11 Aug 2013 20:57:53 +0200 Subject: [PATCH 14/28] - DropItem for ACS. --- src/p_acs.cpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 4cb949539..8a015bae4 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -46,6 +46,7 @@ #include "p_acs.h" #include "p_saveg.h" #include "p_lnspec.h" +#include "p_enemy.h" #include "m_random.h" #include "doomstat.h" #include "c_console.h" @@ -4233,6 +4234,7 @@ enum EACSFunctions ACSF_PlayActorSound, ACSF_SpawnDecal, ACSF_CheckFont, + ACSF_DropItem, // ZDaemon ACSF_GetTeamScore = 19620, // (int team) @@ -5235,6 +5237,39 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound) // bool CheckFont(str fontname) return V_GetFont(FBehavior::StaticLookupString(args[0])) != NULL; + case ACSF_DropItem: + { + const char *type = FBehavior::StaticLookupString(args[1]); + int amount = argCount >= 3? args[2] : -1; + int chance = argCount >= 4? args[3] : -1; + const PClass *cls = PClass::FindClass(type); + int cnt = 0; + if (cls != NULL) + { + if (args[0] == 0) + { + if (activator != NULL) + { + P_DropItem(activator, cls, amount, chance); + cnt++; + } + } + else + { + FActorIterator it(args[0]); + AActor *actor; + + while ((actor = it.Next()) != NULL) + { + P_DropItem(actor, cls, amount, chance); + cnt++; + } + } + return cnt; + } + break; + } + default: break; } From 33005664933ca883306c9336ee9c3ce99d5029b9 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 12 Aug 2013 01:54:45 +0200 Subject: [PATCH 15/28] - P_DropItem's chance parameter had an incorrect default value. --- wadsrc/static/actors/actor.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wadsrc/static/actors/actor.txt b/wadsrc/static/actors/actor.txt index 31051a1a1..3ba47a5c1 100644 --- a/wadsrc/static/actors/actor.txt +++ b/wadsrc/static/actors/actor.txt @@ -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 item, int dropamount = -1, int chance = -1); + action native A_DropItem(class item, int dropamount = -1, int chance = 256); action native A_CheckSightOrRange(float distance, state label); action native A_CheckRange(float distance, state label); From ecfe67dd788f957a5017da0d7a45039aa7fa767e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 12 Aug 2013 09:13:55 +0200 Subject: [PATCH 16/28] - removed weirdness from Powerup.Strength property that was specifically tailored to its use on PowerInvisibility and made its use problematic elsewhere. --- src/g_shared/a_artifacts.cpp | 6 +++--- src/thingdef/thingdef_properties.cpp | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/g_shared/a_artifacts.cpp b/src/g_shared/a_artifacts.cpp index 5c8cd9614..2ef2b03c5 100644 --- a/src/g_shared/a_artifacts.cpp +++ b/src/g_shared/a_artifacts.cpp @@ -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((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((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((OPAQUE - Strength), 0, OPAQUE); + vis->alpha = clamp((OPAQUE - (Strength/100)), 0, OPAQUE); vis->colormap = SpecialColormaps[INVERSECOLORMAP].Colormap; } return -1; // This item is valid so another one shouldn't reset the translucency diff --git a/src/thingdef/thingdef_properties.cpp b/src/thingdef/thingdef_properties.cpp index fcb3bc2ef..dc08db361 100644 --- a/src/thingdef/thingdef_properties.cpp +++ b/src/thingdef/thingdef_properties.cpp @@ -2113,9 +2113,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; } //========================================================================== From f2c250d35df2db2ca7a69aead7fc97588d1d83a5 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 12 Aug 2013 20:09:21 +0200 Subject: [PATCH 17/28] - flags7 variable added to AActor. --- src/actor.h | 1 + src/m_cheat.cpp | 1 + src/p_enemy.cpp | 1 + src/p_mobj.cpp | 11 +++++++++-- src/p_things.cpp | 1 + src/thingdef/thingdef_properties.cpp | 3 ++- src/version.h | 2 +- 7 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/actor.h b/src/actor.h index 768008182..d06e968f7 100644 --- a/src/actor.h +++ b/src/actor.h @@ -837,6 +837,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; diff --git a/src/m_cheat.cpp b/src/m_cheat.cpp index 07c467bac..5d9d48bea 100644 --- a/src/m_cheat.cpp +++ b/src/m_cheat.cpp @@ -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; diff --git a/src/p_enemy.cpp b/src/p_enemy.cpp index 81a58ac15..5df2b4b5e 100644 --- a/src/p_enemy.cpp +++ b/src/p_enemy.cpp @@ -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; diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 14607a682..34100c935 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -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 @@ -6133,6 +6137,9 @@ void PrintMiscActorInfo(AActor *query) Printf("\n\tflags6: %x", query->flags6); for (flagi = 0; flagi <= 31; flagi++) if (query->flags6 & 1<flags7); + for (flagi = 0; flagi <= 31; flagi++) + if (query->flags7 & 1<BounceFlags, FIXED2FLOAT(query->bouncefactor), FIXED2FLOAT(query->wallbouncefactor)); diff --git a/src/p_things.cpp b/src/p_things.cpp index a0f905a7f..4828e8cbc 100644 --- a/src/p_things.cpp +++ b/src/p_things.cpp @@ -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; diff --git a/src/thingdef/thingdef_properties.cpp b/src/thingdef/thingdef_properties.cpp index dc08db361..262846bf2 100644 --- a/src/thingdef/thingdef_properties.cpp +++ b/src/thingdef/thingdef_properties.cpp @@ -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 } diff --git a/src/version.h b/src/version.h index 01fbc7a88..0c62c5ef2 100644 --- a/src/version.h +++ b/src/version.h @@ -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) From 44a1b94ad9bd67496b0cbfe508c603ecb4f13df1 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 12 Aug 2013 20:23:54 +0200 Subject: [PATCH 18/28] - added MF6_NOTELESTOMP flag that prevents an actor from telefragging under all possible circumstances. --- src/actor.h | 7 ++++--- src/p_map.cpp | 3 +-- src/thingdef/thingdef_data.cpp | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/actor.h b/src/actor.h index d06e968f7..98210753a 100644 --- a/src/actor.h +++ b/src/actor.h @@ -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 @@ -332,6 +332,7 @@ enum MF6_INTRYMOVE = 0x10000000, // Executing P_TryMove MF6_NOTAUTOAIMED = 0x20000000, // Do not subject actor to player autoaim. MF6_NOTONAUTOMAP = 0x40000000, // will not be shown on automap with the 'scanner' powerup. + MF6_NOTELESTOMP = 0x80000000, // cannot telefrag under any circumstances (even when set by MAPINFO) // --- mobj.renderflags --- diff --git a/src/p_map.cpp b/src/p_map.cpp index da87481d0..a892c4a95 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -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->flags6 & MF6_NOTELESTOMP); FBoundingBox box(x, y, thing->radius); FBlockLinesIterator it(box); diff --git a/src/thingdef/thingdef_data.cpp b/src/thingdef/thingdef_data.cpp index ef0cf2fe1..938c48e45 100644 --- a/src/thingdef/thingdef_data.cpp +++ b/src/thingdef/thingdef_data.cpp @@ -235,6 +235,7 @@ static FFlagDef ActorFlags[]= DEFINE_FLAG(MF6, POISONALWAYS, AActor, flags6), DEFINE_FLAG(MF6, NOTAUTOAIMED, AActor, flags6), DEFINE_FLAG(MF6, NOTONAUTOMAP, AActor, flags6), + DEFINE_FLAG(MF6, NOTELESTOMP, AActor, flags6), // Effect flags DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects), From e14590d8ced826c6301e31e9908927a4657d5293 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 12 Aug 2013 20:41:33 +0200 Subject: [PATCH 19/28] - moved NOTELESTOMP to flags7. When committing I was accidentally on maint instead of master and in master flags6 was already full. --- src/actor.h | 6 +++++- src/p_interaction.cpp | 3 +++ src/p_map.cpp | 2 +- src/p_mobj.cpp | 2 +- src/thingdef/thingdef_data.cpp | 4 +++- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/actor.h b/src/actor.h index 98210753a..5a3298488 100644 --- a/src/actor.h +++ b/src/actor.h @@ -332,7 +332,11 @@ enum MF6_INTRYMOVE = 0x10000000, // Executing P_TryMove MF6_NOTAUTOAIMED = 0x20000000, // Do not subject actor to player autoaim. MF6_NOTONAUTOMAP = 0x40000000, // will not be shown on automap with the 'scanner' powerup. - MF6_NOTELESTOMP = 0x80000000, // cannot telefrag under any circumstances (even when set by MAPINFO) + +// --- 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 --- diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index 0ee955a82..47ed87888 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -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 diff --git a/src/p_map.cpp b/src/p_map.cpp index a892c4a95..3c7370f02 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -334,7 +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) && !(thing->flags6 & MF6_NOTELESTOMP); + bool StompAlwaysFrags = ((thing->flags2 & MF2_TELESTOMP) || (level.flags & LEVEL_MONSTERSTELEFRAG) || telefrag) && !(thing->flags7 & MF7_NOTELESTOMP); FBoundingBox box(x, y, thing->radius); FBlockLinesIterator it(box); diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 34100c935..a2addad0e 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -830,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; diff --git a/src/thingdef/thingdef_data.cpp b/src/thingdef/thingdef_data.cpp index 938c48e45..e4c166761 100644 --- a/src/thingdef/thingdef_data.cpp +++ b/src/thingdef/thingdef_data.cpp @@ -235,7 +235,9 @@ static FFlagDef ActorFlags[]= DEFINE_FLAG(MF6, POISONALWAYS, AActor, flags6), DEFINE_FLAG(MF6, NOTAUTOAIMED, AActor, flags6), DEFINE_FLAG(MF6, NOTONAUTOMAP, AActor, flags6), - DEFINE_FLAG(MF6, NOTELESTOMP, AActor, flags6), + + DEFINE_FLAG(MF7, NEVERTARGET, AActor, flags7), + DEFINE_FLAG(MF7, NOTELESTOMP, AActor, flags7), // Effect flags DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects), From aa03609b69406c0742a0c7ff174272df2584d931 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 12 Aug 2013 21:00:23 +0200 Subject: [PATCH 20/28] - added IF_TOSSED inventory flag. --- src/g_shared/a_pickups.h | 2 ++ src/p_enemy.cpp | 1 + src/thingdef/thingdef_data.cpp | 1 + 3 files changed, 4 insertions(+) diff --git a/src/g_shared/a_pickups.h b/src/g_shared/a_pickups.h index 6c68990d1..22d1e009f 100644 --- a/src/g_shared/a_pickups.h +++ b/src/g_shared/a_pickups.h @@ -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) + }; diff --git a/src/p_enemy.cpp b/src/p_enemy.cpp index 5df2b4b5e..437940d03 100644 --- a/src/p_enemy.cpp +++ b/src/p_enemy.cpp @@ -3088,6 +3088,7 @@ AInventory *P_DropItem (AActor *source, const PClass *type, int dropamount, int { AInventory * inv = static_cast(mo); ModifyDropAmount(inv, dropamount); + inv->ItemFlags |= IF_TOSSED; if (inv->SpecialDropAction (source)) { // The special action indicates that the item should not spawn diff --git a/src/thingdef/thingdef_data.cpp b/src/thingdef/thingdef_data.cpp index 1f1c6ec00..57dd363c8 100644 --- a/src/thingdef/thingdef_data.cpp +++ b/src/thingdef/thingdef_data.cpp @@ -308,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),}; From 072b66fb9fecc14e4772098993a3fd7d41aa3d50 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 12 Aug 2013 21:11:53 +0200 Subject: [PATCH 21/28] - fixed: The music that's defined in the Gameinfo section of MAPINFO could not set the order for multitrack music lumps. --- src/d_main.cpp | 2 +- src/gi.cpp | 20 +++++++++++++++++--- src/gi.h | 3 +++ src/intermission/intermission.cpp | 2 +- src/wi_stuff.cpp | 2 +- 5 files changed, 23 insertions(+), 6 deletions(-) diff --git a/src/d_main.cpp b/src/d_main.cpp index 6c92babe4..ae1c5144d 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -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 (); diff --git a/src/gi.cpp b/src/gi.cpp index 75476c800..d9d58dc9e 100644 --- a/src/gi.cpp +++ b/src/gi.cpp @@ -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") diff --git a/src/gi.h b/src/gi.h index ff678df07..6b887e1dd 100644 --- a/src/gi.h +++ b/src/gi.h @@ -91,11 +91,13 @@ struct gameinfo_t TArray 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; diff --git a/src/intermission/intermission.cpp b/src/intermission/intermission.cpp index 6ee67006e..91090e432 100644 --- a/src/intermission/intermission.cpp +++ b/src/intermission/intermission.cpp @@ -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 { diff --git a/src/wi_stuff.cpp b/src/wi_stuff.cpp index 37b418ce9..6ae9148af 100644 --- a/src/wi_stuff.cpp +++ b/src/wi_stuff.cpp @@ -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); } From 61c94648dca658117f4d837bb55e9bd6f01b8b21 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 12 Aug 2013 22:38:52 +0200 Subject: [PATCH 22/28] - added ACS CheckFlag function. --- src/p_acs.cpp | 11 +++++++++++ src/thingdef/thingdef.h | 1 + src/thingdef/thingdef_codeptr.cpp | 26 ++------------------------ src/thingdef/thingdef_properties.cpp | 27 +++++++++++++++++++++++++++ 4 files changed, 41 insertions(+), 24 deletions(-) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 8a015bae4..bb92b42bd 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -4235,6 +4235,7 @@ enum EACSFunctions ACSF_SpawnDecal, ACSF_CheckFont, ACSF_DropItem, + ACSF_CheckFlag, // ZDaemon ACSF_GetTeamScore = 19620, // (int team) @@ -5270,6 +5271,16 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound) break; } + case ACSF_CheckFlag: + { + AActor *actor = SingleActorFromTID(args[0], activator); + if (actor != NULL) + { + return !!CheckActorFlag(actor, FBehavior::StaticLookupString(args[1])); + } + break; + } + default: break; } diff --git a/src/thingdef/thingdef.h b/src/thingdef/thingdef.h index 63d04ea29..c388a8544 100644 --- a/src/thingdef/thingdef.h +++ b/src/thingdef/thingdef.h @@ -31,6 +31,7 @@ bool CheckDeprecatedFlags(const AActor *actor, FActorInfo *info, int index); const char *GetFlagName(unsigned int flagnum, int flagoffset); void ModActorFlag(AActor *actor, FFlagDef *fd, bool set); INTBOOL CheckActorFlag(const AActor *actor, FFlagDef *fd); +INTBOOL CheckActorFlag(const AActor *owner, const char *flagname, bool printerror = true); #define FLAG_NAME(flagnum, flagvar) GetFlagName(flagnum, myoffsetof(AActor, flagvar)) diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index 456a1d6e3..7964c422b 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -3777,32 +3777,10 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckFlag) COPY_AAPTR_NOT_NULL(self, owner, checkpointer); - const char *dot = strchr (flagname, '.'); - FFlagDef *fd; - const PClass *cls = owner->GetClass(); - - if (dot != NULL) + if (CheckActorFlag(owner, flagname)) { - FString part1(flagname, dot-flagname); - fd = FindFlag (cls, part1, dot+1); + ACTION_JUMP(jumpto); } - else - { - fd = FindFlag (cls, flagname, NULL); - } - - if (fd != NULL) - { - if (CheckActorFlag(owner, fd)) - { - ACTION_JUMP(jumpto); - } - } - else - { - Printf("Unknown flag '%s' in '%s'\n", flagname, cls->TypeName.GetChars()); - } - } diff --git a/src/thingdef/thingdef_properties.cpp b/src/thingdef/thingdef_properties.cpp index 2c0abee17..d6731aafa 100644 --- a/src/thingdef/thingdef_properties.cpp +++ b/src/thingdef/thingdef_properties.cpp @@ -180,6 +180,33 @@ INTBOOL CheckActorFlag(const AActor *owner, FFlagDef *fd) #endif } +INTBOOL CheckActorFlag(const AActor *owner, const char *flagname, bool printerror) +{ + const char *dot = strchr (flagname, '.'); + FFlagDef *fd; + const PClass *cls = owner->GetClass(); + + if (dot != NULL) + { + FString part1(flagname, dot-flagname); + fd = FindFlag (cls, part1, dot+1); + } + else + { + fd = FindFlag (cls, flagname, NULL); + } + + if (fd != NULL) + { + return CheckActorFlag(owner, fd); + } + else + { + if (printerror) Printf("Unknown flag '%s' in '%s'\n", flagname, cls->TypeName.GetChars()); + return false; + } +} + //=========================================================================== // // HandleDeprecatedFlags From 3518b4dd28a4c1bbf1f39ea31f63926b221683c6 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 12 Aug 2013 22:46:45 +0200 Subject: [PATCH 23/28] - allow menu's back button and the pause sign to be animated. --- src/d_main.cpp | 2 +- src/menu/menu.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/d_main.cpp b/src/d_main.cpp index 75a616bf4..b70e5d779 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -855,7 +855,7 @@ void D_Display () FTexture *tex; int x; - tex = TexMan[gameinfo.PauseSign]; + tex = TexMan(gameinfo.PauseSign); x = (SCREENWIDTH - tex->GetScaledWidth() * CleanXfac)/2 + tex->GetScaledLeftOffset() * CleanXfac; screen->DrawTexture (tex, x, 4, DTA_CleanNoMove, true, TAG_DONE); diff --git a/src/menu/menu.cpp b/src/menu/menu.cpp index dc1b8ccd8..dd25c9e0b 100644 --- a/src/menu/menu.cpp +++ b/src/menu/menu.cpp @@ -207,7 +207,7 @@ bool DMenu::MouseEventBack(int type, int x, int y) { if (m_show_backbutton >= 0) { - FTexture *tex = TexMan[gameinfo.mBackButton]; + FTexture *tex = TexMan(gameinfo.mBackButton); if (tex != NULL) { if (m_show_backbutton&1) x -= screen->GetWidth() - tex->GetScaledWidth() * CleanXfac; @@ -263,7 +263,7 @@ void DMenu::Drawer () { if (this == DMenu::CurrentMenu && BackbuttonAlpha > 0 && m_show_backbutton >= 0 && m_use_mouse) { - FTexture *tex = TexMan[gameinfo.mBackButton]; + FTexture *tex = TexMan(gameinfo.mBackButton); int w = tex->GetScaledWidth() * CleanXfac; int h = tex->GetScaledHeight() * CleanYfac; int x = (!(m_show_backbutton&1))? 0:screen->GetWidth() - w; From 1b79f7d956bf6abf1a21e9f205b067ae644fd383 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 13 Aug 2013 08:52:53 +0200 Subject: [PATCH 24/28] - fixed chance default for ACS's DropItem. --- src/p_acs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 8a015bae4..dc696ca45 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -5241,7 +5241,7 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound) { const char *type = FBehavior::StaticLookupString(args[1]); int amount = argCount >= 3? args[2] : -1; - int chance = argCount >= 4? args[3] : -1; + int chance = argCount >= 4? args[3] : 256; const PClass *cls = PClass::FindClass(type); int cnt = 0; if (cls != NULL) From 7a87e08107511228c05ef6387109eed3ab6fb469 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 13 Aug 2013 21:01:14 +0200 Subject: [PATCH 25/28] - added MF7_ALWAYSTELEFRAG flag that causes an actor to be telefragged by everything that teleports into the same place. --- src/actor.h | 1 + src/p_map.cpp | 3 ++- src/thingdef/thingdef_data.cpp | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/actor.h b/src/actor.h index 17c00041b..c60b6a516 100644 --- a/src/actor.h +++ b/src/actor.h @@ -338,6 +338,7 @@ enum 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) + MF7_ALWAYSTELEFRAG = 0x00000004, // will unconditionally be telefragged when in the way. Overrides all other settings. // --- mobj.renderflags --- diff --git a/src/p_map.cpp b/src/p_map.cpp index 442e77876..1b5c31167 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -382,7 +382,8 @@ bool P_TeleportMove (AActor *thing, fixed_t x, fixed_t y, fixed_t z, bool telefr // monsters don't stomp things except on boss level // [RH] Some Heretic/Hexen monsters can telestomp - if (StompAlwaysFrags && !(th->flags6 & MF6_NOTELEFRAG)) + // ... and some items can never be telefragged while others will be telefragged by everything that teleports upon them. + if ((StompAlwaysFrags && !(th->flags6 & MF6_NOTELEFRAG)) || (th->flags7 & MF7_ALWAYSTELEFRAG)) { P_DamageMobj (th, thing, thing, TELEFRAG_DAMAGE, NAME_Telefrag, DMG_THRUSTLESS); continue; diff --git a/src/thingdef/thingdef_data.cpp b/src/thingdef/thingdef_data.cpp index 57dd363c8..bf0bf2e13 100644 --- a/src/thingdef/thingdef_data.cpp +++ b/src/thingdef/thingdef_data.cpp @@ -239,6 +239,7 @@ static FFlagDef ActorFlags[]= DEFINE_FLAG(MF7, NEVERTARGET, AActor, flags7), DEFINE_FLAG(MF7, NOTELESTOMP, AActor, flags7), + DEFINE_FLAG(MF7, ALWAYSTELEFRAG, AActor, flags7), // Effect flags DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects), From c8b4fb0d3dd782ca9974c436d2d44b5325e1515d Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 13 Aug 2013 21:09:46 +0200 Subject: [PATCH 26/28] - added a 'closemenu' CCMD so that menu options that close the menu can be added. --- src/menu/menu.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/menu/menu.cpp b/src/menu/menu.cpp index dd25c9e0b..d01f0807f 100644 --- a/src/menu/menu.cpp +++ b/src/menu/menu.cpp @@ -909,6 +909,11 @@ CCMD (openmenu) M_SetMenu(argv[1], -1); } +CCMD (closemenu) +{ + M_ClearMenus(); +} + // // Toggle messages on/off // From 62830f7927c8f1a8aa2d387237f66b5acaf4b17f Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 14 Aug 2013 00:32:05 +0200 Subject: [PATCH 27/28] - added separate automap color for non-counting monsters. - fixed: using a nonexistent CVAR in a ColorPicker menu item caused a crash. --- src/am_map.cpp | 12 +++++++++++- src/menu/optionmenuitems.h | 2 +- wadsrc/static/menudef.txt | 2 ++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/am_map.cpp b/src/am_map.cpp index c9e88c70b..c22714316 100644 --- a/src/am_map.cpp +++ b/src/am_map.cpp @@ -115,6 +115,7 @@ CVAR (Color, am_interlevelcolor, 0xff0000, CVAR_ARCHIVE); CVAR (Color, am_secretsectorcolor, 0xff00ff, CVAR_ARCHIVE); CVAR (Color, am_thingcolor_friend, 0xfcfcfc, CVAR_ARCHIVE); CVAR (Color, am_thingcolor_monster, 0xfcfcfc, CVAR_ARCHIVE); +CVAR (Color, am_thingcolor_ncmonster, 0xfcfcfc, CVAR_ARCHIVE); CVAR (Color, am_thingcolor_item, 0xfcfcfc, CVAR_ARCHIVE); CVAR (Color, am_thingcolor_citem, 0xfcfcfc, CVAR_ARCHIVE); @@ -134,6 +135,7 @@ CVAR (Color, am_ovsecretsectorcolor,0x00ffff, CVAR_ARCHIVE); CVAR (Color, am_ovthingcolor, 0xe88800, CVAR_ARCHIVE); CVAR (Color, am_ovthingcolor_friend, 0xe88800, CVAR_ARCHIVE); CVAR (Color, am_ovthingcolor_monster, 0xe88800, CVAR_ARCHIVE); +CVAR (Color, am_ovthingcolor_ncmonster, 0xe88800, CVAR_ARCHIVE); CVAR (Color, am_ovthingcolor_item, 0xe88800, CVAR_ARCHIVE); CVAR (Color, am_ovthingcolor_citem, 0xe88800, CVAR_ARCHIVE); @@ -190,6 +192,7 @@ static const char *ColorNames[] = { "ThingColor_Item", "ThingColor_CountItem", "ThingColor_Monster", + "ThingColor_NocountMonster", "ThingColor_Friend", "SpecialWallColor", "SecretWallColor", @@ -219,6 +222,7 @@ struct AMColorset ThingColor_Item, ThingColor_CountItem, ThingColor_Monster, + ThingColor_NocountMonster, ThingColor_Friend, SpecialWallColor, SecretWallColor, @@ -318,6 +322,7 @@ static FColorCVar *cv_standard[] = { &am_thingcolor_item, &am_thingcolor_citem, &am_thingcolor_monster, + &am_thingcolor_ncmonster, &am_thingcolor_friend, &am_specialwallcolor, &am_secretwallcolor, @@ -342,6 +347,7 @@ static FColorCVar *cv_overlay[] = { &am_ovthingcolor_item, &am_ovthingcolor_citem, &am_ovthingcolor_monster, + &am_ovthingcolor_ncmonster, &am_ovthingcolor_friend, &am_ovspecialwallcolor, &am_ovsecretwallcolor, @@ -368,6 +374,7 @@ static unsigned char DoomColors[]= { 0x74,0xfc,0x6c, // thingcolor_item 0x74,0xfc,0x6c, // thingcolor_citem 0x74,0xfc,0x6c, // thingcolor_monster + 0x74,0xfc,0x6c, // thingcolor_ncmonster 0x74,0xfc,0x6c, // thingcolor_friend NOT_USED, // specialwallcolor NOT_USED, // secretwallcolor @@ -393,6 +400,7 @@ static unsigned char StrifeColors[]= { 219, 171, 0, // thingcolor_item 219, 171, 0, // thingcolor_citem 0xfc,0x00,0x00, // thingcolor_monster + 0xfc,0x00,0x00, // thingcolor_ncmonster 0xfc,0x00,0x00, // thingcolor_friend NOT_USED, // specialwallcolor NOT_USED, // secretwallcolor @@ -418,6 +426,7 @@ static unsigned char RavenColors[]= { 236, 236, 236, // thingcolor_item 236, 236, 236, // thingcolor_citem 236, 236, 236, // thingcolor_monster + 236, 236, 236, // thingcolor_ncmonster 236, 236, 236, // thingcolor_friend NOT_USED, // specialwallcolor NOT_USED, // secretwallcolor @@ -2669,7 +2678,8 @@ void AM_drawThings () // use separate colors for special thing types if (t->flags3&MF3_ISMONSTER && !(t->flags&MF_CORPSE)) { - if (t->flags & MF_FRIENDLY || !(t->flags & MF_COUNTKILL)) color = AMColors[AMColors.ThingColor_Friend]; + if (t->flags & MF_FRIENDLY) color = AMColors[AMColors.ThingColor_Friend]; + else if (!(t->flags & MF_COUNTKILL)) color = AMColors[AMColors.ThingColor_NocountMonster]; else color = AMColors[AMColors.ThingColor_Monster]; } else if (t->flags&MF_SPECIAL) diff --git a/src/menu/optionmenuitems.h b/src/menu/optionmenuitems.h index d57e13d05..ff3eb016a 100644 --- a/src/menu/optionmenuitems.h +++ b/src/menu/optionmenuitems.h @@ -763,7 +763,7 @@ public: : FOptionMenuItem(label, menu) { FBaseCVar *cv = FindCVar(menu, NULL); - if (cv->GetRealType() == CVAR_Color) + if (cv != NULL && cv->GetRealType() == CVAR_Color) { mCVar = (FColorCVar*)cv; } diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index b2a46469a..6457051bf 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -1019,6 +1019,7 @@ OptionMenu MapColorMenu ColorPicker "Secret walls", "am_secretwallcolor" ColorPicker "Actors", "am_thingcolor" ColorPicker "Monsters", "am_thingcolor_monster" + ColorPicker "non-counting Monsters", "am_thingcolor_ncmonster" ColorPicker "Friends", "am_thingcolor_friend" ColorPicker "Items", "am_thingcolor_item" ColorPicker "Count Items", "am_thingcolor_citem" @@ -1041,6 +1042,7 @@ OptionMenu MapColorMenu ColorPicker "Secret walls", "am_ovsecretwallcolor" ColorPicker "Actors", "am_ovthingcolor" ColorPicker "Monsters", "am_ovthingcolor_monster" + ColorPicker "non-counting Monsters", "am_ovthingcolor_ncmonster" ColorPicker "Friends", "am_ovthingcolor_friend" ColorPicker "Items", "am_ovthingcolor_item" ColorPicker "Count Items", "am_ovthingcolor_citem" From 116defbb35d8cc472a21de7656f0b24c23af832e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 18 Aug 2013 09:11:40 +0200 Subject: [PATCH 28/28] - fixed: LookForEnemiesInBlock needs to check for MF7_NEVERTARGET. --- src/p_enemy.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/p_enemy.cpp b/src/p_enemy.cpp index 437940d03..fa39297e6 100644 --- a/src/p_enemy.cpp +++ b/src/p_enemy.cpp @@ -1425,6 +1425,9 @@ AActor *LookForEnemiesInBlock (AActor *lookee, int index, void *extparam) if (!(link->flags3 & MF3_ISMONSTER)) continue; // don't target it if it isn't a monster (could be a barrel) + if (link->flags7 & MF7_NEVERTARGET) + continue; + other = NULL; if (link->flags & MF_FRIENDLY) {