Ejemplo n.º 1
0
 public BindToParent(StateSystem statesystem, String label, TextSection textsection)
     : base(statesystem, label, textsection)
 {
     m_time = textsection.GetAttribute<Evaluation.Expression>("time", null);
     m_facing = textsection.GetAttribute<Evaluation.Expression>("facing", null);
     m_position = textsection.GetAttribute<Evaluation.Expression>("pos", null);
 }
Ejemplo n.º 2
0
 public LifeAdd(StateSystem statesystem, String label, TextSection textsection)
     : base(statesystem, label, textsection)
 {
     m_life    = textsection.GetAttribute <Evaluation.Expression>("value", null);
     m_cankill = textsection.GetAttribute <Evaluation.Expression>("kill", null);
     m_abs     = textsection.GetAttribute <Evaluation.Expression>("absolute", null);
 }
        /// <summary>
        /// Combines all adjecent sections with the same link status.
        /// <param name="orderedSections">The sections to coalesce, in order of position within the text</param>
        /// </summary>
        private static List <TextSection> CoalesceSections(IEnumerable <TextSection> orderedSections)
        {
            var sections = new List <TextSection>();

            TextSection currentSection = null;

            foreach (var section in orderedSections)
            {
                if (currentSection == null)
                {
                    currentSection = section;
                }
                else
                {
                    if (!currentSection.TryCoalesce(section))
                    {
                        // Sections were not adjacent, or not the same link status, so return finish the current one and start a new current
                        sections.Add(currentSection);
                        currentSection = section;
                    }
                }
            }

            sections.Add(currentSection);
            return(sections);
        }
Ejemplo n.º 4
0
        public ModifyExplod(StateSystem statesystem, String label, TextSection textsection)
            : base(statesystem, label, textsection)
        {
            m_animationnumber = textsection.GetAttribute <Evaluation.PrefixedExpression>("anim", null);
            m_id             = textsection.GetAttribute <Evaluation.Expression>("id", null);
            m_position       = textsection.GetAttribute <Evaluation.Expression>("pos", null);
            m_postype        = textsection.GetAttribute <PositionType?>("postype", null);
            m_facing         = textsection.GetAttribute <Evaluation.Expression>("facing", null);
            m_verticalfacing = textsection.GetAttribute <Evaluation.Expression>("vfacing", null);
            m_bindtime       = textsection.GetAttribute <Evaluation.Expression>("BindTime", null);

            Evaluation.Expression exp_vel      = textsection.GetAttribute <Evaluation.Expression>("vel", null);
            Evaluation.Expression exp_velocity = textsection.GetAttribute <Evaluation.Expression>("velocity", null);
            m_velocity = exp_vel ?? exp_velocity;

            m_acceleration       = textsection.GetAttribute <Evaluation.Expression>("accel", null);
            m_randomdisplacement = textsection.GetAttribute <Evaluation.Expression>("random", null);
            m_removetime         = textsection.GetAttribute <Evaluation.Expression>("removetime", null);
            m_supermove          = textsection.GetAttribute <Evaluation.Expression>("supermove", null);
            m_supermovetime      = textsection.GetAttribute <Evaluation.Expression>("supermovetime", null);
            m_pausemovetime      = textsection.GetAttribute <Evaluation.Expression>("pausemovetime", null);
            m_scale                = textsection.GetAttribute <Evaluation.Expression>("scale", null);
            m_spritepriority       = textsection.GetAttribute <Evaluation.Expression>("sprpriority", null);
            m_drawontop            = textsection.GetAttribute <Evaluation.Expression>("ontop", null);
            m_shadow               = textsection.GetAttribute <Evaluation.Expression>("shadow", null);
            m_ownpalette           = textsection.GetAttribute <Evaluation.Expression>("ownpal", null);
            m_removeongethit       = textsection.GetAttribute <Evaluation.Expression>("removeongethit", null);
            m_explodignorehitpause = textsection.GetAttribute <Evaluation.Expression>("ignorehitpause", null);
            m_blending             = textsection.GetAttribute <Blending?>("trans", null);
            m_alpha                = textsection.GetAttribute <Evaluation.Expression>("alpha", null);
        }
Ejemplo n.º 5
0
        private static ReadOnlyDictionary <int, string> BuildMenuText(TextSection textsection)
        {
            var menutext = new Dictionary <int, string>();

            menutext[(int)MainMenuOption.Arcade]       = textsection.GetAttribute <string>("menu.itemname.arcade");
            menutext[(int)MainMenuOption.Versus]       = textsection.GetAttribute <string>("menu.itemname.versus");
            menutext[(int)MainMenuOption.TeamArcade]   = textsection.GetAttribute <string>("menu.itemname.teamarcade");
            menutext[(int)MainMenuOption.TeamVersus]   = textsection.GetAttribute <string>("menu.itemname.teamversus");
            menutext[(int)MainMenuOption.TeamCoop]     = textsection.GetAttribute <string>("menu.itemname.teamcoop");
            menutext[(int)MainMenuOption.Survival]     = textsection.GetAttribute <string>("menu.itemname.survival");
            menutext[(int)MainMenuOption.SurvivalCoop] = textsection.GetAttribute <string>("menu.itemname.survivalcoop");
            menutext[(int)MainMenuOption.Training]     = textsection.GetAttribute <string>("menu.itemname.training");
            menutext[(int)MainMenuOption.Watch]        = textsection.GetAttribute <string>("menu.itemname.watch");
            menutext[(int)MainMenuOption.Options]      = textsection.GetAttribute <string>("menu.itemname.options");
            menutext[(int)MainMenuOption.Quit]         = textsection.GetAttribute <string>("menu.itemname.exit");

#warning Some menu items aren't implemented yet
            menutext[(int)MainMenuOption.TeamCoop]     = "NOT IMPLEMENTED";
            menutext[(int)MainMenuOption.Survival]     = "NOT IMPLEMENTED";
            menutext[(int)MainMenuOption.SurvivalCoop] = "NOT IMPLEMENTED";
            menutext[(int)MainMenuOption.Training]     = "NOT IMPLEMENTED";
            menutext[(int)MainMenuOption.Watch]        = "NOT IMPLEMENTED";
            menutext[(int)MainMenuOption.Options]      = "NOT IMPLEMENTED";

            return(new ReadOnlyDictionary <int, string>(menutext));
        }
