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

Function StartRangeAttack

Source/player.cpp:1485–1506  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1483}
1484
1485void StartRangeAttack(int pnum, int d, int cx, int cy)
1486{
1487 if ((DWORD)pnum >= MAX_PLRS) {
1488 app_fatal("StartRangeAttack: illegal player %d", pnum);
1489 }
1490
1491 if (plr[pnum]._pInvincible && !plr[pnum]._pHitPoints && pnum == myplr) {
1492 SyncPlrKill(pnum, -1);
1493 return;
1494 }
1495
1496 if (!(plr[pnum]._pGFXLoad & PFILE_ATTACK)) {
1497 LoadPlrGFX(pnum, PFILE_ATTACK);
1498 }
1499 NewPlrAnim(pnum, plr[pnum]._pAAnim[d], plr[pnum]._pAFrames, 0, plr[pnum]._pAWidth);
1500
1501 plr[pnum]._pmode = PM_RATTACK;
1502 FixPlayerLocation(pnum, d);
1503 SetPlayerOld(pnum);
1504 plr[pnum]._pVar1 = cx;
1505 plr[pnum]._pVar2 = cy;
1506}
1507
1508void StartPlrBlock(int pnum, int dir)
1509{

Callers 1

CheckNewPathFunction · 0.85

Calls 6

app_fatalFunction · 0.85
SyncPlrKillFunction · 0.85
LoadPlrGFXFunction · 0.85
NewPlrAnimFunction · 0.85
FixPlayerLocationFunction · 0.85
SetPlayerOldFunction · 0.85

Tested by

no test coverage detected