merge dev2

This commit is contained in:
aozhiwei 2020-05-27 20:59:28 +08:00
commit 507372a550
4 changed files with 32 additions and 2 deletions

View File

@ -61,6 +61,9 @@ void Bullet::OnHit(std::set<Entity*>& objects)
float finaly_dmg = dmg * (1 - def/MetaMgr::Instance()->K);
player->stats.damage_amount_out += finaly_dmg;
hum->DecHP(finaly_dmg, player->entity_uniid, player->name, gun_meta->i->id());
#ifdef DEBUG
player->SendDebugMsg(a8::Format("bullet atk:%f", {GetAtk()}));
#endif
}
}
break;
@ -84,6 +87,9 @@ void Bullet::OnHit(std::set<Entity*>& objects)
player->DropItems(obstacle);
}
obstacle->BroadcastFullState(room);
#ifdef DEBUG
player->SendDebugMsg(a8::Format("bullet atk:%f", {GetAtk()}));
#endif
}
}
break;

View File

@ -2185,12 +2185,12 @@ void Human::GenBattleReportData(a8::MutableXObject* params)
{
std::string items_str;
MetaData::RankReward* rank_reward_meta = MetaMgr::Instance()->GetRankReward(rank);
#ifdef DEBUG
#ifdef DEBUG1
{
#else
if (rank_reward_meta && rank_reward_meta->i->drop() > 0) {
#endif
#ifdef DEBUG
#ifdef DEBUG1
{
#else
if (rand() % 100 < rank_reward_meta->i->drop()) {

View File

@ -456,6 +456,7 @@ private:
for (auto& meta : equipupgrade_meta_list) {
MetaData::EquipUpgrade& item = a8::FastAppend(equipupgrade_list);
item.i = &meta;
item.Init();
equipupgrade_hash[meta.id()] = &item;
}

View File

@ -221,6 +221,29 @@ void Room::AddPlayer(Player* hum)
RandRemoveAndroid();
}
NotifyUiUpdate();
#ifdef DEBUG
xtimer.AddRepeatTimerAndAttach
(SERVER_FRAME_RATE * 5,
a8::XParams()
.SetSender(hum),
[] (const a8::XParams& param)
{
Human* hum = (Human*)param.sender.GetUserData();
std::string debugmsg = a8::Format("weapon_id:%d weapon_lv:%d atk:%f fire_rate:%f "
"volume:%d maxhp:%f curr_hp:%f",
{
hum->curr_weapon->weapon_id,
hum->curr_weapon->weapon_lv,
hum->curr_weapon->GetAttrValue(kHAT_Atk),
hum->curr_weapon->GetAttrValue(kHAT_FireRate),
hum->curr_weapon->GetAttrValue(kHAT_Volume),
hum->curr_weapon->GetAttrValue(kHAT_MaxHp),
hum->GetHP()
});
hum->SendDebugMsg(debugmsg);
},
&hum->xtimer_attacher.timer_list_);
#endif
}
int Room::AllocUniid()