Ejemplo n.º 6
0
 public MakeDust(StateSystem statesystem, string label, TextSection textsection)
     : base(statesystem, label, textsection)
 {
     m_pos     = textsection.GetAttribute <Evaluation.Expression>("pos", null);
     m_pos2    = textsection.GetAttribute <Evaluation.Expression>("pos2", null);
     m_spacing = textsection.GetAttribute <Evaluation.Expression>("spacing", null);
 }
Ejemplo n.º 7
0
 public Helper(StateSystem statesystem, String label, TextSection textsection)
     : base(statesystem, label, textsection)
 {
     m_helpertype = textsection.GetAttribute<HelperType>("helpertype", HelperType.Normal);
     m_name = textsection.GetAttribute<String>("name", null);
     m_id = textsection.GetAttribute<Evaluation.Expression>("id", null);
     m_position = textsection.GetAttribute<Evaluation.Expression>("pos", null);
     m_postype = textsection.GetAttribute<PositionType>("postype", PositionType.P1);
     m_facing = textsection.GetAttribute<Evaluation.Expression>("facing", null);
     m_statenumber = textsection.GetAttribute<Evaluation.Expression>("stateno", null);
     m_keyctrl = textsection.GetAttribute<Evaluation.Expression>("keyctrl", null);
     m_ownpal = textsection.GetAttribute<Evaluation.Expression>("ownpal", null);
     m_supermovetime = textsection.GetAttribute<Evaluation.Expression>("SuperMoveTime", null);
     m_pausemovetime = textsection.GetAttribute<Evaluation.Expression>("PauseMoveTime", null);
     m_xscale = textsection.GetAttribute<Evaluation.Expression>("size.xscale", null);
     m_yscale = textsection.GetAttribute<Evaluation.Expression>("size.yscale", null);
     m_groundback = textsection.GetAttribute<Evaluation.Expression>("size.ground.back", null);
     m_groundfront = textsection.GetAttribute<Evaluation.Expression>("size.ground.front", null);
     m_airback = textsection.GetAttribute<Evaluation.Expression>("size.air.back", null);
     m_airfront = textsection.GetAttribute<Evaluation.Expression>("size.air.front", null);
     m_height = textsection.GetAttribute<Evaluation.Expression>("size.height", null);
     m_projectscaling = textsection.GetAttribute<Evaluation.Expression>("size.proj.doscale", null);
     m_headpos = textsection.GetAttribute<Evaluation.Expression>("size.head.pos", null);
     m_midpos = textsection.GetAttribute<Evaluation.Expression>("size.mid.pos", null);
     m_shadowoffset = textsection.GetAttribute<Evaluation.Expression>("size.shadowoffset", null);
 }
Ejemplo n.º 8
0
        private StateController CreateController(TextSection textsection)
        {
            if (textsection == null)
            {
                throw new ArgumentNullException(nameof(textsection));
            }

            var match = _controllertitleregex.Match(textsection.Title);

            if (match.Success == false)
            {
                return(null);
            }

            var typename = textsection.GetAttribute <string>("type", null);

            if (typename == null)
            {
                Log.Write(LogLevel.Warning, LogSystem.StateSystem, "Controller '{0}' does not have a type.", textsection);
                return(null);
            }


            if (_controllermap.ContainsKey(typename) == false)
            {
                Log.Write(LogLevel.Warning, LogSystem.StateSystem, "Controller '{0}' has invalid type - '{1}'.", textsection, typename);
                return(null);
            }

            var controller = (StateController)_controllermap[typename](this, match.Groups[1].Value, textsection);

            return(controller);
        }
Ejemplo n.º 9
0
        void BuildPlayerProfiles()
        {
            m_players.Clear();

            TextFile    textfile    = GetSubSystem <IO.FileSystem>().OpenTextFile("data/select.def");
            TextSection textsection = textfile.GetSection("Characters");

            foreach (String line in textsection.Lines)
            {
                if (String.Equals(line, "random", StringComparison.OrdinalIgnoreCase) == true)
                {
                    m_players.Add(new PlayerSelect(PlayerSelectType.Random, null));
                }
                else
                {
                    String playerpath;
                    String stagepath;
                    if (ParseProfileLine(line, out playerpath, out stagepath) == true)
                    {
                        m_players.Add(new PlayerSelect(PlayerSelectType.Profile, new PlayerProfile(this, playerpath, stagepath)));
                    }
                    else
                    {
                        m_players.Add(null);
                    }
                }
            }
        }
Ejemplo n.º 10
0
 public LifeAdd(StateSystem statesystem, String label, TextSection textsection)
     : base(statesystem, label, textsection)
 {
     m_life = textsection.GetAttribute<Evaluation.Expression>("value", null);
     m_cankill = textsection.GetAttribute<Evaluation.Expression>("kill", null);
     m_abs = textsection.GetAttribute<Evaluation.Expression>("absolute", null);
 }
Ejemplo n.º 11
0
 public SndPan(StateSystem statesystem, string label, TextSection textsection)
     : base(statesystem, label, textsection)
 {
     m_channel = textsection.GetAttribute <Evaluation.Expression>("channel", null);
     m_pan     = textsection.GetAttribute <Evaluation.Expression>("pan", null);
     m_abspan  = textsection.GetAttribute <Evaluation.Expression>("abspan", null);
 }
