Exemplo n.º 1
0
 public EquipmentEffect(EquipmentEffectProfile inputProfile, float inputEffectStrength, float rarity)
 {
     profile                   = inputProfile;
     effectStrength            = inputEffectStrength;
     effectStrengthRarityValue = rarity;
     TranslateRarity();
 }
Exemplo n.º 2
0
    private EquipmentEffect GenerateNewEffect(EquipmentEffectProfile effectProfile, Equipment newModule)
    {
        // Get a value from the curve.
        float rarityValue = strengthRarityCurve.Evaluate(Utility.GenerateRandomFloat(0f, 1f));

        // Find out the difference between the max strength and min strength before multiplying this difference by the item rarity.
        float thisItemRarity = (effectProfile.maxStrength - effectProfile.minStrength) * rarityValue;

        // The strength of our item is now the minimum value + the rarity determination
        float strength = effectProfile.minStrength + thisItemRarity;

        // Create the new effect object by applying the profile and strength.
        EquipmentEffect newEffect = new EquipmentEffect(effectProfile, strength, rarityValue);

        //Debug.Log($"Generating new effect named {effectProfile.name} with strength {strength} at {rarityValue * 100}% rarity.");

        // Add the effect to the list of effects for the equipment module.
        newModule.effects.Add(newEffect);
        return(newEffect);
    }