def getDmgReduction(self, envDmg=True): ret = 1.0 sm = self.smbm hasVaria = sm.haveItem('Varia') hasGrav = sm.haveItem('Gravity') items = [] if RomPatches.has(RomPatches.NoGravityEnvProtection): if hasVaria: items = ['Varia'] if envDmg: ret = 4.0 else: ret = 2.0 if hasGrav and not envDmg: ret = 4.0 items = ['Gravity'] elif RomPatches.has(RomPatches.ProgressiveSuits): if hasVaria: items.append('Varia') ret *= 2 if hasGrav: items.append('Gravity') ret *= 2 else: if hasVaria: ret = 2.0 items = ['Varia'] if hasGrav: ret = 4.0 items = ['Gravity'] return (ret, items)
def enoughMajors(self, smbm, majorLocations): # the end condition if self.itemsPickup == 'all': return len(majorLocations) == 0 elif self.itemsPickup == 'any': return True elif self.itemsPickup == 'minimal': canResistRainbow = ((smbm.haveItemCount('ETank', 3) and smbm.haveItem('Varia')) or smbm.haveItemCount('ETank', 6) or RomPatches.has(RomPatches.NerfedRainbowBeam)) return (smbm.haveItem('Morph') # pass bomb block passages and (smbm.haveItem('Bomb') or smbm.haveItem('PowerBomb')) # mother brain rainbow attack and canResistRainbow # lower norfair access and (smbm.haveItem('Varia') or smbm.wand(smbm.wnot(RomPatches.has(RomPatches.NoGravityEnvProtection)), smbm.wnot(RomPatches.has(RomPatches.ProgressiveSuits)))) # gravity is checked below # speed or ice to access botwoon and (smbm.haveItem('SpeedBooster') or smbm.haveItem('Ice')) # draygon access and smbm.haveItem('Gravity') # all boss locs collected (draygon pickup is not on draygon location) and not any('Boss' in loc['Class'] for loc in majorLocations)) else: return False
def canAccessBillyMays(self): sm = self.smbm return sm.wand( sm.wor(RomPatches.has(RomPatches.BlueBrinstarBlueDoor), sm.canOpenRedDoors()), sm.canUsePowerBombs(), sm.wor(sm.knowsBillyMays(), sm.haveItem('Gravity'), sm.haveItem('SpaceJump')))
def enoughStuffTourian(self): sm = self.smbm ret = self.smbm.wand(sm.wor(RomPatches.has(RomPatches.TourianSpeedup), sm.wand(sm.canPassMetroids(), sm.canPassZebetites())), sm.enoughStuffsMotherbrain()) return ret
def canPassLowerNorfairChozo(self): sm = self.smbm # to require one more CF if no heat protection because of distance to cover, wait times, acid... return sm.wand( sm.canHellRun(**Settings.hellRunsTable['LowerNorfair'] ['Entrance -> GT via Chozo']), sm.canUsePowerBombs(), sm.wor(RomPatches.has(RomPatches.LNChozoSJCheckDisabled), sm.haveItem('SpaceJump')))
def canPassMoatReverse(self): sm = self.smbm return sm.wor( sm.haveItem('Grapple'), sm.haveItem('SpaceJump'), sm.haveItem('Gravity'), sm.wand( sm.haveItem('Morph'), sm.wor(RomPatches.has(RomPatches.MoatShotBlock), sm.canPassBombPassages())))
def canPassForgottenHighway(self, fromWs): sm = self.smbm suitless = sm.wand(sm.haveItem('HiJump'), sm.knowsGravLessLevel1()) if fromWs is True and RomPatches.has( RomPatches.EastOceanPlatforms).bool is False: suitless = sm.wand( suitless, # to break water line and go through the door on the right sm.haveItem('SpaceJump')) return sm.wand(sm.wor(sm.haveItem('Gravity'), suitless), sm.haveItem('Morph')) # for crab maze
def mbEtankCheck(self): sm = self.smbm if RomPatches.has(RomPatches.NerfedRainbowBeam): # "add" energy for difficulty calculations energy = 2.8 if sm.haveItem('Varia') else 2.6 return (True, energy) nTanks = sm.energyReserveCount() energyDiff = 0 if sm.haveItem('Varia') == False: # "remove" 3 etanks (accounting for rainbow beam damage without varia) if nTanks < 6: return (False, 0) energyDiff = -3 elif nTanks < 3: return (False, 0) return (True, energyDiff)
def canEnterCathedral(self, mult=1.0): sm = self.smbm return sm.wand( sm.canOpenRedDoors(), sm.wor( sm.wand( sm.canHellRun('MainUpperNorfair', mult), sm.wor( sm.wor( RomPatches.has( RomPatches.CathedralEntranceWallJump), sm.haveItem('HiJump'), sm.canFly()), sm.wor( sm.haveItem('SpeedBooster'), # spark sm.canSpringBallJump()))), sm.wand(sm.canHellRun('MainUpperNorfair', 0.5 * mult), sm.haveItem('Morph'), sm.knowsNovaBoost())))
def canHellRun(self, hellRun, mult=1.0, minE=2): sm = self.smbm items = [] isHeatProof = sm.heatProof() if isHeatProof == True: return isHeatProof if sm.wand(RomPatches.has(RomPatches.ProgressiveSuits), sm.haveItem('Gravity')).bool == True: # half heat protection mult *= 2.0 minE /= 2.0 items.append('Gravity') if self.energyReserveCount() >= minE: if hellRun != 'LowerNorfair': ret = self.energyReserveCountOkHellRun(hellRun, mult) if ret.bool == True: ret.items += items return ret else: tanks = self.energyReserveCount() multCF = mult if tanks >= 14: multCF *= 2.0 nCF = int(math.ceil(2/multCF)) ret = sm.wand(self.energyReserveCountOkHellRun(hellRun, mult), self.canCrystalFlash(nCF)) if ret.bool == True: if sm.haveItem('Gravity') == True: ret.difficulty *= 0.7 ret.items.append('Gravity') elif sm.haveItem('ScrewAttack') == True: ret.difficulty *= 0.7 ret.items.append('ScrewAttack') #nPB = self.smbm.itemCount('PowerBomb') #print("canHellRun LN. tanks=" + str(tanks) + ", nCF=" + str(nCF) + ", nPB=" + str(nPB) + ", mult=" + str(mult) + ", heatProof=" + str(isHeatProof.bool) + ", ret=" + str(ret)) return ret else: return SMBool(False)
def getPiratesPseudoScrewCoeff(self): ret = 1.0 if RomPatches.has(RomPatches.NerfedCharge).bool == True: ret = 4.0 return ret
def heatProof(self): sm = self.smbm return sm.wor(sm.haveItem('Varia'), sm.wand(sm.wnot(RomPatches.has(RomPatches.NoGravityEnvProtection)), sm.wnot(RomPatches.has(RomPatches.ProgressiveSuits)), sm.haveItem('Gravity')))
def canFireChargedShots(self): sm = self.smbm return sm.wor(sm.haveItem('Charge'), RomPatches.has(RomPatches.NerfedCharge))
def canClimbBottomRedTower(self): sm = self.smbm return sm.wor( sm.wor(RomPatches.has(RomPatches.RedTowerLeftPassage), sm.haveItem('HiJump'), sm.haveItem('Ice'), sm.canFly()), sm.canShortCharge())
def canPassRedTowerToMaridiaNode(self): sm = self.smbm return sm.wand(sm.haveItem('Morph'), RomPatches.has(RomPatches.AreaRandoGatesBase))
def canPassMaridiaToRedTowerNode(self): sm = self.smbm return sm.wand( sm.haveItem('Morph'), sm.wor(RomPatches.has(RomPatches.AreaRandoGatesBase), sm.canOpenGreenDoors()))