Skip to content

Commit 39c6b4c

Browse files
committed
added spellpower! most important gameplay change so far
1 parent d041454 commit 39c6b4c

File tree

12 files changed

+117
-43
lines changed

12 files changed

+117
-43
lines changed

Infernity.zip

3.74 KB
Binary file not shown.

Source/automap.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,16 @@ void AddItemToDrawQueue(int x, int y, int id) {
352352
lootFilterData lfd = luaLootFilter(name, plr[myplr]._pClass, itemName, it->_itype, (int)it->_iLoc, rarity, GetItemColor(id));
353353
if (lfd.show == false) { return; }
354354
int centerXOffset = GetTextWidth((char*)lfd.name.c_str()) ;
355+
if (zoomflag) {
355356
x -= centerXOffset / 2 + 20;
356357
y -= 193;
358+
}
359+
else {
360+
361+
x -= centerXOffset + 20;
362+
y -= 0;
363+
364+
}
357365
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));
358366

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

416424
int bgcolor = 0;
417425
if(true){
418-
419426
char color = t.color;
420427
int sx = t.new_x;
421428
int sy = t.new_y;

Source/control.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,8 @@ int PanBtnPos[8][5] =
190190
{ 560, 361, 71, 19, 1 },
191191
{ 560, 387, 71, 19, 0 },
192192
{ 87, 443, 33, 32, 1 },
193-
{ 527, 443, 33, 32, 1 }
193+
//{ 527, 443, 33, 32, 1 } // relocating player friendly/hostile button
194+
{ 87, 410, 33, 32, 1 }
194195
};
195196
char *PanBtnHotKey[8] = { "'c'", "'q'", "Tab", "Esc", "'i'", "'b'", "Enter", NULL };
196197
char *PanBtnStr[8] =
@@ -1556,7 +1557,8 @@ void __cdecl DrawCtrlPan()
15561557
v3 = panbtn[7] + 3;
15571558
else
15581559
v3 = panbtn[7] + 5;
1559-
CelDecodeOnly(591 + GetWidthDiff() / 2, 634 + GetHeightDiff(), pMultiBtns, v3, 33);
1560+
//CelDecodeOnly(591 + GetWidthDiff() / 2, 634 + GetHeightDiff(), pMultiBtns, v3, 33);
1561+
CelDecodeOnly(151 + GetWidthDiff() / 2, 602 + GetHeightDiff(), pMultiBtns, v3, 33);
15601562
}
15611563
}
15621564
// 484368: using guessed type int FriendlyMode;
@@ -3263,12 +3265,14 @@ void __cdecl DrawSpellBook()
32633265
v5 = v4 >> 6;
32643266
v12 = v4 >> 6;
32653267
GetDamageAmt(v2, &sel, &v11);
3268+
sel = sel*CalculateSpellPower(myplr)/100;
3269+
v11 = v11*CalculateSpellPower(myplr) / 100;
32663270
if ( sel == -1 )
32673271
sprintf(tempstr, "Mana: %i Dam: n/a", v5);
32683272
else
32693273
sprintf(tempstr, "Mana: %i Dam: %i - %i", v5, sel, v11);
32703274
if ( v2 == SPL_BONESPIRIT )
3271-
sprintf(tempstr, "Mana: %i Dam: 1/3 tgt hp", v12);
3275+
sprintf(tempstr, "Mana: %i Dam: 1/8 tgt hp", v12);
32723276
PrintSBookStr(10, v8, 0, tempstr, 0);
32733277
v6 = plr[myplr]._pISplLvlAdd + plr[myplr]._pSplLvl[v2];
32743278
if ( v6 < 0 )

