예제 #1
0
 public void Merge(LootTracking other)
 {
     Magical.Merge(other.Magical);
     Rare.Merge(other.Rare);
     Legendary.Merge(other.Legendary);
     Gems.Merge(other.Gems);
     Crafting.Merge(other.Crafting);
     Keys.Merge(other.Keys);
 }
예제 #2
0
파일: LootStats.cs 프로젝트: Nksn22/Funky
 public void Merge(LootTracking other)
 {
     Magical.Merge(other.Magical);
     Rare.Merge(other.Rare);
     Legendary.Merge(other.Legendary);
     Gems.Merge(other.Gems);
     Crafting.Merge(other.Crafting);
     Keys.Merge(other.Keys);
     KeyStoneFragments.Merge(other.KeyStoneFragments);
     HoradricCache.Merge(other.HoradricCache);
 }
예제 #3
0
    public void Ini(Rare _rare, GameObject obj)
    {
        rare  = _rare;
        agent = obj.GetComponent <NavMeshAgent>();
        var ran = Random.Range(0, ManageMaster.Instance.BookshelfManager.Bookshelves.Count);

        target_pos = ManageMaster.Instance.BookshelfManager.Bookshelves[ran].Obj.transform.position;
        if (ManageMaster.Instance.BookshelfManager.Bookshelves[ran].Produt == null)
        {
            status     = Status.Destroy;
            target_pos = StaticDatas.Instance.CustomerInstancePos;
        }
        instance_id = ManageMaster.Instance.BookshelfManager.Bookshelves[ran].Obj.GetInstanceID();
    }
예제 #4
0
    /*
     * Subscribed to the checkForCollected Event called during loading of a save File. It sets all Collectibles whose ID has already been
     * saved to inactive
     *
     *@Katja
     */
    public void checkForCollected(int collectibleID)
    {
        if (collectibleID == numberID && this != null)
        {
            ScoreSound     scoreSound = gameObject.AddComponent(typeof(ScoreSound)) as ScoreSound;
            SpriteRenderer sp         = gameObject.GetComponent <SpriteRenderer>();
            ManagementSystem.Instance.collectedUpdate();

            sp.sprite = Resources.Load <Sprite>("PickUp Sprites/GoldCoinWithRuby_64x64");
            Rare             rare             = gameObject.GetComponent <Rare>();
            CollectibleSound collectibelSound = gameObject.GetComponent <CollectibleSound>();
            Object.Destroy(collectibelSound);
            Object.Destroy(rare);
        }
    }
예제 #5
0
        public Item Factory(Equipment type, Rare rare, string name)
        {
            switch (type)
            {
            case Equipment.SWORD:
                return(new Sword(name, rare));

            case Equipment.BOW:
                return(new Bow(name, rare));

            case Equipment.HELMET:
                return(new Helmet(name, rare));

            default:
                return(null);
            }
        }
예제 #6
0
 public Sword(string name, Rare rare)
 {
     Name = name;
     Type = rare;
 }
예제 #7
0
 public Helmet(string name, Rare rare)
 {
     Name = name;
     Type = rare;
 }
예제 #8
0
    public Type type; //卡牌种类

    //构造函数,info为卡牌对应的图片名称,记录了卡牌的所有信息
    public Card(string info)
    {
        //string s = "F0120BF0201";
        //Match match = Regex.Match(s, @"(^.+?)(\d+$)");
        //Debug.Log(match.Groups[0].Value + ' ' + match.Groups[1].Value);

        this.info = info;

        info = info.Substring(0, info.Length - 4);   //去除最后的.jpg
        //首先获得卡图
        image = (Sprite)Resources.Load("Cards/" + info, typeof(Sprite));
        Debug.Assert(image, "Cards/" + info);
        //以下为解析info并赋值的过程
        string[] tmp = info.Split(new char[] { '_' });

        //解析阵营
        switch (tmp[0])
        {
            case "魏": camp = Camp.Wei; break;
            case "蜀": camp = Camp.Shu; break;
            case "吴": camp = Camp.Wu; break;
            case "群": camp = Camp.Qun; break;
            default:
                Debug.Log("无法解析阵营" + tmp[0]);
                //return;
                break;
        }
        //解析种类 数量太多 不使用swtich
        string[] types = Enum.GetNames(typeof(Type));
        this.type = (Type)0;    //未找到,返回错误值
        foreach (var type in types)
        {
            if (tmp[1] == type)
            {
                this.type = (Type)Enum.Parse(typeof(Type), type);
                break;
            }
        }
        if(this.type == 0)
        {
            Debug.Log("错误的阵营" + tmp[1]);
        }
        name = tmp[2];  //姓名
        //解析稀有度
        switch (tmp[3])
        {
            case "A": rare = Rare.Ashy;break;
            case "W": rare = Rare.White;break;
            case "G": rare = Rare.Green;break;
            case "B": rare = Rare.Blue;break;
            case "P": rare = Rare.Purple;break;
            case "O": rare = Rare.Orange;break;
            case "R": rare = Rare.Red;break;
            default:
                Debug.Log("无法解析稀有度"+info);
                break;
        }

        try
        {

            if (type == Type.武将)
            {
                ParseCardNum(tmp[4]);
                ParseTAH(tmp[5], tmp[6], tmp[7]);
                ParseSkill(tmp, 8);
            }
            else if (type == Type.术)
            {
                ParseTAH(tmp[4], "-1", "-1");   //法术没有hp和攻击力,缺省
                ParseSkill(tmp, 6);
            }
            else
            {
                ParseTAH(tmp[4], tmp[5], tmp[6]);
                ParseSkill(tmp, 7);
            }
        }
        catch (Exception e)
        {

            Debug.Log(info);
        }
    }
예제 #9
0
 public Bow(string name, Rare rare)
 {
     Name = name;
     Type = rare;
 }