移除EqupUpgrade
This commit is contained in:
parent
2737a2fc17
commit
d5134c05cb
@ -38,7 +38,7 @@ void Bullet::RecalcSelfCollider()
|
|||||||
AddCollider(self_collider_);
|
AddCollider(self_collider_);
|
||||||
}
|
}
|
||||||
self_collider_->pos = a8::Vec2();
|
self_collider_->pos = a8::Vec2();
|
||||||
self_collider_->rad = gun_meta->i->bullet_rad();
|
self_collider_->rad = meta->i->bullet_rad();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bullet::OnHit(std::set<Entity*>& objects)
|
void Bullet::OnHit(std::set<Entity*>& objects)
|
||||||
@ -60,11 +60,11 @@ void Bullet::OnHit(std::set<Entity*>& objects)
|
|||||||
if (hum != player && !hum->dead &&
|
if (hum != player && !hum->dead &&
|
||||||
(hum->team_id == 0 || player->team_id != hum->team_id)) {
|
(hum->team_id == 0 || player->team_id != hum->team_id)) {
|
||||||
#endif
|
#endif
|
||||||
float dmg = gun_meta->i->atk() * (1 + player->ability.damage_add);
|
float dmg = meta->i->atk() * (1 + player->ability.damage_add);
|
||||||
float def = hum->def + hum->ability.def_add;
|
float def = hum->def + hum->ability.def_add;
|
||||||
float finaly_dmg = dmg * (1 - def/MetaMgr::Instance()->K);
|
float finaly_dmg = dmg * (1 - def/MetaMgr::Instance()->K);
|
||||||
player->stats.damage_amount_out += finaly_dmg;
|
player->stats.damage_amount_out += finaly_dmg;
|
||||||
hum->DecHP(finaly_dmg, player->entity_uniid, player->name, gun_meta->i->id());
|
hum->DecHP(finaly_dmg, player->entity_uniid, player->name, meta->i->id());
|
||||||
#if 0
|
#if 0
|
||||||
if (a8::HasBitFlag(hum->status, HS_ReflectDamage) && hum->skill_meta) {
|
if (a8::HasBitFlag(hum->status, HS_ReflectDamage) && hum->skill_meta) {
|
||||||
float reflect_dmg = finaly_dmg * hum->skill_meta->value1;
|
float reflect_dmg = finaly_dmg * hum->skill_meta->value1;
|
||||||
@ -80,7 +80,7 @@ void Bullet::OnHit(std::set<Entity*>& objects)
|
|||||||
{
|
{
|
||||||
Obstacle* obstacle = (Obstacle*)target;
|
Obstacle* obstacle = (Obstacle*)target;
|
||||||
if (!obstacle->dead && obstacle->meta->i->attack_type() == 1) {
|
if (!obstacle->dead && obstacle->meta->i->attack_type() == 1) {
|
||||||
float dmg = gun_meta->i->atk() * (1 + player->ability.damage_add);
|
float dmg = meta->i->atk() * (1 + player->ability.damage_add);
|
||||||
float def = 0;
|
float def = 0;
|
||||||
float finaly_dmg = dmg * (1 - def/MetaMgr::Instance()->K);
|
float finaly_dmg = dmg * (1 - def/MetaMgr::Instance()->K);
|
||||||
#if 0
|
#if 0
|
||||||
@ -109,7 +109,7 @@ void Bullet::OnHit(std::set<Entity*>& objects)
|
|||||||
|
|
||||||
void Bullet::ProcBomb()
|
void Bullet::ProcBomb()
|
||||||
{
|
{
|
||||||
self_collider_->rad = gun_meta->i->explosion_range();
|
self_collider_->rad = meta->i->explosion_range();
|
||||||
std::set<Entity*> objects;
|
std::set<Entity*> objects;
|
||||||
for (auto& grid : grid_list) {
|
for (auto& grid : grid_list) {
|
||||||
for (Human* hum: grid->human_list) {
|
for (Human* hum: grid->human_list) {
|
||||||
@ -186,9 +186,9 @@ bool Bullet::IsBomb()
|
|||||||
|
|
||||||
void Bullet::MapServiceUpdate()
|
void Bullet::MapServiceUpdate()
|
||||||
{
|
{
|
||||||
pos = pos + dir * gun_meta->i->bullet_speed() / (float)SERVER_FRAME_RATE;
|
pos = pos + dir * meta->i->bullet_speed() / (float)SERVER_FRAME_RATE;
|
||||||
float distance = (pos - born_pos).Norm();
|
float distance = (pos - born_pos).Norm();
|
||||||
if (room->OverBorder(pos, gun_meta->i->bullet_rad())) {
|
if (room->OverBorder(pos, meta->i->bullet_rad())) {
|
||||||
if (IsBomb()) {
|
if (IsBomb()) {
|
||||||
ProcBomb();
|
ProcBomb();
|
||||||
} else {
|
} else {
|
||||||
@ -218,10 +218,7 @@ void Bullet::MapServiceUpdate()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
float bullet_range = gun_meta->i->range();
|
float bullet_range = meta->i->range();
|
||||||
if (gun_upgrade_meta && gun_upgrade_meta->GetAttrValue(gun_lv, EA_ShotRange) > 0) {
|
|
||||||
bullet_range += gun_upgrade_meta->GetAttrValue(gun_lv, EA_ShotRange);
|
|
||||||
}
|
|
||||||
#if 1
|
#if 1
|
||||||
if (!objects.empty() || distance > bullet_range ||
|
if (!objects.empty() || distance > bullet_range ||
|
||||||
(IsBomb() && distance >= fly_distance)
|
(IsBomb() && distance >= fly_distance)
|
||||||
|
@ -6,7 +6,6 @@ namespace MetaData
|
|||||||
{
|
{
|
||||||
struct Player;
|
struct Player;
|
||||||
struct Equip;
|
struct Equip;
|
||||||
struct EquipUpgrade;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class Human;
|
class Human;
|
||||||
@ -16,9 +15,6 @@ class MovementComponent;
|
|||||||
class Bullet : public Entity
|
class Bullet : public Entity
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
int gun_lv = 0;
|
|
||||||
MetaData::Equip* gun_meta = nullptr;
|
|
||||||
MetaData::EquipUpgrade* gun_upgrade_meta = nullptr;
|
|
||||||
MetaData::Equip* meta = nullptr;
|
MetaData::Equip* meta = nullptr;
|
||||||
Human* player = nullptr;
|
Human* player = nullptr;
|
||||||
a8::Vec2 dir;
|
a8::Vec2 dir;
|
||||||
|
@ -203,7 +203,18 @@ void Human::Shot()
|
|||||||
CancelAction();
|
CancelAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto& tuple : curr_weapon->meta->bullet_born_offset) {
|
DirectShot(curr_weapon->meta);
|
||||||
|
--curr_weapon->ammo;
|
||||||
|
if (curr_weapon->ammo <= 0) {
|
||||||
|
AutoLoadingBullet();
|
||||||
|
}
|
||||||
|
last_shot_frameno_ = room->frame_no;
|
||||||
|
need_sync_active_player = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Human::DirectShot(MetaData::Equip* bullet_meta)
|
||||||
|
{
|
||||||
|
for (auto& tuple : bullet_meta->bullet_born_offset) {
|
||||||
a8::Vec2 bullet_born_offset = a8::Vec2(std::get<0>(tuple), std::get<1>(tuple));
|
a8::Vec2 bullet_born_offset = a8::Vec2(std::get<0>(tuple), std::get<1>(tuple));
|
||||||
bullet_born_offset.Rotate(attack_dir.CalcAngle(a8::Vec2::UP));
|
bullet_born_offset.Rotate(attack_dir.CalcAngle(a8::Vec2::UP));
|
||||||
a8::Vec2 bullet_born_pos = pos + bullet_born_offset;
|
a8::Vec2 bullet_born_pos = pos + bullet_born_offset;
|
||||||
@ -212,17 +223,14 @@ void Human::Shot()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
room->frame_event.AddShot(this);
|
room->frame_event.AddShot(this);
|
||||||
for (auto& tuple : curr_weapon->meta->bullet_born_offset) {
|
for (auto& tuple : bullet_meta->bullet_born_offset) {
|
||||||
a8::Vec2 bullet_born_offset = a8::Vec2(std::get<0>(tuple), std::get<1>(tuple));
|
a8::Vec2 bullet_born_offset = a8::Vec2(std::get<0>(tuple), std::get<1>(tuple));
|
||||||
bullet_born_offset.Rotate(attack_dir.CalcAngle(a8::Vec2::UP));
|
bullet_born_offset.Rotate(attack_dir.CalcAngle(a8::Vec2::UP));
|
||||||
a8::Vec2 bullet_born_pos = pos + bullet_born_offset;
|
a8::Vec2 bullet_born_pos = pos + bullet_born_offset;
|
||||||
a8::Vec2 bullet_dir = attack_dir;
|
a8::Vec2 bullet_dir = attack_dir;
|
||||||
float bullet_angle = std::get<2>(tuple);
|
float bullet_angle = std::get<2>(tuple);
|
||||||
if (curr_weapon->meta->i->bullet_angle() >= 0.10f) {
|
if (bullet_meta->i->bullet_angle() >= 0.10f) {
|
||||||
int angle = (int)curr_weapon->meta->i->bullet_angle() * 1000;
|
int angle = (int)bullet_meta->i->bullet_angle() * 1000;
|
||||||
if (curr_weapon->upgrade_meta) {
|
|
||||||
angle -= curr_weapon->upgrade_meta->GetAttrValue(curr_weapon->weapon_lv, EA_BulletAngle) * 1000;
|
|
||||||
}
|
|
||||||
if (angle > 0) {
|
if (angle > 0) {
|
||||||
bullet_angle += (rand() % angle) / 1000.0f * (rand() % 2 == 0 ? 1 : -1);
|
bullet_angle += (rand() % angle) / 1000.0f * (rand() % 2 == 0 ? 1 : -1);
|
||||||
}
|
}
|
||||||
@ -230,15 +238,9 @@ void Human::Shot()
|
|||||||
bullet_dir.Rotate(bullet_angle / 180.0f);
|
bullet_dir.Rotate(bullet_angle / 180.0f);
|
||||||
room->frame_event.AddBullet(this, bullet_born_pos, attack_dir, fly_distance);
|
room->frame_event.AddBullet(this, bullet_born_pos, attack_dir, fly_distance);
|
||||||
if (room->BattleStarted()) {
|
if (room->BattleStarted()) {
|
||||||
room->CreateBullet(this, curr_weapon, bullet_born_pos, bullet_dir, fly_distance);
|
room->CreateBullet(this, bullet_meta, bullet_born_pos, bullet_dir, fly_distance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
--curr_weapon->ammo;
|
|
||||||
if (curr_weapon->ammo <= 0) {
|
|
||||||
AutoLoadingBullet();
|
|
||||||
}
|
|
||||||
last_shot_frameno_ = room->frame_no;
|
|
||||||
need_sync_active_player = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Human::RecalcSelfCollider()
|
void Human::RecalcSelfCollider()
|
||||||
@ -1726,9 +1728,12 @@ void Human::ProcSkillPhase(MetaData::SkillPhase* phase)
|
|||||||
[obstacle] (Human* hum, a8::XParams&) -> bool
|
[obstacle] (Human* hum, a8::XParams&) -> bool
|
||||||
{
|
{
|
||||||
if (obstacle->master->team_id != hum->team_id) {
|
if (obstacle->master->team_id != hum->team_id) {
|
||||||
obstacle->dead = true;
|
if (hum->pos.Distance(obstacle->pos) <
|
||||||
obstacle->Explosion();
|
hum->meta->i->radius()) {
|
||||||
return false;
|
obstacle->dead = true;
|
||||||
|
obstacle->Explosion();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
@ -137,6 +137,7 @@ class Human : public Entity
|
|||||||
virtual void GetAabbBox(AabbCollider& aabb_box);
|
virtual void GetAabbBox(AabbCollider& aabb_box);
|
||||||
void FillMFTeamData(cs::MFTeamData* team_data);
|
void FillMFTeamData(cs::MFTeamData* team_data);
|
||||||
void Shot();
|
void Shot();
|
||||||
|
void DirectShot(MetaData::Equip* bullet_meta);
|
||||||
void RecalcSelfCollider();
|
void RecalcSelfCollider();
|
||||||
bool IsCollision();
|
bool IsCollision();
|
||||||
bool IsCollisionInMapService();
|
bool IsCollisionInMapService();
|
||||||
|
@ -82,53 +82,6 @@ namespace MetaData
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void EquipUpgrade::Init()
|
|
||||||
{
|
|
||||||
for (size_t j = 0; j < i->max_lv(); ++j) {
|
|
||||||
std::array<float, EA_End>& attrs = a8::FastAppend(level_attrs);
|
|
||||||
for (size_t k = 0; k < EA_End; ++k) {
|
|
||||||
attrs[k] = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
{
|
|
||||||
std::vector<std::string> strings;
|
|
||||||
a8::Split(i->attr_type(), strings, '|');
|
|
||||||
for (auto& str : strings) {
|
|
||||||
std::vector<std::string> strings2;
|
|
||||||
a8::Split(str, strings2, ':');
|
|
||||||
if (strings2.size() != 3) {
|
|
||||||
abort();
|
|
||||||
}
|
|
||||||
int attr_type = a8::XValue(strings2[0]);
|
|
||||||
int attr_level = a8::XValue(strings2[1]);
|
|
||||||
float attr_value = a8::XValue(strings2[2]).GetDouble();
|
|
||||||
if (attr_type < EA_End) {
|
|
||||||
if (attr_level >= 0 && attr_level < i->max_lv()) {
|
|
||||||
for (size_t j = 1; j < i->max_lv(); ++j) {
|
|
||||||
if (j % attr_level == 0) {
|
|
||||||
level_attrs[j][attr_type] = attr_value * (j / attr_level);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
float EquipUpgrade::GetAttrValue(int level, int attr_type)
|
|
||||||
{
|
|
||||||
if (level < 1) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if (level > level_attrs.size()) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if (attr_type < EA_End) {
|
|
||||||
return level_attrs[level][attr_type];
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Player::Init()
|
void Player::Init()
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
@ -57,17 +57,6 @@ namespace MetaData
|
|||||||
void Init();
|
void Init();
|
||||||
};
|
};
|
||||||
|
|
||||||
struct EquipUpgrade
|
|
||||||
{
|
|
||||||
const metatable::EquipUpgrade* i = nullptr;
|
|
||||||
|
|
||||||
void Init();
|
|
||||||
float GetAttrValue(int level, int attr_type);
|
|
||||||
|
|
||||||
private:
|
|
||||||
std::vector<std::array<float, EA_End>> level_attrs;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct Player
|
struct Player
|
||||||
{
|
{
|
||||||
const metatable::Player* i = nullptr;
|
const metatable::Player* i = nullptr;
|
||||||
|
@ -41,8 +41,6 @@ public:
|
|||||||
std::list<MetaData::Attr> attr_list;
|
std::list<MetaData::Attr> attr_list;
|
||||||
std::list<metatable::RankReward> rankreward_meta_list;
|
std::list<metatable::RankReward> rankreward_meta_list;
|
||||||
std::list<MetaData::RankReward> rankreward_list;
|
std::list<MetaData::RankReward> rankreward_list;
|
||||||
std::list<metatable::EquipUpgrade> equipupgrade_meta_list;
|
|
||||||
std::list<MetaData::EquipUpgrade> equipupgrade_list;
|
|
||||||
std::list<metatable::KillReward> killreward_meta_list;
|
std::list<metatable::KillReward> killreward_meta_list;
|
||||||
std::list<MetaData::KillReward> killreward_list;
|
std::list<MetaData::KillReward> killreward_list;
|
||||||
std::list<metatable::Robot> robot_meta_list;
|
std::list<metatable::Robot> robot_meta_list;
|
||||||
@ -69,7 +67,6 @@ public:
|
|||||||
std::map<std::string, MetaData::Attr*> attr_name_hash;
|
std::map<std::string, MetaData::Attr*> attr_name_hash;
|
||||||
std::map<int, MetaData::RankReward*> rankreward_hash;
|
std::map<int, MetaData::RankReward*> rankreward_hash;
|
||||||
std::map<int, MetaData::KillReward*> killreward_hash;
|
std::map<int, MetaData::KillReward*> killreward_hash;
|
||||||
std::map<int, MetaData::EquipUpgrade*> equipupgrade_hash;
|
|
||||||
std::map<int, MetaData::Robot*> robot_hash;
|
std::map<int, MetaData::Robot*> robot_hash;
|
||||||
|
|
||||||
void Load()
|
void Load()
|
||||||
@ -105,7 +102,6 @@ public:
|
|||||||
f8::ReadCsvMetaFile(res_path + "attr@attr.csv", attr_meta_list);
|
f8::ReadCsvMetaFile(res_path + "attr@attr.csv", attr_meta_list);
|
||||||
f8::ReadCsvMetaFile(res_path + "rankReward@rankReward.csv", rankreward_meta_list);
|
f8::ReadCsvMetaFile(res_path + "rankReward@rankReward.csv", rankreward_meta_list);
|
||||||
f8::ReadCsvMetaFile(res_path + "killReward@killReward.csv", killreward_meta_list);
|
f8::ReadCsvMetaFile(res_path + "killReward@killReward.csv", killreward_meta_list);
|
||||||
f8::ReadCsvMetaFile(res_path + "equipUpgrade@equipUpgrade.csv", equipupgrade_meta_list);
|
|
||||||
f8::ReadCsvMetaFile(res_path + "robot@robot.csv", robot_meta_list);
|
f8::ReadCsvMetaFile(res_path + "robot@robot.csv", robot_meta_list);
|
||||||
BindToMetaData();
|
BindToMetaData();
|
||||||
#if 1
|
#if 1
|
||||||
@ -283,12 +279,6 @@ private:
|
|||||||
killreward_hash[item.i->kill_num()] = &item;
|
killreward_hash[item.i->kill_num()] = &item;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto& meta : equipupgrade_meta_list) {
|
|
||||||
MetaData::EquipUpgrade& item = a8::FastAppend(equipupgrade_list);
|
|
||||||
item.i = &meta;
|
|
||||||
equipupgrade_hash[meta.id()] = &item;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (auto& meta : robot_meta_list) {
|
for (auto& meta : robot_meta_list) {
|
||||||
MetaData::Robot& item = a8::FastAppend(robot_list);
|
MetaData::Robot& item = a8::FastAppend(robot_list);
|
||||||
item.i = &meta;
|
item.i = &meta;
|
||||||
@ -371,12 +361,6 @@ MetaData::Equip* MetaMgr::GetEquipBySlotId(int slot_id)
|
|||||||
return itr != loader_->equip_slot_hash.end() ? itr->second : nullptr;
|
return itr != loader_->equip_slot_hash.end() ? itr->second : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
MetaData::EquipUpgrade* MetaMgr::GetEquipUpgrade(int equip_id)
|
|
||||||
{
|
|
||||||
auto itr = loader_->equipupgrade_hash.find(equip_id);
|
|
||||||
return itr != loader_->equipupgrade_hash.end() ? itr->second : nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
MetaData::Building* MetaMgr::GetBuilding(int building_id)
|
MetaData::Building* MetaMgr::GetBuilding(int building_id)
|
||||||
{
|
{
|
||||||
auto itr = loader_->building_hash.find(building_id);
|
auto itr = loader_->building_hash.find(building_id);
|
||||||
|
@ -24,7 +24,6 @@ class MetaMgr : public a8::Singleton<MetaMgr>
|
|||||||
MetaData::Player* GetPlayer(int id);
|
MetaData::Player* GetPlayer(int id);
|
||||||
MetaData::Equip* GetEquip(int id);
|
MetaData::Equip* GetEquip(int id);
|
||||||
MetaData::Equip* GetEquipBySlotId(int slot_id);
|
MetaData::Equip* GetEquipBySlotId(int slot_id);
|
||||||
MetaData::EquipUpgrade* GetEquipUpgrade(int equip_id);
|
|
||||||
MetaData::Building* GetBuilding(int building_id);
|
MetaData::Building* GetBuilding(int building_id);
|
||||||
MetaData::Drop* GetDrop(int drop_id);
|
MetaData::Drop* GetDrop(int drop_id);
|
||||||
MetaData::SafeArea* GetSafeArea(int area_id);
|
MetaData::SafeArea* GetSafeArea(int area_id);
|
||||||
|
@ -94,7 +94,6 @@ void Room::Update(int delta_time)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
long long begin_tick = a8::XGetTickCount();
|
|
||||||
elapsed_time_ += delta_time;
|
elapsed_time_ += delta_time;
|
||||||
while (elapsed_time_ >= 50) {
|
while (elapsed_time_ >= 50) {
|
||||||
if (frame_no % 2 == 0) {
|
if (frame_no % 2 == 0) {
|
||||||
@ -121,7 +120,6 @@ void Room::Update(int delta_time)
|
|||||||
++frame_no;
|
++frame_no;
|
||||||
elapsed_time_ -= 50;
|
elapsed_time_ -= 50;
|
||||||
}
|
}
|
||||||
long long end_tick = a8::XGetTickCount();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int Room::GetPlayerNum()
|
int Room::GetPlayerNum()
|
||||||
@ -548,17 +546,13 @@ void Room::CreateLoot(int equip_id, a8::Vec2 pos, int count, int equip_lv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Room::CreateBullet(Human* hum, Weapon* weapon,
|
void Room::CreateBullet(Human* hum, MetaData::Equip* bullet_meta,
|
||||||
a8::Vec2 pos, a8::Vec2 dir, float fly_distance)
|
a8::Vec2 pos, a8::Vec2 dir, float fly_distance)
|
||||||
{
|
{
|
||||||
Bullet* bullet = new Bullet();
|
Bullet* bullet = new Bullet();
|
||||||
bullet->player = hum;
|
bullet->player = hum;
|
||||||
bullet->room = this;
|
bullet->room = this;
|
||||||
bullet->gun_meta = weapon->meta;
|
bullet->meta = bullet_meta;
|
||||||
bullet->gun_upgrade_meta = weapon->upgrade_meta;
|
|
||||||
#if 1
|
|
||||||
bullet->meta = weapon->meta;
|
|
||||||
#endif
|
|
||||||
bullet->pos = pos;
|
bullet->pos = pos;
|
||||||
bullet->dir = dir;
|
bullet->dir = dir;
|
||||||
bullet->born_pos = pos;
|
bullet->born_pos = pos;
|
||||||
|
@ -75,7 +75,7 @@ public:
|
|||||||
|
|
||||||
Hero* CreateHero(Human* hum);
|
Hero* CreateHero(Human* hum);
|
||||||
void CreateLoot(int equip_id, a8::Vec2 pos, int count, int equip_lv);
|
void CreateLoot(int equip_id, a8::Vec2 pos, int count, int equip_lv);
|
||||||
void CreateBullet(Human* hum, Weapon* weapon,
|
void CreateBullet(Human* hum, MetaData::Equip* bullet_meta,
|
||||||
a8::Vec2 pos, a8::Vec2 dir, float fly_distance);
|
a8::Vec2 pos, a8::Vec2 dir, float fly_distance);
|
||||||
|
|
||||||
void OnHumanDie(Human* hum);
|
void OnHumanDie(Human* hum);
|
||||||
|
@ -13,16 +13,11 @@ void Weapon::ToPB(cs::MFWeapon* pb_obj)
|
|||||||
|
|
||||||
void Weapon::Recalc()
|
void Weapon::Recalc()
|
||||||
{
|
{
|
||||||
upgrade_meta = MetaMgr::Instance()->GetEquipUpgrade(weapon_id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int Weapon::GetClipVolume()
|
int Weapon::GetClipVolume()
|
||||||
{
|
{
|
||||||
if (upgrade_meta) {
|
return meta->i->clip_volume();
|
||||||
return meta->i->clip_volume() + upgrade_meta->GetAttrValue(weapon_lv, EA_Volume);
|
|
||||||
} else {
|
|
||||||
return meta->i->clip_volume();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Skin::ToPB(cs::MFSkin* pb_obj)
|
void Skin::ToPB(cs::MFSkin* pb_obj)
|
||||||
|
@ -18,7 +18,6 @@ namespace MetaData
|
|||||||
{
|
{
|
||||||
struct SafeArea;
|
struct SafeArea;
|
||||||
struct Equip;
|
struct Equip;
|
||||||
struct EquipUpgrade;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace cs
|
namespace cs
|
||||||
@ -50,7 +49,6 @@ struct Weapon
|
|||||||
int weapon_lv = 0;
|
int weapon_lv = 0;
|
||||||
int ammo = 0;
|
int ammo = 0;
|
||||||
MetaData::Equip* meta = nullptr;
|
MetaData::Equip* meta = nullptr;
|
||||||
MetaData::EquipUpgrade* upgrade_meta = nullptr;
|
|
||||||
|
|
||||||
void ToPB(cs::MFWeapon* pb_obj);
|
void ToPB(cs::MFWeapon* pb_obj);
|
||||||
void Recalc();
|
void Recalc();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user