コード例 #1
0
            public override void Refresh()
            {
                base.Refresh();

                if (Memory.State.Characters != null && Character != Characters.Blank)
                {
                    for (int i = 0; i < Count; i++)
                    {
                        if (i == 0)
                        {
                            ITEM[i, 1] = new IGMDataItem_String(
                                Kernel_bin.BattleCommands[
                                    Memory.State.Characters[Character].Abilities.Contains(Kernel_bin.Abilities.Mug) ?
                                    13 :
                                    1].Name,
                                new Rectangle(SIZE[i].X + 80, SIZE[i].Y, 0, 0));
                        }
                        else
                        {
                            ITEM[i, 0] = new IGMDataItem_Icon(Icons.ID.Arrow_Right2, SIZE[i], 9);
                            ITEM[i, 1] = Memory.State.Characters[Character].Commands[i - 1] != Kernel_bin.Abilities.None ? new IGMDataItem_String(
                                Icons.ID.Ability_Command, 9,
                                Kernel_bin.Commandabilities[Memory.State.Characters[Character].Commands[i - 1]].Name,
                                new Rectangle(SIZE[i].X + 40, SIZE[i].Y, 0, 0)) : null;
                            Kernel_bin.Abilities k = Memory.State.Characters[Character].Commands[i - 1];
                            Descriptions[i] = k == Kernel_bin.Abilities.None ? null : Kernel_bin.Commandabilities[k].BattleCommand.Description;
                        }
                    }
                }
            }
コード例 #2
0
            public override void Refresh()
            {
                base.Refresh();

                if (Memory.State.Characters != null && Damageable != null && Damageable.GetCharacterData(out Saves.CharacterData c))
                {
                    for (int i = 0; i < Count; i++)
                    {
                        if (i == 0)
                        {
                            ITEM[i, 1] = new IGMDataItem.Text(
                                Kernel_bin.BattleCommands[
                                    c.Abilities.Contains(Kernel_bin.Abilities.Mug) ?
                                    12 :
                                    1].Name,
                                new Rectangle(SIZE[i].X + 80, SIZE[i].Y, 0, 0));
                        }
                        else
                        {
                            ITEM[i, 0] = new IGMDataItem.Icon(Icons.ID.Arrow_Right2, SIZE[i], 9);
                            ITEM[i, 1] = c.Commands[i - 1] != Kernel_bin.Abilities.None ? new IGMDataItem.Text(
                                Icons.ID.Ability_Command, 9,
                                Kernel_bin.Commandabilities[c.Commands[i - 1]].Name,
                                new Rectangle(SIZE[i].X + 40, SIZE[i].Y, 0, 0)) : null;
                            Kernel_bin.Abilities k = c.Commands[i - 1];
                            Descriptions[i] = k == Kernel_bin.Abilities.None ? null : Kernel_bin.Commandabilities[k].BattleCommand.Description;
                        }
                    }
                }
            }
コード例 #3
0
            /// <summary>
            /// <para>Set which Ability the GF is learning.</para>
            /// <para>Could actually be a byte to corrispond to APs and Forgotten.</para>
            /// </summary>
            /// <param name="ability">If null sets to first in learnable list</param>
            public void SetLearning(Kernel_bin.Abilities?_ability = null)
            {
                Kernel_bin.Abilities a = _ability ?? Kernel_bin.Abilities.None;
                bool _set = false;

                if (a == Kernel_bin.Abilities.None)
                {
                    foreach (KeyValuePair <Kernel_bin.Abilities, Kernel_bin.Unlocker> kvp in JunctionableGFsData.Ability)
                    {
                        if (TestGFCanLearn(kvp.Key, false))
                        {
                            Learning = kvp.Key;
                            _set     = true;
                            break;
                        }
                    }
                }
                else if (TestGFCanLearn(a, false))
                {
                    Learning = a;
                    _set     = true;
                }

                if (!_set)
                {
                    Learning = Kernel_bin.Abilities.None;
                }
            }
コード例 #4
0
            public bool EarnExp(uint ap, out Kernel_bin.Abilities ability)
            {
                bool ret = false;

                ability = Kernel_bin.Abilities.None;

                if (!IsGameOver)
                {
                    if (EXPtoNextLevel <= ap && Level < 100)
                    {
                        ret = true;
                    }
                    Experience += ap;
                    if (Kernel_bin.AllAbilities.ContainsKey(Learning))
                    {
                        byte ap_tolearn = Kernel_bin.AllAbilities[Learning].AP;
                        if (JunctionableGFsData.Ability.TryGetIndexByKey(Learning, out int ind) && TestGFCanLearn(Learning, false))
                        {
                            if (ap_tolearn < APs[ind] + ap)
                            {
                                APs[ind] = ap_tolearn;
                                ability  = Learning;
                                Learn(Learning);
                            }
                            else
                            {
                                APs[ind] += (byte)ap;
                            }
                        }
                    }
                }
                return(ret);
            }