Ejemplo n.º 12
0
 public TargetBind(StateSystem statesystem, String label, TextSection textsection)
     : base(statesystem, label, textsection)
 {
     m_time = textsection.GetAttribute<Evaluation.Expression>("time", null);
     m_id = textsection.GetAttribute<Evaluation.Expression>("id", null);
     m_pos = textsection.GetAttribute<Evaluation.Expression>("pos", null);
 }
Ejemplo n.º 13
0
		/// <summary>
		/// Creates a new background as per of the collection, initializes from the given xnaMugen.IO.TextSection.
		/// </summary>
		/// <param name="section">The text section used to create and initialize the created background.</param>
		/// <returns>The created background, if it could be created; null otherwise.</returns>
		public void CreateBackground(TextSection section)
		{
			if (section == null) throw new ArgumentNullException("section");

			BackgroundType bgtype = section.GetAttribute<BackgroundType>("type");
			Base background = null;

			switch (bgtype)
			{
				case BackgroundType.Static:
					background = new Static(section, m_spritemanager.Clone());
					break;

				case BackgroundType.Parallax:
					background = new Parallax(section, m_spritemanager.Clone());
					break;

				case BackgroundType.Animated:
					background = new Animated(section, m_spritemanager.Clone(), m_animationmanager.Clone());
					break;

				case BackgroundType.None:
				default:
					Log.Write(LogLevel.Error, LogSystem.BackgroundCollection, "Cannot create background with TextSection: {0}", section);
					return;
			}

			background.Reset();
			m_backgrounds.Add(background);
		}
Ejemplo n.º 14
0
 public TargetBind(StateSystem statesystem, string label, TextSection textsection)
     : base(statesystem, label, textsection)
 {
     m_time = textsection.GetAttribute <Evaluation.Expression>("time", null);
     m_id   = textsection.GetAttribute <Evaluation.Expression>("id", null);
     m_pos  = textsection.GetAttribute <Evaluation.Expression>("pos", null);
 }
Ejemplo n.º 15
0
        protected NonCombatScreen(MenuSystem menusystem, TextSection textsection, String spritepath, String animationpath, String soundpath)
            : base(menusystem)
        {
            if (textsection == null)
            {
                throw new ArgumentNullException("textsection");
            }
            if (spritepath == null)
            {
                throw new ArgumentNullException("spritepath");
            }
            if (animationpath == null)
            {
                throw new ArgumentNullException("animationpath");
            }
            if (soundpath == null)
            {
                throw new ArgumentNullException("soundpath");
            }

            m_soundmanager     = MenuSystem.GetSubSystem <Audio.SoundSystem>().CreateManager(soundpath);
            m_spritemanager    = MenuSystem.GetSubSystem <Drawing.SpriteSystem>().CreateManager(spritepath);
            m_animationmanager = MenuSystem.GetSubSystem <Animations.AnimationSystem>().CreateManager(animationpath);
            m_backgrounds      = new Backgrounds.Collection(m_spritemanager.Clone(), m_animationmanager.Clone());
            m_fadeintime       = textsection.GetAttribute <Int32>("fadein.time");
            m_fadeouttime      = textsection.GetAttribute <Int32>("fadeout.time");

            SpriteManager.LoadAllSprites();
        }
Ejemplo n.º 16
0
        public string GetScript()
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendLine(DataHelper.GetCommandListScript(CommandList));

            TextSection.DecodeText();
            string strTextSection = TextSection.GetCombinedTextString();

            if (!string.IsNullOrEmpty(strTextSection))
            {
                sb.AppendLine("{SECTION:TEXT}");
                sb.AppendLine();
                sb.Append(strTextSection);
            }

            string strDataSection = DataSection.GetCombinedByteString();

            if (!string.IsNullOrEmpty(strDataSection))
            {
                sb.AppendLine("{SECTION:DATA}");
                sb.AppendLine();
                sb.Append(strDataSection);
            }

            return(sb.ToString());
        }
Ejemplo n.º 17
0
 public HitFallSet(StateSystem statesystem, string label, TextSection textsection)
     : base(statesystem, label, textsection)
 {
     m_fallset = textsection.GetAttribute <Evaluation.Expression>("value", null);
     m_velx    = textsection.GetAttribute <Evaluation.Expression>("xvel", null);
     m_vely    = textsection.GetAttribute <Evaluation.Expression>("yvel", null);
 }
Ejemplo n.º 18
0
		static String GetBackgroundName(TextSection textsection)
		{
			if (textsection == null) throw new ArgumentNullException("textsection");

			Match titlematch = s_titleregex.Match(textsection.Title);
			return (titlematch.Success == true) ? titlematch.Groups[1].Value : String.Empty;
		}
Ejemplo n.º 19
0
        public void Load(TextSection section)
        {
            foreach (Tuple <string, string> tuple in section.Lines.Where(x => !x.StartsWith("*")).Select(line => line.FirstArgument()))
            {
                switch (tuple.Item1.ToLower())
                {
                case "announce":
                    Announce = tuple.Item2.TrimHash();
                    break;

                case "day":
                    Day = tuple.Item2.ToInt32();
                    break;

                case "end":
                    if (!string.IsNullOrEmpty(Announce))
                    {
                        Announce = "Today is a holiday, but who the hell knows which one.";
                    }
                    break;

                case "month":
                    Month = tuple.Item2.ToInt32();
                    break;

                case "name":
                    Name = tuple.Item2.TrimHash();
                    break;
                }
            }
        }
