Compare commits

..

6 Commits
master ... test

Author SHA1 Message Date
aozhiwei
a3f965089a 1 2021-12-13 13:20:57 +08:00
aozhiwei
ce956abef3 1 2021-12-13 12:00:04 +08:00
aozhiwei
94fc41091d 1 2021-12-13 11:51:43 +08:00
aozhiwei
46f1b52cba 1 2021-12-13 11:47:32 +08:00
aozhiwei
4faaedd690 1 2021-12-13 11:27:13 +08:00
aozhiwei
8fb91ad06c 1 2021-12-13 11:14:02 +08:00
16 changed files with 48 additions and 302 deletions

View File

@ -781,9 +781,6 @@ void Buff::ProcDive()
}, },
&xtimer_attacher.timer_list_ &xtimer_attacher.timer_list_
); );
if (owner->IsHuman()) {
++owner->AsHuman()->stats.diving_times;
}
} }
void Buff::ProcRemoveDive() void Buff::ProcRemoveDive()

View File

@ -62,11 +62,7 @@ void Bullet::OnHit(std::set<Entity*>& objects)
sender.Get()->context_pos = GetPos(); sender.Get()->context_pos = GetPos();
for (auto& target : objects) { for (auto& target : objects) {
bool old_is_dead = target->IsDead(room);
target->OnBulletHit(this); target->OnBulletHit(this);
if (target->IsDead(room) && !old_is_dead) {
OnKillTarget(target);
}
} }
sender.Get()->context_dir = old_context_dir; sender.Get()->context_dir = old_context_dir;
@ -192,9 +188,6 @@ void Bullet::ProcBomb()
case IS_RPG: case IS_RPG:
{ {
//榴弹炮 //榴弹炮
if (sender.Get() && sender.Get()->IsHuman()) {
sender.Get()->AsHuman()->stats.IncWeaponUseTimes(gun_meta->i->id(), 1);
}
a8::Vec2 bomb_pos = GetPos(); a8::Vec2 bomb_pos = GetPos();
room->frame_event.AddExplosionEx(sender, room->frame_event.AddExplosionEx(sender,
meta->i->id(), meta->i->id(),
@ -206,18 +199,12 @@ void Bullet::ProcBomb()
case IS_FRAG: case IS_FRAG:
{ {
//手雷 //手雷
if (sender.Get() && sender.Get()->IsHuman()) {
sender.Get()->AsHuman()->stats.IncWeaponUseTimes(gun_meta->i->id(), 1);
}
ProcFragBomb(delay_time); ProcFragBomb(delay_time);
} }
break; break;
case IS_SMOKE: case IS_SMOKE:
{ {
//烟雾弹 //烟雾弹
if (sender.Get() && sender.Get()->IsHuman()) {
sender.Get()->AsHuman()->stats.IncWeaponUseTimes(gun_meta->i->id(), 1);
}
#if 1 #if 1
AddGunBuff(); AddGunBuff();
#else #else
@ -234,27 +221,18 @@ void Bullet::ProcBomb()
case IS_POSION_GAS_BOMB: case IS_POSION_GAS_BOMB:
{ {
//毒气弹 //毒气弹
if (sender.Get() && sender.Get()->IsHuman()) {
sender.Get()->AsHuman()->stats.IncWeaponUseTimes(gun_meta->i->id(), 1);
}
ProcPosionGasBomb(delay_time); ProcPosionGasBomb(delay_time);
} }
break; break;
case IS_MOLOTOR_COCKTAIL: case IS_MOLOTOR_COCKTAIL:
{ {
//燃烧瓶 //燃烧瓶
if (sender.Get() && sender.Get()->IsHuman()) {
sender.Get()->AsHuman()->stats.IncWeaponUseTimes(gun_meta->i->id(), 1);
}
ProcMolotorCocktailBomb(delay_time); ProcMolotorCocktailBomb(delay_time);
} }
break; break;
case IS_C4: case IS_C4:
{ {
//c4 //c4
if (sender.Get() && sender.Get()->IsHuman()) {
sender.Get()->AsHuman()->stats.IncWeaponUseTimes(gun_meta->i->id(), 1);
}
if (block) { if (block) {
delay_time = gun_meta->i->missiles_time(); delay_time = gun_meta->i->missiles_time();
} }
@ -263,25 +241,16 @@ void Bullet::ProcBomb()
break; break;
case IS_SINGAL_GUN: case IS_SINGAL_GUN:
{ {
if (sender.Get() && sender.Get()->IsHuman()) {
sender.Get()->AsHuman()->stats.IncWeaponUseTimes(gun_meta->i->id(), 1);
}
ProcSignalGunBomb(delay_time); ProcSignalGunBomb(delay_time);
} }
break; break;
case IS_SHIELD_WALL: case IS_SHIELD_WALL:
{ {
if (sender.Get() && sender.Get()->IsHuman()) {
sender.Get()->AsHuman()->stats.IncWeaponUseTimes(gun_meta->i->id(), 1);
}
ProcShieldWallBomb(delay_time); ProcShieldWallBomb(delay_time);
} }
break; break;
case IS_OIL_BUCKET: case IS_OIL_BUCKET:
{ {
if (sender.Get() && sender.Get()->IsHuman()) {
sender.Get()->AsHuman()->stats.IncWeaponUseTimes(gun_meta->i->id(), 1);
}
ProcOilBucketBomb(delay_time); ProcOilBucketBomb(delay_time);
} }
break; break;
@ -657,13 +626,3 @@ bool Bullet::IsPreBattleBullet()
{ {
return create_frameno_ <= room->GetBattleStartFrameNo() || room->GetBattleStartFrameNo() == 0; return create_frameno_ <= room->GetBattleStartFrameNo() || room->GetBattleStartFrameNo() == 0;
} }
void Bullet::OnKillTarget(Entity* target)
{
if (target->IsCreature(room)) {
Creature* c = (Creature*)target;
if (c->IsHuman() && sender.Get() && sender.Get()->IsHuman()) {
sender.Get()->AsHuman()->stats.IncWeaponKills(gun_meta->i->id(), 1);
}
}
}

View File

@ -61,7 +61,6 @@ protected:
inline void MapServiceUpdate(); inline void MapServiceUpdate();
void Check(float distance); void Check(float distance);
void AddGunBuff(); void AddGunBuff();
void OnKillTarget(Entity* target);
private: private:
CircleCollider* self_collider_ = nullptr; CircleCollider* self_collider_ = nullptr;

View File

@ -384,10 +384,6 @@ void Car::DecHP(float dec_hp, int killer_id, const std::string& killer_name, int
void Car::BeKill(int killer_id, const std::string& killer_name, int weapon_id) void Car::BeKill(int killer_id, const std::string& killer_name, int weapon_id)
{ {
Human* killer = room->GetHumanByUniId(killer_id);
if (killer) {
++killer->stats.destory_car_times;
}
dead = true; dead = true;
later_removed_ = true; later_removed_ = true;
if (hero_meta_->i->delay_remove() > 0) { if (hero_meta_->i->delay_remove() > 0) {
@ -531,15 +527,3 @@ void Car::RemoveFromScene()
room->RemoveObjectLater(this); room->RemoveObjectLater(this);
room->NotifyUiUpdate(); room->NotifyUiUpdate();
} }
void Car::OnKillTarget(Creature* target)
{
if (target->IsHuman()) {
for (auto passenger : passengers_) {
++passenger->stats.ride_car_kills;
}
if (driver_) {
++driver_->stats.ride_car_kills;
}
}
}

View File

@ -49,7 +49,6 @@ class Car : public Creature
virtual void SendDebugMsg(const std::string& debug_msg) override; virtual void SendDebugMsg(const std::string& debug_msg) override;
virtual void SetAttackDir(const a8::Vec2& attack_dir) override; virtual void SetAttackDir(const a8::Vec2& attack_dir) override;
virtual void DropItems(Obstacle* obstacle) override; virtual void DropItems(Obstacle* obstacle) override;
void OnKillTarget(Creature* target);
private: private:
int AllocSeat(); int AllocSeat();

View File

@ -648,26 +648,6 @@ 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();
@ -941,9 +921,6 @@ void Creature::DoSkill(int skill_id,
} }
GetTrigger()->UseSkill(skill); GetTrigger()->UseSkill(skill);
DoSkillPostProc(true, skill_id, target_id, target_pos); DoSkillPostProc(true, skill_id, target_id, target_pos);
if (IsHuman()) {
++AsHuman()->stats.use_skill_times;
}
#if 0 #if 0
if (skill_id != TURN_OVER_SKILL_ID) { if (skill_id != TURN_OVER_SKILL_ID) {
#else #else
@ -1131,9 +1108,6 @@ void Creature::ProcBuffEffect(Creature* caster, Buff* buff)
if (action_type != AT_None) { if (action_type != AT_None) {
CancelAction(); CancelAction();
} }
if (IsHuman()) {
++AsHuman()->stats.use_camouflage_times;
}
} }
break; break;
case kBET_BePull: case kBET_BePull:

View File

@ -94,8 +94,6 @@ 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;

View File

@ -40,58 +40,6 @@
const int kReviveTimeAdd = 12; const int kReviveTimeAdd = 12;
const int kSkinNum = 4; const int kSkinNum = 4;
WeaponStats& PlayerStats::MustBeWeapon(int weapon_id)
{
auto itr = weapon_stats.find(weapon_id);
if (itr == weapon_stats.end()){
WeaponStats weapon;
weapon_stats[weapon_id] = weapon;
itr = weapon_stats.find(weapon_id);
}
return itr->second;
}
void PlayerStats::IncWeaponKills(int weapon_id, int val)
{
MustBeWeapon(weapon_id).kills += val;
}
void PlayerStats::IncWeaponDamageOut(int weapon_id, int val)
{
MustBeWeapon(weapon_id).damage_out += val;
}
void PlayerStats::IncWeaponObtainCount(int weapon_id, int val)
{
MustBeWeapon(weapon_id).obtain_count += val;
}
void PlayerStats::IncWeaponUseTimes(int weapon_id, int val)
{
MustBeWeapon(weapon_id).use_times += val;
}
HeroStats& PlayerStats::MustBeHero(int hero_id)
{
auto itr = hero_stats.find(hero_id);
if (itr == hero_stats.end()){
HeroStats hero;
hero_stats[hero_id] = hero;
itr = hero_stats.find(hero_id);
}
return itr->second;
}
void PlayerStats::SetHeroSkillLv(int hero_id, int skill_lv)
{
MustBeHero(hero_id).skill_lv = std::max(MustBeHero(hero_id).skill_lv, skill_lv);
}
void PlayerStats::SetHeroWeaponLv(int hero_id, int weapon_lv)
{
MustBeHero(hero_id).weapon_lv = std::max(MustBeHero(hero_id).weapon_lv, weapon_lv);
}
Human::Human():Creature() Human::Human():Creature()
{ {
default_weapon.weapon_idx = 0; default_weapon.weapon_idx = 0;
@ -1772,70 +1720,63 @@ void Human::GenBattleReportData(a8::MutableXObject* params)
params->SetVal("session_id", session_id); params->SetVal("session_id", session_id);
params->SetVal("map_id", room->GetMapMeta()->i->map_id()); params->SetVal("map_id", room->GetMapMeta()->i->map_id());
params->SetVal("map_name", room->GetMapMeta()->i->map_name()); params->SetVal("map_name", room->GetMapMeta()->i->map_name());
params->SetVal("team_mode", GetTeam() && GetTeam()->GetMemberNum() > 1 ? 1 : 0);
params->SetVal("map_tpl_name", room->GetMapTplName()); params->SetVal("map_tpl_name", room->GetMapTplName());
params->SetVal("room_uuid", room->GetRoomUuid()); params->SetVal("game_time", time(nullptr));
params->SetVal("game_time", time(nullptr)); //? params->SetVal("hurt", stats.damage_amount_in);
params->SetVal("rank", rank);
params->SetVal("kills", stats.kills);
params->SetVal("harm", stats.damage_amount_out);
params->SetVal("add_HP", stats.heal_amount);
if (!dead) { if (!dead) {
params->SetVal("alive_time", room->GetFrameNo() * 1000.0f / SERVER_FRAME_RATE); params->SetVal("alive_time", room->GetFrameNo() * 1000.0f / SERVER_FRAME_RATE);
} else { } else {
params->SetVal("alive_time", dead_frameno * 1000.0f / SERVER_FRAME_RATE); params->SetVal("alive_time", dead_frameno * 1000.0f / SERVER_FRAME_RATE);
} }
params->SetVal("ranked", rank); params->SetVal("team_status", GetTeam() && GetTeam()->GetMemberNum() > 1 ? 1 : 0);
params->SetVal("kills", stats.kills); params->SetVal("room_uuid", room->GetRoomUuid());
params->SetVal("damage_out", stats.damage_amount_out);
params->SetVal("rescue_teammate_times", stats.rescue_member); int snipe_kill = 0;
params->SetVal("diving_times", stats.diving_times); int rifle_kill = 0;
params->SetVal("damage_in", stats.damage_amount_in); int pistol_kill = 0;
params->SetVal("recover_hp", stats.heal_amount); int submachine_kill = 0;
params->SetVal("open_airdrop_times", stats.open_airdrop_times); for (Human* hum : kill_humans) {
params->SetVal("use_medicine_times", stats.use_medicine_times); MetaData::Equip* equip_meta = MetaMgr::Instance()->GetEquip(stats.weapon_id);
params->SetVal("destory_car_times", stats.destory_car_times); if (equip_meta) {
params->SetVal("use_camouflage_times", stats.use_camouflage_times); switch (equip_meta->i->equip_subtype()) {
params->SetVal("use_skill_times", stats.use_skill_times); case 7:
params->SetVal("ride_car_move_distance", stats.ride_car_move_distance);
params->SetVal("ride_car_kills", stats.ride_car_kills);
params->SetVal("max_hero_skill_lv", stats.max_hero_skill_lv);
{ {
std::string weapons_type; //狙击枪
std::string weapons_slot; ++snipe_kill;
for (auto& pair : stats.weapon_stats) { }
auto& weapon = pair.second; break;
if (weapon.kills || weapon.damage_out || weapon.obtain_count) { case 5:
weapons_type += a8::Format("%d:%d:%d:%d|",
{ {
weapon.weapon_id, //步枪
weapon.kills, ++rifle_kill;
weapon.damage_out,
weapon.obtain_count
});
} }
if (weapon.use_times) { break;
weapons_slot += a8::Format("%d:%d|", case 2:
{ {
weapon.weapon_id, //手枪
weapon.use_times ++pistol_kill;
});
}
}
params->SetVal("weapons_type", weapons_type);
params->SetVal("weapons_slot", weapons_slot);
} }
break;
case 3:
{ {
std::string heros; //冲锋枪
for (auto& pair : stats.hero_stats) { ++submachine_kill;
auto& hero = pair.second; }
if (hero.skill_lv || hero.weapon_lv) { break;
heros += a8::Format("%d:%d:%d|",
{
hero.hero_id,
hero.skill_lv,
hero.weapon_lv,
});
} }
} }
params->SetVal("heros", heros);
} }
params->SetVal("snipe_kill", snipe_kill);
params->SetVal("rifle_kill", rifle_kill);
params->SetVal("pistol_kill", pistol_kill);
params->SetVal("submachine_kill", submachine_kill);
params->SetVal("rescue_member", stats.rescue_member);
params->SetVal("rescue_guild_member", stats.rescue_guild_member);
{ {
float rank_param = MetaMgr::Instance()->GetRankRewardParam(rank); float rank_param = MetaMgr::Instance()->GetRankRewardParam(rank);
float kill_param = MetaMgr::Instance()->GetKillRewardParam(stats.kills); float kill_param = MetaMgr::Instance()->GetKillRewardParam(stats.kills);
@ -2347,7 +2288,6 @@ void Human::DropItems(Obstacle* obstacle)
return; return;
} }
if (room->GetRoomType() == RT_NewBrid && IsPlayer()) { if (room->GetRoomType() == RT_NewBrid && IsPlayer()) {
++stats.open_airdrop_times;
if (is_treasure_box) { if (is_treasure_box) {
if (box_drop_times_ < MetaMgr::Instance()->newbie_airdrop.size()) { if (box_drop_times_ < MetaMgr::Instance()->newbie_airdrop.size()) {
drop_id = MetaMgr::Instance()->newbie_airdrop[box_drop_times_]; drop_id = MetaMgr::Instance()->newbie_airdrop[box_drop_times_];
@ -2813,7 +2753,6 @@ void Human::ProcUseItemAction()
switch (action_item_id) { switch (action_item_id) {
case IS_HEALTHKIT: case IS_HEALTHKIT:
{ {
+stats.use_medicine_times;
AddHp(item_meta->i->heal() * (1 + GetAbility()->GetAttrRate(kHAT_DrugEfficacy))); AddHp(item_meta->i->heal() * (1 + GetAbility()->GetAttrRate(kHAT_DrugEfficacy)));
DecInventory(item_meta->i->_inventory_slot(), 1); DecInventory(item_meta->i->_inventory_slot(), 1);
GetTrigger()->UseItemAction(action_item_id); GetTrigger()->UseItemAction(action_item_id);
@ -2821,7 +2760,6 @@ void Human::ProcUseItemAction()
break; break;
case IS_PAIN_KILLER: case IS_PAIN_KILLER:
{ {
+stats.use_medicine_times;
if (pain_killer_timer) { if (pain_killer_timer) {
int passed_time = (room->GetFrameNo() - pain_killer_frameno) * FRAME_RATE_MS; int passed_time = (room->GetFrameNo() - pain_killer_frameno) * FRAME_RATE_MS;
int left_time = std::max(0, pain_killer_lastingtime * 1000 - passed_time); int left_time = std::max(0, pain_killer_lastingtime * 1000 - passed_time);
@ -2864,7 +2802,6 @@ void Human::ProcUseItemAction()
break; break;
case IS_SHEN_BAO: case IS_SHEN_BAO:
{ {
+stats.use_medicine_times;
if (!dead) { if (!dead) {
if (downed) { if (downed) {
SetHP(MetaMgr::Instance()->GetSysParamAsInt("downed_relive_recover_hp")); SetHP(MetaMgr::Instance()->GetSysParamAsInt("downed_relive_recover_hp"));
@ -3266,10 +3203,6 @@ void Human::OnBulletHit(Bullet* bullet)
} }
} else { } else {
if (!bullet->IsPreBattleBullet()) { if (!bullet->IsPreBattleBullet()) {
if (bullet->sender.Get() && bullet->sender.Get()->IsHuman()) {
bullet->sender.Get()->AsHuman()->stats.IncWeaponDamageOut
(bullet->gun_meta->i->id(), finaly_dmg);
}
DecHP(finaly_dmg, DecHP(finaly_dmg,
bullet->sender.Get()->GetUniId(), bullet->sender.Get()->GetUniId(),
bullet->sender.Get()->GetName(), bullet->sender.Get()->GetName(),

View File

@ -22,22 +22,6 @@ struct HumanBehavior
int total_destory_box_times = 0; int total_destory_box_times = 0;
}; };
struct WeaponStats
{
int weapon_id = 0;
int kills = 0;
int damage_out = 0;
int obtain_count = 0;
int use_times = 0;
};
struct HeroStats
{
int hero_id = 0;
int skill_lv = 0;
int weapon_lv = 0;
};
struct PlayerStats struct PlayerStats
{ {
int kills = 0; int kills = 0;
@ -53,19 +37,6 @@ struct PlayerStats
int history_damage_amount = 0; int history_damage_amount = 0;
int history_heal_amount = 0; int history_heal_amount = 0;
int diving_times = 0;
int open_airdrop_times = 0;
int use_medicine_times = 0;
int destory_car_times = 0;
int use_camouflage_times = 0;
int use_skill_times = 0;
int ride_car_move_distance = 0;
int ride_car_kills = 0;
int max_hero_skill_lv = 0;
std::map<int, WeaponStats> weapon_stats;
std::map<int, HeroStats> hero_stats;
int gold = 0; int gold = 0;
int score = 0; int score = 0;
std::vector<std::pair<int, int>> items; std::vector<std::pair<int, int>> items;
@ -82,15 +53,6 @@ struct PlayerStats
int skill_times = 0; int skill_times = 0;
int dead_times = 0; int dead_times = 0;
WeaponStats& MustBeWeapon(int weapon_id);
void IncWeaponKills(int weapon_id, int val);
void IncWeaponDamageOut(int weapon_id, int val);
void IncWeaponObtainCount(int weapon_id, int val);
void IncWeaponUseTimes(int weapon_id, int val);
HeroStats& MustBeHero(int hero_id);
void SetHeroSkillLv(int hero_id, int skill_lv);
void SetHeroWeaponLv(int hero_id, int weapon_lv);
}; };
struct xtimer_list; struct xtimer_list;

View File

@ -1530,21 +1530,6 @@ namespace MetaData
} }
void GunTalentGrow::Init()
{
std::vector<std::string> tmp_strs1;
a8::Split(i->addattr(), tmp_strs1, '|');
for (std::string& str : tmp_strs1) {
std::vector<std::string> tmp_strs2;
a8::Split(str, tmp_strs2, ':');
if (tmp_strs2.size() >= 2) {
addattr.push_back(
std::make_tuple(a8::XValue(tmp_strs2[0]), a8::XValue(tmp_strs2[1]))
);
}
}
}
void Item::Init() void Item::Init()
{ {

View File

@ -322,15 +322,6 @@ namespace MetaData
const metatable::KillPoint* i = nullptr; const metatable::KillPoint* i = nullptr;
}; };
struct GunTalentGrow
{
const metatable::GunTalentGrow* i = nullptr;
std::vector<std::tuple<int, int>> addattr;
void Init();
};
struct AI struct AI
{ {
const metatable::AI* i = nullptr; const metatable::AI* i = nullptr;

View File

@ -189,7 +189,6 @@ public:
std::list<MetaData::AI> ai_list; std::list<MetaData::AI> ai_list;
std::list<metatable::Text> text_meta_list; std::list<metatable::Text> text_meta_list;
std::list<metatable::TerrainJson> terrain_meta_list; std::list<metatable::TerrainJson> terrain_meta_list;
std::list<metatable::GunTalentGrow> talent_meta_list;
std::map<std::string, MetaData::Parameter*> parameter_hash; std::map<std::string, MetaData::Parameter*> parameter_hash;
std::map<int, MetaData::Map*> gamemap_hash; std::map<int, MetaData::Map*> gamemap_hash;
@ -226,7 +225,6 @@ public:
std::map<long long, MetaData::AI*> android_ai_hash; std::map<long long, MetaData::AI*> android_ai_hash;
std::map<int, MetaData::AI*> ai_hash; std::map<int, MetaData::AI*> ai_hash;
std::map<std::string, std::string> text_hash; std::map<std::string, std::string> text_hash;
std::map<int, std::shared_ptr<MetaData::GunTalentGrow>> talent_hash;
std::map<std::string, std::vector<std::tuple<int, std::string>>> text_element_hash; std::map<std::string, std::vector<std::tuple<int, std::string>>> text_element_hash;
int curr_group_id = 1001; int curr_group_id = 1001;
@ -277,7 +275,6 @@ public:
f8::ReadCsvMetaFile(res_path + "robot@robot.csv", robot_meta_list); f8::ReadCsvMetaFile(res_path + "robot@robot.csv", robot_meta_list);
f8::ReadCsvMetaFile(res_path + "ai@ai.csv", ai_meta_list); f8::ReadCsvMetaFile(res_path + "ai@ai.csv", ai_meta_list);
f8::ReadCsvMetaFile(res_path + "text@text.csv", text_meta_list); f8::ReadCsvMetaFile(res_path + "text@text.csv", text_meta_list);
f8::ReadCsvMetaFile(res_path + "gunTalentGrow@gunTalentGrow.csv", talent_meta_list);
f8::ReadJsonMetaFile(res_path + "terrain.json", terrain_meta_list); f8::ReadJsonMetaFile(res_path + "terrain.json", terrain_meta_list);
BindToMetaData(); BindToMetaData();
#if 1 #if 1
@ -897,13 +894,6 @@ private:
} }
} }
for (auto& meta : talent_meta_list) {
std::shared_ptr<MetaData::GunTalentGrow> item = std::make_shared<MetaData::GunTalentGrow>();
item->i = &meta;
item->Init();
talent_hash[a8::MakeInt64(meta.talent_id(), meta.talent_lv())] = item;
}
} }
private: private:
@ -1217,12 +1207,6 @@ std::vector<std::tuple<int, std::string>>* MetaMgr::GetTextElements(const std::s
return itr != loader_->text_element_hash.end() ? &itr->second : nullptr; return itr != loader_->text_element_hash.end() ? &itr->second : nullptr;
} }
MetaData::GunTalentGrow* MetaMgr::GetTalent(int talent_id, int talent_lv)
{
auto itr = loader_->talent_hash.find(a8::MakeInt64(talent_id, talent_lv));
return itr != loader_->talent_hash.end() ? itr->second.get() : nullptr;
}
MetaData::Item* MetaMgr::GetItem(int id) MetaData::Item* MetaMgr::GetItem(int id)
{ {
auto itr = loader_->item_hash.find(id); auto itr = loader_->item_hash.find(id);

View File

@ -52,7 +52,6 @@ class MetaMgr : public a8::Singleton<MetaMgr>
MetaData::Dress* GetDress(int dress_id); MetaData::Dress* GetDress(int dress_id);
MetaData::Dress* RandDress(); MetaData::Dress* RandDress();
MetaData::RankReward* GetRankReward(int rank); MetaData::RankReward* GetRankReward(int rank);
MetaData::GunTalentGrow* GetTalent(int talent_id, int talent_lv);
float GetRankRewardParam(int rank); float GetRankRewardParam(int rank);
float GetKillRewardParam(int kill_num); float GetKillRewardParam(int kill_num);
int GetRankPointParam1(int rank); int GetRankPointParam1(int rank);

View File

@ -127,11 +127,6 @@ 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;
} }

View File

@ -8,7 +8,6 @@
#include "skill.h" #include "skill.h"
#include "room.h" #include "room.h"
#include "human.h" #include "human.h"
#include "car.h"
void Trigger::Init() void Trigger::Init()
{ {
@ -108,9 +107,6 @@ void Trigger::Kill(Creature* target)
owner_->AsHuman()->kill_humans.insert(target->AsHuman()); owner_->AsHuman()->kill_humans.insert(target->AsHuman());
owner_->AsHuman()->SyncAroundPlayers(__FILE__, __LINE__, __func__); owner_->AsHuman()->SyncAroundPlayers(__FILE__, __LINE__, __func__);
} }
if (owner_->IsCar()) {
owner_->AsCar()->OnKillTarget(target);
}
++kill_num_; ++kill_num_;
TraverseCondBuffs TraverseCondBuffs
(kCondBuffKillTarget, (kCondBuffKillTarget,

View File

@ -415,15 +415,6 @@ message Text
optional string text = 2; optional string text = 2;
} }
message GunTalentGrow
{
optional int32 id = 1;
optional int32 talent_id = 2;
optional int32 talent_lv = 3;
optional int32 addtype = 4;
optional string addattr = 5;
}
//end //end
message DoorObjJson message DoorObjJson