public void PlaySpellFromHand(int spellCardId, int targetId) { var characterTarget = targetId < 0 ? null as ICharacter : targetId == ID ? this as ICharacter : targetId == OtherPlayer.ID ? OtherPlayer as ICharacter : CreatureLogic.FindCreatureLogicById(targetId) as ICharacter; PlaySpellFromHand(spellCardId, characterTarget); }
private bool AttackTarget(Player owner, GameObject target) { var targetId = target.GetObjectUniqueID(); var targetCharacter = target.tag.IsPlayer() ? target.tag.GetOwnerFromTag() as ICharacter : CreatureLogic.FindCreatureLogicById(targetId); if (targetCharacter != null) { owner.PlaySpellFromHand(this.GetObjectUniqueID(), targetCharacter); } return(targetCharacter != null); }
private bool AttackTarget(GameObject target) { var attackingCreatureLogic = CreatureLogic.FindCreatureLogicById(this.GetObjectUniqueID()); var targetId = target.GetObjectUniqueID(); var targetCharacter = target.tag.IsPlayer() ? target.tag.GetOwnerFromTag() as ICharacter : CreatureLogic.FindCreatureLogicById(targetId); if (targetCharacter != null) { attackingCreatureLogic.Attack(targetCharacter); } return(targetCharacter != null); }