Ejemplo n.º 1
0
    public override void SetCard(CardRecord card, int selfGamePlayerID)
    {
        base.SetCard(card, selfGamePlayerID);
        WeaponCardRecord weaponCard = card as WeaponCardRecord;

        attackText.text     = weaponCard.Attack.ToString();
        durabilityText.text = weaponCard.RemainedDurability.ToString();

        if (weaponCard.Attack > (weaponCard.Card as WeaponCard).Attack)
        {
            attackText.color = Color.green;
        }

        if (weaponCard.RemainedDurability == weaponCard.Durability)
        {
            if (weaponCard.Durability > (weaponCard.Card as WeaponCard).Durability)
            {
                durabilityText.color = Color.green;
            }
        }
        else
        {
            durabilityText.color = Color.red;
        }
    }
Ejemplo n.º 2
0
        public CardRecord CreateCardRecord(Card card)
        {
            CardRecord record;

            switch (card.CardType)
            {
            case CardTypeCode.Servant:
                record = new ServantCardRecord(cardRecordID_Generator++, card.CardID);
                break;

            case CardTypeCode.Spell:
                record = new SpellCardRecord(cardRecordID_Generator++, card.CardID);
                break;

            case CardTypeCode.Weapon:
                record = new WeaponCardRecord(cardRecordID_Generator++, card.CardID);
                break;

            default:
                return(null);
            }
            LoadCard(record);
            foreach (Effect effect in card.Effects)
            {
                record.AddEffector(CreareEffector(effect).EffectorID);
            }
            return(record);
        }
Ejemplo n.º 3
0
        public int AttackWithWeapon(Game game)
        {
            WeaponCardRecord weaponCard = Weapon(game.GameCardManager);

            if (weaponCard != null && game.CurrentGamePlayerID == HeroID)
            {
                return(Attack + weaponCard.Attack);
            }
            else
            {
                return(Attack);
            }
        }