Repaths C4 (#808)
* Repaths C4 * Delete tgstation.2.1.3.dmm.rej * Add files via upload * update CitadelStation-1.2.1.dmm
This commit is contained in:
committed by
Poojawa
parent
cd122501fc
commit
257cf986c5
@@ -94,7 +94,7 @@
|
||||
name = "Head of Personnel"
|
||||
|
||||
/obj/effect/landmark/start/librarian
|
||||
name = "Curator"
|
||||
name = "Curator"
|
||||
|
||||
/obj/effect/landmark/start/lawyer
|
||||
name = "Lawyer"
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
return
|
||||
if (istype(M, /atom/movable))
|
||||
if(ismegafauna(M))
|
||||
message_admins("[M] [ADMIN_FLW(M)] has teleported through [src].")
|
||||
message_admins("[M] [ADMIN_FLW(M)] has teleported through [src].")
|
||||
do_teleport(M, target, precision) ///You will appear adjacent to the beacon
|
||||
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
access_mime = 1
|
||||
var/mime_charges = 5
|
||||
|
||||
/obj/item/weapon/cartridge/curator
|
||||
/obj/item/weapon/cartridge/curator
|
||||
name = "\improper Lib-Tweet cartridge"
|
||||
icon_state = "cart-s"
|
||||
access_newscaster = 1
|
||||
|
||||
@@ -12,9 +12,9 @@ GLOBAL_LIST_EMPTY(GPS_list)
|
||||
var/emped = FALSE
|
||||
var/turf/locked_location
|
||||
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
|
||||
|
||||
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/device/gps/Initialize()
|
||||
..()
|
||||
@@ -31,7 +31,7 @@ GLOBAL_LIST_EMPTY(GPS_list)
|
||||
cut_overlay("working")
|
||||
add_overlay("emp")
|
||||
addtimer(CALLBACK(src, .proc/reboot), 300, 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.
|
||||
SStgui.close_uis(src) //Close the UI control if it is open.
|
||||
|
||||
/obj/item/device/gps/proc/reboot()
|
||||
emped = FALSE
|
||||
@@ -39,9 +39,9 @@ GLOBAL_LIST_EMPTY(GPS_list)
|
||||
add_overlay("working")
|
||||
|
||||
/obj/item/device/gps/AltClick(mob/user)
|
||||
toggletracking(user)
|
||||
|
||||
/obj/item/device/gps/proc/toggletracking(mob/user)
|
||||
toggletracking(user)
|
||||
|
||||
/obj/item/device/gps/proc/toggletracking(mob/user)
|
||||
if(!user.canUseTopic(src, be_close=TRUE))
|
||||
return //user not valid to use gps
|
||||
if(emped)
|
||||
@@ -57,80 +57,80 @@ GLOBAL_LIST_EMPTY(GPS_list)
|
||||
tracking = TRUE
|
||||
|
||||
|
||||
/obj/item/device/gps/ui_interact(mob/user, ui_key = "gps", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) // Remember to use the appropriate state.
|
||||
/obj/item/device/gps/ui_interact(mob/user, ui_key = "gps", datum/tgui/ui = null, force_open = 0, 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/device/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)] ([curr.x], [curr.y], [curr.z])"
|
||||
|
||||
var/list/signals = list()
|
||||
data["signals"] = list()
|
||||
|
||||
for(var/gps in GLOB.GPS_list)
|
||||
var/obj/item/device/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/area/gps_area = get_area_name(G)
|
||||
var/list/signal = list()
|
||||
signal["entrytag"] = G.gpstag //Name or 'tag' of the GPS
|
||||
signal["area"] = format_text(gps_area)
|
||||
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/device/gps/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("rename")
|
||||
var/a = input("Please enter desired tag.", name, gpstag) as text
|
||||
a = uppertext(copytext(sanitize(a), 1, 5))
|
||||
gpstag = a
|
||||
name = "global positioning system ([gpstag])"
|
||||
. = TRUE
|
||||
if("power")
|
||||
toggletracking(usr)
|
||||
. = TRUE
|
||||
if("updating")
|
||||
updating = !updating
|
||||
. = TRUE
|
||||
if("globalmode")
|
||||
global_mode = !global_mode
|
||||
. = TRUE
|
||||
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/device/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)] ([curr.x], [curr.y], [curr.z])"
|
||||
|
||||
var/list/signals = list()
|
||||
data["signals"] = list()
|
||||
|
||||
for(var/gps in GLOB.GPS_list)
|
||||
var/obj/item/device/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/area/gps_area = get_area_name(G)
|
||||
var/list/signal = list()
|
||||
signal["entrytag"] = G.gpstag //Name or 'tag' of the GPS
|
||||
signal["area"] = format_text(gps_area)
|
||||
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/device/gps/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("rename")
|
||||
var/a = input("Please enter desired tag.", name, gpstag) as text
|
||||
a = uppertext(copytext(sanitize(a), 1, 5))
|
||||
gpstag = a
|
||||
name = "global positioning system ([gpstag])"
|
||||
. = TRUE
|
||||
if("power")
|
||||
toggletracking(usr)
|
||||
. = TRUE
|
||||
if("updating")
|
||||
updating = !updating
|
||||
. = TRUE
|
||||
if("globalmode")
|
||||
global_mode = !global_mode
|
||||
. = TRUE
|
||||
|
||||
/obj/item/device/gps/Topic(href, href_list)
|
||||
..()
|
||||
|
||||
@@ -95,8 +95,8 @@
|
||||
"[user] activates \the [src]!", \
|
||||
"<span class='notice'>You activate \the [src].</span>",
|
||||
"<span class='italics'>You hear a click.</span>")
|
||||
message_admins("Power sink activated by [ADMIN_LOOKUPFLW(user)] at [ADMIN_COORDJMP(src)]")
|
||||
log_game("Power sink activated by [key_name(user)] at [COORD(src)]")
|
||||
message_admins("Power sink activated by [ADMIN_LOOKUPFLW(user)] at [ADMIN_COORDJMP(src)]")
|
||||
log_game("Power sink activated by [key_name(user)] at [COORD(src)]")
|
||||
set_mode(OPERATING)
|
||||
|
||||
if(OPERATING)
|
||||
|
||||
@@ -178,21 +178,21 @@
|
||||
|
||||
var/log_attacher = ""
|
||||
if(attacher)
|
||||
log_attacher = "[ADMIN_QUE(attacher)] [ADMIN_FLW(attacher)]"
|
||||
log_attacher = "[ADMIN_QUE(attacher)] [ADMIN_FLW(attacher)]"
|
||||
|
||||
var/mob/mob = get_mob_by_key(src.fingerprintslast)
|
||||
var/last_touch_info = ""
|
||||
if(mob)
|
||||
last_touch_info = "[ADMIN_QUE(mob)] [ADMIN_FLW(mob)]"
|
||||
last_touch_info = "[ADMIN_QUE(mob)] [ADMIN_FLW(mob)]"
|
||||
|
||||
var/log_str3 = " Last touched by: [key_name_admin(mob)]"
|
||||
|
||||
var/bomb_message = "[log_str1] [A.name][ADMIN_JMP(bombturf)] [log_str2][log_attacher] [log_str3][last_touch_info]"
|
||||
var/bomb_message = "[log_str1] [A.name][ADMIN_JMP(bombturf)] [log_str2][log_attacher] [log_str3][last_touch_info]"
|
||||
|
||||
GLOB.bombers += bomb_message
|
||||
|
||||
message_admins(bomb_message, 0, 1)
|
||||
log_game("[log_str1] [A.name][COORD(bombturf)] [log_str2] [log_str3]")
|
||||
log_game("[log_str1] [A.name][COORD(bombturf)] [log_str2] [log_str3]")
|
||||
merge_gases()
|
||||
spawn(20) // In case one tank bursts
|
||||
for (var/i=0,i<5,i++)
|
||||
|
||||
@@ -237,7 +237,7 @@
|
||||
/obj/item/borg/upgrade/selfrepair/proc/check_dropped()
|
||||
if(loc != cyborg)
|
||||
toggle_action.Remove(cyborg)
|
||||
QDEL_NULL(toggle_action)
|
||||
QDEL_NULL(toggle_action)
|
||||
cyborg = null
|
||||
deactivate()
|
||||
|
||||
@@ -400,4 +400,4 @@
|
||||
return
|
||||
|
||||
R.make_shell(src)
|
||||
return TRUE
|
||||
return TRUE
|
||||
|
||||
@@ -1,115 +0,0 @@
|
||||
//In this file: C4
|
||||
|
||||
/obj/item/weapon/c4
|
||||
name = "C-4"
|
||||
desc = "Used to put holes in specific areas without too much extra hole."
|
||||
gender = PLURAL
|
||||
icon = 'icons/obj/grenade.dmi'
|
||||
icon_state = "plastic-explosive0"
|
||||
item_state = "plasticx"
|
||||
flags = NOBLUDGEON
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
origin_tech = "syndicate=1"
|
||||
var/timer = 10
|
||||
var/open_panel = 0
|
||||
parent_type = /obj/item/weapon/grenade/plastic/c4
|
||||
|
||||
/obj/item/weapon/c4/New()
|
||||
wires = new /datum/wires/explosive/c4(src)
|
||||
plastic_overlay = mutable_appearance(icon, "plastic-explosive2")
|
||||
..()
|
||||
|
||||
/obj/item/weapon/c4/Destroy()
|
||||
qdel(wires)
|
||||
wires = null
|
||||
target = null
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/c4/suicide_act(mob/user)
|
||||
user.visible_message("<span class='suicide'>[user] activates the [src.name] and holds it above [user.p_their()] head! It looks like [user.p_theyre()] going out with a bang!</span>")
|
||||
var/message_say = "FOR NO RAISIN!"
|
||||
if(user.mind)
|
||||
if(user.mind.special_role)
|
||||
var/role = lowertext(user.mind.special_role)
|
||||
if(role == "traitor" || role == "syndicate")
|
||||
message_say = "FOR THE SYNDICATE!"
|
||||
else if(role == "changeling")
|
||||
message_say = "FOR THE HIVE!"
|
||||
else if(role == "cultist")
|
||||
message_say = "FOR NAR-SIE!"
|
||||
else if(role == "revolutionary" || role == "head revolutionary")
|
||||
message_say = "VIVA LA REVOLUTION!"
|
||||
else if(user.mind.gang_datum)
|
||||
message_say = "[uppertext(user.mind.gang_datum.name)] RULES!"
|
||||
user.say(message_say)
|
||||
target = user
|
||||
message_admins("[ADMIN_LOOKUPFLW(user)] suicided with [name] at [ADMIN_COORDJMP(src)]",0,1)
|
||||
message_admins("[key_name(user)] suicided with [name] at ([x],[y],[z])")
|
||||
sleep(10)
|
||||
explode(get_turf(user))
|
||||
user.gib(1, 1)
|
||||
|
||||
/obj/item/weapon/c4/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
open_panel = !open_panel
|
||||
to_chat(user, "<span class='notice'>You [open_panel ? "open" : "close"] the wire panel.</span>")
|
||||
else if(is_wire_tool(I))
|
||||
wires.interact(user)
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/c4/attack_self(mob/user)
|
||||
var/newtime = input(usr, "Please set the timer.", "Timer", 10) as num
|
||||
if(user.get_active_held_item() == src)
|
||||
newtime = Clamp(newtime, 10, 60000)
|
||||
timer = newtime
|
||||
to_chat(user, "Timer set for [timer] seconds.")
|
||||
|
||||
/obj/item/weapon/c4/afterattack(atom/movable/AM, mob/user, flag)
|
||||
if (!flag)
|
||||
return
|
||||
if (ismob(AM))
|
||||
return
|
||||
if(loc == AM)
|
||||
return
|
||||
if((istype(AM, /obj/item/weapon/storage/)) && !((istype(AM, /obj/item/weapon/storage/secure)) || (istype(AM, /obj/item/weapon/storage/lockbox)))) //If its storage but not secure storage OR a lockbox, then place it inside.
|
||||
return
|
||||
if((istype(AM,/obj/item/weapon/storage/secure)) || (istype(AM, /obj/item/weapon/storage/lockbox)))
|
||||
var/obj/item/weapon/storage/secure/S = AM
|
||||
if(!S.locked) //Literal hacks, this works for lockboxes despite incorrect type casting, because they both share the locked var. But if its unlocked, place it inside, otherwise PLANTING C4!
|
||||
return
|
||||
|
||||
to_chat(user, "<span class='notice'>You start planting the bomb...</span>")
|
||||
|
||||
if(do_after(user, 50, target = AM))
|
||||
if(!user.temporarilyRemoveItemFromInventory(src))
|
||||
return
|
||||
src.target = AM
|
||||
forceMove(null)
|
||||
|
||||
var/message = "[ADMIN_LOOKUPFLW(user)] planted [name] on [target.name] at [ADMIN_COORDJMP(target)] with [timer] second fuse"
|
||||
GLOB.bombers += message
|
||||
message_admins(message,0,1)
|
||||
log_game("[key_name(user)] planted [name] on [target.name] at [COORD(target)] with [timer] second fuse")
|
||||
|
||||
target.add_overlay(plastic_overlay, 1)
|
||||
to_chat(user, "<span class='notice'>You plant the bomb. Timer counting down from [timer].</span>")
|
||||
addtimer(CALLBACK(src, .proc/explode), timer * 10)
|
||||
|
||||
/obj/item/weapon/c4/proc/explode()
|
||||
if(QDELETED(src))
|
||||
return
|
||||
var/turf/location
|
||||
if(target)
|
||||
if(!QDELETED(target))
|
||||
location = get_turf(target)
|
||||
target.cut_overlay(plastic_overlay, TRUE)
|
||||
else
|
||||
location = get_turf(src)
|
||||
if(location)
|
||||
location.ex_act(2, target)
|
||||
explosion(location,0,0,3)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/weapon/c4/attack(mob/M, mob/user, def_zone)
|
||||
return
|
||||
@@ -154,6 +154,115 @@
|
||||
/obj/item/weapon/grenade/plastic/c4
|
||||
name = "C4"
|
||||
desc = "Used to put holes in specific areas without too much extra hole. A saboteur's favorite."
|
||||
gender = PLURAL
|
||||
icon = 'icons/obj/grenade.dmi'
|
||||
icon_state = "plastic-explosive0"
|
||||
item_state = "plasticx"
|
||||
flags = NOBLUDGEON
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
origin_tech = "syndicate=1"
|
||||
var/timer = 10
|
||||
var/open_panel = 0
|
||||
|
||||
/obj/item/weapon/grenade/plastic/c4/New()
|
||||
wires = new /datum/wires/explosive/c4(src)
|
||||
plastic_overlay = mutable_appearance(icon, "plastic-explosive2")
|
||||
..()
|
||||
|
||||
/obj/item/weapon/grenade/plastic/c4/Destroy()
|
||||
qdel(wires)
|
||||
wires = null
|
||||
target = null
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/grenade/plastic/c4/suicide_act(mob/user)
|
||||
user.visible_message("<span class='suicide'>[user] activates the [src.name] and holds it above [user.p_their()] head! It looks like [user.p_theyre()] going out with a bang!</span>")
|
||||
var/message_say = "FOR NO RAISIN!"
|
||||
if(user.mind)
|
||||
if(user.mind.special_role)
|
||||
var/role = lowertext(user.mind.special_role)
|
||||
if(role == "traitor" || role == "syndicate")
|
||||
message_say = "FOR THE SYNDICATE!"
|
||||
else if(role == "changeling")
|
||||
message_say = "FOR THE HIVE!"
|
||||
else if(role == "cultist")
|
||||
message_say = "FOR NAR-SIE!"
|
||||
else if(role == "revolutionary" || role == "head revolutionary")
|
||||
message_say = "VIVA LA REVOLUTION!"
|
||||
else if(user.mind.gang_datum)
|
||||
message_say = "[uppertext(user.mind.gang_datum.name)] RULES!"
|
||||
user.say(message_say)
|
||||
target = user
|
||||
message_admins("[ADMIN_LOOKUPFLW(user)] suicided with [name] at [ADMIN_COORDJMP(src)]",0,1)
|
||||
message_admins("[key_name(user)] suicided with [name] at ([x],[y],[z])")
|
||||
sleep(10)
|
||||
explode(get_turf(user))
|
||||
user.gib(1, 1)
|
||||
|
||||
/obj/item/weapon/grenade/plastic/c4/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
open_panel = !open_panel
|
||||
to_chat(user, "<span class='notice'>You [open_panel ? "open" : "close"] the wire panel.</span>")
|
||||
else if(is_wire_tool(I))
|
||||
wires.interact(user)
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/grenade/plastic/c4/attack_self(mob/user)
|
||||
var/newtime = input(usr, "Please set the timer.", "Timer", 10) as num
|
||||
if(user.get_active_held_item() == src)
|
||||
newtime = Clamp(newtime, 10, 60000)
|
||||
timer = newtime
|
||||
to_chat(user, "Timer set for [timer] seconds.")
|
||||
|
||||
/obj/item/weapon/grenade/plastic/c4/afterattack(atom/movable/AM, mob/user, flag)
|
||||
if (!flag)
|
||||
return
|
||||
if (ismob(AM))
|
||||
return
|
||||
if(loc == AM)
|
||||
return
|
||||
if((istype(AM, /obj/item/weapon/storage/)) && !((istype(AM, /obj/item/weapon/storage/secure)) || (istype(AM, /obj/item/weapon/storage/lockbox)))) //If its storage but not secure storage OR a lockbox, then place it inside.
|
||||
return
|
||||
if((istype(AM,/obj/item/weapon/storage/secure)) || (istype(AM, /obj/item/weapon/storage/lockbox)))
|
||||
var/obj/item/weapon/storage/secure/S = AM
|
||||
if(!S.locked) //Literal hacks, this works for lockboxes despite incorrect type casting, because they both share the locked var. But if its unlocked, place it inside, otherwise PLANTING C4!
|
||||
return
|
||||
|
||||
to_chat(user, "<span class='notice'>You start planting the bomb...</span>")
|
||||
|
||||
if(do_after(user, 50, target = AM))
|
||||
if(!user.temporarilyRemoveItemFromInventory(src))
|
||||
return
|
||||
src.target = AM
|
||||
forceMove(null)
|
||||
|
||||
var/message = "[ADMIN_LOOKUPFLW(user)] planted [name] on [target.name] at [ADMIN_COORDJMP(target)] with [timer] second fuse"
|
||||
GLOB.bombers += message
|
||||
message_admins(message,0,1)
|
||||
log_game("[key_name(user)] planted [name] on [target.name] at [COORD(target)] with [timer] second fuse")
|
||||
|
||||
target.add_overlay(plastic_overlay, 1)
|
||||
to_chat(user, "<span class='notice'>You plant the bomb. Timer counting down from [timer].</span>")
|
||||
addtimer(CALLBACK(src, .proc/explode), timer * 10)
|
||||
|
||||
/obj/item/weapon/grenade/plastic/c4/proc/explode()
|
||||
if(QDELETED(src))
|
||||
return
|
||||
var/turf/location
|
||||
if(target)
|
||||
if(!QDELETED(target))
|
||||
location = get_turf(target)
|
||||
target.cut_overlay(plastic_overlay, TRUE)
|
||||
else
|
||||
location = get_turf(src)
|
||||
if(location)
|
||||
location.ex_act(2, target)
|
||||
explosion(location,0,0,3)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/weapon/grenade/plastic/c4/attack(mob/M, mob/user, def_zone)
|
||||
return
|
||||
|
||||
// X4 is an upgraded directional variant of c4 which is relatively safe to be standing next to. And much less safe to be standing on the other side of.
|
||||
// C4 is intended to be used for infiltration, and destroying tech. X4 is intended to be used for heavy breaching and tight spaces.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/obj/item/weapon/grenade/spawnergrenade
|
||||
desc = "It will unleash an unspecified anomaly into the vicinity."
|
||||
desc = "It will unleash an unspecified anomaly into the vicinity."
|
||||
name = "delivery grenade"
|
||||
icon = 'icons/obj/grenade.dmi'
|
||||
icon_state = "delivery"
|
||||
|
||||
@@ -41,10 +41,10 @@
|
||||
data["open"] = state_open
|
||||
|
||||
data["occupant"] = list()
|
||||
if(occupant)
|
||||
var/mob/living/mob_occupant = occupant
|
||||
data["occupant"]["name"] = mob_occupant.name
|
||||
data["occupant"]["stat"] = mob_occupant.stat
|
||||
if(occupant)
|
||||
var/mob/living/mob_occupant = occupant
|
||||
data["occupant"]["name"] = mob_occupant.name
|
||||
data["occupant"]["stat"] = mob_occupant.stat
|
||||
|
||||
data["special_name"] = special ? special_name : null
|
||||
data["ready_implants"] = ready_implants
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
var/brightness_on = 3
|
||||
|
||||
/obj/item/weapon/melee/energy/Initialize()
|
||||
. = ..()
|
||||
. = ..()
|
||||
if(LAZYLEN(possible_colors))
|
||||
item_color = pick(possible_colors)
|
||||
switch(item_color)//Only run this check if the color was picked randomly, so that colors can be manually set for non-random colored energy weapons.
|
||||
@@ -183,8 +183,8 @@
|
||||
light_color = "#40ceff"
|
||||
possible_colors = null
|
||||
|
||||
/obj/item/weapon/melee/energy/sword/cyborg/saw/Initialize()
|
||||
. = ..()
|
||||
/obj/item/weapon/melee/energy/sword/cyborg/saw/Initialize()
|
||||
. = ..()
|
||||
icon_state = "esaw_0"
|
||||
item_color = null
|
||||
|
||||
@@ -207,9 +207,9 @@
|
||||
|
||||
|
||||
/obj/item/weapon/melee/energy/sword/saber/attackby(obj/item/weapon/W, mob/living/user, params)
|
||||
if(istype(W, /obj/item/device/multitool))
|
||||
if(!hacked)
|
||||
hacked = TRUE
|
||||
if(istype(W, /obj/item/device/multitool))
|
||||
if(!hacked)
|
||||
hacked = TRUE
|
||||
item_color = "rainbow"
|
||||
to_chat(user, "<span class='warning'>RNBW_ENGAGE</span>")
|
||||
|
||||
@@ -243,8 +243,8 @@
|
||||
sharpness = IS_SHARP
|
||||
|
||||
//Most of the other special functions are handled in their own files. aka special snowflake code so kewl
|
||||
/obj/item/weapon/melee/energy/blade/Initialize()
|
||||
. = ..()
|
||||
/obj/item/weapon/melee/energy/blade/Initialize()
|
||||
. = ..()
|
||||
spark_system = new /datum/effect_system/spark_spread()
|
||||
spark_system.set_up(5, 0, src)
|
||||
spark_system.attach(src)
|
||||
|
||||
@@ -296,7 +296,7 @@
|
||||
/obj/item/weapon/lighter,
|
||||
/obj/item/device/multitool,
|
||||
/obj/item/weapon/reagent_containers/food/drinks/bottle/molotov,
|
||||
/obj/item/weapon/c4,
|
||||
/obj/item/weapon/grenade/plastic/c4,
|
||||
)
|
||||
/obj/item/weapon/storage/belt/grenade/full/PopulateContents()
|
||||
new /obj/item/weapon/grenade/flashbang(src)
|
||||
|
||||
@@ -71,9 +71,9 @@
|
||||
icon_state = "refill_clothes"
|
||||
charges = list(31, 4, 4)// of 101 standard, 12 contraband, 10 premium(?)
|
||||
init_charges = list(31, 4, 4)
|
||||
|
||||
/obj/item/weapon/vending_refill/medical
|
||||
machine_name = "NanoMed"
|
||||
icon_state = "refill_medical"
|
||||
charges = list(26, 5, 3)// of 76 standard, 13 contraband, 8 premium
|
||||
|
||||
/obj/item/weapon/vending_refill/medical
|
||||
machine_name = "NanoMed"
|
||||
icon_state = "refill_medical"
|
||||
charges = list(26, 5, 3)// of 76 standard, 13 contraband, 8 premium
|
||||
init_charges = list(26, 5, 3)
|
||||
@@ -390,7 +390,7 @@
|
||||
desc = "A chainsaw that has replaced your arm."
|
||||
icon_state = "chainsaw_on"
|
||||
item_state = "mounted_chainsaw"
|
||||
flags = NODROP | ABSTRACT | DROPDEL
|
||||
flags = NODROP | ABSTRACT | DROPDEL
|
||||
w_class = WEIGHT_CLASS_HUGE
|
||||
force = 21
|
||||
throwforce = 0
|
||||
@@ -400,17 +400,17 @@
|
||||
attack_verb = list("sawed", "torn", "cut", "chopped", "diced")
|
||||
hitsound = 'sound/weapons/chainsawhit.ogg'
|
||||
|
||||
/obj/item/weapon/mounted_chainsaw/Destroy()
|
||||
var/obj/item/bodypart/part
|
||||
/obj/item/weapon/mounted_chainsaw/Destroy()
|
||||
var/obj/item/bodypart/part
|
||||
new /obj/item/weapon/twohanded/required/chainsaw(get_turf(src))
|
||||
if(iscarbon(loc))
|
||||
var/mob/living/carbon/holder = loc
|
||||
var/index = holder.get_held_index_of_item(src)
|
||||
if(index)
|
||||
part = holder.hand_bodyparts[index]
|
||||
. = ..()
|
||||
if(part)
|
||||
part.drop_limb()
|
||||
if(iscarbon(loc))
|
||||
var/mob/living/carbon/holder = loc
|
||||
var/index = holder.get_held_index_of_item(src)
|
||||
if(index)
|
||||
part = holder.hand_bodyparts[index]
|
||||
. = ..()
|
||||
if(part)
|
||||
part.drop_limb()
|
||||
|
||||
/obj/item/weapon/statuebust
|
||||
name = "bust"
|
||||
|
||||
@@ -106,11 +106,11 @@ LINEN BINS
|
||||
icon_state = "sheetrd"
|
||||
item_color = "director"
|
||||
|
||||
// for Free Golems.
|
||||
/obj/item/weapon/bedsheet/rd/royal_cape
|
||||
name = "Royal Cape of the Liberator"
|
||||
desc = "Majestic."
|
||||
|
||||
// for Free Golems.
|
||||
/obj/item/weapon/bedsheet/rd/royal_cape
|
||||
name = "Royal Cape of the Liberator"
|
||||
desc = "Majestic."
|
||||
|
||||
/obj/item/weapon/bedsheet/medical
|
||||
name = "medical blanket"
|
||||
desc = "It's a sterilized* blanket commonly used in the Medbay. *Sterilization is voided if a virologist is present onboard the station."
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
else
|
||||
new /obj/item/weapon/storage/backpack/satchel/cap(src)
|
||||
new /obj/item/clothing/neck/cloak/cap(src)
|
||||
new /obj/item/weapon/storage/daki(src)
|
||||
new /obj/item/weapon/storage/daki(src)
|
||||
new /obj/item/weapon/storage/backpack/dufflebag/captain(src)
|
||||
new /obj/item/clothing/head/crown/fancy(src)
|
||||
new /obj/item/clothing/suit/captunic(src)
|
||||
|
||||
@@ -1,361 +1,361 @@
|
||||
/obj/structure/displaycase
|
||||
name = "display case"
|
||||
icon = 'icons/obj/stationobjs.dmi'
|
||||
icon_state = "glassbox0"
|
||||
desc = "A display case for prized possessions."
|
||||
density = 1
|
||||
anchored = 1
|
||||
resistance_flags = ACID_PROOF
|
||||
armor = list(melee = 30, bullet = 0, laser = 0, energy = 0, bomb = 10, bio = 0, rad = 0, fire = 70, acid = 100)
|
||||
obj_integrity = 200
|
||||
max_integrity = 200
|
||||
integrity_failure = 50
|
||||
var/obj/item/showpiece = null
|
||||
var/alert = TRUE
|
||||
var/open = FALSE
|
||||
var/openable = TRUE
|
||||
var/obj/item/weapon/electronics/airlock/electronics
|
||||
var/start_showpiece_type = null //add type for items on display
|
||||
|
||||
/obj/structure/displaycase/Initialize()
|
||||
. = ..()
|
||||
if(start_showpiece_type)
|
||||
showpiece = new start_showpiece_type (src)
|
||||
update_icon()
|
||||
|
||||
/obj/structure/displaycase/Destroy()
|
||||
if(electronics)
|
||||
QDEL_NULL(electronics)
|
||||
if(showpiece)
|
||||
QDEL_NULL(showpiece)
|
||||
return ..()
|
||||
|
||||
/obj/structure/displaycase/examine(mob/user)
|
||||
..()
|
||||
if(alert)
|
||||
to_chat(user, "<span class='notice'>Hooked up with an anti-theft system.</span>")
|
||||
if(showpiece)
|
||||
to_chat(user, "<span class='notice'>There's [showpiece] inside.</span>")
|
||||
|
||||
|
||||
/obj/structure/displaycase/proc/dump()
|
||||
if (showpiece)
|
||||
showpiece.forceMove(loc)
|
||||
showpiece = null
|
||||
|
||||
/obj/structure/displaycase/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
|
||||
switch(damage_type)
|
||||
if(BRUTE)
|
||||
playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1)
|
||||
if(BURN)
|
||||
playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
|
||||
|
||||
/obj/structure/displaycase/deconstruct(disassembled = TRUE)
|
||||
if(!(flags & NODECONSTRUCT))
|
||||
dump()
|
||||
if(!disassembled)
|
||||
new /obj/item/weapon/shard( src.loc )
|
||||
trigger_alarm()
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/displaycase/obj_break(damage_flag)
|
||||
if(!broken && !(flags & NODECONSTRUCT))
|
||||
density = 0
|
||||
broken = 1
|
||||
new /obj/item/weapon/shard( src.loc )
|
||||
playsound(src, "shatter", 70, 1)
|
||||
update_icon()
|
||||
trigger_alarm()
|
||||
|
||||
/obj/structure/displaycase/proc/trigger_alarm()
|
||||
//Activate Anti-theft
|
||||
if(alert)
|
||||
var/area/alarmed = get_area(src)
|
||||
alarmed.burglaralert(src)
|
||||
playsound(src, 'sound/effects/alert.ogg', 50, 1)
|
||||
|
||||
/*
|
||||
|
||||
*/
|
||||
|
||||
/obj/structure/displaycase/proc/is_directional(atom/A)
|
||||
try
|
||||
getFlatIcon(A,defdir=4)
|
||||
catch
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/structure/displaycase/proc/get_flat_icon_directional(atom/A)
|
||||
//Get flatIcon even if dir is mismatched for directionless icons
|
||||
//SLOW
|
||||
var/icon/I
|
||||
if(is_directional(A))
|
||||
I = getFlatIcon(A)
|
||||
else
|
||||
var/old_dir = A.dir
|
||||
A.setDir(2)
|
||||
I = getFlatIcon(A)
|
||||
A.setDir(old_dir)
|
||||
return I
|
||||
|
||||
/obj/structure/displaycase/update_icon()
|
||||
var/icon/I
|
||||
if(open)
|
||||
I = icon('icons/obj/stationobjs.dmi',"glassbox_open")
|
||||
else
|
||||
I = icon('icons/obj/stationobjs.dmi',"glassbox0")
|
||||
if(broken)
|
||||
I = icon('icons/obj/stationobjs.dmi',"glassboxb0")
|
||||
if(showpiece)
|
||||
var/icon/S = get_flat_icon_directional(showpiece)
|
||||
S.Scale(17,17)
|
||||
I.Blend(S,ICON_UNDERLAY,8,8)
|
||||
src.icon = I
|
||||
return
|
||||
|
||||
/obj/structure/displaycase/attackby(obj/item/weapon/W, mob/user, params)
|
||||
if(W.GetID() && !broken && openable)
|
||||
if(allowed(user))
|
||||
to_chat(user, "<span class='notice'>You [open ? "close":"open"] the [src]</span>")
|
||||
toggle_lock(user)
|
||||
else
|
||||
to_chat(user, "<span class='warning'>Access denied.</span>")
|
||||
else if(istype(W, /obj/item/weapon/weldingtool) && user.a_intent == INTENT_HELP && !broken)
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if(obj_integrity < max_integrity && WT.remove_fuel(5, user))
|
||||
to_chat(user, "<span class='notice'>You begin repairing [src].</span>")
|
||||
playsound(loc, WT.usesound, 40, 1)
|
||||
if(do_after(user, 40*W.toolspeed, target = src))
|
||||
obj_integrity = max_integrity
|
||||
playsound(loc, 'sound/items/Welder2.ogg', 50, 1)
|
||||
update_icon()
|
||||
to_chat(user, "<span class='notice'>You repair [src].</span>")
|
||||
else
|
||||
to_chat(user, "<span class='warning'>[src] is already in good condition!</span>")
|
||||
return
|
||||
else if(!alert && istype(W,/obj/item/weapon/crowbar) && openable) //Only applies to the lab cage and player made display cases
|
||||
if(broken)
|
||||
if(showpiece)
|
||||
to_chat(user, "<span class='notice'>Remove the displayed object first.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You remove the destroyed case</span>")
|
||||
qdel(src)
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You start to [open ? "close":"open"] the [src]</span>")
|
||||
if(do_after(user, 20*W.toolspeed, target = src))
|
||||
to_chat(user, "<span class='notice'>You [open ? "close":"open"] the [src]</span>")
|
||||
toggle_lock(user)
|
||||
else if(open && !showpiece)
|
||||
if(user.transferItemToLoc(W, src))
|
||||
showpiece = W
|
||||
to_chat(user, "<span class='notice'>You put [W] on display</span>")
|
||||
update_icon()
|
||||
else if(istype(W, /obj/item/stack/sheet/glass) && broken)
|
||||
var/obj/item/stack/sheet/glass/G = W
|
||||
if(G.get_amount() < 2)
|
||||
to_chat(user, "<span class='warning'>You need two glass sheets to fix the case!</span>")
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You start fixing [src]...</span>")
|
||||
if(do_after(user, 20, target = src))
|
||||
G.use(2)
|
||||
broken = 0
|
||||
obj_integrity = max_integrity
|
||||
update_icon()
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/structure/displaycase/proc/toggle_lock(mob/user)
|
||||
open = !open
|
||||
update_icon()
|
||||
|
||||
/obj/structure/displaycase/attack_paw(mob/user)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/structure/displaycase/attack_hand(mob/user)
|
||||
user.changeNext_move(CLICK_CD_MELEE)
|
||||
if (showpiece && (broken || open))
|
||||
to_chat(user, "<span class='notice'>You deactivate the hover field built into the case.</span>")
|
||||
dump()
|
||||
src.add_fingerprint(user)
|
||||
update_icon()
|
||||
return
|
||||
else
|
||||
//prevents remote "kicks" with TK
|
||||
if (!Adjacent(user))
|
||||
return
|
||||
user.visible_message("<span class='danger'>[user] kicks the display case.</span>", null, null, COMBAT_MESSAGE_RANGE)
|
||||
user.do_attack_animation(src, ATTACK_EFFECT_KICK)
|
||||
take_damage(2)
|
||||
|
||||
|
||||
|
||||
/obj/structure/displaycase_chassis
|
||||
anchored = 1
|
||||
density = 0
|
||||
name = "display case chassis"
|
||||
desc = "wooden base of display case"
|
||||
icon = 'icons/obj/stationobjs.dmi'
|
||||
icon_state = "glassbox_chassis"
|
||||
var/obj/item/weapon/electronics/airlock/electronics
|
||||
|
||||
|
||||
/obj/structure/displaycase_chassis/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/weapon/wrench)) //The player can only deconstruct the wooden frame
|
||||
to_chat(user, "<span class='notice'>You start disassembling [src]...</span>")
|
||||
playsound(src.loc, I.usesound, 50, 1)
|
||||
if(do_after(user, 30*I.toolspeed, target = src))
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
new /obj/item/stack/sheet/mineral/wood(get_turf(src), 5)
|
||||
qdel(src)
|
||||
|
||||
else if(istype(I, /obj/item/weapon/electronics/airlock))
|
||||
to_chat(user, "<span class='notice'>You start installing the electronics into [src]...</span>")
|
||||
playsound(src.loc, I.usesound, 50, 1)
|
||||
if(do_after(user, 30, target = src) && user.transferItemToLoc(I,src))
|
||||
electronics = I
|
||||
to_chat(user, "<span class='notice'>You install the airlock electronics.</span>")
|
||||
|
||||
else if(istype(I, /obj/item/stack/sheet/glass))
|
||||
var/obj/item/stack/sheet/glass/G = I
|
||||
if(G.get_amount() < 10)
|
||||
to_chat(user, "<span class='warning'>You need ten glass sheets to do this!</span>")
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You start adding [G] to [src]...</span>")
|
||||
if(do_after(user, 20, target = src))
|
||||
G.use(10)
|
||||
var/obj/structure/displaycase/display = new(src.loc)
|
||||
if(electronics)
|
||||
electronics.loc = display
|
||||
display.electronics = electronics
|
||||
if(electronics.one_access)
|
||||
display.req_one_access = electronics.accesses
|
||||
else
|
||||
display.req_access = electronics.accesses
|
||||
qdel(src)
|
||||
else
|
||||
return ..()
|
||||
|
||||
//The captains display case requiring specops ID access is intentional.
|
||||
//The lab cage and captains display case do not spawn with electronics, which is why req_access is needed.
|
||||
/obj/structure/displaycase/captain
|
||||
alert = 1
|
||||
start_showpiece_type = /obj/item/weapon/gun/energy/laser/captain
|
||||
req_access = list(GLOB.access_cent_specops)
|
||||
|
||||
/obj/structure/displaycase/labcage
|
||||
name = "lab cage"
|
||||
desc = "A glass lab container for storing interesting creatures."
|
||||
start_showpiece_type = /obj/item/clothing/mask/facehugger/lamarr
|
||||
req_access = list(GLOB.access_rd)
|
||||
|
||||
/obj/structure/displaycase/trophy
|
||||
name = "trophy display case"
|
||||
desc = "Store your trophies of accomplishment in here, and they will stay forever."
|
||||
var/trophy_message = ""
|
||||
var/placer_key = ""
|
||||
var/added_roundstart = TRUE
|
||||
var/is_locked = TRUE
|
||||
|
||||
alert = TRUE
|
||||
integrity_failure = 0
|
||||
openable = FALSE
|
||||
|
||||
/obj/structure/displaycase/trophy/Initialize()
|
||||
. = ..()
|
||||
GLOB.trophy_cases += src
|
||||
|
||||
/obj/structure/displaycase/trophy/Destroy()
|
||||
GLOB.trophy_cases -= src
|
||||
return ..()
|
||||
|
||||
/obj/structure/displaycase/trophy/examine(mob/user)
|
||||
..()
|
||||
if(trophy_message)
|
||||
to_chat(user, "The plaque reads:")
|
||||
to_chat(user, trophy_message)
|
||||
|
||||
/obj/structure/displaycase/trophy/attackby(obj/item/weapon/W, mob/user, params)
|
||||
|
||||
if(!user.Adjacent(src)) //no TK museology
|
||||
return
|
||||
if(user.a_intent == INTENT_HARM)
|
||||
return ..()
|
||||
|
||||
if(user.is_holding_item_of_type(/obj/item/key/displaycase))
|
||||
if(added_roundstart)
|
||||
is_locked = !is_locked
|
||||
to_chat(user, "You [!is_locked ? "un" : ""]lock the case.")
|
||||
else
|
||||
to_chat(user, "<span class='danger'>The lock is stuck shut!</span>")
|
||||
return
|
||||
|
||||
if(is_locked)
|
||||
to_chat(user, "<span class='danger'>The case is shut tight with an old fashioned physical lock. Maybe you should ask the curator for the key?</span>")
|
||||
return
|
||||
|
||||
if(!added_roundstart)
|
||||
to_chat(user, "You've already put something new in this case.")
|
||||
return
|
||||
|
||||
if(is_type_in_typecache(W, GLOB.blacklisted_cargo_types))
|
||||
to_chat(user, "<span class='danger'>The case rejects the [W].</span>")
|
||||
return
|
||||
|
||||
for(var/a in W.GetAllContents())
|
||||
if(is_type_in_typecache(a, GLOB.blacklisted_cargo_types))
|
||||
to_chat(user, "<span class='danger'>The case rejects the [W].</span>")
|
||||
return
|
||||
|
||||
if(user.transferItemToLoc(W, src))
|
||||
|
||||
if(showpiece)
|
||||
to_chat(user, "You press a button, and [showpiece] descends into the floor of the case.")
|
||||
QDEL_NULL(showpiece)
|
||||
|
||||
to_chat(user, "You insert [W] into the case.")
|
||||
showpiece = W
|
||||
added_roundstart = FALSE
|
||||
update_icon()
|
||||
|
||||
placer_key = user.ckey
|
||||
|
||||
trophy_message = W.desc //default value
|
||||
|
||||
var/chosen_plaque = stripped_input(user, "What would you like the plaque to say? Default value is item's description.", "Trophy Plaque")
|
||||
if(chosen_plaque)
|
||||
if(user.Adjacent(src))
|
||||
trophy_message = chosen_plaque
|
||||
to_chat(user, "You set the plaque's text.")
|
||||
else
|
||||
to_chat(user, "You are too far to set the plaque's text.")
|
||||
|
||||
SSpersistence.SaveTrophy(src)
|
||||
return TRUE
|
||||
|
||||
else
|
||||
to_chat(user, "<span class='warning'>\The [W] is stuck to your hand, you can't put it in the [src.name]!</span>")
|
||||
|
||||
return
|
||||
|
||||
/obj/structure/displaycase/trophy/dump()
|
||||
if (showpiece)
|
||||
if(added_roundstart)
|
||||
visible_message("<span class='danger'>The [showpiece] crumbles to dust!</span>")
|
||||
new /obj/effect/decal/cleanable/ash(loc)
|
||||
QDEL_NULL(showpiece)
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/key/displaycase
|
||||
name = "display case key"
|
||||
desc = "The key to the curator's display cases."
|
||||
|
||||
/obj/item/showpiece_dummy
|
||||
name = "Cheap replica"
|
||||
|
||||
/obj/item/showpiece_dummy/Initialize(mapload, path)
|
||||
. = ..()
|
||||
var/obj/item/I = path
|
||||
name = initial(I.name)
|
||||
icon = initial(I.icon)
|
||||
icon_state = initial(I.icon_state)
|
||||
/obj/structure/displaycase
|
||||
name = "display case"
|
||||
icon = 'icons/obj/stationobjs.dmi'
|
||||
icon_state = "glassbox0"
|
||||
desc = "A display case for prized possessions."
|
||||
density = 1
|
||||
anchored = 1
|
||||
resistance_flags = ACID_PROOF
|
||||
armor = list(melee = 30, bullet = 0, laser = 0, energy = 0, bomb = 10, bio = 0, rad = 0, fire = 70, acid = 100)
|
||||
obj_integrity = 200
|
||||
max_integrity = 200
|
||||
integrity_failure = 50
|
||||
var/obj/item/showpiece = null
|
||||
var/alert = TRUE
|
||||
var/open = FALSE
|
||||
var/openable = TRUE
|
||||
var/obj/item/weapon/electronics/airlock/electronics
|
||||
var/start_showpiece_type = null //add type for items on display
|
||||
|
||||
/obj/structure/displaycase/Initialize()
|
||||
. = ..()
|
||||
if(start_showpiece_type)
|
||||
showpiece = new start_showpiece_type (src)
|
||||
update_icon()
|
||||
|
||||
/obj/structure/displaycase/Destroy()
|
||||
if(electronics)
|
||||
QDEL_NULL(electronics)
|
||||
if(showpiece)
|
||||
QDEL_NULL(showpiece)
|
||||
return ..()
|
||||
|
||||
/obj/structure/displaycase/examine(mob/user)
|
||||
..()
|
||||
if(alert)
|
||||
to_chat(user, "<span class='notice'>Hooked up with an anti-theft system.</span>")
|
||||
if(showpiece)
|
||||
to_chat(user, "<span class='notice'>There's [showpiece] inside.</span>")
|
||||
|
||||
|
||||
/obj/structure/displaycase/proc/dump()
|
||||
if (showpiece)
|
||||
showpiece.forceMove(loc)
|
||||
showpiece = null
|
||||
|
||||
/obj/structure/displaycase/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
|
||||
switch(damage_type)
|
||||
if(BRUTE)
|
||||
playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1)
|
||||
if(BURN)
|
||||
playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
|
||||
|
||||
/obj/structure/displaycase/deconstruct(disassembled = TRUE)
|
||||
if(!(flags & NODECONSTRUCT))
|
||||
dump()
|
||||
if(!disassembled)
|
||||
new /obj/item/weapon/shard( src.loc )
|
||||
trigger_alarm()
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/displaycase/obj_break(damage_flag)
|
||||
if(!broken && !(flags & NODECONSTRUCT))
|
||||
density = 0
|
||||
broken = 1
|
||||
new /obj/item/weapon/shard( src.loc )
|
||||
playsound(src, "shatter", 70, 1)
|
||||
update_icon()
|
||||
trigger_alarm()
|
||||
|
||||
/obj/structure/displaycase/proc/trigger_alarm()
|
||||
//Activate Anti-theft
|
||||
if(alert)
|
||||
var/area/alarmed = get_area(src)
|
||||
alarmed.burglaralert(src)
|
||||
playsound(src, 'sound/effects/alert.ogg', 50, 1)
|
||||
|
||||
/*
|
||||
|
||||
*/
|
||||
|
||||
/obj/structure/displaycase/proc/is_directional(atom/A)
|
||||
try
|
||||
getFlatIcon(A,defdir=4)
|
||||
catch
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/structure/displaycase/proc/get_flat_icon_directional(atom/A)
|
||||
//Get flatIcon even if dir is mismatched for directionless icons
|
||||
//SLOW
|
||||
var/icon/I
|
||||
if(is_directional(A))
|
||||
I = getFlatIcon(A)
|
||||
else
|
||||
var/old_dir = A.dir
|
||||
A.setDir(2)
|
||||
I = getFlatIcon(A)
|
||||
A.setDir(old_dir)
|
||||
return I
|
||||
|
||||
/obj/structure/displaycase/update_icon()
|
||||
var/icon/I
|
||||
if(open)
|
||||
I = icon('icons/obj/stationobjs.dmi',"glassbox_open")
|
||||
else
|
||||
I = icon('icons/obj/stationobjs.dmi',"glassbox0")
|
||||
if(broken)
|
||||
I = icon('icons/obj/stationobjs.dmi',"glassboxb0")
|
||||
if(showpiece)
|
||||
var/icon/S = get_flat_icon_directional(showpiece)
|
||||
S.Scale(17,17)
|
||||
I.Blend(S,ICON_UNDERLAY,8,8)
|
||||
src.icon = I
|
||||
return
|
||||
|
||||
/obj/structure/displaycase/attackby(obj/item/weapon/W, mob/user, params)
|
||||
if(W.GetID() && !broken && openable)
|
||||
if(allowed(user))
|
||||
to_chat(user, "<span class='notice'>You [open ? "close":"open"] the [src]</span>")
|
||||
toggle_lock(user)
|
||||
else
|
||||
to_chat(user, "<span class='warning'>Access denied.</span>")
|
||||
else if(istype(W, /obj/item/weapon/weldingtool) && user.a_intent == INTENT_HELP && !broken)
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if(obj_integrity < max_integrity && WT.remove_fuel(5, user))
|
||||
to_chat(user, "<span class='notice'>You begin repairing [src].</span>")
|
||||
playsound(loc, WT.usesound, 40, 1)
|
||||
if(do_after(user, 40*W.toolspeed, target = src))
|
||||
obj_integrity = max_integrity
|
||||
playsound(loc, 'sound/items/Welder2.ogg', 50, 1)
|
||||
update_icon()
|
||||
to_chat(user, "<span class='notice'>You repair [src].</span>")
|
||||
else
|
||||
to_chat(user, "<span class='warning'>[src] is already in good condition!</span>")
|
||||
return
|
||||
else if(!alert && istype(W,/obj/item/weapon/crowbar) && openable) //Only applies to the lab cage and player made display cases
|
||||
if(broken)
|
||||
if(showpiece)
|
||||
to_chat(user, "<span class='notice'>Remove the displayed object first.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You remove the destroyed case</span>")
|
||||
qdel(src)
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You start to [open ? "close":"open"] the [src]</span>")
|
||||
if(do_after(user, 20*W.toolspeed, target = src))
|
||||
to_chat(user, "<span class='notice'>You [open ? "close":"open"] the [src]</span>")
|
||||
toggle_lock(user)
|
||||
else if(open && !showpiece)
|
||||
if(user.transferItemToLoc(W, src))
|
||||
showpiece = W
|
||||
to_chat(user, "<span class='notice'>You put [W] on display</span>")
|
||||
update_icon()
|
||||
else if(istype(W, /obj/item/stack/sheet/glass) && broken)
|
||||
var/obj/item/stack/sheet/glass/G = W
|
||||
if(G.get_amount() < 2)
|
||||
to_chat(user, "<span class='warning'>You need two glass sheets to fix the case!</span>")
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You start fixing [src]...</span>")
|
||||
if(do_after(user, 20, target = src))
|
||||
G.use(2)
|
||||
broken = 0
|
||||
obj_integrity = max_integrity
|
||||
update_icon()
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/structure/displaycase/proc/toggle_lock(mob/user)
|
||||
open = !open
|
||||
update_icon()
|
||||
|
||||
/obj/structure/displaycase/attack_paw(mob/user)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/structure/displaycase/attack_hand(mob/user)
|
||||
user.changeNext_move(CLICK_CD_MELEE)
|
||||
if (showpiece && (broken || open))
|
||||
to_chat(user, "<span class='notice'>You deactivate the hover field built into the case.</span>")
|
||||
dump()
|
||||
src.add_fingerprint(user)
|
||||
update_icon()
|
||||
return
|
||||
else
|
||||
//prevents remote "kicks" with TK
|
||||
if (!Adjacent(user))
|
||||
return
|
||||
user.visible_message("<span class='danger'>[user] kicks the display case.</span>", null, null, COMBAT_MESSAGE_RANGE)
|
||||
user.do_attack_animation(src, ATTACK_EFFECT_KICK)
|
||||
take_damage(2)
|
||||
|
||||
|
||||
|
||||
/obj/structure/displaycase_chassis
|
||||
anchored = 1
|
||||
density = 0
|
||||
name = "display case chassis"
|
||||
desc = "wooden base of display case"
|
||||
icon = 'icons/obj/stationobjs.dmi'
|
||||
icon_state = "glassbox_chassis"
|
||||
var/obj/item/weapon/electronics/airlock/electronics
|
||||
|
||||
|
||||
/obj/structure/displaycase_chassis/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/weapon/wrench)) //The player can only deconstruct the wooden frame
|
||||
to_chat(user, "<span class='notice'>You start disassembling [src]...</span>")
|
||||
playsound(src.loc, I.usesound, 50, 1)
|
||||
if(do_after(user, 30*I.toolspeed, target = src))
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
new /obj/item/stack/sheet/mineral/wood(get_turf(src), 5)
|
||||
qdel(src)
|
||||
|
||||
else if(istype(I, /obj/item/weapon/electronics/airlock))
|
||||
to_chat(user, "<span class='notice'>You start installing the electronics into [src]...</span>")
|
||||
playsound(src.loc, I.usesound, 50, 1)
|
||||
if(do_after(user, 30, target = src) && user.transferItemToLoc(I,src))
|
||||
electronics = I
|
||||
to_chat(user, "<span class='notice'>You install the airlock electronics.</span>")
|
||||
|
||||
else if(istype(I, /obj/item/stack/sheet/glass))
|
||||
var/obj/item/stack/sheet/glass/G = I
|
||||
if(G.get_amount() < 10)
|
||||
to_chat(user, "<span class='warning'>You need ten glass sheets to do this!</span>")
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You start adding [G] to [src]...</span>")
|
||||
if(do_after(user, 20, target = src))
|
||||
G.use(10)
|
||||
var/obj/structure/displaycase/display = new(src.loc)
|
||||
if(electronics)
|
||||
electronics.loc = display
|
||||
display.electronics = electronics
|
||||
if(electronics.one_access)
|
||||
display.req_one_access = electronics.accesses
|
||||
else
|
||||
display.req_access = electronics.accesses
|
||||
qdel(src)
|
||||
else
|
||||
return ..()
|
||||
|
||||
//The captains display case requiring specops ID access is intentional.
|
||||
//The lab cage and captains display case do not spawn with electronics, which is why req_access is needed.
|
||||
/obj/structure/displaycase/captain
|
||||
alert = 1
|
||||
start_showpiece_type = /obj/item/weapon/gun/energy/laser/captain
|
||||
req_access = list(GLOB.access_cent_specops)
|
||||
|
||||
/obj/structure/displaycase/labcage
|
||||
name = "lab cage"
|
||||
desc = "A glass lab container for storing interesting creatures."
|
||||
start_showpiece_type = /obj/item/clothing/mask/facehugger/lamarr
|
||||
req_access = list(GLOB.access_rd)
|
||||
|
||||
/obj/structure/displaycase/trophy
|
||||
name = "trophy display case"
|
||||
desc = "Store your trophies of accomplishment in here, and they will stay forever."
|
||||
var/trophy_message = ""
|
||||
var/placer_key = ""
|
||||
var/added_roundstart = TRUE
|
||||
var/is_locked = TRUE
|
||||
|
||||
alert = TRUE
|
||||
integrity_failure = 0
|
||||
openable = FALSE
|
||||
|
||||
/obj/structure/displaycase/trophy/Initialize()
|
||||
. = ..()
|
||||
GLOB.trophy_cases += src
|
||||
|
||||
/obj/structure/displaycase/trophy/Destroy()
|
||||
GLOB.trophy_cases -= src
|
||||
return ..()
|
||||
|
||||
/obj/structure/displaycase/trophy/examine(mob/user)
|
||||
..()
|
||||
if(trophy_message)
|
||||
to_chat(user, "The plaque reads:")
|
||||
to_chat(user, trophy_message)
|
||||
|
||||
/obj/structure/displaycase/trophy/attackby(obj/item/weapon/W, mob/user, params)
|
||||
|
||||
if(!user.Adjacent(src)) //no TK museology
|
||||
return
|
||||
if(user.a_intent == INTENT_HARM)
|
||||
return ..()
|
||||
|
||||
if(user.is_holding_item_of_type(/obj/item/key/displaycase))
|
||||
if(added_roundstart)
|
||||
is_locked = !is_locked
|
||||
to_chat(user, "You [!is_locked ? "un" : ""]lock the case.")
|
||||
else
|
||||
to_chat(user, "<span class='danger'>The lock is stuck shut!</span>")
|
||||
return
|
||||
|
||||
if(is_locked)
|
||||
to_chat(user, "<span class='danger'>The case is shut tight with an old fashioned physical lock. Maybe you should ask the curator for the key?</span>")
|
||||
return
|
||||
|
||||
if(!added_roundstart)
|
||||
to_chat(user, "You've already put something new in this case.")
|
||||
return
|
||||
|
||||
if(is_type_in_typecache(W, GLOB.blacklisted_cargo_types))
|
||||
to_chat(user, "<span class='danger'>The case rejects the [W].</span>")
|
||||
return
|
||||
|
||||
for(var/a in W.GetAllContents())
|
||||
if(is_type_in_typecache(a, GLOB.blacklisted_cargo_types))
|
||||
to_chat(user, "<span class='danger'>The case rejects the [W].</span>")
|
||||
return
|
||||
|
||||
if(user.transferItemToLoc(W, src))
|
||||
|
||||
if(showpiece)
|
||||
to_chat(user, "You press a button, and [showpiece] descends into the floor of the case.")
|
||||
QDEL_NULL(showpiece)
|
||||
|
||||
to_chat(user, "You insert [W] into the case.")
|
||||
showpiece = W
|
||||
added_roundstart = FALSE
|
||||
update_icon()
|
||||
|
||||
placer_key = user.ckey
|
||||
|
||||
trophy_message = W.desc //default value
|
||||
|
||||
var/chosen_plaque = stripped_input(user, "What would you like the plaque to say? Default value is item's description.", "Trophy Plaque")
|
||||
if(chosen_plaque)
|
||||
if(user.Adjacent(src))
|
||||
trophy_message = chosen_plaque
|
||||
to_chat(user, "You set the plaque's text.")
|
||||
else
|
||||
to_chat(user, "You are too far to set the plaque's text.")
|
||||
|
||||
SSpersistence.SaveTrophy(src)
|
||||
return TRUE
|
||||
|
||||
else
|
||||
to_chat(user, "<span class='warning'>\The [W] is stuck to your hand, you can't put it in the [src.name]!</span>")
|
||||
|
||||
return
|
||||
|
||||
/obj/structure/displaycase/trophy/dump()
|
||||
if (showpiece)
|
||||
if(added_roundstart)
|
||||
visible_message("<span class='danger'>The [showpiece] crumbles to dust!</span>")
|
||||
new /obj/effect/decal/cleanable/ash(loc)
|
||||
QDEL_NULL(showpiece)
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/key/displaycase
|
||||
name = "display case key"
|
||||
desc = "The key to the curator's display cases."
|
||||
|
||||
/obj/item/showpiece_dummy
|
||||
name = "Cheap replica"
|
||||
|
||||
/obj/item/showpiece_dummy/Initialize(mapload, path)
|
||||
. = ..()
|
||||
var/obj/item/I = path
|
||||
name = initial(I.name)
|
||||
icon = initial(I.icon)
|
||||
icon_state = initial(I.icon_state)
|
||||
|
||||
@@ -188,9 +188,9 @@
|
||||
|
||||
/obj/structure/mineral_door/transparent/plasma/attackby(obj/item/weapon/W, mob/user, params)
|
||||
if(W.is_hot())
|
||||
var/turf/T = get_turf(src)
|
||||
message_admins("Plasma mineral door ignited by [ADMIN_LOOKUPFLW(user)] in [ADMIN_COORDJMP(T)]",0,1)
|
||||
log_game("Plasma mineral door ignited by [key_name(user)] in [COORD(T)]")
|
||||
var/turf/T = get_turf(src)
|
||||
message_admins("Plasma mineral door ignited by [ADMIN_LOOKUPFLW(user)] in [ADMIN_COORDJMP(T)]",0,1)
|
||||
log_game("Plasma mineral door ignited by [key_name(user)] in [COORD(T)]")
|
||||
TemperatureAct()
|
||||
else
|
||||
return ..()
|
||||
|
||||
Reference in New Issue
Block a user