This commit is contained in:
aozhiwei 2024-01-12 19:25:59 +08:00
parent b0b42de5f9
commit 71287dce40
4 changed files with 16 additions and 3 deletions

View File

@ -27,6 +27,8 @@
#include "mt/Hero.h"
#include "mt/Equip.h"
#include "mt/MapThing.h"
#include "mt/BattleBasicAttribute.h"
#include "mt/Map.h"
Hero::Hero():Creature()
{
@ -86,6 +88,11 @@ void Hero::Initialize()
AddSkill(skill_id);
}
}
if (GetHeroMeta()->GetBasicMeta()) {
SetHeroLevel(1, 0, GetHeroMeta()->GetBasicMeta()->GetGrowMeta(room->GetMapMeta()->map_id()));
} else {
SetHeroLevel(1, 0, nullptr);
}
}
void Hero::Update(int delta_time)

View File

@ -67,6 +67,7 @@
#include "mt/KillPoint.h"
#include "mt/Drop.h"
#include "mt/MergeItem.h"
#include "mt/BattleBasicAttribute.h"
#include "pbutils.h"
@ -109,6 +110,11 @@ void Human::Initialize()
observers_.insert(this);
SetCurrWeapon(&weapons[0]);
SetOxygen(mt::Param::s().dive_oxygen_total);
if (GetHeroMeta()->GetBasicMeta()) {
SetHeroLevel(1, 0, GetHeroMeta()->GetBasicMeta()->GetGrowMeta(room->GetMapMeta()->map_id()));
} else {
SetHeroLevel(1, 0, nullptr);
}
}
float Human::GetSpeed()

View File

@ -17,9 +17,9 @@ namespace mt
}
const BattleHeroGrow* BattleBasicAttribute::GetGrowMeta(int map_id)
const BattleHeroGrow* BattleBasicAttribute::GetGrowMeta(int map_id) const
{
return nullptr;
}
}

View File

@ -15,7 +15,7 @@ namespace mt
void Init1();
void Init2();
const BattleHeroGrow* GetGrowMeta(int map_id);
const BattleHeroGrow* GetGrowMeta(int map_id) const;
};
}