| 3945 | } |
| 3946 | |
| 3947 | void ModifyPlrMag(int p, int l) |
| 3948 | { |
| 3949 | int max, ms; |
| 3950 | |
| 3951 | if ((DWORD)p >= MAX_PLRS) { |
| 3952 | app_fatal("ModifyPlrMag: illegal player %d", p); |
| 3953 | } |
| 3954 | |
| 3955 | max = MaxStats[plr[p]._pClass][ATTRIB_MAG]; |
| 3956 | if (plr[p]._pBaseMag + l > max) { |
| 3957 | l = max - plr[p]._pBaseMag; |
| 3958 | } |
| 3959 | |
| 3960 | plr[p]._pMagic += l; |
| 3961 | plr[p]._pBaseMag += l; |
| 3962 | |
| 3963 | ms = l << 6; |
| 3964 | if (plr[p]._pClass == PC_SORCERER) { |
| 3965 | ms <<= 1; |
| 3966 | } |
| 3967 | |
| 3968 | plr[p]._pMaxManaBase += ms; |
| 3969 | plr[p]._pMaxMana += ms; |
| 3970 | if (!(plr[p]._pIFlags & ISPL_NOMANA)) { |
| 3971 | plr[p]._pManaBase += ms; |
| 3972 | plr[p]._pMana += ms; |
| 3973 | } |
| 3974 | |
| 3975 | CalcPlrInv(p, TRUE); |
| 3976 | |
| 3977 | if (p == myplr) { |
| 3978 | NetSendCmdParam1(FALSE, CMD_SETMAG, plr[p]._pBaseMag); |
| 3979 | } |
| 3980 | } |
| 3981 | |
| 3982 | void ModifyPlrDex(int p, int l) |
| 3983 | { |
no test coverage detected