Page 1 of 1

Zombie during multipleactiveplayer?

Posted: 26 June 2020, 04:38
by Xom
Is there documentation on implementing zombie behavior for multipleactiveplayer states?

Re: Zombie during multipleactiveplayer?

Posted: 26 June 2020, 12:18
by Lymon Flowers
Personnally, I use the following:

Code: Select all

    function zombieTurn( $state, $active_player )
    {
    	$statename = $state [ 'name' ];
        switch ( $state [ 'type' ] )
        {
        [...]
        case 'multipleactiveplayer':
          $this->gamestate->setPlayerNonMultiactive( $active_player, 'zombiePass' );
          break;
        }
    }
That marks the zombie player as inactive and if they were the last (unlikey, thought), applies the zombiePass transition.

Of course, you may want to place additional game logic before the setPlayerNonMultiActive line.