Browse Source

some enums (#1816)

pull/393/head
qndel 7 years ago committed by Anders Jenbo
parent
commit
57f1fcce4c
  1. 16
      Source/diablo.cpp
  2. 18
      Source/inv.cpp
  3. 2
      Source/multi.cpp

16
Source/diablo.cpp

@ -1335,43 +1335,43 @@ void PressChar(int vkey)
case '!': case '!':
case '1': case '1':
if (plr[myplr].SpdList[0]._itype != -1 && plr[myplr].SpdList[0]._itype != 11) { if (plr[myplr].SpdList[0]._itype != -1 && plr[myplr].SpdList[0]._itype != 11) {
UseInvItem(myplr, 47); UseInvItem(myplr, INVITEM_BELT_FIRST);
} }
return; return;
case '@': case '@':
case '2': case '2':
if (plr[myplr].SpdList[1]._itype != -1 && plr[myplr].SpdList[1]._itype != 11) { if (plr[myplr].SpdList[1]._itype != -1 && plr[myplr].SpdList[1]._itype != 11) {
UseInvItem(myplr, 48); UseInvItem(myplr, INVITEM_BELT_FIRST + 1);
} }
return; return;
case '#': case '#':
case '3': case '3':
if (plr[myplr].SpdList[2]._itype != -1 && plr[myplr].SpdList[2]._itype != 11) { if (plr[myplr].SpdList[2]._itype != -1 && plr[myplr].SpdList[2]._itype != 11) {
UseInvItem(myplr, 49); UseInvItem(myplr, INVITEM_BELT_FIRST + 2);
} }
return; return;
case '$': case '$':
case '4': case '4':
if (plr[myplr].SpdList[3]._itype != -1 && plr[myplr].SpdList[3]._itype != 11) { if (plr[myplr].SpdList[3]._itype != -1 && plr[myplr].SpdList[3]._itype != 11) {
UseInvItem(myplr, 50); UseInvItem(myplr, INVITEM_BELT_FIRST + 3);
} }
return; return;
case '%': case '%':
case '5': case '5':
if (plr[myplr].SpdList[4]._itype != -1 && plr[myplr].SpdList[4]._itype != 11) { if (plr[myplr].SpdList[4]._itype != -1 && plr[myplr].SpdList[4]._itype != 11) {
UseInvItem(myplr, 51); UseInvItem(myplr, INVITEM_BELT_FIRST + 4);
} }
return; return;
case '^': case '^':
case '6': case '6':
if (plr[myplr].SpdList[5]._itype != -1 && plr[myplr].SpdList[5]._itype != 11) { if (plr[myplr].SpdList[5]._itype != -1 && plr[myplr].SpdList[5]._itype != 11) {
UseInvItem(myplr, 52); UseInvItem(myplr, INVITEM_BELT_FIRST + 5);
} }
return; return;
case '&': case '&':
case '7': case '7':
if (plr[myplr].SpdList[6]._itype != -1 && plr[myplr].SpdList[6]._itype != 11) { if (plr[myplr].SpdList[6]._itype != -1 && plr[myplr].SpdList[6]._itype != 11) {
UseInvItem(myplr, 53); UseInvItem(myplr, INVITEM_BELT_FIRST + 6);
} }
return; return;
case '*': case '*':
@ -1383,7 +1383,7 @@ void PressChar(int vkey)
} }
#endif #endif
if (plr[myplr].SpdList[7]._itype != -1 && plr[myplr].SpdList[7]._itype != 11) { if (plr[myplr].SpdList[7]._itype != -1 && plr[myplr].SpdList[7]._itype != 11) {
UseInvItem(myplr, 54); UseInvItem(myplr, INVITEM_BELT_FIRST + 7);
} }
return; return;
#ifdef _DEBUG #ifdef _DEBUG

18
Source/inv.cpp

