Skip to content

Commit

Permalink
Wasteland Flipper: House Wall DLC (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
AF-Buyrcsp2 authored May 8, 2024
1 parent 70270b8 commit be59bb4
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 21 deletions.
3 changes: 3 additions & 0 deletions code/game/objects/items/crayons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,9 @@
if(!proximity)
return

if(istype(target, /turf/closed/wall/f13/wood/house/broken) || istype(target, /turf/closed/wall/f13/wood/house) || istype(target, /turf/closed/wall/f13/wood/house/clean) || istype(target, /turf/closed/wall/f13/wood/house/clean/broken))
return

if(is_capped)
to_chat(user, span_warning("Take the cap off first!"))
return
Expand Down
88 changes: 67 additions & 21 deletions fallout/turf/walls.dm
Original file line number Diff line number Diff line change
Expand Up @@ -48,34 +48,86 @@
icon_state = "house0"
icon_type_smooth = "house"
hardness = 50
var/broken = 0
canSmoothWith = list(/turf/closed/wall/f13/wood/house, /turf/closed/wall/f13/wood/house/broken, /turf/closed/wall, /turf/closed/wall/f13/wood/house/clean)
var/broken = FALSE
var/clean = FALSE
canSmoothWith = list(/turf/closed/wall/f13/wood/house, /turf/closed/wall/f13/wood/house/broken, /turf/closed/wall, /turf/closed/wall/f13/wood/house/clean, /turf/closed/wall/f13/wood/house/clean/broken)

/turf/closed/wall/f13/wood/house/broken
broken = 1
desc = "A broken weathered pre-War house wall."
broken = TRUE
damage = 21
icon_state = "house0-broken"

/turf/closed/wall/f13/wood/house/broken/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/stack/sheet/mineral/wood))
var/obj/item/stack/sheet/mineral/wood/I = W
if(I.amount < 2)
return
if(!do_after(user, 5 SECONDS, FALSE, src))
to_chat(user, span_warning("You must stand still to fix the wall!"))
return
W.use(2)
ChangeTurf(/turf/closed/wall/f13/wood/house)
. = ..()
/turf/closed/wall/f13/wood/house/clean
desc = "A freshly painted pre-War house wall."
clean = TRUE
icon_state = "house0-clean"

/turf/closed/wall/f13/wood/house/clean/broken
desc = "A broken freshly painted pre-War house wall."
broken = TRUE
icon_state = "house0-clean-broken"

/turf/closed/wall/f13/wood/house/take_damage(dam)
if(damage + dam > hardness/2)
broken = 1
..()

/turf/closed/wall/f13/wood/house/relative()
icon_state = "[icon_type_smooth][junction][broken ? "-broken" : ""]"
icon_state = "[icon_type_smooth][junction][clean ? "-clean" : ""][broken ? "-broken" : ""]"

/turf/closed/wall/f13/wood/house/attackby(obj/item/W, mob/user, params)
if(clean && istype(W, /obj/item/paint/paint_remover))
playsound(user.loc, 'sound/effects/splat.ogg', 25, 1, 5)
user.visible_message("[user] starts removing the paint from [src]!", span_notice("You start removing the paint from [src]."))
if(!do_after(user, 1 SECONDS, FALSE, src))
to_chat(user, span_warning("You must stand still to remove the paint on the wall!"))
return
user.visible_message("[user] removes the paint from [src]!", span_notice("You remove the paint from [src]."))
if(broken)
ChangeTurf(/turf/closed/wall/f13/wood/house/broken)
else
ChangeTurf(/turf/closed/wall/f13/wood/house)
return

if(istype(W, /obj/item/toy/crayon/spraycan))
var/obj/item/toy/crayon/spraycan/I = W
if(!I.use_charges(user, 2))
to_chat(user, span_warning("[I] is too empty to paint [src]!"))
return

if(I.is_capped)
to_chat(user, span_warning("Open the cap first!"))
return

playsound(user.loc, 'sound/effects/spray.ogg', 25, 1, 5)
user.visible_message("[user] starts coating [src] with a fresh layer of paint!", span_notice("You start coating [src] with a fresh layer of paint."))
if(!do_after(user, 1 SECONDS, FALSE, src))
to_chat(user, span_warning("You must stand still to paint the wall!"))
return
user.visible_message("[user] coats [src] with a fresh layer of paint!", span_notice("You coat [src] with a fresh layer of paint."))
if(!clean)
if(broken)
ChangeTurf(/turf/closed/wall/f13/wood/house/clean/broken)
else
ChangeTurf(/turf/closed/wall/f13/wood/house/clean)
src.add_atom_colour(I.paint_color, WASHABLE_COLOUR_PRIORITY)
return


if(broken && istype(W, /obj/item/stack/sheet/mineral/wood))
var/obj/item/stack/sheet/mineral/wood/I = W
if(I.amount < 2)
return
if(!do_after(user, 5 SECONDS, FALSE, src))
to_chat(user, span_warning("You must stand still to fix the wall!"))
return
W.use(2)
if(clean)
ChangeTurf(/turf/closed/wall/f13/wood/house/clean)
else
ChangeTurf(/turf/closed/wall/f13/wood/house)
. = ..()

/turf/closed/wall/f13/wood/house/update_icon()
if(broken)
Expand All @@ -87,12 +139,6 @@ turf/closed/wall/f13/wood/house/update_damage_overlay()
return
..()

/turf/closed/wall/f13/wood/house/clean
icon_state = "house0-clean"

/turf/closed/wall/f13/wood/house/clean/relative()
icon_state = "[icon_type_smooth][junction]-clean"

/turf/closed/wall/f13/wood/interior
name = "interior wall"
desc = "Interesting, what kind of material they have used - these wallpapers still look good after all the centuries..."
Expand Down
Binary file modified icons/fallout/turfs/walls/house.dmi
Binary file not shown.

0 comments on commit be59bb4

Please sign in to comment.