コード例 #1
0
ファイル: Helper.cs プロジェクト: lodossDev/xnamugen
		public Helper(FightEngine engine, Character parent, HelperData data)
			: base(engine)
		{
			if (parent == null) throw new ArgumentNullException("parent");
			if (data == null) throw new ArgumentNullException("data");

			m_parent = parent;
			m_baseplayer = m_parent.BasePlayer;
			m_team = m_baseplayer.Team;
			m_offsetcharacter = (data.PositionType == PositionType.P2) ? parent.GetOpponent() : parent;
			m_remove = false;
			m_data = data;
			m_firsttick = true;
			m_statemanager = Parent.StateManager.Clone(this);
			m_spritemanager = Parent.SpriteManager.Clone();
			m_animationmanager = Parent.AnimationManager.Clone();
			m_commandmanager = Parent.CommandManager.Clone();
			m_soundmanager = Parent.SoundManager.Clone();
			m_dimensions = new CharacterDimensions(Data.GroundFront, Data.GroundBack, Data.AirFront, Data.AirBack, Data.Height);
			m_palfx = (Data.OwnPaletteFx == true) ? new PaletteFx() : Parent.PaletteFx;

			CurrentPalette = Parent.CurrentPalette;
			CurrentFacing = GetFacing(Data.PositionType, m_offsetcharacter.CurrentFacing, Data.FacingFlag < 0);
			CurrentLocation = GetStartLocation();
			CurrentScale = Data.Scale;

			SetLocalAnimation(0, 0);

			StateManager.ChangeState(Data.InitialStateNumber);
		}
コード例 #2
0
 public CombatChecker(FightEngine engine)
     : base(engine)
 {
     m_attacks      = new List <Contact>();
     m_killist      = new List <Contact>();
     m_attacksorter = ContactSort;
 }
コード例 #3
0
ファイル: Projectile.cs プロジェクト: lodossDev/xnamugen
		public Projectile(FightEngine fightengine, Character creator, ProjectileData data)
			: base(fightengine)
		{
			if (creator == null) throw new ArgumentNullException("creator");
			if (data == null) throw new ArgumentNullException("data");

			m_creator = creator;
			m_offsetcharacter = (data.PositionType == PositionType.P2) ? creator.GetOpponent() : creator;
			m_data = data;
			m_animationmanager = Creator.AnimationManager.Clone();
			m_spritemanager = Creator.SpriteManager.Clone();
			m_gameticks = 0;
			m_hitcountdown = 0;
			m_state = ProjectileState.Normal;
			m_totalhits = 0;
			m_hitpausecountdown = 0;
			m_currentpriority = Data.Priority;
			m_palfx = new PaletteFx();

			CurrentPalette = Creator.CurrentPalette;
			CurrentFacing = Creator.CurrentFacing;
			CurrentLocation = GetStartLocation();
			CurrentVelocity = Data.InitialVelocity;
			CurrentAcceleration = Data.Acceleration;
			CurrentFlip = SpriteEffects.None;
			CurrentScale = Data.Scale;
			DrawOrder = Data.SpritePriority;

			SetLocalAnimation(Data.AnimationNumber, 0);
		}
コード例 #4
0
ファイル: CombatChecker.cs プロジェクト: lodossDev/xnamugen
		public CombatChecker(FightEngine engine)
			: base(engine)
		{
			m_attacks = new List<Contact>();
			m_killist = new List<Contact>();
			m_attacksorter = ContactSort;
		}
コード例 #5
0
ファイル: Player.cs プロジェクト: lodossDev/xnamugen
		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;
		}
コード例 #6
0
ファイル: Character.cs プロジェクト: terrynoya/xnamugen-1
 protected Character(FightEngine engine)
     : base(engine)
 {
     m_statetype     = StateType.Standing;
     m_playercontrol = PlayerControl.InControl;
     m_movetype      = MoveType.Idle;
     m_physics       = Physics.Standing;
     m_life          = 0;
     Id                 = Engine.GenerateCharacterId();
     DrawOffset         = new Vector2(0, 0);
     PositionFreeze     = false;
     RoundsExisted      = 0;
     m_bind             = new CharacterBind(this);
     m_assertions       = new CharacterAssertions();
     JugglePoints       = 0;
     m_variables        = new CharacterVariables();
     m_clipboard        = new StringBuilder();
     m_currentinput     = PlayerButton.None;
     PushFlag           = false;
     DrawScale          = Vector2.One;
     m_offensiveinfo    = new OffensiveInfo(this);
     m_defensiveinfo    = new DefensiveInfo(this);
     m_updatedanimation = false;
     m_explods          = new Dictionary <int, List <Explod> >();
 }
