mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
Carbon Dismemberment , second attempt. (#20461)
* - I rearranged X_defense.dm mob files, more damage_procs.dm.Here's what's inside: * X_defense.dm: is for the procs of attacks onto the mob, all the XXX_act() proc (things happening to the mob), as well as protection check and get procs (armor, ear prot, projectile dismemberment) * damage_procs.dm: actual damage procs like adjustBruteLoss() getfireloss, any proc that handles damaging. - some bugfixes with gibspawner effects. - monkey's bodyparts can be dismembered and are used to create its icon. - brains are no longer carbons. - all carbon have bodyparts that can be dropped when the mob is gibbed. - adminspawned bodyparts now have a default icon. - robotic parts are now a child of bodyparts. - health analyzer on alien/monkey shows damage on each limb - added admin option to add/remove bodyparts for all carbon (instead of just remove on humans) - Fixes keycheck message spam for janicart and all when trying to move. - Fixes bug with buckling to a scooter while limbless. - removed arg "hit_zone" in proj's on_hit() because we can already use the def_zone var (where hit_zone got its value) - Fixes mob not getting any damage when hit by a projectile on their missing limb, despite a hit message shown). carbon/apply_damage() now when we specify a def_zone and the corresponding BP is missing we default to the chest instead of stopping the proc. Consistently with how human/attacked_by() default to its attack to chest if missing limb. - Fixes mini uzi icon when empty and no mag (typo). - I renamed and changed a bit check_eye_prot and ear prot - renamed flash_eyes to flash_act() - I made a soundbang_act() similar to flash_act but for loud bangs. - added a gib and dust animation to larva. - husked monkeys - no damage overlay for husk or skeleton. - damage overlay for robotic limb now. - no damage overlay when organic bodypart husked. - one handed human with a bloody hand still get a bloody single hand overlay. - fix admin heal being unable to heal robotic bodyparts. - slightly touched robotic bodypart sprites (head one pixel too high) - Fixes 18532 "beheaded husk has hair". - Fixes 18584 "Ling stasis appearance bug" - no more eyes or lipstick on husks. - can remove flashes/wires/cells from robot chest and head with crowbar. - Fixes not being able to surgically amputate robotic arm/leg. * More merge conflict fixes and adding the new files I forgot to add. * of course I forgot birdstation * More typos and stuff I forgot to undo. * Fixing a typo in examine.dm Removing an unnecessary check. Making admin heal regenerate limbs on all carbons. Monkey-human transformation now transfer missing limbs info and presence of a cavity implant. NODISMEMBER species can still lack a limb if the mob lacked a limb and changed into that new species. Changeling Regenerate ability now also regenerate limbs when in monkey form. (and remove some cryptic useless code) * Fixing more conflicts with remie's multihands PR. * Fixes runtime with hud when calling build_hand_slots(). Fixes lightgeist healing not working. Fixes null.handle_fall() runtimes with pirate mobs. Fixes typo in has_left_hadn() and has_right_hand(). * Derp, forgot to remove debug message.
This commit is contained in:
@@ -1,68 +1,19 @@
|
||||
/obj/item/robot_parts
|
||||
name = "robot parts"
|
||||
icon = 'icons/obj/robot_parts.dmi'
|
||||
force = 4
|
||||
throwforce = 4
|
||||
item_state = "buildpipe"
|
||||
icon_state = "blank"
|
||||
flags = CONDUCT
|
||||
slot_flags = SLOT_BELT
|
||||
var/body_zone
|
||||
|
||||
/obj/item/robot_parts/l_arm
|
||||
name = "cyborg left arm"
|
||||
desc = "A skeletal limb wrapped in pseudomuscles, with a low-conductivity case."
|
||||
attack_verb = list("slapped", "punched")
|
||||
icon_state = "l_arm"
|
||||
body_zone = "l_arm"
|
||||
|
||||
/obj/item/robot_parts/r_arm
|
||||
name = "cyborg right arm"
|
||||
desc = "A skeletal limb wrapped in pseudomuscles, with a low-conductivity case."
|
||||
attack_verb = list("slapped", "punched")
|
||||
icon_state = "r_arm"
|
||||
body_zone = "r_arm"
|
||||
//The robot bodyparts have been moved to code/module/surgery/bodyparts/robot_bodyparts.dm
|
||||
|
||||
/obj/item/robot_parts/l_leg
|
||||
name = "cyborg left leg"
|
||||
desc = "A skeletal limb wrapped in pseudomuscles, with a low-conductivity case."
|
||||
attack_verb = list("kicked", "stomped")
|
||||
icon_state = "l_leg"
|
||||
body_zone = "l_leg"
|
||||
|
||||
/obj/item/robot_parts/r_leg
|
||||
name = "cyborg right leg"
|
||||
desc = "A skeletal limb wrapped in pseudomuscles, with a low-conductivity case."
|
||||
attack_verb = list("kicked", "stomped")
|
||||
icon_state = "r_leg"
|
||||
body_zone = "r_leg"
|
||||
|
||||
/obj/item/robot_parts/chest
|
||||
name = "cyborg torso"
|
||||
desc = "A heavily reinforced case containing cyborg logic boards, with space for a standard power cell."
|
||||
icon_state = "chest"
|
||||
body_zone = "chest"
|
||||
var/wired = 0
|
||||
var/obj/item/weapon/stock_parts/cell/cell = null
|
||||
|
||||
/obj/item/robot_parts/head
|
||||
name = "cyborg head"
|
||||
desc = "A standard reinforced braincase, with spine-plugged neural socket and sensor gimbals."
|
||||
icon_state = "head"
|
||||
body_zone = "head"
|
||||
var/obj/item/device/assembly/flash/handheld/flash1 = null
|
||||
var/obj/item/device/assembly/flash/handheld/flash2 = null
|
||||
|
||||
/obj/item/robot_parts/robot_suit
|
||||
/obj/item/robot_suit
|
||||
name = "cyborg endoskeleton"
|
||||
desc = "A complex metal backbone with standard limb sockets and pseudomuscle anchors."
|
||||
icon = 'icons/obj/robot_parts.dmi'
|
||||
icon_state = "robo_suit"
|
||||
var/obj/item/robot_parts/l_arm/l_arm = null
|
||||
var/obj/item/robot_parts/r_arm/r_arm = null
|
||||
var/obj/item/robot_parts/l_leg/l_leg = null
|
||||
var/obj/item/robot_parts/r_leg/r_leg = null
|
||||
var/obj/item/robot_parts/chest/chest = null
|
||||
var/obj/item/robot_parts/head/head = null
|
||||
var/obj/item/bodypart/l_arm/robot/l_arm = null
|
||||
var/obj/item/bodypart/r_arm/robot/r_arm = null
|
||||
var/obj/item/bodypart/l_leg/robot/l_leg = null
|
||||
var/obj/item/bodypart/r_leg/robot/r_leg = null
|
||||
var/obj/item/bodypart/chest/robot/chest = null
|
||||
var/obj/item/bodypart/head/robot/head = null
|
||||
|
||||
var/created_name = ""
|
||||
var/mob/living/silicon/ai/forced_ai
|
||||
@@ -71,11 +22,11 @@
|
||||
var/aisync = 1
|
||||
var/panel_locked = 1
|
||||
|
||||
/obj/item/robot_parts/robot_suit/New()
|
||||
/obj/item/robot_suit/New()
|
||||
..()
|
||||
src.updateicon()
|
||||
|
||||
/obj/item/robot_parts/robot_suit/proc/updateicon()
|
||||
/obj/item/robot_suit/proc/updateicon()
|
||||
src.cut_overlays()
|
||||
if(src.l_arm)
|
||||
src.add_overlay("l_arm+o")
|
||||
@@ -90,7 +41,7 @@
|
||||
if(src.head)
|
||||
src.add_overlay("head+o")
|
||||
|
||||
/obj/item/robot_parts/robot_suit/proc/check_completion()
|
||||
/obj/item/robot_suit/proc/check_completion()
|
||||
if(src.l_arm && src.r_arm)
|
||||
if(src.l_leg && src.r_leg)
|
||||
if(src.chest && src.head)
|
||||
@@ -98,7 +49,7 @@
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/item/robot_parts/robot_suit/attackby(obj/item/W, mob/user, params)
|
||||
/obj/item/robot_suit/attackby(obj/item/W, mob/user, params)
|
||||
|
||||
if(istype(W, /obj/item/stack/sheet/metal))
|
||||
var/obj/item/stack/sheet/metal/M = W
|
||||
@@ -114,64 +65,82 @@
|
||||
else
|
||||
user << "<span class='warning'>You need one sheet of metal to start building ED-209!</span>"
|
||||
return
|
||||
else if(istype(W, /obj/item/robot_parts/l_leg))
|
||||
else if(istype(W, /obj/item/bodypart/l_leg/robot))
|
||||
if(src.l_leg)
|
||||
return
|
||||
if(!user.unEquip(W))
|
||||
return
|
||||
W.loc = src
|
||||
W.forceMove(src)
|
||||
W.icon_state = initial(W.icon_state)
|
||||
W.cut_overlays()
|
||||
src.l_leg = W
|
||||
src.updateicon()
|
||||
|
||||
else if(istype(W, /obj/item/robot_parts/r_leg))
|
||||
else if(istype(W, /obj/item/bodypart/r_leg/robot))
|
||||
if(src.r_leg)
|
||||
return
|
||||
if(!user.unEquip(W))
|
||||
return
|
||||
W.loc = src
|
||||
W.forceMove(src)
|
||||
W.icon_state = initial(W.icon_state)
|
||||
W.cut_overlays()
|
||||
src.r_leg = W
|
||||
src.updateicon()
|
||||
|
||||
else if(istype(W, /obj/item/robot_parts/l_arm))
|
||||
else if(istype(W, /obj/item/bodypart/l_arm/robot))
|
||||
if(src.l_arm)
|
||||
return
|
||||
if(!user.unEquip(W))
|
||||
return
|
||||
W.loc = src
|
||||
W.forceMove(src)
|
||||
W.icon_state = initial(W.icon_state)
|
||||
W.cut_overlays()
|
||||
src.l_arm = W
|
||||
src.updateicon()
|
||||
|
||||
else if(istype(W, /obj/item/robot_parts/r_arm))
|
||||
else if(istype(W, /obj/item/bodypart/r_arm/robot))
|
||||
if(src.r_arm)
|
||||
return
|
||||
if(!user.unEquip(W))
|
||||
return
|
||||
W.loc = src
|
||||
W.forceMove(src)
|
||||
W.icon_state = initial(W.icon_state)//in case it is a dismembered robotic limb
|
||||
W.cut_overlays()
|
||||
src.r_arm = W
|
||||
src.updateicon()
|
||||
|
||||
else if(istype(W, /obj/item/robot_parts/chest))
|
||||
else if(istype(W, /obj/item/bodypart/chest/robot))
|
||||
var/obj/item/bodypart/chest/robot/CH = W
|
||||
if(src.chest)
|
||||
return
|
||||
if(W:wired && W:cell)
|
||||
if(!user.unEquip(W))
|
||||
if(CH.wired && CH.cell)
|
||||
if(!user.unEquip(CH))
|
||||
return
|
||||
W.loc = src
|
||||
src.chest = W
|
||||
CH.forceMove(src)
|
||||
CH.icon_state = initial(CH.icon_state) //in case it is a dismembered robotic limb
|
||||
CH.cut_overlays()
|
||||
src.chest = CH
|
||||
src.updateicon()
|
||||
else if(!W:wired)
|
||||
else if(!CH.wired)
|
||||
user << "<span class='warning'>You need to attach wires to it first!</span>"
|
||||
else
|
||||
user << "<span class='warning'>You need to attach a cell to it first!</span>"
|
||||
|
||||
else if(istype(W, /obj/item/robot_parts/head))
|
||||
else if(istype(W, /obj/item/bodypart/head/robot))
|
||||
var/obj/item/bodypart/head/robot/HD = W
|
||||
for(var/X in HD.contents)
|
||||
if(istype(X, /obj/item/organ))
|
||||
user << "<span class='warning'>There are organs inside [HD]!</span>"
|
||||
return
|
||||
if(src.head)
|
||||
return
|
||||
if(W:flash2 && W:flash1)
|
||||
if(!user.unEquip(W))
|
||||
if(HD.flash2 && HD.flash1)
|
||||
if(!user.unEquip(HD))
|
||||
return
|
||||
W.loc = src
|
||||
src.head = W
|
||||
HD.loc = src
|
||||
HD.icon_state = initial(HD.icon_state)//in case it is a dismembered robotic limb
|
||||
HD.cut_overlays()
|
||||
src.head = HD
|
||||
src.updateicon()
|
||||
else
|
||||
user << "<span class='warning'>You need to attach a flash to it first!</span>"
|
||||
@@ -192,7 +161,7 @@
|
||||
user << "<span class='warning'>Sticking an empty MMI into the frame would sort of defeat the purpose!</span>"
|
||||
return
|
||||
|
||||
var/mob/living/carbon/brain/BM = M.brainmob
|
||||
var/mob/living/brain/BM = M.brainmob
|
||||
if(!BM.key || !BM.mind)
|
||||
user << "<span class='warning'>The mmi indicates that their mind is completely unresponsive; there's no point!</span>"
|
||||
return
|
||||
@@ -283,7 +252,7 @@
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/robot_parts/robot_suit/proc/Interact(mob/user)
|
||||
/obj/item/robot_suit/proc/Interact(mob/user)
|
||||
var/t1 = text("Designation: <A href='?src=\ref[];Name=1'>[(created_name ? "[created_name]" : "Default Cyborg")]</a><br>\n",src)
|
||||
t1 += text("Master AI: <A href='?src=\ref[];Master=1'>[(forced_ai ? "[forced_ai.name]" : "Automatic")]</a><br><br>\n",src)
|
||||
|
||||
@@ -295,8 +264,8 @@
|
||||
popup.set_content(t1)
|
||||
popup.open()
|
||||
|
||||
/obj/item/robot_parts/robot_suit/Topic(href, href_list)
|
||||
if(usr.lying || usr.stat || usr.stunned || !Adjacent(usr))
|
||||
/obj/item/robot_suit/Topic(href, href_list)
|
||||
if(usr.incapacitated() || !Adjacent(usr))
|
||||
return
|
||||
|
||||
var/mob/living/living_user = usr
|
||||
@@ -330,50 +299,4 @@
|
||||
|
||||
add_fingerprint(usr)
|
||||
Interact(usr)
|
||||
return
|
||||
|
||||
/obj/item/robot_parts/chest/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/weapon/stock_parts/cell))
|
||||
if(src.cell)
|
||||
user << "<span class='warning'>You have already inserted a cell!</span>"
|
||||
return
|
||||
else
|
||||
if(!user.unEquip(W))
|
||||
return
|
||||
W.loc = src
|
||||
src.cell = W
|
||||
user << "<span class='notice'>You insert the cell.</span>"
|
||||
else if(istype(W, /obj/item/stack/cable_coil))
|
||||
if(src.wired)
|
||||
user << "<span class='warning'>You have already inserted wire!</span>"
|
||||
return
|
||||
var/obj/item/stack/cable_coil/coil = W
|
||||
if (coil.use(1))
|
||||
src.wired = 1
|
||||
user << "<span class='notice'>You insert the wire.</span>"
|
||||
else
|
||||
user << "<span class='warning'>You need one length of coil to wire it!</span>"
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/robot_parts/head/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/device/assembly/flash/handheld))
|
||||
var/obj/item/device/assembly/flash/handheld/F = W
|
||||
if(src.flash1 && src.flash2)
|
||||
user << "<span class='warning'>You have already inserted the eyes!</span>"
|
||||
return
|
||||
else if(F.crit_fail)
|
||||
user << "<span class='warning'>You can't use a broken flash!</span>"
|
||||
return
|
||||
else
|
||||
if(!user.unEquip(W))
|
||||
return
|
||||
F.loc = src
|
||||
if(src.flash1)
|
||||
src.flash2 = F
|
||||
else
|
||||
src.flash1 = F
|
||||
user << "<span class='notice'>You insert the flash into the eye socket.</span>"
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user