Skip to content

Commit

Permalink
Merge pull request #19 from silencer-pl/dev
Browse files Browse the repository at this point in the history
Salvaging - Post test fixes and tweaks.
  • Loading branch information
silencer-pl committed Jul 15, 2024
2 parents 7c36e3d + 088c565 commit f55ac02
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 12 deletions.
1 change: 1 addition & 0 deletions code/game/objects/items/devices/flashlight.dm
Original file line number Diff line number Diff line change
Expand Up @@ -563,3 +563,4 @@
desc = "A standard issue flashlight made from light weight plastics. A UACM logo and serial number are engraved at its base."
desc_lore = "Flashlights are critical during power malfunctions, as not much can be done without seeing anything and there are precious few light sources on spaceships that are not externally powered. Batteries used on these lights typically last for days of continuous use and most standard operation procedures call for recharging them between each trip or even use. Artificial light is useless against the consuming 'reverse-light' of deep space so this flashlight will be useless if that specific form of energy manages to find its way onto a spacecraft."
item_serial_distance = SERIAL_ITEM_SIZE_CLOSE
flags_item = NOBLUDGEON
4 changes: 4 additions & 0 deletions code/game/objects/items/tools/sp_tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,31 @@
desc_lore = "Wrenches are common tools used anywhere someone needs something loosened or tightened. Larger bolts typically require automated, pneumatic machines to safely install and remove, but most spaceships use a unified range of bolt and screw sizes making the manufacture of only one, universal size wrench possible. The engraving seems a bit extravagant and seems to be unique to the PST."
item_serial_distance = SERIAL_ITEM_SIZE_CLOSE
inherent_traits = list(TRAIT_TOOL_WRENCH)
flags_item = NOBLUDGEON

/obj/item/tool/crowbar/uacm
name = "UACM engraved crowbar"
desc = "A crowbar with the UACM logo and a serial number engraved into the handle."
desc_lore = "Crowbars are your best friend whenever something needs to be wedged open, which on board of spaceships and space faring installations means that they are particularly useful when dealing with power failures. Most internal airlocks have a hidden switch that can be accessed with a crowbar that releases their basic lock in case of power loss, but secure or external airlocks may be sealed to prevent this. The engraving seems a bit extravagant and seems to be unique to the PST."
item_serial_distance = SERIAL_ITEM_SIZE_CLOSE
inherent_traits = list(TRAIT_TOOL_CROWBAR)
flags_item = NOBLUDGEON

/obj/item/tool/screwdriver/uacm
name = "UACM engraved screwdriver"
desc = "A screwdriver with the UACM logo and a serial number engraved into the handle."
desc_lore = "Screwdrivers are used to tighten and loosen screws that typically hold together smaller pieces of electronics like computers or maintenance panels. A universal, 'star' shaped design was very quickly developed by humanity after their rapid ascent to the stars to ensure compatibility as both the screws and the screwdrivers have a bad tendency to get lost within 10 minutes of any space voyage. A standard issue screwdriver's handle is hollow, the inside used for carrying spare screws. Due to this, engravings on screwdrivers are not that unusual, although a serial number is not something found outside of the PST."
item_serial_distance = SERIAL_ITEM_SIZE_CLOSE
inherent_traits = list(TRAIT_TOOL_SCREWDRIVER)
flags_item = NOBLUDGEON

/obj/item/tool/wirecutters/uacm
name = "UACM engraved wirecutters"
desc = "A set of wirecutters with the UACM logo and a serial number engraved into the handle."
desc_lore = "Wirecutters, as the name suggests, come in handy whenever wires need to be split, typically during work on small electronic systems or while servicing power cables along ships and installations. What the name does not reveal and what most people that haven't used one of these tools for themselves do not realize is that standard wirecutters such as these also have several rings and grooves etched into their squeezing segment which can be used to thread and rebind cut wires, effectively making this tool but a wire cuter and un-cutter. This of course is an exceptionally long way of explaining that these tools can be used to both cut and mend cut wires if there is enough spare length to patch them up. The engraving seems a bit extravagant and seems to be unique to the PST."
item_serial_distance = SERIAL_ITEM_SIZE_CLOSE
inherent_traits = list(TRAIT_TOOL_WIRECUTTERS)
flags_item = NOBLUDGEON

