1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Implement STACK_EXPERIENCE_GAIN_PERCENT bonus

Suggested on Discord

- implements STACK_EXPERIENCE_GAIN_PERCENT that modifies stack
experience received by units after combat
- removed "EXPERIENCE" primary skill. Changes to experience are now
applied through separate netpack
This commit is contained in:
Ivan Savenko
2025-06-02 21:21:20 +03:00
parent 4fda657296
commit 139f41c9b2
24 changed files with 167 additions and 65 deletions

View File

@@ -122,7 +122,18 @@ void ApplyClientNetPackVisitor::visitSetResources(SetResources & pack)
callInterfaceIfPresent(cl, pack.player, &IGameEventsReceiver::receivedResource);
}
void ApplyClientNetPackVisitor::visitSetPrimSkill(SetPrimSkill & pack)
void ApplyClientNetPackVisitor::visitSetHeroExperience(SetHeroExperience & pack)
{
const CGHeroInstance * h = cl.gameInfo().getHero(pack.id);
if(!h)
{
logNetwork->error("Cannot find hero with pack.id %d", pack.id.getNum());
return;
}
callInterfaceIfPresent(cl, h->tempOwner, &IGameEventsReceiver::heroExperienceChanged, h, pack.val);
}
void ApplyClientNetPackVisitor::visitSetPrimarySkill(SetPrimarySkill & pack)
{
const CGHeroInstance * h = cl.gameInfo().getHero(pack.id);
if(!h)