コード例 #7
0
ファイル: Character.cs プロジェクト: lodossDev/xnamugen
		protected Character(FightEngine engine)
			: base(engine)
		{
			m_statetype = StateType.Standing;
			m_playercontrol = PlayerControl.InControl;
			m_movetype = MoveType.Idle;
			m_physics = Physics.Standing;
			m_life = 0;
			m_id = Engine.GenerateCharacterId();
			m_drawoffset = new Vector2(0, 0);
			m_positionfreeze = false;
			m_roundsexisted = 0;
			m_bind = new CharacterBind(this);
			m_assertions = new CharacterAssertions();
			m_jugglepoints = 0;
			m_variables = new CharacterVariables();
			m_clipboard = new StringBuilder();
			m_currentinput = PlayerButton.None;
			m_pushflag = false;
			m_drawscale = Vector2.One;
			m_offensiveinfo = new OffensiveInfo(this);
			m_defensiveinfo = new DefensiveInfo(this);
			m_updatedanimation = false;
			m_explods = new Dictionary<Int32, List<Explod>>();
		}
コード例 #8
0
 public EnvironmentColor(FightEngine fightengine)
     : base(fightengine)
 {
     m_color      = Vector3.Zero;
     m_time       = 0;
     m_under      = false;
     m_hiddenlist = new List <Entity>();
     m_drawstate  = new Video.DrawState(Engine.GetSubSystem <Video.VideoSystem>());
 }
コード例 #9
0
        protected EngineObject(FightEngine engine)
        {
            if (engine == null)
            {
                throw new ArgumentNullException(nameof(engine));
            }

            m_engine = engine;
        }
コード例 #10
0
        public RoundInformation(FightEngine engine, IO.TextFile file)
            : base(engine)
        {
            if (file == null)
            {
                throw new ArgumentNullException("file");
            }

            IO.TextSection roundsection    = file.GetSection("Round");
            IO.TextSection powerbarsection = file.GetSection("Powerbar");

            var elements = Engine.Elements;

            elements.Build(roundsection, "round.default");
            elements.Build(roundsection, "round");
            elements.Build(roundsection, "round1");
            elements.Build(roundsection, "round2");
            elements.Build(roundsection, "round3");
            elements.Build(roundsection, "round4");
            elements.Build(roundsection, "round5");
            elements.Build(roundsection, "round6");
            elements.Build(roundsection, "round7");
            elements.Build(roundsection, "round8");
            elements.Build(roundsection, "round9");
            elements.Build(roundsection, "fight");
            elements.Build(roundsection, "KO");
            elements.Build(roundsection, "DKO");
            elements.Build(roundsection, "TO");
            elements.Build(roundsection, "win");
            elements.Build(roundsection, "win2");
            elements.Build(roundsection, "draw");

            elements.Build(powerbarsection, "level1");
            elements.Build(powerbarsection, "level2");
            elements.Build(powerbarsection, "level3");
            elements.Build(powerbarsection, "level4");
            elements.Build(powerbarsection, "level5");
            elements.Build(powerbarsection, "level6");
            elements.Build(powerbarsection, "level7");
            elements.Build(powerbarsection, "level8");
            elements.Build(powerbarsection, "level9");

            m_roundsforwin     = roundsection.GetAttribute <Int32>("match.wins");
            m_maxdrawgames     = roundsection.GetAttribute <Int32>("match.maxdrawgames");
            m_introdelay       = roundsection.GetAttribute <Int32>("start.waittime");
            m_defaultlocation  = (Vector2)roundsection.GetAttribute <Point>("pos");
            m_rounddisplaytime = roundsection.GetAttribute <Int32>("round.time");
            m_controltime      = roundsection.GetAttribute <Int32>("ctrl.time");
            m_koslowtime       = roundsection.GetAttribute <Int32>("slow.time");
            m_overwaittime     = roundsection.GetAttribute <Int32>("over.waittime");
            m_overhittime      = roundsection.GetAttribute <Int32>("over.hittime");
            m_overwintime      = roundsection.GetAttribute <Int32>("over.wintime");
            m_overtime         = roundsection.GetAttribute <Int32>("over.time");
            m_wintime          = roundsection.GetAttribute <Int32>("win.time");

            m_roundnumbers = BuildRoundNumbersSoundMap();
        }
コード例 #11
0
		public EnvironmentColor(FightEngine fightengine)
			: base(fightengine)
		{
			m_color = Vector3.Zero;
			m_time = 0;
			m_under = false;
			m_hiddenlist = new List<Entity>();
			m_drawstate = new Video.DrawState(Engine.GetSubSystem<Video.VideoSystem>());
		}
