This commit is contained in:
aozhiwei 2023-03-10 18:07:58 +08:00
parent cb5587340c
commit f87e733b56
4 changed files with 35 additions and 33 deletions

View File

@ -15,7 +15,7 @@ set(LIB_DIR "ubuntu20.04_g++-9")
message(LIB_DIR: ${LIB_DIR} )
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall -g -std=gnu++1z -DGAME_ID=${GAME_ID} -DNDEBUG -DMAP3D -DDT_VIRTUAL_QUERYFILTER -DNEW_WEAPON_SYS=1")
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g -std=gnu++1z -DGAME_ID=${GAME_ID} -DDEBUG -DCXY -DSXY -DMAP3D -DDT_VIRTUAL_QUERYFILTER -DNEW_WEAPON_SYS=1")
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g -std=gnu++1z -DGAME_ID=${GAME_ID} -DDEBUG -DCXY -DSXY -DMAP3D -DDT_VIRTUAL_QUERYFILTER -DNEW_WEAPON_SYS=1 -fsanitize=address -fno-omit-frame-pointer")
include_directories(
AFTER

View File

@ -3498,7 +3498,7 @@ void Human::SyncVolume(int slot_id)
[this, i] (int event, const a8::Args* args)
{
if (a8::TIMER_EXEC_EVENT == event) {
room->frame_event.AddPropChgEx(GetWeakPtrRef(), kPropVolume, i, GetInventory(i), 0, volume_[i], true);
room->frame_event.AddPropChgEx(GetWeakPtrRef(), kPropVolume, i, GetInventory(i), volume_[i], 0, true);
}
},
&xtimer_attacher);

View File

@ -1446,29 +1446,31 @@ void Player::ProcPreSettlementInfo(const std::string& pre_settlement_info)
void Player::UpdateAiming()
{
if (aiming) {
if (aiming_frameno == 0) {
aiming_frameno = room->GetFrameNo();
power_idx = -1;
}
if (HasBuffEffect(kBET_Camouflage) && camouflage_aiming_addition_ <= 0) {
RemoveBuffByEffectId(kBET_Camouflage);
}
Weapon* p_weapon = GetCurrWeapon();
if (second_weapon.meta) {
p_weapon = &second_weapon;
}
if (!p_weapon->meta->_power_charge.empty()) {
if (power_idx + 1 > p_weapon->meta->_power_charge.size()) {
A8_ABORT();
} else if (power_idx + 1 == p_weapon->meta->_power_charge.size()) {
} else {
long long passed_time = (room->GetFrameNo() - aiming_frameno) * FRAME_RATE_MS;
if (passed_time >= std::get<0>(p_weapon->meta->_power_charge[power_idx + 1])) {
++power_idx;
ClearAimingBuffs();
int buff_id = std::get<2>(p_weapon->meta->_power_charge[power_idx]);
MustBeAddBuff(this, buff_id);
aiming_buffs.push_back(buff_id);
if (!HasBuffEffect(kBET_HoldShield)) {
if (aiming_frameno == 0) {
aiming_frameno = room->GetFrameNo();
power_idx = -1;
}
if (HasBuffEffect(kBET_Camouflage) && camouflage_aiming_addition_ <= 0) {
RemoveBuffByEffectId(kBET_Camouflage);
}
Weapon* p_weapon = GetCurrWeapon();
if (second_weapon.meta) {
p_weapon = &second_weapon;
}
if (!p_weapon->meta->_power_charge.empty()) {
if (power_idx + 1 > p_weapon->meta->_power_charge.size()) {
A8_ABORT();
} else if (power_idx + 1 == p_weapon->meta->_power_charge.size()) {
} else {
long long passed_time = (room->GetFrameNo() - aiming_frameno) * FRAME_RATE_MS;
if (passed_time >= std::get<0>(p_weapon->meta->_power_charge[power_idx + 1])) {
++power_idx;
ClearAimingBuffs();
int buff_id = std::get<2>(p_weapon->meta->_power_charge[power_idx]);
MustBeAddBuff(this, buff_id);
aiming_buffs.push_back(buff_id);
}
}
}
}

View File

@ -182,14 +182,6 @@ void Skill::AddMinorMode(
[this] (int event, const a8::Args* args)
{
if (a8::TIMER_EXEC_EVENT == event) {
} else if (a8::TIMER_DELETE_EVENT == event) {
minor_type_ = SMT_NONE;
minor_cd_time_ = 0;
minor_frameno_ = 0;
if (minor_cb_) {
minor_cb_(0);
}
minor_cb_ = nullptr;
ResetSkillCd();
if (owner->IsHuman()) {
Human* hum = owner->AsHuman();
@ -205,6 +197,14 @@ void Skill::AddMinorMode(
);
NotifySkillState();
}
} else if (a8::TIMER_DELETE_EVENT == event) {
minor_type_ = SMT_NONE;
minor_cd_time_ = 0;
minor_frameno_ = 0;
if (minor_cb_) {
minor_cb_(0);
}
minor_cb_ = nullptr;
}
},
&xtimer_attacher);