Merge pull request #7631 from Zuhayr/dev-freeze

More fixes.
This commit is contained in:
Chinsky
2015-01-02 20:52:27 +03:00
12 changed files with 97 additions and 69 deletions

View File

@@ -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.
datum/hud/New(mob/owner)
mymob = owner
instantiate()
..()
/datum/hud/proc/hidden_inventory_update()
if(!mymob) return
if(ishuman(mymob))
var/mob/living/carbon/human/H = mymob
if(inventory_shown && hud_shown)
if(H.shoes) H.shoes.screen_loc = ui_shoes
if(H.gloves) H.gloves.screen_loc = ui_gloves
if(H.l_ear) H.l_ear.screen_loc = ui_l_ear
if(H.r_ear) H.r_ear.screen_loc = ui_r_ear
if(H.glasses) H.glasses.screen_loc = ui_glasses
if(H.w_uniform) H.w_uniform.screen_loc = ui_iclothing
if(H.wear_suit) H.wear_suit.screen_loc = ui_oclothing
if(H.wear_mask) H.wear_mask.screen_loc = ui_mask
if(H.head) H.head.screen_loc = ui_head
else
if(H.shoes) H.shoes.screen_loc = null
if(H.gloves) H.gloves.screen_loc = null
if(H.l_ear) H.l_ear.screen_loc = null
if(H.r_ear) H.r_ear.screen_loc = null
if(H.glasses) H.glasses.screen_loc = null
if(H.w_uniform) H.w_uniform.screen_loc = null
if(H.wear_suit) H.wear_suit.screen_loc = null
if(H.wear_mask) H.wear_mask.screen_loc = null
if(H.head) H.head.screen_loc = null
for(var/gear_slot in H.species.hud.gear)
var/list/hud_data = H.species.hud.gear[gear_slot]
if(inventory_shown && hud_shown)
switch(hud_data["slot"])
if(slot_head)
if(H.head) H.head.screen_loc = hud_data["loc"]
if(slot_shoes)
if(H.shoes) H.shoes.screen_loc = hud_data["loc"]
if(slot_l_ear)
if(H.l_ear) H.l_ear.screen_loc = hud_data["loc"]
if(slot_r_ear)
if(H.r_ear) H.r_ear.screen_loc = hud_data["loc"]
if(slot_gloves)
if(H.gloves) H.gloves.screen_loc = hud_data["loc"]
if(slot_glasses)
if(H.glasses) H.glasses.screen_loc = hud_data["loc"]
if(slot_w_uniform)
if(H.w_uniform) H.w_uniform.screen_loc = hud_data["loc"]
if(slot_wear_suit)
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()
@@ -174,20 +194,36 @@ datum/hud/New(mob/owner)
if(ishuman(mymob))
var/mob/living/carbon/human/H = mymob
if(hud_shown)
if(H.s_store) H.s_store.screen_loc = ui_sstore1
if(H.wear_id) H.wear_id.screen_loc = ui_id
if(H.belt) H.belt.screen_loc = ui_belt
if(H.back) H.back.screen_loc = ui_back
if(H.l_store) H.l_store.screen_loc = ui_storage1
if(H.r_store) H.r_store.screen_loc = ui_storage2
else
if(H.s_store) H.s_store.screen_loc = null
if(H.wear_id) H.wear_id.screen_loc = null
if(H.belt) H.belt.screen_loc = null
if(H.back) H.back.screen_loc = null
if(H.l_store) H.l_store.screen_loc = null
if(H.r_store) H.r_store.screen_loc = null
for(var/gear_slot in H.species.hud.gear)
var/list/hud_data = H.species.hud.gear[gear_slot]
if(hud_shown)
switch(hud_data["slot"])
if(slot_s_store)
if(H.s_store) H.s_store.screen_loc = hud_data["loc"]
if(slot_wear_id)
if(H.wear_id) H.wear_id.screen_loc = hud_data["loc"]
if(slot_belt)
if(H.belt) H.belt.screen_loc = hud_data["loc"]
if(slot_back)
if(H.back) H.back.screen_loc = hud_data["loc"]
if(slot_l_store)
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()

View File

@@ -98,7 +98,7 @@
holder.icon_state = "hudhealth-100"
C.images += holder
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
holder = patient.hud_list[STATUS_HUD]

View File