コード例 #5
0
ファイル: Command.cs プロジェクト: poooooooooke/OpenVIII
        public override void Refresh()
        {
            base.Refresh();

            if (Memory.State?.Characters != null && Damageable != null && Damageable.GetCharacterData(out Saves.CharacterData c))
            {
                for (int i = 0; i < Count; i++)
                {
                    if (i > 0)
                    {
                        if (c.Commands[i - 1] != Kernel_bin.Abilities.None)
                        {
                            ((IGMDataItem.Text)ITEM[i, 1]).Data = Kernel_bin.Commandabilities[c.Commands[i - 1]].Name;
                            ITEM[i, 1].Show();
                            Kernel_bin.Abilities k = c.Commands[i - 1];
                            Descriptions[i] = Kernel_bin.Commandabilities[k].BattleCommand.Description;
                        }
                        else
                        {
                            ITEM[i, 1].Hide();
                        }
                    }
                    else if (i == 0)
                    {
                        ((IGMDataItem.Text)ITEM[i, 1]).Data = Kernel_bin.BattleCommands[
                            c.Abilities.Contains(Kernel_bin.Abilities.Mug) ?
                            12 :
                            1].Name;
                    }
                }
            }
        }
コード例 #6
0
 public bool UnlockerTest(Kernel_bin.Abilities a)
 {
     if (JunctionableGFsData.Ability.TryGetByKey(a, out Kernel_bin.Unlocker u))
     {
         return(UnlockerTest(u));
     }
     //return true if there is no prereq.
     return(true);
 }
コード例 #7
0
 /// <summary>
 /// Learn this ability
 /// </summary>
 /// <param name="ability"></param>
 /// <returns></returns>
 public bool Learn(Kernel_bin.Abilities ability)
 {
     if (!MaxGFAbilities)
     {
         if (!Complete[(int)ability])
         {
             Complete[(int)ability] = true;
             if (Learning.Equals(ability))
             {
                 SetLearning();
             }
             return(true);
         }
     }
     return(false);
 }
コード例 #8
0
 /// <summary>
 /// <para>Set which Ability the GF is learning.</para>
 /// <para>Could actually be a byte to corrispond to APs and Forgotten.</para>
 /// </summary>
 /// <param name="ability">If null sets to first in learnable list</param>
 public void SetLearning(Kernel_bin.Abilities?ability = null)
 {
     Kernel_bin.Abilities a = ability ?? Kernel_bin.Abilities.None;
     if (!MaxGFAbilities)
     {
         if (ability == null)
         {
             // if ability is null set learning to the next ability that can be learned
             // check if max abilities is known already.
         }
         else if (a != Kernel_bin.Abilities.None)
         {
             // if ability isn't none. confirm if can learn it set ability to be learned
         }
     }
     else
     {
         Learning = Kernel_bin.Abilities.None;
     }
 }
コード例 #9
0
 /// <summary>
 /// False if gf knows ability, True if can learn it.
 /// </summary>
 /// <param name="ability">Ability you want to learn.</param>
 /// <param name="item">
 /// If using an Item you don't need the prereq, set to false if need prereq
 /// </param>
 public bool TestGFCanLearn(Kernel_bin.Abilities ability, bool item = true) => !Complete[(int)ability] && ((item) || UnlockerTest(ability));
