1
This commit is contained in:
parent
2bd04c0374
commit
e28fc373ba
@ -981,6 +981,11 @@ void Creature::DoSkill(int skill_id,
|
|||||||
context_dir = skill_dir_;
|
context_dir = skill_dir_;
|
||||||
context_pos = GetPos();
|
context_pos = GetPos();
|
||||||
context_pos.AddGlmVec3(skill_dir_ * skill_distance_);
|
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();
|
CurrentSkill()->last_use_frameno = room->GetFrameNo();
|
||||||
skill->LockCastPhase();
|
skill->LockCastPhase();
|
||||||
if (CurrentSkill()->meta->skill_target() == kST_Self
|
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_attacker_revive_times_ = attacker.Get()->revive_count;
|
||||||
last_beattack_frameno_ = room->GetFrameNo();
|
last_beattack_frameno_ = room->GetFrameNo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Creature::ActivateTargetValidPos()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -106,6 +106,8 @@ class Creature : public MoveableEntity
|
|||||||
Weapon second_weapon;
|
Weapon second_weapon;
|
||||||
glm::vec3 skill_pos;
|
glm::vec3 skill_pos;
|
||||||
Position context_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_real_pos = GlmHelper::ZERO;
|
||||||
glm::vec3 context_dir = GlmHelper::ZERO;
|
glm::vec3 context_dir = GlmHelper::ZERO;
|
||||||
std::shared_ptr<Ability> context_ability;
|
std::shared_ptr<Ability> context_ability;
|
||||||
@ -378,6 +380,7 @@ class Creature : public MoveableEntity
|
|||||||
CreatureWeakPtr& GetLastAttacker() { return last_attacker_; }
|
CreatureWeakPtr& GetLastAttacker() { return last_attacker_; }
|
||||||
long long GetLastBeAttackFrameNo() { return last_beattack_frameno_; }
|
long long GetLastBeAttackFrameNo() { return last_beattack_frameno_; }
|
||||||
int GetLastAttackerReviveTimes() { return last_attacker_revive_times_; }
|
int GetLastAttackerReviveTimes() { return last_attacker_revive_times_; }
|
||||||
|
void ActivateTargetValidPos();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void OnBuffRemove(Buff& buff);
|
virtual void OnBuffRemove(Buff& buff);
|
||||||
|
@ -229,6 +229,41 @@ public:
|
|||||||
}
|
}
|
||||||
return std::make_shared<a8::lisp::Value>(a8::lisp::Atom(result));
|
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
|
RegisterCProc
|
||||||
(
|
(
|
||||||
"caster.get_hero_atk",
|
"caster.get_hero_atk",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user