     for id in @orderIds()
       continue  if id in skipIds
 
-      action = @getAction(id)
-      player = @getPlayer(id)
-      team = @getTeam(id)
-
-      switch action.type
+      switch @getAction(id).type
         when 'switch' then @performSwitch(id)
         when 'move'   then @performMove(id)
 

    action = @getAction(id)
    pokemon = @getTeam(id).at(0)
    defenders = @getOpponentPokemon(id, @numActive)
    # todo: the move should be cloned and attached to the pokemon
    move = moves[action.name]

    @message "#{player.username}'s #{pokemon.name} used #{move.name}!"

    team = @getTeam(player.id)
    index = team.indexOf(toPokemon)

    @makeSwitch(player, index)

  hasWeather: (weatherName) =>
