コード例 #1
0
    /// <summary>
    /// Sets the rarity modified values based on the given rarity.
    /// </summary>
    /// <param name="rarityTierArg"></param>
    public void SetupRarityModifiers(RarityTier rarityTierArg)
    {
        // get a random stat multiplier for the damage stat from the given rarity

        /*float randomRarityMultiplier = Random.Range(rarityTierArg.statMultiplierBoundaryLow,
         *  rarityTierArg.statMultiplierBoundaryHigh);*/
        // TEMP LINE!!! Apparently, Random cannot be called during serilization so just doing this for now...
        float randomRarityMultiplier = (rarityTierArg.statMultiplierBoundaryLow + rarityTierArg.statMultiplierBoundaryHigh) / 2f;

        // set the rarity modified damage boundary stats using the retrieved modifier
        damageBoundaryLowRarityModified  = Mathf.RoundToInt(damageBoundaryLowBase * randomRarityMultiplier);
        damageBoundaryHighRarityModified = Mathf.RoundToInt(damageBoundaryHighBase * randomRarityMultiplier);

        // ensure rarity modified damage boundaries are valid values
        damageBoundaryLowRarityModified  = Mathf.Max(damageBoundaryLowRarityModified, 0);
        damageBoundaryHighRarityModified = Mathf.Max(damageBoundaryHighRarityModified, 0);

        // get a random stat multiplier for the attack rate stat from the given rarity

        /*randomRarityMultiplier = Random.Range(rarityTierArg.statMultiplierBoundaryLow,
         *  rarityTierArg.statMultiplierBoundaryHigh);*/
        // TEMP LINE!!! Apparently, Random cannot be called during serilization so just doing this for now...
        randomRarityMultiplier = (rarityTierArg.statMultiplierBoundaryLow + rarityTierArg.statMultiplierBoundaryHigh) / 2f;

        // set the rarity modified attack rate stat using the retrieved modifier
        attackRateRarityModified = attackRateBase / randomRarityMultiplier;

        // ensure rarity modified attack rate is a valid value
        attackRateRarityModified = Mathf.Max(attackRateRarityModified, 0f);
    }
コード例 #2
0
 public Resource(int id, string name, RarityTier rarity, string description, ResourceType type, string spritePath)
 {
     this.id          = id + Constant.IDMask.RESOURCE_ID_MASK;
     this.name        = name;
     this.rarity      = rarity;
     this.description = description;
     this.type        = type;
     this.spritePath  = spritePath;
 }
コード例 #3
0
 public Equipment(int id, string name, RarityTier rarity, string description, EquipmentPosition position, string spritePath, Character.AllStats stats)
 {
     this.id          = id;
     this.name        = name;
     this.rarity      = rarity;
     this.description = description;
     this.position    = position;
     this.spritePath  = spritePath;
     this.stats       = stats;
 }
コード例 #4
0
    private void Setup(InventoryItemInfo templateArg)
    {
        itemId          = templateArg.itemId;
        itemName        = templateArg.itemName;
        itemDescription = templateArg.itemDescription;

        itemPrefixName = templateArg.itemPrefixName;

        itemRarity = new RarityTier(templateArg.itemRarity);
    }
コード例 #5
0
    private void Setup()
    {
        itemId          = "0";
        itemName        = "NAME";
        itemDescription = "DESCRIPTION";

        itemPrefixName = "PREFIX-NAME";

        itemRarity = new RarityTier();
    }
コード例 #6
0
ファイル: RarityTier.cs プロジェクト: nichjaim/network-3d-fps
    private void Setup(RarityTier templateArg)
    {
        rarityId          = templateArg.rarityId;
        rarityName        = templateArg.rarityName;
        rarityDescription = templateArg.rarityDescription;

        statMultiplierBoundaryLow  = templateArg.statMultiplierBoundaryLow;
        statMultiplierBoundaryHigh = templateArg.statMultiplierBoundaryHigh;

        rarityHexColorCode = templateArg.rarityHexColorCode;

        contentPrefixName = templateArg.contentPrefixName;
    }
コード例 #7
0
    public Resource(int id, string name, RarityTier rarity, string description, ResourceType type, string spritePath, CraftingData craftingMaterials)
    {
        if (!IsRecipeType(type))
        {
            Debug.LogError("Only Recipe type can contain CraftingMaterials. Otherwise may caused errors.");
        }

        this.id           = id;
        this.name         = name;
        this.rarity       = rarity;
        this.description  = description;
        this.type         = type;
        this.spritePath   = spritePath;
        this.craftingData = craftingMaterials;
    }
コード例 #8
0
    public Resource(int id, string name, RarityTier rarity, string description, ResourceType type, string spritePath, Effect effect)
    {
        if (!(type == ResourceType.Consumable || type == ResourceType.Gadget || type == ResourceType.Medicine))
        {
            Debug.LogError("Only Consumable type can contain Effect. Otherwise may caused errors.");
        }

        this.id          = id;
        this.name        = name;
        this.rarity      = rarity;
        this.description = description;
        this.type        = type;
        this.spritePath  = spritePath;
        this.effect      = effect;
    }
コード例 #9
0
    PickUpTier GetTier()
    {
        if (tiersProbability.Count == 0)
        {
            for (int i = 0; i < tiers.Count; i++)
            {
                for (int j = 0; j < tiers[i].rarity; j++)
                {
                    tiersProbability.Add(tiers[i].tier);
                }
            }
        }

        int        id     = Random.Range(0, tiersProbability.Count);
        RarityTier rarity = tiersProbability[id];

        tiersProbability.Remove(rarity);

        PickUpTier tier = dicTiers[rarity];

        return(tier);
    }
コード例 #10
0
ファイル: RarityTier.cs プロジェクト: nichjaim/network-3d-fps
 public RarityTier(RarityTier templateArg)
 {
     Setup(templateArg);
 }