# Minimum (Real)

Grammar — Min(value1, value2)
FlagsNative | Function

Returns the lowest of the two real values specified.

# Arguments

  • fixed — Value 1
  • fixed — Value 2

Returns — fixed

native fixed MinF(fixed x1, fixed x2);

Category: Math / Conditionals

# Examples

# campaigns/liberty.sc2campaign

MapScript.galaxy

// L1177
MinF(gf_ConvertShooterXToMapX(15.0), lv_xNew)
// L2985
MinF(lv_xRight, PointGetX(lv_center))
// L2986
MinF(lv_yTop, PointGetY(lv_center))
// L32158
MinF((6.33 - (1.0 + 0.2 + 0.25 + 0.75 + 4.0)), (SoundLengthSync(SoundLink("TTychus05BriefingTychus00010", 0)) - (0.25 + 0.75 + 4.0)))
// L484
MinF(TimerGetRemaining(lv_cooldownTimer), lv_mutaSpawnPeriod)
// L1177
MinF(gf_ConvertShooterXToMapX(15.0), lv_xNew)
// L2985
MinF(lv_xRight, PointGetX(lv_center))
// L2986
MinF(lv_yTop, PointGetY(lv_center))
// L32158
MinF((6.33 - (1.0 + 0.2 + 0.25 + 0.75 + 4.0)), (SoundLengthSync(SoundLink("TTychus05BriefingTychus00010", 0)) - (0.25 + 0.75 + 4.0)))
// L484
MinF(TimerGetRemaining(lv_cooldownTimer), lv_mutaSpawnPeriod)
// L2242
MinF(0.5, (DistanceBetweenPoints(CameraGetTarget(gv_pLAYER_01_USER), lv_target) * 0.5))
// L4376
MinF(0.5, (DistanceBetweenPoints(CameraGetTarget(gv_pLAYER_01_USER), lv_target) * 0.5))
// L5368
MinF(gv_lowestLockDownTime, TimerGetRemaining(gv_s2_LockdownTimer))
// L6066
MinF(gv_lowestLockDownTime, TimerGetRemaining(gv_s2_LockdownTimer))
// L7137
MinF(gv_lowestLockDownTime, TimerGetRemaining(gv_s2_LockdownTimer))
// L2327
MinF(2.0, (DistanceBetweenPoints(PointFromId(515), UnitGetPosition(gv_hyperion)) / 1.0))
// L2242
MinF(0.5, (DistanceBetweenPoints(CameraGetTarget(gv_pLAYER_01_USER), lv_target) * 0.5))
// L4376
MinF(0.5, (DistanceBetweenPoints(CameraGetTarget(gv_pLAYER_01_USER), lv_target) * 0.5))
// L5368
MinF(gv_lowestLockDownTime, TimerGetRemaining(gv_s2_LockdownTimer))
// L6066
MinF(gv_lowestLockDownTime, TimerGetRemaining(gv_s2_LockdownTimer))
// L7137
MinF(gv_lowestLockDownTime, TimerGetRemaining(gv_s2_LockdownTimer))
// L2327
MinF(2.0, (DistanceBetweenPoints(PointFromId(515), UnitGetPosition(gv_hyperion)) / 1.0))

# campaigns/swarmstory.sc2campaign

SwarmCampaignLib.galaxy

// L16911
MinF(lv_indexTimes, 3.0)
// L21486
MinF((lv_maxTotalDuration/lv_levelUpCount), lv_levelDuration)

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

LibPVEB.galaxy

// L2471
MinF(lv_newBehaviorTime, UnitBehaviorDuration(lv_itUnit, "PVEResurrectCastTracking"))

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

LibPVEM.galaxy

// L2028
MinF(lv_newBehaviorTime, UnitBehaviorDuration(lv_itUnit, "DeadHeroResurrectCastTrackingBehavior"))

# mods/heroesbrawlmods/brawlmapmods/lunarfestival.stormmod

LibLNYF.galaxy

// L1541
MinF((libLNYF_gv_movement.lv_speed[autoE34AC8EB_var] + 1.0), lv_maxSpeed)
// L1542
MinF((libLNYF_gv_movement.lv_speed[autoE34AC8EB_var] + 1.0), lv_maxSpeed)
// L1545
MinF((libLNYF_gv_movement.lv_speed[autoE34AC8EB_var] + 0.5), lv_maxSpeed)
// L1546
MinF((libLNYF_gv_movement.lv_speed[autoE34AC8EB_var] + 0.5), lv_maxSpeed)

