1
This commit is contained in:
parent
d16aacac63
commit
12642cbf6b
@ -23,6 +23,7 @@ void Bullet::Initialize()
|
|||||||
{
|
{
|
||||||
Entity::Initialize();
|
Entity::Initialize();
|
||||||
RecalcSelfCollider();
|
RecalcSelfCollider();
|
||||||
|
skill_meta = MetaMgr::Instance()->GetSkill(skill_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bullet::Update(int delta_time)
|
void Bullet::Update(int delta_time)
|
||||||
@ -66,6 +67,7 @@ void Bullet::OnHit(std::set<Entity*>& objects)
|
|||||||
master->stats.damage_amount_out += finaly_dmg;
|
master->stats.damage_amount_out += finaly_dmg;
|
||||||
hum->OnHit();
|
hum->OnHit();
|
||||||
if (!hum->HasBuffEffect(BET_Invincible)) {
|
if (!hum->HasBuffEffect(BET_Invincible)) {
|
||||||
|
hum->OnSkillHit(skill_meta);
|
||||||
hum->DecHP(finaly_dmg, master->entity_uniid, master->name, meta->i->id());
|
hum->DecHP(finaly_dmg, master->entity_uniid, master->name, meta->i->id());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -279,3 +281,4 @@ void Bullet::ProcMissible(const a8::XParams& param)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ namespace MetaData
|
|||||||
{
|
{
|
||||||
struct Player;
|
struct Player;
|
||||||
struct Equip;
|
struct Equip;
|
||||||
|
struct Skill;
|
||||||
}
|
}
|
||||||
|
|
||||||
class Human;
|
class Human;
|
||||||
@ -21,6 +22,8 @@ class Bullet : public Entity
|
|||||||
a8::Vec2 born_pos;
|
a8::Vec2 born_pos;
|
||||||
a8::Vec2 born_dir;
|
a8::Vec2 born_dir;
|
||||||
float fly_distance = 0.0f;
|
float fly_distance = 0.0f;
|
||||||
|
int skill_id = 0;
|
||||||
|
MetaData::Skill* skill_meta = nullptr;
|
||||||
|
|
||||||
Bullet();
|
Bullet();
|
||||||
virtual ~Bullet() override;
|
virtual ~Bullet() override;
|
||||||
|
@ -1402,6 +1402,13 @@ void Human::OnHit()
|
|||||||
GrassTempShow();
|
GrassTempShow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Human::OnSkillHit(MetaData::Skill* skill_meta)
|
||||||
|
{
|
||||||
|
std::set<Entity*> target_list;
|
||||||
|
target_list.insert(this);
|
||||||
|
TriggerBuff(target_list, BTT_SkillHit);
|
||||||
|
}
|
||||||
|
|
||||||
void Human::OnEnterGrass()
|
void Human::OnEnterGrass()
|
||||||
{
|
{
|
||||||
if (a8::HasBitFlag(status, HS_InGrass)) {
|
if (a8::HasBitFlag(status, HS_InGrass)) {
|
||||||
@ -2024,7 +2031,7 @@ void Human::InternalShot(MetaData::Equip* bullet_meta, int skill_id, size_t offs
|
|||||||
}
|
}
|
||||||
if (room->BattleStarted()) {
|
if (room->BattleStarted()) {
|
||||||
if (bullet_meta->i->equip_subtype() != BulletType_Missile) {
|
if (bullet_meta->i->equip_subtype() != BulletType_Missile) {
|
||||||
room->CreateBullet(this, bullet_meta, bullet_born_pos, bullet_dir, fly_distance);
|
room->CreateBullet(this, bullet_meta, bullet_born_pos, bullet_dir, fly_distance, skill_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -200,6 +200,7 @@ class Human : public Entity
|
|||||||
void ProcBuffEffect(Buff* buff);
|
void ProcBuffEffect(Buff* buff);
|
||||||
void OnAttack();
|
void OnAttack();
|
||||||
void OnHit();
|
void OnHit();
|
||||||
|
void OnSkillHit(MetaData::Skill* skill_meta);
|
||||||
void OnEnterGrass();
|
void OnEnterGrass();
|
||||||
void OnLeaveGrass();
|
void OnLeaveGrass();
|
||||||
void CheckGrass();
|
void CheckGrass();
|
||||||
|
@ -553,7 +553,7 @@ void Room::CreateLoot(int equip_id, a8::Vec2 pos, int count, int equip_lv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Room::CreateBullet(Human* hum, MetaData::Equip* bullet_meta,
|
void Room::CreateBullet(Human* hum, MetaData::Equip* bullet_meta,
|
||||||
a8::Vec2 pos, a8::Vec2 dir, float fly_distance)
|
a8::Vec2 pos, a8::Vec2 dir, float fly_distance, int skill_id)
|
||||||
{
|
{
|
||||||
Bullet* bullet = new Bullet();
|
Bullet* bullet = new Bullet();
|
||||||
bullet->master = hum;
|
bullet->master = hum;
|
||||||
@ -564,6 +564,7 @@ void Room::CreateBullet(Human* hum, MetaData::Equip* bullet_meta,
|
|||||||
bullet->born_pos = pos;
|
bullet->born_pos = pos;
|
||||||
bullet->born_dir = dir;
|
bullet->born_dir = dir;
|
||||||
bullet->fly_distance = fly_distance;
|
bullet->fly_distance = fly_distance;
|
||||||
|
bullet->skill_id = skill_id;
|
||||||
bullet->entity_uniid = AllocUniid();
|
bullet->entity_uniid = AllocUniid();
|
||||||
bullet->Initialize();
|
bullet->Initialize();
|
||||||
AddObjectLater(bullet);
|
AddObjectLater(bullet);
|
||||||
|
@ -79,7 +79,7 @@ public:
|
|||||||
Hero* CreateHero(Human* hum);
|
Hero* CreateHero(Human* hum);
|
||||||
void CreateLoot(int equip_id, a8::Vec2 pos, int count, int equip_lv);
|
void CreateLoot(int equip_id, a8::Vec2 pos, int count, int equip_lv);
|
||||||
void CreateBullet(Human* hum, MetaData::Equip* bullet_meta,
|
void CreateBullet(Human* hum, MetaData::Equip* bullet_meta,
|
||||||
a8::Vec2 pos, a8::Vec2 dir, float fly_distance);
|
a8::Vec2 pos, a8::Vec2 dir, float fly_distance, int skill_id);
|
||||||
|
|
||||||
void OnHumanDie(Human* hum);
|
void OnHumanDie(Human* hum);
|
||||||
void OnHumanRevive(Human* hum);
|
void OnHumanRevive(Human* hum);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user