This commit is contained in:
aozhiwei 2024-01-15 19:16:42 +08:00
parent 40968f3ae8
commit 58c10c6eb4
6 changed files with 25 additions and 9 deletions

View File

@ -15,6 +15,8 @@
#include "mt/Text.h"
#include "mt/Hero.h"
#include "mt/Item.h"
#include "mt/Map.h"
#include "mt/BattleBasicAttribute.h"
Android::Android():Human()
{
@ -72,6 +74,11 @@ void Android::Initialize()
AddSkill(skill_id);
}
}
if (GetHeroMeta()->GetBasicMeta()) {
SetHeroLevel(1, 0, GetHeroMeta()->GetBasicMeta()->GetGrowMeta(room->GetMapMeta()->map_id()));
} else {
SetHeroLevel(1, 0, nullptr);
}
agent_->SetOwner(this);
f8::BtMgr::Instance()->BtLoad(agent_, "hero/standard");
f8::BtMgr::Instance()->BtSetCurrent(agent_, "hero/standard");

View File

@ -29,6 +29,8 @@
#include "mt/Equip.h"
#include "mt/Buff.h"
#include "mt/MapThing.h"
#include "mt/Map.h"
#include "mt/BattleBasicAttribute.h"
Car::Car():Creature()
{
@ -88,6 +90,11 @@ void Car::Initialize()
AddSkill(skill_id);
}
}
if (GetHeroMeta()->GetBasicMeta()) {
SetHeroLevel(1, 0, GetHeroMeta()->GetBasicMeta()->GetGrowMeta(room->GetMapMeta()->map_id()));
} else {
SetHeroLevel(1, 0, nullptr);
}
}
Human* Car::GetPassengerBySeat(int seat)

View File

@ -110,11 +110,6 @@ 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

@ -1,6 +1,7 @@
#include "precompile.h"
#include "mt/BattleBasicAttribute.h"
#include "mt/BattleHeroGrow.h"
IMPL_TABLE(mt::BattleBasicAttribute)
@ -19,7 +20,7 @@ namespace mt
const BattleHeroGrow* BattleBasicAttribute::GetGrowMeta(int map_id) const
{
return nullptr;
return mt::BattleHeroGrow::GetByHeroIdLevel(id(), 1);
}
}

View File

@ -24,11 +24,11 @@ namespace mt
for (auto& str : strings) {
std::vector<std::string> strings2;
a8::Split(str, strings2, ':');
if (strings.size() != 2) {
if (strings2.size() != 2) {
abort();
}
int attr_id = a8::XValue(strings.at(0));
float attr_val = a8::XValue(strings.at(1)).GetDouble();
int attr_id = a8::XValue(strings2.at(0));
float attr_val = a8::XValue(strings2.at(1)).GetDouble();
if (!IsValidHumanAttr(attr_id) &&
!IsValidHumanVirtualAttr(attr_id)) {
abort();

View File

@ -44,6 +44,7 @@
#include "mt/Text.h"
#include "mt/Map.h"
#include "mt/PveGemini.h"
#include "mt/BattleBasicAttribute.h"
const int kREVIVE_BUFF_ID = 1005;
@ -133,6 +134,11 @@ void Player::Initialize()
},
&xtimer_attacher);
}
if (GetHeroMeta()->GetBasicMeta()) {
SetHeroLevel(1, 0, GetHeroMeta()->GetBasicMeta()->GetGrowMeta(room->GetMapMeta()->map_id()));
} else {
SetHeroLevel(1, 0, nullptr);
}
}
void Player::Update(int delta_time)