Fixed bug with custom changelling gets his absosrb objective always failed.

Fixed runtime error when cyborg (or sometimes AI) looks at paper.
Healing in cryo without cryoaxodone now works correctly. (slow as before)
Fixed some more runtime errors.
Fixed heal_organ_damage for non-humans. Slitt have to do a lot of work here.


git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1305 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
rastaf.zero@gmail.com
2011-03-28 23:13:58 +00:00
parent af37c522e2
commit 9927cd9de7
9 changed files with 44 additions and 23 deletions
+3 -1
View File
@@ -58,7 +58,9 @@ datum
return the_id
trans_to(var/obj/target, var/amount=1, var/multiplier=1, var/preserve_data=1)//if preserve_data=0, the reagents data will be lost. Usefull if you use data for some strange stuff and don't want it to be transferred.
if (!target || src.total_volume<=0)
if (!target )
return
if (!target.reagents || src.total_volume<=0)
return
var/datum/reagents/R = target.reagents
amount = min(min(amount, src.total_volume), R.maximum_volume-R.total_volume)
+3 -1
View File
@@ -240,7 +240,9 @@ datum/mind
if (istype(objective, /datum/objective/absorb))
def_num = objective:num_to_eat
var/num_to_eat = input("Number to eat:", "Objective", def_num) as text
var/num_to_eat = input("Number to eat:", "Objective", def_num) as num|null
if (isnull(num_to_eat))
return
new_objective = new /datum/objective/absorb
new_objective.owner = src
new_objective:num_to_eat = num_to_eat
+2 -3
View File
@@ -169,9 +169,8 @@
occupant.oxyloss -= 1
//severe damage should heal waaay slower without proper chemicals
if(occupant.bodytemperature < 225)
if(occupant.bruteloss) occupant.bruteloss = max(0, occupant.bruteloss - min(1, 20/occupant.bruteloss))
if(occupant.fireloss) occupant.fireloss = max(0, occupant.fireloss - min(1, 20/occupant.fireloss))
if(occupant.toxloss) occupant.toxloss = max(0, occupant.toxloss - min(1, 20/occupant.toxloss))
occupant.toxloss = max(0, occupant.toxloss - min(1, 20/occupant.toxloss))
occupant.heal_organ_damage(min(1, 20/occupant.bruteloss),min(1, 20/occupant.fireloss))
if(beaker && (next_trans == 0))
beaker:reagents.trans_to(occupant, 1, 10)
beaker:reagents.reaction(occupant)
@@ -203,7 +203,12 @@ CLIPBOARDS
return
/obj/item/weapon/paper/attack_ai(var/mob/living/silicon/ai/user as mob)
if (get_dist(src, user.current) < 2)
var/dist
if (istype(user) && user.current) //is AI
dist = get_dist(src, user.current)
else //cyborg or AI not seeing through a camera
dist = get_dist(src, user)
if (dist < 2)
usr << browse(text("<HTML><HEAD><TITLE>[]</TITLE></HEAD><BODY><TT>[]</TT></BODY></HTML>", src.name, src.info), text("window=[]", src.name))
onclose(usr, "[src.name]")
else
@@ -800,3 +800,8 @@ In all, this is a lot like the monkey code. /N
src.health = 100
src.stat = 0
/mob/living/carbon/alien/heal_organ_damage(var/brute, var/burn)
bruteloss = max(0, bruteloss-brute) //HACK
fireloss = max(0, fireloss-burn) //HACK
src.updatehealth()
+1 -1
View File
@@ -87,7 +87,7 @@
return 0
src.burn_skin(shock_damage)
//src.fireloss += shock_damage //burn_skin will do this for us
src.updatehealth()
//src.updatehealth()
src.visible_message(
"\red [src] was shocked by the [source]!", \
"\red <B>You feel a powerful shock course through your body!</B>", \
+3 -14
View File
@@ -2696,18 +2696,7 @@
var/obj/item/clothing/gloves/G = src.gloves
siemens_coeff = G.siemens_coefficient
return ..(shock_damage,source,siemens_coeff)
/mob/living/carbon/human/proc/heal_organ_damage(var/brute, var/burn)
var/list/parts = list()
for(var/A in src.organs)
if(!src.organs[A]) continue
var/datum/organ/external/affecting = src.organs[A]
if(!istype(affecting)) continue
if((brute && affecting.brute_dam) || (burn && affecting.burn_dam))
parts += affecting
if(!parts.len) return
var/datum/organ/external/picked = pick(parts)
picked.heal_damage(brute,burn)
/mob/living/carbon/human/heal_organ_damage(var/brute, var/burn)
..()
src.UpdateDamageIcon()
src.updatehealth()
@@ -701,4 +701,9 @@
src.source.update_clothing()
src.target.update_clothing()
del(src)
return
return
/mob/living/carbon/monkey/heal_organ_damage(var/brute, var/burn)
bruteloss = max(0, bruteloss-brute) //HACK
fireloss = max(0, fireloss-burn) //HACK
src.updatehealth()
+15 -1
View File
@@ -2228,4 +2228,18 @@ note dizziness decrements automatically in the mob's Life() proc.
var/list/L = src.get_contents()
for(var/obj/O in L)
O.emp_act(severity)
..()
..()
/mob/proc/heal_organ_damage(var/brute, var/burn)
var/list/parts = list()
for(var/A in src.organs)
if(!src.organs[A]) continue
var/datum/organ/external/affecting = src.organs[A]
if(!istype(affecting)) continue
if((brute && affecting.brute_dam) || (burn && affecting.burn_dam))
parts += affecting
if(!parts.len) return
var/datum/organ/external/picked = pick(parts)
picked.heal_damage(brute,burn)
src.updatehealth()