Browse Source

[hellfire] UseItem

pull/956/head
Anders Jenbo 5 years ago
parent
commit
e80d87a9bc
  1. 46
      Source/items.cpp

46
Source/items.cpp

@ -4562,9 +4562,17 @@ void UseItem(int p, int Mid, int spl)
case IMISC_MEAT: case IMISC_MEAT:
j = plr[p]._pMaxHP >> 8; j = plr[p]._pMaxHP >> 8;
l = ((j >> 1) + random_(39, j)) << 6; l = ((j >> 1) + random_(39, j)) << 6;
#ifdef HELLFIRE
if (plr[p]._pClass == PC_WARRIOR || plr[p]._pClass == PC_BARBARIAN)
#else
if (plr[p]._pClass == PC_WARRIOR) if (plr[p]._pClass == PC_WARRIOR)
l *= 2; #endif
l <<= 1;
#ifdef HELLFIRE
if (plr[p]._pClass == PC_ROGUE || plr[p]._pClass == PC_MONK || plr[p]._pClass == PC_BARD)
#else
if (plr[p]._pClass == PC_ROGUE) if (plr[p]._pClass == PC_ROGUE)
#endif
l += l >> 1; l += l >> 1;
plr[p]._pHitPoints += l; plr[p]._pHitPoints += l;
if (plr[p]._pHitPoints > plr[p]._pMaxHP) if (plr[p]._pHitPoints > plr[p]._pMaxHP)
@ -4583,8 +4591,12 @@ void UseItem(int p, int Mid, int spl)
j = plr[p]._pMaxMana >> 8; j = plr[p]._pMaxMana >> 8;
l = ((j >> 1) + random_(40, j)) << 6; l = ((j >> 1) + random_(40, j)) << 6;
if (plr[p]._pClass == PC_SORCERER) if (plr[p]._pClass == PC_SORCERER)
l *= 2; l <<= 1;
#ifdef HELLFIRE
if (plr[p]._pClass == PC_ROGUE || plr[p]._pClass == PC_MONK || plr[p]._pClass == PC_BARD)
#else
if (plr[p]._pClass == PC_ROGUE) if (plr[p]._pClass == PC_ROGUE)
#endif
l += l >> 1; l += l >> 1;
if (!(plr[p]._pIFlags & ISPL_NOMANA)) { if (!(plr[p]._pIFlags & ISPL_NOMANA)) {
plr[p]._pMana += l; plr[p]._pMana += l;
@ -4608,18 +4620,32 @@ void UseItem(int p, int Mid, int spl)
break; break;
case IMISC_ELIXMAG: case IMISC_ELIXMAG:
ModifyPlrMag(p, 1); ModifyPlrMag(p, 1);
#ifdef HELLFIRE
plr[p]._pMana = plr[p]._pMaxMana;
plr[p]._pManaBase = plr[p]._pMaxManaBase;
drawmanaflag = TRUE;
#endif
break; break;
case IMISC_ELIXDEX: case IMISC_ELIXDEX:
ModifyPlrDex(p, 1); ModifyPlrDex(p, 1);
break; break;
case IMISC_ELIXVIT: case IMISC_ELIXVIT:
ModifyPlrVit(p, 1); ModifyPlrVit(p, 1);
#ifdef HELLFIRE
plr[p]._pHitPoints = plr[p]._pMaxHP;
plr[p]._pHPBase = plr[p]._pMaxHPBase;
drawhpflag = TRUE;
#endif
break; break;
case IMISC_REJUV: case IMISC_REJUV:
j = plr[p]._pMaxHP >> 8; j = plr[p]._pMaxHP >> 8;
l = ((j >> 1) + random_(39, j)) << 6; l = ((j >> 1) + random_(39, j)) << 6;
#ifdef HELLFIRE
if (plr[p]._pClass == PC_WARRIOR || plr[p]._pClass == PC_BARBARIAN)
#else
if (plr[p]._pClass == PC_WARRIOR) if (plr[p]._pClass == PC_WARRIOR)
l *= 2; #endif
l <<= 1;
if (plr[p]._pClass == PC_ROGUE) if (plr[p]._pClass == PC_ROGUE)
l += l >> 1; l += l >> 1;
plr[p]._pHitPoints += l; plr[p]._pHitPoints += l;
@ -4632,7 +4658,7 @@ void UseItem(int p, int Mid, int spl)
j = plr[p]._pMaxMana >> 8; j = plr[p]._pMaxMana >> 8;
l = ((j >> 1) + random_(40, j)) << 6; l = ((j >> 1) + random_(40, j)) << 6;
if (plr[p]._pClass == PC_SORCERER) if (plr[p]._pClass == PC_SORCERER)
l *= 2; l <<= 1;
if (plr[p]._pClass == PC_ROGUE) if (plr[p]._pClass == PC_ROGUE)
l += l >> 1; l += l >> 1;
if (!(plr[p]._pIFlags & ISPL_NOMANA)) { if (!(plr[p]._pIFlags & ISPL_NOMANA)) {
@ -4729,7 +4755,7 @@ void UseItem(int p, int Mid, int spl)
if (!invflag) { if (!invflag) {
invflag = TRUE; invflag = TRUE;
} }
SetCursor_(CURSOR_OIL); NewCursor(CURSOR_OIL);
break; break;
#endif #endif
case IMISC_SPECELIX: case IMISC_SPECELIX:
@ -4743,31 +4769,31 @@ void UseItem(int p, int Mid, int spl)
plr[p]._pTSpell = SPL_RUNEFIRE; plr[p]._pTSpell = SPL_RUNEFIRE;
plr[p]._pTSplType = RSPLTYPE_INVALID; plr[p]._pTSplType = RSPLTYPE_INVALID;
if (p == myplr) if (p == myplr)
SetCursor_(CURSOR_TELEPORT); NewCursor(CURSOR_TELEPORT);
break; break;
case IMISC_RUNEL: case IMISC_RUNEL:
plr[p]._pTSpell = SPL_RUNELIGHT; plr[p]._pTSpell = SPL_RUNELIGHT;
plr[p]._pTSplType = RSPLTYPE_INVALID; plr[p]._pTSplType = RSPLTYPE_INVALID;
if (p == myplr) if (p == myplr)
SetCursor_(CURSOR_TELEPORT); NewCursor(CURSOR_TELEPORT);
break; break;
case IMISC_GR_RUNEL: case IMISC_GR_RUNEL:
plr[p]._pTSpell = SPL_RUNENOVA; plr[p]._pTSpell = SPL_RUNENOVA;
plr[p]._pTSplType = RSPLTYPE_INVALID; plr[p]._pTSplType = RSPLTYPE_INVALID;
if (p == myplr) if (p == myplr)
SetCursor_(CURSOR_TELEPORT); NewCursor(CURSOR_TELEPORT);
break; break;
case IMISC_GR_RUNEF: case IMISC_GR_RUNEF:
plr[p]._pTSpell = SPL_RUNEIMMOLAT; plr[p]._pTSpell = SPL_RUNEIMMOLAT;
plr[p]._pTSplType = RSPLTYPE_INVALID; plr[p]._pTSplType = RSPLTYPE_INVALID;
if (p == myplr) if (p == myplr)
SetCursor_(CURSOR_TELEPORT); NewCursor(CURSOR_TELEPORT);
break; break;
case IMISC_RUNES: case IMISC_RUNES:
plr[p]._pTSpell = SPL_RUNESTONE; plr[p]._pTSpell = SPL_RUNESTONE;
plr[p]._pTSplType = RSPLTYPE_INVALID; plr[p]._pTSplType = RSPLTYPE_INVALID;
if (p == myplr) if (p == myplr)
SetCursor_(CURSOR_TELEPORT); NewCursor(CURSOR_TELEPORT);
break; break;
#endif #endif
} }

Loading…
Cancel
Save