static CIEnumerable Transpiler(CIEnumerable cins) { int ld = 0; return(cins.ciInsert(ci => (ci.isOp(OpCodes.Ldarg_2) && ++ld == 2) || ci.isLDC(0.1f), +1, 2, CIUtils.speed, OpCodes.Mul)); }
static CIEnumerable Transpiler(CIEnumerable cins) => cins.ciInsert(ci => ci.isOp(OpCodes.Ldarg_S, (byte)5), CIUtils.speedClamped01, OpCodes.Mul);
static CIEnumerable Transpiler(CIEnumerable cins) => cins.ciInsert(ci => ci.isLDC(500f), CIUtils.speedClamped01, OpCodes.Div);
static CIEnumerable Transpiler(CIEnumerable cins) => cins.ciInsert(ci => ci.isLDC(100f), CIUtils.speed, OpCodes.Mul, _codeForCfgVar(nameof(ModConfig.speedStillsuitWater)), OpCodes.Mul);
static CIEnumerable Transpiler(CIEnumerable cins) => #if GAME_SN cins.ciInsert(ci => ci.isOp(OpCodes.Call), CIUtils.speedClamped01, OpCodes.Mul);
static CIEnumerable Transpiler(CIEnumerable cins) => cins.ciInsert(ci => ci.isLDC(100f), +1, 2, CIUtils.speed, OpCodes.Mul, _codeForCfgVar(nameof(ModConfig.auxSpeedHungerThirst)), OpCodes.Mul);
// transpiler for correcting time if daynightspeed < 1 (with additional multiplier) static CIEnumerable transpiler_dnsClamped01(CIEnumerable cins, string multCfgVarName) => cins.ciInsert(ci => ci.isOp(OpCodes.Callvirt, deltaTime) || ci.isOp(OpCodes.Callvirt, dayNightSpeed), +1, 0, CIUtils.speedClamped01, OpCodes.Div, CIHelper._codeForCfgVar(multCfgVarName), OpCodes.Mul);
static CIEnumerable Transpiler(CIEnumerable cins) => cins.ciInsert(ci => ci.isOp(OpCodes.Sub), CIUtils.speed, OpCodes.Div);
static CIEnumerable FiltrationMachine_Transpiler(CIEnumerable cins) => cins.ciInsert(ci => ci.isLDC(420f) || ci.isLDC(840f), +1, 0, _codeForCfgVar(nameof(ModConfig.speedFiltrationMachine)), OpCodes.Div);
static CIEnumerable Eatable_GetFoodWaterValue_Transpiler(CIEnumerable cins) => cins.ciInsert(ci => ci.isOp(OpCodes.Mul), _codeForCfgVar(nameof(ModConfig.speedFoodDecay)), OpCodes.Mul);
static CIEnumerable GrowingPlant_GetGrowthDuration_Transpiler(CIEnumerable cins) => cins.ciInsert(ci => ci.isLDC(1f), _codeForCfgVar(nameof(ModConfig.speedPlantsGrow)), OpCodes.Div);
static CIEnumerable WaterParkCreature_Transpiler(CIEnumerable cins) { string growingPeriod = $"{(Mod.Consts.isGameSN? "": "get_")}growingPeriod"; return(cins.ciInsert(new MemberMatch(growingPeriod), +1, 0, _codeForCfgVar(nameof(ModConfig.speedCreaturesGrow)), OpCodes.Div)); }
static CIEnumerable Transpiler(CIEnumerable cins) => cins.ciInsert(ci => ci.isLDC(1f), _codeForCfgVar(nameof(ModConfig.speedEggsHatching)), OpCodes.Div);