Skip to content

Commit

Permalink
Merge branch 'master' into Pre-awaking-equipment
Browse files Browse the repository at this point in the history
  • Loading branch information
LC4492 authored Jan 23, 2024
2 parents 0000f42 + 1ff8920 commit 17d9d37
Show file tree
Hide file tree
Showing 26 changed files with 6,695 additions and 5,431 deletions.
4 changes: 0 additions & 4 deletions code/game/machinery/autolathe_datums.dm
Original file line number Diff line number Diff line change
Expand Up @@ -416,10 +416,6 @@
name = "bonesetter"
path = /obj/item/tool/surgery/bonesetter

/datum/autolathe/recipe/medilathe/bonegel
name = "bone gel"
path = /obj/item/tool/surgery/bonegel

/datum/autolathe/recipe/medilathe/fixovein
name = "FixOVein"
path = /obj/item/tool/surgery/FixOVein
Expand Down
12 changes: 12 additions & 0 deletions code/game/machinery/medical_pod/bone_gel_refill.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/obj/structure/machinery/gel_refiller
name = "osteomimetic lattice fabricator"
desc = "Often called the bone gel refiller by those unable to pronounce its full name, this machine synthesizes and stores bone gel for later use. A slot in the front allows you to insert a bone gel bottle to refill it."
desc_lore = "In an attempt to prevent counterfeit bottles of bone gel not created by Weyland-Yutani, also known as a regular bottle, from being refilled, there is a chip reader in the fabricator and a chip in each bottle to make sure it is genuine. However, due to a combination of quality issues and being unmaintainable from proprietary parts, the machine often has problems. One such problem is in the chip reader, resulting in the fabricator being unable to detect a bottle directly on it, and such fails to activate, resulting in a person having to stand there and manually hold a bottle at the correct height to fill it."
icon_state = "bone_gel_vendor"
density = TRUE

/obj/structure/machinery/gel_refiller/attackby(obj/item/attacking_item, mob/user)
if(!istype(attacking_item, /obj/item/tool/surgery/bonegel))
return ..()
var/obj/item/tool/surgery/bonegel/gel = attacking_item
gel.refill_gel(src, user)
68 changes: 65 additions & 3 deletions code/game/objects/items/tools/surgery_tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -195,16 +195,78 @@
*/

/obj/item/tool/surgery/bonegel
name = "bone gel"
name = "bottle of bone gel"
desc = "A container for bone gel that often needs to be refilled from a specialized machine."
desc_lore = "Bone gel is a biological synthetic bone-analogue with the consistency of clay. It is capable of fixing hairline fractures and complex fractures alike. Bone gel should not be used to fix missing bone, as it does not replace the body's bone marrow. Overuse in a short period may cause acute immunodeficiency or anemia."
icon_state = "bone-gel"
force = 0
throwforce = 1
w_class = SIZE_SMALL
matter = list("plastic" = 7500)
///percent of gel remaining in container
var/remaining_gel = 100
///If gel is used when doing bone surgery
var/unlimited_gel = FALSE
///Time it takes per 10% of gel refilled
var/time_per_refill = 1 SECONDS
///if the bone gel is actively being refilled
var/refilling = FALSE

///How much bone gel is needed to fix a fracture
var/fracture_fix_cost = 5
///How much bone gel is needed to mend bones
var/mend_bones_fix_cost = 5

/obj/item/tool/surgery/bonegel/get_examine_text(mob/user)
. = ..()
if(unlimited_gel) //Only show how much gel is left if it actually uses bone gel
return
. += "A volume reader on the side tells you there is still [remaining_gel]% of [src] is remaining."
. += "[src] can be refilled from a osteomimetic lattice fabricator."

if(!skillcheck(user, SKILL_MEDICAL, SKILL_MEDICAL_DOCTOR)) //Know how much you will be using if you can use it
return
. += SPAN_NOTICE("You would need to use [fracture_fix_cost]% of the bone gel to repair a fracture.")
. += SPAN_NOTICE("You would need to use [mend_bones_fix_cost]% of the bone gel to mend bones.")

/obj/item/tool/surgery/bonegel/proc/refill_gel(obj/refilling_obj, mob/user)
if(unlimited_gel)
to_chat(user, SPAN_NOTICE("[refilling_obj] refuses to fill [src]."))
return
if(remaining_gel >= 100)
to_chat(user, SPAN_NOTICE("[src] cannot be filled with any more bone gel."))
return

