コード例 #1
0
        public EnemySkillMenu(EnemySkillMateria esm)
            : base(5,
                Globals.HEIGHT * 7 / 10 + 20,
                Globals.WIDTH * 3 / 4,
                (Globals.HEIGHT * 5 / 20) - 25)
        {
            _spells = new Spell[_totalRows, COLUMNS];

            for (int i = 0; i < EnemySkillMateria.TOTAL_ENEMY_SKILLS; i++)
                if (((esm.AP >> i) & 1) > 0)
                {
                    Spell s = esm.EnemySkills[i];
                    _spells[s.Order / COLUMNS, s.Order % COLUMNS] = s;
                }

            Reset();
        }
コード例 #2
0
ファイル: Ally.cs プロジェクト: skinitimski/Reverence
        public Ally(Character c, int x, int y, int e)
        {
            _c = c;

            _abilityState = new AbilityState();

            int vStep = Globals.BattleSpeed;

            _c_timer   = new ScaledClock(10000);
            _v_timer   = new ScaledClock(vStep);
            _turnTimer = new ScaledTimer(6000, e, Globals.TurnTimerSpeed(this, vStep));

            _x = x;
            _y = y;

            GetMagicSpells();
            GetSummons();

            _battleMenu = new BattleMenu(this);

            _magicMenu = new MagicMenu(MagicSpells, _battleMenu.WMagic);
            if (!_magicMenu.IsValid)
            {
                _magicMenu = null;
            }

            _summonMenu = new SummonMenu(Summons, _battleMenu.WSummon);
            if (!_summonMenu.IsValid)
            {
                _summonMenu = null;
            }

            EnemySkillMateria m = new EnemySkillMateria(GetEnemySkillMask());

            if (m.AP > 0)
            {
                _enemySkillMenu = new EnemySkillMenu(m);
            }

            if (HP == 0)
            {
                InflictDeath();
            }
        }
コード例 #3
0
        public EnemySkillMenu(EnemySkillMateria esm)
            : base(
                5,
                Globals.HEIGHT * 7 / 10 + 20,
                Globals.WIDTH * 3 / 4,
                (Globals.HEIGHT * 5 / 20) - 25)
        {
            _spells = new Spell[_totalRows, COLUMNS];

            for (int i = 0; i < EnemySkillMateria.TOTAL_ENEMY_SKILLS; i++)
            {
                if (((esm.AP >> i) & 1) > 0)
                {
                    Spell s = esm.EnemySkills[i];
                    _spells[s.Order / COLUMNS, s.Order % COLUMNS] = s;
                }
            }

            Reset();
        }
