From a23839b8e80d0063548b3adf2dbfe308cac039af Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 19 Oct 2020 00:04:02 +0200 Subject: [PATCH] WIP --- source/games/whaven/src/2d.cpp | 73 ++++++++++++++++++++++++++ source/games/whaven/src/potions.cpp | 45 ---------------- source/games/whaven/src/spellbooks.cpp | 24 --------- 3 files changed, 73 insertions(+), 69 deletions(-) diff --git a/source/games/whaven/src/2d.cpp b/source/games/whaven/src/2d.cpp index 52bf83acb..04a9f4b39 100644 --- a/source/games/whaven/src/2d.cpp +++ b/source/games/whaven/src/2d.cpp @@ -34,4 +34,77 @@ void showVictoryScreen() //game.changeScreen(gVictoryScreen); } +#if 0 +void orbpic(PLAYER& plr, int currentorb) { + if (plr.orbammo[currentorb] < 0) + plr.orbammo[currentorb] = 0; + +#pragma message("fix orbpic") +#if 0 + itoa(plr->orbammo[currentorb],tempbuf,10); + + int y = 382;// was 389 originally. + if (currentorb == 2) + y = 381; + if (currentorb == 3) + y = 383; + if (currentorb == 6) + y = 383; + if (currentorb == 7) + y = 380; + + int spellbookpage = sspellbookanim[currentorb][8].daweaponframe; + overwritesprite(121 << 1, y, spellbookpage, 0, 0, 0); + fancyfont(126<<1,439,SSCOREFONT-26,tempbuf,0); +#endif +} + + +void potionpic(PLAYER& plr, int currentpotion, int x, int y, int scale) { + int tilenum = SFLASKBLUE; + + if( netgame ) + return; +#pragma message("fix potionpic") +#if 0 + x = x + mulscale(200, scale, 16); + y = y - mulscale(94, scale, 16); + engine.rotatesprite(x<<16,y<<16,scale,0,SPOTIONBACKPIC,0, 0, 8 | 16, 0, 0, xdim, ydim-1); + engine.rotatesprite((x - mulscale(4, scale, 16))<<16,(y - mulscale(7, scale, 16))<<16,scale,0,SPOTIONARROW+currentpotion,0, 0, 8 | 16, 0, 0, xdim, ydim-1); + + x += mulscale(4, scale, 16); + for(int i = 0; i < MAXPOTIONS; i++) { + if(plr.potion[i] < 0) + plr.potion[i] = 0; + if(plr.potion[i] > 0) { + switch(i) { + case 1: + tilenum=SFLASKGREEN; + break; + case 2: + tilenum=SFLASKOCHRE; + break; + case 3: + tilenum=SFLASKRED; + break; + case 4: + tilenum=SFLASKTAN; + break; + } + potiontilenum=tilenum; + + engine.rotatesprite((x + mulscale(i*20, scale, 16))<<16,(y + mulscale(19, scale, 16))<<16,scale,0,potiontilenum,0, 0, 8 | 16, 0, 0, xdim, ydim-1); + char potionbuf[50]; + Bitoa(plr.potion[i],potionbuf); + + fancyfont((266<<1)+(i*20),394,SPOTIONFONT-26,potionbuf,0); + //game.getFont(3).drawText(x + mulscale(7 +(i*20), scale, 16),y+mulscale(7, scale, 16), potionbuf, scale, 0, 0, TextAlign.Left, 0, false); + } + else + engine.rotatesprite((x + mulscale(i*20, scale, 16))<<16,(y + mulscale(19, scale, 16))<<16,scale,0,SFLASKBLACK,0, 0, 8 | 16, 0, 0, xdim, ydim-1); + } +#endif +} +#endif + END_WH_NS diff --git a/source/games/whaven/src/potions.cpp b/source/games/whaven/src/potions.cpp index af0b3866b..78fcbece1 100644 --- a/source/games/whaven/src/potions.cpp +++ b/source/games/whaven/src/potions.cpp @@ -130,51 +130,6 @@ void updatepotion(PLAYER& plr, int vial) { } } -void potionpic(PLAYER& plr, int currentpotion, int x, int y, int scale) { - int tilenum = SFLASKBLUE; - - if( netgame ) - return; -#pragma message("fix potionpic") -#if 0 - x = x + mulscale(200, scale, 16); - y = y - mulscale(94, scale, 16); - engine.rotatesprite(x<<16,y<<16,scale,0,SPOTIONBACKPIC,0, 0, 8 | 16, 0, 0, xdim, ydim-1); - engine.rotatesprite((x - mulscale(4, scale, 16))<<16,(y - mulscale(7, scale, 16))<<16,scale,0,SPOTIONARROW+currentpotion,0, 0, 8 | 16, 0, 0, xdim, ydim-1); - - x += mulscale(4, scale, 16); - for(int i = 0; i < MAXPOTIONS; i++) { - if(plr.potion[i] < 0) - plr.potion[i] = 0; - if(plr.potion[i] > 0) { - switch(i) { - case 1: - tilenum=SFLASKGREEN; - break; - case 2: - tilenum=SFLASKOCHRE; - break; - case 3: - tilenum=SFLASKRED; - break; - case 4: - tilenum=SFLASKTAN; - break; - } - potiontilenum=tilenum; - - engine.rotatesprite((x + mulscale(i*20, scale, 16))<<16,(y + mulscale(19, scale, 16))<<16,scale,0,potiontilenum,0, 0, 8 | 16, 0, 0, xdim, ydim-1); - char potionbuf[50]; - Bitoa(plr.potion[i],potionbuf); - - game.getFont(3).drawText(x + mulscale(7 +(i*20), scale, 16),y+mulscale(7, scale, 16), potionbuf, scale, 0, 0, TextAlign.Left, 0, false); - } - else - engine.rotatesprite((x + mulscale(i*20, scale, 16))<<16,(y + mulscale(19, scale, 16))<<16,scale,0,SFLASKBLACK,0, 0, 8 | 16, 0, 0, xdim, ydim-1); - } -#endif -} - void randompotion(int i) { if ((krand() % 100) > 20) return; diff --git a/source/games/whaven/src/spellbooks.cpp b/source/games/whaven/src/spellbooks.cpp index bef910ea2..8e5783caa 100644 --- a/source/games/whaven/src/spellbooks.cpp +++ b/source/games/whaven/src/spellbooks.cpp @@ -454,28 +454,4 @@ void displayspelltext(PLAYER& plr) { } } -void orbpic(PLAYER& plr, int currentorb) { - if (plr.orbammo[currentorb] < 0) - plr.orbammo[currentorb] = 0; - -#pragma message("fix orbpic") -#if 0 - Bitoa(plr.orbammo[currentorb], tempchar); - - int y = 382; - if (currentorb == 2) - y = 381; - if (currentorb == 3) - y = 383; - if (currentorb == 6) - y = 383; - if (currentorb == 7) - y = 380; - - int spellbookpage = sspellbookanim[currentorb][8].daweaponframe; - overwritesprite(121 << 1, y, spellbookpage, 0, 0, 0); - game.getFont(4).drawText(126 << 1,439, tempchar, 0, 0, TextAlign.Left, 0, false); -#endif -} - END_WH_NS