Example #1
0
        public ComboCounter(Team team)
        {
            if (team == null) throw new ArgumentNullException("team");

            m_team = team;

            String prefix = Misc.GetPrefix(m_team.Side);

            IO.TextFile textfile = m_team.Engine.GetSubSystem<IO.FileSystem>().OpenTextFile(@"data/fight.def");
            IO.TextSection combosection = textfile.GetSection("Combo");

            m_displaylocation = (Vector2)combosection.GetAttribute<Point>("pos", new Point(0, 0));

            Single startx = (Single)combosection.GetAttribute<Int32>("start.x", (Int32)m_displaylocation.X);
            Single starty = (Single)combosection.GetAttribute<Int32>("start.y", (Int32)m_displaylocation.Y);
            m_startlocation = new Vector2(startx, starty);

            m_counterelement = m_team.Engine.Elements.Build(prefix + ".combo counter", combosection, "counter");
            m_displayelement = m_team.Engine.Elements.Build(prefix + ".combo text", combosection, "text");

            m_displaytime = combosection.GetAttribute<Int32>("displaytime", 90);

            m_velocity = new Vector2(5, 5);
            m_state = State.NotShown;
            m_currentlocation = m_startlocation;
            m_hitcount = 0;
            m_displaytimecount = 0;
            m_countertext = String.Empty;
            m_displaytext = String.Empty;
            m_hitbonus = 0;
        }
Example #2
0
		public Player(FightEngine engine, PlayerProfile profile, Team team)
			: base(engine)
		{
			if (profile == null) throw new ArgumentNullException("profile");
			if (team == null) throw new ArgumentNullException("team");

			m_profile = profile;
			m_spritemanager = Engine.GetSubSystem<Drawing.SpriteSystem>().CreateManager(Profile.SpritePath);
			m_animationmanager = Engine.GetSubSystem<Animations.AnimationSystem>().CreateManager(Profile.AnimationPath);
			m_soundmanager = Engine.GetSubSystem<Audio.SoundSystem>().CreateManager(Profile.SoundPath);
			m_statemanager = Engine.GetSubSystem<StateMachine.StateSystem>().CreateManager(this, Profile.StateFiles);
			m_commandmanager = Engine.GetSubSystem<Commands.CommandSystem>().CreateManager(Profile.CommandPath);
			m_constants = new PlayerConstants(this, Engine.GetSubSystem<IO.FileSystem>().OpenTextFile(Profile.ConstantsPath));
			m_dimensions = new CharacterDimensions(Constants);
			m_palettes = BuildPalettes();
			m_palettenumber = 0;
			m_power = 0;
			m_palfx = new PaletteFx();
			m_team = team;
			m_helpers = new Dictionary<Int32, List<Helper>>();

			if (Engine.GetSubSystem<InitializationSettings>().PreloadCharacterSprites == true)
			{
				SpriteManager.LoadAllSprites();
			}

			SpriteManager.UseOverride = true;

			SetLocalAnimation(0, 0);

			CurrentScale = Constants.Scale;
			PushFlag = true;
		}
