Ejemplo n.º 1
0
 void moveAction(Vec2 dir) override {
   if (!isGhost) {
     Player::moveAction(dir);
     return;
   }
   if (Creature *c = creature->getSquare(dir)->getCreature()) {
     if (c == owner)
       owner->popController();
     else
       c->pushController(PController(new PossessedController(c, owner, model, levelMemory, false)));
     creature->die();
   } else Player::moveAction(dir);
 }
Ejemplo n.º 2
0
Controller* Player::getPossessedController(Creature* c) {
  creature->pushController(PController(new DoNothingController(creature)));
  return new PossessedController(c, creature, model, levelMemory, true);
}
Ejemplo n.º 3
0
PController ControllerFactory::get(Creature* c) {
  return PController(fun(c));
}