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 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 override string ToString() { return(school.ToString() + ": " + effect.ToString() + " " + type.ToString()); }
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); } }