/obj/item/tool/weldingtool/experimental/uacm
name = "UACM prototype welding unit"
Expand Down
6 changes: 3 additions & 3 deletions code/modules/admin/verbs/sectorpatrol.dm
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,8 @@
to_chat(src, "<hr>")
to_chat(src, narrate_body("Current level information:"))
to_chat(src, narrate_body("LdPol - [GLOB.resources_ldpol] / [GLOB.salvaging_total_ldpol]"))
to_chat(src, narrate_body("Metal - [GLOB.resources_metal] / [GLOB.salvaging_total_ldpol]"))
to_chat(src, narrate_body("Alloy - [GLOB.resources_resin] / [GLOB.salvaging_total_ldpol]"))
to_chat(src, narrate_body("Resin - [GLOB.resources_alloy] / [GLOB.salvaging_total_ldpol]"))
to_chat(src, narrate_body("Metal - [GLOB.resources_metal] / [GLOB.salvaging_total_metal]"))
to_chat(src, narrate_body("Alloy - [GLOB.resources_resin] / [GLOB.salvaging_total_resin]"))
to_chat(src, narrate_body("Resin - [GLOB.resources_alloy] / [GLOB.salvaging_total_alloy]"))
to_chat(src, narrate_body("Intel - [GLOB.salvaging_intel_items] / [GLOB.salvaging_total_intel_items]"))
to_chat(src, narrate_body("Hacks - [GLOB.salvaging_intel_hacks] / [GLOB.salvaging_total_intel_hacks]"))
22 changes: 18 additions & 4 deletions code/modules/salvage/master_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
GLOB.salvaging_total_resin += salvage_contents["resin"]
GLOB.salvaging_total_alloy += salvage_contents["alloy"]
GLOB.salvaging_items_objects += src
if(salvage_intel_item) GLOB.salvaging_intel_items += 1
if(salvage_intel_item) GLOB.salvaging_total_intel_items += 1
var/area/currentarea = get_area(src)
if(currentarea.salvage_area_tag != null)
salvage_area_tag = currentarea.salvage_area_tag
Expand Down Expand Up @@ -184,6 +184,7 @@
var/salvage_big_item = 0 //If 1, restricts tool usage to specific item
var/salvage_steps = 0
var/salvage_current_step = 1
var/salvage_in_use
var/no_salvage = 0
var/salvage_area_tag = "default"
var/salvage_container_tag
Expand Down Expand Up @@ -388,11 +389,14 @@
/obj/structure/salvage/proc/salvage_process_decon()
to_chat(usr, SPAN_INFO(salvage_process_decon_generate_text(text = salvage_decon_array[1][salvage_current_step], state = "starting")))
salvage_process_decon_generate_av(tool = salvage_decon_array[1][salvage_current_step])
salvage_in_use = 1
if(do_after(usr, (CRAFTING_DELAY_NORMAL * usr.get_skill_duration_multiplier(SKILL_CONSTRUCTION)), INTERRUPT_ALL|BEHAVIOR_IMMOBILE, BUSY_ICON_BUILD))
to_chat(usr, SPAN_INFO(salvage_process_decon_generate_text(text = salvage_decon_array[1][salvage_current_step], state = "finished")))
salvage_in_use = 0
salvage_current_step += 1
salvage_return_step_text()
return 1
salvage_in_use = 0
return 0

/obj/structure/salvage/proc/salvage_play_message()
Expand All @@ -411,7 +415,7 @@
talkas("Infomration retrieved. Data cache pulse sent. This device now may be deconstructed.")
hackable = 3
if(hackable_message) INVOKE_ASYNC(src, TYPE_PROC_REF(/obj/structure/salvage/, salvage_play_message))
GLOB.salvaging_intel_items += 1
GLOB.salvaging_intel_hacks += 1
return 1
if(2)
to_chat(usr, SPAN_INFO("This device is already being hacked."))
Expand Down Expand Up @@ -441,7 +445,7 @@
nozzle.talkas("Error: Air canister depleted. Please recharge at nearest charging station.")
playsound(nozzle, 'sound/machines/terminal_error.ogg', 25)
return
if(salvage_current_step < salvage_steps)
if(salvage_current_step <= salvage_steps)
nozzle.talkas("Error: Unloosened fastening detected. Salvage will be suboptimal.")
nozzle.talkas("Error: Safety mode engaged. Action disallowed.")
playsound(nozzle, 'sound/machines/terminal_error.ogg', 25)
Expand All @@ -458,6 +462,9 @@
if(salvage_current_step > salvage_steps)
to_chat(usr, SPAN_INFO("This object is ready for salvaging and does not need any further tinkering."))
return
if(salvage_in_use == 1)
to_chat(usr, SPAN_INFO("Someone is already working on this."))
return
if(salvage_decon_array && salvage_current_step <= salvage_steps)
if(HAS_TRAIT(W, salvage_decon_array[1][salvage_current_step]))
if(usr.a_intent == salvage_decon_array[2][salvage_current_step])
Expand Down Expand Up @@ -512,6 +519,7 @@
var/list/salvage_decon_array //Alternatively just present a full array, with TRAIT_TOOL / INTENT_ pairs in each row. Presence of a decon array will make mapinit ignore the keyword, even if its set.
var/salvage_steps = 0
var/salvage_current_step = 1
var/salvage_in_use
no_salvage = 0
var/desc_affix
var/desc_lore_affix
Expand Down Expand Up @@ -698,11 +706,14 @@
/turf/open/salvage/proc/salvage_process_decon()
to_chat(usr, SPAN_INFO(salvage_process_decon_generate_text(text = salvage_decon_array[1][salvage_current_step], state = "starting")))
salvage_process_decon_generate_av(tool = salvage_decon_array[1][salvage_current_step])
salvage_in_use = 1
if(do_after(usr, (CRAFTING_DELAY_NORMAL * usr.get_skill_duration_multiplier(SKILL_CONSTRUCTION)), INTERRUPT_ALL|BEHAVIOR_IMMOBILE, BUSY_ICON_BUILD))
salvage_in_use = 0
to_chat(usr, SPAN_INFO(salvage_process_decon_generate_text(text = salvage_decon_array[1][salvage_current_step], state = "finished")))
salvage_current_step += 1
salvage_return_step_text()
return 1
salvage_in_use = 0
return 0

