Skip to content

Commit

Permalink
its finally here
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRealScarHomie committed Jul 30, 2023
1 parent 4f4c974 commit 91511fa
Show file tree
Hide file tree
Showing 20 changed files with 197 additions and 9 deletions.
32 changes: 23 additions & 9 deletions _maps/map_files/Mammoth_Mini/Mammoth_mini.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,14 @@
/obj/effect/spawner/random/ms13/tools/tool,
/turf/open/floor/ms13/concrete/industrial,
/area/ms13/town)
"aEM" = (
/obj/structure/window/fulltile/ms13/glass,
/obj/structure/table/ms13/low_wall/brick/alt,
/obj/structure/ms13/storage/washingmachine/industrial{
dir = 1
},
/turf/open/floor/ms13/tile/blue/long,
/area/ms13/town)
"aFo" = (
/obj/structure/ms13/wall_decor/clock,
/turf/open/floor/wood/ms13/common,
Expand Down Expand Up @@ -3401,7 +3409,7 @@
/turf/open/floor/ms13/tile/brown,
/area/ms13/town)
"dDC" = (
/obj/structure/ms13/storage/washingmachine/industrial,
/obj/structure/ms13/storage/washingmachine/industrial/working,
/turf/open/floor/ms13/tile/blue/long,
/area/ms13/town)
"dEa" = (
Expand Down Expand Up @@ -5041,6 +5049,12 @@
/obj/effect/spawner/random/ms13/gun/tier1,
/turf/open/floor/wood/ms13/carpet,
/area/ms13/town)
"foZ" = (
/obj/structure/ms13/storage/washingmachine/industrial/working{
dir = 1
},
/turf/open/floor/ms13/tile/blue/long,
/area/ms13/town)
"fpa" = (
/obj/structure/flora/grass/jungle/b,
/obj/structure/ms13/cave_decor/support/wall,
Expand Down Expand Up @@ -15188,7 +15202,7 @@
/area/ms13/town)
"mdd" = (
/obj/machinery/light/ms13,
/obj/structure/ms13/storage/washingmachine/industrial{
/obj/structure/ms13/storage/washingmachine/industrial/working{
dir = 1
},
/turf/open/floor/ms13/tile/blue/long,
Expand Down Expand Up @@ -21668,7 +21682,7 @@
/obj/structure/ms13/pallet{
dir = 1
},
/obj/structure/ms13/storage/washingmachine,
/obj/structure/ms13/storage/washingmachine/working,
/turf/open/floor/wood/ms13/common,
/area/ms13/snowcrest/building)
"sYm" = (
Expand Down Expand Up @@ -23282,7 +23296,7 @@
/turf/open/floor/plating/ms13/ground/sidewalk,
/area/ms13/snowcrest)
"uZz" = (
/obj/structure/ms13/storage/washingmachine,
/obj/structure/ms13/storage/washingmachine/working,
/turf/open/floor/wood/ms13/wide,
/area/ms13/snowcrest/building)
"uZA" = (
Expand Down Expand Up @@ -25558,7 +25572,7 @@
/obj/machinery/light/ms13{
dir = 1
},
/obj/structure/ms13/storage/washingmachine/industrial,
/obj/structure/ms13/storage/washingmachine/industrial/working,
/turf/open/floor/ms13/tile/blue/long,
/area/ms13/town)
"yet" = (
Expand Down Expand Up @@ -43930,7 +43944,7 @@ xZD
jIO
aLq
aLq
uFA
foZ
jIO
dDC
aLq
Expand Down Expand Up @@ -44384,7 +44398,7 @@ xZD
jIO
aLq
aLq
uFA
foZ
jIO
dDC
aLq
Expand Down Expand Up @@ -44609,7 +44623,7 @@ ykT
xZD
xZD
iBg
aLq
uFA
aLq
aLq
aLq
Expand Down Expand Up @@ -44836,7 +44850,7 @@ ykT
xZD
jIO
jIO
iBg
aEM
iBg
jIO
jcb
Expand Down
10 changes: 10 additions & 0 deletions mojave/code/datums/components/looping_sounds/machinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,13 @@
falloff_exponent = 3
extra_range = -12
falloff_distance = 1

/datum/looping_sound/ms13/washing_machine
start_sound = 'mojave/sound/ms13machines/washing_start.ogg'
mid_sounds = list('mojave/sound/ms13machines/washing_cycle.ogg'=1)
start_length = 0.22 SECONDS
mid_length = 1.5 SECONDS
extra_range = 5
volume = 15
falloff_distance = 3
falloff_exponent = 5
7 changes: 7 additions & 0 deletions mojave/code/modules/storage/tarkov.dm
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,13 @@
screen_start_x = 8
rustle_sound = FALSE

/datum/component/storage/concrete/ms13/washing //for washing machine
screen_max_columns = 10
screen_max_rows = 10
screen_start_y = 12
screen_start_x = 5
rustle_sound = FALSE

/datum/component/storage/concrete/ms13/matchbox //for matchboxes
screen_max_columns = 5
screen_max_rows = 4
Expand Down
44 changes: 44 additions & 0 deletions mojave/components/machine_washable.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
//component for changing icons/name etc of item in washing machine

/datum/component/machine_washable
// clean sprite for thing thats washed
var/clean_sprite
// if the description changes at all
var/desc_change
// new description for the thing
var/new_desc
// if the name changes at all
var/name_change
// new name for the thing
var/new_name
// if the item has been washed or not
var/washed

/datum/component/machine_washable/Initialize(clean_sprite, desc_change, new_desc = FALSE, name_change, new_name = FALSE, washed = FALSE)
if(!isatom(parent))
return COMPONENT_INCOMPATIBLE

src.clean_sprite = clean_sprite
src.desc_change = desc_change
src.new_desc = new_desc
src.name_change = name_change
src.new_name = new_name
src.washed = washed

/datum/component/machine_washable/RegisterWithParent()
. = ..()
RegisterSignal(parent, COMSIG_COMPONENT_CLEAN_ACT, .proc/check_wash)

/datum/component/machine_washable/UnregisterFromParent()
. = ..()
UnregisterSignal(parent, COMSIG_COMPONENT_CLEAN_ACT)

/datum/component/machine_washable/proc/check_wash()
var/atom/C = parent
if(washed)
C.icon_state = clean_sprite
if(desc_change)
C.desc = new_desc
if(name_change)
C.name = new_name
C.update_appearance()
Binary file modified mojave/icons/mob/clothing/hands.dmi
Binary file not shown.
Binary file modified mojave/icons/mob/clothing/neck.dmi
Binary file not shown.
Binary file modified mojave/icons/mob/clothing/uniform.dmi
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified mojave/icons/objects/clothing/clothing_world/neck_world.dmi
Binary file not shown.
Binary file modified mojave/icons/objects/clothing/clothing_world/uniforms_world.dmi
Binary file not shown.
Binary file modified mojave/icons/objects/tools/tools_inventory.dmi
Binary file not shown.
Binary file modified mojave/icons/structure/storage.dmi
Binary file not shown.
5 changes: 5 additions & 0 deletions mojave/items/clothing/under/wasteland/under.dm
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,11 @@
icon_state = "vestandslacks"
inhand_icon_state = "ro_suit"

/obj/item/clothing/under/ms13/wasteland/vestslacks/Initialize()
. = ..()
AddComponent(/datum/component/machine_washable,\
clean_sprite = "vestandslacks_c")

/obj/item/clothing/under/ms13/wasteland/merchant
name = "merchants' clothes"
desc = "A set of clothes worn often by merchants in the wasteland."
Expand Down
2 changes: 2 additions & 0 deletions mojave/items/handcuffs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
icon_state = "handcuffs"
icon = 'mojave/icons/objects/tools/tools_inventory.dmi'
inhand_icon_state = "handcuffs"
handcuffed_icon = 'mojave/icons/mob/clothing/hands.dmi'
handcuffed_icon_state = "handcuffs"
lefthand_file = 'mojave/icons/mob/inhands/items_lefthand.dmi'
righthand_file = 'mojave/icons/mob/inhands/items_righthand.dmi'
var/does_shrink = TRUE
Expand Down
Binary file added mojave/sound/ms13machines/washing_cycle.ogg
Binary file not shown.
Binary file removed mojave/sound/ms13machines/washing_machine.ogg
Binary file not shown.
Binary file added mojave/sound/ms13machines/washing_start.ogg
Binary file not shown.
105 changes: 105 additions & 0 deletions mojave/structures/storage/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
if(prob(50))
icon_state = "[initial(icon_state)]-damaged"


/obj/structure/ms13/storage/washingmachine
name = "washing machine"
desc = "An old washing machine, before the war this did all the washing for you! But now it washes nothing."
Expand All @@ -50,8 +51,67 @@
anchored = TRUE
pixel_y = 12
var/closed = TRUE
var/working = FALSE
var/busy = FALSE
var/datum/looping_sound/ms13/washing_machine/soundloop

/obj/structure/ms13/storage/washingmachine/working
working = TRUE

/obj/structure/ms13/storage/washingmachine/Initialize(mapload)
. = ..()
AddComponent(/datum/component/storage/concrete/ms13/washing)
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_w_class = WEIGHT_CLASS_BULKY
STR.max_items = 200
STR.max_combined_w_class = 200
soundloop = new(src, FALSE)
if(working)
desc = "An old washing machine, before the war this did all the washing for you! Still a has a bit of life in it somehow."

/obj/structure/ms13/storage/washingmachine/examine(mob/user)
. = ..()
if(working)
. += "<span class='notice'>Close the door and right click to wash the item inside.</span>"


/obj/structure/ms13/storage/washingmachine/attackby(obj/item/I, mob/living/user, params)
if(closed)
to_chat(user, "<span class='danger'>[src] is closed.</span>")
return
else
. = ..()

/obj/structure/ms13/storage/washingmachine/MouseDrop()
if(closed && (usr.stat != DEAD))
to_chat(usr, "<span class='danger'>[src] is closed.</span>")
return COMPONENT_NO_MOUSEDROP
else
return . = ..()

/obj/structure/ms13/storage/washingmachine/attackby_secondary(obj/item/weapon, mob/user, params)
attackby(weapon, user)
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN

/obj/structure/ms13/storage/washingmachine/alt_click_on_secondary(mob/user)
attack_hand(user)
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN

/obj/structure/ms13/storage/washingmachine/AltClick(mob/user)
attack_hand(user)
return

/obj/structure/ms13/storage/washingmachine/update_overlays()
. = ..()
if(!busy)
cut_overlays()
if(busy && dir == SOUTH)
add_overlay(image(icon, icon_state = "[initial(icon_state)]_on"))

/obj/structure/ms13/storage/washingmachine/CtrlClick(mob/living/user)
if(busy)
to_chat(user, span_warning("[src] is currently in use."))
return
if(closed)
if(do_after(user, 0.5 SECONDS, interaction_key = DOAFTER_SOURCE_DOORS))
to_chat(user, span_notice("You open the washing machine."))
Expand All @@ -65,6 +125,43 @@
icon_state = "[initial(icon_state)]"
closed = TRUE

/obj/structure/ms13/storage/washingmachine/attack_hand_secondary(mob/user, modifiers)
if(!working)
to_chat(user, span_warning("You press the on button and nothing happens."))
return
if(busy)
to_chat(user, span_warning("[src] is currently in use."))
return SECONDARY_ATTACK_CONTINUE_CHAIN
if(!closed)
to_chat(user, span_warning("Close the door first!"))
return SECONDARY_ATTACK_CONTINUE_CHAIN
busy = TRUE
to_chat(user, span_notice("You press the on button and the [src] kicks to life."))
update_overlays()
addtimer(CALLBACK(src, .proc/washed), 20 SECONDS, TIMER_UNIQUE)
soundloop.start()
START_PROCESSING(SSfastprocess, src)
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN

/obj/structure/ms13/storage/washingmachine/proc/washed()
busy = FALSE
soundloop.stop()
update_overlays()
src.visible_message(span_notice("The [src] finishes its washing cycle."))
for(var/X in contents)
var/atom/movable/AM = X
if(AM.GetComponent(/datum/component/machine_washable))
var/datum/component/machine_washable/machine_washable = AM.GetComponent(/datum/component/machine_washable)
machine_washable.washed = TRUE
AM.wash(CLEAN_WASH)

/obj/structure/ms13/storage/washingmachine/process(delta_time)
if(!busy)
animate(src, transform=matrix(), time=2)
return PROCESS_KILL
if(prob(50))
Shake(rand(-1, 1), rand(0, 1), 1)

/obj/structure/ms13/storage/washingmachine/welder_act_secondary(mob/living/user, obj/item/I)
if(!I.tool_start_check(user, amount=0))
return TRUE
Expand Down Expand Up @@ -105,6 +202,14 @@
desc = "A large washing machine, for when you need to wash a lot of clothes! Unfortunately, it's been broken for a long time."
icon_state = "industwasher"

/obj/structure/ms13/storage/washingmachine/Initialize(mapload)
. = ..()
if(working)
desc = "A large washing machine, for when you need to wash a lot of clothes! Still a has a bit of life in it somehow."

/obj/structure/ms13/storage/washingmachine/industrial/working
working = TRUE

/obj/structure/ms13/storage/washingmachine/industrial/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))
if(disassembled)
Expand Down
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -4580,6 +4580,7 @@
#include "mojave\code\modules\wallening-temp\frill.dm"
#include "mojave\code\modules\wallening-temp\wall_mount.dm"
#include "mojave\code\modules\wallening-temp\wallening.dm"
#include "mojave\components\machine_washable.dm"
#include "mojave\effects\fire.dm"
#include "mojave\effects\landmarks.dm"
#include "mojave\effects\ms13_decals.dm"
Expand Down

0 comments on commit 91511fa

Please sign in to comment.