| 4006 | } |
| 4007 | |
| 4008 | void ModifyPlrVit(int p, int l) |
| 4009 | { |
| 4010 | int max, ms; |
| 4011 | |
| 4012 | if ((DWORD)p >= MAX_PLRS) { |
| 4013 | app_fatal("ModifyPlrVit: illegal player %d", p); |
| 4014 | } |
| 4015 | |
| 4016 | max = MaxStats[plr[p]._pClass][ATTRIB_VIT]; |
| 4017 | if (plr[p]._pBaseVit + l > max) { |
| 4018 | l = max - plr[p]._pBaseVit; |
| 4019 | } |
| 4020 | |
| 4021 | plr[p]._pVitality += l; |
| 4022 | plr[p]._pBaseVit += l; |
| 4023 | |
| 4024 | ms = l << 6; |
| 4025 | if (plr[p]._pClass == PC_WARRIOR) { |
| 4026 | ms <<= 1; |
| 4027 | } |
| 4028 | |
| 4029 | plr[p]._pHPBase += ms; |
| 4030 | plr[p]._pMaxHPBase += ms; |
| 4031 | plr[p]._pHitPoints += ms; |
| 4032 | plr[p]._pMaxHP += ms; |
| 4033 | |
| 4034 | CalcPlrInv(p, TRUE); |
| 4035 | |
| 4036 | if (p == myplr) { |
| 4037 | NetSendCmdParam1(FALSE, CMD_SETVIT, plr[p]._pBaseVit); |
| 4038 | } |
| 4039 | } |
| 4040 | |
| 4041 | void SetPlayerHitPoints(int pnum, int val) |
| 4042 | { |
no test coverage detected