Changed way CPR lock works, no dependancy on world time.stored time now.

When someone starts doing CPR, it locks. After 3 ticks after CPR is done it unlocks. No other mobs can do CPR on same mob while it is locked.
((also it's one of places that can make CPR not start so I wanted ot replace timer with more simple semaphore))
This commit is contained in:
Chinsky
2012-11-16 20:11:28 +04:00
parent 25a3466285
commit 650dc3dab8

View File

@@ -433,8 +433,9 @@
return
message = "\red <B>[source] is trying to empty [target]'s pockets.</B>"
if("CPR")
if (target.cpr_time >= world.time + 3)
if (!target.cpr_time)
del(src)
target.cpr_time = 0
message = "\red <B>[source] is trying perform CPR on [target]!</B>"
if("id")
message = "\red <B>[source] is trying to take off [target.wear_id] from [target]'s uniform!</B>"
@@ -540,10 +541,7 @@ It can still be worn/put on as normal.
if (target.legcuffed)
strip_item = target.legcuffed
if("CPR")
if (target.cpr_time >= world.time + 30)
del(src)
if ((target.health >= -99.0 && target.health <= 0))
target.cpr_time = world.time
var/suff = min(target.getOxyLoss(), 7)
target.adjustOxyLoss(-suff)
target.updatehealth()
@@ -551,6 +549,8 @@ It can still be worn/put on as normal.
O.show_message("\red [source] performs CPR on [target]!", 1)
target << "\blue <b>You feel a breath of fresh air enter your lungs. It feels good.</b>"
source << "\red Repeat at least every 7 seconds."
spawn(3)
target.cpr_time = 1
if("dnainjector")
var/obj/item/weapon/dnainjector/S = item
if(S)