Skip to content

Commit

Permalink
Move welding content into one folder
Browse files Browse the repository at this point in the history
  • Loading branch information
out-of-phaze committed Jan 30, 2025
1 parent 62e99f1 commit 8c3846e
Show file tree
Hide file tree
Showing 5 changed files with 152 additions and 151 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@
var/obj/item/cell/cell = get_cell()
return cell ? cell.charge : 0

/obj/item/weldingtool/electric/attackby(var/obj/item/W, var/mob/user)
if(istype(W,/obj/item/stack/material/rods) || istype(W, /obj/item/chems/welder_tank))
return FALSE // NO ELECTRIC FLAMETHROWER
return ..()
/obj/item/weldingtool/electric/insert_tank(var/obj/item/chems/welder_tank/T, var/mob/user, var/no_updates = FALSE, var/quiet = FALSE)
return FALSE // No tanks!

/obj/item/weldingtool/electric/attempt_modify(var/obj/item/W, var/mob/user)
return FALSE // NO ELECTRIC FLAMETHROWER

/obj/item/weldingtool/electric/use_fuel(var/amount)
var/obj/item/cell/cell = get_cell()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -379,149 +379,5 @@
material = /decl/material/solid/metal/steel
matter = list(/decl/material/solid/fiberglass = MATTER_AMOUNT_REINFORCEMENT)

//////////////////////////////////////////////////////////////////
// Welding tool tanks
//////////////////////////////////////////////////////////////////
/obj/item/chems/welder_tank
name = "welding tank"
base_name = "welding tank"
desc = "An interchangeable fuel tank meant for a welding tool."
icon = 'icons/obj/items/tool/welders/welder_tanks.dmi'
icon_state = "tank_normal"
w_class = ITEM_SIZE_SMALL
atom_flags = ATOM_FLAG_OPEN_CONTAINER
obj_flags = OBJ_FLAG_HOLLOW
volume = 20
show_reagent_name = TRUE
current_health = 40
max_health = 40
material = /decl/material/solid/metal/steel
var/can_refuel = TRUE
var/size_in_use = ITEM_SIZE_NORMAL
var/unlit_force = 7
var/lit_force = 11

/obj/item/chems/welder_tank/populate_reagents()
add_to_reagents(/decl/material/liquid/fuel, reagents.maximum_volume)

/obj/item/chems/welder_tank/examine(mob/user, distance)
. = ..()
if(distance > 1)
return
if(reagents.total_volume <= 0)
to_chat(user, "It is empty.")
else
to_chat(user, "It contains [reagents.total_volume] units of liquid.")
to_chat(user, " It can hold up to [reagents.maximum_volume] units.")

/obj/item/chems/welder_tank/afterattack(obj/O, mob/user, proximity, click_parameters)
if (!ATOM_IS_OPEN_CONTAINER(src) || !proximity)
return
if(standard_dispenser_refill(user, O))
return TRUE
if(standard_pour_into(user, O))
return TRUE
if(handle_eaten_by_mob(user, O) != EATEN_INVALID)
return TRUE
if(user.check_intent(I_FLAG_HARM))
if(standard_splash_mob(user, O))
return TRUE
if(reagents && reagents.total_volume)
to_chat(user, SPAN_DANGER("You splash the contents of \the [src] onto \the [O]."))
reagents.splash(O, reagents.total_volume)
return TRUE
return ..()

/obj/item/chems/welder_tank/standard_dispenser_refill(mob/user, obj/structure/reagent_dispensers/target, skip_container_check = FALSE)
if(!can_refuel)
to_chat(user, SPAN_DANGER("\The [src] does not have a refuelling port."))
return FALSE
. = ..()
if(.)
playsound(src.loc, 'sound/effects/refill.ogg', 50, TRUE, -6)

/obj/item/chems/welder_tank/standard_pour_into(mob/user, atom/target)
if(!can_refuel)
to_chat(user, SPAN_DANGER("\The [src] is sealed shut."))
return FALSE
. = ..()

/obj/item/chems/welder_tank/standard_splash_mob(mob/user, mob/target)
if(!can_refuel)
to_chat(user, SPAN_DANGER("\The [src] is sealed shut."))
return FALSE
. = ..()

/obj/item/chems/welder_tank/handle_eaten_by_mob(mob/user, mob/target)
if(!can_refuel)
to_chat(user, SPAN_DANGER("\The [src] is sealed shut."))
return EATEN_UNABLE
return ..()

/obj/item/chems/welder_tank/get_alt_interactions(var/mob/user)
. = ..()
if(!can_refuel)
LAZYREMOVE(., /decl/interaction_handler/set_transfer/chems)

/obj/item/chems/welder_tank/mini
name = "small welding tank"
base_name = "small welding tank"
icon_state = "tank_small"
w_class = ITEM_SIZE_TINY
volume = 5
size_in_use = ITEM_SIZE_SMALL
unlit_force = 5
lit_force = 7
_base_attack_force = 4

