Merge pull request #13588 from dearmochi/more-fix-stuff

More fixes: Custodial Locator, e-swords, upside-down-itis and grabbing
This commit is contained in:
Fox McCloud
2020-06-26 20:10:20 -04:00
committed by GitHub
12 changed files with 96 additions and 85 deletions
@@ -260,8 +260,6 @@
add_attack_logs(user, src, "Grabbed passively", ATKLOG_ALL)
var/obj/item/grab/G = new /obj/item/grab(user, src)
if(buckled)
to_chat(user, "<span class='notice'>You cannot grab [src]; [p_they()] [p_are()] buckled in!</span>")
if(!G) //the grab will delete itself in New if src is anchored
return 0
user.put_in_active_hand(G)
+11 -11
View File
@@ -53,12 +53,11 @@
hud.master = src
//check if assailant is grabbed by victim as well
if(assailant.grabbed_by)
for(var/obj/item/grab/G in assailant.grabbed_by)
if(G.assailant == affecting && G.affecting == assailant)
G.dancing = 1
G.adjust_position()
dancing = 1
for(var/obj/item/grab/G in assailant.grabbed_by)
if(G.assailant == affecting && G.affecting == assailant)
G.dancing = 1
G.adjust_position()
dancing = 1
clean_grabbed_by(assailant, affecting)
adjust_position()
@@ -276,7 +275,7 @@
assailant.visible_message("<span class='warning'>[assailant] has reinforced [assailant.p_their()] grip on [affecting] (now neck)!</span>")
state = GRAB_NECK
icon_state = "grabbed+1"
assailant.setDir(get_dir(assailant, affecting))
add_attack_logs(assailant, affecting, "Neck grabbed", ATKLOG_ALL)
if(!iscarbon(assailant))
affecting.LAssailant = null
@@ -296,7 +295,7 @@
assailant.next_move = world.time + 10
if(!affecting.get_organ_slot("breathing_tube"))
affecting.AdjustLoseBreath(1)
affecting.setDir(WEST)
adjust_position()
//This is used to make sure the victim hasn't managed to yackety sax away before using the grab.
@@ -433,9 +432,10 @@
/obj/item/grab/Destroy()
if(affecting)
affecting.pixel_x = 0
affecting.pixel_y = 0 //used to be an animate, not quick enough for del'ing
affecting.layer = initial(affecting.layer)
if(!affecting.buckled)
affecting.pixel_x = 0
affecting.pixel_y = 0 //used to be an animate, not quick enough for del'ing
affecting.layer = initial(affecting.layer)
affecting.grabbed_by -= src
affecting = null
if(assailant)
+8 -19
View File
@@ -366,6 +366,7 @@
JaniData["user_loc"] = list("x" = cl.x, "y" = cl.y)
else
JaniData["user_loc"] = list("x" = 0, "y" = 0)
var/MopData[0]
for(var/obj/item/mop/M in GLOB.janitorial_equipment)
var/turf/ml = get_turf(M)
@@ -375,10 +376,6 @@
var/direction = get_dir(pda, M)
MopData[++MopData.len] = list ("x" = ml.x, "y" = ml.y, "dir" = uppertext(dir2text(direction)), "status" = M.reagents.total_volume ? "Wet" : "Dry")
if(!MopData.len)
MopData[++MopData.len] = list("x" = 0, "y" = 0, dir=null, status = null)
var/BucketData[0]
for(var/obj/structure/mopbucket/B in GLOB.janitorial_equipment)
var/turf/bl = get_turf(B)
@@ -386,13 +383,10 @@
if(bl.z != cl.z)
continue
var/direction = get_dir(pda,B)
BucketData[++BucketData.len] = list ("x" = bl.x, "y" = bl.y, "dir" = uppertext(dir2text(direction)), "status" = B.reagents.total_volume/100)
if(!BucketData.len)
BucketData[++BucketData.len] = list("x" = 0, "y" = 0, dir=null, status = null)
BucketData[++BucketData.len] = list ("x" = bl.x, "y" = bl.y, "dir" = uppertext(dir2text(direction)), "volume" = B.reagents.total_volume, "max_volume" = B.reagents.maximum_volume)
var/CbotData[0]
for(var/mob/living/simple_animal/bot/cleanbot/B in GLOB.simple_animals)
for(var/mob/living/simple_animal/bot/cleanbot/B in GLOB.bots_list)
var/turf/bl = get_turf(B)
if(bl)
if(bl.z != cl.z)
@@ -400,9 +394,6 @@
var/direction = get_dir(pda,B)
CbotData[++CbotData.len] = list("x" = bl.x, "y" = bl.y, "dir" = uppertext(dir2text(direction)), "status" = B.on ? "Online" : "Offline")
if(!CbotData.len)
CbotData[++CbotData.len] = list("x" = 0, "y" = 0, dir=null, status = null)
var/CartData[0]
for(var/obj/structure/janitorialcart/B in GLOB.janitorial_equipment)
var/turf/bl = get_turf(B)
@@ -410,12 +401,10 @@
if(bl.z != cl.z)
continue
var/direction = get_dir(pda,B)
CartData[++CartData.len] = list("x" = bl.x, "y" = bl.y, "dir" = uppertext(dir2text(direction)), "status" = B.reagents.total_volume/100)
if(!CartData.len)
CartData[++CartData.len] = list("x" = 0, "y" = 0, dir=null, status = null)
CartData[++CartData.len] = list("x" = bl.x, "y" = bl.y, "dir" = uppertext(dir2text(direction)), "volume" = B.reagents.total_volume, "max_volume" = B.reagents.maximum_volume)
JaniData["mops"] = MopData
JaniData["buckets"] = BucketData
JaniData["cleanbots"] = CbotData
JaniData["carts"] = CartData
JaniData["mops"] = MopData.len ? MopData : null
JaniData["buckets"] = BucketData.len ? BucketData : null
JaniData["cleanbots"] = CbotData.len ? CbotData : null
JaniData["carts"] = CartData.len ? CartData : null
data["janitor"] = JaniData