完成一级一阶数值
This commit is contained in:
parent
2d69a6a1ec
commit
7e1b020510
@ -46,6 +46,8 @@ void Android::Initialize()
|
||||
);
|
||||
GetBattleContext()->Init(this);
|
||||
}
|
||||
SetHP(GetBattleContext()->GetMaxHP());
|
||||
SetMaxHP(GetHP());
|
||||
}
|
||||
|
||||
void Android::Update(int delta_time)
|
||||
|
@ -17,6 +17,11 @@ public:
|
||||
long long hero_uniid_ = 0;
|
||||
MetaData::Player* hero_meta = nullptr;
|
||||
|
||||
float GetHP()
|
||||
{
|
||||
return hero_meta->i->hp();
|
||||
}
|
||||
|
||||
float GetAtk()
|
||||
{
|
||||
return hero_meta->i->damage();
|
||||
@ -255,7 +260,8 @@ float BattleDataContext::CalcDmg(Obstacle* target, Bullet* bullet)
|
||||
|
||||
float BattleDataContext::CalcDmg(Explosion* e)
|
||||
{
|
||||
|
||||
float finaly_dmg = (1 - GetDef() / 1000) / 2 * 100;
|
||||
return finaly_dmg;
|
||||
}
|
||||
|
||||
float BattleDataContext::GetTotalAtk(Bullet* bullet)
|
||||
@ -264,6 +270,16 @@ float BattleDataContext::GetTotalAtk(Bullet* bullet)
|
||||
return total_atk;
|
||||
}
|
||||
|
||||
float BattleDataContext::GetHP()
|
||||
{
|
||||
return hero_ability_->GetHP();
|
||||
}
|
||||
|
||||
float BattleDataContext::GetMaxHP()
|
||||
{
|
||||
return hero_ability_->GetHP();
|
||||
}
|
||||
|
||||
float BattleDataContext::GetDef()
|
||||
{
|
||||
return def_;
|
||||
|
@ -53,6 +53,8 @@ struct BattleDataContext
|
||||
float CalcDmg(Obstacle* target, Bullet* bullet);
|
||||
float CalcDmg(Explosion* e);
|
||||
|
||||
float GetHP();
|
||||
float GetMaxHP();
|
||||
float GetDef();
|
||||
|
||||
void ForceInit(long long hero_uniid,
|
||||
|
@ -48,9 +48,6 @@ void Car::Initialize()
|
||||
SetCurrWeapon(&weapon);
|
||||
}
|
||||
born_frameno_ = room->GetFrameNo();
|
||||
SetDef(hero_meta_->i->def());
|
||||
SetHP(hero_meta_->i->health());
|
||||
SetMaxHP(std::max(GetHP(), GetMaxHP()));
|
||||
TryAddBuff(this, meta->car_deactive_buff_id);
|
||||
cur_oil_ = meta->i->max_oil();
|
||||
{
|
||||
@ -67,6 +64,8 @@ void Car::Initialize()
|
||||
);
|
||||
GetBattleContext()->Init(this);
|
||||
}
|
||||
SetHP(GetBattleContext()->GetMaxHP());
|
||||
SetMaxHP(std::max(GetHP(), GetMaxHP()));
|
||||
}
|
||||
|
||||
void Car::FillMFObjectPart(Room* room, Human* hum, cs::MFObjectPart* part_data)
|
||||
|
@ -2447,16 +2447,6 @@ float Creature::GetMaxHP()
|
||||
GetAbility()->GetAttrAbs(kHAT_MaxHp);
|
||||
}
|
||||
|
||||
float Creature::GetDef()
|
||||
{
|
||||
return ability.def;
|
||||
}
|
||||
|
||||
void Creature::SetDef(float def)
|
||||
{
|
||||
ability.def = def;
|
||||
}
|
||||
|
||||
void Creature::GetHitEnemys(std::set<Creature*>& enemys, float radius)
|
||||
{
|
||||
float min_distance = 9999999999;
|
||||
|
@ -47,9 +47,6 @@ struct HumanAbility
|
||||
{
|
||||
float hp = 0.0f;
|
||||
float max_hp = 0.0f;
|
||||
float hp_recover = 0.0f;
|
||||
float atk = 0.0f;
|
||||
float def = 0.0f;
|
||||
float speed = 0.0f;
|
||||
|
||||
float shot_range = 0.0f;
|
||||
@ -234,8 +231,6 @@ class Creature : public MoveableEntity
|
||||
void ClearAimingBuffs();
|
||||
float GetHP();
|
||||
float GetMaxHP();
|
||||
float GetDef();
|
||||
void SetDef(float def);
|
||||
void GetHitEnemys(std::set<Creature*>& enemys, float radius);
|
||||
bool TryMove(const a8::Vec2& target_pos, a8::Vec2& out_pos);
|
||||
void SetInfiniteBulletMode();
|
||||
|
@ -34,8 +34,6 @@ void Hero::Initialize()
|
||||
{
|
||||
Creature::Initialize();
|
||||
RecalcSelfCollider();
|
||||
SetHP(meta->i->health());
|
||||
SetMaxHP(GetHP());
|
||||
MetaData::Equip* weapon_meta = MetaMgr::Instance()->GetEquip(meta->i->default_weapon());
|
||||
if (weapon_meta) {
|
||||
Weapon& weapon = weapons[GUN_SLOT1];
|
||||
@ -63,6 +61,8 @@ void Hero::Initialize()
|
||||
);
|
||||
GetBattleContext()->Init(this);
|
||||
}
|
||||
SetHP(GetBattleContext()->GetMaxHP());
|
||||
SetMaxHP(GetHP());
|
||||
}
|
||||
|
||||
void Hero::FillMFObjectPart(Room* room, Human* hum, cs::MFObjectPart* part_data)
|
||||
|
@ -342,7 +342,7 @@ void Human::Initialize()
|
||||
RecalcSelfCollider();
|
||||
volume_ = meta->volume;
|
||||
observers_.insert(this);
|
||||
SetHP(meta->i->health());
|
||||
#if 0
|
||||
for (auto& weapon : spec_weapons) {
|
||||
if (weapon.meta) {
|
||||
float hp = GetHP();
|
||||
@ -350,7 +350,7 @@ void Human::Initialize()
|
||||
SetHP(hp);
|
||||
}
|
||||
}
|
||||
SetMaxHP(GetHP());
|
||||
#endif
|
||||
SetCurrWeapon(&weapons[0]);
|
||||
SetOxygen(MetaMgr::Instance()->dive_oxygen_total);
|
||||
}
|
||||
@ -1654,6 +1654,8 @@ void Human::RecalcVolume()
|
||||
|
||||
void Human::RecalcBaseAttr()
|
||||
{
|
||||
#if 0
|
||||
xxxxxxxx
|
||||
MetaData::Equip* chest_meta = MetaMgr::Instance()->GetEquip(chest);
|
||||
float def = meta->i->def();
|
||||
if (chest_meta) {
|
||||
@ -1664,8 +1666,6 @@ void Human::RecalcBaseAttr()
|
||||
def += helmet_meta->i->def();
|
||||
}
|
||||
SetDef(def);
|
||||
#if 0
|
||||
SetMaxHP(std::max(GetHP(), GetMaxHP()));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -4090,6 +4090,8 @@ void Room::AddTeam(class MatchTeam* team)
|
||||
hum->ProcPrepareItems(msg.prepare_items());
|
||||
hum->ProcPrepareItems2(msg.prepare_items2());
|
||||
hum->ProcSkillList(msg.skill_list());
|
||||
hum->SetHP(hum->GetBattleContext()->GetMaxHP());
|
||||
hum->SetMaxHP(hum->GetHP());
|
||||
PlayerMgr::Instance()->IncAccountNum(msg.account_id());
|
||||
new_team->AddMember(hum);
|
||||
}
|
||||
|
@ -206,6 +206,8 @@ void RoomMgr::_CMJoin(f8::MsgHdr& hdr, const cs::CMJoin& msg)
|
||||
hum->ProcPrepareItems(msg.prepare_items());
|
||||
hum->ProcPrepareItems2(msg.prepare_items2());
|
||||
hum->ProcSkillList(msg.skill_list());
|
||||
hum->SetHP(hum->GetBattleContext()->GetMaxHP());
|
||||
hum->SetMaxHP(hum->GetHP());
|
||||
PlayerMgr::Instance()->IncAccountNum(msg.account_id());
|
||||
if (JsonDataMgr::Instance()->channel != 0 &&
|
||||
JsonDataMgr::Instance()->channel != channel) {
|
||||
|
@ -206,7 +206,6 @@ message Player
|
||||
optional float move_offset_x = 40;
|
||||
optional float move_offset_y = 41;
|
||||
optional float radius = 2; //半径
|
||||
optional int32 health = 3; //初始血量
|
||||
optional int32 move_speed = 4; //移动速度
|
||||
optional int32 jump_speed = 5; //跳伞速度
|
||||
optional int32 move_speed3 = 6;
|
||||
@ -215,7 +214,6 @@ message Player
|
||||
optional int32 move_speed4 = 10; //移动速度4
|
||||
optional int32 reload_speed = 9;
|
||||
optional int32 useitem_speed = 49;
|
||||
optional float def = 11; //防御
|
||||
optional string volume = 12; //初始库存
|
||||
optional int32 level = 13;
|
||||
optional int32 race = 14;
|
||||
|
Loading…
x
Reference in New Issue
Block a user