示例#1
0
 public TasDataStruct(uint?globalTimer = null)
 {
     GlobalTimer      = globalTimer ?? Config.Stream.GetUInt32(MiscConfig.GlobalTimerAddress);
     MarioFacingAngle = Config.Stream.GetUInt16(MarioConfig.StructAddress + MarioConfig.FacingYawOffset);
     MarioIntendAngle = Config.Stream.GetUInt16(MarioConfig.StructAddress + MarioConfig.IntendedYawOffset);
     DAngle           = WatchVariableSpecialUtilities.GetDeltaYawIntendedFacing();
     CameraAngle      = Config.Stream.GetUInt16(CameraConfig.StructAddress + CameraConfig.CentripetalAngleOffset);
     BufferedXInput   = Config.Stream.GetSByte(InputConfig.BufferedInputAddress + InputConfig.ControlStickXOffset);
     BufferedYInput   = Config.Stream.GetSByte(InputConfig.BufferedInputAddress + InputConfig.ControlStickYOffset);
     CurrentXInput    = Config.Stream.GetSByte(InputConfig.CurrentInputAddress + InputConfig.ControlStickXOffset);
     CurrentYInput    = Config.Stream.GetSByte(InputConfig.CurrentInputAddress + InputConfig.ControlStickYOffset);
 }
示例#2
0
        public static (string, Func <string>) CreateGetterFunction(string specialType)
        {
            string        name           = DEFAULT_NAME;
            Func <string> getterFunction = DEFAULT_GETTER;

            switch (specialType)
            {
            case "RngIndex":
                name           = "Index " + VarHackConfig.EscapeChar;
                getterFunction = () =>
                {
                    return(RngIndexer.GetRngIndex().ToString());
                };
                break;

            case "FloorYNorm":
                name           = "YNorm " + VarHackConfig.EscapeChar;
                getterFunction = () =>
                {
                    uint  triFloorAddress = Config.Stream.GetUInt(MarioConfig.StructAddress + MarioConfig.FloorTriangleOffset);
                    float yNorm           = Config.Stream.GetFloat(triFloorAddress + TriangleOffsetsConfig.NormY);
                    return(FormatDouble(yNorm, 4, true));
                };
                break;

            case "DefactoSpeed":
                name           = "Defacto " + VarHackConfig.EscapeChar;
                getterFunction = () =>
                {
                    return(FormatInteger(WatchVariableSpecialUtilities.GetMarioDeFactoSpeed()));
                };
                break;

            case "SlidingSpeed":
                name           = "Spd " + VarHackConfig.EscapeChar;
                getterFunction = () =>
                {
                    return(FormatInteger(WatchVariableSpecialUtilities.GetMarioSlidingSpeed()));
                };
                break;

            case "MarioAction":
                name           = "Action " + VarHackConfig.EscapeChar;
                getterFunction = () =>
                {
                    return(TableConfig.MarioActions.GetActionName());
                };
                break;

            case "MarioAnimation":
                name           = "Animation " + VarHackConfig.EscapeChar;
                getterFunction = () =>
                {
                    return(TableConfig.MarioAnimations.GetAnimationName());
                };
                break;

            case "DYawIntendFacing":
                name           = "DYaw " + VarHackConfig.EscapeChar;
                getterFunction = () =>
                {
                    return(FormatInteger(WatchVariableSpecialUtilities.GetDeltaYawIntendedFacing()));
                };
                break;

            case "DYawIntendFacingHau":
                name           = "DYaw " + VarHackConfig.EscapeChar;
                getterFunction = () =>
                {
                    return(FormatInteger(WatchVariableSpecialUtilities.GetDeltaYawIntendedFacing() / 16));
                };
                break;

            default:
                break;
            }

            return(name, getterFunction);
        }