public void SendDamage() { Character[] enemys = Object.FindObjectsOfType <Character>(); float damage = PlayerUtil.CalculatingCardPowerValue(80f); if (enemys == null) { return; } foreach (var e in enemys) { if (e == Owner) { continue; } float angle = Mathf.Acos(Vector3.Dot((e.transform.position - Owner.transform.position).normalized, Owner.transform.forward)) * Mathf.Rad2Deg; if ((Owner.transform.position - e.transform.position).magnitude <= Isometric.IsometricTileSize.x * 1.8f && angle < 80f) { e.AddNotifyEvent(new CharacterNotifyEvent(CharacterNotifyType.E_Damage, damage)); IsoParticle.CreateParticle("Sliced_Power1", e.transform.position + new Vector3(0f, Isometric.IsometricTileSize.y * 0.5f, 0f), angle); IsoParticle.CreateParticle("Sliced_Power2", e.transform.position + new Vector3(0f, Isometric.IsometricTileSize.y * 0.5f, 0f), angle + 90f); } } PlayerUtil.ConsumeCardPowerUpStatus(); }
public void SendDamage() { Character[] enemys = Object.FindObjectsOfType <Character>(); if (enemys == null) { return; } foreach (var e in enemys) { if (e == Owner) { continue; } float angle = Mathf.Acos(Vector3.Dot((e.transform.position - Owner.transform.position).normalized, Owner.transform.forward)) * Mathf.Rad2Deg; if ((Owner.transform.position - e.transform.position).magnitude <= Isometric.IsometricTileSize.x * 2.5f && angle < 30f) { e.AddNotifyEvent(new CharacterNotifyEvent(CharacterNotifyType.E_Damage, 30f)); IsoParticle.CreateParticle("Sliced1", e.transform.position + new Vector3(0f, Isometric.IsometricTileSize.y * 0.5f, 0f), angle); IsoParticle.CreateParticle("Sliced2", e.transform.position + new Vector3(0f, Isometric.IsometricTileSize.y * 0.5f, 0f), angle + 90f); } } }
public void SendDamage() { Character[] enemys = Object.FindObjectsOfType <Character>(); float damage = PlayerUtil.CalculatingCardPowerValue(DataTable._Parameter[0]); if (enemys == null) { return; } foreach (var e in enemys) { if (e == Owner) { continue; } if ((Target.Point - e.transform.position).magnitude <= Isometric.IsometricTileSize.x * 3f) { e.AddState(new CharacterHitState(e, damage, 0.1f).Init()); e.AddState(new CharacterState(CharacterStateType.E_Stun, e, DataTable._Parameter[1])); IsoParticle.CreateParticle("Sliced_Power1", e.transform.position + new Vector3(0f, Isometric.IsometricTileSize.y * 0.5f, 0f), 0f ); IsoParticle.CreateParticle("Sliced_Power2", e.transform.position + new Vector3(0f, Isometric.IsometricTileSize.y * 0.5f, 0f), 0f); } } PlayerUtil.ConsumeCardPowerUpStatus(); }
public void SendDamage() { Character[] enemys = Object.FindObjectsOfType <Character>(); if (enemys == null) { return; } foreach (var e in enemys) { if (e == Owner) { continue; } float angle = Mathf.Acos(Vector3.Dot((e.transform.position - Owner.transform.position).normalized, Owner.transform.forward)) * Mathf.Rad2Deg; if ((Owner.transform.position - e.transform.position).magnitude <= Isometric.IsometricTileSize.x * 1.8f && angle < 80f) { e.AddState(new CharacterHitState(e, Owner.Status.CurrentDamage, 0.1f).Init()); float zAngle = -1 * AnimUtil.GetRenderAngle(e.transform.rotation) + 45f - 15f; IsoParticle.CreateParticle("Sliced1", e.transform.position + new Vector3(0f, Isometric.IsometricTileSize.y * 0.5f, 0f), zAngle); IsoParticle.CreateParticle("Sliced2", e.transform.position + new Vector3(0f, Isometric.IsometricTileSize.y * 0.5f, 0f), angle + 90f); } } }
public void AttackCurrentTarget() { Vector3 velocity = Owner.RenderTrasform.transform.position - targetCharacters[currentTargetIndex].RenderTrasform.transform.position; velocity.z = 0f; velocity.Normalize(); Vector3 oPos = Owner.transform.position, tPos = targetCharacters[currentTargetIndex].transform.position; float zAngle = Quaternion.FromToRotation(Vector3.right, velocity).eulerAngles.z; IsoParticle.CreateParticle("Sliced_Family", targetCharacters[currentTargetIndex].transform.position, zAngle, false, 0.3f); targetCharacters[currentTargetIndex].AddNotifyEvent(new CharacterNotifyEvent(CharacterNotifyType.E_Damage, damage)); Owner.NavAgent.Move(targetCharacters[currentTargetIndex].transform.position - Owner.transform.position); System.Action nextAction; if (currentTargetIndex < targetCharacters.Count - 1) { TimelineEvents.Add(new TimeLineEvent(ElapsedTime + 0.25f, RotateNextTarget)); } else { nextAction = () => GotoBehindPosition(tPos, oPos); nextAction += ReadyToFinish; TimelineEvents.Add(new TimeLineEvent(ElapsedTime + 0.2f, nextAction)); } }
public void AddBuff() { Character[] enemys = Object.FindObjectsOfType <Character>(); if (enemys == null) { return; } foreach (var e in enemys) { if (e == Owner) { continue; } if ((Owner.transform.position - e.transform.position).magnitude <= Isometric.IsometricTileSize.x * 3f) { if (e != null) { Vector3 pos = e.transform.position; e.CurrentAction?.FinishAction(); GameObject.Destroy(e.gameObject); NodeUtil.CreateEntity("Slime", pos); } IsoParticle.CreateParticle("Sliced_Power1", e.transform.position + new Vector3(0f, Isometric.IsometricTileSize.y * 0.5f, 0f), 0f); } } PlayerUtil.ConsumeCardPowerUpStatus(); }
public override void StartAction(Character owner) { base.StartAction(owner); highlight = IsoParticle.CreateParticle("HighLight", Player.CurrentPlayer.transform.position + Vector3.down * Isometric.IsometricGridSize, 0f, false, 4f) as IsoHighLight; highlight.IsMove = true; highlight.Target = Player.CurrentPlayer.transform; highlight.AfterHighLightLogic += CalculateStun; }
public void CalculateStun(Vector3 position) { isFinish = true; if ((Player.CurrentPlayer.transform.position - position).magnitude < 1.2 * Isometric.IsometricTileSize.x) { Player.CurrentPlayer.AddState(new CharacterState(CharacterStateType.E_Hold, Player.CurrentPlayer, 1f)); Player.CurrentPlayer.AddState(new CharacterHitState(Player.CurrentPlayer, 20f, 0.1f)); } IsoParticle.CreateParticle("ExplosionHighlight", position, 0f); IsoParticle.CreateParticle("WoodHold", position, 0f); Owner.CurrentAction = WoodTotemIdleAction.GetInstance(); }
public void RotateNextTarget() { Vector3 velocity = Owner.RenderTrasform.transform.position - targetCharacters[currentTargetIndex + 1].RenderTrasform.transform.position; velocity.z = 0f; velocity.Normalize(); float zAngle = Quaternion.FromToRotation(Vector3.right, velocity).eulerAngles.z; IsoParticle.CreateParticle("Round_Family", Owner.transform.position, 0f, false, 0.2f); IsoParticle.CreateParticle("Rotate_Family", Owner.transform.position, zAngle, false, 0.1f); TimelineEvents.Add(new TimeLineEvent(ElapsedTime + 0.1f, AttackCurrentTarget)); currentTargetIndex++; }
public static IsoParticle CreateParticle(string particleName, Vector3 position, float zAngle, bool isAnimLifeTime = true, float lifeTime = 1f) { GameObject particle = ResourceManager.GetResource <GameObject>("Particles/" + particleName); if (particle == null || particle.GetComponent <IsoParticle>() == null) { return(null); } IsoParticle iparticle = Instantiate(particle, position, Quaternion.identity).GetComponent <IsoParticle>(); iparticle.Angle = zAngle; iparticle.LifeTime = lifeTime; iparticle.RenderChild.TranslateIsometricToWorldCoordination(); return(iparticle); }
public void ReadyToAction() { StateOrder = 1; Owner.RenderTrasform.GetComponent <SpriteRenderer>().enabled = false; Vector3 velocity = Owner.RenderTrasform.transform.position - Target.Target.RenderTrasform.transform.position; velocity.z = 0f; velocity.Normalize(); Vector3 oPos = Owner.transform.position, tPos = Target.Target.transform.position; float zAngle = Quaternion.FromToRotation(Vector3.right, velocity).eulerAngles.z; IsoParticle.CreateParticle("Sliced_Family", Target.Target.transform.position, zAngle, false, 0.3f); Target.Target.AddState(new CharacterHitState(Target.Target, damage, 0.1f).Init()); GotoBehindPosition(Target.Target.transform.position, Owner.transform.position); ReadyToFinish(); }
public void SendDamage() { IsoParticle.CreateParticle("BreakGround", Owner.transform.position - Vector3.up * Isometric.IsometricTileSize.y, 0f) .RotationAnim("effect_ground_power_atk", Owner.transform.rotation); Character[] enemys = Object.FindObjectsOfType <Character>(); float damage = PlayerUtil.CalculatingCardPowerValue(DataTable._Parameter[0]); if (enemys == null) { return; } foreach (var e in enemys) { if (e == Owner) { continue; } float angle = Mathf.Acos(Vector3.Dot((e.transform.position - Owner.transform.position).normalized, Owner.transform.forward)) * Mathf.Rad2Deg; if ((Owner.transform.position - e.transform.position).magnitude <= Isometric.IsometricTileSize.x * 3f && angle < 45f) { e.AddState(new CharacterHitState(e, damage, 0.1f).Init()); IsoParticle.CreateParticle("Sliced_Power1", e.transform.position + new Vector3(0f, Isometric.IsometricTileSize.y * 0.5f, 0f), angle); IsoParticle.CreateParticle("Sliced_Power2", e.transform.position + new Vector3(0f, Isometric.IsometricTileSize.y * 0.5f, 0f), angle + 90f); } } PlayerUtil.ConsumeCardPowerUpStatus(); }