Skip to content
Permalink
Browse files

added spellpower! most important gameplay change so far

  • Loading branch information...
qndel committed Sep 13, 2018
1 parent d041454 commit 39c6b4cba7a77571af4dc86508f09b978138e280
BIN +3.74 KB (100%) Infernity.zip
Binary file not shown.
@@ -352,8 +352,16 @@ void AddItemToDrawQueue(int x, int y, int id) {
lootFilterData lfd = luaLootFilter(name, plr[myplr]._pClass, itemName, it->_itype, (int)it->_iLoc, rarity, GetItemColor(id));
if (lfd.show == false) { return; }
int centerXOffset = GetTextWidth((char*)lfd.name.c_str()) ;
if (zoomflag) {
x -= centerXOffset / 2 + 20;
y -= 193;
}
else {

x -= centerXOffset + 20;
y -= 0;

}
drawQ.push_back(drawingQueue(x, y, GetTextWidth((char*)lfd.name.c_str()), 13, it->_ix, it->_iy, id, lfd.color2, lfd.name, 1, lfd.r, lfd.g,lfd.b));

}
@@ -415,7 +423,6 @@ void HighlightItemsNameOnMap()

int bgcolor = 0;
if(true){

char color = t.color;
int sx = t.new_x;
int sy = t.new_y;
@@ -190,7 +190,8 @@ int PanBtnPos[8][5] =
{ 560, 361, 71, 19, 1 },
{ 560, 387, 71, 19, 0 },
{ 87, 443, 33, 32, 1 },
{ 527, 443, 33, 32, 1 }
//{ 527, 443, 33, 32, 1 } // relocating player friendly/hostile button
{ 87, 410, 33, 32, 1 }
};
char *PanBtnHotKey[8] = { "'c'", "'q'", "Tab", "Esc", "'i'", "'b'", "Enter", NULL };
char *PanBtnStr[8] =
@@ -1556,7 +1557,8 @@ void __cdecl DrawCtrlPan()
v3 = panbtn[7] + 3;
else
v3 = panbtn[7] + 5;
CelDecodeOnly(591 + GetWidthDiff() / 2, 634 + GetHeightDiff(), pMultiBtns, v3, 33);
//CelDecodeOnly(591 + GetWidthDiff() / 2, 634 + GetHeightDiff(), pMultiBtns, v3, 33);
CelDecodeOnly(151 + GetWidthDiff() / 2, 602 + GetHeightDiff(), pMultiBtns, v3, 33);
}
}
// 484368: using guessed type int FriendlyMode;
@@ -3263,12 +3265,14 @@ void __cdecl DrawSpellBook()
v5 = v4 >> 6;
v12 = v4 >> 6;
GetDamageAmt(v2, &sel, &v11);
sel = sel*CalculateSpellPower(myplr)/100;
v11 = v11*CalculateSpellPower(myplr) / 100;
if ( sel == -1 )
sprintf(tempstr, "Mana: %i Dam: n/a", v5);
else
sprintf(tempstr, "Mana: %i Dam: %i - %i", v5, sel, v11);
if ( v2 == SPL_BONESPIRIT )
sprintf(tempstr, "Mana: %i Dam: 1/3 tgt hp", v12);
sprintf(tempstr, "Mana: %i Dam: 1/8 tgt hp", v12);
PrintSBookStr(10, v8, 0, tempstr, 0);
v6 = plr[myplr]._pISplLvlAdd + plr[myplr]._pSplLvl[v2];
if ( v6 < 0 )
@@ -1901,7 +1901,7 @@ void PrintDebugInfo() {
std::stringstream ss;
int isActivated = -1;
if (pcursmonst != -1) { isActivated = monster[pcursmonst].isActivated; }
ss << "debuginfo: " << MouseX << " " << MouseY << " " << plr[myplr].WorldX << " "<< plr[myplr].WorldY;
ss << "debuginfo: " << MouseX << " " << MouseY << " " << (int)plr[myplr]._pSplLvl[plr[myplr]._pRSpell] << " " << (int)plr[myplr]._pISplLvlAdd;
if (played == false) {
PlaySFX(num++);
played = true;
@@ -78,6 +78,7 @@ void ReloadConfig();
bool CanPutToBelt(int miscId);
int FreeSlotOnBelt();
bool CanRun(int pnum);
int CalculateSpellPower(int pnum);
int MonstersInCombat(int pnum);
int GetTextWidth(char* s);
void PrintDebugInfo();
@@ -20,7 +20,7 @@ const int init_inf = 0x7F800000; // weak
/* data */

char gszVersionNumber[260] = "internal version unknown";
char gszProductName[260] = "Infernity v1.19";
char gszProductName[260] = "Infernity v1.20";

struct init_cpp_init
{
@@ -118,7 +118,7 @@ void __fastcall mainmenu_action(int option)
while ( 1 )
{
a2 = 0;
if ( !UiMainMenuDialog("Infernity v1.19", &a2, effects_play_sound, 30) )
if ( !UiMainMenuDialog("Infernity v1.20", &a2, effects_play_sound, 30) )
TermMsg("Unable to display mainmenu");
if ( a2 == 1 )
break;
@@ -764,7 +764,6 @@ void __fastcall GetDamageAmt(int i, int *mind, int *maxd)
return;
}
}

int __fastcall CheckBlock(int fx, int fy, int tx, int ty)
{
int v4; // edi
@@ -1312,7 +1311,33 @@ bool __fastcall MonsterTrapHit(int m, int mindam, int maxdam, int dist, int t, i
return 1;
}

bool __fastcall MonsterMHit(int pnum, int m, int mindam, int maxdam, int dist, int t, int shift)

int CalculateSpellPower(int pnum) {
int power = 50;
int activeSpellType = plr[pnum]._pRSplType;
int magPower = (plr[pnum]._pMagic / 5);
int spellLevel = plr[myplr]._pSplLvl[plr[pnum]._pRSpell] + plr[myplr]._pISplLvlAdd;

power += 5 * spellLevel;

power += magPower;
int hpPercent = (plr[pnum]._pHPPer * 10) / 8;
int reverseHpPercent = 100 - hpPercent;
if (plr[pnum].pManaShield) {
power = power * 3 / 4;
power = (power*hpPercent*hpPercent)/10000;
}
if (!plr[pnum].pManaShield) {
power += (power*reverseHpPercent) / 200;
}

if (activeSpellType == 2 || activeSpellType == 3) {
power = power * 3 / 2;
}
return power;
}

bool __fastcall MonsterMissileHit(int pnum, int m, int mindam, int maxdam, int dist, int t, int shift)
{
int v7; // edi
bool v8; // zf
@@ -1410,9 +1435,9 @@ bool __fastcall MonsterMHit(int pnum, int m, int mindam, int maxdam, int dist, i
if (v25 >= v13)
return 0;
#endif
if (t == 63)
if (t == MIS_BONESPIRIT)
{
v19 = monster[v7]._mhitpoints / 3 >> 6;
v19 = monster[v7]._mhitpoints / 8 >> 6;
}
else
{
@@ -1431,6 +1456,9 @@ bool __fastcall MonsterMHit(int pnum, int m, int mindam, int maxdam, int dist, i
if (plr[v12]._pIFlags & 0x40000000 && monster[v7].MData->mMonstClass == 1) {//civerb affix for missiles
v19 *= 3;
}
if (t != MIS_ARROW) {
v19 = (v19*CalculateSpellPower(pnum))/100;
}


if (!(_BYTE)shift)
@@ -1486,7 +1514,7 @@ bool __fastcall MonsterMHit(int pnum, int m, int mindam, int maxdam, int dist, i
return 1;
}

bool __fastcall PlayerMHit(int pnum, int m, int dist, int mind, int maxd, int mtype, int shift, int earflag)
bool __fastcall PlayerMissileHit(int pnum, int m, int dist, int mind, int maxd, int mtype, int shift, int earflag)
{
int v8; // ebx
int v9; // esi
@@ -1527,6 +1555,12 @@ bool __fastcall PlayerMHit(int pnum, int m, int dist, int mind, int maxd, int mt
{
return 0;
}

if (mtype == MIS_FIREMOVE && m == -1) {
return 0;
}


v10 = 100;
v32 = random(72, 100);
#ifdef _DEBUG
@@ -2095,7 +2129,7 @@ void __fastcall CheckMissileCol(int i, int mindam, int maxdam, bool shift, int m
{
v28 = missile[v8]._mitype;
v27 = missile[v8]._midist;
v22 = v9 == 4 ? MonsterMHit(missile[v8]._misource, v21 - 1, v7, maxdam, v27, v28, shift) : MonsterTrapHit(v21 - 1, v7, maxdam, v27, v28, shift);
v22 = v9 == 4 ? MonsterMissileHit(missile[v8]._misource, v21 - 1, v7, maxdam, v27, v28, shift) : MonsterTrapHit(v21 - 1, v7, maxdam, v27, v28, shift);
if (v22)
{
if (!(_BYTE)nodel)
@@ -2107,15 +2141,7 @@ void __fastcall CheckMissileCol(int i, int mindam, int maxdam, bool shift, int m
v23 = getImprovedMissilePlayer(mx, my);
if (v23 > 0)
{
v17 = PlayerMHit(
v23 - 1,
-1,
missile[v8]._midist,
v7,
maxdam,
missile[v8]._mitype,
shift,
_LOBYTE(missile[v8]._miAnimType) == 4);
v17 = PlayerMissileHit(v23 - 1,-1,missile[v8]._midist,v7,maxdam,missile[v8]._mitype,shift,_LOBYTE(missile[v8]._miAnimType) == 4);
LABEL_35:
if (v17)
{
@@ -2156,11 +2182,11 @@ void __fastcall CheckMissileCol(int i, int mindam, int maxdam, bool shift, int m
shift);
goto LABEL_35;
}
v13 = MonsterMHit(v10,-1 - v12,mindama,maxdam,missile[v8]._midist,missile[v8]._mitype,shift);
v13 = MonsterMissileHit(v10,-1 - v12,mindama,maxdam,missile[v8]._midist,missile[v8]._mitype,shift);
}
else
{
v13 = MonsterMHit(v10, v12 - 1, v7, maxdam, missile[v8]._midist, missile[v8]._mitype, shift);
v13 = MonsterMissileHit(v10, v12 - 1, v7, maxdam, missile[v8]._midist, missile[v8]._mitype, shift);
}
if (v13)
{
@@ -2199,15 +2225,7 @@ void __fastcall CheckMissileCol(int i, int mindam, int maxdam, bool shift, int m
v20 = getImprovedMissilePlayer(mx, my);
if (v20 > 0)
{
v17 = PlayerMHit(
v20 - 1,
missile[v8]._misource,
missile[v8]._midist,
mindama,
maxdam,
missile[v8]._mitype,
shift,
0);
v17 = PlayerMissileHit(v20 - 1,missile[v8]._misource,missile[v8]._midist,mindama,maxdam,missile[v8]._mitype,shift,0);
goto LABEL_35;
}
}
@@ -7380,7 +7398,8 @@ void __fastcall MI_Bonespirit(int i)
v9 = v8;
v10 = monster[v8]._my;
v11 = monster[v8]._mx;
missile[v2]._midam = monster[v8]._mhitpoints >> 7;
//missile[v2]._midam = monster[v8]._mhitpoints >> 7;
missile[v2]._midam = monster[v8]._mhitpoints >> 9; // bone spirit nerf?
v12 = GetDirection8(v7, y1, v11, v10);
SetMissDir(ia, v12);
GetMissileVel(ia, v7, y1, monster[v9]._mx, monster[v9]._my, 16);
@@ -23,8 +23,8 @@ void __fastcall PutMissile(int i);
void __fastcall GetMissilePos(int i);
void __fastcall MoveMissilePos(int i);
bool __fastcall MonsterTrapHit(int m, int mindam, int maxdam, int dist, int t, int shift);
bool __fastcall MonsterMHit(int pnum, int m, int mindam, int maxdam, int dist, int t, int shift);
bool __fastcall PlayerMHit(int pnum, int m, int dist, int mind, int maxd, int mtype, int shift, int earflag);
bool __fastcall MonsterMissileHit(int pnum, int m, int mindam, int maxdam, int dist, int t, int shift);
bool __fastcall PlayerMissileHit(int pnum, int m, int dist, int mind, int maxd, int mtype, int shift, int earflag);
bool __fastcall Plr2PlrMHit(int pnum, int p, int mindam, int maxdam, int dist, int mtype, int shift);
void __fastcall CheckMissileCol(int i, int mindam, int maxdam, bool shift, int mx, int my, int nodel);
void __fastcall SetMissAnim(int mi, int animtype);
@@ -326,25 +326,25 @@ char *shrinestrs[26] =

char *shrinedesc[26] =
{
"+5 to one attribute, -1 to others",
"-10 dura to one item, +10 to others",
"+2ac to items, -1 dmg to weapon",
"+5 to one attribute",
"-10 dura to one item",
"-1 dmg to weapon",
"weapon damage +1",
"cast mana shield",
"recharge staves",
"repair all items",
"-1 to random spell level, +1 to others",
"-1 to random spell level",
"refill chests",
"firebolt level +2",
"refill mana",
"cast mana shield",
"potions become rejuvenation",
"turn potions",
"+2 to magic",
"get 2 potions",
"cast phasing",
"holy bolt level +2",
"fill inventory with gold",
"refill hp/mana for other players",
"refill hp/mana",
"+2 to dexterity",
"+2 to strength",
"+2 to vitality",
@@ -355,6 +355,38 @@ char *shrinedesc[26] =
};



char *shrinedesc2[26] =
{
"-1 to others",
"+10 to others",
"-1 dmg to weapon",
"",
"",
"",
"",
"-1 to random spell level",
"",
"",
"",
"",
"into rejuvenenation",
"",
"",
"",
"",
"fill inventory with gold",
"for other players",
"",
"",
"",
"",
"2",
"",
""
};


unsigned char shrinemin[26] =
{
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -6791,7 +6823,7 @@ void __fastcall BreakBarrel(int pnum, int i, int dam, unsigned char forcebreak,
MonsterTrapHit(v11 - 1, 1, 4, 0, 1, 0);
v12 = dPlayer[0][forcebreaka];
if ( v12 > 0 )
PlayerMHit(v12 - 1, -1, 0, 8, 16, 1, 0, 0);
PlayerMissileHit(v12 - 1, -1, 0, 8, 16, 1, 0, 0);
v13 = dObject[0][forcebreaka];
if ( v13 > 0 )
{
@@ -7259,6 +7291,7 @@ void __fastcall GetObjectStr(int i)
sprintf(tempstr, "%s Shrine", shrinestrs[object[v1]._oVar1]);
strcpy(infostr, tempstr);
AddPanelString(shrinedesc[object[v1]._oVar1], 1);
AddPanelString(shrinedesc2[object[v1]._oVar1], 1);
break;
case OBJ_SKELBOOK:
strcpy(infostr, "Skeleton Tome");
@@ -155,6 +155,7 @@ extern int bxadd[8];
extern int byadd[8];
extern char *shrinestrs[26];
extern char *shrinedesc[26];
extern char *shrinedesc2[26];
extern unsigned char shrinemin[26];
extern unsigned char shrinemax[26];
extern unsigned char shrineavail[26];
@@ -3905,6 +3905,15 @@ void __cdecl DrawAndBlit()
}
DrawXpBar();
DrawNumbersOnHealthMana();
PrintGameStr(526 + GetWidthDiff() / 2, 436 + GetHeightDiff(), "Spell", COL_ORANGE);
PrintGameStr(516 + GetWidthDiff() / 2, 446 + GetHeightDiff(), "Power", COL_ORANGE);
int power = CalculateSpellPower(myplr);
std::stringstream ss;
ss << power << "%";
int powercol = COL_GOLD;
if (power < 100) { powercol = COL_RED; };
if (power > 100) { powercol = COL_ORANGE; }
PrintGameStr(524 + GetWidthDiff() / 2, 466 + GetHeightDiff(), (char*)ss.str().c_str(), powercol);
PrintDebugInfo();
if (lootFilterBroken == true) {
std::string s="Loot filter broken! Fix the errors and press L to reload!";

0 comments on commit 39c6b4c

Please sign in to comment.
You can’t perform that action at this time.