1
This commit is contained in:
parent
2561d1ecf5
commit
1562212376
@ -61,9 +61,8 @@ void Bullet::OnHit(std::set<Entity*>& objects)
|
||||
|
||||
void Bullet::ProcBomb()
|
||||
{
|
||||
self_collider_->rad = gun_meta->i->explosion_range();
|
||||
self_collider_->rad = GetExplosionRange();
|
||||
if (IsCurrWeapon()) {
|
||||
self_collider_->rad *= (1 + ability_->GetAttrRate(kHAT_WeaponExplosionRange));
|
||||
}
|
||||
std::set<Entity*> objects;
|
||||
Car* c4_target = nullptr;
|
||||
@ -300,6 +299,15 @@ float Bullet::GetAtk()
|
||||
return atk * attr_rate;
|
||||
}
|
||||
|
||||
float Bullet::GetExplosionRange()
|
||||
{
|
||||
float e_range = gun_meta->i->explosion_range();
|
||||
if (IsCurrWeapon()) {
|
||||
e_range *= (1 + ability_->GetAttrRate(kHAT_WeaponExplosionRange));
|
||||
}
|
||||
return e_range;
|
||||
}
|
||||
|
||||
void Bullet::Check(float distance)
|
||||
{
|
||||
std::set<Entity*> objects;
|
||||
@ -365,6 +373,7 @@ void Bullet::ProcFragBomb(int delay_time)
|
||||
task->gun_meta = gun_meta;
|
||||
task->meta = meta;
|
||||
task->atk = GetAtk();
|
||||
task->explosion_range = GetExplosionRange();
|
||||
room->xtimer.AddDeadLineTimerAndAttach
|
||||
(std::max(1, (int)(delay_time / FRAME_RATE_MS)),
|
||||
a8::XParams()
|
||||
|
@ -39,6 +39,7 @@ class Bullet : public MoveableEntity
|
||||
void RecalcSelfCollider();
|
||||
bool IsBomb();
|
||||
float GetAtk();
|
||||
float GetExplosionRange();
|
||||
bool IsCurrWeapon();
|
||||
|
||||
protected:
|
||||
|
@ -20,7 +20,7 @@ void FragMiTask::Done()
|
||||
Explosion explosion;
|
||||
explosion.EnemyAndObstacleAttack(sender,
|
||||
center,
|
||||
meta->i->explosion_range(),
|
||||
explosion_range,
|
||||
gun_meta->i->explosion_effect(),
|
||||
GetAtk());
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ class FragMiTask : public MicroTask
|
||||
CreatureWeakPtr follow_target;
|
||||
MetaData::Equip* gun_meta = nullptr;
|
||||
MetaData::Equip* meta = nullptr;
|
||||
float explosion_range = 1;
|
||||
float atk = 0;
|
||||
|
||||
void Done();
|
||||
|
@ -3548,6 +3548,14 @@ void Human::OnExplosionHit(Explosion* e)
|
||||
GetAbility()->GetAttrAbs(kHAT_Def);
|
||||
float finaly_dmg = dmg * (1 - def/MetaMgr::Instance()->K);
|
||||
finaly_dmg = std::max(finaly_dmg, 0.0f);
|
||||
#ifdef DEBUG
|
||||
{
|
||||
room->BroadcastDebugMsg(a8::Format("explosion dmg:%d def:%d finaly_dmg:%d",
|
||||
{dmg,
|
||||
def,
|
||||
finaly_dmg}));
|
||||
}
|
||||
#endif
|
||||
#if 1
|
||||
DecHP(finaly_dmg,
|
||||
1,
|
||||
|
Loading…
x
Reference in New Issue
Block a user