mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-27 14:07:51 +01:00
Remove duplicate procs, fix examine text
This commit is contained in:
@@ -173,67 +173,10 @@ Turf and target are seperate in case you want to teleport some distance from a t
|
||||
//A* helpers procs
|
||||
///////////////////
|
||||
|
||||
// Returns true if a link between A and B is blocked
|
||||
// Movement through doors allowed if ID has access
|
||||
/proc/LinkBlockedWithAccess(turf/A, turf/B, obj/item/weapon/card/id/ID)
|
||||
|
||||
if(A == null || B == null) return 1
|
||||
var/adir = get_dir(A,B)
|
||||
var/rdir = get_dir(B,A)
|
||||
if(adir & (adir-1)) // diagonal
|
||||
var/turf/iStep = get_step(A,adir&(NORTH|SOUTH))
|
||||
if(!iStep.density && !LinkBlockedWithAccess(A,iStep, ID) && !LinkBlockedWithAccess(iStep,B,ID))
|
||||
return 0
|
||||
|
||||
var/turf/pStep = get_step(A,adir&(EAST|WEST))
|
||||
if(!pStep.density && !LinkBlockedWithAccess(A,pStep,ID) && !LinkBlockedWithAccess(pStep,B,ID))
|
||||
return 0
|
||||
|
||||
return 1
|
||||
|
||||
if(DirBlockedWithAccess(A,adir, ID))
|
||||
return 1
|
||||
|
||||
if(DirBlockedWithAccess(B,rdir, ID))
|
||||
return 1
|
||||
|
||||
for(var/obj/O in B)
|
||||
if(O.density && !istype(O, /obj/machinery/door) && !(O.flags & ON_BORDER))
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
// Returns true if a link between A and B is blocked
|
||||
// Movement through doors allowed if door is open
|
||||
/proc/LinkBlocked(turf/A, turf/B)
|
||||
if(A == null || B == null)
|
||||
return 1
|
||||
var/adir = get_dir(A,B)
|
||||
var/rdir = get_dir(B,A)
|
||||
if(adir & (adir-1)) //diagonal
|
||||
var/turf/iStep = get_step(A,adir & (NORTH|SOUTH)) //check the north/south component
|
||||
if(!iStep.density && !LinkBlocked(A,iStep) && !LinkBlocked(iStep,B))
|
||||
return 0
|
||||
|
||||
var/turf/pStep = get_step(A,adir & (EAST|WEST)) //check the east/west component
|
||||
if(!pStep.density && !LinkBlocked(A,pStep) && !LinkBlocked(pStep,B))
|
||||
return 0
|
||||
|
||||
return 1
|
||||
|
||||
if(DirBlocked(A,adir)) return 1
|
||||
if(DirBlocked(B,rdir)) return 1
|
||||
|
||||
for(var/obj/O in B)
|
||||
if(O.density && !istype(O, /obj/machinery/door) && !(O.flags & ON_BORDER))
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
// Returns true if a link is blocked and neither location has something climbable on
|
||||
// Used for inventory checks
|
||||
/proc/LinkBlockedUnclimbable(turf/A, turf/B)
|
||||
if (!LinkBlocked(A, B))
|
||||
if (!A.LinkBlocked(A, B))
|
||||
return 0
|
||||
for (var/obj/structure/S in A.contents)
|
||||
if(S.climbable)
|
||||
|
||||
@@ -266,9 +266,9 @@
|
||||
|
||||
var/obj/item/organ/external/E = organs_by_name[organ_tag]
|
||||
if(!E)
|
||||
wound_flavor_text["[organ_tag]"] = "<span class='warning'><b>[t_He] is missing [t_his] [organ_descriptor].</b></span>\n"
|
||||
wound_flavor_text["[organ_tag]"] = "<span class='warning'><b>[t_He] [t_is] missing [t_his] [organ_descriptor].</b></span>\n"
|
||||
else if(E.is_stump())
|
||||
wound_flavor_text["[organ_tag]"] = "<span class='warning'><b>[t_He] has a stump where [t_his] [organ_descriptor] should be.</b></span>\n"
|
||||
wound_flavor_text["[organ_tag]"] = "<span class='warning'><b>[t_He] [t_has] a stump where [t_his] [organ_descriptor] should be.</b></span>\n"
|
||||
else
|
||||
continue
|
||||
|
||||
@@ -277,10 +277,10 @@
|
||||
if(temp.status & ORGAN_ROBOT)
|
||||
if(!(temp.brute_dam + temp.burn_dam))
|
||||
if(!isSynthetic())
|
||||
wound_flavor_text["[temp.limb_name]"] = "<span class='warning'>[t_He] has a robotic [temp.name]!</span>\n"
|
||||
wound_flavor_text["[temp.limb_name]"] = "<span class='warning'>[t_He] [t_has] a robotic [temp.name]!</span>\n"
|
||||
continue
|
||||
else
|
||||
wound_flavor_text["[temp.limb_name]"] = "<span class='warning'>[t_He] has a robotic [temp.name]. It has"
|
||||
wound_flavor_text["[temp.limb_name]"] = "<span class='warning'>[t_He] [t_has] a robotic [temp.name]. It has"
|
||||
if(temp.brute_dam) switch(temp.brute_dam)
|
||||
if(0 to 20)
|
||||
wound_flavor_text["[temp.limb_name]"] += " some dents"
|
||||
@@ -317,22 +317,22 @@
|
||||
switch(wound_descriptors[wound])
|
||||
if(1)
|
||||
if(!flavor_text.len)
|
||||
flavor_text += "<span class='warning'>[t_He] has[prob(10) && !(wound in no_exclude) ? " what might be" : ""] a [wound]"
|
||||
flavor_text += "<span class='warning'>[t_He] [t_has][prob(10) && !(wound in no_exclude) ? " what might be" : ""] a [wound]"
|
||||
else
|
||||
flavor_text += "[prob(10) && !(wound in no_exclude) ? " what might be" : ""] a [wound]"
|
||||
if(2)
|
||||
if(!flavor_text.len)
|
||||
flavor_text += "<span class='warning'>[t_He] has[prob(10) && !(wound in no_exclude) ? " what might be" : ""] a pair of [wound]s"
|
||||
flavor_text += "<span class='warning'>[t_He] [t_has][prob(10) && !(wound in no_exclude) ? " what might be" : ""] a pair of [wound]s"
|
||||
else
|
||||
flavor_text += "[prob(10) && !(wound in no_exclude) ? " what might be" : ""] a pair of [wound]s"
|
||||
if(3 to 5)
|
||||
if(!flavor_text.len)
|
||||
flavor_text += "<span class='warning'>[t_He] has several [wound]s"
|
||||
flavor_text += "<span class='warning'>[t_He] [t_has] several [wound]s"
|
||||
else
|
||||
flavor_text += " several [wound]s"
|
||||
if(6 to INFINITY)
|
||||
if(!flavor_text.len)
|
||||
flavor_text += "<span class='warning'>[t_He] has a bunch of [wound]s"
|
||||
flavor_text += "<span class='warning'>[t_He] [t_has] a bunch of [wound]s"
|
||||
else
|
||||
flavor_text += " a ton of [wound]\s"
|
||||
var/flavor_text_string = ""
|
||||
|
||||
Reference in New Issue
Block a user