コード例 #12
0
        public Explod(FightEngine fightengine, ExplodData data)
            : base(fightengine)
        {
            if (data == null)
            {
                throw new ArgumentNullException(nameof(data));
            }

            m_data        = data;
            m_tickcount   = 0;
            m_forceremove = false;
            m_creator     = data.Creator;

            if (m_data.CommonAnimation == false)
            {
                m_spritemanager    = BasePlayer.SpriteManager.Clone();
                m_animationmanager = BasePlayer.AnimationManager.Clone();
            }
            else
            {
                m_spritemanager    = Engine.FxSprites.Clone();
                m_animationmanager = Engine.FxAnimations.Clone();
            }

            m_creationfacing = Data.Offseter.CurrentFacing;

            CurrentPalette      = Creator.CurrentPalette;
            CurrentFacing       = GetStartFacing();
            CurrentLocation     = GetStartLocation();
            CurrentVelocity     = m_data.Velocity;
            CurrentAcceleration = m_data.Acceleration;
            CurrentFlip         = SpriteEffects.None;
            CurrentScale        = m_data.Scale;
            DrawOrder           = m_data.DrawOnTop ? 11 : m_data.SpritePriority;
            Transparency        = Data.Transparency;

            var rng = Engine.GetSubSystem <Random>();

            m_random    = new Vector2();
            m_random.X += rng.NewInt(-m_data.Random.X, m_data.Random.X);
            m_random.Y += rng.NewInt(-m_data.Random.Y, m_data.Random.Y);

            m_palfx = m_data.OwnPalFx ? new PaletteFx() : Creator.PaletteFx;

            if (AnimationManager.HasAnimation(Data.AnimationNumber))
            {
                SetLocalAnimation(Data.AnimationNumber, 0);
                m_valid = true;
            }
            else
            {
                m_valid = false;
            }
        }
コード例 #13
0
		public RoundInformation(FightEngine engine, IO.TextFile file)
			: base(engine)
		{
			if (file == null) throw new ArgumentNullException("file");

			IO.TextSection roundsection = file.GetSection("Round");
			IO.TextSection powerbarsection = file.GetSection("Powerbar");

            var elements = Engine.Elements;

            elements.Build(roundsection, "round.default");
            elements.Build(roundsection, "round");
            elements.Build(roundsection, "round1");
            elements.Build(roundsection, "round2");
            elements.Build(roundsection, "round3");
            elements.Build(roundsection, "round4");
            elements.Build(roundsection, "round5");
            elements.Build(roundsection, "round6");
            elements.Build(roundsection, "round7");
            elements.Build(roundsection, "round8");
            elements.Build(roundsection, "round9");
            elements.Build(roundsection, "fight");
            elements.Build(roundsection, "KO");
            elements.Build(roundsection, "DKO");
            elements.Build(roundsection, "TO");
            elements.Build(roundsection, "win");
            elements.Build(roundsection, "win2");
            elements.Build(roundsection, "draw");

            elements.Build(powerbarsection, "level1");
            elements.Build(powerbarsection, "level2");
            elements.Build(powerbarsection, "level3");
            elements.Build(powerbarsection, "level4");
            elements.Build(powerbarsection, "level5");
            elements.Build(powerbarsection, "level6");
            elements.Build(powerbarsection, "level7");
            elements.Build(powerbarsection, "level8");
            elements.Build(powerbarsection, "level9");

			m_roundsforwin = roundsection.GetAttribute<Int32>("match.wins");
			m_maxdrawgames = roundsection.GetAttribute<Int32>("match.maxdrawgames");
			m_introdelay = roundsection.GetAttribute<Int32>("start.waittime");
			m_defaultlocation = (Vector2)roundsection.GetAttribute<Point>("pos");
			m_rounddisplaytime = roundsection.GetAttribute<Int32>("round.time");
			m_controltime = roundsection.GetAttribute<Int32>("ctrl.time");
			m_koslowtime = roundsection.GetAttribute<Int32>("slow.time");
			m_overwaittime = roundsection.GetAttribute<Int32>("over.waittime");
			m_overhittime = roundsection.GetAttribute<Int32>("over.hittime");
			m_overwintime = roundsection.GetAttribute<Int32>("over.wintime");
			m_overtime = roundsection.GetAttribute<Int32>("over.time");
			m_wintime = roundsection.GetAttribute<Int32>("win.time");

			m_roundnumbers = BuildRoundNumbersSoundMap();
		}
コード例 #14
0
ファイル: Clock.cs プロジェクト: terrynoya/xnamugen-1
        public Clock(FightEngine engine)
            : base(engine)
        {
            var textfile    = Engine.GetSubSystem <IO.FileSystem>().OpenTextFile(@"data/fight.def");
            var timesection = textfile.GetSection("Time");

            m_position       = (Vector2)timesection.GetAttribute("pos", new Point(0, 0));
            m_bgelement      = Engine.Elements.Build("time bg", timesection, "bg");
            m_counterelement = Engine.Elements.Build("time counter", timesection, "counter");

            Time = -1;
        }
