public override int Visit(SummonAbility ability)
 {
     if (Target == null)
     {
         return(0);
     }
     return(-1);
 }
Example #2
0
    public SummonAbility clone()
    {
        SummonAbility clone = null;

        try {
            clone = (SummonAbility)Clone();
        } catch (Exception e) {
            Debug.LogError(e);
        }

        return(clone);
    }
Example #3
0
        public override int Visit(SummonAbility ability)
        {
            //Log("In summonAbility");
            if (GameManager.UserDict[Owner].Player.Outer.Count < AmaruConstants.OUTER_MAX_SIZE)
            {
                CreatureCard summoned = (CreatureCard)ability.toSummon.Original;
                summoned.Energy = 1;
                GameManager.UserDict[Owner].Player.Outer.Add(summoned);

                foreach (CharacterEnum c in GameManager.UserDict.Keys)
                {
                    AddResponse(c, new EvocationResponse(Owner, (CreatureCard)OwnerCard, summoned, Place.OUTER));
                }
            }
            return(0);
        }
Example #4
0
 public override int Visit(SummonAbility summonAbility)
 {
     return(0);
 }
Example #5
0
 public abstract int Visit(SummonAbility summonAbility);
Example #6
0
    public static Ability loadAbility(string abilityLink)
    {
        var textAsset = (TextAsset)Resources.Load(abilityLink);
        var xmldoc    = new XmlDocument();

        xmldoc.LoadXml(textAsset.text);
        var xmlAbility = xmldoc.GetElementsByTagName("ability").Item(0);

        Ability ability = null;

        switch (xmlAbility["type"].InnerText)
        {
        case "basicAbility":
            ability = new Ability();
            ability.setAbstractTactic(new DamageSpellCastTactic(3));
            break;

        case "summonAbility":
            var summon        = loadPerson(xmlAbility["summon"].InnerText);
            var summonAbility = new SummonAbility();

            var tactic = new SummonCastTactic(3);
            tactic.summon = summon;

            summonAbility.setAbstractTactic(tactic);
            summonAbility.person = summon;
            ability = summonAbility;
            break;

        case "buffAbility":
        case "passiveAbility":
            var buff = new Buff();
            buff.setAbstractTactic(new DamageSpellCastTactic(3));
            buff.modificator = getModificators(xmlAbility["modificators"])[0];
            buff.duration    = float.Parse(xmlAbility["duration"].InnerText);
            ability          = buff;
            break;

        case "activeBuff":
            ability = new ActiveBuff();
            ability.setAbstractTactic(new DamageSpellCastTactic(3));
            break;
        }

        ability.name         = xmlAbility["name"].InnerText;
        ability.type         = xmlAbility["type"].InnerText;
        ability.resource     = abilityLink;
        ability.timeCast     = float.Parse(xmlAbility["timeCast"].InnerText);
        ability.manaCost     = float.Parse(xmlAbility["manaCost"].InnerText);
        ability.cooldown     = float.Parse(xmlAbility["cooldown"].InnerText);
        ability.targetType   = getTargetType(xmlAbility["targetType"].InnerText);
        ability.targetTactic = getTargetTactic(xmlAbility["targetTactic"].InnerText, ability);
        ability.animation    = xmlAbility["animation"].InnerText;
        ability.image        = Constants.loadSprite(xmlAbility["sprite"].InnerText, xmlAbility["image"].InnerText);
        foreach (XmlNode node in xmlAbility["effects"])
        {
            ability.effectList.Add(getEffect(node, ability));
        }

        return(ability);
    }