mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-26 14:01:45 +00:00
- Added Line_SetTextureOffset special.
- Added 'allowprotection' keyword to terrain definitions to allow damaging flats that don't damage players with a radiation suit. - Fixed: SNDINFO rolloff setting for Strife was missing. SVN r839 (trunk)
This commit is contained in:
parent
eef724b58e
commit
e0bfe5fd42
8 changed files with 87 additions and 6 deletions
|
@ -1,4 +1,8 @@
|
|||
March 22, 2008 (Changes by Graf Zahl)
|
||||
- Added Line_SetTextureOffset special.
|
||||
- Added 'allowprotection' keyword to terrain definitions to allow damaging
|
||||
flats that don't damage players with a radiation suit.
|
||||
- Fixed: SNDINFO rolloff setting for Strife was missing.
|
||||
- Added more options to Light_ForceLightning: Setting the first arg to 0
|
||||
will behave as before, setting it to 1 will create exactly one lighting
|
||||
and setting it to 2 will terminate lightning for the current level
|
||||
|
|
|
@ -50,6 +50,7 @@ DEFINE_SPECIAL(GlassBreak, 49, 0, 1)
|
|||
DEFINE_SPECIAL(ExtraFloor_LightOnly, 50, -1, -1)
|
||||
DEFINE_SPECIAL(Sector_SetLink, 51, 4, 4)
|
||||
DEFINE_SPECIAL(Scroll_Wall, 52, 5, 5)
|
||||
DEFINE_SPECIAL(Line_SetTextureOffset, 53, 5, 5)
|
||||
|
||||
DEFINE_SPECIAL(Plat_PerpetualRaise, 60, 3, 3)
|
||||
DEFINE_SPECIAL(Plat_Stop, 61, 1, 1)
|
||||
|
|
|
@ -2289,6 +2289,59 @@ FUNC(LS_Line_AlignFloor)
|
|||
return ret;
|
||||
}
|
||||
|
||||
FUNC(LS_Line_SetTextureOffset)
|
||||
// Line_SetTextureOffset (id, x, y, side, flags)
|
||||
{
|
||||
const fixed_t NO_CHANGE = 32767<<FRACBITS;
|
||||
|
||||
if (arg0 == 0 || arg3 < 0 || arg3 > 1)
|
||||
return false;
|
||||
|
||||
for(int line = -1; (line = P_FindLineFromID (arg0, line)) >= 0; )
|
||||
{
|
||||
if (lines[line].sidenum[arg3] != NO_SIDE)
|
||||
{
|
||||
side_t *side = &sides[lines[line].sidenum[arg3]];
|
||||
|
||||
if ((arg4&8)==0)
|
||||
{
|
||||
// set
|
||||
if (arg1 != NO_CHANGE)
|
||||
{
|
||||
if (arg4&1) side->SetTextureXOffset(side_t::top, arg1);
|
||||
if (arg4&2) side->SetTextureXOffset(side_t::mid, arg1);
|
||||
if (arg4&4) side->SetTextureXOffset(side_t::bottom, arg1);
|
||||
}
|
||||
if (arg2 != NO_CHANGE)
|
||||
{
|
||||
if (arg4&1) side->SetTextureYOffset(side_t::top, arg2);
|
||||
if (arg4&2) side->SetTextureYOffset(side_t::mid, arg2);
|
||||
if (arg4&4) side->SetTextureYOffset(side_t::bottom, arg2);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// add
|
||||
if (arg1 != NO_CHANGE)
|
||||
{
|
||||
if (arg4&1) side->AddTextureXOffset(side_t::top, arg1);
|
||||
if (arg4&2) side->AddTextureXOffset(side_t::mid, arg1);
|
||||
if (arg4&4) side->AddTextureXOffset(side_t::bottom, arg1);
|
||||
}
|
||||
if (arg2 != NO_CHANGE)
|
||||
{
|
||||
if (arg4&1) side->AddTextureYOffset(side_t::top, arg2);
|
||||
if (arg4&2) side->AddTextureYOffset(side_t::mid, arg2);
|
||||
if (arg4&4) side->AddTextureYOffset(side_t::bottom, arg2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
FUNC(LS_ChangeCamera)
|
||||
// ChangeCamera (tid, who, revert?)
|
||||
{
|
||||
|
@ -2876,7 +2929,7 @@ lnSpecFunc LineSpecials[256] =
|
|||
LS_NOP, // 50: ExtraFloor_LightOnly
|
||||
LS_Sector_SetLink,
|
||||
LS_Scroll_Wall,
|
||||
LS_NOP, // 53
|
||||
LS_Line_SetTextureOffset,
|
||||
LS_NOP, // 54
|
||||
LS_NOP, // 55
|
||||
LS_NOP, // 56
|
||||
|
|
|
@ -568,8 +568,22 @@ void P_PlayerOnSpecialFlat (player_t *player, int floorType)
|
|||
if (Terrains[floorType].DamageAmount &&
|
||||
!(level.time & Terrains[floorType].DamageTimeMask))
|
||||
{
|
||||
P_DamageMobj (player->mo, NULL, NULL, Terrains[floorType].DamageAmount,
|
||||
Terrains[floorType].DamageMOD);
|
||||
AInventory *ironfeet = NULL;
|
||||
|
||||
if (Terrains[floorType].AllowProtection)
|
||||
{
|
||||
for (ironfeet = player->mo->Inventory; ironfeet != NULL; ironfeet = ironfeet->Inventory)
|
||||
{
|
||||
if (ironfeet->IsKindOf (RUNTIME_CLASS(APowerIronFeet)))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (ironfeet == NULL)
|
||||
{
|
||||
P_DamageMobj (player->mo, NULL, NULL, Terrains[floorType].DamageAmount,
|
||||
Terrains[floorType].DamageMOD);
|
||||
}
|
||||
if (Terrains[floorType].Splash != -1)
|
||||
{
|
||||
S_SoundID (player->mo, CHAN_AUTO,
|
||||
|
|
|
@ -80,7 +80,8 @@ enum ETerrainKeywords
|
|||
TR_LEFTSTEPSOUNDS,
|
||||
TR_RIGHTSTEPSOUNDS,
|
||||
TR_LIQUID,
|
||||
TR_FRICTION
|
||||
TR_FRICTION,
|
||||
TR_ALLOWPROTECTION
|
||||
};
|
||||
|
||||
enum EGenericType
|
||||
|
@ -180,6 +181,7 @@ static const char *TerrainKeywords[] =
|
|||
"rightstepsounds",
|
||||
"liquid",
|
||||
"friction",
|
||||
"allowprotection",
|
||||
NULL
|
||||
};
|
||||
|
||||
|
@ -216,7 +218,8 @@ static FGenericParse TerrainParser[] =
|
|||
{ GEN_Sound, {theoffsetof(FTerrainDef, LeftStepSound)} },
|
||||
{ GEN_Sound, {theoffsetof(FTerrainDef, RightStepSound)} },
|
||||
{ GEN_Bool, {theoffsetof(FTerrainDef, IsLiquid)} },
|
||||
{ GEN_Custom, {(size_t)ParseFriction} }
|
||||
{ GEN_Custom, {(size_t)ParseFriction} },
|
||||
{ GEN_Bool, {theoffsetof(FTerrainDef, AllowProtection)} },
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
@ -74,6 +74,7 @@ struct FTerrainDef
|
|||
int LeftStepSound;
|
||||
int RightStepSound;
|
||||
bool IsLiquid;
|
||||
bool AllowProtection;
|
||||
fixed_t Friction;
|
||||
fixed_t MoveFactor;
|
||||
};
|
||||
|
|
|
@ -1350,7 +1350,6 @@ bool S_ChangeMusic (const char *musicname, int order, bool looping, bool force)
|
|||
length = Wads.LumpLength (lumpnum);
|
||||
if (length == 0)
|
||||
{
|
||||
offset = 0;
|
||||
return false;
|
||||
}
|
||||
musiccache.Resize(length);
|
||||
|
@ -1360,6 +1359,10 @@ bool S_ChangeMusic (const char *musicname, int order, bool looping, bool force)
|
|||
{
|
||||
offset = Wads.GetLumpOffset (lumpnum);
|
||||
length = Wads.LumpLength (lumpnum);
|
||||
if (length == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -879,6 +879,8 @@ $endif // ifhexen
|
|||
|
||||
$ifstrife
|
||||
|
||||
$rolloff * 200 1200
|
||||
|
||||
$playersound player male *death dspldeth
|
||||
$playersound player male *xdeath dspdiehi
|
||||
$playersound player male *gibbed dsslop
|
||||
|
|
Loading…
Reference in a new issue