1
This commit is contained in:
parent
e73cc99198
commit
ab2f33eafd
@ -232,14 +232,17 @@ float Bullet::GetAtk()
|
||||
void Bullet::Check(float distance)
|
||||
{
|
||||
std::set<Entity*> objects;
|
||||
TouchAllLayerHumanList
|
||||
(
|
||||
[this, &objects] (Human* hum, bool& stop)
|
||||
room->grid_service->TouchCreatures
|
||||
(room->GetRoomIdx(),
|
||||
GetGridList(),
|
||||
[this, &objects] (Creature* c, bool& stop)
|
||||
{
|
||||
AabbCollider aabb_box;
|
||||
hum->GetHitAabbBox(aabb_box);
|
||||
if (hum != sender.Get() && !hum->dead && TestCollision(room, &aabb_box)) {
|
||||
objects.insert(hum);
|
||||
if (sender.Get()->IsProperTarget(c)) {
|
||||
AabbCollider aabb_box;
|
||||
c->GetHitAabbBox(aabb_box);
|
||||
if (c != sender.Get() && !c->dead && TestCollision(room, &aabb_box)) {
|
||||
objects.insert(c);
|
||||
}
|
||||
}
|
||||
});
|
||||
{
|
||||
|
@ -231,6 +231,9 @@ void Car::OnBulletHit(Bullet* bullet)
|
||||
|
||||
void Car::DecHP(float dec_hp, int killer_id, const std::string& killer_name, int weapon_id)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
dec_hp *= 5;
|
||||
#endif
|
||||
float old_health = GetHP();
|
||||
float new_health = std::max(0.0f, GetHP() - dec_hp);
|
||||
ability.hp = std::max(0.0f, new_health);
|
||||
|
Loading…
x
Reference in New Issue
Block a user