Replaces a bunch of loc assignments with forcemoves and moves to nullspace
This commit is contained in:
committed by
CitadelStationBot
parent
b03e606d35
commit
7f90427a40
@@ -119,7 +119,7 @@
|
||||
/obj/item/airlock_painter/attack_self(mob/user)
|
||||
if(ink)
|
||||
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
|
||||
ink.loc = user.loc
|
||||
ink.forceMove(user.drop_location())
|
||||
user.put_in_hands(ink)
|
||||
to_chat(user, "<span class='notice'>You remove [ink] from [src].</span>")
|
||||
ink = null
|
||||
|
||||
@@ -35,7 +35,7 @@ micro-manipulator, console screen, beaker, Microlaser, matter bin, power cells.
|
||||
return
|
||||
|
||||
M.component_parts = list(src) // List of components always contains a board
|
||||
loc = null
|
||||
moveToNullspace()
|
||||
|
||||
for(var/comp_path in req_components)
|
||||
var/comp_amt = req_components[comp_path]
|
||||
|
||||
@@ -302,7 +302,7 @@
|
||||
..()
|
||||
if(check_defib_exists(mainunit, src) && req_defib)
|
||||
defib = mainunit
|
||||
loc = defib
|
||||
forceMove(defib)
|
||||
busy = FALSE
|
||||
update_icon()
|
||||
|
||||
|
||||
@@ -292,7 +292,7 @@
|
||||
def_zone = pick("l_leg", "r_leg")
|
||||
if(!C.legcuffed && C.get_num_legs() >= 2) //beartrap can't cuff your leg if there's already a beartrap or legcuffs, or you don't have two legs.
|
||||
C.legcuffed = src
|
||||
src.loc = C
|
||||
forceMove(C)
|
||||
C.update_inv_legcuffed()
|
||||
SSblackbox.record_feedback("tally", "handcuffs", 1, type)
|
||||
else if(isanimal(L))
|
||||
@@ -352,7 +352,7 @@
|
||||
if(!C.legcuffed && C.get_num_legs() >= 2)
|
||||
visible_message("<span class='danger'>\The [src] ensnares [C]!</span>")
|
||||
C.legcuffed = src
|
||||
src.loc = C
|
||||
forceMove(C)
|
||||
C.update_inv_legcuffed()
|
||||
SSblackbox.record_feedback("tally", "handcuffs", 1, type)
|
||||
to_chat(C, "<span class='userdanger'>\The [src] ensnares you!</span>")
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<<<<<<< HEAD
|
||||
/obj/item/implant
|
||||
name = "implant"
|
||||
icon = 'icons/obj/implants.dmi'
|
||||
@@ -95,3 +96,102 @@
|
||||
/obj/item/implant/dropped(mob/user)
|
||||
. = 1
|
||||
..()
|
||||
=======
|
||||
/obj/item/implant
|
||||
name = "implant"
|
||||
icon = 'icons/obj/implants.dmi'
|
||||
icon_state = "generic" //Shows up as the action button icon
|
||||
actions_types = list(/datum/action/item_action/hands_free/activate)
|
||||
var/activated = 1 //1 for implant types that can be activated, 0 for ones that are "always on" like mindshield implants
|
||||
var/mob/living/imp_in = null
|
||||
item_color = "b"
|
||||
var/allow_multiple = FALSE
|
||||
var/uses = -1
|
||||
flags_1 = DROPDEL_1
|
||||
|
||||
|
||||
/obj/item/implant/proc/trigger(emote, mob/living/carbon/source)
|
||||
return
|
||||
|
||||
/obj/item/implant/proc/activate()
|
||||
return
|
||||
|
||||
/obj/item/implant/ui_action_click()
|
||||
activate("action_button")
|
||||
|
||||
/obj/item/implant/proc/can_be_implanted_in(mob/living/target) // for human-only and other special requirements
|
||||
return TRUE
|
||||
|
||||
/mob/living/proc/can_be_implanted()
|
||||
return TRUE
|
||||
|
||||
/mob/living/silicon/can_be_implanted()
|
||||
return FALSE
|
||||
|
||||
/mob/living/simple_animal/can_be_implanted()
|
||||
return healable //Applies to robots and most non-organics, exceptions can override.
|
||||
|
||||
|
||||
|
||||
//What does the implant do upon injection?
|
||||
//return 1 if the implant injects
|
||||
//return 0 if there is no room for implant / it fails
|
||||
/obj/item/implant/proc/implant(mob/living/target, mob/user, silent = 0)
|
||||
LAZYINITLIST(target.implants)
|
||||
if(!target.can_be_implanted() || !can_be_implanted_in(target))
|
||||
return 0
|
||||
for(var/X in target.implants)
|
||||
if(istype(X, type))
|
||||
var/obj/item/implant/imp_e = X
|
||||
if(!allow_multiple)
|
||||
if(imp_e.uses < initial(imp_e.uses)*2)
|
||||
if(uses == -1)
|
||||
imp_e.uses = -1
|
||||
else
|
||||
imp_e.uses = min(imp_e.uses + uses, initial(imp_e.uses)*2)
|
||||
qdel(src)
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
forceMove(target)
|
||||
imp_in = target
|
||||
target.implants += src
|
||||
if(activated)
|
||||
for(var/X in actions)
|
||||
var/datum/action/A = X
|
||||
A.Grant(target)
|
||||
if(ishuman(target))
|
||||
var/mob/living/carbon/human/H = target
|
||||
H.sec_hud_set_implants()
|
||||
|
||||
if(user)
|
||||
add_logs(user, target, "implanted", object="[name]")
|
||||
|
||||
return 1
|
||||
|
||||
/obj/item/implant/proc/removed(mob/living/source, silent = 0, special = 0)
|
||||
moveToNullspace()
|
||||
imp_in = null
|
||||
source.implants -= src
|
||||
for(var/X in actions)
|
||||
var/datum/action/A = X
|
||||
A.Grant(source)
|
||||
if(ishuman(source))
|
||||
var/mob/living/carbon/human/H = source
|
||||
H.sec_hud_set_implants()
|
||||
|
||||
return 1
|
||||
|
||||
/obj/item/implant/Destroy()
|
||||
if(imp_in)
|
||||
removed(imp_in)
|
||||
return ..()
|
||||
|
||||
/obj/item/implant/proc/get_data()
|
||||
return "No information available"
|
||||
|
||||
/obj/item/implant/dropped(mob/user)
|
||||
. = 1
|
||||
..()
|
||||
>>>>>>> a162837... Replaces a bunch of loc assignments with forcemoves and moves to nullspace (#33465)
|
||||
|
||||
@@ -220,7 +220,7 @@
|
||||
return
|
||||
if(!isturf(src.loc))
|
||||
var/atom/target = src.loc
|
||||
loc = target.loc
|
||||
forceMove(target.loc)
|
||||
consume_everything(target)
|
||||
else
|
||||
var/turf/T = get_turf(src)
|
||||
|
||||
@@ -216,7 +216,7 @@
|
||||
if(!src.tank)
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You detach \the [thetank] from \the [src].</span>")
|
||||
src.tank.loc = get_turf(user)
|
||||
src.tank.forceMove(user.drop_location())
|
||||
user.put_in_hands(tank)
|
||||
src.tank = null
|
||||
if(!removing)
|
||||
@@ -265,7 +265,7 @@
|
||||
/obj/item/pneumatic_cannon/pie/Initialize()
|
||||
. = ..()
|
||||
allowed_typecache = pie_typecache
|
||||
|
||||
|
||||
/obj/item/pneumatic_cannon/pie/selfcharge
|
||||
automatic = TRUE
|
||||
selfcharge = TRUE
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
/obj/item/target/Move()
|
||||
..()
|
||||
if(pinnedLoc)
|
||||
pinnedLoc.loc = loc
|
||||
pinnedLoc.forceMove(loc)
|
||||
|
||||
/obj/item/target/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/weldingtool))
|
||||
|
||||
@@ -199,7 +199,7 @@
|
||||
else
|
||||
if(S.pulledby)
|
||||
S.pulledby.stop_pulling()
|
||||
S.loc = src
|
||||
S.forceMove(src)
|
||||
|
||||
orient2hud(usr)
|
||||
if(usr.s_active)
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
on = FALSE
|
||||
to_chat(user, "<span class='warning'>You need a free hand to hold the mister!</span>")
|
||||
return
|
||||
noz.loc = user
|
||||
noz.forceMove(user)
|
||||
else
|
||||
//Remove from their hands and put back "into" the tank
|
||||
remove_noz()
|
||||
@@ -124,7 +124,7 @@
|
||||
if(check_tank_exists(parent_tank, src))
|
||||
tank = parent_tank
|
||||
reagents = tank.reagents //This mister is really just a proxy for the tank's reagents
|
||||
loc = tank
|
||||
forceMove(tank)
|
||||
return
|
||||
|
||||
/obj/item/reagent_containers/spray/mister/dropped(mob/user)
|
||||
@@ -146,7 +146,7 @@
|
||||
/obj/item/reagent_containers/spray/mister/Move()
|
||||
..()
|
||||
if(loc != tank.loc)
|
||||
loc = tank.loc
|
||||
forceMove(tank.loc)
|
||||
|
||||
/obj/item/reagent_containers/spray/mister/afterattack(obj/target, mob/user, proximity)
|
||||
if(target.loc == loc) //Safety check so you don't fill your mister with mutagen or something and then blast yourself in the face with it
|
||||
|
||||
Reference in New Issue
Block a user