Source/engine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1901,7 +1901,7 @@ void PrintDebugInfo() {
19011901
std::stringstream ss;
19021902
int isActivated = -1;
19031903
if (pcursmonst != -1) { isActivated = monster[pcursmonst].isActivated; }
1904-
ss << "debuginfo: " << MouseX << " " << MouseY << " " << plr[myplr].WorldX << " "<< plr[myplr].WorldY;
1904+
ss << "debuginfo: " << MouseX << " " << MouseY << " " << (int)plr[myplr]._pSplLvl[plr[myplr]._pRSpell] << " " << (int)plr[myplr]._pISplLvlAdd;
19051905
if (played == false) {
19061906
PlaySFX(num++);
19071907
played = true;

Source/engine.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ void ReloadConfig();
7878
bool CanPutToBelt(int miscId);
7979
int FreeSlotOnBelt();
8080
bool CanRun(int pnum);
81+
int CalculateSpellPower(int pnum);
8182
int MonstersInCombat(int pnum);
8283
int GetTextWidth(char* s);
8384
void PrintDebugInfo();

Source/init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const int init_inf = 0x7F800000; // weak
2020
/* data */
2121

2222
char gszVersionNumber[260] = "internal version unknown";
23-
char gszProductName[260] = "Infernity v1.19";
23+
char gszProductName[260] = "Infernity v1.20";
2424

2525
struct init_cpp_init
2626
{

Source/mainmenu.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ void __fastcall mainmenu_action(int option)
118118
while ( 1 )
119119
{
120120
a2 = 0;
121-
if ( !UiMainMenuDialog("Infernity v1.19", &a2, effects_play_sound, 30) )
121+
if ( !UiMainMenuDialog("Infernity v1.20", &a2, effects_play_sound, 30) )
122122
TermMsg("Unable to display mainmenu");
123123
if ( a2 == 1 )
124124
break;

Source/missiles.cpp

Lines changed: 46 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,6 @@ void __fastcall GetDamageAmt(int i, int *mind, int *maxd)
764764
return;
765765
}
766766
}
767-
768767
int __fastcall CheckBlock(int fx, int fy, int tx, int ty)
769768
{
770769
int v4; // edi
@@ -1312,7 +1311,33 @@ bool __fastcall MonsterTrapHit(int m, int mindam, int maxdam, int dist, int t, i
13121311
return 1;
13131312
}
13141313

1315-
bool __fastcall MonsterMHit(int pnum, int m, int mindam, int maxdam, int dist, int t, int shift)
1314+
1315+
int CalculateSpellPower(int pnum) {
1316+
int power = 50;
1317+
int activeSpellType = plr[pnum]._pRSplType;
1318+
int magPower = (plr[pnum]._pMagic / 5);
1319+
int spellLevel = plr[myplr]._pSplLvl[plr[pnum]._pRSpell] + plr[myplr]._pISplLvlAdd;
1320+
1321+
power += 5 * spellLevel;
1322+
1323+
power += magPower;
1324+
int hpPercent = (plr[pnum]._pHPPer * 10) / 8;
1325+
int reverseHpPercent = 100 - hpPercent;
1326+
if (plr[pnum].pManaShield) {
1327+
power = power * 3 / 4;
1328+
power = (power*hpPercent*hpPercent)/10000;
1329+
}
1330+
if (!plr[pnum].pManaShield) {
1331+
power += (power*reverseHpPercent) / 200;
1332+
}
1333+
1334+
if (activeSpellType == 2 || activeSpellType == 3) {
1335+
power = power * 3 / 2;
1336+
}
1337+
return power;
1338+
}
1339+
1340+
bool __fastcall MonsterMissileHit(int pnum, int m, int mindam, int maxdam, int dist, int t, int shift)
13161341
{
13171342
int v7; // edi
13181343
bool v8; // zf
@@ -1410,9 +1435,9 @@ bool __fastcall MonsterMHit(int pnum, int m, int mindam, int maxdam, int dist, i
14101435
if (v25 >= v13)
14111436
return 0;
14121437
#endif
1413-
if (t == 63)
1438+
if (t == MIS_BONESPIRIT)
14141439
{
1415-
v19 = monster[v7]._mhitpoints / 3 >> 6;
1440+
v19 = monster[v7]._mhitpoints / 8 >> 6;
14161441
}
14171442
else
14181443
{
@@ -1431,6 +1456,9 @@ bool __fastcall MonsterMHit(int pnum, int m, int mindam, int maxdam, int dist, i
14311456
if (plr[v12]._pIFlags & 0x40000000 && monster[v7].MData->mMonstClass == 1) {//civerb affix for missiles
14321457
v19 *= 3;
14331458
}
1459+
if (t != MIS_ARROW) {
1460+
v19 = (v19*CalculateSpellPower(pnum))/100;
1461+
}
14341462

14351463

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

1489-
bool __fastcall PlayerMHit(int pnum, int m, int dist, int mind, int maxd, int mtype, int shift, int earflag)
1517+
bool __fastcall PlayerMissileHit(int pnum, int m, int dist, int mind, int maxd, int mtype, int shift, int earflag)
14901518
{
14911519
int v8; // ebx
14921520
int v9; // esi
@@ -1527,6 +1555,12 @@ bool __fastcall PlayerMHit(int pnum, int m, int dist, int mind, int maxd, int mt
15271555
{
15281556
return 0;
15291557
}
1558+
1559+
if (mtype == MIS_FIREMOVE && m == -1) {
1560+
return 0;
1561+
}
1562+
1563+
15301564
v10 = 100;
15311565
v32 = random(72, 100);
15321566
#ifdef _DEBUG
@@ -2095,7 +2129,7 @@ void __fastcall CheckMissileCol(int i, int mindam, int maxdam, bool shift, int m
20952129
{
20962130
v28 = missile[v8]._mitype;
20972131
v27 = missile[v8]._midist;
2098-
v22 = v9 == 4 ? MonsterMHit(missile[v8]._misource, v21 - 1, v7, maxdam, v27, v28, shift) : MonsterTrapHit(v21 - 1, v7, maxdam, v27, v28, shift);
2132+
v22 = v9 == 4 ? MonsterMissileHit(missile[v8]._misource, v21 - 1, v7, maxdam, v27, v28, shift) : MonsterTrapHit(v21 - 1, v7, maxdam, v27, v28, shift);
20992133
if (v22)
21002134
{
21012135
if (!(_BYTE)nodel)
@@ -2107,15 +2141,7 @@ void __fastcall CheckMissileCol(int i, int mindam, int maxdam, bool shift, int m
21072141
v23 = getImprovedMissilePlayer(mx, my);
21082142
if (v23 > 0)
21092143
{
2110-
v17 = PlayerMHit(
2111-
v23 - 1,
2112-
-1,
2113-
missile[v8]._midist,
2114-
v7,
2115-
maxdam,
2116-
missile[v8]._mitype,
2117-
shift,
2118-
_LOBYTE(missile[v8]._miAnimType) == 4);
2144+
v17 = PlayerMissileHit(v23 - 1,-1,missile[v8]._midist,v7,maxdam,missile[v8]._mitype,shift,_LOBYTE(missile[v8]._miAnimType) == 4);
21192145
LABEL_35:
21202146
if (v17)
21212147
{
@@ -2156,11 +2182,11 @@ void __fastcall CheckMissileCol(int i, int mindam, int maxdam, bool shift, int m
21562182
shift);
21572183
goto LABEL_35;
21582184
}
2159-
v13 = MonsterMHit(v10,-1 - v12,mindama,maxdam,missile[v8]._midist,missile[v8]._mitype,shift);
2185+
v13 = MonsterMissileHit(v10,-1 - v12,mindama,maxdam,missile[v8]._midist,missile[v8]._mitype,shift);
21602186
}
21612187
else
21622188
{
2163-
v13 = MonsterMHit(v10, v12 - 1, v7, maxdam, missile[v8]._midist, missile[v8]._mitype, shift);
2189+
v13 = MonsterMissileHit(v10, v12 - 1, v7, maxdam, missile[v8]._midist, missile[v8]._mitype, shift);
21642190
}
21652191
if (v13)
21662192
{
@@ -2199,15 +2225,7 @@ void __fastcall CheckMissileCol(int i, int mindam, int maxdam, bool shift, int m
21992225
v20 = getImprovedMissilePlayer(mx, my);
22002226
if (v20 > 0)
22012227
{
2202-
v17 = PlayerMHit(
2203-
v20 - 1,
2204-
missile[v8]._misource,
2205-
missile[v8]._midist,
2206-
mindama,
2207-
maxdam,
2208-
missile[v8]._mitype,
2209-
shift,
2210-
0);
2228+
v17 = PlayerMissileHit(v20 - 1,missile[v8]._misource,missile[v8]._midist,mindama,maxdam,missile[v8]._mitype,shift,0);
22112229
goto LABEL_35;
22122230
}
22132231
}
@@ -7380,7 +7398,8 @@ void __fastcall MI_Bonespirit(int i)
73807398
v9 = v8;
73817399
v10 = monster[v8]._my;
73827400
v11 = monster[v8]._mx;
7383-
missile[v2]._midam = monster[v8]._mhitpoints >> 7;
7401+
//missile[v2]._midam = monster[v8]._mhitpoints >> 7;
7402+
missile[v2]._midam = monster[v8]._mhitpoints >> 9; // bone spirit nerf?
73847403
v12 = GetDirection8(v7, y1, v11, v10);
73857404
SetMissDir(ia, v12);
73867405
GetMissileVel(ia, v7, y1, monster[v9]._mx, monster[v9]._my, 16);

Source/missiles.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ void __fastcall PutMissile(int i);
2323
void __fastcall GetMissilePos(int i);
2424
void __fastcall MoveMissilePos(int i);
2525
bool __fastcall MonsterTrapHit(int m, int mindam, int maxdam, int dist, int t, int shift);
26-
bool __fastcall MonsterMHit(int pnum, int m, int mindam, int maxdam, int dist, int t, int shift);
27-
bool __fastcall PlayerMHit(int pnum, int m, int dist, int mind, int maxd, int mtype, int shift, int earflag);
26+
bool __fastcall MonsterMissileHit(int pnum, int m, int mindam, int maxdam, int dist, int t, int shift);
27+
bool __fastcall PlayerMissileHit(int pnum, int m, int dist, int mind, int maxd, int mtype, int shift, int earflag);
2828
bool __fastcall Plr2PlrMHit(int pnum, int p, int mindam, int maxdam, int dist, int mtype, int shift);
2929
void __fastcall CheckMissileCol(int i, int mindam, int maxdam, bool shift, int mx, int my, int nodel);
3030
void __fastcall SetMissAnim(int mi, int animtype);

Source/objects.cpp

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -326,25 +326,25 @@ char *shrinestrs[26] =
326326

327327
char *shrinedesc[26] =
328328
{
329-
"+5 to one attribute, -1 to others",
330-
"-10 dura to one item, +10 to others",
331-
"+2ac to items, -1 dmg to weapon",
329+
"+5 to one attribute",
330+
"-10 dura to one item",
331+
"-1 dmg to weapon",
332332
"weapon damage +1",
333333
"cast mana shield",
334334
"recharge staves",
335335
"repair all items",
336-
"-1 to random spell level, +1 to others",
336+
"-1 to random spell level",
337337
"refill chests",
338338
"firebolt level +2",
339339
"refill mana",
340340
"cast mana shield",
341-
"potions become rejuvenation",
341+
"turn potions",
342342
"+2 to magic",
343343
"get 2 potions",
344344
"cast phasing",
345345
"holy bolt level +2",
346346
"fill inventory with gold",
347-
"refill hp/mana for other players",
347+
"refill hp/mana",
348348
"+2 to dexterity",
349349
"+2 to strength",
350350
"+2 to vitality",
@@ -355,6 +355,38 @@ char *shrinedesc[26] =
355355
};
356356

357357

358+
359+
char *shrinedesc2[26] =
360+
{
361+
"-1 to others",
362+
"+10 to others",
363+
"-1 dmg to weapon",
364+
"",
365+
"",
366+
"",
367+
"",
368+
"-1 to random spell level",
369+
"",
370+
"",
371+
"",
372+
"",
373+
"into rejuvenenation",
374+
"",
375+
"",
376+
"",
377+
"",
378+
"fill inventory with gold",
379+
"for other players",
380+
"",
381+
"",
382+
"",
383+
"",
384+
"2",
385+
"",
386+
""
387+
};
388+
389+
358390
unsigned char shrinemin[26] =
359391
{
360392
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,
67916823
MonsterTrapHit(v11 - 1, 1, 4, 0, 1, 0);
67926824
v12 = dPlayer[0][forcebreaka];
67936825
if ( v12 > 0 )
6794-
PlayerMHit(v12 - 1, -1, 0, 8, 16, 1, 0, 0);
6826+
PlayerMissileHit(v12 - 1, -1, 0, 8, 16, 1, 0, 0);
67956827
v13 = dObject[0][forcebreaka];
67966828
if ( v13 > 0 )
67976829
{
@@ -7259,6 +7291,7 @@ void __fastcall GetObjectStr(int i)
72597291
sprintf(tempstr, "%s Shrine", shrinestrs[object[v1]._oVar1]);
72607292
strcpy(infostr, tempstr);
72617293
AddPanelString(shrinedesc[object[v1]._oVar1], 1);
7294+
AddPanelString(shrinedesc2[object[v1]._oVar1], 1);
72627295
break;
72637296
case OBJ_SKELBOOK:
72647297
strcpy(infostr, "Skeleton Tome");

0 commit comments

Comments
 (0)