public Item CreateItem() { EItemRarity rarity = ReturnRarity(); Potion potionInstance = new Potion(rarity); return(potionInstance); }
public Item CreateItem() { EItemRarity rarity = ReturnRarity(); Weapon weaponInstance = new Weapon(rarity); return(weaponInstance); }
public static Color getRarityColorUI(EItemRarity rarity) { switch (rarity) { case EItemRarity.COMMON: return(ItemTool.RARITY_COMMON_UI); case EItemRarity.UNCOMMON: return(ItemTool.RARITY_UNCOMMON_UI); case EItemRarity.RARE: return(ItemTool.RARITY_RARE_UI); case EItemRarity.EPIC: return(ItemTool.RARITY_EPIC_UI); case EItemRarity.LEGENDARY: return(ItemTool.RARITY_LEGENDARY_UI); case EItemRarity.MYTHICAL: return(ItemTool.RARITY_MYTHICAL_UI); default: return(Color.white); } }
public void GenerateIM(EItemRarity rarity, out EItemModifyer prefixIM, out EItemModifyer suffixIM) { imToGen = Mathf.Clamp((int)rarity - 1, 0, 2); if (imToGen <= 0) { prefixIM = EItemModifyer.NONE; suffixIM = EItemModifyer.NONE; } else { getSuffix = (Random.Range((int)0, 2) == 0); if (imToGen == 1) { if (getSuffix) { prefixIM = EItemModifyer.NONE; suffixIM = (EItemModifyer)Random.Range(1, System.Enum.GetValues(typeof(EItemModifyer)).Length); } else { suffixIM = EItemModifyer.NONE; prefixIM = (EItemModifyer)Random.Range(1, System.Enum.GetValues(typeof(EItemModifyer)).Length); } } else { suffixIM = (EItemModifyer)Random.Range(1, System.Enum.GetValues(typeof(EItemModifyer)).Length); prefixIM = (EItemModifyer)Random.Range(1, System.Enum.GetValues(typeof(EItemModifyer)).Length); } } }
public Item CreateItem() { EItemRarity rarity = ReturnRarity(); Armor armorInstance = new Armor(rarity); return(armorInstance); }
public void CheckItemPropertyValue() { ArmorFactory factoryInstance = new ArmorFactory(); EItemRarity rarity = EItemRarity.LEGENDARY; Item armorInstance = factoryInstance.CreateItemUnitTest(rarity); Assert.That(armorInstance.BaseEnchantmentValue, Is.EqualTo(100)); }
//--------------------------------------------------------------------------- public Color GetColorByRarity(EItemRarity rarity) { if (m_RarityColors.ContainsKey(rarity)) { return(m_RarityColors[rarity]); } return(Color.White); }
public PredefinedItem(int level, int seed, EEquipmentType equipmentType, EItemRarity rarity) { this.level = level; this.seed = seed; this.equipmentType = equipmentType; this.rarity = rarity; overrideBaseStats = false; }
//--------------------------------------------------------------------------- public ItemDesc(string name, EItemType type, EItemRarity rarity, Sprite sprite, bool isStackable, bool isConsumable) : this() { Name = name; Type = type; Rarity = rarity; Sprite = sprite; IsStackable = isStackable; IsConsumable = isConsumable; }
public ItemStats CalculateItemStats(ItemStats baseStats, EItemRarity itemRarity, int itemLevel, int itemSeed) { Random.seed = itemSeed; baseStats.AddToAll((float)itemRarity * 2f); baseStats.MultiplyByAll(Mathf.Sqrt(itemLevel + 1) + Random.Range(.8f, 1.2f)); Random.seed = (int)System.DateTime.Now.Ticks; return(new ItemStats(baseStats)); }
public void CheckItemUpgradeProcess() { ArmorFactory factoryInstance = new ArmorFactory(); Item armorInstance = factoryInstance.CreateItemUnitTest(EItemRarity.COMMON); EItemRarity previousRarity = armorInstance.ItemRarity; armorInstance.UpgradeItem(); Assert.That(armorInstance.ItemRarity, Is.EqualTo(previousRarity + 1)); }
public PredefinedItem(int level, int seed, EEquipmentType equipmentType, EItemRarity rarity, ItemStats stats) { this.level = level; this.seed = seed; this.equipmentType = equipmentType; this.rarity = rarity; this.stats = stats; overrideBaseStats = true; }
public ItemTypes(ItemTypes types) { itemType = types.ItemType; equipmentType = types.EquipmentType; equipSlot = types.EquipSlot; weightClass = types.WeightClass; damageType = types.DamageType; weaponRange = types.WeaponRange; itemRarity = types.Rarity; prefixItemModifyer = types.PrefixModifyer; suffixItemModifyer = types.SuffixModifyer; }
public ItemTypes(EItemType itemType, EEquipmentType equipmentType, EItemEquipSlot equipSlot, EItemWeightClass weightClass, EWeaponDamageType damageType, EWeaponRange weaponRange, EItemRarity itemRarity, EItemModifyer prefixItemModifyer = EItemModifyer.NONE, EItemModifyer suffixItemModifyer = EItemModifyer.NONE) { this.itemType = itemType; this.equipmentType = equipmentType; this.equipSlot = equipSlot; this.weightClass = weightClass; this.damageType = damageType; this.weaponRange = weaponRange; this.itemRarity = itemRarity; this.prefixItemModifyer = prefixItemModifyer; this.suffixItemModifyer = suffixItemModifyer; }
public PredefinedItem(int level, int seed, EEquipmentType equipmentType, EItemRarity rarity, EItemModifyer prefixModifyer, EItemModifyer suffixModifyer, int prefixIndex, int suffixIndex) { this.level = level; this.seed = seed; this.equipmentType = equipmentType; this.rarity = rarity; this.prefixModifyer = prefixModifyer; this.suffixModifyer = suffixModifyer; this.prefixIndex = prefixIndex; this.suffixIndex = suffixIndex; overrideBaseStats = false; }
public static void DrawItems() { foreach (ItemRegion i in ItemManager.regions) { foreach (ItemDrop drop in i.drops) { if (drop.interactableItem.asset is ItemGunAsset) { EItemRarity rar = ((ItemGunAsset)drop.interactableItem.asset).rarity; if (rar == EItemRarity.COMMON || rar == EItemRarity.UNCOMMON || rar == EItemRarity.RARE) { continue; } float dist = Vector3.Distance(drop.model.position, Player.player.transform.position); if (dist > 160) { continue; } Vector3 Pos = Drawing_Hk.WorldToScreen(drop.model.position); if (Pos.x < 0 || Pos.y < 0 || Pos.x > Screen.width || Pos.y > Screen.height || Pos.z < 0) { continue; } int Size = (int)(500 / dist); if (Size < 7) { Size = 7; } if (Size > 11) { Size = 11; } GUIStyle centeredStyle = GUI.skin.GetStyle("Label"); centeredStyle.alignment = TextAnchor.UpperCenter; centeredStyle.fontSize = Size; centeredStyle.richText = false; GUI.Label(new Rect(Pos.x - 60, Pos.y - 10, 120, 20), drop.interactableItem.asset.itemName, centeredStyle); } } } }
public static void DrawItems() { System.Collections.Generic.List <InteractableItem> itemsInRadius; Items.GetItemsInRadius(out itemsInRadius, 18, 3950f); foreach (InteractableItem drop in itemsInRadius) { if (drop.asset is ItemGunAsset) { EItemRarity rar = ((ItemGunAsset)drop.asset).rarity; if (rar == EItemRarity.COMMON || rar == EItemRarity.UNCOMMON || rar == EItemRarity.RARE) { continue; } Vector3 Pos = Drawing_Hk.WorldToScreen(drop.transform.position); if (Pos.x < 0 || Pos.y < 0 || Pos.x > Screen.width || Pos.y > Screen.height || Pos.z < 0) { continue; } int Size = (int)(500 / Vector3.Distance(drop.transform.position, Player.player.transform.position)); if (Size < 7) { Size = 7; } if (Size > 11) { Size = 11; } GUIStyle centeredStyle = GUI.skin.GetStyle("Label"); centeredStyle.alignment = TextAnchor.UpperCenter; centeredStyle.fontSize = Size; centeredStyle.richText = false; GUI.Label(new Rect(Pos.x - 60, Pos.y - 10, 120, 20), drop.asset.itemName, centeredStyle); } } }
public EItemRarity ReturnRarity() { EItemRarity rarity = (EItemRarity)Random.Range((float)EItemRarity.COMMON, (float)EItemRarity.LEGENDARY + 1); return(rarity); }
public void Update() { if (!Global.ItemEnabled || Global.AllOff) { return; } if (!Provider.isConnected) { return; } if (Provider.clients.Count < 1) { return; } if (Player.player == null) { return; } if (LastPickup > Time.realtimeSinceStartup) { if (LastPickup - Time.realtimeSinceStartup > 10f) { LastPickup = 0f; } return; } if (Global.ItemSettings.AutoClothes) { if (ClothesSwap()) { return; } } if (Global.ItemSettings.AutoMedical) { if (AutoMedical()) { return; } } List <InteractableItem> itemsInRadius; GetItemsInRadius(out itemsInRadius, 8, 395f); if (itemsInRadius.Count < 1) { return; } if (Global.ItemSettings.CustomPickup) { if (CustomPickup(itemsInRadius)) { return; } } foreach (InteractableItem i in itemsInRadius) { float dst = Vector3.Distance(i.transform.position, Player.player.transform.position); if (dst < 2) { continue; } if (Global.ItemSettings.GrabAll) { GrabItem(i); return; } EItemRarity itemRarity = i.asset.rarity; if (i.asset is ItemGunAsset && Global.ItemSettings.GrabGuns) { if (!RarityCheck((int)itemRarity)) { continue; } GrabItem(i); return; } else if (i.asset.type == EItemType.MAGAZINE && (Global.ItemSettings.GrabClips || Global.ItemSettings.AutoArrow)) { if (Global.ItemSettings.AutoArrow && Player.player.equipment != null && !(!(Player.player.equipment.asset is ItemGunAsset) || (Player.player.equipment.asset.id != 357 && Player.player.equipment.asset.id != 346)) && !(i.asset.id != 347 && i.asset.id != 348 && i.asset.id != 351 && i.asset.id != 352 && i.asset.id != 1209)) { GrabItem(i); return; } if (!RarityCheck((int)itemRarity)) { continue; } if (Global.ItemSettings.GrabClips) { GrabItem(i); } return; } else if (i.asset.type == EItemType.MEDICAL && Global.ItemSettings.GrabMedical) { if (!RarityCheck((int)itemRarity)) { continue; } GrabItem(i); return; } else if ((i.asset.type == EItemType.FOOD || i.asset.type == EItemType.WATER) && Global.ItemSettings.GrabFood) { if (i.asset.quality < i.asset.qualityMax) { continue; } GrabItem(i); return; } else if (Global.ItemSettings.AutoClothes || Global.ItemSettings.AutoMedical) { if (i.asset.type == EItemType.SHIRT) { if (Player.player.clothing.shirt == 0 || Player.player.clothing.shirtAsset.rarity < i.asset.rarity || Global.ItemSettings.AutoMedical) { GrabItem(i); } } else if (i.asset.type == EItemType.PANTS) { if (Player.player.clothing.pants == 0 || Player.player.clothing.pantsAsset.rarity < i.asset.rarity || Global.ItemSettings.AutoMedical) { GrabItem(i); } } else if (i.asset.type == EItemType.BACKPACK) { if (Player.player.clothing.backpack == 0 || Player.player.clothing.backpackAsset.rarity < i.asset.rarity || Global.ItemSettings.AutoMedical) { GrabItem(i); } } else if (i.asset.type == EItemType.HAT) { if (Player.player.clothing.hat == 0 || Player.player.clothing.hatAsset.rarity < i.asset.rarity || Global.ItemSettings.AutoMedical) { GrabItem(i); } } else if (i.asset.type == EItemType.VEST) { if (Player.player.clothing.vest == 0 || Player.player.clothing.vestAsset.rarity < i.asset.rarity || Global.ItemSettings.AutoMedical) { GrabItem(i); } } else if (i.asset.type == EItemType.MASK) { if (Player.player.clothing.mask == 0) { GrabItem(i); } } else if (i.asset.type == EItemType.GLASSES) { if (Player.player.clothing.glasses == 0) { GrabItem(i); } } } } }
public static void DoGlow() { foreach (SteamPlayer play in Provider.clients) { if (play.player == Player.player) { continue; } Highlighter Highlighter = play.player.gameObject.GetComponent <Highlighter>(); if ((Global.VisualsEnabled && Global.VisSettings.Glow) && !Global.AllOff && !Hooks.askScreenshot.NeedingSpy) { if (Highlighter == null) { Highlighter = play.player.gameObject.AddComponent <Highlighter>(); } //Deprecated, http://docs.deepdream.games/HighlightingSystem/5.0/#toc9.1upgrading_from_v4.3_to_v5.0 //Highlighter.SeeThroughOn(); //Highlighter.OccluderOn(); //Color blue if in group if (play.player.quests.groupID == Player.player.quests.groupID) { Highlighter.ConstantOnImmediate(Color.blue); } else { Highlighter.ConstantOnImmediate(Color.yellow); } } else if (Highlighter != null) { Highlighter.ConstantOffImmediate(); MonoBehaviour.Destroy(Highlighter); } } if (Global.VisSettings.Items) { foreach (ItemRegion region in ItemManager.regions) { foreach (ItemDrop drop in region.drops) { if (drop.interactableItem.asset is ItemGunAsset) { EItemRarity rar = ((ItemGunAsset)drop.interactableItem.asset).rarity; if (rar == EItemRarity.COMMON || rar == EItemRarity.UNCOMMON || rar == EItemRarity.RARE) { continue; } Highlighter Highlighter = drop.interactableItem.gameObject.GetComponent <Highlighter>(); if (Global.VisualsEnabled && Global.VisSettings.Glow && !Global.AllOff && !Hooks.askScreenshot.NeedingSpy) { if (Highlighter == null) { Highlighter = drop.interactableItem.gameObject.AddComponent <Highlighter>(); } Highlighter.ConstantOnImmediate(Color.white); } else if (Highlighter != null) { Highlighter.ConstantOffImmediate(); MonoBehaviour.Destroy(Highlighter); } } } } } if (Hooks.askScreenshot.NeedingSpy) { System.Threading.Thread.Sleep(85); Hooks.askScreenshot.GlowReady = true; } }
public Weapon(EItemRarity pItemRarity) { _itemRarity = pItemRarity; GenerateItemDetails(); }
public Item CreateItemUnitTest(EItemRarity rarity) { Armor armorInstance = new Armor(rarity); return(armorInstance); }
public Armor(EItemRarity pItemRarity) { _itemRarity = pItemRarity; GenerateItemDetails(); }
public bool PutItemIntoMarche(uint itemID, string itemName, string SteamID, string VendeurName, int Number, int prix, EItemType type, EItemRarity rarity) { try { MySqlConnection connection = CreateConnection(); MySqlCommand cmd = new MySqlCommand("INSERT INTO binaryshop.marchecomu (`ItemID`, `ItemName`, `SteamID`, `VendeurName`, `Number`, `Prix`, `Type`, `Rarity`) VALUES (@ItemID, @ItemName,@SteamID,@VendeurName,@Number,@Prix,@Type,@Rarity)", connection); connection.Open(); if (connection.State == ConnectionState.Open) { cmd.Parameters.AddWithValue("@ItemID", itemID); cmd.Parameters.AddWithValue("@ItemName", itemName); cmd.Parameters.AddWithValue("@SteamID", SteamID); cmd.Parameters.AddWithValue("@VendeurName", VendeurName); cmd.Parameters.AddWithValue("@Number", Number); cmd.Parameters.AddWithValue("@Prix", prix); cmd.Parameters.AddWithValue("@Type", type.ToString()); cmd.Parameters.AddWithValue("@Rarity", rarity.ToString()); cmd.ExecuteNonQuery(); cmd.Parameters.Clear(); return(true); } else { return(false); } } catch (Exception ex) { Logger.Log(ex); return(false); } }