mob
var
dead = FALSE
deactivated = FALSE
...but I've been thinking. Is something like the following viable for such a system?
mob
var
state = ALIVE
proc
get_state()
return state
verb
Die()
set category = "BIT"
state = DEAD
src << get_state()
Deactivate()
set category = "BIT"
state = DEACTIVATED
src << get_state()
Splorch()
set category = "BIT"
state = DEAD | DEACTIVATED
src << get_state()
Revive()
set category = "BIT"
state = ALIVE
src << get_state()
Move()
if(state & (DEAD | DEACTIVATED))
return FALSE
else
return ..()
var
const
TEST_VALUE = 0
DEAD = 1
DEACTIVATED = 2
ALIVE = 4
What I have here works (if I'm either dead, deactivated, or both I cannot move) but... yeah. I've never really used bitflags before so I'm not sure if I'm using them right in the first place.