mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-12 23:53:47 +01:00
Merge pull request #160 from alex-gh/bs12_fixes_optimizations
Fixes and optimizations cherry picked from BS12
This commit is contained in:
@@ -62,7 +62,7 @@
|
||||
if(30)
|
||||
new/obj/item/weapon/melee/baton(src)
|
||||
|
||||
/obj/structure/closet/crate/secure/loot/attack_hand(mob/user as mob)
|
||||
/obj/structure/closet/crate/secure/loot/togglelock(mob/user as mob)
|
||||
if(locked)
|
||||
user << "<span class='notice'>The crate is locked with a Deca-code lock.</span>"
|
||||
var/input = input(usr, "Enter digit from [min] to [max].", "Deca-Code Lock", "") as num
|
||||
@@ -71,6 +71,8 @@
|
||||
if (input == code)
|
||||
user << "<span class='notice'>The crate unlocks!</span>"
|
||||
locked = 0
|
||||
overlays.Cut()
|
||||
overlays += greenlight
|
||||
else if (input == null || input > max || input < min)
|
||||
user << "<span class='notice'>You leave the crate alone.</span>"
|
||||
else
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
icon_state = "body_m_s"
|
||||
var/list/hud_list = list()
|
||||
var/datum/species/species //Contains icon generation and language information, set during New().
|
||||
var/embedded_flag //To check if we've need to roll for damage on movement while an item is imbedded in us.
|
||||
|
||||
/mob/living/carbon/human/dummy
|
||||
real_name = "Test Dummy"
|
||||
|
||||
@@ -251,6 +251,7 @@
|
||||
if(!istype(W, /obj/item/weapon/butch/meatcleaver))
|
||||
organ.implants += W
|
||||
visible_message("<span class='danger'>\The [W] sticks in the wound!</span>")
|
||||
embedded_flag = 1
|
||||
src.verbs += /mob/proc/yank_out_object
|
||||
W.add_blood(src)
|
||||
if(ismob(W.loc))
|
||||
@@ -273,4 +274,4 @@
|
||||
if(prob(60))
|
||||
step_rand(H)
|
||||
if(!stat)
|
||||
src << "<span class='warning'>Your [H] fell off!</span>"
|
||||
src << "<span class='warning'>Your [H] fell off!</span>"
|
||||
|
||||
@@ -100,6 +100,7 @@ emp_act
|
||||
(SP.loc) = organ
|
||||
organ.implants += SP
|
||||
visible_message("<span class='danger'>The projectile sticks in the wound!</span>")
|
||||
embedded_flag = 1
|
||||
src.verbs += /mob/proc/yank_out_object
|
||||
SP.add_blood(src)
|
||||
return (..(P , def_zone))
|
||||
@@ -200,7 +201,7 @@ emp_act
|
||||
target_zone = user.zone_sel.selecting
|
||||
if(!target_zone && !src.stat)
|
||||
visible_message("\red <B>[user] misses [src] with \the [I]!")
|
||||
return
|
||||
return 0
|
||||
|
||||
if(istype(I, /obj/item/weapon/butch/meatcleaver) && src.stat == DEAD && user.a_intent == "harm")
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/meat/human/newmeat = new /obj/item/weapon/reagent_containers/food/snacks/meat/human(get_turf(src.loc))
|
||||
@@ -225,10 +226,10 @@ emp_act
|
||||
|
||||
var/datum/organ/external/affecting = get_organ(target_zone)
|
||||
if (!affecting)
|
||||
return
|
||||
return 0
|
||||
if(affecting.status & ORGAN_DESTROYED)
|
||||
user << "What [affecting.display_name]?"
|
||||
return
|
||||
return 0
|
||||
var/hit_area = affecting.display_name
|
||||
|
||||
if((user != src) && check_shields(I.force, "the [I.name]"))
|
||||
@@ -245,7 +246,7 @@ emp_act
|
||||
var/obj/item/weapon/card/emag/emag = I
|
||||
emag.uses--
|
||||
affecting.sabotaged = 1
|
||||
return
|
||||
return 1
|
||||
|
||||
if(I.attack_verb.len)
|
||||
visible_message("\red <B>[src] has been [pick(I.attack_verb)] in the [hit_area] with [I.name] by [user]!</B>")
|
||||
@@ -300,6 +301,7 @@ emp_act
|
||||
|
||||
if(bloody)
|
||||
bloody_body(src)
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/human/proc/bloody_hands(var/mob/living/source, var/amount = 2)
|
||||
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
|
||||
if (istype(loc, /turf/space)) return -1 // It's hard to be slowed down in space by... anything
|
||||
|
||||
handle_embedded_objects() //Moving with objects stuck in you can cause bad times.
|
||||
if(embedded_flag)
|
||||
handle_embedded_objects() //Moving with objects stuck in you can cause bad times.
|
||||
|
||||
if(reagents.has_reagent("hyperzine")) return -1
|
||||
|
||||
|
||||
@@ -104,20 +104,20 @@
|
||||
|
||||
if (W == wear_suit)
|
||||
if(s_store)
|
||||
u_equip(s_store)
|
||||
drop_from_inventory(s_store)
|
||||
if(W)
|
||||
success = 1
|
||||
wear_suit = null
|
||||
update_inv_wear_suit()
|
||||
else if (W == w_uniform)
|
||||
if (r_store)
|
||||
u_equip(r_store)
|
||||
drop_from_inventory(r_store)
|
||||
if (l_store)
|
||||
u_equip(l_store)
|
||||
drop_from_inventory(l_store)
|
||||
if (wear_id)
|
||||
u_equip(wear_id)
|
||||
drop_from_inventory(wear_id)
|
||||
if (belt)
|
||||
u_equip(belt)
|
||||
drop_from_inventory(belt)
|
||||
w_uniform = null
|
||||
success = 1
|
||||
update_inv_w_uniform()
|
||||
|
||||
@@ -130,7 +130,7 @@
|
||||
handle_environment(environment)
|
||||
|
||||
//Status updates, death etc.
|
||||
handle_regular_status_updates() //TODO: optimise ~Carn
|
||||
handle_regular_status_updates() //TODO: optimise ~Carn NO SHIT ~Ccomp
|
||||
update_canmove()
|
||||
|
||||
//Update our name based on whether our face is obscured/disfigured
|
||||
@@ -1146,6 +1146,13 @@
|
||||
if(halloss > 0)
|
||||
adjustHalLoss(-1)
|
||||
|
||||
if(embedded_flag && !(life_tick % 10))
|
||||
var/list/E
|
||||
E = get_visible_implants(0)
|
||||
if(!E.len)
|
||||
embedded_flag = 0
|
||||
|
||||
|
||||
//Eyes
|
||||
if(sdisabilities & BLIND) //disabled-blind, doesn't get better on its own
|
||||
blinded = 1
|
||||
|
||||
@@ -623,9 +623,10 @@
|
||||
for(var/mob/O in viewers(CM))// lags so hard that 40s isn't lenient enough - Quarxink
|
||||
O.show_message("\red <B>[CM] manages to remove the handcuffs!</B>", 1)
|
||||
CM << "\blue You successfully remove \the [CM.handcuffed]."
|
||||
CM.handcuffed.loc = usr.loc
|
||||
CM.drop_from_inventory(CM.handcuffed)
|
||||
CM.handcuffed = null
|
||||
CM.update_inv_handcuffed()
|
||||
|
||||
else if(CM.legcuffed && CM.canmove && (CM.last_special <= world.time))
|
||||
CM.next_move = world.time + 100
|
||||
CM.last_special = world.time + 100
|
||||
@@ -661,7 +662,7 @@
|
||||
for(var/mob/O in viewers(CM))// lags so hard that 40s isn't lenient enough - Quarxink
|
||||
O.show_message("\red <B>[CM] manages to remove the legcuffs!</B>", 1)
|
||||
CM << "\blue You successfully remove \the [CM.legcuffed]."
|
||||
CM.legcuffed.loc = usr.loc
|
||||
CM.drop_from_inventory(CM.legcuffed)
|
||||
CM.legcuffed = null
|
||||
CM.update_inv_legcuffed()
|
||||
|
||||
|
||||
@@ -694,10 +694,11 @@ var/list/ai_list = list()
|
||||
camera_light_on = !camera_light_on
|
||||
src << "Camera lights [camera_light_on ? "activated" : "deactivated"]."
|
||||
if(!camera_light_on)
|
||||
if(src.current)
|
||||
src.current.SetLuminosity(0)
|
||||
if(current)
|
||||
current.SetLuminosity(0)
|
||||
current = null
|
||||
else
|
||||
src.lightNearbyCamera()
|
||||
lightNearbyCamera()
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -643,5 +643,12 @@
|
||||
dat += "</li>"
|
||||
dat += "</ul>"
|
||||
dat += "<br><br>"
|
||||
dat += "Messages: <hr> [pda.tnote]"
|
||||
return dat
|
||||
for(var/index in pda.tnote)
|
||||
if(index["sent"])
|
||||
dat += addtext("<i><b>→ To <a href='byond://?src=\ref[src];software=pdamessage;target=",index["src"],"'>", index["owner"],"</a>:</b></i><br>", index["message"], "<br>")
|
||||
else
|
||||
dat += addtext("<i><b>← From <a href='byond://?src=\ref[src];software=pdamessage;target=",index["target"],"'>", index["owner"],"</a>:</b></i><br>", index["message"], "<br>")
|
||||
|
||||
|
||||
|
||||
return dat
|
||||
|
||||
@@ -1188,7 +1188,6 @@ mob/proc/yank_out_object()
|
||||
var/datum/wound/internal_bleeding/I = new (15)
|
||||
affected.wounds += I
|
||||
H.custom_pain("Something tears wetly in your [affected] as [selection] is pulled free!", 1)
|
||||
return 1
|
||||
|
||||
selection.loc = get_turf(src)
|
||||
|
||||
|
||||
@@ -177,7 +177,7 @@
|
||||
|
||||
for(var/mob/living/carbon/human/l in view(src, min(7, round(power ** 0.25)))) // If they can see it without mesons on. Bad on them.
|
||||
if(!istype(l.glasses, /obj/item/clothing/glasses/meson))
|
||||
l.hallucination = max(0, min(200, l.hallucination + power * config_hallucination_power * sqrt( 1 / get_dist(l, src) ) ) )
|
||||
l.hallucination = max(0, min(200, l.hallucination + power * config_hallucination_power * sqrt( 1 / max(1,get_dist(l, src)) ) ) )
|
||||
|
||||
for(var/mob/living/l in range(src, round((power / 100) ** 0.25)))
|
||||
var/rads = (power / 10) * sqrt( 1 / get_dist(l, src) )
|
||||
|
||||
Reference in New Issue
Block a user