Fix new genetics stealth powers.

This commit is contained in:
Rob Nelson
2014-01-24 20:49:06 -08:00
parent 4a0d15369b
commit ca93839df5
5 changed files with 17 additions and 12 deletions

View File

@@ -104,9 +104,6 @@
var/list/deactivation_messages=list()
/datum/dna/gene/basic/can_activate(var/mob/M,var/flags)
if(mutation==0)
return 0
// Probability check
if(flags & MUTCHK_FORCED || probinj(activation_prob,(flags&MUTCHK_FORCED)))
return 1

View File

@@ -84,7 +84,7 @@
/datum/dna/gene/disability/speech
can_activate(var/mob/M, var/flags)
// Can only activate one of these at a time.
if(is_type_in_list(/datum/dna/gene/disability/speech,M.mutations))
if(is_type_in_list(/datum/dna/gene/disability/speech,M.active_genes))
return 0
return ..(M,flags)

View File

@@ -30,10 +30,15 @@
/datum/dna/gene/basic/stealth
can_activate(var/mob/M, var/flags)
// Can only activate one of these at a time.
if(is_type_in_list(/datum/dna/gene/basic/stealth,M.mutations))
if(is_type_in_list(/datum/dna/gene/basic/stealth,M.active_genes))
testing("Cannot activate [type]: /datum/dna/gene/basic/stealth in M.active_genes.")
return 0
return ..(M,flags)
deactivate(var/mob/M)
..(M)
M.alpha=255
// WAS: /datum/bioEffect/darkcloak
/datum/dna/gene/basic/stealth/darkcloak
name = "Cloak of Darkness"
@@ -49,9 +54,9 @@
if(!istype(T))
return
if(T.lighting_lumcount <= 2)
M.alpha = round((255 * 0.15))
M.alpha = round(255 * 0.05)
else
M.alpha = round((255 * 0.80))
M.alpha = round(255 * 0.80)
//WAS: /datum/bioEffect/chameleon
/datum/dna/gene/basic/stealth/chameleon
@@ -64,8 +69,7 @@
block=CHAMELEONBLOCK
OnMobLife(var/mob/M)
if((world.timeofday - M.last_move_intent) >= 30 && !M.stat && M.canmove && !M.restrained())
M.alpha = round((255 * 0.15))
if((world.time - M.last_movement) >= 30 && !M.stat && M.canmove && !M.restrained())
M.alpha = round(255 * 0.10)
else
M.alpha = round((255 * 0.80))
return
M.alpha = round(255 * 0.80)

View File

@@ -222,4 +222,6 @@
var/list/active_genes=list()
var/kills=0
var/kills=0
var/last_movement = -100 // Last world.time the mob actually moved of its own accord.

View File

@@ -345,8 +345,10 @@
else if(mob.confused)
step(mob, pick(cardinal))
mob.last_movement=world.time
else
. = ..()
mob.last_movement=world.time
moving = 0