public void LethalThreat(CharacterBattle targetCharacterBattle, Action onAttackComplete) { Vector3 slideTargetPosition = (targetCharacterBattle.GetPosition() + (GetPosition() - targetCharacterBattle.GetPosition()).normalized * 10f) + new Vector3(30, 0); Vector3 startingPosition = GetPosition(); string LoginScreen = CharStats.name + " uses Lethal Threat on " + targetCharacterBattle.CharStats.name; TextScript.Create(new Vector3(-50, -40), LoginScreen, 45, true); foreach (ParticleSystem ps in particles) { if (ps.name == "Dash") { toDestroy = Instantiate(ps, this.transform).gameObject; } } // Slide to Target going = true; SlideToPosition(slideTargetPosition, () => { // Arrived at Target, attack him state = State.Busy; targetCharacterBattle.Damage(this, CharStats.Damage); SlideToPosition(startingPosition, () => { // Slide back completed, back to idle state = State.Idle; onAttackComplete(); }); }, "JabMelee2H"); }
public void Smoke(List <CharacterBattle> targets, Action onAttackComplete) { animator.Play("Victory"); GameObject BindParticle = null; state = State.Busy; foreach (ParticleSystem ps in particles) { if (ps.name == "Smoke") { toDestroy = Instantiate(ps).gameObject; } if (ps.name == "Blind") { BindParticle = ps.gameObject; } } string LoginScreen = CharStats.name + " uses Smoke on Enemies"; TextScript.Create(new Vector3(-50, -40), LoginScreen, 45, true); waitPosition(() => { foreach (CharacterBattle tg in targets) { tg.blinded = true; tg.DeBuffTurns = 5; tg.deBuffToDestroy = Instantiate(BindParticle, tg.transform); } onAttackComplete(); state = State.Idle; }); }
public void Setup(bool isPlayerTeam, GameObject Own) { this.isPlayerTeam = isPlayerTeam; m_GameObject = Instantiate(Own, transform.position, Quaternion.identity, transform); ObjectiveCursor = m_GameObject.transform.Find("Objective").gameObject; ObjectiveCursor.SetActive(false); CharStats = m_GameObject.GetComponent <Stats>(); Level = CharStats.Level; Health = CharStats.Health; Speed = CharStats.Speed; charclass = CharStats.charclass; particles = CharStats.particles; LM = m_GameObject.GetComponent <LayerManager>(); CharStats.parent = this.gameObject; if (isPlayerTeam) { InShield = m_GameObject.transform.Find("SheerWillShield").gameObject; } else { Vector3 transform = m_GameObject.transform.localScale; transform.x *= -1; m_GameObject.transform.localScale = transform; } Vector3 namePos = transform.position; invulnerable = false; healthSystem = new HealthSystem(CharStats.Health); if (CharStats.name != "Amadea") { healthBar = new World_Bar(transform, new Vector3(0, 24), new Vector3(12, 1.7f), Color.grey, Color.red, 1f, 100, new World_Bar.Outline { color = Color.black, size = .6f }); namePos.x -= 8; namePos.y += 25; } else { healthBar = new World_Bar(transform, new Vector3(0, 29), new Vector3(12, 1.7f), Color.grey, Color.red, 1f, 100, new World_Bar.Outline { color = Color.black, size = .6f }); namePos.x -= 8; namePos.y += 30; } healthSystem.OnHealthChanged += HealthSystem_OnHealthChanged; animator = m_GameObject.GetComponentInChildren <Animator>(); going = false; TextScript.Create(namePos, CharStats.name, 35, false, gameObject); //PlayAnimIdle(); }
public void PreciseShot(CharacterBattle target, Action onAttackComplete) { animator.Play("ReadyBowShot"); string LoginScreen = CharStats.name + " uses Precise Shot on " + target.CharStats.name; TextScript.Create(new Vector3(-50, -40), LoginScreen, 45, true); Vector3 slideTargetPosition = GetPosition() + new Vector3(5, 0); Vector3 startingPosition = GetPosition(); float angle = Mathf.Atan2((target.GetPosition().y - GetPosition().y), (target.GetPosition().x - GetPosition().x)); angle = angle * Mathf.Rad2Deg; going = true; timeToAttack = true; foreach (ParticleSystem ps in particles) { if (ps.name == "PreciseShoot") { Vector3 Rot = ps.transform.rotation.eulerAngles; Rot.z += -angle; toDestroy = Instantiate(ps, m_GameObject.transform.position, Quaternion.Euler(Rot)).gameObject; } } SlideToPosition(slideTargetPosition, () => { // Arrived at Target, attack him counter = 0; state = State.Busy; waitPosition(() => { int damageAmount = CharStats.Damage * 2; if (!CharStats.Blinded) { if (target.invulnerable == false) { target.Damage(this, damageAmount); } } SlideToPosition(startingPosition, () => { // Slide back completed, back to idle state = State.Idle; onAttackComplete(); }); }); }); }
public void HollyWater(CharacterBattle targetCharacterBattle, Action onAttackComplete) { animator.Play("Victory"); string LoginScreen = CharStats.name + " uses Holly water on " + targetCharacterBattle.CharStats.name; TextScript.Create(new Vector3(-50, -40), LoginScreen, 45, true); waitPosition(() => { DamagePopup.Create(targetCharacterBattle.GetPosition(), CharStats.HealingPoints, false, true); targetCharacterBattle.healthSystem.Heal(CharStats.HealingPoints); onAttackComplete(); state = State.Idle; }); }
public void Camouflage(Action onAttackComplete) { animator.Play("Victory"); string LoginScreen = CharStats.name + " uses Camouflage to hide himself"; TextScript.Create(new Vector3(-50, -40), LoginScreen, 45, true); waitPosition(() => { invulnerable = true; Hide = true; //LM.SetColor(new Color(1f, 1f, 1f, 0.3f)); onAttackComplete(); BuffTurns = 5; state = State.Idle; }); }
public void SheerWill(Action onAttackComplete) { animator.Play("Victory"); string LoginScreen = CharStats.name + " uses Sheer Will to protect himself"; TextScript.Create(new Vector3(-50, -40), LoginScreen, 45, true); waitPosition(() => { invulnerable = true; InShield.SetActive(true); onAttackComplete(); BuffTurns = 5; state = State.Idle; }); }
public void PurifyingStrike(List <CharacterBattle> targets, Action onAttackComplete) { Vector3 slideTargetPosition = GetPosition() + new Vector3(5, 0); Vector3 startingPosition = GetPosition(); string LoginScreen = CharStats.name + " uses Purifying Strike to Group of enemys"; TextScript.Create(new Vector3(-50, -40), LoginScreen, 45, true); going = true; timeToAttack = true; SlideToPosition(slideTargetPosition, () => { foreach (ParticleSystem ps in particles) { if (ps.name == "PurifingStrike") { toDestroy = Instantiate(ps).gameObject; } } // Arrived at Target, attack him counter = 0; state = State.Busy; waitPosition(() => { foreach (CharacterBattle tg in targets) { tg.Damage(this, CharStats.Damage); } SlideToPosition(startingPosition, () => { // Slide back completed, back to idle state = State.Idle; onAttackComplete(); }); }); }); // Slide to Target }