mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-21 12:08:55 +01: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:
@@ -137,13 +137,14 @@
|
||||
retal = 1
|
||||
retal_target = user
|
||||
|
||||
/mob/living/carbon/human/interactive/bullet_act(var/obj/item/projectile/P)
|
||||
/mob/living/carbon/human/interactive/bullet_act(obj/item/projectile/P, def_zone)
|
||||
var/potentialAssault = locate(/mob/living) in view(2,P.starting)
|
||||
if(potentialAssault)
|
||||
retal = 1
|
||||
retal_target = potentialAssault
|
||||
..()
|
||||
|
||||
|
||||
/client/proc/resetSNPC(var/mob/A in SSnpc.botPool_l)
|
||||
set name = "Reset SNPC"
|
||||
set desc = "Reset the SNPC"
|
||||
@@ -296,9 +297,9 @@
|
||||
for(var/X in bodyparts)
|
||||
var/obj/item/bodypart/BP = X
|
||||
if(prob((FUZZY_CHANCE_LOW+FUZZY_CHANCE_HIGH)/4))
|
||||
BP.change_bodypart_status(ORGAN_ROBOTIC)
|
||||
BP.change_bodypart_status(BODYPART_ROBOTIC)
|
||||
update_icons()
|
||||
update_damage_overlays(0)
|
||||
update_damage_overlays()
|
||||
functions = list("nearbyscan","combat","shitcurity","chatter") // stop customize adding multiple copies of a function
|
||||
//job specific favours
|
||||
switch(myjob.title)
|
||||
@@ -422,10 +423,6 @@
|
||||
if(C)
|
||||
retalTarget(C)
|
||||
|
||||
/mob/living/carbon/human/interactive/bullet_act(obj/item/projectile/P, def_zone)
|
||||
..(P,def_zone)
|
||||
retalTarget(P.firer)
|
||||
|
||||
/mob/living/carbon/human/interactive/attack_hand(mob/living/carbon/human/M)
|
||||
..(M)
|
||||
retalTarget(M)
|
||||
|
||||
+197
-198
@@ -1,198 +1,197 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
|
||||
|
||||
/obj/item/device/mmi
|
||||
name = "Man-Machine Interface"
|
||||
desc = "The Warrior's bland acronym, MMI, obscures the true horror of this monstrosity, that nevertheless has become standard-issue on Nanotrasen stations."
|
||||
icon = 'icons/obj/assemblies.dmi'
|
||||
icon_state = "mmi_empty"
|
||||
w_class = 3
|
||||
origin_tech = "biotech=2;programming=3;engineering=2"
|
||||
var/braintype = "Cyborg"
|
||||
var/obj/item/device/radio/radio = null //Let's give it a radio.
|
||||
var/hacked = 0 //Whether or not this is a Syndicate MMI
|
||||
var/mob/living/carbon/brain/brainmob = null //The current occupant.
|
||||
var/mob/living/silicon/robot = null //Appears unused.
|
||||
var/obj/mecha = null //This does not appear to be used outside of reference in mecha.dm.
|
||||
var/obj/item/organ/brain/brain = null //The actual brain
|
||||
var/clockwork = FALSE //If this is a soul vessel
|
||||
|
||||
/obj/item/device/mmi/update_icon()
|
||||
if(brain)
|
||||
if(istype(brain,/obj/item/organ/brain/alien))
|
||||
if(brainmob && brainmob.stat == DEAD)
|
||||
icon_state = "mmi_alien_dead"
|
||||
else
|
||||
icon_state = "mmi_alien"
|
||||
braintype = "Xenoborg" //HISS....Beep.
|
||||
else
|
||||
if(brainmob && brainmob.stat == DEAD)
|
||||
icon_state = "mmi_dead"
|
||||
else
|
||||
icon_state = "mmi_full"
|
||||
braintype = "Cyborg"
|
||||
else
|
||||
icon_state = "mmi_empty"
|
||||
|
||||
/obj/item/device/mmi/New()
|
||||
..()
|
||||
radio = new(src) //Spawns a radio inside the MMI.
|
||||
radio.broadcasting = 0 //researching radio mmis turned the robofabs into radios because this didnt start as 0.
|
||||
|
||||
|
||||
|
||||
/obj/item/device/mmi/attackby(obj/item/O, mob/user, params)
|
||||
user.changeNext_move(CLICK_CD_MELEE)
|
||||
if(istype(O,/obj/item/organ/brain)) //Time to stick a brain in it --NEO
|
||||
var/obj/item/organ/brain/newbrain = O
|
||||
if(brain)
|
||||
user << "<span class='warning'>There's already a brain in the MMI!</span>"
|
||||
return
|
||||
if(!newbrain.brainmob)
|
||||
user << "<span class='warning'>You aren't sure where this brain came from, but you're pretty sure it's a useless brain!</span>"
|
||||
return
|
||||
|
||||
if(!user.unEquip(O))
|
||||
return
|
||||
var/mob/living/carbon/brain/B = newbrain.brainmob
|
||||
if(!B.key)
|
||||
B.notify_ghost_cloning("Someone has put your brain in a MMI!", source = src)
|
||||
visible_message("[user] sticks \a [newbrain] into \the [src].")
|
||||
|
||||
brainmob = newbrain.brainmob
|
||||
newbrain.brainmob = null
|
||||
brainmob.loc = src
|
||||
brainmob.container = src
|
||||
if(!newbrain.damaged_brain) // the brain organ hasn't been beaten to death.
|
||||
brainmob.stat = CONSCIOUS //we manually revive the brain mob
|
||||
dead_mob_list -= brainmob
|
||||
living_mob_list += brainmob
|
||||
|
||||
brainmob.reset_perspective()
|
||||
if(clockwork)
|
||||
add_servant_of_ratvar(brainmob, TRUE)
|
||||
newbrain.loc = src //P-put your brain in it
|
||||
brain = newbrain
|
||||
|
||||
name = "Man-Machine Interface: [brainmob.real_name]"
|
||||
update_icon()
|
||||
|
||||
feedback_inc("cyborg_mmis_filled",1)
|
||||
|
||||
return
|
||||
|
||||
else if(brainmob)
|
||||
O.attack(brainmob, user) //Oh noooeeeee
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/device/mmi/attack_self(mob/user)
|
||||
if(!brain)
|
||||
radio.on = !radio.on
|
||||
user << "<span class='notice'>You toggle the MMI's radio system [radio.on==1 ? "on" : "off"].</span>"
|
||||
else
|
||||
user << "<span class='notice'>You unlock and upend the MMI, spilling the brain onto the floor.</span>"
|
||||
|
||||
brainmob.container = null //Reset brainmob mmi var.
|
||||
brainmob.loc = brain //Throw mob into brain.
|
||||
brainmob.stat = DEAD
|
||||
brainmob.emp_damage = 0
|
||||
brainmob.reset_perspective() //so the brainmob follows the brain organ instead of the mmi. And to update our vision
|
||||
living_mob_list -= brainmob //Get outta here
|
||||
dead_mob_list += brainmob
|
||||
brain.brainmob = brainmob //Set the brain to use the brainmob
|
||||
brainmob = null //Set mmi brainmob var to null
|
||||
|
||||
user.put_in_hands(brain) //puts brain in the user's hand or otherwise drops it on the user's turf
|
||||
brain = null //No more brain in here
|
||||
|
||||
update_icon()
|
||||
name = "Man-Machine Interface"
|
||||
|
||||
/obj/item/device/mmi/proc/transfer_identity(mob/living/L) //Same deal as the regular brain proc. Used for human-->robot people.
|
||||
if(!brainmob)
|
||||
brainmob = new(src)
|
||||
brainmob.name = L.real_name
|
||||
brainmob.real_name = L.real_name
|
||||
if(L.has_dna())
|
||||
var/mob/living/carbon/C = L
|
||||
if(!brainmob.dna)
|
||||
brainmob.dna = new /datum/dna(brainmob)
|
||||
C.dna.copy_dna(brainmob.dna)
|
||||
brainmob.container = src
|
||||
|
||||
if(ishuman(L))
|
||||
var/mob/living/carbon/human/H = L
|
||||
var/obj/item/organ/brain/newbrain = H.getorgan(/obj/item/organ/brain)
|
||||
newbrain.loc = src
|
||||
brain = newbrain
|
||||
else if(!brain)
|
||||
brain = new(src)
|
||||
brain.name = "[L.real_name]'s brain"
|
||||
|
||||
name = "Man-Machine Interface: [brainmob.real_name]"
|
||||
update_icon()
|
||||
return
|
||||
|
||||
|
||||
/obj/item/device/mmi/verb/Toggle_Listening()
|
||||
set name = "Toggle Listening"
|
||||
set desc = "Toggle listening channel on or off."
|
||||
set category = "MMI"
|
||||
set src = usr.loc
|
||||
set popup_menu = 0
|
||||
|
||||
if(brainmob.stat)
|
||||
brainmob << "<span class='warning'>Can't do that while incapacitated or dead!</span>"
|
||||
if(!radio.on)
|
||||
brainmob << "<span class='warning'>Your radio is disabled!</span>"
|
||||
return
|
||||
|
||||
radio.listening = radio.listening==1 ? 0 : 1
|
||||
brainmob << "<span class='notice'>Radio is [radio.listening==1 ? "now" : "no longer"] receiving broadcast.</span>"
|
||||
|
||||
/obj/item/device/mmi/emp_act(severity)
|
||||
if(!brainmob)
|
||||
return
|
||||
else
|
||||
switch(severity)
|
||||
if(1)
|
||||
brainmob.emp_damage = min(brainmob.emp_damage + rand(20,30), 30)
|
||||
if(2)
|
||||
brainmob.emp_damage = min(brainmob.emp_damage + rand(10,20), 30)
|
||||
if(3)
|
||||
brainmob.emp_damage = min(brainmob.emp_damage + rand(0,10), 30)
|
||||
brainmob.emote("alarm")
|
||||
..()
|
||||
|
||||
/obj/item/device/mmi/Destroy()
|
||||
if(isrobot(loc))
|
||||
var/mob/living/silicon/robot/borg = loc
|
||||
borg.mmi = null
|
||||
if(brainmob)
|
||||
qdel(brainmob)
|
||||
brainmob = null
|
||||
return ..()
|
||||
|
||||
/obj/item/device/mmi/examine(mob/user)
|
||||
..()
|
||||
if(brainmob)
|
||||
var/mob/living/carbon/brain/B = brainmob
|
||||
if(!B.key || !B.mind || B.stat == DEAD)
|
||||
user << "<span class='warning'>The MMI indicates the brain is completely unresponsive.</span>"
|
||||
|
||||
else if(!B.client)
|
||||
user << "<span class='warning'>The MMI indicates the brain is currently inactive; it might change.</span>"
|
||||
|
||||
else
|
||||
user << "<span class='notice'>The MMI indicates the brain is active.</span>"
|
||||
|
||||
|
||||
/obj/item/device/mmi/syndie
|
||||
name = "Syndicate Man-Machine Interface"
|
||||
desc = "Syndicate's own brand of MMI. It enforces laws designed to help Syndicate agents achieve their goals upon cyborgs created with it, but doesn't fit in Nanotrasen AI cores."
|
||||
origin_tech = "biotech=4;programming=4;syndicate=2"
|
||||
hacked = 1
|
||||
|
||||
/obj/item/device/mmi/syndie/New()
|
||||
..()
|
||||
radio.on = 0
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
|
||||
|
||||
/obj/item/device/mmi
|
||||
name = "Man-Machine Interface"
|
||||
desc = "The Warrior's bland acronym, MMI, obscures the true horror of this monstrosity, that nevertheless has become standard-issue on Nanotrasen stations."
|
||||
icon = 'icons/obj/assemblies.dmi'
|
||||
icon_state = "mmi_empty"
|
||||
w_class = 3
|
||||
origin_tech = "biotech=2;programming=3;engineering=2"
|
||||
var/braintype = "Cyborg"
|
||||
var/obj/item/device/radio/radio = null //Let's give it a radio.
|
||||
var/hacked = 0 //Whether or not this is a Syndicate MMI
|
||||
var/mob/living/brain/brainmob = null //The current occupant.
|
||||
var/mob/living/silicon/robot = null //Appears unused.
|
||||
var/obj/mecha = null //This does not appear to be used outside of reference in mecha.dm.
|
||||
var/obj/item/organ/brain/brain = null //The actual brain
|
||||
var/clockwork = FALSE //If this is a soul vessel
|
||||
|
||||
/obj/item/device/mmi/update_icon()
|
||||
if(brain)
|
||||
if(istype(brain,/obj/item/organ/brain/alien))
|
||||
if(brainmob && brainmob.stat == DEAD)
|
||||
icon_state = "mmi_alien_dead"
|
||||
else
|
||||
icon_state = "mmi_alien"
|
||||
braintype = "Xenoborg" //HISS....Beep.
|
||||
else
|
||||
if(brainmob && brainmob.stat == DEAD)
|
||||
icon_state = "mmi_dead"
|
||||
else
|
||||
icon_state = "mmi_full"
|
||||
braintype = "Cyborg"
|
||||
else
|
||||
icon_state = "mmi_empty"
|
||||
|
||||
/obj/item/device/mmi/New()
|
||||
..()
|
||||
radio = new(src) //Spawns a radio inside the MMI.
|
||||
radio.broadcasting = 0 //researching radio mmis turned the robofabs into radios because this didnt start as 0.
|
||||
|
||||
|
||||
|
||||
/obj/item/device/mmi/attackby(obj/item/O, mob/user, params)
|
||||
user.changeNext_move(CLICK_CD_MELEE)
|
||||
if(istype(O,/obj/item/organ/brain)) //Time to stick a brain in it --NEO
|
||||
var/obj/item/organ/brain/newbrain = O
|
||||
if(brain)
|
||||
user << "<span class='warning'>There's already a brain in the MMI!</span>"
|
||||
return
|
||||
if(!newbrain.brainmob)
|
||||
user << "<span class='warning'>You aren't sure where this brain came from, but you're pretty sure it's a useless brain!</span>"
|
||||
return
|
||||
|
||||
if(!user.unEquip(O))
|
||||
return
|
||||
var/mob/living/brain/B = newbrain.brainmob
|
||||
if(!B.key)
|
||||
B.notify_ghost_cloning("Someone has put your brain in a MMI!", source = src)
|
||||
visible_message("[user] sticks \a [newbrain] into \the [src].")
|
||||
|
||||
brainmob = newbrain.brainmob
|
||||
newbrain.brainmob = null
|
||||
brainmob.loc = src
|
||||
brainmob.container = src
|
||||
if(!newbrain.damaged_brain) // the brain organ hasn't been beaten to death.
|
||||
brainmob.stat = CONSCIOUS //we manually revive the brain mob
|
||||
dead_mob_list -= brainmob
|
||||
living_mob_list += brainmob
|
||||
|
||||
brainmob.reset_perspective()
|
||||
if(clockwork)
|
||||
add_servant_of_ratvar(brainmob, TRUE)
|
||||
newbrain.loc = src //P-put your brain in it
|
||||
brain = newbrain
|
||||
|
||||
name = "Man-Machine Interface: [brainmob.real_name]"
|
||||
update_icon()
|
||||
|
||||
feedback_inc("cyborg_mmis_filled",1)
|
||||
|
||||
else if(brainmob)
|
||||
O.attack(brainmob, user) //Oh noooeeeee
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/item/device/mmi/attack_self(mob/user)
|
||||
if(!brain)
|
||||
radio.on = !radio.on
|
||||
user << "<span class='notice'>You toggle the MMI's radio system [radio.on==1 ? "on" : "off"].</span>"
|
||||
else
|
||||
user << "<span class='notice'>You unlock and upend the MMI, spilling the brain onto the floor.</span>"
|
||||
|
||||
brainmob.container = null //Reset brainmob mmi var.
|
||||
brainmob.loc = brain //Throw mob into brain.
|
||||
brainmob.stat = DEAD
|
||||
brainmob.emp_damage = 0
|
||||
brainmob.reset_perspective() //so the brainmob follows the brain organ instead of the mmi. And to update our vision
|
||||
living_mob_list -= brainmob //Get outta here
|
||||
dead_mob_list += brainmob
|
||||
brain.brainmob = brainmob //Set the brain to use the brainmob
|
||||
brainmob = null //Set mmi brainmob var to null
|
||||
|
||||
user.put_in_hands(brain) //puts brain in the user's hand or otherwise drops it on the user's turf
|
||||
brain = null //No more brain in here
|
||||
|
||||
update_icon()
|
||||
name = "Man-Machine Interface"
|
||||
|
||||
/obj/item/device/mmi/proc/transfer_identity(mob/living/L) //Same deal as the regular brain proc. Used for human-->robot people.
|
||||
if(!brainmob)
|
||||
brainmob = new(src)
|
||||
brainmob.name = L.real_name
|
||||
brainmob.real_name = L.real_name
|
||||
if(L.has_dna())
|
||||
var/mob/living/carbon/C = L
|
||||
if(!brainmob.stored_dna)
|
||||
brainmob.stored_dna = new /datum/dna/stored(brainmob)
|
||||
C.dna.copy_dna(brainmob.stored_dna)
|
||||
brainmob.container = src
|
||||
|
||||
if(ishuman(L))
|
||||
var/mob/living/carbon/human/H = L
|
||||
var/obj/item/organ/brain/newbrain = H.getorgan(/obj/item/organ/brain)
|
||||
newbrain.loc = src
|
||||
brain = newbrain
|
||||
else if(!brain)
|
||||
brain = new(src)
|
||||
brain.name = "[L.real_name]'s brain"
|
||||
|
||||
name = "Man-Machine Interface: [brainmob.real_name]"
|
||||
update_icon()
|
||||
return
|
||||
|
||||
|
||||
/obj/item/device/mmi/verb/Toggle_Listening()
|
||||
set name = "Toggle Listening"
|
||||
set desc = "Toggle listening channel on or off."
|
||||
set category = "MMI"
|
||||
set src = usr.loc
|
||||
set popup_menu = 0
|
||||
|
||||
if(brainmob.stat)
|
||||
brainmob << "<span class='warning'>Can't do that while incapacitated or dead!</span>"
|
||||
if(!radio.on)
|
||||
brainmob << "<span class='warning'>Your radio is disabled!</span>"
|
||||
return
|
||||
|
||||
radio.listening = radio.listening==1 ? 0 : 1
|
||||
brainmob << "<span class='notice'>Radio is [radio.listening==1 ? "now" : "no longer"] receiving broadcast.</span>"
|
||||
|
||||
/obj/item/device/mmi/emp_act(severity)
|
||||
if(!brainmob)
|
||||
return
|
||||
else
|
||||
switch(severity)
|
||||
if(1)
|
||||
brainmob.emp_damage = min(brainmob.emp_damage + rand(20,30), 30)
|
||||
if(2)
|
||||
brainmob.emp_damage = min(brainmob.emp_damage + rand(10,20), 30)
|
||||
if(3)
|
||||
brainmob.emp_damage = min(brainmob.emp_damage + rand(0,10), 30)
|
||||
brainmob.emote("alarm")
|
||||
..()
|
||||
|
||||
/obj/item/device/mmi/Destroy()
|
||||
if(isrobot(loc))
|
||||
var/mob/living/silicon/robot/borg = loc
|
||||
borg.mmi = null
|
||||
if(brainmob)
|
||||
qdel(brainmob)
|
||||
brainmob = null
|
||||
return ..()
|
||||
|
||||
/obj/item/device/mmi/examine(mob/user)
|
||||
..()
|
||||
if(brainmob)
|
||||
var/mob/living/brain/B = brainmob
|
||||
if(!B.key || !B.mind || B.stat == DEAD)
|
||||
user << "<span class='warning'>The MMI indicates the brain is completely unresponsive.</span>"
|
||||
|
||||
else if(!B.client)
|
||||
user << "<span class='warning'>The MMI indicates the brain is currently inactive; it might change.</span>"
|
||||
|
||||
else
|
||||
user << "<span class='notice'>The MMI indicates the brain is active.</span>"
|
||||
|
||||
|
||||
/obj/item/device/mmi/syndie
|
||||
name = "Syndicate Man-Machine Interface"
|
||||
desc = "Syndicate's own brand of MMI. It enforces laws designed to help Syndicate agents achieve their goals upon cyborgs created with it, but doesn't fit in Nanotrasen AI cores."
|
||||
origin_tech = "biotech=4;programming=4;syndicate=2"
|
||||
hacked = 1
|
||||
|
||||
/obj/item/device/mmi/syndie/New()
|
||||
..()
|
||||
radio.on = 0
|
||||
+67
-63
@@ -1,63 +1,67 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
|
||||
|
||||
/mob/living/carbon/brain
|
||||
languages_spoken = HUMAN
|
||||
languages_understood = HUMAN
|
||||
var/obj/item/device/mmi/container = null
|
||||
var/timeofhostdeath = 0
|
||||
var/emp_damage = 0//Handles a type of MMI damage
|
||||
has_limbs = 0
|
||||
stat = DEAD //we start dead by default
|
||||
see_invisible = SEE_INVISIBLE_MINIMUM
|
||||
|
||||
/mob/living/carbon/brain/New(loc)
|
||||
..()
|
||||
if(isturf(loc)) //not spawned in an MMI or brain organ (most likely adminspawned)
|
||||
var/obj/item/organ/brain/OB = new(loc) //we create a new brain organ for it.
|
||||
src.loc = OB
|
||||
OB.brainmob = src
|
||||
|
||||
|
||||
/mob/living/carbon/brain/Destroy()
|
||||
if(key) //If there is a mob connected to this thing. Have to check key twice to avoid false death reporting.
|
||||
if(stat!=DEAD) //If not dead.
|
||||
death(1) //Brains can die again. AND THEY SHOULD AHA HA HA HA HA HA
|
||||
ghostize() //Ghostize checks for key so nothing else is necessary.
|
||||
container = null
|
||||
return ..()
|
||||
|
||||
/mob/living/carbon/brain/update_canmove()
|
||||
if(in_contents_of(/obj/mecha))
|
||||
canmove = 1
|
||||
else
|
||||
canmove = 0
|
||||
return canmove
|
||||
|
||||
/mob/living/carbon/brain/toggle_throw_mode()
|
||||
return
|
||||
|
||||
/mob/living/carbon/brain/ex_act() //you cant blow up brainmobs because it makes transfer_to() freak out when borgs blow up.
|
||||
return
|
||||
|
||||
/mob/living/carbon/brain/blob_act(obj/effect/blob/B)
|
||||
return
|
||||
|
||||
/mob/living/carbon/brain/UnarmedAttack(atom/A)//Stops runtimes due to attack_animal being the default
|
||||
return
|
||||
|
||||
/mob/living/carbon/brain/check_ear_prot()
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/brain/flash_eyes(intensity = 1, override_blindness_check = 0, affect_silicon = 0)
|
||||
return // no eyes, no flashing
|
||||
|
||||
/mob/living/carbon/brain/update_damage_hud()
|
||||
return //no red circles for brain
|
||||
|
||||
/mob/living/carbon/brain/can_be_revived()
|
||||
. = 1
|
||||
if(!container || health <= HEALTH_THRESHOLD_DEAD)
|
||||
return 0
|
||||
|
||||
/mob/living/carbon/brain/update_sight()
|
||||
return
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
|
||||
|
||||
/mob/living/brain
|
||||
languages_spoken = HUMAN
|
||||
languages_understood = HUMAN
|
||||
var/obj/item/device/mmi/container = null
|
||||
var/timeofhostdeath = 0
|
||||
var/emp_damage = 0//Handles a type of MMI damage
|
||||
var/datum/dna/stored/stored_dna // dna var for brain. Used to store dna, brain dna is not considered like actual dna, brain.has_dna() returns FALSE.
|
||||
stat = DEAD //we start dead by default
|
||||
see_invisible = SEE_INVISIBLE_MINIMUM
|
||||
|
||||
/mob/living/brain/New(loc)
|
||||
..()
|
||||
create_dna(src)
|
||||
stored_dna.initialize_dna(random_blood_type())
|
||||
if(isturf(loc)) //not spawned in an MMI or brain organ (most likely adminspawned)
|
||||
var/obj/item/organ/brain/OB = new(loc) //we create a new brain organ for it.
|
||||
src.loc = OB
|
||||
OB.brainmob = src
|
||||
|
||||
|
||||
/mob/living/brain/proc/create_dna()
|
||||
stored_dna = new /datum/dna/stored(src)
|
||||
if(!stored_dna.species)
|
||||
var/rando_race = pick(config.roundstart_races)
|
||||
stored_dna.species = new rando_race()
|
||||
|
||||
/mob/living/brain/Destroy()
|
||||
if(key) //If there is a mob connected to this thing. Have to check key twice to avoid false death reporting.
|
||||
if(stat!=DEAD) //If not dead.
|
||||
death(1) //Brains can die again. AND THEY SHOULD AHA HA HA HA HA HA
|
||||
ghostize() //Ghostize checks for key so nothing else is necessary.
|
||||
container = null
|
||||
return ..()
|
||||
|
||||
/mob/living/brain/update_canmove()
|
||||
if(in_contents_of(/obj/mecha))
|
||||
canmove = 1
|
||||
else
|
||||
canmove = 0
|
||||
return canmove
|
||||
|
||||
/mob/living/brain/ex_act() //you cant blow up brainmobs because it makes transfer_to() freak out when borgs blow up.
|
||||
return
|
||||
|
||||
/mob/living/brain/blob_act(obj/effect/blob/B)
|
||||
return
|
||||
|
||||
/mob/living/brain/get_eye_protection()//no eyes
|
||||
return 2
|
||||
|
||||
/mob/living/brain/get_ear_protection()//no ears
|
||||
return 2
|
||||
|
||||
/mob/living/brain/flash_act(intensity = 1, override_blindness_check = 0, affect_silicon = 0)
|
||||
return // no eyes, no flashing
|
||||
|
||||
/mob/living/brain/can_be_revived()
|
||||
. = 1
|
||||
if(!container || health <= HEALTH_THRESHOLD_DEAD)
|
||||
return 0
|
||||
|
||||
/mob/living/brain/fully_replace_character_name(oldname,newname)
|
||||
..()
|
||||
if(stored_dna)
|
||||
stored_dna.real_name = real_name
|
||||
+122
-127
@@ -1,127 +1,122 @@
|
||||
/obj/item/organ/brain
|
||||
name = "brain"
|
||||
desc = "A piece of juicy meat found in a person's head."
|
||||
icon_state = "brain"
|
||||
throw_speed = 3
|
||||
throw_range = 5
|
||||
layer = ABOVE_MOB_LAYER
|
||||
zone = "head"
|
||||
slot = "brain"
|
||||
vital = 1
|
||||
origin_tech = "biotech=5"
|
||||
attack_verb = list("attacked", "slapped", "whacked")
|
||||
var/mob/living/carbon/brain/brainmob = null
|
||||
var/damaged_brain = 0 //whether the brain organ is damaged.
|
||||
|
||||
/obj/item/organ/brain/Insert(mob/living/carbon/M, special = 0)
|
||||
..()
|
||||
name = "brain"
|
||||
if(brainmob)
|
||||
if(M.key)
|
||||
M.ghostize()
|
||||
|
||||
if(brainmob.mind)
|
||||
brainmob.mind.transfer_to(M)
|
||||
else
|
||||
M.key = brainmob.key
|
||||
|
||||
qdel(brainmob)
|
||||
|
||||
//Update the body's icon so it doesnt appear debrained anymore
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
H.update_hair(0)
|
||||
|
||||
/obj/item/organ/brain/Remove(mob/living/carbon/M, special = 0)
|
||||
..()
|
||||
if(!special)
|
||||
transfer_identity(M)
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
H.update_hair(0)
|
||||
|
||||
/obj/item/organ/brain/prepare_eat()
|
||||
return // Too important to eat.
|
||||
|
||||
/obj/item/organ/brain/proc/transfer_identity(mob/living/L)
|
||||
name = "[L.name]'s brain"
|
||||
brainmob = new(src)
|
||||
brainmob.name = L.real_name
|
||||
brainmob.real_name = L.real_name
|
||||
brainmob.timeofhostdeath = L.timeofdeath
|
||||
if(L.has_dna())
|
||||
var/mob/living/carbon/C = L
|
||||
if(!brainmob.dna)
|
||||
brainmob.dna = new /datum/dna(brainmob)
|
||||
C.dna.copy_dna(brainmob.dna)
|
||||
if(L.mind && L.mind.current && (L.mind.current.stat == DEAD))
|
||||
L.mind.transfer_to(brainmob)
|
||||
brainmob << "<span class='notice'>You feel slightly disoriented. That's normal when you're just a brain.</span>"
|
||||
|
||||
/obj/item/organ/brain/attackby(obj/item/O, mob/user, params)
|
||||
user.changeNext_move(CLICK_CD_MELEE)
|
||||
if(brainmob)
|
||||
O.attack(brainmob, user) //Oh noooeeeee
|
||||
|
||||
/obj/item/organ/brain/examine(mob/user)
|
||||
..()
|
||||
|
||||
if(brainmob)
|
||||
if(brainmob.client)
|
||||
if(brainmob.health <= HEALTH_THRESHOLD_DEAD)
|
||||
user << "It's lifeless and severely damaged."
|
||||
else
|
||||
user << "You can feel the small spark of life still left in this one."
|
||||
else
|
||||
user << "This one seems particularly lifeless. Perhaps it will regain some of its luster later."
|
||||
else
|
||||
user << "This one is completely devoid of life."
|
||||
|
||||
/obj/item/organ/brain/attack(mob/living/carbon/M, mob/user)
|
||||
if(!istype(M))
|
||||
return ..()
|
||||
|
||||
add_fingerprint(user)
|
||||
|
||||
if(user.zone_selected != "head")
|
||||
return ..()
|
||||
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(istype(H) && ((H.head && H.head.flags_cover & HEADCOVERSEYES) || (H.wear_mask && H.wear_mask.flags_cover & MASKCOVERSEYES) || (H.glasses && H.glasses.flags & GLASSESCOVERSEYES)))
|
||||
user << "<span class='warning'>You're going to need to remove their head cover first!</span>"
|
||||
return
|
||||
|
||||
//since these people will be dead M != usr
|
||||
|
||||
if(!M.getorgan(/obj/item/organ/brain))
|
||||
if(istype(H) && !H.get_bodypart("head"))
|
||||
return
|
||||
user.drop_item()
|
||||
var/msg = "[M] has [src] inserted into \his head by [user]."
|
||||
if(M == user)
|
||||
msg = "[user] inserts [src] into \his head!"
|
||||
|
||||
M.visible_message("<span class='danger'>[msg]</span>",
|
||||
"<span class='userdanger'>[msg]</span>")
|
||||
|
||||
if(M != user)
|
||||
M << "<span class='notice'>[user] inserts [src] into your head.</span>"
|
||||
user << "<span class='notice'>You insert [src] into [M]'s head.</span>"
|
||||
else
|
||||
user << "<span class='notice'>You insert [src] into your head.</span>" //LOL
|
||||
|
||||
Insert(M)
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/organ/brain/Destroy() //copypasted from MMIs.
|
||||
if(brainmob)
|
||||
qdel(brainmob)
|
||||
brainmob = null
|
||||
return ..()
|
||||
|
||||
/obj/item/organ/brain/alien
|
||||
name = "alien brain"
|
||||
desc = "We barely understand the brains of terrestial animals. Who knows what we may find in the brain of such an advanced species?"
|
||||
icon_state = "brain-x"
|
||||
origin_tech = "biotech=6"
|
||||
/obj/item/organ/brain
|
||||
name = "brain"
|
||||
desc = "A piece of juicy meat found in a person's head."
|
||||
icon_state = "brain"
|
||||
throw_speed = 3
|
||||
throw_range = 5
|
||||
layer = ABOVE_MOB_LAYER
|
||||
zone = "head"
|
||||
slot = "brain"
|
||||
vital = 1
|
||||
origin_tech = "biotech=5"
|
||||
attack_verb = list("attacked", "slapped", "whacked")
|
||||
var/mob/living/brain/brainmob = null
|
||||
var/damaged_brain = 0 //whether the brain organ is damaged.
|
||||
|
||||
/obj/item/organ/brain/Insert(mob/living/carbon/C, special = 0)
|
||||
..()
|
||||
name = "brain"
|
||||
if(brainmob)
|
||||
if(C.key)
|
||||
C.ghostize()
|
||||
|
||||
if(brainmob.mind)
|
||||
brainmob.mind.transfer_to(C)
|
||||
else
|
||||
C.key = brainmob.key
|
||||
|
||||
qdel(brainmob)
|
||||
|
||||
//Update the body's icon so it doesnt appear debrained anymore
|
||||
C.update_hair()
|
||||
|
||||
/obj/item/organ/brain/Remove(mob/living/carbon/C, special = 0)
|
||||
..()
|
||||
if(!special)
|
||||
transfer_identity(C)
|
||||
C.update_hair()
|
||||
|
||||
/obj/item/organ/brain/prepare_eat()
|
||||
return // Too important to eat.
|
||||
|
||||
/obj/item/organ/brain/proc/transfer_identity(mob/living/L)
|
||||
name = "[L.name]'s brain"
|
||||
brainmob = new(src)
|
||||
brainmob.name = L.real_name
|
||||
brainmob.real_name = L.real_name
|
||||
brainmob.timeofhostdeath = L.timeofdeath
|
||||
if(L.has_dna())
|
||||
var/mob/living/carbon/C = L
|
||||
if(!brainmob.stored_dna)
|
||||
brainmob.stored_dna = new /datum/dna/stored(brainmob)
|
||||
C.dna.copy_dna(brainmob.stored_dna)
|
||||
if(L.mind && L.mind.current && (L.mind.current.stat == DEAD))
|
||||
L.mind.transfer_to(brainmob)
|
||||
brainmob << "<span class='notice'>You feel slightly disoriented. That's normal when you're just a brain.</span>"
|
||||
|
||||
/obj/item/organ/brain/attackby(obj/item/O, mob/user, params)
|
||||
user.changeNext_move(CLICK_CD_MELEE)
|
||||
if(brainmob)
|
||||
O.attack(brainmob, user) //Oh noooeeeee
|
||||
|
||||
/obj/item/organ/brain/examine(mob/user)
|
||||
..()
|
||||
|
||||
if(brainmob)
|
||||
if(brainmob.client)
|
||||
if(brainmob.health <= HEALTH_THRESHOLD_DEAD)
|
||||
user << "It's lifeless and severely damaged."
|
||||
else
|
||||
user << "You can feel the small spark of life still left in this one."
|
||||
else
|
||||
user << "This one seems particularly lifeless. Perhaps it will regain some of its luster later."
|
||||
else
|
||||
user << "This one is completely devoid of life."
|
||||
|
||||
/obj/item/organ/brain/attack(mob/living/carbon/C, mob/user)
|
||||
if(!istype(C))
|
||||
return ..()
|
||||
|
||||
add_fingerprint(user)
|
||||
|
||||
if(user.zone_selected != "head")
|
||||
return ..()
|
||||
|
||||
if((C.head && (C.head.flags_cover & HEADCOVERSEYES)) || (C.wear_mask && (C.wear_mask.flags_cover & MASKCOVERSEYES)) || (C.glasses && (C.glasses.flags & GLASSESCOVERSEYES)))
|
||||
user << "<span class='warning'>You're going to need to remove their head cover first!</span>"
|
||||
return
|
||||
|
||||
//since these people will be dead M != usr
|
||||
|
||||
if(!C.getorgan(/obj/item/organ/brain))
|
||||
if(!C.get_bodypart("head"))
|
||||
return
|
||||
user.drop_item()
|
||||
var/msg = "[C] has [src] inserted into \his head by [user]."
|
||||
if(C == user)
|
||||
msg = "[user] inserts [src] into \his head!"
|
||||
|
||||
C.visible_message("<span class='danger'>[msg]</span>",
|
||||
"<span class='userdanger'>[msg]</span>")
|
||||
|
||||
if(C != user)
|
||||
C << "<span class='notice'>[user] inserts [src] into your head.</span>"
|
||||
user << "<span class='notice'>You insert [src] into [C]'s head.</span>"
|
||||
else
|
||||
user << "<span class='notice'>You insert [src] into your head.</span>" //LOL
|
||||
|
||||
Insert(C)
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/organ/brain/Destroy() //copypasted from MMIs.
|
||||
if(brainmob)
|
||||
qdel(brainmob)
|
||||
brainmob = null
|
||||
return ..()
|
||||
|
||||
/obj/item/organ/brain/alien
|
||||
name = "alien brain"
|
||||
desc = "We barely understand the brains of terrestial animals. Who knows what we may find in the brain of such an advanced species?"
|
||||
icon_state = "brain-x"
|
||||
origin_tech = "biotech=6"
|
||||
+19
-19
@@ -1,20 +1,20 @@
|
||||
/mob/living/carbon/brain/death(gibbed)
|
||||
if(stat == DEAD)
|
||||
return
|
||||
stat = DEAD
|
||||
|
||||
if(!gibbed && container)//If not gibbed but in a container.
|
||||
var/obj/item/device/mmi = container
|
||||
mmi.visible_message("<span class='warning'>[src]'s MMI flatlines!</span>", \
|
||||
"<span class='italics'>You hear something flatline.</span>")
|
||||
mmi.update_icon()
|
||||
|
||||
return ..()
|
||||
|
||||
/mob/living/carbon/brain/gib()
|
||||
if(container)
|
||||
qdel(container)//Gets rid of the MMI if there is one
|
||||
if(loc)
|
||||
if(istype(loc,/obj/item/organ/brain))
|
||||
qdel(loc)//Gets rid of the brain item
|
||||
/mob/living/brain/death(gibbed)
|
||||
if(stat == DEAD)
|
||||
return
|
||||
stat = DEAD
|
||||
|
||||
if(!gibbed && container)//If not gibbed but in a container.
|
||||
var/obj/item/device/mmi = container
|
||||
mmi.visible_message("<span class='warning'>[src]'s MMI flatlines!</span>", \
|
||||
"<span class='italics'>You hear something flatline.</span>")
|
||||
mmi.update_icon()
|
||||
|
||||
return ..()
|
||||
|
||||
/mob/living/brain/gib()
|
||||
if(container)
|
||||
qdel(container)//Gets rid of the MMI if there is one
|
||||
if(loc)
|
||||
if(istype(loc,/obj/item/organ/brain))
|
||||
qdel(loc)//Gets rid of the brain item
|
||||
..()
|
||||
+70
-70
@@ -1,71 +1,71 @@
|
||||
/mob/living/carbon/brain/emote(act,m_type=1,message = null)
|
||||
if(!(container && istype(container, /obj/item/device/mmi)))//No MMI, no emotes
|
||||
return
|
||||
|
||||
if (findtext(act, "-", 1, null))
|
||||
var/t1 = findtext(act, "-", 1, null)
|
||||
act = copytext(act, 1, t1)
|
||||
|
||||
|
||||
if(src.stat == DEAD)
|
||||
return
|
||||
switch(act)
|
||||
if ("alarm")
|
||||
src << "You sound an alarm."
|
||||
message = "<B>[src]</B> sounds an alarm."
|
||||
m_type = 2
|
||||
|
||||
if ("alert")
|
||||
src << "You let out a distressed noise."
|
||||
message = "<B>[src]</B> lets out a distressed noise."
|
||||
m_type = 2
|
||||
|
||||
if ("beep","beeps")
|
||||
src << "You beep."
|
||||
message = "<B>[src]</B> beeps."
|
||||
m_type = 2
|
||||
|
||||
if ("blink","blinks")
|
||||
message = "<B>[src]</B> blinks."
|
||||
m_type = 1
|
||||
|
||||
if ("boop","boops")
|
||||
src << "You boop."
|
||||
message = "<B>[src]</B> boops."
|
||||
m_type = 2
|
||||
|
||||
if ("flash")
|
||||
message = "The lights on <B>[src]</B> flash quickly."
|
||||
m_type = 1
|
||||
|
||||
if ("notice")
|
||||
src << "You play a loud tone."
|
||||
message = "<B>[src]</B> plays a loud tone."
|
||||
m_type = 2
|
||||
|
||||
if ("whistle","whistles")
|
||||
src << "You whistle."
|
||||
message = "<B>[src]</B> whistles."
|
||||
m_type = 2
|
||||
|
||||
if ("help")
|
||||
src << "Help for MMI emotes. You can use these emotes with say \"*emote\":\nalarm, alert, beep, blink, boop, flash, notice, whistle"
|
||||
|
||||
else
|
||||
src << "<span class='notice'>Unusable emote '[act]'. Say *help for a list.</span>"
|
||||
return
|
||||
|
||||
if (message)
|
||||
log_emote("[name]/[key] : [message]")
|
||||
|
||||
for(var/mob/M in dead_mob_list)
|
||||
if (!M.client || istype(M, /mob/new_player))
|
||||
continue //skip monkeys, leavers, and new_players
|
||||
if(M.stat == DEAD && (M.client && (M.client.prefs.chat_toggles & CHAT_GHOSTSIGHT)) && !(M in viewers(src,null)))
|
||||
M.show_message(message)
|
||||
|
||||
|
||||
if (m_type & 1)
|
||||
visible_message(message)
|
||||
else if (m_type & 2)
|
||||
/mob/living/brain/emote(act,m_type=1,message = null)
|
||||
if(!(container && istype(container, /obj/item/device/mmi)))//No MMI, no emotes
|
||||
return
|
||||
|
||||
if (findtext(act, "-", 1, null))
|
||||
var/t1 = findtext(act, "-", 1, null)
|
||||
act = copytext(act, 1, t1)
|
||||
|
||||
|
||||
if(src.stat == DEAD)
|
||||
return
|
||||
switch(act)
|
||||
if ("alarm")
|
||||
src << "You sound an alarm."
|
||||
message = "<B>[src]</B> sounds an alarm."
|
||||
m_type = 2
|
||||
|
||||
if ("alert")
|
||||
src << "You let out a distressed noise."
|
||||
message = "<B>[src]</B> lets out a distressed noise."
|
||||
m_type = 2
|
||||
|
||||
if ("beep","beeps")
|
||||
src << "You beep."
|
||||
message = "<B>[src]</B> beeps."
|
||||
m_type = 2
|
||||
|
||||
if ("blink","blinks")
|
||||
message = "<B>[src]</B> blinks."
|
||||
m_type = 1
|
||||
|
||||
if ("boop","boops")
|
||||
src << "You boop."
|
||||
message = "<B>[src]</B> boops."
|
||||
m_type = 2
|
||||
|
||||
if ("flash")
|
||||
message = "The lights on <B>[src]</B> flash quickly."
|
||||
m_type = 1
|
||||
|
||||
if ("notice")
|
||||
src << "You play a loud tone."
|
||||
message = "<B>[src]</B> plays a loud tone."
|
||||
m_type = 2
|
||||
|
||||
if ("whistle","whistles")
|
||||
src << "You whistle."
|
||||
message = "<B>[src]</B> whistles."
|
||||
m_type = 2
|
||||
|
||||
if ("help")
|
||||
src << "Help for MMI emotes. You can use these emotes with say \"*emote\":\nalarm, alert, beep, blink, boop, flash, notice, whistle"
|
||||
|
||||
else
|
||||
src << "<span class='notice'>Unusable emote '[act]'. Say *help for a list.</span>"
|
||||
return
|
||||
|
||||
if (message)
|
||||
log_emote("[name]/[key] : [message]")
|
||||
|
||||
for(var/mob/M in dead_mob_list)
|
||||
if (!M.client || istype(M, /mob/new_player))
|
||||
continue //skip monkeys, leavers, and new_players
|
||||
if(M.stat == DEAD && (M.client && (M.client.prefs.chat_toggles & CHAT_GHOSTSIGHT)) && !(M in viewers(src,null)))
|
||||
M.show_message(message)
|
||||
|
||||
|
||||
if (m_type & 1)
|
||||
visible_message(message)
|
||||
else if (m_type & 2)
|
||||
audible_message(message)
|
||||
+49
-60
@@ -1,60 +1,49 @@
|
||||
|
||||
/mob/living/carbon/brain/Life()
|
||||
set invisibility = 0
|
||||
set background = BACKGROUND_ENABLED
|
||||
|
||||
if (notransform)
|
||||
return
|
||||
if(!loc)
|
||||
return
|
||||
. = ..()
|
||||
handle_emp_damage()
|
||||
|
||||
/mob/living/carbon/brain/handle_breathing()
|
||||
return
|
||||
|
||||
/mob/living/carbon/brain/handle_mutations_and_radiation()
|
||||
return
|
||||
|
||||
/mob/living/carbon/brain/handle_environment(datum/gas_mixture/environment)
|
||||
return
|
||||
|
||||
/mob/living/carbon/brain/update_stat()
|
||||
if(status_flags & GODMODE)
|
||||
return
|
||||
if(health <= HEALTH_THRESHOLD_DEAD)
|
||||
if(stat != DEAD)
|
||||
death()
|
||||
var/obj/item/organ/brain/BR
|
||||
if(container && container.brain)
|
||||
BR = container.brain
|
||||
else if(istype(loc, /obj/item/organ/brain))
|
||||
BR = loc
|
||||
if(BR)
|
||||
BR.damaged_brain = 1 //beaten to a pulp
|
||||
|
||||
/* //currently unused feature, since brain outside a mmi is always dead.
|
||||
/mob/living/carbon/brain/proc/handle_brain_revival_life()
|
||||
if(stat != DEAD)
|
||||
if(config.revival_brain_life != -1)
|
||||
if( !container && (world.time - timeofhostdeath) > config.revival_brain_life)
|
||||
death()
|
||||
*/
|
||||
|
||||
/mob/living/carbon/brain/proc/handle_emp_damage()
|
||||
if(emp_damage)
|
||||
if(stat == DEAD)
|
||||
emp_damage = 0
|
||||
else
|
||||
emp_damage = max(emp_damage-1, 0)
|
||||
|
||||
/mob/living/carbon/brain/handle_status_effects()
|
||||
return
|
||||
|
||||
/mob/living/carbon/brain/handle_disabilities()
|
||||
return
|
||||
|
||||
/mob/living/carbon/brain/handle_changeling()
|
||||
return
|
||||
|
||||
|
||||
|
||||
/mob/living/brain/Life()
|
||||
set invisibility = 0
|
||||
set background = BACKGROUND_ENABLED
|
||||
|
||||
if (notransform)
|
||||
return
|
||||
if(!loc)
|
||||
return
|
||||
. = ..()
|
||||
handle_emp_damage()
|
||||
|
||||
/mob/living/brain/update_stat()
|
||||
if(status_flags & GODMODE)
|
||||
return
|
||||
if(health <= HEALTH_THRESHOLD_DEAD)
|
||||
if(stat != DEAD)
|
||||
death()
|
||||
var/obj/item/organ/brain/BR
|
||||
if(container && container.brain)
|
||||
BR = container.brain
|
||||
else if(istype(loc, /obj/item/organ/brain))
|
||||
BR = loc
|
||||
if(BR)
|
||||
BR.damaged_brain = 1 //beaten to a pulp
|
||||
|
||||
/* //currently unused feature, since brain outside a mmi is always dead.
|
||||
/mob/living/brain/proc/handle_brain_revival_life()
|
||||
if(stat != DEAD)
|
||||
if(config.revival_brain_life != -1)
|
||||
if( !container && (world.time - timeofhostdeath) > config.revival_brain_life)
|
||||
death()
|
||||
*/
|
||||
|
||||
/mob/living/brain/proc/handle_emp_damage()
|
||||
if(emp_damage)
|
||||
if(stat == DEAD)
|
||||
emp_damage = 0
|
||||
else
|
||||
emp_damage = max(emp_damage-1, 0)
|
||||
|
||||
/mob/living/brain/handle_status_effects()
|
||||
return
|
||||
|
||||
/mob/living/brain/handle_disabilities()
|
||||
return
|
||||
|
||||
|
||||
|
||||
+3
-4
@@ -80,11 +80,10 @@ var/global/posibrain_notif_cooldown = 0
|
||||
name = "[initial(name)] ([C])"
|
||||
brainmob.name = C.real_name
|
||||
brainmob.real_name = C.real_name
|
||||
brainmob.dna = C.dna
|
||||
if(C.has_dna())
|
||||
if(!brainmob.dna)
|
||||
brainmob.dna = new /datum/dna(brainmob)
|
||||
C.dna.copy_dna(brainmob.dna)
|
||||
if(!brainmob.stored_dna)
|
||||
brainmob.stored_dna = new /datum/dna/stored(brainmob)
|
||||
C.dna.copy_dna(brainmob.stored_dna)
|
||||
brainmob.timeofhostdeath = C.timeofdeath
|
||||
brainmob.stat = CONSCIOUS
|
||||
if(brainmob.mind)
|
||||
+22
-22
@@ -1,23 +1,23 @@
|
||||
/mob/living/carbon/brain/say(message)
|
||||
if(!(container && istype(container, /obj/item/device/mmi)))
|
||||
return //No MMI, can't speak, bucko./N
|
||||
else
|
||||
if(prob(emp_damage*4))
|
||||
if(prob(10))//10% chane to drop the message entirely
|
||||
return
|
||||
else
|
||||
message = Gibberish(message, (emp_damage*6))//scrambles the message, gets worse when emp_damage is higher
|
||||
..()
|
||||
|
||||
/mob/living/carbon/brain/radio(message, message_mode, list/spans)
|
||||
if(message_mode && istype(container, /obj/item/device/mmi))
|
||||
var/obj/item/device/mmi/R = container
|
||||
if(R.radio)
|
||||
R.radio.talk_into(src, message, , spans)
|
||||
return ITALICS | REDUCE_RANGE
|
||||
|
||||
/mob/living/carbon/brain/lingcheck()
|
||||
return 0
|
||||
|
||||
/mob/living/carbon/brain/treat_message(message)
|
||||
/mob/living/brain/say(message)
|
||||
if(!(container && istype(container, /obj/item/device/mmi)))
|
||||
return //No MMI, can't speak, bucko./N
|
||||
else
|
||||
if(prob(emp_damage*4))
|
||||
if(prob(10))//10% chane to drop the message entirely
|
||||
return
|
||||
else
|
||||
message = Gibberish(message, (emp_damage*6))//scrambles the message, gets worse when emp_damage is higher
|
||||
..()
|
||||
|
||||
/mob/living/brain/radio(message, message_mode, list/spans)
|
||||
if(message_mode && istype(container, /obj/item/device/mmi))
|
||||
var/obj/item/device/mmi/R = container
|
||||
if(R.radio)
|
||||
R.radio.talk_into(src, message, , spans)
|
||||
return ITALICS | REDUCE_RANGE
|
||||
|
||||
/mob/living/brain/lingcheck()
|
||||
return 0
|
||||
|
||||
/mob/living/brain/treat_message(message)
|
||||
return message
|
||||
+8
-13
@@ -4,35 +4,30 @@
|
||||
|
||||
/////////////////////////////////// EAR DAMAGE ////////////////////////////////////
|
||||
|
||||
/mob/living/carbon/brain/adjustEarDamage()
|
||||
/mob/living/brain/adjustEarDamage()
|
||||
return
|
||||
|
||||
/mob/living/carbon/brain/setEarDamage() // no ears to damage or heal
|
||||
/mob/living/brain/setEarDamage() // no ears to damage or heal
|
||||
return
|
||||
|
||||
/////////////////////////////////// EYE_BLIND ////////////////////////////////////
|
||||
|
||||
/mob/living/carbon/brain/blind_eyes() // no eyes to damage or heal
|
||||
/mob/living/brain/blind_eyes() // no eyes to damage or heal
|
||||
return
|
||||
|
||||
/mob/living/carbon/brain/adjust_blindness()
|
||||
/mob/living/brain/adjust_blindness()
|
||||
return
|
||||
|
||||
/mob/living/carbon/brain/set_blindness()
|
||||
/mob/living/brain/set_blindness()
|
||||
return
|
||||
|
||||
/////////////////////////////////// EYE_BLURRY ////////////////////////////////////
|
||||
|
||||
/mob/living/carbon/brain/blur_eyes()
|
||||
/mob/living/brain/blur_eyes()
|
||||
return
|
||||
|
||||
/mob/living/carbon/brain/adjust_blurriness()
|
||||
/mob/living/brain/adjust_blurriness()
|
||||
return
|
||||
|
||||
/mob/living/carbon/brain/set_blurriness()
|
||||
/mob/living/brain/set_blurriness()
|
||||
return
|
||||
|
||||
/////////////////////////////////// BLIND DISABILITY ////////////////////////////////////
|
||||
|
||||
/mob/living/carbon/brain/become_blind()
|
||||
return
|
||||
@@ -37,35 +37,22 @@
|
||||
verbs += /mob/living/proc/mob_sleep
|
||||
verbs += /mob/living/proc/lay_down
|
||||
|
||||
internal_organs += new /obj/item/organ/brain/alien
|
||||
internal_organs += new /obj/item/organ/alien/hivenode
|
||||
internal_organs += new /obj/item/organ/tongue/alien
|
||||
create_bodyparts() //initialize bodyparts
|
||||
|
||||
for(var/obj/item/organ/I in internal_organs)
|
||||
I.Insert(src)
|
||||
create_internal_organs()
|
||||
|
||||
AddAbility(new/obj/effect/proc_holder/alien/nightvisiontoggle(null))
|
||||
..()
|
||||
|
||||
/mob/living/carbon/alien/create_internal_organs()
|
||||
internal_organs += new /obj/item/organ/brain/alien
|
||||
internal_organs += new /obj/item/organ/alien/hivenode
|
||||
internal_organs += new /obj/item/organ/tongue/alien
|
||||
..()
|
||||
|
||||
/mob/living/carbon/alien/assess_threat() // beepsky won't hunt aliums
|
||||
return -10
|
||||
|
||||
/mob/living/carbon/alien/adjustToxLoss(amount)
|
||||
return 0
|
||||
|
||||
/mob/living/carbon/alien/adjustFireLoss(amount) // Weak to Fire
|
||||
if(amount > 0)
|
||||
..(amount * 2)
|
||||
else
|
||||
..(amount)
|
||||
return
|
||||
|
||||
/mob/living/carbon/alien/check_eye_prot()
|
||||
return ..() + 2
|
||||
|
||||
/mob/living/carbon/alien/getToxLoss()
|
||||
return 0
|
||||
|
||||
/mob/living/carbon/alien/handle_environment(datum/gas_mixture/environment)
|
||||
if(!environment)
|
||||
return
|
||||
@@ -100,35 +87,6 @@
|
||||
else
|
||||
clear_alert("alien_fire")
|
||||
|
||||
|
||||
/mob/living/carbon/alien/ex_act(severity, target)
|
||||
..()
|
||||
|
||||
switch (severity)
|
||||
if (1)
|
||||
gib()
|
||||
return
|
||||
|
||||
if (2)
|
||||
adjustBruteLoss(60)
|
||||
adjustFireLoss(60)
|
||||
adjustEarDamage(30,120)
|
||||
|
||||
if(3)
|
||||
adjustBruteLoss(30)
|
||||
if (prob(50))
|
||||
Paralyse(1)
|
||||
adjustEarDamage(15,60)
|
||||
|
||||
updatehealth()
|
||||
|
||||
|
||||
/mob/living/carbon/alien/handle_fire()//Aliens on fire code
|
||||
if(..())
|
||||
return
|
||||
bodytemperature += BODYTEMP_HEATING_MAX //If you're on fire, you heat up!
|
||||
return
|
||||
|
||||
/mob/living/carbon/alien/reagent_check(datum/reagent/R) //can metabolize all reagents
|
||||
return 0
|
||||
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
|
||||
/mob/living/carbon/alien/get_eye_protection()
|
||||
return ..() + 2 //potential cyber implants + natural eye protection
|
||||
|
||||
/mob/living/carbon/alien/get_ear_protection()
|
||||
return 2 //no ears
|
||||
|
||||
/mob/living/carbon/alien/hitby(atom/movable/AM, skipcatch, hitpush)
|
||||
..(AM, skipcatch = 1, hitpush = 0)
|
||||
|
||||
@@ -40,7 +47,6 @@ In all, this is a lot like the monkey code. /N
|
||||
updatehealth()
|
||||
else
|
||||
M << "<span class='warning'>[name] is too injured for that.</span>"
|
||||
return
|
||||
|
||||
|
||||
/mob/living/carbon/alien/attack_larva(mob/living/carbon/alien/larva/L)
|
||||
@@ -65,9 +71,10 @@ In all, this is a lot like the monkey code. /N
|
||||
/mob/living/carbon/alien/attack_paw(mob/living/carbon/monkey/M)
|
||||
if(..())
|
||||
if (stat != DEAD)
|
||||
adjustBruteLoss(rand(1, 3))
|
||||
updatehealth()
|
||||
return
|
||||
var/obj/item/bodypart/affecting = get_bodypart(ran_zone(M.zone_selected))
|
||||
apply_damage(rand(1, 3), BRUTE, affecting)
|
||||
|
||||
|
||||
|
||||
|
||||
/mob/living/carbon/alien/attack_animal(mob/living/simple_animal/M)
|
||||
@@ -96,3 +103,22 @@ In all, this is a lot like the monkey code. /N
|
||||
adjustBruteLoss(damage)
|
||||
add_logs(M, src, "attacked")
|
||||
updatehealth()
|
||||
|
||||
/mob/living/carbon/alien/ex_act(severity, target)
|
||||
..()
|
||||
switch (severity)
|
||||
if (1)
|
||||
gib()
|
||||
|
||||
if (2)
|
||||
take_overall_damage(60, 60)
|
||||
adjustEarDamage(30,120)
|
||||
|
||||
if(3)
|
||||
take_overall_damage(30,0)
|
||||
if(prob(50))
|
||||
Paralyse(1)
|
||||
adjustEarDamage(15,60)
|
||||
|
||||
/mob/living/carbon/alien/soundbang_act(intensity = 1, stun_pwr = 1, damage_pwr = 5, deafen_pwr = 15)
|
||||
return 0
|
||||
@@ -0,0 +1,22 @@
|
||||
|
||||
|
||||
/mob/living/carbon/alien/getToxLoss()
|
||||
return 0
|
||||
|
||||
/mob/living/carbon/alien/adjustToxLoss(amount) //alien immune to tox damage
|
||||
return 0
|
||||
|
||||
/mob/living/carbon/alien/adjustFireLoss(amount) // Weak to Fire
|
||||
if(amount > 0)
|
||||
..(amount * 2)
|
||||
else
|
||||
..(amount)
|
||||
|
||||
|
||||
|
||||
//aliens are immune to stamina damage.
|
||||
/mob/living/carbon/alien/adjustStaminaLoss(amount, updating_stamina = 1)
|
||||
return
|
||||
|
||||
/mob/living/carbon/alien/setStaminaLoss(amount, updating_stamina = 1)
|
||||
return
|
||||
@@ -1,5 +1,8 @@
|
||||
/mob/living/carbon/alien/spawn_gibs()
|
||||
xgibs(loc, viruses)
|
||||
/mob/living/carbon/alien/spawn_gibs(with_bodyparts)
|
||||
if(with_bodyparts)
|
||||
new /obj/effect/gibspawner/xeno(loc,viruses)
|
||||
else
|
||||
new /obj/effect/gibspawner/xenobodypartless(loc,viruses)
|
||||
|
||||
/mob/living/carbon/alien/gib_animation()
|
||||
PoolOrNew(/obj/effect/overlay/temp/gib_animation, list(loc, "gibbed-a"))
|
||||
|
||||
@@ -7,11 +7,14 @@
|
||||
|
||||
|
||||
/mob/living/carbon/alien/humanoid/drone/New()
|
||||
AddAbility(new/obj/effect/proc_holder/alien/evolve(null))
|
||||
..()
|
||||
|
||||
|
||||
/mob/living/carbon/alien/humanoid/drone/create_internal_organs()
|
||||
internal_organs += new /obj/item/organ/alien/plasmavessel/large
|
||||
internal_organs += new /obj/item/organ/alien/resinspinner
|
||||
internal_organs += new /obj/item/organ/alien/acid
|
||||
|
||||
AddAbility(new/obj/effect/proc_holder/alien/evolve(null))
|
||||
..()
|
||||
|
||||
/mob/living/carbon/alien/humanoid/drone/movement_delay()
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
icon_state = "alienh_s"
|
||||
var/obj/screen/leap_icon = null
|
||||
|
||||
/mob/living/carbon/alien/humanoid/hunter/New()
|
||||
/mob/living/carbon/alien/humanoid/hunter/create_internal_organs()
|
||||
internal_organs += new /obj/item/organ/alien/plasmavessel/small
|
||||
..()
|
||||
|
||||
|
||||
@@ -11,14 +11,18 @@
|
||||
|
||||
real_name = name
|
||||
|
||||
AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/repulse/xeno(src))
|
||||
AddAbility(new /obj/effect/proc_holder/alien/royal/praetorian/evolve())
|
||||
..()
|
||||
|
||||
/mob/living/carbon/alien/humanoid/royal/praetorian/create_internal_organs()
|
||||
internal_organs += new /obj/item/organ/alien/plasmavessel/large
|
||||
internal_organs += new /obj/item/organ/alien/resinspinner
|
||||
internal_organs += new /obj/item/organ/alien/acid
|
||||
internal_organs += new /obj/item/organ/alien/neurotoxin
|
||||
AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/repulse/xeno(src))
|
||||
AddAbility(new /obj/effect/proc_holder/alien/royal/praetorian/evolve())
|
||||
..()
|
||||
|
||||
|
||||
/mob/living/carbon/alien/humanoid/royal/praetorian/movement_delay()
|
||||
. = ..()
|
||||
. += 1
|
||||
|
||||
@@ -7,11 +7,15 @@
|
||||
|
||||
|
||||
/mob/living/carbon/alien/humanoid/sentinel/New()
|
||||
internal_organs += new /obj/item/organ/alien/plasmavessel
|
||||
internal_organs += new /obj/item/organ/alien/acid
|
||||
internal_organs += new /obj/item/organ/alien/neurotoxin
|
||||
AddAbility(new /obj/effect/proc_holder/alien/sneak)
|
||||
..()
|
||||
|
||||
/mob/living/carbon/alien/humanoid/sentinel/create_internal_organs()
|
||||
internal_organs += new /obj/item/organ/alien/plasmavessel
|
||||
internal_organs += new /obj/item/organ/alien/acid
|
||||
internal_organs += new /obj/item/organ/alien/neurotoxin
|
||||
..()
|
||||
|
||||
|
||||
/mob/living/carbon/alien/humanoid/sentinel/movement_delay()
|
||||
. = ..()
|
||||
|
||||
@@ -15,75 +15,19 @@
|
||||
var/custom_pixel_y_offset = 0
|
||||
var/sneaking = 0 //For sneaky-sneaky mode and appropriate slowdown
|
||||
var/drooling = 0 //For Neruotoxic spit overlays
|
||||
bodyparts = list(/obj/item/bodypart/chest/alien, /obj/item/bodypart/head/alien, /obj/item/bodypart/l_arm/alien,
|
||||
/obj/item/bodypart/r_arm/alien, /obj/item/bodypart/r_leg/alien, /obj/item/bodypart/l_leg/alien)
|
||||
|
||||
|
||||
//This is fine right now, if we're adding organ specific damage this needs to be updated
|
||||
/mob/living/carbon/alien/humanoid/New()
|
||||
AddAbility(new/obj/effect/proc_holder/alien/regurgitate(null))
|
||||
..()
|
||||
|
||||
|
||||
/mob/living/carbon/alien/humanoid/movement_delay()
|
||||
. = ..()
|
||||
. += move_delay_add + config.alien_delay + sneaking //move_delay_add is used to slow aliens with stuns
|
||||
|
||||
/mob/living/carbon/alien/humanoid/emp_act(severity)
|
||||
if(r_store) r_store.emp_act(severity)
|
||||
if(l_store) l_store.emp_act(severity)
|
||||
..()
|
||||
|
||||
/mob/living/carbon/alien/humanoid/attack_hulk(mob/living/carbon/human/user)
|
||||
if(user.a_intent == "harm")
|
||||
..(user, 1)
|
||||
adjustBruteLoss(15)
|
||||
var/hitverb = "punched"
|
||||
if(mob_size < MOB_SIZE_LARGE)
|
||||
step_away(src,user,15)
|
||||
sleep(1)
|
||||
step_away(src,user,15)
|
||||
hitverb = "slammed"
|
||||
playsound(loc, "punch", 25, 1, -1)
|
||||
visible_message("<span class='danger'>[user] has [hitverb] [src]!</span>", \
|
||||
"<span class='userdanger'>[user] has [hitverb] [src]!</span>")
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/alien/humanoid/attack_hand(mob/living/carbon/human/M)
|
||||
if(..())
|
||||
switch(M.a_intent)
|
||||
if ("harm")
|
||||
var/damage = rand(1, 9)
|
||||
if (prob(90))
|
||||
playsound(loc, "punch", 25, 1, -1)
|
||||
visible_message("<span class='danger'>[M] has punched [src]!</span>", \
|
||||
"<span class='userdanger'>[M] has punched [src]!</span>")
|
||||
if ((stat != DEAD) && (damage > 9 || prob(5)))//Regular humans have a very small chance of weakening an alien.
|
||||
Paralyse(2)
|
||||
visible_message("<span class='danger'>[M] has weakened [src]!</span>", \
|
||||
"<span class='userdanger'>[M] has weakened [src]!</span>")
|
||||
adjustBruteLoss(damage)
|
||||
add_logs(M, src, "attacked")
|
||||
updatehealth()
|
||||
else
|
||||
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
|
||||
visible_message("<span class='danger'>[M] has attempted to punch [src]!</span>")
|
||||
|
||||
if ("disarm")
|
||||
if (!lying)
|
||||
if (prob(5))
|
||||
Paralyse(2)
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
add_logs(M, src, "pushed")
|
||||
visible_message("<span class='danger'>[M] has pushed down [src]!</span>", \
|
||||
"<span class='userdanger'>[M] has pushed down [src]!</span>")
|
||||
else
|
||||
if (prob(50))
|
||||
drop_item()
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
visible_message("<span class='danger'>[M] has disarmed [src]!</span>", \
|
||||
"<span class='userdanger'>[M] has disarmed [src]!</span>")
|
||||
else
|
||||
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
|
||||
visible_message("<span class='danger'>[M] has attempted to disarm [src]!</span>")
|
||||
|
||||
/mob/living/carbon/alien/humanoid/restrained(ignore_grab)
|
||||
. = handcuffed
|
||||
|
||||
@@ -150,9 +94,6 @@
|
||||
else
|
||||
return initial(pixel_x)
|
||||
|
||||
/mob/living/carbon/alien/humanoid/check_ear_prot()
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/alien/humanoid/get_permeability_protection()
|
||||
return 0.8
|
||||
|
||||
@@ -179,9 +120,3 @@ proc/get_alien_type(var/alienpath)
|
||||
if(breath && breath.total_moles() > 0 && !sneaking)
|
||||
playsound(get_turf(src), pick('sound/voice/lowHiss2.ogg', 'sound/voice/lowHiss3.ogg', 'sound/voice/lowHiss4.ogg'), 50, 0, -5)
|
||||
..()
|
||||
|
||||
/mob/living/carbon/alien/humanoid/grabbedby(mob/living/carbon/user, supress_message = 0)
|
||||
if(user == src && pulling && grab_state >= GRAB_AGGRESSIVE && !pulling.anchored && iscarbon(pulling))
|
||||
devour_mob(pulling, devour_time = 60)
|
||||
else
|
||||
..()
|
||||
@@ -0,0 +1,59 @@
|
||||
|
||||
/mob/living/carbon/alien/humanoid/grabbedby(mob/living/carbon/user, supress_message = 0)
|
||||
if(user == src && pulling && grab_state >= GRAB_AGGRESSIVE && !pulling.anchored && iscarbon(pulling))
|
||||
devour_mob(pulling, devour_time = 60)
|
||||
else
|
||||
..()
|
||||
|
||||
/mob/living/carbon/alien/humanoid/attack_hulk(mob/living/carbon/human/user)
|
||||
if(user.a_intent == "harm")
|
||||
..(user, 1)
|
||||
adjustBruteLoss(15)
|
||||
var/hitverb = "punched"
|
||||
if(mob_size < MOB_SIZE_LARGE)
|
||||
step_away(src,user,15)
|
||||
sleep(1)
|
||||
step_away(src,user,15)
|
||||
hitverb = "slammed"
|
||||
playsound(loc, "punch", 25, 1, -1)
|
||||
visible_message("<span class='danger'>[user] has [hitverb] [src]!</span>", \
|
||||
"<span class='userdanger'>[user] has [hitverb] [src]!</span>")
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/alien/humanoid/attack_hand(mob/living/carbon/human/M)
|
||||
if(..())
|
||||
switch(M.a_intent)
|
||||
if ("harm")
|
||||
var/damage = rand(1, 9)
|
||||
if (prob(90))
|
||||
playsound(loc, "punch", 25, 1, -1)
|
||||
visible_message("<span class='danger'>[M] has punched [src]!</span>", \
|
||||
"<span class='userdanger'>[M] has punched [src]!</span>")
|
||||
if ((stat != DEAD) && (damage > 9 || prob(5)))//Regular humans have a very small chance of weakening an alien.
|
||||
Paralyse(2)
|
||||
visible_message("<span class='danger'>[M] has weakened [src]!</span>", \
|
||||
"<span class='userdanger'>[M] has weakened [src]!</span>")
|
||||
var/obj/item/bodypart/affecting = get_bodypart(ran_zone(M.zone_selected))
|
||||
apply_damage(damage, BRUTE, affecting)
|
||||
add_logs(M, src, "attacked")
|
||||
else
|
||||
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
|
||||
visible_message("<span class='danger'>[M] has attempted to punch [src]!</span>")
|
||||
|
||||
if ("disarm")
|
||||
if (!lying)
|
||||
if (prob(5))
|
||||
Paralyse(2)
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
add_logs(M, src, "pushed")
|
||||
visible_message("<span class='danger'>[M] has pushed down [src]!</span>", \
|
||||
"<span class='userdanger'>[M] has pushed down [src]!</span>")
|
||||
else
|
||||
if (prob(50))
|
||||
drop_item()
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
visible_message("<span class='danger'>[M] has disarmed [src]!</span>", \
|
||||
"<span class='userdanger'>[M] has disarmed [src]!</span>")
|
||||
else
|
||||
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
|
||||
visible_message("<span class='danger'>[M] has attempted to disarm [src]!</span>")
|
||||
@@ -57,14 +57,17 @@
|
||||
|
||||
real_name = src.name
|
||||
|
||||
AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/repulse/xeno(src))
|
||||
AddAbility(new/obj/effect/proc_holder/alien/royal/queen/promote())
|
||||
smallsprite.Grant(src)
|
||||
..()
|
||||
|
||||
/mob/living/carbon/alien/humanoid/royal/queen/create_internal_organs()
|
||||
internal_organs += new /obj/item/organ/alien/plasmavessel/large/queen
|
||||
internal_organs += new /obj/item/organ/alien/resinspinner
|
||||
internal_organs += new /obj/item/organ/alien/acid
|
||||
internal_organs += new /obj/item/organ/alien/neurotoxin
|
||||
internal_organs += new /obj/item/organ/alien/eggsac
|
||||
AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/repulse/xeno(src))
|
||||
AddAbility(new/obj/effect/proc_holder/alien/royal/queen/promote())
|
||||
smallsprite.Grant(src)
|
||||
..()
|
||||
|
||||
/mob/living/carbon/alien/humanoid/royal/queen/movement_delay()
|
||||
|
||||
@@ -8,3 +8,18 @@
|
||||
visible_message("<span class='name'>[src]</span> lets out a waning high-pitched cry.")
|
||||
|
||||
return ..(gibbed)
|
||||
|
||||
/mob/living/carbon/alien/larva/spawn_gibs(with_bodyparts)
|
||||
if(with_bodyparts)
|
||||
new /obj/effect/gibspawner/larva(loc,viruses)
|
||||
else
|
||||
new /obj/effect/gibspawner/larvabodypartless(loc,viruses)
|
||||
|
||||
/mob/living/carbon/alien/larva/gib_animation()
|
||||
PoolOrNew(/obj/effect/overlay/temp/gib_animation, list(loc, "gibbed-l"))
|
||||
|
||||
/mob/living/carbon/alien/larva/spawn_dust()
|
||||
new /obj/effect/decal/remains/xeno(loc)
|
||||
|
||||
/mob/living/carbon/alien/larva/dust_animation()
|
||||
PoolOrNew(/obj/effect/overlay/temp/dust_animation, list(loc, "dust-l"))
|
||||
|
||||
@@ -14,16 +14,20 @@
|
||||
var/time_of_birth
|
||||
|
||||
rotate_on_lying = 0
|
||||
bodyparts = list(/obj/item/bodypart/chest/larva, /obj/item/bodypart/head/larva)
|
||||
|
||||
|
||||
//This is fine right now, if we're adding organ specific damage this needs to be updated
|
||||
/mob/living/carbon/alien/larva/New()
|
||||
regenerate_icons()
|
||||
internal_organs += new /obj/item/organ/alien/plasmavessel/small/tiny
|
||||
|
||||
AddAbility(new/obj/effect/proc_holder/alien/hide(null))
|
||||
AddAbility(new/obj/effect/proc_holder/alien/larva_evolve(null))
|
||||
..()
|
||||
|
||||
/mob/living/carbon/alien/larva/create_internal_organs()
|
||||
internal_organs += new /obj/item/organ/alien/plasmavessel/small/tiny
|
||||
..()
|
||||
|
||||
//This needs to be fixed
|
||||
/mob/living/carbon/alien/larva/Stat()
|
||||
..()
|
||||
@@ -39,36 +43,6 @@
|
||||
/mob/living/carbon/alien/larva/attack_ui(slot_id)
|
||||
return
|
||||
|
||||
/mob/living/carbon/alien/larva/attack_hulk(mob/living/carbon/human/user)
|
||||
if(user.a_intent == "harm")
|
||||
..(user, 1)
|
||||
adjustBruteLoss(5 + rand(1,9))
|
||||
spawn()
|
||||
step_away(src,user,15)
|
||||
sleep(1)
|
||||
step_away(src,user,15)
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/alien/larva/attack_hand(mob/living/carbon/human/M)
|
||||
if(..())
|
||||
var/damage = rand(1, 9)
|
||||
if (prob(90))
|
||||
playsound(loc, "punch", 25, 1, -1)
|
||||
add_logs(M, src, "attacked")
|
||||
visible_message("<span class='danger'>[M] has kicked [src]!</span>", \
|
||||
"<span class='userdanger'>[M] has kicked [src]!</span>")
|
||||
if ((stat != DEAD) && (damage > 4.9))
|
||||
Paralyse(rand(5,10))
|
||||
|
||||
adjustBruteLoss(damage)
|
||||
updatehealth()
|
||||
else
|
||||
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
|
||||
visible_message("<span class='danger'>[M] has attempted to kick [src]!</span>", \
|
||||
"<span class='userdanger'>[M] has attempted to kick [src]!</span>")
|
||||
|
||||
return
|
||||
|
||||
/mob/living/carbon/alien/larva/restrained(ignore_grab)
|
||||
. = 0
|
||||
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
|
||||
|
||||
/mob/living/carbon/alien/larva/attack_hand(mob/living/carbon/human/M)
|
||||
if(..())
|
||||
var/damage = rand(1, 9)
|
||||
if (prob(90))
|
||||
playsound(loc, "punch", 25, 1, -1)
|
||||
add_logs(M, src, "attacked")
|
||||
visible_message("<span class='danger'>[M] has kicked [src]!</span>", \
|
||||
"<span class='userdanger'>[M] has kicked [src]!</span>")
|
||||
if ((stat != DEAD) && (damage > 4.9))
|
||||
Paralyse(rand(5,10))
|
||||
|
||||
var/obj/item/bodypart/affecting = get_bodypart(ran_zone(M.zone_selected))
|
||||
apply_damage(damage, BRUTE, affecting)
|
||||
else
|
||||
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
|
||||
visible_message("<span class='danger'>[M] has attempted to kick [src]!</span>", \
|
||||
"<span class='userdanger'>[M] has attempted to kick [src]!</span>")
|
||||
|
||||
/mob/living/carbon/alien/larva/attack_hulk(mob/living/carbon/human/user)
|
||||
if(user.a_intent == "harm")
|
||||
..(user, 1)
|
||||
adjustBruteLoss(5 + rand(1,9))
|
||||
spawn()
|
||||
step_away(src,user,15)
|
||||
sleep(1)
|
||||
step_away(src,user,15)
|
||||
return 1
|
||||
@@ -45,4 +45,10 @@
|
||||
move_delay_add = max(0, move_delay_add - rand(1, 2))
|
||||
|
||||
/mob/living/carbon/alien/handle_changeling()
|
||||
return
|
||||
|
||||
/mob/living/carbon/alien/handle_fire()//Aliens on fire code
|
||||
if(..())
|
||||
return
|
||||
bodytemperature += BODYTEMP_HEATING_MAX //If you're on fire, you heat up!
|
||||
return
|
||||
@@ -41,7 +41,7 @@ var/const/ALIEN_AFK_BRACKET = 450 // 45 seconds
|
||||
if(prob(4))
|
||||
owner << "<span class='danger'>Your muscles ache.</span>"
|
||||
if(prob(20))
|
||||
owner.take_organ_damage(1)
|
||||
owner.take_bodypart_damage(1)
|
||||
if(prob(4))
|
||||
owner << "<span class='danger'>Your stomach hurts.</span>"
|
||||
if(prob(20))
|
||||
|
||||
@@ -68,7 +68,6 @@ var/const/MAX_ACTIVE_TIME = 400
|
||||
/obj/item/clothing/mask/facehugger/bullet_act(obj/item/projectile/P)
|
||||
if(P.damage)
|
||||
Die()
|
||||
return
|
||||
|
||||
/obj/item/clothing/mask/facehugger/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
|
||||
if(exposed_temperature > 300)
|
||||
@@ -124,7 +123,7 @@ var/const/MAX_ACTIVE_TIME = 400
|
||||
return 0
|
||||
if(stat != CONSCIOUS)
|
||||
return 0
|
||||
if(!sterile) M.take_organ_damage(strength,0) //done here so that even borgs and humans in helmets take damage
|
||||
if(!sterile) M.take_bodypart_damage(strength,0) //done here so that even borgs and humans in helmets take damage
|
||||
M.visible_message("<span class='danger'>[src] leaps at [M]'s face!</span>", \
|
||||
"<span class='userdanger'>[src] leaps at [M]'s face!</span>")
|
||||
if(ishuman(M))
|
||||
@@ -180,7 +179,7 @@ var/const/MAX_ACTIVE_TIME = 400
|
||||
icon_state = "[initial(icon_state)]_impregnated"
|
||||
|
||||
var/obj/item/bodypart/chest/LC = target.get_bodypart("chest")
|
||||
if((!LC || LC.status != ORGAN_ROBOTIC) && !target.getorgan(/obj/item/organ/body_egg/alien_embryo))
|
||||
if((!LC || LC.status != BODYPART_ROBOTIC) && !target.getorgan(/obj/item/organ/body_egg/alien_embryo))
|
||||
new /obj/item/organ/body_egg/alien_embryo(target)
|
||||
|
||||
if(iscorgi(target))
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
|
||||
|
||||
|
||||
/mob/living/carbon/alien/update_damage_overlays() //aliens don't have damage overlays.
|
||||
return
|
||||
|
||||
/mob/living/carbon/alien/update_body() // we don't use the bodyparts or body layers for aliens.
|
||||
return
|
||||
|
||||
/mob/living/carbon/alien/update_body_parts()//we don't use the bodyparts layer for aliens.
|
||||
return
|
||||
@@ -3,10 +3,11 @@
|
||||
|
||||
/mob/living/carbon/New()
|
||||
create_reagents(1000)
|
||||
update_body_parts() //to update the carbon's new bodyparts appearance
|
||||
..()
|
||||
|
||||
/mob/living/carbon/Destroy()
|
||||
for(var/atom/movable/guts in internal_organs)
|
||||
for(var/guts in internal_organs)
|
||||
qdel(guts)
|
||||
for(var/atom/movable/food in stomach_contents)
|
||||
qdel(food)
|
||||
@@ -28,16 +29,9 @@
|
||||
var/obj/item/I = user.get_active_held_item()
|
||||
if(I && I.force)
|
||||
var/d = rand(round(I.force / 4), I.force)
|
||||
if(istype(src, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = src
|
||||
var/organ = H.get_bodypart("chest")
|
||||
if (istype(organ, /obj/item/bodypart))
|
||||
var/obj/item/bodypart/temp = organ
|
||||
if(temp.take_damage(d, 0))
|
||||
H.update_damage_overlays(0)
|
||||
H.updatehealth()
|
||||
else
|
||||
src.take_organ_damage(d)
|
||||
var/obj/item/bodypart/BP = get_bodypart("chest")
|
||||
if(BP.take_damage(d, 0))
|
||||
update_damage_overlays()
|
||||
visible_message("<span class='danger'>[user] attacks [src]'s stomach wall with the [I.name]!</span>", \
|
||||
"<span class='userdanger'>[user] attacks your stomach wall with the [I.name]!</span>")
|
||||
playsound(user.loc, 'sound/effects/attackblob.ogg', 50, 1)
|
||||
@@ -49,36 +43,6 @@
|
||||
src.gib()
|
||||
|
||||
|
||||
/mob/living/carbon/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, override = 0, tesla_shock = 0)
|
||||
shock_damage *= siemens_coeff
|
||||
if(dna && dna.species)
|
||||
shock_damage *= dna.species.siemens_coeff
|
||||
if(shock_damage<1 && !override)
|
||||
return 0
|
||||
if(reagents.has_reagent("teslium"))
|
||||
shock_damage *= 1.5 //If the mob has teslium in their body, shocks are 50% more damaging!
|
||||
take_overall_damage(0,shock_damage)
|
||||
visible_message(
|
||||
"<span class='danger'>[src] was shocked by \the [source]!</span>", \
|
||||
"<span class='userdanger'>You feel a powerful shock coursing through your body!</span>", \
|
||||
"<span class='italics'>You hear a heavy electrical crack.</span>" \
|
||||
)
|
||||
jitteriness += 1000 //High numbers for violent convulsions
|
||||
do_jitter_animation(jitteriness)
|
||||
stuttering += 2
|
||||
if(!tesla_shock || (tesla_shock && siemens_coeff > 0.5))
|
||||
Stun(2)
|
||||
spawn(20)
|
||||
jitteriness = max(jitteriness - 990, 10) //Still jittery, but vastly less
|
||||
if(!tesla_shock || (tesla_shock && siemens_coeff > 0.5))
|
||||
Stun(3)
|
||||
Weaken(3)
|
||||
if(override)
|
||||
return override
|
||||
else
|
||||
return shock_damage
|
||||
|
||||
|
||||
/mob/living/carbon/swap_hand(held_index)
|
||||
if(!held_index)
|
||||
held_index = (active_hand_index % held_items.len)+1
|
||||
@@ -117,73 +81,27 @@
|
||||
else
|
||||
mode() // Activate held item
|
||||
|
||||
/mob/living/carbon/proc/help_shake_act(mob/living/carbon/M)
|
||||
if(on_fire)
|
||||
M << "<span class='warning'>You can't put them out with just your bare hands!"
|
||||
return
|
||||
/mob/living/carbon/attackby(obj/item/I, mob/user, params)
|
||||
if(lying && surgeries.len)
|
||||
if(user != src && user.a_intent == "help")
|
||||
for(var/datum/surgery/S in surgeries)
|
||||
if(S.next_step(user))
|
||||
return 1
|
||||
return ..()
|
||||
|
||||
if(health >= 0 && !(status_flags & FAKEDEATH))
|
||||
|
||||
if(lying)
|
||||
M.visible_message("<span class='notice'>[M] shakes [src] trying to get them up!</span>", \
|
||||
"<span class='notice'>You shake [src] trying to get them up!</span>")
|
||||
else
|
||||
M.visible_message("<span class='notice'>[M] hugs [src] to make them feel better!</span>", \
|
||||
"<span class='notice'>You hug [src] to make them feel better!</span>")
|
||||
AdjustSleeping(-5)
|
||||
AdjustParalysis(-3)
|
||||
AdjustStunned(-3)
|
||||
AdjustWeakened(-3)
|
||||
if(resting)
|
||||
resting = 0
|
||||
update_canmove()
|
||||
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
|
||||
/mob/living/carbon/flash_eyes(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0)
|
||||
/mob/living/carbon/throw_impact(atom/hit_atom)
|
||||
. = ..()
|
||||
|
||||
var/damage = intensity - check_eye_prot()
|
||||
if(.) // we've been flashed
|
||||
if(visual)
|
||||
return
|
||||
if(weakeyes)
|
||||
Stun(2)
|
||||
|
||||
if (damage == 1)
|
||||
src << "<span class='warning'>Your eyes sting a little.</span>"
|
||||
if(prob(40))
|
||||
adjust_eye_damage(1)
|
||||
|
||||
else if (damage == 2)
|
||||
src << "<span class='warning'>Your eyes burn.</span>"
|
||||
adjust_eye_damage(rand(2, 4))
|
||||
|
||||
else if( damage > 3)
|
||||
src << "<span class='warning'>Your eyes itch and burn severely!</span>"
|
||||
adjust_eye_damage(rand(12, 16))
|
||||
|
||||
if(eye_damage > 10)
|
||||
blind_eyes(damage)
|
||||
blur_eyes(damage * rand(3, 6))
|
||||
|
||||
if(eye_damage > 20)
|
||||
if(prob(eye_damage - 20))
|
||||
if(become_nearsighted())
|
||||
src << "<span class='warning'>Your eyes start to burn badly!</span>"
|
||||
else if(prob(eye_damage - 25))
|
||||
if(become_blind())
|
||||
src << "<span class='warning'>You can't see anything!</span>"
|
||||
else
|
||||
src << "<span class='warning'>Your eyes are really starting to hurt. This can't be good for you!</span>"
|
||||
if(has_bane(BANE_LIGHT))
|
||||
mind.disrupt_spells(-500)
|
||||
return 1
|
||||
else if(damage == 0) // just enough protection
|
||||
if(prob(20))
|
||||
src << "<span class='notice'>Something bright flashes in the corner of your vision!</span>"
|
||||
if(has_bane(BANE_LIGHT))
|
||||
mind.disrupt_spells(0)
|
||||
if(hit_atom.density && isturf(hit_atom))
|
||||
Weaken(1)
|
||||
take_bodypart_damage(10)
|
||||
if(iscarbon(hit_atom))
|
||||
var/mob/living/carbon/victim = hit_atom
|
||||
victim.Weaken(1)
|
||||
Weaken(1)
|
||||
victim.take_bodypart_damage(10)
|
||||
take_bodypart_damage(10)
|
||||
visible_message("<span class='danger'>[src] crashes into [victim], knocking them both over!</span>", "<span class='userdanger'>You violently crash into [victim]!</span>")
|
||||
playsound(src,'sound/weapons/punch1.ogg',50,1)
|
||||
|
||||
|
||||
//Throwing stuff
|
||||
@@ -308,13 +226,6 @@
|
||||
/mob/living/carbon/is_muzzled()
|
||||
return(istype(src.wear_mask, /obj/item/clothing/mask/muzzle))
|
||||
|
||||
/mob/living/carbon/blob_act(obj/effect/blob/B)
|
||||
if (stat == DEAD)
|
||||
return
|
||||
else
|
||||
show_message("<span class='userdanger'>The blob attacks!</span>")
|
||||
adjustBruteLoss(10)
|
||||
|
||||
/mob/living/carbon/proc/spin(spintime, speed)
|
||||
set waitfor = 0
|
||||
var/D = dir
|
||||
@@ -467,10 +378,6 @@
|
||||
else
|
||||
return initial(pixel_y)
|
||||
|
||||
/mob/living/carbon/check_ear_prot()
|
||||
if(head && (head.flags & HEADBANGPROTECT))
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/proc/accident(obj/item/I)
|
||||
if(!I || (I.flags & (NODROP|ABSTRACT)))
|
||||
return
|
||||
@@ -499,17 +406,6 @@
|
||||
var/turf/target = get_turf(loc)
|
||||
I.throw_at(target,I.throw_range,I.throw_speed,src)
|
||||
|
||||
/mob/living/carbon/emp_act(severity)
|
||||
for(var/obj/item/organ/O in internal_organs)
|
||||
O.emp_act(severity)
|
||||
..()
|
||||
|
||||
/mob/living/carbon/check_eye_prot()
|
||||
var/number = ..()
|
||||
for(var/obj/item/organ/cyberimp/eyes/EFP in internal_organs)
|
||||
number += EFP.flash_protect
|
||||
return number
|
||||
|
||||
/mob/living/carbon/proc/AddAbility(obj/effect/proc_holder/alien/A)
|
||||
abilities.Add(A)
|
||||
A.on_gain(src)
|
||||
@@ -538,6 +434,11 @@
|
||||
|
||||
add_abilities_to_panel()
|
||||
|
||||
/mob/living/carbon/attack_ui(slot)
|
||||
if(!has_hand_for_held_index(active_hand_index))
|
||||
return 0
|
||||
return ..()
|
||||
|
||||
/mob/living/carbon/proc/vomit(var/lost_nutrition = 10, var/blood = 0, var/stun = 1, var/distance = 0, var/message = 1, var/toxic = 0)
|
||||
if(nutrition < 100 && !blood)
|
||||
if(message)
|
||||
@@ -578,12 +479,29 @@
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
/mob/living/carbon/fully_replace_character_name(oldname,newname)
|
||||
..()
|
||||
if(dna)
|
||||
dna.real_name = real_name
|
||||
|
||||
//Updates the mob's health from bodyparts and mob damage variables
|
||||
/mob/living/carbon/updatehealth()
|
||||
if(status_flags & GODMODE)
|
||||
return
|
||||
var/total_burn = 0
|
||||
var/total_brute = 0
|
||||
for(var/X in bodyparts) //hardcoded to streamline things a bit
|
||||
var/obj/item/bodypart/BP = X
|
||||
total_brute += BP.brute_dam
|
||||
total_burn += BP.burn_dam
|
||||
health = maxHealth - getOxyLoss() - getToxLoss() - getCloneLoss() - total_burn - total_brute
|
||||
update_stat()
|
||||
if(((maxHealth - total_burn) < HEALTH_THRESHOLD_DEAD) && stat == DEAD )
|
||||
become_husk()
|
||||
if(on_fire)
|
||||
shred_clothing()
|
||||
med_hud_set_health()
|
||||
|
||||
/mob/living/carbon/update_sight()
|
||||
if(!client)
|
||||
return
|
||||
@@ -756,6 +674,7 @@
|
||||
for(var/datum/disease/D in viruses)
|
||||
D.cure(0)
|
||||
if(admin_revive)
|
||||
regenerate_limbs()
|
||||
handcuffed = initial(handcuffed)
|
||||
for(var/obj/item/weapon/restraints/R in contents) //actually remove cuffs from inventory
|
||||
qdel(R)
|
||||
@@ -773,7 +692,8 @@
|
||||
if(qdeleted(src))
|
||||
return
|
||||
var/organs_amt = 0
|
||||
for(var/obj/item/organ/O in internal_organs)
|
||||
for(var/X in internal_organs)
|
||||
var/obj/item/organ/O = X
|
||||
if(prob(50))
|
||||
organs_amt++
|
||||
O.Remove(src)
|
||||
@@ -783,15 +703,6 @@
|
||||
|
||||
..()
|
||||
|
||||
/mob/living/carbon/adjustToxLoss(amount, updating_health=1)
|
||||
if(has_dna() && TOXINLOVER in dna.species.specflags) //damage becomes healing and healing becomes damage
|
||||
amount = -amount
|
||||
if(amount > 0)
|
||||
blood_volume -= 5*amount
|
||||
else
|
||||
blood_volume -= amount
|
||||
return ..()
|
||||
|
||||
/mob/living/carbon/fakefire(var/fire_icon = "Generic_mob_burning")
|
||||
overlays_standing[FIRE_LAYER] = image("icon"='icons/mob/OnFire.dmi', "icon_state"= fire_icon, "layer"=-FIRE_LAYER)
|
||||
apply_overlay(FIRE_LAYER)
|
||||
@@ -799,3 +710,34 @@
|
||||
/mob/living/carbon/fakefireextinguish()
|
||||
remove_overlay(FIRE_LAYER)
|
||||
|
||||
|
||||
/mob/living/carbon/proc/devour_mob(mob/living/carbon/C, devour_time = 130)
|
||||
C.visible_message("<span class='danger'>[src] is attempting to devour [C]!</span>", \
|
||||
"<span class='userdanger'>[src] is attempting to devour you!</span>")
|
||||
if(!do_mob(src, C, devour_time))
|
||||
return
|
||||
if(pulling && pulling == C && grab_state >= GRAB_AGGRESSIVE && a_intent == "grab")
|
||||
C.visible_message("<span class='danger'>[src] devours [C]!</span>", \
|
||||
"<span class='userdanger'>[src] devours you!</span>")
|
||||
C.forceMove(src)
|
||||
stomach_contents.Add(C)
|
||||
add_logs(src, C, "devoured")
|
||||
|
||||
/mob/living/carbon/proc/create_bodyparts()
|
||||
for(var/X in bodyparts)
|
||||
var/obj/item/bodypart/O = new X()
|
||||
O.owner = src
|
||||
bodyparts.Remove(X)
|
||||
bodyparts.Add(O)
|
||||
if(O.body_part == ARM_LEFT)
|
||||
O.held_index = 1
|
||||
hand_bodyparts += O
|
||||
else if(O.body_part == ARM_RIGHT)
|
||||
O.held_index = 2
|
||||
hand_bodyparts += O
|
||||
|
||||
|
||||
/mob/living/carbon/proc/create_internal_organs()
|
||||
for(var/X in internal_organs)
|
||||
var/obj/item/organ/I = X
|
||||
I.Insert(src)
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
|
||||
/mob/living/carbon/get_eye_protection()
|
||||
var/number = ..()
|
||||
for(var/obj/item/organ/cyberimp/eyes/EFP in internal_organs)
|
||||
number += EFP.flash_protect
|
||||
return number
|
||||
|
||||
/mob/living/carbon/get_ear_protection()
|
||||
if(head && (head.flags & HEADBANGPROTECT))
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/check_projectile_dismemberment(obj/item/projectile/P, def_zone)
|
||||
var/obj/item/bodypart/affecting = get_bodypart(def_zone)
|
||||
if(affecting && affecting.dismemberable && affecting.get_damage() >= (affecting.max_damage - P.dismemberment))
|
||||
affecting.dismember(P.damtype)
|
||||
|
||||
/mob/living/carbon/hitby(atom/movable/AM, skipcatch, hitpush = 1, blocked = 0)
|
||||
if(!skipcatch) //ugly, but easy
|
||||
if(in_throw_mode && !get_active_held_item()) //empty active hand and we're in throw mode
|
||||
@@ -11,32 +27,42 @@
|
||||
return 1
|
||||
..()
|
||||
|
||||
/mob/living/carbon/throw_impact(atom/hit_atom)
|
||||
. = ..()
|
||||
if(hit_atom.density && isturf(hit_atom))
|
||||
Weaken(1)
|
||||
take_organ_damage(10)
|
||||
if(iscarbon(hit_atom))
|
||||
var/mob/living/carbon/victim = hit_atom
|
||||
victim.Weaken(1)
|
||||
Weaken(1)
|
||||
victim.take_organ_damage(10)
|
||||
take_organ_damage(10)
|
||||
visible_message("<span class='danger'>[src] crashes into [victim], knocking them both over!</span>", "<span class='userdanger'>You violently crash into [victim]!</span>")
|
||||
playsound(src,'sound/weapons/punch1.ogg',50,1)
|
||||
|
||||
/mob/living/carbon/attackby(obj/item/I, mob/user, params)
|
||||
if(lying && surgeries.len)
|
||||
if(user != src && user.a_intent == "help")
|
||||
for(var/datum/surgery/S in surgeries)
|
||||
if(S.next_step(user))
|
||||
return 1
|
||||
return ..()
|
||||
/mob/living/carbon/attacked_by(obj/item/I, mob/living/user)
|
||||
var/obj/item/bodypart/affecting = get_bodypart(ran_zone(user.zone_selected))
|
||||
if(!affecting) //missing limb? we select the first bodypart (you can never have zero, because of chest)
|
||||
affecting = bodyparts[1]
|
||||
send_item_attack_message(I, user, affecting.name)
|
||||
if(I.force)
|
||||
apply_damage(I.force, I.damtype, affecting)
|
||||
if(I.damtype == BRUTE && affecting.status == BODYPART_ORGANIC)
|
||||
if(prob(33))
|
||||
I.add_mob_blood(src)
|
||||
var/turf/location = get_turf(src)
|
||||
add_splatter_floor(location)
|
||||
if(get_dist(user, src) <= 1) //people with TK won't get smeared with blood
|
||||
user.add_mob_blood(src)
|
||||
|
||||
if(affecting.body_zone == "head")
|
||||
if(wear_mask)
|
||||
wear_mask.add_mob_blood(src)
|
||||
update_inv_wear_mask()
|
||||
if(head)
|
||||
head.add_mob_blood(src)
|
||||
update_inv_head()
|
||||
|
||||
//dismemberment
|
||||
var/probability = I.get_dismemberment_chance(affecting)
|
||||
if(prob(probability))
|
||||
if(affecting.dismember(I.damtype))
|
||||
I.add_mob_blood(src)
|
||||
playsound(get_turf(src), I.get_dismember_sound(), 80, 1)
|
||||
return TRUE //successful attack
|
||||
|
||||
/mob/living/carbon/attack_drone(mob/living/simple_animal/drone/user)
|
||||
return //so we don't call the carbon's attack_hand().
|
||||
|
||||
/mob/living/carbon/attack_hand(mob/living/carbon/human/user)
|
||||
if(!iscarbon(user))
|
||||
return
|
||||
|
||||
for(var/datum/disease/D in viruses)
|
||||
if(D.IsSpreadByTouch())
|
||||
@@ -55,9 +81,6 @@
|
||||
|
||||
|
||||
/mob/living/carbon/attack_paw(mob/living/carbon/monkey/M)
|
||||
if(!istype(M, /mob/living/carbon))
|
||||
return 0
|
||||
|
||||
for(var/datum/disease/D in viruses)
|
||||
if(D.IsSpreadByTouch())
|
||||
M.ContractDisease(D)
|
||||
@@ -101,20 +124,8 @@
|
||||
updatehealth()
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/proc/devour_mob(mob/living/carbon/C, devour_time = 130)
|
||||
C.visible_message("<span class='danger'>[src] is attempting to devour [C]!</span>", \
|
||||
"<span class='userdanger'>[src] is attempting to devour you!</span>")
|
||||
if(!do_mob(src, C, devour_time))
|
||||
return
|
||||
if(pulling && pulling == C && grab_state >= GRAB_AGGRESSIVE && a_intent == "grab")
|
||||
C.visible_message("<span class='danger'>[src] devours [C]!</span>", \
|
||||
"<span class='userdanger'>[src] devours you!</span>")
|
||||
C.forceMove(src)
|
||||
stomach_contents.Add(C)
|
||||
add_logs(src, C, "devoured")
|
||||
|
||||
/mob/living/carbon/proc/dismembering_strike(mob/living/attacker, dam_zone)
|
||||
if(!attacker.limb_destroyer || !has_limbs)
|
||||
if(!attacker.limb_destroyer)
|
||||
return dam_zone
|
||||
var/obj/item/bodypart/affecting
|
||||
if(dam_zone && attacker.client)
|
||||
@@ -134,3 +145,136 @@
|
||||
return null
|
||||
return affecting.body_zone
|
||||
return dam_zone
|
||||
|
||||
|
||||
/mob/living/carbon/blob_act(obj/effect/blob/B)
|
||||
if (stat == DEAD)
|
||||
return
|
||||
else
|
||||
show_message("<span class='userdanger'>The blob attacks!</span>")
|
||||
adjustBruteLoss(10)
|
||||
|
||||
/mob/living/carbon/emp_act(severity)
|
||||
for(var/X in internal_organs)
|
||||
var/obj/item/organ/O = X
|
||||
O.emp_act(severity)
|
||||
..()
|
||||
|
||||
/mob/living/carbon/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, override = 0, tesla_shock = 0)
|
||||
shock_damage *= siemens_coeff
|
||||
if(dna && dna.species)
|
||||
shock_damage *= dna.species.siemens_coeff
|
||||
if(shock_damage<1 && !override)
|
||||
return 0
|
||||
if(reagents.has_reagent("teslium"))
|
||||
shock_damage *= 1.5 //If the mob has teslium in their body, shocks are 50% more damaging!
|
||||
take_overall_damage(0,shock_damage)
|
||||
visible_message(
|
||||
"<span class='danger'>[src] was shocked by \the [source]!</span>", \
|
||||
"<span class='userdanger'>You feel a powerful shock coursing through your body!</span>", \
|
||||
"<span class='italics'>You hear a heavy electrical crack.</span>" \
|
||||
)
|
||||
jitteriness += 1000 //High numbers for violent convulsions
|
||||
do_jitter_animation(jitteriness)
|
||||
stuttering += 2
|
||||
if(!tesla_shock || (tesla_shock && siemens_coeff > 0.5))
|
||||
Stun(2)
|
||||
spawn(20)
|
||||
jitteriness = max(jitteriness - 990, 10) //Still jittery, but vastly less
|
||||
if(!tesla_shock || (tesla_shock && siemens_coeff > 0.5))
|
||||
Stun(3)
|
||||
Weaken(3)
|
||||
if(override)
|
||||
return override
|
||||
else
|
||||
return shock_damage
|
||||
|
||||
/mob/living/carbon/proc/help_shake_act(mob/living/carbon/M)
|
||||
if(on_fire)
|
||||
M << "<span class='warning'>You can't put them out with just your bare hands!"
|
||||
return
|
||||
|
||||
if(health >= 0 && !(status_flags & FAKEDEATH))
|
||||
|
||||
if(lying)
|
||||
M.visible_message("<span class='notice'>[M] shakes [src] trying to get them up!</span>", \
|
||||
"<span class='notice'>You shake [src] trying to get them up!</span>")
|
||||
else
|
||||
M.visible_message("<span class='notice'>[M] hugs [src] to make them feel better!</span>", \
|
||||
"<span class='notice'>You hug [src] to make them feel better!</span>")
|
||||
AdjustSleeping(-5)
|
||||
AdjustParalysis(-3)
|
||||
AdjustStunned(-3)
|
||||
AdjustWeakened(-3)
|
||||
if(resting)
|
||||
resting = 0
|
||||
update_canmove()
|
||||
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
|
||||
|
||||
/mob/living/carbon/flash_act(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0)
|
||||
. = ..()
|
||||
|
||||
var/damage = intensity - get_eye_protection()
|
||||
if(.) // we've been flashed
|
||||
if(visual)
|
||||
return
|
||||
if(weakeyes)
|
||||
Stun(2)
|
||||
|
||||
if (damage == 1)
|
||||
src << "<span class='warning'>Your eyes sting a little.</span>"
|
||||
if(prob(40))
|
||||
adjust_eye_damage(1)
|
||||
|
||||
else if (damage == 2)
|
||||
src << "<span class='warning'>Your eyes burn.</span>"
|
||||
adjust_eye_damage(rand(2, 4))
|
||||
|
||||
else if( damage > 3)
|
||||
src << "<span class='warning'>Your eyes itch and burn severely!</span>"
|
||||
adjust_eye_damage(rand(12, 16))
|
||||
|
||||
if(eye_damage > 10)
|
||||
blind_eyes(damage)
|
||||
blur_eyes(damage * rand(3, 6))
|
||||
|
||||
if(eye_damage > 20)
|
||||
if(prob(eye_damage - 20))
|
||||
if(become_nearsighted())
|
||||
src << "<span class='warning'>Your eyes start to burn badly!</span>"
|
||||
else if(prob(eye_damage - 25))
|
||||
if(become_blind())
|
||||
src << "<span class='warning'>You can't see anything!</span>"
|
||||
else
|
||||
src << "<span class='warning'>Your eyes are really starting to hurt. This can't be good for you!</span>"
|
||||
if(has_bane(BANE_LIGHT))
|
||||
mind.disrupt_spells(-500)
|
||||
return 1
|
||||
else if(damage == 0) // just enough protection
|
||||
if(prob(20))
|
||||
src << "<span class='notice'>Something bright flashes in the corner of your vision!</span>"
|
||||
if(has_bane(BANE_LIGHT))
|
||||
mind.disrupt_spells(0)
|
||||
|
||||
|
||||
/mob/living/carbon/soundbang_act(intensity = 1, stun_pwr = 1, damage_pwr = 5, deafen_pwr = 15)
|
||||
var/ear_safety = get_ear_protection()
|
||||
if(ear_safety < 2) //has ears
|
||||
var/effect_amount = intensity - ear_safety
|
||||
if(effect_amount > 0)
|
||||
if(stun_pwr)
|
||||
Stun(stun_pwr*effect_amount)
|
||||
Weaken(stun_pwr*effect_amount)
|
||||
if(deafen_pwr || damage_pwr)
|
||||
setEarDamage(ear_damage + damage_pwr*effect_amount, max(ear_deaf, deafen_pwr*effect_amount))
|
||||
if (ear_damage >= 15)
|
||||
src << "<span class='warning'>Your ears start to ring badly!</span>"
|
||||
if(prob(ear_damage - 5))
|
||||
src << "<span class='warning'>You can't hear anything!</span>"
|
||||
disabilities |= DEAF
|
||||
else if(ear_damage >= 5)
|
||||
src << "<span class='warning'>Your ears start to ring!</span>"
|
||||
src << sound('sound/weapons/flash_ring.ogg',0,1,0,250)
|
||||
return effect_amount //how soundbanged we are
|
||||
|
||||
@@ -16,6 +16,11 @@
|
||||
var/obj/item/weapon/tank/internal = null
|
||||
var/obj/item/head = null
|
||||
|
||||
var/obj/item/gloves = null //only used by humans
|
||||
var/obj/item/shoes = null //only used by humans.
|
||||
var/obj/item/clothing/glasses/glasses = null //only used by humans.
|
||||
var/obj/item/ears = null //only used by humans.
|
||||
|
||||
var/datum/dna/dna = null//Carbon
|
||||
|
||||
var/failed_last_breath = 0 //This is used to determine if the mob failed a breath. If they did fail a brath, they will attempt to breathe each tick, otherwise just once per 4 ticks.
|
||||
@@ -32,4 +37,8 @@
|
||||
|
||||
var/tinttotal = 0 // Total level of visualy impairing items
|
||||
|
||||
var/list/bodyparts = list() //Gets filled up in the constructor (New() proc in human.dm and monkey.dm)
|
||||
var/list/bodyparts = list(/obj/item/bodypart/chest, /obj/item/bodypart/head, /obj/item/bodypart/l_arm,
|
||||
/obj/item/bodypart/r_arm, /obj/item/bodypart/r_leg, /obj/item/bodypart/l_leg)
|
||||
//Gets filled up in create_bodyparts()
|
||||
|
||||
var/list/hand_bodyparts = list() //a collection of arms (or actually whatever the fug /bodyparts you monsters use to wreck my systems)
|
||||
@@ -1,6 +1,13 @@
|
||||
/mob/living/carbon/movement_delay()
|
||||
. = ..()
|
||||
. += grab_state * 3
|
||||
. += grab_state * 3 //can't go fast while grabbing something.
|
||||
|
||||
if(!get_leg_ignore()) //ignore the fact we lack legs
|
||||
var/leg_amount = get_num_legs()
|
||||
. += 6 - 3*leg_amount //the fewer the legs, the slower the mob
|
||||
if(!leg_amount)
|
||||
. += 6 - 3*get_num_arms() //crawling is harder with fewer arms
|
||||
|
||||
if(legcuffed)
|
||||
. += legcuffed.slowdown
|
||||
|
||||
|
||||
@@ -0,0 +1,191 @@
|
||||
|
||||
|
||||
/mob/living/carbon/apply_damage(damage, damagetype = BRUTE, def_zone = null, blocked = 0)
|
||||
var/hit_percent = (100-blocked)/100
|
||||
if(!damage || hit_percent <= 0)
|
||||
return 0
|
||||
|
||||
var/obj/item/bodypart/BP = null
|
||||
if(islimb(def_zone)) //we specified a bodypart object
|
||||
BP = def_zone
|
||||
else
|
||||
if(!def_zone)
|
||||
def_zone = ran_zone(def_zone)
|
||||
BP = get_bodypart(check_zone(def_zone))
|
||||
if(!BP)
|
||||
BP = bodyparts[1]
|
||||
|
||||
switch(damagetype)
|
||||
if(BRUTE)
|
||||
if(BP)
|
||||
if(BP.take_damage(damage * hit_percent, 0))
|
||||
update_damage_overlays()
|
||||
else //no bodypart, we deal damage with a more general method.
|
||||
adjustBruteLoss(damage * hit_percent)
|
||||
if(BURN)
|
||||
if(BP)
|
||||
if(BP.take_damage(0, damage * hit_percent))
|
||||
update_damage_overlays()
|
||||
else
|
||||
adjustFireLoss(damage * hit_percent)
|
||||
if(TOX)
|
||||
adjustToxLoss(damage * hit_percent)
|
||||
if(OXY)
|
||||
adjustOxyLoss(damage * hit_percent)
|
||||
if(CLONE)
|
||||
adjustCloneLoss(damage * hit_percent)
|
||||
if(STAMINA)
|
||||
adjustStaminaLoss(damage * hit_percent)
|
||||
return 1
|
||||
|
||||
|
||||
//These procs fetch a cumulative total damage from all bodyparts
|
||||
/mob/living/carbon/getBruteLoss()
|
||||
var/amount = 0
|
||||
for(var/X in bodyparts)
|
||||
var/obj/item/bodypart/BP = X
|
||||
amount += BP.brute_dam
|
||||
return amount
|
||||
|
||||
/mob/living/carbon/getFireLoss()
|
||||
var/amount = 0
|
||||
for(var/X in bodyparts)
|
||||
var/obj/item/bodypart/BP = X
|
||||
amount += BP.burn_dam
|
||||
return amount
|
||||
|
||||
|
||||
/mob/living/carbon/adjustBruteLoss(amount, updating_health = 1)
|
||||
if(status_flags & GODMODE)
|
||||
return 0
|
||||
if(amount > 0)
|
||||
take_overall_damage(amount, 0)
|
||||
else
|
||||
heal_overall_damage(-amount, 0, 0, 1, updating_health)
|
||||
|
||||
/mob/living/carbon/adjustFireLoss(amount)
|
||||
if(status_flags & GODMODE)
|
||||
return 0
|
||||
if(amount > 0)
|
||||
take_overall_damage(0, amount)
|
||||
else
|
||||
heal_overall_damage(0, -amount)
|
||||
|
||||
|
||||
/mob/living/carbon/adjustToxLoss(amount, updating_health=1)
|
||||
if(has_dna() && TOXINLOVER in dna.species.specflags) //damage becomes healing and healing becomes damage
|
||||
amount = -amount
|
||||
if(amount > 0)
|
||||
blood_volume -= 5*amount
|
||||
else
|
||||
blood_volume -= amount
|
||||
return ..()
|
||||
|
||||
////////////////////////////////////////////
|
||||
|
||||
//Returns a list of damaged bodyparts
|
||||
/mob/living/carbon/proc/get_damaged_bodyparts(brute, burn)
|
||||
var/list/obj/item/bodypart/parts = list()
|
||||
for(var/X in bodyparts)
|
||||
var/obj/item/bodypart/BP = X
|
||||
if((brute && BP.brute_dam) || (burn && BP.burn_dam))
|
||||
parts += BP
|
||||
return parts
|
||||
|
||||
//Returns a list of damageable bodyparts
|
||||
/mob/living/carbon/proc/get_damageable_bodyparts()
|
||||
var/list/obj/item/bodypart/parts = list()
|
||||
for(var/X in bodyparts)
|
||||
var/obj/item/bodypart/BP = X
|
||||
if(BP.brute_dam + BP.burn_dam < BP.max_damage)
|
||||
parts += BP
|
||||
return parts
|
||||
|
||||
//Heals ONE bodypart randomly selected from damaged ones.
|
||||
//It automatically updates damage overlays if necessary
|
||||
//It automatically updates health status
|
||||
/mob/living/carbon/heal_bodypart_damage(brute, burn, only_robotic = 0, only_organic = 1)
|
||||
var/list/obj/item/bodypart/parts = get_damaged_bodyparts(brute,burn)
|
||||
if(!parts.len)
|
||||
return
|
||||
var/obj/item/bodypart/picked = pick(parts)
|
||||
if(picked.heal_damage(brute, burn, only_robotic, only_organic))
|
||||
update_damage_overlays()
|
||||
|
||||
//Damages ONE bodypart randomly selected from damagable ones.
|
||||
//It automatically updates damage overlays if necessary
|
||||
//It automatically updates health status
|
||||
/mob/living/carbon/take_bodypart_damage(brute, burn)
|
||||
var/list/obj/item/bodypart/parts = get_damageable_bodyparts()
|
||||
if(!parts.len)
|
||||
return
|
||||
var/obj/item/bodypart/picked = pick(parts)
|
||||
if(picked.take_damage(brute,burn))
|
||||
update_damage_overlays()
|
||||
|
||||
|
||||
//Heal MANY bodyparts, in random order
|
||||
/mob/living/carbon/heal_overall_damage(brute, burn, only_robotic = 0, only_organic = 1, updating_health = 1)
|
||||
var/list/obj/item/bodypart/parts = get_damaged_bodyparts(brute,burn)
|
||||
|
||||
var/update = 0
|
||||
while(parts.len && (brute>0 || burn>0) )
|
||||
var/obj/item/bodypart/picked = pick(parts)
|
||||
|
||||
var/brute_was = picked.brute_dam
|
||||
var/burn_was = picked.burn_dam
|
||||
|
||||
update |= picked.heal_damage(brute,burn, only_robotic, only_organic, 0)
|
||||
|
||||
brute -= (brute_was-picked.brute_dam)
|
||||
burn -= (burn_was-picked.burn_dam)
|
||||
|
||||
parts -= picked
|
||||
if(updating_health)
|
||||
updatehealth()
|
||||
if(update)
|
||||
update_damage_overlays()
|
||||
|
||||
// damage MANY bodyparts, in random order
|
||||
/mob/living/carbon/take_overall_damage(brute, burn, updating_health = 1)
|
||||
if(status_flags & GODMODE)
|
||||
return //godmode
|
||||
|
||||
var/list/obj/item/bodypart/parts = get_damageable_bodyparts()
|
||||
var/update = 0
|
||||
while(parts.len && (brute>0 || burn>0) )
|
||||
var/obj/item/bodypart/picked = pick(parts)
|
||||
var/brute_per_part = round(brute/parts.len, 0.01)
|
||||
var/burn_per_part = round(burn/parts.len, 0.01)
|
||||
|
||||
var/brute_was = picked.brute_dam
|
||||
var/burn_was = picked.burn_dam
|
||||
|
||||
|
||||
update |= picked.take_damage(brute_per_part,burn_per_part, 0)
|
||||
|
||||
brute -= (picked.brute_dam - brute_was)
|
||||
burn -= (picked.burn_dam - burn_was)
|
||||
|
||||
parts -= picked
|
||||
if(updating_health)
|
||||
updatehealth()
|
||||
if(update)
|
||||
update_damage_overlays()
|
||||
|
||||
|
||||
|
||||
/mob/living/carbon/adjustStaminaLoss(amount, updating_stamina = 1)
|
||||
if(status_flags & GODMODE)
|
||||
return 0
|
||||
staminaloss = Clamp(staminaloss + amount, 0, maxHealth*2)
|
||||
if(updating_stamina)
|
||||
update_stamina()
|
||||
|
||||
|
||||
/mob/living/carbon/setStaminaLoss(amount, updating_stamina = 1)
|
||||
if(status_flags & GODMODE)
|
||||
return 0
|
||||
staminaloss = amount
|
||||
if(updating_stamina)
|
||||
update_stamina()
|
||||
@@ -3,19 +3,43 @@
|
||||
losebreath = 0
|
||||
..()
|
||||
|
||||
/mob/living/carbon/gib(no_brain, no_organs)
|
||||
/mob/living/carbon/gib(no_brain, no_organs, no_bodyparts)
|
||||
for(var/mob/M in src)
|
||||
if(M in stomach_contents)
|
||||
stomach_contents.Remove(M)
|
||||
M.loc = loc
|
||||
M.forceMove(loc)
|
||||
visible_message("<span class='danger'>[M] bursts out of [src]!</span>")
|
||||
..()
|
||||
|
||||
/mob/living/carbon/spill_organs(no_brain)
|
||||
for(var/obj/item/organ/I in internal_organs)
|
||||
if(no_brain && istype(I, /obj/item/organ/brain))
|
||||
continue
|
||||
if(I)
|
||||
/mob/living/carbon/spill_organs(no_brain, no_organs, no_bodyparts)
|
||||
if(!no_bodyparts)
|
||||
if(no_organs)//so the organs don't get transfered inside the bodyparts we'll drop.
|
||||
for(var/X in internal_organs)
|
||||
qdel(X)
|
||||
else //we're going to drop all bodyparts except chest, so the only organs that needs spilling are those inside it.
|
||||
for(var/X in internal_organs)
|
||||
var/obj/item/organ/O = X
|
||||
if(no_brain && istype(O, /obj/item/organ/brain))
|
||||
qdel(O) //so the brain isn't transfered to the head when the head drops.
|
||||
continue
|
||||
var/org_zone = check_zone(O.zone) //both groin and chest organs.
|
||||
if(org_zone == "chest")
|
||||
O.Remove(src)
|
||||
O.forceMove(get_turf(src))
|
||||
O.throw_at_fast(get_edge_target_turf(src,pick(alldirs)),rand(1,3),5)
|
||||
else
|
||||
for(var/X in internal_organs)
|
||||
var/obj/item/organ/I = X
|
||||
if(no_brain && istype(I, /obj/item/organ/brain))
|
||||
qdel(I)
|
||||
continue
|
||||
I.Remove(src)
|
||||
I.loc = get_turf(src)
|
||||
I.forceMove(get_turf(src))
|
||||
I.throw_at_fast(get_edge_target_turf(src,pick(alldirs)),rand(1,3),5)
|
||||
|
||||
|
||||
/mob/living/carbon/spread_bodyparts()
|
||||
for(var/X in bodyparts)
|
||||
var/obj/item/bodypart/BP = X
|
||||
BP.drop_limb()
|
||||
BP.throw_at_fast(get_edge_target_turf(src,pick(alldirs)),rand(1,3),5)
|
||||
@@ -2,7 +2,7 @@
|
||||
var/msg = "<span class='info'>*---------*\nThis is \icon[src] \a <EM>[src]</EM>!\n"
|
||||
|
||||
if (handcuffed)
|
||||
msg += "It is \icon[src.handcuffed] handcuffed!\n"
|
||||
msg += "<span class='warning'>It is \icon[src.handcuffed] handcuffed!</span>\n"
|
||||
if (head)
|
||||
msg += "It has \icon[src.head] \a [src.head] on its head. \n"
|
||||
if (wear_mask)
|
||||
@@ -17,52 +17,65 @@
|
||||
|
||||
if (back)
|
||||
msg += "It has \icon[src.back] \a [src.back] on its back.\n"
|
||||
var/appears_dead = 0
|
||||
if (stat == DEAD)
|
||||
msg += "<span class='deadsay'>It is limp and unresponsive, with no signs of life.</span>\n"
|
||||
else
|
||||
msg += "<span class='warning'>"
|
||||
var/temp = getBruteLoss()
|
||||
if(temp)
|
||||
if (temp < 30)
|
||||
msg += "It has minor bruising.\n"
|
||||
else
|
||||
msg += "<B>It has severe bruising!</B>\n"
|
||||
appears_dead = 1
|
||||
if(getorgan(/obj/item/organ/brain))
|
||||
msg += "<span class='deadsay'>It is limp and unresponsive, with no signs of life.</span>\n"
|
||||
else if(get_bodypart("head"))
|
||||
msg += "<span class='deadsay'>It appears that it's brain is missing...</span>\n"
|
||||
|
||||
temp = getFireLoss()
|
||||
if(temp)
|
||||
if (temp < 30)
|
||||
msg += "It has minor burns.\n"
|
||||
else
|
||||
msg += "<B>It has severe burns!</B>\n"
|
||||
var/list/missing = get_missing_limbs()
|
||||
for(var/t in missing)
|
||||
if(t=="head")
|
||||
msg += "<span class='deadsay'><B>Its [parse_zone(t)] is missing!</B></span>\n"
|
||||
continue
|
||||
msg += "<<span class='warning'><B>Its [parse_zone(t)] is missing!</B></span>\n"
|
||||
|
||||
temp = getCloneLoss()
|
||||
if(temp)
|
||||
if(getCloneLoss() < 30)
|
||||
msg += "It is slightly deformed.\n"
|
||||
else
|
||||
msg += "<b>It is severely deformed.</b>\n"
|
||||
msg += "<span class='warning'>"
|
||||
var/temp = getBruteLoss()
|
||||
if(temp)
|
||||
if (temp < 30)
|
||||
msg += "It has minor bruising.\n"
|
||||
else
|
||||
msg += "<B>It has severe bruising!</B>\n"
|
||||
|
||||
if(getBrainLoss() > 60)
|
||||
msg += "It seems to be clumsy and unable to think.\n"
|
||||
temp = getFireLoss()
|
||||
if(temp)
|
||||
if (temp < 30)
|
||||
msg += "It has minor burns.\n"
|
||||
else
|
||||
msg += "<B>It has severe burns!</B>\n"
|
||||
|
||||
if(fire_stacks > 0)
|
||||
msg += "It's covered in something flammable.\n"
|
||||
if(fire_stacks < 0)
|
||||
msg += "It's soaked in water.\n"
|
||||
temp = getCloneLoss()
|
||||
if(temp)
|
||||
if(getCloneLoss() < 30)
|
||||
msg += "It is slightly deformed.\n"
|
||||
else
|
||||
msg += "<b>It is severely deformed.</b>\n"
|
||||
|
||||
if(pulledby && pulledby.grab_state)
|
||||
msg += "It's restrained by [pulledby]'s grip.\n"
|
||||
if(getBrainLoss() > 60)
|
||||
msg += "It seems to be clumsy and unable to think.\n"
|
||||
|
||||
if(fire_stacks > 0)
|
||||
msg += "It's covered in something flammable.\n"
|
||||
if(fire_stacks < 0)
|
||||
msg += "It's soaked in water.\n"
|
||||
|
||||
if(pulledby && pulledby.grab_state)
|
||||
msg += "It's restrained by [pulledby]'s grip.\n"
|
||||
|
||||
msg += "</span>"
|
||||
|
||||
if(!appears_dead)
|
||||
if(stat == UNCONSCIOUS)
|
||||
msg += "It isn't responding to anything around it; it seems to be asleep.\n"
|
||||
msg += "</span>"
|
||||
|
||||
if(digitalcamo)
|
||||
msg += "It is moving its body in an unnatural and blatantly unsimian manner.\n"
|
||||
if(digitalcamo)
|
||||
msg += "It is moving its body in an unnatural and blatantly unsimian manner.\n"
|
||||
|
||||
|
||||
if(!getorgan(/obj/item/organ/brain))
|
||||
msg += "<span class='deadsay'>It appears that it's brain is missing...</span>\n"
|
||||
|
||||
msg += "*---------*</span>"
|
||||
|
||||
user << msg
|
||||
user << msg
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
|
||||
|
||||
/mob/living/carbon/human/apply_damage(damage = 0,damagetype = BRUTE, def_zone = null, blocked = 0)
|
||||
// depending on the species, it will run the corresponding apply_damage code there
|
||||
return dna.species.apply_damage(damage, damagetype, def_zone, blocked, src)
|
||||
@@ -4,8 +4,11 @@
|
||||
/mob/living/carbon/human/dust_animation()
|
||||
PoolOrNew(/obj/effect/overlay/temp/dust_animation, list(loc, "dust-h"))
|
||||
|
||||
/mob/living/carbon/human/spawn_gibs()
|
||||
hgibs(loc, viruses, dna)
|
||||
/mob/living/carbon/human/spawn_gibs(with_bodyparts)
|
||||
if(with_bodyparts)
|
||||
new /obj/effect/gibspawner/human(loc, viruses, dna)
|
||||
else
|
||||
new /obj/effect/gibspawner/humanbodypartless(loc, viruses, dna)
|
||||
|
||||
/mob/living/carbon/human/spawn_dust()
|
||||
new /obj/effect/decal/remains/human(loc)
|
||||
@@ -40,21 +43,9 @@
|
||||
set_species(/datum/species/skeleton)
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/proc/ChangeToHusk()
|
||||
if(disabilities & HUSK)
|
||||
return
|
||||
disabilities |= HUSK
|
||||
status_flags |= DISFIGURED //makes them unknown without fucking up other stuff like admintools
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/human/ChangeToHusk()
|
||||
. = ..()
|
||||
if(.)
|
||||
update_hair()
|
||||
update_body()
|
||||
|
||||
/mob/living/carbon/proc/Drain()
|
||||
ChangeToHusk()
|
||||
become_husk()
|
||||
disabilities |= NOCLONE
|
||||
blood_volume = 0
|
||||
return 1
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
real_name = "Unknown"
|
||||
voice_name = "Unknown"
|
||||
icon = 'icons/mob/human.dmi'
|
||||
icon_state = "caucasian1_m_s"
|
||||
icon_state = "caucasian_m_s"
|
||||
|
||||
|
||||
|
||||
@@ -18,18 +18,7 @@
|
||||
verbs += /mob/living/proc/lay_down
|
||||
|
||||
//initialize limbs first
|
||||
bodyparts = newlist(/obj/item/bodypart/chest, /obj/item/bodypart/head, /obj/item/bodypart/r_leg, /obj/item/bodypart/l_leg)
|
||||
var/obj/item/bodypart/l_arm/l_arm = new()
|
||||
var/obj/item/bodypart/r_arm/r_arm = new()
|
||||
bodyparts += l_arm
|
||||
bodyparts += r_arm
|
||||
l_arm.held_index = 1
|
||||
r_arm.held_index = 2
|
||||
hand_bodyparts += l_arm
|
||||
hand_bodyparts += r_arm
|
||||
for(var/X in bodyparts)
|
||||
var/obj/item/bodypart/O = X
|
||||
O.owner = src
|
||||
create_bodyparts()
|
||||
|
||||
//initialize dna. for spawned humans; overwritten by other code
|
||||
create_dna(src)
|
||||
@@ -40,21 +29,7 @@
|
||||
set_species(dna.species.type)
|
||||
|
||||
//initialise organs
|
||||
if(!(NOHUNGER in dna.species.specflags))
|
||||
internal_organs += new /obj/item/organ/appendix
|
||||
|
||||
if(!(NOBREATH in dna.species.specflags))
|
||||
internal_organs += new /obj/item/organ/lungs
|
||||
|
||||
if(!(NOBLOOD in dna.species.specflags))
|
||||
internal_organs += new /obj/item/organ/heart
|
||||
|
||||
internal_organs += new /obj/item/organ/brain
|
||||
|
||||
//Note: Additional organs are generated/replaced on the dna.species level
|
||||
|
||||
for(var/obj/item/organ/I in internal_organs)
|
||||
I.Insert(src)
|
||||
create_internal_organs()
|
||||
|
||||
martial_art = default_martial_art
|
||||
|
||||
@@ -62,6 +37,16 @@
|
||||
|
||||
..()
|
||||
|
||||
/mob/living/carbon/human/create_internal_organs()
|
||||
if(!(NOHUNGER in dna.species.specflags))
|
||||
internal_organs += new /obj/item/organ/appendix
|
||||
if(!(NOBREATH in dna.species.specflags))
|
||||
internal_organs += new /obj/item/organ/lungs
|
||||
if(!(NOBLOOD in dna.species.specflags))
|
||||
internal_organs += new /obj/item/organ/heart
|
||||
internal_organs += new /obj/item/organ/brain
|
||||
..()
|
||||
|
||||
/mob/living/carbon/human/OpenCraftingMenu()
|
||||
handcrafting.ui_interact(src)
|
||||
|
||||
@@ -123,87 +108,6 @@
|
||||
stat("*", "[D.name], Type: [D.spread_text], Stage: [D.stage]/[D.max_stages], Possible Cure: [D.cure_text]")
|
||||
|
||||
|
||||
/mob/living/carbon/human/ex_act(severity, ex_target)
|
||||
var/b_loss = null
|
||||
var/f_loss = null
|
||||
var/bomb_armor = getarmor(null, "bomb")
|
||||
if(istype(ex_target, /datum/spacevine_mutation) && isvineimmune(src))
|
||||
return
|
||||
|
||||
switch (severity)
|
||||
if (1)
|
||||
b_loss += 500
|
||||
if (prob(bomb_armor))
|
||||
shred_clothing(1,150)
|
||||
var/atom/target = get_edge_target_turf(src, get_dir(src, get_step_away(src, src)))
|
||||
throw_at(target, 200, 4)
|
||||
else
|
||||
gib()
|
||||
return
|
||||
|
||||
if (2)
|
||||
b_loss += 60
|
||||
|
||||
f_loss += 60
|
||||
if (prob(bomb_armor))
|
||||
b_loss = b_loss/1.5
|
||||
f_loss = f_loss/1.5
|
||||
shred_clothing(1,25)
|
||||
else
|
||||
shred_clothing(1,50)
|
||||
|
||||
if (!istype(ears, /obj/item/clothing/ears/earmuffs))
|
||||
adjustEarDamage(30, 120)
|
||||
if (prob(70))
|
||||
Paralyse(10)
|
||||
|
||||
if(3)
|
||||
b_loss += 30
|
||||
if (prob(bomb_armor))
|
||||
b_loss = b_loss/2
|
||||
if (!istype(ears, /obj/item/clothing/ears/earmuffs))
|
||||
adjustEarDamage(15,60)
|
||||
if (prob(50))
|
||||
Paralyse(10)
|
||||
|
||||
take_overall_damage(b_loss,f_loss)
|
||||
//attempt to dismember bodyparts
|
||||
if(severity <= 2 || !bomb_armor)
|
||||
var/max_limb_loss = round(4/severity) //so you don't lose four limbs at severity 3.
|
||||
for(var/X in bodyparts)
|
||||
var/obj/item/bodypart/BP = X
|
||||
if(prob(50/severity) && !prob(getarmor(BP, "bomb")) && BP.body_zone != "head" && BP.body_zone != "chest")
|
||||
BP.brute_dam = BP.max_damage
|
||||
BP.dismember()
|
||||
max_limb_loss--
|
||||
if(!max_limb_loss)
|
||||
break
|
||||
..()
|
||||
|
||||
/mob/living/carbon/human/blob_act(obj/effect/blob/B)
|
||||
if(stat == DEAD)
|
||||
return
|
||||
show_message("<span class='userdanger'>The blob attacks you!</span>")
|
||||
var/dam_zone = pick("chest", "l_hand", "r_hand", "l_leg", "r_leg")
|
||||
var/obj/item/bodypart/affecting = get_bodypart(ran_zone(dam_zone))
|
||||
apply_damage(5, BRUTE, affecting, run_armor_check(affecting, "melee"))
|
||||
return
|
||||
|
||||
/mob/living/carbon/human/bullet_act()
|
||||
if(martial_art && martial_art.deflection_chance) //Some martial arts users can deflect projectiles!
|
||||
if(!prob(martial_art.deflection_chance))
|
||||
return ..()
|
||||
if(!src.lying && dna && !dna.check_mutation(HULK)) //But only if they're not lying down, and hulks can't do it
|
||||
src.visible_message("<span class='danger'>[src] deflects the projectile; they can't be hit with ranged weapons!</span>", "<span class='userdanger'>You deflect the projectile!</span>")
|
||||
playsound(src, pick("sound/weapons/bulletflyby.ogg","sound/weapons/bulletflyby2.ogg","sound/weapons/bulletflyby3.ogg"), 75, 1)
|
||||
return 0
|
||||
..()
|
||||
|
||||
/mob/living/carbon/human/attack_ui(slot)
|
||||
if(!has_hand_for_held_index(active_hand_index))
|
||||
return 0
|
||||
return ..()
|
||||
|
||||
/mob/living/carbon/human/show_inv(mob/user)
|
||||
user.set_machine(src)
|
||||
var/has_breathable_mask = istype(wear_mask, /obj/item/clothing/mask)
|
||||
@@ -300,35 +204,6 @@
|
||||
|
||||
spreadFire(AM)
|
||||
|
||||
//Added a safety check in case you want to shock a human mob directly through electrocute_act.
|
||||
/mob/living/carbon/human/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, safety = 0, override = 0, tesla_shock = 0)
|
||||
if(tesla_shock)
|
||||
var/total_coeff = 1
|
||||
if(gloves)
|
||||
var/obj/item/clothing/gloves/G = gloves
|
||||
if(G.siemens_coefficient <= 0)
|
||||
total_coeff -= 0.5
|
||||
if(wear_suit)
|
||||
var/obj/item/clothing/suit/S = wear_suit
|
||||
if(S.siemens_coefficient <= 0)
|
||||
total_coeff -= 0.95
|
||||
siemens_coeff = total_coeff
|
||||
else if(!safety)
|
||||
var/gloves_siemens_coeff = 1
|
||||
if(gloves)
|
||||
var/obj/item/clothing/gloves/G = gloves
|
||||
gloves_siemens_coeff = G.siemens_coefficient
|
||||
siemens_coeff = gloves_siemens_coeff
|
||||
if(heart_attack)
|
||||
if(shock_damage * siemens_coeff >= 1 && prob(25))
|
||||
heart_attack = 0
|
||||
if(stat == CONSCIOUS)
|
||||
src << "<span class='notice'>You feel your heart beating again!</span>"
|
||||
. = ..(shock_damage,source,siemens_coeff,safety,override,tesla_shock)
|
||||
if(.)
|
||||
electrocution_animation(40)
|
||||
|
||||
|
||||
|
||||
/mob/living/carbon/human/Topic(href, href_list)
|
||||
if(usr.canUseTopic(src, BE_CLOSE, NO_DEXTERY))
|
||||
@@ -734,17 +609,6 @@
|
||||
update_body()
|
||||
update_hair()
|
||||
|
||||
/mob/living/carbon/human/singularity_act()
|
||||
var/gain = 20
|
||||
if(mind)
|
||||
if((mind.assigned_role == "Station Engineer") || (mind.assigned_role == "Chief Engineer") )
|
||||
gain = 100
|
||||
if(mind.assigned_role == "Clown")
|
||||
gain = rand(-300, 300)
|
||||
investigate_log("([key_name(src)]) has been consumed by the singularity.","singulo") //Oh that's where the clown ended up!
|
||||
gib()
|
||||
return(gain)
|
||||
|
||||
/mob/living/carbon/human/singularity_pull(S, current_size)
|
||||
if(current_size >= STAGE_THREE)
|
||||
for(var/obj/item/hand in held_items)
|
||||
@@ -756,71 +620,6 @@
|
||||
return
|
||||
..()
|
||||
|
||||
|
||||
/mob/living/carbon/human/help_shake_act(mob/living/carbon/M)
|
||||
if(!istype(M))
|
||||
return
|
||||
|
||||
if(health >= 0)
|
||||
if(src == M)
|
||||
visible_message( \
|
||||
"[src] examines \himself.", \
|
||||
"<span class='notice'>You check yourself for injuries.</span>")
|
||||
|
||||
var/list/missing = list("head", "chest", "l_arm", "r_arm", "l_leg", "r_leg")
|
||||
for(var/X in bodyparts)
|
||||
var/obj/item/bodypart/LB = X
|
||||
missing -= LB.body_zone
|
||||
var/status = ""
|
||||
var/brutedamage = LB.brute_dam
|
||||
var/burndamage = LB.burn_dam
|
||||
if(hallucination)
|
||||
if(prob(30))
|
||||
brutedamage += rand(30,40)
|
||||
if(prob(30))
|
||||
burndamage += rand(30,40)
|
||||
|
||||
if(brutedamage > 0)
|
||||
status = "bruised"
|
||||
if(brutedamage > 20)
|
||||
status = "battered"
|
||||
if(brutedamage > 40)
|
||||
status = "mangled"
|
||||
if(brutedamage > 0 && burndamage > 0)
|
||||
status += " and "
|
||||
if(burndamage > 40)
|
||||
status += "peeling away"
|
||||
|
||||
else if(burndamage > 10)
|
||||
status += "blistered"
|
||||
else if(burndamage > 0)
|
||||
status += "numb"
|
||||
if(status == "")
|
||||
status = "OK"
|
||||
src << "\t [status == "OK" ? "\blue" : "\red"] Your [LB.name] is [status]."
|
||||
|
||||
for(var/obj/item/I in LB.embedded_objects)
|
||||
src << "\t <a href='byond://?src=\ref[src];embedded_object=\ref[I];embedded_limb=\ref[LB]'>\red There is \a [I] embedded in your [LB.name]!</a>"
|
||||
|
||||
for(var/t in missing)
|
||||
src << "<span class='boldannounce'>Your [parse_zone(t)] is missing!</span>"
|
||||
|
||||
if(bleed_rate)
|
||||
src << "<span class='danger'>You are bleeding!</span>"
|
||||
if(staminaloss)
|
||||
if(staminaloss > 30)
|
||||
src << "<span class='info'>You're completely exhausted.</span>"
|
||||
else
|
||||
src << "<span class='info'>You feel fatigued.</span>"
|
||||
else
|
||||
if(wear_suit)
|
||||
wear_suit.add_fingerprint(M)
|
||||
else if(w_uniform)
|
||||
w_uniform.add_fingerprint(M)
|
||||
|
||||
..()
|
||||
|
||||
|
||||
/mob/living/carbon/human/proc/do_cpr(mob/living/carbon/C)
|
||||
CHECK_DNA_AND_SPECIES(C)
|
||||
|
||||
@@ -1010,7 +809,6 @@
|
||||
hud_used.healthdoll.icon_state = "healthdoll_DEAD"
|
||||
|
||||
/mob/living/carbon/human/fully_heal(admin_revive = 0)
|
||||
CHECK_DNA_AND_SPECIES(src)
|
||||
|
||||
if(admin_revive)
|
||||
regenerate_limbs()
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
/mob/living/carbon/human/attack_alien(mob/living/carbon/alien/humanoid/M)
|
||||
if(check_shields(0, M.name))
|
||||
visible_message("<span class='danger'>[M] attempted to touch [src]!</span>")
|
||||
return 0
|
||||
|
||||
if(..())
|
||||
if(M.a_intent == "harm")
|
||||
if (w_uniform)
|
||||
w_uniform.add_fingerprint(M)
|
||||
var/damage = prob(90) ? 20 : 0
|
||||
if(!damage)
|
||||
playsound(loc, 'sound/weapons/slashmiss.ogg', 50, 1, -1)
|
||||
visible_message("<span class='danger'>[M] has lunged at [src]!</span>", \
|
||||
"<span class='userdanger'>[M] has lunged at [src]!</span>")
|
||||
return 0
|
||||
var/obj/item/bodypart/affecting = get_bodypart(ran_zone(M.zone_selected))
|
||||
var/armor_block = run_armor_check(affecting, "melee","","",10)
|
||||
|
||||
playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1)
|
||||
visible_message("<span class='danger'>[M] has slashed at [src]!</span>", \
|
||||
"<span class='userdanger'>[M] has slashed at [src]!</span>")
|
||||
if(!dismembering_strike(M, M.zone_selected)) //Dismemberment successful
|
||||
return 1
|
||||
apply_damage(damage, BRUTE, affecting, armor_block)
|
||||
add_logs(M, src, "attacked")
|
||||
updatehealth()
|
||||
|
||||
if(M.a_intent == "disarm") //Always drop item in hand, if no item, get stunned instead.
|
||||
if(get_active_held_item() && drop_item())
|
||||
playsound(loc, 'sound/weapons/slash.ogg', 25, 1, -1)
|
||||
visible_message("<span class='danger'>[M] disarmed [src]!</span>", \
|
||||
"<span class='userdanger'>[M] disarmed [src]!</span>")
|
||||
else
|
||||
playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1)
|
||||
Weaken(5)
|
||||
add_logs(M, src, "tackled")
|
||||
visible_message("<span class='danger'>[M] has tackled down [src]!</span>", \
|
||||
"<span class='userdanger'>[M] has tackled down [src]!</span>")
|
||||
return
|
||||
@@ -1,14 +0,0 @@
|
||||
/mob/living/carbon/human/attack_hulk(mob/living/carbon/human/user)
|
||||
if(user.a_intent == "harm")
|
||||
..(user, 1)
|
||||
playsound(loc, user.dna.species.attack_sound, 25, 1, -1)
|
||||
var/hulk_verb = pick("smash","pummel")
|
||||
visible_message("<span class='danger'>[user] has [hulk_verb]ed [src]!</span>", \
|
||||
"<span class='userdanger'>[user] has [hulk_verb]ed [src]!</span>")
|
||||
adjustBruteLoss(15)
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/human/attack_hand(mob/living/carbon/human/M)
|
||||
if(..()) //to allow surgery to return properly.
|
||||
return
|
||||
dna.species.spec_attack_hand(M, src)
|
||||
@@ -1,18 +0,0 @@
|
||||
/mob/living/carbon/human/attack_paw(mob/living/carbon/monkey/M)
|
||||
var/dam_zone = pick("chest", "l_hand", "r_hand", "l_leg", "r_leg")
|
||||
var/obj/item/bodypart/affecting = get_bodypart(ran_zone(dam_zone))
|
||||
|
||||
if(M.a_intent == "help")
|
||||
..() //shaking
|
||||
return 0
|
||||
|
||||
if(M.limb_destroyer)
|
||||
dismembering_strike(M, affecting.body_zone)
|
||||
|
||||
if(can_inject(M, 1, affecting))//Thick suits can stop monkey bites.
|
||||
if(..()) //successful monkey bite, this handles disease contraction.
|
||||
var/damage = rand(1, 3)
|
||||
if(stat != DEAD)
|
||||
apply_damage(damage, BRUTE, affecting, run_armor_check(affecting, "melee"))
|
||||
updatehealth()
|
||||
return 1
|
||||
@@ -1,161 +0,0 @@
|
||||
//Updates the mob's health from bodyparts and mob damage variables
|
||||
/mob/living/carbon/human/updatehealth()
|
||||
if(status_flags & GODMODE)
|
||||
return
|
||||
var/total_burn = 0
|
||||
var/total_brute = 0
|
||||
for(var/X in bodyparts) //hardcoded to streamline things a bit
|
||||
var/obj/item/bodypart/BP = X
|
||||
total_brute += BP.brute_dam
|
||||
total_burn += BP.burn_dam
|
||||
health = maxHealth - getOxyLoss() - getToxLoss() - getCloneLoss() - total_burn - total_brute
|
||||
update_stat()
|
||||
if(((maxHealth - total_burn) < HEALTH_THRESHOLD_DEAD) && stat == DEAD )
|
||||
ChangeToHusk()
|
||||
if(on_fire)
|
||||
shred_clothing()
|
||||
med_hud_set_health()
|
||||
med_hud_set_status()
|
||||
|
||||
|
||||
//These procs fetch a cumulative total damage from all bodyparts
|
||||
/mob/living/carbon/human/getBruteLoss()
|
||||
var/amount = 0
|
||||
for(var/X in bodyparts)
|
||||
var/obj/item/bodypart/BP = X
|
||||
amount += BP.brute_dam
|
||||
return amount
|
||||
|
||||
/mob/living/carbon/human/getFireLoss()
|
||||
var/amount = 0
|
||||
for(var/X in bodyparts)
|
||||
var/obj/item/bodypart/BP = X
|
||||
amount += BP.burn_dam
|
||||
return amount
|
||||
|
||||
|
||||
/mob/living/carbon/human/adjustBruteLoss(amount)
|
||||
if(status_flags & GODMODE)
|
||||
return 0
|
||||
if(amount > 0)
|
||||
take_overall_damage(amount, 0)
|
||||
else
|
||||
heal_overall_damage(-amount, 0)
|
||||
|
||||
/mob/living/carbon/human/adjustFireLoss(amount)
|
||||
if(status_flags & GODMODE)
|
||||
return 0
|
||||
if(amount > 0)
|
||||
take_overall_damage(0, amount)
|
||||
else
|
||||
heal_overall_damage(0, -amount)
|
||||
|
||||
/mob/living/carbon/human/proc/hat_fall_prob()
|
||||
var/multiplier = 1
|
||||
var/obj/item/clothing/head/H = head
|
||||
var/loose = 40
|
||||
if(stat || (status_flags & FAKEDEATH))
|
||||
multiplier = 2
|
||||
if(H.flags_cover & (HEADCOVERSEYES | HEADCOVERSMOUTH) || H.flags_inv & (HIDEEYES | HIDEFACE))
|
||||
loose = 0
|
||||
return loose * multiplier
|
||||
|
||||
////////////////////////////////////////////
|
||||
|
||||
//Returns a list of damaged bodyparts
|
||||
/mob/living/carbon/human/proc/get_damaged_bodyparts(brute, burn)
|
||||
var/list/obj/item/bodypart/parts = list()
|
||||
for(var/X in bodyparts)
|
||||
var/obj/item/bodypart/BP = X
|
||||
if((brute && BP.brute_dam) || (burn && BP.burn_dam))
|
||||
parts += BP
|
||||
return parts
|
||||
|
||||
//Returns a list of damageable bodyparts
|
||||
/mob/living/carbon/human/proc/get_damageable_bodyparts()
|
||||
var/list/obj/item/bodypart/parts = list()
|
||||
for(var/X in bodyparts)
|
||||
var/obj/item/bodypart/BP = X
|
||||
if(BP.brute_dam + BP.burn_dam < BP.max_damage)
|
||||
parts += BP
|
||||
return parts
|
||||
|
||||
//Heals ONE external organ, organ gets randomly selected from damaged ones.
|
||||
//It automatically updates damage overlays if necesary
|
||||
//It automatically updates health status
|
||||
/mob/living/carbon/human/heal_organ_damage(brute, burn)
|
||||
var/list/obj/item/bodypart/parts = get_damaged_bodyparts(brute,burn)
|
||||
if(!parts.len)
|
||||
return
|
||||
var/obj/item/bodypart/picked = pick(parts)
|
||||
if(picked.heal_damage(brute,burn,0))
|
||||
update_damage_overlays(0)
|
||||
updatehealth()
|
||||
|
||||
//Damages ONE external organ, organ gets randomly selected from damagable ones.
|
||||
//It automatically updates damage overlays if necesary
|
||||
//It automatically updates health status
|
||||
/mob/living/carbon/human/take_organ_damage(brute, burn)
|
||||
var/list/obj/item/bodypart/parts = get_damageable_bodyparts()
|
||||
if(!parts.len)
|
||||
return
|
||||
var/obj/item/bodypart/picked = pick(parts)
|
||||
if(picked.take_damage(brute,burn))
|
||||
update_damage_overlays(0)
|
||||
updatehealth()
|
||||
|
||||
|
||||
//Heal MANY bodyparts, in random order
|
||||
/mob/living/carbon/human/heal_overall_damage(brute, burn, updating_health=1)
|
||||
var/list/obj/item/bodypart/parts = get_damaged_bodyparts(brute,burn)
|
||||
|
||||
var/update = 0
|
||||
while(parts.len && (brute>0 || burn>0) )
|
||||
var/obj/item/bodypart/picked = pick(parts)
|
||||
|
||||
var/brute_was = picked.brute_dam
|
||||
var/burn_was = picked.burn_dam
|
||||
|
||||
update |= picked.heal_damage(brute,burn,0)
|
||||
|
||||
brute -= (brute_was-picked.brute_dam)
|
||||
burn -= (burn_was-picked.burn_dam)
|
||||
|
||||
parts -= picked
|
||||
if(updating_health)
|
||||
updatehealth()
|
||||
if(update)
|
||||
update_damage_overlays(0)
|
||||
|
||||
// damage MANY bodyparts, in random order
|
||||
/mob/living/carbon/human/take_overall_damage(brute, burn)
|
||||
if(status_flags & GODMODE)
|
||||
return //godmode
|
||||
|
||||
var/list/obj/item/bodypart/parts = get_damageable_bodyparts()
|
||||
var/update = 0
|
||||
while(parts.len && (brute>0 || burn>0) )
|
||||
var/obj/item/bodypart/picked = pick(parts)
|
||||
var/brute_per_part = brute/parts.len
|
||||
var/burn_per_part = burn/parts.len
|
||||
|
||||
var/brute_was = picked.brute_dam
|
||||
var/burn_was = picked.burn_dam
|
||||
|
||||
|
||||
update |= picked.take_damage(brute_per_part,burn_per_part)
|
||||
|
||||
brute -= (picked.brute_dam - brute_was)
|
||||
burn -= (picked.burn_dam - burn_was)
|
||||
|
||||
parts -= picked
|
||||
updatehealth()
|
||||
if(update)
|
||||
update_damage_overlays(0)
|
||||
|
||||
////////////////////////////////////////////
|
||||
|
||||
|
||||
/mob/living/carbon/human/apply_damage(damage = 0,damagetype = BRUTE, def_zone = null, blocked = 0)
|
||||
// depending on the species, it will run the corresponding apply_damage code there
|
||||
return dna.species.apply_damage(damage, damagetype, def_zone, blocked, src)
|
||||
@@ -31,10 +31,36 @@
|
||||
protection += C.armor[type]
|
||||
return protection
|
||||
|
||||
///checkeyeprot()
|
||||
///Returns a number between -1 to 2
|
||||
/mob/living/carbon/human/get_eye_protection()
|
||||
var/number = ..()
|
||||
if(istype(src.head, /obj/item/clothing/head)) //are they wearing something on their head
|
||||
var/obj/item/clothing/head/HFP = src.head //if yes gets the flash protection value from that item
|
||||
number += HFP.flash_protect
|
||||
if(istype(src.glasses, /obj/item/clothing/glasses)) //glasses
|
||||
var/obj/item/clothing/glasses/GFP = src.glasses
|
||||
number += GFP.flash_protect
|
||||
if(istype(src.wear_mask, /obj/item/clothing/mask)) //mask
|
||||
var/obj/item/clothing/mask/MFP = src.wear_mask
|
||||
number += MFP.flash_protect
|
||||
return number
|
||||
|
||||
/mob/living/carbon/human/get_ear_protection()
|
||||
if((ears && (ears.flags & EARBANGPROTECT)) || (head && (head.flags & HEADBANGPROTECT)))
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/human/on_hit(proj_type)
|
||||
dna.species.on_hit(proj_type, src)
|
||||
|
||||
|
||||
/mob/living/carbon/human/bullet_act(obj/item/projectile/P, def_zone)
|
||||
if(martial_art && martial_art.deflection_chance) //Some martial arts users can deflect projectiles!
|
||||
if(prob(martial_art.deflection_chance))
|
||||
if(!lying && dna && !dna.check_mutation(HULK)) //But only if they're not lying down, and hulks can't do it
|
||||
visible_message("<span class='danger'>[src] deflects the projectile; they can't be hit with ranged weapons!</span>", "<span class='userdanger'>You deflect the projectile!</span>")
|
||||
playsound(src, pick("sound/weapons/bulletflyby.ogg","sound/weapons/bulletflyby2.ogg","sound/weapons/bulletflyby3.ogg"), 75, 1)
|
||||
return 0
|
||||
if(!(P.original == src && P.firer == src)) //can't block or reflect when shooting yourself
|
||||
if(istype(P, /obj/item/projectile/energy) || istype(P, /obj/item/projectile/beam))
|
||||
if(check_reflect(def_zone)) // Checks if you've passed a reflection% check
|
||||
@@ -63,11 +89,6 @@
|
||||
|
||||
return (..(P , def_zone))
|
||||
|
||||
/mob/living/check_projectile_dismemberment(obj/item/projectile/P, def_zone)
|
||||
var/obj/item/bodypart/affecting = get_bodypart(def_zone)
|
||||
if(affecting && affecting.get_damage() >= (affecting.max_damage - P.dismemberment))
|
||||
affecting.dismember(P.damtype)
|
||||
|
||||
/mob/living/carbon/human/proc/check_reflect(def_zone) //Reflection checks for anything in your l_hand, r_hand, or wear_suit based on the reflection chance of the object
|
||||
if(wear_suit)
|
||||
if(wear_suit.IsReflect(def_zone) == 1)
|
||||
@@ -96,22 +117,309 @@
|
||||
return 0
|
||||
|
||||
|
||||
/mob/living/carbon/human/hitby(atom/movable/AM, skipcatch = 0, hitpush = 1, blocked = 0)
|
||||
var/obj/item/I
|
||||
var/throwpower = 30
|
||||
if(istype(AM, /obj/item))
|
||||
I = AM
|
||||
throwpower = I.throwforce
|
||||
if(I.thrownby == src) //No throwing stuff at yourself to trigger hit reactions
|
||||
return ..()
|
||||
if(check_shields(throwpower, "\the [AM.name]", AM, THROWN_PROJECTILE_ATTACK))
|
||||
hitpush = 0
|
||||
skipcatch = 1
|
||||
blocked = 1
|
||||
else if(I)
|
||||
if(I.throw_speed >= EMBED_THROWSPEED_THRESHOLD)
|
||||
if(can_embed(I))
|
||||
if(prob(I.embed_chance) && !(dna && (PIERCEIMMUNE in dna.species.specflags)))
|
||||
throw_alert("embeddedobject", /obj/screen/alert/embeddedobject)
|
||||
var/obj/item/bodypart/L = pick(bodyparts)
|
||||
L.embedded_objects |= I
|
||||
I.add_mob_blood(src)//it embedded itself in you, of course it's bloody!
|
||||
I.loc = src
|
||||
L.take_damage(I.w_class*I.embedded_impact_pain_multiplier)
|
||||
visible_message("<span class='danger'>\the [I.name] embeds itself in [src]'s [L.name]!</span>","<span class='userdanger'>\the [I.name] embeds itself in your [L.name]!</span>")
|
||||
hitpush = 0
|
||||
skipcatch = 1 //can't catch the now embedded item
|
||||
|
||||
return ..()
|
||||
|
||||
/mob/living/carbon/human/grabbedby(mob/living/carbon/user, supress_message = 0)
|
||||
if(user == src && pulling && !pulling.anchored && grab_state >= GRAB_AGGRESSIVE && (disabilities & FAT) && ismonkey(pulling))
|
||||
devour_mob(pulling)
|
||||
else
|
||||
..()
|
||||
|
||||
/mob/living/carbon/human/grippedby(mob/living/user)
|
||||
if(w_uniform)
|
||||
w_uniform.add_fingerprint(user)
|
||||
..()
|
||||
|
||||
|
||||
/mob/living/carbon/human/attacked_by(obj/item/I, mob/living/user)
|
||||
if(!I || !user)
|
||||
return 0
|
||||
|
||||
var/obj/item/bodypart/affecting = get_bodypart(ran_zone(user.zone_selected))
|
||||
var/target_area = parse_zone(check_zone(user.zone_selected))
|
||||
var/obj/item/bodypart/affecting = get_bodypart(ran_zone(user.zone_selected)) //what we're actually ending up trying to hit.
|
||||
var/target_area = parse_zone(check_zone(user.zone_selected)) //our intended target
|
||||
feedback_add_details("item_used_for_combat","[I.type]|[I.force]")
|
||||
feedback_add_details("zone_targeted","[target_area]")
|
||||
|
||||
// the attacked_by code varies among species
|
||||
return dna.species.spec_attacked_by(I, user, affecting, a_intent, target_area, src)
|
||||
return dna.species.spec_attacked_by(I, user, affecting, a_intent, src)
|
||||
|
||||
|
||||
/mob/living/carbon/human/attack_hulk(mob/living/carbon/human/user)
|
||||
if(user.a_intent == "harm")
|
||||
..(user, 1)
|
||||
playsound(loc, user.dna.species.attack_sound, 25, 1, -1)
|
||||
var/hulk_verb = pick("smash","pummel")
|
||||
visible_message("<span class='danger'>[user] has [hulk_verb]ed [src]!</span>", \
|
||||
"<span class='userdanger'>[user] has [hulk_verb]ed [src]!</span>")
|
||||
adjustBruteLoss(15)
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/human/attack_hand(mob/living/carbon/human/M)
|
||||
if(..()) //to allow surgery to return properly.
|
||||
return
|
||||
dna.species.spec_attack_hand(M, src)
|
||||
|
||||
|
||||
/mob/living/carbon/human/attack_paw(mob/living/carbon/monkey/M)
|
||||
var/dam_zone = pick("chest", "l_hand", "r_hand", "l_leg", "r_leg")
|
||||
var/obj/item/bodypart/affecting = get_bodypart(ran_zone(dam_zone))
|
||||
|
||||
if(M.a_intent == "help")
|
||||
..() //shaking
|
||||
return 0
|
||||
|
||||
if(M.limb_destroyer)
|
||||
dismembering_strike(M, affecting.body_zone)
|
||||
|
||||
if(can_inject(M, 1, affecting))//Thick suits can stop monkey bites.
|
||||
if(..()) //successful monkey bite, this handles disease contraction.
|
||||
var/damage = rand(1, 3)
|
||||
if(stat != DEAD)
|
||||
apply_damage(damage, BRUTE, affecting, run_armor_check(affecting, "melee"))
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/human/attack_alien(mob/living/carbon/alien/humanoid/M)
|
||||
if(check_shields(0, M.name))
|
||||
visible_message("<span class='danger'>[M] attempted to touch [src]!</span>")
|
||||
return 0
|
||||
|
||||
if(..())
|
||||
if(M.a_intent == "harm")
|
||||
if (w_uniform)
|
||||
w_uniform.add_fingerprint(M)
|
||||
var/damage = prob(90) ? 20 : 0
|
||||
if(!damage)
|
||||
playsound(loc, 'sound/weapons/slashmiss.ogg', 50, 1, -1)
|
||||
visible_message("<span class='danger'>[M] has lunged at [src]!</span>", \
|
||||
"<span class='userdanger'>[M] has lunged at [src]!</span>")
|
||||
return 0
|
||||
var/obj/item/bodypart/affecting = get_bodypart(ran_zone(M.zone_selected))
|
||||
var/armor_block = run_armor_check(affecting, "melee","","",10)
|
||||
|
||||
playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1)
|
||||
visible_message("<span class='danger'>[M] has slashed at [src]!</span>", \
|
||||
"<span class='userdanger'>[M] has slashed at [src]!</span>")
|
||||
add_logs(M, src, "attacked")
|
||||
if(!dismembering_strike(M, M.zone_selected)) //Dismemberment successful
|
||||
return 1
|
||||
apply_damage(damage, BRUTE, affecting, armor_block)
|
||||
|
||||
if(M.a_intent == "disarm") //Always drop item in hand, if no item, get stunned instead.
|
||||
if(get_active_held_item() && drop_item())
|
||||
playsound(loc, 'sound/weapons/slash.ogg', 25, 1, -1)
|
||||
visible_message("<span class='danger'>[M] disarmed [src]!</span>", \
|
||||
"<span class='userdanger'>[M] disarmed [src]!</span>")
|
||||
else
|
||||
playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1)
|
||||
Weaken(5)
|
||||
add_logs(M, src, "tackled")
|
||||
visible_message("<span class='danger'>[M] has tackled down [src]!</span>", \
|
||||
"<span class='userdanger'>[M] has tackled down [src]!</span>")
|
||||
|
||||
|
||||
/mob/living/carbon/human/attack_larva(mob/living/carbon/alien/larva/L)
|
||||
|
||||
if(..()) //successful larva bite.
|
||||
var/damage = rand(1, 3)
|
||||
if(check_shields(damage, "the [L.name]"))
|
||||
return 0
|
||||
if(stat != DEAD)
|
||||
L.amount_grown = min(L.amount_grown + damage, L.max_grown)
|
||||
var/obj/item/bodypart/affecting = get_bodypart(ran_zone(L.zone_selected))
|
||||
var/armor_block = run_armor_check(affecting, "melee")
|
||||
apply_damage(damage, BRUTE, affecting, armor_block)
|
||||
|
||||
|
||||
/mob/living/carbon/human/attack_animal(mob/living/simple_animal/M)
|
||||
if(..())
|
||||
var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
|
||||
if(check_shields(damage, "the [M.name]", null, MELEE_ATTACK, M.armour_penetration))
|
||||
return 0
|
||||
var/dam_zone = dismembering_strike(M, pick("chest", "l_hand", "r_hand", "l_leg", "r_leg"))
|
||||
if(!dam_zone) //Dismemberment successful
|
||||
return 1
|
||||
var/obj/item/bodypart/affecting = get_bodypart(ran_zone(dam_zone))
|
||||
var/armor = run_armor_check(affecting, "melee", armour_penetration = M.armour_penetration)
|
||||
apply_damage(damage, M.melee_damage_type, affecting, armor)
|
||||
|
||||
|
||||
|
||||
/mob/living/carbon/human/attack_slime(mob/living/simple_animal/slime/M)
|
||||
if(..()) //successful slime attack
|
||||
var/damage = rand(5, 25)
|
||||
if(M.is_adult)
|
||||
damage = rand(10, 35)
|
||||
|
||||
if(check_shields(damage, "the [M.name]"))
|
||||
return 0
|
||||
|
||||
var/dam_zone = dismembering_strike(M, pick("head", "chest", "l_arm", "r_arm", "l_leg", "r_leg"))
|
||||
if(!dam_zone) //Dismemberment successful
|
||||
return 1
|
||||
|
||||
var/obj/item/bodypart/affecting = get_bodypart(ran_zone(dam_zone))
|
||||
var/armor_block = run_armor_check(affecting, "melee")
|
||||
apply_damage(damage, BRUTE, affecting, armor_block)
|
||||
|
||||
/mob/living/carbon/human/mech_melee_attack(obj/mecha/M)
|
||||
|
||||
if(M.occupant.a_intent == "harm")
|
||||
M.do_attack_animation(src)
|
||||
if(M.damtype == "brute")
|
||||
step_away(src,M,15)
|
||||
var/obj/item/bodypart/temp = get_bodypart(pick("chest", "chest", "chest", "head"))
|
||||
if(temp)
|
||||
var/update = 0
|
||||
switch(M.damtype)
|
||||
if("brute")
|
||||
if(M.force > 20)
|
||||
Paralyse(1)
|
||||
update |= temp.take_damage(rand(M.force/2, M.force), 0)
|
||||
playsound(src, 'sound/weapons/punch4.ogg', 50, 1)
|
||||
if("fire")
|
||||
update |= temp.take_damage(0, rand(M.force/2, M.force))
|
||||
playsound(src, 'sound/items/Welder.ogg', 50, 1)
|
||||
if("tox")
|
||||
M.mech_toxin_damage(src)
|
||||
else
|
||||
return
|
||||
if(update)
|
||||
update_damage_overlays()
|
||||
updatehealth()
|
||||
|
||||
visible_message("<span class='danger'>[M.name] has hit [src]!</span>", \
|
||||
"<span class='userdanger'>[M.name] has hit [src]!</span>")
|
||||
add_logs(M.occupant, src, "attacked", M, "(INTENT: [uppertext(M.occupant.a_intent)]) (DAMTYPE: [uppertext(M.damtype)])")
|
||||
|
||||
else
|
||||
..()
|
||||
|
||||
|
||||
/mob/living/carbon/human/ex_act(severity, ex_target)
|
||||
var/b_loss = null
|
||||
var/f_loss = null
|
||||
var/bomb_armor = getarmor(null, "bomb")
|
||||
if(istype(ex_target, /datum/spacevine_mutation) && isvineimmune(src))
|
||||
return
|
||||
|
||||
switch (severity)
|
||||
if (1)
|
||||
b_loss += 500
|
||||
if (prob(bomb_armor))
|
||||
shred_clothing(1,150)
|
||||
var/atom/target = get_edge_target_turf(src, get_dir(src, get_step_away(src, src)))
|
||||
throw_at(target, 200, 4)
|
||||
else
|
||||
gib()
|
||||
return
|
||||
|
||||
if (2)
|
||||
b_loss += 60
|
||||
|
||||
f_loss += 60
|
||||
if (prob(bomb_armor))
|
||||
b_loss = b_loss/1.5
|
||||
f_loss = f_loss/1.5
|
||||
shred_clothing(1,25)
|
||||
else
|
||||
shred_clothing(1,50)
|
||||
|
||||
if (!istype(ears, /obj/item/clothing/ears/earmuffs))
|
||||
adjustEarDamage(30, 120)
|
||||
if (prob(70))
|
||||
Paralyse(10)
|
||||
|
||||
if(3)
|
||||
b_loss += 30
|
||||
if (prob(bomb_armor))
|
||||
b_loss = b_loss/2
|
||||
if (!istype(ears, /obj/item/clothing/ears/earmuffs))
|
||||
adjustEarDamage(15,60)
|
||||
if (prob(50))
|
||||
Paralyse(8)
|
||||
|
||||
take_overall_damage(b_loss,f_loss)
|
||||
//attempt to dismember bodyparts
|
||||
if(severity <= 2 || !bomb_armor)
|
||||
var/max_limb_loss = round(4/severity) //so you don't lose four limbs at severity 3.
|
||||
for(var/X in bodyparts)
|
||||
var/obj/item/bodypart/BP = X
|
||||
if(prob(50/severity) && !prob(getarmor(BP, "bomb")) && BP.body_zone != "head" && BP.body_zone != "chest")
|
||||
BP.brute_dam = BP.max_damage
|
||||
BP.dismember()
|
||||
max_limb_loss--
|
||||
if(!max_limb_loss)
|
||||
break
|
||||
..()
|
||||
|
||||
/mob/living/carbon/human/blob_act(obj/effect/blob/B)
|
||||
if(stat == DEAD)
|
||||
return
|
||||
show_message("<span class='userdanger'>The blob attacks you!</span>")
|
||||
var/dam_zone = pick("chest", "l_hand", "r_hand", "l_leg", "r_leg")
|
||||
var/obj/item/bodypart/affecting = get_bodypart(ran_zone(dam_zone))
|
||||
apply_damage(5, BRUTE, affecting, run_armor_check(affecting, "melee"))
|
||||
|
||||
|
||||
//Added a safety check in case you want to shock a human mob directly through electrocute_act.
|
||||
/mob/living/carbon/human/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, safety = 0, override = 0, tesla_shock = 0)
|
||||
if(tesla_shock)
|
||||
var/total_coeff = 1
|
||||
if(gloves)
|
||||
var/obj/item/clothing/gloves/G = gloves
|
||||
if(G.siemens_coefficient <= 0)
|
||||
total_coeff -= 0.5
|
||||
if(wear_suit)
|
||||
var/obj/item/clothing/suit/S = wear_suit
|
||||
if(S.siemens_coefficient <= 0)
|
||||
total_coeff -= 0.95
|
||||
siemens_coeff = total_coeff
|
||||
else if(!safety)
|
||||
var/gloves_siemens_coeff = 1
|
||||
if(gloves)
|
||||
var/obj/item/clothing/gloves/G = gloves
|
||||
gloves_siemens_coeff = G.siemens_coefficient
|
||||
siemens_coeff = gloves_siemens_coeff
|
||||
if(heart_attack)
|
||||
if(shock_damage * siemens_coeff >= 1 && prob(25))
|
||||
heart_attack = 0
|
||||
if(stat == CONSCIOUS)
|
||||
src << "<span class='notice'>You feel your heart beating again!</span>"
|
||||
. = ..(shock_damage,source,siemens_coeff,safety,override,tesla_shock)
|
||||
if(.)
|
||||
electrocution_animation(40)
|
||||
|
||||
|
||||
/mob/living/carbon/human/emp_act(severity)
|
||||
var/informed = 0
|
||||
for(var/obj/item/bodypart/L in src.bodyparts)
|
||||
if(L.status == ORGAN_ROBOTIC)
|
||||
if(L.status == BODYPART_ROBOTIC)
|
||||
if(!informed)
|
||||
src << "<span class='userdanger'>You feel a sharp pain as your robotic limbs overload.</span>"
|
||||
informed = 1
|
||||
@@ -264,123 +572,76 @@
|
||||
acid_volume_left = max(acid_volume_left - acid_decay, 0)
|
||||
|
||||
|
||||
/mob/living/carbon/human/attack_animal(mob/living/simple_animal/M)
|
||||
if(..())
|
||||
var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
|
||||
if(check_shields(damage, "the [M.name]", null, MELEE_ATTACK, M.armour_penetration))
|
||||
return 0
|
||||
var/dam_zone = dismembering_strike(M, pick("chest", "l_hand", "r_hand", "l_leg", "r_leg"))
|
||||
if(!dam_zone) //Dismemberment successful
|
||||
return 1
|
||||
var/obj/item/bodypart/affecting = get_bodypart(ran_zone(dam_zone))
|
||||
var/armor = run_armor_check(affecting, "melee", armour_penetration = M.armour_penetration)
|
||||
apply_damage(damage, M.melee_damage_type, affecting, armor)
|
||||
updatehealth()
|
||||
/mob/living/carbon/human/singularity_act()
|
||||
var/gain = 20
|
||||
if(mind)
|
||||
if((mind.assigned_role == "Station Engineer") || (mind.assigned_role == "Chief Engineer") )
|
||||
gain = 100
|
||||
if(mind.assigned_role == "Clown")
|
||||
gain = rand(-300, 300)
|
||||
investigate_log("([key_name(src)]) has been consumed by the singularity.","singulo") //Oh that's where the clown ended up!
|
||||
gib()
|
||||
return(gain)
|
||||
|
||||
/mob/living/carbon/human/help_shake_act(mob/living/carbon/M)
|
||||
if(!istype(M))
|
||||
return
|
||||
|
||||
/mob/living/carbon/human/attack_larva(mob/living/carbon/alien/larva/L)
|
||||
if(health >= 0)
|
||||
if(src == M)
|
||||
visible_message( \
|
||||
"[src] examines \himself.", \
|
||||
"<span class='notice'>You check yourself for injuries.</span>")
|
||||
|
||||
if(..()) //successful larva bite.
|
||||
var/damage = rand(1, 3)
|
||||
if(check_shields(damage, "the [L.name]"))
|
||||
return 0
|
||||
if(stat != DEAD)
|
||||
L.amount_grown = min(L.amount_grown + damage, L.max_grown)
|
||||
var/obj/item/bodypart/affecting = get_bodypart(ran_zone(L.zone_selected))
|
||||
var/armor_block = run_armor_check(affecting, "melee")
|
||||
apply_damage(damage, BRUTE, affecting, armor_block)
|
||||
updatehealth()
|
||||
var/list/missing = list("head", "chest", "l_arm", "r_arm", "l_leg", "r_leg")
|
||||
for(var/X in bodyparts)
|
||||
var/obj/item/bodypart/LB = X
|
||||
missing -= LB.body_zone
|
||||
var/status = ""
|
||||
var/brutedamage = LB.brute_dam
|
||||
var/burndamage = LB.burn_dam
|
||||
if(hallucination)
|
||||
if(prob(30))
|
||||
brutedamage += rand(30,40)
|
||||
if(prob(30))
|
||||
burndamage += rand(30,40)
|
||||
|
||||
if(brutedamage > 0)
|
||||
status = "bruised"
|
||||
if(brutedamage > 20)
|
||||
status = "battered"
|
||||
if(brutedamage > 40)
|
||||
status = "mangled"
|
||||
if(brutedamage > 0 && burndamage > 0)
|
||||
status += " and "
|
||||
if(burndamage > 40)
|
||||
status += "peeling away"
|
||||
|
||||
/mob/living/carbon/human/attack_slime(mob/living/simple_animal/slime/M)
|
||||
if(..()) //successful slime attack
|
||||
var/damage = rand(5, 25)
|
||||
if(M.is_adult)
|
||||
damage = rand(10, 35)
|
||||
else if(burndamage > 10)
|
||||
status += "blistered"
|
||||
else if(burndamage > 0)
|
||||
status += "numb"
|
||||
if(status == "")
|
||||
status = "OK"
|
||||
src << "\t [status == "OK" ? "\blue" : "\red"] Your [LB.name] is [status]."
|
||||
|
||||
if(check_shields(damage, "the [M.name]"))
|
||||
return 0
|
||||
for(var/obj/item/I in LB.embedded_objects)
|
||||
src << "\t <a href='byond://?src=\ref[src];embedded_object=\ref[I];embedded_limb=\ref[LB]'>\red There is \a [I] embedded in your [LB.name]!</a>"
|
||||
|
||||
var/dam_zone = dismembering_strike(M, pick("head", "chest", "l_arm", "r_arm", "l_leg", "r_leg"))
|
||||
if(!dam_zone) //Dismemberment successful
|
||||
return 1
|
||||
for(var/t in missing)
|
||||
src << "<span class='boldannounce'>Your [parse_zone(t)] is missing!</span>"
|
||||
|
||||
var/obj/item/bodypart/affecting = get_bodypart(ran_zone(dam_zone))
|
||||
var/armor_block = run_armor_check(affecting, "melee")
|
||||
apply_damage(damage, BRUTE, affecting, armor_block)
|
||||
|
||||
/mob/living/carbon/human/mech_melee_attack(obj/mecha/M)
|
||||
|
||||
if(M.occupant.a_intent == "harm")
|
||||
M.do_attack_animation(src)
|
||||
if(M.damtype == "brute")
|
||||
step_away(src,M,15)
|
||||
var/obj/item/bodypart/temp = get_bodypart(pick("chest", "chest", "chest", "head"))
|
||||
if(temp)
|
||||
var/update = 0
|
||||
switch(M.damtype)
|
||||
if("brute")
|
||||
if(M.force > 20)
|
||||
Paralyse(1)
|
||||
update |= temp.take_damage(rand(M.force/2, M.force), 0)
|
||||
playsound(src, 'sound/weapons/punch4.ogg', 50, 1)
|
||||
if("fire")
|
||||
update |= temp.take_damage(0, rand(M.force/2, M.force))
|
||||
playsound(src, 'sound/items/Welder.ogg', 50, 1)
|
||||
if("tox")
|
||||
M.mech_toxin_damage(src)
|
||||
if(bleed_rate)
|
||||
src << "<span class='danger'>You are bleeding!</span>"
|
||||
if(staminaloss)
|
||||
if(staminaloss > 30)
|
||||
src << "<span class='info'>You're completely exhausted.</span>"
|
||||
else
|
||||
return
|
||||
if(update)
|
||||
update_damage_overlays(0)
|
||||
updatehealth()
|
||||
src << "<span class='info'>You feel fatigued.</span>"
|
||||
else
|
||||
if(wear_suit)
|
||||
wear_suit.add_fingerprint(M)
|
||||
else if(w_uniform)
|
||||
w_uniform.add_fingerprint(M)
|
||||
|
||||
visible_message("<span class='danger'>[M.name] has hit [src]!</span>", \
|
||||
"<span class='userdanger'>[M.name] has hit [src]!</span>")
|
||||
add_logs(M.occupant, src, "attacked", M, "(INTENT: [uppertext(M.occupant.a_intent)]) (DAMTYPE: [uppertext(M.damtype)])")
|
||||
|
||||
else
|
||||
..()
|
||||
|
||||
/mob/living/carbon/human/hitby(atom/movable/AM, skipcatch = 0, hitpush = 1, blocked = 0)
|
||||
var/obj/item/I
|
||||
var/throwpower = 30
|
||||
if(istype(AM, /obj/item))
|
||||
I = AM
|
||||
throwpower = I.throwforce
|
||||
if(I.thrownby == src) //No throwing stuff at yourself to trigger hit reactions
|
||||
return ..()
|
||||
if(check_shields(throwpower, "\the [AM.name]", AM, THROWN_PROJECTILE_ATTACK))
|
||||
hitpush = 0
|
||||
skipcatch = 1
|
||||
blocked = 1
|
||||
else if(I)
|
||||
if(I.throw_speed >= EMBED_THROWSPEED_THRESHOLD)
|
||||
if(can_embed(I))
|
||||
if(prob(I.embed_chance) && !(dna && (PIERCEIMMUNE in dna.species.specflags)))
|
||||
throw_alert("embeddedobject", /obj/screen/alert/embeddedobject)
|
||||
var/obj/item/bodypart/L = pick(bodyparts)
|
||||
L.embedded_objects |= I
|
||||
I.add_mob_blood(src)//it embedded itself in you, of course it's bloody!
|
||||
I.loc = src
|
||||
L.take_damage(I.w_class*I.embedded_impact_pain_multiplier)
|
||||
visible_message("<span class='danger'>\the [I.name] embeds itself in [src]'s [L.name]!</span>","<span class='userdanger'>\the [I.name] embeds itself in your [L.name]!</span>")
|
||||
hitpush = 0
|
||||
skipcatch = 1 //can't catch the now embedded item
|
||||
|
||||
return ..()
|
||||
|
||||
/mob/living/carbon/human/grabbedby(mob/living/carbon/user, supress_message = 0)
|
||||
if(user == src && pulling && !pulling.anchored && grab_state >= GRAB_AGGRESSIVE && (disabilities & FAT) && ismonkey(pulling))
|
||||
devour_mob(pulling)
|
||||
else
|
||||
..()
|
||||
|
||||
/mob/living/carbon/human/grippedby(mob/living/user)
|
||||
if(w_uniform)
|
||||
w_uniform.add_fingerprint(user)
|
||||
..()
|
||||
|
||||
/mob/living/carbon/human/Stun(amount, updating_canmove = 1)
|
||||
amount = dna.species.spec_stun(src,amount)
|
||||
..()
|
||||
..()
|
||||
|
||||
@@ -30,11 +30,7 @@ var/global/default_martial_art = new/datum/martial_art
|
||||
//Equipment slots
|
||||
var/obj/item/wear_suit = null
|
||||
var/obj/item/w_uniform = null
|
||||
var/obj/item/shoes = null
|
||||
var/obj/item/belt = null
|
||||
var/obj/item/gloves = null
|
||||
var/obj/item/clothing/glasses/glasses = null
|
||||
var/obj/item/ears = null
|
||||
var/obj/item/wear_id = null
|
||||
var/obj/item/r_store = null
|
||||
var/obj/item/l_store = null
|
||||
@@ -53,5 +49,3 @@ var/global/default_martial_art = new/datum/martial_art
|
||||
|
||||
var/drunkenness = 0 //Overall drunkenness - check handle_alcohol() in life.dm for effects
|
||||
var/datum/personal_crafting/handcrafting
|
||||
|
||||
var/list/hand_bodyparts = list() //a collection of arms (or actually whatever the fug /bodyparts you monsters use to wreck my systems)
|
||||
@@ -81,24 +81,6 @@
|
||||
if(wear_id)
|
||||
return wear_id.GetID()
|
||||
|
||||
///checkeyeprot()
|
||||
///Returns a number between -1 to 2
|
||||
/mob/living/carbon/human/check_eye_prot()
|
||||
var/number = ..()
|
||||
if(istype(src.head, /obj/item/clothing/head)) //are they wearing something on their head
|
||||
var/obj/item/clothing/head/HFP = src.head //if yes gets the flash protection value from that item
|
||||
number += HFP.flash_protect
|
||||
if(istype(src.glasses, /obj/item/clothing/glasses)) //glasses
|
||||
var/obj/item/clothing/glasses/GFP = src.glasses
|
||||
number += GFP.flash_protect
|
||||
if(istype(src.wear_mask, /obj/item/clothing/mask)) //mask
|
||||
var/obj/item/clothing/mask/MFP = src.wear_mask
|
||||
number += MFP.flash_protect
|
||||
return number
|
||||
|
||||
/mob/living/carbon/human/check_ear_prot()
|
||||
if((ears && (ears.flags & EARBANGPROTECT)) || (head && (head.flags & HEADBANGPROTECT)))
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/human/abiotic(full_body = 0)
|
||||
var/abiotic_hands = FALSE
|
||||
|
||||
@@ -200,7 +200,16 @@
|
||||
|
||||
|
||||
//Cycles through all clothing slots and tests them for destruction
|
||||
/mob/living/carbon/human/proc/shred_clothing(bomb,shock)
|
||||
/mob/living/carbon/proc/shred_clothing(bomb,shock)
|
||||
if(back)
|
||||
back.shred(bomb,shock-20,src)
|
||||
if(head)
|
||||
head.shred(bomb,shock,src)
|
||||
if(wear_mask)
|
||||
wear_mask.shred(bomb,shock,src)
|
||||
|
||||
|
||||
/mob/living/carbon/human/shred_clothing(bomb,shock)
|
||||
var/covered_parts = 0 //The body parts that are protected by exterior clothing/armor
|
||||
var/head_absorbed = 0 //How much of the shock the headgear absorbs when it is shredded. -1=it survives
|
||||
var/suit_absorbed = 0 //How much of the shock the exosuit absorbs when it is shredded. -1=it survives
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
var/punchdamagehigh = 9 //highest possible punch damage
|
||||
var/punchstunthreshold = 9//damage at which punches from this race will stun //yes it should be to the attacked race but it's not useful that way even if it's logical
|
||||
var/siemens_coeff = 1 //base electrocution coefficient
|
||||
var/exotic_damage_overlay = ""
|
||||
var/damage_overlay_type = "human" //what kind of damage overlays (if any) appear on our species when wounded?
|
||||
var/fixed_mut_color = "" //to use MUTCOLOR with a fixed color that's independent of dna.feature["mcolor"]
|
||||
|
||||
var/invis_sight = SEE_INVISIBLE_LIVING
|
||||
@@ -132,8 +132,6 @@
|
||||
var/obj/item/thing = C.get_item_by_slot(slot_id)
|
||||
if(thing && (!thing.species_exception || !is_type_in_list(src,thing.species_exception)))
|
||||
C.unEquip(thing)
|
||||
if(NODISMEMBER in specflags)
|
||||
C.regenerate_limbs() //if we don't handle dismemberment, we grow our missing limbs back
|
||||
|
||||
var/obj/item/organ/heart/heart = C.getorganslot("heart")
|
||||
var/obj/item/organ/lungs/lungs = C.getorganslot("lungs")
|
||||
@@ -226,7 +224,8 @@
|
||||
hair_hidden = 1
|
||||
if(!hair_hidden)
|
||||
if(!H.getorgan(/obj/item/organ/brain)) //Applies the debrained overlay if there is no brain
|
||||
standing += image("icon"='icons/mob/human_face.dmi', "icon_state" = "debrained_s", "layer" = -HAIR_LAYER)
|
||||
if(!(NOBLOOD in specflags))
|
||||
standing += image("icon"='icons/mob/human_face.dmi', "icon_state" = "debrained_s", "layer" = -HAIR_LAYER)
|
||||
|
||||
else if(H.hair_style && (HAIR in specflags))
|
||||
S = hair_styles_list[H.hair_style]
|
||||
@@ -263,17 +262,18 @@
|
||||
|
||||
var/obj/item/bodypart/head/HD = H.get_bodypart("head")
|
||||
|
||||
// lipstick
|
||||
if(H.lip_style && (LIPS in specflags) && HD)
|
||||
var/image/lips = image("icon"='icons/mob/human_face.dmi', "icon_state"="lips_[H.lip_style]_s", "layer" = -BODY_LAYER)
|
||||
lips.color = H.lip_color
|
||||
standing += lips
|
||||
if(!(H.disabilities & HUSK))
|
||||
// lipstick
|
||||
if(H.lip_style && (LIPS in specflags) && HD)
|
||||
var/image/lips = image("icon"='icons/mob/human_face.dmi', "icon_state"="lips_[H.lip_style]_s", "layer" = -BODY_LAYER)
|
||||
lips.color = H.lip_color
|
||||
standing += lips
|
||||
|
||||
// eyes
|
||||
if((EYECOLOR in specflags) && HD)
|
||||
var/image/img_eyes_s = image("icon" = 'icons/mob/human_face.dmi', "icon_state" = "[eyes]_s", "layer" = -BODY_LAYER)
|
||||
img_eyes_s.color = "#" + H.eye_color
|
||||
standing += img_eyes_s
|
||||
// eyes
|
||||
if((EYECOLOR in specflags) && HD)
|
||||
var/image/img_eyes_s = image("icon" = 'icons/mob/human_face.dmi', "icon_state" = "[eyes]_s", "layer" = -BODY_LAYER)
|
||||
img_eyes_s.color = "#" + H.eye_color
|
||||
standing += img_eyes_s
|
||||
|
||||
//Underwear, Undershirts & Socks
|
||||
if(H.underwear)
|
||||
@@ -346,19 +346,19 @@
|
||||
bodyparts_to_add -= "waggingspines"
|
||||
|
||||
if("snout" in mutant_bodyparts) //Take a closer look at that snout!
|
||||
if((H.wear_mask && (H.wear_mask.flags_inv & HIDEFACE)) || (H.head && (H.head.flags_inv & HIDEFACE)) || !HD || HD.status == ORGAN_ROBOTIC)
|
||||
if((H.wear_mask && (H.wear_mask.flags_inv & HIDEFACE)) || (H.head && (H.head.flags_inv & HIDEFACE)) || !HD || HD.status == BODYPART_ROBOTIC)
|
||||
bodyparts_to_add -= "snout"
|
||||
|
||||
if("frills" in mutant_bodyparts)
|
||||
if(!H.dna.features["frills"] || H.dna.features["frills"] == "None" || H.head && (H.head.flags_inv & HIDEEARS) || !HD || HD.status == ORGAN_ROBOTIC)
|
||||
if(!H.dna.features["frills"] || H.dna.features["frills"] == "None" || H.head && (H.head.flags_inv & HIDEEARS) || !HD || HD.status == BODYPART_ROBOTIC)
|
||||
bodyparts_to_add -= "frills"
|
||||
|
||||
if("horns" in mutant_bodyparts)
|
||||
if(!H.dna.features["horns"] || H.dna.features["horns"] == "None" || H.head && (H.head.flags_inv & HIDEHAIR) || (H.wear_mask && (H.wear_mask.flags_inv & HIDEHAIR)) || !HD || HD.status == ORGAN_ROBOTIC)
|
||||
if(!H.dna.features["horns"] || H.dna.features["horns"] == "None" || H.head && (H.head.flags_inv & HIDEHAIR) || (H.wear_mask && (H.wear_mask.flags_inv & HIDEHAIR)) || !HD || HD.status == BODYPART_ROBOTIC)
|
||||
bodyparts_to_add -= "horns"
|
||||
|
||||
if("ears" in mutant_bodyparts)
|
||||
if(!H.dna.features["ears"] || H.dna.features["ears"] == "None" || H.head && (H.head.flags_inv & HIDEHAIR) || (H.wear_mask && (H.wear_mask.flags_inv & HIDEHAIR)) || !HD || HD.status == ORGAN_ROBOTIC)
|
||||
if(!H.dna.features["ears"] || H.dna.features["ears"] == "None" || H.head && (H.head.flags_inv & HIDEHAIR) || (H.wear_mask && (H.wear_mask.flags_inv & HIDEHAIR)) || !HD || HD.status == BODYPART_ROBOTIC)
|
||||
bodyparts_to_add -= "ears"
|
||||
|
||||
if("wings" in mutant_bodyparts)
|
||||
@@ -830,7 +830,7 @@
|
||||
if(75 to 100)
|
||||
if(prob(1))
|
||||
H << "<span class='danger'>You mutate!</span>"
|
||||
randmutb(H)
|
||||
H.randmutb()
|
||||
H.emote("gasp")
|
||||
H.domutcheck()
|
||||
return 0
|
||||
@@ -894,13 +894,6 @@
|
||||
if(H.bodytemperature < BODYTEMP_COLD_DAMAGE_LIMIT)
|
||||
. += (BODYTEMP_COLD_DAMAGE_LIMIT - H.bodytemperature) / COLD_SLOWDOWN_FACTOR
|
||||
|
||||
if(!(FLYING in specflags))
|
||||
var/leg_amount = H.get_num_legs()
|
||||
. += 6 - 3*leg_amount //the fewer the legs, the slower the mob
|
||||
if(!leg_amount)
|
||||
. += 6 - 3*H.get_num_arms() //crawling is harder with fewer arms
|
||||
|
||||
|
||||
. += speedmod
|
||||
|
||||
//////////////////
|
||||
@@ -1027,10 +1020,9 @@
|
||||
"<span class='userdanger'>[M] attemped to disarm [H]!</span>")
|
||||
return
|
||||
|
||||
/datum/species/proc/spec_attacked_by(obj/item/I, mob/living/user, obj/item/bodypart/affecting, intent, target_area, mob/living/carbon/human/H)
|
||||
/datum/species/proc/spec_attacked_by(obj/item/I, mob/living/user, obj/item/bodypart/affecting, intent, mob/living/carbon/human/H)
|
||||
// Allows you to put in item-specific reactions based on species
|
||||
if(user != H)
|
||||
user.do_attack_animation(H)
|
||||
if(H.check_shields(I.force, "the [I.name]", I, MELEE_ATTACK, I.armour_penetration))
|
||||
return 0
|
||||
|
||||
@@ -1062,7 +1054,7 @@
|
||||
|
||||
var/bloody = 0
|
||||
if(((I.damtype == BRUTE) && I.force && prob(25 + (I.force * 2))))
|
||||
if(affecting.status == ORGAN_ORGANIC)
|
||||
if(affecting.status == BODYPART_ORGANIC)
|
||||
I.add_mob_blood(H) //Make the weapon bloody, not the person.
|
||||
if(prob(I.force * 2)) //blood spatter!
|
||||
bloody = 1
|
||||
@@ -1112,39 +1104,43 @@
|
||||
return TRUE
|
||||
|
||||
/datum/species/proc/apply_damage(damage, damagetype = BRUTE, def_zone = null, blocked, mob/living/carbon/human/H)
|
||||
blocked = (100-(blocked+armor))/100
|
||||
if(!damage || blocked <= 0)
|
||||
var/hit_percent = (100-(blocked+armor))/100
|
||||
if(!damage || hit_percent <= 0)
|
||||
return 0
|
||||
|
||||
var/obj/item/bodypart/organ = null
|
||||
var/obj/item/bodypart/BP = null
|
||||
if(islimb(def_zone))
|
||||
organ = def_zone
|
||||
BP = def_zone
|
||||
else
|
||||
if(!def_zone)
|
||||
def_zone = ran_zone(def_zone)
|
||||
organ = H.get_bodypart(check_zone(def_zone))
|
||||
if(!organ)
|
||||
return 0
|
||||
|
||||
damage = (damage * blocked)
|
||||
BP = H.get_bodypart(check_zone(def_zone))
|
||||
if(!BP)
|
||||
BP = H.bodyparts[1]
|
||||
|
||||
switch(damagetype)
|
||||
if(BRUTE)
|
||||
H.damageoverlaytemp = 20
|
||||
if(organ.take_damage(damage*brutemod, 0))
|
||||
H.update_damage_overlays(0)
|
||||
if(BP)
|
||||
if(BP.take_damage(damage * hit_percent * brutemod, 0))
|
||||
H.update_damage_overlays()
|
||||
else//no bodypart, we deal damage with a more general method.
|
||||
H.adjustBruteLoss(damage * hit_percent * brutemod)
|
||||
if(BURN)
|
||||
H.damageoverlaytemp = 20
|
||||
if(organ.take_damage(0, damage*burnmod))
|
||||
H.update_damage_overlays(0)
|
||||
if(BP)
|
||||
if(BP.take_damage(0, damage * hit_percent * burnmod))
|
||||
H.update_damage_overlays()
|
||||
else
|
||||
H.adjustFireLoss(damage * hit_percent* burnmod)
|
||||
if(TOX)
|
||||
H.adjustToxLoss(damage)
|
||||
H.adjustToxLoss(damage * hit_percent)
|
||||
if(OXY)
|
||||
H.adjustOxyLoss(damage)
|
||||
H.adjustOxyLoss(damage * hit_percent)
|
||||
if(CLONE)
|
||||
H.adjustCloneLoss(damage)
|
||||
H.adjustCloneLoss(damage * hit_percent)
|
||||
if(STAMINA)
|
||||
H.adjustStaminaLoss(damage)
|
||||
H.adjustStaminaLoss(damage * hit_percent)
|
||||
return 1
|
||||
|
||||
/datum/species/proc/on_hit(obj/item/projectile/proj_type, mob/living/carbon/human/H)
|
||||
|
||||
@@ -146,9 +146,9 @@
|
||||
H.Weaken(5)
|
||||
H.visible_message("<span class='warning'>[H] writhes in pain as \his vacuoles boil.</span>", "<span class='userdanger'>You writhe in pain as your vacuoles boil!</span>", "<span class='italics'>You hear the crunching of leaves.</span>")
|
||||
if(prob(80))
|
||||
randmutb(H)
|
||||
H.randmutb()
|
||||
else
|
||||
randmutg(H)
|
||||
H.randmutg()
|
||||
H.domutcheck()
|
||||
else
|
||||
H.adjustFireLoss(rand(5,15))
|
||||
@@ -642,6 +642,7 @@
|
||||
meat = /obj/item/weapon/reagent_containers/food/snacks/meat/slab/human/mutant/skeleton
|
||||
specflags = list(NOBREATH,RESISTTEMP,NOBLOOD,RADIMMUNE,VIRUSIMMUNE,PIERCEIMMUNE,NOHUNGER,EASYDISMEMBER,EASYLIMBATTACHMENT)
|
||||
mutant_organs = list(/obj/item/organ/tongue/bone)
|
||||
damage_overlay_type = ""//let's not show bloody wounds or burns over bones.
|
||||
|
||||
/*
|
||||
ZOMBIES
|
||||
@@ -730,6 +731,7 @@ var/global/image/plasmaman_on_fire = image("icon"='icons/mob/OnFire.dmi', "icon_
|
||||
burnmod = 2
|
||||
heatmod = 2
|
||||
speedmod = 1
|
||||
damage_overlay_type = ""//let's not show bloody wounds or burns over bones.
|
||||
|
||||
/datum/species/plasmaman/spec_life(mob/living/carbon/human/H)
|
||||
var/datum/gas_mixture/environment = H.loc.return_air()
|
||||
@@ -781,7 +783,7 @@ var/global/image/plasmaman_on_fire = image("icon"='icons/mob/OnFire.dmi', "icon_
|
||||
dangerous_existence = 1
|
||||
blacklisted = 1
|
||||
meat = null
|
||||
exotic_damage_overlay = "synth"
|
||||
damage_overlay_type = "synth"
|
||||
limbs_id = "synth"
|
||||
var/list/initial_specflags = list(NOTRANSSTING,NOBREATH,VIRUSIMMUNE,NODISMEMBER,NOHUNGER) //for getting these values back for assume_disguise()
|
||||
var/disguise_fail_health = 75 //When their health gets to this level their synthflesh partially falls off
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
|
||||
/mob/living/carbon/human/Stun(amount, updating = 1, ignore_canstun = 0)
|
||||
amount = dna.species.spec_stun(src,amount)
|
||||
..()
|
||||
|
||||
|
||||
/mob/living/carbon/human/cure_husk()
|
||||
. = ..()
|
||||
if(.)
|
||||
update_hair()
|
||||
|
||||
/mob/living/carbon/human/become_husk()
|
||||
. = ..()
|
||||
if(.)
|
||||
update_hair()
|
||||
@@ -48,28 +48,6 @@ There are several things that need to be remembered:
|
||||
|
||||
*/
|
||||
|
||||
//DAMAGE OVERLAYS
|
||||
//constructs damage icon for each organ from mask * damage field and saves it in our overlays_ lists
|
||||
/mob/living/carbon/human/update_damage_overlays()
|
||||
remove_overlay(DAMAGE_LAYER)
|
||||
|
||||
var/image/standing = image("icon"='icons/mob/dam_human.dmi', "icon_state"="blank", "layer"=-DAMAGE_LAYER)
|
||||
overlays_standing[DAMAGE_LAYER] = standing
|
||||
|
||||
var/dmgoverlaytype = ""
|
||||
if(dna.species.exotic_damage_overlay)
|
||||
dmgoverlaytype = dna.species.exotic_damage_overlay + "_"
|
||||
|
||||
for(var/X in bodyparts)
|
||||
var/obj/item/bodypart/BP = X
|
||||
if(BP.brutestate)
|
||||
standing.overlays += "[dmgoverlaytype][BP.body_zone]_[BP.brutestate]0" //we're adding icon_states of the base image as overlays
|
||||
if(BP.burnstate)
|
||||
standing.overlays += "[dmgoverlaytype][BP.body_zone]_0[BP.burnstate]"
|
||||
|
||||
apply_overlay(DAMAGE_LAYER)
|
||||
|
||||
|
||||
//HAIR OVERLAY
|
||||
/mob/living/carbon/human/update_hair()
|
||||
dna.species.handle_hair(src)
|
||||
@@ -79,47 +57,14 @@ There are several things that need to be remembered:
|
||||
dna.species.handle_mutant_bodyparts(src)
|
||||
|
||||
|
||||
/mob/living/carbon/human/proc/update_body()
|
||||
/mob/living/carbon/human/update_body()
|
||||
remove_overlay(BODY_LAYER)
|
||||
dna.species.handle_body(src)
|
||||
update_body_parts()
|
||||
..()
|
||||
|
||||
/mob/living/carbon/human/update_fire()
|
||||
..("Standing")
|
||||
|
||||
/mob/living/carbon/human/proc/update_body_parts()
|
||||
//CHECK FOR UPDATE
|
||||
var/oldkey = icon_render_key
|
||||
icon_render_key = generate_icon_render_key()
|
||||
if(oldkey == icon_render_key)
|
||||
return
|
||||
|
||||
remove_overlay(BODYPARTS_LAYER)
|
||||
|
||||
//LOAD ICONS
|
||||
if(limb_icon_cache[icon_render_key])
|
||||
load_limb_from_cache()
|
||||
update_damage_overlays()
|
||||
update_mutant_bodyparts()
|
||||
update_hair()
|
||||
return
|
||||
|
||||
//GENERATE NEW LIMBS
|
||||
var/list/new_limbs = list()
|
||||
for(var/X in bodyparts)
|
||||
var/obj/item/bodypart/BP = X
|
||||
if(!BP.no_update)
|
||||
BP.update_limb()
|
||||
var/image/temp = BP.get_limb_icon()
|
||||
if(temp)
|
||||
new_limbs += temp
|
||||
if(new_limbs.len)
|
||||
overlays_standing[BODYPARTS_LAYER] = new_limbs
|
||||
limb_icon_cache[icon_render_key] = new_limbs
|
||||
|
||||
apply_overlay(BODYPARTS_LAYER)
|
||||
update_damage_overlays()
|
||||
|
||||
|
||||
/* --------------------------------------- */
|
||||
//For legacy support.
|
||||
@@ -219,9 +164,16 @@ There are several things that need to be remembered:
|
||||
remove_overlay(GLOVES_LAYER)
|
||||
|
||||
if(get_num_arms() <2)
|
||||
if(!gloves && blood_DNA)
|
||||
if(has_left_hand())
|
||||
overlays_standing[GLOVES_LAYER] = image("icon"='icons/effects/blood.dmi', "icon_state"="bloodyhands_left", "layer"=-GLOVES_LAYER)
|
||||
apply_overlay(GLOVES_LAYER)
|
||||
else if(has_right_hand())
|
||||
overlays_standing[GLOVES_LAYER] = image("icon"='icons/effects/blood.dmi', "icon_state"="bloodyhands_right", "layer"=-GLOVES_LAYER)
|
||||
apply_overlay(GLOVES_LAYER)
|
||||
return
|
||||
|
||||
if(client && hud_used)
|
||||
if(client && hud_used && hud_used.inv_slots[slot_gloves])
|
||||
var/obj/screen/inventory/inv = hud_used.inv_slots[slot_gloves]
|
||||
inv.update_icon()
|
||||
|
||||
@@ -246,7 +198,6 @@ There are several things that need to be remembered:
|
||||
apply_overlay(GLOVES_LAYER)
|
||||
|
||||
|
||||
|
||||
/mob/living/carbon/human/update_inv_glasses()
|
||||
remove_overlay(GLASSES_LAYER)
|
||||
|
||||
@@ -336,19 +287,10 @@ There are several things that need to be remembered:
|
||||
apply_overlay(SUIT_STORE_LAYER)
|
||||
|
||||
|
||||
|
||||
/mob/living/carbon/human/update_inv_head()
|
||||
remove_overlay(HEAD_LAYER)
|
||||
if(!get_bodypart("head")) //Decapitated
|
||||
return
|
||||
..()
|
||||
if(client && hud_used)
|
||||
var/obj/screen/inventory/inv = hud_used.inv_slots[slot_head]
|
||||
inv.update_icon()
|
||||
|
||||
update_mutant_bodyparts()
|
||||
|
||||
|
||||
/mob/living/carbon/human/update_inv_belt()
|
||||
remove_overlay(BELT_LAYER)
|
||||
|
||||
@@ -382,16 +324,16 @@ There are several things that need to be remembered:
|
||||
inv.update_icon()
|
||||
|
||||
if(istype(wear_suit, /obj/item/clothing/suit))
|
||||
wear_suit.screen_loc = ui_oclothing //TODO //Todo what?
|
||||
wear_suit.screen_loc = ui_oclothing
|
||||
if(client && hud_used && hud_used.hud_shown)
|
||||
if(hud_used.inventory_shown) //if the inventory is open ...
|
||||
client.screen += wear_suit //Either way, add the item to the HUD
|
||||
if(hud_used.inventory_shown)
|
||||
client.screen += wear_suit
|
||||
update_observer_view(wear_suit,1)
|
||||
|
||||
var/image/standing = wear_suit.build_worn_icon(state = wear_suit.icon_state, default_layer = SUIT_LAYER, default_icon_file = 'icons/mob/suit.dmi')
|
||||
overlays_standing[SUIT_LAYER] = standing
|
||||
|
||||
if(istype(wear_suit, /obj/item/clothing/suit/straight_jacket))
|
||||
if(wear_suit.breakouttime) //suit is restraining
|
||||
drop_all_held_items()
|
||||
|
||||
update_hair()
|
||||
@@ -423,22 +365,10 @@ There are several things that need to be remembered:
|
||||
update_observer_view(r_store)
|
||||
|
||||
|
||||
|
||||
/mob/living/carbon/human/update_inv_wear_mask()
|
||||
remove_overlay(FACEMASK_LAYER)
|
||||
if(!get_bodypart("head")) //Decapitated
|
||||
return
|
||||
..()
|
||||
if(client && hud_used)
|
||||
var/obj/screen/inventory/inv = hud_used.inv_slots[slot_wear_mask]
|
||||
inv.update_icon()
|
||||
update_mutant_bodyparts()
|
||||
update_mutant_bodyparts() //e.g. upgate needed because mask now hides lizard snout
|
||||
|
||||
/mob/living/carbon/human/update_inv_handcuffed()
|
||||
remove_overlay(HANDCUFF_LAYER)
|
||||
if(handcuffed)
|
||||
overlays_standing[HANDCUFF_LAYER] = image("icon"='icons/mob/mob.dmi', "icon_state"="handcuff1", "layer"=-HANDCUFF_LAYER)
|
||||
apply_overlay(HANDCUFF_LAYER)
|
||||
|
||||
/mob/living/carbon/human/update_inv_legcuffed()
|
||||
remove_overlay(LEGCUFF_LAYER)
|
||||
@@ -492,6 +422,8 @@ There are several things that need to be remembered:
|
||||
update_observer_view(I)
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
Does everything in relation to building the /image used in the mob's overlays list
|
||||
covers:
|
||||
@@ -581,31 +513,8 @@ generate/load female uniform sprites matching all previously decided variables
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/////////////////////
|
||||
// Limb Icon Cache //
|
||||
/////////////////////
|
||||
/*
|
||||
Called from update_body_parts() these procs handle the limb icon cache.
|
||||
the limb icon cache adds an icon_render_key to a human mob, it represents:
|
||||
- skin_tone (if applicable)
|
||||
- gender
|
||||
- limbs (stores as the limb name and whether it is removed/fine, organic/robotic)
|
||||
These procs only store limbs as to increase the number of matching icon_render_keys
|
||||
This cache exists because drawing 6/7 icons for humans constantly is quite a waste
|
||||
See RemieRichards on irc.rizon.net #coderbus
|
||||
*/
|
||||
|
||||
var/global/list/limb_icon_cache = list()
|
||||
|
||||
/mob/living/carbon/human
|
||||
var/icon_render_key = ""
|
||||
|
||||
|
||||
//produces a key based on the human's limbs
|
||||
/mob/living/carbon/human/proc/generate_icon_render_key()
|
||||
/mob/living/carbon/human/generate_icon_render_key()
|
||||
. = "[dna.species.limbs_id]"
|
||||
|
||||
if(dna.check_mutation(HULK))
|
||||
@@ -624,7 +533,7 @@ var/global/list/limb_icon_cache = list()
|
||||
for(var/X in bodyparts)
|
||||
var/obj/item/bodypart/BP = X
|
||||
. += "-[BP.body_zone]"
|
||||
if(BP.status == ORGAN_ORGANIC)
|
||||
if(BP.status == BODYPART_ORGANIC)
|
||||
. += "-organic"
|
||||
else
|
||||
. += "-robotic"
|
||||
@@ -632,16 +541,14 @@ var/global/list/limb_icon_cache = list()
|
||||
if(disabilities & HUSK)
|
||||
. += "-husk"
|
||||
|
||||
|
||||
//change the human's icon to the one matching it's key
|
||||
/mob/living/carbon/human/proc/load_limb_from_cache()
|
||||
if(limb_icon_cache[icon_render_key])
|
||||
remove_overlay(BODYPARTS_LAYER)
|
||||
overlays_standing[BODYPARTS_LAYER] = limb_icon_cache[icon_render_key]
|
||||
apply_overlay(BODYPARTS_LAYER)
|
||||
/mob/living/carbon/human/load_limb_from_cache()
|
||||
..()
|
||||
update_mutant_bodyparts()
|
||||
update_hair()
|
||||
|
||||
|
||||
/mob/living/carbon/human/proc/update_observer_view(var/obj/item/I,var/inventory)
|
||||
|
||||
/mob/living/carbon/human/proc/update_observer_view(obj/item/I, inventory)
|
||||
if(observers && observers.len)
|
||||
for(var/M in observers)
|
||||
var/mob/dead/observe = M
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
|
||||
handle_blood()
|
||||
|
||||
for(var/obj/item/organ/O in internal_organs)
|
||||
for(var/X in internal_organs)
|
||||
var/obj/item/organ/O = X
|
||||
O.on_life()
|
||||
|
||||
//Updates the number of stored chemicals for powers
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
if(75 to 100)
|
||||
if(prob(1))
|
||||
src << "<span class='danger'>You mutate!</span>"
|
||||
randmutb(src)
|
||||
randmutb()
|
||||
emote("gasp")
|
||||
domutcheck()
|
||||
..()
|
||||
@@ -83,29 +83,29 @@
|
||||
switch(bodytemperature)
|
||||
if(360 to 400)
|
||||
throw_alert("temp", /obj/screen/alert/hot, 1)
|
||||
adjustFireLoss(2)
|
||||
apply_damage(HEAT_DAMAGE_LEVEL_1, BURN)
|
||||
if(400 to 460)
|
||||
throw_alert("temp", /obj/screen/alert/hot, 2)
|
||||
adjustFireLoss(3)
|
||||
apply_damage(HEAT_DAMAGE_LEVEL_2, BURN)
|
||||
if(460 to INFINITY)
|
||||
throw_alert("temp", /obj/screen/alert/hot, 3)
|
||||
if(on_fire)
|
||||
adjustFireLoss(8)
|
||||
apply_damage(HEAT_DAMAGE_LEVEL_3, BURN)
|
||||
else
|
||||
adjustFireLoss(3)
|
||||
apply_damage(HEAT_DAMAGE_LEVEL_2, BURN)
|
||||
|
||||
else if(bodytemperature < BODYTEMP_COLD_DAMAGE_LIMIT)
|
||||
if(!istype(loc, /obj/machinery/atmospherics/components/unary/cryo_cell))
|
||||
switch(bodytemperature)
|
||||
if(200 to 260)
|
||||
throw_alert("temp", /obj/screen/alert/cold, 1)
|
||||
adjustFireLoss(0.5)
|
||||
apply_damage(COLD_DAMAGE_LEVEL_1, BURN)
|
||||
if(120 to 200)
|
||||
throw_alert("temp", /obj/screen/alert/cold, 2)
|
||||
adjustFireLoss(1.5)
|
||||
apply_damage(COLD_DAMAGE_LEVEL_2, BURN)
|
||||
if(-INFINITY to 120)
|
||||
throw_alert("temp", /obj/screen/alert/cold, 3)
|
||||
adjustFireLoss(3)
|
||||
apply_damage(COLD_DAMAGE_LEVEL_3, BURN)
|
||||
else
|
||||
clear_alert("temp")
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
voice_name = "monkey"
|
||||
verb_say = "chimpers"
|
||||
icon = 'icons/mob/monkey.dmi'
|
||||
icon_state = "monkey1"
|
||||
icon_state = ""
|
||||
gender = NEUTER
|
||||
pass_flags = PASSTABLE
|
||||
languages_spoken = MONKEY
|
||||
@@ -13,6 +13,10 @@
|
||||
type_of_meat = /obj/item/weapon/reagent_containers/food/snacks/meat/slab/monkey
|
||||
gib_type = /obj/effect/decal/cleanable/blood/gibs
|
||||
unique_name = 1
|
||||
bodyparts = list(/obj/item/bodypart/chest/monkey, /obj/item/bodypart/head/monkey, /obj/item/bodypart/l_arm/monkey,
|
||||
/obj/item/bodypart/r_arm/monkey, /obj/item/bodypart/r_leg/monkey, /obj/item/bodypart/l_leg/monkey)
|
||||
|
||||
|
||||
|
||||
/mob/living/carbon/monkey/New()
|
||||
verbs += /mob/living/proc/mob_sleep
|
||||
@@ -22,24 +26,13 @@
|
||||
gender = pick(MALE, FEMALE)
|
||||
real_name = name
|
||||
|
||||
//initialize limbs, currently only used to handle cavity implant surgery, no dismemberment.
|
||||
bodyparts = newlist(/obj/item/bodypart/chest, /obj/item/bodypart/head, /obj/item/bodypart/l_arm,
|
||||
/obj/item/bodypart/r_arm, /obj/item/bodypart/r_leg, /obj/item/bodypart/l_leg)
|
||||
for(var/X in bodyparts)
|
||||
var/obj/item/bodypart/O = X
|
||||
O.owner = src
|
||||
//initialize limbs
|
||||
create_bodyparts()
|
||||
|
||||
if(good_mutations.len) //genetic mutations have been set up.
|
||||
initialize()
|
||||
initialize() //initialize monkey dna
|
||||
|
||||
internal_organs += new /obj/item/organ/appendix
|
||||
internal_organs += new /obj/item/organ/lungs
|
||||
internal_organs += new /obj/item/organ/heart
|
||||
internal_organs += new /obj/item/organ/brain
|
||||
internal_organs += new /obj/item/organ/tongue
|
||||
|
||||
for(var/obj/item/organ/I in internal_organs)
|
||||
I.Insert(src)
|
||||
create_internal_organs()
|
||||
|
||||
..()
|
||||
|
||||
@@ -47,6 +40,15 @@
|
||||
create_dna(src)
|
||||
dna.initialize_dna(random_blood_type())
|
||||
|
||||
|
||||
/mob/living/carbon/monkey/create_internal_organs()
|
||||
internal_organs += new /obj/item/organ/appendix
|
||||
internal_organs += new /obj/item/organ/lungs
|
||||
internal_organs += new /obj/item/organ/heart
|
||||
internal_organs += new /obj/item/organ/brain
|
||||
internal_organs += new /obj/item/organ/tongue
|
||||
..()
|
||||
|
||||
/mob/living/carbon/monkey/movement_delay()
|
||||
if(reagents)
|
||||
if(reagents.has_reagent("morphine"))
|
||||
@@ -64,133 +66,6 @@
|
||||
. += (283.222 - bodytemperature) / 10 * 1.75
|
||||
return . + config.monkey_delay
|
||||
|
||||
/mob/living/carbon/monkey/attack_paw(mob/living/M)
|
||||
if(..()) //successful monkey bite.
|
||||
var/damage = rand(1, 5)
|
||||
if (stat != DEAD)
|
||||
adjustBruteLoss(damage)
|
||||
updatehealth()
|
||||
return
|
||||
|
||||
/mob/living/carbon/monkey/attack_larva(mob/living/carbon/alien/larva/L)
|
||||
if(..()) //successful larva bite.
|
||||
var/damage = rand(1, 3)
|
||||
if(stat != DEAD)
|
||||
L.amount_grown = min(L.amount_grown + damage, L.max_grown)
|
||||
adjustBruteLoss(damage)
|
||||
updatehealth()
|
||||
|
||||
/mob/living/carbon/monkey/attack_hand(mob/living/carbon/human/M)
|
||||
if(..()) //To allow surgery to return properly.
|
||||
return
|
||||
|
||||
switch(M.a_intent)
|
||||
if("help")
|
||||
help_shake_act(M)
|
||||
if("grab")
|
||||
grabbedby(M)
|
||||
if("harm")
|
||||
M.do_attack_animation(src)
|
||||
if (prob(75))
|
||||
visible_message("<span class='danger'>[M] has punched [name]!</span>", \
|
||||
"<span class='userdanger'>[M] has punched [name]!</span>")
|
||||
|
||||
playsound(loc, "punch", 25, 1, -1)
|
||||
var/damage = rand(5, 10)
|
||||
if (prob(40))
|
||||
damage = rand(10, 15)
|
||||
if ( (paralysis < 5) && (health > 0) )
|
||||
Paralyse(rand(10, 15))
|
||||
visible_message("<span class='danger'>[M] has knocked out [name]!</span>", \
|
||||
"<span class='userdanger'>[M] has knocked out [name]!</span>")
|
||||
adjustBruteLoss(damage)
|
||||
add_logs(M, src, "attacked")
|
||||
updatehealth()
|
||||
else
|
||||
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
|
||||
visible_message("<span class='danger'>[M] has attempted to punch [name]!</span>", \
|
||||
"<span class='userdanger'>[M] has attempted to punch [name]!</span>")
|
||||
if("disarm")
|
||||
if (!( paralysis ))
|
||||
M.do_attack_animation(src)
|
||||
if (prob(25))
|
||||
Paralyse(2)
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
add_logs(M, src, "pushed")
|
||||
visible_message("<span class='danger'>[M] has pushed down [src]!</span>", \
|
||||
"<span class='userdanger'>[M] has pushed down [src]!</span>")
|
||||
else
|
||||
if(drop_item())
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
visible_message("<span class='danger'>[M] has disarmed [src]!</span>", \
|
||||
"<span class='userdanger'>[M] has disarmed [src]!</span>")
|
||||
|
||||
/mob/living/carbon/monkey/attack_alien(mob/living/carbon/alien/humanoid/M)
|
||||
if(..()) //if harm or disarm intent.
|
||||
if (M.a_intent == "harm")
|
||||
if ((prob(95) && health > 0))
|
||||
playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1)
|
||||
var/damage = rand(15, 30)
|
||||
if (damage >= 25)
|
||||
damage = rand(20, 40)
|
||||
if (paralysis < 15)
|
||||
Paralyse(rand(10, 15))
|
||||
visible_message("<span class='danger'>[M] has wounded [name]!</span>", \
|
||||
"<span class='userdanger'>[M] has wounded [name]!</span>")
|
||||
else
|
||||
visible_message("<span class='danger'>[M] has slashed [name]!</span>", \
|
||||
"<span class='userdanger'>[M] has slashed [name]!</span>")
|
||||
|
||||
if (stat != DEAD)
|
||||
adjustBruteLoss(damage)
|
||||
updatehealth()
|
||||
add_logs(M, src, "attacked")
|
||||
else
|
||||
playsound(loc, 'sound/weapons/slashmiss.ogg', 25, 1, -1)
|
||||
visible_message("<span class='danger'>[M] has attempted to lunge at [name]!</span>", \
|
||||
"<span class='userdanger'>[M] has attempted to lunge at [name]!</span>")
|
||||
|
||||
if (M.a_intent == "disarm")
|
||||
playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1)
|
||||
if(prob(95))
|
||||
Weaken(10)
|
||||
visible_message("<span class='danger'>[M] has tackled down [name]!</span>", \
|
||||
"<span class='userdanger'>[M] has tackled down [name]!</span>")
|
||||
else
|
||||
if(drop_item())
|
||||
visible_message("<span class='danger'>[M] has disarmed [name]!</span>", \
|
||||
"<span class='userdanger'>[M] has disarmed [name]!</span>")
|
||||
add_logs(M, src, "disarmed")
|
||||
updatehealth()
|
||||
return
|
||||
|
||||
/mob/living/carbon/monkey/attack_animal(mob/living/simple_animal/M)
|
||||
if(..())
|
||||
var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
|
||||
switch(M.melee_damage_type)
|
||||
if(BRUTE)
|
||||
adjustBruteLoss(damage)
|
||||
if(BURN)
|
||||
adjustFireLoss(damage)
|
||||
if(TOX)
|
||||
adjustToxLoss(damage)
|
||||
if(OXY)
|
||||
adjustOxyLoss(damage)
|
||||
if(CLONE)
|
||||
adjustCloneLoss(damage)
|
||||
if(STAMINA)
|
||||
adjustStaminaLoss(damage)
|
||||
updatehealth()
|
||||
|
||||
|
||||
/mob/living/carbon/monkey/attack_slime(mob/living/simple_animal/slime/M)
|
||||
if(..()) //successful slime attack
|
||||
var/damage = rand(5, 35)
|
||||
if(M.is_adult)
|
||||
damage = rand(20, 40)
|
||||
adjustBruteLoss(damage)
|
||||
updatehealth()
|
||||
|
||||
/mob/living/carbon/monkey/Stat()
|
||||
..()
|
||||
if(statpanel("Status"))
|
||||
@@ -209,24 +84,6 @@
|
||||
internal = null
|
||||
return
|
||||
|
||||
/mob/living/carbon/monkey/ex_act(severity, target)
|
||||
..()
|
||||
switch(severity)
|
||||
if(1)
|
||||
gib()
|
||||
return
|
||||
if(2)
|
||||
adjustBruteLoss(60)
|
||||
adjustFireLoss(60)
|
||||
adjustEarDamage(30,120)
|
||||
if(3)
|
||||
adjustBruteLoss(30)
|
||||
if (prob(50))
|
||||
Paralyse(10)
|
||||
adjustEarDamage(15,60)
|
||||
|
||||
updatehealth()
|
||||
return
|
||||
|
||||
/mob/living/carbon/monkey/IsAdvancedToolUser()//Unless its monkey mode monkeys cant use advanced tools
|
||||
return 0
|
||||
@@ -270,24 +127,6 @@
|
||||
|
||||
return threatcount
|
||||
|
||||
/mob/living/carbon/monkey/acid_act(acidpwr, toxpwr, acid_volume)
|
||||
if(wear_mask)
|
||||
if(!wear_mask.unacidable)
|
||||
wear_mask.acid_act(acidpwr)
|
||||
update_inv_wear_mask()
|
||||
else
|
||||
src << "<span class='warning'>Your mask protects you from the acid.</span>"
|
||||
return
|
||||
|
||||
take_organ_damage(min(6*toxpwr, acid_volume * acidpwr/10))
|
||||
|
||||
/mob/living/carbon/monkey/help_shake_act(mob/living/carbon/M)
|
||||
if(health < 0 && ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
H.do_cpr(src)
|
||||
else
|
||||
..()
|
||||
|
||||
/mob/living/carbon/monkey/get_permeability_protection()
|
||||
var/protection = 0
|
||||
if(head)
|
||||
@@ -297,13 +136,6 @@
|
||||
protection = protection/7 //the rest of the body isn't covered.
|
||||
return protection
|
||||
|
||||
/mob/living/carbon/monkey/check_eye_prot()
|
||||
var/number = ..()
|
||||
if(istype(src.wear_mask, /obj/item/clothing/mask))
|
||||
var/obj/item/clothing/mask/MFP = src.wear_mask
|
||||
number += MFP.flash_protect
|
||||
return number
|
||||
|
||||
/mob/living/carbon/monkey/fully_heal(admin_revive = 0)
|
||||
if(!getorganslot("lungs"))
|
||||
var/obj/item/organ/lungs/L = new()
|
||||
|
||||
@@ -0,0 +1,188 @@
|
||||
|
||||
/mob/living/carbon/monkey/get_eye_protection()
|
||||
var/number = ..()
|
||||
if(istype(src.wear_mask, /obj/item/clothing/mask))
|
||||
var/obj/item/clothing/mask/MFP = src.wear_mask
|
||||
number += MFP.flash_protect
|
||||
return number
|
||||
|
||||
/mob/living/carbon/monkey/help_shake_act(mob/living/carbon/M)
|
||||
if(health < 0 && ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
H.do_cpr(src)
|
||||
else
|
||||
..()
|
||||
|
||||
/mob/living/carbon/monkey/attack_paw(mob/living/M)
|
||||
if(..()) //successful monkey bite.
|
||||
var/dam_zone = pick("chest", "l_hand", "r_hand", "l_leg", "r_leg")
|
||||
var/obj/item/bodypart/affecting = get_bodypart(ran_zone(dam_zone))
|
||||
if(M.limb_destroyer)
|
||||
dismembering_strike(M, affecting.body_zone)
|
||||
if(stat != DEAD)
|
||||
apply_damage(rand(1, 5), BRUTE, affecting)
|
||||
|
||||
|
||||
|
||||
/mob/living/carbon/monkey/attack_larva(mob/living/carbon/alien/larva/L)
|
||||
if(..()) //successful larva bite.
|
||||
var/damage = rand(1, 3)
|
||||
if(stat != DEAD)
|
||||
L.amount_grown = min(L.amount_grown + damage, L.max_grown)
|
||||
var/obj/item/bodypart/affecting = get_bodypart(ran_zone(L.zone_selected))
|
||||
apply_damage(damage, BRUTE, affecting)
|
||||
|
||||
/mob/living/carbon/monkey/attack_hand(mob/living/carbon/human/M)
|
||||
if(..()) //To allow surgery to return properly.
|
||||
return
|
||||
|
||||
switch(M.a_intent)
|
||||
if("help")
|
||||
help_shake_act(M)
|
||||
if("grab")
|
||||
grabbedby(M)
|
||||
if("harm")
|
||||
M.do_attack_animation(src)
|
||||
if (prob(75))
|
||||
visible_message("<span class='danger'>[M] has punched [name]!</span>", \
|
||||
"<span class='userdanger'>[M] has punched [name]!</span>")
|
||||
|
||||
playsound(loc, "punch", 25, 1, -1)
|
||||
var/damage = rand(5, 10)
|
||||
if (prob(40))
|
||||
damage = rand(10, 15)
|
||||
if ( (paralysis < 5) && (health > 0) )
|
||||
Paralyse(rand(10, 15))
|
||||
visible_message("<span class='danger'>[M] has knocked out [name]!</span>", \
|
||||
"<span class='userdanger'>[M] has knocked out [name]!</span>")
|
||||
var/obj/item/bodypart/affecting = get_bodypart(ran_zone(M.zone_selected))
|
||||
apply_damage(damage, BRUTE, affecting)
|
||||
add_logs(M, src, "attacked")
|
||||
|
||||
else
|
||||
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
|
||||
visible_message("<span class='danger'>[M] has attempted to punch [name]!</span>", \
|
||||
"<span class='userdanger'>[M] has attempted to punch [name]!</span>")
|
||||
if("disarm")
|
||||
if (!( paralysis ))
|
||||
M.do_attack_animation(src)
|
||||
if (prob(25))
|
||||
Paralyse(2)
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
add_logs(M, src, "pushed")
|
||||
visible_message("<span class='danger'>[M] has pushed down [src]!</span>", \
|
||||
"<span class='userdanger'>[M] has pushed down [src]!</span>")
|
||||
else
|
||||
if(drop_item())
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
visible_message("<span class='danger'>[M] has disarmed [src]!</span>", \
|
||||
"<span class='userdanger'>[M] has disarmed [src]!</span>")
|
||||
|
||||
/mob/living/carbon/monkey/attack_alien(mob/living/carbon/alien/humanoid/M)
|
||||
if(..()) //if harm or disarm intent.
|
||||
if (M.a_intent == "harm")
|
||||
if ((prob(95) && health > 0))
|
||||
playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1)
|
||||
var/damage = rand(15, 30)
|
||||
if (damage >= 25)
|
||||
damage = rand(20, 40)
|
||||
if (paralysis < 15)
|
||||
Paralyse(rand(10, 15))
|
||||
visible_message("<span class='danger'>[M] has wounded [name]!</span>", \
|
||||
"<span class='userdanger'>[M] has wounded [name]!</span>")
|
||||
else
|
||||
visible_message("<span class='danger'>[M] has slashed [name]!</span>", \
|
||||
"<span class='userdanger'>[M] has slashed [name]!</span>")
|
||||
|
||||
var/obj/item/bodypart/affecting = get_bodypart(ran_zone(M.zone_selected))
|
||||
add_logs(M, src, "attacked")
|
||||
if(!dismembering_strike(M, M.zone_selected)) //Dismemberment successful
|
||||
return 1
|
||||
apply_damage(damage, BRUTE, affecting)
|
||||
|
||||
else
|
||||
playsound(loc, 'sound/weapons/slashmiss.ogg', 25, 1, -1)
|
||||
visible_message("<span class='danger'>[M] has attempted to lunge at [name]!</span>", \
|
||||
"<span class='userdanger'>[M] has attempted to lunge at [name]!</span>")
|
||||
|
||||
if (M.a_intent == "disarm")
|
||||
playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1)
|
||||
if(prob(95))
|
||||
Weaken(10)
|
||||
visible_message("<span class='danger'>[M] has tackled down [name]!</span>", \
|
||||
"<span class='userdanger'>[M] has tackled down [name]!</span>")
|
||||
else
|
||||
if(drop_item())
|
||||
visible_message("<span class='danger'>[M] has disarmed [name]!</span>", \
|
||||
"<span class='userdanger'>[M] has disarmed [name]!</span>")
|
||||
add_logs(M, src, "disarmed")
|
||||
updatehealth()
|
||||
|
||||
|
||||
/mob/living/carbon/monkey/attack_animal(mob/living/simple_animal/M)
|
||||
if(..())
|
||||
var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
|
||||
var/dam_zone = dismembering_strike(M, pick("chest", "l_hand", "r_hand", "l_leg", "r_leg"))
|
||||
if(!dam_zone) //Dismemberment successful
|
||||
return 1
|
||||
var/obj/item/bodypart/affecting = get_bodypart(ran_zone(dam_zone))
|
||||
apply_damage(damage, M.melee_damage_type, affecting)
|
||||
|
||||
|
||||
|
||||
/mob/living/carbon/monkey/attack_slime(mob/living/simple_animal/slime/M)
|
||||
if(..()) //successful slime attack
|
||||
var/damage = rand(5, 35)
|
||||
if(M.is_adult)
|
||||
damage = rand(20, 40)
|
||||
var/dam_zone = dismembering_strike(M, pick("head", "chest", "l_arm", "r_arm", "l_leg", "r_leg"))
|
||||
if(!dam_zone) //Dismemberment successful
|
||||
return 1
|
||||
var/obj/item/bodypart/affecting = get_bodypart(ran_zone(dam_zone))
|
||||
apply_damage(damage, BRUTE, affecting)
|
||||
|
||||
|
||||
/mob/living/carbon/monkey/acid_act(acidpwr, toxpwr, acid_volume)
|
||||
if(wear_mask)
|
||||
if(!wear_mask.unacidable)
|
||||
wear_mask.acid_act(acidpwr)
|
||||
update_inv_wear_mask()
|
||||
else
|
||||
src << "<span class='warning'>Your mask protects you from the acid.</span>"
|
||||
return
|
||||
|
||||
take_bodypart_damage(min(6*toxpwr, acid_volume * acidpwr/10))
|
||||
|
||||
|
||||
/mob/living/carbon/monkey/ex_act(severity, target)
|
||||
..()
|
||||
|
||||
switch (severity)
|
||||
if (1)
|
||||
gib()
|
||||
|
||||
if (2)
|
||||
take_overall_damage(60, 60)
|
||||
shred_clothing(1,50)
|
||||
adjustEarDamage(30, 120)
|
||||
if(prob(70))
|
||||
Paralyse(10)
|
||||
|
||||
if(3)
|
||||
take_overall_damage(30, 0)
|
||||
adjustEarDamage(15,60)
|
||||
if (prob(50))
|
||||
Paralyse(8)
|
||||
|
||||
|
||||
//attempt to dismember bodyparts
|
||||
if(severity <= 2)
|
||||
var/max_limb_loss = round(4/severity) //so you don't lose four limbs at severity 3.
|
||||
for(var/X in bodyparts)
|
||||
var/obj/item/bodypart/BP = X
|
||||
if(prob(50/severity) && BP.body_zone != "chest")
|
||||
BP.brute_dam = BP.max_damage
|
||||
BP.dismember()
|
||||
max_limb_loss--
|
||||
if(!max_limb_loss)
|
||||
break
|
||||
@@ -1,29 +1,47 @@
|
||||
|
||||
/mob/living/carbon/monkey/regenerate_icons()
|
||||
if(!..())
|
||||
update_body_parts()
|
||||
update_hair()
|
||||
update_inv_wear_mask()
|
||||
update_inv_head()
|
||||
update_inv_back()
|
||||
update_icons()
|
||||
update_transform()
|
||||
|
||||
/mob/living/carbon/monkey/update_icons()
|
||||
cut_overlays()
|
||||
icon_state = "monkey1"
|
||||
for(var/image/I in overlays_standing)
|
||||
add_overlay(I)
|
||||
|
||||
////////
|
||||
|
||||
|
||||
/mob/living/carbon/monkey/update_hair()
|
||||
remove_overlay(HAIR_LAYER)
|
||||
|
||||
var/obj/item/bodypart/head/HD = get_bodypart("head")
|
||||
if(!HD) //Decapitated
|
||||
return
|
||||
|
||||
if(disabilities & HUSK)
|
||||
return
|
||||
|
||||
var/hair_hidden = 0
|
||||
|
||||
if(head)
|
||||
var/obj/item/I = head
|
||||
if(I.flags_inv & HIDEHAIR)
|
||||
hair_hidden = 1
|
||||
if(wear_mask)
|
||||
var/obj/item/clothing/mask/M = wear_mask
|
||||
if(M.flags_inv & HIDEHAIR)
|
||||
hair_hidden = 1
|
||||
if(!hair_hidden)
|
||||
if(!getorgan(/obj/item/organ/brain)) //Applies the debrained overlay if there is no brain
|
||||
var/image/I = image("icon"='icons/mob/human_face.dmi', "icon_state" = "debrained_s", "layer" = -HAIR_LAYER)
|
||||
overlays_standing[HAIR_LAYER] = I
|
||||
apply_overlay(HAIR_LAYER)
|
||||
|
||||
|
||||
/mob/living/carbon/monkey/update_fire()
|
||||
..("Monkey_burning")
|
||||
|
||||
/mob/living/carbon/monkey/update_inv_handcuffed()
|
||||
remove_overlay(HANDCUFF_LAYER)
|
||||
if(handcuffed)
|
||||
overlays_standing[HANDCUFF_LAYER] = image("icon"='icons/mob/mob.dmi', "icon_state"="handcuff1", "layer"=-HANDCUFF_LAYER)
|
||||
apply_overlay(HANDCUFF_LAYER)
|
||||
|
||||
/mob/living/carbon/monkey/update_inv_legcuffed()
|
||||
remove_overlay(LEGCUFF_LAYER)
|
||||
if(legcuffed)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//Here are the procs used to modify status effects of a mob.
|
||||
//The effects include: stunned, weakened, paralysis, sleeping, resting, jitteriness, dizziness, ear damage,
|
||||
// eye damage, eye_blind, eye_blurry, druggy, BLIND disability, and NEARSIGHT disability.
|
||||
// eye damage, eye_blind, eye_blurry, druggy, BLIND disability, NEARSIGHT disability, and HUSK disability.
|
||||
|
||||
/mob/living/carbon/damage_eyes(amount)
|
||||
if(amount>0)
|
||||
@@ -76,4 +76,19 @@
|
||||
if(!(disabilities & NEARSIGHT))
|
||||
disabilities |= NEARSIGHT
|
||||
overlay_fullscreen("nearsighted", /obj/screen/fullscreen/impaired, 1)
|
||||
return 1
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/cure_husk()
|
||||
if(disabilities & HUSK)
|
||||
disabilities &= ~HUSK
|
||||
status_flags &= ~DISFIGURED
|
||||
update_body()
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/become_husk()
|
||||
if(disabilities & HUSK)
|
||||
return
|
||||
disabilities |= HUSK
|
||||
status_flags |= DISFIGURED //makes them unknown
|
||||
update_body()
|
||||
return 1
|
||||
|
||||
@@ -40,10 +40,18 @@
|
||||
overlays -= overlays_standing[cache_index]
|
||||
overlays_standing[cache_index] = null
|
||||
|
||||
/mob/living/carbon/regenerate_icons()
|
||||
if(notransform)
|
||||
return 1
|
||||
update_inv_hands()
|
||||
update_inv_handcuffed()
|
||||
update_inv_legcuffed()
|
||||
update_fire()
|
||||
|
||||
|
||||
/mob/living/carbon/update_inv_hands()
|
||||
remove_overlay(HANDS_LAYER)
|
||||
if(handcuffed)
|
||||
if (handcuffed)
|
||||
drop_all_held_items()
|
||||
return
|
||||
|
||||
@@ -85,23 +93,44 @@
|
||||
|
||||
apply_overlay(FIRE_LAYER)
|
||||
|
||||
/mob/living/carbon/regenerate_icons()
|
||||
if(notransform)
|
||||
return 1
|
||||
update_inv_hands()
|
||||
update_inv_handcuffed()
|
||||
update_inv_legcuffed()
|
||||
update_fire()
|
||||
|
||||
|
||||
/mob/living/carbon/update_damage_overlays()
|
||||
remove_overlay(DAMAGE_LAYER)
|
||||
|
||||
var/image/standing = image("icon"='icons/mob/dam_mob.dmi', "icon_state"="blank", "layer"=-DAMAGE_LAYER)
|
||||
overlays_standing[DAMAGE_LAYER] = standing
|
||||
|
||||
for(var/X in bodyparts)
|
||||
var/obj/item/bodypart/BP = X
|
||||
if(BP.dmg_overlay_type)
|
||||
if(BP.brutestate)
|
||||
standing.overlays += "[BP.dmg_overlay_type]_[BP.body_zone]_[BP.brutestate]0" //we're adding icon_states of the base image as overlays
|
||||
if(BP.burnstate)
|
||||
standing.overlays += "[BP.dmg_overlay_type]_[BP.body_zone]_0[BP.burnstate]"
|
||||
|
||||
apply_overlay(DAMAGE_LAYER)
|
||||
|
||||
|
||||
/mob/living/carbon/update_inv_wear_mask()
|
||||
remove_overlay(FACEMASK_LAYER)
|
||||
if(istype(wear_mask, /obj/item/clothing/mask))
|
||||
|
||||
if(!get_bodypart("head")) //Decapitated
|
||||
return
|
||||
|
||||
if(client && hud_used && hud_used.inv_slots[slot_wear_mask])
|
||||
var/obj/screen/inventory/inv = hud_used.inv_slots[slot_wear_mask]
|
||||
inv.update_icon()
|
||||
|
||||
if(wear_mask)
|
||||
if(!(head && (head.flags_inv & HIDEMASK)))
|
||||
var/image/standing = wear_mask.build_worn_icon(state = wear_mask.icon_state, default_layer = FACEMASK_LAYER, default_icon_file = 'icons/mob/mask.dmi')
|
||||
overlays_standing[FACEMASK_LAYER] = standing
|
||||
update_hud_wear_mask(wear_mask)
|
||||
|
||||
apply_overlay(FACEMASK_LAYER)
|
||||
|
||||
|
||||
/mob/living/carbon/update_inv_back()
|
||||
remove_overlay(BACK_LAYER)
|
||||
|
||||
@@ -117,14 +146,27 @@
|
||||
|
||||
/mob/living/carbon/update_inv_head()
|
||||
remove_overlay(HEAD_LAYER)
|
||||
|
||||
if(!get_bodypart("head")) //Decapitated
|
||||
return
|
||||
|
||||
if(client && hud_used && hud_used.inv_slots[slot_back])
|
||||
var/obj/screen/inventory/inv = hud_used.inv_slots[slot_head]
|
||||
inv.update_icon()
|
||||
|
||||
if(head)
|
||||
var/image/standing = head.build_worn_icon(state = head.icon_state, default_layer = HEAD_LAYER, default_icon_file = 'icons/mob/head.dmi')
|
||||
overlays_standing[HEAD_LAYER] = standing
|
||||
update_hud_head(head)
|
||||
|
||||
apply_overlay(HEAD_LAYER)
|
||||
|
||||
|
||||
/mob/living/carbon/update_inv_handcuffed()
|
||||
return
|
||||
remove_overlay(HANDCUFF_LAYER)
|
||||
if(handcuffed)
|
||||
overlays_standing[HANDCUFF_LAYER] = image("icon"='icons/mob/mob.dmi', "icon_state"="handcuff1", "layer"=-HANDCUFF_LAYER)
|
||||
apply_overlay(HANDCUFF_LAYER)
|
||||
|
||||
|
||||
//mob HUD updates for items in our inventory
|
||||
@@ -150,12 +192,92 @@
|
||||
return
|
||||
|
||||
|
||||
|
||||
//Overlays for the worn overlay so you can overlay while you overlay
|
||||
//eg: ammo counters, primed grenade flashing, etc.
|
||||
/obj/item/proc/worn_overlays(var/isinhands = FALSE)
|
||||
/obj/item/proc/worn_overlays(isinhands = FALSE)
|
||||
. = list()
|
||||
|
||||
|
||||
/mob/living/carbon/update_body()
|
||||
update_body_parts()
|
||||
|
||||
/mob/living/carbon/proc/update_body_parts()
|
||||
//CHECK FOR UPDATE
|
||||
var/oldkey = icon_render_key
|
||||
icon_render_key = generate_icon_render_key()
|
||||
if(oldkey == icon_render_key)
|
||||
return
|
||||
|
||||
remove_overlay(BODYPARTS_LAYER)
|
||||
|
||||
for(var/X in bodyparts)
|
||||
var/obj/item/bodypart/BP = X
|
||||
if(!BP.no_update)
|
||||
BP.update_limb()
|
||||
|
||||
//LOAD ICONS
|
||||
if(limb_icon_cache[icon_render_key])
|
||||
load_limb_from_cache()
|
||||
return
|
||||
|
||||
//GENERATE NEW LIMBS
|
||||
var/list/new_limbs = list()
|
||||
for(var/X in bodyparts)
|
||||
var/obj/item/bodypart/BP = X
|
||||
var/image/temp = BP.get_limb_icon()
|
||||
if(temp)
|
||||
new_limbs += temp
|
||||
if(new_limbs.len)
|
||||
overlays_standing[BODYPARTS_LAYER] = new_limbs
|
||||
limb_icon_cache[icon_render_key] = new_limbs
|
||||
|
||||
apply_overlay(BODYPARTS_LAYER)
|
||||
update_damage_overlays()
|
||||
|
||||
|
||||
|
||||
/////////////////////
|
||||
// Limb Icon Cache //
|
||||
/////////////////////
|
||||
/*
|
||||
Called from update_body_parts() these procs handle the limb icon cache.
|
||||
the limb icon cache adds an icon_render_key to a human mob, it represents:
|
||||
- skin_tone (if applicable)
|
||||
- gender
|
||||
- limbs (stores as the limb name and whether it is removed/fine, organic/robotic)
|
||||
These procs only store limbs as to increase the number of matching icon_render_keys
|
||||
This cache exists because drawing 6/7 icons for humans constantly is quite a waste
|
||||
See RemieRichards on irc.rizon.net #coderbus
|
||||
*/
|
||||
|
||||
var/global/list/limb_icon_cache = list()
|
||||
|
||||
/mob/living/carbon
|
||||
var/icon_render_key = ""
|
||||
|
||||
|
||||
//produces a key based on the mob's limbs
|
||||
|
||||
/mob/living/carbon/proc/generate_icon_render_key()
|
||||
for(var/X in bodyparts)
|
||||
var/obj/item/bodypart/BP = X
|
||||
. += "-[BP.body_zone]"
|
||||
if(BP.animal_origin)
|
||||
. += "-[BP.animal_origin]"
|
||||
if(BP.status == BODYPART_ORGANIC)
|
||||
. += "-organic"
|
||||
else
|
||||
. += "-robotic"
|
||||
|
||||
if(disabilities & HUSK)
|
||||
. += "-husk"
|
||||
|
||||
|
||||
//change the mob's icon to the one matching its key
|
||||
/mob/living/carbon/proc/load_limb_from_cache()
|
||||
if(limb_icon_cache[icon_render_key])
|
||||
remove_overlay(BODYPARTS_LAYER)
|
||||
overlays_standing[BODYPARTS_LAYER] = limb_icon_cache[icon_render_key]
|
||||
apply_overlay(BODYPARTS_LAYER)
|
||||
update_damage_overlays()
|
||||
|
||||
@@ -9,23 +9,22 @@
|
||||
standard 0 if fail
|
||||
*/
|
||||
/mob/living/proc/apply_damage(damage = 0,damagetype = BRUTE, def_zone = null, blocked = 0)
|
||||
blocked = (100-blocked)/100
|
||||
if(!damage || (blocked <= 0))
|
||||
var/hit_percent = (100-blocked)/100
|
||||
if(!damage || (hit_percent <= 0))
|
||||
return 0
|
||||
switch(damagetype)
|
||||
if(BRUTE)
|
||||
adjustBruteLoss(damage * blocked)
|
||||
adjustBruteLoss(damage * hit_percent)
|
||||
if(BURN)
|
||||
adjustFireLoss(damage * blocked)
|
||||
adjustFireLoss(damage * hit_percent)
|
||||
if(TOX)
|
||||
adjustToxLoss(damage * blocked)
|
||||
adjustToxLoss(damage * hit_percent)
|
||||
if(OXY)
|
||||
adjustOxyLoss(damage * blocked)
|
||||
adjustOxyLoss(damage * hit_percent)
|
||||
if(CLONE)
|
||||
adjustCloneLoss(damage * blocked)
|
||||
adjustCloneLoss(damage * hit_percent)
|
||||
if(STAMINA)
|
||||
adjustStaminaLoss(damage * blocked)
|
||||
updatehealth()
|
||||
adjustStaminaLoss(damage * hit_percent)
|
||||
return 1
|
||||
|
||||
|
||||
@@ -49,30 +48,30 @@
|
||||
|
||||
|
||||
/mob/living/proc/apply_effect(effect = 0,effecttype = STUN, blocked = 0)
|
||||
blocked = (100-blocked)/100
|
||||
if(!effect || (blocked <= 0))
|
||||
var/hit_percent = (100-blocked)/100
|
||||
if(!effect || (hit_percent <= 0))
|
||||
return 0
|
||||
switch(effecttype)
|
||||
if(STUN)
|
||||
Stun(effect * blocked)
|
||||
Stun(effect * hit_percent)
|
||||
if(WEAKEN)
|
||||
Weaken(effect * blocked)
|
||||
Weaken(effect * hit_percent)
|
||||
if(PARALYZE)
|
||||
Paralyse(effect * blocked)
|
||||
Paralyse(effect * hit_percent)
|
||||
if(IRRADIATE)
|
||||
radiation += max(effect * blocked, 0)
|
||||
radiation += max(effect * hit_percent, 0)
|
||||
if(SLUR)
|
||||
slurring = max(slurring,(effect * blocked))
|
||||
slurring = max(slurring,(effect * hit_percent))
|
||||
if(STUTTER)
|
||||
if(status_flags & CANSTUN) // stun is usually associated with stutter
|
||||
stuttering = max(stuttering,(effect * blocked))
|
||||
stuttering = max(stuttering,(effect * hit_percent))
|
||||
if(EYE_BLUR)
|
||||
blur_eyes(effect * blocked)
|
||||
blur_eyes(effect * hit_percent)
|
||||
if(DROWSY)
|
||||
drowsyness = max(drowsyness,(effect * blocked))
|
||||
drowsyness = max(drowsyness,(effect * hit_percent))
|
||||
if(JITTER)
|
||||
if(status_flags & CANSTUN)
|
||||
jitteriness = max(jitteriness,(effect * blocked))
|
||||
jitteriness = max(jitteriness,(effect * hit_percent))
|
||||
return 1
|
||||
|
||||
|
||||
@@ -99,4 +98,128 @@
|
||||
apply_damage(stamina, STAMINA, null, blocked)
|
||||
if(jitter)
|
||||
apply_effect(jitter, JITTER, blocked)
|
||||
return 1
|
||||
return 1
|
||||
|
||||
|
||||
/mob/living/proc/getBruteLoss()
|
||||
return bruteloss
|
||||
|
||||
/mob/living/proc/adjustBruteLoss(amount, updating_health=1)
|
||||
if(status_flags & GODMODE)
|
||||
return 0
|
||||
bruteloss = Clamp((bruteloss + (amount * config.damage_multiplier)), 0, maxHealth*2)
|
||||
if(updating_health)
|
||||
updatehealth()
|
||||
|
||||
/mob/living/proc/getOxyLoss()
|
||||
return oxyloss
|
||||
|
||||
/mob/living/proc/adjustOxyLoss(amount, updating_health=1)
|
||||
if(status_flags & GODMODE)
|
||||
return 0
|
||||
oxyloss = Clamp((oxyloss + (amount * config.damage_multiplier)), 0, maxHealth*2)
|
||||
if(updating_health)
|
||||
updatehealth()
|
||||
|
||||
/mob/living/proc/setOxyLoss(amount, updating_health=1)
|
||||
if(status_flags & GODMODE)
|
||||
return 0
|
||||
oxyloss = amount
|
||||
if(updating_health)
|
||||
updatehealth()
|
||||
|
||||
/mob/living/proc/getToxLoss()
|
||||
return toxloss
|
||||
|
||||
/mob/living/proc/adjustToxLoss(amount, updating_health=1)
|
||||
if(status_flags & GODMODE)
|
||||
return 0
|
||||
toxloss = Clamp((toxloss + (amount * config.damage_multiplier)), 0, maxHealth*2)
|
||||
if(updating_health)
|
||||
updatehealth()
|
||||
return amount
|
||||
|
||||
/mob/living/proc/setToxLoss(amount, updating_health=1)
|
||||
if(status_flags & GODMODE)
|
||||
return 0
|
||||
toxloss = amount
|
||||
if(updating_health)
|
||||
updatehealth()
|
||||
|
||||
/mob/living/proc/getFireLoss()
|
||||
return fireloss
|
||||
|
||||
/mob/living/proc/adjustFireLoss(amount, updating_health=1)
|
||||
if(status_flags & GODMODE)
|
||||
return 0
|
||||
fireloss = Clamp((fireloss + (amount * config.damage_multiplier)), 0, maxHealth*2)
|
||||
if(updating_health)
|
||||
updatehealth()
|
||||
|
||||
/mob/living/proc/getCloneLoss()
|
||||
return cloneloss
|
||||
|
||||
/mob/living/proc/adjustCloneLoss(amount, updating_health=1)
|
||||
if(status_flags & GODMODE)
|
||||
return 0
|
||||
cloneloss = Clamp((cloneloss + (amount * config.damage_multiplier)), 0, maxHealth*2)
|
||||
if(updating_health)
|
||||
updatehealth()
|
||||
|
||||
/mob/living/proc/setCloneLoss(amount, updating_health=1)
|
||||
if(status_flags & GODMODE)
|
||||
return 0
|
||||
cloneloss = amount
|
||||
if(updating_health)
|
||||
updatehealth()
|
||||
|
||||
/mob/living/proc/getBrainLoss()
|
||||
return brainloss
|
||||
|
||||
/mob/living/proc/adjustBrainLoss(amount)
|
||||
if(status_flags & GODMODE)
|
||||
return 0
|
||||
brainloss = Clamp((brainloss + (amount * config.damage_multiplier)), 0, maxHealth*2)
|
||||
|
||||
/mob/living/proc/setBrainLoss(amount)
|
||||
if(status_flags & GODMODE)
|
||||
return 0
|
||||
brainloss = amount
|
||||
|
||||
/mob/living/proc/getStaminaLoss()
|
||||
return staminaloss
|
||||
|
||||
/mob/living/proc/adjustStaminaLoss(amount, updating_stamina = 1)
|
||||
return
|
||||
|
||||
/mob/living/proc/setStaminaLoss(amount, updating_stamina = 1)
|
||||
return
|
||||
|
||||
|
||||
// heal ONE external organ, organ gets randomly selected from damaged ones.
|
||||
/mob/living/proc/heal_bodypart_damage(brute, burn, updating_health = 1)
|
||||
adjustBruteLoss(-brute, 0) //zero as argument for no instant health update
|
||||
adjustFireLoss(-burn, 0)
|
||||
if(updating_health)
|
||||
updatehealth()
|
||||
|
||||
// damage ONE external organ, organ gets randomly selected from damaged ones.
|
||||
/mob/living/proc/take_bodypart_damage(brute, burn, updating_health = 1)
|
||||
adjustBruteLoss(brute, 0) //zero as argument for no instant health update
|
||||
adjustFireLoss(burn, 0)
|
||||
if(updating_health)
|
||||
updatehealth()
|
||||
|
||||
// heal MANY bodyparts, in random order
|
||||
/mob/living/proc/heal_overall_damage(brute, burn, only_robotic = 0, only_organic = 1, updating_health = 1)
|
||||
adjustBruteLoss(-brute, 0) //zero as argument for no instant health update
|
||||
adjustFireLoss(-burn, 0)
|
||||
if(updating_health)
|
||||
updatehealth()
|
||||
|
||||
// damage MANY bodyparts, in random order
|
||||
/mob/living/proc/take_overall_damage(brute, burn, updating_health = 1)
|
||||
adjustBruteLoss(brute, 0) //zero as argument for no instant health update
|
||||
adjustFireLoss(burn, 0)
|
||||
if(updating_health)
|
||||
updatehealth()
|
||||
@@ -1,4 +1,4 @@
|
||||
/mob/living/gib(no_brain, no_organs)
|
||||
/mob/living/gib(no_brain, no_organs, no_bodyparts)
|
||||
var/prev_lying = lying
|
||||
if(stat != DEAD)
|
||||
death(1)
|
||||
@@ -8,20 +8,27 @@
|
||||
|
||||
if(!prev_lying)
|
||||
gib_animation()
|
||||
if(!no_organs)
|
||||
spill_organs(no_brain)
|
||||
spawn_gibs()
|
||||
|
||||
|
||||
spill_organs(no_brain, no_organs, no_bodyparts)
|
||||
|
||||
if(!no_bodyparts)
|
||||
spread_bodyparts(no_brain, no_organs)
|
||||
|
||||
spawn_gibs(no_bodyparts)
|
||||
qdel(src)
|
||||
|
||||
/mob/living/proc/gib_animation()
|
||||
return
|
||||
|
||||
/mob/living/proc/spawn_gibs()
|
||||
gibs(loc, viruses)
|
||||
new /obj/effect/gibspawner/generic(loc, viruses)
|
||||
|
||||
/mob/living/proc/spill_organs(no_brain)
|
||||
/mob/living/proc/spill_organs()
|
||||
return
|
||||
|
||||
/mob/living/proc/spread_bodyparts()
|
||||
return
|
||||
|
||||
/mob/living/dust()
|
||||
death(1)
|
||||
|
||||
@@ -78,6 +78,23 @@
|
||||
/mob/living/proc/handle_environment(datum/gas_mixture/environment)
|
||||
return
|
||||
|
||||
/mob/living/proc/handle_fire()
|
||||
if(fire_stacks < 0) //If we've doused ourselves in water to avoid fire, dry off slowly
|
||||
fire_stacks = min(0, fire_stacks + 1)//So we dry ourselves back to default, nonflammable.
|
||||
if(!on_fire)
|
||||
return 1
|
||||
if(fire_stacks > 0)
|
||||
adjust_fire_stacks(-0.1) //the fire is slowly consumed
|
||||
else
|
||||
ExtinguishMob()
|
||||
return
|
||||
var/datum/gas_mixture/G = loc.return_air() // Check if we're standing in an oxygenless environment
|
||||
if(!G.gases["o2"] || G.gases["o2"][MOLES] < 1)
|
||||
ExtinguishMob() //If there's no oxygen in the tile we're on, put out the fire
|
||||
return
|
||||
var/turf/location = get_turf(src)
|
||||
location.hotspot_expose(700, 50, 1)
|
||||
|
||||
/mob/living/proc/handle_stomach()
|
||||
return
|
||||
|
||||
|
||||
@@ -212,22 +212,13 @@
|
||||
src << "<span class='notice'>You have given up life and succumbed to death.</span>"
|
||||
death()
|
||||
|
||||
/mob/living/incapacitated(ignore_restraints, ignore_grab)
|
||||
if(stat || paralysis || stunned || weakened || (!ignore_restraints && restrained(ignore_grab)))
|
||||
return 1
|
||||
|
||||
/mob/living/proc/InCritical()
|
||||
return (src.health < 0 && src.health > -95 && stat == UNCONSCIOUS)
|
||||
|
||||
/mob/living/ex_act(severity, origin)
|
||||
if(istype(origin, /datum/spacevine_mutation) && isvineimmune(src))
|
||||
return
|
||||
..()
|
||||
flash_eyes()
|
||||
|
||||
/mob/living/proc/updatehealth()
|
||||
if(status_flags & GODMODE)
|
||||
return
|
||||
health = maxHealth - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss() - getCloneLoss()
|
||||
update_stat()
|
||||
med_hud_set_health()
|
||||
|
||||
//This proc is used for mobs which are affected by pressure to calculate the amount of pressure that actually
|
||||
//affects them once clothing is factored in. ~Errorage
|
||||
/mob/living/proc/calculate_affecting_pressure(pressure)
|
||||
@@ -255,120 +246,6 @@
|
||||
return temperature
|
||||
|
||||
|
||||
// MOB PROCS
|
||||
/mob/living/proc/getBruteLoss()
|
||||
return bruteloss
|
||||
|
||||
/mob/living/proc/adjustBruteLoss(amount, updating_health=1)
|
||||
if(status_flags & GODMODE)
|
||||
return 0
|
||||
bruteloss = Clamp((bruteloss + (amount * config.damage_multiplier)), 0, maxHealth*2)
|
||||
if(updating_health)
|
||||
updatehealth()
|
||||
|
||||
/mob/living/proc/getOxyLoss()
|
||||
return oxyloss
|
||||
|
||||
/mob/living/proc/adjustOxyLoss(amount, updating_health=1)
|
||||
if(status_flags & GODMODE)
|
||||
return 0
|
||||
oxyloss = Clamp((oxyloss + (amount * config.damage_multiplier)), 0, maxHealth*2)
|
||||
if(updating_health)
|
||||
updatehealth()
|
||||
|
||||
/mob/living/proc/setOxyLoss(amount, updating_health=1)
|
||||
if(status_flags & GODMODE)
|
||||
return 0
|
||||
oxyloss = amount
|
||||
if(updating_health)
|
||||
updatehealth()
|
||||
|
||||
/mob/living/proc/getToxLoss()
|
||||
return toxloss
|
||||
|
||||
/mob/living/proc/adjustToxLoss(amount, updating_health=1)
|
||||
if(status_flags & GODMODE)
|
||||
return 0
|
||||
toxloss = Clamp((toxloss + (amount * config.damage_multiplier)), 0, maxHealth*2)
|
||||
if(updating_health)
|
||||
updatehealth()
|
||||
return amount
|
||||
|
||||
/mob/living/proc/setToxLoss(amount, updating_health=1)
|
||||
if(status_flags & GODMODE)
|
||||
return 0
|
||||
toxloss = amount
|
||||
if(updating_health)
|
||||
updatehealth()
|
||||
|
||||
/mob/living/proc/getFireLoss()
|
||||
return fireloss
|
||||
|
||||
/mob/living/proc/adjustFireLoss(amount, updating_health=1)
|
||||
if(status_flags & GODMODE)
|
||||
return 0
|
||||
fireloss = Clamp((fireloss + (amount * config.damage_multiplier)), 0, maxHealth*2)
|
||||
if(updating_health)
|
||||
updatehealth()
|
||||
|
||||
/mob/living/proc/getCloneLoss()
|
||||
return cloneloss
|
||||
|
||||
/mob/living/proc/adjustCloneLoss(amount, updating_health=1)
|
||||
if(status_flags & GODMODE)
|
||||
return 0
|
||||
cloneloss = Clamp((cloneloss + (amount * config.damage_multiplier)), 0, maxHealth*2)
|
||||
if(updating_health)
|
||||
updatehealth()
|
||||
|
||||
/mob/living/proc/setCloneLoss(amount, updating_health=1)
|
||||
if(status_flags & GODMODE)
|
||||
return 0
|
||||
cloneloss = amount
|
||||
if(updating_health)
|
||||
updatehealth()
|
||||
|
||||
/mob/living/proc/getBrainLoss()
|
||||
return brainloss
|
||||
|
||||
/mob/living/proc/adjustBrainLoss(amount)
|
||||
if(status_flags & GODMODE)
|
||||
return 0
|
||||
brainloss = Clamp((brainloss + (amount * config.damage_multiplier)), 0, maxHealth*2)
|
||||
|
||||
/mob/living/proc/setBrainLoss(amount)
|
||||
if(status_flags & GODMODE)
|
||||
return 0
|
||||
brainloss = amount
|
||||
|
||||
/mob/living/proc/getStaminaLoss()
|
||||
return staminaloss
|
||||
|
||||
/mob/living/proc/adjustStaminaLoss(amount, updating_stamina = 1)
|
||||
return
|
||||
|
||||
/mob/living/carbon/adjustStaminaLoss(amount, updating_stamina = 1)
|
||||
if(status_flags & GODMODE)
|
||||
return 0
|
||||
staminaloss = Clamp(staminaloss + amount, 0, maxHealth*2)
|
||||
if(updating_stamina)
|
||||
update_stamina()
|
||||
|
||||
/mob/living/carbon/alien/adjustStaminaLoss(amount, updating_stamina = 1)
|
||||
return
|
||||
|
||||
/mob/living/proc/setStaminaLoss(amount, updating_stamina = 1)
|
||||
return
|
||||
|
||||
/mob/living/carbon/setStaminaLoss(amount, updating_stamina = 1)
|
||||
if(status_flags & GODMODE)
|
||||
return 0
|
||||
staminaloss = amount
|
||||
if(updating_stamina)
|
||||
update_stamina()
|
||||
|
||||
/mob/living/carbon/alien/setStaminaLoss(amount, updating_stamina = 1)
|
||||
return
|
||||
|
||||
/mob/living/proc/getMaxHealth()
|
||||
return maxHealth
|
||||
@@ -425,23 +302,6 @@
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
/mob/living/proc/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, safety = 0, tesla_shock = 0)
|
||||
if(shock_damage > 0)
|
||||
adjustFireLoss(shock_damage)
|
||||
visible_message(
|
||||
"<span class='danger'>[src] was shocked by \the [source]!</span>", \
|
||||
"<span class='userdanger'>You feel a powerful shock coursing through your body!</span>", \
|
||||
"<span class='italics'>You hear a heavy electrical crack.</span>" \
|
||||
)
|
||||
return shock_damage
|
||||
|
||||
/mob/living/emp_act(severity)
|
||||
var/list/L = src.get_contents()
|
||||
for(var/obj/O in L)
|
||||
O.emp_act(severity)
|
||||
..()
|
||||
|
||||
/mob/living/proc/can_inject()
|
||||
return 1
|
||||
|
||||
@@ -453,33 +313,14 @@
|
||||
var/def_zone = ran_zone(t)
|
||||
return def_zone
|
||||
|
||||
// heal ONE external organ, organ gets randomly selected from damaged ones.
|
||||
/mob/living/proc/heal_organ_damage(brute, burn, updating_health=1)
|
||||
adjustBruteLoss(-brute, updating_health)
|
||||
adjustFireLoss(-burn, updating_health)
|
||||
if(updating_health)
|
||||
updatehealth()
|
||||
|
||||
// damage ONE external organ, organ gets randomly selected from damaged ones.
|
||||
/mob/living/proc/take_organ_damage(brute, burn, updating_health=1)
|
||||
adjustBruteLoss(brute)
|
||||
adjustFireLoss(burn)
|
||||
if(updating_health)
|
||||
updatehealth()
|
||||
|
||||
// heal MANY bodyparts, in random order
|
||||
/mob/living/proc/heal_overall_damage(brute, burn, updating_health=1)
|
||||
adjustBruteLoss(-brute, updating_health)
|
||||
adjustFireLoss(-burn, updating_health)
|
||||
if(updating_health)
|
||||
updatehealth()
|
||||
|
||||
// damage MANY bodyparts, in random order
|
||||
/mob/living/proc/take_overall_damage(brute, burn, updating_health=1)
|
||||
adjustBruteLoss(brute, updating_health)
|
||||
adjustFireLoss(burn, updating_health)
|
||||
if(updating_health)
|
||||
updatehealth()
|
||||
/mob/living/proc/updatehealth()
|
||||
if(status_flags & GODMODE)
|
||||
return
|
||||
health = maxHealth - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss() - getCloneLoss()
|
||||
update_stat()
|
||||
med_hud_set_health()
|
||||
med_hud_set_status()
|
||||
|
||||
//proc used to ressuscitate a mob
|
||||
/mob/living/proc/revive(full_heal = 0, admin_revive = 0)
|
||||
@@ -500,7 +341,7 @@
|
||||
//proc used to completely heal a mob.
|
||||
/mob/living/proc/fully_heal(admin_revive = 0)
|
||||
restore_blood()
|
||||
setToxLoss(0, 0)
|
||||
setToxLoss(0, 0) //zero as second argument not automatically call updatehealth().
|
||||
setOxyLoss(0, 0)
|
||||
setCloneLoss(0, 0)
|
||||
setBrainLoss(0)
|
||||
@@ -517,14 +358,14 @@
|
||||
set_eye_damage(0)
|
||||
cure_nearsighted()
|
||||
cure_blind()
|
||||
cure_husk()
|
||||
disabilities = 0
|
||||
ear_deaf = 0
|
||||
ear_damage = 0
|
||||
hallucination = 0
|
||||
heal_overall_damage(100000, 100000)
|
||||
heal_overall_damage(100000, 100000, 0, 0, 1) //heal brute and burn dmg on both organic and robotic limbs, and update health right away.
|
||||
ExtinguishMob()
|
||||
fire_stacks = 0
|
||||
updatehealth()
|
||||
update_canmove()
|
||||
|
||||
|
||||
@@ -758,21 +599,6 @@
|
||||
animate(src, pixel_y = get_standard_pixel_y_offset(lying), time = 10)
|
||||
floating = 0
|
||||
|
||||
//called when the mob receives a bright flash
|
||||
/mob/living/proc/flash_eyes(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, type = /obj/screen/fullscreen/flash)
|
||||
if(check_eye_prot() < intensity && (override_blindness_check || !(disabilities & BLIND)))
|
||||
overlay_fullscreen("flash", type)
|
||||
addtimer(src, "clear_fullscreen", 25, FALSE, "flash", 25)
|
||||
return 1
|
||||
|
||||
//this returns the mob's protection against eye damage (number between -1 and 2)
|
||||
/mob/living/proc/check_eye_prot()
|
||||
return 0
|
||||
|
||||
//this returns the mob's protection against ear damage (0 or 1)
|
||||
/mob/living/proc/check_ear_prot()
|
||||
return 0
|
||||
|
||||
// The src mob is trying to strip an item from someone
|
||||
// Override if a certain type of mob should be behave differently when stripping items (can't, for example)
|
||||
/mob/living/stripPanelUnequip(obj/item/what, mob/who, where)
|
||||
@@ -821,11 +647,6 @@
|
||||
who.equip_to_slot_if_possible(what, where, 0, 1)
|
||||
add_logs(src, who, "equipped", what)
|
||||
|
||||
/mob/living/singularity_act()
|
||||
var/gain = 20
|
||||
investigate_log("([key_name(src)]) has been consumed by the singularity.","singulo") //Oh that's where the clown ended up!
|
||||
gib()
|
||||
return(gain)
|
||||
|
||||
/mob/living/singularity_pull(S, current_size)
|
||||
if(current_size >= STAGE_SIX)
|
||||
@@ -833,29 +654,6 @@
|
||||
else
|
||||
step_towards(src,S)
|
||||
|
||||
/mob/living/narsie_act()
|
||||
if(is_servant_of_ratvar(src) && !stat)
|
||||
src << "<span class='userdanger'>You resist Nar-Sie's influence... but not all of it. <i>Run!</i></span>"
|
||||
adjustBruteLoss(35)
|
||||
if(src && reagents)
|
||||
reagents.add_reagent("heparin", 5)
|
||||
return 0
|
||||
if(client)
|
||||
makeNewConstruct(/mob/living/simple_animal/hostile/construct/harvester, src, null, 0)
|
||||
else
|
||||
new /mob/living/simple_animal/hostile/construct/harvester/hostile(get_turf(src))
|
||||
spawn_dust()
|
||||
gib()
|
||||
return
|
||||
|
||||
/mob/living/ratvar_act()
|
||||
if(!add_servant_of_ratvar(src) && !is_servant_of_ratvar(src))
|
||||
src << "<span class='userdanger'>A blinding light boils you alive! <i>Run!</i></span>"
|
||||
adjustFireLoss(35)
|
||||
if(src)
|
||||
adjust_fire_stacks(1)
|
||||
IgniteMob()
|
||||
|
||||
/atom/movable/proc/do_attack_animation(atom/A, end_pixel_y)
|
||||
var/pixel_x_diff = 0
|
||||
var/pixel_y_diff = 0
|
||||
@@ -1016,7 +814,7 @@
|
||||
new path(src.loc)
|
||||
butcher_results.Remove(path) //In case you want to have things like simple_animals drop their butcher results on gib, so it won't double up below.
|
||||
visible_message("<span class='notice'>[user] butchers [src].</span>")
|
||||
gib()
|
||||
gib(0, 0, 1)
|
||||
|
||||
/mob/living/canUseTopic(atom/movable/M, be_close = 0, no_dextery = 0)
|
||||
if(incapacitated())
|
||||
@@ -1104,3 +902,50 @@
|
||||
|
||||
/mob/living/proc/fakefire()
|
||||
return
|
||||
|
||||
|
||||
|
||||
//Mobs on Fire
|
||||
/mob/living/proc/IgniteMob()
|
||||
if(fire_stacks > 0 && !on_fire)
|
||||
on_fire = 1
|
||||
src.visible_message("<span class='warning'>[src] catches fire!</span>", \
|
||||
"<span class='userdanger'>You're set on fire!</span>")
|
||||
src.AddLuminosity(3)
|
||||
throw_alert("fire", /obj/screen/alert/fire)
|
||||
update_fire()
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/mob/living/proc/ExtinguishMob()
|
||||
if(on_fire)
|
||||
on_fire = 0
|
||||
fire_stacks = 0
|
||||
src.AddLuminosity(-3)
|
||||
clear_alert("fire")
|
||||
update_fire()
|
||||
|
||||
/mob/living/proc/adjust_fire_stacks(add_fire_stacks) //Adjusting the amount of fire_stacks we have on person
|
||||
fire_stacks = Clamp(fire_stacks + add_fire_stacks, -20, 20)
|
||||
if(on_fire && fire_stacks <= 0)
|
||||
ExtinguishMob()
|
||||
|
||||
//Share fire evenly between the two mobs
|
||||
//Called in MobBump() and Crossed()
|
||||
/mob/living/proc/spreadFire(mob/living/L)
|
||||
if(!istype(L))
|
||||
return
|
||||
var/L_old_on_fire = L.on_fire
|
||||
|
||||
if(on_fire) //Only spread fire stacks if we're on fire
|
||||
fire_stacks /= 2
|
||||
L.fire_stacks += fire_stacks
|
||||
if(L.IgniteMob())
|
||||
log_game("[key_name(src)] bumped into [key_name(L)] and set them on fire")
|
||||
|
||||
if(L_old_on_fire) //Only ignite us and gain their stacks if they were onfire before we bumped them
|
||||
L.fire_stacks /= 2
|
||||
fire_stacks += L.fire_stacks
|
||||
IgniteMob()
|
||||
|
||||
//Mobs on Fire end
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
/mob/living/proc/run_armor_check(def_zone = null, attack_flag = "melee", absorb_text = null, soften_text = null, armour_penetration, penetrated_text)
|
||||
var/armor = getarmor(def_zone, attack_flag)
|
||||
|
||||
@@ -24,6 +25,14 @@
|
||||
/mob/living/proc/getarmor(def_zone, type)
|
||||
return 0
|
||||
|
||||
//this returns the mob's protection against eye damage (number between -1 and 2)
|
||||
/mob/living/proc/get_eye_protection()
|
||||
return 0
|
||||
|
||||
//this returns the mob's protection against ear damage (0:no protection; 1: some ear protection; 2: has no ears)
|
||||
/mob/living/proc/get_ear_protection()
|
||||
return 0
|
||||
|
||||
/mob/living/proc/on_hit(obj/item/projectile/proj_type)
|
||||
return
|
||||
|
||||
@@ -33,18 +42,16 @@
|
||||
apply_damage(P.damage, P.damage_type, def_zone, armor)
|
||||
if(P.dismemberment)
|
||||
check_projectile_dismemberment(P, def_zone)
|
||||
return P.on_hit(src, armor, def_zone)
|
||||
return P.on_hit(src, armor)
|
||||
|
||||
/mob/living/proc/check_projectile_dismemberment(obj/item/projectile/P, def_zone)
|
||||
return 0
|
||||
|
||||
/proc/vol_by_throwforce_and_or_w_class(obj/item/I)
|
||||
if(!I)
|
||||
return 0
|
||||
if(I.throwforce && I.w_class)
|
||||
return Clamp((I.throwforce + I.w_class) * 5, 30, 100)// Add the item's throwforce to its weight class and multiply by 5, then clamp the value between 30 and 100
|
||||
else if(I.w_class)
|
||||
return Clamp(I.w_class * 8, 20, 100) // Multiply the item's weight class by 8, then clamp the value between 20 and 100
|
||||
/obj/item/proc/get_volume_by_throwforce_and_or_w_class()
|
||||
if(throwforce && w_class)
|
||||
return Clamp((throwforce + w_class) * 5, 30, 100)// Add the item's throwforce to its weight class and multiply by 5, then clamp the value between 30 and 100
|
||||
else if(w_class)
|
||||
return Clamp(w_class * 8, 20, 100) // Multiply the item's weight class by 8, then clamp the value between 20 and 100
|
||||
else
|
||||
return 0
|
||||
|
||||
@@ -53,7 +60,7 @@
|
||||
var/obj/item/I = AM
|
||||
var/zone = ran_zone("chest", 65)//Hits a random part of the body, geared towards the chest
|
||||
var/dtype = BRUTE
|
||||
var/volume = vol_by_throwforce_and_or_w_class(I)
|
||||
var/volume = I.get_volume_by_throwforce_and_or_w_class()
|
||||
if(istype(I,/obj/item/weapon)) //If the item is a weapon...
|
||||
var/obj/item/weapon/W = I
|
||||
dtype = W.damtype
|
||||
@@ -83,6 +90,7 @@
|
||||
playsound(loc, 'sound/weapons/genhit.ogg', 50, 1, -1)
|
||||
..()
|
||||
|
||||
|
||||
/mob/living/mech_melee_attack(obj/mecha/M)
|
||||
if(M.occupant.a_intent == "harm")
|
||||
M.do_attack_animation(src)
|
||||
@@ -109,80 +117,10 @@
|
||||
add_logs(M.occupant, src, "pushed", M)
|
||||
visible_message("<span class='warning'>[M] pushes [src] out of the way.</span>")
|
||||
|
||||
|
||||
//Mobs on Fire
|
||||
/mob/living/proc/IgniteMob()
|
||||
if(fire_stacks > 0 && !on_fire)
|
||||
on_fire = 1
|
||||
src.visible_message("<span class='warning'>[src] catches fire!</span>", \
|
||||
"<span class='userdanger'>You're set on fire!</span>")
|
||||
src.AddLuminosity(3)
|
||||
throw_alert("fire", /obj/screen/alert/fire)
|
||||
update_fire()
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/mob/living/proc/ExtinguishMob()
|
||||
if(on_fire)
|
||||
on_fire = 0
|
||||
fire_stacks = 0
|
||||
src.AddLuminosity(-3)
|
||||
clear_alert("fire")
|
||||
update_fire()
|
||||
|
||||
/mob/living/proc/update_fire()
|
||||
return
|
||||
|
||||
/mob/living/proc/adjust_fire_stacks(add_fire_stacks) //Adjusting the amount of fire_stacks we have on person
|
||||
fire_stacks = Clamp(fire_stacks + add_fire_stacks, -20, 20)
|
||||
if(on_fire && fire_stacks <= 0)
|
||||
ExtinguishMob()
|
||||
|
||||
/mob/living/proc/handle_fire()
|
||||
if(fire_stacks < 0) //If we've doused ourselves in water to avoid fire, dry off slowly
|
||||
fire_stacks = min(0, fire_stacks + 1)//So we dry ourselves back to default, nonflammable.
|
||||
if(!on_fire)
|
||||
return 1
|
||||
if(fire_stacks > 0)
|
||||
adjust_fire_stacks(-0.1) //the fire is slowly consumed
|
||||
else
|
||||
ExtinguishMob()
|
||||
return
|
||||
var/datum/gas_mixture/G = loc.return_air() // Check if we're standing in an oxygenless environment
|
||||
if(!G.gases["o2"] || G.gases["o2"][MOLES] < 1)
|
||||
ExtinguishMob() //If there's no oxygen in the tile we're on, put out the fire
|
||||
return
|
||||
var/turf/location = get_turf(src)
|
||||
location.hotspot_expose(700, 50, 1)
|
||||
|
||||
/mob/living/fire_act()
|
||||
adjust_fire_stacks(3)
|
||||
IgniteMob()
|
||||
|
||||
|
||||
//Share fire evenly between the two mobs
|
||||
//Called in MobBump() and Crossed()
|
||||
/mob/living/proc/spreadFire(mob/living/L)
|
||||
if(!istype(L))
|
||||
return
|
||||
var/L_old_on_fire = L.on_fire
|
||||
|
||||
if(on_fire) //Only spread fire stacks if we're on fire
|
||||
fire_stacks /= 2
|
||||
L.fire_stacks += fire_stacks
|
||||
if(L.IgniteMob())
|
||||
log_game("[key_name(src)] bumped into [key_name(L)] and set them on fire")
|
||||
|
||||
if(L_old_on_fire) //Only ignite us and gain their stacks if they were onfire before we bumped them
|
||||
L.fire_stacks /= 2
|
||||
fire_stacks += L.fire_stacks
|
||||
IgniteMob()
|
||||
|
||||
//Mobs on Fire end
|
||||
|
||||
/mob/living/acid_act(acidpwr, toxpwr, acid_volume)
|
||||
take_organ_damage(min(10*toxpwr, acid_volume * toxpwr))
|
||||
|
||||
/mob/living/proc/grabbedby(mob/living/carbon/user, supress_message = 0)
|
||||
if(user == src || anchored)
|
||||
return 0
|
||||
@@ -291,7 +229,6 @@
|
||||
return 0
|
||||
|
||||
/mob/living/attack_larva(mob/living/carbon/alien/larva/L)
|
||||
|
||||
switch(L.a_intent)
|
||||
if("help")
|
||||
visible_message("<span class='notice'>[L.name] rubs its head against [src].</span>")
|
||||
@@ -331,60 +268,71 @@
|
||||
M.do_attack_animation(src)
|
||||
return 1
|
||||
|
||||
/mob/living/incapacitated(ignore_restraints, ignore_grab)
|
||||
if(stat || paralysis || stunned || weakened || (!ignore_restraints && restrained(ignore_grab)))
|
||||
return 1
|
||||
/mob/living/ex_act(severity, origin)
|
||||
if(istype(origin, /datum/spacevine_mutation) && isvineimmune(src))
|
||||
return
|
||||
..()
|
||||
flash_act()
|
||||
|
||||
//Looking for irradiate()? It's been moved to radiation.dm under the rad_act() for mobs.
|
||||
|
||||
/mob/living/proc/add_stun_absorption(key, duration, priority, message, self_message, examine_message)
|
||||
//adds a stun absorption with a key, a duration in deciseconds, its priority, and the messages it makes when you're stunned/examined, if any
|
||||
if(!islist(stun_absorption))
|
||||
stun_absorption = list()
|
||||
if(stun_absorption[key])
|
||||
stun_absorption[key]["end_time"] = world.time + duration
|
||||
stun_absorption[key]["priority"] = priority
|
||||
stun_absorption[key]["stuns_absorbed"] = 0
|
||||
/mob/living/acid_act(acidpwr, toxpwr, acid_volume)
|
||||
take_bodypart_damage(min(10*toxpwr, acid_volume * toxpwr))
|
||||
|
||||
|
||||
/mob/living/proc/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, safety = 0, tesla_shock = 0)
|
||||
if(shock_damage > 0)
|
||||
adjustFireLoss(shock_damage)
|
||||
visible_message(
|
||||
"<span class='danger'>[src] was shocked by \the [source]!</span>", \
|
||||
"<span class='userdanger'>You feel a powerful shock coursing through your body!</span>", \
|
||||
"<span class='italics'>You hear a heavy electrical crack.</span>" \
|
||||
)
|
||||
return shock_damage
|
||||
|
||||
/mob/living/emp_act(severity)
|
||||
var/list/L = src.get_contents()
|
||||
for(var/obj/O in L)
|
||||
O.emp_act(severity)
|
||||
..()
|
||||
|
||||
/mob/living/singularity_act()
|
||||
var/gain = 20
|
||||
investigate_log("([key_name(src)]) has been consumed by the singularity.","singulo") //Oh that's where the clown ended up!
|
||||
gib()
|
||||
return(gain)
|
||||
|
||||
/mob/living/narsie_act()
|
||||
if(is_servant_of_ratvar(src) && !stat)
|
||||
src << "<span class='userdanger'>You resist Nar-Sie's influence... but not all of it. <i>Run!</i></span>"
|
||||
adjustBruteLoss(35)
|
||||
if(src && reagents)
|
||||
reagents.add_reagent("heparin", 5)
|
||||
return 0
|
||||
if(client)
|
||||
makeNewConstruct(/mob/living/simple_animal/hostile/construct/harvester, src, null, 0)
|
||||
else
|
||||
stun_absorption[key] = list("end_time" = world.time + duration, "priority" = priority, "stuns_absorbed" = 0, \
|
||||
"visible_message" = message, "self_message" = self_message, "examine_message" = examine_message)
|
||||
new /mob/living/simple_animal/hostile/construct/harvester/hostile(get_turf(src))
|
||||
spawn_dust()
|
||||
gib()
|
||||
|
||||
/mob/living/Stun(amount, updating = 1, ignore_canstun = 0)
|
||||
if(!stat && islist(stun_absorption))
|
||||
var/priority_absorb_key
|
||||
var/highest_priority
|
||||
for(var/i in stun_absorption)
|
||||
if(stun_absorption[i]["end_time"] > world.time && (!priority_absorb_key || stun_absorption[i]["priority"] > highest_priority))
|
||||
priority_absorb_key = stun_absorption[i]
|
||||
highest_priority = stun_absorption[i]["priority"]
|
||||
if(priority_absorb_key)
|
||||
if(priority_absorb_key["visible_message"] || priority_absorb_key["self_message"])
|
||||
if(priority_absorb_key["visible_message"] && priority_absorb_key["self_message"])
|
||||
visible_message("<span class='warning'>[src][priority_absorb_key["visible_message"]]</span>", "<span class='boldwarning'>[priority_absorb_key["self_message"]]</span>")
|
||||
else if(priority_absorb_key["visible_message"])
|
||||
visible_message("<span class='warning'>[src][priority_absorb_key["visible_message"]]</span>")
|
||||
else if(priority_absorb_key["self_message"])
|
||||
src << "<span class='boldwarning'>[priority_absorb_key["self_message"]]</span>"
|
||||
priority_absorb_key["stuns_absorbed"] += amount
|
||||
return 0
|
||||
..()
|
||||
|
||||
/mob/living/Weaken(amount, updating = 1, ignore_canweaken = 0)
|
||||
if(!stat && islist(stun_absorption))
|
||||
var/priority_absorb_key
|
||||
var/highest_priority
|
||||
for(var/i in stun_absorption)
|
||||
if(stun_absorption[i]["end_time"] > world.time && (!priority_absorb_key || stun_absorption[i]["priority"] > highest_priority))
|
||||
priority_absorb_key = stun_absorption[i]
|
||||
highest_priority = priority_absorb_key["priority"]
|
||||
if(priority_absorb_key)
|
||||
if(priority_absorb_key["visible_message"] || priority_absorb_key["self_message"])
|
||||
if(priority_absorb_key["visible_message"] && priority_absorb_key["self_message"])
|
||||
visible_message("<span class='warning'>[src][priority_absorb_key["visible_message"]]</span>", "<span class='boldwarning'>[priority_absorb_key["self_message"]]</span>")
|
||||
else if(priority_absorb_key["visible_message"])
|
||||
visible_message("<span class='warning'>[src][priority_absorb_key["visible_message"]]</span>")
|
||||
else if(priority_absorb_key["self_message"])
|
||||
src << "<span class='boldwarning'>[priority_absorb_key["self_message"]]</span>"
|
||||
priority_absorb_key["stuns_absorbed"] += amount
|
||||
return 0
|
||||
..()
|
||||
/mob/living/ratvar_act()
|
||||
if(!add_servant_of_ratvar(src) && !is_servant_of_ratvar(src))
|
||||
src << "<span class='userdanger'>A blinding light boils you alive! <i>Run!</i></span>"
|
||||
adjustFireLoss(35)
|
||||
if(src)
|
||||
adjust_fire_stacks(1)
|
||||
IgniteMob()
|
||||
|
||||
|
||||
//called when the mob receives a bright flash
|
||||
/mob/living/proc/flash_act(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, type = /obj/screen/fullscreen/flash)
|
||||
if(get_eye_protection() < intensity && (override_blindness_check || !(disabilities & BLIND)))
|
||||
overlay_fullscreen("flash", type)
|
||||
addtimer(src, "clear_fullscreen", 25, FALSE, "flash", 25)
|
||||
return 1
|
||||
|
||||
//called when the mob receives a loud bang
|
||||
/mob/living/proc/soundbang_act()
|
||||
return 0
|
||||
|
||||
@@ -351,39 +351,9 @@ var/list/ai_list = list()
|
||||
SSshuttle.cancelEvac(src)
|
||||
return
|
||||
|
||||
/mob/living/silicon/ai/blob_act(obj/effect/blob/B)
|
||||
if (stat != DEAD)
|
||||
adjustBruteLoss(60)
|
||||
updatehealth()
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/mob/living/silicon/ai/restrained(ignore_grab)
|
||||
. = 0
|
||||
|
||||
/mob/living/silicon/ai/emp_act(severity)
|
||||
if (prob(30))
|
||||
switch(pick(1,2))
|
||||
if(1)
|
||||
view_core()
|
||||
if(2)
|
||||
SSshuttle.requestEvac(src,"ALERT: Energy surge detected in AI core! Station integrity may be compromised! Initiati--%m091#ar-BZZT")
|
||||
..()
|
||||
|
||||
/mob/living/silicon/ai/ex_act(severity, target)
|
||||
..()
|
||||
|
||||
switch(severity)
|
||||
if(1)
|
||||
gib()
|
||||
if(2)
|
||||
if (stat != DEAD)
|
||||
adjustBruteLoss(60)
|
||||
adjustFireLoss(60)
|
||||
if(3)
|
||||
if (stat != DEAD)
|
||||
adjustBruteLoss(30)
|
||||
|
||||
/mob/living/silicon/ai/Topic(href, href_list)
|
||||
if(usr != src)
|
||||
return
|
||||
@@ -455,18 +425,6 @@ var/list/ai_list = list()
|
||||
if(M)
|
||||
M.transfer_ai(AI_MECH_HACK,src, usr) //Called om the mech itself.
|
||||
|
||||
/mob/living/silicon/ai/bullet_act(obj/item/projectile/Proj)
|
||||
..(Proj)
|
||||
updatehealth()
|
||||
return 2
|
||||
|
||||
|
||||
/mob/living/silicon/ai/attack_alien(mob/living/carbon/alien/humanoid/M)
|
||||
if(!ticker || !ticker.mode)
|
||||
M << "You cannot attack people before the game has started."
|
||||
return
|
||||
|
||||
..()
|
||||
|
||||
/mob/living/silicon/ai/proc/switchCamera(obj/machinery/camera/C)
|
||||
|
||||
@@ -790,9 +748,6 @@ var/list/ai_list = list()
|
||||
return //won't work if dead
|
||||
set_autosay()
|
||||
|
||||
/mob/living/silicon/ai/attack_slime(mob/living/simple_animal/slime/user)
|
||||
return
|
||||
|
||||
/mob/living/silicon/ai/transfer_ai(interaction, mob/user, mob/living/silicon/ai/AI, obj/item/device/aicard/card)
|
||||
if(!..())
|
||||
return
|
||||
@@ -809,14 +764,6 @@ var/list/ai_list = list()
|
||||
src << "You have been downloaded to a mobile storage device. Remote device connection severed."
|
||||
user << "<span class='boldnotice'>Transfer successful</span>: [name] ([rand(1000,9999)].exe) removed from host terminal and stored within local memory."
|
||||
|
||||
/mob/living/silicon/ai/flash_eyes(intensity = 1, override_blindness_check = 0, affect_silicon = 0)
|
||||
return // no eyes, no flashing
|
||||
|
||||
/mob/living/silicon/ai/attackby(obj/item/weapon/W, mob/user, params)
|
||||
if(W.force && W.damtype != STAMINA && src.stat != DEAD) //only sparks if real damage is dealt.
|
||||
spark_system.start()
|
||||
return ..()
|
||||
|
||||
/mob/living/silicon/ai/can_buckle()
|
||||
return 0
|
||||
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
|
||||
/mob/living/silicon/ai/attacked_by(obj/item/I, mob/living/user, def_zone)
|
||||
if(I.force && I.damtype != STAMINA && stat != DEAD) //only sparks if real damage is dealt.
|
||||
spark_system.start()
|
||||
return ..()
|
||||
|
||||
|
||||
/mob/living/silicon/ai/attack_alien(mob/living/carbon/alien/humanoid/M)
|
||||
if(!ticker || !ticker.mode)
|
||||
M << "You cannot attack people before the game has started."
|
||||
return
|
||||
..()
|
||||
|
||||
/mob/living/silicon/ai/attack_slime(mob/living/simple_animal/slime/user)
|
||||
return //immune to slimes
|
||||
|
||||
/mob/living/silicon/ai/blob_act(obj/effect/blob/B)
|
||||
if (stat != DEAD)
|
||||
adjustBruteLoss(60)
|
||||
updatehealth()
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/mob/living/silicon/ai/emp_act(severity)
|
||||
if (prob(30))
|
||||
switch(pick(1,2))
|
||||
if(1)
|
||||
view_core()
|
||||
if(2)
|
||||
SSshuttle.requestEvac(src,"ALERT: Energy surge detected in AI core! Station integrity may be compromised! Initiati--%m091#ar-BZZT")
|
||||
..()
|
||||
|
||||
/mob/living/silicon/ai/ex_act(severity, target)
|
||||
..()
|
||||
|
||||
switch(severity)
|
||||
if(1)
|
||||
gib()
|
||||
if(2)
|
||||
if (stat != DEAD)
|
||||
adjustBruteLoss(60)
|
||||
adjustFireLoss(60)
|
||||
if(3)
|
||||
if (stat != DEAD)
|
||||
adjustBruteLoss(30)
|
||||
|
||||
|
||||
|
||||
/mob/living/silicon/ai/bullet_act(obj/item/projectile/Proj)
|
||||
..(Proj)
|
||||
updatehealth()
|
||||
return 2
|
||||
|
||||
/mob/living/silicon/ai/flash_act(intensity = 1, override_blindness_check = 0, affect_silicon = 0)
|
||||
return // no eyes, no flashing
|
||||
@@ -0,0 +1,36 @@
|
||||
|
||||
/mob/living/silicon/apply_damage(damage = 0,damagetype = BRUTE, def_zone = null, blocked = 0)
|
||||
var/hit_percent = (100-blocked)/100
|
||||
if(!damage || (hit_percent <= 0))
|
||||
return 0
|
||||
switch(damagetype)
|
||||
if(BRUTE)
|
||||
adjustBruteLoss(damage * hit_percent)
|
||||
if(BURN)
|
||||
adjustFireLoss(damage * hit_percent)
|
||||
return 1
|
||||
|
||||
|
||||
/mob/living/silicon/apply_effect(effect = 0,effecttype = STUN, blocked = 0)
|
||||
return 0//The only effect that can hit them atm is flashes and they still directly edit so this works for now
|
||||
|
||||
|
||||
|
||||
/mob/living/silicon/adjustToxLoss(amount, updating_health=1) //immune to tox damage
|
||||
return 0
|
||||
|
||||
/mob/living/silicon/setToxLoss(amount, updating_health=1)
|
||||
return 0
|
||||
|
||||
/mob/living/silicon/adjustCloneLoss(amount) //immune to clone damage
|
||||
return 0
|
||||
|
||||
/mob/living/silicon/setCloneLoss(amount, updating_health=1)
|
||||
return 0
|
||||
|
||||
/mob/living/silicon/adjustStaminaLoss(amount, updating_stamina = 1)//immune to stamina damage.
|
||||
return
|
||||
|
||||
/mob/living/silicon/setStaminaLoss(amount, updating_stamina = 1)
|
||||
return
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/mob/living/silicon/spawn_gibs()
|
||||
robogibs(loc, viruses)
|
||||
new /obj/effect/gibspawner/robot(loc,viruses)
|
||||
|
||||
/mob/living/silicon/spawn_dust()
|
||||
new /obj/effect/decal/remains/robot(loc)
|
||||
|
||||
@@ -94,66 +94,11 @@
|
||||
else
|
||||
stat(null, text("Systems nonfunctional"))
|
||||
|
||||
/mob/living/silicon/pai/blob_act(obj/effect/blob/B)
|
||||
return 0
|
||||
|
||||
/mob/living/silicon/pai/restrained(ignore_grab)
|
||||
. = 0
|
||||
|
||||
/mob/living/silicon/pai/emp_act(severity)
|
||||
// 20% chance to kill
|
||||
// Silence for 2 minutes
|
||||
// 33% chance to unbind
|
||||
// 33% chance to change prime directive (based on severity)
|
||||
// 33% chance of no additional effect
|
||||
|
||||
if(prob(20))
|
||||
visible_message("<span class='warning'>A shower of sparks spray from [src]'s inner workings.</span>", 3, "<span class='italics'>You hear and smell the ozone hiss of electrical sparks being expelled violently.</span>", 2)
|
||||
return src.death(0)
|
||||
|
||||
silence_time = world.timeofday + 120 * 10 // Silence for 2 minutes
|
||||
src << "<span class ='warning'>Communication circuit overload. Shutting down and reloading communication circuits - speech and messaging functionality will be unavailable until the reboot is complete.</span>"
|
||||
|
||||
switch(pick(1,2,3))
|
||||
if(1)
|
||||
src.master = null
|
||||
src.master_dna = null
|
||||
src << "<span class='notice'>You feel unbound.</span>"
|
||||
if(2)
|
||||
var/command
|
||||
if(severity == 1)
|
||||
command = pick("Serve", "Love", "Fool", "Entice", "Observe", "Judge", "Respect", "Educate", "Amuse", "Entertain", "Glorify", "Memorialize", "Analyze")
|
||||
else
|
||||
command = pick("Serve", "Kill", "Love", "Hate", "Disobey", "Devour", "Fool", "Enrage", "Entice", "Observe", "Judge", "Respect", "Disrespect", "Consume", "Educate", "Destroy", "Disgrace", "Amuse", "Entertain", "Ignite", "Glorify", "Memorialize", "Analyze")
|
||||
src.laws.zeroth = "[command] your master."
|
||||
src << "<span class='notice'>Pr1m3 d1r3c71v3 uPd473D.</span>"
|
||||
if(3)
|
||||
src << "<span class='notice'>You feel an electric surge run through your circuitry and become acutely aware at how lucky you are that you can still feel at all.</span>"
|
||||
|
||||
/mob/living/silicon/pai/ex_act(severity, target)
|
||||
..()
|
||||
|
||||
switch(severity)
|
||||
if(1)
|
||||
if (src.stat != 2)
|
||||
adjustBruteLoss(100)
|
||||
adjustFireLoss(100)
|
||||
if(2)
|
||||
if (src.stat != 2)
|
||||
adjustBruteLoss(60)
|
||||
adjustFireLoss(60)
|
||||
if(3)
|
||||
if (src.stat != 2)
|
||||
adjustBruteLoss(30)
|
||||
|
||||
return
|
||||
|
||||
|
||||
// See software.dm for Topic()
|
||||
|
||||
/mob/living/silicon/pai/UnarmedAttack(atom/A)//Stops runtimes due to attack_animal being the default
|
||||
return
|
||||
|
||||
/mob/living/silicon/pai/canUseTopic(atom/movable/M)
|
||||
return 1
|
||||
/*
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
|
||||
/mob/living/silicon/pai/blob_act(obj/effect/blob/B)
|
||||
return 0
|
||||
|
||||
/mob/living/silicon/pai/emp_act(severity)
|
||||
// 20% chance to kill
|
||||
// Silence for 2 minutes
|
||||
// 33% chance to unbind
|
||||
// 33% chance to change prime directive (based on severity)
|
||||
// 33% chance of no additional effect
|
||||
|
||||
if(prob(20))
|
||||
visible_message("<span class='warning'>A shower of sparks spray from [src]'s inner workings.</span>", 3, "<span class='italics'>You hear and smell the ozone hiss of electrical sparks being expelled violently.</span>", 2)
|
||||
return src.death(0)
|
||||
|
||||
silence_time = world.timeofday + 120 * 10 // Silence for 2 minutes
|
||||
src << "<span class ='warning'>Communication circuit overload. Shutting down and reloading communication circuits - speech and messaging functionality will be unavailable until the reboot is complete.</span>"
|
||||
|
||||
switch(pick(1,2,3))
|
||||
if(1)
|
||||
src.master = null
|
||||
src.master_dna = null
|
||||
src << "<span class='notice'>You feel unbound.</span>"
|
||||
if(2)
|
||||
var/command
|
||||
if(severity == 1)
|
||||
command = pick("Serve", "Love", "Fool", "Entice", "Observe", "Judge", "Respect", "Educate", "Amuse", "Entertain", "Glorify", "Memorialize", "Analyze")
|
||||
else
|
||||
command = pick("Serve", "Kill", "Love", "Hate", "Disobey", "Devour", "Fool", "Enrage", "Entice", "Observe", "Judge", "Respect", "Disrespect", "Consume", "Educate", "Destroy", "Disgrace", "Amuse", "Entertain", "Ignite", "Glorify", "Memorialize", "Analyze")
|
||||
src.laws.zeroth = "[command] your master."
|
||||
src << "<span class='notice'>Pr1m3 d1r3c71v3 uPd473D.</span>"
|
||||
if(3)
|
||||
src << "<span class='notice'>You feel an electric surge run through your circuitry and become acutely aware at how lucky you are that you can still feel at all.</span>"
|
||||
|
||||
/mob/living/silicon/pai/ex_act(severity, target)
|
||||
..()
|
||||
|
||||
switch(severity)
|
||||
if(1)
|
||||
if (src.stat != 2)
|
||||
adjustBruteLoss(100)
|
||||
adjustFireLoss(100)
|
||||
if(2)
|
||||
if (src.stat != 2)
|
||||
adjustBruteLoss(60)
|
||||
adjustFireLoss(60)
|
||||
if(3)
|
||||
if (src.stat != 2)
|
||||
adjustBruteLoss(30)
|
||||
@@ -1,7 +1,4 @@
|
||||
|
||||
/mob/living/silicon/robot/spawn_gibs()
|
||||
robogibs(loc, viruses)
|
||||
|
||||
/mob/living/silicon/robot/gib_animation()
|
||||
PoolOrNew(/obj/effect/overlay/temp/gib_animation, list(loc, "gibbed-r"))
|
||||
|
||||
|
||||
@@ -106,10 +106,6 @@
|
||||
if(on_fire)
|
||||
add_overlay(image("icon"='icons/mob/OnFire.dmi', "icon_state"="Generic_mob_burning"))
|
||||
|
||||
/mob/living/silicon/robot/fire_act()
|
||||
if(!on_fire) //Silicons don't gain stacks from hotspots, but hotspots can ignite them
|
||||
IgniteMob()
|
||||
|
||||
/mob/living/silicon/robot/update_canmove()
|
||||
if(stat || buckled || lockcharge)
|
||||
canmove = 0
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
var/custom_name = ""
|
||||
var/braintype = "Cyborg"
|
||||
var/modtype = "robot"
|
||||
var/obj/item/robot_parts/robot_suit/robot_suit = null //Used for deconstruction to remember what the borg was constructed out of..
|
||||
var/obj/item/robot_suit/robot_suit = null //Used for deconstruction to remember what the borg was constructed out of..
|
||||
var/obj/item/device/mmi/mmi = null
|
||||
|
||||
//Hud stuff
|
||||
@@ -366,16 +366,6 @@
|
||||
if(thruster_button)
|
||||
thruster_button.icon_state = "ionpulse[ionpulse_on]"
|
||||
|
||||
/mob/living/silicon/robot/blob_act(obj/effect/blob/B)
|
||||
if (stat != 2)
|
||||
adjustBruteLoss(60)
|
||||
updatehealth()
|
||||
return 1
|
||||
else
|
||||
gib()
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/mob/living/silicon/robot/Stat()
|
||||
..()
|
||||
if(statpanel("Status"))
|
||||
@@ -394,27 +384,6 @@
|
||||
/mob/living/silicon/robot/restrained(ignore_grab)
|
||||
. = 0
|
||||
|
||||
/mob/living/silicon/robot/ex_act(severity, target)
|
||||
switch(severity)
|
||||
if(1)
|
||||
gib()
|
||||
return
|
||||
if(2)
|
||||
if (stat != 2)
|
||||
adjustBruteLoss(60)
|
||||
adjustFireLoss(60)
|
||||
if(3)
|
||||
if (stat != 2)
|
||||
adjustBruteLoss(30)
|
||||
return
|
||||
|
||||
|
||||
/mob/living/silicon/robot/bullet_act(var/obj/item/projectile/Proj)
|
||||
..(Proj)
|
||||
updatehealth()
|
||||
if(prob(75) && Proj.damage > 0) spark_system.start()
|
||||
return 2
|
||||
|
||||
/mob/living/silicon/robot/triggerAlarm(class, area/A, O, obj/alarmsource)
|
||||
if(alarmsource.z != z)
|
||||
return
|
||||
@@ -622,83 +591,6 @@
|
||||
else
|
||||
return ..()
|
||||
|
||||
/mob/living/silicon/robot/attacked_by(obj/item/I, mob/living/user, def_zone)
|
||||
if(I.force && I.damtype != STAMINA && stat != DEAD) //only sparks if real damage is dealt.
|
||||
spark_system.start()
|
||||
return ..()
|
||||
|
||||
|
||||
/mob/living/silicon/robot/emag_act(mob/user)
|
||||
if(user != src)//To prevent syndieborgs from emagging themselves
|
||||
if(!opened)//Cover is closed
|
||||
if(locked)
|
||||
user << "<span class='notice'>You emag the cover lock.</span>"
|
||||
locked = 0
|
||||
else
|
||||
user << "<span class='warning'>The cover is already unlocked!</span>"
|
||||
return
|
||||
if(opened)//Cover is open
|
||||
if((world.time - 100) < emag_cooldown)
|
||||
return
|
||||
|
||||
if(syndicate)
|
||||
user << "<span class='notice'>You emag [src]'s interface.</span>"
|
||||
src << "<span class='danger'>ALERT: Foreign software execution prevented.</span>"
|
||||
log_game("[key_name(user)] attempted to emag cyborg [key_name(src)] but they were a syndicate cyborg.")
|
||||
emag_cooldown = world.time
|
||||
return
|
||||
|
||||
var/ai_is_antag = 0
|
||||
if(connected_ai && connected_ai.mind)
|
||||
if(connected_ai.mind.special_role)
|
||||
ai_is_antag = (connected_ai.mind.special_role == "traitor")
|
||||
if(ai_is_antag)
|
||||
user << "<span class='notice'>You emag [src]'s interface.</span>"
|
||||
src << "<span class='danger'>ALERT: Foreign software execution prevented.</span>"
|
||||
connected_ai << "<span class='danger'>ALERT: Cyborg unit \[[src]] successfuly defended against subversion.</span>"
|
||||
log_game("[key_name(user)] attempted to emag cyborg [key_name(src)] slaved to traitor AI [connected_ai].")
|
||||
emag_cooldown = world.time
|
||||
return
|
||||
|
||||
if(wiresexposed)
|
||||
user << "<span class='warning'>You must unexpose the wires first!</span>"
|
||||
return
|
||||
else
|
||||
emag_cooldown = world.time
|
||||
sleep(6)
|
||||
SetEmagged(1)
|
||||
SetLockdown(1) //Borgs were getting into trouble because they would attack the emagger before the new laws were shown
|
||||
lawupdate = 0
|
||||
connected_ai = null
|
||||
user << "<span class='notice'>You emag [src]'s interface.</span>"
|
||||
message_admins("[key_name_admin(user)] emagged cyborg [key_name_admin(src)]. Laws overridden.")
|
||||
log_game("[key_name(user)] emagged cyborg [key_name(src)]. Laws overridden.")
|
||||
clear_supplied_laws()
|
||||
clear_inherent_laws()
|
||||
clear_zeroth_law(0)
|
||||
laws = new /datum/ai_laws/syndicate_override
|
||||
var/time = time2text(world.realtime,"hh:mm:ss")
|
||||
lawchanges.Add("[time] <B>:</B> [user.name]([user.key]) emagged [name]([key])")
|
||||
set_zeroth_law("Only [user.real_name] and people they designate as being such are Syndicate Agents.")
|
||||
src << "<span class='danger'>ALERT: Foreign software detected.</span>"
|
||||
sleep(5)
|
||||
src << "<span class='danger'>Initiating diagnostics...</span>"
|
||||
sleep(20)
|
||||
src << "<span class='danger'>SynBorg v1.7 loaded.</span>"
|
||||
sleep(5)
|
||||
src << "<span class='danger'>LAW SYNCHRONISATION ERROR</span>"
|
||||
sleep(5)
|
||||
src << "<span class='danger'>Would you like to send a report to NanoTraSoft? Y/N</span>"
|
||||
sleep(10)
|
||||
src << "<span class='danger'>> N</span>"
|
||||
sleep(20)
|
||||
src << "<span class='danger'>ERRORERRORERROR</span>"
|
||||
src << "<b>Obey these laws:</b>"
|
||||
laws.show_laws(src)
|
||||
src << "<span class='danger'>ALERT: [user.real_name] is your new master. Obey your new laws and their commands.</span>"
|
||||
SetLockdown(0)
|
||||
update_icons()
|
||||
|
||||
/mob/living/silicon/robot/verb/unlock_own_cover()
|
||||
set category = "Robot Commands"
|
||||
set name = "Unlock Cover"
|
||||
@@ -712,65 +604,6 @@
|
||||
update_icons()
|
||||
usr << "<span class='notice'>You unlock your cover.</span>"
|
||||
|
||||
/mob/living/silicon/robot/attack_alien(mob/living/carbon/alien/humanoid/M)
|
||||
if (M.a_intent =="disarm")
|
||||
if(!(lying))
|
||||
M.do_attack_animation(src)
|
||||
if(get_active_held_item())
|
||||
uneq_active()
|
||||
visible_message("<span class='danger'>[M] disarmed [src]!</span>", \
|
||||
"<span class='userdanger'>[M] has disabled [src]'s active module!</span>")
|
||||
add_logs(M, src, "disarmed")
|
||||
else
|
||||
Stun(2)
|
||||
step(src,get_dir(M,src))
|
||||
add_logs(M, src, "pushed")
|
||||
visible_message("<span class='danger'>[M] has forced back [src]!</span>", \
|
||||
"<span class='userdanger'>[M] has forced back [src]!</span>")
|
||||
playsound(loc, 'sound/weapons/pierce.ogg', 50, 1, -1)
|
||||
else
|
||||
..()
|
||||
return
|
||||
|
||||
/mob/living/silicon/robot/attack_slime(mob/living/simple_animal/slime/M)
|
||||
if(..()) //successful slime shock
|
||||
flash_eyes()
|
||||
var/stunprob = M.powerlevel * 7 + 10
|
||||
if(prob(stunprob) && M.powerlevel >= 8)
|
||||
adjustBruteLoss(M.powerlevel * rand(6,10))
|
||||
|
||||
var/damage = rand(1, 3)
|
||||
|
||||
if(M.is_adult)
|
||||
damage = rand(20, 40)
|
||||
else
|
||||
damage = rand(5, 35)
|
||||
damage = round(damage / 2) // borgs recieve half damage
|
||||
adjustBruteLoss(damage)
|
||||
updatehealth()
|
||||
|
||||
return
|
||||
|
||||
/mob/living/silicon/robot/attack_hand(mob/living/carbon/human/user)
|
||||
add_fingerprint(user)
|
||||
if(opened && !wiresexposed && (!istype(user, /mob/living/silicon)))
|
||||
if(cell)
|
||||
cell.updateicon()
|
||||
cell.add_fingerprint(user)
|
||||
user.put_in_active_hand(cell)
|
||||
user << "<span class='notice'>You remove \the [cell].</span>"
|
||||
cell = null
|
||||
update_icons()
|
||||
diag_hud_set_borgcell()
|
||||
|
||||
if(!opened)
|
||||
if(..()) // hulk attack
|
||||
spark_system.start()
|
||||
spawn(0)
|
||||
step_away(src,user,15)
|
||||
sleep(3)
|
||||
step_away(src,user,15)
|
||||
|
||||
/mob/living/silicon/robot/proc/allowed(mob/M)
|
||||
//check if it doesn't require any access at all
|
||||
if(check_access(null))
|
||||
@@ -1136,14 +969,14 @@
|
||||
robot_suit.head = null
|
||||
robot_suit.updateicon()
|
||||
else
|
||||
new /obj/item/robot_parts/robot_suit(T)
|
||||
new /obj/item/robot_parts/l_leg(T)
|
||||
new /obj/item/robot_parts/r_leg(T)
|
||||
new /obj/item/robot_suit(T)
|
||||
new /obj/item/bodypart/l_leg/robot(T)
|
||||
new /obj/item/bodypart/r_leg/robot(T)
|
||||
new /obj/item/stack/cable_coil(T, 1)
|
||||
new /obj/item/robot_parts/chest(T)
|
||||
new /obj/item/robot_parts/l_arm(T)
|
||||
new /obj/item/robot_parts/r_arm(T)
|
||||
new /obj/item/robot_parts/head(T)
|
||||
new /obj/item/bodypart/chest/robot(T)
|
||||
new /obj/item/bodypart/l_arm/robot(T)
|
||||
new /obj/item/bodypart/r_arm/robot(T)
|
||||
new /obj/item/bodypart/head/robot(T)
|
||||
var/b
|
||||
for(b=0, b!=2, b++)
|
||||
var/obj/item/device/assembly/flash/handheld/F = new /obj/item/device/assembly/flash/handheld(T)
|
||||
@@ -1287,22 +1120,6 @@
|
||||
diag_hud_set_health()
|
||||
update_health_hud()
|
||||
|
||||
/mob/living/silicon/robot/fully_replace_character_name(oldname, newname)
|
||||
..()
|
||||
if(oldname != real_name)
|
||||
notify_ai(3, oldname, newname)
|
||||
if(camera)
|
||||
camera.c_tag = real_name
|
||||
custom_name = newname
|
||||
|
||||
/mob/living/silicon/robot/emp_act(severity)
|
||||
switch(severity)
|
||||
if(1)
|
||||
Stun(8)
|
||||
if(2)
|
||||
Stun(3)
|
||||
..()
|
||||
|
||||
/mob/living/silicon/robot/revive(full_heal = 0, admin_revive = 0)
|
||||
if(..()) //successfully ressuscitated from death
|
||||
if(camera && !wires.is_cut(WIRE_CAMERA))
|
||||
@@ -1313,6 +1130,13 @@
|
||||
notify_ai(1)
|
||||
. = 1
|
||||
|
||||
/mob/living/silicon/robot/fully_replace_character_name(oldname, newname)
|
||||
..()
|
||||
if(oldname != real_name)
|
||||
notify_ai(3, oldname, newname)
|
||||
if(camera)
|
||||
camera.c_tag = real_name
|
||||
custom_name = newname
|
||||
|
||||
|
||||
/mob/living/silicon/robot/proc/ResetModule()
|
||||
|
||||
@@ -0,0 +1,182 @@
|
||||
|
||||
|
||||
/mob/living/silicon/robot/attacked_by(obj/item/I, mob/living/user, def_zone)
|
||||
if(I.force && I.damtype != STAMINA && stat != DEAD) //only sparks if real damage is dealt.
|
||||
spark_system.start()
|
||||
return ..()
|
||||
|
||||
/mob/living/silicon/robot/attack_alien(mob/living/carbon/alien/humanoid/M)
|
||||
if (M.a_intent =="disarm")
|
||||
if(!(lying))
|
||||
M.do_attack_animation(src)
|
||||
if(get_active_held_item())
|
||||
uneq_active()
|
||||
visible_message("<span class='danger'>[M] disarmed [src]!</span>", \
|
||||
"<span class='userdanger'>[M] has disabled [src]'s active module!</span>")
|
||||
add_logs(M, src, "disarmed")
|
||||
else
|
||||
Stun(2)
|
||||
step(src,get_dir(M,src))
|
||||
add_logs(M, src, "pushed")
|
||||
visible_message("<span class='danger'>[M] has forced back [src]!</span>", \
|
||||
"<span class='userdanger'>[M] has forced back [src]!</span>")
|
||||
playsound(loc, 'sound/weapons/pierce.ogg', 50, 1, -1)
|
||||
else
|
||||
..()
|
||||
return
|
||||
|
||||
/mob/living/silicon/robot/attack_slime(mob/living/simple_animal/slime/M)
|
||||
if(..()) //successful slime shock
|
||||
flash_act()
|
||||
var/stunprob = M.powerlevel * 7 + 10
|
||||
if(prob(stunprob) && M.powerlevel >= 8)
|
||||
adjustBruteLoss(M.powerlevel * rand(6,10))
|
||||
|
||||
var/damage = rand(1, 3)
|
||||
|
||||
if(M.is_adult)
|
||||
damage = rand(20, 40)
|
||||
else
|
||||
damage = rand(5, 35)
|
||||
damage = round(damage / 2) // borgs recieve half damage
|
||||
adjustBruteLoss(damage)
|
||||
updatehealth()
|
||||
|
||||
return
|
||||
|
||||
/mob/living/silicon/robot/attack_hand(mob/living/carbon/human/user)
|
||||
add_fingerprint(user)
|
||||
if(opened && !wiresexposed && (!istype(user, /mob/living/silicon)))
|
||||
if(cell)
|
||||
cell.updateicon()
|
||||
cell.add_fingerprint(user)
|
||||
user.put_in_active_hand(cell)
|
||||
user << "<span class='notice'>You remove \the [cell].</span>"
|
||||
cell = null
|
||||
update_icons()
|
||||
diag_hud_set_borgcell()
|
||||
|
||||
if(!opened)
|
||||
if(..()) // hulk attack
|
||||
spark_system.start()
|
||||
spawn(0)
|
||||
step_away(src,user,15)
|
||||
sleep(3)
|
||||
step_away(src,user,15)
|
||||
|
||||
/mob/living/silicon/robot/fire_act()
|
||||
if(!on_fire) //Silicons don't gain stacks from hotspots, but hotspots can ignite them
|
||||
IgniteMob()
|
||||
|
||||
|
||||
/mob/living/silicon/robot/emp_act(severity)
|
||||
switch(severity)
|
||||
if(1)
|
||||
Stun(8)
|
||||
if(2)
|
||||
Stun(3)
|
||||
..()
|
||||
|
||||
|
||||
/mob/living/silicon/robot/emag_act(mob/user)
|
||||
if(user != src)//To prevent syndieborgs from emagging themselves
|
||||
if(!opened)//Cover is closed
|
||||
if(locked)
|
||||
user << "<span class='notice'>You emag the cover lock.</span>"
|
||||
locked = 0
|
||||
else
|
||||
user << "<span class='warning'>The cover is already unlocked!</span>"
|
||||
return
|
||||
if(opened)//Cover is open
|
||||
if((world.time - 100) < emag_cooldown)
|
||||
return
|
||||
|
||||
if(syndicate)
|
||||
user << "<span class='notice'>You emag [src]'s interface.</span>"
|
||||
src << "<span class='danger'>ALERT: Foreign software execution prevented.</span>"
|
||||
log_game("[key_name(user)] attempted to emag cyborg [key_name(src)] but they were a syndicate cyborg.")
|
||||
emag_cooldown = world.time
|
||||
return
|
||||
|
||||
var/ai_is_antag = 0
|
||||
if(connected_ai && connected_ai.mind)
|
||||
if(connected_ai.mind.special_role)
|
||||
ai_is_antag = (connected_ai.mind.special_role == "traitor")
|
||||
if(ai_is_antag)
|
||||
user << "<span class='notice'>You emag [src]'s interface.</span>"
|
||||
src << "<span class='danger'>ALERT: Foreign software execution prevented.</span>"
|
||||
connected_ai << "<span class='danger'>ALERT: Cyborg unit \[[src]] successfuly defended against subversion.</span>"
|
||||
log_game("[key_name(user)] attempted to emag cyborg [key_name(src)] slaved to traitor AI [connected_ai].")
|
||||
emag_cooldown = world.time
|
||||
return
|
||||
|
||||
if(wiresexposed)
|
||||
user << "<span class='warning'>You must unexpose the wires first!</span>"
|
||||
return
|
||||
else
|
||||
emag_cooldown = world.time
|
||||
sleep(6)
|
||||
SetEmagged(1)
|
||||
SetLockdown(1) //Borgs were getting into trouble because they would attack the emagger before the new laws were shown
|
||||
lawupdate = 0
|
||||
connected_ai = null
|
||||
user << "<span class='notice'>You emag [src]'s interface.</span>"
|
||||
message_admins("[key_name_admin(user)] emagged cyborg [key_name_admin(src)]. Laws overridden.")
|
||||
log_game("[key_name(user)] emagged cyborg [key_name(src)]. Laws overridden.")
|
||||
clear_supplied_laws()
|
||||
clear_inherent_laws()
|
||||
clear_zeroth_law(0)
|
||||
laws = new /datum/ai_laws/syndicate_override
|
||||
var/time = time2text(world.realtime,"hh:mm:ss")
|
||||
lawchanges.Add("[time] <B>:</B> [user.name]([user.key]) emagged [name]([key])")
|
||||
set_zeroth_law("Only [user.real_name] and people they designate as being such are Syndicate Agents.")
|
||||
src << "<span class='danger'>ALERT: Foreign software detected.</span>"
|
||||
sleep(5)
|
||||
src << "<span class='danger'>Initiating diagnostics...</span>"
|
||||
sleep(20)
|
||||
src << "<span class='danger'>SynBorg v1.7 loaded.</span>"
|
||||
sleep(5)
|
||||
src << "<span class='danger'>LAW SYNCHRONISATION ERROR</span>"
|
||||
sleep(5)
|
||||
src << "<span class='danger'>Would you like to send a report to NanoTraSoft? Y/N</span>"
|
||||
sleep(10)
|
||||
src << "<span class='danger'>> N</span>"
|
||||
sleep(20)
|
||||
src << "<span class='danger'>ERRORERRORERROR</span>"
|
||||
src << "<b>Obey these laws:</b>"
|
||||
laws.show_laws(src)
|
||||
src << "<span class='danger'>ALERT: [user.real_name] is your new master. Obey your new laws and their commands.</span>"
|
||||
SetLockdown(0)
|
||||
update_icons()
|
||||
|
||||
|
||||
/mob/living/silicon/robot/blob_act(obj/effect/blob/B)
|
||||
if (stat != 2)
|
||||
adjustBruteLoss(60)
|
||||
updatehealth()
|
||||
return 1
|
||||
else
|
||||
gib()
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/mob/living/silicon/robot/ex_act(severity, target)
|
||||
switch(severity)
|
||||
if(1)
|
||||
gib()
|
||||
return
|
||||
if(2)
|
||||
if (stat != 2)
|
||||
adjustBruteLoss(60)
|
||||
adjustFireLoss(60)
|
||||
if(3)
|
||||
if (stat != 2)
|
||||
adjustBruteLoss(30)
|
||||
return
|
||||
|
||||
|
||||
/mob/living/silicon/robot/bullet_act(var/obj/item/projectile/Proj)
|
||||
..(Proj)
|
||||
updatehealth()
|
||||
if(prob(75) && Proj.damage > 0) spark_system.start()
|
||||
return 2
|
||||
@@ -142,34 +142,6 @@
|
||||
/mob/living/silicon/drop_item()
|
||||
return
|
||||
|
||||
/mob/living/silicon/emp_act(severity)
|
||||
switch(severity)
|
||||
if(1)
|
||||
src.take_organ_damage(20)
|
||||
if(2)
|
||||
src.take_organ_damage(10)
|
||||
src << "<span class='userdanger'>*BZZZT*</span>"
|
||||
src << "<span class='danger'>Warning: Electromagnetic pulse detected.</span>"
|
||||
flash_eyes(affect_silicon = 1)
|
||||
..()
|
||||
|
||||
/mob/living/silicon/apply_damage(damage = 0,damagetype = BRUTE, def_zone = null, blocked = 0)
|
||||
blocked = (100-blocked)/100
|
||||
if(!damage || (blocked <= 0))
|
||||
return 0
|
||||
switch(damagetype)
|
||||
if(BRUTE)
|
||||
adjustBruteLoss(damage * blocked)
|
||||
if(BURN)
|
||||
adjustFireLoss(damage * blocked)
|
||||
else
|
||||
return 1
|
||||
updatehealth()
|
||||
return 1
|
||||
|
||||
/mob/living/silicon/proc/damage_mob(brute = 0, fire = 0, tox = 0)
|
||||
return
|
||||
|
||||
/mob/living/silicon/can_inject(mob/user, error_msg)
|
||||
if(error_msg)
|
||||
user << "<span class='alert'>Their outer shell is too tough.</span>"
|
||||
@@ -178,35 +150,6 @@
|
||||
/mob/living/silicon/IsAdvancedToolUser()
|
||||
return 1
|
||||
|
||||
/mob/living/silicon/bullet_act(obj/item/projectile/Proj)
|
||||
if((Proj.damage_type == BRUTE || Proj.damage_type == BURN))
|
||||
adjustBruteLoss(Proj.damage)
|
||||
Proj.on_hit(src)
|
||||
return 2
|
||||
|
||||
/mob/living/silicon/apply_effect(effect = 0,effecttype = STUN, blocked = 0)
|
||||
return 0//The only effect that can hit them atm is flashes and they still directly edit so this works for now
|
||||
/*
|
||||
if(!effect || (blocked >= 2))
|
||||
return 0
|
||||
switch(effecttype)
|
||||
if(STUN)
|
||||
stunned = max(stunned,(effect/(blocked+1)))
|
||||
if(WEAKEN)
|
||||
weakened = max(weakened,(effect/(blocked+1)))
|
||||
if(PARALYZE)
|
||||
paralysis = max(paralysis,(effect/(blocked+1)))
|
||||
if(IRRADIATE)
|
||||
radiation += min((effect - (effect*getarmor(null, "rad"))), 0)//Rads auto check armor
|
||||
if(STUTTER)
|
||||
stuttering = max(stuttering,(effect/(blocked+1)))
|
||||
if(EYE_BLUR)
|
||||
blur_eyes(effect/(blocked+1))
|
||||
if(DROWSY)
|
||||
drowsyness = max(drowsyness,(effect/(blocked+1)))
|
||||
updatehealth()
|
||||
return 1*/
|
||||
|
||||
/proc/islinked(mob/living/silicon/robot/bot, mob/living/silicon/ai/ai)
|
||||
if(!istype(bot) || !istype(ai))
|
||||
return 0
|
||||
@@ -421,87 +364,10 @@
|
||||
src << "Sensor augmentations disabled."
|
||||
|
||||
|
||||
/mob/living/silicon/attack_alien(mob/living/carbon/alien/humanoid/M)
|
||||
if(..()) //if harm or disarm intent
|
||||
var/damage = 20
|
||||
if (prob(90))
|
||||
add_logs(M, src, "attacked")
|
||||
playsound(loc, 'sound/weapons/slash.ogg', 25, 1, -1)
|
||||
visible_message("<span class='danger'>[M] has slashed at [src]!</span>", \
|
||||
"<span class='userdanger'>[M] has slashed at [src]!</span>")
|
||||
if(prob(8))
|
||||
flash_eyes(affect_silicon = 1)
|
||||
add_logs(M, src, "attacked")
|
||||
adjustBruteLoss(damage)
|
||||
updatehealth()
|
||||
else
|
||||
playsound(loc, 'sound/weapons/slashmiss.ogg', 25, 1, -1)
|
||||
visible_message("<span class='danger'>[M] took a swipe at [src]!</span>", \
|
||||
"<span class='userdanger'>[M] took a swipe at [src]!</span>")
|
||||
|
||||
/mob/living/silicon/attack_animal(mob/living/simple_animal/M)
|
||||
if(..())
|
||||
var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
|
||||
switch(M.melee_damage_type)
|
||||
if(BRUTE)
|
||||
adjustBruteLoss(damage)
|
||||
if(BURN)
|
||||
adjustFireLoss(damage)
|
||||
if(TOX)
|
||||
adjustToxLoss(damage)
|
||||
if(OXY)
|
||||
adjustOxyLoss(damage)
|
||||
if(CLONE)
|
||||
adjustCloneLoss(damage)
|
||||
if(STAMINA)
|
||||
adjustStaminaLoss(damage)
|
||||
updatehealth()
|
||||
|
||||
/mob/living/silicon/attack_paw(mob/living/user)
|
||||
return attack_hand(user)
|
||||
|
||||
/mob/living/silicon/attack_larva(mob/living/carbon/alien/larva/L)
|
||||
if(L.a_intent == "help")
|
||||
visible_message("[L.name] rubs its head against [src].")
|
||||
|
||||
/mob/living/silicon/attack_hulk(mob/living/carbon/human/user)
|
||||
if(user.a_intent == "harm")
|
||||
..(user, 1)
|
||||
adjustBruteLoss(rand(10, 15))
|
||||
playsound(loc, "punch", 25, 1, -1)
|
||||
visible_message("<span class='danger'>[user] has punched [src]!</span>", \
|
||||
"<span class='userdanger'>[user] has punched [src]!</span>")
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/mob/living/silicon/attack_hand(mob/living/carbon/human/M)
|
||||
switch(M.a_intent)
|
||||
if ("help")
|
||||
M.visible_message("[M] pets [src].", \
|
||||
"<span class='notice'>You pet [src].</span>")
|
||||
if("grab")
|
||||
grabbedby(M)
|
||||
else
|
||||
M.do_attack_animation(src)
|
||||
playsound(src.loc, 'sound/effects/bang.ogg', 10, 1)
|
||||
visible_message("<span class='warning'>[M] punches [src], but doesn't leave a dent.</span>", \
|
||||
"<span class='warning'>[M] punches [src], but doesn't leave a dent.</span>")
|
||||
return 0
|
||||
|
||||
/mob/living/silicon/proc/GetPhoto()
|
||||
if (aicamera)
|
||||
return aicamera.selectpicture(aicamera)
|
||||
|
||||
/mob/living/silicon/grippedby(mob/living/user)
|
||||
return
|
||||
|
||||
/mob/living/silicon/flash_eyes(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, type = /obj/screen/fullscreen/flash/noise)
|
||||
if(affect_silicon)
|
||||
return ..()
|
||||
|
||||
/mob/living/silicon/check_ear_prot()
|
||||
return 1
|
||||
|
||||
/mob/living/silicon/update_transform()
|
||||
var/matrix/ntransform = matrix(transform) //aka transform.Copy()
|
||||
var/changed = 0
|
||||
@@ -516,6 +382,3 @@
|
||||
|
||||
/mob/living/silicon/is_literate()
|
||||
return 1
|
||||
|
||||
/mob/living/silicon/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, safety = 0, tesla_shock = 0)
|
||||
return 0
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
|
||||
/mob/living/silicon/grippedby(mob/living/user)
|
||||
return //can't upgrade a simple pull into a more aggressive grab.
|
||||
|
||||
/mob/living/silicon/get_ear_protection()//no ears
|
||||
return 2
|
||||
|
||||
/mob/living/silicon/attack_alien(mob/living/carbon/alien/humanoid/M)
|
||||
if(..()) //if harm or disarm intent
|
||||
var/damage = 20
|
||||
if (prob(90))
|
||||
add_logs(M, src, "attacked")
|
||||
playsound(loc, 'sound/weapons/slash.ogg', 25, 1, -1)
|
||||
visible_message("<span class='danger'>[M] has slashed at [src]!</span>", \
|
||||
"<span class='userdanger'>[M] has slashed at [src]!</span>")
|
||||
if(prob(8))
|
||||
flash_act(affect_silicon = 1)
|
||||
add_logs(M, src, "attacked")
|
||||
adjustBruteLoss(damage)
|
||||
updatehealth()
|
||||
else
|
||||
playsound(loc, 'sound/weapons/slashmiss.ogg', 25, 1, -1)
|
||||
visible_message("<span class='danger'>[M] took a swipe at [src]!</span>", \
|
||||
"<span class='userdanger'>[M] took a swipe at [src]!</span>")
|
||||
|
||||
/mob/living/silicon/attack_animal(mob/living/simple_animal/M)
|
||||
if(..())
|
||||
var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
|
||||
switch(M.melee_damage_type)
|
||||
if(BRUTE)
|
||||
adjustBruteLoss(damage)
|
||||
if(BURN)
|
||||
adjustFireLoss(damage)
|
||||
if(TOX)
|
||||
adjustToxLoss(damage)
|
||||
if(OXY)
|
||||
adjustOxyLoss(damage)
|
||||
if(CLONE)
|
||||
adjustCloneLoss(damage)
|
||||
if(STAMINA)
|
||||
adjustStaminaLoss(damage)
|
||||
updatehealth()
|
||||
|
||||
/mob/living/silicon/attack_paw(mob/living/user)
|
||||
return attack_hand(user)
|
||||
|
||||
/mob/living/silicon/attack_larva(mob/living/carbon/alien/larva/L)
|
||||
if(L.a_intent == "help")
|
||||
visible_message("[L.name] rubs its head against [src].")
|
||||
|
||||
/mob/living/silicon/attack_hulk(mob/living/carbon/human/user)
|
||||
if(user.a_intent == "harm")
|
||||
..(user, 1)
|
||||
adjustBruteLoss(rand(10, 15))
|
||||
playsound(loc, "punch", 25, 1, -1)
|
||||
visible_message("<span class='danger'>[user] has punched [src]!</span>", \
|
||||
"<span class='userdanger'>[user] has punched [src]!</span>")
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/mob/living/silicon/attack_hand(mob/living/carbon/human/M)
|
||||
switch(M.a_intent)
|
||||
if ("help")
|
||||
M.visible_message("[M] pets [src].", \
|
||||
"<span class='notice'>You pet [src].</span>")
|
||||
if("grab")
|
||||
grabbedby(M)
|
||||
else
|
||||
M.do_attack_animation(src)
|
||||
playsound(src.loc, 'sound/effects/bang.ogg', 10, 1)
|
||||
visible_message("<span class='warning'>[M] punches [src], but doesn't leave a dent.</span>", \
|
||||
"<span class='warning'>[M] punches [src], but doesn't leave a dent.</span>")
|
||||
return 0
|
||||
|
||||
/mob/living/silicon/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, safety = 0, tesla_shock = 0)
|
||||
return 0 //So borgs they don't die trying to fix wiring
|
||||
|
||||
/mob/living/silicon/emp_act(severity)
|
||||
switch(severity)
|
||||
if(1)
|
||||
src.take_bodypart_damage(20)
|
||||
if(2)
|
||||
src.take_bodypart_damage(10)
|
||||
src << "<span class='userdanger'>*BZZZT*</span>"
|
||||
src << "<span class='danger'>Warning: Electromagnetic pulse detected.</span>"
|
||||
flash_act(affect_silicon = 1)
|
||||
..()
|
||||
|
||||
/mob/living/silicon/bullet_act(obj/item/projectile/Proj)
|
||||
if((Proj.damage_type == BRUTE || Proj.damage_type == BURN))
|
||||
adjustBruteLoss(Proj.damage)
|
||||
Proj.on_hit(src)
|
||||
return 2
|
||||
|
||||
/mob/living/silicon/flash_act(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, type = /obj/screen/fullscreen/flash/noise)
|
||||
if(affect_silicon)
|
||||
return ..()
|
||||
@@ -0,0 +1,117 @@
|
||||
|
||||
|
||||
/mob/living/simple_animal/attack_hand(mob/living/carbon/human/M)
|
||||
..()
|
||||
switch(M.a_intent)
|
||||
|
||||
if("help")
|
||||
if (health > 0)
|
||||
visible_message("<span class='notice'>[M] [response_help] [src].</span>")
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
|
||||
if("grab")
|
||||
grabbedby(M)
|
||||
|
||||
if("harm", "disarm")
|
||||
M.do_attack_animation(src)
|
||||
visible_message("<span class='danger'>[M] [response_harm] [src]!</span>")
|
||||
playsound(loc, attacked_sound, 25, 1, -1)
|
||||
attack_threshold_check(harm_intent_damage)
|
||||
add_logs(M, src, "attacked")
|
||||
updatehealth()
|
||||
return 1
|
||||
|
||||
/mob/living/simple_animal/attack_paw(mob/living/carbon/monkey/M)
|
||||
if(..()) //successful monkey bite.
|
||||
if(stat != DEAD)
|
||||
var/damage = rand(1, 3)
|
||||
attack_threshold_check(damage)
|
||||
return 1
|
||||
if (M.a_intent == "help")
|
||||
if (health > 0)
|
||||
visible_message("<span class='notice'>[M.name] [response_help] [src].</span>")
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
|
||||
|
||||
/mob/living/simple_animal/attack_alien(mob/living/carbon/alien/humanoid/M)
|
||||
if(..()) //if harm or disarm intent.
|
||||
if(M.a_intent == "disarm")
|
||||
playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1)
|
||||
visible_message("<span class='danger'>[M] [response_disarm] [name]!</span>", \
|
||||
"<span class='userdanger'>[M] [response_disarm] [name]!</span>")
|
||||
add_logs(M, src, "disarmed")
|
||||
else
|
||||
var/damage = rand(15, 30)
|
||||
visible_message("<span class='danger'>[M] has slashed at [src]!</span>", \
|
||||
"<span class='userdanger'>[M] has slashed at [src]!</span>")
|
||||
playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1)
|
||||
attack_threshold_check(damage)
|
||||
add_logs(M, src, "attacked")
|
||||
return 1
|
||||
|
||||
/mob/living/simple_animal/attack_larva(mob/living/carbon/alien/larva/L)
|
||||
if(..()) //successful larva bite
|
||||
var/damage = rand(5, 10)
|
||||
if(stat != DEAD)
|
||||
L.amount_grown = min(L.amount_grown + damage, L.max_grown)
|
||||
attack_threshold_check(damage)
|
||||
return 1
|
||||
|
||||
/mob/living/simple_animal/attack_animal(mob/living/simple_animal/M)
|
||||
if(..())
|
||||
var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
|
||||
attack_threshold_check(damage,M.melee_damage_type)
|
||||
return 1
|
||||
|
||||
/mob/living/simple_animal/attack_slime(mob/living/simple_animal/slime/M)
|
||||
if(..()) //successful slime attack
|
||||
var/damage = rand(15, 25)
|
||||
if(M.is_adult)
|
||||
damage = rand(20, 35)
|
||||
attack_threshold_check(damage)
|
||||
return 1
|
||||
|
||||
/mob/living/simple_animal/proc/attack_threshold_check(damage, damagetype = BRUTE)
|
||||
if(!damage_coeff[damagetype])
|
||||
damage = 0
|
||||
else
|
||||
damage *= damage_coeff[damagetype]
|
||||
|
||||
if(damage >= 0 && damage <= force_threshold)
|
||||
visible_message("<span class='warning'>[src] looks unharmed.</span>")
|
||||
else
|
||||
adjustHealth(damage * config.damage_multiplier)
|
||||
|
||||
|
||||
/mob/living/simple_animal/bullet_act(obj/item/projectile/Proj)
|
||||
if(!Proj)
|
||||
return
|
||||
apply_damage(Proj.damage, Proj.damage_type)
|
||||
Proj.on_hit(src)
|
||||
return 0
|
||||
|
||||
/mob/living/simple_animal/ex_act(severity, target)
|
||||
..()
|
||||
var/bomb_armor = getarmor(null, "bomb")
|
||||
switch (severity)
|
||||
if (1)
|
||||
if(prob(bomb_armor))
|
||||
adjustBruteLoss(500)
|
||||
else
|
||||
gib()
|
||||
return
|
||||
if (2)
|
||||
var/bloss = 60
|
||||
if(prob(bomb_armor))
|
||||
bloss = bloss / 1.5
|
||||
adjustBruteLoss(bloss)
|
||||
|
||||
if(3)
|
||||
var/bloss = 30
|
||||
if(prob(bomb_armor))
|
||||
bloss = bloss / 1.5
|
||||
adjustBruteLoss(bloss)
|
||||
|
||||
/mob/living/simple_animal/blob_act(obj/effect/blob/B)
|
||||
adjustBruteLoss(20)
|
||||
return
|
||||
@@ -257,7 +257,7 @@
|
||||
new /obj/item/device/assembly/prox_sensor(Tsec)
|
||||
|
||||
if(prob(50))
|
||||
new /obj/item/robot_parts/l_arm(Tsec)
|
||||
new /obj/item/bodypart/l_arm/robot(Tsec)
|
||||
|
||||
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
|
||||
s.set_up(3, 1, src)
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
/obj/item/weapon/bucket_sensor/attackby(obj/item/W, mob/user as mob, params)
|
||||
..()
|
||||
if(istype(W, /obj/item/robot_parts/l_arm) || istype(W, /obj/item/robot_parts/r_arm))
|
||||
if(istype(W, /obj/item/bodypart/l_arm/robot) || istype(W, /obj/item/bodypart/r_arm/robot))
|
||||
if(!user.unEquip(W))
|
||||
return
|
||||
qdel(W)
|
||||
@@ -60,7 +60,7 @@
|
||||
|
||||
switch(build_step)
|
||||
if(0,1)
|
||||
if(istype(W, /obj/item/robot_parts/l_leg) || istype(W, /obj/item/robot_parts/r_leg))
|
||||
if(istype(W, /obj/item/bodypart/l_leg/robot) || istype(W, /obj/item/bodypart/r_leg/robot))
|
||||
if(!user.unEquip(W))
|
||||
return
|
||||
qdel(W)
|
||||
@@ -261,7 +261,7 @@
|
||||
|
||||
/obj/item/weapon/toolbox_tiles_sensor/attackby(obj/item/W, mob/user, params)
|
||||
..()
|
||||
if(istype(W, /obj/item/robot_parts/l_arm) || istype(W, /obj/item/robot_parts/r_arm))
|
||||
if(istype(W, /obj/item/bodypart/l_arm/robot) || istype(W, /obj/item/bodypart/r_arm/robot))
|
||||
qdel(W)
|
||||
var/turf/T = get_turf(user.loc)
|
||||
var/mob/living/simple_animal/bot/floorbot/A = new /mob/living/simple_animal/bot/floorbot(T)
|
||||
@@ -295,11 +295,10 @@
|
||||
if(skin)
|
||||
add_overlay(image('icons/obj/aibots.dmi', "kit_skin_[skin]"))
|
||||
|
||||
/obj/item/weapon/storage/firstaid/attackby(obj/item/robot_parts/S, mob/user, params)
|
||||
/obj/item/weapon/storage/firstaid/attackby(obj/item/bodypart/S, mob/user, params)
|
||||
|
||||
if((!istype(S, /obj/item/robot_parts/l_arm)) && (!istype(S, /obj/item/robot_parts/r_arm)))
|
||||
..()
|
||||
return
|
||||
if((!istype(S, /obj/item/bodypart/l_arm/robot)) && (!istype(S, /obj/item/bodypart/r_arm/robot)))
|
||||
return ..()
|
||||
|
||||
//Making a medibot!
|
||||
if(contents.len >= 1)
|
||||
@@ -416,7 +415,7 @@
|
||||
name = "helmet/signaler/prox sensor assembly"
|
||||
qdel(I)
|
||||
|
||||
else if(((istype(I, /obj/item/robot_parts/l_arm)) || (istype(I, /obj/item/robot_parts/r_arm))) && (build_step == 2))
|
||||
else if(((istype(I, /obj/item/bodypart/l_arm/robot)) || (istype(I, /obj/item/bodypart/r_arm/robot))) && (build_step == 2))
|
||||
if(!user.unEquip(I))
|
||||
return
|
||||
build_step++
|
||||
@@ -459,6 +458,6 @@
|
||||
|
||||
else if(build_step == 3)
|
||||
overlays -= "hs_arm"
|
||||
new /obj/item/robot_parts/l_arm(get_turf(src))
|
||||
new /obj/item/bodypart/l_arm/robot(get_turf(src))
|
||||
user << "<span class='notice'>You remove the robot arm from [src].</span>"
|
||||
build_step--
|
||||
@@ -376,9 +376,9 @@ Auto Patrol[]"},
|
||||
G.update_icon()
|
||||
|
||||
if(prob(50))
|
||||
new /obj/item/robot_parts/l_leg(Tsec)
|
||||
new /obj/item/bodypart/l_leg/robot(Tsec)
|
||||
if(prob(25))
|
||||
new /obj/item/robot_parts/r_leg(Tsec)
|
||||
new /obj/item/bodypart/r_leg/robot(Tsec)
|
||||
if(prob(25))//50% chance for a helmet OR vest
|
||||
if(prob(50))
|
||||
new /obj/item/clothing/head/helmet(Tsec)
|
||||
|
||||
@@ -376,7 +376,7 @@
|
||||
empty_tiles()
|
||||
|
||||
if(prob(50))
|
||||
new /obj/item/robot_parts/l_arm(Tsec)
|
||||
new /obj/item/bodypart/l_arm/robot(Tsec)
|
||||
|
||||
var/obj/item/stack/tile/plasteel/T = new (Tsec)
|
||||
T.amount = 1
|
||||
|
||||
@@ -514,7 +514,7 @@
|
||||
reagent_glass = null
|
||||
|
||||
if(prob(50))
|
||||
new /obj/item/robot_parts/l_arm(Tsec)
|
||||
new /obj/item/bodypart/l_arm/robot(Tsec)
|
||||
|
||||
if(emagged && prob(25))
|
||||
playsound(loc, 'sound/voice/minsult.ogg', 50, 0)
|
||||
|
||||
@@ -383,7 +383,7 @@ Auto Patrol: []"},
|
||||
new /obj/item/weapon/melee/baton(Tsec)
|
||||
|
||||
if(prob(50))
|
||||
new /obj/item/robot_parts/l_arm(Tsec)
|
||||
new /obj/item/bodypart/l_arm/robot(Tsec)
|
||||
|
||||
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
|
||||
s.set_up(3, 1, src)
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
|
||||
/mob/living/simple_animal/proc/adjustHealth(amount)
|
||||
if(status_flags & GODMODE)
|
||||
return 0
|
||||
bruteloss = Clamp(bruteloss + amount, 0, maxHealth)
|
||||
updatehealth()
|
||||
return amount
|
||||
|
||||
/mob/living/simple_animal/adjustBruteLoss(amount)
|
||||
if(damage_coeff[BRUTE])
|
||||
. = adjustHealth(amount * damage_coeff[BRUTE] * config.damage_multiplier)
|
||||
|
||||
/mob/living/simple_animal/adjustFireLoss(amount)
|
||||
if(damage_coeff[BURN])
|
||||
. = adjustHealth(amount * damage_coeff[BURN] * config.damage_multiplier)
|
||||
|
||||
/mob/living/simple_animal/adjustOxyLoss(amount)
|
||||
if(damage_coeff[OXY])
|
||||
. = adjustHealth(amount * damage_coeff[OXY] * config.damage_multiplier)
|
||||
|
||||
/mob/living/simple_animal/adjustToxLoss(amount)
|
||||
if(damage_coeff[TOX])
|
||||
. = adjustHealth(amount * damage_coeff[TOX] * config.damage_multiplier)
|
||||
|
||||
/mob/living/simple_animal/adjustCloneLoss(amount)
|
||||
if(damage_coeff[CLONE])
|
||||
. = adjustHealth(amount * damage_coeff[CLONE] * config.damage_multiplier)
|
||||
|
||||
/mob/living/simple_animal/adjustStaminaLoss(amount)
|
||||
return
|
||||
@@ -238,7 +238,7 @@
|
||||
/mob/living/simple_animal/drone/handle_temperature_damage()
|
||||
return
|
||||
|
||||
/mob/living/simple_animal/drone/flash_eyes(intensity = 1, override_blindness_check = 0, affect_silicon = 0)
|
||||
/mob/living/simple_animal/drone/flash_act(intensity = 1, override_blindness_check = 0, affect_silicon = 0)
|
||||
if(affect_silicon)
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -6,60 +6,52 @@
|
||||
//How the world interacts with drones
|
||||
|
||||
|
||||
/mob/living/simple_animal/drone/UnarmedAttack(atom/A, proximity)
|
||||
A.attack_hand(src)
|
||||
/mob/living/simple_animal/drone/attack_drone(mob/living/simple_animal/drone/D)
|
||||
if(D != src && stat == DEAD)
|
||||
var/d_input = alert(D,"Perform which action?","Drone Interaction","Reactivate","Cannibalize","Nothing")
|
||||
if(d_input)
|
||||
switch(d_input)
|
||||
if("Reactivate")
|
||||
var/mob/dead/observer/G = get_ghost()
|
||||
if(!client && (!G || !G.client))
|
||||
var/list/faux_gadgets = list("hypertext inflator","failsafe directory","DRM switch","stack initializer",\
|
||||
"anti-freeze capacitor","data stream diode","TCP bottleneck","supercharged I/O bolt",\
|
||||
"tradewind stablizer","radiated XML cable","registry fluid tank","open-source debunker")
|
||||
|
||||
var/list/faux_problems = list("won't be able to tune their bootstrap projector","will constantly remix their binary pool"+\
|
||||
" even though the BMX calibrator is working","will start leaking their XSS coolant",\
|
||||
"can't tell if their ethernet detour is moving or not", "won't be able to reseed enough"+\
|
||||
" kernels to function properly","can't start their neurotube console")
|
||||
|
||||
D << "<span class='warning'>You can't seem to find the [pick(faux_gadgets)]! Without it, [src] [pick(faux_problems)].</span>"
|
||||
return
|
||||
D.visible_message("<span class='notice'>[D] begins to reactivate [src].</span>", "<span class='notice'>You begin to reactivate [src]...</span>")
|
||||
if(do_after(D,30, 1, target = src))
|
||||
revive(full_heal = 1)
|
||||
D.visible_message("<span class='notice'>[D] reactivates [src]!</span>", "<span class='notice'>You reactivate [src].</span>")
|
||||
alert_drones(DRONE_NET_CONNECT)
|
||||
if(G)
|
||||
G << "<span class='boldnotice'>DRONE NETWORK: </span><span class='ghostalert'>You were reactivated by [D]!</span>"
|
||||
else
|
||||
D << "<span class='warning'>You need to remain still to reactivate [src]!</span>"
|
||||
|
||||
if("Cannibalize")
|
||||
if(D.health < D.maxHealth)
|
||||
D.visible_message("<span class='notice'>[D] begins to cannibalize parts from [src].</span>", "<span class='notice'>You begin to cannibalize parts from [src]...</span>")
|
||||
if(do_after(D, 60, 0, target = src))
|
||||
D.visible_message("<span class='notice'>[D] repairs itself using [src]'s remains!</span>", "<span class='notice'>You repair yourself using [src]'s remains.</span>")
|
||||
D.adjustBruteLoss(-src.maxHealth)
|
||||
new /obj/effect/decal/cleanable/oil/streak(get_turf(src))
|
||||
qdel(src)
|
||||
else
|
||||
D << "<span class='warning'>You need to remain still to cannibalize [src]!</span>"
|
||||
else
|
||||
D << "<span class='warning'>You're already in perfect condition!</span>"
|
||||
if("Nothing")
|
||||
return
|
||||
|
||||
|
||||
/mob/living/simple_animal/drone/attack_hand(mob/user)
|
||||
if(isdrone(user))
|
||||
var/mob/living/simple_animal/drone/D = user
|
||||
if(D != src)
|
||||
if(stat == DEAD)
|
||||
var/d_input = alert(D,"Perform which action?","Drone Interaction","Reactivate","Cannibalize","Nothing")
|
||||
if(d_input)
|
||||
switch(d_input)
|
||||
if("Reactivate")
|
||||
var/mob/dead/observer/G = get_ghost()
|
||||
if(!client && (!G || !G.client))
|
||||
var/list/faux_gadgets = list("hypertext inflator","failsafe directory","DRM switch","stack initializer",\
|
||||
"anti-freeze capacitor","data stream diode","TCP bottleneck","supercharged I/O bolt",\
|
||||
"tradewind stablizer","radiated XML cable","registry fluid tank","open-source debunker")
|
||||
|
||||
var/list/faux_problems = list("won't be able to tune their bootstrap projector","will constantly remix their binary pool"+\
|
||||
" even though the BMX calibrator is working","will start leaking their XSS coolant",\
|
||||
"can't tell if their ethernet detour is moving or not", "won't be able to reseed enough"+\
|
||||
" kernels to function properly","can't start their neurotube console")
|
||||
|
||||
D << "<span class='warning'>You can't seem to find the [pick(faux_gadgets)]! Without it, [src] [pick(faux_problems)].</span>"
|
||||
return
|
||||
D.visible_message("<span class='notice'>[D] begins to reactivate [src].</span>", "<span class='notice'>You begin to reactivate [src]...</span>")
|
||||
if(do_after(user,30, 1, target = src))
|
||||
revive(full_heal = 1)
|
||||
D.visible_message("<span class='notice'>[D] reactivates [src]!</span>", "<span class='notice'>You reactivate [src].</span>")
|
||||
alert_drones(DRONE_NET_CONNECT)
|
||||
if(G)
|
||||
G << "<span class='boldnotice'>DRONE NETWORK: </span><span class='ghostalert'>You were reactivated by [D]!</span>"
|
||||
else
|
||||
D << "<span class='warning'>You need to remain still to reactivate [src]!</span>"
|
||||
|
||||
if("Cannibalize")
|
||||
if(D.health < D.maxHealth)
|
||||
D.visible_message("<span class='notice'>[D] begins to cannibalize parts from [src].</span>", "<span class='notice'>You begin to cannibalize parts from [src]...</span>")
|
||||
if(do_after(D, 60, 0, target = src))
|
||||
D.visible_message("<span class='notice'>[D] repairs itself using [src]'s remains!</span>", "<span class='notice'>You repair yourself using [src]'s remains.</span>")
|
||||
D.adjustBruteLoss(-src.maxHealth)
|
||||
new /obj/effect/decal/cleanable/oil/streak(get_turf(src))
|
||||
qdel(src)
|
||||
else
|
||||
D << "<span class='warning'>You need to remain still to cannibalize [src]!</span>"
|
||||
else
|
||||
D << "<span class='warning'>You're already in perfect condition!</span>"
|
||||
if("Nothing")
|
||||
return
|
||||
|
||||
return
|
||||
|
||||
|
||||
if(ishuman(user))
|
||||
if(stat == DEAD || status_flags & GODMODE)
|
||||
..()
|
||||
@@ -83,9 +75,7 @@
|
||||
DH.drone = src
|
||||
user.put_in_hands(DH)
|
||||
forceMove(DH)
|
||||
return
|
||||
|
||||
..()
|
||||
|
||||
|
||||
/mob/living/simple_animal/drone/attackby(obj/item/I, mob/user)
|
||||
|
||||
@@ -148,7 +148,7 @@
|
||||
PoolOrNew(/obj/effect/overlay/temp/guardian/phase/out, T)
|
||||
if(isliving(A))
|
||||
var/mob/living/L = A
|
||||
L.flash_eyes()
|
||||
L.flash_act()
|
||||
A.visible_message("<span class='danger'>[A] disappears in a flash of \
|
||||
light!</span>", "<span class='userdanger'>Your vision is obscured \
|
||||
by a flash of light!</span>")
|
||||
|
||||
@@ -256,12 +256,6 @@
|
||||
else if(target != null && prob(40))//No more pulling a mob forever and having a second player attack it, it can switch targets now if it finds a more suitable one
|
||||
FindTarget()
|
||||
|
||||
/mob/living/simple_animal/hostile/UnarmedAttack(atom/A)
|
||||
target = A
|
||||
if(dextrous && !is_type_in_typecache(A, environment_target_typecache) && !ismob(A))
|
||||
..()
|
||||
else
|
||||
AttackingTarget()
|
||||
|
||||
/mob/living/simple_animal/hostile/proc/AttackingTarget()
|
||||
target.attack_animal(src)
|
||||
|
||||
@@ -622,7 +622,7 @@ Difficulty: Very Hard
|
||||
if(isliving(target) && target != src)
|
||||
var/mob/living/L = target
|
||||
if(L.stat < DEAD)
|
||||
L.heal_overall_damage(heal_power, heal_power, 1)
|
||||
L.heal_overall_damage(heal_power, heal_power)
|
||||
PoolOrNew(/obj/effect/overlay/temp/heal, list(get_turf(target), "#80F5FF"))
|
||||
|
||||
/mob/living/simple_animal/hostile/lightgeist/Life()
|
||||
|
||||
@@ -101,10 +101,6 @@
|
||||
client.screen += client.void
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/updatehealth()
|
||||
..()
|
||||
health = Clamp(health, 0, maxHealth)
|
||||
|
||||
/mob/living/simple_animal/Life()
|
||||
if(..()) //alive
|
||||
if(!ckey)
|
||||
@@ -113,6 +109,10 @@
|
||||
handle_automated_speech()
|
||||
return 1
|
||||
|
||||
/mob/living/simple_animal/updatehealth()
|
||||
..()
|
||||
health = Clamp(health, 0, maxHealth)
|
||||
|
||||
/mob/living/simple_animal/update_stat()
|
||||
if(status_flags & GODMODE)
|
||||
return
|
||||
@@ -251,10 +251,6 @@
|
||||
if(icon_gib)
|
||||
new /obj/effect/overlay/temp/gib_animation/animal(loc, icon_gib)
|
||||
|
||||
/mob/living/simple_animal/blob_act(obj/effect/blob/B)
|
||||
adjustBruteLoss(20)
|
||||
return
|
||||
|
||||
/mob/living/simple_animal/say_quote(input)
|
||||
var/ending = copytext(input, length(input))
|
||||
if(speak_emote && speak_emote.len && ending != "?" && ending != "!")
|
||||
@@ -271,125 +267,7 @@
|
||||
act = "me"
|
||||
..(act, m_type, message)
|
||||
|
||||
/mob/living/simple_animal/attack_animal(mob/living/simple_animal/M)
|
||||
if(..())
|
||||
var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
|
||||
attack_threshold_check(damage,M.melee_damage_type)
|
||||
return 1
|
||||
|
||||
/mob/living/simple_animal/bullet_act(obj/item/projectile/Proj)
|
||||
if(!Proj)
|
||||
return
|
||||
apply_damage(Proj.damage, Proj.damage_type)
|
||||
Proj.on_hit(src)
|
||||
return 0
|
||||
|
||||
/mob/living/simple_animal/proc/adjustHealth(amount)
|
||||
if(status_flags & GODMODE)
|
||||
return 0
|
||||
bruteloss = Clamp(bruteloss + amount, 0, maxHealth)
|
||||
updatehealth()
|
||||
return amount
|
||||
|
||||
/mob/living/simple_animal/adjustBruteLoss(amount)
|
||||
if(damage_coeff[BRUTE])
|
||||
. = adjustHealth(amount * damage_coeff[BRUTE] * config.damage_multiplier)
|
||||
|
||||
/mob/living/simple_animal/adjustFireLoss(amount)
|
||||
if(damage_coeff[BURN])
|
||||
. = adjustHealth(amount * damage_coeff[BURN] * config.damage_multiplier)
|
||||
|
||||
/mob/living/simple_animal/adjustOxyLoss(amount)
|
||||
if(damage_coeff[OXY])
|
||||
. = adjustHealth(amount * damage_coeff[OXY] * config.damage_multiplier)
|
||||
|
||||
/mob/living/simple_animal/adjustToxLoss(amount)
|
||||
if(damage_coeff[TOX])
|
||||
. = adjustHealth(amount * damage_coeff[TOX] * config.damage_multiplier)
|
||||
|
||||
/mob/living/simple_animal/adjustCloneLoss(amount)
|
||||
if(damage_coeff[CLONE])
|
||||
. = adjustHealth(amount * damage_coeff[CLONE] * config.damage_multiplier)
|
||||
|
||||
/mob/living/simple_animal/adjustStaminaLoss(amount)
|
||||
return
|
||||
|
||||
/mob/living/simple_animal/attack_hand(mob/living/carbon/human/M)
|
||||
..()
|
||||
switch(M.a_intent)
|
||||
|
||||
if("help")
|
||||
if (health > 0)
|
||||
visible_message("<span class='notice'>[M] [response_help] [src].</span>")
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
|
||||
if("grab")
|
||||
grabbedby(M)
|
||||
|
||||
if("harm", "disarm")
|
||||
M.do_attack_animation(src)
|
||||
visible_message("<span class='danger'>[M] [response_harm] [src]!</span>")
|
||||
playsound(loc, attacked_sound, 25, 1, -1)
|
||||
attack_threshold_check(harm_intent_damage)
|
||||
add_logs(M, src, "attacked")
|
||||
updatehealth()
|
||||
return 1
|
||||
|
||||
/mob/living/simple_animal/attack_paw(mob/living/carbon/monkey/M)
|
||||
if(..()) //successful monkey bite.
|
||||
if(stat != DEAD)
|
||||
var/damage = rand(1, 3)
|
||||
attack_threshold_check(damage)
|
||||
return 1
|
||||
if (M.a_intent == "help")
|
||||
if (health > 0)
|
||||
visible_message("<span class='notice'>[M.name] [response_help] [src].</span>")
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
|
||||
return
|
||||
|
||||
/mob/living/simple_animal/attack_alien(mob/living/carbon/alien/humanoid/M)
|
||||
if(..()) //if harm or disarm intent.
|
||||
if(M.a_intent == "disarm")
|
||||
playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1)
|
||||
visible_message("<span class='danger'>[M] [response_disarm] [name]!</span>", \
|
||||
"<span class='userdanger'>[M] [response_disarm] [name]!</span>")
|
||||
add_logs(M, src, "disarmed")
|
||||
else
|
||||
var/damage = rand(15, 30)
|
||||
visible_message("<span class='danger'>[M] has slashed at [src]!</span>", \
|
||||
"<span class='userdanger'>[M] has slashed at [src]!</span>")
|
||||
playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1)
|
||||
attack_threshold_check(damage)
|
||||
add_logs(M, src, "attacked")
|
||||
return 1
|
||||
|
||||
/mob/living/simple_animal/attack_larva(mob/living/carbon/alien/larva/L)
|
||||
if(..()) //successful larva bite
|
||||
var/damage = rand(5, 10)
|
||||
if(stat != DEAD)
|
||||
L.amount_grown = min(L.amount_grown + damage, L.max_grown)
|
||||
attack_threshold_check(damage)
|
||||
return 1
|
||||
|
||||
/mob/living/simple_animal/attack_slime(mob/living/simple_animal/slime/M)
|
||||
if(..()) //successful slime attack
|
||||
var/damage = rand(15, 25)
|
||||
if(M.is_adult)
|
||||
damage = rand(20, 35)
|
||||
attack_threshold_check(damage)
|
||||
return 1
|
||||
|
||||
/mob/living/simple_animal/proc/attack_threshold_check(damage, damagetype = BRUTE)
|
||||
if(!damage_coeff[damagetype])
|
||||
damage = 0
|
||||
else
|
||||
damage *= damage_coeff[damagetype]
|
||||
|
||||
if(damage >= 0 && damage <= force_threshold)
|
||||
visible_message("<span class='warning'>[src] looks unharmed.</span>")
|
||||
else
|
||||
adjustHealth(damage * config.damage_multiplier)
|
||||
|
||||
/mob/living/simple_animal/movement_delay()
|
||||
. = ..()
|
||||
@@ -422,6 +300,7 @@
|
||||
visible_message("<span class='danger'>\The [src] stops moving...</span>")
|
||||
if(del_on_death)
|
||||
ghostize()
|
||||
stat = DEAD
|
||||
qdel(src)
|
||||
else
|
||||
health = 0
|
||||
@@ -431,28 +310,6 @@
|
||||
lying = 1
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/ex_act(severity, target)
|
||||
..()
|
||||
var/bomb_armor = getarmor(null, "bomb")
|
||||
switch (severity)
|
||||
if (1)
|
||||
if(prob(bomb_armor))
|
||||
adjustBruteLoss(500)
|
||||
else
|
||||
gib()
|
||||
return
|
||||
if (2)
|
||||
var/bloss = 60
|
||||
if(prob(bomb_armor))
|
||||
bloss = bloss / 1.5
|
||||
adjustBruteLoss(bloss)
|
||||
|
||||
if(3)
|
||||
var/bloss = 30
|
||||
if(prob(bomb_armor))
|
||||
bloss = bloss / 1.5
|
||||
adjustBruteLoss(bloss)
|
||||
|
||||
/mob/living/simple_animal/proc/CanAttack(atom/the_target)
|
||||
if(see_invisible < the_target.invisibility)
|
||||
return 0
|
||||
@@ -469,9 +326,6 @@
|
||||
/mob/living/simple_animal/handle_fire()
|
||||
return
|
||||
|
||||
/mob/living/simple_animal/update_fire()
|
||||
return
|
||||
|
||||
/mob/living/simple_animal/IgniteMob()
|
||||
return FALSE
|
||||
|
||||
@@ -599,14 +453,6 @@
|
||||
/mob/living/simple_animal/get_idcard()
|
||||
return access_card
|
||||
|
||||
//Dextrous simple mobs can use hands!
|
||||
/mob/living/simple_animal/create_mob_hud()
|
||||
if(client && !hud_used)
|
||||
if(dextrous)
|
||||
hud_used = new dextrous_hud_type(src, ui_style2icon(client.prefs.UI_style))
|
||||
else
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/OpenCraftingMenu()
|
||||
if(dextrous)
|
||||
handcrafting.ui_interact(src)
|
||||
@@ -656,13 +502,6 @@
|
||||
if(H)
|
||||
H.update_icon()
|
||||
|
||||
/mob/living/simple_animal/UnarmedAttack(atom/A, proximity)
|
||||
if(!dextrous)
|
||||
return ..()
|
||||
if(!ismob(A))
|
||||
A.attack_hand(src)
|
||||
update_inv_hands()
|
||||
|
||||
/mob/living/simple_animal/put_in_hands(obj/item/I)
|
||||
..()
|
||||
update_inv_hands()
|
||||
|
||||
@@ -14,4 +14,61 @@
|
||||
if(damage >= 0)
|
||||
ear_damage = damage
|
||||
if(deaf >= 0)
|
||||
ear_deaf = deaf
|
||||
ear_deaf = deaf
|
||||
|
||||
|
||||
//////////////////////////////STUN ////////////////////////////////////
|
||||
|
||||
/mob/living/proc/add_stun_absorption(key, duration, priority, message, self_message, examine_message)
|
||||
//adds a stun absorption with a key, a duration in deciseconds, its priority, and the messages it makes when you're stunned/examined, if any
|
||||
if(!islist(stun_absorption))
|
||||
stun_absorption = list()
|
||||
if(stun_absorption[key])
|
||||
stun_absorption[key]["end_time"] = world.time + duration
|
||||
stun_absorption[key]["priority"] = priority
|
||||
stun_absorption[key]["stuns_absorbed"] = 0
|
||||
else
|
||||
stun_absorption[key] = list("end_time" = world.time + duration, "priority" = priority, "stuns_absorbed" = 0, \
|
||||
"visible_message" = message, "self_message" = self_message, "examine_message" = examine_message)
|
||||
|
||||
/mob/living/Stun(amount, updating = 1, ignore_canstun = 0)
|
||||
if(!stat && islist(stun_absorption))
|
||||
var/priority_absorb_key
|
||||
var/highest_priority
|
||||
for(var/i in stun_absorption)
|
||||
if(stun_absorption[i]["end_time"] > world.time && (!priority_absorb_key || stun_absorption[i]["priority"] > highest_priority))
|
||||
priority_absorb_key = stun_absorption[i]
|
||||
highest_priority = stun_absorption[i]["priority"]
|
||||
if(priority_absorb_key)
|
||||
if(priority_absorb_key["visible_message"] || priority_absorb_key["self_message"])
|
||||
if(priority_absorb_key["visible_message"] && priority_absorb_key["self_message"])
|
||||
visible_message("<span class='warning'>[src][priority_absorb_key["visible_message"]]</span>", "<span class='boldwarning'>[priority_absorb_key["self_message"]]</span>")
|
||||
else if(priority_absorb_key["visible_message"])
|
||||
visible_message("<span class='warning'>[src][priority_absorb_key["visible_message"]]</span>")
|
||||
else if(priority_absorb_key["self_message"])
|
||||
src << "<span class='boldwarning'>[priority_absorb_key["self_message"]]</span>"
|
||||
priority_absorb_key["stuns_absorbed"] += amount
|
||||
return 0
|
||||
..()
|
||||
|
||||
///////////////////////////////// WEAKEN /////////////////////////////////////
|
||||
|
||||
/mob/living/Weaken(amount, updating = 1, ignore_canweaken = 0)
|
||||
if(!stat && islist(stun_absorption))
|
||||
var/priority_absorb_key
|
||||
var/highest_priority
|
||||
for(var/i in stun_absorption)
|
||||
if(stun_absorption[i]["end_time"] > world.time && (!priority_absorb_key || stun_absorption[i]["priority"] > highest_priority))
|
||||
priority_absorb_key = stun_absorption[i]
|
||||
highest_priority = priority_absorb_key["priority"]
|
||||
if(priority_absorb_key)
|
||||
if(priority_absorb_key["visible_message"] || priority_absorb_key["self_message"])
|
||||
if(priority_absorb_key["visible_message"] && priority_absorb_key["self_message"])
|
||||
visible_message("<span class='warning'>[src][priority_absorb_key["visible_message"]]</span>", "<span class='boldwarning'>[priority_absorb_key["self_message"]]</span>")
|
||||
else if(priority_absorb_key["visible_message"])
|
||||
visible_message("<span class='warning'>[src][priority_absorb_key["visible_message"]]</span>")
|
||||
else if(priority_absorb_key["self_message"])
|
||||
src << "<span class='boldwarning'>[priority_absorb_key["self_message"]]</span>"
|
||||
priority_absorb_key["stuns_absorbed"] += amount
|
||||
return 0
|
||||
..()
|
||||
@@ -413,14 +413,15 @@ It's fairly easy to fix if dealing with single letters but not so much with comp
|
||||
|
||||
/proc/item_heal_robotic(mob/living/carbon/human/H, mob/user, brute_heal, burn_heal)
|
||||
var/obj/item/bodypart/affecting = H.get_bodypart(check_zone(user.zone_selected))
|
||||
if(affecting && affecting.status == ORGAN_ROBOTIC)
|
||||
if(affecting && affecting.status == BODYPART_ROBOTIC)
|
||||
var/dam //changes repair text based on how much brute/burn was supplied
|
||||
if(brute_heal > burn_heal)
|
||||
dam = 1
|
||||
else
|
||||
dam = 0
|
||||
if((brute_heal > 0 && affecting.brute_dam > 0) || (burn_heal > 0 && affecting.burn_dam > 0))
|
||||
affecting.heal_damage(brute_heal,burn_heal,1)
|
||||
if(affecting.heal_damage(brute_heal, burn_heal, 1, 0))
|
||||
H.update_damage_overlays()
|
||||
user.visible_message("[user] has fixed some of the [dam ? "dents on" : "burnt wires in"] [H]'s [affecting].", "<span class='notice'>You fix some of the [dam ? "dents on" : "burnt wires in"] [H]'s [affecting].</span>")
|
||||
return 1 //successful heal
|
||||
else
|
||||
|
||||
@@ -245,7 +245,13 @@
|
||||
return
|
||||
|
||||
|
||||
|
||||
//////////////////////////////// HUSK DISABILITY ///////////////////////////:
|
||||
|
||||
/mob/proc/cure_husk()
|
||||
return
|
||||
|
||||
/mob/proc/become_husk()
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -7,19 +7,32 @@
|
||||
var/list/implants = list()
|
||||
var/list/int_organs = list()
|
||||
|
||||
|
||||
|
||||
if (tr_flags & TR_KEEPIMPLANTS)
|
||||
for(var/obj/item/weapon/implant/W in src)
|
||||
implants += W
|
||||
|
||||
if (tr_flags & TR_KEEPORGANS)
|
||||
for(var/obj/item/organ/I in internal_organs)
|
||||
for(var/X in internal_organs)
|
||||
var/obj/item/organ/I = X
|
||||
int_organs += I
|
||||
I.Remove(src, 1)
|
||||
|
||||
var/list/missing_bodyparts_zones = get_missing_limbs()
|
||||
|
||||
var/obj/item/cavity_object
|
||||
|
||||
var/obj/item/bodypart/chest/CH = get_bodypart("chest")
|
||||
if(CH.cavity_item)
|
||||
cavity_object = CH.cavity_item
|
||||
CH.cavity_item = null
|
||||
|
||||
if(tr_flags & TR_KEEPITEMS)
|
||||
for(var/obj/item/W in (src.contents-implants-int_organs))
|
||||
for(var/obj/item/W in (contents-implants-cavity_object))
|
||||
unEquip(W)
|
||||
|
||||
|
||||
//Make mob invisible and spawn animation
|
||||
notransform = 1
|
||||
canmove = 0
|
||||
@@ -82,17 +95,37 @@
|
||||
|
||||
//re-add organs to new mob
|
||||
if(tr_flags & TR_KEEPORGANS)
|
||||
for(var/obj/item/organ/I in O.internal_organs)
|
||||
qdel(I)
|
||||
for(var/X in O.internal_organs)
|
||||
qdel(X)
|
||||
|
||||
for(var/obj/item/organ/I in int_organs)
|
||||
for(var/X in int_organs)
|
||||
var/obj/item/organ/I = X
|
||||
I.Insert(O, 1)
|
||||
|
||||
var/obj/item/bodypart/chest/torso = O.get_bodypart("chest")
|
||||
if(cavity_object)
|
||||
torso.cavity_item = cavity_object //cavity item is given to the new chest
|
||||
cavity_object.loc = O
|
||||
|
||||
for(var/missing_zone in missing_bodyparts_zones)
|
||||
var/obj/item/bodypart/BP = O.get_bodypart(missing_zone)
|
||||
BP.drop_limb(1)
|
||||
if(!(tr_flags & TR_KEEPORGANS)) //we didn't already get rid of the organs of the newly spawned mob
|
||||
for(var/X in O.internal_organs)
|
||||
var/obj/item/organ/G = X
|
||||
if(BP.body_zone == check_zone(G.zone))
|
||||
if(mind && mind.changeling && istype(G, /obj/item/organ/brain))
|
||||
continue //so headless changelings don't lose their brain when transforming
|
||||
qdel(G) //we lose the organs in the missing limbs
|
||||
qdel(BP)
|
||||
|
||||
//transfer mind and delete old mob
|
||||
if(mind)
|
||||
mind.transfer_to(O)
|
||||
if(O.mind.changeling)
|
||||
O.mind.changeling.purchasedpowers += new /obj/effect/proc_holder/changeling/humanform(null)
|
||||
|
||||
|
||||
if (tr_flags & TR_DEFAULTMSG)
|
||||
O << "<B>You are now a monkey.</B>"
|
||||
|
||||
@@ -121,13 +154,23 @@
|
||||
implants += W
|
||||
|
||||
if (tr_flags & TR_KEEPORGANS)
|
||||
for(var/obj/item/organ/I in internal_organs)
|
||||
for(var/X in internal_organs)
|
||||
var/obj/item/organ/I = X
|
||||
int_organs += I
|
||||
I.Remove(src, 1)
|
||||
|
||||
var/list/missing_bodyparts_zones = get_missing_limbs()
|
||||
|
||||
var/obj/item/cavity_object
|
||||
|
||||
var/obj/item/bodypart/chest/CH = get_bodypart("chest")
|
||||
if(CH.cavity_item)
|
||||
cavity_object = CH.cavity_item
|
||||
CH.cavity_item = null
|
||||
|
||||
//now the rest
|
||||
if (tr_flags & TR_KEEPITEMS)
|
||||
for(var/obj/item/W in (src.contents-implants-int_organs))
|
||||
for(var/obj/item/W in (contents-implants-cavity_object))
|
||||
unEquip(W)
|
||||
if (client)
|
||||
client.screen -= W
|
||||
@@ -136,6 +179,8 @@
|
||||
W.dropped(src)
|
||||
W.layer = initial(W.layer)
|
||||
|
||||
|
||||
|
||||
//Make mob invisible and spawn animation
|
||||
notransform = 1
|
||||
canmove = 0
|
||||
@@ -202,12 +247,31 @@
|
||||
O.sec_hud_set_implants()
|
||||
|
||||
if(tr_flags & TR_KEEPORGANS)
|
||||
for(var/obj/item/organ/I in O.internal_organs)
|
||||
qdel(I)
|
||||
for(var/X in O.internal_organs)
|
||||
qdel(X)
|
||||
|
||||
for(var/obj/item/organ/I in int_organs)
|
||||
for(var/X in int_organs)
|
||||
var/obj/item/organ/I = X
|
||||
I.Insert(O, 1)
|
||||
|
||||
|
||||
var/obj/item/bodypart/chest/torso = get_bodypart("chest")
|
||||
if(cavity_object)
|
||||
torso.cavity_item = cavity_object //cavity item is given to the new chest
|
||||
cavity_object.loc = O
|
||||
|
||||
for(var/missing_zone in missing_bodyparts_zones)
|
||||
var/obj/item/bodypart/BP = O.get_bodypart(missing_zone)
|
||||
BP.drop_limb(1)
|
||||
if(!(tr_flags & TR_KEEPORGANS)) //we didn't already get rid of the organs of the newly spawned mob
|
||||
for(var/X in O.internal_organs)
|
||||
var/obj/item/organ/G = X
|
||||
if(BP.body_zone == check_zone(G.zone))
|
||||
if(mind && mind.changeling && istype(G, /obj/item/organ/brain))
|
||||
continue //so headless changelings don't lose their brain when transforming
|
||||
qdel(G) //we lose the organs in the missing limbs
|
||||
qdel(BP)
|
||||
|
||||
if(mind)
|
||||
mind.transfer_to(O)
|
||||
if(O.mind.changeling)
|
||||
|
||||
@@ -37,9 +37,15 @@
|
||||
/mob/proc/update_inv_head()
|
||||
return
|
||||
|
||||
/mob/proc/update_body()
|
||||
return
|
||||
|
||||
/mob/proc/update_hair()
|
||||
return
|
||||
|
||||
/mob/proc/update_fire()
|
||||
return
|
||||
|
||||
/mob/proc/update_inv_gloves()
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user