diff --git a/extras/conf/udb/Includes/SRB222_things.cfg b/extras/conf/udb/Includes/SRB222_things.cfg index 318981f18..7032dcca5 100644 --- a/extras/conf/udb/Includes/SRB222_things.cfg +++ b/extras/conf/udb/Includes/SRB222_things.cfg @@ -7107,6 +7107,21 @@ udmf title = "Flickies"; width = 8; height = 20; + arg0 + { + title = "Radius"; + } + arg1 + { + title = "Flags"; + type = 12; + enum + { + 1 = "Move aimlessly"; + 2 = "No movement"; + 4 = "Hop"; + } + } 2200 { @@ -7147,6 +7162,30 @@ udmf { title = "Fish"; sprite = "FL08A1"; + arg2 + { + title = "Color"; + type = 11; + enum + { + 0 = "Random"; + 1 = "Red"; + 2 = "Cyan"; + 3 = "Blue"; + 4 = "Vapor"; + 5 = "Purple"; + 6 = "Bubblegum"; + 7 = "Neon"; + 8 = "Black"; + 9 = "Beige"; + 10 = "Lavender"; + 11 = "Ruby"; + 12 = "Salmon"; + 13 = "Sunset"; + 14 = "Orange"; + 15 = "Yellow"; + } + } } 2208 { diff --git a/src/p_enemy.c b/src/p_enemy.c index 7e00ad91d..27f169e20 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -11690,7 +11690,7 @@ void A_FlickySpawn(mobj_t *actor) } // Internal Flicky color setting -void P_InternalFlickySetColor(mobj_t *actor, UINT8 extrainfo) +void P_InternalFlickySetColor(mobj_t *actor, UINT8 color) { UINT8 flickycolors[] = { SKINCOLOR_RED, @@ -11710,11 +11710,11 @@ void P_InternalFlickySetColor(mobj_t *actor, UINT8 extrainfo) SKINCOLOR_YELLOW, }; - if (extrainfo == 0) + if (color == 0) // until we can customize flicky colors by level header, just stick to SRB2's defaults actor->color = flickycolors[P_RandomKey(2)]; //flickycolors[P_RandomKey(sizeof(flickycolors))]; else - actor->color = flickycolors[min(extrainfo-1, 14)]; // sizeof(flickycolors)-1 + actor->color = flickycolors[min(color-1, 14)]; // sizeof(flickycolors)-1 } // Function: A_FlickyCenter @@ -11724,17 +11724,17 @@ void P_InternalFlickySetColor(mobj_t *actor, UINT8 extrainfo) // var1: // Lower 16 bits = if 0, spawns random flicky based on level header. Else, spawns the designated thing type. // Bits 17-20 = Flicky color, up to 15. Applies to fish. -// Bit 21 = Flag MF_SLIDEME (see below) -// Bit 22 = Flag MF_GRENADEBOUNCE (see below) -// Bit 23 = Flag MF_NOCLIPTHING (see below) +// Bit 21 = Flag TMFF_AIMLESS (see below) +// Bit 22 = Flag TMFF_STATIONARY (see below) +// Bit 23 = Flag TMFF_HOP (see below) // // If actor is placed from a spawnpoint (map Thing), the Thing's properties take precedence. // -// var2 = maximum default distance away from spawn the flickies are allowed to travel. If angle != 0, then that's the radius. +// var2 = maximum default distance away from spawn the flickies are allowed to travel. If args[0] != 0, then that's the radius. // -// If MTF_EXTRA (MF_SLIDEME): is flagged, Flickies move aimlessly. Else, orbit around the target. -// If MTF_OBJECTSPECIAL (MF_GRENADEBOUNCE): Flickies stand in-place without gravity (unless they hop, then gravity is applied.) -// If MTF_AMBUSH (MF_NOCLIPTHING): is flagged, Flickies hop. +// If TMFF_AIMLESS (MF_SLIDEME): is flagged, Flickies move aimlessly. Else, orbit around the target. +// If TMFF_STATIONARY (MF_GRENADEBOUNCE): Flickies stand in-place without gravity (unless they hop, then gravity is applied.) +// If TMFF_HOP (MF_NOCLIPTHING): is flagged, Flickies hop. // void A_FlickyCenter(mobj_t *actor) { @@ -11756,14 +11756,15 @@ void A_FlickyCenter(mobj_t *actor) if (actor->spawnpoint) { actor->flags &= ~(MF_SLIDEME|MF_GRENADEBOUNCE|MF_NOCLIPTHING); - actor->flags |= ( - ((actor->spawnpoint->options & MTF_EXTRA) ? MF_SLIDEME : 0) - | ((actor->spawnpoint->options & MTF_OBJECTSPECIAL) ? MF_GRENADEBOUNCE : 0) - | ((actor->spawnpoint->options & MTF_AMBUSH) ? MF_NOCLIPTHING : 0) - ); - actor->extravalue1 = actor->spawnpoint->angle ? abs(actor->spawnpoint->angle) * FRACUNIT - : locvar2 ? abs(locvar2) : 384 * FRACUNIT; - actor->extravalue2 = actor->spawnpoint->extrainfo; + if (actor->spawnpoint->args[1] & TMFF_AIMLESS) + actor->flags |= MF_SLIDEME; + if (actor->spawnpoint->args[1] & TMFF_STATIONARY) + actor->flags |= MF_GRENADEBOUNCE; + if (actor->spawnpoint->args[1] & TMFF_HOP) + actor->flags |= MF_NOCLIPTHING; + actor->extravalue1 = actor->spawnpoint->args[0] ? abs(actor->spawnpoint->args[0])*FRACUNIT + : locvar2 ? abs(locvar2) : 384*FRACUNIT; + actor->extravalue2 = actor->spawnpoint->args[2]; actor->friction = actor->spawnpoint->x*FRACUNIT; actor->movefactor = actor->spawnpoint->y*FRACUNIT; actor->watertop = actor->spawnpoint->z*FRACUNIT; @@ -11771,11 +11772,12 @@ void A_FlickyCenter(mobj_t *actor) else { actor->flags &= ~(MF_SLIDEME|MF_GRENADEBOUNCE|MF_NOCLIPTHING); - actor->flags |= ( - ((flickyflags & 1) ? MF_SLIDEME : 0) - | ((flickyflags & 2) ? MF_GRENADEBOUNCE : 0) - | ((flickyflags & 4) ? MF_NOCLIPTHING : 0) - ); + if (flickyflags & TMFF_AIMLESS) + actor->flags |= MF_SLIDEME; + if (flickyflags & TMFF_STATIONARY) + actor->flags |= MF_GRENADEBOUNCE; + if (flickyflags & TMFF_HOP) + actor->flags |= MF_NOCLIPTHING; actor->extravalue1 = abs(locvar2); actor->extravalue2 = flickycolor; actor->friction = actor->x; diff --git a/src/p_local.h b/src/p_local.h index bbcd86b39..11a4856cf 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -370,7 +370,7 @@ void P_NewChaseDir(mobj_t *actor); boolean P_LookForPlayers(mobj_t *actor, boolean allaround, boolean tracer, fixed_t dist); mobj_t *P_InternalFlickySpawn(mobj_t *actor, mobjtype_t flickytype, fixed_t momz, boolean lookforplayers, SINT8 moveforward); -void P_InternalFlickySetColor(mobj_t *actor, UINT8 extrainfo); +void P_InternalFlickySetColor(mobj_t *actor, UINT8 color); #define P_IsFlickyCenter(type) (type > MT_FLICKY_01 && type < MT_SEED && (type - MT_FLICKY_01) % 2 ? 1 : 0) void P_InternalFlickyBubble(mobj_t *actor); void P_InternalFlickyFly(mobj_t *actor, fixed_t flyspeed, fixed_t targetdist, fixed_t chasez); diff --git a/src/p_setup.c b/src/p_setup.c index c9237bef8..5e9daa327 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -4885,12 +4885,6 @@ static void P_ConvertBinaryMap(void) for (i = 0; i < nummapthings; i++) { - if (mapthings[i].type >= 1 && mapthings[i].type <= 35) - { - mapthings[i].args[0] = !!(mapthings[i].options & MTF_AMBUSH); - continue; - } - mobjtype = mobjtypeofthing[mapthings[i].type]; if (mobjtype) { @@ -4904,6 +4898,25 @@ static void P_ConvertBinaryMap(void) } } + if (mapthings[i].type >= 1 && mapthings[i].type <= 35) //Player starts + { + mapthings[i].args[0] = !!(mapthings[i].options & MTF_AMBUSH); + continue; + } + else if (mapthings[i].type >= 2200 && mapthings[i].type <= 2217) //Flickies + { + mapthings[i].args[0] = mapthings[i].angle; + if (mapthings[i].options & MTF_EXTRA) + mapthings[i].args[1] |= TMFF_AIMLESS; + if (mapthings[i].options & MTF_OBJECTSPECIAL) + mapthings[i].args[1] |= TMFF_STATIONARY; + if (mapthings[i].options & MTF_AMBUSH) + mapthings[i].args[1] |= TMFF_HOP; + if (mapthings[i].type == 2207) + mapthings[i].args[2] = mapthings[i].extrainfo; + continue; + } + switch (mapthings[i].type) { case 102: //SDURF diff --git a/src/p_spec.h b/src/p_spec.h index 88dc6d9f8..53d7cd511 100644 --- a/src/p_spec.h +++ b/src/p_spec.h @@ -50,6 +50,13 @@ typedef enum TMSF_INTANGIBLE = 1<<1, } textmapspikeflags_t; +typedef enum +{ + TMFF_AIMLESS = 1, + TMFF_STATIONARY = 1<<1, + TMFF_HOP = 1<<2, +} textmapflickyflags_t; + //FOF flags typedef enum {