Files
Paradise/code/game/objects/items/tools/crowbar.dm
Luc 346a1b8142 Yet Another Surgery Refactor (#18325)
* Initial commit

Fixes up surgery.dm
Adds some tool behavior

* More basic changes

* Checkpointing: this is a little gross right now

* Add signal COMPONENT_CANCEL_ATTACK_CHAIN

* Cleans up surgery initiator

* Mostly gets surgery (and canceling it) working

* Add abstract proxy surgery steps

Also adds them to organ manipulation

* Clean up most existing surgeries

* Rework organ openness, adds define for aborting a beginstep

* surgery works again, also implements retry defines

* fix surgery computer

* add limb repair to synth implant removal

* retry implant checks

* Clean up abductor surgeries as well as some other things

* A lot
- Reworks organ manipulation to use a series of surgery steps instead
- Fixes some runtimes with open hands
- Lets mito zero out the germ level while treating necrosis
- Adds a debug surgery tool

* add debug surgery tool, note some TODOs for later

* Add conditional check for surgeries repeating

* update surgery retry logic to make it more of a bonus

* Lets abductors automatically retry any failed surgery steps

* Rework robotic surgery to use abstract/proxy steps

* Bunch of bugfixes and more!
- Limb reattachment works properly now, you can just slap a limb onto a person
- If the limb isn't robotic, it'll be useless until the surgery is finished with a hemostat, though it might be enough to get the patient out of the OR.

* Remove more now-implicit checks

* Slight reorganization

* more fixes across the board

* Remove unused variable

* Trying not to lose my mind here
- Does away with can_run() entirely
- Cleans up visible messages in code
- begin steps should now all have ..() afterwards
- slime bone surgery should be fixed now
- more docs

* Robotic  surgery is stoppable with a crowbar, all surgery can_start now checks parent

* Fix some broken robotic typepaths

* Typepath fixes, do away with some last TODOs

* Forgor

* Last cleanups before we go gold

* jk lol

* Make early surgery termination clearer

* More "last" cleanups

* Fixes tool flags, surgery initiation

- Fixes surgery not being startable by sharp objects
- Moves surgical tool flags to item traits

* Clean up surgery cancellation, especially for borgos

* I think this should GC better

* Apply suggestions from code review

Co-authored-by: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com>

* Status is now step number

* Add a 20% chance to find nothing during organ manipulation

* Improve documentation, make forced_surgery a normal arg

* Charlie's reviews

* Why are abductors like this

* Little more verification, ensuring limb augmentation and organ manip healing work properly

* Fix torso organ manip being unfinishable

* Fix cavity implants, open-hand/any item steps

* Make sharp objects not try to start an operation with help intent

* Comments, quick target fix

* Re-order list so advanced bruise pack is pulled first

* Make surgical gripper function like an open hand

* Make mito only use one unit per organ for now

* Check if user is on operable surface before trying to operate

* Reduce admin logging

* Fix some bugs that appeared during the testmerge
- you can no longer start robotic surgeries with a scalpel (lol)
- you can now cancel surgeries on the first step after I fixed some bugs that I introduced (woo hoo)
- Synthetic limb attachment is now combined into a single startable surgery step, though still retains the fun flavor of both

* Swats some more bugs
- (hopefully) fixes a huge source of runtimes where we tried to check if we could run surgeries before checking if the surgery used an organ
- In doing so, moves the logic for determining if a surgery can start to the mob-level
- Fixes robotic reattachment surgery not working

* multi-bug drifting???

- Fixes a bug where a branching surgery with an any tool option could possibly override a step with a matching tool
- Fixes some intermediate surgeries failing due to not having specified possible_locs

* A few more fixes
- Fixes any surgery tool steps again
- Fixes cavity surgery again

* Hopefully fixes getting stuck in robotic organ manip

* Remove extra parent call

* Steel review

* Steel review

* Fix spacing for possible locs

* Roundstart traits

* Advanced surgical traits and other hal fixes

Co-authored-by: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com>
2022-09-16 18:48:43 +01:00

95 lines
3.2 KiB
Plaintext

/obj/item/crowbar
name = "pocket crowbar"
desc = "A small crowbar. This handy tool is useful for lots of things, such as prying floor tiles or opening unpowered doors."
icon = 'icons/obj/tools.dmi'
icon_state = "crowbar"
item_state = "crowbar"
belt_icon = "crowbar"
usesound = 'sound/items/crowbar.ogg'
flags = CONDUCT
slot_flags = SLOT_BELT
force = 5
throwforce = 7
w_class = WEIGHT_CLASS_SMALL
materials = list(MAT_METAL=50)
drop_sound = 'sound/items/handling/crowbar_drop.ogg'
pickup_sound = 'sound/items/handling/crowbar_pickup.ogg'
origin_tech = "engineering=1;combat=1"
attack_verb = list("attacked", "bashed", "battered", "bludgeoned", "whacked")
toolspeed = 1
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 50, ACID = 30)
tool_behaviour = TOOL_CROWBAR
/obj/item/crowbar/red
icon_state = "crowbar_red"
item_state = "crowbar_red"
belt_icon = "crowbar_red"
force = 8
/obj/item/crowbar/brass
name = "brass crowbar"
desc = "A brass crowbar. It feels faintly warm to the touch."
icon_state = "crowbar_brass"
item_state = "crowbar_brass"
toolspeed = 0.5
resistance_flags = FIRE_PROOF | ACID_PROOF
/obj/item/crowbar/abductor
name = "alien crowbar"
desc = "A hard-light crowbar. It appears to pry by itself, without any effort required."
icon = 'icons/obj/abductor.dmi'
usesound = 'sound/weapons/sonic_jackhammer.ogg'
icon_state = "crowbar"
toolspeed = 0.1
origin_tech = "combat=4;engineering=4;abductor=3"
/obj/item/crowbar/large
name = "crowbar"
desc = "It's a big crowbar. It doesn't fit in your pockets, because its too big."
force = 12
w_class = WEIGHT_CLASS_NORMAL
throw_speed = 3
throw_range = 3
materials = list(MAT_METAL=70)
icon_state = "crowbar_large"
item_state = "crowbar_large"
toolspeed = 0.5
/obj/item/crowbar/cyborg
name = "hydraulic crowbar"
desc = "A hydraulic prying tool, compact but powerful. Designed to replace crowbar in construction cyborgs."
usesound = 'sound/items/jaws_pry.ogg'
force = 10
toolspeed = 0.5
/obj/item/crowbar/power
name = "jaws of life"
desc = "A set of jaws of life, the magic of science has managed to fit it down into a device small enough to fit in a tool belt. It's fitted with a prying head."
flags = CONDUCT
icon_state = "jaws_pry"
item_state = "jawsoflife"
belt_icon = "jaws"
materials = list(MAT_METAL=150,MAT_SILVER=50,MAT_TITANIUM=25)
origin_tech = "materials=2;engineering=2"
usesound = 'sound/items/jaws_pry.ogg'
force = 15
toolspeed = 0.25
var/airlock_open_time = 100 // Time required to open powered airlocks
/obj/item/crowbar/power/Initialize(mapload)
. = ..()
ADD_TRAIT(src, TRAIT_ADVANCED_SURGICAL, ROUNDSTART_TRAIT)
/obj/item/crowbar/power/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is putting [user.p_their()] head in [src]. It looks like [user.p_theyre()] trying to commit suicide!</span>")
playsound(loc, 'sound/items/jaws_pry.ogg', 50, 1, -1)
return BRUTELOSS
/obj/item/crowbar/power/attack_self(mob/user)
playsound(get_turf(user), 'sound/items/change_jaws.ogg', 50, 1)
var/obj/item/wirecutters/power/cutjaws = new /obj/item/wirecutters/power
to_chat(user, "<span class='notice'>You attach the cutting jaws to [src].</span>")
qdel(src)
user.put_in_active_hand(cutjaws)