Merge pull request #9202 from Zuhayr/customitems

Custom items refactor.
This commit is contained in:
Chinsky
2015-05-14 21:47:04 +03:00
64 changed files with 845 additions and 1805 deletions
+178
View File
@@ -0,0 +1,178 @@
/obj/item/device/kit
icon_state = "modkit"
icon = 'icons/obj/device.dmi'
var/new_name = "mech" //What is the variant called?
var/new_desc = "A mech." //How is the new mech described?
var/new_icon = "ripley" //What base icon will the new mech use?
var/new_icon_file
var/uses = 1 // Uses before the kit deletes itself.
/obj/item/device/kit/examine()
..()
usr << "It has [uses] [uses>1?"uses":"use"] left."
/obj/item/device/kit/proc/use(var/amt, var/mob/user)
uses -= amt
playsound(get_turf(user), 'sound/items/Screwdriver.ogg', 50, 1)
if(uses<1)
user.drop_item()
qdel(src)
// Root hardsuit kit defines.
// Icons for modified hardsuits need to be in the proper .dmis because suit cyclers may cock them up.
/obj/item/device/kit/suit
name = "voidsuit modification kit"
desc = "A kit for modifying a voidsuit."
uses = 2
var/new_light_overlay
var/new_mob_icon_file
/obj/item/clothing/head/helmet/space/void/attackby(var/obj/item/O, var/mob/user)
if(istype(O,/obj/item/device/kit/suit))
var/obj/item/device/kit/suit/kit = O
name = "[kit.new_name] suit helmet"
desc = kit.new_desc
icon_state = "[kit.new_icon]_helmet"
item_state = "[kit.new_icon]_helmet"
if(kit.new_icon_file)
icon = kit.new_icon_file
if(kit.new_mob_icon_file)
icon_override = kit.new_mob_icon_file
if(kit.new_light_overlay)
light_overlay = kit.new_light_overlay
user << "You set about modifying the helmet into [src]."
var/mob/living/carbon/human/H = user
if(istype(H))
species_restricted = list(H.species.name)
kit.use(1,user)
return 1
return ..()
/obj/item/clothing/suit/space/void/attackby(var/obj/item/O, var/mob/user)
if(istype(O,/obj/item/device/kit/suit))
var/obj/item/device/kit/suit/kit = O
name = "[kit.new_name] voidsuit"
desc = kit.new_desc
icon_state = "[kit.new_icon]_suit"
item_state = "[kit.new_icon]_suit"
if(kit.new_icon_file)
icon = kit.new_icon_file
if(kit.new_mob_icon_file)
icon_override = kit.new_mob_icon_file
user << "You set about modifying the suit into [src]."
var/mob/living/carbon/human/H = user
if(istype(H))
species_restricted = list(H.species.name)
kit.use(1,user)
return 1
return ..()
/obj/item/device/kit/paint
name = "mecha customisation kit"
desc = "A kit containing all the needed tools and parts to repaint a mech."
var/removable = null
var/list/allowed_types = list()
/obj/item/device/kit/paint/examine()
..()
usr << "This kit will convert an exosuit into: [new_name]."
usr << "This kit can be used on the following exosuit models:"
for(var/exotype in allowed_types)
usr << "- [capitalize(exotype)]"
/obj/mecha/attackby(var/obj/item/weapon/W, var/mob/user)
if(istype(W, /obj/item/device/kit/paint))
if(occupant)
user << "You can't customize a mech while someone is piloting it - that would be unsafe!"
return
var/obj/item/device/kit/paint/P = W
var/found = null
for(var/type in P.allowed_types)
if(type==src.initial_icon)
found = 1
break
if(!found)
user << "That kit isn't meant for use on this class of exosuit."
return
user.visible_message("[user] opens [P] and spends some quality time customising [src].")
src.name = P.new_name
src.desc = P.new_desc
src.initial_icon = P.new_icon
if(P.new_icon_file)
src.icon = P.new_icon_file
src.reset_icon()
P.use(1, user)
return 1
else
return ..()
//Ripley APLU kits.
/obj/item/device/kit/paint/ripley
name = "\"Classic\" APLU customisation kit"
new_name = "APLU \"Classic\""
new_desc = "A very retro APLU unit; didn't they retire these back in 2543?"
new_icon = "ripley-old"
allowed_types = list("ripley")
/obj/item/device/kit/paint/ripley/death
name = "\"Reaper\" APLU customisation kit"
new_name = "APLU \"Reaper\""
new_desc = "A terrifying, grim power loader. Why do those clamps have spikes?"
new_icon = "deathripley"
allowed_types = list("ripley","firefighter")
/obj/item/device/kit/paint/ripley/flames_red
name = "\"Firestarter\" APLU customisation kit"
new_name = "APLU \"Firestarter\""
new_desc = "A standard APLU exosuit with stylish orange flame decals."
new_icon = "ripley_flames_red"
/obj/item/device/kit/paint/ripley/flames_blue
name = "\"Burning Chrome\" APLU customisation kit"
new_name = "APLU \"Burning Chrome\""
new_desc = "A standard APLU exosuit with stylish blue flame decals."
new_icon = "ripley_flames_blue"
// Durand kits.
/obj/item/device/kit/paint/durand
name = "\"Classic\" Durand customisation kit"
new_name = "Durand \"Classic\""
new_desc = "An older model of Durand combat exosuit. This model was retired for rotating a pilot's torso 180 degrees."
new_icon = "old_durand"
allowed_types = list("durand")
/obj/item/device/kit/paint/durand/seraph
name = "\"Cherubim\" Durand customisation kit"
new_name = "Durand \"Cherubim\""
new_desc = "A Durand combat exosuit modelled after ancient Earth entertainment. Your heart goes doki-doki just looking at it."
new_icon = "old_durand"
/obj/item/device/kit/paint/durand/phazon
name = "\"Sypher\" Durand customisation kit"
new_name = "Durand \"Sypher\""
new_desc = "A Durand combat exosuit with some very stylish neons and decals. Seems to blur slightly at the edges; probably an optical illusion."
new_icon = "phazon"
// Gygax kits.
/obj/item/device/kit/paint/gygax
name = "\"Jester\" Gygax customisation kit"
new_name = "Gygax \"Jester\""
new_desc = "A Gygax exosuit modelled after the infamous combat-troubadors of Earth's distant past. Terrifying to behold."
new_icon = "honker"
allowed_types = list("gygax")
/obj/item/device/kit/paint/gygax/darkgygax
name = "\"Silhouette\" Gygax customisation kit"
new_name = "Gygax \"Silhouette\""
new_desc = "An ominous Gygax exosuit modelled after the fictional corporate 'death squads' that were popular in pulp action-thrillers back in 2554."
new_icon = "darkgygax"
/obj/item/device/kit/paint/gygax/recitence
name = "\"Gaoler\" Gygax customisation kit"
new_name = "Durand \"Gaoler\""
new_desc = "A bulky silver Gygax exosuit. The extra armour appears to be painted on, but it's very shiny."
new_icon = "recitence"
+5
View File
@@ -923,6 +923,11 @@
desc = "A plushie of a fuzzy spider! It has eight legs - all the better to hug you with."
icon_state = "spiderplushie"
/obj/item/toy/plushie/farwa
name = "farwa plush"
desc = "A farwa plush doll. It's soft and comforting!"
icon_state = "farwaplushie"
//Toy cult sword
/obj/item/toy/cultsword
name = "foam sword"
+2 -13
View File
@@ -81,7 +81,7 @@
/obj/item/device/taperecorder,
/obj/item/device/hailer,
/obj/item/device/megaphone,
/obj/item/clothing/accessory/holobadge,
/obj/item/clothing/accessory/badge/holo,
/obj/structure/closet/crate/secure,
/obj/structure/closet/secure_closet,
/obj/machinery/librarycomp,
@@ -162,17 +162,6 @@
/obj/item/weapon/card/id/GetID()
return src
/obj/item/weapon/card/id/attackby(obj/item/weapon/W as obj, mob/user as mob)
..()
if(istype(W,/obj/item/weapon/id_wallet))
user << "You slip [src] into [W]."
src.name = "[src.registered_name]'s [W.name] ([src.assignment])"
src.desc = W.desc
src.icon = W.icon
src.icon_state = W.icon_state
qdel(W)
return
/obj/item/weapon/card/id/verb/read()
set name = "Read ID Card"
set category = "Object"
@@ -297,7 +286,7 @@
/obj/item/weapon/card/id/centcom/ERT
name = "\improper Emergency Response Team ID"
assignment = "Emergency Response Team"
/obj/item/weapon/card/id/centcom/ERT/New()
..()
access += get_all_accesses()
@@ -416,35 +416,33 @@ CIGARETTE PACKETS ARE IN FANCY.DM
icon = 'icons/obj/items.dmi'
icon_state = "lighter-g"
item_state = "lighter-g"
var/icon_on = "lighter-g-on"
var/icon_off = "lighter-g"
w_class = 1
throwforce = 4
flags = CONDUCT
slot_flags = SLOT_BELT
attack_verb = list("burnt", "singed")
var/base_state
/obj/item/weapon/flame/lighter/zippo
name = "\improper Zippo lighter"
desc = "The zippo."
icon_state = "zippo"
item_state = "zippo"
icon_on = "zippoon"
icon_off = "zippo"
/obj/item/weapon/flame/lighter/random
New()
var/color = pick("r","c","y","g")
icon_on = "lighter-[color]-on"
icon_off = "lighter-[color]"
icon_state = icon_off
icon_state = "lighter-[pick("r","c","y","g")]"
item_state = icon_state
base_state = icon_state
/obj/item/weapon/flame/lighter/attack_self(mob/living/user)
if(!base_state)
base_state = icon_state
if(user.r_hand == src || user.l_hand == src)
if(!lit)
lit = 1
icon_state = icon_on
item_state = icon_on
icon_state = "[base_state]on"
item_state = "[base_state]on"
if(istype(src, /obj/item/weapon/flame/lighter/zippo) )
user.visible_message("<span class='rose'>Without even breaking stride, [user] flips open and lights [src] in one smooth movement.</span>")
else
@@ -462,8 +460,8 @@ CIGARETTE PACKETS ARE IN FANCY.DM
processing_objects.Add(src)
else
lit = 0
icon_state = icon_off
item_state = icon_off
icon_state = "[base_state]"
item_state = "[base_state]"
if(istype(src, /obj/item/weapon/flame/lighter/zippo) )
user.visible_message("<span class='rose'>You hear a quiet click, as [user] shuts off [src] without even looking at what they're doing.")
else
@@ -155,6 +155,12 @@
"\red <b>[user] is slitting \his stomach open with the [src.name]! It looks like \he's trying to commit seppuku.</b>")
return (BRUTELOSS)
/obj/item/weapon/kitchenknife/hook
name = "meat hook"
desc = "A sharp, metal hook what sticks into things."
icon_state = "hook_knife"
item_state = "hook_knife"
/obj/item/weapon/kitchenknife/ritual
name = "ritual knife"
desc = "The unearthly energies that once powered this blade are now dormant."
@@ -92,12 +92,9 @@
/obj/item/weapon/storage/belt/medical/emt
name = "EMT utility belt"
desc = "A sturdy black webbing belt with attached pouches."
icon = 'icons/obj/custom_items.dmi'
icon_state = "emsbelt"
item_state = "emsbelt"
/obj/item/weapon/storage/belt/security
name = "security belt"
desc = "Can hold security gear like handcuffs and flashes."
@@ -289,3 +289,17 @@
new /obj/item/weapon/reagent_containers/pill/tramadol( src )
new /obj/item/weapon/reagent_containers/pill/tramadol( src )
new /obj/item/weapon/reagent_containers/pill/tramadol( src )
/obj/item/weapon/storage/pill_bottle/citalopram
name = "bottle of Citalopram pills"
desc = "Contains pills used to stabilize a patient's mood."
New()
..()
new /obj/item/weapon/reagent_containers/pill/citalopram( src )
new /obj/item/weapon/reagent_containers/pill/citalopram( src )
new /obj/item/weapon/reagent_containers/pill/citalopram( src )
new /obj/item/weapon/reagent_containers/pill/citalopram( src )
new /obj/item/weapon/reagent_containers/pill/citalopram( src )
new /obj/item/weapon/reagent_containers/pill/citalopram( src )
new /obj/item/weapon/reagent_containers/pill/citalopram( src )
+1 -1
View File
@@ -158,7 +158,7 @@
spawn_nothing_percentage = 50
item_to_spawn()
return pick(prob(3);/obj/item/weapon/storage/pill_bottle/tramadol,\
prob(4);/obj/item/weapon/haircomb/fluff/cado_keppel_1,\
prob(4);/obj/item/weapon/haircomb,\
prob(2);/obj/item/weapon/storage/pill_bottle/happy,\
prob(2);/obj/item/weapon/storage/pill_bottle/zoom,\
prob(5);/obj/item/weapon/contraband/poster,\
+1 -1
View File
@@ -4,7 +4,7 @@
icon = 'icons/obj/coatrack.dmi'
icon_state = "coatrack0"
var/obj/item/clothing/suit/coat
var/list/allowed = list(/obj/item/clothing/suit/storage/labcoat, /obj/item/clothing/suit/storage/toggle/labcoat, /obj/item/clothing/suit/storage/det_suit)
var/list/allowed = list(/obj/item/clothing/suit/storage/toggle/labcoat, /obj/item/clothing/suit/storage/det_suit)
/obj/structure/coatrack/attack_hand(mob/user as mob)
user.visible_message("[user] takes [coat] off \the [src].", "You take [coat] off the \the [src]")
@@ -23,44 +23,7 @@
return attack_hand(user)
/obj/structure/largecrate/mule
icon_state = "mulecrate"
/obj/structure/largecrate/lisa
icon_state = "lisacrate"
/obj/structure/largecrate/lisa/attackby(obj/item/weapon/W as obj, mob/user as mob) //ugly but oh well
if(istype(W, /obj/item/weapon/crowbar))
new /mob/living/simple_animal/corgi/Lisa(loc)
..()
/obj/structure/largecrate/cow
name = "cow crate"
icon_state = "lisacrate"
/obj/structure/largecrate/cow/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/crowbar))
new /mob/living/simple_animal/cow(loc)
..()
/obj/structure/largecrate/goat
name = "goat crate"
icon_state = "lisacrate"
/obj/structure/largecrate/goat/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/crowbar))
new /mob/living/simple_animal/hostile/retaliate/goat(loc)
..()
/obj/structure/largecrate/chick
name = "chicken crate"
icon_state = "lisacrate"
/obj/structure/largecrate/chick/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/crowbar))
var/num = rand(4, 6)
for(var/i = 0, i < num, i++)
new /mob/living/simple_animal/chick(loc)
..()
name = "MULE crate"
/obj/structure/largecrate/hoverpod
name = "\improper Hoverpod assembly crate"
@@ -71,9 +34,43 @@
if(istype(W, /obj/item/weapon/crowbar))
var/obj/item/mecha_parts/mecha_equipment/ME
var/obj/mecha/working/hoverpod/H = new (loc)
ME = new /obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp
ME.attach(H)
ME = new /obj/item/mecha_parts/mecha_equipment/tool/passenger
ME.attach(H)
..()
/obj/structure/largecrate/animal
icon_state = "mulecrate"
var/held_count = 1
var/held_type
/obj/structure/largecrate/animal/New()
..()
for(var/i = 1;i<=held_count;i++)
new held_type(src)
/obj/structure/largecrate/animal/corgi
name = "corgi carrier"
held_type = /mob/living/simple_animal/corgi
/obj/structure/largecrate/animal/cow
name = "cow crate"
held_type = /mob/living/simple_animal/cow
/obj/structure/largecrate/animal/goat
name = "goat crate"
held_type = /mob/living/simple_animal/hostile/retaliate/goat
/obj/structure/largecrate/animal/cat
name = "cat carrier"
held_type = /mob/living/simple_animal/cat
/obj/structure/largecrate/animal/cat/bones
held_type = /mob/living/simple_animal/cat/fluff/bones
/obj/structure/largecrate/animal/chick
name = "chicken crate"
held_count = 5
held_type = /mob/living/simple_animal/chick