IEnumerator Fireball() { Log.SpawnLog("Raven empowers his shot with 'Fireball' spell, hitting " + Target.myUnit.name + " and all it's neighbours."); foreach (Tile neighbour in Target.GetNeighbours()) { if (neighbour.myUnit != null) { neighbour.myUnit.DealDamage(Damage + myUnit.CurrentAttack - neighbour.myUnit.CurrentDefence, true, false, true); PopupTextController.AddParalelPopupText("-" + (Damage + myUnit.CurrentAttack - neighbour.myUnit.CurrentDefence), PopupTypes.Damage); } } yield return(null); FinishUsing(); }
public override void Activate() { MadeEmpoweredShotThisTurn = true; foreach (Ability_Elves_Raven_EmpoweredShot variant in GetComponents <Ability_Elves_Raven_EmpoweredShot>()) { if (variant != this) { variant.UsesLeft--; } } myUnit.GetComponent <UnitMovement>().LookAtTheTarget(Target.transform.position, myUnit.GetComponentInChildren <BodyTrigger>().RotationInAttack); myShooter.CurrentProjectile = Projectile; myUnit.GetComponent <AnimController>().Cast(); Target.myUnit.DealDamage(Damage + myUnit.CurrentAttack - Target.myUnit.CurrentDefence, true, false, true); myShooter.hasAlreadyShot = true; myShooter.myTarget = Target.myUnit.transform.position; PopupTextController.AddParalelPopupText("-" + (Damage + myUnit.CurrentAttack - Target.myUnit.CurrentDefence), PopupTypes.Damage); }
IEnumerator Throw() { myUnit.GetComponent <UnitMovement>().LookAtTheTarget(Target.transform.position, 60); GetComponent <AnimController>().Cast(); /* var temp = Instantiate(Dagger, daggerSpawn.position, Dagger.transform.rotation); * temp.GetComponent<ProjectileScript>().Target = Target.transform.position;*/ //LaunchDagger(Target.transform.position, speed); Target.myUnit.DealDamage(Damage + myUnit.CurrentAttack - Target.myUnit.CurrentDefence, true, false, false); PassiveAbility_Buff.AddBuff(Target.myUnit.gameObject, 2, 0, -2, -2, -100, false, "AssassinDebuff", vfx, 0, false, true, false); PopupTextController.AddParalelPopupText("-" + (Damage - Target.myUnit.CurrentDefence), PopupTypes.Damage); Log.SpawnLog("Assassin throws a deadly dagger at " + Target.myUnit.name + ", dealing " + (Damage - Target.myUnit.CurrentDefence) + " damage."); //Animate the shit // do actual logic yield return(null); FinishUsing(); yield return(new WaitForSeconds(1.0f)); CreateVFXOn(Target.transform, BasicVFX.transform.rotation); }
public bool DealDamage(UnitScript attacker, UnitScript target, int damage, bool isPoisoned, bool Retaliatable, int hits) { if (CheckIfDamageBlocked(attacker, target)) { PopupTextController.AddPopupText("Blocked!", PopupTypes.Damage); Log.SpawnLog(attacker.name + " attacks " + target.name + " but the attack gets blocked!"); } if (hits >= 2) { Log.SpawnLog(attacker.name + " attacks " + target.name + "! " + damage + " point(s) of damage is dealt."); PopupTextController.AddParalelPopupText("-" + damage.ToString(), PopupTypes.Damage); } if (hits <= 1) { Log.SpawnLog(attacker.name + " attacks " + target.name + ", but only reduces their Defence by 1!"); // PopupTextController.AddParalelPopupText("Hit!", PopupTypes.Info); PopupTextController.AddParalelPopupText("-1 Defence", PopupTypes.Stats); } /*if (hits == 0) * { * Log.SpawnLog(attacker.name + " attacks " + target.name + ", but misses completely."); * PopupTextController.AddPopupText("Miss!", PopupTypes.Info); * }*/ bool isShot = attacker.isRanged && (GameStateManager.Instance.GameState != GameStates.RetaliationState && GameStateManager.Instance.GameState != GameStates.AttackState) == false; bool didDie = target.DealDamage(damage, hits > 0, isPoisoned, isShot); if (target.CanCurrentlyRetaliate && target.CurrentHP > 0 && Retaliatable && Player.IsPlayerLocal(target.PlayerID)) { GameStateManager.Instance.StartRetaliationChoice(); } return(didDie); }
void HitForSwing(UnitScript target) { target.DealDamage(Damage - target.CurrentDefence, true, false, false); PopupTextController.AddParalelPopupText("-" + (Damage - target.CurrentDefence), PopupTypes.Damage); }