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

Function ModifyPlrStr

Source/player.cpp:3918–3945  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3916}
3917
3918void ModifyPlrStr(int p, int l)
3919{
3920 int max;
3921
3922 if ((DWORD)p >= MAX_PLRS) {
3923 app_fatal("ModifyPlrStr: illegal player %d", p);
3924 }
3925
3926 max = MaxStats[plr[p]._pClass][ATTRIB_STR];
3927 if (plr[p]._pBaseStr + l > max) {
3928 l = max - plr[p]._pBaseStr;
3929 }
3930
3931 plr[p]._pStrength += l;
3932 plr[p]._pBaseStr += l;
3933
3934 if (plr[p]._pClass == PC_ROGUE) {
3935 plr[p]._pDamageMod = plr[p]._pLevel * (plr[p]._pStrength + plr[p]._pDexterity) / 200;
3936 } else {
3937 plr[p]._pDamageMod = plr[p]._pLevel * plr[p]._pStrength / 100;
3938 }
3939
3940 CalcPlrInv(p, TRUE);
3941
3942 if (p == myplr) {
3943 NetSendCmdParam1(FALSE, CMD_SETSTR, plr[p]._pBaseStr); //60
3944 }
3945}
3946
3947void ModifyPlrMag(int p, int l)
3948{

Callers 4

OperateShrineFunction · 0.85
OperateFountainsFunction · 0.85
On_ADDSTRFunction · 0.85
UseItemFunction · 0.85

Calls 3

app_fatalFunction · 0.85
CalcPlrInvFunction · 0.85
NetSendCmdParam1Function · 0.85

Tested by

no test coverage detected