mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-18 02:24:11 +01:00
Moves to BYOND 513 (#13650)
* Fixes Orbiting * moves to 513 * travis update * check for minor version too
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
|
||||
for(var/i = 0;i<name_count;i++)
|
||||
new_name = ""
|
||||
for(var/x = rand(Floor(syllable_count/2),syllable_count);x>0;x--)
|
||||
for(var/x = rand(FLOOR(syllable_count/2, 1),syllable_count);x>0;x--)
|
||||
new_name += pick(syllables)
|
||||
full_name += " [capitalize(lowertext(new_name))]"
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
if(dna.species && amount > 0)
|
||||
if(use_brain_mod)
|
||||
amount = amount * dna.species.brain_mod
|
||||
sponge.damage = Clamp(sponge.damage + amount, 0, 120)
|
||||
sponge.damage = clamp(sponge.damage + amount, 0, 120)
|
||||
if(sponge.damage >= 120)
|
||||
visible_message("<span class='alert'><B>[src]</B> goes limp, [p_their()] facial expression utterly blank.</span>")
|
||||
death()
|
||||
@@ -48,7 +48,7 @@
|
||||
if(dna.species && amount > 0)
|
||||
if(use_brain_mod)
|
||||
amount = amount * dna.species.brain_mod
|
||||
sponge.damage = Clamp(amount, 0, 120)
|
||||
sponge.damage = clamp(amount, 0, 120)
|
||||
if(sponge.damage >= 120)
|
||||
visible_message("<span class='alert'><B>[src]</B> goes limp, [p_their()] facial expression utterly blank.</span>")
|
||||
death()
|
||||
|
||||
@@ -185,19 +185,19 @@ emp_act
|
||||
var/block_chance_modifier = round(damage / -3)
|
||||
|
||||
if(l_hand && !istype(l_hand, /obj/item/clothing))
|
||||
var/final_block_chance = l_hand.block_chance - (Clamp((armour_penetration-l_hand.armour_penetration)/2,0,100)) + block_chance_modifier //So armour piercing blades can still be parried by other blades, for example
|
||||
var/final_block_chance = l_hand.block_chance - (clamp((armour_penetration-l_hand.armour_penetration)/2,0,100)) + block_chance_modifier //So armour piercing blades can still be parried by other blades, for example
|
||||
if(l_hand.hit_reaction(src, AM, attack_text, final_block_chance, damage, attack_type))
|
||||
return 1
|
||||
if(r_hand && !istype(r_hand, /obj/item/clothing))
|
||||
var/final_block_chance = r_hand.block_chance - (Clamp((armour_penetration-r_hand.armour_penetration)/2,0,100)) + block_chance_modifier //Need to reset the var so it doesn't carry over modifications between attempts
|
||||
var/final_block_chance = r_hand.block_chance - (clamp((armour_penetration-r_hand.armour_penetration)/2,0,100)) + block_chance_modifier //Need to reset the var so it doesn't carry over modifications between attempts
|
||||
if(r_hand.hit_reaction(src, AM, attack_text, final_block_chance, damage, attack_type))
|
||||
return 1
|
||||
if(wear_suit)
|
||||
var/final_block_chance = wear_suit.block_chance - (Clamp((armour_penetration-wear_suit.armour_penetration)/2,0,100)) + block_chance_modifier
|
||||
var/final_block_chance = wear_suit.block_chance - (clamp((armour_penetration-wear_suit.armour_penetration)/2,0,100)) + block_chance_modifier
|
||||
if(wear_suit.hit_reaction(src, AM, attack_text, final_block_chance, damage, attack_type))
|
||||
return 1
|
||||
if(w_uniform)
|
||||
var/final_block_chance = w_uniform.block_chance - (Clamp((armour_penetration-w_uniform.armour_penetration)/2,0,100)) + block_chance_modifier
|
||||
var/final_block_chance = w_uniform.block_chance - (clamp((armour_penetration-w_uniform.armour_penetration)/2,0,100)) + block_chance_modifier
|
||||
if(w_uniform.hit_reaction(src, AM, attack_text, final_block_chance, damage, attack_type))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
@@ -197,7 +197,7 @@
|
||||
|
||||
if(!(RADIMMUNE in dna.species.species_traits))
|
||||
if(radiation)
|
||||
radiation = Clamp(radiation, 0, 200)
|
||||
radiation = clamp(radiation, 0, 200)
|
||||
|
||||
var/autopsy_damage = 0
|
||||
switch(radiation)
|
||||
|
||||
@@ -162,7 +162,7 @@
|
||||
//TOXINS/PLASMA
|
||||
if(Toxins_partialpressure > safe_tox_max)
|
||||
var/ratio = (breath.toxins/safe_tox_max) * 10
|
||||
adjustToxLoss(Clamp(ratio, MIN_TOXIC_GAS_DAMAGE, MAX_TOXIC_GAS_DAMAGE))
|
||||
adjustToxLoss(clamp(ratio, MIN_TOXIC_GAS_DAMAGE, MAX_TOXIC_GAS_DAMAGE))
|
||||
throw_alert("too_much_tox", /obj/screen/alert/too_much_tox)
|
||||
else
|
||||
clear_alert("too_much_tox")
|
||||
@@ -243,7 +243,7 @@
|
||||
adjustToxLoss(3)
|
||||
updatehealth("handle mutations and radiation(75-100)")
|
||||
|
||||
radiation = Clamp(radiation, 0, 100)
|
||||
radiation = clamp(radiation, 0, 100)
|
||||
|
||||
|
||||
/mob/living/carbon/handle_chemicals_in_body()
|
||||
|
||||
@@ -79,9 +79,9 @@
|
||||
|
||||
/obj/item/proc/get_volume_by_throwforce_and_or_w_class()
|
||||
if(throwforce && w_class)
|
||||
return Clamp((throwforce + w_class) * 5, 30, 100)// Add the item's throwforce to its weight class and multiply by 5, then clamp the value between 30 and 100
|
||||
return clamp((throwforce + w_class) * 5, 30, 100)// Add the item's throwforce to its weight class and multiply by 5, then clamp the value between 30 and 100
|
||||
else if(w_class)
|
||||
return Clamp(w_class * 8, 20, 100) // Multiply the item's weight class by 8, then clamp the value between 20 and 100
|
||||
return clamp(w_class * 8, 20, 100) // Multiply the item's weight class by 8, then clamp the value between 20 and 100
|
||||
else
|
||||
return 0
|
||||
|
||||
@@ -175,7 +175,7 @@
|
||||
return
|
||||
|
||||
/mob/living/proc/adjust_fire_stacks(add_fire_stacks) //Adjusting the amount of fire_stacks we have on person
|
||||
fire_stacks = Clamp(fire_stacks + add_fire_stacks, -20, 20)
|
||||
fire_stacks = clamp(fire_stacks + add_fire_stacks, -20, 20)
|
||||
if(on_fire && fire_stacks <= 0)
|
||||
ExtinguishMob()
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
if(is_component_functioning("power cell") && cell.charge)
|
||||
if(cell.charge <= 100)
|
||||
uneq_all()
|
||||
var/amt = Clamp((lamp_intensity - 2) * 2,1,cell.charge) //Always try to use at least one charge per tick, but allow it to completely drain the cell.
|
||||
var/amt = clamp((lamp_intensity - 2) * 2,1,cell.charge) //Always try to use at least one charge per tick, but allow it to completely drain the cell.
|
||||
cell.use(amt) //Usage table: 1/tick if off/lowest setting, 4 = 4/tick, 6 = 8/tick, 8 = 12/tick, 10 = 16/tick
|
||||
else
|
||||
uneq_all()
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
if(status_flags & GODMODE)
|
||||
return FALSE
|
||||
var/oldbruteloss = bruteloss
|
||||
bruteloss = Clamp(bruteloss + amount, 0, maxHealth)
|
||||
bruteloss = clamp(bruteloss + amount, 0, maxHealth)
|
||||
if(oldbruteloss == bruteloss)
|
||||
updating_health = FALSE
|
||||
. = STATUS_UPDATE_NONE
|
||||
|
||||
@@ -153,7 +153,7 @@
|
||||
icon_dead = "maid_dead"
|
||||
|
||||
/mob/living/simple_animal/hostile/alien/maid/AttackingTarget()
|
||||
if(ismovableatom(target))
|
||||
if(ismovable(target))
|
||||
if(istype(target, /obj/effect/decal/cleanable))
|
||||
visible_message("<span class='notice'>\The [src] cleans up \the [target].</span>")
|
||||
qdel(target)
|
||||
|
||||
@@ -116,8 +116,8 @@ Difficulty: Hard
|
||||
if(charging)
|
||||
return
|
||||
|
||||
anger_modifier = Clamp(((maxHealth - health)/60),0,20)
|
||||
enrage_time = initial(enrage_time) * Clamp(anger_modifier / 20, 0.5, 1)
|
||||
anger_modifier = clamp(((maxHealth - health)/60),0,20)
|
||||
enrage_time = initial(enrage_time) * clamp(anger_modifier / 20, 0.5, 1)
|
||||
ranged_cooldown = world.time + 50
|
||||
|
||||
if(client)
|
||||
|
||||
@@ -83,7 +83,7 @@ Difficulty: Very Hard
|
||||
chosen_attack_num = 4
|
||||
|
||||
/mob/living/simple_animal/hostile/megafauna/colossus/OpenFire()
|
||||
anger_modifier = Clamp(((maxHealth - health)/50),0,20)
|
||||
anger_modifier = clamp(((maxHealth - health)/50),0,20)
|
||||
ranged_cooldown = world.time + 120
|
||||
|
||||
if(client)
|
||||
|
||||
@@ -103,7 +103,7 @@ Difficulty: Medium
|
||||
if(swooping)
|
||||
return
|
||||
|
||||
anger_modifier = Clamp(((maxHealth - health)/50),0,20)
|
||||
anger_modifier = clamp(((maxHealth - health)/50),0,20)
|
||||
ranged_cooldown = world.time + ranged_cooldown_time
|
||||
|
||||
if(client)
|
||||
@@ -254,7 +254,7 @@ Difficulty: Medium
|
||||
/mob/living/simple_animal/hostile/megafauna/dragon/proc/line_target(var/offset, var/range, var/atom/at = target)
|
||||
if(!at)
|
||||
return
|
||||
var/angle = Atan2(at.x - src.x, at.y - src.y) + offset
|
||||
var/angle = ATAN2(at.x - src.x, at.y - src.y) + offset
|
||||
var/turf/T = get_turf(src)
|
||||
for(var/i in 1 to range)
|
||||
var/turf/check = locate(src.x + cos(angle) * i, src.y + sin(angle) * i, src.z)
|
||||
@@ -344,10 +344,10 @@ Difficulty: Medium
|
||||
|
||||
//ensure swoop direction continuity.
|
||||
if(negative)
|
||||
if(IsInRange(x, initial_x + 1, initial_x + DRAKE_SWOOP_DIRECTION_CHANGE_RANGE))
|
||||
if(ISINRANGE(x, initial_x + 1, initial_x + DRAKE_SWOOP_DIRECTION_CHANGE_RANGE))
|
||||
negative = FALSE
|
||||
else
|
||||
if(IsInRange(x, initial_x - DRAKE_SWOOP_DIRECTION_CHANGE_RANGE, initial_x - 1))
|
||||
if(ISINRANGE(x, initial_x - DRAKE_SWOOP_DIRECTION_CHANGE_RANGE, initial_x - 1))
|
||||
negative = TRUE
|
||||
new /obj/effect/temp_visual/dragon_flight/end(loc, negative)
|
||||
new /obj/effect/temp_visual/dragon_swoop(loc)
|
||||
|
||||
@@ -482,7 +482,7 @@ Difficulty: Hard
|
||||
|
||||
/mob/living/simple_animal/hostile/megafauna/hierophant/proc/calculate_rage() //how angry we are overall
|
||||
did_reset = FALSE //oh hey we're doing SOMETHING, clearly we might need to heal if we recall
|
||||
anger_modifier = Clamp(((maxHealth - health) / 42),0,50)
|
||||
anger_modifier = clamp(((maxHealth - health) / 42),0,50)
|
||||
burst_range = initial(burst_range) + round(anger_modifier * 0.08)
|
||||
beam_range = initial(beam_range) + round(anger_modifier * 0.12)
|
||||
|
||||
|
||||
@@ -168,7 +168,7 @@
|
||||
neststep = 4
|
||||
else
|
||||
spider_lastspawn = world.time
|
||||
var/spiders_left_to_spawn = Clamp( (spider_max_per_nest - CountSpiders()), 1, 10)
|
||||
var/spiders_left_to_spawn = clamp( (spider_max_per_nest - CountSpiders()), 1, 10)
|
||||
DoLayTerrorEggs(pick(spider_types_standard), spiders_left_to_spawn)
|
||||
if(4)
|
||||
// Nest should be full. Otherwise, start replenishing nest (stage 5).
|
||||
|
||||
@@ -144,7 +144,7 @@
|
||||
|
||||
/mob/living/simple_animal/updatehealth(reason = "none given")
|
||||
..(reason)
|
||||
health = Clamp(health, 0, maxHealth)
|
||||
health = clamp(health, 0, maxHealth)
|
||||
med_hud_set_health()
|
||||
|
||||
/mob/living/simple_animal/StartResting(updating = 1)
|
||||
|
||||
@@ -190,7 +190,7 @@
|
||||
step_away(M,src)
|
||||
M.Friends = Friends.Copy()
|
||||
babies += M
|
||||
M.mutation_chance = Clamp(mutation_chance+(rand(5,-5)),0,100)
|
||||
M.mutation_chance = clamp(mutation_chance+(rand(5,-5)),0,100)
|
||||
feedback_add_details("slime_babies_born", "slimebirth_[replacetext(M.colour," ","_")]")
|
||||
|
||||
var/mob/living/simple_animal/slime/new_slime = pick(babies)
|
||||
|
||||
@@ -207,4 +207,4 @@
|
||||
|
||||
/mob/proc/adjust_bodytemperature(amount, min_temp = 0, max_temp = INFINITY)
|
||||
if(bodytemperature >= min_temp && bodytemperature <= max_temp)
|
||||
bodytemperature = Clamp(bodytemperature + amount, min_temp, max_temp)
|
||||
bodytemperature = clamp(bodytemperature + amount, min_temp, max_temp)
|
||||
|
||||
Reference in New Issue
Block a user