public override void Initialize(ResDT_ConditionInfo InConditionInfo) { base.Initialize(InConditionInfo); Singleton <GameEventSys> .instance.AddEventHandler <DefaultGameEventParam>(GameEventDef.Event_BeginFightOver, new RefAction <DefaultGameEventParam>(this.onFightOver)); this.killCnt = 0; this.bCachedResult = SmartCompare.Compare <int>(this.killCnt, this.targetCount, this.operation); }
public override void Initialize(ResDT_ConditionInfo InConditionInfo) { base.Initialize(InConditionInfo); this.TriggerCount = 0; Singleton <TriggerEventSys> .instance.OnActorEnter += new TriggerEventDelegate(this.OnActorEnter); Singleton <TriggerEventSys> .instance.OnActorLeave += new TriggerEventDelegate(this.OnActorLeave); this.bCachedResults = SmartCompare.Compare <int>(this.TriggerCount, this.targetCount, this.operation); }
private bool CheckResults() { Player hostPlayer = Singleton <GamePlayerCenter> .instance.GetHostPlayer(); if (hostPlayer == null) { return(false); } ReadonlyContext <PoolObjHandle <ActorRoot> > .Enumerator enumerator = hostPlayer.GetAllHeroes().GetEnumerator(); bool flag = false; while (enumerator.MoveNext()) { PoolObjHandle <ActorRoot> current = enumerator.Current; int configId = current.handle.TheActorMeta.ConfigId; flag = false; for (int j = 0; j < this.TeamStat.Count; j++) { Info info2 = this.TeamStat[j]; if (info2.Key == configId) { flag = true; Info info = this.TeamStat[j]; info.Value++; break; } } if (!flag) { Info item = new Info { Key = configId, Value = 1 }; this.TeamStat.Add(item); } } int inFirst = 0; flag = false; for (int i = 0; i < this.TeamStat.Count; i++) { Info info4 = this.TeamStat[i]; if (info4.Key == this.targetID) { Info info5 = this.TeamStat[i]; inFirst = info5.Value; flag = true; break; } } if (!flag) { return(false); } return(SmartCompare.Compare <int>(inFirst, this.targetCount, this.operation)); }
private void CheckResult() { bool flag = SmartCompare.Compare <int>(this.TriggerCount, this.targetCount, this.operation); if (flag != this.bCachedResults) { this.bCachedResults = flag; this.TriggerChangedEvent(); } }
public bool CheckHpConditional(PoolObjHandle <ActorRoot> src, PoolObjHandle <ActorRoot> target, int iParam) { if (!src || !target) { return(false); } ulong propertyHpRate = TargetProperty.GetPropertyHpRate(src, 5); ulong propertyHpRate2 = TargetProperty.GetPropertyHpRate(target, 5); return(SmartCompare.Compare <ulong>(propertyHpRate, propertyHpRate2, iParam)); }
protected virtual bool CheckResult() { bool flag = SmartCompare.Compare <int>(this.killCnt, this.targetCount, this.operation); if (flag != this.bCachedResult) { this.bCachedResult = flag; this.OnResultStateChanged(); return(true); } return(false); }
private bool CheckResults() { Player hostPlayer = Singleton <GamePlayerCenter> .get_instance().GetHostPlayer(); if (hostPlayer == null) { return(false); } ReadonlyContext <PoolObjHandle <ActorRoot> > .Enumerator enumerator = hostPlayer.GetAllHeroes().GetEnumerator(); bool flag; while (enumerator.MoveNext()) { PoolObjHandle <ActorRoot> current = enumerator.get_Current(); int configId = current.get_handle().TheActorMeta.ConfigId; flag = false; for (int i = 0; i < this.TeamStat.get_Count(); i++) { if (this.TeamStat.get_Item(i).Key == configId) { flag = true; StarConditionRestrictHero.Info info; this.TeamStat.get_Item(i).Value = info.Value + 1; break; } } if (!flag) { this.TeamStat.Add(new StarConditionRestrictHero.Info { Key = configId, Value = 1 }); } } int inFirst = 0; flag = false; for (int j = 0; j < this.TeamStat.get_Count(); j++) { if (this.TeamStat.get_Item(j).Key == this.targetID) { inFirst = this.TeamStat.get_Item(j).Value; flag = true; break; } } return(flag && SmartCompare.Compare <int>(inFirst, this.targetCount, this.operation)); }
public override void OnActorDeath(ref GameDeadEventParam prm) { if ((((prm.src != 0) && (prm.src.handle.TheActorMeta.ActorType == this.targetType)) && ((this.targetID == 0) || (this.targetID == prm.src.handle.TheActorMeta.ConfigId))) && this.ShouldCare(prm.src.handle)) { this.DealthCount++; bool flag = SmartCompare.Compare <int>(this.DealthCount, this.targetCount, this.operation); if (this.bCheckResults != flag) { this.bCheckResults = flag; this.CachedSource = prm.src; this.CachedAttacker = prm.orignalAtker; this.TriggerChangedEvent(); } } }
private void OnActorDamage(ref HurtEventResultInfo info) { if (!this.bHasFailure && ActorHelper.IsHostActor(ref info.src)) { int actorHp = info.src.get_handle().ValueComponent.actorHp; int actorHpTotal = info.src.get_handle().ValueComponent.actorHpTotal; int num = actorHp * 100 / actorHpTotal; if (num < this.LoweastHealthPercent) { this.LoweastHealthPercent = num; } bool flag = !SmartCompare.Compare <int>(num, this.healthPercent, this.operation); if (this.bHasFailure != flag) { this.bHasFailure = flag; this.TriggerChangedEvent(); } } }
public override void Start() { base.Start(); Player hostPlayer = Singleton <GamePlayerCenter> .instance.GetHostPlayer(); DebugHelper.Assert(hostPlayer != null); ReadonlyContext <PoolObjHandle <ActorRoot> > .Enumerator enumerator = hostPlayer.GetAllHeroes().GetEnumerator(); this.CareerCount = 0; int targetCareer = this.targetCareer; while (enumerator.MoveNext()) { PoolObjHandle <ActorRoot> current = enumerator.Current; if (current.handle.TheActorMeta.ActorType == (ActorTypeDef)targetCareer) { this.CareerCount++; } } this.CachedStatus = (SmartCompare.Compare <int>(this.CareerCount, this.targetCount, this.operation) ? StarEvaluationStatus.Success : StarEvaluationStatus.Failure); }
public override void OnCampScoreUpdated(ref SCampScoreUpdateParam prm) { if (this.ShouldCare(ref prm)) { this.CachedSource = prm.src; this.CachedAttacker = prm.atker; if ((this.DataSubType == RES_STAR_CONDITION_DATA_SUB_TYPE.RES_STAR_CONDITION_DATA_HEAD_POINTS) && (prm.HeadPoints >= 0)) { this.Score = prm.HeadPoints; } else if ((this.DataSubType == RES_STAR_CONDITION_DATA_SUB_TYPE.RES_STAR_CONDITION_DATA_HEADS) && (prm.HeadCount >= 0)) { this.Score = prm.HeadCount; } bool flag = SmartCompare.Compare <int>(this.Score, this.TargetScore, this.operation); if (this.bCheckResults != flag) { this.bCheckResults = flag; this.TriggerChangedEvent(); } } }
private void UpdateCheckResults() { COM_PLAYERCAMP hostPlayerCamp = Singleton <GamePlayerCenter> .instance.hostPlayerCamp; COM_PLAYERCAMP com_playercamp2 = COM_PLAYERCAMP.COM_PLAYERCAMP_MID; switch (hostPlayerCamp) { case COM_PLAYERCAMP.COM_PLAYERCAMP_1: com_playercamp2 = COM_PLAYERCAMP.COM_PLAYERCAMP_2; break; case COM_PLAYERCAMP.COM_PLAYERCAMP_2: com_playercamp2 = COM_PLAYERCAMP.COM_PLAYERCAMP_1; break; } uint score = (uint)Singleton <BattleStatistic> .instance.GetCampStat()[(uint)hostPlayerCamp].GetScore(this.DataSubType); uint inSecond = (uint)Singleton <BattleStatistic> .instance.GetCampStat()[(uint)com_playercamp2].GetScore(this.DataSubType); if (score != inSecond) { if (this.TargetCamp == 0) { this.bCheckResults = SmartCompare.Compare <uint>(score, inSecond, this.operation); Singleton <BattleStatistic> .instance.bSelfCampHaveWinningFlag = this.bCheckResults; } else if (this.TargetCamp == 1) { this.bCheckResults = SmartCompare.Compare <uint>(inSecond, score, this.operation); Singleton <BattleStatistic> .instance.bSelfCampHaveWinningFlag = !this.bCheckResults; } } else if ((score == 0) && (this.TargetCamp == 1)) { this.bCheckResults = true; Singleton <BattleStatistic> .instance.bSelfCampHaveWinningFlag = false; } }
private void UpdateCheckResults() { COM_PLAYERCAMP hostPlayerCamp = Singleton <GamePlayerCenter> .get_instance().hostPlayerCamp; COM_PLAYERCAMP cOM_PLAYERCAMP = 0; if (hostPlayerCamp == 1) { cOM_PLAYERCAMP = 2; } else if (hostPlayerCamp == 2) { cOM_PLAYERCAMP = 1; } uint score = (uint)Singleton <BattleStatistic> .get_instance().GetCampStat().get_Item(hostPlayerCamp).GetScore(this.DataSubType); uint score2 = (uint)Singleton <BattleStatistic> .get_instance().GetCampStat().get_Item(cOM_PLAYERCAMP).GetScore(this.DataSubType); if (score != score2) { if (this.TargetCamp == 0) { this.bCheckResults = SmartCompare.Compare <uint>(score, score2, this.operation); Singleton <BattleStatistic> .get_instance().bSelfCampHaveWinningFlag = this.bCheckResults; } else if (this.TargetCamp == 1) { this.bCheckResults = SmartCompare.Compare <uint>(score2, score, this.operation); Singleton <BattleStatistic> .get_instance().bSelfCampHaveWinningFlag = !this.bCheckResults; } } else if (score == 0u && this.TargetCamp == 1) { this.bCheckResults = true; Singleton <BattleStatistic> .get_instance().bSelfCampHaveWinningFlag = false; } }
public override void OnCampScoreUpdated(ref SCampScoreUpdateParam prm) { if (!this.ShouldCare(ref prm)) { return; } this.CachedSource = prm.src; this.CachedAttacker = prm.atker; if (this.DataSubType == 1 && prm.HeadPoints >= 0) { this.Score = prm.HeadPoints; } else if (this.DataSubType == 2 && prm.HeadCount >= 0) { this.Score = prm.HeadCount; } bool flag = SmartCompare.Compare <int>(this.Score, this.TargetScore, this.operation); if (this.bCheckResults != flag) { this.bCheckResults = flag; this.TriggerChangedEvent(); } }
private void UpdateCheckResults() { COM_PLAYERCAMP hostPlayerCamp = Singleton <GamePlayerCenter> .instance.hostPlayerCamp; COM_PLAYERCAMP key = COM_PLAYERCAMP.COM_PLAYERCAMP_MID; if (hostPlayerCamp == COM_PLAYERCAMP.COM_PLAYERCAMP_1) { key = COM_PLAYERCAMP.COM_PLAYERCAMP_2; } else if (hostPlayerCamp == COM_PLAYERCAMP.COM_PLAYERCAMP_2) { key = COM_PLAYERCAMP.COM_PLAYERCAMP_1; } uint score = (uint)Singleton <BattleStatistic> .instance.GetCampStat()[(uint)hostPlayerCamp].GetScore(this.DataSubType); uint score2 = (uint)Singleton <BattleStatistic> .instance.GetCampStat()[(uint)key].GetScore(this.DataSubType); if (score != score2) { if (this.TargetCamp == 0) { this.bCheckResults = SmartCompare.Compare <uint>(score, score2, this.operation); Singleton <BattleStatistic> .instance.bSelfCampHaveWinningFlag = this.bCheckResults; } else if (this.TargetCamp == 1) { this.bCheckResults = SmartCompare.Compare <uint>(score2, score, this.operation); Singleton <BattleStatistic> .instance.bSelfCampHaveWinningFlag = !this.bCheckResults; } } else if (score == 0u && this.TargetCamp == 1) { this.bCheckResults = true; Singleton <BattleStatistic> .instance.bSelfCampHaveWinningFlag = false; } }
public override void Initialize(ResDT_ConditionInfo InConditionInfo) { base.Initialize(InConditionInfo); this.bCheckResults = SmartCompare.Compare <int>(this.Score, this.TargetScore, this.operation); }
private bool CheckTimeout() { ulong inFirst = Singleton <FrameSynchr> .instance.LogicFrameTick - this.StartTime; return(!SmartCompare.Compare <ulong>(inFirst, (ulong)this.limitMSeconds, this.timeOperation)); }
protected bool CheckResult() { return(SmartCompare.Compare <int>(this.EncounterCount, this.targetCount, this.operation)); }