コード例 #15
0
ファイル: Clock.cs プロジェクト: lodossDev/xnamugen
        public Clock(FightEngine engine)
            : base(engine)
        {
			IO.TextFile textfile = Engine.GetSubSystem<IO.FileSystem>().OpenTextFile(@"data/fight.def");
            IO.TextSection timesection = textfile.GetSection("Time");

            m_position = (Vector2)timesection.GetAttribute<Point>("pos", new Point(0, 0));
            m_bgelement = Engine.Elements.Build("time bg", timesection, "bg");
            m_counterelement = Engine.Elements.Build("time counter", timesection, "counter");

			m_time = -1;
        }
コード例 #16
0
 public EntityCollection(FightEngine fightengine)
     : base(fightengine)
 {
     m_entities            = new List <Entity>();
     m_addlist             = new List <Entity>();
     m_removelist          = new List <Entity>();
     m_tempqueue           = new List <Entity>();
     m_drawordercomparer   = this.DrawOrderComparer;
     m_updateordercomparer = this.UpdateOrderComparer;
     m_removecheck         = this.DrawRemoveCheck;
     m_inupdate            = false;
 }
コード例 #17
0
ファイル: Team.cs プロジェクト: lodossDev/xnamugen
		public Team(FightEngine engine, TeamSide side)
			: base(engine)
		{
			if (side != TeamSide.Left && side != TeamSide.Right) throw new ArgumentException("Side must be either Left or Right", "side");

			m_side = side;
			m_victorystatus = new VictoryStatus(this);
			m_display = new TeamDisplay(this);
			m_winhistory = new List<Win>(9);
			m_p1 = null;
			m_p2 = null;
		}
コード例 #18
0
 public Pause(FightEngine fightengine, bool superpause)
     : base(fightengine)
 {
     m_issuperpause      = superpause;
     m_creator           = null;
     m_totaltime         = 0;
     m_elapsedtime       = -1;
     m_commandbuffertime = 0;
     m_movetime          = 0;
     m_hitpause          = false;
     m_pausebackgrounds  = true;
     m_pausedentities    = new List <Entity>();
 }
コード例 #19
0
ファイル: Pause.cs プロジェクト: lodossDev/xnamugen
		public Pause(FightEngine fightengine, Boolean superpause)
			: base(fightengine)
		{
			m_issuperpause = superpause;
			m_creator = null;
			m_totaltime = 0;
			m_elapsedtime = -1;
			m_commandbuffertime = 0;
			m_movetime = 0;
			m_hitpause = false;
			m_pausebackgrounds = true;
			m_pausedentities = new List<Entity>();
		}
コード例 #20
0
ファイル: Team.cs プロジェクト: terrynoya/xnamugen-1
        public Team(FightEngine engine, TeamSide side)
            : base(engine)
        {
            if (side != TeamSide.Left && side != TeamSide.Right)
            {
                throw new ArgumentException("Side must be either Left or Right", nameof(side));
            }

            m_side          = side;
            m_victorystatus = new VictoryStatus(this);
            m_winhistory    = new List <Win>(9);
            m_p1            = null;
            m_p2            = null;
        }
コード例 #21
0
ファイル: Entity.cs プロジェクト: xubingyue/xnamugen
 protected Entity(FightEngine engine)
     : base(engine)
 {
     m_draworder    = 0;
     m_location     = new Vector2(0, 0);
     m_velocity     = new Vector2(0, 0);
     m_acceleration = new Vector2(0, 0);
     m_facing       = Facing.Right;
     m_flip         = SpriteEffects.None;
     m_scale        = new Vector2(1, 1);
     m_blending     = new Blending();
     m_afterimages  = new AfterImage(this);
     m_drawingangle = 0;
 }
コード例 #22
0
ファイル: Entity.cs プロジェクト: terrynoya/xnamugen-1
 protected Entity(FightEngine engine)
     : base(engine)
 {
     DrawOrder           = 0;
     CurrentLocation     = new Vector2(0, 0);
     CurrentVelocity     = new Vector2(0, 0);
     CurrentAcceleration = new Vector2(0, 0);
     m_facing            = Facing.Right;
     CurrentFlip         = SpriteEffects.None;
     CurrentScale        = new Vector2(1, 1);
     Transparency        = new Blending();
     m_afterimages       = new AfterImage(this);
     DrawingAngle        = 0;
 }
