private void IceBoltAction(Player owner, BoardSkill boardSkill, HeroSkill skill, object target) { if (target != null && target is BoardUnit) { BoardUnit unit = target as BoardUnit; _battleController.AttackUnitBySkill(owner, skill, unit, 0); if (unit.CurrentHp > 0) { unit.Stun(Enumerators.StunType.FREEZE, 1); } _vfxController.CreateVfx( _loadObjectsManager.GetObjectByPath <GameObject>("Prefabs/VFX/Skills/IceBolt_Impact"), unit); _soundManager.PlaySound(Enumerators.SoundType.OVERLORD_ABILITIES, skill.OverlordSkill.ToString().ToLower() + "_Impact", Constants.OverlordAbilitySoundVolume, Enumerators.CardSoundType.NONE); } }
protected override void UnitAttackedHandler(object info, int damage, bool isAttacker) { base.UnitAttackedHandler(info, damage, isAttacker); if (AbilityCallType != Enumerators.AbilityCallType.ATTACK || !isAttacker) { return; } if (info is BoardUnit) { BoardUnit creature = info as BoardUnit; creature.Stun(Enumerators.StunType.FREEZE, Value); CreateVfx(creature.Transform.position); ActionsQueueController.PostGameActionReport(ActionsQueueController.FormatGameActionReport( Enumerators.ActionType.STUN_CREATURE_BY_ABILITY, new object[] { AbilityUnitOwner, creature })); } }
public override void Action(object info = null) { base.Action(info); BoardUnit creature = info as BoardUnit; CreateVfx(creature.Transform.position); BoardUnit leftAdjustment = null, rightAdjastment = null; int targetIndex = -1; for (int i = 0; i < creature.OwnerPlayer.BoardCards.Count; i++) { if (creature.OwnerPlayer.BoardCards[i] == creature) { targetIndex = i; } } if (targetIndex > -1) { if (targetIndex - 1 > -1) { leftAdjustment = creature.OwnerPlayer.BoardCards[targetIndex - 1]; } if (targetIndex + 1 < creature.OwnerPlayer.BoardCards.Count) { rightAdjastment = creature.OwnerPlayer.BoardCards[targetIndex + 1]; } } if (leftAdjustment != null) { if (leftAdjustment.IsStun) { BattleController.AttackUnitByAbility(AbilityUnitOwner, AbilityData, leftAdjustment); } else { leftAdjustment.Stun(Enumerators.StunType.FREEZE, 1); } } if (rightAdjastment != null) { if (rightAdjastment.IsStun) { BattleController.AttackUnitByAbility(AbilityUnitOwner, AbilityData, rightAdjastment); } else { rightAdjastment.Stun(Enumerators.StunType.FREEZE, 1); } } if (creature.IsStun) { BattleController.AttackUnitByAbility(AbilityUnitOwner, AbilityData, creature); } else { creature.Stun(Enumerators.StunType.FREEZE, 1); } }