示例#1
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);
		}
示例#2
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);
		}
示例#3
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);
        }
示例#4
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);
        }