if(refilling)
to_chat(user, SPAN_NOTICE("You are already refilling [src] from [refilling_obj]."))
return
refilling = TRUE

while(remaining_gel < 100)
if(!do_after(user, time_per_refill, INTERRUPT_ALL, BUSY_ICON_FRIENDLY, refilling_obj))
break
remaining_gel = clamp(remaining_gel + 10, 0, 100)
to_chat(user, SPAN_NOTICE("[refilling_obj] chimes, and displays \"[remaining_gel]% filled\"."))

refilling = FALSE
playsound(refilling_obj, "sound/machines/ping.ogg", 10)
to_chat(user, SPAN_NOTICE("You remove [src] from [refilling_obj]."))

/obj/item/tool/surgery/bonegel/proc/use_gel(gel_cost)
if(unlimited_gel)
return TRUE

if(remaining_gel < gel_cost)
return FALSE
remaining_gel -= gel_cost
return TRUE

/obj/item/tool/surgery/bonegel/empty
remaining_gel = 0

/obj/item/tool/surgery/bonegel/predatorbonegel
name = "gel gun"
desc = "Inside is a liquid that is similar in effect to bone gel, but requires much smaller quantities, allowing near infinite use from a single capsule."
icon_state = "predator_bone-gel"
unlimited_gel = TRUE

