mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-29 13:00:43 +00:00
- replaced "sprite[p->i]" globally.
This commit is contained in:
parent
b5309a6410
commit
33f730baf3
11 changed files with 115 additions and 115 deletions
|
@ -77,17 +77,17 @@ void hud_input(int snum)
|
|||
{
|
||||
if (PlayerInput(snum, SB_QUICK_KICK) && p->last_pissed_time == 0)
|
||||
{
|
||||
if (!isRRRA() || sprite[p->i].extra > 0)
|
||||
if (!isRRRA() || p->GetActor()->s.extra > 0)
|
||||
{
|
||||
p->last_pissed_time = 4000;
|
||||
S_PlayActorSound(437, p->i);
|
||||
if (sprite[p->i].extra <= max_player_health - max_player_health / 10)
|
||||
if (p->GetActor()->s.extra <= max_player_health - max_player_health / 10)
|
||||
{
|
||||
sprite[p->i].extra += 2;
|
||||
p->last_extra = sprite[p->i].extra;
|
||||
p->GetActor()->s.extra += 2;
|
||||
p->last_extra = p->GetActor()->s.extra;
|
||||
}
|
||||
else if (sprite[p->i].extra < max_player_health)
|
||||
sprite[p->i].extra = max_player_health;
|
||||
else if (p->GetActor()->s.extra < max_player_health)
|
||||
p->GetActor()->s.extra = max_player_health;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ void hud_input(int snum)
|
|||
|
||||
// Don't go on if paused or dead.
|
||||
if (paused) return;
|
||||
if (sprite[p->i].extra <= 0) return;
|
||||
if (p->GetActor()->s.extra <= 0) return;
|
||||
|
||||
// Activate an inventory item. This just forwards to the other inventory bits. If the inventory selector was taken out of the playsim this could be removed.
|
||||
if (PlayerInput(snum, SB_INVUSE) && p->newowner == -1)
|
||||
|
@ -307,12 +307,12 @@ void hud_input(int snum)
|
|||
}
|
||||
else // In RR this means drinking whiskey.
|
||||
{
|
||||
if (p->holoduke_amount > 0 && sprite[p->i].extra < max_player_health)
|
||||
if (p->holoduke_amount > 0 && p->GetActor()->s.extra < max_player_health)
|
||||
{
|
||||
p->holoduke_amount -= 400;
|
||||
sprite[p->i].extra += 5;
|
||||
if (sprite[p->i].extra > max_player_health)
|
||||
sprite[p->i].extra = max_player_health;
|
||||
p->GetActor()->s.extra += 5;
|
||||
if (p->GetActor()->s.extra > max_player_health)
|
||||
p->GetActor()->s.extra = max_player_health;
|
||||
|
||||
p->drink_amt += 5;
|
||||
p->inven_icon = 3;
|
||||
|
@ -340,18 +340,18 @@ void hud_input(int snum)
|
|||
madenoise(snum);
|
||||
if (sector[p->cursectnum].lotag == 857)
|
||||
{
|
||||
if (sprite[p->i].extra <= max_player_health)
|
||||
if (p->GetActor()->s.extra <= max_player_health)
|
||||
{
|
||||
sprite[p->i].extra += 10;
|
||||
if (sprite[p->i].extra >= max_player_health)
|
||||
sprite[p->i].extra = max_player_health;
|
||||
p->GetActor()->s.extra += 10;
|
||||
if (p->GetActor()->s.extra >= max_player_health)
|
||||
p->GetActor()->s.extra = max_player_health;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (sprite[p->i].extra + 1 <= max_player_health)
|
||||
if (p->GetActor()->s.extra + 1 <= max_player_health)
|
||||
{
|
||||
sprite[p->i].extra++;
|
||||
p->GetActor()->s.extra++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -364,21 +364,21 @@ void hud_input(int snum)
|
|||
OnEvent(EVENT_USEMEDKIT, -1, snum, -1);
|
||||
if (GetGameVarID(g_iReturnVarID, -1, snum) == 0)
|
||||
{
|
||||
if (p->firstaid_amount > 0 && sprite[p->i].extra < max_player_health)
|
||||
if (p->firstaid_amount > 0 && p->GetActor()->s.extra < max_player_health)
|
||||
{
|
||||
if (!isRR())
|
||||
{
|
||||
int j = max_player_health - sprite[p->i].extra;
|
||||
int j = max_player_health - p->GetActor()->s.extra;
|
||||
|
||||
if ((unsigned int)p->firstaid_amount > j)
|
||||
{
|
||||
p->firstaid_amount -= j;
|
||||
sprite[p->i].extra = max_player_health;
|
||||
p->GetActor()->s.extra = max_player_health;
|
||||
p->inven_icon = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
sprite[p->i].extra += p->firstaid_amount;
|
||||
p->GetActor()->s.extra += p->firstaid_amount;
|
||||
p->firstaid_amount = 0;
|
||||
checkavailinven(p);
|
||||
}
|
||||
|
@ -390,19 +390,19 @@ void hud_input(int snum)
|
|||
if (p->firstaid_amount > j)
|
||||
{
|
||||
p->firstaid_amount -= j;
|
||||
sprite[p->i].extra += j;
|
||||
if (sprite[p->i].extra > max_player_health)
|
||||
sprite[p->i].extra = max_player_health;
|
||||
p->GetActor()->s.extra += j;
|
||||
if (p->GetActor()->s.extra > max_player_health)
|
||||
p->GetActor()->s.extra = max_player_health;
|
||||
p->inven_icon = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
sprite[p->i].extra += p->firstaid_amount;
|
||||
p->GetActor()->s.extra += p->firstaid_amount;
|
||||
p->firstaid_amount = 0;
|
||||
checkavailinven(p);
|
||||
}
|
||||
if (sprite[p->i].extra > max_player_health)
|
||||
sprite[p->i].extra = max_player_health;
|
||||
if (p->GetActor()->s.extra > max_player_health)
|
||||
p->GetActor()->s.extra = max_player_health;
|
||||
p->drink_amt += 10;
|
||||
if (p->drink_amt <= 100 && !S_CheckActorSoundPlaying(p->i, DUKE_USEMEDKIT))
|
||||
S_PlayActorSound(DUKE_USEMEDKIT, p->i);
|
||||
|
@ -445,7 +445,7 @@ void hud_input(int snum)
|
|||
else
|
||||
{
|
||||
// eat cow pie
|
||||
if (p->jetpack_amount > 0 && sprite[p->i].extra < max_player_health)
|
||||
if (p->jetpack_amount > 0 && p->GetActor()->s.extra < max_player_health)
|
||||
{
|
||||
if (!S_CheckActorSoundPlaying(p->i, 429))
|
||||
S_PlayActorSound(429, p->i);
|
||||
|
@ -465,12 +465,12 @@ void hud_input(int snum)
|
|||
p->eat = 100;
|
||||
}
|
||||
|
||||
sprite[p->i].extra += 5;
|
||||
p->GetActor()->s.extra += 5;
|
||||
|
||||
p->inven_icon = 4;
|
||||
|
||||
if (sprite[p->i].extra > max_player_health)
|
||||
sprite[p->i].extra = max_player_health;
|
||||
if (p->GetActor()->s.extra > max_player_health)
|
||||
p->GetActor()->s.extra = max_player_health;
|
||||
|
||||
if (p->jetpack_amount <= 0)
|
||||
checkavailinven(p);
|
||||
|
@ -818,7 +818,7 @@ static void processVehicleInput(player_struct *p, ControlInfo* const hidInput, I
|
|||
static void FinalizeInput(int playerNum, InputPacket& input, bool vehicle)
|
||||
{
|
||||
auto p = &ps[playerNum];
|
||||
bool blocked = movementBlocked(playerNum) || sprite[p->i].extra <= 0 || (p->dead_flag && !ud.god);
|
||||
bool blocked = movementBlocked(playerNum) || p->GetActor()->s.extra <= 0 || (p->dead_flag && !ud.god);
|
||||
|
||||
if (blocked && ps[playerNum].newowner < 0)
|
||||
{
|
||||
|
@ -903,7 +903,7 @@ void GameInterface::GetInput(InputPacket* packet, ControlInfo* const hidInput)
|
|||
processVehicleInput(p, hidInput, input, scaleAdjust);
|
||||
FinalizeInput(myconnectindex, input, true);
|
||||
|
||||
if (!cl_syncinput && sprite[p->i].extra > 0)
|
||||
if (!cl_syncinput && p->GetActor()->s.extra > 0)
|
||||
{
|
||||
apply_seasick(p, scaleAdjust);
|
||||
}
|
||||
|
|
|
@ -146,8 +146,8 @@ void quickkill(struct player_struct* p)
|
|||
{
|
||||
SetPlayerPal(p, PalEntry(48, 48, 48, 48));
|
||||
|
||||
sprite[p->i].extra = 0;
|
||||
sprite[p->i].cstat |= 32768;
|
||||
p->GetActor()->s.extra = 0;
|
||||
p->GetActor()->s.cstat |= 32768;
|
||||
if (ud.god == 0) fi.guts(&hittype[p->i], TILE_JIBS6, 8, myconnectindex);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -54,9 +54,9 @@ void incur_damage_d(struct player_struct* p)
|
|||
{
|
||||
int damage = 0L, shield_damage = 0L;
|
||||
|
||||
sprite[p->i].extra -= p->extra_extra8 >> 8;
|
||||
p->GetActor()->s.extra -= p->extra_extra8 >> 8;
|
||||
|
||||
damage = sprite[p->i].extra - p->last_extra;
|
||||
damage = p->GetActor()->s.extra - p->last_extra;
|
||||
|
||||
if (damage < 0)
|
||||
{
|
||||
|
@ -76,7 +76,7 @@ void incur_damage_d(struct player_struct* p)
|
|||
}
|
||||
}
|
||||
|
||||
sprite[p->i].extra = p->last_extra + damage;
|
||||
p->GetActor()->s.extra = p->last_extra + damage;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1175,7 +1175,7 @@ void selectweapon_d(int snum, int weap) // playernum, weaponnum
|
|||
{
|
||||
int i, j, k;
|
||||
auto p = &ps[snum];
|
||||
if (p->last_pissed_time <= (26 * 218) && p->show_empty_weapon == 0 && p->kickback_pic == 0 && p->quick_kick == 0 && sprite[p->i].xrepeat > 32 && p->access_incs == 0 && p->knee_incs == 0)
|
||||
if (p->last_pissed_time <= (26 * 218) && p->show_empty_weapon == 0 && p->kickback_pic == 0 && p->quick_kick == 0 && p->GetActor()->s.xrepeat > 32 && p->access_incs == 0 && p->knee_incs == 0)
|
||||
{
|
||||
if ((p->weapon_pos == 0 || (p->holster_weapon && p->weapon_pos == -9)))
|
||||
{
|
||||
|
@ -1409,7 +1409,7 @@ int doincrements_d(struct player_struct* p)
|
|||
{
|
||||
int snum;
|
||||
|
||||
snum = sprite[p->i].yvel;
|
||||
snum = p->GetActor()->s.yvel;
|
||||
|
||||
p->player_par++;
|
||||
|
||||
|
@ -1492,7 +1492,7 @@ int doincrements_d(struct player_struct* p)
|
|||
}
|
||||
}
|
||||
|
||||
if (p->quick_kick > 0 && sprite[p->i].pal != 1)
|
||||
if (p->quick_kick > 0 && p->GetActor()->s.pal != 1)
|
||||
{
|
||||
p->last_quick_kick = p->quick_kick + 1;
|
||||
p->quick_kick--;
|
||||
|
@ -1502,10 +1502,10 @@ int doincrements_d(struct player_struct* p)
|
|||
else if (p->last_quick_kick > 0)
|
||||
p->last_quick_kick--;
|
||||
|
||||
if (p->access_incs && sprite[p->i].pal != 1)
|
||||
if (p->access_incs && p->GetActor()->s.pal != 1)
|
||||
{
|
||||
p->access_incs++;
|
||||
if (sprite[p->i].extra <= 0)
|
||||
if (p->GetActor()->s.extra <= 0)
|
||||
p->access_incs = 12;
|
||||
if (p->access_incs == 12)
|
||||
{
|
||||
|
@ -1609,7 +1609,7 @@ void checkweapons_d(struct player_struct* p)
|
|||
|
||||
if (isWW2GI())
|
||||
{
|
||||
int snum = sprite[p->i].yvel;
|
||||
int snum = p->GetActor()->s.yvel;
|
||||
cw = aplWeaponWorksLike[p->curr_weapon][snum];
|
||||
}
|
||||
else
|
||||
|
@ -2509,7 +2509,7 @@ static void operateweapon(int snum, ESyncBits actions, int psect)
|
|||
fi.shoot(pi, FREEZEBLAST);
|
||||
checkavailweapon(p);
|
||||
}
|
||||
if (sprite[p->i].xrepeat < 32)
|
||||
if (p->GetActor()->s.xrepeat < 32)
|
||||
{
|
||||
p->okickback_pic = p->kickback_pic = 0; break;
|
||||
}
|
||||
|
@ -2853,7 +2853,7 @@ void processinput_d(int snum)
|
|||
playerweaponsway(p, s);
|
||||
|
||||
s->xvel = clamp(ksqrt((p->posx - p->bobposx) * (p->posx - p->bobposx) + (p->posy - p->bobposy) * (p->posy - p->bobposy)), 0, 512);
|
||||
if (p->on_ground) p->bobcounter += sprite[p->i].xvel >> 1;
|
||||
if (p->on_ground) p->bobcounter += p->GetActor()->s.xvel >> 1;
|
||||
|
||||
backuppos(p, ud.clipping == 0 && (sector[p->cursectnum].floorpicnum == MIRROR || p->cursectnum < 0 || p->cursectnum >= MAXSECTORS));
|
||||
|
||||
|
|
|
@ -46,9 +46,9 @@ void incur_damage_r(struct player_struct* p)
|
|||
int damage = 0, unk = 0, shield_damage = 0;
|
||||
short gut = 0;
|
||||
|
||||
sprite[p->i].extra -= p->extra_extra8 >> 8;
|
||||
p->GetActor()->s.extra -= p->extra_extra8 >> 8;
|
||||
|
||||
damage = sprite[p->i].extra - p->last_extra;
|
||||
damage = p->GetActor()->s.extra - p->last_extra;
|
||||
if (damage < 0)
|
||||
{
|
||||
p->extra_extra8 = 0;
|
||||
|
@ -78,7 +78,7 @@ void incur_damage_r(struct player_struct* p)
|
|||
break;
|
||||
}
|
||||
|
||||
sprite[p->i].extra = p->last_extra + damage;
|
||||
p->GetActor()->s.extra = p->last_extra + damage;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -980,7 +980,7 @@ void selectweapon_r(int snum, int weap)
|
|||
{
|
||||
int i, j, k;
|
||||
auto p = &ps[snum];
|
||||
if (p->last_pissed_time <= (26 * 218) && p->show_empty_weapon == 0 && p->kickback_pic == 0 && p->quick_kick == 0 && sprite[p->i].xrepeat > 8 && p->access_incs == 0 && p->knee_incs == 0)
|
||||
if (p->last_pissed_time <= (26 * 218) && p->show_empty_weapon == 0 && p->kickback_pic == 0 && p->quick_kick == 0 && p->GetActor()->s.xrepeat > 8 && p->access_incs == 0 && p->knee_incs == 0)
|
||||
{
|
||||
if ((p->weapon_pos == 0 || (p->holster_weapon && p->weapon_pos == -9)))
|
||||
{
|
||||
|
@ -1234,7 +1234,7 @@ int doincrements_r(struct player_struct* p)
|
|||
}
|
||||
}
|
||||
|
||||
snum = sprite[p->i].yvel;
|
||||
snum = p->GetActor()->s.yvel;
|
||||
|
||||
p->player_par++;
|
||||
if (p->yehaa_timer)
|
||||
|
@ -1361,10 +1361,10 @@ int doincrements_r(struct player_struct* p)
|
|||
S_PlayActorSound(DUKE_TAKEPILLS, p->i);
|
||||
}
|
||||
|
||||
if (p->access_incs && sprite[p->i].pal != 1)
|
||||
if (p->access_incs && p->GetActor()->s.pal != 1)
|
||||
{
|
||||
p->access_incs++;
|
||||
if (sprite[p->i].extra <= 0)
|
||||
if (p->GetActor()->s.extra <= 0)
|
||||
p->access_incs = 12;
|
||||
if (p->access_incs == 12)
|
||||
{
|
||||
|
@ -3708,7 +3708,7 @@ void processinput_r(int snum)
|
|||
playerweaponsway(p, s);
|
||||
|
||||
s->xvel = clamp(ksqrt((p->posx - p->bobposx) * (p->posx - p->bobposx) + (p->posy - p->bobposy) * (p->posy - p->bobposy)), 0, 512);
|
||||
if (p->on_ground) p->bobcounter += sprite[p->i].xvel >> 1;
|
||||
if (p->on_ground) p->bobcounter += p->GetActor()->s.xvel >> 1;
|
||||
|
||||
backuppos(p, ud.clipping == 0 && (sector[p->cursectnum].floorpicnum == MIRROR || p->cursectnum < 0 || p->cursectnum >= MAXSECTORS));
|
||||
|
||||
|
|
|
@ -111,8 +111,8 @@ void fakedomovethings(void)
|
|||
|
||||
p = &ps[myconnectindex];
|
||||
|
||||
backcstat = sprite[p->i].cstat;
|
||||
sprite[p->i].cstat &= ~257;
|
||||
backcstat = p->GetActor()->s.cstat;
|
||||
p->GetActor()->s.cstat &= ~257;
|
||||
|
||||
actions = syn->actions;
|
||||
|
||||
|
@ -120,7 +120,7 @@ void fakedomovethings(void)
|
|||
psectlotag = sector[psect].lotag;
|
||||
spritebridge = 0;
|
||||
|
||||
shrunk = (sprite[p->i].yrepeat < (isRR()? 8 : 32));
|
||||
shrunk = (p->GetActor()->s.yrepeat < (isRR()? 8 : 32));
|
||||
|
||||
if( ud.clipping == 0 && ( sector[psect].floorpicnum == MIRROR || psect < 0 || psect >= MAXSECTORS) )
|
||||
{
|
||||
|
@ -181,7 +181,7 @@ void fakedomovethings(void)
|
|||
psectlotag = 0;
|
||||
spritebridge = 1;
|
||||
}
|
||||
if(badguy(&sprite[j]) && sprite[j].xrepeat > 24 && klabs(sprite[p->i].z-sprite[j].z) < (84<<8) )
|
||||
if(badguy(&sprite[j]) && sprite[j].xrepeat > 24 && klabs(p->GetActor()->s.z-sprite[j].z) < (84<<8) )
|
||||
{
|
||||
j = getangle( sprite[j].x-myx,sprite[j].y-myy);
|
||||
myxvel -= sintable[(j+512)&2047]<<4;
|
||||
|
@ -189,7 +189,7 @@ void fakedomovethings(void)
|
|||
}
|
||||
}
|
||||
|
||||
if( sprite[p->i].extra <= 0 )
|
||||
if( p->GetActor()->s.extra <= 0 )
|
||||
{
|
||||
if( psectlotag == 2 )
|
||||
{
|
||||
|
@ -525,7 +525,7 @@ ENDFAKEPROCESSINPUT:
|
|||
myhorizbak[fakemovefifoplc&(MOVEFIFOSIZ-1)] = myhoriz;
|
||||
fakemovefifoplc++;
|
||||
|
||||
sprite[p->i].cstat = backcstat;
|
||||
p->GetActor()->s.cstat = backcstat;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -523,7 +523,7 @@ void displayrooms(int snum, double smoothratio)
|
|||
}
|
||||
else
|
||||
{
|
||||
int i = divscale22(1, isRR() ? 64 : sprite[p->i].yrepeat + 28);
|
||||
int i = divscale22(1, isRR() ? 64 : p->GetActor()->s.yrepeat + 28);
|
||||
fixed_t dang = IntToFixed(1024);
|
||||
if (!isRRRA() || !p->DrugMode)
|
||||
{
|
||||
|
@ -615,7 +615,7 @@ void displayrooms(int snum, double smoothratio)
|
|||
cang += buildang((2 - ((earthquaketime) & 2)) << 2);
|
||||
}
|
||||
|
||||
if (sprite[p->i].pal == 1) cposz -= (18 << 8);
|
||||
if (p->GetActor()->s.pal == 1) cposz -= (18 << 8);
|
||||
|
||||
else if (p->spritebridge == 0 && p->newowner < 0)
|
||||
{
|
||||
|
|
|
@ -86,9 +86,9 @@ void DDukeCommonStatusBar::displayfragbar(void)
|
|||
|
||||
for (i = connecthead; i >= 0; i = connectpoint2[i])
|
||||
{
|
||||
m initext(21 + (73 * (i & 3)), 2 + ((i & 28) << 1), &ud.user_name[i][0], sprite[ps[i].i].pal, 2 + 8 + 16 + 128);
|
||||
m initext(21 + (73 * (i & 3)), 2 + ((i & 28) << 1), &ud.user_name[i][0], ps[i].GetActor()->s.pal, 2 + 8 + 16 + 128);
|
||||
sprintf(tempbuf, "%d", ps[i].frag - ps[i].fraggedself);
|
||||
m initext(17 + 50 + (73 * (i & 3)), 2 + ((i & 28) << 1), tempbuf, sprite[ps[i].i].pal, 2 + 8 + 16 + 128);
|
||||
m initext(17 + 50 + (73 * (i & 3)), 2 + ((i & 28) << 1), tempbuf, ps[i].GetActor()->s.pal, 2 + 8 + 16 + 128);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -131,7 +131,7 @@ public:
|
|||
imgScale = baseScale / img->GetDisplayHeight();
|
||||
DrawGraphic(img, 2, -1.5, DI_ITEM_LEFT_BOTTOM, 1., -1, -1, imgScale, imgScale);
|
||||
|
||||
if (!althud_flashing || p->last_extra > (max_player_health >> 2) || (ud.levelclock & 32) || (sprite[p->i].pal == 1 && p->last_extra < 2))
|
||||
if (!althud_flashing || p->last_extra > (max_player_health >> 2) || (ud.levelclock & 32) || (p->GetActor()->s.pal == 1 && p->last_extra < 2))
|
||||
{
|
||||
int s = -8;
|
||||
if (althud_flashing && p->last_extra > max_player_health)
|
||||
|
@ -233,7 +233,7 @@ public:
|
|||
// health
|
||||
//
|
||||
DrawGraphic(tileGetTexture(HEALTHBOX), 5, -2, DI_ITEM_LEFT_BOTTOM, 1, -1, -1, scale, scale);
|
||||
int health = (sprite[p->i].pal == 1 && p->last_extra < 2) ? 1 : p->last_extra;
|
||||
int health = (p->GetActor()->s.pal == 1 && p->last_extra < 2) ? 1 : p->last_extra;
|
||||
FStringf format("%d", health);
|
||||
SBar_DrawString(this, digiFont, format, 20, -digiFont->mFont->GetHeight() * scale - 3, DI_TEXT_ALIGN_CENTER, CR_UNTRANSLATED, 1, 0, 0, scale, scale);
|
||||
|
||||
|
@ -409,7 +409,7 @@ public:
|
|||
}
|
||||
DrawWeaponAmounts(p, 96, top + 15.5);
|
||||
|
||||
int num = (sprite[p->i].pal == 1 && p->last_extra < 2) ? 1 : p->last_extra;
|
||||
int num = (p->GetActor()->s.pal == 1 && p->last_extra < 2) ? 1 : p->last_extra;
|
||||
format.Format("%d", num);
|
||||
SBar_DrawString(this, digiFont, format, 31, top + 17, DI_TEXT_ALIGN_CENTER, CR_UNTRANSLATED, 1, 0, 0, 1, 1);
|
||||
format.Format("%d", GetMoraleOrShield(p, snum));
|
||||
|
|
|
@ -107,7 +107,7 @@ public:
|
|||
imgScale = baseScale / img->GetDisplayHeight();
|
||||
DrawGraphic(img, 2, -2, DI_ITEM_LEFT_BOTTOM, 1, 0, 0, imgScale, imgScale);
|
||||
|
||||
if (!althud_flashing || p->last_extra > (max_player_health >> 2) || (ud.levelclock & 32) || (sprite[p->i].pal == 1 && p->last_extra < 2))
|
||||
if (!althud_flashing || p->last_extra > (max_player_health >> 2) || (ud.levelclock & 32) || (p->GetActor()->s.pal == 1 && p->last_extra < 2))
|
||||
{
|
||||
int s = -8;
|
||||
if (althud_flashing && p->last_extra > max_player_health)
|
||||
|
@ -227,7 +227,7 @@ public:
|
|||
// health
|
||||
//
|
||||
DrawGraphic(tileGetTexture(HEALTHBOX), 2, -2, DI_ITEM_LEFT_BOTTOM, 1, -1, -1, scale, scale);
|
||||
int health = (sprite[p->i].pal == 1 && p->last_extra < 2) ? 1 : p->last_extra;
|
||||
int health = (p->GetActor()->s.pal == 1 && p->last_extra < 2) ? 1 : p->last_extra;
|
||||
FStringf format("%d", health);
|
||||
SBar_DrawString(this, digiFont, format, 21.5, -digiFont->mFont->GetHeight() * scale - 5.5, DI_TEXT_ALIGN_CENTER, CR_UNTRANSLATED, 1, 0, 0, scale, scale);
|
||||
|
||||
|
@ -376,7 +376,7 @@ public:
|
|||
if (p->keys[1]) DrawGraphic(key, 145, top + 21, DI_ITEM_OFFSETS, 1, -1, -1, scale, scale, 0xffffffff, TRANSLATION(Translation_Remap, 0));
|
||||
}
|
||||
|
||||
int num = (sprite[p->i].pal == 1 && p->last_extra < 2) ? 1 : p->last_extra;
|
||||
int num = (p->GetActor()->s.pal == 1 && p->last_extra < 2) ? 1 : p->last_extra;
|
||||
format.Format("%d", num);
|
||||
SBar_DrawString(this, digiFont, format, 66.5, top + 16, DI_TEXT_ALIGN_CENTER, CR_UNTRANSLATED, 1, 0, 0, scale, scale);
|
||||
|
||||
|
|
|
@ -893,7 +893,7 @@ void checkplayerhurt_d(struct player_struct* p, int j)
|
|||
case CACTUS:
|
||||
if (p->hurt_delay < 8)
|
||||
{
|
||||
sprite[p->i].extra -= 5;
|
||||
p->GetActor()->s.extra -= 5;
|
||||
p->hurt_delay = 16;
|
||||
SetPlayerPal(p, PalEntry(32, 32, 0, 0));
|
||||
S_PlayActorSound(DUKE_LONGTERM_PAIN, p->i);
|
||||
|
@ -912,7 +912,7 @@ void checkplayerhurt_d(struct player_struct* p, int j)
|
|||
case W_FORCEFIELD:
|
||||
case W_FORCEFIELD + 1:
|
||||
case W_FORCEFIELD + 2:
|
||||
sprite[p->i].extra -= 5;
|
||||
p->GetActor()->s.extra -= 5;
|
||||
|
||||
p->hurt_delay = 16;
|
||||
SetPlayerPal(p, PalEntry(32, 32, 0, 0));
|
||||
|
@ -1523,7 +1523,7 @@ void checksectors_d(int snum)
|
|||
|
||||
//After this point the the player effects the map with space
|
||||
|
||||
if (chatmodeon || sprite[p->i].extra <= 0) return;
|
||||
if (chatmodeon || p->GetActor()->s.extra <= 0) return;
|
||||
|
||||
if (ud.cashman && PlayerInput(snum, SB_OPEN))
|
||||
fi.lotsofmoney(&hittype[p->i], 2);
|
||||
|
@ -1571,17 +1571,17 @@ void checksectors_d(int snum)
|
|||
return;
|
||||
|
||||
if (p->newowner >= 0)
|
||||
neartag(p->oposx, p->oposy, p->oposz, sprite[p->i].sectnum, p->angle.oang.asbuild(), &neartagsector, &neartagwall, &neartagsprite, &neartaghitdist, 1280L, 1);
|
||||
neartag(p->oposx, p->oposy, p->oposz, p->GetActor()->s.sectnum, p->angle.oang.asbuild(), &neartagsector, &neartagwall, &neartagsprite, &neartaghitdist, 1280L, 1);
|
||||
else
|
||||
{
|
||||
neartag(p->posx, p->posy, p->posz, sprite[p->i].sectnum, p->angle.oang.asbuild(), &neartagsector, &neartagwall, &neartagsprite, &neartaghitdist, 1280L, 1);
|
||||
neartag(p->posx, p->posy, p->posz, p->GetActor()->s.sectnum, p->angle.oang.asbuild(), &neartagsector, &neartagwall, &neartagsprite, &neartaghitdist, 1280L, 1);
|
||||
if (neartagsprite == -1 && neartagwall == -1 && neartagsector == -1)
|
||||
neartag(p->posx, p->posy, p->posz + (8 << 8), sprite[p->i].sectnum, p->angle.oang.asbuild(), &neartagsector, &neartagwall, &neartagsprite, &neartaghitdist, 1280L, 1);
|
||||
neartag(p->posx, p->posy, p->posz + (8 << 8), p->GetActor()->s.sectnum, p->angle.oang.asbuild(), &neartagsector, &neartagwall, &neartagsprite, &neartaghitdist, 1280L, 1);
|
||||
if (neartagsprite == -1 && neartagwall == -1 && neartagsector == -1)
|
||||
neartag(p->posx, p->posy, p->posz + (16 << 8), sprite[p->i].sectnum, p->angle.oang.asbuild(), &neartagsector, &neartagwall, &neartagsprite, &neartaghitdist, 1280L, 1);
|
||||
neartag(p->posx, p->posy, p->posz + (16 << 8), p->GetActor()->s.sectnum, p->angle.oang.asbuild(), &neartagsector, &neartagwall, &neartagsprite, &neartaghitdist, 1280L, 1);
|
||||
if (neartagsprite == -1 && neartagwall == -1 && neartagsector == -1)
|
||||
{
|
||||
neartag(p->posx, p->posy, p->posz + (16 << 8), sprite[p->i].sectnum, p->angle.oang.asbuild(), &neartagsector, &neartagwall, &neartagsprite, &neartaghitdist, 1280L, 3);
|
||||
neartag(p->posx, p->posy, p->posz + (16 << 8), p->GetActor()->s.sectnum, p->angle.oang.asbuild(), &neartagsector, &neartagwall, &neartagsprite, &neartaghitdist, 1280L, 3);
|
||||
if (neartagsprite >= 0)
|
||||
{
|
||||
switch (sprite[neartagsprite].picnum)
|
||||
|
@ -1611,8 +1611,8 @@ void checksectors_d(int snum)
|
|||
}
|
||||
|
||||
if (p->newowner == -1 && neartagsprite == -1 && neartagsector == -1 && neartagwall == -1)
|
||||
if (isanunderoperator(sector[sprite[p->i].sectnum].lotag))
|
||||
neartagsector = sprite[p->i].sectnum;
|
||||
if (isanunderoperator(sector[p->GetActor()->s.sectnum].lotag))
|
||||
neartagsector = p->GetActor()->s.sectnum;
|
||||
|
||||
if (neartagsector >= 0 && (sector[neartagsector].lotag & 16384))
|
||||
return;
|
||||
|
@ -1643,13 +1643,13 @@ void checksectors_d(int snum)
|
|||
p->holster_weapon = 1;
|
||||
p->weapon_pos = -1;
|
||||
}
|
||||
if (sprite[p->i].extra <= (max_player_health - (max_player_health / 10)))
|
||||
if (p->GetActor()->s.extra <= (max_player_health - (max_player_health / 10)))
|
||||
{
|
||||
sprite[p->i].extra += max_player_health / 10;
|
||||
p->last_extra = sprite[p->i].extra;
|
||||
p->GetActor()->s.extra += max_player_health / 10;
|
||||
p->last_extra = p->GetActor()->s.extra;
|
||||
}
|
||||
else if (sprite[p->i].extra < max_player_health)
|
||||
sprite[p->i].extra = max_player_health;
|
||||
else if (p->GetActor()->s.extra < max_player_health)
|
||||
p->GetActor()->s.extra = max_player_health;
|
||||
}
|
||||
else if (S_CheckSoundPlaying(neartagsprite, FLUSH_TOILET) == 0)
|
||||
S_PlayActorSound(FLUSH_TOILET, neartagsprite);
|
||||
|
@ -1675,16 +1675,16 @@ void checksectors_d(int snum)
|
|||
hittype[neartagsprite].temp_data[0] = 1;
|
||||
sprite[neartagsprite].owner = p->i;
|
||||
|
||||
if (sprite[p->i].extra < max_player_health)
|
||||
if (p->GetActor()->s.extra < max_player_health)
|
||||
{
|
||||
sprite[p->i].extra++;
|
||||
p->GetActor()->s.extra++;
|
||||
S_PlayActorSound(DUKE_DRINKING, p->i);
|
||||
}
|
||||
}
|
||||
return;
|
||||
case PLUG:
|
||||
S_PlayActorSound(SHORT_CIRCUIT, p->i);
|
||||
sprite[p->i].extra -= 2 + (krand() & 3);
|
||||
p->GetActor()->s.extra -= 2 + (krand() & 3);
|
||||
SetPlayerPal(p, PalEntry(32, 48, 48, 64));
|
||||
break;
|
||||
case VIEWSCREEN:
|
||||
|
@ -1777,16 +1777,16 @@ void checksectors_d(int snum)
|
|||
}
|
||||
operatesectors(neartagsector, p->GetActor());
|
||||
}
|
||||
else if ((sector[sprite[p->i].sectnum].lotag & 16384) == 0)
|
||||
else if ((sector[p->GetActor()->s.sectnum].lotag & 16384) == 0)
|
||||
{
|
||||
if (isanunderoperator(sector[sprite[p->i].sectnum].lotag))
|
||||
if (isanunderoperator(sector[p->GetActor()->s.sectnum].lotag))
|
||||
{
|
||||
SectIterator it(sprite[p->i].sectnum);
|
||||
SectIterator it(p->GetActor()->s.sectnum);
|
||||
while ((i = it.NextIndex()) >= 0)
|
||||
{
|
||||
if (sprite[i].picnum == ACTIVATOR || sprite[i].picnum == MASTERSWITCH) return;
|
||||
}
|
||||
operatesectors(sprite[p->i].sectnum, p->GetActor());
|
||||
operatesectors(p->GetActor()->s.sectnum, p->GetActor());
|
||||
}
|
||||
else fi.checkhitswitch(snum, neartagwall, 0);
|
||||
}
|
||||
|
|
|
@ -1380,7 +1380,7 @@ void checkplayerhurt_r(struct player_struct* p, int j)
|
|||
case RRTILE2455:
|
||||
if (isRRRA() && p->hurt_delay2 < 8)
|
||||
{
|
||||
sprite[p->i].extra -= 2;
|
||||
p->GetActor()->s.extra -= 2;
|
||||
p->hurt_delay2 = 16;
|
||||
SetPlayerPal(p, PalEntry(32, 32, 0, 0));
|
||||
S_PlayActorSound(DUKE_LONGTERM_PAIN, p->i);
|
||||
|
@ -1389,7 +1389,7 @@ void checkplayerhurt_r(struct player_struct* p, int j)
|
|||
case CACTUS:
|
||||
if (!isRRRA() && p->hurt_delay < 8)
|
||||
{
|
||||
sprite[p->i].extra -= 5;
|
||||
p->GetActor()->s.extra -= 5;
|
||||
p->hurt_delay = 16;
|
||||
SetPlayerPal(p, PalEntry(32, 32, 0, 0));
|
||||
S_PlayActorSound(DUKE_LONGTERM_PAIN, p->i);
|
||||
|
@ -2465,7 +2465,7 @@ void checksectors_r(int snum)
|
|||
|
||||
//After this point the the player effects the map with space
|
||||
|
||||
if (chatmodeon || sprite[p->i].extra <= 0) return;
|
||||
if (chatmodeon || p->GetActor()->s.extra <= 0) return;
|
||||
|
||||
if (ud.cashman && PlayerInput(snum, SB_OPEN))
|
||||
fi.lotsofmoney(&hittype[p->i], 2);
|
||||
|
@ -2539,21 +2539,21 @@ void checksectors_r(int snum)
|
|||
}
|
||||
return;
|
||||
}
|
||||
neartag(p->posx, p->posy, p->posz, sprite[p->i].sectnum, p->angle.oang.asbuild(), &neartagsector, &neartagwall, &neartagsprite, &neartaghitdist, 1280L, 3);
|
||||
neartag(p->posx, p->posy, p->posz, p->GetActor()->s.sectnum, p->angle.oang.asbuild(), &neartagsector, &neartagwall, &neartagsprite, &neartaghitdist, 1280L, 3);
|
||||
}
|
||||
|
||||
if (p->newowner >= 0)
|
||||
neartag(p->oposx, p->oposy, p->oposz, sprite[p->i].sectnum, p->angle.oang.asbuild(), &neartagsector, &neartagwall, &neartagsprite, &neartaghitdist, 1280L, 1);
|
||||
neartag(p->oposx, p->oposy, p->oposz, p->GetActor()->s.sectnum, p->angle.oang.asbuild(), &neartagsector, &neartagwall, &neartagsprite, &neartaghitdist, 1280L, 1);
|
||||
else
|
||||
{
|
||||
neartag(p->posx, p->posy, p->posz, sprite[p->i].sectnum, p->angle.oang.asbuild(), &neartagsector, &neartagwall, &neartagsprite, &neartaghitdist, 1280L, 1);
|
||||
neartag(p->posx, p->posy, p->posz, p->GetActor()->s.sectnum, p->angle.oang.asbuild(), &neartagsector, &neartagwall, &neartagsprite, &neartaghitdist, 1280L, 1);
|
||||
if (neartagsprite == -1 && neartagwall == -1 && neartagsector == -1)
|
||||
neartag(p->posx, p->posy, p->posz + (8 << 8), sprite[p->i].sectnum, p->angle.oang.asbuild(), &neartagsector, &neartagwall, &neartagsprite, &neartaghitdist, 1280L, 1);
|
||||
neartag(p->posx, p->posy, p->posz + (8 << 8), p->GetActor()->s.sectnum, p->angle.oang.asbuild(), &neartagsector, &neartagwall, &neartagsprite, &neartaghitdist, 1280L, 1);
|
||||
if (neartagsprite == -1 && neartagwall == -1 && neartagsector == -1)
|
||||
neartag(p->posx, p->posy, p->posz + (16 << 8), sprite[p->i].sectnum, p->angle.oang.asbuild(), &neartagsector, &neartagwall, &neartagsprite, &neartaghitdist, 1280L, 1);
|
||||
neartag(p->posx, p->posy, p->posz + (16 << 8), p->GetActor()->s.sectnum, p->angle.oang.asbuild(), &neartagsector, &neartagwall, &neartagsprite, &neartaghitdist, 1280L, 1);
|
||||
if (neartagsprite == -1 && neartagwall == -1 && neartagsector == -1)
|
||||
{
|
||||
neartag(p->posx, p->posy, p->posz + (16 << 8), sprite[p->i].sectnum, p->angle.oang.asbuild(), &neartagsector, &neartagwall, &neartagsprite, &neartaghitdist, 1280L, 3);
|
||||
neartag(p->posx, p->posy, p->posz + (16 << 8), p->GetActor()->s.sectnum, p->angle.oang.asbuild(), &neartagsector, &neartagwall, &neartagsprite, &neartaghitdist, 1280L, 3);
|
||||
if (neartagsprite >= 0)
|
||||
{
|
||||
switch (sprite[neartagsprite].picnum)
|
||||
|
@ -2576,8 +2576,8 @@ void checksectors_r(int snum)
|
|||
}
|
||||
|
||||
if (p->newowner == -1 && neartagsprite == -1 && neartagsector == -1 && neartagwall == -1)
|
||||
if (isanunderoperator(sector[sprite[p->i].sectnum].lotag))
|
||||
neartagsector = sprite[p->i].sectnum;
|
||||
if (isanunderoperator(sector[p->GetActor()->s.sectnum].lotag))
|
||||
neartagsector = p->GetActor()->s.sectnum;
|
||||
|
||||
if (neartagsector >= 0 && (sector[neartagsector].lotag & 16384))
|
||||
return;
|
||||
|
@ -2660,13 +2660,13 @@ void checksectors_r(int snum)
|
|||
p->holster_weapon = 1;
|
||||
p->weapon_pos = -1;
|
||||
}
|
||||
if (sprite[p->i].extra <= (max_player_health - (max_player_health / 10)))
|
||||
if (p->GetActor()->s.extra <= (max_player_health - (max_player_health / 10)))
|
||||
{
|
||||
sprite[p->i].extra += max_player_health / 10;
|
||||
p->last_extra = sprite[p->i].extra;
|
||||
p->GetActor()->s.extra += max_player_health / 10;
|
||||
p->last_extra = p->GetActor()->s.extra;
|
||||
}
|
||||
else if (sprite[p->i].extra < max_player_health)
|
||||
sprite[p->i].extra = max_player_health;
|
||||
else if (p->GetActor()->s.extra < max_player_health)
|
||||
p->GetActor()->s.extra = max_player_health;
|
||||
}
|
||||
else if (S_CheckActorSoundPlaying(p->i, DUKE_GRUNT) == 0)
|
||||
S_PlayActorSound(DUKE_GRUNT, p->i);
|
||||
|
@ -2677,16 +2677,16 @@ void checksectors_r(int snum)
|
|||
hittype[neartagsprite].temp_data[0] = 1;
|
||||
sprite[neartagsprite].owner = p->i;
|
||||
|
||||
if (sprite[p->i].extra < max_player_health)
|
||||
if (p->GetActor()->s.extra < max_player_health)
|
||||
{
|
||||
sprite[p->i].extra++;
|
||||
p->GetActor()->s.extra++;
|
||||
S_PlayActorSound(DUKE_DRINKING, p->i);
|
||||
}
|
||||
}
|
||||
return;
|
||||
case PLUG:
|
||||
S_PlayActorSound(SHORT_CIRCUIT, p->i);
|
||||
sprite[p->i].extra -= 2 + (krand() & 3);
|
||||
p->GetActor()->s.extra -= 2 + (krand() & 3);
|
||||
SetPlayerPal(p, PalEntry(32, 48, 48, 64));
|
||||
break;
|
||||
}
|
||||
|
@ -2733,17 +2733,17 @@ void checksectors_r(int snum)
|
|||
FTA(41, p);
|
||||
}
|
||||
}
|
||||
else if ((sector[sprite[p->i].sectnum].lotag & 16384) == 0)
|
||||
else if ((sector[p->GetActor()->s.sectnum].lotag & 16384) == 0)
|
||||
{
|
||||
if (isanunderoperator(sector[sprite[p->i].sectnum].lotag))
|
||||
if (isanunderoperator(sector[p->GetActor()->s.sectnum].lotag))
|
||||
{
|
||||
SectIterator it(sprite[p->i].sectnum);
|
||||
SectIterator it(p->GetActor()->s.sectnum);
|
||||
while ((i = it.NextIndex()) >= 0)
|
||||
{
|
||||
if (sprite[i].picnum == ACTIVATOR || sprite[i].picnum == MASTERSWITCH) return;
|
||||
}
|
||||
if (haskey(neartagsector, snum))
|
||||
operatesectors(sprite[p->i].sectnum, p->GetActor());
|
||||
operatesectors(p->GetActor()->s.sectnum, p->GetActor());
|
||||
else
|
||||
{
|
||||
if (hittype[neartagsprite].spriteextra > 3)
|
||||
|
|
Loading…
Reference in a new issue