@@ -96,19 +96,14 @@ internal static void OptimizeITOPOD()
96
96
if ( Main . Character . adventure . zone < 1000 ) return ;
97
97
var controller = Main . Character . adventureController ;
98
98
var level = controller . itopodLevel ;
99
+ var highestOpen = Main . Character . adventure . highestItopodLevel ;
99
100
var optimal = CalculateBestItopodLevel ( ) ;
100
- if ( level == optimal ) return ;
101
101
controller . itopodStartInput . text = optimal . ToString ( ) ;
102
- if ( optimal == Main . Character . adventure . highestItopodLevel - 1 )
103
- {
104
- optimal = Main . Character . adventureController . maxItopodLevel ( ) ;
105
- Main . Log ( "Highest ITOPOD floor is hit so setting climb mode" ) ;
106
- }
107
-
108
102
controller . itopodEndInput . text = optimal . ToString ( ) ;
109
103
controller . verifyItopodInputs ( ) ;
104
+ if ( level == optimal ) return ; // we are on optimal floor
105
+ if ( level < optimal && level >= highestOpen - 1 ) return ; // we are climbing
110
106
controller . zoneSelector . changeZone ( 1000 ) ;
111
- //controller.log.AddEvent($"The CHEATER Floor Shifter changed your current floor from {level} to {optimal}");
112
107
}
113
108
114
109
internal static int CalculateBestItopodLevel ( )
@@ -120,8 +115,9 @@ internal static int CalculateBestItopodLevel()
120
115
var num2 = Convert . ToInt32 ( Math . Floor ( Math . Log ( num1 , 1.05 ) ) ) ;
121
116
if ( num2 < 1 )
122
117
return 1 ;
123
- if ( num2 >= c . adventure . highestItopodLevel )
124
- num2 = c . adventure . highestItopodLevel - 1 ;
118
+ var maxLevel = c . adventureController . maxItopodLevel ( ) ;
119
+ if ( num2 > maxLevel )
120
+ num2 = maxLevel ;
125
121
return num2 ;
126
122
}
127
123
}
0 commit comments