コード例 #23
0
ファイル: Explod.cs プロジェクト: lodossDev/xnamugen
		public Explod(FightEngine fightengine, ExplodData data)
			: base(fightengine)
		{
			if (data == null) throw new ArgumentNullException("data");

			m_data = data;
			m_tickcount = 0;
			m_forceremove = false;
			m_creator = data.Creator;

			if (m_data.CommonAnimation == false)
			{
				m_spritemanager = BasePlayer.SpriteManager.Clone();
				m_animationmanager = BasePlayer.AnimationManager.Clone();
			}
			else
			{
				m_spritemanager = Engine.FxSprites.Clone();
				m_animationmanager = Engine.FxAnimations.Clone();
			}

			m_creationfacing = Data.Offseter.CurrentFacing;

			CurrentPalette = Creator.CurrentPalette;
			CurrentFacing = GetStartFacing();
			CurrentLocation = GetStartLocation();
			CurrentVelocity = m_data.Velocity;
			CurrentAcceleration = m_data.Acceleration;
			CurrentFlip = SpriteEffects.None;
			CurrentScale = m_data.Scale;
			DrawOrder = (m_data.DrawOnTop == true) ? 11 : m_data.SpritePriority;
			Transparency = Data.Transparency;

			Random rng = Engine.GetSubSystem<Random>();
			m_random = new Vector2();
			m_random.X += rng.NewInt(-m_data.Random.X, m_data.Random.X);
			m_random.Y += rng.NewInt(-m_data.Random.Y, m_data.Random.Y);

			m_palfx = (m_data.OwnPalFx == true) ? new PaletteFx() : Creator.PaletteFx;

			if (AnimationManager.HasAnimation(Data.AnimationNumber) == true)
			{
				SetLocalAnimation(Data.AnimationNumber, 0);
				m_valid = true;
			}
			else
			{
				m_valid = false;
			}
		}
コード例 #24
0
ファイル: Entity.cs プロジェクト: lodossDev/xnamugen
		protected Entity(FightEngine engine)
			: base(engine)
		{
			m_draworder = 0;
			m_location = new Vector2(0, 0);
			m_velocity = new Vector2(0, 0);
			m_acceleration = new Vector2(0, 0);
			m_facing = Facing.Right;
			m_flip = SpriteEffects.None;
			m_scale = new Vector2(1, 1);
			m_blending = new Blending();
			m_afterimages = new AfterImage(this);
			m_drawingangle = 0;
		}
