This commit is contained in:
aozhiwei 2024-04-11 11:55:18 +08:00
parent 96982ddc44
commit 0e0a8032cd
5 changed files with 42 additions and 7 deletions

View File

@ -949,10 +949,20 @@ void Creature::DoSkill(int skill_id,
}
#endif
if (room->HasRoomSwitch(kRoomSwitchDisableUseSkill)) {
#ifdef MYDEBUG
if (IsPlayer()) {
a8::XPrintf("DoSkill skill_id:%d 1\n", {skill_id});
}
#endif
return;
}
Skill* skill = GetSkill(skill_id);
if (skill && CanUseSkill(skill_id)) {
#ifdef MYDEBUG
if (IsPlayer()) {
a8::XPrintf("DoSkill skill_id:%d a\n", {skill_id});
}
#endif
#ifdef MYDEBUG
if (IsPlayer()) {
a8::XPrintf("DoSkill minor_type:%d\n", {skill->GetMinorType()});
@ -1063,6 +1073,13 @@ void Creature::DoSkill(int skill_id,
ptr.Attach(this);
room->frame_event.AddPlaySkill(ptr, skill_id);
}
} else {
#ifdef MYDEBUG
if (IsPlayer()) {
CanUseSkill(skill_id);
a8::XPrintf("DoSkill skill_id:%d b\n", {skill_id});
}
#endif
}
}

View File

@ -944,12 +944,16 @@ void Player::_CMMove(f8::MsgHdr* hdr, const cs::CMMove& msg)
}
#endif
#ifdef MYDEBUG1
a8::XPrintf("CMMove.Shot shot_sart:%d shot_hold:%d skill_hold:%d\n",
{
msg.shot_start(),
msg.shot_hold(),
msg.skill_hold()
});
if (msg.skill_id()) {
a8::XPrintf("CMMove.Shot shot_sart:%d shot_hold:%d skill_hold:%d skill_id:%d seq:%d\n",
{
msg.shot_start(),
msg.shot_hold(),
msg.skill_hold(),
msg.skill_id(),
msg.seq()
});
}
#endif
long long pre_frameno = last_cmmove_frameno_;
last_cmmove_frameno_ = room->GetFrameNo();

View File

@ -109,6 +109,19 @@ int Skill::GetMaxTimes()
void Skill::NotifySkillState()
{
if (owner->IsHuman() || owner->IsCar()) {
#ifdef MYDEBUG
if (owner->IsPlayer()) {
a8::XPrintf("last_frameno:%d room.frameno:%d tick_count:%d\n",
{last_sync_frameno,
owner->room->GetFrameNo(),
a8::XGetTickCount()
});
}
#endif
last_sync_frameno = owner->room->GetFrameNo();
if (owner->IsPlayer() && last_sync_frameno > last_use_frameno + 2) {
int i = 0;
}
if (GetCurrTimes() < GetMaxTimes()) {
owner->room->frame_event.AddSkillCdChg(owner->AllocWeakPtr(), GetBaseSkillId(), GetCd());
} else {

View File

@ -25,6 +25,7 @@ class Skill
public:
Creature* owner = nullptr;
long long last_use_frameno = 0;
long long last_sync_frameno = 0;
a8::Attacher xtimer_attacher;
int force_use_times = 0;
glm::vec3 skill_pos = glm::vec3(0.0f, 0.0f, 0.0f);

2
third_party/f8 vendored

@ -1 +1 @@
Subproject commit 78ca6cf82f6d450f02f23827d6ed09e98cca046a
Subproject commit 94df666a7847c8e98f372c2e7da2e2146546daa2