Ejemplo n.º 20
0
 public NotHitBy(StateSystem statesystem, string label, TextSection textsection)
     : base(statesystem, label, textsection)
 {
     m_hitattr1 = textsection.GetAttribute <Combat.HitAttribute>("value", null);
     m_hitattr2 = textsection.GetAttribute <Combat.HitAttribute>("value2", null);
     m_time     = textsection.GetAttribute <Evaluation.Expression>("time", null);
 }
        void WriteTextInfo(TextSection textInfo)
        {
            string text = string.IsNullOrEmpty(textInfo.Text) ?
                          string.Empty :
                          textInfo.Text + "\0";

            byte[] utf16Text = Encoding.Unicode.GetBytes(text);

            WritePanel(textInfo);

            int additionalSize = textInfo.AdditionalChars * 2; // multiplied by UTF-16 code-point size

            writer.Write((ushort)(utf16Text.Length + additionalSize));
            writer.Write((ushort)utf16Text.Length);
            writer.Write(textInfo.MaterialIndex);
            writer.Write(textInfo.FontIndex);

            writer.Write(textInfo.Unknown54);
            writer.Write(textInfo.Unknown55);
            writer.Write((ushort)0x00); // reserved

            // start text address is always 0x74 because previous fields
            // have a constant size always.
            writer.Write(0x74);

            writer.Write(textInfo.Unknown5C[0]);
            writer.Write(textInfo.Unknown5C[1]);
            writer.Write(textInfo.Unknown64.X);
            writer.Write(textInfo.Unknown64.Y);
            writer.Write(textInfo.Unknown6C);
            writer.Write(textInfo.Unknown70);

            writer.Write(utf16Text);
        }
Ejemplo n.º 22
0
 public TargetVelAdd(StateSystem statesystem, String label, TextSection textsection)
     : base(statesystem, label, textsection)
 {
     m_targetid = textsection.GetAttribute<Evaluation.Expression>("id", null);
     m_x = textsection.GetAttribute<Evaluation.Expression>("x", null);
     m_y = textsection.GetAttribute<Evaluation.Expression>("y", null);
 }
Ejemplo n.º 23
0
 public SndPan(StateSystem statesystem, String label, TextSection textsection)
     : base(statesystem, label, textsection)
 {
     m_channel = textsection.GetAttribute<Evaluation.Expression>("channel", null);
     m_pan = textsection.GetAttribute<Evaluation.Expression>("pan", null);
     m_abspan = textsection.GetAttribute<Evaluation.Expression>("abspan", null);
 }
Ejemplo n.º 24
0
 public AssertSpecial(StateSystem statesystem, String label, TextSection textsection)
     : base(statesystem, label, textsection)
 {
     m_assert1 = textsection.GetAttribute<Assertion>("flag", Assertion.None);
     m_assert2 = textsection.GetAttribute<Assertion>("flag2", Assertion.None);
     m_assert3 = textsection.GetAttribute<Assertion>("flag3", Assertion.None);
 }
Ejemplo n.º 25
0
 public BindToRoot(StateSystem statesystem, String label, TextSection textsection)
     : base(statesystem, label, textsection)
 {
     m_time     = textsection.GetAttribute <Evaluation.Expression>("time", null);
     m_facing   = textsection.GetAttribute <Evaluation.Expression>("facing", null);
     m_position = textsection.GetAttribute <Evaluation.Expression>("pos", null);
 }
Ejemplo n.º 26
0
		static ReadOnlyDictionary<Int32, String> BuildMenuText(TextSection textsection)
		{
			Dictionary<Int32, String> menutext = new Dictionary<Int32, String>();

			menutext[(Int32)MainMenuOption.Arcade] = textsection.GetAttribute<String>("menu.itemname.arcade");
			menutext[(Int32)MainMenuOption.Versus] = textsection.GetAttribute<String>("menu.itemname.versus");
			menutext[(Int32)MainMenuOption.TeamArcade] = textsection.GetAttribute<String>("menu.itemname.teamarcade");
			menutext[(Int32)MainMenuOption.TeamVersus] = textsection.GetAttribute<String>("menu.itemname.teamversus");
			menutext[(Int32)MainMenuOption.TeamCoop] = textsection.GetAttribute<String>("menu.itemname.teamcoop");
			menutext[(Int32)MainMenuOption.Survival] = textsection.GetAttribute<String>("menu.itemname.survival");
			menutext[(Int32)MainMenuOption.SurvivalCoop] = textsection.GetAttribute<String>("menu.itemname.survivalcoop");
			menutext[(Int32)MainMenuOption.Training] = textsection.GetAttribute<String>("menu.itemname.training");
			menutext[(Int32)MainMenuOption.Watch] = textsection.GetAttribute<String>("menu.itemname.watch");
			menutext[(Int32)MainMenuOption.Options] = textsection.GetAttribute<String>("menu.itemname.options");
			menutext[(Int32)MainMenuOption.Quit] = textsection.GetAttribute<String>("menu.itemname.exit");

#warning Some menu items aren't implemented yet
			menutext[(Int32)MainMenuOption.Arcade] = "NOT IMPLEMENTED";
			menutext[(Int32)MainMenuOption.TeamArcade] = "NOT IMPLEMENTED";
			menutext[(Int32)MainMenuOption.TeamVersus] = "NOT IMPLEMENTED";
			menutext[(Int32)MainMenuOption.TeamCoop] = "NOT IMPLEMENTED";
			menutext[(Int32)MainMenuOption.Survival] = "NOT IMPLEMENTED";
			menutext[(Int32)MainMenuOption.SurvivalCoop] = "NOT IMPLEMENTED";
			menutext[(Int32)MainMenuOption.Training] = "NOT IMPLEMENTED";
			menutext[(Int32)MainMenuOption.Watch] = "NOT IMPLEMENTED";
			menutext[(Int32)MainMenuOption.Options] = "NOT IMPLEMENTED";

			return new ReadOnlyDictionary<Int32, String>(menutext);
		}
Ejemplo n.º 27
0
 public StateTypeSet(StateSystem statesystem, String label, TextSection textsection)
     : base(statesystem, label, textsection)
 {
     m_statetype = textsection.GetAttribute<StateType>("statetype", StateType.Unchanged);
     m_movetype = textsection.GetAttribute<MoveType>("movetype", MoveType.Unchanged);
     m_physics = textsection.GetAttribute<Physics>("Physics", Physics.Unchanged);
 }
        public void TextSectionWithDifferentLengthAreNotEqual()
        {
            TextSection lhs = new TextSection(0, 15);
            TextSection rhs = new TextSection(0, 1);

            Assert.IsFalse(lhs.Equals(rhs));
        }
