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.

22 lines
677 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.set_road(roads[type][index], -1)
  13. route.rpc("set_road", roads[type][index], -1)
  14. func set_player(new_player:Player):
  15. player = new_player
  16. player.race_car.connect("road_entered",self,"_on_raceCar_road_entered")