From 1b79f7d956bf6abf1a21e9f205b067ae644fd383 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 13 Aug 2013 08:52:53 +0200 Subject: [PATCH 1/4] - 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 2/4] - 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 3/4] - 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 4/4] - 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"