This commit is contained in:
aozhiwei 2019-07-15 13:23:42 +08:00
parent b8362a8754
commit 855d90204f
3 changed files with 32 additions and 36 deletions

View File

@ -64,16 +64,10 @@ void Bullet::OnHit(std::set<Entity*>& objects)
float def = hum->def + hum->ability.def_add;
float finaly_dmg = dmg * (1 - def/MetaMgr::Instance()->K);
player->stats.damage_amount_out += finaly_dmg;
if (!hum->HasBuffEffect(BET_Invincible)) {
hum->DecHP(finaly_dmg, player->entity_uniid, player->name, meta->i->id());
#if 0
if (a8::HasBitFlag(hum->status, HS_ReflectDamage) && hum->skill_meta) {
float reflect_dmg = finaly_dmg * hum->skill_meta->value1;
if (reflect_dmg > 1.0f) {
player->DecHP(reflect_dmg, hum->entity_uniid, hum->name, gun_meta->i->id());
}
}
#endif
}
}
break;
case ET_Obstacle:
@ -206,10 +200,12 @@ void Bullet::PostAttack()
for (auto& grid : grid_list) {
for (Human* hum: grid->human_list) {
if (hum->pos.Distance(obstacle->pos) < obstacle->meta->i->damage_dia()) {
if (!hum->HasBuffEffect(BET_Invincible)) {
hum->DecHP(obstacle->meta->i->damage(), sender->entity_uniid, sender->name, 0);
}
}
}
}
};
if (meta->i->equip_subtype() == BulletType_FireBomb) {

View File

@ -1921,7 +1921,9 @@ void Human::ProcSkillPhase(MetaData::SkillPhase* phase)
for (auto& cell : grid_list) {
for (Human* hum : cell->human_list) {
if (hum->team_id != team_id && hum->pos.Distance(skill_target_pos) < hum->GetRadius()) {
if (!hum->HasBuffEffect(BET_Invincible)) {
hum->DecHP(phase->param1.GetDouble(), entity_uniid, name, 0);
}
a8::Vec2 pull_dir = pos - old_pos;
if (std::abs(pull_dir.x) > FLT_EPSILON ||
std::abs(pull_dir.y) > FLT_EPSILON) {

View File

@ -204,17 +204,15 @@ void Obstacle::Explosion()
case ET_Player:
{
Human* hum = (Human*)target;
#if 1
if (!hum->dead) {
#else
if (!hum->dead && (hum->team_id == 0 || hum->team_id != player->team_id)) {
#endif
float dmg = meta->i->damage();
float def = hum->def + hum->ability.def_add;
float finaly_dmg = dmg * (1 - def/MetaMgr::Instance()->K);
if (!hum->HasBuffEffect(BET_Invincible)) {
hum->DecHP(finaly_dmg, VP_Mine, "地雷", VW_Mine);
}
}
}
break;
case ET_Obstacle:
{