mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2026-08-29 23:57:10 +01:00
Merge branch 'master' of https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13 into modsuits
This commit is contained in:
@@ -32,6 +32,9 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 100, ACID = 100)
|
||||
resistance_flags = FIRE_PROOF | ACID_PROOF
|
||||
|
||||
always_reskinnable = TRUE
|
||||
reskin_binding = COMSIG_CLICK_CTRL_SHIFT
|
||||
|
||||
//Main variables
|
||||
var/owner = null // String name of owner
|
||||
var/default_cartridge = 0 // Access level defined by cartridge
|
||||
@@ -112,10 +115,10 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
. += id ? "<span class='notice'>Alt-click to remove the id.</span>" : ""
|
||||
if(inserted_item && (!isturf(loc)))
|
||||
. += "<span class='notice'>Ctrl-click to remove [inserted_item].</span>"
|
||||
if(LAZYLEN(GLOB.pda_reskins))
|
||||
. += "<span class='notice'>Ctrl-shift-click it to reskin it.</span>"
|
||||
|
||||
/obj/item/pda/Initialize(mapload)
|
||||
if(GLOB.pda_reskins)
|
||||
unique_reskin = GLOB.pda_reskins
|
||||
. = ..()
|
||||
if(fon)
|
||||
set_light(f_lum, f_pow, f_col)
|
||||
@@ -130,28 +133,10 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
new_overlays = TRUE
|
||||
update_icon()
|
||||
|
||||
/obj/item/pda/CtrlShiftClick(mob/living/user)
|
||||
. = ..()
|
||||
if(GLOB.pda_reskins && user.canUseTopic(src, BE_CLOSE, NO_DEXTERY))
|
||||
reskin_obj(user)
|
||||
|
||||
/obj/item/pda/reskin_obj(mob/M)
|
||||
if(!LAZYLEN(GLOB.pda_reskins))
|
||||
return
|
||||
var/dat = "<b>Reskin options for [name]:</b>"
|
||||
for(var/V in GLOB.pda_reskins)
|
||||
var/output = icon2html(GLOB.pda_reskins[V], M, icon_state)
|
||||
dat += "\n[V]: <span class='reallybig'>[output]</span>"
|
||||
to_chat(M, dat)
|
||||
|
||||
var/choice = input(M, "Choose the a reskin for [src]","Reskin Object") as null|anything in GLOB.pda_reskins
|
||||
var/new_icon = GLOB.pda_reskins[choice]
|
||||
if(QDELETED(src) || isnull(new_icon) || new_icon == icon || !M.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
|
||||
return
|
||||
icon = new_icon
|
||||
. = ..()
|
||||
new_overlays = TRUE
|
||||
update_icon()
|
||||
to_chat(M, "[src] is now skinned as '[choice]'.")
|
||||
|
||||
/obj/item/pda/proc/set_new_overlays()
|
||||
if(!overlays_offsets || !(icon in overlays_offsets))
|
||||
@@ -191,7 +176,7 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
else
|
||||
font_index = MODE_MONO
|
||||
font_mode = FONT_MONO
|
||||
var/pref_skin = GLOB.pda_reskins[C.prefs.pda_skin]
|
||||
var/pref_skin = GLOB.pda_reskins[C.prefs.pda_skin]["icon"]
|
||||
if(icon != pref_skin)
|
||||
icon = pref_skin
|
||||
new_overlays = TRUE
|
||||
|
||||
@@ -211,8 +211,6 @@
|
||||
|
||||
/obj/item/melee/transforming/energy/sword/saber/reskin_obj(mob/M)
|
||||
. = ..()
|
||||
if(!.)
|
||||
return
|
||||
switch(current_skin)
|
||||
if("Sword")
|
||||
icon_state = "sword[active ? sword_color : "0"]"
|
||||
|
||||
@@ -55,8 +55,9 @@
|
||||
generate_items_inside(items_inside,src)
|
||||
|
||||
/obj/item/storage/firstaid/ancient
|
||||
icon_state = "firstaid"
|
||||
desc = "A first aid kit with the ability to heal common types of injuries."
|
||||
name = "ancient first-aid kit"
|
||||
icon_state = "oldfirstaid"
|
||||
desc = "A first aid kit with the ability to heal common types of injuries. You start thinking of the good old days just by looking at it."
|
||||
|
||||
/obj/item/storage/firstaid/ancient/PopulateContents()
|
||||
if(empty)
|
||||
@@ -69,6 +70,10 @@
|
||||
new /obj/item/stack/medical/mesh(src)
|
||||
new /obj/item/stack/medical/mesh(src)
|
||||
|
||||
/obj/item/storage/firstaid/ancient/heirloom
|
||||
// Long since been ransacked by hungry powergaming assistants breaking into med storage
|
||||
empty = TRUE
|
||||
|
||||
/obj/item/storage/firstaid/brute
|
||||
name = "trauma treatment kit"
|
||||
desc = "A first aid kit for when you get toolboxed."
|
||||
|
||||
+17
-52
@@ -28,9 +28,17 @@
|
||||
var/resistance_flags = NONE // INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ON_FIRE | UNACIDABLE | ACID_PROOF
|
||||
|
||||
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.
|
||||
|
||||
//Reskin variables
|
||||
/// The item reskin
|
||||
var/current_skin
|
||||
/// List of options to reskin.
|
||||
var/list/unique_reskin
|
||||
/// Can always be modified
|
||||
var/always_reskinnable = FALSE
|
||||
/// How to bring up the reskinning menu
|
||||
var/reskin_binding = COMSIG_CLICK_ALT
|
||||
//
|
||||
|
||||
// Access levels, used in modules\jobs\access.dm
|
||||
var/list/req_access
|
||||
@@ -76,6 +84,10 @@
|
||||
var/turf/T = loc
|
||||
T.add_blueprints_preround(src)
|
||||
|
||||
/obj/ComponentInitialize()
|
||||
. = ..()
|
||||
if(islist(unique_reskin) && length(unique_reskin))
|
||||
AddElement(/datum/element/object_reskinning)
|
||||
|
||||
/obj/Destroy(force=FALSE)
|
||||
if(!ismachinery(src))
|
||||
@@ -340,57 +352,10 @@
|
||||
. = ..()
|
||||
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
|
||||
|
||||
/// Reskins an object according to M's choice, modified to be overridable and supports different icons
|
||||
/obj/proc/reskin_obj(mob/M)
|
||||
if(!LAZYLEN(unique_reskin))
|
||||
return FALSE
|
||||
|
||||
var/list/items = list()
|
||||
for(var/reskin_option in unique_reskin)
|
||||
var/image/item_image = image(
|
||||
icon = unique_reskin[reskin_option]["icon"] ? unique_reskin[reskin_option]["icon"] : icon,
|
||||
icon_state = unique_reskin[reskin_option]["icon_state"])
|
||||
items += list("[reskin_option]" = item_image)
|
||||
sortList(items)
|
||||
|
||||
var/pick = show_radial_menu(M, src, items, custom_check = CALLBACK(src, .proc/check_reskin_menu, M), radius = 38, require_near = TRUE)
|
||||
if(!pick)
|
||||
return FALSE
|
||||
if(!unique_reskin[pick]["icon_state"])
|
||||
return FALSE
|
||||
current_skin = pick
|
||||
var/has_icon = unique_reskin[pick]["icon"]
|
||||
if(has_icon)
|
||||
icon = has_icon
|
||||
icon_state = unique_reskin[pick]["icon_state"]
|
||||
to_chat(M, "[src] is now skinned as '[pick].'")
|
||||
return TRUE
|
||||
|
||||
/**
|
||||
* Checks if we are allowed to interact with a radial menu for reskins
|
||||
*
|
||||
* Arguments:
|
||||
* * user The mob interacting with the menu
|
||||
*/
|
||||
/obj/proc/check_reskin_menu(mob/user)
|
||||
if(QDELETED(src))
|
||||
return FALSE
|
||||
if(current_skin)
|
||||
return FALSE
|
||||
if(!istype(user))
|
||||
return FALSE
|
||||
if(user.incapacitated())
|
||||
return FALSE
|
||||
return TRUE
|
||||
/// Do you want to make overrides, of course you do! Will be called if an object was reskinned successfully
|
||||
/obj/proc/reskin_obj(mob/user)
|
||||
return
|
||||
|
||||
/obj/update_overlays()
|
||||
. = ..()
|
||||
|
||||
@@ -15,9 +15,12 @@
|
||||
var/obj/structure/chair/C = new /obj/structure/chair(loc)
|
||||
W.play_tool_sound(src)
|
||||
C.setDir(dir)
|
||||
part.forceMove(loc)
|
||||
part.master = null
|
||||
part = null
|
||||
|
||||
if (part)
|
||||
part.forceMove(loc)
|
||||
part.master = null
|
||||
part = null
|
||||
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/chair/e_chair/proc/shock()
|
||||
@@ -44,3 +47,9 @@
|
||||
to_chat(buckled_mob, "<span class='userdanger'>You feel a deep shock course through your body!</span>")
|
||||
addtimer(CALLBACK(buckled_mob, /mob/living.proc/electrocute_act, 85, src, 1), 1)
|
||||
visible_message("<span class='danger'>The electric chair went off!</span>", "<span class='italics'>You hear a deep sharp shock!</span>")
|
||||
|
||||
/obj/structure/chair/e_chair/Destroy()
|
||||
if(part)
|
||||
QDEL_NULL(part)
|
||||
|
||||
return ..()
|
||||
|
||||
Reference in New Issue
Block a user