Example #1
0
    /// <summary>
    /// Jewelの種類、レア度によってパラメータを付与する関数
    /// </summary>
    /// <param name="type"></param>
    public ItemData(JewelType type, JewelRarity rarity, int attack, int deffence, int sutamina)
    {
        JewelType   = type;
        JewelRarity = rarity;

        Attack   = attack;
        Deffence = deffence;
        Sutamina = sutamina;
    }
Example #2
0
        public KeyValuePair<JewelAttributeType, float> SpecialAttribute; // 饰品特殊属性(单条)

        #endregion Fields

        #region Constructors

        /// <summary>
        /// 类型:方法
        /// 名称:Jewel
        /// 作者:taixihuase
        /// 作用:通过数据库中获得的数据构造饰品装备实例
        /// 编写日期:2015/8/16
        /// </summary>
        /// <param name="fixedId"></param>
        /// <param name="allocatedId"></param>
        /// <param name="name"></param>
        /// <param name="occupation"></param>
        /// <param name="limit"></param>
        /// <param name="upgrade"></param>
        /// <param name="cur"></param>
        /// <param name="dur"></param>
        /// <param name="type"></param>
        /// <param name="jewelAttributeType"></param>
        public Jewel(int fixedId, int allocatedId, string name, OccupationCode occupation, int limit, bool upgrade,
            int cur, int dur,
            JewelType type, JewelAttributeType jewelAttributeType)
            : base(fixedId, allocatedId, name, occupation, limit, upgrade, cur, dur, EquipmentType.Jewel)
        {
            Type = (byte) type;
            JewelAttribute = jewelAttributeType;
            SpecialAttribute = new KeyValuePair<JewelAttributeType, float>(jewelAttributeType, 0);
        }
Example #3
0
        public KeyValuePair <JewelAttributeType, float> SpecialAttribute; // 饰品特殊属性(单条)

        #endregion

        /// <summary>
        /// 类型:方法
        /// 名称:Jewel
        /// 作者:taixihuase
        /// 作用:通过数据库中获得的数据构造饰品装备实例
        /// 编写日期:2015/8/16
        /// </summary>
        /// <param name="fixedId"></param>
        /// <param name="allocatedId"></param>
        /// <param name="name"></param>
        /// <param name="occupation"></param>
        /// <param name="limit"></param>
        /// <param name="upgrade"></param>
        /// <param name="cur"></param>
        /// <param name="dur"></param>
        /// <param name="type"></param>
        /// <param name="jewelAttributeType"></param>
        public Jewel(int fixedId, int allocatedId, string name, OccupationCode occupation, int limit, bool upgrade,
                     int cur, int dur,
                     JewelType type, JewelAttributeType jewelAttributeType)
            : base(fixedId, allocatedId, name, occupation, limit, upgrade, cur, dur, EquipmentType.Jewel)
        {
            Type             = (byte)type;
            JewelAttribute   = jewelAttributeType;
            SpecialAttribute = new KeyValuePair <JewelAttributeType, float>(jewelAttributeType, 0);
        }
Example #4
0
        public int JewelValue(JewelType jewelType, int level)
        {
            Enum.TryParse($"{jewelType}_JEWEL", out PropertyType propType);
            var props = Properties(propType, level);

            if (!props.IsEmpty())
            {
                return(props[0].value1);
            }
            return(0);
        }
Example #5
0
    private List <Jewel> GetMatchingJewels(Jewel jewel)
    {
        List <Jewel> resultJewels = new List <Jewel>();

        Vector2Int jewelIndex = jewel.GridIndex;
        JewelType  jewelType  = jewel.Type;

        for (int i = 0; i < 2; i++)
        {
            List <Jewel> tmpJewels = new List <Jewel>();

            for (int j = jewelIndex[i] - 2; j <= jewelIndex[i] + 2; j++)
            {
                if (j < 0 || j >= gridSize[i])
                {
                    continue;
                }

                Jewel currentJewel = i == 0 ? jewelGrid[jewelIndex.y, j] : jewelGrid[j, jewelIndex.x];

                if (currentJewel.Type == jewelType)
                {
                    tmpJewels.Add(currentJewel);
                }
                else
                {
                    if (tmpJewels.Count < 3)
                    {
                        tmpJewels.Clear();
                    }
                    else
                    {
                        AddTmpToResultJewels(resultJewels, tmpJewels);
                        break;
                    }
                }
            }

            if (tmpJewels.Count >= 3)
            {
                AddTmpToResultJewels(resultJewels, tmpJewels);
            }
        }

        return(resultJewels);
    }
Example #6
0
 public void OnDrag(PointerEventData eventData){} //this call needs to exist so that begin and end handlers work properly
 
 public void SetMyType(JewelType jt){
     Image i = GetComponent<Image>();
     switch (jt){
         case JewelType.Red:
             i.color = Color.red;;
             break;
         case JewelType.Green:
             i.color = Color.green;
             break;
         case JewelType.Blue:
             i.color = Color.blue;
             break;
         default: //alpha
             i.color = Color.yellow;
             break;                    
     }
     type = jt;
 }
Example #7
0
    public void CreateJewelLocal()
    {
        ResetJewel();

        var jewelObject = GameManager.GetGameManager().GetRandomJewel();

        _jewelType     = jewelObject.JewelType;
        transform.name = _jewelType.ToString();

        _litEmissionColor = jewelObject.LitEmissionColor;

        GetMeshRenderer          = Instantiate(jewelObject.Mesh);
        GetMeshRenderer.isStatic = false;
        GetMeshRenderer.transform.SetParent(transform);
        GetMeshRenderer.transform.localPosition = Vector3.zero;

        gameObject.layer = GameManager.GetLayer(this);
        gameObject.tag   = "Jewel";

        GetMeshRenderer.layer = GameManager.GetLayer(this);

        GetMeshRenderer.transform.FindChild("core").gameObject.layer = GameManager.GetLayer(this);
    }
Example #8
0
    public Skill(JewelType type)
    {
        switch (type)
        {
        case JewelType.Red:
            SkillType  = SkillType.AttackUp;
            SkillLevel = 1;
            break;

        case JewelType.Blue:
            SkillType  = SkillType.GuardianArea;
            SkillLevel = 1;
            break;

        case JewelType.Green:
            SkillType  = SkillType.KaihiAttack;
            SkillLevel = 1;
            break;

        default:
            break;
        }
    }
 public Jewelry Jewelry(JewelType type)
 {
     return(jewelries[type]);
 }
Example #10
0
 public Jewelry(JewelType type)
 {
     this.type = type;
 }
Example #11
0
 public void Generate()
 {
     type   = (JewelType)Random.Range(0, 6);
     sprite = GridBuilder.GetSprite((int)type);
 }