Exemplo n.º 1
0
 public static string GetAttributeString(int x, string color, string colorOfPlus, AStuff <TModuleType> stuff)
 {
     return(color + MultiResolutions.Font(12) + "<b>" +
            stuff.GetDisplayEquipmentAttribute(stuff.blueAttributes[x].WhichAttribute) + "</b>: " +
            (!(stuff.IsFloatEquipmentAttribute(stuff.blueAttributes[x].WhichAttribute)) ? (colorOfPlus + "+</color>") : "") +
            stuff.GetCorrectEquipmentAttributeValue(stuff.blueAttributes[x]) +
            stuff.GetFinalSignEquipmentAttribute(stuff.blueAttributes[x].WhichAttribute) + "</size></color>");
 }
Exemplo n.º 2
0
    public void GenerateRandomAttributes(List <EquipmentPossibleAttribute> possibleAttribute, AStuff <TModuleType> stuff)
    {
        int qualityAttribbute = ((int)stuff.equipmentQuality);

        if (possibleAttribute.Count < qualityAttribbute)
        {
            Debug.Log("It is not possible to generate more attributes for : " + stuff.Name + " becaue you dont have enought random attributes initialized");
            qualityAttribbute = possibleAttribute.Count;
        }

        int attribute = 0;

        for (int x = 0; x < qualityAttribbute; x++)
        {
            bool goToMyGoTo;
            e_entityAttribute whichAttribute = ServiceLocator.Instance.ProbabilityManager.GetProbabilityIndex(possibleAttribute);
            do
            {
                whichAttribute = ServiceLocator.Instance.ProbabilityManager.GetProbabilityIndex(possibleAttribute);

                attribute = 0;

                for (short i = 0; i < possibleAttribute.Count; i++)
                {
                    if (possibleAttribute[i].attribute == whichAttribute)
                    {
                        attribute = i;
                    }
                }

                goToMyGoTo = false;
                for (short i = 0; i < stuff.blueAttributes.Count; i++)
                {
                    if (whichAttribute == stuff.blueAttributes[i].WhichAttribute)
                    {
                        goToMyGoTo = true;
                    }
                }
            } while (goToMyGoTo);

            possibleAttribute[((int)attribute)].value =
                stuff.GenerateAttributeValue(possibleAttribute[((int)attribute)]);
            stuff.blueAttributes.Add(new EquipmentAttribute(possibleAttribute[((int)attribute)].value, whichAttribute));
            if (!(stuff.IsFloatEquipmentAttribute(whichAttribute)))
            {
                stuff.blueAttributes[stuff.blueAttributes.Count - 1].Value = Mathf.Round(stuff.blueAttributes[stuff.blueAttributes.Count - 1].Value);
            }
        }
    }
Exemplo n.º 3
0
    public void GenerateDefinedAttributes(List <EquipmentPossibleAttribute> definedAttribute, AStuff <TModuleType> stuff)
    {
        for (int attribute = 0; attribute < definedAttribute.Count; attribute++)
        {
            e_entityAttribute whichAttribute = definedAttribute[attribute].attribute;

            definedAttribute[((int)attribute)].value =
                stuff.GenerateAttributeValue(definedAttribute[((int)attribute)]);
            stuff.whiteAttributes.Add(new EquipmentAttribute(definedAttribute[((int)attribute)].value, whichAttribute));
            if (!(stuff.IsFloatEquipmentAttribute(whichAttribute)))
            {
                stuff.whiteAttributes[stuff.whiteAttributes.Count - 1].Value = Mathf.Round(stuff.whiteAttributes[stuff.whiteAttributes.Count - 1].Value);
            }
        }
    }