@@ -8,7 +8,7 @@
attack_verb = list("diced")
/obj/item/weapon/dice/New()
icon_state = "[name][rand(sides)]"
icon_state = "[name][rand(1,sides)]"
/obj/item/weapon/dice/d20
name = "d20"

View File

@@ -1141,6 +1141,8 @@
species.handle_post_spawn(src)
maxHealth = species.total_health
spawn(0)
regenerate_icons()
vessel.add_reagent("blood",560-vessel.total_volume)

View File

@@ -2,7 +2,7 @@
/mob/living/carbon/human/updatehealth()
if(status_flags & GODMODE)
health = species.total_health
health = maxHealth
stat = CONSCIOUS
return
var/total_burn = 0
@@ -15,10 +15,10 @@
var/tox_l = ((species.flags & NO_POISON) ? 0 : getToxLoss())
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
if( ((species.total_health - total_burn) < config.health_threshold_dead) && stat == DEAD)
if( ((maxHealth - total_burn) < config.health_threshold_dead) && stat == DEAD)
ChangeToHusk()
return

View File

@@ -1614,7 +1614,7 @@
if(stat == 2)
holder.icon_state = "hudhealth-100" // X_X
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]"
hud_list[HEALTH_HUD] = holder

View File

@@ -204,7 +204,7 @@
// Called when using the shredding behavior.
/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
for(var/datum/unarmed_attack/attack in unarmed_attacks)

View File

@@ -139,20 +139,10 @@
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>"
return
// TURF CHECK
else if(istype(O, /turf/simulated))
var/turf/T = O
// R WALL
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
else if(istype(O, /turf/simulated/wall/r_wall) || istype(O, /turf/simulated/floor/engine))
src << "<span class='alium'>You cannot dissolve this object.</span>"
return
if(check_alien_ability(200,0,"acid gland"))
new /obj/effect/alien/acid(get_turf(O), O)

View File

@@ -108,7 +108,7 @@
if (prob(5))
H << "<span class='alium'>You feel a soothing sensation come over you...</span>"
return 1
//next internal organs
for(var/datum/organ/internal/I in H.internal_organs)
if(I.damage > 0)
@@ -116,7 +116,7 @@
if (prob(5))
H << "<span class='alium'>You feel a soothing sensation within your [I.parent_organ]...</span>"
return 1
//next mend broken bones, approx 10 ticks each
for(var/datum/organ/external/E in H.bad_external_organs)
if (E.status & ORGAN_BROKEN)
@@ -124,7 +124,7 @@
if (E.mend_fracture())
H << "<span class='alium'>You feel something mend itself inside your [E.display_name].</span>"
return 1
return 0
/datum/species/xenos/handle_login_special(var/mob/living/carbon/human/H)
@@ -268,9 +268,6 @@
/mob/living/carbon/human/proc/resin
)
//maxHealth = 250
//health = 250
/datum/species/xenos/queen/handle_login_special(var/mob/living/carbon/human/H)
..()
// Make sure only one official queen exists at any point.

View File

@@ -86,6 +86,7 @@
edge = 0
/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))
return 0
if (user == target && (zone == "head" || zone == "eyes" || zone == "mouth"))
@@ -171,9 +172,13 @@
damage = 0
/datum/unarmed_attack/stomp/is_usable(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target, var/zone)
if (user.legcuffed)
return 0
if(!istype(target))
return 0
if (!user.lying && (target.lying || zone in list("l_foot", "r_foot")))
if(target.grabbed_by == user && target.lying)
return 0

View File

@@ -640,7 +640,7 @@
can_break_cuffs = 1
else if(istype(CM,/mob/living/carbon/human))
var/mob/living/carbon/human/H = CM
if(H.species.can_shred(H))
if(H.species.can_shred(H,1))
can_break_cuffs = 1
if(can_break_cuffs) //Don't want to do a lot of logic gating here.

View File

@@ -186,21 +186,20 @@
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))
return
D << "\red You begin decompiling the other drone."
D << "<span class='danger'>You begin decompiling [M].</span>"
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
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)
new/obj/effect/decal/cleanable/blood/oil(get_turf(src))
@@ -208,7 +207,6 @@
stored_comms["glass"] += 15
stored_comms["wood"] += 5
stored_comms["plastic"] += 5
return
else
continue