mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 09:11:48 +00:00
Turn solid lava into a damagetype
This commit is contained in:
parent
e011962156
commit
2b4d32b372
8 changed files with 46 additions and 22 deletions
|
@ -246,7 +246,7 @@ mapformat_udmf
|
|||
include("SRB222_misc.cfg", "sectorbrightness");
|
||||
}
|
||||
|
||||
damagetypes = "Generic Water Fire Electric Spike DeathPitTilt DeathPitNoTilt Instakill SpecialStage";
|
||||
damagetypes = "Generic Water Fire Lava Electric Spike DeathPitTilt DeathPitNoTilt Instakill SpecialStage";
|
||||
|
||||
// LINEDEF FLAGS
|
||||
linedefflags
|
||||
|
|
|
@ -4515,6 +4515,7 @@ const char *const SD_LIST[] = {
|
|||
"GENERIC",
|
||||
"WATER",
|
||||
"FIRE",
|
||||
"LAVA",
|
||||
"ELECTRIC",
|
||||
"SPIKE",
|
||||
"DEATHPITTILT",
|
||||
|
|
|
@ -3594,10 +3594,7 @@ static void P_CheckLavaWall(mobj_t *mo, sector_t *sec)
|
|||
if (!(rover->flags & FF_SWIMMABLE))
|
||||
continue;
|
||||
|
||||
if (rover->master->frontsector->damagetype != SD_FIRE)
|
||||
continue;
|
||||
|
||||
if (rover->master->flags & ML_BLOCKMONSTERS)
|
||||
if (rover->master->frontsector->damagetype != SD_LAVA)
|
||||
continue;
|
||||
|
||||
topheight = P_GetFFloorTopZAt(rover, mo->x, mo->y);
|
||||
|
|
16
src/p_mobj.c
16
src/p_mobj.c
|
@ -2334,11 +2334,7 @@ boolean P_CheckDeathPitCollide(mobj_t *mo)
|
|||
|
||||
boolean P_CheckSolidLava(ffloor_t *rover)
|
||||
{
|
||||
if (rover->flags & FF_SWIMMABLE && rover->master->frontsector->damagetype == SD_FIRE
|
||||
&& !(rover->master->flags & ML_BLOCKMONSTERS))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
return (rover->flags & FF_SWIMMABLE) && (rover->master->frontsector->damagetype == SD_LAVA);
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -3305,7 +3301,7 @@ void P_MobjCheckWater(mobj_t *mobj)
|
|||
|
||||
if (mobj->eflags & (MFE_TOUCHWATER|MFE_UNDERWATER))
|
||||
{
|
||||
if (rover->master->frontsector->damagetype == SD_FIRE)
|
||||
if (rover->master->frontsector->damagetype == SD_FIRE || rover->master->frontsector->damagetype == SD_LAVA)
|
||||
mobj->eflags |= MFE_TOUCHLAVA;
|
||||
|
||||
if (rover->flags & FF_GOOWATER && !(mobj->flags & MF_NOGRAVITY))
|
||||
|
@ -4096,9 +4092,11 @@ static void P_KillRingsInLava(mobj_t *mo)
|
|||
{
|
||||
if (!(rover->flags & FF_EXISTS)) continue; // fof must be real
|
||||
|
||||
if (!(rover->flags & FF_SWIMMABLE // fof must be water
|
||||
&& rover->master->frontsector->damagetype == SD_FIRE)) // fof must be lava water
|
||||
continue;
|
||||
if (!(rover->flags & FF_SWIMMABLE))
|
||||
continue; // fof must be water
|
||||
|
||||
if (rover->master->frontsector->damagetype != SD_FIRE && rover->master->frontsector->damagetype != SD_LAVA)
|
||||
continue; // fof must have fire or lava damage
|
||||
|
||||
// find heights of FOF
|
||||
topheight = P_GetFOFTopZ(mo, node->m_sector, rover, mo->x, mo->y, NULL);
|
||||
|
|
|
@ -1735,6 +1735,8 @@ static void ParseTextmapSectorParameter(UINT32 i, char *param, char *val)
|
|||
sectors[i].damagetype = SD_WATER;
|
||||
if (fastcmp(val, "Fire"))
|
||||
sectors[i].damagetype = SD_FIRE;
|
||||
if (fastcmp(val, "Lava"))
|
||||
sectors[i].damagetype = SD_LAVA;
|
||||
if (fastcmp(val, "Electric"))
|
||||
sectors[i].damagetype = SD_ELECTRIC;
|
||||
if (fastcmp(val, "Spike"))
|
||||
|
@ -5105,8 +5107,29 @@ static void P_ConvertBinaryMap(void)
|
|||
sectors[i].damagetype = SD_WATER;
|
||||
break;
|
||||
case 3: //Damage (Fire)
|
||||
sectors[i].damagetype = SD_FIRE;
|
||||
{
|
||||
size_t j;
|
||||
boolean isLava = false;
|
||||
|
||||
for (j = 0; j < sectors[i].linecount; j++)
|
||||
{
|
||||
line_t *line = sectors[i].lines[j];
|
||||
|
||||
if (line->frontsector != §ors[i])
|
||||
continue;
|
||||
|
||||
if (line->flags & ML_BLOCKMONSTERS)
|
||||
continue;
|
||||
|
||||
if (line->special == 120 || (line->special == 259 && (line->args[2] & FF_SWIMMABLE)))
|
||||
{
|
||||
isLava = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
sectors[i].damagetype = isLava ? SD_LAVA : SD_FIRE;
|
||||
break;
|
||||
}
|
||||
case 4: //Damage (Electric)
|
||||
sectors[i].damagetype = SD_ELECTRIC;
|
||||
break;
|
||||
|
|
|
@ -5010,6 +5010,7 @@ static void P_EvaluateDamageType(player_t *player, sector_t *sector, boolean isT
|
|||
P_DamageMobj(player->mo, NULL, NULL, 1, DMG_WATER);
|
||||
break;
|
||||
case SD_FIRE:
|
||||
case SD_LAVA:
|
||||
if (isTouching)
|
||||
P_DamageMobj(player->mo, NULL, NULL, 1, DMG_FIRE);
|
||||
break;
|
||||
|
|
|
@ -12230,7 +12230,10 @@ static boolean P_MobjAboveLava(mobj_t *mobj)
|
|||
|
||||
for (rover = sector->ffloors; rover; rover = rover->next)
|
||||
{
|
||||
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_SWIMMABLE) || rover->master->frontsector->damagetype != SD_FIRE)
|
||||
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_SWIMMABLE))
|
||||
continue;
|
||||
|
||||
if (rover->master->frontsector->damagetype != SD_FIRE && rover->master->frontsector->damagetype != SD_LAVA)
|
||||
continue;
|
||||
|
||||
if (mobj->eflags & MFE_VERTICALFLIP)
|
||||
|
|
13
src/r_defs.h
13
src/r_defs.h
|
@ -321,12 +321,13 @@ typedef enum
|
|||
SD_GENERIC = 1,
|
||||
SD_WATER = 2,
|
||||
SD_FIRE = 3,
|
||||
SD_ELECTRIC = 4,
|
||||
SD_SPIKE = 5,
|
||||
SD_DEATHPITTILT = 6,
|
||||
SD_DEATHPITNOTILT = 7,
|
||||
SD_INSTAKILL = 8,
|
||||
SD_SPECIALSTAGE = 9,
|
||||
SD_LAVA = 4,
|
||||
SD_ELECTRIC = 5,
|
||||
SD_SPIKE = 6,
|
||||
SD_DEATHPITTILT = 7,
|
||||
SD_DEATHPITNOTILT = 8,
|
||||
SD_INSTAKILL = 9,
|
||||
SD_SPECIALSTAGE = 10,
|
||||
} sectordamage_t;
|
||||
|
||||
typedef enum
|
||||
|
|
Loading…
Reference in a new issue