@ -426,30 +426,30 @@ void DrawInvBelt()
continue; continue;
} }
InvDrawSlotBack(InvRect[i + 65].X + 64, InvRect[i + 65].Y + 159, 28, 28); InvDrawSlotBack(InvRect[i + SLOTXY_BELT_FIRST].X + 64, InvRect[i + SLOTXY_BELT_FIRST].Y + 159, 28, 28);
frame = plr[myplr].SpdList[i]._iCurs + CURSOR_FIRSTITEM; frame = plr[myplr].SpdList[i]._iCurs + CURSOR_FIRSTITEM;
frame_width = InvItemWidth[frame]; frame_width = InvItemWidth[frame];
if (pcursinvitem == i + 47) { if (pcursinvitem == i + INVITEM_BELT_FIRST) {
colour = ICOL_WHITE; colour = ICOL_WHITE;
if (plr[myplr].SpdList[i]._iMagical) if (plr[myplr].SpdList[i]._iMagical)
colour = ICOL_BLUE; colour = ICOL_BLUE;
if (!plr[myplr].SpdList[i]._iStatFlag) if (!plr[myplr].SpdList[i]._iStatFlag)
colour = ICOL_RED; colour = ICOL_RED;
CelBlitOutline(colour, InvRect[i + 65].X + 64, InvRect[i + 65].Y + 159, pCursCels, frame, frame_width, 0, 8); CelBlitOutline(colour, InvRect[i + SLOTXY_BELT_FIRST].X + 64, InvRect[i + SLOTXY_BELT_FIRST].Y + 159, pCursCels, frame, frame_width, 0, 8);
} }
if (plr[myplr].SpdList[i]._iStatFlag) if (plr[myplr].SpdList[i]._iStatFlag)
CelClippedDraw(InvRect[i + 65].X + 64, InvRect[i + 65].Y + 159, pCursCels, frame, frame_width, 0, 8); CelClippedDraw(InvRect[i + SLOTXY_BELT_FIRST].X + 64, InvRect[i + SLOTXY_BELT_FIRST].Y + 159, pCursCels, frame, frame_width, 0, 8);
else else
CelDrawLightRed(InvRect[i + 65].X + 64, InvRect[i + 65].Y + 159, pCursCels, frame, frame_width, 0, 8, 1); CelDrawLightRed(InvRect[i + SLOTXY_BELT_FIRST].X + 64, InvRect[i + SLOTXY_BELT_FIRST].Y + 159, pCursCels, frame, frame_width, 0, 8, 1);
if (AllItemsList[plr[myplr].SpdList[i].IDidx].iUsable if (AllItemsList[plr[myplr].SpdList[i].IDidx].iUsable
&& plr[myplr].SpdList[i]._iStatFlag && plr[myplr].SpdList[i]._iStatFlag
&& plr[myplr].SpdList[i]._itype != ITYPE_GOLD) { && plr[myplr].SpdList[i]._itype != ITYPE_GOLD) {
fi = i + 49; fi = i + 49;
ff = fontframe[gbFontTransTbl[fi]]; ff = fontframe[gbFontTransTbl[fi]];
CPrintString(InvRect[i + 65].X + 64 + PitchTbl[InvRect[i + 65].Y + 159] - fontkern[ff] + 28, ff, 0); CPrintString(InvRect[i + SLOTXY_BELT_FIRST].X + 64 + PitchTbl[InvRect[i + SLOTXY_BELT_FIRST].Y + 159] - fontkern[ff] + 28, ff, 0);
} }
} }
} }
@ -2078,10 +2078,10 @@ BOOL UseStaff()
void StartGoldDrop() void StartGoldDrop()
{ {
initialDropGoldIndex = pcursinvitem; initialDropGoldIndex = pcursinvitem;
if (pcursinvitem <= 46) if (pcursinvitem <= INVITEM_INV_LAST)
initialDropGoldValue = plr[myplr].InvList[pcursinvitem - 7]._ivalue; initialDropGoldValue = plr[myplr].InvList[pcursinvitem - INVITEM_INV_FIRST]._ivalue;
else else
initialDropGoldValue = plr[myplr].SpdList[pcursinvitem - 47]._ivalue; initialDropGoldValue = plr[myplr].SpdList[pcursinvitem - INVITEM_BELT_FIRST]._ivalue;
dropGoldFlag = TRUE; dropGoldFlag = TRUE;
dropGoldValue = 0; dropGoldValue = 0;
if (talkflag) if (talkflag)

2
Source/multi.cpp

@ -351,7 +351,7 @@ void multi_mon_seeds()
sgdwGameLoops++; sgdwGameLoops++;
l = _rotr(sgdwGameLoops, 8); l = _rotr(sgdwGameLoops, 8);
for (i = 0; i < 200; i++) for (i = 0; i < MAXMONSTERS; i++)
monster[i]._mAISeed = l + i; monster[i]._mAISeed = l + i;
} }

Loading…
Cancel
Save