private bool CheckReceiver(ResVoiceInteraction InInteractionCfg, HashSet <int> InOwnerCamps) { int hostPlayerCamp = Singleton <GamePlayerCenter> .get_instance().hostPlayerCamp; if (InInteractionCfg.bSpecialReceive != 0) { for (int i = 0; i < InInteractionCfg.SpecialReceiveConditions.Length; i++) { if (InInteractionCfg.SpecialReceiveConditions[i] == 0u) { break; } int inCfgID = (int)InInteractionCfg.SpecialReceiveConditions[i]; if (InInteractionCfg.bReceiveType == 100) { if (this.HasReceiver(inCfgID)) { return(true); } } else if (InInteractionCfg.bReceiveType == 0) { if (this.HasReceiverInCamp(inCfgID, hostPlayerCamp)) { return(true); } } else if (InInteractionCfg.bReceiveType == 1 && this.HasReceiverNotInCamp(inCfgID, hostPlayerCamp)) { return(true); } } } else { if (InInteractionCfg.bReceiveType == 100) { return(true); } if (InInteractionCfg.bReceiveType == 0) { if (InOwnerCamps.Contains(hostPlayerCamp)) { return(true); } } else if (InInteractionCfg.bReceiveType == 1) { HashSet <int> .Enumerator enumerator = InOwnerCamps.GetEnumerator(); while (enumerator.MoveNext()) { if (enumerator.get_Current() != hostPlayerCamp) { return(true); } } } } return(false); }
public virtual void Unit() { this.InteractionCfg = null; this.OnBeginTriggered = null; this.SoundSourceActor = default(PoolObjHandle <ActorRoot>); this.bBeginTrigger = false; this.TriggerCount = 0; }
private VoiceInteraction CreateVoiceInteraction(ResVoiceInteraction InInteractionCfg) { VoiceInteraction voiceInteraction = this.Factory.Create((int)InInteractionCfg.bTriggerType) as VoiceInteraction; DebugHelper.Assert(voiceInteraction != null, "Failed create Interaction for {0}:{1}", new object[] { InInteractionCfg.dwConfigID, InInteractionCfg.bTriggerType }); return(voiceInteraction); }
private void FilterInteractionCfg(ResVoiceInteraction InInteractionCfg) { HashSet <int> inOwnerCamps = null; if (this.HeroStatInfo.TryGetValue((int)InInteractionCfg.dwGroupID, ref inOwnerCamps)) { if (!this.CheckReceiver(InInteractionCfg, inOwnerCamps)) { return; } VoiceInteraction voiceInteraction = this.CreateVoiceInteraction(InInteractionCfg); if (voiceInteraction != null) { voiceInteraction.Init(InInteractionCfg); ListView <VoiceInteraction> listView = null; if (!this.Interactions.TryGetValue(voiceInteraction.groupID, ref listView)) { listView = new ListView <VoiceInteraction>(); this.Interactions.Add(voiceInteraction.groupID, listView); } listView.Add(voiceInteraction); } } }
public override void Init(ResVoiceInteraction InInteractionCfg) { base.Init(InInteractionCfg); Singleton <GameEventSys> .instance.AddEventHandler <GameDeadEventParam>(GameEventDef.Event_ActorDead, new RefAction <GameDeadEventParam>(this.onActorDead)); }
public virtual void Init(ResVoiceInteraction InInteractionCfg) { this.InteractionCfg = InInteractionCfg; }
public override void Init(ResVoiceInteraction InInteractionCfg) { base.Init(InInteractionCfg); Singleton <CTimerManager> .instance.AddTimer(1000, 0, new CTimer.OnTimeUpHandler(this.OnCheckEncounter), false); }
public override void Init(ResVoiceInteraction InInteractionCfg) { base.Init(InInteractionCfg); Singleton <EventRouter> .instance.AddEventHandler <KillDetailInfo>(EventID.AchievementRecorderEvent, new Action <KillDetailInfo>(this.OnAchievementEvent)); }