From 2edd73627d6ab6c46cce7105c1c10c23a97e437e Mon Sep 17 00:00:00 2001 From: comma Date: Fri, 2 Mar 2012 21:56:08 +0200 Subject: [PATCH] Added ashtrays Breakable. Spill contents on breaking or hitting the solid stuff after being thrown. Have limited capacity. Can be emptied in disposal outlet. Change sprite when are half-filled and filled. Also fiddled a bit with the cigs code, so you can put them out without dropping. --- baystation12.dme | 48 ++++++- code/WorkInProgress/Chinsky/ashtray.dm | 136 ++++++++++++++++++ code/game/machinery/autolathe.dm | 1 + .../objects/items/weapons/cigs_lighters.dm | 29 ++-- code/modules/recycling/disposal.dm | 9 ++ icons/ashtray.dmi | Bin 0 -> 2158 bytes 6 files changed, 206 insertions(+), 17 deletions(-) create mode 100644 code/WorkInProgress/Chinsky/ashtray.dm create mode 100644 icons/ashtray.dmi diff --git a/baystation12.dme b/baystation12.dme index beed9a343a4..e5be9e5a6d7 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -1,10 +1,36 @@ // DM Environment file for baystation12.dme. -// All manual changes should be made outside the BEGIN_ and END_ blocks. -// New source code should be placed in .dm files: choose File/New --> Code File. +// All manual changes should be made outside the BEGIN_ and END_ blocks. + // New source code should be placed in .dm files: choose File/New --> Code File. // BEGIN_INTERNALS // END_INTERNALS // BEGIN_FILE_DIR #define FILE_DIR . +#define FILE_DIR ".git" +#define FILE_DIR ".git/hooks" +#define FILE_DIR ".git/info" +#define FILE_DIR ".git/logs" +#define FILE_DIR ".git/logs/refs" +#define FILE_DIR ".git/logs/refs/heads" +#define FILE_DIR ".git/logs/refs/remotes" +#define FILE_DIR ".git/logs/refs/remotes/origin" +#define FILE_DIR ".git/objects" +#define FILE_DIR ".git/objects/00" +#define FILE_DIR ".git/objects/2c" +#define FILE_DIR ".git/objects/2e" +#define FILE_DIR ".git/objects/37" +#define FILE_DIR ".git/objects/4f" +#define FILE_DIR ".git/objects/73" +#define FILE_DIR ".git/objects/a0" +#define FILE_DIR ".git/objects/b4" +#define FILE_DIR ".git/objects/bb" +#define FILE_DIR ".git/objects/bd" +#define FILE_DIR ".git/objects/e0" +#define FILE_DIR ".git/objects/fd" +#define FILE_DIR ".git/objects/pack" +#define FILE_DIR ".git/refs" +#define FILE_DIR ".git/refs/heads" +#define FILE_DIR ".git/refs/remotes" +#define FILE_DIR ".git/refs/remotes/origin" #define FILE_DIR "code" #define FILE_DIR "code/ATMOSPHERICS" #define FILE_DIR "code/ATMOSPHERICS/components" @@ -154,6 +180,7 @@ #define FILE_DIR "code/WorkInProgress/Apples" #define FILE_DIR "code/WorkInProgress/Cael_Aislinn" #define FILE_DIR "code/WorkInProgress/Cael_Aislinn/Tajara" +#define FILE_DIR "code/WorkInProgress/Chinsky" #define FILE_DIR "code/WorkInProgress/mapload" #define FILE_DIR "code/WorkInProgress/Mini" #define FILE_DIR "code/WorkInProgress/Mloc" @@ -167,6 +194,16 @@ #define FILE_DIR "code/WorkInProgress/Tastyfish" #define FILE_DIR "code/WorkInProgress/virus2" #define FILE_DIR "code/WorkInProgress/Wrongnumber" +#define FILE_DIR "config" +#define FILE_DIR "config/names" +#define FILE_DIR "data" +#define FILE_DIR "data/logs" +#define FILE_DIR "data/logs/2012" +#define FILE_DIR "data/logs/2012/02-February" +#define FILE_DIR "data/logs/2012/03-March" +#define FILE_DIR "data/player_saves" +#define FILE_DIR "data/player_saves/c" +#define FILE_DIR "data/player_saves/c/chinsky" #define FILE_DIR "html" #define FILE_DIR "icons" #define FILE_DIR "icons/48x48" @@ -181,12 +218,14 @@ #define FILE_DIR "icons/obj/machines" #define FILE_DIR "icons/obj/pipes" #define FILE_DIR "icons/pda_icons" +#define FILE_DIR "icons/PSD files" #define FILE_DIR "icons/spideros_icons" #define FILE_DIR "icons/Testing" #define FILE_DIR "icons/turf" #define FILE_DIR "icons/vending_icons" #define FILE_DIR "interface" #define FILE_DIR "maps" +#define FILE_DIR "music" #define FILE_DIR "sound" #define FILE_DIR "sound/ambience" #define FILE_DIR "sound/announcer" @@ -200,10 +239,13 @@ #define FILE_DIR "sound/scary" #define FILE_DIR "sound/voice" #define FILE_DIR "sound/weapons" +#define FILE_DIR "SQL" // END_FILE_DIR + // BEGIN_PREFERENCES #define DEBUG // END_PREFERENCES + // BEGIN_INCLUDE #include "code\names.dm" #include "code\setup.dm" @@ -1063,6 +1105,7 @@ #include "code\WorkInProgress\Cael_Aislinn\Tajara\examine.dm" #include "code\WorkInProgress\Cael_Aislinn\Tajara\tajara_transformation.dm" #include "code\WorkInProgress\Cael_Aislinn\Tajara\tajaran.dm" +#include "code\WorkInProgress\Chinsky\ashtray.dm" #include "code\WorkInProgress\mapload\dmm_suite.dm" #include "code\WorkInProgress\mapload\reader.dm" #include "code\WorkInProgress\Mini\atmos_control.dm" @@ -1101,4 +1144,3 @@ #include "interface\skin.dmf" #include "maps\tgstation.2.0.8.dmm" // END_INCLUDE - diff --git a/code/WorkInProgress/Chinsky/ashtray.dm b/code/WorkInProgress/Chinsky/ashtray.dm new file mode 100644 index 00000000000..e6f307ceb95 --- /dev/null +++ b/code/WorkInProgress/Chinsky/ashtray.dm @@ -0,0 +1,136 @@ +/obj/item/ashtray + name = "ashtray" + desc = "Cheap plastic ashtray." + icon = 'ashtray.dmi' + icon_state = "ashtray_bl" + health = 15.0 + g_amt = 20 + var/max_butts = 10 + var/empty_desc = "Cheap plastic ashtray." + var/icon_empty = "ashtray_bl" + var/icon_half = "ashtray_half_bl" + var/icon_full = "ashtray_full_bl" + var/icon_broken = "ashtray_bork_bl" + +/obj/item/ashtray/New() + ..() + src.pixel_y = rand(-5, 5) + src.pixel_x = rand(-6, 6) + return + +/obj/item/ashtray/attackby(obj/item/weapon/W as obj, mob/user as mob) + if (health < 1) + return + if (istype(W,/obj/item/clothing/mask/cigarette)) + if(user) + if (contents.len >= max_butts) + user << "This ashtray is full." + return + user.u_equip(W) + W.loc = src + if ((user.client && user.s_active != src)) + user.client.screen -= W + var/obj/item/clothing/mask/cigarette/cig = W + if (cig.lit == 1) + src.visible_message("[user] crushes a [cig] in the [src], putting it out.") + cig.put_out() + else if (cig.lit == 0) + user << "You place a [cig] in [src] without even smoking it. Why would you do that?" + else if (cig.lit == -1) + src.visible_message("[user] places a [cig] in the [src],.") + user.update_clothing() + add_fingerprint(user) + if (contents.len == max_butts) + icon_state = icon_full + desc = empty_desc + " It's stuffed full." + else if (contents.len > max_butts/2) + icon_state = icon_half + desc = empty_desc + " It's half-filled." + else + health = max(0,health - W.force) + user << "You hit [src] with [W]." + if (health < 1) + die() + return + +/obj/item/ashtray/throw_impact(atom/hit_atom) + if (health > 0) + health = max(0,health - 3) + if (health < 1) + die() + return + if (contents.len) + src.visible_message("\red [src] slams into [hit_atom] spilling its contents!") + for (var/obj/item/clothing/mask/cigarette/O in contents) + contents -= O + O.loc = src.loc + icon_state = icon_empty + return ..() + +/obj/item/ashtray/proc/die() + src.visible_message("\red [src] shatters spilling its contents!") + for (var/obj/item/clothing/mask/cigarette/O in contents) + contents -= O + O.loc = src.loc + icon_state = icon_broken + +/obj/item/ashtray/plastic + name = "plastic ashtray" + desc = "Cheap plastic ashtray." + icon_state = "ashtray_bl" + icon_empty = "ashtray_bl" + icon_half = "ashtray_half_bl" + icon_full = "ashtray_full_bl" + icon_broken = "ashtray_bork_bl" + max_butts = 14 + health = 24.0 + g_amt = 30 + empty_desc = "Cheap plastic ashtray." + throwforce = 3.0 + die() + ..() + name = "pieces of plastic" + desc = "Pieces of plastic with ash on them." + return + + +/obj/item/ashtray/bronze + name = "bronze ashtray" + desc = "Massive bronze ashtray." + icon_state = "ashtray_br" + icon_empty = "ashtray_br" + icon_half = "ashtray_half_br" + icon_full = "ashtray_full_br" + icon_broken = "ashtray_bork_br" + max_butts = 10 + health = 72.0 + m_amt = 50 + empty_desc = "Massive bronze ashtray." + throwforce = 10.0 + + die() + ..() + name = "pieces of bronze" + desc = "Pieces of bronze with ash on them." + return + + +/obj/item/ashtray/glass + name = "glass ashtray" + desc = "Glass ashtray. Looks fragile." + icon_state = "ashtray_gl" + icon_empty = "ashtray_gl" + icon_half = "ashtray_half_gl" + icon_full = "ashtray_full_gl" + icon_broken = "ashtray_bork_gl" + max_butts = 12 + health = 12.0 + g_amt = 60 + empty_desc = "Glass ashtray. Looks fragile." + throwforce = 6.0 + + die() + ..() + name = "shards of glass" + desc = "Shards of glass with ash on them." + return \ No newline at end of file diff --git a/code/game/machinery/autolathe.dm b/code/game/machinery/autolathe.dm index 45fd5e8d9d7..dcafa06665b 100644 --- a/code/game/machinery/autolathe.dm +++ b/code/game/machinery/autolathe.dm @@ -307,6 +307,7 @@ var/global/list/autolathe_recipes = list( \ new /obj/item/device/assembly/timer(), \ new /obj/item/weapon/light/tube(), \ new /obj/item/weapon/light/bulb(), \ + new /obj/item/ashtray/glass() ) var/global/list/autolathe_recipes_hidden = list( \ diff --git a/code/game/objects/items/weapons/cigs_lighters.dm b/code/game/objects/items/weapons/cigs_lighters.dm index a0aab9d9c1b..b8bfaffeee8 100644 --- a/code/game/objects/items/weapons/cigs_lighters.dm +++ b/code/game/objects/items/weapons/cigs_lighters.dm @@ -120,6 +120,7 @@ ZIPPO var/butt_count = 5 //count of butt sprite variations proc light(var/flavor_text = "[usr] lights the [name].") + put_out() attackby(obj/item/weapon/W as obj, mob/user as mob) ..() @@ -144,20 +145,26 @@ ZIPPO O.show_message(flavor_text, 1) processing_objects.Add(src) + put_out() + src.lit = -1 + src.damtype = "brute" + src.icon_state = icon_butt + "[rand(0,butt_count)]" + src.item_state = icon_off + src.desc = "A [src.name] butt." + src.name = "[src.name] butt" + process() var/turf/location = get_turf(src) src.smoketime-- if(src.smoketime < 1) - src.lit = -1 - src.damtype = "brute" - src.icon_state = icon_butt + "[rand(0,butt_count)]" - src.item_state = icon_off - src.desc = "A [src.name] butt." - src.name = "[src.name] butt" if(ismob(src.loc)) var/mob/living/M = src.loc M << "\red Your [src.name] goes out." + put_out() + M.update_clothing() + else + put_out() processing_objects.Remove(src) return if(location) @@ -167,14 +174,8 @@ ZIPPO dropped(mob/user as mob) if(src.lit == 1) - for(var/mob/O in viewers(user, null)) - O.show_message(text("\red [] calmly drops and treads on the lit [], putting it out instantly.", user,src.name), 1) - src.lit = -1 - src.damtype = "brute" - src.icon_state = icon_butt + "[rand(0,butt_count)]" - src.item_state = icon_off - src.desc = "A [src.name] butt." - src.name = "[src.name] butt" + src.visible_message("\red [user] calmly drops and treads on the lit [src], putting it out instantly.") + put_out() return ..() diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index 9c0ea592f27..4313fefb095 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -61,6 +61,15 @@ update() return + if(istype(I, /obj/item/ashtray)) + user << "\blue You empty the ashtray." + for(var/obj/item/O in I.contents) + O.loc = src + I.contents -= O + I.icon_state = I:icon_empty + update() + return + if(istype(I, /obj/item/weapon/weldingtool) && I:welding) var/obj/item/weapon/weldingtool/W = I playsound(src.loc, 'Welder.ogg', 100, 1) diff --git a/icons/ashtray.dmi b/icons/ashtray.dmi new file mode 100644 index 0000000000000000000000000000000000000000..2a5ba568199dff52c221519f9be893ee2f41e112 GIT binary patch literal 2158 zcmaJ@dpHw%AD_sQ%}I5##tu?0Nk~YNc;>L>cJ@w*B)5>EkeSQcDNBw@5~DeWnADj| zGs3iGu@||#*oMW3kV{s~ZH;&Tyw7=`x99DT@8x+u-|zSNe!tJ>`TlxbWyG03e|tC#z{E#|-2YDm8|` zB)vXodZ;+q1+P2!wyLedq0V<>6?UxNo2)dA1Xd7zZ))q$wEfOHuCGne8B077v$AqF zUS}+3>RouW-zfQU2w$ftt3Bi~#U}Dt>ILE*dTY=&1%qx-hufm0hdm!`w*1(r7*G0| zTS8?rphoG=L+FFFXU>0u?zE5{lTsZ^kanyW151ZLAW@mGP*c7icq&XIUC)G{ugf^~ zy&kZ*2{!8j59(069Y+QLfL9Q32XsQg!h4Ufi(Y$`#fx4M$M>2XNAG$>bWuU1GfWmv zkg=iJ{1W9GIgV#A8emKBCr-9L?V3JNx{EseQP<B{s+pPa?Vj8q!)MC4b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