diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index f024e4f..04c5c93 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -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)) { diff --git a/server/gameserver/human.h b/server/gameserver/human.h index 6d2bc77..3133d08 100644 --- a/server/gameserver/human.h +++ b/server/gameserver/human.h @@ -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); diff --git a/server/gameserver/player.cc b/server/gameserver/player.cc index 6f7eea0..7dc8b28 100644 --- a/server/gameserver/player.cc +++ b/server/gameserver/player.cc @@ -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;