Public repository for MUR pre alpha
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
649 B

  1. extends BaseInventory
  2. var rand:RandomNumberGenerator = RandomNumberGenerator.new()
  3. func _ready():
  4. rand.randomize()
  5. func _on_raceCar_road_entered(road):
  6. if is_network_master():
  7. if player != null:
  8. if player.is_in_group("first"):
  9. if route.get_last_road().get_index() <= (road.get_index() +2):
  10. type = rand.randi_range(0,roads.size() -2) # TODO: remove special, loop need fixes!
  11. index = rand.randi_range(0, roads[type].size() -1)
  12. route.rpc("add_road", roads[type][index], player.get_index())
  13. func set_player(new_player:Player):
  14. player = new_player
  15. player.race_car.connect("road_entered",self,"_on_raceCar_road_entered")