Exemplo n.º 1
0
 public static bool MatchCard(CardPrototype p1, CardPrototype p2)
 {
     if (p1.number >= 10)
     {
         return(p1.number == p2.number);
     }
     return(p1.number + p2.number == 10);
 }
Exemplo n.º 2
0
 public CardModel(CardPrototype prototype)
 {
     this.prototype      = prototype;
     this.name           = prototype.cardName;
     this.health         = prototype.health;
     this.damage         = prototype.damage;
     this.sprite         = prototype.sprite;
     this.timeToCast     = prototype.timeToCast;
     this.cardsToDraw    = prototype.cardsToDraw;
     this.casterHpToHeal = prototype.casterHpToHeal;
 }
Exemplo n.º 3
0
 public CardModel(CardPrototype prototype)
 {
     this.prototype = prototype;
     id             = prototype.id;
     name           = prototype.name;
     description    = prototype.description.Replace("\\n", "\n"); // Allow newlines
     animation      = prototype.animation;
     rarity         = prototype.rarity;
     cost           = prototype.cost;
     effect         = prototype.effect;
     statGainType   = prototype.statGainType;
     statGainAmount = prototype.statGainAmount;
     numCardsToDraw = prototype.numCardsToDraw;
 }
Exemplo n.º 4
0
    public void Init()
    {
        if (startingCards == null)
        {
            startingCards = new List <CardPrototype>();
        }

        for (var i = 0; i < startingCards.Count; i++)
        {
            CardPrototype card = startingCards[i];
            DeckController.instance.PutOnTop(card.Instantiate());
        }

        DeckController.instance.Shuffle();
    }
Exemplo n.º 5
0
    static void CreateAsset()
    {
        CardPrototype asset = ScriptableObject.CreateInstance <CardPrototype>();

        string path = AssetDatabase.GetAssetPath(Selection.activeObject);

        if (path == "")
        {
            path = "Assets";
        }
        else if (Path.GetExtension(path) != "")
        {
            path = path.Replace(Path.GetFileName(AssetDatabase.GetAssetPath(Selection.activeObject)), "");
        }

        string assetPathAndName = AssetDatabase.GenerateUniqueAssetPath(path + "/New Card.asset");

        AssetDatabase.CreateAsset(asset, assetPathAndName);

        AssetDatabase.SaveAssets();
        AssetDatabase.Refresh();
        EditorUtility.FocusProjectWindow();
        Selection.activeObject = asset;
    }
Exemplo n.º 6
0
 public static void RegisterCard(CardPrototype card)
 {
     Prototypes.Add(card.Name, card);
 }