コード例 #25
0
ファイル: Player.cs プロジェクト: terrynoya/xnamugen-1
        public Player(FightEngine engine, PlayerProfile profile, PlayerMode mode, Team team)
            : base(engine)
        {
            if (profile == null)
            {
                throw new ArgumentNullException(nameof(profile));
            }
            if (team == null)
            {
                throw new ArgumentNullException(nameof(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(mode, 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 <int, List <Helper> >();

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

            SpriteManager.UseOverride = true;

            SetLocalAnimation(0, 0);

            CurrentScale = Constants.Scale;
            PushFlag     = true;
        }
コード例 #26
0
ファイル: Helper.cs プロジェクト: terrynoya/xnamugen-1
        public Helper(FightEngine engine, Character parent, HelperData data)
            : base(engine)
        {
            if (parent == null)
            {
                throw new ArgumentNullException(nameof(parent));
            }
            if (data == null)
            {
                throw new ArgumentNullException(nameof(data));
            }

            m_parent           = parent;
            m_baseplayer       = m_parent.BasePlayer;
            m_team             = m_baseplayer.Team;
            m_offsetcharacter  = data.PositionType == PositionType.P2 ? parent.GetOpponent() : parent;
            m_remove           = false;
            m_data             = data;
            m_firsttick        = true;
            m_statemanager     = Parent.StateManager.Clone(this);
            m_spritemanager    = Parent.SpriteManager.Clone();
            m_animationmanager = Parent.AnimationManager.Clone();
            m_commandmanager   = Parent.CommandManager.Clone();
            m_soundmanager     = Parent.SoundManager.Clone();
            m_dimensions       = new CharacterDimensions(Data.GroundFront, Data.GroundBack, Data.AirFront, Data.AirBack, Data.Height);
            m_palfx            = Data.OwnPaletteFx ? new PaletteFx() : Parent.PaletteFx;

            CurrentPalette  = Parent.CurrentPalette;
            CurrentFacing   = GetFacing(Data.PositionType, m_offsetcharacter.CurrentFacing, Data.FacingFlag < 0);
            CurrentLocation = GetStartLocation();
            CurrentScale    = Data.Scale;

            SetLocalAnimation(0, 0);

            StateManager.ChangeState(Data.InitialStateNumber);
        }
コード例 #27
0
        public Projectile(FightEngine fightengine, Character creator, ProjectileData data)
            : base(fightengine)
        {
            if (creator == null)
            {
                throw new ArgumentNullException("creator");
            }
            if (data == null)
            {
                throw new ArgumentNullException("data");
            }

            m_creator           = creator;
            m_offsetcharacter   = (data.PositionType == PositionType.P2) ? creator.GetOpponent() : creator;
            m_data              = data;
            m_animationmanager  = Creator.AnimationManager.Clone();
            m_spritemanager     = Creator.SpriteManager.Clone();
            m_gameticks         = 0;
            m_hitcountdown      = 0;
            m_state             = ProjectileState.Normal;
            m_totalhits         = 0;
            m_hitpausecountdown = 0;
            m_currentpriority   = Data.Priority;
            m_palfx             = new PaletteFx();

            CurrentPalette      = Creator.CurrentPalette;
            CurrentFacing       = Creator.CurrentFacing;
            CurrentLocation     = GetStartLocation();
            CurrentVelocity     = Data.InitialVelocity;
            CurrentAcceleration = Data.Acceleration;
            CurrentFlip         = SpriteEffects.None;
            CurrentScale        = Data.Scale;
            DrawOrder           = Data.SpritePriority;

            SetLocalAnimation(Data.AnimationNumber, 0);
        }
コード例 #28
0
 public EnvironmentShake(FightEngine engine)
     : base(engine)
 {
 }
コード例 #29
0
ファイル: Stage.cs プロジェクト: terrynoya/xnamugen-1
        public Stage(FightEngine engine, StageProfile profile)
            : base(engine)
        {
            if (profile == null)
            {
                throw new ArgumentNullException(nameof(profile));
            }

            m_profile             = profile;
            m_camerastartlocation = new Point(0, 0);
            m_p1start             = new Vector2(0, 0);
            m_p2start             = new Vector2(0, 0);
            m_palettefx           = new PaletteFx();

            var textfile          = Engine.GetSubSystem <FileSystem>().OpenTextFile(Profile.Filepath);
            var infosection       = textfile.GetSection("Info");
            var camerasection     = textfile.GetSection("Camera");
            var playerinfosection = textfile.GetSection("PlayerInfo");
            var boundsection      = textfile.GetSection("Bound");
            var stageinfosection  = textfile.GetSection("StageInfo");
            var shadowsection     = textfile.GetSection("Shadow");
            var reflectionsection = textfile.GetSection("Reflection");
            var musicsection      = textfile.GetSection("Music");
            var bgdefsection      = textfile.GetSection("BGDef");

            if (infosection == null)
            {
                throw new InvalidOperationException("Stage textfile '" + Profile.Filepath + "' is missing 'Info' section");
            }
            if (camerasection == null)
            {
                throw new InvalidOperationException("Stage textfile '" + Profile.Filepath + "' is missing 'Camera' section");
            }
            if (playerinfosection == null)
            {
                throw new InvalidOperationException("Stage textfile '" + Profile.Filepath + "' is missing 'PlayerInfo' section");
            }
            if (boundsection == null)
            {
                throw new InvalidOperationException("Stage textfile '" + Profile.Filepath + "' is missing 'Bound' section");
            }
            if (stageinfosection == null)
            {
                throw new InvalidOperationException("Stage textfile '" + Profile.Filepath + "' is missing 'StageInfo' section");
            }
            if (shadowsection == null)
            {
                throw new InvalidOperationException("Stage textfile '" + Profile.Filepath + "' is missing 'Shadow' section");
            }
            //if (reflectionsection == null) throw new InvalidOperationException("Stage textfile '" + Profile.Filepath + "' is missing 'Reflection' section");
            if (musicsection == null)
            {
                throw new InvalidOperationException("Stage textfile '" + Profile.Filepath + "' is missing 'Music' section");
            }
            if (bgdefsection == null)
            {
                throw new InvalidOperationException("Stage textfile '" + Profile.Filepath + "' is missing 'BGDef' section");
            }

            m_name = infosection.GetAttribute <string>("name");

            m_camerastartlocation.X = camerasection.GetAttribute <int>("startx");
            m_camerastartlocation.Y = camerasection.GetAttribute <int>("starty");
            m_camerabounds          = BuildBoundsRect(camerasection, "boundleft", "boundright", "boundhigh", "boundlow");
            m_floortension          = camerasection.GetAttribute("floortension", 0);
            m_tension        = camerasection.GetAttribute <int>("tension");
            m_verticalfollow = camerasection.GetAttribute <float>("verticalfollow");

            m_p1start.X    = playerinfosection.GetAttribute <float>("p1startx");
            m_p1start.Y    = playerinfosection.GetAttribute <float>("p1starty");
            m_p1facing     = playerinfosection.GetAttribute <Facing>("p1facing");
            m_p2start.X    = playerinfosection.GetAttribute <float>("p2startx");
            m_p2start.Y    = playerinfosection.GetAttribute <float>("p2starty");
            m_p2facing     = playerinfosection.GetAttribute <Facing>("p2facing");
            m_p3start.X    = playerinfosection.GetAttribute("p3startx", m_p1start.X);
            m_p3start.Y    = playerinfosection.GetAttribute("p3starty", m_p1start.Y);
            m_p3facing     = playerinfosection.GetAttribute("p3facing", m_p1facing);
            m_p4start.X    = playerinfosection.GetAttribute("p4startx", m_p2start.X);
            m_p4start.Y    = playerinfosection.GetAttribute("p4starty", m_p2start.Y);
            m_p4facing     = playerinfosection.GetAttribute("p4facing", m_p2facing);
            m_playerbounds = BuildBoundsRect(playerinfosection, "leftbound", "rightbound", "topbound", "botbound");

            m_screenleft  = boundsection.GetAttribute <int>("screenleft");
            m_screenright = boundsection.GetAttribute <int>("screenright");

            m_zoffset     = stageinfosection.GetAttribute <int>("zoffset");
            m_zoffsetlink = stageinfosection.GetAttribute <int?>("zoffsetlink", null);
            m_autoturn    = stageinfosection.GetAttribute <bool>("autoturn");
            m_resetbg     = stageinfosection.GetAttribute <bool>("resetBG");

            m_shadowintensity = stageinfosection.GetAttribute <byte>("intensity", 128);
            m_shadowcolor     = stageinfosection.GetAttribute("color", Color.TransparentBlack);
            m_shadowscale     = stageinfosection.GetAttribute("yscale", 0.4f);
            m_shadowfade      = stageinfosection.GetAttribute <Point?>("fade.range", null);

            if (reflectionsection != null)
            {
                m_shadowreflection = reflectionsection.GetAttribute("reflect", false);
            }
            else
            {
                m_shadowreflection = false;
            }

            m_musicfile    = musicsection.GetAttribute("bgmusic", string.Empty);
            m_volumeoffset = musicsection.GetAttribute("bgvolume", 0);

            m_spritefile = bgdefsection.GetAttribute <string>("spr");
            m_debug      = bgdefsection.GetAttribute("debugbg", false);

            if (Engine.GetSubSystem <FileSystem>().DoesFileExist(m_spritefile) == false)
            {
                m_spritefile = Engine.GetSubSystem <FileSystem>().CombinePaths("stages", m_spritefile);
            }

            var spritemanager    = Engine.GetSubSystem <Drawing.SpriteSystem>().CreateManager(SpritePath);
            var animationmanager = Engine.GetSubSystem <Animations.AnimationSystem>().CreateManager(Profile.Filepath);

            m_backgrounds = new Backgrounds.Collection(spritemanager, animationmanager);

            foreach (var textsection in textfile)
            {
                if (s_bgtitleregex.Match(textsection.Title).Success)
                {
                    m_backgrounds.CreateBackground(textsection);
                }
            }

            Reset();
        }
コード例 #30
0
		public EnvironmentShake(FightEngine engine)
			: base(engine)
		{
		}
コード例 #31
0
ファイル: EngineObject.cs プロジェクト: lodossDev/xnamugen
		protected EngineObject(FightEngine engine)
		{
			if (engine == null) throw new ArgumentNullException("fightengine");

			m_engine = engine;
		}
コード例 #32
0
ファイル: Stage.cs プロジェクト: lodossDev/xnamugen
		public Stage(FightEngine engine, StageProfile profile)
			: base(engine)
		{
			if (profile == null) throw new ArgumentNullException("profile");

			m_profile = profile;
			m_camerastartlocation = new Point(0, 0);
			m_p1start = new Vector2(0, 0);
			m_p2start = new Vector2(0, 0);
			m_palettefx = new PaletteFx();

			TextFile textfile = Engine.GetSubSystem<IO.FileSystem>().OpenTextFile(Profile.Filepath);
			TextSection infosection = textfile.GetSection("Info");
			TextSection camerasection = textfile.GetSection("Camera");
			TextSection playerinfosection = textfile.GetSection("PlayerInfo");
			TextSection boundsection = textfile.GetSection("Bound");
			TextSection stageinfosection = textfile.GetSection("StageInfo");
			TextSection shadowsection = textfile.GetSection("Shadow");
			TextSection reflectionsection = textfile.GetSection("Reflection");
			TextSection musicsection = textfile.GetSection("Music");
			TextSection bgdefsection = textfile.GetSection("BGDef");

			if (infosection == null) throw new InvalidOperationException("Stage textfile '" + Profile.Filepath + "' is missing 'Info' section");
			if (camerasection == null) throw new InvalidOperationException("Stage textfile '" + Profile.Filepath + "' is missing 'Camera' section");
			if (playerinfosection == null) throw new InvalidOperationException("Stage textfile '" + Profile.Filepath + "' is missing 'PlayerInfo' section");
			if (boundsection == null) throw new InvalidOperationException("Stage textfile '" + Profile.Filepath + "' is missing 'Bound' section");
			if (stageinfosection == null) throw new InvalidOperationException("Stage textfile '" + Profile.Filepath + "' is missing 'StageInfo' section");
			if (shadowsection == null) throw new InvalidOperationException("Stage textfile '" + Profile.Filepath + "' is missing 'Shadow' section");
			//if (reflectionsection == null) throw new InvalidOperationException("Stage textfile '" + Profile.Filepath + "' is missing 'Reflection' section");
			if (musicsection == null) throw new InvalidOperationException("Stage textfile '" + Profile.Filepath + "' is missing 'Music' section");
			if (bgdefsection == null) throw new InvalidOperationException("Stage textfile '" + Profile.Filepath + "' is missing 'BGDef' section");

			m_name = infosection.GetAttribute<String>("name");

			m_camerastartlocation.X = camerasection.GetAttribute<Int32>("startx");
			m_camerastartlocation.Y = camerasection.GetAttribute<Int32>("starty");
			m_camerabounds = BuildBoundsRect(camerasection, "boundleft", "boundright", "boundhigh", "boundlow");
			m_floortension = camerasection.GetAttribute<Int32>("floortension", 0);
			m_tension = camerasection.GetAttribute<Int32>("tension");
			m_verticalfollow = camerasection.GetAttribute<Single>("verticalfollow");

			m_p1start.X = playerinfosection.GetAttribute<Single>("p1startx");
			m_p1start.Y = playerinfosection.GetAttribute<Single>("p1starty");
			m_p1facing = playerinfosection.GetAttribute<Facing>("p1facing");
			m_p2start.X = playerinfosection.GetAttribute<Single>("p2startx");
			m_p2start.Y = playerinfosection.GetAttribute<Single>("p2starty");
			m_p2facing = playerinfosection.GetAttribute<Facing>("p2facing");
			m_playerbounds = BuildBoundsRect(playerinfosection, "leftbound", "rightbound", "topbound", "botbound");

			m_screenleft = boundsection.GetAttribute<Int32>("screenleft");
			m_screenright = boundsection.GetAttribute<Int32>("screenright");

			m_zoffset = stageinfosection.GetAttribute<Int32>("zoffset");
			m_zoffsetlink = stageinfosection.GetAttribute<Int32?>("zoffsetlink", null);
			m_autoturn = stageinfosection.GetAttribute<Boolean>("autoturn");
			m_resetbg = stageinfosection.GetAttribute<Boolean>("resetBG");

			m_shadowintensity = stageinfosection.GetAttribute<Byte>("intensity", 128);
			m_shadowcolor = stageinfosection.GetAttribute<Color>("color", Color.TransparentBlack);
			m_shadowscale = stageinfosection.GetAttribute<Single>("yscale", 0.4f);
			m_shadowfade = stageinfosection.GetAttribute<Point?>("fade.range", null);

			if (reflectionsection != null)
			{
				m_shadowreflection = reflectionsection.GetAttribute<Boolean>("reflect", false);
			}
			else
			{
				m_shadowreflection = false;
			}

			m_musicfile = musicsection.GetAttribute<String>("bgmusic", String.Empty);
			m_volumeoffset = musicsection.GetAttribute<Int32>("bgvolume", 0);

			m_spritefile = bgdefsection.GetAttribute<String>("spr");
			m_debug = bgdefsection.GetAttribute<Boolean>("debugbg", false);

			if (Engine.GetSubSystem<IO.FileSystem>().DoesFileExist(m_spritefile) == false)
			{
				m_spritefile = Engine.GetSubSystem<IO.FileSystem>().CombinePaths("stages", m_spritefile);
			}

			Drawing.SpriteManager spritemanager = Engine.GetSubSystem<Drawing.SpriteSystem>().CreateManager(SpritePath);
			Animations.AnimationManager animationmanager = Engine.GetSubSystem<Animations.AnimationSystem>().CreateManager(Profile.Filepath);
			m_backgrounds = new Backgrounds.Collection(spritemanager, animationmanager);

			foreach (TextSection textsection in textfile)
			{
				if (s_bgtitleregex.Match(textsection.Title).Success == true)
				{
					m_backgrounds.CreateBackground(textsection);
				}
			}

			Reset();
		}
コード例 #33
0
 public Camera(FightEngine fightengine)
     : base(fightengine)
 {
     m_bounds   = new BoundsRect(0, 0, 0, 0);
     m_location = new Point(0, 0);
 }
コード例 #34
0
ファイル: Camera.cs プロジェクト: lodossDev/xnamugen
		public Camera(FightEngine fightengine)
			: base(fightengine)
		{
			m_bounds = new BoundsRect(0, 0, 0, 0);
			m_location = new Point(0, 0);
		}