예제 #1
0
 public void Clear()
 {
     this.state = null;
     this.tics  = 0;
     this.sx    = Fixed.Zero;
     this.sy    = Fixed.Zero;
 }
예제 #2
0
파일: Mobj.cs 프로젝트: MSylvia/DoomEngine
        public bool SetState(MobjState state)
        {
            do
            {
                if (state == MobjState.Null)
                {
                    this.state = DoomInfo.States[(int)MobjState.Null];
                    this.world.ThingAllocation.RemoveMobj(this);

                    return(false);
                }

                var st = DoomInfo.States[(int)state];
                this.state  = st;
                this.tics   = this.GetTics(st);
                this.sprite = st.Sprite;
                this.frame  = st.Frame;

                // Modified handling.
                // Call action functions when the state is set.
                if (st.MobjAction != null)
                {
                    st.MobjAction(this.world, this);
                }

                state = st.Next;
            }while (this.tics == 0);

            return(true);
        }
예제 #3
0
파일: Mobj.cs 프로젝트: MSylvia/DoomEngine
        private int GetTics(MobjStateDef state)
        {
            var options = this.world.Options;

            if (options.FastMonsters || options.Skill == GameSkill.Nightmare)
            {
                if ((int)MobjState.SargRun1 <= state.Number && state.Number <= (int)MobjState.SargPain2)
                {
                    return(state.Tics >> 1);
                }
                else
                {
                    return(state.Tics);
                }
            }
            else
            {
                return(state.Tics);
            }
        }