Ejemplo n.º 29
0
 public TargetVelAdd(StateSystem statesystem, String label, TextSection textsection)
     : base(statesystem, label, textsection)
 {
     m_targetid = textsection.GetAttribute <Evaluation.Expression>("id", null);
     m_x        = textsection.GetAttribute <Evaluation.Expression>("x", null);
     m_y        = textsection.GetAttribute <Evaluation.Expression>("y", null);
 }
Ejemplo n.º 30
0
        /// <summary>
        /// Creates a new background as per of the collection, initializes from the given xnaMugen.IO.TextSection.
        /// </summary>
        /// <param name="section">The text section used to create and initialize the created background.</param>
        /// <returns>The created background, if it could be created; null otherwise.</returns>
        public void CreateBackground(TextSection section)
        {
            if (section == null)
            {
                throw new ArgumentNullException(nameof(section));
            }

            var  bgtype = section.GetAttribute <BackgroundType>("type");
            Base background;

            switch (bgtype)
            {
            case BackgroundType.Static:
                background = new Static(section, m_spritemanager.Clone());
                break;

            case BackgroundType.Parallax:
                background = new Parallax(section, m_spritemanager.Clone());
                break;

            case BackgroundType.Animated:
                background = new Animated(section, m_spritemanager.Clone(), m_animationmanager.Clone());
                break;

            default:
                Log.Write(LogLevel.Error, LogSystem.BackgroundCollection, "Cannot create background with TextSection: {0}", section);
                return;
            }

            background.Reset();
            m_backgrounds.Add(background);
        }
        public void TextSectionWithSameOffsetAndLengthAreEqual()
        {
            TextSection lhs = new TextSection(0, 1);
            TextSection rhs = new TextSection(0, 1);

            Assert.IsTrue(lhs.Equals(rhs));
        }
Ejemplo n.º 32
0
 public AssertSpecial(StateSystem statesystem, string label, TextSection textsection)
     : base(statesystem, label, textsection)
 {
     m_assert1 = textsection.GetAttribute("flag", Assertion.None);
     m_assert2 = textsection.GetAttribute("flag2", Assertion.None);
     m_assert3 = textsection.GetAttribute("flag3", Assertion.None);
 }
Ejemplo n.º 33
0
 public StateTypeSet(StateSystem statesystem, string label, TextSection textsection)
     : base(statesystem, label, textsection)
 {
     m_statetype = textsection.GetAttribute("statetype", StateType.Unchanged);
     m_movetype  = textsection.GetAttribute("movetype", MoveType.Unchanged);
     m_physics   = textsection.GetAttribute("Physics", Physics.Unchanged);
 }
Ejemplo n.º 34
0
        public SelectData(SelectScreen selectscreen, Input.ButtonMap buttonmap, TextSection textsection, String prefix, Boolean moveoverempty)
        {
            if (selectscreen == null) throw new ArgumentNullException("selectscreen");
            if (buttonmap == null) throw new ArgumentNullException("buttonmap");
            if (textsection == null) throw new ArgumentNullException("textsection");
            if (prefix == null) throw new ArgumentNullException("prefix");

            m_selectscreen = selectscreen;
            m_buttonmap = buttonmap;
            m_moveoverempty = moveoverempty;

            m_elements = new Elements.Collection(SelectScreen.SpriteManager, SelectScreen.AnimationManager, SelectScreen.SoundManager, SelectScreen.MenuSystem.FontMap);
            m_elements.Build("cursor.active", textsection, prefix + ".cursor.active");
            m_elements.Build("cursor.done", textsection, prefix + ".cursor.done");
            m_elements.Build("cursor.move", textsection, prefix + ".cursor.move");
            m_elements.Build("random.move", textsection, prefix + ".random.move");
            m_elements.Build("player.face", textsection, prefix + ".face");
            m_elements.Build("player.name", textsection, prefix + ".name");

            m_startcell = textsection.GetAttribute<Point>(prefix + ".cursor.startcell");

            // X & Y seem to be reversed for this
            m_startcell = new Point(m_startcell.Y, m_startcell.X);

            Reset();
        }
Ejemplo n.º 35
0
 public MakeDust(StateSystem statesystem, String label, TextSection textsection)
     : base(statesystem, label, textsection)
 {
     m_pos = textsection.GetAttribute<Evaluation.Expression>("pos", null);
     m_pos2 = textsection.GetAttribute<Evaluation.Expression>("pos2", null);
     m_spacing = textsection.GetAttribute<Evaluation.Expression>("spacing", null);
 }
Ejemplo n.º 36
0
 public ChangeState(StateSystem statesystem, String label, TextSection textsection)
     : base(statesystem, label, textsection)
 {
     m_statenumber     = textsection.GetAttribute <Evaluation.Expression>("value", null);
     m_control         = textsection.GetAttribute <Evaluation.Expression>("ctrl", null);
     m_animationnumber = textsection.GetAttribute <Evaluation.Expression>("anim", null);
 }
Ejemplo n.º 37
0
        public VarAdd(StateSystem statesystem, String label, TextSection textsection)
            : base(statesystem, label, textsection)
        {
            m_intnumber = textsection.GetAttribute<Evaluation.Expression>("v", null);
            m_floatnumber = textsection.GetAttribute<Evaluation.Expression>("fv", null);
            m_systemintnumber = textsection.GetAttribute<Evaluation.Expression>("sysvar", null);
            m_systemfloatnumber = textsection.GetAttribute<Evaluation.Expression>("sysfvar", null);
            m_value = textsection.GetAttribute<Evaluation.Expression>("value", null);

            foreach (KeyValuePair<String, String> parsedline in textsection.ParsedLines)
            {
                Match match = s_lineregex.Match(parsedline.Key);
                if (match.Success == false) continue;

                Evaluation.EvaluationSystem evalsystem = StateSystem.GetSubSystem<Evaluation.EvaluationSystem>();
                StringComparer sc = StringComparer.OrdinalIgnoreCase;
                String var_type = match.Groups[1].Value;
                Evaluation.Expression var_number = evalsystem.CreateExpression(match.Groups[2].Value);

                if (sc.Equals(var_type, "") == true) m_intnumber = var_number;
                if (sc.Equals(var_type, "f") == true) m_floatnumber = var_number;
                if (sc.Equals(var_type, "sys") == true) m_systemintnumber = var_number;
                if (sc.Equals(var_type, "sysf") == true) m_systemfloatnumber = var_number;

                m_value = evalsystem.CreateExpression(parsedline.Value);
            }
        }
