1
This commit is contained in:
parent
5350b1312d
commit
27c42cf76b
@ -29,6 +29,7 @@
|
||||
#include "stats.h"
|
||||
#include "movement.h"
|
||||
#include "hero.h"
|
||||
#include "skill.h"
|
||||
|
||||
#include "mt/Param.h"
|
||||
#include "mt/Equip.h"
|
||||
@ -1090,3 +1091,14 @@ void Bullet::ProcRequestBulletDmg(int shield_hit, int strength_wall_uniid, int t
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const mt::Skill* Bullet::GetSkillMeta()
|
||||
{
|
||||
if (sender.Get() && skill_meta) {
|
||||
Skill* skill = sender.Get()->GetSkill(skill_meta->skill_id());
|
||||
if (skill) {
|
||||
return skill->GetCurrSkillMeta();
|
||||
}
|
||||
}
|
||||
return skill_meta;
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ class Bullet : public MoveableEntity, public IBullet
|
||||
virtual const glm::vec3& GetDir() override { return dir; };
|
||||
virtual float GetStrengthenWall() override { return strengthen_wall; };
|
||||
virtual long long GetWeaponUniId() override { return weapon_uniid; };
|
||||
virtual const mt::Skill* GetSkillMeta() override {return skill_meta; };
|
||||
virtual const mt::Skill* GetSkillMeta() override;
|
||||
virtual const mt::Equip* GetGunMeta() override { return gun_meta; };
|
||||
virtual const mt::Equip* GetBulletMeta() override { return meta; };
|
||||
virtual CreatureWeakPtr GetSender() override { return sender; };
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include "creature.h"
|
||||
#include "glmhelper.h"
|
||||
#include "room.h"
|
||||
#include "skill.h"
|
||||
|
||||
#include "mt/Skill.h"
|
||||
#include "mt/SkillNumber.h"
|
||||
@ -27,7 +28,16 @@ public:
|
||||
}
|
||||
a8::lisp::Atom atom = std::any_cast<a8::lisp::Atom>(params->at(0)->value);
|
||||
int idx = atom.val;
|
||||
if (context_.buff->GetCaster().Get()) {
|
||||
Skill* skill = context_.buff->GetCaster().Get()->GetSkill(context_.buff->skill_meta->skill_id());
|
||||
if (skill) {
|
||||
result = skill->GetCurrSkillMeta()->_number_meta->GetAttrByIdx(idx);
|
||||
} else {
|
||||
result = context_.buff->skill_meta->_number_meta->GetAttrByIdx(idx);
|
||||
}
|
||||
} else {
|
||||
result = context_.buff->skill_meta->_number_meta->GetAttrByIdx(idx);
|
||||
}
|
||||
return std::make_shared<a8::lisp::Value>(a8::lisp::Atom(result));
|
||||
});
|
||||
RegisterCProc
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "human.h"
|
||||
#include "stats.h"
|
||||
#include "hero.h"
|
||||
#include "skill.h"
|
||||
|
||||
#include "mt/Param.h"
|
||||
#include "mt/Buff.h"
|
||||
@ -30,6 +31,12 @@ long long VirtualBullet::GetWeaponUniId()
|
||||
|
||||
const mt::Skill* VirtualBullet::GetSkillMeta()
|
||||
{
|
||||
if (sender.Get() && skill_meta) {
|
||||
Skill* skill = sender.Get()->GetSkill(skill_meta->skill_id());
|
||||
if (skill) {
|
||||
return skill->GetCurrSkillMeta();
|
||||
}
|
||||
}
|
||||
return skill_meta;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user