mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-27 06:54:23 -04:00
add 'Dropped item' support (#231)
This commit is contained in:
parent
29050ede4a
commit
9d0a051c43
@ -977,7 +977,7 @@ typedef struct
|
|||||||
// killough 8/9/98: make DEH_BLOCKMAX self-adjusting
|
// killough 8/9/98: make DEH_BLOCKMAX self-adjusting
|
||||||
#define DEH_BLOCKMAX (sizeof deh_blocks/sizeof*deh_blocks) // size of array
|
#define DEH_BLOCKMAX (sizeof deh_blocks/sizeof*deh_blocks) // size of array
|
||||||
#define DEH_MAXKEYLEN 32 // as much of any key as we'll look at
|
#define DEH_MAXKEYLEN 32 // as much of any key as we'll look at
|
||||||
#define DEH_MOBJINFOMAX 31 // number of mobjinfo configuration keys
|
#define DEH_MOBJINFOMAX 32 // number of mobjinfo configuration keys
|
||||||
|
|
||||||
// Put all the block header values, and the function to be called when that
|
// Put all the block header values, and the function to be called when that
|
||||||
// one is encountered, in this array:
|
// one is encountered, in this array:
|
||||||
@ -1048,6 +1048,9 @@ char *deh_mobjinfo[DEH_MOBJINFOMAX] =
|
|||||||
|
|
||||||
// [Woof!]
|
// [Woof!]
|
||||||
"Blood color", // .bloodcolor
|
"Blood color", // .bloodcolor
|
||||||
|
|
||||||
|
// DEHEXTRA
|
||||||
|
"Dropped item", // .droppeditem
|
||||||
};
|
};
|
||||||
|
|
||||||
// Strings that are used to indicate flags ("Bits" in mobjinfo)
|
// Strings that are used to indicate flags ("Bits" in mobjinfo)
|
||||||
@ -1912,6 +1915,11 @@ void deh_procThing(DEHFILE *fpin, FILE* fpout, char *line)
|
|||||||
}
|
}
|
||||||
mi->splash_group = mi->splash_group + SG_END;
|
mi->splash_group = mi->splash_group + SG_END;
|
||||||
}
|
}
|
||||||
|
else if (ix == 31)
|
||||||
|
{
|
||||||
|
mobjinfo_t *mi = &mobjinfo[indexnum];
|
||||||
|
mi->droppeditem = (int)(value - 1); // make it base zero (deh is 1-based)
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pix = (int *)&mobjinfo[indexnum];
|
pix = (int *)&mobjinfo[indexnum];
|
||||||
|
@ -1718,6 +1718,8 @@ void D_DoomMain(void)
|
|||||||
mobjinfo[i].meleerange = MELEERANGE;
|
mobjinfo[i].meleerange = MELEERANGE;
|
||||||
// [Woof!]
|
// [Woof!]
|
||||||
mobjinfo[i].bloodcolor = 0; // Normal
|
mobjinfo[i].bloodcolor = 0; // Normal
|
||||||
|
// DEHEXTRA
|
||||||
|
mobjinfo[i].droppeditem = MT_NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
mobjinfo[MT_VILE].flags2 = MF2_SHORTMRANGE | MF2_DMGIGNORED | MF2_NOTHRESHOLD;
|
mobjinfo[MT_VILE].flags2 = MF2_SHORTMRANGE | MF2_DMGIGNORED | MF2_NOTHRESHOLD;
|
||||||
@ -1743,6 +1745,12 @@ void D_DoomMain(void)
|
|||||||
mobjinfo[MT_BRUISER].bloodcolor = 2; // Green
|
mobjinfo[MT_BRUISER].bloodcolor = 2; // Green
|
||||||
mobjinfo[MT_KNIGHT].bloodcolor = 2; // Green
|
mobjinfo[MT_KNIGHT].bloodcolor = 2; // Green
|
||||||
|
|
||||||
|
// DEHEXTRA
|
||||||
|
mobjinfo[MT_WOLFSS].droppeditem = MT_CLIP;
|
||||||
|
mobjinfo[MT_POSSESSED].droppeditem = MT_CLIP;
|
||||||
|
mobjinfo[MT_SHOTGUY].droppeditem = MT_SHOTGUN;
|
||||||
|
mobjinfo[MT_CHAINGUY].droppeditem = MT_CHAINGUN;
|
||||||
|
|
||||||
for (i = S_SARG_RUN1; i <= S_SARG_PAIN2; ++i)
|
for (i = S_SARG_RUN1; i <= S_SARG_PAIN2; ++i)
|
||||||
states[i].flags |= STATEF_SKILL5FAST;
|
states[i].flags |= STATEF_SKILL5FAST;
|
||||||
}
|
}
|
||||||
|
@ -1289,6 +1289,7 @@ extern char *sprnames[]; // 1/17/98 killough
|
|||||||
// Note that many of these are generically named for the ornamentals
|
// Note that many of these are generically named for the ornamentals
|
||||||
//
|
//
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
MT_NULL = -1, // null/invalid mobj (zero is reserved for MT_PLAYER)
|
||||||
MT_PLAYER,
|
MT_PLAYER,
|
||||||
MT_POSSESSED,
|
MT_POSSESSED,
|
||||||
MT_SHOTGUY,
|
MT_SHOTGUY,
|
||||||
@ -1545,6 +1546,8 @@ typedef struct
|
|||||||
|
|
||||||
// [Woof!]
|
// [Woof!]
|
||||||
int bloodcolor; // [FG] colored blood and gibs
|
int bloodcolor; // [FG] colored blood and gibs
|
||||||
|
// DEHEXTRA
|
||||||
|
mobjtype_t droppeditem; // mobj to drop after death
|
||||||
} mobjinfo_t;
|
} mobjinfo_t;
|
||||||
|
|
||||||
#define NO_ALTSPEED -1
|
#define NO_ALTSPEED -1
|
||||||
|
@ -722,24 +722,11 @@ static void P_KillMobj(mobj_t *source, mobj_t *target)
|
|||||||
// This determines the kind of object spawned
|
// This determines the kind of object spawned
|
||||||
// during the death frame of a thing.
|
// during the death frame of a thing.
|
||||||
|
|
||||||
switch (target->type)
|
if (target->info->droppeditem != MT_NULL)
|
||||||
{
|
{
|
||||||
case MT_WOLFSS:
|
item = target->info->droppeditem;
|
||||||
case MT_POSSESSED:
|
}
|
||||||
item = MT_CLIP;
|
else return;
|
||||||
break;
|
|
||||||
|
|
||||||
case MT_SHOTGUY:
|
|
||||||
item = MT_SHOTGUN;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MT_CHAINGUY:
|
|
||||||
item = MT_CHAINGUN;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
mo = P_SpawnMobj (target->x,target->y,ONFLOORZ, item);
|
mo = P_SpawnMobj (target->x,target->y,ONFLOORZ, item);
|
||||||
mo->flags |= MF_DROPPED; // special versions of items
|
mo->flags |= MF_DROPPED; // special versions of items
|
||||||
|
Loading…
x
Reference in New Issue
Block a user