/obj/item/chems/welder_tank/large
name = "large welding tank"
base_name = "large welding tank"
icon_state = "tank_large"
w_class = ITEM_SIZE_SMALL
volume = 40
size_in_use = ITEM_SIZE_NORMAL
_base_attack_force = 6

/obj/item/chems/welder_tank/huge
name = "huge welding tank"
base_name = "huge welding tank"
icon_state = "tank_huge"
w_class = ITEM_SIZE_NORMAL
volume = 80
size_in_use = ITEM_SIZE_LARGE
unlit_force = 9
lit_force = 15
_base_attack_force = 8

/obj/item/chems/welder_tank/experimental
name = "experimental welding tank"
base_name = "experimental welding tank"
icon_state = "tank_experimental"
w_class = ITEM_SIZE_NORMAL
volume = 40
can_refuel = FALSE
size_in_use = ITEM_SIZE_LARGE
unlit_force = 9
lit_force = 15
show_reagent_name = FALSE
_base_attack_force = 8
var/tmp/last_gen = 0

/obj/item/chems/welder_tank/experimental/Initialize(ml, material_key)
. = ..()
atom_flags &= ~ATOM_FLAG_OPEN_CONTAINER
START_PROCESSING(SSobj, src)

/obj/item/chems/welder_tank/experimental/Destroy()
STOP_PROCESSING(SSobj, src)
return ..()

/obj/item/chems/welder_tank/experimental/Process()
if(REAGENT_VOLUME(reagents, /decl/material/liquid/fuel) < reagents.maximum_volume)
var/gen_amount = ((world.time-last_gen)/25)
add_to_reagents(/decl/material/liquid/fuel, gen_amount)
last_gen = world.time

#undef WELDING_TOOL_HOTSPOT_TEMP_ACTIVE
#undef WELDING_TOOL_HOTSPOT_TEMP_IDLE
143 changes: 143 additions & 0 deletions code/game/objects/items/welding/weldingtool_tank.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
//////////////////////////////////////////////////////////////////
// Welding tool tanks
//////////////////////////////////////////////////////////////////
/obj/item/chems/welder_tank
name = "welding tank"
base_name = "welding tank"
desc = "An interchangeable fuel tank meant for a welding tool."
icon = 'icons/obj/items/tool/welders/welder_tanks.dmi'
icon_state = "tank_normal"
w_class = ITEM_SIZE_SMALL
atom_flags = ATOM_FLAG_OPEN_CONTAINER
obj_flags = OBJ_FLAG_HOLLOW
volume = 20
show_reagent_name = TRUE
current_health = 40
max_health = 40
material = /decl/material/solid/metal/steel
var/can_refuel = TRUE
var/size_in_use = ITEM_SIZE_NORMAL
var/unlit_force = 7
var/lit_force = 11

/obj/item/chems/welder_tank/populate_reagents()
add_to_reagents(/decl/material/liquid/fuel, reagents.maximum_volume)

/obj/item/chems/welder_tank/examine(mob/user, distance)
. = ..()
if(distance > 1)
return
if(reagents.total_volume <= 0)
to_chat(user, "It is empty.")
else
to_chat(user, "It contains [reagents.total_volume] units of liquid.")
to_chat(user, " It can hold up to [reagents.maximum_volume] units.")

/obj/item/chems/welder_tank/afterattack(obj/O, mob/user, proximity, click_parameters)
if (!ATOM_IS_OPEN_CONTAINER(src) || !proximity)
return
if(standard_dispenser_refill(user, O))
return TRUE
if(standard_pour_into(user, O))
return TRUE
if(handle_eaten_by_mob(user, O) != EATEN_INVALID)
return TRUE
if(user.check_intent(I_FLAG_HARM))
if(standard_splash_mob(user, O))
return TRUE
if(reagents && reagents.total_volume)
to_chat(user, SPAN_DANGER("You splash the contents of \the [src] onto \the [O]."))
reagents.splash(O, reagents.total_volume)
return TRUE
return ..()

/obj/item/chems/welder_tank/standard_dispenser_refill(mob/user, obj/structure/reagent_dispensers/target, skip_container_check = FALSE)
if(!can_refuel)
to_chat(user, SPAN_DANGER("\The [src] does not have a refuelling port."))
return FALSE
. = ..()
if(.)
playsound(src.loc, 'sound/effects/refill.ogg', 50, TRUE, -6)

/obj/item/chems/welder_tank/standard_pour_into(mob/user, atom/target)
if(!can_refuel)
to_chat(user, SPAN_DANGER("\The [src] is sealed shut."))
return FALSE
. = ..()

/obj/item/chems/welder_tank/standard_splash_mob(mob/user, mob/target)
if(!can_refuel)
to_chat(user, SPAN_DANGER("\The [src] is sealed shut."))
return FALSE
. = ..()

