mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-25 14:00:18 +01:00
Runtime map now loads in ~11 seconds instead of ~40, sped up various other things (#19957)
Runtime map now has a bunch of new areas / items with often-tested stuffs, and some hard-to-put-at-runtime stuffs. Runtime map jobs now are positioned to make it faster to reach the aforementioned often-tested stuffs. Runtime map doesn't generate an overmap anymore by default, which speeds up the process. Runtime map now loads in ~11 seconds instead of ~40 seconds as it was before. Updated the maploader to be faster in parsing maps. Bapi is not engaged anymore if we're only measuring the map size, which speeds up the process. In fastboot we do not generate the codexes anymore, which speeds up the process. In fastboot and if exoplanets and away sites are not enabled, we do not parse the map templates anymore, which speeds up the process. Updated the icon smoothing to be faster. Optimized cargo area code. Other optimizations.
This commit is contained in:
@@ -94,7 +94,7 @@ Exercise Verbs
|
||||
stamina_loss += 2
|
||||
if(get_shock() > 10)
|
||||
stamina_loss += 3
|
||||
var/nut_factor = max_nutrition ? Clamp(nutrition / max_nutrition, 0, 1) : 1
|
||||
var/nut_factor = max_nutrition ? clamp(nutrition / max_nutrition, 0, 1) : 1
|
||||
if(nut_factor <= CREW_NUTRITION_HUNGRY)
|
||||
stamina_loss += 2
|
||||
if(on_knees)
|
||||
|
||||
@@ -1049,8 +1049,8 @@
|
||||
return
|
||||
timevomit = max(timevomit, 5)
|
||||
|
||||
timevomit = Clamp(timevomit, 1, 10)
|
||||
level = Clamp(level, 1, 3)
|
||||
timevomit = clamp(timevomit, 1, 10)
|
||||
level = clamp(level, 1, 3)
|
||||
|
||||
lastpuke = TRUE
|
||||
to_chat(src, SPAN_WARNING("You feel nauseous..."))
|
||||
|
||||
@@ -327,13 +327,13 @@
|
||||
if(M.stamina <= disarm_cost)
|
||||
to_chat(M, SPAN_DANGER("You're too tired to disarm someone!"))
|
||||
return FALSE
|
||||
M.stamina = Clamp(M.stamina - disarm_cost, 0, M.max_stamina) // attempting to knock something out of someone's hands, or pushing them over, is exhausting!
|
||||
M.stamina = clamp(M.stamina - disarm_cost, 0, M.max_stamina) // attempting to knock something out of someone's hands, or pushing them over, is exhausting!
|
||||
else if(M.max_stamina <= 0)
|
||||
disarm_cost = M.max_nutrition / 6
|
||||
if(M.nutrition <= disarm_cost)
|
||||
to_chat(M, SPAN_DANGER("You don't have enough power to disarm someone!"))
|
||||
return FALSE
|
||||
M.nutrition = Clamp(M.nutrition - disarm_cost, 0, M.max_nutrition)
|
||||
M.nutrition = clamp(M.nutrition - disarm_cost, 0, M.max_nutrition)
|
||||
|
||||
M.attack_log += "\[[time_stamp()]\] <span class='warning'>Disarmed [src.name] ([src.ckey])</span>"
|
||||
src.attack_log += "\[[time_stamp()]\] <font color='orange'>Has been disarmed by [M.name] ([M.ckey])</font>"
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
if(.) //We moved
|
||||
handle_leg_damage()
|
||||
|
||||
var/turf/T = loc
|
||||
var/turf/T = get_turf(loc)
|
||||
var/footsound
|
||||
var/top_layer = 0
|
||||
if(istype(T))
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
if(zone_exposure >= 1)
|
||||
return 1
|
||||
pressure_adjustment_coefficient = max(pressure_adjustment_coefficient, zone_exposure)
|
||||
pressure_adjustment_coefficient = Clamp(pressure_adjustment_coefficient, 0, 1) // So it isn't less than 0 or larger than 1.
|
||||
pressure_adjustment_coefficient = clamp(pressure_adjustment_coefficient, 0, 1) // So it isn't less than 0 or larger than 1.
|
||||
|
||||
return pressure_adjustment_coefficient
|
||||
|
||||
@@ -212,7 +212,7 @@
|
||||
if(gene.is_active(src))
|
||||
gene.OnMobLife(src)
|
||||
|
||||
total_radiation = Clamp(total_radiation,0,100)
|
||||
total_radiation = clamp(total_radiation,0,100)
|
||||
|
||||
if (total_radiation)
|
||||
if(src.is_diona())
|
||||
@@ -983,7 +983,7 @@
|
||||
//Update hunger and thirst UI less often, its not important
|
||||
if((life_tick % 3 == 0))
|
||||
if(nutrition_icon)
|
||||
var/nut_factor = max_nutrition ? Clamp(nutrition / max_nutrition, 0, 1) : 1
|
||||
var/nut_factor = max_nutrition ? clamp(nutrition / max_nutrition, 0, 1) : 1
|
||||
var/nut_icon = 5 //5 to 0, with 5 being lowest, 0 being highest
|
||||
if(nut_factor >= CREW_NUTRITION_OVEREATEN)
|
||||
nut_icon = 0
|
||||
@@ -1000,7 +1000,7 @@
|
||||
nutrition_icon.icon_state = new_val
|
||||
|
||||
if(hydration_icon)
|
||||
var/hyd_factor = max_hydration ? Clamp(hydration / max_hydration, 0, 1) : 1
|
||||
var/hyd_factor = max_hydration ? clamp(hydration / max_hydration, 0, 1) : 1
|
||||
var/hyd_icon = 5
|
||||
if(hyd_factor >= CREW_HYDRATION_OVERHYDRATED)
|
||||
hyd_icon = 0
|
||||
@@ -1019,7 +1019,7 @@
|
||||
if(isSynthetic())
|
||||
var/obj/item/organ/internal/cell/IC = internal_organs_by_name[BP_CELL]
|
||||
if(istype(IC) && IC.is_usable())
|
||||
var/chargeNum = Clamp(Ceiling(IC.percent()/25), 0, 4) //0-100 maps to 0-4, but give it a paranoid clamp just in case.
|
||||
var/chargeNum = clamp(Ceiling(IC.percent()/25), 0, 4) //0-100 maps to 0-4, but give it a paranoid clamp just in case.
|
||||
cells.icon_state = "charge[chargeNum]"
|
||||
else
|
||||
cells.icon_state = "charge-empty"
|
||||
|
||||
@@ -655,7 +655,7 @@
|
||||
prescriptions += 7
|
||||
if(H.equipment_prescription)
|
||||
prescriptions -= H.equipment_prescription
|
||||
return Clamp(prescriptions, 0, 7)
|
||||
return clamp(prescriptions, 0, 7)
|
||||
|
||||
// pre_move is set to TRUE when the mob checks whether it's even possible to move, so resources aren't drained until after the move completes
|
||||
// once the mob moves and its loc actually changes, the pre_move is set to FALSE and all the proper resources are drained
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
/datum/unarmed_attack/claws/show_attack(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target, var/zone, var/attack_damage)
|
||||
var/obj/item/organ/external/affecting = target.get_organ(zone)
|
||||
|
||||
attack_damage = Clamp(attack_damage, 1, 5)
|
||||
attack_damage = clamp(attack_damage, 1, 5)
|
||||
|
||||
if(target == user)
|
||||
user.visible_message(SPAN_DANGER("[user] [pick(attack_verb)] [user.get_pronoun("himself")] in the [affecting.name]!"))
|
||||
|
||||
@@ -193,7 +193,7 @@ GLOBAL_LIST_EMPTY(sparring_attack_cache)
|
||||
|
||||
var/organ = affecting.name
|
||||
|
||||
attack_damage = Clamp(attack_damage, 1, 5) // We expect damage input of 1 to 5 for this proc. But we leave this check juuust in case.
|
||||
attack_damage = clamp(attack_damage, 1, 5) // We expect damage input of 1 to 5 for this proc. But we leave this check juuust in case.
|
||||
|
||||
if(target == user)
|
||||
user.visible_message(SPAN_DANGER("[user] [pick(attack_verb)] [user.get_pronoun("himself")] in the [organ]!"))
|
||||
@@ -286,7 +286,7 @@ GLOBAL_LIST_EMPTY(sparring_attack_cache)
|
||||
|
||||
var/organ = affecting.name
|
||||
|
||||
attack_damage = Clamp(attack_damage, 1, 5)
|
||||
attack_damage = clamp(attack_damage, 1, 5)
|
||||
|
||||
switch(attack_damage)
|
||||
if(1 to 2) user.visible_message(SPAN_DANGER("[user] threw [target] a glancing [pick(attack_noun)] to the [organ]!")) //it's not that they're kicking lightly, it's that the kick didn't quite connect
|
||||
@@ -334,7 +334,7 @@ GLOBAL_LIST_EMPTY(sparring_attack_cache)
|
||||
|
||||
var/obj/item/clothing/shoes = user.shoes
|
||||
|
||||
attack_damage = Clamp(attack_damage, 1, 5)
|
||||
attack_damage = clamp(attack_damage, 1, 5)
|
||||
|
||||
switch(attack_damage)
|
||||
if(1 to 4) user.visible_message(SPAN_DANGER("[pick("[user] stomped on", "[user] slammed [user.get_pronoun("his")] [shoes ? copytext(shoes.name, 1, -1) : "foot"] down onto")] [target]'s [organ]!"))
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
return toxloss
|
||||
|
||||
/mob/living/carbon/slime/adjustToxLoss(var/amount)
|
||||
toxloss = Clamp(toxloss + amount, 0, maxHealth)
|
||||
toxloss = clamp(toxloss + amount, 0, maxHealth)
|
||||
|
||||
/mob/living/carbon/slime/setToxLoss(var/amount)
|
||||
adjustToxLoss(amount-getToxLoss())
|
||||
|
||||
@@ -282,7 +282,7 @@ default behaviour is:
|
||||
/mob/living/proc/adjustBruteLoss(var/amount)
|
||||
if (status_flags & GODMODE)
|
||||
return
|
||||
health = Clamp(health - amount, 0, maxHealth)
|
||||
health = clamp(health - amount, 0, maxHealth)
|
||||
|
||||
/mob/living/proc/getOxyLoss()
|
||||
return 0
|
||||
|
||||
@@ -403,7 +403,7 @@
|
||||
return
|
||||
|
||||
/mob/living/proc/adjust_fire_stacks(var/add_fire_stacks)
|
||||
fire_stacks = Clamp(fire_stacks + add_fire_stacks, FIRE_MIN_STACKS, FIRE_MAX_STACKS)
|
||||
fire_stacks = clamp(fire_stacks + add_fire_stacks, FIRE_MIN_STACKS, FIRE_MAX_STACKS)
|
||||
|
||||
return fire_stacks
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
installed = -1
|
||||
|
||||
/datum/robot_component/proc/get_damage(var/type)
|
||||
return Clamp(brute_damage + electronics_damage,0,max_damage)
|
||||
return clamp(brute_damage + electronics_damage,0,max_damage)
|
||||
|
||||
/datum/robot_component/proc/take_damage(brute, electronics, damage_flags)
|
||||
if(installed != 1)
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
for(var/V in components)
|
||||
var/datum/robot_component/C = components[V]
|
||||
if(C.installed)
|
||||
amount += Clamp(C.brute_damage, 0, C.max_damage)
|
||||
amount += clamp(C.brute_damage, 0, C.max_damage)
|
||||
else if(C.installed == -1)
|
||||
amount += C.max_damage / 2
|
||||
return amount
|
||||
@@ -21,7 +21,7 @@
|
||||
for(var/V in components)
|
||||
var/datum/robot_component/C = components[V]
|
||||
if(C.installed)
|
||||
amount += Clamp(C.electronics_damage, 0, C.max_damage)
|
||||
amount += clamp(C.electronics_damage, 0, C.max_damage)
|
||||
else if(C.installed == -1)
|
||||
amount += C.max_damage / 2
|
||||
return amount
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
. = TRUE
|
||||
message = Gibberish(message, C.max_damage / C.get_damage())
|
||||
else
|
||||
var/damaged = 100 - (Clamp(health, 0, maxHealth) / maxHealth) * 100
|
||||
var/damaged = 100 - (clamp(health, 0, maxHealth) / maxHealth) * 100
|
||||
if(damaged > 40)
|
||||
. = TRUE
|
||||
message = Gibberish(message, damaged - 10)
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
var/armor = 100 * affecting.get_blocked_ratio(target, DAMAGE_BRUTE, damage = 30)
|
||||
if(armor < 70)
|
||||
to_chat(target, SPAN_DANGER("You feel extreme pain!"))
|
||||
affecting.adjustHalLoss(Clamp(0, 60 - affecting.getHalLoss(), 30)) //up to 60 halloss
|
||||
affecting.adjustHalLoss(clamp(0, 60 - affecting.getHalLoss(), 30)) //up to 60 halloss
|
||||
|
||||
/obj/item/grab/proc/attack_eye(mob/living/carbon/human/target, mob/living/carbon/human/attacker)
|
||||
if(!istype(attacker))
|
||||
|
||||
Reference in New Issue
Block a user