/// <summary> /// 아이템 등급에 따른 이름 색상 /// </summary> /// <param name="rank">아이템 등급</param> /// <returns>이름 색상</returns> ConsoleColor GetColor(ItemRank rank) { switch (rank) { case ItemRank.Normal: return(ConsoleColor.White); case ItemRank.Exceed: return(ConsoleColor.Yellow); case ItemRank.Rare: return(ConsoleColor.Cyan); case ItemRank.Artifact: return(ConsoleColor.Green); case ItemRank.Unique: return(ConsoleColor.Magenta); case ItemRank.Epic: return(ConsoleColor.Red); default: return(ConsoleColor.White); } }
public Item(string name, string text, string icon, ItemRank rank) { Name = name; Text = text; Icon = icon; Rank = rank; }
public int AttributeCount(ItemRank itemRank) { int attributeCount = 0; switch (itemRank) { case ItemRank.Normal: attributeCount = 0; break; case ItemRank.High: attributeCount = Random.Range(1, 3); break; case ItemRank.Rare: attributeCount = Random.Range(3, 5); break; case ItemRank.Unique: attributeCount = Random.Range(5, 7); break; } Debug.Log(attributeCount); return(attributeCount); }
//public Item OpenChest(int _playerLevel, Chest _chest) //{ // int[] table = _chest.table; // int max = (int)ItemGroup.Max; // int itemGroup = Random.Range(0, max); // int itemIndex = Random.Range(0, itemTable[itemGroup].Count); // ItemRank itemRank = SetItemRank(_chest.table); // int optionCount = 0; // List<int> optionIndex = new List<int>(); // List<int> optionValue = new List<int>(); // List<int> duplication = new List<int>(); // if (_chest.chestType > 10000) //Special Chest // { // } // else // { // if ((int)itemGroup < (int)ItemGroup.SkillCore) // { // switch (itemRank) // { // case ItemRank.Normal: // optionCount = 0; // break; // case ItemRank.High: // optionCount = Random.Range(1, 3); // break; // case ItemRank.Rare: // optionCount = Random.Range(3, 7); // break; // case ItemRank.Unique: // //나중에 유니크옵 따로 구현 // break; // } // for (int i = 0; i < optionCount; i++) // { // //중복검사기 // optionIndex[i] = Random.Range(0, optionTable.Count); // optionValue[i] = Random.Range(System.Int32.Parse(optionTable[optionIndex[i]]["min"].ToString()), System.Int32.Parse(optionTable[optionIndex[i]]["max"].ToString())); // } // } // else //skillcore // { // } // } // Item item = null; // switch((ItemGroup)itemGroup) // { // case ItemGroup.Weapon: // item = new Weapon((ItemGroup)itemGroup, itemIndex, itemRank); // break; // case ItemGroup.Armor: // item = new Armor((ItemGroup)itemGroup, itemIndex, itemRank); // break; // case ItemGroup.SkillCore: // break; // } // optionIndex.Clear(); // optionValue.Clear(); // duplication.Clear(); // return item; //} public ItemRank SetItemRank(int[] _table) { int total = 0; foreach (int item in _table) { total += item; } int randomNumber = Random.Range(0, total); ItemRank itemRank = 0; for (int i = 0; i < _table.Length; i++) { if (randomNumber <= _table[i]) { itemRank = (ItemRank)i; break; } else { randomNumber -= _table[i]; } } return(itemRank); }
public Portion(string name, string text, string icon, ItemRank rank, int hpPoint, int mpPoint, double hpPercent, double mpPercent) : base(name, text, icon, rank) { HpPoint = hpPoint; MpPoint = mpPoint; HpPercent = hpPercent; MpPercent = mpPercent; }
public Weapon InstantiateWeapon(ItemRank rank) { if (weaponRankList[(int)rank].Count > 0) { int index = Random.Range(0, weaponRankList[(int)rank].Count); ScriptableWeaponInfo info = weaponRankList[(int)rank][index]; weaponRankList[(int)rank].RemoveAt(index); return((Weapon)Activator.CreateInstance(Type.GetType(info.name), new object[] { info })); } return(null); }
/// <summary> /// 재료 아이템을 만든다. /// </summary> /// <returns></returns> public Item MakeMaterial(Item frame) { Type = ItemType.Material; Name = frame.Name; Rank = frame.Rank; Description = frame.Description; Value = frame.Value; Level = frame.Level; return(this); }
/// <summary> /// 포션 아이템을 만든다. /// </summary> /// <returns></returns> public Item MakePotion(Item frame) { Type = ItemType.Potion; Name = frame.Name; Rank = frame.Rank; Description = frame.Description; Value = frame.Value; Level = frame.Level; // TODO: formattedPotionEffect return(this); }
public EquippableItem(string name, string text, string icon, ItemRank rank, EquipmentType type, int powerBonus, int defanseBouns, int rangeBonus, double powerPercentBonus, double defansePercentBonus, double rangePercentBonus) : base(name, text, icon, rank) { Type = type; PowerBonus = powerBonus; DefanseBonus = defanseBouns; RangeBonus = rangeBonus; PowerPercentBonus = powerPercentBonus; DefansePercentBonus = defansePercentBonus; RangePercentBonus = rangePercentBonus; }
void OnEnable() { itemRankDatabase = AssetDatabase.LoadAssetAtPath(DATABASE_PATH, typeof(ItemRankDatabase)) as ItemRankDatabase; if (itemRankDatabase == null) { if (!AssetDatabase.IsValidFolder("Assets/Resources/Scripts")) { AssetDatabase.CreateFolder("Assets/Resources", "Scripts"); } itemRankDatabase = ScriptableObject.CreateInstance <ItemRankDatabase>(); AssetDatabase.CreateAsset(itemRankDatabase, DATABASE_PATH); AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); } curItem = new ItemRank(); }
private static void CreateItem() { Items newItem = new Items(); Random rnd = new Random(); newItem.Name = newItem.items[rnd.Next(0, newItem.items.Length)]; ItemRank newQuality = new ItemRank(); Random rnd2 = new Random(); newQuality.QualityName = newQuality.quality[rnd2.Next(0, newQuality.quality.Length)]; int damage = ItemRank.RndAttackDmg(newQuality.QualityName); Console.WriteLine(newQuality.QualityName + " " + newItem.Name); Console.WriteLine(damage); }
void AddQuality() { //name curItem.Name = EditorGUILayout.TextField("Name: ", curItem.Name); //sprite if (curItem.Icon) { curTexture = curItem.Icon.texture; } else { curTexture = null; } //select sprite button if (GUILayout.Button(curTexture, GUILayout.Width(SPRITE_BUTTON_SIZE), GUILayout.Height(SPRITE_BUTTON_SIZE))) { int controllerID = EditorGUIUtility.GetControlID(FocusType.Passive); EditorGUIUtility.ShowObjectPicker <Sprite>(null, true, null, controllerID); } //update sprite button image string commandName = Event.current.commandName; if (commandName == "ObjectSelectorUpdated") { curItem.Icon = EditorGUIUtility.GetObjectPickerObject() as Sprite; Repaint(); } //GUI.SetNextControlName("Save"); //names the following control "Save", a button's text is not its control name if (GUILayout.Button("Save")) { if (curItem == null || curItem.Name == "") { return; } itemRankDatabase.Add(curItem); curItem = new ItemRank(); GUI.FocusControl("Save"); } }
/// <summary> /// [생성자] 포션 아이템을 설정한다. /// </summary> /// <param name="name">이름</param> /// <param name="itemRank">아이템 등급</param> /// <param name="description">아이템 설명</param> /// <param name="value">아이템 가치</param> /// <param name="level">사용 최소레벨</param> /// <param name="formattedPotionEffect">포션 효과 정보, ex)</param> public Item(string name, string itemRank, string description, int value, int level, string formattedPotionEffect) { Type = ItemType.Potion; Name = name; switch (itemRank) { case "1": Rank = ItemRank.Normal; break; case "2": Rank = ItemRank.Exceed; break; case "3": Rank = ItemRank.Rare; break; case "4": Rank = ItemRank.Artifact; break; case "5": Rank = ItemRank.Unique; break; case "6": Rank = ItemRank.Epic; break; } Description = description; Value = value; Level = level; FormattedPotionEffect = formattedPotionEffect; }
protected BaseItem(ItemRank rank) { this._rank = rank; }
public Item CreateItem(ItemList kinds, ItemRank rank) { var info = _itemInformationGroup[(int)kinds]; var item = new Item() .SetItem(kinds) .SetRank(rank) //.SetCost(info.Cost) .SetPrice(info.Price) .SetDamage(info.EquipmentDamage) .SetDefense(info.EquipmentDefense) .SetHealth(info.EquipmentHealth) .SetReleaseCost(info.ReleaseCost); switch (kinds) { case ItemList.LeatherArmor: item.MountEvent = (args) => { }; item.UnMountEvent = (args) => { }; break; case ItemList.Goggles: item.MountEvent = (args) => { var customArgs = new CustomActionArgs(); customArgs.SetMorphable(args.Item); ConditionalEventManager.GetInstance.AddConditionalAction(ConditionalEventManager.ActionFlag.OnKillEnemy, eventArgs => { var itemInfo = eventArgs.Args["DamageUp"].MorphObject as Item; if (itemInfo.Release && Random.Range(0, 100) < 20) { Buff.CreateBuff( PlayerChampionHandler.GetInstance.Handle, PlayerChampionHandler.GetInstance.Handle, Buff._MainCategoryType.AttackIncrease ) .SetAction(Buff.EventType.OnBirth, buffArgs => { PlayerItemManager.GetInstance.EquipmentDamage += 10; }, true ) .SetAction(Buff.EventType.OnTerminate, buffArgs => PlayerItemManager.GetInstance.EquipmentDamage -= 10, true ) .SetTrigger() .BuffArgsClass.SetDurtaion(10); } }, "DamageUp", customArgs); ConditionalEventManager.GetInstance.AddConditionalAction(ConditionalEventManager.ActionFlag.OnChargeAttack, eventArgs => { var itemInfo = eventArgs.Args["Shield"].MorphObject as Item; if (itemInfo.Release && Random.Range(0, 100) < 50) { Buff.CreateBuff( PlayerChampionHandler.GetInstance.Handle, PlayerChampionHandler.GetInstance.Handle, Buff._MainCategoryType.Shield ) .SetAction(Buff.EventType.OnBirth, buffArgs => { PlayerChampionHandler.GetInstance.Handle.Shield += 30; }, true ) .SetAction(Buff.EventType.OnTerminate, buffArgs => PlayerChampionHandler.GetInstance.Handle.Shield -= 30, true ) .SetTrigger() .BuffArgsClass.SetDurtaion(5); } }, "Shield", customArgs); }; item.UnMountEvent = (args) => { ConditionalEventManager.GetInstance.RemoveConditionalAction(ConditionalEventManager.ActionFlag.OnKillEnemy, "DamageUp"); ConditionalEventManager.GetInstance.RemoveConditionalAction(ConditionalEventManager.ActionFlag.OnChargeAttack, "Shield"); }; break; case ItemList.IronBoots: item.MountEvent = (args) => { }; item.UnMountEvent = (args) => { }; break; case ItemList.Gloves: item.MountEvent = (args) => { }; item.UnMountEvent = (args) => { }; break; case ItemList.WoodenClub: item.MountEvent = (args) => { }; item.UnMountEvent = (args) => { }; break; case ItemList.Dagger: item.MountEvent = (args) => { }; item.UnMountEvent = (args) => { }; break; case ItemList.Axe: item.MountEvent = (args) => { }; item.UnMountEvent = (args) => { }; break; case ItemList.Rapier: item.MountEvent = (args) => { }; item.UnMountEvent = (args) => { }; break; case ItemList.Cloak: item.MountEvent = (args) => { }; item.UnMountEvent = (args) => { }; break; case ItemList.LongBow: item.MountEvent = (args) => { }; item.UnMountEvent = (args) => { }; break; case ItemList.LongSword: item.MountEvent = (args) => { }; item.UnMountEvent = (args) => { }; break; case ItemList.Maingauche: item.MountEvent = (args) => { }; item.UnMountEvent = (args) => { }; break; case ItemList.Mace: item.MountEvent = (args) => { }; item.UnMountEvent = (args) => { }; break; case ItemList.HalfGloves: item.MountEvent = (args) => { }; item.UnMountEvent = (args) => { }; break; case ItemList.Boots: item.MountEvent = (args) => { }; item.UnMountEvent = (args) => { }; break; case ItemList.Circlet: item.MountEvent = (args) => { }; item.UnMountEvent = (args) => { }; break; case ItemList.CrossBow: item.MountEvent = (args) => { }; item.UnMountEvent = (args) => { }; break; case ItemList.ShortBow: item.MountEvent = (args) => { var customArgs = new CustomActionArgs(); customArgs.MorphObject = args.Item; ConditionalEventManager.GetInstance.AddConditionalAction(ConditionalEventManager.ActionFlag.OnNormalAttack, eventArgs => { var itemInfo = eventArgs.Args["BonusShot"].MorphObject as Item; if (itemInfo.ActiveEffectCoolTime > Time.realtimeSinceStartup - 0.5f) { return; } var nearEnemy = PlayerChampionHandler.GetInstance.Handle.MostNearEnemy; if (itemInfo.Release && nearEnemy != null) { var caster = PlayerChampionHandler.GetInstance.Handle; var autoFire = caster.ThisAutoFireCluster .AutoFireGroupMappedToGroupZwei[ Random.Range(0, PlayerChampionHandler.GetInstance.Handle.ThisAutoFireCluster .AutoFireGroupMappedToGroupZwei.Count)]; autoFire.TracingFire(ProjectileFactory.Type.PurpleLightningBullet, caster.GetForward, nearEnemy); itemInfo.ActiveEffectCoolTime = Time.realtimeSinceStartup; } }, "BonusShot", customArgs); }; item.UnMountEvent = (args) => { ConditionalEventManager.GetInstance.RemoveConditionalAction(ConditionalEventManager.ActionFlag.OnNormalAttack, "BonusShot"); }; break; case ItemList.ShortSword: item.MountEvent = (args) => { }; item.UnMountEvent = (args) => { }; break; case ItemList.Shoes: item.MountEvent = (args) => { }; item.UnMountEvent = (args) => { }; break; case ItemList.ThrowingDagger: item.MountEvent = (args) => { }; item.UnMountEvent = (args) => { }; break; case ItemList.Staff: item.MountEvent = (args) => { }; item.UnMountEvent = (args) => { }; break; case ItemList.IronGloves: item.MountEvent = (args) => { }; item.UnMountEvent = (args) => { }; break; case ItemList.ShoulderArmor: item.MountEvent = (args) => { }; item.UnMountEvent = (args) => { }; break; case ItemList.Robe: item.MountEvent = (args) => { }; item.UnMountEvent = (args) => { }; break; case ItemList.Orb: item.MountEvent = (args) => { }; item.UnMountEvent = (args) => { }; break; case ItemList.Wand: item.MountEvent = (args) => { }; item.UnMountEvent = (args) => { }; break; case ItemList.Cloth: item.MountEvent = (args) => { }; item.UnMountEvent = (args) => { }; break; case ItemList.IronArmor: item.MountEvent = (args) => { }; item.UnMountEvent = (args) => { }; break; case ItemList.IronHelmet: item.MountEvent = (args) => { }; item.UnMountEvent = (args) => { }; break; default: throw new ArgumentOutOfRangeException(nameof(kinds), kinds, null); } return(item); }
/// <summary> /// [생성자] 장비 아이템을 설정한다. /// </summary> /// <param name="name">이름</param> /// <param name="level">장착 최소레벨</param> /// <param name="equipmentType">장비 유형</param> /// <param name="itemRank">아이템 등급</param> /// <param name="formattedEquipmentEffect">장비 효과 정보, ex) "p15/s10/i7/w8/c12/a13/h150/m120/x4/y3/t165/d138/e25" => 힘 +15, 체력 +10, 지능 +7, 정신력 +8, 집중력 +12, 민첩 +13, HP MAX +150, MP MAX +120, HP회복 +4, MP회복 +3, 공격력 +165, 방어력 +138, 공격속도 +25</param> public Item(string name, int level, string equipmentType, string itemRank, string formattedEquipmentEffect) { Type = ItemType.Equipment; Name = name; Level = level; switch (equipmentType) { case "0": EqType = EquipmentType.None; break; case "1": EqType = EquipmentType.Sword; break; case "2": EqType = EquipmentType.Staff; break; case "3": EqType = EquipmentType.Gun; break; case "4": EqType = EquipmentType.LeatherHelmet; break; case "5": EqType = EquipmentType.MetalHelmet; break; case "6": EqType = EquipmentType.LeatherArmor; break; case "7": EqType = EquipmentType.MetalArmor; break; case "8": EqType = EquipmentType.LeatherTrouser; break; case "9": EqType = EquipmentType.MetalTrouser; break; case "10": EqType = EquipmentType.LeatherShoes; break; case "11": EqType = EquipmentType.MetalShoes; break; case "12": EqType = EquipmentType.SteelNecklace; break; case "13": EqType = EquipmentType.AlloyNecklace; break; case "14": EqType = EquipmentType.SteelRing; break; case "15": EqType = EquipmentType.AlloyRing; break; case "16": EqType = EquipmentType.Emblem; break; } switch (itemRank) { case "1": Rank = ItemRank.Normal; break; case "2": Rank = ItemRank.Exceed; break; case "3": Rank = ItemRank.Rare; break; case "4": Rank = ItemRank.Artifact; break; case "5": Rank = ItemRank.Unique; break; case "6": Rank = ItemRank.Epic; break; } FormattedEquipmentEffect = formattedEquipmentEffect; }
public Scroll(string name, string text, string icon, ItemRank rank, Magic magic) : base(name, text, icon, rank) { this.magic = magic; }
/// <summary> /// 장비 아이템을 만든다. /// </summary> /// <returns></returns> public Item MakeEquipment(Item frame) { Type = ItemType.Equipment; Name = frame.Name; Level = frame.Level; EqType = frame.EqType; Rank = frame.Rank; Effect = new Ability(Ability.CalculateRule.Equipment); Effect.Reset(); EffectStrings = new List <string>(); FormattedEquipmentEffect = frame.FormattedEquipmentEffect; // 효과가 없는 장비 if (StringUtil.IsEmpty(FormattedEquipmentEffect)) { return(this); } // 효과 파싱 string[] effects = FormattedEquipmentEffect.Split('/'); foreach (string effect in effects) { // 효과 유형 분석 string effectTypeString = effect.Substring(0, 1); // 효과 값 분석 int value = int.Parse(effect.Substring(1)); switch (effectTypeString) { case "p": Effect.Power = value; EffectStrings.Add($"힘 +{value}"); break; case "s": Effect.Stamina = value; EffectStrings.Add($"체력 +{value}"); break; case "i": Effect.Intelli = value; EffectStrings.Add($"지능 +{value}"); break; case "w": Effect.Willpower = value; EffectStrings.Add($"정신력 +{value}"); break; case "c": Effect.Concentration = value; EffectStrings.Add($"집중력 +{value}"); break; case "a": Effect.Agility = value; EffectStrings.Add($"민첩 +{value}"); break; case "h": Effect.HPMax = value; EffectStrings.Add($"HP MAX +{value}"); break; case "x": Effect.HPRec = value; EffectStrings.Add($"HP회복 +{value}"); break; case "m": Effect.MPMax = value; EffectStrings.Add($"MP MAX +{value}"); break; case "y": Effect.MPRec = value; EffectStrings.Add($"MP회복 +{value}"); break; case "t": Effect.Attack = value; EffectStrings.Add($"공격력 +{value}"); break; case "d": Effect.Defense = value; EffectStrings.Add($"방어력 +{value}"); break; case "e": Effect.AttackSpeed = value; EffectStrings.Add($"공격속도 +{value}"); break; } } return(this); }
public DroppedItem CreateItem(Vector2 pos, ItemRank rank) { return(CreateItem(pos, InstantiateWeapon(rank))); }
protected BaseItem(ItemRank rank, List <IPrefix <IStatus> > prefixList, List <ISuffix <IStatus> > suffixList) { this._prefixList = prefixList; this._suffixList = suffixList; this._rank = rank; }