Ejemplo n.º 38
0
 public NotHitBy(StateSystem statesystem, String label, TextSection textsection)
     : base(statesystem, label, textsection)
 {
     m_hitattr1 = textsection.GetAttribute<Combat.HitAttribute>("value", null);
     m_hitattr2 = textsection.GetAttribute<Combat.HitAttribute>("value2", null);
     m_time = textsection.GetAttribute<Evaluation.Expression>("time", null);
 }
Ejemplo n.º 39
0
        public Explod(StateSystem statesystem, String label, TextSection textsection)
            : base(statesystem, label, textsection)
        {
            m_animationnumber = textsection.GetAttribute<Evaluation.PrefixedExpression>("anim", null);
            m_id = textsection.GetAttribute<Evaluation.Expression>("id", null);
            m_position = textsection.GetAttribute<Evaluation.Expression>("pos", null);
            m_postype = textsection.GetAttribute<PositionType>("postype", PositionType.P1);
            m_facing = textsection.GetAttribute<Evaluation.Expression>("facing", null);
            m_verticalfacing = textsection.GetAttribute<Evaluation.Expression>("vfacing", null);
            m_bindtime = textsection.GetAttribute<Evaluation.Expression>("BindTime", null);

            Evaluation.Expression exp_vel = textsection.GetAttribute<Evaluation.Expression>("vel", null);
            Evaluation.Expression exp_velocity = textsection.GetAttribute<Evaluation.Expression>("velocity", null);
            m_velocity = exp_vel ?? exp_velocity;

            m_acceleration = textsection.GetAttribute<Evaluation.Expression>("accel", null);
            m_randomdisplacement = textsection.GetAttribute<Evaluation.Expression>("random", null);
            m_removetime = textsection.GetAttribute<Evaluation.Expression>("removetime", null);
            m_supermove = textsection.GetAttribute<Evaluation.Expression>("supermove", null);
            m_supermovetime = textsection.GetAttribute<Evaluation.Expression>("supermovetime", null);
            m_pausemovetime = textsection.GetAttribute<Evaluation.Expression>("pausemovetime", null);
            m_scale = textsection.GetAttribute<Evaluation.Expression>("scale", null);
            m_spritepriority = textsection.GetAttribute<Evaluation.Expression>("sprpriority", null);
            m_drawontop = textsection.GetAttribute<Evaluation.Expression>("ontop", null);
            m_shadow = textsection.GetAttribute<Evaluation.Expression>("shadow", null);
            m_ownpalette = textsection.GetAttribute<Evaluation.Expression>("ownpal", null);
            m_removeongethit = textsection.GetAttribute<Evaluation.Expression>("removeongethit", null);
            m_explodignorehitpause = textsection.GetAttribute<Evaluation.Expression>("ignorehitpause", null);
            m_blending = textsection.GetAttribute<Blending>("trans", new Blending());
            m_alpha = textsection.GetAttribute<Evaluation.Expression>("alpha", null);
        }
Ejemplo n.º 40
0
 public ChangeState(StateSystem statesystem, String label, TextSection textsection)
     : base(statesystem, label, textsection)
 {
     m_statenumber = textsection.GetAttribute<Evaluation.Expression>("value", null);
     m_control = textsection.GetAttribute<Evaluation.Expression>("ctrl", null);
     m_animationnumber = textsection.GetAttribute<Evaluation.Expression>("anim", null);
 }
Ejemplo n.º 41
0
 public Helper(StateSystem statesystem, string label, TextSection textsection)
     : base(statesystem, label, textsection)
 {
     m_helpertype     = textsection.GetAttribute("helpertype", HelperType.Normal);
     m_name           = textsection.GetAttribute <string>("name", null);
     m_id             = textsection.GetAttribute <Evaluation.Expression>("id", null);
     m_position       = textsection.GetAttribute <Evaluation.Expression>("pos", null);
     m_postype        = textsection.GetAttribute("postype", PositionType.P1);
     m_facing         = textsection.GetAttribute <Evaluation.Expression>("facing", null);
     m_statenumber    = textsection.GetAttribute <Evaluation.Expression>("stateno", null);
     m_keyctrl        = textsection.GetAttribute <Evaluation.Expression>("keyctrl", null);
     m_ownpal         = textsection.GetAttribute <Evaluation.Expression>("ownpal", null);
     m_supermovetime  = textsection.GetAttribute <Evaluation.Expression>("SuperMoveTime", null);
     m_pausemovetime  = textsection.GetAttribute <Evaluation.Expression>("PauseMoveTime", null);
     m_xscale         = textsection.GetAttribute <Evaluation.Expression>("size.xscale", null);
     m_yscale         = textsection.GetAttribute <Evaluation.Expression>("size.yscale", null);
     m_groundback     = textsection.GetAttribute <Evaluation.Expression>("size.ground.back", null);
     m_groundfront    = textsection.GetAttribute <Evaluation.Expression>("size.ground.front", null);
     m_airback        = textsection.GetAttribute <Evaluation.Expression>("size.air.back", null);
     m_airfront       = textsection.GetAttribute <Evaluation.Expression>("size.air.front", null);
     m_height         = textsection.GetAttribute <Evaluation.Expression>("size.height", null);
     m_projectscaling = textsection.GetAttribute <Evaluation.Expression>("size.proj.doscale", null);
     m_headpos        = textsection.GetAttribute <Evaluation.Expression>("size.head.pos", null);
     m_midpos         = textsection.GetAttribute <Evaluation.Expression>("size.mid.pos", null);
     m_shadowoffset   = textsection.GetAttribute <Evaluation.Expression>("size.shadowoffset", null);
 }
