mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-21 11:07:46 +01:00
Whitespace Standardization [MDB IGNORE] (#15748)
* Update settings * Whitespace changes * Comment out merger hooks in gitattributes Corrupt maps would have to be resolved in repo before hooks could be updated * Revert "Whitespace changes" This reverts commitafbdd1d844. * Whitespace again minus example * Gitignore example changelog * Restore changelog merge setting * Keep older dmi hook attribute until hooks can be updated * update vscode settings too * Renormalize remaining * Revert "Gitignore example changelog" This reverts commitde22ad375d. * Attempt to normalize example.yml (and another file I guess) * Try again
This commit is contained in:
@@ -1,51 +1,51 @@
|
||||
/obj/item/weapon/paper/carbon
|
||||
name = "paper"
|
||||
icon_state = "paper_stack"
|
||||
item_state = "paper"
|
||||
var/copied = 0
|
||||
var/iscopy = 0
|
||||
|
||||
|
||||
/obj/item/weapon/paper/carbon/update_icon()
|
||||
if(iscopy)
|
||||
if(info)
|
||||
icon_state = "cpaper_words"
|
||||
return
|
||||
icon_state = "cpaper"
|
||||
else if (copied)
|
||||
if(info)
|
||||
icon_state = "paper_words"
|
||||
return
|
||||
icon_state = "paper"
|
||||
else
|
||||
if(info)
|
||||
icon_state = "paper_stack_words"
|
||||
return
|
||||
icon_state = "paper_stack"
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/paper/carbon/verb/removecopy()
|
||||
set name = "Remove carbon-copy"
|
||||
set category = "Object"
|
||||
set src in usr
|
||||
|
||||
if (copied == 0)
|
||||
var/obj/item/weapon/paper/carbon/c = src
|
||||
var/copycontents = html_decode(c.info)
|
||||
var/obj/item/weapon/paper/carbon/copy = new /obj/item/weapon/paper/carbon (usr.loc)
|
||||
// <font>
|
||||
copycontents = replacetext(copycontents, "<font face=\"[c.deffont]\" color=", "<font face=\"[c.deffont]\" nocolor=") //state of the art techniques in action
|
||||
copycontents = replacetext(copycontents, "<font face=\"[c.crayonfont]\" color=", "<font face=\"[c.crayonfont]\" nocolor=") //This basically just breaks the existing color tag, which we need to do because the innermost tag takes priority.
|
||||
copy.info += copycontents
|
||||
copy.info += "</font>"
|
||||
copy.name = "Copy - " + c.name
|
||||
copy.fields = c.fields
|
||||
copy.updateinfolinks()
|
||||
to_chat(usr, "<span class='notice'>You tear off the carbon-copy!</span>")
|
||||
c.copied = 1
|
||||
copy.iscopy = 1
|
||||
copy.update_icon()
|
||||
c.update_icon()
|
||||
else
|
||||
to_chat(usr, "There are no more carbon copies attached to this paper!")
|
||||
/obj/item/weapon/paper/carbon
|
||||
name = "paper"
|
||||
icon_state = "paper_stack"
|
||||
item_state = "paper"
|
||||
var/copied = 0
|
||||
var/iscopy = 0
|
||||
|
||||
|
||||
/obj/item/weapon/paper/carbon/update_icon()
|
||||
if(iscopy)
|
||||
if(info)
|
||||
icon_state = "cpaper_words"
|
||||
return
|
||||
icon_state = "cpaper"
|
||||
else if (copied)
|
||||
if(info)
|
||||
icon_state = "paper_words"
|
||||
return
|
||||
icon_state = "paper"
|
||||
else
|
||||
if(info)
|
||||
icon_state = "paper_stack_words"
|
||||
return
|
||||
icon_state = "paper_stack"
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/paper/carbon/verb/removecopy()
|
||||
set name = "Remove carbon-copy"
|
||||
set category = "Object"
|
||||
set src in usr
|
||||
|
||||
if (copied == 0)
|
||||
var/obj/item/weapon/paper/carbon/c = src
|
||||
var/copycontents = html_decode(c.info)
|
||||
var/obj/item/weapon/paper/carbon/copy = new /obj/item/weapon/paper/carbon (usr.loc)
|
||||
// <font>
|
||||
copycontents = replacetext(copycontents, "<font face=\"[c.deffont]\" color=", "<font face=\"[c.deffont]\" nocolor=") //state of the art techniques in action
|
||||
copycontents = replacetext(copycontents, "<font face=\"[c.crayonfont]\" color=", "<font face=\"[c.crayonfont]\" nocolor=") //This basically just breaks the existing color tag, which we need to do because the innermost tag takes priority.
|
||||
copy.info += copycontents
|
||||
copy.info += "</font>"
|
||||
copy.name = "Copy - " + c.name
|
||||
copy.fields = c.fields
|
||||
copy.updateinfolinks()
|
||||
to_chat(usr, "<span class='notice'>You tear off the carbon-copy!</span>")
|
||||
c.copied = 1
|
||||
copy.iscopy = 1
|
||||
copy.update_icon()
|
||||
c.update_icon()
|
||||
else
|
||||
to_chat(usr, "There are no more carbon copies attached to this paper!")
|
||||
|
||||
+350
-350
@@ -1,350 +1,350 @@
|
||||
/* Pens!
|
||||
* Contains:
|
||||
* Pens
|
||||
* Coloured Pens
|
||||
* Fountain Pens
|
||||
* Multi Pen
|
||||
* Reagent Pens
|
||||
* Blade Pens
|
||||
* Sleepy Pens
|
||||
* Parapens
|
||||
* Chameleon Pen
|
||||
* Crayons
|
||||
*/
|
||||
|
||||
/*
|
||||
* Pens
|
||||
*/
|
||||
/obj/item/weapon/pen
|
||||
name = "pen"
|
||||
desc = "It's a normal black ink pen."
|
||||
icon = 'icons/obj/bureaucracy.dmi'
|
||||
icon_state = "pen"
|
||||
item_state = "pen"
|
||||
slot_flags = SLOT_BELT | SLOT_EARS
|
||||
throwforce = 0
|
||||
w_class = ITEMSIZE_TINY
|
||||
throw_speed = 7
|
||||
throw_range = 15
|
||||
matter = list(MAT_STEEL = 10)
|
||||
var/colour = "black" //what colour the ink is!
|
||||
pressure_resistance = 2
|
||||
drop_sound = 'sound/items/drop/accessory.ogg'
|
||||
pickup_sound = 'sound/items/pickup/accessory.ogg'
|
||||
|
||||
/obj/item/weapon/pen/attack_self(var/mob/user)
|
||||
if(!user.checkClickCooldown())
|
||||
return
|
||||
user.setClickCooldown(1 SECOND)
|
||||
to_chat(user, "<span class='notice'>Click.</span>")
|
||||
playsound(src, 'sound/items/penclick.ogg', 50, 1)
|
||||
|
||||
/*
|
||||
* Coloured Pens
|
||||
*/
|
||||
/obj/item/weapon/pen/blue
|
||||
desc = "It's a normal blue ink pen."
|
||||
icon_state = "pen_blue"
|
||||
colour = "blue"
|
||||
|
||||
/obj/item/weapon/pen/red
|
||||
desc = "It's a normal red ink pen."
|
||||
icon_state = "pen_red"
|
||||
colour = "red"
|
||||
|
||||
/*
|
||||
* Fountain Pens
|
||||
*/
|
||||
/obj/item/weapon/pen/fountain
|
||||
desc = "A well made fountain pen, with a faux wood body."
|
||||
icon_state = "pen_fountain"
|
||||
|
||||
/obj/item/weapon/pen/fountain2
|
||||
desc = "A well made fountain pen, with a faux wood body. This one has golden accents."
|
||||
icon_state = "pen_fountain"
|
||||
|
||||
/obj/item/weapon/pen/fountain3
|
||||
desc = "A well made expesive rosewood pen with golden accents. Very pretty."
|
||||
icon_state = "pen_fountain"
|
||||
|
||||
/obj/item/weapon/pen/fountain4
|
||||
desc = "A well made and expensive fountain pen. This one has silver accents."
|
||||
icon_state = "blues_fountain"
|
||||
|
||||
/obj/item/weapon/pen/fountain5
|
||||
desc = "A well made and expensive fountain pen. This one has gold accents."
|
||||
icon_state = "blueg_fountain"
|
||||
|
||||
/obj/item/weapon/pen/fountain6
|
||||
desc = "A well made and expensive fountain pen. The nib is quite sharp."
|
||||
icon_state = "command_fountain"
|
||||
|
||||
/obj/item/weapon/pen/fountain7
|
||||
desc = "A well made and expensive fountain pen made from gold."
|
||||
icon_state = "gold_fountain"
|
||||
|
||||
/obj/item/weapon/pen/fountain8
|
||||
desc = "A well made and expensive fountain pen."
|
||||
icon_state = "black_fountain"
|
||||
|
||||
/obj/item/weapon/pen/fountain9
|
||||
desc = "A well made and expensive fountain pen made for gesturing."
|
||||
icon_state = "mime_fountain"
|
||||
|
||||
|
||||
/*
|
||||
* Multi Pen
|
||||
*/
|
||||
/obj/item/weapon/pen/multi
|
||||
desc = "It's a pen with multiple colors of ink!"
|
||||
var/selectedColor = 1
|
||||
var/colors = list("black","blue","red")
|
||||
|
||||
/obj/item/weapon/pen/AltClick(mob/user)
|
||||
to_chat(user, "<span class='notice'>Click.</span>")
|
||||
playsound(src, 'sound/items/penclick.ogg', 50, 1)
|
||||
return
|
||||
|
||||
/obj/item/weapon/pen/multi/attack_self(mob/user)
|
||||
if(++selectedColor > 3)
|
||||
selectedColor = 1
|
||||
|
||||
colour = colors[selectedColor]
|
||||
|
||||
if(colour == "black")
|
||||
icon_state = "pen"
|
||||
else
|
||||
icon_state = "pen_[colour]"
|
||||
|
||||
to_chat(user, "<span class='notice'>Changed color to '[colour].'</span>")
|
||||
|
||||
/obj/item/weapon/pen/invisible
|
||||
desc = "It's an invisble pen marker."
|
||||
icon_state = "pen"
|
||||
colour = "white"
|
||||
|
||||
/*
|
||||
* Reagent Pens
|
||||
*/
|
||||
|
||||
/obj/item/weapon/pen/reagent
|
||||
flags = OPENCONTAINER
|
||||
origin_tech = list(TECH_MATERIAL = 2, TECH_ILLEGAL = 5)
|
||||
|
||||
/obj/item/weapon/pen/reagent/New()
|
||||
..()
|
||||
create_reagents(30)
|
||||
|
||||
/obj/item/weapon/pen/reagent/attack(mob/living/M as mob, mob/user as mob)
|
||||
|
||||
if(!istype(M))
|
||||
return
|
||||
|
||||
. = ..()
|
||||
|
||||
if(M.can_inject(user,1))
|
||||
if(reagents.total_volume)
|
||||
if(M.reagents)
|
||||
var/contained = reagents.get_reagents()
|
||||
var/trans = reagents.trans_to_mob(M, 30, CHEM_BLOOD)
|
||||
add_attack_logs(user,M,"Injected with [src.name] containing [contained], trasferred [trans] units")
|
||||
|
||||
/*
|
||||
* Blade Pens
|
||||
*/
|
||||
/obj/item/weapon/pen/blade
|
||||
desc = "It's a normal black ink pen."
|
||||
description_antag = "This pen can be transformed into a dangerous melee and thrown assassination weapon with an Alt-Click.\
|
||||
When active, it cannot be caught safely."
|
||||
name = "pen"
|
||||
icon = 'icons/obj/bureaucracy.dmi'
|
||||
icon_state = "pen"
|
||||
item_state = "pen"
|
||||
slot_flags = SLOT_BELT | SLOT_EARS
|
||||
throwforce = 3
|
||||
w_class = ITEMSIZE_TINY
|
||||
throw_speed = 7
|
||||
throw_range = 15
|
||||
armor_penetration = 20
|
||||
|
||||
var/active = 0
|
||||
var/active_embed_chance = 0
|
||||
var/active_force = 15
|
||||
var/active_throwforce = 30
|
||||
var/active_w_class = ITEMSIZE_NORMAL
|
||||
var/active_icon_state
|
||||
var/default_icon_state
|
||||
|
||||
/obj/item/weapon/pen/blade/Initialize()
|
||||
. = ..()
|
||||
active_icon_state = "[icon_state]-x"
|
||||
default_icon_state = icon_state
|
||||
|
||||
/obj/item/weapon/pen/blade/AltClick(mob/user)
|
||||
..()
|
||||
if(active)
|
||||
deactivate(user)
|
||||
else
|
||||
activate(user)
|
||||
|
||||
to_chat(user, "<span class='notice'>You [active ? "de" : ""]activate \the [src]'s blade.</span>")
|
||||
|
||||
/obj/item/weapon/pen/blade/proc/activate(mob/living/user)
|
||||
if(active)
|
||||
return
|
||||
active = 1
|
||||
icon_state = active_icon_state
|
||||
embed_chance = active_embed_chance
|
||||
force = active_force
|
||||
throwforce = active_throwforce
|
||||
sharp = TRUE
|
||||
edge = TRUE
|
||||
w_class = active_w_class
|
||||
playsound(src, 'sound/weapons/saberon.ogg', 15, 1)
|
||||
damtype = SEARING
|
||||
catchable = FALSE
|
||||
|
||||
attack_verb |= list(\
|
||||
"slashed",\
|
||||
"cut",\
|
||||
"shredded",\
|
||||
"stabbed"\
|
||||
)
|
||||
|
||||
/obj/item/weapon/pen/blade/proc/deactivate(mob/living/user)
|
||||
if(!active)
|
||||
return
|
||||
playsound(src, 'sound/weapons/saberoff.ogg', 15, 1)
|
||||
active = 0
|
||||
icon_state = default_icon_state
|
||||
embed_chance = initial(embed_chance)
|
||||
force = initial(force)
|
||||
throwforce = initial(throwforce)
|
||||
sharp = initial(sharp)
|
||||
edge = initial(edge)
|
||||
w_class = initial(w_class)
|
||||
damtype = BRUTE
|
||||
catchable = TRUE
|
||||
|
||||
/obj/item/weapon/pen/blade/blue
|
||||
desc = "It's a normal blue ink pen."
|
||||
icon_state = "pen_blue"
|
||||
colour = "blue"
|
||||
|
||||
/obj/item/weapon/pen/blade/red
|
||||
desc = "It's a normal red ink pen."
|
||||
icon_state = "pen_red"
|
||||
colour = "red"
|
||||
|
||||
/obj/item/weapon/pen/blade/fountain
|
||||
desc = "A well made fountain pen, with a faux wood body."
|
||||
icon_state = "pen_fountain"
|
||||
|
||||
/*
|
||||
* Sleepy Pens
|
||||
*/
|
||||
/obj/item/weapon/pen/reagent/sleepy
|
||||
desc = "It's a black ink pen with a sharp point and a carefully engraved \"Waffle Co.\""
|
||||
origin_tech = list(TECH_MATERIAL = 2, TECH_ILLEGAL = 5)
|
||||
|
||||
/obj/item/weapon/pen/reagent/sleepy/New()
|
||||
..()
|
||||
reagents.add_reagent("chloralhydrate", 1) //VOREStation Edit
|
||||
reagents.add_reagent("stoxin", 14) //VOREStation Add
|
||||
|
||||
|
||||
/*
|
||||
* Parapens
|
||||
*/
|
||||
/obj/item/weapon/pen/reagent/paralysis
|
||||
origin_tech = list(TECH_MATERIAL = 2, TECH_ILLEGAL = 5)
|
||||
|
||||
/obj/item/weapon/pen/reagent/paralysis/New()
|
||||
..()
|
||||
reagents.add_reagent("zombiepowder", 5)
|
||||
reagents.add_reagent("cryptobiolin", 10)
|
||||
|
||||
/*
|
||||
* Chameleon Pen
|
||||
*/
|
||||
/obj/item/weapon/pen/chameleon
|
||||
var/signature = ""
|
||||
|
||||
/obj/item/weapon/pen/chameleon/attack_self(mob/user as mob)
|
||||
/*
|
||||
// Limit signatures to official crew members
|
||||
var/personnel_list[] = list()
|
||||
for(var/datum/data/record/t in data_core.locked) //Look in data core locked.
|
||||
personnel_list.Add(t.fields["name"])
|
||||
personnel_list.Add("Anonymous")
|
||||
|
||||
var/new_signature = tgui_input_list(usr, "Enter new signature pattern.", "New Signature", personnel_list)
|
||||
if(new_signature)
|
||||
signature = new_signature
|
||||
*/
|
||||
signature = sanitize(tgui_input_text(usr, "Enter new signature. Leave blank for 'Anonymous'", "New Signature", signature))
|
||||
|
||||
/obj/item/weapon/pen/proc/get_signature(var/mob/user)
|
||||
return (user && user.real_name) ? user.real_name : "Anonymous"
|
||||
|
||||
/obj/item/weapon/pen/chameleon/get_signature(var/mob/user)
|
||||
return signature ? signature : "Anonymous"
|
||||
|
||||
/obj/item/weapon/pen/chameleon/verb/set_colour()
|
||||
set name = "Change Pen Colour"
|
||||
set category = "Object"
|
||||
|
||||
var/list/possible_colours = list ("Yellow", "Green", "Pink", "Blue", "Orange", "Cyan", "Red", "Invisible", "Black")
|
||||
var/selected_type = tgui_input_list(usr, "Pick new colour.", "Pen Colour", possible_colours)
|
||||
|
||||
if(selected_type)
|
||||
switch(selected_type)
|
||||
if("Yellow")
|
||||
colour = COLOR_YELLOW
|
||||
if("Green")
|
||||
colour = COLOR_LIME
|
||||
if("Pink")
|
||||
colour = COLOR_PINK
|
||||
if("Blue")
|
||||
colour = COLOR_BLUE
|
||||
if("Orange")
|
||||
colour = COLOR_ORANGE
|
||||
if("Cyan")
|
||||
colour = COLOR_CYAN
|
||||
if("Red")
|
||||
colour = COLOR_RED
|
||||
if("Invisible")
|
||||
colour = COLOR_WHITE
|
||||
else
|
||||
colour = COLOR_BLACK
|
||||
to_chat(usr, "<span class='info'>You select the [lowertext(selected_type)] ink container.</span>")
|
||||
|
||||
|
||||
/*
|
||||
* Crayons
|
||||
*/
|
||||
/obj/item/weapon/pen/crayon
|
||||
name = "crayon"
|
||||
desc = "A colourful crayon. Please refrain from eating it or putting it in your nose."
|
||||
icon = 'icons/obj/crayons.dmi'
|
||||
icon_state = "crayonred"
|
||||
w_class = ITEMSIZE_TINY
|
||||
attack_verb = list("attacked", "coloured")
|
||||
colour = "#FF0000" //RGB
|
||||
var/shadeColour = "#220000" //RGB
|
||||
var/uses = 30 //0 for unlimited uses
|
||||
var/instant = 0
|
||||
var/colourName = "red" //for updateIcon purposes
|
||||
drop_sound = 'sound/items/drop/gloves.ogg'
|
||||
pickup_sound = 'sound/items/pickup/gloves.ogg'
|
||||
|
||||
/obj/item/weapon/pen/crayon/New()
|
||||
name = "[colourName] crayon"
|
||||
|
||||
/obj/item/weapon/pen/crayon/marker
|
||||
name = "marker"
|
||||
desc = "A chisel-tip permanent marker. Hopefully non-toxic."
|
||||
icon_state = "markerred"
|
||||
|
||||
/obj/item/weapon/pen/crayon/marker/New()
|
||||
name = "[colourName] marker"
|
||||
/* Pens!
|
||||
* Contains:
|
||||
* Pens
|
||||
* Coloured Pens
|
||||
* Fountain Pens
|
||||
* Multi Pen
|
||||
* Reagent Pens
|
||||
* Blade Pens
|
||||
* Sleepy Pens
|
||||
* Parapens
|
||||
* Chameleon Pen
|
||||
* Crayons
|
||||
*/
|
||||
|
||||
/*
|
||||
* Pens
|
||||
*/
|
||||
/obj/item/weapon/pen
|
||||
name = "pen"
|
||||
desc = "It's a normal black ink pen."
|
||||
icon = 'icons/obj/bureaucracy.dmi'
|
||||
icon_state = "pen"
|
||||
item_state = "pen"
|
||||
slot_flags = SLOT_BELT | SLOT_EARS
|
||||
throwforce = 0
|
||||
w_class = ITEMSIZE_TINY
|
||||
throw_speed = 7
|
||||
throw_range = 15
|
||||
matter = list(MAT_STEEL = 10)
|
||||
var/colour = "black" //what colour the ink is!
|
||||
pressure_resistance = 2
|
||||
drop_sound = 'sound/items/drop/accessory.ogg'
|
||||
pickup_sound = 'sound/items/pickup/accessory.ogg'
|
||||
|
||||
/obj/item/weapon/pen/attack_self(var/mob/user)
|
||||
if(!user.checkClickCooldown())
|
||||
return
|
||||
user.setClickCooldown(1 SECOND)
|
||||
to_chat(user, "<span class='notice'>Click.</span>")
|
||||
playsound(src, 'sound/items/penclick.ogg', 50, 1)
|
||||
|
||||
/*
|
||||
* Coloured Pens
|
||||
*/
|
||||
/obj/item/weapon/pen/blue
|
||||
desc = "It's a normal blue ink pen."
|
||||
icon_state = "pen_blue"
|
||||
colour = "blue"
|
||||
|
||||
/obj/item/weapon/pen/red
|
||||
desc = "It's a normal red ink pen."
|
||||
icon_state = "pen_red"
|
||||
colour = "red"
|
||||
|
||||
/*
|
||||
* Fountain Pens
|
||||
*/
|
||||
/obj/item/weapon/pen/fountain
|
||||
desc = "A well made fountain pen, with a faux wood body."
|
||||
icon_state = "pen_fountain"
|
||||
|
||||
/obj/item/weapon/pen/fountain2
|
||||
desc = "A well made fountain pen, with a faux wood body. This one has golden accents."
|
||||
icon_state = "pen_fountain"
|
||||
|
||||
/obj/item/weapon/pen/fountain3
|
||||
desc = "A well made expesive rosewood pen with golden accents. Very pretty."
|
||||
icon_state = "pen_fountain"
|
||||
|
||||
/obj/item/weapon/pen/fountain4
|
||||
desc = "A well made and expensive fountain pen. This one has silver accents."
|
||||
icon_state = "blues_fountain"
|
||||
|
||||
/obj/item/weapon/pen/fountain5
|
||||
desc = "A well made and expensive fountain pen. This one has gold accents."
|
||||
icon_state = "blueg_fountain"
|
||||
|
||||
/obj/item/weapon/pen/fountain6
|
||||
desc = "A well made and expensive fountain pen. The nib is quite sharp."
|
||||
icon_state = "command_fountain"
|
||||
|
||||
/obj/item/weapon/pen/fountain7
|
||||
desc = "A well made and expensive fountain pen made from gold."
|
||||
icon_state = "gold_fountain"
|
||||
|
||||
/obj/item/weapon/pen/fountain8
|
||||
desc = "A well made and expensive fountain pen."
|
||||
icon_state = "black_fountain"
|
||||
|
||||
/obj/item/weapon/pen/fountain9
|
||||
desc = "A well made and expensive fountain pen made for gesturing."
|
||||
icon_state = "mime_fountain"
|
||||
|
||||
|
||||
/*
|
||||
* Multi Pen
|
||||
*/
|
||||
/obj/item/weapon/pen/multi
|
||||
desc = "It's a pen with multiple colors of ink!"
|
||||
var/selectedColor = 1
|
||||
var/colors = list("black","blue","red")
|
||||
|
||||
/obj/item/weapon/pen/AltClick(mob/user)
|
||||
to_chat(user, "<span class='notice'>Click.</span>")
|
||||
playsound(src, 'sound/items/penclick.ogg', 50, 1)
|
||||
return
|
||||
|
||||
/obj/item/weapon/pen/multi/attack_self(mob/user)
|
||||
if(++selectedColor > 3)
|
||||
selectedColor = 1
|
||||
|
||||
colour = colors[selectedColor]
|
||||
|
||||
if(colour == "black")
|
||||
icon_state = "pen"
|
||||
else
|
||||
icon_state = "pen_[colour]"
|
||||
|
||||
to_chat(user, "<span class='notice'>Changed color to '[colour].'</span>")
|
||||
|
||||
/obj/item/weapon/pen/invisible
|
||||
desc = "It's an invisble pen marker."
|
||||
icon_state = "pen"
|
||||
colour = "white"
|
||||
|
||||
/*
|
||||
* Reagent Pens
|
||||
*/
|
||||
|
||||
/obj/item/weapon/pen/reagent
|
||||
flags = OPENCONTAINER
|
||||
origin_tech = list(TECH_MATERIAL = 2, TECH_ILLEGAL = 5)
|
||||
|
||||
/obj/item/weapon/pen/reagent/New()
|
||||
..()
|
||||
create_reagents(30)
|
||||
|
||||
/obj/item/weapon/pen/reagent/attack(mob/living/M as mob, mob/user as mob)
|
||||
|
||||
if(!istype(M))
|
||||
return
|
||||
|
||||
. = ..()
|
||||
|
||||
if(M.can_inject(user,1))
|
||||
if(reagents.total_volume)
|
||||
if(M.reagents)
|
||||
var/contained = reagents.get_reagents()
|
||||
var/trans = reagents.trans_to_mob(M, 30, CHEM_BLOOD)
|
||||
add_attack_logs(user,M,"Injected with [src.name] containing [contained], trasferred [trans] units")
|
||||
|
||||
/*
|
||||
* Blade Pens
|
||||
*/
|
||||
/obj/item/weapon/pen/blade
|
||||
desc = "It's a normal black ink pen."
|
||||
description_antag = "This pen can be transformed into a dangerous melee and thrown assassination weapon with an Alt-Click.\
|
||||
When active, it cannot be caught safely."
|
||||
name = "pen"
|
||||
icon = 'icons/obj/bureaucracy.dmi'
|
||||
icon_state = "pen"
|
||||
item_state = "pen"
|
||||
slot_flags = SLOT_BELT | SLOT_EARS
|
||||
throwforce = 3
|
||||
w_class = ITEMSIZE_TINY
|
||||
throw_speed = 7
|
||||
throw_range = 15
|
||||
armor_penetration = 20
|
||||
|
||||
var/active = 0
|
||||
var/active_embed_chance = 0
|
||||
var/active_force = 15
|
||||
var/active_throwforce = 30
|
||||
var/active_w_class = ITEMSIZE_NORMAL
|
||||
var/active_icon_state
|
||||
var/default_icon_state
|
||||
|
||||
/obj/item/weapon/pen/blade/Initialize()
|
||||
. = ..()
|
||||
active_icon_state = "[icon_state]-x"
|
||||
default_icon_state = icon_state
|
||||
|
||||
/obj/item/weapon/pen/blade/AltClick(mob/user)
|
||||
..()
|
||||
if(active)
|
||||
deactivate(user)
|
||||
else
|
||||
activate(user)
|
||||
|
||||
to_chat(user, "<span class='notice'>You [active ? "de" : ""]activate \the [src]'s blade.</span>")
|
||||
|
||||
/obj/item/weapon/pen/blade/proc/activate(mob/living/user)
|
||||
if(active)
|
||||
return
|
||||
active = 1
|
||||
icon_state = active_icon_state
|
||||
embed_chance = active_embed_chance
|
||||
force = active_force
|
||||
throwforce = active_throwforce
|
||||
sharp = TRUE
|
||||
edge = TRUE
|
||||
w_class = active_w_class
|
||||
playsound(src, 'sound/weapons/saberon.ogg', 15, 1)
|
||||
damtype = SEARING
|
||||
catchable = FALSE
|
||||
|
||||
attack_verb |= list(\
|
||||
"slashed",\
|
||||
"cut",\
|
||||
"shredded",\
|
||||
"stabbed"\
|
||||
)
|
||||
|
||||
/obj/item/weapon/pen/blade/proc/deactivate(mob/living/user)
|
||||
if(!active)
|
||||
return
|
||||
playsound(src, 'sound/weapons/saberoff.ogg', 15, 1)
|
||||
active = 0
|
||||
icon_state = default_icon_state
|
||||
embed_chance = initial(embed_chance)
|
||||
force = initial(force)
|
||||
throwforce = initial(throwforce)
|
||||
sharp = initial(sharp)
|
||||
edge = initial(edge)
|
||||
w_class = initial(w_class)
|
||||
damtype = BRUTE
|
||||
catchable = TRUE
|
||||
|
||||
/obj/item/weapon/pen/blade/blue
|
||||
desc = "It's a normal blue ink pen."
|
||||
icon_state = "pen_blue"
|
||||
colour = "blue"
|
||||
|
||||
/obj/item/weapon/pen/blade/red
|
||||
desc = "It's a normal red ink pen."
|
||||
icon_state = "pen_red"
|
||||
colour = "red"
|
||||
|
||||
/obj/item/weapon/pen/blade/fountain
|
||||
desc = "A well made fountain pen, with a faux wood body."
|
||||
icon_state = "pen_fountain"
|
||||
|
||||
/*
|
||||
* Sleepy Pens
|
||||
*/
|
||||
/obj/item/weapon/pen/reagent/sleepy
|
||||
desc = "It's a black ink pen with a sharp point and a carefully engraved \"Waffle Co.\""
|
||||
origin_tech = list(TECH_MATERIAL = 2, TECH_ILLEGAL = 5)
|
||||
|
||||
/obj/item/weapon/pen/reagent/sleepy/New()
|
||||
..()
|
||||
reagents.add_reagent("chloralhydrate", 1) //VOREStation Edit
|
||||
reagents.add_reagent("stoxin", 14) //VOREStation Add
|
||||
|
||||
|
||||
/*
|
||||
* Parapens
|
||||
*/
|
||||
/obj/item/weapon/pen/reagent/paralysis
|
||||
origin_tech = list(TECH_MATERIAL = 2, TECH_ILLEGAL = 5)
|
||||
|
||||
/obj/item/weapon/pen/reagent/paralysis/New()
|
||||
..()
|
||||
reagents.add_reagent("zombiepowder", 5)
|
||||
reagents.add_reagent("cryptobiolin", 10)
|
||||
|
||||
/*
|
||||
* Chameleon Pen
|
||||
*/
|
||||
/obj/item/weapon/pen/chameleon
|
||||
var/signature = ""
|
||||
|
||||
/obj/item/weapon/pen/chameleon/attack_self(mob/user as mob)
|
||||
/*
|
||||
// Limit signatures to official crew members
|
||||
var/personnel_list[] = list()
|
||||
for(var/datum/data/record/t in data_core.locked) //Look in data core locked.
|
||||
personnel_list.Add(t.fields["name"])
|
||||
personnel_list.Add("Anonymous")
|
||||
|
||||
var/new_signature = tgui_input_list(usr, "Enter new signature pattern.", "New Signature", personnel_list)
|
||||
if(new_signature)
|
||||
signature = new_signature
|
||||
*/
|
||||
signature = sanitize(tgui_input_text(usr, "Enter new signature. Leave blank for 'Anonymous'", "New Signature", signature))
|
||||
|
||||
/obj/item/weapon/pen/proc/get_signature(var/mob/user)
|
||||
return (user && user.real_name) ? user.real_name : "Anonymous"
|
||||
|
||||
/obj/item/weapon/pen/chameleon/get_signature(var/mob/user)
|
||||
return signature ? signature : "Anonymous"
|
||||
|
||||
/obj/item/weapon/pen/chameleon/verb/set_colour()
|
||||
set name = "Change Pen Colour"
|
||||
set category = "Object"
|
||||
|
||||
var/list/possible_colours = list ("Yellow", "Green", "Pink", "Blue", "Orange", "Cyan", "Red", "Invisible", "Black")
|
||||
var/selected_type = tgui_input_list(usr, "Pick new colour.", "Pen Colour", possible_colours)
|
||||
|
||||
if(selected_type)
|
||||
switch(selected_type)
|
||||
if("Yellow")
|
||||
colour = COLOR_YELLOW
|
||||
if("Green")
|
||||
colour = COLOR_LIME
|
||||
if("Pink")
|
||||
colour = COLOR_PINK
|
||||
if("Blue")
|
||||
colour = COLOR_BLUE
|
||||
if("Orange")
|
||||
colour = COLOR_ORANGE
|
||||
if("Cyan")
|
||||
colour = COLOR_CYAN
|
||||
if("Red")
|
||||
colour = COLOR_RED
|
||||
if("Invisible")
|
||||
colour = COLOR_WHITE
|
||||
else
|
||||
colour = COLOR_BLACK
|
||||
to_chat(usr, "<span class='info'>You select the [lowertext(selected_type)] ink container.</span>")
|
||||
|
||||
|
||||
/*
|
||||
* Crayons
|
||||
*/
|
||||
/obj/item/weapon/pen/crayon
|
||||
name = "crayon"
|
||||
desc = "A colourful crayon. Please refrain from eating it or putting it in your nose."
|
||||
icon = 'icons/obj/crayons.dmi'
|
||||
icon_state = "crayonred"
|
||||
w_class = ITEMSIZE_TINY
|
||||
attack_verb = list("attacked", "coloured")
|
||||
colour = "#FF0000" //RGB
|
||||
var/shadeColour = "#220000" //RGB
|
||||
var/uses = 30 //0 for unlimited uses
|
||||
var/instant = 0
|
||||
var/colourName = "red" //for updateIcon purposes
|
||||
drop_sound = 'sound/items/drop/gloves.ogg'
|
||||
pickup_sound = 'sound/items/pickup/gloves.ogg'
|
||||
|
||||
/obj/item/weapon/pen/crayon/New()
|
||||
name = "[colourName] crayon"
|
||||
|
||||
/obj/item/weapon/pen/crayon/marker
|
||||
name = "marker"
|
||||
desc = "A chisel-tip permanent marker. Hopefully non-toxic."
|
||||
icon_state = "markerred"
|
||||
|
||||
/obj/item/weapon/pen/crayon/marker/New()
|
||||
name = "[colourName] marker"
|
||||
|
||||
@@ -1,330 +1,330 @@
|
||||
/* Photography!
|
||||
* Contains:
|
||||
* Camera
|
||||
* Camera Film
|
||||
* Photos
|
||||
* Photo Albums
|
||||
*/
|
||||
|
||||
/*******
|
||||
* film *
|
||||
*******/
|
||||
/obj/item/device/camera_film
|
||||
name = "film cartridge"
|
||||
icon = 'icons/obj/items.dmi'
|
||||
desc = "A camera film cartridge. Insert it into a camera to reload it."
|
||||
icon_state = "film"
|
||||
item_state = "camera"
|
||||
w_class = ITEMSIZE_TINY
|
||||
|
||||
|
||||
/********
|
||||
* photo *
|
||||
********/
|
||||
var/global/photo_count = 0
|
||||
|
||||
/obj/item/weapon/photo
|
||||
name = "photo"
|
||||
icon = 'icons/obj/items.dmi'
|
||||
icon_state = "photo"
|
||||
item_state = "paper"
|
||||
w_class = ITEMSIZE_SMALL
|
||||
drop_sound = 'sound/items/drop/paper.ogg'
|
||||
pickup_sound = 'sound/items/pickup/paper.ogg'
|
||||
var/id
|
||||
var/icon/img //Big photo image
|
||||
var/scribble //Scribble on the back.
|
||||
var/icon/tiny
|
||||
var/photo_size = 3
|
||||
|
||||
/obj/item/weapon/photo/New()
|
||||
id = photo_count++
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/photo/attack_self(mob/user as mob)
|
||||
user.examinate(src)
|
||||
|
||||
/obj/item/weapon/photo/attackby(obj/item/weapon/P as obj, mob/user as mob)
|
||||
if(istype(P, /obj/item/weapon/pen))
|
||||
var/txt = sanitize(tgui_input_text(user, "What would you like to write on the back?", "Photo Writing", null, 128), 128)
|
||||
if(loc == user && user.stat == 0)
|
||||
scribble = txt
|
||||
..()
|
||||
|
||||
/obj/item/weapon/photo/examine(mob/user)
|
||||
//This is one time we're not going to call parent, because photos are 'secret' unless you're close enough.
|
||||
if(in_range(user, src))
|
||||
show(user)
|
||||
return list(desc)
|
||||
else
|
||||
return list("<span class='notice'>It is too far away to examine.</span>")
|
||||
|
||||
/obj/item/weapon/photo/proc/show(mob/user as mob)
|
||||
user << browse_rsc(img, "tmp_photo_[id].png")
|
||||
user << browse("<html><head><title>[name]</title></head>" \
|
||||
+ "<body style='overflow:hidden;margin:0;text-align:center'>" \
|
||||
+ "<img src='tmp_photo_[id].png' width='[64*photo_size]' style='-ms-interpolation-mode:nearest-neighbor' />" \
|
||||
+ "[scribble ? "<br>Written on the back:<br><i>[scribble]</i>" : ""]"\
|
||||
+ "</body></html>", "window=book;size=[64*photo_size]x[scribble ? 400 : 64*photo_size]")
|
||||
onclose(user, "[name]")
|
||||
return
|
||||
|
||||
/obj/item/weapon/photo/verb/rename()
|
||||
set name = "Rename photo"
|
||||
set category = "Object"
|
||||
set src in usr
|
||||
|
||||
var/n_name = sanitizeSafe(tgui_input_text(usr, "What would you like to label the photo?", "Photo Labelling", null, MAX_NAME_LEN), MAX_NAME_LEN)
|
||||
//loc.loc check is for making possible renaming photos in clipboards
|
||||
if(( (loc == usr || (loc.loc && loc.loc == usr)) && usr.stat == 0))
|
||||
name = "[(n_name ? text("[n_name]") : "photo")]"
|
||||
add_fingerprint(usr)
|
||||
return
|
||||
|
||||
|
||||
/**************
|
||||
* photo album *
|
||||
**************/
|
||||
/obj/item/weapon/storage/photo_album
|
||||
name = "Photo album"
|
||||
icon = 'icons/obj/items.dmi'
|
||||
icon_state = "album"
|
||||
item_state = "briefcase"
|
||||
can_hold = list(/obj/item/weapon/photo)
|
||||
|
||||
/obj/item/weapon/storage/photo_album/MouseDrop(obj/over_object as obj)
|
||||
|
||||
if((istype(usr, /mob/living/carbon/human)))
|
||||
var/mob/living/carbon/human/M = usr
|
||||
if(!( istype(over_object, /obj/screen) ))
|
||||
return ..()
|
||||
playsound(src, "rustle", 50, 1, -5)
|
||||
if((!( M.restrained() ) && !( M.stat ) && M.back == src))
|
||||
switch(over_object.name)
|
||||
if("r_hand")
|
||||
M.unEquip(src)
|
||||
M.put_in_r_hand(src)
|
||||
if("l_hand")
|
||||
M.unEquip(src)
|
||||
M.put_in_l_hand(src)
|
||||
add_fingerprint(usr)
|
||||
return
|
||||
if(over_object == usr && in_range(src, usr) || usr.contents.Find(src))
|
||||
if(usr.s_active)
|
||||
usr.s_active.close(usr)
|
||||
show_to(usr)
|
||||
return
|
||||
return
|
||||
|
||||
/*********
|
||||
* camera *
|
||||
*********/
|
||||
/obj/item/device/camera
|
||||
name = "camera"
|
||||
icon = 'icons/obj/items.dmi'
|
||||
desc = "A polaroid camera. 10 photos left."
|
||||
icon_state = "camera"
|
||||
item_state = "camera"
|
||||
w_class = ITEMSIZE_SMALL
|
||||
slot_flags = SLOT_BELT
|
||||
matter = list(MAT_STEEL = 2000)
|
||||
var/pictures_max = 10
|
||||
var/pictures_left = 10
|
||||
var/on = 1
|
||||
var/icon_on = "camera"
|
||||
var/icon_off = "camera_off"
|
||||
var/size = 3
|
||||
var/list/picture_planes = list()
|
||||
|
||||
/obj/item/device/camera/verb/change_size()
|
||||
set name = "Set Photo Focus"
|
||||
set category = "Object"
|
||||
var/nsize = tgui_input_list(usr, "Photo Size","Pick a size of resulting photo.", list(1,3,5,7))
|
||||
if(nsize)
|
||||
size = nsize
|
||||
to_chat(usr, "<span class='notice'>Camera will now take [size]x[size] photos.</span>")
|
||||
|
||||
/obj/item/device/camera/attack(mob/living/carbon/human/M as mob, mob/user as mob)
|
||||
return
|
||||
|
||||
/obj/item/device/camera/attack_self(mob/user as mob)
|
||||
on = !on
|
||||
if(on)
|
||||
src.icon_state = icon_on
|
||||
else
|
||||
src.icon_state = icon_off
|
||||
to_chat(user, "You switch the camera [on ? "on" : "off"].")
|
||||
return
|
||||
|
||||
/obj/item/device/camera/attackby(obj/item/I as obj, mob/user as mob)
|
||||
if(istype(I, /obj/item/device/camera_film))
|
||||
if(pictures_left)
|
||||
to_chat(user, "<span class='notice'>[src] still has some film in it!</span>")
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You insert [I] into [src].</span>")
|
||||
user.drop_item()
|
||||
qdel(I)
|
||||
pictures_left = pictures_max
|
||||
return
|
||||
..()
|
||||
|
||||
|
||||
/obj/item/device/camera/proc/get_icon(list/turfs, turf/center)
|
||||
|
||||
//Bigger icon base to capture those icons that were shifted to the next tile
|
||||
//i.e. pretty much all wall-mounted machinery
|
||||
var/icon/res = icon('icons/effects/96x96.dmi', "")
|
||||
res.Scale(size*32, size*32)
|
||||
// Initialize the photograph to black.
|
||||
res.Blend("#000", ICON_OVERLAY)
|
||||
|
||||
var/atoms[] = list()
|
||||
for(var/turf/the_turf in turfs)
|
||||
// Add outselves to the list of stuff to draw
|
||||
atoms.Add(the_turf);
|
||||
// As well as anything that isn't invisible.
|
||||
for(var/atom/A in the_turf)
|
||||
if(A.invisibility) continue
|
||||
if(A.plane > 0 && !(A.plane in picture_planes)) continue
|
||||
atoms.Add(A)
|
||||
|
||||
// Sort the atoms into their layers
|
||||
var/list/sorted = sort_atoms_by_layer(atoms)
|
||||
var/center_offset = (size-1)/2 * 32 + 1
|
||||
for(var/i; i <= sorted.len; i++)
|
||||
var/atom/A = sorted[i]
|
||||
if(A)
|
||||
var/icon/img = getFlatIcon(A, no_anim = TRUE)//, picture_planes = picture_planes)//build_composite_icon(A) //VOREStation Edit
|
||||
|
||||
// If what we got back is actually a picture, draw it.
|
||||
if(istype(img, /icon))
|
||||
// Check if we're looking at a mob that's lying down
|
||||
if(istype(A, /mob/living) && A:lying)
|
||||
// If they are, apply that effect to their picture.
|
||||
img.BecomeLying()
|
||||
// Calculate where we are relative to the center of the photo
|
||||
var/xoff = (A.x - center.x) * 32 + center_offset
|
||||
var/yoff = (A.y - center.y) * 32 + center_offset
|
||||
if (istype(A,/atom/movable))
|
||||
xoff+=A:pixel_x
|
||||
yoff+=A:pixel_y
|
||||
res.Blend(img, blendMode2iconMode(A.blend_mode), A.pixel_x + xoff, A.pixel_y + yoff)
|
||||
|
||||
// Lastly, render any contained effects on top.
|
||||
for(var/turf/the_turf in turfs)
|
||||
// Calculate where we are relative to the center of the photo
|
||||
var/xoff = (the_turf.x - center.x) * 32 + center_offset
|
||||
var/yoff = (the_turf.y - center.y) * 32 + center_offset
|
||||
res.Blend(getFlatIcon(the_turf.loc, no_anim = TRUE), blendMode2iconMode(the_turf.blend_mode),xoff,yoff)
|
||||
return res
|
||||
|
||||
|
||||
/obj/item/device/camera/proc/get_mobs(turf/the_turf as turf)
|
||||
var/mob_detail
|
||||
for(var/mob/living/carbon/A in the_turf)
|
||||
if(A.invisibility) continue
|
||||
var/holding = null
|
||||
if(A.l_hand || A.r_hand)
|
||||
if(A.l_hand) holding = "They are holding \a [A.l_hand]"
|
||||
if(A.r_hand)
|
||||
if(holding)
|
||||
holding += " and \a [A.r_hand]"
|
||||
else
|
||||
holding = "They are holding \a [A.r_hand]"
|
||||
|
||||
if(!mob_detail)
|
||||
mob_detail = "You can see [A] on the photo[(A:health / A.getMaxHealth()) < 0.75 ? " - [A] looks hurt":""].[holding ? " [holding]":"."]. "
|
||||
else
|
||||
mob_detail += "You can also see [A] on the photo[(A:health / A.getMaxHealth()) < 0.75 ? " - [A] looks hurt":""].[holding ? " [holding]":"."]."
|
||||
|
||||
return mob_detail
|
||||
|
||||
/obj/item/device/camera/afterattack(atom/target as mob|obj|turf|area, mob/user as mob, flag)
|
||||
if(!on || !pictures_left || ismob(target.loc)) return
|
||||
captureimage(target, user, flag)
|
||||
|
||||
playsound(src, pick('sound/items/polaroid1.ogg', 'sound/items/polaroid2.ogg'), 75, 1, -3)
|
||||
|
||||
pictures_left--
|
||||
desc = "A polaroid camera. It has [pictures_left] photos left."
|
||||
to_chat(user, "<span class='notice'>[pictures_left] photos left.</span>")
|
||||
icon_state = icon_off
|
||||
on = 0
|
||||
spawn(64)
|
||||
icon_state = icon_on
|
||||
on = 1
|
||||
|
||||
/obj/item/device/camera/proc/can_capture_turf(turf/T, mob/user)
|
||||
var/viewer = user
|
||||
if(user.client) //To make shooting through security cameras possible
|
||||
viewer = user.client.eye
|
||||
var/can_see = (T in view(viewer))
|
||||
|
||||
return can_see
|
||||
|
||||
/obj/item/device/camera/proc/captureimage(atom/target, mob/user, flag)
|
||||
var/x_c = target.x - (size-1)/2
|
||||
var/y_c = target.y + (size-1)/2
|
||||
var/z_c = target.z
|
||||
var/list/turfs = list()
|
||||
var/mobs = ""
|
||||
for(var/i = 1 to size)
|
||||
for(var/j = 1 to size)
|
||||
var/turf/T = locate(x_c, y_c, z_c)
|
||||
if(can_capture_turf(T, user))
|
||||
turfs.Add(T)
|
||||
mobs += get_mobs(T)
|
||||
x_c++
|
||||
y_c--
|
||||
x_c = x_c - size
|
||||
|
||||
var/obj/item/weapon/photo/p = createpicture(target, user, turfs, mobs, flag)
|
||||
|
||||
printpicture(user, p)
|
||||
|
||||
/obj/item/device/camera/proc/createpicture(atom/target, mob/user, list/turfs, mobs, flag)
|
||||
var/icon/photoimage = get_icon(turfs, target)
|
||||
|
||||
var/icon/small_img = icon(photoimage)
|
||||
var/icon/tiny_img = icon(photoimage)
|
||||
var/icon/ic = icon('icons/obj/items.dmi',"photo")
|
||||
var/icon/pc = icon('icons/obj/bureaucracy.dmi', "photo")
|
||||
small_img.Scale(8, 8)
|
||||
tiny_img.Scale(4, 4)
|
||||
ic.Blend(small_img,ICON_OVERLAY, 10, 13)
|
||||
pc.Blend(tiny_img,ICON_OVERLAY, 12, 19)
|
||||
|
||||
var/obj/item/weapon/photo/p = new()
|
||||
p.name = "photo"
|
||||
p.icon = ic
|
||||
p.tiny = pc
|
||||
p.img = photoimage
|
||||
p.desc = mobs
|
||||
p.pixel_x = rand(-10, 10)
|
||||
p.pixel_y = rand(-10, 10)
|
||||
p.photo_size = size
|
||||
return p
|
||||
|
||||
/obj/item/device/camera/proc/printpicture(mob/user, obj/item/weapon/photo/p)
|
||||
p.loc = user.loc
|
||||
if(!user.get_inactive_hand())
|
||||
user.put_in_inactive_hand(p)
|
||||
|
||||
/obj/item/weapon/photo/proc/copy(var/copy_id = 0)
|
||||
var/obj/item/weapon/photo/p = new/obj/item/weapon/photo()
|
||||
|
||||
p.name = name
|
||||
p.icon = icon(icon, icon_state)
|
||||
p.tiny = icon(tiny)
|
||||
p.img = icon(img)
|
||||
p.desc = desc
|
||||
p.pixel_x = pixel_x
|
||||
p.pixel_y = pixel_y
|
||||
p.photo_size = photo_size
|
||||
p.scribble = scribble
|
||||
|
||||
if(copy_id)
|
||||
p.id = id
|
||||
|
||||
return p
|
||||
/* Photography!
|
||||
* Contains:
|
||||
* Camera
|
||||
* Camera Film
|
||||
* Photos
|
||||
* Photo Albums
|
||||
*/
|
||||
|
||||
/*******
|
||||
* film *
|
||||
*******/
|
||||
/obj/item/device/camera_film
|
||||
name = "film cartridge"
|
||||
icon = 'icons/obj/items.dmi'
|
||||
desc = "A camera film cartridge. Insert it into a camera to reload it."
|
||||
icon_state = "film"
|
||||
item_state = "camera"
|
||||
w_class = ITEMSIZE_TINY
|
||||
|
||||
|
||||
/********
|
||||
* photo *
|
||||
********/
|
||||
var/global/photo_count = 0
|
||||
|
||||
/obj/item/weapon/photo
|
||||
name = "photo"
|
||||
icon = 'icons/obj/items.dmi'
|
||||
icon_state = "photo"
|
||||
item_state = "paper"
|
||||
w_class = ITEMSIZE_SMALL
|
||||
drop_sound = 'sound/items/drop/paper.ogg'
|
||||
pickup_sound = 'sound/items/pickup/paper.ogg'
|
||||
var/id
|
||||
var/icon/img //Big photo image
|
||||
var/scribble //Scribble on the back.
|
||||
var/icon/tiny
|
||||
var/photo_size = 3
|
||||
|
||||
/obj/item/weapon/photo/New()
|
||||
id = photo_count++
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/photo/attack_self(mob/user as mob)
|
||||
user.examinate(src)
|
||||
|
||||
/obj/item/weapon/photo/attackby(obj/item/weapon/P as obj, mob/user as mob)
|
||||
if(istype(P, /obj/item/weapon/pen))
|
||||
var/txt = sanitize(tgui_input_text(user, "What would you like to write on the back?", "Photo Writing", null, 128), 128)
|
||||
if(loc == user && user.stat == 0)
|
||||
scribble = txt
|
||||
..()
|
||||
|
||||
/obj/item/weapon/photo/examine(mob/user)
|
||||
//This is one time we're not going to call parent, because photos are 'secret' unless you're close enough.
|
||||
if(in_range(user, src))
|
||||
show(user)
|
||||
return list(desc)
|
||||
else
|
||||
return list("<span class='notice'>It is too far away to examine.</span>")
|
||||
|
||||
/obj/item/weapon/photo/proc/show(mob/user as mob)
|
||||
user << browse_rsc(img, "tmp_photo_[id].png")
|
||||
user << browse("<html><head><title>[name]</title></head>" \
|
||||
+ "<body style='overflow:hidden;margin:0;text-align:center'>" \
|
||||
+ "<img src='tmp_photo_[id].png' width='[64*photo_size]' style='-ms-interpolation-mode:nearest-neighbor' />" \
|
||||
+ "[scribble ? "<br>Written on the back:<br><i>[scribble]</i>" : ""]"\
|
||||
+ "</body></html>", "window=book;size=[64*photo_size]x[scribble ? 400 : 64*photo_size]")
|
||||
onclose(user, "[name]")
|
||||
return
|
||||
|
||||
/obj/item/weapon/photo/verb/rename()
|
||||
set name = "Rename photo"
|
||||
set category = "Object"
|
||||
set src in usr
|
||||
|
||||
var/n_name = sanitizeSafe(tgui_input_text(usr, "What would you like to label the photo?", "Photo Labelling", null, MAX_NAME_LEN), MAX_NAME_LEN)
|
||||
//loc.loc check is for making possible renaming photos in clipboards
|
||||
if(( (loc == usr || (loc.loc && loc.loc == usr)) && usr.stat == 0))
|
||||
name = "[(n_name ? text("[n_name]") : "photo")]"
|
||||
add_fingerprint(usr)
|
||||
return
|
||||
|
||||
|
||||
/**************
|
||||
* photo album *
|
||||
**************/
|
||||
/obj/item/weapon/storage/photo_album
|
||||
name = "Photo album"
|
||||
icon = 'icons/obj/items.dmi'
|
||||
icon_state = "album"
|
||||
item_state = "briefcase"
|
||||
can_hold = list(/obj/item/weapon/photo)
|
||||
|
||||
/obj/item/weapon/storage/photo_album/MouseDrop(obj/over_object as obj)
|
||||
|
||||
if((istype(usr, /mob/living/carbon/human)))
|
||||
var/mob/living/carbon/human/M = usr
|
||||
if(!( istype(over_object, /obj/screen) ))
|
||||
return ..()
|
||||
playsound(src, "rustle", 50, 1, -5)
|
||||
if((!( M.restrained() ) && !( M.stat ) && M.back == src))
|
||||
switch(over_object.name)
|
||||
if("r_hand")
|
||||
M.unEquip(src)
|
||||
M.put_in_r_hand(src)
|
||||
if("l_hand")
|
||||
M.unEquip(src)
|
||||
M.put_in_l_hand(src)
|
||||
add_fingerprint(usr)
|
||||
return
|
||||
if(over_object == usr && in_range(src, usr) || usr.contents.Find(src))
|
||||
if(usr.s_active)
|
||||
usr.s_active.close(usr)
|
||||
show_to(usr)
|
||||
return
|
||||
return
|
||||
|
||||
/*********
|
||||
* camera *
|
||||
*********/
|
||||
/obj/item/device/camera
|
||||
name = "camera"
|
||||
icon = 'icons/obj/items.dmi'
|
||||
desc = "A polaroid camera. 10 photos left."
|
||||
icon_state = "camera"
|
||||
item_state = "camera"
|
||||
w_class = ITEMSIZE_SMALL
|
||||
slot_flags = SLOT_BELT
|
||||
matter = list(MAT_STEEL = 2000)
|
||||
var/pictures_max = 10
|
||||
var/pictures_left = 10
|
||||
var/on = 1
|
||||
var/icon_on = "camera"
|
||||
var/icon_off = "camera_off"
|
||||
var/size = 3
|
||||
var/list/picture_planes = list()
|
||||
|
||||
/obj/item/device/camera/verb/change_size()
|
||||
set name = "Set Photo Focus"
|
||||
set category = "Object"
|
||||
var/nsize = tgui_input_list(usr, "Photo Size","Pick a size of resulting photo.", list(1,3,5,7))
|
||||
if(nsize)
|
||||
size = nsize
|
||||
to_chat(usr, "<span class='notice'>Camera will now take [size]x[size] photos.</span>")
|
||||
|
||||
/obj/item/device/camera/attack(mob/living/carbon/human/M as mob, mob/user as mob)
|
||||
return
|
||||
|
||||
/obj/item/device/camera/attack_self(mob/user as mob)
|
||||
on = !on
|
||||
if(on)
|
||||
src.icon_state = icon_on
|
||||
else
|
||||
src.icon_state = icon_off
|
||||
to_chat(user, "You switch the camera [on ? "on" : "off"].")
|
||||
return
|
||||
|
||||
/obj/item/device/camera/attackby(obj/item/I as obj, mob/user as mob)
|
||||
if(istype(I, /obj/item/device/camera_film))
|
||||
if(pictures_left)
|
||||
to_chat(user, "<span class='notice'>[src] still has some film in it!</span>")
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You insert [I] into [src].</span>")
|
||||
user.drop_item()
|
||||
qdel(I)
|
||||
pictures_left = pictures_max
|
||||
return
|
||||
..()
|
||||
|
||||
|
||||
/obj/item/device/camera/proc/get_icon(list/turfs, turf/center)
|
||||
|
||||
//Bigger icon base to capture those icons that were shifted to the next tile
|
||||
//i.e. pretty much all wall-mounted machinery
|
||||
var/icon/res = icon('icons/effects/96x96.dmi', "")
|
||||
res.Scale(size*32, size*32)
|
||||
// Initialize the photograph to black.
|
||||
res.Blend("#000", ICON_OVERLAY)
|
||||
|
||||
var/atoms[] = list()
|
||||
for(var/turf/the_turf in turfs)
|
||||
// Add outselves to the list of stuff to draw
|
||||
atoms.Add(the_turf);
|
||||
// As well as anything that isn't invisible.
|
||||
for(var/atom/A in the_turf)
|
||||
if(A.invisibility) continue
|
||||
if(A.plane > 0 && !(A.plane in picture_planes)) continue
|
||||
atoms.Add(A)
|
||||
|
||||
// Sort the atoms into their layers
|
||||
var/list/sorted = sort_atoms_by_layer(atoms)
|
||||
var/center_offset = (size-1)/2 * 32 + 1
|
||||
for(var/i; i <= sorted.len; i++)
|
||||
var/atom/A = sorted[i]
|
||||
if(A)
|
||||
var/icon/img = getFlatIcon(A, no_anim = TRUE)//, picture_planes = picture_planes)//build_composite_icon(A) //VOREStation Edit
|
||||
|
||||
// If what we got back is actually a picture, draw it.
|
||||
if(istype(img, /icon))
|
||||
// Check if we're looking at a mob that's lying down
|
||||
if(istype(A, /mob/living) && A:lying)
|
||||
// If they are, apply that effect to their picture.
|
||||
img.BecomeLying()
|
||||
// Calculate where we are relative to the center of the photo
|
||||
var/xoff = (A.x - center.x) * 32 + center_offset
|
||||
var/yoff = (A.y - center.y) * 32 + center_offset
|
||||
if (istype(A,/atom/movable))
|
||||
xoff+=A:pixel_x
|
||||
yoff+=A:pixel_y
|
||||
res.Blend(img, blendMode2iconMode(A.blend_mode), A.pixel_x + xoff, A.pixel_y + yoff)
|
||||
|
||||
// Lastly, render any contained effects on top.
|
||||
for(var/turf/the_turf in turfs)
|
||||
// Calculate where we are relative to the center of the photo
|
||||
var/xoff = (the_turf.x - center.x) * 32 + center_offset
|
||||
var/yoff = (the_turf.y - center.y) * 32 + center_offset
|
||||
res.Blend(getFlatIcon(the_turf.loc, no_anim = TRUE), blendMode2iconMode(the_turf.blend_mode),xoff,yoff)
|
||||
return res
|
||||
|
||||
|
||||
/obj/item/device/camera/proc/get_mobs(turf/the_turf as turf)
|
||||
var/mob_detail
|
||||
for(var/mob/living/carbon/A in the_turf)
|
||||
if(A.invisibility) continue
|
||||
var/holding = null
|
||||
if(A.l_hand || A.r_hand)
|
||||
if(A.l_hand) holding = "They are holding \a [A.l_hand]"
|
||||
if(A.r_hand)
|
||||
if(holding)
|
||||
holding += " and \a [A.r_hand]"
|
||||
else
|
||||
holding = "They are holding \a [A.r_hand]"
|
||||
|
||||
if(!mob_detail)
|
||||
mob_detail = "You can see [A] on the photo[(A:health / A.getMaxHealth()) < 0.75 ? " - [A] looks hurt":""].[holding ? " [holding]":"."]. "
|
||||
else
|
||||
mob_detail += "You can also see [A] on the photo[(A:health / A.getMaxHealth()) < 0.75 ? " - [A] looks hurt":""].[holding ? " [holding]":"."]."
|
||||
|
||||
return mob_detail
|
||||
|
||||
/obj/item/device/camera/afterattack(atom/target as mob|obj|turf|area, mob/user as mob, flag)
|
||||
if(!on || !pictures_left || ismob(target.loc)) return
|
||||
captureimage(target, user, flag)
|
||||
|
||||
playsound(src, pick('sound/items/polaroid1.ogg', 'sound/items/polaroid2.ogg'), 75, 1, -3)
|
||||
|
||||
pictures_left--
|
||||
desc = "A polaroid camera. It has [pictures_left] photos left."
|
||||
to_chat(user, "<span class='notice'>[pictures_left] photos left.</span>")
|
||||
icon_state = icon_off
|
||||
on = 0
|
||||
spawn(64)
|
||||
icon_state = icon_on
|
||||
on = 1
|
||||
|
||||
/obj/item/device/camera/proc/can_capture_turf(turf/T, mob/user)
|
||||
var/viewer = user
|
||||
if(user.client) //To make shooting through security cameras possible
|
||||
viewer = user.client.eye
|
||||
var/can_see = (T in view(viewer))
|
||||
|
||||
return can_see
|
||||
|
||||
/obj/item/device/camera/proc/captureimage(atom/target, mob/user, flag)
|
||||
var/x_c = target.x - (size-1)/2
|
||||
var/y_c = target.y + (size-1)/2
|
||||
var/z_c = target.z
|
||||
var/list/turfs = list()
|
||||
var/mobs = ""
|
||||
for(var/i = 1 to size)
|
||||
for(var/j = 1 to size)
|
||||
var/turf/T = locate(x_c, y_c, z_c)
|
||||
if(can_capture_turf(T, user))
|
||||
turfs.Add(T)
|
||||
mobs += get_mobs(T)
|
||||
x_c++
|
||||
y_c--
|
||||
x_c = x_c - size
|
||||
|
||||
var/obj/item/weapon/photo/p = createpicture(target, user, turfs, mobs, flag)
|
||||
|
||||
printpicture(user, p)
|
||||
|
||||
/obj/item/device/camera/proc/createpicture(atom/target, mob/user, list/turfs, mobs, flag)
|
||||
var/icon/photoimage = get_icon(turfs, target)
|
||||
|
||||
var/icon/small_img = icon(photoimage)
|
||||
var/icon/tiny_img = icon(photoimage)
|
||||
var/icon/ic = icon('icons/obj/items.dmi',"photo")
|
||||
var/icon/pc = icon('icons/obj/bureaucracy.dmi', "photo")
|
||||
small_img.Scale(8, 8)
|
||||
tiny_img.Scale(4, 4)
|
||||
ic.Blend(small_img,ICON_OVERLAY, 10, 13)
|
||||
pc.Blend(tiny_img,ICON_OVERLAY, 12, 19)
|
||||
|
||||
var/obj/item/weapon/photo/p = new()
|
||||
p.name = "photo"
|
||||
p.icon = ic
|
||||
p.tiny = pc
|
||||
p.img = photoimage
|
||||
p.desc = mobs
|
||||
p.pixel_x = rand(-10, 10)
|
||||
p.pixel_y = rand(-10, 10)
|
||||
p.photo_size = size
|
||||
return p
|
||||
|
||||
/obj/item/device/camera/proc/printpicture(mob/user, obj/item/weapon/photo/p)
|
||||
p.loc = user.loc
|
||||
if(!user.get_inactive_hand())
|
||||
user.put_in_inactive_hand(p)
|
||||
|
||||
/obj/item/weapon/photo/proc/copy(var/copy_id = 0)
|
||||
var/obj/item/weapon/photo/p = new/obj/item/weapon/photo()
|
||||
|
||||
p.name = name
|
||||
p.icon = icon(icon, icon_state)
|
||||
p.tiny = icon(tiny)
|
||||
p.img = icon(img)
|
||||
p.desc = desc
|
||||
p.pixel_x = pixel_x
|
||||
p.pixel_y = pixel_y
|
||||
p.photo_size = photo_size
|
||||
p.scribble = scribble
|
||||
|
||||
if(copy_id)
|
||||
p.id = id
|
||||
|
||||
return p
|
||||
|
||||
Reference in New Issue
Block a user