mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
* Adds grep for mapload and var in Args * vars in args * some more * stuff * Update shuttle_creator.dm * Update __techweb_helpers.dm * fix * Update discoball.dm * Update check_grep.sh * Update check_grep.sh * Update check_grep.sh * Update check_grep.sh * I'll finish this later * datum and lateinit maploads * componentinit stuff * mapload fixes * why isnt CI catching these major issues * MERGE CONFLICT FUCKED MY PR OVER * Update check_grep.sh * Update food.dm
337 lines
11 KiB
Plaintext
337 lines
11 KiB
Plaintext
/obj/item/airlock_painter
|
|
name = "airlock painter"
|
|
desc = "An advanced autopainter preprogrammed with several paintjobs for airlocks. Use it on an airlock during or after construction to change the paintjob."
|
|
icon = 'icons/obj/objects.dmi'
|
|
icon_state = "paint sprayer"
|
|
item_state = "paint sprayer"
|
|
|
|
w_class = WEIGHT_CLASS_SMALL
|
|
|
|
materials = list(/datum/material/iron=50, /datum/material/glass=50)
|
|
|
|
flags_1 = CONDUCT_1
|
|
item_flags = NOBLUDGEON
|
|
slot_flags = ITEM_SLOT_BELT
|
|
usesound = 'sound/effects/spray2.ogg'
|
|
|
|
var/obj/item/toner/ink = null
|
|
var/painter_mode = 1
|
|
/// Associate list of all paint jobs the airlock painter can apply. The key is the name of the airlock the user will see. The value is the type path of the airlock
|
|
var/list/available_paint_jobs = list(
|
|
"Public" = /obj/machinery/door/airlock/public,
|
|
"Engineering" = /obj/machinery/door/airlock/engineering,
|
|
"Atmospherics" = /obj/machinery/door/airlock/atmos,
|
|
"Security" = /obj/machinery/door/airlock/security,
|
|
"Command" = /obj/machinery/door/airlock/command,
|
|
"Medical" = /obj/machinery/door/airlock/medical,
|
|
"Research" = /obj/machinery/door/airlock/research,
|
|
"Freezer" = /obj/machinery/door/airlock/freezer,
|
|
"Science" = /obj/machinery/door/airlock/science,
|
|
"Mining" = /obj/machinery/door/airlock/mining,
|
|
"Maintenance" = /obj/machinery/door/airlock/maintenance,
|
|
"External" = /obj/machinery/door/airlock/external,
|
|
"External Maintenance"= /obj/machinery/door/airlock/maintenance/external,
|
|
"Virology" = /obj/machinery/door/airlock/virology,
|
|
"Standard" = /obj/machinery/door/airlock,
|
|
"Centcom" = /obj/machinery/door/airlock/centcom
|
|
)
|
|
|
|
/obj/item/airlock_painter/Initialize(mapload)
|
|
. = ..()
|
|
ink = new /obj/item/toner(src)
|
|
|
|
/obj/item/airlock_painter/proc/get_mode()
|
|
return painter_mode
|
|
|
|
//This proc doesn't just check if the painter can be used, but also uses it.
|
|
//Only call this if you are certain that the painter will be used right after this check!
|
|
/obj/item/airlock_painter/proc/use_paint(mob/user)
|
|
if(can_use(user))
|
|
ink.charges--
|
|
playsound(src.loc, 'sound/effects/spray2.ogg', 50, TRUE)
|
|
return TRUE
|
|
else
|
|
return FALSE
|
|
|
|
//This proc only checks if the painter can be used.
|
|
//Call this if you don't want the painter to be used right after this check, for example
|
|
//because you're expecting user input.
|
|
/obj/item/airlock_painter/proc/can_use(mob/user)
|
|
if(!ink)
|
|
to_chat(user, span_warning("There is no toner cartridge installed in [src]!"))
|
|
return FALSE
|
|
else if(ink.charges < 1)
|
|
to_chat(user, span_warning("[src] is out of ink!"))
|
|
return FALSE
|
|
else
|
|
return TRUE
|
|
|
|
/obj/item/airlock_painter/suicide_act(mob/user)
|
|
var/obj/item/organ/lungs/L = user.getorganslot(ORGAN_SLOT_LUNGS)
|
|
|
|
if(can_use(user) && L)
|
|
user.visible_message(span_suicide("[user] is inhaling toner from [src]! It looks like [user.p_theyre()] trying to commit suicide!"))
|
|
use(user)
|
|
|
|
// Once you've inhaled the toner, you throw up your lungs
|
|
// and then die.
|
|
|
|
// Find out if there is an open turf in front of us,
|
|
// and if not, pick the turf we are standing on.
|
|
var/turf/T = get_step(get_turf(src), user.dir)
|
|
if(!isopenturf(T))
|
|
T = get_turf(src)
|
|
|
|
// they managed to lose their lungs between then and
|
|
// now. Good job.
|
|
if(!L)
|
|
return OXYLOSS
|
|
|
|
L.Remove(user)
|
|
|
|
// make some colorful reagent, and apply it to the lungs
|
|
L.create_reagents(10)
|
|
L.reagents.add_reagent(/datum/reagent/colorful_reagent, 10)
|
|
L.reagents.reaction(L, TOUCH, 1)
|
|
|
|
// TODO maybe add some colorful vomit?
|
|
|
|
user.visible_message(span_suicide("[user] vomits out [user.p_their()] [L]!"))
|
|
playsound(user.loc, 'sound/effects/splat.ogg', 50, TRUE)
|
|
|
|
L.forceMove(T)
|
|
|
|
return (TOXLOSS|OXYLOSS)
|
|
else if(can_use(user) && !L)
|
|
user.visible_message(span_suicide("[user] is spraying toner on [user.p_them()]self from [src]! It looks like [user.p_theyre()] trying to commit suicide."))
|
|
user.reagents.add_reagent(/datum/reagent/colorful_reagent, 1)
|
|
user.reagents.reaction(user, TOUCH, 1)
|
|
return TOXLOSS
|
|
|
|
else
|
|
user.visible_message(span_suicide("[user] is trying to inhale toner from [src]! It might be a suicide attempt if [src] had any toner."))
|
|
return SHAME
|
|
|
|
|
|
/obj/item/airlock_painter/examine(mob/user)
|
|
. = ..()
|
|
if(!ink)
|
|
. += span_notice("It doesn't have a toner cartridge installed.")
|
|
return
|
|
var/ink_level = "high"
|
|
if(ink.charges < 1)
|
|
ink_level = "empty"
|
|
else if((ink.charges/ink.max_charges) <= 0.25) //25%
|
|
ink_level = "low"
|
|
else if((ink.charges/ink.max_charges) > 1) //Over 100% (admin var edit)
|
|
ink_level = "dangerously high"
|
|
. += span_notice("Its ink levels look [ink_level].")
|
|
|
|
|
|
/obj/item/airlock_painter/attackby(obj/item/W, mob/user, params)
|
|
if(istype(W, /obj/item/toner))
|
|
if(ink)
|
|
to_chat(user, span_warning("[src] already contains \a [ink]!"))
|
|
return
|
|
if(!user.transferItemToLoc(W, src))
|
|
return
|
|
to_chat(user, span_notice("You install [W] into [src]."))
|
|
ink = W
|
|
playsound(src.loc, 'sound/machines/click.ogg', 50, TRUE)
|
|
else
|
|
return ..()
|
|
|
|
/obj/item/airlock_painter/AltClick(mob/user, obj/item/W)
|
|
. = ..()
|
|
if(ink)
|
|
playsound(src.loc, 'sound/machines/click.ogg', 50, TRUE)
|
|
ink.forceMove(user.drop_location())
|
|
user.put_in_hands(ink)
|
|
to_chat(user, span_notice("You remove [ink] from [src]."))
|
|
ink = null
|
|
|
|
/obj/item/airlock_painter/decal
|
|
name = "decal painter"
|
|
desc = "An airlock painter, reprogrammed to use a different style of paint in order to apply decals for floor tiles as well, in addition to repainting doors. Decals break when the floor tiles are removed. Alt-Click to take out toner."
|
|
icon = 'icons/obj/objects.dmi'
|
|
icon_state = "decal_sprayer"
|
|
item_state = "decal_sprayer"
|
|
painter_mode = 2
|
|
custom_materials = list(/datum/material/iron=50, /datum/material/glass=50)
|
|
var/stored_dir = 2
|
|
var/stored_color = ""
|
|
var/stored_decal = "warningline"
|
|
var/stored_decal_total = "warningline"
|
|
var/color_list = list("","red","white")
|
|
var/dir_list = list(1,2,4,8)
|
|
var/decal_list = list(list("Warning Line","warningline"),
|
|
list("Warning Line Corner","warninglinecorner"),
|
|
list("Warning Line U Corner","warn_end"),
|
|
list("Warning Line Box","warn_box"),
|
|
list("Caution Label","caution"),
|
|
list("Directional Arrows","arrows"),
|
|
list("Stand Clear Label","stand_clear"),
|
|
list("Box","box"),
|
|
list("Box Corner","box_corners"),
|
|
list("Delivery Marker","delivery"),
|
|
list("Warning Box","warn_full"),
|
|
list("Loading Arrow","loadingarea"),
|
|
list("Bot","bot"),
|
|
list("Bot Corners","bot_right"),
|
|
list("NO","no"),
|
|
list("Radiation Hazard","radiation"),
|
|
list("Circle Radiation Hazard","radiation_huge"),
|
|
list("Bio Warning","bio"),
|
|
list("Shock Warning","shock"),
|
|
list("Danger Warning","danger"),
|
|
list("Explosive Warning","explosives"),
|
|
list("High Explosive Warning","explosives2"),
|
|
list("Fire Warning","fire"),
|
|
list("No Smoking","nosmoking2"),
|
|
list("No Smoking Circle","nosmoking"),
|
|
list("Safety First","safety"),
|
|
list("Nanotrasen","nanotrasen"),
|
|
list("RAVEN1","RAVEN1"),
|
|
list("RAVEN2","RAVEN2"),
|
|
list("RAVEN3","RAVEN3"),
|
|
list("RAVEN4","RAVEN4"),
|
|
list("RAVEN5","RAVEN5"),
|
|
list("RAVEN6","RAVEN6"),
|
|
list("RAVEN7","RAVEN7"),
|
|
list("RAVEN8","RAVEN8"),
|
|
list("RAVEN9","RAVEN9"),
|
|
list("Animated Red Circuit","rcircuitanim"),
|
|
list("Animated Green Circuit","gcircuitanim"),
|
|
list("Blue Circuit","bcircuit"),
|
|
list("Green Circuit","gcircuit"),
|
|
list("Red Circuit","rcircuit"),
|
|
list("Disco Floor","disco"),
|
|
list("Grimy Floor","grimy"),
|
|
list("Chapel Floor","chapel"),
|
|
list("Sepia Floor","sepia"),
|
|
list("Pink Floor","pinkblack"),
|
|
list("Blank & White Floor","blackwhite"),
|
|
list("Yellow Floor","noslip"),
|
|
list("Pod Floor","podfloor_light"),
|
|
list("Freezer Floor","freezerfloor"),
|
|
list("Dark Floor","elevatorshaft"),
|
|
list("Recharge Station","recharge_floor"),
|
|
list("Solar Panel","solarpanel"),
|
|
list("Gaming Floor","eighties"),
|
|
list("Planet Floor","planet"),
|
|
list("Bamboo Floor","bamboo"),
|
|
list("Grass Floor","grass2"),
|
|
list("Sand","sand"),
|
|
list("Asteroid Sand","asteroid"),
|
|
list("Iron Sand","ironsand1"),
|
|
list("Snow Floor","snow"),
|
|
list("Ice Floor","ice"),
|
|
list("Sandstone Vault","sandstonevault"),
|
|
list("Rock Vault","rockvault"),
|
|
list("Alien Vault","alienvault"),
|
|
list("Alien Floor","alienpod5"),
|
|
list("Wood Floor","wood"),
|
|
list("Diamond Floor","diamond"),
|
|
list("Gold Floor","gold"),
|
|
list("Plasma Floor","plasma"),
|
|
list("Silver Floor","silver"),
|
|
list("Uranium Floor","uranium"),
|
|
list("Titanium Floor","titanium_white"),
|
|
list("Plastitanium Floor","plastitanium"),
|
|
list("Bluespace Floor","bluespace"),
|
|
list("Reinforced Floor","engine"),
|
|
list("Bananium Floor","bananium"),
|
|
list("Brick Floor","terracotta"),
|
|
list("Copper Floor","copper"),
|
|
list("Clockwork Floor","clockwork_floor"),
|
|
list("Cult Floor","cult"),
|
|
list("Paper Floor","paperfloor"),
|
|
list("Titanium Floor","titanium_white"),
|
|
list("Plastitanium Floor","plastitanium"),
|
|
list("Lavaland Floor","basalt1"),
|
|
list("Hierophant Floor","hiero"),
|
|
list("Wobby Hierophant Floor","hierophant1"),
|
|
list("Necro Floor","necro1"),
|
|
list("Lava","lava"),
|
|
list("River Water","riverwater_motion"),
|
|
list("Liquid Plasma","liquidplasma"),
|
|
list("Error","error"),
|
|
list("01010101","binary"),
|
|
list("Space","space"))
|
|
|
|
/obj/item/airlock_painter/decal/afterattack(atom/target, mob/user, proximity)
|
|
. = ..()
|
|
var/turf/open/floor/F = target
|
|
if(!proximity)
|
|
to_chat(user, span_notice("You need to get closer!"))
|
|
return
|
|
if(!istype(F, /turf/open/floor))
|
|
to_chat(user, span_notice("[target] is not a tile!"))
|
|
return
|
|
if(use_paint(user))
|
|
F.AddComponent(/datum/component/decal, 'icons/turf/decals.dmi', stored_decal_total, stored_dir, FALSE, color, null, null, 255)
|
|
|
|
/obj/item/airlock_painter/decal/attack_self(mob/user)
|
|
. = ..()
|
|
ui_interact(user)
|
|
|
|
/obj/item/airlock_painter/decal/Initialize(mapload)
|
|
. = ..()
|
|
ink = new /obj/item/toner/large(src)
|
|
|
|
/obj/item/airlock_painter/decal/proc/update_decal_path()
|
|
var/yellow_fix = "" //This will have to do until someone refactor's markings.dm
|
|
if (stored_color)
|
|
yellow_fix = "_"
|
|
stored_decal_total = "[stored_decal][yellow_fix][stored_color]"
|
|
return
|
|
|
|
/obj/item/airlock_painter/decal/ui_interact(mob/user, datum/tgui/ui)
|
|
ui = SStgui.try_update_ui(user, src, ui)
|
|
if(!ui)
|
|
ui = new(user, src, "DecalPainter", name)
|
|
ui.open()
|
|
|
|
/obj/item/airlock_painter/decal/ui_data(mob/user)
|
|
var/list/data = list()
|
|
data["decal_direction"] = stored_dir
|
|
data["decal_color"] = stored_color
|
|
data["decal_style"] = stored_decal
|
|
data["decal_list"] = list()
|
|
data["color_list"] = list()
|
|
data["dir_list"] = list()
|
|
|
|
for(var/i in decal_list)
|
|
data["decal_list"] += list(list(
|
|
"name" = i[1],
|
|
"decal" = i[2]
|
|
))
|
|
for(var/j in color_list)
|
|
data["color_list"] += list(list(
|
|
"colors" = j
|
|
))
|
|
for(var/k in dir_list)
|
|
data["dir_list"] += list(list(
|
|
"dirs" = k
|
|
))
|
|
return data
|
|
|
|
/obj/item/airlock_painter/decal/ui_act(action,list/params)
|
|
. = ..()
|
|
if(.)
|
|
return
|
|
|
|
switch(action)
|
|
//Lists of decals and designs
|
|
if("select decal")
|
|
var/selected_decal = params["decals"]
|
|
stored_decal = selected_decal
|
|
if("select color")
|
|
var/selected_color = params["colors"]
|
|
stored_color = selected_color
|
|
if("selected direction")
|
|
var/selected_direction = text2num(params["dirs"])
|
|
stored_dir = selected_direction
|
|
update_decal_path()
|
|
. = TRUE
|