mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-23 04:51:32 +01:00
Special Swords and amputation (#715)
changes: rscadd: "Chainswords now have an improved animation." rscadd: "Chainswords and energy blades can no longer get embedded in people." rscadd: "Chainswords and energy blades can now be used as surgical tools to amputate limbs. Chainswords are messy. Energy blades will cut clean and cauterize the wound" tweak: "Surgery messages about amputating bodyparts are now very noticeable" tweak: "Cauterising wounds with a welding tool is much more reliable. Cauterising with a cigarette is no longer effective." bugfix: "Fixed chainsword held sprite not updating when toggled"
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
var/siemens_coefficient = 1 // for electrical admittance/conductance (electrocution checks and shit)
|
||||
var/slowdown = 0 // How much clothing is slowing you down. Negative values speeds you up
|
||||
var/canremove = 1 //Mostly for Ninja code at this point but basically will not allow the item to be removed if set to 0. /N
|
||||
var/can_embed = 1//If zero, this item/weapon cannot become embedded in people when you hit them with it
|
||||
var/list/armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
|
||||
var/list/allowed = null //suit storage stuff.
|
||||
var/obj/item/device/uplink/hidden/hidden_uplink = null // All items can have an uplink hidden inside, just remember to add the triggers.
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
sharp = 0
|
||||
edge = 0
|
||||
flags = NOBLOODY
|
||||
can_embed = 0//No embedding pls
|
||||
|
||||
/obj/item/weapon/melee/energy/proc/activate(mob/living/user)
|
||||
anchored = 1
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
attack_verb = list("chopped", "sliced", "shredded", "slashed", "cut", "ripped")
|
||||
hitsound = 'sound/weapons/bladeslice.ogg'
|
||||
var/active = 0
|
||||
can_embed = 0//A chainsword can slice through flesh and bone, and the direction can be reversed if it ever did get stuck
|
||||
|
||||
/obj/item/weapon/melee/chainsword/attack_self(mob/user)
|
||||
active= !active
|
||||
@@ -47,7 +48,8 @@
|
||||
hitsound = initial(hitsound)
|
||||
icon_state = initial(icon_state)
|
||||
slot_flags = initial(slot_flags)
|
||||
|
||||
user.regenerate_icons()
|
||||
|
||||
/obj/item/weapon/melee/chainsword/suicide_act(mob/user)
|
||||
viewers(user) << "\red <b>[user] is slicing \himself apart with the [src.name]! It looks like \he's trying to commit suicide.</b>"
|
||||
return (BRUTELOSS|OXYLOSS)
|
||||
|
||||
@@ -214,6 +214,11 @@
|
||||
if(!do_after(user,cut_delay))
|
||||
return
|
||||
|
||||
|
||||
//This prevents runtime errors if someone clicks the same wall more than once
|
||||
if (!istype(src, /turf/simulated/wall))
|
||||
return
|
||||
|
||||
user << "<span class='notice'>You remove the outer plating.</span>"
|
||||
dismantle_wall()
|
||||
user.visible_message("<span class='warning'>The wall was torn open by [user]!</span>")
|
||||
|
||||
@@ -302,13 +302,15 @@ emp_act
|
||||
if (armor)
|
||||
damage /= armor+1
|
||||
|
||||
//blunt objects should really not be embedding in things unless a huge amount of force is involved
|
||||
var/embed_chance = weapon_sharp? damage/I.w_class : damage/(I.w_class*3)
|
||||
var/embed_threshold = weapon_sharp? 5*I.w_class : 15*I.w_class
|
||||
|
||||
//Sharp objects will always embed if they do enough damage.
|
||||
if((weapon_sharp && damage > (10*I.w_class)) || (damage > embed_threshold && prob(embed_chance)))
|
||||
affecting.embed(I)
|
||||
if (I.can_embed)//If this weapon is allowed to embed in people
|
||||
//blunt objects should really not be embedding in things unless a huge amount of force is involved
|
||||
var/embed_chance = weapon_sharp? damage/I.w_class : damage/(I.w_class*3)
|
||||
var/embed_threshold = weapon_sharp? 5*I.w_class : 15*I.w_class
|
||||
|
||||
//Sharp objects will always embed if they do enough damage.
|
||||
if((weapon_sharp && damage > (10*I.w_class)) || (damage > embed_threshold && prob(embed_chance)))
|
||||
affecting.embed(I)
|
||||
return 1
|
||||
|
||||
//this proc handles being hit by a thrown atom
|
||||
|
||||
@@ -28,7 +28,8 @@
|
||||
/obj/item/weapon/scalpel/laser3 = 95, \
|
||||
/obj/item/weapon/scalpel/laser2 = 85, \
|
||||
/obj/item/weapon/scalpel/laser1 = 75, \
|
||||
/obj/item/weapon/melee/energy/sword = 5
|
||||
//Removed energy sword from here. with a 5% chance of success, it's a feature nobody ever used anyway
|
||||
//Energy swords amputate instead now
|
||||
)
|
||||
priority = 2
|
||||
min_duration = 90
|
||||
@@ -283,11 +284,11 @@
|
||||
target.apply_damage(12, BRUTE, affected, sharp=1)
|
||||
|
||||
/datum/surgery_step/generic/cauterize
|
||||
allowed_tools = list(
|
||||
allowed_tools = list(//Fixed these tool probabilities because they were dumb
|
||||
/obj/item/weapon/cautery = 100, \
|
||||
/obj/item/clothing/mask/smokable/cigarette = 75, \
|
||||
/obj/item/clothing/mask/smokable/cigarette = 25, \
|
||||
/obj/item/weapon/flame/lighter = 50, \
|
||||
/obj/item/weapon/weldingtool = 25
|
||||
/obj/item/weapon/weldingtool = 75
|
||||
)
|
||||
|
||||
min_duration = 70
|
||||
@@ -322,7 +323,9 @@
|
||||
/datum/surgery_step/generic/amputate
|
||||
allowed_tools = list(
|
||||
/obj/item/weapon/circular_saw = 100, \
|
||||
/obj/item/weapon/material/hatchet = 75
|
||||
/obj/item/weapon/melee/energy = 100, \
|
||||
/obj/item/weapon/melee/chainsword = 100, \
|
||||
/obj/item/weapon/material/hatchet = 55
|
||||
)
|
||||
|
||||
min_duration = 110
|
||||
@@ -336,20 +339,49 @@
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
if (affected == null)
|
||||
return 0
|
||||
|
||||
if (istype(tool, /obj/item/weapon/melee/energy))
|
||||
var/obj/item/weapon/melee/energy/E = tool
|
||||
if (!E.active)
|
||||
user << "\red The energy blade is not turned on!"
|
||||
return 0
|
||||
|
||||
if (istype(tool, /obj/item/weapon/melee/chainsword))
|
||||
var/obj/item/weapon/melee/chainsword/E = tool
|
||||
if (!E.active)
|
||||
user << "\red The blades aren't spinning, you can't cut anything!"
|
||||
return 0
|
||||
|
||||
return !affected.cannot_amputate
|
||||
|
||||
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] is beginning to amputate [target]'s [affected.name] with \the [tool]." , \
|
||||
"You are beginning to cut through [target]'s [affected.amputation_point] with \the [tool].")
|
||||
user.visible_message("<span class='danger'>[user] is beginning to amputate [target]'s [affected.name] with \the [tool].</span>" , \
|
||||
"<span class='danger'>You begin to cut through [target]'s [affected.amputation_point] with \the [tool].</span>")
|
||||
target.custom_pain("Your [affected.amputation_point] is being ripped apart!",1)
|
||||
..()
|
||||
|
||||
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("\blue [user] amputates [target]'s [affected.name] at the [affected.amputation_point] with \the [tool].", \
|
||||
"\blue You amputate [target]'s [affected.name] with \the [tool].")
|
||||
affected.droplimb(1,DROPLIMB_EDGE)
|
||||
user.visible_message("<span class='danger'>[user] amputates [target]'s [affected.name] at the [affected.amputation_point] with \the [tool].</span>", \
|
||||
"<span class='danger'>You amputate [target]'s [affected.name] with \the [tool].</span>")
|
||||
|
||||
var/clean = 1
|
||||
if (istype(tool, /obj/item/weapon/melee/chainsword))//Chainswords rip and tear, so the limb removal is not clean
|
||||
clean = 0
|
||||
|
||||
var/var/obj/item/organ/external/parent = affected.parent//Cache the parent organ of the limb before we sever it
|
||||
affected.droplimb(clean,DROPLIMB_EDGE)
|
||||
|
||||
if (istype(tool, /obj/item/weapon/melee/energy))//Code for energy weapons cauterising the cut
|
||||
spawn(1)
|
||||
affected = parent
|
||||
affected.open = 0//Close open wounds
|
||||
for (var/datum/wound/lost_limb/W in affected.wounds)
|
||||
W.disinfected = 1//Cleanse the wound of any germs
|
||||
W.autoheal_cutoff = INFINITY//Allow the wound to auto-heal, regardless of damage
|
||||
W.max_bleeding_stage = 0//Stop bleeding
|
||||
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user