# mods/heroesdata.stormmod

AILib.galaxy

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

# mods/heroesdata.stormmod

GameLib.galaxy

// L1481
MinF(lv_percentReduction, 0.9)
// L6108
MinF(libCore_gv_bALDeathTimes[lv_itLevel], libCore_gv_sYSDeathTimerCap)
// L11210
MinF(TimerGetElapsed(libGame_gv_matchGameplayTimer), (libCore_gv_dataXPBrawlMetaXPMaximumDuration * 60.0))
// L11211
MinF(TimerGetElapsed(libGame_gv_matchGameplayTimer), (libCore_gv_dataXPBrawlMetaXPExpectedDuration * 60.0))
// L17432
MinF((lv_currentDeathTime - lv_spiritOfRedemptionLowDeathTimeAdjustment_C), lv_spiritOfRedemptionBuffDuration)

# mods/heroesdata.stormmod

HeroesLib.galaxy

// L1699
MinF(lv_deathTime, libCore_gv_sYSDeathTimerCap)
// L1707
MinF(MaxF(7.0, (lv_deathTime / 2.0)), 15.0)
// L1710
MinF(MaxF(7.0, (lv_deathTime / 2.0)), 20.0)
// L1713
MinF(lv_deathTime, 30.0)
// L1716
MinF(lv_deathTime, 15.0)

# mods/heroesmapmods/battlegroundmapmods/volskayasound.stormmod

LibVLSS.galaxy

// L48
MinF(libVLSK_gf_CapturingProgressOfTeam(lp_team, lp_capturePointIndex), (libVLSK_gv_capturePointContestTimeGoal_C / 2.0))

# mods/heromods/genji.stormmod

LibHGen.galaxy

// L102
MinF((PlayerScoreValueGetAsFixed(lp_genjiPlayer, libHGen_gv_heroGenjiDeflectDragonClawDamageAbsorbedScore) + lp_incomingDamage), lv_damageThreshold)
// L556
MinF(lv_duration, 8.0)

# mods/heromods/guldan.stormmod

LibHGUL.galaxy

// L222
MinF(libHGUL_gv_heroGuldanDarknessWithinDamageTracker[EventUnitDamageSourcePlayer()], CatalogFieldValueGetAsFixed(c_gameCatalogEffect, "GuldanLifeTapDarknessWithinDamageThreshold", "Amount", EventUnitDamageSourcePlayer()))

# mods/heromods/imperius.stormmod

LibHIMP.galaxy

// L129
MinF(AbsF((lv_imperiusUnitFacing360 - lv_relativeAngle360)), AbsF(((lv_imperiusUnitFacing360 + lv_relativeAngle360) - 360.0)))

# mods/starcoop/starcoop.sc2mod

LibCOMI.galaxy

// L3924
MinF(lv_lastseenhealth, lp_maxHealth)
// L5015
MinF(lv_factionMaxStacks, lv_factionScore)
// L6519
MinF((180.0 - lv_masteryTimeReduction), (lv_targetMissionTime - GameGetMissionTime()))
// L19537
MinF(lv_distance, lv_maxRange)

# mods/starcoop/starcoop.sc2mod

LibCOMU.galaxy

// L13597
MinF(lv_healRemaining, UnitGetCustomValue(lv_indexUnit, libCOMU_gv_cTC_TempDamageCustomIndex))
// L13598
MinF((UnitGetPropertyFixed(lv_indexUnit, c_unitPropLifeMax, c_unitPropCurrent) - UnitGetPropertyFixed(lv_indexUnit, c_unitPropLife, c_unitPropCurrent)), lv_healRemaining)
// L13604
MinF((UnitGetPropertyFixed(lv_indexUnit, c_unitPropShieldsMax, c_unitPropCurrent) - UnitGetPropertyFixed(lv_indexUnit, c_unitPropShields, c_unitPropCurrent)), lv_healRemaining)

# mods/warcoop/legends/jainaproudmoore.sc2mod

LibLJai.galaxy

// L73
MinF((UnitBehaviorCount(lv_jaina, "AttInt")*0.04), 1.4)