Example #3
0
        public TeamDisplay(Team team)
        {
            if (team == null) throw new ArgumentNullException("team");

            m_team = team;
            m_combocounter = new ComboCounter(team);

            IO.TextFile textfile = m_team.Engine.GetSubSystem<IO.FileSystem>().OpenTextFile(@"data/fight.def");
            IO.TextSection lifebar = textfile.GetSection("Lifebar");
            IO.TextSection powerbar = textfile.GetSection("Powerbar");
            IO.TextSection face = textfile.GetSection("Face");
            IO.TextSection name = textfile.GetSection("Name");
            IO.TextSection winicon = textfile.GetSection("WinIcon");

            String prefix = Misc.GetPrefix(m_team.Side);
            var elements = m_team.Engine.Elements;

            m_lifebg0 = elements.Build(prefix + "lifebar.bg0", lifebar, prefix + ".bg0");
            m_lifebg1 = elements.Build(prefix + "lifebar.bg1", lifebar, prefix + ".bg1");
            m_lifebg2 = elements.Build(prefix + "lifebar.bg2", lifebar, prefix + ".bg2");
            m_lifemid = elements.Build(prefix + "lifebar.mid", lifebar, prefix + ".mid");
            m_lifefront = elements.Build(prefix + "lifebar.front", lifebar, prefix + ".front");

            m_powerbg0 = elements.Build(prefix + "powerbar.bg0", powerbar, prefix + ".bg0");
            m_powerbg1 = elements.Build(prefix + "powerbar.bg1", powerbar, prefix + ".bg1");
            m_powerbg2 = elements.Build(prefix + "powerbar.bg2", powerbar, prefix + ".bg2");
            m_powermid = elements.Build(prefix + "powerbar.mid", powerbar, prefix + ".mid");
            m_powerfront = elements.Build(prefix + "powerbar.front", powerbar, prefix + ".front");
            m_powercounter = elements.Build(prefix + "powerbar.counter", powerbar, prefix + ".counter");

            m_facebg = elements.Build(prefix + "face.bg", face, prefix + ".bg");
            m_faceimage = elements.Build(prefix + "face.face", face, prefix + ".face");

            m_namelement = elements.Build(prefix + "name.name", name, prefix + ".name");

            m_winiconnormal = elements.Build(prefix + "winicon.normal", winicon, prefix + ".n");
            m_winiconspecial = elements.Build(prefix + "winicon.special", winicon, prefix + ".s");
            m_winiconhyper = elements.Build(prefix + "winicon.hyper", winicon, prefix + ".h");
            m_winiconthrow = elements.Build(prefix + "winicon.normalthrow", winicon, prefix + ".throw");
            m_winiconcheese = elements.Build(prefix + "winicon.cheese", winicon, prefix + ".c");
            m_winicontime = elements.Build(prefix + "winicon.timeout", winicon, prefix + ".t");
            m_winiconsuicide = elements.Build(prefix + "winicon.suicide", winicon, prefix + ".suicide");
            m_winiconteammate = elements.Build(prefix + "winicon.teammate", winicon, prefix + ".teammate");
            m_winiconperfect = elements.Build(prefix + "winicon.perfect", winicon, prefix + ".perfect");

            m_lifebarposition = (Vector2)lifebar.GetAttribute<Point>(prefix + ".pos");
            m_lifebarrange = lifebar.GetAttribute<Point>(prefix + ".range.x");

            m_powerbarposition = (Vector2)powerbar.GetAttribute<Point>(prefix + ".pos");
            m_powerbarrange = powerbar.GetAttribute<Point>(prefix + ".range.x");

            m_faceposition = (Vector2)face.GetAttribute<Point>(prefix + ".pos");

            m_nameposition = (Vector2)name.GetAttribute<Point>(prefix + ".pos");

            m_winiconposition = (Vector2)winicon.GetAttribute<Point>(prefix + ".pos");
            m_winiconoffset = (Vector2)winicon.GetAttribute<Point>(prefix + ".iconoffset");
        }
Example #4
0
        public FightEngine(SubSystems subsystems)
            : base(subsystems)
        {
            IO.TextFile textfile = GetSubSystem<IO.FileSystem>().OpenTextFile(@"data/fight.def");
            IO.TextSection filesection = textfile.GetSection("Files");
            String basepath = GetSubSystem<IO.FileSystem>().GetDirectory(textfile.Filepath);

			m_init = null;
            m_entities = new EntityCollection(this);
            m_roundnumber = 0;
            m_stage = null;
            m_idcounter = 0;
            m_tickcount = 0;
            m_pause = new Pause(this, false);
            m_superpause = new Pause(this, true);
            m_asserts = new EngineAssertions();
            m_camera = new Camera(this);
            m_envcolor = new EnvironmentColor(this);
            m_envshake = new EnvironmentShake(this);
            m_speed = GameSpeed.Normal;
            m_slowspeedbuffer = 0;
            m_fontmap = BuildFontMap(filesection);
            m_fightsounds = GetSubSystem<Audio.SoundSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute<String>("snd")));
            m_commonsounds = GetSubSystem<Audio.SoundSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute<String>("common.snd")));
            m_fightsprites = GetSubSystem<Drawing.SpriteSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute<String>("sff")));
            m_fxsprites = GetSubSystem<Drawing.SpriteSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute<String>("fightfx.sff")));
            m_fightanimations = GetSubSystem<Animations.AnimationSystem>().CreateManager(textfile.Filepath);
            m_fxanimations = GetSubSystem<Animations.AnimationSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute<String>("fightfx.air")));
            m_elements = new Elements.Collection(FightSprites, FightAnimations, FightSounds, Fonts);
            m_roundinfo = new RoundInformation(this, textfile);
            m_team1 = new Team(this, TeamSide.Left);
            m_team2 = new Team(this, TeamSide.Right);
            m_combatcheck = new CombatChecker(this);
            m_logic = new Logic.PreIntro(this);
			m_clock = new Clock(this);
        }
Example #5
0
		public VictoryStatus(Team team)
		{
			if (team == null) throw new ArgumentNullException("team");

			m_team = team;
		}