天赋功能ok
This commit is contained in:
parent
3aa9102bcf
commit
6a2355c730
@ -648,6 +648,26 @@ void Creature::RecalcBuffAttr()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (auto& tuple : talent_list) {
|
||||||
|
auto talent_meta = MetaMgr::Instance()->GetTalent(std::get<0>(tuple), std::get<1>(tuple));
|
||||||
|
if (talent_meta) {
|
||||||
|
for (auto& tuple1 : talent_meta->addattr) {
|
||||||
|
int attr_type = std::get<0>(tuple1);
|
||||||
|
int attr_val = std::get<1>(tuple1);
|
||||||
|
if (talent_meta->i->addtype() == 0) {
|
||||||
|
float* p = ability_->GetBuffAttrAbsPtr(attr_type);
|
||||||
|
if (p) {
|
||||||
|
*p += attr_val;
|
||||||
|
}
|
||||||
|
} else if (talent_meta->i->addtype() == 1) {
|
||||||
|
float* p = ability_->GetBuffAttrRatePtr(attr_type);
|
||||||
|
if (p) {
|
||||||
|
*p += attr_val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (need_refresh_hp) {
|
if (need_refresh_hp) {
|
||||||
SetHP(GetMaxHP());
|
SetHP(GetMaxHP());
|
||||||
GetTrigger()->HpChg();
|
GetTrigger()->HpChg();
|
||||||
|
@ -94,6 +94,8 @@ class Creature : public MoveableEntity
|
|||||||
a8::Vec2 context_dir;
|
a8::Vec2 context_dir;
|
||||||
std::shared_ptr<Ability> context_ability;
|
std::shared_ptr<Ability> context_ability;
|
||||||
|
|
||||||
|
std::vector<std::tuple<int, int>> talent_list;
|
||||||
|
|
||||||
bool need_sync_active_player = false;
|
bool need_sync_active_player = false;
|
||||||
std::function<void ()> on_loading_bullet;
|
std::function<void ()> on_loading_bullet;
|
||||||
CreatureWeakPtr follow_target;
|
CreatureWeakPtr follow_target;
|
||||||
|
@ -127,6 +127,11 @@ Player* PlayerMgr::CreatePlayerByCMJoin(Player* hum,
|
|||||||
#else
|
#else
|
||||||
hum->SetSkinInfo(msg.baseskin());
|
hum->SetSkinInfo(msg.baseskin());
|
||||||
#endif
|
#endif
|
||||||
|
for (auto& pair : msg.talent_list()) {
|
||||||
|
hum->talent_list.push_back(
|
||||||
|
std::make_tuple(pair.key(), pair.value())
|
||||||
|
);
|
||||||
|
}
|
||||||
socket_hash_[socket] = hum;
|
socket_hash_[socket] = hum;
|
||||||
return hum;
|
return hum;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user