|
|
|
|
@ -1505,25 +1505,25 @@ void DrawChr(CelOutputBuffer out)
|
|
|
|
|
|
|
|
|
|
col = COL_WHITE; |
|
|
|
|
sprintf(chrstr, "%i", plr[myplr]._pBaseStr); |
|
|
|
|
if (plr[myplr].GetMaximumAttributeValue(attribute_id::ATTRIB_STR) == plr[myplr]._pBaseStr) |
|
|
|
|
if (plr[myplr].GetMaximumAttributeValue(CharacterAttribute::Strength) == plr[myplr]._pBaseStr) |
|
|
|
|
col = COL_GOLD; |
|
|
|
|
ADD_PlrStringXY(out, 95, 155, 126, chrstr, col); |
|
|
|
|
|
|
|
|
|
col = COL_WHITE; |
|
|
|
|
sprintf(chrstr, "%i", plr[myplr]._pBaseMag); |
|
|
|
|
if (plr[myplr].GetMaximumAttributeValue(attribute_id::ATTRIB_MAG) == plr[myplr]._pBaseMag) |
|
|
|
|
if (plr[myplr].GetMaximumAttributeValue(CharacterAttribute::Magic) == plr[myplr]._pBaseMag) |
|
|
|
|
col = COL_GOLD; |
|
|
|
|
ADD_PlrStringXY(out, 95, 183, 126, chrstr, col); |
|
|
|
|
|
|
|
|
|
col = COL_WHITE; |
|
|
|
|
sprintf(chrstr, "%i", plr[myplr]._pBaseDex); |
|
|
|
|
if (plr[myplr].GetMaximumAttributeValue(attribute_id::ATTRIB_DEX) == plr[myplr]._pBaseDex) |
|
|
|
|
if (plr[myplr].GetMaximumAttributeValue(CharacterAttribute::Dexterity) == plr[myplr]._pBaseDex) |
|
|
|
|
col = COL_GOLD; |
|
|
|
|
ADD_PlrStringXY(out, 95, 211, 126, chrstr, col); |
|
|
|
|
|
|
|
|
|
col = COL_WHITE; |
|
|
|
|
sprintf(chrstr, "%i", plr[myplr]._pBaseVit); |
|
|
|
|
if (plr[myplr].GetMaximumAttributeValue(attribute_id::ATTRIB_VIT) == plr[myplr]._pBaseVit) |
|
|
|
|
if (plr[myplr].GetMaximumAttributeValue(CharacterAttribute::Vitality) == plr[myplr]._pBaseVit) |
|
|
|
|
col = COL_GOLD; |
|
|
|
|
ADD_PlrStringXY(out, 95, 239, 126, chrstr, col); |
|
|
|
|
|
|
|
|
|
@ -1567,14 +1567,14 @@ void DrawChr(CelOutputBuffer out)
|
|
|
|
|
if (plr[myplr]._pStatPts > 0) { |
|
|
|
|
sprintf(chrstr, "%i", plr[myplr]._pStatPts); |
|
|
|
|
ADD_PlrStringXY(out, 95, 266, 126, chrstr, COL_RED); |
|
|
|
|
if (plr[myplr]._pBaseStr < plr[myplr].GetMaximumAttributeValue(attribute_id::ATTRIB_STR)) |
|
|
|
|
CelDrawTo(out, 137, 159, pChrButtons, chrbtn[static_cast<size_t>(attribute_id::ATTRIB_STR)] + 2, 41); |
|
|
|
|
if (plr[myplr]._pBaseMag < plr[myplr].GetMaximumAttributeValue(attribute_id::ATTRIB_MAG)) |
|
|
|
|
CelDrawTo(out, 137, 187, pChrButtons, chrbtn[static_cast<size_t>(attribute_id::ATTRIB_MAG)] + 4, 41); |
|
|
|
|
if (plr[myplr]._pBaseDex < plr[myplr].GetMaximumAttributeValue(attribute_id::ATTRIB_DEX)) |
|
|
|
|
CelDrawTo(out, 137, 216, pChrButtons, chrbtn[static_cast<size_t>(attribute_id::ATTRIB_DEX)] + 6, 41); |
|
|
|
|
if (plr[myplr]._pBaseVit < plr[myplr].GetMaximumAttributeValue(attribute_id::ATTRIB_VIT)) |
|
|
|
|
CelDrawTo(out, 137, 244, pChrButtons, chrbtn[static_cast<size_t>(attribute_id::ATTRIB_VIT)] + 8, 41); |
|
|
|
|
if (plr[myplr]._pBaseStr < plr[myplr].GetMaximumAttributeValue(CharacterAttribute::Strength)) |
|
|
|
|
CelDrawTo(out, 137, 159, pChrButtons, chrbtn[static_cast<size_t>(CharacterAttribute::Strength)] + 2, 41); |
|
|
|
|
if (plr[myplr]._pBaseMag < plr[myplr].GetMaximumAttributeValue(CharacterAttribute::Magic)) |
|
|
|
|
CelDrawTo(out, 137, 187, pChrButtons, chrbtn[static_cast<size_t>(CharacterAttribute::Magic)] + 4, 41); |
|
|
|
|
if (plr[myplr]._pBaseDex < plr[myplr].GetMaximumAttributeValue(CharacterAttribute::Dexterity)) |
|
|
|
|
CelDrawTo(out, 137, 216, pChrButtons, chrbtn[static_cast<size_t>(CharacterAttribute::Dexterity)] + 6, 41); |
|
|
|
|
if (plr[myplr]._pBaseVit < plr[myplr].GetMaximumAttributeValue(CharacterAttribute::Vitality)) |
|
|
|
|
CelDrawTo(out, 137, 244, pChrButtons, chrbtn[static_cast<size_t>(CharacterAttribute::Vitality)] + 8, 41); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (plr[myplr]._pMaxHP > plr[myplr]._pMaxHPBase) |
|
|
|
|
@ -1630,22 +1630,22 @@ void CheckChrBtns()
|
|
|
|
|
|
|
|
|
|
if (!chrbtnactive && plr[myplr]._pStatPts) { |
|
|
|
|
HeroClass pc = plr[myplr]._pClass; |
|
|
|
|
for (auto i : enum_values<attribute_id>()) { |
|
|
|
|
for (auto i : enum_values<CharacterAttribute>()) { |
|
|
|
|
int max = plr[myplr].GetMaximumAttributeValue(i); |
|
|
|
|
switch (i) { |
|
|
|
|
case attribute_id::ATTRIB_STR: |
|
|
|
|
case CharacterAttribute::Strength: |
|
|
|
|
if (plr[myplr]._pBaseStr >= max) |
|
|
|
|
continue; |
|
|
|
|
break; |
|
|
|
|
case attribute_id::ATTRIB_MAG: |
|
|
|
|
case CharacterAttribute::Magic: |
|
|
|
|
if (plr[myplr]._pBaseMag >= max) |
|
|
|
|
continue; |
|
|
|
|
break; |
|
|
|
|
case attribute_id::ATTRIB_DEX: |
|
|
|
|
case CharacterAttribute::Dexterity: |
|
|
|
|
if (plr[myplr]._pBaseDex >= max) |
|
|
|
|
continue; |
|
|
|
|
break; |
|
|
|
|
case attribute_id::ATTRIB_VIT: |
|
|
|
|
case CharacterAttribute::Vitality: |
|
|
|
|
if (plr[myplr]._pBaseVit >= max) |
|
|
|
|
continue; |
|
|
|
|
break; |
|
|
|
|
@ -1665,7 +1665,7 @@ void CheckChrBtns()
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int CapStatPointsToAdd(int remainingStatPoints, const PlayerStruct &player, attribute_id attribute) |
|
|
|
|
int CapStatPointsToAdd(int remainingStatPoints, const PlayerStruct &player, CharacterAttribute attribute) |
|
|
|
|
{ |
|
|
|
|
int pointsToReachCap = player.GetMaximumAttributeValue(attribute) - player.GetBaseAttributeValue(attribute); |
|
|
|
|
|
|
|
|
|
@ -1675,7 +1675,7 @@ int CapStatPointsToAdd(int remainingStatPoints, const PlayerStruct &player, attr
|
|
|
|
|
void ReleaseChrBtns(bool addAllStatPoints) |
|
|
|
|
{ |
|
|
|
|
chrbtnactive = false; |
|
|
|
|
for (auto i : enum_values<attribute_id>()) { |
|
|
|
|
for (auto i : enum_values<CharacterAttribute>()) { |
|
|
|
|
if (!chrbtn[static_cast<size_t>(i)]) |
|
|
|
|
continue; |
|
|
|
|
|
|
|
|
|
@ -1689,19 +1689,19 @@ void ReleaseChrBtns(bool addAllStatPoints)
|
|
|
|
|
if (addAllStatPoints) |
|
|
|
|
statPointsToAdd = CapStatPointsToAdd(player._pStatPts, player, i); |
|
|
|
|
switch (i) { |
|
|
|
|
case attribute_id::ATTRIB_STR: |
|
|
|
|
case CharacterAttribute::Strength: |
|
|
|
|
NetSendCmdParam1(true, CMD_ADDSTR, statPointsToAdd); |
|
|
|
|
player._pStatPts -= statPointsToAdd; |
|
|
|
|
break; |
|
|
|
|
case attribute_id::ATTRIB_MAG: |
|
|
|
|
case CharacterAttribute::Magic: |
|
|
|
|
NetSendCmdParam1(true, CMD_ADDMAG, statPointsToAdd); |
|
|
|
|
player._pStatPts -= statPointsToAdd; |
|
|
|
|
break; |
|
|
|
|
case attribute_id::ATTRIB_DEX: |
|
|
|
|
case CharacterAttribute::Dexterity: |
|
|
|
|
NetSendCmdParam1(true, CMD_ADDDEX, statPointsToAdd); |
|
|
|
|
player._pStatPts -= statPointsToAdd; |
|
|
|
|
break; |
|
|
|
|
case attribute_id::ATTRIB_VIT: |
|
|
|
|
case CharacterAttribute::Vitality: |
|
|
|
|
NetSendCmdParam1(true, CMD_ADDVIT, statPointsToAdd); |
|
|
|
|
player._pStatPts -= statPointsToAdd; |
|
|
|
|
break; |
|
|
|
|
|