public static bool IsHostCtrlActorCaller(ref PoolObjHandle <ActorRoot> actor) { bool result = false; Player hostPlayer = Singleton <GamePlayerCenter> .instance.GetHostPlayer(); if (hostPlayer != null && hostPlayer.Captain && hostPlayer.Captain.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Call && actor && actor.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero) { CallActorWrapper callActorWrapper = hostPlayer.Captain.handle.ActorControl as CallActorWrapper; if (callActorWrapper != null && callActorWrapper.GetHostActor() == actor) { result = true; } } return(result); }
private void OnActorDead(ref GameDeadEventParam prm) { PoolObjHandle <ActorRoot> src = prm.src; PoolObjHandle <ActorRoot> ptr = prm.orignalAtker; if (!src || !ptr || prm.bImmediateRevive || prm.bSuicide) { return; } if (this.bSoulGrow) { if (src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_EYE) { EyeWrapper eyeWrapper = src.handle.ActorControl as EyeWrapper; if (eyeWrapper == null || eyeWrapper.bLifeTimeOver) { return; } } if (src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero) { if (ptr.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Call) { CallActorWrapper callActorWrapper = ptr.handle.ActorControl as CallActorWrapper; if (callActorWrapper != null) { ptr = callActorWrapper.GetHostActor(); } } else if (ptr.handle.TheActorMeta.ActorType != ActorTypeDef.Actor_Type_Hero && src.handle.ActorControl.IsKilledByHero()) { ptr = src.handle.ActorControl.LastHeroAtker; } } if (ptr) { this.OnActorDeadIncomeSoul(ref src, ref ptr); if (ptr.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero || src.handle.TheActorMeta.ActorType != ActorTypeDef.Actor_Type_Hero) { this.OnActorDeadIncomeGoldCoinInBattle(ref src, ref ptr); } } } if (!this.bPvpMode) { this.OnMonsterDeadGold(ref prm); } }
private void GetAllocIncomeRelatedHeros(ref ListView <ActorRoot> relatedHeros, ref PoolObjHandle <ActorRoot> target, ref PoolObjHandle <ActorRoot> attacker, RES_INCOME_MEMBER_CHOOSE_TYPE chooseType, ResDT_IncomeAttackRule allocIncomeRule, int paramIndex) { switch (chooseType) { case RES_INCOME_MEMBER_CHOOSE_TYPE.RES_INCOME_MEMBER_CAMP: { List <PoolObjHandle <ActorRoot> > heroActors = Singleton <GameObjMgr> .instance.HeroActors; int count = heroActors.get_Count(); for (int i = 0; i < count; i++) { if (heroActors.get_Item(i).handle.TheActorMeta.ActorCamp == attacker.handle.TheActorMeta.ActorCamp && heroActors.get_Item(i).handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero && (!heroActors.get_Item(i).handle.ActorControl.IsDeadState || allocIncomeRule.astIncomeMemberArr[paramIndex].bDeadAddIncome > 0)) { relatedHeros.Add(heroActors.get_Item(i).handle); } } break; } case RES_INCOME_MEMBER_CHOOSE_TYPE.RES_INCOME_MEMBER_RANGE: { if (attacker.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero && (!attacker.handle.ActorControl.IsDeadState || allocIncomeRule.astIncomeMemberArr[paramIndex].bDeadAddIncome > 0)) { relatedHeros.Add(attacker.handle); } List <Player> allPlayers = Singleton <GamePlayerCenter> .instance.GetAllPlayers(); if (allPlayers != null) { int count2 = allPlayers.get_Count(); for (int j = 0; j < count2; j++) { if (!(allPlayers.get_Item(j).Captain == attacker) && allPlayers.get_Item(j).Captain.handle.TheActorMeta.ActorCamp == attacker.handle.TheActorMeta.ActorCamp && this.IsActorInRange(allPlayers.get_Item(j).Captain, target, allocIncomeRule.astIncomeMemberArr[paramIndex].iRangeRadius) && (!allPlayers.get_Item(j).Captain.handle.ActorControl.IsDeadState || allocIncomeRule.astIncomeMemberArr[paramIndex].bDeadAddIncome > 0)) { if (allPlayers.get_Item(j).Captain.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Call) { CallActorWrapper callActorWrapper = allPlayers.get_Item(j).Captain.handle.ActorControl as CallActorWrapper; if (callActorWrapper != null) { relatedHeros.Add(callActorWrapper.GetHostActor()); } } else { relatedHeros.Add(allPlayers.get_Item(j).Captain.handle); } } } } break; } case RES_INCOME_MEMBER_CHOOSE_TYPE.RES_INCOME_MEMBER_LAST_KILL: if (attacker.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero && (!attacker.handle.ActorControl.IsDeadState || allocIncomeRule.astIncomeMemberArr[paramIndex].bDeadAddIncome > 0)) { relatedHeros.Add(attacker.handle); } break; case RES_INCOME_MEMBER_CHOOSE_TYPE.RES_INCOME_MEMBER_ASSIST: { HashSet <uint> assistSet = BattleLogic.GetAssistSet(target, attacker, true); HashSet <uint> .Enumerator enumerator = assistSet.GetEnumerator(); while (enumerator.MoveNext()) { PoolObjHandle <ActorRoot> actor = Singleton <GameObjMgr> .GetInstance().GetActor(enumerator.get_Current()); if (actor.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero && (!actor.handle.ActorControl.IsDeadState || allocIncomeRule.astIncomeMemberArr[paramIndex].bDeadAddIncome > 0)) { relatedHeros.Add(actor.handle); } } break; } case RES_INCOME_MEMBER_CHOOSE_TYPE.RES_INCOME_MEMBER_ALL_KILL: { if (attacker.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero && (!attacker.handle.ActorControl.IsDeadState || allocIncomeRule.astIncomeMemberArr[paramIndex].bDeadAddIncome > 0)) { relatedHeros.Add(attacker.handle); } HashSet <uint> assistSet2 = BattleLogic.GetAssistSet(target, attacker, true); HashSet <uint> .Enumerator enumerator2 = assistSet2.GetEnumerator(); while (enumerator2.MoveNext()) { PoolObjHandle <ActorRoot> actor2 = Singleton <GameObjMgr> .GetInstance().GetActor(enumerator2.get_Current()); if (actor2.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero && !relatedHeros.Contains(actor2.handle) && (!actor2.handle.ActorControl.IsDeadState || allocIncomeRule.astIncomeMemberArr[paramIndex].bDeadAddIncome > 0)) { relatedHeros.Add(actor2.handle); } } break; } } }