mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-12 19:22:56 +00:00
@@ -135,37 +135,57 @@ var/list/global_huds = list(
|
|||||||
|
|
||||||
var/list/obj/screen/item_action/item_action_list = list() //Used for the item action ui buttons.
|
var/list/obj/screen/item_action/item_action_list = list() //Used for the item action ui buttons.
|
||||||
|
|
||||||
|
|
||||||
datum/hud/New(mob/owner)
|
datum/hud/New(mob/owner)
|
||||||
mymob = owner
|
mymob = owner
|
||||||
instantiate()
|
instantiate()
|
||||||
..()
|
..()
|
||||||
|
|
||||||
|
|
||||||
/datum/hud/proc/hidden_inventory_update()
|
/datum/hud/proc/hidden_inventory_update()
|
||||||
if(!mymob) return
|
if(!mymob) return
|
||||||
if(ishuman(mymob))
|
if(ishuman(mymob))
|
||||||
var/mob/living/carbon/human/H = mymob
|
var/mob/living/carbon/human/H = mymob
|
||||||
if(inventory_shown && hud_shown)
|
for(var/gear_slot in H.species.hud.gear)
|
||||||
if(H.shoes) H.shoes.screen_loc = ui_shoes
|
var/list/hud_data = H.species.hud.gear[gear_slot]
|
||||||
if(H.gloves) H.gloves.screen_loc = ui_gloves
|
if(inventory_shown && hud_shown)
|
||||||
if(H.l_ear) H.l_ear.screen_loc = ui_l_ear
|
switch(hud_data["slot"])
|
||||||
if(H.r_ear) H.r_ear.screen_loc = ui_r_ear
|
if(slot_head)
|
||||||
if(H.glasses) H.glasses.screen_loc = ui_glasses
|
if(H.head) H.head.screen_loc = hud_data["loc"]
|
||||||
if(H.w_uniform) H.w_uniform.screen_loc = ui_iclothing
|
if(slot_shoes)
|
||||||
if(H.wear_suit) H.wear_suit.screen_loc = ui_oclothing
|
if(H.shoes) H.shoes.screen_loc = hud_data["loc"]
|
||||||
if(H.wear_mask) H.wear_mask.screen_loc = ui_mask
|
if(slot_l_ear)
|
||||||
if(H.head) H.head.screen_loc = ui_head
|
if(H.l_ear) H.l_ear.screen_loc = hud_data["loc"]
|
||||||
else
|
if(slot_r_ear)
|
||||||
if(H.shoes) H.shoes.screen_loc = null
|
if(H.r_ear) H.r_ear.screen_loc = hud_data["loc"]
|
||||||
if(H.gloves) H.gloves.screen_loc = null
|
if(slot_gloves)
|
||||||
if(H.l_ear) H.l_ear.screen_loc = null
|
if(H.gloves) H.gloves.screen_loc = hud_data["loc"]
|
||||||
if(H.r_ear) H.r_ear.screen_loc = null
|
if(slot_glasses)
|
||||||
if(H.glasses) H.glasses.screen_loc = null
|
if(H.glasses) H.glasses.screen_loc = hud_data["loc"]
|
||||||
if(H.w_uniform) H.w_uniform.screen_loc = null
|
if(slot_w_uniform)
|
||||||
if(H.wear_suit) H.wear_suit.screen_loc = null
|
if(H.w_uniform) H.w_uniform.screen_loc = hud_data["loc"]
|
||||||
if(H.wear_mask) H.wear_mask.screen_loc = null
|
if(slot_wear_suit)
|
||||||
if(H.head) H.head.screen_loc = null
|
if(H.wear_suit) H.wear_suit.screen_loc = hud_data["loc"]
|
||||||
|
if(slot_wear_mask)
|
||||||
|
if(H.wear_mask) H.wear_mask.screen_loc = hud_data["loc"]
|
||||||
|
else
|
||||||
|
switch(hud_data["slot"])
|
||||||
|
if(slot_head)
|
||||||
|
if(H.head) H.head.screen_loc = null
|
||||||
|
if(slot_shoes)
|
||||||
|
if(H.shoes) H.shoes.screen_loc = null
|
||||||
|
if(slot_l_ear)
|
||||||
|
if(H.l_ear) H.l_ear.screen_loc = null
|
||||||
|
if(slot_r_ear)
|
||||||
|
if(H.r_ear) H.r_ear.screen_loc = null
|
||||||
|
if(slot_gloves)
|
||||||
|
if(H.gloves) H.gloves.screen_loc = null
|
||||||
|
if(slot_glasses)
|
||||||
|
if(H.glasses) H.glasses.screen_loc = null
|
||||||
|
if(slot_w_uniform)
|
||||||
|
if(H.w_uniform) H.w_uniform.screen_loc = null
|
||||||
|
if(slot_wear_suit)
|
||||||
|
if(H.wear_suit) H.wear_suit.screen_loc = null
|
||||||
|
if(slot_wear_mask)
|
||||||
|
if(H.wear_mask) H.wear_mask.screen_loc = null
|
||||||
|
|
||||||
|
|
||||||
/datum/hud/proc/persistant_inventory_update()
|
/datum/hud/proc/persistant_inventory_update()
|
||||||
@@ -174,20 +194,36 @@ datum/hud/New(mob/owner)
|
|||||||
|
|
||||||
if(ishuman(mymob))
|
if(ishuman(mymob))
|
||||||
var/mob/living/carbon/human/H = mymob
|
var/mob/living/carbon/human/H = mymob
|
||||||
if(hud_shown)
|
for(var/gear_slot in H.species.hud.gear)
|
||||||
if(H.s_store) H.s_store.screen_loc = ui_sstore1
|
var/list/hud_data = H.species.hud.gear[gear_slot]
|
||||||
if(H.wear_id) H.wear_id.screen_loc = ui_id
|
if(hud_shown)
|
||||||
if(H.belt) H.belt.screen_loc = ui_belt
|
switch(hud_data["slot"])
|
||||||
if(H.back) H.back.screen_loc = ui_back
|
if(slot_s_store)
|
||||||
if(H.l_store) H.l_store.screen_loc = ui_storage1
|
if(H.s_store) H.s_store.screen_loc = hud_data["loc"]
|
||||||
if(H.r_store) H.r_store.screen_loc = ui_storage2
|
if(slot_wear_id)
|
||||||
else
|
if(H.wear_id) H.wear_id.screen_loc = hud_data["loc"]
|
||||||
if(H.s_store) H.s_store.screen_loc = null
|
if(slot_belt)
|
||||||
if(H.wear_id) H.wear_id.screen_loc = null
|
if(H.belt) H.belt.screen_loc = hud_data["loc"]
|
||||||
if(H.belt) H.belt.screen_loc = null
|
if(slot_back)
|
||||||
if(H.back) H.back.screen_loc = null
|
if(H.back) H.back.screen_loc = hud_data["loc"]
|
||||||
if(H.l_store) H.l_store.screen_loc = null
|
if(slot_l_store)
|
||||||
if(H.r_store) H.r_store.screen_loc = null
|
if(H.l_store) H.l_store.screen_loc = hud_data["loc"]
|
||||||
|
if(slot_r_store)
|
||||||
|
if(H.r_store) H.r_store.screen_loc = hud_data["loc"]
|
||||||
|
else
|
||||||
|
switch(hud_data["slot"])
|
||||||
|
if(slot_s_store)
|
||||||
|
if(H.s_store) H.s_store.screen_loc = null
|
||||||
|
if(slot_wear_id)
|
||||||
|
if(H.wear_id) H.wear_id.screen_loc = null
|
||||||
|
if(slot_belt)
|
||||||
|
if(H.belt) H.belt.screen_loc = null
|
||||||
|
if(slot_back)
|
||||||
|
if(H.back) H.back.screen_loc = null
|
||||||
|
if(slot_l_store)
|
||||||
|
if(H.l_store) H.l_store.screen_loc = null
|
||||||
|
if(slot_r_store)
|
||||||
|
if(H.r_store) H.r_store.screen_loc = null
|
||||||
|
|
||||||
|
|
||||||
/datum/hud/proc/instantiate()
|
/datum/hud/proc/instantiate()
|
||||||
|
|||||||
@@ -98,7 +98,7 @@
|
|||||||
holder.icon_state = "hudhealth-100"
|
holder.icon_state = "hudhealth-100"
|
||||||
C.images += holder
|
C.images += holder
|
||||||
else
|
else
|
||||||
holder.icon_state = "hud[RoundHealth((patient.health-config.health_threshold_crit)/(patient.species.total_health-config.health_threshold_crit)*100)]"
|
holder.icon_state = "hud[RoundHealth((patient.health-config.health_threshold_crit)/(patient.maxHealth-config.health_threshold_crit)*100)]"
|
||||||
C.images += holder
|
C.images += holder
|
||||||
|
|
||||||
holder = patient.hud_list[STATUS_HUD]
|
holder = patient.hud_list[STATUS_HUD]
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
attack_verb = list("diced")
|
attack_verb = list("diced")
|
||||||
|
|
||||||
/obj/item/weapon/dice/New()
|
/obj/item/weapon/dice/New()
|
||||||
icon_state = "[name][rand(sides)]"
|
icon_state = "[name][rand(1,sides)]"
|
||||||
|
|
||||||
/obj/item/weapon/dice/d20
|
/obj/item/weapon/dice/d20
|
||||||
name = "d20"
|
name = "d20"
|
||||||
|
|||||||
@@ -1141,6 +1141,8 @@
|
|||||||
|
|
||||||
species.handle_post_spawn(src)
|
species.handle_post_spawn(src)
|
||||||
|
|
||||||
|
maxHealth = species.total_health
|
||||||
|
|
||||||
spawn(0)
|
spawn(0)
|
||||||
regenerate_icons()
|
regenerate_icons()
|
||||||
vessel.add_reagent("blood",560-vessel.total_volume)
|
vessel.add_reagent("blood",560-vessel.total_volume)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/mob/living/carbon/human/updatehealth()
|
/mob/living/carbon/human/updatehealth()
|
||||||
|
|
||||||
if(status_flags & GODMODE)
|
if(status_flags & GODMODE)
|
||||||
health = species.total_health
|
health = maxHealth
|
||||||
stat = CONSCIOUS
|
stat = CONSCIOUS
|
||||||
return
|
return
|
||||||
var/total_burn = 0
|
var/total_burn = 0
|
||||||
@@ -15,10 +15,10 @@
|
|||||||
var/tox_l = ((species.flags & NO_POISON) ? 0 : getToxLoss())
|
var/tox_l = ((species.flags & NO_POISON) ? 0 : getToxLoss())
|
||||||
var/clone_l = getCloneLoss()
|
var/clone_l = getCloneLoss()
|
||||||
|
|
||||||
health = species.total_health - oxy_l - tox_l - clone_l - total_burn - total_brute
|
health = maxHealth - oxy_l - tox_l - clone_l - total_burn - total_brute
|
||||||
|
|
||||||
//TODO: fix husking
|
//TODO: fix husking
|
||||||
if( ((species.total_health - total_burn) < config.health_threshold_dead) && stat == DEAD)
|
if( ((maxHealth - total_burn) < config.health_threshold_dead) && stat == DEAD)
|
||||||
ChangeToHusk()
|
ChangeToHusk()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
@@ -1614,7 +1614,7 @@
|
|||||||
if(stat == 2)
|
if(stat == 2)
|
||||||
holder.icon_state = "hudhealth-100" // X_X
|
holder.icon_state = "hudhealth-100" // X_X
|
||||||
else
|
else
|
||||||
var/percentage_health = RoundHealth((health-config.health_threshold_crit)/(species.total_health-config.health_threshold_crit)*100)
|
var/percentage_health = RoundHealth((health-config.health_threshold_crit)/(maxHealth-config.health_threshold_crit)*100)
|
||||||
holder.icon_state = "hud[percentage_health]"
|
holder.icon_state = "hud[percentage_health]"
|
||||||
hud_list[HEALTH_HUD] = holder
|
hud_list[HEALTH_HUD] = holder
|
||||||
|
|
||||||
|
|||||||
@@ -204,7 +204,7 @@
|
|||||||
// Called when using the shredding behavior.
|
// Called when using the shredding behavior.
|
||||||
/datum/species/proc/can_shred(var/mob/living/carbon/human/H, var/ignore_intent)
|
/datum/species/proc/can_shred(var/mob/living/carbon/human/H, var/ignore_intent)
|
||||||
|
|
||||||
if(ignore_intent && H.a_intent != "hurt")
|
if(!ignore_intent && H.a_intent != "hurt")
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
for(var/datum/unarmed_attack/attack in unarmed_attacks)
|
for(var/datum/unarmed_attack/attack in unarmed_attacks)
|
||||||
|
|||||||
@@ -139,20 +139,10 @@
|
|||||||
if(I.unacidable) //So the aliens don't destroy energy fields/singularies/other aliens/etc with their acid.
|
if(I.unacidable) //So the aliens don't destroy energy fields/singularies/other aliens/etc with their acid.
|
||||||
src << "<span class='alium'>You cannot dissolve this object.</span>"
|
src << "<span class='alium'>You cannot dissolve this object.</span>"
|
||||||
return
|
return
|
||||||
|
|
||||||
// TURF CHECK
|
// TURF CHECK
|
||||||
else if(istype(O, /turf/simulated))
|
else if(istype(O, /turf/simulated/wall/r_wall) || istype(O, /turf/simulated/floor/engine))
|
||||||
var/turf/T = O
|
src << "<span class='alium'>You cannot dissolve this object.</span>"
|
||||||
// R WALL
|
return
|
||||||
if(istype(T, /turf/simulated/wall/r_wall))
|
|
||||||
src << "<span class='alium'>You cannot dissolve this object.</span>"
|
|
||||||
return
|
|
||||||
// R FLOOR
|
|
||||||
if(istype(T, /turf/simulated/floor/engine))
|
|
||||||
src << "<span class='alium'>You cannot dissolve this object.</span>"
|
|
||||||
return
|
|
||||||
else// Not a type we can acid.
|
|
||||||
return
|
|
||||||
|
|
||||||
if(check_alien_ability(200,0,"acid gland"))
|
if(check_alien_ability(200,0,"acid gland"))
|
||||||
new /obj/effect/alien/acid(get_turf(O), O)
|
new /obj/effect/alien/acid(get_turf(O), O)
|
||||||
|
|||||||
@@ -108,7 +108,7 @@
|
|||||||
if (prob(5))
|
if (prob(5))
|
||||||
H << "<span class='alium'>You feel a soothing sensation come over you...</span>"
|
H << "<span class='alium'>You feel a soothing sensation come over you...</span>"
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
//next internal organs
|
//next internal organs
|
||||||
for(var/datum/organ/internal/I in H.internal_organs)
|
for(var/datum/organ/internal/I in H.internal_organs)
|
||||||
if(I.damage > 0)
|
if(I.damage > 0)
|
||||||
@@ -116,7 +116,7 @@
|
|||||||
if (prob(5))
|
if (prob(5))
|
||||||
H << "<span class='alium'>You feel a soothing sensation within your [I.parent_organ]...</span>"
|
H << "<span class='alium'>You feel a soothing sensation within your [I.parent_organ]...</span>"
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
//next mend broken bones, approx 10 ticks each
|
//next mend broken bones, approx 10 ticks each
|
||||||
for(var/datum/organ/external/E in H.bad_external_organs)
|
for(var/datum/organ/external/E in H.bad_external_organs)
|
||||||
if (E.status & ORGAN_BROKEN)
|
if (E.status & ORGAN_BROKEN)
|
||||||
@@ -124,7 +124,7 @@
|
|||||||
if (E.mend_fracture())
|
if (E.mend_fracture())
|
||||||
H << "<span class='alium'>You feel something mend itself inside your [E.display_name].</span>"
|
H << "<span class='alium'>You feel something mend itself inside your [E.display_name].</span>"
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
/datum/species/xenos/handle_login_special(var/mob/living/carbon/human/H)
|
/datum/species/xenos/handle_login_special(var/mob/living/carbon/human/H)
|
||||||
@@ -268,9 +268,6 @@
|
|||||||
/mob/living/carbon/human/proc/resin
|
/mob/living/carbon/human/proc/resin
|
||||||
)
|
)
|
||||||
|
|
||||||
//maxHealth = 250
|
|
||||||
//health = 250
|
|
||||||
|
|
||||||
/datum/species/xenos/queen/handle_login_special(var/mob/living/carbon/human/H)
|
/datum/species/xenos/queen/handle_login_special(var/mob/living/carbon/human/H)
|
||||||
..()
|
..()
|
||||||
// Make sure only one official queen exists at any point.
|
// Make sure only one official queen exists at any point.
|
||||||
|
|||||||
@@ -86,6 +86,7 @@
|
|||||||
edge = 0
|
edge = 0
|
||||||
|
|
||||||
/datum/unarmed_attack/bite/is_usable(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target, var/zone)
|
/datum/unarmed_attack/bite/is_usable(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target, var/zone)
|
||||||
|
|
||||||
if (user.wear_mask && istype(user.wear_mask, /obj/item/clothing/mask/muzzle))
|
if (user.wear_mask && istype(user.wear_mask, /obj/item/clothing/mask/muzzle))
|
||||||
return 0
|
return 0
|
||||||
if (user == target && (zone == "head" || zone == "eyes" || zone == "mouth"))
|
if (user == target && (zone == "head" || zone == "eyes" || zone == "mouth"))
|
||||||
@@ -171,9 +172,13 @@
|
|||||||
damage = 0
|
damage = 0
|
||||||
|
|
||||||
/datum/unarmed_attack/stomp/is_usable(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target, var/zone)
|
/datum/unarmed_attack/stomp/is_usable(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target, var/zone)
|
||||||
|
|
||||||
if (user.legcuffed)
|
if (user.legcuffed)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
if(!istype(target))
|
||||||
|
return 0
|
||||||
|
|
||||||
if (!user.lying && (target.lying || zone in list("l_foot", "r_foot")))
|
if (!user.lying && (target.lying || zone in list("l_foot", "r_foot")))
|
||||||
if(target.grabbed_by == user && target.lying)
|
if(target.grabbed_by == user && target.lying)
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
@@ -640,7 +640,7 @@
|
|||||||
can_break_cuffs = 1
|
can_break_cuffs = 1
|
||||||
else if(istype(CM,/mob/living/carbon/human))
|
else if(istype(CM,/mob/living/carbon/human))
|
||||||
var/mob/living/carbon/human/H = CM
|
var/mob/living/carbon/human/H = CM
|
||||||
if(H.species.can_shred(H))
|
if(H.species.can_shred(H,1))
|
||||||
can_break_cuffs = 1
|
can_break_cuffs = 1
|
||||||
|
|
||||||
if(can_break_cuffs) //Don't want to do a lot of logic gating here.
|
if(can_break_cuffs) //Don't want to do a lot of logic gating here.
|
||||||
|
|||||||
@@ -186,21 +186,20 @@
|
|||||||
|
|
||||||
else if(istype(M,/mob/living/silicon/robot/drone) && !M.client)
|
else if(istype(M,/mob/living/silicon/robot/drone) && !M.client)
|
||||||
|
|
||||||
var/mob/living/silicon/robot/drone/D = src.loc
|
var/mob/living/silicon/robot/D = src.loc
|
||||||
|
|
||||||
if(!istype(D))
|
if(!istype(D))
|
||||||
return
|
return
|
||||||
|
|
||||||
D << "\red You begin decompiling the other drone."
|
D << "<span class='danger'>You begin decompiling [M].</span>"
|
||||||
|
|
||||||
if(!do_after(D,50))
|
if(!do_after(D,50))
|
||||||
D << "\red You need to remain still while decompiling such a large object."
|
D << "<span class='danger'>You need to remain still while decompiling such a large object.</span>"
|
||||||
return
|
return
|
||||||
|
|
||||||
if(!M || !D) return
|
if(!M || !D) return
|
||||||
|
|
||||||
D << "\red You carefully and thoroughly decompile your downed fellow, storing as much of its resources as you can within yourself."
|
D << "<span class='danger'>You carefully and thoroughly decompile [M], storing as much of its resources as you can within yourself.</span>"
|
||||||
|
|
||||||
del(M)
|
del(M)
|
||||||
new/obj/effect/decal/cleanable/blood/oil(get_turf(src))
|
new/obj/effect/decal/cleanable/blood/oil(get_turf(src))
|
||||||
|
|
||||||
@@ -208,7 +207,6 @@
|
|||||||
stored_comms["glass"] += 15
|
stored_comms["glass"] += 15
|
||||||
stored_comms["wood"] += 5
|
stored_comms["wood"] += 5
|
||||||
stored_comms["plastic"] += 5
|
stored_comms["plastic"] += 5
|
||||||
|
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user