void DecideItemRarity() { if (itemTypeToSpawn != ItemType.Item) { float itemRarityRanNum = (Random.Range(0, randomMaxNum + 1) / randomMaxNum) * 100; if (itemRarityRanNum < rarityChanceSettings.common) { rarityTypeToSpawn = RarityType.Common; } else if (itemRarityRanNum < rarityChanceSettings.unCommon) { rarityTypeToSpawn = RarityType.Uncommon; } else if (itemRarityRanNum < rarityChanceSettings.rare) { rarityTypeToSpawn = RarityType.Rare; } else if (itemRarityRanNum < rarityChanceSettings.epic) { rarityTypeToSpawn = RarityType.Epic; } else if (itemRarityRanNum < rarityChanceSettings.legendary) { rarityTypeToSpawn = RarityType.Legendary; } } else { rarityTypeToSpawn = RarityType.Uncommon; } }
public Rarity(int id, I18NString name, RarityType type, string colorCode) { Id = id; Name = name; Type = type; ColorCode = colorCode; }
public void SetBase(EnemyBase enemyBase, RarityType rarity, int level, EnemyActor actor) { BaseEnemyData = enemyBase; Name = enemyBase.idName; Level = level; CurrentActor = actor; OnHitData.SourceActor = actor; BaseHealth = (float)(Helpers.GetEnemyHealthScaling(level) * enemyBase.healthScaling); MaximumHealth = (int)BaseHealth; CurrentHealth = MaximumHealth; movementSpeed = enemyBase.movementSpeed; minAttackDamage = (int)(enemyBase.attackDamageMinMultiplier * Helpers.GetEnemyDamageScaling(level)); maxAttackDamage = (int)(enemyBase.attackDamageMaxMultiplier * Helpers.GetEnemyDamageScaling(level)); foreach (ElementType element in Enum.GetValues(typeof(ElementType))) { ElementData[element] = enemyBase.resistances[(int)element]; } CurrentShieldDelay = 0f; foreach (AbilityScalingBonusProperty bonusProp in enemyBase.leveledBonusProperties) { AddStatBonus(bonusProp.bonusType, bonusProp.restriction, bonusProp.modifyType, bonusProp.initialValue + bonusProp.growthValue * level); } }
public Dagger(string name, double damage, string blade, RarityType rarityType) { this.name = name; this.damage = damage; this.blade = blade; this.rarityType = rarityType; }
public ItemModel(int ID, string name, string description, int level, RarityType rarityType, int stackedCount) : this(ID, level) { this.Name = name; this.Description = description; this.RarityType = rarityType; this.StackedCount = stackedCount; }
public Axe(string name, double damage, string shaft, RarityType rarityType) { this.name = name; this.damage = damage; this.shaft = shaft; this.rarityType = rarityType; }
protected void IncreaseWeaponDamageAccordingToType() { RarityType rarityType = (RarityType)Enum.Parse(typeof(RarityType), this.RarityType); this.MinDamage *= (int)rarityType; this.MaxDamage *= (int)rarityType; }
public Tags(ItemType aItemType, RarityType aRarityType, string aName, string aDescription) { itemType = aItemType; rarity = aRarityType; name = aName; description = aDescription; }
private void AddEquipmentDrops(BattleEndWindow battleEndWindow) { //Get Equipment int additionalDrops = (int)(survivalLoopCount / 5); float rarityBoost = 1 + (0.25f * survivalLoopCount); float nonStageEpicBoost = 1 + (0.4f * survivalLoopCount); float stageEpicBoost = 1 + (0.25f * survivalLoopCount * 5); float affixLevelSkew = 1.2f + (survivalLoopCount * 0.1f); int equipmentDrops = Random.Range(stageInfo.equipmentDropCountMin + additionalDrops, stageInfo.equipmentDropCountMax + 1 + additionalDrops); WeightList <RarityType> nonStageDropRarity = new WeightList <RarityType>(); nonStageDropRarity.Add(RarityType.UNCOMMON, (int)(BASE_UNCOMMON_DROP_WEIGHT / rarityBoost)); nonStageDropRarity.Add(RarityType.RARE, (int)(BASE_RARE_DROP_WEIGHT * rarityBoost)); nonStageDropRarity.Add(RarityType.EPIC, (int)(BASE_EPIC_DROP_WEIGHT * nonStageEpicBoost)); nonStageDropRarity.Add(RarityType.UNIQUE, (int)(BASE_UNIQUE_DROP_WEIGHT * nonStageEpicBoost)); WeightList <RarityType> stageDropRarity = new WeightList <RarityType>(); stageDropRarity.Add(RarityType.UNCOMMON, (int)(BASE_UNCOMMON_DROP_WEIGHT_STAGE_DROP / rarityBoost)); stageDropRarity.Add(RarityType.RARE, (int)(BASE_RARE_DROP_WEIGHT_STAGE_DROP * rarityBoost)); stageDropRarity.Add(RarityType.EPIC, (int)(BASE_EPIC_DROP_WEIGHT_STAGE_DROP * stageEpicBoost)); if (stageInfo.equipmentDropList.Count == 0) { int boostedRarityDrops = System.Math.Max(equipmentDrops / 2, 1); for (int i = 0; i < equipmentDrops; i++) { RarityType rarity; if (i < boostedRarityDrops) { rarity = stageDropRarity.ReturnWeightedRandom(); } else { rarity = nonStageDropRarity.ReturnWeightedRandom(); } AddNonStagePoolDrop(affixLevelSkew, rarity); } } else { WeightList <string> weightList = Helpers.CreateWeightListFromWeightBases(stageInfo.equipmentDropList); int dropsFromStagePool = System.Math.Max(equipmentDrops / 2, 1); for (int i = 0; i < dropsFromStagePool; i++) { string baseId = weightList.ReturnWeightedRandom(); var equip = Equipment.CreateEquipmentFromBase(ResourceManager.Instance.GetEquipmentBase(baseId), stageLevel + survivalLoopCount); RollEquipmentRarity(equip, stageDropRarity.ReturnWeightedRandom(), affixLevelSkew); gainedEquipment.Add(equip); } for (int i = 0; i < equipmentDrops - dropsFromStagePool; i++) { RarityType rarity = nonStageDropRarity.ReturnWeightedRandom(); AddNonStagePoolDrop(affixLevelSkew, rarity); } } }
public Item(String itemname, int value, Boolean stackable) { itemName = itemname; itemValue = value; canStack = stackable; thisRarityType = RarityType.Normal; thisItemType = ItemType.Loot; }
public Tags(ItemType aItemType, RarityType aRarityType, string aName, string aImageURL, string aImageHoverTextURL) { itemType = aItemType; rarity = aRarityType; name = aName; imageURL = aImageURL; imageHoverTextURL = aImageHoverTextURL; }
private void RollEquipmentRarity(Equipment equip, RarityType rarity, float affixLevelSkew) { equip.SetRarity(rarity); equip.RerollAffixesAtRarity(null, affixLevelSkew, new HashSet <GroupType>() { GroupType.DROP_ONLY }); }
public Tags(ItemType aItemType, RarityType aRarityType, string aName, string aDescription, string aImageURL, OutfitTags aOutfitTags) { itemType = aItemType; rarity = aRarityType; name = aName; description = aDescription; imageURL = aImageURL; outfitTags = aOutfitTags; }
public Weapon(string name, RarityType rarity, int minDamage, int maxDamage, int socketsCount) { this.Name = name; this.MinDamage = minDamage; this.MaxDamage = maxDamage; this.Sockets = CreateSocketsForWeapon(socketsCount); this.socketCount = socketsCount; this.Rarity = rarity; }
public DefaultItemData(string itemName, string itemDescription, int itemValue, ItemType itemType, RarityType rarityType, Sprite itemIcon) { this.itemName = itemName; this.itemDescription = itemDescription; this.itemValue = itemValue; this.itemType = itemType; this.rarityType = rarityType; this.itemIcon = itemIcon; }
public Tags(ItemType aItemType, RarityType aRarityType, string aName, string aDescription, string aImageURL, WeaponTags aWeaponTags) { itemType = aItemType; rarity = aRarityType; name = aName; description = aDescription; imageURL = aImageURL; weaponTags = aWeaponTags; }
public ItemTypeAndRarityAlchemyIngredient(string name, string icon, ItemTypeType type, RarityType rarity, int count) { Name = name; Icon = icon; Count = count; this.type = type; this.rarity = rarity; }
protected Weapon(RarityType rarity, string name, string type, int minDamage, int maxDamage, Socket sockets) { this.rarity = rarity; this.Type = type; this.name = name; this.Mindamage = minDamage; this.Maxdamage = maxDamage; this.Sockets = sockets; this.gems = new GemsCollection(sockets); }
public static bool IsLootable(this ItemEntity item, RarityType filter = RarityType.None) { var rarity = item.Rarity(); if ((int)rarity < (int)filter) { return(false); } return(item.IsLootable); }
public Weapon CreateWeapon(string rarity, string weaponType, string weaponName) { RarityType rarityType = Enum.Parse <RarityType>(rarity); Type currentType = Type.GetType($"{StringNamespace}.{weaponType}"); var constructorParams = new object[] { weaponName, rarityType }; Weapon classInstance = (Weapon)Activator.CreateInstance(currentType, constructorParams); return(classInstance); }
public override void Run() { Console.WriteLine("Searching for cards...\n"); bool gotGuaranteedSR = false; for (int i = 0; i < 10; ++i) { var rand = new Random(); var lottery = rand.Next(100); RarityType rarity = RarityType.R; if (lottery < SSRChance) { rarity = RarityType.SSR; } else if (lottery < SRChance) { rarity = RarityType.SR; } if (i == 9 && rarity == RarityType.R && !gotGuaranteedSR) { rarity = RarityType.SR; } while (true) { var cardData = CardManager.AllCards().ToArray()[rand.Next(CardManager.AllCards().Count)]; if (cardData.Rarity == rarity) { bool isDupe = CardManager.Cards().Any(item => item.cardId == cardData.GetID()); string dupeText = isDupe ? " " : rarityNewString[rarity]; var cardText = $" {dupeText}{cardData.Name.str} ({cardData.Attribute})"; foreach (var c in cardText) { Console.Write(c); Thread.Sleep(2); } Console.Write("\n"); CardManager.AddCard(cardData); if (cardData.Rarity != RarityType.R) { gotGuaranteedSR = true; } Thread.Sleep(50); break; } } } }
public NpcModel(string id, string name, NpcRole npcRole, NpcRace npcRace, NpcSize npcSize, RarityType rarityType, CombatantModel combatantModel, string[] alwaysDroppedItemIDs = null) { this.ID = id; this.Name = name; this.NpcRole = npcRole; this.NpcRace = npcRace; this.NpcSize = npcSize; this.RarityType = rarityType; this.CombatantModel = combatantModel; this.AlwaysDroppedItemIDs = alwaysDroppedItemIDs; }
public List <ItemModel> GetAllItemsOfRarity(RarityType rarityType) { List <ItemModel> result = new List <ItemModel>(); for (int i = 0; i < AllItems.Count; i++) { if (AllItems[i].RarityType == rarityType) { result.Add(AllItems[i]); } } return(result); }
private CardModel GetCardData(string name, string spriteName, CardType cardType, RarityType rarityType, int cost, int attack, int life) { CardModel model = new CardModel(); model.Name = name; model.SpriteName = spriteName; model.Type = (int)cardType; model.RarityType = (int)rarityType; model.Cost = cost; model.Attack = attack; model.Life = life; return(model); }
public CardModel(CardPrototype prototype) { this.prototype = prototype; id = prototype.id; name = prototype.name; description = prototype.description.Replace("\\n", "\n"); // Allow newlines animation = prototype.animation; rarity = prototype.rarity; cost = prototype.cost; effect = prototype.effect; statGainType = prototype.statGainType; statGainAmount = prototype.statGainAmount; numCardsToDraw = prototype.numCardsToDraw; }
public Sword(string name, double damage, string blade, RarityType rarityType) { this.name = name; this.damage = damage; this.blade = blade; this.rarityType = rarityType; //this add different "magical properties" for the sword, which can then be selected SwordProperties.Add("+20 Cold Damage, "); SwordProperties.Add("+7% Increased Attack Speed, "); SwordProperties.Add("Reduced Cooldown of all Skills by 9%, "); SwordProperties.Add("+3 Life per Kill"); SwordProperties.Add("12% Chance to Stun on hit"); }
public void RarityButtonOnClick(RarityType rarityType, int index) { Image image = rarityButtons[index].GetComponent <Button>().image; if (rarityTypes.Contains(rarityType)) { image.color = Color.white; rarityTypes.Remove(rarityType); } else { image.color = Helpers.SELECTION_COLOR; rarityTypes.Add(rarityType); } }
public void CopyFrom(ItemModel itemModel, bool copyStackCount) { ID = itemModel.ID; InstanceID = itemModel.InstanceID; Name = itemModel.Name; Description = itemModel.Description; RarityType = itemModel.RarityType; _level_ZeroBased = itemModel.Level_ZeroBased; // Copy to private member to avoid redundant re-building of stats. HasBuiltStatsFromLevel = itemModel.HasBuiltStatsFromLevel; if (copyStackCount) { StackedCount = itemModel.StackedCount; } copyExtendedProperties(itemModel); }
public Item(Item data) { title = data.title; type = data.type; stats = data.stats; desc = data.desc; flavour = data.flavour; flines = data.flines; level = data.level; image = data.image; back = data.back; front = data.front; value = data.value; rarity = data.rarity; id = data.id; }
/// <summary> /// /// </summary> /// <param name="name"></param> /// <param name="cost"></param> /// <param name="weight"></param> /// <param name="description"></param> /// <param name="rarityType"></param> /// <param name="slotType"></param> public BaseItem(string name, double cost, double weight, string description, RarityType rarityType = RarityType.Normal, SlotType slotType = SlotType.None) { SlotType = slotType; RarityType = rarityType; Name = name; Cost = cost; Weight = weight; Description = description; Requirements = new List <Requirement>(); Modifiers = new List <Modifier>(); CombatActions = new List <CombatAction>(); Owner = null; }
private ZoneModel buildZone(int minNpcLevel, RarityType minNpcRarityType, RarityType maxNpcRarityType, int npcTeamID, int maxNpcs) { int numNpcs = 1; ZoneModel zoneModel = new ZoneModel(); zoneModel.EnemyNpcModels = new ServerNpcModel[numNpcs]; for (int i = 0; i < numNpcs; i++) { int zoneBasedLevel = minNpcLevel; ServerNpcModel serverNpcModel = buildRandomNPC(zoneBasedLevel, npcTeamID, minNpcRarityType, maxNpcRarityType); zoneModel.EnemyNpcModels[i] = serverNpcModel; } return(zoneModel); }
public Color GetRarityColor(RarityType rarity) { for (int i = 0; i < rarityColors.Length; i++) { if(rarityColors[i].rarity == rarity) return rarityColors[i].tintColor; } return Color.white; }
public Item() { value = 0; rarity = RarityType.Common; }
/// <summary> /// Initializes a new instance of the <see cref="Item"/> class. /// Used for equipment and quest items. /// </summary> /// <param name='name'> /// Name. /// </param> public Item(string name) { _name = name; _value = 0; _rarity = RarityType.Unique; }
/// <summary> /// Initializes a new instance with parameters of the <see cref="Item"/> class. /// Used for consummables that can be found or sold. /// </summary> /// <param> /// name = Name of the item. /// valye = Value of the item. /// rarity = Rarity of the item. /// </param> public Item(string name, int value, RarityType rare) { _name = name; _value = value; _rarity = rare; }
/// <summary> /// Initializes a default instance of the <see cref="Item"/> class. /// </summary> public Item() { _name = "Need Name"; _value = 0; _rarity = RarityType.Common; }