# Maximum (Real)

Grammar — Max(value1, value2)
FlagsNative | Function

Returns the highest of the two real values specified.

# Arguments

  • fixed — Value 1
  • fixed — Value 2

Returns — fixed

native fixed MaxF(fixed x1, fixed x2);

Category: Math / Conditionals

# Examples

# campaigns/liberty.sc2campaign

MapScript.galaxy

// L1177
MaxF(gf_ConvertShooterXToMapX(5.0), MinF(gf_ConvertShooterXToMapX(15.0), lv_xNew))
// L2985
MaxF(lv_xLeft, MinF(lv_xRight, PointGetX(lv_center)))
// L2986
MaxF(lv_yBottom, MinF(lv_yTop, PointGetY(lv_center)))
// L4423
MaxF((lv_wavePeriod - 150.0), 0.0)
// L4479
MaxF((lv_wavePeriod - 150.0), 0.0)
// L7075
MaxF(UnitGetPropertyFixed(gv_tHEONEBROODMOTHER, c_unitPropLife, c_unitPropCurrent), (gv_queenHP * 0.75))
// L7169
MaxF(UnitGetPropertyFixed(gv_tHEONEBROODMOTHER, c_unitPropLife, c_unitPropCurrent), (gv_queenHP * 0.5))
// L7219
MaxF(UnitGetPropertyFixed(gv_tHEONEBROODMOTHER, c_unitPropLife, c_unitPropCurrent), (gv_queenHP * 0.35))
// L1177
MaxF(gf_ConvertShooterXToMapX(5.0), MinF(gf_ConvertShooterXToMapX(15.0), lv_xNew))
// L2985
MaxF(lv_xLeft, MinF(lv_xRight, PointGetX(lv_center)))
// L2986
MaxF(lv_yBottom, MinF(lv_yTop, PointGetY(lv_center)))
// L4423
MaxF((lv_wavePeriod - 150.0), 0.0)
// L4479
MaxF((lv_wavePeriod - 150.0), 0.0)
// L7075
MaxF(UnitGetPropertyFixed(gv_tHEONEBROODMOTHER, c_unitPropLife, c_unitPropCurrent), (gv_queenHP * 0.75))
// L7169
MaxF(UnitGetPropertyFixed(gv_tHEONEBROODMOTHER, c_unitPropLife, c_unitPropCurrent), (gv_queenHP * 0.5))
// L7219
MaxF(UnitGetPropertyFixed(gv_tHEONEBROODMOTHER, c_unitPropLife, c_unitPropCurrent), (gv_queenHP * 0.35))

# campaigns/libertystory.sc2campaign

CampaignLib.galaxy

// L1682
MaxF((lv_ret - lv_gap), 0.0)
// L11790
MaxF(lv_waitDuration, 0.0)
// L11922
MaxF(lv_waitDuration, 0.0)

# campaigns/swarm.sc2campaign

MapScript.galaxy

// L4409
MaxF((lv_life - 0.5), 0.0)
// L4409
MaxF((lv_life - 0.5), 0.0)

# campaigns/swarmstory.sc2campaign

SwarmCampaignLib.galaxy

// L4489
MaxF(PlayerGetPropertyFixed(lp_player, c_playerPropDamageDealtTime), PlayerGetPropertyFixed(lp_player, c_playerPropDamageTakenTime))

# campaigns/voidstory.sc2campaign

VoidCampaignMissionLib.galaxy

// L2538
MaxF(PlayerGetPropertyFixed(lp_player, c_playerPropDamageDealtTime), PlayerGetPropertyFixed(lp_player, c_playerPropDamageTakenTime))
// L4838
MaxF((1-(lv_distance/50)), 0.0)

# mods/core.sc2mod

NativeLib.galaxy

// L2042
MaxF(lp_duration, 1.5)
// L2089
MaxF(lp_duration, 1.5)
// L1732
MaxF(lp_duration, 1.5)
// L1779
MaxF(lp_duration, 1.5)

# mods/heroesbrawlmods/brawlmapmods/coop/deadmansstand.stormmod

LibPEB1.galaxy

// L12163
MaxF(0.0, libUIUI_gf_HeroesGameTime())

# mods/heroesbrawlmods/brawlmapmods/lunarfestival.stormmod

LibLNYF.galaxy

// L1511
MaxF((libLNYF_gv_movement.lv_speed[autoE34AC8EB_var] - 1.0), 4.0)
// L1512
MaxF((libLNYF_gv_movement.lv_speed[autoE34AC8EB_var] - 1.0), 4.0)
// L1513
MaxF((libLNYF_gv_movement.lv_speed[autoE34AC8EB_var] - 1.0), 4.0)

# mods/heroesdata.stormmod

AILib.galaxy

