mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-20 03:25:49 +01:00
Merge pull request #1852 from comma/master
Custom items, limbs and small fixes.
This commit is contained in:
@@ -225,4 +225,93 @@
|
||||
return l_hand
|
||||
else
|
||||
return r_hand
|
||||
return
|
||||
return
|
||||
|
||||
/mob/living/carbon/human/proc/equip_if_possible(obj/item/W, slot, del_on_fail = 1) // since byond doesn't seem to have pointers, this seems like the best way to do this :/
|
||||
//warning: icky code
|
||||
var/equipped = 0
|
||||
switch(slot)
|
||||
if(slot_back)
|
||||
if(!src.back)
|
||||
src.back = W
|
||||
equipped = 1
|
||||
if(slot_wear_mask)
|
||||
if(!src.wear_mask)
|
||||
src.wear_mask = W
|
||||
equipped = 1
|
||||
if(slot_handcuffed)
|
||||
if(!src.handcuffed)
|
||||
src.handcuffed = W
|
||||
equipped = 1
|
||||
if(slot_l_hand)
|
||||
if(!src.l_hand)
|
||||
src.l_hand = W
|
||||
equipped = 1
|
||||
if(slot_r_hand)
|
||||
if(!src.r_hand)
|
||||
src.r_hand = W
|
||||
equipped = 1
|
||||
if(slot_belt)
|
||||
if(!src.belt && src.w_uniform)
|
||||
src.belt = W
|
||||
equipped = 1
|
||||
if(slot_wear_id)
|
||||
if(!src.wear_id && src.w_uniform)
|
||||
src.wear_id = W
|
||||
equipped = 1
|
||||
if(slot_ears)
|
||||
if(!src.ears)
|
||||
src.ears = W
|
||||
equipped = 1
|
||||
if(slot_glasses)
|
||||
if(!src.glasses)
|
||||
src.glasses = W
|
||||
equipped = 1
|
||||
if(slot_gloves)
|
||||
if(!src.gloves)
|
||||
src.gloves = W
|
||||
equipped = 1
|
||||
if(slot_head)
|
||||
if(!src.head)
|
||||
src.head = W
|
||||
equipped = 1
|
||||
if(slot_shoes)
|
||||
if(!src.shoes)
|
||||
src.shoes = W
|
||||
equipped = 1
|
||||
if(slot_wear_suit)
|
||||
if(!src.wear_suit)
|
||||
src.wear_suit = W
|
||||
equipped = 1
|
||||
if(slot_w_uniform)
|
||||
if(!src.w_uniform)
|
||||
src.w_uniform = W
|
||||
equipped = 1
|
||||
if(slot_l_store)
|
||||
if(!src.l_store && src.w_uniform)
|
||||
src.l_store = W
|
||||
equipped = 1
|
||||
if(slot_r_store)
|
||||
if(!src.r_store && src.w_uniform)
|
||||
src.r_store = W
|
||||
equipped = 1
|
||||
if(slot_s_store)
|
||||
if(!src.s_store && src.wear_suit)
|
||||
src.s_store = W
|
||||
equipped = 1
|
||||
if(slot_in_backpack)
|
||||
if (src.back && istype(src.back, /obj/item/weapon/storage/backpack))
|
||||
var/obj/item/weapon/storage/backpack/B = src.back
|
||||
if(B.contents.len < B.storage_slots && W.w_class <= B.max_w_class)
|
||||
W.loc = B
|
||||
equipped = 1
|
||||
|
||||
if(equipped)
|
||||
W.layer = 20
|
||||
if(src.back && W.loc != src.back)
|
||||
W.loc = src
|
||||
else
|
||||
if (del_on_fail)
|
||||
del(W)
|
||||
return equipped
|
||||
|
||||
|
||||
@@ -50,6 +50,13 @@
|
||||
|
||||
/mob/living/carbon/attack_hand(mob/M as mob)
|
||||
if(!istype(M, /mob/living/carbon)) return
|
||||
if (hasorgans(M))
|
||||
var/datum/organ/external/temp = M:organs_by_name["r_hand"]
|
||||
if (M.hand)
|
||||
temp = M:organs_by_name["l_hand"]
|
||||
if(temp && temp.status & ORGAN_DESTROYED)
|
||||
M << "\red Yo- wait a minute."
|
||||
return
|
||||
|
||||
for(var/datum/disease/D in viruses)
|
||||
var/s_spread_type
|
||||
@@ -88,6 +95,13 @@
|
||||
/mob/living/carbon/attack_paw(mob/M as mob)
|
||||
if(!istype(M, /mob/living/carbon)) return
|
||||
|
||||
if (hasorgans(M))
|
||||
var/datum/organ/external/temp = M:organs_by_name["r_hand"]
|
||||
if (M.hand)
|
||||
temp = M:organs_by_name["l_hand"]
|
||||
if(temp && temp.status & ORGAN_DESTROYED)
|
||||
M << "\red Yo- wait a minute."
|
||||
return
|
||||
|
||||
for(var/datum/disease/D in viruses)
|
||||
var/s_spread_type
|
||||
@@ -211,6 +225,8 @@
|
||||
status += "blistered"
|
||||
else if(burndamage > 0)
|
||||
status += "numb"
|
||||
if(org.status & ORGAN_DESTROYED)
|
||||
status = "MISSING!"
|
||||
if(status == "")
|
||||
status = "OK"
|
||||
src.show_message(text("\t []My [] is [].",status=="OK"?"\blue ":"\red ",org.getDisplayName(),status),1)
|
||||
|
||||
@@ -104,6 +104,9 @@ emp_act
|
||||
for(var/obj/O in src)
|
||||
if(!O) continue
|
||||
O.emp_act(severity)
|
||||
for(var/datum/organ/external/O in organs)
|
||||
if(O.status & ORGAN_DESTROYED) continue
|
||||
O.emp_act(severity)
|
||||
..()
|
||||
|
||||
|
||||
@@ -111,7 +114,11 @@ emp_act
|
||||
if(!I || !user) return 0
|
||||
|
||||
var/datum/organ/external/affecting = get_organ(ran_zone(user.zone_sel.selecting))
|
||||
|
||||
if (!affecting)
|
||||
return
|
||||
if(affecting.status & ORGAN_DESTROYED)
|
||||
user << "What [affecting.display_name]?"
|
||||
return
|
||||
var/hit_area = affecting.display_name
|
||||
|
||||
if((user != src) && check_shields(I.force, "the [I.name]"))
|
||||
|
||||
@@ -290,7 +290,7 @@
|
||||
else if(E.name == "l_leg" || E.name == "l_foot" \
|
||||
|| E.name == "r_leg" || E.name == "r_foot" && !lying)
|
||||
leg_tally-- // let it fail even if just foot&leg
|
||||
if(E.status & ORGAN_BROKEN || E.status & ORGAN_DESTROYED)
|
||||
if(E.status & ORGAN_BROKEN || (E.status & ORGAN_DESTROYED && !E.amputated))
|
||||
if(E.name == "l_hand" || E.name == "l_arm")
|
||||
if(hand && equipped())
|
||||
if(E.status & ORGAN_SPLINTED && prob(10))
|
||||
|
||||
@@ -216,7 +216,6 @@ proc/get_damage_icon_part(damage_state, body_part)
|
||||
|
||||
//BASE MOB SPRITE
|
||||
/mob/living/carbon/human/proc/update_body(var/update_icons=1)
|
||||
|
||||
if(stand_icon) del(stand_icon)
|
||||
if(lying_icon) del(lying_icon)
|
||||
if(dna && dna.mutantrace) return
|
||||
@@ -229,7 +228,7 @@ proc/get_damage_icon_part(damage_state, body_part)
|
||||
if(gender == FEMALE) g = "f"
|
||||
|
||||
// whether to draw the individual limbs
|
||||
var/individual_limbs = 1
|
||||
var/individual_limbs = 0
|
||||
|
||||
//Base mob icon
|
||||
if(husk)
|
||||
@@ -242,9 +241,9 @@ proc/get_damage_icon_part(damage_state, body_part)
|
||||
stand_icon = new /icon('icons/mob/human.dmi', "skeleton_s")
|
||||
lying_icon = new /icon('icons/mob/human.dmi', "skeleton_l")
|
||||
else
|
||||
stand_icon = new /icon('icons/mob/human.dmi', "body_[g]_s")
|
||||
lying_icon = new /icon('icons/mob/human.dmi', "body_[g]_l")
|
||||
individual_limbs = 0
|
||||
stand_icon = new /icon('icons/mob/human.dmi', "torso_[g]_s")
|
||||
lying_icon = new /icon('icons/mob/human.dmi', "torso_[g]_l")
|
||||
individual_limbs = 1
|
||||
|
||||
//remove destroyed limbs from base icon
|
||||
for(var/datum/organ/external/part in organs)
|
||||
|
||||
@@ -370,6 +370,7 @@
|
||||
|
||||
var/mob/living/carbon/human/character = create_character() //creates the human and transfers vars and mind
|
||||
job_master.EquipRank(character, rank, 1) //equips the human
|
||||
EquipCustomItems(character)
|
||||
character.loc = pick(latejoin)
|
||||
character.lastarea = get_area(loc)
|
||||
|
||||
|
||||
@@ -1167,7 +1167,7 @@ datum/preferences
|
||||
|
||||
// Destroy/cyborgize organs
|
||||
for(var/name in organ_data)
|
||||
var/datum/organ/external/O = character.organs[name]
|
||||
var/datum/organ/external/O = character.organs_by_name[name]
|
||||
if(!O) continue
|
||||
|
||||
var/status = organ_data[name]
|
||||
|
||||
Reference in New Issue
Block a user