Advertisement
Guest User

Untitled

a guest
Jan 25th, 2014
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.73 KB | None | 0 0
  1. class SaccageSubscriber implements EventSubscriberInterface
  2. {
  3.     public static function getSubscribedEvents()
  4.     {
  5.         return array(
  6.             SistearthEvent::AVANT_CALCUL_PK => array(
  7.                 array(
  8.                     'invalidatePk',
  9.                     0
  10.                 ),
  11.             )
  12.         );
  13.     }
  14.     public function invalidatePk(SistearthCalculPkEvent $event)
  15.     {
  16.         $attaquant = $event->getAttaquant();
  17.         $defenseur = $event->getDefenseur();
  18.  
  19.         if ($attaquant instanceof Joueur && $defenseur instanceof Joueur) {
  20.             if ($this->hasSaccageActif($defenseur, $attaquant->getRoyaume())) {
  21.                 $event->setForceFalse(true);
  22.             }
  23.         }
  24.     }
  25.  
  26. [...]
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement