def activate(self,activator=None): if not RunDownItem.activate(self): return False if self.is_active: TurnTaker.add_turntaker(self.owner) else: TurnTaker.clear_turntaker(self.owner) return True
def activate(self,activator=None): if self.is_active: # deactivate an active item self.is_active = False TurnTaker.clear_turntaker(self) return True elif self.full(): # can't activate one that's run out return False else: self.is_active = True TurnTaker.add_turntaker(self) self.inc(4) # activation costs 4 + 1 for the first turn; discouraging flickering self.take_turn() # so takes effect straight away if any turn taking behaviour return True
def take_turn(self): if self.inc(): TurnTaker.clear_turntaker(self) return True return False