Files
Polaris/code/modules/surgery/other.dm
Aronai Sieyes 715de43f35 VChat: Redone chat output done in Vue.js (#6761)
* Better notifications

* Add buttons to del/move tabs in edit mode

* Add a <span> to emotes

* Fix duplicate IDs in VChat and add more logging

* VChat: Redone chat output in Vue.js

* Ported tg asset cache

* VChat DME Update

* Replace \image macro with bicon()

* NanoUI Subsystem Fixes

Don't do this, the asset subsystem does this for you

* Allow narrate/globalnarrate shenanigans

Allows HTML if your entire thing is HTML

* Disable bicon() icon object cache, and create text tag cache

* Ore Scanner is written incorrectly

Only revealed by vchat

* Fixes 2 VChat bugs

* Underline links in VChat

* Fix LOOC color

* VChat Improvements

Hopefully, anyway.
- Arbitrary font size setting
- Line height setting
- Multiple crush settings
- Rewrote how tabs work hopefully for performance
- Hidden messages are actually put elsewhere
- Attempts to correct chat backlog restore on rejoin

* Surgery steps to use <span>

* Some VChat Tweaks

- Chat remains between client reconnects if your client didn't close (so things like using the reconnect button, or autoreconnects at round end when that feels like working)
- The client doesn't send pings to the server, the server sends pings to the client. This fixes AFK measurements for AFK kick purposes.
- Turn latency indicator into a green/red indicator to show if you're connected, and when clicked will perform a one-time ping (and block doing it again for 10 seconds). It will display '?ms' if it never got a reply, or '999ms' if it did, but it was over 1s.

* Include date in filename for VChat log save

* Merge pull request #6767 from Cyantime/patch-2

Change chat export naming scheme

* Adds VChat tab saving

Saves every time you enter/exit edit mode. Persists between rounds, VChat reloads via verb, etc.

* Fix chat exporting when someone has used unicode

Only affects clients still using 512

* Use CLIENT_FROM_VAR for ease of code reading

* Update code/modules/client/asset_cache.dm

Co-Authored-By: Novacat <35587478+Novacat@users.noreply.github.com>

* Fix runtime when client disconnects before vchat loads

* Fix polaris version of command reports

* Fix LOOC color in oldchat

* Put some styles in various adminpm messages

* Round info and advanced who spans

* Fix missing tag-end

* Maybe fix images for linux and statpanel but also doom everyone

Co-authored-by: ShadowLarkens <ShadowLarkens@users.noreply.github.com>
Co-authored-by: Novacat <35587478+Novacat@users.noreply.github.com>
2020-03-27 14:07:28 -07:00

235 lines
10 KiB
Plaintext

//Procedures in this file: Inernal wound patching, Implant removal.
//////////////////////////////////////////////////////////////////
// INTERNAL WOUND PATCHING //
//////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////
// Internal Bleeding Surgery
///////////////////////////////////////////////////////////////
/datum/surgery_step/fix_vein
priority = 2
allowed_tools = list(
/obj/item/weapon/surgical/FixOVein = 100, \
/obj/item/stack/cable_coil = 75
)
can_infect = 1
blood_level = 1
min_duration = 70
max_duration = 90
/datum/surgery_step/fix_vein/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(!hasorgans(target))
return 0
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if(!affected) return
if(coverage_check(user, target, affected, tool))
return 0
var/internal_bleeding = 0
for(var/datum/wound/W in affected.wounds) if(W.internal)
internal_bleeding = 1
break
return affected.open == (affected.encased ? 3 : 2) && internal_bleeding
/datum/surgery_step/fix_vein/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts patching the damaged vein in [target]'s [affected.name] with \the [tool]." , \
"You start patching the damaged vein in [target]'s [affected.name] with \the [tool].")
target.custom_pain("The pain in [affected.name] is unbearable!", 100)
..()
/datum/surgery_step/fix_vein/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("<span class='notice'>[user] has patched the damaged vein in [target]'s [affected.name] with \the [tool].</span>", \
"<span class='notice'>You have patched the damaged vein in [target]'s [affected.name] with \the [tool].</span>")
for(var/datum/wound/W in affected.wounds) if(W.internal)
affected.wounds -= W
affected.update_damages()
if (ishuman(user) && prob(40)) user:bloody_hands(target, 0)
/datum/surgery_step/fix_vein/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("<span class='danger'>[user]'s hand slips, smearing [tool] in the incision in [target]'s [affected.name]!</span>" , \
"<span class='danger'>Your hand slips, smearing [tool] in the incision in [target]'s [affected.name]!</span>")
affected.take_damage(5, 0)
///////////////////////////////////////////////////////////////
// Necrosis Surgery Step 1
///////////////////////////////////////////////////////////////
/datum/surgery_step/fix_dead_tissue //Debridement
priority = 2
allowed_tools = list(
/obj/item/weapon/surgical/scalpel = 100, \
/obj/item/weapon/material/knife = 75, \
/obj/item/weapon/material/shard = 50, \
)
can_infect = 1
blood_level = 1
min_duration = 110
max_duration = 160
/datum/surgery_step/fix_dead_tissue/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(!hasorgans(target))
return 0
if (target_zone == O_MOUTH || target_zone == O_EYES)
return 0
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if(coverage_check(user, target, affected, tool))
return 0
return affected && affected.open >= 2 && (affected.status & ORGAN_DEAD)
/datum/surgery_step/fix_dead_tissue/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts cutting away necrotic tissue in [target]'s [affected.name] with \the [tool]." , \
"You start cutting away necrotic tissue in [target]'s [affected.name] with \the [tool].")
target.custom_pain("The pain in [affected.name] is unbearable!", 100)
..()
/datum/surgery_step/fix_dead_tissue/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("<span class='notice'>[user] has cut away necrotic tissue in [target]'s [affected.name] with \the [tool].</span>", \
"<span class='notice'>You have cut away necrotic tissue in [target]'s [affected.name] with \the [tool].</span>")
affected.open = 3
/datum/surgery_step/fix_dead_tissue/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("<span class='danger'>[user]'s hand slips, slicing an artery inside [target]'s [affected.name] with \the [tool]!</span>", \
"<span class='danger'>Your hand slips, slicing an artery inside [target]'s [affected.name] with \the [tool]!</span>")
affected.createwound(CUT, 20, 1)
///////////////////////////////////////////////////////////////
// Necrosis Surgery Step 2
///////////////////////////////////////////////////////////////
/datum/surgery_step/treat_necrosis
priority = 2
allowed_tools = list(
/obj/item/weapon/reagent_containers/dropper = 100,
/obj/item/weapon/reagent_containers/glass/bottle = 75,
/obj/item/weapon/reagent_containers/glass/beaker = 75,
/obj/item/weapon/reagent_containers/spray = 50,
/obj/item/weapon/reagent_containers/glass/bucket = 50,
)
can_infect = 0
blood_level = 0
min_duration = 50
max_duration = 60
/datum/surgery_step/treat_necrosis/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!istype(tool, /obj/item/weapon/reagent_containers))
return 0
var/obj/item/weapon/reagent_containers/container = tool
if(!container.reagents.has_reagent("peridaxon"))
return 0
if(!hasorgans(target))
return 0
if (target_zone == O_MOUTH || target_zone == O_EYES)
return 0
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if(coverage_check(user, target, affected, tool))
return 0
return affected && affected.open == 3 && (affected.status & ORGAN_DEAD)
/datum/surgery_step/treat_necrosis/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts applying medication to the affected tissue in [target]'s [affected.name] with \the [tool]." , \
"You start applying medication to the affected tissue in [target]'s [affected.name] with \the [tool].")
target.custom_pain("Something in your [affected.name] is causing you a lot of pain!", 50)
..()
/datum/surgery_step/treat_necrosis/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if (!istype(tool, /obj/item/weapon/reagent_containers))
return
var/obj/item/weapon/reagent_containers/container = tool
var/trans = container.reagents.trans_to_mob(target, container.amount_per_transfer_from_this, CHEM_BLOOD) //technically it's contact, but the reagents are being applied to internal tissue
if (trans > 0)
affected.status &= ~ORGAN_DEAD
affected.owner.update_icons_body()
user.visible_message("<span class='notice'>[user] applies [trans] units of the solution to affected tissue in [target]'s [affected.name].</span>", \
"<span class='notice'>You apply [trans] units of the solution to affected tissue in [target]'s [affected.name] with \the [tool].</span>")
/datum/surgery_step/treat_necrosis/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if (!istype(tool, /obj/item/weapon/reagent_containers))
return
var/obj/item/weapon/reagent_containers/container = tool
var/trans = container.reagents.trans_to_mob(target, container.amount_per_transfer_from_this, CHEM_BLOOD)
user.visible_message("<span class='danger'>[user]'s hand slips, applying [trans] units of the solution to the wrong place in [target]'s [affected.name] with the [tool]!</span>" , \
"<span class='danger'>Your hand slips, applying [trans] units of the solution to the wrong place in [target]'s [affected.name] with the [tool]!</span>")
//no damage or anything, just wastes medicine
///////////////////////////////////////////////////////////////
// Hardsuit Removal Surgery
///////////////////////////////////////////////////////////////
/datum/surgery_step/hardsuit
allowed_tools = list(
/obj/item/weapon/weldingtool = 80,
/obj/item/weapon/surgical/circular_saw = 60,
/obj/item/weapon/pickaxe/plasmacutter = 100
)
req_open = 0
can_infect = 0
blood_level = 0
min_duration = 120
max_duration = 180
/datum/surgery_step/hardsuit/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(!istype(target))
return 0
if(istype(tool,/obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/welder = tool
if(!welder.isOn() || !welder.remove_fuel(1,user))
return 0
return (target_zone == BP_TORSO) && ((istype(target.back, /obj/item/weapon/rig) && !(target.back.canremove)) || (istype(target.belt, /obj/item/weapon/rig) && !(target.belt.canremove)))
/datum/surgery_step/hardsuit/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/weapon/rig/rig = target.back
if(!istype(rig))
rig = target.belt
if(!istype(rig))
return
user.visible_message("[user] starts cutting through the support systems of \the [rig] on [target] with \the [tool]." , \
"You start cutting through the support systems of \the [rig] on [target] with \the [tool].")
..()
/datum/surgery_step/hardsuit/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/weapon/rig/rig = target.back
if(!istype(rig))
rig = target.belt
if(!istype(rig))
return
rig.cut_suit()
user.visible_message("<span class='notice'>[user] has cut through the support systems of \the [rig] on [target] with \the [tool].</span>", \
"<span class='notice'>You have cut through the support systems of \the [rig] on [target] with \the [tool].</span>")
/datum/surgery_step/hardsuit/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("<span class='danger'>[user]'s [tool] can't quite seem to get through the metal...</span>", \
"<span class='danger'>\The [tool] can't quite seem to get through the metal. It's weakening, though - try again.</span>")