1
This commit is contained in:
parent
7d6a3d15e8
commit
eb337405de
@ -64,6 +64,7 @@ void Bullet::OnHit(std::set<Entity*>& objects)
|
|||||||
float def = hum->ability.def + hum->ability.def_add;
|
float def = hum->ability.def + hum->ability.def_add;
|
||||||
float finaly_dmg = dmg * (1 - def/MetaMgr::Instance()->K);
|
float finaly_dmg = dmg * (1 - def/MetaMgr::Instance()->K);
|
||||||
player->stats.damage_amount_out += finaly_dmg;
|
player->stats.damage_amount_out += finaly_dmg;
|
||||||
|
hum->OnHit();
|
||||||
if (!hum->HasBuffEffect(BET_Invincible)) {
|
if (!hum->HasBuffEffect(BET_Invincible)) {
|
||||||
hum->DecHP(finaly_dmg, player->entity_uniid, player->name, meta->i->id());
|
hum->DecHP(finaly_dmg, player->entity_uniid, player->name, meta->i->id());
|
||||||
}
|
}
|
||||||
@ -204,6 +205,7 @@ void Bullet::PostAttack()
|
|||||||
for (auto& grid : grid_list) {
|
for (auto& grid : grid_list) {
|
||||||
for (Human* hum: grid->human_list) {
|
for (Human* hum: grid->human_list) {
|
||||||
if (hum->pos.Distance(obstacle->pos) < obstacle->meta->i->damage_dia()) {
|
if (hum->pos.Distance(obstacle->pos) < obstacle->meta->i->damage_dia()) {
|
||||||
|
hum->OnHit();
|
||||||
if (!hum->HasBuffEffect(BET_Invincible)) {
|
if (!hum->HasBuffEffect(BET_Invincible)) {
|
||||||
hum->DecHP(obstacle->meta->i->damage(), sender->entity_uniid, sender->name, 0);
|
hum->DecHP(obstacle->meta->i->damage(), sender->entity_uniid, sender->name, 0);
|
||||||
}
|
}
|
||||||
@ -246,6 +248,7 @@ void Bullet::ProcMissible(const a8::XParams& param)
|
|||||||
if (target && !target->dead) {
|
if (target && !target->dead) {
|
||||||
if (bullet_meta->i->equip_subtype() == BulletType_Trace) {
|
if (bullet_meta->i->equip_subtype() == BulletType_Trace) {
|
||||||
if (src_pos.Distance(target->pos) < bullet_meta->i->range()) {
|
if (src_pos.Distance(target->pos) < bullet_meta->i->range()) {
|
||||||
|
target->OnHit();
|
||||||
if (!target->HasBuffEffect(BET_Invincible)) {
|
if (!target->HasBuffEffect(BET_Invincible)) {
|
||||||
target->DecHP(bullet_meta->i->atk(),
|
target->DecHP(bullet_meta->i->atk(),
|
||||||
sender->entity_uniid,
|
sender->entity_uniid,
|
||||||
@ -255,6 +258,7 @@ void Bullet::ProcMissible(const a8::XParams& param)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
target->OnHit();
|
||||||
if (!target->HasBuffEffect(BET_Invincible)) {
|
if (!target->HasBuffEffect(BET_Invincible)) {
|
||||||
target->DecHP(bullet_meta->i->atk(),
|
target->DecHP(bullet_meta->i->atk(),
|
||||||
sender->entity_uniid,
|
sender->entity_uniid,
|
||||||
|
@ -1397,6 +1397,11 @@ void Human::OnAttack()
|
|||||||
GrassTempShow();
|
GrassTempShow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Human::OnHit()
|
||||||
|
{
|
||||||
|
GrassTempShow();
|
||||||
|
}
|
||||||
|
|
||||||
void Human::OnEnterGrass()
|
void Human::OnEnterGrass()
|
||||||
{
|
{
|
||||||
if (a8::HasBitFlag(status, HS_InGrass)) {
|
if (a8::HasBitFlag(status, HS_InGrass)) {
|
||||||
|
@ -199,6 +199,7 @@ class Human : public Entity
|
|||||||
void RecalcBuffAttr();
|
void RecalcBuffAttr();
|
||||||
void ProcBuffEffect(Buff* buff);
|
void ProcBuffEffect(Buff* buff);
|
||||||
void OnAttack();
|
void OnAttack();
|
||||||
|
void OnHit();
|
||||||
void OnEnterGrass();
|
void OnEnterGrass();
|
||||||
void OnLeaveGrass();
|
void OnLeaveGrass();
|
||||||
void CheckGrass();
|
void CheckGrass();
|
||||||
|
@ -207,6 +207,7 @@ void Obstacle::Explosion()
|
|||||||
float dmg = meta->i->damage();
|
float dmg = meta->i->damage();
|
||||||
float def = hum->ability.def + hum->ability.def_add;
|
float def = hum->ability.def + hum->ability.def_add;
|
||||||
float finaly_dmg = dmg * (1 - def/MetaMgr::Instance()->K);
|
float finaly_dmg = dmg * (1 - def/MetaMgr::Instance()->K);
|
||||||
|
hum->OnHit();
|
||||||
if (!hum->HasBuffEffect(BET_Invincible)) {
|
if (!hum->HasBuffEffect(BET_Invincible)) {
|
||||||
hum->DecHP(finaly_dmg, VP_Mine, "地雷", VW_Mine);
|
hum->DecHP(finaly_dmg, VP_Mine, "地雷", VW_Mine);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user