技能加速

This commit is contained in:
aozhiwei 2019-05-08 16:35:40 +08:00
parent 2e7e015c6a
commit 59b0d13618
3 changed files with 13 additions and 0 deletions

View File

@ -719,6 +719,7 @@ void Human::DoSkill()
{
accelerate_frameno_ = room->frame_no;
a8::SetBitFlag(status, HS_Accelerate);
buff.speed += skill_meta->i->value1();
room->xtimer.AddDeadLineTimerAndAttach(skill_meta->i->last_time() * SERVER_FRAME_RATE,
a8::XParams()
.SetSender(this),
@ -730,6 +731,7 @@ void Human::DoSkill()
{
Human* hum = (Human*)param.sender.GetUserData();
a8::UnSetBitFlag(hum->status, HS_Accelerate);
hum->buff.speed = 0.0f;
hum->need_sync_active_player = true;
hum->BroadcastFullState();
}
@ -1114,6 +1116,14 @@ void Human::RecalcVolume()
}
}
void Human::RecalcBuff()
{
buff = HumanAbility();
if (skin_meta) {
}
}
int Human::GetInventory(int slot_id)
{
if (!IsValidSlotId(slot_id)) {

View File

@ -150,6 +150,7 @@ class Human : public Entity
bool CanSee(const Human* hum) const;
void RecalcAttr();
void RecalcVolume();
void RecalcBuff();
int GetInventory(int slot_id);
void AddInventory(int slot_id, int num);
void DecInventory(int slot_id, int num);

View File

@ -34,6 +34,7 @@ void Player::Initialize()
} else {
skill_meta = nullptr;
}
RecalcBuff();
}
void Player::Update(int delta_time)
@ -672,6 +673,7 @@ void Player::LootInteraction(Loot* entity)
} else {
skill_meta = nullptr;
}
RecalcBuff();
SyncAroundPlayers();
}
break;