コード例 #1
0
        internal static string ResolveResourceBurn(this ChampionSpell championSpell, string abilityResourceName)
        {
            string resource = championSpell.Resource;

            Match match = ResourcePattern.Match(resource);

            while (match.Success)
            {
                string expression = match.Groups[0].Value;
                string variable   = match.Groups[1].Value;

                string variableValue;

                switch (variable)
                {
                case "cost":
                    variableValue = championSpell.CostBurn;
                    break;

                case "abilityresourcename":
                    variableValue = abilityResourceName;
                    break;

                default:
                    variableValue = championSpell.ResolveEffectValue(variable);
                    break;
                }

                resource = resource.Replace(expression, variableValue);
                match    = match.NextMatch();
            }

            return(resource);
        }
コード例 #2
0
            public override void Init(StoC_0x7B_TrainerWindow pak)
            {
                countRows = pak.ReadByte();
                m_skills  = new ChampionSkill[countRows];

                for (int i = 0; i < countRows; i++)
                {
                    ChampionSkill skill = new ChampionSkill();
                    skill.index       = pak.ReadByte();
                    skill.countSpells = pak.ReadByte();
                    skill.m_spells    = new ChampionSpell[skill.countSpells];
                    for (int index = 0; index < skill.countSpells; index++)
                    {
                        ChampionSpell spell = new ChampionSpell();
                        spell.index              = pak.ReadByte();
                        spell.type               = pak.ReadByte();
                        spell.icon               = pak.ReadShortLowEndian();
                        spell.name               = pak.ReadPascalString();
                        spell.aviability         = pak.ReadByte();
                        spell.stickedSkillsCount = pak.ReadByte();
                        if (spell.stickedSkillsCount > 0)
                        {
                            spell.stickedSkills = new byte[spell.stickedSkillsCount];
                        }
                        for (int k = 0; k < spell.stickedSkillsCount; k++)
                        {
                            spell.stickedSkills[k] = pak.ReadByte();
                        }
                        skill.m_spells[index] = spell;
                    }
                    m_skills[i] = skill;
                }
            }
コード例 #3
0
        public void ResolvesResourceBurn()
        {
            ChampionSpell spell = new ChampionSpell
            {
                Resource   = "{{ cost }} {{ abilityresourcename }} + {{ e1 }} {{ abilityresourcename }} per second + {{ e2 }} Health",
                CostBurn   = "10",
                EffectBurn = new List <string> {
                    null, "20", "30"
                }
            };

            Assert.That(spell.ResolveResourceBurn("Mana"), Is.EqualTo("10 Mana + 20 Mana per second + 30 Health"));
        }
コード例 #4
0
ファイル: ThreshLantern.cs プロジェクト: waldow90/PortAIO
        private static void OnGameUpdate(EventArgs args)
        {
            if (ObjectManager.Player.IsDead || Lantern == null || !Lantern.IsValid || !MenuLocal.Item("Use.Lantern").GetValue <KeyBind>().Active)
            {
                return;
            }

            if (Lantern.Position.Distance(ObjectManager.Player.Position) <= 500)
            {
                ObjectManager.Player.Spellbook.CastSpell((SpellSlot)62, Lantern);
            }
            else if (ChampionSpell != null && ChampionSpell.IsReady() && Lantern.Position.Distance(ObjectManager.Player.Position) <= 500 + ChampionSpell.Range)
            {
                ChampionSpell.Cast(Lantern.Position);
            }
        }
コード例 #5
0
        private static string ResolveEffectValue(this ChampionSpell championSpell, string variable)
        {
            if (variable.StartsWith("e"))
            {
                int i;

                if (int.TryParse(variable.Substring(1), out i))
                {
                    if (i >= 0 && i < championSpell.EffectBurn.Count)
                    {
                        return(championSpell.EffectBurn[i]);
                    }
                }
            }

            return(variable);
        }
コード例 #6
0
 public override void MakeString(TextWriter text, bool flagsDescription)
 {
     for (int i = 0; i < countRows; i++)
     {
         ChampionSkill skill = (ChampionSkill)m_skills[i];
         text.Write("\n\tskillIndex:{0,-3} countSpells:{1,-2}",
                    skill.index, skill.countSpells);
         for (int j = 0; j < skill.countSpells; j++)
         {
             ChampionSpell spell = (ChampionSpell)skill.m_spells[j];
             text.Write("\n\tindex:{0,-3} type:{1,-2} icon:0x{2:X4} aviability:{4} stickedSkillsCount:{5} \"{3}\" ",
                        spell.index, spell.type, spell.icon, spell.name, spell.aviability, spell.stickedSkillsCount);
             for (int k = 0; k < spell.stickedSkillsCount; k++)
             {
                 text.Write(" [{0}]:0x{1:X2}", k, spell.stickedSkills[k]);
             }
         }
     }
 }
コード例 #7
0
 public ChampionSpellViewModel(ChampionSpell championSpell, string resourceType)
 {
     this.championSpell = championSpell;
     this.resourceBurn  = championSpell.ResolveResourceBurn(resourceType);
 }
コード例 #8
0
            public override void Init(StoC_0x7B_TrainerWindow pak)
            {
                countRows = pak.ReadByte();
                m_skills = new ChampionSkill[countRows];

                for (int i = 0; i < countRows; i++)
                {
                    ChampionSkill skill = new ChampionSkill();
                    skill.index = pak.ReadByte();
                    skill.countSpells = pak.ReadByte();
                    skill.m_spells = new ChampionSpell[skill.countSpells];
                    for (int index = 0; index < skill.countSpells; index++)
                    {
                        ChampionSpell spell = new ChampionSpell();
                        spell.index = pak.ReadByte();
                        spell.type = pak.ReadByte();
                        spell.icon = pak.ReadShortLowEndian();
                        spell.name = pak.ReadPascalString();
                        spell.aviability = pak.ReadByte();
                        spell.stickedSkillsCount = pak.ReadByte();
                        if (spell.stickedSkillsCount > 0)
                            spell.stickedSkills = new byte[spell.stickedSkillsCount];
                        for (int k = 0; k < spell.stickedSkillsCount; k++)
                        {
                            spell.stickedSkills[k] = pak.ReadByte();
                        }
                        skill.m_spells[index] = spell;
                    }
                    m_skills[i] = skill;
                }
            }