diff --git a/server/gameserver/creature.cc b/server/gameserver/creature.cc index 52135bcd..d185fa40 100644 --- a/server/gameserver/creature.cc +++ b/server/gameserver/creature.cc @@ -326,7 +326,7 @@ void InternalShot(Creature* c, bullet_born_offset = a8::Vec2(v.z *10*1, v.x*10*-1); bullet_born_pos = c->GetPos() + bullet_born_offset; if (c->IsPlayer() || c->IsCar()) { -#ifdef DEBUG +#ifdef DEBUG1 a8::XPrintf("idx:%d offset:%f,%f angle:%f old_angle:%f angle_xy:%f,%f %f %f gun_muzzle_position:%f,%f,%f pos:%f,%f gun_id:%d\n", { i, diff --git a/server/gameserver/hero.h b/server/gameserver/hero.h index cf289c7b..0fbd8643 100644 --- a/server/gameserver/hero.h +++ b/server/gameserver/hero.h @@ -43,12 +43,12 @@ public: virtual void OnRemoveFromTargetPartObject(Entity* target) override; virtual void OnBattleStart(Room* room) override; void Destory(); + void BeKill(int killer_id, const std::string& killer_name, int weapon_id); protected: virtual void _UpdateMove(int speed) override; void InternalUpdateMove(float speed); virtual void RecalcSelfCollider() override; - void BeKill(int killer_id, const std::string& killer_name, int weapon_id); void InitAI(); void DetachFromMaster(); diff --git a/server/gameserver/incubator.cc b/server/gameserver/incubator.cc index 1a483c1e..b40a96e0 100644 --- a/server/gameserver/incubator.cc +++ b/server/gameserver/incubator.cc @@ -326,8 +326,26 @@ void Incubator::SpawnWaveMon(int wave) if (!hero) { A8_ABORT(); } +#ifdef DEBUG1 + { + room->xtimer.AddDeadLineTimerAndAttach + ( + SERVER_FRAME_RATE * (rand() % 3), + a8::XParams() + .SetSender(hero), + [] (const a8::XParams& param) + { + Hero* hero = (Hero*)param.sender.GetUserData(); + hero->BeKill(VP_Gas, TEXT("battle_server_killer_gas", "毒圈"), VW_Gas); + }, + &hero->xtimer_attacher.timer_list_); + } +#endif if (wave + 1 == room->pve_mode_meta->waves.size()) { hero->is_pve_boss = true; +#ifdef DEBGU + a8::XPrintf("pve_boss appear\n", {}); +#endif } ++room->pve_data.mon_num; diff --git a/server/gameserver/pvedata.cc b/server/gameserver/pvedata.cc index 1f66eb58..c95b194a 100644 --- a/server/gameserver/pvedata.cc +++ b/server/gameserver/pvedata.cc @@ -63,6 +63,9 @@ void PveData::OnBeKill(Hero* hero) } ); pve_kill_boss = true; +#ifdef DEBUG + a8::XPrintf("onKill pve_boss\n", {}); +#endif } #ifdef DEBUG