// L2245
MaxF(libAIAI_gv_aIGateNearbyRange, (lv_offsetFromEdge + (0.5 * lv_originalDistance)))

# mods/heroesdata.stormmod

GameDataHelperLib.galaxy

// L25961
MaxF(lv_newCooldownAmount, 0.1)

# mods/heroesdata.stormmod

GameLib.galaxy

// L6662
MaxF((lp_initialRespawnTime - libGame_gv_heroDeathRespawnCueSoundTiming), 0.0625)
// L6803
MaxF((lp_newRespawnTimerDuration - libGame_gv_heroDeathRespawnCueSoundTiming), 0.0625)

# mods/heroesdata.stormmod

HeroesLib.galaxy

// L1707
MaxF(7.0, (lv_deathTime / 2.0))
// L1710
MaxF(7.0, (lv_deathTime / 2.0))

# mods/heroesdata.stormmod

StartingExperienceLib.galaxy

// L444
MaxF(PlayerGetPropertyFixed(lp_player, c_playerPropDamageTakenTime), PlayerGetPropertyFixed(lp_player, c_playerPropDamageDealtTime))

# mods/heroesdata.stormmod

SupportLib.galaxy

// L8131
MaxF((TimerGetRemaining(libGame_gv_jungleWatchTowerStartTimer)-lv_requestedTimeChange*60), 0.0625)
// L8136
MaxF((TimerGetRemaining(libGame_gv_xPTrickleStartTimer)-lv_requestedTimeChange*60), 0.0625)

# mods/heroesmapmods/battlegroundmapmods/braxisholdout.stormmod

LibSCHO.galaxy

// L2946
MaxF(libSCHO_gv_mMHO_TotalZergHP[libGame_gv_teamOrderIndex_C], libSCHO_gv_mMHO_TotalZergHP[libGame_gv_teamChaosIndex_C])
// L2947
MaxF(libSCHO_gv_mMHO_TotalZergHP[libGame_gv_teamOrderIndex_C], libSCHO_gv_mMHO_TotalZergHP[libGame_gv_teamChaosIndex_C])

# mods/missionpacks/campaigncommon.sc2mod

LibCMMI.galaxy

// L91
MaxF(PlayerGetPropertyFixed(lp_player, c_playerPropDamageDealtTime), PlayerGetPropertyFixed(lp_player, c_playerPropDamageTakenTime))

# mods/novastoryassets.sc2mod

MapScript.galaxy

// L4485
MaxF((1-(lv_distance/50)), 0.0)
// L4485
MaxF((1-(lv_distance/50)), 0.0)

# mods/starcoop/starcoop.sc2mod

LibCOMI.galaxy

// L780
MaxF(0.0, 1.5)
// L1555
MaxF(0.5, UnitTypeGetProperty(UnitGetType(lv_indexGroundUnit), c_unitPropSuppliesUsed))
// L1896
MaxF(0.5, UnitTypeGetProperty(UnitGetType(lv_dropUnit), c_unitPropSuppliesUsed))
// L3756
MaxF(lp_thinkPeriod, 0.5)
// L5457
MaxF((lv_baseenergyregen + (libCOMI_gv_cM_Mengsk_EnergyRegenRoyalGuard + libCOMI_gv_cM_Mengsk_EnergyRegenTrooper)), 0.01)
// L6520
MaxF(lv_cooldownTime, 10.0)
// L9168
MaxF(PlayerGetPropertyFixed(lp_player, c_playerPropDamageDealtTime), PlayerGetPropertyFixed(lp_player, c_playerPropDamageTakenTime))
// L10356
MaxF(lv_minimumrevivedelay, TimerGetRemaining(lv_remindertimer))
// L22104
MaxF(Round((lv_xp / lv_veterancount)), lv_minimumearnedxp)
// L25255
MaxF((1-(lv_distance/50)), 0.0)

# mods/starcoop/starcoop.sc2mod

LibCOMU.galaxy

// L5069
MaxF(lv_remainingpercentage, 0.0)
// L12907
MaxF(libCOMU_gv_cT_SharedSupplyIndividual[lv_indexPlayer], 1.0)

# mods/starcoop/starcoop.sc2mod

LibCOUI.galaxy

// L5986
MaxF(libNtve_gf_WidthOfRegion(RegionPlayableMap()), libNtve_gf_HeightOfRegion(RegionPlayableMap()))

# mods/voidprologue.sc2mod

LibA3DDD02B.galaxy

// L3382
MaxF(PlayerGetPropertyFixed(lp_player, c_playerPropDamageDealtTime), PlayerGetPropertyFixed(lp_player, c_playerPropDamageTakenTime))

# mods/warcoop/warclassicsystem.sc2mod

WarClassicSystem.galaxy

// L39
MaxF(UserDataGetFixed("MiscData", "Misc", "Creep - Max Camp Radius", 1), 0.0625)