This commit is contained in:
aozhiwei 2024-01-22 16:02:45 +08:00
parent 5ba88f2d4f
commit a0754e877d
5 changed files with 14 additions and 5 deletions

View File

@ -1505,7 +1505,8 @@ void CallFuncBuff::Shot()
fly_distance = GlmHelper::Norm2D(target_pos - owner->GetPos().ToGlmVec3()); fly_distance = GlmHelper::Norm2D(target_pos - owner->GetPos().ToGlmVec3());
owner->SetAttackDir(attack_dir); owner->SetAttackDir(attack_dir);
} }
fly_distance = std::max(500.0f, fly_distance); fly_distance = std::max(200.0f, fly_distance);
fly_distance = std::min(400.0f, fly_distance);
InternalShot(owner, InternalShot(owner,
owner->GetCurrWeapon()->meta, owner->GetCurrWeapon()->meta,
bullet_meta, bullet_meta,

View File

@ -724,7 +724,8 @@ int Room::CreateBullet(Creature* sender,
float shot_animi_time, float shot_animi_time,
int weapon_buff_id, int weapon_buff_id,
std::shared_ptr<std::set<int>> reporter_list, std::shared_ptr<std::set<int>> reporter_list,
int shot_uniid) int shot_uniid,
std::function<void(Bullet*)> on_bullet_exit)
{ {
int bullet_uniid = 0; int bullet_uniid = 0;
if (grid_service->CanAdd(pos.x, pos.z)) { if (grid_service->CanAdd(pos.x, pos.z)) {
@ -750,6 +751,7 @@ int Room::CreateBullet(Creature* sender,
bullet->spec_gun_buff_id = weapon_buff_id; bullet->spec_gun_buff_id = weapon_buff_id;
bullet->reporter_list = reporter_list; bullet->reporter_list = reporter_list;
bullet->shot_uniid = shot_uniid; bullet->shot_uniid = shot_uniid;
bullet->on_bullet_exit = on_bullet_exit;
bullet->Initialize(); bullet->Initialize();
#ifdef MYDEBUG1 #ifdef MYDEBUG1
a8::XPrintf("xxxxxxx born_pos:%f,%f,%f curr_pos:%f,%f,%f\n", a8::XPrintf("xxxxxxx born_pos:%f,%f,%f curr_pos:%f,%f,%f\n",

View File

@ -179,7 +179,8 @@ public:
float shot_animi_time, float shot_animi_time,
int weapon_buff_id, int weapon_buff_id,
std::shared_ptr<std::set<int>> reporter_list, std::shared_ptr<std::set<int>> reporter_list,
int shot_uniid); int shot_uniid,
std::function<void(Bullet*)> on_bullet_exit);
Car* CreateCar(Human* driver, Car* CreateCar(Human* driver,
int car_uniid, int car_uniid,
const mt::Equip* meta, const mt::Equip* meta,

View File

@ -56,6 +56,7 @@ struct BulletInfo
int shot_uniid = 0; int shot_uniid = 0;
a8::XTimerWp keep_shot_animi_timer_ptr; a8::XTimerWp keep_shot_animi_timer_ptr;
bool ignore_original_dmg = false; bool ignore_original_dmg = false;
std::function<void(Bullet*)> on_bullet_exit;
}; };
static void CalcGunMuzzlePosition(Creature* c, static void CalcGunMuzzlePosition(Creature* c,
@ -250,7 +251,8 @@ static void InternalCreateBullet(BulletInfo& bullet_info)
bullet_info.shot_animi_time, bullet_info.shot_animi_time,
bullet_info.weapon_buff_id, bullet_info.weapon_buff_id,
bullet_info.reporter_list, bullet_info.reporter_list,
bullet_info.shot_uniid); bullet_info.shot_uniid,
bullet_info.on_bullet_exit);
#ifdef MYDEBUG1 #ifdef MYDEBUG1
if (bullet_info.c.Get()->IsPlayer()) { if (bullet_info.c.Get()->IsPlayer()) {
bullet_info.c.Get()->SendDebugMsg(a8::Format("CreateBullet id:%d", bullet_info.c.Get()->SendDebugMsg(a8::Format("CreateBullet id:%d",
@ -503,6 +505,7 @@ void InternalShot(Creature* c,
bullet_info.weapon_buff_id = weapon_buff_id; bullet_info.weapon_buff_id = weapon_buff_id;
bullet_info.reporter_list = c->CalcReporterList(trace_target_uniid, weapon_meta, bullet_meta); 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.ignore_original_dmg = c->GetAbility()->GetSwitchTimes(kIgnoreOriginalDmg) > 0;
bullet_info.on_bullet_exit = on_bullet_exit;
if (weapon_meta->double_gun() && if (weapon_meta->double_gun() &&
bulletIdx > (int)(bulletNum / 2)) { bulletIdx > (int)(bulletNum / 2)) {
bullet_info.hand = 1; bullet_info.hand = 1;

View File

@ -238,8 +238,10 @@ void Skill::DoMinorMode()
if (!minor_mode_timer_.expired()) { if (!minor_mode_timer_.expired()) {
owner->room->xtimer.Delete(minor_mode_timer_); owner->room->xtimer.Delete(minor_mode_timer_);
} }
if (old_cb) {
old_cb(kSmaClick); old_cb(kSmaClick);
} }
}
} }
void Skill::InitActiveSkill() void Skill::InitActiveSkill()