private void OnOrganDead(ref GameDeadEventParam prm) { if (!prm.src || prm.src.handle.TheActorMeta.ActorType != ActorTypeDef.Actor_Type_Organ || !prm.atker) { return; } ActorRoot handle = prm.src.handle; OrganWrapper organWrapper = handle.AsOrgan(); COM_PLAYERCAMP actorCamp = prm.atker.handle.TheActorMeta.ActorCamp; if (handle.TheStaticData.TheOrganOnlyInfo.DeadEnemySoldier > 0) { SoldierRegion soldierRegionByRoute = Singleton <BattleLogic> .GetInstance().mapLogic.GetSoldierRegionByRoute(actorCamp, handle.TheStaticData.TheOrganOnlyInfo.AttackRouteID); if (soldierRegionByRoute != null) { soldierRegionByRoute.SwitchWave(handle.TheStaticData.TheOrganOnlyInfo.DeadEnemySoldier, false); } } if (this._supportHighTowerSoldier && organWrapper.cfgInfo.bOrganType == 4) { List <PoolObjHandle <ActorRoot> > organActors = Singleton <GameObjMgr> .GetInstance().OrganActors; bool flag = true; for (int i = 0; i < organActors.get_Count(); i++) { PoolObjHandle <ActorRoot> ptr = organActors.get_Item(i); if (ptr && ptr.handle.AsOrgan().cfgInfo.bOrganType == organWrapper.cfgInfo.bOrganType && ptr.handle.TheActorMeta.ActorCamp == handle.TheActorMeta.ActorCamp && !ptr.handle.ActorControl.IsDeadState) { flag = false; break; } } if (flag) { this._soldierAddAttrs[(int)actorCamp].HadAdd = true; this._soldierAddAttrs[(int)actorCamp].MaxHP = (int)GameDataMgr.globalInfoDatabin.GetDataByKey(335u).dwConfValue; this._soldierAddAttrs[(int)actorCamp].PhycAttack = (int)GameDataMgr.globalInfoDatabin.GetDataByKey(336u).dwConfValue; this._soldierAddAttrs[(int)actorCamp].PhycDefend = (int)GameDataMgr.globalInfoDatabin.GetDataByKey(338u).dwConfValue; this._soldierAddAttrs[(int)actorCamp].MagcAttack = (int)GameDataMgr.globalInfoDatabin.GetDataByKey(337u).dwConfValue; this._soldierAddAttrs[(int)actorCamp].MagcDefend = (int)GameDataMgr.globalInfoDatabin.GetDataByKey(339u).dwConfValue; this._soldierAddAttrs[(int)actorCamp].DropCoin = (int)GameDataMgr.globalInfoDatabin.GetDataByKey(340u).dwConfValue; this._soldierAddAttrs[(int)actorCamp].DropExp = (int)GameDataMgr.globalInfoDatabin.GetDataByKey(341u).dwConfValue; this._soldierAddAttrs[(int)actorCamp].ShapeScale = (int)GameDataMgr.globalInfoDatabin.GetDataByKey(342u).dwConfValue; KillNotify theKillNotify = Singleton <CBattleSystem> .GetInstance().TheKillNotify; Player hostPlayer = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer(); if (theKillNotify != null && hostPlayer != null) { bool bSrcAllies = hostPlayer.PlayerCamp == actorCamp; KillInfo killInfo = new KillInfo(KillNotify.building_icon, null, KillDetailInfoType.Info_Type_Destroy_All_Tower, bSrcAllies, false, ActorTypeDef.Invalid, false); theKillNotify.AddKillInfo(ref killInfo); } } } }
protected override void OnDead() { Singleton <CSoundManager> .GetInstance().PostEvent("Set_Theme", null); if (base.actor.TheStaticData.TheOrganOnlyInfo.DeadEnemySoldier > 0) { SoldierRegion soldierRegion = Singleton <BattleLogic> .GetInstance().mapLogic.GetSoldierRegion(base.actor.GiveMyEnemyCamp(), base.actor.TheStaticData.TheOrganOnlyInfo.AttackRouteID); if (soldierRegion != null) { soldierRegion.SwitchWave(base.actor.TheStaticData.TheOrganOnlyInfo.DeadEnemySoldier); } } base.OnDead(); }