mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-02-09 15:00:48 +00:00
parent
04dd939d65
commit
0263d8eed0
2 changed files with 31 additions and 29 deletions
|
@ -172,12 +172,6 @@ void BuildItemAnim(short nSprite);
|
||||||
void DestroyItemAnim(short nSprite);
|
void DestroyItemAnim(short nSprite);
|
||||||
void ItemFlash();
|
void ItemFlash();
|
||||||
void FillItems(short nPlayer);
|
void FillItems(short nPlayer);
|
||||||
void UseEye(short nPlayer);
|
|
||||||
void UseMask(short nPlayer);
|
|
||||||
void UseTorch(short nPlayer);
|
|
||||||
void UseHeart(short nPlayer);
|
|
||||||
void UseScarab(short nPlayer);
|
|
||||||
void UseHand(short nPlayer);
|
|
||||||
void UseItem(short nPlayer, short nItem);
|
void UseItem(short nPlayer, short nItem);
|
||||||
void UseCurItem(short nPlayer);
|
void UseCurItem(short nPlayer);
|
||||||
int GrabItem(short nPlayer, short nItem);
|
int GrabItem(short nPlayer, short nItem);
|
||||||
|
|
|
@ -176,11 +176,10 @@ void FillItems(short nPlayer)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UseEye(short nPlayer)
|
static bool UseEye(short nPlayer)
|
||||||
{
|
{
|
||||||
if (nPlayerInvisible[nPlayer] >= 0) {
|
if (nPlayerInvisible[nPlayer] >= 0)
|
||||||
nPlayerInvisible[nPlayer] = 900;
|
nPlayerInvisible[nPlayer] = 900;
|
||||||
}
|
|
||||||
|
|
||||||
int nSprite = PlayerList[nPlayer].nSprite;
|
int nSprite = PlayerList[nPlayer].nSprite;
|
||||||
|
|
||||||
|
@ -195,9 +194,10 @@ void UseEye(short nPlayer)
|
||||||
ItemFlash();
|
ItemFlash();
|
||||||
D3PlayFX(StaticSound[kSound31], nSprite);
|
D3PlayFX(StaticSound[kSound31], nSprite);
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UseMask(short nPlayer)
|
static bool UseMask(short nPlayer)
|
||||||
{
|
{
|
||||||
PlayerList[nPlayer].nMaskAmount = 1350;
|
PlayerList[nPlayer].nMaskAmount = 1350;
|
||||||
PlayerList[nPlayer].nAir = 100;
|
PlayerList[nPlayer].nAir = 100;
|
||||||
|
@ -207,47 +207,52 @@ void UseMask(short nPlayer)
|
||||||
SetAirFrame();
|
SetAirFrame();
|
||||||
D3PlayFX(StaticSound[kSound31], PlayerList[nPlayer].nSprite);
|
D3PlayFX(StaticSound[kSound31], PlayerList[nPlayer].nSprite);
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UseTorch(short nPlayer)
|
bool UseTorch(short nPlayer)
|
||||||
{
|
{
|
||||||
if (!nPlayerTorch[nPlayer]) {
|
if (!nPlayerTorch[nPlayer])
|
||||||
|
{
|
||||||
SetTorch(nPlayer, 1);
|
SetTorch(nPlayer, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
nPlayerTorch[nPlayer] = 900;
|
nPlayerTorch[nPlayer] = 900;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UseHeart(short nPlayer)
|
bool UseHeart(short nPlayer)
|
||||||
{
|
{
|
||||||
if (PlayerList[nPlayer].nHealth < kMaxHealth) {
|
if (PlayerList[nPlayer].nHealth < kMaxHealth) {
|
||||||
PlayerList[nPlayer].nHealth = kMaxHealth;
|
PlayerList[nPlayer].nHealth = kMaxHealth;
|
||||||
}
|
|
||||||
|
|
||||||
if (nPlayer == nLocalPlayer)
|
if (nPlayer == nLocalPlayer)
|
||||||
{
|
{
|
||||||
ItemFlash();
|
ItemFlash();
|
||||||
SetHealthFrame(1);
|
SetHealthFrame(1);
|
||||||
D3PlayFX(StaticSound[kSound31], PlayerList[nPlayer].nSprite);
|
D3PlayFX(StaticSound[kSound31], PlayerList[nPlayer].nSprite);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// invincibility
|
// invincibility
|
||||||
void UseScarab(short nPlayer)
|
bool UseScarab(short nPlayer)
|
||||||
{
|
{
|
||||||
if (PlayerList[nPlayer].invincibility > 0 && PlayerList[nPlayer].invincibility < 900) {
|
if (PlayerList[nPlayer].invincibility > 0 && PlayerList[nPlayer].invincibility < 900)
|
||||||
PlayerList[nPlayer].invincibility = 900;
|
PlayerList[nPlayer].invincibility = 900;
|
||||||
}
|
|
||||||
|
|
||||||
if (nPlayer == nLocalPlayer)
|
if (nPlayer == nLocalPlayer)
|
||||||
{
|
{
|
||||||
ItemFlash();
|
ItemFlash();
|
||||||
D3PlayFX(StaticSound[kSound31], PlayerList[nPlayer].nSprite);
|
D3PlayFX(StaticSound[kSound31], PlayerList[nPlayer].nSprite);
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// faster firing
|
// faster firing
|
||||||
void UseHand(short nPlayer)
|
static bool UseHand(short nPlayer)
|
||||||
{
|
{
|
||||||
nPlayerDouble[nPlayer] = 1350;
|
nPlayerDouble[nPlayer] = 1350;
|
||||||
|
|
||||||
|
@ -256,33 +261,36 @@ void UseHand(short nPlayer)
|
||||||
ItemFlash();
|
ItemFlash();
|
||||||
D3PlayFX(StaticSound[kSound31], PlayerList[nPlayer].nSprite);
|
D3PlayFX(StaticSound[kSound31], PlayerList[nPlayer].nSprite);
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UseItem(short nPlayer, short nItem)
|
void UseItem(short nPlayer, short nItem)
|
||||||
{
|
{
|
||||||
|
bool didit = false;
|
||||||
switch (nItem)
|
switch (nItem)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
UseHeart(nPlayer);
|
didit = UseHeart(nPlayer);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
UseScarab(nPlayer);
|
didit = UseScarab(nPlayer);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
UseTorch(nPlayer);
|
didit = UseTorch(nPlayer);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
UseHand(nPlayer);
|
didit = UseHand(nPlayer);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
UseEye(nPlayer);
|
didit = UseEye(nPlayer);
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
UseMask(nPlayer);
|
didit = UseMask(nPlayer);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (!didit) return;
|
||||||
|
|
||||||
PlayerList[nPlayer].items[nItem]--;
|
PlayerList[nPlayer].items[nItem]--;
|
||||||
int nItemCount = PlayerList[nPlayer].items[nItem];
|
int nItemCount = PlayerList[nPlayer].items[nItem];
|
||||||
|
|
Loading…
Reference in a new issue