Ejemplo n.º 42
0
 public HitFallSet(StateSystem statesystem, String label, TextSection textsection)
     : base(statesystem, label, textsection)
 {
     m_fallset = textsection.GetAttribute<Evaluation.Expression>("value", null);
     m_velx = textsection.GetAttribute<Evaluation.Expression>("xvel", null);
     m_vely = textsection.GetAttribute<Evaluation.Expression>("yvel", null);
 }
Ejemplo n.º 43
0
        public MenuSystem(SubSystems subsystems)
            : base(subsystems)
        {
            TextFile    textfile = GetSubSystem <IO.FileSystem>().OpenTextFile(@"data/system.def");
            TextSection info     = textfile.GetSection("info");
            TextSection files    = textfile.GetSection("files");

            m_motifname   = info.GetAttribute <String>("name", String.Empty);
            m_motifauthor = info.GetAttribute <String>("author", String.Empty);

            Dictionary <Int32, Font> fontmap = new Dictionary <Int32, Font>();

            Drawing.SpriteSystem spritesystem = GetSubSystem <Drawing.SpriteSystem>();

            String fontpath1 = files.GetAttribute <String>("font1", null);

            if (fontpath1 != null)
            {
                fontmap[1] = spritesystem.LoadFont(fontpath1);
            }

            String fontpath2 = files.GetAttribute <String>("font2", null);

            if (fontpath2 != null)
            {
                fontmap[2] = spritesystem.LoadFont(fontpath2);
            }

            String fontpath3 = files.GetAttribute <String>("font3", null);

            if (fontpath3 != null)
            {
                fontmap[3] = spritesystem.LoadFont(fontpath3);
            }

            m_fontmap = new Drawing.FontMap(fontmap);

            String soundpath  = @"data/" + files.GetAttribute <String>("snd");
            String spritepath = @"data/" + files.GetAttribute <String>("spr");
            String animpath   = textfile.Filepath;

            m_titlescreen = new TitleScreen(this, textfile.GetSection("Title Info"), spritepath, animpath, soundpath);
            m_titlescreen.LoadBackgrounds("Title", textfile);

            m_versusscreen = new VersusScreen(this, textfile.GetSection("VS Screen"), spritepath, animpath, soundpath);
            m_versusscreen.LoadBackgrounds("Versus", textfile);

            m_selectscreen = new SelectScreen(this, textfile.GetSection("Select Info"), spritepath, animpath, soundpath);
            m_selectscreen.LoadBackgrounds("Select", textfile);

            m_combatscreen = new CombatScreen(this);
            m_replayscreen = new RecordedCombatScreen(this);

            m_currentscreen = null;
            m_newscreen     = null;
            m_fade          = 0;
            m_fadespeed     = 0;
            m_eventqueue    = new Queue <Events.Base>();
        }
Ejemplo n.º 44
0
 public AssemblyWriter(AssemblyDefinition assemblyDef, Stream output, CompilationOptions options)
     : base(output)
 {
     _options = options;
     _text    = GetTextSection(assemblyDef);
     _rsrc    = GetRsrcSection();
     _reloc   = GetRelocSection();
 }
Ejemplo n.º 45
0
 public Pause(StateSystem statesystem, String label, TextSection textsection)
     : base(statesystem, label, textsection)
 {
     m_time = textsection.GetAttribute<Evaluation.Expression>("time", null);
     m_cmdbuffertime = textsection.GetAttribute<Evaluation.Expression>("endcmdbuftime", null);
     m_movetime = textsection.GetAttribute<Evaluation.Expression>("movetime", null);
     m_pausebackground = textsection.GetAttribute<Evaluation.Expression>("pausebg", null);
 }
Ejemplo n.º 46
0
        public BindToTarget(StateSystem statesystem, String label, TextSection textsection)
            : base(statesystem, label, textsection)
        {
            m_time = textsection.GetAttribute<Evaluation.Expression>("time", null);
            m_targetid = textsection.GetAttribute<Evaluation.Expression>("id", null);

            ParsePositionString(textsection.GetAttribute<String>("pos", null), out m_position, out m_bindpos);
        }
Ejemplo n.º 47
0
 public GameMakeAnim(StateSystem statesystem, String label, TextSection textsection)
     : base(statesystem, label, textsection)
 {
     m_anim = textsection.GetAttribute<Evaluation.Expression>("value", null);
     m_drawunder = textsection.GetAttribute<Evaluation.Expression>("under", null);
     m_position = textsection.GetAttribute<Evaluation.Expression>("pos", null);
     m_random = textsection.GetAttribute<Evaluation.Expression>("random", null);
 }
Ejemplo n.º 48
0
        public SelectScreen(MenuSystem screensystem, TextSection textsection, string spritepath, string animationpath, string soundpath)
            : base(screensystem, textsection, spritepath, animationpath, soundpath)
        {
            m_textsection = textsection;
            var elements = new Collection(SpriteManager, AnimationManager, SoundManager, MenuSystem.FontMap);

            Grid = new SelectGrid(textsection, elements, PlayerProfiles);
        }
Ejemplo n.º 49
0
 public VersusScreen(MenuSystem screensystem, TextSection textsection, String spritepath, String animationpath, String soundpath)
     : base(screensystem, textsection, spritepath, animationpath, soundpath)
 {
     m_visibletime = textsection.GetAttribute<Int32>("time");
     m_p1 = new VersusData("p1.", textsection);
     m_p2 = new VersusData("p2.", textsection);
     m_timer = new CountdownTimer(TimeSpan.FromSeconds(m_visibletime / 60.0f), this.ShowTimeComplete);
 }
