1
This commit is contained in:
parent
2ace1a04dc
commit
e9a68efa3d
@ -1,10 +1,12 @@
|
|||||||
#include "precompile.h"
|
#include "precompile.h"
|
||||||
|
|
||||||
#include "ability.h"
|
#include "ability.h"
|
||||||
#include "metamgr.h"
|
|
||||||
#include "buff.h"
|
#include "buff.h"
|
||||||
#include "creature.h"
|
#include "creature.h"
|
||||||
|
|
||||||
|
#include "mt/Equip.h"
|
||||||
|
#include "mt/Buff.h"
|
||||||
|
|
||||||
float Ability::GetAttrAbs(int attr_id)
|
float Ability::GetAttrAbs(int attr_id)
|
||||||
{
|
{
|
||||||
float attr_abs_val = GetBuffAttrAbs(attr_id);
|
float attr_abs_val = GetBuffAttrAbs(attr_id);
|
||||||
@ -12,17 +14,17 @@ float Ability::GetAttrAbs(int attr_id)
|
|||||||
if (owner.Get()) {
|
if (owner.Get()) {
|
||||||
Buff* buff = owner.Get()->GetBuffByEffectId(kBET_Car);
|
Buff* buff = owner.Get()->GetBuffByEffectId(kBET_Car);
|
||||||
if (buff) {
|
if (buff) {
|
||||||
MetaData::Equip* equip_meta = MetaMgr::Instance()->GetEquip(buff->meta->param4);
|
const mt::Equip* equip_meta = mt::Equip::GetById(buff->meta->_param4);
|
||||||
if (equip_meta) {
|
if (equip_meta) {
|
||||||
switch (attr_id) {
|
switch (attr_id) {
|
||||||
case kHAT_Atk:
|
case kHAT_Atk:
|
||||||
{
|
{
|
||||||
attr_abs_val += equip_meta->pb->atk();
|
attr_abs_val += equip_meta->atk();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case kHAT_Def:
|
case kHAT_Def:
|
||||||
{
|
{
|
||||||
attr_abs_val += equip_meta->pb->def();
|
attr_abs_val += equip_meta->def();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
#include "precompile.h"
|
#include "precompile.h"
|
||||||
|
|
||||||
#include "android.h"
|
#include "android.h"
|
||||||
#include "metamgr.h"
|
|
||||||
#include "room.h"
|
#include "room.h"
|
||||||
#include "app.h"
|
#include "app.h"
|
||||||
#include "android_agent.h"
|
#include "android_agent.h"
|
||||||
@ -9,6 +8,9 @@
|
|||||||
|
|
||||||
#include "f8/btmgr.h"
|
#include "f8/btmgr.h"
|
||||||
|
|
||||||
|
#include "mt/Equip.h"
|
||||||
|
#include "mt/Robot.h"
|
||||||
|
|
||||||
Android::Android():Human()
|
Android::Android():Human()
|
||||||
{
|
{
|
||||||
#if 0
|
#if 0
|
||||||
@ -110,17 +112,17 @@ void Android::InternalUpdate(int delta_time)
|
|||||||
|
|
||||||
void Android::GiveEquip()
|
void Android::GiveEquip()
|
||||||
{
|
{
|
||||||
MetaData::Equip* weapon_meta = MetaMgr::Instance()->GetEquip(robot_meta->pb->weapon_id());
|
const mt::Equip* weapon_meta = mt::Equip::GetById(robot_meta->weapon_id());
|
||||||
if (weapon_meta) {
|
if (weapon_meta) {
|
||||||
Weapon& weapon = weapons[GUN_SLOT1];
|
Weapon& weapon = weapons[GUN_SLOT1];
|
||||||
weapon.weapon_idx = GUN_SLOT1;
|
weapon.weapon_idx = GUN_SLOT1;
|
||||||
weapon.weapon_id = weapon_meta->pb->id();
|
weapon.weapon_id = weapon_meta->id();
|
||||||
weapon.ammo = 0;
|
weapon.ammo = 0;
|
||||||
weapon.meta = weapon_meta;
|
weapon.meta = weapon_meta;
|
||||||
weapon.Recalc();
|
weapon.Recalc();
|
||||||
SetCurrWeapon(&weapon);
|
SetCurrWeapon(&weapon);
|
||||||
}
|
}
|
||||||
sex = robot_meta->pb->sex();
|
sex = robot_meta->sex();
|
||||||
if (sex == 0) {
|
if (sex == 0) {
|
||||||
sex = rand() % 3;
|
sex = rand() % 3;
|
||||||
}
|
}
|
||||||
@ -128,9 +130,9 @@ void Android::GiveEquip()
|
|||||||
|
|
||||||
void Android::RandSkin()
|
void Android::RandSkin()
|
||||||
{
|
{
|
||||||
if (!robot_meta->skin_id.empty()) {
|
if (!robot_meta->_skin_id.empty()) {
|
||||||
Skin& skin = skins[0];
|
Skin& skin = skins[0];
|
||||||
skin.skin_id = 1 + (robot_meta->pb->id() % 3);
|
skin.skin_id = 1 + (robot_meta->id() % 3);
|
||||||
skin.skin_lv = 1;
|
skin.skin_lv = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,16 +2,11 @@
|
|||||||
|
|
||||||
#include "human.h"
|
#include "human.h"
|
||||||
|
|
||||||
namespace MetaData
|
|
||||||
{
|
|
||||||
class Robot;
|
|
||||||
}
|
|
||||||
|
|
||||||
class AndroidAgent;
|
class AndroidAgent;
|
||||||
class Android : public Human
|
class Android : public Human
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MetaData::Robot* robot_meta = nullptr;
|
const mt::Robot* robot_meta = nullptr;
|
||||||
|
|
||||||
virtual ~Android() override;
|
virtual ~Android() override;
|
||||||
virtual void Initialize() override;
|
virtual void Initialize() override;
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
#include "app.h"
|
#include "app.h"
|
||||||
#include "jsondatamgr.h"
|
#include "jsondatamgr.h"
|
||||||
#include "handlermgr.h"
|
#include "handlermgr.h"
|
||||||
#include "metamgr.h"
|
|
||||||
#include "roommgr.h"
|
#include "roommgr.h"
|
||||||
#include "player.h"
|
#include "player.h"
|
||||||
#include "playermgr.h"
|
#include "playermgr.h"
|
||||||
@ -204,7 +203,6 @@ bool App::Init(int argc, char* argv[])
|
|||||||
#endif
|
#endif
|
||||||
SkillHelper::Init();
|
SkillHelper::Init();
|
||||||
JsonDataMgr::Instance()->Init();
|
JsonDataMgr::Instance()->Init();
|
||||||
MetaMgr::Instance()->Init();
|
|
||||||
mt::MetaMgr::Instance()->Init();
|
mt::MetaMgr::Instance()->Init();
|
||||||
EntityFactory::Instance()->Init();
|
EntityFactory::Instance()->Init();
|
||||||
uuid.SetMachineId((node_id - 1) * MAX_NODE_ID + instance_id);
|
uuid.SetMachineId((node_id - 1) * MAX_NODE_ID + instance_id);
|
||||||
@ -260,7 +258,6 @@ void App::UnInit()
|
|||||||
KillMgr::Instance()->UnInit();
|
KillMgr::Instance()->UnInit();
|
||||||
EntityFactory::Instance()->UnInit();
|
EntityFactory::Instance()->UnInit();
|
||||||
mt::MetaMgr::Instance()->UnInit();
|
mt::MetaMgr::Instance()->UnInit();
|
||||||
MetaMgr::Instance()->UnInit();
|
|
||||||
JsonDataMgr::Instance()->UnInit();
|
JsonDataMgr::Instance()->UnInit();
|
||||||
f8::BtMgr::Instance()->UnInit();
|
f8::BtMgr::Instance()->UnInit();
|
||||||
f8::HttpClientPool::Instance()->UnInit();
|
f8::HttpClientPool::Instance()->UnInit();
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
#include "battledatacontext.h"
|
#include "battledatacontext.h"
|
||||||
|
|
||||||
#include "human.h"
|
#include "human.h"
|
||||||
#include "metamgr.h"
|
|
||||||
#include "creature.h"
|
#include "creature.h"
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "bullet.h"
|
#include "bullet.h"
|
||||||
@ -15,6 +14,13 @@
|
|||||||
#include "roommgr.h"
|
#include "roommgr.h"
|
||||||
#include "mt/Param.h"
|
#include "mt/Param.h"
|
||||||
#include "mt/Hero.h"
|
#include "mt/Hero.h"
|
||||||
|
#include "mt/HeroQuality.h"
|
||||||
|
#include "mt/NpcStandard.h"
|
||||||
|
#include "mt/PveGemini.h"
|
||||||
|
#include "mt/PveGeminiContent.h"
|
||||||
|
#include "mt/Equip.h"
|
||||||
|
#include "mt/Skill.h"
|
||||||
|
#include "mt/FormulaPvp.h"
|
||||||
|
|
||||||
#include "attrhelper.h"
|
#include "attrhelper.h"
|
||||||
|
|
||||||
@ -89,13 +95,13 @@ private:
|
|||||||
dodge_ = hero_meta->miss();
|
dodge_ = hero_meta->miss();
|
||||||
dodge_damage_ruduce_ = hero_meta->miss_damage_ruduce();
|
dodge_damage_ruduce_ = hero_meta->miss_damage_ruduce();
|
||||||
if (c->room->pve_instance) {
|
if (c->room->pve_instance) {
|
||||||
MetaData::NpcStandard* standard_meta = MetaMgr::Instance()->GetNpcStandard
|
const mt::NpcStandard* standard_meta = mt::NpcStandard::GetById
|
||||||
(c->room->pve_instance->pb->gemini_lv());
|
(c->room->pve_instance->gemini_lv());
|
||||||
if (standard_meta) {
|
if (standard_meta) {
|
||||||
hp_ = standard_meta->pb->hp() * hero_meta->hp_ratio() *
|
hp_ = standard_meta->hp() * hero_meta->hp_ratio() *
|
||||||
c->room->pve_instance->GetHpMul(c->room->GetHumanNum());
|
c->room->pve_instance->GetHpMul(c->room->GetHumanNum());
|
||||||
atk_ = standard_meta->pb->damage() * hero_meta->damage_ratio();
|
atk_ = standard_meta->damage() * hero_meta->damage_ratio();
|
||||||
def_ = standard_meta->pb->defence() * hero_meta->defence_ratio();
|
def_ = standard_meta->defence() * hero_meta->defence_ratio();
|
||||||
} else {
|
} else {
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
abort();
|
abort();
|
||||||
@ -198,7 +204,7 @@ class WeaponAbility
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
long long weapon_uniid = 0;
|
long long weapon_uniid = 0;
|
||||||
MetaData::Equip* weapon_meta = nullptr;
|
const mt::Equip* weapon_meta = nullptr;
|
||||||
std::shared_ptr<a8::XObject> weapon_dto;
|
std::shared_ptr<a8::XObject> weapon_dto;
|
||||||
|
|
||||||
float GetAtk()
|
float GetAtk()
|
||||||
@ -244,12 +250,12 @@ private:
|
|||||||
|
|
||||||
void DefaultInit(Creature* c)
|
void DefaultInit(Creature* c)
|
||||||
{
|
{
|
||||||
atk_ = weapon_meta->pb->atk();
|
atk_ = weapon_meta->atk();
|
||||||
crit_atk_ = weapon_meta->pb->critical();
|
crit_atk_ = weapon_meta->critical();
|
||||||
crit_atk_ratio_ = weapon_meta->pb->cri_damage();
|
crit_atk_ratio_ = weapon_meta->cri_damage();
|
||||||
clip_volume_ = weapon_meta->pb->clip_volume();
|
clip_volume_ = weapon_meta->clip_volume();
|
||||||
fire_rate_ = weapon_meta->pb->fire_rate();
|
fire_rate_ = weapon_meta->fire_rate();
|
||||||
reload_time_ = weapon_meta->pb->reload_time();
|
reload_time_ = weapon_meta->reload_time();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DtoInit(Creature* c)
|
void DtoInit(Creature* c)
|
||||||
@ -355,7 +361,7 @@ void BattleDataContext::ParseResult(a8::XObject& obj)
|
|||||||
}
|
}
|
||||||
if (obj.HasKey("weapon_dto1") && obj.At("weapon_dto1")->IsObject()) {
|
if (obj.HasKey("weapon_dto1") && obj.At("weapon_dto1")->IsObject()) {
|
||||||
weapon_dto1 = obj.At("weapon_dto1");
|
weapon_dto1 = obj.At("weapon_dto1");
|
||||||
MetaData::Equip* meta = MetaMgr::Instance()->GetEquip(weapon_dto1->Get("gun_id", 0));
|
const mt::Equip* meta = mt::Equip::GetById(weapon_dto1->Get("gun_id", 0));
|
||||||
if (meta) {
|
if (meta) {
|
||||||
weapon1_ability_ = std::make_shared<WeaponAbility>();
|
weapon1_ability_ = std::make_shared<WeaponAbility>();
|
||||||
weapon1_ability_->weapon_uniid = weapon_dto1->Get("gun_uniid", 0);
|
weapon1_ability_->weapon_uniid = weapon_dto1->Get("gun_uniid", 0);
|
||||||
@ -365,7 +371,7 @@ void BattleDataContext::ParseResult(a8::XObject& obj)
|
|||||||
}
|
}
|
||||||
if (obj.HasKey("weapon_dto2") && obj.At("weapon_dto2")->IsObject()) {
|
if (obj.HasKey("weapon_dto2") && obj.At("weapon_dto2")->IsObject()) {
|
||||||
weapon_dto2 = obj.At("weapon_dto2");
|
weapon_dto2 = obj.At("weapon_dto2");
|
||||||
MetaData::Equip* meta = MetaMgr::Instance()->GetEquip(weapon_dto2->Get("gun_id", 0));
|
const mt::Equip* meta = mt::Equip::GetById(weapon_dto2->Get("gun_id", 0));
|
||||||
if (meta) {
|
if (meta) {
|
||||||
weapon2_ability_ = std::make_shared<WeaponAbility>();
|
weapon2_ability_ = std::make_shared<WeaponAbility>();
|
||||||
weapon2_ability_->weapon_uniid = weapon_dto2->Get("gun_uniid", 0);
|
weapon2_ability_->weapon_uniid = weapon_dto2->Get("gun_uniid", 0);
|
||||||
@ -411,7 +417,7 @@ void BattleDataContext::CalcBattleStat(struct PlayerStats* stats)
|
|||||||
auto CalcHeroPvpCeg =
|
auto CalcHeroPvpCeg =
|
||||||
[] (long long ceg_uplimit, struct PlayerStats* stats) -> long long
|
[] (long long ceg_uplimit, struct PlayerStats* stats) -> long long
|
||||||
{
|
{
|
||||||
MetaData::FormulaPvp* meta = MetaMgr::Instance()->GetFormulaPvp(stats->ranked_topx);
|
const mt::FormulaPvp* meta = mt::FormulaPvp::GetById(stats->ranked_topx);
|
||||||
if (!meta) {
|
if (!meta) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -419,11 +425,11 @@ void BattleDataContext::CalcBattleStat(struct PlayerStats* stats)
|
|||||||
(
|
(
|
||||||
ceg_uplimit *
|
ceg_uplimit *
|
||||||
(
|
(
|
||||||
(0.5 * stats->ranked_topx * meta->pb->ranked_topx()) +
|
(0.5 * stats->ranked_topx * meta->ranked_topx()) +
|
||||||
(0.25 * stats->kills_topx * meta->pb->kills_topx()) +
|
(0.25 * stats->kills_topx * meta->kills_topx()) +
|
||||||
(0.15 * stats->hero_topx * meta->pb->hero_topx()) +
|
(0.15 * stats->hero_topx * meta->hero_topx()) +
|
||||||
(0.5 * stats->weapon_topx * meta->pb->weapon_topx()) +
|
(0.5 * stats->weapon_topx * meta->weapon_topx()) +
|
||||||
(0.5 * stats->survival_topx * meta->pb->survival_topx())
|
(0.5 * stats->survival_topx * meta->survival_topx())
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
return ceg;
|
return ceg;
|
||||||
@ -431,7 +437,7 @@ void BattleDataContext::CalcBattleStat(struct PlayerStats* stats)
|
|||||||
auto CalcWeaponPvpCeg =
|
auto CalcWeaponPvpCeg =
|
||||||
[] (long long ceg_uplimit, struct PlayerStats* stats) -> long long
|
[] (long long ceg_uplimit, struct PlayerStats* stats) -> long long
|
||||||
{
|
{
|
||||||
MetaData::FormulaPvp* meta = MetaMgr::Instance()->GetFormulaPvp(stats->ranked_topx);
|
const mt::FormulaPvp* meta = mt::FormulaPvp::GetById(stats->ranked_topx);
|
||||||
if (!meta) {
|
if (!meta) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -439,11 +445,11 @@ void BattleDataContext::CalcBattleStat(struct PlayerStats* stats)
|
|||||||
(
|
(
|
||||||
ceg_uplimit *
|
ceg_uplimit *
|
||||||
(
|
(
|
||||||
(0.5 * stats->ranked_topx * meta->pb->ranked_topx()) +
|
(0.5 * stats->ranked_topx * meta->ranked_topx()) +
|
||||||
(0.25 * stats->kills_topx * meta->pb->kills_topx()) +
|
(0.25 * stats->kills_topx * meta->kills_topx()) +
|
||||||
(0.15 * stats->hero_topx * meta->pb->hero_topx()) +
|
(0.15 * stats->hero_topx * meta->hero_topx()) +
|
||||||
(0.5 * stats->weapon_topx * meta->pb->weapon_topx()) +
|
(0.5 * stats->weapon_topx * meta->weapon_topx()) +
|
||||||
(0.5 * stats->survival_topx * meta->pb->survival_topx())
|
(0.5 * stats->survival_topx * meta->survival_topx())
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
return ceg;
|
return ceg;
|
||||||
@ -454,7 +460,7 @@ void BattleDataContext::CalcBattleStat(struct PlayerStats* stats)
|
|||||||
int quality = hero_dto->Get("quality", 0).GetInt();
|
int quality = hero_dto->Get("quality", 0).GetInt();
|
||||||
int today_get_gold = hero_dto->Get("today_get_gold", 0).GetInt();
|
int today_get_gold = hero_dto->Get("today_get_gold", 0).GetInt();
|
||||||
const mt::Hero* hero_meta = mt::Hero::GetById(hero_id);
|
const mt::Hero* hero_meta = mt::Hero::GetById(hero_id);
|
||||||
MetaData::HeroQuality* quality_meta = MetaMgr::Instance()->GetHeroQuality(quality);
|
const mt::HeroQuality* quality_meta = mt::HeroQuality::GetById(quality);
|
||||||
|
|
||||||
stats->pb_hero_stats.set_hero_uniid(a8::XValue(hero_ability_->hero_uniid_).GetString());
|
stats->pb_hero_stats.set_hero_uniid(a8::XValue(hero_ability_->hero_uniid_).GetString());
|
||||||
stats->pb_hero_stats.set_hero_id(hero_id);
|
stats->pb_hero_stats.set_hero_id(hero_id);
|
||||||
@ -482,14 +488,14 @@ void BattleDataContext::CalcBattleStat(struct PlayerStats* stats)
|
|||||||
int gun_id = weapon_dto->Get("gun_id", 0).GetInt();
|
int gun_id = weapon_dto->Get("gun_id", 0).GetInt();
|
||||||
int quality = weapon_dto->Get("quality", 0).GetInt();
|
int quality = weapon_dto->Get("quality", 0).GetInt();
|
||||||
int today_get_gold = weapon_dto->Get("today_get_gold", 0).GetInt();
|
int today_get_gold = weapon_dto->Get("today_get_gold", 0).GetInt();
|
||||||
MetaData::Item* item_meta = MetaMgr::Instance()->GetItem(gun_id);
|
const mt::Item* item_meta = MetaMgr::Instance()->GetItem(gun_id);
|
||||||
MetaData::GunQuality* quality_meta = MetaMgr::Instance()->GetGunQuality(quality);
|
const mt::GunQuality* quality_meta = MetaMgr::Instance()->GetGunQuality(quality);
|
||||||
|
|
||||||
|
|
||||||
auto p = stats->pb_weapons_stats.Add();
|
auto p = stats->pb_weapons_stats.Add();
|
||||||
p->set_weapon_uniid(gun_uniid);
|
p->set_weapon_uniid(gun_uniid);
|
||||||
p->set_weapon_id(gun_id);
|
p->set_weapon_id(gun_id);
|
||||||
p->set_weapon_name(item_meta ? item_meta->pb->name() : "");
|
p->set_weapon_name(item_meta ? item_meta->name() : "");
|
||||||
if (quality_meta) {
|
if (quality_meta) {
|
||||||
int up_limit = quality_meta->GetPvpCegUpLimit();
|
int up_limit = quality_meta->GetPvpCegUpLimit();
|
||||||
int ceg = CalcWeaponPvpCeg(up_limit, stats);
|
int ceg = CalcWeaponPvpCeg(up_limit, stats);
|
||||||
@ -639,7 +645,7 @@ float BattleDataContext::GetWeaponAtk(IBullet* bullet)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return bullet->GetGunMeta()->pb->atk();
|
return bullet->GetGunMeta()->atk();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BattleDataContext::IsCrit(IBullet* bullet)
|
bool BattleDataContext::IsCrit(IBullet* bullet)
|
||||||
@ -679,9 +685,9 @@ std::shared_ptr<WeaponAbility> BattleDataContext::GetWeaponByUniId(long long wea
|
|||||||
void BattleDataContext::ForceInit(long long hero_uniid,
|
void BattleDataContext::ForceInit(long long hero_uniid,
|
||||||
const mt::Hero* hum_meta,
|
const mt::Hero* hum_meta,
|
||||||
long long weapon1_uniid,
|
long long weapon1_uniid,
|
||||||
MetaData::Equip* weapon1_meta,
|
const mt::Equip* weapon1_meta,
|
||||||
long long weapon2_uniid,
|
long long weapon2_uniid,
|
||||||
MetaData::Equip* weapon2_meta)
|
const mt::Equip* weapon2_meta)
|
||||||
{
|
{
|
||||||
hero_ability_->hero_uniid_ = hero_uniid;
|
hero_ability_->hero_uniid_ = hero_uniid;
|
||||||
hero_ability_->hero_meta = hum_meta;
|
hero_ability_->hero_meta = hum_meta;
|
||||||
@ -717,26 +723,26 @@ void BattleDataContext::GetSkillList(std::vector<int>& skill_list)
|
|||||||
int hero_lv = 1;
|
int hero_lv = 1;
|
||||||
int quality = 1;
|
int quality = 1;
|
||||||
GetHeroLvQuality(hero_lv, quality);
|
GetHeroLvQuality(hero_lv, quality);
|
||||||
MetaData::Skill* skill1 = MetaMgr::Instance()->GetSkill(hero_ability_->hero_meta->skill1list());
|
const mt::Skill* skill1 = MetaMgr::Instance()->GetSkill(hero_ability_->hero_meta->skill1list());
|
||||||
MetaData::Skill* skill2 = MetaMgr::Instance()->GetSkill(hero_ability_->hero_meta->skill2list());
|
const mt::Skill* skill2 = MetaMgr::Instance()->GetSkill(hero_ability_->hero_meta->skill2list());
|
||||||
MetaData::Skill* skill3 = MetaMgr::Instance()->GetSkill(hero_ability_->hero_meta->skill3list());
|
const mt::Skill* skill3 = MetaMgr::Instance()->GetSkill(hero_ability_->hero_meta->skill3list());
|
||||||
if (skill1 && skill2 && skill3 && skill1_lv > 0 && skill2_lv > 0 && skill3_lv > 0) {
|
if (skill1 && skill2 && skill3 && skill1_lv > 0 && skill2_lv > 0 && skill3_lv > 0) {
|
||||||
if (MetaMgr::Instance()->GetSkill(skill1->pb->skill_id() + skill1_lv - 1)) {
|
if (MetaMgr::Instance()->GetSkill(skill1->skill_id() + skill1_lv - 1)) {
|
||||||
skill_list.push_back(skill1->pb->skill_id() + skill1_lv - 1);
|
skill_list.push_back(skill1->skill_id() + skill1_lv - 1);
|
||||||
} else {
|
} else {
|
||||||
skill_list.push_back(skill1->pb->skill_id());
|
skill_list.push_back(skill1->skill_id());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MetaMgr::Instance()->GetSkill(skill2->pb->skill_id() + skill2_lv - 2)) {
|
if (MetaMgr::Instance()->GetSkill(skill2->skill_id() + skill2_lv - 2)) {
|
||||||
skill_list.push_back(skill2->pb->skill_id() + skill2_lv - 2);
|
skill_list.push_back(skill2->skill_id() + skill2_lv - 2);
|
||||||
} else {
|
} else {
|
||||||
skill_list.push_back(skill2->pb->skill_id());
|
skill_list.push_back(skill2->skill_id());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MetaMgr::Instance()->GetSkill(skill3->pb->skill_id() + skill3_lv - 3)) {
|
if (MetaMgr::Instance()->GetSkill(skill3->skill_id() + skill3_lv - 3)) {
|
||||||
skill_list.push_back(skill3->pb->skill_id() + skill3_lv - 3);
|
skill_list.push_back(skill3->skill_id() + skill3_lv - 3);
|
||||||
} else {
|
} else {
|
||||||
skill_list.push_back(skill3->pb->skill_id());
|
skill_list.push_back(skill3->skill_id());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -759,7 +765,7 @@ int BattleDataContext::GetClipVolume(Creature* c, Weapon* weapon)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
auto p = GetWeaponByUniId(weapon->weapon_uniid);
|
auto p = GetWeaponByUniId(weapon->weapon_uniid);
|
||||||
return p ? p->GetClipVolume() : weapon->meta->pb->clip_volume();
|
return p ? p->GetClipVolume() : weapon->meta->clip_volume();
|
||||||
}
|
}
|
||||||
|
|
||||||
int BattleDataContext::GetFireRate(Creature* c, Weapon* weapon)
|
int BattleDataContext::GetFireRate(Creature* c, Weapon* weapon)
|
||||||
@ -768,7 +774,7 @@ int BattleDataContext::GetFireRate(Creature* c, Weapon* weapon)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
auto p = GetWeaponByUniId(weapon->weapon_uniid);
|
auto p = GetWeaponByUniId(weapon->weapon_uniid);
|
||||||
return p ? p->GetFireRate() : weapon->meta->pb->fire_rate();
|
return p ? p->GetFireRate() : weapon->meta->fire_rate();
|
||||||
}
|
}
|
||||||
|
|
||||||
int BattleDataContext::GetReloadTime(Creature* c, Weapon* weapon)
|
int BattleDataContext::GetReloadTime(Creature* c, Weapon* weapon)
|
||||||
@ -777,7 +783,7 @@ int BattleDataContext::GetReloadTime(Creature* c, Weapon* weapon)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
auto p = GetWeaponByUniId(weapon->weapon_uniid);
|
auto p = GetWeaponByUniId(weapon->weapon_uniid);
|
||||||
return p ? p->GetReloadTime() : weapon->meta->pb->reload_time();
|
return p ? p->GetReloadTime() : weapon->meta->reload_time();
|
||||||
}
|
}
|
||||||
|
|
||||||
float BattleDataContext::GetExtRecoverHp()
|
float BattleDataContext::GetExtRecoverHp()
|
||||||
|
@ -62,9 +62,9 @@ struct BattleDataContext
|
|||||||
void ForceInit(long long hero_uniid,
|
void ForceInit(long long hero_uniid,
|
||||||
const mt::Hero* hum_meta,
|
const mt::Hero* hum_meta,
|
||||||
long long weapon1_uniid,
|
long long weapon1_uniid,
|
||||||
MetaData::Equip* weapon1_meta,
|
const mt::Equip* weapon1_meta,
|
||||||
long long weapon2_uniid,
|
long long weapon2_uniid,
|
||||||
MetaData::Equip* weapon2_meta);
|
const mt::Equip* weapon2_meta);
|
||||||
void Init(Creature* c);
|
void Init(Creature* c);
|
||||||
void GetSkillList(std::vector<int>& skill_list);
|
void GetSkillList(std::vector<int>& skill_list);
|
||||||
int GetClipVolume(Creature* c, Weapon* weapon);
|
int GetClipVolume(Creature* c, Weapon* weapon);
|
||||||
|
@ -3,16 +3,6 @@
|
|||||||
#include "weakptr.h"
|
#include "weakptr.h"
|
||||||
#include "weapon.h"
|
#include "weapon.h"
|
||||||
|
|
||||||
namespace MetaData
|
|
||||||
{
|
|
||||||
struct Player;
|
|
||||||
struct Equip;
|
|
||||||
struct Dress;
|
|
||||||
struct Skill;
|
|
||||||
struct Tank;
|
|
||||||
struct Buff;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace cs
|
namespace cs
|
||||||
{
|
{
|
||||||
class MFBuff;
|
class MFBuff;
|
||||||
@ -33,8 +23,8 @@ class Buff
|
|||||||
public:
|
public:
|
||||||
int buff_uniid = 0;
|
int buff_uniid = 0;
|
||||||
Creature* owner = nullptr;
|
Creature* owner = nullptr;
|
||||||
MetaData::Buff* meta = nullptr;
|
const mt::Buff* meta = nullptr;
|
||||||
MetaData::Skill* skill_meta = nullptr;
|
const mt::Skill* skill_meta = nullptr;
|
||||||
a8::Attacher xtimer_attacher;
|
a8::Attacher xtimer_attacher;
|
||||||
long long add_frameno = 0;
|
long long add_frameno = 0;
|
||||||
list_head effect_entry;
|
list_head effect_entry;
|
||||||
|
@ -5,6 +5,7 @@ namespace mt
|
|||||||
class Param;
|
class Param;
|
||||||
class Hero;
|
class Hero;
|
||||||
class Map;
|
class Map;
|
||||||
|
class MapThing;
|
||||||
class Attr;
|
class Attr;
|
||||||
class FormulaPvp;
|
class FormulaPvp;
|
||||||
class GunQuality;
|
class GunQuality;
|
||||||
|
@ -9,7 +9,7 @@ IMPL_TABLE(mt::GunQuality)
|
|||||||
namespace mt
|
namespace mt
|
||||||
{
|
{
|
||||||
|
|
||||||
long long GunQuality::GetPvpCegUpLimit()
|
long long GunQuality::GetPvpCegUpLimit() const
|
||||||
{
|
{
|
||||||
double sys_param = 0;
|
double sys_param = 0;
|
||||||
long long up_limit = round
|
long long up_limit = round
|
||||||
|
@ -11,7 +11,7 @@ namespace mt
|
|||||||
"id")
|
"id")
|
||||||
public:
|
public:
|
||||||
|
|
||||||
long long GetPvpCegUpLimit();
|
long long GetPvpCegUpLimit() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ IMPL_TABLE(mt::HeroQuality)
|
|||||||
namespace mt
|
namespace mt
|
||||||
{
|
{
|
||||||
|
|
||||||
long long HeroQuality::GetPvpCegUpLimit()
|
long long HeroQuality::GetPvpCegUpLimit() const
|
||||||
{
|
{
|
||||||
double sys_param = 0;
|
double sys_param = 0;
|
||||||
long long up_limit = round
|
long long up_limit = round
|
||||||
|
@ -11,7 +11,7 @@ namespace mt
|
|||||||
"id")
|
"id")
|
||||||
public:
|
public:
|
||||||
|
|
||||||
long long GetPvpCegUpLimit();
|
long long GetPvpCegUpLimit() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ namespace mt
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float PveGemini::GetHpMul(int num)
|
float PveGemini::GetHpMul(int num) const
|
||||||
{
|
{
|
||||||
if (num > 0 && num <= hp_muls.size()) {
|
if (num > 0 && num <= hp_muls.size()) {
|
||||||
return hp_muls[num - 1];
|
return hp_muls[num - 1];
|
||||||
|
@ -12,7 +12,8 @@ namespace mt
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
void Init1();
|
void Init1();
|
||||||
float GetHpMul(int num);
|
float GetHpMul(int num) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<float> hp_muls;
|
std::vector<float> hp_muls;
|
||||||
std::vector<float> hp_mul;
|
std::vector<float> hp_mul;
|
||||||
|
@ -13,7 +13,7 @@ namespace mt
|
|||||||
|
|
||||||
void Init1();
|
void Init1();
|
||||||
static const mt::Robot* RandRobot(std::set<int>& refreshed_robot_set);
|
static const mt::Robot* RandRobot(std::set<int>& refreshed_robot_set);
|
||||||
private:
|
|
||||||
std::vector<int> _skin_id;
|
std::vector<int> _skin_id;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -11,17 +11,6 @@
|
|||||||
#include "pvedata.h"
|
#include "pvedata.h"
|
||||||
#include "bornpoint.h"
|
#include "bornpoint.h"
|
||||||
|
|
||||||
namespace MetaData
|
|
||||||
{
|
|
||||||
struct Map;
|
|
||||||
struct AirLine;
|
|
||||||
struct MapThing;
|
|
||||||
struct Player;
|
|
||||||
struct PveGeminiMode;
|
|
||||||
struct PveGemini;
|
|
||||||
struct Skill;
|
|
||||||
}
|
|
||||||
|
|
||||||
class Entity;
|
class Entity;
|
||||||
class RoomEntity;
|
class RoomEntity;
|
||||||
class MoveableEntity;
|
class MoveableEntity;
|
||||||
@ -71,8 +60,8 @@ public:
|
|||||||
bool added_to_over_room = false;
|
bool added_to_over_room = false;
|
||||||
glm::vec3 last_player_jump_pos;
|
glm::vec3 last_player_jump_pos;
|
||||||
std::map<int, RoomObstacleWeakPtr> mine_objects;
|
std::map<int, RoomObstacleWeakPtr> mine_objects;
|
||||||
MetaData::PveGeminiMode* pve_mode_meta = nullptr;
|
const mt::PveGeminiMode* pve_mode_meta = nullptr;
|
||||||
MetaData::PveGemini* pve_instance = nullptr;
|
const mt::PveGemini* pve_instance = nullptr;
|
||||||
int pve_human_num = 0;
|
int pve_human_num = 0;
|
||||||
PveData pve_data;
|
PveData pve_data;
|
||||||
|
|
||||||
@ -92,7 +81,7 @@ public:
|
|||||||
long long GetRoomUuid() { return room_uuid_; }
|
long long GetRoomUuid() { return room_uuid_; }
|
||||||
int GetRoomIdx() { return room_idx_; }
|
int GetRoomIdx() { return room_idx_; }
|
||||||
std::string GetMapTplName() { return map_tpl_name_; }
|
std::string GetMapTplName() { return map_tpl_name_; }
|
||||||
const MetaData::Map* GetMapMeta() { return map_meta_; }
|
const mt::Map* GetMapMeta() { return map_meta_; }
|
||||||
#if 1
|
#if 1
|
||||||
bool IsWaitingStart() { return false; }
|
bool IsWaitingStart() { return false; }
|
||||||
#else
|
#else
|
||||||
@ -140,9 +129,9 @@ public:
|
|||||||
int CreateLootEx(int equip_id, Position born_pos, Position pos, int count, int equip_lv, bool show_anim);
|
int CreateLootEx(int equip_id, Position born_pos, Position pos, int count, int equip_lv, bool show_anim);
|
||||||
int CreateBullet(Creature* sender,
|
int CreateBullet(Creature* sender,
|
||||||
Creature* passenger,
|
Creature* passenger,
|
||||||
MetaData::Equip* weapon_meta,
|
const mt::Equip* weapon_meta,
|
||||||
MetaData::Equip* bullet_meta,
|
const mt::Equip* bullet_meta,
|
||||||
MetaData::Skill* skill_meta,
|
const mt::Skill* skill_meta,
|
||||||
Position pos,
|
Position pos,
|
||||||
glm::vec3 dir,
|
glm::vec3 dir,
|
||||||
float fly_distance,
|
float fly_distance,
|
||||||
@ -153,7 +142,7 @@ public:
|
|||||||
float shot_animi_time);
|
float shot_animi_time);
|
||||||
Car* CreateCar(Human* driver,
|
Car* CreateCar(Human* driver,
|
||||||
int car_uniid,
|
int car_uniid,
|
||||||
MetaData::Equip* meta,
|
const mt::Equip* meta,
|
||||||
const Position& pos,
|
const Position& pos,
|
||||||
int team_id);
|
int team_id);
|
||||||
Hero* CreateHero(Creature* master,
|
Hero* CreateHero(Creature* master,
|
||||||
@ -236,7 +225,7 @@ private:
|
|||||||
void MatchTeam(Human* hum);
|
void MatchTeam(Human* hum);
|
||||||
void CombineTeam();
|
void CombineTeam();
|
||||||
void AirDrop(int appear_time, int box_id, int airdrop_id);
|
void AirDrop(int appear_time, int box_id, int airdrop_id);
|
||||||
void AdjustAirDropPos(MetaData::MapThing* thing_meta, Position& box_pos);
|
void AdjustAirDropPos(const mt::MapThing* thing_meta, Position& box_pos);
|
||||||
void AirRaid(int airraid_id);
|
void AirRaid(int airraid_id);
|
||||||
void ShuaPlane();
|
void ShuaPlane();
|
||||||
Team* NewTeam();
|
Team* NewTeam();
|
||||||
@ -308,7 +297,7 @@ private:
|
|||||||
int room_idx_ = 0;
|
int room_idx_ = 0;
|
||||||
RoomMode_e room_mode_ = kChiJiMode;
|
RoomMode_e room_mode_ = kChiJiMode;
|
||||||
long long room_uuid_ = 0;
|
long long room_uuid_ = 0;
|
||||||
const MetaData::Map* map_meta_ = nullptr;
|
const mt::Map* map_meta_ = nullptr;
|
||||||
std::string map_tpl_name_;
|
std::string map_tpl_name_;
|
||||||
RoomType_e room_type_ = RT_NewBrid;
|
RoomType_e room_type_ = RT_NewBrid;
|
||||||
|
|
||||||
@ -323,7 +312,7 @@ private:
|
|||||||
int alive_count_ = 0;
|
int alive_count_ = 0;
|
||||||
long long alive_count_chged_frameno_ = 0;
|
long long alive_count_chged_frameno_ = 0;
|
||||||
int human_alive_count_ = 0;
|
int human_alive_count_ = 0;
|
||||||
MetaData::AirLine* airline_ = nullptr;
|
const mt::AirLine* airline_ = nullptr;
|
||||||
size_t airdrop_times_ = 0;
|
size_t airdrop_times_ = 0;
|
||||||
size_t airraid_times_ = 0;
|
size_t airraid_times_ = 0;
|
||||||
int level0room_born_point_uniid_ = 0;
|
int level0room_born_point_uniid_ = 0;
|
||||||
|
@ -5,12 +5,6 @@ namespace cs
|
|||||||
class MFWeapon;
|
class MFWeapon;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace MetaData
|
|
||||||
{
|
|
||||||
struct Equip;
|
|
||||||
struct Skill;
|
|
||||||
}
|
|
||||||
|
|
||||||
class Creature;
|
class Creature;
|
||||||
class Weapon
|
class Weapon
|
||||||
{
|
{
|
||||||
@ -20,9 +14,9 @@ class Weapon
|
|||||||
int weapon_idx = 0;
|
int weapon_idx = 0;
|
||||||
int weapon_id = 0;
|
int weapon_id = 0;
|
||||||
int ammo = 0;
|
int ammo = 0;
|
||||||
MetaData::Equip* meta = nullptr;
|
const mt::Equip* meta = nullptr;
|
||||||
MetaData::Equip* bullet_meta = nullptr;
|
const mt::Equip* bullet_meta = nullptr;
|
||||||
MetaData::Skill* skill_meta = nullptr;
|
const mt::Skill* skill_meta = nullptr;
|
||||||
|
|
||||||
void Clear();
|
void Clear();
|
||||||
void ToPB(Creature* c, cs::MFWeapon* pb_obj);
|
void ToPB(Creature* c, cs::MFWeapon* pb_obj);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user