A team game with an emphasis on movement (with no shooting), inspired by Overwatch and Zineth
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.

56 lines
2.1 KiB

  1. extends Node
  2. # Semantic versioning, more or less
  3. # Major: Server cannot accept requests (i.e. new hero, or network protocol change)
  4. # Minor: Gameplay was significantly changed, but these can still technically play together (i.e. master-only scope added)
  5. # These are things a server admin might choose to reject if it was decided to be significant
  6. # Patch: Anything else: Bugfixes, UI changes, etc
  7. # Currently 0.0.0 which means API, gameplay, etc can change suddenly and frequently
  8. # Don't rely on it for anything
  9. # 1.0.0 will be the reddit release
  10. var version = "0.0.1"
  11. var args
  12. onready var Options = preload("res://scripts/args.gd").new().Options
  13. func _ready():
  14. args = _get_args()
  15. func get_master_player():
  16. return get_player(get_tree().get_network_unique_id())
  17. func get_player(netid):
  18. # We not %d? Because sometimes we need to do get_player(thing.get_name())
  19. var path = "/root/Level/Players/%s" % str(netid)
  20. if has_node(path):
  21. return get_node(path)
  22. else:
  23. return null
  24. func is_friendly(player):
  25. var mp = get_master_player()
  26. if mp:
  27. return player.player_info.is_right_team == mp.player_info.is_right_team
  28. else:
  29. return true # Doesn't matter, we're headless
  30. func _get_args():
  31. var opts = Options.new()
  32. opts.set_banner(('A non-violent MOBA inspired by Overwatch and Zineth'))
  33. opts.add('-singleplayer', false, 'Whether to run singeplayer, starting immediately')
  34. opts.add('-server', false, 'Whether to run as server')
  35. opts.add('-matchmaker', false, 'Whether to be the sole matchmaker')
  36. opts.add('-client', false, 'Immediately connect as client')
  37. opts.add('-silent', false, 'If the server is not playing, merely serving')
  38. opts.add('-ip', '127.0.0.1', 'The ip to connect to (client only!)')
  39. opts.add('-port', 54673, 'The port to run a server on or connect to')
  40. opts.add('-hero', 'r', 'Your choice of hero (index)')
  41. opts.add('-level', 'r', 'Your choice of level (index) - server only!')
  42. opts.add('-start-game', false, 'Join as a client and immediately start the game')
  43. opts.add('-ai', true, 'Run this client as AI')
  44. opts.add('-no-record', true, "Don't record this play for AI later")
  45. opts.add('-h', false, "Print help")
  46. opts.parse()
  47. return opts