/turf/open/salvage/attackby(obj/item/W, mob/user)
Expand All @@ -726,7 +737,7 @@
nozzle.talkas("Error: Air canister depleted. Please recharge at nearest charging station.")
playsound(nozzle, 'sound/machines/terminal_error.ogg', 25)
return
if(salvage_current_step < salvage_steps)
if(salvage_current_step <= salvage_steps)
nozzle.talkas("Error: Unloosened fastening detected. Salvage will be suboptimal.")
nozzle.talkas("Error: Safety mode engaged. Action disallowed.")
playsound(nozzle, 'sound/machines/terminal_error.ogg', 25)
Expand All @@ -736,6 +747,9 @@
if(salvage_current_step > salvage_steps)
to_chat(usr, SPAN_INFO("This floor is ready for salvaging and does not need any further tinkering."))
return
if(salvage_in_use == 1)
to_chat(usr, SPAN_INFO("Someone is already working on this."))
return
if(salvage_decon_array && salvage_current_step <= salvage_steps)
if(HAS_TRAIT(W, salvage_decon_array[1][salvage_current_step]))
if(usr.a_intent == salvage_decon_array[2][salvage_current_step])
Expand Down
6 changes: 4 additions & 2 deletions code/modules/salvage/recycler.dm
Original file line number Diff line number Diff line change
Expand Up @@ -290,18 +290,20 @@
if(metal_to_rem) GLOB.salvaging_total_metal -= metal_to_rem
if(resin_to_rem) GLOB.salvaging_total_resin -= resin_to_rem
if(alloy_to_rem) GLOB.salvaging_total_alloy -= alloy_to_rem
GLOB.salvaging_total_ldpol -= ((metal_to_rem + resin_to_rem + alloy_to_rem) / 5)
GLOB.salvaging_intel_items += 1
return 1


/obj/structure/salvage/intel_dropoff/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/salvage/))
var/obj/item/salvage/processed_item
if (processed_item.salvage_intel_item == FALSE)
var/obj/item/salvage/processed_item = W
if(processed_item.salvage_intel_item == FALSE)
to_chat(usr, SPAN_INFO("There does not seem to be anything important to process."))
return
if(process_intel(metal = processed_item.salvage_contents["metal"], resin = processed_item.salvage_contents["resin"], alloy = processed_item.salvage_contents["alloy"]) == 1)
qdel(processed_item)
talkas("Intelligence processed.")
return

// Extra gear: Pouches etc as needed
Expand Down
4 changes: 2 additions & 2 deletions code/modules/terminal/briefing/briefing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

/obj/structure/terminal/briefing
name = "briefing display"
desc = "This is a master item. It should not be placed anywhere in the game world."
desc_lore = "If you have the time, please consider reporting this as a bug."
desc = "A large-scale display, safely mounted inside a slot made in the hull of the ship"
desc_lore = "Computer displays on most ships tend to be adjusted for single colored text, initially due to lack of technology that allowed for better quality displays to survive out in space. Over time this became more a habit than anything else, as evidenced by PDAs which do not limit themselves in terms of display capabilities. Large scale displays such as this one have resisted over a hundred years' worth of technological progress and still reign supreme across human space ships. Truly, you are looking at a classic. For better or worse."
icon = 'icons/obj/structures/machinery/displaymonitor.dmi'
icon_state = "off"
terminal_id = "briefing"
Expand Down
2 changes: 1 addition & 1 deletion code/modules/terminal/mission_control/salvage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
terminal_display_line("ALLOYS")
terminal_display_line("[GLOB.resources_alloy] / [GLOB.salvaging_total_alloy]")
terminal_display_line("LD-POLYMER")
terminal_display_line("[(GLOB.resources_metal + GLOB.resources_resin + GLOB.resources_alloy) / 5] / [GLOB.salvaging_total_ldpol]")
terminal_display_line("[GLOB.resources_ldpol] / [GLOB.salvaging_total_ldpol]")
// Multi word commands start here. A little hacky, but will do. Essentially cuts the ammount of expected letters for the command and if that passes, passes the whole command to a separate parser that does the work. Use case can probably be defived form len or soemthing, but I really dont feel like calculating that atm :P
else
switch(cut_string_to_parse)
Expand Down

0 comments on commit f55ac02

Please sign in to comment.