public static Weapon.Sword GenerateSword(Type.Tier _tier) { int damage = 0; switch (_tier) { case Type.Tier.common: damage = Random.Range(DAMAGE.COMMON_MIN, DAMAGE.COMMON_MAX); break; case Type.Tier.uncommon: damage = Random.Range(DAMAGE.UNCOMMON_MIN, DAMAGE.UNCOMMON_MAX); break; case Type.Tier.rare: damage = Random.Range(DAMAGE.RARE_MIN, DAMAGE.RARE_MAX); break; case Type.Tier.ultraRare: damage = Random.Range(DAMAGE.ULTRARARE_MIN, DAMAGE.ULTRARARE_MAX); break; case Type.Tier.epic: damage = Random.Range(DAMAGE.EPIC_MIN, DAMAGE.EPIC_MAX); break; } float weight = Random.Range(0f, 20f); return(GenerateSword(_tier, damage, weight)); }
public Axe(Type.Tier _tier, int _damage, Ability[] activeAbilities, Ability[] passiveAbilities, float _weight, int _value) : base(_weight, _value) { weaponType = Type.WeaponType.axe; itemType = Type.ItemType.weapon; tier = _tier; damage = _damage; weight = _weight; abilityActive1 = activeAbilities[0]; abilityActive2 = activeAbilities[1]; abilityActive3 = activeAbilities[2]; abilityActive4 = activeAbilities[3]; abilityPassive1 = passiveAbilities[0]; abilityPassive2 = passiveAbilities[1]; }
public static Weapon.Sword GenerateSword(Type.Tier _tier, int _damage, float _weight) { Ability[] abilitiesActive = new Ability[4]; Ability[] abilitiesPassive = new Ability[2]; string sqlStr = "select * from SYS_ABILITY where TYPE = " + ((int)Type.WeaponType.sword) + " and ACTIVE_PASSIVE = " + ((int)Type.ActivePassive.active) + " and TIER <= " + ((int)_tier); DataTable res = DB.Select(sqlStr); for (int i = 0; i < abilitiesActive.Length; i++) { } for (int i = 0; i < abilitiesPassive.Length; i++) { } return(new Weapon.Sword(_tier, _damage, abilitiesActive, abilitiesPassive, _weight, 10)); }
//--------------------------------SWORD-------------------------------// public static Weapon.Sword GenerateRandomSword() { Type.Tier tier = (Type.Tier)Random.Range(0, 4); return(GenerateSword(tier)); }