1
This commit is contained in:
parent
ec25b5a13a
commit
8bf2110e74
@ -1493,6 +1493,7 @@ void CallFuncBuff::Shot()
|
||||
float x = meta->GetBuffParam3(this);
|
||||
float y = meta->GetBuffParam4(this);
|
||||
float z = meta->GetBuffParam5(this);
|
||||
int duration = meta->GetBuffParam8(this);
|
||||
const mt::Equip* gun_meta = mt::Equip::GetById(id);
|
||||
if (gun_meta) {
|
||||
const mt::Equip* bullet_meta = mt::Equip::GetById(gun_meta->use_bullet());
|
||||
|
@ -35,6 +35,7 @@ class Bullet : public MoveableEntity, public IBullet
|
||||
std::shared_ptr<std::set<int>> reporter_list;
|
||||
bool ignore_original_dmg = false;
|
||||
std::function<void(Bullet*)> on_bullet_exit = nullptr;
|
||||
int duration = 0;
|
||||
|
||||
virtual ~Bullet() override;
|
||||
virtual void Initialize() override;
|
||||
|
@ -94,7 +94,8 @@ void FrameEvent::AddBullet(int bullet_uniid,
|
||||
int hand,
|
||||
std::shared_ptr<std::set<int>> reporter_list,
|
||||
int shot_uniid,
|
||||
int force_player_id)
|
||||
int force_player_id,
|
||||
int duration)
|
||||
{
|
||||
{
|
||||
auto& tuple = a8::FastAppend(room->frame_event_data->bullets_);
|
||||
@ -122,6 +123,7 @@ void FrameEvent::AddBullet(int bullet_uniid,
|
||||
}
|
||||
}
|
||||
p.set_shot_uniid(shot_uniid);
|
||||
p.set_duration(duration);
|
||||
}
|
||||
{
|
||||
int bullet_idx = room->frame_event_data->bullets_.size() - 1;
|
||||
|
@ -28,7 +28,8 @@ public:
|
||||
int hand,
|
||||
std::shared_ptr<std::set<int>> reporter_list,
|
||||
int shot_uniid,
|
||||
int force_player_id = 0);
|
||||
int force_player_id = 0,
|
||||
int duration = 0);
|
||||
void RemoveBullet(glm::vec3 pos, int bullet_uniid);
|
||||
void AddExplosion(Bullet* bullet, int item_id, Position bomb_pos);
|
||||
void AddPlaySkill(CreatureWeakPtr& sender, int skill_id);
|
||||
|
@ -808,7 +808,8 @@ int Room::CreateBullet(Creature* sender,
|
||||
int weapon_buff_id,
|
||||
std::shared_ptr<std::set<int>> reporter_list,
|
||||
int shot_uniid,
|
||||
std::function<void(Bullet*)> on_bullet_exit)
|
||||
std::function<void(Bullet*)> on_bullet_exit,
|
||||
int duration)
|
||||
{
|
||||
int bullet_uniid = 0;
|
||||
if (grid_service->CanAdd(pos.x, pos.z)) {
|
||||
@ -835,6 +836,7 @@ int Room::CreateBullet(Creature* sender,
|
||||
bullet->reporter_list = reporter_list;
|
||||
bullet->shot_uniid = shot_uniid;
|
||||
bullet->on_bullet_exit = on_bullet_exit;
|
||||
bullet->duration = duration;
|
||||
bullet->Initialize();
|
||||
#ifdef MYDEBUG1
|
||||
a8::XPrintf("xxxxxxx born_pos:%f,%f,%f curr_pos:%f,%f,%f\n",
|
||||
|
@ -190,7 +190,8 @@ public:
|
||||
int weapon_buff_id,
|
||||
std::shared_ptr<std::set<int>> reporter_list,
|
||||
int shot_uniid,
|
||||
std::function<void(Bullet*)> on_bullet_exit);
|
||||
std::function<void(Bullet*)> on_bullet_exit,
|
||||
int duration);
|
||||
Car* CreateCar(Human* driver,
|
||||
int car_uniid,
|
||||
const mt::Equip* meta,
|
||||
|
@ -58,6 +58,7 @@ struct BulletInfo
|
||||
a8::XTimerWp keep_shot_animi_timer_ptr;
|
||||
bool ignore_original_dmg = false;
|
||||
std::function<void(Bullet*)> on_bullet_exit;
|
||||
int duration = 0;
|
||||
};
|
||||
|
||||
static void CalcGunMuzzlePosition(Creature* c,
|
||||
@ -284,7 +285,8 @@ static void InternalCreateBullet(BulletInfo& bullet_info)
|
||||
bullet_info.weapon_buff_id,
|
||||
bullet_info.reporter_list,
|
||||
bullet_info.shot_uniid,
|
||||
bullet_info.on_bullet_exit);
|
||||
bullet_info.on_bullet_exit,
|
||||
bullet_info.duration);
|
||||
#ifdef MYDEBUG1
|
||||
if (bullet_info.c.Get()->IsPlayer()) {
|
||||
bullet_info.c.Get()->SendDebugMsg(a8::Format("CreateBullet id:%d",
|
||||
@ -359,7 +361,8 @@ void InternalShot(Creature* c,
|
||||
float fly_distance,
|
||||
long long weapon_uniid,
|
||||
int trace_target_uniid,
|
||||
std::function<void(Bullet*)> on_bullet_exit)
|
||||
std::function<void(Bullet*)> on_bullet_exit,
|
||||
int duration)
|
||||
{
|
||||
bool is_player = c->IsPlayer();
|
||||
bool is_car = c->IsCar();
|
||||
@ -543,6 +546,7 @@ void InternalShot(Creature* c,
|
||||
bullet_info.reporter_list = c->CalcReporterList(trace_target_uniid, weapon_meta, bullet_meta);
|
||||
bullet_info.ignore_original_dmg = c->GetAbility()->GetSwitchTimes(kIgnoreOriginalDmg) > 0;
|
||||
bullet_info.on_bullet_exit = on_bullet_exit;
|
||||
bullet_info.duration = duration;
|
||||
if (shot_animi && shot_animi->is_other) {
|
||||
bullet_info.hand = shot_animi->GetShotHand(bulletIdx - 1);
|
||||
} else {
|
||||
|
@ -10,4 +10,5 @@ void InternalShot(Creature* sender,
|
||||
float fly_distance,
|
||||
long long weapon_uniid,
|
||||
int trace_target_uniid,
|
||||
std::function<void(Bullet*)> on_bullet_exit = nullptr);
|
||||
std::function<void(Bullet*)> on_bullet_exit = nullptr,
|
||||
int duration = 0);
|
||||
|
@ -828,6 +828,7 @@ message MFBullet
|
||||
optional float fly_distance = 11; //只有手雷和烟雾弹时这个字段才有意义
|
||||
optional int32 bullet_uniid = 12; //子弹唯一id
|
||||
optional int32 hand = 16 [default = 0]; //手 0:右手 1:左手
|
||||
optional int32 duration = 21; //持续时间(单位毫秒,>0时才有意义)
|
||||
|
||||
//追踪型子弹以下字段才有意义(trace_target_uniid != 0)
|
||||
optional int32 trace_target_uniid = 13 [default = 0]; //不为空和0的时候表示要追踪的目标对象uniid
|
||||
@ -837,6 +838,7 @@ message MFBullet
|
||||
|
||||
//客户端上报型子弹一下字段才有意义(reporter_list.size() > 0)
|
||||
repeated int32 reporter_list = 20; //上报者列表
|
||||
|
||||
}
|
||||
|
||||
//射击
|
||||
|
Loading…
x
Reference in New Issue
Block a user