Example #1
0
		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);
		}
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 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;
        }
Example #4
0
        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);
        }