Merge pull request #8914 from Ghommie/Ghommie-cit147
Updating spraycans and crayons.
This commit is contained in:
@@ -791,3 +791,6 @@ GLOBAL_LIST_INIT(binary, list("0","1"))
|
||||
rearranged += cword
|
||||
message = "[prefix][jointext(rearranged," ")]"
|
||||
. = message
|
||||
|
||||
#define is_alpha(X) ((text2ascii(X) <= 122) && (text2ascii(X) >= 97))
|
||||
#define is_digit(X) ((length(X) == 1) && (length(text2num(X)) == 1))
|
||||
@@ -1,6 +1,9 @@
|
||||
#define RANDOM_GRAFFITI "Random Graffiti"
|
||||
#define RANDOM_LETTER "Random Letter"
|
||||
#define RANDOM_PUNCTUATION "Random Punctuation"
|
||||
#define RANDOM_NUMBER "Random Number"
|
||||
#define RANDOM_SYMBOL "Random Symbol"
|
||||
#define RANDOM_DRAWING "Random Drawing"
|
||||
#define RANDOM_ORIENTED "Random Oriented"
|
||||
#define RANDOM_RUNE "Random Rune"
|
||||
#define RANDOM_ANY "Random Anything"
|
||||
@@ -32,16 +35,16 @@
|
||||
var/drawtype
|
||||
var/text_buffer = ""
|
||||
|
||||
var/list/graffiti = list("amyjon","face","matt","revolution","engie","guy","end","dwarf","uboa","body","cyka","arrow","star","poseur tag","prolizard","antilizard", "tile") //cit edit
|
||||
var/list/letters = list("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z")
|
||||
var/list/numerals = list("0","1","2","3","4","5","6","7","8","9")
|
||||
var/list/oriented = list("arrow","body") // These turn to face the same way as the drawer
|
||||
var/list/runes = list("rune1","rune2","rune3","rune4","rune5","rune6")
|
||||
var/list/randoms = list(RANDOM_ANY, RANDOM_RUNE, RANDOM_ORIENTED,
|
||||
RANDOM_NUMBER, RANDOM_GRAFFITI, RANDOM_LETTER)
|
||||
var/list/graffiti_large_h = list("yiffhell", "secborg", "paint")
|
||||
var/static/list/graffiti = list("amyjon","face","matt","revolution","engie","guy","end","dwarf","uboa","body","cyka","star","poseur tag","prolizard","antilizard", "tile")
|
||||
var/static/list/symbols = list("danger","firedanger","electricdanger","biohazard","radiation","safe","evac","space","med","trade","shop","food","peace","like","skull","nay","heart","credit")
|
||||
var/static/list/drawings = list("smallbrush","brush","largebrush","splatter","snake","stickman","carp","ghost","clown","taser","disk","fireaxe","toolbox","corgi","cat","toilet","blueprint","beepsky","scroll","bottle","shotgun")
|
||||
var/static/list/oriented = list("arrow","line","thinline","shortline","body","chevron","footprint","clawprint","pawprint") // These turn to face the same way as the drawer
|
||||
var/static/list/runes = list("rune1","rune2","rune3","rune4","rune5","rune6")
|
||||
var/static/list/randoms = list(RANDOM_ANY, RANDOM_RUNE, RANDOM_ORIENTED,
|
||||
RANDOM_NUMBER, RANDOM_GRAFFITI, RANDOM_LETTER, RANDOM_SYMBOL, RANDOM_PUNCTUATION, RANDOM_DRAWING)
|
||||
var/static/list/graffiti_large_h = list("yiffhell", "secborg", "paint")
|
||||
|
||||
var/list/all_drawables
|
||||
var/static/list/all_drawables = graffiti + symbols + drawings + oriented + runes + graffiti_large_h
|
||||
|
||||
var/paint_mode = PAINT_NORMAL
|
||||
|
||||
@@ -54,8 +57,6 @@
|
||||
var/instant = FALSE
|
||||
var/self_contained = TRUE // If it deletes itself when it is empty
|
||||
|
||||
var/list/validSurfaces = list(/turf/open/floor)
|
||||
|
||||
var/edible = TRUE // That doesn't mean eating it is a good idea
|
||||
|
||||
var/list/reagent_contents = list("nutriment" = 1)
|
||||
@@ -71,6 +72,9 @@
|
||||
var/datum/team/gang/gang //For marking territory.
|
||||
var/gang_tag_delay = 30 //this is the delay for gang mode tag applications on anything that gang = true on.
|
||||
|
||||
/obj/item/toy/crayon/proc/isValidSurface(surface)
|
||||
return istype(surface, /turf/open/floor)
|
||||
|
||||
/obj/item/toy/crayon/suicide_act(mob/user)
|
||||
user.visible_message("<span class='suicide'>[user] is jamming [src] up [user.p_their()] nose and into [user.p_their()] brain. It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
return (BRUTELOSS|OXYLOSS)
|
||||
@@ -81,7 +85,6 @@
|
||||
if(name == "crayon")
|
||||
name = "[item_color] crayon"
|
||||
|
||||
all_drawables = graffiti + letters + numerals + oriented + runes + graffiti_large_h
|
||||
drawtype = pick(all_drawables)
|
||||
|
||||
refill()
|
||||
@@ -153,55 +156,62 @@
|
||||
to_chat(user, "<span class='notice'>The cap on [src] is now [is_capped ? "on" : "off"].</span>")
|
||||
update_icon()
|
||||
|
||||
/obj/item/toy/crayon/ui_data()
|
||||
var/list/data = list()
|
||||
data["drawables"] = list()
|
||||
var/list/D = data["drawables"]
|
||||
/obj/item/toy/crayon/proc/staticDrawables()
|
||||
|
||||
. = list()
|
||||
|
||||
var/list/g_items = list()
|
||||
D += list(list("name" = "Graffiti", "items" = g_items))
|
||||
. += list(list("name" = "Graffiti", "items" = g_items))
|
||||
for(var/g in graffiti)
|
||||
g_items += list(list("item" = g))
|
||||
|
||||
var/list/glh_items = list()
|
||||
D += list(list("name" = "Graffiti Large Horizontal", "items" = glh_items))
|
||||
. += list(list("name" = "Graffiti Large Horizontal", "items" = glh_items))
|
||||
for(var/glh in graffiti_large_h)
|
||||
glh_items += list(list("item" = glh))
|
||||
|
||||
var/list/L_items = list()
|
||||
D += list(list("name" = "Letters", "items" = L_items))
|
||||
for(var/L in letters)
|
||||
L_items += list(list("item" = L))
|
||||
var/list/S_items = list()
|
||||
. += list(list("name" = "Symbols", "items" = S_items))
|
||||
for(var/S in symbols)
|
||||
S_items += list(list("item" = S))
|
||||
|
||||
var/list/N_items = list()
|
||||
D += list(list(name = "Numerals", "items" = N_items))
|
||||
for(var/N in numerals)
|
||||
N_items += list(list("item" = N))
|
||||
var/list/D_items = list()
|
||||
. += list(list("name" = "Drawings", "items" = D_items))
|
||||
for(var/D in drawings)
|
||||
D_items += list(list("item" = D))
|
||||
|
||||
var/list/O_items = list()
|
||||
D += list(list(name = "Oriented", "items" = O_items))
|
||||
. += list(list(name = "Oriented", "items" = O_items))
|
||||
for(var/O in oriented)
|
||||
O_items += list(list("item" = O))
|
||||
|
||||
var/list/R_items = list()
|
||||
D += list(list(name = "Runes", "items" = R_items))
|
||||
. += list(list(name = "Runes", "items" = R_items))
|
||||
for(var/R in runes)
|
||||
R_items += list(list("item" = R))
|
||||
|
||||
var/list/rand_items = list()
|
||||
D += list(list(name = "Random", "items" = rand_items))
|
||||
. += list(list(name = "Random", "items" = rand_items))
|
||||
for(var/i in randoms)
|
||||
rand_items += list(list("item" = i))
|
||||
|
||||
data["selected_stencil"] = drawtype
|
||||
data["text_buffer"] = text_buffer
|
||||
|
||||
data["has_cap"] = has_cap
|
||||
data["is_capped"] = is_capped
|
||||
data["can_change_colour"] = can_change_colour
|
||||
data["current_colour"] = paint_color
|
||||
/obj/item/toy/crayon/ui_data()
|
||||
|
||||
return data
|
||||
var/static/list/crayon_drawables
|
||||
|
||||
if (!crayon_drawables)
|
||||
crayon_drawables = staticDrawables()
|
||||
|
||||
. = list()
|
||||
.["drawables"] = crayon_drawables
|
||||
.["selected_stencil"] = drawtype
|
||||
.["text_buffer"] = text_buffer
|
||||
|
||||
.["has_cap"] = has_cap
|
||||
.["is_capped"] = is_capped
|
||||
.["can_change_colour"] = can_change_colour
|
||||
.["current_colour"] = paint_color
|
||||
|
||||
/obj/item/toy/crayon/ui_act(action, list/params)
|
||||
if(..())
|
||||
@@ -216,6 +226,7 @@
|
||||
if(stencil in all_drawables + randoms)
|
||||
drawtype = stencil
|
||||
. = TRUE
|
||||
text_buffer = ""
|
||||
if(stencil in graffiti_large_h)
|
||||
paint_mode = PAINT_LARGE_HORIZONTAL
|
||||
text_buffer = ""
|
||||
@@ -235,18 +246,16 @@
|
||||
update_icon()
|
||||
|
||||
/obj/item/toy/crayon/proc/crayon_text_strip(text)
|
||||
var/list/base = string2charlist(lowertext(text))
|
||||
var/list/out = list()
|
||||
for(var/a in base)
|
||||
if(a in (letters|numerals))
|
||||
out += a
|
||||
return jointext(out,"")
|
||||
var/static/regex/crayon_r = new /regex(@"[^\w!?,.=%#&+\/\-]")
|
||||
return replacetext(lowertext(text), crayon_r, "")
|
||||
|
||||
/obj/item/toy/crayon/afterattack(atom/target, mob/user, proximity, params)
|
||||
. = ..()
|
||||
if(!proximity || !check_allowed_items(target))
|
||||
return
|
||||
|
||||
var/static/list/punctuation = list("!","?",".",",","/","+","-","=","%","#","&")
|
||||
|
||||
var/cost = 1
|
||||
if(paint_mode == PAINT_LARGE_HORIZONTAL)
|
||||
cost = 5
|
||||
@@ -264,13 +273,19 @@
|
||||
if(istype(target, /obj/effect/decal/cleanable))
|
||||
target = target.loc
|
||||
|
||||
if(!is_type_in_list(target,validSurfaces))
|
||||
if(!isValidSurface(target))
|
||||
return
|
||||
|
||||
var/drawing = drawtype
|
||||
switch(drawtype)
|
||||
if(RANDOM_LETTER)
|
||||
drawing = pick(letters)
|
||||
drawing = ascii2text(rand(97, 122)) // a-z
|
||||
if(RANDOM_PUNCTUATION)
|
||||
drawing = pick(punctuation)
|
||||
if(RANDOM_SYMBOL)
|
||||
drawing = pick(symbols)
|
||||
if(RANDOM_DRAWING)
|
||||
drawing = pick(drawings)
|
||||
if(RANDOM_GRAFFITI)
|
||||
drawing = pick(graffiti)
|
||||
if(RANDOM_RUNE)
|
||||
@@ -278,17 +293,23 @@
|
||||
if(RANDOM_ORIENTED)
|
||||
drawing = pick(oriented)
|
||||
if(RANDOM_NUMBER)
|
||||
drawing = pick(numerals)
|
||||
drawing = ascii2text(rand(48, 57)) // 0-9
|
||||
if(RANDOM_ANY)
|
||||
drawing = pick(all_drawables)
|
||||
|
||||
var/temp = "rune"
|
||||
if(drawing in letters)
|
||||
if(is_alpha(drawing))
|
||||
temp = "letter"
|
||||
else if(drawing in graffiti)
|
||||
temp = "graffiti"
|
||||
else if(drawing in numerals)
|
||||
else if(is_digit(drawing))
|
||||
temp = "number"
|
||||
else if(drawing in punctuation)
|
||||
temp = "punctuation mark"
|
||||
else if(drawing in symbols)
|
||||
temp = "symbol"
|
||||
else if(drawing in drawings)
|
||||
temp = "drawing"
|
||||
else if(drawing in graffiti|oriented)
|
||||
temp = "graffiti"
|
||||
|
||||
// If a gang member is using a gang spraycan, it'll behave differently
|
||||
var/gang_mode = FALSE
|
||||
@@ -338,7 +359,7 @@
|
||||
return
|
||||
|
||||
if(length(text_buffer))
|
||||
drawing = copytext(text_buffer,1,2)
|
||||
drawing = text_buffer[1]
|
||||
|
||||
|
||||
var/list/turf/affected_turfs = list()
|
||||
@@ -362,7 +383,7 @@
|
||||
if(PAINT_LARGE_HORIZONTAL)
|
||||
var/turf/left = locate(target.x-1,target.y,target.z)
|
||||
var/turf/right = locate(target.x+1,target.y,target.z)
|
||||
if(is_type_in_list(left, validSurfaces) && is_type_in_list(right, validSurfaces))
|
||||
if(isValidSurface(left) && isValidSurface(right))
|
||||
var/obj/effect/decal/cleanable/crayon/C = new(left, paint_color, drawing, temp, graf_rot, PAINT_LARGE_HORIZONTAL_ICON)
|
||||
C.add_hiddenprint(user)
|
||||
affected_turfs += left
|
||||
@@ -377,8 +398,9 @@
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You spray a [temp] on \the [target.name]</span>")
|
||||
|
||||
if(length(text_buffer))
|
||||
if(length(text_buffer) > 1)
|
||||
text_buffer = copytext(text_buffer,2)
|
||||
SStgui.update_uis(src)
|
||||
|
||||
if(post_noise)
|
||||
audible_message("<span class='notice'>You hear spraying.</span>")
|
||||
@@ -516,7 +538,7 @@
|
||||
|
||||
charges = -1
|
||||
|
||||
/obj/item/toy/crayon/rainbow/afterattack(atom/target, mob/user, proximity)
|
||||
/obj/item/toy/crayon/rainbow/afterattack(atom/target, mob/user, proximity, params)
|
||||
paint_color = rgb(rand(0,255), rand(0,255), rand(0,255))
|
||||
. = ..()
|
||||
|
||||
@@ -591,12 +613,14 @@
|
||||
can_change_colour = TRUE
|
||||
gang = TRUE //Gang check is true for all things upon the honored hierarchy of spraycans, except those that are FALSE.
|
||||
|
||||
validSurfaces = list(/turf/open/floor, /turf/closed/wall)
|
||||
reagent_contents = list("welding_fuel" = 1, "ethanol" = 1)
|
||||
|
||||
pre_noise = TRUE
|
||||
post_noise = FALSE
|
||||
|
||||
/obj/item/toy/crayon/spraycan/isValidSurface(surface)
|
||||
return (istype(surface, /turf/open/floor) || istype(surface, /turf/closed/wall))
|
||||
|
||||
/obj/item/toy/crayon/spraycan/suicide_act(mob/user)
|
||||
var/mob/living/carbon/human/H = user
|
||||
if(is_capped || !actually_paints)
|
||||
@@ -622,8 +646,8 @@
|
||||
|
||||
return (OXYLOSS)
|
||||
|
||||
/obj/item/toy/crayon/spraycan/New()
|
||||
..()
|
||||
/obj/item/toy/crayon/spraycan/Initialize()
|
||||
. = ..()
|
||||
// If default crayon red colour, pick a more fun spraycan colour
|
||||
if(!paint_color)
|
||||
paint_color = pick("#DA0000","#FF9300","#FFF200","#A8E61D","#00B7EF",
|
||||
@@ -640,7 +664,7 @@
|
||||
to_chat(user, "It is empty.")
|
||||
to_chat(user, "<span class='notice'>Alt-click [src] to [ is_capped ? "take the cap off" : "put the cap on"].</span>")
|
||||
|
||||
/obj/item/toy/crayon/spraycan/afterattack(atom/target, mob/user, proximity)
|
||||
/obj/item/toy/crayon/spraycan/afterattack(atom/target, mob/user, proximity, params)
|
||||
if(!proximity)
|
||||
return
|
||||
|
||||
@@ -656,8 +680,7 @@
|
||||
playsound(user.loc, 'sound/effects/spray.ogg', 25, 1, 5)
|
||||
|
||||
var/mob/living/carbon/C = target
|
||||
user.visible_message("<span class='danger'>[user] sprays [src] into the face of [target]!</span>")
|
||||
to_chat(target, "<span class='userdanger'>[user] sprays [src] into your face!</span>")
|
||||
C.visible_message("<span class='danger'>[user] sprays [src] into the face of [C]!</span>", "<span class='userdanger'>[user] sprays [src] into your face!</span>")
|
||||
|
||||
if(C.client)
|
||||
C.blur_eyes(3)
|
||||
@@ -678,13 +701,14 @@
|
||||
|
||||
return
|
||||
|
||||
if(istype(target, /obj/structure/window))
|
||||
if(isobj(target))
|
||||
if(actually_paints)
|
||||
target.add_atom_colour(paint_color, WASHABLE_COLOUR_PRIORITY)
|
||||
if(color_hex2num(paint_color) < 255)
|
||||
target.set_opacity(255)
|
||||
else
|
||||
target.set_opacity(initial(target.opacity))
|
||||
if(istype(target, /obj/structure/window))
|
||||
if(color_hex2num(paint_color) < 255)
|
||||
target.set_opacity(255)
|
||||
else
|
||||
target.set_opacity(initial(target.opacity))
|
||||
. = use_charges(user, 2)
|
||||
var/fraction = min(1, . / reagents.maximum_volume)
|
||||
reagents.reaction(target, TOUCH, fraction * volume_multiplier)
|
||||
@@ -692,6 +716,7 @@
|
||||
|
||||
if(pre_noise || post_noise)
|
||||
playsound(user.loc, 'sound/effects/spray.ogg', 5, 1, 5)
|
||||
user.visible_message("[user] coats [target] with spray paint!", "<span class='notice'>You coat [target] with spray paint.</span>")
|
||||
return
|
||||
|
||||
. = ..()
|
||||
@@ -709,7 +734,7 @@
|
||||
desc = "A metallic container containing shiny synthesised paint."
|
||||
charges = -1
|
||||
|
||||
/obj/item/toy/crayon/spraycan/borg/afterattack(atom/target,mob/user,proximity)
|
||||
/obj/item/toy/crayon/spraycan/borg/afterattack(atom/target,mob/user,proximity, params)
|
||||
var/diff = ..()
|
||||
if(!iscyborg(user))
|
||||
to_chat(user, "<span class='notice'>How did you get this?</span>")
|
||||
@@ -754,7 +779,9 @@
|
||||
|
||||
reagent_contents = list("lube" = 1, "banana" = 1)
|
||||
volume_multiplier = 5
|
||||
validSurfaces = list(/turf/open/floor)
|
||||
|
||||
/obj/item/toy/crayon/spraycan/lubecan/isValidSurface(surface)
|
||||
return istype(surface, /turf/open/floor)
|
||||
|
||||
/obj/item/toy/crayon/spraycan/mimecan
|
||||
name = "silent spraycan"
|
||||
@@ -794,6 +821,9 @@
|
||||
|
||||
#undef RANDOM_GRAFFITI
|
||||
#undef RANDOM_LETTER
|
||||
#undef RANDOM_PUNCTUATION
|
||||
#undef RANDOM_SYMBOL
|
||||
#undef RANDOM_DRAWING
|
||||
#undef RANDOM_NUMBER
|
||||
#undef RANDOM_ORIENTED
|
||||
#undef RANDOM_RUNE
|
||||
|
||||
@@ -90,14 +90,14 @@
|
||||
add_fingerprint(user)
|
||||
|
||||
|
||||
/obj/item/paint/afterattack(turf/target, mob/user, proximity)
|
||||
/obj/item/paint/afterattack(atom/target, mob/user, proximity)
|
||||
. = ..()
|
||||
if(!proximity)
|
||||
return
|
||||
if(paintleft <= 0)
|
||||
icon_state = "paint_empty"
|
||||
return
|
||||
if(!istype(target) || isspaceturf(target))
|
||||
if(!isturf(target) || isspaceturf(target))
|
||||
return
|
||||
var/newcolor = "#" + item_color
|
||||
target.add_atom_colour(newcolor, WASHABLE_COLOUR_PRIORITY)
|
||||
@@ -105,12 +105,14 @@
|
||||
/obj/item/paint/paint_remover
|
||||
gender = PLURAL
|
||||
name = "paint remover"
|
||||
desc = "Used to remove color from floors and walls."
|
||||
desc = "Used to remove color from anything."
|
||||
icon_state = "paint_neutral"
|
||||
|
||||
/obj/item/paint/paint_remover/afterattack(turf/target, mob/user, proximity)
|
||||
/obj/item/paint/paint_remover/afterattack(atom/target, mob/user, proximity)
|
||||
. = ..()
|
||||
if(!proximity)
|
||||
return
|
||||
if(istype(target) && target.color != initial(target.color))
|
||||
if(!isturf(target) || !isobj(target))
|
||||
return
|
||||
if(target.color != initial(target.color))
|
||||
target.remove_atom_colour(WASHABLE_COLOUR_PRIORITY)
|
||||
|
||||
@@ -323,6 +323,8 @@
|
||||
var/BR = brightness
|
||||
var/PO = bulb_power
|
||||
var/CO = bulb_colour
|
||||
if(color)
|
||||
CO = color
|
||||
var/area/A = get_area(src)
|
||||
if (A && A.fire)
|
||||
CO = bulb_emergency_colour
|
||||
@@ -360,6 +362,9 @@
|
||||
else
|
||||
removeStaticPower(static_power_used, STATIC_LIGHT)
|
||||
|
||||
/obj/machinery/light/update_atom_colour()
|
||||
. = ..()
|
||||
update()
|
||||
|
||||
/obj/machinery/light/process()
|
||||
if (!cell)
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 46 KiB |
+13
-13
File diff suppressed because one or more lines are too long
@@ -29,7 +29,7 @@
|
||||
{{/each}}
|
||||
</ui-display>
|
||||
<ui-display title="Text Mode">
|
||||
<ui-section label='Current Buffer'>{{text_buffer}}
|
||||
<ui-section label='Current Buffer'>{{data.text_buffer}}
|
||||
</ui-section>
|
||||
<ui-section><ui-button action='enter_text'>New Text</ui-button></ui-section>
|
||||
</ui-display>
|
||||
|
||||
Reference in New Issue
Block a user