示例#1
0
    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);
    }
示例#2
0
    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);
    }
示例#3
0
    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);
    }