This commit is contained in:
aozhiwei 2023-10-26 15:47:01 +08:00
parent 2bd04c0374
commit e28fc373ba
3 changed files with 48 additions and 0 deletions

View File

@ -981,6 +981,11 @@ void Creature::DoSkill(int skill_id,
context_dir = skill_dir_;
context_pos = GetPos();
context_pos.AddGlmVec3(skill_dir_ * skill_distance_);
#ifdef DEBUG
if (IsPlayer()) {
a8::XPrintf("skill-distance:%f\n", {skill_distance_});
}
#endif
CurrentSkill()->last_use_frameno = room->GetFrameNo();
skill->LockCastPhase();
if (CurrentSkill()->meta->skill_target() == kST_Self
@ -3558,3 +3563,8 @@ void Creature::SetLastAttacker(CreatureWeakPtr attacker)
last_attacker_revive_times_ = attacker.Get()->revive_count;
last_beattack_frameno_ = room->GetFrameNo();
}
void Creature::ActivateTargetValidPos()
{
}

View File

@ -106,6 +106,8 @@ class Creature : public MoveableEntity
Weapon second_weapon;
glm::vec3 skill_pos;
Position context_pos;
bool target_valid_pos_activated = false;
glm::vec3 target_valid_pos = GlmHelper::ZERO;
glm::vec3 context_real_pos = GlmHelper::ZERO;
glm::vec3 context_dir = GlmHelper::ZERO;
std::shared_ptr<Ability> context_ability;
@ -378,6 +380,7 @@ class Creature : public MoveableEntity
CreatureWeakPtr& GetLastAttacker() { return last_attacker_; }
long long GetLastBeAttackFrameNo() { return last_beattack_frameno_; }
int GetLastAttackerReviveTimes() { return last_attacker_revive_times_; }
void ActivateTargetValidPos();
protected:
virtual void OnBuffRemove(Buff& buff);

View File

@ -229,6 +229,41 @@ public:
}
return std::make_shared<a8::lisp::Value>(a8::lisp::Atom(result));
});
RegisterCProc
(
"caster.get_skill_target_valid_pos_x",
[this] (const a8::lisp::List& params) -> std::shared_ptr<a8::lisp::Value>
{
double result = 0.0f;
if (context_.buff->GetCaster().Get()) {
result = context_.buff->GetCaster().Get()->context_pos.GetX();
}
return std::make_shared<a8::lisp::Value>(a8::lisp::Atom(result));
});
RegisterCProc
(
"caster.get_skill_target_valid_pos_y",
[this] (const a8::lisp::List& params) -> std::shared_ptr<a8::lisp::Value>
{
double result = 0.0f;
if (context_.buff->GetCaster().Get()) {
result = context_.buff->GetCaster().Get()->context_pos.GetY();
}
return std::make_shared<a8::lisp::Value>(a8::lisp::Atom(result));
});
RegisterCProc
(
"caster.get_skill_target_valid_pos_z",
[this] (const a8::lisp::List& params) -> std::shared_ptr<a8::lisp::Value>
{
double result = 0.0f;
if (context_.buff->GetCaster().Get()) {
result = context_.buff->GetCaster().Get()->context_pos.GetZ();
}
return std::make_shared<a8::lisp::Value>(a8::lisp::Atom(result));
});
RegisterCProc
(
"caster.get_hero_atk",