/*
* Fix-o-Vein
Expand Down
21 changes: 21 additions & 0 deletions code/game/objects/items/toys/cards.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
. = ..()
populate_deck()

/obj/item/toy/deck/Destroy(force)
. = ..()
QDEL_NULL_LIST(cards)

/obj/item/toy/deck/get_examine_text(mob/user)
. = ..()
. += SPAN_NOTICE("There are <b>[length(cards)]</b> cards remaining in the deck.")
Expand Down Expand Up @@ -75,6 +79,7 @@
var/obj/item/toy/handcard/H = O
for(var/datum/playing_card/P as anything in H.cards)
cards += P
H.cards -= P
update_icon()
qdel(O)
user.visible_message(SPAN_NOTICE("<b>[user]</b> places their cards on the bottom of \the [src]."), SPAN_NOTICE("You place your cards on the bottom of the deck."))
Expand Down Expand Up @@ -271,6 +276,10 @@
if(!concealed)
. += " ([length(cards)] card\s)"

/obj/item/toy/handcard/Destroy(force)
. = ..()
QDEL_NULL_LIST(cards)

/obj/item/toy/handcard/aceofspades
icon_state = "spades_ace"
desc = "An Ace of Spades"
Expand Down Expand Up @@ -315,6 +324,9 @@

//fuck any qsorts and merge sorts. This needs to be brutally easy
var/cards_length = length(cards)
if(cards_length >= 200)
to_chat(usr, SPAN_WARNING("Your hand is too big to sort. Remove some cards."))
return
for(var/i = 1 to cards_length)
for(var/k = 2 to cards_length)
if(cards[i].sort_index > cards[k].sort_index)
Expand All @@ -331,6 +343,7 @@
var/cards_length = length(H.cards)
for(var/datum/playing_card/P in H.cards)
cards += P
H.cards -= P
qdel(O)
if(pile_state)
if(concealed)
Expand Down Expand Up @@ -390,6 +403,8 @@
/obj/item/toy/handcard/MouseDrop(atom/over)
if(usr != over || !Adjacent(usr))
return
if(ismob(loc))
return
usr.put_in_hands(src)

/obj/item/toy/handcard/get_examine_text(mob/user)
Expand Down Expand Up @@ -423,6 +438,12 @@
name = "a playing card"
desc = "A playing card."

if(length(cards) >= 200)
// BYOND will flat out choke when using thousands of cards for some unknown reason,
// possibly due to the transformed overlay stacking below. Nobody's gonna see the
// difference past 40 or so anyway.
return

overlays.Cut()

if(!cards_length)
Expand Down
6 changes: 3 additions & 3 deletions code/modules/projectiles/guns/smgs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
aim_slowdown = SLOWDOWN_ADS_QUICK
wield_delay = WIELD_DELAY_VERY_FAST
attachable_allowed = list(
/obj/item/attachable/suppressor,
/obj/item/attachable/suppressor,
/obj/item/attachable/reddot,
/obj/item/attachable/reflex,
/obj/item/attachable/flashlight,
Expand Down Expand Up @@ -50,7 +50,7 @@
/obj/item/attachable/suppressor,
/obj/item/attachable/reddot,
/obj/item/attachable/reflex,
/obj/item/attachable/angledgrip,
/obj/item/attachable/angledgrip,
/obj/item/attachable/verticalgrip,
/obj/item/attachable/flashlight/grip,
/obj/item/attachable/stock/smg,
Expand Down Expand Up @@ -84,7 +84,7 @@
accuracy_mult = BASE_ACCURACY_MULT
accuracy_mult_unwielded = BASE_ACCURACY_MULT - HIT_ACCURACY_MULT_TIER_5
scatter = SCATTER_AMOUNT_TIER_4
burst_scatter_mult = SCATTER_AMOUNT_TIER_4
burst_scatter_mult = SCATTER_AMOUNT_TIER_7
scatter_unwielded = SCATTER_AMOUNT_TIER_4
damage_mult = BASE_BULLET_DAMAGE_MULT
recoil_unwielded = RECOIL_AMOUNT_TIER_5
Expand Down
25 changes: 25 additions & 0 deletions code/modules/surgery/bones.dm
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,24 @@
success_sound = 'sound/handling/bandage.ogg'
failure_sound = 'sound/surgery/organ2.ogg'

//Use materials to repair bones, same as /datum/surgery_step/mend_encased
/datum/surgery_step/mend_bones/extra_checks(mob/living/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, repeating, skipped)
. = ..()
if(istype(tool, /obj/item/tool/surgery/bonegel)) //If bone gel, use some of the gel
var/obj/item/tool/surgery/bonegel/gel = tool
if(!gel.use_gel(gel.fracture_fix_cost))
to_chat(user, SPAN_BOLDWARNING("[gel] is empty!"))
return FALSE

else //Otherwise, use metal rods
var/obj/item/stack/rods/rods = user.get_inactive_hand()
if(!istype(rods))
to_chat(user, SPAN_BOLDWARNING("You need metal rods in your offhand to repair [target]'s [surgery.affected_limb.display_name] with [tool]."))
return FALSE
if(!rods.use(2)) //Refunded on failure
to_chat(user, SPAN_BOLDWARNING("You need more metal rods to mend [target]'s [surgery.affected_limb.display_name] with [tool]."))
return FALSE

/datum/surgery_step/mend_bones/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, tool_type, datum/surgery/bone_repair/surgery)
if(surgery.affected_bone)
if(tool_type == /obj/item/tool/surgery/bonegel)
Expand Down Expand Up @@ -118,6 +136,13 @@

target.apply_damage(10, BRUTE, target_zone)
log_interact(user, target, "[key_name(user)] failed to begin repairing bones in [key_name(target)]'s [surgery.affected_limb.display_name] with \the [tool], aborting [surgery].")

if(tool_type != /obj/item/tool/surgery/bonegel)
to_chat(user, SPAN_NOTICE("The metal rods used on [target]'s [surgery.affected_limb.display_name] fall loose from their [surgery.affected_limb]."))
var/obj/item/stack/rods/rods = new /obj/item/stack/rods(get_turf(target))
rods.amount = 2 //Refund 2 rods on failure
rods.update_icon()

return FALSE

//------------------------------------
Expand Down
23 changes: 23 additions & 0 deletions code/modules/surgery/generic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,24 @@
success_sound = 'sound/handling/bandage.ogg'
failure_sound = 'sound/surgery/organ2.ogg'

//Use materials to mend bones, same as /datum/surgery_step/mend_bones
/datum/surgery_step/mend_encased/extra_checks(mob/living/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, repeating, skipped)
. = ..()
if(istype(tool, /obj/item/tool/surgery/bonegel)) //If bone gel, use some of the gel
var/obj/item/tool/surgery/bonegel/gel = tool
if(!gel.use_gel(gel.mend_bones_fix_cost))
to_chat(user, SPAN_BOLDWARNING("[gel] is empty!"))
return FALSE

else //Otherwise, use metal rods
var/obj/item/stack/rods/rods = user.get_inactive_hand()
if(!istype(rods))
to_chat(user, SPAN_BOLDWARNING("You need metal rods in your offhand to mend [target]'s [surgery.affected_limb.display_name] with [tool]."))
return FALSE
if(!rods.use(2)) //Refunded on failure
to_chat(user, SPAN_BOLDWARNING("You need more metal rods to mend [target]'s [surgery.affected_limb.display_name] with [tool]."))
return FALSE

/datum/surgery_step/mend_encased/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, tool_type, datum/surgery/surgery)
if(tool_type == /obj/item/tool/surgery/bonegel)
user.affected_message(target,
Expand Down Expand Up @@ -626,6 +644,11 @@
target.apply_damage(10, BRUTE, target_zone)
log_interact(user, target, "[key_name(user)] failed to mend [key_name(target)]'s [surgery.affected_limb.encased].")

if(tool_type != /obj/item/tool/surgery/bonegel)
to_chat(user, SPAN_NOTICE("The metal rods used on [target]'s [surgery.affected_limb.display_name] fall loose from their [surgery.affected_limb]."))
var/obj/item/stack/rods/rods = new /obj/item/stack/rods(get_turf(target))
rods.amount = 2 //Refund 2 rods on failure
rods.update_icon()

/*Proof of concept. Functions but does nothing useful.
If fiddling with, uncomment /mob/living/attackby surgery code also. It's pointless processing to have live without any surgeries for it to use.*/
Expand Down
1 change: 1 addition & 0 deletions colonialmarines.dme
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,7 @@
#include "code\game\machinery\kitchen\smartfridge.dm"
#include "code\game\machinery\medical_pod\autodoc.dm"
#include "code\game\machinery\medical_pod\bodyscanner.dm"
#include "code\game\machinery\medical_pod\bone_gel_refill.dm"
#include "code\game\machinery\medical_pod\medical_pod.dm"
#include "code\game\machinery\medical_pod\sleeper.dm"
#include "code\game\machinery\pipe\construction.dm"
Expand Down
4 changes: 4 additions & 0 deletions html/changelogs/AutoChangeLog-pr-5228.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
author: "VileBeggar"
delete-after: True
changes:
- balance: "M39 burst scatter multiplier reduced from 7 to 4."
7 changes: 7 additions & 0 deletions html/changelogs/AutoChangeLog-pr-5280.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
author: "BeagleGaming1"
delete-after: True
changes:
- balance: "Repairing bones with bone glue costs a portion of the bone glue's resources"
- balance: "Repairing bones with a screwdriver costs metal"
- rscdel: "Removed bone glue from the medilathe"
- spellcheck: "New description for bone glue"
4 changes: 4 additions & 0 deletions html/changelogs/AutoChangeLog-pr-5337.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
author: "fira"
delete-after: True
changes:
- bugfix: "Fixed an exploit involving playing cards."
4 changes: 4 additions & 0 deletions html/changelogs/AutoChangeLog-pr-5397.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
author: "SpartanBobby"
delete-after: True
changes:
- maptweak: "A bunch of edits to big red and big red nightmares for the following areas, Northcaves, Medical Morgue, maint between cargo and general store, LZ2, North Libary, EVA, dorms bathroom"
6 changes: 0 additions & 6 deletions html/changelogs/AutoChangeLog-pr-5402.yml

This file was deleted.

4 changes: 4 additions & 0 deletions html/changelogs/AutoChangeLog-pr-5497.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
author: "Ben10083"
delete-after: True
changes:
- maptweak: "Workin Joey has returned to the Maintenance Bar"
5 changes: 5 additions & 0 deletions html/changelogs/archive/2024-01.yml
Original file line number Diff line number Diff line change
Expand Up @@ -288,3 +288,8 @@
- balance: AP rocket applies 3 weaken and 3 paralyze no matter if you hit the mob
directly(from 2), at max range (from 2) or tile under it (from 4)
- balance: indirect AP rocket does the same damage to walls and mobs
2024-01-23:
realforest2001:
- rscadd: Added Whitelist Panel for whitelist senators to manage their own whitelists.
- refactor: Whitelist.txt is no longer functional, owing to the new system.
- rscdel: Removed "Alien Whitelist" checks regarding base SS13 races.
Binary file modified icons/obj/structures/props/stationobjs.dmi
Binary file not shown.
Loading

0 comments on commit 17d9d37

Please sign in to comment.