Skip to content

Commit

Permalink
Medbots will now bandage bleeding patients (#11057)
Browse files Browse the repository at this point in the history
* Bleeding Update

* Changes bleeding effects

* Fixes some bleeding issues

* Fixes blood calculation

* Polishes the hold wounds button

* Adds an indicator to how deadly it is

* Moves the examine message

* Adds cauterisation surgery

* Fixes the examine message

* Removes the screaming and updates the icons

* Update code/controllers/subsystem/early_assets.dm

* Fixes de-sword keeping bleed damage when unwielded

* Adds in bleeding to the armour readouts

* Fixes the examine message

* Blood update

* Adds some bleed armour to some things that really should have it

* Fixes compilation

* Uses maths to decrease the bleed rate as your blood pressure lowers, and when your heart stops beating

* Merge conflict resolution

* Bleeding stuff

* Fixes cauterising wounds

* Fixes

* Bandages disappear when you stop bleeding

* Removes bleeding from toy de-sword, adds minor bleeding to toy katana

Co-Authored-By: BlueHNT <[email protected]>

* Updates how bandaging works, makes bleeding status effect reactive

* Nerfs heparin

* Fixes mime gun causing bleeding

* Reduces the amount of bleed damage caused by cult

* Adds a maximum bleed rate

* Medical scanners report bleed rate

* Restorative nanites now restore blood

* Changes how death works

* Nukie stims prevent bleeding

* Fixes compilation

* Syndicate reagents now regenerate blood

* Shotgun pellets deal less bleed damage

* Fixes blooD calculation

* Changes the equation

* Updates cauterisation, adds overhead messages to healing items

* Update carbon_defense.dm

* Fixes blood damage doing nothing

* Fixes the player not dying when they have no blood

* Fixes some minor bugs with medical items

* Unholy water now provides bleed immunity

* Update code/__DEFINES/mobs.dm

Co-authored-by: EvilDragonfiend <[email protected]>

* Update code/modules/mob/living/blood.dm

Co-authored-by: EvilDragonfiend <[email protected]>

* Adds IPC bleeding and cleans some code up

* Fixes IPCs taking infinite damage from no coolant

* Status effect merging

* Bleed merging and reduces bleed rate of rubbershot

* Fixes bleeding status effect having invalid status type

* Update blood.dm

* Abductor teleporter now heals all wounds

* Arglist change that was lost during merge deconflict

* Doubles the capacity of bloodbags

* Shows compatible blood types on the analyser

* Update scanners.dm

* Adds compatible to the analyser

* Update code/modules/clothing/under/_under.dm

* Simplemobs can now cause bleeding with melee attacks

* Makes big amounts of blood appear more frequently

* Bleed anomaly

* Fixes blood anomaly

* Blood anomaly properly deletes itself

* Reactive armour and bleed anomaly fixes

* Ashwalkers will now heal bleeding naturally

* fixes golems bleeding for a single tick

* Fixes gun loading bug (#10999)

* Automatic changelog generation for PR #10999 [ci skip]

* Automatic changelog compile [ci skip]

* Automatic changelog compile [ci skip]

* adds missing QDEL_HINT return (#11013)

* Automatic changelog generation for PR #11013 [ci skip]

* Automatic changelog compile [ci skip]

* Update soulstone.dm (#11017)

* Automatic changelog generation for PR #11017 [ci skip]

* Automatic changelog compile [ci skip]

* Replaces Telecommunications piping with actual cooling pipes (#10964)

* did a thing

* attempt 2

* box station fixed

* echostation fixed

* more fix

* finally done

* Automatic changelog generation for PR #10964 [ci skip]

* Automatic changelog compile [ci skip]

* Automatic changelog compile [ci skip]

* Automatic changelog compile [ci skip]

* Fixes ghost construct spawning copies (#11018)

* Automatic changelog generation for PR #11018 [ci skip]

* Automatic changelog compile [ci skip]

* Fixes the rest of the 'random arcade machines' bug (#11028)

* Used UpdatePaths

Ran UpdatePaths with ```/obj/machinery/computer/arcade : /obj/effect/spawner/randomarcade{@old}```

* Updated the script name to add the PR number

I added it to mine and also added it to the previous script while I was at it.

* Adds a newline to the two scripts

I didn't realize that it was needed and even removed it from the brigtimers script, oopsie. Added them.

* Automatic changelog generation for PR #11028 [ci skip]

* Automatic changelog compile [ci skip]

* Automatic changelog compile [ci skip]

* Automatic changelog compile [ci skip]

* Autolathe shock wire now responds to cutting (#11031)

* Automatic changelog generation for PR #11031 [ci skip]

* Automatic changelog compile [ci skip]

* Adds cigars to the smoker trait option list (#10991)

* Added cigars to the smoker trait option list

* added dromedary co cigs 

For some reason it doesnt want to work, testing out with a different pack

* I might have figured out the issue, just gotta test 

might have to do something with the "cigpack" part of object names. Fixing shitcode with even more shitcode

* was editing the wrong code

Death be upon coders

* The code is now in the correct file

* Cleaned up a bit of code

Learning as I go, was told this was a good change

* Added Dromedary co cigs

* Added missing comma

* Automatic changelog generation for PR #10991 [ci skip]

* Automatic changelog compile [ci skip]

* Automatic changelog compile [ci skip]

* Fixes incorrect message being shown on brain mob and heads (#10955)

* Automatic changelog generation for PR #10955 [ci skip]

* Increases weapon slowdown for heavier weapons (#10977)

* Update gun.dm

* Removes KA slowdown

* Automatic changelog generation for PR #10977 [ci skip]

* map debug (#10980)

* Automatic changelog generation for PR #10980 [ci skip]

* Nature Sect Fix - Stops the orb from replacing open-space tiles and blocking off stairs (#11023)

* Fixes an issue involving the open-space tile

* more turfs

* Automatic changelog generation for PR #11023 [ci skip]

* Automatic changelog compile [ci skip]

* Automatic changelog compile [ci skip]

* Automatic changelog compile [ci skip]

* Automatic changelog compile [ci skip]

* Shadow Sect - New Rite, Final Darkness (#11004)

* Adds Faithsworn and Summon Rite

* faithless define, Summon to Final Darkness, Murderbone Only

* Adds a priority announcement apon murderbone summon

* Fixes an issue regarding openspace tiles

* fixes potential turf issues

* Fixes and swapped to timer and stuff

* dont need Initalize

* Removes Check-tick, removed from nature sect too as its almost the same code

* Automatic changelog generation for PR #11004 [ci skip]

* Automatic changelog compile [ci skip]

* Really tiny (#10716)

* Automatic changelog generation for PR #10716 [ci skip]

* initial commit

* updates to use bacon bleeding

* uses DEFINE

* removes unecessary check

* Update code/modules/mob/living/simple_animal/bot/medbot.dm

Co-authored-by: PowerfulBacon <[email protected]>

---------

Co-authored-by: PowerfulBacon <[email protected]>
Co-authored-by: BlueHNT <[email protected]>
Co-authored-by: EvilDragonfiend <[email protected]>
Co-authored-by: ss13-beebot <[email protected]>
Co-authored-by: HowToLoLu <[email protected]>
Co-authored-by: XeonMations <[email protected]>
Co-authored-by: Gilgaxx <[email protected]>
Co-authored-by: Geatish <[email protected]>
Co-authored-by: ro5490 <[email protected]>
Co-authored-by: TsunamiAnt <[email protected]>
  • Loading branch information
11 people authored Aug 8, 2024
1 parent 2a176dd commit 65ff1f3
Showing 1 changed file with 35 additions and 12 deletions.
47 changes: 35 additions & 12 deletions code/modules/mob/living/simple_animal/bot/medbot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ GLOBAL_VAR(medibot_unique_id_gen)
#define MEDBOT_PANIC_AAAA 70
#define MEDBOT_PANIC_ENDING 90
#define MEDBOT_PANIC_END 100
#define MEDIBOT_TREAT_INJECT "inject"
#define MEDIBOT_TREAT_SUCK "suck"
#define MEDBOT_TREAT_INJECT "inject"
#define MEDBOT_TREAT_SUCK "suck"
#define MEDBOT_TREAT_BANDAGE "bandage"


/mob/living/simple_animal/bot/medbot
Expand Down Expand Up @@ -530,10 +531,13 @@ GLOBAL_VAR(medibot_unique_id_gen)
var/obj/item/clothing/CH = H.head
if (CS.clothing_flags & CH.clothing_flags & THICKMATERIAL)
return FALSE // Skip over them if they have no exposed flesh.
if(H.is_bleeding())
return TRUE

if(declare_crit && C.health <= 0) //Critical condition! Call for help!
declare(C)


if(!reagent_glass?.reagents.total_volume) // no beaker, we can't do that
return FALSE

Expand Down Expand Up @@ -611,10 +615,15 @@ GLOBAL_VAR(medibot_unique_id_gen)
var/treat_behaviour // what this medibot will do?

if(emagged)
treat_behaviour = MEDIBOT_TREAT_SUCK // Emagged! Time to drain everybody.
treat_behaviour = MEDBOT_TREAT_SUCK // Emagged! Time to drain everybody.

if(!treat_behaviour && ishuman(C))
var/mob/living/carbon/human/H = C
if(H.is_bleeding())
treat_behaviour = MEDBOT_TREAT_BANDAGE

if(!treat_behaviour && reagent_glass?.reagents.total_volume) //have a beaker with something?
treat_behaviour = MEDIBOT_TREAT_INJECT
treat_behaviour = MEDBOT_TREAT_INJECT

for(var/datum/reagent/each_beaker_reagent in reagent_glass.reagents.reagent_list)
if(C.reagents.has_reagent(each_beaker_reagent.type)) // they have the chems inside them already
Expand All @@ -631,19 +640,21 @@ GLOBAL_VAR(medibot_unique_id_gen)
bot_reset()
return


C.visible_message("<span class='danger'>[src] is trying to inject [patient]!</span>", "<span class='userdanger'>[src] is trying to inject you!</span>")
if( get_dist(src, patient) > 1 || \
var/tool_action = "inject"
if(treat_behaviour == MEDBOT_TREAT_BANDAGE)
tool_action = "bandage"
C.visible_message("<span class='danger'>[src] is trying to [tool_action] [patient]!</span>", "<span class='userdanger'>[src] is trying to [tool_action] you!</span>")
if(get_dist(src, patient) > 1 || \
!do_after(src, 2 SECONDS, patient) ||\
!assess_patient(patient) || \
!on) //are they near us? did they move away? are they still hurt? are we stil on?
visible_message("[src] retracts its syringe.")
visible_message("[src] retracts its tools.")
update_icon()
soft_reset()
return

switch(treat_behaviour)
if(MEDIBOT_TREAT_INJECT)
if(MEDBOT_TREAT_INJECT)
if(reagent_glass?.reagents.total_volume)
var/fraction = min(injection_amount/reagent_glass.reagents.total_volume, 1)
var/reagentlist = pretty_string_from_reagent_list(reagent_glass.reagents.reagent_list)
Expand All @@ -656,15 +667,27 @@ GLOBAL_VAR(medibot_unique_id_gen)
speak(message,radio_channel)
playsound(src, messagevoice[message], 50)
COOLDOWN_START(src, declare_cooldown, 10 SECONDS)
if(MEDIBOT_TREAT_SUCK)
C.visible_message("<span class='danger'>[src] injects [patient] with its syringe!</span>", \
"<span class='userdanger'>[src] injects you with its syringe!</span>")
if(MEDBOT_TREAT_BANDAGE)
var/mob/living/carbon/human/H = C
if(!H.is_bleeding())
to_chat(src, "<span class='warning'>[H] isn't bleeding!</span>")
update_icon()
soft_reset()
return
H.suppress_bloodloss(BLEED_SURFACE) // as good as a improvized medical gauze
C.visible_message("<span class='danger'>[src] bandages [patient] with its gauze!</span>", \
"<span class='userdanger'>[src] bandages you with its gauze!</span>")
if(MEDBOT_TREAT_SUCK)
if(patient.transfer_blood_to(reagent_glass, injection_amount))
patient.visible_message("<span class='danger'>[src] is trying to inject [patient]!</span>", \
"<span class='userdanger'>[src] is trying to inject you!</span>")
log_combat(src, patient, "drained of blood")
else
to_chat(src, "<span class='warning'>You are unable to draw any blood from [patient]!</span>")
C.visible_message("<span class='danger'>[src] injects [patient] with its syringe!</span>", \
"<span class='userdanger'>[src] injects you with its syringe!</span>")
C.visible_message("<span class='danger'>[src] injects [patient] with its syringe!</span>", \
"<span class='userdanger'>[src] injects you with its syringe!</span>")
update_icon()
soft_reset()
return
Expand Down

0 comments on commit 65ff1f3

Please sign in to comment.