mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 04:30:44 +01:00
Merge branch 'master' of https://github.com/tgstation/tgstation into idigtilmyshoveltellsasecretsweartotheearththatiwillkeepitbrushoffthedirtandletmychangeofheartoccur
Conflicts: code/game/objects/structures/grille.dm icons/effects/beam.dmi
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,11 +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)
|
||||
|
||||
hand = 0
|
||||
update_damage_overlays()
|
||||
functions = list("nearbyscan","combat","shitcurity","chatter") // stop customize adding multiple copies of a function
|
||||
//job specific favours
|
||||
switch(myjob.title)
|
||||
@@ -424,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)
|
||||
@@ -491,28 +486,35 @@
|
||||
if(other_hand)
|
||||
if(other_hand.loc != src)
|
||||
other_hand = null
|
||||
if(hand)
|
||||
if(!l_hand)
|
||||
|
||||
var/obj/item/L = get_item_for_held_index(1) //just going to hardcode SNPCs to 2 hands, for now.
|
||||
var/obj/item/R = get_item_for_held_index(2) //they're just VERY assume-y about 2 hands.
|
||||
if(active_hand_index == 1)
|
||||
if(!L)
|
||||
main_hand = null
|
||||
if(r_hand)
|
||||
if(R)
|
||||
swap_hands()
|
||||
else
|
||||
if(!r_hand)
|
||||
if(!R)
|
||||
main_hand = null
|
||||
if(l_hand)
|
||||
if(L)
|
||||
swap_hands()
|
||||
|
||||
|
||||
/mob/living/carbon/human/interactive/proc/swap_hands()
|
||||
hand = !hand
|
||||
var/obj/item/T = other_hand
|
||||
main_hand = other_hand
|
||||
other_hand = T
|
||||
var/oindex = active_hand_index
|
||||
if(active_hand_index == 1)
|
||||
active_hand_index = 2
|
||||
else
|
||||
active_hand_index = 1
|
||||
main_hand = get_active_held_item()
|
||||
other_hand = get_item_for_held_index(oindex)
|
||||
update_hands = 1
|
||||
|
||||
/mob/living/carbon/human/interactive/proc/take_to_slot(obj/item/G, var/hands=0)
|
||||
var/list/slots = list ("left pocket" = slot_l_store,"right pocket" = slot_r_store,"left hand" = slot_l_hand,"right hand" = slot_r_hand)
|
||||
var/list/slots = list ("left pocket" = slot_l_store,"right pocket" = slot_r_store,"left hand" = slot_hands,"right hand" = slot_hands)
|
||||
if(hands)
|
||||
slots = list ("left hand" = slot_l_hand,"right hand" = slot_r_hand)
|
||||
slots = list ("left hand" = slot_hands,"right hand" = slot_hands)
|
||||
G.loc = src
|
||||
if(G.force && G.force > best_force)
|
||||
best_force = G.force
|
||||
@@ -520,7 +522,7 @@
|
||||
update_hands = 1
|
||||
|
||||
/mob/living/carbon/human/interactive/proc/insert_into_backpack()
|
||||
var/list/slots = list ("left pocket" = slot_l_store,"right pocket" = slot_r_store,"left hand" = slot_l_hand,"right hand" = slot_r_hand)
|
||||
var/list/slots = list ("left pocket" = slot_l_store,"right pocket" = slot_r_store,"left hand" = slot_hands,"right hand" = slot_hands)
|
||||
var/obj/item/I = get_item_by_slot(pick(slots))
|
||||
var/obj/item/weapon/storage/BP = get_item_by_slot(slot_back)
|
||||
if(back && BP && I)
|
||||
@@ -604,14 +606,16 @@
|
||||
D.open()
|
||||
|
||||
if(update_hands)
|
||||
var/obj/item/l_hand = get_item_for_held_index(1)
|
||||
var/obj/item/r_hand = get_item_for_held_index(2)
|
||||
if(l_hand || r_hand)
|
||||
if(l_hand)
|
||||
hand = 1
|
||||
active_hand_index = 1
|
||||
main_hand = l_hand
|
||||
if(r_hand)
|
||||
other_hand = r_hand
|
||||
else if(r_hand)
|
||||
hand = 0
|
||||
active_hand_index = 2
|
||||
main_hand = r_hand
|
||||
if(l_hand) //this technically shouldnt occur, but its a redundancy
|
||||
other_hand = l_hand
|
||||
@@ -659,12 +663,12 @@
|
||||
if(istype(TARGET, /obj/item/weapon))
|
||||
var/obj/item/weapon/W = TARGET
|
||||
if(W.force >= best_force || prob((FUZZY_CHANCE_LOW+FUZZY_CHANCE_HIGH)/2))
|
||||
if(!l_hand || !r_hand)
|
||||
if(!get_item_for_held_index(1) || !get_item_for_held_index(2))
|
||||
put_in_hands(W)
|
||||
else
|
||||
insert_into_backpack()
|
||||
else
|
||||
if(!l_hand || !r_hand)
|
||||
if(!get_item_for_held_index(1) || !get_item_for_held_index(2))
|
||||
put_in_hands(TARGET)
|
||||
else
|
||||
insert_into_backpack()
|
||||
|
||||
+286
-148
@@ -1,178 +1,287 @@
|
||||
//These procs handle putting s tuff in your hand. It's probably best to use these rather than setting l_hand = ...etc
|
||||
//These procs handle putting s tuff in your hands
|
||||
//as they handle all relevant stuff like adding it to the player's screen and updating their overlays.
|
||||
|
||||
//Returns the thing in our active hand
|
||||
/mob/proc/get_active_hand()
|
||||
if(hand)
|
||||
return l_hand
|
||||
else
|
||||
return r_hand
|
||||
//Returns the thing we're currently holding
|
||||
/mob/proc/get_active_held_item()
|
||||
return get_item_for_held_index(active_hand_index)
|
||||
|
||||
|
||||
//Returns the thing in our inactive hand
|
||||
/mob/proc/get_inactive_hand()
|
||||
if(hand)
|
||||
return r_hand
|
||||
//Finds the opposite limb for the active one (eg: upper left arm will find the item in upper right arm)
|
||||
//So we're treating each "pair" of limbs as a team, so "both" refers to them
|
||||
/mob/proc/get_inactive_held_item()
|
||||
return get_item_for_held_index(get_inactive_hand_index())
|
||||
|
||||
|
||||
//Finds the opposite index for the active one (eg: upper left arm will find the item in upper right arm)
|
||||
//So we're treating each "pair" of limbs as a team, so "both" refers to them
|
||||
/mob/proc/get_inactive_hand_index()
|
||||
var/other_hand = 0
|
||||
if(!(active_hand_index % 2))
|
||||
other_hand = active_hand_index-1 //finding the matching "left" limb
|
||||
else
|
||||
return l_hand
|
||||
other_hand = active_hand_index+1 //finding the matching "right" limb
|
||||
if(other_hand < 0 || other_hand > held_items.len)
|
||||
other_hand = 0
|
||||
return other_hand
|
||||
|
||||
|
||||
/mob/proc/get_item_for_held_index(i)
|
||||
if(i > 0 && i <= held_items.len)
|
||||
return held_items[i]
|
||||
return FALSE
|
||||
|
||||
|
||||
//Odd = left. Even = right
|
||||
/mob/proc/held_index_to_dir(i)
|
||||
if(!(i % 2))
|
||||
return "r"
|
||||
return "l"
|
||||
|
||||
|
||||
//Check we have an organ for this hand slot (Dismemberment), Only relevant for humans
|
||||
/mob/proc/has_hand_for_held_index(i)
|
||||
return TRUE
|
||||
|
||||
|
||||
//Check we have an organ for our active hand slot (Dismemberment),Only relevant for humans
|
||||
/mob/proc/has_active_hand()
|
||||
return has_hand_for_held_index(active_hand_index)
|
||||
|
||||
|
||||
//Finds the first available (null) index OR all available (null) indexes in held_items based on a side.
|
||||
//Lefts: 1, 3, 5, 7...
|
||||
//Rights:2, 4, 6, 8...
|
||||
/mob/proc/get_empty_held_index_for_side(side = "left", all = FALSE)
|
||||
var/start = 0
|
||||
var/static/list/lefts = list("l" = TRUE,"L" = TRUE,"LEFT" = TRUE,"left" = TRUE)
|
||||
var/static/list/rights = list("r" = TRUE,"R" = TRUE,"RIGHT" = TRUE,"right" = TRUE) //"to remain silent"
|
||||
if(lefts[side])
|
||||
start = 1
|
||||
else if(rights[side])
|
||||
start = 2
|
||||
if(!start)
|
||||
return FALSE
|
||||
var/list/empty_indexes
|
||||
for(var/i in start to held_items.len step 2)
|
||||
if(!held_items[i])
|
||||
if(!all)
|
||||
return i
|
||||
if(!empty_indexes)
|
||||
empty_indexes = list()
|
||||
empty_indexes += i
|
||||
return empty_indexes
|
||||
|
||||
|
||||
//Same as the above, but returns the first or ALL held *ITEMS* for the side
|
||||
/mob/proc/get_held_items_for_side(side = "left", all = FALSE)
|
||||
var/start = 0
|
||||
var/static/list/lefts = list("l" = TRUE,"L" = TRUE,"LEFT" = TRUE,"left" = TRUE)
|
||||
var/static/list/rights = list("r" = TRUE,"R" = TRUE,"RIGHT" = TRUE,"right" = TRUE) //"to remain silent"
|
||||
if(lefts[side])
|
||||
start = 1
|
||||
else if(rights[side])
|
||||
start = 2
|
||||
if(!start)
|
||||
return FALSE
|
||||
var/list/holding_items
|
||||
for(var/i in start to held_items.len step 2)
|
||||
var/obj/item/I = held_items[i]
|
||||
if(I)
|
||||
if(!all)
|
||||
return I
|
||||
if(!holding_items)
|
||||
holding_items = list()
|
||||
holding_items += I
|
||||
return holding_items
|
||||
|
||||
|
||||
/mob/proc/get_empty_held_indexes()
|
||||
var/list/L
|
||||
for(var/i in 1 to held_items.len)
|
||||
if(!held_items[i])
|
||||
if(!L)
|
||||
L = list()
|
||||
L += i
|
||||
return L
|
||||
|
||||
/mob/proc/get_held_index_of_item(obj/item/I)
|
||||
return held_items.Find(I)
|
||||
|
||||
|
||||
//Sad that this will cause some overhead, but the alias seems necessary
|
||||
//*I* may be happy with a million and one references to "indexes" but others won't be
|
||||
/mob/proc/is_holding(obj/item/I)
|
||||
return get_held_index_of_item(I)
|
||||
|
||||
|
||||
//Checks if we're holding an item of type: typepath
|
||||
/mob/proc/is_holding_item_of_type(typepath)
|
||||
for(var/obj/item/I in held_items)
|
||||
if(istype(I, typepath))
|
||||
return I
|
||||
return FALSE
|
||||
|
||||
|
||||
//To appropriately fluff things like "they are holding [I] in their [get_held_index_name(get_held_index_of_item(I))]"
|
||||
//Can be overriden to pass off the fluff to something else (eg: science allowing people to add extra robotic limbs, and having this proc react to that
|
||||
// with say "they are holding [I] in their Nanotrasen Brand Utility Arm - Right Edition" or w/e
|
||||
/mob/proc/get_held_index_name(i)
|
||||
var/list/hand = list()
|
||||
if(i > 2)
|
||||
hand += "upper "
|
||||
var/num = 0
|
||||
if(!(i % 2))
|
||||
num = i-2
|
||||
hand += "right hand"
|
||||
else
|
||||
num = i-1
|
||||
hand += "left hand"
|
||||
num -= (num*0.5)
|
||||
if(num > 1) //"upper left hand #1" seems weird, but "upper left hand #2" is A-ok
|
||||
hand += " #[num]"
|
||||
return hand.Join()
|
||||
|
||||
|
||||
|
||||
//Returns if a certain item can be equipped to a certain slot.
|
||||
// Currently invalid for two-handed items - call obj/item/mob_can_equip() instead.
|
||||
/mob/proc/can_equip(obj/item/I, slot, disable_warning = 0)
|
||||
return 0
|
||||
|
||||
//Puts the item into your l_hand if possible and calls all necessary triggers/updates. returns 1 on success.
|
||||
/mob/proc/put_in_l_hand(obj/item/W)
|
||||
if(!put_in_hand_check(W))
|
||||
return 0
|
||||
if(!has_left_hand())
|
||||
return 0
|
||||
if(!l_hand)
|
||||
W.loc = src //TODO: move to equipped?
|
||||
l_hand = W
|
||||
W.layer = ABOVE_HUD_LAYER //TODO: move to equipped?
|
||||
W.equipped(src,slot_l_hand)
|
||||
if(W.pulledby)
|
||||
W.pulledby.stop_pulling()
|
||||
update_inv_l_hand()
|
||||
W.pixel_x = initial(W.pixel_x)
|
||||
W.pixel_y = initial(W.pixel_y)
|
||||
return 1
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
|
||||
//Puts the item into your r_hand if possible and calls all necessary triggers/updates. returns 1 on success.
|
||||
/mob/proc/put_in_r_hand(obj/item/W)
|
||||
if(!put_in_hand_check(W))
|
||||
return 0
|
||||
if(!has_right_hand())
|
||||
return 0
|
||||
if(!r_hand)
|
||||
W.loc = src
|
||||
r_hand = W
|
||||
W.layer = ABOVE_HUD_LAYER
|
||||
W.equipped(src,slot_r_hand)
|
||||
if(W.pulledby)
|
||||
W.pulledby.stop_pulling()
|
||||
update_inv_r_hand()
|
||||
W.pixel_x = initial(W.pixel_x)
|
||||
W.pixel_y = initial(W.pixel_y)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/mob/proc/put_in_hand_check(obj/item/W)
|
||||
if(lying && !(W.flags&ABSTRACT))
|
||||
return 0
|
||||
if(!istype(W))
|
||||
return 0
|
||||
return 1
|
||||
|
||||
//Puts the item into our active hand if possible. returns 1 on success.
|
||||
/mob/proc/put_in_active_hand(obj/item/W)
|
||||
if(hand)
|
||||
return put_in_l_hand(W)
|
||||
else
|
||||
return put_in_r_hand(W)
|
||||
/mob/proc/put_in_hand(obj/item/I, hand_index)
|
||||
if(!put_in_hand_check(I))
|
||||
return FALSE
|
||||
if(!has_hand_for_held_index(hand_index))
|
||||
return FALSE
|
||||
var/obj/item/curr = held_items[hand_index]
|
||||
if(!curr)
|
||||
I.loc = src
|
||||
held_items[hand_index] = I
|
||||
I.layer = ABOVE_HUD_LAYER
|
||||
I.equipped(src, slot_hands)
|
||||
if(I.pulledby)
|
||||
I.pulledby.stop_pulling()
|
||||
update_inv_hands()
|
||||
I.pixel_x = initial(I.pixel_x)
|
||||
I.pixel_y = initial(I.pixel_y)
|
||||
return hand_index || TRUE
|
||||
return FALSE
|
||||
|
||||
|
||||
//Puts the item into our inactive hand if possible. returns 1 on success.
|
||||
/mob/proc/put_in_inactive_hand(obj/item/W)
|
||||
if(hand)
|
||||
return put_in_r_hand(W)
|
||||
else
|
||||
return put_in_l_hand(W)
|
||||
//Puts the item into the first available left hand if possible and calls all necessary triggers/updates. returns 1 on success.
|
||||
/mob/proc/put_in_l_hand(obj/item/I)
|
||||
return put_in_hand(I, get_empty_held_index_for_side("l"))
|
||||
|
||||
|
||||
//Puts the item our active hand if possible. Failing that it tries our inactive hand. Returns 1 on success.
|
||||
//If both fail it drops it on the floor and returns 0.
|
||||
//Puts the item into the first available right hand if possible and calls all necessary triggers/updates. returns 1 on success.
|
||||
/mob/proc/put_in_r_hand(obj/item/I)
|
||||
return put_in_hand(I, get_empty_held_index_for_side("r"))
|
||||
|
||||
|
||||
/mob/proc/put_in_hand_check(obj/item/I)
|
||||
if(lying && !(I.flags&ABSTRACT))
|
||||
return FALSE
|
||||
if(!istype(I))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
|
||||
//Puts the item into our active hand if possible. returns TRUE on success.
|
||||
/mob/proc/put_in_active_hand(obj/item/I)
|
||||
return put_in_hand(I, active_hand_index)
|
||||
|
||||
|
||||
//Puts the item into our inactive hand if possible, returns TRUE on success
|
||||
/mob/proc/put_in_inactive_hand(obj/item/I)
|
||||
return put_in_hand(I, get_inactive_hand_index())
|
||||
|
||||
|
||||
//Puts the item our active hand if possible. Failing that it tries our inactive hand. Returns TRUE on success.
|
||||
//If both fail it drops it on the floor and returns FALSE.
|
||||
//This is probably the main one you need to know :)
|
||||
/mob/proc/put_in_hands(obj/item/W)
|
||||
if(!W)
|
||||
return 0
|
||||
if(put_in_active_hand(W))
|
||||
return 1
|
||||
else if(put_in_inactive_hand(W))
|
||||
return 1
|
||||
else
|
||||
W.loc = get_turf(src)
|
||||
W.layer = initial(W.layer)
|
||||
W.dropped(src)
|
||||
return 0
|
||||
/mob/proc/put_in_hands(obj/item/I, del_on_fail = FALSE)
|
||||
if(!I)
|
||||
return FALSE
|
||||
var/hand = get_empty_held_index_for_side("l")
|
||||
if(!hand)
|
||||
hand = get_empty_held_index_for_side("r")
|
||||
if(hand)
|
||||
if(put_in_hand(I, hand))
|
||||
return TRUE
|
||||
if(del_on_fail)
|
||||
qdel(I)
|
||||
return FALSE
|
||||
I.forceMove(get_turf(src))
|
||||
I.layer = initial(I.layer)
|
||||
I.dropped(src)
|
||||
return FALSE
|
||||
|
||||
|
||||
/mob/proc/put_in_hands_or_del(obj/item/I)
|
||||
return put_in_hands(I, TRUE)
|
||||
|
||||
|
||||
/mob/proc/drop_item_v() //this is dumb.
|
||||
if(stat == CONSCIOUS && isturf(loc))
|
||||
return drop_item()
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
|
||||
//Drops the item in our left hand
|
||||
/mob/proc/drop_l_hand()
|
||||
/mob/proc/drop_all_held_items()
|
||||
if(!loc || !loc.allow_drop())
|
||||
return
|
||||
return unEquip(l_hand) //All needed checks are in unEquip
|
||||
|
||||
|
||||
//Drops the item in our right hand
|
||||
/mob/proc/drop_r_hand()
|
||||
if(!loc || !loc.allow_drop())
|
||||
return
|
||||
return unEquip(r_hand)
|
||||
|
||||
for(var/obj/item/I in held_items)
|
||||
unEquip(I)
|
||||
|
||||
//Drops the item in our active hand.
|
||||
/mob/proc/drop_item()
|
||||
if(hand)
|
||||
return drop_l_hand()
|
||||
else
|
||||
return drop_r_hand()
|
||||
if(!loc || !loc.allow_drop())
|
||||
return
|
||||
var/obj/item/held = get_active_held_item()
|
||||
return unEquip(held)
|
||||
|
||||
|
||||
//Here lie drop_from_inventory and before_item_take, already forgotten and not missed.
|
||||
|
||||
|
||||
/mob/proc/canUnEquip(obj/item/I, force)
|
||||
if(!I)
|
||||
return 1
|
||||
return TRUE
|
||||
if((I.flags & NODROP) && !force)
|
||||
return 0
|
||||
return 1
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/mob/proc/unEquip(obj/item/I, force) //Force overrides NODROP for things like wizarditis and admin undress.
|
||||
if(!I) //If there's nothing to drop, the drop is automatically succesfull. If(unEquip) should generally be used to check for NODROP.
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
if((I.flags & NODROP) && !force)
|
||||
return 0
|
||||
|
||||
if(I == r_hand)
|
||||
r_hand = null
|
||||
update_inv_r_hand()
|
||||
else if(I == l_hand)
|
||||
l_hand = null
|
||||
update_inv_l_hand()
|
||||
return FALSE
|
||||
|
||||
var/hand_index = get_held_index_of_item(I)
|
||||
if(hand_index)
|
||||
held_items[hand_index] = null
|
||||
update_inv_hands()
|
||||
if(I)
|
||||
if(client)
|
||||
client.screen -= I
|
||||
I.loc = loc
|
||||
I.layer = initial(I.layer)
|
||||
I.forceMove(loc)
|
||||
I.dropped(src)
|
||||
if(I)
|
||||
I.layer = initial(I.layer)
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
|
||||
//Attemps to remove an object on a mob. Will not move it to another area or such, just removes from the mob.
|
||||
/mob/proc/remove_from_mob(var/obj/O)
|
||||
unEquip(O)
|
||||
O.screen_loc = null
|
||||
return 1
|
||||
/mob/proc/remove_from_mob(var/obj/item/I)
|
||||
unEquip(I)
|
||||
I.screen_loc = null
|
||||
return TRUE
|
||||
|
||||
|
||||
//Outdated but still in use apparently. This should at least be a human proc.
|
||||
//Daily reminder to murder this - Remie.
|
||||
/mob/proc/get_equipped_items()
|
||||
var/list/items = new/list()
|
||||
var/list/items = list()
|
||||
|
||||
if(hasvar(src,"back"))
|
||||
if(src:back)
|
||||
@@ -204,48 +313,34 @@
|
||||
if(hasvar(src,"wear_suit"))
|
||||
if(src:wear_suit)
|
||||
items += src:wear_suit
|
||||
/* if(hasvar(src,"w_radio"))
|
||||
if(src:w_radio)
|
||||
items += src:w_radio commenting this out since headsets go on your ears now PLEASE DON'T BE MAD KEELIN */
|
||||
if(hasvar(src,"w_uniform"))
|
||||
if(src:w_uniform)
|
||||
items += src:w_uniform
|
||||
|
||||
/* if(hasvar(src,"l_hand"))
|
||||
if(src:l_hand)
|
||||
items += src:l_hand
|
||||
if(hasvar(src,"r_hand"))
|
||||
if(src:r_hand)
|
||||
items += src:r_hand*/
|
||||
|
||||
return items
|
||||
|
||||
|
||||
/obj/item/proc/equip_to_best_slot(var/mob/M)
|
||||
if(src != M.get_active_hand())
|
||||
if(src != M.get_active_held_item())
|
||||
M << "<span class='warning'>You are not holding anything to equip!</span>"
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
if(M.equip_to_appropriate_slot(src))
|
||||
if(M.hand)
|
||||
M.update_inv_l_hand()
|
||||
else
|
||||
M.update_inv_r_hand()
|
||||
return 1
|
||||
M.update_inv_hands()
|
||||
return TRUE
|
||||
|
||||
if(M.s_active && M.s_active.can_be_inserted(src,1)) //if storage active insert there
|
||||
M.s_active.handle_item_insertion(src)
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
var/obj/item/weapon/storage/S = M.get_inactive_hand()
|
||||
var/obj/item/weapon/storage/S = M.get_inactive_held_item()
|
||||
if(istype(S) && S.can_be_inserted(src,1)) //see if we have box in other hand
|
||||
S.handle_item_insertion(src)
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
S = M.get_item_by_slot(slot_belt)
|
||||
if(istype(S) && S.can_be_inserted(src,1)) //else we put in belt
|
||||
S.handle_item_insertion(src)
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
S = M.get_item_by_slot(slot_generic_dextrous_storage) //else we put in whatever is in drone storage
|
||||
if(istype(S) && S.can_be_inserted(src,1))
|
||||
@@ -255,17 +350,17 @@
|
||||
if(istype(S) && S.can_be_inserted(src,1))
|
||||
S.handle_item_insertion(src)
|
||||
playsound(src.loc, "rustle", 50, 1, -5)
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
M << "<span class='warning'>You are unable to equip that!</span>"
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
|
||||
/mob/verb/quick_equip()
|
||||
set name = "quick-equip"
|
||||
set hidden = 1
|
||||
|
||||
var/obj/item/I = get_active_hand()
|
||||
var/obj/item/I = get_active_held_item()
|
||||
if (I)
|
||||
I.equip_to_best_slot(src)
|
||||
|
||||
@@ -274,4 +369,47 @@
|
||||
return slot_back
|
||||
|
||||
/mob/proc/getBeltSlot()
|
||||
return slot_belt
|
||||
return slot_belt
|
||||
|
||||
|
||||
|
||||
//Inventory.dm is -kind of- an ok place for this I guess
|
||||
|
||||
//This is NOT for dismemberment, as the user still technically has 2 "hands"
|
||||
//This is for multi-handed mobs, such as a human with a third limb installed
|
||||
//This is a very rare proc to call (besides admin fuckery) so
|
||||
//any cost it has isn't a worry
|
||||
/mob/proc/change_number_of_hands(amt)
|
||||
if(amt < held_items.len)
|
||||
for(var/i in held_items.len to amt step -1)
|
||||
unEquip(held_items[i])
|
||||
held_items.len = amt
|
||||
|
||||
if(hud_used)
|
||||
var/style
|
||||
if(client && client.prefs)
|
||||
style = ui_style2icon(client.prefs.UI_style)
|
||||
hud_used.build_hand_slots(style)
|
||||
|
||||
|
||||
/mob/living/carbon/human/change_number_of_hands(amt)
|
||||
var/old_limbs = held_items.len
|
||||
if(amt < old_limbs)
|
||||
for(var/i in hand_bodyparts.len to amt step -1)
|
||||
var/obj/item/bodypart/BP = hand_bodyparts[i]
|
||||
BP.dismember()
|
||||
hand_bodyparts[i] = null
|
||||
hand_bodyparts.len = amt
|
||||
else if(amt > old_limbs)
|
||||
hand_bodyparts.len = amt
|
||||
for(var/i in old_limbs+1 to amt)
|
||||
var/path = /obj/item/bodypart/l_arm
|
||||
if(!(i % 2))
|
||||
path = /obj/item/bodypart/r_arm
|
||||
|
||||
var/obj/item/bodypart/BP = new path ()
|
||||
BP.owner = src
|
||||
BP.held_index = i
|
||||
bodyparts += BP
|
||||
hand_bodyparts[i] = BP
|
||||
..() //Don't redraw hands until we have organs for them
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
/mob/living/proc/phaseout(obj/effect/decal/cleanable/B)
|
||||
if(iscarbon(src))
|
||||
var/mob/living/carbon/C = src
|
||||
if(C.l_hand || C.r_hand)
|
||||
for(var/obj/item/I in C.held_items)
|
||||
//TODO make it toggleable to either forcedrop the items, or deny
|
||||
//entry when holding them
|
||||
// literally only an option for carbons though
|
||||
|
||||
+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,88 +15,34 @@
|
||||
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
|
||||
|
||||
|
||||
/mob/living/carbon/alien/humanoid/show_inv(mob/user)
|
||||
user.set_machine(src)
|
||||
var/dat = {"
|
||||
var/list/dat = list()
|
||||
dat += {"
|
||||
<HR>
|
||||
<B><FONT size=3>[name]</FONT></B>
|
||||
<HR>
|
||||
<BR><B>Left Hand:</B> <A href='?src=\ref[src];item=[slot_l_hand]'> [l_hand ? l_hand : "Nothing"]</A>
|
||||
<BR><B>Right Hand:</B> <A href='?src=\ref[src];item=[slot_r_hand]'> [r_hand ? r_hand : "Nothing"]</A>
|
||||
<BR><A href='?src=\ref[src];pouches=1'>Empty Pouches</A>"}
|
||||
<HR>"}
|
||||
for(var/i in 1 to held_items.len)
|
||||
var/obj/item/I = get_item_for_held_index(i)
|
||||
dat += "<BR><B>[get_held_index_name(i)]:</B><A href='?src=\ref[src];item=[slot_hands];hand_index=[i]'>[(I && !(I.flags & ABSTRACT)) ? I : "<font color=grey>Empty</font>"]</a>"
|
||||
dat += "<BR><A href='?src=\ref[src];pouches=1'>Empty Pouches</A>"
|
||||
|
||||
if(handcuffed)
|
||||
dat += "<BR><A href='?src=\ref[src];item=[slot_handcuffed]'>Handcuffed</A>"
|
||||
@@ -107,7 +53,7 @@
|
||||
<BR>
|
||||
<BR><A href='?src=\ref[user];mach_close=mob\ref[src]'>Close</A>
|
||||
"}
|
||||
user << browse(dat, "window=mob\ref[src];size=325x500")
|
||||
user << browse(dat.Join(), "window=mob\ref[src];size=325x500")
|
||||
onclose(user, "mob\ref[src]")
|
||||
|
||||
|
||||
@@ -148,15 +94,11 @@
|
||||
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
|
||||
|
||||
/mob/living/carbon/alien/humanoid/alien_evolve(mob/living/carbon/alien/humanoid/new_xeno)
|
||||
drop_l_hand()
|
||||
drop_r_hand()
|
||||
drop_all_held_items()
|
||||
for(var/atom/movable/A in stomach_contents)
|
||||
stomach_contents.Remove(A)
|
||||
new_xeno.stomach_contents.Add(A)
|
||||
@@ -178,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()
|
||||
|
||||
@@ -68,27 +68,26 @@
|
||||
apply_overlay(HANDCUFF_LAYER)
|
||||
|
||||
//Royals have bigger sprites, so inhand things must be handled differently.
|
||||
/mob/living/carbon/alien/humanoid/royal/update_inv_r_hand()
|
||||
/mob/living/carbon/alien/humanoid/royal/update_inv_hands()
|
||||
..()
|
||||
remove_overlay(R_HAND_LAYER)
|
||||
if(r_hand)
|
||||
var/itm_state = r_hand.item_state
|
||||
if(!itm_state)
|
||||
itm_state = r_hand.icon_state
|
||||
remove_overlay(HANDS_LAYER)
|
||||
var/list/hands = list()
|
||||
|
||||
var/image/I = image("icon" = alt_inhands_file , "icon_state"="[itm_state][caste]_r", "layer"=-R_HAND_LAYER)
|
||||
overlays_standing[R_HAND_LAYER] = I
|
||||
|
||||
apply_overlay(R_HAND_LAYER)
|
||||
|
||||
/mob/living/carbon/alien/humanoid/royal/update_inv_l_hand()
|
||||
..()
|
||||
remove_overlay(L_HAND_LAYER)
|
||||
var/obj/item/l_hand = get_item_for_held_index(1)
|
||||
if(l_hand)
|
||||
var/itm_state = l_hand.item_state
|
||||
if(!itm_state)
|
||||
itm_state = l_hand.icon_state
|
||||
var/image/I = image("icon" = alt_inhands_file , "icon_state"="[itm_state][caste]_l", "layer"=-HANDS_LAYER)
|
||||
hands += I
|
||||
|
||||
var/image/I = image("icon" = alt_inhands_file , "icon_state"="[itm_state][caste]_l", "layer"=-L_HAND_LAYER)
|
||||
overlays_standing[L_HAND_LAYER] = I
|
||||
apply_overlay(L_HAND_LAYER)
|
||||
var/obj/item/r_hand = get_item_for_held_index(2)
|
||||
if(r_hand)
|
||||
var/itm_state = r_hand.item_state
|
||||
if(!itm_state)
|
||||
itm_state = r_hand.icon_state
|
||||
var/image/I = image("icon" = alt_inhands_file , "icon_state"="[itm_state][caste]_r", "layer"=-HANDS_LAYER)
|
||||
hands += I
|
||||
|
||||
overlays_standing[HANDS_LAYER] = hands
|
||||
apply_overlay(HANDS_LAYER)
|
||||
@@ -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)
|
||||
@@ -25,19 +26,12 @@
|
||||
audible_message("<span class='warning'>You hear something rumbling inside [src]'s stomach...</span>", \
|
||||
"<span class='warning'>You hear something rumbling.</span>", 4,\
|
||||
"<span class='userdanger'>Something is rumbling inside your stomach!</span>")
|
||||
var/obj/item/I = user.get_active_hand()
|
||||
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,138 +43,65 @@
|
||||
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
|
||||
|
||||
|
||||
/mob/living/carbon/swap_hand()
|
||||
var/obj/item/item_in_hand = src.get_active_hand()
|
||||
var/obj/item/item_in_hand = src.get_active_held_item()
|
||||
if(item_in_hand) //this segment checks if the item in your hand is twohanded.
|
||||
if(istype(item_in_hand,/obj/item/weapon/twohanded))
|
||||
if(item_in_hand:wielded == 1)
|
||||
usr << "<span class='warning'>Your other hand is too busy holding the [item_in_hand.name]</span>"
|
||||
return
|
||||
src.hand = !( src.hand )
|
||||
if(hud_used && hud_used.inv_slots[slot_l_hand] && hud_used.inv_slots[slot_r_hand])
|
||||
var/oindex = active_hand_index
|
||||
active_hand_index = held_index
|
||||
if(hud_used)
|
||||
var/obj/screen/inventory/hand/H
|
||||
H = hud_used.inv_slots[slot_l_hand]
|
||||
H.update_icon()
|
||||
H = hud_used.inv_slots[slot_r_hand]
|
||||
H.update_icon()
|
||||
/*if (!( src.hand ))
|
||||
src.hands.setDir(NORTH)
|
||||
else
|
||||
src.hands.setDir(SOUTH)*/
|
||||
return
|
||||
H = hud_used.hand_slots["[oindex]"]
|
||||
if(H)
|
||||
H.update_icon()
|
||||
H = hud_used.hand_slots["[held_index]"]
|
||||
if(H)
|
||||
H.update_icon()
|
||||
|
||||
/mob/living/carbon/activate_hand(selhand) //0 or "r" or "right" for right hand; 1 or "l" or "left" for left hand.
|
||||
|
||||
/mob/living/carbon/activate_hand(selhand) //l/r OR 1-held_items.len
|
||||
if(!selhand)
|
||||
selhand = (active_hand_index % held_items.len)+1
|
||||
|
||||
if(istext(selhand))
|
||||
selhand = lowertext(selhand)
|
||||
|
||||
if(selhand == "right" || selhand == "r")
|
||||
selhand = 0
|
||||
selhand = 2
|
||||
if(selhand == "left" || selhand == "l")
|
||||
selhand = 1
|
||||
|
||||
if(selhand != src.hand)
|
||||
swap_hand()
|
||||
if(selhand != active_hand_index)
|
||||
swap_hand(selhand)
|
||||
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
|
||||
@@ -215,7 +136,7 @@
|
||||
return
|
||||
|
||||
var/atom/movable/thrown_thing
|
||||
var/obj/item/I = src.get_active_hand()
|
||||
var/obj/item/I = src.get_active_held_item()
|
||||
|
||||
if(!I)
|
||||
if(pulling && isliving(pulling) && grab_state >= GRAB_AGGRESSIVE)
|
||||
@@ -253,9 +174,11 @@
|
||||
<B><FONT size=3>[name]</FONT></B>
|
||||
<HR>
|
||||
<BR><B>Head:</B> <A href='?src=\ref[src];item=[slot_head]'> [(head && !(head.flags&ABSTRACT)) ? head : "Nothing"]</A>
|
||||
<BR><B>Mask:</B> <A href='?src=\ref[src];item=[slot_wear_mask]'> [(wear_mask && !(wear_mask.flags&ABSTRACT)) ? wear_mask : "Nothing"]</A>
|
||||
<BR><B>Left Hand:</B> <A href='?src=\ref[src];item=[slot_l_hand]'> [(l_hand && !(l_hand.flags&ABSTRACT)) ? l_hand : "Nothing"]</A>
|
||||
<BR><B>Right Hand:</B> <A href='?src=\ref[src];item=[slot_r_hand]'> [(r_hand && !(r_hand.flags&ABSTRACT)) ? r_hand : "Nothing"]</A>"}
|
||||
<BR><B>Mask:</B> <A href='?src=\ref[src];item=[slot_wear_mask]'> [(wear_mask && !(wear_mask.flags&ABSTRACT)) ? wear_mask : "Nothing"]</A>"}
|
||||
|
||||
for(var/i in 1 to held_items.len)
|
||||
var/obj/item/I = get_item_for_held_index(i)
|
||||
dat += "<BR><B>[get_held_index_name(i)]:</B></td><td><A href='?src=\ref[src];item=[slot_hands];hand_index=[i]'>[(I && !(I.flags & ABSTRACT)) ? I : "Nothing"]</a>"
|
||||
|
||||
dat += "<BR><B>Back:</B> <A href='?src=\ref[src];item=[slot_back]'>[back ? back : "Nothing"]</A>"
|
||||
|
||||
@@ -303,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
|
||||
@@ -462,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
|
||||
@@ -494,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)
|
||||
@@ -533,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)
|
||||
@@ -573,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
|
||||
@@ -733,8 +656,7 @@
|
||||
//called when we get cuffed/uncuffed
|
||||
/mob/living/carbon/proc/update_handcuffed()
|
||||
if(handcuffed)
|
||||
drop_r_hand()
|
||||
drop_l_hand()
|
||||
drop_all_held_items()
|
||||
stop_pulling()
|
||||
throw_alert("handcuffed", /obj/screen/alert/restrained/handcuffed, new_master = src.handcuffed)
|
||||
else
|
||||
@@ -752,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)
|
||||
@@ -769,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)
|
||||
@@ -779,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)
|
||||
@@ -795,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,6 +1,22 @@
|
||||
|
||||
/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_hand()) //empty active hand and we're in throw mode
|
||||
if(in_throw_mode && !get_active_held_item()) //empty active hand and we're in throw mode
|
||||
if(canmove && !restrained())
|
||||
if(istype(AM, /obj/item))
|
||||
var/obj/item/I = AM
|
||||
@@ -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,63 +2,80 @@
|
||||
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)
|
||||
msg += "It has \icon[src.wear_mask] \a [src.wear_mask] on its face.\n"
|
||||
if (l_hand)
|
||||
msg += "It has \icon[src.l_hand] \a [src.l_hand] in its left hand.\n"
|
||||
if (r_hand)
|
||||
msg += "It has \icon[src.r_hand] \a [src.r_hand] in its right hand.\n"
|
||||
|
||||
for(var/obj/item/I in held_items)
|
||||
if(!(I.flags & ABSTRACT))
|
||||
if(I.blood_DNA)
|
||||
msg += "<span class='warning'>It has \icon[I] [I.gender==PLURAL?"some":"a"] blood-stained [I.name] in its [get_held_index_name(get_held_index_of_item(I))]!</span>\n"
|
||||
else
|
||||
msg += "It has \icon[I] \a [I] in its [get_held_index_name(get_held_index_of_item(I))].\n"
|
||||
|
||||
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
|
||||
|
||||
@@ -178,7 +178,7 @@
|
||||
|
||||
if ("handshake")
|
||||
m_type = 1
|
||||
if (!src.restrained() && !src.r_hand)
|
||||
if (!src.restrained() && get_empty_held_indexes())
|
||||
var/mob/M = null
|
||||
if (param)
|
||||
for (var/mob/A in view(1, src))
|
||||
@@ -188,7 +188,7 @@
|
||||
if (M == src)
|
||||
M = null
|
||||
if (M)
|
||||
if (M.canmove && !M.r_hand && !M.restrained())
|
||||
if (M.canmove && M.get_empty_held_indexes() && !M.restrained())
|
||||
message = "<B>[src]</B> shakes hands with [M]."
|
||||
else
|
||||
message = "<B>[src]</B> holds out \his hand to [M]."
|
||||
@@ -298,12 +298,16 @@
|
||||
|
||||
if ("signal","signals")
|
||||
if (!src.restrained())
|
||||
var/maximum_fingers = 10
|
||||
var/full_hands
|
||||
for(var/obj/item/I in held_items)
|
||||
full_hands++
|
||||
maximum_fingers = (held_items.len-full_hands)*5
|
||||
var/t1 = round(text2num(param))
|
||||
if (isnum(t1))
|
||||
if (t1 <= 5 && (!src.r_hand || !src.l_hand))
|
||||
message = "<B>[src]</B> raises [t1] finger\s."
|
||||
else if (t1 <= 10 && (!src.r_hand && !src.l_hand))
|
||||
if (t1 <= maximum_fingers)
|
||||
message = "<B>[src]</B> raises [t1] finger\s."
|
||||
|
||||
m_type = 1
|
||||
|
||||
if ("sneeze","sneezes")
|
||||
|
||||
@@ -73,19 +73,13 @@
|
||||
else
|
||||
msg += "[t_He] [t_has] \icon[back] \a [back] on [t_his] back.\n"
|
||||
|
||||
//left hand
|
||||
if(l_hand && !(l_hand.flags&ABSTRACT))
|
||||
if(l_hand.blood_DNA)
|
||||
msg += "<span class='warning'>[t_He] [t_is] holding \icon[l_hand] [l_hand.gender==PLURAL?"some":"a"] blood-stained [l_hand.name] in [t_his] left hand!</span>\n"
|
||||
else
|
||||
msg += "[t_He] [t_is] holding \icon[l_hand] \a [l_hand] in [t_his] left hand.\n"
|
||||
|
||||
//right hand
|
||||
if(r_hand && !(r_hand.flags&ABSTRACT))
|
||||
if(r_hand.blood_DNA)
|
||||
msg += "<span class='warning'>[t_He] [t_is] holding \icon[r_hand] [r_hand.gender==PLURAL?"some":"a"] blood-stained [r_hand.name] in [t_his] right hand!</span>\n"
|
||||
else
|
||||
msg += "[t_He] [t_is] holding \icon[r_hand] \a [r_hand] in [t_his] right hand.\n"
|
||||
//Hands
|
||||
for(var/obj/item/I in held_items)
|
||||
if(!(I.flags & ABSTRACT))
|
||||
if(I.blood_DNA)
|
||||
msg += "<span class='warning'>[t_He] [t_is] holding \icon[I] [I.gender==PLURAL?"some":"a"] blood-stained [I.name] in [t_his] [get_held_index_name(get_held_index_of_item(I))]!</span>\n"
|
||||
else
|
||||
msg += "[t_He] [t_is] holding \icon[I] \a [I] in [t_his] [get_held_index_name(get_held_index_of_item(I))].\n"
|
||||
|
||||
//gloves
|
||||
if(gloves && !(slot_gloves in obscured))
|
||||
|
||||
@@ -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,11 +18,7 @@
|
||||
verbs += /mob/living/proc/lay_down
|
||||
|
||||
//initialize limbs first
|
||||
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
|
||||
create_bodyparts()
|
||||
|
||||
//initialize dna. for spawned humans; overwritten by other code
|
||||
create_dna(src)
|
||||
@@ -33,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
|
||||
|
||||
@@ -55,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)
|
||||
|
||||
@@ -116,96 +108,17 @@
|
||||
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(!get_bodypart(hand ? "l_arm" : "r_arm"))
|
||||
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)
|
||||
var/list/obscured = check_obscured_slots()
|
||||
var/list/dat = list()
|
||||
|
||||
var/dat = {"<table>
|
||||
<tr><td><B>Left Hand:</B></td><td><A href='?src=\ref[src];item=[slot_l_hand]'>[(l_hand && !(l_hand.flags&ABSTRACT)) ? l_hand : "<font color=grey>Empty</font>"]</A></td></tr>
|
||||
<tr><td><B>Right Hand:</B></td><td><A href='?src=\ref[src];item=[slot_r_hand]'>[(r_hand && !(r_hand.flags&ABSTRACT)) ? r_hand : "<font color=grey>Empty</font>"]</A></td></tr>
|
||||
<tr><td> </td></tr>"}
|
||||
dat += "<table>"
|
||||
for(var/i in 1 to held_items.len)
|
||||
var/obj/item/I = get_item_for_held_index(i)
|
||||
dat += "<tr><td><B>[get_held_index_name(i)]:</B></td><td><A href='?src=\ref[src];item=[slot_hands];hand_index=[i]'>[(I && !(I.flags & ABSTRACT)) ? I : "<font color=grey>Empty</font>"]</a></td></tr>"
|
||||
dat += "<tr><td> </td></tr>"
|
||||
|
||||
dat += "<tr><td><B>Back:</B></td><td><A href='?src=\ref[src];item=[slot_back]'>[(back && !(back.flags&ABSTRACT)) ? back : "<font color=grey>Empty</font>"]</A>"
|
||||
if(has_breathable_mask && istype(back, /obj/item/weapon/tank))
|
||||
@@ -279,7 +192,7 @@
|
||||
"}
|
||||
|
||||
var/datum/browser/popup = new(user, "mob\ref[src]", "[src]", 440, 510)
|
||||
popup.set_content(dat)
|
||||
popup.set_content(dat.Join())
|
||||
popup.open()
|
||||
|
||||
// called when something steps onto a human
|
||||
@@ -291,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))
|
||||
@@ -354,7 +238,7 @@
|
||||
var/pocket_side = href_list["pockets"]
|
||||
var/pocket_id = (pocket_side == "right" ? slot_r_store : slot_l_store)
|
||||
var/obj/item/pocket_item = (pocket_id == slot_r_store ? r_store : l_store)
|
||||
var/obj/item/place_item = usr.get_active_hand() // Item to place in the pocket, if it's empty
|
||||
var/obj/item/place_item = usr.get_active_held_item() // Item to place in the pocket, if it's empty
|
||||
|
||||
var/delay_denominator = 1
|
||||
if(pocket_item && !(pocket_item.flags&ABSTRACT))
|
||||
@@ -653,7 +537,7 @@
|
||||
if(lasercolor == "b")//Lasertag turrets target the opposing team, how great is that? -Sieve
|
||||
if(istype(wear_suit, /obj/item/clothing/suit/redtag))
|
||||
threatcount += 4
|
||||
if((istype(r_hand,/obj/item/weapon/gun/energy/laser/redtag)) || (istype(l_hand,/obj/item/weapon/gun/energy/laser/redtag)))
|
||||
if(is_holding_item_of_type(/obj/item/weapon/gun/energy/laser/redtag))
|
||||
threatcount += 4
|
||||
if(istype(belt, /obj/item/weapon/gun/energy/laser/redtag))
|
||||
threatcount += 2
|
||||
@@ -661,7 +545,7 @@
|
||||
if(lasercolor == "r")
|
||||
if(istype(wear_suit, /obj/item/clothing/suit/bluetag))
|
||||
threatcount += 4
|
||||
if((istype(r_hand,/obj/item/weapon/gun/energy/laser/bluetag)) || (istype(l_hand,/obj/item/weapon/gun/energy/laser/bluetag)))
|
||||
if(is_holding_item_of_type(/obj/item/weapon/gun/energy/laser/bluetag))
|
||||
threatcount += 4
|
||||
if(istype(belt, /obj/item/weapon/gun/energy/laser/bluetag))
|
||||
threatcount += 2
|
||||
@@ -676,10 +560,9 @@
|
||||
//Check for weapons
|
||||
if(judgebot.weaponscheck)
|
||||
if(!idcard || !(access_weapons in idcard.access))
|
||||
if(judgebot.check_for_weapons(l_hand))
|
||||
threatcount += 4
|
||||
if(judgebot.check_for_weapons(r_hand))
|
||||
threatcount += 4
|
||||
for(var/obj/item/I in held_items)
|
||||
if(judgebot.check_for_weapons(I))
|
||||
threatcount += 4
|
||||
if(judgebot.check_for_weapons(belt))
|
||||
threatcount += 2
|
||||
|
||||
@@ -726,21 +609,9 @@
|
||||
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)
|
||||
var/list/handlist = list(l_hand, r_hand)
|
||||
for(var/obj/item/hand in handlist)
|
||||
for(var/obj/item/hand in held_items)
|
||||
if(prob(current_size * 5) && hand.w_class >= ((11-current_size)/2) && unEquip(hand))
|
||||
step_towards(hand, src)
|
||||
src << "<span class='warning'>\The [S] pulls \the [hand] from your grip!</span>"
|
||||
@@ -749,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)
|
||||
|
||||
@@ -1003,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_hand() && 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,34 +89,23 @@
|
||||
|
||||
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)
|
||||
return 1
|
||||
if(l_hand)
|
||||
if(l_hand.IsReflect(def_zone) == 1)
|
||||
return 1
|
||||
if(r_hand)
|
||||
if(r_hand.IsReflect(def_zone) == 1)
|
||||
for(var/obj/item/I in held_items)
|
||||
if(I.IsReflect(def_zone) == 1)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/mob/living/carbon/human/proc/check_shields(damage = 0, attack_text = "the attack", atom/movable/AM, attack_type = MELEE_ATTACK, armour_penetration = 0)
|
||||
var/block_chance_modifier = round(damage / -3)
|
||||
|
||||
if(l_hand && !istype(l_hand, /obj/item/clothing))
|
||||
var/final_block_chance = l_hand.block_chance - (Clamp((armour_penetration-l_hand.armour_penetration)/2,0,100)) + block_chance_modifier //So armour piercing blades can still be parried by other blades, for example
|
||||
if(l_hand.hit_reaction(src, attack_text, final_block_chance, damage, attack_type))
|
||||
return 1
|
||||
if(r_hand && !istype(r_hand, /obj/item/clothing))
|
||||
var/final_block_chance = r_hand.block_chance - (Clamp((armour_penetration-r_hand.armour_penetration)/2,0,100)) + block_chance_modifier //Need to reset the var so it doesn't carry over modifications between attempts
|
||||
if(r_hand.hit_reaction(src, attack_text, final_block_chance, damage, attack_type))
|
||||
return 1
|
||||
for(var/obj/item/I in held_items)
|
||||
if(!istype(I, /obj/item/clothing))
|
||||
var/final_block_chance = I.block_chance - (Clamp((armour_penetration-I.armour_penetration)/2,0,100)) + block_chance_modifier //So armour piercing blades can still be parried by other blades, for example
|
||||
if(I.hit_reaction(src, attack_text, final_block_chance, damage, attack_type))
|
||||
return 1
|
||||
if(wear_suit)
|
||||
var/final_block_chance = wear_suit.block_chance - (Clamp((armour_penetration-wear_suit.armour_penetration)/2,0,100)) + block_chance_modifier
|
||||
if(wear_suit.hit_reaction(src, attack_text, final_block_chance, damage, attack_type))
|
||||
@@ -102,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
|
||||
@@ -262,133 +564,84 @@
|
||||
inventory_items_to_kill += back
|
||||
if(belt)
|
||||
inventory_items_to_kill += belt
|
||||
if(r_hand)
|
||||
inventory_items_to_kill += r_hand
|
||||
if(l_hand)
|
||||
inventory_items_to_kill += l_hand
|
||||
|
||||
inventory_items_to_kill += held_items
|
||||
|
||||
for(var/obj/item/I in inventory_items_to_kill)
|
||||
I.acid_act(acidpwr, acid_volume_left)
|
||||
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
|
||||
|
||||
@@ -81,33 +81,17 @@
|
||||
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)
|
||||
if(full_body && ((l_hand && !( src.l_hand.flags&NODROP )) || (r_hand && !( src.r_hand.flags&NODROP )) || (back && !(back.flags&NODROP)) || (wear_mask && !(wear_mask.flags&NODROP)) || (head && !(head.flags&NODROP)) || (shoes && !(shoes.flags&NODROP)) || (w_uniform && !(w_uniform.flags&NODROP)) || (wear_suit && !(wear_suit.flags&NODROP)) || (glasses && !(glasses.flags&NODROP)) || (ears && !(ears.flags&NODROP)) || (gloves && !(gloves.flags&NODROP)) ) )
|
||||
return 1
|
||||
var/abiotic_hands = FALSE
|
||||
for(var/obj/item/I in held_items)
|
||||
if(!(I.flags & NODROP))
|
||||
abiotic_hands = TRUE
|
||||
break
|
||||
if(full_body && abiotic_hands && ((back && !(back.flags&NODROP)) || (wear_mask && !(wear_mask.flags&NODROP)) || (head && !(head.flags&NODROP)) || (shoes && !(shoes.flags&NODROP)) || (w_uniform && !(w_uniform.flags&NODROP)) || (wear_suit && !(wear_suit.flags&NODROP)) || (glasses && !(glasses.flags&NODROP)) || (ears && !(ears.flags&NODROP)) || (gloves && !(gloves.flags&NODROP)) ) )
|
||||
return TRUE
|
||||
return abiotic_hands
|
||||
|
||||
if( (src.l_hand && !(src.l_hand.flags&NODROP)) || (src.r_hand && !(src.r_hand.flags&NODROP)) )
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
/mob/living/carbon/human/IsAdvancedToolUser()
|
||||
return 1//Humans can use guns and such
|
||||
|
||||
@@ -22,10 +22,6 @@
|
||||
return handcuffed
|
||||
if(slot_legcuffed)
|
||||
return legcuffed
|
||||
if(slot_l_hand)
|
||||
return l_hand
|
||||
if(slot_r_hand)
|
||||
return r_hand
|
||||
if(slot_belt)
|
||||
return belt
|
||||
if(slot_wear_id)
|
||||
@@ -113,7 +109,7 @@
|
||||
//Item is handled and in slot, valid to call callback, for this proc should always be true
|
||||
if(!not_handled)
|
||||
I.equipped(src, slot)
|
||||
|
||||
|
||||
return not_handled //For future deeper overrides
|
||||
|
||||
/mob/living/carbon/human/unEquip(obj/item/I)
|
||||
@@ -204,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)
|
||||
@@ -380,6 +380,8 @@
|
||||
var/image/I
|
||||
|
||||
for(var/layer in relevent_layers)
|
||||
var/layertext = mutant_bodyparts_layertext(layer)
|
||||
|
||||
for(var/bodypart in bodyparts_to_add)
|
||||
var/datum/sprite_accessory/S
|
||||
switch(bodypart)
|
||||
@@ -423,9 +425,9 @@
|
||||
var/icon_string
|
||||
|
||||
if(S.gender_specific)
|
||||
icon_string = "[g]_[bodypart]_[S.icon_state]_[layer]"
|
||||
icon_string = "[g]_[bodypart]_[S.icon_state]_[layertext]"
|
||||
else
|
||||
icon_string = "m_[bodypart]_[S.icon_state]_[layer]"
|
||||
icon_string = "m_[bodypart]_[S.icon_state]_[layertext]"
|
||||
|
||||
I = image("icon" = S.icon, "icon_state" = icon_string, "layer" =- layer)
|
||||
|
||||
@@ -455,9 +457,9 @@
|
||||
|
||||
if(S.hasinner)
|
||||
if(S.gender_specific)
|
||||
icon_string = "[g]_[bodypart]inner_[S.icon_state]_[layer]"
|
||||
icon_string = "[g]_[bodypart]inner_[S.icon_state]_[layertext]"
|
||||
else
|
||||
icon_string = "m_[bodypart]inner_[S.icon_state]_[layer]"
|
||||
icon_string = "m_[bodypart]inner_[S.icon_state]_[layertext]"
|
||||
|
||||
I = image("icon" = S.icon, "icon_state" = icon_string, "layer" =- layer)
|
||||
|
||||
@@ -473,6 +475,19 @@
|
||||
H.apply_overlay(BODY_ADJ_LAYER)
|
||||
H.apply_overlay(BODY_FRONT_LAYER)
|
||||
|
||||
|
||||
//This exists so sprite accessories can still be per-layer without having to include that layer's
|
||||
//number in their sprite name, which causes issues when those numbers change.
|
||||
/datum/species/proc/mutant_bodyparts_layertext(layer)
|
||||
switch(layer)
|
||||
if(BODY_BEHIND_LAYER)
|
||||
return "BEHIND"
|
||||
if(BODY_ADJ_LAYER)
|
||||
return "ADJ"
|
||||
if(BODY_FRONT_LAYER)
|
||||
return "FRONT"
|
||||
|
||||
|
||||
/datum/species/proc/spec_life(mob/living/carbon/human/H)
|
||||
if(NOBREATH in specflags)
|
||||
H.setOxyLoss(0)
|
||||
@@ -494,24 +509,14 @@
|
||||
if(!I.species_exception || !is_type_in_list(src, I.species_exception))
|
||||
return 0
|
||||
|
||||
var/R = H.has_right_hand()
|
||||
var/L = H.has_left_hand()
|
||||
var/num_arms = H.get_num_arms()
|
||||
var/num_legs = H.get_num_legs()
|
||||
|
||||
switch(slot)
|
||||
if(slot_l_hand)
|
||||
if(H.l_hand)
|
||||
return 0
|
||||
if(!L)
|
||||
return 0
|
||||
return 1
|
||||
if(slot_r_hand)
|
||||
if(H.r_hand)
|
||||
return 0
|
||||
if(!R)
|
||||
return 0
|
||||
return 1
|
||||
if(slot_hands)
|
||||
if(H.get_empty_held_indexes())
|
||||
return TRUE
|
||||
return FALSE
|
||||
if(slot_wear_mask)
|
||||
if(H.wear_mask)
|
||||
return 0
|
||||
@@ -825,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
|
||||
@@ -881,23 +886,14 @@
|
||||
. += H.shoes.slowdown
|
||||
if(H.back)
|
||||
. += H.back.slowdown
|
||||
if(H.l_hand && (H.l_hand.flags & HANDSLOW))
|
||||
. += H.l_hand.slowdown
|
||||
if(H.r_hand && (H.r_hand.flags & HANDSLOW))
|
||||
. += H.r_hand.slowdown
|
||||
|
||||
for(var/obj/item/I in H.held_items)
|
||||
if(I.flags & HANDSLOW)
|
||||
. += I.slowdown
|
||||
if((H.disabilities & FAT))
|
||||
. += 1.5
|
||||
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
|
||||
|
||||
//////////////////
|
||||
@@ -1024,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
|
||||
|
||||
@@ -1059,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
|
||||
@@ -1109,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
|
||||
@@ -676,10 +677,9 @@
|
||||
. = ..()
|
||||
// Drop items in hands
|
||||
// If you're a zombie lucky enough to have a NODROP item, then it stays.
|
||||
if(C.unEquip(C.l_hand))
|
||||
C.put_in_l_hand(new /obj/item/zombie_hand(C))
|
||||
if(C.unEquip(C.r_hand))
|
||||
C.put_in_r_hand(new /obj/item/zombie_hand(C))
|
||||
for(var/obj/item/I in C.held_items)
|
||||
C.unEquip(I)
|
||||
C.put_in_hands(new /obj/item/zombie_hand(C))
|
||||
|
||||
// Next, deal with the source of this zombie corruption
|
||||
var/obj/item/organ/body_egg/zombie_infection/infection
|
||||
@@ -689,13 +689,10 @@
|
||||
|
||||
/datum/species/zombie/infectious/on_species_loss(mob/living/carbon/C)
|
||||
. = ..()
|
||||
var/obj/item/zombie_hand/left = C.l_hand
|
||||
var/obj/item/zombie_hand/right = C.r_hand
|
||||
// Deletion of the hands is handled in the items dropped()
|
||||
if(istype(left))
|
||||
C.unEquip(left, TRUE)
|
||||
if(istype(right))
|
||||
C.unEquip(right, TRUE)
|
||||
for(var/obj/item/I in C.held_items)
|
||||
if(istype(I, /obj/item/zombie_hand))
|
||||
C.unEquip(I, TRUE)
|
||||
|
||||
|
||||
// Your skin falls off
|
||||
/datum/species/krokodil_addict
|
||||
@@ -734,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()
|
||||
@@ -757,7 +755,7 @@ var/global/image/plasmaman_on_fire = image("icon"='icons/mob/OnFire.dmi', "icon_
|
||||
/datum/species/plasmaman/before_equip_job(datum/job/J, mob/living/carbon/human/H, visualsOnly = FALSE)
|
||||
var/datum/outfit/plasmaman/O = new /datum/outfit/plasmaman
|
||||
H.equipOutfit(O, visualsOnly)
|
||||
H.internal = H.r_hand
|
||||
H.internal = H.get_item_for_held_index(2)
|
||||
H.update_internals_hud_icon(1)
|
||||
return 0
|
||||
|
||||
@@ -785,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
|
||||
@@ -1016,8 +1014,8 @@ SYNDICATE BLACK OPS
|
||||
|
||||
playsound(H.loc, 'sound/misc/slip.ogg', 50, 1, -3)
|
||||
|
||||
H.accident(H.l_hand)
|
||||
H.accident(H.r_hand)
|
||||
for(var/obj/item/I in H.held_items)
|
||||
H.accident(I)
|
||||
|
||||
var/olddir = H.dir
|
||||
|
||||
|
||||
@@ -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,18 +324,17 @@ 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))
|
||||
drop_l_hand()
|
||||
drop_r_hand()
|
||||
if(wear_suit.breakouttime) //suit is restraining
|
||||
drop_all_held_items()
|
||||
|
||||
update_hair()
|
||||
update_mutant_bodyparts()
|
||||
@@ -424,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)
|
||||
@@ -459,7 +388,7 @@ There are several things that need to be remembered:
|
||||
|
||||
/mob/living/carbon/human/proc/get_overlays_copy(list/unwantedLayers)
|
||||
var/list/out = new
|
||||
for(var/i=1;i<=TOTAL_LAYERS;i++)
|
||||
for(var/i in 1 to TOTAL_LAYERS)
|
||||
if(overlays_standing[i])
|
||||
if(i in unwantedLayers)
|
||||
continue
|
||||
@@ -493,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:
|
||||
@@ -548,41 +479,42 @@ generate/load female uniform sprites matching all previously decided variables
|
||||
|
||||
standing = center_image(standing, isinhands ? inhand_x_dimension : worn_x_dimension, isinhands ? inhand_y_dimension : worn_y_dimension)
|
||||
|
||||
//Handle held offsets
|
||||
var/mob/M = loc
|
||||
if(istype(M))
|
||||
var/list/L = get_held_offsets()
|
||||
if(L)
|
||||
standing.pixel_x += L["x"] //+= because of center()ing
|
||||
standing.pixel_y += L["y"]
|
||||
|
||||
standing.alpha = alpha
|
||||
standing.color = color
|
||||
|
||||
return standing
|
||||
|
||||
|
||||
/obj/item/proc/get_held_offsets()
|
||||
var/list/L
|
||||
if(ismob(loc))
|
||||
var/mob/M = loc
|
||||
L = M.get_item_offsets_for_index(M.get_held_index_of_item(src))
|
||||
return L
|
||||
|
||||
|
||||
//Can't think of a better way to do this, sadly
|
||||
/mob/proc/get_item_offsets_for_index(i)
|
||||
switch(i)
|
||||
if(3) //odd = left hands
|
||||
return list("x" = 0, "y" = 16)
|
||||
if(4) //even = right hands
|
||||
return list("x" = 0, "y" = 16)
|
||||
else //No offsets or Unwritten number of hands
|
||||
return list("x" = 0, "y" = 0)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/////////////////////
|
||||
// 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))
|
||||
@@ -601,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"
|
||||
@@ -609,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
|
||||
|
||||
@@ -10,10 +10,6 @@
|
||||
return handcuffed
|
||||
if(slot_legcuffed)
|
||||
return legcuffed
|
||||
if(slot_l_hand)
|
||||
return l_hand
|
||||
if(slot_r_hand)
|
||||
return r_hand
|
||||
return null
|
||||
|
||||
|
||||
@@ -24,10 +20,9 @@
|
||||
if(!istype(I))
|
||||
return
|
||||
|
||||
if(I == l_hand)
|
||||
l_hand = null
|
||||
else if(I == r_hand)
|
||||
r_hand = null
|
||||
var/index = get_held_index_of_item(I)
|
||||
if(index)
|
||||
held_items[index] = null
|
||||
|
||||
if(I.pulledby)
|
||||
I.pulledby.stop_pulling()
|
||||
@@ -59,25 +54,22 @@
|
||||
if(slot_legcuffed)
|
||||
legcuffed = I
|
||||
update_inv_legcuffed()
|
||||
if(slot_l_hand)
|
||||
l_hand = I
|
||||
update_inv_l_hand()
|
||||
if(slot_r_hand)
|
||||
r_hand = I
|
||||
update_inv_r_hand()
|
||||
if(slot_hands)
|
||||
put_in_hands(I)
|
||||
update_inv_hands()
|
||||
if(slot_in_backpack)
|
||||
if(I == get_active_hand())
|
||||
if(I == get_active_held_item())
|
||||
unEquip(I)
|
||||
I.loc = back
|
||||
else
|
||||
not_handled = TRUE
|
||||
|
||||
|
||||
//Item has been handled at this point and equipped callback can be safely called
|
||||
//We cannot call it for items that have not been handled as they are not yet correctly
|
||||
//in a slot (handled further down inheritance chain, probably living/carbon/human/equip_to_slot
|
||||
if(!not_handled)
|
||||
I.equipped(src, slot)
|
||||
|
||||
|
||||
return not_handled
|
||||
|
||||
/mob/living/carbon/unEquip(obj/item/I)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,32 +1,28 @@
|
||||
/mob/living/carbon/monkey/can_equip(obj/item/I, slot, disable_warning = 0)
|
||||
switch(slot)
|
||||
if(slot_l_hand)
|
||||
if(l_hand)
|
||||
return 0
|
||||
return 1
|
||||
if(slot_r_hand)
|
||||
if(r_hand)
|
||||
return 0
|
||||
return 1
|
||||
if(slot_hands)
|
||||
if(get_empty_held_indexes())
|
||||
return TRUE
|
||||
return FALSE
|
||||
if(slot_wear_mask)
|
||||
if(wear_mask)
|
||||
return 0
|
||||
return FALSE
|
||||
if( !(I.slot_flags & SLOT_MASK) )
|
||||
return 0
|
||||
return 1
|
||||
return FALSE
|
||||
return TRUE
|
||||
if(slot_head)
|
||||
if(head)
|
||||
return 0
|
||||
return FALSE
|
||||
if( !(I.slot_flags & SLOT_HEAD) )
|
||||
return 0
|
||||
return 1
|
||||
return FALSE
|
||||
return TRUE
|
||||
if(slot_back)
|
||||
if(back)
|
||||
return 0
|
||||
return FALSE
|
||||
if( !(I.slot_flags & SLOT_BACK) )
|
||||
return 0
|
||||
return 1
|
||||
return 0 //Unsupported slot
|
||||
return FALSE
|
||||
return TRUE
|
||||
return FALSE //Unsupported slot
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -249,21 +106,20 @@
|
||||
//Lasertag bullshit
|
||||
if(lasercolor)
|
||||
if(lasercolor == "b")//Lasertag turrets target the opposing team, how great is that? -Sieve
|
||||
if((istype(r_hand,/obj/item/weapon/gun/energy/laser/redtag)) || (istype(l_hand,/obj/item/weapon/gun/energy/laser/redtag)))
|
||||
if(is_holding_item_of_type(/obj/item/weapon/gun/energy/laser/redtag))
|
||||
threatcount += 4
|
||||
|
||||
if(lasercolor == "r")
|
||||
if((istype(r_hand,/obj/item/weapon/gun/energy/laser/bluetag)) || (istype(l_hand,/obj/item/weapon/gun/energy/laser/bluetag)))
|
||||
if(is_holding_item_of_type(/obj/item/weapon/gun/energy/laser/bluetag))
|
||||
threatcount += 4
|
||||
|
||||
return threatcount
|
||||
|
||||
//Check for weapons
|
||||
if(judgebot.weaponscheck)
|
||||
if(judgebot.check_for_weapons(l_hand))
|
||||
threatcount += 4
|
||||
if(judgebot.check_for_weapons(r_hand))
|
||||
threatcount += 4
|
||||
for(var/obj/item/I in held_items)
|
||||
if(judgebot.check_for_weapons(I))
|
||||
threatcount += 4
|
||||
|
||||
//mindshield implants imply trustworthyness
|
||||
if(isloyal(src))
|
||||
@@ -271,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)
|
||||
@@ -298,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,64 +40,51 @@
|
||||
overlays -= overlays_standing[cache_index]
|
||||
overlays_standing[cache_index] = null
|
||||
|
||||
/mob/living/carbon/update_inv_r_hand()
|
||||
remove_overlay(R_HAND_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_inv_hands()
|
||||
remove_overlay(HANDS_LAYER)
|
||||
if (handcuffed)
|
||||
drop_r_hand()
|
||||
drop_all_held_items()
|
||||
return
|
||||
if(r_hand)
|
||||
|
||||
var/list/hands = list()
|
||||
for(var/obj/item/I in held_items)
|
||||
if(client && hud_used && hud_used.hud_version != HUD_STYLE_NOHUD)
|
||||
r_hand.screen_loc = ui_rhand
|
||||
client.screen += r_hand
|
||||
I.screen_loc = ui_hand_position(get_held_index_of_item(I))
|
||||
client.screen += I
|
||||
if(observers && observers.len)
|
||||
for(var/M in observers)
|
||||
var/mob/dead/observe = M
|
||||
if(observe.client && observe.client.eye == src)
|
||||
observe.client.screen += r_hand
|
||||
observe.client.screen += I
|
||||
else
|
||||
observers -= observe
|
||||
if(!observers.len)
|
||||
observers = null
|
||||
break
|
||||
|
||||
|
||||
var/t_state = r_hand.item_state
|
||||
var/t_state = I.item_state
|
||||
if(!t_state)
|
||||
t_state = r_hand.icon_state
|
||||
t_state = I.icon_state
|
||||
|
||||
var/image/standing = r_hand.build_worn_icon(state = t_state, default_layer = R_HAND_LAYER, default_icon_file = r_hand.righthand_file, isinhands = TRUE)
|
||||
overlays_standing[R_HAND_LAYER] = standing
|
||||
var/icon_file = I.lefthand_file
|
||||
if(get_held_index_of_item(I) % 2 == 0)
|
||||
icon_file = I.righthand_file
|
||||
|
||||
apply_overlay(R_HAND_LAYER)
|
||||
var/image/standing = I.build_worn_icon(state = t_state, default_layer = HANDS_LAYER, default_icon_file = icon_file, isinhands = TRUE)
|
||||
hands += standing
|
||||
|
||||
/mob/living/carbon/update_inv_l_hand()
|
||||
remove_overlay(L_HAND_LAYER)
|
||||
if(handcuffed)
|
||||
drop_l_hand()
|
||||
return
|
||||
if(l_hand)
|
||||
if(client && hud_used && hud_used.hud_version != HUD_STYLE_NOHUD)
|
||||
l_hand.screen_loc = ui_lhand
|
||||
client.screen += l_hand
|
||||
if(observers && observers.len)
|
||||
for(var/M in observers)
|
||||
var/mob/dead/observe = M
|
||||
if(observe.client && observe.client.eye == src)
|
||||
observe.client.screen += l_hand
|
||||
else
|
||||
observers -= observe
|
||||
if(!observers.len)
|
||||
observers = null
|
||||
break
|
||||
overlays_standing[HANDS_LAYER] = hands
|
||||
apply_overlay(HANDS_LAYER)
|
||||
|
||||
var/t_state = l_hand.item_state
|
||||
if(!t_state)
|
||||
t_state = l_hand.icon_state
|
||||
|
||||
var/image/standing = l_hand.build_worn_icon(state = t_state, default_layer = L_HAND_LAYER, default_icon_file = l_hand.lefthand_file, isinhands = TRUE)
|
||||
overlays_standing[L_HAND_LAYER] = standing
|
||||
|
||||
apply_overlay(L_HAND_LAYER)
|
||||
|
||||
/mob/living/carbon/update_fire(var/fire_icon = "Generic_mob_burning")
|
||||
remove_overlay(FIRE_LAYER)
|
||||
@@ -106,24 +93,44 @@
|
||||
|
||||
apply_overlay(FIRE_LAYER)
|
||||
|
||||
/mob/living/carbon/regenerate_icons()
|
||||
if(notransform)
|
||||
return 1
|
||||
update_inv_r_hand()
|
||||
update_inv_l_hand()
|
||||
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)
|
||||
|
||||
@@ -139,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
|
||||
@@ -154,11 +174,10 @@
|
||||
//update whether handcuffs appears on our hud.
|
||||
/mob/living/carbon/proc/update_hud_handcuffed()
|
||||
if(hud_used)
|
||||
var/obj/screen/inventory/R = hud_used.inv_slots[slot_r_hand]
|
||||
var/obj/screen/inventory/L = hud_used.inv_slots[slot_l_hand]
|
||||
if(R && L)
|
||||
R.update_icon()
|
||||
L.update_icon()
|
||||
for(var/hand in hud_used.hand_slots)
|
||||
var/obj/screen/inventory/hand/H = hud_used.hand_slots[hand]
|
||||
if(H)
|
||||
H.update_icon()
|
||||
|
||||
//update whether our head item appears on our hud.
|
||||
/mob/living/carbon/proc/update_hud_head(obj/item/I)
|
||||
@@ -173,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
|
||||
|
||||
|
||||
@@ -149,10 +149,10 @@
|
||||
if(!(M.status_flags & CANPUSH))
|
||||
return 1
|
||||
//anti-riot equipment is also anti-push
|
||||
if(M.r_hand && (prob(M.r_hand.block_chance * 2)) && !istype(M.r_hand, /obj/item/clothing))
|
||||
return 1
|
||||
if(M.l_hand && (prob(M.l_hand.block_chance * 2)) && !istype(M.l_hand, /obj/item/clothing))
|
||||
return 1
|
||||
for(var/obj/item/I in M.held_items)
|
||||
if(!istype(M, /obj/item/clothing))
|
||||
if(prob(I.block_chance*2))
|
||||
return 1
|
||||
|
||||
//Called when we bump onto an obj
|
||||
/mob/living/proc/ObjBump(obj/O)
|
||||
@@ -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)
|
||||
@@ -783,33 +609,44 @@
|
||||
"<span class='userdanger'>[src] tries to remove [who]'s [what.name].</span>")
|
||||
what.add_fingerprint(src)
|
||||
if(do_mob(src, who, what.strip_delay))
|
||||
if(what && what == who.get_item_by_slot(where) && Adjacent(who))
|
||||
who.unEquip(what)
|
||||
add_logs(src, who, "stripped", addition="of [what]")
|
||||
if(what && Adjacent(who))
|
||||
if(islist(where))
|
||||
var/list/L = where
|
||||
if(what == who.get_item_for_held_index(L[2]))
|
||||
who.unEquip(what)
|
||||
add_logs(src, who, "stripped", addition="of [what]")
|
||||
if(what == who.get_item_by_slot(where))
|
||||
who.unEquip(what)
|
||||
add_logs(src, who, "stripped", addition="of [what]")
|
||||
|
||||
// The src mob is trying to place an item on someone
|
||||
// Override if a certain mob should be behave differently when placing items (can't, for example)
|
||||
/mob/living/stripPanelEquip(obj/item/what, mob/who, where)
|
||||
what = src.get_active_hand()
|
||||
what = src.get_active_held_item()
|
||||
if(what && (what.flags & NODROP))
|
||||
src << "<span class='warning'>You can't put \the [what.name] on [who], it's stuck to your hand!</span>"
|
||||
return
|
||||
if(what)
|
||||
if(!what.mob_can_equip(who, src, where, 1))
|
||||
src << "<span class='warning'>\The [what.name] doesn't fit in that place!</span>"
|
||||
return
|
||||
var/list/where_list
|
||||
if(islist(where))
|
||||
where_list = where
|
||||
if(!what.mob_can_equip(who, src, where[1], 1))
|
||||
src << "<span class='warning'>\The [what.name] doesn't fit in that place!</span>"
|
||||
return
|
||||
else
|
||||
if(!what.mob_can_equip(who, src, where, 1))
|
||||
src << "<span class='warning'>\The [what.name] doesn't fit in that place!</span>"
|
||||
return
|
||||
visible_message("<span class='notice'>[src] tries to put [what] on [who].</span>")
|
||||
if(do_mob(src, who, what.put_on_delay))
|
||||
if(what && Adjacent(who))
|
||||
unEquip(what)
|
||||
who.equip_to_slot_if_possible(what, where, 0, 1)
|
||||
if(where_list)
|
||||
who.put_in_hand(what, where_list[2])
|
||||
else
|
||||
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)
|
||||
@@ -817,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
|
||||
@@ -869,11 +683,10 @@
|
||||
|
||||
// What icon do we use for the attack?
|
||||
var/image/I
|
||||
if(hand && l_hand) // Attacked with item in left hand.
|
||||
I = image(l_hand.icon, A, l_hand.icon_state, A.layer + 0.1)
|
||||
else if(!hand && r_hand) // Attacked with item in right hand.
|
||||
I = image(r_hand.icon, A, r_hand.icon_state, A.layer + 0.1)
|
||||
else // Attacked with a fist?
|
||||
var/obj/item/held_item = get_active_held_item()
|
||||
if(held_item)
|
||||
I = image(held_item.icon, A, held_item.icon_state, A.layer + 0.1)
|
||||
else
|
||||
return
|
||||
|
||||
// Who can see the attack?
|
||||
@@ -1001,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())
|
||||
@@ -1089,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
|
||||
@@ -216,8 +154,7 @@
|
||||
add_logs(user, src, "grabbed", addition="aggressively")
|
||||
visible_message("<span class='danger'>[user] has grabbed [src] aggressively!</span>", \
|
||||
"<span class='userdanger'>[user] has grabbed [src] aggressively!</span>")
|
||||
drop_r_hand()
|
||||
drop_l_hand()
|
||||
drop_all_held_items()
|
||||
stop_pulling()
|
||||
if(GRAB_NECK)
|
||||
visible_message("<span class='danger'>[user] has grabbed [src] by the neck!</span>",\
|
||||
@@ -292,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>")
|
||||
@@ -332,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
|
||||
|
||||
@@ -266,14 +266,15 @@ var/list/crit_allowed_modes = list(MODE_WHISPER,MODE_CHANGELING,MODE_ALIEN)
|
||||
/mob/living/proc/radio(message, message_mode, list/spans)
|
||||
switch(message_mode)
|
||||
if(MODE_R_HAND)
|
||||
if (r_hand)
|
||||
r_hand.talk_into(src, message, , spans)
|
||||
return ITALICS | REDUCE_RANGE
|
||||
|
||||
for(var/obj/item/r_hand in get_held_items_for_side("r", all = TRUE))
|
||||
if (r_hand)
|
||||
r_hand.talk_into(src, message, , spans)
|
||||
return ITALICS | REDUCE_RANGE
|
||||
if(MODE_L_HAND)
|
||||
if (l_hand)
|
||||
l_hand.talk_into(src, message, , spans)
|
||||
return ITALICS | REDUCE_RANGE
|
||||
for(var/obj/item/l_hand in get_held_items_for_side("l", all = TRUE))
|
||||
if (l_hand)
|
||||
l_hand.talk_into(src, message, , spans)
|
||||
return ITALICS | REDUCE_RANGE
|
||||
|
||||
if(MODE_INTERCOM)
|
||||
for (var/obj/item/device/radio/intercom/I in view(1, null))
|
||||
|
||||
@@ -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"))
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
if(desc)
|
||||
msg += "[desc]\n"
|
||||
|
||||
var/obj/act_module = get_active_hand()
|
||||
var/obj/act_module = get_active_held_item()
|
||||
if(act_module)
|
||||
msg += "It is holding \icon[act_module] \a [act_module].\n"
|
||||
msg += "<span class='warning'>"
|
||||
@@ -48,4 +48,4 @@
|
||||
|
||||
user << msg
|
||||
|
||||
..()
|
||||
..()
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//as they handle all relevant stuff like adding it to the player's screen and such
|
||||
|
||||
//Returns the thing in our active hand (whatever is in our active module-slot, in this case)
|
||||
/mob/living/silicon/robot/get_active_hand()
|
||||
/mob/living/silicon/robot/get_active_held_item()
|
||||
return module_active
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -24,6 +24,7 @@
|
||||
var/obj/screen/inv3 = null
|
||||
var/obj/screen/lamp_button = null
|
||||
var/obj/screen/thruster_button = null
|
||||
var/obj/screen/hands = null
|
||||
|
||||
var/shown_robot_modules = 0 //Used to determine whether they have the module menu shown or not
|
||||
var/obj/screen/robot_modules_background
|
||||
@@ -365,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"))
|
||||
@@ -393,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
|
||||
@@ -621,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"
|
||||
@@ -711,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_hand())
|
||||
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))
|
||||
@@ -777,13 +611,13 @@
|
||||
if(istype(M, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = M
|
||||
//if they are holding or wearing a card that has access, that works
|
||||
if(check_access(H.get_active_hand()) || check_access(H.wear_id))
|
||||
if(check_access(H.get_active_held_item()) || check_access(H.wear_id))
|
||||
return 1
|
||||
else if(istype(M, /mob/living/carbon/monkey))
|
||||
var/mob/living/carbon/monkey/george = M
|
||||
//they can only hold things :(
|
||||
if(istype(george.get_active_hand(), /obj/item))
|
||||
return check_access(george.get_active_hand())
|
||||
if(istype(george.get_active_held_item(), /obj/item))
|
||||
return check_access(george.get_active_held_item())
|
||||
return 0
|
||||
|
||||
/mob/living/silicon/robot/proc/check_access(obj/item/weapon/card/id/I)
|
||||
@@ -1033,7 +867,7 @@
|
||||
|
||||
if(incapacitated())
|
||||
return
|
||||
var/obj/item/W = get_active_hand()
|
||||
var/obj/item/W = get_active_held_item()
|
||||
if(W)
|
||||
W.attack_self(src)
|
||||
|
||||
@@ -1135,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)
|
||||
@@ -1286,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))
|
||||
@@ -1312,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
|
||||
@@ -147,14 +147,14 @@
|
||||
|
||||
switch(add_to)
|
||||
if("head")
|
||||
place_on_head(usr.get_active_hand(),usr)
|
||||
place_on_head(usr.get_active_held_item(),usr)
|
||||
|
||||
if("back")
|
||||
if(inventory_back)
|
||||
usr << "<span class='warning'>It's already wearing something!</span>"
|
||||
return
|
||||
else
|
||||
var/obj/item/item_to_add = usr.get_active_hand()
|
||||
var/obj/item/item_to_add = usr.get_active_held_item()
|
||||
|
||||
if(!item_to_add)
|
||||
usr.visible_message("[usr] pets [src].","<span class='notice'>You rest your hand on [src]'s back for a moment.</span>")
|
||||
|
||||
@@ -144,19 +144,13 @@
|
||||
/mob/living/simple_animal/drone/examine(mob/user)
|
||||
var/msg = "<span class='info'>*---------*\nThis is \icon[src] \a <b>[src]</b>!\n"
|
||||
|
||||
//Left hand items
|
||||
if(l_hand && !(l_hand.flags&ABSTRACT))
|
||||
if(l_hand.blood_DNA)
|
||||
msg += "<span class='warning'>It is holding \icon[l_hand] [l_hand.gender==PLURAL?"some":"a"] blood-stained [l_hand.name] in its left hand!</span>\n"
|
||||
else
|
||||
msg += "It is holding \icon[l_hand] \a [l_hand] in its left hand.\n"
|
||||
|
||||
//Right hand items
|
||||
if(r_hand && !(r_hand.flags&ABSTRACT))
|
||||
if(r_hand.blood_DNA)
|
||||
msg += "<span class='warning'>It is holding \icon[r_hand] [r_hand.gender==PLURAL?"some":"a"] blood-stained [r_hand.name] in its right hand!</span>\n"
|
||||
else
|
||||
msg += "It is holding \icon[r_hand] \a [r_hand] in its right hand.\n"
|
||||
//Hands
|
||||
for(var/obj/item/I in held_items)
|
||||
if(!(I.flags & ABSTRACT))
|
||||
if(I.blood_DNA)
|
||||
msg += "<span class='warning'>It has \icon[I] [I.gender==PLURAL?"some":"a"] blood-stained [I.name] in its [get_held_index_name(get_held_index_of_item(I))]!</span>\n"
|
||||
else
|
||||
msg += "It has \icon[I] \a [I] in its [get_held_index_name(get_held_index_of_item(I))].\n"
|
||||
|
||||
//Internal storage
|
||||
if(internal_storage && !(internal_storage.flags&ABSTRACT))
|
||||
@@ -244,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,65 +6,57 @@
|
||||
//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)
|
||||
..()
|
||||
return
|
||||
if(user.get_active_hand())
|
||||
if(user.get_active_held_item())
|
||||
user << "<span class='warning'>Your hands are full!</span>"
|
||||
return
|
||||
visible_message("<span class='warning'>[user] starts picking up [src].</span>", \
|
||||
@@ -77,16 +69,13 @@
|
||||
user << "<span class='warning'>[src] is buckled to [buckled] and cannot be picked up!</span>"
|
||||
return
|
||||
user << "<span class='notice'>You pick [src] up.</span>"
|
||||
drop_l_hand()
|
||||
drop_r_hand()
|
||||
drop_all_held_items()
|
||||
var/obj/item/clothing/head/drone_holder/DH = new /obj/item/clothing/head/drone_holder(src)
|
||||
DH.updateVisualAppearence(src)
|
||||
DH.drone = src
|
||||
user.put_in_hands(DH)
|
||||
forceMove(DH)
|
||||
return
|
||||
|
||||
..()
|
||||
|
||||
|
||||
/mob/living/simple_animal/drone/attackby(obj/item/I, mob/user)
|
||||
|
||||
@@ -49,10 +49,9 @@
|
||||
if(!istype(I))
|
||||
return
|
||||
|
||||
if(I == l_hand)
|
||||
l_hand = null
|
||||
else if(I == r_hand)
|
||||
r_hand = null
|
||||
var/index = get_held_index_of_item(I)
|
||||
if(index)
|
||||
held_items[index] = null
|
||||
update_inv_hands()
|
||||
|
||||
if(I.pulledby)
|
||||
|
||||
@@ -18,10 +18,13 @@
|
||||
drone_overlays[cache_index] = null
|
||||
|
||||
|
||||
/mob/living/simple_animal/drone/proc/update_inv_hands()
|
||||
/mob/living/simple_animal/drone/update_inv_hands()
|
||||
remove_overlay(DRONE_HANDS_LAYER)
|
||||
var/list/hands_overlays = list()
|
||||
|
||||
var/obj/item/l_hand = get_item_for_held_index(1)
|
||||
var/obj/item/r_hand = get_item_for_held_index(2)
|
||||
|
||||
var/y_shift = getItemPixelShiftY()
|
||||
|
||||
if(r_hand)
|
||||
@@ -38,7 +41,7 @@
|
||||
|
||||
if(client && hud_used && hud_used.hud_version != HUD_STYLE_NOHUD)
|
||||
r_hand.layer = ABOVE_HUD_LAYER
|
||||
r_hand.screen_loc = ui_rhand
|
||||
r_hand.screen_loc = ui_hand_position(get_held_index_of_item(r_hand))
|
||||
client.screen |= r_hand
|
||||
|
||||
if(l_hand)
|
||||
@@ -55,7 +58,7 @@
|
||||
|
||||
if(client && hud_used && hud_used.hud_version != HUD_STYLE_NOHUD)
|
||||
l_hand.layer = ABOVE_HUD_LAYER
|
||||
l_hand.screen_loc = ui_lhand
|
||||
l_hand.screen_loc = ui_hand_position(get_held_index_of_item(l_hand))
|
||||
client.screen |= l_hand
|
||||
|
||||
|
||||
@@ -87,16 +90,6 @@
|
||||
|
||||
apply_overlay(DRONE_HEAD_LAYER)
|
||||
|
||||
|
||||
//These procs serve as redirection so that the drone updates as expected when other things call these procs
|
||||
/mob/living/simple_animal/drone/update_inv_l_hand()
|
||||
update_inv_hands()
|
||||
|
||||
|
||||
/mob/living/simple_animal/drone/update_inv_r_hand()
|
||||
update_inv_hands()
|
||||
|
||||
|
||||
/mob/living/simple_animal/drone/update_inv_wear_mask()
|
||||
update_inv_head()
|
||||
|
||||
|
||||
@@ -187,8 +187,7 @@ var/global/list/parasites = list() //all currently existing/living guardians
|
||||
return 1
|
||||
|
||||
/mob/living/simple_animal/hostile/guardian/death()
|
||||
drop_l_hand()
|
||||
drop_r_hand()
|
||||
drop_all_held_items()
|
||||
..()
|
||||
if(summoner)
|
||||
summoner << "<span class='danger'><B>Your [name] died somehow!</span></B>"
|
||||
@@ -243,11 +242,10 @@ var/global/list/parasites = list() //all currently existing/living guardians
|
||||
return FALSE
|
||||
|
||||
. = TRUE
|
||||
if(I == l_hand)
|
||||
l_hand = null
|
||||
else if(I == r_hand)
|
||||
r_hand = null
|
||||
update_inv_hands()
|
||||
var/index = get_held_index_of_item(I)
|
||||
if(index)
|
||||
held_items[index] = null
|
||||
update_inv_hands()
|
||||
|
||||
if(I.pulledby)
|
||||
I.pulledby.stop_pulling()
|
||||
@@ -267,9 +265,11 @@ var/global/list/parasites = list() //all currently existing/living guardians
|
||||
overlays -= guardian_overlays[cache_index]
|
||||
guardian_overlays[cache_index] = null
|
||||
|
||||
/mob/living/simple_animal/hostile/guardian/proc/update_inv_hands()
|
||||
/mob/living/simple_animal/hostile/guardian/update_inv_hands()
|
||||
remove_overlay(GUARDIAN_HANDS_LAYER)
|
||||
var/list/hands_overlays = list()
|
||||
var/obj/item/l_hand = get_item_for_held_index(1)
|
||||
var/obj/item/r_hand = get_item_for_held_index(2)
|
||||
|
||||
if(r_hand)
|
||||
var/r_state = r_hand.item_state
|
||||
@@ -282,7 +282,7 @@ var/global/list/parasites = list() //all currently existing/living guardians
|
||||
|
||||
if(client && hud_used && hud_used.hud_version != HUD_STYLE_NOHUD)
|
||||
r_hand.layer = ABOVE_HUD_LAYER
|
||||
r_hand.screen_loc = ui_rhand
|
||||
r_hand.screen_loc = ui_hand_position(get_held_index_of_item(r_hand))
|
||||
client.screen |= r_hand
|
||||
|
||||
if(l_hand)
|
||||
@@ -296,19 +296,13 @@ var/global/list/parasites = list() //all currently existing/living guardians
|
||||
|
||||
if(client && hud_used && hud_used.hud_version != HUD_STYLE_NOHUD)
|
||||
l_hand.layer = ABOVE_HUD_LAYER
|
||||
l_hand.screen_loc = ui_lhand
|
||||
l_hand.screen_loc = ui_hand_position(get_held_index_of_item(l_hand))
|
||||
client.screen |= l_hand
|
||||
|
||||
if(hands_overlays.len)
|
||||
guardian_overlays[GUARDIAN_HANDS_LAYER] = hands_overlays
|
||||
apply_overlay(GUARDIAN_HANDS_LAYER)
|
||||
|
||||
/mob/living/simple_animal/hostile/guardian/update_inv_l_hand()
|
||||
update_inv_hands()
|
||||
|
||||
/mob/living/simple_animal/hostile/guardian/update_inv_r_hand()
|
||||
update_inv_hands()
|
||||
|
||||
/mob/living/simple_animal/hostile/guardian/regenerate_icons()
|
||||
update_inv_hands()
|
||||
|
||||
|
||||
@@ -60,9 +60,7 @@
|
||||
if(H.check_shields(90, "[name]", src, attack_type = THROWN_PROJECTILE_ATTACK))
|
||||
blocked = 1
|
||||
if(!blocked)
|
||||
|
||||
L.drop_r_hand()
|
||||
L.drop_l_hand()
|
||||
L.drop_all_held_items()
|
||||
L.visible_message("<span class='danger'>[src] slams into [L]!</span>", "<span class='userdanger'>[src] slams into you!</span>")
|
||||
L.apply_damage(20, BRUTE)
|
||||
playsound(get_turf(L), 'sound/effects/meteorimpact.ogg', 100, 1)
|
||||
|
||||
@@ -28,17 +28,13 @@
|
||||
if(dextrous)
|
||||
var/msg = "<span class='info'>*---------*\nThis is \icon[src] \a <b>[src]</b>!\n"
|
||||
msg += "[desc]\n"
|
||||
if(l_hand && !(l_hand.flags&ABSTRACT))
|
||||
if(l_hand.blood_DNA)
|
||||
msg += "<span class='warning'>It is holding \icon[l_hand] [l_hand.gender==PLURAL?"some":"a"] blood-stained [l_hand.name] in its left hand!</span>\n"
|
||||
else
|
||||
msg += "It is holding \icon[l_hand] \a [l_hand] in its left hand.\n"
|
||||
|
||||
if(r_hand && !(r_hand.flags&ABSTRACT))
|
||||
if(r_hand.blood_DNA)
|
||||
msg += "<span class='warning'>It is holding \icon[r_hand] [r_hand.gender==PLURAL?"some":"a"] blood-stained [r_hand.name] in its right hand!</span>\n"
|
||||
else
|
||||
msg += "It is holding \icon[r_hand] \a [r_hand] in its right hand.\n"
|
||||
for(var/obj/item/I in held_items)
|
||||
if(!(I.flags & ABSTRACT))
|
||||
if(I.blood_DNA)
|
||||
msg += "<span class='warning'>It has \icon[I] [I.gender==PLURAL?"some":"a"] blood-stained [I.name] in its [get_held_index_name(get_held_index_of_item(I))]!</span>\n"
|
||||
else
|
||||
msg += "It has \icon[I] \a [I] in its [get_held_index_name(get_held_index_of_item(I))].\n"
|
||||
|
||||
if(internal_storage && !(internal_storage.flags&ABSTRACT))
|
||||
if(internal_storage.blood_DNA)
|
||||
@@ -53,14 +49,12 @@
|
||||
/mob/living/simple_animal/hostile/guardian/dextrous/Recall()
|
||||
if(loc == summoner || cooldown > world.time)
|
||||
return 0
|
||||
drop_l_hand()
|
||||
drop_r_hand()
|
||||
drop_all_held_items()
|
||||
return ..() //lose items, then return
|
||||
|
||||
/mob/living/simple_animal/hostile/guardian/dextrous/snapback()
|
||||
if(summoner && !(get_dist(get_turf(summoner),get_turf(src)) <= range))
|
||||
drop_l_hand()
|
||||
drop_r_hand()
|
||||
drop_all_held_items()
|
||||
..() //lose items, then return
|
||||
|
||||
//SLOT HANDLING BULLSHIT FOR INTERNAL STORAGE
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user