mirror of
https://github.com/KabKebab/GS13.git
synced 2026-07-15 09:57:49 +01:00
Merge pull request #9983 from Ghommie/Ghommie-cit408
refactoring altclick interaction to allow parent calls without forcing the turf contents stat menu open.
This commit is contained in:
+8
-3
@@ -114,7 +114,8 @@
|
||||
/mob/living/silicon/ai/CtrlClickOn(var/atom/A)
|
||||
A.AICtrlClick(src)
|
||||
/mob/living/silicon/ai/AltClickOn(var/atom/A)
|
||||
A.AIAltClick(src)
|
||||
if(!A.AIAltClick(src))
|
||||
altclick_listed_turf(A)
|
||||
|
||||
/*
|
||||
The following criminally helpful code is just the previous code cleaned up;
|
||||
@@ -125,9 +126,10 @@
|
||||
/* Atom Procs */
|
||||
/atom/proc/AICtrlClick()
|
||||
return
|
||||
|
||||
/atom/proc/AIAltClick(mob/living/silicon/ai/user)
|
||||
AltClick(user)
|
||||
return
|
||||
return AltClick(user)
|
||||
|
||||
/atom/proc/AIShiftClick()
|
||||
return
|
||||
/atom/proc/AICtrlShiftClick()
|
||||
@@ -151,6 +153,7 @@
|
||||
shock_perm(usr)
|
||||
else
|
||||
shock_restore(usr)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/door/airlock/AIShiftClick() // Opens and closes doors!
|
||||
if(obj_flags & EMAGGED)
|
||||
@@ -185,10 +188,12 @@
|
||||
return
|
||||
toggle_on()
|
||||
add_fingerprint(usr)
|
||||
return TRUE
|
||||
|
||||
/* Holopads */
|
||||
/obj/machinery/holopad/AIAltClick(mob/living/silicon/ai/user)
|
||||
hangup_all_calls()
|
||||
return TRUE
|
||||
|
||||
//
|
||||
// Override TurfAdjacent for AltClicking
|
||||
|
||||
+518
-520
File diff suppressed because it is too large
Load Diff
+174
-176
@@ -1,176 +1,174 @@
|
||||
/*
|
||||
Cyborg ClickOn()
|
||||
|
||||
Cyborgs have no range restriction on attack_robot(), because it is basically an AI click.
|
||||
However, they do have a range restriction on item use, so they cannot do without the
|
||||
adjacency code.
|
||||
*/
|
||||
|
||||
/mob/living/silicon/robot/ClickOn(var/atom/A, var/params)
|
||||
if(world.time <= next_click)
|
||||
return
|
||||
next_click = world.time + 1
|
||||
|
||||
if(check_click_intercept(params,A))
|
||||
return
|
||||
|
||||
if(stat || lockcharge || IsKnockdown() || IsStun() || IsUnconscious())
|
||||
return
|
||||
|
||||
var/list/modifiers = params2list(params)
|
||||
if(modifiers["shift"] && modifiers["ctrl"])
|
||||
CtrlShiftClickOn(A)
|
||||
return
|
||||
if(modifiers["shift"] && modifiers["middle"])
|
||||
ShiftMiddleClickOn(A)
|
||||
return
|
||||
if(modifiers["middle"])
|
||||
MiddleClickOn(A)
|
||||
return
|
||||
if(modifiers["shift"])
|
||||
ShiftClickOn(A)
|
||||
return
|
||||
if(modifiers["alt"]) // alt and alt-gr (rightalt)
|
||||
AltClickOn(A)
|
||||
return
|
||||
if(modifiers["ctrl"])
|
||||
CtrlClickOn(A)
|
||||
return
|
||||
|
||||
if(next_move >= world.time)
|
||||
return
|
||||
|
||||
face_atom(A) // change direction to face what you clicked on
|
||||
|
||||
/*
|
||||
cyborg restrained() currently does nothing
|
||||
if(restrained())
|
||||
RestrainedClickOn(A)
|
||||
return
|
||||
*/
|
||||
if(aicamera.in_camera_mode) //Cyborg picture taking
|
||||
aicamera.camera_mode_off()
|
||||
aicamera.captureimage(A, usr)
|
||||
return
|
||||
|
||||
var/obj/item/W = get_active_held_item()
|
||||
|
||||
if(!W && get_dist(src,A) <= interaction_range)
|
||||
A.attack_robot(src)
|
||||
return
|
||||
|
||||
if(W)
|
||||
// buckled cannot prevent machine interlinking but stops arm movement
|
||||
if( buckled || incapacitated())
|
||||
return
|
||||
|
||||
if(W == A)
|
||||
W.attack_self(src)
|
||||
return
|
||||
|
||||
// cyborgs are prohibited from using storage items so we can I think safely remove (A.loc in contents)
|
||||
if(A == loc || (A in loc) || (A in contents))
|
||||
W.melee_attack_chain(src, A, params)
|
||||
return
|
||||
|
||||
if(!isturf(loc))
|
||||
return
|
||||
|
||||
// cyborgs are prohibited from using storage items so we can I think safely remove (A.loc && isturf(A.loc.loc))
|
||||
if(isturf(A) || isturf(A.loc))
|
||||
if(A.Adjacent(src)) // see adjacent.dm
|
||||
W.melee_attack_chain(src, A, params)
|
||||
return
|
||||
else
|
||||
W.afterattack(A, src, 0, params)
|
||||
return
|
||||
|
||||
//Middle click cycles through selected modules.
|
||||
/mob/living/silicon/robot/MiddleClickOn(atom/A)
|
||||
cycle_modules()
|
||||
return
|
||||
|
||||
//Give cyborgs hotkey clicks without breaking existing uses of hotkey clicks
|
||||
// for non-doors/apcs
|
||||
/mob/living/silicon/robot/CtrlShiftClickOn(atom/A)
|
||||
A.BorgCtrlShiftClick(src)
|
||||
/mob/living/silicon/robot/ShiftClickOn(atom/A)
|
||||
A.BorgShiftClick(src)
|
||||
/mob/living/silicon/robot/CtrlClickOn(atom/A)
|
||||
A.BorgCtrlClick(src)
|
||||
/mob/living/silicon/robot/AltClickOn(atom/A)
|
||||
A.BorgAltClick(src)
|
||||
|
||||
/atom/proc/BorgCtrlShiftClick(mob/living/silicon/robot/user) //forward to human click if not overridden
|
||||
CtrlShiftClick(user)
|
||||
|
||||
/obj/machinery/door/airlock/BorgCtrlShiftClick(mob/living/silicon/robot/user) // Sets/Unsets Emergency Access Override Forwards to AI code.
|
||||
if(get_dist(src,user) <= user.interaction_range)
|
||||
AICtrlShiftClick()
|
||||
else
|
||||
..()
|
||||
|
||||
|
||||
/atom/proc/BorgShiftClick(mob/living/silicon/robot/user) //forward to human click if not overridden
|
||||
ShiftClick(user)
|
||||
|
||||
/obj/machinery/door/airlock/BorgShiftClick(mob/living/silicon/robot/user) // Opens and closes doors! Forwards to AI code.
|
||||
if(get_dist(src,user) <= user.interaction_range)
|
||||
AIShiftClick()
|
||||
else
|
||||
..()
|
||||
|
||||
|
||||
/atom/proc/BorgCtrlClick(mob/living/silicon/robot/user) //forward to human click if not overridden
|
||||
CtrlClick(user)
|
||||
|
||||
/obj/machinery/door/airlock/BorgCtrlClick(mob/living/silicon/robot/user) // Bolts doors. Forwards to AI code.
|
||||
if(get_dist(src,user) <= user.interaction_range)
|
||||
AICtrlClick()
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/machinery/power/apc/BorgCtrlClick(mob/living/silicon/robot/user) // turns off/on APCs. Forwards to AI code.
|
||||
if(get_dist(src,user) <= user.interaction_range)
|
||||
AICtrlClick()
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/machinery/turretid/BorgCtrlClick(mob/living/silicon/robot/user) //turret control on/off. Forwards to AI code.
|
||||
if(get_dist(src,user) <= user.interaction_range)
|
||||
AICtrlClick()
|
||||
else
|
||||
..()
|
||||
|
||||
/atom/proc/BorgAltClick(mob/living/silicon/robot/user)
|
||||
AltClick(user)
|
||||
return
|
||||
|
||||
/obj/machinery/door/airlock/BorgAltClick(mob/living/silicon/robot/user) // Eletrifies doors. Forwards to AI code.
|
||||
if(get_dist(src,user) <= user.interaction_range)
|
||||
AIAltClick()
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/machinery/turretid/BorgAltClick(mob/living/silicon/robot/user) //turret lethal on/off. Forwards to AI code.
|
||||
if(get_dist(src,user) <= user.interaction_range)
|
||||
AIAltClick()
|
||||
else
|
||||
..()
|
||||
|
||||
/*
|
||||
As with AI, these are not used in click code,
|
||||
because the code for robots is specific, not generic.
|
||||
|
||||
If you would like to add advanced features to robot
|
||||
clicks, you can do so here, but you will have to
|
||||
change attack_robot() above to the proper function
|
||||
*/
|
||||
/mob/living/silicon/robot/UnarmedAttack(atom/A)
|
||||
A.attack_robot(src)
|
||||
/mob/living/silicon/robot/RangedAttack(atom/A)
|
||||
A.attack_robot(src)
|
||||
|
||||
/atom/proc/attack_robot(mob/user)
|
||||
attack_ai(user)
|
||||
return
|
||||
/*
|
||||
Cyborg ClickOn()
|
||||
|
||||
Cyborgs have no range restriction on attack_robot(), because it is basically an AI click.
|
||||
However, they do have a range restriction on item use, so they cannot do without the
|
||||
adjacency code.
|
||||
*/
|
||||
|
||||
/mob/living/silicon/robot/ClickOn(var/atom/A, var/params)
|
||||
if(world.time <= next_click)
|
||||
return
|
||||
next_click = world.time + 1
|
||||
|
||||
if(check_click_intercept(params,A))
|
||||
return
|
||||
|
||||
if(stat || lockcharge || IsKnockdown() || IsStun() || IsUnconscious())
|
||||
return
|
||||
|
||||
var/list/modifiers = params2list(params)
|
||||
if(modifiers["shift"] && modifiers["ctrl"])
|
||||
CtrlShiftClickOn(A)
|
||||
return
|
||||
if(modifiers["shift"] && modifiers["middle"])
|
||||
ShiftMiddleClickOn(A)
|
||||
return
|
||||
if(modifiers["middle"])
|
||||
MiddleClickOn(A)
|
||||
return
|
||||
if(modifiers["shift"])
|
||||
ShiftClickOn(A)
|
||||
return
|
||||
if(modifiers["alt"]) // alt and alt-gr (rightalt)
|
||||
AltClickOn(A)
|
||||
return
|
||||
if(modifiers["ctrl"])
|
||||
CtrlClickOn(A)
|
||||
return
|
||||
|
||||
if(next_move >= world.time)
|
||||
return
|
||||
|
||||
face_atom(A) // change direction to face what you clicked on
|
||||
|
||||
/*
|
||||
cyborg restrained() currently does nothing
|
||||
if(restrained())
|
||||
RestrainedClickOn(A)
|
||||
return
|
||||
*/
|
||||
if(aicamera.in_camera_mode) //Cyborg picture taking
|
||||
aicamera.camera_mode_off()
|
||||
aicamera.captureimage(A, usr)
|
||||
return
|
||||
|
||||
var/obj/item/W = get_active_held_item()
|
||||
|
||||
if(!W && get_dist(src,A) <= interaction_range)
|
||||
A.attack_robot(src)
|
||||
return
|
||||
|
||||
if(W)
|
||||
// buckled cannot prevent machine interlinking but stops arm movement
|
||||
if( buckled || incapacitated())
|
||||
return
|
||||
|
||||
if(W == A)
|
||||
W.attack_self(src)
|
||||
return
|
||||
|
||||
// cyborgs are prohibited from using storage items so we can I think safely remove (A.loc in contents)
|
||||
if(A == loc || (A in loc) || (A in contents))
|
||||
W.melee_attack_chain(src, A, params)
|
||||
return
|
||||
|
||||
if(!isturf(loc))
|
||||
return
|
||||
|
||||
// cyborgs are prohibited from using storage items so we can I think safely remove (A.loc && isturf(A.loc.loc))
|
||||
if(isturf(A) || isturf(A.loc))
|
||||
if(A.Adjacent(src)) // see adjacent.dm
|
||||
W.melee_attack_chain(src, A, params)
|
||||
return
|
||||
else
|
||||
W.afterattack(A, src, 0, params)
|
||||
return
|
||||
|
||||
//Middle click cycles through selected modules.
|
||||
/mob/living/silicon/robot/MiddleClickOn(atom/A)
|
||||
cycle_modules()
|
||||
return
|
||||
|
||||
//Give cyborgs hotkey clicks without breaking existing uses of hotkey clicks
|
||||
// for non-doors/apcs
|
||||
/mob/living/silicon/robot/CtrlShiftClickOn(atom/A)
|
||||
A.BorgCtrlShiftClick(src)
|
||||
/mob/living/silicon/robot/ShiftClickOn(atom/A)
|
||||
A.BorgShiftClick(src)
|
||||
/mob/living/silicon/robot/CtrlClickOn(atom/A)
|
||||
A.BorgCtrlClick(src)
|
||||
/mob/living/silicon/robot/AltClickOn(atom/A)
|
||||
if(!A.BorgAltClick(src))
|
||||
altclick_listed_turf(A)
|
||||
|
||||
/atom/proc/BorgCtrlShiftClick(mob/living/silicon/robot/user) //forward to human click if not overridden
|
||||
CtrlShiftClick(user)
|
||||
|
||||
/obj/machinery/door/airlock/BorgCtrlShiftClick(mob/living/silicon/robot/user) // Sets/Unsets Emergency Access Override Forwards to AI code.
|
||||
if(get_dist(src,user) <= user.interaction_range)
|
||||
AICtrlShiftClick()
|
||||
else
|
||||
..()
|
||||
|
||||
|
||||
/atom/proc/BorgShiftClick(mob/living/silicon/robot/user) //forward to human click if not overridden
|
||||
ShiftClick(user)
|
||||
|
||||
/obj/machinery/door/airlock/BorgShiftClick(mob/living/silicon/robot/user) // Opens and closes doors! Forwards to AI code.
|
||||
if(get_dist(src,user) <= user.interaction_range)
|
||||
AIShiftClick()
|
||||
else
|
||||
..()
|
||||
|
||||
|
||||
/atom/proc/BorgCtrlClick(mob/living/silicon/robot/user) //forward to human click if not overridden
|
||||
CtrlClick(user)
|
||||
|
||||
/obj/machinery/door/airlock/BorgCtrlClick(mob/living/silicon/robot/user) // Bolts doors. Forwards to AI code.
|
||||
if(get_dist(src,user) <= user.interaction_range)
|
||||
AICtrlClick()
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/machinery/power/apc/BorgCtrlClick(mob/living/silicon/robot/user) // turns off/on APCs. Forwards to AI code.
|
||||
if(get_dist(src,user) <= user.interaction_range)
|
||||
AICtrlClick()
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/machinery/turretid/BorgCtrlClick(mob/living/silicon/robot/user) //turret control on/off. Forwards to AI code.
|
||||
if(get_dist(src,user) <= user.interaction_range)
|
||||
AICtrlClick()
|
||||
else
|
||||
..()
|
||||
|
||||
/atom/proc/BorgAltClick(mob/living/silicon/robot/user)
|
||||
return AltClick(user)
|
||||
|
||||
/obj/machinery/door/airlock/BorgAltClick(mob/living/silicon/robot/user) // Eletrifies doors. Forwards to AI code.
|
||||
if(get_dist(src,user) <= user.interaction_range)
|
||||
return AIAltClick()
|
||||
return ..()
|
||||
|
||||
/obj/machinery/turretid/BorgAltClick(mob/living/silicon/robot/user) //turret lethal on/off. Forwards to AI code.
|
||||
if(get_dist(src,user) <= user.interaction_range)
|
||||
return AIAltClick()
|
||||
return ..()
|
||||
|
||||
/*
|
||||
As with AI, these are not used in click code,
|
||||
because the code for robots is specific, not generic.
|
||||
|
||||
If you would like to add advanced features to robot
|
||||
clicks, you can do so here, but you will have to
|
||||
change attack_robot() above to the proper function
|
||||
*/
|
||||
/mob/living/silicon/robot/UnarmedAttack(atom/A)
|
||||
A.attack_robot(src)
|
||||
/mob/living/silicon/robot/RangedAttack(atom/A)
|
||||
A.attack_robot(src)
|
||||
|
||||
/atom/proc/attack_robot(mob/user)
|
||||
attack_ai(user)
|
||||
return
|
||||
|
||||
@@ -125,6 +125,7 @@
|
||||
moved = FALSE
|
||||
user.update_action_buttons(TRUE)
|
||||
to_chat(user, "<span class='notice'>Action button positions have been reset.</span>")
|
||||
return TRUE
|
||||
|
||||
|
||||
/obj/screen/movable/action_button/hide_toggle/proc/InitialiseIcon(datum/hud/owner_hud)
|
||||
|
||||
+83
-83
@@ -1,83 +1,83 @@
|
||||
/mob/dead/observer/DblClickOn(var/atom/A, var/params)
|
||||
if(can_reenter_corpse && mind && mind.current)
|
||||
if(A == mind.current || (mind.current in A)) // double click your corpse or whatever holds it
|
||||
reenter_corpse() // (cloning scanner, body bag, closet, mech, etc)
|
||||
return // seems legit.
|
||||
|
||||
// Things you might plausibly want to follow
|
||||
if(ismovableatom(A))
|
||||
ManualFollow(A)
|
||||
|
||||
// Otherwise jump
|
||||
else if(A.loc)
|
||||
forceMove(get_turf(A))
|
||||
update_parallax_contents()
|
||||
|
||||
/mob/dead/observer/ClickOn(var/atom/A, var/params)
|
||||
if(check_click_intercept(params,A))
|
||||
return
|
||||
|
||||
var/list/modifiers = params2list(params)
|
||||
if(modifiers["shift"] && modifiers["middle"])
|
||||
ShiftMiddleClickOn(A)
|
||||
return
|
||||
if(modifiers["shift"] && modifiers["ctrl"])
|
||||
CtrlShiftClickOn(A)
|
||||
return
|
||||
if(modifiers["middle"])
|
||||
MiddleClickOn(A)
|
||||
return
|
||||
if(modifiers["shift"])
|
||||
ShiftClickOn(A)
|
||||
return
|
||||
if(modifiers["alt"])
|
||||
AltClickNoInteract(src, A)
|
||||
return
|
||||
if(modifiers["ctrl"])
|
||||
CtrlClickOn(A)
|
||||
return
|
||||
|
||||
if(world.time <= next_move)
|
||||
return
|
||||
// You are responsible for checking config.ghost_interaction when you override this function
|
||||
// Not all of them require checking, see below
|
||||
A.attack_ghost(src)
|
||||
|
||||
// Oh by the way this didn't work with old click code which is why clicking shit didn't spam you
|
||||
/atom/proc/attack_ghost(mob/dead/observer/user)
|
||||
if(SEND_SIGNAL(src, COMSIG_ATOM_ATTACK_GHOST, user) & COMPONENT_NO_ATTACK_HAND)
|
||||
return TRUE
|
||||
if(user.client)
|
||||
if(IsAdminGhost(user))
|
||||
attack_ai(user)
|
||||
else if(user.client.prefs.inquisitive_ghost)
|
||||
user.examinate(src)
|
||||
return FALSE
|
||||
|
||||
/mob/living/attack_ghost(mob/dead/observer/user)
|
||||
if(user.client && user.health_scan)
|
||||
healthscan(user, src, 1, TRUE)
|
||||
return ..()
|
||||
|
||||
// ---------------------------------------
|
||||
// And here are some good things for free:
|
||||
// Now you can click through portals, wormholes, gateways, and teleporters while observing. -Sayu
|
||||
|
||||
/obj/machinery/gateway/centerstation/attack_ghost(mob/user)
|
||||
if(awaygate)
|
||||
user.forceMove(awaygate.loc)
|
||||
else
|
||||
to_chat(user, "[src] has no destination.")
|
||||
return ..()
|
||||
|
||||
/obj/machinery/gateway/centeraway/attack_ghost(mob/user)
|
||||
if(stationgate)
|
||||
user.forceMove(stationgate.loc)
|
||||
else
|
||||
to_chat(user, "[src] has no destination.")
|
||||
return ..()
|
||||
|
||||
/obj/machinery/teleport/hub/attack_ghost(mob/user)
|
||||
if(power_station && power_station.engaged && power_station.teleporter_console && power_station.teleporter_console.target)
|
||||
user.forceMove(get_turf(power_station.teleporter_console.target))
|
||||
return ..()
|
||||
/mob/dead/observer/DblClickOn(var/atom/A, var/params)
|
||||
if(can_reenter_corpse && mind && mind.current)
|
||||
if(A == mind.current || (mind.current in A)) // double click your corpse or whatever holds it
|
||||
reenter_corpse() // (cloning scanner, body bag, closet, mech, etc)
|
||||
return // seems legit.
|
||||
|
||||
// Things you might plausibly want to follow
|
||||
if(ismovableatom(A))
|
||||
ManualFollow(A)
|
||||
|
||||
// Otherwise jump
|
||||
else if(A.loc)
|
||||
forceMove(get_turf(A))
|
||||
update_parallax_contents()
|
||||
|
||||
/mob/dead/observer/ClickOn(var/atom/A, var/params)
|
||||
if(check_click_intercept(params,A))
|
||||
return
|
||||
|
||||
var/list/modifiers = params2list(params)
|
||||
if(modifiers["shift"] && modifiers["middle"])
|
||||
ShiftMiddleClickOn(A)
|
||||
return
|
||||
if(modifiers["shift"] && modifiers["ctrl"])
|
||||
CtrlShiftClickOn(A)
|
||||
return
|
||||
if(modifiers["middle"])
|
||||
MiddleClickOn(A)
|
||||
return
|
||||
if(modifiers["shift"])
|
||||
ShiftClickOn(A)
|
||||
return
|
||||
if(modifiers["alt"])
|
||||
altclick_listed_turf(A)
|
||||
return
|
||||
if(modifiers["ctrl"])
|
||||
CtrlClickOn(A)
|
||||
return
|
||||
|
||||
if(world.time <= next_move)
|
||||
return
|
||||
// You are responsible for checking config.ghost_interaction when you override this function
|
||||
// Not all of them require checking, see below
|
||||
A.attack_ghost(src)
|
||||
|
||||
// Oh by the way this didn't work with old click code which is why clicking shit didn't spam you
|
||||
/atom/proc/attack_ghost(mob/dead/observer/user)
|
||||
if(SEND_SIGNAL(src, COMSIG_ATOM_ATTACK_GHOST, user) & COMPONENT_NO_ATTACK_HAND)
|
||||
return TRUE
|
||||
if(user.client)
|
||||
if(IsAdminGhost(user))
|
||||
attack_ai(user)
|
||||
else if(user.client.prefs.inquisitive_ghost)
|
||||
user.examinate(src)
|
||||
return FALSE
|
||||
|
||||
/mob/living/attack_ghost(mob/dead/observer/user)
|
||||
if(user.client && user.health_scan)
|
||||
healthscan(user, src, 1, TRUE)
|
||||
return ..()
|
||||
|
||||
// ---------------------------------------
|
||||
// And here are some good things for free:
|
||||
// Now you can click through portals, wormholes, gateways, and teleporters while observing. -Sayu
|
||||
|
||||
/obj/machinery/gateway/centerstation/attack_ghost(mob/user)
|
||||
if(awaygate)
|
||||
user.forceMove(awaygate.loc)
|
||||
else
|
||||
to_chat(user, "[src] has no destination.")
|
||||
return ..()
|
||||
|
||||
/obj/machinery/gateway/centeraway/attack_ghost(mob/user)
|
||||
if(stationgate)
|
||||
user.forceMove(stationgate.loc)
|
||||
else
|
||||
to_chat(user, "[src] has no destination.")
|
||||
return ..()
|
||||
|
||||
/obj/machinery/teleport/hub/attack_ghost(mob/user)
|
||||
if(power_station && power_station.engaged && power_station.teleporter_console && power_station.teleporter_console.target)
|
||||
user.forceMove(get_turf(power_station.teleporter_console.target))
|
||||
return ..()
|
||||
|
||||
@@ -106,6 +106,7 @@
|
||||
if(!can_be_rotated.Invoke(user, rotation) || !can_user_rotate.Invoke(user, rotation))
|
||||
return
|
||||
BaseRot(user, rotation)
|
||||
return TRUE
|
||||
|
||||
/datum/component/simple_rotation/proc/WrenchRot(datum/source, obj/item/I, mob/living/user)
|
||||
if(!can_be_rotated.Invoke(user,default_rotation_direction) || !can_user_rotate.Invoke(user,default_rotation_direction))
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -181,12 +181,14 @@
|
||||
open_machine()
|
||||
|
||||
/obj/machinery/sleeper/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(!user.canUseTopic(src, !issilicon(user)))
|
||||
return
|
||||
if(state_open)
|
||||
close_machine()
|
||||
else
|
||||
open_machine()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/sleeper/examine(mob/user)
|
||||
. = ..()
|
||||
|
||||
@@ -132,8 +132,8 @@
|
||||
..()
|
||||
if(!user.canUseTopic(src))
|
||||
return
|
||||
else
|
||||
eject_part(user)
|
||||
eject_part(user)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/aug_manipulator/power_change()
|
||||
..()
|
||||
|
||||
@@ -1,143 +1,144 @@
|
||||
/obj/structure/frame/computer
|
||||
name = "computer frame"
|
||||
icon_state = "0"
|
||||
state = 0
|
||||
|
||||
/obj/structure/frame/computer/attackby(obj/item/P, mob/user, params)
|
||||
add_fingerprint(user)
|
||||
switch(state)
|
||||
if(0)
|
||||
if(istype(P, /obj/item/wrench))
|
||||
to_chat(user, "<span class='notice'>You start wrenching the frame into place...</span>")
|
||||
if(P.use_tool(src, user, 20, volume=50))
|
||||
to_chat(user, "<span class='notice'>You wrench the frame into place.</span>")
|
||||
setAnchored(TRUE)
|
||||
state = 1
|
||||
return
|
||||
if(istype(P, /obj/item/weldingtool))
|
||||
if(!P.tool_start_check(user, amount=0))
|
||||
return
|
||||
|
||||
to_chat(user, "<span class='notice'>You start deconstructing the frame...</span>")
|
||||
if(P.use_tool(src, user, 20, volume=50))
|
||||
to_chat(user, "<span class='notice'>You deconstruct the frame.</span>")
|
||||
var/obj/item/stack/sheet/metal/M = new (drop_location(), 5)
|
||||
M.add_fingerprint(user)
|
||||
qdel(src)
|
||||
return
|
||||
if(1)
|
||||
if(istype(P, /obj/item/wrench))
|
||||
to_chat(user, "<span class='notice'>You start to unfasten the frame...</span>")
|
||||
if(P.use_tool(src, user, 20, volume=50))
|
||||
to_chat(user, "<span class='notice'>You unfasten the frame.</span>")
|
||||
setAnchored(FALSE)
|
||||
state = 0
|
||||
return
|
||||
if(istype(P, /obj/item/circuitboard/computer) && !circuit)
|
||||
if(!user.transferItemToLoc(P, src))
|
||||
return
|
||||
playsound(src, 'sound/items/deconstruct.ogg', 50, 1)
|
||||
to_chat(user, "<span class='notice'>You place [P] inside the frame.</span>")
|
||||
icon_state = "1"
|
||||
circuit = P
|
||||
circuit.add_fingerprint(user)
|
||||
return
|
||||
|
||||
else if(istype(P, /obj/item/circuitboard) && !circuit)
|
||||
to_chat(user, "<span class='warning'>This frame does not accept circuit boards of this type!</span>")
|
||||
return
|
||||
if(istype(P, /obj/item/screwdriver) && circuit)
|
||||
P.play_tool_sound(src)
|
||||
to_chat(user, "<span class='notice'>You screw [circuit] into place.</span>")
|
||||
state = 2
|
||||
icon_state = "2"
|
||||
return
|
||||
if(istype(P, /obj/item/crowbar) && circuit)
|
||||
P.play_tool_sound(src)
|
||||
to_chat(user, "<span class='notice'>You remove [circuit].</span>")
|
||||
state = 1
|
||||
icon_state = "0"
|
||||
circuit.forceMove(drop_location())
|
||||
circuit.add_fingerprint(user)
|
||||
circuit = null
|
||||
return
|
||||
if(2)
|
||||
if(istype(P, /obj/item/screwdriver) && circuit)
|
||||
P.play_tool_sound(src)
|
||||
to_chat(user, "<span class='notice'>You unfasten the circuit board.</span>")
|
||||
state = 1
|
||||
icon_state = "1"
|
||||
return
|
||||
if(istype(P, /obj/item/stack/cable_coil))
|
||||
if(!P.tool_start_check(user, amount=5))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You start adding cables to the frame...</span>")
|
||||
if(P.use_tool(src, user, 20, volume=50, amount=5))
|
||||
if(state != 2)
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You add cables to the frame.</span>")
|
||||
state = 3
|
||||
icon_state = "3"
|
||||
return
|
||||
if(3)
|
||||
if(istype(P, /obj/item/wirecutters))
|
||||
P.play_tool_sound(src)
|
||||
to_chat(user, "<span class='notice'>You remove the cables.</span>")
|
||||
state = 2
|
||||
icon_state = "2"
|
||||
var/obj/item/stack/cable_coil/A = new (drop_location(), 5)
|
||||
A.add_fingerprint(user)
|
||||
return
|
||||
|
||||
if(istype(P, /obj/item/stack/sheet/glass))
|
||||
if(!P.tool_start_check(user, amount=2))
|
||||
return
|
||||
playsound(src, 'sound/items/deconstruct.ogg', 50, 1)
|
||||
to_chat(user, "<span class='notice'>You start to put in the glass panel...</span>")
|
||||
if(P.use_tool(src, user, 20, amount=2))
|
||||
if(state != 3)
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You put in the glass panel.</span>")
|
||||
state = 4
|
||||
src.icon_state = "4"
|
||||
return
|
||||
if(4)
|
||||
if(istype(P, /obj/item/crowbar))
|
||||
P.play_tool_sound(src)
|
||||
to_chat(user, "<span class='notice'>You remove the glass panel.</span>")
|
||||
state = 3
|
||||
icon_state = "3"
|
||||
var/obj/item/stack/sheet/glass/G = new(drop_location(), 2)
|
||||
G.add_fingerprint(user)
|
||||
return
|
||||
if(istype(P, /obj/item/screwdriver))
|
||||
P.play_tool_sound(src)
|
||||
to_chat(user, "<span class='notice'>You connect the monitor.</span>")
|
||||
var/obj/B = new circuit.build_path (loc, circuit)
|
||||
B.setDir(dir)
|
||||
transfer_fingerprints_to(B)
|
||||
qdel(src)
|
||||
return
|
||||
if(user.a_intent == INTENT_HARM)
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/structure/frame/computer/deconstruct(disassembled = TRUE)
|
||||
if(!(flags_1 & NODECONSTRUCT_1))
|
||||
if(state == 4)
|
||||
new /obj/item/shard(drop_location())
|
||||
new /obj/item/shard(drop_location())
|
||||
if(state >= 3)
|
||||
new /obj/item/stack/cable_coil(drop_location(), 5)
|
||||
..()
|
||||
|
||||
/obj/structure/frame/computer/AltClick(mob/user)
|
||||
..()
|
||||
if(!isliving(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||
return
|
||||
|
||||
if(anchored)
|
||||
to_chat(usr, "<span class='warning'>You must unwrench [src] before rotating it!</span>")
|
||||
return
|
||||
|
||||
setDir(turn(dir, -90))
|
||||
/obj/structure/frame/computer
|
||||
name = "computer frame"
|
||||
icon_state = "0"
|
||||
state = 0
|
||||
|
||||
/obj/structure/frame/computer/attackby(obj/item/P, mob/user, params)
|
||||
add_fingerprint(user)
|
||||
switch(state)
|
||||
if(0)
|
||||
if(istype(P, /obj/item/wrench))
|
||||
to_chat(user, "<span class='notice'>You start wrenching the frame into place...</span>")
|
||||
if(P.use_tool(src, user, 20, volume=50))
|
||||
to_chat(user, "<span class='notice'>You wrench the frame into place.</span>")
|
||||
setAnchored(TRUE)
|
||||
state = 1
|
||||
return
|
||||
if(istype(P, /obj/item/weldingtool))
|
||||
if(!P.tool_start_check(user, amount=0))
|
||||
return
|
||||
|
||||
to_chat(user, "<span class='notice'>You start deconstructing the frame...</span>")
|
||||
if(P.use_tool(src, user, 20, volume=50))
|
||||
to_chat(user, "<span class='notice'>You deconstruct the frame.</span>")
|
||||
var/obj/item/stack/sheet/metal/M = new (drop_location(), 5)
|
||||
M.add_fingerprint(user)
|
||||
qdel(src)
|
||||
return
|
||||
if(1)
|
||||
if(istype(P, /obj/item/wrench))
|
||||
to_chat(user, "<span class='notice'>You start to unfasten the frame...</span>")
|
||||
if(P.use_tool(src, user, 20, volume=50))
|
||||
to_chat(user, "<span class='notice'>You unfasten the frame.</span>")
|
||||
setAnchored(FALSE)
|
||||
state = 0
|
||||
return
|
||||
if(istype(P, /obj/item/circuitboard/computer) && !circuit)
|
||||
if(!user.transferItemToLoc(P, src))
|
||||
return
|
||||
playsound(src, 'sound/items/deconstruct.ogg', 50, 1)
|
||||
to_chat(user, "<span class='notice'>You place [P] inside the frame.</span>")
|
||||
icon_state = "1"
|
||||
circuit = P
|
||||
circuit.add_fingerprint(user)
|
||||
return
|
||||
|
||||
else if(istype(P, /obj/item/circuitboard) && !circuit)
|
||||
to_chat(user, "<span class='warning'>This frame does not accept circuit boards of this type!</span>")
|
||||
return
|
||||
if(istype(P, /obj/item/screwdriver) && circuit)
|
||||
P.play_tool_sound(src)
|
||||
to_chat(user, "<span class='notice'>You screw [circuit] into place.</span>")
|
||||
state = 2
|
||||
icon_state = "2"
|
||||
return
|
||||
if(istype(P, /obj/item/crowbar) && circuit)
|
||||
P.play_tool_sound(src)
|
||||
to_chat(user, "<span class='notice'>You remove [circuit].</span>")
|
||||
state = 1
|
||||
icon_state = "0"
|
||||
circuit.forceMove(drop_location())
|
||||
circuit.add_fingerprint(user)
|
||||
circuit = null
|
||||
return
|
||||
if(2)
|
||||
if(istype(P, /obj/item/screwdriver) && circuit)
|
||||
P.play_tool_sound(src)
|
||||
to_chat(user, "<span class='notice'>You unfasten the circuit board.</span>")
|
||||
state = 1
|
||||
icon_state = "1"
|
||||
return
|
||||
if(istype(P, /obj/item/stack/cable_coil))
|
||||
if(!P.tool_start_check(user, amount=5))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You start adding cables to the frame...</span>")
|
||||
if(P.use_tool(src, user, 20, volume=50, amount=5))
|
||||
if(state != 2)
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You add cables to the frame.</span>")
|
||||
state = 3
|
||||
icon_state = "3"
|
||||
return
|
||||
if(3)
|
||||
if(istype(P, /obj/item/wirecutters))
|
||||
P.play_tool_sound(src)
|
||||
to_chat(user, "<span class='notice'>You remove the cables.</span>")
|
||||
state = 2
|
||||
icon_state = "2"
|
||||
var/obj/item/stack/cable_coil/A = new (drop_location(), 5)
|
||||
A.add_fingerprint(user)
|
||||
return
|
||||
|
||||
if(istype(P, /obj/item/stack/sheet/glass))
|
||||
if(!P.tool_start_check(user, amount=2))
|
||||
return
|
||||
playsound(src, 'sound/items/deconstruct.ogg', 50, 1)
|
||||
to_chat(user, "<span class='notice'>You start to put in the glass panel...</span>")
|
||||
if(P.use_tool(src, user, 20, amount=2))
|
||||
if(state != 3)
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You put in the glass panel.</span>")
|
||||
state = 4
|
||||
src.icon_state = "4"
|
||||
return
|
||||
if(4)
|
||||
if(istype(P, /obj/item/crowbar))
|
||||
P.play_tool_sound(src)
|
||||
to_chat(user, "<span class='notice'>You remove the glass panel.</span>")
|
||||
state = 3
|
||||
icon_state = "3"
|
||||
var/obj/item/stack/sheet/glass/G = new(drop_location(), 2)
|
||||
G.add_fingerprint(user)
|
||||
return
|
||||
if(istype(P, /obj/item/screwdriver))
|
||||
P.play_tool_sound(src)
|
||||
to_chat(user, "<span class='notice'>You connect the monitor.</span>")
|
||||
var/obj/B = new circuit.build_path (loc, circuit)
|
||||
B.setDir(dir)
|
||||
transfer_fingerprints_to(B)
|
||||
qdel(src)
|
||||
return
|
||||
if(user.a_intent == INTENT_HARM)
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/structure/frame/computer/deconstruct(disassembled = TRUE)
|
||||
if(!(flags_1 & NODECONSTRUCT_1))
|
||||
if(state == 4)
|
||||
new /obj/item/shard(drop_location())
|
||||
new /obj/item/shard(drop_location())
|
||||
if(state >= 3)
|
||||
new /obj/item/stack/cable_coil(drop_location(), 5)
|
||||
..()
|
||||
|
||||
/obj/structure/frame/computer/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(!isliving(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||
return
|
||||
|
||||
if(anchored)
|
||||
to_chat(usr, "<span class='warning'>You must unwrench [src] before rotating it!</span>")
|
||||
return TRUE
|
||||
|
||||
setDir(turn(dir, -90))
|
||||
return TRUE
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,7 +5,7 @@
|
||||
if(contained_id)
|
||||
contained_id.forceMove(get_turf(src))
|
||||
return ..()
|
||||
|
||||
|
||||
|
||||
/obj/machinery/computer/prisoner/examine(mob/user)
|
||||
. = ..()
|
||||
@@ -15,8 +15,9 @@
|
||||
|
||||
|
||||
/obj/machinery/computer/prisoner/AltClick(mob/user)
|
||||
..()
|
||||
id_eject(user)
|
||||
return ..()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/computer/prisoner/proc/id_insert(mob/user, obj/item/card/id/prisoner/P)
|
||||
if(istype(P))
|
||||
|
||||
@@ -115,8 +115,10 @@
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/defibrillator_mount/AltClick(mob/living/carbon/user)
|
||||
. = ..()
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
. = TRUE
|
||||
if(!defib)
|
||||
to_chat(user, "<span class='warning'>It'd be hard to remove a defib unit from a mount that has none.</span>")
|
||||
return
|
||||
|
||||
@@ -152,9 +152,11 @@
|
||||
. += "<span class='notice'>Alt-click to toggle modes.</span>"
|
||||
|
||||
/obj/item/grenade/barrier/AltClick(mob/living/carbon/user)
|
||||
. = ..()
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
toggle_mode(user)
|
||||
return TRUE
|
||||
|
||||
/obj/item/grenade/barrier/proc/toggle_mode(mob/user)
|
||||
switch(mode)
|
||||
|
||||
@@ -97,8 +97,10 @@
|
||||
do_the_dishes(TRUE)
|
||||
|
||||
/obj/machinery/dish_drive/AltClick(mob/living/user)
|
||||
. = ..()
|
||||
if(user.canUseTopic(src, !issilicon(user)))
|
||||
do_the_dishes(TRUE)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/dish_drive/proc/do_the_dishes(manual)
|
||||
if(!contents.len)
|
||||
|
||||
@@ -143,6 +143,13 @@
|
||||
/obj/machinery/dna_scannernew/interact(mob/user)
|
||||
toggle_open(user)
|
||||
|
||||
/obj/machinery/dna_scannernew/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(!user.canUseTopic(src, !issilicon(user)))
|
||||
return
|
||||
interact(user)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/dna_scannernew/MouseDrop_T(mob/target, mob/user)
|
||||
if(user.stat || user.lying || !Adjacent(user) || !user.Adjacent(target) || !iscarbon(target) || !user.IsAdvancedToolUser())
|
||||
return
|
||||
|
||||
@@ -51,10 +51,12 @@
|
||||
open_machine()
|
||||
|
||||
/obj/machinery/harvester/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(harvesting || !user || !isliving(user) || state_open)
|
||||
return
|
||||
if(can_harvest())
|
||||
start_harvest()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/harvester/proc/can_harvest()
|
||||
if(!powered(EQUIP) || state_open || !occupant || !iscarbon(occupant))
|
||||
|
||||
@@ -1,282 +1,284 @@
|
||||
/obj/machinery/washing_machine
|
||||
name = "washing machine"
|
||||
desc = "Gets rid of those pesky bloodstains, or your money back!"
|
||||
icon = 'icons/obj/machines/washing_machine.dmi'
|
||||
icon_state = "wm_1_0"
|
||||
density = TRUE
|
||||
state_open = TRUE
|
||||
var/busy = FALSE
|
||||
var/bloody_mess = 0
|
||||
var/has_corgi = 0
|
||||
var/obj/item/color_source
|
||||
var/max_wash_capacity = 5
|
||||
|
||||
/obj/machinery/washing_machine/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>Alt-click it to start a wash cycle.</span>"
|
||||
|
||||
/obj/machinery/washing_machine/AltClick(mob/user)
|
||||
if(!user.canUseTopic(src))
|
||||
return
|
||||
|
||||
if(busy)
|
||||
return
|
||||
|
||||
if(state_open)
|
||||
to_chat(user, "<span class='notice'>Close the door first</span>")
|
||||
return
|
||||
|
||||
if(bloody_mess)
|
||||
to_chat(user, "<span class='warning'>[src] must be cleaned up first.</span>")
|
||||
return
|
||||
|
||||
if(has_corgi)
|
||||
bloody_mess = 1
|
||||
|
||||
busy = TRUE
|
||||
update_icon()
|
||||
addtimer(CALLBACK(src, .proc/wash_cycle), 200)
|
||||
START_PROCESSING(SSfastprocess, src)
|
||||
|
||||
/obj/machinery/washing_machine/process()
|
||||
if (!busy)
|
||||
animate(src, transform=matrix(), time=2)
|
||||
return PROCESS_KILL
|
||||
if (anchored)
|
||||
if (prob(5))
|
||||
var/matrix/M = new
|
||||
M.Translate(rand(-1, 1), rand(0, 1))
|
||||
animate(src, transform=M, time=1)
|
||||
animate(transform=matrix(), time=1)
|
||||
else
|
||||
if (prob(1))
|
||||
step(src, pick(GLOB.cardinals))
|
||||
var/matrix/M = new
|
||||
M.Translate(rand(-3, 3), rand(-1, 3))
|
||||
animate(src, transform=M, time=2)
|
||||
|
||||
/obj/machinery/washing_machine/clean_blood()
|
||||
..()
|
||||
if(!busy)
|
||||
bloody_mess = FALSE
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/washing_machine/proc/wash_cycle()
|
||||
for(var/X in contents)
|
||||
var/atom/movable/AM = X
|
||||
SEND_SIGNAL(AM, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK)
|
||||
AM.clean_blood()
|
||||
AM.machine_wash(src)
|
||||
|
||||
busy = FALSE
|
||||
if(color_source)
|
||||
qdel(color_source)
|
||||
color_source = null
|
||||
update_icon()
|
||||
|
||||
|
||||
//what happens to this object when washed inside a washing machine
|
||||
/atom/movable/proc/machine_wash(obj/machinery/washing_machine/WM)
|
||||
return
|
||||
|
||||
/obj/item/stack/sheet/hairlesshide/machine_wash(obj/machinery/washing_machine/WM)
|
||||
new /obj/item/stack/sheet/wetleather(drop_location(), amount)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/clothing/suit/hooded/ian_costume/machine_wash(obj/machinery/washing_machine/WM)
|
||||
new /obj/item/reagent_containers/food/snacks/meat/slab/corgi(loc)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/paper/machine_wash(obj/machinery/washing_machine/WM)
|
||||
if(WM.color_source)
|
||||
if(istype(WM.color_source, /obj/item/toy/crayon))
|
||||
var/obj/item/toy/crayon/CR = WM.color_source
|
||||
add_atom_colour(CR.paint_color, WASHABLE_COLOUR_PRIORITY)
|
||||
|
||||
/obj/item/reagents_containers/rag/towel/machine_wash(obj/machinery/washing_machine/WM)
|
||||
if(WM.color_source)
|
||||
if(istype(WM.color_source, /obj/item/toy/crayon))
|
||||
var/obj/item/toy/crayon/CR = WM.color_source
|
||||
add_atom_colour(CR.paint_color, WASHABLE_COLOUR_PRIORITY)
|
||||
|
||||
/mob/living/simple_animal/pet/dog/corgi/machine_wash(obj/machinery/washing_machine/WM)
|
||||
gib()
|
||||
|
||||
/obj/item/clothing/under/color/machine_wash(obj/machinery/washing_machine/WM)
|
||||
jumpsuit_wash(WM)
|
||||
|
||||
/obj/item/clothing/under/rank/machine_wash(obj/machinery/washing_machine/WM)
|
||||
jumpsuit_wash(WM)
|
||||
|
||||
/obj/item/clothing/under/proc/jumpsuit_wash(obj/machinery/washing_machine/WM)
|
||||
if(WM.color_source)
|
||||
var/wash_color = WM.color_source.item_color
|
||||
var/obj/item/clothing/under/U
|
||||
for(var/T in typesof(/obj/item/clothing/under/color))
|
||||
var/obj/item/clothing/under/color/J = T
|
||||
if(wash_color == initial(J.item_color))
|
||||
U = J
|
||||
break
|
||||
if(!U)
|
||||
for(var/T in typesof(/obj/item/clothing/under/rank))
|
||||
var/obj/item/clothing/under/rank/R = T
|
||||
if(wash_color == initial(R.item_color))
|
||||
U = R
|
||||
break
|
||||
if(U)
|
||||
item_state = initial(U.item_state)
|
||||
icon_state = initial(U.icon_state)
|
||||
item_color = wash_color
|
||||
name = initial(U.name)
|
||||
desc = "The colors are a bit dodgy."
|
||||
can_adjust = initial(U.can_adjust)
|
||||
if(!can_adjust && adjusted) //we deadjust the uniform if it's now unadjustable
|
||||
toggle_jumpsuit_adjust()
|
||||
|
||||
/obj/item/clothing/gloves/color/machine_wash(obj/machinery/washing_machine/WM)
|
||||
if(WM.color_source)
|
||||
var/wash_color = WM.color_source.item_color
|
||||
for(var/T in typesof(/obj/item/clothing/gloves/color))
|
||||
var/obj/item/clothing/gloves/color/G = T
|
||||
if(wash_color == initial(G.item_color))
|
||||
item_state = initial(G.item_state)
|
||||
icon_state = initial(G.icon_state)
|
||||
item_color = wash_color
|
||||
name = initial(G.name)
|
||||
desc = "The colors are a bit dodgy."
|
||||
break
|
||||
|
||||
/obj/item/clothing/shoes/sneakers/machine_wash(obj/machinery/washing_machine/WM)
|
||||
if(chained)
|
||||
chained = 0
|
||||
slowdown = SHOES_SLOWDOWN
|
||||
new /obj/item/restraints/handcuffs(loc)
|
||||
if(WM.color_source)
|
||||
var/wash_color = WM.color_source.item_color
|
||||
for(var/T in typesof(/obj/item/clothing/shoes/sneakers))
|
||||
var/obj/item/clothing/shoes/sneakers/S = T
|
||||
if(wash_color == initial(S.item_color))
|
||||
icon_state = initial(S.icon_state)
|
||||
item_color = wash_color
|
||||
name = initial(S.name)
|
||||
desc = "The colors are a bit dodgy."
|
||||
break
|
||||
|
||||
/obj/item/bedsheet/machine_wash(obj/machinery/washing_machine/WM)
|
||||
if(WM.color_source)
|
||||
var/wash_color = WM.color_source.item_color
|
||||
for(var/T in typesof(/obj/item/bedsheet))
|
||||
var/obj/item/bedsheet/B = T
|
||||
if(wash_color == initial(B.item_color))
|
||||
icon_state = initial(B.icon_state)
|
||||
item_color = wash_color
|
||||
name = initial(B.name)
|
||||
desc = "The colors are a bit dodgy."
|
||||
break
|
||||
|
||||
/obj/item/clothing/head/soft/machine_wash(obj/machinery/washing_machine/WM)
|
||||
if(WM.color_source)
|
||||
var/wash_color = WM.color_source.item_color
|
||||
for(var/T in typesof(/obj/item/clothing/head/soft))
|
||||
var/obj/item/clothing/head/soft/H = T
|
||||
if(wash_color == initial(H.item_color))
|
||||
icon_state = initial(H.icon_state)
|
||||
item_color = wash_color
|
||||
name = initial(H.name)
|
||||
desc = "The colors are a bit dodgy."
|
||||
break
|
||||
|
||||
|
||||
/obj/machinery/washing_machine/relaymove(mob/user)
|
||||
container_resist(user)
|
||||
|
||||
/obj/machinery/washing_machine/container_resist(mob/living/user)
|
||||
if(!busy)
|
||||
add_fingerprint(user)
|
||||
open_machine()
|
||||
|
||||
|
||||
|
||||
/obj/machinery/washing_machine/update_icon()
|
||||
cut_overlays()
|
||||
if(busy)
|
||||
icon_state = "wm_running_[bloody_mess]"
|
||||
else if(bloody_mess)
|
||||
icon_state = "wm_[state_open]_blood"
|
||||
else
|
||||
var/full = contents.len ? 1 : 0
|
||||
icon_state = "wm_[state_open]_[full]"
|
||||
if(panel_open)
|
||||
add_overlay("wm_panel")
|
||||
|
||||
/obj/machinery/washing_machine/attackby(obj/item/W, mob/user, params)
|
||||
if(panel_open && !busy && default_unfasten_wrench(user, W))
|
||||
return
|
||||
|
||||
if(default_deconstruction_screwdriver(user, null, null, W))
|
||||
update_icon()
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/clothing/head/mob_holder))
|
||||
to_chat(user, "<span class='warning'>It's too unweildy to put in this way.</span>")
|
||||
return 1
|
||||
|
||||
else if(user.a_intent != INTENT_HARM)
|
||||
|
||||
if (!state_open)
|
||||
to_chat(user, "<span class='warning'>Open the door first!</span>")
|
||||
return 1
|
||||
|
||||
if(bloody_mess)
|
||||
to_chat(user, "<span class='warning'>[src] must be cleaned up first.</span>")
|
||||
return 1
|
||||
|
||||
if(contents.len >= max_wash_capacity)
|
||||
to_chat(user, "<span class='warning'>The washing machine is full!</span>")
|
||||
return 1
|
||||
|
||||
if(!user.transferItemToLoc(W, src))
|
||||
to_chat(user, "<span class='warning'>\The [W] is stuck to your hand, you cannot put it in the washing machine!</span>")
|
||||
return 1
|
||||
|
||||
if(istype(W, /obj/item/toy/crayon) || istype(W, /obj/item/stamp))
|
||||
color_source = W
|
||||
update_icon()
|
||||
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/machinery/washing_machine/attack_hand(mob/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
if(busy)
|
||||
to_chat(user, "<span class='warning'>[src] is busy.</span>")
|
||||
return
|
||||
|
||||
if(user.pulling && user.a_intent == INTENT_GRAB && isliving(user.pulling))
|
||||
var/mob/living/L = user.pulling
|
||||
if(L.buckled || L.has_buckled_mobs())
|
||||
return
|
||||
if(state_open)
|
||||
if(iscorgi(L))
|
||||
has_corgi = 1
|
||||
L.forceMove(src)
|
||||
update_icon()
|
||||
return
|
||||
|
||||
if(!state_open)
|
||||
open_machine()
|
||||
else
|
||||
state_open = FALSE //close the door
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/washing_machine/deconstruct(disassembled = TRUE)
|
||||
new /obj/item/stack/sheet/metal (loc, 2)
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/washing_machine/open_machine(drop = 1)
|
||||
..()
|
||||
density = TRUE //because machinery/open_machine() sets it to 0
|
||||
color_source = null
|
||||
has_corgi = 0
|
||||
/obj/machinery/washing_machine
|
||||
name = "washing machine"
|
||||
desc = "Gets rid of those pesky bloodstains, or your money back!"
|
||||
icon = 'icons/obj/machines/washing_machine.dmi'
|
||||
icon_state = "wm_1_0"
|
||||
density = TRUE
|
||||
state_open = TRUE
|
||||
var/busy = FALSE
|
||||
var/bloody_mess = 0
|
||||
var/has_corgi = 0
|
||||
var/obj/item/color_source
|
||||
var/max_wash_capacity = 5
|
||||
|
||||
/obj/machinery/washing_machine/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>Alt-click it to start a wash cycle.</span>"
|
||||
|
||||
/obj/machinery/washing_machine/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(!user.canUseTopic(src))
|
||||
return
|
||||
|
||||
if(busy)
|
||||
return
|
||||
|
||||
if(state_open)
|
||||
to_chat(user, "<span class='notice'>Close the door first</span>")
|
||||
return TRUE
|
||||
|
||||
if(bloody_mess)
|
||||
to_chat(user, "<span class='warning'>[src] must be cleaned up first.</span>")
|
||||
return TRUE
|
||||
|
||||
if(has_corgi)
|
||||
bloody_mess = 1
|
||||
|
||||
busy = TRUE
|
||||
update_icon()
|
||||
addtimer(CALLBACK(src, .proc/wash_cycle), 200)
|
||||
START_PROCESSING(SSfastprocess, src)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/washing_machine/process()
|
||||
if (!busy)
|
||||
animate(src, transform=matrix(), time=2)
|
||||
return PROCESS_KILL
|
||||
if (anchored)
|
||||
if (prob(5))
|
||||
var/matrix/M = new
|
||||
M.Translate(rand(-1, 1), rand(0, 1))
|
||||
animate(src, transform=M, time=1)
|
||||
animate(transform=matrix(), time=1)
|
||||
else
|
||||
if (prob(1))
|
||||
step(src, pick(GLOB.cardinals))
|
||||
var/matrix/M = new
|
||||
M.Translate(rand(-3, 3), rand(-1, 3))
|
||||
animate(src, transform=M, time=2)
|
||||
|
||||
/obj/machinery/washing_machine/clean_blood()
|
||||
..()
|
||||
if(!busy)
|
||||
bloody_mess = FALSE
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/washing_machine/proc/wash_cycle()
|
||||
for(var/X in contents)
|
||||
var/atom/movable/AM = X
|
||||
SEND_SIGNAL(AM, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK)
|
||||
AM.clean_blood()
|
||||
AM.machine_wash(src)
|
||||
|
||||
busy = FALSE
|
||||
if(color_source)
|
||||
qdel(color_source)
|
||||
color_source = null
|
||||
update_icon()
|
||||
|
||||
|
||||
//what happens to this object when washed inside a washing machine
|
||||
/atom/movable/proc/machine_wash(obj/machinery/washing_machine/WM)
|
||||
return
|
||||
|
||||
/obj/item/stack/sheet/hairlesshide/machine_wash(obj/machinery/washing_machine/WM)
|
||||
new /obj/item/stack/sheet/wetleather(drop_location(), amount)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/clothing/suit/hooded/ian_costume/machine_wash(obj/machinery/washing_machine/WM)
|
||||
new /obj/item/reagent_containers/food/snacks/meat/slab/corgi(loc)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/paper/machine_wash(obj/machinery/washing_machine/WM)
|
||||
if(WM.color_source)
|
||||
if(istype(WM.color_source, /obj/item/toy/crayon))
|
||||
var/obj/item/toy/crayon/CR = WM.color_source
|
||||
add_atom_colour(CR.paint_color, WASHABLE_COLOUR_PRIORITY)
|
||||
|
||||
/obj/item/reagents_containers/rag/towel/machine_wash(obj/machinery/washing_machine/WM)
|
||||
if(WM.color_source)
|
||||
if(istype(WM.color_source, /obj/item/toy/crayon))
|
||||
var/obj/item/toy/crayon/CR = WM.color_source
|
||||
add_atom_colour(CR.paint_color, WASHABLE_COLOUR_PRIORITY)
|
||||
|
||||
/mob/living/simple_animal/pet/dog/corgi/machine_wash(obj/machinery/washing_machine/WM)
|
||||
gib()
|
||||
|
||||
/obj/item/clothing/under/color/machine_wash(obj/machinery/washing_machine/WM)
|
||||
jumpsuit_wash(WM)
|
||||
|
||||
/obj/item/clothing/under/rank/machine_wash(obj/machinery/washing_machine/WM)
|
||||
jumpsuit_wash(WM)
|
||||
|
||||
/obj/item/clothing/under/proc/jumpsuit_wash(obj/machinery/washing_machine/WM)
|
||||
if(WM.color_source)
|
||||
var/wash_color = WM.color_source.item_color
|
||||
var/obj/item/clothing/under/U
|
||||
for(var/T in typesof(/obj/item/clothing/under/color))
|
||||
var/obj/item/clothing/under/color/J = T
|
||||
if(wash_color == initial(J.item_color))
|
||||
U = J
|
||||
break
|
||||
if(!U)
|
||||
for(var/T in typesof(/obj/item/clothing/under/rank))
|
||||
var/obj/item/clothing/under/rank/R = T
|
||||
if(wash_color == initial(R.item_color))
|
||||
U = R
|
||||
break
|
||||
if(U)
|
||||
item_state = initial(U.item_state)
|
||||
icon_state = initial(U.icon_state)
|
||||
item_color = wash_color
|
||||
name = initial(U.name)
|
||||
desc = "The colors are a bit dodgy."
|
||||
can_adjust = initial(U.can_adjust)
|
||||
if(!can_adjust && adjusted) //we deadjust the uniform if it's now unadjustable
|
||||
toggle_jumpsuit_adjust()
|
||||
|
||||
/obj/item/clothing/gloves/color/machine_wash(obj/machinery/washing_machine/WM)
|
||||
if(WM.color_source)
|
||||
var/wash_color = WM.color_source.item_color
|
||||
for(var/T in typesof(/obj/item/clothing/gloves/color))
|
||||
var/obj/item/clothing/gloves/color/G = T
|
||||
if(wash_color == initial(G.item_color))
|
||||
item_state = initial(G.item_state)
|
||||
icon_state = initial(G.icon_state)
|
||||
item_color = wash_color
|
||||
name = initial(G.name)
|
||||
desc = "The colors are a bit dodgy."
|
||||
break
|
||||
|
||||
/obj/item/clothing/shoes/sneakers/machine_wash(obj/machinery/washing_machine/WM)
|
||||
if(chained)
|
||||
chained = 0
|
||||
slowdown = SHOES_SLOWDOWN
|
||||
new /obj/item/restraints/handcuffs(loc)
|
||||
if(WM.color_source)
|
||||
var/wash_color = WM.color_source.item_color
|
||||
for(var/T in typesof(/obj/item/clothing/shoes/sneakers))
|
||||
var/obj/item/clothing/shoes/sneakers/S = T
|
||||
if(wash_color == initial(S.item_color))
|
||||
icon_state = initial(S.icon_state)
|
||||
item_color = wash_color
|
||||
name = initial(S.name)
|
||||
desc = "The colors are a bit dodgy."
|
||||
break
|
||||
|
||||
/obj/item/bedsheet/machine_wash(obj/machinery/washing_machine/WM)
|
||||
if(WM.color_source)
|
||||
var/wash_color = WM.color_source.item_color
|
||||
for(var/T in typesof(/obj/item/bedsheet))
|
||||
var/obj/item/bedsheet/B = T
|
||||
if(wash_color == initial(B.item_color))
|
||||
icon_state = initial(B.icon_state)
|
||||
item_color = wash_color
|
||||
name = initial(B.name)
|
||||
desc = "The colors are a bit dodgy."
|
||||
break
|
||||
|
||||
/obj/item/clothing/head/soft/machine_wash(obj/machinery/washing_machine/WM)
|
||||
if(WM.color_source)
|
||||
var/wash_color = WM.color_source.item_color
|
||||
for(var/T in typesof(/obj/item/clothing/head/soft))
|
||||
var/obj/item/clothing/head/soft/H = T
|
||||
if(wash_color == initial(H.item_color))
|
||||
icon_state = initial(H.icon_state)
|
||||
item_color = wash_color
|
||||
name = initial(H.name)
|
||||
desc = "The colors are a bit dodgy."
|
||||
break
|
||||
|
||||
|
||||
/obj/machinery/washing_machine/relaymove(mob/user)
|
||||
container_resist(user)
|
||||
|
||||
/obj/machinery/washing_machine/container_resist(mob/living/user)
|
||||
if(!busy)
|
||||
add_fingerprint(user)
|
||||
open_machine()
|
||||
|
||||
|
||||
|
||||
/obj/machinery/washing_machine/update_icon()
|
||||
cut_overlays()
|
||||
if(busy)
|
||||
icon_state = "wm_running_[bloody_mess]"
|
||||
else if(bloody_mess)
|
||||
icon_state = "wm_[state_open]_blood"
|
||||
else
|
||||
var/full = contents.len ? 1 : 0
|
||||
icon_state = "wm_[state_open]_[full]"
|
||||
if(panel_open)
|
||||
add_overlay("wm_panel")
|
||||
|
||||
/obj/machinery/washing_machine/attackby(obj/item/W, mob/user, params)
|
||||
if(panel_open && !busy && default_unfasten_wrench(user, W))
|
||||
return
|
||||
|
||||
if(default_deconstruction_screwdriver(user, null, null, W))
|
||||
update_icon()
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/clothing/head/mob_holder))
|
||||
to_chat(user, "<span class='warning'>It's too unweildy to put in this way.</span>")
|
||||
return 1
|
||||
|
||||
else if(user.a_intent != INTENT_HARM)
|
||||
|
||||
if (!state_open)
|
||||
to_chat(user, "<span class='warning'>Open the door first!</span>")
|
||||
return 1
|
||||
|
||||
if(bloody_mess)
|
||||
to_chat(user, "<span class='warning'>[src] must be cleaned up first.</span>")
|
||||
return 1
|
||||
|
||||
if(contents.len >= max_wash_capacity)
|
||||
to_chat(user, "<span class='warning'>The washing machine is full!</span>")
|
||||
return 1
|
||||
|
||||
if(!user.transferItemToLoc(W, src))
|
||||
to_chat(user, "<span class='warning'>\The [W] is stuck to your hand, you cannot put it in the washing machine!</span>")
|
||||
return 1
|
||||
|
||||
if(istype(W, /obj/item/toy/crayon) || istype(W, /obj/item/stamp))
|
||||
color_source = W
|
||||
update_icon()
|
||||
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/machinery/washing_machine/attack_hand(mob/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
if(busy)
|
||||
to_chat(user, "<span class='warning'>[src] is busy.</span>")
|
||||
return
|
||||
|
||||
if(user.pulling && user.a_intent == INTENT_GRAB && isliving(user.pulling))
|
||||
var/mob/living/L = user.pulling
|
||||
if(L.buckled || L.has_buckled_mobs())
|
||||
return
|
||||
if(state_open)
|
||||
if(iscorgi(L))
|
||||
has_corgi = 1
|
||||
L.forceMove(src)
|
||||
update_icon()
|
||||
return
|
||||
|
||||
if(!state_open)
|
||||
open_machine()
|
||||
else
|
||||
state_open = FALSE //close the door
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/washing_machine/deconstruct(disassembled = TRUE)
|
||||
new /obj/item/stack/sheet/metal (loc, 2)
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/washing_machine/open_machine(drop = 1)
|
||||
..()
|
||||
density = TRUE //because machinery/open_machine() sets it to 0
|
||||
color_source = null
|
||||
has_corgi = 0
|
||||
|
||||
@@ -139,8 +139,10 @@
|
||||
chassis.toggle_strafe()
|
||||
|
||||
/obj/mecha/AltClick(mob/living/user)
|
||||
. = ..()
|
||||
if((user == occupant) && user.canUseTopic(src))
|
||||
toggle_strafe()
|
||||
return TRUE
|
||||
|
||||
/obj/mecha/proc/toggle_strafe()
|
||||
strafe = !strafe
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -974,10 +974,12 @@
|
||||
to_chat(user, "<span class='notice'>You [suction ? "enable" : "disable"] the board's suction function.</span>")
|
||||
|
||||
/obj/item/circuitboard/machine/dish_drive/AltClick(mob/living/user)
|
||||
. = ..()
|
||||
if(!user.Adjacent(src))
|
||||
return
|
||||
transmit = !transmit
|
||||
to_chat(user, "<span class='notice'>You [transmit ? "enable" : "disable"] the board's automatic disposal transmission.</span>")
|
||||
return TRUE
|
||||
|
||||
/obj/item/circuitboard/machine/stacking_unit_console
|
||||
name = "Stacking Machine Console (Machine Board)"
|
||||
|
||||
+1173
-1173
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,91 @@
|
||||
//NOT YET IMPLEMENTED -- Archie
|
||||
|
||||
/obj/item/desynchronizer
|
||||
name = "desynchronizer"
|
||||
desc = "An experimental device that can temporarily desynchronize the user from spacetime, effectively making them disappear while it's active."
|
||||
icon = 'icons/obj/device.dmi'
|
||||
icon_state = "desynchronizer"
|
||||
item_state = "electronic"
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
item_flags = NOBLUDGEON
|
||||
lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
|
||||
materials = list(MAT_METAL = 250, MAT_GLASS = 500)
|
||||
var/max_duration = 3000
|
||||
var/duration = 300
|
||||
var/last_use = 0
|
||||
var/next_use = 0
|
||||
var/obj/effect/abstract/sync_holder/sync_holder
|
||||
|
||||
/obj/item/desynchronizer/attack_self(mob/living/user)
|
||||
if(world.time < next_use)
|
||||
to_chat(user, "<span class='warning'>[src] is still recharging.</span>")
|
||||
return
|
||||
if(!sync_holder)
|
||||
desync(user)
|
||||
else
|
||||
resync()
|
||||
|
||||
/obj/item/desynchronizer/examine(mob/user)
|
||||
. = ..()
|
||||
if(world.time < next_use)
|
||||
. += "<span class='warning'>Time left to recharge: [DisplayTimeText(next_use - world.time)]</span>"
|
||||
. += "<span class='notice'>Alt-click to customize the duration. Current duration: [DisplayTimeText(duration)].</span>"
|
||||
. += "<span class='notice'>Can be used again to interrupt the effect early. The recharge time is the same as the time spent in desync.</span>"
|
||||
|
||||
/obj/item/desynchronizer/AltClick(mob/living/user)
|
||||
. = ..()
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||
return
|
||||
var/new_duration = input(user, "Set the duration (5-300):", "Desynchronizer", duration / 10) as null|num
|
||||
if(new_duration)
|
||||
new_duration = new_duration SECONDS
|
||||
new_duration = CLAMP(new_duration, 50, max_duration)
|
||||
duration = new_duration
|
||||
to_chat(user, "<span class='notice'>You set the duration to [DisplayTimeText(duration)].</span>")
|
||||
return TRUE
|
||||
|
||||
/obj/item/desynchronizer/proc/desync(mob/living/user)
|
||||
if(sync_holder)
|
||||
return
|
||||
sync_holder = new(drop_location())
|
||||
new /obj/effect/temp_visual/desynchronizer(drop_location())
|
||||
to_chat(user, "<span class='notice'>You activate [src], desynchronizing yourself from the present. You can still see your surroundings, but you feel eerily dissociated from reality.</span>")
|
||||
user.forceMove(sync_holder)
|
||||
SEND_SIGNAL(user, COMSIG_MOVABLE_SECLUDED_LOCATION)
|
||||
for(var/thing in user)
|
||||
var/atom/movable/AM = thing
|
||||
SEND_SIGNAL(AM, COMSIG_MOVABLE_SECLUDED_LOCATION)
|
||||
last_use = world.time
|
||||
icon_state = "desynchronizer-on"
|
||||
addtimer(CALLBACK(src, .proc/resync), duration)
|
||||
|
||||
/obj/item/desynchronizer/proc/resync()
|
||||
new /obj/effect/temp_visual/desynchronizer(sync_holder.drop_location())
|
||||
QDEL_NULL(sync_holder)
|
||||
icon_state = initial(icon_state)
|
||||
next_use = world.time + (world.time - last_use) // Could be 2*world.time-last_use but that would just be confusing
|
||||
|
||||
/obj/item/desynchronizer/Destroy()
|
||||
resync()
|
||||
return ..()
|
||||
|
||||
/obj/effect/abstract/sync_holder
|
||||
name = "desyncronized pocket"
|
||||
desc = "A pocket in spacetime, keeping the user a fraction of a second in the future."
|
||||
icon = null
|
||||
icon_state = null
|
||||
alpha = 0
|
||||
invisibility = INVISIBILITY_ABSTRACT
|
||||
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
|
||||
anchored = TRUE
|
||||
resistance_flags = INDESTRUCTIBLE
|
||||
|
||||
/obj/effect/abstract/sync_holder/Destroy()
|
||||
for(var/I in contents)
|
||||
var/atom/movable/AM = I
|
||||
AM.forceMove(drop_location())
|
||||
return ..()
|
||||
|
||||
/obj/effect/abstract/sync_holder/AllowDrop()
|
||||
return TRUE //no dropping spaghetti out of your spacetime pocket
|
||||
@@ -184,14 +184,16 @@
|
||||
return ..()
|
||||
|
||||
/obj/item/geiger_counter/AltClick(mob/living/user)
|
||||
. = ..()
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE))
|
||||
return ..()
|
||||
return
|
||||
if(!scanning)
|
||||
to_chat(usr, "<span class='warning'>[src] must be on to reset its radiation level!</span>")
|
||||
return 0
|
||||
return TRUE
|
||||
radiation_count = 0
|
||||
to_chat(usr, "<span class='notice'>You flush [src]'s radiation counts, resetting it to normal.</span>")
|
||||
update_icon()
|
||||
return TRUE
|
||||
|
||||
/obj/item/geiger_counter/emag_act(mob/user)
|
||||
if(obj_flags & EMAGGED)
|
||||
|
||||
@@ -1,224 +1,226 @@
|
||||
GLOBAL_LIST_EMPTY(GPS_list)
|
||||
/obj/item/gps
|
||||
name = "global positioning system"
|
||||
desc = "Helping lost spacemen find their way through the planets since 2016."
|
||||
icon = 'icons/obj/telescience.dmi'
|
||||
icon_state = "gps-c"
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
slot_flags = ITEM_SLOT_BELT
|
||||
obj_flags = UNIQUE_RENAME
|
||||
var/gpstag = "COM0"
|
||||
var/emped = FALSE
|
||||
var/tracking = TRUE
|
||||
var/updating = TRUE //Automatic updating of GPS list. Can be set to manual by user.
|
||||
var/global_mode = TRUE //If disabled, only GPS signals of the same Z level are shown
|
||||
|
||||
/obj/item/gps/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>Alt-click to switch it [tracking ? "off":"on"].</span>"
|
||||
|
||||
/obj/item/gps/Initialize()
|
||||
. = ..()
|
||||
GLOB.GPS_list += src
|
||||
name = "global positioning system ([gpstag])"
|
||||
add_overlay("working")
|
||||
|
||||
/obj/item/gps/Destroy()
|
||||
GLOB.GPS_list -= src
|
||||
return ..()
|
||||
|
||||
/obj/item/gps/emp_act(severity)
|
||||
. = ..()
|
||||
if (. & EMP_PROTECT_SELF)
|
||||
return
|
||||
emped = TRUE
|
||||
cut_overlay("working")
|
||||
add_overlay("emp")
|
||||
addtimer(CALLBACK(src, .proc/reboot), 300, TIMER_UNIQUE|TIMER_OVERRIDE) //if a new EMP happens, remove the old timer so it doesn't reactivate early
|
||||
SStgui.close_uis(src) //Close the UI control if it is open.
|
||||
|
||||
/obj/item/gps/proc/reboot()
|
||||
emped = FALSE
|
||||
cut_overlay("emp")
|
||||
add_overlay("working")
|
||||
|
||||
/obj/item/gps/AltClick(mob/user)
|
||||
if(!user.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
toggletracking(user)
|
||||
|
||||
/obj/item/gps/proc/toggletracking(mob/user)
|
||||
if(!user.canUseTopic(src, BE_CLOSE))
|
||||
return //user not valid to use gps
|
||||
if(emped)
|
||||
to_chat(user, "It's busted!")
|
||||
return
|
||||
if(tracking)
|
||||
cut_overlay("working")
|
||||
to_chat(user, "[src] is no longer tracking, or visible to other GPS devices.")
|
||||
tracking = FALSE
|
||||
else
|
||||
add_overlay("working")
|
||||
to_chat(user, "[src] is now tracking, and visible to other GPS devices.")
|
||||
tracking = TRUE
|
||||
|
||||
|
||||
/obj/item/gps/ui_interact(mob/user, ui_key = "gps", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) // Remember to use the appropriate state.
|
||||
if(emped)
|
||||
to_chat(user, "[src] fizzles weakly.")
|
||||
return
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
var/gps_window_height = 300 + GLOB.GPS_list.len * 20 // Variable window height, depending on how many GPS units there are to show
|
||||
ui = new(user, src, ui_key, "gps", "Global Positioning System", 600, gps_window_height, master_ui, state) //width, height
|
||||
ui.open()
|
||||
|
||||
ui.set_autoupdate(state = updating)
|
||||
|
||||
|
||||
/obj/item/gps/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["power"] = tracking
|
||||
data["tag"] = gpstag
|
||||
data["updating"] = updating
|
||||
data["globalmode"] = global_mode
|
||||
if(!tracking || emped) //Do not bother scanning if the GPS is off or EMPed
|
||||
return data
|
||||
|
||||
var/turf/curr = get_turf(src)
|
||||
data["current"] = "[get_area_name(curr, TRUE)] ([curr.x], [curr.y], [curr.z])"
|
||||
|
||||
var/list/signals = list()
|
||||
data["signals"] = list()
|
||||
|
||||
for(var/gps in GLOB.GPS_list)
|
||||
var/obj/item/gps/G = gps
|
||||
if(G.emped || !G.tracking || G == src)
|
||||
continue
|
||||
var/turf/pos = get_turf(G)
|
||||
if(!global_mode && pos.z != curr.z)
|
||||
continue
|
||||
var/list/signal = list()
|
||||
signal["entrytag"] = G.gpstag //Name or 'tag' of the GPS
|
||||
signal["area"] = get_area_name(G, TRUE)
|
||||
signal["coord"] = "[pos.x], [pos.y], [pos.z]"
|
||||
if(pos.z == curr.z) //Distance/Direction calculations for same z-level only
|
||||
signal["dist"] = max(get_dist(curr, pos), 0) //Distance between the src and remote GPS turfs
|
||||
signal["degrees"] = round(Get_Angle(curr, pos)) //0-360 degree directional bearing, for more precision.
|
||||
var/direction = uppertext(dir2text(get_dir(curr, pos))) //Direction text (East, etc). Not as precise, but still helpful.
|
||||
if(!direction)
|
||||
direction = "CENTER"
|
||||
signal["degrees"] = "N/A"
|
||||
signal["direction"] = direction
|
||||
|
||||
signals += list(signal) //Add this signal to the list of signals
|
||||
data["signals"] = signals
|
||||
return data
|
||||
|
||||
|
||||
|
||||
/obj/item/gps/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("rename")
|
||||
var/a = input("Please enter desired tag.", name, gpstag) as text
|
||||
a = copytext(sanitize(a), 1, 20)
|
||||
gpstag = a
|
||||
. = TRUE
|
||||
name = "global positioning system ([gpstag])"
|
||||
|
||||
if("power")
|
||||
toggletracking(usr)
|
||||
. = TRUE
|
||||
if("updating")
|
||||
updating = !updating
|
||||
. = TRUE
|
||||
if("globalmode")
|
||||
global_mode = !global_mode
|
||||
. = TRUE
|
||||
|
||||
|
||||
/obj/item/gps/science
|
||||
icon_state = "gps-s"
|
||||
gpstag = "SCI0"
|
||||
|
||||
/obj/item/gps/engineering
|
||||
icon_state = "gps-e"
|
||||
gpstag = "ENG0"
|
||||
|
||||
/obj/item/gps/mining
|
||||
icon_state = "gps-m"
|
||||
gpstag = "MINE0"
|
||||
desc = "A positioning system helpful for rescuing trapped or injured miners, keeping one on you at all times while mining might just save your life."
|
||||
|
||||
/obj/item/gps/cyborg
|
||||
icon_state = "gps-b"
|
||||
gpstag = "BORG0"
|
||||
desc = "A mining cyborg internal positioning system. Used as a recovery beacon for damaged cyborg assets, or a collaboration tool for mining teams."
|
||||
|
||||
/obj/item/gps/cyborg/Initialize()
|
||||
. = ..()
|
||||
ADD_TRAIT(src, TRAIT_NODROP, CYBORG_ITEM_TRAIT)
|
||||
|
||||
/obj/item/gps/internal
|
||||
icon_state = null
|
||||
item_flags = ABSTRACT
|
||||
gpstag = "Eerie Signal"
|
||||
desc = "Report to a coder immediately."
|
||||
invisibility = INVISIBILITY_MAXIMUM
|
||||
var/obj/item/implant/gps/implant
|
||||
|
||||
/obj/item/gps/internal/Initialize(mapload, obj/item/implant/gps/_implant)
|
||||
. = ..()
|
||||
implant = _implant
|
||||
|
||||
/obj/item/gps/internal/Destroy()
|
||||
if(implant?.imp_in)
|
||||
qdel(implant)
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/gps/internal/mining
|
||||
icon_state = "gps-m"
|
||||
gpstag = "MINER"
|
||||
desc = "A positioning system helpful for rescuing trapped or injured miners, keeping one on you at all times while mining might just save your life."
|
||||
|
||||
/obj/item/gps/internal/base
|
||||
gpstag = "NT_AUX"
|
||||
desc = "A homing signal from Kinaris's mining base."
|
||||
|
||||
/obj/item/gps/visible_debug
|
||||
name = "visible GPS"
|
||||
gpstag = "ADMIN"
|
||||
desc = "This admin-spawn GPS unit leaves the coordinates visible \
|
||||
on any turf that it passes over, for debugging. Especially useful \
|
||||
for marking the area around the transition edges."
|
||||
var/list/turf/tagged
|
||||
|
||||
/obj/item/gps/visible_debug/Initialize()
|
||||
. = ..()
|
||||
tagged = list()
|
||||
START_PROCESSING(SSfastprocess, src)
|
||||
|
||||
/obj/item/gps/visible_debug/process()
|
||||
var/turf/T = get_turf(src)
|
||||
if(T)
|
||||
// I assume it's faster to color,tag and OR the turf in, rather
|
||||
// then checking if its there
|
||||
T.color = RANDOM_COLOUR
|
||||
T.maptext = "[T.x],[T.y],[T.z]"
|
||||
tagged |= T
|
||||
|
||||
/obj/item/gps/visible_debug/proc/clear()
|
||||
while(tagged.len)
|
||||
var/turf/T = pop(tagged)
|
||||
T.color = initial(T.color)
|
||||
T.maptext = initial(T.maptext)
|
||||
|
||||
/obj/item/gps/visible_debug/Destroy()
|
||||
if(tagged)
|
||||
clear()
|
||||
tagged = null
|
||||
STOP_PROCESSING(SSfastprocess, src)
|
||||
. = ..()
|
||||
GLOBAL_LIST_EMPTY(GPS_list)
|
||||
/obj/item/gps
|
||||
name = "global positioning system"
|
||||
desc = "Helping lost spacemen find their way through the planets since 2016."
|
||||
icon = 'icons/obj/telescience.dmi'
|
||||
icon_state = "gps-c"
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
slot_flags = ITEM_SLOT_BELT
|
||||
obj_flags = UNIQUE_RENAME
|
||||
var/gpstag = "COM0"
|
||||
var/emped = FALSE
|
||||
var/tracking = TRUE
|
||||
var/updating = TRUE //Automatic updating of GPS list. Can be set to manual by user.
|
||||
var/global_mode = TRUE //If disabled, only GPS signals of the same Z level are shown
|
||||
|
||||
/obj/item/gps/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>Alt-click to switch it [tracking ? "off":"on"].</span>"
|
||||
|
||||
/obj/item/gps/Initialize()
|
||||
. = ..()
|
||||
GLOB.GPS_list += src
|
||||
name = "global positioning system ([gpstag])"
|
||||
add_overlay("working")
|
||||
|
||||
/obj/item/gps/Destroy()
|
||||
GLOB.GPS_list -= src
|
||||
return ..()
|
||||
|
||||
/obj/item/gps/emp_act(severity)
|
||||
. = ..()
|
||||
if (. & EMP_PROTECT_SELF)
|
||||
return
|
||||
emped = TRUE
|
||||
cut_overlay("working")
|
||||
add_overlay("emp")
|
||||
addtimer(CALLBACK(src, .proc/reboot), 300, TIMER_UNIQUE|TIMER_OVERRIDE) //if a new EMP happens, remove the old timer so it doesn't reactivate early
|
||||
SStgui.close_uis(src) //Close the UI control if it is open.
|
||||
|
||||
/obj/item/gps/proc/reboot()
|
||||
emped = FALSE
|
||||
cut_overlay("emp")
|
||||
add_overlay("working")
|
||||
|
||||
/obj/item/gps/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(!user.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
toggletracking(user)
|
||||
return TRUE
|
||||
|
||||
/obj/item/gps/proc/toggletracking(mob/user)
|
||||
if(!user.canUseTopic(src, BE_CLOSE))
|
||||
return //user not valid to use gps
|
||||
if(emped)
|
||||
to_chat(user, "It's busted!")
|
||||
return
|
||||
if(tracking)
|
||||
cut_overlay("working")
|
||||
to_chat(user, "[src] is no longer tracking, or visible to other GPS devices.")
|
||||
tracking = FALSE
|
||||
else
|
||||
add_overlay("working")
|
||||
to_chat(user, "[src] is now tracking, and visible to other GPS devices.")
|
||||
tracking = TRUE
|
||||
|
||||
|
||||
/obj/item/gps/ui_interact(mob/user, ui_key = "gps", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) // Remember to use the appropriate state.
|
||||
if(emped)
|
||||
to_chat(user, "[src] fizzles weakly.")
|
||||
return
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
var/gps_window_height = 300 + GLOB.GPS_list.len * 20 // Variable window height, depending on how many GPS units there are to show
|
||||
ui = new(user, src, ui_key, "gps", "Global Positioning System", 600, gps_window_height, master_ui, state) //width, height
|
||||
ui.open()
|
||||
|
||||
ui.set_autoupdate(state = updating)
|
||||
|
||||
|
||||
/obj/item/gps/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["power"] = tracking
|
||||
data["tag"] = gpstag
|
||||
data["updating"] = updating
|
||||
data["globalmode"] = global_mode
|
||||
if(!tracking || emped) //Do not bother scanning if the GPS is off or EMPed
|
||||
return data
|
||||
|
||||
var/turf/curr = get_turf(src)
|
||||
data["current"] = "[get_area_name(curr, TRUE)] ([curr.x], [curr.y], [curr.z])"
|
||||
|
||||
var/list/signals = list()
|
||||
data["signals"] = list()
|
||||
|
||||
for(var/gps in GLOB.GPS_list)
|
||||
var/obj/item/gps/G = gps
|
||||
if(G.emped || !G.tracking || G == src)
|
||||
continue
|
||||
var/turf/pos = get_turf(G)
|
||||
if(!global_mode && pos.z != curr.z)
|
||||
continue
|
||||
var/list/signal = list()
|
||||
signal["entrytag"] = G.gpstag //Name or 'tag' of the GPS
|
||||
signal["area"] = get_area_name(G, TRUE)
|
||||
signal["coord"] = "[pos.x], [pos.y], [pos.z]"
|
||||
if(pos.z == curr.z) //Distance/Direction calculations for same z-level only
|
||||
signal["dist"] = max(get_dist(curr, pos), 0) //Distance between the src and remote GPS turfs
|
||||
signal["degrees"] = round(Get_Angle(curr, pos)) //0-360 degree directional bearing, for more precision.
|
||||
var/direction = uppertext(dir2text(get_dir(curr, pos))) //Direction text (East, etc). Not as precise, but still helpful.
|
||||
if(!direction)
|
||||
direction = "CENTER"
|
||||
signal["degrees"] = "N/A"
|
||||
signal["direction"] = direction
|
||||
|
||||
signals += list(signal) //Add this signal to the list of signals
|
||||
data["signals"] = signals
|
||||
return data
|
||||
|
||||
|
||||
|
||||
/obj/item/gps/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("rename")
|
||||
var/a = input("Please enter desired tag.", name, gpstag) as text
|
||||
a = copytext(sanitize(a), 1, 20)
|
||||
gpstag = a
|
||||
. = TRUE
|
||||
name = "global positioning system ([gpstag])"
|
||||
|
||||
if("power")
|
||||
toggletracking(usr)
|
||||
. = TRUE
|
||||
if("updating")
|
||||
updating = !updating
|
||||
. = TRUE
|
||||
if("globalmode")
|
||||
global_mode = !global_mode
|
||||
. = TRUE
|
||||
|
||||
|
||||
/obj/item/gps/science
|
||||
icon_state = "gps-s"
|
||||
gpstag = "SCI0"
|
||||
|
||||
/obj/item/gps/engineering
|
||||
icon_state = "gps-e"
|
||||
gpstag = "ENG0"
|
||||
|
||||
/obj/item/gps/mining
|
||||
icon_state = "gps-m"
|
||||
gpstag = "MINE0"
|
||||
desc = "A positioning system helpful for rescuing trapped or injured miners, keeping one on you at all times while mining might just save your life."
|
||||
|
||||
/obj/item/gps/cyborg
|
||||
icon_state = "gps-b"
|
||||
gpstag = "BORG0"
|
||||
desc = "A mining cyborg internal positioning system. Used as a recovery beacon for damaged cyborg assets, or a collaboration tool for mining teams."
|
||||
|
||||
/obj/item/gps/cyborg/Initialize()
|
||||
. = ..()
|
||||
ADD_TRAIT(src, TRAIT_NODROP, CYBORG_ITEM_TRAIT)
|
||||
|
||||
/obj/item/gps/internal
|
||||
icon_state = null
|
||||
item_flags = ABSTRACT
|
||||
gpstag = "Eerie Signal"
|
||||
desc = "Report to a coder immediately."
|
||||
invisibility = INVISIBILITY_MAXIMUM
|
||||
var/obj/item/implant/gps/implant
|
||||
|
||||
/obj/item/gps/internal/Initialize(mapload, obj/item/implant/gps/_implant)
|
||||
. = ..()
|
||||
implant = _implant
|
||||
|
||||
/obj/item/gps/internal/Destroy()
|
||||
if(implant?.imp_in)
|
||||
qdel(implant)
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/gps/internal/mining
|
||||
icon_state = "gps-m"
|
||||
gpstag = "MINER"
|
||||
desc = "A positioning system helpful for rescuing trapped or injured miners, keeping one on you at all times while mining might just save your life."
|
||||
|
||||
/obj/item/gps/internal/base
|
||||
gpstag = "NT_AUX"
|
||||
desc = "A homing signal from Kinaris's mining base."
|
||||
|
||||
/obj/item/gps/visible_debug
|
||||
name = "visible GPS"
|
||||
gpstag = "ADMIN"
|
||||
desc = "This admin-spawn GPS unit leaves the coordinates visible \
|
||||
on any turf that it passes over, for debugging. Especially useful \
|
||||
for marking the area around the transition edges."
|
||||
var/list/turf/tagged
|
||||
|
||||
/obj/item/gps/visible_debug/Initialize()
|
||||
. = ..()
|
||||
tagged = list()
|
||||
START_PROCESSING(SSfastprocess, src)
|
||||
|
||||
/obj/item/gps/visible_debug/process()
|
||||
var/turf/T = get_turf(src)
|
||||
if(T)
|
||||
// I assume it's faster to color,tag and OR the turf in, rather
|
||||
// then checking if its there
|
||||
T.color = RANDOM_COLOUR
|
||||
T.maptext = "[T.x],[T.y],[T.z]"
|
||||
tagged |= T
|
||||
|
||||
/obj/item/gps/visible_debug/proc/clear()
|
||||
while(tagged.len)
|
||||
var/turf/T = pop(tagged)
|
||||
T.color = initial(T.color)
|
||||
T.maptext = initial(T.maptext)
|
||||
|
||||
/obj/item/gps/visible_debug/Destroy()
|
||||
if(tagged)
|
||||
clear()
|
||||
tagged = null
|
||||
STOP_PROCESSING(SSfastprocess, src)
|
||||
. = ..()
|
||||
|
||||
@@ -18,12 +18,14 @@
|
||||
. += "<span class='notice'>Insert [src] into an active quantum pad to link it.</span>"
|
||||
|
||||
/obj/item/quantum_keycard/AltClick(mob/living/user)
|
||||
. = ..()
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You start pressing [src]'s unlink button...</span>")
|
||||
if(do_after(user, 40, target = src))
|
||||
to_chat(user, "<span class='notice'>The keycard beeps twice and disconnects the quantum link.</span>")
|
||||
qpad = null
|
||||
return TRUE
|
||||
|
||||
/obj/item/quantum_keycard/update_icon()
|
||||
if(qpad)
|
||||
|
||||
@@ -1,333 +1,335 @@
|
||||
// Used for translating channels to tokens on examination
|
||||
GLOBAL_LIST_INIT(channel_tokens, list(
|
||||
RADIO_CHANNEL_COMMON = RADIO_KEY_COMMON,
|
||||
RADIO_CHANNEL_SCIENCE = RADIO_TOKEN_SCIENCE,
|
||||
RADIO_CHANNEL_COMMAND = RADIO_TOKEN_COMMAND,
|
||||
RADIO_CHANNEL_MEDICAL = RADIO_TOKEN_MEDICAL,
|
||||
RADIO_CHANNEL_ENGINEERING = RADIO_TOKEN_ENGINEERING,
|
||||
RADIO_CHANNEL_SECURITY = RADIO_TOKEN_SECURITY,
|
||||
RADIO_CHANNEL_CENTCOM = RADIO_TOKEN_CENTCOM,
|
||||
RADIO_CHANNEL_SYNDICATE = RADIO_TOKEN_SYNDICATE,
|
||||
RADIO_CHANNEL_SUPPLY = RADIO_TOKEN_SUPPLY,
|
||||
RADIO_CHANNEL_SERVICE = RADIO_TOKEN_SERVICE,
|
||||
MODE_BINARY = MODE_TOKEN_BINARY,
|
||||
RADIO_CHANNEL_AI_PRIVATE = RADIO_TOKEN_AI_PRIVATE
|
||||
))
|
||||
|
||||
/obj/item/radio/headset
|
||||
name = "radio headset"
|
||||
desc = "An updated, modular intercom that fits over the head. Takes encryption keys."
|
||||
icon_state = "headset"
|
||||
item_state = "headset"
|
||||
materials = list(MAT_METAL=75)
|
||||
subspace_transmission = TRUE
|
||||
canhear_range = 0 // can't hear headsets from very far away
|
||||
|
||||
slot_flags = ITEM_SLOT_EARS
|
||||
var/obj/item/encryptionkey/keyslot2 = null
|
||||
dog_fashion = null
|
||||
|
||||
/obj/item/radio/headset/suicide_act(mob/living/carbon/user)
|
||||
user.visible_message("<span class='suicide'>[user] begins putting \the [src]'s antenna up [user.p_their()] nose! It looks like [user.p_theyre()] trying to give [user.p_them()]self cancer!</span>")
|
||||
return TOXLOSS
|
||||
|
||||
/obj/item/radio/headset/examine(mob/user)
|
||||
. = ..()
|
||||
|
||||
if(item_flags & IN_INVENTORY && loc == user)
|
||||
// construction of frequency description
|
||||
var/list/avail_chans = list("Use [RADIO_KEY_COMMON] for the currently tuned frequency")
|
||||
if(translate_binary)
|
||||
avail_chans += "use [MODE_TOKEN_BINARY] for [MODE_BINARY]"
|
||||
if(length(channels))
|
||||
for(var/i in 1 to length(channels))
|
||||
if(i == 1)
|
||||
avail_chans += "use [MODE_TOKEN_DEPARTMENT] or [GLOB.channel_tokens[channels[i]]] for [lowertext(channels[i])]"
|
||||
else
|
||||
avail_chans += "use [GLOB.channel_tokens[channels[i]]] for [lowertext(channels[i])]"
|
||||
. += "<span class='notice'>A small screen on the headset displays the following available frequencies:\n[english_list(avail_chans)]."
|
||||
|
||||
if(command)
|
||||
. += "<span class='info'>Alt-click to toggle the high-volume mode.</span>"
|
||||
else
|
||||
. += "<span class='notice'>A small screen on the headset flashes, it's too small to read without holding or wearing the headset.</span>"
|
||||
|
||||
/obj/item/radio/headset/Initialize()
|
||||
. = ..()
|
||||
recalculateChannels()
|
||||
|
||||
/obj/item/radio/headset/Destroy()
|
||||
QDEL_NULL(keyslot2)
|
||||
return ..()
|
||||
|
||||
/obj/item/radio/headset/talk_into(mob/living/M, message, channel, list/spans,datum/language/language)
|
||||
if (!listening)
|
||||
return ITALICS | REDUCE_RANGE
|
||||
return ..()
|
||||
|
||||
/obj/item/radio/headset/can_receive(freq, level, AIuser)
|
||||
if(ishuman(src.loc))
|
||||
var/mob/living/carbon/human/H = src.loc
|
||||
if(H.ears == src)
|
||||
return ..(freq, level)
|
||||
else if(AIuser)
|
||||
return ..(freq, level)
|
||||
return FALSE
|
||||
|
||||
/obj/item/radio/headset/syndicate //disguised to look like a normal headset for stealth ops
|
||||
|
||||
/obj/item/radio/headset/syndicate/alt //undisguised bowman with flash protection
|
||||
name = "syndicate headset"
|
||||
desc = "A syndicate headset that can be used to hear all radio frequencies. Protects ears from flashbangs."
|
||||
icon_state = "syndie_headset"
|
||||
item_state = "syndie_headset"
|
||||
|
||||
/obj/item/radio/headset/syndicate/alt/ComponentInitialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/wearertargeting/earprotection, list(SLOT_EARS))
|
||||
|
||||
/obj/item/radio/headset/syndicate/alt/leader
|
||||
name = "team leader headset"
|
||||
command = TRUE
|
||||
|
||||
/obj/item/radio/headset/syndicate/Initialize()
|
||||
. = ..()
|
||||
make_syndie()
|
||||
|
||||
/obj/item/radio/headset/binary
|
||||
/obj/item/radio/headset/binary/Initialize()
|
||||
. = ..()
|
||||
qdel(keyslot)
|
||||
keyslot = new /obj/item/encryptionkey/binary
|
||||
recalculateChannels()
|
||||
|
||||
/obj/item/radio/headset/headset_sec
|
||||
name = "security radio headset"
|
||||
desc = "This is used by your elite security force."
|
||||
icon_state = "sec_headset"
|
||||
keyslot = new /obj/item/encryptionkey/headset_sec
|
||||
|
||||
/obj/item/radio/headset/headset_sec/alt
|
||||
name = "security bowman headset"
|
||||
desc = "This is used by your elite security force. Protects ears from flashbangs."
|
||||
icon_state = "sec_headset_alt"
|
||||
item_state = "sec_headset_alt"
|
||||
|
||||
/obj/item/radio/headset/headset_sec/alt/ComponentInitialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/wearertargeting/earprotection, list(SLOT_EARS))
|
||||
|
||||
/obj/item/radio/headset/headset_eng
|
||||
name = "engineering radio headset"
|
||||
desc = "When the engineers wish to chat like girls."
|
||||
icon_state = "eng_headset"
|
||||
keyslot = new /obj/item/encryptionkey/headset_eng
|
||||
|
||||
/obj/item/radio/headset/headset_rob
|
||||
name = "robotics radio headset"
|
||||
desc = "Made specifically for the roboticists, who cannot decide between departments."
|
||||
icon_state = "rob_headset"
|
||||
keyslot = new /obj/item/encryptionkey/headset_rob
|
||||
|
||||
/obj/item/radio/headset/headset_med
|
||||
name = "medical radio headset"
|
||||
desc = "A headset for the trained staff of the medbay."
|
||||
icon_state = "med_headset"
|
||||
keyslot = new /obj/item/encryptionkey/headset_med
|
||||
|
||||
/obj/item/radio/headset/headset_sci
|
||||
name = "science radio headset"
|
||||
desc = "A sciency headset. Like usual."
|
||||
icon_state = "sci_headset"
|
||||
keyslot = new /obj/item/encryptionkey/headset_sci
|
||||
|
||||
/obj/item/radio/headset/headset_medsci
|
||||
name = "medical research radio headset"
|
||||
desc = "A headset that is a result of the mating between medical and science."
|
||||
icon_state = "medsci_headset"
|
||||
keyslot = new /obj/item/encryptionkey/headset_medsci
|
||||
|
||||
/obj/item/radio/headset/headset_com
|
||||
name = "command radio headset"
|
||||
desc = "A headset with a commanding channel.\nTo access the command channel, use :c."
|
||||
icon_state = "com_headset"
|
||||
keyslot = new /obj/item/encryptionkey/headset_com
|
||||
|
||||
/obj/item/radio/headset/heads
|
||||
command = TRUE
|
||||
|
||||
/obj/item/radio/headset/heads/captain
|
||||
name = "\proper the captain's headset"
|
||||
desc = "The headset of the king."
|
||||
icon_state = "com_headset"
|
||||
keyslot = new /obj/item/encryptionkey/heads/captain
|
||||
|
||||
/obj/item/radio/headset/heads/captain/alt
|
||||
name = "\proper the captain's bowman headset"
|
||||
desc = "The headset of the boss. Protects ears from flashbangs."
|
||||
icon_state = "com_headset_alt"
|
||||
item_state = "com_headset_alt"
|
||||
|
||||
/obj/item/radio/headset/heads/captain/alt/ComponentInitialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/wearertargeting/earprotection, list(SLOT_EARS))
|
||||
|
||||
/obj/item/radio/headset/heads/rd
|
||||
name = "\proper the research director's headset"
|
||||
desc = "Headset of the fellow who keeps society marching towards technological singularity."
|
||||
icon_state = "com_headset"
|
||||
keyslot = new /obj/item/encryptionkey/heads/rd
|
||||
|
||||
/obj/item/radio/headset/heads/hos
|
||||
name = "\proper the head of security's headset"
|
||||
desc = "The headset of the man in charge of keeping order and protecting the station."
|
||||
icon_state = "com_headset"
|
||||
keyslot = new /obj/item/encryptionkey/heads/hos
|
||||
|
||||
/obj/item/radio/headset/heads/hos/alt
|
||||
name = "\proper the head of security's bowman headset"
|
||||
desc = "The headset of the man in charge of keeping order and protecting the station. Protects ears from flashbangs."
|
||||
icon_state = "com_headset_alt"
|
||||
item_state = "com_headset_alt"
|
||||
|
||||
/obj/item/radio/headset/heads/hos/ComponentInitialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/wearertargeting/earprotection, list(SLOT_EARS))
|
||||
|
||||
/obj/item/radio/headset/heads/ce
|
||||
name = "\proper the chief engineer's headset"
|
||||
desc = "The headset of the guy in charge of keeping the station powered and undamaged."
|
||||
icon_state = "com_headset"
|
||||
keyslot = new /obj/item/encryptionkey/heads/ce
|
||||
|
||||
/obj/item/radio/headset/heads/cmo
|
||||
name = "\proper the chief medical officer's headset"
|
||||
desc = "The headset of the highly trained medical chief."
|
||||
icon_state = "com_headset"
|
||||
keyslot = new /obj/item/encryptionkey/heads/cmo
|
||||
|
||||
/obj/item/radio/headset/heads/hop
|
||||
name = "\proper the head of personnel's headset"
|
||||
desc = "The headset of the guy who will one day be captain."
|
||||
icon_state = "com_headset"
|
||||
keyslot = new /obj/item/encryptionkey/heads/hop
|
||||
|
||||
/obj/item/radio/headset/headset_cargo
|
||||
name = "supply radio headset"
|
||||
desc = "A headset used by the QM and his slaves."
|
||||
icon_state = "cargo_headset"
|
||||
keyslot = new /obj/item/encryptionkey/headset_cargo
|
||||
|
||||
/obj/item/radio/headset/headset_cargo/mining
|
||||
name = "mining radio headset"
|
||||
desc = "Headset used by shaft miners."
|
||||
icon_state = "mine_headset"
|
||||
keyslot = new /obj/item/encryptionkey/headset_mining
|
||||
|
||||
/obj/item/radio/headset/headset_srv
|
||||
name = "service radio headset"
|
||||
desc = "Headset used by the service staff, tasked with keeping the station full, happy and clean."
|
||||
icon_state = "srv_headset"
|
||||
keyslot = new /obj/item/encryptionkey/headset_service
|
||||
|
||||
/obj/item/radio/headset/headset_cent
|
||||
name = "\improper CentCom headset"
|
||||
desc = "A headset used by the upper echelons of Kinaris."
|
||||
icon_state = "cent_headset"
|
||||
keyslot = new /obj/item/encryptionkey/headset_com
|
||||
keyslot2 = new /obj/item/encryptionkey/headset_cent
|
||||
|
||||
/obj/item/radio/headset/headset_cent/empty
|
||||
keyslot = null
|
||||
keyslot2 = null
|
||||
|
||||
/obj/item/radio/headset/headset_cent/commander
|
||||
keyslot = new /obj/item/encryptionkey/heads/captain
|
||||
|
||||
/obj/item/radio/headset/headset_cent/alt
|
||||
name = "\improper CentCom bowman headset"
|
||||
desc = "A headset especially for emergency response personnel. Protects ears from flashbangs."
|
||||
icon_state = "cent_headset_alt"
|
||||
item_state = "cent_headset_alt"
|
||||
keyslot = null
|
||||
|
||||
/obj/item/radio/headset/headset_cent/alt/ComponentInitialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/wearertargeting/earprotection, list(SLOT_EARS))
|
||||
|
||||
/obj/item/radio/headset/ai
|
||||
name = "\proper Integrated Subspace Transceiver "
|
||||
keyslot2 = new /obj/item/encryptionkey/ai
|
||||
command = TRUE
|
||||
|
||||
/obj/item/radio/headset/ai/can_receive(freq, level)
|
||||
return ..(freq, level, TRUE)
|
||||
|
||||
/obj/item/radio/headset/attackby(obj/item/W, mob/user, params)
|
||||
user.set_machine(src)
|
||||
|
||||
if(istype(W, /obj/item/screwdriver))
|
||||
if(keyslot || keyslot2)
|
||||
for(var/ch_name in channels)
|
||||
SSradio.remove_object(src, GLOB.radiochannels[ch_name])
|
||||
secure_radio_connections[ch_name] = null
|
||||
|
||||
var/turf/T = user.drop_location()
|
||||
if(T)
|
||||
if(keyslot)
|
||||
keyslot.forceMove(T)
|
||||
keyslot = null
|
||||
if(keyslot2)
|
||||
keyslot2.forceMove(T)
|
||||
keyslot2 = null
|
||||
|
||||
recalculateChannels()
|
||||
to_chat(user, "<span class='notice'>You pop out the encryption keys in the headset.</span>")
|
||||
|
||||
else
|
||||
to_chat(user, "<span class='warning'>This headset doesn't have any unique encryption keys! How useless...</span>")
|
||||
|
||||
else if(istype(W, /obj/item/encryptionkey))
|
||||
if(keyslot && keyslot2)
|
||||
to_chat(user, "<span class='warning'>The headset can't hold another key!</span>")
|
||||
return
|
||||
|
||||
if(!keyslot)
|
||||
if(!user.transferItemToLoc(W, src))
|
||||
return
|
||||
keyslot = W
|
||||
|
||||
else
|
||||
if(!user.transferItemToLoc(W, src))
|
||||
return
|
||||
keyslot2 = W
|
||||
|
||||
|
||||
recalculateChannels()
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/item/radio/headset/recalculateChannels()
|
||||
..()
|
||||
if(keyslot2)
|
||||
for(var/ch_name in keyslot2.channels)
|
||||
if(!(ch_name in src.channels))
|
||||
channels[ch_name] = keyslot2.channels[ch_name]
|
||||
|
||||
if(keyslot2.translate_binary)
|
||||
translate_binary = TRUE
|
||||
if(keyslot2.syndie)
|
||||
syndie = TRUE
|
||||
if (keyslot2.independent)
|
||||
independent = TRUE
|
||||
|
||||
for(var/ch_name in channels)
|
||||
secure_radio_connections[ch_name] = add_radio(src, GLOB.radiochannels[ch_name])
|
||||
|
||||
/obj/item/radio/headset/AltClick(mob/living/user)
|
||||
if(!istype(user) || !Adjacent(user) || user.incapacitated())
|
||||
return
|
||||
if (command)
|
||||
use_command = !use_command
|
||||
to_chat(user, "<span class='notice'>You toggle high-volume mode [use_command ? "on" : "off"].</span>")
|
||||
// Used for translating channels to tokens on examination
|
||||
GLOBAL_LIST_INIT(channel_tokens, list(
|
||||
RADIO_CHANNEL_COMMON = RADIO_KEY_COMMON,
|
||||
RADIO_CHANNEL_SCIENCE = RADIO_TOKEN_SCIENCE,
|
||||
RADIO_CHANNEL_COMMAND = RADIO_TOKEN_COMMAND,
|
||||
RADIO_CHANNEL_MEDICAL = RADIO_TOKEN_MEDICAL,
|
||||
RADIO_CHANNEL_ENGINEERING = RADIO_TOKEN_ENGINEERING,
|
||||
RADIO_CHANNEL_SECURITY = RADIO_TOKEN_SECURITY,
|
||||
RADIO_CHANNEL_CENTCOM = RADIO_TOKEN_CENTCOM,
|
||||
RADIO_CHANNEL_SYNDICATE = RADIO_TOKEN_SYNDICATE,
|
||||
RADIO_CHANNEL_SUPPLY = RADIO_TOKEN_SUPPLY,
|
||||
RADIO_CHANNEL_SERVICE = RADIO_TOKEN_SERVICE,
|
||||
MODE_BINARY = MODE_TOKEN_BINARY,
|
||||
RADIO_CHANNEL_AI_PRIVATE = RADIO_TOKEN_AI_PRIVATE
|
||||
))
|
||||
|
||||
/obj/item/radio/headset
|
||||
name = "radio headset"
|
||||
desc = "An updated, modular intercom that fits over the head. Takes encryption keys."
|
||||
icon_state = "headset"
|
||||
item_state = "headset"
|
||||
materials = list(MAT_METAL=75)
|
||||
subspace_transmission = TRUE
|
||||
canhear_range = 0 // can't hear headsets from very far away
|
||||
|
||||
slot_flags = ITEM_SLOT_EARS
|
||||
var/obj/item/encryptionkey/keyslot2 = null
|
||||
dog_fashion = null
|
||||
|
||||
/obj/item/radio/headset/suicide_act(mob/living/carbon/user)
|
||||
user.visible_message("<span class='suicide'>[user] begins putting \the [src]'s antenna up [user.p_their()] nose! It looks like [user.p_theyre()] trying to give [user.p_them()]self cancer!</span>")
|
||||
return TOXLOSS
|
||||
|
||||
/obj/item/radio/headset/examine(mob/user)
|
||||
. = ..()
|
||||
|
||||
if(item_flags & IN_INVENTORY && loc == user)
|
||||
// construction of frequency description
|
||||
var/list/avail_chans = list("Use [RADIO_KEY_COMMON] for the currently tuned frequency")
|
||||
if(translate_binary)
|
||||
avail_chans += "use [MODE_TOKEN_BINARY] for [MODE_BINARY]"
|
||||
if(length(channels))
|
||||
for(var/i in 1 to length(channels))
|
||||
if(i == 1)
|
||||
avail_chans += "use [MODE_TOKEN_DEPARTMENT] or [GLOB.channel_tokens[channels[i]]] for [lowertext(channels[i])]"
|
||||
else
|
||||
avail_chans += "use [GLOB.channel_tokens[channels[i]]] for [lowertext(channels[i])]"
|
||||
. += "<span class='notice'>A small screen on the headset displays the following available frequencies:\n[english_list(avail_chans)]."
|
||||
|
||||
if(command)
|
||||
. += "<span class='info'>Alt-click to toggle the high-volume mode.</span>"
|
||||
else
|
||||
. += "<span class='notice'>A small screen on the headset flashes, it's too small to read without holding or wearing the headset.</span>"
|
||||
|
||||
/obj/item/radio/headset/Initialize()
|
||||
. = ..()
|
||||
recalculateChannels()
|
||||
|
||||
/obj/item/radio/headset/Destroy()
|
||||
QDEL_NULL(keyslot2)
|
||||
return ..()
|
||||
|
||||
/obj/item/radio/headset/talk_into(mob/living/M, message, channel, list/spans,datum/language/language)
|
||||
if (!listening)
|
||||
return ITALICS | REDUCE_RANGE
|
||||
return ..()
|
||||
|
||||
/obj/item/radio/headset/can_receive(freq, level, AIuser)
|
||||
if(ishuman(src.loc))
|
||||
var/mob/living/carbon/human/H = src.loc
|
||||
if(H.ears == src)
|
||||
return ..(freq, level)
|
||||
else if(AIuser)
|
||||
return ..(freq, level)
|
||||
return FALSE
|
||||
|
||||
/obj/item/radio/headset/syndicate //disguised to look like a normal headset for stealth ops
|
||||
|
||||
/obj/item/radio/headset/syndicate/alt //undisguised bowman with flash protection
|
||||
name = "syndicate headset"
|
||||
desc = "A syndicate headset that can be used to hear all radio frequencies. Protects ears from flashbangs."
|
||||
icon_state = "syndie_headset"
|
||||
item_state = "syndie_headset"
|
||||
|
||||
/obj/item/radio/headset/syndicate/alt/ComponentInitialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/wearertargeting/earprotection, list(SLOT_EARS))
|
||||
|
||||
/obj/item/radio/headset/syndicate/alt/leader
|
||||
name = "team leader headset"
|
||||
command = TRUE
|
||||
|
||||
/obj/item/radio/headset/syndicate/Initialize()
|
||||
. = ..()
|
||||
make_syndie()
|
||||
|
||||
/obj/item/radio/headset/binary
|
||||
/obj/item/radio/headset/binary/Initialize()
|
||||
. = ..()
|
||||
qdel(keyslot)
|
||||
keyslot = new /obj/item/encryptionkey/binary
|
||||
recalculateChannels()
|
||||
|
||||
/obj/item/radio/headset/headset_sec
|
||||
name = "security radio headset"
|
||||
desc = "This is used by your elite security force."
|
||||
icon_state = "sec_headset"
|
||||
keyslot = new /obj/item/encryptionkey/headset_sec
|
||||
|
||||
/obj/item/radio/headset/headset_sec/alt
|
||||
name = "security bowman headset"
|
||||
desc = "This is used by your elite security force. Protects ears from flashbangs."
|
||||
icon_state = "sec_headset_alt"
|
||||
item_state = "sec_headset_alt"
|
||||
|
||||
/obj/item/radio/headset/headset_sec/alt/ComponentInitialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/wearertargeting/earprotection, list(SLOT_EARS))
|
||||
|
||||
/obj/item/radio/headset/headset_eng
|
||||
name = "engineering radio headset"
|
||||
desc = "When the engineers wish to chat like girls."
|
||||
icon_state = "eng_headset"
|
||||
keyslot = new /obj/item/encryptionkey/headset_eng
|
||||
|
||||
/obj/item/radio/headset/headset_rob
|
||||
name = "robotics radio headset"
|
||||
desc = "Made specifically for the roboticists, who cannot decide between departments."
|
||||
icon_state = "rob_headset"
|
||||
keyslot = new /obj/item/encryptionkey/headset_rob
|
||||
|
||||
/obj/item/radio/headset/headset_med
|
||||
name = "medical radio headset"
|
||||
desc = "A headset for the trained staff of the medbay."
|
||||
icon_state = "med_headset"
|
||||
keyslot = new /obj/item/encryptionkey/headset_med
|
||||
|
||||
/obj/item/radio/headset/headset_sci
|
||||
name = "science radio headset"
|
||||
desc = "A sciency headset. Like usual."
|
||||
icon_state = "sci_headset"
|
||||
keyslot = new /obj/item/encryptionkey/headset_sci
|
||||
|
||||
/obj/item/radio/headset/headset_medsci
|
||||
name = "medical research radio headset"
|
||||
desc = "A headset that is a result of the mating between medical and science."
|
||||
icon_state = "medsci_headset"
|
||||
keyslot = new /obj/item/encryptionkey/headset_medsci
|
||||
|
||||
/obj/item/radio/headset/headset_com
|
||||
name = "command radio headset"
|
||||
desc = "A headset with a commanding channel.\nTo access the command channel, use :c."
|
||||
icon_state = "com_headset"
|
||||
keyslot = new /obj/item/encryptionkey/headset_com
|
||||
|
||||
/obj/item/radio/headset/heads
|
||||
command = TRUE
|
||||
|
||||
/obj/item/radio/headset/heads/captain
|
||||
name = "\proper the captain's headset"
|
||||
desc = "The headset of the king."
|
||||
icon_state = "com_headset"
|
||||
keyslot = new /obj/item/encryptionkey/heads/captain
|
||||
|
||||
/obj/item/radio/headset/heads/captain/alt
|
||||
name = "\proper the captain's bowman headset"
|
||||
desc = "The headset of the boss. Protects ears from flashbangs."
|
||||
icon_state = "com_headset_alt"
|
||||
item_state = "com_headset_alt"
|
||||
|
||||
/obj/item/radio/headset/heads/captain/alt/ComponentInitialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/wearertargeting/earprotection, list(SLOT_EARS))
|
||||
|
||||
/obj/item/radio/headset/heads/rd
|
||||
name = "\proper the research director's headset"
|
||||
desc = "Headset of the fellow who keeps society marching towards technological singularity."
|
||||
icon_state = "com_headset"
|
||||
keyslot = new /obj/item/encryptionkey/heads/rd
|
||||
|
||||
/obj/item/radio/headset/heads/hos
|
||||
name = "\proper the head of security's headset"
|
||||
desc = "The headset of the man in charge of keeping order and protecting the station."
|
||||
icon_state = "com_headset"
|
||||
keyslot = new /obj/item/encryptionkey/heads/hos
|
||||
|
||||
/obj/item/radio/headset/heads/hos/alt
|
||||
name = "\proper the head of security's bowman headset"
|
||||
desc = "The headset of the man in charge of keeping order and protecting the station. Protects ears from flashbangs."
|
||||
icon_state = "com_headset_alt"
|
||||
item_state = "com_headset_alt"
|
||||
|
||||
/obj/item/radio/headset/heads/hos/ComponentInitialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/wearertargeting/earprotection, list(SLOT_EARS))
|
||||
|
||||
/obj/item/radio/headset/heads/ce
|
||||
name = "\proper the chief engineer's headset"
|
||||
desc = "The headset of the guy in charge of keeping the station powered and undamaged."
|
||||
icon_state = "com_headset"
|
||||
keyslot = new /obj/item/encryptionkey/heads/ce
|
||||
|
||||
/obj/item/radio/headset/heads/cmo
|
||||
name = "\proper the chief medical officer's headset"
|
||||
desc = "The headset of the highly trained medical chief."
|
||||
icon_state = "com_headset"
|
||||
keyslot = new /obj/item/encryptionkey/heads/cmo
|
||||
|
||||
/obj/item/radio/headset/heads/hop
|
||||
name = "\proper the head of personnel's headset"
|
||||
desc = "The headset of the guy who will one day be captain."
|
||||
icon_state = "com_headset"
|
||||
keyslot = new /obj/item/encryptionkey/heads/hop
|
||||
|
||||
/obj/item/radio/headset/headset_cargo
|
||||
name = "supply radio headset"
|
||||
desc = "A headset used by the QM and his slaves."
|
||||
icon_state = "cargo_headset"
|
||||
keyslot = new /obj/item/encryptionkey/headset_cargo
|
||||
|
||||
/obj/item/radio/headset/headset_cargo/mining
|
||||
name = "mining radio headset"
|
||||
desc = "Headset used by shaft miners."
|
||||
icon_state = "mine_headset"
|
||||
keyslot = new /obj/item/encryptionkey/headset_mining
|
||||
|
||||
/obj/item/radio/headset/headset_srv
|
||||
name = "service radio headset"
|
||||
desc = "Headset used by the service staff, tasked with keeping the station full, happy and clean."
|
||||
icon_state = "srv_headset"
|
||||
keyslot = new /obj/item/encryptionkey/headset_service
|
||||
|
||||
/obj/item/radio/headset/headset_cent
|
||||
name = "\improper CentCom headset"
|
||||
desc = "A headset used by the upper echelons of Kinaris."
|
||||
icon_state = "cent_headset"
|
||||
keyslot = new /obj/item/encryptionkey/headset_com
|
||||
keyslot2 = new /obj/item/encryptionkey/headset_cent
|
||||
|
||||
/obj/item/radio/headset/headset_cent/empty
|
||||
keyslot = null
|
||||
keyslot2 = null
|
||||
|
||||
/obj/item/radio/headset/headset_cent/commander
|
||||
keyslot = new /obj/item/encryptionkey/heads/captain
|
||||
|
||||
/obj/item/radio/headset/headset_cent/alt
|
||||
name = "\improper CentCom bowman headset"
|
||||
desc = "A headset especially for emergency response personnel. Protects ears from flashbangs."
|
||||
icon_state = "cent_headset_alt"
|
||||
item_state = "cent_headset_alt"
|
||||
keyslot = null
|
||||
|
||||
/obj/item/radio/headset/headset_cent/alt/ComponentInitialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/wearertargeting/earprotection, list(SLOT_EARS))
|
||||
|
||||
/obj/item/radio/headset/ai
|
||||
name = "\proper Integrated Subspace Transceiver "
|
||||
keyslot2 = new /obj/item/encryptionkey/ai
|
||||
command = TRUE
|
||||
|
||||
/obj/item/radio/headset/ai/can_receive(freq, level)
|
||||
return ..(freq, level, TRUE)
|
||||
|
||||
/obj/item/radio/headset/attackby(obj/item/W, mob/user, params)
|
||||
user.set_machine(src)
|
||||
|
||||
if(istype(W, /obj/item/screwdriver))
|
||||
if(keyslot || keyslot2)
|
||||
for(var/ch_name in channels)
|
||||
SSradio.remove_object(src, GLOB.radiochannels[ch_name])
|
||||
secure_radio_connections[ch_name] = null
|
||||
|
||||
var/turf/T = user.drop_location()
|
||||
if(T)
|
||||
if(keyslot)
|
||||
keyslot.forceMove(T)
|
||||
keyslot = null
|
||||
if(keyslot2)
|
||||
keyslot2.forceMove(T)
|
||||
keyslot2 = null
|
||||
|
||||
recalculateChannels()
|
||||
to_chat(user, "<span class='notice'>You pop out the encryption keys in the headset.</span>")
|
||||
|
||||
else
|
||||
to_chat(user, "<span class='warning'>This headset doesn't have any unique encryption keys! How useless...</span>")
|
||||
|
||||
else if(istype(W, /obj/item/encryptionkey))
|
||||
if(keyslot && keyslot2)
|
||||
to_chat(user, "<span class='warning'>The headset can't hold another key!</span>")
|
||||
return
|
||||
|
||||
if(!keyslot)
|
||||
if(!user.transferItemToLoc(W, src))
|
||||
return
|
||||
keyslot = W
|
||||
|
||||
else
|
||||
if(!user.transferItemToLoc(W, src))
|
||||
return
|
||||
keyslot2 = W
|
||||
|
||||
|
||||
recalculateChannels()
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/item/radio/headset/recalculateChannels()
|
||||
..()
|
||||
if(keyslot2)
|
||||
for(var/ch_name in keyslot2.channels)
|
||||
if(!(ch_name in src.channels))
|
||||
channels[ch_name] = keyslot2.channels[ch_name]
|
||||
|
||||
if(keyslot2.translate_binary)
|
||||
translate_binary = TRUE
|
||||
if(keyslot2.syndie)
|
||||
syndie = TRUE
|
||||
if (keyslot2.independent)
|
||||
independent = TRUE
|
||||
|
||||
for(var/ch_name in channels)
|
||||
secure_radio_connections[ch_name] = add_radio(src, GLOB.radiochannels[ch_name])
|
||||
|
||||
/obj/item/radio/headset/AltClick(mob/living/user)
|
||||
. = ..()
|
||||
if(!istype(user) || !Adjacent(user) || user.incapacitated())
|
||||
return
|
||||
if (command)
|
||||
use_command = !use_command
|
||||
to_chat(user, "<span class='notice'>You toggle high-volume mode [use_command ? "on" : "off"].</span>")
|
||||
return TRUE
|
||||
|
||||
@@ -595,10 +595,10 @@ GENE SCANNER
|
||||
to_chat(user, "<span class='info'>Temperature: [round(environment.temperature-T0C, 0.01)] °C ([round(environment.temperature, 0.01)] K)</span>")
|
||||
|
||||
/obj/item/analyzer/AltClick(mob/user) //Barometer output for measuring when the next storm happens
|
||||
..()
|
||||
. = ..()
|
||||
|
||||
if(user.canUseTopic(src))
|
||||
|
||||
. = TRUE
|
||||
if(cooldown)
|
||||
to_chat(user, "<span class='warning'>[src]'s barometer function is preparing itself.</span>")
|
||||
return
|
||||
|
||||
@@ -138,11 +138,13 @@
|
||||
toggle_igniter(user)
|
||||
|
||||
/obj/item/flamethrower/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(ptank && isliving(user) && user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||
user.put_in_hands(ptank)
|
||||
ptank = null
|
||||
to_chat(user, "<span class='notice'>You remove the plasma tank from [src]!</span>")
|
||||
update_icon()
|
||||
return TRUE
|
||||
|
||||
/obj/item/flamethrower/examine(mob/user)
|
||||
. = ..()
|
||||
|
||||
@@ -70,6 +70,7 @@
|
||||
update_icon()
|
||||
|
||||
/obj/item/pet_carrier/AltClick(mob/living/user)
|
||||
. = ..()
|
||||
if(open || !user.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
locked = !locked
|
||||
@@ -79,6 +80,7 @@
|
||||
else
|
||||
playsound(user, 'sound/machines/boltsup.ogg', 30, TRUE)
|
||||
update_icon()
|
||||
return TRUE
|
||||
|
||||
/obj/item/pet_carrier/attack(mob/living/target, mob/living/user)
|
||||
if(user.a_intent == INTENT_HARM)
|
||||
|
||||
@@ -350,6 +350,7 @@
|
||||
. = ..()
|
||||
|
||||
/obj/item/stack/AltClick(mob/living/user)
|
||||
. = ..()
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||
return
|
||||
if(is_cyborg)
|
||||
@@ -363,10 +364,11 @@
|
||||
max = get_amount()
|
||||
stackmaterial = min(max, stackmaterial)
|
||||
if(stackmaterial == null || stackmaterial <= 0 || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||
return
|
||||
return TRUE
|
||||
else
|
||||
change_stack(user, stackmaterial)
|
||||
to_chat(user, "<span class='notice'>You take [stackmaterial] sheets out of the stack</span>")
|
||||
return TRUE
|
||||
|
||||
/obj/item/stack/proc/change_stack(mob/user, amount)
|
||||
if(!use(amount, TRUE, FALSE))
|
||||
|
||||
@@ -842,23 +842,13 @@ obj/item/storage/belt/slut/ComponentInitialize()
|
||||
STR.rustle_sound = FALSE
|
||||
STR.max_w_class = WEIGHT_CLASS_BULKY
|
||||
STR.can_hold = typecacheof(fitting_swords)
|
||||
STR.quickdraw = TRUE
|
||||
|
||||
/obj/item/storage/belt/sabre/examine(mob/user)
|
||||
. = ..()
|
||||
if(length(contents))
|
||||
. += "<span class='notice'>Alt-click it to quickly draw the blade.</span>"
|
||||
|
||||
/obj/item/storage/belt/sabre/AltClick(mob/user)
|
||||
if(!iscarbon(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||
return
|
||||
if(length(contents))
|
||||
var/obj/item/I = contents[1]
|
||||
user.visible_message("[user] takes [I] out of [src].", "<span class='notice'>You take [I] out of [src].</span>")
|
||||
user.put_in_hands(I)
|
||||
update_icon()
|
||||
else
|
||||
to_chat(user, "[src] is empty.")
|
||||
|
||||
/obj/item/storage/belt/sabre/update_icon()
|
||||
. = ..()
|
||||
if(isliving(loc))
|
||||
|
||||
@@ -1,389 +1,390 @@
|
||||
/*
|
||||
* The 'fancy' path is for objects like donut boxes that show how many items are in the storage item on the sprite itself
|
||||
* .. Sorry for the shitty path name, I couldnt think of a better one.
|
||||
*
|
||||
* WARNING: var/icon_type is used for both examine text and sprite name. Please look at the procs below and adjust your sprite names accordingly
|
||||
* TODO: Cigarette boxes should be ported to this standard
|
||||
*
|
||||
* Contains:
|
||||
* Donut Box
|
||||
* Egg Box
|
||||
* Candle Box
|
||||
* Cigarette Box
|
||||
* Cigar Case
|
||||
* Heart Shaped Box w/ Chocolates
|
||||
* Ring Box
|
||||
*/
|
||||
|
||||
/obj/item/storage/fancy
|
||||
icon = 'icons/obj/food/containers.dmi'
|
||||
icon_state = "donutbox6"
|
||||
name = "donut box"
|
||||
desc = "Mmm. Donuts."
|
||||
resistance_flags = FLAMMABLE
|
||||
var/icon_type = "donut"
|
||||
var/spawn_type = null
|
||||
var/fancy_open = FALSE
|
||||
|
||||
/obj/item/storage/fancy/PopulateContents()
|
||||
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
|
||||
for(var/i = 1 to STR.max_items)
|
||||
new spawn_type(src)
|
||||
|
||||
/obj/item/storage/fancy/update_icon()
|
||||
if(fancy_open)
|
||||
icon_state = "[icon_type]box[contents.len]"
|
||||
else
|
||||
icon_state = "[icon_type]box"
|
||||
|
||||
/obj/item/storage/fancy/examine(mob/user)
|
||||
. = ..()
|
||||
if(fancy_open)
|
||||
if(length(contents) == 1)
|
||||
. += "There is one [icon_type] left."
|
||||
else
|
||||
. += "There are [contents.len <= 0 ? "no" : "[contents.len]"] [icon_type]s left."
|
||||
|
||||
/obj/item/storage/fancy/attack_self(mob/user)
|
||||
fancy_open = !fancy_open
|
||||
update_icon()
|
||||
. = ..()
|
||||
|
||||
/obj/item/storage/fancy/Exited()
|
||||
. = ..()
|
||||
fancy_open = TRUE
|
||||
update_icon()
|
||||
|
||||
/obj/item/storage/fancy/Entered()
|
||||
. = ..()
|
||||
fancy_open = TRUE
|
||||
update_icon()
|
||||
|
||||
/*
|
||||
* Donut Box
|
||||
*/
|
||||
|
||||
/obj/item/storage/fancy/donut_box
|
||||
icon = 'icons/obj/food/containers.dmi'
|
||||
icon_state = "donutbox6"
|
||||
icon_type = "donut"
|
||||
name = "donut box"
|
||||
spawn_type = /obj/item/reagent_containers/food/snacks/donut
|
||||
fancy_open = TRUE
|
||||
|
||||
/obj/item/storage/fancy/donut_box/ComponentInitialize()
|
||||
. = ..()
|
||||
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
|
||||
STR.max_items = 6
|
||||
STR.can_hold = typecacheof(list(/obj/item/reagent_containers/food/snacks/donut))
|
||||
|
||||
/*
|
||||
* Egg Box
|
||||
*/
|
||||
|
||||
/obj/item/storage/fancy/egg_box
|
||||
icon = 'icons/obj/food/containers.dmi'
|
||||
item_state = "eggbox"
|
||||
icon_state = "eggbox"
|
||||
icon_type = "egg"
|
||||
lefthand_file = 'icons/mob/inhands/misc/food_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/misc/food_righthand.dmi'
|
||||
name = "egg box"
|
||||
desc = "A carton for containing eggs."
|
||||
spawn_type = /obj/item/reagent_containers/food/snacks/egg
|
||||
|
||||
/obj/item/storage/fancy/egg_box/ComponentInitialize()
|
||||
. = ..()
|
||||
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
|
||||
STR.max_items = 12
|
||||
STR.can_hold = typecacheof(list(/obj/item/reagent_containers/food/snacks/egg))
|
||||
|
||||
/*
|
||||
* Candle Box
|
||||
*/
|
||||
|
||||
/obj/item/storage/fancy/candle_box
|
||||
name = "candle pack"
|
||||
desc = "A pack of red candles."
|
||||
icon = 'icons/obj/candle.dmi'
|
||||
icon_state = "candlebox5"
|
||||
icon_type = "candle"
|
||||
item_state = "candlebox5"
|
||||
throwforce = 2
|
||||
slot_flags = ITEM_SLOT_BELT
|
||||
spawn_type = /obj/item/candle
|
||||
fancy_open = TRUE
|
||||
|
||||
/obj/item/storage/fancy/candle_box/ComponentInitialize()
|
||||
. = ..()
|
||||
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
|
||||
STR.max_items = 5
|
||||
|
||||
/obj/item/storage/fancy/candle_box/attack_self(mob_user)
|
||||
return
|
||||
|
||||
////////////
|
||||
//CIG PACK//
|
||||
////////////
|
||||
/obj/item/storage/fancy/cigarettes
|
||||
name = "\improper Space Cigarettes packet"
|
||||
desc = "The most popular brand of cigarettes, sponsors of the Space Olympics."
|
||||
icon = 'icons/obj/cigarettes.dmi'
|
||||
icon_state = "cig"
|
||||
item_state = "cigpacket"
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
throwforce = 0
|
||||
slot_flags = ITEM_SLOT_BELT
|
||||
icon_type = "cigarette"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/space_cigarette
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/ComponentInitialize()
|
||||
. = ..()
|
||||
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
|
||||
STR.max_items = 6
|
||||
STR.can_hold = typecacheof(list(/obj/item/clothing/mask/cigarette, /obj/item/lighter))
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>Alt-click to extract contents.</span>"
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/AltClick(mob/living/carbon/user)
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||
return
|
||||
var/obj/item/clothing/mask/cigarette/W = locate(/obj/item/clothing/mask/cigarette) in contents
|
||||
if(W && contents.len > 0)
|
||||
SEND_SIGNAL(src, COMSIG_TRY_STORAGE_TAKE, W, user)
|
||||
user.put_in_hands(W)
|
||||
contents -= W
|
||||
to_chat(user, "<span class='notice'>You take \a [W] out of the pack.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>There are no [icon_type]s left in the pack.</span>")
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/update_icon()
|
||||
if(fancy_open || !contents.len)
|
||||
cut_overlays()
|
||||
if(!contents.len)
|
||||
icon_state = "[initial(icon_state)]_empty"
|
||||
else
|
||||
icon_state = initial(icon_state)
|
||||
add_overlay("[icon_state]_open")
|
||||
var/cig_position = 1
|
||||
for(var/C in contents)
|
||||
var/mutable_appearance/inserted_overlay = mutable_appearance(icon)
|
||||
|
||||
if(istype(C, /obj/item/lighter/greyscale))
|
||||
inserted_overlay.icon_state = "lighter_in"
|
||||
else if(istype(C, /obj/item/lighter))
|
||||
inserted_overlay.icon_state = "zippo_in"
|
||||
else
|
||||
inserted_overlay.icon_state = "cigarette"
|
||||
|
||||
inserted_overlay.icon_state = "[inserted_overlay.icon_state]_[cig_position]"
|
||||
add_overlay(inserted_overlay)
|
||||
cig_position++
|
||||
else
|
||||
cut_overlays()
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
|
||||
if(!ismob(M))
|
||||
return
|
||||
var/obj/item/clothing/mask/cigarette/cig = locate(/obj/item/clothing/mask/cigarette) in contents
|
||||
if(cig)
|
||||
if(M == user && contents.len > 0 && !user.wear_mask)
|
||||
var/obj/item/clothing/mask/cigarette/W = cig
|
||||
SEND_SIGNAL(src, COMSIG_TRY_STORAGE_TAKE, W, M)
|
||||
M.equip_to_slot_if_possible(W, SLOT_WEAR_MASK)
|
||||
contents -= W
|
||||
to_chat(user, "<span class='notice'>You take \a [W] out of the pack.</span>")
|
||||
else
|
||||
..()
|
||||
else
|
||||
to_chat(user, "<span class='notice'>There are no [icon_type]s left in the pack.</span>")
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/dromedaryco
|
||||
name = "\improper DromedaryCo packet"
|
||||
desc = "A packet of six imported DromedaryCo cancer sticks. A label on the packaging reads, \"Wouldn't a slow death make a change?\""
|
||||
icon_state = "dromedary"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/dromedary
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/smokekins
|
||||
name = "\improper smokekins packet"
|
||||
desc = "Let the Radiance fill your lungs"
|
||||
icon_state = "smokekins"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/smokekins
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigpack_uplift
|
||||
name = "\improper Uplift Smooth packet"
|
||||
desc = "Your favorite brand, now menthol flavored."
|
||||
icon_state = "uplift"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/uplift
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigpack_robust
|
||||
name = "\improper Robust packet"
|
||||
desc = "Smoked by the robust."
|
||||
icon_state = "robust"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/robust
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigpack_robustgold
|
||||
name = "\improper Robust Gold packet"
|
||||
desc = "Smoked by the truly robust."
|
||||
icon_state = "robustg"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/robustgold
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigpack_carp
|
||||
name = "\improper Carp Classic packet"
|
||||
desc = "Since 2313."
|
||||
icon_state = "carp"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/carp
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigpack_syndicate
|
||||
name = "cigarette packet"
|
||||
desc = "An obscure brand of cigarettes."
|
||||
icon_state = "syndie"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/syndicate
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigpack_midori
|
||||
name = "\improper Midori Tabako packet"
|
||||
desc = "You can't understand the runes, but the packet smells funny."
|
||||
icon_state = "midori"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/rollie/nicotine
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigpack_shadyjims
|
||||
name = "\improper Shady Jim's Super Slims packet"
|
||||
desc = "Is your weight slowing you down? Having trouble running away from gravitational singularities? Can't stop stuffing your mouth? Smoke Shady Jim's Super Slims and watch all that fat burn away. Guaranteed results!"
|
||||
icon_state = "shadyjim"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/shadyjims
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigpack_xeno
|
||||
name = "\improper Xeno Filtered packet"
|
||||
desc = "Loaded with 100% pure slime. And also nicotine."
|
||||
icon_state = "slime"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/xeno
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigpack_cannabis
|
||||
name = "\improper Freak Brothers' Special packet"
|
||||
desc = "A label on the packaging reads, \"Endorsed by Phineas, Freddy and Franklin.\""
|
||||
icon_state = "midori"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/rollie/cannabis
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigpack_mindbreaker
|
||||
name = "\improper Leary's Delight packet"
|
||||
desc = "Banned in over 36 galaxies."
|
||||
icon_state = "shadyjim"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/rollie/mindbreaker
|
||||
|
||||
/obj/item/storage/fancy/rollingpapers
|
||||
name = "rolling paper pack"
|
||||
desc = "A pack of Kinaris brand rolling papers."
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
icon = 'icons/obj/cigarettes.dmi'
|
||||
icon_state = "cig_paper_pack"
|
||||
icon_type = "rolling paper"
|
||||
spawn_type = /obj/item/rollingpaper
|
||||
|
||||
/obj/item/storage/fancy/rollingpapers/ComponentInitialize()
|
||||
. = ..()
|
||||
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
|
||||
STR.max_items = 10
|
||||
STR.can_hold = typecacheof(list(/obj/item/rollingpaper))
|
||||
|
||||
/obj/item/storage/fancy/rollingpapers/update_icon()
|
||||
cut_overlays()
|
||||
if(!contents.len)
|
||||
add_overlay("[icon_state]_empty")
|
||||
|
||||
/////////////
|
||||
//CIGAR BOX//
|
||||
/////////////
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigars
|
||||
name = "\improper premium cigar case"
|
||||
desc = "A case of premium cigars. Very expensive."
|
||||
icon = 'icons/obj/cigarettes.dmi'
|
||||
icon_state = "cigarcase"
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
icon_type = "premium cigar"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/cigar
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigars/ComponentInitialize()
|
||||
. = ..()
|
||||
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
|
||||
STR.max_items = 5
|
||||
STR.can_hold = typecacheof(list(/obj/item/clothing/mask/cigarette/cigar))
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigars/update_icon()
|
||||
cut_overlays()
|
||||
if(fancy_open)
|
||||
icon_state = "[initial(icon_state)]_open"
|
||||
|
||||
var/cigar_position = 1 //generate sprites for cigars in the box
|
||||
for(var/obj/item/clothing/mask/cigarette/cigar/smokes in contents)
|
||||
var/mutable_appearance/cigar_overlay = mutable_appearance(icon, "[smokes.icon_off]_[cigar_position]")
|
||||
add_overlay(cigar_overlay)
|
||||
cigar_position++
|
||||
|
||||
else
|
||||
icon_state = "[initial(icon_state)]"
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigars/cohiba
|
||||
name = "\improper Cohiba Robusto cigar case"
|
||||
desc = "A case of imported Cohiba cigars, renowned for their strong flavor."
|
||||
icon_state = "cohibacase"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/cigar/cohiba
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigars/havana
|
||||
name = "\improper premium Havanian cigar case"
|
||||
desc = "A case of classy Havanian cigars."
|
||||
icon_state = "cohibacase"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/cigar/havana
|
||||
|
||||
/*
|
||||
* Heart Shaped Box w/ Chocolates
|
||||
*/
|
||||
|
||||
/obj/item/storage/fancy/heart_box
|
||||
name = "heart-shaped box"
|
||||
desc = "A heart-shaped box for holding tiny chocolates."
|
||||
icon = 'icons/obj/food/containers.dmi'
|
||||
item_state = "chocolatebox"
|
||||
icon_state = "chocolatebox"
|
||||
icon_type = "chocolate"
|
||||
lefthand_file = 'icons/mob/inhands/misc/food_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/misc/food_righthand.dmi'
|
||||
spawn_type = /obj/item/reagent_containers/food/snacks/tinychocolate
|
||||
|
||||
/obj/item/storage/fancy/heart_box/ComponentInitialize()
|
||||
. = ..()
|
||||
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
|
||||
STR.max_items = 8
|
||||
STR.can_hold = typecacheof(list(/obj/item/reagent_containers/food/snacks/tinychocolate))
|
||||
|
||||
/*
|
||||
* Ring Box
|
||||
*/
|
||||
|
||||
/obj/item/storage/fancy/ringbox
|
||||
name = "ring box"
|
||||
desc = "A tiny box covered in soft red felt made for holding rings."
|
||||
icon = 'icons/obj/ring.dmi'
|
||||
icon_state = "gold ringbox"
|
||||
icon_type = "gold ring"
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
spawn_type = /obj/item/clothing/gloves/ring
|
||||
|
||||
/obj/item/storage/fancy/ringbox/ComponentInitialize()
|
||||
. = ..()
|
||||
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
|
||||
STR.max_items = 1
|
||||
STR.can_hold = typecacheof(list(/obj/item/clothing/gloves/ring))
|
||||
|
||||
/obj/item/storage/fancy/ringbox/diamond
|
||||
icon_state = "diamond ringbox"
|
||||
icon_type = "diamond ring"
|
||||
spawn_type = /obj/item/clothing/gloves/ring/diamond
|
||||
|
||||
/obj/item/storage/fancy/ringbox/silver
|
||||
icon_state = "silver ringbox"
|
||||
icon_type = "silver ring"
|
||||
spawn_type = /obj/item/clothing/gloves/ring/silver
|
||||
|
||||
/*
|
||||
* The 'fancy' path is for objects like donut boxes that show how many items are in the storage item on the sprite itself
|
||||
* .. Sorry for the shitty path name, I couldnt think of a better one.
|
||||
*
|
||||
* WARNING: var/icon_type is used for both examine text and sprite name. Please look at the procs below and adjust your sprite names accordingly
|
||||
* TODO: Cigarette boxes should be ported to this standard
|
||||
*
|
||||
* Contains:
|
||||
* Donut Box
|
||||
* Egg Box
|
||||
* Candle Box
|
||||
* Cigarette Box
|
||||
* Cigar Case
|
||||
* Heart Shaped Box w/ Chocolates
|
||||
* Ring Box
|
||||
*/
|
||||
|
||||
/obj/item/storage/fancy
|
||||
icon = 'icons/obj/food/containers.dmi'
|
||||
icon_state = "donutbox6"
|
||||
name = "donut box"
|
||||
desc = "Mmm. Donuts."
|
||||
resistance_flags = FLAMMABLE
|
||||
var/icon_type = "donut"
|
||||
var/spawn_type = null
|
||||
var/fancy_open = FALSE
|
||||
|
||||
/obj/item/storage/fancy/PopulateContents()
|
||||
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
|
||||
for(var/i = 1 to STR.max_items)
|
||||
new spawn_type(src)
|
||||
|
||||
/obj/item/storage/fancy/update_icon()
|
||||
if(fancy_open)
|
||||
icon_state = "[icon_type]box[contents.len]"
|
||||
else
|
||||
icon_state = "[icon_type]box"
|
||||
|
||||
/obj/item/storage/fancy/examine(mob/user)
|
||||
. = ..()
|
||||
if(fancy_open)
|
||||
if(length(contents) == 1)
|
||||
. += "There is one [icon_type] left."
|
||||
else
|
||||
. += "There are [contents.len <= 0 ? "no" : "[contents.len]"] [icon_type]s left."
|
||||
|
||||
/obj/item/storage/fancy/attack_self(mob/user)
|
||||
fancy_open = !fancy_open
|
||||
update_icon()
|
||||
. = ..()
|
||||
|
||||
/obj/item/storage/fancy/Exited()
|
||||
. = ..()
|
||||
fancy_open = TRUE
|
||||
update_icon()
|
||||
|
||||
/obj/item/storage/fancy/Entered()
|
||||
. = ..()
|
||||
fancy_open = TRUE
|
||||
update_icon()
|
||||
|
||||
/*
|
||||
* Donut Box
|
||||
*/
|
||||
|
||||
/obj/item/storage/fancy/donut_box
|
||||
icon = 'icons/obj/food/containers.dmi'
|
||||
icon_state = "donutbox6"
|
||||
icon_type = "donut"
|
||||
name = "donut box"
|
||||
spawn_type = /obj/item/reagent_containers/food/snacks/donut
|
||||
fancy_open = TRUE
|
||||
|
||||
/obj/item/storage/fancy/donut_box/ComponentInitialize()
|
||||
. = ..()
|
||||
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
|
||||
STR.max_items = 6
|
||||
STR.can_hold = typecacheof(list(/obj/item/reagent_containers/food/snacks/donut))
|
||||
|
||||
/*
|
||||
* Egg Box
|
||||
*/
|
||||
|
||||
/obj/item/storage/fancy/egg_box
|
||||
icon = 'icons/obj/food/containers.dmi'
|
||||
item_state = "eggbox"
|
||||
icon_state = "eggbox"
|
||||
icon_type = "egg"
|
||||
lefthand_file = 'icons/mob/inhands/misc/food_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/misc/food_righthand.dmi'
|
||||
name = "egg box"
|
||||
desc = "A carton for containing eggs."
|
||||
spawn_type = /obj/item/reagent_containers/food/snacks/egg
|
||||
|
||||
/obj/item/storage/fancy/egg_box/ComponentInitialize()
|
||||
. = ..()
|
||||
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
|
||||
STR.max_items = 12
|
||||
STR.can_hold = typecacheof(list(/obj/item/reagent_containers/food/snacks/egg))
|
||||
|
||||
/*
|
||||
* Candle Box
|
||||
*/
|
||||
|
||||
/obj/item/storage/fancy/candle_box
|
||||
name = "candle pack"
|
||||
desc = "A pack of red candles."
|
||||
icon = 'icons/obj/candle.dmi'
|
||||
icon_state = "candlebox5"
|
||||
icon_type = "candle"
|
||||
item_state = "candlebox5"
|
||||
throwforce = 2
|
||||
slot_flags = ITEM_SLOT_BELT
|
||||
spawn_type = /obj/item/candle
|
||||
fancy_open = TRUE
|
||||
|
||||
/obj/item/storage/fancy/candle_box/ComponentInitialize()
|
||||
. = ..()
|
||||
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
|
||||
STR.max_items = 5
|
||||
|
||||
/obj/item/storage/fancy/candle_box/attack_self(mob_user)
|
||||
return
|
||||
|
||||
////////////
|
||||
//CIG PACK//
|
||||
////////////
|
||||
/obj/item/storage/fancy/cigarettes
|
||||
name = "\improper Space Cigarettes packet"
|
||||
desc = "The most popular brand of cigarettes, sponsors of the Space Olympics."
|
||||
icon = 'icons/obj/cigarettes.dmi'
|
||||
icon_state = "cig"
|
||||
item_state = "cigpacket"
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
throwforce = 0
|
||||
slot_flags = ITEM_SLOT_BELT
|
||||
icon_type = "cigarette"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/space_cigarette
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/ComponentInitialize()
|
||||
. = ..()
|
||||
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
|
||||
STR.max_items = 6
|
||||
STR.can_hold = typecacheof(list(/obj/item/clothing/mask/cigarette, /obj/item/lighter))
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>Alt-click to extract contents.</span>"
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/AltClick(mob/living/carbon/user)
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||
return
|
||||
var/obj/item/clothing/mask/cigarette/W = locate(/obj/item/clothing/mask/cigarette) in contents
|
||||
if(W && contents.len > 0)
|
||||
SEND_SIGNAL(src, COMSIG_TRY_STORAGE_TAKE, W, user)
|
||||
user.put_in_hands(W)
|
||||
contents -= W
|
||||
to_chat(user, "<span class='notice'>You take \a [W] out of the pack.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>There are no [icon_type]s left in the pack.</span>")
|
||||
return TRUE
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/update_icon()
|
||||
if(fancy_open || !contents.len)
|
||||
cut_overlays()
|
||||
if(!contents.len)
|
||||
icon_state = "[initial(icon_state)]_empty"
|
||||
else
|
||||
icon_state = initial(icon_state)
|
||||
add_overlay("[icon_state]_open")
|
||||
var/cig_position = 1
|
||||
for(var/C in contents)
|
||||
var/mutable_appearance/inserted_overlay = mutable_appearance(icon)
|
||||
|
||||
if(istype(C, /obj/item/lighter/greyscale))
|
||||
inserted_overlay.icon_state = "lighter_in"
|
||||
else if(istype(C, /obj/item/lighter))
|
||||
inserted_overlay.icon_state = "zippo_in"
|
||||
else
|
||||
inserted_overlay.icon_state = "cigarette"
|
||||
|
||||
inserted_overlay.icon_state = "[inserted_overlay.icon_state]_[cig_position]"
|
||||
add_overlay(inserted_overlay)
|
||||
cig_position++
|
||||
else
|
||||
cut_overlays()
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
|
||||
if(!ismob(M))
|
||||
return
|
||||
var/obj/item/clothing/mask/cigarette/cig = locate(/obj/item/clothing/mask/cigarette) in contents
|
||||
if(cig)
|
||||
if(M == user && contents.len > 0 && !user.wear_mask)
|
||||
var/obj/item/clothing/mask/cigarette/W = cig
|
||||
SEND_SIGNAL(src, COMSIG_TRY_STORAGE_TAKE, W, M)
|
||||
M.equip_to_slot_if_possible(W, SLOT_WEAR_MASK)
|
||||
contents -= W
|
||||
to_chat(user, "<span class='notice'>You take \a [W] out of the pack.</span>")
|
||||
else
|
||||
..()
|
||||
else
|
||||
to_chat(user, "<span class='notice'>There are no [icon_type]s left in the pack.</span>")
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/dromedaryco
|
||||
name = "\improper DromedaryCo packet"
|
||||
desc = "A packet of six imported DromedaryCo cancer sticks. A label on the packaging reads, \"Wouldn't a slow death make a change?\""
|
||||
icon_state = "dromedary"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/dromedary
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/smokekins
|
||||
name = "\improper smokekins packet"
|
||||
desc = "Let the Radiance fill your lungs"
|
||||
icon_state = "smokekins"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/smokekins
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigpack_uplift
|
||||
name = "\improper Uplift Smooth packet"
|
||||
desc = "Your favorite brand, now menthol flavored."
|
||||
icon_state = "uplift"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/uplift
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigpack_robust
|
||||
name = "\improper Robust packet"
|
||||
desc = "Smoked by the robust."
|
||||
icon_state = "robust"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/robust
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigpack_robustgold
|
||||
name = "\improper Robust Gold packet"
|
||||
desc = "Smoked by the truly robust."
|
||||
icon_state = "robustg"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/robustgold
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigpack_carp
|
||||
name = "\improper Carp Classic packet"
|
||||
desc = "Since 2313."
|
||||
icon_state = "carp"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/carp
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigpack_syndicate
|
||||
name = "cigarette packet"
|
||||
desc = "An obscure brand of cigarettes."
|
||||
icon_state = "syndie"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/syndicate
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigpack_midori
|
||||
name = "\improper Midori Tabako packet"
|
||||
desc = "You can't understand the runes, but the packet smells funny."
|
||||
icon_state = "midori"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/rollie/nicotine
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigpack_shadyjims
|
||||
name = "\improper Shady Jim's Super Slims packet"
|
||||
desc = "Is your weight slowing you down? Having trouble running away from gravitational singularities? Can't stop stuffing your mouth? Smoke Shady Jim's Super Slims and watch all that fat burn away. Guaranteed results!"
|
||||
icon_state = "shadyjim"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/shadyjims
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigpack_xeno
|
||||
name = "\improper Xeno Filtered packet"
|
||||
desc = "Loaded with 100% pure slime. And also nicotine."
|
||||
icon_state = "slime"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/xeno
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigpack_cannabis
|
||||
name = "\improper Freak Brothers' Special packet"
|
||||
desc = "A label on the packaging reads, \"Endorsed by Phineas, Freddy and Franklin.\""
|
||||
icon_state = "midori"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/rollie/cannabis
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigpack_mindbreaker
|
||||
name = "\improper Leary's Delight packet"
|
||||
desc = "Banned in over 36 galaxies."
|
||||
icon_state = "shadyjim"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/rollie/mindbreaker
|
||||
|
||||
/obj/item/storage/fancy/rollingpapers
|
||||
name = "rolling paper pack"
|
||||
desc = "A pack of Kinaris brand rolling papers."
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
icon = 'icons/obj/cigarettes.dmi'
|
||||
icon_state = "cig_paper_pack"
|
||||
icon_type = "rolling paper"
|
||||
spawn_type = /obj/item/rollingpaper
|
||||
|
||||
/obj/item/storage/fancy/rollingpapers/ComponentInitialize()
|
||||
. = ..()
|
||||
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
|
||||
STR.max_items = 10
|
||||
STR.can_hold = typecacheof(list(/obj/item/rollingpaper))
|
||||
|
||||
/obj/item/storage/fancy/rollingpapers/update_icon()
|
||||
cut_overlays()
|
||||
if(!contents.len)
|
||||
add_overlay("[icon_state]_empty")
|
||||
|
||||
/////////////
|
||||
//CIGAR BOX//
|
||||
/////////////
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigars
|
||||
name = "\improper premium cigar case"
|
||||
desc = "A case of premium cigars. Very expensive."
|
||||
icon = 'icons/obj/cigarettes.dmi'
|
||||
icon_state = "cigarcase"
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
icon_type = "premium cigar"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/cigar
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigars/ComponentInitialize()
|
||||
. = ..()
|
||||
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
|
||||
STR.max_items = 5
|
||||
STR.can_hold = typecacheof(list(/obj/item/clothing/mask/cigarette/cigar))
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigars/update_icon()
|
||||
cut_overlays()
|
||||
if(fancy_open)
|
||||
icon_state = "[initial(icon_state)]_open"
|
||||
|
||||
var/cigar_position = 1 //generate sprites for cigars in the box
|
||||
for(var/obj/item/clothing/mask/cigarette/cigar/smokes in contents)
|
||||
var/mutable_appearance/cigar_overlay = mutable_appearance(icon, "[smokes.icon_off]_[cigar_position]")
|
||||
add_overlay(cigar_overlay)
|
||||
cigar_position++
|
||||
|
||||
else
|
||||
icon_state = "[initial(icon_state)]"
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigars/cohiba
|
||||
name = "\improper Cohiba Robusto cigar case"
|
||||
desc = "A case of imported Cohiba cigars, renowned for their strong flavor."
|
||||
icon_state = "cohibacase"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/cigar/cohiba
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigars/havana
|
||||
name = "\improper premium Havanian cigar case"
|
||||
desc = "A case of classy Havanian cigars."
|
||||
icon_state = "cohibacase"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/cigar/havana
|
||||
|
||||
/*
|
||||
* Heart Shaped Box w/ Chocolates
|
||||
*/
|
||||
|
||||
/obj/item/storage/fancy/heart_box
|
||||
name = "heart-shaped box"
|
||||
desc = "A heart-shaped box for holding tiny chocolates."
|
||||
icon = 'icons/obj/food/containers.dmi'
|
||||
item_state = "chocolatebox"
|
||||
icon_state = "chocolatebox"
|
||||
icon_type = "chocolate"
|
||||
lefthand_file = 'icons/mob/inhands/misc/food_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/misc/food_righthand.dmi'
|
||||
spawn_type = /obj/item/reagent_containers/food/snacks/tinychocolate
|
||||
|
||||
/obj/item/storage/fancy/heart_box/ComponentInitialize()
|
||||
. = ..()
|
||||
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
|
||||
STR.max_items = 8
|
||||
STR.can_hold = typecacheof(list(/obj/item/reagent_containers/food/snacks/tinychocolate))
|
||||
|
||||
/*
|
||||
* Ring Box
|
||||
*/
|
||||
|
||||
/obj/item/storage/fancy/ringbox
|
||||
name = "ring box"
|
||||
desc = "A tiny box covered in soft red felt made for holding rings."
|
||||
icon = 'icons/obj/ring.dmi'
|
||||
icon_state = "gold ringbox"
|
||||
icon_type = "gold ring"
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
spawn_type = /obj/item/clothing/gloves/ring
|
||||
|
||||
/obj/item/storage/fancy/ringbox/ComponentInitialize()
|
||||
. = ..()
|
||||
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
|
||||
STR.max_items = 1
|
||||
STR.can_hold = typecacheof(list(/obj/item/clothing/gloves/ring))
|
||||
|
||||
/obj/item/storage/fancy/ringbox/diamond
|
||||
icon_state = "diamond ringbox"
|
||||
icon_type = "diamond ring"
|
||||
spawn_type = /obj/item/clothing/gloves/ring/diamond
|
||||
|
||||
/obj/item/storage/fancy/ringbox/silver
|
||||
icon_state = "silver ringbox"
|
||||
icon_type = "silver ring"
|
||||
spawn_type = /obj/item/clothing/gloves/ring/silver
|
||||
|
||||
|
||||
@@ -1,198 +1,199 @@
|
||||
/obj/item/storage/lockbox
|
||||
name = "lockbox"
|
||||
desc = "A locked box."
|
||||
icon_state = "lockbox+l"
|
||||
item_state = "syringe_kit"
|
||||
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
req_access = list(ACCESS_ARMORY)
|
||||
var/broken = FALSE
|
||||
var/open = FALSE
|
||||
var/icon_locked = "lockbox+l"
|
||||
var/icon_closed = "lockbox"
|
||||
var/icon_broken = "lockbox+b"
|
||||
|
||||
/obj/item/storage/lockbox/ComponentInitialize()
|
||||
. = ..()
|
||||
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
|
||||
STR.max_w_class = WEIGHT_CLASS_NORMAL
|
||||
STR.max_combined_w_class = 14
|
||||
STR.max_items = 4
|
||||
STR.locked = TRUE
|
||||
|
||||
/obj/item/storage/lockbox/attackby(obj/item/W, mob/user, params)
|
||||
var/locked = SEND_SIGNAL(src, COMSIG_IS_STORAGE_LOCKED)
|
||||
if(W.GetID())
|
||||
if(broken)
|
||||
to_chat(user, "<span class='danger'>It appears to be broken.</span>")
|
||||
return
|
||||
if(allowed(user))
|
||||
SEND_SIGNAL(src, COMSIG_TRY_STORAGE_SET_LOCKSTATE, !locked)
|
||||
locked = SEND_SIGNAL(src, COMSIG_IS_STORAGE_LOCKED)
|
||||
if(locked)
|
||||
icon_state = icon_locked
|
||||
to_chat(user, "<span class='danger'>You lock the [src.name]!</span>")
|
||||
SEND_SIGNAL(src, COMSIG_TRY_STORAGE_HIDE_ALL)
|
||||
return
|
||||
else
|
||||
icon_state = icon_closed
|
||||
to_chat(user, "<span class='danger'>You unlock the [src.name]!</span>")
|
||||
return
|
||||
else
|
||||
to_chat(user, "<span class='danger'>Access Denied.</span>")
|
||||
return
|
||||
if(!locked)
|
||||
return ..()
|
||||
else
|
||||
to_chat(user, "<span class='danger'>It's locked!</span>")
|
||||
|
||||
/obj/item/storage/lockbox/emag_act(mob/user)
|
||||
if(!broken)
|
||||
broken = TRUE
|
||||
SEND_SIGNAL(src, COMSIG_TRY_STORAGE_SET_LOCKSTATE, FALSE)
|
||||
desc += "It appears to be broken."
|
||||
icon_state = src.icon_broken
|
||||
if(user)
|
||||
visible_message("<span class='warning'>\The [src] has been broken by [user] with an electromagnetic card!</span>")
|
||||
return
|
||||
|
||||
/obj/item/storage/lockbox/Entered()
|
||||
. = ..()
|
||||
open = TRUE
|
||||
update_icon()
|
||||
|
||||
/obj/item/storage/lockbox/Exited()
|
||||
. = ..()
|
||||
open = TRUE
|
||||
update_icon()
|
||||
|
||||
/obj/item/storage/lockbox/loyalty
|
||||
name = "lockbox of mindshield implants"
|
||||
req_access = list(ACCESS_SECURITY)
|
||||
|
||||
/obj/item/storage/lockbox/loyalty/PopulateContents()
|
||||
for(var/i in 1 to 3)
|
||||
new /obj/item/implantcase/mindshield(src)
|
||||
new /obj/item/implanter/mindshield(src)
|
||||
|
||||
/obj/item/storage/lockbox/clusterbang
|
||||
name = "lockbox of clusterbangs"
|
||||
desc = "You have a bad feeling about opening this."
|
||||
req_access = list(ACCESS_SECURITY)
|
||||
|
||||
/obj/item/storage/lockbox/clusterbang/PopulateContents()
|
||||
new /obj/item/grenade/clusterbuster(src)
|
||||
|
||||
/obj/item/storage/lockbox/medal
|
||||
name = "medal box"
|
||||
desc = "A locked box used to store medals of honor."
|
||||
icon_state = "medalbox+l"
|
||||
item_state = "syringe_kit"
|
||||
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
req_access = list(ACCESS_CAPTAIN)
|
||||
icon_locked = "medalbox+l"
|
||||
icon_closed = "medalbox"
|
||||
icon_broken = "medalbox+b"
|
||||
|
||||
/obj/item/storage/lockbox/medal/ComponentInitialize()
|
||||
. = ..()
|
||||
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
|
||||
STR.max_w_class = WEIGHT_CLASS_SMALL
|
||||
STR.max_items = 10
|
||||
STR.max_combined_w_class = 20
|
||||
STR.can_hold = typecacheof(list(/obj/item/clothing/accessory/medal))
|
||||
|
||||
/obj/item/storage/lockbox/medal/examine(mob/user)
|
||||
. = ..()
|
||||
var/locked = SEND_SIGNAL(src, COMSIG_IS_STORAGE_LOCKED)
|
||||
if(!locked)
|
||||
. += "<span class='notice'>Alt-click to [open ? "close":"open"] it.</span>"
|
||||
|
||||
/obj/item/storage/lockbox/medal/AltClick(mob/user)
|
||||
if(user.canUseTopic(src, BE_CLOSE))
|
||||
if(!SEND_SIGNAL(src, COMSIG_IS_STORAGE_LOCKED))
|
||||
open = (open ? FALSE : TRUE)
|
||||
update_icon()
|
||||
..()
|
||||
|
||||
/obj/item/storage/lockbox/medal/PopulateContents()
|
||||
new /obj/item/clothing/accessory/medal/gold/captain(src)
|
||||
new /obj/item/clothing/accessory/medal/silver/valor(src)
|
||||
new /obj/item/clothing/accessory/medal/silver/valor(src)
|
||||
new /obj/item/clothing/accessory/medal/silver/security(src)
|
||||
new /obj/item/clothing/accessory/medal/bronze_heart(src)
|
||||
new /obj/item/clothing/accessory/medal/plasma/nobel_science(src)
|
||||
new /obj/item/clothing/accessory/medal/plasma/nobel_science(src)
|
||||
for(var/i in 1 to 3)
|
||||
new /obj/item/clothing/accessory/medal/conduct(src)
|
||||
|
||||
/obj/item/storage/lockbox/medal/update_icon()
|
||||
cut_overlays()
|
||||
var/locked = SEND_SIGNAL(src, COMSIG_IS_STORAGE_LOCKED)
|
||||
if(locked)
|
||||
icon_state = "medalbox+l"
|
||||
open = FALSE
|
||||
else
|
||||
icon_state = "medalbox"
|
||||
if(open)
|
||||
icon_state += "open"
|
||||
if(broken)
|
||||
icon_state += "+b"
|
||||
if(contents && open)
|
||||
for (var/i in 1 to contents.len)
|
||||
var/obj/item/clothing/accessory/medal/M = contents[i]
|
||||
var/mutable_appearance/medalicon = mutable_appearance(initial(icon), M.medaltype)
|
||||
if(i > 1 && i <= 5)
|
||||
medalicon.pixel_x += ((i-1)*3)
|
||||
else if(i > 5)
|
||||
medalicon.pixel_y -= 7
|
||||
medalicon.pixel_x -= 2
|
||||
medalicon.pixel_x += ((i-6)*3)
|
||||
add_overlay(medalicon)
|
||||
|
||||
/obj/item/storage/lockbox/medal/sec
|
||||
name = "security medal box"
|
||||
desc = "A locked box used to store medals to be given to members of the security department."
|
||||
req_access = list(ACCESS_HOS)
|
||||
|
||||
/obj/item/storage/lockbox/medal/sec/PopulateContents()
|
||||
for(var/i in 1 to 3)
|
||||
new /obj/item/clothing/accessory/medal/silver/security(src)
|
||||
|
||||
/obj/item/storage/lockbox/medal/cargo
|
||||
name = "cargo award box"
|
||||
desc = "A locked box used to store awards to be given to members of the cargo department."
|
||||
req_access = list(ACCESS_QM)
|
||||
|
||||
/obj/item/storage/lockbox/medal/cargo/PopulateContents()
|
||||
new /obj/item/clothing/accessory/medal/ribbon/cargo(src)
|
||||
|
||||
/obj/item/storage/lockbox/medal/sci
|
||||
name = "science medal box"
|
||||
desc = "A locked box used to store medals to be given to members of the science department."
|
||||
req_access = list(ACCESS_RD)
|
||||
|
||||
/obj/item/storage/lockbox/medal/sci/PopulateContents()
|
||||
for(var/i in 1 to 3)
|
||||
new /obj/item/clothing/accessory/medal/plasma/nobel_science(src)
|
||||
|
||||
/obj/item/storage/lockbox/medal/engineering
|
||||
name = "engineering medal box"
|
||||
desc = "A locked box used to store medals to be given to the members of the engineering department."
|
||||
req_access = list(ACCESS_CE)
|
||||
|
||||
/obj/item/storage/lockbox/medal/engineering/PopulateContents()
|
||||
for(var/i in 1 to 3)
|
||||
new /obj/item/clothing/accessory/medal/engineer(src)
|
||||
|
||||
/obj/item/storage/lockbox/medal/medical
|
||||
name = "medical medal box"
|
||||
desc = "A locked box used to store medals to be given to the members of the medical department."
|
||||
req_access = list(ACCESS_CMO)
|
||||
|
||||
/obj/item/storage/lockbox/medal/medical/PopulateContents()
|
||||
for(var/i in 1 to 3)
|
||||
new /obj/item/clothing/accessory/medal/ribbon/medical_doctor(src)
|
||||
/obj/item/storage/lockbox
|
||||
name = "lockbox"
|
||||
desc = "A locked box."
|
||||
icon_state = "lockbox+l"
|
||||
item_state = "syringe_kit"
|
||||
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
req_access = list(ACCESS_ARMORY)
|
||||
var/broken = FALSE
|
||||
var/open = FALSE
|
||||
var/icon_locked = "lockbox+l"
|
||||
var/icon_closed = "lockbox"
|
||||
var/icon_broken = "lockbox+b"
|
||||
|
||||
/obj/item/storage/lockbox/ComponentInitialize()
|
||||
. = ..()
|
||||
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
|
||||
STR.max_w_class = WEIGHT_CLASS_NORMAL
|
||||
STR.max_combined_w_class = 14
|
||||
STR.max_items = 4
|
||||
STR.locked = TRUE
|
||||
|
||||
/obj/item/storage/lockbox/attackby(obj/item/W, mob/user, params)
|
||||
var/locked = SEND_SIGNAL(src, COMSIG_IS_STORAGE_LOCKED)
|
||||
if(W.GetID())
|
||||
if(broken)
|
||||
to_chat(user, "<span class='danger'>It appears to be broken.</span>")
|
||||
return
|
||||
if(allowed(user))
|
||||
SEND_SIGNAL(src, COMSIG_TRY_STORAGE_SET_LOCKSTATE, !locked)
|
||||
locked = SEND_SIGNAL(src, COMSIG_IS_STORAGE_LOCKED)
|
||||
if(locked)
|
||||
icon_state = icon_locked
|
||||
to_chat(user, "<span class='danger'>You lock the [src.name]!</span>")
|
||||
SEND_SIGNAL(src, COMSIG_TRY_STORAGE_HIDE_ALL)
|
||||
return
|
||||
else
|
||||
icon_state = icon_closed
|
||||
to_chat(user, "<span class='danger'>You unlock the [src.name]!</span>")
|
||||
return
|
||||
else
|
||||
to_chat(user, "<span class='danger'>Access Denied.</span>")
|
||||
return
|
||||
if(!locked)
|
||||
return ..()
|
||||
else
|
||||
to_chat(user, "<span class='danger'>It's locked!</span>")
|
||||
|
||||
/obj/item/storage/lockbox/emag_act(mob/user)
|
||||
if(!broken)
|
||||
broken = TRUE
|
||||
SEND_SIGNAL(src, COMSIG_TRY_STORAGE_SET_LOCKSTATE, FALSE)
|
||||
desc += "It appears to be broken."
|
||||
icon_state = src.icon_broken
|
||||
if(user)
|
||||
visible_message("<span class='warning'>\The [src] has been broken by [user] with an electromagnetic card!</span>")
|
||||
return
|
||||
|
||||
/obj/item/storage/lockbox/Entered()
|
||||
. = ..()
|
||||
open = TRUE
|
||||
update_icon()
|
||||
|
||||
/obj/item/storage/lockbox/Exited()
|
||||
. = ..()
|
||||
open = TRUE
|
||||
update_icon()
|
||||
|
||||
/obj/item/storage/lockbox/loyalty
|
||||
name = "lockbox of mindshield implants"
|
||||
req_access = list(ACCESS_SECURITY)
|
||||
|
||||
/obj/item/storage/lockbox/loyalty/PopulateContents()
|
||||
for(var/i in 1 to 3)
|
||||
new /obj/item/implantcase/mindshield(src)
|
||||
new /obj/item/implanter/mindshield(src)
|
||||
|
||||
/obj/item/storage/lockbox/clusterbang
|
||||
name = "lockbox of clusterbangs"
|
||||
desc = "You have a bad feeling about opening this."
|
||||
req_access = list(ACCESS_SECURITY)
|
||||
|
||||
/obj/item/storage/lockbox/clusterbang/PopulateContents()
|
||||
new /obj/item/grenade/clusterbuster(src)
|
||||
|
||||
/obj/item/storage/lockbox/medal
|
||||
name = "medal box"
|
||||
desc = "A locked box used to store medals of honor."
|
||||
icon_state = "medalbox+l"
|
||||
item_state = "syringe_kit"
|
||||
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
req_access = list(ACCESS_CAPTAIN)
|
||||
icon_locked = "medalbox+l"
|
||||
icon_closed = "medalbox"
|
||||
icon_broken = "medalbox+b"
|
||||
|
||||
/obj/item/storage/lockbox/medal/ComponentInitialize()
|
||||
. = ..()
|
||||
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
|
||||
STR.max_w_class = WEIGHT_CLASS_SMALL
|
||||
STR.max_items = 10
|
||||
STR.max_combined_w_class = 20
|
||||
STR.can_hold = typecacheof(list(/obj/item/clothing/accessory/medal))
|
||||
|
||||
/obj/item/storage/lockbox/medal/examine(mob/user)
|
||||
. = ..()
|
||||
var/locked = SEND_SIGNAL(src, COMSIG_IS_STORAGE_LOCKED)
|
||||
if(!locked)
|
||||
. += "<span class='notice'>Alt-click to [open ? "close":"open"] it.</span>"
|
||||
|
||||
/obj/item/storage/lockbox/medal/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(user.canUseTopic(src, BE_CLOSE))
|
||||
if(!SEND_SIGNAL(src, COMSIG_IS_STORAGE_LOCKED))
|
||||
open = (open ? FALSE : TRUE)
|
||||
update_icon()
|
||||
return TRUE
|
||||
|
||||
/obj/item/storage/lockbox/medal/PopulateContents()
|
||||
new /obj/item/clothing/accessory/medal/gold/captain(src)
|
||||
new /obj/item/clothing/accessory/medal/silver/valor(src)
|
||||
new /obj/item/clothing/accessory/medal/silver/valor(src)
|
||||
new /obj/item/clothing/accessory/medal/silver/security(src)
|
||||
new /obj/item/clothing/accessory/medal/bronze_heart(src)
|
||||
new /obj/item/clothing/accessory/medal/plasma/nobel_science(src)
|
||||
new /obj/item/clothing/accessory/medal/plasma/nobel_science(src)
|
||||
for(var/i in 1 to 3)
|
||||
new /obj/item/clothing/accessory/medal/conduct(src)
|
||||
|
||||
/obj/item/storage/lockbox/medal/update_icon()
|
||||
cut_overlays()
|
||||
var/locked = SEND_SIGNAL(src, COMSIG_IS_STORAGE_LOCKED)
|
||||
if(locked)
|
||||
icon_state = "medalbox+l"
|
||||
open = FALSE
|
||||
else
|
||||
icon_state = "medalbox"
|
||||
if(open)
|
||||
icon_state += "open"
|
||||
if(broken)
|
||||
icon_state += "+b"
|
||||
if(contents && open)
|
||||
for (var/i in 1 to contents.len)
|
||||
var/obj/item/clothing/accessory/medal/M = contents[i]
|
||||
var/mutable_appearance/medalicon = mutable_appearance(initial(icon), M.medaltype)
|
||||
if(i > 1 && i <= 5)
|
||||
medalicon.pixel_x += ((i-1)*3)
|
||||
else if(i > 5)
|
||||
medalicon.pixel_y -= 7
|
||||
medalicon.pixel_x -= 2
|
||||
medalicon.pixel_x += ((i-6)*3)
|
||||
add_overlay(medalicon)
|
||||
|
||||
/obj/item/storage/lockbox/medal/sec
|
||||
name = "security medal box"
|
||||
desc = "A locked box used to store medals to be given to members of the security department."
|
||||
req_access = list(ACCESS_HOS)
|
||||
|
||||
/obj/item/storage/lockbox/medal/sec/PopulateContents()
|
||||
for(var/i in 1 to 3)
|
||||
new /obj/item/clothing/accessory/medal/silver/security(src)
|
||||
|
||||
/obj/item/storage/lockbox/medal/cargo
|
||||
name = "cargo award box"
|
||||
desc = "A locked box used to store awards to be given to members of the cargo department."
|
||||
req_access = list(ACCESS_QM)
|
||||
|
||||
/obj/item/storage/lockbox/medal/cargo/PopulateContents()
|
||||
new /obj/item/clothing/accessory/medal/ribbon/cargo(src)
|
||||
|
||||
/obj/item/storage/lockbox/medal/sci
|
||||
name = "science medal box"
|
||||
desc = "A locked box used to store medals to be given to members of the science department."
|
||||
req_access = list(ACCESS_RD)
|
||||
|
||||
/obj/item/storage/lockbox/medal/sci/PopulateContents()
|
||||
for(var/i in 1 to 3)
|
||||
new /obj/item/clothing/accessory/medal/plasma/nobel_science(src)
|
||||
|
||||
/obj/item/storage/lockbox/medal/engineering
|
||||
name = "engineering medal box"
|
||||
desc = "A locked box used to store medals to be given to the members of the engineering department."
|
||||
req_access = list(ACCESS_CE)
|
||||
|
||||
/obj/item/storage/lockbox/medal/engineering/PopulateContents()
|
||||
for(var/i in 1 to 3)
|
||||
new /obj/item/clothing/accessory/medal/engineer(src)
|
||||
|
||||
/obj/item/storage/lockbox/medal/medical
|
||||
name = "medical medal box"
|
||||
desc = "A locked box used to store medals to be given to the members of the medical department."
|
||||
req_access = list(ACCESS_CMO)
|
||||
|
||||
/obj/item/storage/lockbox/medal/medical/PopulateContents()
|
||||
for(var/i in 1 to 3)
|
||||
new /obj/item/clothing/accessory/medal/ribbon/medical_doctor(src)
|
||||
|
||||
@@ -546,6 +546,7 @@
|
||||
qdel(src)
|
||||
|
||||
/obj/item/twohanded/spear/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(user.canUseTopic(src, BE_CLOSE))
|
||||
..()
|
||||
if(!explosive)
|
||||
@@ -554,6 +555,7 @@
|
||||
var/input = stripped_input(user,"What do you want your war cry to be? You will shout it when you hit someone in melee.", ,"", 50)
|
||||
if(input)
|
||||
src.war_cry = input
|
||||
return TRUE
|
||||
|
||||
/obj/item/twohanded/spear/CheckParts(list/parts_list)
|
||||
var/obj/item/twohanded/spear/S = locate() in parts_list
|
||||
|
||||
+253
-252
@@ -1,252 +1,253 @@
|
||||
|
||||
/obj
|
||||
var/crit_fail = FALSE
|
||||
animate_movement = 2
|
||||
speech_span = SPAN_ROBOT
|
||||
var/obj_flags = CAN_BE_HIT
|
||||
var/set_obj_flags // ONLY FOR MAPPING: Sets flags from a string list, handled in Initialize. Usage: set_obj_flags = "EMAGGED;!CAN_BE_HIT" to set EMAGGED and clear CAN_BE_HIT.
|
||||
|
||||
var/damtype = BRUTE
|
||||
var/force = 0
|
||||
|
||||
var/datum/armor/armor
|
||||
var/obj_integrity //defaults to max_integrity
|
||||
var/max_integrity = 500
|
||||
var/integrity_failure = 0 //0 if we have no special broken behavior
|
||||
|
||||
var/resistance_flags = NONE // INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ON_FIRE | UNACIDABLE | ACID_PROOF
|
||||
|
||||
var/acid_level = 0 //how much acid is on that obj
|
||||
|
||||
var/persistence_replacement //have something WAY too amazing to live to the next round? Set a new path here. Overuse of this var will make me upset.
|
||||
var/current_skin //the item reskin
|
||||
var/list/unique_reskin //List of options to reskin.
|
||||
var/always_reskinnable = FALSE
|
||||
|
||||
// Access levels, used in modules\jobs\access.dm
|
||||
var/list/req_access
|
||||
var/req_access_txt = "0"
|
||||
var/list/req_one_access
|
||||
var/req_one_access_txt = "0"
|
||||
|
||||
var/renamedByPlayer = FALSE //set when a player uses a pen on a renamable object
|
||||
|
||||
/obj/vv_edit_var(vname, vval)
|
||||
switch(vname)
|
||||
if("anchored")
|
||||
setAnchored(vval)
|
||||
return TRUE
|
||||
if("obj_flags")
|
||||
if ((obj_flags & DANGEROUS_POSSESSION) && !(vval & DANGEROUS_POSSESSION))
|
||||
return FALSE
|
||||
if("control_object")
|
||||
var/obj/O = vval
|
||||
if(istype(O) && (O.obj_flags & DANGEROUS_POSSESSION))
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
/obj/Initialize()
|
||||
. = ..()
|
||||
if (islist(armor))
|
||||
armor = getArmor(arglist(armor))
|
||||
else if (!armor)
|
||||
armor = getArmor()
|
||||
else if (!istype(armor, /datum/armor))
|
||||
stack_trace("Invalid type [armor.type] found in .armor during /obj Initialize()")
|
||||
|
||||
if(obj_integrity == null)
|
||||
obj_integrity = max_integrity
|
||||
if (set_obj_flags)
|
||||
var/flagslist = splittext(set_obj_flags,";")
|
||||
var/list/string_to_objflag = GLOB.bitfields["obj_flags"]
|
||||
for (var/flag in flagslist)
|
||||
if (findtext(flag,"!",1,2))
|
||||
flag = copytext(flag,1-(length(flag))) // Get all but the initial !
|
||||
obj_flags &= ~string_to_objflag[flag]
|
||||
else
|
||||
obj_flags |= string_to_objflag[flag]
|
||||
if((obj_flags & ON_BLUEPRINTS) && isturf(loc))
|
||||
var/turf/T = loc
|
||||
T.add_blueprints_preround(src)
|
||||
|
||||
|
||||
/obj/Destroy(force=FALSE)
|
||||
if(!ismachinery(src))
|
||||
STOP_PROCESSING(SSobj, src) // TODO: Have a processing bitflag to reduce on unnecessary loops through the processing lists
|
||||
SStgui.close_uis(src)
|
||||
. = ..()
|
||||
|
||||
/obj/proc/setAnchored(anchorvalue)
|
||||
SEND_SIGNAL(src, COMSIG_OBJ_SETANCHORED, anchorvalue)
|
||||
anchored = anchorvalue
|
||||
|
||||
/obj/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback, force, messy_throw = TRUE)
|
||||
. = ..()
|
||||
if(obj_flags & FROZEN)
|
||||
visible_message("<span class='danger'>[src] shatters into a million pieces!</span>")
|
||||
qdel(src)
|
||||
|
||||
|
||||
/obj/assume_air(datum/gas_mixture/giver)
|
||||
if(loc)
|
||||
return loc.assume_air(giver)
|
||||
else
|
||||
return null
|
||||
|
||||
/obj/remove_air(amount)
|
||||
if(loc)
|
||||
return loc.remove_air(amount)
|
||||
else
|
||||
return null
|
||||
|
||||
/obj/return_air()
|
||||
if(loc)
|
||||
return loc.return_air()
|
||||
else
|
||||
return null
|
||||
|
||||
/obj/proc/handle_internal_lifeform(mob/lifeform_inside_me, breath_request)
|
||||
//Return: (NONSTANDARD)
|
||||
// null if object handles breathing logic for lifeform
|
||||
// datum/air_group to tell lifeform to process using that breath return
|
||||
//DEFAULT: Take air from turf to give to have mob process
|
||||
|
||||
if(breath_request>0)
|
||||
var/datum/gas_mixture/environment = return_air()
|
||||
var/breath_percentage = BREATH_VOLUME / environment.return_volume()
|
||||
return remove_air(environment.total_moles() * breath_percentage)
|
||||
else
|
||||
return null
|
||||
|
||||
/obj/proc/updateUsrDialog()
|
||||
if((obj_flags & IN_USE) && !(obj_flags & USES_TGUI))
|
||||
var/is_in_use = FALSE
|
||||
var/list/nearby = viewers(1, src)
|
||||
for(var/mob/M in nearby)
|
||||
if ((M.client && M.machine == src))
|
||||
is_in_use = TRUE
|
||||
ui_interact(M)
|
||||
if(isAI(usr) || iscyborg(usr) || IsAdminGhost(usr))
|
||||
if (!(usr in nearby))
|
||||
if (usr.client && usr.machine==src) // && M.machine == src is omitted because if we triggered this by using the dialog, it doesn't matter if our machine changed in between triggering it and this - the dialog is probably still supposed to refresh.
|
||||
is_in_use = TRUE
|
||||
ui_interact(usr)
|
||||
|
||||
// check for TK users
|
||||
|
||||
if(ishuman(usr))
|
||||
var/mob/living/carbon/human/H = usr
|
||||
if(!(usr in nearby))
|
||||
if(usr.client && usr.machine==src)
|
||||
if(H.dna.check_mutation(TK))
|
||||
is_in_use = TRUE
|
||||
ui_interact(usr)
|
||||
if (is_in_use)
|
||||
obj_flags |= IN_USE
|
||||
else
|
||||
obj_flags &= ~IN_USE
|
||||
|
||||
/obj/proc/updateDialog(update_viewers = TRUE,update_ais = TRUE)
|
||||
// Check that people are actually using the machine. If not, don't update anymore.
|
||||
if(obj_flags & IN_USE)
|
||||
var/is_in_use = FALSE
|
||||
if(update_viewers)
|
||||
for(var/mob/M in viewers(1, src))
|
||||
if ((M.client && M.machine == src))
|
||||
is_in_use = TRUE
|
||||
src.interact(M)
|
||||
var/ai_in_use = FALSE
|
||||
if(update_ais)
|
||||
ai_in_use = AutoUpdateAI(src)
|
||||
|
||||
if(update_viewers && update_ais) //State change is sure only if we check both
|
||||
if(!ai_in_use && !is_in_use)
|
||||
obj_flags &= ~IN_USE
|
||||
|
||||
|
||||
/obj/attack_ghost(mob/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
ui_interact(user)
|
||||
|
||||
/obj/proc/container_resist(mob/living/user)
|
||||
return
|
||||
|
||||
/obj/proc/update_icon()
|
||||
return
|
||||
|
||||
/mob/proc/unset_machine()
|
||||
if(machine)
|
||||
machine.on_unset_machine(src)
|
||||
machine = null
|
||||
|
||||
//called when the user unsets the machine.
|
||||
/atom/movable/proc/on_unset_machine(mob/user)
|
||||
return
|
||||
|
||||
/mob/proc/set_machine(obj/O)
|
||||
if(src.machine)
|
||||
unset_machine()
|
||||
src.machine = O
|
||||
if(istype(O))
|
||||
O.obj_flags |= IN_USE
|
||||
|
||||
/obj/item/proc/updateSelfDialog()
|
||||
var/mob/M = src.loc
|
||||
if(istype(M) && M.client && M.machine == src)
|
||||
src.attack_self(M)
|
||||
|
||||
/obj/proc/hide(h)
|
||||
return
|
||||
|
||||
/obj/singularity_pull(S, current_size)
|
||||
..()
|
||||
if(!anchored || current_size >= STAGE_FIVE)
|
||||
step_towards(src,S)
|
||||
|
||||
/obj/get_dumping_location(datum/component/storage/source,mob/user)
|
||||
return get_turf(src)
|
||||
|
||||
/obj/proc/CanAStarPass()
|
||||
. = !density
|
||||
|
||||
/obj/proc/check_uplink_validity()
|
||||
return 1
|
||||
|
||||
/obj/proc/intercept_user_move(dir, mob, newLoc, oldLoc)
|
||||
return
|
||||
|
||||
/obj/vv_get_dropdown()
|
||||
. = ..()
|
||||
.["Delete all of type"] = "?_src_=vars;[HrefToken()];delall=[REF(src)]"
|
||||
.["Osay"] = "?_src_=vars;[HrefToken()];osay[REF(src)]"
|
||||
.["Modify armor values"] = "?_src_=vars;[HrefToken()];modarmor=[REF(src)]"
|
||||
|
||||
/obj/examine(mob/user)
|
||||
. = ..()
|
||||
if(obj_flags & UNIQUE_RENAME)
|
||||
. += "<span class='notice'>Use a pen on it to rename it or change its description.</span>"
|
||||
if(unique_reskin && (!current_skin || always_reskinnable))
|
||||
. += "<span class='notice'>Alt-click it to reskin it.</span>"
|
||||
|
||||
/obj/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(unique_reskin && (!current_skin || always_reskinnable) && user.canUseTopic(src, BE_CLOSE, NO_DEXTERY))
|
||||
reskin_obj(user)
|
||||
|
||||
/obj/proc/reskin_obj(mob/M)
|
||||
if(!LAZYLEN(unique_reskin))
|
||||
return
|
||||
var/dat = "<b>Reskin options for [name]:</b>\n"
|
||||
for(var/V in unique_reskin)
|
||||
var/output = icon2html(src, M, unique_reskin[V])
|
||||
dat += "[V]: <span class='reallybig'>[output]</span>\n"
|
||||
to_chat(M, dat)
|
||||
|
||||
var/choice = input(M, always_reskinnable ? "Choose the a reskin for [src]" : "Warning, you can only reskin [src] once!","Reskin Object") as null|anything in unique_reskin
|
||||
if(QDELETED(src) || !choice || (current_skin && !always_reskinnable) || M.incapacitated() || !in_range(M,src) || !unique_reskin[choice] || unique_reskin[choice] == current_skin)
|
||||
return
|
||||
current_skin = choice
|
||||
icon_state = unique_reskin[choice]
|
||||
to_chat(M, "[src] is now skinned as '[choice]'.")
|
||||
|
||||
/obj
|
||||
var/crit_fail = FALSE
|
||||
animate_movement = 2
|
||||
speech_span = SPAN_ROBOT
|
||||
var/obj_flags = CAN_BE_HIT
|
||||
var/set_obj_flags // ONLY FOR MAPPING: Sets flags from a string list, handled in Initialize. Usage: set_obj_flags = "EMAGGED;!CAN_BE_HIT" to set EMAGGED and clear CAN_BE_HIT.
|
||||
|
||||
var/damtype = BRUTE
|
||||
var/force = 0
|
||||
|
||||
var/datum/armor/armor
|
||||
var/obj_integrity //defaults to max_integrity
|
||||
var/max_integrity = 500
|
||||
var/integrity_failure = 0 //0 if we have no special broken behavior
|
||||
|
||||
var/resistance_flags = NONE // INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ON_FIRE | UNACIDABLE | ACID_PROOF
|
||||
|
||||
var/acid_level = 0 //how much acid is on that obj
|
||||
|
||||
var/persistence_replacement //have something WAY too amazing to live to the next round? Set a new path here. Overuse of this var will make me upset.
|
||||
var/current_skin //the item reskin
|
||||
var/list/unique_reskin //List of options to reskin.
|
||||
var/always_reskinnable = FALSE
|
||||
|
||||
// Access levels, used in modules\jobs\access.dm
|
||||
var/list/req_access
|
||||
var/req_access_txt = "0"
|
||||
var/list/req_one_access
|
||||
var/req_one_access_txt = "0"
|
||||
|
||||
var/renamedByPlayer = FALSE //set when a player uses a pen on a renamable object
|
||||
|
||||
/obj/vv_edit_var(vname, vval)
|
||||
switch(vname)
|
||||
if("anchored")
|
||||
setAnchored(vval)
|
||||
return TRUE
|
||||
if("obj_flags")
|
||||
if ((obj_flags & DANGEROUS_POSSESSION) && !(vval & DANGEROUS_POSSESSION))
|
||||
return FALSE
|
||||
if("control_object")
|
||||
var/obj/O = vval
|
||||
if(istype(O) && (O.obj_flags & DANGEROUS_POSSESSION))
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
/obj/Initialize()
|
||||
. = ..()
|
||||
if (islist(armor))
|
||||
armor = getArmor(arglist(armor))
|
||||
else if (!armor)
|
||||
armor = getArmor()
|
||||
else if (!istype(armor, /datum/armor))
|
||||
stack_trace("Invalid type [armor.type] found in .armor during /obj Initialize()")
|
||||
|
||||
if(obj_integrity == null)
|
||||
obj_integrity = max_integrity
|
||||
if (set_obj_flags)
|
||||
var/flagslist = splittext(set_obj_flags,";")
|
||||
var/list/string_to_objflag = GLOB.bitfields["obj_flags"]
|
||||
for (var/flag in flagslist)
|
||||
if (findtext(flag,"!",1,2))
|
||||
flag = copytext(flag,1-(length(flag))) // Get all but the initial !
|
||||
obj_flags &= ~string_to_objflag[flag]
|
||||
else
|
||||
obj_flags |= string_to_objflag[flag]
|
||||
if((obj_flags & ON_BLUEPRINTS) && isturf(loc))
|
||||
var/turf/T = loc
|
||||
T.add_blueprints_preround(src)
|
||||
|
||||
|
||||
/obj/Destroy(force=FALSE)
|
||||
if(!ismachinery(src))
|
||||
STOP_PROCESSING(SSobj, src) // TODO: Have a processing bitflag to reduce on unnecessary loops through the processing lists
|
||||
SStgui.close_uis(src)
|
||||
. = ..()
|
||||
|
||||
/obj/proc/setAnchored(anchorvalue)
|
||||
SEND_SIGNAL(src, COMSIG_OBJ_SETANCHORED, anchorvalue)
|
||||
anchored = anchorvalue
|
||||
|
||||
/obj/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback, force, messy_throw = TRUE)
|
||||
. = ..()
|
||||
if(obj_flags & FROZEN)
|
||||
visible_message("<span class='danger'>[src] shatters into a million pieces!</span>")
|
||||
qdel(src)
|
||||
|
||||
|
||||
/obj/assume_air(datum/gas_mixture/giver)
|
||||
if(loc)
|
||||
return loc.assume_air(giver)
|
||||
else
|
||||
return null
|
||||
|
||||
/obj/remove_air(amount)
|
||||
if(loc)
|
||||
return loc.remove_air(amount)
|
||||
else
|
||||
return null
|
||||
|
||||
/obj/return_air()
|
||||
if(loc)
|
||||
return loc.return_air()
|
||||
else
|
||||
return null
|
||||
|
||||
/obj/proc/handle_internal_lifeform(mob/lifeform_inside_me, breath_request)
|
||||
//Return: (NONSTANDARD)
|
||||
// null if object handles breathing logic for lifeform
|
||||
// datum/air_group to tell lifeform to process using that breath return
|
||||
//DEFAULT: Take air from turf to give to have mob process
|
||||
|
||||
if(breath_request>0)
|
||||
var/datum/gas_mixture/environment = return_air()
|
||||
var/breath_percentage = BREATH_VOLUME / environment.return_volume()
|
||||
return remove_air(environment.total_moles() * breath_percentage)
|
||||
else
|
||||
return null
|
||||
|
||||
/obj/proc/updateUsrDialog()
|
||||
if((obj_flags & IN_USE) && !(obj_flags & USES_TGUI))
|
||||
var/is_in_use = FALSE
|
||||
var/list/nearby = viewers(1, src)
|
||||
for(var/mob/M in nearby)
|
||||
if ((M.client && M.machine == src))
|
||||
is_in_use = TRUE
|
||||
ui_interact(M)
|
||||
if(isAI(usr) || iscyborg(usr) || IsAdminGhost(usr))
|
||||
if (!(usr in nearby))
|
||||
if (usr.client && usr.machine==src) // && M.machine == src is omitted because if we triggered this by using the dialog, it doesn't matter if our machine changed in between triggering it and this - the dialog is probably still supposed to refresh.
|
||||
is_in_use = TRUE
|
||||
ui_interact(usr)
|
||||
|
||||
// check for TK users
|
||||
|
||||
if(ishuman(usr))
|
||||
var/mob/living/carbon/human/H = usr
|
||||
if(!(usr in nearby))
|
||||
if(usr.client && usr.machine==src)
|
||||
if(H.dna.check_mutation(TK))
|
||||
is_in_use = TRUE
|
||||
ui_interact(usr)
|
||||
if (is_in_use)
|
||||
obj_flags |= IN_USE
|
||||
else
|
||||
obj_flags &= ~IN_USE
|
||||
|
||||
/obj/proc/updateDialog(update_viewers = TRUE,update_ais = TRUE)
|
||||
// Check that people are actually using the machine. If not, don't update anymore.
|
||||
if(obj_flags & IN_USE)
|
||||
var/is_in_use = FALSE
|
||||
if(update_viewers)
|
||||
for(var/mob/M in viewers(1, src))
|
||||
if ((M.client && M.machine == src))
|
||||
is_in_use = TRUE
|
||||
src.interact(M)
|
||||
var/ai_in_use = FALSE
|
||||
if(update_ais)
|
||||
ai_in_use = AutoUpdateAI(src)
|
||||
|
||||
if(update_viewers && update_ais) //State change is sure only if we check both
|
||||
if(!ai_in_use && !is_in_use)
|
||||
obj_flags &= ~IN_USE
|
||||
|
||||
|
||||
/obj/attack_ghost(mob/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
ui_interact(user)
|
||||
|
||||
/obj/proc/container_resist(mob/living/user)
|
||||
return
|
||||
|
||||
/obj/proc/update_icon()
|
||||
return
|
||||
|
||||
/mob/proc/unset_machine()
|
||||
if(machine)
|
||||
machine.on_unset_machine(src)
|
||||
machine = null
|
||||
|
||||
//called when the user unsets the machine.
|
||||
/atom/movable/proc/on_unset_machine(mob/user)
|
||||
return
|
||||
|
||||
/mob/proc/set_machine(obj/O)
|
||||
if(src.machine)
|
||||
unset_machine()
|
||||
src.machine = O
|
||||
if(istype(O))
|
||||
O.obj_flags |= IN_USE
|
||||
|
||||
/obj/item/proc/updateSelfDialog()
|
||||
var/mob/M = src.loc
|
||||
if(istype(M) && M.client && M.machine == src)
|
||||
src.attack_self(M)
|
||||
|
||||
/obj/proc/hide(h)
|
||||
return
|
||||
|
||||
/obj/singularity_pull(S, current_size)
|
||||
..()
|
||||
if(!anchored || current_size >= STAGE_FIVE)
|
||||
step_towards(src,S)
|
||||
|
||||
/obj/get_dumping_location(datum/component/storage/source,mob/user)
|
||||
return get_turf(src)
|
||||
|
||||
/obj/proc/CanAStarPass()
|
||||
. = !density
|
||||
|
||||
/obj/proc/check_uplink_validity()
|
||||
return 1
|
||||
|
||||
/obj/proc/intercept_user_move(dir, mob, newLoc, oldLoc)
|
||||
return
|
||||
|
||||
/obj/vv_get_dropdown()
|
||||
. = ..()
|
||||
.["Delete all of type"] = "?_src_=vars;[HrefToken()];delall=[REF(src)]"
|
||||
.["Osay"] = "?_src_=vars;[HrefToken()];osay[REF(src)]"
|
||||
.["Modify armor values"] = "?_src_=vars;[HrefToken()];modarmor=[REF(src)]"
|
||||
|
||||
/obj/examine(mob/user)
|
||||
. = ..()
|
||||
if(obj_flags & UNIQUE_RENAME)
|
||||
. += "<span class='notice'>Use a pen on it to rename it or change its description.</span>"
|
||||
if(unique_reskin && (!current_skin || always_reskinnable))
|
||||
. += "<span class='notice'>Alt-click it to reskin it.</span>"
|
||||
|
||||
/obj/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(unique_reskin && (!current_skin || always_reskinnable) && user.canUseTopic(src, BE_CLOSE, NO_DEXTERY))
|
||||
reskin_obj(user)
|
||||
return TRUE
|
||||
|
||||
/obj/proc/reskin_obj(mob/M)
|
||||
if(!LAZYLEN(unique_reskin))
|
||||
return
|
||||
var/dat = "<b>Reskin options for [name]:</b>\n"
|
||||
for(var/V in unique_reskin)
|
||||
var/output = icon2html(src, M, unique_reskin[V])
|
||||
dat += "[V]: <span class='reallybig'>[output]</span>\n"
|
||||
to_chat(M, dat)
|
||||
|
||||
var/choice = input(M, always_reskinnable ? "Choose the a reskin for [src]" : "Warning, you can only reskin [src] once!","Reskin Object") as null|anything in unique_reskin
|
||||
if(QDELETED(src) || !choice || (current_skin && !always_reskinnable) || M.incapacitated() || !in_range(M,src) || !unique_reskin[choice] || unique_reskin[choice] == current_skin)
|
||||
return
|
||||
current_skin = choice
|
||||
icon_state = unique_reskin[choice]
|
||||
to_chat(M, "[src] is now skinned as '[choice]'.")
|
||||
|
||||
@@ -449,6 +449,9 @@
|
||||
item_chair = null
|
||||
var/turns = 0
|
||||
|
||||
/obj/structure/chair/brass/ComponentInitialize()
|
||||
return //it spins with the power of ratvar, not components.
|
||||
|
||||
/obj/structure/chair/brass/Destroy()
|
||||
STOP_PROCESSING(SSfastprocess, src)
|
||||
. = ..()
|
||||
@@ -464,6 +467,7 @@
|
||||
return
|
||||
|
||||
/obj/structure/chair/brass/AltClick(mob/living/user)
|
||||
. = ..()
|
||||
turns = 0
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||
return
|
||||
@@ -475,6 +479,7 @@
|
||||
user.visible_message("<span class='notice'>[user] stops [src]'s uncontrollable spinning.</span>", \
|
||||
"<span class='notice'>You grab [src] and stop its wild spinning.</span>")
|
||||
STOP_PROCESSING(SSfastprocess, src)
|
||||
return TRUE
|
||||
|
||||
/obj/structure/chair/bronze
|
||||
name = "brass chair"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,154 +1,156 @@
|
||||
/obj/structure/extinguisher_cabinet
|
||||
name = "extinguisher cabinet"
|
||||
desc = "A small wall mounted cabinet designed to hold a fire extinguisher."
|
||||
icon = 'icons/obj/wallmounts.dmi'
|
||||
icon_state = "extinguisher_closed"
|
||||
anchored = TRUE
|
||||
density = FALSE
|
||||
max_integrity = 200
|
||||
integrity_failure = 50
|
||||
var/obj/item/extinguisher/stored_extinguisher
|
||||
var/opened = FALSE
|
||||
|
||||
/obj/structure/extinguisher_cabinet/Initialize(mapload, ndir, building)
|
||||
. = ..()
|
||||
if(building)
|
||||
setDir(ndir)
|
||||
pixel_x = (dir & 3)? 0 : (dir == 4 ? -27 : 27)
|
||||
pixel_y = (dir & 3)? (dir ==1 ? -30 : 30) : 0
|
||||
opened = TRUE
|
||||
icon_state = "extinguisher_empty"
|
||||
else
|
||||
stored_extinguisher = new /obj/item/extinguisher(src)
|
||||
|
||||
/obj/structure/extinguisher_cabinet/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>Alt-click to [opened ? "close":"open"] it.</span>"
|
||||
|
||||
/obj/structure/extinguisher_cabinet/Destroy()
|
||||
if(stored_extinguisher)
|
||||
qdel(stored_extinguisher)
|
||||
stored_extinguisher = null
|
||||
return ..()
|
||||
|
||||
/obj/structure/extinguisher_cabinet/contents_explosion(severity, target)
|
||||
if(stored_extinguisher)
|
||||
stored_extinguisher.ex_act(severity, target)
|
||||
|
||||
/obj/structure/extinguisher_cabinet/handle_atom_del(atom/A)
|
||||
if(A == stored_extinguisher)
|
||||
stored_extinguisher = null
|
||||
update_icon()
|
||||
|
||||
/obj/structure/extinguisher_cabinet/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/wrench) && !stored_extinguisher)
|
||||
to_chat(user, "<span class='notice'>You start unsecuring [name]...</span>")
|
||||
I.play_tool_sound(src)
|
||||
if(I.use_tool(src, user, 60))
|
||||
playsound(loc, 'sound/items/deconstruct.ogg', 50, 1)
|
||||
to_chat(user, "<span class='notice'>You unsecure [name].</span>")
|
||||
deconstruct(TRUE)
|
||||
return
|
||||
|
||||
if(iscyborg(user) || isalien(user))
|
||||
return
|
||||
if(istype(I, /obj/item/extinguisher))
|
||||
if(!stored_extinguisher && opened)
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
stored_extinguisher = I
|
||||
to_chat(user, "<span class='notice'>You place [I] in [src].</span>")
|
||||
update_icon()
|
||||
return TRUE
|
||||
else
|
||||
toggle_cabinet(user)
|
||||
else if(user.a_intent != INTENT_HARM)
|
||||
toggle_cabinet(user)
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/structure/extinguisher_cabinet/attack_hand(mob/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
if(iscyborg(user) || isalien(user))
|
||||
return
|
||||
if(stored_extinguisher)
|
||||
user.put_in_hands(stored_extinguisher)
|
||||
to_chat(user, "<span class='notice'>You take [stored_extinguisher] from [src].</span>")
|
||||
stored_extinguisher = null
|
||||
if(!opened)
|
||||
opened = 1
|
||||
playsound(loc, 'sound/machines/click.ogg', 15, 1, -3)
|
||||
update_icon()
|
||||
else
|
||||
toggle_cabinet(user)
|
||||
|
||||
|
||||
/obj/structure/extinguisher_cabinet/attack_tk(mob/user)
|
||||
if(stored_extinguisher)
|
||||
stored_extinguisher.forceMove(loc)
|
||||
to_chat(user, "<span class='notice'>You telekinetically remove [stored_extinguisher] from [src].</span>")
|
||||
stored_extinguisher = null
|
||||
opened = 1
|
||||
playsound(loc, 'sound/machines/click.ogg', 15, 1, -3)
|
||||
update_icon()
|
||||
else
|
||||
toggle_cabinet(user)
|
||||
|
||||
|
||||
/obj/structure/extinguisher_cabinet/attack_paw(mob/user)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/structure/extinguisher_cabinet/AltClick(mob/living/user)
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||
return
|
||||
toggle_cabinet(user)
|
||||
|
||||
/obj/structure/extinguisher_cabinet/proc/toggle_cabinet(mob/user)
|
||||
if(opened && broken)
|
||||
to_chat(user, "<span class='warning'>[src] is broken open.</span>")
|
||||
else
|
||||
playsound(loc, 'sound/machines/click.ogg', 15, 1, -3)
|
||||
opened = !opened
|
||||
update_icon()
|
||||
|
||||
/obj/structure/extinguisher_cabinet/update_icon()
|
||||
if(!opened)
|
||||
icon_state = "extinguisher_closed"
|
||||
return
|
||||
if(stored_extinguisher)
|
||||
if(istype(stored_extinguisher, /obj/item/extinguisher/mini))
|
||||
icon_state = "extinguisher_mini"
|
||||
else
|
||||
icon_state = "extinguisher_full"
|
||||
else
|
||||
icon_state = "extinguisher_empty"
|
||||
|
||||
/obj/structure/extinguisher_cabinet/obj_break(damage_flag)
|
||||
if(!broken && !(flags_1 & NODECONSTRUCT_1))
|
||||
broken = 1
|
||||
opened = 1
|
||||
if(stored_extinguisher)
|
||||
stored_extinguisher.forceMove(loc)
|
||||
stored_extinguisher = null
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/structure/extinguisher_cabinet/deconstruct(disassembled = TRUE)
|
||||
if(!(flags_1 & NODECONSTRUCT_1))
|
||||
if(disassembled)
|
||||
new /obj/item/wallframe/extinguisher_cabinet(loc)
|
||||
else
|
||||
new /obj/item/stack/sheet/metal (loc, 2)
|
||||
if(stored_extinguisher)
|
||||
stored_extinguisher.forceMove(loc)
|
||||
stored_extinguisher = null
|
||||
qdel(src)
|
||||
|
||||
/obj/item/wallframe/extinguisher_cabinet
|
||||
name = "extinguisher cabinet frame"
|
||||
desc = "Used for building wall-mounted extinguisher cabinets."
|
||||
icon_state = "extinguisher"
|
||||
result_path = /obj/structure/extinguisher_cabinet
|
||||
/obj/structure/extinguisher_cabinet
|
||||
name = "extinguisher cabinet"
|
||||
desc = "A small wall mounted cabinet designed to hold a fire extinguisher."
|
||||
icon = 'icons/obj/wallmounts.dmi'
|
||||
icon_state = "extinguisher_closed"
|
||||
anchored = TRUE
|
||||
density = FALSE
|
||||
max_integrity = 200
|
||||
integrity_failure = 50
|
||||
var/obj/item/extinguisher/stored_extinguisher
|
||||
var/opened = FALSE
|
||||
|
||||
/obj/structure/extinguisher_cabinet/Initialize(mapload, ndir, building)
|
||||
. = ..()
|
||||
if(building)
|
||||
setDir(ndir)
|
||||
pixel_x = (dir & 3)? 0 : (dir == 4 ? -27 : 27)
|
||||
pixel_y = (dir & 3)? (dir ==1 ? -30 : 30) : 0
|
||||
opened = TRUE
|
||||
icon_state = "extinguisher_empty"
|
||||
else
|
||||
stored_extinguisher = new /obj/item/extinguisher(src)
|
||||
|
||||
/obj/structure/extinguisher_cabinet/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>Alt-click to [opened ? "close":"open"] it.</span>"
|
||||
|
||||
/obj/structure/extinguisher_cabinet/Destroy()
|
||||
if(stored_extinguisher)
|
||||
qdel(stored_extinguisher)
|
||||
stored_extinguisher = null
|
||||
return ..()
|
||||
|
||||
/obj/structure/extinguisher_cabinet/contents_explosion(severity, target)
|
||||
if(stored_extinguisher)
|
||||
stored_extinguisher.ex_act(severity, target)
|
||||
|
||||
/obj/structure/extinguisher_cabinet/handle_atom_del(atom/A)
|
||||
if(A == stored_extinguisher)
|
||||
stored_extinguisher = null
|
||||
update_icon()
|
||||
|
||||
/obj/structure/extinguisher_cabinet/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/wrench) && !stored_extinguisher)
|
||||
to_chat(user, "<span class='notice'>You start unsecuring [name]...</span>")
|
||||
I.play_tool_sound(src)
|
||||
if(I.use_tool(src, user, 60))
|
||||
playsound(loc, 'sound/items/deconstruct.ogg', 50, 1)
|
||||
to_chat(user, "<span class='notice'>You unsecure [name].</span>")
|
||||
deconstruct(TRUE)
|
||||
return
|
||||
|
||||
if(iscyborg(user) || isalien(user))
|
||||
return
|
||||
if(istype(I, /obj/item/extinguisher))
|
||||
if(!stored_extinguisher && opened)
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
stored_extinguisher = I
|
||||
to_chat(user, "<span class='notice'>You place [I] in [src].</span>")
|
||||
update_icon()
|
||||
return TRUE
|
||||
else
|
||||
toggle_cabinet(user)
|
||||
else if(user.a_intent != INTENT_HARM)
|
||||
toggle_cabinet(user)
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/structure/extinguisher_cabinet/attack_hand(mob/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
if(iscyborg(user) || isalien(user))
|
||||
return
|
||||
if(stored_extinguisher)
|
||||
user.put_in_hands(stored_extinguisher)
|
||||
to_chat(user, "<span class='notice'>You take [stored_extinguisher] from [src].</span>")
|
||||
stored_extinguisher = null
|
||||
if(!opened)
|
||||
opened = 1
|
||||
playsound(loc, 'sound/machines/click.ogg', 15, 1, -3)
|
||||
update_icon()
|
||||
else
|
||||
toggle_cabinet(user)
|
||||
|
||||
|
||||
/obj/structure/extinguisher_cabinet/attack_tk(mob/user)
|
||||
if(stored_extinguisher)
|
||||
stored_extinguisher.forceMove(loc)
|
||||
to_chat(user, "<span class='notice'>You telekinetically remove [stored_extinguisher] from [src].</span>")
|
||||
stored_extinguisher = null
|
||||
opened = 1
|
||||
playsound(loc, 'sound/machines/click.ogg', 15, 1, -3)
|
||||
update_icon()
|
||||
else
|
||||
toggle_cabinet(user)
|
||||
|
||||
|
||||
/obj/structure/extinguisher_cabinet/attack_paw(mob/user)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/structure/extinguisher_cabinet/AltClick(mob/living/user)
|
||||
. = ..()
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||
return
|
||||
toggle_cabinet(user)
|
||||
return TRUE
|
||||
|
||||
/obj/structure/extinguisher_cabinet/proc/toggle_cabinet(mob/user)
|
||||
if(opened && broken)
|
||||
to_chat(user, "<span class='warning'>[src] is broken open.</span>")
|
||||
else
|
||||
playsound(loc, 'sound/machines/click.ogg', 15, 1, -3)
|
||||
opened = !opened
|
||||
update_icon()
|
||||
|
||||
/obj/structure/extinguisher_cabinet/update_icon()
|
||||
if(!opened)
|
||||
icon_state = "extinguisher_closed"
|
||||
return
|
||||
if(stored_extinguisher)
|
||||
if(istype(stored_extinguisher, /obj/item/extinguisher/mini))
|
||||
icon_state = "extinguisher_mini"
|
||||
else
|
||||
icon_state = "extinguisher_full"
|
||||
else
|
||||
icon_state = "extinguisher_empty"
|
||||
|
||||
/obj/structure/extinguisher_cabinet/obj_break(damage_flag)
|
||||
if(!broken && !(flags_1 & NODECONSTRUCT_1))
|
||||
broken = 1
|
||||
opened = 1
|
||||
if(stored_extinguisher)
|
||||
stored_extinguisher.forceMove(loc)
|
||||
stored_extinguisher = null
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/structure/extinguisher_cabinet/deconstruct(disassembled = TRUE)
|
||||
if(!(flags_1 & NODECONSTRUCT_1))
|
||||
if(disassembled)
|
||||
new /obj/item/wallframe/extinguisher_cabinet(loc)
|
||||
else
|
||||
new /obj/item/stack/sheet/metal (loc, 2)
|
||||
if(stored_extinguisher)
|
||||
stored_extinguisher.forceMove(loc)
|
||||
stored_extinguisher = null
|
||||
qdel(src)
|
||||
|
||||
/obj/item/wallframe/extinguisher_cabinet
|
||||
name = "extinguisher cabinet frame"
|
||||
desc = "Used for building wall-mounted extinguisher cabinets."
|
||||
icon_state = "extinguisher"
|
||||
result_path = /obj/structure/extinguisher_cabinet
|
||||
|
||||
@@ -1,444 +1,445 @@
|
||||
/* Morgue stuff
|
||||
* Contains:
|
||||
* Morgue
|
||||
* Morgue tray
|
||||
* Crematorium
|
||||
* Creamatorium
|
||||
* Crematorium tray
|
||||
* Crematorium button
|
||||
*/
|
||||
|
||||
/*
|
||||
* Bodycontainer
|
||||
* Parent class for morgue and crematorium
|
||||
* For overriding only
|
||||
*/
|
||||
GLOBAL_LIST_EMPTY(bodycontainers) //Let them act as spawnpoints for revenants and other ghosties.
|
||||
|
||||
/obj/structure/bodycontainer
|
||||
icon = 'icons/obj/stationobjs.dmi'
|
||||
icon_state = "morgue1"
|
||||
density = TRUE
|
||||
anchored = TRUE
|
||||
max_integrity = 400
|
||||
|
||||
var/obj/structure/tray/connected = null
|
||||
var/locked = FALSE
|
||||
dir = SOUTH
|
||||
var/message_cooldown
|
||||
var/breakout_time = 600
|
||||
var/obj/item/radio/radio = null
|
||||
var/hasradio = FALSE
|
||||
|
||||
/obj/structure/bodycontainer/Initialize()
|
||||
. = ..()
|
||||
GLOB.bodycontainers += src
|
||||
recursive_organ_check(src)
|
||||
|
||||
/obj/structure/bodycontainer/Destroy()
|
||||
GLOB.bodycontainers -= src
|
||||
open()
|
||||
if(connected)
|
||||
qdel(connected)
|
||||
connected = null
|
||||
return ..()
|
||||
|
||||
/obj/structure/bodycontainer/on_log(login)
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
/obj/structure/bodycontainer/update_icon()
|
||||
return
|
||||
|
||||
/obj/structure/bodycontainer/relaymove(mob/user)
|
||||
if(user.stat || !isturf(loc))
|
||||
return
|
||||
if(locked)
|
||||
if(message_cooldown <= world.time)
|
||||
message_cooldown = world.time + 50
|
||||
to_chat(user, "<span class='warning'>[src]'s door won't budge!</span>")
|
||||
return
|
||||
open()
|
||||
|
||||
/obj/structure/bodycontainer/attack_paw(mob/user)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/structure/bodycontainer/attack_hand(mob/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
if(locked)
|
||||
to_chat(user, "<span class='danger'>It's locked.</span>")
|
||||
return
|
||||
if(!connected)
|
||||
to_chat(user, "That doesn't appear to have a tray.")
|
||||
return
|
||||
if(connected.loc == src)
|
||||
open()
|
||||
else
|
||||
close()
|
||||
add_fingerprint(user)
|
||||
|
||||
/obj/structure/bodycontainer/attack_robot(mob/user)
|
||||
if(!user.Adjacent(src))
|
||||
return
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/structure/bodycontainer/attackby(obj/P, mob/user, params)
|
||||
add_fingerprint(user)
|
||||
if(istype(P, /obj/item/pen))
|
||||
if(!user.is_literate())
|
||||
to_chat(user, "<span class='notice'>You scribble illegibly on the side of [src]!</span>")
|
||||
return
|
||||
var/t = stripped_input(user, "What would you like the label to be?", text("[]", name), null)
|
||||
if (user.get_active_held_item() != P)
|
||||
return
|
||||
if(!user.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
if (t)
|
||||
name = text("[]- '[]'", initial(name), t)
|
||||
else
|
||||
name = initial(name)
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/structure/bodycontainer/deconstruct(disassembled = TRUE)
|
||||
new /obj/item/stack/sheet/metal (loc, 5)
|
||||
recursive_organ_check(src)
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/bodycontainer/container_resist(mob/living/user)
|
||||
if(!locked)
|
||||
open()
|
||||
return
|
||||
user.changeNext_move(CLICK_CD_BREAKOUT)
|
||||
user.last_special = world.time + CLICK_CD_BREAKOUT
|
||||
user.visible_message(null, \
|
||||
"<span class='notice'>You lean on the back of [src] and start pushing the tray open... (this will take about [DisplayTimeText(breakout_time)].)</span>", \
|
||||
"<span class='italics'>You hear a metallic creaking from [src].</span>")
|
||||
if(do_after(user,(breakout_time), target = src))
|
||||
if(!user || user.stat != CONSCIOUS || user.loc != src )
|
||||
return
|
||||
user.visible_message("<span class='warning'>[user] successfully broke out of [src]!</span>", \
|
||||
"<span class='notice'>You successfully break out of [src]!</span>")
|
||||
open()
|
||||
|
||||
/obj/structure/bodycontainer/proc/open()
|
||||
recursive_organ_check(src)
|
||||
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1)
|
||||
playsound(src, 'sound/effects/roll.ogg', 5, 1)
|
||||
var/turf/T = get_step(src, dir)
|
||||
connected.setDir(dir)
|
||||
for(var/atom/movable/AM in src)
|
||||
if(AM != radio)
|
||||
AM.forceMove(T)
|
||||
update_icon()
|
||||
|
||||
/obj/structure/bodycontainer/proc/close()
|
||||
playsound(src, 'sound/effects/roll.ogg', 5, 1)
|
||||
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1)
|
||||
for(var/atom/movable/AM in connected.loc)
|
||||
if(!AM.anchored || AM == connected)
|
||||
AM.forceMove(src)
|
||||
recursive_organ_check(src)
|
||||
update_icon()
|
||||
|
||||
/obj/structure/bodycontainer/get_remote_view_fullscreens(mob/user)
|
||||
if(user.stat == DEAD || !(user.sight & (SEEOBJS|SEEMOBS)))
|
||||
user.overlay_fullscreen("remote_view", /obj/screen/fullscreen/impaired, 2)
|
||||
/*
|
||||
* Morgue
|
||||
*/
|
||||
/obj/structure/bodycontainer/morgue
|
||||
name = "morgue"
|
||||
desc = "Used to keep bodies in until someone fetches them. Now includes a high-tech alert system."
|
||||
icon_state = "morgue1"
|
||||
dir = EAST
|
||||
var/beeper = TRUE
|
||||
var/beep_cooldown = 50
|
||||
var/next_beep = 0
|
||||
//Hyperstation edit
|
||||
var/radio_key = /obj/item/encryptionkey/headset_med
|
||||
var/medical_channel = "Medical"
|
||||
var/inuse = FALSE
|
||||
hasradio = TRUE
|
||||
|
||||
/obj/structure/bodycontainer/morgue/Initialize()
|
||||
. = ..()
|
||||
radio = new(src)
|
||||
radio.anchored = TRUE
|
||||
radio.keyslot = new radio_key
|
||||
radio.listening = 0
|
||||
radio.recalculateChannels()
|
||||
|
||||
/obj/structure/bodycontainer/morgue/Destroy()
|
||||
QDEL_NULL(radio)
|
||||
GLOB.bodycontainers -= src
|
||||
open()
|
||||
if(connected)
|
||||
qdel(connected)
|
||||
connected = null
|
||||
return ..()
|
||||
/*
|
||||
/obj/structure/bodycontainer/morgue/proc/open2()
|
||||
recursive_organ_check(src)
|
||||
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1)
|
||||
playsound(src, 'sound/effects/roll.ogg', 5, 1)
|
||||
var/turf/T = get_step(src, dir)
|
||||
connected.setDir(dir)
|
||||
for(var/atom/movable/AM in src)
|
||||
if(AM != radio)
|
||||
AM.forceMove(T)
|
||||
update_icon()
|
||||
*/
|
||||
//end of edit
|
||||
/obj/structure/bodycontainer/morgue/New()
|
||||
connected = new/obj/structure/tray/m_tray(src)
|
||||
connected.connected = src
|
||||
..()
|
||||
|
||||
/obj/structure/bodycontainer/morgue/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>The speaker is [beeper ? "enabled" : "disabled"]. Alt-click to toggle it.</span>"
|
||||
|
||||
/obj/structure/bodycontainer/morgue/AltClick(mob/user)
|
||||
..()
|
||||
if(!user.canUseTopic(src, !issilicon(user)))
|
||||
return
|
||||
beeper = !beeper
|
||||
to_chat(user, "<span class='notice'>You turn the speaker function [beeper ? "on" : "off"].</span>")
|
||||
|
||||
/obj/structure/bodycontainer/morgue/update_icon()
|
||||
if (!connected || connected.loc != src) // Open or tray is gone.
|
||||
icon_state = "morgue0"
|
||||
else
|
||||
if(contents.len == 2) // Empty. Was length 1 because of the tray, is now length 2 because it includes a radio.
|
||||
icon_state = "morgue1"
|
||||
else
|
||||
icon_state = "morgue2" // Dead, brainded mob.
|
||||
var/list/compiled = recursive_mob_check(src, 0, 0) // Search for mobs in all contents.
|
||||
if(!length(compiled)) // No mobs?
|
||||
icon_state = "morgue3"
|
||||
return
|
||||
|
||||
for(var/mob/living/M in compiled)
|
||||
var/mob/living/mob_occupant = get_mob_or_brainmob(M)
|
||||
if(mob_occupant.client && !mob_occupant.suiciding && !(HAS_TRAIT(mob_occupant, TRAIT_NOCLONE)) && !mob_occupant.hellbound)
|
||||
icon_state = "morgue4" // Cloneable
|
||||
if(mob_occupant.stat == DEAD && beeper)
|
||||
if(world.time > next_beep)
|
||||
playsound(src, 'sound/weapons/smg_empty_alarm.ogg', 50, 0) //Clone them you blind fucks
|
||||
next_beep = world.time + beep_cooldown
|
||||
break
|
||||
|
||||
|
||||
/obj/item/paper/guides/jobs/medical/morgue
|
||||
name = "morgue memo"
|
||||
info = "<font size='2'>Since this station's medbay never seems to fail to be staffed by the mindless monkeys meant for genetics experiments, I'm leaving a reminder here for anyone handling the pile of cadavers the quacks are sure to leave.</font><BR><BR><font size='4'><font color=red>Red lights mean there's a plain ol' dead body inside.</font><BR><BR><font color=orange>Yellow lights mean there's non-body objects inside.</font><BR><font size='2'>Probably stuff pried off a corpse someone grabbed, or if you're lucky it's stashed booze.</font><BR><BR><font color=green>Green lights mean the morgue system detects the body may be able to be cloned.</font></font><BR><font size='2'>I don't know how that works, but keep it away from the kitchen and go yell at the geneticists.</font><BR><BR>- CentCom medical inspector"
|
||||
|
||||
/*
|
||||
* Crematorium
|
||||
*/
|
||||
GLOBAL_LIST_EMPTY(crematoriums)
|
||||
/obj/structure/bodycontainer/crematorium
|
||||
name = "crematorium"
|
||||
desc = "A human incinerator. Works well on barbecue nights."
|
||||
icon_state = "crema1"
|
||||
dir = SOUTH
|
||||
var/id = 1
|
||||
|
||||
/obj/structure/bodycontainer/crematorium/attack_robot(mob/user) //Borgs can't use crematoriums without help
|
||||
to_chat(user, "<span class='warning'>[src] is locked against you.</span>")
|
||||
return
|
||||
|
||||
/obj/structure/bodycontainer/crematorium/Destroy()
|
||||
GLOB.crematoriums.Remove(src)
|
||||
return ..()
|
||||
|
||||
/obj/structure/bodycontainer/crematorium/New()
|
||||
connected = new/obj/structure/tray/c_tray(src)
|
||||
connected.connected = src
|
||||
|
||||
GLOB.crematoriums.Add(src)
|
||||
..()
|
||||
|
||||
/obj/structure/bodycontainer/crematorium/update_icon()
|
||||
if(!connected || connected.loc != src)
|
||||
icon_state = "crema0"
|
||||
else
|
||||
|
||||
if(src.contents.len > 1)
|
||||
src.icon_state = "crema2"
|
||||
else
|
||||
src.icon_state = "crema1"
|
||||
|
||||
if(locked)
|
||||
src.icon_state = "crema_active"
|
||||
|
||||
return
|
||||
|
||||
/obj/structure/bodycontainer/crematorium/proc/cremate(mob/user)
|
||||
if(locked)
|
||||
return //don't let you cremate something twice or w/e
|
||||
// Make sure we don't delete the actual morgue and its tray
|
||||
var/list/conts = GetAllContents() - src - connected
|
||||
|
||||
if(!conts.len)
|
||||
audible_message("<span class='italics'>You hear a hollow crackle.</span>")
|
||||
return
|
||||
|
||||
else
|
||||
audible_message("<span class='italics'>You hear a roar as the crematorium activates.</span>")
|
||||
|
||||
locked = TRUE
|
||||
update_icon()
|
||||
|
||||
for(var/mob/living/M in conts)
|
||||
if (M.stat != DEAD)
|
||||
M.emote("scream")
|
||||
if(user)
|
||||
log_combat(user, M, "cremated")
|
||||
else
|
||||
M.log_message("was cremated", LOG_ATTACK)
|
||||
|
||||
M.death(1)
|
||||
if(M) //some animals get automatically deleted on death.
|
||||
M.ghostize()
|
||||
qdel(M)
|
||||
|
||||
for(var/obj/O in conts) //conts defined above, ignores crematorium and tray
|
||||
qdel(O)
|
||||
|
||||
if(!locate(/obj/effect/decal/cleanable/ash) in get_step(src, dir))//prevent pile-up
|
||||
new/obj/effect/decal/cleanable/ash/crematorium(src)
|
||||
|
||||
sleep(30)
|
||||
|
||||
if(!QDELETED(src))
|
||||
locked = FALSE
|
||||
update_icon()
|
||||
playsound(src.loc, 'sound/machines/ding.ogg', 50, 1) //you horrible people
|
||||
|
||||
/obj/structure/bodycontainer/crematorium/creamatorium
|
||||
name = "creamatorium"
|
||||
desc = "A human incinerator. Works well during ice cream socials."
|
||||
|
||||
/obj/structure/bodycontainer/crematorium/creamatorium/cremate(mob/user)
|
||||
var/list/icecreams = new()
|
||||
for(var/mob/living/i_scream in GetAllContents())
|
||||
var/obj/item/reagent_containers/food/snacks/icecream/IC = new()
|
||||
IC.set_cone_type("waffle")
|
||||
IC.add_mob_flavor(i_scream)
|
||||
icecreams += IC
|
||||
. = ..()
|
||||
for(var/obj/IC in icecreams)
|
||||
IC.forceMove(src)
|
||||
|
||||
/*
|
||||
* Generic Tray
|
||||
* Parent class for morguetray and crematoriumtray
|
||||
* For overriding only
|
||||
*/
|
||||
/obj/structure/tray
|
||||
icon = 'icons/obj/stationobjs.dmi'
|
||||
density = TRUE
|
||||
layer = BELOW_OBJ_LAYER
|
||||
var/obj/structure/bodycontainer/connected = null
|
||||
anchored = TRUE
|
||||
pass_flags = LETPASSTHROW
|
||||
max_integrity = 350
|
||||
|
||||
/obj/structure/tray/Destroy()
|
||||
if(connected)
|
||||
connected.connected = null
|
||||
connected.update_icon()
|
||||
connected = null
|
||||
return ..()
|
||||
|
||||
/obj/structure/tray/deconstruct(disassembled = TRUE)
|
||||
new /obj/item/stack/sheet/metal (loc, 2)
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/tray/attack_paw(mob/user)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/structure/tray/attack_hand(mob/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
if (src.connected)
|
||||
connected.close()
|
||||
add_fingerprint(user)
|
||||
else
|
||||
to_chat(user, "<span class='warning'>That's not connected to anything!</span>")
|
||||
|
||||
/obj/structure/tray/MouseDrop_T(atom/movable/O as mob|obj, mob/user)
|
||||
if(!ismovableatom(O) || O.anchored || !Adjacent(user) || !user.Adjacent(O) || O.loc == user)
|
||||
return
|
||||
if(!ismob(O))
|
||||
if(!istype(O, /obj/structure/closet/body_bag))
|
||||
return
|
||||
else
|
||||
var/mob/M = O
|
||||
if(M.buckled)
|
||||
return
|
||||
if(!ismob(user) || user.lying || user.incapacitated())
|
||||
return
|
||||
O.forceMove(src.loc)
|
||||
if (user != O)
|
||||
visible_message("<span class='warning'>[user] stuffs [O] into [src].</span>")
|
||||
return
|
||||
|
||||
/*
|
||||
* Crematorium tray
|
||||
*/
|
||||
/obj/structure/tray/c_tray
|
||||
name = "crematorium tray"
|
||||
desc = "Apply body before burning."
|
||||
icon_state = "cremat"
|
||||
|
||||
/*
|
||||
* Morgue tray
|
||||
*/
|
||||
/obj/structure/tray/m_tray
|
||||
name = "morgue tray"
|
||||
desc = "Apply corpse before closing."
|
||||
icon_state = "morguet"
|
||||
|
||||
/obj/structure/tray/m_tray/CanPass(atom/movable/mover, turf/target)
|
||||
if(istype(mover) && (mover.pass_flags & PASSTABLE))
|
||||
return 1
|
||||
if(locate(/obj/structure/table) in get_turf(mover))
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
/obj/structure/tray/m_tray/CanAStarPass(ID, dir, caller)
|
||||
. = !density
|
||||
if(ismovableatom(caller))
|
||||
var/atom/movable/mover = caller
|
||||
. = . || (mover.pass_flags & PASSTABLE)
|
||||
|
||||
//Hyperstation edit starts here
|
||||
/obj/structure/bodycontainer/morgue/attack_ghost(mob/user)
|
||||
. = ..()
|
||||
if(!beeper || inuse)
|
||||
return
|
||||
|
||||
var/list/compiled = recursive_mob_check(src, 0, 0) // Search for mobs in all contents.
|
||||
if(!length(compiled)) // No mobs?
|
||||
return
|
||||
|
||||
for(var/mob/living/M in compiled)
|
||||
var/mob/living/mob_occupant = get_mob_or_brainmob(M)
|
||||
if(!mob_occupant.suiciding && !mob_occupant.hellbound)
|
||||
if(mob_occupant.stat == DEAD && mob_occupant.mind.key == user.client.key)
|
||||
inuse = TRUE
|
||||
visible_message("One of the morgue coffins currently holds a soul that is eager to have its body revived.")
|
||||
radio.talk_into(src, "One of the morgue coffins currently holds a soul that is eager to have its body revived.", medical_channel)
|
||||
playsound(loc, 'sound/machines/ping.ogg', 50)
|
||||
addtimer(CALLBACK(src, .proc/liftcooldown), 500)
|
||||
|
||||
/obj/structure/bodycontainer/morgue/proc/liftcooldown()
|
||||
inuse = FALSE
|
||||
//Hyperstation edit ends here
|
||||
/* Morgue stuff
|
||||
* Contains:
|
||||
* Morgue
|
||||
* Morgue tray
|
||||
* Crematorium
|
||||
* Creamatorium
|
||||
* Crematorium tray
|
||||
* Crematorium button
|
||||
*/
|
||||
|
||||
/*
|
||||
* Bodycontainer
|
||||
* Parent class for morgue and crematorium
|
||||
* For overriding only
|
||||
*/
|
||||
GLOBAL_LIST_EMPTY(bodycontainers) //Let them act as spawnpoints for revenants and other ghosties.
|
||||
|
||||
/obj/structure/bodycontainer
|
||||
icon = 'icons/obj/stationobjs.dmi'
|
||||
icon_state = "morgue1"
|
||||
density = TRUE
|
||||
anchored = TRUE
|
||||
max_integrity = 400
|
||||
|
||||
var/obj/structure/tray/connected = null
|
||||
var/locked = FALSE
|
||||
dir = SOUTH
|
||||
var/message_cooldown
|
||||
var/breakout_time = 600
|
||||
var/obj/item/radio/radio = null
|
||||
var/hasradio = FALSE
|
||||
|
||||
/obj/structure/bodycontainer/Initialize()
|
||||
. = ..()
|
||||
GLOB.bodycontainers += src
|
||||
recursive_organ_check(src)
|
||||
|
||||
/obj/structure/bodycontainer/Destroy()
|
||||
GLOB.bodycontainers -= src
|
||||
open()
|
||||
if(connected)
|
||||
qdel(connected)
|
||||
connected = null
|
||||
return ..()
|
||||
|
||||
/obj/structure/bodycontainer/on_log(login)
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
/obj/structure/bodycontainer/update_icon()
|
||||
return
|
||||
|
||||
/obj/structure/bodycontainer/relaymove(mob/user)
|
||||
if(user.stat || !isturf(loc))
|
||||
return
|
||||
if(locked)
|
||||
if(message_cooldown <= world.time)
|
||||
message_cooldown = world.time + 50
|
||||
to_chat(user, "<span class='warning'>[src]'s door won't budge!</span>")
|
||||
return
|
||||
open()
|
||||
|
||||
/obj/structure/bodycontainer/attack_paw(mob/user)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/structure/bodycontainer/attack_hand(mob/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
if(locked)
|
||||
to_chat(user, "<span class='danger'>It's locked.</span>")
|
||||
return
|
||||
if(!connected)
|
||||
to_chat(user, "That doesn't appear to have a tray.")
|
||||
return
|
||||
if(connected.loc == src)
|
||||
open()
|
||||
else
|
||||
close()
|
||||
add_fingerprint(user)
|
||||
|
||||
/obj/structure/bodycontainer/attack_robot(mob/user)
|
||||
if(!user.Adjacent(src))
|
||||
return
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/structure/bodycontainer/attackby(obj/P, mob/user, params)
|
||||
add_fingerprint(user)
|
||||
if(istype(P, /obj/item/pen))
|
||||
if(!user.is_literate())
|
||||
to_chat(user, "<span class='notice'>You scribble illegibly on the side of [src]!</span>")
|
||||
return
|
||||
var/t = stripped_input(user, "What would you like the label to be?", text("[]", name), null)
|
||||
if (user.get_active_held_item() != P)
|
||||
return
|
||||
if(!user.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
if (t)
|
||||
name = text("[]- '[]'", initial(name), t)
|
||||
else
|
||||
name = initial(name)
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/structure/bodycontainer/deconstruct(disassembled = TRUE)
|
||||
new /obj/item/stack/sheet/metal (loc, 5)
|
||||
recursive_organ_check(src)
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/bodycontainer/container_resist(mob/living/user)
|
||||
if(!locked)
|
||||
open()
|
||||
return
|
||||
user.changeNext_move(CLICK_CD_BREAKOUT)
|
||||
user.last_special = world.time + CLICK_CD_BREAKOUT
|
||||
user.visible_message(null, \
|
||||
"<span class='notice'>You lean on the back of [src] and start pushing the tray open... (this will take about [DisplayTimeText(breakout_time)].)</span>", \
|
||||
"<span class='italics'>You hear a metallic creaking from [src].</span>")
|
||||
if(do_after(user,(breakout_time), target = src))
|
||||
if(!user || user.stat != CONSCIOUS || user.loc != src )
|
||||
return
|
||||
user.visible_message("<span class='warning'>[user] successfully broke out of [src]!</span>", \
|
||||
"<span class='notice'>You successfully break out of [src]!</span>")
|
||||
open()
|
||||
|
||||
/obj/structure/bodycontainer/proc/open()
|
||||
recursive_organ_check(src)
|
||||
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1)
|
||||
playsound(src, 'sound/effects/roll.ogg', 5, 1)
|
||||
var/turf/T = get_step(src, dir)
|
||||
connected.setDir(dir)
|
||||
for(var/atom/movable/AM in src)
|
||||
if(AM != radio)
|
||||
AM.forceMove(T)
|
||||
update_icon()
|
||||
|
||||
/obj/structure/bodycontainer/proc/close()
|
||||
playsound(src, 'sound/effects/roll.ogg', 5, 1)
|
||||
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1)
|
||||
for(var/atom/movable/AM in connected.loc)
|
||||
if(!AM.anchored || AM == connected)
|
||||
AM.forceMove(src)
|
||||
recursive_organ_check(src)
|
||||
update_icon()
|
||||
|
||||
/obj/structure/bodycontainer/get_remote_view_fullscreens(mob/user)
|
||||
if(user.stat == DEAD || !(user.sight & (SEEOBJS|SEEMOBS)))
|
||||
user.overlay_fullscreen("remote_view", /obj/screen/fullscreen/impaired, 2)
|
||||
/*
|
||||
* Morgue
|
||||
*/
|
||||
/obj/structure/bodycontainer/morgue
|
||||
name = "morgue"
|
||||
desc = "Used to keep bodies in until someone fetches them. Now includes a high-tech alert system."
|
||||
icon_state = "morgue1"
|
||||
dir = EAST
|
||||
var/beeper = TRUE
|
||||
var/beep_cooldown = 50
|
||||
var/next_beep = 0
|
||||
//Hyperstation edit
|
||||
var/radio_key = /obj/item/encryptionkey/headset_med
|
||||
var/medical_channel = "Medical"
|
||||
var/inuse = FALSE
|
||||
hasradio = TRUE
|
||||
|
||||
/obj/structure/bodycontainer/morgue/Initialize()
|
||||
. = ..()
|
||||
radio = new(src)
|
||||
radio.anchored = TRUE
|
||||
radio.keyslot = new radio_key
|
||||
radio.listening = 0
|
||||
radio.recalculateChannels()
|
||||
|
||||
/obj/structure/bodycontainer/morgue/Destroy()
|
||||
QDEL_NULL(radio)
|
||||
GLOB.bodycontainers -= src
|
||||
open()
|
||||
if(connected)
|
||||
qdel(connected)
|
||||
connected = null
|
||||
return ..()
|
||||
/*
|
||||
/obj/structure/bodycontainer/morgue/proc/open2()
|
||||
recursive_organ_check(src)
|
||||
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1)
|
||||
playsound(src, 'sound/effects/roll.ogg', 5, 1)
|
||||
var/turf/T = get_step(src, dir)
|
||||
connected.setDir(dir)
|
||||
for(var/atom/movable/AM in src)
|
||||
if(AM != radio)
|
||||
AM.forceMove(T)
|
||||
update_icon()
|
||||
*/
|
||||
//end of edit
|
||||
/obj/structure/bodycontainer/morgue/New()
|
||||
connected = new/obj/structure/tray/m_tray(src)
|
||||
connected.connected = src
|
||||
..()
|
||||
|
||||
/obj/structure/bodycontainer/morgue/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>The speaker is [beeper ? "enabled" : "disabled"]. Alt-click to toggle it.</span>"
|
||||
|
||||
/obj/structure/bodycontainer/morgue/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(!user.canUseTopic(src, !issilicon(user)))
|
||||
return
|
||||
beeper = !beeper
|
||||
to_chat(user, "<span class='notice'>You turn the speaker function [beeper ? "on" : "off"].</span>")
|
||||
return TRUE
|
||||
|
||||
/obj/structure/bodycontainer/morgue/update_icon()
|
||||
if (!connected || connected.loc != src) // Open or tray is gone.
|
||||
icon_state = "morgue0"
|
||||
else
|
||||
if(contents.len == 2) // Empty. Was length 1 because of the tray, is now length 2 because it includes a radio.
|
||||
icon_state = "morgue1"
|
||||
else
|
||||
icon_state = "morgue2" // Dead, brainded mob.
|
||||
var/list/compiled = recursive_mob_check(src, 0, 0) // Search for mobs in all contents.
|
||||
if(!length(compiled)) // No mobs?
|
||||
icon_state = "morgue3"
|
||||
return
|
||||
|
||||
for(var/mob/living/M in compiled)
|
||||
var/mob/living/mob_occupant = get_mob_or_brainmob(M)
|
||||
if(mob_occupant.client && !mob_occupant.suiciding && !(HAS_TRAIT(mob_occupant, TRAIT_NOCLONE)) && !mob_occupant.hellbound)
|
||||
icon_state = "morgue4" // Cloneable
|
||||
if(mob_occupant.stat == DEAD && beeper)
|
||||
if(world.time > next_beep)
|
||||
playsound(src, 'sound/weapons/smg_empty_alarm.ogg', 50, 0) //Clone them you blind fucks
|
||||
next_beep = world.time + beep_cooldown
|
||||
break
|
||||
|
||||
|
||||
/obj/item/paper/guides/jobs/medical/morgue
|
||||
name = "morgue memo"
|
||||
info = "<font size='2'>Since this station's medbay never seems to fail to be staffed by the mindless monkeys meant for genetics experiments, I'm leaving a reminder here for anyone handling the pile of cadavers the quacks are sure to leave.</font><BR><BR><font size='4'><font color=red>Red lights mean there's a plain ol' dead body inside.</font><BR><BR><font color=orange>Yellow lights mean there's non-body objects inside.</font><BR><font size='2'>Probably stuff pried off a corpse someone grabbed, or if you're lucky it's stashed booze.</font><BR><BR><font color=green>Green lights mean the morgue system detects the body may be able to be cloned.</font></font><BR><font size='2'>I don't know how that works, but keep it away from the kitchen and go yell at the geneticists.</font><BR><BR>- CentCom medical inspector"
|
||||
|
||||
/*
|
||||
* Crematorium
|
||||
*/
|
||||
GLOBAL_LIST_EMPTY(crematoriums)
|
||||
/obj/structure/bodycontainer/crematorium
|
||||
name = "crematorium"
|
||||
desc = "A human incinerator. Works well on barbecue nights."
|
||||
icon_state = "crema1"
|
||||
dir = SOUTH
|
||||
var/id = 1
|
||||
|
||||
/obj/structure/bodycontainer/crematorium/attack_robot(mob/user) //Borgs can't use crematoriums without help
|
||||
to_chat(user, "<span class='warning'>[src] is locked against you.</span>")
|
||||
return
|
||||
|
||||
/obj/structure/bodycontainer/crematorium/Destroy()
|
||||
GLOB.crematoriums.Remove(src)
|
||||
return ..()
|
||||
|
||||
/obj/structure/bodycontainer/crematorium/New()
|
||||
connected = new/obj/structure/tray/c_tray(src)
|
||||
connected.connected = src
|
||||
|
||||
GLOB.crematoriums.Add(src)
|
||||
..()
|
||||
|
||||
/obj/structure/bodycontainer/crematorium/update_icon()
|
||||
if(!connected || connected.loc != src)
|
||||
icon_state = "crema0"
|
||||
else
|
||||
|
||||
if(src.contents.len > 1)
|
||||
src.icon_state = "crema2"
|
||||
else
|
||||
src.icon_state = "crema1"
|
||||
|
||||
if(locked)
|
||||
src.icon_state = "crema_active"
|
||||
|
||||
return
|
||||
|
||||
/obj/structure/bodycontainer/crematorium/proc/cremate(mob/user)
|
||||
if(locked)
|
||||
return //don't let you cremate something twice or w/e
|
||||
// Make sure we don't delete the actual morgue and its tray
|
||||
var/list/conts = GetAllContents() - src - connected
|
||||
|
||||
if(!conts.len)
|
||||
audible_message("<span class='italics'>You hear a hollow crackle.</span>")
|
||||
return
|
||||
|
||||
else
|
||||
audible_message("<span class='italics'>You hear a roar as the crematorium activates.</span>")
|
||||
|
||||
locked = TRUE
|
||||
update_icon()
|
||||
|
||||
for(var/mob/living/M in conts)
|
||||
if (M.stat != DEAD)
|
||||
M.emote("scream")
|
||||
if(user)
|
||||
log_combat(user, M, "cremated")
|
||||
else
|
||||
M.log_message("was cremated", LOG_ATTACK)
|
||||
|
||||
M.death(1)
|
||||
if(M) //some animals get automatically deleted on death.
|
||||
M.ghostize()
|
||||
qdel(M)
|
||||
|
||||
for(var/obj/O in conts) //conts defined above, ignores crematorium and tray
|
||||
qdel(O)
|
||||
|
||||
if(!locate(/obj/effect/decal/cleanable/ash) in get_step(src, dir))//prevent pile-up
|
||||
new/obj/effect/decal/cleanable/ash/crematorium(src)
|
||||
|
||||
sleep(30)
|
||||
|
||||
if(!QDELETED(src))
|
||||
locked = FALSE
|
||||
update_icon()
|
||||
playsound(src.loc, 'sound/machines/ding.ogg', 50, 1) //you horrible people
|
||||
|
||||
/obj/structure/bodycontainer/crematorium/creamatorium
|
||||
name = "creamatorium"
|
||||
desc = "A human incinerator. Works well during ice cream socials."
|
||||
|
||||
/obj/structure/bodycontainer/crematorium/creamatorium/cremate(mob/user)
|
||||
var/list/icecreams = new()
|
||||
for(var/mob/living/i_scream in GetAllContents())
|
||||
var/obj/item/reagent_containers/food/snacks/icecream/IC = new()
|
||||
IC.set_cone_type("waffle")
|
||||
IC.add_mob_flavor(i_scream)
|
||||
icecreams += IC
|
||||
. = ..()
|
||||
for(var/obj/IC in icecreams)
|
||||
IC.forceMove(src)
|
||||
|
||||
/*
|
||||
* Generic Tray
|
||||
* Parent class for morguetray and crematoriumtray
|
||||
* For overriding only
|
||||
*/
|
||||
/obj/structure/tray
|
||||
icon = 'icons/obj/stationobjs.dmi'
|
||||
density = TRUE
|
||||
layer = BELOW_OBJ_LAYER
|
||||
var/obj/structure/bodycontainer/connected = null
|
||||
anchored = TRUE
|
||||
pass_flags = LETPASSTHROW
|
||||
max_integrity = 350
|
||||
|
||||
/obj/structure/tray/Destroy()
|
||||
if(connected)
|
||||
connected.connected = null
|
||||
connected.update_icon()
|
||||
connected = null
|
||||
return ..()
|
||||
|
||||
/obj/structure/tray/deconstruct(disassembled = TRUE)
|
||||
new /obj/item/stack/sheet/metal (loc, 2)
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/tray/attack_paw(mob/user)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/structure/tray/attack_hand(mob/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
if (src.connected)
|
||||
connected.close()
|
||||
add_fingerprint(user)
|
||||
else
|
||||
to_chat(user, "<span class='warning'>That's not connected to anything!</span>")
|
||||
|
||||
/obj/structure/tray/MouseDrop_T(atom/movable/O as mob|obj, mob/user)
|
||||
if(!ismovableatom(O) || O.anchored || !Adjacent(user) || !user.Adjacent(O) || O.loc == user)
|
||||
return
|
||||
if(!ismob(O))
|
||||
if(!istype(O, /obj/structure/closet/body_bag))
|
||||
return
|
||||
else
|
||||
var/mob/M = O
|
||||
if(M.buckled)
|
||||
return
|
||||
if(!ismob(user) || user.lying || user.incapacitated())
|
||||
return
|
||||
O.forceMove(src.loc)
|
||||
if (user != O)
|
||||
visible_message("<span class='warning'>[user] stuffs [O] into [src].</span>")
|
||||
return
|
||||
|
||||
/*
|
||||
* Crematorium tray
|
||||
*/
|
||||
/obj/structure/tray/c_tray
|
||||
name = "crematorium tray"
|
||||
desc = "Apply body before burning."
|
||||
icon_state = "cremat"
|
||||
|
||||
/*
|
||||
* Morgue tray
|
||||
*/
|
||||
/obj/structure/tray/m_tray
|
||||
name = "morgue tray"
|
||||
desc = "Apply corpse before closing."
|
||||
icon_state = "morguet"
|
||||
|
||||
/obj/structure/tray/m_tray/CanPass(atom/movable/mover, turf/target)
|
||||
if(istype(mover) && (mover.pass_flags & PASSTABLE))
|
||||
return 1
|
||||
if(locate(/obj/structure/table) in get_turf(mover))
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
/obj/structure/tray/m_tray/CanAStarPass(ID, dir, caller)
|
||||
. = !density
|
||||
if(ismovableatom(caller))
|
||||
var/atom/movable/mover = caller
|
||||
. = . || (mover.pass_flags & PASSTABLE)
|
||||
|
||||
//Hyperstation edit starts here
|
||||
/obj/structure/bodycontainer/morgue/attack_ghost(mob/user)
|
||||
. = ..()
|
||||
if(!beeper || inuse)
|
||||
return
|
||||
|
||||
var/list/compiled = recursive_mob_check(src, 0, 0) // Search for mobs in all contents.
|
||||
if(!length(compiled)) // No mobs?
|
||||
return
|
||||
|
||||
for(var/mob/living/M in compiled)
|
||||
var/mob/living/mob_occupant = get_mob_or_brainmob(M)
|
||||
if(!mob_occupant.suiciding && !mob_occupant.hellbound)
|
||||
if(mob_occupant.stat == DEAD && mob_occupant.mind.key == user.client.key)
|
||||
inuse = TRUE
|
||||
visible_message("One of the morgue coffins currently holds a soul that is eager to have its body revived.")
|
||||
radio.talk_into(src, "One of the morgue coffins currently holds a soul that is eager to have its body revived.", medical_channel)
|
||||
playsound(loc, 'sound/machines/ping.ogg', 50)
|
||||
addtimer(CALLBACK(src, .proc/liftcooldown), 500)
|
||||
|
||||
/obj/structure/bodycontainer/morgue/proc/liftcooldown()
|
||||
inuse = FALSE
|
||||
//Hyperstation edit ends here
|
||||
|
||||
@@ -168,10 +168,12 @@
|
||||
return TRUE
|
||||
|
||||
/obj/structure/reflector/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(!user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||
return
|
||||
else if(finished)
|
||||
rotate(user)
|
||||
return TRUE
|
||||
|
||||
|
||||
//TYPES OF REFLECTORS, SINGLE, DOUBLE, BOX
|
||||
|
||||
@@ -52,9 +52,11 @@
|
||||
edit_emitter(user)
|
||||
|
||||
/obj/effect/sound_emitter/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(check_rights_for(user.client, R_SOUNDS))
|
||||
activate(user)
|
||||
to_chat(user, "<span class='notice'>Sound emitter activated.</span>")
|
||||
return TRUE
|
||||
|
||||
/obj/effect/sound_emitter/proc/edit_emitter(mob/user)
|
||||
var/dat = ""
|
||||
|
||||
@@ -180,9 +180,11 @@
|
||||
access_display(user)
|
||||
|
||||
/obj/item/clockwork/slab/AltClick(mob/living/user)
|
||||
. = ..()
|
||||
if(is_servant_of_ratvar(user) && linking && user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||
linking = null
|
||||
to_chat(user, "<span class='notice'>Object link canceled.</span>")
|
||||
return TRUE
|
||||
|
||||
/obj/item/clockwork/slab/proc/access_display(mob/living/user)
|
||||
if(!is_servant_of_ratvar(user))
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
ShiftClickOn(A)
|
||||
return
|
||||
if(modifiers["alt"])
|
||||
AltClickNoInteract(src, A)
|
||||
altclick_listed_turf(A)
|
||||
return
|
||||
|
||||
if(iscarbon(A))
|
||||
|
||||
@@ -838,11 +838,11 @@
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/airalarm/AltClick(mob/user)
|
||||
..()
|
||||
. = ..()
|
||||
if(!user.canUseTopic(src, !issilicon(user)) || !isturf(loc))
|
||||
return
|
||||
else
|
||||
togglelock(user)
|
||||
togglelock(user)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/airalarm/proc/togglelock(mob/living/user)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
|
||||
@@ -1,342 +1,341 @@
|
||||
// Quick overview:
|
||||
//
|
||||
// Pipes combine to form pipelines
|
||||
// Pipelines and other atmospheric objects combine to form pipe_networks
|
||||
// Note: A single pipe_network represents a completely open space
|
||||
//
|
||||
// Pipes -> Pipelines
|
||||
// Pipelines + Other Objects -> Pipe network
|
||||
|
||||
#define PIPE_VISIBLE_LEVEL 2
|
||||
#define PIPE_HIDDEN_LEVEL 1
|
||||
|
||||
/obj/machinery/atmospherics
|
||||
anchored = TRUE
|
||||
move_resist = INFINITY //Moving a connected machine without actually doing the normal (dis)connection things will probably cause a LOT of issues.
|
||||
idle_power_usage = 0
|
||||
active_power_usage = 0
|
||||
power_channel = ENVIRON
|
||||
layer = GAS_PIPE_HIDDEN_LAYER //under wires
|
||||
resistance_flags = FIRE_PROOF
|
||||
max_integrity = 200
|
||||
obj_flags = CAN_BE_HIT | ON_BLUEPRINTS
|
||||
var/nodealert = 0
|
||||
var/can_unwrench = 0
|
||||
var/initialize_directions = 0
|
||||
var/pipe_color
|
||||
var/piping_layer = PIPING_LAYER_DEFAULT
|
||||
var/pipe_flags = NONE
|
||||
|
||||
var/global/list/iconsetids = list()
|
||||
var/global/list/pipeimages = list()
|
||||
|
||||
var/image/pipe_vision_img = null
|
||||
|
||||
var/device_type = 0
|
||||
var/list/obj/machinery/atmospherics/nodes
|
||||
|
||||
var/construction_type
|
||||
var/pipe_state //icon_state as a pipe item
|
||||
var/on = FALSE
|
||||
|
||||
/obj/machinery/atmospherics/examine(mob/user)
|
||||
. = ..()
|
||||
if(is_type_in_list(src, GLOB.ventcrawl_machinery) && isliving(user))
|
||||
var/mob/living/L = user
|
||||
if(L.ventcrawler)
|
||||
. += "<span class='notice'>Alt-click to crawl through it.</span>"
|
||||
|
||||
/obj/machinery/atmospherics/New(loc, process = TRUE, setdir)
|
||||
if(!isnull(setdir))
|
||||
setDir(setdir)
|
||||
if(pipe_flags & PIPING_CARDINAL_AUTONORMALIZE)
|
||||
normalize_cardinal_directions()
|
||||
nodes = new(device_type)
|
||||
if (!armor)
|
||||
armor = list("melee" = 25, "bullet" = 10, "laser" = 10, "energy" = 100, "bomb" = 0, "bio" = 100, "rad" = 100, "fire" = 100, "acid" = 70)
|
||||
..()
|
||||
if(process)
|
||||
SSair.atmos_machinery += src
|
||||
SetInitDirections()
|
||||
|
||||
/obj/machinery/atmospherics/Destroy()
|
||||
for(var/i in 1 to device_type)
|
||||
nullifyNode(i)
|
||||
|
||||
SSair.atmos_machinery -= src
|
||||
|
||||
dropContents()
|
||||
if(pipe_vision_img)
|
||||
qdel(pipe_vision_img)
|
||||
|
||||
return ..()
|
||||
//return QDEL_HINT_FINDREFERENCE
|
||||
|
||||
/obj/machinery/atmospherics/proc/destroy_network()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/proc/build_network()
|
||||
// Called to build a network from this node
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/proc/nullifyNode(i)
|
||||
if(nodes[i])
|
||||
var/obj/machinery/atmospherics/N = nodes[i]
|
||||
N.disconnect(src)
|
||||
nodes[i] = null
|
||||
|
||||
/obj/machinery/atmospherics/proc/getNodeConnects()
|
||||
var/list/node_connects = list()
|
||||
node_connects.len = device_type
|
||||
|
||||
for(var/i in 1 to device_type)
|
||||
for(var/D in GLOB.cardinals)
|
||||
if(D & GetInitDirections())
|
||||
if(D in node_connects)
|
||||
continue
|
||||
node_connects[i] = D
|
||||
break
|
||||
return node_connects
|
||||
|
||||
/obj/machinery/atmospherics/proc/normalize_cardinal_directions()
|
||||
switch(dir)
|
||||
if(SOUTH)
|
||||
setDir(NORTH)
|
||||
if(WEST)
|
||||
setDir(EAST)
|
||||
|
||||
//this is called just after the air controller sets up turfs
|
||||
/obj/machinery/atmospherics/proc/atmosinit(list/node_connects)
|
||||
if(!node_connects) //for pipes where order of nodes doesn't matter
|
||||
node_connects = getNodeConnects()
|
||||
|
||||
for(var/i in 1 to device_type)
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node_connects[i]))
|
||||
if(can_be_node(target, i))
|
||||
nodes[i] = target
|
||||
break
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/proc/setPipingLayer(new_layer)
|
||||
piping_layer = (pipe_flags & PIPING_DEFAULT_LAYER_ONLY) ? PIPING_LAYER_DEFAULT : new_layer
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/proc/can_be_node(obj/machinery/atmospherics/target, iteration)
|
||||
return connection_check(target, piping_layer)
|
||||
|
||||
//Find a connecting /obj/machinery/atmospherics in specified direction
|
||||
/obj/machinery/atmospherics/proc/findConnecting(direction, prompted_layer)
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src, direction))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
if(connection_check(target, prompted_layer))
|
||||
return target
|
||||
|
||||
/obj/machinery/atmospherics/proc/connection_check(obj/machinery/atmospherics/target, given_layer)
|
||||
if(isConnectable(target, given_layer) && target.isConnectable(src, given_layer) && (target.initialize_directions & get_dir(target,src)))
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/atmospherics/proc/isConnectable(obj/machinery/atmospherics/target, given_layer)
|
||||
if(isnull(given_layer))
|
||||
given_layer = piping_layer
|
||||
if((target.piping_layer == given_layer) || (target.pipe_flags & PIPING_ALL_LAYER))
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/atmospherics/proc/pipeline_expansion()
|
||||
return nodes
|
||||
|
||||
/obj/machinery/atmospherics/proc/SetInitDirections()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/proc/GetInitDirections()
|
||||
return initialize_directions
|
||||
|
||||
/obj/machinery/atmospherics/proc/returnPipenet()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/proc/returnPipenetAir()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/proc/setPipenet()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/proc/replacePipenet()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/proc/disconnect(obj/machinery/atmospherics/reference)
|
||||
if(istype(reference, /obj/machinery/atmospherics/pipe))
|
||||
var/obj/machinery/atmospherics/pipe/P = reference
|
||||
P.destroy_network()
|
||||
nodes[nodes.Find(reference)] = null
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/pipe)) //lets you autodrop
|
||||
var/obj/item/pipe/pipe = W
|
||||
if(user.dropItemToGround(pipe))
|
||||
pipe.setPipingLayer(piping_layer) //align it with us
|
||||
return TRUE
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/wrench_act(mob/living/user, obj/item/I)
|
||||
if(!can_unwrench(user))
|
||||
return ..()
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
if (level==1 && isturf(T) && T.intact)
|
||||
to_chat(user, "<span class='warning'>You must remove the plating first!</span>")
|
||||
return TRUE
|
||||
|
||||
var/datum/gas_mixture/int_air = return_air()
|
||||
var/datum/gas_mixture/env_air = loc.return_air()
|
||||
add_fingerprint(user)
|
||||
|
||||
var/unsafe_wrenching = FALSE
|
||||
var/internal_pressure = int_air.return_pressure()-env_air.return_pressure()
|
||||
|
||||
to_chat(user, "<span class='notice'>You begin to unfasten \the [src]...</span>")
|
||||
|
||||
if (internal_pressure > 2*ONE_ATMOSPHERE)
|
||||
to_chat(user, "<span class='warning'>As you begin unwrenching \the [src] a gush of air blows in your face... maybe you should reconsider?</span>")
|
||||
unsafe_wrenching = TRUE //Oh dear oh dear
|
||||
|
||||
if(I.use_tool(src, user, 20, volume=50))
|
||||
user.visible_message( \
|
||||
"[user] unfastens \the [src].", \
|
||||
"<span class='notice'>You unfasten \the [src].</span>", \
|
||||
"<span class='italics'>You hear ratchet.</span>")
|
||||
investigate_log("was <span class='warning'>REMOVED</span> by [key_name(usr)]", INVESTIGATE_ATMOS)
|
||||
|
||||
//You unwrenched a pipe full of pressure? Let's splat you into the wall, silly.
|
||||
if(unsafe_wrenching)
|
||||
unsafe_pressure_release(user, internal_pressure)
|
||||
deconstruct(TRUE)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/atmospherics/proc/can_unwrench(mob/user)
|
||||
return can_unwrench
|
||||
|
||||
// Throws the user when they unwrench a pipe with a major difference between the internal and environmental pressure.
|
||||
/obj/machinery/atmospherics/proc/unsafe_pressure_release(mob/user, pressures = null)
|
||||
if(!user)
|
||||
return
|
||||
if(!pressures)
|
||||
var/datum/gas_mixture/int_air = return_air()
|
||||
var/datum/gas_mixture/env_air = loc.return_air()
|
||||
pressures = int_air.return_pressure() - env_air.return_pressure()
|
||||
|
||||
user.visible_message("<span class='danger'>[user] is sent flying by pressure!</span>","<span class='userdanger'>The pressure sends you flying!</span>")
|
||||
|
||||
// if get_dir(src, user) is not 0, target is the edge_target_turf on that dir
|
||||
// otherwise, edge_target_turf uses a random cardinal direction
|
||||
// range is pressures / 250
|
||||
// speed is pressures / 1250
|
||||
user.throw_at(get_edge_target_turf(user, get_dir(src, user) || pick(GLOB.cardinals)), pressures / 250, pressures / 1250)
|
||||
|
||||
/obj/machinery/atmospherics/deconstruct(disassembled = TRUE)
|
||||
if(!(flags_1 & NODECONSTRUCT_1))
|
||||
if(can_unwrench)
|
||||
var/obj/item/pipe/stored = new construction_type(loc, null, dir, src)
|
||||
stored.setPipingLayer(piping_layer)
|
||||
if(!disassembled)
|
||||
stored.obj_integrity = stored.max_integrity * 0.5
|
||||
transfer_fingerprints_to(stored)
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/proc/getpipeimage(iconset, iconstate, direction, col=rgb(255,255,255), piping_layer=2)
|
||||
|
||||
//Add identifiers for the iconset
|
||||
if(iconsetids[iconset] == null)
|
||||
iconsetids[iconset] = num2text(iconsetids.len + 1)
|
||||
|
||||
//Generate a unique identifier for this image combination
|
||||
var/identifier = iconsetids[iconset] + "_[iconstate]_[direction]_[col]_[piping_layer]"
|
||||
|
||||
if((!(. = pipeimages[identifier])))
|
||||
var/image/pipe_overlay
|
||||
pipe_overlay = . = pipeimages[identifier] = image(iconset, iconstate, dir = direction)
|
||||
pipe_overlay.color = col
|
||||
PIPING_LAYER_SHIFT(pipe_overlay, piping_layer)
|
||||
|
||||
/obj/machinery/atmospherics/on_construction(obj_color, set_layer)
|
||||
if(can_unwrench)
|
||||
add_atom_colour(obj_color, FIXED_COLOUR_PRIORITY)
|
||||
pipe_color = obj_color
|
||||
setPipingLayer(set_layer)
|
||||
var/turf/T = get_turf(src)
|
||||
level = T.intact ? 2 : 1
|
||||
atmosinit()
|
||||
var/list/nodes = pipeline_expansion()
|
||||
for(var/obj/machinery/atmospherics/A in nodes)
|
||||
A.atmosinit()
|
||||
A.addMember(src)
|
||||
build_network()
|
||||
|
||||
/obj/machinery/atmospherics/Entered(atom/movable/AM)
|
||||
if(istype(AM, /mob/living))
|
||||
var/mob/living/L = AM
|
||||
L.ventcrawl_layer = piping_layer
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/singularity_pull(S, current_size)
|
||||
if(current_size >= STAGE_FIVE)
|
||||
deconstruct(FALSE)
|
||||
return ..()
|
||||
|
||||
#define VENT_SOUND_DELAY 30
|
||||
|
||||
/obj/machinery/atmospherics/relaymove(mob/living/user, direction)
|
||||
direction &= initialize_directions
|
||||
if(!direction || !(direction in GLOB.cardinals)) //cant go this way.
|
||||
return
|
||||
|
||||
if(user in buckled_mobs)// fixes buckle ventcrawl edgecase fuck bug
|
||||
return
|
||||
|
||||
var/obj/machinery/atmospherics/target_move = findConnecting(direction, user.ventcrawl_layer)
|
||||
if(target_move)
|
||||
if(target_move.can_crawl_through())
|
||||
if(is_type_in_typecache(target_move, GLOB.ventcrawl_machinery))
|
||||
user.forceMove(target_move.loc) //handle entering and so on.
|
||||
user.visible_message("<span class='notice'>You hear something squeezing through the ducts...</span>", "<span class='notice'>You climb out the ventilation system.")
|
||||
else
|
||||
var/list/pipenetdiff = returnPipenets() ^ target_move.returnPipenets()
|
||||
if(pipenetdiff.len)
|
||||
user.update_pipe_vision(target_move)
|
||||
user.forceMove(target_move)
|
||||
user.client.eye = target_move //Byond only updates the eye every tick, This smooths out the movement
|
||||
if(world.time - user.last_played_vent > VENT_SOUND_DELAY)
|
||||
user.last_played_vent = world.time
|
||||
playsound(src, 'sound/machines/ventcrawl.ogg', 50, 1, -3)
|
||||
else if(is_type_in_typecache(src, GLOB.ventcrawl_machinery) && can_crawl_through()) //if we move in a way the pipe can connect, but doesn't - or we're in a vent
|
||||
user.forceMove(loc)
|
||||
user.visible_message("<span class='notice'>You hear something squeezing through the ducts...</span>", "<span class='notice'>You climb out the ventilation system.")
|
||||
|
||||
user.canmove = FALSE
|
||||
addtimer(VARSET_CALLBACK(user, canmove, TRUE), 1)
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/AltClick(mob/living/L)
|
||||
if(is_type_in_list(src, GLOB.ventcrawl_machinery))
|
||||
L.handle_ventcrawl(src)
|
||||
return
|
||||
..()
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/proc/can_crawl_through()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/atmospherics/proc/returnPipenets()
|
||||
return list()
|
||||
|
||||
/obj/machinery/atmospherics/update_remote_sight(mob/user)
|
||||
user.sight |= (SEE_TURFS|BLIND)
|
||||
|
||||
//Used for certain children of obj/machinery/atmospherics to not show pipe vision when mob is inside it.
|
||||
/obj/machinery/atmospherics/proc/can_see_pipes()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/atmospherics/proc/update_layer()
|
||||
// Quick overview:
|
||||
//
|
||||
// Pipes combine to form pipelines
|
||||
// Pipelines and other atmospheric objects combine to form pipe_networks
|
||||
// Note: A single pipe_network represents a completely open space
|
||||
//
|
||||
// Pipes -> Pipelines
|
||||
// Pipelines + Other Objects -> Pipe network
|
||||
|
||||
#define PIPE_VISIBLE_LEVEL 2
|
||||
#define PIPE_HIDDEN_LEVEL 1
|
||||
|
||||
/obj/machinery/atmospherics
|
||||
anchored = TRUE
|
||||
move_resist = INFINITY //Moving a connected machine without actually doing the normal (dis)connection things will probably cause a LOT of issues.
|
||||
idle_power_usage = 0
|
||||
active_power_usage = 0
|
||||
power_channel = ENVIRON
|
||||
layer = GAS_PIPE_HIDDEN_LAYER //under wires
|
||||
resistance_flags = FIRE_PROOF
|
||||
max_integrity = 200
|
||||
obj_flags = CAN_BE_HIT | ON_BLUEPRINTS
|
||||
var/nodealert = 0
|
||||
var/can_unwrench = 0
|
||||
var/initialize_directions = 0
|
||||
var/pipe_color
|
||||
var/piping_layer = PIPING_LAYER_DEFAULT
|
||||
var/pipe_flags = NONE
|
||||
|
||||
var/global/list/iconsetids = list()
|
||||
var/global/list/pipeimages = list()
|
||||
|
||||
var/image/pipe_vision_img = null
|
||||
|
||||
var/device_type = 0
|
||||
var/list/obj/machinery/atmospherics/nodes
|
||||
|
||||
var/construction_type
|
||||
var/pipe_state //icon_state as a pipe item
|
||||
var/on = FALSE
|
||||
|
||||
/obj/machinery/atmospherics/examine(mob/user)
|
||||
. = ..()
|
||||
if(is_type_in_list(src, GLOB.ventcrawl_machinery) && isliving(user))
|
||||
var/mob/living/L = user
|
||||
if(L.ventcrawler)
|
||||
. += "<span class='notice'>Alt-click to crawl through it.</span>"
|
||||
|
||||
/obj/machinery/atmospherics/New(loc, process = TRUE, setdir)
|
||||
if(!isnull(setdir))
|
||||
setDir(setdir)
|
||||
if(pipe_flags & PIPING_CARDINAL_AUTONORMALIZE)
|
||||
normalize_cardinal_directions()
|
||||
nodes = new(device_type)
|
||||
if (!armor)
|
||||
armor = list("melee" = 25, "bullet" = 10, "laser" = 10, "energy" = 100, "bomb" = 0, "bio" = 100, "rad" = 100, "fire" = 100, "acid" = 70)
|
||||
..()
|
||||
if(process)
|
||||
SSair.atmos_machinery += src
|
||||
SetInitDirections()
|
||||
|
||||
/obj/machinery/atmospherics/Destroy()
|
||||
for(var/i in 1 to device_type)
|
||||
nullifyNode(i)
|
||||
|
||||
SSair.atmos_machinery -= src
|
||||
|
||||
dropContents()
|
||||
if(pipe_vision_img)
|
||||
qdel(pipe_vision_img)
|
||||
|
||||
return ..()
|
||||
//return QDEL_HINT_FINDREFERENCE
|
||||
|
||||
/obj/machinery/atmospherics/proc/destroy_network()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/proc/build_network()
|
||||
// Called to build a network from this node
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/proc/nullifyNode(i)
|
||||
if(nodes[i])
|
||||
var/obj/machinery/atmospherics/N = nodes[i]
|
||||
N.disconnect(src)
|
||||
nodes[i] = null
|
||||
|
||||
/obj/machinery/atmospherics/proc/getNodeConnects()
|
||||
var/list/node_connects = list()
|
||||
node_connects.len = device_type
|
||||
|
||||
for(var/i in 1 to device_type)
|
||||
for(var/D in GLOB.cardinals)
|
||||
if(D & GetInitDirections())
|
||||
if(D in node_connects)
|
||||
continue
|
||||
node_connects[i] = D
|
||||
break
|
||||
return node_connects
|
||||
|
||||
/obj/machinery/atmospherics/proc/normalize_cardinal_directions()
|
||||
switch(dir)
|
||||
if(SOUTH)
|
||||
setDir(NORTH)
|
||||
if(WEST)
|
||||
setDir(EAST)
|
||||
|
||||
//this is called just after the air controller sets up turfs
|
||||
/obj/machinery/atmospherics/proc/atmosinit(list/node_connects)
|
||||
if(!node_connects) //for pipes where order of nodes doesn't matter
|
||||
node_connects = getNodeConnects()
|
||||
|
||||
for(var/i in 1 to device_type)
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node_connects[i]))
|
||||
if(can_be_node(target, i))
|
||||
nodes[i] = target
|
||||
break
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/proc/setPipingLayer(new_layer)
|
||||
piping_layer = (pipe_flags & PIPING_DEFAULT_LAYER_ONLY) ? PIPING_LAYER_DEFAULT : new_layer
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/proc/can_be_node(obj/machinery/atmospherics/target, iteration)
|
||||
return connection_check(target, piping_layer)
|
||||
|
||||
//Find a connecting /obj/machinery/atmospherics in specified direction
|
||||
/obj/machinery/atmospherics/proc/findConnecting(direction, prompted_layer)
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src, direction))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
if(connection_check(target, prompted_layer))
|
||||
return target
|
||||
|
||||
/obj/machinery/atmospherics/proc/connection_check(obj/machinery/atmospherics/target, given_layer)
|
||||
if(isConnectable(target, given_layer) && target.isConnectable(src, given_layer) && (target.initialize_directions & get_dir(target,src)))
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/atmospherics/proc/isConnectable(obj/machinery/atmospherics/target, given_layer)
|
||||
if(isnull(given_layer))
|
||||
given_layer = piping_layer
|
||||
if((target.piping_layer == given_layer) || (target.pipe_flags & PIPING_ALL_LAYER))
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/atmospherics/proc/pipeline_expansion()
|
||||
return nodes
|
||||
|
||||
/obj/machinery/atmospherics/proc/SetInitDirections()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/proc/GetInitDirections()
|
||||
return initialize_directions
|
||||
|
||||
/obj/machinery/atmospherics/proc/returnPipenet()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/proc/returnPipenetAir()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/proc/setPipenet()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/proc/replacePipenet()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/proc/disconnect(obj/machinery/atmospherics/reference)
|
||||
if(istype(reference, /obj/machinery/atmospherics/pipe))
|
||||
var/obj/machinery/atmospherics/pipe/P = reference
|
||||
P.destroy_network()
|
||||
nodes[nodes.Find(reference)] = null
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/pipe)) //lets you autodrop
|
||||
var/obj/item/pipe/pipe = W
|
||||
if(user.dropItemToGround(pipe))
|
||||
pipe.setPipingLayer(piping_layer) //align it with us
|
||||
return TRUE
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/wrench_act(mob/living/user, obj/item/I)
|
||||
if(!can_unwrench(user))
|
||||
return ..()
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
if (level==1 && isturf(T) && T.intact)
|
||||
to_chat(user, "<span class='warning'>You must remove the plating first!</span>")
|
||||
return TRUE
|
||||
|
||||
var/datum/gas_mixture/int_air = return_air()
|
||||
var/datum/gas_mixture/env_air = loc.return_air()
|
||||
add_fingerprint(user)
|
||||
|
||||
var/unsafe_wrenching = FALSE
|
||||
var/internal_pressure = int_air.return_pressure()-env_air.return_pressure()
|
||||
|
||||
to_chat(user, "<span class='notice'>You begin to unfasten \the [src]...</span>")
|
||||
|
||||
if (internal_pressure > 2*ONE_ATMOSPHERE)
|
||||
to_chat(user, "<span class='warning'>As you begin unwrenching \the [src] a gush of air blows in your face... maybe you should reconsider?</span>")
|
||||
unsafe_wrenching = TRUE //Oh dear oh dear
|
||||
|
||||
if(I.use_tool(src, user, 20, volume=50))
|
||||
user.visible_message( \
|
||||
"[user] unfastens \the [src].", \
|
||||
"<span class='notice'>You unfasten \the [src].</span>", \
|
||||
"<span class='italics'>You hear ratchet.</span>")
|
||||
investigate_log("was <span class='warning'>REMOVED</span> by [key_name(usr)]", INVESTIGATE_ATMOS)
|
||||
|
||||
//You unwrenched a pipe full of pressure? Let's splat you into the wall, silly.
|
||||
if(unsafe_wrenching)
|
||||
unsafe_pressure_release(user, internal_pressure)
|
||||
deconstruct(TRUE)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/atmospherics/proc/can_unwrench(mob/user)
|
||||
return can_unwrench
|
||||
|
||||
// Throws the user when they unwrench a pipe with a major difference between the internal and environmental pressure.
|
||||
/obj/machinery/atmospherics/proc/unsafe_pressure_release(mob/user, pressures = null)
|
||||
if(!user)
|
||||
return
|
||||
if(!pressures)
|
||||
var/datum/gas_mixture/int_air = return_air()
|
||||
var/datum/gas_mixture/env_air = loc.return_air()
|
||||
pressures = int_air.return_pressure() - env_air.return_pressure()
|
||||
|
||||
user.visible_message("<span class='danger'>[user] is sent flying by pressure!</span>","<span class='userdanger'>The pressure sends you flying!</span>")
|
||||
|
||||
// if get_dir(src, user) is not 0, target is the edge_target_turf on that dir
|
||||
// otherwise, edge_target_turf uses a random cardinal direction
|
||||
// range is pressures / 250
|
||||
// speed is pressures / 1250
|
||||
user.throw_at(get_edge_target_turf(user, get_dir(src, user) || pick(GLOB.cardinals)), pressures / 250, pressures / 1250)
|
||||
|
||||
/obj/machinery/atmospherics/deconstruct(disassembled = TRUE)
|
||||
if(!(flags_1 & NODECONSTRUCT_1))
|
||||
if(can_unwrench)
|
||||
var/obj/item/pipe/stored = new construction_type(loc, null, dir, src)
|
||||
stored.setPipingLayer(piping_layer)
|
||||
if(!disassembled)
|
||||
stored.obj_integrity = stored.max_integrity * 0.5
|
||||
transfer_fingerprints_to(stored)
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/proc/getpipeimage(iconset, iconstate, direction, col=rgb(255,255,255), piping_layer=2)
|
||||
|
||||
//Add identifiers for the iconset
|
||||
if(iconsetids[iconset] == null)
|
||||
iconsetids[iconset] = num2text(iconsetids.len + 1)
|
||||
|
||||
//Generate a unique identifier for this image combination
|
||||
var/identifier = iconsetids[iconset] + "_[iconstate]_[direction]_[col]_[piping_layer]"
|
||||
|
||||
if((!(. = pipeimages[identifier])))
|
||||
var/image/pipe_overlay
|
||||
pipe_overlay = . = pipeimages[identifier] = image(iconset, iconstate, dir = direction)
|
||||
pipe_overlay.color = col
|
||||
PIPING_LAYER_SHIFT(pipe_overlay, piping_layer)
|
||||
|
||||
/obj/machinery/atmospherics/on_construction(obj_color, set_layer)
|
||||
if(can_unwrench)
|
||||
add_atom_colour(obj_color, FIXED_COLOUR_PRIORITY)
|
||||
pipe_color = obj_color
|
||||
setPipingLayer(set_layer)
|
||||
var/turf/T = get_turf(src)
|
||||
level = T.intact ? 2 : 1
|
||||
atmosinit()
|
||||
var/list/nodes = pipeline_expansion()
|
||||
for(var/obj/machinery/atmospherics/A in nodes)
|
||||
A.atmosinit()
|
||||
A.addMember(src)
|
||||
build_network()
|
||||
|
||||
/obj/machinery/atmospherics/Entered(atom/movable/AM)
|
||||
if(istype(AM, /mob/living))
|
||||
var/mob/living/L = AM
|
||||
L.ventcrawl_layer = piping_layer
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/singularity_pull(S, current_size)
|
||||
if(current_size >= STAGE_FIVE)
|
||||
deconstruct(FALSE)
|
||||
return ..()
|
||||
|
||||
#define VENT_SOUND_DELAY 30
|
||||
|
||||
/obj/machinery/atmospherics/relaymove(mob/living/user, direction)
|
||||
direction &= initialize_directions
|
||||
if(!direction || !(direction in GLOB.cardinals)) //cant go this way.
|
||||
return
|
||||
|
||||
if(user in buckled_mobs)// fixes buckle ventcrawl edgecase fuck bug
|
||||
return
|
||||
|
||||
var/obj/machinery/atmospherics/target_move = findConnecting(direction, user.ventcrawl_layer)
|
||||
if(target_move)
|
||||
if(target_move.can_crawl_through())
|
||||
if(is_type_in_typecache(target_move, GLOB.ventcrawl_machinery))
|
||||
user.forceMove(target_move.loc) //handle entering and so on.
|
||||
user.visible_message("<span class='notice'>You hear something squeezing through the ducts...</span>", "<span class='notice'>You climb out the ventilation system.")
|
||||
else
|
||||
var/list/pipenetdiff = returnPipenets() ^ target_move.returnPipenets()
|
||||
if(pipenetdiff.len)
|
||||
user.update_pipe_vision(target_move)
|
||||
user.forceMove(target_move)
|
||||
user.client.eye = target_move //Byond only updates the eye every tick, This smooths out the movement
|
||||
if(world.time - user.last_played_vent > VENT_SOUND_DELAY)
|
||||
user.last_played_vent = world.time
|
||||
playsound(src, 'sound/machines/ventcrawl.ogg', 50, 1, -3)
|
||||
else if(is_type_in_typecache(src, GLOB.ventcrawl_machinery) && can_crawl_through()) //if we move in a way the pipe can connect, but doesn't - or we're in a vent
|
||||
user.forceMove(loc)
|
||||
user.visible_message("<span class='notice'>You hear something squeezing through the ducts...</span>", "<span class='notice'>You climb out the ventilation system.")
|
||||
|
||||
user.canmove = FALSE
|
||||
addtimer(VARSET_CALLBACK(user, canmove, TRUE), 1)
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/AltClick(mob/living/L)
|
||||
if(is_type_in_typecache(src, GLOB.ventcrawl_machinery))
|
||||
return L.handle_ventcrawl(src)
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/proc/can_crawl_through()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/atmospherics/proc/returnPipenets()
|
||||
return list()
|
||||
|
||||
/obj/machinery/atmospherics/update_remote_sight(mob/user)
|
||||
user.sight |= (SEE_TURFS|BLIND)
|
||||
|
||||
//Used for certain children of obj/machinery/atmospherics to not show pipe vision when mob is inside it.
|
||||
/obj/machinery/atmospherics/proc/can_see_pipes()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/atmospherics/proc/update_layer()
|
||||
layer = initial(layer) + (piping_layer - PIPING_LAYER_DEFAULT) * PIPING_LAYER_LCHANGE
|
||||
@@ -43,6 +43,7 @@
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/components/binary/pump/AltClick(mob/user)
|
||||
. = ..()
|
||||
var/area/A = get_area(src)
|
||||
var/turf/T = get_turf(src)
|
||||
if(user.canUseTopic(src, BE_CLOSE, FALSE,))
|
||||
@@ -50,6 +51,7 @@
|
||||
to_chat(user,"<span class='notice'>You maximize the pressure on the [src].</span>")
|
||||
investigate_log("Pump, [src.name], was maximized by [key_name(usr)] at [x], [y], [z], [A]", INVESTIGATE_ATMOS)
|
||||
message_admins("Pump, [src.name], was maximized by [ADMIN_LOOKUPFLW(usr)] at [ADMIN_COORDJMP(T)], [A]")
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/atmospherics/components/binary/pump/Destroy()
|
||||
SSradio.remove_object(src,frequency)
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/components/trinary/mixer/AltClick(mob/user)
|
||||
. = ..()
|
||||
var/area/A = get_area(src)
|
||||
var/turf/T = get_turf(src)
|
||||
if(user.canUseTopic(src, BE_CLOSE, FALSE,))
|
||||
@@ -38,6 +39,7 @@
|
||||
to_chat(user,"<span class='notice'>You maximize the pressure on the [src].</span>")
|
||||
investigate_log("Mixer, [src.name], was maximized by [key_name(usr)] at [x], [y], [z], [A]", INVESTIGATE_ATMOS)
|
||||
message_admins("Mixer, [src.name], was maximized by [ADMIN_LOOKUPFLW(usr)] at [ADMIN_COORDJMP(T)], [A]")
|
||||
return TRUE
|
||||
|
||||
//node 3 is the outlet, nodes 1 & 2 are intakes
|
||||
|
||||
|
||||
@@ -1,430 +1,446 @@
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell
|
||||
name = "cryo cell"
|
||||
icon = 'icons/obj/cryogenics.dmi'
|
||||
icon_state = "pod-off"
|
||||
density = TRUE
|
||||
max_integrity = 350
|
||||
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 100, "bomb" = 0, "bio" = 100, "rad" = 100, "fire" = 30, "acid" = 30)
|
||||
layer = ABOVE_WINDOW_LAYER
|
||||
state_open = FALSE
|
||||
circuit = /obj/item/circuitboard/machine/cryo_tube
|
||||
pipe_flags = PIPING_ONE_PER_TURF | PIPING_DEFAULT_LAYER_ONLY
|
||||
occupant_typecache = list(/mob/living/carbon, /mob/living/simple_animal)
|
||||
|
||||
var/autoeject = FALSE
|
||||
var/volume = 100
|
||||
|
||||
var/efficiency = 1
|
||||
var/sleep_factor = 0.00125
|
||||
var/unconscious_factor = 0.001
|
||||
var/heat_capacity = 20000
|
||||
var/conduction_coefficient = 0.3
|
||||
|
||||
var/obj/item/reagent_containers/glass/beaker = null
|
||||
var/reagent_transfer = 0
|
||||
|
||||
var/obj/item/radio/radio
|
||||
var/radio_key = /obj/item/encryptionkey/headset_med
|
||||
var/radio_channel = RADIO_CHANNEL_MEDICAL
|
||||
|
||||
var/running_anim = FALSE
|
||||
|
||||
var/escape_in_progress = FALSE
|
||||
var/message_cooldown
|
||||
var/breakout_time = 300
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/Initialize()
|
||||
. = ..()
|
||||
initialize_directions = dir
|
||||
|
||||
radio = new(src)
|
||||
radio.keyslot = new radio_key
|
||||
radio.subspace_transmission = TRUE
|
||||
radio.canhear_range = 0
|
||||
radio.recalculateChannels()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/on_construction()
|
||||
..(dir, dir)
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/RefreshParts()
|
||||
var/C
|
||||
for(var/obj/item/stock_parts/matter_bin/M in component_parts)
|
||||
C += M.rating
|
||||
|
||||
efficiency = initial(efficiency) * C
|
||||
sleep_factor = initial(sleep_factor) * C
|
||||
unconscious_factor = initial(unconscious_factor) * C
|
||||
heat_capacity = initial(heat_capacity) / C
|
||||
conduction_coefficient = initial(conduction_coefficient) * C
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/Destroy()
|
||||
QDEL_NULL(radio)
|
||||
QDEL_NULL(beaker)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/contents_explosion(severity, target)
|
||||
..()
|
||||
if(beaker)
|
||||
beaker.ex_act(severity, target)
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/handle_atom_del(atom/A)
|
||||
..()
|
||||
if(A == beaker)
|
||||
beaker = null
|
||||
updateUsrDialog()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/on_deconstruction()
|
||||
if(beaker)
|
||||
beaker.forceMove(drop_location())
|
||||
beaker = null
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/update_icon()
|
||||
cut_overlays()
|
||||
|
||||
if(panel_open)
|
||||
add_overlay("pod-panel")
|
||||
|
||||
if(state_open)
|
||||
icon_state = "pod-open"
|
||||
return
|
||||
|
||||
if(occupant)
|
||||
var/image/occupant_overlay
|
||||
|
||||
if(ismonkey(occupant)) // Monkey
|
||||
occupant_overlay = image(CRYOMOBS, "monkey")
|
||||
else if(isalienadult(occupant))
|
||||
if(isalienroyal(occupant)) // Queen and prae
|
||||
occupant_overlay = image(CRYOMOBS, "alienq")
|
||||
else if(isalienhunter(occupant)) // Hunter
|
||||
occupant_overlay = image(CRYOMOBS, "alienh")
|
||||
else if(isaliensentinel(occupant)) // Sentinel
|
||||
occupant_overlay = image(CRYOMOBS, "aliens")
|
||||
else // Drone or other
|
||||
occupant_overlay = image(CRYOMOBS, "aliend")
|
||||
|
||||
else if(ishuman(occupant) || islarva(occupant) || (isanimal(occupant) && !ismegafauna(occupant))) // Mobs that are smaller than cryotube
|
||||
occupant_overlay = image(occupant.icon, occupant.icon_state)
|
||||
occupant_overlay.copy_overlays(occupant)
|
||||
|
||||
else
|
||||
occupant_overlay = image(CRYOMOBS, "generic")
|
||||
|
||||
occupant_overlay.dir = SOUTH
|
||||
occupant_overlay.pixel_y = 22
|
||||
|
||||
if(on && !running_anim && is_operational())
|
||||
icon_state = "pod-on"
|
||||
running_anim = TRUE
|
||||
run_anim(TRUE, occupant_overlay)
|
||||
else
|
||||
icon_state = "pod-off"
|
||||
add_overlay(occupant_overlay)
|
||||
add_overlay("cover-off")
|
||||
|
||||
else if(on && is_operational())
|
||||
icon_state = "pod-on"
|
||||
add_overlay("cover-on")
|
||||
else
|
||||
icon_state = "pod-off"
|
||||
add_overlay("cover-off")
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/proc/run_anim(anim_up, image/occupant_overlay)
|
||||
if(!on || !occupant || !is_operational())
|
||||
running_anim = FALSE
|
||||
return
|
||||
cut_overlays()
|
||||
if(occupant_overlay.pixel_y != 23) // Same effect as occupant_overlay.pixel_y == 22 || occupant_overlay.pixel_y == 24
|
||||
anim_up = occupant_overlay.pixel_y == 22 // Same effect as if(occupant_overlay.pixel_y == 22) anim_up = TRUE ; if(occupant_overlay.pixel_y == 24) anim_up = FALSE
|
||||
if(anim_up)
|
||||
occupant_overlay.pixel_y++
|
||||
else
|
||||
occupant_overlay.pixel_y--
|
||||
add_overlay(occupant_overlay)
|
||||
add_overlay("cover-on")
|
||||
addtimer(CALLBACK(src, .proc/run_anim, anim_up, occupant_overlay), 7, TIMER_UNIQUE)
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/process()
|
||||
..()
|
||||
|
||||
if(!on)
|
||||
return
|
||||
if(!is_operational())
|
||||
on = FALSE
|
||||
update_icon()
|
||||
return
|
||||
if(!occupant)
|
||||
return
|
||||
|
||||
var/mob/living/mob_occupant = occupant
|
||||
|
||||
if(mob_occupant.stat == DEAD) // We don't bother with dead people.
|
||||
return
|
||||
|
||||
if(mob_occupant.health >= mob_occupant.getMaxHealth()) // Don't bother with fully healed people.
|
||||
on = FALSE
|
||||
update_icon()
|
||||
playsound(src, 'sound/machines/cryo_warning.ogg', volume) // Bug the doctors.
|
||||
var/msg = "Patient fully restored."
|
||||
if(autoeject) // Eject if configured.
|
||||
msg += " Auto ejecting patient now."
|
||||
open_machine()
|
||||
radio.talk_into(src, msg, radio_channel)
|
||||
return
|
||||
|
||||
var/datum/gas_mixture/air1 = airs[1]
|
||||
|
||||
if(air1.gases.len)
|
||||
if(mob_occupant.bodytemperature < T0C) // Sleepytime. Why? More cryo magic.
|
||||
mob_occupant.Sleeping((mob_occupant.bodytemperature * sleep_factor) * 2000)
|
||||
mob_occupant.Unconscious((mob_occupant.bodytemperature * unconscious_factor) * 2000)
|
||||
if(beaker)
|
||||
if(reagent_transfer == 0) // Magically transfer reagents. Because cryo magic.
|
||||
beaker.reagents.trans_to(occupant, 1, efficiency * 0.25) // Transfer reagents.
|
||||
beaker.reagents.reaction(occupant, VAPOR)
|
||||
air1.gases[/datum/gas/oxygen] -= max(0,air1.gases[/datum/gas/oxygen] - 2 / efficiency) //Let's use gas for this
|
||||
GAS_GARBAGE_COLLECT(air1.gases)
|
||||
if(++reagent_transfer >= 10 * efficiency) // Throttle reagent transfer (higher efficiency will transfer the same amount but consume less from the beaker).
|
||||
reagent_transfer = 0
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/process_atmos()
|
||||
..()
|
||||
|
||||
if(!on)
|
||||
return
|
||||
|
||||
var/datum/gas_mixture/air1 = airs[1]
|
||||
|
||||
if(!nodes[1] || !airs[1] || !air1.gases.len || air1.gases[/datum/gas/oxygen] < 5) // Turn off if the machine won't work.
|
||||
on = FALSE
|
||||
update_icon()
|
||||
return
|
||||
|
||||
if(occupant)
|
||||
var/mob/living/mob_occupant = occupant
|
||||
var/cold_protection = 0
|
||||
var/temperature_delta = air1.temperature - mob_occupant.bodytemperature // The only semi-realistic thing here: share temperature between the cell and the occupant.
|
||||
|
||||
if(ishuman(occupant))
|
||||
var/mob/living/carbon/human/H = occupant
|
||||
cold_protection = H.get_thermal_protection(air1.temperature, TRUE)
|
||||
|
||||
if(abs(temperature_delta) > 1)
|
||||
var/air_heat_capacity = air1.heat_capacity()
|
||||
|
||||
var/heat = ((1 - cold_protection) * 0.1 + conduction_coefficient) * temperature_delta * (air_heat_capacity * heat_capacity / (air_heat_capacity + heat_capacity))
|
||||
|
||||
air1.temperature = max(air1.temperature - heat / air_heat_capacity, TCMB)
|
||||
mob_occupant.adjust_bodytemperature(heat / heat_capacity, TCMB)
|
||||
|
||||
air1.gases[/datum/gas/oxygen] = max(0,air1.gases[/datum/gas/oxygen] - 0.5 / efficiency) // Magically consume gas? Why not, we run on cryo magic.
|
||||
GAS_GARBAGE_COLLECT(air1.gases)
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/power_change()
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/relaymove(mob/user)
|
||||
if(message_cooldown <= world.time)
|
||||
message_cooldown = world.time + 50
|
||||
to_chat(user, "<span class='warning'>[src]'s door won't budge!</span>")
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/open_machine(drop = 0)
|
||||
if(!state_open && !panel_open)
|
||||
on = FALSE
|
||||
..()
|
||||
for(var/mob/M in contents) //only drop mobs
|
||||
M.forceMove(get_turf(src))
|
||||
if(isliving(M))
|
||||
var/mob/living/L = M
|
||||
L.update_canmove()
|
||||
occupant = null
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/close_machine(mob/living/carbon/user)
|
||||
if((isnull(user) || istype(user)) && state_open && !panel_open)
|
||||
..(user)
|
||||
return occupant
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/container_resist(mob/living/user)
|
||||
user.changeNext_move(CLICK_CD_BREAKOUT)
|
||||
user.last_special = world.time + CLICK_CD_BREAKOUT
|
||||
user.visible_message("<span class='notice'>You see [user] kicking against the glass of [src]!</span>", \
|
||||
"<span class='notice'>You struggle inside [src], kicking the release with your foot... (this will take about [DisplayTimeText(breakout_time)].)</span>", \
|
||||
"<span class='italics'>You hear a thump from [src].</span>")
|
||||
if(do_after(user, breakout_time, target = src))
|
||||
if(!user || user.stat != CONSCIOUS || user.loc != src )
|
||||
return
|
||||
user.visible_message("<span class='warning'>[user] successfully broke out of [src]!</span>", \
|
||||
"<span class='notice'>You successfully break out of [src]!</span>")
|
||||
open_machine()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/examine(mob/user)
|
||||
. = ..()
|
||||
if(occupant)
|
||||
if(on)
|
||||
. += "Someone's inside [src]!"
|
||||
else
|
||||
. += "You can barely make out a form floating in [src]."
|
||||
else
|
||||
. += "[src] seems empty."
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/MouseDrop_T(mob/target, mob/user)
|
||||
if(user.stat || user.lying || !Adjacent(user) || !user.Adjacent(target) || !iscarbon(target) || !user.IsAdvancedToolUser())
|
||||
return
|
||||
if (target.IsKnockdown() || target.IsStun() || target.IsSleeping() || target.IsUnconscious())
|
||||
close_machine(target)
|
||||
else
|
||||
user.visible_message("<b>[user]</b> starts shoving [target] inside [src].", "<span class='notice'>You start shoving [target] inside [src].</span>")
|
||||
if (do_after(user, 25, target=target))
|
||||
close_machine(target)
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/reagent_containers/glass))
|
||||
. = 1 //no afterattack
|
||||
if(beaker)
|
||||
to_chat(user, "<span class='warning'>A beaker is already loaded into [src]!</span>")
|
||||
return
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
beaker = I
|
||||
user.visible_message("[user] places [I] in [src].", \
|
||||
"<span class='notice'>You place [I] in [src].</span>")
|
||||
var/reagentlist = pretty_string_from_reagent_list(I.reagents.reagent_list)
|
||||
log_game("[key_name(user)] added an [I] to cryo containing [reagentlist]")
|
||||
return
|
||||
if(!on && !occupant && !state_open && (default_deconstruction_screwdriver(user, "pod-off", "pod-off", I)) \
|
||||
|| default_change_direction_wrench(user, I) \
|
||||
|| default_pry_open(I) \
|
||||
|| default_deconstruction_crowbar(I))
|
||||
update_icon()
|
||||
return
|
||||
else if(istype(I, /obj/item/screwdriver))
|
||||
to_chat(user, "<span class='notice'>You can't access the maintenance panel while the pod is " \
|
||||
+ (on ? "active" : (occupant ? "full" : "open")) + ".</span>")
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.notcontained_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "cryo", name, 400, 550, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/ui_data()
|
||||
var/list/data = list()
|
||||
data["isOperating"] = on
|
||||
data["hasOccupant"] = occupant ? TRUE : FALSE
|
||||
data["isOpen"] = state_open
|
||||
data["autoEject"] = autoeject
|
||||
|
||||
data["occupant"] = list()
|
||||
if(occupant)
|
||||
var/mob/living/mob_occupant = occupant
|
||||
data["occupant"]["name"] = mob_occupant.name
|
||||
switch(mob_occupant.stat)
|
||||
if(CONSCIOUS)
|
||||
data["occupant"]["stat"] = "Conscious"
|
||||
data["occupant"]["statstate"] = "good"
|
||||
if(SOFT_CRIT)
|
||||
data["occupant"]["stat"] = "Conscious"
|
||||
data["occupant"]["statstate"] = "average"
|
||||
if(UNCONSCIOUS)
|
||||
data["occupant"]["stat"] = "Unconscious"
|
||||
data["occupant"]["statstate"] = "average"
|
||||
if(DEAD)
|
||||
data["occupant"]["stat"] = "Dead"
|
||||
data["occupant"]["statstate"] = "bad"
|
||||
data["occupant"]["health"] = round(mob_occupant.health, 1)
|
||||
data["occupant"]["maxHealth"] = mob_occupant.maxHealth
|
||||
data["occupant"]["minHealth"] = HEALTH_THRESHOLD_DEAD
|
||||
data["occupant"]["bruteLoss"] = round(mob_occupant.getBruteLoss(), 1)
|
||||
data["occupant"]["oxyLoss"] = round(mob_occupant.getOxyLoss(), 1)
|
||||
data["occupant"]["toxLoss"] = round(mob_occupant.getToxLoss(), 1)
|
||||
data["occupant"]["fireLoss"] = round(mob_occupant.getFireLoss(), 1)
|
||||
data["occupant"]["bodyTemperature"] = round(mob_occupant.bodytemperature, 1)
|
||||
if(mob_occupant.bodytemperature < TCRYO)
|
||||
data["occupant"]["temperaturestatus"] = "good"
|
||||
else if(mob_occupant.bodytemperature < T0C)
|
||||
data["occupant"]["temperaturestatus"] = "average"
|
||||
else
|
||||
data["occupant"]["temperaturestatus"] = "bad"
|
||||
|
||||
var/datum/gas_mixture/air1 = airs[1]
|
||||
data["cellTemperature"] = round(air1.temperature, 1)
|
||||
|
||||
data["isBeakerLoaded"] = beaker ? TRUE : FALSE
|
||||
var/beakerContents = list()
|
||||
if(beaker && beaker.reagents && beaker.reagents.reagent_list.len)
|
||||
for(var/datum/reagent/R in beaker.reagents.reagent_list)
|
||||
beakerContents += list(list("name" = R.name, "volume" = R.volume))
|
||||
data["beakerContents"] = beakerContents
|
||||
return data
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("power")
|
||||
if(on)
|
||||
on = FALSE
|
||||
else if(!state_open)
|
||||
on = TRUE
|
||||
. = TRUE
|
||||
if("door")
|
||||
if(state_open)
|
||||
close_machine()
|
||||
else
|
||||
open_machine()
|
||||
. = TRUE
|
||||
if("autoeject")
|
||||
autoeject = !autoeject
|
||||
. = TRUE
|
||||
if("ejectbeaker")
|
||||
if(beaker)
|
||||
beaker.forceMove(drop_location())
|
||||
if(Adjacent(usr) && !issilicon(usr))
|
||||
usr.put_in_hands(beaker)
|
||||
beaker = null
|
||||
. = TRUE
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/update_remote_sight(mob/living/user)
|
||||
return // we don't see the pipe network while inside cryo.
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/get_remote_view_fullscreens(mob/user)
|
||||
user.overlay_fullscreen("remote_view", /obj/screen/fullscreen/impaired, 1)
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/can_crawl_through()
|
||||
return // can't ventcrawl in or out of cryo.
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/can_see_pipes()
|
||||
return 0 // you can't see the pipe network when inside a cryo cell.
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/return_temperature()
|
||||
var/datum/gas_mixture/G = airs[1]
|
||||
|
||||
if(G.total_moles() > 10)
|
||||
return G.temperature
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/default_change_direction_wrench(mob/user, obj/item/wrench/W)
|
||||
. = ..()
|
||||
if(.)
|
||||
SetInitDirections()
|
||||
var/obj/machinery/atmospherics/node = nodes[1]
|
||||
if(node)
|
||||
node.disconnect(src)
|
||||
nodes[1] = null
|
||||
nullifyPipenet(parents[1])
|
||||
atmosinit()
|
||||
node = nodes[1]
|
||||
if(node)
|
||||
node.atmosinit()
|
||||
node.addMember(src)
|
||||
build_network()
|
||||
|
||||
#undef CRYOMOBS
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell
|
||||
name = "cryo cell"
|
||||
icon = 'icons/obj/cryogenics.dmi'
|
||||
icon_state = "pod-off"
|
||||
density = TRUE
|
||||
max_integrity = 350
|
||||
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 100, "bomb" = 0, "bio" = 100, "rad" = 100, "fire" = 30, "acid" = 30)
|
||||
layer = ABOVE_WINDOW_LAYER
|
||||
state_open = FALSE
|
||||
circuit = /obj/item/circuitboard/machine/cryo_tube
|
||||
pipe_flags = PIPING_ONE_PER_TURF | PIPING_DEFAULT_LAYER_ONLY
|
||||
occupant_typecache = list(/mob/living/carbon, /mob/living/simple_animal)
|
||||
|
||||
var/autoeject = FALSE
|
||||
var/volume = 100
|
||||
|
||||
var/efficiency = 1
|
||||
var/sleep_factor = 0.00125
|
||||
var/unconscious_factor = 0.001
|
||||
var/heat_capacity = 20000
|
||||
var/conduction_coefficient = 0.3
|
||||
|
||||
var/obj/item/reagent_containers/glass/beaker = null
|
||||
var/reagent_transfer = 0
|
||||
|
||||
var/obj/item/radio/radio
|
||||
var/radio_key = /obj/item/encryptionkey/headset_med
|
||||
var/radio_channel = RADIO_CHANNEL_MEDICAL
|
||||
|
||||
var/running_anim = FALSE
|
||||
|
||||
var/escape_in_progress = FALSE
|
||||
var/message_cooldown
|
||||
var/breakout_time = 300
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/Initialize()
|
||||
. = ..()
|
||||
initialize_directions = dir
|
||||
|
||||
radio = new(src)
|
||||
radio.keyslot = new radio_key
|
||||
radio.subspace_transmission = TRUE
|
||||
radio.canhear_range = 0
|
||||
radio.recalculateChannels()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/on_construction()
|
||||
..(dir, dir)
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/RefreshParts()
|
||||
var/C
|
||||
for(var/obj/item/stock_parts/matter_bin/M in component_parts)
|
||||
C += M.rating
|
||||
|
||||
efficiency = initial(efficiency) * C
|
||||
sleep_factor = initial(sleep_factor) * C
|
||||
unconscious_factor = initial(unconscious_factor) * C
|
||||
heat_capacity = initial(heat_capacity) / C
|
||||
conduction_coefficient = initial(conduction_coefficient) * C
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/Destroy()
|
||||
QDEL_NULL(radio)
|
||||
QDEL_NULL(beaker)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/contents_explosion(severity, target)
|
||||
..()
|
||||
if(beaker)
|
||||
beaker.ex_act(severity, target)
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/handle_atom_del(atom/A)
|
||||
..()
|
||||
if(A == beaker)
|
||||
beaker = null
|
||||
updateUsrDialog()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/on_deconstruction()
|
||||
if(beaker)
|
||||
beaker.forceMove(drop_location())
|
||||
beaker = null
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/update_icon()
|
||||
cut_overlays()
|
||||
|
||||
if(panel_open)
|
||||
add_overlay("pod-panel")
|
||||
|
||||
if(state_open)
|
||||
icon_state = "pod-open"
|
||||
return
|
||||
|
||||
if(occupant)
|
||||
var/image/occupant_overlay
|
||||
|
||||
if(ismonkey(occupant)) // Monkey
|
||||
occupant_overlay = image(CRYOMOBS, "monkey")
|
||||
else if(isalienadult(occupant))
|
||||
if(isalienroyal(occupant)) // Queen and prae
|
||||
occupant_overlay = image(CRYOMOBS, "alienq")
|
||||
else if(isalienhunter(occupant)) // Hunter
|
||||
occupant_overlay = image(CRYOMOBS, "alienh")
|
||||
else if(isaliensentinel(occupant)) // Sentinel
|
||||
occupant_overlay = image(CRYOMOBS, "aliens")
|
||||
else // Drone or other
|
||||
occupant_overlay = image(CRYOMOBS, "aliend")
|
||||
|
||||
else if(ishuman(occupant) || islarva(occupant) || (isanimal(occupant) && !ismegafauna(occupant))) // Mobs that are smaller than cryotube
|
||||
occupant_overlay = image(occupant.icon, occupant.icon_state)
|
||||
occupant_overlay.copy_overlays(occupant)
|
||||
|
||||
else
|
||||
occupant_overlay = image(CRYOMOBS, "generic")
|
||||
|
||||
occupant_overlay.dir = SOUTH
|
||||
occupant_overlay.pixel_y = 22
|
||||
|
||||
if(on && !running_anim && is_operational())
|
||||
icon_state = "pod-on"
|
||||
running_anim = TRUE
|
||||
run_anim(TRUE, occupant_overlay)
|
||||
else
|
||||
icon_state = "pod-off"
|
||||
add_overlay(occupant_overlay)
|
||||
add_overlay("cover-off")
|
||||
|
||||
else if(on && is_operational())
|
||||
icon_state = "pod-on"
|
||||
add_overlay("cover-on")
|
||||
else
|
||||
icon_state = "pod-off"
|
||||
add_overlay("cover-off")
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/proc/run_anim(anim_up, image/occupant_overlay)
|
||||
if(!on || !occupant || !is_operational())
|
||||
running_anim = FALSE
|
||||
return
|
||||
cut_overlays()
|
||||
if(occupant_overlay.pixel_y != 23) // Same effect as occupant_overlay.pixel_y == 22 || occupant_overlay.pixel_y == 24
|
||||
anim_up = occupant_overlay.pixel_y == 22 // Same effect as if(occupant_overlay.pixel_y == 22) anim_up = TRUE ; if(occupant_overlay.pixel_y == 24) anim_up = FALSE
|
||||
if(anim_up)
|
||||
occupant_overlay.pixel_y++
|
||||
else
|
||||
occupant_overlay.pixel_y--
|
||||
add_overlay(occupant_overlay)
|
||||
add_overlay("cover-on")
|
||||
addtimer(CALLBACK(src, .proc/run_anim, anim_up, occupant_overlay), 7, TIMER_UNIQUE)
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/process()
|
||||
..()
|
||||
|
||||
if(!on)
|
||||
return
|
||||
if(!is_operational())
|
||||
on = FALSE
|
||||
update_icon()
|
||||
return
|
||||
if(!occupant)
|
||||
return
|
||||
|
||||
var/mob/living/mob_occupant = occupant
|
||||
|
||||
if(mob_occupant.stat == DEAD) // We don't bother with dead people.
|
||||
return
|
||||
|
||||
if(mob_occupant.health >= mob_occupant.getMaxHealth()) // Don't bother with fully healed people.
|
||||
on = FALSE
|
||||
update_icon()
|
||||
playsound(src, 'sound/machines/cryo_warning.ogg', volume) // Bug the doctors.
|
||||
var/msg = "Patient fully restored."
|
||||
if(autoeject) // Eject if configured.
|
||||
msg += " Auto ejecting patient now."
|
||||
open_machine()
|
||||
radio.talk_into(src, msg, radio_channel)
|
||||
return
|
||||
|
||||
var/datum/gas_mixture/air1 = airs[1]
|
||||
|
||||
if(air1.gases.len)
|
||||
if(mob_occupant.bodytemperature < T0C) // Sleepytime. Why? More cryo magic.
|
||||
mob_occupant.Sleeping((mob_occupant.bodytemperature * sleep_factor) * 2000)
|
||||
mob_occupant.Unconscious((mob_occupant.bodytemperature * unconscious_factor) * 2000)
|
||||
if(beaker)
|
||||
if(reagent_transfer == 0) // Magically transfer reagents. Because cryo magic.
|
||||
beaker.reagents.trans_to(occupant, 1, efficiency * 0.25) // Transfer reagents.
|
||||
beaker.reagents.reaction(occupant, VAPOR)
|
||||
air1.gases[/datum/gas/oxygen] -= max(0,air1.gases[/datum/gas/oxygen] - 2 / efficiency) //Let's use gas for this
|
||||
GAS_GARBAGE_COLLECT(air1.gases)
|
||||
if(++reagent_transfer >= 10 * efficiency) // Throttle reagent transfer (higher efficiency will transfer the same amount but consume less from the beaker).
|
||||
reagent_transfer = 0
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/process_atmos()
|
||||
..()
|
||||
|
||||
if(!on)
|
||||
return
|
||||
|
||||
var/datum/gas_mixture/air1 = airs[1]
|
||||
|
||||
if(!nodes[1] || !airs[1] || !air1.gases.len || air1.gases[/datum/gas/oxygen] < 5) // Turn off if the machine won't work.
|
||||
on = FALSE
|
||||
update_icon()
|
||||
return
|
||||
|
||||
if(occupant)
|
||||
var/mob/living/mob_occupant = occupant
|
||||
var/cold_protection = 0
|
||||
var/temperature_delta = air1.temperature - mob_occupant.bodytemperature // The only semi-realistic thing here: share temperature between the cell and the occupant.
|
||||
|
||||
if(ishuman(occupant))
|
||||
var/mob/living/carbon/human/H = occupant
|
||||
cold_protection = H.get_thermal_protection(air1.temperature, TRUE)
|
||||
|
||||
if(abs(temperature_delta) > 1)
|
||||
var/air_heat_capacity = air1.heat_capacity()
|
||||
|
||||
var/heat = ((1 - cold_protection) * 0.1 + conduction_coefficient) * temperature_delta * (air_heat_capacity * heat_capacity / (air_heat_capacity + heat_capacity))
|
||||
|
||||
air1.temperature = max(air1.temperature - heat / air_heat_capacity, TCMB)
|
||||
mob_occupant.adjust_bodytemperature(heat / heat_capacity, TCMB)
|
||||
|
||||
air1.gases[/datum/gas/oxygen] = max(0,air1.gases[/datum/gas/oxygen] - 0.5 / efficiency) // Magically consume gas? Why not, we run on cryo magic.
|
||||
GAS_GARBAGE_COLLECT(air1.gases)
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/power_change()
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/relaymove(mob/user)
|
||||
if(message_cooldown <= world.time)
|
||||
message_cooldown = world.time + 50
|
||||
to_chat(user, "<span class='warning'>[src]'s door won't budge!</span>")
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/open_machine(drop = 0)
|
||||
if(!state_open && !panel_open)
|
||||
on = FALSE
|
||||
..()
|
||||
for(var/mob/M in contents) //only drop mobs
|
||||
M.forceMove(get_turf(src))
|
||||
if(isliving(M))
|
||||
var/mob/living/L = M
|
||||
L.update_canmove()
|
||||
occupant = null
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/close_machine(mob/living/carbon/user)
|
||||
if((isnull(user) || istype(user)) && state_open && !panel_open)
|
||||
..(user)
|
||||
return occupant
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/container_resist(mob/living/user)
|
||||
user.changeNext_move(CLICK_CD_BREAKOUT)
|
||||
user.last_special = world.time + CLICK_CD_BREAKOUT
|
||||
user.visible_message("<span class='notice'>You see [user] kicking against the glass of [src]!</span>", \
|
||||
"<span class='notice'>You struggle inside [src], kicking the release with your foot... (this will take about [DisplayTimeText(breakout_time)].)</span>", \
|
||||
"<span class='italics'>You hear a thump from [src].</span>")
|
||||
if(do_after(user, breakout_time, target = src))
|
||||
if(!user || user.stat != CONSCIOUS || user.loc != src )
|
||||
return
|
||||
user.visible_message("<span class='warning'>[user] successfully broke out of [src]!</span>", \
|
||||
"<span class='notice'>You successfully break out of [src]!</span>")
|
||||
open_machine()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/examine(mob/user)
|
||||
. = ..()
|
||||
if(occupant)
|
||||
if(on)
|
||||
. += "Someone's inside [src]!"
|
||||
else
|
||||
. += "You can barely make out a form floating in [src]."
|
||||
else
|
||||
. += "[src] seems empty."
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/MouseDrop_T(mob/target, mob/user)
|
||||
if(user.stat || user.lying || !Adjacent(user) || !user.Adjacent(target) || !iscarbon(target) || !user.IsAdvancedToolUser())
|
||||
return
|
||||
if (target.IsKnockdown() || target.IsStun() || target.IsSleeping() || target.IsUnconscious())
|
||||
close_machine(target)
|
||||
else
|
||||
user.visible_message("<b>[user]</b> starts shoving [target] inside [src].", "<span class='notice'>You start shoving [target] inside [src].</span>")
|
||||
if (do_after(user, 25, target=target))
|
||||
close_machine(target)
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/reagent_containers/glass))
|
||||
. = 1 //no afterattack
|
||||
if(beaker)
|
||||
to_chat(user, "<span class='warning'>A beaker is already loaded into [src]!</span>")
|
||||
return
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
beaker = I
|
||||
user.visible_message("[user] places [I] in [src].", \
|
||||
"<span class='notice'>You place [I] in [src].</span>")
|
||||
var/reagentlist = pretty_string_from_reagent_list(I.reagents.reagent_list)
|
||||
log_game("[key_name(user)] added an [I] to cryo containing [reagentlist]")
|
||||
return
|
||||
if(!on && !occupant && !state_open && (default_deconstruction_screwdriver(user, "pod-off", "pod-off", I)) \
|
||||
|| default_change_direction_wrench(user, I) \
|
||||
|| default_pry_open(I) \
|
||||
|| default_deconstruction_crowbar(I))
|
||||
update_icon()
|
||||
return
|
||||
else if(istype(I, /obj/item/screwdriver))
|
||||
to_chat(user, "<span class='notice'>You can't access the maintenance panel while the pod is " \
|
||||
+ (on ? "active" : (occupant ? "full" : "open")) + ".</span>")
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.notcontained_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "cryo", name, 400, 550, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/ui_data()
|
||||
var/list/data = list()
|
||||
data["isOperating"] = on
|
||||
data["hasOccupant"] = occupant ? TRUE : FALSE
|
||||
data["isOpen"] = state_open
|
||||
data["autoEject"] = autoeject
|
||||
|
||||
data["occupant"] = list()
|
||||
if(occupant)
|
||||
var/mob/living/mob_occupant = occupant
|
||||
data["occupant"]["name"] = mob_occupant.name
|
||||
switch(mob_occupant.stat)
|
||||
if(CONSCIOUS)
|
||||
data["occupant"]["stat"] = "Conscious"
|
||||
data["occupant"]["statstate"] = "good"
|
||||
if(SOFT_CRIT)
|
||||
data["occupant"]["stat"] = "Conscious"
|
||||
data["occupant"]["statstate"] = "average"
|
||||
if(UNCONSCIOUS)
|
||||
data["occupant"]["stat"] = "Unconscious"
|
||||
data["occupant"]["statstate"] = "average"
|
||||
if(DEAD)
|
||||
data["occupant"]["stat"] = "Dead"
|
||||
data["occupant"]["statstate"] = "bad"
|
||||
data["occupant"]["health"] = round(mob_occupant.health, 1)
|
||||
data["occupant"]["maxHealth"] = mob_occupant.maxHealth
|
||||
data["occupant"]["minHealth"] = HEALTH_THRESHOLD_DEAD
|
||||
data["occupant"]["bruteLoss"] = round(mob_occupant.getBruteLoss(), 1)
|
||||
data["occupant"]["oxyLoss"] = round(mob_occupant.getOxyLoss(), 1)
|
||||
data["occupant"]["toxLoss"] = round(mob_occupant.getToxLoss(), 1)
|
||||
data["occupant"]["fireLoss"] = round(mob_occupant.getFireLoss(), 1)
|
||||
data["occupant"]["bodyTemperature"] = round(mob_occupant.bodytemperature, 1)
|
||||
if(mob_occupant.bodytemperature < TCRYO)
|
||||
data["occupant"]["temperaturestatus"] = "good"
|
||||
else if(mob_occupant.bodytemperature < T0C)
|
||||
data["occupant"]["temperaturestatus"] = "average"
|
||||
else
|
||||
data["occupant"]["temperaturestatus"] = "bad"
|
||||
|
||||
var/datum/gas_mixture/air1 = airs[1]
|
||||
data["cellTemperature"] = round(air1.temperature, 1)
|
||||
|
||||
data["isBeakerLoaded"] = beaker ? TRUE : FALSE
|
||||
var/beakerContents = list()
|
||||
if(beaker && beaker.reagents && beaker.reagents.reagent_list.len)
|
||||
for(var/datum/reagent/R in beaker.reagents.reagent_list)
|
||||
beakerContents += list(list("name" = R.name, "volume" = R.volume))
|
||||
data["beakerContents"] = beakerContents
|
||||
return data
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("power")
|
||||
if(on)
|
||||
on = FALSE
|
||||
else if(!state_open)
|
||||
on = TRUE
|
||||
. = TRUE
|
||||
if("door")
|
||||
if(state_open)
|
||||
close_machine()
|
||||
else
|
||||
open_machine()
|
||||
. = TRUE
|
||||
if("autoeject")
|
||||
autoeject = !autoeject
|
||||
. = TRUE
|
||||
if("ejectbeaker")
|
||||
if(beaker)
|
||||
beaker.forceMove(drop_location())
|
||||
if(Adjacent(usr) && !issilicon(usr))
|
||||
usr.put_in_hands(beaker)
|
||||
beaker = null
|
||||
. = TRUE
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/CtrlClick(mob/user)
|
||||
if(user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK) && !state_open)
|
||||
on = !on
|
||||
update_icon()
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
|
||||
if(state_open)
|
||||
close_machine()
|
||||
else
|
||||
open_machine()
|
||||
update_icon()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/update_remote_sight(mob/living/user)
|
||||
return // we don't see the pipe network while inside cryo.
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/get_remote_view_fullscreens(mob/user)
|
||||
user.overlay_fullscreen("remote_view", /obj/screen/fullscreen/impaired, 1)
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/can_crawl_through()
|
||||
return // can't ventcrawl in or out of cryo.
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/can_see_pipes()
|
||||
return 0 // you can't see the pipe network when inside a cryo cell.
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/return_temperature()
|
||||
var/datum/gas_mixture/G = airs[1]
|
||||
|
||||
if(G.total_moles() > 10)
|
||||
return G.temperature
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/default_change_direction_wrench(mob/user, obj/item/wrench/W)
|
||||
. = ..()
|
||||
if(.)
|
||||
SetInitDirections()
|
||||
var/obj/machinery/atmospherics/node = nodes[1]
|
||||
if(node)
|
||||
node.disconnect(src)
|
||||
nodes[1] = null
|
||||
nullifyPipenet(parents[1])
|
||||
atmosinit()
|
||||
node = nodes[1]
|
||||
if(node)
|
||||
node.atmosinit()
|
||||
node.addMember(src)
|
||||
build_network()
|
||||
|
||||
#undef CRYOMOBS
|
||||
|
||||
@@ -217,13 +217,15 @@
|
||||
min_temperature = max(T0C - (initial(min_temperature) + L * 15), TCMB) //73.15K with T1 stock parts
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/thermomachine/freezer/AltClick(mob/living/user)
|
||||
. = ..()
|
||||
var/area/A = get_area(src)
|
||||
var/turf/T = get_turf(src)
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
target_temperature = min_temperature
|
||||
target_temperature = min_temperature
|
||||
investigate_log("was set to [target_temperature] K by [key_name(usr)]", INVESTIGATE_ATMOS)
|
||||
message_admins("[src.name] was minimized by [ADMIN_LOOKUPFLW(usr)] at [ADMIN_COORDJMP(T)], [A]")
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/thermomachine/heater
|
||||
name = "heater"
|
||||
@@ -247,6 +249,7 @@
|
||||
max_temperature = T20C + (initial(max_temperature) * L) //573.15K with T1 stock parts
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/thermomachine/heater/AltClick(mob/living/user)
|
||||
. = ..()
|
||||
var/area/A = get_area(src)
|
||||
var/turf/T = get_turf(src)
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE))
|
||||
@@ -254,3 +257,4 @@
|
||||
target_temperature = max_temperature
|
||||
investigate_log("was set to [target_temperature] K by [key_name(usr)]", INVESTIGATE_ATMOS)
|
||||
message_admins("[src.name] was maximized by [ADMIN_LOOKUPFLW(usr)] at [ADMIN_COORDJMP(T)], [A]")
|
||||
return TRUE
|
||||
|
||||
@@ -1,154 +1,156 @@
|
||||
/obj/machinery/portable_atmospherics
|
||||
name = "portable_atmospherics"
|
||||
icon = 'icons/obj/atmos.dmi'
|
||||
use_power = NO_POWER_USE
|
||||
max_integrity = 250
|
||||
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 100, "bomb" = 0, "bio" = 100, "rad" = 100, "fire" = 60, "acid" = 30)
|
||||
anchored = FALSE
|
||||
|
||||
var/datum/gas_mixture/air_contents
|
||||
var/obj/machinery/atmospherics/components/unary/portables_connector/connected_port
|
||||
var/obj/item/tank/holding
|
||||
|
||||
var/volume = 0
|
||||
|
||||
var/maximum_pressure = 90 * ONE_ATMOSPHERE
|
||||
|
||||
/obj/machinery/portable_atmospherics/New()
|
||||
..()
|
||||
SSair.atmos_machinery += src
|
||||
|
||||
air_contents = new
|
||||
air_contents.volume = volume
|
||||
air_contents.temperature = T20C
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/portable_atmospherics/Destroy()
|
||||
SSair.atmos_machinery -= src
|
||||
|
||||
disconnect()
|
||||
qdel(air_contents)
|
||||
air_contents = null
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/machinery/portable_atmospherics/process_atmos()
|
||||
if(!connected_port) // Pipe network handles reactions if connected.
|
||||
air_contents.react(src)
|
||||
else
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/portable_atmospherics/return_air()
|
||||
return air_contents
|
||||
|
||||
/obj/machinery/portable_atmospherics/proc/connect(obj/machinery/atmospherics/components/unary/portables_connector/new_port)
|
||||
//Make sure not already connected to something else
|
||||
if(connected_port || !new_port || new_port.connected_device)
|
||||
return FALSE
|
||||
|
||||
//Make sure are close enough for a valid connection
|
||||
if(new_port.loc != get_turf(src))
|
||||
return FALSE
|
||||
|
||||
//Perform the connection
|
||||
connected_port = new_port
|
||||
connected_port.connected_device = src
|
||||
var/datum/pipeline/connected_port_parent = connected_port.parents[1]
|
||||
connected_port_parent.reconcile_air()
|
||||
|
||||
anchored = TRUE //Prevent movement
|
||||
pixel_x = new_port.pixel_x
|
||||
pixel_y = new_port.pixel_y
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/portable_atmospherics/Move()
|
||||
. = ..()
|
||||
if(.)
|
||||
disconnect()
|
||||
|
||||
/obj/machinery/portable_atmospherics/proc/disconnect()
|
||||
if(!connected_port)
|
||||
return FALSE
|
||||
anchored = FALSE
|
||||
connected_port.connected_device = null
|
||||
connected_port = null
|
||||
pixel_x = 0
|
||||
pixel_y = 0
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/portable_atmospherics/portableConnectorReturnAir()
|
||||
return air_contents
|
||||
|
||||
/obj/machinery/portable_atmospherics/AltClick(mob/living/user)
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, !ismonkey(user)))
|
||||
return
|
||||
if(holding)
|
||||
to_chat(user, "<span class='notice'>You remove [holding] from [src].</span>")
|
||||
replace_tank(user, TRUE)
|
||||
|
||||
/obj/machinery/portable_atmospherics/examine(mob/user)
|
||||
. = ..()
|
||||
if(holding)
|
||||
. += "<span class='notice'>\The [src] contains [holding]. Alt-click [src] to remove it.</span>"
|
||||
. += "<span class='notice'>Click [src] with another gas tank to hot swap [holding].</span>"
|
||||
|
||||
/obj/machinery/portable_atmospherics/proc/replace_tank(mob/living/user, close_valve, obj/item/tank/new_tank)
|
||||
if(holding)
|
||||
holding.forceMove(drop_location())
|
||||
if(Adjacent(user) && !issilicon(user))
|
||||
user.put_in_hands(holding)
|
||||
if(new_tank)
|
||||
holding = new_tank
|
||||
else
|
||||
holding = null
|
||||
update_icon()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/portable_atmospherics/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/tank))
|
||||
if(!(stat & BROKEN))
|
||||
var/obj/item/tank/T = W
|
||||
if(!user.transferItemToLoc(T, src))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>[holding ? "In one smooth motion you pop [holding] out of [src]'s connector and replace it with [T]" : "You insert [T] into [src]"].</span>")
|
||||
replace_tank(user, FALSE, T)
|
||||
update_icon()
|
||||
else if(istype(W, /obj/item/wrench))
|
||||
if(!(stat & BROKEN))
|
||||
if(connected_port)
|
||||
disconnect()
|
||||
W.play_tool_sound(src)
|
||||
user.visible_message( \
|
||||
"[user] disconnects [src].", \
|
||||
"<span class='notice'>You unfasten [src] from the port.</span>", \
|
||||
"<span class='italics'>You hear a ratchet.</span>")
|
||||
update_icon()
|
||||
return
|
||||
else
|
||||
var/obj/machinery/atmospherics/components/unary/portables_connector/possible_port = locate(/obj/machinery/atmospherics/components/unary/portables_connector) in loc
|
||||
if(!possible_port)
|
||||
to_chat(user, "<span class='notice'>Nothing happens.</span>")
|
||||
return
|
||||
if(!connect(possible_port))
|
||||
to_chat(user, "<span class='notice'>[name] failed to connect to the port.</span>")
|
||||
return
|
||||
W.play_tool_sound(src)
|
||||
user.visible_message( \
|
||||
"[user] connects [src].", \
|
||||
"<span class='notice'>You fasten [src] to the port.</span>", \
|
||||
"<span class='italics'>You hear a ratchet.</span>")
|
||||
update_icon()
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/machinery/portable_atmospherics/analyzer_act(mob/living/user, obj/item/I)
|
||||
atmosanalyzer_scan(air_contents, user, src)
|
||||
|
||||
/obj/machinery/portable_atmospherics/attacked_by(obj/item/I, mob/user)
|
||||
if(I.force < 10 && !(stat & BROKEN))
|
||||
take_damage(0)
|
||||
else
|
||||
investigate_log("was smacked with \a [I] by [key_name(user)].", INVESTIGATE_ATMOS)
|
||||
add_fingerprint(user)
|
||||
..()
|
||||
/obj/machinery/portable_atmospherics
|
||||
name = "portable_atmospherics"
|
||||
icon = 'icons/obj/atmos.dmi'
|
||||
use_power = NO_POWER_USE
|
||||
max_integrity = 250
|
||||
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 100, "bomb" = 0, "bio" = 100, "rad" = 100, "fire" = 60, "acid" = 30)
|
||||
anchored = FALSE
|
||||
|
||||
var/datum/gas_mixture/air_contents
|
||||
var/obj/machinery/atmospherics/components/unary/portables_connector/connected_port
|
||||
var/obj/item/tank/holding
|
||||
|
||||
var/volume = 0
|
||||
|
||||
var/maximum_pressure = 90 * ONE_ATMOSPHERE
|
||||
|
||||
/obj/machinery/portable_atmospherics/New()
|
||||
..()
|
||||
SSair.atmos_machinery += src
|
||||
|
||||
air_contents = new
|
||||
air_contents.volume = volume
|
||||
air_contents.temperature = T20C
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/portable_atmospherics/Destroy()
|
||||
SSair.atmos_machinery -= src
|
||||
|
||||
disconnect()
|
||||
qdel(air_contents)
|
||||
air_contents = null
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/machinery/portable_atmospherics/process_atmos()
|
||||
if(!connected_port) // Pipe network handles reactions if connected.
|
||||
air_contents.react(src)
|
||||
else
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/portable_atmospherics/return_air()
|
||||
return air_contents
|
||||
|
||||
/obj/machinery/portable_atmospherics/proc/connect(obj/machinery/atmospherics/components/unary/portables_connector/new_port)
|
||||
//Make sure not already connected to something else
|
||||
if(connected_port || !new_port || new_port.connected_device)
|
||||
return FALSE
|
||||
|
||||
//Make sure are close enough for a valid connection
|
||||
if(new_port.loc != get_turf(src))
|
||||
return FALSE
|
||||
|
||||
//Perform the connection
|
||||
connected_port = new_port
|
||||
connected_port.connected_device = src
|
||||
var/datum/pipeline/connected_port_parent = connected_port.parents[1]
|
||||
connected_port_parent.reconcile_air()
|
||||
|
||||
anchored = TRUE //Prevent movement
|
||||
pixel_x = new_port.pixel_x
|
||||
pixel_y = new_port.pixel_y
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/portable_atmospherics/Move()
|
||||
. = ..()
|
||||
if(.)
|
||||
disconnect()
|
||||
|
||||
/obj/machinery/portable_atmospherics/proc/disconnect()
|
||||
if(!connected_port)
|
||||
return FALSE
|
||||
anchored = FALSE
|
||||
connected_port.connected_device = null
|
||||
connected_port = null
|
||||
pixel_x = 0
|
||||
pixel_y = 0
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/portable_atmospherics/portableConnectorReturnAir()
|
||||
return air_contents
|
||||
|
||||
/obj/machinery/portable_atmospherics/AltClick(mob/living/user)
|
||||
. = ..()
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, !ismonkey(user)))
|
||||
return
|
||||
if(holding)
|
||||
to_chat(user, "<span class='notice'>You remove [holding] from [src].</span>")
|
||||
replace_tank(user, TRUE)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/portable_atmospherics/examine(mob/user)
|
||||
. = ..()
|
||||
if(holding)
|
||||
. += "<span class='notice'>\The [src] contains [holding]. Alt-click [src] to remove it.</span>"
|
||||
. += "<span class='notice'>Click [src] with another gas tank to hot swap [holding].</span>"
|
||||
|
||||
/obj/machinery/portable_atmospherics/proc/replace_tank(mob/living/user, close_valve, obj/item/tank/new_tank)
|
||||
if(holding)
|
||||
holding.forceMove(drop_location())
|
||||
if(Adjacent(user) && !issilicon(user))
|
||||
user.put_in_hands(holding)
|
||||
if(new_tank)
|
||||
holding = new_tank
|
||||
else
|
||||
holding = null
|
||||
update_icon()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/portable_atmospherics/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/tank))
|
||||
if(!(stat & BROKEN))
|
||||
var/obj/item/tank/T = W
|
||||
if(!user.transferItemToLoc(T, src))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>[holding ? "In one smooth motion you pop [holding] out of [src]'s connector and replace it with [T]" : "You insert [T] into [src]"].</span>")
|
||||
replace_tank(user, FALSE, T)
|
||||
update_icon()
|
||||
else if(istype(W, /obj/item/wrench))
|
||||
if(!(stat & BROKEN))
|
||||
if(connected_port)
|
||||
disconnect()
|
||||
W.play_tool_sound(src)
|
||||
user.visible_message( \
|
||||
"[user] disconnects [src].", \
|
||||
"<span class='notice'>You unfasten [src] from the port.</span>", \
|
||||
"<span class='italics'>You hear a ratchet.</span>")
|
||||
update_icon()
|
||||
return
|
||||
else
|
||||
var/obj/machinery/atmospherics/components/unary/portables_connector/possible_port = locate(/obj/machinery/atmospherics/components/unary/portables_connector) in loc
|
||||
if(!possible_port)
|
||||
to_chat(user, "<span class='notice'>Nothing happens.</span>")
|
||||
return
|
||||
if(!connect(possible_port))
|
||||
to_chat(user, "<span class='notice'>[name] failed to connect to the port.</span>")
|
||||
return
|
||||
W.play_tool_sound(src)
|
||||
user.visible_message( \
|
||||
"[user] connects [src].", \
|
||||
"<span class='notice'>You fasten [src] to the port.</span>", \
|
||||
"<span class='italics'>You hear a ratchet.</span>")
|
||||
update_icon()
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/machinery/portable_atmospherics/analyzer_act(mob/living/user, obj/item/I)
|
||||
atmosanalyzer_scan(air_contents, user, src)
|
||||
|
||||
/obj/machinery/portable_atmospherics/attacked_by(obj/item/I, mob/user)
|
||||
if(I.force < 10 && !(stat & BROKEN))
|
||||
take_damage(0)
|
||||
else
|
||||
investigate_log("was smacked with \a [I] by [key_name(user)].", INVESTIGATE_ATMOS)
|
||||
add_fingerprint(user)
|
||||
..()
|
||||
|
||||
@@ -76,12 +76,14 @@
|
||||
to_chat(user, "<span class='notice'>[src] linked to [C].</span>")
|
||||
|
||||
/obj/item/supplypod_beacon/AltClick(mob/user)
|
||||
. = ..()
|
||||
if (!user.canUseTopic(src, !issilicon(user)))
|
||||
return
|
||||
if (express_console)
|
||||
unlink_console()
|
||||
else
|
||||
to_chat(user, "<span class='notice'>There is no linked console!</span>")
|
||||
return TRUE
|
||||
|
||||
/obj/item/supplypod_beacon/attackby(obj/item/W, mob/user)
|
||||
if(istype(W, /obj/item/pen)) //give a tag that is visible from the linked express console
|
||||
|
||||
@@ -269,16 +269,14 @@ BLIND // can't see anything
|
||||
H.update_suit_sensors()
|
||||
|
||||
/obj/item/clothing/under/AltClick(mob/user)
|
||||
if(..())
|
||||
return 1
|
||||
|
||||
. = ..()
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||
return
|
||||
if(attached_accessory)
|
||||
remove_accessory(user)
|
||||
else
|
||||
if(attached_accessory)
|
||||
remove_accessory(user)
|
||||
else
|
||||
rolldown()
|
||||
rolldown()
|
||||
return TRUE
|
||||
|
||||
/obj/item/clothing/under/verb/jumpsuit_adjust()
|
||||
set name = "Adjust Jumpsuit Style"
|
||||
|
||||
@@ -1,443 +1,441 @@
|
||||
//Glasses
|
||||
/obj/item/clothing/glasses
|
||||
name = "glasses"
|
||||
icon = 'icons/obj/clothing/glasses.dmi'
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
flags_cover = GLASSESCOVERSEYES
|
||||
slot_flags = ITEM_SLOT_EYES
|
||||
strip_delay = 20
|
||||
equip_delay_other = 25
|
||||
resistance_flags = NONE
|
||||
materials = list(MAT_GLASS = 250)
|
||||
var/vision_flags = 0
|
||||
var/darkness_view = 2//Base human is 2
|
||||
var/invis_view = SEE_INVISIBLE_LIVING //admin only for now
|
||||
var/invis_override = 0 //Override to allow glasses to set higher than normal see_invis
|
||||
var/lighting_alpha
|
||||
var/list/icon/current = list() //the current hud icons
|
||||
var/vision_correction = 0 //does wearing these glasses correct some of our vision defects?
|
||||
var/glass_colour_type //colors your vision when worn
|
||||
|
||||
/obj/item/clothing/glasses/suicide_act(mob/living/carbon/user)
|
||||
user.visible_message("<span class='suicide'>[user] is stabbing \the [src] into [user.p_their()] eyes! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
return BRUTELOSS
|
||||
|
||||
/obj/item/clothing/glasses/examine(mob/user)
|
||||
. = ..()
|
||||
if(glass_colour_type && ishuman(user))
|
||||
. += "<span class='notice'>Alt-click to toggle its colors.</span>"
|
||||
|
||||
/obj/item/clothing/glasses/visor_toggling()
|
||||
..()
|
||||
if(visor_vars_to_toggle & VISOR_VISIONFLAGS)
|
||||
vision_flags ^= initial(vision_flags)
|
||||
if(visor_vars_to_toggle & VISOR_DARKNESSVIEW)
|
||||
darkness_view ^= initial(darkness_view)
|
||||
if(visor_vars_to_toggle & VISOR_INVISVIEW)
|
||||
invis_view ^= initial(invis_view)
|
||||
|
||||
/obj/item/clothing/glasses/weldingvisortoggle(mob/user)
|
||||
. = ..()
|
||||
if(. && user)
|
||||
user.update_sight()
|
||||
|
||||
//called when thermal glasses are emped.
|
||||
/obj/item/clothing/glasses/proc/thermal_overload()
|
||||
if(ishuman(src.loc))
|
||||
var/mob/living/carbon/human/H = src.loc
|
||||
if(!(HAS_TRAIT(H, TRAIT_BLIND)))
|
||||
if(H.glasses == src)
|
||||
to_chat(H, "<span class='danger'>[src] overloads and blinds you!</span>")
|
||||
H.flash_act(visual = 1)
|
||||
H.blind_eyes(3)
|
||||
H.blur_eyes(5)
|
||||
H.adjust_eye_damage(5)
|
||||
|
||||
/obj/item/clothing/glasses/meson
|
||||
name = "optical meson scanner"
|
||||
desc = "Used by engineering and mining staff to see basic structural and terrain layouts through walls, regardless of lighting conditions."
|
||||
icon_state = "meson"
|
||||
item_state = "meson"
|
||||
darkness_view = 2
|
||||
vision_flags = SEE_TURFS
|
||||
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE
|
||||
glass_colour_type = /datum/client_colour/glass_colour/lightgreen
|
||||
|
||||
/obj/item/clothing/glasses/meson/suicide_act(mob/living/carbon/user)
|
||||
user.visible_message("<span class='suicide'>[user] is putting \the [src] to [user.p_their()] eyes and overloading the brightness! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
return BRUTELOSS
|
||||
|
||||
/obj/item/clothing/glasses/meson/prescription
|
||||
name = "prescription optical meson scanner"
|
||||
desc = "Used by engineering and mining staff to see basic structural and terrain layouts through walls, regardless of lighting conditions. This one has prescription lens fitted in."
|
||||
vision_correction = 1
|
||||
|
||||
/obj/item/clothing/glasses/meson/night
|
||||
name = "night vision meson scanner"
|
||||
desc = "An optical meson scanner fitted with an amplified visible light spectrum overlay, providing greater visual clarity in darkness."
|
||||
icon_state = "nvgmeson"
|
||||
item_state = "nvgmeson"
|
||||
darkness_view = 8
|
||||
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
|
||||
glass_colour_type = /datum/client_colour/glass_colour/green
|
||||
|
||||
/obj/item/clothing/glasses/meson/gar
|
||||
name = "gar mesons"
|
||||
icon_state = "garm"
|
||||
item_state = "garm"
|
||||
desc = "Do the impossible, see the invisible!"
|
||||
force = 10
|
||||
throwforce = 10
|
||||
throw_speed = 4
|
||||
attack_verb = list("sliced")
|
||||
hitsound = 'sound/weapons/bladeslice.ogg'
|
||||
sharpness = IS_SHARP
|
||||
|
||||
/obj/item/clothing/glasses/science
|
||||
name = "science goggles"
|
||||
desc = "A pair of snazzy goggles used to protect against chemical spills. Fitted with an analyzer for scanning items and reagents."
|
||||
icon_state = "purple"
|
||||
item_state = "glasses"
|
||||
clothing_flags = SCAN_REAGENTS //You can see reagents while wearing science goggles
|
||||
actions_types = list(/datum/action/item_action/toggle_research_scanner)
|
||||
glass_colour_type = /datum/client_colour/glass_colour/purple
|
||||
resistance_flags = ACID_PROOF
|
||||
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 100)
|
||||
|
||||
/obj/item/clothing/glasses/science/item_action_slot_check(slot)
|
||||
if(slot == SLOT_GLASSES)
|
||||
return 1
|
||||
|
||||
/obj/item/clothing/glasses/night
|
||||
name = "night vision goggles"
|
||||
desc = "You can totally see in the dark now!"
|
||||
icon_state = "night"
|
||||
item_state = "glasses"
|
||||
darkness_view = 8
|
||||
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
|
||||
glass_colour_type = /datum/client_colour/glass_colour/green
|
||||
|
||||
/obj/item/clothing/glasses/night/prescription
|
||||
name = "prescription night vision goggles"
|
||||
desc = "NVGs but for those with nearsightedness."
|
||||
vision_correction = 1
|
||||
|
||||
/obj/item/clothing/glasses/science/suicide_act(mob/living/carbon/user)
|
||||
user.visible_message("<span class='suicide'>[user] is tightening \the [src]'s straps around [user.p_their()] neck! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
return OXYLOSS
|
||||
|
||||
/obj/item/clothing/glasses/eyepatch
|
||||
name = "eyepatch"
|
||||
desc = "Yarr."
|
||||
icon_state = "eyepatch"
|
||||
item_state = "eyepatch"
|
||||
|
||||
/obj/item/clothing/glasses/monocle
|
||||
name = "monocle"
|
||||
desc = "Such a dapper eyepiece!"
|
||||
icon_state = "monocle"
|
||||
item_state = "headset" // lol
|
||||
|
||||
/obj/item/clothing/glasses/material
|
||||
name = "optical material scanner"
|
||||
desc = "Very confusing glasses."
|
||||
icon_state = "material"
|
||||
item_state = "glasses"
|
||||
vision_flags = SEE_OBJS
|
||||
glass_colour_type = /datum/client_colour/glass_colour/lightblue
|
||||
|
||||
/obj/item/clothing/glasses/material/mining
|
||||
name = "optical material scanner"
|
||||
desc = "Used by miners to detect ores deep within the rock."
|
||||
icon_state = "material"
|
||||
item_state = "glasses"
|
||||
darkness_view = 0
|
||||
|
||||
/obj/item/clothing/glasses/material/mining/gar
|
||||
name = "gar material scanner"
|
||||
icon_state = "garm"
|
||||
item_state = "garm"
|
||||
desc = "Do the impossible, see the invisible!"
|
||||
force = 10
|
||||
throwforce = 20
|
||||
throw_speed = 4
|
||||
attack_verb = list("sliced")
|
||||
hitsound = 'sound/weapons/bladeslice.ogg'
|
||||
sharpness = IS_SHARP
|
||||
vision_correction = 1
|
||||
glass_colour_type = /datum/client_colour/glass_colour/lightgreen
|
||||
|
||||
/obj/item/clothing/glasses/regular
|
||||
name = "prescription glasses"
|
||||
desc = "Made by Nerd. Co."
|
||||
icon_state = "glasses"
|
||||
item_state = "glasses"
|
||||
vision_correction = 1 //corrects nearsightedness
|
||||
|
||||
/obj/item/clothing/glasses/regular/jamjar
|
||||
name = "jamjar glasses"
|
||||
desc = "Also known as Virginity Protectors."
|
||||
icon_state = "jamjar_glasses"
|
||||
item_state = "jamjar_glasses"
|
||||
|
||||
/obj/item/clothing/glasses/regular/hipster
|
||||
name = "prescription glasses"
|
||||
desc = "Made by Uncool. Co."
|
||||
icon_state = "hipster_glasses"
|
||||
item_state = "hipster_glasses"
|
||||
|
||||
//Here lies green glasses, so ugly they died. RIP
|
||||
|
||||
/obj/item/clothing/glasses/sunglasses
|
||||
name = "sunglasses"
|
||||
desc = "Strangely ancient technology used to help provide rudimentary eye cover. Enhanced shielding blocks flashes."
|
||||
icon_state = "sun"
|
||||
item_state = "sunglasses"
|
||||
darkness_view = 1
|
||||
flash_protect = 1
|
||||
tint = 1
|
||||
glass_colour_type = /datum/client_colour/glass_colour/gray
|
||||
dog_fashion = /datum/dog_fashion/head
|
||||
|
||||
/obj/item/clothing/glasses/sunglasses/reagent
|
||||
name = "beer goggles"
|
||||
desc = "A pair of sunglasses outfitted with apparatus to scan reagents."
|
||||
clothing_flags = SCAN_REAGENTS
|
||||
|
||||
/obj/item/clothing/glasses/sunglasses/garb
|
||||
name = "black gar glasses"
|
||||
desc = "Go beyond impossible and kick reason to the curb!"
|
||||
icon_state = "garb"
|
||||
item_state = "garb"
|
||||
force = 10
|
||||
throwforce = 10
|
||||
throw_speed = 4
|
||||
attack_verb = list("sliced")
|
||||
hitsound = 'sound/weapons/bladeslice.ogg'
|
||||
sharpness = IS_SHARP
|
||||
|
||||
/obj/item/clothing/glasses/sunglasses/garb/supergarb
|
||||
name = "black giga gar glasses"
|
||||
desc = "Believe in us humans."
|
||||
icon_state = "supergarb"
|
||||
item_state = "garb"
|
||||
force = 12
|
||||
throwforce = 12
|
||||
|
||||
/obj/item/clothing/glasses/garb
|
||||
name = "plain black gar glasses"
|
||||
desc = "Go beyond impossible and kick reason to the curb! Doesn't seem to have flash protection and doesn't seem sharp either."
|
||||
icon_state = "garb"
|
||||
item_state = "garb"
|
||||
|
||||
/obj/item/clothing/glasses/garb/supergarb
|
||||
name = "plain black giga gar glasses"
|
||||
desc = "Believe in us humans. Also doesn't seem to have flash protection and doesn't seem sharp either."
|
||||
icon_state = "supergarb"
|
||||
|
||||
/obj/item/clothing/glasses/sunglasses/gar
|
||||
name = "gar glasses"
|
||||
desc = "Just who the hell do you think I am?!"
|
||||
icon_state = "gar"
|
||||
item_state = "gar"
|
||||
force = 10
|
||||
throwforce = 10
|
||||
throw_speed = 4
|
||||
attack_verb = list("sliced")
|
||||
hitsound = 'sound/weapons/bladeslice.ogg'
|
||||
sharpness = IS_SHARP
|
||||
glass_colour_type = /datum/client_colour/glass_colour/orange
|
||||
|
||||
/obj/item/clothing/glasses/sunglasses/gar/supergar
|
||||
name = "giga gar glasses"
|
||||
desc = "We evolve past the person we were a minute before. Little by little we advance with each turn. That's how a drill works!"
|
||||
icon_state = "supergar"
|
||||
item_state = "gar"
|
||||
force = 12
|
||||
throwforce = 12
|
||||
glass_colour_type = /datum/client_colour/glass_colour/red
|
||||
|
||||
/obj/item/clothing/glasses/welding
|
||||
name = "welding goggles"
|
||||
desc = "Protects the eyes from welders; approved by the mad scientist association."
|
||||
icon_state = "welding-g"
|
||||
item_state = "welding-g"
|
||||
actions_types = list(/datum/action/item_action/toggle)
|
||||
materials = list(MAT_METAL = 250)
|
||||
flash_protect = 2
|
||||
tint = 2
|
||||
visor_vars_to_toggle = VISOR_FLASHPROTECT | VISOR_TINT
|
||||
flags_cover = GLASSESCOVERSEYES
|
||||
visor_flags_inv = HIDEEYES
|
||||
glass_colour_type = /datum/client_colour/glass_colour/gray
|
||||
|
||||
/obj/item/clothing/glasses/welding/attack_self(mob/user)
|
||||
weldingvisortoggle(user)
|
||||
|
||||
|
||||
/obj/item/clothing/glasses/sunglasses/blindfold
|
||||
name = "blindfold"
|
||||
desc = "Covers the eyes, preventing sight."
|
||||
icon_state = "blindfold"
|
||||
item_state = "blindfold"
|
||||
flash_protect = 2
|
||||
tint = 3 // to make them blind
|
||||
|
||||
/obj/item/clothing/glasses/sunglasses/blindfold/equipped(mob/living/carbon/human/user, slot)
|
||||
. = ..()
|
||||
if(slot == SLOT_GLASSES)
|
||||
user.become_blind("blindfold_[REF(src)]")
|
||||
|
||||
/obj/item/clothing/glasses/sunglasses/blindfold/dropped(mob/living/carbon/human/user)
|
||||
..()
|
||||
user.cure_blind("blindfold_[REF(src)]")
|
||||
|
||||
/obj/item/clothing/glasses/sunglasses/big
|
||||
desc = "Strangely ancient technology used to help provide rudimentary eye cover. Larger than average enhanced shielding blocks flashes."
|
||||
icon_state = "bigsunglasses"
|
||||
item_state = "bigsunglasses"
|
||||
|
||||
/obj/item/clothing/glasses/thermal
|
||||
name = "optical thermal scanner"
|
||||
desc = "Thermals in the shape of glasses."
|
||||
icon_state = "thermal"
|
||||
item_state = "glasses"
|
||||
vision_flags = SEE_MOBS
|
||||
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE
|
||||
flash_protect = 0
|
||||
glass_colour_type = /datum/client_colour/glass_colour/red
|
||||
|
||||
/obj/item/clothing/glasses/thermal/emp_act(severity)
|
||||
. = ..()
|
||||
if(. & EMP_PROTECT_SELF)
|
||||
return
|
||||
thermal_overload()
|
||||
|
||||
/obj/item/clothing/glasses/thermal/syndi //These are now a traitor item, concealed as mesons. -Pete
|
||||
name = "chameleon thermals"
|
||||
desc = "A pair of thermal optic goggles with an onboard chameleon generator."
|
||||
flash_protect = -1
|
||||
|
||||
var/datum/action/item_action/chameleon/change/chameleon_action
|
||||
|
||||
/obj/item/clothing/glasses/thermal/syndi/New()
|
||||
..()
|
||||
chameleon_action = new(src)
|
||||
chameleon_action.chameleon_type = /obj/item/clothing/glasses
|
||||
chameleon_action.chameleon_name = "Glasses"
|
||||
chameleon_action.chameleon_blacklist = typecacheof(/obj/item/clothing/glasses/changeling, only_root_path = TRUE)
|
||||
chameleon_action.initialize_disguises()
|
||||
|
||||
/obj/item/clothing/glasses/thermal/syndi/emp_act(severity)
|
||||
. = ..()
|
||||
if(. & EMP_PROTECT_SELF)
|
||||
return
|
||||
chameleon_action.emp_randomise()
|
||||
|
||||
/obj/item/clothing/glasses/thermal/monocle
|
||||
name = "thermoncle"
|
||||
desc = "Never before has seeing through walls felt so gentlepersonly."
|
||||
icon_state = "thermoncle"
|
||||
flags_1 = null //doesn't protect eyes because it's a monocle, duh
|
||||
|
||||
/obj/item/clothing/glasses/thermal/monocle/examine(mob/user) //Different examiners see a different description!
|
||||
var/desk = desc
|
||||
if(user.gender == MALE)
|
||||
desc = replacetext(desc, "person", "man")
|
||||
else if(user.gender == FEMALE)
|
||||
desc = replacetext(desc, "person", "woman")
|
||||
. = ..()
|
||||
desc = desk
|
||||
|
||||
/obj/item/clothing/glasses/thermal/eyepatch
|
||||
name = "optical thermal eyepatch"
|
||||
desc = "An eyepatch with built-in thermal optics."
|
||||
icon_state = "eyepatch"
|
||||
item_state = "eyepatch"
|
||||
|
||||
/obj/item/clothing/glasses/cold
|
||||
name = "cold goggles"
|
||||
desc = "A pair of goggles meant for low temperatures."
|
||||
icon_state = "cold"
|
||||
item_state = "cold"
|
||||
|
||||
/obj/item/clothing/glasses/heat
|
||||
name = "heat goggles"
|
||||
desc = "A pair of goggles meant for high temperatures."
|
||||
icon_state = "heat"
|
||||
item_state = "heat"
|
||||
|
||||
/obj/item/clothing/glasses/orange
|
||||
name = "orange glasses"
|
||||
desc = "A sweet pair of orange shades."
|
||||
icon_state = "orangeglasses"
|
||||
item_state = "orangeglasses"
|
||||
glass_colour_type = /datum/client_colour/glass_colour/lightorange
|
||||
|
||||
/obj/item/clothing/glasses/red
|
||||
name = "red glasses"
|
||||
desc = "Hey, you're looking good, senpai!"
|
||||
icon_state = "redglasses"
|
||||
item_state = "redglasses"
|
||||
glass_colour_type = /datum/client_colour/glass_colour/red
|
||||
|
||||
/obj/item/clothing/glasses/godeye
|
||||
name = "eye of god"
|
||||
desc = "A strange eye, said to have been torn from an omniscient creature that used to roam the wastes."
|
||||
icon_state = "godeye"
|
||||
item_state = "godeye"
|
||||
vision_flags = SEE_TURFS|SEE_MOBS|SEE_OBJS
|
||||
darkness_view = 8
|
||||
clothing_flags = SCAN_REAGENTS
|
||||
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
|
||||
resistance_flags = LAVA_PROOF | FIRE_PROOF
|
||||
|
||||
/obj/item/clothing/glasses/godeye/Initialize()
|
||||
. = ..()
|
||||
ADD_TRAIT(src, TRAIT_NODROP, EYE_OF_GOD_TRAIT)
|
||||
|
||||
/obj/item/clothing/glasses/godeye/attackby(obj/item/W as obj, mob/user as mob, params)
|
||||
if(istype(W, src) && W != src && W.loc == user)
|
||||
if(W.icon_state == "godeye")
|
||||
W.icon_state = "doublegodeye"
|
||||
W.item_state = "doublegodeye"
|
||||
W.desc = "A pair of strange eyes, said to have been torn from an omniscient creature that used to roam the wastes. There's no real reason to have two, but that isn't stopping you."
|
||||
if(iscarbon(user))
|
||||
var/mob/living/carbon/C = user
|
||||
C.update_inv_wear_mask()
|
||||
else
|
||||
to_chat(user, "<span class='notice'>The eye winks at you and vanishes into the abyss, you feel really unlucky.</span>")
|
||||
qdel(src)
|
||||
..()
|
||||
|
||||
/obj/item/clothing/glasses/AltClick(mob/user)
|
||||
if(glass_colour_type && ishuman(user))
|
||||
var/mob/living/carbon/human/H = user
|
||||
if(H.client)
|
||||
if(H.client.prefs)
|
||||
if(src == H.glasses)
|
||||
H.client.prefs.uses_glasses_colour = !H.client.prefs.uses_glasses_colour
|
||||
if(H.client.prefs.uses_glasses_colour)
|
||||
to_chat(H, "You will now see glasses colors.")
|
||||
else
|
||||
to_chat(H, "You will no longer see glasses colors.")
|
||||
H.update_glasses_color(src, 1)
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/clothing/glasses/proc/change_glass_color(mob/living/carbon/human/H, datum/client_colour/glass_colour/new_color_type)
|
||||
var/old_colour_type = glass_colour_type
|
||||
if(!new_color_type || ispath(new_color_type)) //the new glass colour type must be null or a path.
|
||||
glass_colour_type = new_color_type
|
||||
if(H && H.glasses == src)
|
||||
if(old_colour_type)
|
||||
H.remove_client_colour(old_colour_type)
|
||||
if(glass_colour_type)
|
||||
H.update_glasses_color(src, 1)
|
||||
|
||||
|
||||
/mob/living/carbon/human/proc/update_glasses_color(obj/item/clothing/glasses/G, glasses_equipped)
|
||||
if(client && client.prefs.uses_glasses_colour && glasses_equipped)
|
||||
add_client_colour(G.glass_colour_type)
|
||||
else
|
||||
remove_client_colour(G.glass_colour_type)
|
||||
//Glasses
|
||||
/obj/item/clothing/glasses
|
||||
name = "glasses"
|
||||
icon = 'icons/obj/clothing/glasses.dmi'
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
flags_cover = GLASSESCOVERSEYES
|
||||
slot_flags = ITEM_SLOT_EYES
|
||||
strip_delay = 20
|
||||
equip_delay_other = 25
|
||||
resistance_flags = NONE
|
||||
materials = list(MAT_GLASS = 250)
|
||||
var/vision_flags = 0
|
||||
var/darkness_view = 2//Base human is 2
|
||||
var/invis_view = SEE_INVISIBLE_LIVING //admin only for now
|
||||
var/invis_override = 0 //Override to allow glasses to set higher than normal see_invis
|
||||
var/lighting_alpha
|
||||
var/list/icon/current = list() //the current hud icons
|
||||
var/vision_correction = 0 //does wearing these glasses correct some of our vision defects?
|
||||
var/glass_colour_type //colors your vision when worn
|
||||
|
||||
/obj/item/clothing/glasses/suicide_act(mob/living/carbon/user)
|
||||
user.visible_message("<span class='suicide'>[user] is stabbing \the [src] into [user.p_their()] eyes! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
return BRUTELOSS
|
||||
|
||||
/obj/item/clothing/glasses/examine(mob/user)
|
||||
. = ..()
|
||||
if(glass_colour_type && ishuman(user))
|
||||
. += "<span class='notice'>Alt-click to toggle its colors.</span>"
|
||||
|
||||
/obj/item/clothing/glasses/visor_toggling()
|
||||
..()
|
||||
if(visor_vars_to_toggle & VISOR_VISIONFLAGS)
|
||||
vision_flags ^= initial(vision_flags)
|
||||
if(visor_vars_to_toggle & VISOR_DARKNESSVIEW)
|
||||
darkness_view ^= initial(darkness_view)
|
||||
if(visor_vars_to_toggle & VISOR_INVISVIEW)
|
||||
invis_view ^= initial(invis_view)
|
||||
|
||||
/obj/item/clothing/glasses/weldingvisortoggle(mob/user)
|
||||
. = ..()
|
||||
if(. && user)
|
||||
user.update_sight()
|
||||
|
||||
//called when thermal glasses are emped.
|
||||
/obj/item/clothing/glasses/proc/thermal_overload()
|
||||
if(ishuman(src.loc))
|
||||
var/mob/living/carbon/human/H = src.loc
|
||||
if(!(HAS_TRAIT(H, TRAIT_BLIND)))
|
||||
if(H.glasses == src)
|
||||
to_chat(H, "<span class='danger'>[src] overloads and blinds you!</span>")
|
||||
H.flash_act(visual = 1)
|
||||
H.blind_eyes(3)
|
||||
H.blur_eyes(5)
|
||||
H.adjust_eye_damage(5)
|
||||
|
||||
/obj/item/clothing/glasses/meson
|
||||
name = "optical meson scanner"
|
||||
desc = "Used by engineering and mining staff to see basic structural and terrain layouts through walls, regardless of lighting conditions."
|
||||
icon_state = "meson"
|
||||
item_state = "meson"
|
||||
darkness_view = 2
|
||||
vision_flags = SEE_TURFS
|
||||
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE
|
||||
glass_colour_type = /datum/client_colour/glass_colour/lightgreen
|
||||
|
||||
/obj/item/clothing/glasses/meson/suicide_act(mob/living/carbon/user)
|
||||
user.visible_message("<span class='suicide'>[user] is putting \the [src] to [user.p_their()] eyes and overloading the brightness! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
return BRUTELOSS
|
||||
|
||||
/obj/item/clothing/glasses/meson/prescription
|
||||
name = "prescription optical meson scanner"
|
||||
desc = "Used by engineering and mining staff to see basic structural and terrain layouts through walls, regardless of lighting conditions. This one has prescription lens fitted in."
|
||||
vision_correction = 1
|
||||
|
||||
/obj/item/clothing/glasses/meson/night
|
||||
name = "night vision meson scanner"
|
||||
desc = "An optical meson scanner fitted with an amplified visible light spectrum overlay, providing greater visual clarity in darkness."
|
||||
icon_state = "nvgmeson"
|
||||
item_state = "nvgmeson"
|
||||
darkness_view = 8
|
||||
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
|
||||
glass_colour_type = /datum/client_colour/glass_colour/green
|
||||
|
||||
/obj/item/clothing/glasses/meson/gar
|
||||
name = "gar mesons"
|
||||
icon_state = "garm"
|
||||
item_state = "garm"
|
||||
desc = "Do the impossible, see the invisible!"
|
||||
force = 10
|
||||
throwforce = 10
|
||||
throw_speed = 4
|
||||
attack_verb = list("sliced")
|
||||
hitsound = 'sound/weapons/bladeslice.ogg'
|
||||
sharpness = IS_SHARP
|
||||
|
||||
/obj/item/clothing/glasses/science
|
||||
name = "science goggles"
|
||||
desc = "A pair of snazzy goggles used to protect against chemical spills. Fitted with an analyzer for scanning items and reagents."
|
||||
icon_state = "purple"
|
||||
item_state = "glasses"
|
||||
clothing_flags = SCAN_REAGENTS //You can see reagents while wearing science goggles
|
||||
actions_types = list(/datum/action/item_action/toggle_research_scanner)
|
||||
glass_colour_type = /datum/client_colour/glass_colour/purple
|
||||
resistance_flags = ACID_PROOF
|
||||
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 100)
|
||||
|
||||
/obj/item/clothing/glasses/science/item_action_slot_check(slot)
|
||||
if(slot == SLOT_GLASSES)
|
||||
return 1
|
||||
|
||||
/obj/item/clothing/glasses/night
|
||||
name = "night vision goggles"
|
||||
desc = "You can totally see in the dark now!"
|
||||
icon_state = "night"
|
||||
item_state = "glasses"
|
||||
darkness_view = 8
|
||||
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
|
||||
glass_colour_type = /datum/client_colour/glass_colour/green
|
||||
|
||||
/obj/item/clothing/glasses/night/prescription
|
||||
name = "prescription night vision goggles"
|
||||
desc = "NVGs but for those with nearsightedness."
|
||||
vision_correction = 1
|
||||
|
||||
/obj/item/clothing/glasses/science/suicide_act(mob/living/carbon/user)
|
||||
user.visible_message("<span class='suicide'>[user] is tightening \the [src]'s straps around [user.p_their()] neck! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
return OXYLOSS
|
||||
|
||||
/obj/item/clothing/glasses/eyepatch
|
||||
name = "eyepatch"
|
||||
desc = "Yarr."
|
||||
icon_state = "eyepatch"
|
||||
item_state = "eyepatch"
|
||||
|
||||
/obj/item/clothing/glasses/monocle
|
||||
name = "monocle"
|
||||
desc = "Such a dapper eyepiece!"
|
||||
icon_state = "monocle"
|
||||
item_state = "headset" // lol
|
||||
|
||||
/obj/item/clothing/glasses/material
|
||||
name = "optical material scanner"
|
||||
desc = "Very confusing glasses."
|
||||
icon_state = "material"
|
||||
item_state = "glasses"
|
||||
vision_flags = SEE_OBJS
|
||||
glass_colour_type = /datum/client_colour/glass_colour/lightblue
|
||||
|
||||
/obj/item/clothing/glasses/material/mining
|
||||
name = "optical material scanner"
|
||||
desc = "Used by miners to detect ores deep within the rock."
|
||||
icon_state = "material"
|
||||
item_state = "glasses"
|
||||
darkness_view = 0
|
||||
|
||||
/obj/item/clothing/glasses/material/mining/gar
|
||||
name = "gar material scanner"
|
||||
icon_state = "garm"
|
||||
item_state = "garm"
|
||||
desc = "Do the impossible, see the invisible!"
|
||||
force = 10
|
||||
throwforce = 20
|
||||
throw_speed = 4
|
||||
attack_verb = list("sliced")
|
||||
hitsound = 'sound/weapons/bladeslice.ogg'
|
||||
sharpness = IS_SHARP
|
||||
vision_correction = 1
|
||||
glass_colour_type = /datum/client_colour/glass_colour/lightgreen
|
||||
|
||||
/obj/item/clothing/glasses/regular
|
||||
name = "prescription glasses"
|
||||
desc = "Made by Nerd. Co."
|
||||
icon_state = "glasses"
|
||||
item_state = "glasses"
|
||||
vision_correction = 1 //corrects nearsightedness
|
||||
|
||||
/obj/item/clothing/glasses/regular/jamjar
|
||||
name = "jamjar glasses"
|
||||
desc = "Also known as Virginity Protectors."
|
||||
icon_state = "jamjar_glasses"
|
||||
item_state = "jamjar_glasses"
|
||||
|
||||
/obj/item/clothing/glasses/regular/hipster
|
||||
name = "prescription glasses"
|
||||
desc = "Made by Uncool. Co."
|
||||
icon_state = "hipster_glasses"
|
||||
item_state = "hipster_glasses"
|
||||
|
||||
//Here lies green glasses, so ugly they died. RIP
|
||||
|
||||
/obj/item/clothing/glasses/sunglasses
|
||||
name = "sunglasses"
|
||||
desc = "Strangely ancient technology used to help provide rudimentary eye cover. Enhanced shielding blocks flashes."
|
||||
icon_state = "sun"
|
||||
item_state = "sunglasses"
|
||||
darkness_view = 1
|
||||
flash_protect = 1
|
||||
tint = 1
|
||||
glass_colour_type = /datum/client_colour/glass_colour/gray
|
||||
dog_fashion = /datum/dog_fashion/head
|
||||
|
||||
/obj/item/clothing/glasses/sunglasses/reagent
|
||||
name = "beer goggles"
|
||||
desc = "A pair of sunglasses outfitted with apparatus to scan reagents."
|
||||
clothing_flags = SCAN_REAGENTS
|
||||
|
||||
/obj/item/clothing/glasses/sunglasses/garb
|
||||
name = "black gar glasses"
|
||||
desc = "Go beyond impossible and kick reason to the curb!"
|
||||
icon_state = "garb"
|
||||
item_state = "garb"
|
||||
force = 10
|
||||
throwforce = 10
|
||||
throw_speed = 4
|
||||
attack_verb = list("sliced")
|
||||
hitsound = 'sound/weapons/bladeslice.ogg'
|
||||
sharpness = IS_SHARP
|
||||
|
||||
/obj/item/clothing/glasses/sunglasses/garb/supergarb
|
||||
name = "black giga gar glasses"
|
||||
desc = "Believe in us humans."
|
||||
icon_state = "supergarb"
|
||||
item_state = "garb"
|
||||
force = 12
|
||||
throwforce = 12
|
||||
|
||||
/obj/item/clothing/glasses/garb
|
||||
name = "plain black gar glasses"
|
||||
desc = "Go beyond impossible and kick reason to the curb! Doesn't seem to have flash protection and doesn't seem sharp either."
|
||||
icon_state = "garb"
|
||||
item_state = "garb"
|
||||
|
||||
/obj/item/clothing/glasses/garb/supergarb
|
||||
name = "plain black giga gar glasses"
|
||||
desc = "Believe in us humans. Also doesn't seem to have flash protection and doesn't seem sharp either."
|
||||
icon_state = "supergarb"
|
||||
|
||||
/obj/item/clothing/glasses/sunglasses/gar
|
||||
name = "gar glasses"
|
||||
desc = "Just who the hell do you think I am?!"
|
||||
icon_state = "gar"
|
||||
item_state = "gar"
|
||||
force = 10
|
||||
throwforce = 10
|
||||
throw_speed = 4
|
||||
attack_verb = list("sliced")
|
||||
hitsound = 'sound/weapons/bladeslice.ogg'
|
||||
sharpness = IS_SHARP
|
||||
glass_colour_type = /datum/client_colour/glass_colour/orange
|
||||
|
||||
/obj/item/clothing/glasses/sunglasses/gar/supergar
|
||||
name = "giga gar glasses"
|
||||
desc = "We evolve past the person we were a minute before. Little by little we advance with each turn. That's how a drill works!"
|
||||
icon_state = "supergar"
|
||||
item_state = "gar"
|
||||
force = 12
|
||||
throwforce = 12
|
||||
glass_colour_type = /datum/client_colour/glass_colour/red
|
||||
|
||||
/obj/item/clothing/glasses/welding
|
||||
name = "welding goggles"
|
||||
desc = "Protects the eyes from welders; approved by the mad scientist association."
|
||||
icon_state = "welding-g"
|
||||
item_state = "welding-g"
|
||||
actions_types = list(/datum/action/item_action/toggle)
|
||||
materials = list(MAT_METAL = 250)
|
||||
flash_protect = 2
|
||||
tint = 2
|
||||
visor_vars_to_toggle = VISOR_FLASHPROTECT | VISOR_TINT
|
||||
flags_cover = GLASSESCOVERSEYES
|
||||
visor_flags_inv = HIDEEYES
|
||||
glass_colour_type = /datum/client_colour/glass_colour/gray
|
||||
|
||||
/obj/item/clothing/glasses/welding/attack_self(mob/user)
|
||||
weldingvisortoggle(user)
|
||||
|
||||
|
||||
/obj/item/clothing/glasses/sunglasses/blindfold
|
||||
name = "blindfold"
|
||||
desc = "Covers the eyes, preventing sight."
|
||||
icon_state = "blindfold"
|
||||
item_state = "blindfold"
|
||||
flash_protect = 2
|
||||
tint = 3 // to make them blind
|
||||
|
||||
/obj/item/clothing/glasses/sunglasses/blindfold/equipped(mob/living/carbon/human/user, slot)
|
||||
. = ..()
|
||||
if(slot == SLOT_GLASSES)
|
||||
user.become_blind("blindfold_[REF(src)]")
|
||||
|
||||
/obj/item/clothing/glasses/sunglasses/blindfold/dropped(mob/living/carbon/human/user)
|
||||
..()
|
||||
user.cure_blind("blindfold_[REF(src)]")
|
||||
|
||||
/obj/item/clothing/glasses/sunglasses/big
|
||||
desc = "Strangely ancient technology used to help provide rudimentary eye cover. Larger than average enhanced shielding blocks flashes."
|
||||
icon_state = "bigsunglasses"
|
||||
item_state = "bigsunglasses"
|
||||
|
||||
/obj/item/clothing/glasses/thermal
|
||||
name = "optical thermal scanner"
|
||||
desc = "Thermals in the shape of glasses."
|
||||
icon_state = "thermal"
|
||||
item_state = "glasses"
|
||||
vision_flags = SEE_MOBS
|
||||
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE
|
||||
flash_protect = 0
|
||||
glass_colour_type = /datum/client_colour/glass_colour/red
|
||||
|
||||
/obj/item/clothing/glasses/thermal/emp_act(severity)
|
||||
. = ..()
|
||||
if(. & EMP_PROTECT_SELF)
|
||||
return
|
||||
thermal_overload()
|
||||
|
||||
/obj/item/clothing/glasses/thermal/syndi //These are now a traitor item, concealed as mesons. -Pete
|
||||
name = "chameleon thermals"
|
||||
desc = "A pair of thermal optic goggles with an onboard chameleon generator."
|
||||
flash_protect = -1
|
||||
|
||||
var/datum/action/item_action/chameleon/change/chameleon_action
|
||||
|
||||
/obj/item/clothing/glasses/thermal/syndi/New()
|
||||
..()
|
||||
chameleon_action = new(src)
|
||||
chameleon_action.chameleon_type = /obj/item/clothing/glasses
|
||||
chameleon_action.chameleon_name = "Glasses"
|
||||
chameleon_action.chameleon_blacklist = typecacheof(/obj/item/clothing/glasses/changeling, only_root_path = TRUE)
|
||||
chameleon_action.initialize_disguises()
|
||||
|
||||
/obj/item/clothing/glasses/thermal/syndi/emp_act(severity)
|
||||
. = ..()
|
||||
if(. & EMP_PROTECT_SELF)
|
||||
return
|
||||
chameleon_action.emp_randomise()
|
||||
|
||||
/obj/item/clothing/glasses/thermal/monocle
|
||||
name = "thermoncle"
|
||||
desc = "Never before has seeing through walls felt so gentlepersonly."
|
||||
icon_state = "thermoncle"
|
||||
flags_1 = null //doesn't protect eyes because it's a monocle, duh
|
||||
|
||||
/obj/item/clothing/glasses/thermal/monocle/examine(mob/user) //Different examiners see a different description!
|
||||
var/desk = desc
|
||||
if(user.gender == MALE)
|
||||
desc = replacetext(desc, "person", "man")
|
||||
else if(user.gender == FEMALE)
|
||||
desc = replacetext(desc, "person", "woman")
|
||||
. = ..()
|
||||
desc = desk
|
||||
|
||||
/obj/item/clothing/glasses/thermal/eyepatch
|
||||
name = "optical thermal eyepatch"
|
||||
desc = "An eyepatch with built-in thermal optics."
|
||||
icon_state = "eyepatch"
|
||||
item_state = "eyepatch"
|
||||
|
||||
/obj/item/clothing/glasses/cold
|
||||
name = "cold goggles"
|
||||
desc = "A pair of goggles meant for low temperatures."
|
||||
icon_state = "cold"
|
||||
item_state = "cold"
|
||||
|
||||
/obj/item/clothing/glasses/heat
|
||||
name = "heat goggles"
|
||||
desc = "A pair of goggles meant for high temperatures."
|
||||
icon_state = "heat"
|
||||
item_state = "heat"
|
||||
|
||||
/obj/item/clothing/glasses/orange
|
||||
name = "orange glasses"
|
||||
desc = "A sweet pair of orange shades."
|
||||
icon_state = "orangeglasses"
|
||||
item_state = "orangeglasses"
|
||||
glass_colour_type = /datum/client_colour/glass_colour/lightorange
|
||||
|
||||
/obj/item/clothing/glasses/red
|
||||
name = "red glasses"
|
||||
desc = "Hey, you're looking good, senpai!"
|
||||
icon_state = "redglasses"
|
||||
item_state = "redglasses"
|
||||
glass_colour_type = /datum/client_colour/glass_colour/red
|
||||
|
||||
/obj/item/clothing/glasses/godeye
|
||||
name = "eye of god"
|
||||
desc = "A strange eye, said to have been torn from an omniscient creature that used to roam the wastes."
|
||||
icon_state = "godeye"
|
||||
item_state = "godeye"
|
||||
vision_flags = SEE_TURFS|SEE_MOBS|SEE_OBJS
|
||||
darkness_view = 8
|
||||
clothing_flags = SCAN_REAGENTS
|
||||
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
|
||||
resistance_flags = LAVA_PROOF | FIRE_PROOF
|
||||
|
||||
/obj/item/clothing/glasses/godeye/Initialize()
|
||||
. = ..()
|
||||
ADD_TRAIT(src, TRAIT_NODROP, EYE_OF_GOD_TRAIT)
|
||||
|
||||
/obj/item/clothing/glasses/godeye/attackby(obj/item/W as obj, mob/user as mob, params)
|
||||
if(istype(W, src) && W != src && W.loc == user)
|
||||
if(W.icon_state == "godeye")
|
||||
W.icon_state = "doublegodeye"
|
||||
W.item_state = "doublegodeye"
|
||||
W.desc = "A pair of strange eyes, said to have been torn from an omniscient creature that used to roam the wastes. There's no real reason to have two, but that isn't stopping you."
|
||||
if(iscarbon(user))
|
||||
var/mob/living/carbon/C = user
|
||||
C.update_inv_wear_mask()
|
||||
else
|
||||
to_chat(user, "<span class='notice'>The eye winks at you and vanishes into the abyss, you feel really unlucky.</span>")
|
||||
qdel(src)
|
||||
..()
|
||||
|
||||
/obj/item/clothing/glasses/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(glass_colour_type && ishuman(user))
|
||||
var/mob/living/carbon/human/H = user
|
||||
if(H.client?.prefs && src == H.glasses)
|
||||
H.client.prefs.uses_glasses_colour = !H.client.prefs.uses_glasses_colour
|
||||
if(H.client.prefs.uses_glasses_colour)
|
||||
to_chat(H, "You will now see glasses colors.")
|
||||
else
|
||||
to_chat(H, "You will no longer see glasses colors.")
|
||||
H.update_glasses_color(src, 1)
|
||||
return TRUE
|
||||
|
||||
/obj/item/clothing/glasses/proc/change_glass_color(mob/living/carbon/human/H, datum/client_colour/glass_colour/new_color_type)
|
||||
var/old_colour_type = glass_colour_type
|
||||
if(!new_color_type || ispath(new_color_type)) //the new glass colour type must be null or a path.
|
||||
glass_colour_type = new_color_type
|
||||
if(H && H.glasses == src)
|
||||
if(old_colour_type)
|
||||
H.remove_client_colour(old_colour_type)
|
||||
if(glass_colour_type)
|
||||
H.update_glasses_color(src, 1)
|
||||
|
||||
|
||||
/mob/living/carbon/human/proc/update_glasses_color(obj/item/clothing/glasses/G, glasses_equipped)
|
||||
if(client && client.prefs.uses_glasses_colour && glasses_equipped)
|
||||
add_client_colour(G.glass_colour_type)
|
||||
else
|
||||
remove_client_colour(G.glass_colour_type)
|
||||
|
||||
@@ -1,159 +1,161 @@
|
||||
/obj/item/clothing/head/hardhat
|
||||
name = "hard hat"
|
||||
desc = "A piece of headgear used in dangerous working conditions to protect the head. Comes with a built-in flashlight."
|
||||
icon_state = "hardhat0_yellow"
|
||||
item_state = "hardhat0_yellow"
|
||||
var/brightness_on = 4 //luminosity when on
|
||||
light_color = "#FFCC66"
|
||||
var/power_on = 0.8
|
||||
var/on = FALSE
|
||||
item_color = "yellow" //Determines used sprites: hardhat[on]_[item_color] and hardhat[on]_[item_color]2 (lying down sprite)
|
||||
armor = list("melee" = 15, "bullet" = 5, "laser" = 20,"energy" = 10, "bomb" = 20, "bio" = 10, "rad" = 20, "fire" = 100, "acid" = 50)
|
||||
flags_inv = 0
|
||||
actions_types = list(/datum/action/item_action/toggle_helmet_light)
|
||||
resistance_flags = FIRE_PROOF
|
||||
dynamic_hair_suffix = "+generic"
|
||||
|
||||
dog_fashion = /datum/dog_fashion/head
|
||||
|
||||
/obj/item/clothing/head/hardhat/attack_self(mob/living/user)
|
||||
toggle_helmet_light(user)
|
||||
|
||||
/obj/item/clothing/head/hardhat/proc/toggle_helmet_light(mob/living/user)
|
||||
on = !on
|
||||
if(on)
|
||||
turn_on(user)
|
||||
else
|
||||
turn_off(user)
|
||||
update_icon()
|
||||
|
||||
/obj/item/clothing/head/hardhat/update_icon()
|
||||
icon_state = "hardhat[on]_[item_color]"
|
||||
item_state = "hardhat[on]_[item_color]"
|
||||
if(ishuman(loc))
|
||||
var/mob/living/carbon/human/H = loc
|
||||
H.update_inv_head()
|
||||
for(var/X in actions)
|
||||
var/datum/action/A = X
|
||||
A.UpdateButtonIcon(force = TRUE)
|
||||
|
||||
/obj/item/clothing/head/hardhat/proc/turn_on(mob/user)
|
||||
set_light(brightness_on, power_on)
|
||||
|
||||
/obj/item/clothing/head/hardhat/proc/turn_off(mob/user)
|
||||
set_light(0)
|
||||
|
||||
/obj/item/clothing/head/hardhat/orange
|
||||
icon_state = "hardhat0_orange"
|
||||
item_state = "hardhat0_orange"
|
||||
item_color = "orange"
|
||||
dog_fashion = null
|
||||
|
||||
/obj/item/clothing/head/hardhat/red
|
||||
icon_state = "hardhat0_red"
|
||||
item_state = "hardhat0_red"
|
||||
item_color = "red"
|
||||
dog_fashion = null
|
||||
name = "firefighter helmet"
|
||||
clothing_flags = STOPSPRESSUREDAMAGE
|
||||
heat_protection = HEAD
|
||||
max_heat_protection_temperature = FIRE_HELM_MAX_TEMP_PROTECT
|
||||
cold_protection = HEAD
|
||||
min_cold_protection_temperature = FIRE_HELM_MIN_TEMP_PROTECT
|
||||
|
||||
/obj/item/clothing/head/hardhat/white
|
||||
icon_state = "hardhat0_white"
|
||||
item_state = "hardhat0_white"
|
||||
item_color = "white"
|
||||
clothing_flags = STOPSPRESSUREDAMAGE
|
||||
heat_protection = HEAD
|
||||
max_heat_protection_temperature = FIRE_HELM_MAX_TEMP_PROTECT
|
||||
cold_protection = HEAD
|
||||
min_cold_protection_temperature = FIRE_HELM_MIN_TEMP_PROTECT
|
||||
dog_fashion = /datum/dog_fashion/head
|
||||
|
||||
/obj/item/clothing/head/hardhat/dblue
|
||||
icon_state = "hardhat0_dblue"
|
||||
item_state = "hardhat0_dblue"
|
||||
item_color = "dblue"
|
||||
dog_fashion = null
|
||||
|
||||
/obj/item/clothing/head/hardhat/atmos
|
||||
icon_state = "hardhat0_atmos"
|
||||
item_state = "hardhat0_atmos"
|
||||
item_color = "atmos"
|
||||
dog_fashion = null
|
||||
name = "atmospheric technician's firefighting helmet"
|
||||
desc = "A firefighter's helmet, able to keep the user cool in any situation."
|
||||
clothing_flags = STOPSPRESSUREDAMAGE | THICKMATERIAL | BLOCK_GAS_SMOKE_EFFECT
|
||||
flags_inv = HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE|HIDEHAIR|HIDEFACIALHAIR|HIDESNOUT
|
||||
heat_protection = HEAD
|
||||
max_heat_protection_temperature = FIRE_IMMUNITY_MAX_TEMP_PROTECT
|
||||
cold_protection = HEAD
|
||||
min_cold_protection_temperature = FIRE_HELM_MIN_TEMP_PROTECT
|
||||
mutantrace_variation = MUTANTRACE_VARIATION
|
||||
|
||||
/obj/item/clothing/head/hardhat/weldhat
|
||||
name = "welding hard hat"
|
||||
desc = "A piece of headgear used in dangerous working conditions to protect the head. Comes with a built-in flashlight AND welding shield! The bulb seems a little smaller though."
|
||||
brightness_on = 3 //Needs a little bit of tradeoff
|
||||
dog_fashion = null
|
||||
actions_types = list(/datum/action/item_action/toggle_helmet_light, /datum/action/item_action/toggle_welding_screen)
|
||||
flash_protect = 2
|
||||
tint = 2
|
||||
flags_inv = HIDEEYES | HIDEFACE
|
||||
flags_cover = HEADCOVERSEYES | HEADCOVERSMOUTH
|
||||
visor_vars_to_toggle = VISOR_FLASHPROTECT | VISOR_TINT
|
||||
visor_flags_inv = HIDEEYES | HIDEFACE
|
||||
visor_flags_cover = HEADCOVERSEYES | HEADCOVERSMOUTH
|
||||
|
||||
/obj/item/clothing/head/hardhat/weldhat/Initialize()
|
||||
. = ..()
|
||||
update_icon()
|
||||
|
||||
/obj/item/clothing/head/hardhat/weldhat/attack_self(mob/living/user)
|
||||
toggle_helmet_light(user)
|
||||
|
||||
/obj/item/clothing/head/hardhat/weldhat/AltClick(mob/user)
|
||||
if(user.canUseTopic(src, BE_CLOSE))
|
||||
toggle_welding_screen(user)
|
||||
|
||||
/obj/item/clothing/head/hardhat/weldhat/proc/toggle_welding_screen(mob/living/user)
|
||||
if(weldingvisortoggle(user))
|
||||
playsound(src, 'sound/mecha/mechmove03.ogg', 30, TRUE) //Visors don't just come from nothing
|
||||
update_icon()
|
||||
|
||||
/obj/item/clothing/head/hardhat/weldhat/worn_overlays(isinhands)
|
||||
. = ..()
|
||||
if(!isinhands)
|
||||
. += mutable_appearance('icons/mob/head.dmi', "weldhelmet")
|
||||
if(!up)
|
||||
. += mutable_appearance('icons/mob/head.dmi', "weldvisor")
|
||||
|
||||
/obj/item/clothing/head/hardhat/weldhat/update_icon()
|
||||
cut_overlays()
|
||||
if(!up)
|
||||
add_overlay("weldvisor")
|
||||
..()
|
||||
|
||||
/obj/item/clothing/head/hardhat/weldhat/orange
|
||||
icon_state = "hardhat0_orange"
|
||||
item_state = "hardhat0_orange"
|
||||
item_color = "orange"
|
||||
|
||||
/obj/item/clothing/head/hardhat/weldhat/white
|
||||
desc = "A piece of headgear used in dangerous working conditions to protect the head. Comes with a built-in flashlight AND welding shield!" //This bulb is not smaller
|
||||
icon_state = "hardhat0_white"
|
||||
item_state = "hardhat0_white"
|
||||
brightness_on = 4 //Boss always takes the best stuff
|
||||
item_color = "white"
|
||||
clothing_flags = STOPSPRESSUREDAMAGE
|
||||
heat_protection = HEAD
|
||||
max_heat_protection_temperature = FIRE_HELM_MAX_TEMP_PROTECT
|
||||
cold_protection = HEAD
|
||||
min_cold_protection_temperature = FIRE_HELM_MIN_TEMP_PROTECT
|
||||
|
||||
/obj/item/clothing/head/hardhat/weldhat/dblue
|
||||
icon_state = "hardhat0_dblue"
|
||||
item_state = "hardhat0_dblue"
|
||||
/obj/item/clothing/head/hardhat
|
||||
name = "hard hat"
|
||||
desc = "A piece of headgear used in dangerous working conditions to protect the head. Comes with a built-in flashlight."
|
||||
icon_state = "hardhat0_yellow"
|
||||
item_state = "hardhat0_yellow"
|
||||
var/brightness_on = 4 //luminosity when on
|
||||
light_color = "#FFCC66"
|
||||
var/power_on = 0.8
|
||||
var/on = FALSE
|
||||
item_color = "yellow" //Determines used sprites: hardhat[on]_[item_color] and hardhat[on]_[item_color]2 (lying down sprite)
|
||||
armor = list("melee" = 15, "bullet" = 5, "laser" = 20,"energy" = 10, "bomb" = 20, "bio" = 10, "rad" = 20, "fire" = 100, "acid" = 50)
|
||||
flags_inv = 0
|
||||
actions_types = list(/datum/action/item_action/toggle_helmet_light)
|
||||
resistance_flags = FIRE_PROOF
|
||||
dynamic_hair_suffix = "+generic"
|
||||
|
||||
dog_fashion = /datum/dog_fashion/head
|
||||
|
||||
/obj/item/clothing/head/hardhat/attack_self(mob/living/user)
|
||||
toggle_helmet_light(user)
|
||||
|
||||
/obj/item/clothing/head/hardhat/proc/toggle_helmet_light(mob/living/user)
|
||||
on = !on
|
||||
if(on)
|
||||
turn_on(user)
|
||||
else
|
||||
turn_off(user)
|
||||
update_icon()
|
||||
|
||||
/obj/item/clothing/head/hardhat/update_icon()
|
||||
icon_state = "hardhat[on]_[item_color]"
|
||||
item_state = "hardhat[on]_[item_color]"
|
||||
if(ishuman(loc))
|
||||
var/mob/living/carbon/human/H = loc
|
||||
H.update_inv_head()
|
||||
for(var/X in actions)
|
||||
var/datum/action/A = X
|
||||
A.UpdateButtonIcon(force = TRUE)
|
||||
|
||||
/obj/item/clothing/head/hardhat/proc/turn_on(mob/user)
|
||||
set_light(brightness_on, power_on)
|
||||
|
||||
/obj/item/clothing/head/hardhat/proc/turn_off(mob/user)
|
||||
set_light(0)
|
||||
|
||||
/obj/item/clothing/head/hardhat/orange
|
||||
icon_state = "hardhat0_orange"
|
||||
item_state = "hardhat0_orange"
|
||||
item_color = "orange"
|
||||
dog_fashion = null
|
||||
|
||||
/obj/item/clothing/head/hardhat/red
|
||||
icon_state = "hardhat0_red"
|
||||
item_state = "hardhat0_red"
|
||||
item_color = "red"
|
||||
dog_fashion = null
|
||||
name = "firefighter helmet"
|
||||
clothing_flags = STOPSPRESSUREDAMAGE
|
||||
heat_protection = HEAD
|
||||
max_heat_protection_temperature = FIRE_HELM_MAX_TEMP_PROTECT
|
||||
cold_protection = HEAD
|
||||
min_cold_protection_temperature = FIRE_HELM_MIN_TEMP_PROTECT
|
||||
|
||||
/obj/item/clothing/head/hardhat/white
|
||||
icon_state = "hardhat0_white"
|
||||
item_state = "hardhat0_white"
|
||||
item_color = "white"
|
||||
clothing_flags = STOPSPRESSUREDAMAGE
|
||||
heat_protection = HEAD
|
||||
max_heat_protection_temperature = FIRE_HELM_MAX_TEMP_PROTECT
|
||||
cold_protection = HEAD
|
||||
min_cold_protection_temperature = FIRE_HELM_MIN_TEMP_PROTECT
|
||||
dog_fashion = /datum/dog_fashion/head
|
||||
|
||||
/obj/item/clothing/head/hardhat/dblue
|
||||
icon_state = "hardhat0_dblue"
|
||||
item_state = "hardhat0_dblue"
|
||||
item_color = "dblue"
|
||||
dog_fashion = null
|
||||
|
||||
/obj/item/clothing/head/hardhat/atmos
|
||||
icon_state = "hardhat0_atmos"
|
||||
item_state = "hardhat0_atmos"
|
||||
item_color = "atmos"
|
||||
dog_fashion = null
|
||||
name = "atmospheric technician's firefighting helmet"
|
||||
desc = "A firefighter's helmet, able to keep the user cool in any situation."
|
||||
clothing_flags = STOPSPRESSUREDAMAGE | THICKMATERIAL | BLOCK_GAS_SMOKE_EFFECT
|
||||
flags_inv = HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE|HIDEHAIR|HIDEFACIALHAIR|HIDESNOUT
|
||||
heat_protection = HEAD
|
||||
max_heat_protection_temperature = FIRE_IMMUNITY_MAX_TEMP_PROTECT
|
||||
cold_protection = HEAD
|
||||
min_cold_protection_temperature = FIRE_HELM_MIN_TEMP_PROTECT
|
||||
mutantrace_variation = MUTANTRACE_VARIATION
|
||||
|
||||
/obj/item/clothing/head/hardhat/weldhat
|
||||
name = "welding hard hat"
|
||||
desc = "A piece of headgear used in dangerous working conditions to protect the head. Comes with a built-in flashlight AND welding shield! The bulb seems a little smaller though."
|
||||
brightness_on = 3 //Needs a little bit of tradeoff
|
||||
dog_fashion = null
|
||||
actions_types = list(/datum/action/item_action/toggle_helmet_light, /datum/action/item_action/toggle_welding_screen)
|
||||
flash_protect = 2
|
||||
tint = 2
|
||||
flags_inv = HIDEEYES | HIDEFACE
|
||||
flags_cover = HEADCOVERSEYES | HEADCOVERSMOUTH
|
||||
visor_vars_to_toggle = VISOR_FLASHPROTECT | VISOR_TINT
|
||||
visor_flags_inv = HIDEEYES | HIDEFACE
|
||||
visor_flags_cover = HEADCOVERSEYES | HEADCOVERSMOUTH
|
||||
|
||||
/obj/item/clothing/head/hardhat/weldhat/Initialize()
|
||||
. = ..()
|
||||
update_icon()
|
||||
|
||||
/obj/item/clothing/head/hardhat/weldhat/attack_self(mob/living/user)
|
||||
toggle_helmet_light(user)
|
||||
|
||||
/obj/item/clothing/head/hardhat/weldhat/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(user.canUseTopic(src, BE_CLOSE))
|
||||
toggle_welding_screen(user)
|
||||
return TRUE
|
||||
|
||||
/obj/item/clothing/head/hardhat/weldhat/proc/toggle_welding_screen(mob/living/user)
|
||||
if(weldingvisortoggle(user))
|
||||
playsound(src, 'sound/mecha/mechmove03.ogg', 30, TRUE) //Visors don't just come from nothing
|
||||
update_icon()
|
||||
|
||||
/obj/item/clothing/head/hardhat/weldhat/worn_overlays(isinhands)
|
||||
. = ..()
|
||||
if(!isinhands)
|
||||
. += mutable_appearance('icons/mob/head.dmi', "weldhelmet")
|
||||
if(!up)
|
||||
. += mutable_appearance('icons/mob/head.dmi', "weldvisor")
|
||||
|
||||
/obj/item/clothing/head/hardhat/weldhat/update_icon()
|
||||
cut_overlays()
|
||||
if(!up)
|
||||
add_overlay("weldvisor")
|
||||
..()
|
||||
|
||||
/obj/item/clothing/head/hardhat/weldhat/orange
|
||||
icon_state = "hardhat0_orange"
|
||||
item_state = "hardhat0_orange"
|
||||
item_color = "orange"
|
||||
|
||||
/obj/item/clothing/head/hardhat/weldhat/white
|
||||
desc = "A piece of headgear used in dangerous working conditions to protect the head. Comes with a built-in flashlight AND welding shield!" //This bulb is not smaller
|
||||
icon_state = "hardhat0_white"
|
||||
item_state = "hardhat0_white"
|
||||
brightness_on = 4 //Boss always takes the best stuff
|
||||
item_color = "white"
|
||||
clothing_flags = STOPSPRESSUREDAMAGE
|
||||
heat_protection = HEAD
|
||||
max_heat_protection_temperature = FIRE_HELM_MAX_TEMP_PROTECT
|
||||
cold_protection = HEAD
|
||||
min_cold_protection_temperature = FIRE_HELM_MIN_TEMP_PROTECT
|
||||
|
||||
/obj/item/clothing/head/hardhat/weldhat/dblue
|
||||
icon_state = "hardhat0_dblue"
|
||||
item_state = "hardhat0_dblue"
|
||||
item_color = "dblue"
|
||||
+297
-297
@@ -1,297 +1,297 @@
|
||||
//defines the drill hat's yelling setting
|
||||
#define DRILL_DEFAULT "default"
|
||||
#define DRILL_SHOUTING "shouting"
|
||||
#define DRILL_YELLING "yelling"
|
||||
#define DRILL_CANADIAN "canadian"
|
||||
|
||||
//Chef
|
||||
/obj/item/clothing/head/chefhat
|
||||
name = "chef's hat"
|
||||
item_state = "chef"
|
||||
icon_state = "chef"
|
||||
desc = "The commander in chef's head wear."
|
||||
strip_delay = 10
|
||||
equip_delay_other = 10
|
||||
dynamic_hair_suffix = ""
|
||||
dog_fashion = /datum/dog_fashion/head/chef
|
||||
|
||||
/obj/item/clothing/head/chefhat/suicide_act(mob/user)
|
||||
user.visible_message("<span class='suicide'>[user] is donning [src]! It looks like [user.p_theyre()] trying to become a chef.</span>")
|
||||
user.say("Bork Bork Bork!", forced = "chef hat suicide")
|
||||
sleep(20)
|
||||
user.visible_message("<span class='suicide'>[user] climbs into an imaginary oven!</span>")
|
||||
user.say("BOOORK!", forced = "chef hat suicide")
|
||||
playsound(user, 'sound/machines/ding.ogg', 50, 1)
|
||||
return(FIRELOSS)
|
||||
|
||||
//Captain
|
||||
/obj/item/clothing/head/caphat
|
||||
name = "captain's hat"
|
||||
desc = "It's good being the king."
|
||||
icon_state = "captain"
|
||||
item_state = "that"
|
||||
flags_inv = 0
|
||||
armor = list("melee" = 40, "bullet" = 30, "laser" = 30, "energy" = 10, "bomb" = 25, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 50)
|
||||
strip_delay = 60
|
||||
dog_fashion = /datum/dog_fashion/head/captain
|
||||
|
||||
//Captain: This is no longer space-worthy
|
||||
/obj/item/clothing/head/caphat/parade
|
||||
name = "captain's parade cap"
|
||||
desc = "Worn only by Captains with an abundance of class."
|
||||
icon_state = "capcap"
|
||||
|
||||
dog_fashion = null
|
||||
|
||||
/obj/item/clothing/head/caphat/beret
|
||||
name = "captain's beret"
|
||||
desc = "A beret fit for a leader."
|
||||
icon_state = "capberet"
|
||||
dynamic_hair_suffix = ""
|
||||
|
||||
dog_fashion = null
|
||||
|
||||
//Head of Personnel
|
||||
/obj/item/clothing/head/hopcap
|
||||
name = "head of personnel's cap"
|
||||
icon_state = "hopcap"
|
||||
desc = "The symbol of true bureaucratic micromanagement."
|
||||
armor = list("melee" = 30, "bullet" = 25, "laser" = 25, "energy" = 10, "bomb" = 25, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 50)
|
||||
dog_fashion = /datum/dog_fashion/head/hop
|
||||
|
||||
/obj/item/clothing/head/hopcap/beret
|
||||
name = "head of personnel's beret"
|
||||
desc = "The symbol of true bureaucratic micromanagement, although in a fancy form."
|
||||
icon_state = "hopberet"
|
||||
dynamic_hair_suffix = ""
|
||||
|
||||
dog_fashion = null
|
||||
|
||||
//Chaplain
|
||||
/obj/item/clothing/head/nun_hood
|
||||
name = "nun hood"
|
||||
desc = "Maximum piety in this star system."
|
||||
icon_state = "nun_hood"
|
||||
flags_inv = HIDEHAIR
|
||||
flags_cover = HEADCOVERSEYES
|
||||
|
||||
//Detective
|
||||
/obj/item/clothing/head/fedora/det_hat
|
||||
name = "detective's fedora"
|
||||
desc = "There's only one man who can sniff out the dirty stench of crime, and he's likely wearing this hat."
|
||||
armor = list("melee" = 25, "bullet" = 5, "laser" = 25, "energy" = 10, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 30, "acid" = 50)
|
||||
icon_state = "detective"
|
||||
var/candy_cooldown = 0
|
||||
pocket_storage_component_path = /datum/component/storage/concrete/pockets/small/detective
|
||||
dog_fashion = /datum/dog_fashion/head/detective
|
||||
|
||||
/obj/item/clothing/head/fedora/det_hat/Initialize()
|
||||
. = ..()
|
||||
new /obj/item/reagent_containers/food/drinks/flask/det(src)
|
||||
|
||||
/obj/item/clothing/head/fedora/det_hat/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>Alt-click to take a candy corn.</span>"
|
||||
|
||||
/obj/item/clothing/head/fedora/det_hat/AltClick(mob/user)
|
||||
if(user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||
..()
|
||||
if(loc == user)
|
||||
if(candy_cooldown < world.time)
|
||||
var/obj/item/reagent_containers/food/snacks/candy_corn/CC = new /obj/item/reagent_containers/food/snacks/candy_corn(src)
|
||||
user.put_in_hands(CC)
|
||||
to_chat(user, "You slip a candy corn from your hat.")
|
||||
candy_cooldown = world.time+1200
|
||||
else
|
||||
to_chat(user, "You just took a candy corn! You should wait a couple minutes, lest you burn through your stash.")
|
||||
|
||||
|
||||
//Mime
|
||||
/obj/item/clothing/head/beret
|
||||
name = "beret"
|
||||
desc = "A beret, a mime's favorite headwear."
|
||||
icon_state = "beret"
|
||||
dog_fashion = /datum/dog_fashion/head/beret
|
||||
dynamic_hair_suffix = ""
|
||||
|
||||
/obj/item/clothing/head/beret/black
|
||||
name = "black beret"
|
||||
desc = "A black beret, perfect for war veterans and dark, brooding, anti-hero mimes."
|
||||
icon_state = "beretblack"
|
||||
|
||||
/obj/item/clothing/head/beret/highlander
|
||||
desc = "That was white fabric. <i>Was.</i>"
|
||||
dog_fashion = null //THIS IS FOR SLAUGHTER, NOT PUPPIES
|
||||
|
||||
/obj/item/clothing/head/beret/highlander/Initialize()
|
||||
. = ..()
|
||||
ADD_TRAIT(src, TRAIT_NODROP, HIGHLANDER)
|
||||
|
||||
//Security
|
||||
|
||||
/obj/item/clothing/head/HoS
|
||||
name = "head of security cap"
|
||||
desc = "The robust standard-issue cap of the Head of Security. For showing the officers who's in charge."
|
||||
icon_state = "hoscap"
|
||||
armor = list("melee" = 40, "bullet" = 30, "laser" = 25, "energy" = 10, "bomb" = 25, "bio" = 10, "rad" = 0, "fire" = 50, "acid" = 60)
|
||||
strip_delay = 80
|
||||
dynamic_hair_suffix = ""
|
||||
|
||||
/obj/item/clothing/head/HoS/syndicate
|
||||
name = "syndicate cap"
|
||||
desc = "A black cap fit for a high ranking syndicate officer."
|
||||
|
||||
/obj/item/clothing/head/HoS/beret
|
||||
name = "head of security beret"
|
||||
desc = "A robust beret for the Head of Security, for looking stylish while not sacrificing protection."
|
||||
icon_state = "hosberetblack"
|
||||
|
||||
/obj/item/clothing/head/HoS/beret/syndicate
|
||||
name = "syndicate beret"
|
||||
desc = "A black beret with thick armor padding inside. Stylish and robust."
|
||||
|
||||
/obj/item/clothing/head/warden
|
||||
name = "warden's police hat"
|
||||
desc = "It's a special armored hat issued to the Warden of a security force. Protects the head from impacts."
|
||||
icon_state = "policehelm"
|
||||
armor = list("melee" = 40, "bullet" = 30, "laser" = 30, "energy" = 10, "bomb" = 25, "bio" = 0, "rad" = 0, "fire" = 30, "acid" = 60)
|
||||
strip_delay = 60
|
||||
dog_fashion = /datum/dog_fashion/head/warden
|
||||
|
||||
/obj/item/clothing/head/warden/drill
|
||||
name = "warden's campaign hat"
|
||||
desc = "A special armored campaign hat with the security insignia emblazoned on it. Uses reinforced fabric to offer sufficient protection. Has the letters 'FMJ' enscribed on its side."
|
||||
icon_state = "wardendrill"
|
||||
item_state = "wardendrill"
|
||||
dog_fashion = null
|
||||
var/mode = DRILL_DEFAULT
|
||||
|
||||
/obj/item/clothing/head/warden/drill/screwdriver_act(mob/living/carbon/human/user, obj/item/I)
|
||||
if(..())
|
||||
return TRUE
|
||||
switch(mode)
|
||||
if(DRILL_DEFAULT)
|
||||
to_chat(user, "<span class='notice'>You set the voice circuit to the middle position.</span>")
|
||||
mode = DRILL_SHOUTING
|
||||
if(DRILL_SHOUTING)
|
||||
to_chat(user, "<span class='notice'>You set the voice circuit to the last position.</span>")
|
||||
mode = DRILL_YELLING
|
||||
if(DRILL_YELLING)
|
||||
to_chat(user, "<span class='notice'>You set the voice circuit to the first position.</span>")
|
||||
mode = DRILL_DEFAULT
|
||||
if(DRILL_CANADIAN)
|
||||
to_chat(user, "<span class='danger'>You adjust voice circuit but nothing happens, probably because it's broken.</span>")
|
||||
return TRUE
|
||||
|
||||
/obj/item/clothing/head/warden/drill/wirecutter_act(mob/living/user, obj/item/I)
|
||||
if(mode != DRILL_CANADIAN)
|
||||
to_chat(user, "<span class='danger'>You broke the voice circuit!</span>")
|
||||
mode = DRILL_CANADIAN
|
||||
return TRUE
|
||||
|
||||
/obj/item/clothing/head/warden/drill/equipped(mob/M, slot)
|
||||
. = ..()
|
||||
if (slot == SLOT_HEAD)
|
||||
RegisterSignal(M, COMSIG_MOB_SAY, .proc/handle_speech)
|
||||
else
|
||||
UnregisterSignal(M, COMSIG_MOB_SAY)
|
||||
|
||||
/obj/item/clothing/head/warden/drill/dropped(mob/M)
|
||||
. = ..()
|
||||
UnregisterSignal(M, COMSIG_MOB_SAY)
|
||||
|
||||
/obj/item/clothing/head/warden/drill/proc/handle_speech(datum/source, mob/speech_args)
|
||||
var/message = speech_args[SPEECH_MESSAGE]
|
||||
if(message[1] != "*")
|
||||
switch (mode)
|
||||
if(DRILL_SHOUTING)
|
||||
message += "!"
|
||||
if(DRILL_YELLING)
|
||||
message += "!!"
|
||||
if(DRILL_CANADIAN)
|
||||
message = " [message]"
|
||||
var/list/canadian_words = strings("canadian_replacement.json", "canadian")
|
||||
|
||||
for(var/key in canadian_words)
|
||||
var/value = canadian_words[key]
|
||||
if(islist(value))
|
||||
value = pick(value)
|
||||
|
||||
message = replacetextEx(message, " [uppertext(key)]", " [uppertext(value)]")
|
||||
message = replacetextEx(message, " [capitalize(key)]", " [capitalize(value)]")
|
||||
message = replacetextEx(message, " [key]", " [value]")
|
||||
|
||||
if(prob(30))
|
||||
message += pick(", eh?", ", EH?")
|
||||
speech_args[SPEECH_MESSAGE] = message
|
||||
|
||||
/obj/item/clothing/head/beret/sec
|
||||
name = "security beret"
|
||||
desc = "A robust beret with the security insignia emblazoned on it. Uses reinforced fabric to offer sufficient protection."
|
||||
icon_state = "beret_badge"
|
||||
armor = list("melee" = 40, "bullet" = 30, "laser" = 30,"energy" = 10, "bomb" = 25, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 50)
|
||||
strip_delay = 60
|
||||
dog_fashion = null
|
||||
|
||||
/obj/item/clothing/head/beret/sec/navyhos
|
||||
name = "head of security's beret"
|
||||
desc = "A special beret with the Head of Security's insignia emblazoned on it. A symbol of excellence, a badge of courage, a mark of distinction."
|
||||
icon_state = "hosberet"
|
||||
|
||||
/obj/item/clothing/head/beret/sec/navywarden
|
||||
name = "warden's beret"
|
||||
desc = "A special beret with the Warden's insignia emblazoned on it. For wardens with class."
|
||||
icon_state = "wardenberet"
|
||||
armor = list("melee" = 40, "bullet" = 30, "laser" = 30, "energy" = 10, "bomb" = 25, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 50)
|
||||
strip_delay = 60
|
||||
|
||||
/obj/item/clothing/head/beret/sec/navyofficer
|
||||
desc = "A special beret with the security insignia emblazoned on it. For officers with class."
|
||||
icon_state = "officerberet"
|
||||
|
||||
/obj/item/clothing/head/beret/sec/bitch
|
||||
name = "security's bitch beret"
|
||||
desc = "A softer beret with the word 'BITCH' embroidered on it in pink thread."
|
||||
icon_state = "bitchberet"
|
||||
|
||||
//Curator
|
||||
/obj/item/clothing/head/fedora/curator
|
||||
name = "treasure hunter's fedora"
|
||||
desc = "You got red text today kid, but it doesn't mean you have to like it."
|
||||
icon_state = "curator"
|
||||
|
||||
//Chief Medical Officer
|
||||
/obj/item/clothing/head/beret/cmo
|
||||
name = "chief medical officer's beret"
|
||||
desc = "A fancy beret with a green cross, signifying your status in the station's medbay."
|
||||
icon_state = "cmoberet"
|
||||
|
||||
//Research Director
|
||||
/obj/item/clothing/head/beret/rd
|
||||
name = "research director's beret"
|
||||
desc = "A beret worn only by highly intelligent people."
|
||||
icon_state = "rdberet"
|
||||
|
||||
//Chief Engineer
|
||||
/obj/item/clothing/head/beret/ce
|
||||
name = "chief engineer's beret"
|
||||
desc = "A beret that will surely make you look way cooler than a hard hat, although lack of protection is the price."
|
||||
icon_state = "ceberet"
|
||||
|
||||
//Quartermaster
|
||||
/obj/item/clothing/head/beret/qm
|
||||
name = "quartermaster's beret"
|
||||
desc = "This headwear shows off your Cargonian leadership"
|
||||
icon_state = "qmberet"
|
||||
|
||||
/obj/item/clothing/head/beret/durathread
|
||||
name = "durathread beret"
|
||||
desc = "A beret made from durathread, its resilient fibres provide some protection to the wearer."
|
||||
icon_state = "beretdurathread"
|
||||
item_color = null
|
||||
armor = list("melee" = 25, "bullet" = 10, "laser" = 20,"energy" = 10, "bomb" = 30, "bio" = 15, "rad" = 20, "fire" = 100, "acid" = 50)
|
||||
|
||||
#undef DRILL_DEFAULT
|
||||
#undef DRILL_SHOUTING
|
||||
#undef DRILL_YELLING
|
||||
#undef DRILL_CANADIAN
|
||||
//defines the drill hat's yelling setting
|
||||
#define DRILL_DEFAULT "default"
|
||||
#define DRILL_SHOUTING "shouting"
|
||||
#define DRILL_YELLING "yelling"
|
||||
#define DRILL_CANADIAN "canadian"
|
||||
|
||||
//Chef
|
||||
/obj/item/clothing/head/chefhat
|
||||
name = "chef's hat"
|
||||
item_state = "chef"
|
||||
icon_state = "chef"
|
||||
desc = "The commander in chef's head wear."
|
||||
strip_delay = 10
|
||||
equip_delay_other = 10
|
||||
dynamic_hair_suffix = ""
|
||||
dog_fashion = /datum/dog_fashion/head/chef
|
||||
|
||||
/obj/item/clothing/head/chefhat/suicide_act(mob/user)
|
||||
user.visible_message("<span class='suicide'>[user] is donning [src]! It looks like [user.p_theyre()] trying to become a chef.</span>")
|
||||
user.say("Bork Bork Bork!", forced = "chef hat suicide")
|
||||
sleep(20)
|
||||
user.visible_message("<span class='suicide'>[user] climbs into an imaginary oven!</span>")
|
||||
user.say("BOOORK!", forced = "chef hat suicide")
|
||||
playsound(user, 'sound/machines/ding.ogg', 50, 1)
|
||||
return(FIRELOSS)
|
||||
|
||||
//Captain
|
||||
/obj/item/clothing/head/caphat
|
||||
name = "captain's hat"
|
||||
desc = "It's good being the king."
|
||||
icon_state = "captain"
|
||||
item_state = "that"
|
||||
flags_inv = 0
|
||||
armor = list("melee" = 40, "bullet" = 30, "laser" = 30, "energy" = 10, "bomb" = 25, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 50)
|
||||
strip_delay = 60
|
||||
dog_fashion = /datum/dog_fashion/head/captain
|
||||
|
||||
//Captain: This is no longer space-worthy
|
||||
/obj/item/clothing/head/caphat/parade
|
||||
name = "captain's parade cap"
|
||||
desc = "Worn only by Captains with an abundance of class."
|
||||
icon_state = "capcap"
|
||||
|
||||
dog_fashion = null
|
||||
|
||||
/obj/item/clothing/head/caphat/beret
|
||||
name = "captain's beret"
|
||||
desc = "A beret fit for a leader."
|
||||
icon_state = "capberet"
|
||||
dynamic_hair_suffix = ""
|
||||
|
||||
dog_fashion = null
|
||||
|
||||
//Head of Personnel
|
||||
/obj/item/clothing/head/hopcap
|
||||
name = "head of personnel's cap"
|
||||
icon_state = "hopcap"
|
||||
desc = "The symbol of true bureaucratic micromanagement."
|
||||
armor = list("melee" = 30, "bullet" = 25, "laser" = 25, "energy" = 10, "bomb" = 25, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 50)
|
||||
dog_fashion = /datum/dog_fashion/head/hop
|
||||
|
||||
/obj/item/clothing/head/hopcap/beret
|
||||
name = "head of personnel's beret"
|
||||
desc = "The symbol of true bureaucratic micromanagement, although in a fancy form."
|
||||
icon_state = "hopberet"
|
||||
dynamic_hair_suffix = ""
|
||||
|
||||
dog_fashion = null
|
||||
|
||||
//Chaplain
|
||||
/obj/item/clothing/head/nun_hood
|
||||
name = "nun hood"
|
||||
desc = "Maximum piety in this star system."
|
||||
icon_state = "nun_hood"
|
||||
flags_inv = HIDEHAIR
|
||||
flags_cover = HEADCOVERSEYES
|
||||
|
||||
//Detective
|
||||
/obj/item/clothing/head/fedora/det_hat
|
||||
name = "detective's fedora"
|
||||
desc = "There's only one man who can sniff out the dirty stench of crime, and he's likely wearing this hat."
|
||||
armor = list("melee" = 25, "bullet" = 5, "laser" = 25, "energy" = 10, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 30, "acid" = 50)
|
||||
icon_state = "detective"
|
||||
var/candy_cooldown = 0
|
||||
pocket_storage_component_path = /datum/component/storage/concrete/pockets/small/detective
|
||||
dog_fashion = /datum/dog_fashion/head/detective
|
||||
|
||||
/obj/item/clothing/head/fedora/det_hat/Initialize()
|
||||
. = ..()
|
||||
new /obj/item/reagent_containers/food/drinks/flask/det(src)
|
||||
|
||||
/obj/item/clothing/head/fedora/det_hat/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>Alt-click to take a candy corn.</span>"
|
||||
|
||||
/obj/item/clothing/head/fedora/det_hat/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(loc == user && user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||
if(candy_cooldown < world.time)
|
||||
var/obj/item/reagent_containers/food/snacks/candy_corn/CC = new /obj/item/reagent_containers/food/snacks/candy_corn(src)
|
||||
user.put_in_hands(CC)
|
||||
to_chat(user, "You slip a candy corn from your hat.")
|
||||
candy_cooldown = world.time+1200
|
||||
else
|
||||
to_chat(user, "You just took a candy corn! You should wait a couple minutes, lest you burn through your stash.")
|
||||
return TRUE
|
||||
|
||||
|
||||
//Mime
|
||||
/obj/item/clothing/head/beret
|
||||
name = "beret"
|
||||
desc = "A beret, a mime's favorite headwear."
|
||||
icon_state = "beret"
|
||||
dog_fashion = /datum/dog_fashion/head/beret
|
||||
dynamic_hair_suffix = ""
|
||||
|
||||
/obj/item/clothing/head/beret/black
|
||||
name = "black beret"
|
||||
desc = "A black beret, perfect for war veterans and dark, brooding, anti-hero mimes."
|
||||
icon_state = "beretblack"
|
||||
|
||||
/obj/item/clothing/head/beret/highlander
|
||||
desc = "That was white fabric. <i>Was.</i>"
|
||||
dog_fashion = null //THIS IS FOR SLAUGHTER, NOT PUPPIES
|
||||
|
||||
/obj/item/clothing/head/beret/highlander/Initialize()
|
||||
. = ..()
|
||||
ADD_TRAIT(src, TRAIT_NODROP, HIGHLANDER)
|
||||
|
||||
//Security
|
||||
|
||||
/obj/item/clothing/head/HoS
|
||||
name = "head of security cap"
|
||||
desc = "The robust standard-issue cap of the Head of Security. For showing the officers who's in charge."
|
||||
icon_state = "hoscap"
|
||||
armor = list("melee" = 40, "bullet" = 30, "laser" = 25, "energy" = 10, "bomb" = 25, "bio" = 10, "rad" = 0, "fire" = 50, "acid" = 60)
|
||||
strip_delay = 80
|
||||
dynamic_hair_suffix = ""
|
||||
|
||||
/obj/item/clothing/head/HoS/syndicate
|
||||
name = "syndicate cap"
|
||||
desc = "A black cap fit for a high ranking syndicate officer."
|
||||
|
||||
/obj/item/clothing/head/HoS/beret
|
||||
name = "head of security beret"
|
||||
desc = "A robust beret for the Head of Security, for looking stylish while not sacrificing protection."
|
||||
icon_state = "hosberetblack"
|
||||
|
||||
/obj/item/clothing/head/HoS/beret/syndicate
|
||||
name = "syndicate beret"
|
||||
desc = "A black beret with thick armor padding inside. Stylish and robust."
|
||||
|
||||
/obj/item/clothing/head/warden
|
||||
name = "warden's police hat"
|
||||
desc = "It's a special armored hat issued to the Warden of a security force. Protects the head from impacts."
|
||||
icon_state = "policehelm"
|
||||
armor = list("melee" = 40, "bullet" = 30, "laser" = 30, "energy" = 10, "bomb" = 25, "bio" = 0, "rad" = 0, "fire" = 30, "acid" = 60)
|
||||
strip_delay = 60
|
||||
dog_fashion = /datum/dog_fashion/head/warden
|
||||
|
||||
/obj/item/clothing/head/warden/drill
|
||||
name = "warden's campaign hat"
|
||||
desc = "A special armored campaign hat with the security insignia emblazoned on it. Uses reinforced fabric to offer sufficient protection. Has the letters 'FMJ' enscribed on its side."
|
||||
icon_state = "wardendrill"
|
||||
item_state = "wardendrill"
|
||||
dog_fashion = null
|
||||
var/mode = DRILL_DEFAULT
|
||||
|
||||
/obj/item/clothing/head/warden/drill/screwdriver_act(mob/living/carbon/human/user, obj/item/I)
|
||||
if(..())
|
||||
return TRUE
|
||||
switch(mode)
|
||||
if(DRILL_DEFAULT)
|
||||
to_chat(user, "<span class='notice'>You set the voice circuit to the middle position.</span>")
|
||||
mode = DRILL_SHOUTING
|
||||
if(DRILL_SHOUTING)
|
||||
to_chat(user, "<span class='notice'>You set the voice circuit to the last position.</span>")
|
||||
mode = DRILL_YELLING
|
||||
if(DRILL_YELLING)
|
||||
to_chat(user, "<span class='notice'>You set the voice circuit to the first position.</span>")
|
||||
mode = DRILL_DEFAULT
|
||||
if(DRILL_CANADIAN)
|
||||
to_chat(user, "<span class='danger'>You adjust voice circuit but nothing happens, probably because it's broken.</span>")
|
||||
return TRUE
|
||||
|
||||
/obj/item/clothing/head/warden/drill/wirecutter_act(mob/living/user, obj/item/I)
|
||||
if(mode != DRILL_CANADIAN)
|
||||
to_chat(user, "<span class='danger'>You broke the voice circuit!</span>")
|
||||
mode = DRILL_CANADIAN
|
||||
return TRUE
|
||||
|
||||
/obj/item/clothing/head/warden/drill/equipped(mob/M, slot)
|
||||
. = ..()
|
||||
if (slot == SLOT_HEAD)
|
||||
RegisterSignal(M, COMSIG_MOB_SAY, .proc/handle_speech)
|
||||
else
|
||||
UnregisterSignal(M, COMSIG_MOB_SAY)
|
||||
|
||||
/obj/item/clothing/head/warden/drill/dropped(mob/M)
|
||||
. = ..()
|
||||
UnregisterSignal(M, COMSIG_MOB_SAY)
|
||||
|
||||
/obj/item/clothing/head/warden/drill/proc/handle_speech(datum/source, mob/speech_args)
|
||||
var/message = speech_args[SPEECH_MESSAGE]
|
||||
if(message[1] != "*")
|
||||
switch (mode)
|
||||
if(DRILL_SHOUTING)
|
||||
message += "!"
|
||||
if(DRILL_YELLING)
|
||||
message += "!!"
|
||||
if(DRILL_CANADIAN)
|
||||
message = " [message]"
|
||||
var/list/canadian_words = strings("canadian_replacement.json", "canadian")
|
||||
|
||||
for(var/key in canadian_words)
|
||||
var/value = canadian_words[key]
|
||||
if(islist(value))
|
||||
value = pick(value)
|
||||
|
||||
message = replacetextEx(message, " [uppertext(key)]", " [uppertext(value)]")
|
||||
message = replacetextEx(message, " [capitalize(key)]", " [capitalize(value)]")
|
||||
message = replacetextEx(message, " [key]", " [value]")
|
||||
|
||||
if(prob(30))
|
||||
message += pick(", eh?", ", EH?")
|
||||
speech_args[SPEECH_MESSAGE] = message
|
||||
|
||||
/obj/item/clothing/head/beret/sec
|
||||
name = "security beret"
|
||||
desc = "A robust beret with the security insignia emblazoned on it. Uses reinforced fabric to offer sufficient protection."
|
||||
icon_state = "beret_badge"
|
||||
armor = list("melee" = 40, "bullet" = 30, "laser" = 30,"energy" = 10, "bomb" = 25, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 50)
|
||||
strip_delay = 60
|
||||
dog_fashion = null
|
||||
|
||||
/obj/item/clothing/head/beret/sec/navyhos
|
||||
name = "head of security's beret"
|
||||
desc = "A special beret with the Head of Security's insignia emblazoned on it. A symbol of excellence, a badge of courage, a mark of distinction."
|
||||
icon_state = "hosberet"
|
||||
|
||||
/obj/item/clothing/head/beret/sec/navywarden
|
||||
name = "warden's beret"
|
||||
desc = "A special beret with the Warden's insignia emblazoned on it. For wardens with class."
|
||||
icon_state = "wardenberet"
|
||||
armor = list("melee" = 40, "bullet" = 30, "laser" = 30, "energy" = 10, "bomb" = 25, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 50)
|
||||
strip_delay = 60
|
||||
|
||||
/obj/item/clothing/head/beret/sec/navyofficer
|
||||
desc = "A special beret with the security insignia emblazoned on it. For officers with class."
|
||||
icon_state = "officerberet"
|
||||
|
||||
/obj/item/clothing/head/beret/sec/bitch
|
||||
name = "security's bitch beret"
|
||||
desc = "A softer beret with the word 'BITCH' embroidered on it in pink thread."
|
||||
icon_state = "bitchberet"
|
||||
|
||||
//Curator
|
||||
/obj/item/clothing/head/fedora/curator
|
||||
name = "treasure hunter's fedora"
|
||||
desc = "You got red text today kid, but it doesn't mean you have to like it."
|
||||
icon_state = "curator"
|
||||
|
||||
//Chief Medical Officer
|
||||
/obj/item/clothing/head/beret/cmo
|
||||
name = "chief medical officer's beret"
|
||||
desc = "A fancy beret with a green cross, signifying your status in the station's medbay."
|
||||
icon_state = "cmoberet"
|
||||
|
||||
//Research Director
|
||||
/obj/item/clothing/head/beret/rd
|
||||
name = "research director's beret"
|
||||
desc = "A beret worn only by highly intelligent people."
|
||||
icon_state = "rdberet"
|
||||
|
||||
//Chief Engineer
|
||||
/obj/item/clothing/head/beret/ce
|
||||
name = "chief engineer's beret"
|
||||
desc = "A beret that will surely make you look way cooler than a hard hat, although lack of protection is the price."
|
||||
icon_state = "ceberet"
|
||||
|
||||
//Quartermaster
|
||||
/obj/item/clothing/head/beret/qm
|
||||
name = "quartermaster's beret"
|
||||
desc = "This headwear shows off your Cargonian leadership"
|
||||
icon_state = "qmberet"
|
||||
|
||||
/obj/item/clothing/head/beret/durathread
|
||||
name = "durathread beret"
|
||||
desc = "A beret made from durathread, its resilient fibres provide some protection to the wearer."
|
||||
icon_state = "beretdurathread"
|
||||
item_color = null
|
||||
armor = list("melee" = 25, "bullet" = 10, "laser" = 20,"energy" = 10, "bomb" = 30, "bio" = 15, "rad" = 20, "fire" = 100, "acid" = 50)
|
||||
|
||||
#undef DRILL_DEFAULT
|
||||
#undef DRILL_SHOUTING
|
||||
#undef DRILL_YELLING
|
||||
#undef DRILL_CANADIAN
|
||||
|
||||
@@ -1,142 +1,142 @@
|
||||
/obj/item/clothing/head/soft
|
||||
name = "cargo cap"
|
||||
desc = "It's a baseball hat in a tasteless yellow colour."
|
||||
icon_state = "cargosoft"
|
||||
item_state = "helmet"
|
||||
item_color = "cargo"
|
||||
|
||||
dog_fashion = /datum/dog_fashion/head/cargo_tech
|
||||
|
||||
var/flipped = 0
|
||||
|
||||
/obj/item/clothing/head/soft/dropped()
|
||||
src.icon_state = "[item_color]soft"
|
||||
src.flipped=0
|
||||
..()
|
||||
|
||||
/obj/item/clothing/head/soft/verb/flipcap()
|
||||
set category = "Object"
|
||||
set name = "Flip cap"
|
||||
|
||||
flip(usr)
|
||||
|
||||
|
||||
/obj/item/clothing/head/soft/AltClick(mob/user)
|
||||
..()
|
||||
if(!user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||
return
|
||||
else
|
||||
flip(user)
|
||||
|
||||
|
||||
/obj/item/clothing/head/soft/proc/flip(mob/user)
|
||||
if(!user.incapacitated())
|
||||
src.flipped = !src.flipped
|
||||
if(src.flipped)
|
||||
icon_state = "[item_color]soft_flipped"
|
||||
to_chat(user, "<span class='notice'>You flip the hat backwards.</span>")
|
||||
else
|
||||
icon_state = "[item_color]soft"
|
||||
to_chat(user, "<span class='notice'>You flip the hat back in normal position.</span>")
|
||||
usr.update_inv_head() //so our mob-overlays update
|
||||
|
||||
/obj/item/clothing/head/soft/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>Alt-click the cap to flip it [flipped ? "forwards" : "backwards"].</span>"
|
||||
|
||||
/obj/item/clothing/head/soft/red
|
||||
name = "red cap"
|
||||
desc = "It's a baseball hat in a tasteless red colour."
|
||||
icon_state = "redsoft"
|
||||
item_color = "red"
|
||||
dog_fashion = null
|
||||
|
||||
/obj/item/clothing/head/soft/blue
|
||||
name = "blue cap"
|
||||
desc = "It's a baseball hat in a tasteless blue colour."
|
||||
icon_state = "bluesoft"
|
||||
item_color = "blue"
|
||||
dog_fashion = null
|
||||
|
||||
/obj/item/clothing/head/soft/green
|
||||
name = "green cap"
|
||||
desc = "It's a baseball hat in a tasteless green colour."
|
||||
icon_state = "greensoft"
|
||||
item_color = "green"
|
||||
dog_fashion = null
|
||||
|
||||
/obj/item/clothing/head/soft/yellow
|
||||
name = "yellow cap"
|
||||
desc = "It's a baseball hat in a tasteless yellow colour."
|
||||
icon_state = "yellowsoft"
|
||||
item_color = "yellow"
|
||||
dog_fashion = null
|
||||
|
||||
/obj/item/clothing/head/soft/grey
|
||||
name = "grey cap"
|
||||
desc = "It's a baseball hat in a tasteful grey colour."
|
||||
icon_state = "greysoft"
|
||||
item_color = "grey"
|
||||
dog_fashion = null
|
||||
|
||||
/obj/item/clothing/head/soft/orange
|
||||
name = "orange cap"
|
||||
desc = "It's a baseball hat in a tasteless orange colour."
|
||||
icon_state = "orangesoft"
|
||||
item_color = "orange"
|
||||
dog_fashion = null
|
||||
|
||||
/obj/item/clothing/head/soft/mime
|
||||
name = "white cap"
|
||||
desc = "It's a baseball hat in a tasteless white colour."
|
||||
icon_state = "mimesoft"
|
||||
item_color = "mime"
|
||||
dog_fashion = null
|
||||
|
||||
/obj/item/clothing/head/soft/purple
|
||||
name = "purple cap"
|
||||
desc = "It's a baseball hat in a tasteless purple colour."
|
||||
icon_state = "purplesoft"
|
||||
item_color = "purple"
|
||||
dog_fashion = null
|
||||
|
||||
/obj/item/clothing/head/soft/black
|
||||
name = "black cap"
|
||||
desc = "It's a baseball hat in a tasteless black colour."
|
||||
icon_state = "blacksoft"
|
||||
item_color = "black"
|
||||
dog_fashion = null
|
||||
|
||||
/obj/item/clothing/head/soft/rainbow
|
||||
name = "rainbow cap"
|
||||
desc = "It's a baseball hat in a bright rainbow of colors."
|
||||
icon_state = "rainbowsoft"
|
||||
item_color = "rainbow"
|
||||
dog_fashion = null
|
||||
|
||||
/obj/item/clothing/head/soft/sec
|
||||
name = "security cap"
|
||||
desc = "It's a robust baseball hat in tasteful red colour."
|
||||
icon_state = "secsoft"
|
||||
item_color = "sec"
|
||||
armor = list("melee" = 30, "bullet" = 25, "laser" = 25, "energy" = 10, "bomb" = 25, "bio" = 0, "rad" = 0, "fire" = 20, "acid" = 50)
|
||||
strip_delay = 60
|
||||
dog_fashion = null
|
||||
|
||||
/obj/item/clothing/head/soft/emt
|
||||
name = "paramedic cap"
|
||||
desc = "It's a baseball hat with a dark turquoise color and a reflective cross on the top."
|
||||
icon_state = "emtsoft"
|
||||
item_color = "emt"
|
||||
dog_fashion = null
|
||||
|
||||
/obj/item/clothing/head/soft/baseball
|
||||
name = "baseball cap"
|
||||
desc = "It's a robust baseball hat, this one belongs to syndicate major league team."
|
||||
icon_state = "baseballsoft"
|
||||
item_color = "baseballsoft"
|
||||
item_state = "baseballsoft"
|
||||
flags_inv = HIDEEYES|HIDEFACE
|
||||
armor = list("melee" = 35, "bullet" = 35, "laser" = 25, "energy" = 10, "bomb" = 25, "bio" = 0, "rad" = 0, "fire" = 20, "acid" = 90)
|
||||
strip_delay = 90 //You dont take a Major Leage cap
|
||||
dog_fashion = null
|
||||
/obj/item/clothing/head/soft
|
||||
name = "cargo cap"
|
||||
desc = "It's a baseball hat in a tasteless yellow colour."
|
||||
icon_state = "cargosoft"
|
||||
item_state = "helmet"
|
||||
item_color = "cargo"
|
||||
|
||||
dog_fashion = /datum/dog_fashion/head/cargo_tech
|
||||
|
||||
var/flipped = 0
|
||||
|
||||
/obj/item/clothing/head/soft/dropped()
|
||||
src.icon_state = "[item_color]soft"
|
||||
src.flipped=0
|
||||
..()
|
||||
|
||||
/obj/item/clothing/head/soft/verb/flipcap()
|
||||
set category = "Object"
|
||||
set name = "Flip cap"
|
||||
|
||||
flip(usr)
|
||||
|
||||
|
||||
/obj/item/clothing/head/soft/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(!user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||
return
|
||||
flip(user)
|
||||
return TRUE
|
||||
|
||||
|
||||
/obj/item/clothing/head/soft/proc/flip(mob/user)
|
||||
if(!user.incapacitated())
|
||||
src.flipped = !src.flipped
|
||||
if(src.flipped)
|
||||
icon_state = "[item_color]soft_flipped"
|
||||
to_chat(user, "<span class='notice'>You flip the hat backwards.</span>")
|
||||
else
|
||||
icon_state = "[item_color]soft"
|
||||
to_chat(user, "<span class='notice'>You flip the hat back in normal position.</span>")
|
||||
usr.update_inv_head() //so our mob-overlays update
|
||||
|
||||
/obj/item/clothing/head/soft/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>Alt-click the cap to flip it [flipped ? "forwards" : "backwards"].</span>"
|
||||
|
||||
/obj/item/clothing/head/soft/red
|
||||
name = "red cap"
|
||||
desc = "It's a baseball hat in a tasteless red colour."
|
||||
icon_state = "redsoft"
|
||||
item_color = "red"
|
||||
dog_fashion = null
|
||||
|
||||
/obj/item/clothing/head/soft/blue
|
||||
name = "blue cap"
|
||||
desc = "It's a baseball hat in a tasteless blue colour."
|
||||
icon_state = "bluesoft"
|
||||
item_color = "blue"
|
||||
dog_fashion = null
|
||||
|
||||
/obj/item/clothing/head/soft/green
|
||||
name = "green cap"
|
||||
desc = "It's a baseball hat in a tasteless green colour."
|
||||
icon_state = "greensoft"
|
||||
item_color = "green"
|
||||
dog_fashion = null
|
||||
|
||||
/obj/item/clothing/head/soft/yellow
|
||||
name = "yellow cap"
|
||||
desc = "It's a baseball hat in a tasteless yellow colour."
|
||||
icon_state = "yellowsoft"
|
||||
item_color = "yellow"
|
||||
dog_fashion = null
|
||||
|
||||
/obj/item/clothing/head/soft/grey
|
||||
name = "grey cap"
|
||||
desc = "It's a baseball hat in a tasteful grey colour."
|
||||
icon_state = "greysoft"
|
||||
item_color = "grey"
|
||||
dog_fashion = null
|
||||
|
||||
/obj/item/clothing/head/soft/orange
|
||||
name = "orange cap"
|
||||
desc = "It's a baseball hat in a tasteless orange colour."
|
||||
icon_state = "orangesoft"
|
||||
item_color = "orange"
|
||||
dog_fashion = null
|
||||
|
||||
/obj/item/clothing/head/soft/mime
|
||||
name = "white cap"
|
||||
desc = "It's a baseball hat in a tasteless white colour."
|
||||
icon_state = "mimesoft"
|
||||
item_color = "mime"
|
||||
dog_fashion = null
|
||||
|
||||
/obj/item/clothing/head/soft/purple
|
||||
name = "purple cap"
|
||||
desc = "It's a baseball hat in a tasteless purple colour."
|
||||
icon_state = "purplesoft"
|
||||
item_color = "purple"
|
||||
dog_fashion = null
|
||||
|
||||
/obj/item/clothing/head/soft/black
|
||||
name = "black cap"
|
||||
desc = "It's a baseball hat in a tasteless black colour."
|
||||
icon_state = "blacksoft"
|
||||
item_color = "black"
|
||||
dog_fashion = null
|
||||
|
||||
/obj/item/clothing/head/soft/rainbow
|
||||
name = "rainbow cap"
|
||||
desc = "It's a baseball hat in a bright rainbow of colors."
|
||||
icon_state = "rainbowsoft"
|
||||
item_color = "rainbow"
|
||||
dog_fashion = null
|
||||
|
||||
/obj/item/clothing/head/soft/sec
|
||||
name = "security cap"
|
||||
desc = "It's a robust baseball hat in tasteful red colour."
|
||||
icon_state = "secsoft"
|
||||
item_color = "sec"
|
||||
armor = list("melee" = 30, "bullet" = 25, "laser" = 25, "energy" = 10, "bomb" = 25, "bio" = 0, "rad" = 0, "fire" = 20, "acid" = 50)
|
||||
strip_delay = 60
|
||||
dog_fashion = null
|
||||
|
||||
/obj/item/clothing/head/soft/emt
|
||||
name = "paramedic cap"
|
||||
desc = "It's a baseball hat with a dark turquoise color and a reflective cross on the top."
|
||||
icon_state = "emtsoft"
|
||||
item_color = "emt"
|
||||
dog_fashion = null
|
||||
|
||||
/obj/item/clothing/head/soft/baseball
|
||||
name = "baseball cap"
|
||||
desc = "It's a robust baseball hat, this one belongs to syndicate major league team."
|
||||
icon_state = "baseballsoft"
|
||||
item_color = "baseballsoft"
|
||||
item_state = "baseballsoft"
|
||||
flags_inv = HIDEEYES|HIDEFACE
|
||||
armor = list("melee" = 35, "bullet" = 35, "laser" = 25, "energy" = 10, "bomb" = 25, "bio" = 0, "rad" = 0, "fire" = 20, "acid" = 90)
|
||||
strip_delay = 90 //You dont take a Major Leage cap
|
||||
dog_fashion = null
|
||||
|
||||
@@ -1,42 +1,42 @@
|
||||
/obj/item/clothing/mask/breath
|
||||
desc = "A close-fitting mask that can be connected to an air supply."
|
||||
name = "breath mask"
|
||||
icon_state = "breath"
|
||||
item_state = "m_mask"
|
||||
body_parts_covered = 0
|
||||
clothing_flags = ALLOWINTERNALS
|
||||
visor_flags = ALLOWINTERNALS
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
gas_transfer_coefficient = 0.1
|
||||
permeability_coefficient = 0.5
|
||||
actions_types = list(/datum/action/item_action/adjust)
|
||||
flags_cover = MASKCOVERSMOUTH
|
||||
visor_flags_cover = MASKCOVERSMOUTH
|
||||
resistance_flags = NONE
|
||||
mutantrace_variation = MUTANTRACE_VARIATION
|
||||
|
||||
/obj/item/clothing/mask/breath/suicide_act(mob/living/carbon/user)
|
||||
user.visible_message("<span class='suicide'>[user] is wrapping \the [src]'s tube around [user.p_their()] neck! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
return OXYLOSS
|
||||
|
||||
/obj/item/clothing/mask/breath/attack_self(mob/user)
|
||||
adjustmask(user)
|
||||
|
||||
/obj/item/clothing/mask/breath/AltClick(mob/user)
|
||||
..()
|
||||
if(!user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||
return
|
||||
else
|
||||
adjustmask(user)
|
||||
|
||||
/obj/item/clothing/mask/breath/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>Alt-click [src] to adjust it.</span>"
|
||||
|
||||
/obj/item/clothing/mask/breath/medical
|
||||
desc = "A close-fitting sterile mask that can be connected to an air supply."
|
||||
name = "medical mask"
|
||||
icon_state = "medical"
|
||||
item_state = "m_mask"
|
||||
permeability_coefficient = 0.01
|
||||
equip_delay_other = 10
|
||||
/obj/item/clothing/mask/breath
|
||||
desc = "A close-fitting mask that can be connected to an air supply."
|
||||
name = "breath mask"
|
||||
icon_state = "breath"
|
||||
item_state = "m_mask"
|
||||
body_parts_covered = 0
|
||||
clothing_flags = ALLOWINTERNALS
|
||||
visor_flags = ALLOWINTERNALS
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
gas_transfer_coefficient = 0.1
|
||||
permeability_coefficient = 0.5
|
||||
actions_types = list(/datum/action/item_action/adjust)
|
||||
flags_cover = MASKCOVERSMOUTH
|
||||
visor_flags_cover = MASKCOVERSMOUTH
|
||||
resistance_flags = NONE
|
||||
mutantrace_variation = MUTANTRACE_VARIATION
|
||||
|
||||
/obj/item/clothing/mask/breath/suicide_act(mob/living/carbon/user)
|
||||
user.visible_message("<span class='suicide'>[user] is wrapping \the [src]'s tube around [user.p_their()] neck! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
return OXYLOSS
|
||||
|
||||
/obj/item/clothing/mask/breath/attack_self(mob/user)
|
||||
adjustmask(user)
|
||||
|
||||
/obj/item/clothing/mask/breath/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(!user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||
return
|
||||
adjustmask(user)
|
||||
return TRUE
|
||||
|
||||
/obj/item/clothing/mask/breath/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>Alt-click [src] to adjust it.</span>"
|
||||
|
||||
/obj/item/clothing/mask/breath/medical
|
||||
desc = "A close-fitting sterile mask that can be connected to an air supply."
|
||||
name = "medical mask"
|
||||
icon_state = "medical"
|
||||
item_state = "m_mask"
|
||||
permeability_coefficient = 0.01
|
||||
equip_delay_other = 10
|
||||
|
||||
@@ -865,3 +865,126 @@
|
||||
strip_delay = 130
|
||||
max_heat_protection_temperature = FIRE_IMMUNITY_MAX_TEMP_PROTECT
|
||||
actions_types = list()
|
||||
|
||||
/*
|
||||
CYDONIAN ARMOR THAT IS RGB AND STUFF WOOOOOOOOOO
|
||||
*/
|
||||
|
||||
/obj/item/clothing/head/helmet/space/hardsuit/lavaknight
|
||||
name = "cydonian helmet"
|
||||
desc = "A helmet designed with both form and function in mind, it protects the user against physical trauma and hazardous conditions while also having polychromic light strips."
|
||||
icon_state = "knight_cydonia"
|
||||
item_state = "knight_yellow"
|
||||
item_color = null
|
||||
max_heat_protection_temperature = FIRE_SUIT_MAX_TEMP_PROTECT
|
||||
resistance_flags = FIRE_PROOF | LAVA_PROOF
|
||||
heat_protection = HEAD
|
||||
armor = list(melee = 50, bullet = 10, laser = 10, energy = 10, bomb = 50, bio = 100, rad = 50, fire = 100, acid = 100)
|
||||
brightness_on = 7
|
||||
allowed = list(/obj/item/flashlight, /obj/item/tank/internals, /obj/item/resonator, /obj/item/mining_scanner, /obj/item/t_scanner/adv_mining_scanner, /obj/item/gun/energy/kinetic_accelerator)
|
||||
var/energy_color = "#35FFF0"
|
||||
var/obj/item/clothing/suit/space/hardsuit/lavaknight/linkedsuit = null
|
||||
mutantrace_variation = NO_MUTANTRACE_VARIATION
|
||||
|
||||
/obj/item/clothing/head/helmet/space/hardsuit/lavaknight/Initialize()
|
||||
. = ..()
|
||||
if(istype(loc, /obj/item/clothing/suit/space/hardsuit/lavaknight))
|
||||
var/obj/item/clothing/suit/space/hardsuit/lavaknight/S = loc
|
||||
energy_color = S.energy_color
|
||||
update_icon()
|
||||
|
||||
/obj/item/clothing/head/helmet/space/hardsuit/lavaknight/attack_self(mob/user)
|
||||
on = !on
|
||||
|
||||
if(on)
|
||||
set_light(brightness_on)
|
||||
else
|
||||
set_light(0)
|
||||
for(var/X in actions)
|
||||
var/datum/action/A = X
|
||||
A.UpdateButtonIcon()
|
||||
|
||||
/obj/item/clothing/head/helmet/space/hardsuit/lavaknight/update_icon()
|
||||
var/mutable_appearance/helm_overlay = mutable_appearance(icon, "knight_cydonia_overlay")
|
||||
|
||||
if(energy_color)
|
||||
helm_overlay.color = energy_color
|
||||
|
||||
cut_overlays() //So that it doesn't keep stacking overlays non-stop on top of each other
|
||||
|
||||
add_overlay(helm_overlay)
|
||||
|
||||
/obj/item/clothing/head/helmet/space/hardsuit/lavaknight/worn_overlays(isinhands = FALSE, icon_file)
|
||||
. = ..()
|
||||
if(!isinhands)
|
||||
var/mutable_appearance/energy_overlay = mutable_appearance(icon_file, "knight_cydonia_overlay", ABOVE_LIGHTING_LAYER)
|
||||
energy_overlay.plane = ABOVE_LIGHTING_LAYER
|
||||
energy_overlay.color = energy_color
|
||||
. += energy_overlay
|
||||
|
||||
/obj/item/clothing/suit/space/hardsuit/lavaknight
|
||||
icon_state = "knight_cydonia"
|
||||
name = "cydonian armor"
|
||||
desc = "A suit designed with both form and function in mind, it protects the user against physical trauma and hazardous conditions while also having polychromic light strips."
|
||||
item_state = "swat_suit"
|
||||
max_heat_protection_temperature = FIRE_SUIT_MAX_TEMP_PROTECT
|
||||
resistance_flags = FIRE_PROOF | LAVA_PROOF
|
||||
armor = list(melee = 50, bullet = 10, laser = 10, energy = 10, bomb = 50, bio = 100, rad = 50, fire = 100, acid = 100)
|
||||
allowed = list(/obj/item/flashlight, /obj/item/tank/internals, /obj/item/storage/bag/ore, /obj/item/pickaxe)
|
||||
helmettype = /obj/item/clothing/head/helmet/space/hardsuit/lavaknight
|
||||
heat_protection = CHEST|GROIN|LEGS|FEET|ARMS|HANDS
|
||||
tauric = TRUE //Citadel Add for tauric hardsuits
|
||||
|
||||
var/energy_color = "#35FFF0"
|
||||
|
||||
/obj/item/clothing/suit/space/hardsuit/lavaknight/Initialize()
|
||||
..()
|
||||
light_color = energy_color
|
||||
set_light(1)
|
||||
update_icon()
|
||||
|
||||
/obj/item/clothing/suit/space/hardsuit/lavaknight/update_icon()
|
||||
var/mutable_appearance/suit_overlay = mutable_appearance(icon, "knight_cydonia_overlay")
|
||||
|
||||
if(energy_color)
|
||||
suit_overlay.color = energy_color
|
||||
|
||||
cut_overlays() //So that it doesn't keep stacking overlays non-stop on top of each other
|
||||
|
||||
add_overlay(suit_overlay)
|
||||
|
||||
/obj/item/clothing/suit/space/hardsuit/lavaknight/worn_overlays(isinhands = FALSE, icon_file)
|
||||
. = ..()
|
||||
if(!isinhands)
|
||||
var/mutable_appearance/energy_overlay = mutable_appearance(icon_file, "knight_cydonia_overlay", ABOVE_LIGHTING_LAYER)
|
||||
energy_overlay.plane = ABOVE_LIGHTING_LAYER
|
||||
energy_overlay.color = energy_color
|
||||
. += energy_overlay
|
||||
|
||||
/obj/item/clothing/suit/space/hardsuit/lavaknight/AltClick(mob/living/user)
|
||||
. = ..()
|
||||
if(!in_range(src, user) || !istype(user))
|
||||
return
|
||||
if(user.incapacitated())
|
||||
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
|
||||
return TRUE
|
||||
|
||||
if(alert("Are you sure you want to recolor your armor stripes?", "Confirm Repaint", "Yes", "No") == "Yes")
|
||||
var/energy_color_input = input(usr,"","Choose Energy Color",energy_color) as color|null
|
||||
if(energy_color_input)
|
||||
energy_color = sanitize_hexcolor(energy_color_input, desired_format=6, include_crunch=1)
|
||||
user.update_inv_wear_suit()
|
||||
if(helmet)
|
||||
var/obj/item/clothing/head/helmet/space/hardsuit/lavaknight/H = helmet
|
||||
H.energy_color = energy_color
|
||||
user.update_inv_head()
|
||||
H.update_icon()
|
||||
update_icon()
|
||||
user.update_inv_wear_suit()
|
||||
light_color = energy_color
|
||||
update_light()
|
||||
return TRUE
|
||||
|
||||
/obj/item/clothing/suit/space/hardsuit/lavaknight/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>Alt-click to recolor it.</span>"
|
||||
|
||||
@@ -92,11 +92,11 @@
|
||||
//Toggle exosuits for different aesthetic styles (hoodies, suit jacket buttons, etc)
|
||||
|
||||
/obj/item/clothing/suit/toggle/AltClick(mob/user)
|
||||
..()
|
||||
. = ..()
|
||||
if(!user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||
return
|
||||
else
|
||||
suit_toggle(user)
|
||||
suit_toggle(user)
|
||||
return TRUE
|
||||
|
||||
/obj/item/clothing/suit/toggle/ui_action_click()
|
||||
suit_toggle()
|
||||
|
||||
@@ -67,10 +67,12 @@
|
||||
return
|
||||
|
||||
/obj/item/clothing/accessory/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(istype(user) && user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||
if(initial(above_suit))
|
||||
above_suit = !above_suit
|
||||
to_chat(user, "[src] will be worn [above_suit ? "above" : "below"] your suit.")
|
||||
return TRUE
|
||||
|
||||
/obj/item/clothing/accessory/examine(mob/user)
|
||||
. = ..()
|
||||
|
||||
@@ -1,217 +1,219 @@
|
||||
//CONTAINS: Detective's Scanner
|
||||
|
||||
// TODO: Split everything into easy to manage procs.
|
||||
|
||||
/obj/item/detective_scanner
|
||||
name = "forensic scanner"
|
||||
desc = "Used to remotely scan objects and biomass for DNA and fingerprints. Can print a report of the findings."
|
||||
icon = 'icons/obj/device.dmi'
|
||||
icon_state = "forensicnew"
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
item_state = "electronic"
|
||||
lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
|
||||
flags_1 = CONDUCT_1
|
||||
item_flags = NOBLUDGEON
|
||||
slot_flags = ITEM_SLOT_BELT
|
||||
var/scanning = FALSE
|
||||
var/list/log = list()
|
||||
var/range = 8
|
||||
var/view_check = TRUE
|
||||
actions_types = list(/datum/action/item_action/displayDetectiveScanResults)
|
||||
|
||||
/datum/action/item_action/displayDetectiveScanResults
|
||||
name = "Display Forensic Scanner Results"
|
||||
|
||||
/datum/action/item_action/displayDetectiveScanResults/Trigger()
|
||||
var/obj/item/detective_scanner/scanner = target
|
||||
if(istype(scanner))
|
||||
scanner.displayDetectiveScanResults(usr)
|
||||
|
||||
/obj/item/detective_scanner/attack_self(mob/user)
|
||||
if(log.len && !scanning)
|
||||
scanning = TRUE
|
||||
to_chat(user, "<span class='notice'>Printing report, please wait...</span>")
|
||||
addtimer(CALLBACK(src, .proc/PrintReport), 100)
|
||||
else
|
||||
to_chat(user, "<span class='notice'>The scanner has no logs or is in use.</span>")
|
||||
|
||||
/obj/item/detective_scanner/attack(mob/living/M, mob/user)
|
||||
return
|
||||
|
||||
/obj/item/detective_scanner/proc/PrintReport()
|
||||
// Create our paper
|
||||
var/obj/item/paper/P = new(get_turf(src))
|
||||
P.name = "paper- 'Scanner Report'"
|
||||
P.info = "<center><font size='6'><B>Scanner Report</B></font></center><HR><BR>"
|
||||
P.info += jointext(log, "<BR>")
|
||||
P.info += "<HR><B>Notes:</B><BR>"
|
||||
P.info_links = P.info
|
||||
P.updateinfolinks()
|
||||
|
||||
if(ismob(loc))
|
||||
var/mob/M = loc
|
||||
M.put_in_hands(P)
|
||||
to_chat(M, "<span class='notice'>Report printed. Log cleared.</span>")
|
||||
|
||||
// Clear the logs
|
||||
log = list()
|
||||
scanning = FALSE
|
||||
|
||||
/obj/item/detective_scanner/afterattack(atom/A, mob/user, params)
|
||||
. = ..()
|
||||
scan(A, user)
|
||||
return FALSE
|
||||
|
||||
/obj/item/detective_scanner/proc/scan(atom/A, mob/user)
|
||||
set waitfor = 0
|
||||
if(!scanning)
|
||||
// Can remotely scan objects and mobs.
|
||||
if((get_dist(A, user) > range) || (!(A in view(range, user)) && view_check) || (loc != user))
|
||||
return
|
||||
|
||||
scanning = TRUE
|
||||
|
||||
user.visible_message("\The [user] points the [src.name] at \the [A] and performs a forensic scan.")
|
||||
to_chat(user, "<span class='notice'>You scan \the [A]. The scanner is now analysing the results...</span>")
|
||||
|
||||
|
||||
// GATHER INFORMATION
|
||||
|
||||
//Make our lists
|
||||
var/list/fingerprints = list()
|
||||
var/list/blood = list()
|
||||
var/list/fibers = list()
|
||||
var/list/reagents = list()
|
||||
|
||||
var/target_name = A.name
|
||||
|
||||
// Start gathering
|
||||
|
||||
if(A.blood_DNA && A.blood_DNA.len)
|
||||
blood = A.blood_DNA.Copy()
|
||||
|
||||
if(A.suit_fibers && A.suit_fibers.len)
|
||||
fibers = A.suit_fibers.Copy()
|
||||
|
||||
if(ishuman(A))
|
||||
|
||||
var/mob/living/carbon/human/H = A
|
||||
if(!H.gloves)
|
||||
fingerprints += md5(H.dna.uni_identity)
|
||||
|
||||
else if(!ismob(A))
|
||||
|
||||
if(A.fingerprints && A.fingerprints.len)
|
||||
fingerprints = A.fingerprints.Copy()
|
||||
|
||||
// Only get reagents from non-mobs.
|
||||
if(A.reagents && A.reagents.reagent_list.len)
|
||||
|
||||
for(var/datum/reagent/R in A.reagents.reagent_list)
|
||||
reagents[R.name] = R.volume
|
||||
|
||||
// Get blood data from the blood reagent.
|
||||
if(istype(R, /datum/reagent/blood))
|
||||
|
||||
if(R.data["blood_DNA"] && R.data["blood_type"])
|
||||
var/blood_DNA = R.data["blood_DNA"]
|
||||
var/blood_type = R.data["blood_type"]
|
||||
LAZYINITLIST(blood)
|
||||
blood[blood_DNA] = blood_type
|
||||
|
||||
// We gathered everything. Create a fork and slowly display the results to the holder of the scanner.
|
||||
|
||||
var/found_something = FALSE
|
||||
add_log("<B>[STATION_TIME_TIMESTAMP("hh:mm:ss")][get_timestamp()] - [target_name]</B>", 0)
|
||||
|
||||
// Fingerprints
|
||||
if(length(fingerprints))
|
||||
sleep(3 SECONDS)
|
||||
add_log("<span class='info'><B>Prints:</B></span>")
|
||||
for(var/finger in fingerprints)
|
||||
add_log("[finger]")
|
||||
found_something = TRUE
|
||||
|
||||
// Blood
|
||||
if (length(blood))
|
||||
sleep(3 SECONDS)
|
||||
add_log("<span class='info'><B>Blood:</B></span>")
|
||||
found_something = TRUE
|
||||
for(var/B in blood)
|
||||
add_log("Type: <font color='red'>[blood[B]]</font> DNA: <font color='red'>[B]</font>")
|
||||
|
||||
//Fibers
|
||||
if(length(fibers))
|
||||
sleep(3 SECONDS)
|
||||
add_log("<span class='info'><B>Fibers:</B></span>")
|
||||
for(var/fiber in fibers)
|
||||
add_log("[fiber]")
|
||||
found_something = TRUE
|
||||
|
||||
//Reagents
|
||||
if(length(reagents))
|
||||
sleep(3 SECONDS)
|
||||
add_log("<span class='info'><B>Reagents:</B></span>")
|
||||
for(var/R in reagents)
|
||||
add_log("Reagent: <font color='red'>[R]</font> Volume: <font color='red'>[reagents[R]]</font>")
|
||||
found_something = TRUE
|
||||
|
||||
// Get a new user
|
||||
var/mob/holder = null
|
||||
if(ismob(src.loc))
|
||||
holder = src.loc
|
||||
|
||||
if(!found_something)
|
||||
add_log("<I># No forensic traces found #</I>", 0) // Don't display this to the holder user
|
||||
if(holder)
|
||||
to_chat(holder, "<span class='warning'>Unable to locate any fingerprints, materials, fibers, or blood on \the [target_name]!</span>")
|
||||
else
|
||||
if(holder)
|
||||
to_chat(holder, "<span class='notice'>You finish scanning \the [target_name].</span>")
|
||||
|
||||
add_log("---------------------------------------------------------", 0)
|
||||
scanning = FALSE
|
||||
return
|
||||
|
||||
/obj/item/detective_scanner/proc/add_log(msg, broadcast = TRUE)
|
||||
if(scanning)
|
||||
if(broadcast && ismob(loc))
|
||||
var/mob/M = loc
|
||||
to_chat(M, msg)
|
||||
log += " [msg]"
|
||||
else
|
||||
CRASH("[src] [REF(src)] is adding a log when it was never put in scanning mode!")
|
||||
|
||||
/proc/get_timestamp()
|
||||
return time2text(world.time + 432000, ":ss")
|
||||
|
||||
/obj/item/detective_scanner/AltClick(mob/living/user)
|
||||
// Best way for checking if a player can use while not incapacitated, etc
|
||||
if(!user.canUseTopic(src, be_close=TRUE))
|
||||
return
|
||||
if(!LAZYLEN(log))
|
||||
to_chat(user, "<span class='notice'>Cannot clear logs, the scanner has no logs.</span>")
|
||||
return
|
||||
if(scanning)
|
||||
to_chat(user, "<span class='notice'>Cannot clear logs, the scanner is in use.</span>")
|
||||
return
|
||||
to_chat(user, "<span class='notice'>The scanner logs are cleared.</span>")
|
||||
log = list()
|
||||
|
||||
/obj/item/detective_scanner/examine(mob/user)
|
||||
. = ..()
|
||||
if(LAZYLEN(log) && !scanning)
|
||||
. += "<span class='notice'>Alt-click to clear scanner logs.</span>"
|
||||
|
||||
/obj/item/detective_scanner/proc/displayDetectiveScanResults(mob/living/user)
|
||||
// No need for can-use checks since the action button should do proper checks
|
||||
if(!LAZYLEN(log))
|
||||
to_chat(user, "<span class='notice'>Cannot display logs, the scanner has no logs.</span>")
|
||||
return
|
||||
if(scanning)
|
||||
to_chat(user, "<span class='notice'>Cannot display logs, the scanner is in use.</span>")
|
||||
return
|
||||
to_chat(user, "<span class='notice'><B>Scanner Report</B></span>")
|
||||
for(var/iterLog in log)
|
||||
to_chat(user, iterLog)
|
||||
//CONTAINS: Detective's Scanner
|
||||
|
||||
// TODO: Split everything into easy to manage procs.
|
||||
|
||||
/obj/item/detective_scanner
|
||||
name = "forensic scanner"
|
||||
desc = "Used to remotely scan objects and biomass for DNA and fingerprints. Can print a report of the findings."
|
||||
icon = 'icons/obj/device.dmi'
|
||||
icon_state = "forensicnew"
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
item_state = "electronic"
|
||||
lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
|
||||
flags_1 = CONDUCT_1
|
||||
item_flags = NOBLUDGEON
|
||||
slot_flags = ITEM_SLOT_BELT
|
||||
var/scanning = FALSE
|
||||
var/list/log = list()
|
||||
var/range = 8
|
||||
var/view_check = TRUE
|
||||
actions_types = list(/datum/action/item_action/displayDetectiveScanResults)
|
||||
|
||||
/datum/action/item_action/displayDetectiveScanResults
|
||||
name = "Display Forensic Scanner Results"
|
||||
|
||||
/datum/action/item_action/displayDetectiveScanResults/Trigger()
|
||||
var/obj/item/detective_scanner/scanner = target
|
||||
if(istype(scanner))
|
||||
scanner.displayDetectiveScanResults(usr)
|
||||
|
||||
/obj/item/detective_scanner/attack_self(mob/user)
|
||||
if(log.len && !scanning)
|
||||
scanning = TRUE
|
||||
to_chat(user, "<span class='notice'>Printing report, please wait...</span>")
|
||||
addtimer(CALLBACK(src, .proc/PrintReport), 100)
|
||||
else
|
||||
to_chat(user, "<span class='notice'>The scanner has no logs or is in use.</span>")
|
||||
|
||||
/obj/item/detective_scanner/attack(mob/living/M, mob/user)
|
||||
return
|
||||
|
||||
/obj/item/detective_scanner/proc/PrintReport()
|
||||
// Create our paper
|
||||
var/obj/item/paper/P = new(get_turf(src))
|
||||
P.name = "paper- 'Scanner Report'"
|
||||
P.info = "<center><font size='6'><B>Scanner Report</B></font></center><HR><BR>"
|
||||
P.info += jointext(log, "<BR>")
|
||||
P.info += "<HR><B>Notes:</B><BR>"
|
||||
P.info_links = P.info
|
||||
P.updateinfolinks()
|
||||
|
||||
if(ismob(loc))
|
||||
var/mob/M = loc
|
||||
M.put_in_hands(P)
|
||||
to_chat(M, "<span class='notice'>Report printed. Log cleared.</span>")
|
||||
|
||||
// Clear the logs
|
||||
log = list()
|
||||
scanning = FALSE
|
||||
|
||||
/obj/item/detective_scanner/afterattack(atom/A, mob/user, params)
|
||||
. = ..()
|
||||
scan(A, user)
|
||||
return FALSE
|
||||
|
||||
/obj/item/detective_scanner/proc/scan(atom/A, mob/user)
|
||||
set waitfor = 0
|
||||
if(!scanning)
|
||||
// Can remotely scan objects and mobs.
|
||||
if((get_dist(A, user) > range) || (!(A in view(range, user)) && view_check) || (loc != user))
|
||||
return
|
||||
|
||||
scanning = TRUE
|
||||
|
||||
user.visible_message("\The [user] points the [src.name] at \the [A] and performs a forensic scan.")
|
||||
to_chat(user, "<span class='notice'>You scan \the [A]. The scanner is now analysing the results...</span>")
|
||||
|
||||
|
||||
// GATHER INFORMATION
|
||||
|
||||
//Make our lists
|
||||
var/list/fingerprints = list()
|
||||
var/list/blood = list()
|
||||
var/list/fibers = list()
|
||||
var/list/reagents = list()
|
||||
|
||||
var/target_name = A.name
|
||||
|
||||
// Start gathering
|
||||
|
||||
if(A.blood_DNA && A.blood_DNA.len)
|
||||
blood = A.blood_DNA.Copy()
|
||||
|
||||
if(A.suit_fibers && A.suit_fibers.len)
|
||||
fibers = A.suit_fibers.Copy()
|
||||
|
||||
if(ishuman(A))
|
||||
|
||||
var/mob/living/carbon/human/H = A
|
||||
if(!H.gloves)
|
||||
fingerprints += md5(H.dna.uni_identity)
|
||||
|
||||
else if(!ismob(A))
|
||||
|
||||
if(A.fingerprints && A.fingerprints.len)
|
||||
fingerprints = A.fingerprints.Copy()
|
||||
|
||||
// Only get reagents from non-mobs.
|
||||
if(A.reagents && A.reagents.reagent_list.len)
|
||||
|
||||
for(var/datum/reagent/R in A.reagents.reagent_list)
|
||||
reagents[R.name] = R.volume
|
||||
|
||||
// Get blood data from the blood reagent.
|
||||
if(istype(R, /datum/reagent/blood))
|
||||
|
||||
if(R.data["blood_DNA"] && R.data["blood_type"])
|
||||
var/blood_DNA = R.data["blood_DNA"]
|
||||
var/blood_type = R.data["blood_type"]
|
||||
LAZYINITLIST(blood)
|
||||
blood[blood_DNA] = blood_type
|
||||
|
||||
// We gathered everything. Create a fork and slowly display the results to the holder of the scanner.
|
||||
|
||||
var/found_something = FALSE
|
||||
add_log("<B>[STATION_TIME_TIMESTAMP("hh:mm:ss")][get_timestamp()] - [target_name]</B>", 0)
|
||||
|
||||
// Fingerprints
|
||||
if(length(fingerprints))
|
||||
sleep(3 SECONDS)
|
||||
add_log("<span class='info'><B>Prints:</B></span>")
|
||||
for(var/finger in fingerprints)
|
||||
add_log("[finger]")
|
||||
found_something = TRUE
|
||||
|
||||
// Blood
|
||||
if (length(blood))
|
||||
sleep(3 SECONDS)
|
||||
add_log("<span class='info'><B>Blood:</B></span>")
|
||||
found_something = TRUE
|
||||
for(var/B in blood)
|
||||
add_log("Type: <font color='red'>[blood[B]]</font> DNA: <font color='red'>[B]</font>")
|
||||
|
||||
//Fibers
|
||||
if(length(fibers))
|
||||
sleep(3 SECONDS)
|
||||
add_log("<span class='info'><B>Fibers:</B></span>")
|
||||
for(var/fiber in fibers)
|
||||
add_log("[fiber]")
|
||||
found_something = TRUE
|
||||
|
||||
//Reagents
|
||||
if(length(reagents))
|
||||
sleep(3 SECONDS)
|
||||
add_log("<span class='info'><B>Reagents:</B></span>")
|
||||
for(var/R in reagents)
|
||||
add_log("Reagent: <font color='red'>[R]</font> Volume: <font color='red'>[reagents[R]]</font>")
|
||||
found_something = TRUE
|
||||
|
||||
// Get a new user
|
||||
var/mob/holder = null
|
||||
if(ismob(src.loc))
|
||||
holder = src.loc
|
||||
|
||||
if(!found_something)
|
||||
add_log("<I># No forensic traces found #</I>", 0) // Don't display this to the holder user
|
||||
if(holder)
|
||||
to_chat(holder, "<span class='warning'>Unable to locate any fingerprints, materials, fibers, or blood on \the [target_name]!</span>")
|
||||
else
|
||||
if(holder)
|
||||
to_chat(holder, "<span class='notice'>You finish scanning \the [target_name].</span>")
|
||||
|
||||
add_log("---------------------------------------------------------", 0)
|
||||
scanning = FALSE
|
||||
return
|
||||
|
||||
/obj/item/detective_scanner/proc/add_log(msg, broadcast = TRUE)
|
||||
if(scanning)
|
||||
if(broadcast && ismob(loc))
|
||||
var/mob/M = loc
|
||||
to_chat(M, msg)
|
||||
log += " [msg]"
|
||||
else
|
||||
CRASH("[src] [REF(src)] is adding a log when it was never put in scanning mode!")
|
||||
|
||||
/proc/get_timestamp()
|
||||
return time2text(world.time + 432000, ":ss")
|
||||
|
||||
/obj/item/detective_scanner/AltClick(mob/living/user)
|
||||
. = ..()
|
||||
// Best way for checking if a player can use while not incapacitated, etc
|
||||
if(!user.canUseTopic(src, be_close=TRUE))
|
||||
return
|
||||
. = TRUE
|
||||
if(!LAZYLEN(log))
|
||||
to_chat(user, "<span class='notice'>Cannot clear logs, the scanner has no logs.</span>")
|
||||
return
|
||||
if(scanning)
|
||||
to_chat(user, "<span class='notice'>Cannot clear logs, the scanner is in use.</span>")
|
||||
return
|
||||
to_chat(user, "<span class='notice'>The scanner logs are cleared.</span>")
|
||||
log = list()
|
||||
|
||||
/obj/item/detective_scanner/examine(mob/user)
|
||||
. = ..()
|
||||
if(LAZYLEN(log) && !scanning)
|
||||
. += "<span class='notice'>Alt-click to clear scanner logs.</span>"
|
||||
|
||||
/obj/item/detective_scanner/proc/displayDetectiveScanResults(mob/living/user)
|
||||
// No need for can-use checks since the action button should do proper checks
|
||||
if(!LAZYLEN(log))
|
||||
to_chat(user, "<span class='notice'>Cannot display logs, the scanner has no logs.</span>")
|
||||
return
|
||||
if(scanning)
|
||||
to_chat(user, "<span class='notice'>Cannot display logs, the scanner is in use.</span>")
|
||||
return
|
||||
to_chat(user, "<span class='notice'><B>Scanner Report</B></span>")
|
||||
for(var/iterLog in log)
|
||||
to_chat(user, iterLog)
|
||||
|
||||
@@ -186,8 +186,10 @@
|
||||
..()
|
||||
|
||||
/obj/machinery/microwave/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(user.canUseTopic(src, !issilicon(usr)))
|
||||
cook()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/microwave/ui_interact(mob/user)
|
||||
. = ..()
|
||||
|
||||
@@ -130,9 +130,11 @@
|
||||
update_icon()
|
||||
|
||||
/obj/item/toy/cards/singlecard/cas/AltClick(mob/living/user)
|
||||
. = ..()
|
||||
if(!ishuman(user) || !user.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
Flip()
|
||||
return TRUE
|
||||
|
||||
/obj/item/toy/cards/singlecard/cas/update_icon()
|
||||
if(flipped)
|
||||
|
||||
@@ -180,10 +180,11 @@
|
||||
else
|
||||
return ..()
|
||||
|
||||
//this helps you not blow up so easily by overriding unlocking which results in an immediate boom.
|
||||
/obj/structure/closet/crate/secure/loot/AltClick(mob/living/user)
|
||||
if(!user.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
return attack_hand(user) //this helps you not blow up so easily by overriding unlocking which results in an immediate boom.
|
||||
if(user.canUseTopic(src, BE_CLOSE))
|
||||
attack_hand(user)
|
||||
return TRUE
|
||||
|
||||
/obj/structure/closet/crate/secure/loot/attackby(obj/item/W, mob/user)
|
||||
if(locked)
|
||||
|
||||
@@ -59,6 +59,7 @@ GLOBAL_LIST_INIT(marker_beacon_colors, list(
|
||||
/obj/item/stack/marker_beacon/AltClick(mob/living/user)
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
. = TRUE
|
||||
var/input_color = input(user, "Choose a color.", "Beacon Color") as null|anything in GLOB.marker_beacon_colors
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
@@ -128,9 +129,10 @@ GLOBAL_LIST_INIT(marker_beacon_colors, list(
|
||||
return ..()
|
||||
|
||||
/obj/structure/marker_beacon/AltClick(mob/living/user)
|
||||
..()
|
||||
. = ..()
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
. = TRUE
|
||||
var/input_color = input(user, "Choose a color.", "Beacon Color") as null|anything in GLOB.marker_beacon_colors
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
/mob/living/simple_animal/hostile/guardian/bomb/AltClickOn(atom/movable/A)
|
||||
if(!istype(A))
|
||||
altclick_listed_turf(A)
|
||||
return
|
||||
if(loc == summoner)
|
||||
to_chat(src, "<span class='danger'><B>You must be manifested to create bombs!</span></B>")
|
||||
|
||||
@@ -105,8 +105,9 @@
|
||||
|
||||
/mob/living/simple_animal/hostile/guardian/healer/AltClickOn(atom/movable/A)
|
||||
if(!istype(A))
|
||||
altclick_listed_turf(A)
|
||||
return
|
||||
if(src.loc == summoner)
|
||||
if(loc == summoner)
|
||||
to_chat(src, "<span class='danger'><B>You must be manifested to warp a target!</span></B>")
|
||||
return
|
||||
if(!beacon)
|
||||
|
||||
@@ -267,6 +267,7 @@ Difficulty: Medium
|
||||
|
||||
/mob/living/simple_animal/hostile/megafauna/dragon/AltClickOn(atom/movable/A)
|
||||
if(!istype(A))
|
||||
altclick_listed_turf(A)
|
||||
return
|
||||
if(swoop_cooldown >= world.time)
|
||||
to_chat(src, "<span class='warning'>You need to wait 20 seconds between swoop attacks!</span>")
|
||||
|
||||
@@ -442,7 +442,7 @@ Difficulty: Normal
|
||||
|
||||
/mob/living/simple_animal/hostile/megafauna/hierophant/AltClickOn(atom/A) //player control handler(don't give this to a player holy fuck)
|
||||
if(!istype(A) || get_dist(A, src) <= 2)
|
||||
return
|
||||
return altclick_listed_turf(A)
|
||||
blink(A)
|
||||
|
||||
//Hierophant overlays
|
||||
|
||||
@@ -8,6 +8,7 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, typecacheof(list(
|
||||
/mob/living/proc/handle_ventcrawl(atom/A)
|
||||
if(!ventcrawler || !Adjacent(A))
|
||||
return
|
||||
. = TRUE //return value to stop the client from being shown the turf contents stat tab on alt-click.
|
||||
if(stat)
|
||||
to_chat(src, "You must be conscious to do this!")
|
||||
return
|
||||
|
||||
@@ -126,7 +126,7 @@
|
||||
portable_drive.verb_pickup()
|
||||
|
||||
/obj/item/modular_computer/AltClick(mob/user)
|
||||
..()
|
||||
. = ..()
|
||||
if(issilicon(user))
|
||||
return
|
||||
|
||||
@@ -142,7 +142,7 @@
|
||||
return
|
||||
if(ai_slot)
|
||||
ai_slot.try_eject(null, user)
|
||||
|
||||
return TRUE
|
||||
|
||||
// Gets IDs/access levels from card slot. Would be useful when/if PDAs would become modular PCs.
|
||||
/obj/item/modular_computer/GetAccess()
|
||||
|
||||
@@ -86,8 +86,8 @@
|
||||
/obj/item/modular_computer/laptop/AltClick(mob/user)
|
||||
if(screen_on) // Close it.
|
||||
try_toggle_open(user)
|
||||
else
|
||||
return ..()
|
||||
return TRUE
|
||||
return ..()
|
||||
|
||||
/obj/item/modular_computer/laptop/proc/toggle_open(mob/living/user=null)
|
||||
if(screen_on)
|
||||
|
||||
@@ -92,8 +92,9 @@
|
||||
cpu.eject_card()
|
||||
|
||||
/obj/machinery/modular_computer/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(cpu)
|
||||
cpu.AltClick(user)
|
||||
return cpu.AltClick(user)
|
||||
|
||||
//ATTACK HAND IGNORING PARENT RETURN VALUE
|
||||
// On-click handling. Turns on the computer if it's off and opens the GUI.
|
||||
|
||||
@@ -122,6 +122,7 @@
|
||||
. += "<span class='notice'>Alt-click [src] to fold it into a paper plane.</span>"
|
||||
|
||||
/obj/item/paper/AltClick(mob/living/carbon/user, obj/item/I)
|
||||
. = ..()
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user), NO_TK))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You fold [src] into the shape of a plane!</span>")
|
||||
@@ -134,3 +135,4 @@
|
||||
|
||||
I = new plane_type(user, src)
|
||||
user.put_in_hands(I)
|
||||
return TRUE
|
||||
|
||||
@@ -1,214 +1,215 @@
|
||||
|
||||
#define CAMERA_PICTURE_SIZE_HARD_LIMIT 21
|
||||
|
||||
/obj/item/camera
|
||||
name = "camera"
|
||||
icon = 'icons/obj/items_and_weapons.dmi'
|
||||
desc = "A polaroid camera."
|
||||
icon_state = "camera"
|
||||
item_state = "camera"
|
||||
lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
|
||||
light_color = LIGHT_COLOR_WHITE
|
||||
light_power = FLASH_LIGHT_POWER
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
flags_1 = CONDUCT_1
|
||||
slot_flags = ITEM_SLOT_NECK
|
||||
materials = list(MAT_METAL = 50, MAT_GLASS = 150)
|
||||
var/flash_enabled = TRUE
|
||||
var/state_on = "camera"
|
||||
var/state_off = "camera_off"
|
||||
var/pictures_max = 10
|
||||
var/pictures_left = 10
|
||||
var/on = TRUE
|
||||
var/cooldown = 64
|
||||
var/blending = FALSE //lets not take pictures while the previous is still processing!
|
||||
var/see_ghosts = CAMERA_NO_GHOSTS //for the spoop of it
|
||||
var/obj/item/disk/holodisk/disk
|
||||
var/sound/custom_sound
|
||||
var/silent = FALSE
|
||||
var/picture_size_x = 2
|
||||
var/picture_size_y = 2
|
||||
var/picture_size_x_min = 1
|
||||
var/picture_size_y_min = 1
|
||||
var/picture_size_x_max = 4
|
||||
var/picture_size_y_max = 4
|
||||
|
||||
/obj/item/camera/attack_self(mob/user)
|
||||
if(!disk)
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You eject [disk] out the back of [src].</span>")
|
||||
user.put_in_hands(disk)
|
||||
disk = null
|
||||
|
||||
/obj/item/camera/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>Alt-click to change its focusing, allowing you to set how big of an area it will capture.</span>"
|
||||
|
||||
/obj/item/camera/AltClick(mob/user)
|
||||
if(!user.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
var/desired_x = input(user, "How high do you want the camera to shoot, between [picture_size_x_min] and [picture_size_x_max]?", "Zoom", picture_size_x) as num
|
||||
var/desired_y = input(user, "How wide do you want the camera to shoot, between [picture_size_y_min] and [picture_size_y_max]?", "Zoom", picture_size_y) as num
|
||||
picture_size_x = min(CLAMP(desired_x, picture_size_x_min, picture_size_x_max), CAMERA_PICTURE_SIZE_HARD_LIMIT)
|
||||
picture_size_y = min(CLAMP(desired_y, picture_size_y_min, picture_size_y_max), CAMERA_PICTURE_SIZE_HARD_LIMIT)
|
||||
|
||||
|
||||
/obj/item/camera/attack(mob/living/carbon/human/M, mob/user)
|
||||
return
|
||||
|
||||
/obj/item/camera/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/camera_film))
|
||||
if(pictures_left)
|
||||
to_chat(user, "<span class='notice'>[src] still has some film in it!</span>")
|
||||
return
|
||||
if(!user.temporarilyRemoveItemFromInventory(I))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You insert [I] into [src].</span>")
|
||||
qdel(I)
|
||||
pictures_left = pictures_max
|
||||
return
|
||||
if(istype(I, /obj/item/disk/holodisk))
|
||||
if (!disk)
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
to_chat(user, "<span class='warning'>[I] is stuck to your hand!</span>")
|
||||
return TRUE
|
||||
to_chat(user, "<span class='notice'>You slide [I] into the back of [src].</span>")
|
||||
disk = I
|
||||
else
|
||||
to_chat(user, "<span class='warning'>There's already a disk inside [src].</span>")
|
||||
return TRUE //no afterattack
|
||||
..()
|
||||
|
||||
/obj/item/camera/examine(mob/user)
|
||||
. = ..()
|
||||
. += "It has [pictures_left] photos left."
|
||||
|
||||
//user can be atom or mob
|
||||
/obj/item/camera/proc/can_target(atom/target, mob/user, prox_flag)
|
||||
if(!on || blending || !pictures_left)
|
||||
return FALSE
|
||||
var/turf/T = get_turf(target)
|
||||
if(!T)
|
||||
return FALSE
|
||||
if(istype(user))
|
||||
if(isAI(user) && !GLOB.cameranet.checkTurfVis(T))
|
||||
return FALSE
|
||||
else if(user.client && !(get_turf(target) in get_hear(user.client.view, user)))
|
||||
return FALSE
|
||||
else if(!(get_turf(target) in get_hear(world.view, user)))
|
||||
return FALSE
|
||||
else //user is an atom
|
||||
if(!(get_turf(target) in view(world.view, user)))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/item/camera/afterattack(atom/target, mob/user, flag)
|
||||
if (disk)
|
||||
if(ismob(target))
|
||||
if (disk.record)
|
||||
QDEL_NULL(disk.record)
|
||||
|
||||
disk.record = new
|
||||
var/mob/M = target
|
||||
disk.record.caller_name = M.name
|
||||
disk.record.set_caller_image(M)
|
||||
else
|
||||
to_chat(user, "<span class='warning'>Invalid holodisk target.</span>")
|
||||
return
|
||||
|
||||
if(!can_target(target, user, flag))
|
||||
return
|
||||
|
||||
on = FALSE
|
||||
|
||||
var/realcooldown = cooldown
|
||||
var/mob/living/carbon/human/H = user
|
||||
if (HAS_TRAIT(H, TRAIT_PHOTOGRAPHER))
|
||||
realcooldown *= 0.5
|
||||
addtimer(CALLBACK(src, .proc/cooldown), realcooldown)
|
||||
|
||||
icon_state = state_off
|
||||
|
||||
INVOKE_ASYNC(src, .proc/captureimage, target, user, flag, picture_size_x - 1, picture_size_y - 1)
|
||||
|
||||
|
||||
/obj/item/camera/proc/cooldown()
|
||||
UNTIL(!blending)
|
||||
icon_state = state_on
|
||||
on = TRUE
|
||||
|
||||
/obj/item/camera/proc/show_picture(mob/user, datum/picture/selection)
|
||||
var/obj/item/photo/P = new(src, selection)
|
||||
P.show(user)
|
||||
to_chat(user, P.desc)
|
||||
qdel(P)
|
||||
|
||||
/obj/item/camera/proc/captureimage(atom/target, mob/user, flag, size_x = 1, size_y = 1)
|
||||
if(flash_enabled)
|
||||
flash_lighting_fx(8, light_power, light_color)
|
||||
blending = TRUE
|
||||
var/turf/target_turf = get_turf(target)
|
||||
if(!isturf(target_turf))
|
||||
blending = FALSE
|
||||
return FALSE
|
||||
size_x = CLAMP(size_x, 0, CAMERA_PICTURE_SIZE_HARD_LIMIT)
|
||||
size_y = CLAMP(size_y, 0, CAMERA_PICTURE_SIZE_HARD_LIMIT)
|
||||
var/list/desc = list("This is a photo of an area of [size_x+1] meters by [size_y+1] meters.")
|
||||
var/ai_user = isAI(user)
|
||||
var/list/seen
|
||||
var/list/viewlist = (user && user.client)? getviewsize(user.client.view) : getviewsize(world.view)
|
||||
var/viewr = max(viewlist[1], viewlist[2]) + max(size_x, size_y)
|
||||
var/viewc = user.client? user.client.eye : target
|
||||
seen = get_hear(viewr, viewc)
|
||||
var/list/turfs = list()
|
||||
var/list/mobs = list()
|
||||
var/blueprints = FALSE
|
||||
var/clone_area = SSmapping.RequestBlockReservation(size_x * 2 + 1, size_y * 2 + 1)
|
||||
for(var/turf/T in block(locate(target_turf.x - size_x, target_turf.y - size_y, target_turf.z), locate(target_turf.x + size_x, target_turf.y + size_y, target_turf.z)))
|
||||
if((ai_user && GLOB.cameranet.checkTurfVis(T)) || (T in seen))
|
||||
turfs += T
|
||||
for(var/mob/M in T)
|
||||
mobs += M
|
||||
if(locate(/obj/item/areaeditor/blueprints) in T)
|
||||
blueprints = TRUE
|
||||
for(var/i in mobs)
|
||||
var/mob/M = i
|
||||
desc += M.get_photo_description(src)
|
||||
|
||||
var/psize_x = (size_x * 2 + 1) * world.icon_size
|
||||
var/psize_y = (size_y * 2 + 1) * world.icon_size
|
||||
var/get_icon = camera_get_icon(turfs, target_turf, psize_x, psize_y, clone_area, size_x, size_y, (size_x * 2 + 1), (size_y * 2 + 1))
|
||||
qdel(clone_area)
|
||||
var/icon/temp = icon('icons/effects/96x96.dmi',"")
|
||||
temp.Blend("#000", ICON_OVERLAY)
|
||||
temp.Scale(psize_x, psize_y)
|
||||
temp.Blend(get_icon, ICON_OVERLAY)
|
||||
|
||||
var/datum/picture/P = new("picture", desc.Join(" "), temp, null, psize_x, psize_y, blueprints)
|
||||
after_picture(user, P, flag)
|
||||
blending = FALSE
|
||||
|
||||
/obj/item/camera/proc/after_picture(mob/user, datum/picture/picture, proximity_flag)
|
||||
printpicture(user, picture)
|
||||
|
||||
/obj/item/camera/proc/printpicture(mob/user, datum/picture/picture) //Normal camera proc for creating photos
|
||||
var/obj/item/photo/p = new(get_turf(src), picture)
|
||||
if(in_range(src, user)) //needed because of TK
|
||||
user.put_in_hands(p)
|
||||
pictures_left--
|
||||
to_chat(user, "<span class='notice'>[pictures_left] photos left.</span>")
|
||||
var/customize = alert(user, "Do you want to customize the photo?", "Customization", "Yes", "No")
|
||||
if(customize == "Yes")
|
||||
var/name1 = stripped_input(user, "Set a name for this photo, or leave blank. 32 characters max.", "Name", max_length = 32)
|
||||
var/desc1 = stripped_input(user, "Set a description to add to photo, or leave blank. 128 characters max.", "Caption", max_length = 128)
|
||||
var/caption = stripped_input(user, "Set a caption for this photo, or leave blank. 256 characters max.", "Caption", max_length = 256)
|
||||
if(name1)
|
||||
picture.picture_name = name1
|
||||
if(desc1)
|
||||
picture.picture_desc = "[desc1] - [picture.picture_desc]"
|
||||
if(caption)
|
||||
picture.caption = caption
|
||||
p.set_picture(picture, TRUE, TRUE)
|
||||
if(CONFIG_GET(flag/picture_logging_camera))
|
||||
picture.log_to_file()
|
||||
|
||||
#define CAMERA_PICTURE_SIZE_HARD_LIMIT 21
|
||||
|
||||
/obj/item/camera
|
||||
name = "camera"
|
||||
icon = 'icons/obj/items_and_weapons.dmi'
|
||||
desc = "A polaroid camera."
|
||||
icon_state = "camera"
|
||||
item_state = "camera"
|
||||
lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
|
||||
light_color = LIGHT_COLOR_WHITE
|
||||
light_power = FLASH_LIGHT_POWER
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
flags_1 = CONDUCT_1
|
||||
slot_flags = ITEM_SLOT_NECK
|
||||
materials = list(MAT_METAL = 50, MAT_GLASS = 150)
|
||||
var/flash_enabled = TRUE
|
||||
var/state_on = "camera"
|
||||
var/state_off = "camera_off"
|
||||
var/pictures_max = 10
|
||||
var/pictures_left = 10
|
||||
var/on = TRUE
|
||||
var/cooldown = 64
|
||||
var/blending = FALSE //lets not take pictures while the previous is still processing!
|
||||
var/see_ghosts = CAMERA_NO_GHOSTS //for the spoop of it
|
||||
var/obj/item/disk/holodisk/disk
|
||||
var/sound/custom_sound
|
||||
var/silent = FALSE
|
||||
var/picture_size_x = 2
|
||||
var/picture_size_y = 2
|
||||
var/picture_size_x_min = 1
|
||||
var/picture_size_y_min = 1
|
||||
var/picture_size_x_max = 4
|
||||
var/picture_size_y_max = 4
|
||||
|
||||
/obj/item/camera/attack_self(mob/user)
|
||||
if(!disk)
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You eject [disk] out the back of [src].</span>")
|
||||
user.put_in_hands(disk)
|
||||
disk = null
|
||||
|
||||
/obj/item/camera/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>Alt-click to change its focusing, allowing you to set how big of an area it will capture.</span>"
|
||||
|
||||
/obj/item/camera/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(!user.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
var/desired_x = input(user, "How high do you want the camera to shoot, between [picture_size_x_min] and [picture_size_x_max]?", "Zoom", picture_size_x) as num
|
||||
var/desired_y = input(user, "How wide do you want the camera to shoot, between [picture_size_y_min] and [picture_size_y_max]?", "Zoom", picture_size_y) as num
|
||||
picture_size_x = min(CLAMP(desired_x, picture_size_x_min, picture_size_x_max), CAMERA_PICTURE_SIZE_HARD_LIMIT)
|
||||
picture_size_y = min(CLAMP(desired_y, picture_size_y_min, picture_size_y_max), CAMERA_PICTURE_SIZE_HARD_LIMIT)
|
||||
return TRUE
|
||||
|
||||
/obj/item/camera/attack(mob/living/carbon/human/M, mob/user)
|
||||
return
|
||||
|
||||
/obj/item/camera/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/camera_film))
|
||||
if(pictures_left)
|
||||
to_chat(user, "<span class='notice'>[src] still has some film in it!</span>")
|
||||
return
|
||||
if(!user.temporarilyRemoveItemFromInventory(I))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You insert [I] into [src].</span>")
|
||||
qdel(I)
|
||||
pictures_left = pictures_max
|
||||
return
|
||||
if(istype(I, /obj/item/disk/holodisk))
|
||||
if (!disk)
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
to_chat(user, "<span class='warning'>[I] is stuck to your hand!</span>")
|
||||
return TRUE
|
||||
to_chat(user, "<span class='notice'>You slide [I] into the back of [src].</span>")
|
||||
disk = I
|
||||
else
|
||||
to_chat(user, "<span class='warning'>There's already a disk inside [src].</span>")
|
||||
return TRUE //no afterattack
|
||||
..()
|
||||
|
||||
/obj/item/camera/examine(mob/user)
|
||||
. = ..()
|
||||
. += "It has [pictures_left] photos left."
|
||||
|
||||
//user can be atom or mob
|
||||
/obj/item/camera/proc/can_target(atom/target, mob/user, prox_flag)
|
||||
if(!on || blending || !pictures_left)
|
||||
return FALSE
|
||||
var/turf/T = get_turf(target)
|
||||
if(!T)
|
||||
return FALSE
|
||||
if(istype(user))
|
||||
if(isAI(user) && !GLOB.cameranet.checkTurfVis(T))
|
||||
return FALSE
|
||||
else if(user.client && !(get_turf(target) in get_hear(user.client.view, user)))
|
||||
return FALSE
|
||||
else if(!(get_turf(target) in get_hear(world.view, user)))
|
||||
return FALSE
|
||||
else //user is an atom
|
||||
if(!(get_turf(target) in view(world.view, user)))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/item/camera/afterattack(atom/target, mob/user, flag)
|
||||
if (disk)
|
||||
if(ismob(target))
|
||||
if (disk.record)
|
||||
QDEL_NULL(disk.record)
|
||||
|
||||
disk.record = new
|
||||
var/mob/M = target
|
||||
disk.record.caller_name = M.name
|
||||
disk.record.set_caller_image(M)
|
||||
else
|
||||
to_chat(user, "<span class='warning'>Invalid holodisk target.</span>")
|
||||
return
|
||||
|
||||
if(!can_target(target, user, flag))
|
||||
return
|
||||
|
||||
on = FALSE
|
||||
|
||||
var/realcooldown = cooldown
|
||||
var/mob/living/carbon/human/H = user
|
||||
if (HAS_TRAIT(H, TRAIT_PHOTOGRAPHER))
|
||||
realcooldown *= 0.5
|
||||
addtimer(CALLBACK(src, .proc/cooldown), realcooldown)
|
||||
|
||||
icon_state = state_off
|
||||
|
||||
INVOKE_ASYNC(src, .proc/captureimage, target, user, flag, picture_size_x - 1, picture_size_y - 1)
|
||||
|
||||
|
||||
/obj/item/camera/proc/cooldown()
|
||||
UNTIL(!blending)
|
||||
icon_state = state_on
|
||||
on = TRUE
|
||||
|
||||
/obj/item/camera/proc/show_picture(mob/user, datum/picture/selection)
|
||||
var/obj/item/photo/P = new(src, selection)
|
||||
P.show(user)
|
||||
to_chat(user, P.desc)
|
||||
qdel(P)
|
||||
|
||||
/obj/item/camera/proc/captureimage(atom/target, mob/user, flag, size_x = 1, size_y = 1)
|
||||
if(flash_enabled)
|
||||
flash_lighting_fx(8, light_power, light_color)
|
||||
blending = TRUE
|
||||
var/turf/target_turf = get_turf(target)
|
||||
if(!isturf(target_turf))
|
||||
blending = FALSE
|
||||
return FALSE
|
||||
size_x = CLAMP(size_x, 0, CAMERA_PICTURE_SIZE_HARD_LIMIT)
|
||||
size_y = CLAMP(size_y, 0, CAMERA_PICTURE_SIZE_HARD_LIMIT)
|
||||
var/list/desc = list("This is a photo of an area of [size_x+1] meters by [size_y+1] meters.")
|
||||
var/ai_user = isAI(user)
|
||||
var/list/seen
|
||||
var/list/viewlist = (user && user.client)? getviewsize(user.client.view) : getviewsize(world.view)
|
||||
var/viewr = max(viewlist[1], viewlist[2]) + max(size_x, size_y)
|
||||
var/viewc = user.client? user.client.eye : target
|
||||
seen = get_hear(viewr, viewc)
|
||||
var/list/turfs = list()
|
||||
var/list/mobs = list()
|
||||
var/blueprints = FALSE
|
||||
var/clone_area = SSmapping.RequestBlockReservation(size_x * 2 + 1, size_y * 2 + 1)
|
||||
for(var/turf/T in block(locate(target_turf.x - size_x, target_turf.y - size_y, target_turf.z), locate(target_turf.x + size_x, target_turf.y + size_y, target_turf.z)))
|
||||
if((ai_user && GLOB.cameranet.checkTurfVis(T)) || (T in seen))
|
||||
turfs += T
|
||||
for(var/mob/M in T)
|
||||
mobs += M
|
||||
if(locate(/obj/item/areaeditor/blueprints) in T)
|
||||
blueprints = TRUE
|
||||
for(var/i in mobs)
|
||||
var/mob/M = i
|
||||
desc += M.get_photo_description(src)
|
||||
|
||||
var/psize_x = (size_x * 2 + 1) * world.icon_size
|
||||
var/psize_y = (size_y * 2 + 1) * world.icon_size
|
||||
var/get_icon = camera_get_icon(turfs, target_turf, psize_x, psize_y, clone_area, size_x, size_y, (size_x * 2 + 1), (size_y * 2 + 1))
|
||||
qdel(clone_area)
|
||||
var/icon/temp = icon('icons/effects/96x96.dmi',"")
|
||||
temp.Blend("#000", ICON_OVERLAY)
|
||||
temp.Scale(psize_x, psize_y)
|
||||
temp.Blend(get_icon, ICON_OVERLAY)
|
||||
|
||||
var/datum/picture/P = new("picture", desc.Join(" "), temp, null, psize_x, psize_y, blueprints)
|
||||
after_picture(user, P, flag)
|
||||
blending = FALSE
|
||||
|
||||
/obj/item/camera/proc/after_picture(mob/user, datum/picture/picture, proximity_flag)
|
||||
printpicture(user, picture)
|
||||
|
||||
/obj/item/camera/proc/printpicture(mob/user, datum/picture/picture) //Normal camera proc for creating photos
|
||||
var/obj/item/photo/p = new(get_turf(src), picture)
|
||||
if(in_range(src, user)) //needed because of TK
|
||||
user.put_in_hands(p)
|
||||
pictures_left--
|
||||
to_chat(user, "<span class='notice'>[pictures_left] photos left.</span>")
|
||||
var/customize = alert(user, "Do you want to customize the photo?", "Customization", "Yes", "No")
|
||||
if(customize == "Yes")
|
||||
var/name1 = stripped_input(user, "Set a name for this photo, or leave blank. 32 characters max.", "Name", max_length = 32)
|
||||
var/desc1 = stripped_input(user, "Set a description to add to photo, or leave blank. 128 characters max.", "Caption", max_length = 128)
|
||||
var/caption = stripped_input(user, "Set a caption for this photo, or leave blank. 256 characters max.", "Caption", max_length = 256)
|
||||
if(name1)
|
||||
picture.picture_name = name1
|
||||
if(desc1)
|
||||
picture.picture_desc = "[desc1] - [picture.picture_desc]"
|
||||
if(caption)
|
||||
picture.caption = caption
|
||||
p.set_picture(picture, TRUE, TRUE)
|
||||
if(CONFIG_GET(flag/picture_logging_camera))
|
||||
picture.log_to_file()
|
||||
|
||||
@@ -748,11 +748,11 @@
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/power/apc/AltClick(mob/user)
|
||||
..()
|
||||
. = ..()
|
||||
if(!user.canUseTopic(src, !issilicon(user)) || !isturf(loc))
|
||||
return
|
||||
else
|
||||
togglelock(user)
|
||||
togglelock(user)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/power/apc/proc/togglelock(mob/living/user)
|
||||
if(obj_flags & EMAGGED)
|
||||
|
||||
@@ -222,10 +222,11 @@
|
||||
spread = 2
|
||||
|
||||
/obj/item/gun/ballistic/shotgun/automatic/combat/compact/AltClick(mob/living/user)
|
||||
. = ..()
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||
return
|
||||
toggle_stock(user)
|
||||
. = ..()
|
||||
return TRUE
|
||||
|
||||
/obj/item/gun/ballistic/shotgun/automatic/combat/compact/examine(mob/user)
|
||||
. = ..()
|
||||
@@ -286,8 +287,10 @@
|
||||
to_chat(user, "You switch to tube A.")
|
||||
|
||||
/obj/item/gun/ballistic/shotgun/automatic/dual_tube/AltClick(mob/living/user)
|
||||
. = ..()
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||
return
|
||||
pump()
|
||||
return TRUE
|
||||
|
||||
// DOUBLE BARRELED SHOTGUN and IMPROVISED SHOTGUN are in revolver.dm
|
||||
|
||||
@@ -442,10 +442,11 @@
|
||||
return final_list
|
||||
|
||||
/obj/machinery/chem_dispenser/AltClick(mob/living/user)
|
||||
. = ..()
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
|
||||
return
|
||||
replace_beaker(user)
|
||||
return
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/chem_dispenser/drinks/Initialize()
|
||||
. = ..()
|
||||
|
||||
@@ -29,10 +29,11 @@
|
||||
icon_state = "mixer0b"
|
||||
|
||||
/obj/machinery/chem_heater/AltClick(mob/living/user)
|
||||
. = ..()
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
|
||||
return
|
||||
replace_beaker(user)
|
||||
return
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/chem_heater/proc/replace_beaker(mob/living/user, obj/item/reagent_containers/new_beaker)
|
||||
if(beaker)
|
||||
|
||||
@@ -237,10 +237,11 @@
|
||||
return ..()
|
||||
|
||||
/obj/machinery/computer/pandemic/AltClick(mob/living/user)
|
||||
. = ..()
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
|
||||
return
|
||||
replace_beaker(user)
|
||||
return
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/computer/pandemic/proc/replace_beaker(mob/living/user, obj/item/reagent_containers/new_beaker)
|
||||
if(beaker)
|
||||
|
||||
@@ -344,8 +344,10 @@
|
||||
return FALSE
|
||||
|
||||
/obj/item/hypospray/mkii/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(vial)
|
||||
vial.attack_self(user)
|
||||
return TRUE
|
||||
|
||||
// Gunna allow this for now, still really don't approve - Pooj
|
||||
/obj/item/hypospray/mkii/emag_act(mob/user)
|
||||
|
||||
@@ -88,13 +88,25 @@
|
||||
if(reagents.total_volume && user.canUseTopic(src, BE_CLOSE))
|
||||
to_chat(user, "<span class='notice'>You start squeezing the liquids out of \the [src]...</span>")
|
||||
if(do_after(user, action_speed, TRUE, src))
|
||||
to_chat(user, "<span class='notice'>You squeeze \the [src] dry.</span>")
|
||||
var/atom/react_loc = get_turf(src)
|
||||
if(ismob(react_loc))
|
||||
react_loc = react_loc.loc
|
||||
if(react_loc)
|
||||
reagents.reaction(react_loc, TOUCH)
|
||||
reagents.clear_reagents()
|
||||
var/msg = "You squeeze \the [src]"
|
||||
var/obj/item/target
|
||||
if(Adjacent(user)) //Allows the user to drain the reagents into a beaker if adjacent (no telepathy).
|
||||
for(var/obj/item/I in user.held_items)
|
||||
if(I == src)
|
||||
continue
|
||||
if(I.is_open_container() && !I.reagents.holder_full())
|
||||
target = I
|
||||
break
|
||||
if(!target)
|
||||
msg += " dry"
|
||||
reagents.reaction(get_turf(src), TOUCH)
|
||||
reagents.clear_reagents()
|
||||
else
|
||||
msg += "'s liquids into \the [target]"
|
||||
reagents.trans_to(target, reagents.total_volume)
|
||||
to_chat(user, "<span class='notice'>[msg].</span>")
|
||||
return TRUE
|
||||
|
||||
|
||||
/obj/item/reagent_containers/rag/towel
|
||||
name = "towel"
|
||||
@@ -177,4 +189,4 @@
|
||||
extinguish_efficiency = 5
|
||||
action_speed = 15
|
||||
damp_threshold = 0.8
|
||||
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 20, "bio" = 20, "rad" = 20, "fire" = 50, "acid" = 50) //items don't provide armor to wearers unlike clothing yet.
|
||||
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 20, "bio" = 20, "rad" = 20, "fire" = 50, "acid" = 50) //items don't provide armor to wearers unlike clothing yet.
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
return
|
||||
if(disk)
|
||||
eject()
|
||||
return TRUE
|
||||
|
||||
/obj/item/nanite_hijacker/examine(mob/user)
|
||||
. = ..()
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
update_icon()
|
||||
else
|
||||
to_chat(user, "<span class='warning'>Access denied.</span>")
|
||||
return TRUE
|
||||
|
||||
/obj/item/nanite_remote/emag_act(mob/user)
|
||||
if(obj_flags & EMAGGED)
|
||||
|
||||
@@ -276,14 +276,15 @@ GLOBAL_VAR_INIT(hhmysteryRoomNumber, 1337)
|
||||
promptExit(user)
|
||||
|
||||
/turf/closed/indestructible/hoteldoor/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(get_dist(get_turf(src), get_turf(user)) <= 1)
|
||||
to_chat(user, "<span class='notice'>You peak through the door's bluespace peephole...</span>")
|
||||
user.reset_perspective(parentSphere)
|
||||
user.set_machine(src)
|
||||
var/datum/action/peepholeCancel/PHC = new
|
||||
user.overlay_fullscreen("remote_view", /obj/screen/fullscreen/impaired, 1)
|
||||
PHC.Grant(user)
|
||||
. = ..()
|
||||
if(get_dist(get_turf(src), get_turf(user)) <= 1)
|
||||
to_chat(user, "<span class='notice'>You peak through the door's bluespace peephole...</span>")
|
||||
user.reset_perspective(parentSphere)
|
||||
user.set_machine(src)
|
||||
var/datum/action/peepholeCancel/PHC = new
|
||||
user.overlay_fullscreen("remote_view", /obj/screen/fullscreen/impaired, 1)
|
||||
PHC.Grant(user)
|
||||
return TRUE
|
||||
|
||||
/turf/closed/indestructible/hoteldoor/check_eye(mob/user)
|
||||
if(get_dist(get_turf(src), get_turf(user)) >= 2)
|
||||
|
||||
@@ -1,78 +1,79 @@
|
||||
/obj/vehicle/ridden
|
||||
name = "ridden vehicle"
|
||||
can_buckle = TRUE
|
||||
max_buckled_mobs = 1
|
||||
buckle_lying = FALSE
|
||||
default_driver_move = FALSE
|
||||
var/legs_required = 1
|
||||
var/arms_required = 0 //why not?
|
||||
|
||||
/obj/vehicle/ridden/Initialize()
|
||||
. = ..()
|
||||
LoadComponent(/datum/component/riding)
|
||||
|
||||
/obj/vehicle/ridden/examine(mob/user)
|
||||
. = ..()
|
||||
if(key_type)
|
||||
if(!inserted_key)
|
||||
. += "<span class='notice'>Put a key inside it by clicking it with the key.</span>"
|
||||
else
|
||||
. += "<span class='notice'>Alt-click [src] to remove the key.</span>"
|
||||
|
||||
/obj/vehicle/ridden/generate_action_type(actiontype)
|
||||
var/datum/action/vehicle/ridden/A = ..()
|
||||
. = A
|
||||
if(istype(A))
|
||||
A.vehicle_ridden_target = src
|
||||
|
||||
/obj/vehicle/ridden/post_unbuckle_mob(mob/living/M)
|
||||
remove_occupant(M)
|
||||
return ..()
|
||||
|
||||
/obj/vehicle/ridden/post_buckle_mob(mob/living/M)
|
||||
add_occupant(M)
|
||||
if(M.get_num_legs() < legs_required)
|
||||
to_chat(M, "<span class='warning'>You don't have enough legs to operate the pedals!</span>")
|
||||
unbuckle_mob(M)
|
||||
return ..()
|
||||
|
||||
/obj/vehicle/ridden/attackby(obj/item/I, mob/user, params)
|
||||
if(key_type && !is_key(inserted_key) && is_key(I))
|
||||
if(user.transferItemToLoc(I, src))
|
||||
to_chat(user, "<span class='notice'>You insert \the [I] into \the [src].</span>")
|
||||
if(inserted_key) //just in case there's an invalid key
|
||||
inserted_key.forceMove(drop_location())
|
||||
inserted_key = I
|
||||
else
|
||||
to_chat(user, "<span class='notice'>[I] seems to be stuck to your hand!</span>")
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/vehicle/ridden/AltClick(mob/user)
|
||||
if(inserted_key && user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||
if(!is_occupant(user))
|
||||
to_chat(user, "<span class='notice'>You must be riding the [src] to remove [src]'s key!</span>")
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You remove \the [inserted_key] from \the [src].</span>")
|
||||
inserted_key.forceMove(drop_location())
|
||||
user.put_in_hands(inserted_key)
|
||||
inserted_key = null
|
||||
return ..()
|
||||
|
||||
/obj/vehicle/ridden/driver_move(mob/user, direction)
|
||||
if(key_type && !is_key(inserted_key))
|
||||
to_chat(user, "<span class='warning'>[src] has no key inserted!</span>")
|
||||
return FALSE
|
||||
var/datum/component/riding/R = GetComponent(/datum/component/riding)
|
||||
R.handle_ride(user, direction)
|
||||
return ..()
|
||||
|
||||
/obj/vehicle/ridden/user_buckle_mob(mob/living/M, mob/user, check_loc = TRUE)
|
||||
if(!in_range(user, src) || !in_range(M, src))
|
||||
return FALSE
|
||||
. = ..(M, user, FALSE)
|
||||
|
||||
/obj/vehicle/ridden/buckle_mob(mob/living/M, force = FALSE, check_loc = TRUE)
|
||||
if(!force && occupant_amount() >= max_occupants)
|
||||
return FALSE
|
||||
return ..()
|
||||
/obj/vehicle/ridden
|
||||
name = "ridden vehicle"
|
||||
can_buckle = TRUE
|
||||
max_buckled_mobs = 1
|
||||
buckle_lying = FALSE
|
||||
default_driver_move = FALSE
|
||||
var/legs_required = 1
|
||||
var/arms_required = 0 //why not?
|
||||
|
||||
/obj/vehicle/ridden/Initialize()
|
||||
. = ..()
|
||||
LoadComponent(/datum/component/riding)
|
||||
|
||||
/obj/vehicle/ridden/examine(mob/user)
|
||||
. = ..()
|
||||
if(key_type)
|
||||
if(!inserted_key)
|
||||
. += "<span class='notice'>Put a key inside it by clicking it with the key.</span>"
|
||||
else
|
||||
. += "<span class='notice'>Alt-click [src] to remove the key.</span>"
|
||||
|
||||
/obj/vehicle/ridden/generate_action_type(actiontype)
|
||||
var/datum/action/vehicle/ridden/A = ..()
|
||||
. = A
|
||||
if(istype(A))
|
||||
A.vehicle_ridden_target = src
|
||||
|
||||
/obj/vehicle/ridden/post_unbuckle_mob(mob/living/M)
|
||||
remove_occupant(M)
|
||||
return ..()
|
||||
|
||||
/obj/vehicle/ridden/post_buckle_mob(mob/living/M)
|
||||
add_occupant(M)
|
||||
if(M.get_num_legs() < legs_required)
|
||||
to_chat(M, "<span class='warning'>You don't have enough legs to operate the pedals!</span>")
|
||||
unbuckle_mob(M)
|
||||
return ..()
|
||||
|
||||
/obj/vehicle/ridden/attackby(obj/item/I, mob/user, params)
|
||||
if(key_type && !is_key(inserted_key) && is_key(I))
|
||||
if(user.transferItemToLoc(I, src))
|
||||
to_chat(user, "<span class='notice'>You insert \the [I] into \the [src].</span>")
|
||||
if(inserted_key) //just in case there's an invalid key
|
||||
inserted_key.forceMove(drop_location())
|
||||
inserted_key = I
|
||||
else
|
||||
to_chat(user, "<span class='notice'>[I] seems to be stuck to your hand!</span>")
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/vehicle/ridden/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(inserted_key && user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||
if(!is_occupant(user))
|
||||
to_chat(user, "<span class='notice'>You must be riding the [src] to remove [src]'s key!</span>")
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You remove \the [inserted_key] from \the [src].</span>")
|
||||
inserted_key.forceMove(drop_location())
|
||||
user.put_in_hands(inserted_key)
|
||||
inserted_key = null
|
||||
return TRUE
|
||||
|
||||
/obj/vehicle/ridden/driver_move(mob/user, direction)
|
||||
if(key_type && !is_key(inserted_key))
|
||||
to_chat(user, "<span class='warning'>[src] has no key inserted!</span>")
|
||||
return FALSE
|
||||
var/datum/component/riding/R = GetComponent(/datum/component/riding)
|
||||
R.handle_ride(user, direction)
|
||||
return ..()
|
||||
|
||||
/obj/vehicle/ridden/user_buckle_mob(mob/living/M, mob/user, check_loc = TRUE)
|
||||
if(!in_range(user, src) || !in_range(M, src))
|
||||
return FALSE
|
||||
. = ..(M, user, FALSE)
|
||||
|
||||
/obj/vehicle/ridden/buckle_mob(mob/living/M, force = FALSE, check_loc = TRUE)
|
||||
if(!force && occupant_amount() >= max_occupants)
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
@@ -94,6 +94,7 @@
|
||||
qdel(src)
|
||||
|
||||
/obj/vehicle/ridden/scooter/skateboard/AltClick(mob/user)
|
||||
. = ..()
|
||||
var/datum/component/riding/R = src.GetComponent(/datum/component/riding)
|
||||
if (!adjusted_speed)
|
||||
R.vehicle_move_delay = 0
|
||||
@@ -103,6 +104,7 @@
|
||||
R.vehicle_move_delay = 1
|
||||
to_chat(user, "<span class='notice'>You adjust the wheels on [src] to make it go slower.</span>")
|
||||
adjusted_speed = FALSE
|
||||
return TRUE
|
||||
|
||||
//CONSTRUCTION
|
||||
/obj/item/scooter_frame
|
||||
|
||||
Reference in New Issue
Block a user