private string imageNameFromEnchantment(EnchantmentType enchantment) { if (enchantment == EnchantmentType.Unset) { return(string.Empty); } //var encodedString = Uri.EscapeDataString(stringFromEnchantment(enchantment)); //return string.Format("{0}.png", encodedString); return(string.Format("T_{0}_Icon.png", enchantment.ToString())); }
public ItemMetaBuilder AddStoredEnchantment(EnchantmentType type, int level) { this.storedEnchantments.Add(type, new Enchantment { Type = type, Level = level }); return(this); }
private void starColorList(object sender, EventArgs e) { switch (comboBoxStarColor.Text) { case "红": starColor = EnchantmentType.Red; break; case "绿": starColor = EnchantmentType.Green; break; case "蓝": starColor = EnchantmentType.Blue; break; } }
public BitmapImage?imageSourceForEnchantment(EnchantmentType enchantmentType) { if (enchantmentType == EnchantmentType.Unset) { return(null); } //var filename = imageNameFromEnchantment(enchantmentType); var filename = "Enchantments.png"; var path = Path.Combine(IMAGES_URI, filename); var uri = new Uri(path); return(tryBitmapImageForUri(uri)); }
public BitmapImage?imageSourceForEnchantment(EnchantmentType enchantmentType) { if (enchantmentType == EnchantmentType.Unset) { return(imageSource("/Dungeons/Content/UI/Materials/MissionSelectMap/marker/locked_node")); } var name = enchantmentType.ToString(); var filename = string.Format("T_{0}_Icon", name); var path = Path.Combine(PathToEnchantmentImages, name, filename).Replace('\\', '/'); var fullPath = "/" + path; return(imageSource(fullPath) ?? _backupResolver.imageSourceForEnchantment(enchantmentType)); }
public void RemoveListObject(EnchantmentEffectListObject listObject, EnchantmentType listType) { switch (listType) { case EnchantmentType.Keywords: keywordList.Remove(listObject); break; case EnchantmentType.StatusEffects: statusEffectList.Remove(listObject); break; default: throw new Exception("Not a valid enchantment type"); } Destroy(listObject.gameObject); }
public EnchantmentData(Enchantment enchantment) { type = enchantment.type; }
public static bool isPowerful(this EnchantmentType enchantmentType) { return(powerful.Contains(enchantmentType)); }
public Enchantment(EnchantmentType type, byte level, int itemType = 0) { Type = type; Level = level; ItemType = itemType; }
internal EnumEnchantmentType(EnchantmentType type) { this.Enum = type; }
public Enchantment(EnchantmentType type) { this.type = type; }
public Enchantment(EnchantmentData enchantmentData) { type = enchantmentData.type; }
public Armor(ArmorType type_,EnchantmentType enchantment_ = EnchantmentType.NO_ENCHANTMENT) { type = type_; enchantment = enchantment_; }
public Weapon(WeaponType type_,EnchantmentType enchantment_ = EnchantmentType.NO_ENCHANTMENT) { type = type_; enchantment = enchantment_; }
public virtual void SetExtraEffects(EnchantmentType enchant) { this.extraEffect = enchant; }
void LevelFromContents(LevelContents levelContents) { // populate the monsters foreach (MonsterData monsterData in levelContents.AllMonsters) { GameObject CurrentMonster = Instantiate(Resources.Load("EnemyPrefabs/TargetDummy" /* + monsterData.MonsterType.ToString()*/) as GameObject); CurrentMonster.transform.position = ConvertToVector(monsterData.position); CurrentMonster.transform.rotation = Quaternion.Euler(ConvertToVector(monsterData.rotation)); MonsterScript monsterScript = CurrentMonster.GetComponent <MonsterScript>(); monsterScript.MonsterLevel = monsterData.Level; // not sure that we will be using monster buffs, if we have time we will fix this /*for (int i = 0; i < monsterData.CurrentBuffs.Length; i++) * { * Type mytype = Type.GetType(monsterData.CurrentBuffs[i].ToString()); * * CurrentMonster.AddComponent(mytype); * * BuffScript[] BuffArray = CurrentMonster.GetComponents<BuffScript>(); * * BuffArray[i].BuffStrength = monsterData.BuffStrengths[i]; * }*/ } if (levelContents.myConsumableLoot.Length > 0) { for (int i = 0; i < levelContents.myConsumableLoot.Length; i++) { GameObject currentConsumable = Instantiate(Resources.Load("DroppedConsumables/" + levelContents.myConsumableLoot[i].consumableType.ToString()) as GameObject); currentConsumable.transform.position = ConvertToVector(levelContents.myConsumablePositions[i]); currentConsumable.transform.rotation = Quaternion.Euler(ConvertToVector(levelContents.myConsumableRotations[i])); currentConsumable.GetComponent <DroppedConsumableScript>().amount = levelContents.myConsumableLoot[i].amountCarried; } } if (levelContents.myWeaponLoot.Length > 0) { for (int i = 0; i < levelContents.myWeaponLoot.Length; i++) { WeaponData currentWeaponData = levelContents.myWeaponLoot[i]; GameObject currentWeapon = Instantiate(Resources.Load("DroppedWeapons/" + currentWeaponData.weaponType.ToString() + "/" + currentWeaponData.weaponVariant) as GameObject); currentWeapon.transform.position = ConvertToVector(levelContents.myWeaponLootPositions[i]); currentWeapon.transform.rotation = Quaternion.Euler(ConvertToVector(levelContents.myWeaponRotations[i])); if (currentWeaponData.enchants != null) { for (i = 0; i < currentWeaponData.enchants.Length; i++) { EnchantmentType enchant = currentWeaponData.enchants[i]; Type mytype = Type.GetType(enchant.ToString() + "Script"); currentWeapon.AddComponent(mytype); EnchantmentScript[] myEnchants = currentWeapon.GetComponents <EnchantmentScript>(); myEnchants[i].Strength = currentWeaponData.enchantmentStrengths[i]; myEnchants[i].ManaPenalty = currentWeaponData.enchantmentPenalties[i]; myEnchants[i].ManaCost = currentWeaponData.enchantmentCosts[i]; } } } } map = levelContents.map; LocalExitScript.Exit.transform.position = map.end; LocalEntranceScript.Entrance.transform.position = map.start; if (DungeonScript.CurrentDungeon.CurrentLevelIndex == DungeonScript.CurrentDungeon.MaxLevelIndex) { LocalExitScript.Exit.SetActive(false); } else { LocalExitScript.Exit.SetActive(true); } }