public Deck(HeroClass hero, bool allowNDR, bool allowNMR, bool allowNNR) { this.hero = hero; this.allowNDR = allowNDR; this.allowNMR = allowNMR; this.allowNNR = allowNNR; }
public Hero(HeroClass heroClass, HeroRace heroRace, string heroName) { Materials = new List <Material>(); Recipes = new List <Recipe>(); Artifacts = new List <Artifact>(); EquippedArtifacts = new List <Artifact>(); Quests = new List <Quest>(); Specializations = new Specializations(); ArtifactSets = new List <ArtifactSet> { new ArtifactSet { Id = 0, Name = "Default set" } }; HeroClass = heroClass; HeroRace = heroRace; Experience = 0; Level = 0; Name = heroName; ClickDamagePerLevel = 1; AuraDamage = 0.084; CritDamage = 2.0; AuraAttackSpeed = AuraSpeedBase; Id = ++User.Instance.LastHeroId; SetClassSpecificValues(); RefreshHeroExperience(); }
public ItemAttributesFromLevel(Follower follower, HeroClass heroClass) { switch (heroClass) { case HeroClass.ScoundrelFollower: dexterityItem = new ItemValueRange(8 + 3 * follower.Level); intelligenceItem = new ItemValueRange(8 + 1 * follower.Level); strengthItem = new ItemValueRange(9 + 1 * follower.Level); vitalityItem = new ItemValueRange(7 + 2 * follower.Level); break; case HeroClass.EnchantressFollower: dexterityItem = new ItemValueRange(9 + 1 * follower.Level); intelligenceItem = new ItemValueRange(5 + 3 * follower.Level); strengthItem = new ItemValueRange(9 + 1 * follower.Level); vitalityItem = new ItemValueRange(7 + 2 * follower.Level); break; case HeroClass.TemplarFollower: dexterityItem = new ItemValueRange(8 + 1 * follower.Level); intelligenceItem = new ItemValueRange(10 + 1 * follower.Level); strengthItem = new ItemValueRange(7 + 3 * follower.Level); vitalityItem = new ItemValueRange(9 + 2 * follower.Level); break; } critDamagePercent = new ItemValueRange(0.5); }
private static List <Spell> ParseSpellList(HeroClass heroClass) { //Parsing Stats string csv = "/Assets/Data/Heroes.csv"; string path = Path.GetFullPath(dir + csv); StreamReader strReader = new StreamReader(path); List <Spell> baseSpells = new List <Spell>(); string fileString = strReader.ReadToEnd(); string[] lines = fileString.Split('\n'); int heroClassId = (int)heroClass; string[] fields = lines[heroClassId + 1].Split(';'); if (fields[1].Equals(heroClass.ToString())) { baseSpells.Add(ParseSpell(Int32.Parse(fields[4]))); baseSpells.Add(ParseSpell(Int32.Parse(fields[5]))); } else { throw new Exception(" Invalid Hero class Id given in builder, table might be wrong"); } return(baseSpells); }
public Hero( string name) { Name = name; Enum.TryParse(name, out HeroClass heroClass); HeroClass = heroClass; }
private void _on_ItemList_item_selected(int index) { _compareClass = new HeroClass(GameState.AllClasses[index]); _selectedClass = new HeroClass(GameState.AllClasses[index]); CheckSkillPoints(); TxtDescription.Text = _selectedClass.Description; }
/***FROM UI***/ public void PreviousHeroClass() { int heroClassId = (int)currHeroClass - 1; if (heroClassId < 0) heroClassId = (int) HeroClass.LAST; currHeroClass = (HeroClass)heroClassId; UpdateWithNewClass(); }
public void RefreshDataFromDatabase() { DBManager dbm = new DBManager(); theHero = dbm.GetHero(1); theEvent = dbm.GetEvent(1); }
public Hero(int id, HeroClass heroClass, Race race, string heroName) { this.id = id; this._hClass = heroClass; this._race = race; this._heroName = heroName; }
public void NextHeroClass() { int heroClassId = (int)currHeroClass + 1; if (heroClassId > (int)HeroClass.LAST) heroClassId = 0; currHeroClass = (HeroClass)heroClassId; UpdateWithNewClass(); }
/// <summary> /// Computes the hit points per vitality factor. /// </summary> /// <param name="heroClass">Class of the hero (can be a follower).</param> /// <param name="heroLevel">Level of the hero.</param> /// <returns></returns> public static int GetHitpointsPerVitalityFactor(HeroClass heroClass, int heroLevel) { switch (heroClass) { case HeroClass.Barbarian: case HeroClass.Crusader: case HeroClass.DemonHunter: case HeroClass.Monk: case HeroClass.WitchDoctor: case HeroClass.Wizard: if (heroLevel <= 35) { return(10); } if (heroLevel <= 60) { return(heroLevel - 25); } if (heroLevel <= 65) { return(35 + 4 * (heroLevel - 60)); } return(50 + 10 * (heroLevel - 65)); case HeroClass.EnchantressFollower: case HeroClass.ScoundrelFollower: case HeroClass.TemplarFollower: // Missing leveling return(35 + 5 * (heroLevel - 61)); default: return(0); } }
public HeroData(int ID, string Identity, string Name, HeroClass Class, HeroType Type, ElementalTypes elementalType, int Strength, int Vitality, int Intelligence, int Speed, float StrengthScale, float VitalityScale, float IntelligenceScale, float SpeedScale, float StrengthQualityScale, float VitalityQualityScale, float IntelligenceQualityScale, float SpeedQualityScale, float StrengthQualityBase, float VitalityQualityBase, float IntelligenceQualityBase, float SpeedQualityBase, LeaderSkill leaderSkill, string defaultWeapon, string awakenReference, List <Skill> Skills, int order, int rarity) : base(Identity, Name) { this.ID = ID; _class = Class; _type = Type; _elementalType = elementalType; _strength = Strength; _vitality = Vitality; _intelligence = Intelligence; _speed = Speed; _strengthScale = StrengthScale; _vitalityScale = VitalityScale; _intelligenceScale = IntelligenceScale; _speedScale = SpeedScale; _strengthQualityScale = StrengthQualityScale; _vitalityQualityScale = VitalityQualityScale; _intelligenceQualityScale = IntelligenceQualityScale; _speedQualityScale = SpeedQualityScale; _strengthQualityBase = StrengthQualityBase; _vitalityQualityBase = VitalityQualityBase; _intelligenceQualityBase = IntelligenceQualityBase; _speedQualityBase = SpeedQualityBase; _leaderSkill = leaderSkill; _defaultWeapon = defaultWeapon; _awakenReference = DataManager.Instance.heroDataList.GetByIdentity(awakenReference); _order = order; _rarity = rarity; this.Skills = Skills; }
public Hero CreateHero(HeroClass heroClass) { Hero hero = new Hero(); hero.heroName = Strings.RandomNameForClass(heroClass); hero.heroClass = heroClass; switch (heroClass) { case HeroClass.WARRIOR: hero.strength = 10; hero.dexterity = 5; hero.intelligence = 3; hero.vitality = 8; hero.weapon = GameManager.I.weaponLib.GetWeapon("Sword_Rusty"); break; case HeroClass.BARBARIAN: hero.strength = 12; hero.dexterity = 4; hero.intelligence = 2; hero.vitality = 8; hero.weapon = GameManager.I.weaponLib.GetWeapon("Hammer_Rusty"); break; case HeroClass.ASSASSIN: hero.strength = 6; hero.dexterity = 9; hero.intelligence = 3; hero.vitality = 5; break; case HeroClass.RANGER: hero.strength = 2; hero.dexterity = 12; hero.intelligence = 4; hero.vitality = 2; break; case HeroClass.WIZARD: hero.strength = 1; hero.dexterity = 6; hero.intelligence = 12; hero.vitality = 3; break; case HeroClass.PRIEST: hero.strength = 5; hero.dexterity = 2; hero.intelligence = 10; hero.vitality = 4; break; default: break; } hero.level = 1; hero.maxMana = CalculateMaxMana(hero.intelligence); hero.maxHP = CalculateMaxHP(hero.vitality); hero.position = GameManager.I.status.heroes.Count; hero.id = GameManager.I.status.heroes.Count; return hero; }
public int GetIndexOffset(HeroClass heroClass) { switch (heroClass) { case HeroClass.Hunter: return(0); case HeroClass.Mage: if (DisplayedClasses.Contains(HeroClass.Hunter)) { return(SecretHelper.GetMaxSecretCount(HeroClass.Hunter)); } return(0); case HeroClass.Paladin: if (DisplayedClasses.Contains(HeroClass.Hunter) && DisplayedClasses.Contains(HeroClass.Mage)) { return(SecretHelper.GetMaxSecretCount(HeroClass.Hunter) + SecretHelper.GetMaxSecretCount(HeroClass.Mage)); } if (DisplayedClasses.Contains(HeroClass.Hunter)) { return(SecretHelper.GetMaxSecretCount(HeroClass.Hunter)); } if (DisplayedClasses.Contains(HeroClass.Mage)) { return(SecretHelper.GetMaxSecretCount(HeroClass.Mage)); } return(0); } return(0); }
public CharacterBaseModel(string name, HeroClass heroClass, bool isActive) { Name = name; HeroClass = heroClass; GameState = new GameState(); IsActive = isActive; }
private static void PrintPairs(List <CardPair> cardPairs, HeroClass hero, int oldPairs = 0, int oldWins = 0, int oldLoses = 0) { var pairs = cardPairs.FindAll(x => x.Hero == hero); int wins = 0; int loses = 0; foreach (var pair in pairs) { wins += pair.Wins; loses += pair.Losses; } if (oldPairs == 0) { Console.WriteLine( string.Format("{0:n0}", pairs.Count) + " -> " + string.Format("{0:n0}", (wins + loses)) + " : " + (wins + loses > 0 ? string.Format("{0:0.00}", 100.0 * wins / (wins + loses)) : "0") + "%"); } else { Console.WriteLine( string.Format("{0:n0}", pairs.Count) + " (" + string.Format("{0:+#;-#;0}", pairs.Count - oldPairs) + ")" + " -> " + string.Format("{0:n0}", (wins + loses)) + " (" + string.Format("{0:+#;-#;0}", wins + loses - oldWins - oldLoses) + ")" + " : " + (wins + loses > 0 ? string.Format("{0:0.00}", 100.0 * wins / (wins + loses)) : "0") + "% (" + string.Format("{0:+#.00;-#.00;0}", 100.0 * wins / (wins + loses) - 100.0 * oldWins / (oldWins + oldLoses)) + ")"); } }
public void CopyHero(HeroClass target, HeroClass template) { target.uniqueID = template.uniqueID; target.name = template.name; target.sprite = template.sprite; target.Health = template.Health; target.currentHealth = template.currentHealth; target.Attack = template.Attack; target.Defense = template.Defense; target.Speed = template.Speed; target.Level = template.Level; target.XP = template.XP; target.maxSP = template.maxSP; target.currentSP = template.currentSP; target.Skill = template.Skill; target.role = template.role; target.SpecialAbility = template.SpecialAbility; target.PassiveAbility = template.PassiveAbility; target.PrimaryStat = template.PrimaryStat; target.currentElement = template.currentElement; target.weaponSlot = template.weaponSlot; target.armorSlot = template.armorSlot; target.accessorySlot = template.accessorySlot; target.attackAnimations = template.attackAnimations; target.healingAnimation = template.healingAnimation; target.isDead = template.isDead; }
public WndClass(HeroClass cl) { var tabPerks = new PerksTab(cl); Add(tabPerks); Tab tab = new RankingTab(this, Utils.Capitalize(cl.Title()), tabPerks); tab.SetSize(TabWidth, TabHeight()); Add(tab); if (Badge.IsUnlocked(cl.MasteryBadge())) { var tabMastery = new MasteryTab(cl); Add(tabMastery); tab = new RankingTab(this, TxtMastery, tabMastery); tab.SetSize(TabWidth, TabHeight()); Add(tab); Resize((int)Math.Max(tabPerks.Width, tabMastery.Width), (int)Math.Max(tabPerks.Height, tabMastery.Height)); } else { Resize((int)tabPerks.Width, (int)tabPerks.Height); } Select(0); }
// Start is called before the first frame update void Start() { canvas = transform.parent.gameObject; mm = canvas.transform.GetComponent <MainManager>(); DBManager dbm = new DBManager(); equipList = dbm.GetAllEquipment(); theHero = dbm.GetHero(1); thePackage = dbm.GetPackage(1); Init_SlotList(); foreach (EquipmentClass i in equipList) { i.price = i.price * 2; } for (int i = 0; i < 6; i++) { EquipmentClass thisEquip = equipList[Random.Range(0, equipList.Count)]; PutItemToSlot(thisEquip, slotList[i]); equipList.Remove(thisEquip); } Refresh(); }
private void UpdateHeroPicture(HeroClass heroClass, HeroGender gender) { Image picture; switch (heroClass) { case HeroClass.Barbarian: picture = (gender == HeroGender.Female ? Resources.barbarian_female : Resources.barbarian_male); break; case HeroClass.Crusader: picture = (gender == HeroGender.Female ? Resources.crusader_female : Resources.crusader_male); break; case HeroClass.DemonHunter: picture = (gender == HeroGender.Female ? Resources.demonhunter_female : Resources.demonhunter_male); break; case HeroClass.Monk: picture = (gender == HeroGender.Female ? Resources.monk_female : Resources.monk_male); break; case HeroClass.WitchDoctor: picture = (gender == HeroGender.Female ? Resources.witchdoctor_female : Resources.witchdoctor_male); break; case HeroClass.Wizard: picture = (gender == HeroGender.Female ? Resources.wizard_female : Resources.wizard_male); break; default: return; } if (picture == null) { return; } guiHeroPicture.Image = picture; }
private void DisplayCharSprite(HeroClass c) { zHeroClass = c; Sprite s1 = null; if (c == HeroClass.Elf) { s1 = Functions.AddSpriteFromAchx(Path.Make(Path.Hero, "elf.achx")); zCharSprite.Text = "Elf"; } else if (c == HeroClass.Knight) { s1 = Functions.AddSpriteFromAchx(Path.Make(Path.Hero, "knight.achx")); zCharSprite.Text = "Knight"; } else if (c == HeroClass.Wizard) { s1 = Functions.AddSpriteFromAchx(Path.Make(Path.Hero, "wizard.achx")); zCharSprite.Text = "Wizard"; } SpriteManager.RemoveSprite(s1); zCharSprite.zSprite.Texture = s1.Texture; zCharSprite.zSprite.LeftTextureCoordinate = 0.333f; zCharSprite.zSprite.RightTextureCoordinate = 0.667f; zCharSprite.zSprite.ColorOperation = ColorOperation.Texture; zCharSprite.Visible = true; zCharSprite.Size = new Vector2(8, 8); zCharSprite.zText.RelativePosition.X = 0; zCharSprite.zText.HorizontalAlignment = HorizontalAlignment.Center; }
public Hero(string name, HeroClass heroClass) { Collect = false; Online = TimeSpan.Zero; Target = Position; AcceptArrows = true; zLastPosition = Position; Netid = 0; Name = name; Class = heroClass; Position.Z = ZLayer.Npc; WalkingSpeed = 10; SpriteManager.AddPositionedObject(this); Collider = ShapeManager.AddCircle(); Collider.AttachTo(this, false); Collider.Visible = false; Sprite = LoadSprite(); Sprite.AttachTo(this, false); Sprite.Resize(4); Sprite.AnimationSpeed = 0.1f; Label = TextManager.AddText(name, Globals.Font); Label.AttachTo(this, false); Label.HorizontalAlignment = HorizontalAlignment.Center; Label.RelativePosition = new Vector3(0, 4, ZLayer.NpcLabel - Position.Z); InitStats(); }
public ClientHero() { Position = Vector3.Zero; Class = HeroClass.Invalid; Name = string.Empty; Netid = 0; }
public CharacterBaseModel() { HeroClass = HeroClass.Warrior; Name = HeroClass.ToString(); GameState = new GameState(); IsActive = true; }
private IEnumerable <BuffRule> GetCurrentRules(HeroClass heroClass) { for (var i = 1; i <= 7; i++) { switch (heroClass) { case HeroClass.Barbarian: if (i == 1 || i == 4 || i == 7) { continue; } break; case HeroClass.Crusader: if (i == 1 || i == 2 || i == 7) { continue; } break; case HeroClass.DemonHunter: if (i == 1 || i == 4 || i == 7) { continue; } break; case HeroClass.Monk: if (i == 1 || i == 7) { continue; } break; case HeroClass.Necromancer: if (i == 1 || i == 3 || i == 4 || i == 5) { continue; } break; case HeroClass.WitchDoctor: if (i == 1 || i == 4 || i == 5) { continue; } break; case HeroClass.Wizard: if (i == 4 || i == 6 || i == 7) { continue; } break; } yield return(_ruleCalculator.Rules[i - 1]); } }
public void OnPickData(bool isMine, HeroClass heroType) { if (isMine) return; PickWindow pickedWindow = isMine ? MyWindow : EnemyWindow; pickedWindow.PickHero(heroType); }
public Ability(string name, int cd, HeroClass heroClass, EffectType type, int abilityPower) { this.Name = name; this.Cd = cd; this.HeroClass = heroClass; this.AbilityPower = abilityPower; this.Type = type; }
private void SetValueText(HeroAnyValue value, int indent, ListViewItem item) { string text = ""; item.Tag = value; switch (value.Type.Type) { case HeroTypes.Id: { text = (value as HeroID).ValueText; HeroID oid = value as HeroID; if (GOM.Instance.Definitions.ContainsKey(oid.Id)) { object obj2 = text; text = string.Concat(new object[] { obj2, " (", GOM.Instance.Definitions[oid.Id], ")" }); } break; } case HeroTypes.Integer: { text = (value as HeroInt).ValueText; HeroInt num = value as HeroInt; if (GOM.Instance.Definitions.ContainsKey((ulong)num.Value)) { object obj3 = text; text = string.Concat(new object[] { obj3, " (", GOM.Instance.Definitions[(ulong)num.Value], ")" }); } break; } case HeroTypes.List: { HeroList list = value as HeroList; this.AddList(list, indent + 1); break; } case HeroTypes.LookupList: { HeroLookupList list2 = value as HeroLookupList; this.AddLookupList(list2, indent + 1); break; } case HeroTypes.Class: { HeroClass class2 = value as HeroClass; this.AddVariables(class2.Variables, indent + 1); break; } default: text = value.ValueText; break; } item.SubItems.Add(text); }
static void Main() { var hero = new HeroClass(100, 150, 0); // third counter - initial position horizontally Console.Write($"Velocity = {hero.Velocity}; H-Position = {hero.MovePosition}"); Console.Write("\r"); var keyInfo = Console.ReadKey(); while (keyInfo.Key != ConsoleKey.Escape) { keyInfo = Console.ReadKey(); switch (keyInfo.Key) { case ConsoleKey.UpArrow: hero.UpSpeed(); break; case ConsoleKey.DownArrow: hero.DownSpeed(); break; case ConsoleKey.RightArrow: hero.MoveRight(); if (hero.MovePosition != 4) { break; } else { hero.MoveLeft(); break; } case ConsoleKey.LeftArrow: hero.MoveLeft(); if (hero.MovePosition != -1) { break; } else { hero.MoveRight(); break; } default: break; } Console.Write($"Velocity = {hero.Velocity}; H-Position = {hero.MovePosition}"); Console.Write("\r"); } //IPoint p = new Point(2, 3); //Idoublepoint pp = new Point(3, 4); //Point ppp = new Point(2, 6, 6); //pp.XYdoublepoint = 10; //Console.Write("My Point: "); //PrintPoint(ppp); }
public HeroInfo(HeroDeath hd) { this.@class = hd.HeroClass; this.name = hd.HeroName; this.level = hd.HeroLevel; this.deathCause = hd.CauseOfDeath; this.affliction = hd.Affliction == null ? global::Affliction.None : hd.Affliction.GetValueOrDefault(); this.virtue = hd.Virtue == null ? global::Virtue.None : hd.Virtue.GetValueOrDefault(); }
public Player() { Level = 1; Experience = 0; ExperienceCap = 300; Position = new Position(0, 0); Class = new HeroClass(SetClass()); ShowClassInfo(); }
void ShowModel(HeroClass heroType) { foreach(var model in HeroModels) { model.SetActive(false); } HeroModels[(int)heroType].SetActive(true); }
public SecretHelper(HeroClass heroClass, int id, bool stolen) { Id = id; Stolen = stolen; PossibleSecrets = new bool[GetMaxSecretCount(heroClass)]; for(var i = 0; i < PossibleSecrets.Length; i++) PossibleSecrets[i] = true; }
private void Awake() { heroClass = PersistentScene.Instance.GameCharacter.HeroClass; // will need to check if first time playing the game with character SetStartingItems(); RefreshUI(); Start(); }
public SecretHelper(HeroClass heroClass, int id, int turnPlayed) { Id = id; TurnPlayed = turnPlayed; HeroClass = heroClass; PossibleSecrets = new Dictionary<string, bool>(); foreach(var cardId in GetSecretIds(heroClass)) PossibleSecrets[cardId] = true; }
public Hero(HeroClass @class, string name, int level, int health, int strength, int spirit, int speed) { Class = @class; Name = name; Level = level; Health = health; Strength = strength; Spirit = spirit; Speed = speed; }
private void generateButton(HeroClass heroClass) { GameObject newButton = (GameObject)GameObject.Instantiate(prefab); newButton.transform.SetParent(contentPanel); ClassSelectionButton button = newButton.GetComponent <ClassSelectionButton>(); button.Setup(heroClass, this); }
/// <summary> /// Gets whether a class can equip an item /// </summary> /// <param name="heroClass">class</param> /// <param name="type">item type</param> /// <returns>true if the class can equip an item</returns> public static bool CanEquip(HeroClass heroClass, ItemType type) { int typeInt = (int)type; if ((typeInt & EquipmentSlotMask) == 0) { return(false); } return(((1 << ((int)heroClass + ClassesShift)) & typeInt) != 0); }
public Hero(string name, HeroClass heroClass, int healthPoints, int dmgStartOfRange, int dmgEndOfRange) { this.Name = name; this.HeroClass = heroClass; this.HealthPoints = healthPoints; this.DmgStartOfRange = dmgStartOfRange; this.DmgEndOfRange = dmgEndOfRange; this.Abilities = new List <IAbility>(); this.AppliedEffects = new List <IEffect>(); }
public void NewSecretPlayed(HeroClass heroClass, int id, int turn, string knownCardId = null) { var helper = new SecretHelper(heroClass, id, turn); if(knownCardId != null) { foreach(var cardId in SecretHelper.GetSecretIds(heroClass)) helper.TrySetSecret(cardId, cardId == knownCardId); } Secrets.Add(helper); Log.Info("Added secret with id:" + id); }
public void NewSecretPlayed(HeroClass heroClass, int id, int turn, string knownCardId = null) { var helper = new SecretHelper(heroClass, id, turn); if(knownCardId != null) { foreach(var cardId in SecretHelper.GetSecretIds(heroClass)) helper.PossibleSecrets[cardId] = cardId == knownCardId; } Secrets.Add(helper); Logger.WriteLine("Added secret with id:" + id, "OpponentSecrets"); }
public D3Calculator(Hero hero, Item mainHand, Item offHand, IEnumerable<Item> items) { HeroClass = hero.heroClass; HeroLevel = hero.level; // Build unique item equivalent to items worn HeroStatsItem = new StatsItem(mainHand, offHand, items); levelAttributes = new ItemAttributesFromLevel(hero); paragonLevelAttributes = new ItemAttributesFromParagonLevel(hero); Update(); }
public static int GetSecretIndex(HeroClass heroClass, string cardId) { switch(heroClass) { case HeroClass.Hunter: return CardIds.SecretIdsHunter.IndexOf(cardId); case HeroClass.Mage: return CardIds.SecretIdsMage.IndexOf(cardId); case HeroClass.Paladin: return CardIds.SecretIdsPaladin.IndexOf(cardId); } return -1; }
public static int GetMaxSecretCount(HeroClass heroClass) { switch(heroClass) { case HeroClass.Hunter: return CardIds.SecretIdsHunter.Count; case HeroClass.Mage: return CardIds.SecretIdsMage.Count; case HeroClass.Paladin: return CardIds.SecretIdsPaladin.Count; default: return 0; } }
public static List<string> GetSecretIds(HeroClass heroClass) { switch(heroClass) { case HeroClass.Hunter: return CardIds.SecretIdsHunter; case HeroClass.Mage: return CardIds.SecretIdsMage; case HeroClass.Paladin: return CardIds.SecretIdsPaladin; default: return new List<string>(); } }
public static List<string> GetSecretIds(HeroClass heroClass) { var standardOnly = Core.Game.CurrentFormat == Format.Standard; switch(heroClass) { case HeroClass.Hunter: return CardIds.Secrets.Hunter.GetCards(standardOnly); case HeroClass.Mage: return CardIds.Secrets.Mage.GetCards(standardOnly); case HeroClass.Paladin: return CardIds.Secrets.Paladin.GetCards(standardOnly); default: return new List<string>(); } }
public NewCharacterWindow():base(null,true) { zHeroClass = HeroClass.Invalid; InitProps(new Vector2(-11, 5), new Vector2(22, 15), new Color(0.3f, 0.3f, 0.3f, 0.75f), "", Color.White); CloseWithEscape = true; zNametextbox = new TextBox(this); zNametextbox.InitProps(Position + new Vector2(1, -7), new Vector2(14, 1.5f), new Color(0.1f, 0.1f, 0.1f, 1), "", Color.White); zNametextbox.MaxLength = 18; Window elfbutton = new Button(this); elfbutton.InitProps(Position + new Vector2(1, -1), new Vector2(4, 2), new Color(0.1f, 0.1f, 0.1f, 1), "Elf", Color.White); elfbutton.OnClick = delegate () { DisplayCharSprite(HeroClass.Elf); }; Window knightbutton = new Button(this); knightbutton.InitProps(elfbutton.Position + new Vector2(5, 0), new Vector2(4, 2), new Color(0.1f, 0.1f, 0.1f, 1), "Knight", Color.White); knightbutton.OnClick = delegate () { DisplayCharSprite(HeroClass.Knight); }; Window wizardbutton = new Button(this); wizardbutton.InitProps(knightbutton.Position + new Vector2(5, -0), new Vector2(4, 2), new Color(0.1f, 0.1f, 0.1f, 1), "Wizard", Color.White); wizardbutton.OnClick = delegate () { DisplayCharSprite(HeroClass.Wizard); }; Window createbutton = new Button(this); createbutton.InitProps(Position + new Vector2(16.5f, -7), new Vector2(4, 2), new Color(0.1f, 0.1f, 0.1f, 1), "Create", Color.White); createbutton.OnClick = CreateNewCharacter; Window backbutton = new Button(this); backbutton.InitProps(createbutton.Position + new Vector2(0, -3), new Vector2(4, 2), new Color(0.1f, 0.1f, 0.1f, 1), "Back", Color.White); backbutton.OnClick = Destroy; zCharSprite = new Window(this); zCharSprite.InitProps(Position + new Vector2(15, -1), new Vector2(4, 4), Color.White, "", Color.White); zCharSprite.Visible = false; }
public int GetIndexOffset(HeroClass heroClass) { switch(heroClass) { case HeroClass.Hunter: return 0; case HeroClass.Mage: if(DisplayedClasses.Contains(HeroClass.Hunter)) return SecretHelper.GetMaxSecretCount(HeroClass.Hunter); return 0; case HeroClass.Paladin: if(DisplayedClasses.Contains(HeroClass.Hunter) && DisplayedClasses.Contains(HeroClass.Mage)) return SecretHelper.GetMaxSecretCount(HeroClass.Hunter) + SecretHelper.GetMaxSecretCount(HeroClass.Mage); if(DisplayedClasses.Contains(HeroClass.Hunter)) return SecretHelper.GetMaxSecretCount(HeroClass.Hunter); if(DisplayedClasses.Contains(HeroClass.Mage)) return SecretHelper.GetMaxSecretCount(HeroClass.Mage); return 0; } return 0; }
public D3Calculator(Follower follower, HeroClass heroClass, Item mainHand, Item offHand, IEnumerable<Item> items) { HeroClass = heroClass; HeroLevel = follower.level; foreach (var item in items.Union(new[] { mainHand, offHand })) { ApplyFollowersBonusMalusOnItemAttributes(item.AttributesRaw, heroClass); if (item.Gems != null) { foreach (var gem in item.Gems) { ApplyFollowersBonusMalusOnItemAttributes(gem.AttributesRaw, heroClass); } } } // Build unique item equivalent to items worn HeroStatsItem = new StatsItem(mainHand, offHand, items); levelAttributes = new Followers.ItemAttributesFromLevel(follower, heroClass); Update(); }
public List<Secret> GetDefaultSecrets(HeroClass heroClass) { return SecretHelper.GetSecretIds(heroClass).Select(cardId => new Secret(cardId, 1)).ToList(); }
public static int GetMaxSecretCount(HeroClass heroClass) { return GetSecretIds(heroClass).Count; }
public AttributeListItem(String name, HeroClass value) { Name = name; Value = value.Translate(); }
public HeroClassWrapper(HeroClass heroClass) { Class = heroClass.ToString(); }
public D3CalculatorForm(Follower follower, HeroClass heroClass) : this() { Item offHand; Item mainHand; Text += " [ " + follower.slug + " ]"; guiHeroClass.SelectedItem = heroClass.ToString(); guiHeroLevel.Text = follower.level.ToString(); guiHeroParagonLevel.Text = "0"; if (follower.items.special != null) { special = follower.items.special.GetFullItem(); } if (follower.items.leftFinger != null) { leftFinger = follower.items.leftFinger.GetFullItem(); } if (follower.items.neck != null) { neck = follower.items.neck.GetFullItem(); } if (follower.items.rightFinger != null) { rightFinger = follower.items.rightFinger.GetFullItem(); } // If no weapon is set in mainHand, use "naked hand" weapon if (follower.items.mainHand != null) { mainHand = follower.items.mainHand.GetFullItem(); } else { mainHand = D3Calculator.NakedHandWeapon; } // If no item is set in offHand, use a blank item if (follower.items.offHand != null) { offHand = follower.items.offHand.GetFullItem(); } else { offHand = D3Calculator.BlankWeapon; } var allRawItems = new List<Item> { special, leftFinger, neck, rightFinger, mainHand, offHand }; guiSpecialEditor.SetEditedItem(special); guiMainHandEditor.SetEditedItem(mainHand); guiOffHandEditor.SetEditedItem(offHand); guiLeftFingerEditor.SetEditedItem(leftFinger); guiNeckEditor.SetEditedItem(neck); guiRightFingerEditor.SetEditedItem(rightFinger); guiSetBonusEditor.SetEditedItem(new Item(allRawItems.Where(i => i != null).ToList().GetActivatedSetBonus())); //populatePassiveSkills(); //populateActiveSkills(); }
public void SetMax(string cardId, HeroClass? heroClass) { if(heroClass == null) { heroClass = GetHeroClass(cardId); if(!heroClass.HasValue) return; } var index = SecretHelper.GetSecretIndex(heroClass.Value, cardId); if(index != -1) SetMax(index, heroClass.Value); }
public void ShowSecrets(bool force = false, HeroClass? heroClass = null) { if (Config.Instance.HideSecrets && !force) return; StackPanelSecrets.Children.Clear(); var secrets = heroClass == null ? _game.OpponentSecrets.GetSecrets() : _game.OpponentSecrets.GetDefaultSecrets(heroClass.Value); foreach (var id in secrets) { var cardObj = new Controls.Card(); var card = Database.GetCardFromId(id.CardId); card.Count = id.AdjustedCount(_game); cardObj.SetValue(DataContextProperty, card); StackPanelSecrets.Children.Add(cardObj); } StackPanelSecrets.Visibility = Visibility.Visible; }
public AttributeListItem(int id, HeroClass value) : this(Application.Context.Resources.GetString(id), value) { }
public static string RandomNameForClass(HeroClass heroClass) { int rndNameId = Random.Range(0, heroNamesDict[heroClass].Count); return heroNamesDict[heroClass][rndNameId]; }