IEnumerator SetPersonSize() { yield return(new WaitForSeconds(0.001f)); for (int i = 0; i < es.GetEnemyPower(); i++) { this.transform.localScale += new Vector3(0.0005f, 0.0005f, 0f); } }
void OnTriggerEnter2D(Collider2D other) { if ((other.gameObject.CompareTag("AchillesBody")))// { playerScript = other.transform.parent.GetComponent <Player>(); ph = other.transform.parent.GetComponent <PlayerHealth>(); if (!playerScript.GetAnim().GetCurrentAnimatorStateInfo(1).IsName("Defense")) { if (infCtrl.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("QuickAttack1")) { playerScript.SetIsAttacked(true); playerScript.BackDirection(Utility.EnemyDirection(other.transform.parent.transform, enemy.transform)); if (ph.GetPlayerHealth() > 0 && !damaged) { CameraShaker.Instance.ShakeOnce(GameController.Instance.magnitudeValsBig); has.RandomizeSfx(stab0, stab1, stab2, stab3); ph.ReceiveDamage(Utility.GetWeaponDamageAmount(ea.GetWeaponCategoryAndIndex(), es.GetEnemyPower(), ea.GetEmberPercentage())); damaged = true; BloodEffect(other.transform.parent.transform); if (ea.GetEmber()) { HotParticles(other.transform.parent.transform); } } } if (infCtrl.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("StrongAttack1")) { playerScript.SetIsAttacked(true); playerScript.BackDirection(Utility.EnemyDirection(other.transform.parent.transform, enemy.transform)); if (ph.GetPlayerHealth() > 0 && !damaged) { CameraShaker.Instance.ShakeOnce(GameController.Instance.magnitudeValsBig); has.RandomizeSfx(swing0, swing1, swing2); ph.ReceiveDamage(Utility.GetWeaponDamageAmount(ea.GetWeaponCategoryAndIndex(), es.GetEnemyPower(), ea.GetEmberPercentage())); damaged = true; BloodEffect(other.transform.parent.transform); if (ea.GetEmber()) { HotParticles(other.transform.parent.transform); } } } } } if (other.gameObject.CompareTag("AchillesShield")) { playerScript = other.transform.parent.parent.parent.parent.parent.GetComponent <Player>(); ph = other.transform.parent.parent.parent.parent.parent.GetComponent <PlayerHealth>(); if (playerScript.GetAnim().GetCurrentAnimatorStateInfo(1).IsName("Defense") && (infCtrl.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("QuickAttack1") || infCtrl.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("StrongAttack1"))) { if (ph.GetPlayerShieldHealth() > 0 && !damaged_shield) { CameraShaker.Instance.ShakeOnce(GameController.Instance.magnitudeValsSmall); ph.ReceiveShieldDamage(Utility.GetWeaponDamageAmount(ea.GetWeaponCategoryAndIndex(), es.GetEnemyPower(), ea.GetEmberPercentage())); damaged_shield = true; if (ea.GetEmber()) { HotParticlesForShield(other.transform); } else { DestroyParticles(other.transform); } if (other.transform.parent.parent.parent.parent.parent.GetComponent <PlayerState>().GetShield() > 2) { has.RandomizeSfxShieldIron(shieldhit_iron_0, shieldhit_iron_1, shieldhit_iron_2); } else { has.RandomizeSfxShieldWood(shieldhit_wood_0, shieldhit_wood_1, shieldhit_wood_2); } } } } }