Exemple #1
0
         if ($active_robot->get_id() == $target_robot->get_id()) {
             $active_robot = $target_robot;
         }
         $active_robot->check_items($this_player, $this_robot);
         $active_robot->check_attachments($this_player, $this_robot);
         $active_robot->check_weapons($this_player, $this_robot);
     }
     // Re-collect both player's active pokemon
     $this_robots_active = $this_player->get_robots_active();
     $target_robots_active = $this_player->get_robots_active();
     // Create an empty field to remove any leftover frames
     $this_battle->events_create();
     // If this the player's last robot
     if (empty($this_robots_active)) {
         // Trigger the battle complete event
         $this_battle->trigger_complete($target_player, $target_robot, $this_player, $this_robot);
     } elseif (empty($target_robots_active)) {
         // Trigger the battle complete event
         $this_battle->trigger_complete($this_player, $this_robot, $target_player, $target_robot);
     }
 }
 // Unset any item use flags for this player, so they can use one again next turn
 if ($this_player->has_flag('item_used_this_turn')) {
     $this_player->unset_flag('item_used_this_turn');
 }
 if ($target_player->has_flag('item_used_this_turn')) {
     $target_player->unset_flag('item_used_this_turn');
 }
 // Unset any switch use flags for this player, so they can use one again next turn
 if ($this_player->has_flag('switch_used_this_turn')) {
     $this_player->unset_flag('switch_used_this_turn');