public void PartyCastSpell(ETarget wizard, TestSpell spell) { m_LastSpellIsMonster = false; m_LastSpell = spell; m_TargetOrWizard = wizard; if (!String.IsNullOrEmpty(spell.EffectPath)) { FXQueue fxqueue = Helper.ResourcesLoad <FXQueue>(spell.EffectPath, false); if (fxqueue != null && m_ActiveMonster != null) { if (wizard == ETarget.Party) { wizard = (ETarget)UnityEngine.Random.Range(1, 4); } GameObject gameObject; switch (wizard) { case ETarget.Member1: gameObject = m_Member1; break; case ETarget.Member2: gameObject = m_Member2; break; case ETarget.Member3: gameObject = m_Member3; break; case ETarget.Member4: gameObject = m_Member4; break; default: return; } Vector3 forward = m_Party.transform.forward; Vector3 p_slotLeft = -m_Party.transform.right; ETargetType targetType = spell.TargetType; FXArgs args; if ((targetType & ETargetType.PARTY) == ETargetType.PARTY) { args = new FXArgs(m_PartySlot, m_PartySlot, m_PartySlot, m_PartySlot, m_PartySlot.transform.position, forward, p_slotLeft, m_PartySlot.transform.position, new List <GameObject> { m_PartySlot }); } else if ((targetType & ETargetType.LINE_OF_SIGHT) == ETargetType.LINE_OF_SIGHT) { args = new FXArgs(m_PartySlot, m_MonsterSlot, m_PartySlot, m_MonsterSlot, m_PartySlot.transform.position, forward, p_slotLeft, m_MonsterSlot.transform.position, new List <GameObject> { m_ActiveMonster }); } else if ((targetType & ETargetType.MULTY) == ETargetType.MULTY) { args = new FXArgs(gameObject, m_MonsterSlot, gameObject, m_MonsterSlot, m_PartySlot.transform.position, forward, p_slotLeft, m_MonsterSlot.transform.position, new List <GameObject> { m_ActiveMonster }); } else if ((targetType & ETargetType.SINGLE) == ETargetType.SINGLE) { FXTags component = m_ActiveMonster.GetComponent <FXTags>(); GameObject p_endPoint = m_ActiveMonster; if (component != null) { p_endPoint = component.FindOne("HitSpot"); } else { Debug.LogError("FXTags not found!!\nTarget=" + m_ActiveMonster, m_ActiveMonster); } args = new FXArgs(gameObject, m_MonsterSlot, gameObject, p_endPoint, m_PartySlot.transform.position, forward, p_slotLeft, m_MonsterSlot.transform.position, new List <GameObject> { m_ActiveMonster }); } else if ((targetType & ETargetType.ADJACENT) == ETargetType.ADJACENT) { args = new FXArgs(gameObject, m_PartySlot, gameObject, m_PartySlot, m_PartySlot.transform.position, forward, p_slotLeft, m_MonsterSlot.transform.position, new List <GameObject> { m_ActiveMonster }); } else { Debug.LogError("error !! spellType: " + targetType); args = new FXArgs(gameObject, m_ActiveMonster, gameObject, m_ActiveMonster, m_PartySlot.transform.position, forward, p_slotLeft, m_MonsterSlot.transform.position, new List <GameObject> { m_ActiveMonster }); } FXQueue fxqueue2 = Helper.Instantiate <FXQueue>(fxqueue); fxqueue2.Finished += delegate(Object sender, EventArgs e) { m_ActiveMonsterAnimationHandler.Hit(); }; fxqueue2.Execute(args); } else { Debug.LogError("SpellEffect not found! " + spell.EffectPath); } } PartyCastBuff(spell); MonsterCastBuff(spell); }
private void TabMonsterAnimation() { if (m_Main.ActiveMonsterAnimationHandler != null) { Int32 attackMagicMaxValue = m_Anim.AttackMagicMaxValue; Int32 attackMeleeMaxValue = m_Anim.AttackMeleeMaxValue; Int32 attackRangedMaxValue = m_Anim.AttackRangedMaxValue; Int32 attackCriticalMeleeMaxValue = m_Anim.AttackCriticalMeleeMaxValue; Int32 idleMaxValue = m_Anim.IdleMaxValue; Int32 evadeMaxValue = m_Anim.EvadeMaxValue; Int32 blockMaxValue = m_Anim.BlockMaxValue; Int32 hitMaxValue = m_Anim.HitMaxValue; Int32 dieMaxValue = m_Anim.DieMaxValue; Int32 eventMaxValue = m_Anim.EventMaxValue; m_IdleRota = GUILayout.Toggle(m_IdleRota, "Switch On/Off Idle Rota", new GUILayoutOption[0]); if (!m_IdleRota) { m_Main.ActiveMonsterView.NumberOfIdleAnimations = 0; } else { m_Main.ActiveMonsterView.NumberOfIdleAnimations = idleMaxValue; } m_Anim.InCombat = GUILayout.Toggle(m_Anim.InCombat, "InCombat", new GUILayoutOption[0]); GUILayout.Label("Attack Animations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); for (Int32 i = 1; i <= attackMeleeMaxValue; i++) { if (GUILayout.Button("#" + i, new GUILayoutOption[0])) { m_Anim.Attack(i); } } GUILayout.EndHorizontal(); GUILayout.Label("AttackCritical Animations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); for (Int32 j = 1; j <= attackCriticalMeleeMaxValue; j++) { if (GUILayout.Button("#" + j, new GUILayoutOption[0])) { m_Anim.AttackCritical(j); } } GUILayout.EndHorizontal(); GUILayout.Label("RangedAttack Animations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); for (Int32 k = 1; k <= attackRangedMaxValue; k++) { if (GUILayout.Button("#" + k, new GUILayoutOption[0])) { m_Anim.AttackRange(k); } } GUILayout.EndHorizontal(); GUILayout.Label("Idle Animations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); for (Int32 l = 1; l <= idleMaxValue; l++) { if (GUILayout.Button("#" + l, new GUILayoutOption[0])) { m_Anim.IdleSpecial(l); } } GUILayout.EndHorizontal(); GUILayout.Label("Evade Animations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); for (Int32 m = 1; m <= evadeMaxValue; m++) { if (GUILayout.Button("#" + m, new GUILayoutOption[0])) { m_Anim.Evade(m); } } GUILayout.EndHorizontal(); GUILayout.Label("Hit Animations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); for (Int32 n = 1; n <= hitMaxValue; n++) { if (GUILayout.Button("#" + n, new GUILayoutOption[0])) { m_Anim.Hit(n); } } GUILayout.EndHorizontal(); GUILayout.Label("Event Animations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); for (Int32 num = 2; num <= eventMaxValue; num++) { if (GUILayout.Button("#" + (num - 1), new GUILayoutOption[0])) { m_Anim.EventSummon(num); } } GUILayout.EndHorizontal(); GUILayout.Label("Block Animations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); for (Int32 num2 = 1; num2 <= blockMaxValue; num2++) { if (GUILayout.Button("#" + num2, new GUILayoutOption[0])) { m_Anim.Block(num2); } } GUILayout.EndHorizontal(); GUILayout.Label("MagicAttackAnimations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); for (Int32 num3 = 1; num3 <= attackMagicMaxValue; num3++) { if (GUILayout.Button("#" + num3, new GUILayoutOption[0])) { m_Anim.AttackMagic(num3); } } GUILayout.EndHorizontal(); GUILayout.Label("Die Animations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); for (Int32 num4 = 1; num4 <= dieMaxValue; num4++) { if (GUILayout.Button("#" + num4, new GUILayoutOption[0])) { m_Anim.Die(num4); } } GUILayout.EndHorizontal(); GUILayout.Label("Movement/Turn Animations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); if (GUILayout.Button("StartPosition", new GUILayoutOption[0])) { m_Anim.MoveTo(transform.position, transform.rotation); } if (GUILayout.Button("LeftPosition", new GUILayoutOption[0])) { Vector3 position = new Vector3(10f, 0f, 0f); m_Anim.MoveTo(position, transform.rotation); } if (GUILayout.Button("RightPosition", new GUILayoutOption[0])) { Vector3 position2 = new Vector3(-10f, 0f, 0f); m_Anim.MoveTo(position2, transform.rotation); } if (GUILayout.Button("BackPosition", new GUILayoutOption[0])) { Vector3 position3 = new Vector3(0f, 0f, -10f); m_Anim.MoveTo(position3, transform.rotation); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(new GUILayoutOption[0]); if (GUILayout.Button("Rotate Left", new GUILayoutOption[0])) { m_MonsterRotation = m_Main.ActiveMonster.transform.rotation; m_Degree = RotationValueHandler(-90f); m_MonsterRotation = Quaternion.Euler(0f, m_Degree, 0f); m_Anim.RotateTo(m_MonsterRotation); } if (GUILayout.Button("Rotate Right", new GUILayoutOption[0])) { m_MonsterRotation = m_Main.ActiveMonster.transform.rotation; m_Degree = RotationValueHandler(90f); m_MonsterRotation = Quaternion.Euler(0f, m_Degree, 0f); m_Anim.RotateTo(m_MonsterRotation); } GUILayout.EndHorizontal(); } }
private void DrawWindow(Int32 id) { Time.timeScale = timescale; Application.targetFrameRate = targetframerate; if (m_Anim != null) { Int32 attackMagicMaxValue = m_Anim.AttackMagicMaxValue; Int32 attackMeleeMaxValue = m_Anim.AttackMeleeMaxValue; Int32 attackRangedMaxValue = m_Anim.AttackRangedMaxValue; Int32 attackCriticalMeleeMaxValue = m_Anim.AttackCriticalMeleeMaxValue; Int32 idleMaxValue = m_Anim.IdleMaxValue; Int32 evadeMaxValue = m_Anim.EvadeMaxValue; Int32 blockMaxValue = m_Anim.BlockMaxValue; Int32 hitMaxValue = m_Anim.HitMaxValue; Int32 dieMaxValue = m_Anim.DieMaxValue; Int32 eventMaxValue = m_Anim.EventMaxValue; m_Anim.InCombat = GUILayout.Toggle(m_Anim.InCombat, "InCombat", new GUILayoutOption[0]); GUILayout.Label("Attack Animations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); for (Int32 i = 1; i <= attackMeleeMaxValue; i++) { if (GUILayout.Button("#" + i, new GUILayoutOption[0])) { m_Anim.Attack(i); } } GUILayout.EndHorizontal(); GUILayout.Label("AttackCritical Animations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); for (Int32 j = 1; j <= attackCriticalMeleeMaxValue; j++) { if (GUILayout.Button("#" + j, new GUILayoutOption[0])) { m_Anim.AttackCritical(j); } } GUILayout.EndHorizontal(); GUILayout.Label("RangedAttack Animations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); for (Int32 k = 1; k <= attackRangedMaxValue; k++) { if (GUILayout.Button("#" + k, new GUILayoutOption[0])) { m_Anim.AttackRange(k); } } GUILayout.EndHorizontal(); GUILayout.Label("Idle Animations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); for (Int32 l = 1; l <= idleMaxValue; l++) { if (GUILayout.Button("#" + l, new GUILayoutOption[0])) { m_Anim.IdleSpecial(l); } } GUILayout.EndHorizontal(); GUILayout.Label("Evade Animations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); for (Int32 m = 1; m <= evadeMaxValue; m++) { if (GUILayout.Button("#" + m, new GUILayoutOption[0])) { m_Anim.Evade(m); } } GUILayout.EndHorizontal(); GUILayout.Label("Hit Animations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); for (Int32 n = 1; n <= hitMaxValue; n++) { if (GUILayout.Button("#" + n, new GUILayoutOption[0])) { m_Anim.Hit(n); } } GUILayout.EndHorizontal(); GUILayout.Label("Event Animations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); for (Int32 num = 2; num <= eventMaxValue; num++) { if (GUILayout.Button("#" + (num - 1), new GUILayoutOption[0])) { m_Anim.EventSummon(num); } } GUILayout.EndHorizontal(); GUILayout.Label("Block Animations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); for (Int32 num2 = 1; num2 <= blockMaxValue; num2++) { if (GUILayout.Button("#" + num2, new GUILayoutOption[0])) { m_Anim.Block(num2); } } GUILayout.EndHorizontal(); GUILayout.Label("MagicAttackAnimations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); for (Int32 num3 = 1; num3 <= attackMagicMaxValue; num3++) { if (GUILayout.Button("#" + num3, new GUILayoutOption[0])) { m_Anim.AttackMagic(num3); } } GUILayout.EndHorizontal(); GUILayout.Label("Die Animations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); for (Int32 num4 = 1; num4 <= dieMaxValue; num4++) { if (GUILayout.Button("#" + num4, new GUILayoutOption[0])) { m_Anim.Die(num4); } } GUILayout.EndHorizontal(); GUILayout.Label("Movement/Turn Animations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); if (GUILayout.Button("StartPosition", new GUILayoutOption[0])) { Quaternion lookDirection = Quaternion.Euler(0f, 0f, 0f); Vector3 position = new Vector3(0f, 0f, 0f); m_Anim.MoveTo(position, lookDirection); } if (GUILayout.Button("LeftPosition", new GUILayoutOption[0])) { Vector3 position2 = new Vector3(20f, 0f, 0f); m_Anim.MoveTo(position2, transform.rotation); } if (GUILayout.Button("RightPosition", new GUILayoutOption[0])) { Vector3 position3 = new Vector3(-10f, 0f, 0f); m_Anim.MoveTo(position3, transform.rotation); } if (GUILayout.Button("BackPosition", new GUILayoutOption[0])) { Vector3 position4 = new Vector3(0f, 0f, -10f); m_Anim.MoveTo(position4, transform.rotation); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(new GUILayoutOption[0]); if (GUILayout.Button("Rotate Left", new GUILayoutOption[0])) { m_MonsterRotation = transform.rotation; m_Degree = RotationValueHandler(-90f); m_MonsterRotation = Quaternion.Euler(0f, m_Degree, 0f); m_Anim.RotateTo(m_MonsterRotation); } if (GUILayout.Button("Rotate Right", new GUILayoutOption[0])) { m_MonsterRotation = transform.rotation; m_Degree = RotationValueHandler(90f); m_MonsterRotation = Quaternion.Euler(0f, m_Degree, 0f); m_Anim.RotateTo(m_MonsterRotation); } GUILayout.EndHorizontal(); GUILayout.Label("IsMoving: " + m_Anim.IsMoving, new GUILayoutOption[0]); GUILayout.Label("IsRotating: " + m_Anim.IsRotating, new GUILayoutOption[0]); GUILayout.Label("InMovement: " + m_Anim.InMovement, new GUILayoutOption[0]); GUILayout.Label("IsDead: " + m_Anim.IsDead, new GUILayoutOption[0]); GUILayout.Label("InCombat: " + m_Anim.InCombat, new GUILayoutOption[0]); } }
private void TakeHit(Object p_sender, EventArgs p_args, Boolean p_isRanged) { Int32 tagHash = m_animator.GetCurrentAnimatorStateInfo(0).tagHash; Int32 tagHash2 = m_animator.GetNextAnimatorStateInfo(0).tagHash; Int32 num = Animator.StringToHash("ATTACK"); Int32 num2 = Animator.StringToHash("DIE"); Boolean flag = true; Boolean flag2 = false; if (p_args is AttacksEventArgs) { AttacksEventArgs attacksEventArgs = (AttacksEventArgs)p_args; foreach (AttacksEventArgs.AttackedTarget attackedTarget in attacksEventArgs.Attacks) { if (attackedTarget.AttackTarget == MyController) { AttackResult attackResult = attackedTarget.AttackResult; if (flag) { flag = false; ((Monster)MyController).HitAnimationDone.Trigger(); FlushMonsterLogEntries(); DelayedEventManager.InvokeEvent(EDelayType.ON_FX_FINISH, (!p_isRanged) ? EEventType.CHARACTER_ATTACKS : EEventType.CHARACTER_ATTACKS_RANGED, p_sender, p_args); if (attackedTarget.AttackResult.DamageDone > 0 && num2 != tagHash && num2 != tagHash2 && num != tagHash && num != tagHash2) { m_animatorControl.Hit(); } PlayTakeHitSound(p_sender, attackResult, p_isRanged); } if (!flag2 && attacksEventArgs.PushToParty) { flag2 = true; m_MainView.PushEntityToPosition(); } foreach (AttacksEventArgs.AttackedTarget attackedTarget2 in attacksEventArgs.Attacks) { if (attackedTarget2.AttackTarget != null && attackedTarget2.AttackTarget == MyController) { Monster monster = (Monster)MyController; monster.CombatHandler.CheckCounterAttack((Character)p_sender); List <CombatEntryEventArgs> counterLogEntries = monster.CombatHandler.CounterLogEntries; if (counterLogEntries.Count > 0) { foreach (CombatEntryEventArgs p_args2 in counterLogEntries) { LegacyLogic.Instance.ActionLog.PushEntry(p_args2); if (LegacyLogic.Instance.WorldManager.Party.Buffs.HasBuff(EPartyBuffs.CELESTIAL_ARMOR)) { if (LegacyLogic.Instance.WorldManager.Party.Buffs.GetBuff(EPartyBuffs.CELESTIAL_ARMOR).IsExpired()) { LegacyLogic.Instance.WorldManager.Party.Buffs.RemoveBuff(EPartyBuffs.CELESTIAL_ARMOR); } LegacyLogic.Instance.WorldManager.Party.Buffs.FlushActionLog(); } ((Character)p_sender).ConditionHandler.FlushActionLog(); ((Character)p_sender).ConditionHandler.FlushDelayedActionLog(); } } counterLogEntries.Clear(); } } if (attackResult.ReflectedDamage != null && attackResult.ReflectedDamage.Damages.Count > 0 && MyController is Monster && (!p_isRanged || (p_isRanged && ((Monster)MyController).DistanceToParty < 1.1f))) { ((Monster)MyController).AbilityHandler.FlushActionLog(EExecutionPhase.ON_CHARACTER_ATTACKS_MONSTER_AFTER_DAMAGE_REDUCTION); AttackResult attackResult2 = ((Character)p_sender).FightHandler.AttackEntity(attackResult.ReflectedDamage, true, EDamageType.PHYSICAL, true, 0, false); ((Character)p_sender).ApplyDamages(attackResult2, (Monster)MyController); Object p_source = (attackResult2.ReflectedDamageSource != null) ? attackResult2.ReflectedDamageSource : MyController; CombatEntryEventArgs p_args3 = new CombatEntryEventArgs(p_source, p_sender, attackResult2, null); LegacyLogic.Instance.ActionLog.PushEntry(p_args3); DelayedEventManager.InvokeEvent(EDelayType.ON_FX_FINISH, EEventType.REFLECTED_MAGIC_DAMAGE, p_sender, new AttacksEventArgs(false) { Attacks = { new AttacksEventArgs.AttackedTarget(p_sender, attackResult2) } }); } this.SendEvent("OnReceivedAttacks", new AttacksUnityEventArgs(this, attackResult, false)); } } } else if (p_args is SpellEventArgs) { SpellEventArgs spellEventArgs = (SpellEventArgs)p_args; foreach (AttackedTarget attackedTarget3 in spellEventArgs.SpellTargetsOfType <AttackedTarget>()) { if (attackedTarget3.Target == MyController) { if (flag) { flag = false; TakeHitDoFinishBySpell(p_sender, p_args); if (attackedTarget3.Result.DamageDone > 0 && num2 != tagHash && num2 != tagHash2 && num != tagHash && num != tagHash2) { m_animatorControl.Hit(); } } if (attackedTarget3.Result.ReflectedDamage != null && attackedTarget3.Result.ReflectedDamage.Damages.Count > 0 && MyController is Monster && (!p_isRanged || (p_isRanged && ((Monster)MyController).DistanceToParty < 1.1f))) { ((Monster)MyController).AbilityHandler.FlushActionLog(EExecutionPhase.ON_CHARACTER_ATTACKS_MONSTER_AFTER_DAMAGE_REDUCTION); AttackResult attackResult3 = ((Character)p_sender).FightHandler.AttackEntity(attackedTarget3.Result.ReflectedDamage, true, EDamageType.PHYSICAL, true, 0, false); ((Character)p_sender).ApplyDamages(attackResult3, (Monster)MyController); Object p_source2 = (attackResult3.ReflectedDamageSource != null) ? attackResult3.ReflectedDamageSource : MyController; CombatEntryEventArgs p_args4 = new CombatEntryEventArgs(p_source2, p_sender, attackResult3, null); LegacyLogic.Instance.ActionLog.PushEntry(p_args4); DelayedEventManager.InvokeEvent(EDelayType.ON_FX_FINISH, EEventType.REFLECTED_MAGIC_DAMAGE, p_sender, new AttacksEventArgs(false) { Attacks = { new AttacksEventArgs.AttackedTarget(p_sender, attackResult3) } }); } this.SendEvent("OnReceivedAttacks", new AttacksUnityEventArgs(this, attackedTarget3.Result, spellEventArgs.DamageType != EDamageType.PHYSICAL)); } } foreach (PushedTarget pushedTarget in spellEventArgs.SpellTargetsOfType <PushedTarget>()) { if (pushedTarget.Target == MyController) { m_MainView.PushEntityToPosition(); } } foreach (MonsterBuffTarget monsterBuffTarget in spellEventArgs.SpellTargetsOfType <MonsterBuffTarget>()) { if (flag && monsterBuffTarget.Target == MyController) { flag = false; TakeHitDoFinishBySpell(p_sender, p_args); } } } }