/obj/item/chems/welder_tank/handle_eaten_by_mob(mob/user, mob/target)
if(!can_refuel)
to_chat(user, SPAN_DANGER("\The [src] is sealed shut."))
return EATEN_UNABLE
return ..()

/obj/item/chems/welder_tank/get_alt_interactions(var/mob/user)
. = ..()
if(!can_refuel)
LAZYREMOVE(., /decl/interaction_handler/set_transfer/chems)

/obj/item/chems/welder_tank/mini
name = "small welding tank"
base_name = "small welding tank"
icon_state = "tank_small"
w_class = ITEM_SIZE_TINY
volume = 5
size_in_use = ITEM_SIZE_SMALL
unlit_force = 5
lit_force = 7
_base_attack_force = 4

/obj/item/chems/welder_tank/large
name = "large welding tank"
base_name = "large welding tank"
icon_state = "tank_large"
w_class = ITEM_SIZE_SMALL
volume = 40
size_in_use = ITEM_SIZE_NORMAL
_base_attack_force = 6

/obj/item/chems/welder_tank/huge
name = "huge welding tank"
base_name = "huge welding tank"
icon_state = "tank_huge"
w_class = ITEM_SIZE_NORMAL
volume = 80
size_in_use = ITEM_SIZE_LARGE
unlit_force = 9
lit_force = 15
_base_attack_force = 8

/obj/item/chems/welder_tank/experimental
name = "experimental welding tank"
base_name = "experimental welding tank"
icon_state = "tank_experimental"
w_class = ITEM_SIZE_NORMAL
volume = 40
can_refuel = FALSE
size_in_use = ITEM_SIZE_LARGE
unlit_force = 9
lit_force = 15
show_reagent_name = FALSE
_base_attack_force = 8
var/tmp/last_gen = 0

/obj/item/chems/welder_tank/experimental/Initialize(ml, material_key)
. = ..()
atom_flags &= ~ATOM_FLAG_OPEN_CONTAINER
START_PROCESSING(SSobj, src)

/obj/item/chems/welder_tank/experimental/Destroy()
STOP_PROCESSING(SSobj, src)
return ..()

/obj/item/chems/welder_tank/experimental/Process()
if(REAGENT_VOLUME(reagents, /decl/material/liquid/fuel) < reagents.maximum_volume)
var/gen_amount = ((world.time-last_gen)/25)
add_to_reagents(/decl/material/liquid/fuel, gen_amount)
last_gen = world.time
7 changes: 4 additions & 3 deletions nebula.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1248,7 +1248,6 @@
#include "code\game\objects\items\tools\crowbar.dm"
#include "code\game\objects\items\tools\screwdriver.dm"
#include "code\game\objects\items\tools\shears.dm"
#include "code\game\objects\items\tools\weldingtool.dm"
#include "code\game\objects\items\tools\wirecutter.dm"
#include "code\game\objects\items\tools\wrench.dm"
#include "code\game\objects\items\weapons\AI_modules.dm"
Expand All @@ -1264,7 +1263,6 @@
#include "code\game\objects\items\weapons\defib.dm"
#include "code\game\objects\items\weapons\dice.dm"
#include "code\game\objects\items\weapons\ecigs.dm"
#include "code\game\objects\items\weapons\electric_welder.dm"
#include "code\game\objects\items\weapons\explosives.dm"
#include "code\game\objects\items\weapons\extinguisher.dm"
#include "code\game\objects\items\weapons\flamethrower.dm"
Expand Down Expand Up @@ -1292,7 +1290,6 @@
#include "code\game\objects\items\weapons\towels.dm"
#include "code\game\objects\items\weapons\traps.dm"
#include "code\game\objects\items\weapons\weaponry.dm"
#include "code\game\objects\items\weapons\weldbackpack.dm"
#include "code\game\objects\items\weapons\grenades\anti_photon_grenade.dm"
#include "code\game\objects\items\weapons\grenades\chem_grenade.dm"
#include "code\game\objects\items\weapons\grenades\decompiler.dm"
Expand Down Expand Up @@ -1367,6 +1364,10 @@
#include "code\game\objects\items\weapons\tanks\jetpack.dm"
#include "code\game\objects\items\weapons\tanks\tank_types.dm"
#include "code\game\objects\items\weapons\tanks\tanks.dm"
#include "code\game\objects\items\welding\electric_welder.dm"
#include "code\game\objects\items\welding\weldbackpack.dm"
#include "code\game\objects\items\welding\weldingtool.dm"
#include "code\game\objects\items\welding\weldingtool_tank.dm"
#include "code\game\objects\random\_random.dm"
#include "code\game\objects\random\date_based.dm"
#include "code\game\objects\random\random.dm"
Expand Down

0 comments on commit 8c3846e

Please sign in to comment.