mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-11 07:11:39 +00:00
sector.c: cleanup round 3, P_ActivateSwitch() refactoring.
git-svn-id: https://svn.eduke32.com/eduke32@4282 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
ab5c89430c
commit
6de687ba86
1 changed files with 217 additions and 285 deletions
|
@ -384,15 +384,13 @@ void G_AnimateCamSprite(void)
|
|||
|
||||
void G_AnimateWalls(void)
|
||||
{
|
||||
int32_t i, j, p = g_numAnimWalls-1, t;
|
||||
int32_t p = g_numAnimWalls-1;
|
||||
|
||||
for (; p>=0; p--)
|
||||
// for(p=g_numAnimWalls-1;p>=0;p--)
|
||||
{
|
||||
i = animwall[p].wallnum;
|
||||
j = wall[i].picnum;
|
||||
const int32_t i = animwall[p].wallnum;
|
||||
|
||||
switch (DYNAMICTILEMAP(j))
|
||||
switch (DYNAMICTILEMAP(wall[i].picnum))
|
||||
{
|
||||
case SCREENBREAK1__STATIC:
|
||||
case SCREENBREAK2__STATIC:
|
||||
|
@ -433,12 +431,11 @@ void G_AnimateWalls(void)
|
|||
wall[i].picnum = SCREENBREAK6;
|
||||
}
|
||||
continue;
|
||||
|
||||
}
|
||||
|
||||
if ((wall[i].cstat&16) && G_GetForcefieldPicnum(i)==W_FORCEFIELD)
|
||||
{
|
||||
t = animwall[p].tag;
|
||||
const int32_t t = animwall[p].tag;
|
||||
|
||||
if (wall[i].cstat&254)
|
||||
{
|
||||
|
@ -1076,24 +1073,105 @@ void G_OperateForceFields(int32_t s, int32_t low)
|
|||
}
|
||||
}
|
||||
|
||||
int32_t P_ActivateSwitch(int32_t snum,int32_t w,int32_t switchissprite)
|
||||
// List of switches that function like dip (combination lock) switches.
|
||||
#define DIPSWITCH_LIKE_CASES \
|
||||
DIPSWITCH__STATIC: \
|
||||
case TECHSWITCH__STATIC: \
|
||||
case ALIENSWITCH__STATIC
|
||||
|
||||
// List of access switches.
|
||||
#define ACCESSSWITCH_CASES \
|
||||
ACCESSSWITCH__STATIC: \
|
||||
case ACCESSSWITCH2__STATIC
|
||||
|
||||
// List of switches that don't fit the two preceding categories, and are not
|
||||
// the MULTISWITCH. 13 cases.
|
||||
#define REST_SWITCH_CASES \
|
||||
DIPSWITCH2__STATIC: \
|
||||
case DIPSWITCH3__STATIC: \
|
||||
case FRANKENSTINESWITCH__STATIC: \
|
||||
case HANDSWITCH__STATIC: \
|
||||
case LIGHTSWITCH2__STATIC: \
|
||||
case LIGHTSWITCH__STATIC: \
|
||||
case LOCKSWITCH1__STATIC: \
|
||||
case POWERSWITCH1__STATIC: \
|
||||
case POWERSWITCH2__STATIC: \
|
||||
case PULLSWITCH__STATIC: \
|
||||
case SLOTDOOR__STATIC: \
|
||||
case SPACEDOORSWITCH__STATIC: \
|
||||
case SPACELIGHTSWITCH__STATIC
|
||||
|
||||
// Returns:
|
||||
// 0: is not a dipswitch-like switch
|
||||
// 1: is one, off
|
||||
// 2: is one, on
|
||||
static int32_t G_IsLikeDipswitch(int32_t picnum)
|
||||
{
|
||||
int32_t switchpal, switchpicnum;
|
||||
int32_t i, x, lotag,hitag,picnum,correctdips = 1, numdips = 0;
|
||||
int32_t i;
|
||||
|
||||
for (i=0; i<2; i++)
|
||||
if (picnum == DIPSWITCH+i || picnum == TECHSWITCH+i || picnum == ALIENSWITCH+i)
|
||||
return 1+i;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Get base (unpressed) tile number for switch.
|
||||
static int32_t G_GetBaseSwitch(int32_t picnum)
|
||||
{
|
||||
if (picnum==DIPSWITCH+1
|
||||
|| picnum==TECHSWITCH+1
|
||||
|| picnum==ALIENSWITCH+1
|
||||
|| picnum==DIPSWITCH2+1
|
||||
|| picnum==DIPSWITCH3+1
|
||||
|| picnum==PULLSWITCH+1
|
||||
|| picnum==HANDSWITCH+1
|
||||
|| picnum==SLOTDOOR+1
|
||||
|| picnum==LIGHTSWITCH+1
|
||||
|| picnum==SPACELIGHTSWITCH+1
|
||||
|| picnum==SPACEDOORSWITCH+1
|
||||
|| picnum==FRANKENSTINESWITCH+1
|
||||
|| picnum==LIGHTSWITCH2+1
|
||||
|| picnum==POWERSWITCH1+1
|
||||
|| picnum==LOCKSWITCH1+1
|
||||
|| picnum==POWERSWITCH2+1
|
||||
)
|
||||
{
|
||||
return picnum-1;
|
||||
}
|
||||
|
||||
if (picnum > MULTISWITCH && picnum <= MULTISWITCH+3)
|
||||
{
|
||||
return MULTISWITCH;
|
||||
}
|
||||
|
||||
return picnum;
|
||||
}
|
||||
|
||||
int32_t P_ActivateSwitch(int32_t snum, int32_t w, int32_t switchissprite)
|
||||
{
|
||||
int32_t lotag, hitag, picnum, switchpal;
|
||||
vec3_t davector;
|
||||
|
||||
if (w < 0) return 0;
|
||||
int32_t switchpicnum;
|
||||
int32_t i, correctdips = 1, numdips = 0;
|
||||
|
||||
if (w < 0)
|
||||
return 0;
|
||||
|
||||
if (switchissprite == 1) // A wall sprite
|
||||
{
|
||||
if (actor[w].lasttransport == totalclock) return 0;
|
||||
if (actor[w].lasttransport == totalclock)
|
||||
return 0;
|
||||
|
||||
actor[w].lasttransport = totalclock;
|
||||
|
||||
lotag = sprite[w].lotag;
|
||||
if (lotag == 0) return 0;
|
||||
if (lotag == 0)
|
||||
return 0;
|
||||
|
||||
hitag = sprite[w].hitag;
|
||||
|
||||
// sx = sprite[w].x;
|
||||
// sy = sprite[w].y;
|
||||
Bmemcpy(&davector, &sprite[w], sizeof(vec3_t));
|
||||
picnum = sprite[w].picnum;
|
||||
switchpal = sprite[w].pal;
|
||||
|
@ -1101,76 +1179,46 @@ int32_t P_ActivateSwitch(int32_t snum,int32_t w,int32_t switchissprite)
|
|||
else
|
||||
{
|
||||
lotag = wall[w].lotag;
|
||||
if (lotag == 0) return 0;
|
||||
if (lotag == 0)
|
||||
return 0;
|
||||
|
||||
hitag = wall[w].hitag;
|
||||
// sx = wall[w].x;
|
||||
// sy = wall[w].y;
|
||||
|
||||
Bmemcpy(&davector, &wall[w], sizeof(int32_t) * 2);
|
||||
davector.z = g_player[snum].ps->pos.z;
|
||||
picnum = wall[w].picnum;
|
||||
switchpal = wall[w].pal;
|
||||
}
|
||||
// initprintf("P_ActivateSwitch called picnum=%i switchissprite=%i\n",picnum,switchissprite);
|
||||
switchpicnum = picnum;
|
||||
if ((picnum==DIPSWITCH+1)
|
||||
|| (picnum==TECHSWITCH+1)
|
||||
|| (picnum==ALIENSWITCH+1)
|
||||
|| (picnum==DIPSWITCH2+1)
|
||||
|| (picnum==DIPSWITCH3+1)
|
||||
|| (picnum==PULLSWITCH+1)
|
||||
|| (picnum==HANDSWITCH+1)
|
||||
|| (picnum==SLOTDOOR+1)
|
||||
|| (picnum==LIGHTSWITCH+1)
|
||||
|| (picnum==SPACELIGHTSWITCH+1)
|
||||
|| (picnum==SPACEDOORSWITCH+1)
|
||||
|| (picnum==FRANKENSTINESWITCH+1)
|
||||
|| (picnum==LIGHTSWITCH2+1)
|
||||
|| (picnum==POWERSWITCH1+1)
|
||||
|| (picnum==LOCKSWITCH1+1)
|
||||
|| (picnum==POWERSWITCH2+1)
|
||||
|| (picnum==LIGHTSWITCH+1)
|
||||
)
|
||||
{
|
||||
switchpicnum--;
|
||||
}
|
||||
if (picnum > MULTISWITCH && picnum <= MULTISWITCH+3)
|
||||
{
|
||||
switchpicnum = MULTISWITCH;
|
||||
}
|
||||
|
||||
// initprintf("P_ActivateSwitch called picnum=%i switchissprite=%i\n",picnum,switchissprite);
|
||||
|
||||
switchpicnum = G_GetBaseSwitch(picnum);
|
||||
|
||||
switch (DYNAMICTILEMAP(switchpicnum))
|
||||
{
|
||||
case DIPSWITCH__STATIC:
|
||||
// case DIPSWITCH+1:
|
||||
case TECHSWITCH__STATIC:
|
||||
// case TECHSWITCH+1:
|
||||
case ALIENSWITCH__STATIC:
|
||||
// case ALIENSWITCH+1:
|
||||
case DIPSWITCH_LIKE_CASES:
|
||||
break;
|
||||
case ACCESSSWITCH__STATIC:
|
||||
case ACCESSSWITCH2__STATIC:
|
||||
|
||||
case ACCESSSWITCH_CASES:
|
||||
if (g_player[snum].ps->access_incs == 0)
|
||||
{
|
||||
if (switchpal == 0)
|
||||
{
|
||||
if ((g_player[snum].ps->got_access&1))
|
||||
g_player[snum].ps->access_incs = 1;
|
||||
else P_DoQuote(QUOTE_NEED_BLUE_KEY,g_player[snum].ps);
|
||||
}
|
||||
int32_t pp;
|
||||
|
||||
else if (switchpal == 21)
|
||||
{
|
||||
if (g_player[snum].ps->got_access&2)
|
||||
g_player[snum].ps->access_incs = 1;
|
||||
else P_DoQuote(QUOTE_NEED_RED_KEY,g_player[snum].ps);
|
||||
}
|
||||
static const int32_t key_switchpal[3] = { 0, 21, 23 };
|
||||
static const int32_t need_key_quote[3] = {
|
||||
QUOTE_NEED_BLUE_KEY, QUOTE_NEED_RED_KEY, QUOTE_NEED_YELLOW_KEY
|
||||
};
|
||||
|
||||
else if (switchpal == 23)
|
||||
{
|
||||
if (g_player[snum].ps->got_access&4)
|
||||
g_player[snum].ps->access_incs = 1;
|
||||
else P_DoQuote(QUOTE_NEED_YELLOW_KEY,g_player[snum].ps);
|
||||
}
|
||||
for (pp=0; pp<2; pp++)
|
||||
if (switchpal == key_switchpal[pp])
|
||||
{
|
||||
if (g_player[snum].ps->got_access & (1<<pp))
|
||||
g_player[snum].ps->access_incs = 1;
|
||||
else
|
||||
P_DoQuote(need_key_quote[pp], g_player[snum].ps);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (g_player[snum].ps->access_incs == 1)
|
||||
{
|
||||
|
@ -1182,183 +1230,115 @@ int32_t P_ActivateSwitch(int32_t snum,int32_t w,int32_t switchissprite)
|
|||
|
||||
return 0;
|
||||
}
|
||||
case DIPSWITCH2__STATIC:
|
||||
//case DIPSWITCH2+1:
|
||||
case DIPSWITCH3__STATIC:
|
||||
//case DIPSWITCH3+1:
|
||||
/* fall-through (XXX: intended?) */
|
||||
case MULTISWITCH__STATIC:
|
||||
//case MULTISWITCH+1:
|
||||
//case MULTISWITCH+2:
|
||||
//case MULTISWITCH+3:
|
||||
case PULLSWITCH__STATIC:
|
||||
//case PULLSWITCH+1:
|
||||
case HANDSWITCH__STATIC:
|
||||
//case HANDSWITCH+1:
|
||||
case SLOTDOOR__STATIC:
|
||||
//case SLOTDOOR+1:
|
||||
case LIGHTSWITCH__STATIC:
|
||||
//case LIGHTSWITCH+1:
|
||||
case SPACELIGHTSWITCH__STATIC:
|
||||
//case SPACELIGHTSWITCH+1:
|
||||
case SPACEDOORSWITCH__STATIC:
|
||||
//case SPACEDOORSWITCH+1:
|
||||
case FRANKENSTINESWITCH__STATIC:
|
||||
//case FRANKENSTINESWITCH+1:
|
||||
case LIGHTSWITCH2__STATIC:
|
||||
//case LIGHTSWITCH2+1:
|
||||
case POWERSWITCH1__STATIC:
|
||||
//case POWERSWITCH1+1:
|
||||
case LOCKSWITCH1__STATIC:
|
||||
//case LOCKSWITCH1+1:
|
||||
case POWERSWITCH2__STATIC:
|
||||
//case POWERSWITCH2+1:
|
||||
if (G_CheckActivatorMotion(lotag)) return 0;
|
||||
case REST_SWITCH_CASES:
|
||||
if (G_CheckActivatorMotion(lotag))
|
||||
return 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (CheckDoorTile(picnum) == 0) return 0;
|
||||
if (CheckDoorTile(picnum) == 0)
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
|
||||
i = headspritestat[STAT_DEFAULT];
|
||||
while (i >= 0)
|
||||
for (SPRITES_OF(STAT_DEFAULT, i))
|
||||
{
|
||||
|
||||
if (lotag == SLT)
|
||||
{
|
||||
int32_t switchpicnum=PN; // put it in a variable so later switches don't trigger on the result of changes
|
||||
if ((switchpicnum >= MULTISWITCH) && (switchpicnum <=MULTISWITCH+3))
|
||||
// Put the tile number into a variable so later switches don't
|
||||
// trigger on the result of changes:
|
||||
const int32_t switchpic = PN;
|
||||
|
||||
if (switchpic >= MULTISWITCH && switchpic <= MULTISWITCH+3)
|
||||
{
|
||||
sprite[i].picnum++;
|
||||
if (sprite[i].picnum > (MULTISWITCH+3))
|
||||
if (sprite[i].picnum > MULTISWITCH+3)
|
||||
sprite[i].picnum = MULTISWITCH;
|
||||
|
||||
}
|
||||
switch (DYNAMICTILEMAP(switchpicnum))
|
||||
|
||||
switch (DYNAMICTILEMAP(switchpic))
|
||||
{
|
||||
case DIPSWITCH__STATIC:
|
||||
case TECHSWITCH__STATIC:
|
||||
case ALIENSWITCH__STATIC:
|
||||
if (switchissprite == 1 && w == i) PN++;
|
||||
else if (SHT == 0) correctdips++;
|
||||
case DIPSWITCH_LIKE_CASES:
|
||||
if (switchissprite == 1 && w == i)
|
||||
PN++;
|
||||
else if (SHT == 0)
|
||||
correctdips++;
|
||||
numdips++;
|
||||
break;
|
||||
case ACCESSSWITCH__STATIC:
|
||||
case ACCESSSWITCH2__STATIC:
|
||||
case SLOTDOOR__STATIC:
|
||||
case LIGHTSWITCH__STATIC:
|
||||
case SPACELIGHTSWITCH__STATIC:
|
||||
case SPACEDOORSWITCH__STATIC:
|
||||
case FRANKENSTINESWITCH__STATIC:
|
||||
case LIGHTSWITCH2__STATIC:
|
||||
case POWERSWITCH1__STATIC:
|
||||
case LOCKSWITCH1__STATIC:
|
||||
case POWERSWITCH2__STATIC:
|
||||
case HANDSWITCH__STATIC:
|
||||
case PULLSWITCH__STATIC:
|
||||
case DIPSWITCH2__STATIC:
|
||||
case DIPSWITCH3__STATIC:
|
||||
|
||||
case ACCESSSWITCH_CASES:
|
||||
case REST_SWITCH_CASES:
|
||||
sprite[i].picnum++;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (switchpicnum <= 0) // oob safety
|
||||
if (switchpic <= 0) // oob safety
|
||||
break;
|
||||
|
||||
switch (DYNAMICTILEMAP(switchpicnum-1))
|
||||
switch (DYNAMICTILEMAP(switchpic-1))
|
||||
{
|
||||
case TECHSWITCH__STATIC:
|
||||
case DIPSWITCH__STATIC:
|
||||
case ALIENSWITCH__STATIC:
|
||||
if (switchissprite == 1 && w == i) PN--;
|
||||
else if (SHT == 1) correctdips++;
|
||||
case DIPSWITCH_LIKE_CASES:
|
||||
if (switchissprite == 1 && w == i)
|
||||
PN--;
|
||||
else if (SHT == 1)
|
||||
correctdips++;
|
||||
numdips++;
|
||||
break;
|
||||
case PULLSWITCH__STATIC:
|
||||
case HANDSWITCH__STATIC:
|
||||
case LIGHTSWITCH2__STATIC:
|
||||
case POWERSWITCH1__STATIC:
|
||||
case LOCKSWITCH1__STATIC:
|
||||
case POWERSWITCH2__STATIC:
|
||||
case SLOTDOOR__STATIC:
|
||||
case LIGHTSWITCH__STATIC:
|
||||
case SPACELIGHTSWITCH__STATIC:
|
||||
case SPACEDOORSWITCH__STATIC:
|
||||
case FRANKENSTINESWITCH__STATIC:
|
||||
case DIPSWITCH2__STATIC:
|
||||
case DIPSWITCH3__STATIC:
|
||||
|
||||
case REST_SWITCH_CASES:
|
||||
sprite[i].picnum--;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
i = nextspritestat[i];
|
||||
}
|
||||
|
||||
for (i=numwalls-1; i>=0; i--)
|
||||
{
|
||||
x = i;
|
||||
const int32_t x = i;
|
||||
|
||||
if (lotag == wall[x].lotag)
|
||||
{
|
||||
if ((wall[x].picnum >= MULTISWITCH) && (wall[x].picnum <=MULTISWITCH+3))
|
||||
if (wall[x].picnum >= MULTISWITCH && wall[x].picnum <= MULTISWITCH+3)
|
||||
{
|
||||
wall[x].picnum++;
|
||||
if (wall[x].picnum > (MULTISWITCH+3))
|
||||
if (wall[x].picnum > MULTISWITCH+3)
|
||||
wall[x].picnum = MULTISWITCH;
|
||||
|
||||
}
|
||||
|
||||
switch (DYNAMICTILEMAP(wall[x].picnum))
|
||||
{
|
||||
case DIPSWITCH__STATIC:
|
||||
case TECHSWITCH__STATIC:
|
||||
case ALIENSWITCH__STATIC:
|
||||
if (switchissprite == 0 && i == w) wall[x].picnum++;
|
||||
else if (wall[x].hitag == 0) correctdips++;
|
||||
case DIPSWITCH_LIKE_CASES:
|
||||
if (switchissprite == 0 && i == w)
|
||||
wall[x].picnum++;
|
||||
else if (wall[x].hitag == 0)
|
||||
correctdips++;
|
||||
numdips++;
|
||||
break;
|
||||
case ACCESSSWITCH__STATIC:
|
||||
case ACCESSSWITCH2__STATIC:
|
||||
case SLOTDOOR__STATIC:
|
||||
case LIGHTSWITCH__STATIC:
|
||||
case SPACELIGHTSWITCH__STATIC:
|
||||
case SPACEDOORSWITCH__STATIC:
|
||||
case FRANKENSTINESWITCH__STATIC:
|
||||
case LIGHTSWITCH2__STATIC:
|
||||
case POWERSWITCH1__STATIC:
|
||||
case LOCKSWITCH1__STATIC:
|
||||
case POWERSWITCH2__STATIC:
|
||||
case HANDSWITCH__STATIC:
|
||||
case PULLSWITCH__STATIC:
|
||||
case DIPSWITCH2__STATIC:
|
||||
case DIPSWITCH3__STATIC:
|
||||
|
||||
case ACCESSSWITCH_CASES:
|
||||
case REST_SWITCH_CASES:
|
||||
wall[x].picnum++;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (wall[x].picnum <= 0) // oob safety
|
||||
break;
|
||||
|
||||
switch (DYNAMICTILEMAP(wall[x].picnum-1))
|
||||
{
|
||||
case TECHSWITCH__STATIC:
|
||||
case DIPSWITCH__STATIC:
|
||||
case ALIENSWITCH__STATIC:
|
||||
if (switchissprite == 0 && i == w) wall[x].picnum--;
|
||||
else if (wall[x].hitag == 1) correctdips++;
|
||||
case DIPSWITCH_LIKE_CASES:
|
||||
if (switchissprite == 0 && i == w)
|
||||
wall[x].picnum--;
|
||||
else if (wall[x].hitag == 1)
|
||||
correctdips++;
|
||||
numdips++;
|
||||
break;
|
||||
case PULLSWITCH__STATIC:
|
||||
case HANDSWITCH__STATIC:
|
||||
case LIGHTSWITCH2__STATIC:
|
||||
case POWERSWITCH1__STATIC:
|
||||
case LOCKSWITCH1__STATIC:
|
||||
case POWERSWITCH2__STATIC:
|
||||
case SLOTDOOR__STATIC:
|
||||
case LIGHTSWITCH__STATIC:
|
||||
case SPACELIGHTSWITCH__STATIC:
|
||||
case SPACEDOORSWITCH__STATIC:
|
||||
case FRANKENSTINESWITCH__STATIC:
|
||||
case DIPSWITCH2__STATIC:
|
||||
case DIPSWITCH3__STATIC:
|
||||
|
||||
case REST_SWITCH_CASES:
|
||||
wall[x].picnum--;
|
||||
break;
|
||||
}
|
||||
|
@ -1388,104 +1368,50 @@ int32_t P_ActivateSwitch(int32_t snum,int32_t w,int32_t switchissprite)
|
|||
return 1;
|
||||
}
|
||||
|
||||
switchpicnum = picnum;
|
||||
|
||||
if ((picnum==DIPSWITCH+1)
|
||||
|| (picnum==TECHSWITCH+1)
|
||||
|| (picnum==ALIENSWITCH+1)
|
||||
|| (picnum==DIPSWITCH2+1)
|
||||
|| (picnum==DIPSWITCH3+1)
|
||||
|| (picnum==PULLSWITCH+1)
|
||||
|| (picnum==HANDSWITCH+1)
|
||||
|| (picnum==SLOTDOOR+1)
|
||||
|| (picnum==LIGHTSWITCH+1)
|
||||
|| (picnum==SPACELIGHTSWITCH+1)
|
||||
|| (picnum==SPACEDOORSWITCH+1)
|
||||
|| (picnum==FRANKENSTINESWITCH+1)
|
||||
|| (picnum==LIGHTSWITCH2+1)
|
||||
|| (picnum==POWERSWITCH1+1)
|
||||
|| (picnum==LOCKSWITCH1+1)
|
||||
|| (picnum==POWERSWITCH2+1)
|
||||
|| (picnum==LIGHTSWITCH+1)
|
||||
)
|
||||
{
|
||||
switchpicnum--;
|
||||
}
|
||||
if (picnum > MULTISWITCH && picnum <= MULTISWITCH+3)
|
||||
{
|
||||
switchpicnum = MULTISWITCH;
|
||||
}
|
||||
switchpicnum = G_GetBaseSwitch(picnum);
|
||||
|
||||
switch (DYNAMICTILEMAP(switchpicnum))
|
||||
{
|
||||
default:
|
||||
if (CheckDoorTile(picnum) == 0) break;
|
||||
case DIPSWITCH__STATIC:
|
||||
//case DIPSWITCH+1:
|
||||
case TECHSWITCH__STATIC:
|
||||
//case TECHSWITCH+1:
|
||||
case ALIENSWITCH__STATIC:
|
||||
//case ALIENSWITCH+1:
|
||||
if (picnum == DIPSWITCH || picnum == DIPSWITCH+1 ||
|
||||
picnum == ALIENSWITCH || picnum == ALIENSWITCH+1 ||
|
||||
picnum == TECHSWITCH || picnum == TECHSWITCH+1)
|
||||
if (CheckDoorTile(picnum) == 0)
|
||||
break;
|
||||
/* fall-through */
|
||||
case DIPSWITCH_LIKE_CASES:
|
||||
if (G_IsLikeDipswitch(picnum))
|
||||
{
|
||||
if (picnum == ALIENSWITCH || picnum == ALIENSWITCH+1)
|
||||
{
|
||||
if (switchissprite == 1)
|
||||
S_PlaySound3D(ALIEN_SWITCH1, w, &davector);
|
||||
else S_PlaySound3D(ALIEN_SWITCH1,g_player[snum].ps->i,&davector);
|
||||
else
|
||||
S_PlaySound3D(ALIEN_SWITCH1, g_player[snum].ps->i, &davector);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (switchissprite == 1)
|
||||
S_PlaySound3D(SWITCH_ON, w, &davector);
|
||||
else S_PlaySound3D(SWITCH_ON,g_player[snum].ps->i,&davector);
|
||||
else
|
||||
S_PlaySound3D(SWITCH_ON, g_player[snum].ps->i, &davector);
|
||||
}
|
||||
if (numdips != correctdips) break;
|
||||
S_PlaySound3D(END_OF_LEVEL_WARN,g_player[snum].ps->i,&davector);
|
||||
|
||||
if (numdips != correctdips)
|
||||
break;
|
||||
|
||||
S_PlaySound3D(END_OF_LEVEL_WARN, g_player[snum].ps->i, &davector);
|
||||
}
|
||||
case DIPSWITCH2__STATIC:
|
||||
//case DIPSWITCH2+1:
|
||||
case DIPSWITCH3__STATIC:
|
||||
//case DIPSWITCH3+1:
|
||||
/* fall-through */
|
||||
case ACCESSSWITCH_CASES:
|
||||
case MULTISWITCH__STATIC:
|
||||
//case MULTISWITCH+1:
|
||||
//case MULTISWITCH+2:
|
||||
//case MULTISWITCH+3:
|
||||
case ACCESSSWITCH__STATIC:
|
||||
case ACCESSSWITCH2__STATIC:
|
||||
case SLOTDOOR__STATIC:
|
||||
//case SLOTDOOR+1:
|
||||
case LIGHTSWITCH__STATIC:
|
||||
//case LIGHTSWITCH+1:
|
||||
case SPACELIGHTSWITCH__STATIC:
|
||||
//case SPACELIGHTSWITCH+1:
|
||||
case SPACEDOORSWITCH__STATIC:
|
||||
//case SPACEDOORSWITCH+1:
|
||||
case FRANKENSTINESWITCH__STATIC:
|
||||
//case FRANKENSTINESWITCH+1:
|
||||
case LIGHTSWITCH2__STATIC:
|
||||
//case LIGHTSWITCH2+1:
|
||||
case POWERSWITCH1__STATIC:
|
||||
//case POWERSWITCH1+1:
|
||||
case LOCKSWITCH1__STATIC:
|
||||
//case LOCKSWITCH1+1:
|
||||
case POWERSWITCH2__STATIC:
|
||||
//case POWERSWITCH2+1:
|
||||
case HANDSWITCH__STATIC:
|
||||
//case HANDSWITCH+1:
|
||||
case PULLSWITCH__STATIC:
|
||||
//case PULLSWITCH+1:
|
||||
case REST_SWITCH_CASES:
|
||||
{
|
||||
int32_t x;
|
||||
|
||||
if (picnum == MULTISWITCH || picnum == (MULTISWITCH+1) ||
|
||||
picnum == (MULTISWITCH+2) || picnum == (MULTISWITCH+3))
|
||||
lotag += picnum-MULTISWITCH;
|
||||
if (picnum >= MULTISWITCH && picnum <= MULTISWITCH+3)
|
||||
lotag += picnum - MULTISWITCH;
|
||||
|
||||
x = headspritestat[STAT_EFFECTOR];
|
||||
while (x >= 0)
|
||||
for (SPRITES_OF(STAT_EFFECTOR, x))
|
||||
{
|
||||
if (((sprite[x].hitag) == lotag))
|
||||
if (sprite[x].hitag == lotag)
|
||||
{
|
||||
switch (sprite[x].lotag)
|
||||
{
|
||||
|
@ -1494,47 +1420,49 @@ int32_t P_ActivateSwitch(int32_t snum,int32_t w,int32_t switchissprite)
|
|||
actor[x].t_data[0]++;
|
||||
if (actor[x].t_data[0] == 2)
|
||||
actor[x].t_data[0]++;
|
||||
|
||||
break;
|
||||
|
||||
case SE_24_CONVEYOR:
|
||||
case SE_34:
|
||||
case SE_25_PISTON:
|
||||
actor[x].t_data[4] = !actor[x].t_data[4];
|
||||
if (actor[x].t_data[4])
|
||||
P_DoQuote(QUOTE_DEACTIVATED,g_player[snum].ps);
|
||||
else P_DoQuote(QUOTE_ACTIVATED,g_player[snum].ps);
|
||||
P_DoQuote(actor[x].t_data[4] ? QUOTE_DEACTIVATED : QUOTE_ACTIVATED,
|
||||
g_player[snum].ps);
|
||||
break;
|
||||
|
||||
case SE_21_DROP_FLOOR:
|
||||
P_DoQuote(QUOTE_ACTIVATED,g_player[screenpeek].ps);
|
||||
P_DoQuote(QUOTE_ACTIVATED, g_player[screenpeek].ps);
|
||||
break;
|
||||
}
|
||||
}
|
||||
x = nextspritestat[x];
|
||||
}
|
||||
|
||||
G_OperateActivators(lotag,snum);
|
||||
G_OperateForceFields(g_player[snum].ps->i,lotag);
|
||||
G_OperateForceFields(g_player[snum].ps->i, lotag);
|
||||
G_OperateMasterSwitches(lotag);
|
||||
|
||||
if (picnum == DIPSWITCH || picnum == DIPSWITCH+1 ||
|
||||
picnum == ALIENSWITCH || picnum == ALIENSWITCH+1 ||
|
||||
picnum == TECHSWITCH || picnum == TECHSWITCH+1) return 1;
|
||||
if (G_IsLikeDipswitch(picnum))
|
||||
return 1;
|
||||
|
||||
if (hitag == 0 && CheckDoorTile(picnum) == 0)
|
||||
{
|
||||
if (switchissprite == 1)
|
||||
S_PlaySound3D(SWITCH_ON,w,&davector);
|
||||
else S_PlaySound3D(SWITCH_ON,g_player[snum].ps->i,&davector);
|
||||
S_PlaySound3D(SWITCH_ON, w, &davector);
|
||||
else
|
||||
S_PlaySound3D(SWITCH_ON, g_player[snum].ps->i, &davector);
|
||||
}
|
||||
else if (hitag != 0)
|
||||
{
|
||||
if (switchissprite == 1 && (g_sounds[hitag].m & SF_TALK) == 0)
|
||||
S_PlaySound3D(hitag,w,&davector);
|
||||
else A_PlaySound(hitag,g_player[snum].ps->i);
|
||||
S_PlaySound3D(hitag, w, &davector);
|
||||
else
|
||||
A_PlaySound(hitag, g_player[snum].ps->i);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1940,6 +1868,7 @@ void A_DamageObject(int32_t i,int32_t sn)
|
|||
A_Spawn(i,SMALLSMOKE);
|
||||
A_DeleteSprite(i);
|
||||
break;
|
||||
|
||||
case QUEBALL__STATIC:
|
||||
case STRIPEBALL__STATIC:
|
||||
if (sprite[sn].picnum == QUEBALL || sprite[sn].picnum == STRIPEBALL)
|
||||
|
@ -1964,6 +1893,7 @@ void A_DamageObject(int32_t i,int32_t sn)
|
|||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case TREE1__STATIC:
|
||||
case TREE2__STATIC:
|
||||
case TIRE__STATIC:
|
||||
|
@ -1994,6 +1924,7 @@ void A_DamageObject(int32_t i,int32_t sn)
|
|||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case CACTUS__STATIC:
|
||||
{
|
||||
if (rpg == 1)
|
||||
|
@ -2024,6 +1955,7 @@ void A_DamageObject(int32_t i,int32_t sn)
|
|||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case HANGLIGHT__STATIC:
|
||||
case GENERICPOLE2__STATIC:
|
||||
for (k=6; k>0; k--)
|
||||
|
|
Loading…
Reference in a new issue