public void CustomValidationTest() { EntityParent parent = new EntityParent(); Assert.IsFalse(string.IsNullOrEmpty(parent["CustomValidationProperty"]), "Assert #1"); parent.CustomValidationProperty = 7; Assert.IsTrue(string.IsNullOrEmpty(parent["CustomValidationProperty"]), "Assert #2"); }
public void DateTimeTest() { EntityParent parent = new EntityParent(); Assert.IsFalse(string.IsNullOrEmpty(parent[EntityParent.DateTimePropertyPropertyName]), "Assert #1"); parent.DateTimeProperty = DateTime.Now; Assert.IsTrue(string.IsNullOrEmpty(parent[EntityParent.DateTimePropertyPropertyName]), "Assert #2"); }
public void ByteTest() { EntityParent parent = new EntityParent(); parent.ByteProperty = 8; Assert.IsFalse(string.IsNullOrEmpty(parent["ByteProperty"]), "Assert #1"); parent.ByteProperty = 21; Assert.IsFalse(string.IsNullOrEmpty(parent["ByteProperty"]), "Assert #2"); parent.ByteProperty = 11; Assert.IsFalse(string.IsNullOrEmpty(parent["ByteProperty"]), "Assert #3"); parent.ByteProperty = 15; Assert.IsTrue(string.IsNullOrEmpty(parent["ByteProperty"]), "Assert #4"); parent.ByteProperty = 18; Assert.IsTrue(string.IsNullOrEmpty(parent["ByteProperty"]), "Assert #5"); }
public void DecimalTest() { EntityParent parent = new EntityParent(); Assert.IsFalse(string.IsNullOrEmpty(parent[EntityParent.DecimalPropertyPropertyName]), "Assert #1"); parent.DecimalProperty = 5; Assert.IsFalse(string.IsNullOrEmpty(parent[EntityParent.DecimalPropertyPropertyName]), "Assert #2"); parent.DecimalProperty = -7; Assert.IsFalse(string.IsNullOrEmpty(parent[EntityParent.DecimalPropertyPropertyName]), "Assert #3"); parent.DecimalProperty = 13; Assert.IsFalse(string.IsNullOrEmpty(parent[EntityParent.DecimalPropertyPropertyName]), "Assert #4"); parent.DecimalProperty = -12; Assert.IsFalse(string.IsNullOrEmpty(parent[EntityParent.DecimalPropertyPropertyName]), "Assert #5"); parent.DecimalProperty = 2; Assert.IsTrue(string.IsNullOrEmpty(parent[EntityParent.DecimalPropertyPropertyName]), "Assert #6"); parent.DecimalProperty = -3; Assert.IsTrue(string.IsNullOrEmpty(parent[EntityParent.DecimalPropertyPropertyName]), "Assert #7"); }
// 进入该状态 public void Enter(EntityParent theOwner, params Object[] args) { theOwner.CurrentMotionState = MotionState.LOCKING; }
// 离开状态 public void Exit(EntityParent theOwner, params object[] args) { skill = null; this.curSkillId = 0; }
public static void HandleBuff(Buff buffData, EntityParent caster, EntityParent target, int fromSkillLevel) { LocalBattleBuffPropHandler.HandleBuff(buffData, caster, target, fromSkillLevel); LocalBattleProtocolSimulator.SendCloseRenderer(target.ID); }
public static void HandleBuff(Buff buffData, EntityParent caster, EntityParent target, int fromSkillID, int fromSkillLevel, XDict <GameData.AttrType, BattleSkillAttrAdd> fromSkillAttrChange, bool isCommunicateMix) { LocalBattleBuffDrainHandler.AppBuffDrain(buffData, caster, target, fromSkillID, fromSkillLevel, fromSkillAttrChange, isCommunicateMix); }
public override bool Proc(EntityParent theOwner) { //Mogo.Util.LoggerHelper.Debug("AI:" + "EnterCD:" + m_iSec); theOwner.ProcEnterCD(m_iSec);//kevintestcd return(true); }
// 离开状态 public void Exit(EntityParent theOwner, params System.Object[] args) { }
private void DestroyCurrentAttackChargeFx(EntityParent theOwner) { }
public override bool Proc(EntityParent theOwner) { //Mogo.Util.LoggerHelper.Debug("AI:" + "PowerFX"); return(theOwner.PowerFX()); }
public override bool Proc(EntityParent theOwner) { //Mogo.Util.LoggerHelper.Debug("AI:" + "SelectAutoFightMovePoint"); return(theOwner.ProcSelectAutoFightMovePoint()); }
public override bool Proc(EntityParent theOwner) { //Mogo.Util.LoggerHelper.Debug("AI:" + "MercenaryAOI"); return(theOwner.ProcMercenaryAOI()); }
public override bool Proc(EntityParent theOwner) { //Mogo.Util.LoggerHelper.Debug("AI:" + "Escape:" + m_iSec); theOwner.ProcEscape(m_iSec); return(true); }
public override bool Proc(EntityParent theOwner) { //Mogo.Util.LoggerHelper.Debug("AI:" + "ReinitLastCast"); theOwner.ProcReinitLastCast(); return(true); }
public override bool Proc(EntityParent theOwner) { //Mogo.Util.LoggerHelper.Debug("AI:" + "CastSpell:" + m_iSkillId); return(theOwner.ProcCastSpell(m_iSkillId, m_iReversal)); }
public void Process(EntityParent theOwner, params Object[] args) { //去除重力,浮空一段时间 }
protected static void OnHitYelling(EntityParent entity, int action) { AudioSource ownerSource = entity.audioSource; if (ownerSource == null) { return; } int ownerVocation = (int)entity.vocation; if (entity is EntityMonster) { ownerVocation = (int)((entity as EntityMonster).MonsterData.id); } else if (entity is EntityMercenary) { ownerVocation = (int)((entity as EntityMercenary).MonsterData.id); } else if (entity is EntityDummy) { ownerVocation = (int)((entity as EntityDummy).MonsterData.id); } ActionSoundData data = ActionSoundData.dataMap.FirstOrDefault(t => t.Value.vocation == ownerVocation && t.Value.action == action).Value; if (data == null) { return; } int sum = 0; foreach (var soundMessage in data.sound) { sum += soundMessage.Value; } int soundID = -1; int temp = RandomHelper.GetRandomInt(0, sum); foreach (var soundMessage in data.sound) { if (temp < soundMessage.Value) { soundID = soundMessage.Key; break; } temp -= soundMessage.Value; } if (soundID == -1) { return; } if (entity is EntityMyself) { MyselfLogicPlaySound(ownerSource, soundID); } else { LogicPlaySound(ownerSource, soundID); } }
public override bool Proc(EntityParent theOwner) { //Mogo.Util.LoggerHelper.Debug("AI:" + "Rest"); //theOwner.ProcRest(); return(false); }
public void TimeSpanTest() { EntityParent parent = new EntityParent(); Assert.IsFalse(string.IsNullOrEmpty(parent["TimeSpanProperty"]), "Assert #1"); parent.TimeSpanProperty = new TimeSpan(0, 0, 20000); Assert.IsTrue(string.IsNullOrEmpty(parent["TimeSpanProperty"]), "Assert #2"); parent.TimeSpanProperty = new TimeSpan(0, 0, 82000); Assert.IsFalse(string.IsNullOrEmpty(parent["TimeSpanProperty"]), "Assert #3"); }
public void Process(EntityParent theOwner, params Object[] args) { //不能受击 }
public override bool Proc(EntityParent theOwner) { //Mogo.Util.LoggerHelper.Debug("AI:" + "EnterThink"); theOwner.blackBoard.ChangeState(Mogo.AI.AIState.THINK_STATE); return(true); }
// 状态处理 public void Process(EntityParent theOwner, params System.Object[] args) { }
public void EntityRefTest() { EntityChild child = new EntityChild(); EntityParent parent = new EntityParent(); Assert.IsFalse(string.IsNullOrEmpty(child[EntityChild.ParentPropertyName]), "Assert #1"); Assert.IsFalse(string.IsNullOrEmpty(child[EntityChild.ParentIDPropertyName]), "Assert #2"); child.Parent = parent; Assert.IsTrue(string.IsNullOrEmpty(child[EntityChild.ParentPropertyName]), "Assert #3"); Assert.IsTrue(string.IsNullOrEmpty(child[EntityChild.ParentIDPropertyName]), "Assert #4"); parent.ID = Guid.NewGuid(); Assert.IsTrue(string.IsNullOrEmpty(child[EntityChild.ParentPropertyName]), "Assert #5"); Assert.IsTrue(string.IsNullOrEmpty(child[EntityChild.ParentIDPropertyName]), "Assert #6"); child.Parent = null; Assert.IsFalse(string.IsNullOrEmpty(child[EntityChild.ParentPropertyName]), "Assert #9"); Assert.IsFalse(string.IsNullOrEmpty(child[EntityChild.ParentIDPropertyName]), "Assert #10"); child = new EntityChild { ParentID = Guid.NewGuid() }; Assert.IsTrue(string.IsNullOrEmpty(child[EntityChild.ParentPropertyName]), "Assert #7"); Assert.IsTrue(string.IsNullOrEmpty(child[EntityChild.ParentIDPropertyName]), "Assert #8"); }
public override bool Proc(EntityParent theOwner) { //Mogo.Util.LoggerHelper.Debug("AI:" + "Think"); theOwner.ProcThink(); return(true); }
protected static void AppBuffDrain(Buff buffData, EntityParent caster, EntityParent target, int fromSkillID, int fromSkillLevel, XDict <GameData.AttrType, BattleSkillAttrAdd> fromSkillAttrChange, bool isCommunicateMix) { }
protected void HandleEffect(bool isRepeat, EffectMessage message) { EntityParent caster = message.caster; if (caster == null) { return; } if (caster.IsDead || !caster.IsFighting) { return; } Actor casterActor = message.casterActor; if (casterActor == null) { return; } Effect effectData = message.effectData; XPoint basePoint = message.basePoint; List <EffectTargetInfo> list = new List <EffectTargetInfo>(); switch (effectData.type1) { case 3: case 8: case 9: case 10: goto IL_484; } if (basePoint != null) { List <EntityParent> list2 = this.CheckCandidateByType(caster, casterActor, effectData.targetType, effectData.forcePickup == 1, effectData.antiaircraft); if (list2.get_Count() != 0) { Hashtable hashtable = this.CheckCandidatesByEffectShape(list2, ContainerGear.containers.Values, casterActor, basePoint, effectData); if (hashtable.get_Count() != 0) { List <EntityParent> list3 = hashtable.get_Item("Entity") as List <EntityParent>; List <ContainerGear> list4 = hashtable.get_Item("Container") as List <ContainerGear>; if (list3.get_Count() > 0) { List <float> list5 = new List <float>(); for (int i = 0; i < list3.get_Count(); i++) { if (!SystemConfig.IsEffectOn) { break; } if (list3.get_Item(i) != null) { if (list3.get_Item(i).Actor) { list.Add(new EffectTargetInfo { targetId = list3.get_Item(i).ID }); if (caster.IsEntitySelfType && (effectData.type1 == 1 || effectData.type1 == 5 || effectData.type1 == 11)) { BattleBlackboard.Instance.ContinueCombo = true; } AvatarModel avatarModel = DataReader <AvatarModel> .Get(list3.get_Item(i).FixModelID); if ((!isRepeat || effectData.cycleHit != 0) && (!list3.get_Item(i).IsUnconspicuous || effectData.forcePickup != 0) && effectData.hitFx != 0) { if (casterActor is ActorParent) { list3.get_Item(i).Actor.PlayHitFx((casterActor as ActorParent).FixTransform, effectData.hitFx, avatarModel.undAtkFxScale, avatarModel.undAtkFxOffset); } else { list3.get_Item(i).Actor.PlayHitFx(casterActor.get_transform(), effectData.hitFx, avatarModel.undAtkFxScale, avatarModel.undAtkFxOffset); } } if (InstanceManager.IsServerBattle) { list3.get_Item(i).Actor.PlayHitSound(effectData.hitAudio); } list5.Add(avatarModel.frameRatio); } } } if (!isRepeat) { if ((message.caster.IsEntitySelfType || message.caster.OwnerID == EntityWorld.Instance.EntSelf.ID || message.caster.IsEntityMonsterType) && effectData.cameraRelyPickup == 1) { for (int j = 0; j < message.effectData.cameraEffect.get_Count(); j++) { int cameraEffectID = message.effectData.cameraEffect.get_Item(j); this.effectCameraTimerList.Add(TimerHeap.AddTimer((uint)(20 * j), 0, delegate { this.HandleCameraEffect(cameraEffectID); })); } } list5.Sort(); CommandCenter.ExecuteCommand(casterActor.get_transform(), new FrozeFrameCmd { count = list3.get_Count(), rate = effectData.frameFroze, time = effectData.frameTime, timeRateList = list5, interval = effectData.frameInterval, callback = null }); } } if (list4.get_Count() > 0 && effectData.type1 == 1 && effectData.targetType == 1) { for (int k = 0; k < list4.get_Count(); k++) { list4.get_Item(k).OnHit(effectData.id); } } if (casterActor is ActorFX && (list3.get_Count() > 0 || list4.get_Count() > 0)) { (casterActor as ActorFX).bulletLife--; } } } } IL_484: if (isRepeat) { GlobalBattleNetwork.Instance.SendUpdateEffect(message.caster.ID, (message.skillData != null) ? message.skillData.id : 0, message.effectData.id, list, message.UID, message.basePoint, message.isClientHandle); } else { GlobalBattleNetwork.Instance.SendAddEffect(message.caster.ID, (message.skillData != null) ? message.skillData.id : 0, message.effectData.id, list, message.UID, message.basePoint, message.isClientHandle); } }
public static void IntervalBuff(Buff buffData, EntityParent caster, EntityParent target, int fromSkillLevel) { LocalBattleBuffPropHandler.IntervalBuff(buffData, caster, target, fromSkillLevel); }
protected List <EntityParent> CheckCandidateByType(EntityParent owner, Actor ownerActor, int targetType, bool isIgnoreUnconspicuous, int altitude) { List <EntityParent> list = new List <EntityParent>(); if (owner == null) { return(list); } if (ownerActor == null) { return(list); } switch (targetType) { case 1: EntityWorld.Instance.GetAllEffectTarget(owner, isIgnoreUnconspicuous, altitude, owner.Camp, false, false, list); break; case 2: EntityWorld.Instance.GetAllEffectTarget(owner, isIgnoreUnconspicuous, altitude, owner.Camp, true, false, list); break; case 3: list.Add(owner); break; case 4: EntityWorld.Instance.GetAllEffectTarget(owner, isIgnoreUnconspicuous, altitude, owner.Camp, true, true, list); break; case 5: if (EntityWorld.Instance.StateFilter <EntityParent>(owner.Owner, isIgnoreUnconspicuous) && EntityWorld.Instance.AltitudeFilter <EntityParent>(owner.Owner, altitude)) { list.Add(owner.Owner); } break; case 6: EntityWorld.Instance.GetAllEffectTarget(owner, isIgnoreUnconspicuous, altitude, -1, false, true, list); break; case 7: { List <EntityParent> values = EntityWorld.Instance.GetEntities <EntityPet>().Values; for (int i = 0; i < values.get_Count(); i++) { if (values.get_Item(i).OwnerID == owner.ID && EntityWorld.Instance.StateFilter <EntityParent>(values.get_Item(i), isIgnoreUnconspicuous) && EntityWorld.Instance.AltitudeFilter <EntityParent>(values.get_Item(i), altitude)) { list.Add(values.get_Item(i)); } } break; } case 8: if (owner.DamageSource != null && owner.DamageSource.Actor && EntityWorld.Instance.StateFilter <EntityParent>(owner.DamageSource, isIgnoreUnconspicuous) && EntityWorld.Instance.AltitudeFilter <EntityParent>(owner.DamageSource, altitude)) { list.Add(owner.DamageSource); } break; case 9: if (EntityWorld.Instance.StateFilter <EntitySelf>(EntityWorld.Instance.EntSelf, isIgnoreUnconspicuous) && EntityWorld.Instance.AltitudeFilter <EntitySelf>(EntityWorld.Instance.EntSelf, altitude)) { list.Add(EntityWorld.Instance.EntSelf); } break; case 10: { List <EntityParent> values2 = EntityWorld.Instance.GetEntities <EntityMonster>().Values; for (int j = 0; j < values2.get_Count(); j++) { if (values2.get_Item(j).IsLogicBoss&& EntityWorld.Instance.StateFilter <EntityParent>(values2.get_Item(j), isIgnoreUnconspicuous) && EntityWorld.Instance.AltitudeFilter <EntityParent>(values2.get_Item(j), altitude)) { list.Add(values2.get_Item(j)); } } break; } case 11: { List <EntityParent> values3 = EntityWorld.Instance.GetEntities <EntityMonster>().Values; for (int k = 0; k < values3.get_Count(); k++) { if (values3.get_Item(k).IsBuffEntity&& EntityWorld.Instance.StateFilter <EntityParent>(values3.get_Item(k), isIgnoreUnconspicuous) && EntityWorld.Instance.AltitudeFilter <EntityParent>(values3.get_Item(k), altitude)) { list.Add(values3.get_Item(k)); } } break; } } return(list); }
/// <summary> /// 进入该状态 /// </summary> /// <param name="theOwner"></param> /// <param name="args"></param> public void Enter(EntityParent theOwner, params object[] args) { theOwner.CurrentMotionState = MotionState.ReleaseSkill; }
public void NotNullInNullableTest() { EntityParent parent = new EntityParent(); Assert.IsFalse(string.IsNullOrEmpty(parent["NotNullIntProperty"]), "Assert #1"); Assert.IsFalse(string.IsNullOrEmpty(parent["NotNullDeciamlProperty"]), "Assert #2"); Assert.IsFalse(string.IsNullOrEmpty(parent["NotNullDateTimeProperty"]), "Assert #3"); Assert.IsFalse(string.IsNullOrEmpty(parent["NotNullBoolProperty"]), "Assert #4"); Assert.IsFalse(string.IsNullOrEmpty(parent["NotNullCharProperty"]), "Assert #5"); Assert.IsFalse(string.IsNullOrEmpty(parent["NotNullInNullableByteProperty"]), "Assert 11"); parent.NotNullIntProperty = 0; parent.NotNullDeciamlProperty = 0; parent.NotNullDateTimeProperty = DateTime.Now; parent.NotNullBoolProperty = false; parent.NotNullCharProperty = 'a'; parent.NotNullInNullableByteProperty = 54; Assert.IsTrue(string.IsNullOrEmpty(parent["NotNullIntProperty"]), "Assert #6"); Assert.IsTrue(string.IsNullOrEmpty(parent["NotNullDeciamlProperty"]), "Assert #7"); Assert.IsTrue(string.IsNullOrEmpty(parent["NotNullDateTimeProperty"]), "Assert #8"); Assert.IsTrue(string.IsNullOrEmpty(parent["NotNullBoolProperty"]), "Assert #9"); Assert.IsTrue(string.IsNullOrEmpty(parent["NotNullCharProperty"]), "Assert #10"); Assert.IsTrue(string.IsNullOrEmpty(parent["NotNullInNullableByteProperty"]), "Assert 12"); }
public void Execute(EntityParent theOwner) { }
public void NullableEntityRefTest() { EntityChild child = new EntityChild(); EntityParent parent = new EntityParent(); Assert.IsTrue(string.IsNullOrEmpty(child[EntityChild.NullableParentPropertyName]), "Assert #1"); Assert.IsTrue(string.IsNullOrEmpty(child[EntityChild.NullableParentIDPropertyName]), "Assert #2"); child.NullableParent = parent; Assert.IsTrue(string.IsNullOrEmpty(child[EntityChild.NullableParentPropertyName]), "Assert #3"); Assert.IsTrue(string.IsNullOrEmpty(child[EntityChild.NullableParentIDPropertyName]), "Assert #4"); child.Parent = null; Assert.IsTrue(string.IsNullOrEmpty(child[EntityChild.NullableParentPropertyName]), "Assert #5"); Assert.IsTrue(string.IsNullOrEmpty(child[EntityChild.NullableParentIDPropertyName]), "Assert #6"); }
private UIFilledSprite m_fsInfoBillboardAnger; // 怒气条 public PlayerHead(uint id, Transform trans, Action <PlayerHead, uint, Transform, EntityParent> OnFinished, EntityParent self, bool showBlood, HeadBloodColor bloodColor = HeadBloodColor.Red, bool showAnger = false) { AssetCacheMgr.GetUIInstance("InfoBillboard.prefab", (prefab, guid, go) => { m_billboard = (GameObject)go; m_billboard.name = id.ToString(); m_goBillboardBlood = m_billboard.transform.Find("InfoBillboardBlood").gameObject; m_goBillboardAnger = m_billboard.transform.Find("InfoBillboardAnger").gameObject; ShowBillboardBlood(showBlood); SetBillboardBloodColor(bloodColor); ShowBillboardAnger(showAnger); blood = m_billboard.transform.Find("InfoBillboardBlood/InfoBillboardBloodFG").GetComponentInChildren <UIFilledSprite>(); name = m_billboard.transform.Find("InfoBillboardName").GetComponentInChildren <UILabel>(); tong = m_billboard.transform.Find("InfoBillboardTong").GetComponentInChildren <UILabel>(); testInfo = m_billboard.transform.Find("InfoBillboardTestInfo").GetComponentsInChildren <UILabel>(true)[0]; bar = m_billboard.transform.Find("InfoBillboardBlood/InfoBillboardBloodFG").GetComponentInChildren <UIFilledSprite>(); bg = m_billboard.transform.Find("InfoBillboardBlood/InfoBillboardBloodBG0").GetComponentInChildren <UISprite>(); m_bloodAnim = m_billboard.transform.Find("InfoBillboardBlood").GetComponentsInChildren <MogoBloodAnim>(true)[0]; m_fsInfoBillboardAnger = m_billboard.transform.Find("InfoBillboardAnger/InfoBillboardAngerFG").GetComponentInChildren <UIFilledSprite>(); OnFinished(this, id, trans, self); }); }
public void SimpleStringTest() { EntityParent parent = new EntityParent(); Assert.IsFalse(string.IsNullOrEmpty(parent["SimpleStringProperty"]), "Assert #1"); parent.SimpleStringProperty = "123456"; Assert.IsTrue(string.IsNullOrEmpty(parent["SimpleStringProperty"]), "Assert #2"); parent.SimpleStringProperty = null; Assert.IsFalse(string.IsNullOrEmpty(parent["SimpleStringProperty"]), "Assert #3"); parent.SimpleStringProperty = string.Empty; Assert.IsFalse(string.IsNullOrEmpty(parent["SimpleStringProperty"]), "Assert #4"); }
public void Enter(EntityParent theOwner, params Object[] args) { }
public void StringTest() { EntityParent parent = new EntityParent(); Assert.IsFalse(string.IsNullOrEmpty(parent[EntityParent.StringPropertyPropertyName]), "Assert #1"); parent.StringProperty = "123456"; Assert.IsFalse(string.IsNullOrEmpty(parent[EntityParent.StringPropertyPropertyName]), "Assert #2"); parent.StringProperty = "12345"; Assert.IsFalse(string.IsNullOrEmpty(parent[EntityParent.StringPropertyPropertyName]), "Assert #3"); parent.StringProperty = "666"; Assert.IsTrue(string.IsNullOrEmpty(parent[EntityParent.StringPropertyPropertyName]), "Assert #4"); parent.StringProperty = "777"; Assert.IsTrue(string.IsNullOrEmpty(parent[EntityParent.StringPropertyPropertyName]), "Assert #5"); parent.StringProperty = null; Assert.IsFalse(string.IsNullOrEmpty(parent[EntityParent.StringPropertyPropertyName]), "Assert #6"); parent.StringProperty = string.Empty; Assert.IsFalse(string.IsNullOrEmpty(parent[EntityParent.StringPropertyPropertyName]), "Assert #7"); }
protected virtual bool InRange(EntityParent entity) { return(entity != null && entity.Actor && XUtility.DistanceNoY(base.get_transform().get_position(), entity.Actor.FixTransform.get_position()) <= this.range); }
private int CalcDamage(EntityParent entity, float percentage, int damageMin, int damageMax) { return((int)(entity.hp * percentage + RandomHelper.GetRandomInt(damageMin, damageMax))); }