MCPcopy Create free account
hub / github.com/diasurgical/devilution / S_StartSPBuy

Function S_StartSPBuy

Source/stores.cpp:537–570  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

535}
536
537BOOL S_StartSPBuy()
538{
539 int i;
540
541 storenumh = 0;
542 for (i = 0; i < 6; i++) {
543 if (premiumitem[i]._itype != ITYPE_NONE)
544 storenumh++;
545 }
546 if (!storenumh) {
547 StartStore(STORE_SMITH);
548 stextsel = 14;
549 return FALSE;
550 }
551
552 stextsize = 1;
553 stextscrl = TRUE;
554 stextsval = 0;
555
556 sprintf(tempstr, "I have these premium items for sale : Your gold : %i", plr[myplr]._pGold);
557 AddSText(0, 1, 1, tempstr, COL_GOLD, 0);
558 AddSLine(3);
559 AddSLine(21);
560 AddSText(0, 22, 1, "Back", COL_WHITE, 0);
561 OffsetSTextY(22, 6);
562
563 stextsmax = storenumh - 4;
564 if (stextsmax < 0)
565 stextsmax = 0;
566
567 S_ScrollSPBuy(stextsval);
568
569 return TRUE;
570}
571
572BOOL SmithSellOk(int i)
573{

Callers 1

StartStoreFunction · 0.85

Calls 5

StartStoreFunction · 0.85
AddSTextFunction · 0.85
AddSLineFunction · 0.85
OffsetSTextYFunction · 0.85
S_ScrollSPBuyFunction · 0.85

Tested by

no test coverage detected