the-strength-of-this-world-fades

This commit is contained in:
Fox McCloud
2019-10-04 19:34:08 -04:00
parent 20c4cf0a08
commit 5170f3fbae
40 changed files with 582 additions and 850 deletions
+49 -88
View File
@@ -1,133 +1,94 @@
/obj/item/ashtray
icon = 'icons/ashtray.dmi'
var/
max_butts = 0
empty_desc = ""
icon_empty = ""
icon_half = ""
icon_full = ""
icon_broken = ""
var/max_butts = 0
var/icon_half = ""
var/icon_full = ""
/obj/item/ashtray/New()
..()
src.pixel_y = rand(-5, 5)
src.pixel_x = rand(-6, 6)
return
/obj/item/ashtray/Initialize(mapload)
. = ..()
pixel_y = rand(-5, 5)
pixel_x = rand(-6, 6)
/obj/item/ashtray/attackby(obj/item/W as obj, mob/user as mob, params)
if(health < 1)
return
if(istype(W,/obj/item/cigbutt) || istype(W,/obj/item/clothing/mask/cigarette) || istype(W, /obj/item/match))
/obj/item/ashtray/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/cigbutt) || istype(I, /obj/item/clothing/mask/cigarette) || istype(I, /obj/item/match))
if(contents.len >= max_butts)
to_chat(user, "This ashtray is full.")
return
user.unEquip(W)
W.loc = src
if(!user.unEquip(I))
return
I.forceMove(src)
if(istype(W,/obj/item/clothing/mask/cigarette))
var/obj/item/clothing/mask/cigarette/cig = W
if(istype(I, /obj/item/clothing/mask/cigarette))
var/obj/item/clothing/mask/cigarette/cig = I
if(cig.lit == 1)
src.visible_message("[user] crushes [cig] in [src], putting it out.")
visible_message("[user] crushes [cig] in [src], putting it out.")
var/obj/item/butt = new cig.type_butt(src)
cig.transfer_fingerprints_to(butt)
qdel(cig)
else if(cig.lit == 0)
to_chat(user, "You place [cig] in [src] without even smoking it. Why would you do that?")
src.visible_message("[user] places [W] in [src].")
user.update_inv_l_hand()
user.update_inv_r_hand()
visible_message("[user] places [I] in [src].")
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."
update_icon()
else
health = max(0,health - W.force)
to_chat(user, "You hit [src] with [W].")
if(health < 1)
die()
return
return ..()
/obj/item/ashtray/update_icon()
if(contents.len == max_butts)
icon_state = icon_full
desc = initial(desc) + " It's stuffed full."
if(contents.len > max_butts * 0.5)
icon_state = icon_half
desc = initial(desc) + " It's half-filled."
else
icon_state = initial(icon_state)
desc = initial(desc)
/obj/item/ashtray/deconstruct()
empty_tray()
qdel(src)
/obj/item/ashtray/proc/empty_tray()
for(var/obj/item/I in contents)
I.forceMove(loc)
update_icon()
/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("<span class='warning'>[src] slams into [hit_atom] spilling its contents!</span>")
for(var/obj/item/clothing/mask/cigarette/O in contents)
O.loc = src.loc
icon_state = icon_empty
if(contents.len)
visible_message("<span class='warning'>[src] slams into [hit_atom] spilling its contents!</span>")
empty_tray()
return ..()
/obj/item/ashtray/proc/die()
src.visible_message("<span class='warning'>[src] shatters spilling its contents!</span>")
for(var/obj/item/clothing/mask/cigarette/O in contents)
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
max_butts = 8
max_integrity = 8
materials = list(MAT_METAL=30, MAT_GLASS=30)
empty_desc = "Cheap plastic ashtray."
throwforce = 3.0
die()
..()
name = "pieces of plastic"
desc = "Pieces of plastic with ash on them."
return
throwforce = 3
/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
max_butts = 16
max_integrity = 16
materials = list(MAT_METAL=80)
empty_desc = "Massive bronze ashtray."
throwforce = 10.0
die()
..()
name = "pieces of bronze"
desc = "Pieces of bronze with ash on them."
return
throwforce = 10
/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
max_integrity = 12
materials = list(MAT_GLASS=60)
empty_desc = "Glass ashtray. Looks fragile."
throwforce = 6.0
die()
..()
name = "shards of glass"
desc = "Shards of glass with ash on them."
playsound(src, "shatter", 30, 1)
return
throwforce = 6
@@ -178,6 +178,7 @@ var/global/list/datum/stack_recipe/wood_recipes = list(
new /datum/stack_recipe("rifle stock", /obj/item/weaponcrafting/stock, 10, time = 40),
new /datum/stack_recipe("wooden door", /obj/structure/mineral_door/wood, 10, time = 20, one_per_turf = 1, on_floor = 1),
new /datum/stack_recipe("coffin", /obj/structure/closet/coffin, 5, time = 15, one_per_turf = 1, on_floor = 1),
new/datum/stack_recipe("display case chassis", /obj/structure/displaycase_chassis, 5, one_per_turf = TRUE, on_floor = TRUE),
new /datum/stack_recipe("wooden buckler", /obj/item/shield/riot/buckler, 20, time = 40),
new /datum/stack_recipe("apiary", /obj/structure/beebox, 40, time = 50),
new /datum/stack_recipe("honey frame", /obj/item/honey_frame, 5, time = 10),
@@ -22,8 +22,7 @@
for(var/obj/structure/blob/B in hear(8, flashbang_turf)) //Blob damage here
var/damage = round(30 / (get_dist(B, get_turf(src)) + 1))
B.health -= damage
B.update_icon()
B.take_damage(damage, BURN, "melee", 0)
spawn(light_time)
qdel(src)
@@ -31,8 +31,7 @@
for(var/obj/structure/blob/B in view(8,src))
var/damage = round(30/(get_dist(B,src)+1))
B.health -= damage
B.update_icon()
B.take_damage(damage, BURN, "melee", 0)
sleep(80)
qdel(src)
return