移除无用代码
This commit is contained in:
parent
1ceb71aaeb
commit
36ec24eb8a
@ -55,35 +55,14 @@ void Bullet::OnHit(std::set<Entity*>& objects)
|
||||
hum->HasBuffEffect(kBET_AdPlaying)) {
|
||||
continue;
|
||||
}
|
||||
#if 1
|
||||
if (!hum->dead && (IsBomb() || player->team_id != hum->team_id)) {
|
||||
#else
|
||||
if (hum != player && !hum->dead &&
|
||||
(hum->team_id == 0 || player->team_id != hum->team_id)) {
|
||||
#endif
|
||||
#if 1
|
||||
float dmg = gun_meta->i->atk() * (1 + player->GetBuffAttrRate(kHAT_Atk)) +
|
||||
player->GetBuffAttrAbs(kHAT_Atk);
|
||||
#else
|
||||
float dmg = gun_meta->i->atk() * (1 + player->buff.damage_add + player->atk_add);
|
||||
#endif
|
||||
#if 1
|
||||
float def = hum->ability.def * (1 + hum->GetBuffAttrRate(kHAT_Def)) +
|
||||
hum->GetBuffAttrAbs(kHAT_Def);
|
||||
#else
|
||||
float def = hum->def + hum->buff.def_add;
|
||||
#endif
|
||||
float finaly_dmg = dmg * (1 - def/MetaMgr::Instance()->K);
|
||||
player->stats.damage_amount_out += finaly_dmg;
|
||||
hum->DecHP(finaly_dmg, player->entity_uniid, player->name, gun_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;
|
||||
@ -91,18 +70,10 @@ void Bullet::OnHit(std::set<Entity*>& objects)
|
||||
{
|
||||
Obstacle* obstacle = (Obstacle*)target;
|
||||
if (!obstacle->IsDead(room) && obstacle->meta->i->attack_type() == 1) {
|
||||
#if 1
|
||||
float dmg = gun_meta->i->atk() * (1 + player->GetBuffAttrRate(kHAT_Atk)) +
|
||||
player->GetBuffAttrAbs(kHAT_Atk);
|
||||
#else
|
||||
float dmg = gun_meta->i->atk() * (1 + player->buff.damage_add + player->atk_add);
|
||||
#endif
|
||||
float def = 0;
|
||||
float finaly_dmg = dmg * (1 - def/MetaMgr::Instance()->K);
|
||||
#if 0
|
||||
player->stats.damage_amount_out += finaly_dmg;
|
||||
#endif
|
||||
|
||||
obstacle->SetHealth(room, std::max(0.0f, obstacle->GetHealth(room) - finaly_dmg));
|
||||
if (obstacle->GetHealth(room) <= 0.01f) {
|
||||
obstacle->Die(room);
|
||||
@ -227,21 +198,11 @@ void Bullet::MapServiceUpdate()
|
||||
std::set<Entity*> objects;
|
||||
for (auto& grid : grid_list) {
|
||||
for (Human* hum: grid->human_list[room->room_idx]) {
|
||||
#if 1
|
||||
if (hum != player && !hum->dead && TestCollision(room, hum)) {
|
||||
objects.insert(hum);
|
||||
}
|
||||
#else
|
||||
if (hum != player && !hum->dead &&
|
||||
(hum->team_id == 0 || player->team_id != hum->team_id)) {
|
||||
if (TestCollision(hum)) {
|
||||
objects.insert(hum);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}//end for
|
||||
#if 1
|
||||
{
|
||||
std::set<ColliderComponent*> colliders;
|
||||
room->map_service->GetColliders(room, GetX(), GetY(), colliders);
|
||||
@ -251,7 +212,6 @@ void Bullet::MapServiceUpdate()
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
float bullet_range = gun_meta->i->range();
|
||||
if (gun_upgrade_meta && gun_upgrade_meta->GetAttrValue(gun_lv, EA_ShotRange) > 0) {
|
||||
bullet_range += gun_upgrade_meta->GetAttrValue(gun_lv, EA_ShotRange);
|
||||
|
Loading…
x
Reference in New Issue
Block a user