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

Function StartAttack

Source/player.cpp:1464–1483  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1462}
1463
1464void StartAttack(int pnum, int d)
1465{
1466 if ((DWORD)pnum >= MAX_PLRS) {
1467 app_fatal("StartAttack: illegal player %d", pnum);
1468 }
1469
1470 if (plr[pnum]._pInvincible && !plr[pnum]._pHitPoints && pnum == myplr) {
1471 SyncPlrKill(pnum, -1);
1472 return;
1473 }
1474
1475 if (!(plr[pnum]._pGFXLoad & PFILE_ATTACK)) {
1476 LoadPlrGFX(pnum, PFILE_ATTACK);
1477 }
1478
1479 NewPlrAnim(pnum, plr[pnum]._pAAnim[d], plr[pnum]._pAFrames, 0, plr[pnum]._pAWidth);
1480 plr[pnum]._pmode = PM_ATTACK;
1481 FixPlayerLocation(pnum, d);
1482 SetPlayerOld(pnum);
1483}
1484
1485void StartRangeAttack(int pnum, int d, int cx, int cy)
1486{

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