1
This commit is contained in:
parent
6656bbabb9
commit
eb5818c8e2
@ -519,6 +519,7 @@ void Bullet::ProcC4Bomb(Car* target, int delay_time)
|
||||
task->bomb_pos = GetPos();
|
||||
if (target) {
|
||||
task->follow_target.Attach(target);
|
||||
task->force_target.Attach(target);
|
||||
if (gun_meta->int_param1 > 0) {
|
||||
int buff_uniid = target->TryAddBuff(sender.Get(), gun_meta->int_param1);
|
||||
if (buff_uniid != 0) {
|
||||
|
@ -117,6 +117,9 @@ void Explosion::InternalAttack()
|
||||
}
|
||||
}
|
||||
);
|
||||
if (force_target_.Get() && objects.find(force_target_.Get()) == objects.end()) {
|
||||
objects.insert(force_target_.Get());
|
||||
}
|
||||
for (auto& target : objects) {
|
||||
if (target->IsCreature(room_) && ((Creature*)target)->HasBuffEffect(kBET_BulletThrough)) {
|
||||
continue;
|
||||
@ -129,3 +132,8 @@ bool Explosion::IsPreBattleExplosion()
|
||||
{
|
||||
return create_frameno_ <= room_->GetBattleStartFrameNo() || room_->GetBattleStartFrameNo() == 0;
|
||||
}
|
||||
|
||||
void Explosion::AddForceTarget(CreatureWeakPtr force_target)
|
||||
{
|
||||
force_target_ = force_target;
|
||||
}
|
||||
|
@ -26,6 +26,8 @@ class Explosion
|
||||
int explosion_effect,
|
||||
float dmg,
|
||||
long long special_damage_type = 0);
|
||||
void AddForceTarget(CreatureWeakPtr force_target);
|
||||
|
||||
private:
|
||||
void InternalAttack();
|
||||
|
||||
@ -33,6 +35,7 @@ class Explosion
|
||||
int type_ = 0;
|
||||
Room* room_ = nullptr;
|
||||
CreatureWeakPtr sender_;
|
||||
CreatureWeakPtr force_target_;
|
||||
float explosion_range_ = 0;
|
||||
int explosion_effect_ = 0;
|
||||
float dmg_ = 0;
|
||||
|
@ -19,6 +19,9 @@ void FragMiTask::Done()
|
||||
}
|
||||
|
||||
Explosion explosion;
|
||||
if (force_target.Get()) {
|
||||
explosion.AddForceTarget(force_target);
|
||||
}
|
||||
explosion.EnemyAndObstacleAttack(sender,
|
||||
center,
|
||||
explosion_range,
|
||||
|
@ -17,6 +17,7 @@ class FragMiTask : public MicroTask
|
||||
a8::Vec2 bomb_pos;
|
||||
CreatureWeakPtr sender;
|
||||
CreatureWeakPtr follow_target;
|
||||
CreatureWeakPtr force_target;
|
||||
MetaData::Equip* gun_meta = nullptr;
|
||||
MetaData::Equip* meta = nullptr;
|
||||
float explosion_range = 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user