1
This commit is contained in:
parent
9ac84073b1
commit
ddbb749689
@ -57,7 +57,7 @@ void FrameEvent::AddShot(Human* hum)
|
||||
}
|
||||
}
|
||||
|
||||
void FrameEvent::AddBullet(Human* hum, a8::Vec2 born_pos, a8::Vec2 dir, float fly_distance)
|
||||
void FrameEvent::AddBullet(Human* hum, a8::Vec2 born_pos, a8::Vec2 dir, float fly_distance, int hit_time)
|
||||
{
|
||||
{
|
||||
auto& tuple = a8::FastAppend(bullets_);
|
||||
@ -74,6 +74,9 @@ void FrameEvent::AddBullet(Human* hum, a8::Vec2 born_pos, a8::Vec2 dir, float fl
|
||||
p.set_gun_id(hum->curr_weapon->meta->i->id());
|
||||
p.set_gun_lv(hum->curr_weapon->weapon_lv);
|
||||
p.set_fly_distance(fly_distance);
|
||||
if (hit_time != 0) {
|
||||
p.set_hit_time(hit_time);
|
||||
}
|
||||
}
|
||||
{
|
||||
int bullet_idx = bullets_.size() - 1;
|
||||
|
@ -15,7 +15,7 @@ public:
|
||||
void AddAirDrop(int appear_time, int box_id, a8::Vec2 box_pos);
|
||||
void AddEmote(Human* hum, int emote_id);
|
||||
void AddShot(Human* hum);
|
||||
void AddBullet(Human* hum, a8::Vec2 born_pos, a8::Vec2 dir, float fly_distance);
|
||||
void AddBullet(Human* hum, a8::Vec2 born_pos, a8::Vec2 dir, float fly_distance, int hit_time);
|
||||
void AddExplosion(int item_id, a8::Vec2 bomb_pos, int effect);
|
||||
void AddSmoke(Bullet* bullet, int item_id, a8::Vec2 pos);
|
||||
void AddDead(Human* hum);
|
||||
|
@ -236,7 +236,8 @@ void Human::DirectShot(MetaData::Equip* bullet_meta)
|
||||
}
|
||||
}
|
||||
bullet_dir.Rotate(bullet_angle / 180.0f);
|
||||
room->frame_event.AddBullet(this, bullet_born_pos, attack_dir, fly_distance);
|
||||
int hit_time = 0;
|
||||
room->frame_event.AddBullet(this, bullet_born_pos, attack_dir, fly_distance, hit_time);
|
||||
if (room->BattleStarted()) {
|
||||
room->CreateBullet(this, bullet_meta, bullet_born_pos, bullet_dir, fly_distance);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user