public void Clear() { this.state = null; this.tics = 0; this.sx = Fixed.Zero; this.sy = Fixed.Zero; }
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); }
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); } }