public static Armor creatRandomLevelArmor(int level, IFriendly creator = null, float qualityBonus = 0) { int numberOfWeponShape = ArmorShapeMasterManager.getInstance().getNumberOfShapes(); int shpeRand = Random.Range(0, numberOfWeponShape); ArmorShape shape = ArmorShapeMasterManager.getInstance().getShapeFromId(shpeRand); var armorMaterials = ItemMaterialMasterManager.getInstance().getMaterialFromLevel(level); int materialRand = Random.Range(0, armorMaterials.Count); ItemMaterial material = armorMaterials[materialRand]; if (creator == null) { float dex = material.getQuality() / 20; float diffculty = shape.getCreatDifficulty(); float baseQuality = material.getQuality(); qualityBonus = dex / 2; float quality = weaponQualityCaliculate(dex, diffculty, baseQuality, qualityBonus); return(new Armor(shape, material, quality)); } else { return(creatArmor(shape, material, creator, qualityBonus)); } }
public static Armor creatArmor(ArmorShape shape, ItemMaterial material, IFriendly creator, float qualityBonus) { float dex = creator.getFriendlyAbility(FriendlyAbility.DEX); float diffculty = shape.getCreatDifficulty(); float baseQuality = material.getQuality(); float quality = weaponQualityCaliculate(dex, diffculty, baseQuality, qualityBonus); return(new Armor(shape, material, quality)); }
/// <summary> /// コンストラクタ /// </summary> public Armor(ArmorShape shape, ItemMaterial material, float quality) { CLASSIFICATION_CODE = shape.getId() + material.getId(); BASE_DEF = shape.getDef(); BASE_VALUE = shape.getItemValue() + material.getItemValue(); DELAY_DISTURB_MAG = shape.getDelayDisturbMag(); DODGE_DISTURB_MAG = shape.getDodgeDisturbMag(); MAGIC_DISTURB_MAG = shape.getMagicDisturbMag(); this.quality = quality; CONSUMABILITY = material.getConsumability(); NAME = material.getName() + "の" + shape.getName(); DESCRIPTION = material.getAdditionalDescription() + shape.getAdditionalDescription(); FLAVOR_TEXT = material.getAdditionalFlavor() + shape.getAdditionalFlavor(); MASS = shape.getMass() + material.getMass(); HEAVINESS = material.getHeaviness(); }
/// <summary> /// コンストラクタ /// </summary> public Weapon(WeaponShape shape, ItemMaterial material, float quality) { CLASSIFICATION_CODE = shape.getId() + material.getId(); BASE_ATTACK = shape.getAttack(); RANGE = shape.getRange(); BASE_VALUE = material.getItemValue() + shape.getValue(); MASS = shape.getMass() + material.getMass(); BASE_HIT = shape.getHit(); NAME = material.getName() + "の" + shape.getName(); BASE_DELAY = shape.getDelay(); TYPE = shape.getWeaponType(); CONSUMABILITY = material.getConsumability(); this.quality = quality; DESCRIPTION = material.getAdditionalDescription() + shape.getAdditionalDescription(); FLAVOR_TEXT = material.getAdditionalFlavor() + shape.getAdditionalFlavor(); WEAPON_ABILITY = WeaponTypeHelper.getTypeAbility(TYPE); }