コード例 #4
0
        protected override void DrawContents(Gdk.Drawable d)
        {
            Cairo.Context g = Gdk.CairoHelper.Create(d);

            g.SelectFontFace("Lucida Console", FontSlant.Normal, FontWeight.Bold);
            g.SetFontSize(24);

            TextExtents te;

            Materia orb = MateriaTop.Instance.Selection;

            if (orb == null)
            {
                orb = MateriaList.Instance.Selection;
            }


            if (orb != null)
            {
                Graphics.RenderCircle(g, new Color(1, 1, 1), 9, X + x1, Y + yp);
                Graphics.RenderCircle(g, orb.Color, 7, X + x1, Y + yp);
                Graphics.ShadowedText(g, orb.Name, X + x2, Y + y0);

                Cairo.Color greenish = new Color(.3, .8, .8);
                Cairo.Color yellow   = new Color(.8, .8, 0);
                Cairo.Color red      = new Color(0.8, 0, 0);
                Cairo.Color gray     = new Color(.4, .4, .4);
                Cairo.Color white    = new Color(1, 1, 1);


                if (orb.ID == "enemyskill")
                {
                    EnemySkillMateria esm = (EnemySkillMateria)orb;

                    string mask = "";
                    for (int i = 0; i < EnemySkillMateria.TOTAL_ENEMY_SKILLS; i++)
                    {
                        mask += ((esm.AP >> i) & 1) > 0 ? "1" : "0";
                    }
                    Graphics.ShadowedText(g, mask, X + x1, Y + y3);
                }
                else
                {
                    string lvl = (orb.Level + 1).ToString() + "/";
                    te = g.TextExtents(lvl);
                    Graphics.ShadowedText(g, lvl, X + x6 - te.Width, Y + y0);

                    string lvls = orb.Tiers.Length.ToString();
                    te = g.TextExtents(lvls);
                    Graphics.ShadowedText(g, lvls, X + x7 - te.Width, Y + y0);

                    te = g.TextExtents("Level");
                    Graphics.ShadowedText(g, greenish, "Level", X + x5 - te.Width, Y + y0);


                    string ap;
                    if (orb.AP < orb.Tiers[orb.Tiers.Length - 1])
                    {
                        ap = orb.AP.ToString();
                    }
                    else
                    {
                        ap = "MASTER";
                    }
                    te = g.TextExtents(ap);
                    Graphics.ShadowedText(g, ap, X + x7 - te.Width, Y + y1);
                    te = g.TextExtents("AP");
                    Graphics.ShadowedText(g, greenish, "AP", X + x5 - te.Width, Y + y1);


                    string nxt;
                    if (orb.Master)
                    {
                        nxt = "0";
                    }
                    else
                    {
                        nxt = (orb.Tiers[orb.Level + 1] - orb.AP).ToString();
                    }
                    te = g.TextExtents(nxt);
                    Graphics.ShadowedText(g, nxt, X + x7 - te.Width, Y + y2);
                    te = g.TextExtents("To next level");
                    Graphics.ShadowedText(g, greenish, "To next level", X + x5 - te.Width, Y + y2);


                    Graphics.ShadowedText(g, greenish, "Ability List", X + x0, Y + y3);

                    int k = 0;
                    foreach (string s in orb.AllAbilities)
                    {
                        if (!String.IsNullOrEmpty(s))
                        {
                            if (orb.Abilities.Contains(s))
                            {
                                Graphics.ShadowedText(g, s, X + x1, Y + y4 + (ys * k));
                            }
                            else
                            {
                                Graphics.ShadowedText(g, gray, s, X + x1, Y + y4 + (ys * k));
                            }
                            k++;
                        }
                    }

                    Graphics.ShadowedText(g, greenish, "Equip Effect", X + x4, Y + y3);

                    int    i = 0;
                    string stat;

                    te = g.TextExtents("-");
                    double dashw = te.Width;

                    te = g.TextExtents("+");
                    double plusw = te.Width;

                    #region Strength
                    if (orb.StrengthMod != 0)
                    {
                        Graphics.ShadowedText(g, "Str", X + x5, Y + y4 + (ys * i));

                        stat = Math.Abs(orb.StrengthMod).ToString();
                        if (stat.Length < 2)
                        {
                            stat = "0" + stat;
                        }

                        te = g.TextExtents(stat);
                        if (orb.StrengthMod < 0)
                        {
                            Graphics.ShadowedText(g, "-", X + x7 - te.Width - dashw, Y + y4 + (ys * i));
                            Graphics.ShadowedText(g, red, stat, X + x7 - te.Width, Y + y4 + (ys * i));
                        }
                        else
                        {
                            Graphics.ShadowedText(g, "+", X + x7 - te.Width - plusw, Y + y4 + (ys * i));
                            Graphics.ShadowedText(g, yellow, stat, X + x7 - te.Width, Y + y4 + (ys * i));
                        }
                        i++;
                    }
                    #endregion Strength
                    #region Vitality
                    if (orb.VitalityMod != 0)
                    {
                        Graphics.ShadowedText(g, "Vit", X + x5, Y + y4 + (ys * i));

                        stat = Math.Abs(orb.VitalityMod).ToString();
                        if (stat.Length < 2)
                        {
                            stat = "0" + stat;
                        }

                        te = g.TextExtents(stat);
                        if (orb.VitalityMod < 0)
                        {
                            Graphics.ShadowedText(g, "-", X + x7 - te.Width - dashw, Y + y4 + (ys * i));
                            Graphics.ShadowedText(g, red, stat, X + x7 - te.Width, Y + y4 + (ys * i));
                        }
                        else
                        {
                            Graphics.ShadowedText(g, "+", X + x7 - te.Width - plusw, Y + y4 + (ys * i));
                            Graphics.ShadowedText(g, yellow, stat, X + x7 - te.Width, Y + y4 + (ys * i));
                        }
                        i++;
                    }
                    #endregion Vitality
                    #region Dexterity
                    if (orb.DexterityMod != 0)
                    {
                        Graphics.ShadowedText(g, "Dex", X + x5, Y + y4 + (ys * i));

                        stat = Math.Abs(orb.DexterityMod).ToString();
                        if (stat.Length < 2)
                        {
                            stat = "0" + stat;
                        }

                        te = g.TextExtents(stat);
                        if (orb.DexterityMod < 0)
                        {
                            Graphics.ShadowedText(g, "-", X + x7 - te.Width - dashw, Y + y4 + (ys * i));
                            Graphics.ShadowedText(g, red, stat, X + x7 - te.Width, Y + y4 + (ys * i));
                        }
                        else
                        {
                            Graphics.ShadowedText(g, "+", X + x7 - te.Width - plusw, Y + y4 + (ys * i));
                            Graphics.ShadowedText(g, yellow, stat, X + x7 - te.Width, Y + y4 + (ys * i));
                        }
                        i++;
                    }
                    #endregion Dexterity
                    #region Magic
                    if (orb.MagicMod != 0)
                    {
                        Graphics.ShadowedText(g, "Mag", X + x5, Y + y4 + (ys * i));

                        stat = Math.Abs(orb.MagicMod).ToString();
                        if (stat.Length < 2)
                        {
                            stat = "0" + stat;
                        }

                        te = g.TextExtents(stat);
                        if (orb.MagicMod < 0)
                        {
                            Graphics.ShadowedText(g, "-", X + x7 - te.Width - dashw, Y + y4 + (ys * i));
                            Graphics.ShadowedText(g, red, stat, X + x7 - te.Width, Y + y4 + (ys * i));
                        }
                        else
                        {
                            Graphics.ShadowedText(g, "+", X + x7 - te.Width - plusw, Y + y4 + (ys * i));
                            Graphics.ShadowedText(g, yellow, stat, X + x7 - te.Width, Y + y4 + (ys * i));
                        }
                        i++;
                    }
                    #endregion Magic
                    #region Spirit
                    if (orb.SpiritMod != 0)
                    {
                        Graphics.ShadowedText(g, "Spr", X + x5, Y + y4 + (ys * i));

                        stat = Math.Abs(orb.SpiritMod).ToString();
                        if (stat.Length < 2)
                        {
                            stat = "0" + stat;
                        }

                        te = g.TextExtents(stat);
                        if (orb.SpiritMod < 0)
                        {
                            Graphics.ShadowedText(g, "-", X + x7 - te.Width - dashw, Y + y4 + (ys * i));
                            Graphics.ShadowedText(g, red, stat, X + x7 - te.Width, Y + y4 + (ys * i));
                        }
                        else
                        {
                            Graphics.ShadowedText(g, "+", X + x7 - te.Width - plusw, Y + y4 + (ys * i));
                            Graphics.ShadowedText(g, yellow, stat, X + x7 - te.Width, Y + y4 + (ys * i));
                        }
                        i++;
                    }
                    #endregion Spirit
                    #region Luck
                    if (orb.LuckMod != 0)
                    {
                        Graphics.ShadowedText(g, "Lck", X + x5, Y + y4 + (ys * i));

                        stat = Math.Abs(orb.LuckMod).ToString();
                        if (stat.Length < 2)
                        {
                            stat = "0" + stat;
                        }

                        te = g.TextExtents(stat);
                        if (orb.LuckMod < 0)
                        {
                            Graphics.ShadowedText(g, "-", X + x7 - te.Width - dashw, Y + y4 + (ys * i));
                            Graphics.ShadowedText(g, red, stat, X + x7 - te.Width, Y + y4 + (ys * i));
                        }
                        else
                        {
                            Graphics.ShadowedText(g, "+", X + x7 - te.Width - plusw, Y + y4 + (ys * i));
                            Graphics.ShadowedText(g, yellow, stat, X + x7 - te.Width, Y + y4 + (ys * i));
                        }
                        i++;
                    }
                    #endregion Luck
                    #region HP
                    if (orb.HPMod != 0)
                    {
                        Graphics.ShadowedText(g, "MaxHP", X + x5, Y + y4 + (ys * i));

                        stat = Math.Abs(orb.HPMod).ToString();
                        if (stat.Length < 2)
                        {
                            stat = "0" + stat;
                        }
                        stat = stat + "%";
                        te   = g.TextExtents(stat);
                        if (orb.HPMod < 0)
                        {
                            Graphics.ShadowedText(g, "-", X + x8 - te.Width - dashw, Y + y4 + (ys * i));
                            Graphics.ShadowedText(g, red, stat, X + x8 - te.Width, Y + y4 + (ys * i));
                        }
                        else
                        {
                            Graphics.ShadowedText(g, "+", X + x8 - te.Width - plusw, Y + y4 + (ys * i));
                            Graphics.ShadowedText(g, yellow, stat, X + x8 - te.Width, Y + y4 + (ys * i));
                        }
                        i++;
                    }
                    #endregion HP
                    #region MP
                    if (orb.MPMod != 0)
                    {
                        Graphics.ShadowedText(g, "MaxMP", X + x5, Y + y4 + (ys * i));

                        stat = Math.Abs(orb.MPMod).ToString();
                        if (stat.Length < 2)
                        {
                            stat = "0" + stat;
                        }
                        stat = stat + "%";
                        te   = g.TextExtents(stat);
                        if (orb.MPMod < 0)
                        {
                            Graphics.ShadowedText(g, "-", X + x8 - te.Width - dashw, Y + y4 + (ys * i));
                            Graphics.ShadowedText(g, red, stat, X + x8 - te.Width, Y + y4 + (ys * i));
                        }
                        else
                        {
                            Graphics.ShadowedText(g, "+", X + x8 - te.Width - plusw, Y + y4 + (ys * i));
                            Graphics.ShadowedText(g, yellow, stat, X + x8 - te.Width, Y + y4 + (ys * i));
                        }
                        i++;
                    }
                    #endregion MP
                }
            }

            ((IDisposable)g.Target).Dispose();
            ((IDisposable)g).Dispose();
        }