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