コード例 #10
0
            public override bool Update()
            {
                if (IGM_Junction != null && !IGM_Junction.GetMode().Equals(Mode.Abilities_Abilities))
                {
                    Cursor_Status &= ~Cursor_Status.Enabled;
                }
                else
                {
                    Cursor_Status |= Cursor_Status.Enabled;
                }
                int pos  = 0;
                int skip = Page * Rows;

                for (int i = 0;
                     Memory.State.Characters != null &&
                     i < Memory.State.Characters[Character].UnlockedGFAbilities.Count &&
                     pos < Rows; i++)
                {
                    if (Memory.State.Characters[Character].UnlockedGFAbilities[i] != Kernel_bin.Abilities.None)
                    {
                        Kernel_bin.Abilities j = Memory.State.Characters[Character].UnlockedGFAbilities[i];
                        if (Source.ContainsKey(j))
                        {
                            if (skip > 0)
                            {
                                skip--;
                                continue;
                            }
                            Font.ColorID cid = Memory.State.Characters[Character].Abilities.Contains(j) ? Font.ColorID.Grey : Font.ColorID.White;
                            BLANKS[pos] = cid == Font.ColorID.Grey ? true : false;

                            ITEM[pos, 0] = new IGMDataItem_String(
                                Source[j].Icon, 9,
                                Source[j].Name,
                                new Rectangle(SIZE[pos].X, SIZE[pos].Y, 0, 0), cid);
                            Contents[pos] = j;
                            pos++;
                        }
                    }
                }
                for (; pos < Rows; pos++)
                {
                    ITEM[pos, 0]  = null;
                    BLANKS[pos]   = true;
                    Contents[pos] = Kernel_bin.Abilities.None;
                }
                if (Contents[CURSOR_SELECT] != Kernel_bin.Abilities.None && IGM_Junction.GetMode().Equals(Mode.Abilities_Abilities))
                {
                    IGM_Junction.ChangeHelp(Source[Contents[CURSOR_SELECT]].Description);
                }
                UpdateTitle();
                if (Contents[CURSOR_SELECT] == Kernel_bin.Abilities.None)
                {
                    CURSOR_NEXT();
                }
                if (Pages > 1)
                {
                    if (Contents[0] == Kernel_bin.Abilities.None)
                    {
                        Pages = Page;
                        PAGE_NEXT();
                        return(Update());
                    }
                    else if (Contents[Rows - 1] == Kernel_bin.Abilities.None)
                    {
                        Pages = Page + 1;
                    }
                }
                return(base.Update());
            }
コード例 #11
0
 /// <summary>
 /// False if gf knows ability, True if can learn it.
 /// </summary>
 /// <param name="ability">Ability you want to learn.</param>
 public bool TestGFCanLearn(Kernel_bin.Abilities ability) => !Complete[(int)ability];
コード例 #12
0
                public override bool Update()
                {
                    if (InGameMenu_Junction != null && InGameMenu_Junction.GetMode() != Mode.Abilities_Commands)
                    {
                        Cursor_Status &= ~Cursor_Status.Enabled;
                    }
                    else
                    {
                        Cursor_Status |= Cursor_Status.Enabled;
                    }
                    int pos  = 0;
                    int skip = Page * rows;

                    for (int i = 0;
                         Memory.State.Characters != null &&
                         i < Memory.State.Characters[Character].UnlockedGFAbilities.Count &&
                         pos < rows; i++)
                    {
                        if (Memory.State.Characters[Character].UnlockedGFAbilities[i] != Kernel_bin.Abilities.None)
                        {
                            Kernel_bin.Abilities j = (Memory.State.Characters[Character].UnlockedGFAbilities[i]);
                            if (Source.ContainsKey(j) && skip-- <= 0)
                            {
                                Font.ColorID cid = Memory.State.Characters[Character].Commands.Contains(j) ? Font.ColorID.Grey : Font.ColorID.White;
                                BLANKS[pos]  = cid == Font.ColorID.Grey ? true : false;
                                ITEM[pos, 0] = new IGMDataItem_String(
                                    Icons.ID.Ability_Command, 9,
                                    Source[j].Name,
                                    new Rectangle(SIZE[pos].X, SIZE[pos].Y, 0, 0), cid);
                                Contents[pos] = j;
                                pos++;
                            }
                        }
                    }
                    for (; pos < rows; pos++)
                    {
                        ITEM[pos, 0]  = null;
                        BLANKS[pos]   = true;
                        Contents[pos] = Kernel_bin.Abilities.None;
                    }

                    if (Contents[CURSOR_SELECT] != Kernel_bin.Abilities.None && InGameMenu_Junction.GetMode() == Mode.Abilities_Commands)
                    {
                        InGameMenu_Junction.ChangeHelp(Source[Contents[CURSOR_SELECT]].Description.ReplaceRegion());
                    }
                    UpdateTitle();
                    if (Contents[CURSOR_SELECT] == Kernel_bin.Abilities.None)
                    {
                        CURSOR_NEXT();
                    }
                    if (Pages > 1)
                    {
                        if (Contents[0] == Kernel_bin.Abilities.None)
                        {
                            Pages = Page;
                            PAGE_NEXT();
                            return(Update());
                        }
                        else if (Contents[rows - 1] == Kernel_bin.Abilities.None)
                        {
                            Pages = Page + 1;
                        }
                    }
                    return(base.Update());
                }