示例#1
0
    public int MakeReinforceData(int type, int grade)
    {
        int rand = type;

        if (rand == -1)
        {
            rand = Random.Range(0, 3);
        }

        GameObject     eq;
        Item_Equipment ieq = null;
        int            uid = 0;

        grade = 0;

        switch (rand)
        {
        case 0:
            eq  = ObjManager.MakeObj("EqAttack");
            ieq = eq.GetComponent <Item_Equipment>();
            ieq.StartAbsorb(0.0f);
            uid = (int)Item.UIDCombination.REINFORCE + (grade + 1) * 10 + (int)Item.UIDCombination.ATK;
            ieq.SetValues(grade, uid, rand);
            ieq.gameObject.SetActive(false);
            break;

        case 1:
            eq  = ObjManager.MakeObj("EqRange");
            ieq = eq.GetComponent <Item_Equipment>();
            ieq.StartAbsorb(0.0f);
            uid = (int)Item.UIDCombination.REINFORCE + (grade + 1) * 10 + (int)Item.UIDCombination.HP;
            ieq.SetValues(grade, uid, rand);
            ieq.gameObject.SetActive(false);
            break;

        case 2:
            eq  = ObjManager.MakeObj("EqSpeed");
            ieq = eq.GetComponent <Item_Equipment>();
            ieq.StartAbsorb(0.0f);
            uid = (int)Item.UIDCombination.REINFORCE + (grade + 1) * 10 + (int)Item.UIDCombination.SPD;
            ieq.SetValues(grade, uid, rand);
            ieq.gameObject.SetActive(false);
            break;
        }

        int index = Player.AddItem(ieq);

        ieq.gameObject.SetActive(false);

        return(index);
    }
示例#2
0
    public void MakeReinforce(int type, int grade, Transform transform)
    {
        int rand = type;

        if (rand == -1)
        {
            rand = Random.Range(0, 3);
        }

        int uid = 0;

        grade = 0;

        switch (rand)
        {
        case 0:
            GameObject eqAtk = ObjManager.MakeObj("EqAttack");
            eqAtk.transform.position = transform.position;
            Item_Equipment eqpAtk = eqAtk.GetComponent <Item_Equipment>();
            eqpAtk.StartAbsorb(0.5f);
            uid = (int)Item.UIDCombination.REINFORCE + (grade + 1) * 10 + (int)Item.UIDCombination.ATK;

            eqpAtk.SetValues(grade, uid, rand);
            break;

        case 1:
            GameObject eqRng = ObjManager.MakeObj("EqRange");
            eqRng.transform.position = transform.position;
            Item_Equipment eqpRng = eqRng.GetComponent <Item_Equipment>();
            eqpRng.StartAbsorb(0.5f);
            uid = (int)Item.UIDCombination.REINFORCE + (grade + 1) * 10 + (int)Item.UIDCombination.HP;

            eqpRng.SetValues(grade, uid, rand);
            break;

        case 2:
            GameObject eqSpd = ObjManager.MakeObj("EqSpeed");
            eqSpd.transform.position = transform.position;
            Item_Equipment eqpSpd = eqSpd.GetComponent <Item_Equipment>();
            eqpSpd.StartAbsorb(0.5f);
            uid = (int)Item.UIDCombination.REINFORCE + (grade + 1) * 10 + (int)Item.UIDCombination.SPD;

            eqpSpd.SetValues(grade, uid, rand);
            break;
        }
    }