Ejemplo n.º 50
0
 public VarRangeSet(StateSystem statesystem, String label, TextSection textsection)
     : base(statesystem, label, textsection)
 {
     m_intnumber = textsection.GetAttribute<Evaluation.Expression>("value", null);
     m_floatnumber = textsection.GetAttribute<Evaluation.Expression>("fvalue", null);
     m_startrrange = textsection.GetAttribute<Evaluation.Expression>("first", null);
     m_endrange = textsection.GetAttribute<Evaluation.Expression>("last", null);
 }
Ejemplo n.º 51
0
 public VarRangeSet(StateSystem statesystem, String label, TextSection textsection)
     : base(statesystem, label, textsection)
 {
     m_intnumber   = textsection.GetAttribute <Evaluation.Expression>("value", null);
     m_floatnumber = textsection.GetAttribute <Evaluation.Expression>("fvalue", null);
     m_startrrange = textsection.GetAttribute <Evaluation.Expression>("first", null);
     m_endrange    = textsection.GetAttribute <Evaluation.Expression>("last", null);
 }
Ejemplo n.º 52
0
        public AfterImageTime(StateSystem statesystem, string label, TextSection textsection)
            : base(statesystem, label, textsection)
        {
            var expTime  = textsection.GetAttribute <Evaluation.Expression>("time", null);
            var expValue = textsection.GetAttribute <Evaluation.Expression>("value", null);

            m_time = expTime ?? expValue;
        }
Ejemplo n.º 53
0
        public BindToTarget(StateSystem statesystem, String label, TextSection textsection)
            : base(statesystem, label, textsection)
        {
            m_time     = textsection.GetAttribute <Evaluation.Expression>("time", null);
            m_targetid = textsection.GetAttribute <Evaluation.Expression>("id", null);

            ParsePositionString(textsection.GetAttribute <String>("pos", null), out m_position, out m_bindpos);
        }
Ejemplo n.º 54
0
		/// <summary>
		/// Determines whether a background can be created from the given xnaMugen.IO.TextSection.
		/// </summary>
		/// <param name="section">A xnaMugen.IO.TextSection.</param>
		/// <returns>true if a background can be created; false otherwise.</returns>
		public Boolean CanCreateBackground(TextSection section)
		{
			if (section == null) throw new ArgumentNullException("section");

			BackgroundType bgtype = section.GetAttribute<BackgroundType>("type");

			return bgtype != BackgroundType.None;
		}
Ejemplo n.º 55
0
 public EnvShake(StateSystem statesystem, String label, TextSection textsection)
     : base(statesystem, label, textsection)
 {
     m_time = textsection.GetAttribute<Evaluation.Expression>("Time", null);
     m_freq = textsection.GetAttribute<Evaluation.Expression>("freq", null);
     m_amplitude = textsection.GetAttribute<Evaluation.Expression>("ampl", null);
     m_phaseoffset = textsection.GetAttribute<Evaluation.Expression>("phase", null);
 }
Ejemplo n.º 56
0
        public AfterImageTime(StateSystem statesystem, String label, TextSection textsection)
            : base(statesystem, label, textsection)
        {
            Evaluation.Expression exp_time = textsection.GetAttribute<Evaluation.Expression>("time", null);
            Evaluation.Expression exp_value = textsection.GetAttribute<Evaluation.Expression>("value", null);

            m_time = exp_time ?? exp_value;
        }
Ejemplo n.º 57
0
 public ForceFeedback(StateSystem statesystem, String label, TextSection textsection)
     : base(statesystem, label, textsection)
 {
     m_rumbletype = textsection.GetAttribute<ForceFeedbackType>("waveform", ForceFeedbackType.Sine);
     m_time = textsection.GetAttribute<Evaluation.Expression>("time", null);
     m_freq = textsection.GetAttribute<Evaluation.Expression>("freq", null);
     m_ampl = textsection.GetAttribute<Evaluation.Expression>("ampl", null);
     m_self = textsection.GetAttribute<Evaluation.Expression>("self", null);
 }
Ejemplo n.º 58
0
		public Parallax(TextSection textsection, Drawing.SpriteManager spritemanager)
			: base(textsection)
		{
			if (spritemanager == null) throw new ArgumentNullException("spritemanager");

			m_spritemanager = spritemanager;
			m_spriteid = textsection.GetAttribute<SpriteId>("spriteno", SpriteId.Invalid);
			m_sprite = SpriteManager.GetSprite(SpriteId);
		}
Ejemplo n.º 59
0
 public HitOverride(StateSystem statesystem, String label, TextSection textsection)
     : base(statesystem, label, textsection)
 {
     m_hitattr = textsection.GetAttribute<Combat.HitAttribute>("attr", null);
     m_slot = textsection.GetAttribute<Evaluation.Expression>("slot", null);
     m_statenumber = textsection.GetAttribute<Evaluation.Expression>("stateno", null);
     m_time = textsection.GetAttribute<Evaluation.Expression>("time", null);
     m_forceair = textsection.GetAttribute<Evaluation.Expression>("forceair", null);
 }
Ejemplo n.º 60
0
 public PalFx(StateSystem statesystem, String label, TextSection textsection)
     : base(statesystem, label, textsection)
 {
     m_time = textsection.GetAttribute<Evaluation.Expression>("time", null);
     m_paladd = textsection.GetAttribute<Evaluation.Expression>("add", null);
     m_palmul = textsection.GetAttribute<Evaluation.Expression>("mul", null);
     m_sineadd = textsection.GetAttribute<Evaluation.Expression>("sinadd", null);
     m_palinvert = textsection.GetAttribute<Evaluation.Expression>("invertall", null);
     m_palcolor = textsection.GetAttribute<Evaluation.Expression>("color", null);
 }