{"commit":"03c11cd68e73821d79e37b99bf542c24b23f8c8b","subject":"testing init","message":"testing init\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/sample_tests.gd","new_file":"src\/scripts\/sample_tests.gd","new_contents":"extends \"res:\/\/scripts\/gut.gd\".Test\n\nvar PuzzleManager = preload(\"res:\/\/scripts\/PuzzleManager.gd\")\n\nfunc setup():\n\tgut.p(\"ran setup\", 2)\n\nfunc teardown():\n\tgut.p(\"ran teardown\", 2)\n\nfunc test_assert_eq_number_equal():\n\tPuzzleManager.instance()\n\tgut.assert_eq('asf', 'asdf', \"Should pass\")\n\n","old_contents":"extends \"res:\/\/scripts\/gut.gd\".Test\n\n\n\nfunc setup():\n\tgut.p(\"ran setup\", 2)\n\nfunc teardown():\n\tgut.p(\"ran teardown\", 2)\n\nfunc test_assert_eq_number_equal():\n gut.assert_eq('asdf', 'asdf', \"Should pass\")\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"cb937d91ff9832e57bafb76a1aa73f1d494442fe","subject":"Fix the display count for tests","message":"Fix the display count for tests\n","repos":"groboclown\/godot-bootstrap","old_file":"components\/unit_tests\/main.gd","new_file":"components\/unit_tests\/main.gd","new_contents":"# Run as \"godot -s main.gd\"\r\n\r\nextends SceneTree\r\n\r\nconst TEST_SOURCES = \"res:\/\/tests\/\"\r\nvar BASE_TEST_CLASS = load(TEST_SOURCES + \"base.gd\")\r\n\r\nfunc _init():\r\n\tvar tests = find_tests_from_dir(TEST_SOURCES)\r\n\trun_tests(tests)\r\n\tquit()\r\n\r\n\r\nfunc find_tests_from_dir(path):\r\n\t#print(\"Finding in \" + path)\r\n\tvar ret = []\r\n\tvar dir = Directory.new()\r\n\tdir.open(path)\r\n\tdir.list_dir_begin()\r\n\tvar file_name = dir.get_next()\r\n\twhile file_name != \"\":\r\n\t\tvar name = path + file_name\r\n\t\tif dir.current_is_dir():\r\n\t\t\t#print(\"Checking dir \" + file_name + \" [\" + file_name.right(file_name.length() - 6)+ \"]\")\r\n\t\t\tif file_name.right(file_name.length() - 6) == \"_tests\":\r\n\t\t\t\tfor f in find_tests_from_dir(name + \"\/\"):\r\n\t\t\t\t\tret.append(f)\r\n\t\telse:\r\n\t\t\tvar f = File.new()\r\n\t\t\t#print(\"Checking file \" + name)\r\n\t\t\tif name.right(name.length() - 3) == \".gd\" && f.file_exists(name):\r\n\t\t\t\t# print(\"TEST ADDED \" + name)\r\n\t\t\t\tret.append(name)\r\n\t\tfile_name = dir.get_next()\r\n\tdir.list_dir_end()\r\n\treturn ret\r\n\r\n\r\nfunc run_tests(tests):\r\n\tvar results = ResultCollector.new()\r\n\tfor test in tests:\r\n\t\tvar test_instance = create_test(test)\r\n\t\tif test_instance != null:\r\n\t\t\trun_test(test, test_instance, results)\r\n\tresults._end()\r\n\r\n\r\n\r\nfunc run_test(test_file, test_instance, results):\r\n\t# print(\"Running \" + test_file)\r\n\ttest_instance.filename = test_file.get_file()\r\n\ttest_instance.filename = test_instance.filename.left(test_instance.filename.length() - 3)\r\n\ttest_instance.run(results)\r\n\r\n\r\nfunc create_test(test_file):\r\n\tif test_file.to_lower().find(\"\/test_\") < 0:\r\n\t\t# don't even report it.\r\n\t\t#print(\"ignoring \" + test_file)\r\n\t\treturn null\r\n\tvar test_class = load(test_file)\r\n\tif test_class != null:\r\n\t\tvar test_instance = test_class.new()\r\n\t\tif test_instance != null && test_instance extends BASE_TEST_CLASS:\r\n\t\t\treturn test_instance\r\n\t\tprint(\"*** SETUP ERROR: Not a valid test instance: \" + test_file)\r\n\telse:\r\n\t\tprint(\"*** SETUP ERROR: Could not load file \" + test_file)\r\n\treturn null\r\n\r\n\r\nclass ResultCollector:\r\n\t# This can be replaced or modified to allow for different kinds of output.\r\n\t# For example, a version could output the test results as a JSON object.\r\n\r\n\t# Results for all suites\r\n\tvar suites = []\r\n\r\n\t# Current suite data\r\n\tvar suite_name = null\r\n\tvar test_stack = []\r\n\tvar current_suite = null\r\n\tvar current_test = null\r\n\r\n\tfunc start_suite(name):\r\n\t\tif suite_name != null:\r\n\t\t\tend_suite()\r\n\t\tsuite_name = name\r\n\r\n\t\t# The start and end of the suite should be the suite-wide setup\/teardown\r\n\t\tcurrent_test = {\r\n\t\t\t\"name\": \"<>\",\r\n\t\t\t\"errors\": []\r\n\t\t}\r\n\t\ttest_stack = [ current_test ]\r\n\t\tcurrent_suite = {\r\n\t\t\t\"name\": suite_name,\r\n\t\t\t\"tests\": [ current_test ],\r\n\t\t\t\"error_count\": 0\r\n\t\t}\r\n\t\tsuites.append(current_suite)\r\n\r\n\tfunc end_suite():\r\n\t\tif suite_name == null:\r\n\t\t\treturn\r\n\t\t# Display a \"- 1\" on the test count, because otherwise this will include\r\n\t\t# the <> test, which we shouldn't count towards the total.\r\n\t\tif current_suite[\"error_count\"] <= 0:\r\n\t\t\tprint(suite_name + \": Success (\" + str(current_suite[\"tests\"].size() - 1) + \" tests)\")\r\n\t\telse:\r\n\t\t\tprint(suite_name + \": Failed (\" + str(current_suite[\"error_count\"]) + \" errors, \" + str(current_suite[\"tests\"].size() - 1) + \" tests)\")\r\n\t\tsuite_name = null\r\n\t\tcurrent_suite = null\r\n\t\tcurrent_test = null\r\n\r\n\tfunc start_test(test_name):\r\n\t\tcurrent_test = { \"name\": test_name, \"errors\": [] }\r\n\t\ttest_stack.append(current_test)\r\n\t\tcurrent_suite[\"tests\"].append(current_test)\r\n\r\n\tfunc end_test():\r\n\t\tif test_stack.size() > 0:\r\n\t\t\tcurrent_test = test_stack[test_stack.size() - 1]\r\n\t\t\ttest_stack.pop_back()\r\n\t\telse:\r\n\t\t\tcurrent_test = null\r\n\r\n\tfunc add_error(text):\r\n\t\tif current_suite == null || current_test == null:\r\n\t\t\t# We're outside the context of a suite or test. Shouldn't happen.\r\n\t\t\tprinterr(\"<> Failed: \" + text)\r\n\t\telse:\r\n\t\t\tcurrent_test[\"errors\"].append(text)\r\n\t\t\tcurrent_suite[\"error_count\"] += 1\r\n\t\t\tprinterr(suite_name + \"::\" + current_test[\"name\"] + \": \" + text)\r\n\r\n\t\t# It would be nice if we could capture the stack, so that the errors\r\n\t\t# could be assembled in a better form. But, currently, Godot does not\r\n\t\t# support this.\r\n\t\tprint_stack()\r\n\r\n\tfunc has_error():\r\n\t\tif current_test == null:\r\n\t\t\treturn false\r\n\t\treturn current_test[\"errors\"].size() > 0\r\n\r\n\r\n\tfunc _end():\r\n\t\t# All test results are displayed during execution.\r\n\t\t# But we'll post a final summary\r\n\t\tvar test_count = 0\r\n\t\tvar error_count = 0\r\n\t\tvar result\r\n\t\tfor result in suites:\r\n\t\t\ttest_count += result[\"tests\"].size()\r\n\t\t\terror_count += result[\"error_count\"]\r\n\t\tprint(\"==============================\")\r\n\t\tif error_count > 0:\r\n\t\t\tprinterr(\"**** Test Failures ****\")\r\n\t\telse:\r\n\t\t\tprinterr(\"**** Success ****\")\r\n\t\tprinterr(\"Total Tests Ran: \" + str(test_count))\r\n\t\tprinterr(\"Total Errors: \" + str(error_count))\r\n","old_contents":"# Run as \"godot -s main.gd\"\r\n\r\nextends SceneTree\r\n\r\nconst TEST_SOURCES = \"res:\/\/tests\/\"\r\nvar BASE_TEST_CLASS = load(TEST_SOURCES + \"base.gd\")\r\n\r\nfunc _init():\r\n\tvar tests = find_tests_from_dir(TEST_SOURCES)\r\n\trun_tests(tests)\r\n\tquit()\r\n\r\n\r\nfunc find_tests_from_dir(path):\r\n\t#print(\"Finding in \" + path)\r\n\tvar ret = []\r\n\tvar dir = Directory.new()\r\n\tdir.open(path)\r\n\tdir.list_dir_begin()\r\n\tvar file_name = dir.get_next()\r\n\twhile file_name != \"\":\r\n\t\tvar name = path + file_name\r\n\t\tif dir.current_is_dir():\r\n\t\t\t#print(\"Checking dir \" + file_name + \" [\" + file_name.right(file_name.length() - 6)+ \"]\")\r\n\t\t\tif file_name.right(file_name.length() - 6) == \"_tests\":\r\n\t\t\t\tfor f in find_tests_from_dir(name + \"\/\"):\r\n\t\t\t\t\tret.append(f)\r\n\t\telse:\r\n\t\t\tvar f = File.new()\r\n\t\t\t#print(\"Checking file \" + name)\r\n\t\t\tif name.right(name.length() - 3) == \".gd\" && f.file_exists(name):\r\n\t\t\t\t# print(\"TEST ADDED \" + name)\r\n\t\t\t\tret.append(name)\r\n\t\tfile_name = dir.get_next()\r\n\tdir.list_dir_end()\r\n\treturn ret\r\n\r\n\r\nfunc run_tests(tests):\r\n\tvar results = ResultCollector.new()\r\n\tfor test in tests:\r\n\t\tvar test_instance = create_test(test)\r\n\t\tif test_instance != null:\r\n\t\t\trun_test(test, test_instance, results)\r\n\tresults._end()\r\n\r\n\r\n\r\nfunc run_test(test_file, test_instance, results):\r\n\t# print(\"Running \" + test_file)\r\n\ttest_instance.filename = test_file.get_file()\r\n\ttest_instance.filename = test_instance.filename.left(test_instance.filename.length() - 3)\r\n\ttest_instance.run(results)\r\n\r\n\r\nfunc create_test(test_file):\r\n\tif test_file.to_lower().find(\"\/test_\") < 0:\r\n\t\t# don't even report it.\r\n\t\t#print(\"ignoring \" + test_file)\r\n\t\treturn null\r\n\tvar test_class = load(test_file)\r\n\tif test_class != null:\r\n\t\tvar test_instance = test_class.new()\r\n\t\tif test_instance != null && test_instance extends BASE_TEST_CLASS:\r\n\t\t\treturn test_instance\r\n\t\tprint(\"*** SETUP ERROR: Not a valid test instance: \" + test_file)\r\n\telse:\r\n\t\tprint(\"*** SETUP ERROR: Could not load file \" + test_file)\r\n\treturn null\r\n\r\n\r\nclass ResultCollector:\r\n\t# This can be replaced or modified to allow for different kinds of output.\r\n\t# For example, a version could output the test results as a JSON object.\r\n\r\n\t# Results for all suites\r\n\tvar suites = []\r\n\r\n\t# Current suite data\r\n\tvar suite_name = null\r\n\tvar test_stack = []\r\n\tvar current_suite = null\r\n\tvar current_test = null\r\n\r\n\tfunc start_suite(name):\r\n\t\tif suite_name != null:\r\n\t\t\tend_suite()\r\n\t\tsuite_name = name\r\n\r\n\t\t# The start and end of the suite should be the suite-wide setup\/teardown\r\n\t\tcurrent_test = {\r\n\t\t\t\"name\": \"<>\",\r\n\t\t\t\"errors\": []\r\n\t\t}\r\n\t\ttest_stack = [ current_test ]\r\n\t\tcurrent_suite = {\r\n\t\t\t\"name\": suite_name,\r\n\t\t\t\"tests\": [ current_test ],\r\n\t\t\t\"error_count\": 0\r\n\t\t}\r\n\t\tsuites.append(current_suite)\r\n\r\n\tfunc end_suite():\r\n\t\tif suite_name == null:\r\n\t\t\treturn\r\n\t\tif current_suite[\"error_count\"] <= 0:\r\n\t\t\tprint(suite_name + \": Success (\" + str(current_suite[\"tests\"].size()) + \" tests)\")\r\n\t\telse:\r\n\t\t\tprint(suite_name + \": Failed (\" + str(current_suite[\"error_count\"]) + \" errors, \" + str(current_suite[\"tests\"].size()) + \" tests)\")\r\n\t\tsuite_name = null\r\n\t\tcurrent_suite = null\r\n\t\tcurrent_test = null\r\n\r\n\tfunc start_test(test_name):\r\n\t\tcurrent_test = { \"name\": test_name, \"errors\": [] }\r\n\t\ttest_stack.append(current_test)\r\n\t\tcurrent_suite[\"tests\"].append(current_test)\r\n\r\n\tfunc end_test():\r\n\t\tif test_stack.size() > 0:\r\n\t\t\tcurrent_test = test_stack[test_stack.size() - 1]\r\n\t\t\ttest_stack.pop_back()\r\n\t\telse:\r\n\t\t\tcurrent_test = null\r\n\r\n\tfunc add_error(text):\r\n\t\tif current_suite == null || current_test == null:\r\n\t\t\t# We're outside the context of a suite or test. Shouldn't happen.\r\n\t\t\tprinterr(\"<> Failed: \" + text)\r\n\t\telse:\r\n\t\t\tcurrent_test[\"errors\"].append(text)\r\n\t\t\tcurrent_suite[\"error_count\"] += 1\r\n\t\t\tprinterr(suite_name + \"::\" + current_test[\"name\"] + \": \" + text)\r\n\r\n\t\t# It would be nice if we could capture the stack, so that the errors\r\n\t\t# could be assembled in a better form. But, currently, Godot does not\r\n\t\t# support this.\r\n\t\tprint_stack()\r\n\r\n\tfunc has_error():\r\n\t\tif current_test == null:\r\n\t\t\treturn false\r\n\t\treturn current_test[\"errors\"].size() > 0\r\n\r\n\r\n\tfunc _end():\r\n\t\t# All test results are displayed during execution.\r\n\t\t# But we'll post a final summary\r\n\t\tvar test_count = 0\r\n\t\tvar error_count = 0\r\n\t\tvar result\r\n\t\tfor result in suites:\r\n\t\t\ttest_count += result[\"tests\"].size()\r\n\t\t\terror_count += result[\"error_count\"]\r\n\t\tprint(\"==============================\")\r\n\t\tif error_count > 0:\r\n\t\t\tprinterr(\"**** Test Failures ****\")\r\n\t\telse:\r\n\t\t\tprinterr(\"**** Success ****\")\r\n\t\tprinterr(\"Total Tests Ran: \" + str(test_count))\r\n\t\tprinterr(\"Total Errors: \" + str(error_count))\r\n","returncode":0,"stderr":"","license":"cc0-1.0","lang":"GDScript"} {"commit":"49e8ca307b001e6bf9ccd0d6ea45ddfef595c4cf","subject":"tween in otherPuzzle","message":"tween in otherPuzzle\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Network.gd","new_file":"src\/scripts\/Network.gd","new_contents":"# Core networking\n\nextends Node\n\nconst REMOTE_FINISH = 0\nconst REMOTE_START = 1\nconst REMOTE_QUIT = 2\nconst REMOTE_BLOCK = 4\nconst REMOTE_PUZZLE_TRANSFORM = 5\nconst REMOTE_BLOCK_UPDATE = 6\n\nvar port = 54321\nvar root\nvar isNetwork\nvar isHost\nvar isClient = false\nvar server\nvar client\nvar connection\nvar proxy\n\nvar thisPuzzle\n\n#Store the peer stream used by both the lcient and server\nvar stream\n\nfunc _ready():\n\tisNetwork = false\n\tisHost = false\n\tvar label = get_tree().get_root().get_node(\"GUIManager\/OptionsMenu\/Panel\/PortField\/LineEdit\")\n\tif not label == null:\n\t\tlabel.set_text(str(port))\n\nfunc setPort(pt):\n\tport = pt;\n\nfunc connectTo(ip, pt):\n\tisClient = true #just to tell if it's doing something :S\n\tconnection = PacketPeerStream.new()\n\tstream = StreamPeerTCP.new()\n\tconnection.set_stream_peer(stream)\n\tstream.connect(ip, pt);\n\n\tif stream.get_status() == stream.STATUS_CONNECTED or stream.get_status() == stream.STATUS_CONNECTING:\n\t\tprint(\"Connecting to \" + ip + \":\" + str(port));\n\t\tproxy.set_process(true)\n\t\t#leave is_network as false to indicate we're still waiting for connection\n\n\nfunc host(pt):\n\tserver = TCP_Server.new()\n\t#connection = PacketPeerStream.new()\n\tisHost = true\n\tprint(\"Starting listening server on port \" + str(pt))\n\tif server.listen(pt) == 0:\n\t\tproxy.set_process(true)\n\t\tprint(\"Listening...\")\n\telse:\n\t\tprint(\"Failed to start server on port \" + str(pt));\n\nfunc _process(delta):\n\tif (isHost):\n\t\t#server processing stuff\n\t\t#use isNetwork to determine if we're still listening\n\t\tif !isNetwork:\n\t\t\tif server.is_connection_available():\n\t\t\t\tstream = server.take_connection()\n\t\t\t\tconnection = PacketPeerStream.new()\n\t\t\t\tconnection.set_stream_peer(stream)\n\t\t\t\tprint(\"Connecting with player...\")\n\t\t\t\tisNetwork = true\n\t\t\t\tserver.stop()\n\n\t\t\t\tgotoPuzzle()\n\n\t\t\t\tthisPuzzle = root.get_node(\"Puzzle\")\n\t\t\t\t#MAKE CALL TO PUZZLE SELECTER\n\t\telse: #not listening anymore, have a client\n\t\t\t#do quick check to make sure we're still\n\t\t\t#connected\n\t\t\tif !stream.is_connected():\n\t\t\t\tprint(\"Lost Connection!\");\n\t\t\t\tisNetwork = false\n\t\t\t\tproxy.set_process(false)\n\t\t\t\t#QUIT GAME\n\t\t\t\treturn\n\t\t\t#check if we have any data\n\t\t\tif connection.get_available_packet_count() > 0:\n\t\t\t\t#have to be careful about more than 1 packet per frame\n\t\t\t\tfor i in range(connection.get_available_packet_count()):\n\t\t\t\t\tvar dataArray = connection.get_var()\n\t\t\t\t\tProcessServerData(dataArray)\n\n\telse:\n\t\t#client processing stuff\n\t\tif !isNetwork:\n\t\t\t#Still waiting for connection confirmed\n\t\t\tif stream.get_status() == stream.STATUS_CONNECTED:\n\t\t\t\tprint(\"Connection established!\")\n\t\t\t\tisNetwork = true\n\n\t\t\t\tgotoPuzzle()\n\n\t\t\t\tthisPuzzle = root.get_node(\"Puzzle\")\n\t\t\t\treturn\n\t\t\tif stream.get_status() == stream.STATUS_NONE or stream.get_status() == stream.STATUS_ERROR:\n\t\t\t\tprint(\"Error establishing connection!\")\n\t\t\t\tproxy.set_process(false)\n\t\t\t\treturn\n\t\t\t\t#stop running process loop, cause we have no connection\n\t\telse:\n\t\t\t#connecton established and confirmed. Do regular data processing\n\t\t\t#check if we have any data\n\t\t\tif connection.get_available_packet_count() > 0:\n\t\t\t\tfor i in range(connection.get_available_packet_count()):\n\t\t\t\t\tvar dataArray = connection.get_var()\n\t\t\t\t\tProcessServerData(dataArray)\n\t\t\t\t\t#Call the server process script cuase it's peer to peer and we have the same functions!\n\n\nfunc disconnect():\n\t#need to do lots of things! If the server is open and listening, but has no connection just stop listening!\n\tif isHost and !isNetwork:\n\t\t#this means we're waiting for connection still\n\t\tserver.stop()\n\t\tprint(\"closing server listener!\")\n\telif isHost and isNetwork:\n\t\t#have connections. Need to send them stop packet, and close connection\n\t\tconnection.put_var([REMOTE_QUIT])\n\t\tstream.disconnect()\n\t\tprint(\"Closing connection to remote player...\")\n\telif !isHost and !isNetwork:\n\t\tstream.disconnect()\n\t\tprint(\"Halting connection request...\")\n\telif !isHost and isNetwork:\n\t\t#connected to server already\n\t\tstream.disconnect()\n\t\tprint(\"Disconnecting from server...\")\n\n\t#no matter where we wre before disconnect, set network to false and return to beginning screen!\n\tisNetwork = false;\n\tisHost = false;\n\tisClient = false;\n\n\tproxy.set_process(false)\n\n\n\tgotoMenu()\n\n\nfunc ProcessServerData(dataArray):\n\t#have an array of data. First element should be identifying int\n\tvar ID = dataArray[0]\n\tvar puzzle = root.get_node( \"Puzzle\" )\n\tvar gridMan = puzzle.otherPuzzle.get_node(\"GridView\/GridMan\")\n\t#no switch statement. I'm crying right now while i type this. My fingers are bleeding\n\tif ID == REMOTE_START:\n\t\t#read other person's puzzle\n\t\tprint(\"remote_stuff\")\n\t\tgridMan.set_puzzle(dataArray[1])\n\telif ID == REMOTE_FINISH:\n\t\t#again, do ending stuff\n\t\tprint(\"remote_finish: \" + str(dataArray[1]))\n\t\tgridMan.beatenWithScore(dataArray[1])\n\telif ID == REMOTE_QUIT:\n\t\t#omg those jerks!\n\t\tprint(\"remote_quit\")\n\t\tdisconnect()\n\telif ID == REMOTE_BLOCK:\n\t\t#get their block ifnormation!\n\t\tprint(\"remote_block\")\n\telif ID == REMOTE_PUZZLE_TRANSFORM:\n\t\t#sent block information\n\t\tvar translation = dataArray[1]\n\t\tthisPuzzle.otherPuzzle.set_transform(Transform( translation ))\n# better measurements!!!!\t\tthisPuzzle.otherPuzzle.set_translation(Vector3(20, 12, -40))\n##############3\n\t\tvar otherPosition = Vector3(20,0,10)\n\t\tvar tween = Tween.new()\n\t\ttween.interpolate_method(thisPuzzle.otherPuzzle, \"set_translation\", \\\n\t\tthisPuzzle.otherPuzzle.get_translation(), otherPosition, \\\n\t\t0.5, Tween.TRANS_SINE, Tween.EASE_OUT )\n\n\telif ID == REMOTE_BLOCK_UPDATE:\n\t\t#sent an updated block pair\n\t\tprint(\"block update\")\n\t\tgridMan.forceClickBlock(dataArray[1])\n\nfunc sendStart(puzzle):\n\tif !isNetwork:\n\t\tprint(\"Error sending start packet: not connected!\")\n\t\treturn\n\tvar er = connection.put_var([REMOTE_START, puzzle])\n\nfunc sendBlockUpdate(pos):\n\tif !isNetwork:\n\t\tprint(\"Error sending start packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_BLOCK_UPDATE, pos])\n\nfunc sendFinish(score):\n\tif !isNetwork:\n\t\tprint(\"Error sending finish packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_FINISH, root.get_node(\"Puzzle\").time.val])\n\nfunc sendQuit():\n\tif !isNetwork:\n\t\tprint(\"Error sending finish packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_QUIT])\n\nfunc sendTransform(translation):\n\tif !isNetwork:\n\t\tprint(\"Cannot send transformation over an unitialized network!\")\n\t\treturn\n\tconnection.put_var([REMOTE_PUZZLE_TRANSFORM, translation])\n\tprint(\"it got here\")\n\n\nfunc gotoMenu():\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\troot.add_child( load(\"res:\/\/menus.scn\") )\n\nfunc gotoPuzzle():\n\tvar guiMan = preload(\"GUIManager.gd\").new()\n\tguiMan.gotoPuzzleScene(root, true) # network = true\n","old_contents":"# Core networking\n\nextends Node\n\nconst REMOTE_FINISH = 0\nconst REMOTE_START = 1\nconst REMOTE_QUIT = 2\nconst REMOTE_BLOCK = 4\nconst REMOTE_PUZZLE_TRANSFORM = 5\nconst REMOTE_BLOCK_UPDATE = 6\n\nvar port = 54321\nvar root\nvar isNetwork\nvar isHost\nvar isClient = false\nvar server\nvar client\nvar connection\nvar proxy\n\nvar thisPuzzle\n\n#Store the peer stream used by both the lcient and server\nvar stream\n\nfunc _ready():\n\tisNetwork = false\n\tisHost = false\n\tvar label = get_tree().get_root().get_node(\"GUIManager\/OptionsMenu\/Panel\/PortField\/LineEdit\")\n\tif not label == null:\n\t\tlabel.set_text(str(port))\n\nfunc setPort(pt):\n\tport = pt;\n\nfunc connectTo(ip, pt):\n\tisClient = true #just to tell if it's doing something :S\n\tconnection = PacketPeerStream.new()\n\tstream = StreamPeerTCP.new()\n\tconnection.set_stream_peer(stream)\n\tstream.connect(ip, pt);\n\n\tif stream.get_status() == stream.STATUS_CONNECTED or stream.get_status() == stream.STATUS_CONNECTING:\n\t\tprint(\"Connecting to \" + ip + \":\" + str(port));\n\t\tproxy.set_process(true)\n\t\t#leave is_network as false to indicate we're still waiting for connection\n\n\nfunc host(pt):\n\tserver = TCP_Server.new()\n\t#connection = PacketPeerStream.new()\n\tisHost = true\n\tprint(\"Starting listening server on port \" + str(pt))\n\tif server.listen(pt) == 0:\n\t\tproxy.set_process(true)\n\t\tprint(\"Listening...\")\n\telse:\n\t\tprint(\"Failed to start server on port \" + str(pt));\n\nfunc _process(delta):\n\tif (isHost):\n\t\t#server processing stuff\n\t\t#use isNetwork to determine if we're still listening\n\t\tif !isNetwork:\n\t\t\tif server.is_connection_available():\n\t\t\t\tstream = server.take_connection()\n\t\t\t\tconnection = PacketPeerStream.new()\n\t\t\t\tconnection.set_stream_peer(stream)\n\t\t\t\tprint(\"Connecting with player...\")\n\t\t\t\tisNetwork = true\n\t\t\t\tserver.stop()\n\n\t\t\t\tgotoPuzzle()\n\n\t\t\t\tthisPuzzle = root.get_node(\"Puzzle\")\n\t\t\t\t#MAKE CALL TO PUZZLE SELECTER\n\t\telse: #not listening anymore, have a client\n\t\t\t#do quick check to make sure we're still\n\t\t\t#connected\n\t\t\tif !stream.is_connected():\n\t\t\t\tprint(\"Lost Connection!\");\n\t\t\t\tisNetwork = false\n\t\t\t\tproxy.set_process(false)\n\t\t\t\t#QUIT GAME\n\t\t\t\treturn\n\t\t\t#check if we have any data\n\t\t\tif connection.get_available_packet_count() > 0:\n\t\t\t\t#have to be careful about more than 1 packet per frame\n\t\t\t\tfor i in range(connection.get_available_packet_count()):\n\t\t\t\t\tvar dataArray = connection.get_var()\n\t\t\t\t\tProcessServerData(dataArray)\n\n\telse:\n\t\t#client processing stuff\n\t\tif !isNetwork:\n\t\t\t#Still waiting for connection confirmed\n\t\t\tif stream.get_status() == stream.STATUS_CONNECTED:\n\t\t\t\tprint(\"Connection established!\")\n\t\t\t\tisNetwork = true\n\n\t\t\t\tgotoPuzzle()\n\n\t\t\t\tthisPuzzle = root.get_node(\"Puzzle\")\n\t\t\t\treturn\n\t\t\tif stream.get_status() == stream.STATUS_NONE or stream.get_status() == stream.STATUS_ERROR:\n\t\t\t\tprint(\"Error establishing connection!\")\n\t\t\t\tproxy.set_process(false)\n\t\t\t\treturn\n\t\t\t\t#stop running process loop, cause we have no connection\n\t\telse:\n\t\t\t#connecton established and confirmed. Do regular data processing\n\t\t\t#check if we have any data\n\t\t\tif connection.get_available_packet_count() > 0:\n\t\t\t\tfor i in range(connection.get_available_packet_count()):\n\t\t\t\t\tvar dataArray = connection.get_var()\n\t\t\t\t\tProcessServerData(dataArray)\n\t\t\t\t\t#Call the server process script cuase it's peer to peer and we have the same functions!\n\n\nfunc disconnect():\n\t#need to do lots of things! If the server is open and listening, but has no connection just stop listening!\n\tif isHost and !isNetwork:\n\t\t#this means we're waiting for connection still\n\t\tserver.stop()\n\t\tprint(\"closing server listener!\")\n\telif isHost and isNetwork:\n\t\t#have connections. Need to send them stop packet, and close connection\n\t\tconnection.put_var([REMOTE_QUIT])\n\t\tstream.disconnect()\n\t\tprint(\"Closing connection to remote player...\")\n\telif !isHost and !isNetwork:\n\t\tstream.disconnect()\n\t\tprint(\"Halting connection request...\")\n\telif !isHost and isNetwork:\n\t\t#connected to server already\n\t\tstream.disconnect()\n\t\tprint(\"Disconnecting from server...\")\n\n\t#no matter where we wre before disconnect, set network to false and return to beginning screen!\n\tisNetwork = false;\n\tisHost = false;\n\tisClient = false;\n\n\tproxy.set_process(false)\n\n\n\tgotoMenu()\n\n\nfunc ProcessServerData(dataArray):\n\t#have an array of data. First element should be identifying int\n\tvar ID = dataArray[0]\n\tvar puzzle = root.get_node( \"Puzzle\" )\n\tvar gridMan = puzzle.otherPuzzle.get_node(\"GridView\/GridMan\")\n\t#no switch statement. I'm crying right now while i type this. My fingers are bleeding\n\tif ID == REMOTE_START:\n\t\t#read other person's puzzle\n\t\tprint(\"remote_stuff\")\n\t\tgridMan.set_puzzle(dataArray[1])\n\telif ID == REMOTE_FINISH:\n\t\t#again, do ending stuff\n\t\tprint(\"remote_finish: \" + str(dataArray[1]))\n\t\tgridMan.beatenWithScore(dataArray[1])\n\telif ID == REMOTE_QUIT:\n\t\t#omg those jerks!\n\t\tprint(\"remote_quit\")\n\t\tdisconnect()\n\telif ID == REMOTE_BLOCK:\n\t\t#get their block ifnormation!\n\t\tprint(\"remote_block\")\n\telif ID == REMOTE_PUZZLE_TRANSFORM:\n\t\t#sent block information\n\t\tvar translation = dataArray[1]\n\t\tthisPuzzle.otherPuzzle.set_transform(Transform( translation ))\n# better measurements!!!!\t\tthisPuzzle.otherPuzzle.set_translation(Vector3(20, 12, -40))\n##############3\n\t\tthisPuzzle.otherPuzzle.set_translation(Vector3(10, 5, -20))\n\telif ID == REMOTE_BLOCK_UPDATE:\n\t\t#sent an updated block pair\n\t\tprint(\"block update\")\n\t\tvar pos = dataArray[1]\n\t\tgridMan.forceClickBlock(pos)\n\nfunc sendStart(puzzle):\n\tif !isNetwork:\n\t\tprint(\"Error sending start packet: not connected!\")\n\t\treturn\n\tvar er = connection.put_var([REMOTE_START, puzzle])\n\nfunc sendBlockUpdate(pos):\n\tif !isNetwork:\n\t\tprint(\"Error sending start packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_BLOCK_UPDATE, pos])\n\nfunc sendFinish(score):\n\tif !isNetwork:\n\t\tprint(\"Error sending finish packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_FINISH, root.get_node(\"Puzzle\").time.val])\n\nfunc sendQuit():\n\tif !isNetwork:\n\t\tprint(\"Error sending finish packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_QUIT])\n\nfunc sendTransform(translation):\n\tif !isNetwork:\n\t\tprint(\"Cannot send transformation over an unitialized network!\")\n\t\treturn\n\tconnection.put_var([REMOTE_PUZZLE_TRANSFORM, translation])\n\tprint(\"it got here\")\n\n\nfunc gotoMenu():\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\troot.add_child( load(\"res:\/\/menus.scn\") )\n\nfunc gotoPuzzle():\n\tvar guiMan = preload(\"GUIManager.gd\").new()\n\tguiMan.gotoPuzzleScene(root, true) # network = true\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"e69704caacf30f5cc795f250c044cc0993372a2e","subject":"pushback range nerf","message":"pushback range nerf\n","repos":"P1X-in\/rat-is-fat","old_file":"scripts\/moving_object.gd","new_file":"scripts\/moving_object.gd","new_contents":"extends \"res:\/\/scripts\/object.gd\"\n\nvar velocity\nvar movement_vector = [0, 0]\n\nvar AXIS_THRESHOLD = 0.15\n\nvar body_part_head\nvar body_part_body\nvar body_part_footer\nvar animations\nvar hat = false\n\nvar stun_duration = 0.15\nvar stun_level = 0\n\nfunc _init(bag).(bag):\n self.bag = bag\n\nfunc spawn(position):\n .spawn(position)\n self.bag.processing.register(self)\n\nfunc despawn():\n self.bag.processing.remove(self)\n .despawn()\n\nfunc process(delta):\n self.modify_position(delta)\n\nfunc modify_position(delta):\n var x = self.apply_axis_threshold(self.movement_vector[0])\n var y = self.apply_axis_threshold(self.movement_vector[1])\n var motion = Vector2(x, y) * self.velocity * delta\n self.avatar.move(motion)\n if (self.avatar.is_colliding()):\n var n = self.avatar.get_collision_normal()\n motion = n.slide(motion)\n self.avatar.move(motion)\n self.flip(self.movement_vector[0])\n\nfunc apply_axis_threshold(axis_value):\n if abs(axis_value) < self.AXIS_THRESHOLD:\n return 0\n return axis_value\n\nfunc flip(direction):\n if direction == 0:\n return\n\n var flip_sprite = false\n if direction > 0:\n flip_sprite = true\n\n self.body_part_head.set_flip_h(flip_sprite)\n self.body_part_body.set_flip_h(flip_sprite)\n self.body_part_footer.set_flip_h(flip_sprite)\n if self.hat:\n self.hat.set_flip_h(flip_sprite)\n\nfunc reset_movement():\n self.movement_vector = [0, 0]\n\nfunc push_back(enemy):\n var enemy_position = enemy.get_pos()\n var object_position = self.get_pos()\n\n var position_delta_x = object_position.x - enemy_position.x\n var position_delta_y = object_position.y - enemy_position.y\n var force = pow(enemy.attack_strength, -1)\n\n var scale = force \/ self.calculate_distance(enemy_position) * 20 - mass \/ force\n\n self.avatar.move(Vector2(position_delta_x * scale, position_delta_y * scale))\n self.stun()\n\nfunc stun(duration=null):\n if duration == null:\n duration = self.stun_duration\n self.is_processing = false\n self.stun_level = stun_level + 1\n self.bag.timers.set_timeout(duration, self, \"remove_stun\")\n\nfunc remove_stun():\n self.stun_level = stun_level - 1\n if self.stun_level == 0:\n self.is_processing = true\n\n\n","old_contents":"extends \"res:\/\/scripts\/object.gd\"\n\nvar velocity\nvar movement_vector = [0, 0]\n\nvar AXIS_THRESHOLD = 0.15\n\nvar body_part_head\nvar body_part_body\nvar body_part_footer\nvar animations\nvar hat = false\n\nvar stun_duration = 0.15\nvar stun_level = 0\n\nfunc _init(bag).(bag):\n self.bag = bag\n\nfunc spawn(position):\n .spawn(position)\n self.bag.processing.register(self)\n\nfunc despawn():\n self.bag.processing.remove(self)\n .despawn()\n\nfunc process(delta):\n self.modify_position(delta)\n\nfunc modify_position(delta):\n var x = self.apply_axis_threshold(self.movement_vector[0])\n var y = self.apply_axis_threshold(self.movement_vector[1])\n var motion = Vector2(x, y) * self.velocity * delta\n self.avatar.move(motion)\n if (self.avatar.is_colliding()):\n var n = self.avatar.get_collision_normal()\n motion = n.slide(motion)\n self.avatar.move(motion)\n self.flip(self.movement_vector[0])\n\nfunc apply_axis_threshold(axis_value):\n if abs(axis_value) < self.AXIS_THRESHOLD:\n return 0\n return axis_value\n\nfunc flip(direction):\n if direction == 0:\n return\n\n var flip_sprite = false\n if direction > 0:\n flip_sprite = true\n\n self.body_part_head.set_flip_h(flip_sprite)\n self.body_part_body.set_flip_h(flip_sprite)\n self.body_part_footer.set_flip_h(flip_sprite)\n if self.hat:\n self.hat.set_flip_h(flip_sprite)\n\nfunc reset_movement():\n self.movement_vector = [0, 0]\n\nfunc push_back(enemy):\n var enemy_position = enemy.get_pos()\n var object_position = self.get_pos()\n\n var position_delta_x = object_position.x - enemy_position.x\n var position_delta_y = object_position.y - enemy_position.y\n\n var power = enemy.attack_strength * 2 + 15\n var scale = power \/ self.calculate_distance(enemy_position)\n\n self.avatar.move(Vector2(position_delta_x * scale, position_delta_y * scale))\n self.stun()\n\nfunc stun(duration=null):\n if duration == null:\n duration = self.stun_duration\n self.is_processing = false\n self.stun_level = stun_level + 1\n self.bag.timers.set_timeout(duration, self, \"remove_stun\")\n\nfunc remove_stun():\n self.stun_level = stun_level - 1\n if self.stun_level == 0:\n self.is_processing = true\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"d78cb9fcc18c043f53d78c8e69d3aa682a873691","subject":"Removed unnecessary statement.","message":"Removed unnecessary statement.\n","repos":"CSaratakij\/jam-2016-remake","old_file":"src\/levels\/level.gd","new_file":"src\/levels\/level.gd","new_contents":"\nextends Node2D\n\nvar previous_floor = 0\nvar current_floor = 0\n\nonready var tree = get_tree()\nonready var root = tree.get_root()\nonready var global = root.get_node(\"\/root\/global\")\nonready var _music_player = root.get_node(\"\/root\/music_player\")\nonready var players = tree.get_nodes_in_group(\"player\")\nonready var totem_spawners = get_node(\"Totem_Spawners\").get_children()\n\nvar is_init_spawn = false\n\nfunc _ready():\n\tset_process(true)\n\tif not _music_player.is_playing():\n\t\t_music_player.play()\n\tprevious_floor = players[0].get_current_floor()\n\tcurrent_floor = previous_floor\n\nfunc _process(delta):\n\tif not is_init_spawn:\n\t\t_spawn_totem()\n\t\tis_init_spawn = true\n\tif not players.empty():\n\t\tcurrent_floor = players[0].get_current_floor()\n\t\tif current_floor != previous_floor:\n\t\t\tif current_floor == 1:\n\t\t\t\t_spawn_totem()\n\t\t\tprevious_floor = current_floor\n\t\tif not players[0].get_node(\"health\").is_alive():\n\t\t\tglobal.game_over()\n\nfunc _spawn_totem():\n\tfor spawner in totem_spawners:\n\t\tspawner.clear()\n\t\tspawner.spawn()\n","old_contents":"\nextends Node2D\n\nvar previous_floor = 0\nvar current_floor = 0\n\nonready var tree = get_tree()\nonready var root = tree.get_root()\nonready var global = root.get_node(\"\/root\/global\")\nonready var _music_player = root.get_node(\"\/root\/music_player\")\nonready var players = tree.get_nodes_in_group(\"player\")\nonready var totem_spawners = get_node(\"Totem_Spawners\").get_children()\n\nvar is_init_spawn = false\n\nfunc _ready():\n\tset_process(true)\n\tif not _music_player.is_playing():\n\t\t_music_player.play()\n\tprevious_floor = players[0].get_current_floor()\n\tcurrent_floor = previous_floor\n\nfunc _notification(what):\n\tif what == MainLoop.NOTIFICATION_WM_QUIT_REQUEST:\n\t\tpass\n\nfunc _process(delta):\n\tif not is_init_spawn:\n\t\t_spawn_totem()\n\t\tis_init_spawn = true\n\tif not players.empty():\n\t\tcurrent_floor = players[0].get_current_floor()\n\t\tif current_floor != previous_floor:\n\t\t\tif current_floor == 1:\n\t\t\t\t_spawn_totem()\n\t\t\tprevious_floor = current_floor\n\t\tif not players[0].get_node(\"health\").is_alive():\n\t\t\tglobal.game_over()\n\nfunc _spawn_totem():\n\tfor spawner in totem_spawners:\n\t\tspawner.clear()\n\t\tspawner.spawn()\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"6673ccbdb0f027f1576067d76940922ee56528ea","subject":"Slightly better rocket rotation","message":"Slightly better rocket rotation\n","repos":"P1X-in\/boctok","old_file":"scripts\/entities\/player.gd","new_file":"scripts\/entities\/player.gd","new_contents":"extends \"res:\/\/scripts\/entities\/object.gd\"\n\nvar camera\nvar hud\n\nvar player_id\nvar gamepad_id = null\nvar keyboard_use = null\n\nvar gamepad_handlers = []\nvar keyboard_handlers = []\n\n\nvar rocket_template = preload(\"res:\/\/scenes\/ships\/rocket.tscn\")\nvar rocket_cooldown = false\nvar rocket_firing = false\nvar ROCKET_COOLDOWN_TIME = 0.1\n\nfunc _init(bag, player_id).(bag):\n self.bag = bag\n self.player_id = player_id\n self.avatar = preload(\"res:\/\/scenes\/ships\/ship.tscn\").instance()\n self.camera = self.avatar.get_node('camera')\n\n self.gamepad_handlers = [\n preload(\"res:\/\/scripts\/input\/handlers\/player_rotate_axis.gd\").new(self.bag, self, 0),\n #preload(\"res:\/\/scripts\/input\/handlers\/player_accelerate_axis.gd\").new(self.bag, self, 1),\n #preload(\"res:\/\/scripts\/input\/handlers\/player_accelerate_axis.gd\").new(self.bag, self, 3),\n preload(\"res:\/\/scripts\/input\/handlers\/player_accelerate_button.gd\").new(self.bag, self, JOY_BUTTON_0),\n preload(\"res:\/\/scripts\/input\/handlers\/player_boost_button.gd\").new(self.bag, self, JOY_BUTTON_1),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_button.gd\").new(self.bag, self, JOY_BUTTON_2),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_trigger.gd\").new(self.bag, self, 4),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_trigger.gd\").new(self.bag, self, 5),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_trigger.gd\").new(self.bag, self, 6),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_trigger.gd\").new(self.bag, self, 7),\n ]\n\n self.keyboard_handlers = [\n preload(\"res:\/\/scripts\/input\/handlers\/player_rotate_key.gd\").new(self.bag, self, KEY_LEFT, 1),\n preload(\"res:\/\/scripts\/input\/handlers\/player_rotate_key.gd\").new(self.bag, self, KEY_RIGHT, -1),\n preload(\"res:\/\/scripts\/input\/handlers\/player_accelerate_key.gd\").new(self.bag, self, KEY_UP),\n preload(\"res:\/\/scripts\/input\/handlers\/player_boost_key.gd\").new(self.bag, self, KEY_DOWN),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_key.gd\").new(self.bag, self, KEY_SPACE),\n ]\n\nfunc spawn(initial_position):\n self.attach()\n self.avatar.set_pos(initial_position)\n\nfunc attach():\n self.bag.processing.register(self)\n .attach()\n\nfunc detach():\n self.bag.processing.remove(self)\n .detach()\n\nfunc bind_keyboard():\n var keyboard = self.bag.input.schemes['game']['keyboard']\n self.keyboard_use = true\n for handler in self.keyboard_handlers:\n keyboard.register_handler(handler)\nfunc unbind_keyboard():\n if not self.keyboard_use:\n return\n\n var keyboard = self.bag.input.schemes['game']['keyboard']\n self.keyboard_use = false\n for handler in self.keyboard_handlers:\n keyboard.remove_handler(handler)\n\nfunc bind_gamepad(id):\n self.unbind_gamepad()\n self.gamepad_id = id\n var gamepad = self.bag.input.schemes['game']['pad' + str(id)]\n\n for handler in self.gamepad_handlers:\n gamepad.register_handler(handler)\n\nfunc unbind_gamepad():\n if self.gamepad_id == null:\n return\n\n var gamepad = self.bag.input.schemes['game']['pad' + str(self.gamepad_id)]\n\n for handler in self.gamepad_handlers:\n gamepad.remove_handler(handler)\n\n self.gamepad_id = null\n\nfunc reset():\n self.rocket_cooldown = false\n self.rocket_firing = false\n self.avatar.reset()\n\nfunc bind_camera(viewport):\n self.camera.set_custom_viewport(viewport)\n\nfunc bind_hud(hud):\n self.hud = hud\n\nfunc process(delta):\n hud.update_sun_indicator(self.avatar.get_pos())\n hud.update_fuel(self.avatar.fuel)\n hud.update_gravity(self.avatar.current_gravity)\n hud.update_ship_velocity(self.avatar.current_acceleration)\n hud.update_sun_warning(self)\n\n if self.rocket_firing and not self.rocket_cooldown:\n self.fire_rocket()\n\n\nfunc fire_rocket():\n if self.rocket_cooldown:\n return\n\n var rocket = self.rocket_template.instance()\n var position = self.avatar.get_pos()\n var rocket_offset = Vector2(0, -1).rotated(self.avatar.rotation)\n var rocket_position = position + rocket_offset * 60\n\n rocket.initial_velocity = self.avatar.current_acceleration + rocket_offset * 500\n\n self.bag.board.attach_object(rocket)\n rocket.set_pos(rocket_position)\n rocket.set_rot(rocket.initial_velocity.angle() + 3.14)\n\n self.rocket_cooldown = true\n self.bag.timers.set_timeout(self.ROCKET_COOLDOWN_TIME, self, \"rocket_cooldown_done\")\n\nfunc rocket_cooldown_done():\n self.rocket_cooldown = false\n","old_contents":"extends \"res:\/\/scripts\/entities\/object.gd\"\n\nvar camera\nvar hud\n\nvar player_id\nvar gamepad_id = null\nvar keyboard_use = null\n\nvar gamepad_handlers = []\nvar keyboard_handlers = []\n\n\nvar rocket_template = preload(\"res:\/\/scenes\/ships\/rocket.tscn\")\nvar rocket_cooldown = false\nvar rocket_firing = false\nvar ROCKET_COOLDOWN_TIME = 0.1\n\nfunc _init(bag, player_id).(bag):\n self.bag = bag\n self.player_id = player_id\n self.avatar = preload(\"res:\/\/scenes\/ships\/ship.tscn\").instance()\n self.camera = self.avatar.get_node('camera')\n\n self.gamepad_handlers = [\n preload(\"res:\/\/scripts\/input\/handlers\/player_rotate_axis.gd\").new(self.bag, self, 0),\n #preload(\"res:\/\/scripts\/input\/handlers\/player_accelerate_axis.gd\").new(self.bag, self, 1),\n #preload(\"res:\/\/scripts\/input\/handlers\/player_accelerate_axis.gd\").new(self.bag, self, 3),\n preload(\"res:\/\/scripts\/input\/handlers\/player_accelerate_button.gd\").new(self.bag, self, JOY_BUTTON_0),\n preload(\"res:\/\/scripts\/input\/handlers\/player_boost_button.gd\").new(self.bag, self, JOY_BUTTON_1),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_button.gd\").new(self.bag, self, JOY_BUTTON_2),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_trigger.gd\").new(self.bag, self, 4),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_trigger.gd\").new(self.bag, self, 5),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_trigger.gd\").new(self.bag, self, 6),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_trigger.gd\").new(self.bag, self, 7),\n ]\n\n self.keyboard_handlers = [\n preload(\"res:\/\/scripts\/input\/handlers\/player_rotate_key.gd\").new(self.bag, self, KEY_LEFT, 1),\n preload(\"res:\/\/scripts\/input\/handlers\/player_rotate_key.gd\").new(self.bag, self, KEY_RIGHT, -1),\n preload(\"res:\/\/scripts\/input\/handlers\/player_accelerate_key.gd\").new(self.bag, self, KEY_UP),\n preload(\"res:\/\/scripts\/input\/handlers\/player_boost_key.gd\").new(self.bag, self, KEY_DOWN),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_key.gd\").new(self.bag, self, KEY_SPACE),\n ]\n\nfunc spawn(initial_position):\n self.attach()\n self.avatar.set_pos(initial_position)\n\nfunc attach():\n self.bag.processing.register(self)\n .attach()\n\nfunc detach():\n self.bag.processing.remove(self)\n .detach()\n\nfunc bind_keyboard():\n var keyboard = self.bag.input.schemes['game']['keyboard']\n self.keyboard_use = true\n for handler in self.keyboard_handlers:\n keyboard.register_handler(handler)\nfunc unbind_keyboard():\n if not self.keyboard_use:\n return\n\n var keyboard = self.bag.input.schemes['game']['keyboard']\n self.keyboard_use = false\n for handler in self.keyboard_handlers:\n keyboard.remove_handler(handler)\n\nfunc bind_gamepad(id):\n self.unbind_gamepad()\n self.gamepad_id = id\n var gamepad = self.bag.input.schemes['game']['pad' + str(id)]\n\n for handler in self.gamepad_handlers:\n gamepad.register_handler(handler)\n\nfunc unbind_gamepad():\n if self.gamepad_id == null:\n return\n\n var gamepad = self.bag.input.schemes['game']['pad' + str(self.gamepad_id)]\n\n for handler in self.gamepad_handlers:\n gamepad.remove_handler(handler)\n\n self.gamepad_id = null\n\nfunc reset():\n self.rocket_cooldown = false\n self.rocket_firing = false\n self.avatar.reset()\n\nfunc bind_camera(viewport):\n self.camera.set_custom_viewport(viewport)\n\nfunc bind_hud(hud):\n self.hud = hud\n\nfunc process(delta):\n hud.update_sun_indicator(self.avatar.get_pos())\n hud.update_fuel(self.avatar.fuel)\n hud.update_gravity(self.avatar.current_gravity)\n hud.update_ship_velocity(self.avatar.current_acceleration)\n hud.update_sun_warning(self)\n\n if self.rocket_firing and not self.rocket_cooldown:\n self.fire_rocket()\n\n\nfunc fire_rocket():\n if self.rocket_cooldown:\n return\n\n var rocket = self.rocket_template.instance()\n var position = self.avatar.get_pos()\n var rocket_offset = Vector2(0, -1).rotated(self.avatar.rotation)\n var rocket_position = position + rocket_offset * 60\n\n print(rocket_offset)\n\n rocket.initial_velocity = self.avatar.current_acceleration + rocket_offset * 500\n\n self.bag.board.attach_object(rocket)\n rocket.set_pos(rocket_position)\n\n self.rocket_cooldown = true\n self.bag.timers.set_timeout(self.ROCKET_COOLDOWN_TIME, self, \"rocket_cooldown_done\")\n\nfunc rocket_cooldown_done():\n self.rocket_cooldown = false\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"974dbd6b8803652ed94b32194690f143cfd59cba","subject":"Fixed Finite State Machine demo issues","message":"Fixed Finite State Machine demo issues\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"2d\/finite_state_machine\/player\/weapon\/sword.gd","new_file":"2d\/finite_state_machine\/player\/weapon\/sword.gd","new_contents":"extends Area2D\n\nsignal attack_finished\n\nenum STATES { IDLE, ATTACK }\nvar state = null\n\nenum ATTACK_INPUT_STATES { IDLE, LISTENING, REGISTERED }\nvar attack_input_state = ATTACK_INPUT_STATES.IDLE\nvar ready_for_next_attack = false\nconst MAX_COMBO_COUNT = 3\nvar combo_count = 0\n\nvar attack_current = {}\nvar combo = [{\n\t\t'damage': 1,\n\t\t'animation': 'attack_fast',\n\t\t'effect': null\n\t},\n\t{\n\t\t'damage': 1,\n\t\t'animation': 'attack_fast',\n\t\t'effect': null\n\t},\n\t{\n\t\t'damage': 3,\n\t\t'animation': 'attack_medium',\n\t\t'effect': null\n\t}]\n\nvar hit_objects = []\n\nfunc _ready():\n\t$AnimationPlayer.connect('animation_finished', self, \"_on_animation_finished\")\n\tself.connect(\"body_entered\", self, \"_on_body_entered\")\n\t_change_state(STATES.IDLE)\n\nfunc _change_state(new_state):\n\tmatch state:\n\t\tSTATES.ATTACK:\n\t\t\thit_objects = []\n\t\t\tattack_input_state = ATTACK_INPUT_STATES.LISTENING\n\t\t\tready_for_next_attack = false\n\n\tmatch new_state:\n\t\tSTATES.IDLE:\n\t\t\tcombo_count = 0\n\t\t\t$AnimationPlayer.stop()\n\t\t\tvisible = false\n\t\t\tmonitoring = false\n\t\tSTATES.ATTACK:\n\t\t\tattack_current = combo[combo_count -1]\n\t\t\t$AnimationPlayer.play(attack_current['animation'])\n\t\t\tvisible = true\n\t\t\tmonitoring = true\n\tstate = new_state\n\nfunc _input(event):\n\tif not state == STATES.ATTACK:\n\t\treturn\n\tif attack_input_state != ATTACK_INPUT_STATES.LISTENING:\n\t\treturn\n\tif event.is_action_pressed('attack'):\n\t\tattack_input_state = ATTACK_INPUT_STATES.REGISTERED\n\nfunc _physics_process(delta):\n\tif attack_input_state == ATTACK_INPUT_STATES.REGISTERED and ready_for_next_attack:\n\t\tattack()\n\nfunc attack():\n\tcombo_count += 1\n\t_change_state(STATES.ATTACK)\n\n# use with AnimationPlayer func track\nfunc set_attack_input_listening():\n\tattack_input_state = ATTACK_INPUT_STATES.LISTENING\n\n# use with AnimationPlayer func track\nfunc set_ready_for_next_attack():\n\tready_for_next_attack = true\n\nfunc _on_body_entered(body):\n\tif not body.has_node('Health'):\n\t\treturn\n\tif body.get_rid().get_id() in hit_objects:\n\t\treturn\n\thit_objects.append(body.get_rid().get_id())\n\tbody.take_damage(self, attack_current['damage'], attack_current['effect'])\n\nfunc _on_animation_finished(name):\n\tif not attack_current:\n\t\treturn\n\n\tif attack_input_state == ATTACK_INPUT_STATES.REGISTERED and combo_count < MAX_COMBO_COUNT:\n\t\tattack()\n\telse:\n\t\t_change_state(STATES.IDLE)\n\t\temit_signal(\"attack_finished\")\n\nfunc _on_StateMachine_state_changed(current_state):\n\tif current_state.name == \"Attack\":\n\t\tattack()\n","old_contents":"extends Area2D\n\nsignal attack_finished\n\nenum STATES { IDLE, ATTACK }\nvar state = null\n\nenum ATTACK_INPUT_STATES { IDLE, LISTENING, REGISTERED }\nvar attack_input_state = IDLE\nvar ready_for_next_attack = false\nconst MAX_COMBO_COUNT = 3\nvar combo_count = 0\n\nvar attack_current = {}\nvar combo = [{\n\t\t'damage': 1,\n\t\t'animation': 'attack_fast',\n\t\t'effect': null\n\t},\n\t{\n\t\t'damage': 1,\n\t\t'animation': 'attack_fast',\n\t\t'effect': null\n\t},\n\t{\n\t\t'damage': 3,\n\t\t'animation': 'attack_medium',\n\t\t'effect': null\n\t}]\n\nvar hit_objects = []\n\nfunc _ready():\n\t$AnimationPlayer.connect('animation_finished', self, \"_on_animation_finished\")\n\tself.connect(\"body_entered\", self, \"_on_body_entered\")\n\t_change_state(IDLE)\n\nfunc _change_state(new_state):\n\tmatch state:\n\t\tATTACK:\n\t\t\thit_objects = []\n\t\t\tattack_input_state = IDLE\n\t\t\tready_for_next_attack = false\n\n\tmatch new_state:\n\t\tIDLE:\n\t\t\tcombo_count = 0\n\t\t\t$AnimationPlayer.stop()\n\t\t\tvisible = false\n\t\t\tmonitoring = false\n\t\tATTACK:\n\t\t\tattack_current = combo[combo_count -1]\n\t\t\t$AnimationPlayer.play(attack_current['animation'])\n\t\t\tvisible = true\n\t\t\tmonitoring = true\n\tstate = new_state\n\nfunc _input(event):\n\tif not state == ATTACK:\n\t\treturn\n\tif attack_input_state != LISTENING:\n\t\treturn\n\tif event.is_action_pressed('attack'):\n\t\tattack_input_state = REGISTERED\n\nfunc _physics_process(delta):\n\tif attack_input_state == REGISTERED and ready_for_next_attack:\n\t\tattack()\n\nfunc attack():\n\tcombo_count += 1\n\t_change_state(ATTACK)\n\n# use with AnimationPlayer func track\nfunc set_attack_input_listening():\n\tattack_input_state = LISTENING\n\n# use with AnimationPlayer func track\nfunc set_ready_for_next_attack():\n\tready_for_next_attack = true\n\nfunc _on_body_entered(body):\n\tif not body.has_node('Health'):\n\t\treturn\n\tif body.get_rid().get_id() in hit_objects:\n\t\treturn\n\thit_objects.append(body.get_rid().get_id())\n\tbody.take_damage(self, attack_current['damage'], attack_current['effect'])\n\nfunc _on_animation_finished(name):\n\tif not attack_current:\n\t\treturn\n\n\tif attack_input_state == REGISTERED and combo_count < MAX_COMBO_COUNT:\n\t\tattack()\n\telse:\n\t\t_change_state(IDLE)\n\t\temit_signal(\"attack_finished\")\n\nfunc _on_StateMachine_state_changed(current_state):\n\tif current_state.name == \"Attack\":\n\t\tattack()\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"eac8dfd6ed6e35ce9bddc9bb51b2b32cdd932a6d","subject":"Fix a typo in GodotPayment(s)","message":"Fix a typo in GodotPayment(s)\n\nFix https:\/\/github.com\/godotengine\/godot\/issues\/22909","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"misc\/android_iap\/iap.gd","new_file":"misc\/android_iap\/iap.gd","new_contents":"\nextends Node\n\nsignal purchase_success(item_name)\nsignal purchase_fail\nsignal purchase_cancel\nsignal purchase_owned(item_name)\n\nsignal has_purchased(item_name)\n\nsignal consume_success(item_name)\nsignal consume_fail\nsignal consume_not_required\n\nsignal sku_details_complete\nsignal sku_details_error\n\nvar payment\n\nfunc _ready():\n\tif Engine.has_singleton(\"GodotPayments\"):\n\t\tpayment = Engine.get_singleton(\"GodotPayments\")\n\telse:\n\t\tprint(\"GodotPayment singleton is only available on Android devices.\")\n\n\tif payment:\n\t\t# set callback with this script instance\n\t\tpayment.setPurchaseCallbackId(get_instance_id())\n\n# set consume purchased item automatically after purchase, defulat value is true\nfunc set_auto_consume(auto):\n\tif payment:\n\t\tpayment.setAutoConsume(auto)\n\n\n# request user owned item, callback : has_purchased\nfunc request_purchased():\n\tif payment:\n\t\tpayment.requestPurchased()\n\nfunc has_purchased(receipt, signature, sku):\n\tif sku == \"\":\n\t\tprint(\"has_purchased : nothing\")\n\t\temit_signal(\"has_purchased\", null)\n\telse:\n\t\tprint(\"has_purchased : \", sku)\n\t\temit_signal(\"has_purchased\", sku)\n\n\n# purchase item\n# callback : purchase_success, purchase_fail, purchase_cancel, purchase_owned\nfunc purchase(item_name):\n\tif payment:\n\t\t# transaction_id could be any string that used for validation internally in java\n\t\tpayment.purchase(item_name, \"transaction_id\")\n\nfunc purchase_success(receipt, signature, sku):\n\tprint(\"purchase_success : \", sku)\n\temit_signal(\"purchase_success\", sku)\n\nfunc purchase_fail():\n\tprint(\"purchase_fail\")\n\temit_signal(\"purchase_fail\")\n\nfunc purchase_cancel():\n\tprint(\"purchase_cancel\")\n\temit_signal(\"purchase_cancel\")\n\nfunc purchase_owned(sku):\n\tprint(\"purchase_owned : \", sku)\n\temit_signal(\"purchase_owned\", sku)\n\n\n# consume purchased item\n# callback : consume_success, consume_fail\nfunc consume(item_name):\n\tif payment:\n\t\tpayment.consume(item_name)\n\n# consume all purchased items\nfunc consume_all():\n\tif payment:\n\t\tpayment.consumeUnconsumedPurchases()\n\nfunc consume_success(receipt, signature, sku):\n\tprint(\"consume_success : \", sku)\n\temit_signal(\"consume_success\", sku)\n\n# if consume fail, need to call request_purchased() to get purchase token from google\n# then try to consume again\nfunc consume_fail():\n\temit_signal(\"consume_fail\")\n\n# no purchased item to consume\nfunc consume_not_required():\n\temit_signal(\"consume_not_required\")\n\n\n# detail info of IAP items\n# sku_details = {\n# product_id (String) : {\n# type (String),\n# product_id (String),\n# title (String),\n# description (String),\n# price (String), # this can be used to display price for each country with their own currency\n# price_currency_code (String),\n# price_amount (float)\n# },\n# ...\n# }\nvar sku_details = {}\n\n# query for details of IAP items\n# callback : sku_details_complete\nfunc sku_details_query(list):\n\tif payment:\n\t\tvar sku_list = PoolStringArray(list)\n\t\tpayment.querySkuDetails(sku_list)\n\nfunc sku_details_complete(result):\n\tprint(\"sku_details_complete : \", result)\n\tfor key in result.keys():\n\t\tsku_details[key] = result[key]\n\temit_signal(\"sku_details_complete\")\n\nfunc sku_details_error(error_message):\n\tprint(\"error_sku_details = \", error_message)\n\temit_signal(\"sku_details_error\")\n","old_contents":"\nextends Node\n\nsignal purchase_success(item_name)\nsignal purchase_fail\nsignal purchase_cancel\nsignal purchase_owned(item_name)\n\nsignal has_purchased(item_name)\n\nsignal consume_success(item_name)\nsignal consume_fail\nsignal consume_not_required\n\nsignal sku_details_complete\nsignal sku_details_error\n\nvar payment\n\nfunc _ready():\n\tif Engine.has_singleton(\"GodotPayment\"):\n\t\tpayment = Engine.get_singleton(\"GodotPayments\")\n\telse:\n\t\tprint(\"GodotPayment singleton is only available on Android devices.\")\n\n\tif payment:\n\t\t# set callback with this script instance\n\t\tpayment.setPurchaseCallbackId(get_instance_id())\n\n# set consume purchased item automatically after purchase, defulat value is true\nfunc set_auto_consume(auto):\n\tif payment:\n\t\tpayment.setAutoConsume(auto)\n\n\n# request user owned item, callback : has_purchased\nfunc request_purchased():\n\tif payment:\n\t\tpayment.requestPurchased()\n\nfunc has_purchased(receipt, signature, sku):\n\tif sku == \"\":\n\t\tprint(\"has_purchased : nothing\")\n\t\temit_signal(\"has_purchased\", null)\n\telse:\n\t\tprint(\"has_purchased : \", sku)\n\t\temit_signal(\"has_purchased\", sku)\n\n\n# purchase item\n# callback : purchase_success, purchase_fail, purchase_cancel, purchase_owned\nfunc purchase(item_name):\n\tif payment:\n\t\t# transaction_id could be any string that used for validation internally in java\n\t\tpayment.purchase(item_name, \"transaction_id\")\n\nfunc purchase_success(receipt, signature, sku):\n\tprint(\"purchase_success : \", sku)\n\temit_signal(\"purchase_success\", sku)\n\nfunc purchase_fail():\n\tprint(\"purchase_fail\")\n\temit_signal(\"purchase_fail\")\n\nfunc purchase_cancel():\n\tprint(\"purchase_cancel\")\n\temit_signal(\"purchase_cancel\")\n\nfunc purchase_owned(sku):\n\tprint(\"purchase_owned : \", sku)\n\temit_signal(\"purchase_owned\", sku)\n\n\n# consume purchased item\n# callback : consume_success, consume_fail\nfunc consume(item_name):\n\tif payment:\n\t\tpayment.consume(item_name)\n\n# consume all purchased items\nfunc consume_all():\n\tif payment:\n\t\tpayment.consumeUnconsumedPurchases()\n\nfunc consume_success(receipt, signature, sku):\n\tprint(\"consume_success : \", sku)\n\temit_signal(\"consume_success\", sku)\n\n# if consume fail, need to call request_purchased() to get purchase token from google\n# then try to consume again\nfunc consume_fail():\n\temit_signal(\"consume_fail\")\n\n# no purchased item to consume\nfunc consume_not_required():\n\temit_signal(\"consume_not_required\")\n\n\n# detail info of IAP items\n# sku_details = {\n# product_id (String) : {\n# type (String),\n# product_id (String),\n# title (String),\n# description (String),\n# price (String), # this can be used to display price for each country with their own currency\n# price_currency_code (String),\n# price_amount (float)\n# },\n# ...\n# }\nvar sku_details = {}\n\n# query for details of IAP items\n# callback : sku_details_complete\nfunc sku_details_query(list):\n\tif payment:\n\t\tvar sku_list = PoolStringArray(list)\n\t\tpayment.querySkuDetails(sku_list)\n\nfunc sku_details_complete(result):\n\tprint(\"sku_details_complete : \", result)\n\tfor key in result.keys():\n\t\tsku_details[key] = result[key]\n\temit_signal(\"sku_details_complete\")\n\nfunc sku_details_error(error_message):\n\tprint(\"error_sku_details = \", error_message)\n\temit_signal(\"sku_details_error\")\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"cd7f9aa99dc7470009b47c2d97ca22be3e196092","subject":"Send messages with random mask","message":"Send messages with random mask\n","repos":"marcosbitetti\/Godot-Websocket","old_file":"websocket.gd","new_file":"websocket.gd","new_contents":"\nextends StreamPeerTCP\n\nconst MAGIC_STRING = \"258EAFA5-E914-47DA-95CA-C5AB0DC85B11\"\nconst USER_AGENT = \"Godot-client\"\n\n\nconst MESSAGE_RECIEVED = \"msg_recieved\"\nconst BINARY_RECIEVED = \"binary_recieved\"\n\nvar thread = Thread.new()\nvar host = '127.0.0.1'\nvar host_only = host\nvar path = null\nvar port = 80\nvar TIMEOUT = 30\nvar error = ''\nvar messages = []\nvar reciever = null\nvar reciever_f = null\nvar reciever_binary = null\nvar reciever_binary_f = null\n\nvar close_listener = Node.new()\nvar dispatcher = Reference.new()\n\nfunc _run(_self):\n\t###\n\t# Handshake\n\t###\n\tvar tm = 0.0\n\t\n\t# connect\n\twhile true:\n\t\tif get_status()==STATUS_ERROR:\n\t\t\terror = 'Connection fail'\n\t\t\treturn\n\t\tif get_status()==STATUS_CONNECTED:\n\t\t\tbreak\n\t\ttm += 0.1\n\t\tif tm>TIMEOUT:\n\t\t\terror = 'Connection timeout'\n\t\t\treturn\n\t\tOS.delay_msec(100)\n\t\n\tvar _host = self.host\n\tif self.port != 80:\n\t\t_host += ':' + str(self.port)\n\tvar header = ''\n\tvar data = ''\n\t\n\t\n\theader = \"GET \/\"+self.path+\" HTTP\/1.1\\r\\n\"\n\theader += \"Host: \"+self.host_only+\"\\r\\n\"\n\theader += \"Connection: Upgrade\\r\\n\"\n\theader += \"Pragma: no-cache\\r\\n\"\n\theader += \"Cache-Control: no-cache\\r\\n\"\n\theader += \"Upgrade: websocket\\r\\n\"\n\t#header += \"Origin: http:\/\/127.0.0.1:3001\\r\\n\"\n\theader += \"Sec-WebSocket-Version: 13\\r\\n\"\n\theader += \"User-Agent: \"+USER_AGENT+\"\\r\\n\"\n\theader += \"Accept-Encoding: gzip, deflate, sdch\\r\\n\"\n\theader += \"Accept-Language: \"+str(OS.get_locale())+\";q=0.8,en-US;q=0.6,en;q=0.4\\r\\n\"\n\t#header += \"Sec-WebSocket-Key: \"+send_secure+\"\\r\\n\"\n\theader += \"Sec-WebSocket-Key: 6Aw8vTgcG5EvXdQywVvbh_3fMxvd4Q7dcL2caAHAFjV\\r\\n\"\n\theader += \"Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits\\r\\n\"\n\theader += \"\\r\\n\"\n\t#print(header)\n\t\n\tif OK!=put_data( header.to_ascii() ):\n\t\tprint('error sending handshake headers')\n\t\treturn\n\n\tdata = ''\n\ttm = 0.0\n\tvar start_read = false\n\twhile true:\n\t\tif get_available_bytes()>0 and not start_read:\n\t\t\tdata += get_string(get_available_bytes())\n\t\t\tstart_read = true\n\t\telif get_available_bytes()==0 and start_read:\n\t\t\tbreak\n\t\t\n\t\tOS.delay_msec(100)\n\t\ttm += 0.1\n\t\tif tm>TIMEOUT:\n\t\t\tprint('timeout')\n\t\t\treturn\n\t#print(data)\n\n\tvar connection_ok = false\n\tfor lin in data.split(\"\\n\"):\n\t\tif lin.find(\"HTTP\/1.1 101\")>-1:\n\t\t\tconnection_ok = true\n\t\t# other headers can by cheched here\n\t\n\tif not connection_ok:\n\t\t#print(data)\n\t\tprint(\"Not connection ok\")\n\t\treturn\n\t\n\tdata = ''\n\tvar is_reading_frame = false\n\tvar size = 0\n\tvar byte = 0\n\tvar fin = 0\n\tvar opcode = 0\n\twhile is_connected():\n\t\tif get_available_bytes()>0:\n\t\t\tif not is_reading_frame:\n\t\t\t\t# frame\n\t\t\t\tbyte = get_8()\n\t\t\t\tfin = byte & 0x80\n\t\t\t\topcode = byte & 0x0F\n\t\t\t\tbyte = get_8()\n\t\t\t\tvar mskd = byte & 0x80\n\t\t\t\tvar payload = byte & 0x7F\n\t\t\t\t#printt('length', get_available_bytes())\n\t\t\t\t#printt(fin,mskd,opcode,payload)\n\t\t\t\t#if fin:\n\t\t\t\t#data += get_string(get_available_bytes())\n\t\t\t\tif payload<126:\n\t\t\t\t\t# size of data = payload\n\t\t\t\t\tdata += get_string(payload)\n\t\t\t\t\tif fin:\n\t\t\t\t\t\tif reciever:\n\t\t\t\t\t\t\tdispatcher.emit_signal(MESSAGE_RECIEVED, data)\n\t\t\t\t\t\tdata = ''\n\t\t\t\telse:\n\t\t\t\t\tsize = 0\n\t\t\t\t\tif payload==126:\n\t\t\t\t\t\t# 16-bit size\n\t\t\t\t\t\tsize = get_u16()\n\t\t\t\t\t\t#printt(size,'of data')\n\t\t\t\t\tif get_available_bytes()0:\n\t\t\tvar msg = messages[0]\n\t\t\tmessages.pop_front()\n\t\t\t\n\t\t\t# mount frame\n\t\t\tvar byte = 0x80 # fin\n\t\t\tbyte = byte | 0x01 # text frame\n\t\t\tput_8(byte)\n\t\t\tbyte = 0x80 | msg.length() # mask flag and payload size\n\t\t\tput_u8(byte)\n\t\t\tbyte = randi() # mask 32 bit int\n\t\t\tput_32(byte)\n\t\t\tvar masked = _mask(byte,msg)\n\t\t\tfor i in range(masked.size()):\n\t\t\t\tput_u8(masked[i])\n\t\t\tprint(msg+\" sent\")\n\t\t\t\n\t\tOS.delay_msec(3)\n\t\n\nfunc send(msg):\n\tmessages.append(msg)\n\n\nfunc start(host,port,path=null):\n\tself.host_only = host\n\tif path == null:\n\t\tself.host = host\n\telse:\n\t\tself.host = host+\"\/\"+path\n\tself.path = path\n\tself.port = port\n\tset_big_endian(true)\n\tprint(IP.get_local_addresses())\n\tif OK==connect(IP.resolve_hostname(host),port):\n\t\tthread.start(self,'_run', self)\n\telse:\n\t\tprint('no')\n\nfunc set_reciever(o,f):\n\tif reciever:\n\t\tunset_reciever()\n\treciever = o\n\treciever_f = f\n\tdispatcher.connect( MESSAGE_RECIEVED, reciever, reciever_f)\n\nfunc set_binary_reciever(o,f):\n\tif reciever_binary:\n\t\tunset_binary_reciever()\n\treciever_binary = o\n\treciever_binary_f = f\n\tdispatcher.connect( MESSAGE_RECIEVED, reciever_binary, reciever_binary_f)\n\nfunc unset_reciever():\n\tdispatcher.disconnect( MESSAGE_RECIEVED, reciever, reciever_f)\n\treciever = null\n\treciever_f = null\n\nfunc unset_binary_reciever():\n\tdispatcher.disconnect( MESSAGE_RECIEVED, reciever_binary, reciever_binary_f)\n\treciever_binary = null\n\treciever_binary_f = null\n\t\nfunc _init(reference).():\n\tdispatcher.add_user_signal(MESSAGE_RECIEVED)\n\tdispatcher.add_user_signal(BINARY_RECIEVED)\n\nfunc _mask(_m, _d):\n\t_m = int_to_hex(_m)\n\t_d=_d.to_utf8()\n\tvar ret = []\n\tfor i in range(_d.size()):\n\t\tret.append(_d[i] ^ _m[i % 4])\n\treturn ret\n\nfunc int_to_hex(n):\n\tn = var2bytes(n)\n\tn.invert()\n\tn.resize(n.size()-4)\n\treturn n","old_contents":"\nextends StreamPeerTCP\n\nconst MAGIC_STRING = \"258EAFA5-E914-47DA-95CA-C5AB0DC85B11\"\nconst USER_AGENT = \"Godot-client\"\n\n\nconst MESSAGE_RECIEVED = \"msg_recieved\"\nconst BINARY_RECIEVED = \"binary_recieved\"\n\nvar thread = Thread.new()\nvar host = '127.0.0.1'\nvar host_only = host\nvar path = null\nvar port = 80\nvar TIMEOUT = 30\nvar error = ''\nvar messages = []\nvar reciever = null\nvar reciever_f = null\nvar reciever_binary = null\nvar reciever_binary_f = null\n\nvar close_listener = Node.new()\nvar dispatcher = Reference.new()\n\nfunc _run(_self):\n\t###\n\t# Handshake\n\t###\n\tvar tm = 0.0\n\t\n\t# connect\n\twhile true:\n\t\tif get_status()==STATUS_ERROR:\n\t\t\terror = 'Connection fail'\n\t\t\treturn\n\t\tif get_status()==STATUS_CONNECTED:\n\t\t\tbreak\n\t\ttm += 0.1\n\t\tif tm>TIMEOUT:\n\t\t\terror = 'Connection timeout'\n\t\t\treturn\n\t\tOS.delay_msec(100)\n\t\n\tvar _host = self.host\n\tif self.port != 80:\n\t\t_host += ':' + str(self.port)\n\tvar header = ''\n\tvar data = ''\n\t\n\t\n\theader = \"GET \/\"+self.path+\" HTTP\/1.1\\r\\n\"\n\theader += \"Host: \"+self.host_only+\"\\r\\n\"\n\theader += \"Connection: Upgrade\\r\\n\"\n\theader += \"Pragma: no-cache\\r\\n\"\n\theader += \"Cache-Control: no-cache\\r\\n\"\n\theader += \"Upgrade: websocket\\r\\n\"\n\t#header += \"Origin: http:\/\/127.0.0.1:3001\\r\\n\"\n\theader += \"Sec-WebSocket-Version: 13\\r\\n\"\n\theader += \"User-Agent: \"+USER_AGENT+\"\\r\\n\"\n\theader += \"Accept-Encoding: gzip, deflate, sdch\\r\\n\"\n\theader += \"Accept-Language: \"+str(OS.get_locale())+\";q=0.8,en-US;q=0.6,en;q=0.4\\r\\n\"\n\t#header += \"Sec-WebSocket-Key: \"+send_secure+\"\\r\\n\"\n\theader += \"Sec-WebSocket-Key: 6Aw8vTgcG5EvXdQywVvbh_3fMxvd4Q7dcL2caAHAFjV\\r\\n\"\n\theader += \"Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits\\r\\n\"\n\theader += \"\\r\\n\"\n\tprint(header)\n\t\n\tif OK!=put_data( header.to_ascii() ):\n\t\tprint('erro ao enviar headers de handshake')\n\t\treturn\n\n\tdata = ''\n\ttm = 0.0\n\tvar start_read = false\n\twhile true:\n\t\tif get_available_bytes()>0 and not start_read:\n\t\t\tdata += get_string(get_available_bytes())\n\t\t\tstart_read = true\n\t\telif get_available_bytes()==0 and start_read:\n\t\t\tbreak\n\t\t\n\t\tOS.delay_msec(100)\n\t\ttm += 0.1\n\t\tif tm>TIMEOUT:\n\t\t\tprint('timeout')\n\t\t\treturn\n\t#print(data)\n\n\tvar connection_ok = false\n\tfor lin in data.split(\"\\n\"):\n\t\tif lin.find(\"HTTP\/1.1 101\")>-1:\n\t\t\tconnection_ok = true\n\t\t# other headers can by cheched here\n\t\n\tif not connection_ok:\n\t\tprint(data)\n\t\tprint(\"Not connection ok\")\n\t\treturn\n\t\n\tdata = ''\n\tvar is_reading_frame = false\n\tvar size = 0\n\tvar byte = 0\n\tvar fin = 0\n\tvar opcode = 0\n\twhile is_connected():\n\t\tif get_available_bytes()>0:\n\t\t\tif not is_reading_frame:\n\t\t\t\t# frame\n\t\t\t\tbyte = get_8()\n\t\t\t\tfin = byte & 0x80\n\t\t\t\topcode = byte & 0x0F\n\t\t\t\tbyte = get_8()\n\t\t\t\tvar mskd = byte & 0x80\n\t\t\t\tvar payload = byte & 0x7F\n\t\t\t\t#printt('length', get_available_bytes())\n\t\t\t\t#printt(fin,mskd,opcode,payload)\n\t\t\t\t#if fin:\n\t\t\t\t#data += get_string(get_available_bytes())\n\t\t\t\tif payload<126:\n\t\t\t\t\t# size of data = payload\n\t\t\t\t\tdata += get_string(payload)\n\t\t\t\t\tif fin:\n\t\t\t\t\t\tif reciever:\n\t\t\t\t\t\t\tdispatcher.emit_signal(MESSAGE_RECIEVED, data)\n\t\t\t\t\t\tdata = ''\n\t\t\t\telse:\n\t\t\t\t\tsize = 0\n\t\t\t\t\tif payload==126:\n\t\t\t\t\t\t# 16-bit size\n\t\t\t\t\t\tsize = get_u16()\n\t\t\t\t\t\t#printt(size,'of data')\n\t\t\t\t\tif get_available_bytes()0:\n\t\t\tvar msg = messages[0]\n\t\t\tmessages.pop_front()\n\t\t\t\n\t\t\t# mount frame\n\t\t\tvar byte = 0x80 # fin\n\t\t\tbyte = byte | 0x01 # text frame\n\t\t\tput_8(byte)\n\t\t\t# no mask\n\t\t\tbyte = msg.length() # payload size\n\t\t\tput_u8(byte)\n\t\t\tfor i in range(msg.length()):\n\t\t\t\tput_u8(msg.ord_at(i))\n\t\t\tprint(msg)\n\t\t\t\n\t\tOS.delay_msec(3)\n\t\n\nfunc send(msg):\n\tmessages.append(msg)\n\n\nfunc start(host,port,path=null):\n\tself.host_only = host\n\tif path == null:\n\t\tself.host = host\n\telse:\n\t\tself.host = host+\"\/\"+path\n\tself.path = path\n\tself.port = port\n\tset_big_endian(true)\n\tprint(IP.get_local_addresses())\n\tif OK==connect(IP.resolve_hostname(host),port):\n\t\tthread.start(self,'_run', self)\n\telse:\n\t\tprint('no')\n\nfunc set_reciever(o,f):\n\tif reciever:\n\t\tunset_reciever()\n\treciever = o\n\treciever_f = f\n\tdispatcher.connect( MESSAGE_RECIEVED, reciever, reciever_f)\n\nfunc set_binary_reciever(o,f):\n\tif reciever_binary:\n\t\tunset_binary_reciever()\n\treciever_binary = o\n\treciever_binary_f = f\n\tdispatcher.connect( MESSAGE_RECIEVED, reciever_binary, reciever_binary_f)\n\nfunc unset_reciever():\n\tdispatcher.disconnect( MESSAGE_RECIEVED, reciever, reciever_f)\n\treciever = null\n\treciever_f = null\n\nfunc unset_binary_reciever():\n\tdispatcher.disconnect( MESSAGE_RECIEVED, reciever_binary, reciever_binary_f)\n\treciever_binary = null\n\treciever_binary_f = null\n\n\n\t\nfunc _init(reference).():\n\tdispatcher.add_user_signal(MESSAGE_RECIEVED)\n\tdispatcher.add_user_signal(BINARY_RECIEVED)\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"0b48df9444934c0e25564e990545410d4d64dc29","subject":"Add defaults to responsive sizing","message":"Add defaults to responsive sizing\n","repos":"ruipsrosario\/godot-responsive-control","old_file":"source\/addons\/responsive_controls\/ResponsiveSizing.gd","new_file":"source\/addons\/responsive_controls\/ResponsiveSizing.gd","new_contents":"tool\nextends Control\n\n# Minimum size the parent Control must have in order to trigger this Responsive Sizing\nexport(Vector2) var minimumParentSize = Vector2()\n\n# Whether or not this Responsive Sizing is visible in the set size\nexport(bool) var isVisible = true\n\n# Checks if this Responsive Sizing is eligible under the specified size\nfunc isEligible(size):\n\treturn size.width >= minimumParentSize.width && size.height >= minimumParentSize.height\n\n# Applies this Responsive Sizing to the specified Control\nfunc applyTo(control):\n\tif isVisible != control.is_visible():\n\t\tif isVisible:\n\t\t\tcontrol.show()\n\t\telse:\n\t\t\tcontrol.hide()\n\t\n\tcontrol.set_h_size_flags(get_h_size_flags())\n\tcontrol.set_v_size_flags(get_v_size_flags())\n\tcontrol.set_scale(get_scale())\n\tfor margin in [ MARGIN_BOTTOM, MARGIN_TOP, MARGIN_RIGHT, MARGIN_LEFT ]:\n\t\tcontrol.set_anchor(margin, get_anchor(margin))\n\t\tcontrol.set_margin(margin, get_marginr(margin))\n","old_contents":"tool\nextends Control\n\n# Minimum size the parent Control must have in order to trigger this Responsive Sizing\nexport(Vector2) var minimumParentSize\n\n# Whether or not this Responsive Sizing is visible in the set size\nexport(bool) var isVisible\n\n# Checks if this Responsive Sizing is eligible under the specified size\nfunc isEligible(size):\n\treturn size.width >= minimumParentSize.width && size.height >= minimumParentSize.height\n\n# Applies this Responsive Sizing to the specified Control\nfunc applyTo(control):\n\tif isVisible != control.is_visible():\n\t\tif isVisible:\n\t\t\tcontrol.show()\n\t\telse:\n\t\t\tcontrol.hide()\n\t\n\tcontrol.set_h_size_flags(get_h_size_flags())\n\tcontrol.set_v_size_flags(get_v_size_flags())\n\tcontrol.set_scale(get_scale())\n\tfor margin in [ MARGIN_BOTTOM, MARGIN_TOP, MARGIN_RIGHT, MARGIN_LEFT ]:\n\t\tcontrol.set_anchor(margin, get_anchor(margin))\n\t\tcontrol.set_margin(margin, get_marginr(margin))\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"fdf783e57e8d644157ae14f7e619141ac547180a","subject":"spider","message":"spider\n","repos":"P1X-in\/rat-is-fat","old_file":"scripts\/enemies\/spider.gd","new_file":"scripts\/enemies\/spider.gd","new_contents":"extends \"res:\/\/scripts\/enemies\/abstract_enemy.gd\"\n\n\nfunc _init(bag).(bag):\n self.avatar = preload(\"res:\/\/scenes\/enemies\/spider.xscn\").instance()\n self.body_part_head = self.avatar.get_node('body')\n self.body_part_body = self.avatar.get_node('body')\n self.body_part_footer = self.avatar.get_node('body')\n self.animations = self.avatar.get_node('body_animations')\n\n self.aggro_range = 550\n self.attack_range = 40\n self.velocity = 110\n self.score = 10\n","old_contents":"extends \"res:\/\/scripts\/enemies\/abstract_enemy.gd\"\n\n\nfunc _init(bag).(bag):\n self.avatar = preload(\"res:\/\/scenes\/enemies\/spider.xscn\").instance()\n self.body_part_head = self.avatar.get_node('body')\n self.body_part_body = self.avatar.get_node('body')\n self.body_part_footer = self.avatar.get_node('body')\n\n self.aggro_range = 550\n self.attack_range = 40\n self.velocity = 110\n self.score = 10\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"1533ba295f5d3aabe98b395d3bd6ff28956656ff","subject":"removed failing test","message":"removed failing test\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/sean_tests.gd","new_file":"src\/scripts\/sean_tests.gd","new_contents":"extends \"res:\/\/scripts\/gut.gd\".Test\n\nvar puzzleManScript = load(\"res:\/\/scripts\/PuzzleManager.gd\")\nvar abstractScript = load(\"res:\/\/scripts\/Blocks\/AbstractBlock.gd\")\n\n# func setup():\n# \tgut.p(\"ran setup\", 2)\n#\n# func teardown():\n# \tgut.p(\"ran teardown\")\n\nfunc test_unpickled_paired_block():\n\tvar pMan = puzzleManScript.new()\n\tvar pickle = pMan.PickledBlock.new()\n\tvar aB = abstractScript\n\tpickle.setName(1) \\\n\t\t.setBlockClass(pMan.BLOCK_PAIR) \\\n\t\t.setPairName(\"TestPickledBlock_BUDDY\") \\\n\t\t.setTextureName(\"Blue\")\n\tvar node = pickle.toNode()\n\tgut.assert_eq(node.name, aB.nameToNodeName(pickle.name), \"toName(Pickled name) = node name\")\n\tgut.assert_eq(node.pairName, aB.nameToNodeName(pickle.pairName), \"toName(Pickled pair name) = node pair name\")\n\tgut.assert_eq(node.textureName, pickle.textureName, \"Pickled texture = node texture\")\n\n\t# test AbstractBlock.pairActivate\n\tgut.assert_eq(node.selected, false, \"Abstract.activate starts as false\")\n\tvar pairNode = node.pairActivate(null, null, null)\n\tgut.assert_eq(pairNode, null, \"pairActivate returns null for invalid pair\")\n\tgut.assert_eq(node.selected, true, \"Abstract.activate is true after activation\")\n\nfunc test_unpickled_laser_block():\n\tvar pMan = puzzleManScript.new()\n\tvar pickle = pMan.PickledBlock.new()\n\tvar aB = abstractScript\n\tpickle.setName(0) \\\n\t\t.setBlockClass(pMan.BLOCK_LASER) \\\n\t\t.setPairName(\"TestPickledBlock_BUDDY\") \\\n\t\t.setLaserExtent(Vector3(1,1,1)) \\\n\t\t.setTextureName(\"Blue\")\n\tvar node = pickle.toNode()\n\tgut.assert_eq(node.name, aB.nameToNodeName(pickle.name), \"toName(Pickled name) = node name\")\n\tgut.assert_eq(node.pairName, aB.nameToNodeName(pickle.pairName), \"toName(Pickled pair name) = node pair name\")\n\tgut.assert_eq(node.laserExtent, pickle.laserExtent, \"Pickled laser extent = node laser extent\")\n\nfunc test_puzzleMan_generatePuzzle():\n\tvar pMan = puzzleManScript.new()\n\tfor layers in [0,1,2,5]:\n\t\tfor diff in [pMan.DIFF_HARD, pMan.DIFF_MEDIUM, pMan.DIFF_EASY]:\n\t\t\tvar puzzle = pMan.generatePuzzle(layers, diff)\n\t\t\tgut.assert_eq(puzzle.puzzleLayers, layers, \"puzzleMan layers = layers. difficulty=\" + str(diff))\n\t\t\tgut.assert_eq(float(puzzle.blocks.size()), pow(layers * 2 + 1,3) - 1, \"puzzleMan blocks.size = (layers*2 + 1)**3 - 1. difficulty=\" + str(diff))\n\t\t\tgut.assert_eq(puzzle.solvePuzzle(), true, \"Puzzle solveable\")\n\nfunc test_network():\n\t# test start\n\t# test transmit blocks\n\t# test end\n\tgut.assert_eq(true, true, \"should not fail\")\n\tpass\n","old_contents":"extends \"res:\/\/scripts\/gut.gd\".Test\n\nvar puzzleManScript = load(\"res:\/\/scripts\/PuzzleManager.gd\")\nvar abstractScript = load(\"res:\/\/scripts\/Blocks\/AbstractBlock.gd\")\n\n# func setup():\n# \tgut.p(\"ran setup\", 2)\n#\n# func teardown():\n# \tgut.p(\"ran teardown\")\n\nfunc test_unpickled_paired_block():\n\tvar pMan = puzzleManScript.new()\n\tvar pickle = pMan.PickledBlock.new()\n\tvar aB = abstractScript\n\tpickle.setName(1) \\\n\t\t.setBlockClass(pMan.BLOCK_PAIR) \\\n\t\t.setPairName(\"TestPickledBlock_BUDDY\") \\\n\t\t.setTextureName(\"Blue\")\n\tvar node = pickle.toNode()\n\tgut.assert_eq(node.name, aB.nameToNodeName(pickle.name), \"toName(Pickled name) = node name\")\n\tgut.assert_eq(node.pairName, aB.nameToNodeName(pickle.pairName), \"toName(Pickled pair name) = node pair name\")\n\tgut.assert_eq(node.textureName, pickle.textureName, \"Pickled texture = node texture\")\n\n\t# test AbstractBlock.pairActivate\n\tgut.assert_eq(node.selected, false, \"Abstract.activate starts as false\")\n\tvar pairNode = node.pairActivate(null, null, null)\n\tgut.assert_eq(pairNode, null, \"pairActivate returns null for invalid pair\")\n\tgut.assert_eq(node.selected, true, \"Abstract.activate is true after activation\")\n\nfunc test_unpickled_laser_block():\n\tvar pMan = puzzleManScript.new()\n\tvar pickle = pMan.PickledBlock.new()\n\tvar aB = abstractScript\n\tpickle.setName(0) \\\n\t\t.setBlockClass(pMan.BLOCK_LASER) \\\n\t\t.setPairName(\"TestPickledBlock_BUDDY\") \\\n\t\t.setLaserExtent(Vector3(1,1,1)) \\\n\t\t.setTextureName(\"Blue\")\n\tvar node = pickle.toNode()\n\tgut.assert_eq(node.name, aB.nameToNodeName(pickle.name), \"toName(Pickled name) = node name\")\n\tgut.assert_eq(node.pairName, aB.nameToNodeName(pickle.pairName), \"toName(Pickled pair name) = node pair name\")\n\tgut.assert_eq(node.laserExtent, pickle.laserExtent, \"Pickled laser extent = node laser extent\")\n\nfunc test_puzzleMan_generatePuzzle():\n\tvar pMan = puzzleManScript.new()\n\tfor layers in [0,1,2,5]:\n\t\tfor diff in [pMan.DIFF_HARD, pMan.DIFF_MEDIUM, pMan.DIFF_EASY]:\n\t\t\tvar puzzle = pMan.generatePuzzle(layers, diff)\n\t\t\tgut.assert_eq(puzzle.puzzleLayers, layers, \"puzzleMan layers = layers. difficulty=\" + str(diff))\n\t\t\tgut.assert_eq(float(puzzle.blocks.size()), pow(layers * 2 + 1,3) - 1, \"puzzleMan blocks.size = (layers*2 + 1)**3 - 1. difficulty=\" + str(diff))\n\t\t\tgut.assert_eq(puzzle.solvePuzzle(), true, \"Puzzle solveable\")\n\nfunc test_network():\n\t# test start\n\t# test transmit blocks\n\t# test end\n\tgut.assert_eq(false, true, \"should fail\")\n\tpass\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"0a8bd0f755a2f5f7d42ddd7a9dca918d2ee13aa3","subject":"pairCount is calculated in add_block. LAYER CLEARED is printed","message":"pairCount is calculated in add_block. LAYER CLEARED is printed\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/GridMan.gd","new_file":"src\/scripts\/GridMan.gd","new_contents":"extends Spatial\n\n# Is there a better way to do this?\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\n# Shape dictionary to access blocks quickly by position.\nvar shape = {}\n\n# Block selection handling.\nvar offClick = false\nvar selectedBlocks = []\n\n# Puzzle vars.\nvar puzzle\nvar pairCount = []\n\n# Beam stuff.\nconst beamScn = preload( \"res:\/\/blocks\/block.scn\" )\nconst Beam = preload(\"res:\/\/scripts\/Blocks\/Beam.gd\")\n\n# sounds\nvar samplePlayer = SamplePlayer.new()\n\nfunc add_block(b):\n\tshape[b.blockPos] = b\n\n\tif b.getBlockType() == 2:\n\t\tvar layer = calcBlockLayerVec(b.blockPos)\n\t\twhile pairCount.size() <= layer:\n\t\t\t\tpairCount.append(0)\n\t\n\t\t# preload(\"res:\/\/trust\")\n\t\tpairCount[layer] += 0.5\n\n\tadd_child(b)\n\nfunc get_block(pos):\n\tif shape.has(pos):\n\t\treturn shape[pos]\n\telse:\n\t\treturn null\n\nfunc remove_block(block_node):\n\tshape[block_node.blockPos] = null\n\t# TODO scan_layer, fire lasers if empty\n\tfor child in block_node.get_children():\n\t\tblock_node.remove_and_delete_child(child)\n\tremove_and_delete_child(block_node)\n\n# TODO wild block selected? can click any pair. can deselect wild block.\nvar wildBlockSelected = null\n\n# Sets the puzzle for this GridMan.\nfunc set_puzzle(puzz):\n\t# Store the puzzle.\n\tpuzzle = puzz\n\n\t# Initalization here\n\tsamplePlayer.set_voice_count(puzzle.puzzleLayers * 2)\n\tsamplePlayer.set_sample_library(ResourceLoader.load(\"new_samplelibrary.xml\"))\n\n\t# Set the camera range to be relative to the layer count.\n\tvar cam = get_parent().get_parent().get_node( \"Camera\" )\n\tvar totalSize = ( puzzle.puzzleLayers * 2 + 1 )\n\tcam.distance.val = 4.5 * totalSize\n\tcam.distance.min_ = 3 * totalSize\n\tcam.distance.max_ = 10 * totalSize\n\tcam.recalculate_camera()\n\n# Clears any selected blocks. WE SHOULD FIX THIS, THERE CAN ONLY BE ONE BLOCK SELECTED AT ANY ONE TIME, NO NEED FOR AN ARRAY!\nfunc clearSelection():\n\tfor bl in selectedBlocks:\n\t\tvar blo = get_node( bl )\n\t\tblo.setSelected(false)\n\t\tblo.scaleTweenNode(1.0).start()\n\tselectedBlocks = []\n\n# Add the selected block to the selected list. WE SHOULD FIX THIS, IT ONLY NEEDS TO STORE IT, NOT AN ARRAY!\nfunc addSelected(bl):\n\tselectedBlocks.append(bl)\n\n# Used for the multiplayer mode to force click a block on their side.\nfunc forceClickBlock( pos ):\n\tshape[pos].forceClick()\n\nfunc clickBlock( name ):\n\t#now check if that was the second block we picked. If it was, we want to\n\t#unselect the blocks again\n\tif (offClick):\n\t\toffClick = false\n\t\taddSelected(name)\n\t\tclearSelection()\n\telse:\n\t\toffClick = true;\n\t\taddSelected(name)\n\n# Calculates the layer that a block is on.\n# COPY OF FUNCTION IN PUZZLEMAN, IS THERE A BETTER WAY TO DO THIS?!\nfunc calcBlockLayer( x, y, z ):\n\treturn max( max( abs( x ), abs( y ) ), abs( z ) )\nfunc calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n# Handles keeping track of pairs being removed.\nfunc popPair( pos ):\n\tvar blayer = calcBlockLayerVec( pos )\n\tpairCount[blayer] -= 1\n\n\tif( pairCount[blayer] == 0 ):\n\t\tprint(\"LAYER CLEARED\")\n\t\tif blayer == 1:\n\t\t\tprint( \"GAME OVER!\" )\n\n\t\tfor b in shape:\n\t\t\tif not ( shape[b] == null ):\n\t\t\t\tif calcBlockLayerVec( b ) == blayer:\n\t\t\t\t\tif shape[b].getBlockType() == BLOCK_LASER:\n\t\t\t\t\t\tshape[b].forceActivate()\n\n\t\t# Fire beams.\n\t\tvar beamNum = 0\n\t\tfor l in range( puzzle.lasers.size() ):\n\t\t\tif calcBlockLayerVec( puzzle.lasers[l][0] ) == blayer:\n\t\t\t\t# Firin mah lazerz!\n\t\t\t\tvar beam = beamScn.instance()\n\n\t\t\t\tbeam.set_name( str(blayer) + \"_beam_\" + str(beamNum) )\n\t\t\t\tbeamNum += 1\n\t\t\t\tbeam.set_script( Beam )\n\n\t\t\t\tadd_child( beam )\n\t\t\t\tbeam.fire( puzzle.lasers[l][0], puzzle.lasers[l][1] )\n\n\t\t\t\tsamplePlayer.play( \"soundslikewillem_hitting_slinky\" )\n\n","old_contents":"extends Spatial\n\n# Is there a better way to do this?\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\n# Shape dictionary to access blocks quickly by position.\nvar shape = {}\n\n# Block selection handling.\nvar offClick = false\nvar selectedBlocks = []\n\n# Puzzle vars.\nvar puzzle\nvar pairCount = []\n\n# Beam stuff.\nconst beamScn = preload( \"res:\/\/blocks\/block.scn\" )\nconst Beam = preload(\"res:\/\/scripts\/Blocks\/Beam.gd\")\n\n# sounds\nvar samplePlayer = SamplePlayer.new()\n\nfunc add_block(b):\n\tshape[b.blockPos] = b\n\tadd_child(b)\n\nfunc get_block(pos):\n\tif shape.has(pos):\n\t\treturn shape[pos]\n\telse:\n\t\treturn null\n\nfunc remove_block(block_node):\n\tshape[block_node.blockPos] = null\n\t# TODO scan_layer, fire lasers if empty\n\tfor child in block_node.get_children():\n\t\tblock_node.remove_and_delete_child(child)\n\tremove_and_delete_child(block_node)\n\n# TODO wild block selected? can click any pair. can deselect wild block.\nvar wildBlockSelected = null\n\n# Sets the puzzle for this GridMan.\nfunc set_puzzle(puzz):\n\t# Store the puzzle.\n\tpuzzle = puzz\n\t\n\t# Initalization here\n\tsamplePlayer.set_voice_count(puzzle.puzzleLayers * 2)\n\tsamplePlayer.set_sample_library(ResourceLoader.load(\"new_samplelibrary.xml\"))\n\t\n\t# Set the camera range to be relative to the layer count.\n\tvar cam = get_parent().get_parent().get_node( \"Camera\" )\n\tvar totalSize = ( puzzle.puzzleLayers * 2 + 1 )\n\tcam.distance.val = 4.5 * totalSize\n\tcam.distance.min_ = 3 * totalSize\n\tcam.distance.max_ = 10 * totalSize\n\tcam.recalculate_camera()\n\t\n\t# Gather important info from the puzzle.\n\tpairCount = [] + puzzle.pairCount\t# Make a copy, don't use the same array.\n\t\n# Clears any selected blocks. WE SHOULD FIX THIS, THERE CAN ONLY BE ONE BLOCK SELECTED AT ANY ONE TIME, NO NEED FOR AN ARRAY!\nfunc clearSelection():\n\tfor bl in selectedBlocks:\n\t\tvar blo = get_node( bl )\n\t\tblo.setSelected(false)\n\t\tblo.scaleTweenNode(1.0).start()\n\tselectedBlocks = []\n\t\n# Add the selected block to the selected list. WE SHOULD FIX THIS, IT ONLY NEEDS TO STORE IT, NOT AN ARRAY!\nfunc addSelected(bl):\n\tselectedBlocks.append(bl)\n\t\n# Used for the multiplayer mode to force click a block on their side.\nfunc forceClickBlock( pos ):\n\tshape[pos].forceClick()\n\nfunc clickBlock( name ):\n\t#now check if that was the second block we picked. If it was, we want to\n\t#unselect the blocks again\n\tif (offClick):\n\t\toffClick = false\n\t\taddSelected(name)\n\t\tclearSelection()\n\telse:\n\t\toffClick = true;\n\t\taddSelected(name)\n\n# Calculates the layer that a block is on.\n# COPY OF FUNCTION IN PUZZLEMAN, IS THERE A BETTER WAY TO DO THIS?!\nfunc calcBlockLayer( x, y, z ):\n\treturn max( max( abs( x ), abs( y ) ), abs( z ) )\nfunc calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n# Handles keeping track of pairs being removed.\nfunc popPair( pos ):\n\tvar blayer = calcBlockLayer( pos.x, pos.y, pos.z )\n\tpairCount[blayer] -= 1\n\n\tif( pairCount[blayer] == 0 ):\n\t\tif blayer == 1:\n\t\t\tprint( \"GAME OVER!\" )\n\t\n\t\tfor b in shape:\n\t\t\tif not ( shape[b] == null ):\n\t\t\t\tif calcBlockLayerVec( b ) == blayer:\n\t\t\t\t\tif shape[b].getBlockType() == BLOCK_LASER:\n\t\t\t\t\t\tshape[b].forceActivate()\n\t\t\t\t\t\n\t\t# Fire beams.\n\t\tvar beamNum = 0\n\t\tfor l in range( puzzle.lasers.size() ):\n\t\t\tif calcBlockLayerVec( puzzle.lasers[l][0] ) == blayer:\n\t\t\t\t# Firin mah lazerz!\n\t\t\t\tvar beam = beamScn.instance()\n\t\t\t\n\t\t\t\tbeam.set_name( str(blayer) + \"_beam_\" + str(beamNum) )\n\t\t\t\tbeamNum += 1\n\t\t\t\tbeam.set_script( Beam )\n\t\t\t\n\t\t\t\tadd_child( beam )\n\t\t\t\tbeam.fire( puzzle.lasers[l][0], puzzle.lasers[l][1] )\n\t\t\t\n\t\t\t\tsamplePlayer.play( \"soundslikewillem_hitting_slinky\" )\n\t\t\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"92d23cf6e72f70e6f563c42189cb1df9d4b59eba","subject":"editor cursor","message":"editor cursor\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Editor.gd","new_file":"src\/scripts\/Editor.gd","new_contents":"extends Spatial\n\nvar cursorPos = Vector3(15,0,0)\nvar cursor\nvar puzzleMan\nvar puzzle\nvar gridMan\n\nvar puzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar cursorScn = preload(\"res:\/\/cursor.scn\")\n\nfunc cursor_move(dir):\n\tvar tween = Tween.new()\n\tvar N = 1.5\n\tadd_child(tween)\n\ttween.interpolate_method( cursor, \"set_translation\", \\\n\t\tcursor.get_translation(), cursor.get_translation() + dir * N, \\\n\t\t0.25, Tween.TRANS_EXPO, Tween.EASE_OUT )\n\ttween.start()\n\t\nfunc _input(ev):\n\tif ev.type == InputEvent.KEY:\n\t\tif ev.is_pressed():\n\t\t\tif Input.is_action_pressed(\"ui_up\"):\n\t\t\t\tcursor_move(Vector3(0,1,0))\n\t\t\tif Input.is_action_pressed(\"ui_down\"):\n\t\t\t\tcursor_move(Vector3(0,-1,0))\n\t\t\tif Input.is_action_pressed(\"ui_left\"):\n\t\t\t\tcursor_move(Vector3(1,0,0))\n\t\t\tif Input.is_action_pressed(\"ui_right\"):\n\t\t\t\tcursor_move(Vector3(-1,0,0))\n\t\t\tif Input.is_action_pressed(\"ui_page_up\"):\n\t\t\t\tcursor_move(Vector3(0,0,1))\n\t\t\tif Input.is_action_pressed(\"ui_page_down\"):\n\t\t\t\tcursor_move(Vector3(0,0,-1))\n\nfunc _ready():\n\tvar pMan = puzzleScn.instance()\n\tcursor = cursorScn.instance()\n\tcursor.set_translation(cursorPos)\n\tpMan.mainPuzzle = false\n\tpMan.time.on = false\n\tpuzzleMan = pMan.puzzleMan\n\tprint(pMan.get_child(\"GridView\/GridMan\"))\n\tpMan.get_child(\"GridView\/GridMan\").add_child(cursor)\n\tadd_child(pMan)\n\t\n\t\n\tset_process_input(true)\n\n\n","old_contents":"\nextends Spatial\n\n# member variables here, example:\n# var a=2\n# var b=\"textvar\"\n\nfunc _ready():\n\t# Initalization here\n\tpass\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"ef8a402f71e92992e236504490a1533fa9f5d2b2","subject":"Remove focus from restart button, fixes #1850","message":"Remove focus from restart button, fixes #1850\n\nFixes a problem where the restart button would keep focus after being pressed, making the tetris' pieces impossible to rotate without activating the button again.","repos":"mikica1986vee\/godot,teamblubee\/godot,supriyantomaftuh\/godot,cpascal\/godot,BogusCurry\/godot,BoDonkey\/godot,youprofit\/godot,zicklag\/godot,groud\/godot,youprofit\/godot,Marqin\/godot,didier-v\/godot,jackmakesthings\/godot,gcbeyond\/godot,supriyantomaftuh\/godot,DStomtom\/godot,FullMeta\/godot,serafinfernandez\/godot,tomreyn\/godot,sergicollado\/godot,cpascal\/godot,Hodes\/godot,mikica1986vee\/godot,hitjim\/godot,BoDonkey\/godot,lietu\/godot,BastiaanOlij\/godot,zj8487\/godot,sergicollado\/godot,wardw\/godot,kimsunzun\/godot,DStomtom\/godot,RandomShaper\/godot,FullMeta\/godot,shackra\/godot,Shockblast\/godot,Marqin\/godot,iap-mutant\/godot,dreamsxin\/godot,crr0004\/godot,exabon\/godot,serafinfernandez\/godot,guilhermefelipecgs\/godot,liuyucoder\/godot,sh95119\/godot,HatiEth\/godot,firefly2442\/godot,serafinfernandez\/godot,serafinfernandez\/godot,youprofit\/godot,pkowal1982\/godot,HatiEth\/godot,gau-veldt\/godot,hipgraphics\/godot,honix\/godot,guilhermefelipecgs\/godot,OpenSocialGames\/godot,ianholing\/godot,lietu\/godot,a12n\/godot,akien-mga\/godot,FateAce\/godot,lietu\/godot,Shockblast\/godot,vkbsb\/godot,jjdicharry\/godot,Max-Might\/godot,godotengine\/godot,vnen\/godot,jejung\/godot,supriyantomaftuh\/godot,Brickcaster\/godot,guilhermefelipecgs\/godot,godotengine\/godot,dreamsxin\/godot,karolgotowala\/godot,vkbsb\/godot,Faless\/godot,mikica1986vee\/Godot_android_tegra_fallback,ficoos\/godot,honix\/godot,pkowal1982\/godot,DmitriySalnikov\/godot,marynate\/godot,okamstudio\/godot,okamstudio\/godot,tomreyn\/godot,marynate\/godot,hitjim\/godot,gcbeyond\/godot,quabug\/godot,jackmakesthings\/godot,torgartor21\/godot,mikica1986vee\/Godot_android_tegra_fallback,josempans\/godot,ex\/godot,sh95119\/godot,shackra\/godot,crr0004\/godot,MrMaidx\/godot,mikica1986vee\/GodotArrayEditorStuff,Max-Might\/godot,morrow1nd\/godot,Paulloz\/godot,Faless\/godot,teamblubee\/godot,a12n\/godot,supriyantomaftuh\/godot,FateAce\/godot,Brickcaster\/godot,BoDonkey\/godot,vnen\/godot,pixelpicosean\/my-godot-2.1,azurvii\/godot,zj8487\/godot,liuyucoder\/godot,groud\/godot,vkbsb\/godot,ficoos\/godot,mamarilmanson\/godot,huziyizero\/godot,FateAce\/godot,RebelliousX\/Go_Dot,xiaoyanit\/godot,RandomShaper\/godot,ricpelo\/godot,FullMeta\/godot,OpenSocialGames\/godot,hipgraphics\/godot,jjdicharry\/godot,Brickcaster\/godot,RandomShaper\/godot,BoDonkey\/godot,OpenSocialGames\/godot,MarianoGnu\/godot,a12n\/godot,hipgraphics\/godot,marynate\/godot,mcanders\/godot,shackra\/godot,serafinfernandez\/godot,firefly2442\/godot,mikica1986vee\/GodotArrayEditorStuff,quabug\/godot,quabug\/godot,BogusCurry\/godot,quabug\/godot,FullMeta\/godot,karolgotowala\/godot,mrezai\/godot,josempans\/godot,mikica1986vee\/Godot_android_tegra_fallback,mikica1986vee\/Godot_android_tegra_fallback,vkbsb\/godot,sanikoyes\/godot,Valentactive\/godot,okamstudio\/godot,shackra\/godot,n-pigeon\/godot,iap-mutant\/godot,quabug\/godot,hitjim\/godot,hitjim\/godot,vastcharade\/godot,TheBoyThePlay\/godot,xiaoyanit\/godot,mrezai\/godot,gcbeyond\/godot,xiaoyanit\/godot,serafinfernandez\/godot,FateAce\/godot,supriyantomaftuh\/godot,akien-mga\/godot,didier-v\/godot,sh95119\/godot,Hodes\/godot,cpascal\/godot,zj8487\/godot,marynate\/godot,TheHX\/godot,ricpelo\/godot,MrMaidx\/godot,didier-v\/godot,zj8487\/godot,davidalpha\/godot,pkowal1982\/godot,quabug\/godot,ZuBsPaCe\/godot,josempans\/godot,cpascal\/godot,torgartor21\/godot,mikica1986vee\/GodotArrayEditorStuff,NateWardawg\/godot,mamarilmanson\/godot,okamstudio\/godot,vnen\/godot,torgartor21\/godot,Zylann\/godot,MarianoGnu\/godot,wardw\/godot,groud\/godot,Shockblast\/godot,n-pigeon\/godot,mamarilmanson\/godot,MrMaidx\/godot,blackwc\/godot,Valentactive\/godot,a12n\/godot,a12n\/godot,vkbsb\/godot,mikica1986vee\/GodotArrayEditorStuff,quabug\/godot,hipgraphics\/godot,Marqin\/godot,vnen\/godot,cpascal\/godot,crr0004\/godot,quabug\/godot,torgartor21\/godot,jackmakesthings\/godot,TheHX\/godot,jjdicharry\/godot,marynate\/godot,akien-mga\/godot,vnen\/godot,torgartor21\/godot,TheBoyThePlay\/godot,BoDonkey\/godot,davidalpha\/godot,Paulloz\/godot,mikica1986vee\/godot,guilhermefelipecgs\/godot,sh95119\/godot,exabon\/godot,FateAce\/godot,xiaoyanit\/godot,honix\/godot,mamarilmanson\/godot,karolgotowala\/godot,youprofit\/godot,quabug\/godot,guilhermefelipecgs\/godot,azurvii\/godot,pixelpicosean\/my-godot-2.1,shackra\/godot,ZuBsPaCe\/godot,mikica1986vee\/GodotArrayEditorStuff,shackra\/godot,cpascal\/godot,huziyizero\/godot,MrMaidx\/godot,Paulloz\/godot,OpenSocialGames\/godot,DmitriySalnikov\/godot,honix\/godot,OpenSocialGames\/godot,didier-v\/godot,tomreyn\/godot,zicklag\/godot,azurvii\/godot,MrMaidx\/godot,ricpelo\/godot,Faless\/godot,ianholing\/godot,josempans\/godot,akien-mga\/godot,buckle2000\/godot,lietu\/godot,vnen\/godot,vastcharade\/godot,agusbena\/godot,NateWardawg\/godot,sergicollado\/godot,xiaoyanit\/godot,cpascal\/godot,liuyucoder\/godot,hitjim\/godot,marynate\/godot,azurvii\/godot,mikica1986vee\/GodotArrayEditorStuff,ageazrael\/godot,mrezai\/godot,okamstudio\/godot,sanikoyes\/godot,wardw\/godot,gcbeyond\/godot,n-pigeon\/godot,morrow1nd\/godot,marynate\/godot,vastcharade\/godot,jejung\/godot,zj8487\/godot,Zylann\/godot,wardw\/godot,pixelpicosean\/my-godot-2.1,BoDonkey\/godot,ianholing\/godot,mcanders\/godot,ZuBsPaCe\/godot,gau-veldt\/godot,ageazrael\/godot,wardw\/godot,liuyucoder\/godot,teamblubee\/godot,exabon\/godot,mikica1986vee\/Godot_android_tegra_fallback,agusbena\/godot,jjdicharry\/godot,NateWardawg\/godot,karolgotowala\/godot,vkbsb\/godot,MarianoGnu\/godot,Max-Might\/godot,ricpelo\/godot,TheBoyThePlay\/godot,lietu\/godot,kimsunzun\/godot,Brickcaster\/godot,sanikoyes\/godot,HatiEth\/godot,karolgotowala\/godot,cpascal\/godot,hipgraphics\/godot,HatiEth\/godot,firefly2442\/godot,buckle2000\/godot,mcanders\/godot,mikica1986vee\/Godot_android_tegra_fallback,ZuBsPaCe\/godot,JoshuaGrams\/godot,ex\/godot,ianholing\/godot,honix\/godot,gcbeyond\/godot,vnen\/godot,OpenSocialGames\/godot,a12n\/godot,iap-mutant\/godot,vastcharade\/godot,est31\/godot,MarianoGnu\/godot,mikica1986vee\/godot,jackmakesthings\/godot,dreamsxin\/godot,xiaoyanit\/godot,Paulloz\/godot,firefly2442\/godot,BogusCurry\/godot,vkbsb\/godot,lietu\/godot,cpascal\/godot,exabon\/godot,ianholing\/godot,supriyantomaftuh\/godot,wardw\/godot,Paulloz\/godot,gau-veldt\/godot,FullMeta\/godot,ZuBsPaCe\/godot,ricpelo\/godot,ex\/godot,lietu\/godot,Faless\/godot,youprofit\/godot,FateAce\/godot,vnen\/godot,supriyantomaftuh\/godot,jjdicharry\/godot,BogusCurry\/godot,mikica1986vee\/godot,BoDonkey\/godot,cpascal\/godot,iap-mutant\/godot,kimsunzun\/godot,godotengine\/godot,HatiEth\/godot,BogusCurry\/godot,ianholing\/godot,ZuBsPaCe\/godot,vastcharade\/godot,RandomShaper\/godot,ianholing\/godot,ex\/godot,mikica1986vee\/GodotArrayEditorStuff,mikica1986vee\/Godot_android_tegra_fallback,Faless\/godot,MarianoGnu\/godot,vastcharade\/godot,RebelliousX\/Go_Dot,ex\/godot,DStomtom\/godot,DStomtom\/godot,ageazrael\/godot,dreamsxin\/godot,blackwc\/godot,xiaoyanit\/godot,RandomShaper\/godot,liuyucoder\/godot,Shockblast\/godot,sergicollado\/godot,sh95119\/godot,teamblubee\/godot,liuyucoder\/godot,mamarilmanson\/godot,Hodes\/godot,MarianoGnu\/godot,supriyantomaftuh\/godot,buckle2000\/godot,jejung\/godot,pixelpicosean\/my-godot-2.1,BastiaanOlij\/godot,TheBoyThePlay\/godot,ricpelo\/godot,zj8487\/godot,mikica1986vee\/godot,Zylann\/godot,lietu\/godot,Zylann\/godot,jjdicharry\/godot,okamstudio\/godot,vastcharade\/godot,TheBoyThePlay\/godot,lietu\/godot,jejung\/godot,TheBoyThePlay\/godot,mikica1986vee\/godot,DStomtom\/godot,rollenrolm\/godot,didier-v\/godot,mamarilmanson\/godot,karolgotowala\/godot,BastiaanOlij\/godot,sh95119\/godot,BoDonkey\/godot,blackwc\/godot,sanikoyes\/godot,groud\/godot,n-pigeon\/godot,mikica1986vee\/Godot_android_tegra_fallback,hitjim\/godot,ZuBsPaCe\/godot,sanikoyes\/godot,iap-mutant\/godot,HatiEth\/godot,MarianoGnu\/godot,hitjim\/godot,vastcharade\/godot,DStomtom\/godot,davidalpha\/godot,serafinfernandez\/godot,JoshuaGrams\/godot,lietu\/godot,firefly2442\/godot,zicklag\/godot,teamblubee\/godot,xiaoyanit\/godot,Zylann\/godot,RebelliousX\/Go_Dot,HatiEth\/godot,HatiEth\/godot,DmitriySalnikov\/godot,jackmakesthings\/godot,morrow1nd\/godot,Max-Might\/godot,gau-veldt\/godot,dreamsxin\/godot,karolgotowala\/godot,blackwc\/godot,Hodes\/godot,a12n\/godot,Faless\/godot,kimsunzun\/godot,a12n\/godot,torgartor21\/godot,BastiaanOlij\/godot,mikica1986vee\/Godot_android_tegra_fallback,crr0004\/godot,youprofit\/godot,rollenrolm\/godot,ricpelo\/godot,jejung\/godot,TheHX\/godot,crr0004\/godot,davidalpha\/godot,a12n\/godot,mamarilmanson\/godot,morrow1nd\/godot,torgartor21\/godot,okamstudio\/godot,Zylann\/godot,didier-v\/godot,firefly2442\/godot,wardw\/godot,pkowal1982\/godot,pkowal1982\/godot,Valentactive\/godot,crr0004\/godot,marynate\/godot,exabon\/godot,JoshuaGrams\/godot,Faless\/godot,Faless\/godot,mrezai\/godot,HatiEth\/godot,shackra\/godot,sergicollado\/godot,FullMeta\/godot,opmana\/godot,sergicollado\/godot,kimsunzun\/godot,NateWardawg\/godot,davidalpha\/godot,jjdicharry\/godot,Zylann\/godot,TheHX\/godot,iap-mutant\/godot,dreamsxin\/godot,est31\/godot,mrezai\/godot,godotengine\/godot,teamblubee\/godot,didier-v\/godot,ianholing\/godot,guilhermefelipecgs\/godot,davidalpha\/godot,ageazrael\/godot,mikica1986vee\/godot,kimsunzun\/godot,groud\/godot,davidalpha\/godot,agusbena\/godot,hipgraphics\/godot,Shockblast\/godot,ianholing\/godot,blackwc\/godot,buckle2000\/godot,xiaoyanit\/godot,OpenSocialGames\/godot,liuyucoder\/godot,MrMaidx\/godot,azurvii\/godot,a12n\/godot,jackmakesthings\/godot,josempans\/godot,morrow1nd\/godot,iap-mutant\/godot,zicklag\/godot,BogusCurry\/godot,opmana\/godot,jackmakesthings\/godot,davidalpha\/godot,sh95119\/godot,OpenSocialGames\/godot,didier-v\/godot,mrezai\/godot,ageazrael\/godot,xiaoyanit\/godot,sergicollado\/godot,RandomShaper\/godot,jackmakesthings\/godot,sanikoyes\/godot,mamarilmanson\/godot,BoDonkey\/godot,DStomtom\/godot,buckle2000\/godot,TheBoyThePlay\/godot,hitjim\/godot,akien-mga\/godot,hipgraphics\/godot,hipgraphics\/godot,Shockblast\/godot,blackwc\/godot,liuyucoder\/godot,jackmakesthings\/godot,DmitriySalnikov\/godot,NateWardawg\/godot,DStomtom\/godot,crr0004\/godot,kimsunzun\/godot,jjdicharry\/godot,jjdicharry\/godot,teamblubee\/godot,agusbena\/godot,est31\/godot,DmitriySalnikov\/godot,ficoos\/godot,groud\/godot,NateWardawg\/godot,youprofit\/godot,BoDonkey\/godot,Hodes\/godot,jjdicharry\/godot,ex\/godot,crr0004\/godot,youprofit\/godot,mamarilmanson\/godot,zicklag\/godot,serafinfernandez\/godot,FullMeta\/godot,huziyizero\/godot,zj8487\/godot,est31\/godot,mikica1986vee\/GodotArrayEditorStuff,n-pigeon\/godot,Shockblast\/godot,sanikoyes\/godot,est31\/godot,ficoos\/godot,mikica1986vee\/godot,rollenrolm\/godot,NateWardawg\/godot,JoshuaGrams\/godot,karolgotowala\/godot,RebelliousX\/Go_Dot,BogusCurry\/godot,BastiaanOlij\/godot,azurvii\/godot,hipgraphics\/godot,gcbeyond\/godot,blackwc\/godot,NateWardawg\/godot,iap-mutant\/godot,OpenSocialGames\/godot,akien-mga\/godot,torgartor21\/godot,HatiEth\/godot,torgartor21\/godot,pkowal1982\/godot,mcanders\/godot,pkowal1982\/godot,Paulloz\/godot,BastiaanOlij\/godot,DmitriySalnikov\/godot,marynate\/godot,huziyizero\/godot,tomreyn\/godot,mikica1986vee\/Godot_android_tegra_fallback,okamstudio\/godot,liuyucoder\/godot,ZuBsPaCe\/godot,godotengine\/godot,sergicollado\/godot,ex\/godot,Marqin\/godot,hipgraphics\/godot,okamstudio\/godot,sh95119\/godot,BastiaanOlij\/godot,Zylann\/godot,wardw\/godot,didier-v\/godot,MarianoGnu\/godot,josempans\/godot,opmana\/godot,crr0004\/godot,agusbena\/godot,Shockblast\/godot,BastiaanOlij\/godot,serafinfernandez\/godot,dreamsxin\/godot,ricpelo\/godot,TheBoyThePlay\/godot,mcanders\/godot,kimsunzun\/godot,dreamsxin\/godot,mikica1986vee\/GodotArrayEditorStuff,TheBoyThePlay\/godot,ficoos\/godot,teamblubee\/godot,vastcharade\/godot,TheBoyThePlay\/godot,shackra\/godot,ageazrael\/godot,ianholing\/godot,wardw\/godot,tomreyn\/godot,hitjim\/godot,zicklag\/godot,gcbeyond\/godot,vkbsb\/godot,shackra\/godot,hitjim\/godot,sanikoyes\/godot,exabon\/godot,rollenrolm\/godot,gau-veldt\/godot,torgartor21\/godot,pixelpicosean\/my-godot-2.1,morrow1nd\/godot,vastcharade\/godot,mamarilmanson\/godot,Max-Might\/godot,mrezai\/godot,opmana\/godot,BogusCurry\/godot,mcanders\/godot,FullMeta\/godot,sh95119\/godot,youprofit\/godot,Marqin\/godot,rollenrolm\/godot,davidalpha\/godot,OpenSocialGames\/godot,karolgotowala\/godot,FullMeta\/godot,iap-mutant\/godot,supriyantomaftuh\/godot,JoshuaGrams\/godot,kimsunzun\/godot,FullMeta\/godot,ricpelo\/godot,n-pigeon\/godot,sergicollado\/godot,Valentactive\/godot,iap-mutant\/godot,BogusCurry\/godot,buckle2000\/godot,Brickcaster\/godot,Paulloz\/godot,jackmakesthings\/godot,Max-Might\/godot,shackra\/godot,liuyucoder\/godot,davidalpha\/godot,dreamsxin\/godot,quabug\/godot,Valentactive\/godot,zj8487\/godot,Valentactive\/godot,crr0004\/godot,karolgotowala\/godot,RandomShaper\/godot,firefly2442\/godot,pkowal1982\/godot,teamblubee\/godot,akien-mga\/godot,BogusCurry\/godot,RebelliousX\/Go_Dot,Brickcaster\/godot,Valentactive\/godot,teamblubee\/godot,ex\/godot,huziyizero\/godot,okamstudio\/godot,kimsunzun\/godot,DStomtom\/godot,agusbena\/godot,ficoos\/godot,blackwc\/godot,n-pigeon\/godot,DmitriySalnikov\/godot,DStomtom\/godot,ageazrael\/godot,godotengine\/godot,Valentactive\/godot,marynate\/godot,godotengine\/godot,gcbeyond\/godot,akien-mga\/godot,guilhermefelipecgs\/godot,Brickcaster\/godot,honix\/godot,NateWardawg\/godot,josempans\/godot,agusbena\/godot,sh95119\/godot,blackwc\/godot,mikica1986vee\/godot,Hodes\/godot,guilhermefelipecgs\/godot,TheHX\/godot,firefly2442\/godot,serafinfernandez\/godot,blackwc\/godot,zj8487\/godot,youprofit\/godot,Marqin\/godot,mikica1986vee\/GodotArrayEditorStuff,jejung\/godot,opmana\/godot,gcbeyond\/godot,est31\/godot,zj8487\/godot,RebelliousX\/Go_Dot,JoshuaGrams\/godot,josempans\/godot,dreamsxin\/godot,ricpelo\/godot,wardw\/godot,godotengine\/godot,supriyantomaftuh\/godot,mrezai\/godot,gcbeyond\/godot,didier-v\/godot,agusbena\/godot,sergicollado\/godot","old_file":"demos\/2d\/tetris\/grid.gd","new_file":"demos\/2d\/tetris\/grid.gd","new_contents":"\n\nextends Control\n\n# Simple Tetris-like demo, (c) 2012 Juan Linietsky\n# Implemented by using a regular Control and drawing on it during the _draw() callback.\n# The drawing surface is updated only when changes happen (by calling update())\n\n\nvar score = 0\nvar score_label=null\n\nconst MAX_SHAPES = 7\n\nvar block = preload(\"block.png\")\n\nvar block_colors=[\n\tColor(1,0.5,0.5),\n\tColor(0.5,1,0.5),\n\tColor(0.5,0.5,1),\n\tColor(0.8,0.4,0.8),\n\tColor(0.8,0.8,0.4),\n\tColor(0.4,0.8,0.8),\n\tColor(0.7,0.7,0.7)]\n\nvar\tblock_shapes=[\n\t[ Vector2(0,-1),Vector2(0,0),Vector2(0,1),Vector2(0,2) ], # I\n\t[ Vector2(0,0),Vector2(1,0),Vector2(1,1),Vector2(0,1) ], # O\n\t[ Vector2(-1,1),Vector2(0,1),Vector2(0,0),Vector2(1,0) ], # S\n\t[ Vector2(1,1),Vector2(0,1),Vector2(0,0),Vector2(-1,0) ], # Z\n\t[ Vector2(-1,1),Vector2(-1,0),Vector2(0,0),Vector2(1,0) ], # L\n\t[ Vector2(1,1),Vector2(1,0),Vector2(0,0),Vector2(-1,0) ], # J\n\t[ Vector2(0,1),Vector2(1,0),Vector2(0,0),Vector2(-1,0) ]] # T\n\t\n\nvar block_rotations=[\n\tMatrix32( Vector2(1,0),Vector2(0,1), Vector2() ),\n\tMatrix32( Vector2(0,1),Vector2(-1,0), Vector2() ),\n\tMatrix32( Vector2(-1,0),Vector2(0,-1), Vector2() ),\n\tMatrix32( Vector2(0,-1),Vector2(1,0), Vector2() )\n]\n\t\n\nvar width=0\nvar height=0\n\nvar cells={}\n\nvar piece_active=false\nvar piece_shape=0\nvar piece_pos=Vector2()\nvar piece_rot=0\n\n\nfunc piece_cell_xform(p,er=0):\n\tvar r = (4+er+piece_rot)%4\n\treturn piece_pos+block_rotations[r].xform(p)\n\nfunc _draw():\n\n\tvar sb = get_stylebox(\"bg\",\"Tree\") # use line edit bg\n\tdraw_style_box(sb,Rect2(Vector2(),get_size()).grow(3))\n\t\n\tvar bs = block.get_size()\n\tfor y in range(height):\n\t\tfor x in range(width):\n\t\t\tif (Vector2(x,y) in cells):\n\t\t\t\tdraw_texture_rect(block,Rect2(Vector2(x,y)*bs,bs),false,block_colors[cells[Vector2(x,y)]])\n\t\t\t\t\n\tif (piece_active):\n\t\t\n\t\tfor c in block_shapes[piece_shape]:\n\t\t\tdraw_texture_rect(block,Rect2(piece_cell_xform(c)*bs,bs),false,block_colors[piece_shape])\n\t\t\t\n\nfunc piece_check_fit(ofs,er=0):\n\n\tfor c in block_shapes[piece_shape]:\n\t\tvar pos = piece_cell_xform(c,er)+ofs\n\t\tif (pos.x < 0):\n\t\t\treturn false\n\t\tif (pos.y < 0):\n\t\t\treturn false\n\t\tif (pos.x >= width):\n\t\t\treturn false\n\t\tif (pos.y >= height):\n\t\t\treturn false\n\t\tif (pos in cells):\n\t\t\treturn false\n\t\n\treturn true\t\n\nfunc new_piece():\n\n\tpiece_shape = randi() % MAX_SHAPES\t\n\tpiece_pos = Vector2(width\/2,0)\n\tpiece_active=true\n\tpiece_rot=0\n\tif (piece_shape==0):\n\t\tpiece_pos.y+=1\n\t\t\n\tif (not piece_check_fit(Vector2())):\n\t\t#game over\n\t\t#print(\"GAME OVER!\")\n\t\tgame_over()\n\t\t\n\tupdate()\n\t\t\n\t\nfunc test_collapse_rows():\n\tvar accum_down=0\n\tfor i in range(height):\n\t\tvar y = height - i - 1\n\t\tvar collapse = true\n\t\tfor x in range(width):\n\t\t\tif (Vector2(x,y) in cells):\n\t\t\t\tif (accum_down):\n\t\t\t\t\tcells[ Vector2(x,y+accum_down) ] = cells[Vector2(x,y)]\n\t\t\telse:\n\t\t\t\tcollapse=false\n\t\t\t\tif (accum_down):\n\t\t\t\t\tcells.erase( Vector2(x,y+accum_down) )\n\t\t\t\t\t\t\n\t\tif (collapse):\n\t\t\taccum_down+=1\n\t\t\n\t\t\t\n\tscore+=accum_down*100\n\tscore_label.set_text(str(score))\n\t\t\t\n\t\t\nfunc game_over():\n\n\t\tpiece_active=false\n\t\tget_node(\"gameover\").set_text(\"Game Over\")\t\t\n\t\tupdate()\n\t\t\t\t\n\t\t\nfunc restart_pressed():\n\n\t\tscore=0\n\t\tscore_label.set_text(\"0\")\n\t\tcells.clear()\n\t\tget_node(\"gameover\").set_text(\"\")\t\t\n\t\tpiece_active=true\n\t\tget_node(\"..\/restart\").release_focus()\n\t\tupdate()\n\t\t\n\t\t\n\nfunc piece_move_down():\n\n\tif (!piece_active):\n\t\treturn\n\tif (piece_check_fit(Vector2(0,1))):\n\t\tpiece_pos.y+=1\n\t\tupdate()\t\t\n\telse:\n\n\t\tfor c in block_shapes[piece_shape]:\n\t\t\tvar pos = piece_cell_xform(c)\n\t\t\tcells[pos]=piece_shape\n\t\ttest_collapse_rows()\n\t\tnew_piece()\n\t\t\n\nfunc piece_rotate():\n\n\tvar adv = 1\n\tif (not piece_check_fit(Vector2(),1)):\n\t\treturn\n\tpiece_rot = (piece_rot + adv) % 4\n\tupdate()\n\t\n\t\n\nfunc _input(ie):\n\n\n\tif (not piece_active):\n\t\treturn\n\tif (!ie.is_pressed()):\n\t\treturn\n\n\tif (ie.is_action(\"move_left\")):\n\t\tif (piece_check_fit(Vector2(-1,0))):\n\t\t\tpiece_pos.x-=1\n\t\t\tupdate()\n\telif (ie.is_action(\"move_right\")):\n\t\tif (piece_check_fit(Vector2(1,0))):\n\t\t\tpiece_pos.x+=1\n\t\t\tupdate()\n\telif (ie.is_action(\"move_down\")):\n\t\tpiece_move_down()\n\telif (ie.is_action(\"rotate\")):\n\t\tpiece_rotate()\n\t\t\n\t\t\nfunc setup(w,h):\n\twidth=w\n\theight=h\n\tset_size( Vector2(w,h)*block.get_size() )\n\tnew_piece()\n\tget_node(\"timer\").start()\n\t\n\nfunc _ready():\n\t# Initalization here\n\n\tsetup(10,20)\n\tscore_label = get_node(\"..\/score\")\n\n\tset_process_input(true)\n\n\n\n\n","old_contents":"\n\nextends Control\n\n# Simple Tetris-like demo, (c) 2012 Juan Linietsky\n# Implemented by using a regular Control and drawing on it during the _draw() callback.\n# The drawing surface is updated only when changes happen (by calling update())\n\n\nvar score = 0\nvar score_label=null\n\nconst MAX_SHAPES = 7\n\nvar block = preload(\"block.png\")\n\nvar block_colors=[\n\tColor(1,0.5,0.5),\n\tColor(0.5,1,0.5),\n\tColor(0.5,0.5,1),\n\tColor(0.8,0.4,0.8),\n\tColor(0.8,0.8,0.4),\n\tColor(0.4,0.8,0.8),\n\tColor(0.7,0.7,0.7)]\n\nvar\tblock_shapes=[\n\t[ Vector2(0,-1),Vector2(0,0),Vector2(0,1),Vector2(0,2) ], # I\n\t[ Vector2(0,0),Vector2(1,0),Vector2(1,1),Vector2(0,1) ], # O\n\t[ Vector2(-1,1),Vector2(0,1),Vector2(0,0),Vector2(1,0) ], # S\n\t[ Vector2(1,1),Vector2(0,1),Vector2(0,0),Vector2(-1,0) ], # Z\n\t[ Vector2(-1,1),Vector2(-1,0),Vector2(0,0),Vector2(1,0) ], # L\n\t[ Vector2(1,1),Vector2(1,0),Vector2(0,0),Vector2(-1,0) ], # J\n\t[ Vector2(0,1),Vector2(1,0),Vector2(0,0),Vector2(-1,0) ]] # T\n\t\n\nvar block_rotations=[\n\tMatrix32( Vector2(1,0),Vector2(0,1), Vector2() ),\n\tMatrix32( Vector2(0,1),Vector2(-1,0), Vector2() ),\n\tMatrix32( Vector2(-1,0),Vector2(0,-1), Vector2() ),\n\tMatrix32( Vector2(0,-1),Vector2(1,0), Vector2() )\n]\n\t\n\nvar width=0\nvar height=0\n\nvar cells={}\n\nvar piece_active=false\nvar piece_shape=0\nvar piece_pos=Vector2()\nvar piece_rot=0\n\n\nfunc piece_cell_xform(p,er=0):\n\tvar r = (4+er+piece_rot)%4\n\treturn piece_pos+block_rotations[r].xform(p)\n\nfunc _draw():\n\n\tvar sb = get_stylebox(\"bg\",\"Tree\") # use line edit bg\n\tdraw_style_box(sb,Rect2(Vector2(),get_size()).grow(3))\n\t\n\tvar bs = block.get_size()\n\tfor y in range(height):\n\t\tfor x in range(width):\n\t\t\tif (Vector2(x,y) in cells):\n\t\t\t\tdraw_texture_rect(block,Rect2(Vector2(x,y)*bs,bs),false,block_colors[cells[Vector2(x,y)]])\n\t\t\t\t\n\tif (piece_active):\n\t\t\n\t\tfor c in block_shapes[piece_shape]:\n\t\t\tdraw_texture_rect(block,Rect2(piece_cell_xform(c)*bs,bs),false,block_colors[piece_shape])\n\t\t\t\n\nfunc piece_check_fit(ofs,er=0):\n\n\tfor c in block_shapes[piece_shape]:\n\t\tvar pos = piece_cell_xform(c,er)+ofs\n\t\tif (pos.x < 0):\n\t\t\treturn false\n\t\tif (pos.y < 0):\n\t\t\treturn false\n\t\tif (pos.x >= width):\n\t\t\treturn false\n\t\tif (pos.y >= height):\n\t\t\treturn false\n\t\tif (pos in cells):\n\t\t\treturn false\n\t\n\treturn true\t\n\nfunc new_piece():\n\n\tpiece_shape = randi() % MAX_SHAPES\t\n\tpiece_pos = Vector2(width\/2,0)\n\tpiece_active=true\n\tpiece_rot=0\n\tif (piece_shape==0):\n\t\tpiece_pos.y+=1\n\t\t\n\tif (not piece_check_fit(Vector2())):\n\t\t#game over\n\t\t#print(\"GAME OVER!\")\n\t\tgame_over()\n\t\t\n\tupdate()\n\t\t\n\t\nfunc test_collapse_rows():\n\tvar accum_down=0\n\tfor i in range(height):\n\t\tvar y = height - i - 1\n\t\tvar collapse = true\n\t\tfor x in range(width):\n\t\t\tif (Vector2(x,y) in cells):\n\t\t\t\tif (accum_down):\n\t\t\t\t\tcells[ Vector2(x,y+accum_down) ] = cells[Vector2(x,y)]\n\t\t\telse:\n\t\t\t\tcollapse=false\n\t\t\t\tif (accum_down):\n\t\t\t\t\tcells.erase( Vector2(x,y+accum_down) )\n\t\t\t\t\t\t\n\t\tif (collapse):\n\t\t\taccum_down+=1\n\t\t\n\t\t\t\n\tscore+=accum_down*100\n\tscore_label.set_text(str(score))\n\t\t\t\n\t\t\nfunc game_over():\n\n\t\tpiece_active=false\n\t\tget_node(\"gameover\").set_text(\"Game Over\")\t\t\n\t\tupdate()\n\t\t\t\t\n\t\t\nfunc restart_pressed():\n\n\t\tscore=0\n\t\tscore_label.set_text(\"0\")\n\t\tcells.clear()\n\t\tget_node(\"gameover\").set_text(\"\")\t\t\n\t\tpiece_active=true\n\t\tupdate()\n\t\t\n\t\t\n\nfunc piece_move_down():\n\n\tif (!piece_active):\n\t\treturn\n\tif (piece_check_fit(Vector2(0,1))):\n\t\tpiece_pos.y+=1\n\t\tupdate()\t\t\n\telse:\n\n\t\tfor c in block_shapes[piece_shape]:\n\t\t\tvar pos = piece_cell_xform(c)\n\t\t\tcells[pos]=piece_shape\n\t\ttest_collapse_rows()\n\t\tnew_piece()\n\t\t\n\nfunc piece_rotate():\n\n\tvar adv = 1\n\tif (not piece_check_fit(Vector2(),1)):\n\t\treturn\n\tpiece_rot = (piece_rot + adv) % 4\n\tupdate()\n\t\n\t\n\nfunc _input(ie):\n\n\n\tif (not piece_active):\n\t\treturn\n\tif (!ie.is_pressed()):\n\t\treturn\n\n\tif (ie.is_action(\"move_left\")):\n\t\tif (piece_check_fit(Vector2(-1,0))):\n\t\t\tpiece_pos.x-=1\n\t\t\tupdate()\n\telif (ie.is_action(\"move_right\")):\n\t\tif (piece_check_fit(Vector2(1,0))):\n\t\t\tpiece_pos.x+=1\n\t\t\tupdate()\n\telif (ie.is_action(\"move_down\")):\n\t\tpiece_move_down()\n\telif (ie.is_action(\"rotate\")):\n\t\tpiece_rotate()\n\t\t\n\t\t\nfunc setup(w,h):\n\twidth=w\n\theight=h\n\tset_size( Vector2(w,h)*block.get_size() )\n\tnew_piece()\n\tget_node(\"timer\").start()\n\t\n\nfunc _ready():\n\t# Initalization here\n\n\tsetup(10,20)\n\tscore_label = get_node(\"..\/score\")\n\n\tset_process_input(true)\n\n\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"13ea3a954614c334a707ecf5474d07cf08a6b8c9","subject":"fixed block removal","message":"fixed block removal\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Blocks\/AbstractBlock.gd","new_file":"src\/scripts\/Blocks\/AbstractBlock.gd","new_contents":"\nextends RigidBody\n\nvar name_int\nvar name\nvar pairName\nvar selected = false\nvar blockPos\nvar blockLayer\nvar blockType\nconst far_away_corner = Vector3(110, 110, 110)\n\nvar editor\n\nstatic func nameToNodeName(n):\n\treturn \"block\" + str(n)\n\nfunc setName(n):\n\tname_int = n\n\tname = nameToNodeName(n)\n\tset_name(nameToNodeName(n))\n\treturn self\n\nfunc setPairName(n):\n\tpairName = nameToNodeName(n)\n\treturn self\n\nfunc setBlockLayer(n):\n\tblockLayer = n\n\treturn self\n\nfunc getBlockLayer():\n\treturn blockLayer\n\nfunc setBlockType( blockT ):\n\tblockType = blockT\n\treturn self\n\nfunc getBlockType():\n\treturn blockType\n\nfunc setSelected(sel):\n\tselected = sel\n\treturn self\n\nfunc forceClick(click_normal=null):\n\tvar network = Globals.get(\"Network\")\n\tif (not network == null and get_node(\"..\/..\/..\/..\/Puzzle\").mainPuzzle and network.isNetwork):\n\t\t\tnetwork.sendBlockUpdate(blockPos)\n\n\tif click_normal != null and editor != null:\n\t\tif editor.shouldAddNeighbor():\n\t\t\taddNeighbor(editor, click_normal)\n\t\t\treturn\n\t\tif editor.shouldReplaceSelf() or editor.shouldRemoveSelf():\n\t\t\t# lasers cannot be removed by the editor\n\t\t\tif blockType == get_parent().get_parent().get_parent().puzzleMan.BLOCK_LASER:\n\t\t\t\treturn\n\n\t\t\t# maybe replace self\n\t\t\tif editor.shouldReplaceSelf():\n\t\t\t\taddNeighbor(editor, 0 * click_normal)\n\t\t\tif pairName != null:\n\t\t\t\tvar pair = get_parent().get_node(pairName)\n\t\t\t\tif pair != null:\n\t\t\t\t\tpair.request_remove()\n\t\t\trequest_remove()\n\t\t\treturn\n\telse:\n\t\tactivate()\n\t\tget_parent().clickBlock( name )\n\nfunc addNeighbor(editor, click_normal):\n\tvar t = get_parent().get_parent().get_transform().inverse()\n\teditor.addBlock(blockPos + t * click_normal)\n\n\n# catch clicks\/taps\nfunc _input_event( camera, ev, click_pos, click_normal, shape_idx ):\n\tif ((ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT)\n\tor (ev.type==InputEvent.SCREEN_TOUCH)):\n\t\tif (get_parent().get_parent().active and ev.is_pressed()):\n\t\t\tGlobals.get(\"Network\").sendBlockUpdate(blockPos)\n\t\t\tforceClick(click_normal)\n\n# returns this block's pairNode or null\nfunc pairActivate():\n\tselected = true\n\n\t# is my pair Nil?\n\tif not get_parent().has_node(str(pairName)):\n\t\tscaleTweenNode(0.9, 0.2, Tween.TRANS_EXPO).start()\n\t\treturn null\n\n\t# get my pair node\n\tvar pairNode = get_parent().get_node(pairName)\n\n\t# enlarge if the other guy's unselected\n\tif not pairNode.selected:\n\t\tscaleTweenNode(1.1, 0.2, Tween.TRANS_EXPO).start()\n\treturn pairNode\n\n\n# returns a tween node that uniformly changes the object's scale\n# call start() on the returned object\nfunc scaleTweenNode(scale, time=1, transType=Tween.TRANS_BOUNCE):\n\tvar tweenNode = newTweenNode()\n\ttweenNode.interpolate_method( self, \"set_scale\", \\\n\t\tself.get_scale(), Vector3(scale, scale, scale), \\\n\t\ttime, transType, Tween.EASE_OUT )\n\n\treturn tweenNode\n\n# adds a tween transition node to the tree\nfunc newTweenNode():\n\tvar tween = Tween.new()\n\tadd_child(tween)\n\treturn tween\n\nfunc request_remove(node=null, key=null):\n\tif node == null:\n\t\tnode = self\n\tvar n = scaleTweenNode(0.001, 0.25, Tween.TRANS_QUART)\n\tn.start()\n\tn.connect(\"tween_complete\", get_parent(), \"remove_block\")\n\nfunc _ready():\n\tif get_tree().get_root().has_node(\"EditorSpatial\"):\n\t\teditor = get_tree().get_root().get_node(\"EditorSpatial\")\n\tset_ray_pickable(true)\n","old_contents":"\nextends RigidBody\n\nvar name_int\nvar name\nvar pairName\nvar selected = false\nvar blockPos\nvar blockLayer\nvar blockType\nconst far_away_corner = Vector3(110, 110, 110)\n\nvar editor\n\nstatic func nameToNodeName(n):\n\treturn \"block\" + str(n)\n\nfunc setName(n):\n\tname_int = n\n\tname = nameToNodeName(n)\n\tset_name(nameToNodeName(n))\n\treturn self\n\nfunc setPairName(n):\n\tpairName = nameToNodeName(n)\n\treturn self\n\nfunc setBlockLayer(n):\n\tblockLayer = n\n\treturn self\n\nfunc getBlockLayer():\n\treturn blockLayer\n\nfunc setBlockType( blockT ):\n\tblockType = blockT\n\treturn self\n\nfunc getBlockType():\n\treturn blockType\n\nfunc setSelected(sel):\n\tselected = sel\n\treturn self\n\nfunc forceClick(click_normal=null):\n\tvar network = Globals.get(\"Network\")\n\tif (not network == null and get_node(\"..\/..\/..\/..\/Puzzle\").mainPuzzle and network.isNetwork):\n\t\t\tnetwork.sendBlockUpdate(blockPos)\n\n\tif click_normal != null and editor != null:\n\t\tif editor.shouldAddNeighbor():\n\t\t\taddNeighbor(editor, click_normal)\n\t\t\treturn\n\t\tif editor.shouldReplaceSelf() or editor.shouldRemoveSelf():\n\t\t\t# lasers cannot be removed by the editor\n\t\t\tif blockType == get_parent().get_parent().get_parent().puzzleMan.BLOCK_LASER:\n\t\t\t\treturn\n\n\t\t\t# maybe replace self\n\t\t\tif editor.shouldReplaceSelf():\n\t\t\t\taddNeighbor(editor, 0 * click_normal)\n\t\t\tif pairName != null:\n\t\t\t\tvar pair = get_parent().get_node(pairName)\n\t\t\t\tif pair != null:\n\t\t\t\t\tpair.request_remove()\n\t\t\trequest_remove()\n\t\t\treturn\n\telse:\n\t\tactivate()\n\t\tget_parent().clickBlock( name )\n\nfunc addNeighbor(editor, click_normal):\n\tvar t = get_parent().get_parent().get_transform().inverse()\n\teditor.addBlock(blockPos + t * click_normal)\n\n\n# catch clicks\/taps\nfunc _input_event( camera, ev, click_pos, click_normal, shape_idx ):\n\tif ((ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT)\n\tor (ev.type==InputEvent.SCREEN_TOUCH)):\n\t\tif (get_parent().get_parent().active and ev.is_pressed()):\n\t\t\tGlobals.get(\"Network\").sendBlockUpdate(blockPos)\n\t\t\tforceClick(click_normal)\n\n# returns this block's pairNode or null\nfunc pairActivate():\n\tselected = true\n\n\t# is my pair Nil?\n\tif not get_parent().has_node(str(pairName)):\n\t\tscaleTweenNode(0.9, 0.2, Tween.TRANS_EXPO).start()\n\t\treturn null\n\n\t# get my pair node\n\tvar pairNode = get_parent().get_node(pairName)\n\n\t# enlarge if the other guy's unselected\n\tif not pairNode.selected:\n\t\tscaleTweenNode(1.1, 0.2, Tween.TRANS_EXPO).start()\n\treturn pairNode\n\n\n# returns a tween node that uniformly changes the object's scale\n# call start() on the returned object\nfunc scaleTweenNode(scale, time=1, transType=Tween.TRANS_BOUNCE):\n\tvar tweenNode = newTweenNode()\n\ttweenNode.interpolate_method( self, \"set_scale\", \\\n\t\tself.get_scale(), Vector3(scale, scale, scale), \\\n\t\ttime, transType, Tween.EASE_OUT )\n\n\treturn tweenNode\n\n# adds a tween transition node to the tree\nfunc newTweenNode():\n\tvar tween = Tween.new()\n\tadd_child(tween)\n\treturn tween\n\nfunc request_remove(node=null, key=null):\n\tvar n = scaleTweenNode(0.001, 0.25, Tween.TRANS_QUART)\n\tn.start()\n\tn.connect(\"tween_complete\", get_parent(), \"remove_block\", [self])\n\nfunc _ready():\n\tif get_tree().get_root().has_node(\"EditorSpatial\"):\n\t\teditor = get_tree().get_root().get_node(\"EditorSpatial\")\n\tset_ray_pickable(true)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"8803521f274dcde8f69aa463159cd8811b444dd3","subject":"Fix size issues with left-right container","message":"Fix size issues with left-right container\n","repos":"groboclown\/godot-bootstrap","old_file":"components\/ext_controllers\/containers\/left_right_container.gd","new_file":"components\/ext_controllers\/containers\/left_right_container.gd","new_contents":"\nextends Container\n\n# A very specific kind of container that holds exactly 2 child nodes.\n# The left child is aligned on the left margin, and the right child on the\n# right margin.\n\nexport var right_fixed_width = true\n\n\nfunc _ready():\n\tvar n\n\tfor n in [ self, get_child(0), get_child(1) ]:\n\t\tn.connect(\"minimum_size_changed\", self, \"_on_resized\")\n\t\tn.connect(\"item_rect_changed\", self, \"_on_resized\")\n\t\tn.connect(\"resized\", self, \"_on_resized\")\n\t\tn.connect(\"size_flags_changed\", self, \"_on_resized\")\n\n\t_on_resized()\n\n\nfunc _on_resized():\n\tvar size = get_size()\n\tvar pos = get_pos()\n\tvar mid_x = pos.x + (size.x \/ 2)\n\tvar c0 = get_child(0)\n\tvar c0s = c0.get_size()\n\tvar c1 = get_child(1)\n\tvar c1s = c1.get_size()\n\tvar min_size = get_minimum_size()\n\t\n\tif right_fixed_width:\n\t\tc0s = _get_opposite_size(size.x, c1, c0)\n\telse:\n\t\tc1s = _get_opposite_size(size.x, c0, c1)\n\t\n\t_set_kid_size(c0, c0s, size, pos.x)\n\t_set_kid_size(c1, c1s, size, pos.x + size.x - c1s.x)\n\t\n\tc0s = c0.get_size()\n\tc1s = c1.get_size()\n\tif size.y != max(c0s.y, c1s.y):\n\t\tset_size(Vector2(size.x, max(c0s.y, c1s.y)))\n\n\nfunc _set_kid_size(child, child_size, size, width):\n\tvar min_size = child.get_minimum_size()\n\t#if min_size.x > 0:\n\t#\tchild.set_size(Vector2(min_size.x, size.y))\n\t#else:\n\t#\tchild.set_size(Vector2(child_size.x, size.y))\n\tchild.set_size(Vector2(max(min_size.x, child_size.x), size.y))\n\tchild.set_pos(Vector2(width, 0))\n\nfunc _get_opposite_size(parent_width, priority_child, other_child):\n\tvar pwidth = max(priority_child.get_minimum_size().x, priority_child.get_size().x)\n\tvar owidth = parent_width - pwidth\n\tvar osize = other_child.get_size()\n\tvar oxwidth = max(other_child.get_minimum_size().x, owidth)\n\treturn Vector2(oxwidth, osize.y)\n\n","old_contents":"\nextends Container\n\n# A very specific kind of container that holds exactly 2 child nodes.\n# The left child is aligned on the left margin, and the right child on the\n# right margin.\n\nexport var right_fixed_width = true\n\n\nfunc _ready():\n\tconnect(\"minimum_size_changed\", self, \"_on_resized\")\n\tconnect(\"item_rect_changed\", self, \"_on_resized\")\n\tconnect(\"resized\", self, \"_on_resized\")\n\tconnect(\"size_flags_changed\", self, \"_on_resized\")\n\t\n\t_on_resized()\n\n\nfunc _on_resized():\n\tvar size = get_size()\n\tvar pos = get_pos()\n\tvar mid_x = pos.x + (size.x \/ 2)\n\tvar c0 = get_child(0)\n\tvar c0s = c0.get_size()\n\tvar c1 = get_child(1)\n\tvar c1s = c1.get_size()\n\tvar min_size = get_minimum_size()\n\t\n\tif right_fixed_width:\n\t\tc0s = _get_opposite_size(size.x, c1, c0)\n\telse:\n\t\tc1s = _get_opposite_size(size.x, c0, c1)\n\t\n\t_set_kid_size(c0, c0s, size, pos.x)\n\t_set_kid_size(c1, c1s, size, pos.x + size.x - c1s.x)\n\n\nfunc _set_kid_size(child, child_size, size, width):\n\tvar min_size = child.get_minimum_size()\n\t#if min_size.x > 0:\n\t#\tchild.set_size(Vector2(min_size.x, size.y))\n\t#else:\n\t#\tchild.set_size(Vector2(child_size.x, size.y))\n\tchild.set_size(Vector2(max(min_size.x, child_size.x), size.y))\n\tchild.set_pos(Vector2(width, 0))\n\nfunc _get_opposite_size(parent_width, priority_child, other_child):\n\tvar pwidth = max(priority_child.get_minimum_size().x, priority_child.get_size().x)\n\tvar owidth = parent_width - pwidth\n\tvar osize = other_child.get_size()\n\tvar oxwidth = max(other_child.get_minimum_size().x, owidth)\n\treturn Vector2(oxwidth, osize.y)\n\n","returncode":0,"stderr":"","license":"cc0-1.0","lang":"GDScript"} {"commit":"672381760465b9e4e16b1775c191cf9a441def95","subject":"Add visibility application","message":"Add visibility application\n","repos":"ruipsrosario\/godot-responsive-control","old_file":"source\/addons\/responsive_controls\/ResponsiveSizing.gd","new_file":"source\/addons\/responsive_controls\/ResponsiveSizing.gd","new_contents":"tool\nextends Control\n\n# Minimum size the parent Control must have in order to trigger this Responsive Sizing\nexport(Vector2) var minimumParentSize\n\n# Whether or not this Responsive Sizing is visible in the set size\nexport(bool) var isVisible\n\n# Checks if this Responsive Sizing is eligible under the specified size\nfunc isEligible(size):\n\treturn size.width >= minimumParentSize.width && size.height >= minimumParentSize.height\n\n# Applies this Responsive Sizing to the specified Control\nfunc applyTo(control):\n\tif isVisible != control.is_visible():\n\t\tif isVisible:\n\t\t\tcontrol.show()\n\t\telse:\n\t\t\tcontrol.hide()\n\t\n\tcontrol.set_h_size_flags(get_h_size_flags())\n\tcontrol.set_v_size_flags(get_v_size_flags())\n\tcontrol.set_scale(get_scale())\n\tfor margin in [ MARGIN_BOTTOM, MARGIN_TOP, MARGIN_RIGHT, MARGIN_LEFT ]:\n\t\tcontrol.set_anchor(margin, get_anchor(margin))\n\t\tcontrol.set_margin(margin, get_marginr(margin))\n","old_contents":"tool\nextends Control\n\n# Minimum size the parent Control must have in order to trigger this Responsive Sizing\nexport(Vector2) var minimumParentSize\n\n# Whether or not this Responsive Sizing is visible in the set size\nexport(bool) var isVisible\n\n# Checks if this Responsive Sizing is eligible under the specified size\nfunc isEligible(size):\n\treturn size.width >= minimumParentSize.width && size.height >= minimumParentSize.height\n\n# Applies this Responsive Sizing to the specified Control\nfunc applyTo(control):\n\tcontrol.set_h_size_flags(get_h_size_flags())\n\tcontrol.set_v_size_flags(get_v_size_flags())\n\tcontrol.set_scale(get_scale())\n\tfor margin in [ MARGIN_BOTTOM, MARGIN_TOP, MARGIN_RIGHT, MARGIN_LEFT ]:\n\t\tcontrol.set_anchor(margin, get_anchor(margin))\n\t\tcontrol.set_margin(margin, get_marginr(margin))\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"41823864949240c8fd43956b4131ccb3aed8da3d","subject":"Updated the documentation to indicate that GurobiFindAllSolutions with the option representatives will give unique solutions up to equivalence under the group.","message":"Updated the documentation to indicate that GurobiFindAllSolutions with the option representatives will give unique solutions up to equivalence under the group.\n","repos":"jesselansdown\/Gurobify,jesselansdown\/Gurobify","old_file":"gap\/Gurobify.gd","new_file":"gap\/Gurobify.gd","new_contents":"# Gurobify: Gurobify provides an interface to Gurobi from GAP.\n#\n# Copyright (c) 2017 Jesse Lansdown\n#\n# This Source Code Form is subject to the terms of the Mozilla\n# Public License, v. 2.0. If a copy of the MPL was not distributed\n# with this file, You can obtain one at https:\/\/mozilla.org\/MPL\/2.0\/.\n\n\n\n# Declarations\n#\n\n\nDeclareCategory( \"IsGurobiModel\", IsObject );\n\n\nGurobiObjectFamily := NewFamily( \"GurobiObjectFamily\" );\n\nBindGlobal(\"TheTypeGurobiModel\", NewType( GurobiObjectFamily, IsGurobiModel ));\n\n\nDeclareOperation( \"GurobiNewModel\",\n\t[IsList]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Deleting Constraints\n#! @Arguments Model, ConstraintName\n#! @Returns true\/false\n#! @Description\n#!\tDeletes all constraints with the name ConstraintName\nDeclareOperation(\"GurobiDeleteConstraintsWithName\",\n\t[IsGurobiModel, IsString]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Deleting Constraints\n#! @Arguments Model, ConstraintEquation, ConstraintSense, ConstraintRHSValue[, ConstraintName]\n#! @Returns true\n#! @Description\n#!\tSame as below, except that ConstraintRHS value takes an integer value.\nDeclareOperation( \"GurobiAddConstraint\",\n\t[ IsGurobiModel, IsList, IsString, IsInt, IsString]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Deleting Constraints\n#! @Arguments Model, ConstraintEquation, ConstraintSense, ConstraintRHSValue[, ConstraintName]\n#! @Returns true\n#! @Description\n#!\tAdds a constraint to a gurobi model. ConstraintEquation must be a list, \n#!\tsuch that each entry is the coefficient (including $0$ coefficents) of the corresponding variable\n#! \tin the constraint equation. The ConstraintSense must be one of \"<\", \">\" or \"=\",\n#!\twhere Gurobi interprets < as <= and > as >=. The ConstraintRHSValue is the value on the\n#!\tright hand side of the constraint. A constraint may optionally be given a name, which helps to identify\n#!\tthe constraint if it is to be deleted at some point. If no constraint name is given, then a constraint is\n#!\tsimply assigned the name \"UnNamedConstraint\".\n#!\tNote that a model must be updated or optimised before any additional constraints become effective.\nDeclareOperation( \"GurobiAddConstraint\",\n\t[ IsGurobiModel, IsList, IsString, IsFloat, IsString] );\n\nDeclareOperation( \"GurobiAddConstraint\",\n\t[ IsGurobiModel, IsList, IsString, IsFloat]);\n\nDeclareOperation( \"GurobiAddConstraint\",\n\t[ IsGurobiModel, IsList, IsString, IsInt]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Deleting Constraints\n#! @Arguments Model, ConstraintEquations, ConstraintSenses, ConstraintRHSValues[, ConstraintNames]\n#! @Returns true\n#! @Description\n#!\tAdd multiple constraints to a model at one time. The arguments (except Model)\n#!\tare lists, such that the i-th entries of each list determine a single constraint in\n#!\tthe same manner as for the operation GurobiAddConstraint. ConstraintNames is an optional argument,\n#!\tand must be given for all constraints, or not at all.\nDeclareOperation( \"GurobiAddMultipleConstraints\",\n\t[ IsGurobiModel, IsList, IsList, IsList, IsList] );\n\n#! @Chapter Using Gurobify\n#! @Section Optimising A Model\n#! @Arguments Model\n#! @Returns Solution\n#! @Description\n#!\tDisplay the solution found for a successfuly optimised model. Note that if a solution has not been optimised, is infeasible, or\n#!\tthe optimisation was not completed, then this will return an error. Thus it is advisable to first check the optimisation status.\nDeclareOperation( \"GurobiSolution\",\n\t[ IsGurobiModel] );\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, TimeLimit\n#! @Returns true\n#! @Description\n#!\tSet a time limit for a Gurobi model. Note that TimeLimit should be a float, however an integer value can be given\n#!\twhich will be automatically converted to a float.\nDeclareOperation( \"GurobiSetTimeLimit\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, BestObjectiveBoundStop\n#! @Returns true\n#! @Description\n#!\tOptimisation will terminate if a feasible solution is found with objective value at least as good as BestObjectiveBoundStop.\n#!\tNote that BestObjectiveBoundStop should be a float, however an integer value can be given\n#!\twhich will be automatically converted to a float.\nDeclareOperation( \"GurobiSetBestObjectiveBoundStop\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, CutOff\n#! @Returns true\n#! @Description\n#!\tOptimisation will terminate if the objective value is worse than CutOff.\n#!\tNote that CutOff should be a float, an integer value can be given\n#!\twhich will be automatically converted to a float.\nDeclareOperation( \"GurobiSetCutOff\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Modifying Objective Functions\n#! @Arguments Model\n#! @Returns true\n#! @Description\n#!\tSets the model sense to maximise. When the model is optimised, it will try to maximise the objective function.\nDeclareOperation(\"GurobiMaximiseModel\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Modifying Objective Functions\n#! @Arguments Model\n#! @Returns true\n#! @Description\n#!\tSets the model sense to minimise. When the model is optimised, it will try to minimise the objective function.\nDeclareOperation(\"GurobiMinimiseModel\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Modifying Objective Functions\n#! @Arguments Model, ObjectiveValues\n#! @Returns true\n#! @Description\n#!\tSet the objective function for a model. ObjectiveValues is a list of coefficients (including $0$ coefficeints)\n#!\tcorresponding to each of the variables\nDeclareOperation( \"GurobiSetObjectiveFunction\",\n\t[ IsGurobiModel, IsList] );\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Modifying Objective Functions\n#! @Arguments Model\n#! @Returns List of coefficients of the objective function\n#! @Description\n#!\tView the objective function for a model.\nDeclareOperation( \"GurobiObjectiveFunction\",\n\t[ IsGurobiModel] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns Number of variables\n#! @Description\n#!\tReturns the number of variables in the model.\nDeclareOperation(\"GurobiNumberOfVariables\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns Number of linear constraints\n#! @Description\n#!\tReturns the number of linear constraints in the model.\nDeclareOperation(\"GurobiNumberOfConstraints\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Optimising A Model\n#! @Arguments Model\n#! @Returns objective value\n#! @Description\n#!\tReturns the objective value of the current solution.\nDeclareOperation(\"GurobiObjectiveValue\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns objective bound\n#! @Description\n#!\tReturns the best known bound on the objective value of the model.\nDeclareOperation(\"GurobiObjectiveBound\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns run time of optimisation\n#! @Description\n#!\tReturns the wall clock runtime in seconds for the most recent optimisation.\nDeclareOperation(\"GurobiRunTime\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Optimising A Model\n#! @Arguments Model\n#! @Returns optimisation status code\n#! @Description\n#!\tReturns the optimisation status code of the most recent optimisation. Refer to the Gurobi documentation for more\n#!\ton the optimisation statuses, or alternatively refer to the Appendix of this manual.\nDeclareOperation(\"GurobiOptimisationStatus\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns numeric focus\n#! @Description\n#!\tReturns the numeric focus value of the model. The numeric focus is a value in the set [0,1,2,3]. A numeric focus of $0$ sets the\n#!\tnumeric focus automatically, preferancing speed. Values between 1 and 3 increase the care taken in computations \n#!\tas the value increases, but also take longer. The default value is 0.\nDeclareOperation(\"GurobiNumericFocus\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, NumericFocus\n#! @Returns true\n#! @Description\n#!\tSet the numeric focus for a model. Numeric focus must be in the set [0,1,2,3]. A numeric focus of $0$ sets the\n#!\tnumeric focus automatically, preferancing speed. Values between 1 and 3 increase the care taken in computations \n#!\tas the value increases, but also take longer. The default value is 0.\nDeclareOperation( \"GurobiSetNumericFocus\",\n\t[ IsGurobiModel, IsInt] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns time limit\n#! @Description\n#!\tReturns the time limit for the model. The default value is infinity.\nDeclareOperation(\"GurobiTimeLimit\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns cutoff value\n#! @Description\n#!\tReturns the cutoff value for the model. Optimisation will terminate if the objective value is worse than CutOff.\n#!\tThe default value is infinity for minimisation, and negative infinity for maximisation.\nDeclareOperation(\"GurobiCutOff\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns best objective bound limit value\n#! @Description\n#!\tReturns the best objective bound limit value for the model.\n#!\tOptimisation will terminate if a feasible solution is found with objective value at least as good as the best objective bound.\n#!\tThe default value is negative infinity.\nDeclareOperation(\"GurobiBestObjectiveBoundStop\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, MIPFocus\n#! @Returns true\n#! @Description\n#!\tSet the MIP focus for a model. The mip focus must be in the set [0,1,2,3], and the default value is 0.\n#!\tThe MIP focus alows you to prioritise finding solutions or proving their optimality. See the Gurobi \n#!\tdocumentation for more information.\nDeclareOperation( \"GurobiSetMIPFocus\",\n\t[ IsGurobiModel, IsInt] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns MIP focus\n#! @Description\n#!\tReturns the MIP focus value for the model. The mip focus must be in the set [0,1,2,3], and the default value is 0.\n#!\tThe MIP focus alows you to prioritise finding solutions or proving their optimality. See the Gurobi \n#!\tdocumentation for more information.\nDeclareOperation(\"GurobiMIPFocus\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, BestBdStop\n#! @Returns true\n#! @Description\n#!\tSet the best bound stopping value for a model. Terminates optimisation as soon as the value\n#!\tof the best bound is determined to be at least as good as the best bound stopping value. Default value is infinity.\nDeclareOperation( \"GurobiSetBestBoundStop\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns Best bound stopping value\n#! @Description\n#!\tReturns the best bound stopping value for the model. Optimisation terminates as soon as the value\n#!\tof the best bound is determined to be at least as good as the best bound stopping value. Default value is infinity.\nDeclareOperation(\"GurobiBestBoundStop\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, BestBdStop\n#! @Returns true\n#! @Description\n#!\tSet the limit for the maximum number of MIP solutions to find.\n#!\tDefault value is $2,000,000,000$.\nDeclareOperation( \"GurobiSetSolutionLimit\",\n\t[ IsGurobiModel, IsInt] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns solution limit value\n#! @Description\n#!\tReturns the solution limit value for the model. This value limits the maximum number of MIP solutions that will be found.\n#!\tDefault value is $2,000,000,000$.\nDeclareOperation(\"GurobiSolutionLimit\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, IterationLimit\n#! @Returns true\n#! @Description\n#!\tSet the limit for the maximum number of simplex iterations performed. Default value is infinity.\nDeclareOperation( \"GurobiSetIterationLimit\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns Iteration limit\n#! @Description\n#!\tReturns the iteration limit value for the model, which limits the number of simplex iterations performed during optimisation.\n#!\tDefault value is infinity.\nDeclareOperation(\"GurobiIterationLimit\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, NodeLimit\n#! @Returns true\n#! @Description\n#!\tSet the limit for the maximum number of MIP nodes explored.\n#!\tThe default value is infinity.\nDeclareOperation( \"GurobiSetNodeLimit\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns Node limit\n#! @Description\n#!\tReturns the node limit value for the model, which limits the number of MIP nodes explored during optimisation.\n#!\tThe default value is infinity.\nDeclareOperation(\"GurobiNodeLimit\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns \n#! @Description\n#!\tReturns the names of the variables in the model. This list acts as the index set for\n#!\tany lists of variable coefficients, such as in GurobiAddConstraint or GurobiSetObjectiveFunction.\nDeclareOperation(\"GurobiVariableNames\",\n\t[IsGurobiModel]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Creating Or Reading A Model\n#! @Arguments VariableTypes[, VariableNames]\n#! @Returns A Gurobi model\n#! @Description\n#! Creates a gurobi model with variables defined by VariableTypes. VariableTypes must be a list of strings, \n#!\twhere each entry is the type of the corresponding variable.\n#! Accepted variable types are \"CONTINUOUS\", \"BINARY\", \"INTEGER\", \"SEMICONT\", or \"SEMIINT\". The variable types are not case sensitive.\n#! Refer to the Gurobi documentation for more information on the variable types.\n#! Optionally takes the names of the variables as a list of strings.\nDeclareOperation( \"GurobiNewModel\",\n\t[IsList, IsList]);\n\n\n\n#! @Chapter Using Gurobify\n#! @Section Creating Or Reading A Model\n#! @Arguments Model, VariableNames\n#! @Returns true\n#! @Description\n#! Assigns each variable a new name from a list of names. The names must be strings. \nDeclareOperation(\"GurobiSetVariableNames\",\n\t\t[IsGurobiModel, IsList]);\n\n\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, Switch\n#! @Returns true\n#! @Description\n#! Turns console logging on or off. If Switch is true the output of Gurobi will be printed to the screen,\n#!\tand if it is false the output will be supressed. The default for Gurobify is to supress the output.\nDeclareOperation(\"GurobiSetLogToConsole\",\n\t\t[IsGurobiModel, IsBool]);\n\n\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns true\/false\n#! @Description\n#!\tReturns true if the Gurobi output is set to display to the screen, and false if the output is supressed.\n#!\tGurobify suppresses the output by default.\nDeclareOperation(\"GurobiLogToConsole\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Optimising A Model\n#! @Arguments Model\n#! @Returns Set of all solutions.\n#! @Description\n#!\tTakes a Gurobi model and repeatedly optimises it, each time adding the previous solution as a\n#!\tconstraint so that it isn't found again. This continues until all solutions are found, and\n#!\tthen they are returned as a set. During the process the number of found solutions is displayed.\nDeclareOperation(\"GurobiFindAllSolutions\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Optimising A Model\n#! @Arguments Model, Group\n#! @Returns Set of all solutions.\n#! @Description\n#!\tSame as above, except that it also takes a permutation group acting on the index set of variables.\n#!\tInstead of finding all solutions directly, the group is used to find the orbit of each new\n#!\tsolution, and these are then all returned at the end, and used as constraints until then.\n#!\tAn option value may also be given which will only return the representatives of each orbit of the\n#!\tsolutions. Hence it returns all the unique solutions up to equivalence under the group.\n#!\tThis saves on memory, and the remaing solutions may be refound by generating the\n#!\torbit under the group. To invoke this option place a colon after the group argument and then put\n#!\trepresentatives:=true so for example GurobiFindAllSolutions(model, gp : representatives:=true);\nDeclareOperation(\"GurobiFindAllSolutions\",\n\t[IsGurobiModel, IsGroup]);\n\n\n","old_contents":"# Gurobify: Gurobify provides an interface to Gurobi from GAP.\n#\n# Copyright (c) 2017 Jesse Lansdown\n#\n# This Source Code Form is subject to the terms of the Mozilla\n# Public License, v. 2.0. If a copy of the MPL was not distributed\n# with this file, You can obtain one at https:\/\/mozilla.org\/MPL\/2.0\/.\n\n\n\n# Declarations\n#\n\n\nDeclareCategory( \"IsGurobiModel\", IsObject );\n\n\nGurobiObjectFamily := NewFamily( \"GurobiObjectFamily\" );\n\nBindGlobal(\"TheTypeGurobiModel\", NewType( GurobiObjectFamily, IsGurobiModel ));\n\n\nDeclareOperation( \"GurobiNewModel\",\n\t[IsList]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Deleting Constraints\n#! @Arguments Model, ConstraintName\n#! @Returns true\/false\n#! @Description\n#!\tDeletes all constraints with the name ConstraintName\nDeclareOperation(\"GurobiDeleteConstraintsWithName\",\n\t[IsGurobiModel, IsString]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Deleting Constraints\n#! @Arguments Model, ConstraintEquation, ConstraintSense, ConstraintRHSValue[, ConstraintName]\n#! @Returns true\n#! @Description\n#!\tSame as below, except that ConstraintRHS value takes an integer value.\nDeclareOperation( \"GurobiAddConstraint\",\n\t[ IsGurobiModel, IsList, IsString, IsInt, IsString]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Deleting Constraints\n#! @Arguments Model, ConstraintEquation, ConstraintSense, ConstraintRHSValue[, ConstraintName]\n#! @Returns true\n#! @Description\n#!\tAdds a constraint to a gurobi model. ConstraintEquation must be a list, \n#!\tsuch that each entry is the coefficient (including $0$ coefficents) of the corresponding variable\n#! \tin the constraint equation. The ConstraintSense must be one of \"<\", \">\" or \"=\",\n#!\twhere Gurobi interprets < as <= and > as >=. The ConstraintRHSValue is the value on the\n#!\tright hand side of the constraint. A constraint may optionally be given a name, which helps to identify\n#!\tthe constraint if it is to be deleted at some point. If no constraint name is given, then a constraint is\n#!\tsimply assigned the name \"UnNamedConstraint\".\n#!\tNote that a model must be updated or optimised before any additional constraints become effective.\nDeclareOperation( \"GurobiAddConstraint\",\n\t[ IsGurobiModel, IsList, IsString, IsFloat, IsString] );\n\nDeclareOperation( \"GurobiAddConstraint\",\n\t[ IsGurobiModel, IsList, IsString, IsFloat]);\n\nDeclareOperation( \"GurobiAddConstraint\",\n\t[ IsGurobiModel, IsList, IsString, IsInt]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Deleting Constraints\n#! @Arguments Model, ConstraintEquations, ConstraintSenses, ConstraintRHSValues[, ConstraintNames]\n#! @Returns true\n#! @Description\n#!\tAdd multiple constraints to a model at one time. The arguments (except Model)\n#!\tare lists, such that the i-th entries of each list determine a single constraint in\n#!\tthe same manner as for the operation GurobiAddConstraint. ConstraintNames is an optional argument,\n#!\tand must be given for all constraints, or not at all.\nDeclareOperation( \"GurobiAddMultipleConstraints\",\n\t[ IsGurobiModel, IsList, IsList, IsList, IsList] );\n\n#! @Chapter Using Gurobify\n#! @Section Optimising A Model\n#! @Arguments Model\n#! @Returns Solution\n#! @Description\n#!\tDisplay the solution found for a successfuly optimised model. Note that if a solution has not been optimised, is infeasible, or\n#!\tthe optimisation was not completed, then this will return an error. Thus it is advisable to first check the optimisation status.\nDeclareOperation( \"GurobiSolution\",\n\t[ IsGurobiModel] );\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, TimeLimit\n#! @Returns true\n#! @Description\n#!\tSet a time limit for a Gurobi model. Note that TimeLimit should be a float, however an integer value can be given\n#!\twhich will be automatically converted to a float.\nDeclareOperation( \"GurobiSetTimeLimit\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, BestObjectiveBoundStop\n#! @Returns true\n#! @Description\n#!\tOptimisation will terminate if a feasible solution is found with objective value at least as good as BestObjectiveBoundStop.\n#!\tNote that BestObjectiveBoundStop should be a float, however an integer value can be given\n#!\twhich will be automatically converted to a float.\nDeclareOperation( \"GurobiSetBestObjectiveBoundStop\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, CutOff\n#! @Returns true\n#! @Description\n#!\tOptimisation will terminate if the objective value is worse than CutOff.\n#!\tNote that CutOff should be a float, an integer value can be given\n#!\twhich will be automatically converted to a float.\nDeclareOperation( \"GurobiSetCutOff\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Modifying Objective Functions\n#! @Arguments Model\n#! @Returns true\n#! @Description\n#!\tSets the model sense to maximise. When the model is optimised, it will try to maximise the objective function.\nDeclareOperation(\"GurobiMaximiseModel\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Modifying Objective Functions\n#! @Arguments Model\n#! @Returns true\n#! @Description\n#!\tSets the model sense to minimise. When the model is optimised, it will try to minimise the objective function.\nDeclareOperation(\"GurobiMinimiseModel\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Modifying Objective Functions\n#! @Arguments Model, ObjectiveValues\n#! @Returns true\n#! @Description\n#!\tSet the objective function for a model. ObjectiveValues is a list of coefficients (including $0$ coefficeints)\n#!\tcorresponding to each of the variables\nDeclareOperation( \"GurobiSetObjectiveFunction\",\n\t[ IsGurobiModel, IsList] );\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Modifying Objective Functions\n#! @Arguments Model\n#! @Returns List of coefficients of the objective function\n#! @Description\n#!\tView the objective function for a model.\nDeclareOperation( \"GurobiObjectiveFunction\",\n\t[ IsGurobiModel] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns Number of variables\n#! @Description\n#!\tReturns the number of variables in the model.\nDeclareOperation(\"GurobiNumberOfVariables\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns Number of linear constraints\n#! @Description\n#!\tReturns the number of linear constraints in the model.\nDeclareOperation(\"GurobiNumberOfConstraints\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Optimising A Model\n#! @Arguments Model\n#! @Returns objective value\n#! @Description\n#!\tReturns the objective value of the current solution.\nDeclareOperation(\"GurobiObjectiveValue\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns objective bound\n#! @Description\n#!\tReturns the best known bound on the objective value of the model.\nDeclareOperation(\"GurobiObjectiveBound\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns run time of optimisation\n#! @Description\n#!\tReturns the wall clock runtime in seconds for the most recent optimisation.\nDeclareOperation(\"GurobiRunTime\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Optimising A Model\n#! @Arguments Model\n#! @Returns optimisation status code\n#! @Description\n#!\tReturns the optimisation status code of the most recent optimisation. Refer to the Gurobi documentation for more\n#!\ton the optimisation statuses, or alternatively refer to the Appendix of this manual.\nDeclareOperation(\"GurobiOptimisationStatus\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns numeric focus\n#! @Description\n#!\tReturns the numeric focus value of the model. The numeric focus is a value in the set [0,1,2,3]. A numeric focus of $0$ sets the\n#!\tnumeric focus automatically, preferancing speed. Values between 1 and 3 increase the care taken in computations \n#!\tas the value increases, but also take longer. The default value is 0.\nDeclareOperation(\"GurobiNumericFocus\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, NumericFocus\n#! @Returns true\n#! @Description\n#!\tSet the numeric focus for a model. Numeric focus must be in the set [0,1,2,3]. A numeric focus of $0$ sets the\n#!\tnumeric focus automatically, preferancing speed. Values between 1 and 3 increase the care taken in computations \n#!\tas the value increases, but also take longer. The default value is 0.\nDeclareOperation( \"GurobiSetNumericFocus\",\n\t[ IsGurobiModel, IsInt] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns time limit\n#! @Description\n#!\tReturns the time limit for the model. The default value is infinity.\nDeclareOperation(\"GurobiTimeLimit\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns cutoff value\n#! @Description\n#!\tReturns the cutoff value for the model. Optimisation will terminate if the objective value is worse than CutOff.\n#!\tThe default value is infinity for minimisation, and negative infinity for maximisation.\nDeclareOperation(\"GurobiCutOff\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns best objective bound limit value\n#! @Description\n#!\tReturns the best objective bound limit value for the model.\n#!\tOptimisation will terminate if a feasible solution is found with objective value at least as good as the best objective bound.\n#!\tThe default value is negative infinity.\nDeclareOperation(\"GurobiBestObjectiveBoundStop\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, MIPFocus\n#! @Returns true\n#! @Description\n#!\tSet the MIP focus for a model. The mip focus must be in the set [0,1,2,3], and the default value is 0.\n#!\tThe MIP focus alows you to prioritise finding solutions or proving their optimality. See the Gurobi \n#!\tdocumentation for more information.\nDeclareOperation( \"GurobiSetMIPFocus\",\n\t[ IsGurobiModel, IsInt] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns MIP focus\n#! @Description\n#!\tReturns the MIP focus value for the model. The mip focus must be in the set [0,1,2,3], and the default value is 0.\n#!\tThe MIP focus alows you to prioritise finding solutions or proving their optimality. See the Gurobi \n#!\tdocumentation for more information.\nDeclareOperation(\"GurobiMIPFocus\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, BestBdStop\n#! @Returns true\n#! @Description\n#!\tSet the best bound stopping value for a model. Terminates optimisation as soon as the value\n#!\tof the best bound is determined to be at least as good as the best bound stopping value. Default value is infinity.\nDeclareOperation( \"GurobiSetBestBoundStop\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns Best bound stopping value\n#! @Description\n#!\tReturns the best bound stopping value for the model. Optimisation terminates as soon as the value\n#!\tof the best bound is determined to be at least as good as the best bound stopping value. Default value is infinity.\nDeclareOperation(\"GurobiBestBoundStop\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, BestBdStop\n#! @Returns true\n#! @Description\n#!\tSet the limit for the maximum number of MIP solutions to find.\n#!\tDefault value is $2,000,000,000$.\nDeclareOperation( \"GurobiSetSolutionLimit\",\n\t[ IsGurobiModel, IsInt] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns solution limit value\n#! @Description\n#!\tReturns the solution limit value for the model. This value limits the maximum number of MIP solutions that will be found.\n#!\tDefault value is $2,000,000,000$.\nDeclareOperation(\"GurobiSolutionLimit\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, IterationLimit\n#! @Returns true\n#! @Description\n#!\tSet the limit for the maximum number of simplex iterations performed. Default value is infinity.\nDeclareOperation( \"GurobiSetIterationLimit\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns Iteration limit\n#! @Description\n#!\tReturns the iteration limit value for the model, which limits the number of simplex iterations performed during optimisation.\n#!\tDefault value is infinity.\nDeclareOperation(\"GurobiIterationLimit\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, NodeLimit\n#! @Returns true\n#! @Description\n#!\tSet the limit for the maximum number of MIP nodes explored.\n#!\tThe default value is infinity.\nDeclareOperation( \"GurobiSetNodeLimit\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns Node limit\n#! @Description\n#!\tReturns the node limit value for the model, which limits the number of MIP nodes explored during optimisation.\n#!\tThe default value is infinity.\nDeclareOperation(\"GurobiNodeLimit\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns \n#! @Description\n#!\tReturns the names of the variables in the model. This list acts as the index set for\n#!\tany lists of variable coefficients, such as in GurobiAddConstraint or GurobiSetObjectiveFunction.\nDeclareOperation(\"GurobiVariableNames\",\n\t[IsGurobiModel]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Creating Or Reading A Model\n#! @Arguments VariableTypes[, VariableNames]\n#! @Returns A Gurobi model\n#! @Description\n#! Creates a gurobi model with variables defined by VariableTypes. VariableTypes must be a list of strings, \n#!\twhere each entry is the type of the corresponding variable.\n#! Accepted variable types are \"CONTINUOUS\", \"BINARY\", \"INTEGER\", \"SEMICONT\", or \"SEMIINT\". The variable types are not case sensitive.\n#! Refer to the Gurobi documentation for more information on the variable types.\n#! Optionally takes the names of the variables as a list of strings.\nDeclareOperation( \"GurobiNewModel\",\n\t[IsList, IsList]);\n\n\n\n#! @Chapter Using Gurobify\n#! @Section Creating Or Reading A Model\n#! @Arguments Model, VariableNames\n#! @Returns true\n#! @Description\n#! Assigns each variable a new name from a list of names. The names must be strings. \nDeclareOperation(\"GurobiSetVariableNames\",\n\t\t[IsGurobiModel, IsList]);\n\n\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, Switch\n#! @Returns true\n#! @Description\n#! Turns console logging on or off. If Switch is true the output of Gurobi will be printed to the screen,\n#!\tand if it is false the output will be supressed. The default for Gurobify is to supress the output.\nDeclareOperation(\"GurobiSetLogToConsole\",\n\t\t[IsGurobiModel, IsBool]);\n\n\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns true\/false\n#! @Description\n#!\tReturns true if the Gurobi output is set to display to the screen, and false if the output is supressed.\n#!\tGurobify suppresses the output by default.\nDeclareOperation(\"GurobiLogToConsole\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Optimising A Model\n#! @Arguments Model\n#! @Returns Set of all solutions.\n#! @Description\n#!\tTakes a Gurobi model and repeatedly optimises it, each time adding the previous solution as a\n#!\tconstraint so that it isn't found again. This continues until all solutions are found, and\n#!\tthen they are returned as a set. During the process the number of found solutions is displayed.\nDeclareOperation(\"GurobiFindAllSolutions\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Optimising A Model\n#! @Arguments Model, Group\n#! @Returns Set of all solutions.\n#! @Description\n#!\tSame as above, except that it also takes a permutation group acting on the index set of variables.\n#!\tInstead of finding all solutions directly, the group is used to find the orbit of each new\n#!\tsolution, and these are then all returned at the end, and used as constraints until then.\n#!\tAn option value may also be given which will only return the representatives of each orbit of the\n#!\tsolutions. This saves on memory, and the remaing solutions may be generated again by finding the\n#!\torbit under the group. To invoke this option place a colon after the group argument and then put\n#!\trepresentatives:=true so for example GurobiFindAllSolutions(model, gp : representatives:=true);\nDeclareOperation(\"GurobiFindAllSolutions\",\n\t[IsGurobiModel, IsGroup]);\n\n\n","returncode":0,"stderr":"","license":"mpl-2.0","lang":"GDScript"} {"commit":"62e14ebf7b72abc88d6ada283513c7aae2241284","subject":"window management demo: show dpi for second screen if plugged in at runtime.","message":"window management demo: show dpi for second screen if plugged in at runtime.\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"misc\/window_management\/control.gd","new_file":"misc\/window_management\/control.gd","new_contents":"\nextends Control\n\n# Member variables\nvar mousepos\n\n\nfunc _fixed_process(delta):\n\tvar modetext = \"Mode:\\n\"\n\t\n\tif(OS.is_window_fullscreen()):\n\t\tmodetext += \"Fullscreen\\n\"\n\telse:\n\t\tmodetext += \"Windowed\\n\"\n\t\n\tif(!OS.is_window_resizable()):\n\t\tmodetext += \"FixedSize\\n\"\n\t\n\tif(OS.is_window_minimized()):\n\t\tmodetext += \"Minimized\\n\"\n\t\n\tif(OS.is_window_maximized()):\n\t\tmodetext += \"Maximized\\n\"\n\t\n\tif(Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED):\n\t\tmodetext += \"MouseGrab\\n\"\n\t\tget_node(\"Label_MouseGrab_KeyInfo\").show()\n\telse:\n\t\tget_node(\"Label_MouseGrab_KeyInfo\").hide()\n\t\n\tget_node(\"Label_Mode\").set_text(modetext)\n\t\n\tget_node(\"Label_Position\").set_text(str(\"Position:\\n\", OS.get_window_position()))\n\t\n\tget_node(\"Label_Size\").set_text(str(\"Size:\\n\", OS.get_window_size()))\n\t\n\tget_node(\"Label_MousePosition\").set_text(str(\"Mouse Position:\\n\", mousepos))\n\t\n\tget_node(\"Label_Screen_Count\").set_text(str(\"Screen_Count:\\n\", OS.get_screen_count()))\n\t\n\tget_node(\"Label_Screen_Current\").set_text(str(\"Screen:\\n\", OS.get_current_screen()))\n\t\n\tget_node(\"Label_Screen0_Resolution\").set_text(str(\"Screen0 Resolution:\\n\", OS.get_screen_size()))\n\t\n\tget_node(\"Label_Screen0_Position\").set_text(str(\"Screen0 Position:\\n\", OS.get_screen_position()))\n\n\tget_node(\"Label_Screen0_DPI\").set_text(str(\"Screen0 DPI:\\n\", OS.get_screen_dpi()))\n\t\n\tif(OS.get_screen_count() > 1):\n\t\tget_node(\"Button_Screen0\").show()\n\t\tget_node(\"Button_Screen1\").show()\n\t\tget_node(\"Label_Screen1_Resolution\").show()\n\t\tget_node(\"Label_Screen1_Position\").show()\n\t\tget_node(\"Label_Screen1_DPI\").show()\n\t\tget_node(\"Label_Screen1_Resolution\").set_text(str(\"Screen1 Resolution:\\n\", OS.get_screen_size(1)))\n\t\tget_node(\"Label_Screen1_Position\").set_text(str(\"Screen1 Position:\\n\", OS.get_screen_position(1)))\n\t\tget_node(\"Label_Screen1_DPI\").set_text(str(\"Screen1 DPI:\\n\", OS.get_screen_dpi(1)))\n\telse:\n\t\tget_node(\"Button_Screen0\").hide()\n\t\tget_node(\"Button_Screen1\").hide()\n\t\tget_node(\"Label_Screen1_Resolution\").hide()\n\t\tget_node(\"Label_Screen1_Position\").hide()\n\t\tget_node(\"Label_Screen1_DPI\").hide()\n\t\n\tget_node(\"Button_Fullscreen\").set_pressed(OS.is_window_fullscreen())\n\tget_node(\"Button_FixedSize\").set_pressed(!OS.is_window_resizable())\n\tget_node(\"Button_Minimized\").set_pressed(OS.is_window_minimized())\n\tget_node(\"Button_Maximized\").set_pressed(OS.is_window_maximized())\n\tget_node(\"Button_Mouse_Grab\").set_pressed(Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED)\n\n\nfunc check_wm_api():\n\tvar s = \"\"\n\tif(!OS.has_method(\"get_screen_count\")):\n\t\ts += \" - get_screen_count()\\n\"\n\t\n\tif(!OS.has_method(\"get_current_screen\")):\n\t\ts += \" - get_current_screen()\\n\"\n\t\n\tif(!OS.has_method(\"set_current_screen\")):\n\t\ts += \" - set_current_screen()\\n\"\n\t\n\tif(!OS.has_method(\"get_screen_position\")):\n\t\ts += \" - get_screen_position()\\n\"\n\t\n\tif(!OS.has_method(\"get_screen_size\")):\n\t\ts += \" - get_screen_size()\\n\"\n\t\n\tif(!OS.has_method(\"get_window_position\")):\n\t\ts += \" - get_window_position()\\n\"\n\t\n\tif(!OS.has_method(\"set_window_position\")):\n\t\ts += \" - set_window_position()\\n\"\n\t\n\tif(!OS.has_method(\"get_window_size\")):\n\t\ts += \" - get_window_size()\\n\"\n\t\n\tif(!OS.has_method(\"set_window_size\")):\n\t\ts += \" - set_window_size()\\n\"\n\t\n\tif(!OS.has_method(\"set_window_fullscreen\")):\n\t\ts += \" - set_window_fullscreen()\\n\"\n\t\n\tif(!OS.has_method(\"is_window_fullscreen\")):\n\t\ts += \" - is_window_fullscreen()\\n\"\n\t\n\tif(!OS.has_method(\"set_window_resizable\")):\n\t\ts += \" - set_window_resizable()\\n\"\n\t\n\tif(!OS.has_method(\"is_window_resizable\")):\n\t\ts += \" - is_window_resizable()\\n\"\n\t\n\tif(!OS.has_method(\"set_window_minimized\")):\n\t\ts += \" - set_window_minimized()\\n\"\n\t\n\tif(!OS.has_method(\"is_window_minimized\")):\n\t\ts += \" - is_window_minimized()\\n\"\n\t\n\tif(!OS.has_method(\"set_window_maximized\")):\n\t\ts += \" - set_window_maximized()\\n\"\n\t\n\tif(!OS.has_method(\"is_window_maximized\")):\n\t\ts += \" - is_window_maximized()\\n\"\n\t\n\tif(s.length() == 0):\n\t\treturn true\n\telse:\n\t\tvar text = get_node(\"ImplementationDialog\/Text\").get_text()\n\t\tget_node(\"ImplementationDialog\/Text\").set_text(text + s)\n\t\tget_node(\"ImplementationDialog\").show()\n\t\treturn false\n\n\nfunc _ready():\n\tif(check_wm_api()):\n\t\tset_fixed_process(true)\n\t\tset_process_input(true)\n\n\nfunc _input(event):\n\tif (event.type == InputEvent.MOUSE_MOTION):\n\t\tmousepos = event.pos\n\n\nfunc _on_Button_MoveTo_pressed():\n\tOS.set_window_position(Vector2(100, 100))\n\n\nfunc _on_Button_Resize_pressed():\n\tOS.set_window_size(Vector2(1024, 768))\n\n\nfunc _on_Button_Screen0_pressed():\n\tOS.set_current_screen(0)\n\n\nfunc _on_Button_Screen1_pressed():\n\tOS.set_current_screen(1)\n\n\nfunc _on_Button_Fullscreen_pressed():\n\tif(OS.is_window_fullscreen()):\n\t\tOS.set_window_fullscreen(false)\n\telse:\n\t\tOS.set_window_fullscreen(true)\n\n\nfunc _on_Button_FixedSize_pressed():\n\tif(OS.is_window_resizable()):\n\t\tOS.set_window_resizable(false)\n\telse:\n\t\tOS.set_window_resizable(true)\n\n\nfunc _on_Button_Minimized_pressed():\n\tif(OS.is_window_minimized()):\n\t\tOS.set_window_minimized(false)\n\telse:\n\t\tOS.set_window_minimized(true)\n\n\nfunc _on_Button_Maximized_pressed():\n\tif(OS.is_window_maximized()):\n\t\tOS.set_window_maximized(false)\n\telse:\n\t\tOS.set_window_maximized(true)\n\n\nfunc _on_Button_Mouse_Grab_pressed():\n\tvar observer = get_node(\"..\/Observer\")\n\tobserver.state = observer.STATE_GRAB\n","old_contents":"\nextends Control\n\n# Member variables\nvar mousepos\n\n\nfunc _fixed_process(delta):\n\tvar modetext = \"Mode:\\n\"\n\t\n\tif(OS.is_window_fullscreen()):\n\t\tmodetext += \"Fullscreen\\n\"\n\telse:\n\t\tmodetext += \"Windowed\\n\"\n\t\n\tif(!OS.is_window_resizable()):\n\t\tmodetext += \"FixedSize\\n\"\n\t\n\tif(OS.is_window_minimized()):\n\t\tmodetext += \"Minimized\\n\"\n\t\n\tif(OS.is_window_maximized()):\n\t\tmodetext += \"Maximized\\n\"\n\t\n\tif(Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED):\n\t\tmodetext += \"MouseGrab\\n\"\n\t\tget_node(\"Label_MouseGrab_KeyInfo\").show()\n\telse:\n\t\tget_node(\"Label_MouseGrab_KeyInfo\").hide()\n\t\n\tget_node(\"Label_Mode\").set_text(modetext)\n\t\n\tget_node(\"Label_Position\").set_text(str(\"Position:\\n\", OS.get_window_position()))\n\t\n\tget_node(\"Label_Size\").set_text(str(\"Size:\\n\", OS.get_window_size()))\n\t\n\tget_node(\"Label_MousePosition\").set_text(str(\"Mouse Position:\\n\", mousepos))\n\t\n\tget_node(\"Label_Screen_Count\").set_text(str(\"Screen_Count:\\n\", OS.get_screen_count()))\n\t\n\tget_node(\"Label_Screen_Current\").set_text(str(\"Screen:\\n\", OS.get_current_screen()))\n\t\n\tget_node(\"Label_Screen0_Resolution\").set_text(str(\"Screen0 Resolution:\\n\", OS.get_screen_size()))\n\t\n\tget_node(\"Label_Screen0_Position\").set_text(str(\"Screen0 Position:\\n\", OS.get_screen_position()))\n\n\tget_node(\"Label_Screen0_DPI\").set_text(str(\"Screen0 DPI:\\n\", OS.get_screen_dpi()))\n\t\n\tif(OS.get_screen_count() > 1):\n\t\tget_node(\"Button_Screen0\").show()\n\t\tget_node(\"Button_Screen1\").show()\n\t\tget_node(\"Label_Screen1_Resolution\").show()\n\t\tget_node(\"Label_Screen1_Position\").show()\n\t\tget_node(\"Label_Screen1_Resolution\").set_text(str(\"Screen1 Resolution:\\n\", OS.get_screen_size(1)))\n\t\tget_node(\"Label_Screen1_Position\").set_text(str(\"Screen1 Position:\\n\", OS.get_screen_position(1)))\n\t\tget_node(\"Label_Screen1_DPI\").set_text(str(\"Screen1 DPI:\\n\", OS.get_screen_dpi(1)))\n\telse:\n\t\tget_node(\"Button_Screen0\").hide()\n\t\tget_node(\"Button_Screen1\").hide()\n\t\tget_node(\"Label_Screen1_Resolution\").hide()\n\t\tget_node(\"Label_Screen1_Position\").hide()\n\t\tget_node(\"Label_Screen1_DPI\").hide()\n\t\n\tget_node(\"Button_Fullscreen\").set_pressed(OS.is_window_fullscreen())\n\tget_node(\"Button_FixedSize\").set_pressed(!OS.is_window_resizable())\n\tget_node(\"Button_Minimized\").set_pressed(OS.is_window_minimized())\n\tget_node(\"Button_Maximized\").set_pressed(OS.is_window_maximized())\n\tget_node(\"Button_Mouse_Grab\").set_pressed(Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED)\n\n\nfunc check_wm_api():\n\tvar s = \"\"\n\tif(!OS.has_method(\"get_screen_count\")):\n\t\ts += \" - get_screen_count()\\n\"\n\t\n\tif(!OS.has_method(\"get_current_screen\")):\n\t\ts += \" - get_current_screen()\\n\"\n\t\n\tif(!OS.has_method(\"set_current_screen\")):\n\t\ts += \" - set_current_screen()\\n\"\n\t\n\tif(!OS.has_method(\"get_screen_position\")):\n\t\ts += \" - get_screen_position()\\n\"\n\t\n\tif(!OS.has_method(\"get_screen_size\")):\n\t\ts += \" - get_screen_size()\\n\"\n\t\n\tif(!OS.has_method(\"get_window_position\")):\n\t\ts += \" - get_window_position()\\n\"\n\t\n\tif(!OS.has_method(\"set_window_position\")):\n\t\ts += \" - set_window_position()\\n\"\n\t\n\tif(!OS.has_method(\"get_window_size\")):\n\t\ts += \" - get_window_size()\\n\"\n\t\n\tif(!OS.has_method(\"set_window_size\")):\n\t\ts += \" - set_window_size()\\n\"\n\t\n\tif(!OS.has_method(\"set_window_fullscreen\")):\n\t\ts += \" - set_window_fullscreen()\\n\"\n\t\n\tif(!OS.has_method(\"is_window_fullscreen\")):\n\t\ts += \" - is_window_fullscreen()\\n\"\n\t\n\tif(!OS.has_method(\"set_window_resizable\")):\n\t\ts += \" - set_window_resizable()\\n\"\n\t\n\tif(!OS.has_method(\"is_window_resizable\")):\n\t\ts += \" - is_window_resizable()\\n\"\n\t\n\tif(!OS.has_method(\"set_window_minimized\")):\n\t\ts += \" - set_window_minimized()\\n\"\n\t\n\tif(!OS.has_method(\"is_window_minimized\")):\n\t\ts += \" - is_window_minimized()\\n\"\n\t\n\tif(!OS.has_method(\"set_window_maximized\")):\n\t\ts += \" - set_window_maximized()\\n\"\n\t\n\tif(!OS.has_method(\"is_window_maximized\")):\n\t\ts += \" - is_window_maximized()\\n\"\n\t\n\tif(s.length() == 0):\n\t\treturn true\n\telse:\n\t\tvar text = get_node(\"ImplementationDialog\/Text\").get_text()\n\t\tget_node(\"ImplementationDialog\/Text\").set_text(text + s)\n\t\tget_node(\"ImplementationDialog\").show()\n\t\treturn false\n\n\nfunc _ready():\n\tif(check_wm_api()):\n\t\tset_fixed_process(true)\n\t\tset_process_input(true)\n\n\nfunc _input(event):\n\tif (event.type == InputEvent.MOUSE_MOTION):\n\t\tmousepos = event.pos\n\n\nfunc _on_Button_MoveTo_pressed():\n\tOS.set_window_position(Vector2(100, 100))\n\n\nfunc _on_Button_Resize_pressed():\n\tOS.set_window_size(Vector2(1024, 768))\n\n\nfunc _on_Button_Screen0_pressed():\n\tOS.set_current_screen(0)\n\n\nfunc _on_Button_Screen1_pressed():\n\tOS.set_current_screen(1)\n\n\nfunc _on_Button_Fullscreen_pressed():\n\tif(OS.is_window_fullscreen()):\n\t\tOS.set_window_fullscreen(false)\n\telse:\n\t\tOS.set_window_fullscreen(true)\n\n\nfunc _on_Button_FixedSize_pressed():\n\tif(OS.is_window_resizable()):\n\t\tOS.set_window_resizable(false)\n\telse:\n\t\tOS.set_window_resizable(true)\n\n\nfunc _on_Button_Minimized_pressed():\n\tif(OS.is_window_minimized()):\n\t\tOS.set_window_minimized(false)\n\telse:\n\t\tOS.set_window_minimized(true)\n\n\nfunc _on_Button_Maximized_pressed():\n\tif(OS.is_window_maximized()):\n\t\tOS.set_window_maximized(false)\n\telse:\n\t\tOS.set_window_maximized(true)\n\n\nfunc _on_Button_Mouse_Grab_pressed():\n\tvar observer = get_node(\"..\/Observer\")\n\tobserver.state = observer.STATE_GRAB\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"d6e7343c14cd50bd43ae69a4c49032f1512fa852","subject":"gd \"G\u00e0idhlig\" translation #15170. Author: bretasker. ","message":"gd \"G\u00e0idhlig\" translation #15170. Author: bretasker. ","repos":"JimmyMow\/lila,TangentialAlan\/lila,terokinnunen\/lila,r0k3\/lila,Unihedro\/lila,bjhaid\/lila,elioair\/lila,TangentialAlan\/lila,Unihedro\/lila,r0k3\/lila,ccampo133\/lila,clarkerubber\/lila,ccampo133\/lila,Unihedro\/lila,ccampo133\/lila,bjhaid\/lila,ccampo133\/lila,luanlv\/lila,TangentialAlan\/lila,arex1337\/lila,r0k3\/lila,elioair\/lila,JimmyMow\/lila,JimmyMow\/lila,luanlv\/lila,TangentialAlan\/lila,JimmyMow\/lila,elioair\/lila,Unihedro\/lila,bjhaid\/lila,bjhaid\/lila,arex1337\/lila,r0k3\/lila,Unihedro\/lila,arex1337\/lila,clarkerubber\/lila,luanlv\/lila,luanlv\/lila,elioair\/lila,JimmyMow\/lila,clarkerubber\/lila,arex1337\/lila,samuel-soubeyran\/lila,samuel-soubeyran\/lila,ccampo133\/lila,bjhaid\/lila,terokinnunen\/lila,TangentialAlan\/lila,TangentialAlan\/lila,arex1337\/lila,bjhaid\/lila,terokinnunen\/lila,r0k3\/lila,terokinnunen\/lila,Unihedro\/lila,samuel-soubeyran\/lila,arex1337\/lila,terokinnunen\/lila,samuel-soubeyran\/lila,clarkerubber\/lila,luanlv\/lila,Unihedro\/lila,terokinnunen\/lila,r0k3\/lila,samuel-soubeyran\/lila,ccampo133\/lila,TangentialAlan\/lila,JimmyMow\/lila,clarkerubber\/lila,samuel-soubeyran\/lila,luanlv\/lila,JimmyMow\/lila,elioair\/lila,r0k3\/lila,samuel-soubeyran\/lila,terokinnunen\/lila,elioair\/lila,luanlv\/lila,clarkerubber\/lila,clarkerubber\/lila,ccampo133\/lila,bjhaid\/lila,arex1337\/lila,elioair\/lila","old_file":"conf\/messages.gd","new_file":"conf\/messages.gd","new_contents":"playWithAFriend=Cluich c\u00f2mhla ri caraid\nplayWithTheMachine=Cluich an aghaidh a' choimpiutair\ntoInviteSomeoneToPlayGiveThisUrl=Gus cuireadh a thoirt do chuideigin, thoir an url seo dha\ngameOver=Cr\u00ecoch a\u2019 gheama\nwaitingForOpponent=A\u2019 feitheamh air n\u00e0mhaid\nwaiting=A\u2019 feitheamh\nyourTurn=An turas agad\naiNameLevelAiLevel=%s inbhe %s\nlevel=Inbhe\ntoggleTheChat=Toglaich a\u2019 chabadaich\ntoggleSound=Toglaich fuaim\nchat=Cabadaich\nresign=G\u00e8ill\ncheckmate=Tul-chasg\nstalemate=Clos-cluiche\nwhite=Geal\nblack=Dubh\nrandomColor=Dath air thuaiream\ncreateAGame=Cruthaich geama\nwhiteIsVictorious=Bhuannaich geal\nblackIsVictorious=Bhuannaich dubh\nplayWithTheSameOpponentAgain=Cluich an aghaidh an aon n\u00e0mhaid a-rithist\nnewOpponent=N\u00e0mhaid \u00f9r\nplayWithAnotherOpponent=Cluich an aghaidh n\u00e0mhaid eile\nyourOpponentWantsToPlayANewGameWithYou=Tha an n\u00e0mhaid agad airson geama \u00f9r a chluich \u2019nad aghaidh\njoinTheGame=Thig a-steach dhan gheama\nwhitePlays=Tha geal a\u2019 cluich\nblackPlays=Tha dubh a\u2019 cluich\ntheOtherPlayerHasLeftTheGameYouCanForceResignationOrWaitForHim=Tha an cluicheadair eile air a' gheama fh\u00e0gail. Is urrainn dhut g\u00e8illeadh a chur air, geama ionnannach a ghairm, no feitheamh air a shon.\nmakeYourOpponentResign=Cuir g\u00e8illeadh air an n\u00e0mhaid agad\nforceResignation=Gairm buaidh\nforceDraw=Gairm geama ionnannach\ntalkInChat=D\u00e8an cabadaich\ntheFirstPersonToComeOnThisUrlWillPlayWithYou=Cluichidh a\u2019 chiad neach a thig a-steach air an url seo c\u00f2mhla riut.\nwhiteCreatesTheGame=Tha geal a\u2019 cruthachadh a\u2019 gheama\nblackCreatesTheGame=Tha dubh a\u2019 cruthachadh a\u2019 gheama\nwhiteJoinsTheGame=Th\u00e0inig geal a-steach dhan gheama\nblackJoinsTheGame=Th\u00e0inig dubh a-steach dhan gheama\nwhiteResigned=Gh\u00e8ill geal\nblackResigned=Gh\u00e8ill dubh\nwhiteLeftTheGame=Dh\u2019fh\u00e0g geal an geama\nblackLeftTheGame=Dh\u2019fh\u00e0g dubh an geama\nshareThisUrlToLetSpectatorsSeeTheGame=Co-roinn an url seo gus luchd-amhairc a leigeil a-steach dhan gheama\nreplayAndAnalyse=Ath-chluich is sgr\u00f9daich\ncomputerAnalysisInProgress=Tha anailis a\u2019 choimpiutair a\u2019 dol\ntheComputerAnalysisHasFailed=Dh\u2019fh\u00e0illig le anailis a\u2019 choimpiutair\nviewTheComputerAnalysis=Seall anailis a\u2019 choimpiutair\nrequestAComputerAnalysis=Iarr anailis air a\u2019 choimpiutair\ncomputerAnalysis=Anailis a\u2019 choimpiutair\nblunders=Tuislidhean\nmistakes=Mearachdan\ninaccuracies=Neo-eagnaidhean\nmoveTimes=\u00d9ine nan gluasadan\nflipBoard=D\u00e8an flip air a\u2019 bh\u00f2rd\nthreefoldRepetition=Treas ath-nochdadh\nclaimADraw=Gairm geama ionnannach\nofferDraw=Tairg geama ionnannach\ndraw=Geama ionnannach\nnbConnectedPlayers=%s cluicheadairean\ngamesBeingPlayedRightNow=Geamannan a tha \u2019gan cluich an-dr\u00e0sta fh\u00e8in\nviewAllNbGames=%s geamannan\nviewNbCheckmates=%s tul-chaisg\nnbBookmarks=%s comharran-l\u00ecn\nnbPopularGames=%s geamannan m\u00f2r-ch\u00f2rdte\nnbAnalysedGames=%s geamannan sgr\u00f9daichte\nbookmarkedByNbPlayers=Comharra-leabhair le %s cluicheadairean\nviewInFullSize=Seall sa mheud iomlan\nlogOut=Log a-mach\nsignIn=Log a-steach\nnewToLichess=\u00d9r air Lichess?\nyouNeedAnAccountToDoThat=Tha feum agad air cunntas gus sin a dh\u00e8anamh\nsignUp=Cl\u00e0raich\ngames=Geamannan\nforum=B\u00f2rd-brath\nxPostedInForumY=Sgr\u00ecobh %s san fh\u00f2ram %s\nlatestForumPosts=Na postaichean as \u00f9ire\nplayers=Cluicheadairean\nminutesPerSide=Mionaidean gach taobh\nvariant=Caochladh\ntimeControl=Smachd air an \u00f9ine\ntime=\u00d9ine\nusername=Far-ainm\npassword=Facal-faire\nhaveAnAccount=A bheil cunntas agad?\nchangePassword=Atharraich am facal-faire\nlearnMoreAboutLichess=Ionnsaich barrachd mu Lichess\nrank=Inbhe\ngamesPlayed=Geamannan air an cluich\nnbGamesWithYou=%s geamannan c\u00f2mhla riut\ndeclineInvitation=Di\u00f9lt cuireadh\ncancel=Sguir dheth\ntimeOut=Dh\u2019fhalbh an \u00f9ine\ndrawOfferSent=Chaidh tairgse airson geama ionnanach a chur\ndrawOfferDeclined=Dhi\u00f9ltadh do thairgse airson geama ionnanach\ndrawOfferAccepted=Ghabhadh ri do thairgse airson geama ionnanach\ndrawOfferCanceled=Sguireadh de do thairgse airson geama ionnanach\nyourOpponentOffersADraw=Tha an n\u00e0mhaid agad a\u2019 tairgse geama ionnanach\naccept=Gabh ris\ndecline=Di\u00f9lt\nplayingRightNow=A\u2019 cluich an-dr\u00e0sta fh\u00e8in\nfinished=Cr\u00ecochnaichte\nabortGame=Stad an geama\ngameAborted=Chaidh sgur dhen gheama\nstandard=Coitcheann\nunlimited=Gun chr\u00ecoch\nmode=Modh\ncasual=Gun rangachadh\nrated=Rangaichte\nthisGameIsRated=Tha an geama seo rangaichte\nrematch=Ath-mhaids\nrematchOfferSent=Chaidh tairgse airson ath-mhaids a chur\nrematchOfferAccepted=Ghabhadh ri do thairgse airson ath-mhaids\nrematchOfferCanceled=Chaidh sgur dhe thairgse ath-mhaids\nrematchOfferDeclined=Tairgse ath-mhaids air a di\u00f9ltadh\ncancelRematchOffer=Sguir dhe thairgse ath-mhaids\nviewRematch=Seall an ath-mhaids\nplay=Cluich\ninbox=Bogsa a-steach\nchatRoom=Se\u00f2mar cabadaich\nspectatorRoom=Se\u00f2mar an luchd-amhairc\ncomposeMessage=Sgr\u00ecobh teachdaireachd\nnoNewMessages=Gun teachdaireachd \u00f9r\nsubject=Cuspair\nrecipient=Faightear\nsend=Cuir\nincrementInSeconds=Ioncramaid ann an diogan\nfreeOnlineChess=T\u00e0ileasg air loidhne an-asgaidh\nspectators=Luchd-amhairc:\nnbWins=Bhuannaich %s\nnbLosses=Chaill %s\nnbDraws=Geama ionnanach le %s\nexportGames=\u00c0s-phortaich geamannan\nratingRange=Rainse an rangachaidh\ngiveNbSeconds=Thoir %s diogan\npremoveEnabledClickAnywhereToCancel=Ro-ghluasad an comas - briog \u00e0ite sam bith airson sgur dheth\nthisPlayerUsesChessComputerAssistance=Tha an cluicheadair seo a\u2019 cleachdadh taic coimpiutair taileisg\nopening=Fosgladh\ntakeback=Tarraing air ais\nproposeATakeback=Tairg tarraing air ais\ntakebackPropositionSent=Tairgse tarraing air ais air a cur\ntakebackPropositionDeclined=Tairgse tarraing air ais air a di\u00f9ltadh\ntakebackPropositionAccepted=Air gabhail ri tairgse tarraing air ais\ntakebackPropositionCanceled=Chaidh sgur dhe thairgse tarraing air ais\nyourOpponentProposesATakeback=Tha an n\u00e0mhaid a\u2019 tairgse tarraing air ais\nbookmarkThisGame=Cruthaich comharra-l\u00ecn airson a\u2019 gheama seo.\nsearch=Lorg\nadvancedSearch=Lorg adhartach\ntournament=F\u00e8ill-chluich\ntournaments=F\u00e8ill-chluichean\ntournamentPoints=Puingean f\u00e8ill-chluich\nviewTournament=Seall an fh\u00e8ill-chluich\nbackToTournament=Till dhan fh\u00e8ill-chluich\nfreeOnlineChessGamePlayChessNowInACleanInterfaceNoRegistrationNoAdsNoPluginRequiredPlayChessWithComputerFriendsOrRandomOpponents=T\u00e0ileasg air loidhne an-asgaidh. Cluich t\u00e0ileasg ann am pr\u00f2gram air a bheil dreach glan. Gun chl\u00e0radh, gun sanasachd, gun fheum air plugan. Cluich t\u00e0ileasg an aghaidh a\u2019 choimpiutair, charaidean no n\u00e0imhdean air thuaiream.\nteams=Sgiobaidhean\nnbMembers=%s ball\nallTeams=A h-uile sgioba\nnewTeam=Sgioba \u00f9r\nmyTeams=Na sgiobaidhean agam\nnoTeamFound=Cha deach sgioba a lorg\njoinTeam=Gabh p\u00e0irt san sgioba\nquitTeam=F\u00e0g an sgioba\nanyoneCanJoin=Faodaidh duine sam bith p\u00e0irt a ghabhail ann\naConfirmationIsRequiredToJoin=Tha feum air dearbhadh gus p\u00e0irt a ghabhail ann\njoiningPolicy=Poileasaidh na ballrachd\nteamLeader=Ceannard an sgioba\nteamBestPlayers=Na cluicheadairean as fhearr\nteamRecentMembers=Na buill as \u00f9ire\nxJoinedTeamY=Ghabh %s ballrachd san sgioba %s\nxCreatedTeamY=Chruthaich %s an sgioba %s\naverageElo=Rangachadh cuibheasach\nlocation=\u00c0ite\nsettings=Roghainnean\nfilterGames=Criathraich na geamannan\nreset=Ath-shuidhich\napply=Cuir an s\u00e0s\nleaderboard=Cl\u00e0r nan curaidh\npasteTheFenStringHere=Cuir a-steach an t-sreang FEN an-seo\npasteThePgnStringHere=Cuir a-steach an t-sreang PGN an-seo\nfromPosition=On t-suidheachadh\ncontinueFromHere=Lean air adhart on a sheo\nimportGame=Ion-phortaich geama\nnbImportedGames=%s geamannan air an ion-phortadh\nthisIsAChessCaptcha=Seo CAPTCHA t\u00e0ileisg.\nclickOnTheBoardToMakeYourMove=Briog air a\u2019 bh\u00f2rd airson gluasad \u2019s dearbhaich gur e duine a th\u2019 annad.\nnotACheckmate=Chan e tul-chasg a th\u2019 ann\ncolorPlaysCheckmateInOne=Tha %s a\u2019 cluich; tul-chasg an ceann gluasaid\nretry=Feuch ris a-rithist\nreconnecting=Ag ath-cheangal\nonlineFriends=Caraidean air loidhne\nnoFriendsOnline=Chan eil caraid air loidhne\nfindFriends=Lorg caraidean\nfavoriteOpponents=Na farpaisichean as annsa leat\nfollow=Lean air\nfollowing=A\u2019 leantainn air\nunfollow=Na lean air tuilleadh\nblock=Bac\nblocked=Bacte\nunblock=D\u00ec-bhac\nfollowsYou=\u2019Gad leantainn\nxStartedFollowingY=Th\u00f2isich %s a\u2019 leantainn air %s\nnbFollowers=%s luchd-leantainn\nnbFollowing=%s \u2019ga leantainn\nmore=Barrachd\nmemberSince=Ball o chionn\nlastLogin=An logadh a-steach mu dheireadh\nchallengeToPlay=Thoir d\u00f9bhlan cluiche dha\nplayer=Cluicheadair\nlist=Liosta\ngraph=Graf\nlessThanNbMinutes=Nas lugha na %s mionaidean\nxToYMinutes=%s gu %s mionaidean\ntextIsTooShort=Tha an teacsa ro ghoirid.\ntextIsTooLong=Tha an teacsa ro fhada.\nrequired=Riatanach.\nopenTournaments=F\u00e8ill-chluichean fosgailte\nduration=Faid\nwinner=Buannaiche\nstanding=A\u2019 seasamh\ncreateANewTournament=Cruthaich f\u00e8ill-chluich \u00f9r\njoin=Gabh p\u00e0irt ann\nwithdraw=C\u00f9laich\npoints=Puingean\nwins=Buaidhean\nlosses=Ruaigean\nwinStreak=Sreath de bhuaidhean\ncreatedBy=Air a chruthachadh le\ntournamentIsStarting=Tha an fh\u00e8ill-chluich gu bhith t\u00f2iseachadh\nmembersOnly=Buill a-mh\u00e0in\nboardEditor=Deasaiche a\u2019 bh\u00f9ird\nstartPosition=Suidheachadh an t\u00f2iseachaidh\nclearBoard=Falamhaich am b\u00f2rd\nsavePosition=S\u00e0bhail an suidheachadh\nloadPosition=Luchdaich suidheachadh\nisPrivate=Pr\u00ecobhaideach\nreportXToModerators=Cuir gearan mu %s dha na maoir\nprofile=Pr\u00f2ifil\neditProfile=Deasaich a\u2019 phr\u00f2ifil\nfirstName=Ainm\nlastName=Sloinneadh\nbiography=Eachdraidh-beatha\ncountry=D\u00f9thaich\npreferences=Roghainnean\nwatchLichessTV=Coimhead air TBh Lichess\npreviouslyOnLichessTV=Air Tbh Lichess roimhe\ntodaysLeaders=S\u00e0r-chluicheadairean an-diugh\nonlinePlayers=Cluicheadairean air loidhne\nprogressToday=Adhartas an-diugh\nprogressThisWeek=Adhartas an seachdain seo\nprogressThisMonth=Adhartas am m\u00ecos seo\nleaderboardThisWeek=S\u00e0r-chluicheadairean na seachdaine\nleaderboardThisMonth=S\u00e0r-chluicheadairean a\u2019 mh\u00ecosa\nactiveToday=Gn\u00ecomhach an-diugh\nactiveThisWeek=Gn\u00ecomhach an seachdain seo\nactivePlayers=Cluicheadairean gn\u00ecomhach\nbewareTheGameIsRatedButHasNoClock=Thoir an aire, th\u00e8id an geama seo rangachadh ach chan eil uaireadair aige!\ntraining=Tr\u00e8anadh\nyourPuzzleRatingX=An rangachadh agad: %s\nfindTheBestMoveForWhite=Lorg an gluasad as fhearr airson geal.\nfindTheBestMoveForBlack=Lorg an gluasad as fhearr airson dubh.\ntoTrackYourProgress=Gus s\u00f9il a chumail air d\u2019 adhartas:\ntrainingSignupExplanation=Bheir Lichess t\u00f2imhseachain dhut a bhios freagarrach dhan chomas agad ach am faigh thu tr\u00e8anadh as iomchaidh.\nrecentlyPlayedPuzzles=T\u00f2imhseachain o chionn goirid\npuzzleId=T\u00f2imhseachan %s\npuzzleOfTheDay=T\u00f2imhseachan an latha\nclickToSolve=Briog an-seo airson fhuasgladh\ngoodMove=Seo gluasad math\nbutYouCanDoBetter=Ach tha gluasad nas fhearr ann.\nbestMove=Seo an gluasad as fhearr!\nkeepGoing=Cum ort...\npuzzleFailed=Cha deach leat\nbutYouCanKeepTrying=Ach faodaidh tu feuchainn a-rithist.\nvictory=Buaidh!\ngiveUp=Thoir g\u00e8ill\npuzzleSolvedInXSeconds=Rinn thu a\u2019 ch\u00f9is air an ceann %s diog.\nwasThisPuzzleAnyGood=An robh an t\u00f2imhseachan seo math?\npleaseVotePuzzle=Cuidich lichess \u2019s cuir bh\u00f2t ann leis an t-saighead suas no s\u00ecos:\nthankYou=M\u00f2ran taing!\nratingX=Rangachadh: %s\nplayedXTimes=Air a chluich %s turas\nfromGameLink=On gheama %s\nstartTraining=T\u00f2isich air an tr\u00e8anadh\ncontinueTraining=Lean air adhart leis an tr\u00e8anadh\nretryThisPuzzle=Feuch ris an t\u00f2imhseachan seo a-rithist\nthisPuzzleIsCorrect=Tha an t\u00f2imhseachan seo ceart is inntinneach\nthisPuzzleIsWrong=Tha an t\u00f2imhseachan seo cearr no d\u00f2rainneach\ncommunity=Coimhearsnachd\ntools=Goireasean\nwatch=Coimhead\n","old_contents":"playWithAFriend=Cluich c\u00f2mhla ri caraid\nplayWithTheMachine=Cluich an aghaidh a' choimpiutair\ntoInviteSomeoneToPlayGiveThisUrl=Gus cuireadh a thoirt do chuideigin, thoir an url seo dha\ngameOver=Cr\u00ecoch a\u2019 gheama\nwaitingForOpponent=A\u2019 feitheamh air n\u00e0mhaid\nwaiting=A\u2019 feitheamh\nyourTurn=An turas agad\naiNameLevelAiLevel=%s inbhe %s\nlevel=Inbhe\ntoggleTheChat=Toglaich a\u2019 chabadaich\ntoggleSound=Toglaich fuaim\nchat=Cabadaich\nresign=G\u00e8ill\ncheckmate=Tul-chasg\nstalemate=Clos-cluiche\nwhite=Geal\nblack=Dubh\nrandomColor=Dath air thuaiream\ncreateAGame=Cruthaich geama\nwhiteIsVictorious=Bhuannaich geal\nblackIsVictorious=Bhuannaich dubh\nplayWithTheSameOpponentAgain=Cluich an aghaidh an aon n\u00e0mhaid a-rithist\nnewOpponent=N\u00e0mhaid \u00f9r\nplayWithAnotherOpponent=Cluich an aghaidh n\u00e0mhaid eile\nyourOpponentWantsToPlayANewGameWithYou=Tha an n\u00e0mhaid agad airson geama \u00f9r a chluich \u2019nad aghaidh\njoinTheGame=Thig a-steach dhan gheama\nwhitePlays=Tha geal a\u2019 cluich\nblackPlays=Tha dubh a\u2019 cluich\ntheOtherPlayerHasLeftTheGameYouCanForceResignationOrWaitForHim=Tha an cluicheadair eile air a' gheama fh\u00e0gail. Is urrainn dhut g\u00e8illeadh a chur air, geama ionnannach a ghairm, no feitheamh air a shon.\nmakeYourOpponentResign=Cuir g\u00e8illeadh air an n\u00e0mhaid agad\nforceResignation=Gairm buaidh\nforceDraw=Gairm geama ionnannach\ntalkInChat=D\u00e8an cabadaich\ntheFirstPersonToComeOnThisUrlWillPlayWithYou=Cluichidh a\u2019 chiad neach a thig a-steach air an url seo c\u00f2mhla riut.\nwhiteCreatesTheGame=Tha geal a\u2019 cruthachadh a\u2019 gheama\nblackCreatesTheGame=Tha dubh a\u2019 cruthachadh a\u2019 gheama\nwhiteJoinsTheGame=Th\u00e0inig geal a-steach dhan gheama\nblackJoinsTheGame=Th\u00e0inig dubh a-steach dhan gheama\nwhiteResigned=Gh\u00e8ill geal\nblackResigned=Gh\u00e8ill dubh\nwhiteLeftTheGame=Dh\u2019fh\u00e0g geal an geama\nblackLeftTheGame=Dh\u2019fh\u00e0g dubh an geama\nshareThisUrlToLetSpectatorsSeeTheGame=Co-roinn an url seo gus luchd-amhairc a leigeil a-steach dhan gheama\nreplayAndAnalyse=Ath-chluich is sgr\u00f9daich\ncomputerAnalysisInProgress=Tha anailis a\u2019 choimpiutair a\u2019 dol\ntheComputerAnalysisHasFailed=Dh\u2019fh\u00e0illig le anailis a\u2019 choimpiutair\nviewTheComputerAnalysis=Seall anailis a\u2019 choimpiutair\nrequestAComputerAnalysis=Iarr anailis air a\u2019 choimpiutair\ncomputerAnalysis=Anailis a\u2019 choimpiutair\nblunders=Tuislidhean\nmistakes=Mearachdan\ninaccuracies=Neo-eagnaidhean\nmoveTimes=\u00d9ine nan gluasadan\nflipBoard=D\u00e8an flip air a\u2019 bh\u00f2rd\nthreefoldRepetition=Treas ath-nochdadh\nclaimADraw=Gairm geama ionnannach\nofferDraw=Tairg geama ionnannach\ndraw=Geama ionnannach\nnbConnectedPlayers=%s cluicheadairean\ngamesBeingPlayedRightNow=Geamannan a tha \u2019gan cluich an-dr\u00e0sta fh\u00e8in\nviewAllNbGames=%s geamannan\nviewNbCheckmates=%s tul-chaisg\nnbBookmarks=%s comharran-l\u00ecn\nnbPopularGames=%s geamannan m\u00f2r-ch\u00f2rdte\nnbAnalysedGames=%s geamannan sgr\u00f9daichte\nbookmarkedByNbPlayers=Comharra-leabhair le %s cluicheadairean\nviewInFullSize=Seall sa mheud iomlan\nlogOut=Log a-mach\nsignIn=Log a-steach\nnewToLichess=\u00d9r air Lichess?\nyouNeedAnAccountToDoThat=Tha feum agad air cunntas gus sin a dh\u00e8anamh\nsignUp=Cl\u00e0raich\ngames=Geamannan\nforum=B\u00f2rd-brath\nxPostedInForumY=Sgr\u00ecobh %s san fh\u00f2ram %s\nlatestForumPosts=Na postaichean as \u00f9ire\nplayers=Cluicheadairean\nminutesPerSide=Mionaidean gach taobh\nvariant=Caochladh\ntimeControl=Smachd air an \u00f9ine\ntime=\u00d9ine\nusername=Far-ainm\npassword=Facal-faire\nhaveAnAccount=A bheil cunntas agad?\nchangePassword=Atharraich am facal-faire\nlearnMoreAboutLichess=Ionnsaich barrachd mu Lichess\nrank=Inbhe\ngamesPlayed=Geamannan air an cluich\nnbGamesWithYou=%s geamannan c\u00f2mhla riut\ndeclineInvitation=Di\u00f9lt cuireadh\ncancel=Sguir dheth\ntimeOut=Dh\u2019fhalbh an \u00f9ine\ndrawOfferSent=Chaidh tairgse airson geama ionnanach a chur\ndrawOfferDeclined=Dhi\u00f9ltadh do thairgse airson geama ionnanach\ndrawOfferAccepted=Ghabhadh ri do thairgse airson geama ionnanach\ndrawOfferCanceled=Sguireadh de do thairgse airson geama ionnanach\nyourOpponentOffersADraw=Tha an n\u00e0mhaid agad a\u2019 tairgse geama ionnanach\naccept=Gabh ris\ndecline=Di\u00f9lt\nplayingRightNow=A\u2019 cluich an-dr\u00e0sta fh\u00e8in\nfinished=Cr\u00ecochnaichte\nabortGame=Stad an geama\ngameAborted=Chaidh sgur dhen gheama\nstandard=Coitcheann\nunlimited=Gun chr\u00ecoch\nmode=Modh\ncasual=Gun rangachadh\nrated=Rangaichte\nthisGameIsRated=Tha an geama seo rangaichte\nrematch=Ath-mhaids\nrematchOfferSent=Chaidh tairgse airson ath-mhaids a chur\nrematchOfferAccepted=Ghabhadh ri do thairgse airson ath-mhaids\nrematchOfferCanceled=Chaidh sgur dhe thairgse ath-mhaids\nrematchOfferDeclined=Tairgse ath-mhaids air a di\u00f9ltadh\ncancelRematchOffer=Sguir dhe thairgse ath-mhaids\nviewRematch=Seall an ath-mhaids\nplay=Cluich\ninbox=Bogsa a-steach\nchatRoom=Se\u00f2mar cabadaich\nspectatorRoom=Se\u00f2mar an luchd-amhairc\ncomposeMessage=Sgr\u00ecobh teachdaireachd\nnoNewMessages=Gun teachdaireachd \u00f9r\nsubject=Cuspair\nrecipient=Faightear\nsend=Cuir\nincrementInSeconds=Ioncramaid ann an diogan\nfreeOnlineChess=T\u00e0ileasg air loidhne an-asgaidh\nspectators=Luchd-amhairc:\nnbWins=Bhuannaich %s\nnbLosses=Chaill %s\nnbDraws=Geama ionnanach le %s\nexportGames=\u00c0s-phortaich geamannan\nratingRange=Rainse an rangachaidh\ngiveNbSeconds=Thoir %s diogan\npremoveEnabledClickAnywhereToCancel=Ro-ghluasad an comas - briog \u00e0ite sam bith airson sgur dheth\nthisPlayerUsesChessComputerAssistance=Tha an cluicheadair seo a\u2019 cleachdadh taic coimpiutair taileisg\nopening=Fosgladh\ntakeback=Tarraing air ais\nproposeATakeback=Tairg tarraing air ais\ntakebackPropositionSent=Tairgse tarraing air ais air a cur\ntakebackPropositionDeclined=Tairgse tarraing air ais air a di\u00f9ltadh\ntakebackPropositionAccepted=Air gabhail ri tairgse tarraing air ais\ntakebackPropositionCanceled=Chaidh sgur dhe thairgse tarraing air ais\nyourOpponentProposesATakeback=Tha an n\u00e0mhaid a\u2019 tairgse tarraing air ais\nbookmarkThisGame=Cruthaich comharra-l\u00ecn airson a\u2019 gheama seo.\nsearch=Lorg\nadvancedSearch=Lorg adhartach\ntournament=F\u00e8ill-chluich\ntournaments=F\u00e8ill-chluichean\ntournamentPoints=Puingean f\u00e8ill-chluich\nviewTournament=Seall an fh\u00e8ill-chluich\nbackToTournament=Till dhan fh\u00e8ill-chluich\nfreeOnlineChessGamePlayChessNowInACleanInterfaceNoRegistrationNoAdsNoPluginRequiredPlayChessWithComputerFriendsOrRandomOpponents=T\u00e0ileasg air loidhne an-asgaidh. Cluich t\u00e0ileasg ann am pr\u00f2gram air a bheil dreach glan. Gun chl\u00e0radh, gun sanasachd, gun fheum air plugan. Cluich t\u00e0ileasg an aghaidh a\u2019 choimpiutair, charaidean no n\u00e0imhdean air thuaiream.\nteams=Sgiobaidhean\nnbMembers=%s ball\nallTeams=A h-uile sgioba\nnewTeam=Sgioba \u00f9r\nmyTeams=Na sgiobaidhean agam\nnoTeamFound=Cha deach sgioba a lorg\njoinTeam=Gabh p\u00e0irt san sgioba\nquitTeam=F\u00e0g an sgioba\nanyoneCanJoin=Faodaidh duine sam bith p\u00e0irt a ghabhail ann\naConfirmationIsRequiredToJoin=Tha feum air dearbhadh gus p\u00e0irt a ghabhail ann\njoiningPolicy=Poileasaidh na ballrachd\nteamLeader=Ceannard an sgioba\nteamBestPlayers=Na cluicheadairean as fhearr\nteamRecentMembers=Na buill as \u00f9ire\nxJoinedTeamY=Ghabh %s ballrachd san sgioba %s\nxCreatedTeamY=Chruthaich %s an sgioba %s\naverageElo=Rangachadh cuibheasach\nlocation=\u00c0ite\nsettings=Roghainnean\nfilterGames=Criathraich na geamannan\nreset=Ath-shuidhich\napply=Cuir an s\u00e0s\nleaderboard=Cl\u00e0r nan curaidh\npasteTheFenStringHere=Cuir a-steach an t-sreang FEN an-seo\npasteThePgnStringHere=Cuir a-steach an t-sreang PGN an-seo\nfromPosition=On t-suidheachadh\ncontinueFromHere=Lean air adhart on a sheo\nimportGame=Ion-phortaich geama\nnbImportedGames=%s geamannan air an ion-phortadh\nthisIsAChessCaptcha=Seo CAPTCHA t\u00e0ileisg.\nclickOnTheBoardToMakeYourMove=Briog air a\u2019 bh\u00f2rd airson gluasad \u2019s dearbhaich gur e duine a th\u2019 annad.\nnotACheckmate=Chan e tul-chasg a th\u2019 ann\ncolorPlaysCheckmateInOne=Tha %s a\u2019 cluich; tul-chasg an ceann gluasaid\nretry=Feuch ris a-rithist\nreconnecting=Ag ath-cheangal\nonlineFriends=Caraidean air loidhne\nnoFriendsOnline=Chan eil caraid air loidhne\nfindFriends=Lorg caraidean\nfavoriteOpponents=Na farpaisichean as annsa leat\nfollow=Lean air\nfollowing=A\u2019 leantainn air\nunfollow=Na lean air tuilleadh\nblock=Bac\nblocked=Bacte\nunblock=D\u00ec-bhac\nfollowsYou=\u2019Gad leantainn\nxStartedFollowingY=Th\u00f2isich %s a\u2019 leantainn air %s\nnbFollowers=%s luchd-leantainn\nnbFollowing=%s \u2019ga leantainn\nmore=Barrachd\nmemberSince=Ball o chionn\nlastLogin=An logadh a-steach mu dheireadh\nchallengeToPlay=Thoir d\u00f9bhlan cluiche dha\nplayer=Cluicheadair\nlist=Liosta\ngraph=Graf\nlessThanNbMinutes=Nas lugha na %s mionaidean\nxToYMinutes=%s gu %s mionaidean\ntextIsTooShort=Tha an teacsa ro ghoirid.\ntextIsTooLong=Tha an teacsa ro fhada.\nrequired=Riatanach.\nopenTournaments=F\u00e8ill-chluichean fosgailte\nduration=Faid\nwinner=Buannaiche\nstanding=A\u2019 seasamh\ncreateANewTournament=Cruthaich f\u00e8ill-chluich \u00f9r\njoin=Gabh p\u00e0irt ann\nwithdraw=C\u00f9laich\npoints=Puingean\nwins=Buaidhean\nlosses=Ruaigean\nwinStreak=Sreath de bhuaidhean\ncreatedBy=Air a chruthachadh le\ntournamentIsStarting=Tha an fh\u00e8ill-chluich gu bhith t\u00f2iseachadh\nmembersOnly=Buill a-mh\u00e0in\nboardEditor=Deasaiche a\u2019 bh\u00f9ird\nstartPosition=Suidheachadh an t\u00f2iseachaidh\nclearBoard=Falamhaich am b\u00f2rd\nsavePosition=S\u00e0bhail an suidheachadh\nloadPosition=Luchdaich suidheachadh\nisPrivate=Pr\u00ecobhaideach\nreportXToModerators=Cuir gearan mu %s dha na maoir\nprofile=Pr\u00f2ifil\neditProfile=Deasaich a\u2019 phr\u00f2ifil\nfirstName=Ainm\nlastName=Sloinneadh\nbiography=Eachdraidh-beatha\ncountry=D\u00f9thaich\npreferences=Roghainnean\nwatchLichessTV=Coimhead air TBh Lichess\npreviouslyOnLichessTV=Air Tbh Lichess roimhe\ntodaysLeaders=S\u00e0r-chluicheadairean an-diugh\nonlinePlayers=Cluicheadairean air loidhne\nprogressToday=Adhartas an-diugh\nprogressThisWeek=Adhartas an seachdain seo\nprogressThisMonth=Adhartas am m\u00ecos seo\nleaderboardThisWeek=S\u00e0r-chluicheadairean na seachdaine\nleaderboardThisMonth=S\u00e0r-chluicheadairean a\u2019 mh\u00ecosa\nactiveToday=Gn\u00ecomhach an-diugh\nactiveThisWeek=Gn\u00ecomhach an seachdain seo\nactivePlayers=Cluicheadairean gn\u00ecomhach\nbewareTheGameIsRatedButHasNoClock=Thoir an aire, th\u00e8id an geama seo rangachadh ach chan eil uaireadair aige!\ntraining=Tr\u00e8anadh\nyourPuzzleRatingX=An rangachadh agad: %s\nfindTheBestMoveForWhite=Lorg an gluasad as fhearr airson geal.\nfindTheBestMoveForBlack=Lorg an gluasad as fhearr airson dubh.\ntoTrackYourProgress=Gus s\u00f9il a chumail air d\u2019 adhartas:\ntrainingSignupExplanation=Bheir Lichess t\u00f2imhseachain dhut a bhios freagarrach dhan chomas agad ach am faigh thu tr\u00e8anadh as iomchaidh.\nrecentlyPlayedPuzzles=T\u00f2imhseachain o chionn goirid\npuzzleId=T\u00f2imhseachan %s\npuzzleOfTheDay=T\u00f2imhseachan an latha\nclickToSolve=Briog an-seo airson fhuasgladh\ngoodMove=Seo gluasad math\nbutYouCanDoBetter=Ach tha gluasad nas fhearr ann.\nbestMove=Seo an gluasad as fhearr!\nkeepGoing=Cum ort...\npuzzleFailed=Cha deach leat\nbutYouCanKeepTrying=Ach faodaidh tu feuchainn a-rithist.\nvictory=Buaidh!\ngiveUp=Thoir g\u00e8ill\npuzzleSolvedInXSeconds=Rinn thu a\u2019 ch\u00f9is air an ceann %s diog.\nwasThisPuzzleAnyGood=An robh an t\u00f2imhseachan seo math?\npleaseVotePuzzle=Cuidich lichess \u2019s cuir bh\u00f2t ann leis an t-saighead suas no s\u00ecos:\nthankYou=M\u00f2ran taing!\nratingX=Rangachadh: %s\nplayedXTimes=Air a chluich %s turas\nfromGameLink=On gheama %s\nstartTraining=T\u00f2isich air an tr\u00e8anadh\ncontinueTraining=Lean air adhart leis an tr\u00e8anadh\nretryThisPuzzle=Feuch ris an t\u00f2imhseachan seo a-rithist\nthisPuzzleIsCorrect=Tha an t\u00f2imhseachan seo ceart is inntinneach\nthisPuzzleIsWrong=Tha an t\u00f2imhseachan seo cearr no d\u00f2rainneach\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"GDScript"} {"commit":"58b9ae5d4b60869c0dd0fc68762fa3707bc014d8","subject":"sound looping fixed","message":"sound looping fixed\n","repos":"AlexHolly\/captain-holetooth,shelltitan\/captain-holetooth,AlexHolly\/captain-holetooth,shelltitan\/captain-holetooth","old_file":"src\/actors\/player\/player.gd","new_file":"src\/actors\/player\/player.gd","new_contents":"\nextends RigidBody2D\n\n# Member variables\nvar anim = \"\"\nvar siding_left = false\nvar jumping = false\nvar shooting = false\n\nvar WALK_ACCEL = 2000.0 # Higher = Better control, Lower = Sluggish\nvar WALK_DEACCEL = 2000.0\nvar WALK_MAX_VELOCITY = 300.0\nvar AIR_ACCEL = 300.0 # It's over 9000! \nvar AIR_DEACCEL = 2900.0 # Make it higher to give the player better air control, or slower to make the game more \"realistic\"\nvar JUMP_VELOCITY = 438\nvar STOP_JUMP_FORCE = 2000.0\n\nvar MAX_FLOOR_AIRBORNE_TIME = 0.15\n\nvar airborne_time = 1e20\nvar shoot_time = 1e20\n\nvar MAX_SHOOT_POSE_TIME = 0.3\n\nvar bullet = preload(\"res:\/\/src\/actors\/player\/bullet.tscn\")\n\nvar floor_h_velocity = 0.0\nvar enemy\n\n#func beam_to(spawner):\n\t\n#\tvar spawnerpos = get_node(spawner).get_global_pos()\n#\tprint(\"Beam to active!\")\n#\tself.set_pos(spawnerpos)\n\n\nfunc _integrate_forces(s):\n\tvar linear_vel = s.get_linear_velocity()\n\tvar step = s.get_step()\n\t\n\tvar new_anim = anim\n\tvar new_siding_left = siding_left\n\t\n\t# Get the controls\n\tvar move_left = Input.is_action_pressed(\"move_left\")\n\tvar move_right = Input.is_action_pressed(\"move_right\")\n\tvar jump = Input.is_action_pressed(\"jump\")\n\tvar shoot = Input.is_action_pressed(\"shoot\")\n\tvar spawn = Input.is_action_pressed(\"spawn\")\n\t\n\tif spawn:\n\t\tvar e = enemy.instance()\n\t\tvar p = get_pos()\n\t\tp.y = p.y - 100\n\t\te.set_pos(p)\n\t\tget_parent().add_child(e)\n\t\n\t# Deapply prev floor velocity\n\tlinear_vel.x -= floor_h_velocity\n\tfloor_h_velocity = 0.0\n\t\n\t# Find the floor (a contact with upwards facing collision normal)\n\tvar found_floor = false\n\tvar floor_index = -1\n\t\n\tfor x in range(s.get_contact_count()):\n\t\tvar ci = s.get_contact_local_normal(x)\n\t\tif (ci.dot(Vector2(0, -1)) > 0.6):\n\t\t\tfound_floor = true\n\t\t\tfloor_index = x\n\t\n\t# A good idea when impementing characters of all kinds,\n\t# compensates for physics imprecission, as well as human reaction delay.\n\tif (shoot and not shooting):\n\t\tshoot_time = 0\n\t\tvar bi = bullet.instance()\n\t\tvar ss\n\t\tif (siding_left):\n\t\t\tss = -1.0\n\t\telse:\n\t\t\tss = 1.0\n\t\tvar pos = get_pos() + get_node(\"bullet_shoot\").get_pos()*Vector2(ss, 1.0)\n\t\t\n\t\tbi.set_pos(pos)\n\t\tget_parent().add_child(bi)\n\t\t\n\t\tbi.set_linear_velocity(Vector2(800.0*ss, -80))\n\t\tget_node(\"sprite\/smoke\").set_emitting(true)\n\t\tget_node(\"sfx\").play(\"schwuit\")\n\t\tPS2D.body_add_collision_exception(bi.get_rid(), get_rid()) # Make bullet and this not collide\n\telse:\n\t\tshoot_time += step\n\t\n\t# Calculate air born time in order to control when to stop jump\n\t# from the user releasing jump or reaching max jump height\n\tif (found_floor):\n\t\tairborne_time = 0.0\n\telse:\n\t\tairborne_time += step # Time it spent in the air\n\t\n\tvar on_floor = airborne_time < MAX_FLOOR_AIRBORNE_TIME\n\n\t# Process jump\n\tif (jumping):\n\t\tif (linear_vel.y > 0):\n\t\t\t# Set off the jumping flag if going down\n\t\t\tjumping = false\n\n\t\tif (!jump):\n\t\t\tlinear_vel.y += STOP_JUMP_FORCE*step\n\t\n\tif (on_floor):\n\t\t# Process logic when character is on floor\n\t\tif (move_left and not move_right):\n\t\t\tif (linear_vel.x > -WALK_MAX_VELOCITY):\n\t\t\t\tlinear_vel.x -= WALK_ACCEL*step\n\t\t\t\t# Prevent player from exceeding max walk velocity\n\t\t\t\tif(linear_vel.x < -WALK_MAX_VELOCITY):\n\t\t\t\t\tlinear_vel.x = -WALK_MAX_VELOCITY\n\t\t\t\t\n\t\telif (move_right and not move_left):\n\t\t\tif (linear_vel.x < WALK_MAX_VELOCITY):\n\t\t\t\tlinear_vel.x += WALK_ACCEL*step\n\t\t\t\t# Prevent player from exceeding max walk velocity\n\t\t\t\tif(linear_vel.x > WALK_MAX_VELOCITY):\n\t\t\t\t\tlinear_vel.x = WALK_MAX_VELOCITY\n\t\telse:\n\t\t\tvar xv = abs(linear_vel.x)\n\t\t\txv -= WALK_DEACCEL*step\n\t\t\tif (xv < 0):\n\t\t\t\txv = 0\n\t\t\tlinear_vel.x = sign(linear_vel.x)*xv\n\n\t\t\n\t\t# If we can, and want to JUMP - Jump!\n\t\tif (!jumping && jump):\n\t\t\t# Set velocity upwards \n\t\t\tlinear_vel.y = -JUMP_VELOCITY\n\t\t\t\n\t\t\t# Notify code that we are jumping\n\t\t\tjumping = true\n\t\t\t\n\t\t\t# Play the player's jump sound\n\t\t\tif !get_node(\"sfx\").is_active():\n\t\t\t\tget_node(\"sfx\").play(\"flupp\")\n\t\t\t# THIS IS FOR FUTURE USE - Its a statistics thing for players to see like \"Hey you only jumped 20 times during the whole game...\"\n\t\t\t# Whatever use it is, i think its a fun element to talk about :D\n\t\t\t# I don't care often about the \"use\" of things... just having it for fun is good enough ;)\n\t\t\tglobal.times_jumped = global.times_jumped +1\n\t\t\t# print(global.times_jumped)\n\t\t\t\n\t\t\t# Achievement for jumping 50 times - Increased jump height\n\t\t\tif (global.times_jumped > 50):\n\t\t\t\tJUMP_VELOCITY = 550\n\t\t\t\t# print(\"Yay! You can now jump higher\")\n\t\t\t\t# TODO: Print an achievement notification message to the player\n\t\t\n\t\t# Check siding direction\n\t\tif (linear_vel.x < 0 && move_left):\n\t\t\tnew_siding_left = true\n\t\telif (linear_vel.x > 0 && move_right):\n\t\t\tnew_siding_left = false\n\t\t\n\t\t# Check jumping\n\t\tif (jumping):\n\t\t\t# Set the next animation\n\t\t\tnew_anim = \"jumping\"\n\t\t\n\t\t# Handling an idle player\n\t\telif (abs(linear_vel.x) < 0.1): # Using a 0.1 padding for when we consider the player to be idle\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"idle_weapon\"\n\t\t\telse:\n\t\t\t\tnew_anim = \"idle\"\n\t\t\n\t\t# The player is moving (not jumping)\n\t\telse:\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"run_weapon\"\n\t\t\telse:\n\t\t\t\tnew_anim = \"run\"\n\telse:\n\t\t# Process logic when the character is in the air\n\t\t# When we are only pressing LEFT movement\n\t\tif (move_left && !move_right):\n\t\t\tif (linear_vel.x > -WALK_MAX_VELOCITY):\n\t\t\t\t# linear_vel.x = -WALK_MAX_VELOCITY\n\t\t\t\tlinear_vel.x -= AIR_ACCEL*step\n\t\t\t\tif(linear_vel.x < -WALK_MAX_VELOCITY):\n\t\t\t\t\tlinear_vel.x = -WALK_MAX_VELOCITY\n\t\t\t\t\n\t\telif (move_right && !move_left):\n\t\t\tif (linear_vel.x < WALK_MAX_VELOCITY):\n\t\t\t\t# linear_vel.x = WALK_MAX_VELOCITY\n\t\t\t\tlinear_vel.x += AIR_ACCEL*step\n\t\t\t\tif(linear_vel.x > WALK_MAX_VELOCITY):\n\t\t\t\t\tlinear_vel.x = WALK_MAX_VELOCITY\n\t\telse:\n\t\t\t# Deaccelerate air movement (quickly for a smooth gameplay experience)\n\t\t\tvar x_vel = abs(linear_vel.x)\n\t\t\tx_vel -= AIR_DEACCEL*step\n\t\t\tif (x_vel < 0):\n\t\t\t\tx_vel = 0\n\t\t\tlinear_vel.x = sign(linear_vel.x)*x_vel\n\t\t\n\t\tif (linear_vel.y < 0):\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"jumping_weapon\"\n\t\t\telse:\n\t\t\t\tnew_anim = \"jumping\"\n\t\telse:\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"falling_weapon\"\n\t\t\t\n\t\t\telse:\n\t\t\t\tnew_anim = \"falling\"\n\t\n\t# Update siding\n\tif (new_siding_left != siding_left):\n\t\tif (new_siding_left):\n\t\t\tget_node(\"sprite\").set_scale(Vector2(-1, 1))\n\t\telse:\n\t\t\tget_node(\"sprite\").set_scale(Vector2(1, 1))\n\t\t\n\t\tsiding_left = new_siding_left\n\t\n\t# Change animation\n\tif (new_anim != anim):\n\t\tanim = new_anim\n\t\tget_node(\"anim\").play(anim)\n\t\n\tshooting = shoot\n\t\n\t# Apply floor velocity\n\tif (found_floor):\n\t\tfloor_h_velocity = s.get_contact_collider_velocity_at_pos(floor_index).x\n\t\tlinear_vel.x += floor_h_velocity\n\t\n\t# Finally, apply gravity and set back the linear velocity\n\tlinear_vel += s.get_total_gravity()*step\n\ts.set_linear_velocity(linear_vel)\n\t\n\n\nfunc _ready():\n\tset_process(true)\n\tenemy = ResourceLoader.load(\"res:\/\/scenes\/scn3-forest\/enemy.tscn\")\n\t# Update play time, has to go into a global function at some point\nfunc _process(delta):\n\tglobal.time_elapsed += delta\n\t#print(global.time_elapsed)\n\tif global.time_elapsed >= int(global.playtime_limit_seconds):\n\t\t#print(\"Time elpased!\")\n\t\t#show(Popup)\n\t\tglobal.time_elapsed = 0\n\n\n#\tif !Globals.has_singleton(\"Facebook\"):\n#\t\treturn\n#\tvar Facebook = Globals.get_singleton(\"Facebook\")\n#\tvar link = Globals.get(\"facebook\/link\")\n#\tvar icon = Globals.get(\"facebook\/icon\")\n#\tvar msg = \"I just sneezed on your wall! Beat my score and Stop the Running nose!\"\n#\tvar title = \"I just sneezed on your wall!\"\n#\tFacebook.post(\"feed\", msg, title, link, icon)\n","old_contents":"\nextends RigidBody2D\n\n# Member variables\nvar anim = \"\"\nvar siding_left = false\nvar jumping = false\nvar shooting = false\n\nvar WALK_ACCEL = 2000.0 # Higher = Better control, Lower = Sluggish\nvar WALK_DEACCEL = 2000.0\nvar WALK_MAX_VELOCITY = 300.0\nvar AIR_ACCEL = 300.0 # It's over 9000! \nvar AIR_DEACCEL = 2900.0 # Make it higher to give the player better air control, or slower to make the game more \"realistic\"\nvar JUMP_VELOCITY = 438\nvar STOP_JUMP_FORCE = 2000.0\n\nvar MAX_FLOOR_AIRBORNE_TIME = 0.15\n\nvar airborne_time = 1e20\nvar shoot_time = 1e20\n\nvar MAX_SHOOT_POSE_TIME = 0.3\n\nvar bullet = preload(\"res:\/\/src\/actors\/player\/bullet.tscn\")\n\nvar floor_h_velocity = 0.0\nvar enemy\n\n#func beam_to(spawner):\n\t\n#\tvar spawnerpos = get_node(spawner).get_global_pos()\n#\tprint(\"Beam to active!\")\n#\tself.set_pos(spawnerpos)\n\n\nfunc _integrate_forces(s):\n\tvar linear_vel = s.get_linear_velocity()\n\tvar step = s.get_step()\n\t\n\tvar new_anim = anim\n\tvar new_siding_left = siding_left\n\t\n\t# Get the controls\n\tvar move_left = Input.is_action_pressed(\"move_left\")\n\tvar move_right = Input.is_action_pressed(\"move_right\")\n\tvar jump = Input.is_action_pressed(\"jump\")\n\tvar shoot = Input.is_action_pressed(\"shoot\")\n\tvar spawn = Input.is_action_pressed(\"spawn\")\n\t\n\tif spawn:\n\t\tvar e = enemy.instance()\n\t\tvar p = get_pos()\n\t\tp.y = p.y - 100\n\t\te.set_pos(p)\n\t\tget_parent().add_child(e)\n\t\n\t# Deapply prev floor velocity\n\tlinear_vel.x -= floor_h_velocity\n\tfloor_h_velocity = 0.0\n\t\n\t# Find the floor (a contact with upwards facing collision normal)\n\tvar found_floor = false\n\tvar floor_index = -1\n\t\n\tfor x in range(s.get_contact_count()):\n\t\tvar ci = s.get_contact_local_normal(x)\n\t\tif (ci.dot(Vector2(0, -1)) > 0.6):\n\t\t\tfound_floor = true\n\t\t\tfloor_index = x\n\t\n\t# A good idea when impementing characters of all kinds,\n\t# compensates for physics imprecission, as well as human reaction delay.\n\tif (shoot and not shooting):\n\t\tshoot_time = 0\n\t\tvar bi = bullet.instance()\n\t\tvar ss\n\t\tif (siding_left):\n\t\t\tss = -1.0\n\t\telse:\n\t\t\tss = 1.0\n\t\tvar pos = get_pos() + get_node(\"bullet_shoot\").get_pos()*Vector2(ss, 1.0)\n\t\t\n\t\tbi.set_pos(pos)\n\t\tget_parent().add_child(bi)\n\t\t\n\t\tbi.set_linear_velocity(Vector2(800.0*ss, -80))\n\t\tget_node(\"sprite\/smoke\").set_emitting(true)\n\t\tget_node(\"sfx\").play(\"schwuit\")\n\t\tPS2D.body_add_collision_exception(bi.get_rid(), get_rid()) # Make bullet and this not collide\n\telse:\n\t\tshoot_time += step\n\t\n\t# Calculate air born time in order to control when to stop jump\n\t# from the user releasing jump or reaching max jump height\n\tif (found_floor):\n\t\tairborne_time = 0.0\n\telse:\n\t\tairborne_time += step # Time it spent in the air\n\t\n\tvar on_floor = airborne_time < MAX_FLOOR_AIRBORNE_TIME\n\n\t# Process jump\n\tif (jumping):\n\t\tif (linear_vel.y > 0):\n\t\t\t# Set off the jumping flag if going down\n\t\t\tjumping = false\n\n\t\tif (!jump):\n\t\t\tlinear_vel.y += STOP_JUMP_FORCE*step\n\t\n\tif (on_floor):\n\t\t# Process logic when character is on floor\n\t\tif (move_left and not move_right):\n\t\t\tif (linear_vel.x > -WALK_MAX_VELOCITY):\n\t\t\t\tlinear_vel.x -= WALK_ACCEL*step\n\t\t\t\t# Prevent player from exceeding max walk velocity\n\t\t\t\tif(linear_vel.x < -WALK_MAX_VELOCITY):\n\t\t\t\t\tlinear_vel.x = -WALK_MAX_VELOCITY\n\t\t\t\t\n\t\telif (move_right and not move_left):\n\t\t\tif (linear_vel.x < WALK_MAX_VELOCITY):\n\t\t\t\tlinear_vel.x += WALK_ACCEL*step\n\t\t\t\t# Prevent player from exceeding max walk velocity\n\t\t\t\tif(linear_vel.x > WALK_MAX_VELOCITY):\n\t\t\t\t\tlinear_vel.x = WALK_MAX_VELOCITY\n\t\telse:\n\t\t\tvar xv = abs(linear_vel.x)\n\t\t\txv -= WALK_DEACCEL*step\n\t\t\tif (xv < 0):\n\t\t\t\txv = 0\n\t\t\tlinear_vel.x = sign(linear_vel.x)*xv\n\n\t\t\n\t\t# If we can, and want to JUMP - Jump!\n\t\tif (!jumping && jump):\n\t\t\t# Set velocity upwards \n\t\t\tlinear_vel.y = -JUMP_VELOCITY\n\t\t\t\n\t\t\t# Notify code that we are jumping\n\t\t\tjumping = true\n\t\t\t\n\t\t\t# Play the player's jump sound\n\t\t\tget_node(\"sfx\").play(\"flupp\")\n\t\t\t\n\t\t\t# THIS IS FOR FUTURE USE - Its a statistics thing for players to see like \"Hey you only jumped 20 times during the whole game...\"\n\t\t\t# Whatever use it is, i think its a fun element to talk about :D\n\t\t\t# I don't care often about the \"use\" of things... just having it for fun is good enough ;)\n\t\t\tglobal.times_jumped = global.times_jumped +1\n\t\t\t# print(global.times_jumped)\n\t\t\t\n\t\t\t# Achievement for jumping 50 times - Increased jump height\n\t\t\tif (global.times_jumped > 50):\n\t\t\t\tJUMP_VELOCITY = 550\n\t\t\t\t# print(\"Yay! You can now jump higher\")\n\t\t\t\t# TODO: Print an achievement notification message to the player\n\t\t\n\t\t# Check siding direction\n\t\tif (linear_vel.x < 0 && move_left):\n\t\t\tnew_siding_left = true\n\t\telif (linear_vel.x > 0 && move_right):\n\t\t\tnew_siding_left = false\n\t\t\n\t\t# Check jumping\n\t\tif (jumping):\n\t\t\t# Set the next animation\n\t\t\tnew_anim = \"jumping\"\n\t\t\n\t\t# Handling an idle player\n\t\telif (abs(linear_vel.x) < 0.1): # Using a 0.1 padding for when we consider the player to be idle\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"idle_weapon\"\n\t\t\telse:\n\t\t\t\tnew_anim = \"idle\"\n\t\t\n\t\t# The player is moving (not jumping)\n\t\telse:\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"run_weapon\"\n\t\t\telse:\n\t\t\t\tnew_anim = \"run\"\n\telse:\n\t\t# Process logic when the character is in the air\n\t\t# When we are only pressing LEFT movement\n\t\tif (move_left && !move_right):\n\t\t\tif (linear_vel.x > -WALK_MAX_VELOCITY):\n\t\t\t\t# linear_vel.x = -WALK_MAX_VELOCITY\n\t\t\t\tlinear_vel.x -= AIR_ACCEL*step\n\t\t\t\tif(linear_vel.x < -WALK_MAX_VELOCITY):\n\t\t\t\t\tlinear_vel.x = -WALK_MAX_VELOCITY\n\t\t\t\t\n\t\telif (move_right && !move_left):\n\t\t\tif (linear_vel.x < WALK_MAX_VELOCITY):\n\t\t\t\t# linear_vel.x = WALK_MAX_VELOCITY\n\t\t\t\tlinear_vel.x += AIR_ACCEL*step\n\t\t\t\tif(linear_vel.x > WALK_MAX_VELOCITY):\n\t\t\t\t\tlinear_vel.x = WALK_MAX_VELOCITY\n\t\telse:\n\t\t\t# Deaccelerate air movement (quickly for a smooth gameplay experience)\n\t\t\tvar x_vel = abs(linear_vel.x)\n\t\t\tx_vel -= AIR_DEACCEL*step\n\t\t\tif (x_vel < 0):\n\t\t\t\tx_vel = 0\n\t\t\tlinear_vel.x = sign(linear_vel.x)*x_vel\n\t\t\n\t\tif (linear_vel.y < 0):\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"jumping_weapon\"\n\t\t\telse:\n\t\t\t\tnew_anim = \"jumping\"\n\t\telse:\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"falling_weapon\"\n\t\t\t\n\t\t\telse:\n\t\t\t\tnew_anim = \"falling\"\n\t\n\t# Update siding\n\tif (new_siding_left != siding_left):\n\t\tif (new_siding_left):\n\t\t\tget_node(\"sprite\").set_scale(Vector2(-1, 1))\n\t\telse:\n\t\t\tget_node(\"sprite\").set_scale(Vector2(1, 1))\n\t\t\n\t\tsiding_left = new_siding_left\n\t\n\t# Change animation\n\tif (new_anim != anim):\n\t\tanim = new_anim\n\t\tget_node(\"anim\").play(anim)\n\t\n\tshooting = shoot\n\t\n\t# Apply floor velocity\n\tif (found_floor):\n\t\tfloor_h_velocity = s.get_contact_collider_velocity_at_pos(floor_index).x\n\t\tlinear_vel.x += floor_h_velocity\n\t\n\t# Finally, apply gravity and set back the linear velocity\n\tlinear_vel += s.get_total_gravity()*step\n\ts.set_linear_velocity(linear_vel)\n\t\n\n\nfunc _ready():\n\tset_process(true)\n\tenemy = ResourceLoader.load(\"res:\/\/scenes\/scn3-forest\/enemy.tscn\")\n\t# Update play time, has to go into a global function at some point\nfunc _process(delta):\n\tglobal.time_elapsed += delta\n\t#print(global.time_elapsed)\n\tif global.time_elapsed >= int(global.playtime_limit_seconds):\n\t\t#print(\"Time elpased!\")\n\t\t#show(Popup)\n\t\tglobal.time_elapsed = 0\n\n\n#\tif !Globals.has_singleton(\"Facebook\"):\n#\t\treturn\n#\tvar Facebook = Globals.get_singleton(\"Facebook\")\n#\tvar link = Globals.get(\"facebook\/link\")\n#\tvar icon = Globals.get(\"facebook\/icon\")\n#\tvar msg = \"I just sneezed on your wall! Beat my score and Stop the Running nose!\"\n#\tvar title = \"I just sneezed on your wall!\"\n#\tFacebook.post(\"feed\", msg, title, link, icon)\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"GDScript"} {"commit":"05e089cc2b9ce745c2d67bfe780c433132715777","subject":"use blockNodes and puzzle.shape for block node and pickled block management","message":"use blockNodes and puzzle.shape for block node and pickled block management\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/GridMan.gd","new_file":"src\/scripts\/GridMan.gd","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"mit","lang":"GDScript"} {"commit":"01022df3e4b706e9dbea6676afc6176d084f7cb0","subject":"Made sure, that dying enemies have their hp set to zero","message":"Made sure, that dying enemies have their hp set to zero\n","repos":"P1X-in\/rat-is-fat","old_file":"scripts\/object.gd","new_file":"scripts\/object.gd","new_contents":"var bag\n\nvar hp\nvar max_hp\n\nvar hit_protection = false\nvar is_invulnerable = false\nvar invulnerability_period = 0.5\n\nvar avatar\nvar is_processing = false\nvar initial_position = Vector2(0, 0)\nvar score = 100\n\nvar sounds = {\n 'attack' : null,\n 'die' : null,\n 'hit' : null,\n}\n\nfunc _init(bag):\n self.bag = bag\n self.max_hp = 5\n self.hp = 5\n\n\nfunc get_hp():\n return self.hp\n\nfunc set_hp(hp):\n if hp <= 0:\n self.hp = 0\n self.die()\n else:\n if hp <= self.max_hp:\n self.hp = hp\n else:\n self.hp = self.max_hp\n\nfunc get_pos():\n return self.avatar.get_pos()\n\nfunc get_screen_pos():\n var position = self.get_pos()\n var global_x = position.x \/ self.bag.camera.zoom.x\n var global_y = position.y \/ self.bag.camera.zoom.y\n return Vector2(global_x, global_y)\n\nfunc spawn(position):\n self.attach()\n self.initial_position = position\n self.avatar.set_pos(self.initial_position)\n\nfunc despawn():\n self.detach()\n\nfunc attach():\n self.is_processing = true\n self.bag.action_controller.attach_object(self.avatar)\n\nfunc detach():\n self.is_processing = false\n self.bag.action_controller.detach_object(self.avatar)\n\nfunc die():\n self.play_sound('die')\n self.is_processing = false\n self.despawn()\n\nfunc calculate_distance_to_object(moving_object):\n return self.calculate_distance(moving_object.get_pos())\n\nfunc calculate_distance(their_position):\n var my_position = self.get_pos()\n var delta_x = abs(my_position.x - their_position.x)\n var delta_y = abs(my_position.y - their_position.y)\n\n return sqrt(delta_x * delta_x + delta_y * delta_y)\n\nfunc recieve_damage(damage):\n if self.is_invulnerable:\n return\n\n self.play_sound('hit')\n self.set_hp(self.hp - damage)\n\n if self.hit_protection:\n self.is_invulnerable = true\n self.bag.timers.set_timeout(self.invulnerability_period, self, \"loose_invulnerability\")\n\n\nfunc loose_invulnerability():\n self.is_invulnerable = false\n\nfunc will_die(damage):\n return damage >= self.hp\n\nfunc play_sound(name):\n if self.sounds[name] != null:\n self.bag.sample_player.play(self.sounds[name])\n\nfunc make_invulnerable(duration=null):\n if duration == null:\n return\n self.is_invulnerable = true\n self.bag.timers.set_timeout(duration, self, \"remove_invulnerable\")\n\nfunc remove_invulnerable():\n self.is_invulnerable = false\n","old_contents":"var bag\n\nvar hp\nvar max_hp\n\nvar hit_protection = false\nvar is_invulnerable = false\nvar invulnerability_period = 0.5\n\nvar avatar\nvar is_processing = false\nvar initial_position = Vector2(0, 0)\nvar score = 100\n\nvar sounds = {\n 'attack' : null,\n 'die' : null,\n 'hit' : null,\n}\n\nfunc _init(bag):\n self.bag = bag\n self.max_hp = 5\n self.hp = 5\n\n\nfunc get_hp():\n return self.hp\n\nfunc set_hp(hp):\n if hp <= 0:\n self.die()\n else:\n if hp <= self.max_hp:\n self.hp = hp\n else:\n self.hp = self.max_hp\n\nfunc get_pos():\n return self.avatar.get_pos()\n\nfunc get_screen_pos():\n var position = self.get_pos()\n var global_x = position.x \/ self.bag.camera.zoom.x\n var global_y = position.y \/ self.bag.camera.zoom.y\n return Vector2(global_x, global_y)\n\nfunc spawn(position):\n self.attach()\n self.initial_position = position\n self.avatar.set_pos(self.initial_position)\n\nfunc despawn():\n self.detach()\n\nfunc attach():\n self.is_processing = true\n self.bag.action_controller.attach_object(self.avatar)\n\nfunc detach():\n self.is_processing = false\n self.bag.action_controller.detach_object(self.avatar)\n\nfunc die():\n self.play_sound('die')\n self.is_processing = false\n self.despawn()\n\nfunc calculate_distance_to_object(moving_object):\n return self.calculate_distance(moving_object.get_pos())\n\nfunc calculate_distance(their_position):\n var my_position = self.get_pos()\n var delta_x = abs(my_position.x - their_position.x)\n var delta_y = abs(my_position.y - their_position.y)\n\n return sqrt(delta_x * delta_x + delta_y * delta_y)\n\nfunc recieve_damage(damage):\n if self.is_invulnerable:\n return\n\n self.play_sound('hit')\n self.set_hp(self.hp - damage)\n\n if self.hit_protection:\n self.is_invulnerable = true\n self.bag.timers.set_timeout(self.invulnerability_period, self, \"loose_invulnerability\")\n\n\nfunc loose_invulnerability():\n self.is_invulnerable = false\n\nfunc will_die(damage):\n return damage >= self.hp\n\nfunc play_sound(name):\n if self.sounds[name] != null:\n self.bag.sample_player.play(self.sounds[name])\n\nfunc make_invulnerable(duration=null):\n if duration == null:\n return\n self.is_invulnerable = true\n self.bag.timers.set_timeout(duration, self, \"remove_invulnerable\")\n\nfunc remove_invulnerable():\n self.is_invulnerable = false\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"c9f442bf65cceb0f875a5d834fb3f5e0a89860f7","subject":"can turn off the timer now","message":"can turn off the timer now\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Puzzle.gd","new_file":"src\/scripts\/Puzzle.gd","new_contents":"extends Spatial\n\n# proposed script manager:\n# var PuzzleManScript = get_node(\"Globals\").get(\"PuzzleManScript\")\n\nvar DataMan = preload( \"res:\/\/scripts\/DataManager.gd\" ).new()\nvar PuzzleManScript = preload( \"res:\/\/scripts\/PuzzleManager.gd\" )\nvar PuzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar puzzleMan\nvar otherPuzzle\nvar mainPuzzle = true\n\nvar time = {\n\t\ton = true,\n\t\tval = 0.0,\n\t\tlabel = null,\n\t\ttween = null }\n\nfunc addTimer():\n\ttime.label = Label.new()\n\ttime.tween = Tween.new()\n\tadd_child(time.label)\n\tadd_child(time.tween)\n\ttime.label.set_pos(Vector2(15,15))\n\n\ttime.label.set_theme(load(\"res:\/\/themes\/MainTheme.thm\"))\n\ttime.tween.interpolate_method(time.label, \"set_pos\", \\\n\t\t\ttime.label.get_pos(), time.label.get_pos()*2, 0.5, \\\n\t\t\tTween.TRANS_BOUNCE, Tween.EASE_OUT)\n\ttime.tween.start()\n\ttime.label.set_text(str(time.val))\n\nfunc formatTime(t):\n\tvar mins = floor(t \/ 60)\n\tvar secs = fmod(floor(t), 60)\n\tvar millis = floor((t - floor(t)) * 1000)\n\treturn str(mins) + \":\" + str(secs).pad_zeros(2) + \":\" + str(millis).pad_zeros(3)\n\nfunc _process(dTime):\n\t# start label tween on\n\ttime.val += dTime\n\ttime.label.set_text(formatTime(time.val))\n\tif fmod(time.val, 10) < 0.1:\n\t\ttime.tween.seek(0.0)\n\n# Called for initialization\nfunc _ready():\n\tif time.on:\n\t\tset_process(true) # needed for time keeping\n\tpuzzleMan = PuzzleManScript.new()\n\tvar puzzle = puzzleMan.generatePuzzle( 2, puzzleMan.DIFF_EASY )\n\tpuzzle.puzzleMan = puzzleMan\n\n\tprint(\"Generated \", puzzle.blocks.size(), \" blocks.\" )\n\t\n\tprint( \"Saving...\" )\n\tDataMan.savePuzzle( \"TestPuzzle.pzl\", puzzle )\n\t\n\tpuzzle = 0\n\t\n\tpuzzle = DataMan.loadPuzzle( \"TestPuzzle.pzl\" )\n\t\n\tprint( puzzle.puzzleName )\n\tprint( puzzle.blocks.size() )\n\n\taddTimer()\n\n\t# Place the blocks in the puzzle.\n\tvar gridMan = get_node( \"GridView\/GridMan\" )\n\tgridMan.shape = puzzleMan.shape\n\tgridMan.set_puzzle(puzzle)\n\tfor block in puzzle.blocks:\n\t\t# Create a block node, add it to the tree\n\t\tvar b = block.toNode()\n\t\tgridMan.add_block(b)\n\t\tgridMan.get_child(block.name) \\\n\t\t\t.set_translation(block.blockPos * 2 )\n\n\t# make a new puzzle, embed using Viewport\n\tif mainPuzzle:\n\t\tvar p = PuzzleScn.instance()\n\t\tp.mainPuzzle = false\n\t\tp.set_scale(Vector3(0.5, 0.5, 0.5))\n\t\tp.set_translation(Vector3(20, 0, 0))\n\n\t\tvar v = Viewport.new()\n\t\tvar c = Control.new()\n\n\t\tv.set_world(p.get_world())\n\t\tv.set_rect(Rect2(0, 0, 100, 100))\n\t\tv.set_physics_object_picking(false)\n\t\tv.add_child(p)\n\t\tadd_child(c)\n\t\tc.add_child(v)\n\t\totherPuzzle = p #for use with network\n# child of control? easier input\n\n\n","old_contents":"extends Spatial\n\n# proposed script manager:\n# var PuzzleManScript = get_node(\"Globals\").get(\"PuzzleManScript\")\n\nvar DataMan = preload( \"res:\/\/scripts\/DataManager.gd\" ).new()\nvar PuzzleManScript = preload( \"res:\/\/scripts\/PuzzleManager.gd\" )\nvar PuzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar puzzleMan\nvar otherPuzzle\nvar mainPuzzle = true\n\nvar time = {\n\t\tval = 0.0,\n\t\tlabel = null,\n\t\ttween = null }\n\nfunc addTimer():\n\ttime.label = Label.new()\n\ttime.tween = Tween.new()\n\tadd_child(time.label)\n\tadd_child(time.tween)\n\ttime.label.set_pos(Vector2(15,15))\n\n\ttime.label.set_theme(load(\"res:\/\/themes\/MainTheme.thm\"))\n\ttime.tween.interpolate_method(time.label, \"set_pos\", \\\n\t\t\ttime.label.get_pos(), time.label.get_pos()*2, 0.5, \\\n\t\t\tTween.TRANS_BOUNCE, Tween.EASE_OUT)\n\ttime.tween.start()\n\ttime.label.set_text(str(time.val))\n\nfunc formatTime(t):\n\tvar mins = floor(t \/ 60)\n\tvar secs = fmod(floor(t), 60)\n\tvar millis = floor((t - floor(t)) * 1000)\n\treturn str(mins) + \":\" + str(secs).pad_zeros(2) + \":\" + str(millis).pad_zeros(3)\n\nfunc _process(dTime):\n\t# start label tween on\n\ttime.val += dTime\n\ttime.label.set_text(formatTime(time.val))\n\tif fmod(time.val, 10) < 0.1:\n\t\ttime.tween.seek(0.0)\n\n# Called for initialization\nfunc _ready():\n\tset_process(true) # needed for time keeping\n\tpuzzleMan = PuzzleManScript.new()\n\tvar puzzle = puzzleMan.generatePuzzle( 2, puzzleMan.DIFF_EASY )\n\tpuzzle.puzzleMan = puzzleMan\n\n\tprint(\"Generated \", puzzle.blocks.size(), \" blocks.\" )\n\t\n\tprint( \"Saving...\" )\n\tDataMan.savePuzzle( \"TestPuzzle.pzl\", puzzle )\n\t\n\tpuzzle = 0\n\t\n\tpuzzle = DataMan.loadPuzzle( \"TestPuzzle.pzl\" )\n\t\n\tprint( puzzle.puzzleName )\n\tprint( puzzle.blocks.size() )\n\n\taddTimer()\n\n\t# Place the blocks in the puzzle.\n\tvar gridMan = get_node( \"GridView\/GridMan\" )\n\tgridMan.shape = puzzleMan.shape\n\tgridMan.set_puzzle(puzzle)\n\tfor block in puzzle.blocks:\n\t\t# Create a block node, add it to the tree\n\t\tvar b = block.toNode()\n\t\tgridMan.add_block(b)\n\t\tgridMan.get_child(block.name) \\\n\t\t\t.set_translation(block.blockPos * 2 )\n\n\t# make a new puzzle, embed using Viewport\n\tif mainPuzzle:\n\t\tvar p = PuzzleScn.instance()\n\t\tp.mainPuzzle = false\n\t\tp.set_scale(Vector3(0.5, 0.5, 0.5))\n\t\tp.set_translation(Vector3(20, 0, 0))\n\n\t\tvar v = Viewport.new()\n\t\tvar c = Control.new()\n\n\t\tv.set_world(p.get_world())\n\t\tv.set_rect(Rect2(0, 0, 100, 100))\n\t\tv.set_physics_object_picking(false)\n\t\tv.add_child(p)\n\t\tadd_child(c)\n\t\tc.add_child(v)\n\t\totherPuzzle = p #for use with network\n# child of control? easier input\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"2fa5c51b9e3d73a76d54c159caf5a2259b19770f","subject":"gd \"G\u00e0idhlig\" translation #8984. Author: GunChleoc. Translated new strings. If you find the time to code this, 286 and 291 could do with proper plural forms. http:\/\/localization-guide.readthedocs.org\/en\/latest\/l10n\/pluralforms.html","message":"gd \"G\u00e0idhlig\" translation #8984. Author: GunChleoc. Translated new strings. If you find the time to code this, 286 and 291 could do with proper plural forms. http:\/\/localization-guide.readthedocs.org\/en\/latest\/l10n\/pluralforms.html\n","repos":"Unihedro\/lila,TangentialAlan\/lila,bjhaid\/lila,terokinnunen\/lila,abougouffa\/lila,arex1337\/lila,bjhaid\/lila,abougouffa\/lila,samuel-soubeyran\/lila,samuel-soubeyran\/lila,systemovich\/lila,luanlv\/lila,r0k3\/lila,terokinnunen\/lila,arex1337\/lila,danilovsergey\/i-bur,r0k3\/lila,TangentialAlan\/lila,samuel-soubeyran\/lila,pawank\/lila,ccampo133\/lila,r0k3\/lila,clarkerubber\/lila,bjhaid\/lila,arex1337\/lila,ccampo133\/lila,Enigmahack\/lila,arex1337\/lila,r0k3\/lila,clarkerubber\/lila,abougouffa\/lila,pavelo65\/lila,danilovsergey\/i-bur,Happy0\/lila,elioair\/lila,danilovsergey\/i-bur,JimmyMow\/lila,JimmyMow\/lila,systemovich\/lila,samuel-soubeyran\/lila,danilovsergey\/i-bur,abougouffa\/lila,Happy0\/lila,abougouffa\/lila,Unihedro\/lila,clarkerubber\/lila,Unihedro\/lila,elioair\/lila,samuel-soubeyran\/lila,clarkerubber\/lila,elioair\/lila,clarkerubber\/lila,Unihedro\/lila,systemovich\/lila,JimmyMow\/lila,Happy0\/lila,r0k3\/lila,r0k3\/lila,r0k3\/lila,pavelo65\/lila,bjhaid\/lila,arex1337\/lila,TangentialAlan\/lila,JimmyMow\/lila,terokinnunen\/lila,Enigmahack\/lila,arex1337\/lila,Happy0\/lila,pavelo65\/lila,bjhaid\/lila,luanlv\/lila,pavelo65\/lila,samuel-soubeyran\/lila,systemovich\/lila,terokinnunen\/lila,pawank\/lila,elioair\/lila,pawank\/lila,pawank\/lila,ccampo133\/lila,Enigmahack\/lila,elioair\/lila,Unihedro\/lila,TangentialAlan\/lila,Happy0\/lila,pavelo65\/lila,Happy0\/lila,samuel-soubeyran\/lila,Enigmahack\/lila,abougouffa\/lila,luanlv\/lila,JimmyMow\/lila,danilovsergey\/i-bur,elioair\/lila,systemovich\/lila,pawank\/lila,terokinnunen\/lila,danilovsergey\/i-bur,elioair\/lila,ccampo133\/lila,ccampo133\/lila,JimmyMow\/lila,Enigmahack\/lila,TangentialAlan\/lila,danilovsergey\/i-bur,systemovich\/lila,Enigmahack\/lila,terokinnunen\/lila,Unihedro\/lila,clarkerubber\/lila,Unihedro\/lila,luanlv\/lila,pavelo65\/lila,arex1337\/lila,pawank\/lila,luanlv\/lila,ccampo133\/lila,Happy0\/lila,pawank\/lila,Enigmahack\/lila,ccampo133\/lila,terokinnunen\/lila,JimmyMow\/lila,systemovich\/lila,clarkerubber\/lila,TangentialAlan\/lila,luanlv\/lila,abougouffa\/lila,bjhaid\/lila,bjhaid\/lila,TangentialAlan\/lila,pavelo65\/lila,luanlv\/lila","old_file":"conf\/messages.gd","new_file":"conf\/messages.gd","new_contents":"playWithAFriend=Cluich c\u00f2mhla ri caraid\ninviteAFriendToPlayWithYou=Thoir cuireadh do charaid gus cluich c\u00f2mhla riut\nplayWithTheMachine=Cluich an aghaidh a' choimpiutair\nchallengeTheArtificialIntelligence=Thoir ionnsaigh air an inntinn fhuadain\ntoInviteSomeoneToPlayGiveThisUrl=Gus cuireadh a thoirt do chuideigin, thoir an url seo dha\ngameOver=Cr\u00ecoch a\u2019 gheama\nwaitingForOpponent=A\u2019 feitheamh air n\u00e0mhaid\nwaiting=A\u2019 feitheamh\nyourTurn=An turas agad\naiNameLevelAiLevel=%s inbhe %s\nlevel=Inbhe\ntoggleTheChat=Toglaich a\u2019 chabadaich\ntoggleSound=Toglaich fuaim\nchat=Cabadaich\nresign=G\u00e8ill\ncheckmate=Tul-chasg\nstalemate=Clos-cluiche\nwhite=Geal\nblack=Dubh\nrandomColor=Dath air thuaiream\ncreateAGame=Cruthaich geama\nwhiteIsVictorious=Bhuannaich geal\nblackIsVictorious=Bhuannaich dubh\nplayWithTheSameOpponentAgain=Cluich an aghaidh an aon n\u00e0mhaid a-rithist\nnewOpponent=N\u00e0mhaid \u00f9r\nplayWithAnotherOpponent=Cluich an aghaidh n\u00e0mhaid eile\nyourOpponentWantsToPlayANewGameWithYou=Tha an n\u00e0mhaid agad airson geama \u00f9r a chluich \u2019nad aghaidh\njoinTheGame=Thig a-steach dhan gheama\nwhitePlays=Tha geal a\u2019 cluich\nblackPlays=Tha dubh a\u2019 cluich\ntheOtherPlayerHasLeftTheGameYouCanForceResignationOrWaitForHim=Tha an cluicheadair eile air a' gheama fh\u00e0gail. Is urrainn dhut g\u00e8illeadh a chur air, geama ionnannach a ghairm, no feitheamh air a shon.\nmakeYourOpponentResign=Cuir g\u00e8illeadh air an n\u00e0mhaid agad\nforceResignation=Gairm buaidh\nforceDraw=Gairm geama ionnannach\ntalkInChat=D\u00e8an cabadaich\ntheFirstPersonToComeOnThisUrlWillPlayWithYou=Cluichidh a\u2019 chiad neach a thig a-steach air an url seo c\u00f2mhla riut.\nwhiteCreatesTheGame=Tha geal a\u2019 cruthachadh a\u2019 gheama\nblackCreatesTheGame=Tha dubh a\u2019 cruthachadh a\u2019 gheama\nwhiteJoinsTheGame=Th\u00e0inig geal a-steach dhan gheama\nblackJoinsTheGame=Th\u00e0inig dubh a-steach dhan gheama\nwhiteResigned=Gh\u00e8ill geal\nblackResigned=Gh\u00e8ill dubh\nwhiteLeftTheGame=Dh\u2019fh\u00e0g geal an geama\nblackLeftTheGame=Dh\u2019fh\u00e0g dubh an geama\nshareThisUrlToLetSpectatorsSeeTheGame=Co-roinn an url seo gus luchd-amhairc a leigeil a-steach dhan gheama\nyouAreViewingThisGameAsASpectator=Tha thu a\u2019 coimhead air a\u2019 gheama seo \u2019nad neach-amhairc\nreplayAndAnalyse=Ath-chluich is sgr\u00f9daich\ncomputerAnalysisInProgress=Tha anailis a\u2019 choimpiutair a\u2019 dol\ntheComputerAnalysisHasFailed=Dh\u2019fh\u00e0illig le anailis a\u2019 choimpiutair\nviewTheComputerAnalysis=Seall anailis a\u2019 choimpiutair\nrequestAComputerAnalysis=Iarr anailis air a\u2019 choimpiutair\ncomputerAnalysis=Anailis a\u2019 choimpiutair\nblunders=Tuislidhean\nmistakes=Mearachdan\ninaccuracies=Neo-eagnaidhean\nmoveTimes=\u00d9ine nan gluasadan\nflipBoard=D\u00e8an flip air a\u2019 bh\u00f2rd\nthreefoldRepetition=Treas ath-nochdadh\nclaimADraw=Gairm geama ionnannach\nofferDraw=Tairg geama ionnannach\ndraw=Geama ionnannach\nnbConnectedPlayers=%s cluicheadairean\ngamesBeingPlayedRightNow=Geamannan a tha \u2019gan cluich an-dr\u00e0sta fh\u00e8in\nviewAllNbGames=%s geamannan\nviewNbCheckmates=%s tul-chaisg\nnbBookmarks=%s comharran-l\u00ecn\nnbPopularGames=%s geamannan m\u00f2r-ch\u00f2rdte\nnbAnalysedGames=%s geamannan sgr\u00f9daichte\nbookmarkedByNbPlayers=Comharra-leabhair le %s cluicheadairean\nviewInFullSize=Seall sa mheud iomlan\nlogOut=Log a-mach\nsignIn=Log a-steach\nnewToLichess=\u00d9r air Lichess?\nyouNeedAnAccountToDoThat=Tha feum agad air cunntas gus sin a dh\u00e8anamh\nsignUp=Cl\u00e0raich\ngames=Geamannan\nforum=B\u00f2rd-brath\nxPostedInForumY=Sgr\u00ecobh %s san fh\u00f2ram %s\nlatestForumPosts=Na postaichean as \u00f9ire\nplayers=Cluicheadairean\nminutesPerSide=Mionaidean gach taobh\nvariant=Caochladh\ntimeControl=Smachd air an \u00f9ine\ntime=\u00d9ine\nusername=Far-ainm\npassword=Facal-faire\nhaveAnAccount=A bheil cunntas agad?\nchangePassword=Atharraich am facal-faire\nallYouNeedIsAUsernameAndAPassword=Cha bhi feum agad ach air far-ainm \u2019s facal-faire\nlearnMoreAboutLichess=Ionnsaich barrachd mu Lichess\nrank=Inbhe\ngamesPlayed=Geamannan air an cluich\nnbGamesWithYou=%s geamannan c\u00f2mhla riut\ndeclineInvitation=Di\u00f9lt cuireadh\ncancel=Sguir dheth\ntimeOut=Dh\u2019fhalbh an \u00f9ine\ndrawOfferSent=Chaidh tairgse airson geama ionnanach a chur\ndrawOfferDeclined=Dhi\u00f9ltadh do thairgse airson geama ionnanach\ndrawOfferAccepted=Ghabhadh ri do thairgse airson geama ionnanach\ndrawOfferCanceled=Sguireadh de do thairgse airson geama ionnanach\nyourOpponentOffersADraw=Tha an n\u00e0mhaid agad a\u2019 tairgse geama ionnanach\naccept=Gabh ris\ndecline=Di\u00f9lt\nplayingRightNow=A\u2019 cluich an-dr\u00e0sta fh\u00e8in\nfinished=Cr\u00ecochnaichte\nabortGame=Stad an geama\ngameAborted=Chaidh sgur dhen gheama\nstandard=Coitcheann\nunlimited=Gun chr\u00ecoch\nmode=Modh\ncasual=Gun rangachadh\nrated=Rangaichte\nthisGameIsRated=Tha an geama seo rangaichte\nrematch=Ath-mhaids\nrematchOfferSent=Chaidh tairgse airson ath-mhaids a chur\nrematchOfferAccepted=Ghabhadh ri do thairgse airson ath-mhaids\nrematchOfferCanceled=Chaidh sgur dhe thairgse ath-mhaids\nrematchOfferDeclined=Tairgse ath-mhaids air a di\u00f9ltadh\ncancelRematchOffer=Sguir dhe thairgse ath-mhaids\nviewRematch=Seall an ath-mhaids\nplay=Cluich\ninbox=Bogsa a-steach\nchatRoom=Se\u00f2mar cabadaich\nspectatorRoom=Se\u00f2mar an luchd-amhairc\ncomposeMessage=Sgr\u00ecobh teachdaireachd\nnoNewMessages=Gun teachdaireachd \u00f9r\nsubject=Cuspair\nrecipient=Faightear\nsend=Cuir\nincrementInSeconds=Ioncramaid ann an diogan\nfreeOnlineChess=T\u00e0ileasg air loidhne an-asgaidh\nspectators=Luchd-amhairc:\nnbWins=Bhuannaich %s\nnbLosses=Chaill %s\nnbDraws=Geama ionnanach le %s\nexportGames=\u00c0s-phortaich geamannan\ncolor=Dath\nratingRange=Rainse an rangachaidh\ngiveNbSeconds=Thoir %s diogan\npremoveEnabledClickAnywhereToCancel=Ro-ghluasad an comas - briog \u00e0ite sam bith airson sgur dheth\nthisPlayerUsesChessComputerAssistance=Tha an cluicheadair seo a\u2019 cleachdadh taic coimpiutair taileisg\nopening=Fosgladh\ntakeback=Tarraing air ais\nproposeATakeback=Tairg tarraing air ais\ntakebackPropositionSent=Tairgse tarraing air ais air a cur\ntakebackPropositionDeclined=Tairgse tarraing air ais air a di\u00f9ltadh\ntakebackPropositionAccepted=Air gabhail ri tairgse tarraing air ais\ntakebackPropositionCanceled=Chaidh sgur dhe thairgse tarraing air ais\nyourOpponentProposesATakeback=Tha an n\u00e0mhaid a\u2019 tairgse tarraing air ais\nbookmarkThisGame=Cruthaich comharra-l\u00ecn airson a\u2019 gheama seo.\ntoggleBackground=Toglaich dath a\u2019 ch\u00f9laibh\nsearch=Lorg\nadvancedSearch=Lorg adhartach\ntournament=F\u00e8ill-chluich\ntournaments=F\u00e8ill-chluichean\ntournamentPoints=Puingean f\u00e8ill-chluich\nviewTournament=Seall an fh\u00e8ill-chluich\nbackToTournament=Till dhan fh\u00e8ill-chluich\nxTournament=F\u00e8ill-chluich %s\nfreeOnlineChessGamePlayChessNowInACleanInterfaceNoRegistrationNoAdsNoPluginRequiredPlayChessWithComputerFriendsOrRandomOpponents=T\u00e0ileasg air loidhne an-asgaidh. Cluich t\u00e0ileasg ann am pr\u00f2gram air a bheil dreach glan. Gun chl\u00e0radh, gun sanasachd, gun fheum air plugan. Cluich t\u00e0ileasg an aghaidh a\u2019 choimpiutair, charaidean no n\u00e0imhdean air thuaiream.\nteams=Sgiobaidhean\nnbMembers=%s ball\nallTeams=A h-uile sgioba\nnewTeam=Sgioba \u00f9r\nmyTeams=Na sgiobaidhean agam\nnoTeamFound=Cha deach sgioba a lorg\njoinTeam=Gabh p\u00e0irt san sgioba\nquitTeam=F\u00e0g an sgioba\nanyoneCanJoin=Faodaidh duine sam bith p\u00e0irt a ghabhail ann\naConfirmationIsRequiredToJoin=Tha feum air dearbhadh gus p\u00e0irt a ghabhail ann\njoiningPolicy=Poileasaidh na ballrachd\nteamLeader=Ceannard an sgioba\nteamBestPlayers=Na cluicheadairean as fhearr\nteamRecentMembers=Na buill as \u00f9ire\nxJoinedTeamY=Ghabh %s ballrachd san sgioba %s\nxCreatedTeamY=Chruthaich %s an sgioba %s\naverageElo=Rangachadh cuibheasach\nlocation=\u00c0ite\nsettings=Roghainnean\nfilterGames=Criathraich na geamannan\nreset=Ath-shuidhich\napply=Cuir an s\u00e0s\nleaderboard=Cl\u00e0r nan curaidh\npasteTheFenStringHere=Cuir a-steach an t-sreang FEN an-seo\npasteThePgnStringHere=Cuir a-steach an t-sreang PGN an-seo\nfromPosition=On t-suidheachadh\ncontinueFromHere=Lean air adhart on a sheo\nimportGame=Ion-phortaich geama\nnbImportedGames=%s geamannan air an ion-phortadh\nthisIsAChessCaptcha=Seo CAPTCHA t\u00e0ileisg.\nclickOnTheBoardToMakeYourMove=Briog air a\u2019 bh\u00f2rd airson gluasad \u2019s dearbhaich gur e duine a th\u2019 annad.\nnotACheckmate=Chan e tul-chasg a th\u2019 ann\ncolorPlaysCheckmateInOne=Tha %s a\u2019 cluich; tul-chasg an ceann gluasaid\nretry=Feuch ris a-rithist\nreconnecting=Ag ath-cheangal\nonlineFriends=Caraidean air loidhne\nnoFriendsOnline=Chan eil caraid air loidhne\nfindFriends=Lorg caraidean\nfavoriteOpponents=Na farpaisichean as annsa leat\nfollow=Lean air\nfollowing=A\u2019 leantainn air\nunfollow=Na lean air tuilleadh\nblock=Bac\nblocked=Bacte\nunblock=D\u00ec-bhac\nfollowsYou=\u2019Gad leantainn\nxStartedFollowingY=Th\u00f2isich %s a\u2019 leantainn air %s\nnbFollowers=%s luchd-leantainn\nnbFollowing=%s \u2019ga leantainn\nmore=Barrachd\nmemberSince=Ball o chionn\nlastLogin=An logadh a-steach mu dheireadh\nchallengeToPlay=Thoir d\u00f9bhlan cluiche dha\nplayer=Cluicheadair\nlist=Liosta\ngraph=Graf\nlessThanNbMinutes=Nas lugha na %s mionaidean\nxToYMinutes=%s gu %s mionaidean\ntextIsTooShort=Tha an teacsa ro ghoirid.\ntextIsTooLong=Tha an teacsa ro fhada.\nrequired=Riatanach.\naddToChrome=Cuir ri Chrome\nopenTournaments=F\u00e8ill-chluichean fosgailte\nduration=Faid\nwinner=Buannaiche\nstanding=A\u2019 seasamh\ncreateANewTournament=Cruthaich f\u00e8ill-chluich \u00f9r\njoin=Gabh p\u00e0irt ann\nwithdraw=C\u00f9laich\npoints=Puingean\nwins=Buaidhean\nlosses=Ruaigean\nwinStreak=Sreath de bhuaidhean\ncreatedBy=Air a chruthachadh le\nwaitingForNbPlayers=A\u2019 feitheamh air %s cluicheadairean\ntournamentIsStarting=Tha an fh\u00e8ill-chluich gu bhith t\u00f2iseachadh\nnbMinutesPerSidePlusNbSecondsPerMove=%s mionaidean\/taobh + %s diogan\/gluasad\nmembersOnly=Buill a-mh\u00e0in\nstartPosition=Suidheachadh an t\u00f2iseachaidh\nboardEditor=Deasaiche a\u2019 bh\u00f9ird\nclearBoard=Falamhaich am b\u00f2rd\nloadPosition=Luchdaich suidheachadh\nsavePosition=S\u00e0bhail an suidheachadh\nisPrivate=Pr\u00ecobhaideach\nreportXToModerators=Cuir gearan mu %s dha na maoir\nprofile=Pr\u00f2ifil\neditProfile=Deasaich a\u2019 phr\u00f2ifil\nfirstName=Ainm\nlastName=Sloinneadh\nbiography=Eachdraidh-beatha\ncountry=D\u00f9thaich\npreferences=Roghainnean\nwatchLichessTV=Coimhead air TBh Lichess\npreviouslyOnLichessTV=Air Tbh Lichess roimhe\ntodaysLeaders=S\u00e0r-chluicheadairean an-diugh\nonlinePlayers=Cluicheadairean air loidhne\nprogressToday=Adhartas an-diugh\nprogressThisWeek=Adhartas an seachdain seo\nprogressThisMonth=Adhartas am m\u00ecos seo\nleaderboardThisWeek=S\u00e0r-chluicheadairean na seachdaine\nleaderboardThisMonth=S\u00e0r-chluicheadairean a\u2019 mh\u00ecosa\nactiveToday=Gn\u00ecomhach an-diugh\nactiveThisWeek=Gn\u00ecomhach an seachdain seo\nactivePlayers=Cluicheadairean gn\u00ecomhach\nbestBulletPlayers=Na cluicheadairean bullet as fhearr\nbestBlitzPlayers=Na cluicheadairean blitz as fhearr\nbestSlowPlayers=Na cluicheadairean slow as fhearr\nbewareTheGameIsRatedButHasNoClock=Thoir an aire, th\u00e8id an geama seo rangachadh ach chan eil uaireadair aige!\ntraining=Tr\u00e8anadh\nyourPuzzleRatingX=An rangachadh agad: %s\nfindTheBestMoveForWhite=Lorg an gluasad as fhearr airson geal.\nfindTheBestMoveForBlack=Lorg an gluasad as fhearr airson dubh.\ntoTrackYourProgress=Gus s\u00f9il a chumail air d\u2019 adhartas:\ntrainingSignupExplanation=Bheir Lichess t\u00f2imhseachain dhut a bhios freagarrach dhan chomas agad ach am faigh thu tr\u00e8anadh as iomchaidh.\nrecentlyPlayedPuzzles=T\u00f2imhseachain o chionn goirid\npuzzleId=T\u00f2imhseachan %s\npuzzleOfTheDay=T\u00f2imhseachan an latha\nclickToSolve=Briog an-seo airson fhuasgladh\ngoodMove=Seo gluasad math\nbutYouCanDoBetter=Ach tha gluasad nas fhearr ann.\nbestMove=Seo an gluasad as fhearr!\nkeepGoing=Cum ort...\npuzzleFailed=Cha deach leat\nbutYouCanKeepTrying=Ach faodaidh tu feuchainn a-rithist.\nvictory=Buaidh!\ngiveUp=Thoir g\u00e8ill\npuzzleSolvedInXSeconds=Rinn thu a\u2019 ch\u00f9is air an ceann %s diog.\nwasThisPuzzleAnyGood=An robh an t\u00f2imhseachan seo math?\npleaseVotePuzzle=Cuidich lichess \u2019s cuir bh\u00f2t ann leis an t-saighead suas no s\u00ecos:\nthankYou=M\u00f2ran taing!\nratingX=Rangachadh: %s\nplayedXTimes=Air a chluich %s turas\nfromGameLink=On gheama %s\nstartTraining=T\u00f2isich air an tr\u00e8anadh\ncontinueTraining=Lean air adhart leis an tr\u00e8anadh\nretryThisPuzzle=Feuch ris an t\u00f2imhseachan seo a-rithist\nthisPuzzleIsCorrect=Tha an t\u00f2imhseachan seo ceart is inntinneach\nthisPuzzleIsWrong=Tha an t\u00f2imhseachan seo cearr no d\u00f2rainneach\n","old_contents":"playWithAFriend=Cluich c\u00f2mhla ri caraid\ninviteAFriendToPlayWithYou=Thoir cuireadh do charaid gus cluich c\u00f2mhla riut\nplayWithTheMachine=Cluich an aghaidh a' choimpiutair\nchallengeTheArtificialIntelligence=Thoir ionnsaigh air an inntinn fhuadain\ntoInviteSomeoneToPlayGiveThisUrl=Gus cuireadh a thoirt do chuideigin, thoir an url seo seachad\ngameOver=Cr\u00ecoch a\u2019 gheama\nwaitingForOpponent=A\u2019 feitheamh air n\u00e0mhaid\nwaiting=A\u2019 feitheamh\nyourTurn=An turas agad\naiNameLevelAiLevel=%s inbhe %s\nlevel=Inbhe\ntoggleTheChat=Toglaich a\u2019 chabadaich\ntoggleSound=Toglaich fuaim\nchat=Cabadaich\nresign=G\u00e8ill\ncheckmate=Tul-chasg\nstalemate=Clos-cluiche\nwhite=Geal\nblack=Dubh\ncreateAGame=Cruthaich geama\nwhiteIsVictorious=Bhuannaich geal\nblackIsVictorious=Bhuannaich dubh\nplayWithTheSameOpponentAgain=Cluich an aghaidh an aon n\u00e0mhaid a-rithist\nnewOpponent=N\u00e0mhaid \u00f9r\nplayWithAnotherOpponent=Cluich an aghaidh n\u00e0mhaid eile\nyourOpponentWantsToPlayANewGameWithYou=Tha an n\u00e0mhaid agad airson geama \u00f9r a chluich c\u00f2mhla riut\njoinTheGame=Thig a-steach dhan gheama\nwhitePlays=Tha geal a\u2019 cluich\nblackPlays=Tha dubh a\u2019 cluich\ntheOtherPlayerHasLeftTheGameYouCanForceResignationOrWaitForHim=Tha an geamaiche eile air a' gheama fh\u00e0gail. Is urrainn dhut g\u00e8illeadh a chur air, geama ionnannach a ghairm, no feitheamh air a shon.\nmakeYourOpponentResign=Cuir g\u00e8illeadh air an n\u00e0mhaid agad\nforceResignation=Cuir g\u00e8illeadh air an n\u00e0mhaid agad\nforceDraw=Gairm geama ionnannach\ntalkInChat=D\u00e8an cabadaich\ntheFirstPersonToComeOnThisUrlWillPlayWithYou=Cluichidh a\u2019 chiad neach a thig a-steach air an url seo c\u00f2mhla riut.\nwhiteCreatesTheGame=Tha geal a\u2019 cruthachadh a\u2019 gheama\nblackCreatesTheGame=Tha dubh a\u2019 cruthachadh a\u2019 gheama\nwhiteJoinsTheGame=Th\u00e0inig geal a-steach dhan gheama\nblackJoinsTheGame=Th\u00e0inig dubh a-steach dhan gheama\nwhiteResigned=Gh\u00e8ill geal\nblackResigned=Gh\u00e8ill dubh\nwhiteLeftTheGame=Dh\u2019fh\u00e0g geal an geama\nblackLeftTheGame=Dh\u2019fh\u00e0g dubh an geama\nshareThisUrlToLetSpectatorsSeeTheGame=Co-roinn an url seo gus luchd-amhairc a leigeil a-steach dhan gheama\nyouAreViewingThisGameAsASpectator=Tha thu a\u2019 coimhead air a\u2019 gheama seo nad neach-amhairc\nreplayAndAnalyse=Ath-chluich is sgr\u00f9daich\ncomputerAnalysisInProgress=Tha anailis a' choimpiutair a' dol\ntheComputerAnalysisHasFailed=Dh'fh\u00e0illig le anailis a' choimpiutair\nviewTheComputerAnalysis=Seall anailis a' choimpiutair\nrequestAComputerAnalysis=Iarr anailis a' choimpiutair\nblunders=Tuislidhean\nmistakes=Mearachdan\ninaccuracies=Neo-eagnaidhean\nflipBoard=D\u00e8an flip air a\u2019 bh\u00f2rd\nthreefoldRepetition=Treas ath-nochdadh\nclaimADraw=Tagair geama ionnannach\nofferDraw=Tairg geama ionnannach\ndraw=Geama ionnannach\nnbConnectedPlayers=Tha %s geamaichean ceangailte\ngamesBeingPlayedRightNow=Geamaichean a tha gan cluich an-dr\u00e0sta fh\u00e8in\nviewAllNbGames=Seall air a h-uile %s de na geamaichean\nviewNbCheckmates=Seall na chur %s de thul-chasg\nnbBookmarks=%s Comharran-l\u00ecn\nnbPopularGames=%s geamannan m\u00f2r-ch\u00f2rdte\nnbAnalysedGames=%s geamannan sgr\u00f9daichte\nbookmarkedByNbPlayers=Comharra-leabhair le %s cluicheadairean\nviewInFullSize=Seall sa mheud iomlan\nlogOut=Log a-mach\nsignIn=Log a-steach\nnewToLichess=\u00d9r air Lichess?\nyouNeedAnAccountToDoThat=Tha feum agad air cunntas gus sin a dh\u00e8anamh\nsignUp=Cl\u00e0raich\ngames=Geamannan\nforum=B\u00f2rd-brath\nxPostedInForumY=Sgr\u00ecobh %s san fh\u00f2ram %s\nplayers=Geamaichean t\u00e0ileisg\nminutesPerSide=Mionaidean an taobh\nvariant=Caochladh\ntimeControl=Smachdadh-\u00f9ine\ntime=\u00d9ine\nusername=Far-ainm\npassword=Facal-faire\nhaveAnAccount=A bheil cunntas agad?\nallYouNeedIsAUsernameAndAPassword=Chan eil a dh\u00ecth ort ach far-ainm agus facal-faire\nlearnMoreAboutLichess=Ionnsaich barrachd mu lichess\nrank=Inbhe\ngamesPlayed=Geamannan air an cluich\nnbGamesWithYou=%s geamannan c\u00f2mhla riut\ndeclineInvitation=Di\u00f9lt cuireadh\ncancel=Sguir dheth\ntimeOut=Dh\u2019fhalbh an \u00f9ine\ndrawOfferSent=Chaidh tairgse airson geama ionnanach a chur\ndrawOfferDeclined=Dhi\u00f9ltadh do thairgse airson geama ionnanach\ndrawOfferAccepted=Ghabhadh ri do thairgse airson geama ionnanach\ndrawOfferCanceled=Sguireadh de do thairgse airson geama ionnanach\nyourOpponentOffersADraw=Tha an n\u00e0mhaid agad a\u2019 tairgse geama ionnanach\naccept=Gabh ris\ndecline=Di\u00f9lt\nplayingRightNow=A\u2019 cluich an-dr\u00e0sta fh\u00e8in\nfinished=Cr\u00ecochnaichte\nabortGame=Stad an geama\ngameAborted=Chaidh an geama a stad\nstandard=Coitcheann\nunlimited=Gun chr\u00ecoch\nmode=Modh\ncasual=Gun rangachadh\nrated=Rangaichte\nthisGameIsRated=Tha an geama seo rangaichte\nrematch=Ath-mhaids\nrematchOfferSent=Chaidh tairgse airson ath-chluich a chur\nrematchOfferAccepted=Ghabhadh ri do thairgse airson ath-chluich\nrematchOfferCanceled=Chaidh sgur dhe thairgse ath-mhaids\nrematchOfferDeclined=Tairgse ath-mhaids air a di\u00f9ltadh\ncancelRematchOffer=Sguir dhe thairgse ath-mhaids\nviewRematch=Seall air ath-mhaids\nplay=Cluich\ninbox=Bogsa a-steach\nchatRoom=Se\u00f2mar cabadaich\nspectatorRoom=Se\u00f2mar amhairc\ncomposeMessage=Sgr\u00ecobh teachdaireachd\nnoNewMessages=Gun teachdaireachd \u00f9r\nsubject=Cuspair\nrecipient=Faightear\nsend=Cuir\nincrementInSeconds=Ioncramaid ann an diogan\nfreeOnlineChess=T\u00e0ileasg air loidhne an asgaidh\nspectators=Luchd-amhairc:\nnbWins=Bhuannaich %s\nnbLosses=Chaill %s\nnbDraws=Geama ionnanach le %s\nexportGames=\u00c0s-phortaich geamannan\nratingRange=Rainse Elo\ngiveNbSeconds=Thoir %s diog(an)\npremoveEnabledClickAnywhereToCancel=Ro-ghluasad an comas - d\u00e8an briogadh \u00e0ite sam bith gus sgur dheth\nthisPlayerUsesChessComputerAssistance=Tha an cluicheadair seo a\u2019 cleachdadh taic coimpiutair taileisg\nopening=Fosgladh\ntakeback=Tarraing air ais\nproposeATakeback=Tairg tarraing air ais\ntakebackPropositionSent=Tairgse tarraing air ais air a cur\ntakebackPropositionDeclined=Tairgse tarraing air ais air a di\u00f9ltadh\ntakebackPropositionAccepted=Air gabhail ri tairgse tarraing air ais\ntakebackPropositionCanceled=Chaidh sgur dhe thairgse tarraing air ais\nyourOpponentProposesATakeback=Tha am farpaiseach a\u2019 tairgse tarraing air ais\nbookmarkThisGame=Cruthaich comharra-l\u00ecn airson an geama seo.\nsearch=Lorg\nadvancedSearch=Lorg adhartach\ntournament=F\u00e8ill-chluich\ntournaments=F\u00e8ill-chluichean\ntournamentPoints=Puingean f\u00e8ill-chluich\nviewTournament=Seall an fh\u00e8ill-chluich\nfreeOnlineChessGamePlayChessNowInACleanInterfaceNoRegistrationNoAdsNoPluginRequiredPlayChessWithComputerFriendsOrRandomOpponents=T\u00e0ileasg air loidhne an asgaidh. Cluich t\u00e0ileasg ann am pr\u00f2gram air a bheil dreach glan. Gun chl\u00e0radh, gun sanasachd, gun fheum air plugan. Cluich t\u00e0ileasg an aghaidh a\u2019 choimpiutair, charaidean no n\u00e0imhdean air thuaiream.\nteams=Sgiobaidhean\nnbMembers=%s ball\nallTeams=A h-uile sgioba\nnewTeam=Sgioba \u00f9r\nmyTeams=Na sgiobaidhean agam\nnoTeamFound=Cha deach sgioba a lorg\njoinTeam=Gabh sa sgioba\nquitTeam=F\u00e0g an sgioba\nanyoneCanJoin=Faodaidh duine sam bith a ghabhail ann\naConfirmationIsRequiredToJoin=Tha dearbhadh a dh\u00ecth gus gabhail ann\njoiningPolicy=Poileasaidh gabhail ann\nteamLeader=Ceannard an sgioba\nteamBestPlayers=Ar cluicheadairean as fhearr\nteamRecentMembers=Ar buill as \u00f9ire\nxJoinedTeamY=Ghabh %s sa sgioba %s\nxCreatedTeamY=Chruthaich %s an sgioba %s\naverageElo=Elo cuibheasach\nlocation=\u00c0ite\nsettings=Roghainnean\nfilterGames=Criathraich na geamannan\nreset=Ath-shuidhich\napply=Cuir an s\u00e0s\nleaderboard=Cl\u00e0r na l\u00ecge\npasteTheFenStringHere=Cuir a-steach an t-sreang FEN an-seo\npasteThePgnStringHere=Cuir a-steach an t-sreang PGN an-seo\nfromPosition=On ionad\ncontinueFromHere=Lean air adhart on a sheo\nimportGame=Ion-phortaich geama\nnbImportedGames=%s geama(ichean) air ion-phortadh\nthisIsAChessCaptcha=Seo CAPTCHA t\u00e0ileisg.\nclickOnTheBoardToMakeYourMove=Briog air a' bh\u00f2rd airson gluasad is dearbhaich gur e duine a th' annad.\nnotACheckmate=Chan e tul-chasg a th' ann\ncolorPlaysCheckmateInOne=Tha %s a' cluich; tul-chasg an ceann gluasaid\nretry=Feuch ris a-rithist\nreconnecting=Ag ath-cheangal\nonlineFriends=Caraidean air loidhne\nnoFriendsOnline=Chan eil caraid air loidhne\nfindFriends=Lorg caraidean\nfavoriteOpponents=Na farpaisichean as annsa leat\nfollow=Lean air\nfollowing=A' leantainn air\nunfollow=Na lean air tuilleadh\nblock=Bac\nblocked=Bacte\nunblock=D\u00ec-bhac\nfollowsYou='Gad leantainn\nxStartedFollowingY=Th\u00f2isich %s a' leantainn air %s\nnbFollowers=%s luchd-leantainn\nnbFollowing=%s ga leantainn\nmore=Barrachd\nmemberSince=Ball os cionn\nlastLogin=An logadh a-steach mu dheireadh\nchallengeToPlay=Thoir d\u00f9bhlan cluiche dha\nplayer=Cluicheadair\nlist=Liosta\ngraph=Graf\nlessThanNbMinutes=Nas lugha na %s mionaidean\nxToYMinutes=%s gu %s mionaidean\ntextIsTooShort=Tha an teacsa ro ghoirid.\ntextIsTooLong=Tha an teacsa ro fhada.\nrequired=Riatanach.\naddToChrome=Cuir ri Chrome\nopenTournaments=F\u00e8ill-chluichean fosgailte\nduration=Faid\nwinner=Buannaiche\nstanding=A' seasamh\ncreateANewTournament=Cruthaich f\u00e8ill-chluich \u00f9r\njoin=Gabh p\u00e0irt ann\nwithdraw=C\u00f9laich\npoints=Puingean\nwins=Buaidhean\nlosses=Ruaigean\nwinStreak=Sreath de bhuaidhean\ncreatedBy=Air a chruthachadh le\nwaitingForNbPlayers=A' feitheamh air %s cluicheadairean\ntournamentIsStarting=Tha an fh\u00e8ill-chluich a' t\u00f2iseachadh\nnbMinutesPerSidePlusNbSecondsPerMove=%s mionaidean\/taobh + %s diog\/gluasad\nmembersOnly=Buill a-mh\u00e0in\nboardEditor=Deasaiche a' bh\u00f9ird\nclearBoard=Falamhaich am b\u00f2rd\nsavePosition=S\u00e0bhail an t-ionad\nisPrivate=Pr\u00ecobhaideach\nprofile=Pr\u00f2ifil\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"fc032119cadeda49614b6ec36456b084e389d502","subject":"Added interpolation functionality to ik_look_at node (#585)","message":"Added interpolation functionality to ik_look_at node (#585)\n\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"3d\/ik\/addons\/sade\/ik_look_at.gd","new_file":"3d\/ik\/addons\/sade\/ik_look_at.gd","new_contents":"tool\nextends Spatial\n\nexport(NodePath) var skeleton_path setget _set_skeleton_path\nexport(String) var bone_name = \"\"\nexport(int, \"_process\", \"_physics_process\", \"_notification\", \"none\") var update_mode = 0 setget _set_update\nexport(int, \"X-up\", \"Y-up\", \"Z-up\") var look_at_axis = 1\nexport(float, 0.0, 1.0, 0.001) var interpolation = 1.0\nexport(bool) var use_our_rotation_x = false\nexport(bool) var use_our_rotation_y = false\nexport(bool) var use_our_rotation_z = false\nexport(bool) var use_negative_our_rot = false\nexport(Vector3) var additional_rotation = Vector3()\nexport(bool) var position_using_additional_bone = false\nexport(String) var additional_bone_name = \"\"\nexport(float) var additional_bone_length = 1\nexport(bool) var debug_messages = false\n\nvar skeleton_to_use: Skeleton = null\nvar first_call: bool = true\nvar _editor_indicator: Spatial = null\n\n\nfunc _ready():\n\tset_process(false)\n\tset_physics_process(false)\n\tset_notify_transform(false)\n\n\tif update_mode == 0:\n\t\tset_process(true)\n\telif update_mode == 1:\n\t\tset_physics_process(true)\n\telif update_mode == 2:\n\t\tset_notify_transform(true)\n\telse:\n\t\tif debug_messages:\n\t\t\tprint(name, \" - IK_LookAt: Unknown update mode. NOT updating skeleton\")\n\n\tif Engine.editor_hint:\n\t\t_setup_for_editor()\n\n\nfunc _process(_delta):\n\tupdate_skeleton()\n\n\nfunc _physics_process(_delta):\n\tupdate_skeleton()\n\n\nfunc _notification(what):\n\tif what == NOTIFICATION_TRANSFORM_CHANGED:\n\t\tupdate_skeleton()\n\n\nfunc update_skeleton():\n\t# NOTE: Because get_node doesn't work in _ready, we need to skip\n\t# a call before doing anything.\n\tif first_call:\n\t\tfirst_call = false\n\t\tif skeleton_to_use == null:\n\t\t\t_set_skeleton_path(skeleton_path)\n\n\n\t# If we do not have a skeleton and\/or we're not supposed to update, then return.\n\tif skeleton_to_use == null:\n\t\treturn\n\tif update_mode >= 3:\n\t\treturn\n\n\t# Get the bone index.\n\tvar bone: int = skeleton_to_use.find_bone(bone_name)\n\n\t# If no bone is found (-1), then return and optionally printan error.\n\tif bone == -1:\n\t\tif debug_messages:\n\t\t\tprint(name, \" - IK_LookAt: No bone in skeleton found with name [\", bone_name, \"]!\")\n\t\treturn\n\n\t# get the bone's global transform pose.\n\tvar rest = skeleton_to_use.get_bone_global_pose(bone)\n\n\t# Convert our position relative to the skeleton's transform.\n\tvar target_pos = skeleton_to_use.global_transform.xform_inv(global_transform.origin)\n\n\t# Call helper's look_at function with the chosen up axis.\n\tif look_at_axis == 0:\n\t\trest = rest.looking_at(target_pos, Vector3.RIGHT)\n\telif look_at_axis == 1:\n\t\trest = rest.looking_at(target_pos, Vector3.UP)\n\telif look_at_axis == 2:\n\t\trest = rest.looking_at(target_pos, Vector3.FORWARD)\n\telse:\n\t\trest = rest.looking_at(target_pos, Vector3.UP)\n\t\tif debug_messages:\n\t\t\tprint(name, \" - IK_LookAt: Unknown look_at_axis value!\")\n\n\t# Get the rotation euler of the bone and of this node.\n\tvar rest_euler = rest.basis.get_euler()\n\tvar self_euler = global_transform.basis.orthonormalized().get_euler()\n\n\t# Flip the rotation euler if using negative rotation.\n\tif use_negative_our_rot:\n\t\tself_euler = -self_euler\n\n\t# Apply this node's rotation euler on each axis, if wanted\/required.\n\tif use_our_rotation_x:\n\t\trest_euler.x = self_euler.x\n\tif use_our_rotation_y:\n\t\trest_euler.y = self_euler.y\n\tif use_our_rotation_z:\n\t\trest_euler.z = self_euler.z\n\n\t# Make a new basis with the, potentially, changed euler angles.\n\trest.basis = Basis(rest_euler)\n\n\t# Apply additional rotation stored in additional_rotation to the bone.\n\tif additional_rotation != Vector3.ZERO:\n\t\trest.basis = rest.basis.rotated(rest.basis.x, deg2rad(additional_rotation.x))\n\t\trest.basis = rest.basis.rotated(rest.basis.y, deg2rad(additional_rotation.y))\n\t\trest.basis = rest.basis.rotated(rest.basis.z, deg2rad(additional_rotation.z))\n\n\t# If the position is set using an additional bone, then set the origin\n\t# based on that bone and its length.\n\tif position_using_additional_bone:\n\t\tvar additional_bone_id = skeleton_to_use.find_bone(additional_bone_name)\n\t\tvar additional_bone_pos = skeleton_to_use.get_bone_global_pose(additional_bone_id)\n\t\trest.origin = additional_bone_pos.origin - additional_bone_pos.basis.z.normalized() * additional_bone_length\n\n\t# Finally, apply the new rotation to the bone in the skeleton.\n\tskeleton_to_use.set_bone_global_pose_override(bone, rest, interpolation, true)\n\n\nfunc _setup_for_editor():\n\t# To see the target in the editor, let's create a MeshInstance,\n\t# add it as a child of this node, and name it.\n\t_editor_indicator = MeshInstance.new()\n\tadd_child(_editor_indicator)\n\t_editor_indicator.name = \"(EditorOnly) Visual indicator\"\n\n\t# Make a sphere mesh for the MeshInstance\n\tvar indicator_mesh = SphereMesh.new()\n\tindicator_mesh.radius = 0.1\n\tindicator_mesh.height = 0.2\n\tindicator_mesh.radial_segments = 8\n\tindicator_mesh.rings = 4\n\n\t# Create a new SpatialMaterial for the sphere and give it the editor\n\t# gizmo texture so it is textured.\n\tvar indicator_material = SpatialMaterial.new()\n\tindicator_material.flags_unshaded = true\n\tindicator_material.albedo_texture = preload(\"editor_gizmo_texture.png\")\n\tindicator_material.albedo_color = Color(1, 0.5, 0, 1)\n\n\t# Assign the material and mesh to the MeshInstance.\n\tindicator_mesh.material = indicator_material\n\t_editor_indicator.mesh = indicator_mesh\n\n\nfunc _set_update(new_value):\n\tupdate_mode = new_value\n\n\t# Set all of our processes to false.\n\tset_process(false)\n\tset_physics_process(false)\n\tset_notify_transform(false)\n\n\t# Based on the value of passed to update, enable the correct process.\n\tif update_mode == 0:\n\t\tset_process(true)\n\t\tif debug_messages:\n\t\t\tprint(name, \" - IK_LookAt: updating skeleton using _process...\")\n\telif update_mode == 1:\n\t\tset_physics_process(true)\n\t\tif debug_messages:\n\t\t\tprint(name, \" - IK_LookAt: updating skeleton using _physics_process...\")\n\telif update_mode == 2:\n\t\tset_notify_transform(true)\n\t\tif debug_messages:\n\t\t\tprint(name, \" - IK_LookAt: updating skeleton using _notification...\")\n\telse:\n\t\tif debug_messages:\n\t\t\tprint(name, \" - IK_LookAt: NOT updating skeleton due to unknown update method...\")\n\n\nfunc _set_skeleton_path(new_value):\n\t# Because get_node doesn't work in the first call, we just want to assign instead.\n\t# This is to get around a issue with NodePaths exposed to the editor.\n\tif first_call:\n\t\tskeleton_path = new_value\n\t\treturn\n\n\t# Assign skeleton_path to whatever value is passed.\n\tskeleton_path = new_value\n\n\tif skeleton_path == null:\n\t\tif debug_messages:\n\t\t\tprint(name, \" - IK_LookAt: No Nodepath selected for skeleton_path!\")\n\t\treturn\n\n\t# Get the node at that location, if there is one.\n\tvar temp = get_node(skeleton_path)\n\tif temp != null:\n\t\tif temp is Skeleton:\n\t\t\tskeleton_to_use = temp\n\t\t\tif debug_messages:\n\t\t\t\tprint(name, \" - IK_LookAt: attached to (new) skeleton\")\n\t\telse:\n\t\t\tskeleton_to_use = null\n\t\t\tif debug_messages:\n\t\t\t\tprint(name, \" - IK_LookAt: skeleton_path does not point to a skeleton!\")\n\telse:\n\t\tif debug_messages:\n\t\t\tprint(name, \" - IK_LookAt: No Nodepath selected for skeleton_path!\")\n","old_contents":"tool\nextends Spatial\n\nexport(NodePath) var skeleton_path setget _set_skeleton_path\nexport(String) var bone_name = \"\"\nexport(int, \"_process\", \"_physics_process\", \"_notification\", \"none\") var update_mode = 0 setget _set_update\nexport(int, \"X-up\", \"Y-up\", \"Z-up\") var look_at_axis = 1\nexport(bool) var use_our_rotation_x = false\nexport(bool) var use_our_rotation_y = false\nexport(bool) var use_our_rotation_z = false\nexport(bool) var use_negative_our_rot = false\nexport(Vector3) var additional_rotation = Vector3()\nexport(bool) var position_using_additional_bone = false\nexport(String) var additional_bone_name = \"\"\nexport(float) var additional_bone_length = 1\nexport(bool) var debug_messages = false\n\nvar skeleton_to_use: Skeleton = null\nvar first_call: bool = true\nvar _editor_indicator: Spatial = null\n\n\nfunc _ready():\n\tset_process(false)\n\tset_physics_process(false)\n\tset_notify_transform(false)\n\n\tif update_mode == 0:\n\t\tset_process(true)\n\telif update_mode == 1:\n\t\tset_physics_process(true)\n\telif update_mode == 2:\n\t\tset_notify_transform(true)\n\telse:\n\t\tif debug_messages:\n\t\t\tprint(name, \" - IK_LookAt: Unknown update mode. NOT updating skeleton\")\n\n\tif Engine.editor_hint:\n\t\t_setup_for_editor()\n\n\nfunc _process(_delta):\n\tupdate_skeleton()\n\n\nfunc _physics_process(_delta):\n\tupdate_skeleton()\n\n\nfunc _notification(what):\n\tif what == NOTIFICATION_TRANSFORM_CHANGED:\n\t\tupdate_skeleton()\n\n\nfunc update_skeleton():\n\t# NOTE: Because get_node doesn't work in _ready, we need to skip\n\t# a call before doing anything.\n\tif first_call:\n\t\tfirst_call = false\n\t\tif skeleton_to_use == null:\n\t\t\t_set_skeleton_path(skeleton_path)\n\n\n\t# If we do not have a skeleton and\/or we're not supposed to update, then return.\n\tif skeleton_to_use == null:\n\t\treturn\n\tif update_mode >= 3:\n\t\treturn\n\n\t# Get the bone index.\n\tvar bone: int = skeleton_to_use.find_bone(bone_name)\n\n\t# If no bone is found (-1), then return and optionally printan error.\n\tif bone == -1:\n\t\tif debug_messages:\n\t\t\tprint(name, \" - IK_LookAt: No bone in skeleton found with name [\", bone_name, \"]!\")\n\t\treturn\n\n\t# get the bone's global transform pose.\n\tvar rest = skeleton_to_use.get_bone_global_pose(bone)\n\n\t# Convert our position relative to the skeleton's transform.\n\tvar target_pos = skeleton_to_use.global_transform.xform_inv(global_transform.origin)\n\n\t# Call helper's look_at function with the chosen up axis.\n\tif look_at_axis == 0:\n\t\trest = rest.looking_at(target_pos, Vector3.RIGHT)\n\telif look_at_axis == 1:\n\t\trest = rest.looking_at(target_pos, Vector3.UP)\n\telif look_at_axis == 2:\n\t\trest = rest.looking_at(target_pos, Vector3.FORWARD)\n\telse:\n\t\trest = rest.looking_at(target_pos, Vector3.UP)\n\t\tif debug_messages:\n\t\t\tprint(name, \" - IK_LookAt: Unknown look_at_axis value!\")\n\n\t# Get the rotation euler of the bone and of this node.\n\tvar rest_euler = rest.basis.get_euler()\n\tvar self_euler = global_transform.basis.orthonormalized().get_euler()\n\n\t# Flip the rotation euler if using negative rotation.\n\tif use_negative_our_rot:\n\t\tself_euler = -self_euler\n\n\t# Apply this node's rotation euler on each axis, if wanted\/required.\n\tif use_our_rotation_x:\n\t\trest_euler.x = self_euler.x\n\tif use_our_rotation_y:\n\t\trest_euler.y = self_euler.y\n\tif use_our_rotation_z:\n\t\trest_euler.z = self_euler.z\n\n\t# Make a new basis with the, potentially, changed euler angles.\n\trest.basis = Basis(rest_euler)\n\n\t# Apply additional rotation stored in additional_rotation to the bone.\n\tif additional_rotation != Vector3.ZERO:\n\t\trest.basis = rest.basis.rotated(rest.basis.x, deg2rad(additional_rotation.x))\n\t\trest.basis = rest.basis.rotated(rest.basis.y, deg2rad(additional_rotation.y))\n\t\trest.basis = rest.basis.rotated(rest.basis.z, deg2rad(additional_rotation.z))\n\n\t# If the position is set using an additional bone, then set the origin\n\t# based on that bone and its length.\n\tif position_using_additional_bone:\n\t\tvar additional_bone_id = skeleton_to_use.find_bone(additional_bone_name)\n\t\tvar additional_bone_pos = skeleton_to_use.get_bone_global_pose(additional_bone_id)\n\t\trest.origin = additional_bone_pos.origin - additional_bone_pos.basis.z.normalized() * additional_bone_length\n\n\t# Finally, apply the new rotation to the bone in the skeleton.\n\tskeleton_to_use.set_bone_global_pose_override(bone, rest, 1.0, true)\n\n\nfunc _setup_for_editor():\n\t# To see the target in the editor, let's create a MeshInstance,\n\t# add it as a child of this node, and name it.\n\t_editor_indicator = MeshInstance.new()\n\tadd_child(_editor_indicator)\n\t_editor_indicator.name = \"(EditorOnly) Visual indicator\"\n\n\t# Make a sphere mesh for the MeshInstance\n\tvar indicator_mesh = SphereMesh.new()\n\tindicator_mesh.radius = 0.1\n\tindicator_mesh.height = 0.2\n\tindicator_mesh.radial_segments = 8\n\tindicator_mesh.rings = 4\n\n\t# Create a new SpatialMaterial for the sphere and give it the editor\n\t# gizmo texture so it is textured.\n\tvar indicator_material = SpatialMaterial.new()\n\tindicator_material.flags_unshaded = true\n\tindicator_material.albedo_texture = preload(\"editor_gizmo_texture.png\")\n\tindicator_material.albedo_color = Color(1, 0.5, 0, 1)\n\n\t# Assign the material and mesh to the MeshInstance.\n\tindicator_mesh.material = indicator_material\n\t_editor_indicator.mesh = indicator_mesh\n\n\nfunc _set_update(new_value):\n\tupdate_mode = new_value\n\n\t# Set all of our processes to false.\n\tset_process(false)\n\tset_physics_process(false)\n\tset_notify_transform(false)\n\n\t# Based on the value of passed to update, enable the correct process.\n\tif update_mode == 0:\n\t\tset_process(true)\n\t\tif debug_messages:\n\t\t\tprint(name, \" - IK_LookAt: updating skeleton using _process...\")\n\telif update_mode == 1:\n\t\tset_physics_process(true)\n\t\tif debug_messages:\n\t\t\tprint(name, \" - IK_LookAt: updating skeleton using _physics_process...\")\n\telif update_mode == 2:\n\t\tset_notify_transform(true)\n\t\tif debug_messages:\n\t\t\tprint(name, \" - IK_LookAt: updating skeleton using _notification...\")\n\telse:\n\t\tif debug_messages:\n\t\t\tprint(name, \" - IK_LookAt: NOT updating skeleton due to unknown update method...\")\n\n\nfunc _set_skeleton_path(new_value):\n\t# Because get_node doesn't work in the first call, we just want to assign instead.\n\t# This is to get around a issue with NodePaths exposed to the editor.\n\tif first_call:\n\t\tskeleton_path = new_value\n\t\treturn\n\n\t# Assign skeleton_path to whatever value is passed.\n\tskeleton_path = new_value\n\n\tif skeleton_path == null:\n\t\tif debug_messages:\n\t\t\tprint(name, \" - IK_LookAt: No Nodepath selected for skeleton_path!\")\n\t\treturn\n\n\t# Get the node at that location, if there is one.\n\tvar temp = get_node(skeleton_path)\n\tif temp != null:\n\t\tif temp is Skeleton:\n\t\t\tskeleton_to_use = temp\n\t\t\tif debug_messages:\n\t\t\t\tprint(name, \" - IK_LookAt: attached to (new) skeleton\")\n\t\telse:\n\t\t\tskeleton_to_use = null\n\t\t\tif debug_messages:\n\t\t\t\tprint(name, \" - IK_LookAt: skeleton_path does not point to a skeleton!\")\n\telse:\n\t\tif debug_messages:\n\t\t\tprint(name, \" - IK_LookAt: No Nodepath selected for skeleton_path!\")\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"979348ac4e8df5bbcdc9f9aa7913c37d493c9a49","subject":"Fixed small warning when exploding decoy","message":"Fixed small warning when exploding decoy\n","repos":"Lucas-Cerqueira\/GDP-Processo-Produtivo,Lucas-Cerqueira\/GDP-Processo-Produtivo","old_file":"Scripts\/lustDecoy.gd","new_file":"Scripts\/lustDecoy.gd","new_contents":"extends Area2D\n\nfunc _ready():\n\tpass\n\nfunc Explode():\n\tvar baseDamage = get_node(\"\/root\/GlobalVariables\").lustDecoyExplosionDamage\n\tvar array = get_overlapping_bodies()\n\tset_enable_monitoring(false)\n\tif (array.size() != 0):\n\t\tfor enemy in array:\n\t\t\tif (enemy.has_method(\"TakeHit\")):\n\t\t\t\tenemy.TakeHit (baseDamage)\n\t\n\tqueue_free()","old_contents":"extends Area2D\n\nfunc _ready():\n\tpass\n\nfunc Explode():\n\tvar baseDamage = get_node(\"\/root\/GlobalVariables\").lustDecoyExplosionDamage\n\tvar array = get_overlapping_bodies()\n\tif (array.size() != 0):\n\t\tfor enemy in array:\n\t\t\tenemy.TakeHit (baseDamage)\n\t\n\tqueue_free()","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"a26a9afcb30f52e3f7cb1e351405a5dcdf453a99","subject":"Shia kills!","message":"Shia kills!\n","repos":"P1X-in\/rat-is-fat","old_file":"scripts\/enemies\/abstract_enemy.gd","new_file":"scripts\/enemies\/abstract_enemy.gd","new_contents":"extends \"res:\/\/scripts\/moving_object.gd\"\n\nvar destination = [0, 0]\nvar target = null\nvar aggro_range = 200\nvar attack_range = 50\nvar attack_strength = 1\nvar attack_cooldown = 1\nvar is_attack_on_cooldown = false\nvar id = 0\n\nfunc _init(bag).(bag):\n self.initial_position = Vector2(200, 100)\n self.velocity = 100\n\nfunc go_to(x, y):\n self.destination[0] = x\n self.destination[1] = y\n\nfunc process_ai():\n var distance\n var direction = Vector2(0, 0)\n\n if self.target == null:\n for player in self.bag.players.players:\n if player.is_playing && player.is_alive:\n distance = self.calculate_distance_to_object(player)\n if distance < self.aggro_range:\n if self.target != null:\n if self.calculate_distance_to_object(self.target) > distance:\n self.target = player\n else:\n self.target = player\n if self.target == null:\n distance = self.calculate_distance(self.initial_position)\n if distance > 10:\n direction = self.cast_movement_vector(self.initial_position)\n else:\n distance = self.calculate_distance_to_object(self.target)\n if not self.target.is_alive || distance > self.aggro_range:\n self.target = null\n elif distance > self.attack_range:\n direction = self.cast_movement_vector(self.target.get_pos())\n elif not self.is_attack_on_cooldown:\n self.attack()\n\n if self.push_back:\n print('PUSH BACK!')\n self.movement_vector[0] = -direction.x\n self.movement_vector[1] = -direction.y\n else:\n self.movement_vector[0] = direction.x\n self.movement_vector[1] = direction.y\n\nfunc cast_movement_vector(destination_point):\n var my_position = self.get_pos()\n var distance = self.calculate_distance(destination_point)\n var scale = 1.0 \/ distance\n var delta_x = (destination_point.x - my_position.x) * scale\n var delta_y = (destination_point.y - my_position.y) * scale\n\n return Vector2(delta_x, delta_y)\n\nfunc process(delta):\n self.reset_movement()\n self.process_ai()\n .process(delta)\n\nfunc apply_axis_threshold(axis_value):\n return axis_value\n\nfunc attack():\n self.is_attack_on_cooldown = true\n self.target.push_back(self)\n self.target.recieve_damage(self.attack_strength)\n self.bag.timers.set_timeout(self.attack_cooldown, self, \"attack_cooled_down\")\n\nfunc attack_cooled_down():\n self.is_attack_on_cooldown = false\n\nfunc die():\n self.is_processing = false\n self.bag.enemies.del_enemy(self)\n self.despawn()\n\n","old_contents":"extends \"res:\/\/scripts\/moving_object.gd\"\n\nvar destination = [0, 0]\nvar target = null\nvar aggro_range = 200\nvar attack_range = 50\nvar attack_strength = 1\nvar id = 0\n\nfunc _init(bag).(bag):\n self.initial_position = Vector2(200, 100)\n self.velocity = 100\n\nfunc go_to(x, y):\n self.destination[0] = x\n self.destination[1] = y\n\nfunc process_ai():\n var distance\n var direction = Vector2(0, 0)\n\n if self.target == null:\n for player in self.bag.players.players:\n if player.is_playing && player.is_alive:\n distance = self.calculate_distance_to_object(player)\n if distance < self.aggro_range:\n if self.target != null:\n if self.calculate_distance_to_object(self.target) > distance:\n self.target = player\n else:\n self.target = player\n if self.target == null:\n distance = self.calculate_distance(self.initial_position)\n if distance > 10:\n direction = self.cast_movement_vector(self.initial_position)\n else:\n distance = self.calculate_distance_to_object(self.target)\n if not self.target.is_alive || distance > self.aggro_range:\n self.target = null\n elif distance > self.attack_range:\n direction = self.cast_movement_vector(self.target.get_pos())\n else:\n self.attack()\n\n if self.push_back:\n print('PUSH BACK!')\n self.movement_vector[0] = -direction.x\n self.movement_vector[1] = -direction.y\n else:\n self.movement_vector[0] = direction.x\n self.movement_vector[1] = direction.y\n\nfunc cast_movement_vector(destination_point):\n var my_position = self.get_pos()\n var distance = self.calculate_distance(destination_point)\n var scale = 1.0 \/ distance\n var delta_x = (destination_point.x - my_position.x) * scale\n var delta_y = (destination_point.y - my_position.y) * scale\n\n return Vector2(delta_x, delta_y)\n\nfunc process(delta):\n self.reset_movement()\n self.process_ai()\n .process(delta)\n\nfunc apply_axis_threshold(axis_value):\n return axis_value\n\nfunc attack():\n return\n #print('ENEMY IS ATTACKING!!')\n\nfunc die():\n self.is_processing = false\n self.bag.enemies.del_enemy(self)\n self.despawn()\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"89ddc149bde1caa32523d95d1f195962576daf5f","subject":"fixed bug. some events do not have a pos porperty","message":"fixed bug. some events do not have a pos porperty\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/GridView.gd","new_file":"src\/scripts\/GridView.gd","new_contents":"# global working variables\nvar turn = Vector2( 0.0, 0.0 ) # the amount the mouse has turned\nvar mouseposlast = Input.get_mouse_pos() # the mouses last position\n\n# global tweakable parameters\nvar orbitrate = 10 # the rate the camera orbits the target when the mouse is moved\nvar active = true\n\nfunc _ready():\n\t# Initalization here\n\tset_process_input(true) # process user input events here\n\n# called to handle a user input event\nfunc _input(ev):\n\tif (not active):\n\t\treturn\n\t# If the mouse has been moved\n\tif (ev.type==InputEvent.SCREEN_DRAG or (ev.type==InputEvent.MOUSE_MOTION and ev.button_mask == 1)):\n\t\t# calculate the delta change from the last mouse movement\n\t\tvar mousedelta = (mouseposlast - ev.pos)\n\t\t# scale the mouse delta to a useful value\n\t\tturn = mousedelta \/ orbitrate\n\t\t# perform the rotation\n\t\tvar currentTransform = get_transform().basis\n\t\tvar dtime = get_process_delta_time()\n\t\tcurrentTransform = Matrix3( Vector3(0, 1, 0), PI * turn.x * dtime ) * currentTransform\n\t\tcurrentTransform = Matrix3( Vector3(1, 0, 0), PI * turn.y * dtime ) * currentTransform\n\t\tset_transform( Transform( currentTransform ) )\n\n\t\t# record the last position of the mousedelta\n\n\tif (ev.type==InputEvent.SCREEN_DRAG or ev.type==InputEvent.MOUSE_MOTION):\n\t\tmouseposlast = ev.pos\n\t# Android does not like this: Input.get_mouse_pos()\n","old_contents":"# global working variables\nvar turn = Vector2( 0.0, 0.0 ) # the amount the mouse has turned\nvar mouseposlast = Input.get_mouse_pos() # the mouses last position\n\n# global tweakable parameters\nvar orbitrate = 10 # the rate the camera orbits the target when the mouse is moved\nvar active = true\n\nfunc _ready():\n\t# Initalization here\n\tset_process_input(true) # process user input events here\n\n# called to handle a user input event\nfunc _input(ev):\n\tif (not active):\n\t\treturn\n\t# If the mouse has been moved\n\tif (ev.type==InputEvent.SCREEN_DRAG or (ev.type==InputEvent.MOUSE_MOTION and ev.button_mask == 1)):\n\t\t# calculate the delta change from the last mouse movement\n\t\tvar mousedelta = (mouseposlast - ev.pos)\n\t\t# scale the mouse delta to a useful value\n\t\tturn = mousedelta \/ orbitrate\n\t\t# perform the rotation\n\t\tvar currentTransform = get_transform().basis\n\t\tvar dtime = get_process_delta_time()\n\t\tcurrentTransform = Matrix3( Vector3(0, 1, 0), PI * turn.x * dtime ) * currentTransform\n\t\tcurrentTransform = Matrix3( Vector3(1, 0, 0), PI * turn.y * dtime ) * currentTransform\n\t\tset_transform( Transform( currentTransform ) )\n\n\t\t# record the last position of the mousedelta\n\n\tif (ev.type==InputEvent.SCREEN_DRAG or ev.type==InputEvent.MOUSE_MOTION or ev.type==InputEvent.JOYSTICK_MOTION or ev.type==InputEvent.SCREEN_TOUCH):\n\t\tmouseposlast = ev.pos\n\t# Android does not like this: Input.get_mouse_pos()\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"645ecbeb68054d7ef4226b657948d0ae6906dd3c","subject":"added player ship shoot delay","message":"added player ship shoot delay\n","repos":"AlexHolly\/captain-holetooth,shelltitan\/captain-holetooth,shelltitan\/captain-holetooth,AlexHolly\/captain-holetooth","old_file":"src\/actors\/player\/ship\/ship.gd","new_file":"src\/actors\/player\/ship\/ship.gd","new_contents":"extends Area2D\n\n# Max Speed\nconst MAX_SPEED = 250\n\n# Time in Seconds the speed boost lasts\nconst SPEED_BOOST_TIME = 5 # seconds\nconst SPEED_BOOST_MULTIPLIER = 2 # 2x speed multiplier\nvar speed_boost = 1 # This changes to the multipler when boost is enabled\n\nconst ACC_BOOST_TIME = 5 # seconds\nconst ACC_BOOST_MULTIPLIER = 7.5 # 7.5x more ship control!\nvar acc_boost = 1\n\n# Acceleration\nconst ACCELERATION = 950 # Higher acceleration gives the player quicker control over the ship\n\n# Animation player\nexport (NodePath) var anim_player_path\nonready var anim_player = get_node(anim_player_path)\n\n# Screen Size is used to determine where the player can fly\nvar screen_size\nvar prev_shooting = false\nvar killed = false\nvar speed = Vector2(0, 0)\n\n# animated from anim when hited\nvar motion_factor = Vector2(1, 1) # multiplies base motion\nvar root_motion = Vector2(0, 0) # applyed to base motion\n\n# Shoot delay\nvar shoot_delay_sec = 0.3\n\n# Coin\nconst coin_type = preload(\"res:\/\/src\/objects\/rewards\/reward.gd\")\n\n# Processing\nfunc _process(delta):\n\t# Player motion\n\tvar motion = Vector2()\n\t\n\t# Input: MOVE UP\n\tif(Input.is_action_pressed(\"move_up\")):\n\t\tmotion += Vector2(0, -1)\n\t# Input: MOVE DOWN\n\tif(Input.is_action_pressed(\"move_down\")):\n\t\tmotion += Vector2(0, 1)\n\t# Input: MOVE LEFT\n\tif(Input.is_action_pressed(\"move_left\")):\n\t\tmotion += Vector2(-1, 0)\n\t# Input: MOVE RIGHT\n\tif(Input.is_action_pressed(\"move_right\")):\n\t\tmotion += Vector2(1, 0)\n\t# Input: SHOOT\n\t# REMOVED FOR 2.1 Stable: if(Input.is_action_just_pressed(\"shoot\")):\n\tif(Input.is_action_pressed(\"shoot\") && timer.get_time_left()<=0):\n\t\ttimer.start()\n\t\t# Create a new shot instance\n\t\tvar shot = preload(\"shot.tscn\").instance()\n\t\t\n\t\t# Use the Position2D as spawn coordinate for our new shot\n\t\tshot.set_pos( get_node(\"shootfrom\").get_global_pos() )\n\t\t\n\t\t# Put it two parents above, so it is not moved by us\n\t\tget_node(\"..\/..\").add_child(shot)\n\t\t\n\t\t# Play shooting sound\n\t\tget_node(\"sfx\").play(\"shoot\")\n\t\n\t# If we are pressing any movement keys, increase speed\n\tif(motion.x || motion.y):\n\t\tspeed += acc_boost * ACCELERATION * motion.normalized() * delta\n\t\n\t# If we are NOT pressing any movement keys, and we have some speed, deaccelerate to a full stop\n\telif(speed.x || speed.y):\n\t\tspeed -= acc_boost * ACCELERATION * speed.normalized() * delta\n\t\n\t# Prevents ship speed from going faster than MAX_SPEED\n\tif(speed.length() > MAX_SPEED):\n\t\tspeed = speed.normalized() * MAX_SPEED\n\t\n\t# Move player\n\tvar pos = get_pos()\n\t\n\t# Celculate position to where we are moving\n\tpos += delta * (speed_boost * speed * motion_factor + root_motion)\n\t\n\t# Prevent ship from going outside the screen\n\tpos.x = clamp(pos.x, 0, screen_size.x)\n\tpos.y = clamp(pos.y, 0, screen_size.y)\n\t\n\t# Set new player position\n\tset_pos(pos)\n\nvar timer = null\n# Start\nfunc _ready():\n\t# Screen size is used to calculate whether or not the player is inside it\n\tscreen_size = get_viewport().get_rect().size\n\t\n\ttimer = Timer.new()\n\tadd_child(timer)\n\ttimer.set_one_shot(true)\n\ttimer.set_wait_time(shoot_delay_sec)\n\t\n\t# Enable process\n\tset_process(true)\n\n\n# SPEED BOOST\n# Used by certain pickup items to give the player a speed boost\nvar speed_timer = null\nfunc speed_boost():\n\t# If it is not already running\n\tif(speed_boost == 1):\n\t\t# If this is the first time running, create timer\n\t\tif(speed_timer == null):\n\t\t\tspeed_timer = Timer.new()\n\t\t\tspeed_timer.set_wait_time(SPEED_BOOST_TIME)\n\t\t\tspeed_timer.set_one_shot(true)\n\t\t\tadd_child(speed_timer)\n\t\t\n\t\t# Set speed boost\n\t\tspeed_boost = SPEED_BOOST_MULTIPLIER\n\t\n\t\t# Start timer\n\t\tspeed_timer.start()\n\t\t\n\t\t# Wait for timeout\n\t\tyield(speed_timer, \"timeout\")\n\t\t\n\t\t# Disable speed boost\n\t\tspeed_boost = 1 # back to 1\n\n\n# ACCELERATION BOOST\n# Used by certain pickup items to give the player more ship control\nvar acc_timer = null\nfunc acc_boost():\n\t# If it is not already running\n\tif(acc_boost == 1):\n\t\t# If this is the first time running, create timer\n\t\tif(acc_timer == null):\n\t\t\tacc_timer = Timer.new()\n\t\t\tacc_timer.set_wait_time(ACC_BOOST_TIME)\n\t\t\tacc_timer.set_one_shot(true)\n\t\t\tadd_child(acc_timer)\n\t\t\n\t\t# Set speed boost\n\t\tacc_boost = ACC_BOOST_MULTIPLIER\n\t\n\t\t# Start timer\n\t\tacc_timer.start()\n\t\t\n\t\t# Wait for timeout\n\t\tyield(acc_timer, \"timeout\")\n\t\t\n\t\t# Disable speed boost\n\t\tacc_boost = 1 # back to 1\n\n# On area enter the player\nfunc _on_player_area_enter( area ):\n\tvar groups = area.get_groups()\n\t\n\tif(groups.has(\"enemy\") || groups.has(\"enemy_shot\")):\n\t\t# Play ship 'hit' animation\n\t\tanim_player.play(\"hit\")\n\t\t\n\t\t# Wait for the animation to complete\n\t\tyield(anim_player, \"finished\")\n\t\t\n\t\t# Go back to the 'flying' animation (default)\n\t\tanim_player.play(\"flying\")","old_contents":"extends Area2D\n\n# Max Speed\nconst MAX_SPEED = 250\n\n# Time in Seconds the speed boost lasts\nconst SPEED_BOOST_TIME = 5 # seconds\nconst SPEED_BOOST_MULTIPLIER = 2 # 2x speed multiplier\nvar speed_boost = 1 # This changes to the multipler when boost is enabled\n\nconst ACC_BOOST_TIME = 5 # seconds\nconst ACC_BOOST_MULTIPLIER = 7.5 # 7.5x more ship control!\nvar acc_boost = 1\n\n# Acceleration\nconst ACCELERATION = 950 # Higher acceleration gives the player quicker control over the ship\n\n# Animation player\nexport (NodePath) var anim_player_path\nonready var anim_player = get_node(anim_player_path)\n\n# Screen Size is used to determine where the player can fly\nvar screen_size\nvar prev_shooting = false\nvar killed = false\nvar speed = Vector2(0, 0)\n\n# animated from anim when hited\nvar motion_factor = Vector2(1, 1) # multiplies base motion\nvar root_motion = Vector2(0, 0) # applyed to base motion\n\n# Coin\nconst coin_type = preload(\"res:\/\/src\/objects\/rewards\/reward.gd\")\n\n# Processing\nfunc _process(delta):\n\t# Player motion\n\tvar motion = Vector2()\n\t\n\t# Input: MOVE UP\n\tif(Input.is_action_pressed(\"move_up\")):\n\t\tmotion += Vector2(0, -1)\n\t# Input: MOVE DOWN\n\tif(Input.is_action_pressed(\"move_down\")):\n\t\tmotion += Vector2(0, 1)\n\t# Input: MOVE LEFT\n\tif(Input.is_action_pressed(\"move_left\")):\n\t\tmotion += Vector2(-1, 0)\n\t# Input: MOVE RIGHT\n\tif(Input.is_action_pressed(\"move_right\")):\n\t\tmotion += Vector2(1, 0)\n\t# Input: SHOOT\n\t# REMOVED FOR 2.1 Stable: if(Input.is_action_just_pressed(\"shoot\")):\n\tif(Input.is_action_pressed(\"shoot\")):\n\t\t# Create a new shot instance\n\t\tvar shot = preload(\"shot.tscn\").instance()\n\t\t\n\t\t# Use the Position2D as spawn coordinate for our new shot\n\t\tshot.set_pos( get_node(\"shootfrom\").get_global_pos() )\n\t\t\n\t\t# Put it two parents above, so it is not moved by us\n\t\tget_node(\"..\/..\").add_child(shot)\n\t\t\n\t\t# Play shooting sound\n\t\tget_node(\"sfx\").play(\"shoot\")\n\t\n\t# If we are pressing any movement keys, increase speed\n\tif(motion.x || motion.y):\n\t\tspeed += acc_boost * ACCELERATION * motion.normalized() * delta\n\t\n\t# If we are NOT pressing any movement keys, and we have some speed, deaccelerate to a full stop\n\telif(speed.x || speed.y):\n\t\tspeed -= acc_boost * ACCELERATION * speed.normalized() * delta\n\t\n\t# Prevents ship speed from going faster than MAX_SPEED\n\tif(speed.length() > MAX_SPEED):\n\t\tspeed = speed.normalized() * MAX_SPEED\n\t\n\t# Move player\n\tvar pos = get_pos()\n\t\n\t# Celculate position to where we are moving\n\tpos += delta * (speed_boost * speed * motion_factor + root_motion)\n\t\n\t# Prevent ship from going outside the screen\n\tpos.x = clamp(pos.x, 0, screen_size.x)\n\tpos.y = clamp(pos.y, 0, screen_size.y)\n\t\n\t# Set new player position\n\tset_pos(pos)\n\n\n# Start\nfunc _ready():\n\t# Screen size is used to calculate whether or not the player is inside it\n\tscreen_size = get_viewport().get_rect().size\n\t\n\t# Enable process\n\tset_process(true)\n\n\n# SPEED BOOST\n# Used by certain pickup items to give the player a speed boost\nvar speed_timer = null\nfunc speed_boost():\n\t# If it is not already running\n\tif(speed_boost == 1):\n\t\t# If this is the first time running, create timer\n\t\tif(speed_timer == null):\n\t\t\tspeed_timer = Timer.new()\n\t\t\tspeed_timer.set_wait_time(SPEED_BOOST_TIME)\n\t\t\tspeed_timer.set_one_shot(true)\n\t\t\tadd_child(speed_timer)\n\t\t\n\t\t# Set speed boost\n\t\tspeed_boost = SPEED_BOOST_MULTIPLIER\n\t\n\t\t# Start timer\n\t\tspeed_timer.start()\n\t\t\n\t\t# Wait for timeout\n\t\tyield(speed_timer, \"timeout\")\n\t\t\n\t\t# Disable speed boost\n\t\tspeed_boost = 1 # back to 1\n\n\n# ACCELERATION BOOST\n# Used by certain pickup items to give the player more ship control\nvar acc_timer = null\nfunc acc_boost():\n\t# If it is not already running\n\tif(acc_boost == 1):\n\t\t# If this is the first time running, create timer\n\t\tif(acc_timer == null):\n\t\t\tacc_timer = Timer.new()\n\t\t\tacc_timer.set_wait_time(ACC_BOOST_TIME)\n\t\t\tacc_timer.set_one_shot(true)\n\t\t\tadd_child(acc_timer)\n\t\t\n\t\t# Set speed boost\n\t\tacc_boost = ACC_BOOST_MULTIPLIER\n\t\n\t\t# Start timer\n\t\tacc_timer.start()\n\t\t\n\t\t# Wait for timeout\n\t\tyield(acc_timer, \"timeout\")\n\t\t\n\t\t# Disable speed boost\n\t\tacc_boost = 1 # back to 1\n\n# On area enter the player\nfunc _on_player_area_enter( area ):\n\tvar groups = area.get_groups()\n\t\n\tif(groups.has(\"enemy\") || groups.has(\"enemy_shot\")):\n\t\t# Play ship 'hit' animation\n\t\tanim_player.play(\"hit\")\n\t\t\n\t\t# Wait for the animation to complete\n\t\tyield(anim_player, \"finished\")\n\t\t\n\t\t# Go back to the 'flying' animation (default)\n\t\tanim_player.play(\"flying\")","returncode":0,"stderr":"","license":"apache-2.0","lang":"GDScript"} {"commit":"ea6ca3f6777a4e5bb3c373cc4a7b28eb09245521","subject":"Testing continuous integration :)","message":"Testing continuous integration :)\n","repos":"h4de5\/spiel4","old_file":"game\/main\/game.gd","new_file":"game\/main\/game.gd","new_contents":"# main node to start game with, holds background, does ship spawing\nextends Node2D\n\nfunc _ready():\n\tprint (\"reset everything - new game\")\n\n\tvar camera_scn = load(global.scene_path_camera)\n\tvar camera_node = camera_scn.instance()\n\tadd_child(camera_node, true)\n\n\tfor i in range(1): spawn_enemy()\n\n\tfor i in range(1): spawn_tower()\n\n\tfor i in range(2): spawn_pickup()\n\n\n\t# Background node\n\t# player_manager node\n\nfunc spawn_player(processor, device_details):\n\tvar player_scn = load(global.scene_path_player)\n\tvar player_node = player_scn.instance()\n\tget_node(\"ships\").add_child(player_node, true)\n\n\tplayer_node.get_node(\"processor_selector\").set_processor(processor)\n\tplayer_node.get_node(\"processor_selector\").set_processor_details(device_details)\n\nfunc spawn_enemy():\n\tvar scn = load(global.scene_path_enemy)\n\tvar node = scn.instance()\n\tget_node(\"ships\").add_child(node, true)\n\nfunc spawn_tower():\n\tvar scn = load(global.scene_path_tower)\n\tvar node = scn.instance()\n\tget_node(\"ships\").add_child(node, true)\n\nfunc spawn_pickup():\n\tvar scn = load(global.scene_path_pickup)\n\tvar node = scn.instance()\n\tget_node(\"objects\").add_child(node, true)\n\n\n\t# http:\/\/www.gamefromscratch.com\/post\/2015\/02\/23\/Godot-Engine-Tutorial-Part-6-Multiple-Scenes-and-Global-Variables.aspx\n#\n#\tfunc _ready():\n#\t #On load set the current scene to the last scene available\n#\t currentScene = get_tree().get_root().get_child(get_tree().get_root().get_child_count() -1)\n#\t #Demonstrate setting a global variable.\n#\t Globals.set(\"MAX_POWER_LEVEL\",9000)\n#\n#\t# create a function to switch between scenes\n#\tfunc setScene(scene):\n#\t #clean up the current scene\n#\t currentScene.queue_free()\n#\t #load the file passed in as the param \"scene\"\n#\t var s = ResourceLoader.load(scene)\n#\t #create an instance of our scene\n#\t currentScene = s.instance()\n#\t # add scene to root\n#\t get_tree().get_root().add_child(currentScene)\n#","old_contents":"# main node to start game with, holds background, does ship spawing\nextends Node2D\n\nfunc _ready():\n\tprint (\"reset everything - new game\")\n\n\tvar camera_scn = load(global.scene_path_camera)\n\tvar camera_node = camera_scn.instance()\n\tadd_child(camera_node, true)\n\n\tfor i in range(2): spawn_enemy()\n\n\tfor i in range(1): spawn_tower()\n\n\tfor i in range(2): spawn_pickup()\n\n\n\t# Background node\n\t# player_manager node\n\nfunc spawn_player(processor, device_details):\n\tvar player_scn = load(global.scene_path_player)\n\tvar player_node = player_scn.instance()\n\tget_node(\"ships\").add_child(player_node, true)\n\n\tplayer_node.get_node(\"processor_selector\").set_processor(processor)\n\tplayer_node.get_node(\"processor_selector\").set_processor_details(device_details)\n\nfunc spawn_enemy():\n\tvar scn = load(global.scene_path_enemy)\n\tvar node = scn.instance()\n\tget_node(\"ships\").add_child(node, true)\n\nfunc spawn_tower():\n\tvar scn = load(global.scene_path_tower)\n\tvar node = scn.instance()\n\tget_node(\"ships\").add_child(node, true)\n\nfunc spawn_pickup():\n\tvar scn = load(global.scene_path_pickup)\n\tvar node = scn.instance()\n\tget_node(\"objects\").add_child(node, true)\n\n\n\t# http:\/\/www.gamefromscratch.com\/post\/2015\/02\/23\/Godot-Engine-Tutorial-Part-6-Multiple-Scenes-and-Global-Variables.aspx\n#\n#\tfunc _ready():\n#\t #On load set the current scene to the last scene available\n#\t currentScene = get_tree().get_root().get_child(get_tree().get_root().get_child_count() -1)\n#\t #Demonstrate setting a global variable.\n#\t Globals.set(\"MAX_POWER_LEVEL\",9000)\n#\n#\t# create a function to switch between scenes\n#\tfunc setScene(scene):\n#\t #clean up the current scene\n#\t currentScene.queue_free()\n#\t #load the file passed in as the param \"scene\"\n#\t var s = ResourceLoader.load(scene)\n#\t #create an instance of our scene\n#\t currentScene = s.instance()\n#\t # add scene to root\n#\t get_tree().get_root().add_child(currentScene)\n#","returncode":0,"stderr":"","license":"apache-2.0","lang":"GDScript"} {"commit":"2e732853ff446863fd15d08d045c3572db8cd45f","subject":"error messages work better now, albeit through messy code","message":"error messages work better now, albeit through messy code\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Editor.gd","new_file":"src\/scripts\/Editor.gd","new_contents":"extends Spatial\n\nvar puzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar puzzle\nvar puzzleMan\n\nvar gridMan\nvar prevBlock = [] # keeps track of prevous color for pairs by layer\nvar blockColors = preload(\"res:\/\/scripts\/PuzzleManager.gd\").blockColors\nvar id\n\nvar fileDialog = load(\"res:\/\/fileDialog.scn\").instance()\nvar gui = [\n\t[\"status\", Label.new()], # plz keep me as first element, referenced as gui[0] later\n\t[\"save_pzl\", Button.new()],\n\t[\"load_pzl\", Button.new()],\n\t[\"remove_layer\", Button.new()],\n\t[\"random_layer\", Button.new()],\n\t# THESE SHOULD BE Options instead of left, label, right\n\t[\"class_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=[\"LZR\", \"WILD\", \"PAIR\", \"GOAL\"],\n\t\tvalue=\"PAIR\"\n\t}],\n\t[\"color_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=blockColors,\n\t\tvalue=\"Blue\"\n\t}],\n\t[\"action_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=[\"Add\", \"Remove\", \"Replace\"],\n\t\tvalue=\"Add\"\n\t}],\n\t[\"test_pzl\", Button.new()],\n]\nvar action_ix = gui.size() - 1 - 1\nvar color_ix = gui.size() - 1 - 2\nvar class_ix = gui.size() - 1 - 3\n\n# gross style, cannot , but clean enough\nfunc shouldAddNeighbor():\n\treturn gui[action_ix][1].value == \"Add\"\n\nfunc shouldReplaceSelf():\n\treturn gui[action_ix][1].value == \"Replace\"\n\nfunc shouldRemoveSelf():\n\treturn gui[action_ix][1].value == \"Remove\"\n\n# called in AbstractBlock to add a new block\nfunc addBlock(pos):\n\tvar curColor = gui[color_ix][1].value\n\tvar b = puzzleMan.PickledBlock.new() \\\n\t\t.setName(id) \\\n\t\t.setTextureName(curColor) \\\n\t\t.setBlockPos(pos)\n\tvar layer = puzzleMan.calcBlockLayerVec(pos)\n\tid += 1\n\n\t# expand prevblocks index\n\twhile prevBlock.size() <= layer:\n\t\tvar d = {}\n\t\tfor k in blockColors:\n\t\t\td[k] = null\n\t\tprevBlock.append(d)\n\n\tvar pb = prevBlock[layer][curColor]\n\n\tif pb != null:\n\t\tb.setPairName(pb.name)\n\t\tgridMan.get_node(pb.toNode().name).setPairName(b.name)\n\t\tprevBlock[layer][curColor] = null\n\telse:\n\t\t# TODO SUPPORT GLYPHS HERE, SET PAIRWISE GLYPH\n\t\tprevBlock[layer][curColor] = b\n\n\tgui[0][1].set_text(getPrevBlockErrors())\n\tgridMan.addPickledBlock(b)\n\treturn b\n\nfunc getPrevBlockErrors():\n\t# hahaha, so bad\n\tvar missing = \"STATUS: \"\n\t# check every layer\n\tfor l in range(prevBlock.size()):\n\t\t# check every color\n\t\tfor k in prevBlock[l].keys():\n\t\t\tvar missed = false\n\t\t\tif prevBlock[l][k] != null:\n\t\t\t\t# one message about the current layer\n\t\t\t\tif not missed:\n\t\t\t\t\tmissing += \" L\" + str(l) + \" \"\n\t\t\t\t\tmissed = true\n\t\t\t\tmissing += k.to_upper() + \" \" # bad way of constructing strings\n\tif missing == \"\":\n\t\tmissing += \"NOMINAL\"\n\treturn missing\n\n\nfunc showFileDialog(loadInstead=false):\n\tget_tree().set_pause(true)\n\n\tif loadInstead:\n\t\tfileDialog.connect(\"confirmed\", self, \"puzzleLoad\")\n\t\tfileDialog.set_mode(FileDialog.MODE_OPEN_FILE)\n\telse:\n\t\tfileDialog.connect(\"confirmed\", self, \"puzzleSave\")\n\t\tfileDialog.set_mode(FileDialog.MODE_SAVE_FILE)\n\n\tfileDialog.popup_centered()\n\nfunc puzzleSave():\n\tprint(\"SAVING TO \", fileDialog.get_current_file() )\n\tget_tree().set_pause(false)\n\nfunc puzzleLoad():\n\tprint(\"LOADING FROM \", fileDialog.get_current_file() )\n\tget_tree().set_pause(false)\n\nfunc changeValue(ix, togg):\n\ttogg.value = togg.values[ix]\n\nfunc _ready():\n\t# lights!\n\tget_tree().get_root().add_child( preload( \"res:\/\/puzzleView.scn\" ).instance() )\n\n\tpuzzle = puzzleScn.instance()\n\tpuzzle.mainPuzzle = false\n\n\t# hide and disable timer\n\tpuzzle.time.on = false;\n\tpuzzle.time.val = ''\n\n\tpuzzle.set_as_toplevel(true)\n\n\tadd_child(puzzle)\n\n\tgridMan = puzzle.get_node(\"GridView\/GridMan\")\n\tid = gridMan.shape.size()\n\n\n\tpuzzleMan = puzzle.puzzleMan\n\n\tset_process_input(true)\n\n\tvar theme = preload(\"res:\/\/themes\/MainTheme.thm\")\n\n\n\tfileDialog.set_title(\"Select Puzzle Filename\")\n\tfileDialog.set_access(FileDialog.ACCESS_USERDATA)\n\tfileDialog.set_current_dir(\"PuzzleSaves\")\n\tfileDialog.add_filter(\"*.pzl ; Anttris Puzzle\")\n\n\t# MainTheme leaks on bottom\n\tvar dialogTheme = Theme.new()\n\tdialogTheme.copy_default_theme()\n\tfileDialog.set_theme(dialogTheme)\n\n\t# work even if game is paused\n\tfileDialog.set_pause_mode(PAUSE_MODE_PROCESS)\n\n\t# unpause if user cancels\n\tfileDialog.connect(\"popup_hide\", get_tree(), \"set_pause\", [false])\n\tfileDialog.hide()\n\tadd_child(fileDialog)\n\n\tvar y = 0\n\tfor control in gui:\n\t\ty += 45\n\t\tif control[0].rfind('_toggle') > 0:\n\t\t\tvar togg = control[1]\n\t\t\tvar e = togg.optionButt\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tadd_child(e)\n\n\t\t\t# index of items needed\n\t\t\te.connect(\"item_selected\", self, \"changeValue\", [togg])\n\t\t\tfor i in range(togg.values.size()):\n\t\t\t\te.add_item(togg.values[i], i)\n\t\t\t\t# e.add_icon_item(togg.values[i], i)\n\n\t\telse:\n\t\t\tvar e = control[1]\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tif e extends Button:\n\t\t\t\te.set_text(control[0])\n\t\t\tif control[0] == 'save_pzl' :\n\t\t\t\te.connect('pressed', self, 'showFileDialog')\n\t\t\tif control[0] == 'load_pzl' :\n\t\t\t\te.connect('pressed', self, 'showFileDialog', [true])\n\t\t\tif control[0] == 'status':\n\t\t\t\tcontrol[1].set_text('STATUS: NOMINAL')\n\t\t\tadd_child(e)\n\n\n","old_contents":"extends Spatial\n\nvar puzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar puzzle\nvar puzzleMan\n\nvar gridMan\nvar prevBlockByColor = {} # keeps track of prevous color for pairs\nvar blockColors = preload(\"res:\/\/scripts\/PuzzleManager.gd\").blockColors\nvar id\n\nvar fileDialog = load(\"res:\/\/fileDialog.scn\").instance()\nvar gui = [\n\t[\"status\", Label.new()], # plz keep me as first element, referenced as gui[0] later\n\t[\"save_pzl\", Button.new()],\n\t[\"load_pzl\", Button.new()],\n\t[\"remove_layer\", Button.new()],\n\t[\"random_layer\", Button.new()],\n\t# THESE SHOULD BE Options instead of left, label, right\n\t[\"class_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=[\"LZR\", \"WILD\", \"PAIR\", \"GOAL\"],\n\t\tvalue=\"PAIR\"\n\t}],\n\t[\"color_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=blockColors,\n\t\tvalue=\"Blue\"\n\t}],\n\t[\"action_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=[\"Add\", \"Remove\", \"Replace\"],\n\t\tvalue=\"Add\"\n\t}],\n\t[\"test_pzl\", Button.new()],\n]\nvar action_ix = gui.size() - 1 - 1\nvar color_ix = gui.size() - 1 - 2\nvar class_ix = gui.size() - 1 - 3\n\n# gross style, cannot , but clean enough\nfunc shouldAddNeighbor():\n\treturn gui[action_ix][1].value == \"Add\"\n\nfunc shouldReplaceSelf():\n\treturn gui[action_ix][1].value == \"Replace\"\n\nfunc shouldRemoveSelf():\n\treturn gui[action_ix][1].value == \"Remove\"\n\n# called in AbstractBlock to add a new block\nfunc newPickledBlock():\n\tvar curColor = gui[color_ix][1].value\n\tvar b = puzzleMan.PickledBlock.new() \\\n\t\t.setName(id) \\\n\t\t.setTextureName(curColor)\n\tvar pb = prevBlockByColor[curColor]\n\tid += 1\n\n\tif pb != null:\n\t\tb.setPairName(pb.name)\n\t\tgridMan.get_node(pb.toNode().name).setPairName(b.name)\n\t\tprevBlockByColor[curColor] = null\n\t\tgui[0][1].set_text(\"STATUS: NOMINAL\")\n\telse:\n\t\t# TODO SUPPORT GLYPHS HERE, SET PAIRWISE GLYPH\n\t\tprevBlockByColor[curColor] = b\n\t\tvar missing = \"\"\n\t\tfor k in prevBlockByColor.keys():\n\t\t\tif prevBlockByColor[k] != null:\n\t\t\t\tmissing += k.to_upper() + \" \" # bad way of constructing strings\n\t\tgui[0][1].set_text(\"STATUS: ERROR, ADD PAIR \" + missing)\n\treturn b\n\nfunc showFileDialog(loadInstead=false):\n\tget_tree().set_pause(true)\n\n\tif loadInstead:\n\t\tfileDialog.connect(\"confirmed\", self, \"puzzleLoad\")\n\t\tfileDialog.set_mode(FileDialog.MODE_OPEN_FILE)\n\telse:\n\t\tfileDialog.connect(\"confirmed\", self, \"puzzleSave\")\n\t\tfileDialog.set_mode(FileDialog.MODE_SAVE_FILE)\n\n\tfileDialog.popup_centered()\n\nfunc puzzleSave():\n\tprint(\"SAVING TO \", fileDialog.get_current_file() )\n\tget_tree().set_pause(false)\n\nfunc puzzleLoad():\n\tprint(\"LOADING FROM \", fileDialog.get_current_file() )\n\tget_tree().set_pause(false)\n\nfunc changeValue(ix, togg):\n\ttogg.value = togg.values[ix]\n\nfunc _ready():\n\tfor k in blockColors:\n\t\tprevBlockByColor[k] = null\n\n\tpuzzle = puzzleScn.instance()\n\tgridMan = puzzle.get_node(\"GridView\/GridMan\")\n\tid = gridMan.shape.size()\n\tpuzzle.mainPuzzle = false\n\tget_tree().get_root().add_child( preload( \"res:\/\/puzzleView.scn\" ).instance() )\n\n\t# hide and disable timer\n\tpuzzle.time.on = false;\n\tpuzzle.time.val = ''\n\n\tpuzzle.set_as_toplevel(true)\n\n\tadd_child(puzzle)\n\n\tpuzzleMan = puzzle.puzzleMan\n\n\tset_process_input(true)\n\n\tvar theme = preload(\"res:\/\/themes\/MainTheme.thm\")\n\n\n\tfileDialog.set_title(\"Select Puzzle Filename\")\n\tfileDialog.set_access(FileDialog.ACCESS_USERDATA)\n\tfileDialog.set_current_dir(\"PuzzleSaves\")\n\tfileDialog.add_filter(\"*.pzl ; Anttris Puzzle\")\n\n\t# MainTheme leaks on bottom\n\tvar dialogTheme = Theme.new()\n\tdialogTheme.copy_default_theme()\n\tfileDialog.set_theme(dialogTheme)\n\n\t# work even if game is paused\n\tfileDialog.set_pause_mode(PAUSE_MODE_PROCESS)\n\n\t# unpause if user cancels\n\tfileDialog.connect(\"popup_hide\", get_tree(), \"set_pause\", [false])\n\tfileDialog.hide()\n\tadd_child(fileDialog)\n\n\tvar y = 0\n\tfor control in gui:\n\t\ty += 45\n\t\tif control[0].rfind('_toggle') > 0:\n\t\t\tvar togg = control[1]\n\t\t\tvar e = togg.optionButt\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tadd_child(e)\n\n\t\t\t# index of items needed\n\t\t\te.connect(\"item_selected\", self, \"changeValue\", [togg])\n\t\t\tfor i in range(togg.values.size()):\n\t\t\t\te.add_item(togg.values[i], i)\n\t\t\t\t# e.add_icon_item(togg.values[i], i)\n\n\t\telse:\n\t\t\tvar e = control[1]\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tif e extends Button:\n\t\t\t\te.set_text(control[0])\n\t\t\tif control[0] == 'save_pzl' :\n\t\t\t\te.connect('pressed', self, 'showFileDialog')\n\t\t\tif control[0] == 'load_pzl' :\n\t\t\t\te.connect('pressed', self, 'showFileDialog', [true])\n\t\t\tif control[0] == 'status':\n\t\t\t\tcontrol[1].set_text('STATUS: NOMINAL')\n\t\t\tadd_child(e)\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"9fca3fdff3d24d6e7ed0a7e277605aee5afc752c","subject":"Platforms tweaks","message":"Platforms tweaks\n","repos":"w84death\/mountain-of-hope","old_file":"scripts\/map\/map.gd","new_file":"scripts\/map\/map.gd","new_contents":"\nvar bag\n\nvar segments = []\nvar last_visited_segment = -1\n\nvar SCREEN_WIDTH = Globals.get(\"display\/width\")\nvar SCREEN_HEIGHT = Globals.get(\"display\/height\")\nvar SCREEN_MARGIN = 200\n\nvar SEGMENT_SIZE = 60\nvar SEGMENT_LINE_HEIGHT = 36\n\nvar WALL_HEIGHT = 39\nvar WALL_HALF_WIDTH = 36\n\nvar platforms = [\n { 'width' : 100, 'template' : preload('res:\/\/scenes\/map\/platform_grass.xscn') }\n]\n\nvar left_wall_template = preload('res:\/\/scenes\/map\/wall_left.xscn')\nvar right_wall_template = preload('res:\/\/scenes\/map\/wall_right.xscn')\nvar separator_template = preload('res:\/\/scenes\/map\/base_platform.xscn')\nvar playable_width = 0\n\n\nfunc _init_bag(bag):\n self.bag = bag\n self.playable_width = self.SCREEN_WIDTH - (self.SCREEN_MARGIN * 2)\n self.reset_map()\n\nfunc reset_map():\n for segment in self.segments:\n self.destroy_unused_segment(segment)\n self.segments.clear()\n\n\nfunc generate_next_map_segment():\n var next_segment_index = self.segments.size()\n\n var new_segment = []\n\n new_segment = self.add_walls(new_segment)\n new_segment = self.add_separator(new_segment)\n new_segment = self.add_platforms(new_segment)\n\n self.segments.append(new_segment)\n self.apply_segment(next_segment_index)\n self.destroy_unused_segment_by_id(next_segment_index - 3)\n\nfunc apply_segment(id):\n var segment_offset = id * self.SEGMENT_SIZE * self.SEGMENT_LINE_HEIGHT\n for object in self.segments[id]:\n self.bag.action_controller.attach_object(object.object)\n object.object.set_global_pos(Vector2(object.x, -object.y - segment_offset))\n\nfunc destroy_unused_segment_by_id(id):\n if id < 0:\n return\n\n self.destroy_unused_segment(self.segments[id])\n\nfunc destroy_unused_segment(segment):\n for object in segment:\n self.bag.action_controller.detach_object(object.object)\n object.object.queue_free()\n\n segment.clear()\n\nfunc add_segment_object(segment, x, y, object):\n segment.append({\n 'x' : x,\n 'y' : y,\n 'object' : object\n })\n\n return segment\n\nfunc add_separator(segment):\n var separator_platform = self.separator_template.instance()\n segment = self.add_segment_object(segment, -10, self.SEGMENT_LINE_HEIGHT, separator_platform)\n return segment\n\nfunc add_walls(segment):\n var height = 0\n var left_wall\n var right_wall\n var wall_offset\n var real_height\n\n while height < self.SEGMENT_SIZE:\n left_wall = self.left_wall_template.instance()\n right_wall = self.right_wall_template.instance()\n\n wall_offset = self.SCREEN_MARGIN - self.WALL_HALF_WIDTH\n real_height = (height + self.WALL_HEIGHT \/ 2) * self.SEGMENT_LINE_HEIGHT\n segment = self.add_segment_object(segment, wall_offset, real_height, left_wall)\n segment = self.add_segment_object(segment, wall_offset + self.playable_width + self.WALL_HALF_WIDTH * 2, real_height, right_wall)\n\n height = height + self.WALL_HEIGHT\n return segment\n\nfunc update_segments(player_height):\n var segment_height = self.SEGMENT_SIZE * self.SEGMENT_LINE_HEIGHT\n var overflow = player_height % segment_height\n\n var segment_num = (player_height - overflow) \/ segment_height\n\n if overflow > 100 && segment_num > self.last_visited_segment:\n self.last_visited_segment = segment_num\n self.generate_next_map_segment()\n\nfunc add_platforms(segment):\n var iterator = 2\n var last_iterator = 0\n\n randomize()\n\n while iterator < self.SEGMENT_SIZE - 2:\n segment = self.generate_single_platform(segment, iterator)\n\n last_iterator = iterator\n\n if randi() % 10 == 0:\n iterator = iterator + 5\n else:\n iterator = iterator + 4\n\n if last_iterator < self.SEGMENT_SIZE - 4:\n segment = self.generate_single_platform(segment, self.SEGMENT_SIZE - 2)\n\n return segment\n\nfunc generate_single_platform(segment, iterator):\n var template = self.platforms[randi() % self.platforms.size()]\n var new_platform = template.template.instance()\n\n var horizontal_position = randi() % (self.playable_width - template.width)\n horizontal_position = horizontal_position + self.SCREEN_MARGIN + int(template.width \/ 2)\n\n segment = self.add_segment_object(segment, horizontal_position, (iterator + 1) * self.SEGMENT_LINE_HEIGHT, new_platform)\n\n return segment","old_contents":"\nvar bag\n\nvar segments = []\nvar last_visited_segment = -1\n\nvar SCREEN_WIDTH = Globals.get(\"display\/width\")\nvar SCREEN_HEIGHT = Globals.get(\"display\/height\")\nvar SCREEN_MARGIN = 200\n\nvar SEGMENT_SIZE = 60\nvar SEGMENT_LINE_HEIGHT = 36\n\nvar WALL_HEIGHT = 39\nvar WALL_HALF_WIDTH = 36\n\nvar platforms = [\n { 'width' : 100, 'template' : preload('res:\/\/scenes\/map\/platform_grass.xscn') }\n]\n\nvar left_wall_template = preload('res:\/\/scenes\/map\/wall_left.xscn')\nvar right_wall_template = preload('res:\/\/scenes\/map\/wall_right.xscn')\nvar separator_template = preload('res:\/\/scenes\/map\/base_platform.xscn')\nvar playable_width = 0\n\n\nfunc _init_bag(bag):\n self.bag = bag\n self.playable_width = self.SCREEN_WIDTH - (self.SCREEN_MARGIN * 2)\n self.reset_map()\n\nfunc reset_map():\n for segment in self.segments:\n self.destroy_unused_segment(segment)\n self.segments.clear()\n\n\nfunc generate_next_map_segment():\n var next_segment_index = self.segments.size()\n\n var new_segment = []\n\n new_segment = self.add_walls(new_segment)\n new_segment = self.add_separator(new_segment)\n new_segment = self.add_platforms(new_segment)\n\n self.segments.append(new_segment)\n self.apply_segment(next_segment_index)\n self.destroy_unused_segment_by_id(next_segment_index - 3)\n\nfunc apply_segment(id):\n var segment_offset = id * self.SEGMENT_SIZE * self.SEGMENT_LINE_HEIGHT\n for object in self.segments[id]:\n self.bag.action_controller.attach_object(object.object)\n object.object.set_global_pos(Vector2(object.x, -object.y - segment_offset))\n\nfunc destroy_unused_segment_by_id(id):\n if id < 0:\n return\n\n self.destroy_unused_segment(self.segments[id])\n\nfunc destroy_unused_segment(segment):\n for object in segment:\n self.bag.action_controller.detach_object(object.object)\n object.object.queue_free()\n\n segment.clear()\n\nfunc add_segment_object(segment, x, y, object):\n segment.append({\n 'x' : x,\n 'y' : y,\n 'object' : object\n })\n\n return segment\n\nfunc add_separator(segment):\n var separator_platform = self.separator_template.instance()\n segment = self.add_segment_object(segment, -10, self.SEGMENT_LINE_HEIGHT, separator_platform)\n return segment\n\nfunc add_walls(segment):\n var height = 0\n var left_wall\n var right_wall\n var wall_offset\n var real_height\n\n while height < self.SEGMENT_SIZE:\n left_wall = self.left_wall_template.instance()\n right_wall = self.right_wall_template.instance()\n\n wall_offset = self.SCREEN_MARGIN - self.WALL_HALF_WIDTH\n real_height = (height + self.WALL_HEIGHT \/ 2) * self.SEGMENT_LINE_HEIGHT\n segment = self.add_segment_object(segment, wall_offset, real_height, left_wall)\n segment = self.add_segment_object(segment, wall_offset + self.playable_width + self.WALL_HALF_WIDTH * 2, real_height, right_wall)\n\n height = height + self.WALL_HEIGHT\n return segment\n\nfunc update_segments(player_height):\n var segment_height = self.SEGMENT_SIZE * self.SEGMENT_LINE_HEIGHT\n var overflow = player_height % segment_height\n\n var segment_num = (player_height - overflow) \/ segment_height\n\n if overflow > 100 && segment_num > self.last_visited_segment:\n self.last_visited_segment = segment_num\n self.generate_next_map_segment()\n\nfunc add_platforms(segment):\n var iterator = 2\n var last_iterator = 0\n\n randomize()\n\n while iterator < self.SEGMENT_SIZE - 3:\n segment = self.generate_single_platform(segment, iterator)\n\n last_iterator = iterator\n\n if randi() % 10 == 0:\n iterator = iterator + 2\n else:\n if randi() % 2 == 0:\n iterator = iterator + 3\n else:\n iterator = iterator + 4\n\n if last_iterator < self.SEGMENT_SIZE - 3:\n segment = self.generate_single_platform(segment, self.SEGMENT_SIZE - 3)\n\n return segment\n\nfunc generate_single_platform(segment, iterator):\n var template = self.platforms[randi() % self.platforms.size()]\n var new_platform = template.template.instance()\n\n var horizontal_position = randi() % (self.playable_width - template.width)\n horizontal_position = horizontal_position + self.SCREEN_MARGIN + int(template.width \/ 2)\n\n segment = self.add_segment_object(segment, horizontal_position, (iterator + 1) * self.SEGMENT_LINE_HEIGHT, new_platform)\n\n return segment","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"57b0ca7dd5acf0fb2e7b3fa4491d96460f7b30bc","subject":"Avoid playing sound of the player's jump when player is no longer alive.","message":"Avoid playing sound of the player's jump when player is no longer alive.\n","repos":"CSaratakij\/jam-2016-remake","old_file":"src\/player\/player.gd","new_file":"src\/player\/player.gd","new_contents":"\nextends KinematicBody2D\n\nconst GRAVITY = 1000.0\nconst MOVE_SPEED = 260.0\nconst JUMP_FORCE = 230.0\nconst POINT = 1\nconst INIT_MOVE_DIRECTION = Vector2(1, 1)\n\nvar score = 0\nvar _velocity = Vector2()\nvar _motion = Vector2()\nvar is_grounded = false\nvar _move_direction = INIT_MOVE_DIRECTION\nvar current_floor = 1\nvar start_points = [\n\t\tMatrix32(0.0, Vector2(0, 80)),\n\t\tMatrix32(0.0, Vector2(715, 220)),\n\t\tMatrix32(0.0, Vector2(0, 360))\n\t]\n\nonready var tree = get_tree()\nonready var root = tree.get_root()\nonready var global = root.get_node(\"\/root\/global\")\nonready var _sprite = get_node(\"Sprite\")\nonready var _raycast = get_node(\"RayCast2D\")\nonready var _health = get_node(\"health\")\nonready var _sound_player = get_node(\"SamplePlayer\")\n\nfunc _ready():\n\tset_process(true)\n\tset_fixed_process(true)\n\nfunc _process(delta):\n\tif global.is_game_over():\n\t\t_sprite.hide()\n\telse:\n\t\t_sprite.show()\n\nfunc _fixed_process(delta):\n\tif _health.is_alive():\n\t\tis_grounded = _raycast.is_colliding()\n\t\t_velocity.y += _move_direction.y * GRAVITY * delta\n\t\n\t\tif not global.is_game_over():\n\t\t\t_velocity.x = _move_direction.x * MOVE_SPEED\n\t\telse:\n\t\t\t_velocity.x = 0.0\n\t\n\t\tif is_grounded:\n\t\t\tif Input.is_action_pressed(\"jump\"):\n\t\t\t\t_velocity.y = -JUMP_FORCE\n\t\t\t\t_sound_player.play(\"jump\")\n\t\n\t\t_motion = _velocity * delta\n\t\t_motion = move(_motion)\n\t\n\t\tif is_colliding():\n\t\t\tvar n = get_collision_normal()\n\t\t\t_motion = n.slide(_motion)\n\t\t\t_velocity = n.slide(_velocity)\n\t\t\tmove(_motion)\n\nfunc change_move_direction_h():\n\t_move_direction.x *= -1\n\nfunc reset_move_direction():\n\t_move_direction = INIT_MOVE_DIRECTION\n\nfunc _on_Area2D_area_enter( area ):\n\tif area.get_groups().has(\"switch_side_trigger\"):\n\t\tglobal.add_score(POINT)\n\t\t\n\t\tif area.get_name() == \"floor1-2\":\n\t\t\tcurrent_floor = 2\n\t\t\tset_transform(start_points[current_floor - 1])\n\t\t\tchange_move_direction_h()\n\t\t\t_sprite.set_flip_h(true)\n\t\t\n\t\telif area.get_name() == \"floor2-3\":\n\t\t\tcurrent_floor = 3\n\t\t\tset_transform(start_points[current_floor - 1])\n\t\t\tchange_move_direction_h()\n\t\t\t_sprite.set_flip_h(false)\n\t\t\n\t\telif area.get_name() == \"floor3-1\":\n\t\t\tcurrent_floor = 1\n\t\t\tset_transform(start_points[current_floor - 1])\n\n\nfunc _on_Area2D_body_enter( body ):\n\tif body.get_groups().has(\"totem\"):\n\t\t_health.remove(1)\n\t\t_sound_player.play(\"hit\")\n\t\tset_transform(start_points[current_floor - 1])\n","old_contents":"\nextends KinematicBody2D\n\nconst GRAVITY = 1000.0\nconst MOVE_SPEED = 260.0\nconst JUMP_FORCE = 230.0\nconst POINT = 1\nconst INIT_MOVE_DIRECTION = Vector2(1, 1)\n\nvar score = 0\nvar _velocity = Vector2()\nvar _motion = Vector2()\nvar is_grounded = false\nvar _move_direction = INIT_MOVE_DIRECTION\nvar current_floor = 1\nvar start_points = [\n\t\tMatrix32(0.0, Vector2(0, 80)),\n\t\tMatrix32(0.0, Vector2(715, 220)),\n\t\tMatrix32(0.0, Vector2(0, 360))\n\t]\n\nonready var tree = get_tree()\nonready var root = tree.get_root()\nonready var global = root.get_node(\"\/root\/global\")\nonready var _sprite = get_node(\"Sprite\")\nonready var _raycast = get_node(\"RayCast2D\")\nonready var _health = get_node(\"health\")\nonready var _sound_player = get_node(\"SamplePlayer\")\n\nfunc _ready():\n\tset_process(true)\n\tset_fixed_process(true)\n\nfunc _process(delta):\n\tif global.is_game_over():\n\t\t_sprite.hide()\n\telse:\n\t\t_sprite.show()\n\nfunc _fixed_process(delta):\n\tis_grounded = _raycast.is_colliding()\n\t_velocity.y += _move_direction.y * GRAVITY * delta\n\t\n\tif not global.is_game_over():\n\t\t_velocity.x = _move_direction.x * MOVE_SPEED\n\telse:\n\t\t_velocity.x = 0.0\n\t\n\tif is_grounded:\n\t\tif Input.is_action_pressed(\"jump\"):\n\t\t\t_velocity.y = -JUMP_FORCE\n\t\t\t_sound_player.play(\"jump\")\n\t\n\t_motion = _velocity * delta\n\t_motion = move(_motion)\n\t\n\tif is_colliding():\n\t\tvar n = get_collision_normal()\n\t\t_motion = n.slide(_motion)\n\t\t_velocity = n.slide(_velocity)\n\t\tmove(_motion)\n\nfunc change_move_direction_h():\n\t_move_direction.x *= -1\n\nfunc reset_move_direction():\n\t_move_direction = INIT_MOVE_DIRECTION\n\nfunc _on_Area2D_area_enter( area ):\n\tif area.get_groups().has(\"switch_side_trigger\"):\n\t\tglobal.add_score(POINT)\n\t\t\n\t\tif area.get_name() == \"floor1-2\":\n\t\t\tcurrent_floor = 2\n\t\t\tset_transform(start_points[current_floor - 1])\n\t\t\tchange_move_direction_h()\n\t\t\t_sprite.set_flip_h(true)\n\t\t\n\t\telif area.get_name() == \"floor2-3\":\n\t\t\tcurrent_floor = 3\n\t\t\tset_transform(start_points[current_floor - 1])\n\t\t\tchange_move_direction_h()\n\t\t\t_sprite.set_flip_h(false)\n\t\t\n\t\telif area.get_name() == \"floor3-1\":\n\t\t\tcurrent_floor = 1\n\t\t\tset_transform(start_points[current_floor - 1])\n\n\nfunc _on_Area2D_body_enter( body ):\n\tif body.get_groups().has(\"totem\"):\n\t\t_health.remove(1)\n\t\t_sound_player.play(\"hit\")\n\t\tset_transform(start_points[current_floor - 1])\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"cdeb610a13aaa70c017c7bafc09ece19f54c6b73","subject":"Update cubio.gd","message":"Update cubio.gd\n\na little wrong only.","repos":"vnen\/godot,gcbeyond\/godot,lietu\/godot,buckle2000\/godot,vnen\/godot,Zylann\/godot,BastiaanOlij\/godot,torgartor21\/godot,mikica1986vee\/GodotArrayEditorStuff,tomreyn\/godot,torgartor21\/godot,RebelliousX\/Go_Dot,sanikoyes\/godot,ZuBsPaCe\/godot,pkowal1982\/godot,est31\/godot,iap-mutant\/godot,blackwc\/godot,cpascal\/godot,BogusCurry\/godot,youprofit\/godot,sanikoyes\/godot,jackmakesthings\/godot,vnen\/godot,supriyantomaftuh\/godot,groud\/godot,liuyucoder\/godot,opmana\/godot,BoDonkey\/godot,HatiEth\/godot,tomreyn\/godot,pkowal1982\/godot,wardw\/godot,BoDonkey\/godot,mikica1986vee\/godot,sergicollado\/godot,tomasy23\/evertonkrosnodart,Shockblast\/godot,teamblubee\/godot,liuyucoder\/godot,gcbeyond\/godot,azurvii\/godot,marynate\/godot,MrMaidx\/godot,okamstudio\/godot,davidalpha\/godot,gokudomatic\/godot,groud\/godot,marynate\/godot,Faless\/godot,Shockblast\/godot,mikica1986vee\/Godot_android_tegra_fallback,BogusCurry\/godot,kimsunzun\/godot,jackmakesthings\/godot,ianholing\/godot,sh95119\/godot,ZuBsPaCe\/godot,xiaoyanit\/godot,jjdicharry\/godot,pixelpicosean\/my-godot-2.1,NateWardawg\/godot,davidalpha\/godot,kimsunzun\/godot,ianholing\/godot,mrezai\/godot,vnen\/godot,mikica1986vee\/GodotArrayEditorStuff,sergicollado\/godot,mikica1986vee\/godot,Valentactive\/godot,TheBoyThePlay\/godot,mikica1986vee\/Godot_VideoModeStuff,ficoos\/godot,mamarilmanson\/godot,mamarilmanson\/godot,didier-v\/godot,gcbeyond\/godot,mamarilmanson\/godot,FullMeta\/godot,Shockblast\/godot,RebelliousX\/Go_Dot,ZuBsPaCe\/godot,cpascal\/godot,mcanders\/godot,mcanders\/godot,n-pigeon\/godot,sergicollado\/godot,mikica1986vee\/godot,mamarilmanson\/godot,buckle2000\/godot,zj8487\/godot,agusbena\/godot,serafinfernandez\/godot,Faless\/godot,davidalpha\/godot,FullMeta\/godot,zj8487\/godot,sanikoyes\/godot,BogusCurry\/godot,gokudomatic\/godot,a12n\/godot,DmitriySalnikov\/godot,iap-mutant\/godot,zj8487\/godot,mamarilmanson\/godot,NateWardawg\/godot,FateAce\/godot,hitjim\/godot,mikica1986vee\/GodotArrayEditorStuff,teamblubee\/godot,Faless\/godot,jackmakesthings\/godot,Faless\/godot,guilhermefelipecgs\/godot,vkbsb\/godot,vkbsb\/godot,didier-v\/godot,mrezai\/godot,a12n\/godot,a12n\/godot,agusbena\/godot,exabon\/godot,teamblubee\/godot,vkbsb\/godot,sanikoyes\/godot,ianholing\/godot,xiaoyanit\/godot,Zylann\/godot,crr0004\/godot,FullMeta\/godot,DStomtom\/godot,davidalpha\/godot,firefly2442\/godot,firefly2442\/godot,sh95119\/godot,est31\/godot,DmitriySalnikov\/godot,vkbsb\/godot,pkowal1982\/godot,hipgraphics\/godot,opmana\/godot,mikica1986vee\/godot,teamblubee\/godot,Marqin\/godot,supriyantomaftuh\/godot,youprofit\/godot,Hodes\/godot,torgartor21\/godot,ex\/godot,n-pigeon\/godot,pixelpicosean\/my-godot-2.1,ageazrael\/godot,teamblubee\/godot,ianholing\/godot,hipgraphics\/godot,pkowal1982\/godot,tomasy23\/evertonkrosnodart,jjdicharry\/godot,Valentactive\/godot,FullMeta\/godot,DmitriySalnikov\/godot,DStomtom\/godot,firefly2442\/godot,n-pigeon\/godot,MarianoGnu\/godot,didier-v\/godot,quabug\/godot,rollenrolm\/godot,godotengine\/godot,BoDonkey\/godot,zicklag\/godot,josempans\/godot,wardw\/godot,mrezai\/godot,supriyantomaftuh\/godot,Marqin\/godot,didier-v\/godot,azurvii\/godot,agusbena\/godot,TheHX\/godot,wardw\/godot,cpascal\/godot,pkowal1982\/godot,pixelpicosean\/my-godot-2.1,gokudomatic\/godot,HatiEth\/godot,mikica1986vee\/Godot_android_tegra_fallback,mikica1986vee\/Godot_android_tegra_fallback,hipgraphics\/godot,huziyizero\/godot,teamblubee\/godot,liuyucoder\/godot,Zylann\/godot,FateAce\/godot,quabug\/godot,Valentactive\/godot,gau-veldt\/godot,NateWardawg\/godot,ianholing\/godot,BoDonkey\/godot,ficoos\/godot,BogusCurry\/godot,morrow1nd\/godot,mikica1986vee\/Godot_android_tegra_fallback,BoDonkey\/godot,groud\/godot,lietu\/godot,iap-mutant\/godot,mamarilmanson\/godot,ex\/godot,JoshuaGrams\/godot,Brickcaster\/godot,MrMaidx\/godot,zicklag\/godot,buckle2000\/godot,mcanders\/godot,gcbeyond\/godot,sh95119\/godot,torgartor21\/godot,cpascal\/godot,Zylann\/godot,tomasy23\/evertonkrosnodart,buckle2000\/godot,crr0004\/godot,FullMeta\/godot,pkowal1982\/godot,zicklag\/godot,RandomShaper\/godot,shackra\/godot,gau-veldt\/godot,rollenrolm\/godot,godotengine\/godot,exabon\/godot,Hodes\/godot,zj8487\/godot,morrow1nd\/godot,gokudomatic\/godot,zicklag\/godot,mcanders\/godot,guilhermefelipecgs\/godot,hipgraphics\/godot,zj8487\/godot,sh95119\/godot,DustinTriplett\/godot,quabug\/godot,shackra\/godot,torgartor21\/godot,MarianoGnu\/godot,mikica1986vee\/godot,josempans\/godot,buckle2000\/godot,honix\/godot,serafinfernandez\/godot,xiaoyanit\/godot,Paulloz\/godot,mikica1986vee\/GodotArrayEditorStuff,jejung\/godot,sh95119\/godot,torgartor21\/godot,Paulloz\/godot,zj8487\/godot,DustinTriplett\/godot,okamstudio\/godot,DStomtom\/godot,Max-Might\/godot,godotengine\/godot,DmitriySalnikov\/godot,FullMeta\/godot,youprofit\/godot,BastiaanOlij\/godot,okamstudio\/godot,Marqin\/godot,Marqin\/godot,quabug\/godot,hipgraphics\/godot,Max-Might\/godot,serafinfernandez\/godot,ricpelo\/godot,BogusCurry\/godot,lietu\/godot,xiaoyanit\/godot,zj8487\/godot,sergicollado\/godot,honix\/godot,kimsunzun\/godot,shackra\/godot,lietu\/godot,okamstudio\/godot,shackra\/godot,davidalpha\/godot,FullMeta\/godot,agusbena\/godot,agusbena\/godot,godotengine\/godot,firefly2442\/godot,FateAce\/godot,vnen\/godot,est31\/godot,BastiaanOlij\/godot,godotengine\/godot,dreamsxin\/godot,gcbeyond\/godot,est31\/godot,mcanders\/godot,MarianoGnu\/godot,Zylann\/godot,ricpelo\/godot,FateAce\/godot,ianholing\/godot,tomreyn\/godot,didier-v\/godot,sanikoyes\/godot,mamarilmanson\/godot,HatiEth\/godot,FateAce\/godot,dreamsxin\/godot,gcbeyond\/godot,akien-mga\/godot,jejung\/godot,a12n\/godot,vastcharade\/godot,Faless\/godot,akien-mga\/godot,jjdicharry\/godot,zj8487\/godot,firefly2442\/godot,josempans\/godot,DustinTriplett\/godot,wardw\/godot,azurvii\/godot,RandomShaper\/godot,Zylann\/godot,zicklag\/godot,mikica1986vee\/GodotArrayEditorStuff,DustinTriplett\/godot,morrow1nd\/godot,lietu\/godot,ianholing\/godot,torgartor21\/godot,vastcharade\/godot,josempans\/godot,OpenSocialGames\/godot,serafinfernandez\/godot,OpenSocialGames\/godot,ZuBsPaCe\/godot,shackra\/godot,mikica1986vee\/Godot_android_tegra_fallback,akien-mga\/godot,wardw\/godot,okamstudio\/godot,groud\/godot,TheHX\/godot,Zylann\/godot,gokudomatic\/godot,supriyantomaftuh\/godot,sergicollado\/godot,marynate\/godot,RebelliousX\/Go_Dot,josempans\/godot,est31\/godot,gokudomatic\/godot,ZuBsPaCe\/godot,BogusCurry\/godot,sergicollado\/godot,mikica1986vee\/GodotArrayEditorStuff,dreamsxin\/godot,FullMeta\/godot,didier-v\/godot,youprofit\/godot,mamarilmanson\/godot,azurvii\/godot,Shockblast\/godot,exabon\/godot,TheBoyThePlay\/godot,mamarilmanson\/godot,HatiEth\/godot,dreamsxin\/godot,iap-mutant\/godot,guilhermefelipecgs\/godot,ficoos\/godot,sh95119\/godot,vastcharade\/godot,teamblubee\/godot,BogusCurry\/godot,guilhermefelipecgs\/godot,RandomShaper\/godot,xiaoyanit\/godot,josempans\/godot,Brickcaster\/godot,Valentactive\/godot,BoDonkey\/godot,quabug\/godot,FullMeta\/godot,HatiEth\/godot,karolgotowala\/godot,RandomShaper\/godot,karolgotowala\/godot,lietu\/godot,Hodes\/godot,dreamsxin\/godot,shackra\/godot,vnen\/godot,a12n\/godot,vastcharade\/godot,NateWardawg\/godot,jackmakesthings\/godot,sergicollado\/godot,HatiEth\/godot,FullMeta\/godot,firefly2442\/godot,liuyucoder\/godot,quabug\/godot,davidalpha\/godot,RebelliousX\/Go_Dot,blackwc\/godot,Valentactive\/godot,mamarilmanson\/godot,agusbena\/godot,BogusCurry\/godot,DStomtom\/godot,Max-Might\/godot,Brickcaster\/godot,gcbeyond\/godot,DStomtom\/godot,RebelliousX\/Go_Dot,davidalpha\/godot,jejung\/godot,OpenSocialGames\/godot,azurvii\/godot,vkbsb\/godot,mikica1986vee\/Godot_android_tegra_fallback,mikica1986vee\/godot,Shockblast\/godot,xiaoyanit\/godot,karolgotowala\/godot,mikica1986vee\/godot,azurvii\/godot,Hodes\/godot,kimsunzun\/godot,mikica1986vee\/Godot_VideoModeStuff,didier-v\/godot,marynate\/godot,vastcharade\/godot,RandomShaper\/godot,tomasy23\/evertonkrosnodart,Marqin\/godot,mrezai\/godot,akien-mga\/godot,crr0004\/godot,honix\/godot,ricpelo\/godot,JoshuaGrams\/godot,dreamsxin\/godot,supriyantomaftuh\/godot,serafinfernandez\/godot,JoshuaGrams\/godot,mikica1986vee\/Godot_VideoModeStuff,BastiaanOlij\/godot,dreamsxin\/godot,hitjim\/godot,ricpelo\/godot,Shockblast\/godot,cpascal\/godot,TheBoyThePlay\/godot,Max-Might\/godot,morrow1nd\/godot,groud\/godot,torgartor21\/godot,blackwc\/godot,blackwc\/godot,mikica1986vee\/GodotArrayEditorStuff,gau-veldt\/godot,liuyucoder\/godot,a12n\/godot,sh95119\/godot,a12n\/godot,kimsunzun\/godot,DustinTriplett\/godot,firefly2442\/godot,BoDonkey\/godot,lietu\/godot,iap-mutant\/godot,ex\/godot,jackmakesthings\/godot,Faless\/godot,morrow1nd\/godot,ianholing\/godot,kimsunzun\/godot,liuyucoder\/godot,BastiaanOlij\/godot,BoDonkey\/godot,MrMaidx\/godot,TheBoyThePlay\/godot,TheHX\/godot,karolgotowala\/godot,sergicollado\/godot,teamblubee\/godot,BastiaanOlij\/godot,MrMaidx\/godot,ageazrael\/godot,NateWardawg\/godot,NateWardawg\/godot,DStomtom\/godot,dreamsxin\/godot,Paulloz\/godot,NateWardawg\/godot,huziyizero\/godot,lietu\/godot,DmitriySalnikov\/godot,gokudomatic\/godot,hipgraphics\/godot,jejung\/godot,youprofit\/godot,iap-mutant\/godot,torgartor21\/godot,MarianoGnu\/godot,ageazrael\/godot,ianholing\/godot,marynate\/godot,liuyucoder\/godot,ricpelo\/godot,huziyizero\/godot,BastiaanOlij\/godot,sh95119\/godot,jjdicharry\/godot,ageazrael\/godot,jackmakesthings\/godot,youprofit\/godot,godotengine\/godot,hitjim\/godot,tomasy23\/evertonkrosnodart,HatiEth\/godot,crr0004\/godot,TheBoyThePlay\/godot,rollenrolm\/godot,hitjim\/godot,didier-v\/godot,xiaoyanit\/godot,hitjim\/godot,a12n\/godot,cpascal\/godot,buckle2000\/godot,TheHX\/godot,JoshuaGrams\/godot,wardw\/godot,ageazrael\/godot,kimsunzun\/godot,HatiEth\/godot,agusbena\/godot,ianholing\/godot,TheBoyThePlay\/godot,cpascal\/godot,liuyucoder\/godot,mikica1986vee\/Godot_VideoModeStuff,cpascal\/godot,opmana\/godot,teamblubee\/godot,mikica1986vee\/godot,mrezai\/godot,sanikoyes\/godot,sanikoyes\/godot,ricpelo\/godot,OpenSocialGames\/godot,pkowal1982\/godot,supriyantomaftuh\/godot,mrezai\/godot,DStomtom\/godot,cpascal\/godot,tomasy23\/evertonkrosnodart,honix\/godot,youprofit\/godot,quabug\/godot,gokudomatic\/godot,karolgotowala\/godot,ageazrael\/godot,Brickcaster\/godot,blackwc\/godot,Shockblast\/godot,jjdicharry\/godot,Valentactive\/godot,ficoos\/godot,jackmakesthings\/godot,tomasy23\/evertonkrosnodart,liuyucoder\/godot,JoshuaGrams\/godot,ricpelo\/godot,jjdicharry\/godot,kimsunzun\/godot,tomreyn\/godot,tomreyn\/godot,Max-Might\/godot,jackmakesthings\/godot,quabug\/godot,Brickcaster\/godot,wardw\/godot,sh95119\/godot,vastcharade\/godot,DustinTriplett\/godot,n-pigeon\/godot,DStomtom\/godot,jjdicharry\/godot,guilhermefelipecgs\/godot,liuyucoder\/godot,mikica1986vee\/Godot_android_tegra_fallback,guilhermefelipecgs\/godot,blackwc\/godot,n-pigeon\/godot,ex\/godot,youprofit\/godot,vkbsb\/godot,pixelpicosean\/my-godot-2.1,Valentactive\/godot,Marqin\/godot,gcbeyond\/godot,mrezai\/godot,DustinTriplett\/godot,wardw\/godot,guilhermefelipecgs\/godot,davidalpha\/godot,mikica1986vee\/Godot_android_tegra_fallback,vkbsb\/godot,mikica1986vee\/Godot_VideoModeStuff,Paulloz\/godot,shackra\/godot,vnen\/godot,mikica1986vee\/godot,FateAce\/godot,TheBoyThePlay\/godot,NateWardawg\/godot,pkowal1982\/godot,Valentactive\/godot,opmana\/godot,didier-v\/godot,supriyantomaftuh\/godot,gokudomatic\/godot,BastiaanOlij\/godot,supriyantomaftuh\/godot,iap-mutant\/godot,ex\/godot,gau-veldt\/godot,mcanders\/godot,okamstudio\/godot,hitjim\/godot,blackwc\/godot,josempans\/godot,OpenSocialGames\/godot,TheBoyThePlay\/godot,jjdicharry\/godot,kimsunzun\/godot,exabon\/godot,mikica1986vee\/GodotArrayEditorStuff,morrow1nd\/godot,rollenrolm\/godot,iap-mutant\/godot,Max-Might\/godot,jackmakesthings\/godot,marynate\/godot,cpascal\/godot,blackwc\/godot,BoDonkey\/godot,crr0004\/godot,Paulloz\/godot,Zylann\/godot,a12n\/godot,mikica1986vee\/GodotArrayEditorStuff,youprofit\/godot,dreamsxin\/godot,honix\/godot,akien-mga\/godot,DStomtom\/godot,didier-v\/godot,gokudomatic\/godot,OpenSocialGames\/godot,serafinfernandez\/godot,zicklag\/godot,DStomtom\/godot,jackmakesthings\/godot,mikica1986vee\/Godot_android_tegra_fallback,hitjim\/godot,rollenrolm\/godot,lietu\/godot,crr0004\/godot,sanikoyes\/godot,MrMaidx\/godot,iap-mutant\/godot,Hodes\/godot,opmana\/godot,shackra\/godot,hitjim\/godot,shackra\/godot,karolgotowala\/godot,lietu\/godot,DmitriySalnikov\/godot,BogusCurry\/godot,marynate\/godot,Faless\/godot,ZuBsPaCe\/godot,ricpelo\/godot,wardw\/godot,ex\/godot,TheHX\/godot,vastcharade\/godot,MarianoGnu\/godot,karolgotowala\/godot,marynate\/godot,ricpelo\/godot,akien-mga\/godot,mikica1986vee\/Godot_VideoModeStuff,serafinfernandez\/godot,RebelliousX\/Go_Dot,karolgotowala\/godot,HatiEth\/godot,xiaoyanit\/godot,godotengine\/godot,blackwc\/godot,hitjim\/godot,JoshuaGrams\/godot,ZuBsPaCe\/godot,shackra\/godot,dreamsxin\/godot,guilhermefelipecgs\/godot,wardw\/godot,OpenSocialGames\/godot,honix\/godot,DustinTriplett\/godot,okamstudio\/godot,jjdicharry\/godot,mikica1986vee\/Godot_VideoModeStuff,ex\/godot,teamblubee\/godot,Brickcaster\/godot,marynate\/godot,Shockblast\/godot,josempans\/godot,firefly2442\/godot,karolgotowala\/godot,sergicollado\/godot,huziyizero\/godot,gau-veldt\/godot,xiaoyanit\/godot,ZuBsPaCe\/godot,jejung\/godot,OpenSocialGames\/godot,exabon\/godot,OpenSocialGames\/godot,n-pigeon\/godot,hipgraphics\/godot,xiaoyanit\/godot,blackwc\/godot,crr0004\/godot,tomasy23\/evertonkrosnodart,serafinfernandez\/godot,sergicollado\/godot,okamstudio\/godot,Hodes\/godot,gcbeyond\/godot,vastcharade\/godot,vkbsb\/godot,pixelpicosean\/my-godot-2.1,vastcharade\/godot,iap-mutant\/godot,MarianoGnu\/godot,Paulloz\/godot,davidalpha\/godot,youprofit\/godot,vnen\/godot,NateWardawg\/godot,okamstudio\/godot,ficoos\/godot,MarianoGnu\/godot,Brickcaster\/godot,serafinfernandez\/godot,zj8487\/godot,torgartor21\/godot,quabug\/godot,supriyantomaftuh\/godot,davidalpha\/godot,exabon\/godot,quabug\/godot,DmitriySalnikov\/godot,crr0004\/godot,a12n\/godot,Paulloz\/godot,serafinfernandez\/godot,OpenSocialGames\/godot,jejung\/godot,crr0004\/godot,RandomShaper\/godot,Faless\/godot,ricpelo\/godot,hipgraphics\/godot,huziyizero\/godot,TheBoyThePlay\/godot,ficoos\/godot,agusbena\/godot,godotengine\/godot,mikica1986vee\/godot,MrMaidx\/godot,groud\/godot,kimsunzun\/godot,ex\/godot,akien-mga\/godot,n-pigeon\/godot,ageazrael\/godot,BoDonkey\/godot,BogusCurry\/godot,supriyantomaftuh\/godot,hitjim\/godot,hipgraphics\/godot,MarianoGnu\/godot,marynate\/godot,mikica1986vee\/Godot_VideoModeStuff,jjdicharry\/godot,mrezai\/godot,crr0004\/godot,gcbeyond\/godot,akien-mga\/godot,mikica1986vee\/GodotArrayEditorStuff,karolgotowala\/godot,TheBoyThePlay\/godot,est31\/godot,sh95119\/godot,mikica1986vee\/Godot_android_tegra_fallback,vastcharade\/godot,zj8487\/godot,RandomShaper\/godot,HatiEth\/godot,okamstudio\/godot,hipgraphics\/godot","old_file":"demos\/3d\/kinematic_char\/cubio.gd","new_file":"demos\/3d\/kinematic_char\/cubio.gd","new_contents":"\nextends KinematicBody\n\n# member variables here, example:\n# var a=2\n# var b=\"textvar\"\n\nvar g = -9.8\nvar vel = Vector3()\nconst MAX_SPEED = 5\nconst JUMP_SPEED = 7\nconst ACCEL= 2\nconst DEACCEL= 4\nconst MAX_SLOPE_ANGLE = 30\n\nfunc _fixed_process(delta):\n\n\tvar dir = Vector3() #where does the player intend to walk to\n\tvar cam_xform = get_node(\"target\/camera\").get_global_transform()\n\t\n\tif (Input.is_action_pressed(\"move_forward\")):\n\t\tdir+=-cam_xform.basis[2] \n\tif (Input.is_action_pressed(\"move_backwards\")):\n\t\tdir+=cam_xform.basis[2] \n\tif (Input.is_action_pressed(\"move_left\")):\n\t\tdir+=-cam_xform.basis[0] \n\tif (Input.is_action_pressed(\"move_right\")):\n\t\tdir+=cam_xform.basis[0] \n\n\tdir.y=0\n\tdir=dir.normalized()\n\n\tvel.y+=delta*g\n\t\n\tvar hvel = vel\n\thvel.y=0\t\n\t\n\tvar target = dir*MAX_SPEED\n\tvar accel\n\tif (dir.dot(hvel) >0):\n\t\taccel=ACCEL\n\telse:\n\t\taccel=DEACCEL\n\t\t\n\thvel = hvel.linear_interpolate(target,accel*delta)\n\t\n\tvel.x=hvel.x;\n\tvel.z=hvel.z\t\n\t\t\n\tvar motion = vel*delta\n\tmotion=move(vel*delta)\n\n\tvar on_floor = false\n\tvar original_vel = vel\n\n\n\tvar floor_velocity=Vector3()\n\n\tvar attempts=4\n\t\n\twhile(is_colliding() and attempts):\n\t\tvar n=get_collision_normal()\n\n\t\tif ( rad2deg(acos(n.dot( Vector3(0,1,0)))) < MAX_SLOPE_ANGLE ):\n\t\t\t\t#if angle to the \"up\" vectors is < angle tolerance\n\t\t\t\t#char is on floor\n\t\t\t\tfloor_velocity=get_collider_velocity()\n\t\t\t\ton_floor=true\t\t\t\n\t\t\t\n\t\tmotion = n.slide(motion)\n\t\tvel = n.slide(vel)\n\t\tif (original_vel.dot(vel) > 0):\n\t\t\t#do not allow to slide towads the opposite direction we were coming from\n\t\t\tmotion=move(motion)\n\t\t\tif (motion.length()<0.001):\n\t\t\t\tbreak\n\t\tattempts-=1\n\n\tif (on_floor and floor_velocity!=Vector3()):\n\t\t\tmove(floor_velocity*delta)\n\t\n\tif (on_floor and Input.is_action_pressed(\"jump\")):\n\t\tvel.y=JUMP_SPEED\n\t\t\n\tvar crid = get_node(\"..\/elevator1\").get_rid()\n#\tprint(crid,\" : \",PS.body_get_state(crid,PS.BODY_STATE_TRANSFORM))\n\nfunc _ready():\n\t# Initalization here\n\tset_fixed_process(true)\n\tpass\n\n\nfunc _on_tcube_body_enter( body ):\n\tget_node(\"..\/ty\").show()\n\tpass # replace with function body\n","old_contents":"\nextends KinematicBody\n\n# member variables here, example:\n# var a=2\n# var b=\"textvar\"\n\nvar g = -9.8\nvar vel = Vector3()\nconst MAX_SPEED = 5\nconst JUMP_SPEED = 7\nconst ACCEL= 2\nconst DEACCEL= 4\nconst MAX_SLOPE_ANGLE = 30\n\nfunc _fixed_process(delta):\n\n\tvar dir = Vector3() #where does the player intend to walk to\n\tvar cam_xform = get_node(\"target\/camera\").get_global_transform()\n\t\n\tif (Input.is_action_pressed(\"move_forward\")):\n\t\tdir+=-cam_xform.basis[2] \n\tif (Input.is_action_pressed(\"move_backwards\")):\n\t\tdir+=cam_xform.basis[2] \n\tif (Input.is_action_pressed(\"move_left\")):\n\t\tdir+=-cam_xform.basis[0] \n\tif (Input.is_action_pressed(\"move_right\")):\n\t\tdir+=cam_xform.basis[0] \n\n\tdir.y=0\n\tdir=dir.normalized()\n\n\tvel.y+=delta*g\n\t\n\tvar hvel = vel\n\thvel.y=0\t\n\t\n\tvar target = dir*MAX_SPEED\n\tvar accel\n\tif (dir.dot(hvel) >0):\n\t\taccel=ACCEL\n\telse:\n\t\taccel=DEACCEL\n\t\t\n\thvel = hvel.linear_interpolate(target,accel*delta)\n\t\n\tvel.x=hvel.x;\n\tvel.z=hvel.z\t\n\t\t\n\tvar motion = vel*delta\n\tmotion=move(vel*delta)\n\n\tvar on_floor = false\n\tvar original_vel = vel\n\n\n\tvar floor_velocity=Vector2()\n\n\tvar attempts=4\n\t\n\twhile(is_colliding() and attempts):\n\t\tvar n=get_collision_normal()\n\n\t\tif ( rad2deg(acos(n.dot( Vector3(0,1,0)))) < MAX_SLOPE_ANGLE ):\n\t\t\t\t#if angle to the \"up\" vectors is < angle tolerance\n\t\t\t\t#char is on floor\n\t\t\t\tfloor_velocity=get_collider_velocity()\n\t\t\t\ton_floor=true\t\t\t\n\t\t\t\n\t\tmotion = n.slide(motion)\n\t\tvel = n.slide(vel)\n\t\tif (original_vel.dot(vel) > 0):\n\t\t\t#do not allow to slide towads the opposite direction we were coming from\n\t\t\tmotion=move(motion)\n\t\t\tif (motion.length()<0.001):\n\t\t\t\tbreak\n\t\tattempts-=1\n\n\tif (on_floor and floor_velocity!=Vector3()):\n\t\t\tmove(floor_velocity*delta)\n\t\n\tif (on_floor and Input.is_action_pressed(\"jump\")):\n\t\tvel.y=JUMP_SPEED\n\t\t\n\tvar crid = get_node(\"..\/elevator1\").get_rid()\n#\tprint(crid,\" : \",PS.body_get_state(crid,PS.BODY_STATE_TRANSFORM))\n\nfunc _ready():\n\t# Initalization here\n\tset_fixed_process(true)\n\tpass\n\n\nfunc _on_tcube_body_enter( body ):\n\tget_node(\"..\/ty\").show()\n\tpass # replace with function body\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"0e3a6e5ecd565b5b17229bc9ed2e5ae4fa87cdb3","subject":"Reduce Magic number in ui life","message":"Reduce Magic number in ui life\n","repos":"CSaratakij\/jam-2016-remake","old_file":"src\/ui\/ui_life.gd","new_file":"src\/ui\/ui_life.gd","new_contents":"\nextends HBoxContainer\n\nconst RECT_WIDTH = 20\nconst RECT_HEIGHT = 20\n\nvar rects_life = [\n\t\tRect2(0, 0, RECT_WIDTH * 0, RECT_HEIGHT),\n\t\tRect2(0, 0, RECT_WIDTH * 1, RECT_HEIGHT),\n\t\tRect2(0, 0, RECT_WIDTH * 2, RECT_HEIGHT),\n\t\tRect2(0, 0, RECT_WIDTH * 3, RECT_HEIGHT)\n\t]\n\nvar current_life = 0\nvar current_rect_life = 0\n\nonready var tree = get_tree()\nonready var _life_sprite = get_node(\"Sprite\")\nonready var _health = tree.get_nodes_in_group(\"player\")[0].get_node(\"health\")\n\nfunc _ready():\n\tset_process(true)\n\nfunc _process(delta):\n\tcurrent_life = _health.get_current_life()\n\tcurrent_rect_life = rects_life[current_life]\n\t_life_sprite.set_region_rect(current_rect_life)\n","old_contents":"\nextends HBoxContainer\n\nconst RECT_HEIGHT = 20\nconst RECT_STEP_WIDTH = [0, 20, 40, 60]\n\nonready var tree = get_tree()\nonready var _life_sprite = get_node(\"Sprite\")\nonready var _health = tree.get_nodes_in_group(\"player\")[0].get_node(\"health\")\n\nfunc _ready():\n\tset_process(true)\n\nfunc _process(delta):\n\t_life_sprite.set_region_rect(Rect2(0.0, 0.0, RECT_STEP_WIDTH[_health.get_current_life()], RECT_HEIGHT))","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"6a2359f901f77f611a8779c3bc9e6c9b40b9198e","subject":"Using Xinerama extension for getting screen info","message":"Using Xinerama extension for getting screen info\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"misc\/window_management\/control.gd","new_file":"misc\/window_management\/control.gd","new_contents":"\nextends Control\n\nfunc _fixed_process(delta):\n\tif(OS.is_fullscreen()):\n\t\tget_node(\"Label_Fullscreen\").set_text(\"Mode:\\nFullscreen\")\n\telse:\n\t\tget_node(\"Label_Fullscreen\").set_text(\"Mode:\\nWindowed\")\n\t\n\tget_node(\"Label_Position\").set_text( str(\"Position:\\n\", OS.get_window_position() ) )\n\t\n\tget_node(\"Label_Size\").set_text(str(\"Size:\\n\", OS.get_window_size() ) )\n\t\n\tget_node(\"Label_Screen_Count\").set_text( str(\"Screens:\\n\", OS.get_screen_count() ) )\n\t\n\tget_node(\"Label_Screen0_Resolution\").set_text( str(\"Screen0 Resolution:\\n\", OS.get_screen_size() ) )\n\t\n\tget_node(\"Label_Screen0_Position\").set_text(str(\"Screen0 Position:\\n\",OS.get_screen_position()))\n\t\n\tif(OS.get_screen_count() > 1):\n\t\tget_node(\"Label_Screen1_Resolution\").show()\n\t\tget_node(\"Label_Screen1_Resolution\").set_text( str(\"Screen1 Resolution:\\n\", OS.get_screen_size(1) ) )\n\t\tget_node(\"Label_Screen1_Position\").show()\n\t\tget_node(\"Label_Screen1_Position\").set_text( str(\"Screen1 Position:\\n\", OS.get_screen_position(1) ) )\n\telse:\n\t\tget_node(\"Label_Screen1_Resolution\").hide()\n\t\tget_node(\"Label_Screen1_Position\").hide()\nfunc _ready():\n\tset_fixed_process(true)\n\n\nfunc _on_Fullscreen_toggled( pressed ):\n\tif(pressed):\n\t\tOS.set_fullscreen(true)\n\telse:\n\t\tOS.set_fullscreen(false)\n\n\nfunc _on_Button_MoveTo_pressed():\n\tOS.set_window_position( Vector2(100,100) )\n\n\nfunc _on_Button_Resize_pressed():\n\tOS.set_window_size( Vector2(1024,768) )\n","old_contents":"\nextends Control\n\nfunc _fixed_process(delta):\n\tif(OS.is_fullscreen()):\n\t\tget_node(\"Label_Fullscreen\").set_text(\"Mode:\\nFullscreen\")\n\telse:\n\t\tget_node(\"Label_Fullscreen\").set_text(\"Mode:\\nWindowed\")\n\t\n\tget_node(\"Label_Position\").set_text( str(\"Position:\\n\", OS.get_window_position() ) )\n\t\n\tget_node(\"Label_Size\").set_text(str(\"Size:\\n\", OS.get_window_size() ) )\n\t\n\tget_node(\"Label_Screen_Count\").set_text( str(\"Screens:\\n\", OS.get_screen_count() ) )\n\t\n\tget_node(\"Label_Screen0_Resolution\").set_text( str(\"Screen0 Resolution:\\n\", OS.get_screen_size() ) )\n\t\n\tget_node(\"Label_Screen0_Position\").set_text(str(\"Screen0 Position:\\n\",OS.get_screen_position()))\n\t\n\tif(OS.get_screen_count() > 1):\n\t\tget_node(\"Label_Screen1_Resolution\").show()\n\t\tget_node(\"Label_Screen1_Resolution\").set_text( str(\"Screen1 Resolution:\\n\", OS.get_screen_size(1) ) )\n\t\tget_node(\"Label_Screen1_Position\").show()\n\t\tget_node(\"Label_Screen1_Position\").set_text( str(\"Screen1 Position:\\n\", OS.get_screen_size(1) ) )\n\telse:\n\t\tget_node(\"Label_Screen1_Resolution\").hide()\n\t\tget_node(\"Label_Screen1_Position\").hide()\nfunc _ready():\n\tset_fixed_process(true)\n\n\nfunc _on_Fullscreen_toggled( pressed ):\n\tif(pressed):\n\t\tOS.set_fullscreen(true)\n\telse:\n\t\tOS.set_fullscreen(false)\n\n\nfunc _on_Button_MoveTo_pressed():\n\tOS.set_window_position( Vector2(100,100) )\n\n\nfunc _on_Button_Resize_pressed():\n\tOS.set_window_size( Vector2(1024,768) )\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"429581cfcc4c0e772abb11b0065e46c0f621fb0e","subject":"Adjust child_blocks when moving","message":"Adjust child_blocks when moving\n","repos":"mvr\/abyme","old_file":"Block.gd","new_file":"Block.gd","new_contents":"extends Node2D\n\n################################################################################\n### Vars\n\n# Gameplay\nonready var tilemap = self.get_node(\"TileMap\")\nenum TILES {TILE_EMPTY, TILE_WALL}\n\nexport(NodePath) var parent_block_path = null\nexport(Vector2) var position_on_parent = Vector2(0, 0)\nexport(bool) var is_player = false\n\nvar parent_block = null\nvar child_blocks = []\n\n# TODO: calculate?\nvar size = 5\n\n# Movement animation\nvar is_moving = false\nvar move_vector = Vector2(0.0, 0.0)\nvar previous_parent = null\nvar previous_position_on_parent = self.position_on_parent\nexport var move_duration = 0.5\nvar current_move_time = 0\n\n# Drawing\nonready var viewport = self.get_node(\"SelfViewport\")\nonready var self_rect = self.get_self_rect()\n\n################################################################################\n### Setup\n\nfunc _ready():\n\t# Add to block group\n\tself.add_to_group(\"blocks\")\n\n\t# Setup viewport\n\tviewport.set_world_2d(self.get_world_2d())\n\tviewport.set_rect(self.self_rect)\n\t#viewport.set_size_override(true, self.self_rect.size)\n\tvar transform = Matrix32(0, -self.self_rect.pos)\n\tviewport.set_canvas_transform(transform)\n\n\tself.set_fixed_process(true)\n\tself.set_process_input(true) # TODO: do input once in Level\n\n################################################################################\n### Parents and Siblings\n\nfunc find_children():\n\tvar all_blocks = get_tree().get_nodes_in_group(\"blocks\")\n\tvar child_blocks = []\n\tfor b in all_blocks:\n\t\tif b.parent_block == self:\n\t\t\tchild_blocks.append(b)\n\treturn child_blocks\n\nfunc set_child_blocks():\n\tself.child_blocks = self.find_children()\n\nfunc find_parent_block():\n\tself.parent_block = self.get_node(self.parent_block_path)\n\tself.previous_parent = self.parent_block\n\n################################################################################\n### Block position\n# Represents a square in the world\n\nclass BlockPosition:\n\tvar block = null\n\tvar position = Vector2(0, 0)\n\n\tfunc _init(b, p):\n\t\tself.block = b\n\t\tself.position = p\n\n\tfunc get_tile_id():\n\t\treturn self.block.tilemap.get_cell(self.position.x, self.position.y)\n\n\tfunc adjacent(direction):\n\t\treturn adjacent_recurse(direction, self.block)\n\n\tfunc direction_to_vect(direction):\n\t\tif direction == \"left\":\n\t\t\treturn Vector2(-1, 0)\n\t\telif direction == \"right\":\n\t\t\treturn Vector2(1, 0)\n\t\telif direction == \"up\":\n\t\t\treturn Vector2(0, -1)\n\t\telif direction == \"down\":\n\t\t\treturn Vector2(0, 1)\n\n\tfunc adjacent_recurse(direction, original):\n\t\tvar newpos = self.position + self.direction_to_vect(direction)\n\n\t\tif newpos.x < 0:\n\t\t\tnewpos.x = self.block.size - 1\n\t\telif newpos.x >= self.block.size:\n\t\t\tnewpos.x = 0\n\t\telif newpos.y < 0:\n\t\t\tnewpos.y = self.block.size - 1\n\t\telif newpos.y >= self.block.size:\n\t\t\tnewpos.y = 0\n\t\telse:\n\t\t\treturn get_script().new(self.block, newpos)\n\n\t\t# We left the block\n\n\t\tif self.block.parent_block == original:\n\t\t\treturn null\n\n\t\tvar newsquare = self.block.own_position().adjacent_recurse(direction, original)\n\n\t\tif newsquare == null:\n\t\t\treturn null\n\n\t\tvar newblock = newsquare.block_at()\n\n\t\tif newblock == null:\n\t\t\treturn null\n\n\t\treturn get_script().new(newblock, newpos)\n\n\tfunc is_underlying_walkable():\n\t\treturn self.get_tile_id() == TILE_EMPTY\n\n\tfunc block_at():\n\t\tfor b in self.block.child_blocks:\n\t\t\tif b.position_on_parent == self.position:\n\t\t\t\treturn b\n\t\treturn null\n\n\tfunc is_empty():\n\t\tif not self.is_underlying_walkable():\n\t\t\treturn false\n\n\t\tif not self.block_at() == null:\n\t\t\treturn false\n\n\t\treturn true\n\nfunc own_position():\n\treturn BlockPosition.new(parent_block, position_on_parent)\n\nfunc adjacent_blocks():\n\treturn adjacent_blocks_with_displacement().keys()\n\nfunc adjacent_blocks_with_displacement():\n\tvar adjacents = {}\n\tvar a = null\n\n\ta = self.own_position().adjacent(\"left\")\n\tif not a == null:\n\t\tvar b = a.block_at()\n\t\tif not b == null:\n\t\t\tadjacents[b] = Vector2(-1, 0)\n\n\ta = self.own_position().adjacent(\"right\")\n\tif not a == null:\n\t\tvar b = a.block_at()\n\t\tif not b == null:\n\t\t\tadjacents[b] = Vector2(1, 0)\n\n\ta = self.own_position().adjacent(\"up\")\n\tif not a == null:\n\t\tvar b = a.block_at()\n\t\tif not b == null:\n\t\t\tadjacents[b] = Vector2(0, -1)\n\n\ta = self.own_position().adjacent(\"down\")\n\tif not a == null:\n\t\tvar b = a.block_at()\n\t\tif not b == null:\n\t\t\tadjacents[b] = Vector2(0, 1)\n\n\treturn adjacents\n\n################################################################################\n### Drawing\n\nfunc get_self_rect():\n\tvar pos = tilemap.get_global_pos()\n\t# TODO: scale?\n\tvar s = self.size * tilemap.get_cell_size()\n\treturn Rect2(pos, s)\n\nfunc draw_self_on(block, position):\n\tvar texture = self.viewport.get_render_target_texture()\n\n\tvar to_parent_transform = block.get_global_transform() * self.get_global_transform().affine_inverse()\n\n\tvar tile_size = self.tilemap.get_cell_size() # TODO: self?\n\tvar drawrect = Rect2(position, tile_size)\n\n\tself.draw_set_transform_matrix(to_parent_transform)\n\tself.draw_texture_rect(texture, drawrect, false)\n\nfunc _draw():\n\tif self.is_moving:\n\t\tvar t = easing_function(self.current_move_time \/ self.move_duration)\n\n\t\tvar newpos = self.parent_block.tilemap.map_to_world(self.position_on_parent)\n\t\tvar oldpos = self.parent_block.tilemap.map_to_world(self.position_on_parent - self.move_vector)\n\n\t\tvar pos = interpolate(t, oldpos, newpos)\n\t\tdraw_self_on(self.parent_block, pos)\n\n\t\tif not self.previous_parent == self.parent_block:\n\t\t\tvar newpos = self.previous_parent.tilemap.map_to_world(self.previous_position_on_parent + self.move_vector)\n\t\t\tvar oldpos = self.previous_parent.tilemap.map_to_world(self.previous_position_on_parent)\n\n\t\t\tvar pos = interpolate(t, oldpos, newpos)\n\t\t\tdraw_self_on(self.previous_parent, pos)\n\telse:\n\t\tvar worldcoords = self.parent_block.tilemap.map_to_world(self.position_on_parent)\n\t\tdraw_self_on(self.parent_block, worldcoords)\n\nfunc interpolate(t, x1, x2):\n\treturn (1-t)*x1 + t*x2\n\nfunc easing_function(t):\n\tvar u0 = 0\n\tvar u1 = 0.2\n\tvar u2 = 0.95\n\tvar u3 = 1\n\treturn u0 * (1-t*t*t) + 3*u1*(1-t*t)*t + 3*u2*(1-t)*t*t + u3*t*t*t*t\n\nfunc _fixed_process(delta):\n\tif self.is_moving:\n\t\tself.current_move_time += delta\n\t\tif self.current_move_time > self.move_duration:\n\t\t\tself.is_moving = false\n\t\t\tself.current_move_time = 0\n\n\t\tself.update()\n\n################################################################################\n### Movement\n\nfunc try_move(direction):\n\tif self.is_moving:\n\t\treturn\n\n\tvar a = self.own_position().adjacent(direction)\n\tif a == null:\n\t\treturn\n\n\tif a.is_empty():\n\t\tdo_move(direction, a)\n\nfunc do_move(direction, new_square):\n\tself.is_moving = true\n\n\t# TODO: silly\n\tself.move_vector = self.own_position().direction_to_vect(direction)\n\n\tself.previous_parent = self.parent_block\n\tself.previous_position_on_parent = self.position_on_parent\n\n\tself.parent_block = new_square.block\n\tself.position_on_parent = new_square.position\n\n\tif not self.parent_block == self.previous_parent:\n\t\tself.previous_parent.child_blocks.erase(self)\n\t\tself.parent_block.children.append(self)\n\nfunc _input(event):\n\tif not self.is_player:\n\t\treturn\n\n\tif event.is_action_pressed(\"move_left\"):\n\t\tself.try_move(\"left\")\n\n\tif event.is_action_pressed(\"move_right\"):\n\t\tself.try_move(\"right\")\n\n\tif event.is_action_pressed(\"move_up\"):\n\t\tself.try_move(\"up\")\n\n\tif event.is_action_pressed(\"move_down\"):\n\t\tself.try_move(\"down\")\n","old_contents":"extends Node2D\n\n################################################################################\n### Vars\n\n# Gameplay\nonready var tilemap = self.get_node(\"TileMap\")\nenum TILES {TILE_EMPTY, TILE_WALL}\n\nexport(NodePath) var parent_block_path = null\nexport(Vector2) var position_on_parent = Vector2(0, 0)\nexport(bool) var is_player = false\n\nvar parent_block = null\nvar child_blocks = []\n\n# TODO: calculate?\nvar size = 5\n\n# Movement animation\nvar is_moving = false\nvar move_vector = Vector2(0.0, 0.0)\nvar previous_parent = null\nvar previous_position_on_parent = self.position_on_parent\nexport var move_duration = 0.5\nvar current_move_time = 0\n\n# Drawing\nonready var viewport = self.get_node(\"SelfViewport\")\nonready var self_rect = self.get_self_rect()\n\n################################################################################\n### Setup\n\nfunc _ready():\n\t# Add to block group\n\tself.add_to_group(\"blocks\")\n\n\t# Setup viewport\n\tviewport.set_world_2d(self.get_world_2d())\n\tviewport.set_rect(self.self_rect)\n\t#viewport.set_size_override(true, self.self_rect.size)\n\tvar transform = Matrix32(0, -self.self_rect.pos)\n\tviewport.set_canvas_transform(transform)\n\n\tself.set_fixed_process(true)\n\tself.set_process_input(true) # TODO: do input once in Level\n\n################################################################################\n### Parents and Siblings\n\nfunc find_children():\n\tvar all_blocks = get_tree().get_nodes_in_group(\"blocks\")\n\tvar child_blocks = []\n\tfor b in all_blocks:\n\t\tif b.parent_block == self:\n\t\t\tchild_blocks.append(b)\n\treturn child_blocks\n\nfunc set_child_blocks():\n\tself.child_blocks = self.find_children()\n\nfunc find_parent_block():\n\tself.parent_block = self.get_node(self.parent_block_path)\n\tself.previous_parent = self.parent_block\n\n################################################################################\n### Block position\n# Represents a square in the world\n\nclass BlockPosition:\n\tvar block = null\n\tvar position = Vector2(0, 0)\n\n\tfunc _init(b, p):\n\t\tself.block = b\n\t\tself.position = p\n\n\tfunc get_tile_id():\n\t\treturn self.block.tilemap.get_cell(self.position.x, self.position.y)\n\n\tfunc adjacent(direction):\n\t\treturn adjacent_recurse(direction, self.block)\n\n\tfunc direction_to_vect(direction):\n\t\tif direction == \"left\":\n\t\t\treturn Vector2(-1, 0)\n\t\telif direction == \"right\":\n\t\t\treturn Vector2(1, 0)\n\t\telif direction == \"up\":\n\t\t\treturn Vector2(0, -1)\n\t\telif direction == \"down\":\n\t\t\treturn Vector2(0, 1)\n\n\tfunc adjacent_recurse(direction, original):\n\t\tvar newpos = self.position + self.direction_to_vect(direction)\n\n\t\tif newpos.x < 0:\n\t\t\tnewpos.x = self.block.size - 1\n\t\telif newpos.x >= self.block.size:\n\t\t\tnewpos.x = 0\n\t\telif newpos.y < 0:\n\t\t\tnewpos.y = self.block.size - 1\n\t\telif newpos.y >= self.block.size:\n\t\t\tnewpos.y = 0\n\t\telse:\n\t\t\treturn get_script().new(self.block, newpos)\n\n\t\t# We left the block\n\n\t\tif self.block.parent_block == original:\n\t\t\treturn null\n\n\t\tvar newsquare = self.block.own_position().adjacent_recurse(direction, original)\n\n\t\tif newsquare == null:\n\t\t\treturn null\n\n\t\tvar newblock = newsquare.block_at()\n\n\t\tif newblock == null:\n\t\t\treturn null\n\n\t\treturn get_script().new(newblock, newpos)\n\n\tfunc is_underlying_walkable():\n\t\treturn self.get_tile_id() == TILE_EMPTY\n\n\tfunc block_at():\n\t\tfor b in self.block.child_blocks:\n\t\t\tif b.position_on_parent == self.position:\n\t\t\t\treturn b\n\t\treturn null\n\n\tfunc is_empty():\n\t\tif not self.is_underlying_walkable():\n\t\t\treturn false\n\n\t\tif not self.block_at() == null:\n\t\t\treturn false\n\n\t\treturn true\n\nfunc own_position():\n\treturn BlockPosition.new(parent_block, position_on_parent)\n\nfunc adjacent_blocks():\n\treturn adjacent_blocks_with_displacement().keys()\n\nfunc adjacent_blocks_with_displacement():\n\tvar adjacents = {}\n\tvar a = null\n\n\ta = self.own_position().adjacent(\"left\")\n\tif not a == null:\n\t\tvar b = a.block_at()\n\t\tif not b == null:\n\t\t\tadjacents[b] = Vector2(-1, 0)\n\n\ta = self.own_position().adjacent(\"right\")\n\tif not a == null:\n\t\tvar b = a.block_at()\n\t\tif not b == null:\n\t\t\tadjacents[b] = Vector2(1, 0)\n\n\ta = self.own_position().adjacent(\"up\")\n\tif not a == null:\n\t\tvar b = a.block_at()\n\t\tif not b == null:\n\t\t\tadjacents[b] = Vector2(0, -1)\n\n\ta = self.own_position().adjacent(\"down\")\n\tif not a == null:\n\t\tvar b = a.block_at()\n\t\tif not b == null:\n\t\t\tadjacents[b] = Vector2(0, 1)\n\n\treturn adjacents\n\n################################################################################\n### Drawing\n\nfunc get_self_rect():\n\tvar pos = tilemap.get_global_pos()\n\t# TODO: scale?\n\tvar s = self.size * tilemap.get_cell_size()\n\treturn Rect2(pos, s)\n\nfunc draw_self_on(block, position):\n\tvar texture = self.viewport.get_render_target_texture()\n\n\tvar to_parent_transform = block.get_global_transform() * self.get_global_transform().affine_inverse()\n\n\tvar tile_size = self.tilemap.get_cell_size() # TODO: self?\n\tvar drawrect = Rect2(position, tile_size)\n\n\tself.draw_set_transform_matrix(to_parent_transform)\n\tself.draw_texture_rect(texture, drawrect, false)\n\nfunc _draw():\n\tif self.is_moving:\n\t\tvar t = easing_function(self.current_move_time \/ self.move_duration)\n\n\t\tvar newpos = self.parent_block.tilemap.map_to_world(self.position_on_parent)\n\t\tvar oldpos = self.parent_block.tilemap.map_to_world(self.position_on_parent - self.move_vector)\n\n\t\tvar pos = interpolate(t, oldpos, newpos)\n\t\tdraw_self_on(self.parent_block, pos)\n\n\t\tif not self.previous_parent == self.parent_block:\n\t\t\tvar newpos = self.previous_parent.tilemap.map_to_world(self.previous_position_on_parent + self.move_vector)\n\t\t\tvar oldpos = self.previous_parent.tilemap.map_to_world(self.previous_position_on_parent)\n\n\t\t\tvar pos = interpolate(t, oldpos, newpos)\n\t\t\tdraw_self_on(self.previous_parent, pos)\n\telse:\n\t\tvar worldcoords = self.parent_block.tilemap.map_to_world(self.position_on_parent)\n\t\tdraw_self_on(self.parent_block, worldcoords)\n\nfunc interpolate(t, x1, x2):\n\treturn (1-t)*x1 + t*x2\n\nfunc easing_function(t):\n\tvar u0 = 0\n\tvar u1 = 0.2\n\tvar u2 = 0.95\n\tvar u3 = 1\n\treturn u0 * (1-t*t*t) + 3*u1*(1-t*t)*t + 3*u2*(1-t)*t*t + u3*t*t*t*t\n\nfunc _fixed_process(delta):\n\tif self.is_moving:\n\t\tself.current_move_time += delta\n\t\tif self.current_move_time > self.move_duration:\n\t\t\tself.is_moving = false\n\t\t\tself.current_move_time = 0\n\t\t\tself.previous_parent = self.parent_block\n\t\t\tself.previous_position_on_parent = self.position_on_parent\n\n\t\tself.update()\n\n################################################################################\n### Movement\n\nfunc try_move(direction):\n\tif self.is_moving:\n\t\treturn\n\n\tvar a = self.own_position().adjacent(direction)\n\tif a == null:\n\t\treturn\n\n\tif a.is_empty():\n\t\tdo_move(direction, a)\n\nfunc do_move(direction, new_square):\n\tself.is_moving = true\n\n\t# TODO: silly\n\tself.move_vector = self.own_position().direction_to_vect(direction)\n\n\t# TODO! Possibly update child blocks\n\tself.parent_block = new_square.block\n\tself.position_on_parent = new_square.position\n\nfunc _input(event):\n\tif not self.is_player:\n\t\treturn\n\n\tif event.is_action_pressed(\"move_left\"):\n\t\tself.try_move(\"left\")\n\n\tif event.is_action_pressed(\"move_right\"):\n\t\tself.try_move(\"right\")\n\n\tif event.is_action_pressed(\"move_up\"):\n\t\tself.try_move(\"up\")\n\n\tif event.is_action_pressed(\"move_down\"):\n\t\tself.try_move(\"down\")\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"GDScript"} {"commit":"d7e10522057bc7cb765661fd3545d8f3ca44985d","subject":"Fix MIDI devices scanning","message":"Fix MIDI devices scanning\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"misc\/os_test\/os_test.gd","new_file":"misc\/os_test\/os_test.gd","new_contents":"extends Node\n\nonready var rtl = $HBoxContainer\/Features\nonready var mono_test = $MonoTest\n\n\n# Returns a human-readable string from a date and time, date, or time dictionary.\nfunc datetime_to_string(date):\n\tif (\n\t\tdate.has(\"year\")\n\t\tand date.has(\"month\")\n\t\tand date.has(\"day\")\n\t\tand date.has(\"hour\")\n\t\tand date.has(\"minute\")\n\t\tand date.has(\"second\")\n\t):\n\t\t# Date and time.\n\t\treturn \"{year}-{month}-{day} {hour}:{minute}:{second}\".format({\n\t\t\tyear = str(date.year).pad_zeros(2),\n\t\t\tmonth = str(date.month).pad_zeros(2),\n\t\t\tday = str(date.day).pad_zeros(2),\n\t\t\thour = str(date.hour).pad_zeros(2),\n\t\t\tminute = str(date.minute).pad_zeros(2),\n\t\t\tsecond = str(date.second).pad_zeros(2),\n\t\t})\n\telif date.has(\"year\") and date.has(\"month\") and date.has(\"day\"):\n\t\t# Date only.\n\t\treturn \"{year}-{month}-{day}\".format({\n\t\t\tyear = str(date.year).pad_zeros(2),\n\t\t\tmonth = str(date.month).pad_zeros(2),\n\t\t\tday = str(date.day).pad_zeros(2),\n\t\t})\n\telse:\n\t\t# Time only.\n\t\treturn \"{hour}:{minute}:{second}\".format({\n\t\t\thour = str(date.hour).pad_zeros(2),\n\t\t\tminute = str(date.minute).pad_zeros(2),\n\t\t\tsecond = str(date.second).pad_zeros(2),\n\t\t})\n\n\nfunc scan_midi_devices():\n\tOS.open_midi_inputs()\n\tvar devices = OS.get_connected_midi_inputs().join(\", \")\n\tOS.close_midi_inputs()\n\treturn devices\n\n\nfunc add_header(header):\n\trtl.append_bbcode(\"\\n[b][u][color=#6df]{header}[\/color][\/u][\/b]\\n\".format({\n\t\theader = header,\n\t}))\n\n\nfunc add_line(key, value):\n\trtl.append_bbcode(\"[b]{key}:[\/b] {value}\\n\".format({\n\t\tkey = key,\n\t\tvalue = value if str(value) != \"\" else \"[color=#8fff](empty)[\/color]\",\n\t}))\n\n\nfunc _ready():\n\tadd_header(\"Audio\")\n\tvar audio_drivers = PoolStringArray()\n\tfor i in OS.get_audio_driver_count():\n\t\taudio_drivers.push_back(OS.get_audio_driver_name(i))\n\tadd_line(\"Available drivers\", audio_drivers.join(\", \"))\n\tadd_line(\"MIDI inputs\", scan_midi_devices())\n\n\tadd_header(\"Date\")\n\tadd_line(\"Date and time (local)\", datetime_to_string(OS.get_datetime()))\n\tadd_line(\"Date and time (UTC)\", datetime_to_string(OS.get_datetime(true)))\n\tadd_line(\"Date (local)\", datetime_to_string(OS.get_date()))\n\tadd_line(\"Date (UTC)\", datetime_to_string(OS.get_date(true)))\n\tadd_line(\"Time (local)\", datetime_to_string(OS.get_time()))\n\tadd_line(\"Time (UTC)\", datetime_to_string(OS.get_time(true)))\n\tadd_line(\"Timezone\", OS.get_time_zone_info())\n\tadd_line(\"System time (milliseconds)\", OS.get_system_time_msecs())\n\tadd_line(\"System time (seconds)\", OS.get_system_time_secs())\n\tadd_line(\"UNIX time\", OS.get_unix_time())\n\n\tadd_header(\"Display\")\n\tadd_line(\"Screen count\", OS.get_screen_count())\n\tadd_line(\"DPI\", OS.get_screen_dpi())\n\tadd_line(\"Startup screen position\", OS.get_screen_position())\n\tadd_line(\"Startup screen size\", OS.get_screen_size())\n\tadd_line(\"Safe area rectangle\", OS.get_window_safe_area())\n\tadd_line(\"Screen orientation\", [\n\t\t\"Landscape\",\n\t\t\"Portrait\",\n\t\t\"Landscape (reverse)\",\n\t\t\"Portrait (reverse)\",\n\t\t\"Landscape (defined by sensor)\",\n\t\t\"Portrait (defined by sensor)\",\n\t\t\"Defined by sensor\",\n\t][OS.screen_orientation])\n\n\tadd_header(\"Engine\")\n\tadd_line(\"Command-line arguments\", str(OS.get_cmdline_args()))\n\tadd_line(\"Is debug build\", OS.is_debug_build())\n\tadd_line(\"Executable path\", OS.get_executable_path())\n\tadd_line(\"User data directory\", OS.get_user_data_dir())\n\tadd_line(\"Filesystem is persistent\", OS.is_userfs_persistent())\n\n\tadd_header(\"Environment\")\n\tadd_line(\"Value of `PATH`\", OS.get_environment(\"PATH\"))\n\tadd_line(\"Value of `path`\", OS.get_environment(\"path\"))\n\n\tadd_header(\"Hardware\")\n\tadd_line(\"Model name\", OS.get_model_name())\n\tadd_line(\"Processor count\", OS.get_processor_count())\n\tadd_line(\"Device unique ID\", OS.get_unique_id())\n\tadd_line(\"Video adapter name\", VisualServer.get_video_adapter_name())\n\tadd_line(\"Video adapter vendor\", VisualServer.get_video_adapter_vendor())\n\n\tadd_header(\"Input\")\n\tadd_line(\"Latin keyboard variant\", OS.get_latin_keyboard_variant())\n\tadd_line(\"Device has touch screen\", OS.has_touchscreen_ui_hint())\n\tadd_line(\"Device has virtual keyboard\", OS.has_virtual_keyboard())\n\tadd_line(\"Virtual keyboard height\", OS.get_virtual_keyboard_height())\n\n\tadd_header(\"Localization\")\n\tadd_line(\"Locale\", OS.get_locale())\n\n\tadd_header(\"Mobile\")\n\tadd_line(\"Granted permissions\", OS.get_granted_permissions())\n\n\tadd_header(\"Mono (C#)\")\n\tvar mono_enabled = ResourceLoader.exists(\"res:\/\/MonoTest.cs\")\n\tadd_line(\"Mono module enabled\", \"Yes\" if mono_enabled else \"No\")\n\tif mono_enabled:\n\t\tmono_test.set_script(load(\"res:\/\/MonoTest.cs\"))\n\t\tadd_line(\"Operating System\", mono_test.OperatingSystem())\n\t\tadd_line(\"Platform Type\", mono_test.PlatformType())\n\n\tadd_header(\"Software\")\n\tadd_line(\"OS name\", OS.get_name())\n\tadd_line(\"Process ID\", OS.get_process_id())\n\n\tadd_header(\"System directories\")\n\tadd_line(\"Desktop\", OS.get_system_dir(OS.SYSTEM_DIR_DESKTOP))\n\tadd_line(\"DCIM\", OS.get_system_dir(OS.SYSTEM_DIR_DCIM))\n\tadd_line(\"Documents\", OS.get_system_dir(OS.SYSTEM_DIR_DOCUMENTS))\n\tadd_line(\"Downloads\", OS.get_system_dir(OS.SYSTEM_DIR_DOWNLOADS))\n\tadd_line(\"Movies\", OS.get_system_dir(OS.SYSTEM_DIR_MOVIES))\n\tadd_line(\"Music\", OS.get_system_dir(OS.SYSTEM_DIR_MUSIC))\n\tadd_line(\"Pictures\", OS.get_system_dir(OS.SYSTEM_DIR_PICTURES))\n\tadd_line(\"Ringtones\", OS.get_system_dir(OS.SYSTEM_DIR_RINGTONES))\n\n\tadd_header(\"Video\")\n\tvar video_drivers = PoolStringArray()\n\tfor i in OS.get_video_driver_count():\n\t\tvideo_drivers.push_back(OS.get_video_driver_name(i))\n\tadd_line(\"Available drivers\", video_drivers.join(\", \"))\n\tadd_line(\"Current driver\", OS.get_video_driver_name(OS.get_current_video_driver()))\n","old_contents":"extends Node\n\nonready var rtl = $HBoxContainer\/Features\nonready var mono_test = $MonoTest\n\n\n# Returns a human-readable string from a date and time, date, or time dictionary.\nfunc datetime_to_string(date):\n\tif (\n\t\tdate.has(\"year\")\n\t\tand date.has(\"month\")\n\t\tand date.has(\"day\")\n\t\tand date.has(\"hour\")\n\t\tand date.has(\"minute\")\n\t\tand date.has(\"second\")\n\t):\n\t\t# Date and time.\n\t\treturn \"{year}-{month}-{day} {hour}:{minute}:{second}\".format({\n\t\t\tyear = str(date.year).pad_zeros(2),\n\t\t\tmonth = str(date.month).pad_zeros(2),\n\t\t\tday = str(date.day).pad_zeros(2),\n\t\t\thour = str(date.hour).pad_zeros(2),\n\t\t\tminute = str(date.minute).pad_zeros(2),\n\t\t\tsecond = str(date.second).pad_zeros(2),\n\t\t})\n\telif date.has(\"year\") and date.has(\"month\") and date.has(\"day\"):\n\t\t# Date only.\n\t\treturn \"{year}-{month}-{day}\".format({\n\t\t\tyear = str(date.year).pad_zeros(2),\n\t\t\tmonth = str(date.month).pad_zeros(2),\n\t\t\tday = str(date.day).pad_zeros(2),\n\t\t})\n\telse:\n\t\t# Time only.\n\t\treturn \"{hour}:{minute}:{second}\".format({\n\t\t\thour = str(date.hour).pad_zeros(2),\n\t\t\tminute = str(date.minute).pad_zeros(2),\n\t\t\tsecond = str(date.second).pad_zeros(2),\n\t\t})\n\n\nfunc add_header(header):\n\trtl.append_bbcode(\"\\n[b][u][color=#6df]{header}[\/color][\/u][\/b]\\n\".format({\n\t\theader = header,\n\t}))\n\n\nfunc add_line(key, value):\n\trtl.append_bbcode(\"[b]{key}:[\/b] {value}\\n\".format({\n\t\tkey = key,\n\t\tvalue = value if str(value) != \"\" else \"[color=#8fff](empty)[\/color]\",\n\t}))\n\n\nfunc _ready():\n\tadd_header(\"Audio\")\n\tvar audio_drivers = PoolStringArray()\n\tfor i in OS.get_audio_driver_count():\n\t\taudio_drivers.push_back(OS.get_audio_driver_name(i))\n\tadd_line(\"Available drivers\", audio_drivers.join(\", \"))\n\tadd_line(\"MIDI inputs\", OS.get_connected_midi_inputs().join(\", \"))\n\n\tadd_header(\"Date\")\n\tadd_line(\"Date and time (local)\", datetime_to_string(OS.get_datetime()))\n\tadd_line(\"Date and time (UTC)\", datetime_to_string(OS.get_datetime(true)))\n\tadd_line(\"Date (local)\", datetime_to_string(OS.get_date()))\n\tadd_line(\"Date (UTC)\", datetime_to_string(OS.get_date(true)))\n\tadd_line(\"Time (local)\", datetime_to_string(OS.get_time()))\n\tadd_line(\"Time (UTC)\", datetime_to_string(OS.get_time(true)))\n\tadd_line(\"Timezone\", OS.get_time_zone_info())\n\tadd_line(\"System time (milliseconds)\", OS.get_system_time_msecs())\n\tadd_line(\"System time (seconds)\", OS.get_system_time_secs())\n\tadd_line(\"UNIX time\", OS.get_unix_time())\n\n\tadd_header(\"Display\")\n\tadd_line(\"Screen count\", OS.get_screen_count())\n\tadd_line(\"DPI\", OS.get_screen_dpi())\n\tadd_line(\"Startup screen position\", OS.get_screen_position())\n\tadd_line(\"Startup screen size\", OS.get_screen_size())\n\tadd_line(\"Safe area rectangle\", OS.get_window_safe_area())\n\tadd_line(\"Screen orientation\", [\n\t\t\"Landscape\",\n\t\t\"Portrait\",\n\t\t\"Landscape (reverse)\",\n\t\t\"Portrait (reverse)\",\n\t\t\"Landscape (defined by sensor)\",\n\t\t\"Portrait (defined by sensor)\",\n\t\t\"Defined by sensor\",\n\t][OS.screen_orientation])\n\n\tadd_header(\"Engine\")\n\tadd_line(\"Command-line arguments\", str(OS.get_cmdline_args()))\n\tadd_line(\"Is debug build\", OS.is_debug_build())\n\tadd_line(\"Executable path\", OS.get_executable_path())\n\tadd_line(\"User data directory\", OS.get_user_data_dir())\n\tadd_line(\"Filesystem is persistent\", OS.is_userfs_persistent())\n\n\tadd_header(\"Environment\")\n\tadd_line(\"Value of `PATH`\", OS.get_environment(\"PATH\"))\n\tadd_line(\"Value of `path`\", OS.get_environment(\"path\"))\n\n\tadd_header(\"Hardware\")\n\tadd_line(\"Model name\", OS.get_model_name())\n\tadd_line(\"Processor count\", OS.get_processor_count())\n\tadd_line(\"Device unique ID\", OS.get_unique_id())\n\tadd_line(\"Video adapter name\", VisualServer.get_video_adapter_name())\n\tadd_line(\"Video adapter vendor\", VisualServer.get_video_adapter_vendor())\n\n\tadd_header(\"Input\")\n\tadd_line(\"Latin keyboard variant\", OS.get_latin_keyboard_variant())\n\tadd_line(\"Device has touch screen\", OS.has_touchscreen_ui_hint())\n\tadd_line(\"Device has virtual keyboard\", OS.has_virtual_keyboard())\n\tadd_line(\"Virtual keyboard height\", OS.get_virtual_keyboard_height())\n\n\tadd_header(\"Localization\")\n\tadd_line(\"Locale\", OS.get_locale())\n\n\tadd_header(\"Mobile\")\n\tadd_line(\"Granted permissions\", OS.get_granted_permissions())\n\n\tadd_header(\"Mono (C#)\")\n\tvar mono_enabled = ResourceLoader.exists(\"res:\/\/MonoTest.cs\")\n\tadd_line(\"Mono module enabled\", \"Yes\" if mono_enabled else \"No\")\n\tif mono_enabled:\n\t\tmono_test.set_script(load(\"res:\/\/MonoTest.cs\"))\n\t\tadd_line(\"Operating System\", mono_test.OperatingSystem())\n\t\tadd_line(\"Platform Type\", mono_test.PlatformType())\n\n\tadd_header(\"Software\")\n\tadd_line(\"OS name\", OS.get_name())\n\tadd_line(\"Process ID\", OS.get_process_id())\n\n\tadd_header(\"System directories\")\n\tadd_line(\"Desktop\", OS.get_system_dir(OS.SYSTEM_DIR_DESKTOP))\n\tadd_line(\"DCIM\", OS.get_system_dir(OS.SYSTEM_DIR_DCIM))\n\tadd_line(\"Documents\", OS.get_system_dir(OS.SYSTEM_DIR_DOCUMENTS))\n\tadd_line(\"Downloads\", OS.get_system_dir(OS.SYSTEM_DIR_DOWNLOADS))\n\tadd_line(\"Movies\", OS.get_system_dir(OS.SYSTEM_DIR_MOVIES))\n\tadd_line(\"Music\", OS.get_system_dir(OS.SYSTEM_DIR_MUSIC))\n\tadd_line(\"Pictures\", OS.get_system_dir(OS.SYSTEM_DIR_PICTURES))\n\tadd_line(\"Ringtones\", OS.get_system_dir(OS.SYSTEM_DIR_RINGTONES))\n\n\tadd_header(\"Video\")\n\tvar video_drivers = PoolStringArray()\n\tfor i in OS.get_video_driver_count():\n\t\tvideo_drivers.push_back(OS.get_video_driver_name(i))\n\tadd_line(\"Available drivers\", video_drivers.join(\", \"))\n\tadd_line(\"Current driver\", OS.get_video_driver_name(OS.get_current_video_driver()))\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"6832f6068fbad9fe97b46a5854364154b7c09dd3","subject":"Added different platforms","message":"Added different platforms\n","repos":"w84death\/mountain-of-hope","old_file":"scripts\/map\/map.gd","new_file":"scripts\/map\/map.gd","new_contents":"\nvar bag\n\nvar segments = []\nvar last_visited_segment = -1\n\nvar SCREEN_WIDTH = Globals.get(\"display\/width\")\nvar SCREEN_HEIGHT = Globals.get(\"display\/height\")\nvar SCREEN_MARGIN = 200\n\nvar SEGMENT_SIZE = 60\nvar SEGMENT_LINE_HEIGHT = 36\n\nvar WALL_HEIGHT = 39\nvar WALL_HALF_WIDTH = 36\n\nvar platforms = {\n 'grass' : [\n { 'width' : 100, 'template' : preload('res:\/\/scenes\/map\/platform_grass_big.xscn') },\n { 'width' : 100, 'template' : preload('res:\/\/scenes\/map\/platform_grass_medium.xscn') },\n { 'width' : 100, 'template' : preload('res:\/\/scenes\/map\/platform_grass_small.xscn') }\n ],\n 'ice' : [\n { 'width' : 100, 'template' : preload('res:\/\/scenes\/map\/platform_ice_big.xscn') },\n { 'width' : 100, 'template' : preload('res:\/\/scenes\/map\/platform_ice_medium.xscn') },\n { 'width' : 100, 'template' : preload('res:\/\/scenes\/map\/platform_ice_small.xscn') }\n ]\n}\n\n\nvar left_wall_template = preload('res:\/\/scenes\/map\/wall_left.xscn')\nvar right_wall_template = preload('res:\/\/scenes\/map\/wall_right.xscn')\nvar separator_template = preload('res:\/\/scenes\/map\/base_platform.xscn')\nvar playable_width = 0\n\n\nfunc _init_bag(bag):\n self.bag = bag\n self.playable_width = self.SCREEN_WIDTH - (self.SCREEN_MARGIN * 2)\n self.reset_map()\n\nfunc reset_map():\n for segment in self.segments:\n self.destroy_unused_segment(segment)\n self.segments.clear()\n\n\nfunc generate_next_map_segment():\n var next_segment_index = self.segments.size()\n\n var new_segment = []\n\n new_segment = self.add_walls(new_segment)\n new_segment = self.add_separator(new_segment)\n new_segment = self.add_platforms(new_segment, next_segment_index)\n\n self.segments.append(new_segment)\n self.apply_segment(next_segment_index)\n self.destroy_unused_segment_by_id(next_segment_index - 3)\n\nfunc apply_segment(id):\n var segment_offset = id * self.SEGMENT_SIZE * self.SEGMENT_LINE_HEIGHT\n for object in self.segments[id]:\n self.bag.action_controller.attach_object(object.object)\n object.object.set_global_pos(Vector2(object.x, -object.y - segment_offset))\n\nfunc destroy_unused_segment_by_id(id):\n if id < 0:\n return\n\n self.destroy_unused_segment(self.segments[id])\n\nfunc destroy_unused_segment(segment):\n for object in segment:\n self.bag.action_controller.detach_object(object.object)\n object.object.queue_free()\n\n segment.clear()\n\nfunc add_segment_object(segment, x, y, object):\n segment.append({\n 'x' : x,\n 'y' : y,\n 'object' : object\n })\n\n return segment\n\nfunc add_separator(segment):\n var separator_platform = self.separator_template.instance()\n segment = self.add_segment_object(segment, -10, self.SEGMENT_LINE_HEIGHT, separator_platform)\n return segment\n\nfunc add_walls(segment):\n var height = 0\n var left_wall\n var right_wall\n var wall_offset\n var real_height\n\n while height < self.SEGMENT_SIZE:\n left_wall = self.left_wall_template.instance()\n right_wall = self.right_wall_template.instance()\n\n wall_offset = self.SCREEN_MARGIN - self.WALL_HALF_WIDTH\n real_height = (height + self.WALL_HEIGHT \/ 2) * self.SEGMENT_LINE_HEIGHT\n segment = self.add_segment_object(segment, wall_offset, real_height, left_wall)\n segment = self.add_segment_object(segment, wall_offset + self.playable_width + self.WALL_HALF_WIDTH * 2, real_height, right_wall)\n\n height = height + self.WALL_HEIGHT\n return segment\n\nfunc update_segments(player_height):\n var segment_height = self.SEGMENT_SIZE * self.SEGMENT_LINE_HEIGHT\n var overflow = player_height % segment_height\n\n var segment_num = (player_height - overflow) \/ segment_height\n\n if overflow > 100 && segment_num > self.last_visited_segment:\n self.last_visited_segment = segment_num\n self.generate_next_map_segment()\n\nfunc add_platforms(segment, index):\n var iterator = 2\n var last_iterator = 0\n\n var templates\n if index < 3:\n templates = self.platforms.grass\n else:\n templates = self.platforms.ice\n\n randomize()\n\n while iterator < self.SEGMENT_SIZE - 2:\n segment = self.generate_single_platform(segment, iterator, templates)\n\n last_iterator = iterator\n\n if randi() % 10 == 0:\n iterator = iterator + 5\n else:\n iterator = iterator + 4\n\n if last_iterator < self.SEGMENT_SIZE - 4:\n segment = self.generate_single_platform(segment, self.SEGMENT_SIZE - 2, templates)\n\n return segment\n\nfunc generate_single_platform(segment, iterator, templates):\n var template = templates[randi() % templates.size()]\n var new_platform = template.template.instance()\n\n var horizontal_position = randi() % (self.playable_width - template.width)\n horizontal_position = horizontal_position + self.SCREEN_MARGIN + int(template.width \/ 2)\n\n segment = self.add_segment_object(segment, horizontal_position, (iterator + 1) * self.SEGMENT_LINE_HEIGHT, new_platform)\n\n return segment","old_contents":"\nvar bag\n\nvar segments = []\nvar last_visited_segment = -1\n\nvar SCREEN_WIDTH = Globals.get(\"display\/width\")\nvar SCREEN_HEIGHT = Globals.get(\"display\/height\")\nvar SCREEN_MARGIN = 200\n\nvar SEGMENT_SIZE = 60\nvar SEGMENT_LINE_HEIGHT = 36\n\nvar WALL_HEIGHT = 39\nvar WALL_HALF_WIDTH = 36\n\nvar platforms = [\n { 'width' : 100, 'template' : preload('res:\/\/scenes\/map\/platform_grass.xscn') }\n]\n\nvar left_wall_template = preload('res:\/\/scenes\/map\/wall_left.xscn')\nvar right_wall_template = preload('res:\/\/scenes\/map\/wall_right.xscn')\nvar separator_template = preload('res:\/\/scenes\/map\/base_platform.xscn')\nvar playable_width = 0\n\n\nfunc _init_bag(bag):\n self.bag = bag\n self.playable_width = self.SCREEN_WIDTH - (self.SCREEN_MARGIN * 2)\n self.reset_map()\n\nfunc reset_map():\n for segment in self.segments:\n self.destroy_unused_segment(segment)\n self.segments.clear()\n\n\nfunc generate_next_map_segment():\n var next_segment_index = self.segments.size()\n\n var new_segment = []\n\n new_segment = self.add_walls(new_segment)\n new_segment = self.add_separator(new_segment)\n new_segment = self.add_platforms(new_segment)\n\n self.segments.append(new_segment)\n self.apply_segment(next_segment_index)\n self.destroy_unused_segment_by_id(next_segment_index - 3)\n\nfunc apply_segment(id):\n var segment_offset = id * self.SEGMENT_SIZE * self.SEGMENT_LINE_HEIGHT\n for object in self.segments[id]:\n self.bag.action_controller.attach_object(object.object)\n object.object.set_global_pos(Vector2(object.x, -object.y - segment_offset))\n\nfunc destroy_unused_segment_by_id(id):\n if id < 0:\n return\n\n self.destroy_unused_segment(self.segments[id])\n\nfunc destroy_unused_segment(segment):\n for object in segment:\n self.bag.action_controller.detach_object(object.object)\n object.object.queue_free()\n\n segment.clear()\n\nfunc add_segment_object(segment, x, y, object):\n segment.append({\n 'x' : x,\n 'y' : y,\n 'object' : object\n })\n\n return segment\n\nfunc add_separator(segment):\n var separator_platform = self.separator_template.instance()\n segment = self.add_segment_object(segment, -10, self.SEGMENT_LINE_HEIGHT, separator_platform)\n return segment\n\nfunc add_walls(segment):\n var height = 0\n var left_wall\n var right_wall\n var wall_offset\n var real_height\n\n while height < self.SEGMENT_SIZE:\n left_wall = self.left_wall_template.instance()\n right_wall = self.right_wall_template.instance()\n\n wall_offset = self.SCREEN_MARGIN - self.WALL_HALF_WIDTH\n real_height = (height + self.WALL_HEIGHT \/ 2) * self.SEGMENT_LINE_HEIGHT\n segment = self.add_segment_object(segment, wall_offset, real_height, left_wall)\n segment = self.add_segment_object(segment, wall_offset + self.playable_width + self.WALL_HALF_WIDTH * 2, real_height, right_wall)\n\n height = height + self.WALL_HEIGHT\n return segment\n\nfunc update_segments(player_height):\n var segment_height = self.SEGMENT_SIZE * self.SEGMENT_LINE_HEIGHT\n var overflow = player_height % segment_height\n\n var segment_num = (player_height - overflow) \/ segment_height\n\n if overflow > 100 && segment_num > self.last_visited_segment:\n self.last_visited_segment = segment_num\n self.generate_next_map_segment()\n\nfunc add_platforms(segment):\n var iterator = 2\n var last_iterator = 0\n\n randomize()\n\n while iterator < self.SEGMENT_SIZE - 2:\n segment = self.generate_single_platform(segment, iterator)\n\n last_iterator = iterator\n\n if randi() % 10 == 0:\n iterator = iterator + 5\n else:\n iterator = iterator + 4\n\n if last_iterator < self.SEGMENT_SIZE - 4:\n segment = self.generate_single_platform(segment, self.SEGMENT_SIZE - 2)\n\n return segment\n\nfunc generate_single_platform(segment, iterator):\n var template = self.platforms[randi() % self.platforms.size()]\n var new_platform = template.template.instance()\n\n var horizontal_position = randi() % (self.playable_width - template.width)\n horizontal_position = horizontal_position + self.SCREEN_MARGIN + int(template.width \/ 2)\n\n segment = self.add_segment_object(segment, horizontal_position, (iterator + 1) * self.SEGMENT_LINE_HEIGHT, new_platform)\n\n return segment","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"23fe7a0b39367a9b31ccbb94f384c7b014fc41a3","subject":"add temporary 2 keyboard buttons controls using page_up and page_down buttons","message":"add temporary 2 keyboard buttons controls using page_up and page_down buttons\n","repos":"arnaudcoj\/godot_game_jam_2016,arnaudcoj\/godot_game_jam_2016","old_file":"sources\/scripts\/player\/buttbutt.gd","new_file":"sources\/scripts\/player\/buttbutt.gd","new_contents":"extends KinematicBody2D\n\n#### SIGNALS ####\nsignal exit\nsignal die\nsignal controls_changed\n\n#### VARIABLES ####\n\n## Export\n\n# traces the fsm changes\nexport (bool) var debug = true\n\n# default moves available\nexport(String, \"move_up\", \"move_down\", \"move_left\", \"move_right\", \"run\", \"jump\") var control_1 = \"move_right\"\nexport(String, \"move_up\", \"move_down\", \"move_left\", \"move_right\", \"run\", \"jump\") var control_2 = \"move_left\"\n\n# controls are pressed\nvar control_1_pressed = false\nvar control_2_pressed = false\n\n# keep finger id for touchscreen\nvar touchscreen_right = -1\nvar touchscreen_left = -1\n\n## FSM\n\nconst IDLE = 0\nconst WALKING = 1\nconst RUNNING = 2\nconst JUMPING = 3\nconst FALLING = 4\nconst CLIMBING = 5\n# current state\nvar fsm = IDLE\n\n## PHYSICS\n\nconst GRAVITY = 800\nconst WALK_SPEED = 150\nconst RUN_SPEED = 350\nconst JUMP_SPEED = 70\nconst CLIMB_SPEED = Vector2(70, 130)\n\nvar velocity = Vector2()\n\nconst MAX_JUMP_TIME = 0.1\nvar jumping_time = 0\n\n#### ONREADY ####\n\nonready var interaction_area = get_node(\"interaction_area\")\nonready var climb_area = preload(\"res:\/\/sources\/scripts\/levels\/climb_area.gd\")\n\nfunc _ready():\n\tset_fixed_process(true)\n\tset_process_input(true)\n\n#### METHODS ####\n\t\nfunc _fixed_process(delta):\n\tdecide_fsm(delta)\n\tupdate_physics(delta)\n\t\nfunc _input(event):\n\tupdate_controls(event)\n\t\n# PHYSICS\n\nfunc update_physics(delta):\n\t# first update the velocity with gravity\n\tupdate_gravity(delta)\n\t\n\t# next update the velocity according to the fsm state\n\tif fsm == IDLE:\n\t\tupdate_idle(delta)\n\telif fsm == WALKING:\n\t\tupdate_walking(delta)\n\telif fsm == RUNNING:\n\t\tupdate_running(delta)\n\telif fsm == JUMPING:\n\t\tupdate_jumping(delta)\n\telif fsm == FALLING:\n\t\tupdate_falling(delta)\n\telif fsm == CLIMBING:\n\t\tupdate_climbing(delta)\n\t\n\t# finally integrate the velocity into actual motion\n\tintegrate_motion(delta)\n\t\n\t\nfunc update_idle(delta):\n\tvelocity.y = 0\n\tvelocity.x = lerp(velocity.x, 0, 0.1)\n\t\nfunc update_walking(delta):\n\tif is_on_ground() :\n\t\tvelocity.y = 0\n\t\tif available_action_pressed(\"move_left\") && available_action_pressed(\"move_right\"):\n\t\t\tvelocity.x = lerp(velocity.x, 0, 0.2)\n\t\telif available_action_pressed(\"move_left\"):\n\t\t\tvelocity.x = lerp(velocity.x, -WALK_SPEED, 0.2)\n\t\telif available_action_pressed(\"move_right\"):\n\t\t\tvelocity.x = lerp(velocity.x, WALK_SPEED, 0.2)\n\nfunc update_running(delta):\n\tif is_on_ground() :\n\t\tvelocity.y = 0\n\t\tif available_action_pressed(\"move_left\") && available_action_pressed(\"move_right\"):\n\t\t\tvelocity.x = lerp(velocity.x, 0, 0.2)\n\t\telif available_action_pressed(\"move_left\"):\n\t\t\tvelocity.x = lerp(velocity.x, -RUN_SPEED, 0.2)\n\t\telif available_action_pressed(\"move_right\"):\n\t\t\tvelocity.x = lerp(velocity.x, RUN_SPEED, 0.2)\n\t\nfunc update_jumping(delta):\n\tjumping_time += delta\n\tif abs(velocity.x) < RUN_SPEED && available_action_pressed(\"run\"):\n\t\tif available_action_pressed(\"move_left\"):\n\t\t\tvelocity.x = lerp(velocity.x, -RUN_SPEED, 0.3)\n\t\telif available_action_pressed(\"move_right\"):\n\t\t\tvelocity.x = lerp(velocity.x, RUN_SPEED, 0.3)\n\telif abs(velocity.x) < WALK_SPEED && !available_action_pressed(\"run\"):\n\t\tif available_action_pressed(\"move_left\"):\n\t\t\tvelocity.x = lerp(velocity.x, -WALK_SPEED, 0.3)\n\t\telif available_action_pressed(\"move_right\"):\n\t\t\tvelocity.x = lerp(velocity.x, WALK_SPEED, 0.3)\n\t\t\n\tvelocity.y -= JUMP_SPEED\n\t\nfunc update_falling(delta):\n\tif abs(velocity.x) < RUN_SPEED && available_action_pressed(\"run\") && (available_action_pressed(\"move_left\") || available_action_pressed(\"move_right\")):\n\t\tif available_action_pressed(\"move_left\"):\n\t\t\tvelocity.x = lerp(velocity.x, -RUN_SPEED, 0.1)\n\t\telif available_action_pressed(\"move_right\"):\n\t\t\tvelocity.x = lerp(velocity.x, RUN_SPEED, 0.1)\n\telif abs(velocity.x) < WALK_SPEED && !available_action_pressed(\"run\") && (available_action_pressed(\"move_left\") || available_action_pressed(\"move_right\")):\n\t\tif available_action_pressed(\"move_left\"):\n\t\t\tvelocity.x = lerp(velocity.x, -WALK_SPEED, 0.2)\n\t\telif available_action_pressed(\"move_right\"):\n\t\t\tvelocity.x = lerp(velocity.x, WALK_SPEED, 0.2)\n\telse:\n\t\tvelocity.x = lerp(velocity.x, 0, 0.02)\n\t\nfunc update_climbing(delta):\n\tvar direction = Vector2()\n\n\tif available_action_pressed(\"move_up\") && !reached_top():\n\t\tdirection.y -= 1\n\tif available_action_pressed(\"move_down\"):\n\t\tdirection.y += 1\n\t\t\n\tif available_action_pressed(\"move_left\"):\n\t\tdirection.x -= 1\n\tif available_action_pressed(\"move_right\"):\n\t\tdirection.x += 1\n\t\n\tmove_and_slide(direction * CLIMB_SPEED)\n\t\t\n\tvelocity.y = 0\n\tvelocity.x = 0\n\nfunc update_gravity(delta):\n\t#velocity.y += delta * GRAVITY\n\tvelocity.y = lerp(velocity.y, GRAVITY, 0.015)\n\t\nfunc integrate_motion(delta):\n\tvar motion = velocity * delta\n\tmove_and_slide(velocity)\n\t\n\tif is_colliding():\n\t\tvar n = get_collision_normal()\n\t\tmotion = n.slide(motion)\n\t\tvelocity = n.slide(velocity)\n\t\tmove(motion)\n\t\nfunc is_on_ground():\n\t return test_move(get_transform(), Vector2(0, 1))\n\t\nfunc reset_jump():\n\tjumping_time = 0\n\tif control_1 == \"jump\" && control_1_pressed:\n\t\tcontrol_1_pressed = false\n\tif control_2 == \"jump\" && control_2_pressed:\n\t\tcontrol_2_pressed = false\n# FSM\n\nfunc decide_fsm(delta):\n\tif fsm == IDLE:\n\t\tdecide_fsm_idle(delta)\n\telif fsm == WALKING:\n\t\tdecide_fsm_walking(delta)\n\telif fsm == RUNNING:\n\t\tdecide_fsm_running(delta)\n\telif fsm == JUMPING:\n\t\tdecide_fsm_jumping(delta)\n\telif fsm == FALLING:\n\t\tdecide_fsm_falling(delta)\n\telif fsm == CLIMBING:\n\t\tdecide_fsm_climbing(delta)\n\nfunc decide_fsm_idle(delta):\n\tif !is_on_ground():\n\t\tchange_state(FALLING)\n\telif available_action_pressed(\"jump\"):\n\t\tchange_state(JUMPING)\n\telif can_climb() && !reached_top() && (available_action_pressed(\"move_up\") || available_action_pressed(\"move_down\")):\n\t\tchange_state(CLIMBING)\n\telif available_action_pressed(\"move_left\") || available_action_pressed(\"move_right\") :\n\t\tif available_action_pressed(\"run\"):\n\t\t\tchange_state(RUNNING)\n\t\telse:\n\t\t\tchange_state(WALKING)\n\t\nfunc decide_fsm_walking(delta):\n\tif !is_on_ground():\n\t\tchange_state(FALLING)\n\telif available_action_pressed(\"jump\"):\n\t\tchange_state(JUMPING)\n\telif can_climb() && !reached_top() && (available_action_pressed(\"move_up\") || available_action_pressed(\"move_down\")):\n\t\tchange_state(CLIMBING)\n\telif available_action_pressed(\"run\"):\n\t\tchange_state(RUNNING)\n\telif !available_action_pressed(\"move_left\") && !available_action_pressed(\"move_right\") :\n\t\tchange_state(IDLE)\n\nfunc decide_fsm_running(delta):\n\tif !is_on_ground():\n\t\tchange_state(FALLING)\n\telif available_action_pressed(\"jump\"):\n\t\tchange_state(JUMPING)\n\telif can_climb() && !reached_top() && (available_action_pressed(\"move_up\") || available_action_pressed(\"move_down\")):\n\t\tchange_state(CLIMBING)\n\telif !available_action_pressed(\"move_left\") && !available_action_pressed(\"move_right\") :\n\t\tchange_state(IDLE)\n\telif !available_action_pressed(\"run\"):\n\t\tchange_state(WALKING)\n\nfunc decide_fsm_jumping(delta):\n\tif jumping_time > MAX_JUMP_TIME || !available_action_pressed(\"jump\"):\n\t\tchange_state(FALLING)\n\t\treset_jump()\n\t\t\nfunc decide_fsm_falling(delta):\n\tif is_on_ground():\n\t\tif available_action_pressed(\"move_left\") || available_action_pressed(\"move_right\"):\n\t\t\tchange_state(WALKING)\n\t\telse :\n\t\t\tchange_state(IDLE)\n\telif can_climb() && !reached_top() && (available_action_pressed(\"move_up\") || available_action_pressed(\"move_down\")):\n\t\tchange_state(CLIMBING)\n\t\t\nfunc decide_fsm_climbing(delta):\n\tif available_action_pressed(\"jump\"):\n\t\tchange_state(FALLING)\n\telif !can_climb():\n\t\tchange_state(FALLING)\n\nfunc change_state(id):\n\tif debug:\n\t\tprint(get_fsm_name(fsm), \" -> \", get_fsm_name(id))\n\tfsm = id\n\nfunc can_climb():\n\tfor area in interaction_area.get_overlapping_areas():\n\t\tif area extends climb_area:\n\t\t\treturn true\n\treturn false\n\nfunc reached_top():\n\tfor area in interaction_area.get_overlapping_areas():\n\t\tif area extends climb_area && !area.is_on_top(interaction_area):\n\t\t\treturn false\n\treturn true\n\nfunc get_fsm_name(id = -1):\n\tif id == -1:\n\t\tid = fsm\n\tif id == IDLE:\n\t\treturn \"idle\"\n\telif id == WALKING:\n\t\treturn \"walking\"\n\telif id == RUNNING:\n\t\treturn \"running\"\n\telif id == JUMPING:\n\t\treturn \"jumping\"\n\telif id == FALLING:\n\t\treturn \"falling\"\n\telif id == CLIMBING:\n\t\treturn \"climbing\"\n\t\n# Interactions\n\nfunc update_controls(event):\n\t# update control_x_pressed state\n\t\n\t# touchscreen event\n\tif event.type == InputEvent.SCREEN_TOUCH: \n\t\t# just pressed the screen\n\t\tif event.pressed:\n\t\t\t# checks if bottom part of the screen\n\t\t\tif event.pos.y > 200:\n\t\t\t\t# checks if left part of the screen and no finger already in this part\n\t\t\t\tif event.pos.x <= 1024 \/ 2 && touchscreen_left == -1:\n\t\t\t\t\ttouchscreen_left = event.index\n\t\t\t\t\tcontrol_1_pressed = true\n\t\t\t\t# checks if right part of the screen and no finger already in this part\n\t\t\t\telif event.pos.x > 1024 \/ 2 && touchscreen_right == -1:\n\t\t\t\t\ttouchscreen_right = event.index\n\t\t\t\t\tcontrol_2_pressed = true\n\t\t# just released a finger\n\t\telse:\n\t\t\t# if the finger released was on the right part\n\t\t\tif event.index == touchscreen_right:\n\t\t\t\ttouchscreen_right = -1\n\t\t\t\tcontrol_2_pressed = false\n\t\t\t# if the finger released was on the left part\n\t\t\telif event.index == touchscreen_left:\n\t\t\t\ttouchscreen_left = -1\n\t\t\t\tcontrol_1_pressed = false\n\t\t\n\t# Keyboard event\n\telif event.type == InputEvent.KEY && !event.is_echo():\n\t\tif event.is_action(control_1):\n\t\t\tcontrol_1_pressed = event.pressed\n\t\tif event.is_action(control_2):\n\t\t\tcontrol_2_pressed = event.pressed\n\t\tif event.is_action(\"ui_page_up\"):\n\t\t\tcontrol_1_pressed = event.pressed\n\t\tif event.is_action(\"ui_page_down\"):\n\t\t\tcontrol_2_pressed = event.pressed\n\t\nfunc available_action_pressed(action):\n\tif debug:\n\t\treturn Input.is_action_pressed(action)\n\telse:\n\t\treturn (control_1_pressed && control_1 == action) || (control_2_pressed && control_2 == action)\n\nfunc change_controls(control_1, control_2):\n\tif self.control_1 != control_1:\n\t\tself.control_1 = control_1\n\t\tcontrol_1_pressed = false\n\tif self.control_2 != control_2:\n\t\tself.control_2 = control_2\n\t\tcontrol_2_pressed = false\n\temit_signal(\"controls_changed\", self)\n\nfunc die():\n\temit_signal(\"die\")\n\t#get_tree().get_root().get_node(\"root\").restart()\n\t\nfunc exit():\n\temit_signal(\"exit\")\n\t#get_tree().get_root().get_node(\"root\").show_menu()\n","old_contents":"extends KinematicBody2D\n\n#### SIGNALS ####\nsignal exit\nsignal die\nsignal controls_changed\n\n#### VARIABLES ####\n\n## Export\n\n# traces the fsm changes\nexport (bool) var debug = true\n\n# default moves available\nexport(String, \"move_up\", \"move_down\", \"move_left\", \"move_right\", \"run\", \"jump\") var control_1 = \"move_right\"\nexport(String, \"move_up\", \"move_down\", \"move_left\", \"move_right\", \"run\", \"jump\") var control_2 = \"move_left\"\n\n# controls are pressed\nvar control_1_pressed = false\nvar control_2_pressed = false\n\n# keep finger id for touchscreen\nvar touchscreen_right = -1\nvar touchscreen_left = -1\n\n## FSM\n\nconst IDLE = 0\nconst WALKING = 1\nconst RUNNING = 2\nconst JUMPING = 3\nconst FALLING = 4\nconst CLIMBING = 5\n# current state\nvar fsm = IDLE\n\n## PHYSICS\n\nconst GRAVITY = 800\nconst WALK_SPEED = 150\nconst RUN_SPEED = 350\nconst JUMP_SPEED = 70\nconst CLIMB_SPEED = Vector2(70, 130)\n\nvar velocity = Vector2()\n\nconst MAX_JUMP_TIME = 0.1\nvar jumping_time = 0\n\n#### ONREADY ####\n\nonready var interaction_area = get_node(\"interaction_area\")\nonready var climb_area = preload(\"res:\/\/sources\/scripts\/levels\/climb_area.gd\")\n\nfunc _ready():\n\tset_fixed_process(true)\n\tset_process_input(true)\n\n#### METHODS ####\n\t\nfunc _fixed_process(delta):\n\tdecide_fsm(delta)\n\tupdate_physics(delta)\n\t\nfunc _input(event):\n\tupdate_controls(event)\n\t\n# PHYSICS\n\nfunc update_physics(delta):\n\t# first update the velocity with gravity\n\tupdate_gravity(delta)\n\t\n\t# next update the velocity according to the fsm state\n\tif fsm == IDLE:\n\t\tupdate_idle(delta)\n\telif fsm == WALKING:\n\t\tupdate_walking(delta)\n\telif fsm == RUNNING:\n\t\tupdate_running(delta)\n\telif fsm == JUMPING:\n\t\tupdate_jumping(delta)\n\telif fsm == FALLING:\n\t\tupdate_falling(delta)\n\telif fsm == CLIMBING:\n\t\tupdate_climbing(delta)\n\t\n\t# finally integrate the velocity into actual motion\n\tintegrate_motion(delta)\n\t\n\t\nfunc update_idle(delta):\n\tvelocity.y = 0\n\tvelocity.x = lerp(velocity.x, 0, 0.1)\n\t\nfunc update_walking(delta):\n\tif is_on_ground() :\n\t\tvelocity.y = 0\n\t\tif available_action_pressed(\"move_left\") && available_action_pressed(\"move_right\"):\n\t\t\tvelocity.x = lerp(velocity.x, 0, 0.2)\n\t\telif available_action_pressed(\"move_left\"):\n\t\t\tvelocity.x = lerp(velocity.x, -WALK_SPEED, 0.2)\n\t\telif available_action_pressed(\"move_right\"):\n\t\t\tvelocity.x = lerp(velocity.x, WALK_SPEED, 0.2)\n\nfunc update_running(delta):\n\tif is_on_ground() :\n\t\tvelocity.y = 0\n\t\tif available_action_pressed(\"move_left\") && available_action_pressed(\"move_right\"):\n\t\t\tvelocity.x = lerp(velocity.x, 0, 0.2)\n\t\telif available_action_pressed(\"move_left\"):\n\t\t\tvelocity.x = lerp(velocity.x, -RUN_SPEED, 0.2)\n\t\telif available_action_pressed(\"move_right\"):\n\t\t\tvelocity.x = lerp(velocity.x, RUN_SPEED, 0.2)\n\t\nfunc update_jumping(delta):\n\tjumping_time += delta\n\tif abs(velocity.x) < RUN_SPEED && available_action_pressed(\"run\"):\n\t\tif available_action_pressed(\"move_left\"):\n\t\t\tvelocity.x = lerp(velocity.x, -RUN_SPEED, 0.3)\n\t\telif available_action_pressed(\"move_right\"):\n\t\t\tvelocity.x = lerp(velocity.x, RUN_SPEED, 0.3)\n\telif abs(velocity.x) < WALK_SPEED && !available_action_pressed(\"run\"):\n\t\tif available_action_pressed(\"move_left\"):\n\t\t\tvelocity.x = lerp(velocity.x, -WALK_SPEED, 0.3)\n\t\telif available_action_pressed(\"move_right\"):\n\t\t\tvelocity.x = lerp(velocity.x, WALK_SPEED, 0.3)\n\t\t\n\tvelocity.y -= JUMP_SPEED\n\t\nfunc update_falling(delta):\n\tif abs(velocity.x) < RUN_SPEED && available_action_pressed(\"run\") && (available_action_pressed(\"move_left\") || available_action_pressed(\"move_right\")):\n\t\tif available_action_pressed(\"move_left\"):\n\t\t\tvelocity.x = lerp(velocity.x, -RUN_SPEED, 0.1)\n\t\telif available_action_pressed(\"move_right\"):\n\t\t\tvelocity.x = lerp(velocity.x, RUN_SPEED, 0.1)\n\telif abs(velocity.x) < WALK_SPEED && !available_action_pressed(\"run\") && (available_action_pressed(\"move_left\") || available_action_pressed(\"move_right\")):\n\t\tif available_action_pressed(\"move_left\"):\n\t\t\tvelocity.x = lerp(velocity.x, -WALK_SPEED, 0.2)\n\t\telif available_action_pressed(\"move_right\"):\n\t\t\tvelocity.x = lerp(velocity.x, WALK_SPEED, 0.2)\n\telse:\n\t\tvelocity.x = lerp(velocity.x, 0, 0.02)\n\t\nfunc update_climbing(delta):\n\tvar direction = Vector2()\n\n\tif available_action_pressed(\"move_up\") && !reached_top():\n\t\tdirection.y -= 1\n\tif available_action_pressed(\"move_down\"):\n\t\tdirection.y += 1\n\t\t\n\tif available_action_pressed(\"move_left\"):\n\t\tdirection.x -= 1\n\tif available_action_pressed(\"move_right\"):\n\t\tdirection.x += 1\n\t\n\tmove_and_slide(direction * CLIMB_SPEED)\n\t\t\n\tvelocity.y = 0\n\tvelocity.x = 0\n\nfunc update_gravity(delta):\n\t#velocity.y += delta * GRAVITY\n\tvelocity.y = lerp(velocity.y, GRAVITY, 0.015)\n\t\nfunc integrate_motion(delta):\n\tvar motion = velocity * delta\n\tmove_and_slide(velocity)\n\t\n\tif is_colliding():\n\t\tvar n = get_collision_normal()\n\t\tmotion = n.slide(motion)\n\t\tvelocity = n.slide(velocity)\n\t\tmove(motion)\n\t\nfunc is_on_ground():\n\t return test_move(get_transform(), Vector2(0, 1))\n\t\nfunc reset_jump():\n\tjumping_time = 0\n\tif control_1 == \"jump\" && control_1_pressed:\n\t\tcontrol_1_pressed = false\n\tif control_2 == \"jump\" && control_2_pressed:\n\t\tcontrol_2_pressed = false\n# FSM\n\nfunc decide_fsm(delta):\n\tif fsm == IDLE:\n\t\tdecide_fsm_idle(delta)\n\telif fsm == WALKING:\n\t\tdecide_fsm_walking(delta)\n\telif fsm == RUNNING:\n\t\tdecide_fsm_running(delta)\n\telif fsm == JUMPING:\n\t\tdecide_fsm_jumping(delta)\n\telif fsm == FALLING:\n\t\tdecide_fsm_falling(delta)\n\telif fsm == CLIMBING:\n\t\tdecide_fsm_climbing(delta)\n\nfunc decide_fsm_idle(delta):\n\tif !is_on_ground():\n\t\tchange_state(FALLING)\n\telif available_action_pressed(\"jump\"):\n\t\tchange_state(JUMPING)\n\telif can_climb() && !reached_top() && (available_action_pressed(\"move_up\") || available_action_pressed(\"move_down\")):\n\t\tchange_state(CLIMBING)\n\telif available_action_pressed(\"move_left\") || available_action_pressed(\"move_right\") :\n\t\tif available_action_pressed(\"run\"):\n\t\t\tchange_state(RUNNING)\n\t\telse:\n\t\t\tchange_state(WALKING)\n\t\nfunc decide_fsm_walking(delta):\n\tif !is_on_ground():\n\t\tchange_state(FALLING)\n\telif available_action_pressed(\"jump\"):\n\t\tchange_state(JUMPING)\n\telif can_climb() && !reached_top() && (available_action_pressed(\"move_up\") || available_action_pressed(\"move_down\")):\n\t\tchange_state(CLIMBING)\n\telif available_action_pressed(\"run\"):\n\t\tchange_state(RUNNING)\n\telif !available_action_pressed(\"move_left\") && !available_action_pressed(\"move_right\") :\n\t\tchange_state(IDLE)\n\nfunc decide_fsm_running(delta):\n\tif !is_on_ground():\n\t\tchange_state(FALLING)\n\telif available_action_pressed(\"jump\"):\n\t\tchange_state(JUMPING)\n\telif can_climb() && !reached_top() && (available_action_pressed(\"move_up\") || available_action_pressed(\"move_down\")):\n\t\tchange_state(CLIMBING)\n\telif !available_action_pressed(\"move_left\") && !available_action_pressed(\"move_right\") :\n\t\tchange_state(IDLE)\n\telif !available_action_pressed(\"run\"):\n\t\tchange_state(WALKING)\n\nfunc decide_fsm_jumping(delta):\n\tif jumping_time > MAX_JUMP_TIME || !available_action_pressed(\"jump\"):\n\t\tchange_state(FALLING)\n\t\treset_jump()\n\t\t\nfunc decide_fsm_falling(delta):\n\tif is_on_ground():\n\t\tif available_action_pressed(\"move_left\") || available_action_pressed(\"move_right\"):\n\t\t\tchange_state(WALKING)\n\t\telse :\n\t\t\tchange_state(IDLE)\n\telif can_climb() && !reached_top() && (available_action_pressed(\"move_up\") || available_action_pressed(\"move_down\")):\n\t\tchange_state(CLIMBING)\n\t\t\nfunc decide_fsm_climbing(delta):\n\tif available_action_pressed(\"jump\"):\n\t\tchange_state(FALLING)\n\telif !can_climb():\n\t\tchange_state(FALLING)\n\nfunc change_state(id):\n\tif debug:\n\t\tprint(get_fsm_name(fsm), \" -> \", get_fsm_name(id))\n\tfsm = id\n\nfunc can_climb():\n\tfor area in interaction_area.get_overlapping_areas():\n\t\tif area extends climb_area:\n\t\t\treturn true\n\treturn false\n\nfunc reached_top():\n\tfor area in interaction_area.get_overlapping_areas():\n\t\tif area extends climb_area && !area.is_on_top(interaction_area):\n\t\t\treturn false\n\treturn true\n\nfunc get_fsm_name(id = -1):\n\tif id == -1:\n\t\tid = fsm\n\tif id == IDLE:\n\t\treturn \"idle\"\n\telif id == WALKING:\n\t\treturn \"walking\"\n\telif id == RUNNING:\n\t\treturn \"running\"\n\telif id == JUMPING:\n\t\treturn \"jumping\"\n\telif id == FALLING:\n\t\treturn \"falling\"\n\telif id == CLIMBING:\n\t\treturn \"climbing\"\n\t\n# Interactions\n\nfunc update_controls(event):\n\t# update control_x_pressed state\n\t\n\t# touchscreen event\n\tif event.type == InputEvent.SCREEN_TOUCH: \n\t\t# just pressed the screen\n\t\tif event.pressed:\n\t\t\t# checks if bottom part of the screen\n\t\t\tif event.pos.y > 200:\n\t\t\t\t# checks if left part of the screen and no finger already in this part\n\t\t\t\tif event.pos.x <= 1024 \/ 2 && touchscreen_left == -1:\n\t\t\t\t\ttouchscreen_left = event.index\n\t\t\t\t\tcontrol_1_pressed = true\n\t\t\t\t# checks if right part of the screen and no finger already in this part\n\t\t\t\telif event.pos.x > 1024 \/ 2 && touchscreen_right == -1:\n\t\t\t\t\ttouchscreen_right = event.index\n\t\t\t\t\tcontrol_2_pressed = true\n\t\t# just released a finger\n\t\telse:\n\t\t\t# if the finger released was on the right part\n\t\t\tif event.index == touchscreen_right:\n\t\t\t\ttouchscreen_right = -1\n\t\t\t\tcontrol_2_pressed = false\n\t\t\t# if the finger released was on the left part\n\t\t\telif event.index == touchscreen_left:\n\t\t\t\ttouchscreen_left = -1\n\t\t\t\tcontrol_1_pressed = false\n\t\t\n\t# Keyboard event\n\telif event.type == InputEvent.KEY && !event.is_echo():\n\t\tif event.is_action(control_1):\n\t\t\tcontrol_1_pressed = event.pressed\n\t\tif event.is_action(control_2):\n\t\t\tcontrol_2_pressed = event.pressed\n\t\nfunc available_action_pressed(action):\n\tif debug:\n\t\treturn Input.is_action_pressed(action)\n\telse:\n\t\treturn (control_1_pressed && control_1 == action) || (control_2_pressed && control_2 == action)\n\nfunc change_controls(control_1, control_2):\n\tif self.control_1 != control_1:\n\t\tself.control_1 = control_1\n\t\tcontrol_1_pressed = false\n\tif self.control_2 != control_2:\n\t\tself.control_2 = control_2\n\t\tcontrol_2_pressed = false\n\temit_signal(\"controls_changed\", self)\n\nfunc die():\n\temit_signal(\"die\")\n\t#get_tree().get_root().get_node(\"root\").restart()\n\t\nfunc exit():\n\temit_signal(\"exit\")\n\t#get_tree().get_root().get_node(\"root\").show_menu()\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"599f1516e92e0b801ba24e8647da8bf92aaf90f4","subject":"Deleted unused variable","message":"Deleted unused variable\n\nDeleted the var GRAVITY because it is unused. The gravity is used at line 237, but it's gotten from the Physics2DDirectBodyState parameter.","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"2d\/platformer\/player.gd","new_file":"2d\/platformer\/player.gd","new_contents":"extends RigidBody2D\n\n# Character Demo, written by Juan Linietsky.\n#\n# Implementation of a 2D Character controller.\n# This implementation uses the physics engine for\n# controlling a character, in a very similar way\n# than a 3D character controller would be implemented.\n#\n# Using the physics engine for this has the main\n# advantages:\n# -Easy to write.\n# -Interaction with other physics-based objects is free\n# -Only have to deal with the object linear velocity, not position\n# -All collision\/area framework available\n# \n# But also has the following disadvantages:\n# \n# -Objects may bounce a little bit sometimes\n# -Going up ramps sends the chracter flying up, small hack is needed.\n# -A ray collider is needed to avoid sliding down on ramps and \n# undesiderd bumps, small steps and rare numerical precision errors.\n# (another alternative may be to turn on friction when the character is not moving).\n# -Friction cant be used, so floor velocity must be considered\n# for moving platforms.\n\nvar anim=\"\"\nvar siding_left=false\nvar jumping=false\nvar stopping_jump=false\nvar shooting=false\n\nvar WALK_ACCEL = 800.0\nvar WALK_DEACCEL= 800.0\nvar WALK_MAX_VELOCITY= 200.0\nvar AIR_ACCEL = 200.0\nvar AIR_DEACCEL= 200.0\nvar JUMP_VELOCITY=460\nvar STOP_JUMP_FORCE=900.0\n\nvar MAX_FLOOR_AIRBORNE_TIME = 0.15\n\nvar airborne_time=1e20\nvar shoot_time=1e20\n\nvar MAX_SHOOT_POSE_TIME = 0.3\n\nvar bullet = preload(\"res:\/\/bullet.xml\")\n\nvar floor_h_velocity=0.0\nvar enemy\n\nfunc _integrate_forces(s):\n\n\t\n\n\tvar lv = s.get_linear_velocity()\n\tvar step = s.get_step()\n\t\n\tvar new_anim=anim\n\tvar new_siding_left=siding_left\n\t\n\t\n\t# Get the controls\n\tvar move_left = Input.is_action_pressed(\"move_left\")\n\tvar move_right = Input.is_action_pressed(\"move_right\")\n\tvar jump = Input.is_action_pressed(\"jump\")\n\tvar shoot = Input.is_action_pressed(\"shoot\")\n\tvar spawn = Input.is_action_pressed(\"spawn\")\n\t\n\tif spawn:\n\t\tvar e = enemy.instance()\n\t\tvar p = get_pos()\n\t\tp.y = p.y - 100\n\t\te.set_pos(p)\n\t\tget_parent().add_child(e)\n\n\t\n\t#deapply prev floor velocity\n\tlv.x-=floor_h_velocity\n\tfloor_h_velocity=0.0\n\t\n\t\n\t# Find the floor (a contact with upwards facing collision normal)\n\tvar found_floor=false\n\tvar floor_index=-1\n\t\n\tfor x in range(s.get_contact_count()):\n\n\t\tvar ci = s.get_contact_local_normal(x)\n\t\tif (ci.dot(Vector2(0,-1))>0.6):\n\t\t\tfound_floor=true\n\t\t\tfloor_index=x\n\t\n\t# A good idea when impementing characters of all kinds,\n\t# Compensates for physics imprecission, as well as human\n\t# reaction delay.\n\t\n\tif (shoot and not shooting):\n\t\tshoot_time=0\n\t\tvar bi = bullet.instance()\n\t\tvar ss\n\t\tif (siding_left):\n\t\t\tss=-1.0\n\t\telse:\n\t\t\tss=1.0\n\t\tvar pos = get_pos() + get_node(\"bullet_shoot\").get_pos()*Vector2(ss,1.0)\n\n\t\tbi.set_pos(pos)\n\t\tget_parent().add_child(bi)\n\n\t\tbi.set_linear_velocity( Vector2(800.0*ss,-80) )\t\n\t\tget_node(\"sprite\/smoke\").set_emitting(true)\t\n\t\tget_node(\"sound\").play(\"shoot\")\n\t\tPS2D.body_add_collision_exception(bi.get_rid(),get_rid()) # make bullet and this not collide\n\n\n\telse:\n\t\tshoot_time+=step\n\t\t\n\t\n\tif (found_floor):\n\t\tairborne_time=0.0 \n\telse:\n\t\tairborne_time+=step #time it spent in the air\n\t\t\n\tvar on_floor = airborne_time < MAX_FLOOR_AIRBORNE_TIME\n\n\t# Process jump\t\t\n\tif (jumping):\n\t\tif (lv.y>0):\n\t\t\t#set off the jumping flag if going down\n\t\t\tjumping=false\n\t\telif (not jump):\n\t\t\tstopping_jump=true\n\t\t\t\n\t\tif (stopping_jump):\n\t\t\tlv.y+=STOP_JUMP_FORCE*step\n\t\t\n\tif (on_floor):\n\n\t\t# Process logic when character is on floor\n\t\t\t\n\t\tif (move_left and not move_right):\n\t\t\tif (lv.x > -WALK_MAX_VELOCITY):\n\t\t\t\tlv.x-=WALK_ACCEL*step\t\t\t\n\t\telif (move_right and not move_left):\n\t\t\tif (lv.x < WALK_MAX_VELOCITY):\n\t\t\t\tlv.x+=WALK_ACCEL*step\n\t\telse:\n\t\t\tvar xv = abs(lv.x)\n\t\t\txv-=WALK_DEACCEL*step\n\t\t\tif (xv<0):\n\t\t\t\txv=0\n\t\t\tlv.x=sign(lv.x)*xv\n\t\t\t\n\t\t#Check jump\n\t\tif (not jumping and jump):\n\t\t\tlv.y=-JUMP_VELOCITY\n\t\t\tjumping=true\n\t\t\tstopping_jump=false\n\t\t\tget_node(\"sound\").play(\"jump\")\n\t\t\t\n\t\t#check siding\n\t\t\n\t\tif (lv.x < 0 and move_left):\n\t\t\tnew_siding_left=true\n\t\telif (lv.x > 0 and move_right):\n\t\t\tnew_siding_left=false\n\t\tif (jumping):\n\t\t\tnew_anim=\"jumping\"\t\n\t\telif (abs(lv.x)<0.1):\n\t\t\tif (shoot_time -WALK_MAX_VELOCITY):\n\t\t\t\tlv.x-=AIR_ACCEL*step\t\t\t\n\t\telif (move_right and not move_left):\n\t\t\tif (lv.x < WALK_MAX_VELOCITY):\n\t\t\t\tlv.x+=AIR_ACCEL*step\n\t\telse:\n\t\t\tvar xv = abs(lv.x)\n\t\t\txv-=AIR_DEACCEL*step\n\t\t\tif (xv<0):\n\t\t\t\txv=0\n\t\t\tlv.x=sign(lv.x)*xv\n\t\t\t\n\t\tif (lv.y<0):\n\t\t\tif (shoot_time0.6):\n\t\t\tfound_floor=true\n\t\t\tfloor_index=x\n\t\n\t# A good idea when impementing characters of all kinds,\n\t# Compensates for physics imprecission, as well as human\n\t# reaction delay.\n\t\n\tif (shoot and not shooting):\n\t\tshoot_time=0\n\t\tvar bi = bullet.instance()\n\t\tvar ss\n\t\tif (siding_left):\n\t\t\tss=-1.0\n\t\telse:\n\t\t\tss=1.0\n\t\tvar pos = get_pos() + get_node(\"bullet_shoot\").get_pos()*Vector2(ss,1.0)\n\n\t\tbi.set_pos(pos)\n\t\tget_parent().add_child(bi)\n\n\t\tbi.set_linear_velocity( Vector2(800.0*ss,-80) )\t\n\t\tget_node(\"sprite\/smoke\").set_emitting(true)\t\n\t\tget_node(\"sound\").play(\"shoot\")\n\t\tPS2D.body_add_collision_exception(bi.get_rid(),get_rid()) # make bullet and this not collide\n\n\n\telse:\n\t\tshoot_time+=step\n\t\t\n\t\n\tif (found_floor):\n\t\tairborne_time=0.0 \n\telse:\n\t\tairborne_time+=step #time it spent in the air\n\t\t\n\tvar on_floor = airborne_time < MAX_FLOOR_AIRBORNE_TIME\n\n\t# Process jump\t\t\n\tif (jumping):\n\t\tif (lv.y>0):\n\t\t\t#set off the jumping flag if going down\n\t\t\tjumping=false\n\t\telif (not jump):\n\t\t\tstopping_jump=true\n\t\t\t\n\t\tif (stopping_jump):\n\t\t\tlv.y+=STOP_JUMP_FORCE*step\n\t\t\n\tif (on_floor):\n\n\t\t# Process logic when character is on floor\n\t\t\t\n\t\tif (move_left and not move_right):\n\t\t\tif (lv.x > -WALK_MAX_VELOCITY):\n\t\t\t\tlv.x-=WALK_ACCEL*step\t\t\t\n\t\telif (move_right and not move_left):\n\t\t\tif (lv.x < WALK_MAX_VELOCITY):\n\t\t\t\tlv.x+=WALK_ACCEL*step\n\t\telse:\n\t\t\tvar xv = abs(lv.x)\n\t\t\txv-=WALK_DEACCEL*step\n\t\t\tif (xv<0):\n\t\t\t\txv=0\n\t\t\tlv.x=sign(lv.x)*xv\n\t\t\t\n\t\t#Check jump\n\t\tif (not jumping and jump):\n\t\t\tlv.y=-JUMP_VELOCITY\n\t\t\tjumping=true\n\t\t\tstopping_jump=false\n\t\t\tget_node(\"sound\").play(\"jump\")\n\t\t\t\n\t\t#check siding\n\t\t\n\t\tif (lv.x < 0 and move_left):\n\t\t\tnew_siding_left=true\n\t\telif (lv.x > 0 and move_right):\n\t\t\tnew_siding_left=false\n\t\tif (jumping):\n\t\t\tnew_anim=\"jumping\"\t\n\t\telif (abs(lv.x)<0.1):\n\t\t\tif (shoot_time -WALK_MAX_VELOCITY):\n\t\t\t\tlv.x-=AIR_ACCEL*step\t\t\t\n\t\telif (move_right and not move_left):\n\t\t\tif (lv.x < WALK_MAX_VELOCITY):\n\t\t\t\tlv.x+=AIR_ACCEL*step\n\t\telse:\n\t\t\tvar xv = abs(lv.x)\n\t\t\txv-=AIR_DEACCEL*step\n\t\t\tif (xv<0):\n\t\t\t\txv=0\n\t\t\tlv.x=sign(lv.x)*xv\n\t\t\t\n\t\tif (lv.y<0):\n\t\t\tif (shoot_time 0:\n\t\t\tvar togg = control[1]\n\t\t\tvar e = togg.optionButt\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tadd_child(e)\n\n\t\t\t# index of items needed\n\t\t\tfor i in range(togg.values.size()):\n\t\t\t\te.add_item(togg.values[i], i)\n\t\t\t\te.connect(\"item_selected\", self, \"changeValue\", [togg])\n\t\t\t\t# e.add_icon_item(togg.values[i], i)\n\n\t\telse:\n\t\t\tvar e = control[1]\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tif e extends Button:\n\t\t\t\te.set_text(control[0])\n\t\t\tif control[0] == 'save_pzl' :\n\t\t\t\te.connect('pressed', self, 'showFileDialog')\n\t\t\tif control[0] == 'load_pzl' :\n\t\t\t\te.connect('pressed', self, 'showFileDialog', [true])\n\t\t\tif control[0] == 'status':\n\t\t\t\tcontrol[1].set_text('STATUS: NOMINAL')\n\t\t\tadd_child(e)\n\n\n","old_contents":"extends Spatial\n\nvar puzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar puzzle\nvar puzzleMan\n\nvar gridMan\nvar prevBlock = null\n\nvar fileDialog = load(\"res:\/\/fileDialog.scn\").instance()\nvar gui = [\n\t[\"status\", Label.new()], # plz keep me as first element, referenced as gui[0] later\n\t[\"save_pzl\", Button.new()],\n\t[\"load_pzl\", Button.new()],\n\t[\"remove_layer\", Button.new()],\n\t[\"random_layer\", Button.new()],\n\t# THESE SHOULD BE Options instead of left, label, right\n\t[\"class_toggle\", {\n\t\tleft=Button.new(),\n\t\tright=Button.new(),\n\t\tlabel=Label.new(),\n\t\tvalues=[\"LZR\", \"WILD\", \"PAIR\", \"GOAL\"],\n\t\tvalue=\"PAIR\"\n\t}],\n\t[\"color_toggle\", {\n\t\tleft=Button.new(),\n\t\tright=Button.new(),\n\t\tlabel=Label.new(),\n\t\tvalues=preload(\"res:\/\/scripts\/PuzzleManager.gd\").blockColors,\n\t\tvalue=\"Red\"\n\t}],\n\t[\"action_toggle\", {\n\t\tleft=Button.new(),\n\t\tright=Button.new(),\n\t\tlabel=Label.new(),\n\t\tvalues=[\"Add\", \"Remove\", \"Replace\"],\n\t\tvalue=\"Add\"\n\t}],\n\t[\"test_pzl\", Button.new()],\n]\n\nfunc shouldAddNeighbor():\n\treturn true\n\nfunc shouldReplaceSelf():\n\treturn false\n\nfunc shouldRemoveSelf():\n\treturn false\n\nfunc newPickledBlock():\n\tvar b = puzzleMan.PickledBlock.new()\\\n\t\t.setName(gridMan.shape.keys().size())\\\n\tif prevBlock != null:\n\t\tb.setPairName(prevBlock.name)\n\t\tgridMan.get_node(prevBlock.toNode().name).setPairName(b.name)\n\t\tprevBlock = null\n\t\tgui[0][1].set_text(\"STATUS: ERROR, ADD PAIR\")\n\telse:\n\t\tprevBlock = b\n\t\tgui[0][1].set_text(\"STATUS: NOMINAL\")\n\treturn b\n\nfunc updateToggle(togg, increase):\n\tif increase:\n\t\tvar next_ix = togg.values.find(togg.value) + 1\n\t\tif (next_ix >= togg.values.size()):\n\t\t\tnext_ix = 0\n\t\ttogg.value = togg.values[next_ix]\n\telse:\n\t\tvar next_ix = togg.values.find(togg.value) - 1\n\t\tif (next_ix < 0):\n\t\t\tnext_ix = togg.values.size() - 1\n\t\ttogg.value = togg.values[next_ix]\n\ttogg.label.set_text(togg.value)\n\nfunc showFileDialog(loadInstead=false):\n\tget_tree().set_pause(true)\n\n\tif loadInstead:\n\t\tfileDialog.connect(\"confirmed\", self, \"puzzleLoad\")\n\t\tfileDialog.set_mode(FileDialog.MODE_OPEN_FILE)\n\telse:\n\t\tfileDialog.connect(\"confirmed\", self, \"puzzleSave\")\n\t\tfileDialog.set_mode(FileDialog.MODE_SAVE_FILE)\n\t\t\n\tfileDialog.popup_centered()\n\t\nfunc puzzleSave():\n\tprint(\"SAVING TO \", fileDialog.get_current_file() )\n\tget_tree().set_pause(false)\n\nfunc puzzleLoad():\n\tprint(\"LOADING FROM \", fileDialog.get_current_file() )\n\tget_tree().set_pause(false)\n\nfunc _ready():\n\tpuzzle = puzzleScn.instance()\n\tgridMan = puzzle.get_node(\"GridView\/GridMan\")\n\tpuzzle.mainPuzzle = false\n\t\n\t# hide and disable timer\n\tpuzzle.time.on = false;\n\tpuzzle.time.val = ''\n\t\n\tpuzzle.set_as_toplevel(true)\n\n\tadd_child(puzzle)\n\t\n\tprint(puzzle.get_tree() == get_tree())\n\tpuzzleMan = puzzle.puzzleMan\n\n\tset_process_input(true)\n\n\tvar theme = preload(\"res:\/\/themes\/MainTheme.thm\")\n\t\n\n\tfileDialog.set_title(\"Select Puzzle Filename\")\n\tfileDialog.set_access(FileDialog.ACCESS_USERDATA)\n\tfileDialog.set_current_dir(\"PuzzleSaves\")\n\tfileDialog.add_filter(\"*.pzl ; Anttris Puzzle\")\n\t\n\t# MainTheme leaks on bottom\n\tvar dialogTheme = Theme.new()\n\tdialogTheme.copy_default_theme()\n\tfileDialog.set_theme(dialogTheme)\n\t\n\t# work even if game is paused\n\tfileDialog.set_pause_mode(PAUSE_MODE_PROCESS)\n\n\t# unpause if user cancels\n\tfileDialog.connect(\"popup_hide\", get_tree(), \"set_pause\", [false])\n\tfileDialog.hide()\n\tadd_child(fileDialog)\n\t\n\tvar y = 0\n\tfor control in gui:\n\t\ty += 45\n\t\tif control[0].rfind('_toggle') > 0:\n\t\t\tvar togg = control[1]\n\t\t\tfor cont in togg.keys():\n\t\t\t\tif not cont.begins_with('value'):\n\t\t\t\t\tvar e = togg[cont]\n\t\t\t\t\te.set_pos(Vector2(10, y))\n\t\t\t\t\te.set_theme(theme)\n\t\t\t\t\tadd_child(e)\n\n\t\t\ttogg.left.set_text(\"<\")\n\t\t\ttogg.left.connect('pressed', self, 'updateToggle', [togg, false])\n\n\t\t\ttogg.label.set_pos(Vector2(90, y + 4))\n\t\t\ttogg.label.set_text(togg.value)\n\n\t\t\ttogg.right.set_pos(Vector2(55, y))\n\t\t\ttogg.right.set_text(\">\")\n\t\t\ttogg.right.connect('pressed', self, 'updateToggle', [togg, true])\n\n\t\telse:\n\t\t\tvar e = control[1]\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tif e extends Button:\n\t\t\t\te.set_text(control[0])\n\t\t\tif control[0] == 'save_pzl' :\n\t\t\t\te.connect('pressed', self, 'showFileDialog')\n\t\t\tif control[0] == 'load_pzl' :\n\t\t\t\te.connect('pressed', self, 'showFileDialog', [true])\n\t\t\tif control[0] == 'status':\n\t\t\t\tcontrol[1].set_text('STATUS: NOMINAL')\n\t\t\tadd_child(e)\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"b8fed647d789f7ebd2f7ea143d674c07e5f8b8bf","subject":"fixed block addition","message":"fixed block addition\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Editor.gd","new_file":"src\/scripts\/Editor.gd","new_contents":"extends Spatial\n\nvar puzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar puzzle\nvar puzzleMan\n\nvar gridMan\nvar prevBlockByColor = {} # keeps track of prevous color for pairs\nvar blockColors = preload(\"res:\/\/scripts\/PuzzleManager.gd\").blockColors\nvar id\n\nvar fileDialog = load(\"res:\/\/fileDialog.scn\").instance()\nvar gui = [\n\t[\"status\", Label.new()], # plz keep me as first element, referenced as gui[0] later\n\t[\"save_pzl\", Button.new()],\n\t[\"load_pzl\", Button.new()],\n\t[\"remove_layer\", Button.new()],\n\t[\"random_layer\", Button.new()],\n\t# THESE SHOULD BE Options instead of left, label, right\n\t[\"class_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=[\"LZR\", \"WILD\", \"PAIR\", \"GOAL\"],\n\t\tvalue=\"PAIR\"\n\t}],\n\t[\"color_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=blockColors,\n\t\tvalue=\"Blue\"\n\t}],\n\t[\"action_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=[\"Add\", \"Remove\", \"Replace\"],\n\t\tvalue=\"Add\"\n\t}],\n\t[\"test_pzl\", Button.new()],\n]\nvar action_ix = gui.size() - 1 - 1\nvar color_ix = gui.size() - 1 - 2\nvar class_ix = gui.size() - 1 - 3\n\n# gross style, cannot , but clean enough\nfunc shouldAddNeighbor():\n\treturn gui[action_ix][1].value == \"Add\"\n\nfunc shouldReplaceSelf():\n\treturn gui[action_ix][1].value == \"Replace\"\n\nfunc shouldRemoveSelf():\n\treturn gui[action_ix][1].value == \"Remove\"\n\n# called in AbstractBlock to add a new block\nfunc newPickledBlock():\n\tvar curColor = gui[color_ix][1].value\n\tvar b = puzzleMan.PickledBlock.new() \\\n\t\t.setName(id) \\\n\t\t.setTextureName(curColor)\n\tvar pb = prevBlockByColor[curColor]\n\tid += 1\n\n\tif pb != null:\n\t\tb.setPairName(pb.name)\n\t\tgridMan.get_node(pb.toNode().name).setPairName(b.name)\n\t\tprevBlockByColor[curColor] = null\n\t\tgui[0][1].set_text(\"STATUS: NOMINAL\")\n\telse:\n\t\t# TODO SUPPORT GLYPHS HERE, SET PAIRWISE GLYPH\n\t\tprevBlockByColor[curColor] = b\n\t\tvar missing = \"\"\n\t\tfor k in prevBlockByColor.keys():\n\t\t\tif prevBlockByColor[k] != null:\n\t\t\t\tmissing += k.to_upper() + \" \" # bad way of constructing strings\n\t\tgui[0][1].set_text(\"STATUS: ERROR, ADD PAIR \" + missing)\n\treturn b\n\nfunc showFileDialog(loadInstead=false):\n\tget_tree().set_pause(true)\n\n\tif loadInstead:\n\t\tfileDialog.connect(\"confirmed\", self, \"puzzleLoad\")\n\t\tfileDialog.set_mode(FileDialog.MODE_OPEN_FILE)\n\telse:\n\t\tfileDialog.connect(\"confirmed\", self, \"puzzleSave\")\n\t\tfileDialog.set_mode(FileDialog.MODE_SAVE_FILE)\n\n\tfileDialog.popup_centered()\n\nfunc puzzleSave():\n\tprint(\"SAVING TO \", fileDialog.get_current_file() )\n\tget_tree().set_pause(false)\n\nfunc puzzleLoad():\n\tprint(\"LOADING FROM \", fileDialog.get_current_file() )\n\tget_tree().set_pause(false)\n\nfunc changeValue(ix, togg):\n\ttogg.value = togg.values[ix]\n\nfunc _ready():\n\tfor k in blockColors:\n\t\tprevBlockByColor[k] = null\n\n\tpuzzle = puzzleScn.instance()\n\tgridMan = puzzle.get_node(\"GridView\/GridMan\")\n\tid = gridMan.shape.size()\n\tpuzzle.mainPuzzle = false\n\tget_tree().get_root().add_child( preload( \"res:\/\/puzzleView.scn\" ).instance() )\n\n\t# hide and disable timer\n\tpuzzle.time.on = false;\n\tpuzzle.time.val = ''\n\n\tpuzzle.set_as_toplevel(true)\n\n\tadd_child(puzzle)\n\n\tpuzzleMan = puzzle.puzzleMan\n\n\tset_process_input(true)\n\n\tvar theme = preload(\"res:\/\/themes\/MainTheme.thm\")\n\n\n\tfileDialog.set_title(\"Select Puzzle Filename\")\n\tfileDialog.set_access(FileDialog.ACCESS_USERDATA)\n\tfileDialog.set_current_dir(\"PuzzleSaves\")\n\tfileDialog.add_filter(\"*.pzl ; Anttris Puzzle\")\n\n\t# MainTheme leaks on bottom\n\tvar dialogTheme = Theme.new()\n\tdialogTheme.copy_default_theme()\n\tfileDialog.set_theme(dialogTheme)\n\n\t# work even if game is paused\n\tfileDialog.set_pause_mode(PAUSE_MODE_PROCESS)\n\n\t# unpause if user cancels\n\tfileDialog.connect(\"popup_hide\", get_tree(), \"set_pause\", [false])\n\tfileDialog.hide()\n\tadd_child(fileDialog)\n\n\tvar y = 0\n\tfor control in gui:\n\t\ty += 45\n\t\tif control[0].rfind('_toggle') > 0:\n\t\t\tvar togg = control[1]\n\t\t\tvar e = togg.optionButt\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tadd_child(e)\n\n\t\t\t# index of items needed\n\t\t\te.connect(\"item_selected\", self, \"changeValue\", [togg])\n\t\t\tfor i in range(togg.values.size()):\n\t\t\t\te.add_item(togg.values[i], i)\n\t\t\t\t# e.add_icon_item(togg.values[i], i)\n\n\t\telse:\n\t\t\tvar e = control[1]\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tif e extends Button:\n\t\t\t\te.set_text(control[0])\n\t\t\tif control[0] == 'save_pzl' :\n\t\t\t\te.connect('pressed', self, 'showFileDialog')\n\t\t\tif control[0] == 'load_pzl' :\n\t\t\t\te.connect('pressed', self, 'showFileDialog', [true])\n\t\t\tif control[0] == 'status':\n\t\t\t\tcontrol[1].set_text('STATUS: NOMINAL')\n\t\t\tadd_child(e)\n\n\n","old_contents":"extends Spatial\n\nvar puzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar puzzle\nvar puzzleMan\n\nvar gridMan\nvar prevBlockByColor = {} # keeps track of prevous color for pairs\nvar blockColors = preload(\"res:\/\/scripts\/PuzzleManager.gd\").blockColors\n\nvar fileDialog = load(\"res:\/\/fileDialog.scn\").instance()\nvar gui = [\n\t[\"status\", Label.new()], # plz keep me as first element, referenced as gui[0] later\n\t[\"save_pzl\", Button.new()],\n\t[\"load_pzl\", Button.new()],\n\t[\"remove_layer\", Button.new()],\n\t[\"random_layer\", Button.new()],\n\t# THESE SHOULD BE Options instead of left, label, right\n\t[\"class_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=[\"LZR\", \"WILD\", \"PAIR\", \"GOAL\"],\n\t\tvalue=\"PAIR\"\n\t}],\n\t[\"color_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=blockColors,\n\t\tvalue=\"Blue\"\n\t}],\n\t[\"action_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=[\"Add\", \"Remove\", \"Replace\"],\n\t\tvalue=\"Add\"\n\t}],\n\t[\"test_pzl\", Button.new()],\n]\nvar action_ix = gui.size() - 1 - 1\nvar color_ix = gui.size() - 1 - 2\nvar class_ix = gui.size() - 1 - 3\n\n# gross style, cannot , but clean enough\nfunc shouldAddNeighbor():\n\treturn gui[action_ix][1].value == \"Add\"\n\nfunc shouldReplaceSelf():\n\treturn gui[action_ix][1].value == \"Replace\"\n\nfunc shouldRemoveSelf():\n\treturn gui[action_ix][1].value == \"Remove\"\n\nfunc newPickledBlock():\n\tvar curColor = gui[color_ix][1].value\n\tvar b = puzzleMan.PickledBlock.new() \\\n\t\t.setName(gridMan.shape.keys().size()) \\\n\t\t.setTextureName(curColor)\n\tvar pb = prevBlockByColor[curColor]\n\n\tif pb != null:\n\t\tb.setPairName(pb.name)\n\t\tgridMan.get_node(pb.toNode().name).setPairName(b.name)\n\t\tprevBlockByColor[curColor] = null\n\t\tgui[0][1].set_text(\"STATUS: NOMINAL\")\n\telse:\n\t\t# TODO SUPPORT GLYPHS HERE, SET PAIRWISE GLYPH\n\t\tprevBlockByColor[curColor] = b\n\t\tvar missing = \"\"\n\t\tfor k in prevBlockByColor.keys():\n\t\t\tif prevBlockByColor[k] != null:\n\t\t\t\tmissing += k.to_upper() + \" \" # bad way of constructing strings\n\t\tgui[0][1].set_text(\"STATUS: ERROR, ADD PAIR \" + missing)\n\treturn b\n\nfunc showFileDialog(loadInstead=false):\n\tget_tree().set_pause(true)\n\n\tif loadInstead:\n\t\tfileDialog.connect(\"confirmed\", self, \"puzzleLoad\")\n\t\tfileDialog.set_mode(FileDialog.MODE_OPEN_FILE)\n\telse:\n\t\tfileDialog.connect(\"confirmed\", self, \"puzzleSave\")\n\t\tfileDialog.set_mode(FileDialog.MODE_SAVE_FILE)\n\n\tfileDialog.popup_centered()\n\nfunc puzzleSave():\n\tprint(\"SAVING TO \", fileDialog.get_current_file() )\n\tget_tree().set_pause(false)\n\nfunc puzzleLoad():\n\tprint(\"LOADING FROM \", fileDialog.get_current_file() )\n\tget_tree().set_pause(false)\n\nfunc changeValue(ix, togg):\n\ttogg.value = togg.values[ix]\n\nfunc _ready():\n\tfor k in blockColors:\n\t\tprevBlockByColor[k] = null\n\tget_tree().get_root().add_child( preload( \"res:\/\/puzzleView.scn\" ).instance() )\n\n\tpuzzle = puzzleScn.instance()\n\tgridMan = puzzle.get_node(\"GridView\/GridMan\")\n\tpuzzle.mainPuzzle = false\n\n\t# hide and disable timer\n\tpuzzle.time.on = false;\n\tpuzzle.time.val = ''\n\n\tpuzzle.set_as_toplevel(true)\n\n\tadd_child(puzzle)\n\n\tprint(puzzle.get_tree() == get_tree())\n\tpuzzleMan = puzzle.puzzleMan\n\n\tset_process_input(true)\n\n\tvar theme = preload(\"res:\/\/themes\/MainTheme.thm\")\n\n\n\tfileDialog.set_title(\"Select Puzzle Filename\")\n\tfileDialog.set_access(FileDialog.ACCESS_USERDATA)\n\tfileDialog.set_current_dir(\"PuzzleSaves\")\n\tfileDialog.add_filter(\"*.pzl ; Anttris Puzzle\")\n\n\t# MainTheme leaks on bottom\n\tvar dialogTheme = Theme.new()\n\tdialogTheme.copy_default_theme()\n\tfileDialog.set_theme(dialogTheme)\n\n\t# work even if game is paused\n\tfileDialog.set_pause_mode(PAUSE_MODE_PROCESS)\n\n\t# unpause if user cancels\n\tfileDialog.connect(\"popup_hide\", get_tree(), \"set_pause\", [false])\n\tfileDialog.hide()\n\tadd_child(fileDialog)\n\n\tvar y = 0\n\tfor control in gui:\n\t\ty += 45\n\t\tif control[0].rfind('_toggle') > 0:\n\t\t\tvar togg = control[1]\n\t\t\tvar e = togg.optionButt\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tadd_child(e)\n\n\t\t\t# index of items needed\n\t\t\tfor i in range(togg.values.size()):\n\t\t\t\te.add_item(togg.values[i], i)\n\t\t\t\te.connect(\"item_selected\", self, \"changeValue\", [togg])\n\t\t\t\t# e.add_icon_item(togg.values[i], i)\n\n\t\telse:\n\t\t\tvar e = control[1]\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tif e extends Button:\n\t\t\t\te.set_text(control[0])\n\t\t\tif control[0] == 'save_pzl' :\n\t\t\t\te.connect('pressed', self, 'showFileDialog')\n\t\t\tif control[0] == 'load_pzl' :\n\t\t\t\te.connect('pressed', self, 'showFileDialog', [true])\n\t\t\tif control[0] == 'status':\n\t\t\t\tcontrol[1].set_text('STATUS: NOMINAL')\n\t\t\tadd_child(e)\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"b5ebbc648a13e2ab08f831cf496727f4070865ec","subject":"send puzzle over network. static time formatter","message":"send puzzle over network. static time formatter\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Puzzle.gd","new_file":"src\/scripts\/Puzzle.gd","new_contents":"# Provides functionality for the puzzle itself\n\nextends Spatial\n\nvar DataMan = preload( \"res:\/\/scripts\/DataManager.gd\" ).new()\nvar PuzzleManScript = preload( \"res:\/\/scripts\/PuzzleManager.gd\" )\nvar PuzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar puzzleMan\nvar seed\nvar otherPuzzle\nvar generateRandom = true\nvar mainPuzzle = false\n\nvar time = {\n\t\ton = true,\n\t\tval = 0.0,\n\t\tlabel = Label.new(),\n\t\ttween = Tween.new() }\n\nfunc addTimer():\n\tadd_child(time.label)\n\tadd_child(time.tween)\n\ttime.label.set_pos(Vector2(15,15))\n\n\ttime.label.set_theme(load(\"res:\/\/themes\/MainTheme.thm\"))\n\ttime.tween.interpolate_method(time.label, \"set_pos\", \\\n\t\t\ttime.label.get_pos(), time.label.get_pos()*2, 0.5, \\\n\t\t\tTween.TRANS_BOUNCE, Tween.EASE_OUT)\n\ttime.tween.start()\n\ttime.label.set_text(str(time.val))\n\nstatic func formatTime(t):\n\tvar mins = floor(t \/ 60)\n\tvar secs = fmod(floor(t), 60)\n\tvar millis = floor((t - floor(t)) * 1000)\n\treturn str(mins) + \":\" + str(secs).pad_zeros(2) + \":\" + str(millis).pad_zeros(3)\n\nfunc _process(dTime):\n\t# start label tween on\n\ttime.val += dTime\n\ttime.label.set_text(formatTime(time.val))\n\tif fmod(time.val, 10) < 0.1:\n\t\ttime.tween.seek(0.0)\n\n# Called for initialization\nfunc _ready():\n\tif time.on:\n\t\tset_process(true) # needed for time keeping\n\taddTimer()\n\n\t#set up network stuffs\n\tadd_child(load(\"res:\/\/networkProxy.scn\").instance())\n\tvar Network = Globals.get(\"Network\")\n\tif Network != null:\n\t\tNetwork.proxy.set_process(Network.isClient or Network.isHost)\n\n\n\t# generate puzzle\n\tpuzzleMan = PuzzleManScript.new()\n\tvar puzzle\n\n\tif generateRandom:\n\t\tseed = OS.get_unix_time() # unix time\n\t\tseed *= OS.get_ticks_msec() # initial time\n\t\tseed *= 1 + OS.get_time().second\n\t\tseed *= 1 + OS.get_date().weekday\n\t\tseed = abs(seed) % 7919 # 1000th prime\n\n\t\trand_seed(seed)\n\n\t\tpuzzle = puzzleMan.generatePuzzle( 2, puzzleMan.DIFF_HARD )\n\t\tpuzzle.puzzleMan = puzzleMan\n\t\tvar steps = puzzle.solvePuzzleSteps()\n\t\tprint(\"Generated \", puzzle.shape.size(), \" blocks.\" )\n\t\tprint( \"PUZZLE IS SOLVEABLE?: \", steps.solveable )\n\n\t\tvar gridMan = get_node( \"GridView\/GridMan\" )\n\t\tDataMan.savePuzzle(\"test.pzl\", puzzle)\n\t\tvar pCopy = DataMan.loadPuzzle(\"test.pzl\")\n\t\tgridMan.set_puzzle(puzzle)\n\n\t\n\n\t# make a new puzzle, embed using Viewport\n\tif mainPuzzle:\n\t\tif (not Network == null and Network.isNetwork):\n\t\t\tprint(\"Sending puzzle\")\n\t\t\tNetwork.sendStart(puzzle)\n\n\t\tvar p = PuzzleScn.instance()\n\t\tp.get_node(\"GridView\").active = false\n\t\tp.get_node(\"GridView\/GridMan\").set_puzzle(puzzle)\n\t\tp.mainPuzzle = false\n\t\tp.set_scale(Vector3(0.5, 0.5, 0.5))\n\t\tp.set_translation(Vector3(10, 5, -20))\n\n\t\tvar v = Viewport.new()\n\t\tvar c = Control.new()\n\n\t\tv.set_world(p.get_world())\n\t\tv.set_render_target_to_screen_rect(Rect2(20,20,40,40))\n\t\tv.set_physics_object_picking(false)\n\t\tv.add_child(p)\n\t\tc.add_child(v)\n\t\tadd_child(c)\n\n\t\tp.get_node(\"GridView\").set_process_input(false)\n\n\t\totherPuzzle = p #for use with network\n\n\n","old_contents":"# Provides functionality for the puzzle itself\n\nextends Spatial\n\nvar DataMan = preload( \"res:\/\/scripts\/DataManager.gd\" ).new()\nvar PuzzleManScript = preload( \"res:\/\/scripts\/PuzzleManager.gd\" )\nvar PuzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar puzzleMan\nvar seed\nvar otherPuzzle\nvar generateRandom = true\nvar mainPuzzle = false\n\nvar time = {\n\t\ton = true,\n\t\tval = 0.0,\n\t\tlabel = Label.new(),\n\t\ttween = Tween.new() }\n\nfunc addTimer():\n\tadd_child(time.label)\n\tadd_child(time.tween)\n\ttime.label.set_pos(Vector2(15,15))\n\n\ttime.label.set_theme(load(\"res:\/\/themes\/MainTheme.thm\"))\n\ttime.tween.interpolate_method(time.label, \"set_pos\", \\\n\t\t\ttime.label.get_pos(), time.label.get_pos()*2, 0.5, \\\n\t\t\tTween.TRANS_BOUNCE, Tween.EASE_OUT)\n\ttime.tween.start()\n\ttime.label.set_text(str(time.val))\n\nfunc formatTime(t):\n\tvar mins = floor(t \/ 60)\n\tvar secs = fmod(floor(t), 60)\n\tvar millis = floor((t - floor(t)) * 1000)\n\treturn str(mins) + \":\" + str(secs).pad_zeros(2) + \":\" + str(millis).pad_zeros(3)\n\nfunc _process(dTime):\n\t# start label tween on\n\ttime.val += dTime\n\ttime.label.set_text(formatTime(time.val))\n\tif fmod(time.val, 10) < 0.1:\n\t\ttime.tween.seek(0.0)\n\n# Called for initialization\nfunc _ready():\n\tif time.on:\n\t\tset_process(true) # needed for time keeping\n\taddTimer()\n\n\t#set up network stuffs\n\tadd_child(load(\"res:\/\/networkProxy.scn\").instance())\n\tvar Network = Globals.get(\"Network\")\n\tif Network != null:\n\t\tNetwork.proxy.set_process(Network.isClient or Network.isHost)\n\n\n\t# generate puzzle\n\tpuzzleMan = PuzzleManScript.new()\n\tvar puzzle\n\n\tif generateRandom:\n\t\tseed = OS.get_unix_time() # unix time\n\t\tseed *= OS.get_ticks_msec() # initial time\n\t\tseed *= 1 + OS.get_time().second\n\t\tseed *= 1 + OS.get_date().weekday\n\t\tseed = abs(seed) % 7919 # 1000th prime\n\n\t\trand_seed(seed)\n\n\t\tpuzzle = puzzleMan.generatePuzzle( 1, puzzleMan.DIFF_EASY )\n\t\tpuzzle.puzzleMan = puzzleMan\n\t\tvar steps = puzzle.solvePuzzleSteps()\n\t\tprint(\"Generated \", puzzle.shape.size(), \" blocks.\" )\n\t\tprint( \"PUZZLE IS SOLVEABLE?: \", steps.solveable )\n\n\t\tvar gridMan = get_node( \"GridView\/GridMan\" )\n\t\tDataMan.savePuzzle(\"test.pzl\", puzzle)\n\t\tvar pCopy = DataMan.loadPuzzle(\"test.pzl\")\n\t\tgridMan.set_puzzle(puzzle)\n\n\t\tvar network = Globals.get(\"Network\")\n\t\tif (not network == null and network.isNetwork):\n\t\t\tprint(\"Sending puzzle\")\n\n\t# make a new puzzle, embed using Viewport\n\tif mainPuzzle:\n\t\tnetwork.sendStart(puzzle)\n\n\t\tvar p = PuzzleScn.instance()\n\t\tp.get_node(\"GridView\").active = false\n\t\tp.get_node(\"GridView\/GridMan\").set_puzzle(puzzle)\n\t\tp.mainPuzzle = false\n\t\tp.set_scale(Vector3(0.5, 0.5, 0.5))\n\t\tp.set_translation(Vector3(10, 5, -20))\n\n\t\tvar v = Viewport.new()\n\t\tvar c = Control.new()\n\n\t\tv.set_world(p.get_world())\n\t\tv.set_render_target_to_screen_rect(Rect2(20,20,40,40))\n\t\tv.set_physics_object_picking(false)\n\t\tv.add_child(p)\n\t\tc.add_child(v)\n\t\tadd_child(c)\n\n\t\tp.get_node(\"GridView\").set_process_input(false)\n\n\t\totherPuzzle = p #for use with network\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"b3e06fb2e52f88440f7f6d776d93edb345912497","subject":"Clean up comments for Network.gd","message":"Clean up comments for Network.gd\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Network.gd","new_file":"src\/scripts\/Network.gd","new_contents":"# Core networking\n\nextends Node\n\nconst REMOTE_FINISH = 0\nconst REMOTE_START = 1\nconst REMOTE_QUIT = 2\nconst REMOTE_BLOCK = 4\nconst REMOTE_BLOCK_TRANSFORM = 5\nconst REMOTE_BLOCK_UPDATE = 6\n\nvar port = 54321\nvar root\nvar isNetwork\nvar isHost\nvar isClient = false\nvar server\nvar client\nvar connection\nvar proxy\n\nvar remotePuzzle\n\n#Store the peer stream used by both the lcient and server\nvar stream\n\nfunc _ready():\n\tisNetwork = false\n\tisHost = false\n\tvar label = get_tree().get_root().get_node(\"GUIManager\/OptionsMenu\/Panel\/PortField\/LineEdit\")\n\tif not label == null:\n\t\tlabel.set_text(str(port))\n\nfunc setPort(pt):\n\tport = pt;\n\nfunc connectTo(ip, pt):\n\tisClient = true #just to tell if it's doing something :S\n\tconnection = PacketPeerStream.new()\n\tstream = StreamPeerTCP.new()\n\tconnection.set_stream_peer(stream)\n\tstream.connect(ip, pt);\n\t\n\tif stream.get_status() == stream.STATUS_CONNECTED or stream.get_status() == stream.STATUS_CONNECTING:\n\t\tprint(\"Connecting to \" + ip + \":\" + str(port));\n\t\tproxy.set_process(true)\n\t\t#leave is_network as false to indicate we're still waiting for connection\n\t\n\t\nfunc host(pt):\n\tserver = TCP_Server.new()\n\t#connection = PacketPeerStream.new()\n\tisHost = true\n\tprint(\"Starting listening server on port \" + str(pt))\n\tif server.listen(pt) == 0:\n\t\tproxy.set_process(true)\n\t\tprint(\"Listening...\")\n\telse:\n\t\tprint(\"Failed to start server on port \" + str(pt));\n\nfunc _process(delta):\n\tif (isHost):\n\t\t#server processing stuff\n\t\t#use isNetwork to determine if we're still listening\n\t\tif !isNetwork:\n\t\t\tif server.is_connection_available():\n\t\t\t\tstream = server.take_connection()\n\t\t\t\tconnection = PacketPeerStream.new()\n\t\t\t\tconnection.set_stream_peer(stream)\n\t\t\t\tprint(\"Connecting with player...\")\n\t\t\t\tisNetwork = true\n\t\t\t\tserver.stop()\n\t\t\t\tchangeScene(\"res:\/\/puzzle.scn\")\n\t\t\t\tremotePuzzle = root.get_node(\"Spatial\")\n\t\t\t\t#MAKE CALL TO PUZZLE SELECTER\n\t\telse: #not listening anymore, have a client\n\t\t\t#do quick check to make sure we're still\n\t\t\t#connected\n\t\t\tif !stream.is_connected():\n\t\t\t\tprint(\"Lost Connection!\");\n\t\t\t\tisNetwork = false\n\t\t\t\tproxy.set_process(false)\n\t\t\t\t#QUIT GAME\n\t\t\t\treturn\n\t\t\t#check if we have any data\n\t\t\tif connection.get_available_packet_count() > 0:\n\t\t\t\t#have to be careful about more than 1 packet per frame\n\t\t\t\tfor i in range(connection.get_available_packet_count()):\n\t\t\t\t\tvar dataArray = connection.get_var()\n\t\t\t\t\tProcessServerData(dataArray)\n\t\t\t\t\t\n\telse:\n\t\t#client processing stuff\n\t\tif !isNetwork:\n\t\t\t#Still waiting for connection confirmed\n\t\t\tif stream.get_status() == stream.STATUS_CONNECTED:\n\t\t\t\tprint(\"Connection established!\")\n\t\t\t\tisNetwork = true\n\t\t\t\tchangeScene(\"res:\/\/puzzle.scn\")\n\t\t\t\tremotePuzzle = root.get_node(\"Spatial\")\n\t\t\t\treturn\n\t\t\tif stream.get_status() == stream.STATUS_NONE or stream.get_status() == stream.STATUS_ERROR:\n\t\t\t\tprint(\"Error establishing connection!\")\n\t\t\t\tproxy.set_process(false)\n\t\t\t\treturn\n\t\t\t\t#stop running process loop, cause we have no connection\n\t\telse:\n\t\t\t#connecton established and confirmed. Do regular data processing\n\t\t\t#check if we have any data\n\t\t\tif connection.get_available_packet_count() > 0:\n\t\t\t\tfor i in range(connection.get_available_packet_count()):\n\t\t\t\t\tvar dataArray = connection.get_var()\n\t\t\t\t\tProcessServerData(dataArray)\n\t\t\t\t\t#Call the server process script cuase it's peer to peer and we have the same functions!\n\n\nfunc disconnect():\n\t#need to do lots of things! If the server is open and listening, but has no connection just stop listening!\n\tif isHost and !isNetwork:\n\t\t#this means we're waiting for connection still\n\t\tserver.stop()\n\t\tprint(\"closing server listener!\")\n\telif isHost and isNetwork:\n\t\t#have connections. Need to send them stop packet, and close connection\n\t\tconnection.put_var([REMOTE_QUIT])\n\t\tstream.disconnect()\n\t\tprint(\"Closing connection to remote player...\")\n\telif !isHost and !isNetwork:\n\t\tstream.disconnect()\n\t\tprint(\"Halting connection request...\")\n\telif !isHost and isNetwork:\n\t\t#connected to server already\n\t\tstream.disconnect()\n\t\tprint(\"Disconnecting from server...\")\n\t\n\t#no matter where we wre before disconnect, set network to false and return to beginning screen!\n\tisNetwork = false;\n\tisHost = false;\n\tisClient = false;\n\t\n\tproxy.set_process(false)\n\t\n\tchangeScene(\"res:\/\/menus.scn\")\n\n\n\nfunc ProcessServerData(dataArray):\n\t#have an array of data. First element should be identifying int\n\tvar ID = dataArray[0]\n\tprint(ID)\n\t#no switch statement. I'm crying right now while i type this. My fingers are bleeding\n\tif ID == REMOTE_START:\n\t\t#do start something or something whut\n\t\tprint(\"remote_stuff\")\n\telif ID == REMOTE_FINISH:\n\t\t#again, do ending stuff\n\t\tprint(\"remote_finish: \" + str(dataArray[1]))\n\telif ID == REMOTE_QUIT:\n\t\t#omg those jerks!\n\t\tprint(\"remote_quit\")\n\t\tdisconnect()\n\telif ID == REMOTE_BLOCK:\n\t\t#get their block ifnormation!\n\t\tprint(\"remote_block\")\n\telif ID == REMOTE_BLOCK_TRANSFORM:\n\t\t#sent block information\n\t\tprint(\"block TRANSFORM!!!!!!!!!!!\")\n\t\t#var scale = dataArray[1]\n\t\tvar translation = dataArray[1]\n\t\t#remotePuzzle.otherPuzzle.set_scale(scale)\n\t\tremotePuzzle.otherPuzzle.set_transform(Transform( translation ))\n\t\tremotePuzzle.otherPuzzle.set_translation(Vector3(20, 12, -40))\n\telif ID == REMOTE_BLOCK_UPDATE:\n\t\t#sent an updated block pair\n\t\tprint(\"block update\")\n\t\tvar gridMan = root.get_node( \"Spatial\/GridView\/GridMan\" )\n\t\tvar pos1 = dataArray[1]\n\t\tvar pos2 = dataArray[2]\n\t\tgridMan.remove_block(pos1)\n\t\tgridMan.remove_block(pos2)\n\nfunc sendStart():\n\tif !isNetwork:\n\t\tprint(\"Error sending start packet: not connected!\")\n\t\treturn\n\tvar er = connection.put_var([REMOTE_START])\n\tprint(\"Sending start and got [\" + str(er) + \"]\")\n\nfunc sendBlockUpdate(pos1, pos2):\n\tif !isNetwork:\n\t\tprint(\"Error sending start packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_BLOCK_UPDATE, pos1, pos2])\n\nfunc sendFinish(score):\n\tif !isNetwork:\n\t\tprint(\"Error sending finish packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_FINISH, score])\n\nfunc sendQuit():\n\tif !isNetwork:\n\t\tprint(\"Error sending finish packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_QUIT])\n\nfunc sendTransform(translation):\n\tif !isNetwork:\n\t\tprint(\"Cannot send transformation over an unitialized network!\")\n\t\treturn\n\tconnection.put_var([REMOTE_BLOCK_TRANSFORM, translation])\n\tprint(\"it got here\")\n\n\nfunc changeScene(scene):\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\troot.add_child( ResourceLoader.load( scene ).instance() )\n","old_contents":"\nextends Node\n\nconst REMOTE_FINISH = 0\nconst REMOTE_START = 1\nconst REMOTE_QUIT = 2\nconst REMOTE_BLOCK = 4\nconst REMOTE_BLOCK_TRANSFORM = 5\nconst REMOTE_BLOCK_UPDATE = 6\n\nvar port = 54321\nvar root\nvar isNetwork\nvar isHost\nvar isClient = false\nvar server\nvar client\nvar connection\nvar proxy\n\nvar remotePuzzle\n\n#Store the peer stream used by both the lcient and server\nvar stream\n\nfunc _ready():\n\tisNetwork = false\n\tisHost = false\n\tvar label = get_tree().get_root().get_node(\"GUIManager\/OptionsMenu\/Panel\/PortField\/LineEdit\")\n\tif not label == null:\n\t\tlabel.set_text(str(port))\n\nfunc setPort(pt):\n\tport = pt;\n\nfunc connectTo(ip, pt):\n\tisClient = true #just to tell if it's doing something :S\n\tconnection = PacketPeerStream.new()\n\tstream = StreamPeerTCP.new()\n\tconnection.set_stream_peer(stream)\n\tstream.connect(ip, pt);\n\t\n\tif stream.get_status() == stream.STATUS_CONNECTED or stream.get_status() == stream.STATUS_CONNECTING:\n\t\tprint(\"Connecting to \" + ip + \":\" + str(port));\n\t\tproxy.set_process(true)\n\t\t#leave is_network as false to indicate we're still waiting for connection\n\t\n\t\nfunc host(pt):\n\tserver = TCP_Server.new()\n\t#connection = PacketPeerStream.new()\n\tisHost = true\n\tprint(\"Starting listening server on port \" + str(pt))\n\tif server.listen(pt) == 0:\n\t\tproxy.set_process(true)\n\t\tprint(\"Listening...\")\n\telse:\n\t\tprint(\"Failed to start server on port \" + str(pt));\n\nfunc _process(delta):\n\t#print(\"Spam\")\n\t#self.omg()\n\tif (isHost):\n\t\t#server processing stuff\n\t\t#use isNetwork to determine if we're still listening\n\t\tif !isNetwork:\n\t\t\tif server.is_connection_available():\n\t\t\t\tstream = server.take_connection()\n\t\t\t\tconnection = PacketPeerStream.new()\n\t\t\t\tconnection.set_stream_peer(stream)\n\t\t\t\tprint(\"Connecting with player...\")\n\t\t\t\tisNetwork = true\n\t\t\t\tserver.stop()\n\t\t\t\tchangeScene(\"res:\/\/puzzle.scn\")\n\t\t\t\tremotePuzzle = root.get_node(\"Spatial\")\n\t\t\t\t#MAKE CALL TO PUZZLE SELECTER\n\t\telse: #not listening anymore, have a client\n\t\t\t#do quick check to make sure we're still\n\t\t\t#connected\n\t\t\tif !stream.is_connected():\n\t\t\t\tprint(\"Lost Connection!\");\n\t\t\t\tisNetwork = false\n\t\t\t\tproxy.set_process(false)\n\t\t\t\t#QUIT GAME\n\t\t\t\treturn\n\t\t\t#check if we have any data\n\t\t\tif connection.get_available_packet_count() > 0:\n\t\t\t\t#have to be careful about more than 1 packet per frame\n\t\t\t\tfor i in range(connection.get_available_packet_count()):\n\t\t\t\t\tvar dataArray = connection.get_var()\n\t\t\t\t\tProcessServerData(dataArray)\n\t\t\t\t\t\n\telse:\n\t\t#client processing stuff\n\t\tif !isNetwork:\n\t\t\t#Still waiting for connection confirmed\n\t\t\tif stream.get_status() == stream.STATUS_CONNECTED:\n\t\t\t\tprint(\"Connection established!\")\n\t\t\t\tisNetwork = true\n\t\t\t\tchangeScene(\"res:\/\/puzzle.scn\")\n\t\t\t\tremotePuzzle = root.get_node(\"Spatial\")\n\t\t\t\treturn\n\t\t\tif stream.get_status() == stream.STATUS_NONE or stream.get_status() == stream.STATUS_ERROR:\n\t\t\t\tprint(\"Error establishing connection!\")\n\t\t\t\tproxy.set_process(false)\n\t\t\t\treturn\n\t\t\t\t#stop running process loop, cause we have no connection\n\t\telse:\n\t\t\t#connecton established and confirmed. Do regular data processing\n\t\t\t#check if we have any data\n\t\t\tif connection.get_available_packet_count() > 0:\n\t\t\t\tfor i in range(connection.get_available_packet_count()):\n\t\t\t\t\tvar dataArray = connection.get_var()\n\t\t\t\t\tProcessServerData(dataArray)\n\t\t\t\t\t#Call the server process script cuase it's peer to peer and we have the same functions!\n\n\nfunc disconnect():\n\t#need to do lots of things! If the server is open and listening, but has no connection just stop listening!\n\tif isHost and !isNetwork:\n\t\t#this means we're waiting for connection still\n\t\tserver.stop()\n\t\tprint(\"closing server listener!\")\n\telif isHost and isNetwork:\n\t\t#have connections. Need to send them stop packet, and close connection\n\t\tconnection.put_var([REMOTE_QUIT])\n\t\tstream.disconnect()\n\t\tprint(\"Closing connection to remote player...\")\n\telif !isHost and !isNetwork:\n\t\tstream.disconnect()\n\t\tprint(\"Halting connection request...\")\n\telif !isHost and isNetwork:\n\t\t#connected to server already\n\t\tstream.disconnect()\n\t\tprint(\"Disconnecting from server...\")\n\t\n\t#no matter where we wre before disconnect, set network to false and return to beginning screen!\n\tisNetwork = false;\n\tisHost = false;\n\tisClient = false;\n\t\n\tproxy.set_process(false)\n\t\n\tchangeScene(\"res:\/\/menus.scn\")\n\n\n\nfunc ProcessServerData(dataArray):\n\t#have an array of data. First element should be identifying int\n\tvar ID = dataArray[0]\n\tprint(ID)\n\t#no swithc statement. I'm crying right now while i type this. My fingers are bleeding\n\tif ID == REMOTE_START:\n\t\t#do start something or something whut\n\t\tprint(\"remote_stuff\")\n\telif ID == REMOTE_FINISH:\n\t\t#again, do ending stuff\n\t\tprint(\"remote_finish: \" + str(dataArray[1]))\n\telif ID == REMOTE_QUIT:\n\t\t#omg those jerks!\n\t\tprint(\"remote_quit\")\n\t\tdisconnect()\n\telif ID == REMOTE_BLOCK:\n\t\t#get their block ifnormation!\n\t\tprint(\"remote_block\")\n\telif ID == REMOTE_BLOCK_TRANSFORM:\n\t\t#sent block information\n\t\tprint(\"block TRANSFORM!!!!!!!!!!!\")\n\t\t#var scale = dataArray[1]\n\t\tvar translation = dataArray[1]\n\t\t#remotePuzzle.otherPuzzle.set_scale(scale)\n\t\tremotePuzzle.otherPuzzle.set_transform(Transform( translation ))\n\t\tremotePuzzle.otherPuzzle.set_translation(Vector3(20, 12, -40))\n\telif ID == REMOTE_BLOCK_UPDATE:\n\t\t#sent an updated block pair\n\t\tprint(\"block update\")\n\t\tvar gridMan = root.get_node( \"Spatial\/GridView\/GridMan\" )\n\t\tvar pos1 = dataArray[1]\n\t\tvar pos2 = dataArray[2]\n\t\tgridMan.remove_block(pos1)\n\t\tgridMan.remove_block(pos2)\n\nfunc sendStart():\n\tif !isNetwork:\n\t\tprint(\"Error sending start packet: not connected!\")\n\t\treturn\n\tvar er = connection.put_var([REMOTE_START])\n\tprint(\"Sending start and got [\" + str(er) + \"]\")\n\nfunc sendBlockUpdate(pos1, pos2):\n\tif !isNetwork:\n\t\tprint(\"Error sending start packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_BLOCK_UPDATE, pos1, pos2])\n\nfunc sendFinish(score):\n\tif !isNetwork:\n\t\tprint(\"Error sending finish packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_FINISH, score])\n\nfunc sendQuit():\n\tif !isNetwork:\n\t\tprint(\"Error sending finish packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_QUIT])\n\nfunc sendTransform(translation):\n\tif !isNetwork:\n\t\tprint(\"Cannot send transformation over an unitialized network!\")\n\t\treturn\n\tconnection.put_var([REMOTE_BLOCK_TRANSFORM, translation])\n\tprint(\"it got here\")\n\n\nfunc changeScene(scene):\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\t#root.get_child( 0).queue_free()\n\troot.add_child( ResourceLoader.load( scene ).instance() )\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"0537cf5f85af8da7ed7f8f1fa188c149f6c9244b","subject":"call return after deleting self. very important. GODOT BUG, CAUSED SEGFAULT.","message":"call return after deleting self. very important. GODOT BUG, CAUSED SEGFAULT.\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Blocks\/AbstractBlock.gd","new_file":"src\/scripts\/Blocks\/AbstractBlock.gd","new_contents":"\nextends RigidBody\n\nvar name_int\nvar name\nvar pairName\nvar selected = false\nvar blockPos\nvar blockLayer\nvar blockType\nconst far_away_corner = Vector3(110, 110, 110)\n\nvar editor\n\nstatic func nameToNodeName(n):\n\treturn \"block\" + str(n)\n\nfunc setName(n):\n\tname_int = n\n\tname = nameToNodeName(n)\n\tset_name(nameToNodeName(n))\n\treturn self\n\nfunc setPairName(n):\n\tpairName = nameToNodeName(n)\n\treturn self\n\nfunc setBlockLayer(n):\n\tblockLayer = n\n\treturn self\n\nfunc getBlockLayer():\n\treturn blockLayer\n\nfunc setBlockType( blockT ):\n\tblockType = blockT\n\treturn self\n\nfunc getBlockType():\n\treturn blockType\n\nfunc setSelected(sel):\n\tselected = sel\n\treturn self\n\nfunc forceClick():\n\tactivate()\n\tget_parent().clickBlock( name )\n\nfunc addNeighbor(editor, click_normal):\n\tvar t = get_parent().get_parent().get_transform().inverse()\n\tvar b = editor.newPickledBlock().setBlockPos(blockPos + t * click_normal)\n\tget_parent().add_block(b.toNode())\n\n\n# catch clicks\/taps\nfunc _input_event( camera, ev, click_pos, click_normal, shape_idx ):\n\tif ((ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT)\n\tor (ev.type==InputEvent.SCREEN_TOUCH)):\n\t\tif (get_parent().get_parent().active and ev.is_pressed()):\n\t\t\tif editor != null:\n\t\t\t\tif editor.shouldAddNeighbor():\n\t\t\t\t\taddNeighbor(editor, click_normal)\n\t\t\t\t\treturn\n\t\t\t\tif editor.shouldReplaceSelf():\n\t\t\t\t\taddNeighbor(editor, 0 * click_normal)\n\t\t\t\t\tremove_with_pop(self, null)\n\t\t\t\t\treturn\n\t\t\t\tif editor.shouldRemoveSelf():\n\t\t\t\t\tremove_with_pop(self, null)\n\t\t\t\t\treturn\n\t\t\telse:\n\t\t\t\tforceClick()\n\n# returns this block's pairNode or null\nfunc pairActivate():\n\tselected = true\n\n\t# is my pair Nil?\n\tif pairName == null or get_parent() == null or not get_parent().has_node(pairName):\n\t\tscaleTweenNode(0.9, 0.2, Tween.TRANS_EXPO).start()\n\t\treturn null\n\n\t# get my pair node\n\tvar pairNode = get_parent().get_node(pairName)\n\n\t# enlarge if the other guy's unselected\n\tif not pairNode.selected:\n\t\tscaleTweenNode(1.1, 0.2, Tween.TRANS_EXPO).start()\n\treturn pairNode\n\n\n# returns a tween node that uniformly changes the object's scale\n# call start() on the returned object\nfunc scaleTweenNode(scale, time=1, transType=Tween.TRANS_BOUNCE):\n\tvar tweenNode = newTweenNode()\n\ttweenNode.interpolate_method( self, \"set_scale\", \\\n\t\tself.get_scale(), Vector3(scale, scale, scale), \\\n\t\ttime, transType, Tween.EASE_OUT )\n\n\treturn tweenNode\n\n# adds a tween transition node to the tree\nfunc newTweenNode():\n\tvar tween = Tween.new()\n\tadd_child(tween)\n\treturn tween\n\nfunc remove_with_pop(node, key=null):\n\tget_parent().samplePlayer.play(\"deraj_pop_sound\")\n\tget_parent().remove_block(self)\n\nfunc _ready():\n\teditor = get_tree().get_root().get_node(\"EditorSpatial\")\n\tset_ray_pickable(true)\n","old_contents":"\nextends RigidBody\n\nvar name_int\nvar name\nvar pairName\nvar selected = false\nvar blockPos\nvar blockLayer\nvar blockType\nconst far_away_corner = Vector3(110, 110, 110)\n\nvar editor\n\nstatic func nameToNodeName(n):\n\treturn \"block\" + str(n)\n\nfunc setName(n):\n\tname_int = n\n\tname = nameToNodeName(n)\n\tset_name(nameToNodeName(n))\n\treturn self\n\nfunc setPairName(n):\n\tpairName = nameToNodeName(n)\n\treturn self\n\nfunc setBlockLayer(n):\n\tblockLayer = n\n\treturn self\n\nfunc getBlockLayer():\n\treturn blockLayer\n\nfunc setBlockType( blockT ):\n\tblockType = blockT\n\treturn self\n\nfunc getBlockType():\n\treturn blockType\n\nfunc setSelected(sel):\n\tselected = sel\n\treturn self\n\nfunc forceClick():\n\tactivate()\n\tget_parent().clickBlock( name )\n\nfunc addNeighbor(editor, click_normal):\n\tvar t = get_parent().get_parent().get_transform().inverse()\n\tvar b = editor.newPickledBlock().setBlockPos(blockPos + t * click_normal)\n\tget_parent().add_block(b.toNode())\n\n\n# catch clicks\/taps\nfunc _input_event( camera, ev, click_pos, click_normal, shape_idx ):\n\tif ((ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT)\n\tor (ev.type==InputEvent.SCREEN_TOUCH)):\n\t\tif (get_parent().get_parent().active and ev.is_pressed()):\n\t\t\tif editor != null:\n\t\t\t\tif editor.shouldAddNeighbor():\n\t\t\t\t\taddNeighbor(editor, click_normal)\n\t\t\t\tif editor.shouldReplaceSelf():\n\t\t\t\t\taddNeighbor(editor, 0 * click_normal)\n\t\t\t\t\tremove_with_pop(self, null)\n\t\t\t\tif editor.shouldRemoveSelf():\n\t\t\t\t\tremove_with_pop(self, null)\n\t\t\telse:\n\t\t\t\tforceClick()\n\n# returns this block's pairNode or null\nfunc pairActivate():\n\tselected = true\n\n\t# is my pair Nil?\n\tif pairName == null or get_parent() == null or not get_parent().has_node(pairName):\n\t\tscaleTweenNode(0.9, 0.2, Tween.TRANS_EXPO).start()\n\t\treturn null\n\n\t# get my pair node\n\tvar pairNode = get_parent().get_node(pairName)\n\n\t# enlarge if the other guy's unselected\n\tif not pairNode.selected:\n\t\tscaleTweenNode(1.1, 0.2, Tween.TRANS_EXPO).start()\n\treturn pairNode\n\n\n# returns a tween node that uniformly changes the object's scale\n# call start() on the returned object\nfunc scaleTweenNode(scale, time=1, transType=Tween.TRANS_BOUNCE):\n\tvar tweenNode = newTweenNode()\n\ttweenNode.interpolate_method( self, \"set_scale\", \\\n\t\tself.get_scale(), Vector3(scale, scale, scale), \\\n\t\ttime, transType, Tween.EASE_OUT )\n\n\treturn tweenNode\n\n# adds a tween transition node to the tree\nfunc newTweenNode():\n\tvar tween = Tween.new()\n\tadd_child(tween)\n\treturn tween\n\nfunc remove_with_pop(node, key=null):\n\tget_parent().samplePlayer.play(\"deraj_pop_sound\")\n\tget_parent().remove_block(self)\n\nfunc _ready():\n\teditor = get_tree().get_root().get_node(\"EditorSpatial\")\n\tset_ray_pickable(true)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"031bc0fc73c00f24865655e16fff59bcd44f3a76","subject":"Keep track of block layer in AbstractBlock","message":"Keep track of block layer in AbstractBlock\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Blocks\/AbstractBlock.gd","new_file":"src\/scripts\/Blocks\/AbstractBlock.gd","new_contents":"extends RigidBody\n\nvar name\nvar pairName\nvar selected = false\nvar blockPos\nvar blockLayer\nconst far_away_corner = Vector3(80, 80, 80)\n\nfunc nameToNodeName(n):\n\treturn \"block\" + str(n)\n\nfunc setName(n):\n\tname = nameToNodeName(n)\n\tset_name(nameToNodeName(n))\n\treturn self\n\nfunc setPairName(n):\n\tpairName = nameToNodeName(n)\n\treturn self\n\nfunc setBlockLayer(n):\n\tblockLayer = n\n\treturn self\n\nfunc getBlockLayer():\n\treturn blockLayer\n\n# catch clicks\/taps\nfunc _input_event( camera, ev, click_pos, click_normal, shape_idx ):\n\tif ((ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT)\n\tor (ev.type==InputEvent.SCREEN_TOUCH)):\n\t\tactivate(ev, click_pos, click_normal)\n\n# returns this block's pairNode or null\nfunc pairActivate(ev, click_pos, click_normal):\n\tselected = true\n\n\t# is my pair Nil?\n\tif pairName == null or get_parent() == null or not get_parent().has_node(str(pairName)):\n\t\tscaleTweenNode(0.9, 0.2, Tween.TRANS_EXPO).start()\n\t\treturn null\n\n\t# get my pair node\n\tvar pairNode = get_parent().get_node(pairName)\n\n\t# enlarge if the other guy's unselected\n\tif not pairNode.selected:\n\t\tscaleTweenNode(1.1, 0.2, Tween.TRANS_EXPO).start()\n\treturn pairNode\n\n\n# returns a tween node that uniformly changes the object's scale\n# call start() on the returned object\nfunc scaleTweenNode(scale, time=1, transType=Tween.TRANS_BOUNCE):\n\tvar tweenNode = newTweenNode()\n\ttweenNode.interpolate_method( self, \"set_scale\", \\\n\t\tself.get_scale(), Vector3(scale, scale, scale), \\\n\t\ttime, transType, Tween.EASE_OUT )\n\n\treturn tweenNode\n\n# adds a tween transition node to the tree\nfunc newTweenNode():\n\tvar tween = Tween.new()\n\tadd_child(tween)\n\treturn tween\n\nfunc remove_with_pop(node, key):\n\tget_parent().samplePlayer.play(\"deraj_pop_sound\")\n\tget_parent().remove_block(self)\n\nfunc _ready():\n\tset_ray_pickable(true)\n","old_contents":"extends RigidBody\n\nvar name\nvar pairName\nvar selected = false\nvar blockPos\nconst far_away_corner = Vector3(80, 80, 80)\n\nfunc nameToNodeName(n):\n\treturn \"block\" + str(n)\n\nfunc setName(n):\n\tname = nameToNodeName(n)\n\tset_name(nameToNodeName(n))\n\treturn self\n\nfunc setPairName(n):\n\tpairName = nameToNodeName(n)\n\treturn self\n\n# catch clicks\/taps\nfunc _input_event( camera, ev, click_pos, click_normal, shape_idx ):\n\tif ((ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT)\n\tor (ev.type==InputEvent.SCREEN_TOUCH)):\n\t\tactivate(ev, click_pos, click_normal)\n\n# returns this block's pairNode or null\nfunc pairActivate(ev, click_pos, click_normal):\n\tselected = true\n\n\t# is my pair Nil?\n\tif pairName == null or get_parent() == null or not get_parent().has_node(str(pairName)):\n\t\tscaleTweenNode(0.9, 0.2, Tween.TRANS_EXPO).start()\n\t\treturn null\n\n\t# get my pair node\n\tvar pairNode = get_parent().get_node(pairName)\n\n\t# enlarge if the other guy's unselected\n\tif not pairNode.selected:\n\t\tscaleTweenNode(1.1, 0.2, Tween.TRANS_EXPO).start()\n\treturn pairNode\n\n\n# returns a tween node that uniformly changes the object's scale\n# call start() on the returned object\nfunc scaleTweenNode(scale, time=1, transType=Tween.TRANS_BOUNCE):\n\tvar tweenNode = newTweenNode()\n\ttweenNode.interpolate_method( self, \"set_scale\", \\\n\t\tself.get_scale(), Vector3(scale, scale, scale), \\\n\t\ttime, transType, Tween.EASE_OUT )\n\n\treturn tweenNode\n\n# adds a tween transition node to the tree\nfunc newTweenNode():\n\tvar tween = Tween.new()\n\tadd_child(tween)\n\treturn tween\n\nfunc remove_with_pop(node, key):\n\tget_parent().samplePlayer.play(\"deraj_pop_sound\")\n\tget_parent().remove_block(self)\n\nfunc _ready():\n\tset_ray_pickable(true)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"52d515b611ed1f593e23b0adabedbd9fd59dc7db","subject":"Use get_current_scene() instead of hack","message":"Use get_current_scene() instead of hack\n","repos":"pkowal1982\/godot,ageazrael\/godot,ianholing\/godot,iap-mutant\/godot,OpenSocialGames\/godot,zicklag\/godot,ex\/godot,morrow1nd\/godot,mcanders\/godot,DmitriySalnikov\/godot,shackra\/godot,Zylann\/godot,est31\/godot,DmitriySalnikov\/godot,Shockblast\/godot,quabug\/godot,mrezai\/godot,Max-Might\/godot,firefly2442\/godot,Faless\/godot,Valentactive\/godot,iap-mutant\/godot,Valentactive\/godot,huziyizero\/godot,NateWardawg\/godot,agusbena\/godot,quabug\/godot,Zylann\/godot,est31\/godot,ianholing\/godot,godotengine\/godot,agusbena\/godot,ficoos\/godot,mcanders\/godot,DmitriySalnikov\/godot,n-pigeon\/godot,opmana\/godot,opmana\/godot,JoshuaGrams\/godot,MrMaidx\/godot,JoshuaGrams\/godot,NateWardawg\/godot,morrow1nd\/godot,crr0004\/godot,josempans\/godot,firefly2442\/godot,jejung\/godot,Hodes\/godot,n-pigeon\/godot,honix\/godot,teamblubee\/godot,MrMaidx\/godot,iap-mutant\/godot,akien-mga\/godot,sanikoyes\/godot,teamblubee\/godot,Max-Might\/godot,firefly2442\/godot,azurvii\/godot,Shockblast\/godot,crr0004\/godot,shackra\/godot,pkowal1982\/godot,MrMaidx\/godot,crr0004\/godot,BastiaanOlij\/godot,honix\/godot,ex\/godot,ageazrael\/godot,teamblubee\/godot,Marqin\/godot,josempans\/godot,josempans\/godot,exabon\/godot,akien-mga\/godot,vkbsb\/godot,godotengine\/godot,tomreyn\/godot,honix\/godot,teamblubee\/godot,firefly2442\/godot,zicklag\/godot,MarianoGnu\/godot,MarianoGnu\/godot,honix\/godot,Paulloz\/godot,guilhermefelipecgs\/godot,guilhermefelipecgs\/godot,RandomShaper\/godot,Shockblast\/godot,mrezai\/godot,vkbsb\/godot,ianholing\/godot,akien-mga\/godot,OpenSocialGames\/godot,ZuBsPaCe\/godot,buckle2000\/godot,okamstudio\/godot,NateWardawg\/godot,pixelpicosean\/my-godot-2.1,groud\/godot,tomreyn\/godot,Hodes\/godot,ex\/godot,godotengine\/godot,mcanders\/godot,groud\/godot,Valentactive\/godot,MarianoGnu\/godot,groud\/godot,josempans\/godot,NateWardawg\/godot,exabon\/godot,RebelliousX\/Go_Dot,OpenSocialGames\/godot,Max-Might\/godot,RandomShaper\/godot,azurvii\/godot,zicklag\/godot,ageazrael\/godot,tomreyn\/godot,jejung\/godot,NateWardawg\/godot,FateAce\/godot,NateWardawg\/godot,ex\/godot,RandomShaper\/godot,RandomShaper\/godot,ZuBsPaCe\/godot,morrow1nd\/godot,sanikoyes\/godot,shackra\/godot,Zylann\/godot,ianholing\/godot,mrezai\/godot,ianholing\/godot,quabug\/godot,teamblubee\/godot,vkbsb\/godot,okamstudio\/godot,mcanders\/godot,zicklag\/godot,vkbsb\/godot,vnen\/godot,Marqin\/godot,guilhermefelipecgs\/godot,crr0004\/godot,MarianoGnu\/godot,morrow1nd\/godot,pixelpicosean\/my-godot-2.1,mcanders\/godot,crr0004\/godot,huziyizero\/godot,pkowal1982\/godot,Faless\/godot,jejung\/godot,gau-veldt\/godot,Shockblast\/godot,ficoos\/godot,honix\/godot,okamstudio\/godot,Shockblast\/godot,josempans\/godot,ianholing\/godot,BastiaanOlij\/godot,pixelpicosean\/my-godot-2.1,azurvii\/godot,mrezai\/godot,OpenSocialGames\/godot,godotengine\/godot,BastiaanOlij\/godot,buckle2000\/godot,Paulloz\/godot,OpenSocialGames\/godot,sanikoyes\/godot,Valentactive\/godot,OpenSocialGames\/godot,NateWardawg\/godot,pkowal1982\/godot,vkbsb\/godot,Max-Might\/godot,Faless\/godot,shackra\/godot,FateAce\/godot,buckle2000\/godot,Paulloz\/godot,RebelliousX\/Go_Dot,Hodes\/godot,iap-mutant\/godot,RandomShaper\/godot,TheHX\/godot,MrMaidx\/godot,OpenSocialGames\/godot,ex\/godot,okamstudio\/godot,morrow1nd\/godot,gau-veldt\/godot,Paulloz\/godot,MarianoGnu\/godot,BastiaanOlij\/godot,Brickcaster\/godot,ex\/godot,ZuBsPaCe\/godot,vnen\/godot,DmitriySalnikov\/godot,Zylann\/godot,sanikoyes\/godot,TheHX\/godot,quabug\/godot,ianholing\/godot,okamstudio\/godot,quabug\/godot,shackra\/godot,ageazrael\/godot,Hodes\/godot,crr0004\/godot,mrezai\/godot,NateWardawg\/godot,groud\/godot,Brickcaster\/godot,teamblubee\/godot,rollenrolm\/godot,JoshuaGrams\/godot,firefly2442\/godot,buckle2000\/godot,pkowal1982\/godot,Max-Might\/godot,RandomShaper\/godot,shackra\/godot,guilhermefelipecgs\/godot,JoshuaGrams\/godot,ficoos\/godot,RebelliousX\/Go_Dot,JoshuaGrams\/godot,iap-mutant\/godot,vkbsb\/godot,Faless\/godot,ageazrael\/godot,huziyizero\/godot,est31\/godot,godotengine\/godot,ageazrael\/godot,Valentactive\/godot,OpenSocialGames\/godot,Marqin\/godot,josempans\/godot,FateAce\/godot,ianholing\/godot,n-pigeon\/godot,ZuBsPaCe\/godot,agusbena\/godot,exabon\/godot,josempans\/godot,n-pigeon\/godot,jejung\/godot,FateAce\/godot,Paulloz\/godot,shackra\/godot,Zylann\/godot,shackra\/godot,vnen\/godot,buckle2000\/godot,agusbena\/godot,ficoos\/godot,vnen\/godot,Marqin\/godot,quabug\/godot,FateAce\/godot,MrMaidx\/godot,sanikoyes\/godot,Faless\/godot,pkowal1982\/godot,vnen\/godot,iap-mutant\/godot,mrezai\/godot,RebelliousX\/Go_Dot,rollenrolm\/godot,Max-Might\/godot,JoshuaGrams\/godot,tomreyn\/godot,mrezai\/godot,Zylann\/godot,ageazrael\/godot,gau-veldt\/godot,okamstudio\/godot,Brickcaster\/godot,opmana\/godot,MarianoGnu\/godot,Brickcaster\/godot,okamstudio\/godot,akien-mga\/godot,akien-mga\/godot,iap-mutant\/godot,MarianoGnu\/godot,groud\/godot,rollenrolm\/godot,quabug\/godot,firefly2442\/godot,firefly2442\/godot,Paulloz\/godot,opmana\/godot,Shockblast\/godot,agusbena\/godot,ex\/godot,RebelliousX\/Go_Dot,morrow1nd\/godot,vnen\/godot,huziyizero\/godot,MrMaidx\/godot,okamstudio\/godot,gau-veldt\/godot,ZuBsPaCe\/godot,BastiaanOlij\/godot,agusbena\/godot,Faless\/godot,okamstudio\/godot,RebelliousX\/Go_Dot,vnen\/godot,ZuBsPaCe\/godot,ianholing\/godot,zicklag\/godot,NateWardawg\/godot,Brickcaster\/godot,DmitriySalnikov\/godot,DmitriySalnikov\/godot,akien-mga\/godot,zicklag\/godot,est31\/godot,guilhermefelipecgs\/godot,guilhermefelipecgs\/godot,teamblubee\/godot,okamstudio\/godot,ZuBsPaCe\/godot,firefly2442\/godot,RandomShaper\/godot,azurvii\/godot,n-pigeon\/godot,BastiaanOlij\/godot,Faless\/godot,TheHX\/godot,shackra\/godot,crr0004\/godot,exabon\/godot,OpenSocialGames\/godot,BastiaanOlij\/godot,crr0004\/godot,guilhermefelipecgs\/godot,Marqin\/godot,OpenSocialGames\/godot,Faless\/godot,mcanders\/godot,sanikoyes\/godot,Paulloz\/godot,gau-veldt\/godot,ficoos\/godot,crr0004\/godot,pixelpicosean\/my-godot-2.1,sanikoyes\/godot,sanikoyes\/godot,pkowal1982\/godot,exabon\/godot,josempans\/godot,godotengine\/godot,iap-mutant\/godot,pkowal1982\/godot,exabon\/godot,opmana\/godot,groud\/godot,ficoos\/godot,Brickcaster\/godot,teamblubee\/godot,vnen\/godot,guilhermefelipecgs\/godot,TheHX\/godot,BastiaanOlij\/godot,Zylann\/godot,teamblubee\/godot,Hodes\/godot,Valentactive\/godot,pixelpicosean\/my-godot-2.1,TheHX\/godot,azurvii\/godot,Valentactive\/godot,quabug\/godot,Brickcaster\/godot,godotengine\/godot,vkbsb\/godot,agusbena\/godot,Hodes\/godot,Marqin\/godot,n-pigeon\/godot,honix\/godot,Shockblast\/godot,godotengine\/godot,n-pigeon\/godot,iap-mutant\/godot,est31\/godot,akien-mga\/godot,akien-mga\/godot,huziyizero\/godot,ianholing\/godot,rollenrolm\/godot,crr0004\/godot,FateAce\/godot,agusbena\/godot,azurvii\/godot,buckle2000\/godot,DmitriySalnikov\/godot,jejung\/godot,mrezai\/godot,jejung\/godot,shackra\/godot,vkbsb\/godot,Shockblast\/godot,MarianoGnu\/godot,tomreyn\/godot,est31\/godot,quabug\/godot,ZuBsPaCe\/godot,iap-mutant\/godot,quabug\/godot,rollenrolm\/godot,Valentactive\/godot,ex\/godot,Zylann\/godot,teamblubee\/godot","old_file":"demos\/misc\/autoload\/global.gd","new_file":"demos\/misc\/autoload\/global.gd","new_contents":"extends Node\n\n# Member variables\nvar current_scene = null\n\n\nfunc goto_scene(path):\n\t# This function will usually be called from a signal callback,\n\t# or some other function from the running scene.\n\t# Deleting the current scene at this point might be\n\t# a bad idea, because it may be inside of a callback or function of it.\n\t# The worst case will be a crash or unexpected behavior.\n\t\n\t# The way around this is deferring the load to a later time, when\n\t# it is ensured that no code from the current scene is running:\n\t\n\tcall_deferred(\"_deferred_goto_scene\",path)\n\n\nfunc _deferred_goto_scene(path):\n\t# Immediately free the current scene,\n\t# there is no risk here.\n\tcurrent_scene.free()\n\t\n\t# Load new scene\n\tvar s = ResourceLoader.load(path)\n\t\n\t# Instance the new scene\n\tcurrent_scene = s.instance()\n\t\n\t# Add it to the active scene, as child of root\n\tget_tree().get_root().add_child(current_scene)\n\n\nfunc _ready():\n\t# Get the current scene at the time of initialization\n\tcurrent_scene = get_tree().get_current_scene()\n","old_contents":"extends Node\n\n# Member variables\nvar current_scene = null\n\n\nfunc goto_scene(path):\n\t# This function will usually be called from a signal callback,\n\t# or some other function from the running scene.\n\t# Deleting the current scene at this point might be\n\t# a bad idea, because it may be inside of a callback or function of it.\n\t# The worst case will be a crash or unexpected behavior.\n\t\n\t# The way around this is deferring the load to a later time, when\n\t# it is ensured that no code from the current scene is running:\n\t\n\tcall_deferred(\"_deferred_goto_scene\",path)\n\n\nfunc _deferred_goto_scene(path):\n\t# Immediately free the current scene,\n\t# there is no risk here.\n\tcurrent_scene.free()\n\t\n\t# Load new scene\n\tvar s = ResourceLoader.load(path)\n\t\n\t# Instance the new scene\n\tcurrent_scene = s.instance()\n\t\n\t# Add it to the active scene, as child of root\n\tget_tree().get_root().add_child(current_scene)\n\n\nfunc _ready():\n\t# Get the current scene, the first time.\n\t# It is always the last child of root,\n\t# after the autoloaded nodes.\n\t\n\tvar root = get_tree().get_root()\n\tcurrent_scene = root.get_child(root.get_child_count() - 1)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"df23467e0f647ef58c531a45ae99452e1e16d865","subject":"Player movement inertia","message":"Player movement inertia\n","repos":"BK-TN\/IncendiumGame","old_file":"incendium\/scripts\/Player.gd","new_file":"incendium\/scripts\/Player.gd","new_contents":"# PLAYER class\n# Moves n shoots\n\nextends Node2D\n\nconst SPEED = 420 \/ 1.42\nconst ACCEL = 3000\n\nexport var polar_controls = false\nvar angle = 0\nvar dist = 200\nvar shield_cooldown = 0\nvar fire_timer = 0\nvar velocity = Vector2(0,0)\n\nconst MAX_HEALTH = 100\nvar health = MAX_HEALTH\n\nvar inv_time = 0\n\nvar col = Color(1,1,1)\n\nfunc _ready():\n\tset_process(true)\n\nfunc _process(delta):\n\tvar target_velocity = Vector2(0,0)\n\tif Input.is_key_pressed(KEY_LEFT):\n\t\tif polar_controls:\n\t\t\tangle += (delta \/ dist) * SPEED\n\t\telse:\n\t\t\ttarget_velocity += Vector2(-1,0)\n\tif Input.is_key_pressed(KEY_RIGHT):\n\t\tif polar_controls:\n\t\t\tangle -= (delta \/ dist) * SPEED\n\t\telse:\n\t\t\ttarget_velocity += Vector2(1,0)\n\tif Input.is_key_pressed(KEY_UP):\n\t\tif polar_controls:\n\t\t\tdist -= delta * SPEED\n\t\t\tif dist < 0.1: dist = 0.1\n\t\telse:\n\t\t\ttarget_velocity += Vector2(0,-1)\n\tif Input.is_key_pressed(KEY_DOWN):\n\t\tif polar_controls:\n\t\t\tdist += delta * SPEED \n\t\telse:\n\t\t\ttarget_velocity += Vector2(0,1)\n\t\t\n\ttarget_velocity = target_velocity.normalized() * SPEED\n\t\n\tvar towards_target = target_velocity - velocity\n\tvar dist_to_target = towards_target.length()\n\ttowards_target = towards_target.normalized()\n\ttowards_target *= min(ACCEL * delta, dist_to_target)\n\t\n\tvelocity += towards_target\n\ttranslate(velocity * delta)\n\t\n\tvar center = Vector2(720\/2,720\/2)\n\t\n\tif polar_controls:\n\t\tset_pos(center + Vector2(cos(angle),sin(angle)) * dist)\n\n\tvar towards_center = (center - get_pos()).normalized()\n\t\n\tcol = col.linear_interpolate(Color(1,1,1),delta * 10)\n\tget_node(\"RegularPolygon\/Polygon2D\").set_color(col)\n\t\n\tif inv_time > 0:\n\t\tinv_time -= delta\n\t\n\tif fire_timer > 0:\n\t\tfire_timer -= delta\n\t\n\tif (Input.is_key_pressed(KEY_SPACE) or Input.is_key_pressed(KEY_F)) and fire_timer <= 0:\n\t\tvar bullet = preload(\"res:\/\/objects\/Bullet.tscn\").instance()\n\t\tbullet.set_pos(get_pos())\n\t\tget_tree().get_root().get_node(\"Game\/SFX\").set_default_pitch_scale(rand_range(0.9,1.1))\n\t\tget_tree().get_root().get_node(\"Game\/SFX\").play(\"Laser_Shoot14\")\n\t\t#bullet.get_node(\"RegularPolygon\").size = 1\n\t\tbullet.damage = 1\n\t\t\n\t\tvar dir = atan2(towards_center.y,towards_center.x)\n\t\tvar len = 600\n\t\t\n\t\tvar spread = 0.05\n\t\tvar rot = rand_range(-spread,spread)\n\t\tvar final = dir + rot\n\t\t\n\t\tbullet.velocity = Vector2(cos(final),sin(final)) * len\n\t\tget_tree().get_root().add_child(bullet,false)\n\t\tfire_timer = 0.05\n\t\t\n\tif shield_cooldown > 0:\n\t\tshield_cooldown -= delta\n\t\n\tif Input.is_key_pressed(KEY_D) and shield_cooldown <= 0:\n\t\tvar shield = preload(\"res:\/\/objects\/PlayerShield.tscn\").instance()\n\t\tshield.node_to_follow = get_path()\n\t\tget_tree().get_root().add_child(shield)\n\t\tshield.set_global_pos(get_global_pos())\n\t\tshield_cooldown = 6\n\n\tset_rot(atan2(towards_center.x,towards_center.y) - PI\/2)\n\t\n\t# Limit position to circle\n\tif center.distance_to(get_pos()) > 720\/2:\n\t\tset_pos((get_pos() - center).normalized() * 720\/2 + center)\n\nfunc _on_RegularPolygon_area_enter( area ):\n\tif area.get_groups().has(\"damage_player\"):\n\t\tvar bullet = area.get_parent()\n\t\tbullet.queue_free()\n\t\tvar dmgtotake = bullet.damage * 2\n\t\tlose_health(dmgtotake)\n\tif area.get_groups().has(\"damage_player_solid\") && area.get_parent().enabled:\n\t\tlose_health(100)\n\nfunc lose_health(hp):\n\tif inv_time <= 0:\n\t\thealth -= hp\n\t\tinv_time = 1\n\t\tcol = Color(1,0,0)\n\t\tget_parent().score_mult = 1\n\t\tget_parent().score_mult_timer = 0\n\t\tif health <= 0:\n\t\t\tfor i in range(0,8):\n\t\t\t\tvar explosion_instance = preload(\"res:\/\/objects\/Explosion.tscn\").instance()\n\t\t\t\texplosion_instance.get_node(\"RegularPolygon\").size = get_node(\"RegularPolygon\").size\n\t\t\t\texplosion_instance.get_node(\"RegularPolygon\/Polygon2D\").set_color(get_node(\"RegularPolygon\/Polygon2D\").get_color())\n\t\t\t\t# explosion_instance.velocity = Vector2(0,0)\n\t\t\t\tget_tree().get_root().add_child(explosion_instance)\n\t\t\t\texplosion_instance.set_global_pos(get_global_pos())\n\t\t\tOS.set_time_scale(0.02)\n\t\t\tqueue_free()\n\nfunc _on_RegularPolygon_area_exit( area ):\n\tpass\n","old_contents":"# PLAYER class\n# Moves n shoots\n\nextends Node2D\n\nconst SPEED = 420 \/ 1.42\n\nexport var polar_controls = false\nvar angle = 0\nvar dist = 200\nvar shield_cooldown = 0\nvar fire_timer = 0\n\nconst MAX_HEALTH = 100\nvar health = MAX_HEALTH\n\nvar inv_time = 0\n\nvar col = Color(1,1,1)\n\nfunc _ready():\n\tset_process(true)\n\nfunc _process(delta):\n\tif Input.is_key_pressed(KEY_LEFT):\n\t\tif polar_controls:\n\t\t\tangle += (delta \/ dist) * SPEED\n\t\telse:\n\t\t\ttranslate(Vector2(-delta,0) * SPEED)\n\tif Input.is_key_pressed(KEY_RIGHT):\n\t\tif polar_controls:\n\t\t\tangle -= (delta \/ dist) * SPEED\n\t\telse:\n\t\t\ttranslate(Vector2(delta,0) * SPEED)\n\tif Input.is_key_pressed(KEY_UP):\n\t\tif polar_controls:\n\t\t\tdist -= delta * SPEED\n\t\t\tif dist < 0.1: dist = 0.1\n\t\telse:\n\t\t\ttranslate(Vector2(0,-delta) * SPEED)\n\tif Input.is_key_pressed(KEY_DOWN):\n\t\tif polar_controls:\n\t\t\tdist += delta * SPEED \n\t\telse:\n\t\t\ttranslate(Vector2(0,delta) * SPEED)\n\t\n\tvar center = Vector2(720\/2,720\/2)\n\t\n\tif polar_controls:\n\t\tset_pos(center + Vector2(cos(angle),sin(angle)) * dist)\n\n\tvar towards_center = (center - get_pos()).normalized()\n\t\n\tcol = col.linear_interpolate(Color(1,1,1),delta * 10)\n\tget_node(\"RegularPolygon\/Polygon2D\").set_color(col)\n\t\n\tif inv_time > 0:\n\t\tinv_time -= delta\n\t\n\tif fire_timer > 0:\n\t\tfire_timer -= delta\n\t\n\tif (Input.is_key_pressed(KEY_SPACE) or Input.is_key_pressed(KEY_F)) and fire_timer <= 0:\n\t\tvar bullet = preload(\"res:\/\/objects\/Bullet.tscn\").instance()\n\t\tbullet.set_pos(get_pos())\n\t\tget_tree().get_root().get_node(\"Game\/SFX\").set_default_pitch_scale(rand_range(0.9,1.1))\n\t\tget_tree().get_root().get_node(\"Game\/SFX\").play(\"Laser_Shoot14\")\n\t\t#bullet.get_node(\"RegularPolygon\").size = 1\n\t\tbullet.damage = 1\n\t\t\n\t\tvar dir = atan2(towards_center.y,towards_center.x)\n\t\tvar len = 600\n\t\t\n\t\tvar spread = 0.05\n\t\tvar rot = rand_range(-spread,spread)\n\t\tvar final = dir + rot\n\t\t\n\t\tbullet.velocity = Vector2(cos(final),sin(final)) * len\n\t\tget_tree().get_root().add_child(bullet,false)\n\t\tfire_timer = 0.05\n\t\t\n\tif shield_cooldown > 0:\n\t\tshield_cooldown -= delta\n\t\n\tif Input.is_key_pressed(KEY_D) and shield_cooldown <= 0:\n\t\tvar shield = preload(\"res:\/\/objects\/PlayerShield.tscn\").instance()\n\t\tshield.node_to_follow = get_path()\n\t\tget_tree().get_root().add_child(shield)\n\t\tshield.set_global_pos(get_global_pos())\n\t\tshield_cooldown = 6\n\n\tset_rot(atan2(towards_center.x,towards_center.y) - PI\/2)\n\t\n\t# Limit position to circle\n\tif center.distance_to(get_pos()) > 720\/2:\n\t\tset_pos((get_pos() - center).normalized() * 720\/2 + center)\n\nfunc _on_RegularPolygon_area_enter( area ):\n\tif area.get_groups().has(\"damage_player\"):\n\t\tvar bullet = area.get_parent()\n\t\tbullet.queue_free()\n\t\tvar dmgtotake = bullet.damage * 2\n\t\tlose_health(dmgtotake)\n\tif area.get_groups().has(\"damage_player_solid\") && area.get_parent().enabled:\n\t\tlose_health(100)\n\nfunc lose_health(hp):\n\tif inv_time <= 0:\n\t\thealth -= hp\n\t\tinv_time = 1\n\t\tcol = Color(1,0,0)\n\t\tget_parent().score_mult = 1\n\t\tget_parent().score_mult_timer = 0\n\t\tif health <= 0:\n\t\t\tfor i in range(0,8):\n\t\t\t\tvar explosion_instance = preload(\"res:\/\/objects\/Explosion.tscn\").instance()\n\t\t\t\texplosion_instance.get_node(\"RegularPolygon\").size = get_node(\"RegularPolygon\").size\n\t\t\t\texplosion_instance.get_node(\"RegularPolygon\/Polygon2D\").set_color(get_node(\"RegularPolygon\/Polygon2D\").get_color())\n\t\t\t\t# explosion_instance.velocity = Vector2(0,0)\n\t\t\t\tget_tree().get_root().add_child(explosion_instance)\n\t\t\t\texplosion_instance.set_global_pos(get_global_pos())\n\t\t\tOS.set_time_scale(0.02)\n\t\t\tqueue_free()\n\nfunc _on_RegularPolygon_area_exit( area ):\n\tpass\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"626c06e1bbc5fc53ce81de081d0311c1c7c9c1eb","subject":"Doge rampage","message":"Doge rampage\n","repos":"P1X-in\/rat-is-fat","old_file":"scripts\/enemies\/doge_prime.gd","new_file":"scripts\/enemies\/doge_prime.gd","new_contents":"extends \"res:\/\/scripts\/enemies\/abstract_boss.gd\"\n\nconst IRRITATED_TIMER = 2\n\nvar irritated = false\nvar calm = true\nvar rampage_hp_threshold = 10\n\nvar body_angry\nvar body_moving\n\nvar path_points = [\n Vector2(17, 2),\n Vector2(17, 8),\n Vector2(5, 8),\n]\nvar path_points_global = []\nvar target_point = null\nvar current_point = 0\n\nfunc _init(bag).(bag):\n self.avatar = preload(\"res:\/\/scenes\/enemies\/doge_prime.xscn\").instance()\n self.body_part_head = self.avatar.get_node('body')\n self.body_part_body = self.avatar.get_node('body')\n self.body_part_footer = self.avatar.get_node('body')\n self.animations = self.avatar.get_node('body_animations')\n\n self.body_angry = self.avatar.get_node('body2')\n self.body_moving = self.avatar.get_node('body3')\n\n self.velocity = 250\n self.attack_range = 75\n self.aggro_range = 75\n self.attack_strength = 3\n self.attack_cooldown = 3\n self.max_hp = 25\n self.hp = 25\n self.rampage_hp_threshold = 10\n self.score = 200\n\n self.stun_duration = 0.4\n self.mass = 30\n\n self.calm = true\n self.irritated = false\n\n self.phase_hp_thresholds = [\n [25, 2],\n ]\n\n for point in self.path_points:\n self.path_points_global.push_back(self.bag.room_loader.translate_position(point))\n\nfunc process_ai():\n var distance\n var direction = Vector2(0, 0)\n\n self.target = null\n if not self.calm:\n for player in self.bag.players.players:\n if player.is_playing && player.is_alive:\n distance = self.calculate_distance_to_object(player)\n if distance < self.aggro_range:\n if self.target != null:\n if self.calculate_distance_to_object(self.target) > distance:\n self.target = player\n else:\n self.target = player\n break\n\n if self.calm and not self.irritated:\n for player in self.bag.players.players:\n if player.is_playing && player.is_alive:\n distance = self.calculate_distance_to_object(player)\n if distance < self.aggro_range:\n self.irritate()\n break\n\n if self.target != null:\n distance = self.calculate_distance_to_object(self.target)\n if not self.target.is_alive || distance > self.aggro_range:\n self.target = null\n elif distance < self.attack_range and not self.is_attack_on_cooldown:\n self.attack()\n\n if self.target_point != null:\n distance = self.calculate_distance(self.target_point)\n if distance < 5:\n self.target_point = null\n self.calm_down()\n else:\n direction = self.cast_movement_vector(self.target_point)\n\n self.movement_vector[0] = direction.x\n self.movement_vector[1] = direction.y\n\nfunc enrage():\n self.is_invulnerable = true\n self.calm = false\n self.pick_next_point()\n self.body_angry.hide()\n self.body_moving.show()\n self.body_part_body.hide()\n\nfunc calm_down():\n self.is_invulnerable = false\n self.calm = true\n self.irritated = false\n self.body_angry.hide()\n self.body_moving.hide()\n self.body_part_body.show()\n\n var timer = randi() % 3\n timer += 2\n\n if self.hp > self.rampage_hp_threshold:\n self.bag.timers.set_timeout(timer, self, 'irritate')\n else:\n self.irritate()\n\nfunc irritate():\n if self.irritated:\n return\n\n self.irritated = true\n self.body_part_body.hide()\n self.body_angry.show()\n self.body_moving.hide()\n self.bag.timers.set_timeout(self.IRRITATED_TIMER, self, 'enrage')\n\nfunc phase2():\n return\n\nfunc pick_next_point():\n var next_point = self.current_point\n\n while (next_point == self.current_point):\n next_point = randi() % self.path_points_global.size()\n\n self.current_point = next_point\n self.target_point = self.path_points_global[next_point]\n\n\nfunc push_back(enemy):\n if not self.irritated:\n self.irritate()\n\nfunc flip_body_parts(flip_flag):\n .flip_body_parts(flip_flag)\n self.body_angry.set_flip_h(flip_flag)\n self.body_moving.set_flip_h(flip_flag)\n","old_contents":"extends \"res:\/\/scripts\/enemies\/abstract_boss.gd\"\n\nconst IRRITATED_TIMER = 2\n\nvar irritated = false\nvar calm = true\n\nvar body_angry\nvar body_moving\n\nvar path_points = [\n Vector2(17, 2),\n Vector2(17, 8),\n Vector2(5, 8),\n]\nvar path_points_global = []\nvar target_point = null\nvar current_point = 0\n\nfunc _init(bag).(bag):\n self.avatar = preload(\"res:\/\/scenes\/enemies\/doge_prime.xscn\").instance()\n self.body_part_head = self.avatar.get_node('body')\n self.body_part_body = self.avatar.get_node('body')\n self.body_part_footer = self.avatar.get_node('body')\n self.animations = self.avatar.get_node('body_animations')\n\n self.body_angry = self.avatar.get_node('body2')\n self.body_moving = self.avatar.get_node('body3')\n\n self.velocity = 250\n self.attack_range = 75\n self.aggro_range = 75\n self.attack_strength = 3\n self.attack_cooldown = 3\n self.max_hp = 25\n self.hp = 25\n self.score = 200\n\n self.stun_duration = 0.4\n self.mass = 30\n\n self.calm = true\n self.irritated = false\n\n self.phase_hp_thresholds = [\n [25, 2],\n ]\n\n for point in self.path_points:\n self.path_points_global.push_back(self.bag.room_loader.translate_position(point))\n\nfunc process_ai():\n var distance\n var direction = Vector2(0, 0)\n\n self.target = null\n if not self.calm:\n for player in self.bag.players.players:\n if player.is_playing && player.is_alive:\n distance = self.calculate_distance_to_object(player)\n if distance < self.aggro_range:\n if self.target != null:\n if self.calculate_distance_to_object(self.target) > distance:\n self.target = player\n else:\n self.target = player\n break\n\n if self.calm and not self.irritated:\n for player in self.bag.players.players:\n if player.is_playing && player.is_alive:\n distance = self.calculate_distance_to_object(player)\n if distance < self.aggro_range:\n self.irritate()\n break\n\n if self.target != null:\n distance = self.calculate_distance_to_object(self.target)\n if not self.target.is_alive || distance > self.aggro_range:\n self.target = null\n elif distance < self.attack_range and not self.is_attack_on_cooldown:\n self.attack()\n\n if self.target_point != null:\n distance = self.calculate_distance(self.target_point)\n if distance < 5:\n self.target_point = null\n self.calm_down()\n else:\n direction = self.cast_movement_vector(self.target_point)\n\n self.movement_vector[0] = direction.x\n self.movement_vector[1] = direction.y\n\nfunc enrage():\n self.is_invulnerable = true\n self.calm = false\n self.pick_next_point()\n self.body_angry.hide()\n self.body_moving.show()\n self.body_part_body.hide()\n\nfunc calm_down():\n self.is_invulnerable = false\n self.calm = true\n self.irritated = false\n self.body_angry.hide()\n self.body_moving.hide()\n self.body_part_body.show()\n\n var timer = randi() % 3\n timer += 2\n\n self.bag.timers.set_timeout(timer, self, 'irritate')\n\nfunc irritate():\n if self.irritated:\n return\n\n self.irritated = true\n self.body_part_body.hide()\n self.body_angry.show()\n self.body_moving.hide()\n self.bag.timers.set_timeout(self.IRRITATED_TIMER, self, 'enrage')\n\nfunc phase2():\n return\n\nfunc pick_next_point():\n var next_point = self.current_point\n\n while (next_point == self.current_point):\n next_point = randi() % self.path_points_global.size()\n\n self.current_point = next_point\n self.target_point = self.path_points_global[next_point]\n\n\nfunc push_back(enemy):\n if not self.irritated:\n self.irritate()\n\nfunc flip_body_parts(flip_flag):\n .flip_body_parts(flip_flag)\n self.body_angry.set_flip_h(flip_flag)\n self.body_moving.set_flip_h(flip_flag)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"a16e3b83a35768754da0ce5ceb1c18648e5fa905","subject":"remove cheese file","message":"remove cheese file\n","repos":"P1X-in\/rat-is-fat","old_file":"scenes\/items\/cheese.gd","new_file":"scenes\/items\/cheese.gd","new_contents":"","old_contents":"\nextends RigidBody2D\n# selects random chees omnomnom\n\nvar body\n\nfunc _ready():\n self.set_mode(MODE_RIGID)\n self.body = self.get_node('body')\n self.body.set_frame(randi() % self.body.get_vframes())\n pass\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"0dd9cfcc6619d50dc78fd47a56695c7a31193517","subject":"added blockLayer variable","message":"added blockLayer variable\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Blocks\/AbstractBlock.gd","new_file":"src\/scripts\/Blocks\/AbstractBlock.gd","new_contents":"extends RigidBody\n\nvar name\nvar pairName\nvar selected = false\nvar blockPos\nvar blockLayer\nconst far_away_corner = Vector3(80, 80, 80)\n\nfunc nameToNodeName(n):\n\treturn \"block\" + str(n)\n\nfunc setName(n):\n\tname = nameToNodeName(n)\n\tset_name(nameToNodeName(n))\n\treturn self\n\nfunc setPairName(n):\n\tpairName = nameToNodeName(n)\n\treturn self\n\nfunc setBlockLayer(n):\n\tblockLayer = n\n\treturn self\n\nfunc getBlockLayer():\n\treturn blockLayer\n\nfunc setSelected(sel):\n\tselected = sel\n\treturn self\n\n# catch clicks\/taps\nfunc _input_event( camera, ev, click_pos, click_normal, shape_idx ):\n\tif ((ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT)\n\tor (ev.type==InputEvent.SCREEN_TOUCH)):\n\t\tif (get_parent().get_parent().active and ev.is_pressed()):\n\t\t\tactivate(ev, click_pos, click_normal)\n\n\t\t\t#now check if that was the second block we picked. If it was, we want to\n\t\t\t#unselect the blocks again\n\t\t\tvar gridView = get_parent().get_parent()\n\t\t\tif (gridView.offClick):\n\t\t\t\tprint(\"omg\")\n\t\t\t\tgridView.offClick = false\n\t\t\t\tgridView.addSelected(name)\n\t\t\t\tgridView.clearSelection()\n\t\t\telse:\n\t\t\t\tprint(\"lulz\")\n\t\t\t\tgridView.offClick = true;\n\t\t\t\tgridView.addSelected(name)\n\n# returns this block's pairNode or null\nfunc pairActivate(ev, click_pos, click_normal):\n\tselected = true\n\n\t# is my pair Nil?\n\tif pairName == null or get_parent() == null or not get_parent().has_node(str(pairName)):\n\t\tscaleTweenNode(0.9, 0.2, Tween.TRANS_EXPO).start()\n\t\treturn null\n\n\t# get my pair node\n\tvar pairNode = get_parent().get_node(pairName)\n\n\t# enlarge if the other guy's unselected\n\tif not pairNode.selected:\n\t\tscaleTweenNode(1.1, 0.2, Tween.TRANS_EXPO).start()\n\treturn pairNode\n\n\n# returns a tween node that uniformly changes the object's scale\n# call start() on the returned object\nfunc scaleTweenNode(scale, time=1, transType=Tween.TRANS_BOUNCE):\n\tvar tweenNode = newTweenNode()\n\ttweenNode.interpolate_method( self, \"set_scale\", \\\n\t\tself.get_scale(), Vector3(scale, scale, scale), \\\n\t\ttime, transType, Tween.EASE_OUT )\n\n\treturn tweenNode\n\n# adds a tween transition node to the tree\nfunc newTweenNode():\n\tvar tween = Tween.new()\n\tadd_child(tween)\n\treturn tween\n\nfunc remove_with_pop(node, key):\n\tget_parent().samplePlayer.play(\"deraj_pop_sound\")\n\tget_parent().remove_block(self)\n\nfunc _ready():\n\tset_ray_pickable(true)\n\t#var img;\n\t#img.load(\"res:\/\/textures\/Block_\" + textureName + \".png\")\n","old_contents":"extends RigidBody\n\nvar name\nvar pairName\nvar selected = false\nvar blockPos\nconst far_away_corner = Vector3(80, 80, 80)\n\nfunc nameToNodeName(n):\n\treturn \"block\" + str(n)\n\nfunc setName(n):\n\tname = nameToNodeName(n)\n\tset_name(nameToNodeName(n))\n\treturn self\n\nfunc setPairName(n):\n\tpairName = nameToNodeName(n)\n\treturn self\n\nfunc setBlockLayer(n):\n\tblockLayer = n\n\treturn self\n\nfunc getBlockLayer():\n\treturn blockLayer\n\nfunc setSelected(sel):\n\tselected = sel\n\treturn self\n\n# catch clicks\/taps\nfunc _input_event( camera, ev, click_pos, click_normal, shape_idx ):\n\tif ((ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT)\n\tor (ev.type==InputEvent.SCREEN_TOUCH)):\n\t\tif (get_parent().get_parent().active and ev.is_pressed()):\n\t\t\tactivate(ev, click_pos, click_normal)\n\t\t\t\n\t\t\t#now check if that was the second block we picked. If it was, we want to\n\t\t\t#unselect the blocks again\n\t\t\tvar gridView = get_parent().get_parent()\n\t\t\tif (gridView.offClick):\n\t\t\t\tprint(\"omg\")\n\t\t\t\tgridView.offClick = false\n\t\t\t\tgridView.addSelected(name)\n\t\t\t\tgridView.clearSelection()\n\t\t\telse:\n\t\t\t\tprint(\"lulz\")\n\t\t\t\tgridView.offClick = true;\n\t\t\t\tgridView.addSelected(name)\n\n# returns this block's pairNode or null\nfunc pairActivate(ev, click_pos, click_normal):\n\tselected = true\n\n\t# is my pair Nil?\n\tif pairName == null or get_parent() == null or not get_parent().has_node(str(pairName)):\n\t\tscaleTweenNode(0.9, 0.2, Tween.TRANS_EXPO).start()\n\t\treturn null\n\n\t# get my pair node\n\tvar pairNode = get_parent().get_node(pairName)\n\n\t# enlarge if the other guy's unselected\n\tif not pairNode.selected:\n\t\tscaleTweenNode(1.1, 0.2, Tween.TRANS_EXPO).start()\n\treturn pairNode\n\n\n# returns a tween node that uniformly changes the object's scale\n# call start() on the returned object\nfunc scaleTweenNode(scale, time=1, transType=Tween.TRANS_BOUNCE):\n\tvar tweenNode = newTweenNode()\n\ttweenNode.interpolate_method( self, \"set_scale\", \\\n\t\tself.get_scale(), Vector3(scale, scale, scale), \\\n\t\ttime, transType, Tween.EASE_OUT )\n\n\treturn tweenNode\n\n# adds a tween transition node to the tree\nfunc newTweenNode():\n\tvar tween = Tween.new()\n\tadd_child(tween)\n\treturn tween\n\nfunc remove_with_pop(node, key):\n\tget_parent().samplePlayer.play(\"deraj_pop_sound\")\n\tget_parent().remove_block(self)\n\nfunc _ready():\n\tset_ray_pickable(true)\n\t#var img;\n\t#img.load(\"res:\/\/textures\/Block_\" + textureName + \".png\")\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"9a5a9247da68bbd3301a0b91c1e282df9e028484","subject":"proper game over screen","message":"proper game over screen\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/GridMan.gd","new_file":"src\/scripts\/GridMan.gd","new_contents":"extends Spatial\n\n# Is there a better way to do this?\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\n# Shape dictionary to access blocks quickly by position.\nvar shape = {}\n\n# Block selection handling.\nvar offClick = false\nvar selectedBlocks = []\n\n# Puzzle vars.\nvar puzzle\n\n# Beam stuff.\nconst beamScn = preload( \"res:\/\/blocks\/block.scn\" )\nconst Beam = preload(\"res:\/\/scripts\/Blocks\/Beam.gd\")\n\n# sounds\nvar samplePlayer = SamplePlayer.new()\n\nfunc addPickledBlock(block):\n\t# TODO add to puzzle\n\tvar b = block.toNode()\n\n\tprint (\"ADDED\")\n\tshape[b.blockPos] = b\n\n\t# TODO any special treatment for the wild blocks?\n\t# TODO keep track of puzzle.lasers ? How to?\n\n\t# keep track of puzzle.pairCounts\n\tvar layer = calcBlockLayerVec(b.blockPos)\n\tif b.getBlockType() == 2:\n\t\twhile puzzle.pairCount.size() <= layer:\n\t\t\tpuzzle.pairCount.append(0)\n\t\tpuzzle.pairCount[layer] += 0.5\n\n\tadd_child(b)\n\nfunc get_block(pos):\n\tif shape.has(pos):\n\t\treturn shape[pos]\n\telse:\n\t\treturn null\n\n# unused key argument needed for the tween_complete signal\nfunc remove_block(block_node, key=null):\n\tif block_node == null:\n\t\treturn\n\tprint (\"REMOVED\")\n\n\tshape[block_node.blockPos] = null\n\tfor child in block_node.get_children():\n\t\tblock_node.remove_and_delete_child(child)\n\tremove_and_delete_child(block_node)\n\n# Sets the puzzle for this GridMan.\nfunc set_puzzle(puzz):\n\t# delete all current nodes\n\tfor pos in shape:\n\t\tremove_block(shape[pos])\n\n\t# Store the puzzle.\n\tpuzzle = puzz\n\n\t# Set the camera range to be relative to the layer count.\n\tvar cam = get_tree().get_root().get_node( \"Spatial\" ).get_node( \"Camera\" )\n\tprint( cam )\n\tvar totalSize = ( puzzle.puzzleLayers * 2 + 1 )\n\tcam.distance.val = 4.5 * totalSize\n\tcam.distance.min_ = 3 * totalSize\n\tcam.distance.max_ = 10 * totalSize\n\tcam.recalculate_camera()\n\n\t\t# # I can do my own counting!\n\t# needed for adding blocks in the editor\n\tpuzzle.pairCount = []\n\tfor block in puzzle.blocks:\n\t\t# Create a block node, add it to the tree\n\t\taddPickledBlock(block)\n\n# Clears any selected blocks. WE SHOULD FIX THIS, THERE CAN ONLY BE ONE BLOCK SELECTED AT ANY ONE TIME, NO NEED FOR AN ARRAY!\nfunc clearSelection():\n\tfor bl in selectedBlocks:\n\t\tvar blo = get_node( bl )\n\t\tblo.setSelected(false)\n\t\tblo.scaleTweenNode(1.0).start()\n\tselectedBlocks = []\n\n# Add the selected block to the selected list. WE SHOULD FIX THIS, IT ONLY NEEDS TO STORE IT, NOT AN ARRAY!\nfunc addSelected(bl):\n\tselectedBlocks.append(bl)\n\n# Used for the multiplayer mode to force click a block on their side.\nfunc forceClickBlock( pos ):\n\tshape[pos].forceClick()\n\nfunc clickBlock( name ):\n\t#now check if that was the second block we picked. If it was, we want to\n\t#unselect the blocks again\n\tif (offClick):\n\t\toffClick = false\n\t\taddSelected(name)\n\t\tclearSelection()\n\telse:\n\t\toffClick = true;\n\t\taddSelected(name)\n\n# Calculates the layer that a block is on.\n# COPY OF FUNCTION IN PUZZLEMAN, IS THERE A BETTER WAY TO DO THIS?!\nfunc calcBlockLayer( x, y, z ):\n\treturn max( max( abs( x ), abs( y ) ), abs( z ) )\nfunc calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n# Handles keeping track of pairs being removed.\nfunc popPair( pos ):\n\tvar blayer = calcBlockLayerVec( pos )\n\tpuzzle.pairCount[blayer] -= 1\n\n\tif( puzzle.pairCount[blayer] == 0 ):\n\t\tprint(\"LAYER CLEARED\")\n\t\tif blayer == 1:\n\t\t\tprint( \"GAME OVER!\" )\n\t\t\tvar pauseMenu = get_tree().get_root().get_node( \"Spatial\" ).get_node( \"Camera\" ).pauseMenu\n\t\t\tpauseMenu.set_text(\"GAME OVER\\nSCORE:1,000,000\")\n\t\t\t# TODO set timeout!!!\n\t\t\tpauseMenu.popup_centered()\n\n\t\tfor b in shape:\n\t\t\tif not ( shape[b] == null ):\n\t\t\t\tif calcBlockLayerVec( b ) == blayer:\n\t\t\t\t\tif shape[b].getBlockType() == BLOCK_LASER:\n\t\t\t\t\t\tshape[b].forceActivate()\n\n\t\t# Fire beams.\n\t\tvar beamNum = 0\n\t\tfor l in range( puzzle.lasers.size() ):\n\t\t\tif calcBlockLayerVec( puzzle.lasers[l][0] ) == blayer:\n\t\t\t\t# Firin mah lazerz!\n\t\t\t\tvar beam = beamScn.instance()\n\n\t\t\t\tbeam.set_name( str(blayer) + \"_beam_\" + str(beamNum) )\n\t\t\t\tbeamNum += 1\n\t\t\t\tbeam.set_script( Beam )\n\n\t\t\t\tadd_child( beam )\n\t\t\t\tbeam.fire( puzzle.lasers[l][0], puzzle.lasers[l][1] )\n\n\t\t\t\tsamplePlayer.play( \"soundslikewillem_hitting_slinky\" )\n\n\nfunc _init():\n\t# Load sound\n\tsamplePlayer.set_voice_count(10)\n\tsamplePlayer.set_sample_library(ResourceLoader.load(\"new_samplelibrary.xml\"))\n\tprint(\"GridMan initialized\")\n\n","old_contents":"extends Spatial\n\n# Is there a better way to do this?\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\n# Shape dictionary to access blocks quickly by position.\nvar shape = {}\n\n# Block selection handling.\nvar offClick = false\nvar selectedBlocks = []\n\n# Puzzle vars.\nvar puzzle\n\n# Beam stuff.\nconst beamScn = preload( \"res:\/\/blocks\/block.scn\" )\nconst Beam = preload(\"res:\/\/scripts\/Blocks\/Beam.gd\")\n\n# sounds\nvar samplePlayer = SamplePlayer.new()\n\nfunc addPickledBlock(block):\n\t# TODO add to puzzle\n\tvar b = block.toNode()\n\n\tprint (\"ADDED\")\n\tshape[b.blockPos] = b\n\n\t# TODO any special treatment for the wild blocks?\n\t# TODO keep track of puzzle.lasers ? How to?\n\n\t# keep track of puzzle.pairCounts\n\tvar layer = calcBlockLayerVec(b.blockPos)\n\tif b.getBlockType() == 2:\n\t\twhile puzzle.pairCount.size() <= layer:\n\t\t\tpuzzle.pairCount.append(0)\n\t\tpuzzle.pairCount[layer] += 0.5\n\n\tadd_child(b)\n\nfunc get_block(pos):\n\tif shape.has(pos):\n\t\treturn shape[pos]\n\telse:\n\t\treturn null\n\n# unused key argument needed for the tween_complete signal\nfunc remove_block(block_node, key=null):\n\tif block_node == null:\n\t\treturn\n\tprint (\"REMOVED\")\n\n\tshape[block_node.blockPos] = null\n\tfor child in block_node.get_children():\n\t\tblock_node.remove_and_delete_child(child)\n\tremove_and_delete_child(block_node)\n\n# Sets the puzzle for this GridMan.\nfunc set_puzzle(puzz):\n\t# delete all current nodes\n\tfor pos in shape:\n\t\tremove_block(shape[pos])\n\n\t# Store the puzzle.\n\tpuzzle = puzz\n\n\t# Set the camera range to be relative to the layer count.\n\tvar cam = get_tree().get_root().get_node( \"Spatial\" ).get_node( \"Camera\" )\n\tprint( cam )\n\tvar totalSize = ( puzzle.puzzleLayers * 2 + 1 )\n\tcam.distance.val = 4.5 * totalSize\n\tcam.distance.min_ = 3 * totalSize\n\tcam.distance.max_ = 10 * totalSize\n\tcam.recalculate_camera()\n\n\t\t# # I can do my own counting!\n\t# needed for adding blocks in the editor\n\tpuzzle.pairCount = []\n\tfor block in puzzle.blocks:\n\t\t# Create a block node, add it to the tree\n\t\taddPickledBlock(block)\n\n# Clears any selected blocks. WE SHOULD FIX THIS, THERE CAN ONLY BE ONE BLOCK SELECTED AT ANY ONE TIME, NO NEED FOR AN ARRAY!\nfunc clearSelection():\n\tfor bl in selectedBlocks:\n\t\tvar blo = get_node( bl )\n\t\tblo.setSelected(false)\n\t\tblo.scaleTweenNode(1.0).start()\n\tselectedBlocks = []\n\n# Add the selected block to the selected list. WE SHOULD FIX THIS, IT ONLY NEEDS TO STORE IT, NOT AN ARRAY!\nfunc addSelected(bl):\n\tselectedBlocks.append(bl)\n\n# Used for the multiplayer mode to force click a block on their side.\nfunc forceClickBlock( pos ):\n\tshape[pos].forceClick()\n\nfunc clickBlock( name ):\n\t#now check if that was the second block we picked. If it was, we want to\n\t#unselect the blocks again\n\tif (offClick):\n\t\toffClick = false\n\t\taddSelected(name)\n\t\tclearSelection()\n\telse:\n\t\toffClick = true;\n\t\taddSelected(name)\n\n# Calculates the layer that a block is on.\n# COPY OF FUNCTION IN PUZZLEMAN, IS THERE A BETTER WAY TO DO THIS?!\nfunc calcBlockLayer( x, y, z ):\n\treturn max( max( abs( x ), abs( y ) ), abs( z ) )\nfunc calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n# Handles keeping track of pairs being removed.\nfunc popPair( pos ):\n\tvar blayer = calcBlockLayerVec( pos )\n\tpuzzle.pairCount[blayer] -= 1\n\n\tif( puzzle.pairCount[blayer] == 0 ):\n\t\tprint(\"LAYER CLEARED\")\n\t\tif blayer == 1:\n\t\t\tprint( \"GAME OVER!\" )\n\n\t\tfor b in shape:\n\t\t\tif not ( shape[b] == null ):\n\t\t\t\tif calcBlockLayerVec( b ) == blayer:\n\t\t\t\t\tif shape[b].getBlockType() == BLOCK_LASER:\n\t\t\t\t\t\tshape[b].forceActivate()\n\n\t\t# Fire beams.\n\t\tvar beamNum = 0\n\t\tfor l in range( puzzle.lasers.size() ):\n\t\t\tif calcBlockLayerVec( puzzle.lasers[l][0] ) == blayer:\n\t\t\t\t# Firin mah lazerz!\n\t\t\t\tvar beam = beamScn.instance()\n\n\t\t\t\tbeam.set_name( str(blayer) + \"_beam_\" + str(beamNum) )\n\t\t\t\tbeamNum += 1\n\t\t\t\tbeam.set_script( Beam )\n\n\t\t\t\tadd_child( beam )\n\t\t\t\tbeam.fire( puzzle.lasers[l][0], puzzle.lasers[l][1] )\n\n\t\t\t\tsamplePlayer.play( \"soundslikewillem_hitting_slinky\" )\n\n\nfunc _init():\n\t# Load sound\n\tsamplePlayer.set_voice_count(10)\n\tsamplePlayer.set_sample_library(ResourceLoader.load(\"new_samplelibrary.xml\"))\n\tprint(\"GridMan initialized\")\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"23aae1432067fab00d2c784ece55ef83e11918ff","subject":"tests if editor is available before requesting it","message":"tests if editor is available before requesting it\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Blocks\/AbstractBlock.gd","new_file":"src\/scripts\/Blocks\/AbstractBlock.gd","new_contents":"\nextends RigidBody\n\nvar name_int\nvar name\nvar pairName\nvar selected = false\nvar blockPos\nvar blockLayer\nvar blockType\nconst far_away_corner = Vector3(110, 110, 110)\n\nvar editor\n\nstatic func nameToNodeName(n):\n\treturn \"block\" + str(n)\n\nfunc setName(n):\n\tname_int = n\n\tname = nameToNodeName(n)\n\tset_name(nameToNodeName(n))\n\treturn self\n\nfunc setPairName(n):\n\tpairName = nameToNodeName(n)\n\treturn self\n\nfunc setBlockLayer(n):\n\tblockLayer = n\n\treturn self\n\nfunc getBlockLayer():\n\treturn blockLayer\n\nfunc setBlockType( blockT ):\n\tblockType = blockT\n\treturn self\n\nfunc getBlockType():\n\treturn blockType\n\nfunc setSelected(sel):\n\tselected = sel\n\treturn self\n\nfunc forceClick(click_normal):\n\tif editor != null:\n\t\tif editor.shouldAddNeighbor():\n\t\t\taddNeighbor(editor, click_normal)\n\t\t\treturn\n\t\tif editor.shouldReplaceSelf():\n\t\t\taddNeighbor(editor, 0 * click_normal)\n\t\tif editor.shouldReplaceSelf() or editor.shouldRemoveSelf():\n\t\t\tif pairName != null:\n\t\t\t\tvar pair = get_parent().get_node(pairName)\n\t\t\t\tif pair != null:\n\t\t\t\t\tpair.request_remove()\n\t\t\trequest_remove()\n\t\t\treturn\n\telse:\n\t\tactivate()\n\t\tget_parent().clickBlock( name )\n\nfunc addNeighbor(editor, click_normal):\n\tvar t = get_parent().get_parent().get_transform().inverse()\n\teditor.addBlock(blockPos + t * click_normal)\n\n\n# catch clicks\/taps\nfunc _input_event( camera, ev, click_pos, click_normal, shape_idx ):\n\tif ((ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT)\n\tor (ev.type==InputEvent.SCREEN_TOUCH)):\n\t\tif (get_parent().get_parent().active and ev.is_pressed()):\n\t\t\tforceClick(click_normal)\n\n# returns this block's pairNode or null\nfunc pairActivate():\n\tselected = true\n\n\t# is my pair Nil?\n\tif pairName == null or get_parent() == null or not get_parent().has_node(pairName):\n\t\tscaleTweenNode(0.9, 0.2, Tween.TRANS_EXPO).start()\n\t\treturn null\n\n\t# get my pair node\n\tvar pairNode = get_parent().get_node(pairName)\n\n\t# enlarge if the other guy's unselected\n\tif not pairNode.selected:\n\t\tscaleTweenNode(1.1, 0.2, Tween.TRANS_EXPO).start()\n\treturn pairNode\n\n\n# returns a tween node that uniformly changes the object's scale\n# call start() on the returned object\nfunc scaleTweenNode(scale, time=1, transType=Tween.TRANS_BOUNCE):\n\tvar tweenNode = newTweenNode()\n\ttweenNode.interpolate_method( self, \"set_scale\", \\\n\t\tself.get_scale(), Vector3(scale, scale, scale), \\\n\t\ttime, transType, Tween.EASE_OUT )\n\n\treturn tweenNode\n\n# adds a tween transition node to the tree\nfunc newTweenNode():\n\tvar tween = Tween.new()\n\tadd_child(tween)\n\treturn tween\n\nfunc request_remove(node=null, key=null):\n\tget_parent().remove_block(self)\n\nfunc _ready():\n\tif get_tree().get_root().has_node(\"EditorSpatial\"):\n\t\teditor = get_tree().get_root().get_node(\"EditorSpatial\")\n\tset_ray_pickable(true)\n","old_contents":"\nextends RigidBody\n\nvar name_int\nvar name\nvar pairName\nvar selected = false\nvar blockPos\nvar blockLayer\nvar blockType\nconst far_away_corner = Vector3(110, 110, 110)\n\nvar editor\n\nstatic func nameToNodeName(n):\n\treturn \"block\" + str(n)\n\nfunc setName(n):\n\tname_int = n\n\tname = nameToNodeName(n)\n\tset_name(nameToNodeName(n))\n\treturn self\n\nfunc setPairName(n):\n\tpairName = nameToNodeName(n)\n\treturn self\n\nfunc setBlockLayer(n):\n\tblockLayer = n\n\treturn self\n\nfunc getBlockLayer():\n\treturn blockLayer\n\nfunc setBlockType( blockT ):\n\tblockType = blockT\n\treturn self\n\nfunc getBlockType():\n\treturn blockType\n\nfunc setSelected(sel):\n\tselected = sel\n\treturn self\n\nfunc forceClick(click_normal):\n\tif editor != null:\n\t\tif editor.shouldAddNeighbor():\n\t\t\taddNeighbor(editor, click_normal)\n\t\t\treturn\n\t\tif editor.shouldReplaceSelf():\n\t\t\taddNeighbor(editor, 0 * click_normal)\n\t\tif editor.shouldReplaceSelf() or editor.shouldRemoveSelf():\n\t\t\tif pairName != null:\n\t\t\t\tvar pair = get_parent().get_node(pairName)\n\t\t\t\tif pair != null:\n\t\t\t\t\tpair.request_remove()\n\t\t\trequest_remove()\n\t\t\treturn\n\telse:\n\t\tactivate()\n\t\tget_parent().clickBlock( name )\n\nfunc addNeighbor(editor, click_normal):\n\tvar t = get_parent().get_parent().get_transform().inverse()\n\teditor.addBlock(blockPos + t * click_normal)\n\n\n# catch clicks\/taps\nfunc _input_event( camera, ev, click_pos, click_normal, shape_idx ):\n\tif ((ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT)\n\tor (ev.type==InputEvent.SCREEN_TOUCH)):\n\t\tif (get_parent().get_parent().active and ev.is_pressed()):\n\t\t\tforceClick(click_normal)\n\n# returns this block's pairNode or null\nfunc pairActivate():\n\tselected = true\n\n\t# is my pair Nil?\n\tif pairName == null or get_parent() == null or not get_parent().has_node(pairName):\n\t\tscaleTweenNode(0.9, 0.2, Tween.TRANS_EXPO).start()\n\t\treturn null\n\n\t# get my pair node\n\tvar pairNode = get_parent().get_node(pairName)\n\n\t# enlarge if the other guy's unselected\n\tif not pairNode.selected:\n\t\tscaleTweenNode(1.1, 0.2, Tween.TRANS_EXPO).start()\n\treturn pairNode\n\n\n# returns a tween node that uniformly changes the object's scale\n# call start() on the returned object\nfunc scaleTweenNode(scale, time=1, transType=Tween.TRANS_BOUNCE):\n\tvar tweenNode = newTweenNode()\n\ttweenNode.interpolate_method( self, \"set_scale\", \\\n\t\tself.get_scale(), Vector3(scale, scale, scale), \\\n\t\ttime, transType, Tween.EASE_OUT )\n\n\treturn tweenNode\n\n# adds a tween transition node to the tree\nfunc newTweenNode():\n\tvar tween = Tween.new()\n\tadd_child(tween)\n\treturn tween\n\nfunc request_remove(node=null, key=null):\n\tget_parent().remove_block(self)\n\nfunc _ready():\n\teditor = get_tree().get_root().get_node(\"EditorSpatial\")\n\tset_ray_pickable(true)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"fa001d242e7bb33ef1902a188324699a33afeb18","subject":"tweak buttbutt speeds","message":"tweak buttbutt speeds\n","repos":"arnaudcoj\/godot_game_jam_2016,arnaudcoj\/godot_game_jam_2016","old_file":"sources\/scripts\/player\/buttbutt.gd","new_file":"sources\/scripts\/player\/buttbutt.gd","new_contents":"extends KinematicBody2D\n\n#### SIGNALS ####\nsignal exit\nsignal die\nsignal controls_changed\n\n#### VARIABLES ####\n\n## Export\n\n# traces the fsm changes\nexport (bool) var debug = false\n\n# default moves available\nexport(String, \"move_up\", \"move_down\", \"move_left\", \"move_right\", \"run\", \"jump\") var control_1 = \"move_right\"\nexport(String, \"move_up\", \"move_down\", \"move_left\", \"move_right\", \"run\", \"jump\") var control_2 = \"move_left\"\n\n# controls are pressed\nvar control_1_pressed = false\nvar control_2_pressed = false\n\n# keep finger id for touchscreen\nvar touchscreen_right = -1\nvar touchscreen_left = -1\n\n## FSM\n\nconst IDLE = 0\nconst WALKING = 1\nconst RUNNING = 2\nconst JUMPING = 3\nconst FALLING = 4\nconst CLIMBING = 5\n# current state\nvar fsm = IDLE\n\n## PHYSICS\n\nconst GRAVITY = 1200\nconst WALK_SPEED = 180\nconst RUN_SPEED = 350\nconst JUMP_SPEED = 80\nconst CLIMB_SPEED = Vector2(120, 200)\n\nvar velocity = Vector2(0, 0)\n\nconst MAX_JUMP_TIME = 0.11\nvar jumping_time = 0\n\n#### ONREADY ####\n\nonready var interaction_area = get_node(\"interaction_area\")\nonready var climb_area = preload(\"res:\/\/sources\/scripts\/levels\/climb_area.gd\")\nonready var initial_pos = get_pos()\n\nfunc _ready():\n\tset_fixed_process(true)\n\tset_process_input(true)\n\tprint(get_pos(), \" start\")\n\nfunc reset():\n\tset_pos(initial_pos)\n\tvelocity = Vector2(0,0)\n\tfsm = IDLE\n\n#### METHODS ####\n\t\nfunc _fixed_process(delta):\n\tdecide_fsm(delta)\n\tupdate_physics(delta)\n\nfunc _input(event):\n\tupdate_controls(event)\n\t\n# PHYSICS\n\nfunc update_physics(delta):\n\t# first update the velocity with gravity\n\tupdate_gravity(delta)\n\t\n\t# next update the velocity according to the fsm state\n\tif fsm == IDLE:\n\t\tupdate_idle(delta)\n\telif fsm == WALKING:\n\t\tupdate_walking(delta)\n\telif fsm == RUNNING:\n\t\tupdate_running(delta)\n\telif fsm == JUMPING:\n\t\tupdate_jumping(delta)\n\telif fsm == FALLING:\n\t\tupdate_falling(delta)\n\telif fsm == CLIMBING:\n\t\tupdate_climbing(delta)\n\t\n\t# finally integrate the velocity into actual motion\n\tintegrate_motion(delta)\n\t\n\t\nfunc update_idle(delta):\n\tvelocity.y = 0\n\tvelocity.x = lerp(velocity.x, 0, 0.1)\n\t\nfunc update_walking(delta):\n\tif is_on_ground() :\n\t\tvelocity.y = 0\n\t\tif available_action_pressed(\"move_left\") && available_action_pressed(\"move_right\"):\n\t\t\tvelocity.x = lerp(velocity.x, 0, 0.2)\n\t\telif available_action_pressed(\"move_left\"):\n\t\t\tvelocity.x = lerp(velocity.x, -WALK_SPEED, 0.2)\n\t\telif available_action_pressed(\"move_right\"):\n\t\t\tvelocity.x = lerp(velocity.x, WALK_SPEED, 0.2)\n\nfunc update_running(delta):\n\tif is_on_ground() :\n\t\tvelocity.y = 0\n\t\tif available_action_pressed(\"move_left\") && available_action_pressed(\"move_right\"):\n\t\t\tvelocity.x = lerp(velocity.x, 0, 0.2)\n\t\telif available_action_pressed(\"move_left\"):\n\t\t\tvelocity.x = lerp(velocity.x, -RUN_SPEED, 0.2)\n\t\telif available_action_pressed(\"move_right\"):\n\t\t\tvelocity.x = lerp(velocity.x, RUN_SPEED, 0.2)\n\t\nfunc update_jumping(delta):\n\tjumping_time += delta\n\tif abs(velocity.x) < RUN_SPEED && available_action_pressed(\"run\"):\n\t\tif available_action_pressed(\"move_left\"):\n\t\t\tvelocity.x = lerp(velocity.x, -RUN_SPEED, 0.3)\n\t\telif available_action_pressed(\"move_right\"):\n\t\t\tvelocity.x = lerp(velocity.x, RUN_SPEED, 0.3)\n\telif abs(velocity.x) < WALK_SPEED && !available_action_pressed(\"run\"):\n\t\tif available_action_pressed(\"move_left\"):\n\t\t\tvelocity.x = lerp(velocity.x, -WALK_SPEED, 0.3)\n\t\telif available_action_pressed(\"move_right\"):\n\t\t\tvelocity.x = lerp(velocity.x, WALK_SPEED, 0.3)\n\t\t\n\tvelocity.y -= JUMP_SPEED\n\t\nfunc update_falling(delta):\n\tif abs(velocity.x) < RUN_SPEED && available_action_pressed(\"run\") && (available_action_pressed(\"move_left\") || available_action_pressed(\"move_right\")):\n\t\tif available_action_pressed(\"move_left\"):\n\t\t\tvelocity.x = lerp(velocity.x, -RUN_SPEED, 0.1)\n\t\telif available_action_pressed(\"move_right\"):\n\t\t\tvelocity.x = lerp(velocity.x, RUN_SPEED, 0.1)\n\telif abs(velocity.x) < WALK_SPEED && !available_action_pressed(\"run\") && (available_action_pressed(\"move_left\") || available_action_pressed(\"move_right\")):\n\t\tif available_action_pressed(\"move_left\"):\n\t\t\tvelocity.x = lerp(velocity.x, -WALK_SPEED, 0.2)\n\t\telif available_action_pressed(\"move_right\"):\n\t\t\tvelocity.x = lerp(velocity.x, WALK_SPEED, 0.2)\n\telse:\n\t\tvelocity.x = lerp(velocity.x, 0, 0.02)\n\t\nfunc update_climbing(delta):\n\tvar direction = Vector2()\n\n\tif available_action_pressed(\"move_up\") && !reached_top():\n\t\tdirection.y -= 1\n\tif available_action_pressed(\"move_down\"):\n\t\tdirection.y += 1\n\t\t\n\tif available_action_pressed(\"move_left\"):\n\t\tdirection.x -= 1\n\tif available_action_pressed(\"move_right\"):\n\t\tdirection.x += 1\n\t\n\tmove_and_slide(direction * CLIMB_SPEED)\n\t\t\n\tvelocity.y = 0\n\tvelocity.x = 0\n\nfunc update_gravity(delta):\n\t#velocity.y += delta * GRAVITY\n\tvelocity.y = lerp(velocity.y, GRAVITY, 0.015)\n\t\nfunc integrate_motion(delta):\n\tvar motion = velocity * delta\n\tmove_and_slide(velocity)\n\t\n\tif is_colliding():\n\t\tvar n = get_collision_normal()\n\t\tmotion = n.slide(motion)\n\t\tvelocity = n.slide(velocity)\n\t\tmove(motion)\n\t\nfunc is_on_ground():\n\t return test_move(get_transform(), Vector2(0, 1))\n\t\nfunc reset_jump():\n\tjumping_time = 0\n\tif control_1 == \"jump\" && control_1_pressed:\n\t\tcontrol_1_pressed = false\n\tif control_2 == \"jump\" && control_2_pressed:\n\t\tcontrol_2_pressed = false\n# FSM\n\nfunc decide_fsm(delta):\n\tif fsm == IDLE:\n\t\tdecide_fsm_idle(delta)\n\telif fsm == WALKING:\n\t\tdecide_fsm_walking(delta)\n\telif fsm == RUNNING:\n\t\tdecide_fsm_running(delta)\n\telif fsm == JUMPING:\n\t\tdecide_fsm_jumping(delta)\n\telif fsm == FALLING:\n\t\tdecide_fsm_falling(delta)\n\telif fsm == CLIMBING:\n\t\tdecide_fsm_climbing(delta)\n\nfunc decide_fsm_idle(delta):\n\tif !is_on_ground():\n\t\tchange_state(FALLING)\n\telif available_action_pressed(\"jump\"):\n\t\tchange_state(JUMPING)\n\telif can_climb() && !reached_top() && (available_action_pressed(\"move_up\") || available_action_pressed(\"move_down\")):\n\t\tchange_state(CLIMBING)\n\telif available_action_pressed(\"move_left\") || available_action_pressed(\"move_right\") :\n\t\tif available_action_pressed(\"run\"):\n\t\t\tchange_state(RUNNING)\n\t\telse:\n\t\t\tchange_state(WALKING)\n\t\nfunc decide_fsm_walking(delta):\n\tif !is_on_ground():\n\t\tchange_state(FALLING)\n\telif available_action_pressed(\"jump\"):\n\t\tchange_state(JUMPING)\n\telif can_climb() && !reached_top() && (available_action_pressed(\"move_up\") || available_action_pressed(\"move_down\")):\n\t\tchange_state(CLIMBING)\n\telif available_action_pressed(\"run\"):\n\t\tchange_state(RUNNING)\n\telif !available_action_pressed(\"move_left\") && !available_action_pressed(\"move_right\") :\n\t\tchange_state(IDLE)\n\nfunc decide_fsm_running(delta):\n\tif !is_on_ground():\n\t\tchange_state(FALLING)\n\telif available_action_pressed(\"jump\"):\n\t\tchange_state(JUMPING)\n\telif can_climb() && !reached_top() && (available_action_pressed(\"move_up\") || available_action_pressed(\"move_down\")):\n\t\tchange_state(CLIMBING)\n\telif !available_action_pressed(\"move_left\") && !available_action_pressed(\"move_right\") :\n\t\tchange_state(IDLE)\n\telif !available_action_pressed(\"run\"):\n\t\tchange_state(WALKING)\n\nfunc decide_fsm_jumping(delta):\n\tif jumping_time > MAX_JUMP_TIME || !available_action_pressed(\"jump\"):\n\t\tchange_state(FALLING)\n\t\treset_jump()\n\t\t\nfunc decide_fsm_falling(delta):\n\tif is_on_ground():\n\t\tif available_action_pressed(\"move_left\") || available_action_pressed(\"move_right\"):\n\t\t\tchange_state(WALKING)\n\t\telse :\n\t\t\tchange_state(IDLE)\n\telif can_climb() && !reached_top() && (available_action_pressed(\"move_up\") || available_action_pressed(\"move_down\")):\n\t\tchange_state(CLIMBING)\n\t\t\nfunc decide_fsm_climbing(delta):\n\tif available_action_pressed(\"jump\"):\n\t\tchange_state(FALLING)\n\telif !can_climb():\n\t\tchange_state(FALLING)\n\nfunc change_state(id):\n\tif debug:\n\t\tprint(get_fsm_name(fsm), \" -> \", get_fsm_name(id))\n\tfsm = id\n\nfunc can_climb():\n\tfor area in interaction_area.get_overlapping_areas():\n\t\tif area extends climb_area:\n\t\t\treturn true\n\treturn false\n\nfunc reached_top():\n\tfor area in interaction_area.get_overlapping_areas():\n\t\tif area extends climb_area && !area.is_on_top(interaction_area):\n\t\t\treturn false\n\treturn true\n\nfunc get_fsm_name(id = -1):\n\tif id == -1:\n\t\tid = fsm\n\tif id == IDLE:\n\t\treturn \"idle\"\n\telif id == WALKING:\n\t\treturn \"walking\"\n\telif id == RUNNING:\n\t\treturn \"running\"\n\telif id == JUMPING:\n\t\treturn \"jumping\"\n\telif id == FALLING:\n\t\treturn \"falling\"\n\telif id == CLIMBING:\n\t\treturn \"climbing\"\n\t\n# Interactions\n\nfunc update_controls(event):\n\t# update control_x_pressed state\n\t\n\t# touchscreen event\n\tif event.type == InputEvent.SCREEN_TOUCH: \n\t\t# just pressed the screen\n\t\tif event.pressed:\n\t\t\t# checks if bottom part of the screen\n\t\t\tif event.pos.y > 200:\n\t\t\t\t# checks if left part of the screen and no finger already in this part\n\t\t\t\tif event.pos.x <= 1024 \/ 2 && touchscreen_left == -1:\n\t\t\t\t\ttouchscreen_left = event.index\n\t\t\t\t\tcontrol_1_pressed = true\n\t\t\t\t# checks if right part of the screen and no finger already in this part\n\t\t\t\telif event.pos.x > 1024 \/ 2 && touchscreen_right == -1:\n\t\t\t\t\ttouchscreen_right = event.index\n\t\t\t\t\tcontrol_2_pressed = true\n\t\t# just released a finger\n\t\telse:\n\t\t\t# if the finger released was on the right part\n\t\t\tif event.index == touchscreen_right:\n\t\t\t\ttouchscreen_right = -1\n\t\t\t\tcontrol_2_pressed = false\n\t\t\t# if the finger released was on the left part\n\t\t\telif event.index == touchscreen_left:\n\t\t\t\ttouchscreen_left = -1\n\t\t\t\tcontrol_1_pressed = false\n\t\t\n\t# Keyboard event\n\telif event.type == InputEvent.KEY && !event.is_echo():\n\t\tif event.is_action(control_1):\n\t\t\tcontrol_1_pressed = event.pressed\n\t\tif event.is_action(control_2):\n\t\t\tcontrol_2_pressed = event.pressed\n\t\tif event.is_action(\"ui_page_up\"):\n\t\t\tcontrol_1_pressed = event.pressed\n\t\tif event.is_action(\"ui_page_down\"):\n\t\t\tcontrol_2_pressed = event.pressed\n\t\nfunc available_action_pressed(action):\n\tif debug:\n\t\treturn Input.is_action_pressed(action)\n\telse:\n\t\treturn (control_1_pressed && control_1 == action) || (control_2_pressed && control_2 == action)\n\nfunc change_controls(control_1, control_2):\n\tif self.control_1 != control_1:\n\t\tcontrol_1_pressed = false\n\t\tself.control_1 = control_1\n\tif self.control_2 != control_2:\n\t\tcontrol_2_pressed = false\n\t\tself.control_2 = control_2\n\temit_signal(\"controls_changed\", self)\n\nfunc release_controls():\n\tcontrol_1_pressed = false\n\tcontrol_2_pressed = false\n\nfunc die():\n\temit_signal(\"die\")\n\t\nfunc exit():\n\temit_signal(\"exit\")","old_contents":"extends KinematicBody2D\n\n#### SIGNALS ####\nsignal exit\nsignal die\nsignal controls_changed\n\n#### VARIABLES ####\n\n## Export\n\n# traces the fsm changes\nexport (bool) var debug = false\n\n# default moves available\nexport(String, \"move_up\", \"move_down\", \"move_left\", \"move_right\", \"run\", \"jump\") var control_1 = \"move_right\"\nexport(String, \"move_up\", \"move_down\", \"move_left\", \"move_right\", \"run\", \"jump\") var control_2 = \"move_left\"\n\n# controls are pressed\nvar control_1_pressed = false\nvar control_2_pressed = false\n\n# keep finger id for touchscreen\nvar touchscreen_right = -1\nvar touchscreen_left = -1\n\n## FSM\n\nconst IDLE = 0\nconst WALKING = 1\nconst RUNNING = 2\nconst JUMPING = 3\nconst FALLING = 4\nconst CLIMBING = 5\n# current state\nvar fsm = IDLE\n\n## PHYSICS\n\nconst GRAVITY = 1200\nconst WALK_SPEED = 200\nconst RUN_SPEED = 350\nconst JUMP_SPEED = 70\nconst CLIMB_SPEED = Vector2(70, 130)\n\nvar velocity = Vector2(0, 0)\n\nconst MAX_JUMP_TIME = 0.11\nvar jumping_time = 0\n\n#### ONREADY ####\n\nonready var interaction_area = get_node(\"interaction_area\")\nonready var climb_area = preload(\"res:\/\/sources\/scripts\/levels\/climb_area.gd\")\nonready var initial_pos = get_pos()\n\nfunc _ready():\n\tset_fixed_process(true)\n\tset_process_input(true)\n\tprint(get_pos(), \" start\")\n\nfunc reset():\n\tset_pos(initial_pos)\n\tvelocity = Vector2(0,0)\n\tfsm = IDLE\n\n#### METHODS ####\n\t\nfunc _fixed_process(delta):\n\tdecide_fsm(delta)\n\tupdate_physics(delta)\n\nfunc _input(event):\n\tupdate_controls(event)\n\t\n# PHYSICS\n\nfunc update_physics(delta):\n\t# first update the velocity with gravity\n\tupdate_gravity(delta)\n\t\n\t# next update the velocity according to the fsm state\n\tif fsm == IDLE:\n\t\tupdate_idle(delta)\n\telif fsm == WALKING:\n\t\tupdate_walking(delta)\n\telif fsm == RUNNING:\n\t\tupdate_running(delta)\n\telif fsm == JUMPING:\n\t\tupdate_jumping(delta)\n\telif fsm == FALLING:\n\t\tupdate_falling(delta)\n\telif fsm == CLIMBING:\n\t\tupdate_climbing(delta)\n\t\n\t# finally integrate the velocity into actual motion\n\tintegrate_motion(delta)\n\t\n\t\nfunc update_idle(delta):\n\tvelocity.y = 0\n\tvelocity.x = lerp(velocity.x, 0, 0.1)\n\t\nfunc update_walking(delta):\n\tif is_on_ground() :\n\t\tvelocity.y = 0\n\t\tif available_action_pressed(\"move_left\") && available_action_pressed(\"move_right\"):\n\t\t\tvelocity.x = lerp(velocity.x, 0, 0.2)\n\t\telif available_action_pressed(\"move_left\"):\n\t\t\tvelocity.x = lerp(velocity.x, -WALK_SPEED, 0.2)\n\t\telif available_action_pressed(\"move_right\"):\n\t\t\tvelocity.x = lerp(velocity.x, WALK_SPEED, 0.2)\n\nfunc update_running(delta):\n\tif is_on_ground() :\n\t\tvelocity.y = 0\n\t\tif available_action_pressed(\"move_left\") && available_action_pressed(\"move_right\"):\n\t\t\tvelocity.x = lerp(velocity.x, 0, 0.2)\n\t\telif available_action_pressed(\"move_left\"):\n\t\t\tvelocity.x = lerp(velocity.x, -RUN_SPEED, 0.2)\n\t\telif available_action_pressed(\"move_right\"):\n\t\t\tvelocity.x = lerp(velocity.x, RUN_SPEED, 0.2)\n\t\nfunc update_jumping(delta):\n\tjumping_time += delta\n\tif abs(velocity.x) < RUN_SPEED && available_action_pressed(\"run\"):\n\t\tif available_action_pressed(\"move_left\"):\n\t\t\tvelocity.x = lerp(velocity.x, -RUN_SPEED, 0.3)\n\t\telif available_action_pressed(\"move_right\"):\n\t\t\tvelocity.x = lerp(velocity.x, RUN_SPEED, 0.3)\n\telif abs(velocity.x) < WALK_SPEED && !available_action_pressed(\"run\"):\n\t\tif available_action_pressed(\"move_left\"):\n\t\t\tvelocity.x = lerp(velocity.x, -WALK_SPEED, 0.3)\n\t\telif available_action_pressed(\"move_right\"):\n\t\t\tvelocity.x = lerp(velocity.x, WALK_SPEED, 0.3)\n\t\t\n\tvelocity.y -= JUMP_SPEED\n\t\nfunc update_falling(delta):\n\tif abs(velocity.x) < RUN_SPEED && available_action_pressed(\"run\") && (available_action_pressed(\"move_left\") || available_action_pressed(\"move_right\")):\n\t\tif available_action_pressed(\"move_left\"):\n\t\t\tvelocity.x = lerp(velocity.x, -RUN_SPEED, 0.1)\n\t\telif available_action_pressed(\"move_right\"):\n\t\t\tvelocity.x = lerp(velocity.x, RUN_SPEED, 0.1)\n\telif abs(velocity.x) < WALK_SPEED && !available_action_pressed(\"run\") && (available_action_pressed(\"move_left\") || available_action_pressed(\"move_right\")):\n\t\tif available_action_pressed(\"move_left\"):\n\t\t\tvelocity.x = lerp(velocity.x, -WALK_SPEED, 0.2)\n\t\telif available_action_pressed(\"move_right\"):\n\t\t\tvelocity.x = lerp(velocity.x, WALK_SPEED, 0.2)\n\telse:\n\t\tvelocity.x = lerp(velocity.x, 0, 0.02)\n\t\nfunc update_climbing(delta):\n\tvar direction = Vector2()\n\n\tif available_action_pressed(\"move_up\") && !reached_top():\n\t\tdirection.y -= 1\n\tif available_action_pressed(\"move_down\"):\n\t\tdirection.y += 1\n\t\t\n\tif available_action_pressed(\"move_left\"):\n\t\tdirection.x -= 1\n\tif available_action_pressed(\"move_right\"):\n\t\tdirection.x += 1\n\t\n\tmove_and_slide(direction * CLIMB_SPEED)\n\t\t\n\tvelocity.y = 0\n\tvelocity.x = 0\n\nfunc update_gravity(delta):\n\t#velocity.y += delta * GRAVITY\n\tvelocity.y = lerp(velocity.y, GRAVITY, 0.015)\n\t\nfunc integrate_motion(delta):\n\tvar motion = velocity * delta\n\tmove_and_slide(velocity)\n\t\n\tif is_colliding():\n\t\tvar n = get_collision_normal()\n\t\tmotion = n.slide(motion)\n\t\tvelocity = n.slide(velocity)\n\t\tmove(motion)\n\t\nfunc is_on_ground():\n\t return test_move(get_transform(), Vector2(0, 1))\n\t\nfunc reset_jump():\n\tjumping_time = 0\n\tif control_1 == \"jump\" && control_1_pressed:\n\t\tcontrol_1_pressed = false\n\tif control_2 == \"jump\" && control_2_pressed:\n\t\tcontrol_2_pressed = false\n# FSM\n\nfunc decide_fsm(delta):\n\tif fsm == IDLE:\n\t\tdecide_fsm_idle(delta)\n\telif fsm == WALKING:\n\t\tdecide_fsm_walking(delta)\n\telif fsm == RUNNING:\n\t\tdecide_fsm_running(delta)\n\telif fsm == JUMPING:\n\t\tdecide_fsm_jumping(delta)\n\telif fsm == FALLING:\n\t\tdecide_fsm_falling(delta)\n\telif fsm == CLIMBING:\n\t\tdecide_fsm_climbing(delta)\n\nfunc decide_fsm_idle(delta):\n\tif !is_on_ground():\n\t\tchange_state(FALLING)\n\telif available_action_pressed(\"jump\"):\n\t\tchange_state(JUMPING)\n\telif can_climb() && !reached_top() && (available_action_pressed(\"move_up\") || available_action_pressed(\"move_down\")):\n\t\tchange_state(CLIMBING)\n\telif available_action_pressed(\"move_left\") || available_action_pressed(\"move_right\") :\n\t\tif available_action_pressed(\"run\"):\n\t\t\tchange_state(RUNNING)\n\t\telse:\n\t\t\tchange_state(WALKING)\n\t\nfunc decide_fsm_walking(delta):\n\tif !is_on_ground():\n\t\tchange_state(FALLING)\n\telif available_action_pressed(\"jump\"):\n\t\tchange_state(JUMPING)\n\telif can_climb() && !reached_top() && (available_action_pressed(\"move_up\") || available_action_pressed(\"move_down\")):\n\t\tchange_state(CLIMBING)\n\telif available_action_pressed(\"run\"):\n\t\tchange_state(RUNNING)\n\telif !available_action_pressed(\"move_left\") && !available_action_pressed(\"move_right\") :\n\t\tchange_state(IDLE)\n\nfunc decide_fsm_running(delta):\n\tif !is_on_ground():\n\t\tchange_state(FALLING)\n\telif available_action_pressed(\"jump\"):\n\t\tchange_state(JUMPING)\n\telif can_climb() && !reached_top() && (available_action_pressed(\"move_up\") || available_action_pressed(\"move_down\")):\n\t\tchange_state(CLIMBING)\n\telif !available_action_pressed(\"move_left\") && !available_action_pressed(\"move_right\") :\n\t\tchange_state(IDLE)\n\telif !available_action_pressed(\"run\"):\n\t\tchange_state(WALKING)\n\nfunc decide_fsm_jumping(delta):\n\tif jumping_time > MAX_JUMP_TIME || !available_action_pressed(\"jump\"):\n\t\tchange_state(FALLING)\n\t\treset_jump()\n\t\t\nfunc decide_fsm_falling(delta):\n\tif is_on_ground():\n\t\tif available_action_pressed(\"move_left\") || available_action_pressed(\"move_right\"):\n\t\t\tchange_state(WALKING)\n\t\telse :\n\t\t\tchange_state(IDLE)\n\telif can_climb() && !reached_top() && (available_action_pressed(\"move_up\") || available_action_pressed(\"move_down\")):\n\t\tchange_state(CLIMBING)\n\t\t\nfunc decide_fsm_climbing(delta):\n\tif available_action_pressed(\"jump\"):\n\t\tchange_state(FALLING)\n\telif !can_climb():\n\t\tchange_state(FALLING)\n\nfunc change_state(id):\n\tif debug:\n\t\tprint(get_fsm_name(fsm), \" -> \", get_fsm_name(id))\n\tfsm = id\n\nfunc can_climb():\n\tfor area in interaction_area.get_overlapping_areas():\n\t\tif area extends climb_area:\n\t\t\treturn true\n\treturn false\n\nfunc reached_top():\n\tfor area in interaction_area.get_overlapping_areas():\n\t\tif area extends climb_area && !area.is_on_top(interaction_area):\n\t\t\treturn false\n\treturn true\n\nfunc get_fsm_name(id = -1):\n\tif id == -1:\n\t\tid = fsm\n\tif id == IDLE:\n\t\treturn \"idle\"\n\telif id == WALKING:\n\t\treturn \"walking\"\n\telif id == RUNNING:\n\t\treturn \"running\"\n\telif id == JUMPING:\n\t\treturn \"jumping\"\n\telif id == FALLING:\n\t\treturn \"falling\"\n\telif id == CLIMBING:\n\t\treturn \"climbing\"\n\t\n# Interactions\n\nfunc update_controls(event):\n\t# update control_x_pressed state\n\t\n\t# touchscreen event\n\tif event.type == InputEvent.SCREEN_TOUCH: \n\t\t# just pressed the screen\n\t\tif event.pressed:\n\t\t\t# checks if bottom part of the screen\n\t\t\tif event.pos.y > 200:\n\t\t\t\t# checks if left part of the screen and no finger already in this part\n\t\t\t\tif event.pos.x <= 1024 \/ 2 && touchscreen_left == -1:\n\t\t\t\t\ttouchscreen_left = event.index\n\t\t\t\t\tcontrol_1_pressed = true\n\t\t\t\t# checks if right part of the screen and no finger already in this part\n\t\t\t\telif event.pos.x > 1024 \/ 2 && touchscreen_right == -1:\n\t\t\t\t\ttouchscreen_right = event.index\n\t\t\t\t\tcontrol_2_pressed = true\n\t\t# just released a finger\n\t\telse:\n\t\t\t# if the finger released was on the right part\n\t\t\tif event.index == touchscreen_right:\n\t\t\t\ttouchscreen_right = -1\n\t\t\t\tcontrol_2_pressed = false\n\t\t\t# if the finger released was on the left part\n\t\t\telif event.index == touchscreen_left:\n\t\t\t\ttouchscreen_left = -1\n\t\t\t\tcontrol_1_pressed = false\n\t\t\n\t# Keyboard event\n\telif event.type == InputEvent.KEY && !event.is_echo():\n\t\tif event.is_action(control_1):\n\t\t\tcontrol_1_pressed = event.pressed\n\t\tif event.is_action(control_2):\n\t\t\tcontrol_2_pressed = event.pressed\n\t\tif event.is_action(\"ui_page_up\"):\n\t\t\tcontrol_1_pressed = event.pressed\n\t\tif event.is_action(\"ui_page_down\"):\n\t\t\tcontrol_2_pressed = event.pressed\n\t\nfunc available_action_pressed(action):\n\tif debug:\n\t\treturn Input.is_action_pressed(action)\n\telse:\n\t\treturn (control_1_pressed && control_1 == action) || (control_2_pressed && control_2 == action)\n\nfunc change_controls(control_1, control_2):\n\tif self.control_1 != control_1:\n\t\tself.control_1 = control_1\n\t\tcontrol_1_pressed = false\n\tif self.control_2 != control_2:\n\t\tself.control_2 = control_2\n\t\tcontrol_2_pressed = false\n\temit_signal(\"controls_changed\", self)\n\nfunc release_controls():\n\tcontrol_1_pressed = false\n\tcontrol_2_pressed = false\n\nfunc die():\n\temit_signal(\"die\")\n\t\nfunc exit():\n\temit_signal(\"exit\")","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"6ca2a45a215d3183d7151f08d854e3ad20693ede","subject":"Fix jumps in scale and rotation when pinching","message":"Fix jumps in scale and rotation when pinching\n\nWhen pressing with two fingers at once and pinching, an old coordinate contained in the curr_state dictionary gets added to the base_state dictionary, which causes unintended jumps in both scale and rotation. By clearing base_state the script functions as intended.","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"mobile\/multitouch_cubes\/GestureArea.gd","new_file":"mobile\/multitouch_cubes\/GestureArea.gd","new_contents":"extends Control\n\nexport(NodePath) var target\nexport var min_scale = 0.1\nexport var max_scale = 3.0\nexport var one_finger_rot_x = true\nexport var one_finger_rot_y = true\nexport var two_fingers_rot_z = true\nexport var two_fingers_zoom = true\n\nvar base_state\nvar curr_state\n\nvar target_node\n\n# We keep here a copy of the state before the number of fingers changed to avoid accumulation errors.\nvar base_xform\n\nfunc _ready():\n\tbase_state = {}\n\tcurr_state = {}\n\ttarget_node = get_node(target)\n\n\nfunc _gui_input(event):\n\t# We must start touching inside, but we can drag or unpress outside.\n#\tif not (event is InputEventScreenDrag or\n#\t\t(event is InputEventScreenTouch and (not event.pressed or get_global_rect().has_point(event.position)))):\n#\t\treturn\n\n\tvar finger_count = base_state.size()\n\n\tif finger_count == 0:\n\t\t# No fingers => Accept press.\n\t\tif event is InputEventScreenTouch:\n\t\t\tif event.pressed:\n\t\t\t\t# A finger started touching.\n\n\t\t\t\tbase_state = {\n\t\t\t\t\tevent.index: event.position,\n\t\t\t\t}\n\n\telif finger_count == 1:\n\t\t# One finger => For rotating around X and Y.\n\t\t# Accept one more press, unpress or drag.\n\t\tif event is InputEventScreenTouch:\n\t\t\tif event.pressed:\n\t\t\t\t# One more finger started touching.\n\n\t\t\t\t# Reset the base state to the only current and the new fingers.\n\t\t\t\tbase_state = {\n\t\t\t\t\tcurr_state.keys()[0]: curr_state.values()[0],\n\t\t\t\t\tevent.index: event.position,\n\t\t\t\t}\n\t\t\telse:\n\t\t\t\tif base_state.has(event.index):\n\t\t\t\t\t# Only touching finger released.\n\n\t\t\t\t\tbase_state.clear()\n\n\t\telif event is InputEventScreenDrag:\n\t\t\tif curr_state.has(event.index):\n\t\t\t\t# Touching finger dragged.\n\t\t\t\tvar unit_drag = _px2unit(base_state[base_state.keys()[0]] - event.position)\n\t\t\t\tif one_finger_rot_x:\n\t\t\t\t\ttarget_node.global_rotate(Vector3.UP, deg2rad(180.0 * unit_drag.x))\n\t\t\t\tif one_finger_rot_y:\n\t\t\t\t\ttarget_node.global_rotate(Vector3.RIGHT, deg2rad(180.0 * unit_drag.y))\n\t\t\t\t# Since rotating around two axes, we have to reset the base constantly.\n\t\t\t\tcurr_state[event.index] = event.position\n\t\t\t\tbase_state[event.index] = event.position\n\t\t\t\tbase_xform = target_node.get_transform()\n\n\telif finger_count == 2:\n\t\t# Two fingers => To pinch-zoom and rotate around Z.\n\t\t# Accept unpress or drag.\n\t\tif event is InputEventScreenTouch:\n\t\t\tif not event.pressed and base_state.has(event.index):\n\t\t\t\t# Some known touching finger released.\n\n\t\t\t\t# Clear the base state\n\t\t\t\tbase_state.clear()\n\n\t\telif event is InputEventScreenDrag:\n\t\t\tif curr_state.has(event.index):\n\t\t\t\t# Some known touching finger dragged.\n\t\t\t\tcurr_state[event.index] = event.position\n\n\t\t\t\t# Compute base and current inter-finger vectors.\n\t\t\t\tvar base_segment = base_state[base_state.keys()[0]] - base_state[base_state.keys()[1]]\n\t\t\t\tvar new_segment = curr_state[curr_state.keys()[0]] - curr_state[curr_state.keys()[1]]\n\n\t\t\t\t# Get the base scale from the base matrix.\n\t\t\t\tvar base_scale = Vector3(base_xform.basis.x.x, base_xform.basis.y.y, base_xform.basis.z.z).length()\n\n\t\t\t\tif two_fingers_zoom:\n\t\t\t\t\t# Compute the new scale limiting it and taking into account the base scale.\n\t\t\t\t\tvar new_scale = clamp(base_scale * (new_segment.length() \/ base_segment.length()), min_scale, max_scale) \/ base_scale\n\t\t\t\t\ttarget_node.set_transform(base_xform.scaled(new_scale * Vector3.ONE))\n\t\t\t\telse:\n\t\t\t\t\ttarget_node.set_transform(base_xform)\n\n\t\t\t\tif two_fingers_rot_z:\n\t\t\t\t\t# Apply rotation between base inter-finger vector and the current one.\n\t\t\t\t\tvar rot = new_segment.angle_to(base_segment)\n\t\t\t\t\ttarget_node.global_rotate(Vector3.BACK, rot)\n\n\t# Finger count changed?\n\tif base_state.size() != finger_count:\n\t\t# Copy new base state to the current state.\n\t\tcurr_state = {}\n\t\tfor idx in base_state.keys():\n\t\t\tcurr_state[idx] = base_state[idx]\n\t\t# Remember the base transform.\n\t\tbase_xform = target_node.get_transform()\n\n\n# Converts a vector in pixels to a unitary magnitude,\n# considering the number of pixels of the shorter axis is the unit.\nfunc _px2unit(v):\n\tvar shortest = min(get_size().x, get_size().y)\n\treturn v * (1.0 \/ shortest)\n","old_contents":"extends Control\n\nexport(NodePath) var target\nexport var min_scale = 0.1\nexport var max_scale = 3.0\nexport var one_finger_rot_x = true\nexport var one_finger_rot_y = true\nexport var two_fingers_rot_z = true\nexport var two_fingers_zoom = true\n\nvar base_state\nvar curr_state\n\nvar target_node\n\n# We keep here a copy of the state before the number of fingers changed to avoid accumulation errors.\nvar base_xform\n\nfunc _ready():\n\tbase_state = {}\n\tcurr_state = {}\n\ttarget_node = get_node(target)\n\n\nfunc _gui_input(event):\n\t# We must start touching inside, but we can drag or unpress outside.\n#\tif not (event is InputEventScreenDrag or\n#\t\t(event is InputEventScreenTouch and (not event.pressed or get_global_rect().has_point(event.position)))):\n#\t\treturn\n\n\tvar finger_count = base_state.size()\n\n\tif finger_count == 0:\n\t\t# No fingers => Accept press.\n\t\tif event is InputEventScreenTouch:\n\t\t\tif event.pressed:\n\t\t\t\t# A finger started touching.\n\n\t\t\t\tbase_state = {\n\t\t\t\t\tevent.index: event.position,\n\t\t\t\t}\n\n\telif finger_count == 1:\n\t\t# One finger => For rotating around X and Y.\n\t\t# Accept one more press, unpress or drag.\n\t\tif event is InputEventScreenTouch:\n\t\t\tif event.pressed:\n\t\t\t\t# One more finger started touching.\n\n\t\t\t\t# Reset the base state to the only current and the new fingers.\n\t\t\t\tbase_state = {\n\t\t\t\t\tcurr_state.keys()[0]: curr_state.values()[0],\n\t\t\t\t\tevent.index: event.position,\n\t\t\t\t}\n\t\t\telse:\n\t\t\t\tif base_state.has(event.index):\n\t\t\t\t\t# Only touching finger released.\n\n\t\t\t\t\tbase_state.clear()\n\n\t\telif event is InputEventScreenDrag:\n\t\t\tif curr_state.has(event.index):\n\t\t\t\t# Touching finger dragged.\n\t\t\t\tvar unit_drag = _px2unit(base_state[base_state.keys()[0]] - event.position)\n\t\t\t\tif one_finger_rot_x:\n\t\t\t\t\ttarget_node.global_rotate(Vector3.UP, deg2rad(180.0 * unit_drag.x))\n\t\t\t\tif one_finger_rot_y:\n\t\t\t\t\ttarget_node.global_rotate(Vector3.RIGHT, deg2rad(180.0 * unit_drag.y))\n\t\t\t\t# Since rotating around two axes, we have to reset the base constantly.\n\t\t\t\tcurr_state[event.index] = event.position\n\t\t\t\tbase_state[event.index] = event.position\n\t\t\t\tbase_xform = target_node.get_transform()\n\n\telif finger_count == 2:\n\t\t# Two fingers => To pinch-zoom and rotate around Z.\n\t\t# Accept unpress or drag.\n\t\tif event is InputEventScreenTouch:\n\t\t\tif not event.pressed and base_state.has(event.index):\n\t\t\t\t# Some known touching finger released.\n\n\t\t\t\t# Remove released finger from the base state.\n\t\t\t\tbase_state.erase(event.index)\n\t\t\t\t# Reset the base state to the now only toyching finger.\n\t\t\t\tbase_state = {\n\t\t\t\t\tcurr_state.keys()[0]: curr_state.values()[0],\n\t\t\t\t}\n\n\t\telif event is InputEventScreenDrag:\n\t\t\tif curr_state.has(event.index):\n\t\t\t\t# Some known touching finger dragged.\n\t\t\t\tcurr_state[event.index] = event.position\n\n\t\t\t\t# Compute base and current inter-finger vectors.\n\t\t\t\tvar base_segment = base_state[base_state.keys()[0]] - base_state[base_state.keys()[1]]\n\t\t\t\tvar new_segment = curr_state[curr_state.keys()[0]] - curr_state[curr_state.keys()[1]]\n\n\t\t\t\t# Get the base scale from the base matrix.\n\t\t\t\tvar base_scale = Vector3(base_xform.basis.x.x, base_xform.basis.y.y, base_xform.basis.z.z).length()\n\n\t\t\t\tif two_fingers_zoom:\n\t\t\t\t\t# Compute the new scale limiting it and taking into account the base scale.\n\t\t\t\t\tvar new_scale = clamp(base_scale * (new_segment.length() \/ base_segment.length()), min_scale, max_scale) \/ base_scale\n\t\t\t\t\ttarget_node.set_transform(base_xform.scaled(new_scale * Vector3.ONE))\n\t\t\t\telse:\n\t\t\t\t\ttarget_node.set_transform(base_xform)\n\n\t\t\t\tif two_fingers_rot_z:\n\t\t\t\t\t# Apply rotation between base inter-finger vector and the current one.\n\t\t\t\t\tvar rot = new_segment.angle_to(base_segment)\n\t\t\t\t\ttarget_node.global_rotate(Vector3.BACK, rot)\n\n\t# Finger count changed?\n\tif base_state.size() != finger_count:\n\t\t# Copy new base state to the current state.\n\t\tcurr_state = {}\n\t\tfor idx in base_state.keys():\n\t\t\tcurr_state[idx] = base_state[idx]\n\t\t# Remember the base transform.\n\t\tbase_xform = target_node.get_transform()\n\n\n# Converts a vector in pixels to a unitary magnitude,\n# considering the number of pixels of the shorter axis is the unit.\nfunc _px2unit(v):\n\tvar shortest = min(get_size().x, get_size().y)\n\treturn v * (1.0 \/ shortest)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"24ef6b0d41e3d5e4a4d295be43031475e96ae684","subject":"pushback range nerf","message":"pushback range nerf\n","repos":"P1X-in\/rat-is-fat","old_file":"scripts\/moving_object.gd","new_file":"scripts\/moving_object.gd","new_contents":"extends \"res:\/\/scripts\/object.gd\"\n\nvar velocity\nvar movement_vector = [0, 0]\n\nvar AXIS_THRESHOLD = 0.15\n\nvar body_part_head\nvar body_part_body\nvar body_part_footer\nvar animations\nvar hat = false\n\nvar stun_duration = 0.15\nvar stun_level = 0\n\nfunc _init(bag).(bag):\n self.bag = bag\n\nfunc spawn(position):\n .spawn(position)\n self.bag.processing.register(self)\n\nfunc despawn():\n self.bag.processing.remove(self)\n .despawn()\n\nfunc process(delta):\n self.modify_position(delta)\n\nfunc modify_position(delta):\n var x = self.apply_axis_threshold(self.movement_vector[0])\n var y = self.apply_axis_threshold(self.movement_vector[1])\n var motion = Vector2(x, y) * self.velocity * delta\n self.avatar.move(motion)\n if (self.avatar.is_colliding()):\n var n = self.avatar.get_collision_normal()\n motion = n.slide(motion)\n self.avatar.move(motion)\n self.flip(self.movement_vector[0])\n\nfunc apply_axis_threshold(axis_value):\n if abs(axis_value) < self.AXIS_THRESHOLD:\n return 0\n return axis_value\n\nfunc flip(direction):\n if direction == 0:\n return\n\n var flip_sprite = false\n if direction > 0:\n flip_sprite = true\n\n self.body_part_head.set_flip_h(flip_sprite)\n self.body_part_body.set_flip_h(flip_sprite)\n self.body_part_footer.set_flip_h(flip_sprite)\n if self.hat:\n self.hat.set_flip_h(flip_sprite)\n\nfunc reset_movement():\n self.movement_vector = [0, 0]\n\nfunc push_back(enemy):\n var enemy_position = enemy.get_pos()\n var object_position = self.get_pos()\n\n var position_delta_x = object_position.x - enemy_position.x\n var position_delta_y = object_position.y - enemy_position.y\n var force = pow(enemy.attack_strength, -1)\n\n var scale = force \/ self.calculate_distance(enemy_position) * 10\n\n self.avatar.move(Vector2(position_delta_x * scale, position_delta_y * scale))\n self.stun()\n\nfunc stun(duration=null):\n if duration == null:\n duration = self.stun_duration\n self.is_processing = false\n self.stun_level = stun_level + 1\n self.bag.timers.set_timeout(duration, self, \"remove_stun\")\n\nfunc remove_stun():\n self.stun_level = stun_level - 1\n if self.stun_level == 0:\n self.is_processing = true\n\n\n","old_contents":"extends \"res:\/\/scripts\/object.gd\"\n\nvar velocity\nvar movement_vector = [0, 0]\n\nvar AXIS_THRESHOLD = 0.15\n\nvar body_part_head\nvar body_part_body\nvar body_part_footer\nvar animations\nvar hat = false\n\nvar stun_duration = 0.15\nvar stun_level = 0\n\nfunc _init(bag).(bag):\n self.bag = bag\n\nfunc spawn(position):\n .spawn(position)\n self.bag.processing.register(self)\n\nfunc despawn():\n self.bag.processing.remove(self)\n .despawn()\n\nfunc process(delta):\n self.modify_position(delta)\n\nfunc modify_position(delta):\n var x = self.apply_axis_threshold(self.movement_vector[0])\n var y = self.apply_axis_threshold(self.movement_vector[1])\n var motion = Vector2(x, y) * self.velocity * delta\n self.avatar.move(motion)\n if (self.avatar.is_colliding()):\n var n = self.avatar.get_collision_normal()\n motion = n.slide(motion)\n self.avatar.move(motion)\n self.flip(self.movement_vector[0])\n\nfunc apply_axis_threshold(axis_value):\n if abs(axis_value) < self.AXIS_THRESHOLD:\n return 0\n return axis_value\n\nfunc flip(direction):\n if direction == 0:\n return\n\n var flip_sprite = false\n if direction > 0:\n flip_sprite = true\n\n self.body_part_head.set_flip_h(flip_sprite)\n self.body_part_body.set_flip_h(flip_sprite)\n self.body_part_footer.set_flip_h(flip_sprite)\n if self.hat:\n self.hat.set_flip_h(flip_sprite)\n\nfunc reset_movement():\n self.movement_vector = [0, 0]\n\nfunc push_back(enemy):\n var enemy_position = enemy.get_pos()\n var object_position = self.get_pos()\n\n var position_delta_x = object_position.x - enemy_position.x\n var position_delta_y = object_position.y - enemy_position.y\n var force = pow(enemy.attack_strength, -1)\n\n var scale = force \/ self.calculate_distance(enemy_position) * 20 - mass \/ force\n\n self.avatar.move(Vector2(position_delta_x * scale, position_delta_y * scale))\n self.stun()\n\nfunc stun(duration=null):\n if duration == null:\n duration = self.stun_duration\n self.is_processing = false\n self.stun_level = stun_level + 1\n self.bag.timers.set_timeout(duration, self, \"remove_stun\")\n\nfunc remove_stun():\n self.stun_level = stun_level - 1\n if self.stun_level == 0:\n self.is_processing = true\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"f5c6839a85ccb9ba35a739cb4b072bb98d2121aa","subject":"Fix function typo","message":"Fix function typo\n","repos":"ruipsrosario\/godot-responsive-control","old_file":"source\/addons\/responsive_controls\/ResponsiveSizing.gd","new_file":"source\/addons\/responsive_controls\/ResponsiveSizing.gd","new_contents":"tool\nextends Control\n\n# Minimum size the parent Control must have in order to trigger this Responsive Sizing\nexport(Vector2) var minimumParentSize = Vector2()\n\n# Whether or not this Responsive Sizing is visible in the set size\nexport(bool) var isVisible = true\n\n# Checks if this Responsive Sizing is eligible under the specified size\nfunc isEligible(size):\n\treturn size.width >= minimumParentSize.width && size.height >= minimumParentSize.height\n\n# Applies this Responsive Sizing to the specified Control\nfunc applyTo(control):\n\tif isVisible != control.is_visible():\n\t\tif isVisible:\n\t\t\tcontrol.show()\n\t\telse:\n\t\t\tcontrol.hide()\n\t\n\tcontrol.set_h_size_flags(get_h_size_flags())\n\tcontrol.set_v_size_flags(get_v_size_flags())\n\tcontrol.set_scale(get_scale())\n\tfor margin in [ MARGIN_BOTTOM, MARGIN_TOP, MARGIN_RIGHT, MARGIN_LEFT ]:\n\t\tcontrol.set_anchor(margin, get_anchor(margin))\n\t\tcontrol.set_margin(margin, get_margin(margin))\n","old_contents":"tool\nextends Control\n\n# Minimum size the parent Control must have in order to trigger this Responsive Sizing\nexport(Vector2) var minimumParentSize = Vector2()\n\n# Whether or not this Responsive Sizing is visible in the set size\nexport(bool) var isVisible = true\n\n# Checks if this Responsive Sizing is eligible under the specified size\nfunc isEligible(size):\n\treturn size.width >= minimumParentSize.width && size.height >= minimumParentSize.height\n\n# Applies this Responsive Sizing to the specified Control\nfunc applyTo(control):\n\tif isVisible != control.is_visible():\n\t\tif isVisible:\n\t\t\tcontrol.show()\n\t\telse:\n\t\t\tcontrol.hide()\n\t\n\tcontrol.set_h_size_flags(get_h_size_flags())\n\tcontrol.set_v_size_flags(get_v_size_flags())\n\tcontrol.set_scale(get_scale())\n\tfor margin in [ MARGIN_BOTTOM, MARGIN_TOP, MARGIN_RIGHT, MARGIN_LEFT ]:\n\t\tcontrol.set_anchor(margin, get_anchor(margin))\n\t\tcontrol.set_margin(margin, get_marginr(margin))\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"a36a03218ea98847085c4afb5daa9d2569ac62da","subject":"Made game field scalable","message":"Made game field scalable\n","repos":"Acvarium\/BabylonTower2,Acvarium\/BabylonTower2","old_file":"scripts\/2d\/main.gd","new_file":"scripts\/2d\/main.gd","new_contents":"extends Node2D\nvar mainArray = []\nconst BALL_SIZE = 64\nvar ballObj = load(\"res:\/\/objects\/ball.tscn\")\nvar ballPressed = false\nvar ballPressedName = ''\nvar shiftPressed = Vector2(0,0)\n\nvar gameSize = Vector2(6,8)\nconst COLORS = ['r', 'g', 'b', 'p', 'y', 'o']\n\nfunc setGameSize(gs):\n\tgameSize = gs\n\t\nfunc generateMainArray():\n\tmainArray = []\n\tfor i in range(gameSize.x):\n\t\tfor j in range(gameSize.y):\n\t\t\tmainArray.append(str(COLORS[i] + str(j)))\n\tmainArray[mainArray.size() - 1] = ''\n\nfunc _fixed_process(delta):\n\tvar mouse = get_viewport().get_mouse_pos()\n\tvar ballPressedPos = findBallByName(ballPressedName)\n\tif ballPressed:\n\t\tvar mouseOnGrid = Vector2(0,0)\n\t\tvar onGrid = Vector2(0,0)\n\n\t\tmouseOnGrid.x = int((mouse.x - ballPressedPos.x) \/ 64) - 1 \n\t\tmouseOnGrid.y = int((mouse.y - 32 - ballPressedPos.y) \/ 64)\n\n\t\tonGrid.x = (int((mouse.x - ballPressedPos.x) \/ 64) - 1) - ballPressedPos.x\n\t\tonGrid.y = int((mouse.y - 32 - ballPressedPos.y) \/ 64) - ballPressedPos.y\n\n\t\tif onGrid.x != 0:\n\t\t\tvar ballsToShift = []\n\n\t\t\tfor i in range(gameSize.x):\n\t\t\t\tvar b = get_node(\"balls\/b\" + mainArray[i * gameSize.y + ballPressedPos.y])\n\t\t\t\tballsToShift.append(b)\n\t\t\tfor i in range(ballsToShift.size()):\n\n\t\t\t\tvar b = get_node(\"balls\/b\" + mainArray[mainArray.size() - 1])\n\t\t\t\tif ballPressedPos.y < gameSize.y:\n\t\t\t\t\tb = get_node(\"balls\/b\" + mainArray[i * gameSize.y + ballPressedPos.y])\n\t\t\t\tvar pos = b.get_pos()\n\t\t\t\tpos.x = i * 64 + mouseOnGrid.x * 64 - ballPressedPos.x * 64\n\n\t\t\t\tif pos.x > 64 * gameSize.x - 32:\n\t\t\t\t\tpos.x -= 64 * gameSize.x\n\t\t\t\telif pos.x < 0:\n\t\t\t\t\tpos.x += 64 * gameSize.x\n\t\t\t\tb.set_pos(pos)\n\t\t\tshiftPressed = Vector2(ballPressedPos.y, onGrid.x)\n\nfunc _ready():\n\trandomize()\n\n\tset_process_input(true)\n\tset_fixed_process(true)\n#\u041a\u043b\u044e\u0447\u043e\u0432\u0438\u0439 \u043c\u0430\u0441\u0438\u0432, \u0432 \u043a\u043e\u0442\u0440\u043e\u043c\u0443 \u0437\u0431\u0435\u0440\u0456\u0433\u0430\u044e\u0442\u044c\u0441\u044f \u0434\u0430\u043d\u0456 \u043f\u0440\u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044f \u043a\u043e\u043b\u044c\u043e\u0440\u043e\u0432\u0438\u0445 \u043a\u0443\u043b\u044c\u043e\u043a\n\tmainArray = [ 'r1', 'r2', 'r3', 'r4', 'r5', 'r6', 'r7',\n\t\t\t\t 'o1', 'o2', 'o3', 'o4', 'o5', 'o6', 'o7',\n\t\t\t\t 'y1', 'y2', 'y3', 'y4', 'y5', 'y6', 'y7',\n\t\t\t\t 'g1', 'g2', 'g3', 'g4', 'g5', 'g6', 'g7',\n\t\t\t\t 'b1', 'b2', 'b3', 'b4', 'b5', 'b6', 'b7',\n\t\t\t\t 'p1', 'p2', 'p3', 'p4', 'p5', 'p6', ''] \n#\u0421\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f \u043a\u0443\u043b\u044c\u043e\u043a \u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u043d\u043e \u0434\u043e \u043a\u043b\u044e\u0447\u043e\u0432\u043e\u0433\u043e \u043c\u0430\u0441\u0438\u0432\u0443\n\tgenerateMainArray()\n\t#shuffleBalls()\n\tupdateBalls()\n\t\n#\u041e\u0431\u0440\u043e\u0431\u043a\u0430 \u043f\u043e\u0434\u0456\u0439 (\u043d\u0430\u0442\u0438\u0441\u043a\u0430\u043d\u043d\u044f \u043a\u043b\u0430\u0432\u0456\u0448)\nfunc _input(event):\n\tif event.is_action_released(\"space\"): \n\t\tshuffleBalls()\n\t\tupdateBalls()\n\t\tballPressed = false\n\t\t\n\tif event.is_action_released(\"LMB\"):\n\t\tif shiftPressed.y != 0:\n\t\t\tshiftRow(shiftPressed.x, shiftPressed.y)\n\t\telse:\n\t\t\tif findBallByName('').x == findBallByName(ballPressedName).x and ballPressed:\n\t\t\t\tvar sCol = findBallByName(ballPressedName).x\n\t\t\t\tcutCol(findBallByName(ballPressedName))\n\t\t\t\tupdateBalls()\n\t\tballPressed = false\n\t\tupdateBalls()\n\t\tshiftPressed = Vector2(0,0)\n\n#\u0421\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f \u043e\u0434\u043d\u0456\u0454\u0457 \u043a\u0443\u043b\u044c\u043a\u0438 \u0437\u0430 \u0437\u0430\u0434\u0430\u043d\u0438\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438\nfunc createBall(name):\n\tvar balls = get_node(\"balls\")\n\tvar ball = ballObj.instance()\n\tball.set_name(name)\n\tballs.add_child(ball)\n\tvar color = Color(0,0,0,1)\n\tif name != 'b':\n\t\tcolor = toColor(name[1])\n\tball.setColor(color)\n\t\n#\u041f\u0435\u0440\u0435\u0444\u0430\u0440\u0431\u0443\u0432\u0430\u043d\u043d\u044f \u043a\u0443\u043b\u044c\u043e\u043a \u0443 \u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u043d\u0456\u0441\u0442\u044c \u0434\u043e \u0437\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0445 \u0432 \u043a\u043b\u044e\u0447\u043e\u0432\u043e\u043c\u0443 \u043c\u0430\u0441\u0438\u0432\u0456 \u043a\u043e\u043b\u044c\u043e\u0440\u0456\u0432\nfunc toColor(colorMark):\n\tvar color = Color(1,0,1,1)\n\tif not colorMark: \t\t\t#\u041f\u043e\u0440\u043e\u0436\u043d\u044f \u043a\u043e\u043c\u0456\u0440\u043a\u0430\n\t\tcolor = Color(1,1,0,1)\n\telif colorMark == 'r':\t\t#\u0427\u0435\u0440\u0432\u043e\u043d\u0456\n\t\tcolor = Color(1,0,0,1)\n\telif colorMark == 'g':\t\t#\u0417\u0435\u043b\u0435\u043d\u0456\n\t\tcolor = Color(0,0.6,0,1)\n\telif colorMark == 'b':\t\t#\u0421\u0438\u043d\u0456\n\t\tcolor = Color(0,0,1,1)\n\telif colorMark == 'o':\t\t#\u041f\u043e\u043c\u0430\u0440\u0430\u043d\u0447\u0435\u0432\u0456\n\t\tcolor = Color(1.0, 0.5, 0.0, 1.0)\n\telif colorMark == 'y':\t\t#\u0416\u043e\u0432\u0442\u0456\n\t\tcolor = Color(0.65, 0.65, 0.0, 1.0)\n\telif colorMark == 'p':\t\t#\u0424\u0456\u043e\u043b\u0435\u0442\u043e\u0432\u0456\n\t\tcolor = Color(0.65, 0.0, 0.65, 1.0)\n\treturn color\n\n#\u0417\u043c\u0456\u0449\u0435\u043d\u043d\u044f \u0440\u044f\u0434\u043a\u0430 \u043b\u0456\u0432\u043e\u0440\u0443\u0447 \u0430\u0431\u043e \u043f\u0440\u0430\u0432\u043e\u0440\u0443\u0447\nfunc shiftRow(row, dir):\n\tvar tempRow = []\n\tfor i in range(gameSize.x):\n\t\ttempRow.append(mainArray[i * gameSize.y + row])\n\tvar tail\n\tif dir < 0:\n\t\tfor j in range(abs(dir)):\n\t\t\ttail = tempRow[0]\n\t\t\tfor i in range(tempRow.size() - 1):\n\t\t\t\ttempRow[i] = tempRow[i+1]\n\t\t\ttempRow[tempRow.size() - 1] = tail\n\telif dir > 0:\n\t\tfor j in range(abs(dir)):\n\t\t\ttail = tempRow[tempRow.size() - 1]\n\t\t\tfor i in range((tempRow.size() - 1), 0 , -1):\n\t\t\t\ttempRow[i] = tempRow[i - 1]\n\t\t\ttempRow[0] = tail\n\tfor i in range(gameSize.x):\n\t\tmainArray[i * gameSize.y + row] = tempRow[i]\n\t\t\nfunc findBallByName(name):\n\tvar index = 0\n\tfor b in mainArray:\n\t\tif b == name:\n\t\t\tvar col = int(index \/ gameSize.y)\n\t\t\tvar row = (index - col * gameSize.y)\n\t\t\treturn(Vector2(col,row))\n\t\tindex += 1\n\n#\u041f\u0435\u0440\u0435\u043c\u0456\u0448\u0430\u0442\u0438 \u043a\u0443\u043b\u044c\u043a\u0438\nfunc shuffleBalls():\n\tvar shuffledList = [] \n\tvar indexList = range(mainArray.size())\n\tfor i in range(mainArray.size()):\n\t\tvar x = randi()%indexList.size()\n\t\tshuffledList.append(mainArray[indexList[x]])\n\t\tindexList.remove(x)\n\tmainArray = shuffledList\n\n\n#\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044f \u043f\u043e\u0437\u0438\u0446\u0456\u0439 \u043a\u0443\u043b\u044c\u043e\u043a\nfunc updateBalls():\n\tvar index = 0\n\tvar table = []\n\tfor b in mainArray:\n\t\tvar col = int(index \/ gameSize.y)\n\t\tvar row = (index - col * gameSize.y)\n\t\tvar name = \"b\" + mainArray[index]\n\t\tif not get_node(\"balls\/\" + name):\n\t\t\tcreateBall(name)\n\t\tget_node(\"balls\" + \"\/b\" + mainArray[index]).set_pos(Vector2(col * (BALL_SIZE), row * (BALL_SIZE)))\n\t\tindex += 1\n\n#\u041e\u0431\u0440\u043e\u0431\u043a\u0430 \u0441\u0438\u0433\u043d\u0430\u043b\u0456\u0432 \u043a\u043d\u043e\u043f\u043e\u043a\nfunc _signal_arrow(rowDir):\n\tshiftRow(abs(rowDir) - 1, sign(int(rowDir)))\n\tupdateBalls()\n\nfunc cutCol(ball):\n\tvar column = []\n\tvar i\n\tfor b in range(gameSize.y):\n\t\ti = b + (ball.x * gameSize.y)\n\t\tcolumn.append(mainArray[i])\n\tvar empty = findBallByName('')\n\n\tvar dir = 1\n\tif empty.y > ball.y:\n\t\tdir = -1\n\ti = empty.y\n\twhile(i != ball.y):\n\t\tcolumn[i] = column[i + dir]\n\t\t\n\t\ti += dir\n\tcolumn[ball.y] = ''\n\n\n\tfor b in range(gameSize.y):\n\t\ti = b + (ball.x * gameSize.y)\n\t\tmainArray[i] = column[b]\n\nfunc _signal_ballClicked(name):\n\tif name != 'b':\n\t\tname = name[1] + name[2]\n\t\tballPressedName = name\n\telse:\n\t\tballPressedName = ''\n\tballPressed = true\n","old_contents":"extends Node2D\nvar mainArray = []\nconst BALL_SIZE = 64\nvar ballObj = load(\"res:\/\/objects\/ball.tscn\")\nvar ballPressed = false\nvar ballPressedName = ''\nvar shiftPressed = Vector2(0,0)\n\nfunc _fixed_process(delta):\n\tvar mouse = get_viewport().get_mouse_pos()\n\n\tvar ballPressedPos = findBallByName(ballPressedName)\n\t\n\tif ballPressed:\n\n\t\tvar mouseOnGrid = Vector2(0,0)\n\t\tvar onGrid = Vector2(0,0)\n\n\t\tmouseOnGrid.x = int((mouse.x - ballPressedPos.x) \/ 64) - 1 \n\t\tmouseOnGrid.y = int((mouse.y - 32 - ballPressedPos.y) \/ 64)\n\n\t\tonGrid.x = (int((mouse.x - ballPressedPos.x) \/ 64) - 1) - ballPressedPos.x\n\t\tonGrid.y = int((mouse.y - 32 - ballPressedPos.y) \/ 64) - ballPressedPos.y\n\n\t\tif onGrid.x != 0:\n\t\t\tvar ballsToShift = []\n\t\t\tif ballPressedPos.y > 6:\n\t\t\t\tballsToShift.append(get_node(\"balls\/b\" + ballPressedName))\n\t\t\telse:\n\t\t\t\tfor i in range(6):\n\t\t\t\t\tvar b = get_node(\"balls\/b\" + mainArray[i * 7 + ballPressedPos.y])\n\t\t\t\t\tballsToShift.append(b)\n\t\t\tfor i in range(ballsToShift.size()):\n\n\t\t\t\tvar b = get_node(\"balls\/b\" + mainArray[mainArray.size() - 1])\n\t\t\t\tif ballPressedPos.y < 7:\n\t\t\t\t\tb = get_node(\"balls\/b\" + mainArray[i * 7 + ballPressedPos.y])\n\t\t\t\tvar pos = b.get_pos()\n\t\t\t\tpos.x = i * 64 + mouseOnGrid.x * 64 - ballPressedPos.x * 64\n\t\t\t\tif ballPressedPos.y > 6:\n\t\t\t\t\tpos.x = i * 64 + mouseOnGrid.x * 64\n\t\t\t\tif pos.x > 64 * 6 - 32:\n\t\t\t\t\tpos.x -= 64 * 6\n\t\t\t\telif pos.x < 0:\n\t\t\t\t\tpos.x += 64 * 6\n\t\t\t\tb.set_pos(pos)\n\t\t\tshiftPressed = Vector2(ballPressedPos.y, onGrid.x)\n\nfunc _ready():\n\trandomize()\n\tset_process_input(true)\n\tset_fixed_process(true)\n#\u041a\u043b\u044e\u0447\u043e\u0432\u0438\u0439 \u043c\u0430\u0441\u0438\u0432, \u0432 \u043a\u043e\u0442\u0440\u043e\u043c\u0443 \u0437\u0431\u0435\u0440\u0456\u0433\u0430\u044e\u0442\u044c\u0441\u044f \u0434\u0430\u043d\u0456 \u043f\u0440\u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044f \u043a\u043e\u043b\u044c\u043e\u0440\u043e\u0432\u0438\u0445 \u043a\u0443\u043b\u044c\u043e\u043a\n\tmainArray = [ 'r1', 'r2', 'r3', 'r4', 'r5', 'r6', 'r7',\n\t\t\t\t 'o1', 'o2', 'o3', 'o4', 'o5', 'o6', 'o7',\n\t\t\t\t 'y1', 'y2', 'y3', 'y4', 'y5', 'y6', 'y7',\n\t\t\t\t 'g1', 'g2', 'g3', 'g4', 'g5', 'g6', 'g7',\n\t\t\t\t 'b1', 'b2', 'b3', 'b4', 'b5', 'b6', 'b7',\n\t\t\t\t 'p1', 'p2', 'p3', 'p4', 'p5', 'p6', ''] \n#\u0421\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f \u043a\u0443\u043b\u044c\u043e\u043a \u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u043d\u043e \u0434\u043e \u043a\u043b\u044e\u0447\u043e\u0432\u043e\u0433\u043e \u043c\u0430\u0441\u0438\u0432\u0443\n\tshuffleBalls()\n\tupdateBalls()\n\t\n#\u041e\u0431\u0440\u043e\u0431\u043a\u0430 \u043f\u043e\u0434\u0456\u0439 (\u043d\u0430\u0442\u0438\u0441\u043a\u0430\u043d\u043d\u044f \u043a\u043b\u0430\u0432\u0456\u0448)\nfunc _input(event):\n\tif event.is_action_released(\"space\"): \n\t\tshuffleBalls()\n\t\tupdateBalls()\n\tif event.is_action_released(\"LMB\"):\n\n\t\tif shiftPressed.y != 0:\n\t\t\tshiftRow(shiftPressed.x, shiftPressed.y)\n\t\telse:\n\t\t\tif findBallByName('').x == findBallByName(ballPressedName).x and ballPressed:\n\n\t\t\t\tvar sCol = findBallByName(ballPressedName).x\n\t\t\t\tcutCol(findBallByName(ballPressedName))\n\t\t\t\tupdateBalls()\n\t\tballPressed = false\n\t\tupdateBalls()\n\t\tshiftPressed = Vector2(0,0)\n\n#\u0421\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f \u043e\u0434\u043d\u0456\u0454\u0457 \u043a\u0443\u043b\u044c\u043a\u0438 \u0437\u0430 \u0437\u0430\u0434\u0430\u043d\u0438\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438\nfunc createBall(name):\n\tvar balls = get_node(\"balls\")\n\tvar ball = ballObj.instance()\n\tball.set_name(name)\n\tballs.add_child(ball)\n\tvar color = Color(0,0,0,1)\n\tif name != 'b':\n\t\tcolor = toColor(name[1])\n\tball.setColor(color)\n\t\n#\u041f\u0435\u0440\u0435\u0444\u0430\u0440\u0431\u0443\u0432\u0430\u043d\u043d\u044f \u043a\u0443\u043b\u044c\u043e\u043a \u0443 \u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u043d\u0456\u0441\u0442\u044c \u0434\u043e \u0437\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0445 \u0432 \u043a\u043b\u044e\u0447\u043e\u0432\u043e\u043c\u0443 \u043c\u0430\u0441\u0438\u0432\u0456 \u043a\u043e\u043b\u044c\u043e\u0440\u0456\u0432\nfunc toColor(colorMark):\n\tvar color = Color(1,0,1,1)\n\tif not colorMark: \t\t\t#\u041f\u043e\u0440\u043e\u0436\u043d\u044f \u043a\u043e\u043c\u0456\u0440\u043a\u0430\n\t\tcolor = Color(1,1,0,1)\n\telif colorMark == 'r':\t\t#\u0427\u0435\u0440\u0432\u043e\u043d\u0456\n\t\tcolor = Color(1,0,0,1)\n\telif colorMark == 'g':\t\t#\u0417\u0435\u043b\u0435\u043d\u0456\n\t\tcolor = Color(0,0.6,0,1)\n\telif colorMark == 'b':\t\t#\u0421\u0438\u043d\u0456\n\t\tcolor = Color(0,0,1,1)\n\telif colorMark == 'o':\t\t#\u041f\u043e\u043c\u0430\u0440\u0430\u043d\u0447\u0435\u0432\u0456\n\t\tcolor = Color(1.0, 0.5, 0.0, 1.0)\n\telif colorMark == 'y':\t\t#\u0416\u043e\u0432\u0442\u0456\n\t\tcolor = Color(0.65, 0.65, 0.0, 1.0)\n\telif colorMark == 'p':\t\t#\u0424\u0456\u043e\u043b\u0435\u0442\u043e\u0432\u0456\n\t\tcolor = Color(0.65, 0.0, 0.65, 1.0)\n\treturn color\n\n#\u0417\u043c\u0456\u0449\u0435\u043d\u043d\u044f \u0440\u044f\u0434\u043a\u0430 \u043b\u0456\u0432\u043e\u0440\u0443\u0447 \u0430\u0431\u043e \u043f\u0440\u0430\u0432\u043e\u0440\u0443\u0447\nfunc shiftRow(row, dir):\n\tvar tempRow = []\n\tfor i in range(6):\n\t\ttempRow.append(mainArray[i * 7 + row])\n\tvar tail\n\tif dir < 0:\n\t\tfor j in range(abs(dir)):\n\t\t\ttail = tempRow[0]\n\t\t\tfor i in range(tempRow.size() - 1):\n\t\t\t\ttempRow[i] = tempRow[i+1]\n\t\t\ttempRow[tempRow.size() - 1] = tail\n\telif dir > 0:\n\t\tfor j in range(abs(dir)):\n\t\t\ttail = tempRow[tempRow.size() - 1]\n\t\t\tfor i in range((tempRow.size() - 1), 0 , -1):\n\t\t\t\ttempRow[i] = tempRow[i - 1]\n\t\t\ttempRow[0] = tail\n\tfor i in range(6):\n\t\tmainArray[i * 7 + row] = tempRow[i]\n\t\t\nfunc findBallByName(name):\n\tvar index = 0\n\tfor b in mainArray:\n\t\tif b == name:\n\t\t\tvar col = int(index \/ 7)\n\t\t\tvar row = (index - col * 7)\n\t\t\treturn(Vector2(col,row))\n\t\tindex += 1\n\n#\u041f\u0435\u0440\u0435\u043c\u0456\u0448\u0430\u0442\u0438 \u043a\u0443\u043b\u044c\u043a\u0438\nfunc shuffleBalls():\n\tvar shuffledList = [] \n\tvar indexList = range(mainArray.size())\n\tfor i in range(mainArray.size()):\n\t\tvar x = randi()%indexList.size()\n\t\tshuffledList.append(mainArray[indexList[x]])\n\t\tindexList.remove(x)\n\tmainArray = shuffledList\n\n\n#\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044f \u043f\u043e\u0437\u0438\u0446\u0456\u0439 \u043a\u0443\u043b\u044c\u043e\u043a\nfunc updateBalls():\n\tvar index = 0\n\tvar table = []\n\tfor b in mainArray:\n\t\tvar col = int(index \/ 7)\n\t\tvar row = (index - col * 7)\n\t\tvar name = \"b\" + mainArray[index]\n\t\tif not get_node(\"balls\/\" + name):\n\t\t\tcreateBall(name)\n\t\tget_node(\"balls\" + \"\/b\" + mainArray[index]).set_pos(Vector2(col * (BALL_SIZE), row * (BALL_SIZE)))\n\t\tindex += 1\n\n#\u041e\u0431\u0440\u043e\u0431\u043a\u0430 \u0441\u0438\u0433\u043d\u0430\u043b\u0456\u0432 \u043a\u043d\u043e\u043f\u043e\u043a\nfunc _signal_arrow(rowDir):\n\tshiftRow(abs(rowDir) - 1, sign(int(rowDir)))\n\tupdateBalls()\n\nfunc cutCol(ball):\n\tvar column = []\n\tvar i\n\tfor b in range(7):\n\t\ti = b + (ball.x * 7)\n\t\tcolumn.append(mainArray[i])\n\tvar empty = findBallByName('')\n\n\tvar dir = 1\n\tif empty.y > ball.y:\n\t\tdir = -1\n\ti = empty.y\n\twhile(i != ball.y):\n\t\tcolumn[i] = column[i + dir]\n\t\t\n\t\ti += dir\n\tcolumn[ball.y] = ''\n\n\n\tfor b in range(7):\n\t\ti = b + (ball.x * 7)\n\t\tmainArray[i] = column[b]\n\nfunc _signal_ballClicked(name):\n\tif name != 'b':\n\t\tname = name[1] + name[2]\n\t\tballPressedName = name\n\telse:\n\t\tballPressedName = ''\n\tballPressed = true\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"6744901684b7062a3d4b5357b6eb52d5d5e001e3","subject":"Speak bug with timers","message":"Speak bug with timers\n","repos":"P1X-in\/rat-is-fat","old_file":"scripts\/enemies\/grumpy_prime.gd","new_file":"scripts\/enemies\/grumpy_prime.gd","new_contents":"extends \"res:\/\/scripts\/enemies\/abstract_boss.gd\"\n\n\nconst THRASH_AMOUNT = 2\nvar THRASH_SPAWN_TIME = 5\nvar VULNERABLE_TIME = 3.5\nvar RAINBOW_DELAY = 5\nvar thrash_template = 'fat_rat'\n\n\nvar shield_points = [\n Vector2(17, 3),\n Vector2(17, 8),\n Vector2(2, 8),\n]\nvar shield_points_global = []\n\nvar shield\nvar angry_body = null\nvar rainbow_spawned = true\nvar rainbow = 'rainbow'\n\nfunc _init(bag).(bag):\n self.avatar = preload(\"res:\/\/scenes\/enemies\/grumpy_prime.xscn\").instance()\n self.body_part_head = self.avatar.get_node('body')\n self.body_part_body = self.avatar.get_node('body')\n self.body_part_footer = self.avatar.get_node('body')\n self.animations = self.avatar.get_node('body_animations')\n self.angry_body = self.avatar.get_node('angry')\n self.shield = self.avatar.get_node('shield')\n self.hit_particles = self.avatar.get_node('hitparticles')\n self.speech_bubble = self.avatar.get_node('speech')\n\n self.velocity = 25\n self.attack_range = 50\n self.attack_strength = 4\n self.attack_cooldown = 2\n self.max_hp = 200\n self.hp = 200\n self.score = 200\n self.is_invulnerable = true\n\n self.stun_duration = 0.4\n self.mass = 3\n\n self.phase_hp_thresholds = [\n [100, 2],\n ]\n\n for point in self.shield_points:\n self.shield_points_global.push_back(self.bag.room_loader.translate_position(point))\n\nfunc spawn(position):\n .spawn(position)\n self.randomize_movement()\n self.raise_shield()\n self.spawn_thrash()\n self.speak(\"NO\", 2, true)\n\nfunc phase2():\n self.body_part_body.hide()\n self.angry_body.show()\n self.THRASH_SPAWN_TIME = 2.5\n self.VULNERABLE_TIME = 2\n self.RAINBOW_DELAY = 2.5\n self.velocity = 50\n self.speak(\"I had fun once\", 2, true)\n self.bag.timers.set_timeout(2.1, self, \"bugged_speak\")\n\nfunc bugged_speak():\n self.speak(\"It was awful\", 2, true)\n\nfunc process_ai():\n var distance\n\n if self.target == null:\n for player in self.bag.players.players:\n if player.is_playing && player.is_alive:\n distance = self.calculate_distance_to_object(player)\n if distance < self.aggro_range:\n self.target = player\n break\n\n if self.target != null:\n distance = self.calculate_distance_to_object(self.target)\n if not self.target.is_alive || distance > self.aggro_range:\n self.target = null\n elif distance < self.attack_range and not self.is_attack_on_cooldown:\n self.attack()\n\n if not self.rainbow_spawned:\n self.rainbow_spawned = true\n self.bag.timers.set_timeout(self.RAINBOW_DELAY, self, 'spawn_rainbow')\n\nfunc randomize_movement():\n if self.hp < 1:\n return\n\n var direction\n\n var x = randi() % 18 + 1\n var y = randi() % 8 + 1\n\n direction = self.bag.room_loader.translate_position(Vector2(x, y))\n direction = self.cast_movement_vector(direction)\n\n self.movement_vector[0] = direction.x\n self.movement_vector[1] = direction.y\n\nfunc reset_movement():\n return\n\nfunc modify_position(delta):\n var x = self.movement_vector[0]\n var y = self.movement_vector[1]\n var motion = Vector2(x, y) * self.velocity * delta\n self.avatar.move(motion)\n self.flip(self.movement_vector[0])\n if (self.avatar.is_colliding()):\n var n = self.avatar.get_collision_normal()\n motion = n.slide(motion)\n self.avatar.move(motion)\n self.randomize_movement()\n\nfunc external_stun(duration=null):\n if self.is_invulnerable:\n return\n\n .external_stun(duration)\n\nfunc push_back(enemy):\n if self.is_invulnerable:\n return\n\n .push_back(enemy)\n\nfunc schedule_thrash_spawn():\n self.bag.timers.set_timeout(self.THRASH_SPAWN_TIME, self, 'spawn_thrash')\n\nfunc spawn_thrash():\n if self.hp < 1:\n return\n\n var position = self.avatar.get_global_pos()\n var new_guy\n\n for i in range(0, self.THRASH_AMOUNT):\n position = self.avatar.get_global_pos()\n position.x += pow(-1, i) * 30\n position.y += 30\n new_guy = self.bag.enemies.spawn_global(self.thrash_template, position)\n new_guy.is_attack_on_cooldown = true\n new_guy.has_tombstone = false\n new_guy.drop_chance = 0\n self.bag.timers.set_timeout(self.attack_cooldown, new_guy, \"attack_cooled_down\")\n new_guy.make_invulnerable(1)\n\n self.schedule_thrash_spawn()\n\nfunc disable_shield():\n self.is_invulnerable = false\n self.shield.hide()\n self.bag.timers.set_timeout(self.VULNERABLE_TIME, self, 'raise_shield')\n\nfunc raise_shield():\n self.animations.play('shield_on')\n self.bag.timers.set_timeout(0.5, self, 'raise_shield_anim_end')\n\nfunc raise_shield_anim_end():\n self.is_invulnerable = true\n self.rainbow_spawned = false\n self.shield.show()\n\nfunc spawn_rainbow():\n if self.hp < 1:\n return\n\n self.bag.enemies.spawn_global(self.rainbow, self.pick_next_point())\n\nfunc pick_next_point():\n return self.shield_points_global[randi() % self.shield_points_global.size()]\n\n\nfunc flip_body_parts(flip_flag):\n .flip_body_parts(flip_flag)\n self.angry_body.set_flip_h(flip_flag)\n","old_contents":"extends \"res:\/\/scripts\/enemies\/abstract_boss.gd\"\n\n\nconst THRASH_AMOUNT = 2\nvar THRASH_SPAWN_TIME = 5\nvar VULNERABLE_TIME = 3.5\nvar RAINBOW_DELAY = 5\nvar thrash_template = 'fat_rat'\n\n\nvar shield_points = [\n Vector2(17, 3),\n Vector2(17, 8),\n Vector2(2, 8),\n]\nvar shield_points_global = []\n\nvar shield\nvar angry_body = null\nvar rainbow_spawned = true\nvar rainbow = 'rainbow'\n\nfunc _init(bag).(bag):\n self.avatar = preload(\"res:\/\/scenes\/enemies\/grumpy_prime.xscn\").instance()\n self.body_part_head = self.avatar.get_node('body')\n self.body_part_body = self.avatar.get_node('body')\n self.body_part_footer = self.avatar.get_node('body')\n self.animations = self.avatar.get_node('body_animations')\n self.angry_body = self.avatar.get_node('angry')\n self.shield = self.avatar.get_node('shield')\n self.hit_particles = self.avatar.get_node('hitparticles')\n self.speech_bubble = self.avatar.get_node('speech')\n\n self.velocity = 25\n self.attack_range = 50\n self.attack_strength = 4\n self.attack_cooldown = 2\n self.max_hp = 200\n self.hp = 200\n self.score = 200\n self.is_invulnerable = true\n\n self.stun_duration = 0.4\n self.mass = 3\n\n self.phase_hp_thresholds = [\n [100, 2],\n ]\n\n for point in self.shield_points:\n self.shield_points_global.push_back(self.bag.room_loader.translate_position(point))\n\nfunc spawn(position):\n .spawn(position)\n self.randomize_movement()\n self.raise_shield()\n self.spawn_thrash()\n self.speak(\"NO\", 2, true)\n\nfunc phase2():\n self.body_part_body.hide()\n self.angry_body.show()\n self.THRASH_SPAWN_TIME = 2.5\n self.VULNERABLE_TIME = 2\n self.RAINBOW_DELAY = 2.5\n self.velocity = 50\n self.speak(\"I had fun once\", 2, true)\n self.bag.timers.set_timeout(2.1, self, \"speak\", [\"It was awful\", 2, true])\n\nfunc process_ai():\n var distance\n\n if self.target == null:\n for player in self.bag.players.players:\n if player.is_playing && player.is_alive:\n distance = self.calculate_distance_to_object(player)\n if distance < self.aggro_range:\n self.target = player\n break\n\n if self.target != null:\n distance = self.calculate_distance_to_object(self.target)\n if not self.target.is_alive || distance > self.aggro_range:\n self.target = null\n elif distance < self.attack_range and not self.is_attack_on_cooldown:\n self.attack()\n\n if not self.rainbow_spawned:\n self.rainbow_spawned = true\n self.bag.timers.set_timeout(self.RAINBOW_DELAY, self, 'spawn_rainbow')\n\nfunc randomize_movement():\n if self.hp < 1:\n return\n\n var direction\n\n var x = randi() % 18 + 1\n var y = randi() % 8 + 1\n\n direction = self.bag.room_loader.translate_position(Vector2(x, y))\n direction = self.cast_movement_vector(direction)\n\n self.movement_vector[0] = direction.x\n self.movement_vector[1] = direction.y\n\nfunc reset_movement():\n return\n\nfunc modify_position(delta):\n var x = self.movement_vector[0]\n var y = self.movement_vector[1]\n var motion = Vector2(x, y) * self.velocity * delta\n self.avatar.move(motion)\n self.flip(self.movement_vector[0])\n if (self.avatar.is_colliding()):\n var n = self.avatar.get_collision_normal()\n motion = n.slide(motion)\n self.avatar.move(motion)\n self.randomize_movement()\n\nfunc external_stun(duration=null):\n if self.is_invulnerable:\n return\n\n .external_stun(duration)\n\nfunc push_back(enemy):\n if self.is_invulnerable:\n return\n\n .push_back(enemy)\n\nfunc schedule_thrash_spawn():\n self.bag.timers.set_timeout(self.THRASH_SPAWN_TIME, self, 'spawn_thrash')\n\nfunc spawn_thrash():\n if self.hp < 1:\n return\n\n var position = self.avatar.get_global_pos()\n var new_guy\n\n for i in range(0, self.THRASH_AMOUNT):\n position = self.avatar.get_global_pos()\n position.x += pow(-1, i) * 30\n position.y += 30\n new_guy = self.bag.enemies.spawn_global(self.thrash_template, position)\n new_guy.is_attack_on_cooldown = true\n new_guy.has_tombstone = false\n new_guy.drop_chance = 0\n self.bag.timers.set_timeout(self.attack_cooldown, new_guy, \"attack_cooled_down\")\n new_guy.make_invulnerable(1)\n\n self.schedule_thrash_spawn()\n\nfunc disable_shield():\n self.is_invulnerable = false\n self.shield.hide()\n self.bag.timers.set_timeout(self.VULNERABLE_TIME, self, 'raise_shield')\n\nfunc raise_shield():\n self.animations.play('shield_on')\n self.bag.timers.set_timeout(0.5, self, 'raise_shield_anim_end')\n\nfunc raise_shield_anim_end():\n self.is_invulnerable = true\n self.rainbow_spawned = false\n self.shield.show()\n\nfunc spawn_rainbow():\n if self.hp < 1:\n return\n\n self.bag.enemies.spawn_global(self.rainbow, self.pick_next_point())\n\nfunc pick_next_point():\n return self.shield_points_global[randi() % self.shield_points_global.size()]\n\n\nfunc flip_body_parts(flip_flag):\n .flip_body_parts(flip_flag)\n self.angry_body.set_flip_h(flip_flag)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"a5d4ad92aed1876ca50170b6d5ed28687b9c1153","subject":"Fixed Grumpy Prime stopping to spawn adds","message":"Fixed Grumpy Prime stopping to spawn adds\n","repos":"P1X-in\/rat-is-fat","old_file":"scripts\/enemies\/grumpy_prime.gd","new_file":"scripts\/enemies\/grumpy_prime.gd","new_contents":"extends \"res:\/\/scripts\/enemies\/abstract_boss.gd\"\n\n\nconst THRASH_AMOUNT = 2\nvar THRASH_SPAWN_TIME = 5\nvar VULNERABLE_TIME = 3.5\nvar RAINBOW_DELAY = 5\nvar thrash_template = 'fat_rat'\n\n\nvar shield_points = [\n Vector2(17, 3),\n Vector2(17, 8),\n Vector2(2, 8),\n]\nvar shield_points_global = []\n\nvar shield\nvar angry_body = null\nvar rainbow_spawned = true\nvar rainbow = 'rainbow'\n\nfunc _init(bag).(bag):\n self.avatar = preload(\"res:\/\/scenes\/enemies\/grumpy_prime.xscn\").instance()\n self.body_part_head = self.avatar.get_node('body')\n self.body_part_body = self.avatar.get_node('body')\n self.body_part_footer = self.avatar.get_node('body')\n self.animations = self.avatar.get_node('body_animations')\n self.angry_body = self.avatar.get_node('angry')\n self.shield = self.avatar.get_node('shield')\n\n self.velocity = 25\n self.attack_range = 50\n self.attack_strength = 4\n self.attack_cooldown = 2\n self.max_hp = 200\n self.hp = 200\n self.score = 200\n self.is_invulnerable = true\n\n self.stun_duration = 0.4\n self.mass = 3\n\n self.phase_hp_thresholds = [\n [100, 2],\n ]\n\n for point in self.shield_points:\n self.shield_points_global.push_back(self.bag.room_loader.translate_position(point))\n\nfunc spawn(position):\n .spawn(position)\n self.randomize_movement()\n self.raise_shield()\n self.spawn_thrash()\n\nfunc phase2():\n self.body_part_body.hide()\n self.angry_body.show()\n self.THRASH_SPAWN_TIME = 2.5\n self.VULNERABLE_TIME = 2\n self.RAINBOW_DELAY = 2.5\n self.velocity = 50\n\nfunc process_ai():\n var distance\n\n if self.target == null:\n for player in self.bag.players.players:\n if player.is_playing && player.is_alive:\n distance = self.calculate_distance_to_object(player)\n if distance < self.aggro_range:\n self.target = player\n break\n\n if self.target != null:\n distance = self.calculate_distance_to_object(self.target)\n if not self.target.is_alive || distance > self.aggro_range:\n self.target = null\n elif distance < self.attack_range and not self.is_attack_on_cooldown:\n self.attack()\n\n if not self.rainbow_spawned:\n self.rainbow_spawned = true\n self.bag.timers.set_timeout(self.RAINBOW_DELAY, self, 'spawn_rainbow')\n\nfunc randomize_movement():\n if self.hp < 1:\n return\n\n var direction\n\n var x = randi() % 18 + 1\n var y = randi() % 8 + 1\n\n direction = self.bag.room_loader.translate_position(Vector2(x, y))\n direction = self.cast_movement_vector(direction)\n\n self.movement_vector[0] = direction.x\n self.movement_vector[1] = direction.y\n\nfunc reset_movement():\n return\n\nfunc modify_position(delta):\n var x = self.movement_vector[0]\n var y = self.movement_vector[1]\n var motion = Vector2(x, y) * self.velocity * delta\n self.avatar.move(motion)\n self.flip(self.movement_vector[0])\n if (self.avatar.is_colliding()):\n var n = self.avatar.get_collision_normal()\n motion = n.slide(motion)\n self.avatar.move(motion)\n self.randomize_movement()\n\nfunc external_stun(duration=null):\n if self.is_invulnerable:\n return\n\n .external_stun(duration)\n\nfunc push_back(enemy):\n if self.is_invulnerable:\n return\n\n .push_back(enemy)\n\nfunc schedule_thrash_spawn():\n self.bag.timers.set_timeout(self.THRASH_SPAWN_TIME, self, 'spawn_thrash')\n\nfunc spawn_thrash():\n if self.hp < 1:\n return\n\n var position = self.avatar.get_global_pos()\n var new_guy\n\n for i in range(0, self.THRASH_AMOUNT):\n position = self.avatar.get_global_pos()\n position.x += pow(-1, i) * 30\n position.y += 30\n new_guy = self.bag.enemies.spawn_global(self.thrash_template, position)\n new_guy.is_attack_on_cooldown = true\n self.bag.timers.set_timeout(self.attack_cooldown, new_guy, \"attack_cooled_down\")\n new_guy.make_invulnerable(1)\n\n self.schedule_thrash_spawn()\n\nfunc disable_shield():\n self.is_invulnerable = false\n self.shield.hide()\n self.bag.timers.set_timeout(self.VULNERABLE_TIME, self, 'raise_shield')\n\nfunc raise_shield():\n self.animations.play('shield_on')\n self.bag.timers.set_timeout(0.5, self, 'raise_shield_anim_end')\n\nfunc raise_shield_anim_end():\n self.is_invulnerable = true\n self.rainbow_spawned = false\n self.shield.show()\n\nfunc spawn_rainbow():\n if self.hp < 1:\n return\n\n self.bag.enemies.spawn_global(self.rainbow, self.pick_next_point())\n\nfunc pick_next_point():\n return self.shield_points_global[randi() % self.shield_points_global.size()]\n\n\nfunc flip_body_parts(flip_flag):\n .flip_body_parts(flip_flag)\n self.angry_body.set_flip_h(flip_flag)\n","old_contents":"extends \"res:\/\/scripts\/enemies\/abstract_boss.gd\"\n\n\nconst THRASH_AMOUNT = 2\nvar THRASH_SPAWN_TIME = 5\nvar VULNERABLE_TIME = 3.5\nvar RAINBOW_DELAY = 5\nvar thrash_template = 'fat_rat'\n\n\nvar shield_points = [\n Vector2(17, 3),\n Vector2(17, 8),\n Vector2(2, 8),\n]\nvar shield_points_global = []\n\nvar shield\nvar angry_body = null\nvar rainbow_spawned = true\nvar rainbow = 'rainbow'\n\nfunc _init(bag).(bag):\n self.avatar = preload(\"res:\/\/scenes\/enemies\/grumpy_prime.xscn\").instance()\n self.body_part_head = self.avatar.get_node('body')\n self.body_part_body = self.avatar.get_node('body')\n self.body_part_footer = self.avatar.get_node('body')\n self.animations = self.avatar.get_node('body_animations')\n self.angry_body = self.avatar.get_node('angry')\n self.shield = self.avatar.get_node('shield')\n\n self.velocity = 25\n self.attack_range = 50\n self.attack_strength = 4\n self.attack_cooldown = 2\n self.max_hp = 200\n self.hp = 200\n self.score = 200\n self.is_invulnerable = true\n\n self.stun_duration = 0.4\n self.mass = 3\n\n self.phase_hp_thresholds = [\n [100, 2],\n ]\n\n for point in self.shield_points:\n self.shield_points_global.push_back(self.bag.room_loader.translate_position(point))\n\nfunc spawn(position):\n .spawn(position)\n self.randomize_movement()\n self.raise_shield()\n self.spawn_thrash()\n\nfunc phase2():\n self.body_part_body.hide()\n self.angry_body.show()\n self.THRASH_SPAWN_TIME = 2.5\n self.VULNERABLE_TIME = 2\n self.RAINBOW_DELAY = 2.5\n self.velocity = 50\n\nfunc process_ai():\n var distance\n\n if self.target == null:\n for player in self.bag.players.players:\n if player.is_playing && player.is_alive:\n distance = self.calculate_distance_to_object(player)\n if distance < self.aggro_range:\n self.target = player\n break\n\n if self.target != null:\n distance = self.calculate_distance_to_object(self.target)\n if not self.target.is_alive || distance > self.aggro_range:\n self.target = null\n elif distance < self.attack_range and not self.is_attack_on_cooldown:\n self.attack()\n\n if not self.rainbow_spawned:\n self.rainbow_spawned = true\n self.bag.timers.set_timeout(self.RAINBOW_DELAY, self, 'spawn_rainbow')\n\nfunc randomize_movement():\n if self.hp < 1:\n return\n\n var direction\n\n var x = randi() % 18 + 1\n var y = randi() % 8 + 1\n\n direction = self.bag.room_loader.translate_position(Vector2(x, y))\n direction = self.cast_movement_vector(direction)\n\n self.movement_vector[0] = direction.x\n self.movement_vector[1] = direction.y\n\nfunc reset_movement():\n return\n\nfunc modify_position(delta):\n var x = self.movement_vector[0]\n var y = self.movement_vector[1]\n var motion = Vector2(x, y) * self.velocity * delta\n self.avatar.move(motion)\n self.flip(self.movement_vector[0])\n if (self.avatar.is_colliding()):\n var n = self.avatar.get_collision_normal()\n motion = n.slide(motion)\n self.avatar.move(motion)\n self.randomize_movement()\n\nfunc external_stun(duration=null):\n if self.is_invulnerable:\n return\n\n .external_stun(duration)\n\nfunc push_back(enemy):\n if self.is_invulnerable:\n return\n\n .push_back(enemy)\n\nfunc schedule_thrash_spawn():\n self.bag.timers.set_timeout(self.THRASH_SPAWN_TIME, self, 'spawn_thrash')\n\nfunc spawn_thrash():\n if self.hp < 1 or not self.is_processing:\n return\n\n var position = self.avatar.get_global_pos()\n var new_guy\n\n for i in range(0, self.THRASH_AMOUNT):\n position = self.avatar.get_global_pos()\n position.x += pow(-1, i) * 30\n position.y += 30\n new_guy = self.bag.enemies.spawn_global(self.thrash_template, position)\n new_guy.is_attack_on_cooldown = true\n self.bag.timers.set_timeout(self.attack_cooldown, new_guy, \"attack_cooled_down\")\n new_guy.make_invulnerable(1)\n\n self.schedule_thrash_spawn()\n\nfunc disable_shield():\n self.is_invulnerable = false\n self.shield.hide()\n self.bag.timers.set_timeout(self.VULNERABLE_TIME, self, 'raise_shield')\n\nfunc raise_shield():\n self.animations.play('shield_on')\n self.bag.timers.set_timeout(0.5, self, 'raise_shield_anim_end')\n\nfunc raise_shield_anim_end():\n self.is_invulnerable = true\n self.rainbow_spawned = false\n self.shield.show()\n\nfunc spawn_rainbow():\n if self.hp < 1:\n return\n\n self.bag.enemies.spawn_global(self.rainbow, self.pick_next_point())\n\nfunc pick_next_point():\n return self.shield_points_global[randi() % self.shield_points_global.size()]\n\n\nfunc flip_body_parts(flip_flag):\n .flip_body_parts(flip_flag)\n self.angry_body.set_flip_h(flip_flag)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"453495957a287b0f1280cde134c87eaab1717fa9","subject":"Fixed room loader","message":"Fixed room loader\n","repos":"P1X-in\/rat-is-fat","old_file":"scripts\/map\/room_loader.gd","new_file":"scripts\/map\/room_loader.gd","new_contents":"\n\nvar bag\nvar tilemap\nvar room_max_size = Vector2(20, 12)\nvar side_offset = 3\nvar DOORS_CLOSED = 3\nvar DOORS_OPEN = 2\n\nvar spawns = {\n 'initial0' : Vector2(8, 5),\n 'initial1' : Vector2(9, 5),\n 'initial2' : Vector2(8, 6),\n 'initial3' : Vector2(9, 6),\n 'north0' : Vector2(8, 1),\n 'north1' : Vector2(9, 1),\n 'north2' : Vector2(8, 2),\n 'north3' : Vector2(9, 2),\n 'south0' : Vector2(8, 9),\n 'south1' : Vector2(9, 9),\n 'south2' : Vector2(8, 8),\n 'south3' : Vector2(9, 8),\n 'east0' : Vector2(15, 5),\n 'east1' : Vector2(14, 5),\n 'east2' : Vector2(15, 6),\n 'east3' : Vector2(14, 6),\n 'west0' : Vector2(1, 5),\n 'west1' : Vector2(2, 5),\n 'west2' : Vector2(1, 6),\n 'west3' : Vector2(2, 6),\n}\n\nvar room_templates = {\n 'start' : preload(\"res:\/\/scripts\/map\/rooms\/start_room.gd\"),\n 'easy1' : preload(\"res:\/\/scripts\/map\/rooms\/easy1_room.gd\"),\n 'easy2' : preload(\"res:\/\/scripts\/map\/rooms\/easy2_room.gd\"),\n 'easy3' : preload(\"res:\/\/scripts\/map\/rooms\/easy3_room.gd\"),\n 'easy4' : preload(\"res:\/\/scripts\/map\/rooms\/easy4_room.gd\"),\n 'easy5' : preload(\"res:\/\/scripts\/map\/rooms\/easy5_room.gd\"),\n 'easy6' : preload(\"res:\/\/scripts\/map\/rooms\/easy6_room.gd\"),\n 'boss1' : preload(\"res:\/\/scripts\/map\/rooms\/boss1_room.gd\"),\n 'boss2' : preload(\"res:\/\/scripts\/map\/rooms\/boss2_room.gd\"),\n}\n\nvar difficulty_templates = [\n ['start'],\n ['easy1', 'easy2', 'easy4', 'easy5', 'easy6'],\n ['easy2', 'easy3', 'easy4', 'easy6'],\n]\n\nvar difficulty_bosses = [\n [],\n ['boss1'],\n ['boss2'],\n]\n\n\nvar door_definitions = {\n 'north' : [\n [0, 0, 14, 21],\n [1, 0, 0, 19],\n [2, 0, 13, 20],\n ],\n 'south' : [\n [0, 0, 16, 26],\n [1, 0, 0, 27],\n [2, 0, 15, 28],\n ],\n 'east' : [\n [0, 0, 13, 17],\n [0, 1, 0, 22],\n [0, 2, 15, 24],\n ],\n 'west' : [\n [0, 0, 14, 18],\n [0, 1, 0, 23],\n [0, 2, 16, 25],\n ],\n}\n\nfunc _init_bag(bag):\n self.bag = bag\n self.tilemap = self.bag.action_controller.tilemap\n\nfunc load_room(cell):\n var template_name = cell.template_name\n var data\n self.clear_space()\n self.bag.game_state.current_room = self.room_templates[template_name].new()\n data = self.create_passages(self.bag.game_state.current_room.room, cell)\n self.apply_room_data(data)\n if self.bag.game_state.current_room.enemies.size() > 0 && not cell.clear:\n self.spawn_enemies(self.bag.game_state.current_room.enemies)\n self.close_doors()\n else:\n self.open_doors()\n self.bag.items.reset()\n if cell.items_loaded:\n self.load_previous_items(cell.items)\n else:\n self.spawn_items(self.bag.game_state.current_room.items, cell)\n cell.items_loaded = true\n\nfunc create_passages(data, cell):\n if cell.north != null:\n data = self.open_passage(data, self.door_definitions['north'], 7, 0)\n if cell.south != null:\n data = self.open_passage(data, self.door_definitions['south'], 7, 10)\n if cell.east != null:\n data = self.open_passage(data, self.door_definitions['east'], 16, 4)\n if cell.west != null:\n data = self.open_passage(data, self.door_definitions['west'], 0, 4)\n return data\n\nfunc open_passage(data, passage, x, y):\n for tile in passage:\n data[tile[1] + y][tile[0] + x] = tile[2]\n return data\n\nfunc close_doors():\n self.bag.game_state.doors_open = false\n self.switch_doors(self.DOORS_CLOSED)\n\nfunc open_doors():\n self.bag.game_state.doors_open = true\n self.switch_doors(self.DOORS_OPEN)\n\nfunc switch_custom_doors(tile_index):\n for custom_door in self.bag.game_state.current_room.doors:\n self.apply_door(self.door_definitions[custom_door[2]], tile_index, custom_door[0], custom_door[1])\n\nfunc switch_doors(tile_index):\n var cell = self.bag.game_state.current_cell\n if cell.north != null:\n self.apply_door(self.door_definitions['north'], tile_index, 7, 0)\n if cell.south != null:\n self.apply_door(self.door_definitions['south'], tile_index, 7, 10)\n if cell.east != null:\n self.apply_door(self.door_definitions['east'], tile_index, 16, 4)\n if cell.west != null:\n self.apply_door(self.door_definitions['west'], tile_index, 0, 4)\n self.switch_custom_doors(tile_index)\n\nfunc apply_door(definition, tile_index, x, y):\n for tile in definition:\n self.tilemap.set_cell(tile[0] + self.side_offset + x, tile[1] + y, tile[tile_index])\n\nfunc clear_space():\n for x in range(self.room_max_size.x):\n for y in range(self.room_max_size.y):\n self.tilemap.set_cell(x, y, -1)\n\nfunc apply_room_data(data):\n var row\n for y in range(0, data.size()):\n row = data[y]\n for x in range(0, row.size()):\n self.tilemap.set_cell(x + self.side_offset, y, data[y][x])\n\nfunc spawn_enemies(enemies):\n var position = Vector2(0, 0)\n self.bag.enemies.reset()\n for enemy_data in enemies:\n position.x = enemy_data[0] + self.side_offset\n position.y = enemy_data[1]\n self.bag.enemies.spawn(enemy_data[2], position)\n\nfunc spawn_items(items, cell):\n var position = Vector2(0, 0)\n for item_data in items:\n position.x = item_data[0] + self.side_offset\n position.y = item_data[1]\n cell.add_item(self.bag.items.spawn(item_data[2], position))\n\nfunc load_previous_items(items):\n for item in items:\n items[item].attach()\n self.bag.items.add_item(items[item])\n\nfunc get_spawn_position(spawn_name):\n var position = self.bag.room_loader.spawns[spawn_name]\n position.x = position.x + self.side_offset\n return self.translate_position(position)\n\nfunc translate_position(position):\n return self.tilemap.map_to_world(position)","old_contents":"\n\nvar bag\nvar tilemap\nvar room_max_size = Vector2(20, 12)\nvar side_offset = 3\nvar DOORS_CLOSED = 3\nvar DOORS_OPEN = 2\n\nvar spawns = {\n 'initial0' : Vector2(8, 5),\n 'initial1' : Vector2(9, 5),\n 'initial2' : Vector2(8, 6),\n 'initial3' : Vector2(9, 6),\n 'north0' : Vector2(8, 1),\n 'north1' : Vector2(9, 1),\n 'north2' : Vector2(8, 2),\n 'north3' : Vector2(9, 2),\n 'south0' : Vector2(8, 9),\n 'south1' : Vector2(9, 9),\n 'south2' : Vector2(8, 8),\n 'south3' : Vector2(9, 8),\n 'east0' : Vector2(15, 5),\n 'east1' : Vector2(14, 5),\n 'east2' : Vector2(15, 6),\n 'east3' : Vector2(14, 6),\n 'west0' : Vector2(1, 5),\n 'west1' : Vector2(2, 5),\n 'west2' : Vector2(1, 6),\n 'west3' : Vector2(2, 6),\n}\n\nvar room_templates = {\n 'start' : preload(\"res:\/\/scripts\/map\/rooms\/start_room.gd\"),\n 'easy1' : preload(\"res:\/\/scripts\/map\/rooms\/easy1_room.gd\"),\n 'easy2' : preload(\"res:\/\/scripts\/map\/rooms\/easy2_room.gd\"),\n 'easy3' : preload(\"res:\/\/scripts\/map\/rooms\/easy3_room.gd\"),\n 'easy4' : preload(\"res:\/\/scripts\/map\/rooms\/easy4_room.gd\"),\n 'easy5' : preload(\"res:\/\/scripts\/map\/rooms\/easy5_room.gd\"),\n 'easy6' : preload(\"res:\/\/scripts\/map\/rooms\/easy6_room.gd\"),\n 'boss1' : preload(\"res:\/\/scripts\/map\/rooms\/boss1_room.gd\"),\n 'boss2' : preload(\"res:\/\/scripts\/map\/rooms\/boss2_room.gd\"),\n}\n\nvar difficulty_templates = [\n ['start'],\n ['easy1', 'easy2', 'easy4', 'easy5', 'easy6'],\n ['easy2', 'easy3', 'easy4', 'easy6'],\n]\n\nvar difficulty_bosses = [\n [],\n ['boss1']\n ['boss2']\n]\n\n\nvar door_definitions = {\n 'north' : [\n [0, 0, 14, 21],\n [1, 0, 0, 19],\n [2, 0, 13, 20],\n ],\n 'south' : [\n [0, 0, 16, 26],\n [1, 0, 0, 27],\n [2, 0, 15, 28],\n ],\n 'east' : [\n [0, 0, 13, 17],\n [0, 1, 0, 22],\n [0, 2, 15, 24],\n ],\n 'west' : [\n [0, 0, 14, 18],\n [0, 1, 0, 23],\n [0, 2, 16, 25],\n ],\n}\n\nfunc _init_bag(bag):\n self.bag = bag\n self.tilemap = self.bag.action_controller.tilemap\n\nfunc load_room(cell):\n var template_name = cell.template_name\n var data\n self.clear_space()\n self.bag.game_state.current_room = self.room_templates[template_name].new()\n data = self.create_passages(self.bag.game_state.current_room.room, cell)\n self.apply_room_data(data)\n if self.bag.game_state.current_room.enemies.size() > 0 && not cell.clear:\n self.spawn_enemies(self.bag.game_state.current_room.enemies)\n self.close_doors()\n else:\n self.open_doors()\n self.bag.items.reset()\n if cell.items_loaded:\n self.load_previous_items(cell.items)\n else:\n self.spawn_items(self.bag.game_state.current_room.items, cell)\n cell.items_loaded = true\n\nfunc create_passages(data, cell):\n if cell.north != null:\n data = self.open_passage(data, self.door_definitions['north'], 7, 0)\n if cell.south != null:\n data = self.open_passage(data, self.door_definitions['south'], 7, 10)\n if cell.east != null:\n data = self.open_passage(data, self.door_definitions['east'], 16, 4)\n if cell.west != null:\n data = self.open_passage(data, self.door_definitions['west'], 0, 4)\n return data\n\nfunc open_passage(data, passage, x, y):\n for tile in passage:\n data[tile[1] + y][tile[0] + x] = tile[2]\n return data\n\nfunc close_doors():\n self.bag.game_state.doors_open = false\n self.switch_doors(self.DOORS_CLOSED)\n\nfunc open_doors():\n self.bag.game_state.doors_open = true\n self.switch_doors(self.DOORS_OPEN)\n\nfunc switch_custom_doors(tile_index):\n for custom_door in self.bag.game_state.current_room.doors:\n self.apply_door(self.door_definitions[custom_door[2]], tile_index, custom_door[0], custom_door[1])\n\nfunc switch_doors(tile_index):\n var cell = self.bag.game_state.current_cell\n if cell.north != null:\n self.apply_door(self.door_definitions['north'], tile_index, 7, 0)\n if cell.south != null:\n self.apply_door(self.door_definitions['south'], tile_index, 7, 10)\n if cell.east != null:\n self.apply_door(self.door_definitions['east'], tile_index, 16, 4)\n if cell.west != null:\n self.apply_door(self.door_definitions['west'], tile_index, 0, 4)\n self.switch_custom_doors(tile_index)\n\nfunc apply_door(definition, tile_index, x, y):\n for tile in definition:\n self.tilemap.set_cell(tile[0] + self.side_offset + x, tile[1] + y, tile[tile_index])\n\nfunc clear_space():\n for x in range(self.room_max_size.x):\n for y in range(self.room_max_size.y):\n self.tilemap.set_cell(x, y, -1)\n\nfunc apply_room_data(data):\n var row\n for y in range(0, data.size()):\n row = data[y]\n for x in range(0, row.size()):\n self.tilemap.set_cell(x + self.side_offset, y, data[y][x])\n\nfunc spawn_enemies(enemies):\n var position = Vector2(0, 0)\n self.bag.enemies.reset()\n for enemy_data in enemies:\n position.x = enemy_data[0] + self.side_offset\n position.y = enemy_data[1]\n self.bag.enemies.spawn(enemy_data[2], position)\n\nfunc spawn_items(items, cell):\n var position = Vector2(0, 0)\n for item_data in items:\n position.x = item_data[0] + self.side_offset\n position.y = item_data[1]\n cell.add_item(self.bag.items.spawn(item_data[2], position))\n\nfunc load_previous_items(items):\n for item in items:\n items[item].attach()\n self.bag.items.add_item(items[item])\n\nfunc get_spawn_position(spawn_name):\n var position = self.bag.room_loader.spawns[spawn_name]\n position.x = position.x + self.side_offset\n return self.translate_position(position)\n\nfunc translate_position(position):\n return self.tilemap.map_to_world(position)","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"76e8543b216ba76a1fe27291ded7f39709a2ff3e","subject":"Move to puzzle.scn instead of network_test","message":"Move to puzzle.scn instead of network_test\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Network.gd","new_file":"src\/scripts\/Network.gd","new_contents":"\nextends Node\n\nconst REMOTE_FINISH = 0\nconst REMOTE_START = 1\nconst REMOTE_QUIT = 2\nconst REMOTE_BLOCK = 4\nconst REMOTE_BLOCK_TRANSFORM = 5\nconst REMOTE_BLOCK_UPDATE = 6\n\nvar port = 54321\nvar root\nvar isNetwork\nvar isHost\nvar isClient = false\nvar server\nvar client\nvar connection\n\nvar remotePuzzle\n\n#Store the peer stream used by both the lcient and server\nvar stream\n\nfunc _ready():\n\tisNetwork = false\n\tisHost = false\n\tget_tree().get_root().get_node(\"GUIManager\/OptionsMenu\/Panel\/PortField\/LineEdit\").set_text(str(port))\n\nfunc setPort(pt):\n\tport = pt;\n\nfunc connectTo(ip, pt):\n\tisClient = true #just to tell if it's doing something :S\n\tconnection = PacketPeerStream.new()\n\tstream = StreamPeerTCP.new()\n\tconnection.set_stream_peer(stream)\n\tstream.connect(ip, pt);\n\t\n\tif stream.get_status() == stream.STATUS_CONNECTED or stream.get_status() == stream.STATUS_CONNECTING:\n\t\tprint(\"Connecting to \" + ip + \":\" + str(port));\n\t\tset_process(true)\n\t\t#leave is_network as false to indicate we're still waiting for connection\n\t\n\t\nfunc host(pt):\n\tserver = TCP_Server.new()\n\tconnection = PacketPeerStream.new()\n\tisHost = true\n\tprint(\"Starting listening server on port \" + str(pt))\n\tif server.listen(pt) == 0:\n\t\tset_process(true)\n\t\tprint(\"Listening...\")\n\telse:\n\t\tprint(\"Failed to start server on port \" + str(pt));\n\t\nfunc _process(delta):\n\tif (isHost):\n\t\t#server processing stuff\n\t\t#use isNetwork to determine if we're still listening\n\t\tif !isNetwork:\n\t\t\tif server.is_connection_available():\n\t\t\t\tstream = server.take_connection()\n\t\t\t\tconnection = PacketPeerStream.new()\n\t\t\t\tconnection.set_stream_peer(stream)\n\t\t\t\tprint(\"Connecting with player...\")\n\t\t\t\tisNetwork = true\n\t\t\t\tserver.stop()\n\t\t\t\tchangeScene(\"res:\/\/puzzle.scn\")\n\t\t\t\tremotePuzzle = root.get_node(\"Spatial\")\n\t\t\t\t#MAKE CALL TO PUZZLE SELECTER\n\t\telse: #not listening anymore, have a client\n\t\t\t#do quick check to make sure we're still\n\t\t\t#connected\n\t\t\tif !stream.is_connected():\n\t\t\t\tprint(\"Lost Connection!\");\n\t\t\t\tisNetwork = false\n\t\t\t\tset_process(false)\n\t\t\t\t#QUIT GAME\n\t\t\t\treturn\n\t\t\t#check if we have any data\n\t\t\tif connection.get_available_packet_count() > 0:\n\t\t\t\t#have to be careful about more than 1 packet per frame\n\t\t\t\tfor i in range(connection.get_available_packet_count()):\n\t\t\t\t\tvar dataArray = connection.get_var()\n\t\t\t\t\tprocessServerData(dataArray)\n\t\t\t\t\t\n\telse:\n\t\t#client processing stuff\n\t\tif !isNetwork:\n\t\t\t#Still waiting for connection confirmed\n\t\t\tif stream.get_status() == stream.STATUS_CONNECTED:\n\t\t\t\tprint(\"Connection established!\")\n\t\t\t\tisNetwork = true\n\t\t\t\tchangeScene(\"res:\/\/puzzle.scn\")\n\t\t\t\tremotePuzzle = root.get_node(\"Spatial\")\n\t\t\t\treturn\n\t\t\tif stream.get_status() == stream.STATUS_NONE or stream.get_status() == stream.STATUS_ERROR:\n\t\t\t\tprint(\"Error establishing connection!\")\n\t\t\t\tset_process(false)\n\t\t\t\treturn\n\t\t\t\t#stop running process loop, cause we have no connection\n\t\telse:\n\t\t\t#connecton established and confirmed. Do regular data processing\n\t\t\t#check if we have any data\n\t\t\tif connection.get_available_packet_count() > 0:\n\t\t\t\tfor i in range(connection.get_available_packet_count()):\n\t\t\t\t\tvar dataArray = connection.get_var()\n\t\t\t\t\tprocessServerData(dataArray)\n\t\t\t\t\t#Call the server process script cuase it's peer to peer and we have the same functions!\n\n\nfunc disconnect():\n\t#need to do lots of things! If the server is open and listening, but has no connection just stop listening!\n\tif isHost and !isNetwork:\n\t\t#this means we're waiting for connection still\n\t\tserver.stop()\n\t\tprint(\"closing server listener!\")\n\telif isHost and isNetwork:\n\t\t#have connections. Need to send them stop packet, and close connection\n\t\tconnection.put_var([REMOTE_QUIT])\n\t\tstream.disconnect()\n\t\tprint(\"Closing connection to remote player...\")\n\telif !isHost and !isNetwork:\n\t\tstream.disconnect()\n\t\tprint(\"Halting connection request...\")\n\telif !isHost and isNetwork:\n\t\t#connected to server already\n\t\tstream.disconnect()\n\t\tprint(\"Disconnecting from server...\")\n\t\n\t#no matter where we wre before disconnect, set network to false and return to beginning screen!\n\tisNetwork = false;\n\tisHost = false;\n\tisClient = false;\n\t\n\tset_process(false)\n\t\n\tchangeScene(\"res:\/\/menus.scn\")\n\n\n\nfunc ProcessServerData(dataArray):\n\t#have an array of data. First element should be identifying int\n\tvar ID = dataArray[0]\n\tprint(ID)\n\t#no swithc statement. I'm crying right now while i type this. My fingers are bleeding\n\tif ID == REMOTE_START:\n\t\t#do start something or something whut\n\t\tprint(\"remote_stuff\")\n\telif ID == REMOTE_FINISH:\n\t\t#again, do ending stuff\n\t\tprint(\"remote_finish: \" + str(dataArray[1]))\n\telif ID == REMOTE_QUIT:\n\t\t#omg those jerks!\n\t\tprint(\"remote_quit\")\n\t\tdisconnect()\n\telif ID == REMOTE_BLOCK:\n\t\t#get their block ifnormation!\n\t\tprint(\"remote_block\")\n\telif ID == REMOTE_BLOCK_TRANSFORM:\n\t\t#sent block information\n\t\tprint(\"block TRANSFORM!!!!!!!!!!!\")\n\t\tvar scale = dataArray[1]\n\t\tvar translation = dataArray[2]\n\t\tremotePuzzle.otherPuzzle.set_scale(scale)\n\t\tremotePuzzle.otherPuzzle.set_translation(translation)\n\telif ID == REMOTE_BLOCK_UPDATE:\n\t\t#sent an updated block pair\n\t\tprint(\"block update\")\n\t\tvar gridMan = root.get_node( \"Spatial\/GridView\/GridMan\" )\n\t\tvar pos1 = dataArray[1]\n\t\tvar pos2 = dataArray[2]\n\t\tgridMan.remove_block(pos1)\n\t\tgridMan.remove_block(pos2)\n\nfunc sendStart():\n\tif !isNetwork:\n\t\tprint(\"Error sending start packet: not connected!\")\n\t\treturn\n\tvar er = connection.put_var([REMOTE_START])\n\tprint(\"Sending start and got [\" + str(er) + \"]\")\n\nfunc sendBlockUpdate(pos1, pos2):\n\tif !isNetwork:\n\t\tprint(\"Error sending start packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_BLOCK_UPDATE, pos1, pos2])\n\nfunc sendFinish(score):\n\tif !isNetwork:\n\t\tprint(\"Error sending finish packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_FINISH, score])\n\nfunc sendQuit():\n\tif !isNetwork:\n\t\tprint(\"Error sending finish packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_QUIT])\n\nfunc sendTransform(scale, translation):\n\tif !isNetwork:\n\t\tprint(\"Cannot send transformation over an unitialized network!\")\n\t\treturn\n\tconnection.put_var([REMOTE_BLOCK_TRANSFORM, scale, translation])\n\n\n\nfunc changeScene(scene):\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\t#root.get_child( 0).queue_free()\n\troot.add_child( ResourceLoader.load( scene ).instance() )\n","old_contents":"\nextends Node\n\nconst REMOTE_FINISH = 0\nconst REMOTE_START = 1\nconst REMOTE_QUIT = 2\nconst REMOTE_BLOCK = 4\nconst REMOTE_BLOCK_TRANSFORM = 5\nconst REMOTE_BLOCK_UPDATE = 6\n\nvar port = 54321\nvar root\nvar isNetwork\nvar isHost\nvar isClient = false\nvar server\nvar client\nvar connection\n\nvar remotePuzzle\n\n#Store the peer stream used by both the lcient and server\nvar stream\n\nfunc _ready():\n\tisNetwork = false\n\tisHost = false\n\tget_tree().get_root().get_node(\"GUIManager\/OptionsMenu\/Panel\/PortField\/LineEdit\").set_text(str(port))\n\nfunc setPort(pt):\n\tport = pt;\n\nfunc connectTo(ip, pt):\n\tisClient = true #just to tell if it's doing something :S\n\tconnection = PacketPeerStream.new()\n\tstream = StreamPeerTCP.new()\n\tconnection.set_stream_peer(stream)\n\tstream.connect(ip, pt);\n\t\n\tif stream.get_status() == stream.STATUS_CONNECTED or stream.get_status() == stream.STATUS_CONNECTING:\n\t\tprint(\"Connecting to \" + ip + \":\" + str(port));\n\t\tset_process(true)\n\t\t#leave is_network as false to indicate we're still waiting for connection\n\t\n\t\nfunc host(pt):\n\tserver = TCP_Server.new()\n\tconnection = PacketPeerStream.new()\n\tisHost = true\n\tprint(\"Starting listening server on port \" + str(pt))\n\tif server.listen(pt) == 0:\n\t\tset_process(true)\n\t\tprint(\"Listening...\")\n\telse:\n\t\tprint(\"Failed to start server on port \" + str(pt));\n\t\nfunc _process(delta):\n\tif (isHost):\n\t\t#server processing stuff\n\t\t#use isNetwork to determine if we're still listening\n\t\tif !isNetwork:\n\t\t\tif server.is_connection_available():\n\t\t\t\tstream = server.take_connection()\n\t\t\t\tconnection = PacketPeerStream.new()\n\t\t\t\tconnection.set_stream_peer(stream)\n\t\t\t\tprint(\"Connecting with player...\")\n\t\t\t\tisNetwork = true\n\t\t\t\tserver.stop()\n\t\t\t\tchangeScene(\"res:\/\/network_test.scn\")\n\t\t\t\tremotePuzzle = root.get_node(\"Spatial\")\n\t\t\t\t#MAKE CALL TO PUZZLE SELECTER\n\t\telse: #not listening anymore, have a client\n\t\t\t#do quick check to make sure we're still\n\t\t\t#connected\n\t\t\tif !stream.is_connected():\n\t\t\t\tprint(\"Lost Connection!\");\n\t\t\t\tisNetwork = false\n\t\t\t\tset_process(false)\n\t\t\t\t#QUIT GAME\n\t\t\t\treturn\n\t\t\t#check if we have any data\n\t\t\tif connection.get_available_packet_count() > 0:\n\t\t\t\t#have to be careful about more than 1 packet per frame\n\t\t\t\tfor i in range(connection.get_available_packet_count()):\n\t\t\t\t\tvar dataArray = connection.get_var()\n\t\t\t\t\tprocessServerData(dataArray)\n\t\t\t\t\t\n\telse:\n\t\t#client processing stuff\n\t\tif !isNetwork:\n\t\t\t#Still waiting for connection confirmed\n\t\t\tif stream.get_status() == stream.STATUS_CONNECTED:\n\t\t\t\tprint(\"Connection established!\")\n\t\t\t\tisNetwork = true\n\t\t\t\tchangeScene(\"res:\/\/network_test.scn\")\n\t\t\t\tremotePuzzle = root.get_node(\"Spatial\")\n\t\t\t\treturn\n\t\t\tif stream.get_status() == stream.STATUS_NONE or stream.get_status() == stream.STATUS_ERROR:\n\t\t\t\tprint(\"Error establishing connection!\")\n\t\t\t\tset_process(false)\n\t\t\t\treturn\n\t\t\t\t#stop running process loop, cause we have no connection\n\t\telse:\n\t\t\t#connecton established and confirmed. Do regular data processing\n\t\t\t#check if we have any data\n\t\t\tif connection.get_available_packet_count() > 0:\n\t\t\t\tfor i in range(connection.get_available_packet_count()):\n\t\t\t\t\tvar dataArray = connection.get_var()\n\t\t\t\t\tprocessServerData(dataArray)\n\t\t\t\t\t#Call the server process script cuase it's peer to peer and we have the same functions!\n\n\nfunc disconnect():\n\t#need to do lots of things! If the server is open and listening, but has no connection just stop listening!\n\tif isHost and !isNetwork:\n\t\t#this means we're waiting for connection still\n\t\tserver.stop()\n\t\tprint(\"closing server listener!\")\n\telif isHost and isNetwork:\n\t\t#have connections. Need to send them stop packet, and close connection\n\t\tconnection.put_var([REMOTE_QUIT])\n\t\tstream.disconnect()\n\t\tprint(\"Closing connection to remote player...\")\n\telif !isHost and !isNetwork:\n\t\tstream.disconnect()\n\t\tprint(\"Halting connection request...\")\n\telif !isHost and isNetwork:\n\t\t#connected to server already\n\t\tstream.disconnect()\n\t\tprint(\"Disconnecting from server...\")\n\t\n\t#no matter where we wre before disconnect, set network to false and return to beginning screen!\n\tisNetwork = false;\n\tisHost = false;\n\tisClient = false;\n\t\n\tset_process(false)\n\t\n\tchangeScene(\"res:\/\/menus.scn\")\n\n\n\nfunc ProcessServerData(dataArray):\n\t#have an array of data. First element should be identifying int\n\tvar ID = dataArray[0]\n\tprint(ID)\n\t#no swithc statement. I'm crying right now while i type this. My fingers are bleeding\n\tif ID == REMOTE_START:\n\t\t#do start something or something whut\n\t\tprint(\"remote_stuff\")\n\telif ID == REMOTE_FINISH:\n\t\t#again, do ending stuff\n\t\tprint(\"remote_finish: \" + str(dataArray[1]))\n\telif ID == REMOTE_QUIT:\n\t\t#omg those jerks!\n\t\tprint(\"remote_quit\")\n\t\tdisconnect()\n\telif ID == REMOTE_BLOCK:\n\t\t#get their block ifnormation!\n\t\tprint(\"remote_block\")\n\telif ID == REMOTE_BLOCK_TRANSFORM:\n\t\t#sent block information\n\t\tprint(\"block TRANSFORM!!!!!!!!!!!\")\n\t\tvar scale = dataArray[1]\n\t\tvar translation = dataArray[2]\n\t\tremotePuzzle.otherPuzzle.set_scale(scale)\n\t\tremotePuzzle.otherPuzzle.set_translation(translation)\n\telif ID == REMOTE_BLOCK_UPDATE:\n\t\t#sent an updated block pair\n\t\tprint(\"block update\")\n\t\tvar gridMan = root.get_node( \"Spatial\/GridView\/GridMan\" )\n\t\tvar pos1 = dataArray[1]\n\t\tvar pos2 = dataArray[2]\n\t\tgridMan.remove_block(pos1)\n\t\tgridMan.remove_block(pos2)\n\nfunc sendStart():\n\tif !isNetwork:\n\t\tprint(\"Error sending start packet: not connected!\")\n\t\treturn\n\tvar er = connection.put_var([REMOTE_START])\n\tprint(\"Sending start and got [\" + str(er) + \"]\")\n\nfunc sendBlockUpdate(pos1, pos2):\n\tif !isNetwork:\n\t\tprint(\"Error sending start packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_BLOCK_UPDATE, pos1, pos2])\n\nfunc sendFinish(score):\n\tif !isNetwork:\n\t\tprint(\"Error sending finish packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_FINISH, score])\n\nfunc sendQuit():\n\tif !isNetwork:\n\t\tprint(\"Error sending finish packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_QUIT])\n\nfunc sendTransform(scale, translation):\n\tif !isNetwork:\n\t\tprint(\"Cannot send transformation over an unitialized network!\")\n\t\treturn\n\tconnection.put_var([REMOTE_BLOCK_TRANSFORM, scale, translation])\n\n\n\nfunc changeScene(scene):\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\t#root.get_child( 0).queue_free()\n\troot.add_child( ResourceLoader.load( scene ).instance() )\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"08cf668d7378f4a098c24d9cd43dad6628bd33e8","subject":"networking moved","message":"networking moved\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Blocks\/PairedBlock.gd","new_file":"src\/scripts\/Blocks\/PairedBlock.gd","new_contents":"extends \"AbstractBlock.gd\"\n\n# Is there a better way to do this?\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\nvar textureName\n\nfunc setTexture(textureName=\"Red\"):\n\tvar img = Image()\n\tself.textureName = textureName\n\n\tvar mat = load(\"res:\/\/materials\/block_\" + textureName + \".mtl\")\n\n\tself.get_node(\"MeshInstance\").set_material_override(mat)\n\treturn self\n\n# Animate the removal of this block and its pair.\nfunc popBlock( pairNode, justFly=false ):\n\tget_parent().samplePlayer.play(\"deraj_pop_sound_low\")\n\t# fly away\n\tvar tweenNode = newTweenNode()\n\ttweenNode.interpolate_method( self, \"set_translation\", \\\n\t\tself.get_translation(), self.get_translation().normalized() * far_away_corner, \\\n\t\t1, Tween.TRANS_CIRC, Tween.EASE_IN_OUT )\n\n\t# remove on animation end\n\ttweenNode.connect(\"tween_complete\", self, \"request_remove\")\n\n\ttweenNode.start()\n\t# just one call to activate...\n\tif not justFly:\n\t\tpairNode.activate(true)\n\t\tget_parent().popPair( blockPos )\n\n# THIS IS EVERYWHERE, ANY BETTER WAY TO HAVE FUNCTIONS BETWEEN SCRIPTS?\nfunc calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n# fly away only if self.pairName is selected\nfunc activate(justFly = false):\n\tvar gridMan = get_parent()\n\tif gridMan.selectedBlocks.size() > 0:\n\t\tvar selBlock = gridMan.get_node( gridMan.selectedBlocks[0] )\n\n\t\tif selBlock.getBlockType() == BLOCK_WILD:\n\t\t\tif selBlock.textureName == textureName:\n\t\t\t\tif calcBlockLayerVec( selBlock.blockPos ) == calcBlockLayerVec( blockPos ):\n\t\t\t\t\tgridMan.clearSelection()\n\t\t\t\t\tselBlock.popBlock()\n\t\t\t\t\tforceActivate()\n\n\t\t\t\t\treturn\n\n\tvar pairNode = pairActivate()\n\tif pairNode == null:\n\t\treturn\n\tif pairNode.selected:\n\t\tpopBlock( pairNode, justFly )\n\n\n# Force the pair to activate.\nfunc forceActivate():\n\tvar pairNode = pairActivate()\n\tif pairNode == null:\n\t\treturn\n\n\tpopBlock( pairNode )\n\n","old_contents":"extends \"AbstractBlock.gd\"\n\n# Is there a better way to do this?\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\nvar textureName\n\nfunc setTexture(textureName=\"Red\"):\n\tvar img = Image()\n\tself.textureName = textureName\n\n\tvar mat = load(\"res:\/\/materials\/block_\" + textureName + \".mtl\")\n\n\tself.get_node(\"MeshInstance\").set_material_override(mat)\n\treturn self\n\n# Animate the removal of this block and its pair.\nfunc popBlock( pairNode, justFly=false ):\n\tget_parent().samplePlayer.play(\"deraj_pop_sound_low\")\n\t# fly away\n\tvar tweenNode = newTweenNode()\n\ttweenNode.interpolate_method( self, \"set_translation\", \\\n\t\tself.get_translation(), self.get_translation().normalized() * far_away_corner, \\\n\t\t1, Tween.TRANS_CIRC, Tween.EASE_IN_OUT )\n\n\t# remove on animation end\n\ttweenNode.connect(\"tween_complete\", self, \"request_remove\")\n\n\tvar network = Globals.get(\"Network\")\n\tif (not network == null and get_parent().get_parent().active and network.isNetwork):\n\t\t\tnetwork.sendBlockUpdate(blockPos)\n\n\ttweenNode.start()\n\t# just one call to activate...\n\tif not justFly:\n\t\tpairNode.activate(true)\n\t\tget_parent().popPair( blockPos )\n\n# THIS IS EVERYWHERE, ANY BETTER WAY TO HAVE FUNCTIONS BETWEEN SCRIPTS?\nfunc calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n# fly away only if self.pairName is selected\nfunc activate(justFly = false):\n\tvar gridMan = get_parent()\n\tif gridMan.selectedBlocks.size() > 0:\n\t\tvar selBlock = gridMan.get_node( gridMan.selectedBlocks[0] )\n\n\t\tif selBlock.getBlockType() == BLOCK_WILD:\n\t\t\tif selBlock.textureName == textureName:\n\t\t\t\tif calcBlockLayerVec( selBlock.blockPos ) == calcBlockLayerVec( blockPos ):\n\t\t\t\t\tgridMan.clearSelection()\n\t\t\t\t\tselBlock.popBlock()\n\t\t\t\t\tforceActivate()\n\n\t\t\t\t\treturn\n\n\tvar pairNode = pairActivate()\n\tif pairNode == null:\n\t\treturn\n\tif pairNode.selected:\n\t\tpopBlock( pairNode, justFly )\n\n\n# Force the pair to activate.\nfunc forceActivate():\n\tvar pairNode = pairActivate()\n\tif pairNode == null:\n\t\treturn\n\n\tpopBlock( pairNode )\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"b355e3937a94fb28441469bec57f821d7cbdae3c","subject":"Fix condition always true in navigation demo","message":"Fix condition always true in navigation demo\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"2d\/navigation\/navigation.gd","new_file":"2d\/navigation\/navigation.gd","new_contents":"extends Navigation2D\n\nexport(float) var CHARACTER_SPEED = 400.0\nvar path = []\n\n# The 'click' event is a custom input action defined in\n# Project > Project Settings > Input Map tab\nfunc _input(event):\n\tif not event.is_action_pressed('click'):\n\t\treturn\n\t_update_navigation_path($Character.position, get_local_mouse_position())\n\n\nfunc _update_navigation_path(start_position, end_position):\n\t# get_simple_path is part of the Navigation2D class\n\t# it returns a PoolVector2Array of points that lead you from the\n\t# start_position to the end_position\n\tpath = get_simple_path(start_position, end_position, true)\n\t# The first point is always the start_position\n\t# We don't need it in this example as it corresponds to the character's position\n\tpath.remove(0)\n\tset_process(true)\n\n\nfunc _process(delta):\n\tvar walk_distance = CHARACTER_SPEED * delta\n\tmove_along_path(walk_distance)\n\n\nfunc move_along_path(distance):\n\tvar last_point = $Character.position\n\tfor index in range(path.size()):\n\t\tvar distance_between_points = last_point.distance_to(path[0])\n\t\t# the position to move to falls between two points\n\t\tif distance <= distance_between_points and distance >= 0.0:\n\t\t\t$Character.position = last_point.linear_interpolate(path[0], distance \/ distance_between_points)\n\t\t\tbreak\n\t\t# the character reached the end of the path\n\t\telif distance < 0.0:\n\t\t\t$Character.position = path[0]\n\t\t\tset_process(false)\n\t\t\tbreak\n\t\tdistance -= distance_between_points\n\t\tlast_point = path[0]\n\t\tpath.remove(0)\n","old_contents":"extends Navigation2D\n\nexport(float) var CHARACTER_SPEED = 400.0\nvar path = []\n\n# The 'click' event is a custom input action defined in\n# Project > Project Settings > Input Map tab\nfunc _input(event):\n\tif not event.is_action_pressed('click'):\n\t\treturn\n\t_update_navigation_path($Character.position, get_local_mouse_position())\n\n\nfunc _update_navigation_path(start_position, end_position):\n\t# get_simple_path is part of the Navigation2D class\n\t# it returns a PoolVector2Array of points that lead you from the\n\t# start_position to the end_position\n\tpath = get_simple_path(start_position, end_position, true)\n\t# The first point is always the start_position\n\t# We don't need it in this example as it corresponds to the character's position\n\tpath.remove(0)\n\tset_process(true)\n\n\nfunc _process(delta):\n\tvar walk_distance = CHARACTER_SPEED * delta\n\tmove_along_path(walk_distance)\n\n\nfunc move_along_path(distance):\n\tvar last_point = $Character.position\n\tfor index in range(path.size()):\n\t\tvar distance_between_points = last_point.distance_to(path[0])\n\t\t# the position to move to falls between two points\n\t\tif distance <= distance_between_points:\n\t\t\t$Character.position = last_point.linear_interpolate(path[0], distance \/ distance_between_points)\n\t\t\tbreak\n\t\t# the character reached the end of the path\n\t\telif distance < 0.0:\n\t\t\t$Character.position = path[0]\n\t\t\tset_process(false)\n\t\t\tbreak\n\t\tdistance -= distance_between_points\n\t\tlast_point = path[0]\n\t\tpath.remove(0)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"64716ee33d883eaad782d1af3b20dabb181e2d8d","subject":"fixes to new window management API","message":"fixes to new window management API\n\n-needs testing on Linux\n-needs testing on Windows\n-NEED SOMEONE TO IMPLEMENT IT ON OSX!! PLEASE HELP!\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"misc\/window_management\/control.gd","new_file":"misc\/window_management\/control.gd","new_contents":"\nextends Control\n\nfunc _fixed_process(delta):\n\n\tvar modetext = \"Mode:\\n\"\n\t\n\tif(OS.is_fullscreen()):\n\t\tmodetext += \"Fullscreen\\n\"\n\telse:\n\t\tmodetext += \"Windowed\\n\"\n\t\t\n\tif(!OS.is_resizable()):\n\t\tmodetext += \"FixedSize\\n\"\n\t\n\tif(OS.is_minimized()):\n\t\tmodetext += \"Minimized\\n\"\n\t\n\tif(OS.is_maximized()):\n\t\tmodetext += \"Maximized\\n\"\n\t\n\tif(Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED):\n\t\tmodetext += \"MouseGrab\\n\"\n\t\tget_node(\"Label_MouseGrab_KeyInfo\").show()\n\telse:\n\t\tget_node(\"Label_MouseGrab_KeyInfo\").hide()\n\t\n\tget_node(\"Label_Mode\").set_text(modetext)\n\t\n\tget_node(\"Label_Position\").set_text( str(\"Position:\\n\", OS.get_window_position() ) )\n\t\n\tget_node(\"Label_Size\").set_text(str(\"Size:\\n\", OS.get_window_size() ) )\n\t\n\tget_node(\"Label_MousePosition\").set_text(str(\"Mouse Position:\\n\", Input.get_mouse_pos() ) )\n\t\n\tget_node(\"Label_Screen_Count\").set_text( str(\"Screen_Count:\\n\", OS.get_screen_count() ) )\n\t\n\tget_node(\"Label_Screen_Current\").set_text( str(\"Screen:\\n\", OS.get_current_screen() ) )\n\t\n\tget_node(\"Label_Screen0_Resolution\").set_text( str(\"Screen0 Resolution:\\n\", OS.get_screen_size() ) )\n\t\n\tget_node(\"Label_Screen0_Position\").set_text(str(\"Screen0 Position:\\n\",OS.get_screen_position() ) )\n\t\n\tif(OS.get_screen_count() > 1):\n\t\tget_node(\"Button_Screen0\").show()\n\t\tget_node(\"Button_Screen1\").show()\n\t\tget_node(\"Label_Screen1_Resolution\").show()\n\t\tget_node(\"Label_Screen1_Position\").show()\n\t\tget_node(\"Label_Screen1_Resolution\").set_text( str(\"Screen1 Resolution:\\n\", OS.get_screen_size(1) ) )\n\t\tget_node(\"Label_Screen1_Position\").set_text( str(\"Screen1 Position:\\n\", OS.get_screen_position(1) ) )\n\telse:\n\t\tget_node(\"Button_Screen0\").hide()\n\t\tget_node(\"Button_Screen1\").hide()\n\t\tget_node(\"Label_Screen1_Resolution\").hide()\n\t\tget_node(\"Label_Screen1_Position\").hide()\n\t\t\n\tget_node(\"Button_Fullscreen\").set_pressed( OS.is_window_fullscreen() )\n\tget_node(\"Button_FixedSize\").set_pressed( !OS.is_is_window_resizable() )\n\tget_node(\"Button_Minimized\").set_pressed( OS.is_is_window_minimized() )\n\tget_node(\"Button_Maximized\").set_pressed( OS.is_is_window_maximized() )\n\tget_node(\"Button_Mouse_Grab\").set_pressed( Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED )\n\n\nfunc check_wm_api():\n\tvar s = \"\"\n\tif( !OS.has_method(\"get_screen_count\") ):\n\t\ts += \" - get_screen_count()\\n\"\n\t\n\tif( !OS.has_method(\"get_screen\") ):\n\t\ts += \" - get_screen()\\n\"\n\t\n\tif( !OS.has_method(\"set_screen\") ):\n\t\ts += \" - set_screen()\\n\"\n\t\n\tif( !OS.has_method(\"get_screen_position\") ):\n\t\ts += \" - get_screen_position()\\n\"\n\t\n\tif( !OS.has_method(\"get_screen_size\") ):\n\t\ts += \" - get_screen_size()\\n\"\n\t\n\tif( !OS.has_method(\"get_window_position\") ):\n\t\ts += \" - get_window_position()\\n\"\n\t\n\tif( !OS.has_method(\"set_window_position\") ):\n\t\ts += \" - set_window_position()\\n\"\n\t\n\tif( !OS.has_method(\"get_window_size\") ):\n\t\ts += \" - get_window_size()\\n\"\n\t\n\tif( !OS.has_method(\"set_window_size\") ):\n\t\ts += \" - set_window_size()\\n\"\n\t\n\tif( !OS.has_method(\"set_fullscreen\") ):\n\t\ts += \" - set_fullscreen()\\n\"\n\t\n\tif( !OS.has_method(\"is_fullscreen\") ):\n\t\ts += \" - is_fullscreen()\\n\"\n\t\n\tif( !OS.has_method(\"set_resizable\") ):\n\t\ts += \" - set_resizable()\\n\"\n\t\n\tif( !OS.has_method(\"is_resizable\") ):\n\t\ts += \" - is_resizable()\\n\"\n\t\n\tif( !OS.has_method(\"set_minimized\") ):\n\t\ts += \" - set_minimized()\\n\"\n\t\n\tif( !OS.has_method(\"is_minimized\") ):\n\t\ts += \" - is_minimized()\\n\"\n\t\n\tif( !OS.has_method(\"set_maximized\") ):\n\t\ts += \" - set_maximized()\\n\"\n\t\n\tif( !OS.has_method(\"is_maximized\") ):\n\t\ts += \" - is_maximized()\\n\"\n\t\n\tif( s.length() == 0 ):\n\t\treturn true\n\telse:\n\t\tvar text = get_node(\"ImplementationDialog\/Text\").get_text()\n\t\tget_node(\"ImplementationDialog\/Text\").set_text( text + s )\n\t\tget_node(\"ImplementationDialog\").show()\n\t\treturn false\n\n\nfunc _ready():\n\tif( check_wm_api() ):\n\t\tset_fixed_process(true)\n\n\nfunc _on_Button_MoveTo_pressed():\n\tOS.set_window_position( Vector2(100,100) )\n\n\nfunc _on_Button_Resize_pressed():\n\tOS.set_window_size( Vector2(1024,768) )\n\n\nfunc _on_Button_Screen0_pressed():\n\tOS.set_current_screen(0)\n\n\nfunc _on_Button_Screen1_pressed():\n\tOS.set_current_screen(1)\n\n\nfunc _on_Button_Fullscreen_pressed():\n\tif(OS.is_window_fullscreen()):\n\t\tOS.set_window_fullscreen(false)\n\telse:\n\t\tOS.set_window_fullscreen(true)\n\n\nfunc _on_Button_FixedSize_pressed():\n\tif(OS.is_window_resizable()):\n\t\tOS.set_window_resizable(false)\n\telse:\n\t\tOS.set_window_resizable(true)\n\n\nfunc _on_Button_Minimized_pressed():\n\tif(OS.is_window_minimized()):\n\t\tOS.set_window_minimized(false)\n\telse:\n\t\tOS.set_window_minimized(true)\n\n\nfunc _on_Button_Maximized_pressed():\n\tif(OS.is_window_maximized()):\n\t\tOS.set_window_maximized(false)\n\telse:\n\t\tOS.set_window_maximized(true)\n\n\nfunc _on_Button_Mouse_Grab_pressed():\n\tvar observer = get_node(\"..\/Observer\")\n\tobserver.state = observer.STATE_GRAB\n","old_contents":"\nextends Control\n\nfunc _fixed_process(delta):\n\n\tvar modetext = \"Mode:\\n\"\n\t\n\tif(OS.is_fullscreen()):\n\t\tmodetext += \"Fullscreen\\n\"\n\telse:\n\t\tmodetext += \"Windowed\\n\"\n\t\t\n\tif(!OS.is_resizable()):\n\t\tmodetext += \"FixedSize\\n\"\n\t\n\tif(OS.is_minimized()):\n\t\tmodetext += \"Minimized\\n\"\n\t\n\tif(OS.is_maximized()):\n\t\tmodetext += \"Maximized\\n\"\n\t\n\tif(Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED):\n\t\tmodetext += \"MouseGrab\\n\"\n\t\tget_node(\"Label_MouseGrab_KeyInfo\").show()\n\telse:\n\t\tget_node(\"Label_MouseGrab_KeyInfo\").hide()\n\t\n\tget_node(\"Label_Mode\").set_text(modetext)\n\t\n\tget_node(\"Label_Position\").set_text( str(\"Position:\\n\", OS.get_window_position() ) )\n\t\n\tget_node(\"Label_Size\").set_text(str(\"Size:\\n\", OS.get_window_size() ) )\n\t\n\tget_node(\"Label_MousePosition\").set_text(str(\"Mouse Position:\\n\", Input.get_mouse_pos() ) )\n\t\n\tget_node(\"Label_Screen_Count\").set_text( str(\"Screen_Count:\\n\", OS.get_screen_count() ) )\n\t\n\tget_node(\"Label_Screen_Current\").set_text( str(\"Screen:\\n\", OS.get_screen() ) )\n\t\n\tget_node(\"Label_Screen0_Resolution\").set_text( str(\"Screen0 Resolution:\\n\", OS.get_screen_size() ) )\n\t\n\tget_node(\"Label_Screen0_Position\").set_text(str(\"Screen0 Position:\\n\",OS.get_screen_position() ) )\n\t\n\tif(OS.get_screen_count() > 1):\n\t\tget_node(\"Button_Screen0\").show()\n\t\tget_node(\"Button_Screen1\").show()\n\t\tget_node(\"Label_Screen1_Resolution\").show()\n\t\tget_node(\"Label_Screen1_Position\").show()\n\t\tget_node(\"Label_Screen1_Resolution\").set_text( str(\"Screen1 Resolution:\\n\", OS.get_screen_size(1) ) )\n\t\tget_node(\"Label_Screen1_Position\").set_text( str(\"Screen1 Position:\\n\", OS.get_screen_position(1) ) )\n\telse:\n\t\tget_node(\"Button_Screen0\").hide()\n\t\tget_node(\"Button_Screen1\").hide()\n\t\tget_node(\"Label_Screen1_Resolution\").hide()\n\t\tget_node(\"Label_Screen1_Position\").hide()\n\t\t\n\tget_node(\"Button_Fullscreen\").set_pressed( OS.is_fullscreen() )\n\tget_node(\"Button_FixedSize\").set_pressed( !OS.is_resizable() )\n\tget_node(\"Button_Minimized\").set_pressed( OS.is_minimized() )\n\tget_node(\"Button_Maximized\").set_pressed( OS.is_maximized() )\n\tget_node(\"Button_Mouse_Grab\").set_pressed( Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED )\n\n\nfunc check_wm_api():\n\tvar s = \"\"\n\tif( !OS.has_method(\"get_screen_count\") ):\n\t\ts += \" - get_screen_count()\\n\"\n\t\n\tif( !OS.has_method(\"get_screen\") ):\n\t\ts += \" - get_screen()\\n\"\n\t\n\tif( !OS.has_method(\"set_screen\") ):\n\t\ts += \" - set_screen()\\n\"\n\t\n\tif( !OS.has_method(\"get_screen_position\") ):\n\t\ts += \" - get_screen_position()\\n\"\n\t\n\tif( !OS.has_method(\"get_screen_size\") ):\n\t\ts += \" - get_screen_size()\\n\"\n\t\n\tif( !OS.has_method(\"get_window_position\") ):\n\t\ts += \" - get_window_position()\\n\"\n\t\n\tif( !OS.has_method(\"set_window_position\") ):\n\t\ts += \" - set_window_position()\\n\"\n\t\n\tif( !OS.has_method(\"get_window_size\") ):\n\t\ts += \" - get_window_size()\\n\"\n\t\n\tif( !OS.has_method(\"set_window_size\") ):\n\t\ts += \" - set_window_size()\\n\"\n\t\n\tif( !OS.has_method(\"set_fullscreen\") ):\n\t\ts += \" - set_fullscreen()\\n\"\n\t\n\tif( !OS.has_method(\"is_fullscreen\") ):\n\t\ts += \" - is_fullscreen()\\n\"\n\t\n\tif( !OS.has_method(\"set_resizable\") ):\n\t\ts += \" - set_resizable()\\n\"\n\t\n\tif( !OS.has_method(\"is_resizable\") ):\n\t\ts += \" - is_resizable()\\n\"\n\t\n\tif( !OS.has_method(\"set_minimized\") ):\n\t\ts += \" - set_minimized()\\n\"\n\t\n\tif( !OS.has_method(\"is_minimized\") ):\n\t\ts += \" - is_minimized()\\n\"\n\t\n\tif( !OS.has_method(\"set_maximized\") ):\n\t\ts += \" - set_maximized()\\n\"\n\t\n\tif( !OS.has_method(\"is_maximized\") ):\n\t\ts += \" - is_maximized()\\n\"\n\t\n\tif( s.length() == 0 ):\n\t\treturn true\n\telse:\n\t\tvar text = get_node(\"ImplementationDialog\/Text\").get_text()\n\t\tget_node(\"ImplementationDialog\/Text\").set_text( text + s )\n\t\tget_node(\"ImplementationDialog\").show()\n\t\treturn false\n\n\nfunc _ready():\n\tif( check_wm_api() ):\n\t\tset_fixed_process(true)\n\n\nfunc _on_Button_MoveTo_pressed():\n\tOS.set_window_position( Vector2(100,100) )\n\n\nfunc _on_Button_Resize_pressed():\n\tOS.set_window_size( Vector2(1024,768) )\n\n\nfunc _on_Button_Screen0_pressed():\n\tOS.set_screen(0)\n\n\nfunc _on_Button_Screen1_pressed():\n\tOS.set_screen(1)\n\n\nfunc _on_Button_Fullscreen_pressed():\n\tif(OS.is_fullscreen()):\n\t\tOS.set_fullscreen(false)\n\telse:\n\t\tOS.set_fullscreen(true)\n\n\nfunc _on_Button_FixedSize_pressed():\n\tif(OS.is_resizable()):\n\t\tOS.set_resizable(false)\n\telse:\n\t\tOS.set_resizable(true)\n\n\nfunc _on_Button_Minimized_pressed():\n\tif(OS.is_minimized()):\n\t\tOS.set_minimized(false)\n\telse:\n\t\tOS.set_minimized(true)\n\n\nfunc _on_Button_Maximized_pressed():\n\tif(OS.is_maximized()):\n\t\tOS.set_maximized(false)\n\telse:\n\t\tOS.set_maximized(true)\n\n\nfunc _on_Button_Mouse_Grab_pressed():\n\tvar observer = get_node(\"..\/Observer\")\n\tobserver.state = observer.STATE_GRAB\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"c23899155249035c679d0701158a2472cc5bc348","subject":"Player damage color, invincibility timer","message":"Player damage color, invincibility timer\n\n","repos":"BK-TN\/IncendiumGame","old_file":"incendium\/scripts\/Player.gd","new_file":"incendium\/scripts\/Player.gd","new_contents":"# PLAYER class\n# Moves n shoots\n\nextends Node2D\n\nconst SPEED = 420 \/ 1.42\n\nexport var polar_controls = false\nvar angle = 0\nvar dist = 200\nvar shield_cooldown = 0\nvar fire_timer = 0\n\nconst MAX_HEALTH = 100\nvar health = MAX_HEALTH\n\nvar inv_time = 0\n\nvar col = Color(1,1,1)\n\nfunc _ready():\n\tset_process(true)\n\nfunc _process(delta):\n\tif Input.is_key_pressed(KEY_LEFT):\n\t\tif polar_controls:\n\t\t\tangle += (delta \/ dist) * SPEED\n\t\telse:\n\t\t\ttranslate(Vector2(-delta,0) * SPEED)\n\tif Input.is_key_pressed(KEY_RIGHT):\n\t\tif polar_controls:\n\t\t\tangle -= (delta \/ dist) * SPEED\n\t\telse:\n\t\t\ttranslate(Vector2(delta,0) * SPEED)\n\tif Input.is_key_pressed(KEY_UP):\n\t\tif polar_controls:\n\t\t\tdist -= delta * SPEED\n\t\t\tif dist < 0.1: dist = 0.1\n\t\telse:\n\t\t\ttranslate(Vector2(0,-delta) * SPEED)\n\tif Input.is_key_pressed(KEY_DOWN):\n\t\tif polar_controls:\n\t\t\tdist += delta * SPEED \n\t\telse:\n\t\t\ttranslate(Vector2(0,delta) * SPEED)\n\t\n\tvar center = Vector2(720\/2,720\/2)\n\t\n\tif polar_controls:\n\t\tset_pos(center + Vector2(cos(angle),sin(angle)) * dist)\n\n\tvar towards_center = (center - get_pos()).normalized()\n\t\n\tcol = col.linear_interpolate(Color(1,1,1),delta * 10)\n\tget_node(\"RegularPolygon\/Polygon2D\").set_color(col)\n\t\n\tif inv_time > 0:\n\t\tinv_time -= delta\n\t\n\tif fire_timer > 0:\n\t\tfire_timer -= delta\n\t\n\tif (Input.is_key_pressed(KEY_SPACE) or Input.is_key_pressed(KEY_F)) and fire_timer <= 0:\n\t\tvar bullet = preload(\"res:\/\/objects\/Bullet.tscn\").instance()\n\t\tbullet.set_pos(get_pos())\n\t\tget_tree().get_root().get_node(\"Game\/SFX\").set_default_pitch_scale(rand_range(0.9,1.1))\n\t\tget_tree().get_root().get_node(\"Game\/SFX\").play(\"Laser_Shoot14\")\n\t\t#bullet.get_node(\"RegularPolygon\").size = 1\n\t\tbullet.damage = 1\n\t\t\n\t\tvar dir = atan2(towards_center.y,towards_center.x)\n\t\tvar len = 600\n\t\t\n\t\tvar spread = 0.05\n\t\tvar rot = rand_range(-spread,spread)\n\t\tvar final = dir + rot\n\t\t\n\t\tbullet.velocity = Vector2(cos(final),sin(final)) * len\n\t\tget_tree().get_root().add_child(bullet,false)\n\t\tfire_timer = 0.05\n\t\t\n\tif shield_cooldown > 0:\n\t\tshield_cooldown -= delta\n\t\n\tif Input.is_key_pressed(KEY_D) and shield_cooldown <= 0:\n\t\tvar shield = preload(\"res:\/\/objects\/PlayerShield.tscn\").instance()\n\t\tshield.node_to_follow = get_path()\n\t\tget_tree().get_root().add_child(shield)\n\t\tshield.set_global_pos(get_global_pos())\n\t\tshield_cooldown = 6\n\n\tset_rot(atan2(towards_center.x,towards_center.y) - PI\/2)\n\t\n\t# Limit position to circle\n\tif center.distance_to(get_pos()) > 720\/2:\n\t\tset_pos((get_pos() - center).normalized() * 720\/2 + center)\n\nfunc _on_RegularPolygon_area_enter( area ):\n\tif area.get_groups().has(\"damage_player\"):\n\t\tvar bullet = area.get_parent()\n\t\tbullet.queue_free()\n\t\tvar dmgtotake = bullet.damage * 2\n\t\tlose_health(dmgtotake)\n\tif area.get_groups().has(\"damage_player_solid\") && area.get_parent().enabled:\n\t\tlose_health(100)\n\nfunc lose_health(hp):\n\tif inv_time <= 0:\n\t\thealth -= hp\n\t\tinv_time = 1\n\t\tcol = Color(1,0,0)\n\t\tget_parent().score_mult = 1\n\t\tget_parent().score_mult_timer = 0\n\t\tif health <= 0:\n\t\t\tfor i in range(0,8):\n\t\t\t\tvar explosion_instance = preload(\"res:\/\/objects\/Explosion.tscn\").instance()\n\t\t\t\texplosion_instance.get_node(\"RegularPolygon\").size = get_node(\"RegularPolygon\").size\n\t\t\t\texplosion_instance.get_node(\"RegularPolygon\/Polygon2D\").set_color(get_node(\"RegularPolygon\/Polygon2D\").get_color())\n\t\t\t\t# explosion_instance.velocity = Vector2(0,0)\n\t\t\t\tget_tree().get_root().add_child(explosion_instance)\n\t\t\t\texplosion_instance.set_global_pos(get_global_pos())\n\t\t\tOS.set_time_scale(0.02)\n\t\t\tqueue_free()\n\nfunc _on_RegularPolygon_area_exit( area ):\n\tpass\n","old_contents":"# PLAYER class\n# Moves n shoots\n\nextends Node2D\n\nconst SPEED = 420 \/ 1.42\n\nexport var polar_controls = false\nvar angle = 0\nvar dist = 200\nvar shield_cooldown = 0\nvar fire_timer = 0\n\nconst MAX_HEALTH = 100\nvar health = MAX_HEALTH\n\nfunc _ready():\n\tset_process(true)\n\nfunc _process(delta):\n\tif Input.is_key_pressed(KEY_LEFT):\n\t\tif polar_controls:\n\t\t\tangle += (delta \/ dist) * SPEED\n\t\telse:\n\t\t\ttranslate(Vector2(-delta,0) * SPEED)\n\tif Input.is_key_pressed(KEY_RIGHT):\n\t\tif polar_controls:\n\t\t\tangle -= (delta \/ dist) * SPEED\n\t\telse:\n\t\t\ttranslate(Vector2(delta,0) * SPEED)\n\tif Input.is_key_pressed(KEY_UP):\n\t\tif polar_controls:\n\t\t\tdist -= delta * SPEED\n\t\t\tif dist < 0.1: dist = 0.1\n\t\telse:\n\t\t\ttranslate(Vector2(0,-delta) * SPEED)\n\tif Input.is_key_pressed(KEY_DOWN):\n\t\tif polar_controls:\n\t\t\tdist += delta * SPEED \n\t\telse:\n\t\t\ttranslate(Vector2(0,delta) * SPEED)\n\t\n\tvar center = Vector2(720\/2,720\/2)\n\t\n\tif polar_controls:\n\t\tset_pos(center + Vector2(cos(angle),sin(angle)) * dist)\n\n\tvar towards_center = (center - get_pos()).normalized()\n\t\n\tif fire_timer > 0:\n\t\tfire_timer -= delta\n\t\n\tif (Input.is_key_pressed(KEY_SPACE) or Input.is_key_pressed(KEY_F)) and fire_timer <= 0:\n\t\tvar bullet = preload(\"res:\/\/objects\/Bullet.tscn\").instance()\n\t\tbullet.set_pos(get_pos())\n\t\tget_tree().get_root().get_node(\"Game\/SFX\").set_default_pitch_scale(rand_range(0.9,1.1))\n\t\tget_tree().get_root().get_node(\"Game\/SFX\").play(\"Laser_Shoot14\")\n\t\t#bullet.get_node(\"RegularPolygon\").size = 1\n\t\tbullet.damage = 1\n\t\t\n\t\tvar dir = atan2(towards_center.y,towards_center.x)\n\t\tvar len = 600\n\t\t\n\t\tvar spread = 0.05\n\t\tvar rot = rand_range(-spread,spread)\n\t\tvar final = dir + rot\n\t\t\n\t\tbullet.velocity = Vector2(cos(final),sin(final)) * len\n\t\tget_tree().get_root().add_child(bullet,false)\n\t\tfire_timer = 0.05\n\t\t\n\tif shield_cooldown > 0:\n\t\tshield_cooldown -= delta\n\t\n\tif Input.is_key_pressed(KEY_D) and shield_cooldown <= 0:\n\t\tvar shield = preload(\"res:\/\/objects\/PlayerShield.tscn\").instance()\n\t\tshield.node_to_follow = get_path()\n\t\tget_tree().get_root().add_child(shield)\n\t\tshield.set_global_pos(get_global_pos())\n\t\tshield_cooldown = 6\n\n\tset_rot(atan2(towards_center.x,towards_center.y) - PI\/2)\n\t\n\t# Limit position to circle\n\tif center.distance_to(get_pos()) > 720\/2:\n\t\tset_pos((get_pos() - center).normalized() * 720\/2 + center)\n\nfunc _on_RegularPolygon_area_enter( area ):\n\tif area.get_groups().has(\"damage_player\"):\n\t\tvar bullet = area.get_parent()\n\t\tbullet.queue_free()\n\t\tvar dmgtotake = bullet.damage * 2\n\t\tlose_health(dmgtotake)\n\tif area.get_groups().has(\"damage_player_solid\") && area.get_parent().enabled:\n\t\tlose_health(100)\n\nfunc lose_health(hp):\n\thealth -= hp\n\tget_parent().score_mult = 1\n\tget_parent().score_mult_timer = 0\n\tif health <= 0:\n\t\tfor i in range(0,8):\n\t\t\tvar explosion_instance = preload(\"res:\/\/objects\/Explosion.tscn\").instance()\n\t\t\texplosion_instance.get_node(\"RegularPolygon\").size = get_node(\"RegularPolygon\").size\n\t\t\texplosion_instance.get_node(\"RegularPolygon\/Polygon2D\").set_color(get_node(\"RegularPolygon\/Polygon2D\").get_color())\n\t\t\t# explosion_instance.velocity = Vector2(0,0)\n\t\t\tget_tree().get_root().add_child(explosion_instance)\n\t\t\texplosion_instance.set_global_pos(get_global_pos())\n\t\tOS.set_time_scale(0.02)\n\t\tqueue_free()\n\nfunc _on_RegularPolygon_area_exit( area ):\n\tpass\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"d22dd385577002685475c4dc306d7654f8975d2b","subject":"Fix simple multiplayer demo for 3+ players","message":"Fix simple multiplayer demo for 3+ players\n\nProperly send newly connected dudes to old players\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"networking\/simple_multiplayer\/gamestate.gd","new_file":"networking\/simple_multiplayer\/gamestate.gd","new_contents":"extends Node\n\n# Default game port\nconst DEFAULT_PORT = 10567\n\n# Max number of players\nconst MAX_PEERS = 12\n\n# Name for my player\nvar player_name = \"The Warrior\"\n\n# Names for remote players in id:name format\nvar players = {}\n\n# Signals to let lobby GUI know what's going on\nsignal player_list_changed()\nsignal connection_failed()\nsignal connection_succeeded()\nsignal game_ended()\nsignal game_error(what)\n\n# Callback from SceneTree\nfunc _player_connected(id):\n\t# This is not used in this demo, because _connected_ok is called for clients\n\t# on success and will do the job.\n\tpass\n\n# Callback from SceneTree\nfunc _player_disconnected(id):\n\tif (get_tree().is_network_server()):\n\t\tif (has_node(\"\/root\/world\")): # Game is in progress\n\t\t\temit_signal(\"game_error\", \"Player \" + players[id] + \" disconnected\")\n\t\t\tend_game()\n\t\telse: # Game is not in progress\n\t\t\t# If we are the server, send to the new dude all the already registered players\n\t\t\tunregister_player(id)\n\t\t\tfor p_id in players:\n\t\t\t\t# Erase in the server\n\t\t\t\trpc_id(p_id, \"unregister_player\", id)\n\n# Callback from SceneTree, only for clients (not server)\nfunc _connected_ok():\n\t# Registration of a client beings here, tell everyone that we are here\n\trpc(\"register_player\", get_tree().get_network_unique_id(), player_name)\n\temit_signal(\"connection_succeeded\")\n\n# Callback from SceneTree, only for clients (not server)\nfunc _server_disconnected():\n\temit_signal(\"game_error\", \"Server disconnected\")\n\tend_game()\n\n# Callback from SceneTree, only for clients (not server)\nfunc _connected_fail():\n\tget_tree().set_network_peer(null) # Remove peer\n\temit_signal(\"connection_failed\")\n\n# Lobby management functions\n\nremote func register_player(id, name):\n\tif (get_tree().is_network_server()):\n\t\t# If we are the server, let everyone know about the new player\n\t\trpc_id(id, \"register_player\", 1, player_name) # Send myself to new dude\n\t\tfor p_id in players: # Then, for each remote player\n\t\t\trpc_id(id, \"register_player\", p_id, players[p_id]) # Send player to new dude\n\t\t\trpc_id(p_id, \"register_player\", id, name) # Send new dude to player\n\n\tplayers[id] = name\n\temit_signal(\"player_list_changed\")\n\nremote func unregister_player(id):\n\tplayers.erase(id)\n\temit_signal(\"player_list_changed\")\n\nremote func pre_start_game(spawn_points):\n\t# Change scene\n\tvar world = load(\"res:\/\/world.tscn\").instance()\n\tget_tree().get_root().add_child(world)\n\n\tget_tree().get_root().get_node(\"lobby\").hide()\n\n\tvar player_scene = load(\"res:\/\/player.tscn\")\n\n\tfor p_id in spawn_points:\n\t\tvar spawn_pos = world.get_node(\"spawn_points\/\" + str(spawn_points[p_id])).get_pos()\n\t\tvar player = player_scene.instance()\n\n\t\tplayer.set_name(str(p_id)) # Use unique ID as node name\n\t\tplayer.set_pos(spawn_pos)\n\n\t\tif (p_id == get_tree().get_network_unique_id()):\n\t\t\t# If node for this peer id, set master\n\t\t\tplayer.set_network_mode(NETWORK_MODE_MASTER)\n\t\t\tplayer.set_player_name(player_name)\n\t\telse:\n\t\t\t# Otherwise set slave\n\t\t\tplayer.set_network_mode(NETWORK_MODE_SLAVE)\n\t\t\tplayer.set_player_name(players[p_id])\n\n\t\tworld.get_node(\"players\").add_child(player)\n\n\t# Set up score\n\tworld.get_node(\"score\").add_player(get_tree().get_network_unique_id(), player_name)\n\tfor pn in players:\n\t\tworld.get_node(\"score\").add_player(pn, players[pn])\n\n\tif (not get_tree().is_network_server()):\n\t\t# Tell server we are ready to start\n\t\trpc_id(1, \"ready_to_start\", get_tree().get_network_unique_id())\n\telif players.size() == 0:\n\t\tpost_start_game()\n\nremote func post_start_game():\n\tget_tree().set_pause(false) # Unpause and unleash the game!\n\nvar players_ready = []\n\nremote func ready_to_start(id):\n\tassert(get_tree().is_network_server())\n\n\tif (not id in players_ready):\n\t\tplayers_ready.append(id)\n\n\tif (players_ready.size() == players.size()):\n\t\tfor p in players:\n\t\t\trpc_id(p, \"post_start_game\")\n\t\tpost_start_game()\n\nfunc host_game(name):\n\tplayer_name = name\n\tvar host = NetworkedMultiplayerENet.new()\n\thost.create_server(DEFAULT_PORT, MAX_PEERS)\n\tget_tree().set_network_peer(host)\n\nfunc join_game(ip, name):\n\tplayer_name = name\n\tvar host = NetworkedMultiplayerENet.new()\n\thost.create_client(ip, DEFAULT_PORT)\n\tget_tree().set_network_peer(host)\n\nfunc get_player_list():\n\treturn players.values()\n\nfunc get_player_name():\n\treturn player_name\n\nfunc begin_game():\n\tassert(get_tree().is_network_server())\n\n\t# Create a dictionary with peer id and respective spawn points, could be improved by randomizing\n\tvar spawn_points = {}\n\tspawn_points[1] = 0 # Server in spawn point 0\n\tvar spawn_point_idx = 1\n\tfor p in players:\n\t\tspawn_points[p] = spawn_point_idx\n\t\tspawn_point_idx += 1\n\t# Call to pre-start game with the spawn points\n\tfor p in players:\n\t\trpc_id(p, \"pre_start_game\", spawn_points)\n\n\tpre_start_game(spawn_points)\n\nfunc end_game():\n\tif (has_node(\"\/root\/world\")): # Game is in progress\n\t\t# End it\n\t\tget_node(\"\/root\/world\").queue_free()\n\n\temit_signal(\"game_ended\")\n\tplayers.clear()\n\tget_tree().set_network_peer(null) # End networking\n\nfunc _ready():\n\tget_tree().connect(\"network_peer_connected\", self, \"_player_connected\")\n\tget_tree().connect(\"network_peer_disconnected\", self,\"_player_disconnected\")\n\tget_tree().connect(\"connected_to_server\", self, \"_connected_ok\")\n\tget_tree().connect(\"connection_failed\", self, \"_connected_fail\")\n\tget_tree().connect(\"server_disconnected\", self, \"_server_disconnected\")\n","old_contents":"extends Node\n\n# Default game port\nconst DEFAULT_PORT = 10567\n\n# Max number of players\nconst MAX_PEERS = 12\n\n# Name for my player\nvar player_name = \"The Warrior\"\n\n# Names for remote players in id:name format\nvar players = {}\n\n# Signals to let lobby GUI know what's going on\nsignal player_list_changed()\nsignal connection_failed()\nsignal connection_succeeded()\nsignal game_ended()\nsignal game_error(what)\n\n# Callback from SceneTree\nfunc _player_connected(id):\n\t# This is not used in this demo, because _connected_ok is called for clients\n\t# on success and will do the job.\n\tpass\n\n# Callback from SceneTree\nfunc _player_disconnected(id):\n\tif (get_tree().is_network_server()):\n\t\tif (has_node(\"\/root\/world\")): # Game is in progress\n\t\t\temit_signal(\"game_error\", \"Player \" + players[id] + \" disconnected\")\n\t\t\tend_game()\n\t\telse: # Game is not in progress\n\t\t\t# If we are the server, send to the new dude all the already registered players\n\t\t\tunregister_player(id)\n\t\t\tfor p_id in players:\n\t\t\t\t# Erase in the server\n\t\t\t\trpc_id(p_id, \"unregister_player\", id)\n\n# Callback from SceneTree, only for clients (not server)\nfunc _connected_ok():\n\t# Registration of a client beings here, tell everyone that we are here\n\trpc(\"register_player\", get_tree().get_network_unique_id(), player_name)\n\temit_signal(\"connection_succeeded\")\n\n# Callback from SceneTree, only for clients (not server)\nfunc _server_disconnected():\n\temit_signal(\"game_error\", \"Server disconnected\")\n\tend_game()\n\n# Callback from SceneTree, only for clients (not server)\nfunc _connected_fail():\n\tget_tree().set_network_peer(null) # Remove peer\n\temit_signal(\"connection_failed\")\n\n# Lobby management functions\n\nremote func register_player(id, name):\n\tif (get_tree().is_network_server()):\n\t\t# If we are the server, let everyone know about the new player\n\t\trpc_id(id, \"register_player\", 1, player_name) # Send myself to new dude\n\t\tfor p_id in players: # Then, for each remote player\n\t\t\trpc_id(id, \"register_player\", p_id, players[p_id]) # Send player to new dude\n\n\tplayers[id] = name\n\temit_signal(\"player_list_changed\")\n\nremote func unregister_player(id):\n\tplayers.erase(id)\n\temit_signal(\"player_list_changed\")\n\nremote func pre_start_game(spawn_points):\n\t# Change scene\n\tvar world = load(\"res:\/\/world.tscn\").instance()\n\tget_tree().get_root().add_child(world)\n\n\tget_tree().get_root().get_node(\"lobby\").hide()\n\n\tvar player_scene = load(\"res:\/\/player.tscn\")\n\n\tfor p_id in spawn_points:\n\t\tvar spawn_pos = world.get_node(\"spawn_points\/\" + str(spawn_points[p_id])).get_pos()\n\t\tvar player = player_scene.instance()\n\n\t\tplayer.set_name(str(p_id)) # Use unique ID as node name\n\t\tplayer.set_pos(spawn_pos)\n\n\t\tif (p_id == get_tree().get_network_unique_id()):\n\t\t\t# If node for this peer id, set master\n\t\t\tplayer.set_network_mode(NETWORK_MODE_MASTER)\n\t\t\tplayer.set_player_name(player_name)\n\t\telse:\n\t\t\t# Otherwise set slave\n\t\t\tplayer.set_network_mode(NETWORK_MODE_SLAVE)\n\t\t\tplayer.set_player_name(players[p_id])\n\n\t\tworld.get_node(\"players\").add_child(player)\n\n\t# Set up score\n\tworld.get_node(\"score\").add_player(get_tree().get_network_unique_id(), player_name)\n\tfor pn in players:\n\t\tworld.get_node(\"score\").add_player(pn, players[pn])\n\n\tif (not get_tree().is_network_server()):\n\t\t# Tell server we are ready to start\n\t\trpc_id(1, \"ready_to_start\", get_tree().get_network_unique_id())\n\telif players.size() == 0:\n\t\tpost_start_game()\n\nremote func post_start_game():\n\tget_tree().set_pause(false) # Unpause and unleash the game!\n\nvar players_ready = []\n\nremote func ready_to_start(id):\n\tassert(get_tree().is_network_server())\n\n\tif (not id in players_ready):\n\t\tplayers_ready.append(id)\n\n\tif (players_ready.size() == players.size()):\n\t\tfor p in players:\n\t\t\trpc_id(p, \"post_start_game\")\n\t\tpost_start_game()\n\nfunc host_game(name):\n\tplayer_name = name\n\tvar host = NetworkedMultiplayerENet.new()\n\thost.create_server(DEFAULT_PORT, MAX_PEERS)\n\tget_tree().set_network_peer(host)\n\nfunc join_game(ip, name):\n\tplayer_name = name\n\tvar host = NetworkedMultiplayerENet.new()\n\thost.create_client(ip, DEFAULT_PORT)\n\tget_tree().set_network_peer(host)\n\nfunc get_player_list():\n\treturn players.values()\n\nfunc get_player_name():\n\treturn player_name\n\nfunc begin_game():\n\tassert(get_tree().is_network_server())\n\n\t# Create a dictionary with peer id and respective spawn points, could be improved by randomizing\n\tvar spawn_points = {}\n\tspawn_points[1] = 0 # Server in spawn point 0\n\tvar spawn_point_idx = 1\n\tfor p in players:\n\t\tspawn_points[p] = spawn_point_idx\n\t\tspawn_point_idx += 1\n\t# Call to pre-start game with the spawn points\n\tfor p in players:\n\t\trpc_id(p, \"pre_start_game\", spawn_points)\n\n\tpre_start_game(spawn_points)\n\nfunc end_game():\n\tif (has_node(\"\/root\/world\")): # Game is in progress\n\t\t# End it\n\t\tget_node(\"\/root\/world\").queue_free()\n\n\temit_signal(\"game_ended\")\n\tplayers.clear()\n\tget_tree().set_network_peer(null) # End networking\n\nfunc _ready():\n\tget_tree().connect(\"network_peer_connected\", self, \"_player_connected\")\n\tget_tree().connect(\"network_peer_disconnected\", self,\"_player_disconnected\")\n\tget_tree().connect(\"connected_to_server\", self, \"_connected_ok\")\n\tget_tree().connect(\"connection_failed\", self, \"_connected_fail\")\n\tget_tree().connect(\"server_disconnected\", self, \"_server_disconnected\")\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"753a8a20d54744e597cf826d31a4f729bcb24e14","subject":"Fixed small typos","message":"Fixed small typos\n","repos":"CSaratakij\/jam-2016-remake","old_file":"src\/ui\/ui_life.gd","new_file":"src\/ui\/ui_life.gd","new_contents":"\nextends HBoxContainer\n\nconst RECT_WIDTH = 20\nconst RECT_HEIGHT = 20\n\nvar rects_life = [\n\tRect2(0, 0, RECT_WIDTH * 0, RECT_HEIGHT),\n\tRect2(0, 0, RECT_WIDTH * 1, RECT_HEIGHT),\n\tRect2(0, 0, RECT_WIDTH * 2, RECT_HEIGHT),\n\tRect2(0, 0, RECT_WIDTH * 3, RECT_HEIGHT)\n]\n\nvar current_life = 0\nvar current_rect_life = 0\n\nonready var tree = get_tree()\nonready var _life_sprite = get_node(\"Sprite\")\nonready var _health = tree.get_nodes_in_group(\"player\")[ 0 ].get_node(\"health\")\n\nfunc _ready():\n\tset_process(true)\n\nfunc _process(delta):\n\tcurrent_life = _health.get_current_life()\n\tcurrent_rect_life = rects_life[ current_life ]\n\t_life_sprite.set_region_rect(current_rect_life)\n","old_contents":"\nextends HBoxContainer\n\nconst RECT_WIDTH = 20\nconst RECT_HEIGHT = 20\n\nvar rects_life = [\n\t\tRect2(0, 0, RECT_WIDTH * 0, RECT_HEIGHT),\n\t\tRect2(0, 0, RECT_WIDTH * 1, RECT_HEIGHT),\n\t\tRect2(0, 0, RECT_WIDTH * 2, RECT_HEIGHT),\n\t\tRect2(0, 0, RECT_WIDTH * 3, RECT_HEIGHT)\n\t]\n\nvar current_life = 0\nvar current_rect_life = 0\n\nonready var tree = get_tree()\nonready var _life_sprite = get_node(\"Sprite\")\nonready var _health = tree.get_nodes_in_group(\"player\")[0].get_node(\"health\")\n\nfunc _ready():\n\tset_process(true)\n\nfunc _process(delta):\n\tcurrent_life = _health.get_current_life()\n\tcurrent_rect_life = rects_life[current_life]\n\t_life_sprite.set_region_rect(current_rect_life)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"e264adf76dab6e4e6bb039e3ac94997776de3073","subject":"Added simple check to make sure networking is needed on creation of a puzzle scene","message":"Added simple check to make sure networking is needed on creation of a\npuzzle scene\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Puzzle.gd","new_file":"src\/scripts\/Puzzle.gd","new_contents":"# Provides functionality for the puzzle itself\n\nextends Spatial\n\nvar DataMan = preload( \"res:\/\/scripts\/DataManager.gd\" ).new()\nvar PuzzleManScript = preload( \"res:\/\/scripts\/PuzzleManager.gd\" )\nvar PuzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar puzzleMan\nvar otherPuzzle\nvar mainPuzzle = true\n\nvar time = {\n\t\ton = true,\n\t\tval = 0.0,\n\t\tlabel = Label.new(),\n\t\ttween = Tween.new() }\n\nfunc addTimer():\n\tadd_child(time.label)\n\tadd_child(time.tween)\n\ttime.label.set_pos(Vector2(15,15))\n\n\ttime.label.set_theme(load(\"res:\/\/themes\/MainTheme.thm\"))\n\ttime.tween.interpolate_method(time.label, \"set_pos\", \\\n\t\t\ttime.label.get_pos(), time.label.get_pos()*2, 0.5, \\\n\t\t\tTween.TRANS_BOUNCE, Tween.EASE_OUT)\n\ttime.tween.start()\n\ttime.label.set_text(str(time.val))\n\nfunc formatTime(t):\n\tvar mins = floor(t \/ 60)\n\tvar secs = fmod(floor(t), 60)\n\tvar millis = floor((t - floor(t)) * 1000)\n\treturn str(mins) + \":\" + str(secs).pad_zeros(2) + \":\" + str(millis).pad_zeros(3)\n\nfunc _process(dTime):\n\t# start label tween on\n\ttime.val += dTime\n\ttime.label.set_text(formatTime(time.val))\n\tif fmod(time.val, 10) < 0.1:\n\t\ttime.tween.seek(0.0)\n\n# Called for initialization\nfunc _ready():\n\tif time.on:\n\t\tset_process(true) # needed for time keeping\n\tpuzzleMan = PuzzleManScript.new()\n\tvar puzzle = puzzleMan.generatePuzzle( 2, puzzleMan.DIFF_EASY )\n\tpuzzle.puzzleMan = puzzleMan\n\t\n\t#set up network stuffs\n\tadd_child(load(\"res:\/\/networkProxy.scn\").instance())\n\tGlobals.get(\"Network\").proxy.set_process(Globals.get(\"Network\").isClient or Globals.get(\"Network\").isHost)\n\n\tprint(\"Generated \", puzzle.blocks.size(), \" blocks.\" )\n\n\tprint( \"Saving...\" )\n\tDataMan.savePuzzle( \"TestPuzzle.pzl\", puzzle )\n\n\tpuzzle = 0\n\n\tpuzzle = DataMan.loadPuzzle( \"TestPuzzle.pzl\" )\n\n\tvar steps = puzzle.solvePuzzleSteps()\n\tprint( \"PUZZLE IS SOLVEABLE?: \", steps.solveable )\n\n\taddTimer()\n\n\t# Place the blocks in the puzzle.\n\tvar gridMan = get_node( \"GridView\/GridMan\" )\n\tgridMan.shape = puzzleMan.shape\n\tgridMan.set_puzzle(puzzle)\n\tfor block in puzzle.blocks:\n\t\t# Create a block node, add it to the tree\n\t\tgridMan.add_block(block.toNode())\n\n\t# make a new puzzle, embed using Viewport\n\tif mainPuzzle:\n\t\tvar p = PuzzleScn.instance()\n\t\tp.remove_and_delete_child(p.get_node(\"Lights\"))\n\t\tp.get_node(\"GridView\").active = false\n\t\tp.mainPuzzle = false\n\t\tp.set_scale(Vector3(0.5, 0.5, 0.5))\n\t\tp.set_translation(Vector3(10, 5, -20))\n\n\t\tvar v = Viewport.new()\n\t\tvar c = Control.new()\n\n\t\tv.set_world(p.get_world())\n\t\tv.set_rect(Rect2(0, 0, 100, 100))\n\t\tv.set_physics_object_picking(false)\n\t\tget_node(\"Camera\").add_child(p)\n\t\tv.add_child(p)\n\t\tadd_child(c)\n\t\tc.add_child(v)\n\t\totherPuzzle = p #for use with network\n# child of control? easier input\n\n\n","old_contents":"# Provides functionality for the puzzle itself\n\nextends Spatial\n\nvar DataMan = preload( \"res:\/\/scripts\/DataManager.gd\" ).new()\nvar PuzzleManScript = preload( \"res:\/\/scripts\/PuzzleManager.gd\" )\nvar PuzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar puzzleMan\nvar otherPuzzle\nvar mainPuzzle = true\n\nvar time = {\n\t\ton = true,\n\t\tval = 0.0,\n\t\tlabel = Label.new(),\n\t\ttween = Tween.new() }\n\nfunc addTimer():\n\tadd_child(time.label)\n\tadd_child(time.tween)\n\ttime.label.set_pos(Vector2(15,15))\n\n\ttime.label.set_theme(load(\"res:\/\/themes\/MainTheme.thm\"))\n\ttime.tween.interpolate_method(time.label, \"set_pos\", \\\n\t\t\ttime.label.get_pos(), time.label.get_pos()*2, 0.5, \\\n\t\t\tTween.TRANS_BOUNCE, Tween.EASE_OUT)\n\ttime.tween.start()\n\ttime.label.set_text(str(time.val))\n\nfunc formatTime(t):\n\tvar mins = floor(t \/ 60)\n\tvar secs = fmod(floor(t), 60)\n\tvar millis = floor((t - floor(t)) * 1000)\n\treturn str(mins) + \":\" + str(secs).pad_zeros(2) + \":\" + str(millis).pad_zeros(3)\n\nfunc _process(dTime):\n\t# start label tween on\n\ttime.val += dTime\n\ttime.label.set_text(formatTime(time.val))\n\tif fmod(time.val, 10) < 0.1:\n\t\ttime.tween.seek(0.0)\n\n# Called for initialization\nfunc _ready():\n\tif time.on:\n\t\tset_process(true) # needed for time keeping\n\tpuzzleMan = PuzzleManScript.new()\n\tvar puzzle = puzzleMan.generatePuzzle( 2, puzzleMan.DIFF_EASY )\n\tpuzzle.puzzleMan = puzzleMan\n\t\n\t#set up network stuffs\n\tadd_child(load(\"res:\/\/networkProxy.scn\").instance())\n\tGlobals.get(\"Network\").proxy.set_process(true)\n\n\tprint(\"Generated \", puzzle.blocks.size(), \" blocks.\" )\n\n\tprint( \"Saving...\" )\n\tDataMan.savePuzzle( \"TestPuzzle.pzl\", puzzle )\n\n\tpuzzle = 0\n\n\tpuzzle = DataMan.loadPuzzle( \"TestPuzzle.pzl\" )\n\n\tvar steps = puzzle.solvePuzzleSteps()\n\tprint( \"PUZZLE IS SOLVEABLE?: \", steps.solveable )\n\n\taddTimer()\n\n\t# Place the blocks in the puzzle.\n\tvar gridMan = get_node( \"GridView\/GridMan\" )\n\tgridMan.shape = puzzleMan.shape\n\tgridMan.set_puzzle(puzzle)\n\tfor block in puzzle.blocks:\n\t\t# Create a block node, add it to the tree\n\t\tgridMan.add_block(block.toNode())\n\n\t# make a new puzzle, embed using Viewport\n\tif mainPuzzle:\n\t\tvar p = PuzzleScn.instance()\n\t\tp.remove_and_delete_child(p.get_node(\"Lights\"))\n\t\tp.get_node(\"GridView\").active = false\n\t\tp.mainPuzzle = false\n\t\tp.set_scale(Vector3(0.5, 0.5, 0.5))\n\t\tp.set_translation(Vector3(10, 5, -20))\n\n\t\tvar v = Viewport.new()\n\t\tvar c = Control.new()\n\n\t\tv.set_world(p.get_world())\n\t\tv.set_rect(Rect2(0, 0, 100, 100))\n\t\tv.set_physics_object_picking(false)\n\t\tget_node(\"Camera\").add_child(p)\n\t\tv.add_child(p)\n\t\tadd_child(c)\n\t\tc.add_child(v)\n\t\totherPuzzle = p #for use with network\n# child of control? easier input\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"10c378c9fba471b8ae0c24c80df03225b82dc0d5","subject":"cleaner null pair check","message":"cleaner null pair check\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Blocks\/AbstractBlock.gd","new_file":"src\/scripts\/Blocks\/AbstractBlock.gd","new_contents":"\nextends RigidBody\n\nvar name_int\nvar name\nvar pairName\nvar selected = false\nvar blockPos\nvar blockLayer\nvar blockType\nconst far_away_corner = Vector3(110, 110, 110)\n\nvar editor\n\nstatic func nameToNodeName(n):\n\treturn \"block\" + str(n)\n\nfunc setName(n):\n\tname_int = n\n\tname = nameToNodeName(n)\n\tset_name(nameToNodeName(n))\n\treturn self\n\nfunc setPairName(n):\n\tpairName = nameToNodeName(n)\n\treturn self\n\nfunc setBlockLayer(n):\n\tblockLayer = n\n\treturn self\n\nfunc getBlockLayer():\n\treturn blockLayer\n\nfunc setBlockType( blockT ):\n\tblockType = blockT\n\treturn self\n\nfunc getBlockType():\n\treturn blockType\n\nfunc setSelected(sel):\n\tselected = sel\n\treturn self\n\nfunc forceClick(click_normal):\n\tif editor != null:\n\t\tif editor.shouldAddNeighbor():\n\t\t\taddNeighbor(editor, click_normal)\n\t\t\treturn\n\t\tif editor.shouldReplaceSelf() or editor.shouldRemoveSelf():\n\t\t\t# lasers cannot be removed by the editor\n\t\t\tif blockType == get_parent().get_parent().get_parent().puzzleMan.BLOCK_LASER:\n\t\t\t\treturn\n\n\t\t\t# maybe replace self\n\t\t\tif editor.shouldReplaceSelf():\n\t\t\t\taddNeighbor(editor, 0 * click_normal)\n\t\t\tif pairName != null:\n\t\t\t\tvar pair = get_parent().get_node(pairName)\n\t\t\t\tif pair != null:\n\t\t\t\t\tpair.request_remove()\n\t\t\trequest_remove()\n\t\t\treturn\n\telse:\n\t\tactivate()\n\t\tget_parent().clickBlock( name )\n\nfunc addNeighbor(editor, click_normal):\n\tvar t = get_parent().get_parent().get_transform().inverse()\n\teditor.addBlock(blockPos + t * click_normal)\n\n\n# catch clicks\/taps\nfunc _input_event( camera, ev, click_pos, click_normal, shape_idx ):\n\tif ((ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT)\n\tor (ev.type==InputEvent.SCREEN_TOUCH)):\n\t\tif (get_parent().get_parent().active and ev.is_pressed()):\n\t\t\tforceClick(click_normal)\n\n# returns this block's pairNode or null\nfunc pairActivate():\n\tselected = true\n\n\t# is my pair Nil?\n\tif not get_parent().has_node(str(pairName)):\n\t\tscaleTweenNode(0.9, 0.2, Tween.TRANS_EXPO).start()\n\t\treturn null\n\n\t# get my pair node\n\tvar pairNode = get_parent().get_node(pairName)\n\n\t# enlarge if the other guy's unselected\n\tif not pairNode.selected:\n\t\tscaleTweenNode(1.1, 0.2, Tween.TRANS_EXPO).start()\n\treturn pairNode\n\n\n# returns a tween node that uniformly changes the object's scale\n# call start() on the returned object\nfunc scaleTweenNode(scale, time=1, transType=Tween.TRANS_BOUNCE):\n\tvar tweenNode = newTweenNode()\n\ttweenNode.interpolate_method( self, \"set_scale\", \\\n\t\tself.get_scale(), Vector3(scale, scale, scale), \\\n\t\ttime, transType, Tween.EASE_OUT )\n\n\treturn tweenNode\n\n# adds a tween transition node to the tree\nfunc newTweenNode():\n\tvar tween = Tween.new()\n\tadd_child(tween)\n\treturn tween\n\nfunc request_remove(node=null, key=null):\n\tvar n = scaleTweenNode(0.001, 0.25, Tween.TRANS_QUART)\n\tn.start()\n\tn.connect(\"tween_complete\", get_parent(), \"remove_block\", [self])\n\nfunc _ready():\n\tif get_tree().get_root().has_node(\"EditorSpatial\"):\n\t\teditor = get_tree().get_root().get_node(\"EditorSpatial\")\n\tset_ray_pickable(true)\n","old_contents":"\nextends RigidBody\n\nvar name_int\nvar name\nvar pairName\nvar selected = false\nvar blockPos\nvar blockLayer\nvar blockType\nconst far_away_corner = Vector3(110, 110, 110)\n\nvar editor\n\nstatic func nameToNodeName(n):\n\treturn \"block\" + str(n)\n\nfunc setName(n):\n\tname_int = n\n\tname = nameToNodeName(n)\n\tset_name(nameToNodeName(n))\n\treturn self\n\nfunc setPairName(n):\n\tpairName = nameToNodeName(n)\n\treturn self\n\nfunc setBlockLayer(n):\n\tblockLayer = n\n\treturn self\n\nfunc getBlockLayer():\n\treturn blockLayer\n\nfunc setBlockType( blockT ):\n\tblockType = blockT\n\treturn self\n\nfunc getBlockType():\n\treturn blockType\n\nfunc setSelected(sel):\n\tselected = sel\n\treturn self\n\nfunc forceClick(click_normal):\n\tif editor != null:\n\t\tif editor.shouldAddNeighbor():\n\t\t\taddNeighbor(editor, click_normal)\n\t\t\treturn\n\t\tif editor.shouldReplaceSelf() or editor.shouldRemoveSelf():\n\t\t\t# lasers cannot be removed by the editor\n\t\t\tif blockType == get_parent().get_parent().get_parent().puzzleMan.BLOCK_LASER:\n\t\t\t\treturn\n\n\t\t\t# maybe replace self\n\t\t\tif editor.shouldReplaceSelf():\n\t\t\t\taddNeighbor(editor, 0 * click_normal)\n\t\t\tif pairName != null:\n\t\t\t\tvar pair = get_parent().get_node(pairName)\n\t\t\t\tif pair != null:\n\t\t\t\t\tpair.request_remove()\n\t\t\trequest_remove()\n\t\t\treturn\n\telse:\n\t\tactivate()\n\t\tget_parent().clickBlock( name )\n\nfunc addNeighbor(editor, click_normal):\n\tvar t = get_parent().get_parent().get_transform().inverse()\n\teditor.addBlock(blockPos + t * click_normal)\n\n\n# catch clicks\/taps\nfunc _input_event( camera, ev, click_pos, click_normal, shape_idx ):\n\tif ((ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT)\n\tor (ev.type==InputEvent.SCREEN_TOUCH)):\n\t\tif (get_parent().get_parent().active and ev.is_pressed()):\n\t\t\tforceClick(click_normal)\n\n# returns this block's pairNode or null\nfunc pairActivate():\n\tselected = true\n\n\t# is my pair Nil?\n\tif pairName == null or get_parent() == null or not get_parent().has_node(pairName):\n\t\tscaleTweenNode(0.9, 0.2, Tween.TRANS_EXPO).start()\n\t\treturn null\n\n\t# get my pair node\n\tvar pairNode = get_parent().get_node(pairName)\n\n\t# enlarge if the other guy's unselected\n\tif not pairNode.selected:\n\t\tscaleTweenNode(1.1, 0.2, Tween.TRANS_EXPO).start()\n\treturn pairNode\n\n\n# returns a tween node that uniformly changes the object's scale\n# call start() on the returned object\nfunc scaleTweenNode(scale, time=1, transType=Tween.TRANS_BOUNCE):\n\tvar tweenNode = newTweenNode()\n\ttweenNode.interpolate_method( self, \"set_scale\", \\\n\t\tself.get_scale(), Vector3(scale, scale, scale), \\\n\t\ttime, transType, Tween.EASE_OUT )\n\n\treturn tweenNode\n\n# adds a tween transition node to the tree\nfunc newTweenNode():\n\tvar tween = Tween.new()\n\tadd_child(tween)\n\treturn tween\n\nfunc request_remove(node=null, key=null):\n\tvar n = scaleTweenNode(0.001, 0.25, Tween.TRANS_QUART)\n\tn.start()\n\tn.connect(\"tween_complete\", get_parent(), \"remove_block\", [self])\n\nfunc _ready():\n\tif get_tree().get_root().has_node(\"EditorSpatial\"):\n\t\teditor = get_tree().get_root().get_node(\"EditorSpatial\")\n\tset_ray_pickable(true)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"50a312c1812b8cd94ebf1101edc33d1860d8122f","subject":"static function for scene switch-aroo","message":"static function for scene switch-aroo\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/GUIManager.gd","new_file":"src\/scripts\/GUIManager.gd","new_contents":"# This script manages all of the GUI elements.\n# It switches between the states of the GUI allowing\n# the user to start games, edit the options or connect\n# to a multiplayer game.\n\nextends Node\n\n# network variables\nvar network\n\n# State variables.\nvar menuOn\nvar splashTween\n\n# Timers.\nvar timer\nvar initialWait = 0.5\nvar splashTimer = 2.0\nvar warningTimer = 5.0\n\n# GUI pieces.\nvar Splash_Team5\nvar Splash_Warning\nvar Menu_Main\nvar Menu_Chooser\nvar Menu_MP\nvar Menu_HostGame\nvar Menu_JoinGame\nvar Menu_Options\n\n# Menu state values. Used to switch between them.\nvar MENU_INIT\t\t\t= 0\nvar MENU_SPLASHTEAM5\t= 1\nvar MENU_SPLASHWARNING\t= 2\nvar MENU_MAIN\t\t\t= 3\nvar MENU_CHOOSER\t\t= 4\nvar MENU_MP\t\t\t\t= 5\nvar MENU_HOSTGAME\t\t= 6\nvar MENU_JOINGAME\t\t= 7\nvar MENU_OPTIONS\t\t= 8\n\n# Main Menu Theme\nvar samplePlayer = StreamPlayer.new()\nvar songs = [load(\"res:\/\/main_theme_antris.ogg\")]\n\n# Loader dialog\nvar saveDir\nvar fileDialog\n\nfunc skipTitle(skip):\n\tif skip:\n\t\tinitialWait = 0.01\n\t\tsplashTimer = 0.01\n\t\twarningTimer = 0.01\n\n# Function to be called once for setup.\nfunc _ready():\n\t# Initial setup.\n\tmenuOn = MENU_INIT\n\ttimer = 0.0\n\tset_process( true )\n\tset_process_input( true )\n\n\t# Setup the splash fader tween.\n\tsplashTween = Tween.new()\n\tget_node( \"SplashFader\" ).add_child( splashTween )\n\tsplashTween.interpolate_method( get_node( \"SplashFader\" ), \"set_opacity\", 1.0, 0.0, 1.0, Tween.TRANS_CUBIC, Tween.EASE_IN_OUT )\n\n\t# Gather all of the menus.\n\tSplash_Team5 = get_node( \"SplashTeam5\" )\n\tSplash_Warning = get_node( \"SplashWarning\" )\n\tMenu_Main = get_node( \"MainMenu\" )\n\tMenu_Chooser = get_node( \"ChooserMenu\" )\n\tMenu_MP = get_node( \"Multiplayer\" )\n\tMenu_HostGame = get_node( \"HostGame\" )\n\tMenu_JoinGame = get_node( \"JoinGame\" )\n\tMenu_Options = get_node( \"OptionsMenu\" )\n\n\tGlobals.set(\"Network\", load(\"res:\/\/scripts\/Network.gd\").new())\n\tnetwork = Globals.get(\"Network\")\n\n\tvar scn = load(\"res:\/\/networkProxy.scn\")\n\tadd_child(scn.instance())\n\tnetwork.root = get_tree().get_root()\n\n\t# Load the config.\n\tvar config = preload( \"res:\/\/scripts\/DataManager.gd\" ).new().loadConfig()\n\n\tget_node(\"OptionsMenu\/Panel\/OnlineName\/LineEdit\").set_text( config.name )\n\tget_node(\"OptionsMenu\/Panel\/SoundVolume\/SoundSlider\").set_value( config.soundvolume )\n\tget_node(\"OptionsMenu\/Panel\/MusicVolume\/MusicSlider\").set_value( config.musicvolume )\n\n\tnetwork.port = config.portnumber\n\n\t# Prepare puzzle loader dialog\n\tsaveDir = OS.get_data_dir() + \"\/PuzzleSaves\"\n\tfileDialog = preload(\"Editor.gd\").initLoadSaveDialog(self, get_tree(), saveDir)\n\n\t# Main Menu Theme\n\tGlobals.set(\"StreamPlayer\", samplePlayer)\n\tadd_child(samplePlayer)\n\tsamplePlayer.set_stream(songs[0])\n\tsamplePlayer.play()\n\n# Function to update the GUI.\nfunc _process( delta ):\n\t# Handle the initial wait.\n\tif( menuOn == MENU_INIT ):\n\t\tif( timer > initialWait ):\n\t\t\tmenuOn = MENU_SPLASHTEAM5\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiIn()\n\n\t# Handle the Team5 splash screen.\n\tif( menuOn == MENU_SPLASHTEAM5 ):\n\t\tif( timer > splashTimer ):\n\t\t\tmenuOn = MENU_SPLASHWARNING\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiOut()\n\t\t\tSplash_Warning.guiIn()\n\n\t# Handle the warning splash screen.\n\tif( menuOn == MENU_SPLASHWARNING ):\n\t\tif( timer > warningTimer ):\n\t\t\tmenuOn = MENU_MAIN\n\t\t\ttimer = 0.0\n\t\t\tSplash_Warning.guiOut()\n\t\t\tMenu_Main.guiIn()\n\t\t\tsplashTween.start()\n\n\t# Increase the timer each frame.\n\ttimer += delta\n\n# Handle the input events.\nfunc _input( ev ):\n\t# Handle skip splash screens.\n\tif( !ev.is_pressed() and ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT ):\n\t\tif( menuOn == MENU_SPLASHTEAM5 || menuOn == MENU_SPLASHWARNING ):\n\t\t\ttimer = 999.0;\n\n\t# Handle exit.\n\tif( ev.is_action( \"ui_cancel\" ) ):\n\t\texit()\n\nfunc exit():\n\tprint( \"Exiting\" )\n\tOS.get_main_loop().quit()\n\nfunc _on_Exit_pressed():\n\texit()\n\n# TODO save to ConfigFile, load this on beginning\nfunc _on_Options_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Options.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_OPTIONS\n\tget_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\").set_text(str(network.port))\n\nfunc _on_Cancel_pressed():\n\tMenu_Options.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_SaveQuit_pressed():\n\t# Save the options.\n\n\tvar config = { name = get_node(\"OptionsMenu\/Panel\/OnlineName\/LineEdit\").get_text()\n\t\t\t\t , soundvolume = get_node(\"OptionsMenu\/Panel\/SoundVolume\/SoundSlider\").get_value()\n\t\t\t\t , musicvolume = get_node(\"OptionsMenu\/Panel\/MusicVolume\/MusicSlider\").get_value()\n\t\t\t\t , portnumber = get_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\").get_text()\n\t\t\t\t }\n\n\tpreload( \"res:\/\/scripts\/DataManager.gd\" ).new().saveConfig( config )\n\n\tvar field = get_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\")\n\tnetwork.setPort(field.get_text())\n\tnetwork.setPort(field.get_text())\n\t_on_Cancel_pressed()\n\nfunc _on_SP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Chooser.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_CHOOSER\n\nfunc _on_MainMenu_pressed():\n\tMenu_Chooser.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MainMenuMP_pressed():\n\tMenu_MP.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_MP.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MP\n\nfunc _on_MainMenuHG_pressed():\n\tMenu_HostGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\tnetwork.disconnect()\n\nfunc _on_HostGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_HostGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_HOSTGAME\n\n\tif !network.isHost and !network.isNetwork:\n\t\tprint(\"calling!\")\n\t\tnetwork.host(network.port)\n\t\tget_node(\"HostGame\/Panel\/Waiting\").set_text(\"Waiting for player to join on port \" + str(network.port) + \"...\")\n\nfunc _on_JoinGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_JoinGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_JOINGAME\n\nfunc _on_MainMenuJG_pressed():\n\tMenu_JoinGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\tif (network.isClient):\n\t\tnetwork.disconnect()\n\nfunc _on_RandomPuzzle_pressed(puzzle=null):\n\tgotoPuzzleScene(get_tree().get_root(), false, puzzle)\n\nstatic func gotoPuzzleScene(root, networked=false, puzzle=null):\n\tvar p = load( \"res:\/\/puzzle.scn\" ).instance()\n\tp.mainPuzzle = networked\n\n\tif puzzle != null:\n\t\tp.generateRandom = false\n\t\tp.get_node(\"GridView\/GridMan\").set_puzzle(puzzle)\n\t\tp.get_node(\"GridView\/GridMan\").setupCam()\n\n\t# called on idle time\n\tgoto_scene(root.get_tree(), [load(\"res:\/\/puzzleView.scn\").instance(), p])\n\nstatic func goto_scene(tree, scenes, freeAll=false):\n\tvar root = tree.get_root()\n\troot.print_tree()\n\tif freeAll:\n\t\tfor child in root.get_children():\n\t\t\tchild.queue_free()\n\telse:\n\t\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\tfor scn in scenes:\n\t\tscn.set_owner(root)\n\t\troot.call_deferred(\"add_child\", scn )\n\nfunc _on_Join_pressed():\n\tvar IPPanel = get_node(\"JoinGame\/Panel\/IPAddress\")\n\tvar ip = IPPanel.get_text();\n\n\tif (ip.empty()):\n\t\treturn\n\n\tif !network.isClient:\n\t\tnetwork.connectTo(ip, network.port)\n\n\nfunc _on_Editor_pressed():\n\t# called on idle time\n\tgoto_scene(get_tree(), [load(\"res:\/\/editor.scn\").instance()])\n\nfunc _on_LoadPuzzle_pressed():\n\tpreload(\"Editor.gd\").showLoadDialog(fileDialog, self)\n\n# called by the fileDialog\nfunc puzzleLoad():\n\tvar f = fileDialog.get_current_path()\n\tif f == null or f == \"\":\n\t\treturn\n\tprint(\"LOADING FROM \", f)\n\t_on_RandomPuzzle_pressed(preload(\"DataManager.gd\").loadPuzzle( f ))\n","old_contents":"# This script manages all of the GUI elements.\n# It switches between the states of the GUI allowing\n# the user to start games, edit the options or connect\n# to a multiplayer game.\n\nextends Node\n\n# network variables\nvar network\n\n# State variables.\nvar menuOn\nvar splashTween\n\n# Timers.\nvar timer\nvar initialWait = 0.5\nvar splashTimer = 2.0\nvar warningTimer = 5.0\n\n# GUI pieces.\nvar Splash_Team5\nvar Splash_Warning\nvar Menu_Main\nvar Menu_Chooser\nvar Menu_MP\nvar Menu_HostGame\nvar Menu_JoinGame\nvar Menu_Options\n\n# Menu state values. Used to switch between them.\nvar MENU_INIT\t\t\t= 0\nvar MENU_SPLASHTEAM5\t= 1\nvar MENU_SPLASHWARNING\t= 2\nvar MENU_MAIN\t\t\t= 3\nvar MENU_CHOOSER\t\t= 4\nvar MENU_MP\t\t\t\t= 5\nvar MENU_HOSTGAME\t\t= 6\nvar MENU_JOINGAME\t\t= 7\nvar MENU_OPTIONS\t\t= 8\n\n# Main Menu Theme\nvar samplePlayer = StreamPlayer.new()\nvar songs = [load(\"res:\/\/main_theme_antris.ogg\")]\n\n# Loader dialog\nvar saveDir\nvar fileDialog\n\nfunc skipTitle(skip):\n\tif skip:\n\t\tinitialWait = 0.01\n\t\tsplashTimer = 0.01\n\t\twarningTimer = 0.01\n\n# Function to be called once for setup.\nfunc _ready():\n\t# Initial setup.\n\tmenuOn = MENU_INIT\n\ttimer = 0.0\n\tset_process( true )\n\tset_process_input( true )\n\n\t# Setup the splash fader tween.\n\tsplashTween = Tween.new()\n\tget_node( \"SplashFader\" ).add_child( splashTween )\n\tsplashTween.interpolate_method( get_node( \"SplashFader\" ), \"set_opacity\", 1.0, 0.0, 1.0, Tween.TRANS_CUBIC, Tween.EASE_IN_OUT )\n\n\t# Gather all of the menus.\n\tSplash_Team5 = get_node( \"SplashTeam5\" )\n\tSplash_Warning = get_node( \"SplashWarning\" )\n\tMenu_Main = get_node( \"MainMenu\" )\n\tMenu_Chooser = get_node( \"ChooserMenu\" )\n\tMenu_MP = get_node( \"Multiplayer\" )\n\tMenu_HostGame = get_node( \"HostGame\" )\n\tMenu_JoinGame = get_node( \"JoinGame\" )\n\tMenu_Options = get_node( \"OptionsMenu\" )\n\n\tGlobals.set(\"Network\", load(\"res:\/\/scripts\/Network.gd\").new())\n\tnetwork = Globals.get(\"Network\")\n\n\tvar scn = load(\"res:\/\/networkProxy.scn\")\n\tadd_child(scn.instance())\n\tnetwork.root = get_tree().get_root()\n\n\t# Load the config.\n\tvar config = preload( \"res:\/\/scripts\/DataManager.gd\" ).new().loadConfig()\n\n\tget_node(\"OptionsMenu\/Panel\/OnlineName\/LineEdit\").set_text( config.name )\n\tget_node(\"OptionsMenu\/Panel\/SoundVolume\/SoundSlider\").set_value( config.soundvolume )\n\tget_node(\"OptionsMenu\/Panel\/MusicVolume\/MusicSlider\").set_value( config.musicvolume )\n\n\tnetwork.port = config.portnumber\n\n\t# Prepare puzzle loader dialog\n\tsaveDir = OS.get_data_dir() + \"\/PuzzleSaves\"\n\tfileDialog = preload(\"Editor.gd\").initLoadSaveDialog(self, get_tree(), saveDir)\n\n\t# Main Menu Theme\n\tGlobals.set(\"StreamPlayer\", samplePlayer)\n\tadd_child(samplePlayer)\n\tsamplePlayer.set_stream(songs[0])\n\tsamplePlayer.play()\n\n# Function to update the GUI.\nfunc _process( delta ):\n\t# Handle the initial wait.\n\tif( menuOn == MENU_INIT ):\n\t\tif( timer > initialWait ):\n\t\t\tmenuOn = MENU_SPLASHTEAM5\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiIn()\n\n\t# Handle the Team5 splash screen.\n\tif( menuOn == MENU_SPLASHTEAM5 ):\n\t\tif( timer > splashTimer ):\n\t\t\tmenuOn = MENU_SPLASHWARNING\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiOut()\n\t\t\tSplash_Warning.guiIn()\n\n\t# Handle the warning splash screen.\n\tif( menuOn == MENU_SPLASHWARNING ):\n\t\tif( timer > warningTimer ):\n\t\t\tmenuOn = MENU_MAIN\n\t\t\ttimer = 0.0\n\t\t\tSplash_Warning.guiOut()\n\t\t\tMenu_Main.guiIn()\n\t\t\tsplashTween.start()\n\n\t# Increase the timer each frame.\n\ttimer += delta\n\n# Handle the input events.\nfunc _input( ev ):\n\t# Handle skip splash screens.\n\tif( !ev.is_pressed() and ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT ):\n\t\tif( menuOn == MENU_SPLASHTEAM5 || menuOn == MENU_SPLASHWARNING ):\n\t\t\ttimer = 999.0;\n\n\t# Handle exit.\n\tif( ev.is_action( \"ui_cancel\" ) ):\n\t\texit()\n\nfunc exit():\n\tprint( \"Exiting\" )\n\tOS.get_main_loop().quit()\n\nfunc _on_Exit_pressed():\n\texit()\n\n# TODO save to ConfigFile, load this on beginning\nfunc _on_Options_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Options.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_OPTIONS\n\tget_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\").set_text(str(network.port))\n\nfunc _on_Cancel_pressed():\n\tMenu_Options.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_SaveQuit_pressed():\n\t# Save the options.\n\n\tvar config = { name = get_node(\"OptionsMenu\/Panel\/OnlineName\/LineEdit\").get_text()\n\t\t\t\t , soundvolume = get_node(\"OptionsMenu\/Panel\/SoundVolume\/SoundSlider\").get_value()\n\t\t\t\t , musicvolume = get_node(\"OptionsMenu\/Panel\/MusicVolume\/MusicSlider\").get_value()\n\t\t\t\t , portnumber = get_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\").get_text()\n\t\t\t\t }\n\n\tpreload( \"res:\/\/scripts\/DataManager.gd\" ).new().saveConfig( config )\n\n\tvar field = get_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\")\n\tnetwork.setPort(field.get_text())\n\tnetwork.setPort(field.get_text())\n\t_on_Cancel_pressed()\n\nfunc _on_SP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Chooser.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_CHOOSER\n\nfunc _on_MainMenu_pressed():\n\tMenu_Chooser.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MainMenuMP_pressed():\n\tMenu_MP.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_MP.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MP\n\nfunc _on_MainMenuHG_pressed():\n\tMenu_HostGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\tnetwork.disconnect()\n\nfunc _on_HostGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_HostGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_HOSTGAME\n\n\tif !network.isHost and !network.isNetwork:\n\t\tprint(\"calling!\")\n\t\tnetwork.host(network.port)\n\t\tget_node(\"HostGame\/Panel\/Waiting\").set_text(\"Waiting for player to join on port \" + str(network.port) + \"...\")\n\nfunc _on_JoinGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_JoinGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_JOINGAME\n\nfunc _on_MainMenuJG_pressed():\n\tMenu_JoinGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\tif (network.isClient):\n\t\tnetwork.disconnect()\n\nfunc _on_RandomPuzzle_pressed(puzzle=null):\n\tgotoPuzzleScene(get_tree().get_root(), false, puzzle)\n\nstatic func gotoPuzzleScene(root, networked=false, puzzle=null):\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\troot.add_child( preload( \"res:\/\/puzzleView.scn\" ).instance() )\n\tvar p = preload( \"res:\/\/puzzle.scn\" ).instance()\n\tp.mainPuzzle = networked\n\n\tif puzzle != null:\n\t\tp.generateRandom = false\n\t\tp.get_node(\"GridView\/GridMan\").set_puzzle(puzzle)\n\t\tp.get_node(\"GridView\/GridMan\").setupCam()\n\n\troot.add_child( p )\n\n\nfunc _on_Join_pressed():\n\tvar IPPanel = get_node(\"JoinGame\/Panel\/IPAddress\")\n\tvar ip = IPPanel.get_text();\n\n\tif (ip.empty()):\n\t\treturn\n\n\tif !network.isClient:\n\t\tnetwork.connectTo(ip, network.port)\n\n\nfunc _on_Editor_pressed():\n\tvar root = get_tree().get_root()\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\troot.add_child( ResourceLoader.load( \"res:\/\/editor.scn\" ).instance() )\n\n\nfunc _on_LoadPuzzle_pressed():\n\tpreload(\"Editor.gd\").showLoadDialog(fileDialog, self)\n\n# called by the fileDialog\nfunc puzzleLoad():\n\tvar f = fileDialog.get_current_path()\n\tif f == null or f == \"\":\n\t\treturn\n\tprint(\"LOADING FROM \", f)\n\t_on_RandomPuzzle_pressed(preload(\"DataManager.gd\").loadPuzzle( f ))\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"24b3ac52d4e46a59201a030850dfc86d72bd0782","subject":"beaten and won game over popups","message":"beaten and won game over popups\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/GridMan.gd","new_file":"src\/scripts\/GridMan.gd","new_contents":"extends Spatial\n\n# Is there a better way to do this?\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\n# Block selection handling.\nvar offClick = false\nvar selectedBlocks = []\n\n# Puzzle vars.\nvar puzzle\nvar puzzleLoaded = false\nvar blockNodes = {}\n\n# Beam stuff.\nconst beamScn = preload( \"res:\/\/blocks\/block.scn\" )\nconst Beam = preload(\"res:\/\/scripts\/Blocks\/Beam.gd\")\n\n# sounds\nvar samplePlayer = SamplePlayer.new()\n\nfunc addPickledBlock(block):\n\tvar b = block.toNode()\n\n\t# TODO any special treatment for the wild blocks?\n\t# TODO keep track of puzzle.lasers ? How to?\n\tblockNodes[block.blockPos] = b\n\n\tif puzzleLoaded:\n\t\t# keep pickled block\n\t\tpuzzle.shape[block.blockPos] = block\n\n\t\t# keep track of puzzle.pairCounts\n\t\tvar layer = calcBlockLayerVec(b.blockPos)\n\t\tif b.getBlockType() == 2:\n\t\t\twhile puzzle.pairCount.size() <= layer:\n\t\t\t\tpuzzle.pairCount.append(0)\n\t\t\tpuzzle.puzzleLayers = puzzle.pairCount.size() - 1\n\t\t\tpuzzle.pairCount[layer] += 0.5\n\n\n\tadd_child(b)\n\treturn b\n\nfunc get_block(pos):\n\tif blockNodes.has(pos):\n\t\treturn blockNodes[pos]\n\telse:\n\t\treturn null\n\n# unused key argument needed for the tween_complete signal\nfunc remove_block(block, key=null):\n\tvar block_node = blockNodes[block.blockPos]\n\n\tpuzzle.shape[block_node.blockPos] = null\n\tblockNodes[block_node.blockPos] = null\n\n\tif block_node == null:\n\t\treturn\n\n\tfor child in block_node.get_children():\n\t\tblock_node.remove_and_delete_child(child)\n\tremove_and_delete_child(block_node)\n\n# Sets the puzzle for this GridMan.\nfunc set_puzzle(puzz):\n\t# verify puzzle\n\tif puzz == null:\n\t\tprint(\"INVALID PUZZLE\")\n\t\treturn\n\n\t# delete all current nodes\n\tif puzzle != null:\n\t\tfor pos in puzzle.shape:\n\t\t\tremove_block(puzzle.shape[pos])\n\tpuzzleLoaded = false\n\n\t# Store the puzzle.\n\tpuzzle = puzz\n\n\t\t# # I can do my own counting!\n\t# needed for adding blocks in the editor\n\tfor k in puzzle.shape:\n\t\t# Create a block node, add it to the tree\n\t\taddPickledBlock(puzzle.shape[k])\n\tpuzzleLoaded = true\n\n# Clears any selected blocks. WE SHOULD FIX THIS, THERE CAN ONLY BE ONE BLOCK SELECTED AT ANY ONE TIME, NO NEED FOR AN ARRAY!\nfunc clearSelection():\n\tfor bl in selectedBlocks:\n\t\tvar blo = get_node( bl )\n\t\tblo.setSelected(false)\n\t\tblo.scaleTweenNode(1.0).start()\n\tselectedBlocks = []\n\n# Add the selected block to the selected list. WE SHOULD FIX THIS, IT ONLY NEEDS TO STORE IT, NOT AN ARRAY!\nfunc addSelected(bl):\n\tselectedBlocks.append(bl)\n\n# Used for the multiplayer mode to force click a block on their side.\nfunc forceClickBlock( pos ):\n\tblockNodes[pos].forceClick()\n\nfunc clickBlock( name ):\n\t#now check if that was the second block we picked. If it was, we want to\n\t#unselect the blocks again\n\tif (offClick):\n\t\toffClick = false\n\t\taddSelected(name)\n\t\tclearSelection()\n\telse:\n\t\toffClick = true;\n\t\taddSelected(name)\n\n# Calculates the layer that a block is on.\n# COPY OF FUNCTION IN PUZZLEMAN, IS THERE A BETTER WAY TO DO THIS?!\nfunc calcBlockLayer( x, y, z ):\n\treturn max( max( abs( x ), abs( y ) ), abs( z ) )\nfunc calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\nfunc beatenWithScore(othersScore):\n\tprint( \"BEATEN!\" )\n\tvar pauseMenu = get_tree().get_root().get_node( \"Spatial\" ).get_node( \"Camera\" ).pauseMenu\n\tpauseMenu.set_text(\"GAME OVER\\nYou've been beaten with time: \" + othersScore)\n\tpauseMenu.popup_centered()\n\nfunc win():\n\tprint( \"GAME OVER!\" )\n\tvar pauseMenu = get_tree().get_root().get_node( \"Spatial\" ).get_node( \"Camera\" ).pauseMenu\n\tpauseMenu.set_text(\"GAME OVER\\nYou win with time: \" + get_parent().get_parent().time.val)\n\tpauseMenu.popup_centered()\n\n\n# Handles keeping track of pairs being removed.\nfunc popPair( pos ):\n\tvar blayer = calcBlockLayerVec( pos )\n\tpuzzle.pairCount[blayer] -= 1\n\n\tif( puzzle.pairCount[blayer] == 0 ):\n\t\tprint(\"LAYER CLEARED\")\n\t\tif blayer == 1:\n\t\t\twin()\n\n\t\tfor b in puzzle.shape:\n\t\t\tif not ( puzzle.shape[b] == null ):\n\t\t\t\tif calcBlockLayerVec( b ) == blayer:\n\t\t\t\t\tif blockNodes[b].getBlockType() == BLOCK_LASER:\n\t\t\t\t\t\tblockNodes[b].forceActivate()\n\n\t\t# Fire beams.\n\t\tvar beamNum = 0\n\t\tfor l in range( puzzle.lasers.size() ):\n\t\t\tif calcBlockLayerVec( puzzle.lasers[l][0] ) == blayer:\n\t\t\t\t# Firin mah lazerz!\n\t\t\t\tvar beam = beamScn.instance()\n\n\t\t\t\tbeam.set_name( str(blayer) + \"_beam_\" + str(beamNum) )\n\t\t\t\tbeamNum += 1\n\t\t\t\tbeam.set_script( Beam )\n\n\t\t\t\tadd_child( beam )\n\t\t\t\tbeam.fire( puzzle.lasers[l][0], puzzle.lasers[l][1] )\n\n\t\t\t\tsamplePlayer.play( \"soundslikewillem_hitting_slinky\" )\n\n\nfunc _init():\n\t# Load sound\n\tsamplePlayer.set_voice_count(10)\n\tsamplePlayer.set_sample_library(ResourceLoader.load(\"new_samplelibrary.xml\"))\n\tprint(\"GridMan initialized\")\n\nfunc _ready():\n\tsetupCam()\n\nfunc setupCam():\n\tvar cam = get_tree().get_root().get_node( \"Spatial\/Camera\" )\n\tif cam == null or puzzle == null:\n\t\treturn\n\tvar totalSize = ( puzzle.puzzleLayers * 2 + 1 )\n\tcam.distance.val = 4.5 * totalSize\n\tcam.distance.min_ = 3 * totalSize\n\tcam.distance.max_ = 10 * totalSize\n\tcam.recalculate_camera()\n\n\n","old_contents":"extends Spatial\n\n# Is there a better way to do this?\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\n# Block selection handling.\nvar offClick = false\nvar selectedBlocks = []\n\n# Puzzle vars.\nvar puzzle\nvar puzzleLoaded = false\nvar blockNodes = {}\n\n# Beam stuff.\nconst beamScn = preload( \"res:\/\/blocks\/block.scn\" )\nconst Beam = preload(\"res:\/\/scripts\/Blocks\/Beam.gd\")\n\n# sounds\nvar samplePlayer = SamplePlayer.new()\n\nfunc addPickledBlock(block):\n\tvar b = block.toNode()\n\n\t# TODO any special treatment for the wild blocks?\n\t# TODO keep track of puzzle.lasers ? How to?\n\tblockNodes[block.blockPos] = b\n\n\tif puzzleLoaded:\n\t\t# keep pickled block\n\t\tpuzzle.shape[block.blockPos] = block\n\n\t\t# keep track of puzzle.pairCounts\n\t\tvar layer = calcBlockLayerVec(b.blockPos)\n\t\tif b.getBlockType() == 2:\n\t\t\twhile puzzle.pairCount.size() <= layer:\n\t\t\t\tpuzzle.pairCount.append(0)\n\t\t\tpuzzle.puzzleLayers = puzzle.pairCount.size() - 1\n\t\t\tpuzzle.pairCount[layer] += 0.5\n\n\n\tadd_child(b)\n\treturn b\n\nfunc get_block(pos):\n\tif blockNodes.has(pos):\n\t\treturn blockNodes[pos]\n\telse:\n\t\treturn null\n\n# unused key argument needed for the tween_complete signal\nfunc remove_block(block, key=null):\n\tvar block_node = blockNodes[block.blockPos]\n\n\tpuzzle.shape[block_node.blockPos] = null\n\tblockNodes[block_node.blockPos] = null\n\n\tif block_node == null:\n\t\treturn\n\n\tfor child in block_node.get_children():\n\t\tblock_node.remove_and_delete_child(child)\n\tremove_and_delete_child(block_node)\n\n# Sets the puzzle for this GridMan.\nfunc set_puzzle(puzz):\n\t# verify puzzle\n\tif puzz == null:\n\t\tprint(\"INVALID PUZZLE\")\n\t\treturn\n\n\t# delete all current nodes\n\tif puzzle != null:\n\t\tfor pos in puzzle.shape:\n\t\t\tremove_block(puzzle.shape[pos])\n\tpuzzleLoaded = false\n\n\t# Store the puzzle.\n\tpuzzle = puzz\n\n\t\t# # I can do my own counting!\n\t# needed for adding blocks in the editor\n\tfor k in puzzle.shape:\n\t\t# Create a block node, add it to the tree\n\t\taddPickledBlock(puzzle.shape[k])\n\tpuzzleLoaded = true\n\n# Clears any selected blocks. WE SHOULD FIX THIS, THERE CAN ONLY BE ONE BLOCK SELECTED AT ANY ONE TIME, NO NEED FOR AN ARRAY!\nfunc clearSelection():\n\tfor bl in selectedBlocks:\n\t\tvar blo = get_node( bl )\n\t\tblo.setSelected(false)\n\t\tblo.scaleTweenNode(1.0).start()\n\tselectedBlocks = []\n\n# Add the selected block to the selected list. WE SHOULD FIX THIS, IT ONLY NEEDS TO STORE IT, NOT AN ARRAY!\nfunc addSelected(bl):\n\tselectedBlocks.append(bl)\n\n# Used for the multiplayer mode to force click a block on their side.\nfunc forceClickBlock( pos ):\n\tblockNodes[pos].forceClick()\n\nfunc clickBlock( name ):\n\t#now check if that was the second block we picked. If it was, we want to\n\t#unselect the blocks again\n\tif (offClick):\n\t\toffClick = false\n\t\taddSelected(name)\n\t\tclearSelection()\n\telse:\n\t\toffClick = true;\n\t\taddSelected(name)\n\n# Calculates the layer that a block is on.\n# COPY OF FUNCTION IN PUZZLEMAN, IS THERE A BETTER WAY TO DO THIS?!\nfunc calcBlockLayer( x, y, z ):\n\treturn max( max( abs( x ), abs( y ) ), abs( z ) )\nfunc calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n# Handles keeping track of pairs being removed.\nfunc popPair( pos ):\n\tvar blayer = calcBlockLayerVec( pos )\n\tpuzzle.pairCount[blayer] -= 1\n\n\tif( puzzle.pairCount[blayer] == 0 ):\n\t\tprint(\"LAYER CLEARED\")\n\t\tif blayer == 1:\n\t\t\tprint( \"GAME OVER!\" )\n\t\t\tvar pauseMenu = get_tree().get_root().get_node( \"Spatial\" ).get_node( \"Camera\" ).pauseMenu\n\t\t\tpauseMenu.set_text(\"GAME OVER\\nSCORE:1,000,000\")\n\t\t\t# TODO set timeout!!!\n\t\t\tpauseMenu.popup_centered()\n\n\t\tfor b in puzzle.shape:\n\t\t\tif not ( puzzle.shape[b] == null ):\n\t\t\t\tif calcBlockLayerVec( b ) == blayer:\n\t\t\t\t\tif blockNodes[b].getBlockType() == BLOCK_LASER:\n\t\t\t\t\t\tblockNodes[b].forceActivate()\n\n\t\t# Fire beams.\n\t\tvar beamNum = 0\n\t\tfor l in range( puzzle.lasers.size() ):\n\t\t\tif calcBlockLayerVec( puzzle.lasers[l][0] ) == blayer:\n\t\t\t\t# Firin mah lazerz!\n\t\t\t\tvar beam = beamScn.instance()\n\n\t\t\t\tbeam.set_name( str(blayer) + \"_beam_\" + str(beamNum) )\n\t\t\t\tbeamNum += 1\n\t\t\t\tbeam.set_script( Beam )\n\n\t\t\t\tadd_child( beam )\n\t\t\t\tbeam.fire( puzzle.lasers[l][0], puzzle.lasers[l][1] )\n\n\t\t\t\tsamplePlayer.play( \"soundslikewillem_hitting_slinky\" )\n\n\nfunc _init():\n\t# Load sound\n\tsamplePlayer.set_voice_count(10)\n\tsamplePlayer.set_sample_library(ResourceLoader.load(\"new_samplelibrary.xml\"))\n\tprint(\"GridMan initialized\")\n\nfunc _ready():\n\tsetupCam()\n\nfunc setupCam():\n\tvar cam = get_tree().get_root().get_node( \"Spatial\/Camera\" )\n\tif cam == null or puzzle == null:\n\t\treturn\n\tvar totalSize = ( puzzle.puzzleLayers * 2 + 1 )\n\tcam.distance.val = 4.5 * totalSize\n\tcam.distance.min_ = 3 * totalSize\n\tcam.distance.max_ = 10 * totalSize\n\tcam.recalculate_camera()\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"222f94444ab22c036b81c03ad65c00a65e0f989b","subject":"Fix incorrect comment in hierarchical FSM demo script","message":"Fix incorrect comment in hierarchical FSM demo script\n\nThis closes #433.\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"2d\/finite_state_machine\/state_machine\/state_machine.gd","new_file":"2d\/finite_state_machine\/state_machine\/state_machine.gd","new_contents":"extends Node\n# Base interface for a generic state machine.\n# It handles initializing, setting the machine active or not\n# delegating _physics_process, _input calls to the State nodes,\n# and changing the current\/active state.\n# See the PlayerV2 scene for an example on how to use it.\n\nsignal state_changed(current_state)\n\n# You should set a starting node from the inspector or on the node that inherits\n# from this state machine interface. If you don't, the game will default to\n# the first state in the state machine's children.\nexport(NodePath) var start_state\nvar states_map = {}\n\nvar states_stack = []\nvar current_state = null\nvar _active = false setget set_active\n\nfunc _ready():\n\tif not start_state:\n\t\tstart_state = get_child(0).get_path()\n\tfor child in get_children():\n\t\tchild.connect(\"finished\", self, \"_change_state\")\n\tinitialize(start_state)\n\n\nfunc initialize(initial_state):\n\tset_active(true)\n\tstates_stack.push_front(get_node(initial_state))\n\tcurrent_state = states_stack[0]\n\tcurrent_state.enter()\n\n\nfunc set_active(value):\n\t_active = value\n\tset_physics_process(value)\n\tset_process_input(value)\n\tif not _active:\n\t\tstates_stack = []\n\t\tcurrent_state = null\n\n\nfunc _input(event):\n\tcurrent_state.handle_input(event)\n\n\nfunc _physics_process(delta):\n\tcurrent_state.update(delta)\n\n\nfunc _on_animation_finished(anim_name):\n\tif not _active:\n\t\treturn\n\tcurrent_state._on_animation_finished(anim_name)\n\n\nfunc _change_state(state_name):\n\tif not _active:\n\t\treturn\n\tcurrent_state.exit()\n\n\tif state_name == \"previous\":\n\t\tstates_stack.pop_front()\n\telse:\n\t\tstates_stack[0] = states_map[state_name]\n\n\tcurrent_state = states_stack[0]\n\temit_signal(\"state_changed\", current_state)\n\n\tif state_name != \"previous\":\n\t\tcurrent_state.enter()\n","old_contents":"extends Node\n# Base interface for a generic state machine.\n# It handles initializing, setting the machine active or not\n# delegating _physics_process, _input calls to the State nodes,\n# and changing the current\/active state.\n# See the PlayerV2 scene for an example on how to use it.\n\nsignal state_changed(current_state)\n\n# You must set a starting node from the inspector or on\n# the node that inherits from this state machine interface.\n# If you don't the game will crash (on purpose, so you won't\n# forget to initialize the state machine).\nexport(NodePath) var start_state\nvar states_map = {}\n\nvar states_stack = []\nvar current_state = null\nvar _active = false setget set_active\n\nfunc _ready():\n\tif not start_state:\n\t\tstart_state = get_child(0).get_path()\n\tfor child in get_children():\n\t\tchild.connect(\"finished\", self, \"_change_state\")\n\tinitialize(start_state)\n\n\nfunc initialize(initial_state):\n\tset_active(true)\n\tstates_stack.push_front(get_node(initial_state))\n\tcurrent_state = states_stack[0]\n\tcurrent_state.enter()\n\n\nfunc set_active(value):\n\t_active = value\n\tset_physics_process(value)\n\tset_process_input(value)\n\tif not _active:\n\t\tstates_stack = []\n\t\tcurrent_state = null\n\n\nfunc _input(event):\n\tcurrent_state.handle_input(event)\n\n\nfunc _physics_process(delta):\n\tcurrent_state.update(delta)\n\n\nfunc _on_animation_finished(anim_name):\n\tif not _active:\n\t\treturn\n\tcurrent_state._on_animation_finished(anim_name)\n\n\nfunc _change_state(state_name):\n\tif not _active:\n\t\treturn\n\tcurrent_state.exit()\n\t\n\tif state_name == \"previous\":\n\t\tstates_stack.pop_front()\n\telse:\n\t\tstates_stack[0] = states_map[state_name]\n\t\n\tcurrent_state = states_stack[0]\n\temit_signal(\"state_changed\", current_state)\n\t\n\tif state_name != \"previous\":\n\t\tcurrent_state.enter()\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"1fa992374e12880ea8af4c09586399b39d473346","subject":"No change","message":"No change\n","repos":"DaddySmash\/GraphicsGame,DaddySmash\/GraphicsGame","old_file":"app\/scene\/unitTestForSaving.gd","new_file":"app\/scene\/unitTestForSaving.gd","new_contents":"\nextends Node2D\n\n# member variables here, example:\n# var a=2\n# var b=\"textvar\"\n\nfunc _ready():\n\t# Initalization here\n\t#var value = get_node(\"\/root\/global\").getSavedHighScore()\n\tget_node(\"\/root\/global\").saveHighScore()\n\t\n\t#get_node(\"\/root\/global\").savedHighScore = \"NO NO NO\"\n\t#get_node(\"\/root\/global\").savedHighTime = \"NO NO NO\"\n\tget_node(\"\/root\/global\").savedHighDifficulty = \"NO NO NO\"\n\tget_node(\"\/root\/global\").savedHighName = \"NO NO NO\"\n\t\n\tget_node(\"\/root\/global\").loadHighScore()\n\t\n\tget_node(\"Panel\").get_node(\"Label 1\").set_text(get_node(\"\/root\/global\").savedHighScore)\n\tget_node(\"Panel\").get_node(\"Label 2\").set_text(get_node(\"\/root\/global\").savedHighTime)\n\tget_node(\"Panel\").get_node(\"Label 3\").set_text(get_node(\"\/root\/global\").savedHighDifficulty)\n\tget_node(\"Panel\").get_node(\"Label 4\").set_text(get_node(\"\/root\/global\").savedHighName)","old_contents":"\nextends Node2D\n\n# member variables here, example:\n# var a=2\n# var b=\"textvar\"\n\nfunc _ready():\n\t# Initalization here\n\t#var value = get_node(\"\/root\/global\").getSavedHighScore()\n\tget_node(\"\/root\/global\").saveHighScore()\n\t\n\tget_node(\"\/root\/global\").savedHighScore = \"NO NO NO\"\n\tget_node(\"\/root\/global\").savedHighTime = \"NO NO NO\"\n\tget_node(\"\/root\/global\").savedHighDifficulty = \"NO NO NO\"\n\tget_node(\"\/root\/global\").savedHighName = \"NO NO NO\"\n\t\n\tget_node(\"\/root\/global\").loadHighScore()\n\t\n\tget_node(\"Panel\").get_node(\"Label 1\").set_text(get_node(\"\/root\/global\").savedHighScore)\n\tget_node(\"Panel\").get_node(\"Label 2\").set_text(get_node(\"\/root\/global\").savedHighTime)\n\tget_node(\"Panel\").get_node(\"Label 3\").set_text(get_node(\"\/root\/global\").savedHighDifficulty)\n\tget_node(\"Panel\").get_node(\"Label 4\").set_text(get_node(\"\/root\/global\").savedHighName)","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"fdb0d77e8864cc47c92e5c85dc412c6bb450ef44","subject":"Fixed style issues in IK Demo. Added a bit of static typing hints to the LookAt IK file to better fit the rest of the scripts","message":"Fixed style issues in IK Demo. Added a bit of static typing hints to the LookAt IK file to better fit the rest of the scripts\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"3d\/ik\/addons\/sade\/ik_look_at.gd","new_file":"3d\/ik\/addons\/sade\/ik_look_at.gd","new_contents":"tool\nextends Spatial\n\nexport(NodePath) var skeleton_path setget _set_skeleton_path\nexport(String) var bone_name = \"\"\nexport(int, \"_process\", \"_physics_process\", \"_notification\", \"none\") var update_mode = 0 setget _set_update\nexport(int, \"X-up\", \"Y-up\", \"Z-up\") var look_at_axis = 1\nexport(bool) var use_our_rotation_x = false\nexport(bool) var use_our_rotation_y = false\nexport(bool) var use_our_rotation_z = false\nexport(bool) var use_negative_our_rot = false\nexport(Vector3) var additional_rotation = Vector3()\nexport(bool) var position_using_additional_bone = false\nexport(String) var additional_bone_name = \"\"\nexport(float) var additional_bone_length = 1\nexport(bool) var debug_messages = false\n\nvar skeleton_to_use: Skeleton = null\nvar first_call: bool = true\nvar _editor_indicator: Spatial = null\n\n\nfunc _ready():\n\tset_process(false)\n\tset_physics_process(false)\n\tset_notify_transform(false)\n\t\n\tif update_mode == 0:\n\t\tset_process(true)\n\telif update_mode == 1:\n\t\tset_physics_process(true)\n\telif update_mode == 2:\n\t\tset_notify_transform(true)\n\telse:\n\t\tif debug_messages == true:\n\t\t\tprint (name, \" - IK_LookAt: Unknown update mode. NOT updating skeleton\")\n\t\n\tif Engine.editor_hint == true:\n\t\t_setup_for_editor()\n\n\nfunc _process(_delta):\n\tupdate_skeleton()\n\n\nfunc _physics_process(_delta):\n\tupdate_skeleton()\n\n\nfunc _notification(what):\n\tif what == NOTIFICATION_TRANSFORM_CHANGED:\n\t\tupdate_skeleton()\n\n\nfunc update_skeleton():\n\t# NOTE: Because get_node doesn't work in _ready, we need to skip\n\t# a call before doing anything.\n\tif first_call == true:\n\t\tfirst_call = false\n\t\tif skeleton_to_use == null:\n\t\t\t_set_skeleton_path(skeleton_path)\n\t\n\t\n\t# If we do not have a skeleton and\/or we're not supposed to update, then return.\n\tif skeleton_to_use == null:\n\t\treturn\n\tif update_mode >= 3:\n\t\treturn\n\t\n\t# Get the bone\n\tvar bone : int = skeleton_to_use.find_bone(bone_name)\n\t\n\t# If no bone is found (-1), then return (and optionally print an error)\n\tif bone == -1:\n\t\tif debug_messages == true:\n\t\t\tprint (name, \" - IK_LookAt: No bone in skeleton found with name [\", bone_name, \"]!\")\n\t\treturn\n\t\n\t# get the bone's rest position\n\tvar rest = skeleton_to_use.get_bone_global_pose(bone)\n\t\n\t# Convert our position relative to the skeleton's transform\n\tvar target_pos = skeleton_to_use.global_transform.xform_inv(global_transform.origin)\n\t\n\t# Call helper's look_at function with the chosen up axis.\n\tif look_at_axis == 0:\n\t\trest = rest.looking_at(target_pos, Vector3(1, 0, 0))\n\telif look_at_axis == 1:\n\t\trest = rest.looking_at(target_pos, Vector3(0, 1, 0))\n\telif look_at_axis == 2:\n\t\trest = rest.looking_at(target_pos, Vector3(0, 0, 1))\n\telse:\n\t\trest = rest.looking_at(target_pos, Vector3(0, 1, 0))\n\t\tif debug_messages == true:\n\t\t\tprint (name, \" - IK_LookAt: Unknown look_at_axis value!\")\n\t\n\t# Get our rotation euler, and the bone's rotation euler\n\tvar rest_euler = rest.basis.get_euler()\n\tvar self_euler = global_transform.basis.orthonormalized().get_euler()\n\t\n\t# If we using negative rotation, we flip our rotation euler\n\tif use_negative_our_rot == true:\n\t\tself_euler = -self_euler\n\t\n\t# Apply our rotation euler, if wanted\/required\n\tif use_our_rotation_x == true:\n\t\trest_euler.x = self_euler.x\n\tif use_our_rotation_y == true:\n\t\trest_euler.y = self_euler.y\n\tif use_our_rotation_z == true:\n\t\trest_euler.z = self_euler.z\n\t\n\t# Rotate the bone by the (potentially) changed euler angle(s)\n\trest.basis = Basis(rest_euler)\n\t\n\t# If we have additional rotation, then rotate it by the local rotation vectors\n\tif additional_rotation != Vector3.ZERO:\n\t\trest.basis = rest.basis.rotated(rest.basis.x, deg2rad(additional_rotation.x))\n\t\trest.basis = rest.basis.rotated(rest.basis.y, deg2rad(additional_rotation.y))\n\t\trest.basis = rest.basis.rotated(rest.basis.z, deg2rad(additional_rotation.z))\n\t\n\tif position_using_additional_bone:\n\t\tvar additional_bone_id = skeleton_to_use.find_bone(additional_bone_name)\n\t\tvar additional_bone_pos = skeleton_to_use.get_bone_global_pose(additional_bone_id)\n\t\trest.origin = additional_bone_pos.origin - additional_bone_pos.basis.z.normalized() * additional_bone_length\n\t\n\t# Finally, apply the bone rotation to the skeleton\n\tskeleton_to_use.set_bone_global_pose_override(bone, rest, 1.0, true)\n\n\nfunc _setup_for_editor():\n\t# So we can see the target in the editor, let's create a mesh instance,\n\t# Add it as our child, and name it\n\t_editor_indicator = MeshInstance.new()\n\tadd_child(_editor_indicator)\n\t_editor_indicator.name = \"(EditorOnly) Visual indicator\"\n\n\t# We need to make a mesh for the mesh instance.\n\t# The code below makes a small sphere mesh\n\tvar indicator_mesh = SphereMesh.new()\n\tindicator_mesh.radius = 0.1\n\tindicator_mesh.height = 0.2\n\tindicator_mesh.radial_segments = 8\n\tindicator_mesh.rings = 4\n\n\t# The mesh needs a material (unless we want to use the defualt one).\n\t# Let's create a material and use the EditorGizmoTexture to texture it.\n\tvar indicator_material = SpatialMaterial.new()\n\tindicator_material.flags_unshaded = true\n\tindicator_material.albedo_texture = preload(\"editor_gizmo_texture.png\")\n\tindicator_material.albedo_color = Color(1, 0.5, 0, 1)\n\tindicator_mesh.material = indicator_material\n\t_editor_indicator.mesh = indicator_mesh\n\n\nfunc _set_update(new_value):\n\tupdate_mode = new_value\n\t\n\t# Set all of our processes to false\n\tset_process(false)\n\tset_physics_process(false)\n\tset_notify_transform(false)\n\t\n\t# Based on the value of upate, change how we handle updating the skeleton\n\tif update_mode == 0:\n\t\tset_process(true)\n\t\tif debug_messages == true:\n\t\t\tprint (name, \" - IK_LookAt: updating skeleton using _process...\")\n\telif update_mode == 1:\n\t\tset_physics_process(true)\n\t\tif debug_messages == true:\n\t\t\tprint (name, \" - IK_LookAt: updating skeleton using _physics_process...\")\n\telif update_mode == 2:\n\t\tset_notify_transform(true)\n\t\tif debug_messages == true:\n\t\t\tprint (name, \" - IK_LookAt: updating skeleton using _notification...\")\n\telse:\n\t\tif debug_messages == true:\n\t\t\tprint (name, \" - IK_LookAt: NOT updating skeleton due to unknown update method...\")\n\n\nfunc _set_skeleton_path(new_value):\n\t# Because get_node doesn't work in the first call, we just want to assign instead\n\t# This is to get around a issue with NodePaths exposed to the editor\n\tif first_call == true:\n\t\tskeleton_path = new_value\n\t\treturn\n\t\n\t# Assign skeleton_path to whatever value is passed\n\tskeleton_path = new_value\n\t\n\tif skeleton_path == null:\n\t\tif debug_messages == true:\n\t\t\tprint (name, \" - IK_LookAt: No Nodepath selected for skeleton_path!\")\n\t\treturn\n\t\n\t# Get the node at that location, if there is one\n\tvar temp = get_node(skeleton_path)\n\tif temp != null:\n\t\t# If the node has the method \"find_bone\" then we can assume it is (likely) a skeleton\n\t\tif temp.has_method(\"find_bone\") == true:\n\t\t\tskeleton_to_use = temp\n\t\t\tif debug_messages == true:\n\t\t\t\tprint (name, \" - IK_LookAt: attached to (new) skeleton\")\n\t\t# If not, then it's (likely) not a skeleton\n\t\telse:\n\t\t\tskeleton_to_use = null\n\t\t\tif debug_messages == true:\n\t\t\t\tprint (name, \" - IK_LookAt: skeleton_path does not point to a skeleton!\")\n\telse:\n\t\tif debug_messages == true:\n\t\t\tprint (name, \" - IK_LookAt: No Nodepath selected for skeleton_path!\")\n","old_contents":"tool\nextends Spatial\n\nexport(NodePath) var skeleton_path setget _set_skeleton_path\nexport(String) var bone_name = \"\"\nexport(int, \"_process\", \"_physics_process\", \"_notification\", \"none\") var update_mode = 0 setget _set_update\nexport(int, \"X-up\", \"Y-up\", \"Z-up\") var look_at_axis = 1\nexport(bool) var use_our_rotation_x = false\nexport(bool) var use_our_rotation_y = false\nexport(bool) var use_our_rotation_z = false\nexport(bool) var use_negative_our_rot = false\nexport(Vector3) var additional_rotation = Vector3()\nexport (bool) var position_using_additional_bone = false\nexport (String) var additional_bone_name = \"\"\nexport (float) var additional_bone_length = 1\nexport(bool) var debug_messages = false\n\nvar skeleton_to_use\nvar first_call = true\nvar _editor_indicator = null\n\n\nfunc _ready():\n\tset_process(false)\n\tset_physics_process(false)\n\tset_notify_transform(false)\n\t\n\tif update_mode == 0:\n\t\tset_process(true)\n\telif update_mode == 1:\n\t\tset_physics_process(true)\n\telif update_mode == 2:\n\t\tset_notify_transform(true)\n\telse:\n\t\tif debug_messages == true:\n\t\t\tprint (name, \" - IK_LookAt: Unknown update mode. NOT updating skeleton\")\n\t\n\tif Engine.editor_hint == true:\n\t\t_setup_for_editor()\n\n\nfunc _process(_delta):\n\tupdate_skeleton()\n\n\nfunc _physics_process(_delta):\n\tupdate_skeleton()\n\n\nfunc _notification(what):\n\tif what == NOTIFICATION_TRANSFORM_CHANGED:\n\t\tupdate_skeleton()\n\n\nfunc update_skeleton():\n\t# NOTE: Because get_node doesn't work in _ready, we need to skip\n\t# a call before doing anything.\n\tif first_call == true:\n\t\tfirst_call = false\n\t\tif skeleton_to_use == null:\n\t\t\t_set_skeleton_path(skeleton_path)\n\t\n\t\n\t# If we do not have a skeleton and\/or we're not supposed to update, then return.\n\tif skeleton_to_use == null:\n\t\treturn\n\tif update_mode >= 3:\n\t\treturn\n\t\n\t# Get the bone\n\tvar bone = skeleton_to_use.find_bone(bone_name)\n\t\n\t# If no bone is found (-1), then return (and optionally print an error)\n\tif bone == -1:\n\t\tif debug_messages == true:\n\t\t\tprint (name, \" - IK_LookAt: No bone in skeleton found with name [\", bone_name, \"]!\")\n\t\treturn\n\t\n\t# get the bone's rest position\n\tvar rest = skeleton_to_use.get_bone_global_pose(bone)\n\t\n\t# Convert our position relative to the skeleton's transform\n\tvar target_pos = skeleton_to_use.global_transform.xform_inv(global_transform.origin)\n\t\n\t# Call helper's look_at function with the chosen up axis.\n\tif look_at_axis == 0:\n\t\trest = rest.looking_at(target_pos, Vector3(1, 0, 0))\n\telif look_at_axis == 1:\n\t\trest = rest.looking_at(target_pos, Vector3(0, 1, 0))\n\telif look_at_axis == 2:\n\t\trest = rest.looking_at(target_pos, Vector3(0, 0, 1))\n\telse:\n\t\trest = rest.looking_at(target_pos, Vector3(0, 1, 0))\n\t\tif debug_messages == true:\n\t\t\tprint (name, \" - IK_LookAt: Unknown look_at_axis value!\")\n\t\n\t# Get our rotation euler, and the bone's rotation euler\n\tvar rest_euler = rest.basis.get_euler()\n\tvar self_euler = global_transform.basis.orthonormalized().get_euler()\n\t\n\t# If we using negative rotation, we flip our rotation euler\n\tif use_negative_our_rot == true:\n\t\tself_euler = -self_euler\n\t\n\t# Apply our rotation euler, if wanted\/required\n\tif use_our_rotation_x == true:\n\t\trest_euler.x = self_euler.x\n\tif use_our_rotation_y == true:\n\t\trest_euler.y = self_euler.y\n\tif use_our_rotation_z == true:\n\t\trest_euler.z = self_euler.z\n\t\n\t# Rotate the bone by the (potentially) changed euler angle(s)\n\trest.basis = Basis(rest_euler)\n\t\n\t# If we have additional rotation, then rotate it by the local rotation vectors\n\tif additional_rotation != Vector3.ZERO:\n\t\trest.basis = rest.basis.rotated(rest.basis.x, deg2rad(additional_rotation.x))\n\t\trest.basis = rest.basis.rotated(rest.basis.y, deg2rad(additional_rotation.y))\n\t\trest.basis = rest.basis.rotated(rest.basis.z, deg2rad(additional_rotation.z))\n\t\n\tif position_using_additional_bone:\n\t\tvar additional_bone_id = skeleton_to_use.find_bone(additional_bone_name)\n\t\tvar additional_bone_pos = skeleton_to_use.get_bone_global_pose(additional_bone_id)\n\t\trest.origin = additional_bone_pos.origin - additional_bone_pos.basis.z.normalized() * additional_bone_length\n\t\n\t# Finally, apply the bone rotation to the skeleton\n\tskeleton_to_use.set_bone_global_pose_override(bone, rest, 1.0, true)\n\n\nfunc _setup_for_editor():\n\t# So we can see the target in the editor, let's create a mesh instance,\n\t# Add it as our child, and name it\n\t_editor_indicator = MeshInstance.new()\n\tadd_child(_editor_indicator)\n\t_editor_indicator.name = \"(EditorOnly) Visual indicator\"\n\n\t# We need to make a mesh for the mesh instance.\n\t# The code below makes a small sphere mesh\n\tvar indicator_mesh = SphereMesh.new()\n\tindicator_mesh.radius = 0.1\n\tindicator_mesh.height = 0.2\n\tindicator_mesh.radial_segments = 8\n\tindicator_mesh.rings = 4\n\n\t# The mesh needs a material (unless we want to use the defualt one).\n\t# Let's create a material and use the EditorGizmoTexture to texture it.\n\tvar indicator_material = SpatialMaterial.new()\n\tindicator_material.flags_unshaded = true\n\tindicator_material.albedo_texture = preload(\"editor_gizmo_texture.png\")\n\tindicator_material.albedo_color = Color(1, 0.5, 0, 1)\n\tindicator_mesh.material = indicator_material\n\t_editor_indicator.mesh = indicator_mesh\n\n\nfunc _set_update(new_value):\n\tupdate_mode = new_value\n\t\n\t# Set all of our processes to false\n\tset_process(false)\n\tset_physics_process(false)\n\tset_notify_transform(false)\n\t\n\t# Based on the value of upate, change how we handle updating the skeleton\n\tif update_mode == 0:\n\t\tset_process(true)\n\t\tif debug_messages == true:\n\t\t\tprint (name, \" - IK_LookAt: updating skeleton using _process...\")\n\telif update_mode == 1:\n\t\tset_physics_process(true)\n\t\tif debug_messages == true:\n\t\t\tprint (name, \" - IK_LookAt: updating skeleton using _physics_process...\")\n\telif update_mode == 2:\n\t\tset_notify_transform(true)\n\t\tif debug_messages == true:\n\t\t\tprint (name, \" - IK_LookAt: updating skeleton using _notification...\")\n\telse:\n\t\tif debug_messages == true:\n\t\t\tprint (name, \" - IK_LookAt: NOT updating skeleton due to unknown update method...\")\n\n\nfunc _set_skeleton_path(new_value):\n\t# Because get_node doesn't work in the first call, we just want to assign instead\n\t# This is to get around a issue with NodePaths exposed to the editor\n\tif first_call == true:\n\t\tskeleton_path = new_value\n\t\treturn\n\t\n\t# Assign skeleton_path to whatever value is passed\n\tskeleton_path = new_value\n\t\n\tif skeleton_path == null:\n\t\tif debug_messages == true:\n\t\t\tprint (name, \" - IK_LookAt: No Nodepath selected for skeleton_path!\")\n\t\treturn\n\t\n\t# Get the node at that location, if there is one\n\tvar temp = get_node(skeleton_path)\n\tif temp != null:\n\t\t# If the node has the method \"find_bone\" then we can assume it is (likely) a skeleton\n\t\tif temp.has_method(\"find_bone\") == true:\n\t\t\tskeleton_to_use = temp\n\t\t\tif debug_messages == true:\n\t\t\t\tprint (name, \" - IK_LookAt: attached to (new) skeleton\")\n\t\t# If not, then it's (likely) not a skeleton\n\t\telse:\n\t\t\tskeleton_to_use = null\n\t\t\tif debug_messages == true:\n\t\t\t\tprint (name, \" - IK_LookAt: skeleton_path does not point to a skeleton!\")\n\telse:\n\t\tif debug_messages == true:\n\t\t\tprint (name, \" - IK_LookAt: No Nodepath selected for skeleton_path!\")\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"1835876be9911ea6751434edc09cf5e35aaae346","subject":"Re add is_player property","message":"Re add is_player property\n","repos":"mvr\/abyme","old_file":"Block.gd","new_file":"Block.gd","new_contents":"extends Node2D\n\n################################################################################\n### Vars\n\n# Gameplay\nonready var tilemap = self.get_node(\"TileMap\")\nenum TILES {TILE_EMPTY, TILE_WALL}\n\nexport(NodePath) var parent_block_path = null\nexport(Vector2) var position_on_parent = Vector2(0, 0)\nexport(bool) var is_player = false\n\nvar parent_block = null\nvar child_blocks = []\n\n# Movement animation\nvar is_moving = false\nvar move_vector = Vector2(0.0, 0.0)\nvar previous_parent = null\nvar previous_position_on_parent = self.position_on_parent\n\nvar current_move_time = 0\n\n# Drawing\nonready var viewport = self.get_node(\"SelfViewport\")\nonready var self_rect = self.get_self_rect()\n\n################################################################################\n### Setup\n\nfunc _ready():\n\t# Add to block group\n\tself.add_to_group(\"blocks\")\n\n\t# Setup viewport\n\tviewport.set_world_2d(self.get_world_2d())\n\tviewport.set_rect(self.self_rect)\n\t#viewport.set_size_override(true, self.self_rect.size)\n\tvar transform = Matrix32(0, -self.self_rect.pos)\n\tviewport.set_canvas_transform(transform)\n\n\tself.set_fixed_process(true)\n\n\n################################################################################\n### Parents and Siblings\n\nfunc find_children():\n\tvar all_blocks = get_tree().get_nodes_in_group(\"blocks\")\n\tvar child_blocks = []\n\tfor b in all_blocks:\n\t\tif b.parent_block == self:\n\t\t\tchild_blocks.append(b)\n\treturn child_blocks\n\nfunc set_child_blocks():\n\tself.child_blocks = self.find_children()\n\nfunc find_parent_block():\n\tself.parent_block = self.get_node(self.parent_block_path)\n\tself.previous_parent = self.parent_block\n\n################################################################################\n### Block position\n# Represents a square in the world\n\nclass BlockPosition:\n\tvar block = null\n\tvar position = Vector2(0, 0)\n\n\tfunc _init(b, p):\n\t\tself.block = b\n\t\tself.position = p\n\n\tfunc get_tile_id():\n\t\treturn self.block.tilemap.get_cell(self.position.x, self.position.y)\n\n\tfunc adjacent(move_vect):\n\t\treturn adjacent_recurse(move_vect, self.block)\n\n\tfunc adjacent_recurse(move_vect, original):\n\t\tvar newpos = self.position + move_vect\n\n\t\tif newpos.x < 0:\n\t\t\tnewpos.x = Constants.block_size - 1\n\t\telif newpos.x >= Constants.block_size:\n\t\t\tnewpos.x = 0\n\t\telif newpos.y < 0:\n\t\t\tnewpos.y = Constants.block_size - 1\n\t\telif newpos.y >= Constants.block_size:\n\t\t\tnewpos.y = 0\n\t\telse:\n\t\t\treturn get_script().new(self.block, newpos)\n\n\t\t# We left the block\n\n\t\tif self.block.parent_block == original:\n\t\t\treturn null\n\n\t\tvar newsquare = self.block.own_position().adjacent_recurse(move_vect, original)\n\n\t\tif newsquare == null:\n\t\t\treturn null\n\n\t\tvar newblock = newsquare.block_at()\n\n\t\tif newblock == null:\n\t\t\treturn null\n\n\t\treturn get_script().new(newblock, newpos)\n\n\tfunc is_underlying_walkable():\n\t\treturn self.get_tile_id() == TILE_EMPTY\n\n\tfunc block_at():\n\t\tfor b in self.block.child_blocks:\n\t\t\tif b.position_on_parent == self.position:\n\t\t\t\treturn b\n\t\treturn null\n\n\tfunc is_empty():\n\t\tif not self.is_underlying_walkable():\n\t\t\treturn false\n\n\t\tif not self.block_at() == null:\n\t\t\treturn false\n\n\t\treturn true\n\nfunc own_position():\n\treturn BlockPosition.new(parent_block, position_on_parent)\n\nfunc adjacent_blocks():\n\treturn adjacent_blocks_with_displacement().keys()\n\nfunc adjacent_blocks_with_displacement():\n\tvar adjacents = {}\n\tvar a = null\n\n\ta = self.own_position().adjacent(\"left\")\n\tif not a == null:\n\t\tvar b = a.block_at()\n\t\tif not b == null:\n\t\t\tadjacents[b] = Vector2(-1, 0)\n\n\ta = self.own_position().adjacent(\"right\")\n\tif not a == null:\n\t\tvar b = a.block_at()\n\t\tif not b == null:\n\t\t\tadjacents[b] = Vector2(1, 0)\n\n\ta = self.own_position().adjacent(\"up\")\n\tif not a == null:\n\t\tvar b = a.block_at()\n\t\tif not b == null:\n\t\t\tadjacents[b] = Vector2(0, -1)\n\n\ta = self.own_position().adjacent(\"down\")\n\tif not a == null:\n\t\tvar b = a.block_at()\n\t\tif not b == null:\n\t\t\tadjacents[b] = Vector2(0, 1)\n\n\treturn adjacents\n\n################################################################################\n### Drawing\n\nfunc get_self_rect():\n\tvar pos = tilemap.get_global_pos()\n\t# TODO: scale?\n\tvar s = Constants.block_size * tilemap.get_cell_size()\n\treturn Rect2(pos, s)\n\nfunc visual_position_on_parent():\n\tif self.is_moving:\n\t\tvar t = easing_function(self.current_move_time \/ Constants.move_duration)\n\n\t\treturn interpolate(t, self.position_on_parent - self.move_vector, self.position_on_parent)\n\telse:\n\t\treturn self.position_on_parent\n\nfunc draw_self_texture_on(block, position):\n\tvar texture = self.viewport.get_render_target_texture()\n\n\tvar to_parent_transform = block.get_global_transform() * self.get_global_transform().affine_inverse()\n\n\tvar cell_size = self.tilemap.get_cell_size() # TODO: self?\n\tvar drawrect = Rect2(position, cell_size)\n\n\tself.draw_set_transform_matrix(to_parent_transform)\n\tself.draw_texture_rect(texture, drawrect, false)\n\nfunc _draw(): # TODO: think about clearing the render target every frame\n\t# Border\n\t# var s = Constants.block_size * tilemap.get_cell_size().x\n\t# var grey = Color(0.5, 0.5, 0.5)\n\t# self.draw_line(Vector2(0, 0), Vector2(0, s), grey, 1)\n\t# self.draw_line(Vector2(0, s), Vector2(s, s), grey, 1)\n\t# self.draw_line(Vector2(s, s), Vector2(s, 0), grey, 1)\n\t# self.draw_line(Vector2(s, 0), Vector2(0, 0), grey, 1)\n\n\tif self.is_moving:\n\t\tvar t = easing_function(self.current_move_time \/ Constants.move_duration)\n\n\t\tvar newpos = self.parent_block.tilemap.map_to_world(self.position_on_parent)\n\t\tvar oldpos = self.parent_block.tilemap.map_to_world(self.position_on_parent - self.move_vector)\n\n\t\tvar pos = interpolate(t, oldpos, newpos)\n\t\tself.draw_self_texture_on(self.parent_block, pos)\n\n\t\tif not self.previous_parent == self.parent_block:\n\t\t\tvar newpos = self.previous_parent.tilemap.map_to_world(self.previous_position_on_parent + self.move_vector)\n\t\t\tvar oldpos = self.previous_parent.tilemap.map_to_world(self.previous_position_on_parent)\n\n\t\t\tvar pos = interpolate(t, oldpos, newpos)\n\t\t\tself.draw_self_texture_on(self.previous_parent, pos)\n\telse:\n\t\tvar worldcoords = self.parent_block.tilemap.map_to_world(self.position_on_parent)\n\t\tself.draw_self_texture_on(self.parent_block, worldcoords)\n\nfunc interpolate(t, x1, x2):\n\treturn (1-t)*x1 + t*x2\n\nfunc easing_function(t):\n\tvar u0 = 0\n\tvar u1 = 0.2\n\tvar u2 = 0.95\n\tvar u3 = 1\n\treturn u0 * (1-t*t*t) + 3*u1*(1-t*t)*t + 3*u2*(1-t)*t*t + u3*t*t*t*t\n\nfunc _fixed_process(delta):\n\tif self.is_moving:\n\t\tself.current_move_time += delta\n\t\tif self.current_move_time > Constants.move_duration:\n\t\t\tself.is_moving = false\n\t\t\tself.current_move_time = 0\n\n\t\tself.update()\n\n################################################################################\n### Movement\n\nfunc try_move(move_vect):\n\tif self.is_moving:\n\t\treturn\n\n\tvar a = self.own_position().adjacent(move_vect)\n\tif a == null:\n\t\treturn\n\n\tif a.is_empty():\n\t\tdo_move(move_vect, a)\n\nfunc do_move(move_vect, new_square):\n\tself.is_moving = true\n\tself.move_vector = move_vect\n\n\tself.previous_parent = self.parent_block\n\tself.previous_position_on_parent = self.position_on_parent\n\n\tself.parent_block = new_square.block\n\tself.position_on_parent = new_square.position\n\n\tif not self.parent_block == self.previous_parent:\n\t\tself.previous_parent.child_blocks.erase(self)\n\t\tself.parent_block.child_blocks.append(self)\n","old_contents":"extends Node2D\n\n################################################################################\n### Vars\n\n# Gameplay\nonready var tilemap = self.get_node(\"TileMap\")\nenum TILES {TILE_EMPTY, TILE_WALL}\n\nexport(NodePath) var parent_block_path = null\nexport(Vector2) var position_on_parent = Vector2(0, 0)\n\nvar parent_block = null\nvar child_blocks = []\n\n# Movement animation\nvar is_moving = false\nvar move_vector = Vector2(0.0, 0.0)\nvar previous_parent = null\nvar previous_position_on_parent = self.position_on_parent\n\nvar current_move_time = 0\n\n# Drawing\nonready var viewport = self.get_node(\"SelfViewport\")\nonready var self_rect = self.get_self_rect()\n\n################################################################################\n### Setup\n\nfunc _ready():\n\t# Add to block group\n\tself.add_to_group(\"blocks\")\n\n\t# Setup viewport\n\tviewport.set_world_2d(self.get_world_2d())\n\tviewport.set_rect(self.self_rect)\n\t#viewport.set_size_override(true, self.self_rect.size)\n\tvar transform = Matrix32(0, -self.self_rect.pos)\n\tviewport.set_canvas_transform(transform)\n\n\tself.set_fixed_process(true)\n\n\n################################################################################\n### Parents and Siblings\n\nfunc find_children():\n\tvar all_blocks = get_tree().get_nodes_in_group(\"blocks\")\n\tvar child_blocks = []\n\tfor b in all_blocks:\n\t\tif b.parent_block == self:\n\t\t\tchild_blocks.append(b)\n\treturn child_blocks\n\nfunc set_child_blocks():\n\tself.child_blocks = self.find_children()\n\nfunc find_parent_block():\n\tself.parent_block = self.get_node(self.parent_block_path)\n\tself.previous_parent = self.parent_block\n\n################################################################################\n### Block position\n# Represents a square in the world\n\nclass BlockPosition:\n\tvar block = null\n\tvar position = Vector2(0, 0)\n\n\tfunc _init(b, p):\n\t\tself.block = b\n\t\tself.position = p\n\n\tfunc get_tile_id():\n\t\treturn self.block.tilemap.get_cell(self.position.x, self.position.y)\n\n\tfunc adjacent(move_vect):\n\t\treturn adjacent_recurse(move_vect, self.block)\n\n\tfunc adjacent_recurse(move_vect, original):\n\t\tvar newpos = self.position + move_vect\n\n\t\tif newpos.x < 0:\n\t\t\tnewpos.x = Constants.block_size - 1\n\t\telif newpos.x >= Constants.block_size:\n\t\t\tnewpos.x = 0\n\t\telif newpos.y < 0:\n\t\t\tnewpos.y = Constants.block_size - 1\n\t\telif newpos.y >= Constants.block_size:\n\t\t\tnewpos.y = 0\n\t\telse:\n\t\t\treturn get_script().new(self.block, newpos)\n\n\t\t# We left the block\n\n\t\tif self.block.parent_block == original:\n\t\t\treturn null\n\n\t\tvar newsquare = self.block.own_position().adjacent_recurse(move_vect, original)\n\n\t\tif newsquare == null:\n\t\t\treturn null\n\n\t\tvar newblock = newsquare.block_at()\n\n\t\tif newblock == null:\n\t\t\treturn null\n\n\t\treturn get_script().new(newblock, newpos)\n\n\tfunc is_underlying_walkable():\n\t\treturn self.get_tile_id() == TILE_EMPTY\n\n\tfunc block_at():\n\t\tfor b in self.block.child_blocks:\n\t\t\tif b.position_on_parent == self.position:\n\t\t\t\treturn b\n\t\treturn null\n\n\tfunc is_empty():\n\t\tif not self.is_underlying_walkable():\n\t\t\treturn false\n\n\t\tif not self.block_at() == null:\n\t\t\treturn false\n\n\t\treturn true\n\nfunc own_position():\n\treturn BlockPosition.new(parent_block, position_on_parent)\n\nfunc adjacent_blocks():\n\treturn adjacent_blocks_with_displacement().keys()\n\nfunc adjacent_blocks_with_displacement():\n\tvar adjacents = {}\n\tvar a = null\n\n\ta = self.own_position().adjacent(\"left\")\n\tif not a == null:\n\t\tvar b = a.block_at()\n\t\tif not b == null:\n\t\t\tadjacents[b] = Vector2(-1, 0)\n\n\ta = self.own_position().adjacent(\"right\")\n\tif not a == null:\n\t\tvar b = a.block_at()\n\t\tif not b == null:\n\t\t\tadjacents[b] = Vector2(1, 0)\n\n\ta = self.own_position().adjacent(\"up\")\n\tif not a == null:\n\t\tvar b = a.block_at()\n\t\tif not b == null:\n\t\t\tadjacents[b] = Vector2(0, -1)\n\n\ta = self.own_position().adjacent(\"down\")\n\tif not a == null:\n\t\tvar b = a.block_at()\n\t\tif not b == null:\n\t\t\tadjacents[b] = Vector2(0, 1)\n\n\treturn adjacents\n\n################################################################################\n### Drawing\n\nfunc get_self_rect():\n\tvar pos = tilemap.get_global_pos()\n\t# TODO: scale?\n\tvar s = Constants.block_size * tilemap.get_cell_size()\n\treturn Rect2(pos, s)\n\nfunc visual_position_on_parent():\n\tif self.is_moving:\n\t\tvar t = easing_function(self.current_move_time \/ Constants.move_duration)\n\n\t\treturn interpolate(t, self.position_on_parent - self.move_vector, self.position_on_parent)\n\telse:\n\t\treturn self.position_on_parent\n\nfunc draw_self_texture_on(block, position):\n\tvar texture = self.viewport.get_render_target_texture()\n\n\tvar to_parent_transform = block.get_global_transform() * self.get_global_transform().affine_inverse()\n\n\tvar cell_size = self.tilemap.get_cell_size() # TODO: self?\n\tvar drawrect = Rect2(position, cell_size)\n\n\tself.draw_set_transform_matrix(to_parent_transform)\n\tself.draw_texture_rect(texture, drawrect, false)\n\nfunc _draw(): # TODO: think about clearing the render target every frame\n\t# Border\n\t# var s = Constants.block_size * tilemap.get_cell_size().x\n\t# var grey = Color(0.5, 0.5, 0.5)\n\t# self.draw_line(Vector2(0, 0), Vector2(0, s), grey, 1)\n\t# self.draw_line(Vector2(0, s), Vector2(s, s), grey, 1)\n\t# self.draw_line(Vector2(s, s), Vector2(s, 0), grey, 1)\n\t# self.draw_line(Vector2(s, 0), Vector2(0, 0), grey, 1)\n\n\tif self.is_moving:\n\t\tvar t = easing_function(self.current_move_time \/ Constants.move_duration)\n\n\t\tvar newpos = self.parent_block.tilemap.map_to_world(self.position_on_parent)\n\t\tvar oldpos = self.parent_block.tilemap.map_to_world(self.position_on_parent - self.move_vector)\n\n\t\tvar pos = interpolate(t, oldpos, newpos)\n\t\tself.draw_self_texture_on(self.parent_block, pos)\n\n\t\tif not self.previous_parent == self.parent_block:\n\t\t\tvar newpos = self.previous_parent.tilemap.map_to_world(self.previous_position_on_parent + self.move_vector)\n\t\t\tvar oldpos = self.previous_parent.tilemap.map_to_world(self.previous_position_on_parent)\n\n\t\t\tvar pos = interpolate(t, oldpos, newpos)\n\t\t\tself.draw_self_texture_on(self.previous_parent, pos)\n\telse:\n\t\tvar worldcoords = self.parent_block.tilemap.map_to_world(self.position_on_parent)\n\t\tself.draw_self_texture_on(self.parent_block, worldcoords)\n\nfunc interpolate(t, x1, x2):\n\treturn (1-t)*x1 + t*x2\n\nfunc easing_function(t):\n\tvar u0 = 0\n\tvar u1 = 0.2\n\tvar u2 = 0.95\n\tvar u3 = 1\n\treturn u0 * (1-t*t*t) + 3*u1*(1-t*t)*t + 3*u2*(1-t)*t*t + u3*t*t*t*t\n\nfunc _fixed_process(delta):\n\tif self.is_moving:\n\t\tself.current_move_time += delta\n\t\tif self.current_move_time > Constants.move_duration:\n\t\t\tself.is_moving = false\n\t\t\tself.current_move_time = 0\n\n\t\tself.update()\n\n################################################################################\n### Movement\n\nfunc try_move(move_vect):\n\tif self.is_moving:\n\t\treturn\n\n\tvar a = self.own_position().adjacent(move_vect)\n\tif a == null:\n\t\treturn\n\n\tif a.is_empty():\n\t\tdo_move(move_vect, a)\n\nfunc do_move(move_vect, new_square):\n\tself.is_moving = true\n\tself.move_vector = move_vect\n\n\tself.previous_parent = self.parent_block\n\tself.previous_position_on_parent = self.position_on_parent\n\n\tself.parent_block = new_square.block\n\tself.position_on_parent = new_square.position\n\n\tif not self.parent_block == self.previous_parent:\n\t\tself.previous_parent.child_blocks.erase(self)\n\t\tself.parent_block.child_blocks.append(self)\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"GDScript"} {"commit":"4820903ada6b97ceebb8a1f32b8e8159684e5f83","subject":"fix : resume button grabs focus when menu opened with keyboard but not with clicking\/touching","message":"fix : resume button grabs focus when menu opened with keyboard but not with clicking\/touching\n","repos":"arnaudcoj\/godot_game_jam_2016,arnaudcoj\/godot_game_jam_2016","old_file":"sources\/scripts\/menu_screen.gd","new_file":"sources\/scripts\/menu_screen.gd","new_contents":"extends CanvasLayer\n\nsignal pause\nsignal restart\nsignal menu\n\nvar enabled = true\nvar open = false\nonready var animation = get_node(\"animation\")\nonready var button = get_node(\"pause_button\")\nonready var menu_screen = get_node(\"menu_screen\")\nonready var buttons = menu_screen.get_node(\"buttons\")\n\n\nfunc _ready():\n\tset_process_input(true)\n\nfunc _input(event):\n\tif !open && event.is_action_released(\"start\"):\n\t\thandle_pause()\n\t\tbuttons.get_node(\"resume_button\").grab_focus()\n\n\nfunc set_enabled(enabled):\n\tself.enabled = enabled\n\tmenu_screen.set_hidden(!enabled)\n\tbutton.set_hidden(!enabled)\n\nfunc _on_animation_finished():\n\tif animation.get_current_animation() == \"open\":\n\t\topen = !open\n\nfunc handle_pause():\n\tif !animation.is_playing():\n\t\tif !open:\n\t\t\tanimation.play(\"open\")\n\t\t\temit_signal(\"pause\")\n\t\t\tget_tree().set_pause(true)\n\t\t\tmenu_screen.reset()\n\t\telse:\n\t\t\tanimation.play_backwards(\"open\")\n\t\t\tget_tree().set_pause(false)\n\t\t\tmenu_screen.stop()\n\nfunc _on_pause_button_released():\n\tif !open:\n\t\thandle_pause()\n\nfunc _on_restart_button_pressed():\n\tif open:\n\t\temit_signal(\"restart\")\n\nfunc _on_resume_button_pressed():\n\tif open:\n\t\thandle_pause()\n\t\tbuttons.get_node(\"resume_button\").release_focus()\n\nfunc _on_menu_button_pressed():\n\tif open:\n\t\temit_signal(\"menu\")\n","old_contents":"extends CanvasLayer\n\nsignal pause\nsignal restart\nsignal menu\n\nvar enabled = true\nvar open = false\nonready var animation = get_node(\"animation\")\nonready var button = get_node(\"pause_button\")\nonready var menu_screen = get_node(\"menu_screen\")\nonready var buttons = menu_screen.get_node(\"buttons\")\n\n\nfunc _ready():\n\tset_process_input(true)\n\nfunc _input(event):\n\tif !open && event.is_action_released(\"start\"):\n\t\thandle_pause()\n\n\nfunc set_enabled(enabled):\n\tself.enabled = enabled\n\tmenu_screen.set_hidden(!enabled)\n\tbutton.set_hidden(!enabled)\n\nfunc _on_animation_finished():\n\tif animation.get_current_animation() == \"open\":\n\t\topen = !open\n\nfunc handle_pause():\n\tif !animation.is_playing():\n\t\tif !open:\n\t\t\tbuttons.get_node(\"resume_button\").grab_focus()\n\t\t\tanimation.play(\"open\")\n\t\t\temit_signal(\"pause\")\n\t\t\tget_tree().set_pause(true)\n\t\t\tmenu_screen.reset()\n\t\telse:\n\t\t\tanimation.play_backwards(\"open\")\n\t\t\tget_tree().set_pause(false)\n\t\t\tmenu_screen.stop()\n\nfunc _on_pause_button_released():\n\tif !open:\n\t\thandle_pause()\n\nfunc _on_restart_button_pressed():\n\tif open:\n\t\temit_signal(\"restart\")\n\nfunc _on_resume_button_pressed():\n\tif open:\n\t\thandle_pause()\n\nfunc _on_menu_button_pressed():\n\tif open:\n\t\temit_signal(\"menu\")\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"53c16a0577230252b9f3e1458c1172cccb0f6e65","subject":"Fix sorting function","message":"Fix sorting function\n","repos":"ruipsrosario\/godot-responsive-control","old_file":"source\/addons\/responsive_controls\/ResponsiveSection.gd","new_file":"source\/addons\/responsive_controls\/ResponsiveSection.gd","new_contents":"tool\nextends Control\n\nvar ResponsiveSizing = preload(\"ResponsiveSizing.gd\")\nvar sizingNodes = [ ]\nvar parentControl\n\nfunc _ready():\n\trefreshParent()\n\trefreshSizings()\n\tprocessParentResizing()\n\n# Function to refresh the parentControl with the parent Control node of the current node\n# NOTE - This function should be manually called if this node is either unparented \/ reparented\nfunc refreshParent():\n\tparentControl = get_parent()\n\tif parentControl != null && parentControl extends Control:\n\t\tparentControl.connect(\"resized\", self, \"processParentResizing\")\n\telse:\n\t\tparentControl = null\n\n# Dynamically chooses the Responsive Sizing node that better relates to the current size of the\n# parent Control and applies it\nfunc processParentResizing():\n\tif parentControl != null:\n\t\tvar parentSize = parentControl.get_size()\n\t\tfor sizingNode in sizingNodes:\n\t\t\tif sizingNode.isEligible(parentSize):\n\t\t\t\tsizingNode.applyTo(self)\n\t\t\t\tbreak\n\n# Function to refresh the sizingNodes array with all the Responsive Sizing children\n# NOTE - This function should be manually called if the children of the current node are changed\n# (e.g. add or remove Responsive Sizing children)\nfunc refreshSizings():\n\tsizingNodes.clear()\n\tfor child in get_children():\n\t\tif child extends ResponsiveSizing:\n\t\t\tsizingNodes.append(child)\n\tsizingNodes.sort_custom(self, \"sortSizingNodes\")\n\n# Sorts the Responsive Sizing children nodes from largest to smallest (prioritizing width)\nfunc sortSizingNodes(node1, node2):\n\tif node1.minimumParentSize.width != node2.minimumParentSize.width:\n\t\treturn node1.minimumParentSize.width > node2.minimumParentSize.width\n\treturn node1.minimumParentSize.height > node2.minimumParentSize.height\n","old_contents":"tool\nextends Control\n\nvar ResponsiveSizing = preload(\"ResponsiveSizing.gd\")\nvar sizingNodes = [ ]\nvar parentControl\n\nfunc _ready():\n\trefreshParent()\n\trefreshSizings()\n\tprocessParentResizing()\n\n# Function to refresh the parentControl with the parent Control node of the current node\n# NOTE - This function should be manually called if this node is either unparented \/ reparented\nfunc refreshParent():\n\tparentControl = get_parent()\n\tif parentControl != null && parentControl extends Control:\n\t\tparentControl.connect(\"resized\", self, \"processParentResizing\")\n\telse:\n\t\tparentControl = null\n\n# Dynamically chooses the Responsive Sizing node that better relates to the current size of the\n# parent Control and applies it\nfunc processParentResizing():\n\tif parentControl != null:\n\t\tvar parentSize = parentControl.get_size()\n\t\tfor sizingNode in sizingNodes:\n\t\t\tif sizingNode.isEligible(parentSize):\n\t\t\t\tsizingNode.applyTo(self)\n\t\t\t\tbreak\n\n# Function to refresh the sizingNodes array with all the Responsive Sizing children\n# NOTE - This function should be manually called if the children of the current node are changed\n# (e.g. add or remove Responsive Sizing children)\nfunc refreshSizings():\n\tsizingNodes.clear()\n\tfor child in get_children():\n\t\tif child extends ResponsiveSizing:\n\t\t\tsizingNodes.append(child)\n\tsizingNodes.sort_custom(self, \"sortSizingNodes\")\n\n# Sorts the Responsive Sizing children nodes from largest to smallest (prioritizing width)\nfunc sortSizingNodes(node1, node2):\n\tvar nodeSize1 = node1.get_size()\n\tvar nodeSize2 = node2.get_size()\n\tif nodeSize1.width != nodeSize2.width:\n\t\treturn nodeSize1.width > nodeSize2.width\n\treturn nodeSize1.height > nodeSize2.height\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"692bccbb426dd249a0682cd95c01120c948f0200","subject":"Add another user. Mock chris","message":"Add another user. Mock chris\n","repos":"h4de5\/spiel4","old_file":"game\/main\/game.gd","new_file":"game\/main\/game.gd","new_contents":"# main node to start game with, holds background, does ship spawing\nextends Node2D\n\nfunc _ready():\n\tprint (\"reset everything - new game\")\n\n\tvar camera_scn = load(global.scene_path_camera)\n\tvar camera_node = camera_scn.instance()\n\tadd_child(camera_node, true)\n\n\tfor i in range(2): spawn_enemy()\n\n\tfor i in range(1): spawn_tower()\n\n\tfor i in range(2): spawn_pickup()\n\n\n\t# Background node\n\t# player_manager node\n\nfunc spawn_player(processor, device_details):\n\tvar player_scn = load(global.scene_path_player)\n\tvar player_node = player_scn.instance()\n\tget_node(\"ships\").add_child(player_node, true)\n\n\tplayer_node.get_node(\"processor_selector\").set_processor(processor)\n\tplayer_node.get_node(\"processor_selector\").set_processor_details(device_details)\n\nfunc spawn_enemy():\n\tvar scn = load(global.scene_path_enemy)\n\tvar node = scn.instance()\n\tget_node(\"ships\").add_child(node, true)\n\nfunc spawn_tower():\n\tvar scn = load(global.scene_path_tower)\n\tvar node = scn.instance()\n\tget_node(\"ships\").add_child(node, true)\n\nfunc spawn_pickup():\n\tvar scn = load(global.scene_path_pickup)\n\tvar node = scn.instance()\n\tget_node(\"objects\").add_child(node, true)\n\n\n\t# http:\/\/www.gamefromscratch.com\/post\/2015\/02\/23\/Godot-Engine-Tutorial-Part-6-Multiple-Scenes-and-Global-Variables.aspx\n#\n#\tfunc _ready():\n#\t #On load set the current scene to the last scene available\n#\t currentScene = get_tree().get_root().get_child(get_tree().get_root().get_child_count() -1)\n#\t #Demonstrate setting a global variable.\n#\t Globals.set(\"MAX_POWER_LEVEL\",9000)\n#\n#\t# create a function to switch between scenes\n#\tfunc setScene(scene):\n#\t #clean up the current scene\n#\t currentScene.queue_free()\n#\t #load the file passed in as the param \"scene\"\n#\t var s = ResourceLoader.load(scene)\n#\t #create an instance of our scene\n#\t currentScene = s.instance()\n#\t # add scene to root\n#\t get_tree().get_root().add_child(currentScene)\n#","old_contents":"# main node to start game with, holds background, does ship spawing\nextends Node2D\n\nfunc _ready():\n\tprint (\"reset everything - new game\")\n\n\tvar camera_scn = load(global.scene_path_camera)\n\tvar camera_node = camera_scn.instance()\n\tadd_child(camera_node, true)\n\n\tfor i in range(1): spawn_enemy()\n\n\tfor i in range(1): spawn_tower()\n\n\tfor i in range(2): spawn_pickup()\n\n\n\t# Background node\n\t# player_manager node\n\nfunc spawn_player(processor, device_details):\n\tvar player_scn = load(global.scene_path_player)\n\tvar player_node = player_scn.instance()\n\tget_node(\"ships\").add_child(player_node, true)\n\n\tplayer_node.get_node(\"processor_selector\").set_processor(processor)\n\tplayer_node.get_node(\"processor_selector\").set_processor_details(device_details)\n\nfunc spawn_enemy():\n\tvar scn = load(global.scene_path_enemy)\n\tvar node = scn.instance()\n\tget_node(\"ships\").add_child(node, true)\n\nfunc spawn_tower():\n\tvar scn = load(global.scene_path_tower)\n\tvar node = scn.instance()\n\tget_node(\"ships\").add_child(node, true)\n\nfunc spawn_pickup():\n\tvar scn = load(global.scene_path_pickup)\n\tvar node = scn.instance()\n\tget_node(\"objects\").add_child(node, true)\n\n\n\t# http:\/\/www.gamefromscratch.com\/post\/2015\/02\/23\/Godot-Engine-Tutorial-Part-6-Multiple-Scenes-and-Global-Variables.aspx\n#\n#\tfunc _ready():\n#\t #On load set the current scene to the last scene available\n#\t currentScene = get_tree().get_root().get_child(get_tree().get_root().get_child_count() -1)\n#\t #Demonstrate setting a global variable.\n#\t Globals.set(\"MAX_POWER_LEVEL\",9000)\n#\n#\t# create a function to switch between scenes\n#\tfunc setScene(scene):\n#\t #clean up the current scene\n#\t currentScene.queue_free()\n#\t #load the file passed in as the param \"scene\"\n#\t var s = ResourceLoader.load(scene)\n#\t #create an instance of our scene\n#\t currentScene = s.instance()\n#\t # add scene to root\n#\t get_tree().get_root().add_child(currentScene)\n#","returncode":0,"stderr":"","license":"apache-2.0","lang":"GDScript"} {"commit":"8d2f34dc18e8abe4a14e210903e190d42effcbd9","subject":"Removed random boss size dropoff","message":"Removed random boss size dropoff\n\n","repos":"BK-TN\/IncendiumGame","old_file":"incendium\/scripts\/Game.gd","new_file":"incendium\/scripts\/Game.gd","new_contents":"# GAME class\n# This class handles the core game loop.\n# It generates new random bosses as the player defeats them,\n# and also respawns the player when dead.\n\nextends Node\n\n# As long as this is true, new bosses (and players) will be spawned\nvar playing = false\n\n# Strong and weak references to last spawned boss\n# Weak reference is nessecary to check when the boss has been destroyed\nvar last_boss\nvar last_boss_wr\n\n# Values for current and target fore- and background colors\n# Used for slowly fading into new colors\nvar bgcol = Color(0,0,0)\nvar target_bgcol = Color(0,0,0)\nvar fgcol = Color(0,0,0)\nvar target_fgcol = Color(0,0,0)\n\n# Number of bosses spawned, and how many layers the next boss should have\nvar bossnum = 0\nvar bossdepth = 2\n\n# Those values every game in the known universe have\nvar score = 0\nvar lives = 3\n\nvar score_mult = 1\nvar score_mult_timer = 0\nconst score_mult_time = 4\n\n# List of Nikolaj-curaged regexes for the boss generator to use\n# The letters a, b and c will each be replaced by a random number from 0 to the highest poly degree of the boss\nvar regex_list = [\n#\"a*b*\",\n\".*\",\n#\"(a|c)*b\",\n#\".*a.*\",\n#\"c*(aa|bb)*c*\",\n#\"b.*a\",\n#\"(c.b)*\",\n#\"ba*b.*\",\n#\"c*ba*\",\n#\"c*\",\n#\"a*b*c*\"\n]\n\n# Starts the party\nfunc start_game():\n\tplaying = true\n\tgen_boss()\n\nfunc _ready():\n\tset_process_input(true)\n\tset_process(true)\n\tstart_game()\n\t\nfunc _input(event):\n\tif event.type == InputEvent.KEY:\n\t\tif event.scancode == KEY_R and event.pressed == true:\n\t\t\tif last_boss != null:\n\t\t\t\tlast_boss.queue_free()\n\nfunc _process(delta):\n\tbgcol = bgcol.linear_interpolate(target_bgcol,delta * 3)\n\tfgcol = fgcol.linear_interpolate(target_fgcol,delta * 0.5)\n\t#get_node(\"Background\/Polygon2D\").set_color(bgcol)\n\tget_node(\"Background\").set_modulate(bgcol)\n\t\n\tif score_mult_timer > 0:\n\t\tscore_mult_timer -= delta\n\t\tif score_mult_timer <= 0:\n\t\t\tscore_mult = 1\n\t\n\tif playing:\n\t\tif OS.get_time_scale() < 1:\n\t\t\tOS.set_time_scale(min(OS.get_time_scale() + delta, 1))\n\t\t\tif OS.get_time_scale() >= 1 and !has_node(\"Player\") and lives > 0:\n\t\t\t\tvar p = preload(\"res:\/\/objects\/Player.tscn\").instance()\n\t\t\t\tadd_child(p)\n\t\t\t\tp.set_global_pos(Vector2(360,600))\n\t\t\t\tlives-=1\n\t\t\n\t\tif !last_boss_wr.get_ref():\n\t\t\t#No boss, spawn a new one\n\t\t\tif bossdepth < 4:\n\t\t\t\tbossdepth += 1\n\t\t\tgen_boss()\n\t\t\t#also increase player health\n\t\t\tvar player = get_node(\"Player\")\n\t\t\tif player != null:\n\t\t\t\tplayer.health = floor(lerp(player.health,player.MAX_HEALTH,0.5))\n\t\t\t\t\n\n# Generates regexes using the regex list and some info about the boss\nfunc random_regex(size, larg):\n\tvar string = regex_list[abs(randi()) % regex_list.size()]\n\tvar base = randi();\n\tstring = string.replace(\"a\",str(int(base+0)%int(larg)))\n\tstring = string.replace(\"b\",str(int(base+1)%int(larg)))\n\tstring = string.replace(\"c\",str(int(base+2)%int(larg)))\n\treturn string\n\nfunc add_score(amount):\n\tscore += amount * score_mult\n\tscore_mult += 1\n\t#score_mult_timer = score_mult_time\n\n# Spawns a boss from a boss design object\nfunc spawn_boss(design):\n\tvar boss_instance = preload(\"res:\/\/objects\/Boss.tscn\").instance()\n\tlast_boss = boss_instance\n\tlast_boss_wr = weakref(boss_instance)\n\t\n\tboss_instance.design = design\n\t\n\ttarget_bgcol = design.start_color.linear_interpolate(Color(0,0,0), 0.8)\n\ttarget_fgcol = design.end_color.linear_interpolate(Color(0,0,0), 0)\n\t\n\tadd_child(boss_instance)\n\tboss_instance.set_pos(Vector2(360,360))\n\t\n\tbossnum += 1\n\t\n\t\n\tplaying = true\n\n# Generates a random boss design\nfunc gen_boss():\n\tvar design = preload(\"res:\/\/scripts\/datatypes\/BossDesign.gd\").new()\n\t\n\trandomize() # Randomize random seed\n\t\n\tvar layer_count = 4 #floor(rand_range(3,5)) + floor(bossdepth \/ 2) # bossdepth # floor(rand_range(3,5))\n\t\n\tvar layers = []\n\tvar bullettypes = []\n\tvar largest = 3;\n\tfor i in range(0,layer_count):\n\t\tvar l = floor(rand_range(3,6));\n\t\tif (l>largest):\n\t\t\tlargest = l;\n\t\tlayers.append(l)\n\t\tbullettypes.append(floor(rand_range(0,5)))\n\t\t#bullettypes.append(2)\n\tdesign.layers = layers\n\tdesign.bullettypes = bullettypes\n\t\n\tdesign.regex = random_regex(1 + (abs(randi())%3), largest)\n\t\n\tdesign.base_size = layer_count * 20\n\tdesign.size_dropoff = 0.6\n\t\n\tdesign.base_health = 20 + (2.5 * bossnum)\n\t#TODO: Health and health dropoff (Should be based on difficulty, and probably affected by the total amount of boss parts)\n\n\tvar speed = 1\n\n\tvar min_base_rot = 0.5\n\tvar max_base_rot = 1.5\n\tvar min_rot_inc = 0.05\n\tvar max_rot_inc = 0.15\n\t\n\tvar rot_speed_focus = rand_range(0,1)\n\tdesign.base_rot_speed = lerp(min_base_rot, max_base_rot, rot_speed_focus) * speed\n\tdesign.rot_speed_inc = lerp(min_rot_inc, max_rot_inc, 1 - rot_speed_focus) * PI * speed\n\t\n\tif randi() % 2 == 0: design.base_rot_speed = -design.base_rot_speed\n\tif randi() % 2 == 0: design.rot_speed_inc = -design.rot_speed_inc\n\t\n\tvar boss_start_col = Color(rand_range(0,1),rand_range(0,1),rand_range(0,1))\n\tvar boss_end_col = Color(rand_range(0,1),rand_range(0,1),rand_range(0,1))\n\t\n\tdesign.start_color = boss_start_col\n\tdesign.end_color = boss_end_col\n\t\n\tspawn_boss(design)\n\n# Unused broken regex generator\nfunc gen_regex(depth, layers):\n\tprint(depth)\n\tif depth == 0:\n\t\treturn str(floor(rand_range(0, layers[depth])))\n\t\t\n\tvar option = floor(rand_range(0,3))\n\tif option == 0:\n\t\treturn \"(\" + gen_regex(depth - 1, layers) + \")*\"\n\tif option == 1:\n\t\treturn \"(\" + gen_regex(depth - 1, layers) + \")+(\" + gen_regex(depth - 1, layers) + \")\"\n\tif option == 2:\n\t\treturn \"(\" + gen_regex(depth - 1, layers) + \")(\" + gen_regex(depth - 1, layers) + \")\"\n\n","old_contents":"# GAME class\n# This class handles the core game loop.\n# It generates new random bosses as the player defeats them,\n# and also respawns the player when dead.\n\nextends Node\n\n# As long as this is true, new bosses (and players) will be spawned\nvar playing = false\n\n# Strong and weak references to last spawned boss\n# Weak reference is nessecary to check when the boss has been destroyed\nvar last_boss\nvar last_boss_wr\n\n# Values for current and target fore- and background colors\n# Used for slowly fading into new colors\nvar bgcol = Color(0,0,0)\nvar target_bgcol = Color(0,0,0)\nvar fgcol = Color(0,0,0)\nvar target_fgcol = Color(0,0,0)\n\n# Number of bosses spawned, and how many layers the next boss should have\nvar bossnum = 0\nvar bossdepth = 2\n\n# Those values every game in the known universe have\nvar score = 0\nvar lives = 3\n\nvar score_mult = 1\nvar score_mult_timer = 0\nconst score_mult_time = 4\n\n# List of Nikolaj-curaged regexes for the boss generator to use\n# The letters a, b and c will each be replaced by a random number from 0 to the highest poly degree of the boss\nvar regex_list = [\n#\"a*b*\",\n\".*\",\n#\"(a|c)*b\",\n#\".*a.*\",\n#\"c*(aa|bb)*c*\",\n#\"b.*a\",\n#\"(c.b)*\",\n#\"ba*b.*\",\n#\"c*ba*\",\n#\"c*\",\n#\"a*b*c*\"\n]\n\n# Starts the party\nfunc start_game():\n\tplaying = true\n\tgen_boss()\n\nfunc _ready():\n\tset_process_input(true)\n\tset_process(true)\n\tstart_game()\n\t\nfunc _input(event):\n\tif event.type == InputEvent.KEY:\n\t\tif event.scancode == KEY_R and event.pressed == true:\n\t\t\tif last_boss != null:\n\t\t\t\tlast_boss.queue_free()\n\nfunc _process(delta):\n\tbgcol = bgcol.linear_interpolate(target_bgcol,delta * 3)\n\tfgcol = fgcol.linear_interpolate(target_fgcol,delta * 0.5)\n\t#get_node(\"Background\/Polygon2D\").set_color(bgcol)\n\tget_node(\"Background\").set_modulate(bgcol)\n\t\n\tif score_mult_timer > 0:\n\t\tscore_mult_timer -= delta\n\t\tif score_mult_timer <= 0:\n\t\t\tscore_mult = 1\n\t\n\tif playing:\n\t\tif OS.get_time_scale() < 1:\n\t\t\tOS.set_time_scale(min(OS.get_time_scale() + delta, 1))\n\t\t\tif OS.get_time_scale() >= 1 and !has_node(\"Player\") and lives > 0:\n\t\t\t\tvar p = preload(\"res:\/\/objects\/Player.tscn\").instance()\n\t\t\t\tadd_child(p)\n\t\t\t\tp.set_global_pos(Vector2(360,600))\n\t\t\t\tlives-=1\n\t\t\n\t\tif !last_boss_wr.get_ref():\n\t\t\t#No boss, spawn a new one\n\t\t\tif bossdepth < 4:\n\t\t\t\tbossdepth += 1\n\t\t\tgen_boss()\n\t\t\t#also increase player health\n\t\t\tvar player = get_node(\"Player\")\n\t\t\tif player != null:\n\t\t\t\tplayer.health = floor(lerp(player.health,player.MAX_HEALTH,0.5))\n\t\t\t\t\n\n# Generates regexes using the regex list and some info about the boss\nfunc random_regex(size, larg):\n\tvar string = regex_list[abs(randi()) % regex_list.size()]\n\tvar base = randi();\n\tstring = string.replace(\"a\",str(int(base+0)%int(larg)))\n\tstring = string.replace(\"b\",str(int(base+1)%int(larg)))\n\tstring = string.replace(\"c\",str(int(base+2)%int(larg)))\n\treturn string\n\nfunc add_score(amount):\n\tscore += amount * score_mult\n\tscore_mult += 1\n\t#score_mult_timer = score_mult_time\n\n# Spawns a boss from a boss design object\nfunc spawn_boss(design):\n\tvar boss_instance = preload(\"res:\/\/objects\/Boss.tscn\").instance()\n\tlast_boss = boss_instance\n\tlast_boss_wr = weakref(boss_instance)\n\t\n\tboss_instance.design = design\n\t\n\ttarget_bgcol = design.start_color.linear_interpolate(Color(0,0,0), 0.8)\n\ttarget_fgcol = design.end_color.linear_interpolate(Color(0,0,0), 0)\n\t\n\tadd_child(boss_instance)\n\tboss_instance.set_pos(Vector2(360,360))\n\t\n\tbossnum += 1\n\t\n\t\n\tplaying = true\n\n# Generates a random boss design\nfunc gen_boss():\n\tvar design = preload(\"res:\/\/scripts\/datatypes\/BossDesign.gd\").new()\n\t\n\trandomize() # Randomize random seed\n\t\n\tvar layer_count = 4 #floor(rand_range(3,5)) + floor(bossdepth \/ 2) # bossdepth # floor(rand_range(3,5))\n\t\n\tvar layers = []\n\tvar bullettypes = []\n\tvar largest = 3;\n\tfor i in range(0,layer_count):\n\t\tvar l = floor(rand_range(3,6));\n\t\tif (l>largest):\n\t\t\tlargest = l;\n\t\tlayers.append(l)\n\t\tbullettypes.append(floor(rand_range(0,5)))\n\t\t#bullettypes.append(2)\n\tdesign.layers = layers\n\tdesign.bullettypes = bullettypes\n\t\n\tdesign.regex = random_regex(1 + (abs(randi())%3), largest)\n\t\n\tdesign.base_size = layer_count * 20\n\tdesign.size_dropoff = rand_range(0.5,0.8)\n\t\n\tdesign.base_health = 20 + (2.5 * bossnum)\n\t#TODO: Health and health dropoff (Should be based on difficulty, and probably affected by the total amount of boss parts)\n\n\tvar speed = 1\n\n\tvar min_base_rot = 0.5\n\tvar max_base_rot = 1.5\n\tvar min_rot_inc = 0.05\n\tvar max_rot_inc = 0.15\n\t\n\tvar rot_speed_focus = rand_range(0,1)\n\tdesign.base_rot_speed = lerp(min_base_rot, max_base_rot, rot_speed_focus) * speed\n\tdesign.rot_speed_inc = lerp(min_rot_inc, max_rot_inc, 1 - rot_speed_focus) * PI * speed\n\t\n\tif randi() % 2 == 0: design.base_rot_speed = -design.base_rot_speed\n\tif randi() % 2 == 0: design.rot_speed_inc = -design.rot_speed_inc\n\t\n\tvar boss_start_col = Color(rand_range(0,1),rand_range(0,1),rand_range(0,1))\n\tvar boss_end_col = Color(rand_range(0,1),rand_range(0,1),rand_range(0,1))\n\t\n\tdesign.start_color = boss_start_col\n\tdesign.end_color = boss_end_col\n\t\n\tspawn_boss(design)\n\n# Unused broken regex generator\nfunc gen_regex(depth, layers):\n\tprint(depth)\n\tif depth == 0:\n\t\treturn str(floor(rand_range(0, layers[depth])))\n\t\t\n\tvar option = floor(rand_range(0,3))\n\tif option == 0:\n\t\treturn \"(\" + gen_regex(depth - 1, layers) + \")*\"\n\tif option == 1:\n\t\treturn \"(\" + gen_regex(depth - 1, layers) + \")+(\" + gen_regex(depth - 1, layers) + \")\"\n\tif option == 2:\n\t\treturn \"(\" + gen_regex(depth - 1, layers) + \")(\" + gen_regex(depth - 1, layers) + \")\"\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"90cb4331098d8b9bbcbcedbd4c58860801e37130","subject":"portal fix","message":"portal fix\n","repos":"MartiniMoe\/Amal,MartiniMoe\/handala","old_file":"scripts\/scene_12_entrance_back.gd","new_file":"scripts\/scene_12_entrance_back.gd","new_contents":"extends Navigation2D\n\n# Member variables\nconst SPEED = 180.0\nconst TALK_DISTANCE = 50\n\nexport var scale_enabled = false\nexport var scale_factor = 500\n\nvar npc_clicked = null\nvar dialogue_running = null\n\nvar item_held = null\n\nvar begin = Vector2()\nvar end = Vector2()\nvar path = []\n\nvar left_corner = Vector2(110,1000)\nvar right_corner = Vector2(1748,1000)\nvar middle = Vector2(1000,1000)\n\nvar mouseOver = null\n\n\nfunc _process(delta):\n\t\t\n\tif (path.size() > 1):\n\t\tvar to_walk = delta*SPEED\n\t\t\n\t\tif !get_node(\"player\/AnimationPlayer\").is_playing():\n\t\t\tget_node(\"player\/AnimationPlayer\").play(\"walk\")\n\t\tscale_player()\n\t\t\n\t\twhile(to_walk > 0 and path.size() >= 2):\n\t\t\tvar pfrom = path[path.size() - 1]\n\t\t\tvar pto = path[path.size() - 2]\n\t\t\tvar d = pfrom.distance_to(pto)\n\t\t\tif (d <= to_walk):\n\t\t\t\tpath.remove(path.size() - 1)\n\t\t\t\tto_walk -= d\n\t\t\telse:\n\t\t\t\tpath[path.size() - 1] = pfrom.linear_interpolate(pto, to_walk\/d)\n\t\t\t\tto_walk = 0\n\t\t\n\t\tvar atpos = path[path.size() - 1]\n\t\tget_node(\"player\").set_pos(atpos)\n\t\t\n\t\tif (path.size() < 2):\n\t\t\tpath = []\n\t\t\tget_node(\"player\/AnimationPlayer\").seek(0.0, true)\n\t\t\tget_node(\"player\/AnimationPlayer\").stop_all()\n\t\t\tset_process(false)\n\t\t\tvar npc_near = check_npc_near()\n\t\t\tif (npc_near != null && npc_clicked != null) && (npc_clicked == npc_near) && (dialogue_running == false):\n\t\t\t\t\tnpc_clicked.show_dialogue()\n\t\t\t\t\t\n\t\t\t\n\t\t\tif get_node(\"player\/Area2D\").get_overlapping_areas().size() > 0:\n\t\t\t\tget_node(\"player\/Area2D\").get_overlapping_areas()[0].teleport()\n\telse:\n\t\tset_process(false)\n\n\n\nfunc check_npc_clicked(clickPos):\n\tvar character = get_node(\"player\")\n\tfor npc in get_children():\n\t\tif npc.is_in_group(\"npc_dialogue\"):\n\t\t\tvar npc_x = npc.get_pos().x\n\t\t\tvar npc_y = npc.get_pos().y\n\t\t\tvar npc_width = npc.get_region_rect().size.x\n\t\t\tvar npc_height = npc.get_region_rect().size.y\n\t\t\tif (clickPos.x > (npc_x - npc_width\/2) && clickPos.x < (npc_x + npc_width\/2)):\n\t\t\t\tif (clickPos.y > (npc_y - npc_height\/2) && clickPos.y < (npc_y + npc_height\/2)):\n\t\t\t\t\treturn npc\n#\t\t\tnpc.hide_dialogue()\n\treturn null\n\nfunc check_npc_near():\n\tvar character = get_node(\"player\")\n\tfor npc in get_children():\n\t\tif npc.is_in_group(\"npc_dialogue\"):\n\t\t\tvar npc_x = npc.get_pos().x\n\t\t\tvar npc_y = npc.get_pos().y\n\t\t\tvar npc_width = npc.get_region_rect().size.x\n\t\t\tvar npc_height = npc.get_region_rect().size.y\n\t\t\tif character.get_pos().x > (npc_x - npc_width\/2 - TALK_DISTANCE) && character.get_pos().x < (npc_x + npc_width\/2 + TALK_DISTANCE):\n\t\t\t\tif character.get_pos().y > (npc_y - npc_height\/2 - TALK_DISTANCE) && character.get_pos().y < (npc_y + npc_height\/2 + TALK_DISTANCE):\n\t\t\t\t\treturn npc\n\treturn null\n\n\nfunc _update_path():\n\tvar p = get_simple_path(begin, end, true)\n\tpath = Array(p) # Vector2array too complex to use, convert to regular array\n\tpath.invert()\n\t\n\tset_process(true)\n\n\nfunc _input(event):\n\tif (event.type == InputEvent.MOUSE_BUTTON and event.pressed and event.button_index == 1 and !dialogue_running):\n\t\tbegin = get_node(\"player\").get_pos()\n\t\t\n\t\tnpc_clicked = check_npc_clicked(event.pos - get_pos())\n\t\t\n\t\t# Mouse to local navigation coordinates\n\t\tend = event.pos - get_pos()\n\t\t_update_path()\n\nfunc scale_player():\n\tif scale_enabled:\n\t\tvar scale = log(get_node(\"player\").get_pos().y\/scale_factor)\n\t\tget_node(\"player\").set_scale(Vector2(scale, scale))\n\nfunc set_playerPos():\n\tif(transition.get_direction() == 0):\n\t\tget_node(\"player\").set_pos(right_corner)\n\tif(transition.get_direction() == 1):\n\t\tget_node(\"player\").set_pos(left_corner)\n\tif(transition.get_direction() == 2):\n\t\tget_node(\"player\").set_pos(middle)\n\telse:\n\t\treturn\n\n\n\nfunc _ready():\n\tSPEED = game_state.player_speed\n\tset_playerPos()\n\tscale_player()\n\tdialogue_running = false\n\tfor npc in get_children():\n\t\tif npc.is_in_group(\"npc_dialogue\"):\n\t\t\tnpc.hide_dialogue()\n\tif game_state.end:\n\t\tfor portal in get_children():\n\t\t\tif portal.is_in_group(\"portal\"):\n\t\t\t\tportal.hide()\n\t\tnpc_clicked = get_node(\"end\")\n\t\tget_node(\"end\").show_dialogue()\n\tset_process_input(true)\n\n\n\n# when pressing the key, collect it #\nfunc _on_Key_pressed():\n\titem_held = \"sprites\/key.png\"\n\tget_node(\"Key\").hide()\n\n\nfunc npc_bubble_clicked():\n\tif get_node(\"npc_bubble\/text_interface_engine\")._buffer.size() > 0:\n\t\t#get_node(\"npc_bubble\/text_interface_engine\").set_buff_speed(1.0)\n\t\tget_node(\"npc_bubble\/text_interface_engine\").set_turbomode(true)\n\telse:\n\t\tif npc_clicked.counter >= npc_clicked.npc_text.size():\n\t\t\tnpc_clicked.hide_dialogue()\n\t\t\tif npc_clicked == get_node(\"end\"):\n\t\t\t\tfor portal in get_children():\n\t\t\t\t\t\tif portal.is_in_group(\"portal\"):\n\t\t\t\t\t\t\tportal.show()\n\t\telse:\n\t\t\tnpc_clicked.show_dialogue()\n\n","old_contents":"extends Navigation2D\n\n# Member variables\nconst SPEED = 180.0\nconst TALK_DISTANCE = 50\n\nexport var scale_enabled = false\nexport var scale_factor = 500\n\nvar npc_clicked = null\nvar dialogue_running = null\n\nvar item_held = null\n\nvar begin = Vector2()\nvar end = Vector2()\nvar path = []\n\nvar left_corner = Vector2(110,1000)\nvar right_corner = Vector2(1748,1000)\nvar middle = Vector2(1000,1000)\n\nvar mouseOver = null\n\n\nfunc _process(delta):\n\t\t\n\tif (path.size() > 1):\n\t\tvar to_walk = delta*SPEED\n\t\t\n\t\tif !get_node(\"player\/AnimationPlayer\").is_playing():\n\t\t\tget_node(\"player\/AnimationPlayer\").play(\"walk\")\n\t\tscale_player()\n\t\t\n\t\twhile(to_walk > 0 and path.size() >= 2):\n\t\t\tvar pfrom = path[path.size() - 1]\n\t\t\tvar pto = path[path.size() - 2]\n\t\t\tvar d = pfrom.distance_to(pto)\n\t\t\tif (d <= to_walk):\n\t\t\t\tpath.remove(path.size() - 1)\n\t\t\t\tto_walk -= d\n\t\t\telse:\n\t\t\t\tpath[path.size() - 1] = pfrom.linear_interpolate(pto, to_walk\/d)\n\t\t\t\tto_walk = 0\n\t\t\n\t\tvar atpos = path[path.size() - 1]\n\t\tget_node(\"player\").set_pos(atpos)\n\t\t\n\t\tif (path.size() < 2):\n\t\t\tpath = []\n\t\t\tget_node(\"player\/AnimationPlayer\").seek(0.0, true)\n\t\t\tget_node(\"player\/AnimationPlayer\").stop_all()\n\t\t\tset_process(false)\n\t\t\tvar npc_near = check_npc_near()\n\t\t\tif (npc_near != null && npc_clicked != null) && (npc_clicked == npc_near) && (dialogue_running == false):\n\t\t\t\t\tnpc_clicked.show_dialogue()\n\t\t\t\t\t\n\t\t\t\n\t\t\tif get_node(\"player\/Area2D\").get_overlapping_areas().size() > 0 && game_state.end == true:\n\t\t\t\tget_node(\"player\/Area2D\").get_overlapping_areas()[0].teleport()\n\telse:\n\t\tset_process(false)\n\n\n\nfunc check_npc_clicked(clickPos):\n\tvar character = get_node(\"player\")\n\tfor npc in get_children():\n\t\tif npc.is_in_group(\"npc_dialogue\"):\n\t\t\tvar npc_x = npc.get_pos().x\n\t\t\tvar npc_y = npc.get_pos().y\n\t\t\tvar npc_width = npc.get_region_rect().size.x\n\t\t\tvar npc_height = npc.get_region_rect().size.y\n\t\t\tif (clickPos.x > (npc_x - npc_width\/2) && clickPos.x < (npc_x + npc_width\/2)):\n\t\t\t\tif (clickPos.y > (npc_y - npc_height\/2) && clickPos.y < (npc_y + npc_height\/2)):\n\t\t\t\t\treturn npc\n#\t\t\tnpc.hide_dialogue()\n\treturn null\n\nfunc check_npc_near():\n\tvar character = get_node(\"player\")\n\tfor npc in get_children():\n\t\tif npc.is_in_group(\"npc_dialogue\"):\n\t\t\tvar npc_x = npc.get_pos().x\n\t\t\tvar npc_y = npc.get_pos().y\n\t\t\tvar npc_width = npc.get_region_rect().size.x\n\t\t\tvar npc_height = npc.get_region_rect().size.y\n\t\t\tif character.get_pos().x > (npc_x - npc_width\/2 - TALK_DISTANCE) && character.get_pos().x < (npc_x + npc_width\/2 + TALK_DISTANCE):\n\t\t\t\tif character.get_pos().y > (npc_y - npc_height\/2 - TALK_DISTANCE) && character.get_pos().y < (npc_y + npc_height\/2 + TALK_DISTANCE):\n\t\t\t\t\treturn npc\n\treturn null\n\n\nfunc _update_path():\n\tvar p = get_simple_path(begin, end, true)\n\tpath = Array(p) # Vector2array too complex to use, convert to regular array\n\tpath.invert()\n\t\n\tset_process(true)\n\n\nfunc _input(event):\n\tif (event.type == InputEvent.MOUSE_BUTTON and event.pressed and event.button_index == 1 and !dialogue_running):\n\t\tbegin = get_node(\"player\").get_pos()\n\t\t\n\t\tnpc_clicked = check_npc_clicked(event.pos - get_pos())\n\t\t\n\t\t# Mouse to local navigation coordinates\n\t\tend = event.pos - get_pos()\n\t\t_update_path()\n\nfunc scale_player():\n\tif scale_enabled:\n\t\tvar scale = log(get_node(\"player\").get_pos().y\/scale_factor)\n\t\tget_node(\"player\").set_scale(Vector2(scale, scale))\n\nfunc set_playerPos():\n\tif(transition.get_direction() == 0):\n\t\tget_node(\"player\").set_pos(right_corner)\n\tif(transition.get_direction() == 1):\n\t\tget_node(\"player\").set_pos(left_corner)\n\tif(transition.get_direction() == 2):\n\t\tget_node(\"player\").set_pos(middle)\n\telse:\n\t\treturn\n\n\n\nfunc _ready():\n\tSPEED = game_state.player_speed\n\tset_playerPos()\n\tscale_player()\n\tdialogue_running = false\n\tfor npc in get_children():\n\t\tif npc.is_in_group(\"npc_dialogue\"):\n\t\t\tnpc.hide_dialogue()\n\tif game_state.end:\n\t\tfor portal in get_children():\n\t\t\tif portal.is_in_group(\"portal\"):\n\t\t\t\tportal.hide()\n\t\tnpc_clicked = get_node(\"end\")\n\t\tget_node(\"end\").show_dialogue()\n\tset_process_input(true)\n\n\n\n# when pressing the key, collect it #\nfunc _on_Key_pressed():\n\titem_held = \"sprites\/key.png\"\n\tget_node(\"Key\").hide()\n\n\nfunc npc_bubble_clicked():\n\tif get_node(\"npc_bubble\/text_interface_engine\")._buffer.size() > 0:\n\t\t#get_node(\"npc_bubble\/text_interface_engine\").set_buff_speed(1.0)\n\t\tget_node(\"npc_bubble\/text_interface_engine\").set_turbomode(true)\n\telse:\n\t\tif npc_clicked.counter >= npc_clicked.npc_text.size():\n\t\t\tnpc_clicked.hide_dialogue()\n\t\t\tif npc_clicked == get_node(\"end\"):\n\t\t\t\tfor portal in get_children():\n\t\t\t\t\t\tif portal.is_in_group(\"portal\"):\n\t\t\t\t\t\t\tportal.show()\n\t\telse:\n\t\t\tnpc_clicked.show_dialogue()\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"aa1ef4d7909a0c62c222dccf5b429b531504b9f1","subject":"emission color default red","message":"emission color default red\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Blocks\/LaserBlock.gd","new_file":"src\/scripts\/Blocks\/LaserBlock.gd","new_contents":"extends \"AbstractBlock.gd\"\n\nvar mat\nvar laserExtent = Vector3()\n\n# color\nfunc setTexture(color=Color(0.5, 0, 0)):\n\tvar mat = load(\"res:\/\/materials\/block_Laser.mtl\")\n\tmat.set_parameter(FixedMaterial.PARAM_EMISSION, Color(0.2, 0.1, 0.1))\n\tself.get_node(\"MeshInstance\").set_material_override(mat)\n\n\treturn self\n\n# sets light emission color\nfunc setColor(col):\n\tmat.set_parameter(FixedMaterial.PARAM_EMISSION, col)\n\nfunc setExtent(laserExtent):\n\t self.laserExtent = laserExtent\n\n# Force a laser to set off at the end of a layer.\nfunc forceActivate():\n\tscaleTweenNode(0, 0.5, Tween.TRANS_ELASTIC).start()\n\n# Can't manually activate a laser.\nfunc activate():\n\treturn\n","old_contents":"extends \"AbstractBlock.gd\"\n\nvar mat\nvar laserExtent = Vector3()\n\n# color\nfunc setTexture(color=Color(0.5, 0, 0)):\n\tvar mat = load(\"res:\/\/materials\/block_Laser.mtl\")\n\tmat.set_parameter(FixedMaterial.PARAM_EMISSION, color)\n\tself.get_node(\"MeshInstance\").set_material_override(mat)\n\n\treturn self\n\n# sets light emission color\nfunc setColor(col):\n\tmat.set_parameter(FixedMaterial.PARAM_EMISSION, col)\n\nfunc setExtent(laserExtent):\n\t self.laserExtent = laserExtent\n\n# Force a laser to set off at the end of a layer.\nfunc forceActivate():\n\tscaleTweenNode(0, 0.5, Tween.TRANS_ELASTIC).start()\n\n# Can't manually activate a laser.\nfunc activate():\n\treturn\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"abde2858a7626013cd5db0b75f20d25973765aa6","subject":"fix gd translations","message":"fix gd translations\n","repos":"clarkerubber\/lila,arex1337\/lila,luanlv\/lila,luanlv\/lila,arex1337\/lila,clarkerubber\/lila,luanlv\/lila,luanlv\/lila,arex1337\/lila,luanlv\/lila,arex1337\/lila,luanlv\/lila,clarkerubber\/lila,luanlv\/lila,clarkerubber\/lila,arex1337\/lila,clarkerubber\/lila,clarkerubber\/lila,arex1337\/lila,arex1337\/lila,clarkerubber\/lila","old_file":"modules\/i18n\/messages\/messages.gd","new_file":"modules\/i18n\/messages\/messages.gd","new_contents":"playWithAFriend=Cluich c\u00f2mhla ri caraid\nplayWithTheMachine=Cluich an aghaidh a' choimpiutair\ntoInviteSomeoneToPlayGiveThisUrl=Gus cuireadh a thoirt do chuideigin, thoir an url seo dha\ngameOver=Cr\u00ecoch a\u2019 gheama\nwaitingForOpponent=A\u2019 feitheamh air n\u00e0mhaid\nwaiting=A\u2019 feitheamh\nyourTurn=An turas agad\naiNameLevelAiLevel=%s inbhe %s\nlevel=Inbhe\ntoggleTheChat=Toglaich a\u2019 chabadaich\ntoggleSound=Toglaich fuaim\nchat=Cabadaich\nresign=G\u00e8ill\ncheckmate=Tul-chasg\nstalemate=Clos-cluiche\nwhite=Geal\nblack=Dubh\nrandomColor=Dath air thuaiream\ncreateAGame=Cruthaich geama\nwhiteIsVictorious=Bhuannaich geal\nblackIsVictorious=Bhuannaich dubh\nkingInTheCenter=R\u00ecgh sa mheadhan\nthreeChecks=Tr\u00ec caisg\nnewOpponent=N\u00e0mhaid \u00f9r\nyourOpponentWantsToPlayANewGameWithYou=Tha an n\u00e0mhaid agad airson geama \u00f9r a chluich \u2019nad aghaidh\njoinTheGame=Thig a-steach dhan gheama\nwhitePlays=Tha geal a\u2019 cluich\nblackPlays=Tha dubh a\u2019 cluich\ntheOtherPlayerHasLeftTheGameYouCanForceResignationOrWaitForHim=Tha an cluicheadair eile air a' gheama fh\u00e0gail. Is urrainn dhut g\u00e8illeadh a chur air, geama ionnannach a ghairm, no feitheamh air a shon.\nmakeYourOpponentResign=Cuir g\u00e8illeadh air an n\u00e0mhaid agad\nforceResignation=Gairm buaidh\nforceDraw=Gairm geama ionnannach\ntalkInChat=D\u00e8an cabadaich\ntheFirstPersonToComeOnThisUrlWillPlayWithYou=Cluichidh a\u2019 chiad neach a thig a-steach air an url seo c\u00f2mhla riut.\nwhiteResigned=Gh\u00e8ill geal\nblackResigned=Gh\u00e8ill dubh\nwhiteLeftTheGame=Dh\u2019fh\u00e0g geal an geama\nblackLeftTheGame=Dh\u2019fh\u00e0g dubh an geama\nshareThisUrlToLetSpectatorsSeeTheGame=Co-roinn an url seo gus luchd-amhairc a leigeil a-steach dhan gheama\ntheComputerAnalysisHasFailed=Dh\u2019fh\u00e0illig le anailis a\u2019 choimpiutair\nviewTheComputerAnalysis=Seall anailis a\u2019 choimpiutair\nrequestAComputerAnalysis=Iarr anailis air a\u2019 choimpiutair\ncomputerAnalysis=Anailis a\u2019 choimpiutair\nanalysis=B\u00f2rd sgr\u00f9daidh\nblunders=Tuislidhean\nmistakes=Mearachdan\ninaccuracies=Neo-eagnaidhean\nmoveTimes=\u00d9ine nan gluasadan\nflipBoard=D\u00e8an flip air a\u2019 bh\u00f2rd\nthreefoldRepetition=Treas ath-nochdadh\nclaimADraw=Gairm co-tharraing\nofferDraw=Tairg co-tharraing\ndraw=Co-tharraing\nnbConnectedPlayers=%s cluicheadairean\ngamesBeingPlayedRightNow=Geamannan a tha \u2019gan cluich an-dr\u00e0sta fh\u00e8in\nviewAllNbGames=%s geamannan\nviewNbCheckmates=%s tul-chaisg\nnbBookmarks=%s comharran-l\u00ecn\nnbPopularGames=%s geamannan m\u00f2r-ch\u00f2rdte\nnbAnalysedGames=%s geamannan sgr\u00f9daichte\nbookmarkedByNbPlayers=Comharra-leabhair le %s cluicheadairean\nviewInFullSize=Seall sa mheud iomlan\nlogOut=Log a-mach\nsignIn=Log a-steach\nnewToLichess=\u00d9r air Lichess?\nyouNeedAnAccountToDoThat=Tha feum agad air cunntas gus sin a dh\u00e8anamh\nsignUp=Cl\u00e0raich\ngames=Geamannan\nforum=B\u00f2rd-brath\nxPostedInForumY=Sgr\u00ecobh %s san fh\u00f2ram %s\nlatestForumPosts=Na postaichean as \u00f9ire\nplayers=Cluicheadairean\nminutesPerSide=Mionaidean gach taobh\nvariant=Caochladh\nvariants=Se\u00f2rsachan\ntimeControl=Smachd air an \u00f9ine\nrealTime=F\u00ecor-\u00f9ine\ndaysPerTurn=L\u00e0ithean gach cuairt\noneDay=Aon latha\nnbDays=%s l\u00e0(ithean)\nnbHours=%s uair(ean)\ntime=\u00d9ine\nrating=Rangachadh\nusername=Ainm-cleachdaidh\nusernameOrEmail=Far-ainm\npassword=Facal-faire\nhaveAnAccount=A bheil cunntas agad?\nchangePassword=Atharraich am facal-faire\nchangeEmail=Atharraich am post-d\nemail=Post-d\nemailIsOptional=Tha am post-d roghainneil. cleachdaich Lichess an se\u00f2ladh puist-d agad gus am facal-faire agad ath-shuidheachadh ma dh\u00ecochuimhnicheas tu e.\npasswordReset=Ath-shuidheachadh an fhacail-fhaire\nforgotPassword=An do dh\u00ecochuimhnich thu am facal-faire?\nrank=Inbhe\ngamesPlayed=Geamannan air an cluich\nnbGamesWithYou=%s geamannan c\u00f2mhla riut\ndeclineInvitation=Di\u00f9lt cuireadh\ncancel=Sguir dheth\ntimeOut=Dh\u2019fhalbh an \u00f9ine\ndrawOfferSent=Chaidh tairgse airson co-tharraing a chur\ndrawOfferDeclined=Dhi\u00f9ltadh do thairgse airson co-tharraing\ndrawOfferAccepted=Ghabhadh ri do thairgse airson co-tharraing\ndrawOfferCanceled=Sguireadh de do thairgse airson co-tharraing\nwhiteOffersDraw=Tha geal a' tairgse co-tharraing\nblackOffersDraw=Tha dubh a' tairgse co-tharraing\nwhiteDeclinesDraw=Tha geal a' di\u00f9ltadh co-tharraing\nblackDeclinesDraw=Tha dubh a' di\u00f9ltadh co-tharraing\nyourOpponentOffersADraw=Tha an n\u00e0mhaid agad a\u2019 tairgse co-tharraing\naccept=Gabh ris\ndecline=Di\u00f9lt\nplayingRightNow=A\u2019 cluich an-dr\u00e0sta fh\u00e8in\nfinished=Cr\u00ecochnaichte\nabortGame=Stad an geama\ngameAborted=Chaidh sgur dhen gheama\nstandard=Coitcheann\nunlimited=Gun chr\u00ecoch\nmode=Modh\ncasual=Gun rangachadh\nrated=Rangaichte\nthisGameIsRated=Tha an geama seo rangaichte\nrematch=Ath-mhaids\nrematchOfferSent=Chaidh tairgse airson ath-mhaids a chur\nrematchOfferAccepted=Ghabhadh ri do thairgse airson ath-mhaids\nrematchOfferCanceled=Chaidh sgur dhe thairgse ath-mhaids\nrematchOfferDeclined=Tairgse ath-mhaids air a di\u00f9ltadh\ncancelRematchOffer=Sguir dhe thairgse ath-mhaids\nviewRematch=Seall an ath-mhaids\nplay=Cluich\ninbox=Bogsa a-steach\nchatRoom=Se\u00f2mar cabadaich\nspectatorRoom=Se\u00f2mar an luchd-amhairc\ncomposeMessage=Sgr\u00ecobh teachdaireachd\nnoNewMessages=Gun teachdaireachd \u00f9r\nsubject=Cuspair\nrecipient=Faightear\nsend=Cuir\nincrementInSeconds=Ioncramaid ann an diogan\nfreeOnlineChess=T\u00e0ileasg air loidhne an-asgaidh\nspectators=Luchd-amhairc:\nnbWins=Bhuannaich %s\nnbLosses=Chaill %s\nnbDraws=Co-tharraing %s\nexportGames=\u00c0s-phortaich geamannan\nratingRange=Rainse an rangachaidh\ngiveNbSeconds=Thoir %s diogan\npremoveEnabledClickAnywhereToCancel=Ro-ghluasad an comas - briog \u00e0ite sam bith airson sgur dheth\nthisPlayerUsesChessComputerAssistance=Tha an cluicheadair seo a\u2019 cleachdadh taic coimpiutair taileisg\nopening=Fosgladh\ntakeback=Tarraing air ais\nproposeATakeback=Tairg tarraing air ais\ntakebackPropositionSent=Tairgse tarraing air ais air a cur\ntakebackPropositionDeclined=Tairgse tarraing air ais air a di\u00f9ltadh\ntakebackPropositionAccepted=Air gabhail ri tairgse tarraing air ais\ntakebackPropositionCanceled=Chaidh sgur dhe thairgse tarraing air ais\nyourOpponentProposesATakeback=Tha an n\u00e0mhaid a\u2019 tairgse tarraing air ais\nbookmarkThisGame=Cruthaich comharra-l\u00ecn airson a\u2019 gheama seo.\nsearch=Lorg\nadvancedSearch=Lorg adhartach\ntournament=F\u00e8ill-chluich\ntournaments=F\u00e8illean-chluich\ntournamentPoints=Puingean f\u00e8ill-chluich\nviewTournament=Seall an fh\u00e8ill-chluich\nbackToTournament=Till dhan fh\u00e8ill-chluich\nbackToGame=Till dhan gheama\nfreeOnlineChessGamePlayChessNowInACleanInterfaceNoRegistrationNoAdsNoPluginRequiredPlayChessWithComputerFriendsOrRandomOpponents=T\u00e0ileasg air loidhne an-asgaidh. Cluich t\u00e0ileasg ann am pr\u00f2gram air a bheil dreach glan. Gun chl\u00e0radh, gun sanasachd, gun fheum air plugan. Cluich t\u00e0ileasg an aghaidh a\u2019 choimpiutair, charaidean no n\u00e0imhdean air thuaiream.\nteams=Sgiobaidhean\nnbMembers=%s ball\nallTeams=A h-uile sgioba\nnewTeam=Sgioba \u00f9r\nmyTeams=Na sgiobaidhean agam\nnoTeamFound=Cha deach sgioba a lorg\njoinTeam=Gabh p\u00e0irt san sgioba\nquitTeam=F\u00e0g an sgioba\nanyoneCanJoin=Faodaidh duine sam bith p\u00e0irt a ghabhail ann\naConfirmationIsRequiredToJoin=Tha feum air dearbhadh gus p\u00e0irt a ghabhail ann\njoiningPolicy=Poileasaidh na ballrachd\nteamLeader=Ceannard an sgioba\nteamBestPlayers=Na cluicheadairean as fhearr\nteamRecentMembers=Na buill as \u00f9ire\nxJoinedTeamY=Ghabh %s ballrachd san sgioba %s\nxCreatedTeamY=Chruthaich %s an sgioba %s\naverageElo=Rangachadh cuibheasach\nlocation=\u00c0ite\nsettings=Roghainnean\nfilterGames=Criathraich na geamannan\nreset=Ath-shuidhich\napply=Cuir an s\u00e0s\nleaderboard=Cl\u00e0r nan curaidh\npasteTheFenStringHere=Cuir a-steach an t-sreang FEN an-seo\npasteThePgnStringHere=Cuir a-steach an t-sreang PGN an-seo\nfromPosition=On t-suidheachadh\ncontinueFromHere=Lean air adhart on a sheo\nimportGame=Ion-phortaich geama\nnbImportedGames=%s geamannan air an ion-phortadh\nthisIsAChessCaptcha=Seo CAPTCHA t\u00e0ileisg.\nclickOnTheBoardToMakeYourMove=Briog air a\u2019 bh\u00f2rd airson gluasad \u2019s dearbhaich gur e duine a th\u2019 annad.\nnotACheckmate=Chan e tul-chasg a th\u2019 ann\ncolorPlaysCheckmateInOne=Tha %s a\u2019 cluich; tul-chasg an ceann gluasaid\nretry=Feuch ris a-rithist\nreconnecting=Ag ath-cheangal\nonlineFriends=Caraidean air loidhne\nnoFriendsOnline=Chan eil caraid air loidhne\nfindFriends=Lorg caraidean\nfavoriteOpponents=Na farpaisichean as annsa leat\nfollow=Lean\nfollowing=A\u2019 leantainn\nunfollow=Na lean an corr\nblock=Bac\nblocked=Bacte\nunblock=D\u00ec-bhac\nfollowsYou=\u2019Gad leantainn\nxStartedFollowingY=Th\u00f2isich %s a\u2019 leantainn %s\nnbFollowers=%s luchd-leantainn\nnbFollowing=%s a' leantainn\nmore=Barrachd\nmemberSince=Ball o chionn\nlastSeenActive=An logadh a-steach mu dheireadh %s\nchallengeToPlay=Thoir d\u00f9bhlan cluiche dha\nplayer=Cluicheadair\nlist=Liosta\ngraph=Graf\nlessThanNbMinutes=Nas lugha na %s mionaidean\nxToYMinutes=%s gu %s mionaidean\ntextIsTooShort=Tha an teacsa ro ghoirid.\ntextIsTooLong=Tha an teacsa ro fhada.\nrequired=Riatanach.\nopenTournaments=F\u00e8ill-chluichean fosgailte\nduration=Faid\nwinner=Buannaiche\nstanding=Suidheachadh\ncreateANewTournament=Cruthaich f\u00e8ill-chluich \u00f9r\njoin=Gabh p\u00e0irt ann\nwithdraw=C\u00f9laich\npoints=Puingean\nwins=Buaidhean\nlosses=Ruaigean\nwinStreak=Sreath de bhuaidhean\ncreatedBy=Air a chruthachadh le\ntournamentIsStarting=Tha an fh\u00e8ill-chluich gu bhith t\u00f2iseachadh\nmembersOnly=Buill a-mh\u00e0in\nboardEditor=Deasaiche a\u2019 bh\u00f9ird\nstartPosition=Suidheachadh an t\u00f2iseachaidh\nclearBoard=Falamhaich am b\u00f2rd\nsavePosition=S\u00e0bhail an suidheachadh\nloadPosition=Luchdaich suidheachadh\nisPrivate=Pr\u00ecobhaideach\nreportXToModerators=Cuir gearan mu %s dha na maoir\nprofile=Pr\u00f2ifil\neditProfile=Deasaich a\u2019 phr\u00f2ifil\nfirstName=Ainm\nlastName=Sloinneadh\nbiography=Eachdraidh-beatha\ncountry=D\u00f9thaich\npreferences=Roghainnean\nwatchLichessTV=Coimhead air tbh Lichess\npreviouslyOnLichessTV=Air tbh Lichess roimhe\nonlinePlayers=Cluicheadairean air loidhne\nactiveToday=Gn\u00ecomhach an-diugh\nactivePlayers=Cluicheadairean gn\u00ecomhach\nbewareTheGameIsRatedButHasNoClock=Thoir an aire, th\u00e8id an geama seo rangachadh ach chan eil uaireadair aige!\ntraining=Tr\u00e8anadh\nyourPuzzleRatingX=An rangachadh agad: %s\nfindTheBestMoveForWhite=Lorg an gluasad as fhearr airson geal.\nfindTheBestMoveForBlack=Lorg an gluasad as fhearr airson dubh.\ntoTrackYourProgress=Gus s\u00f9il a chumail air d\u2019 adhartas:\ntrainingSignupExplanation=Bheir Lichess t\u00f2imhseachain dhut a bhios freagarrach dhan chomas agad ach am faigh thu tr\u00e8anadh as iomchaidh.\nrecentlyPlayedPuzzles=T\u00f2imhseachain o chionn goirid\npuzzleId=T\u00f2imhseachan %s\npuzzleOfTheDay=T\u00f2imhseachan an latha\nclickToSolve=Briog an-seo airson fhuasgladh\ngoodMove=Seo gluasad math\nbutYouCanDoBetter=Ach tha gluasad nas fhearr ann.\nbestMove=Seo an gluasad as fhearr!\nkeepGoing=Cum ort...\npuzzleFailed=Cha deach leat\nbutYouCanKeepTrying=Ach faodaidh tu feuchainn a-rithist.\nvictory=Buaidh!\ngiveUp=Thoir g\u00e8ill\npuzzleSolvedInXSeconds=Rinn thu a\u2019 ch\u00f9is air an ceann %s diog.\nwasThisPuzzleAnyGood=An robh an t\u00f2imhseachan seo math?\npleaseVotePuzzle=Cuidich lichess \u2019s cuir bh\u00f2t ann leis an t-saighead suas no s\u00ecos:\nthankYou=M\u00f2ran taing!\nratingX=Rangachadh: %s\nplayedXTimes=Air a chluich %s turas\nfromGameLink=On gheama %s\nstartTraining=T\u00f2isich air an tr\u00e8anadh\ncontinueTraining=Lean air adhart leis an tr\u00e8anadh\nretryThisPuzzle=Feuch ris an t\u00f2imhseachan seo a-rithist\nthisPuzzleIsCorrect=Tha an t\u00f2imhseachan seo ceart is inntinneach\nthisPuzzleIsWrong=Tha an t\u00f2imhseachan seo cearr no d\u00f2rainneach\nyouHaveNbSecondsToMakeYourFirstMove=Tha %s diog(an) air fh\u00e0gail dhut airson a' chiad gluasaid agad!\nnbGamesInPlay=%s geama 'gan cluich\nopeningId=Fosgladh %s\nyourOpeningRatingX=An rangachadh fosglaidh agad: %s\nfindNbStrongMoves=Lorg %s gluasad(an) l\u00e0idir\nthisMoveGivesYourOpponentTheAdvantage=Tha an gluasad seo a' toirt buannachd dha do n\u00e0mhaid\nopeningFailed=Dh'fh\u00e0illig leis an fhosgladh\nopeningSolved=Chaidh am fosgladh fhuasgladh\nrecentlyPlayedOpenings=Fosglaidhean a chaidh a chluich o chionn goirid\npuzzles=T\u00f2imhseachain\ncoordinates=Co-chomharran\nopenings=Fosglaidhean\nlatestUpdates=Na naidheachdan as \u00f9ire\ntournamentWinners=Feadhainn a bhuannaich f\u00e8ill-chluich\nname=Ainm\ndescription=Tuairisgeul\nno=Chan eil\nyes=Tha\nhelp=Cobhair:\ncreateANewTopic=Cruthaich cuspair \u00f9r\ntopics=Cuspairean\nposts=Postaichean\nlastPost=Am post mu dheireadh\nviews=Air a shealltainn\nreplies=Freagairtean\nreplyToThisTopic=Freagair dhan chuspair seo\nreply=Freagair\nmessage=Teachdaireachd\ncreateTheTopic=Cruthaich an cuspair\nreportAUser=D\u00e8an aithris air cleachdaiche\nuser=Cleachdaiche\nreason=Adhbhar\nwhatIsIheMatter=D\u00e8 an trioblaid?\ncheat=Cealgaireachd\ninsult=Mosach\ntroll=Troll\nother=Adhbhar eile\nby=le %s\nthisTopicIsNowClosed=Tha an cuspair seo d\u00f9inte a-nis.\ntheming=\u00d9rlar\nblog=Bloga\nquestionsAndAnswers=Ceistean & Freagairtean\nnotes=N\u00f2taichean\ntypePrivateNotesHere=Sgr\u00ecobh notaichean pr\u00ecobhaideach an seo\ngameDisplay=Dealbhachd na geama\npieceAnimation=Gluasachd nam p\u00ecosan\nmaterialDifference=Eadar-dhealachadh de stuth\nboardHighlights=Soillseachadh am b\u00f2rd (an gluasachd mu dheireadh agus caisg)\npieceDestinations=Ceann-uidhe nam p\u00ecosan (gluasachdan dligheach agus ro-ghluasachdan)\nboardCoordinates=Co-chomharran na b\u00f9ird (A-H, 1-8)\nmoveListWhilePlaying=Liosta na gluasachdan fhad 's a tha thu a' cluich\ntenthsOfSeconds=Deicheamhan de dhiogan\nprivacy=Pr\u00ecobhaideachd\nsound=Fuaim\nnone=Na seall\nfast=Luath\nnormal=Meadhanach\nslow=Slaodach\ninsideTheBoard=Taobh a-staigh den bh\u00f2rd\noutsideTheBoard=Taobh a-muigh den bh\u00f2rd\nonSlowGames=Air geamannan slaodach\nalways=An-c\u00f2mhnaidh\ndifficultyEasy=Furasta\ndifficultyNormal=Meadhanach\ndifficultyHard=Doirbh\nxCompetesInY=%s a' gabhail p\u00e0irt ann an %s\ntimeline=Loidhne-t\u00ecm\nseeAllTournaments=Faic na f\u00e8illean-cluich uile\nstarting=A' t\u00f2iseachadh:\nyourCityRegionOrDepartment=Do bhaile, do sg\u00ecre no do mh\u00f3r-roinn.\nbiographyDescription=Innis mu do dheidhinn, de 's toigh leat ann an t\u00e0ileasg, na fosglaidhean as fhearr leat, geamannan, cluicheadairean...\nmaximumNbCharacters=A' chuid as motha: %s caractarean.\nlearn=Ionnsaich\ncommunity=Coimhearsnachd\ntools=Goireasean\nincrement=Ioncramaid\nboard=B\u00f2rd\npieces=P\u00ecosan\nmenu=Cl\u00e0r-taice\nwhiteCastlingKingside=Geal O-O\nwhiteCastlingQueenside=Geal O-O-O\nblackCastlingKingside=Dubh O-O\nblackCastlingQueenside=Dubh O-O-O\nnbForumPosts=%s Puist air F\u00f2ram\ntpTimeSpentPlaying=\u00d9ine a' cluich: %s\nwatchGames=Coimhead geamannan\ntpTimeSpentOnTV=\u00d9ine air tbh: %s\nwatch=Coimhead\nvideoLibrary=Cruinneachadh bhidiothan\ncontact=Cuir fios\nlichessTournaments=F\u00e9illean-chluich Lichess\ntournamentOfficial=Oifigeil\ntimeBeforeTournamentStarts=\u00d9ine mus t\u00f2isich an fh\u00e9ill-chluich\nyouAreBetterThanPercentOfPerfTypePlayers=Tha thu nas fhearr na %s de chluicheadairean %s.\nconfirmResignation=Cinntich an g\u00e8illeadh\n","old_contents":"playWithAFriend=Cluich c\u00f2mhla ri caraid\nplayWithTheMachine=Cluich an aghaidh a' choimpiutair\ntoInviteSomeoneToPlayGiveThisUrl=Gus cuireadh a thoirt do chuideigin, thoir an url seo dha\ngameOver=Cr\u00ecoch a\u2019 gheama\nwaitingForOpponent=A\u2019 feitheamh air n\u00e0mhaid\nwaiting=A\u2019 feitheamh\nyourTurn=An turas agad\naiNameLevelAiLevel=%s inbhe %s\nlevel=Inbhe\ntoggleTheChat=Toglaich a\u2019 chabadaich\ntoggleSound=Toglaich fuaim\nchat=Cabadaich\nresign=G\u00e8ill\ncheckmate=Tul-chasg\nstalemate=Clos-cluiche\nwhite=Geal\nblack=Dubh\nrandomColor=Dath air thuaiream\ncreateAGame=Cruthaich geama\nwhiteIsVictorious=Bhuannaich geal\nblackIsVictorious=Bhuannaich dubh\nkingInTheCenter=R\u00ecgh sa mheadhan\nthreeChecks=Tr\u00ec caisg\nnewOpponent=N\u00e0mhaid \u00f9r\nyourOpponentWantsToPlayANewGameWithYou=Tha an n\u00e0mhaid agad airson geama \u00f9r a chluich \u2019nad aghaidh\njoinTheGame=Thig a-steach dhan gheama\nwhitePlays=Tha geal a\u2019 cluich\nblackPlays=Tha dubh a\u2019 cluich\ntheOtherPlayerHasLeftTheGameYouCanForceResignationOrWaitForHim=Tha an cluicheadair eile air a' gheama fh\u00e0gail. Is urrainn dhut g\u00e8illeadh a chur air, geama ionnannach a ghairm, no feitheamh air a shon.\nmakeYourOpponentResign=Cuir g\u00e8illeadh air an n\u00e0mhaid agad\nforceResignation=Gairm buaidh\nforceDraw=Gairm geama ionnannach\ntalkInChat=D\u00e8an cabadaich\ntheFirstPersonToComeOnThisUrlWillPlayWithYou=Cluichidh a\u2019 chiad neach a thig a-steach air an url seo c\u00f2mhla riut.\nwhiteResigned=Gh\u00e8ill geal\nblackResigned=Gh\u00e8ill dubh\nwhiteLeftTheGame=Dh\u2019fh\u00e0g geal an geama\nblackLeftTheGame=Dh\u2019fh\u00e0g dubh an geama\nshareThisUrlToLetSpectatorsSeeTheGame=Co-roinn an url seo gus luchd-amhairc a leigeil a-steach dhan gheama\ntheComputerAnalysisHasFailed=Dh\u2019fh\u00e0illig le anailis a\u2019 choimpiutair\nviewTheComputerAnalysis=Seall anailis a\u2019 choimpiutair\nrequestAComputerAnalysis=Iarr anailis air a\u2019 choimpiutair\ncomputerAnalysis=Anailis a\u2019 choimpiutair\nanalysis=B\u00f2rd sgr\u00f9daidh\nblunders=Tuislidhean\nmistakes=Mearachdan\ninaccuracies=Neo-eagnaidhean\nmoveTimes=\u00d9ine nan gluasadan\nflipBoard=D\u00e8an flip air a\u2019 bh\u00f2rd\nthreefoldRepetition=Treas ath-nochdadh\nclaimADraw=Gairm co-tharraing\nofferDraw=Tairg co-tharraing\ndraw=Co-tharraing\nnbConnectedPlayers=%s cluicheadairean\ngamesBeingPlayedRightNow=Geamannan a tha \u2019gan cluich an-dr\u00e0sta fh\u00e8in\nviewAllNbGames=%s geamannan\nviewNbCheckmates=%s tul-chaisg\nnbBookmarks=%s comharran-l\u00ecn\nnbPopularGames=%s geamannan m\u00f2r-ch\u00f2rdte\nnbAnalysedGames=%s geamannan sgr\u00f9daichte\nbookmarkedByNbPlayers=Comharra-leabhair le %s cluicheadairean\nviewInFullSize=Seall sa mheud iomlan\nlogOut=Log a-mach\nsignIn=Log a-steach\nnewToLichess=\u00d9r air Lichess?\nyouNeedAnAccountToDoThat=Tha feum agad air cunntas gus sin a dh\u00e8anamh\nsignUp=Cl\u00e0raich\ngames=Geamannan\nforum=B\u00f2rd-brath\nxPostedInForumY=Sgr\u00ecobh %s san fh\u00f2ram %s\nlatestForumPosts=Na postaichean as \u00f9ire\nplayers=Cluicheadairean\nminutesPerSide=Mionaidean gach taobh\nvariant=Caochladh\nvariants=Se\u00f2rsachan\ntimeControl=Smachd air an \u00f9ine\nrealTime=F\u00ecor-\u00f9ine\ndaysPerTurn=L\u00e0ithean gach cuairt\noneDay=Aon latha\nnbDays=%s l\u00e0(ithean)\nnbHours=%s uair(ean)\ntime=\u00d9ine\nrating=Rangachadh\nusername=Ainm-cleachdaidh\nusernameOrEmail=Far-ainm\npassword=Facal-faire\nhaveAnAccount=A bheil cunntas agad?\nchangePassword=Atharraich am facal-faire\nchangeEmail=Atharraich am post-d\nemail=Post-d\nemailIsOptional=Tha am post-d roghainneil. cleachdaich Lichess an se\u00f2ladh puist-d agad gus am facal-faire agad ath-shuidheachadh ma dh\u00ecochuimhnicheas tu e.\npasswordReset=Ath-shuidheachadh an fhacail-fhaire\nforgotPassword=An do dh\u00ecochuimhnich thu am facal-faire?\nrank=Inbhe\ngamesPlayed=Geamannan air an cluich\nnbGamesWithYou=%s geamannan c\u00f2mhla riut\ndeclineInvitation=Di\u00f9lt cuireadh\ncancel=Sguir dheth\ntimeOut=Dh\u2019fhalbh an \u00f9ine\ndrawOfferSent=Chaidh tairgse airson co-tharraing a chur\ndrawOfferDeclined=Dhi\u00f9ltadh do thairgse airson co-tharraing\ndrawOfferAccepted=Ghabhadh ri do thairgse airson co-tharraing\ndrawOfferCanceled=Sguireadh de do thairgse airson co-tharraing\nwhiteOffersDraw=Tha geal a' tairgse co-tharraing\nblackOffersDraw=Tha dubh a' tairgse co-tharraing\nwhiteDeclinesDraw=Tha geal a' di\u00f9ltadh co-tharraing\nblackDeclinesDraw=Tha dubh a' di\u00f9ltadh co-tharraing\nyourOpponentOffersADraw=Tha an n\u00e0mhaid agad a\u2019 tairgse co-tharraing\naccept=Gabh ris\ndecline=Di\u00f9lt\nplayingRightNow=A\u2019 cluich an-dr\u00e0sta fh\u00e8in\nfinished=Cr\u00ecochnaichte\nabortGame=Stad an geama\ngameAborted=Chaidh sgur dhen gheama\nstandard=Coitcheann\nunlimited=Gun chr\u00ecoch\nmode=Modh\ncasual=Gun rangachadh\nrated=Rangaichte\nthisGameIsRated=Tha an geama seo rangaichte\nrematch=Ath-mhaids\nrematchOfferSent=Chaidh tairgse airson ath-mhaids a chur\nrematchOfferAccepted=Ghabhadh ri do thairgse airson ath-mhaids\nrematchOfferCanceled=Chaidh sgur dhe thairgse ath-mhaids\nrematchOfferDeclined=Tairgse ath-mhaids air a di\u00f9ltadh\ncancelRematchOffer=Sguir dhe thairgse ath-mhaids\nviewRematch=Seall an ath-mhaids\nplay=Cluich\ninbox=Bogsa a-steach\nchatRoom=Se\u00f2mar cabadaich\nspectatorRoom=Se\u00f2mar an luchd-amhairc\ncomposeMessage=Sgr\u00ecobh teachdaireachd\nnoNewMessages=Gun teachdaireachd \u00f9r\nsubject=Cuspair\nrecipient=Faightear\nsend=Cuir\nincrementInSeconds=Ioncramaid ann an diogan\nfreeOnlineChess=T\u00e0ileasg air loidhne an-asgaidh\nspectators=Luchd-amhairc:\nnbWins=Bhuannaich %s\nnbLosses=Chaill %s\nnbDraws=Co-tharraing %s\nexportGames=\u00c0s-phortaich geamannan\nratingRange=Rainse an rangachaidh\ngiveNbSeconds=Thoir %s diogan\npremoveEnabledClickAnywhereToCancel=Ro-ghluasad an comas - briog \u00e0ite sam bith airson sgur dheth\nthisPlayerUsesChessComputerAssistance=Tha an cluicheadair seo a\u2019 cleachdadh taic coimpiutair taileisg\nopening=Fosgladh\ntakeback=Tarraing air ais\nproposeATakeback=Tairg tarraing air ais\ntakebackPropositionSent=Tairgse tarraing air ais air a cur\ntakebackPropositionDeclined=Tairgse tarraing air ais air a di\u00f9ltadh\ntakebackPropositionAccepted=Air gabhail ri tairgse tarraing air ais\ntakebackPropositionCanceled=Chaidh sgur dhe thairgse tarraing air ais\nyourOpponentProposesATakeback=Tha an n\u00e0mhaid a\u2019 tairgse tarraing air ais\nbookmarkThisGame=Cruthaich comharra-l\u00ecn airson a\u2019 gheama seo.\nsearch=Lorg\nadvancedSearch=Lorg adhartach\ntournament=F\u00e8ill-chluich\ntournaments=F\u00e8illean-chluich\ntournamentPoints=Puingean f\u00e8ill-chluich\nviewTournament=Seall an fh\u00e8ill-chluich\nbackToTournament=Till dhan fh\u00e8ill-chluich\nbackToGame=Till dhan gheama\nfreeOnlineChessGamePlayChessNowInACleanInterfaceNoRegistrationNoAdsNoPluginRequiredPlayChessWithComputerFriendsOrRandomOpponents=T\u00e0ileasg air loidhne an-asgaidh. Cluich t\u00e0ileasg ann am pr\u00f2gram air a bheil dreach glan. Gun chl\u00e0radh, gun sanasachd, gun fheum air plugan. Cluich t\u00e0ileasg an aghaidh a\u2019 choimpiutair, charaidean no n\u00e0imhdean air thuaiream.\nteams=Sgiobaidhean\nnbMembers=%s ball\nallTeams=A h-uile sgioba\nnewTeam=Sgioba \u00f9r\nmyTeams=Na sgiobaidhean agam\nnoTeamFound=Cha deach sgioba a lorg\njoinTeam=Gabh p\u00e0irt san sgioba\nquitTeam=F\u00e0g an sgioba\nanyoneCanJoin=Faodaidh duine sam bith p\u00e0irt a ghabhail ann\naConfirmationIsRequiredToJoin=Tha feum air dearbhadh gus p\u00e0irt a ghabhail ann\njoiningPolicy=Poileasaidh na ballrachd\nteamLeader=Ceannard an sgioba\nteamBestPlayers=Na cluicheadairean as fhearr\nteamRecentMembers=Na buill as \u00f9ire\nxJoinedTeamY=Ghabh %s ballrachd san sgioba %s\nxCreatedTeamY=Chruthaich %s an sgioba %s\naverageElo=Rangachadh cuibheasach\nlocation=\u00c0ite\nsettings=Roghainnean\nfilterGames=Criathraich na geamannan\nreset=Ath-shuidhich\napply=Cuir an s\u00e0s\nleaderboard=Cl\u00e0r nan curaidh\npasteTheFenStringHere=Cuir a-steach an t-sreang FEN an-seo\npasteThePgnStringHere=Cuir a-steach an t-sreang PGN an-seo\nfromPosition=On t-suidheachadh\ncontinueFromHere=Lean air adhart on a sheo\nimportGame=Ion-phortaich geama\nnbImportedGames=%s geamannan air an ion-phortadh\nthisIsAChessCaptcha=Seo CAPTCHA t\u00e0ileisg.\nclickOnTheBoardToMakeYourMove=Briog air a\u2019 bh\u00f2rd airson gluasad \u2019s dearbhaich gur e duine a th\u2019 annad.\nnotACheckmate=Chan e tul-chasg a th\u2019 ann\ncolorPlaysCheckmateInOne=Tha %s a\u2019 cluich; tul-chasg an ceann gluasaid\nretry=Feuch ris a-rithist\nreconnecting=Ag ath-cheangal\nonlineFriends=Caraidean air loidhne\nnoFriendsOnline=Chan eil caraid air loidhne\nfindFriends=Lorg caraidean\nfavoriteOpponents=Na farpaisichean as annsa leat\nfollow=Lean\nfollowing=A\u2019 leantainn\nunfollow=Na lean an corr\nblock=Bac\nblocked=Bacte\nunblock=D\u00ec-bhac\nfollowsYou=\u2019Gad leantainn\nxStartedFollowingY=Th\u00f2isich %s a\u2019 leantainn %s\nnbFollowers=%s luchd-leantainn\nnbFollowing=%s a' leantainn\nmore=Barrachd\nmemberSince=Ball o chionn\nlastSeenActive=An logadh a-steach mu dheireadh %s\nchallengeToPlay=Thoir d\u00f9bhlan cluiche dha\nplayer=Cluicheadair\nlist=Liosta\ngraph=Graf\nlessThanNbMinutes=Nas lugha na %s mionaidean\nxToYMinutes=%s gu %s mionaidean\ntextIsTooShort=Tha an teacsa ro ghoirid.\ntextIsTooLong=Tha an teacsa ro fhada.\nrequired=Riatanach.\nopenTournaments=F\u00e8ill-chluichean fosgailte\nduration=Faid\nwinner=Buannaiche\nstanding=Suidheachadh\ncreateANewTournament=Cruthaich f\u00e8ill-chluich \u00f9r\njoin=Gabh p\u00e0irt ann\nwithdraw=C\u00f9laich\npoints=Puingean\nwins=Buaidhean\nlosses=Ruaigean\nwinStreak=Sreath de bhuaidhean\ncreatedBy=Air a chruthachadh le\ntournamentIsStarting=Tha an fh\u00e8ill-chluich gu bhith t\u00f2iseachadh\nmembersOnly=Buill a-mh\u00e0in\nboardEditor=Deasaiche a\u2019 bh\u00f9ird\nstartPosition=Suidheachadh an t\u00f2iseachaidh\nclearBoard=Falamhaich am b\u00f2rd\nsavePosition=S\u00e0bhail an suidheachadh\nloadPosition=Luchdaich suidheachadh\nisPrivate=Pr\u00ecobhaideach\nreportXToModerators=Cuir gearan mu %s dha na maoir\nprofile=Pr\u00f2ifil\neditProfile=Deasaich a\u2019 phr\u00f2ifil\nfirstName=Ainm\nlastName=Sloinneadh\nbiography=Eachdraidh-beatha\ncountry=D\u00f9thaich\npreferences=Roghainnean\nwatchLichessTV=Coimhead air tbh Lichess\npreviouslyOnLichessTV=Air tbh Lichess roimhe\nonlinePlayers=Cluicheadairean air loidhne\nactiveToday=Gn\u00ecomhach an-diugh\nactivePlayers=Cluicheadairean gn\u00ecomhach\nbewareTheGameIsRatedButHasNoClock=Thoir an aire, th\u00e8id an geama seo rangachadh ach chan eil uaireadair aige!\ntraining=Tr\u00e8anadh\nyourPuzzleRatingX=An rangachadh agad: %s\nfindTheBestMoveForWhite=Lorg an gluasad as fhearr airson geal.\nfindTheBestMoveForBlack=Lorg an gluasad as fhearr airson dubh.\ntoTrackYourProgress=Gus s\u00f9il a chumail air d\u2019 adhartas:\ntrainingSignupExplanation=Bheir Lichess t\u00f2imhseachain dhut a bhios freagarrach dhan chomas agad ach am faigh thu tr\u00e8anadh as iomchaidh.\nrecentlyPlayedPuzzles=T\u00f2imhseachain o chionn goirid\npuzzleId=T\u00f2imhseachan %s\npuzzleOfTheDay=T\u00f2imhseachan an latha\nclickToSolve=Briog an-seo airson fhuasgladh\ngoodMove=Seo gluasad math\nbutYouCanDoBetter=Ach tha gluasad nas fhearr ann.\nbestMove=Seo an gluasad as fhearr!\nkeepGoing=Cum ort...\npuzzleFailed=Cha deach leat\nbutYouCanKeepTrying=Ach faodaidh tu feuchainn a-rithist.\nvictory=Buaidh!\ngiveUp=Thoir g\u00e8ill\npuzzleSolvedInXSeconds=Rinn thu a\u2019 ch\u00f9is air an ceann %s diog.\nwasThisPuzzleAnyGood=An robh an t\u00f2imhseachan seo math?\npleaseVotePuzzle=Cuidich lichess \u2019s cuir bh\u00f2t ann leis an t-saighead suas no s\u00ecos:\nthankYou=M\u00f2ran taing!\nratingX=Rangachadh: %s\nplayedXTimes=Air a chluich %s turas\nfromGameLink=On gheama %s\nstartTraining=T\u00f2isich air an tr\u00e8anadh\ncontinueTraining=Lean air adhart leis an tr\u00e8anadh\nretryThisPuzzle=Feuch ris an t\u00f2imhseachan seo a-rithist\nthisPuzzleIsCorrect=Tha an t\u00f2imhseachan seo ceart is inntinneach\nthisPuzzleIsWrong=Tha an t\u00f2imhseachan seo cearr no d\u00f2rainneach\nyouHaveNbSecondsToMakeYourFirstMove=Tha %s diog(an) air fh\u00e0gail dhut airson a' chiad gluasaid agad!\nnbGamesInPlay=%s geama 'gan cluich\nopeningId=Fosgladh %s\nyourOpeningRatingX=An rangachadh fosglaidh agad: %s\nfindNbStrongMoves=Lorg %s gluasad(an) l\u00e0idir\nthisMoveGivesYourOpponentTheAdvantage=Tha an gluasad seo a' toirt buannachd dha do n\u00e0mhaid\nopeningFailed=Dh'fh\u00e0illig leis an fhosgladh\nopeningSolved=Chaidh am fosgladh fhuasgladh\nrecentlyPlayedOpenings=Fosglaidhean a chaidh a chluich o chionn goirid\npuzzles=T\u00f2imhseachain\ncoordinates=Co-chomharran\nopenings=Fosglaidhean\nlatestUpdates=Na naidheachdan as \u00f9ire\ntournamentWinners=Feadhainn a bhuannaich f\u00e8ill-chluich\nname=Ainm\ndescription=Tuairisgeul\nno=Chan eil\nyes=Tha\nhelp=Cobhair:\ncreateANewTopic=Cruthaich cuspair \u00f9r\ntopics=Cuspairean\nposts=Postaichean\nlastPost=Am post mu dheireadh\nviews=Air a shealltainn\nreplies=Freagairtean\nreplyToThisTopic=Freagair dhan chuspair seo\nreply=Freagair\nmessage=Teachdaireachd\ncreateTheTopic=Cruthaich an cuspair\nreportAUser=D\u00e8an aithris air cleachdaiche\nuser=Cleachdaiche\nreason=Adhbhar\nwhatIsIheMatter=D\u00e8 an trioblaid?\ncheat=Cealgaireachd\ninsult=Mosach\ntroll=Troll\nother=Adhbhar eile\nby=le %s\nthisTopicIsNowClosed=Tha an cuspair seo d\u00f9inte a-nis.\ntheming=\u00d9rlar\nblog=Bloga\nquestionsAndAnswers=Ceistean & Freagairtean\nnotes=N\u00f2taichean\ntypePrivateNotesHere=Sgr\u00ecobh notaichean pr\u00ecobhaideach an seo\ngameDisplay=Dealbhachd na geama\npieceAnimation=Gluasachd nam p\u00ecosan\nmaterialDifference=Eadar-dhealachadh de stuth\nboardHighlights=Soillseachadh am b\u00f2rd (an gluasachd mu dheireadh agus caisg)\npieceDestinations=Ceann-uidhe nam p\u00ecosan (gluasachdan dligheach agus ro-ghluasachdan)\nboardCoordinates=Co-chomharran na b\u00f9ird (A-H, 1-8)\nmoveListWhilePlaying=Liosta na gluasachdan fhad 's a tha thu a' cluich\ntenthsOfSeconds=Deicheamhan de dhiogan\nprivacy=Pr\u00ecobhaideachd\nsound=Fuaim\nnone=Na seall\nfast=Luath\nnormal=Meadhanach\nslow=Slaodach\ninsideTheBoard=Taobh a-staigh den bh\u00f2rd\noutsideTheBoard=Taobh a-muigh den bh\u00f2rd\nonSlowGames=Air geamannan slaodach\nalways=An-c\u00f2mhnaidh\ndifficultyEasy=Furasta\ndifficultyNormal=Meadhanach\ndifficultyHard=Doirbh\nxCompetesInY=%s a' gabhail p\u00e0irt ann an %s\ntimeline=Loidhne-t\u00ecm\nseeAllTournaments=Faic na f\u00e8illean-cluich uile\nstarting=A' t\u00f2iseachadh:\nyourCityRegionOrDepartment=Do bhaile, do sg\u00ecre no do mh\u00f3r-roinn.\nbiographyDescription=Innis mu do dheidhinn, de 's toigh leat ann an t\u00e0ileasg, na fosglaidhean as fhearr leat, geamannan, cluicheadairean...\nmaximumNbCharacters=A' chuid as motha: %s caractarean.\nlearn=Ionnsaich\ncommunity=Coimhearsnachd\ntools=Goireasean\nincrement=Ioncramaid\nboard=B\u00f2rd\npieces=P\u00ecosan\nmenu=Cl\u00e0r-taice\nnbForumPosts=%s Puist air F\u00f2ram\ntpTimeSpentPlaying=\u00d9ine a' cluich: %s\nwhiteCastlingKingside=Geal O-O\nwhiteCastlingQueenside=Geal O-O-O\nblackCastlingKingside=Dubh O-O\nblackCastlingQueenside=Dubh O-O-O\nwatchGames=Coimhead geamannan\ntpTimeSpentOnTV=\u00d9ine air tbh: %s\nwatch=Coimhead\nvideoLibrary=Cruinneachadh bhidiothan\ncontact=Cuir fios\nlichessTournaments=F\u00e9illean-chluich Lichess\ntournamentOfficial=Oifigeil\ntimeBeforeTournamentStarts=\u00d9ine mus t\u00f2isich an fh\u00e9ill-chluich\nyouAreBetterThanPercentOfPerfTypePlayers=Tha thu nas fhearr na %s de chluicheadairean %s.\nconfirmResignation=Cinntich an g\u00e8illeadh\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"GDScript"} {"commit":"c16581f4a719d7923fc46df41ab7d3143032282b","subject":"Resetting score when starting new round","message":"Resetting score when starting new round\n","repos":"P1X-in\/boctok","old_file":"scripts\/entities\/player.gd","new_file":"scripts\/entities\/player.gd","new_contents":"extends \"res:\/\/scripts\/entities\/object.gd\"\n\nvar camera\nvar hud\nvar fuel_gauge\nvar newspaper\n\nvar player_id\nvar gamepad_id = null\nvar keyboard_use = null\n\nvar gamepad_handlers = []\nvar keyboard_handlers = []\n\nvar boctok_template = preload(\"res:\/\/scenes\/ships\/ship.tscn\")\nvar mercury_template = preload(\"res:\/\/scenes\/ships\/mercury.tscn\")\n\nvar rocket_template = preload(\"res:\/\/scenes\/ships\/rocket.tscn\")\nvar rocket_cooldown = false\nvar swear_cooldown = false\nvar rocket_firing = false\nvar ROCKET_COOLDOWN_TIME = 0.1\nvar SWEAR_COOLDOWN_TIME = 2\n\nvar score = 0\n\nfunc _init(bag, player_id).(bag):\n self.bag = bag\n self.player_id = player_id\n if player_id == 0:\n self.avatar = self.boctok_template.instance()\n else:\n self.avatar = self.mercury_template.instance()\n self.avatar.player_id = player_id\n self.camera = self.avatar.get_node('camera')\n\n self.gamepad_handlers = [\n preload(\"res:\/\/scripts\/input\/handlers\/player_rotate_axis.gd\").new(self.bag, self, 0),\n #preload(\"res:\/\/scripts\/input\/handlers\/player_accelerate_axis.gd\").new(self.bag, self, 1),\n #preload(\"res:\/\/scripts\/input\/handlers\/player_accelerate_axis.gd\").new(self.bag, self, 3),\n preload(\"res:\/\/scripts\/input\/handlers\/player_accelerate_button.gd\").new(self.bag, self, JOY_BUTTON_0),\n preload(\"res:\/\/scripts\/input\/handlers\/player_boost_button.gd\").new(self.bag, self, JOY_BUTTON_1),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_button.gd\").new(self.bag, self, JOY_BUTTON_2),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_trigger.gd\").new(self.bag, self, 4),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_trigger.gd\").new(self.bag, self, 5),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_trigger.gd\").new(self.bag, self, 6),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_trigger.gd\").new(self.bag, self, 7),\n preload(\"res:\/\/scripts\/input\/handlers\/swear_button.gd\").new(self.bag, self, JOY_BUTTON_3),\n\n ]\n\n self.keyboard_handlers = [\n preload(\"res:\/\/scripts\/input\/handlers\/player_rotate_key.gd\").new(self.bag, self, KEY_LEFT, 1),\n preload(\"res:\/\/scripts\/input\/handlers\/player_rotate_key.gd\").new(self.bag, self, KEY_RIGHT, -1),\n preload(\"res:\/\/scripts\/input\/handlers\/player_accelerate_key.gd\").new(self.bag, self, KEY_UP),\n preload(\"res:\/\/scripts\/input\/handlers\/player_boost_key.gd\").new(self.bag, self, KEY_DOWN),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_key.gd\").new(self.bag, self, KEY_SPACE),\n preload(\"res:\/\/scripts\/input\/handlers\/swear_key.gd\").new(self.bag, self, KEY_B),\n ]\n\nfunc spawn(initial_position):\n self.attach()\n self.avatar.set_pos(initial_position)\n\nfunc attach():\n self.bag.processing.register(self)\n self.newspaper.hide()\n self.hud.show()\n self.fuel_gauge.show()\n self.score = 0\n .attach()\n\nfunc detach():\n self.bag.processing.remove(self)\n self.hud.hide()\n self.fuel_gauge.hide()\n .detach()\n\nfunc bind_keyboard():\n var keyboard = self.bag.input.schemes['game']['keyboard']\n self.keyboard_use = true\n for handler in self.keyboard_handlers:\n keyboard.register_handler(handler)\nfunc unbind_keyboard():\n if not self.keyboard_use:\n return\n\n var keyboard = self.bag.input.schemes['game']['keyboard']\n self.keyboard_use = false\n for handler in self.keyboard_handlers:\n keyboard.remove_handler(handler)\n\nfunc bind_gamepad(id):\n self.unbind_gamepad()\n self.gamepad_id = id\n var gamepad = self.bag.input.schemes['game']['pad' + str(id)]\n\n for handler in self.gamepad_handlers:\n gamepad.register_handler(handler)\n\nfunc unbind_gamepad():\n if self.gamepad_id == null:\n return\n\n var gamepad = self.bag.input.schemes['game']['pad' + str(self.gamepad_id)]\n\n for handler in self.gamepad_handlers:\n gamepad.remove_handler(handler)\n\n self.gamepad_id = null\n\nfunc reset():\n self.rocket_cooldown = false\n self.rocket_firing = false\n self.avatar.reset()\n self.score = 0\n\nfunc bind_camera(viewport):\n self.camera.set_custom_viewport(viewport)\n\nfunc bind_hud(hud, fuel_gauge):\n self.hud = hud\n self.fuel_gauge = fuel_gauge\n\nfunc bind_newspaper(newspaper):\n self.newspaper = newspaper\n\nfunc show_fail():\n self.newspaper.show()\n if self.player_id == 0:\n self.newspaper.get_node('nyt').hide()\n self.newspaper.get_node('pravda').show()\n else:\n self.newspaper.get_node('nyt').show()\n self.newspaper.get_node('pravda').hide()\n\nfunc process(delta):\n self.hud.update_sun_indicator(self.avatar.get_pos())\n self.hud.update_fuel(self.avatar.fuel)\n self.fuel_gauge.update_fuel(self.avatar.fuel)\n self.hud.update_gravity(self.avatar.current_gravity)\n self.hud.update_ship_velocity(self.avatar.current_acceleration)\n self.hud.update_score(self.score)\n\n if hud.update_sun_warning(self):\n self.swear()\n\n if self.rocket_firing and not self.rocket_cooldown:\n self.fire_rocket()\n\nfunc fire_rocket():\n if self.rocket_cooldown:\n return\n\n var rocket = self.rocket_template.instance()\n var position = self.avatar.get_pos()\n var starting_vector = Vector2(0, -1)\n starting_vector.x = ((randi() % 101) - 50) \/ 900.0\n var rocket_offset = starting_vector.rotated(self.avatar.rotation)\n var rocket_position = position + rocket_offset * 60\n\n rocket.initial_velocity = self.avatar.current_acceleration + rocket_offset * 500\n\n self.bag.board.attach_object(rocket)\n rocket.set_pos(rocket_position)\n rocket.set_rot(rocket.initial_velocity.angle() + 3.14)\n\n self.rocket_cooldown = true\n self.bag.timers.set_timeout(self.ROCKET_COOLDOWN_TIME, self, \"rocket_cooldown_done\")\n\n rocket.owner = self.player_id\n self.bag.sound.play('rocket_launch')\n\nfunc rocket_cooldown_done():\n self.rocket_cooldown = false\n\nfunc swear_cooldown_done():\n self.swear_cooldown = false\n\nfunc swear():\n if self.swear_cooldown:\n return\n\n randomize()\n var suffix\n var item\n if self.player_id == 0:\n suffix = \"ru_\"\n else:\n suffix = \"en_\"\n item = 'swear_' + suffix + str(randi() % 8 + 1)\n\n self.bag.sound.play(item)\n\n self.swear_cooldown = true\n self.bag.timers.set_timeout(self.SWEAR_COOLDOWN_TIME, self, \"swear_cooldown_done\")\n\n","old_contents":"extends \"res:\/\/scripts\/entities\/object.gd\"\n\nvar camera\nvar hud\nvar fuel_gauge\nvar newspaper\n\nvar player_id\nvar gamepad_id = null\nvar keyboard_use = null\n\nvar gamepad_handlers = []\nvar keyboard_handlers = []\n\nvar boctok_template = preload(\"res:\/\/scenes\/ships\/ship.tscn\")\nvar mercury_template = preload(\"res:\/\/scenes\/ships\/mercury.tscn\")\n\nvar rocket_template = preload(\"res:\/\/scenes\/ships\/rocket.tscn\")\nvar rocket_cooldown = false\nvar swear_cooldown = false\nvar rocket_firing = false\nvar ROCKET_COOLDOWN_TIME = 0.1\nvar SWEAR_COOLDOWN_TIME = 2\n\nvar score = 0\n\nfunc _init(bag, player_id).(bag):\n self.bag = bag\n self.player_id = player_id\n if player_id == 0:\n self.avatar = self.boctok_template.instance()\n else:\n self.avatar = self.mercury_template.instance()\n self.avatar.player_id = player_id\n self.camera = self.avatar.get_node('camera')\n\n self.gamepad_handlers = [\n preload(\"res:\/\/scripts\/input\/handlers\/player_rotate_axis.gd\").new(self.bag, self, 0),\n #preload(\"res:\/\/scripts\/input\/handlers\/player_accelerate_axis.gd\").new(self.bag, self, 1),\n #preload(\"res:\/\/scripts\/input\/handlers\/player_accelerate_axis.gd\").new(self.bag, self, 3),\n preload(\"res:\/\/scripts\/input\/handlers\/player_accelerate_button.gd\").new(self.bag, self, JOY_BUTTON_0),\n preload(\"res:\/\/scripts\/input\/handlers\/player_boost_button.gd\").new(self.bag, self, JOY_BUTTON_1),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_button.gd\").new(self.bag, self, JOY_BUTTON_2),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_trigger.gd\").new(self.bag, self, 4),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_trigger.gd\").new(self.bag, self, 5),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_trigger.gd\").new(self.bag, self, 6),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_trigger.gd\").new(self.bag, self, 7),\n preload(\"res:\/\/scripts\/input\/handlers\/swear_button.gd\").new(self.bag, self, JOY_BUTTON_3),\n\n ]\n\n self.keyboard_handlers = [\n preload(\"res:\/\/scripts\/input\/handlers\/player_rotate_key.gd\").new(self.bag, self, KEY_LEFT, 1),\n preload(\"res:\/\/scripts\/input\/handlers\/player_rotate_key.gd\").new(self.bag, self, KEY_RIGHT, -1),\n preload(\"res:\/\/scripts\/input\/handlers\/player_accelerate_key.gd\").new(self.bag, self, KEY_UP),\n preload(\"res:\/\/scripts\/input\/handlers\/player_boost_key.gd\").new(self.bag, self, KEY_DOWN),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_key.gd\").new(self.bag, self, KEY_SPACE),\n preload(\"res:\/\/scripts\/input\/handlers\/swear_key.gd\").new(self.bag, self, KEY_B),\n ]\n\nfunc spawn(initial_position):\n self.attach()\n self.avatar.set_pos(initial_position)\n\nfunc attach():\n self.bag.processing.register(self)\n self.newspaper.hide()\n self.hud.show()\n self.fuel_gauge.show()\n self.score = 0\n .attach()\n\nfunc detach():\n self.bag.processing.remove(self)\n self.hud.hide()\n self.fuel_gauge.hide()\n .detach()\n\nfunc bind_keyboard():\n var keyboard = self.bag.input.schemes['game']['keyboard']\n self.keyboard_use = true\n for handler in self.keyboard_handlers:\n keyboard.register_handler(handler)\nfunc unbind_keyboard():\n if not self.keyboard_use:\n return\n\n var keyboard = self.bag.input.schemes['game']['keyboard']\n self.keyboard_use = false\n for handler in self.keyboard_handlers:\n keyboard.remove_handler(handler)\n\nfunc bind_gamepad(id):\n self.unbind_gamepad()\n self.gamepad_id = id\n var gamepad = self.bag.input.schemes['game']['pad' + str(id)]\n\n for handler in self.gamepad_handlers:\n gamepad.register_handler(handler)\n\nfunc unbind_gamepad():\n if self.gamepad_id == null:\n return\n\n var gamepad = self.bag.input.schemes['game']['pad' + str(self.gamepad_id)]\n\n for handler in self.gamepad_handlers:\n gamepad.remove_handler(handler)\n\n self.gamepad_id = null\n\nfunc reset():\n self.rocket_cooldown = false\n self.rocket_firing = false\n self.avatar.reset()\n\nfunc bind_camera(viewport):\n self.camera.set_custom_viewport(viewport)\n\nfunc bind_hud(hud, fuel_gauge):\n self.hud = hud\n self.fuel_gauge = fuel_gauge\n\nfunc bind_newspaper(newspaper):\n self.newspaper = newspaper\n\nfunc show_fail():\n self.newspaper.show()\n if self.player_id == 0:\n self.newspaper.get_node('nyt').hide()\n self.newspaper.get_node('pravda').show()\n else:\n self.newspaper.get_node('nyt').show()\n self.newspaper.get_node('pravda').hide()\n\nfunc process(delta):\n self.hud.update_sun_indicator(self.avatar.get_pos())\n self.hud.update_fuel(self.avatar.fuel)\n self.fuel_gauge.update_fuel(self.avatar.fuel)\n self.hud.update_gravity(self.avatar.current_gravity)\n self.hud.update_ship_velocity(self.avatar.current_acceleration)\n self.hud.update_score(self.score)\n\n if hud.update_sun_warning(self):\n self.swear()\n\n if self.rocket_firing and not self.rocket_cooldown:\n self.fire_rocket()\n\nfunc fire_rocket():\n if self.rocket_cooldown:\n return\n\n var rocket = self.rocket_template.instance()\n var position = self.avatar.get_pos()\n var starting_vector = Vector2(0, -1)\n starting_vector.x = ((randi() % 101) - 50) \/ 900.0\n var rocket_offset = starting_vector.rotated(self.avatar.rotation)\n var rocket_position = position + rocket_offset * 60\n\n rocket.initial_velocity = self.avatar.current_acceleration + rocket_offset * 500\n\n self.bag.board.attach_object(rocket)\n rocket.set_pos(rocket_position)\n rocket.set_rot(rocket.initial_velocity.angle() + 3.14)\n\n self.rocket_cooldown = true\n self.bag.timers.set_timeout(self.ROCKET_COOLDOWN_TIME, self, \"rocket_cooldown_done\")\n\n rocket.owner = self.player_id\n self.bag.sound.play('rocket_launch')\n\nfunc rocket_cooldown_done():\n self.rocket_cooldown = false\n\nfunc swear_cooldown_done():\n self.swear_cooldown = false\n\nfunc swear():\n if self.swear_cooldown:\n return\n\n randomize()\n var suffix\n var item\n if self.player_id == 0:\n suffix = \"ru_\"\n else:\n suffix = \"en_\"\n item = 'swear_' + suffix + str(randi() % 8 + 1)\n\n self.bag.sound.play(item)\n\n self.swear_cooldown = true\n self.bag.timers.set_timeout(self.SWEAR_COOLDOWN_TIME, self, \"swear_cooldown_done\")\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"c918feba4dcc4e0e1ad05e300846f005b8ce6bff","subject":"seeded. viewport fiddling","message":"seeded. viewport fiddling\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Puzzle.gd","new_file":"src\/scripts\/Puzzle.gd","new_contents":"# Provides functionality for the puzzle itself\n\nextends Spatial\n\nvar DataMan = preload( \"res:\/\/scripts\/DataManager.gd\" ).new()\nvar PuzzleManScript = preload( \"res:\/\/scripts\/PuzzleManager.gd\" )\nvar PuzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar puzzleMan\nvar seed\nvar otherPuzzle\nvar generateRandom = true\nvar mainPuzzle = false\n\nvar time = {\n\t\ton = true,\n\t\tval = 0.0,\n\t\tlabel = Label.new(),\n\t\ttween = Tween.new() }\n\nfunc addTimer():\n\tadd_child(time.label)\n\tadd_child(time.tween)\n\ttime.label.set_pos(Vector2(15,15))\n\n\ttime.label.set_theme(load(\"res:\/\/themes\/MainTheme.thm\"))\n\ttime.tween.interpolate_method(time.label, \"set_pos\", \\\n\t\t\ttime.label.get_pos(), time.label.get_pos()*2, 0.5, \\\n\t\t\tTween.TRANS_BOUNCE, Tween.EASE_OUT)\n\ttime.tween.start()\n\ttime.label.set_text(str(time.val))\n\nfunc formatTime(t):\n\tvar mins = floor(t \/ 60)\n\tvar secs = fmod(floor(t), 60)\n\tvar millis = floor((t - floor(t)) * 1000)\n\treturn str(mins) + \":\" + str(secs).pad_zeros(2) + \":\" + str(millis).pad_zeros(3)\n\nfunc _process(dTime):\n\t# start label tween on\n\ttime.val += dTime\n\ttime.label.set_text(formatTime(time.val))\n\tif fmod(time.val, 10) < 0.1:\n\t\ttime.tween.seek(0.0)\n\n# Called for initialization\nfunc _ready():\n\tif time.on:\n\t\tset_process(true) # needed for time keeping\n\taddTimer()\n\n\t#set up network stuffs\n\tadd_child(load(\"res:\/\/networkProxy.scn\").instance())\n\tvar Network = Globals.get(\"Network\")\n\tif Network != null:\n\t\tNetwork.proxy.set_process(Network.isClient or Network.isHost)\n\n\n\t# generate puzzle\n\tpuzzleMan = PuzzleManScript.new()\n\tvar puzzle\n\n\tif generateRandom:\n\t\tseed = OS.get_unix_time() # unix time\n\t\tseed *= OS.get_ticks_msec() # initial time\n\t\tseed *= 1 + OS.get_time().second\n\t\tseed *= 1 + OS.get_date().weekday\n\t\tseed = abs(seed) % 7919 # 1000th prime\n\n\t\trand_seed(seed)\n\n\t\tpuzzle = puzzleMan.generatePuzzle( 1, puzzleMan.DIFF_EASY )\n\t\tpuzzle.puzzleMan = puzzleMan\n\t\tvar steps = puzzle.solvePuzzleSteps()\n\t\tprint(\"Generated \", puzzle.shape.size(), \" blocks.\" )\n\t\tprint( \"PUZZLE IS SOLVEABLE?: \", steps.solveable )\n\n\t\tvar gridMan = get_node( \"GridView\/GridMan\" )\n\t\tDataMan.savePuzzle(\"test.pzl\", puzzle)\n\t\tvar pCopy = DataMan.loadPuzzle(\"test.pzl\")\n\t\tgridMan.set_puzzle(puzzle)\n\n\t\tvar network = Globals.get(\"Network\")\n\t\tif (not network == null and network.isNetwork):\n\t\t\tprint(\"Sending puzzle\")\n\n\t# make a new puzzle, embed using Viewport\n\tif mainPuzzle:\n\t\tnetwork.sendStart(puzzle)\n\n\t\tvar p = PuzzleScn.instance()\n\t\tp.get_node(\"GridView\").active = false\n\t\tp.get_node(\"GridView\/GridMan\").set_puzzle(puzzle)\n\t\tp.mainPuzzle = false\n\t\tp.set_scale(Vector3(0.5, 0.5, 0.5))\n\t\tp.set_translation(Vector3(10, 5, -20))\n\n\t\tvar v = Viewport.new()\n\t\tvar c = Control.new()\n\n\t\tv.set_world(p.get_world())\n\t\tv.set_render_target_to_screen_rect(Rect2(20,20,40,40))\n\t\tv.set_physics_object_picking(false)\n\t\tv.add_child(p)\n\t\tc.add_child(v)\n\t\tadd_child(c)\n\n\t\tp.get_node(\"GridView\").set_process_input(false)\n\n\t\totherPuzzle = p #for use with network\n\n\n","old_contents":"# Provides functionality for the puzzle itself\n\nextends Spatial\n\nvar DataMan = preload( \"res:\/\/scripts\/DataManager.gd\" ).new()\nvar PuzzleManScript = preload( \"res:\/\/scripts\/PuzzleManager.gd\" )\nvar PuzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar puzzleMan\nvar seed\nvar otherPuzzle\nvar generateRandom = true\nvar mainPuzzle = false\n\nvar time = {\n\t\ton = true,\n\t\tval = 0.0,\n\t\tlabel = Label.new(),\n\t\ttween = Tween.new() }\n\nfunc addTimer():\n\tadd_child(time.label)\n\tadd_child(time.tween)\n\ttime.label.set_pos(Vector2(15,15))\n\n\ttime.label.set_theme(load(\"res:\/\/themes\/MainTheme.thm\"))\n\ttime.tween.interpolate_method(time.label, \"set_pos\", \\\n\t\t\ttime.label.get_pos(), time.label.get_pos()*2, 0.5, \\\n\t\t\tTween.TRANS_BOUNCE, Tween.EASE_OUT)\n\ttime.tween.start()\n\ttime.label.set_text(str(time.val))\n\nfunc formatTime(t):\n\tvar mins = floor(t \/ 60)\n\tvar secs = fmod(floor(t), 60)\n\tvar millis = floor((t - floor(t)) * 1000)\n\treturn str(mins) + \":\" + str(secs).pad_zeros(2) + \":\" + str(millis).pad_zeros(3)\n\nfunc _process(dTime):\n\t# start label tween on\n\ttime.val += dTime\n\ttime.label.set_text(formatTime(time.val))\n\tif fmod(time.val, 10) < 0.1:\n\t\ttime.tween.seek(0.0)\n\n# Called for initialization\nfunc _ready():\n\tif time.on:\n\t\tset_process(true) # needed for time keeping\n\taddTimer()\n\n\t#set up network stuffs\n\tadd_child(load(\"res:\/\/networkProxy.scn\").instance())\n\tvar Network = Globals.get(\"Network\")\n\tif Network != null:\n\t\tNetwork.proxy.set_process(Network.isClient or Network.isHost)\n\n\n\t# generate puzzle\n\tpuzzleMan = PuzzleManScript.new()\n\n\tif generateRandom:\n\t\tseed = OS.get_unix_time() # unix time\n\t\tseed *= OS.get_ticks_msec() # initial time\n\t\tseed *= 1 + OS.get_time().second\n\t\tseed *= 1 + OS.get_date().weekday\n\t\tseed = abs(seed) % 7919 # 1000th prime\n\n\t\tvar puzzle = puzzleMan.generatePuzzle( 1, puzzleMan.DIFF_EASY )\n\t\tpuzzle.puzzleMan = puzzleMan\n\t\tvar steps = puzzle.solvePuzzleSteps()\n\t\tprint(\"Generated \", puzzle.shape.size(), \" blocks.\" )\n\t\tprint( \"PUZZLE IS SOLVEABLE?: \", steps.solveable )\n\n\t\tvar gridMan = get_node( \"GridView\/GridMan\" )\n\t\tDataMan.savePuzzle(\"test.pzl\", puzzle)\n\t\tvar pCopy = DataMan.loadPuzzle(\"test.pzl\")\n\t\tgridMan.set_puzzle(puzzle)\n\n\t# make a new puzzle, embed using Viewport\n\tif mainPuzzle:\n\t\tvar p = PuzzleScn.instance()\n\t\tp.get_node(\"GridView\").active = false\n\t\tp.mainPuzzle = false\n\t\tp.set_scale(Vector3(0.5, 0.5, 0.5))\n\t\tp.set_translation(Vector3(10, 5, -20))\n\n\t\tvar v = Viewport.new()\n\t\tvar c = Control.new()\n\n\t\tv.set_world(p.get_world())\n\t\tv.set_rect(Rect2(0, 0, 100, 100))\n\t\tv.set_physics_object_picking(false)\n\t\tadd_child(p)\n\t\tv.add_child(p)\n\t\tadd_child(c)\n\t\tc.add_child(v)\n\t\totherPuzzle = p #for use with network\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"ca6a00e0789fb6fefd2c94d34a792595db1c3250","subject":"Enemies 'attacking'","message":"Enemies 'attacking'\n","repos":"P1X-in\/rat-is-fat","old_file":"scripts\/enemies\/abstract_enemy.gd","new_file":"scripts\/enemies\/abstract_enemy.gd","new_contents":"extends \"res:\/\/scripts\/moving_object.gd\"\n\nvar destination = [0, 0]\nvar target = null\nvar aggro_range = 200\nvar attack_range = 50\nvar id = 0\n\nfunc _init(bag).(bag):\n self.initial_position = Vector2(200, 200)\n self.velocity = 2\n\nfunc go_to(x, y):\n self.destination[0] = x\n self.destination[1] = y\n\nfunc process_ai():\n var distance\n var direction = Vector2(0, 0)\n\n if self.target == null:\n for player in self.bag.players.players:\n if player.is_playing && player.is_alive:\n distance = self.calculate_distance_to_object(player)\n if distance < self.aggro_range:\n if self.target != null:\n if self.calculate_distance_to_object(self.target) > distance:\n self.target = player\n else:\n self.target = player\n if self.target == null:\n distance = self.calculate_distance(self.initial_position)\n if distance > 10:\n direction = self.cast_movement_vector(self.initial_position)\n else:\n distance = self.calculate_distance_to_object(self.target)\n if not self.target.is_alive || distance > self.aggro_range:\n self.target = null\n elif distance > self.attack_range:\n direction = self.cast_movement_vector(self.target.get_pos())\n else:\n self.attack()\n self.movement_vector[0] = direction.x\n self.movement_vector[1] = direction.y\n\nfunc cast_movement_vector(destination_point):\n var my_position = self.get_pos()\n var distance = self.calculate_distance(destination_point)\n var scale = 1.0 \/ distance\n var delta_x = (destination_point.x - my_position.x) * scale\n var delta_y = (destination_point.y - my_position.y) * scale\n\n return Vector2(delta_x, delta_y)\n\nfunc process(delta):\n self.reset_movement()\n self.process_ai()\n self.modify_position()\n\nfunc attack():\n print('ENEMY IS ATTACKING!!')\n\nfunc die():\n self.is_processing = false\n self.bag.enemies.del_enemy(self)\n self.despawn()\n\n","old_contents":"extends \"res:\/\/scripts\/moving_object.gd\"\n\nvar destination = [0, 0]\nvar target = null\nvar aggro_range = 200\nvar attack_range = 50\nvar id = 0\n\nfunc _init(bag).(bag):\n self.initial_position = Vector2(200, 200)\n self.velocity = 2\n\nfunc go_to(x, y):\n self.destination[0] = x\n self.destination[1] = y\n\nfunc process_ai():\n var distance\n var direction = Vector2(0, 0)\n\n if self.target == null:\n for player in self.bag.players.players:\n if player.is_playing && player.is_alive:\n distance = self.calculate_distance_to_object(player)\n if distance < self.aggro_range:\n if self.target != null:\n if self.calculate_distance_to_object(self.target) > distance:\n self.target = player\n else:\n self.target = player\n if self.target == null:\n distance = self.calculate_distance(self.initial_position)\n if distance > 10:\n direction = self.cast_movement_vector(self.initial_position)\n else:\n distance = self.calculate_distance_to_object(self.target)\n if not self.target.is_alive || distance > self.aggro_range:\n self.target = null\n elif distance > self.attack_range:\n direction = self.cast_movement_vector(self.target.get_pos())\n self.movement_vector[0] = direction.x\n self.movement_vector[1] = direction.y\n\nfunc cast_movement_vector(destination_point):\n var my_position = self.get_pos()\n var distance = self.calculate_distance(destination_point)\n var scale = 1.0 \/ distance\n var delta_x = (destination_point.x - my_position.x) * scale\n var delta_y = (destination_point.y - my_position.y) * scale\n\n return Vector2(delta_x, delta_y)\n\nfunc process(delta):\n self.reset_movement()\n self.process_ai()\n self.modify_position()\n\nfunc attack():\n print('ENEMY IS ATTACKING!!')\n\nfunc die():\n self.is_processing = false\n self.bag.enemies.del_enemy(self)\n self.despawn()\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"bd6c90313288fe102e8089f32cf6d0a6099c0c9c","subject":"cleaned NameGen choice array","message":"cleaned NameGen choice array\n","repos":"YeOldeDM\/we-under-skies","old_file":"space-wizard\/generators\/NameGen.gd","new_file":"space-wizard\/generators\/NameGen.gd","new_contents":"\nextends Node\n\nvar choices = []\n\nfunc _rand(m=1,M=10):\n\treturn int(round(rand_range(m,M)))\n\n\nfunc _get_choice():\n\tvar R = _rand(0,choices.size()-1)\n\treturn choices[R]\n\nfunc _get_slice(name, from_right=false):\n\tvar len = name.length()\n\tvar slice_point = len\/2\n\tif len > 4:\n\t\tslice_point = _rand(len\/3,len\/2)\n\tif from_right:\n\t\treturn name.right(slice_point)\n\telse:\n\t\treturn name.left(slice_point)\n\t\t\n\nfunc MakeName():\n\tvar names = _rand(1,4)\n\tif names > 2:\n\t\tnames -= _rand(1,2)\n\tvar name = \"\"\n\tfor i in range(names):\n\t\tname += _get_name()\n\t\tif i != names:\n\t\t\tname += \" \"\n\n\tvar N = \"\"\n\tif randf() < 0.3:\n\t\tN = str(_rand(1,100))+\" \"\n\t\n\treturn N+name\n\nfunc _get_name():\n\tvar N1 = _rand(0,choices.size()-1)\n\tvar N2 = null\n\tvar go = false\n\twhile !go:\n\t\tvar N2try = _rand(0,choices.size()-1)\n\t\tif N2try != N1:\n\t\t\tN2 = N2try\n\t\t\tgo = true\n\t\n\t\n\tvar name1 = choices[N1]\n\tvar name2 = choices[N2]\n\t\n\tname1 = _get_slice(_get_choice())\n\t\n\tname2 = _get_slice(_get_choice(),true)\n\t\n\n\treturn (name1+name2).capitalize()\n\n\n","old_contents":"\nextends Node\n\nvar choices = [\n\t'alpha',\n\t'beta',\n\t'gamma',\n\t'sigma',\n\t'omega',\n\t'orion',\n\t'polaris',\n\t'sol',\n\t'centauri',\n\t'gemini',\n\t'atlas',\n\t'cancer',\n\t'betelgeuse',\n\t'sagitauri',\n\t'palieades',\n\t'altair',\n\t'kappa',\n\t'bootes'\n\t]\n\nfunc _rand(m=1,M=10):\n\treturn int(round(rand_range(m,M)))\n\n\nfunc _get_choice():\n\tvar R = _rand(0,choices.size()-1)\n\treturn choices[R]\n\nfunc _get_slice(name, from_right=false):\n\tvar len = name.length()\n\tvar slice_point = len\/2\n\tif len > 4:\n\t\tslice_point = _rand(len\/3,len\/2)\n\tif from_right:\n\t\treturn name.right(slice_point)\n\telse:\n\t\treturn name.left(slice_point)\n\t\t\n\nfunc MakeName():\n\tvar names = _rand(1,4)\n\tif names > 2:\n\t\tnames -= _rand(1,2)\n\tvar name = \"\"\n\tfor i in range(names):\n\t\tname += _get_name()\n\t\tif i != names:\n\t\t\tname += \" \"\n\n\tvar N = \"\"\n\tif randf() < 0.3:\n\t\tN = str(_rand(1,100))+\" \"\n\t\n\treturn N+name\n\nfunc _get_name():\n\tvar N1 = _rand(0,choices.size()-1)\n\tvar N2 = null\n\tvar go = false\n\twhile !go:\n\t\tvar N2try = _rand(0,choices.size()-1)\n\t\tif N2try != N1:\n\t\t\tN2 = N2try\n\t\t\tgo = true\n\t\n\t\n\tvar name1 = choices[N1]\n\tvar name2 = choices[N2]\n\t\n\tname1 = _get_slice(_get_choice())\n\t\n\tname2 = _get_slice(_get_choice(),true)\n\t\n\n\treturn (name1+name2).capitalize()\n\n\n","returncode":0,"stderr":"","license":"cc0-1.0","lang":"GDScript"} {"commit":"dc5f2489f84b1a70f3879b7c78ef96ba4531bbfb","subject":"add neighbor. aware of the editor, if it exists. keeps original int name","message":"add neighbor. aware of the editor, if it exists. keeps original int name\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Blocks\/AbstractBlock.gd","new_file":"src\/scripts\/Blocks\/AbstractBlock.gd","new_contents":"\nextends RigidBody\n\nvar name_int\nvar name\nvar pairName\nvar selected = false\nvar blockPos\nvar blockLayer\nvar blockType\nconst far_away_corner = Vector3(110, 110, 110)\n\nvar editor\n\nstatic func nameToNodeName(n):\n\treturn \"block\" + str(n)\n\nfunc setName(n):\n\tname_int = n\n\tname = nameToNodeName(n)\n\tset_name(nameToNodeName(n))\n\treturn self\n\nfunc setPairName(n):\n\tpairName = nameToNodeName(n)\n\treturn self\n\nfunc setBlockLayer(n):\n\tblockLayer = n\n\treturn self\n\nfunc getBlockLayer():\n\treturn blockLayer\n\nfunc setBlockType( blockT ):\n\tblockType = blockT\n\treturn self\n\nfunc getBlockType():\n\treturn blockType\n\nfunc setSelected(sel):\n\tselected = sel\n\treturn self\n\nfunc forceClick():\n\tactivate()\n\tget_parent().clickBlock( name )\n\nfunc addNeighbor(editor, click_normal):\n\tvar t = get_parent().get_parent().get_transform().inverse()\n\tvar b = editor.newPickledBlock().setBlockPos(blockPos + t * click_normal)\n\tget_parent().add_block(b.toNode())\n\n\n# catch clicks\/taps\nfunc _input_event( camera, ev, click_pos, click_normal, shape_idx ):\n\tif ((ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT)\n\tor (ev.type==InputEvent.SCREEN_TOUCH)):\n\t\tif (get_parent().get_parent().active and ev.is_pressed()):\n\t\t\tif editor != null and editor.shouldAddNeighbor():\n\t\t\t\taddNeighbor(editor, click_normal)\n\t\t\telse:\n\t\t\t\tforceClick()\n\n# returns this block's pairNode or null\nfunc pairActivate():\n\tselected = true\n\n\t# is my pair Nil?\n\tif pairName == null or get_parent() == null or not get_parent().has_node(pairName):\n\t\tscaleTweenNode(0.9, 0.2, Tween.TRANS_EXPO).start()\n\t\treturn null\n\n\t# get my pair node\n\tvar pairNode = get_parent().get_node(pairName)\n\n\t# enlarge if the other guy's unselected\n\tif not pairNode.selected:\n\t\tscaleTweenNode(1.1, 0.2, Tween.TRANS_EXPO).start()\n\treturn pairNode\n\n\n# returns a tween node that uniformly changes the object's scale\n# call start() on the returned object\nfunc scaleTweenNode(scale, time=1, transType=Tween.TRANS_BOUNCE):\n\tvar tweenNode = newTweenNode()\n\ttweenNode.interpolate_method( self, \"set_scale\", \\\n\t\tself.get_scale(), Vector3(scale, scale, scale), \\\n\t\ttime, transType, Tween.EASE_OUT )\n\n\treturn tweenNode\n\n# adds a tween transition node to the tree\nfunc newTweenNode():\n\tvar tween = Tween.new()\n\tadd_child(tween)\n\treturn tween\n\nfunc remove_with_pop(node, key):\n\tget_parent().samplePlayer.play(\"deraj_pop_sound\")\n\tget_parent().remove_block(self)\n\nfunc _ready():\n\teditor = get_tree().get_root().get_node(\"Editor\")\n\tset_ray_pickable(true)\n","old_contents":"extends RigidBody\n\nvar name\nvar pairName\nvar selected = false\nvar blockPos\nvar blockLayer\nvar blockType\nconst far_away_corner = Vector3(80, 80, 80)\n\nstatic func nameToNodeName(n):\n\treturn \"block\" + str(n)\n\nfunc setName(n):\n\tname = nameToNodeName(n)\n\tset_name(nameToNodeName(n))\n\treturn self\n\nfunc setPairName(n):\n\tpairName = nameToNodeName(n)\n\treturn self\n\nfunc setBlockLayer(n):\n\tblockLayer = n\n\treturn self\n\nfunc getBlockLayer():\n\treturn blockLayer\n\t\nfunc setBlockType( blockT ):\n\tblockType = blockT\n\treturn self\n\t\nfunc getBlockType():\n\treturn blockType\n\nfunc setSelected(sel):\n\tselected = sel\n\treturn self\n\nfunc forceClick():\n\tactivate()\n\tget_parent().clickBlock( name )\n\n# catch clicks\/taps\nfunc _input_event( camera, ev, click_pos, click_normal, shape_idx ):\n\tif ((ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT)\n\tor (ev.type==InputEvent.SCREEN_TOUCH)):\n\t\tif (get_parent().get_parent().active and ev.is_pressed()):\n\t\t\tforceClick()\n\n# returns this block's pairNode or null\nfunc pairActivate():\n\tselected = true\n\n\t# is my pair Nil?\n\tif pairName == null or get_parent() == null or not get_parent().has_node(str(pairName)):\n\t\tscaleTweenNode(0.9, 0.2, Tween.TRANS_EXPO).start()\n\t\treturn null\n\n\t# get my pair node\n\tvar pairNode = get_parent().get_node(pairName)\n\n\t# enlarge if the other guy's unselected\n\tif not pairNode.selected:\n\t\tscaleTweenNode(1.1, 0.2, Tween.TRANS_EXPO).start()\n\treturn pairNode\n\n\n# returns a tween node that uniformly changes the object's scale\n# call start() on the returned object\nfunc scaleTweenNode(scale, time=1, transType=Tween.TRANS_BOUNCE):\n\tvar tweenNode = newTweenNode()\n\ttweenNode.interpolate_method( self, \"set_scale\", \\\n\t\tself.get_scale(), Vector3(scale, scale, scale), \\\n\t\ttime, transType, Tween.EASE_OUT )\n\n\treturn tweenNode\n\n# adds a tween transition node to the tree\nfunc newTweenNode():\n\tvar tween = Tween.new()\n\tadd_child(tween)\n\treturn tween\n\nfunc remove_with_pop(node, key):\n\tget_parent().samplePlayer.play(\"deraj_pop_sound\")\n\tget_parent().remove_block(self)\n\nfunc _ready():\n\tset_ray_pickable(true)\n\t#var img;\n\t#img.load(\"res:\/\/textures\/Block_\" + textureName + \".png\")\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"acf0d6e150d88d1a4c073083ea43b17ff696c328","subject":"lasers cannot be removed by editor. animation on removal.","message":"lasers cannot be removed by editor. animation on removal.\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Blocks\/AbstractBlock.gd","new_file":"src\/scripts\/Blocks\/AbstractBlock.gd","new_contents":"\nextends RigidBody\n\nvar name_int\nvar name\nvar pairName\nvar selected = false\nvar blockPos\nvar blockLayer\nvar blockType\nconst far_away_corner = Vector3(110, 110, 110)\n\nvar editor\n\nstatic func nameToNodeName(n):\n\treturn \"block\" + str(n)\n\nfunc setName(n):\n\tname_int = n\n\tname = nameToNodeName(n)\n\tset_name(nameToNodeName(n))\n\treturn self\n\nfunc setPairName(n):\n\tpairName = nameToNodeName(n)\n\treturn self\n\nfunc setBlockLayer(n):\n\tblockLayer = n\n\treturn self\n\nfunc getBlockLayer():\n\treturn blockLayer\n\nfunc setBlockType( blockT ):\n\tblockType = blockT\n\treturn self\n\nfunc getBlockType():\n\treturn blockType\n\nfunc setSelected(sel):\n\tselected = sel\n\treturn self\n\nfunc forceClick(click_normal):\n\tif editor != null:\n\t\tif editor.shouldAddNeighbor():\n\t\t\taddNeighbor(editor, click_normal)\n\t\t\treturn\n\t\tif editor.shouldReplaceSelf() or editor.shouldRemoveSelf():\n\t\t\t# lasers cannot be removed by the editor\n\t\t\tif blockType == get_parent().get_parent().get_parent().puzzleMan.BLOCK_LASER:\n\t\t\t\treturn\n\n\t\t\t# maybe replace self\n\t\t\tif editor.shouldReplaceSelf():\n\t\t\t\taddNeighbor(editor, 0 * click_normal)\n\t\t\tif pairName != null:\n\t\t\t\tvar pair = get_parent().get_node(pairName)\n\t\t\t\tif pair != null:\n\t\t\t\t\tpair.request_remove()\n\t\t\trequest_remove()\n\t\t\treturn\n\telse:\n\t\tactivate()\n\t\tget_parent().clickBlock( name )\n\nfunc addNeighbor(editor, click_normal):\n\tvar t = get_parent().get_parent().get_transform().inverse()\n\teditor.addBlock(blockPos + t * click_normal)\n\n\n# catch clicks\/taps\nfunc _input_event( camera, ev, click_pos, click_normal, shape_idx ):\n\tif ((ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT)\n\tor (ev.type==InputEvent.SCREEN_TOUCH)):\n\t\tif (get_parent().get_parent().active and ev.is_pressed()):\n\t\t\tforceClick(click_normal)\n\n# returns this block's pairNode or null\nfunc pairActivate():\n\tselected = true\n\n\t# is my pair Nil?\n\tif pairName == null or get_parent() == null or not get_parent().has_node(pairName):\n\t\tscaleTweenNode(0.9, 0.2, Tween.TRANS_EXPO).start()\n\t\treturn null\n\n\t# get my pair node\n\tvar pairNode = get_parent().get_node(pairName)\n\n\t# enlarge if the other guy's unselected\n\tif not pairNode.selected:\n\t\tscaleTweenNode(1.1, 0.2, Tween.TRANS_EXPO).start()\n\treturn pairNode\n\n\n# returns a tween node that uniformly changes the object's scale\n# call start() on the returned object\nfunc scaleTweenNode(scale, time=1, transType=Tween.TRANS_BOUNCE):\n\tvar tweenNode = newTweenNode()\n\ttweenNode.interpolate_method( self, \"set_scale\", \\\n\t\tself.get_scale(), Vector3(scale, scale, scale), \\\n\t\ttime, transType, Tween.EASE_OUT )\n\n\treturn tweenNode\n\n# adds a tween transition node to the tree\nfunc newTweenNode():\n\tvar tween = Tween.new()\n\tadd_child(tween)\n\treturn tween\n\nfunc request_remove(node=null, key=null):\n\tvar n = scaleTweenNode(0.001, 0.25, Tween.TRANS_QUART)\n\tn.start()\n\tn.connect(\"tween_complete\", get_parent(), \"remove_block\", [self])\n\nfunc _ready():\n\tif get_tree().get_root().has_node(\"EditorSpatial\"):\n\t\teditor = get_tree().get_root().get_node(\"EditorSpatial\")\n\tset_ray_pickable(true)\n","old_contents":"\nextends RigidBody\n\nvar name_int\nvar name\nvar pairName\nvar selected = false\nvar blockPos\nvar blockLayer\nvar blockType\nconst far_away_corner = Vector3(110, 110, 110)\n\nvar editor\n\nstatic func nameToNodeName(n):\n\treturn \"block\" + str(n)\n\nfunc setName(n):\n\tname_int = n\n\tname = nameToNodeName(n)\n\tset_name(nameToNodeName(n))\n\treturn self\n\nfunc setPairName(n):\n\tpairName = nameToNodeName(n)\n\treturn self\n\nfunc setBlockLayer(n):\n\tblockLayer = n\n\treturn self\n\nfunc getBlockLayer():\n\treturn blockLayer\n\nfunc setBlockType( blockT ):\n\tblockType = blockT\n\treturn self\n\nfunc getBlockType():\n\treturn blockType\n\nfunc setSelected(sel):\n\tselected = sel\n\treturn self\n\nfunc forceClick(click_normal):\n\tif editor != null:\n\t\tif editor.shouldAddNeighbor():\n\t\t\taddNeighbor(editor, click_normal)\n\t\t\treturn\n\t\tif editor.shouldReplaceSelf():\n\t\t\taddNeighbor(editor, 0 * click_normal)\n\t\tif editor.shouldReplaceSelf() or editor.shouldRemoveSelf():\n\t\t\tif pairName != null:\n\t\t\t\tvar pair = get_parent().get_node(pairName)\n\t\t\t\tif pair != null:\n\t\t\t\t\tpair.request_remove()\n\t\t\trequest_remove()\n\t\t\treturn\n\telse:\n\t\tactivate()\n\t\tget_parent().clickBlock( name )\n\nfunc addNeighbor(editor, click_normal):\n\tvar t = get_parent().get_parent().get_transform().inverse()\n\teditor.addBlock(blockPos + t * click_normal)\n\n\n# catch clicks\/taps\nfunc _input_event( camera, ev, click_pos, click_normal, shape_idx ):\n\tif ((ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT)\n\tor (ev.type==InputEvent.SCREEN_TOUCH)):\n\t\tif (get_parent().get_parent().active and ev.is_pressed()):\n\t\t\tforceClick(click_normal)\n\n# returns this block's pairNode or null\nfunc pairActivate():\n\tselected = true\n\n\t# is my pair Nil?\n\tif pairName == null or get_parent() == null or not get_parent().has_node(pairName):\n\t\tscaleTweenNode(0.9, 0.2, Tween.TRANS_EXPO).start()\n\t\treturn null\n\n\t# get my pair node\n\tvar pairNode = get_parent().get_node(pairName)\n\n\t# enlarge if the other guy's unselected\n\tif not pairNode.selected:\n\t\tscaleTweenNode(1.1, 0.2, Tween.TRANS_EXPO).start()\n\treturn pairNode\n\n\n# returns a tween node that uniformly changes the object's scale\n# call start() on the returned object\nfunc scaleTweenNode(scale, time=1, transType=Tween.TRANS_BOUNCE):\n\tvar tweenNode = newTweenNode()\n\ttweenNode.interpolate_method( self, \"set_scale\", \\\n\t\tself.get_scale(), Vector3(scale, scale, scale), \\\n\t\ttime, transType, Tween.EASE_OUT )\n\n\treturn tweenNode\n\n# adds a tween transition node to the tree\nfunc newTweenNode():\n\tvar tween = Tween.new()\n\tadd_child(tween)\n\treturn tween\n\nfunc request_remove(node=null, key=null):\n\tget_parent().remove_block(self)\n\nfunc _ready():\n\tif get_tree().get_root().has_node(\"EditorSpatial\"):\n\t\teditor = get_tree().get_root().get_node(\"EditorSpatial\")\n\tset_ray_pickable(true)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"58d7ea68236632bcb8ace53bf560f76d8439aa66","subject":"Fix bug can collect coin when game is over..","message":"Fix bug can collect coin when game is over..\n","repos":"khairul169\/two-taps-racer","old_file":"scripts\/game.gd","new_file":"scripts\/game.gd","new_contents":"extends Node\n\nonready var lblScore = get_node(\"gui\/score\");\nonready var lblScore2 = get_node(\"gui\/score2\");\nonready var lblCoins = get_node(\"gui\/coins\");\n\nonready var camera = get_node(\"world\/cam_base\");\nonready var level = get_node(\"world\/level\");\n\nonready var vehicle = load(\"res:\/\/scenes\/vehicle.tscn\");\nonready var vehicle_node = get_node(\"world\/vehicle\");\n\nonready var vehicle_ai = load(\"res:\/\/scenes\/vehicle_ai.tscn\");\nonready var vehicle_aiNode = get_node(\"world\/vehicle_ai\");\n\nonready var item_coin = load(\"res:\/\/scenes\/items\/coin.tscn\");\nonready var items_node = get_node(\"world\/items\");\n\nvar curPos = Vector3();\nvar curSpeed = 0.0;\nvar vehiclePos = [0, 0];\nvar curRunLength = 0.0;\nvar curCoins = 0;\n\nvar viewportSize = Vector2();\n\nvar gameTime = 0.0;\nvar gameStarted = false;\nvar gameOver = false;\nvar nextSpawnAI = 0.0;\nvar nextSpawnItems = 0.0;\nvar vehicles = [null, null];\n\nfunc _init():\n\t# Randomize random seed\n\trandomize();\n\nfunc _ready():\n\tglobals.handle_quitRequest(self, \"goto_mainmenu\");\n\t\n\tinit_game();\n\tstart_game();\n\t\n\tset_process(true);\n\tset_process_input(true);\n\tset_fixed_process(true);\n\nfunc goto_mainmenu():\n\ttransition.change_scene(transition.menu_scene);\n\nfunc init_game():\n\tcurPos = Vector3();\n\tcurSpeed = 14.0;\n\tvehiclePos = [0, 0];\n\tcurRunLength = 0.0;\n\tcurCoins = 0;\n\t\n\tviewportSize = get_viewport().get_rect().size;\n\t\n\tgameTime = 0.0;\n\tgameStarted = false;\n\tgameOver = false;\n\tnextSpawnAI = 0.0;\n\tnextSpawnItems = 0.0;\n\t\n\tspawn_vehicle();\n\t\n\tvehicles[0].gameMain = self;\n\tvehicles[1].gameMain = self;\n\t\n\tget_node(\"gui\/startGame\").show();\n\tget_node(\"gui\/gameOver\").hide();\n\t\n\tget_node(\"gui\/startGame\/btnPlay\").connect(\"pressed\", self, \"start_game\");\n\tget_node(\"gui\/gameOver\/btnPlay\").connect(\"pressed\", self, \"restart_game\");\n\tget_node(\"gui\/gameOver\/btnReturn\").connect(\"pressed\", self, \"goto_menu\");\n\t\n\tlevel.build_level(2);\n\nfunc _input(ie):\n\tif (!gameStarted || gameOver):\n\t\treturn;\n\t\n\tif (ie.type == InputEvent.KEY):\n\t\tif (Input.is_action_just_pressed(\"ui_left\")):\n\t\t\tvehiclePos[0] = !vehiclePos[0];\n\t\tif (Input.is_action_just_pressed(\"ui_right\")):\n\t\t\tvehiclePos[1] = !vehiclePos[1];\n\t\n\tif (ie.type == InputEvent.SCREEN_TOUCH && ie.pressed):\n\t\tif (ie.x < viewportSize.width\/2):\n\t\t\tvehiclePos[0] = !vehiclePos[0];\n\t\tif (ie.x > viewportSize.width\/2):\n\t\t\tvehiclePos[1] = !vehiclePos[1];\n\nfunc _process(delta):\n\tif (gameStarted):\n\t\tgameTime += delta;\n\t\n\tlblScore.set_text(str(curRunLength).pad_decimals(2) + \" Km\");\n\tlblScore2.set_text(\"Best: \" + str(globals.bestRun).pad_decimals(2) + \" Km\");\n\tlblCoins.set_text(str(curCoins).pad_zeros(5));\n\nfunc _fixed_process(delta):\n\tif (gameStarted && !gameOver):\n\t\tcurSpeed = min(curSpeed+0.8*delta, 24.0);\n\telse:\n\t\tcurSpeed = 14.0;\n\t\n\tcurPos.z -= curSpeed*delta;\n\t\n\tif (gameStarted && !gameOver):\n\t\tcurRunLength += curSpeed*delta*0.001;\n\t\n\tcamera.set_translation(camera.get_translation().linear_interpolate(curPos, 10*delta));\n\t\n\tlevel.curPos = curPos;\n\tlevel.update_level();\n\t\n\tvehicles[0].targetPos = curPos;\n\tvehicles[0].targetPos.x = -2.0-(2.5*vehiclePos[0]);\n\t\n\tvehicles[1].targetPos = curPos;\n\tvehicles[1].targetPos.x = 2.0+(2.5*vehiclePos[1]);\n\t\n\tspawn_ai();\n\tspawn_items();\n\nfunc spawn_vehicle():\n\tvar spawnPos = Vector3(-2.0, 0, 0);\n\tvehicles[0] = vehicle.instance();\n\tvehicles[0].add_to_group(\"vehicle\");\n\tvehicles[0].set_name(\"vehicle1\");\n\tvehicles[0].change_color(globals.vehicleColor[0]);\n\tvehicles[0].set_translation(spawnPos);\n\tvehicle_node.add_child(vehicles[0]);\n\t\n\tspawnPos = Vector3(2.0, 0, 0);\n\tvehicles[1] = vehicle.instance();\n\tvehicles[1].add_to_group(\"vehicle\");\n\tvehicles[1].set_name(\"vehicle2\");\n\tvehicles[1].change_color(globals.vehicleColor[1]);\n\tvehicles[1].set_translation(spawnPos);\n\tvehicle_node.add_child(vehicles[1]);\n\nfunc spawn_ai():\n\tif (!gameStarted || gameTime < nextSpawnAI):\n\t\treturn;\n\t\n\tif (vehicle_aiNode.get_child_count() > 4):\n\t\tfor i in range(2):\n\t\t\tvehicle_aiNode.get_child(i).queue_free();\n\t\n\tvar randPos = [[-4.5, -2.0], [2.0, 4.5]];\n\t\n\tfor i in range(2):\n\t\tvar spawnPos = curPos;\n\t\tspawnPos.x = randPos[i][int(rand_range(0, randPos[i].size()))];\n\t\tspawnPos.z -= rand_range(28.0, 32.0);\n\t\t\n\t\tvar inst = vehicle_ai.instance();\n\t\tinst.set_name(\"ai\");\n\t\tvar col = globals.vehicleColorSet[rand_range(0, globals.vehicleColorSet.size())];\n\t\tinst.change_color(col);\n\t\tinst.moveSpeed = rand_range(7.0, 8.0);\n\t\tinst.set_translation(spawnPos);\n\t\tvehicle_aiNode.add_child(inst);\n\t\t\n\tif (gameTime < 15.0 || gameOver):\n\t\tnextSpawnAI = gameTime + rand_range(2.0, 3.0);\n\telif (gameTime >= 15.0 && gameTime < 30.0):\n\t\tnextSpawnAI = gameTime + rand_range(1.0, 2.0);\n\telse:\n\t\tnextSpawnAI = gameTime + rand_range(0.8, 1.5);\n\nfunc spawn_items():\n\tif (!gameStarted || gameOver || gameTime < nextSpawnItems):\n\t\treturn;\n\t\n\tif (items_node.get_child_count() > 4):\n\t\titems_node.get_child(0).queue_free();\n\t\n\tvar randPos = [-4.5, -2.0, 2.0, 4.5];\n\tvar spawnPos = curPos;\n\tspawnPos.x = randPos[int(rand_range(0, randPos.size()))];\n\tspawnPos.y += 0.5;\n\tspawnPos.z -= rand_range(25.0, 30.0);\n\t\n\tvar inst = item_coin.instance();\n\tinst.set_name(\"item\");\n\tinst.set_gamemgr(self);\n\tinst.set_translation(spawnPos);\n\titems_node.add_child(inst);\n\t\n\tnextSpawnItems = gameTime + rand_range(0.5, 1.0);\n\nfunc item_collected(item):\n\tif (!gameStarted || gameOver):\n\t\treturn;\n\t\n\tcurCoins += 1;\n\titem.queue_free();\n\nfunc restart_game():\n\t#get_tree().reload_current_scene();\n\ttransition.change_scene(transition.game_scene);\n\nfunc goto_menu():\n\ttransition.change_scene(transition.menu_scene);\n\nfunc start_game():\n\tif (gameStarted || gameOver):\n\t\treturn;\n\t\n\tgameStarted = true;\n\tgameOver = false;\n\t\n\tget_node(\"gui\/startGame\").hide();\n\nfunc end_game():\n\tif (!gameStarted || gameOver):\n\t\treturn;\n\t\n\tgameStarted = true;\n\tgameOver = true;\n\t\n\tif (curRunLength > globals.bestRun):\n\t\tglobals.bestRun = curRunLength;\n\t\n\tglobals.totalCoins += curCoins;\n\tglobals.save_game();\n\t\n\tget_node(\"gui\/gameOver\").show();\n","old_contents":"extends Node\n\nonready var lblScore = get_node(\"gui\/score\");\nonready var lblScore2 = get_node(\"gui\/score2\");\nonready var lblCoins = get_node(\"gui\/coins\");\n\nonready var camera = get_node(\"world\/cam_base\");\nonready var level = get_node(\"world\/level\");\n\nonready var vehicle = load(\"res:\/\/scenes\/vehicle.tscn\");\nonready var vehicle_node = get_node(\"world\/vehicle\");\n\nonready var vehicle_ai = load(\"res:\/\/scenes\/vehicle_ai.tscn\");\nonready var vehicle_aiNode = get_node(\"world\/vehicle_ai\");\n\nonready var item_coin = load(\"res:\/\/scenes\/items\/coin.tscn\");\nonready var items_node = get_node(\"world\/items\");\n\nvar curPos = Vector3();\nvar curSpeed = 0.0;\nvar vehiclePos = [0, 0];\nvar curRunLength = 0.0;\nvar curCoins = 0;\n\nvar viewportSize = Vector2();\n\nvar gameTime = 0.0;\nvar gameStarted = false;\nvar gameOver = false;\nvar nextSpawnAI = 0.0;\nvar nextSpawnItems = 0.0;\nvar vehicles = [null, null];\n\nfunc _init():\n\t# Randomize random seed\n\trandomize();\n\nfunc _ready():\n\tglobals.handle_quitRequest(self, \"goto_mainmenu\");\n\t\n\tinit_game();\n\tstart_game();\n\t\n\tset_process(true);\n\tset_process_input(true);\n\tset_fixed_process(true);\n\nfunc goto_mainmenu():\n\ttransition.change_scene(transition.menu_scene);\n\nfunc init_game():\n\tcurPos = Vector3();\n\tcurSpeed = 14.0;\n\tvehiclePos = [0, 0];\n\tcurRunLength = 0.0;\n\tcurCoins = 0;\n\t\n\tviewportSize = get_viewport().get_rect().size;\n\t\n\tgameTime = 0.0;\n\tgameStarted = false;\n\tgameOver = false;\n\tnextSpawnAI = 0.0;\n\tnextSpawnItems = 0.0;\n\t\n\tspawn_vehicle();\n\t\n\tvehicles[0].gameMain = self;\n\tvehicles[1].gameMain = self;\n\t\n\tget_node(\"gui\/startGame\").show();\n\tget_node(\"gui\/gameOver\").hide();\n\t\n\tget_node(\"gui\/startGame\/btnPlay\").connect(\"pressed\", self, \"start_game\");\n\tget_node(\"gui\/gameOver\/btnPlay\").connect(\"pressed\", self, \"restart_game\");\n\tget_node(\"gui\/gameOver\/btnReturn\").connect(\"pressed\", self, \"goto_menu\");\n\t\n\tlevel.build_level(2);\n\nfunc _input(ie):\n\tif (!gameStarted || gameOver):\n\t\treturn;\n\t\n\tif (ie.type == InputEvent.KEY):\n\t\tif (Input.is_action_just_pressed(\"ui_left\")):\n\t\t\tvehiclePos[0] = !vehiclePos[0];\n\t\tif (Input.is_action_just_pressed(\"ui_right\")):\n\t\t\tvehiclePos[1] = !vehiclePos[1];\n\t\n\tif (ie.type == InputEvent.SCREEN_TOUCH && ie.pressed):\n\t\tif (ie.x < viewportSize.width\/2):\n\t\t\tvehiclePos[0] = !vehiclePos[0];\n\t\tif (ie.x > viewportSize.width\/2):\n\t\t\tvehiclePos[1] = !vehiclePos[1];\n\nfunc _process(delta):\n\tif (gameStarted):\n\t\tgameTime += delta;\n\t\n\tlblScore.set_text(str(curRunLength).pad_decimals(2) + \" Km\");\n\tlblScore2.set_text(\"Best: \" + str(globals.bestRun).pad_decimals(2) + \" Km\");\n\tlblCoins.set_text(str(curCoins).pad_zeros(5));\n\nfunc _fixed_process(delta):\n\tif (gameStarted && !gameOver):\n\t\tcurSpeed = min(curSpeed+0.8*delta, 24.0);\n\telse:\n\t\tcurSpeed = 14.0;\n\t\n\tcurPos.z -= curSpeed*delta;\n\t\n\tif (gameStarted && !gameOver):\n\t\tcurRunLength += curSpeed*delta*0.001;\n\t\n\tcamera.set_translation(camera.get_translation().linear_interpolate(curPos, 10*delta));\n\t\n\tlevel.curPos = curPos;\n\tlevel.update_level();\n\t\n\tvehicles[0].targetPos = curPos;\n\tvehicles[0].targetPos.x = -2.0-(2.5*vehiclePos[0]);\n\t\n\tvehicles[1].targetPos = curPos;\n\tvehicles[1].targetPos.x = 2.0+(2.5*vehiclePos[1]);\n\t\n\tspawn_ai();\n\tspawn_items();\n\nfunc spawn_vehicle():\n\tvar spawnPos = Vector3(-2.0, 0, 0);\n\tvehicles[0] = vehicle.instance();\n\tvehicles[0].add_to_group(\"vehicle\");\n\tvehicles[0].set_name(\"vehicle1\");\n\tvehicles[0].change_color(globals.vehicleColor[0]);\n\tvehicles[0].set_translation(spawnPos);\n\tvehicle_node.add_child(vehicles[0]);\n\t\n\tspawnPos = Vector3(2.0, 0, 0);\n\tvehicles[1] = vehicle.instance();\n\tvehicles[1].add_to_group(\"vehicle\");\n\tvehicles[1].set_name(\"vehicle2\");\n\tvehicles[1].change_color(globals.vehicleColor[1]);\n\tvehicles[1].set_translation(spawnPos);\n\tvehicle_node.add_child(vehicles[1]);\n\nfunc spawn_ai():\n\tif (!gameStarted || gameTime < nextSpawnAI):\n\t\treturn;\n\t\n\tif (vehicle_aiNode.get_child_count() > 4):\n\t\tfor i in range(2):\n\t\t\tvehicle_aiNode.get_child(i).queue_free();\n\t\n\tvar randPos = [[-4.5, -2.0], [2.0, 4.5]];\n\t\n\tfor i in range(2):\n\t\tvar spawnPos = curPos;\n\t\tspawnPos.x = randPos[i][int(rand_range(0, randPos[i].size()))];\n\t\tspawnPos.z -= rand_range(28.0, 32.0);\n\t\t\n\t\tvar inst = vehicle_ai.instance();\n\t\tinst.set_name(\"ai\");\n\t\tvar col = globals.vehicleColorSet[rand_range(0, globals.vehicleColorSet.size())];\n\t\tinst.change_color(col);\n\t\tinst.moveSpeed = rand_range(7.0, 8.0);\n\t\tinst.set_translation(spawnPos);\n\t\tvehicle_aiNode.add_child(inst);\n\t\t\n\tif (gameTime < 15.0 || gameOver):\n\t\tnextSpawnAI = gameTime + rand_range(2.0, 3.0);\n\telif (gameTime >= 15.0 && gameTime < 30.0):\n\t\tnextSpawnAI = gameTime + rand_range(1.0, 2.0);\n\telse:\n\t\tnextSpawnAI = gameTime + rand_range(0.8, 1.5);\n\nfunc spawn_items():\n\tif (!gameStarted || gameOver || gameTime < nextSpawnItems):\n\t\treturn;\n\t\n\tif (items_node.get_child_count() > 4):\n\t\titems_node.get_child(0).queue_free();\n\t\n\tvar randPos = [-4.5, -2.0, 2.0, 4.5];\n\tvar spawnPos = curPos;\n\tspawnPos.x = randPos[int(rand_range(0, randPos.size()))];\n\tspawnPos.y += 0.5;\n\tspawnPos.z -= rand_range(25.0, 30.0);\n\t\n\tvar inst = item_coin.instance();\n\tinst.set_name(\"item\");\n\tinst.set_gamemgr(self);\n\tinst.set_translation(spawnPos);\n\titems_node.add_child(inst);\n\t\n\tnextSpawnItems = gameTime + rand_range(0.5, 1.0);\n\nfunc item_collected(item):\n\tcurCoins += 1;\n\titem.queue_free();\n\nfunc restart_game():\n\t#get_tree().reload_current_scene();\n\ttransition.change_scene(transition.game_scene);\n\nfunc goto_menu():\n\ttransition.change_scene(transition.menu_scene);\n\nfunc start_game():\n\tif (gameStarted || gameOver):\n\t\treturn;\n\t\n\tgameStarted = true;\n\tgameOver = false;\n\t\n\tget_node(\"gui\/startGame\").hide();\n\nfunc end_game():\n\tif (!gameStarted || gameOver):\n\t\treturn;\n\t\n\tgameStarted = true;\n\tgameOver = true;\n\t\n\tif (curRunLength > globals.bestRun):\n\t\tglobals.bestRun = curRunLength;\n\t\n\tglobals.totalCoins += curCoins;\n\tglobals.save_game();\n\t\n\tget_node(\"gui\/gameOver\").show();\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"9ac51518b2bf39a06166bf8ed84f29d5a2422cbb","subject":"added editor.scn","message":"added editor.scn\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Editor.gd","new_file":"src\/scripts\/Editor.gd","new_contents":"\nextends Spatial\n\n# member variables here, example:\n# var a=2\n# var b=\"textvar\"\n\nfunc _ready():\n\t# Initalization here\n\tpass\n\n\n","old_contents":"extends \"Node\"\n\nvar selectedPosition = Vector3(0,0,0)\n\n# receives input events... UD, LR, FB\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"9ad2a841781df01c4ce912e0c2a435b15d89de27","subject":"centralized save\/load initialization. configures puzzle before adding.","message":"centralized save\/load initialization. configures puzzle before adding.\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Editor.gd","new_file":"src\/scripts\/Editor.gd","new_contents":"extends Spatial\n\nvar puzzle\nvar puzzleMan\n\nvar gridMan\nvar prevBlock = [] # keeps track of prevous color for pairs by layer\nvar blockColors = preload(\"res:\/\/scripts\/PuzzleManager.gd\").blockColors\nvar id\n\nvar fd\nvar gui = [\n\t[\"status\", Label.new()], # plz keep me as first element, referenced as gui[0] later\n\t[\"save_pzl\", Button.new()],\n\t[\"load_pzl\", Button.new()],\n\t[\"remove_layer\", Button.new()],\n\t[\"random_layer\", Button.new()],\n\t# THESE SHOULD BE Options instead of left, label, right\n\t[\"class_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=[\"LZR\", \"WILD\", \"PAIR\", \"GOAL\"],\n\t\tvalue=\"PAIR\"\n\t}],\n\t[\"color_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=blockColors,\n\t\tvalue=\"Blue\"\n\t}],\n\t[\"action_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=[\"Add\", \"Remove\", \"Replace\"],\n\t\tvalue=\"Add\"\n\t}],\n\t[\"test_pzl\", Button.new()],\n]\nvar action_ix = gui.size() - 1 - 1\nvar color_ix = gui.size() - 1 - 2\nvar class_ix = gui.size() - 1 - 3\n\n# gross style, cannot , but clean enough\nfunc shouldAddNeighbor():\n\treturn gui[action_ix][1].value == \"Add\"\n\nfunc shouldReplaceSelf():\n\treturn gui[action_ix][1].value == \"Replace\"\n\nfunc shouldRemoveSelf():\n\treturn gui[action_ix][1].value == \"Remove\"\n\n# called in AbstractBlock to add a new block\nfunc addBlock(pos):\n\tvar curColor = gui[color_ix][1].value\n\tvar b = puzzleMan.PickledBlock.new() \\\n\t\t.setName(id) \\\n\t\t.setTextureName(curColor) \\\n\t\t.setBlockPos(pos)\n\tvar layer = puzzleMan.calcBlockLayerVec(pos)\n\tid += 1\n\n\t# expand prevblocks index\n\twhile prevBlock.size() <= layer:\n\t\tvar d = {}\n\t\tfor k in blockColors:\n\t\t\td[k] = null\n\t\tprevBlock.append(d)\n\n\tvar pb = prevBlock[layer][curColor]\n\n\tif pb != null:\n\t\tb.setPairName(pb.name)\n\t\tgridMan.get_node(pb.toNode().name).setPairName(b.name)\n\t\tprevBlock[layer][curColor] = null\n\telse:\n\t\t# TODO SUPPORT GLYPHS HERE, SET PAIRWISE GLYPH\n\t\tprevBlock[layer][curColor] = b\n\n\tgui[0][1].set_text(getPrevBlockErrors())\n\tgridMan.addPickledBlock(b)\n\treturn b\n\nfunc getPrevBlockErrors():\n\t# hahaha, so bad\n\tvar missing = \"STATUS: \"\n\t# check every layer\n\tfor l in range(prevBlock.size()):\n\t\t# check every color\n\t\tfor k in prevBlock[l].keys():\n\t\t\tvar missed = false\n\t\t\tif prevBlock[l][k] != null:\n\t\t\t\t# one message about the current layer\n\t\t\t\tif not missed:\n\t\t\t\t\tmissing += \" L\" + str(l) + \" \"\n\t\t\t\t\tmissed = true\n\t\t\t\tmissing += k.to_upper() + \" \" # bad way of constructing strings\n\tif missing == \"\":\n\t\tmissing += \"NOMINAL\"\n\treturn missing\n\nfunc changeValue(ix, togg):\n\ttogg.value = togg.values[ix]\n\nfunc _ready():\n\t# lights!\n\tget_tree().get_root().add_child(preload( \"res:\/\/puzzleView.scn\" ).instance())\n\tpuzzle = preload( \"res:\/\/puzzle.scn\" ).instance()\n\tpuzzle.mainPuzzle = false\n\n\t# hide and disable timer\n\tpuzzle.time.on = false;\n\tpuzzle.time.val = ''\n\tprint(puzzle.time)\n\n\tpuzzle.set_as_toplevel(true)\n\tget_tree().get_root().add_child(puzzle)\n\n\tgridMan = puzzle.get_node(\"GridView\/GridMan\")\n\tid = gridMan.shape.size()\n\n\tpuzzleMan = puzzle.puzzleMan\n\n\tset_process_input(true)\n\n\tvar theme = preload(\"res:\/\/themes\/MainTheme.thm\")\n\tinitLoadSaveDialog(self)\n\n\tvar y = 0\n\tfor control in gui:\n\t\ty += 45\n\t\tif control[0].rfind('_toggle') > 0:\n\t\t\tvar togg = control[1]\n\t\t\tvar e = togg.optionButt\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tadd_child(e)\n\n\t\t\t# index of items needed\n\t\t\te.connect(\"item_selected\", self, \"changeValue\", [togg])\n\t\t\tfor i in range(togg.values.size()):\n\t\t\t\te.add_item(togg.values[i], i)\n\t\t\t\t# e.add_icon_item(togg.values[i], i)\n\n\t\telse:\n\t\t\tvar e = control[1]\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tif e extends Button:\n\t\t\t\te.set_text(control[0])\n\t\t\tif control[0] == 'save_pzl' :\n\t\t\t\te.connect('pressed', self, 'showSaveDialog')\n\t\t\tif control[0] == 'load_pzl' :\n\t\t\t\te.connect('pressed', self, 'showLoadDialog')\n\t\t\tif control[0] == 'status':\n\t\t\t\tcontrol[1].set_text('STATUS: NOMINAL')\n\t\t\tadd_child(e)\n\n\nfunc puzzleSave():\n\tprint(\"SAVING TO \", fd.get_current_file() )\n\nfunc puzzleLoad():\n\tprint(\"LOADING FROM \", fd.get_current_file() )\n\nfunc showLoadDialog():\n\tshowSaveDialog(true)\n\nfunc showSaveDialog(loadInstead=false):\n\tif loadInstead:\n\t\tif fd.is_connected(\"confirmed\", self, \"puzzleSave\"):\n\t\t\tfd.disconnect(\"confirmed\", self, \"puzzleSave\")\n\t\tfd.connect(\"confirmed\", self, \"puzzleLoad\")\n\t\tfd.set_mode(FileDialog.MODE_OPEN_FILE)\n\telse:\n\t\tif fd.is_connected(\"confirmed\", self, \"puzzleLoad\"):\n\t\t\tfd.disconnect(\"confirmed\", self, \"puzzleLoad\")\n\t\tfd.connect(\"confirmed\", self, \"puzzleSave\")\n\t\tfd.set_mode(FileDialog.MODE_SAVE_FILE)\n\n\tfd.popup_centered()\n\nfunc initLoadSaveDialog(parent):\n\t# setup text in the file dialog\n\tparent.fd = load(\"res:\/\/fileDialog.scn\").instance()\n\tparent.fd.set_title(\"Select Puzzle Filename\")\n\tparent.fd.set_access(FileDialog.ACCESS_USERDATA)\n\tparent.fd.set_current_dir(\"PuzzleSaves\")\n\tparent.fd.add_filter(\"*.pzl ; Anttris Puzzle\")\n\n\t# MainTheme leaks on bottom\n\tvar dialogTheme = Theme.new()\n\tdialogTheme.copy_default_theme()\n\tparent.fd.set_theme(dialogTheme)\n\n\t# work even if game is paused\n\tparent.fd.set_pause_mode(PAUSE_MODE_PROCESS)\n\n\t# unpause if user cancels\n\tparent.fd.connect(\"popup_hide\", get_tree(), \"set_pause\", [false])\n\tparent.fd.connect(\"hide\", get_tree(), \"set_pause\", [false])\n\tparent.fd.connect(\"about_to_show\", get_tree(), \"set_pause\", [true])\n\tparent.fd.hide()\n\n\tparent.add_child(fd)\n\tfd.set_owner(parent)\n","old_contents":"extends Spatial\n\nvar puzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar puzzle\nvar puzzleMan\n\nvar gridMan\nvar prevBlock = [] # keeps track of prevous color for pairs by layer\nvar blockColors = preload(\"res:\/\/scripts\/PuzzleManager.gd\").blockColors\nvar id\n\nvar fileDialog = load(\"res:\/\/fileDialog.scn\").instance()\nvar gui = [\n\t[\"status\", Label.new()], # plz keep me as first element, referenced as gui[0] later\n\t[\"save_pzl\", Button.new()],\n\t[\"load_pzl\", Button.new()],\n\t[\"remove_layer\", Button.new()],\n\t[\"random_layer\", Button.new()],\n\t# THESE SHOULD BE Options instead of left, label, right\n\t[\"class_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=[\"LZR\", \"WILD\", \"PAIR\", \"GOAL\"],\n\t\tvalue=\"PAIR\"\n\t}],\n\t[\"color_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=blockColors,\n\t\tvalue=\"Blue\"\n\t}],\n\t[\"action_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=[\"Add\", \"Remove\", \"Replace\"],\n\t\tvalue=\"Add\"\n\t}],\n\t[\"test_pzl\", Button.new()],\n]\nvar action_ix = gui.size() - 1 - 1\nvar color_ix = gui.size() - 1 - 2\nvar class_ix = gui.size() - 1 - 3\n\n# gross style, cannot , but clean enough\nfunc shouldAddNeighbor():\n\treturn gui[action_ix][1].value == \"Add\"\n\nfunc shouldReplaceSelf():\n\treturn gui[action_ix][1].value == \"Replace\"\n\nfunc shouldRemoveSelf():\n\treturn gui[action_ix][1].value == \"Remove\"\n\n# called in AbstractBlock to add a new block\nfunc addBlock(pos):\n\tvar curColor = gui[color_ix][1].value\n\tvar b = puzzleMan.PickledBlock.new() \\\n\t\t.setName(id) \\\n\t\t.setTextureName(curColor) \\\n\t\t.setBlockPos(pos)\n\tvar layer = puzzleMan.calcBlockLayerVec(pos)\n\tid += 1\n\n\t# expand prevblocks index\n\twhile prevBlock.size() <= layer:\n\t\tvar d = {}\n\t\tfor k in blockColors:\n\t\t\td[k] = null\n\t\tprevBlock.append(d)\n\n\tvar pb = prevBlock[layer][curColor]\n\n\tif pb != null:\n\t\tb.setPairName(pb.name)\n\t\tgridMan.get_node(pb.toNode().name).setPairName(b.name)\n\t\tprevBlock[layer][curColor] = null\n\telse:\n\t\t# TODO SUPPORT GLYPHS HERE, SET PAIRWISE GLYPH\n\t\tprevBlock[layer][curColor] = b\n\n\tgui[0][1].set_text(getPrevBlockErrors())\n\tgridMan.addPickledBlock(b)\n\treturn b\n\nfunc getPrevBlockErrors():\n\t# hahaha, so bad\n\tvar missing = \"STATUS: \"\n\t# check every layer\n\tfor l in range(prevBlock.size()):\n\t\t# check every color\n\t\tfor k in prevBlock[l].keys():\n\t\t\tvar missed = false\n\t\t\tif prevBlock[l][k] != null:\n\t\t\t\t# one message about the current layer\n\t\t\t\tif not missed:\n\t\t\t\t\tmissing += \" L\" + str(l) + \" \"\n\t\t\t\t\tmissed = true\n\t\t\t\tmissing += k.to_upper() + \" \" # bad way of constructing strings\n\tif missing == \"\":\n\t\tmissing += \"NOMINAL\"\n\treturn missing\n\n\nfunc showFileDialog(loadInstead=false):\n\tif loadInstead:\n\t\tfileDialog.connect(\"confirmed\", self, \"puzzleLoad\")\n\t\tfileDialog.set_mode(FileDialog.MODE_OPEN_FILE)\n\telse:\n\t\tfileDialog.connect(\"confirmed\", self, \"puzzleSave\")\n\t\tfileDialog.set_mode(FileDialog.MODE_SAVE_FILE)\n\n\tfileDialog.popup_centered()\n\nfunc puzzleSave():\n\tprint(\"SAVING TO \", fileDialog.get_current_file() )\n\tget_tree().set_pause(false)\n\nfunc puzzleLoad():\n\tprint(\"LOADING FROM \", fileDialog.get_current_file() )\n\tget_tree().set_pause(false)\n\nfunc changeValue(ix, togg):\n\ttogg.value = togg.values[ix]\n\nfunc _ready():\n\t# lights!\n\tget_tree().get_root().add_child( preload( \"res:\/\/puzzleView.scn\" ).instance() )\n\n\tpuzzle = puzzleScn.instance()\n\tpuzzle.mainPuzzle = false\n\n\t# hide and disable timer\n\tpuzzle.time.on = false;\n\tpuzzle.time.val = ''\n\n\tpuzzle.set_as_toplevel(true)\n\n\tadd_child(puzzle)\n\n\tgridMan = puzzle.get_node(\"GridView\/GridMan\")\n\tid = gridMan.shape.size()\n\n\n\tpuzzleMan = puzzle.puzzleMan\n\n\tset_process_input(true)\n\n\tvar theme = preload(\"res:\/\/themes\/MainTheme.thm\")\n\n\n\tfileDialog.set_title(\"Select Puzzle Filename\")\n\tfileDialog.set_access(FileDialog.ACCESS_USERDATA)\n\tfileDialog.set_current_dir(\"PuzzleSaves\")\n\tfileDialog.add_filter(\"*.pzl ; Anttris Puzzle\")\n\n\t# MainTheme leaks on bottom\n\tvar dialogTheme = Theme.new()\n\tdialogTheme.copy_default_theme()\n\tfileDialog.set_theme(dialogTheme)\n\n\t# work even if game is paused\n\tfileDialog.set_pause_mode(PAUSE_MODE_PROCESS)\n\n\t# unpause if user cancels\n\tfileDialog.connect(\"popup_hide\", get_tree(), \"set_pause\", [false])\n\tfileDialog.connect(\"hide\", get_tree(), \"set_pause\", [false])\n\tfileDialog.connect(\"about_to_show\", get_tree(), \"set_pause\", [true])\n\tfileDialog.hide()\n\tadd_child(fileDialog)\n\n\tvar y = 0\n\tfor control in gui:\n\t\ty += 45\n\t\tif control[0].rfind('_toggle') > 0:\n\t\t\tvar togg = control[1]\n\t\t\tvar e = togg.optionButt\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tadd_child(e)\n\n\t\t\t# index of items needed\n\t\t\te.connect(\"item_selected\", self, \"changeValue\", [togg])\n\t\t\tfor i in range(togg.values.size()):\n\t\t\t\te.add_item(togg.values[i], i)\n\t\t\t\t# e.add_icon_item(togg.values[i], i)\n\n\t\telse:\n\t\t\tvar e = control[1]\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tif e extends Button:\n\t\t\t\te.set_text(control[0])\n\t\t\tif control[0] == 'save_pzl' :\n\t\t\t\te.connect('pressed', self, 'showFileDialog')\n\t\t\tif control[0] == 'load_pzl' :\n\t\t\t\te.connect('pressed', self, 'showFileDialog', [true])\n\t\t\tif control[0] == 'status':\n\t\t\t\tcontrol[1].set_text('STATUS: NOMINAL')\n\t\t\tadd_child(e)\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"1ef527614e62d17d2f17ad1532150a056719fed7","subject":"can choose to generate random puzzle or not","message":"can choose to generate random puzzle or not\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Puzzle.gd","new_file":"src\/scripts\/Puzzle.gd","new_contents":"# Provides functionality for the puzzle itself\n\nextends Spatial\n\nvar DataMan = preload( \"res:\/\/scripts\/DataManager.gd\" ).new()\nvar PuzzleManScript = preload( \"res:\/\/scripts\/PuzzleManager.gd\" )\nvar PuzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar puzzleMan\nvar seed\nvar otherPuzzle\nvar generateRandom = true\nvar mainPuzzle = false\n\nvar time = {\n\t\ton = true,\n\t\tval = 0.0,\n\t\tlabel = Label.new(),\n\t\ttween = Tween.new() }\n\nfunc addTimer():\n\tadd_child(time.label)\n\tadd_child(time.tween)\n\ttime.label.set_pos(Vector2(15,15))\n\n\ttime.label.set_theme(load(\"res:\/\/themes\/MainTheme.thm\"))\n\ttime.tween.interpolate_method(time.label, \"set_pos\", \\\n\t\t\ttime.label.get_pos(), time.label.get_pos()*2, 0.5, \\\n\t\t\tTween.TRANS_BOUNCE, Tween.EASE_OUT)\n\ttime.tween.start()\n\ttime.label.set_text(str(time.val))\n\nfunc formatTime(t):\n\tvar mins = floor(t \/ 60)\n\tvar secs = fmod(floor(t), 60)\n\tvar millis = floor((t - floor(t)) * 1000)\n\treturn str(mins) + \":\" + str(secs).pad_zeros(2) + \":\" + str(millis).pad_zeros(3)\n\nfunc _process(dTime):\n\t# start label tween on\n\ttime.val += dTime\n\ttime.label.set_text(formatTime(time.val))\n\tif fmod(time.val, 10) < 0.1:\n\t\ttime.tween.seek(0.0)\n\n# Called for initialization\nfunc _ready():\n\tif time.on:\n\t\tset_process(true) # needed for time keeping\n\taddTimer()\n\n\t#set up network stuffs\n\tadd_child(load(\"res:\/\/networkProxy.scn\").instance())\n\tvar Network = Globals.get(\"Network\")\n\tif Network != null:\n\t\tNetwork.proxy.set_process(Network.isClient or Network.isHost)\n\n\n\t# generate puzzle\n\tpuzzleMan = PuzzleManScript.new()\n\n\tif generateRandom:\n\t\tseed = OS.get_unix_time() # unix time\n\t\tseed *= OS.get_ticks_msec() # initial time\n\t\tseed *= 1 + OS.get_time().second\n\t\tseed *= 1 + OS.get_date().weekday\n\t\tseed = abs(seed) % 7919 # 1000th prime\n\n\t\tvar puzzle = puzzleMan.generatePuzzle( 1, puzzleMan.DIFF_EASY )\n\t\tpuzzle.puzzleMan = puzzleMan\n\t\tvar steps = puzzle.solvePuzzleSteps()\n\t\tprint(\"Generated \", puzzle.shape.size(), \" blocks.\" )\n\t\tprint( \"PUZZLE IS SOLVEABLE?: \", steps.solveable )\n\n\t\tget_node( \"GridView\/GridMan\" ).set_puzzle(puzzle)\n\n\t# make a new puzzle, embed using Viewport\n\tif mainPuzzle:\n\t\tvar p = PuzzleScn.instance()\n\t\t#p.remove_and_delete_child(p.get_node(\"Lights\"))\n\t\t#.remove_and_delete_child(p.get_node(\"Camera\"))\n\t\tp.get_node(\"GridView\").active = false\n\t\tp.mainPuzzle = false\n\t\tp.set_scale(Vector3(0.5, 0.5, 0.5))\n\t\tp.set_translation(Vector3(10, 5, -20))\n\n\t\tvar v = Viewport.new()\n\t\tvar c = Control.new()\n\n\t\tv.set_world(p.get_world())\n\t\tv.set_rect(Rect2(0, 0, 100, 100))\n\t\tv.set_physics_object_picking(false)\n\t\tget_tree().get_root().get_node( \"Spatial\" ).get_node( \"Camera\" ).add_child(p)\n\t\tv.add_child(p)\n\t\tadd_child(c)\n\t\tc.add_child(v)\n\t\totherPuzzle = p #for use with network\n# child of control? easier input\n\n\n","old_contents":"# Provides functionality for the puzzle itself\n\nextends Spatial\n\nvar DataMan = preload( \"res:\/\/scripts\/DataManager.gd\" ).new()\nvar PuzzleManScript = preload( \"res:\/\/scripts\/PuzzleManager.gd\" )\nvar PuzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar puzzleMan\nvar seed\nvar otherPuzzle\nvar generateRandom = true\nvar mainPuzzle = false\n\nvar time = {\n\t\ton = true,\n\t\tval = 0.0,\n\t\tlabel = Label.new(),\n\t\ttween = Tween.new() }\n\nfunc addTimer():\n\tadd_child(time.label)\n\tadd_child(time.tween)\n\ttime.label.set_pos(Vector2(15,15))\n\n\ttime.label.set_theme(load(\"res:\/\/themes\/MainTheme.thm\"))\n\ttime.tween.interpolate_method(time.label, \"set_pos\", \\\n\t\t\ttime.label.get_pos(), time.label.get_pos()*2, 0.5, \\\n\t\t\tTween.TRANS_BOUNCE, Tween.EASE_OUT)\n\ttime.tween.start()\n\ttime.label.set_text(str(time.val))\n\nfunc formatTime(t):\n\tvar mins = floor(t \/ 60)\n\tvar secs = fmod(floor(t), 60)\n\tvar millis = floor((t - floor(t)) * 1000)\n\treturn str(mins) + \":\" + str(secs).pad_zeros(2) + \":\" + str(millis).pad_zeros(3)\n\nfunc _process(dTime):\n\t# start label tween on\n\ttime.val += dTime\n\ttime.label.set_text(formatTime(time.val))\n\tif fmod(time.val, 10) < 0.1:\n\t\ttime.tween.seek(0.0)\n\n# Called for initialization\nfunc _ready():\n\tif time.on:\n\t\tset_process(true) # needed for time keeping\n\taddTimer()\n\n\t#set up network stuffs\n\tadd_child(load(\"res:\/\/networkProxy.scn\").instance())\n\tvar Network = Globals.get(\"Network\")\n\tif Network != null:\n\t\tNetwork.proxy.set_process(Network.isClient or Network.isHost)\n\n\n\t# generate puzzle\n\tpuzzleMan = PuzzleManScript.new()\n\tvar puzzle = puzzleMan.generatePuzzle( 1, puzzleMan.DIFF_EASY )\n\tpuzzle.puzzleMan = puzzleMan\n\n\tif generateRandom:\n\t\tseed = OS.get_unix_time() # unix time\n\t\tseed *= OS.get_ticks_msec() # initial time\n\t\tseed *= 1 + OS.get_time().second\n\t\tseed *= 1 + OS.get_date().weekday\n\t\tseed = abs(seed) % 7919 # 1000th prime\n\n\t\tprint(\"Generated \", puzzle.blocks.size(), \" blocks.\" )\n\t\tvar steps = puzzle.solvePuzzleSteps()\n\t\tprint( \"PUZZLE IS SOLVEABLE?: \", steps.solveable )\n\n\t\tget_node( \"GridView\/GridMan\" ).set_puzzle(puzzle)\n\n\t# make a new puzzle, embed using Viewport\n\tif mainPuzzle:\n\t\tvar p = PuzzleScn.instance()\n\t\t#p.remove_and_delete_child(p.get_node(\"Lights\"))\n\t\t#.remove_and_delete_child(p.get_node(\"Camera\"))\n\t\tp.get_node(\"GridView\").active = false\n\t\tp.mainPuzzle = false\n\t\tp.set_scale(Vector3(0.5, 0.5, 0.5))\n\t\tp.set_translation(Vector3(10, 5, -20))\n\n\t\tvar v = Viewport.new()\n\t\tvar c = Control.new()\n\n\t\tv.set_world(p.get_world())\n\t\tv.set_rect(Rect2(0, 0, 100, 100))\n\t\tv.set_physics_object_picking(false)\n\t\tget_tree().get_root().get_node( \"Spatial\" ).get_node( \"Camera\" ).add_child(p)\n\t\tv.add_child(p)\n\t\tadd_child(c)\n\t\tc.add_child(v)\n\t\totherPuzzle = p #for use with network\n# child of control? easier input\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"22d9269ea132c0470e322ab0e4f49567ba9a2cdb","subject":"Added a caution in the manual for GurobiFindAllSolutions when using a group","message":"Added a caution in the manual for GurobiFindAllSolutions when using a group\n","repos":"jesselansdown\/Gurobify,jesselansdown\/Gurobify","old_file":"gap\/Gurobify.gd","new_file":"gap\/Gurobify.gd","new_contents":"# Gurobify: Gurobify provides an interface to Gurobi from GAP.\n#\n# Copyright (c) 2017 Jesse Lansdown\n#\n# This Source Code Form is subject to the terms of the Mozilla\n# Public License, v. 2.0. If a copy of the MPL was not distributed\n# with this file, You can obtain one at https:\/\/mozilla.org\/MPL\/2.0\/.\n\n\n\n# Declarations\n#\n\n\nDeclareCategory( \"IsGurobiModel\", IsObject );\n\n\nGurobiObjectFamily := NewFamily( \"GurobiObjectFamily\" );\n\nBindGlobal(\"TheTypeGurobiModel\", NewType( GurobiObjectFamily, IsGurobiModel ));\n\n\nDeclareOperation( \"GurobiNewModel\",\n\t[IsList]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Deleting Constraints\n#! @Arguments Model, ConstraintName\n#! @Returns true\/false\n#! @Description\n#!\tDeletes all constraints with the name ConstraintName\nDeclareOperation(\"GurobiDeleteConstraintsWithName\",\n\t[IsGurobiModel, IsString]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Deleting Constraints\n#! @Arguments Model, ConstraintEquation, ConstraintSense, ConstraintRHSValue[, ConstraintName]\n#! @Returns true\n#! @Description\n#!\tSame as below, except that ConstraintRHS value takes an integer value.\nDeclareOperation( \"GurobiAddConstraint\",\n\t[ IsGurobiModel, IsList, IsString, IsInt, IsString]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Deleting Constraints\n#! @Arguments Model, ConstraintEquation, ConstraintSense, ConstraintRHSValue[, ConstraintName]\n#! @Returns true\n#! @Description\n#!\tAdds a constraint to a gurobi model. ConstraintEquation must be a list, \n#!\tsuch that each entry is the coefficient (including $0$ coefficents) of the corresponding variable\n#! \tin the constraint equation. The ConstraintSense must be one of \"<\", \">\" or \"=\",\n#!\twhere Gurobi interprets < as <= and > as >=. The ConstraintRHSValue is the value on the\n#!\tright hand side of the constraint. A constraint may optionally be given a name, which helps to identify\n#!\tthe constraint if it is to be deleted at some point. If no constraint name is given, then a constraint is\n#!\tsimply assigned the name \"UnNamedConstraint\".\n#!\tNote that a model must be updated or optimised before any additional constraints become effective.\nDeclareOperation( \"GurobiAddConstraint\",\n\t[ IsGurobiModel, IsList, IsString, IsFloat, IsString] );\n\nDeclareOperation( \"GurobiAddConstraint\",\n\t[ IsGurobiModel, IsList, IsString, IsFloat]);\n\nDeclareOperation( \"GurobiAddConstraint\",\n\t[ IsGurobiModel, IsList, IsString, IsInt]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Deleting Constraints\n#! @Arguments Model, ConstraintEquations, ConstraintSenses, ConstraintRHSValues[, ConstraintNames]\n#! @Returns true\n#! @Description\n#!\tAdd multiple constraints to a model at one time. The arguments (except Model)\n#!\tare lists, such that the i-th entries of each list determine a single constraint in\n#!\tthe same manner as for the operation GurobiAddConstraint. ConstraintNames is an optional argument,\n#!\tand must be given for all constraints, or not at all.\nDeclareOperation( \"GurobiAddMultipleConstraints\",\n\t[ IsGurobiModel, IsList, IsList, IsList, IsList] );\n\n#! @Chapter Using Gurobify\n#! @Section Optimising A Model\n#! @Arguments Model\n#! @Returns Solution\n#! @Description\n#!\tDisplay the solution found for a successfuly optimised model. Note that if a solution has not been optimised, is infeasible, or\n#!\tthe optimisation was not completed, then this will return an error. Thus it is advisable to first check the optimisation status.\nDeclareOperation( \"GurobiSolution\",\n\t[ IsGurobiModel] );\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, TimeLimit\n#! @Returns true\n#! @Description\n#!\tSet a time limit for a Gurobi model. Note that TimeLimit should be a float, however an integer value can be given\n#!\twhich will be automatically converted to a float.\nDeclareOperation( \"GurobiSetTimeLimit\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, BestObjectiveBoundStop\n#! @Returns true\n#! @Description\n#!\tOptimisation will terminate if a feasible solution is found with objective value at least as good as BestObjectiveBoundStop.\n#!\tNote that BestObjectiveBoundStop should be a float, however an integer value can be given\n#!\twhich will be automatically converted to a float.\nDeclareOperation( \"GurobiSetBestObjectiveBoundStop\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, CutOff\n#! @Returns true\n#! @Description\n#!\tOptimisation will terminate if the objective value is worse than CutOff.\n#!\tNote that CutOff should be a float, an integer value can be given\n#!\twhich will be automatically converted to a float.\nDeclareOperation( \"GurobiSetCutOff\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Modifying Objective Functions\n#! @Arguments Model\n#! @Returns true\n#! @Description\n#!\tSets the model sense to maximise. When the model is optimised, it will try to maximise the objective function.\nDeclareOperation(\"GurobiMaximiseModel\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Modifying Objective Functions\n#! @Arguments Model\n#! @Returns true\n#! @Description\n#!\tSets the model sense to minimise. When the model is optimised, it will try to minimise the objective function.\nDeclareOperation(\"GurobiMinimiseModel\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Modifying Objective Functions\n#! @Arguments Model, ObjectiveValues\n#! @Returns true\n#! @Description\n#!\tSet the objective function for a model. ObjectiveValues is a list of coefficients (including $0$ coefficeints)\n#!\tcorresponding to each of the variables\nDeclareOperation( \"GurobiSetObjectiveFunction\",\n\t[ IsGurobiModel, IsList] );\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Modifying Objective Functions\n#! @Arguments Model\n#! @Returns List of coefficients of the objective function\n#! @Description\n#!\tView the objective function for a model.\nDeclareOperation( \"GurobiObjectiveFunction\",\n\t[ IsGurobiModel] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns Number of variables\n#! @Description\n#!\tReturns the number of variables in the model.\nDeclareOperation(\"GurobiNumberOfVariables\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns Number of linear constraints\n#! @Description\n#!\tReturns the number of linear constraints in the model.\nDeclareOperation(\"GurobiNumberOfConstraints\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Optimising A Model\n#! @Arguments Model\n#! @Returns objective value\n#! @Description\n#!\tReturns the objective value of the current solution.\nDeclareOperation(\"GurobiObjectiveValue\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns objective bound\n#! @Description\n#!\tReturns the best known bound on the objective value of the model.\nDeclareOperation(\"GurobiObjectiveBound\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns run time of optimisation\n#! @Description\n#!\tReturns the wall clock runtime in seconds for the most recent optimisation.\nDeclareOperation(\"GurobiRunTime\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Optimising A Model\n#! @Arguments Model\n#! @Returns optimisation status code\n#! @Description\n#!\tReturns the optimisation status code of the most recent optimisation. Refer to the Gurobi documentation for more\n#!\ton the optimisation statuses, or alternatively refer to the Appendix of this manual.\nDeclareOperation(\"GurobiOptimisationStatus\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns numeric focus\n#! @Description\n#!\tReturns the numeric focus value of the model. The numeric focus is a value in the set [0,1,2,3]. A numeric focus of $0$ sets the\n#!\tnumeric focus automatically, preferancing speed. Values between 1 and 3 increase the care taken in computations \n#!\tas the value increases, but also take longer. The default value is 0.\nDeclareOperation(\"GurobiNumericFocus\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, NumericFocus\n#! @Returns true\n#! @Description\n#!\tSet the numeric focus for a model. Numeric focus must be in the set [0,1,2,3]. A numeric focus of $0$ sets the\n#!\tnumeric focus automatically, preferancing speed. Values between 1 and 3 increase the care taken in computations \n#!\tas the value increases, but also take longer. The default value is 0.\nDeclareOperation( \"GurobiSetNumericFocus\",\n\t[ IsGurobiModel, IsInt] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns time limit\n#! @Description\n#!\tReturns the time limit for the model. The default value is infinity.\nDeclareOperation(\"GurobiTimeLimit\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns cutoff value\n#! @Description\n#!\tReturns the cutoff value for the model. Optimisation will terminate if the objective value is worse than CutOff.\n#!\tThe default value is infinity for minimisation, and negative infinity for maximisation.\nDeclareOperation(\"GurobiCutOff\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns best objective bound limit value\n#! @Description\n#!\tReturns the best objective bound limit value for the model.\n#!\tOptimisation will terminate if a feasible solution is found with objective value at least as good as the best objective bound.\n#!\tThe default value is negative infinity.\nDeclareOperation(\"GurobiBestObjectiveBoundStop\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, MIPFocus\n#! @Returns true\n#! @Description\n#!\tSet the MIP focus for a model. The mip focus must be in the set [0,1,2,3], and the default value is 0.\n#!\tThe MIP focus alows you to prioritise finding solutions or proving their optimality. See the Gurobi \n#!\tdocumentation for more information.\nDeclareOperation( \"GurobiSetMIPFocus\",\n\t[ IsGurobiModel, IsInt] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns MIP focus\n#! @Description\n#!\tReturns the MIP focus value for the model. The mip focus must be in the set [0,1,2,3], and the default value is 0.\n#!\tThe MIP focus alows you to prioritise finding solutions or proving their optimality. See the Gurobi \n#!\tdocumentation for more information.\nDeclareOperation(\"GurobiMIPFocus\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, BestBdStop\n#! @Returns true\n#! @Description\n#!\tSet the best bound stopping value for a model. Terminates optimisation as soon as the value\n#!\tof the best bound is determined to be at least as good as the best bound stopping value. Default value is infinity.\nDeclareOperation( \"GurobiSetBestBoundStop\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns Best bound stopping value\n#! @Description\n#!\tReturns the best bound stopping value for the model. Optimisation terminates as soon as the value\n#!\tof the best bound is determined to be at least as good as the best bound stopping value. Default value is infinity.\nDeclareOperation(\"GurobiBestBoundStop\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, BestBdStop\n#! @Returns true\n#! @Description\n#!\tSet the limit for the maximum number of MIP solutions to find.\n#!\tDefault value is $2,000,000,000$.\nDeclareOperation( \"GurobiSetSolutionLimit\",\n\t[ IsGurobiModel, IsInt] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns solution limit value\n#! @Description\n#!\tReturns the solution limit value for the model. This value limits the maximum number of MIP solutions that will be found.\n#!\tDefault value is $2,000,000,000$.\nDeclareOperation(\"GurobiSolutionLimit\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, IterationLimit\n#! @Returns true\n#! @Description\n#!\tSet the limit for the maximum number of simplex iterations performed. Default value is infinity.\nDeclareOperation( \"GurobiSetIterationLimit\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns Iteration limit\n#! @Description\n#!\tReturns the iteration limit value for the model, which limits the number of simplex iterations performed during optimisation.\n#!\tDefault value is infinity.\nDeclareOperation(\"GurobiIterationLimit\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, NodeLimit\n#! @Returns true\n#! @Description\n#!\tSet the limit for the maximum number of MIP nodes explored.\n#!\tThe default value is infinity.\nDeclareOperation( \"GurobiSetNodeLimit\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns Node limit\n#! @Description\n#!\tReturns the node limit value for the model, which limits the number of MIP nodes explored during optimisation.\n#!\tThe default value is infinity.\nDeclareOperation(\"GurobiNodeLimit\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns \n#! @Description\n#!\tReturns the names of the variables in the model. This list acts as the index set for\n#!\tany lists of variable coefficients, such as in GurobiAddConstraint or GurobiSetObjectiveFunction.\nDeclareOperation(\"GurobiVariableNames\",\n\t[IsGurobiModel]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Creating Or Reading A Model\n#! @Arguments VariableTypes[, VariableNames]\n#! @Returns A Gurobi model\n#! @Description\n#! Creates a gurobi model with variables defined by VariableTypes. VariableTypes must be a list of strings, \n#!\twhere each entry is the type of the corresponding variable.\n#! Accepted variable types are \"CONTINUOUS\", \"BINARY\", \"INTEGER\", \"SEMICONT\", or \"SEMIINT\". The variable types are not case sensitive.\n#! Refer to the Gurobi documentation for more information on the variable types.\n#! Optionally takes the names of the variables as a list of strings.\nDeclareOperation( \"GurobiNewModel\",\n\t[IsList, IsList]);\n\n\n\n#! @Chapter Using Gurobify\n#! @Section Creating Or Reading A Model\n#! @Arguments Model, VariableNames\n#! @Returns true\n#! @Description\n#! Assigns each variable a new name from a list of names. The names must be strings. \nDeclareOperation(\"GurobiSetVariableNames\",\n\t\t[IsGurobiModel, IsList]);\n\n\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, Switch\n#! @Returns true\n#! @Description\n#! Turns console logging on or off. If Switch is true the output of Gurobi will be printed to the screen,\n#!\tand if it is false the output will be supressed. The default for Gurobify is to supress the output.\nDeclareOperation(\"GurobiSetLogToConsole\",\n\t\t[IsGurobiModel, IsBool]);\n\n\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns true\/false\n#! @Description\n#!\tReturns true if the Gurobi output is set to display to the screen, and false if the output is supressed.\n#!\tGurobify suppresses the output by default.\nDeclareOperation(\"GurobiLogToConsole\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Optimising A Model\n#! @Arguments Model\n#! @Returns Set of all solutions.\n#! @Description\n#!\tTakes a Gurobi model and repeatedly optimises it, each time adding the previous solution as a\n#!\tconstraint so that it isn't found again. This continues until all solutions are found, and\n#!\tthen they are returned as a set. During the process the number of found solutions is displayed.\nDeclareOperation(\"GurobiFindAllSolutions\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Optimising A Model\n#! @Arguments Model, Group\n#! @Returns Set of all solutions.\n#! @Description\n#!\t(Caution: This function is intended for use with binary variables only and may behave unexpectedly\n#!\twith other variable types).\n#!\tSame as above, except that it also takes a permutation group acting on the index set of variables.\n#!\tInstead of finding all solutions directly, the group is used to find the orbit of each new\n#!\tsolution, and these are then all returned at the end, and used as constraints until then.\n#!\tAn option value may also be given which will only return the representatives of each orbit of the\n#!\tsolutions. Hence it returns all the unique solutions up to equivalence under the group.\n#!\tThis saves on memory, and the remaing solutions may be refound by generating the\n#!\torbit under the group. To invoke this option place a colon after the group argument and then put\n#!\trepresentatives:=true so for example GurobiFindAllSolutions(model, gp : representatives:=true);\nDeclareOperation(\"GurobiFindAllSolutions\",\n\t[IsGurobiModel, IsGroup]);\n\n#! @Chapter Using Gurobify\n#! @Section Additional Functionality\n#! @Arguments IndexSet, NumberOfIndices\n#! @Returns Characterisitc vector\n#! @Description\n#!\tTakes a list of integers which form a subset of the set [1 .. n], where n is the second argument,\n#!\tand converts the set of indices to its characteristic vector. For example, if n = 5, the set\n#!\t[1,3] would be converted to [1, 0, 1, 0, 0]. It is useful to be able to convert between the two,\n#!\tsince Gurobify always takes the characteristic vector (for example when taking constraints),\n#!\tyet the set of indices is generally more helpful for the user.\nDeclareOperation(\"IndexSetToCharacteristicVector\",\n\t[IsList, IsPosInt]);\n\n#! @Chapter Using Gurobify\n#! @Section Additional Functionality\n#! @Arguments CharacteristicVector\n#! @Returns Characterisitc vector\n#! @Description\n#!\tTakes a characteristic vector and returns the set of indices corresponding to it. This reverses the\n#!\tprocess which occurs with IndexSetToCharacteristicVector. It is particularly useful to convert the\n#!\toutput of a Gurobi solution back in terms of the variables. For example, the characteristic vector\n#!\t[1, 0, 1, 0, 0] would return the index set [1,3]. Note that since the function expects a characteristic \n#!\tvector it doesn't account for any weightings, and is only interested in whether or not the corresponding \n#!\tindex is present, and as such it rounds each entry to the nearest integer and checks that it is non-zero.\n#!\tHence it is particularly suitable for use with binary variables. \nDeclareOperation(\"CharacteristicVectorToIndexSet\",\n\t[IsList]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Additional Functionality\n#! @Arguments Subset, FullSet\n#! @Returns Characterisitc vector\n#! @Description\n#!\tTakes a subset of some set, and returns the characteristic vector where the entries of the characteristic\n#!\tvector are indexed by the full set. For example, the subset [\"c\"] of [\"a\", \"c\", \"n\", \"q\"] would give the \n#!\tcharacteristic vector [0, 1, 0, 0]. This removes the need to first find the index set of the subset.\nDeclareOperation(\"SubsetToCharacteristicVector\",\n\t[IsList, IsList]);\n\n#! @Chapter Using Gurobify\n#! @Section Additional Functionality\n#! @Arguments CharacteristicVector\n#! @Returns Characterisitc vector\n#! @Description\n#!\tTakes a characteristic vector and some set which it takes to be indexing the entries of the characteristic \n#!\tvector. It then returns the subset of the full set corresponding to the non-zero entries of the characteristic \n#!\tvector. This is the reverse process to SubsetToCharacteristicVector. Note again that the characteristic vector \n#!\tis rounded to an integer before being compared to 0. As an example, the characteristic vector [0, 1, 0, 0] with \n#!\tthe set [\"a\", \"c\", \"n\", \"q\"] would return [\"c\"]. This removes the need to first return an index set before \n#!\tfinding the subset.\nDeclareOperation(\"CharacteristicVectorToSubset\",\n\t[IsList, IsList]);\n\n","old_contents":"# Gurobify: Gurobify provides an interface to Gurobi from GAP.\n#\n# Copyright (c) 2017 Jesse Lansdown\n#\n# This Source Code Form is subject to the terms of the Mozilla\n# Public License, v. 2.0. If a copy of the MPL was not distributed\n# with this file, You can obtain one at https:\/\/mozilla.org\/MPL\/2.0\/.\n\n\n\n# Declarations\n#\n\n\nDeclareCategory( \"IsGurobiModel\", IsObject );\n\n\nGurobiObjectFamily := NewFamily( \"GurobiObjectFamily\" );\n\nBindGlobal(\"TheTypeGurobiModel\", NewType( GurobiObjectFamily, IsGurobiModel ));\n\n\nDeclareOperation( \"GurobiNewModel\",\n\t[IsList]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Deleting Constraints\n#! @Arguments Model, ConstraintName\n#! @Returns true\/false\n#! @Description\n#!\tDeletes all constraints with the name ConstraintName\nDeclareOperation(\"GurobiDeleteConstraintsWithName\",\n\t[IsGurobiModel, IsString]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Deleting Constraints\n#! @Arguments Model, ConstraintEquation, ConstraintSense, ConstraintRHSValue[, ConstraintName]\n#! @Returns true\n#! @Description\n#!\tSame as below, except that ConstraintRHS value takes an integer value.\nDeclareOperation( \"GurobiAddConstraint\",\n\t[ IsGurobiModel, IsList, IsString, IsInt, IsString]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Deleting Constraints\n#! @Arguments Model, ConstraintEquation, ConstraintSense, ConstraintRHSValue[, ConstraintName]\n#! @Returns true\n#! @Description\n#!\tAdds a constraint to a gurobi model. ConstraintEquation must be a list, \n#!\tsuch that each entry is the coefficient (including $0$ coefficents) of the corresponding variable\n#! \tin the constraint equation. The ConstraintSense must be one of \"<\", \">\" or \"=\",\n#!\twhere Gurobi interprets < as <= and > as >=. The ConstraintRHSValue is the value on the\n#!\tright hand side of the constraint. A constraint may optionally be given a name, which helps to identify\n#!\tthe constraint if it is to be deleted at some point. If no constraint name is given, then a constraint is\n#!\tsimply assigned the name \"UnNamedConstraint\".\n#!\tNote that a model must be updated or optimised before any additional constraints become effective.\nDeclareOperation( \"GurobiAddConstraint\",\n\t[ IsGurobiModel, IsList, IsString, IsFloat, IsString] );\n\nDeclareOperation( \"GurobiAddConstraint\",\n\t[ IsGurobiModel, IsList, IsString, IsFloat]);\n\nDeclareOperation( \"GurobiAddConstraint\",\n\t[ IsGurobiModel, IsList, IsString, IsInt]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Deleting Constraints\n#! @Arguments Model, ConstraintEquations, ConstraintSenses, ConstraintRHSValues[, ConstraintNames]\n#! @Returns true\n#! @Description\n#!\tAdd multiple constraints to a model at one time. The arguments (except Model)\n#!\tare lists, such that the i-th entries of each list determine a single constraint in\n#!\tthe same manner as for the operation GurobiAddConstraint. ConstraintNames is an optional argument,\n#!\tand must be given for all constraints, or not at all.\nDeclareOperation( \"GurobiAddMultipleConstraints\",\n\t[ IsGurobiModel, IsList, IsList, IsList, IsList] );\n\n#! @Chapter Using Gurobify\n#! @Section Optimising A Model\n#! @Arguments Model\n#! @Returns Solution\n#! @Description\n#!\tDisplay the solution found for a successfuly optimised model. Note that if a solution has not been optimised, is infeasible, or\n#!\tthe optimisation was not completed, then this will return an error. Thus it is advisable to first check the optimisation status.\nDeclareOperation( \"GurobiSolution\",\n\t[ IsGurobiModel] );\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, TimeLimit\n#! @Returns true\n#! @Description\n#!\tSet a time limit for a Gurobi model. Note that TimeLimit should be a float, however an integer value can be given\n#!\twhich will be automatically converted to a float.\nDeclareOperation( \"GurobiSetTimeLimit\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, BestObjectiveBoundStop\n#! @Returns true\n#! @Description\n#!\tOptimisation will terminate if a feasible solution is found with objective value at least as good as BestObjectiveBoundStop.\n#!\tNote that BestObjectiveBoundStop should be a float, however an integer value can be given\n#!\twhich will be automatically converted to a float.\nDeclareOperation( \"GurobiSetBestObjectiveBoundStop\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, CutOff\n#! @Returns true\n#! @Description\n#!\tOptimisation will terminate if the objective value is worse than CutOff.\n#!\tNote that CutOff should be a float, an integer value can be given\n#!\twhich will be automatically converted to a float.\nDeclareOperation( \"GurobiSetCutOff\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Modifying Objective Functions\n#! @Arguments Model\n#! @Returns true\n#! @Description\n#!\tSets the model sense to maximise. When the model is optimised, it will try to maximise the objective function.\nDeclareOperation(\"GurobiMaximiseModel\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Modifying Objective Functions\n#! @Arguments Model\n#! @Returns true\n#! @Description\n#!\tSets the model sense to minimise. When the model is optimised, it will try to minimise the objective function.\nDeclareOperation(\"GurobiMinimiseModel\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Modifying Objective Functions\n#! @Arguments Model, ObjectiveValues\n#! @Returns true\n#! @Description\n#!\tSet the objective function for a model. ObjectiveValues is a list of coefficients (including $0$ coefficeints)\n#!\tcorresponding to each of the variables\nDeclareOperation( \"GurobiSetObjectiveFunction\",\n\t[ IsGurobiModel, IsList] );\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Modifying Objective Functions\n#! @Arguments Model\n#! @Returns List of coefficients of the objective function\n#! @Description\n#!\tView the objective function for a model.\nDeclareOperation( \"GurobiObjectiveFunction\",\n\t[ IsGurobiModel] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns Number of variables\n#! @Description\n#!\tReturns the number of variables in the model.\nDeclareOperation(\"GurobiNumberOfVariables\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns Number of linear constraints\n#! @Description\n#!\tReturns the number of linear constraints in the model.\nDeclareOperation(\"GurobiNumberOfConstraints\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Optimising A Model\n#! @Arguments Model\n#! @Returns objective value\n#! @Description\n#!\tReturns the objective value of the current solution.\nDeclareOperation(\"GurobiObjectiveValue\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns objective bound\n#! @Description\n#!\tReturns the best known bound on the objective value of the model.\nDeclareOperation(\"GurobiObjectiveBound\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns run time of optimisation\n#! @Description\n#!\tReturns the wall clock runtime in seconds for the most recent optimisation.\nDeclareOperation(\"GurobiRunTime\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Optimising A Model\n#! @Arguments Model\n#! @Returns optimisation status code\n#! @Description\n#!\tReturns the optimisation status code of the most recent optimisation. Refer to the Gurobi documentation for more\n#!\ton the optimisation statuses, or alternatively refer to the Appendix of this manual.\nDeclareOperation(\"GurobiOptimisationStatus\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns numeric focus\n#! @Description\n#!\tReturns the numeric focus value of the model. The numeric focus is a value in the set [0,1,2,3]. A numeric focus of $0$ sets the\n#!\tnumeric focus automatically, preferancing speed. Values between 1 and 3 increase the care taken in computations \n#!\tas the value increases, but also take longer. The default value is 0.\nDeclareOperation(\"GurobiNumericFocus\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, NumericFocus\n#! @Returns true\n#! @Description\n#!\tSet the numeric focus for a model. Numeric focus must be in the set [0,1,2,3]. A numeric focus of $0$ sets the\n#!\tnumeric focus automatically, preferancing speed. Values between 1 and 3 increase the care taken in computations \n#!\tas the value increases, but also take longer. The default value is 0.\nDeclareOperation( \"GurobiSetNumericFocus\",\n\t[ IsGurobiModel, IsInt] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns time limit\n#! @Description\n#!\tReturns the time limit for the model. The default value is infinity.\nDeclareOperation(\"GurobiTimeLimit\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns cutoff value\n#! @Description\n#!\tReturns the cutoff value for the model. Optimisation will terminate if the objective value is worse than CutOff.\n#!\tThe default value is infinity for minimisation, and negative infinity for maximisation.\nDeclareOperation(\"GurobiCutOff\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns best objective bound limit value\n#! @Description\n#!\tReturns the best objective bound limit value for the model.\n#!\tOptimisation will terminate if a feasible solution is found with objective value at least as good as the best objective bound.\n#!\tThe default value is negative infinity.\nDeclareOperation(\"GurobiBestObjectiveBoundStop\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, MIPFocus\n#! @Returns true\n#! @Description\n#!\tSet the MIP focus for a model. The mip focus must be in the set [0,1,2,3], and the default value is 0.\n#!\tThe MIP focus alows you to prioritise finding solutions or proving their optimality. See the Gurobi \n#!\tdocumentation for more information.\nDeclareOperation( \"GurobiSetMIPFocus\",\n\t[ IsGurobiModel, IsInt] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns MIP focus\n#! @Description\n#!\tReturns the MIP focus value for the model. The mip focus must be in the set [0,1,2,3], and the default value is 0.\n#!\tThe MIP focus alows you to prioritise finding solutions or proving their optimality. See the Gurobi \n#!\tdocumentation for more information.\nDeclareOperation(\"GurobiMIPFocus\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, BestBdStop\n#! @Returns true\n#! @Description\n#!\tSet the best bound stopping value for a model. Terminates optimisation as soon as the value\n#!\tof the best bound is determined to be at least as good as the best bound stopping value. Default value is infinity.\nDeclareOperation( \"GurobiSetBestBoundStop\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns Best bound stopping value\n#! @Description\n#!\tReturns the best bound stopping value for the model. Optimisation terminates as soon as the value\n#!\tof the best bound is determined to be at least as good as the best bound stopping value. Default value is infinity.\nDeclareOperation(\"GurobiBestBoundStop\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, BestBdStop\n#! @Returns true\n#! @Description\n#!\tSet the limit for the maximum number of MIP solutions to find.\n#!\tDefault value is $2,000,000,000$.\nDeclareOperation( \"GurobiSetSolutionLimit\",\n\t[ IsGurobiModel, IsInt] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns solution limit value\n#! @Description\n#!\tReturns the solution limit value for the model. This value limits the maximum number of MIP solutions that will be found.\n#!\tDefault value is $2,000,000,000$.\nDeclareOperation(\"GurobiSolutionLimit\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, IterationLimit\n#! @Returns true\n#! @Description\n#!\tSet the limit for the maximum number of simplex iterations performed. Default value is infinity.\nDeclareOperation( \"GurobiSetIterationLimit\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns Iteration limit\n#! @Description\n#!\tReturns the iteration limit value for the model, which limits the number of simplex iterations performed during optimisation.\n#!\tDefault value is infinity.\nDeclareOperation(\"GurobiIterationLimit\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, NodeLimit\n#! @Returns true\n#! @Description\n#!\tSet the limit for the maximum number of MIP nodes explored.\n#!\tThe default value is infinity.\nDeclareOperation( \"GurobiSetNodeLimit\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns Node limit\n#! @Description\n#!\tReturns the node limit value for the model, which limits the number of MIP nodes explored during optimisation.\n#!\tThe default value is infinity.\nDeclareOperation(\"GurobiNodeLimit\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns \n#! @Description\n#!\tReturns the names of the variables in the model. This list acts as the index set for\n#!\tany lists of variable coefficients, such as in GurobiAddConstraint or GurobiSetObjectiveFunction.\nDeclareOperation(\"GurobiVariableNames\",\n\t[IsGurobiModel]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Creating Or Reading A Model\n#! @Arguments VariableTypes[, VariableNames]\n#! @Returns A Gurobi model\n#! @Description\n#! Creates a gurobi model with variables defined by VariableTypes. VariableTypes must be a list of strings, \n#!\twhere each entry is the type of the corresponding variable.\n#! Accepted variable types are \"CONTINUOUS\", \"BINARY\", \"INTEGER\", \"SEMICONT\", or \"SEMIINT\". The variable types are not case sensitive.\n#! Refer to the Gurobi documentation for more information on the variable types.\n#! Optionally takes the names of the variables as a list of strings.\nDeclareOperation( \"GurobiNewModel\",\n\t[IsList, IsList]);\n\n\n\n#! @Chapter Using Gurobify\n#! @Section Creating Or Reading A Model\n#! @Arguments Model, VariableNames\n#! @Returns true\n#! @Description\n#! Assigns each variable a new name from a list of names. The names must be strings. \nDeclareOperation(\"GurobiSetVariableNames\",\n\t\t[IsGurobiModel, IsList]);\n\n\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, Switch\n#! @Returns true\n#! @Description\n#! Turns console logging on or off. If Switch is true the output of Gurobi will be printed to the screen,\n#!\tand if it is false the output will be supressed. The default for Gurobify is to supress the output.\nDeclareOperation(\"GurobiSetLogToConsole\",\n\t\t[IsGurobiModel, IsBool]);\n\n\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns true\/false\n#! @Description\n#!\tReturns true if the Gurobi output is set to display to the screen, and false if the output is supressed.\n#!\tGurobify suppresses the output by default.\nDeclareOperation(\"GurobiLogToConsole\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Optimising A Model\n#! @Arguments Model\n#! @Returns Set of all solutions.\n#! @Description\n#!\tTakes a Gurobi model and repeatedly optimises it, each time adding the previous solution as a\n#!\tconstraint so that it isn't found again. This continues until all solutions are found, and\n#!\tthen they are returned as a set. During the process the number of found solutions is displayed.\nDeclareOperation(\"GurobiFindAllSolutions\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Optimising A Model\n#! @Arguments Model, Group\n#! @Returns Set of all solutions.\n#! @Description\n#!\tSame as above, except that it also takes a permutation group acting on the index set of variables.\n#!\tInstead of finding all solutions directly, the group is used to find the orbit of each new\n#!\tsolution, and these are then all returned at the end, and used as constraints until then.\n#!\tAn option value may also be given which will only return the representatives of each orbit of the\n#!\tsolutions. Hence it returns all the unique solutions up to equivalence under the group.\n#!\tThis saves on memory, and the remaing solutions may be refound by generating the\n#!\torbit under the group. To invoke this option place a colon after the group argument and then put\n#!\trepresentatives:=true so for example GurobiFindAllSolutions(model, gp : representatives:=true);\nDeclareOperation(\"GurobiFindAllSolutions\",\n\t[IsGurobiModel, IsGroup]);\n\n#! @Chapter Using Gurobify\n#! @Section Additional Functionality\n#! @Arguments IndexSet, NumberOfIndices\n#! @Returns Characterisitc vector\n#! @Description\n#!\tTakes a list of integers which form a subset of the set [1 .. n], where n is the second argument,\n#!\tand converts the set of indices to its characteristic vector. For example, if n = 5, the set\n#!\t[1,3] would be converted to [1, 0, 1, 0, 0]. It is useful to be able to convert between the two,\n#!\tsince Gurobify always takes the characteristic vector (for example when taking constraints),\n#!\tyet the set of indices is generally more helpful for the user.\nDeclareOperation(\"IndexSetToCharacteristicVector\",\n\t[IsList, IsPosInt]);\n\n#! @Chapter Using Gurobify\n#! @Section Additional Functionality\n#! @Arguments CharacteristicVector\n#! @Returns Characterisitc vector\n#! @Description\n#!\tTakes a characteristic vector and returns the set of indices corresponding to it. This reverses the\n#!\tprocess which occurs with IndexSetToCharacteristicVector. It is particularly useful to convert the\n#!\toutput of a Gurobi solution back in terms of the variables. For example, the characteristic vector\n#!\t[1, 0, 1, 0, 0] would return the index set [1,3]. Note that since the function expects a characteristic \n#!\tvector it doesn't account for any weightings, and is only interested in whether or not the corresponding \n#!\tindex is present, and as such it rounds each entry to the nearest integer and checks that it is non-zero.\n#!\tHence it is particularly suitable for use with binary variables. \nDeclareOperation(\"CharacteristicVectorToIndexSet\",\n\t[IsList]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Additional Functionality\n#! @Arguments Subset, FullSet\n#! @Returns Characterisitc vector\n#! @Description\n#!\tTakes a subset of some set, and returns the characteristic vector where the entries of the characteristic\n#!\tvector are indexed by the full set. For example, the subset [\"c\"] of [\"a\", \"c\", \"n\", \"q\"] would give the \n#!\tcharacteristic vector [0, 1, 0, 0]. This removes the need to first find the index set of the subset.\nDeclareOperation(\"SubsetToCharacteristicVector\",\n\t[IsList, IsList]);\n\n#! @Chapter Using Gurobify\n#! @Section Additional Functionality\n#! @Arguments CharacteristicVector\n#! @Returns Characterisitc vector\n#! @Description\n#!\tTakes a characteristic vector and some set which it takes to be indexing the entries of the characteristic \n#!\tvector. It then returns the subset of the full set corresponding to the non-zero entries of the characteristic \n#!\tvector. This is the reverse process to SubsetToCharacteristicVector. Note again that the characteristic vector \n#!\tis rounded to an integer before being compared to 0. As an example, the characteristic vector [0, 1, 0, 0] with \n#!\tthe set [\"a\", \"c\", \"n\", \"q\"] would return [\"c\"]. This removes the need to first return an index set before \n#!\tfinding the subset.\nDeclareOperation(\"CharacteristicVectorToSubset\",\n\t[IsList, IsList]);\n\n","returncode":0,"stderr":"","license":"mpl-2.0","lang":"GDScript"} {"commit":"5f25afcfd21943030320621eac2634b478b2cb8c","subject":"using saveDir instead","message":"using saveDir instead\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Puzzle.gd","new_file":"src\/scripts\/Puzzle.gd","new_contents":"# Provides functionality for the puzzle itself\n\nextends Spatial\n\nvar DataMan = preload( \"res:\/\/scripts\/DataManager.gd\" ).new()\nvar PuzzleManScript = preload( \"res:\/\/scripts\/PuzzleManager.gd\" )\nvar PuzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar puzzleMan\nvar seed\nvar otherPuzzle\nvar generateRandom = true\nvar mainPuzzle = false\n\nvar time = {\n\t\ton = true,\n\t\tval = 0.0,\n\t\tlabel = Label.new(),\n\t\ttween = Tween.new() }\n\nfunc addTimer():\n\tadd_child(time.label)\n\tadd_child(time.tween)\n\ttime.label.set_pos(Vector2(15,15))\n\n\ttime.label.set_theme(load(\"res:\/\/themes\/MainTheme.thm\"))\n\ttime.tween.interpolate_method(time.label, \"set_pos\", \\\n\t\t\ttime.label.get_pos(), time.label.get_pos()*2, 0.5, \\\n\t\t\tTween.TRANS_BOUNCE, Tween.EASE_OUT)\n\ttime.tween.start()\n\ttime.label.set_text(str(time.val))\n\nstatic func formatTime(t):\n\tvar mins = floor(t \/ 60)\n\tvar secs = fmod(floor(t), 60)\n\tvar millis = floor((t - floor(t)) * 1000)\n\treturn str(mins) + \":\" + str(secs).pad_zeros(2) + \":\" + str(millis).pad_zeros(3)\n\nfunc _process(dTime):\n\t# start label tween on\n\ttime.val += dTime\n\ttime.label.set_text(formatTime(time.val))\n\tif fmod(time.val, 10) < 0.1:\n\t\ttime.tween.seek(0.0)\n\n# Called for initialization\nfunc _ready():\n\tif time.on:\n\t\tset_process(true) # needed for time keeping\n\taddTimer()\n\n\t#set up network stuffs\n\tadd_child(load(\"res:\/\/networkProxy.scn\").instance())\n\tvar Network = Globals.get(\"Network\")\n\tif Network != null:\n\t\tNetwork.proxy.set_process(Network.isClient or Network.isHost)\n\n\n\t# generate puzzle\n\tpuzzleMan = PuzzleManScript.new()\n\tvar puzzle\n\n\tif generateRandom:\n\t\tseed = OS.get_unix_time() # unix time\n\t\tseed *= OS.get_ticks_msec() # initial time\n\t\tseed *= 1 + OS.get_time().second\n\t\tseed *= 1 + OS.get_date().weekday\n\t\tseed = abs(seed) % 7919 # 1000th prime\n\n\t\trand_seed(seed)\n\n\t\tpuzzle = puzzleMan.generatePuzzle( 2, puzzleMan.DIFF_HARD )\n\t\tpuzzle.puzzleMan = puzzleMan\n\t\tvar steps = puzzle.solvePuzzleSteps()\n\t\tprint(\"Generated \", puzzle.shape.size(), \" blocks.\" )\n\t\tprint( \"PUZZLE IS SOLVEABLE?: \", steps.solveable )\n\n\t\tvar gridMan = get_node( \"GridView\/GridMan\" )\n\t\tDataMan.savePuzzle(DataMan.saveDir + \"test.pzl\", puzzle)\n\t\tvar pCopy = DataMan.loadPuzzle(DataMan.saveDir + \"test.pzl\")\n\t\tgridMan.set_puzzle(pCopy)\n\n\n\n\t# make a new puzzle, embed using Viewport\n\tif mainPuzzle:\n\t\tif (not Network == null and Network.isNetwork):\n\t\t\tprint(\"Sending puzzle\")\n\t\t\tNetwork.sendStart(puzzle)\n\n\t\tvar p = PuzzleScn.instance()\n\t\tp.get_node(\"GridView\").active = false\n\t\tp.get_node(\"GridView\/GridMan\").set_puzzle(puzzle)\n\t\tp.mainPuzzle = false\n\t\tp.set_scale(Vector3(0.5, 0.5, 0.5))\n\t\tp.set_translation(Vector3(10, 5, -20))\n\n\t\tvar v = Viewport.new()\n\t\tvar c = Control.new()\n\n\t\tv.set_world(p.get_world())\n\t\tv.set_render_target_to_screen_rect(Rect2(20,20,40,40))\n\t\tv.set_physics_object_picking(false)\n\t\tv.add_child(p)\n\t\tc.add_child(v)\n\t\tadd_child(c)\n\n\t\tp.get_node(\"GridView\").set_process_input(false)\n\n\t\totherPuzzle = p #for use with network\n\n\t#music attempt\n\tvar musicPlayer = Globals.get(\"StreamPlayer\")\n\tvar songs = [load(\"res:\/\/main_theme_antris.ogg\")]\n\tadd_child(StreamPlayer)\n\tadd_child(musicPlayer)\n\tmusicPlayer.set_stream(songs[0])\n\tmusicPlayer.play()\n","old_contents":"# Provides functionality for the puzzle itself\n\nextends Spatial\n\nvar DataMan = preload( \"res:\/\/scripts\/DataManager.gd\" ).new()\nvar PuzzleManScript = preload( \"res:\/\/scripts\/PuzzleManager.gd\" )\nvar PuzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar puzzleMan\nvar seed\nvar otherPuzzle\nvar generateRandom = true\nvar mainPuzzle = false\n\nvar time = {\n\t\ton = true,\n\t\tval = 0.0,\n\t\tlabel = Label.new(),\n\t\ttween = Tween.new() }\n\nfunc addTimer():\n\tadd_child(time.label)\n\tadd_child(time.tween)\n\ttime.label.set_pos(Vector2(15,15))\n\n\ttime.label.set_theme(load(\"res:\/\/themes\/MainTheme.thm\"))\n\ttime.tween.interpolate_method(time.label, \"set_pos\", \\\n\t\t\ttime.label.get_pos(), time.label.get_pos()*2, 0.5, \\\n\t\t\tTween.TRANS_BOUNCE, Tween.EASE_OUT)\n\ttime.tween.start()\n\ttime.label.set_text(str(time.val))\n\nstatic func formatTime(t):\n\tvar mins = floor(t \/ 60)\n\tvar secs = fmod(floor(t), 60)\n\tvar millis = floor((t - floor(t)) * 1000)\n\treturn str(mins) + \":\" + str(secs).pad_zeros(2) + \":\" + str(millis).pad_zeros(3)\n\nfunc _process(dTime):\n\t# start label tween on\n\ttime.val += dTime\n\ttime.label.set_text(formatTime(time.val))\n\tif fmod(time.val, 10) < 0.1:\n\t\ttime.tween.seek(0.0)\n\n# Called for initialization\nfunc _ready():\n\tif time.on:\n\t\tset_process(true) # needed for time keeping\n\taddTimer()\n\n\t#set up network stuffs\n\tadd_child(load(\"res:\/\/networkProxy.scn\").instance())\n\tvar Network = Globals.get(\"Network\")\n\tif Network != null:\n\t\tNetwork.proxy.set_process(Network.isClient or Network.isHost)\n\n\n\t# generate puzzle\n\tpuzzleMan = PuzzleManScript.new()\n\tvar puzzle\n\n\tif generateRandom:\n\t\tseed = OS.get_unix_time() # unix time\n\t\tseed *= OS.get_ticks_msec() # initial time\n\t\tseed *= 1 + OS.get_time().second\n\t\tseed *= 1 + OS.get_date().weekday\n\t\tseed = abs(seed) % 7919 # 1000th prime\n\n\t\trand_seed(seed)\n\n\t\tpuzzle = puzzleMan.generatePuzzle( 2, puzzleMan.DIFF_HARD )\n\t\tpuzzle.puzzleMan = puzzleMan\n\t\tvar steps = puzzle.solvePuzzleSteps()\n\t\tprint(\"Generated \", puzzle.shape.size(), \" blocks.\" )\n\t\tprint( \"PUZZLE IS SOLVEABLE?: \", steps.solveable )\n\n\t\tvar gridMan = get_node( \"GridView\/GridMan\" )\n\t\tDataMan.savePuzzle(\"test.pzl\", puzzle)\n\t\tvar pCopy = DataMan.loadPuzzle(\"test.pzl\")\n\t\tgridMan.set_puzzle(puzzle)\n\n\n\n\t# make a new puzzle, embed using Viewport\n\tif mainPuzzle:\n\t\tif (not Network == null and Network.isNetwork):\n\t\t\tprint(\"Sending puzzle\")\n\t\t\tNetwork.sendStart(puzzle)\n\n\t\tvar p = PuzzleScn.instance()\n\t\tp.get_node(\"GridView\").active = false\n\t\tp.get_node(\"GridView\/GridMan\").set_puzzle(puzzle)\n\t\tp.mainPuzzle = false\n\t\tp.set_scale(Vector3(0.5, 0.5, 0.5))\n\t\tp.set_translation(Vector3(10, 5, -20))\n\n\t\tvar v = Viewport.new()\n\t\tvar c = Control.new()\n\n\t\tv.set_world(p.get_world())\n\t\tv.set_render_target_to_screen_rect(Rect2(20,20,40,40))\n\t\tv.set_physics_object_picking(false)\n\t\tv.add_child(p)\n\t\tc.add_child(v)\n\t\tadd_child(c)\n\n\t\tp.get_node(\"GridView\").set_process_input(false)\n\n\t\totherPuzzle = p #for use with network\n\n\t#music attempt\n\tvar musicPlayer = Globals.get(\"StreamPlayer\")\n\tvar songs = [load(\"res:\/\/main_theme_antris.ogg\")]\n\tadd_child(StreamPlayer)\n\tadd_child(musicPlayer)\n\tmusicPlayer.set_stream(songs[0])\n\tmusicPlayer.play()\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"c9f7ac121e0af55d17c0f88db7a469552a11664a","subject":"Mapa Adama.","message":"Mapa Adama.\n","repos":"Xpressik\/Podstawy-Gier-Komputerowych,Xpressik\/Podstawy-Gier-Komputerowych","old_file":"Assets\/savedCells.gd","new_file":"Assets\/savedCells.gd","new_contents":"\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\f\u0002\u0000\u0000\u0000\u000fAssembly-CSharp\u0004\u0001\u0000\u0000\u0000xSystem.Collections.Generic.List`1[[HexCellInfo, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]\u0003\u0000\u0000\u0000\u0006_items\u0005_size\b_version\u0004\u0000\u0000\rHexCellInfo[]\u0002\u0000\u0000\u0000\b\b\t\u0003\u0000\u0000\u0000,\u0001\u0000\u0000,\u0001\u0000\u0000\u0007\u0003\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0004\u000bHexCellInfo\u0002\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\t\u0005\u0000\u0000\u0000\t\u0006\u0000\u0000\u0000\t\u0007\u0000\u0000\u0000\t\b\u0000\u0000\u0000\t\t\u0000\u0000\u0000\t\n\u0000\u0000\u0000\t\u000b\u0000\u0000\u0000\t\f\u0000\u0000\u0000\t\r\u0000\u0000\u0000\t\u000e\u0000\u0000\u0000\t\u000f\u0000\u0000\u0000\t\u0010\u0000\u0000\u0000\t\u0011\u0000\u0000\u0000\t\u0012\u0000\u0000\u0000\t\u0013\u0000\u0000\u0000\t\u0014\u0000\u0000\u0000\t\u0015\u0000\u0000\u0000\t\u0016\u0000\u0000\u0000\t\u0017\u0000\u0000\u0000\t\u0018\u0000\u0000\u0000\t\u0019\u0000\u0000\u0000\t\u001a\u0000\u0000\u0000\t\u001b\u0000\u0000\u0000\t\u001c\u0000\u0000\u0000\t\u001d\u0000\u0000\u0000\t\u001e\u0000\u0000\u0000\t\u001f\u0000\u0000\u0000\t \u0000\u0000\u0000\t!\u0000\u0000\u0000\t\"\u0000\u0000\u0000\t#\u0000\u0000\u0000\t$\u0000\u0000\u0000\t%\u0000\u0000\u0000\t&\u0000\u0000\u0000\t'\u0000\u0000\u0000\t(\u0000\u0000\u0000\t)\u0000\u0000\u0000\t*\u0000\u0000\u0000\t+\u0000\u0000\u0000\t,\u0000\u0000\u0000\t-\u0000\u0000\u0000\t.\u0000\u0000\u0000\t\/\u0000\u0000\u0000\t0\u0000\u0000\u0000\t1\u0000\u0000\u0000\t2\u0000\u0000\u0000\t3\u0000\u0000\u0000\t4\u0000\u0000\u0000\t5\u0000\u0000\u0000\t6\u0000\u0000\u0000\t7\u0000\u0000\u0000\t8\u0000\u0000\u0000\t9\u0000\u0000\u0000\t:\u0000\u0000\u0000\t;\u0000\u0000\u0000\t<\u0000\u0000\u0000\t=\u0000\u0000\u0000\t>\u0000\u0000\u0000\t?\u0000\u0000\u0000\t@\u0000\u0000\u0000\tA\u0000\u0000\u0000\tB\u0000\u0000\u0000\tC\u0000\u0000\u0000\tD\u0000\u0000\u0000\tE\u0000\u0000\u0000\tF\u0000\u0000\u0000\tG\u0000\u0000\u0000\tH\u0000\u0000\u0000\tI\u0000\u0000\u0000\tJ\u0000\u0000\u0000\tK\u0000\u0000\u0000\tL\u0000\u0000\u0000\tM\u0000\u0000\u0000\tN\u0000\u0000\u0000\tO\u0000\u0000\u0000\tP\u0000\u0000\u0000\tQ\u0000\u0000\u0000\tR\u0000\u0000\u0000\tS\u0000\u0000\u0000\tT\u0000\u0000\u0000\tU\u0000\u0000\u0000\tV\u0000\u0000\u0000\tW\u0000\u0000\u0000\tX\u0000\u0000\u0000\tY\u0000\u0000\u0000\tZ\u0000\u0000\u0000\t[\u0000\u0000\u0000\t\\\u0000\u0000\u0000\t]\u0000\u0000\u0000\t^\u0000\u0000\u0000\t_\u0000\u0000\u0000\t`\u0000\u0000\u0000\ta\u0000\u0000\u0000\tb\u0000\u0000\u0000\tc\u0000\u0000\u0000\td\u0000\u0000\u0000\te\u0000\u0000\u0000\tf\u0000\u0000\u0000\tg\u0000\u0000\u0000\th\u0000\u0000\u0000\ti\u0000\u0000\u0000\tj\u0000\u0000\u0000\tk\u0000\u0000\u0000\tl\u0000\u0000\u0000\tm\u0000\u0000\u0000\tn\u0000\u0000\u0000\to\u0000\u0000\u0000\tp\u0000\u0000\u0000\tq\u0000\u0000\u0000\tr\u0000\u0000\u0000\ts\u0000\u0000\u0000\tt\u0000\u0000\u0000\tu\u0000\u0000\u0000\tv\u0000\u0000\u0000\tw\u0000\u0000\u0000\tx\u0000\u0000\u0000\ty\u0000\u0000\u0000\tz\u0000\u0000\u0000\t{\u0000\u0000\u0000\t|\u0000\u0000\u0000\t}\u0000\u0000\u0000\t~\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0001\u0000\u0000\t\u0001\u0001\u0000\u0000\t\u0002\u0001\u0000\u0000\t\u0003\u0001\u0000\u0000\t\u0004\u0001\u0000\u0000\t\u0005\u0001\u0000\u0000\t\u0006\u0001\u0000\u0000\t\u0007\u0001\u0000\u0000\t\b\u0001\u0000\u0000\t\t\u0001\u0000\u0000\t\n\u0001\u0000\u0000\t\u000b\u0001\u0000\u0000\t\f\u0001\u0000\u0000\t\r\u0001\u0000\u0000\t\u000e\u0001\u0000\u0000\t\u000f\u0001\u0000\u0000\t\u0010\u0001\u0000\u0000\t\u0011\u0001\u0000\u0000\t\u0012\u0001\u0000\u0000\t\u0013\u0001\u0000\u0000\t\u0014\u0001\u0000\u0000\t\u0015\u0001\u0000\u0000\t\u0016\u0001\u0000\u0000\t\u0017\u0001\u0000\u0000\t\u0018\u0001\u0000\u0000\t\u0019\u0001\u0000\u0000\t\u001a\u0001\u0000\u0000\t\u001b\u0001\u0000\u0000\t\u001c\u0001\u0000\u0000\t\u001d\u0001\u0000\u0000\t\u001e\u0001\u0000\u0000\t\u001f\u0001\u0000\u0000\t \u0001\u0000\u0000\t!\u0001\u0000\u0000\t\"\u0001\u0000\u0000\t#\u0001\u0000\u0000\t$\u0001\u0000\u0000\t%\u0001\u0000\u0000\t&\u0001\u0000\u0000\t'\u0001\u0000\u0000\t(\u0001\u0000\u0000\t)\u0001\u0000\u0000\t*\u0001\u0000\u0000\t+\u0001\u0000\u0000\t,\u0001\u0000\u0000\t-\u0001\u0000\u0000\t.\u0001\u0000\u0000\t\/\u0001\u0000\u0000\r\u0005\u0004\u0000\u0000\u0000\u000bHexCellInfo\f\u0000\u0000\u0000\televation\b_myColor\u0010hasIncomingRiver\u0010hasOutgoingRiver\rincomingRiver\routgoingRiver\nwaterLevel\fisUnderWater\bisWalled\nurbanLevel\nplantLevel\tfarmLevel\u0000\u0007\u0000\u0000\u0004\u0004\u0000\u0000\u0000\u0000\u0000\u0000\b\u000b\u0001\u0001\fHexDirection\u0002\u0000\u0000\u0000\fHexDirection\u0002\u0000\u0000\u0000\b\u0001\u0001\b\b\b\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t0\u0001\u0000\u0000\u0000\u0000\u00051\u0001\u0000\u0000\fHexDirection\u0001\u0000\u0000\u0000\u0007value__\u0000\b\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00012\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0005\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t3\u0001\u0000\u0000\u0000\u0000\u00014\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00015\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0006\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t6\u0001\u0000\u0000\u0000\u0000\u00017\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00018\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0007\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t9\u0001\u0000\u0000\u0000\u0000\u0001:\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001;\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\b\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t<\u0001\u0000\u0000\u0000\u0000\u0001=\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001>\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\t\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t?\u0001\u0000\u0000\u0000\u0000\u0001@\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001A\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\n\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tB\u0001\u0000\u0000\u0000\u0000\u0001C\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001D\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000b\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\tE\u0001\u0000\u0000\u0000\u0000\u0001F\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001G\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\f\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\tH\u0001\u0000\u0000\u0000\u0000\u0001I\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001J\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\r\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\tK\u0001\u0000\u0000\u0000\u0000\u0001L\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001M\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000e\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\tN\u0001\u0000\u0000\u0000\u0000\u0001O\u0001\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001P\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000f\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tQ\u0001\u0000\u0000\u0000\u0000\u0001R\u0001\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001S\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0010\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tT\u0001\u0000\u0000\u0000\u0000\u0001U\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001V\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0011\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tW\u0001\u0000\u0000\u0000\u0000\u0001X\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001Y\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0012\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tZ\u0001\u0000\u0000\u0000\u0000\u0001[\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\\\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0013\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t]\u0001\u0000\u0000\u0000\u0000\u0001^\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001_\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0014\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t`\u0001\u0000\u0000\u0000\u0000\u0001a\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001b\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0015\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tc\u0001\u0000\u0000\u0000\u0000\u0001d\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001e\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0016\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tf\u0001\u0000\u0000\u0000\u0000\u0001g\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001h\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0017\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\ti\u0001\u0000\u0000\u0000\u0000\u0001j\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001k\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0018\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\tl\u0001\u0000\u0000\u0000\u0000\u0001m\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001n\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0019\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\to\u0001\u0000\u0000\u0000\u0000\u0001p\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001q\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001a\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\tr\u0001\u0000\u0000\u0000\u0000\u0001s\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001t\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001b\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\tu\u0001\u0000\u0000\u0000\u0000\u0001v\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001w\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001c\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tx\u0001\u0000\u0000\u0000\u0000\u0001y\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001z\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001d\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t{\u0001\u0000\u0000\u0000\u0000\u0001|\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001}\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001e\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t~\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001f\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 \u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001!\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\"\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001#\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001$\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001%\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001&\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001'\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001(\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001)\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001*\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001+\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001,\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001-\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001.\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\/\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00010\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00011\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u00012\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00013\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00014\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00015\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00016\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00017\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00018\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00019\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001:\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001;\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0001<\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001=\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0001\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001>\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0001\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001?\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001@\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001A\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001B\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001C\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001D\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001E\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001F\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001G\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001H\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001I\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0000\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001J\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0002\u0002\u0000\u0000\u0000\u0000\u0001\u0003\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0004\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001K\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0005\u0002\u0000\u0000\u0000\u0000\u0001\u0006\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0007\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001L\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\b\u0002\u0000\u0000\u0000\u0000\u0001\t\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\n\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001M\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\t\u000b\u0002\u0000\u0000\u0000\u0000\u0001\f\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\r\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001N\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\t\u000e\u0002\u0000\u0000\u0000\u0000\u0001\u000f\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0010\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001O\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t\u0011\u0002\u0000\u0000\u0000\u0000\u0001\u0012\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0013\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001P\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\t\u0014\u0002\u0000\u0000\u0000\u0000\u0001\u0015\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0016\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0001Q\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\t\u0017\u0002\u0000\u0000\u0000\u0000\u0001\u0018\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0019\u0002\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0001R\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u001a\u0002\u0000\u0000\u0001\u0000\u0001\u001b\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u001c\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001S\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u001d\u0002\u0000\u0000\u0000\u0000\u0001\u001e\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001f\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001T\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0002\u0000\u0000\u0000\u0000\u0001!\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\"\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001U\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t#\u0002\u0000\u0000\u0000\u0000\u0001$\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001%\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001V\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\t&\u0002\u0000\u0000\u0000\u0000\u0001'\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001(\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001W\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t)\u0002\u0000\u0000\u0000\u0000\u0001*\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001+\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001X\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t,\u0002\u0000\u0000\u0000\u0000\u0001-\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001.\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001Y\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\/\u0002\u0000\u0000\u0000\u0000\u00010\u0002\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u00011\u0002\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001Z\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t2\u0002\u0000\u0000\u0001\u0000\u00013\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00014\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001[\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t5\u0002\u0000\u0000\u0000\u0000\u00016\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00017\u0002\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\\\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t8\u0002\u0000\u0000\u0000\u0000\u00019\u0002\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001:\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001]\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t;\u0002\u0000\u0000\u0000\u0000\u0001<\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001=\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001^\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t>\u0002\u0000\u0000\u0000\u0000\u0001?\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001@\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001_\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tA\u0002\u0000\u0000\u0000\u0000\u0001B\u0002\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0001C\u0002\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001`\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tD\u0002\u0000\u0000\u0000\u0000\u0001E\u0002\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001F\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001a\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tG\u0002\u0000\u0000\u0000\u0000\u0001H\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001I\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001b\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tJ\u0002\u0000\u0000\u0000\u0000\u0001K\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001L\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001c\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tM\u0002\u0000\u0000\u0000\u0000\u0001N\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001O\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001d\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\tP\u0002\u0000\u0000\u0000\u0000\u0001Q\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001R\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001e\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\tS\u0002\u0000\u0000\u0000\u0000\u0001T\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001U\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001f\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\tV\u0002\u0000\u0000\u0000\u0001\u0001W\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001X\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001g\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tY\u0002\u0000\u0000\u0001\u0000\u0001Z\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001[\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001h\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\\\u0002\u0000\u0000\u0000\u0000\u0001]\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001^\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001i\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t_\u0002\u0000\u0000\u0000\u0000\u0001`\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001a\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001j\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\tb\u0002\u0000\u0000\u0000\u0000\u0001c\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001d\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001k\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\te\u0002\u0000\u0000\u0000\u0000\u0001f\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001g\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001l\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0006\u0000\u0000\u0000\th\u0002\u0000\u0000\u0000\u0000\u0001i\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001j\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001m\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0006\u0000\u0000\u0000\tk\u0002\u0000\u0000\u0000\u0000\u0001l\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001m\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001n\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0006\u0000\u0000\u0000\tn\u0002\u0000\u0000\u0000\u0001\u0001o\u0002\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001p\u0002\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0001o\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0006\u0000\u0000\u0000\tq\u0002\u0000\u0000\u0000\u0000\u0001r\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001s\u0002\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001p\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tt\u0002\u0000\u0000\u0000\u0000\u0001u\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001v\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001q\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tw\u0002\u0000\u0000\u0000\u0000\u0001x\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001y\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001r\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tz\u0002\u0000\u0000\u0000\u0000\u0001{\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001|\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001s\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t}\u0002\u0000\u0000\u0000\u0000\u0001~\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001t\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001u\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001v\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001w\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001x\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001y\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001z\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0002\u0000\u0000\u0001\u0001\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001{\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001|\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001}\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001~\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0006\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0006\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0006\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0006\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0002\u0000\u0000\u0001\u0001\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0002\u0000\u0000\u0001\u0001\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0001\u0001\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0001\u0001\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0001\u0001\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0006\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0001\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0006\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0001\u0003\u0000\u0000\u0000\u0000\u0001\u0002\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0003\u0000\u0000\u0000\u0000\u0001\u0005\u0003\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0006\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0007\u0003\u0000\u0000\u0001\u0001\u0001\b\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\t\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\n\u0003\u0000\u0000\u0000\u0000\u0001\u000b\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\f\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\r\u0003\u0000\u0000\u0000\u0000\u0001\u000e\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000f\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0010\u0003\u0000\u0000\u0000\u0000\u0001\u0011\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0012\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0013\u0003\u0000\u0000\u0000\u0000\u0001\u0014\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0015\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0016\u0003\u0000\u0000\u0000\u0000\u0001\u0017\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0018\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0019\u0003\u0000\u0000\u0001\u0001\u0001\u001a\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u001b\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u001c\u0003\u0000\u0000\u0000\u0000\u0001\u001d\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001e\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u001f\u0003\u0000\u0000\u0000\u0000\u0001 \u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001!\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\"\u0003\u0000\u0000\u0000\u0000\u0001#\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001$\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t%\u0003\u0000\u0000\u0000\u0000\u0001&\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001'\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t(\u0003\u0000\u0000\u0000\u0000\u0001)\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001*\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t+\u0003\u0000\u0000\u0000\u0000\u0001,\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001-\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t.\u0003\u0000\u0000\u0000\u0000\u0001\/\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u00010\u0003\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t1\u0003\u0000\u0000\u0000\u0000\u00012\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00013\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t4\u0003\u0000\u0000\u0000\u0000\u00015\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00016\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t7\u0003\u0000\u0000\u0000\u0000\u00018\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00019\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0006\u0000\u0000\u0000\t:\u0003\u0000\u0000\u0000\u0000\u0001;\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001<\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t=\u0003\u0000\u0000\u0000\u0000\u0001>\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001?\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t@\u0003\u0000\u0000\u0000\u0000\u0001A\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001B\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tC\u0003\u0000\u0000\u0000\u0000\u0001D\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001E\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\tF\u0003\u0000\u0000\u0001\u0001\u0001G\u0003\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001H\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tI\u0003\u0000\u0000\u0000\u0000\u0001J\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001K\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tL\u0003\u0000\u0000\u0000\u0000\u0001M\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001N\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tO\u0003\u0000\u0000\u0000\u0000\u0001P\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001Q\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tR\u0003\u0000\u0000\u0000\u0000\u0001S\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001T\u0003\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\tU\u0003\u0000\u0000\u0001\u0001\u0001V\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0001W\u0003\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tX\u0003\u0000\u0000\u0000\u0000\u0001Y\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001Z\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t[\u0003\u0000\u0000\u0000\u0000\u0001\\\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001]\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t^\u0003\u0000\u0000\u0000\u0000\u0001_\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001`\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\ta\u0003\u0000\u0000\u0000\u0000\u0001b\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001c\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\td\u0003\u0000\u0000\u0000\u0000\u0001e\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001f\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\tg\u0003\u0000\u0000\u0000\u0000\u0001h\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001i\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tj\u0003\u0000\u0000\u0000\u0000\u0001k\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001l\u0003\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tm\u0003\u0000\u0000\u0000\u0000\u0001n\u0003\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001o\u0003\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0006\u0000\u0000\u0000\tp\u0003\u0000\u0000\u0000\u0000\u0001q\u0003\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001r\u0003\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0006\u0000\u0000\u0000\ts\u0003\u0000\u0000\u0000\u0000\u0001t\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001u\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0006\u0000\u0000\u0000\tv\u0003\u0000\u0000\u0000\u0001\u0001w\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001x\u0003\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\ty\u0003\u0000\u0000\u0001\u0001\u0001z\u0003\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001{\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t|\u0003\u0000\u0000\u0000\u0000\u0001}\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001~\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0003\u0000\u0000\u0001\u0001\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0003\u0000\u0000\u0001\u0001\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0001\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0006\u0000\u0000\u0000\t\u0003\u0000\u0000\u0001\u0001\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0006\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0001\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0006\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0006\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0006\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0001\u0001\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0003\u0000\u0000\u0001\u0001\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0003\u0000\u0000\u0001\u0001\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0006\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0006\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0006\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0006\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0000\u0004\u0000\u0000\u0000\u0000\u0001\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0005\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0006\u0004\u0000\u0000\u0001\u0000\u0001\u0007\u0004\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\b\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\t\t\u0004\u0000\u0000\u0000\u0001\u0001\n\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000b\u0004\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\t\f\u0004\u0000\u0000\u0000\u0000\u0001\r\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000e\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t\u000f\u0004\u0000\u0000\u0000\u0000\u0001\u0010\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0011\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\t\u0012\u0004\u0000\u0000\u0000\u0000\u0001\u0013\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0014\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0015\u0004\u0000\u0000\u0000\u0000\u0001\u0016\u0004\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0017\u0004\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0018\u0004\u0000\u0000\u0000\u0000\u0001\u0019\u0004\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u001a\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u001b\u0004\u0000\u0000\u0000\u0000\u0001\u001c\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001d\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u001e\u0004\u0000\u0000\u0000\u0000\u0001\u001f\u0004\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001 \u0004\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t!\u0004\u0000\u0000\u0000\u0000\u0001\"\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001#\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t$\u0004\u0000\u0000\u0000\u0000\u0001%\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001&\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t'\u0004\u0000\u0000\u0000\u0000\u0001(\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001)\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\t*\u0004\u0000\u0000\u0000\u0000\u0001+\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001,\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\t-\u0004\u0000\u0000\u0000\u0000\u0001.\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\/\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t0\u0004\u0000\u0000\u0000\u0000\u00011\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00012\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0005\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\t3\u0004\u0000\u0000\u0000\u0000\u00014\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00015\u0004\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0006\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t6\u0004\u0000\u0000\u0000\u0000\u00017\u0004\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u00018\u0004\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0007\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t9\u0004\u0000\u0000\u0000\u0000\u0001:\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001;\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\b\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t<\u0004\u0000\u0000\u0000\u0000\u0001=\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001>\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\t\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t?\u0004\u0000\u0000\u0000\u0000\u0001@\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001A\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\n\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tB\u0004\u0000\u0000\u0001\u0000\u0001C\u0004\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001D\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000b\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\tE\u0004\u0000\u0000\u0001\u0001\u0001F\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001G\u0004\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\tH\u0004\u0000\u0000\u0000\u0000\u0001I\u0004\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001J\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0001\r\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\tK\u0004\u0000\u0000\u0000\u0000\u0001L\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001M\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000e\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tN\u0004\u0000\u0000\u0000\u0000\u0001O\u0004\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001P\u0004\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tQ\u0004\u0000\u0000\u0000\u0000\u0001R\u0004\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001S\u0004\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0010\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\tT\u0004\u0000\u0000\u0000\u0000\u0001U\u0004\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0001V\u0004\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0011\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\tW\u0004\u0000\u0000\u0000\u0000\u0001X\u0004\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001Y\u0004\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0012\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tZ\u0004\u0000\u0000\u0000\u0000\u0001[\u0004\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\\\u0004\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0013\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t]\u0004\u0000\u0000\u0000\u0000\u0001^\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001_\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0014\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t`\u0004\u0000\u0000\u0000\u0000\u0001a\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001b\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0015\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\tc\u0004\u0000\u0000\u0000\u0000\u0001d\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001e\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0016\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\tf\u0004\u0000\u0000\u0000\u0000\u0001g\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001h\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0017\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\ti\u0004\u0000\u0000\u0000\u0000\u0001j\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001k\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0018\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\tl\u0004\u0000\u0000\u0000\u0000\u0001m\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001n\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0019\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\to\u0004\u0000\u0000\u0000\u0000\u0001p\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001q\u0004\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001a\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tr\u0004\u0000\u0000\u0000\u0000\u0001s\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001t\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u001b\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tu\u0004\u0000\u0000\u0000\u0000\u0001v\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001w\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u001c\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tx\u0004\u0000\u0000\u0000\u0000\u0001y\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001z\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001d\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t{\u0004\u0000\u0000\u0000\u0000\u0001|\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001}\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001e\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t~\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0001\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 \u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0001\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001!\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\"\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001#\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001$\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001%\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001&\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001'\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001(\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001)\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001*\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001+\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001,\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001-\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001.\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\/\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u000f0\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f3\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f6\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f9\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f<\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f?\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fB\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fE\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fH\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fK\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fN\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fQ\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fT\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fW\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fZ\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f]\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f`\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fc\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000ff\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fi\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fl\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fo\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fr\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fu\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fx\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f{\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f~\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0002\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0005\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\b\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u000b\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u000e\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0011\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0014\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0017\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u001a\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u001d\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f \u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f#\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f&\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f)\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f,\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\/\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f2\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f5\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f8\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f;\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f>\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fA\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fD\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fG\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fJ\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fM\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fP\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fS\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fV\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fY\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\\\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f_\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fb\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000fe\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fh\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fk\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fn\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fq\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000ft\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fw\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fz\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f}\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0004\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0007\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\n\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\r\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0010\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0013\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0016\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0019\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u001c\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u001f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\"\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f%\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f(\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f+\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f.\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f1\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f4\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f7\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f:\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f=\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f@\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fC\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fF\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fI\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fL\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fO\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fR\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fU\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fX\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f[\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f^\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fa\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fd\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fg\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fj\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fm\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fp\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fs\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fv\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fy\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f|\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0000\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0006\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\t\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0012\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0015\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0018\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u001b\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u001e\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f!\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f$\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f'\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f*\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f-\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f0\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f3\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f6\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f9\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f<\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f?\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fB\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fE\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fH\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fK\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000fN\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fQ\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fT\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fW\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fZ\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f]\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f`\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fc\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000ff\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000fi\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000fl\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fo\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fr\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fu\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fx\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f{\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f~\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000b","old_contents":"\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\f\u0002\u0000\u0000\u0000\u000fAssembly-CSharp\u0004\u0001\u0000\u0000\u0000xSystem.Collections.Generic.List`1[[HexCellInfo, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]\u0003\u0000\u0000\u0000\u0006_items\u0005_size\b_version\u0004\u0000\u0000\rHexCellInfo[]\u0002\u0000\u0000\u0000\b\b\t\u0003\u0000\u0000\u0000,\u0001\u0000\u0000,\u0001\u0000\u0000\u0007\u0003\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0004\u000bHexCellInfo\u0002\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\t\u0005\u0000\u0000\u0000\t\u0006\u0000\u0000\u0000\t\u0007\u0000\u0000\u0000\t\b\u0000\u0000\u0000\t\t\u0000\u0000\u0000\t\n\u0000\u0000\u0000\t\u000b\u0000\u0000\u0000\t\f\u0000\u0000\u0000\t\r\u0000\u0000\u0000\t\u000e\u0000\u0000\u0000\t\u000f\u0000\u0000\u0000\t\u0010\u0000\u0000\u0000\t\u0011\u0000\u0000\u0000\t\u0012\u0000\u0000\u0000\t\u0013\u0000\u0000\u0000\t\u0014\u0000\u0000\u0000\t\u0015\u0000\u0000\u0000\t\u0016\u0000\u0000\u0000\t\u0017\u0000\u0000\u0000\t\u0018\u0000\u0000\u0000\t\u0019\u0000\u0000\u0000\t\u001a\u0000\u0000\u0000\t\u001b\u0000\u0000\u0000\t\u001c\u0000\u0000\u0000\t\u001d\u0000\u0000\u0000\t\u001e\u0000\u0000\u0000\t\u001f\u0000\u0000\u0000\t \u0000\u0000\u0000\t!\u0000\u0000\u0000\t\"\u0000\u0000\u0000\t#\u0000\u0000\u0000\t$\u0000\u0000\u0000\t%\u0000\u0000\u0000\t&\u0000\u0000\u0000\t'\u0000\u0000\u0000\t(\u0000\u0000\u0000\t)\u0000\u0000\u0000\t*\u0000\u0000\u0000\t+\u0000\u0000\u0000\t,\u0000\u0000\u0000\t-\u0000\u0000\u0000\t.\u0000\u0000\u0000\t\/\u0000\u0000\u0000\t0\u0000\u0000\u0000\t1\u0000\u0000\u0000\t2\u0000\u0000\u0000\t3\u0000\u0000\u0000\t4\u0000\u0000\u0000\t5\u0000\u0000\u0000\t6\u0000\u0000\u0000\t7\u0000\u0000\u0000\t8\u0000\u0000\u0000\t9\u0000\u0000\u0000\t:\u0000\u0000\u0000\t;\u0000\u0000\u0000\t<\u0000\u0000\u0000\t=\u0000\u0000\u0000\t>\u0000\u0000\u0000\t?\u0000\u0000\u0000\t@\u0000\u0000\u0000\tA\u0000\u0000\u0000\tB\u0000\u0000\u0000\tC\u0000\u0000\u0000\tD\u0000\u0000\u0000\tE\u0000\u0000\u0000\tF\u0000\u0000\u0000\tG\u0000\u0000\u0000\tH\u0000\u0000\u0000\tI\u0000\u0000\u0000\tJ\u0000\u0000\u0000\tK\u0000\u0000\u0000\tL\u0000\u0000\u0000\tM\u0000\u0000\u0000\tN\u0000\u0000\u0000\tO\u0000\u0000\u0000\tP\u0000\u0000\u0000\tQ\u0000\u0000\u0000\tR\u0000\u0000\u0000\tS\u0000\u0000\u0000\tT\u0000\u0000\u0000\tU\u0000\u0000\u0000\tV\u0000\u0000\u0000\tW\u0000\u0000\u0000\tX\u0000\u0000\u0000\tY\u0000\u0000\u0000\tZ\u0000\u0000\u0000\t[\u0000\u0000\u0000\t\\\u0000\u0000\u0000\t]\u0000\u0000\u0000\t^\u0000\u0000\u0000\t_\u0000\u0000\u0000\t`\u0000\u0000\u0000\ta\u0000\u0000\u0000\tb\u0000\u0000\u0000\tc\u0000\u0000\u0000\td\u0000\u0000\u0000\te\u0000\u0000\u0000\tf\u0000\u0000\u0000\tg\u0000\u0000\u0000\th\u0000\u0000\u0000\ti\u0000\u0000\u0000\tj\u0000\u0000\u0000\tk\u0000\u0000\u0000\tl\u0000\u0000\u0000\tm\u0000\u0000\u0000\tn\u0000\u0000\u0000\to\u0000\u0000\u0000\tp\u0000\u0000\u0000\tq\u0000\u0000\u0000\tr\u0000\u0000\u0000\ts\u0000\u0000\u0000\tt\u0000\u0000\u0000\tu\u0000\u0000\u0000\tv\u0000\u0000\u0000\tw\u0000\u0000\u0000\tx\u0000\u0000\u0000\ty\u0000\u0000\u0000\tz\u0000\u0000\u0000\t{\u0000\u0000\u0000\t|\u0000\u0000\u0000\t}\u0000\u0000\u0000\t~\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0001\u0000\u0000\t\u0001\u0001\u0000\u0000\t\u0002\u0001\u0000\u0000\t\u0003\u0001\u0000\u0000\t\u0004\u0001\u0000\u0000\t\u0005\u0001\u0000\u0000\t\u0006\u0001\u0000\u0000\t\u0007\u0001\u0000\u0000\t\b\u0001\u0000\u0000\t\t\u0001\u0000\u0000\t\n\u0001\u0000\u0000\t\u000b\u0001\u0000\u0000\t\f\u0001\u0000\u0000\t\r\u0001\u0000\u0000\t\u000e\u0001\u0000\u0000\t\u000f\u0001\u0000\u0000\t\u0010\u0001\u0000\u0000\t\u0011\u0001\u0000\u0000\t\u0012\u0001\u0000\u0000\t\u0013\u0001\u0000\u0000\t\u0014\u0001\u0000\u0000\t\u0015\u0001\u0000\u0000\t\u0016\u0001\u0000\u0000\t\u0017\u0001\u0000\u0000\t\u0018\u0001\u0000\u0000\t\u0019\u0001\u0000\u0000\t\u001a\u0001\u0000\u0000\t\u001b\u0001\u0000\u0000\t\u001c\u0001\u0000\u0000\t\u001d\u0001\u0000\u0000\t\u001e\u0001\u0000\u0000\t\u001f\u0001\u0000\u0000\t \u0001\u0000\u0000\t!\u0001\u0000\u0000\t\"\u0001\u0000\u0000\t#\u0001\u0000\u0000\t$\u0001\u0000\u0000\t%\u0001\u0000\u0000\t&\u0001\u0000\u0000\t'\u0001\u0000\u0000\t(\u0001\u0000\u0000\t)\u0001\u0000\u0000\t*\u0001\u0000\u0000\t+\u0001\u0000\u0000\t,\u0001\u0000\u0000\t-\u0001\u0000\u0000\t.\u0001\u0000\u0000\t\/\u0001\u0000\u0000\r\u0005\u0004\u0000\u0000\u0000\u000bHexCellInfo\f\u0000\u0000\u0000\televation\b_myColor\u0010hasIncomingRiver\u0010hasOutgoingRiver\rincomingRiver\routgoingRiver\nwaterLevel\fisUnderWater\bisWalled\nurbanLevel\nplantLevel\tfarmLevel\u0000\u0007\u0000\u0000\u0004\u0004\u0000\u0000\u0000\u0000\u0000\u0000\b\u000b\u0001\u0001\fHexDirection\u0002\u0000\u0000\u0000\fHexDirection\u0002\u0000\u0000\u0000\b\u0001\u0001\b\b\b\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t0\u0001\u0000\u0000\u0000\u0000\u00051\u0001\u0000\u0000\fHexDirection\u0001\u0000\u0000\u0000\u0007value__\u0000\b\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00012\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0005\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t3\u0001\u0000\u0000\u0000\u0000\u00014\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00015\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0006\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t6\u0001\u0000\u0000\u0000\u0000\u00017\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00018\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0007\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t9\u0001\u0000\u0000\u0000\u0000\u0001:\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001;\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\b\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t<\u0001\u0000\u0000\u0000\u0000\u0001=\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001>\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\t\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t?\u0001\u0000\u0000\u0000\u0000\u0001@\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001A\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\n\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tB\u0001\u0000\u0000\u0000\u0000\u0001C\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001D\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000b\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tE\u0001\u0000\u0000\u0000\u0000\u0001F\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001G\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\f\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tH\u0001\u0000\u0000\u0000\u0000\u0001I\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001J\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\r\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tK\u0001\u0000\u0000\u0000\u0000\u0001L\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001M\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000e\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tN\u0001\u0000\u0000\u0000\u0000\u0001O\u0001\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001P\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000f\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tQ\u0001\u0000\u0000\u0000\u0000\u0001R\u0001\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001S\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0010\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tT\u0001\u0000\u0000\u0000\u0000\u0001U\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001V\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0011\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tW\u0001\u0000\u0000\u0000\u0000\u0001X\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001Y\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0012\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tZ\u0001\u0000\u0000\u0000\u0000\u0001[\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\\\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0013\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t]\u0001\u0000\u0000\u0000\u0000\u0001^\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001_\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0014\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t`\u0001\u0000\u0000\u0000\u0000\u0001a\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001b\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0015\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tc\u0001\u0000\u0000\u0000\u0000\u0001d\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001e\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0016\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tf\u0001\u0000\u0000\u0000\u0000\u0001g\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001h\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0017\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\ti\u0001\u0000\u0000\u0000\u0000\u0001j\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001k\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0018\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tl\u0001\u0000\u0000\u0000\u0000\u0001m\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001n\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0019\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\to\u0001\u0000\u0000\u0000\u0000\u0001p\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001q\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001a\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\tr\u0001\u0000\u0000\u0000\u0000\u0001s\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001t\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001b\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\tu\u0001\u0000\u0000\u0000\u0000\u0001v\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001w\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001c\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\tx\u0001\u0000\u0000\u0000\u0000\u0001y\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001z\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001d\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t{\u0001\u0000\u0000\u0000\u0000\u0001|\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001}\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001e\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t~\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001f\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 \u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001!\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\"\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001#\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001$\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001%\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001&\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001'\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001(\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001)\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001*\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001+\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001,\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001-\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001.\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\/\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00010\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00011\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00012\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u00013\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00014\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00015\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00016\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00017\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0001\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00018\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0001\u0000\u0000\u0001\u0001\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00019\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0001\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001:\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001;\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0001\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001<\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0001\u0000\u0000\u0001\u0001\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001=\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0001\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001>\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001?\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001@\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001A\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001B\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001C\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001D\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001E\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001F\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0001G\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001H\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001I\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0000\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001J\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0002\u0000\u0000\u0000\u0000\u0001\u0003\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0004\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001K\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0005\u0002\u0000\u0000\u0000\u0000\u0001\u0006\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0007\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001L\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\b\u0002\u0000\u0000\u0000\u0000\u0001\t\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\n\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001M\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u000b\u0002\u0000\u0000\u0000\u0000\u0001\f\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\r\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001N\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u000e\u0002\u0000\u0000\u0000\u0000\u0001\u000f\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0010\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001O\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0011\u0002\u0000\u0000\u0000\u0000\u0001\u0012\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0013\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001P\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0014\u0002\u0000\u0000\u0000\u0000\u0001\u0015\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0016\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001Q\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0017\u0002\u0000\u0000\u0000\u0000\u0001\u0018\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0019\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001R\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u001a\u0002\u0000\u0000\u0000\u0000\u0001\u001b\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001c\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001S\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u001d\u0002\u0000\u0000\u0000\u0000\u0001\u001e\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001f\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001T\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0002\u0000\u0000\u0000\u0000\u0001!\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\"\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001U\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t#\u0002\u0000\u0000\u0000\u0000\u0001$\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001%\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001V\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t&\u0002\u0000\u0000\u0000\u0000\u0001'\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001(\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001W\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t)\u0002\u0000\u0000\u0000\u0000\u0001*\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001+\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001X\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t,\u0002\u0000\u0000\u0000\u0001\u0001-\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001.\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001Y\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t\/\u0002\u0000\u0000\u0000\u0000\u00010\u0002\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u00011\u0002\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001Z\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t2\u0002\u0000\u0000\u0000\u0000\u00013\u0002\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u00014\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0001[\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t5\u0002\u0000\u0000\u0000\u0000\u00016\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00017\u0002\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\\\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t8\u0002\u0000\u0000\u0000\u0000\u00019\u0002\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001:\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001]\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t;\u0002\u0000\u0000\u0000\u0000\u0001<\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001=\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001^\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t>\u0002\u0000\u0000\u0000\u0000\u0001?\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001@\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001_\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tA\u0002\u0000\u0000\u0000\u0000\u0001B\u0002\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0001C\u0002\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001`\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tD\u0002\u0000\u0000\u0000\u0000\u0001E\u0002\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001F\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001a\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tG\u0002\u0000\u0000\u0000\u0000\u0001H\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001I\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001b\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tJ\u0002\u0000\u0000\u0000\u0000\u0001K\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001L\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001c\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tM\u0002\u0000\u0000\u0000\u0000\u0001N\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001O\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001d\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tP\u0002\u0000\u0000\u0000\u0000\u0001Q\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001R\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001e\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tS\u0002\u0000\u0000\u0000\u0000\u0001T\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001U\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001f\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tV\u0002\u0000\u0000\u0000\u0000\u0001W\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001X\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001g\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tY\u0002\u0000\u0000\u0000\u0000\u0001Z\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001[\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001h\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\\\u0002\u0000\u0000\u0000\u0000\u0001]\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001^\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001i\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t_\u0002\u0000\u0000\u0000\u0000\u0001`\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001a\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001j\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tb\u0002\u0000\u0000\u0000\u0000\u0001c\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001d\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001k\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\te\u0002\u0000\u0000\u0001\u0001\u0001f\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001g\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001l\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\th\u0002\u0000\u0000\u0000\u0000\u0001i\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001j\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001m\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tk\u0002\u0000\u0000\u0000\u0000\u0001l\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001m\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001n\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tn\u0002\u0000\u0000\u0000\u0000\u0001o\u0002\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001p\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001o\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tq\u0002\u0000\u0000\u0000\u0000\u0001r\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001s\u0002\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001p\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tt\u0002\u0000\u0000\u0000\u0000\u0001u\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001v\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001q\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tw\u0002\u0000\u0000\u0000\u0000\u0001x\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001y\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001r\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tz\u0002\u0000\u0000\u0000\u0000\u0001{\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001|\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001s\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t}\u0002\u0000\u0000\u0000\u0000\u0001~\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001t\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001u\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001v\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001w\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0001\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001x\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001y\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001z\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001{\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001|\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001}\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001~\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0002\u0000\u0000\u0001\u0001\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0001\u0001\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0001\u0001\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0001\u0001\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0003\u0000\u0000\u0000\u0000\u0001\u0002\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0003\u0000\u0000\u0001\u0001\u0001\u0005\u0003\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0006\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0007\u0003\u0000\u0000\u0000\u0000\u0001\b\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\t\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\n\u0003\u0000\u0000\u0000\u0000\u0001\u000b\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\f\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\r\u0003\u0000\u0000\u0000\u0000\u0001\u000e\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000f\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0010\u0003\u0000\u0000\u0000\u0000\u0001\u0011\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0012\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0013\u0003\u0000\u0000\u0000\u0000\u0001\u0014\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0015\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0016\u0003\u0000\u0000\u0001\u0001\u0001\u0017\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0018\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0019\u0003\u0000\u0000\u0000\u0000\u0001\u001a\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u001b\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u001c\u0003\u0000\u0000\u0000\u0000\u0001\u001d\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001e\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u001f\u0003\u0000\u0000\u0000\u0000\u0001 \u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001!\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\"\u0003\u0000\u0000\u0000\u0000\u0001#\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001$\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t%\u0003\u0000\u0000\u0000\u0000\u0001&\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001'\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t(\u0003\u0000\u0000\u0000\u0000\u0001)\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001*\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t+\u0003\u0000\u0000\u0000\u0000\u0001,\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001-\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t.\u0003\u0000\u0000\u0000\u0000\u0001\/\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u00010\u0003\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t1\u0003\u0000\u0000\u0000\u0000\u00012\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00013\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\t4\u0003\u0000\u0000\u0000\u0000\u00015\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00016\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t7\u0003\u0000\u0000\u0000\u0000\u00018\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00019\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t:\u0003\u0000\u0000\u0000\u0000\u0001;\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001<\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t=\u0003\u0000\u0000\u0000\u0000\u0001>\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001?\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t@\u0003\u0000\u0000\u0001\u0001\u0001A\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001B\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\tC\u0003\u0000\u0000\u0000\u0000\u0001D\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001E\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tF\u0003\u0000\u0000\u0000\u0000\u0001G\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001H\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tI\u0003\u0000\u0000\u0000\u0000\u0001J\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001K\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tL\u0003\u0000\u0000\u0000\u0000\u0001M\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001N\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tO\u0003\u0000\u0000\u0000\u0000\u0001P\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001Q\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tR\u0003\u0000\u0000\u0001\u0001\u0001S\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0001T\u0003\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tU\u0003\u0000\u0000\u0000\u0000\u0001V\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001W\u0003\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tX\u0003\u0000\u0000\u0000\u0000\u0001Y\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001Z\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t[\u0003\u0000\u0000\u0000\u0000\u0001\\\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001]\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t^\u0003\u0000\u0000\u0000\u0000\u0001_\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001`\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\ta\u0003\u0000\u0000\u0000\u0000\u0001b\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001c\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\td\u0003\u0000\u0000\u0000\u0000\u0001e\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001f\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tg\u0003\u0000\u0000\u0000\u0000\u0001h\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001i\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tj\u0003\u0000\u0000\u0000\u0000\u0001k\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001l\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\tm\u0003\u0000\u0000\u0000\u0000\u0001n\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001o\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\tp\u0003\u0000\u0000\u0000\u0000\u0001q\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001r\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\ts\u0003\u0000\u0000\u0000\u0000\u0001t\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001u\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tv\u0003\u0000\u0000\u0000\u0000\u0001w\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001x\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\ty\u0003\u0000\u0000\u0000\u0000\u0001z\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001{\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\t|\u0003\u0000\u0000\u0001\u0001\u0001}\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001~\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0001\u0001\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\t\u0003\u0000\u0000\u0001\u0001\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0001\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\t\u0003\u0000\u0000\u0001\u0001\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0000\u0004\u0000\u0000\u0000\u0000\u0001\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0005\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0006\u0004\u0000\u0000\u0000\u0000\u0001\u0007\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\b\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\t\u0004\u0000\u0000\u0000\u0000\u0001\n\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000b\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\f\u0004\u0000\u0000\u0000\u0000\u0001\r\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000e\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u000f\u0004\u0000\u0000\u0000\u0000\u0001\u0010\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0011\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0012\u0004\u0000\u0000\u0000\u0000\u0001\u0013\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0014\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0015\u0004\u0000\u0000\u0000\u0000\u0001\u0016\u0004\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0017\u0004\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0018\u0004\u0000\u0000\u0000\u0000\u0001\u0019\u0004\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u001a\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u001b\u0004\u0000\u0000\u0000\u0000\u0001\u001c\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001d\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u001e\u0004\u0000\u0000\u0000\u0000\u0001\u001f\u0004\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001 \u0004\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t!\u0004\u0000\u0000\u0000\u0000\u0001\"\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001#\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t$\u0004\u0000\u0000\u0000\u0000\u0001%\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001&\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t'\u0004\u0000\u0000\u0000\u0000\u0001(\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001)\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t*\u0004\u0000\u0000\u0000\u0000\u0001+\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001,\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\t-\u0004\u0000\u0000\u0000\u0000\u0001.\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\/\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t0\u0004\u0000\u0000\u0000\u0000\u00011\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00012\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0005\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t3\u0004\u0000\u0000\u0001\u0001\u00014\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00015\u0004\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0006\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t6\u0004\u0000\u0000\u0000\u0000\u00017\u0004\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u00018\u0004\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0007\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t9\u0004\u0000\u0000\u0000\u0000\u0001:\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001;\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\b\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t<\u0004\u0000\u0000\u0000\u0000\u0001=\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001>\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\t\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t?\u0004\u0000\u0000\u0000\u0000\u0001@\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001A\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\n\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tB\u0004\u0000\u0000\u0000\u0000\u0001C\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001D\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000b\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tE\u0004\u0000\u0000\u0000\u0000\u0001F\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001G\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tH\u0004\u0000\u0000\u0000\u0000\u0001I\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001J\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\r\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tK\u0004\u0000\u0000\u0000\u0000\u0001L\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001M\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000e\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tN\u0004\u0000\u0000\u0000\u0000\u0001O\u0004\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001P\u0004\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tQ\u0004\u0000\u0000\u0000\u0000\u0001R\u0004\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001S\u0004\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0010\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tT\u0004\u0000\u0000\u0000\u0000\u0001U\u0004\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0001V\u0004\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0011\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tW\u0004\u0000\u0000\u0000\u0000\u0001X\u0004\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001Y\u0004\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0012\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tZ\u0004\u0000\u0000\u0000\u0000\u0001[\u0004\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\\\u0004\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0013\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t]\u0004\u0000\u0000\u0000\u0000\u0001^\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001_\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0014\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t`\u0004\u0000\u0000\u0000\u0000\u0001a\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001b\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0015\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tc\u0004\u0000\u0000\u0000\u0000\u0001d\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001e\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0016\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tf\u0004\u0000\u0000\u0000\u0000\u0001g\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001h\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0017\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\ti\u0004\u0000\u0000\u0000\u0000\u0001j\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001k\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0018\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tl\u0004\u0000\u0000\u0000\u0000\u0001m\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001n\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0019\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\to\u0004\u0000\u0000\u0000\u0001\u0001p\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001q\u0004\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001a\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tr\u0004\u0000\u0000\u0000\u0000\u0001s\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001t\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001b\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tu\u0004\u0000\u0000\u0000\u0000\u0001v\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001w\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001c\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tx\u0004\u0000\u0000\u0000\u0000\u0001y\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001z\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001d\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t{\u0004\u0000\u0000\u0000\u0000\u0001|\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001}\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001e\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t~\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 \u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001!\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\"\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001#\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001$\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001%\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001&\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001'\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001(\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001)\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001*\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001+\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001,\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001-\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001.\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\/\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u000f0\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f3\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f6\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f9\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f<\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f?\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fB\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fE\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fH\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fK\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fN\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fQ\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fT\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fW\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fZ\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f]\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f`\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fc\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000ff\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fi\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fl\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fo\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fr\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fu\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fx\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f{\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f~\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0005\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\b\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u000b\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u000e\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0011\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0014\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0017\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u001a\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u001d\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f \u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f#\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f&\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f)\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f,\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\/\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f2\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f5\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f8\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f;\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f>\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fA\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fD\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fG\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fJ\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fM\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fP\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fS\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fV\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fY\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\\\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f_\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fb\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fe\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fh\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fk\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fn\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fq\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000ft\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fw\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fz\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f}\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0007\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\n\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\r\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0010\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0013\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0016\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0019\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u001c\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u001f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\"\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f%\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f(\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f+\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f.\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f1\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f4\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f7\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f:\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f=\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f@\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fC\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fF\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fI\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fL\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fO\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fR\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fU\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fX\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f[\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f^\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fa\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fd\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fg\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fj\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fm\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fp\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fs\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fv\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fy\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f|\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0000\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0006\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\t\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0012\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0015\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0018\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u001b\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u001e\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f!\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f$\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f'\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f*\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f-\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f0\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f3\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f6\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f9\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f<\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f?\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fB\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fE\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fH\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fK\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fN\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fQ\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fT\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fW\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fZ\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f]\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f`\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fc\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000ff\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fi\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fl\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000fo\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000fr\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000fu\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000fx\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f{\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f~\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000b","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"a3161604947b9b35d7eac9063239b68181eefd14","subject":"mainPuzzle off by default. seed random number gen. save puzzles by seed into SavedPuzzles\/. GridMan in charge of its own shape.","message":"mainPuzzle off by default. seed random number gen. save puzzles by seed into SavedPuzzles\/. GridMan in charge of its own shape.\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/GridMan.gd","new_file":"src\/scripts\/GridMan.gd","new_contents":"extends Spatial\n\n# Is there a better way to do this?\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\n# Shape dictionary to access blocks quickly by position.\nvar shape = {}\n\n# Block selection handling.\nvar offClick = false\nvar selectedBlocks = []\n\n# Puzzle vars.\nvar puzzle\nvar puzzleLoaded = false\n\n# Beam stuff.\nconst beamScn = preload( \"res:\/\/blocks\/block.scn\" )\nconst Beam = preload(\"res:\/\/scripts\/Blocks\/Beam.gd\")\n\n# sounds\nvar samplePlayer = SamplePlayer.new()\n\nfunc addPickledBlock(block):\n\t# TODO add to puzzle\n\tvar b = block.toNode()\n\n\tprint (\"ADDED\")\n\tshape[b.blockPos] = b\n\n\t# TODO any special treatment for the wild blocks?\n\t# TODO keep track of puzzle.lasers ? How to?\n\n\tif puzzleLoaded:\n\t\t# keep pickled block\n\t\tpuzzle.blocks.append(block)\n\n\t\t# keep track of puzzle.pairCounts\n\t\tvar layer = calcBlockLayerVec(b.blockPos)\n\t\tif b.getBlockType() == 2:\n\t\t\twhile puzzle.pairCount.size() <= layer:\n\t\t\t\tpuzzle.pairCount.append(0)\n\t\t\tpuzzle.pairCount[layer] += 0.5\n\n\n\tadd_child(b)\n\nfunc get_block(pos):\n\tif shape.has(pos):\n\t\treturn shape[pos]\n\telse:\n\t\treturn null\n\n# unused key argument needed for the tween_complete signal\nfunc remove_block(block_node, key=null):\n\tif block_node == null:\n\t\treturn\n\tprint (\"REMOVED\")\n\n\tshape[block_node.blockPos] = null\n\tfor child in block_node.get_children():\n\t\tblock_node.remove_and_delete_child(child)\n\tremove_and_delete_child(block_node)\n\n# Sets the puzzle for this GridMan.\nfunc set_puzzle(puzz):\n\t# delete all current nodes\n\tfor pos in shape:\n\t\tremove_block(shape[pos])\n\tpuzzleLoaded = false\n\n\t# Store the puzzle.\n\tpuzzle = puzz\n\n\t# Set the camera range to be relative to the layer count.\n\tvar cam = get_tree().get_root().get_node( \"Spatial\" ).get_node( \"Camera\" )\n\tprint( cam )\n\tvar totalSize = ( puzzle.puzzleLayers * 2 + 1 )\n\tcam.distance.val = 4.5 * totalSize\n\tcam.distance.min_ = 3 * totalSize\n\tcam.distance.max_ = 10 * totalSize\n\tcam.recalculate_camera()\n\n\t\t# # I can do my own counting!\n\t# needed for adding blocks in the editor\n\tfor block in puzzle.blocks:\n\t\t# Create a block node, add it to the tree\n\t\taddPickledBlock(block)\n\tpuzzleLoaded = true\n\n# Clears any selected blocks. WE SHOULD FIX THIS, THERE CAN ONLY BE ONE BLOCK SELECTED AT ANY ONE TIME, NO NEED FOR AN ARRAY!\nfunc clearSelection():\n\tfor bl in selectedBlocks:\n\t\tvar blo = get_node( bl )\n\t\tblo.setSelected(false)\n\t\tblo.scaleTweenNode(1.0).start()\n\tselectedBlocks = []\n\n# Add the selected block to the selected list. WE SHOULD FIX THIS, IT ONLY NEEDS TO STORE IT, NOT AN ARRAY!\nfunc addSelected(bl):\n\tselectedBlocks.append(bl)\n\n# Used for the multiplayer mode to force click a block on their side.\nfunc forceClickBlock( pos ):\n\tshape[pos].forceClick()\n\nfunc clickBlock( name ):\n\t#now check if that was the second block we picked. If it was, we want to\n\t#unselect the blocks again\n\tif (offClick):\n\t\toffClick = false\n\t\taddSelected(name)\n\t\tclearSelection()\n\telse:\n\t\toffClick = true;\n\t\taddSelected(name)\n\n# Calculates the layer that a block is on.\n# COPY OF FUNCTION IN PUZZLEMAN, IS THERE A BETTER WAY TO DO THIS?!\nfunc calcBlockLayer( x, y, z ):\n\treturn max( max( abs( x ), abs( y ) ), abs( z ) )\nfunc calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n# Handles keeping track of pairs being removed.\nfunc popPair( pos ):\n\tvar blayer = calcBlockLayerVec( pos )\n\tpuzzle.pairCount[blayer] -= 1\n\n\tif( puzzle.pairCount[blayer] == 0 ):\n\t\tprint(\"LAYER CLEARED\")\n\t\tif blayer == 1:\n\t\t\tprint( \"GAME OVER!\" )\n\t\t\tvar pauseMenu = get_tree().get_root().get_node( \"Spatial\" ).get_node( \"Camera\" ).pauseMenu\n\t\t\tpauseMenu.set_text(\"GAME OVER\\nSCORE:1,000,000\")\n\t\t\t# TODO set timeout!!!\n\t\t\tpauseMenu.popup_centered()\n\n\t\tfor b in shape:\n\t\t\tif not ( shape[b] == null ):\n\t\t\t\tif calcBlockLayerVec( b ) == blayer:\n\t\t\t\t\tif shape[b].getBlockType() == BLOCK_LASER:\n\t\t\t\t\t\tshape[b].forceActivate()\n\n\t\t# Fire beams.\n\t\tvar beamNum = 0\n\t\tfor l in range( puzzle.lasers.size() ):\n\t\t\tif calcBlockLayerVec( puzzle.lasers[l][0] ) == blayer:\n\t\t\t\t# Firin mah lazerz!\n\t\t\t\tvar beam = beamScn.instance()\n\n\t\t\t\tbeam.set_name( str(blayer) + \"_beam_\" + str(beamNum) )\n\t\t\t\tbeamNum += 1\n\t\t\t\tbeam.set_script( Beam )\n\n\t\t\t\tadd_child( beam )\n\t\t\t\tbeam.fire( puzzle.lasers[l][0], puzzle.lasers[l][1] )\n\n\t\t\t\tsamplePlayer.play( \"soundslikewillem_hitting_slinky\" )\n\n\nfunc _init():\n\t# Load sound\n\tsamplePlayer.set_voice_count(10)\n\tsamplePlayer.set_sample_library(ResourceLoader.load(\"new_samplelibrary.xml\"))\n\tprint(\"GridMan initialized\")\n\n","old_contents":"extends Spatial\n\n# Is there a better way to do this?\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\n# Shape dictionary to access blocks quickly by position.\nvar shape = {}\n\n# Block selection handling.\nvar offClick = false\nvar selectedBlocks = []\n\n# Puzzle vars.\nvar puzzle\n\n# Beam stuff.\nconst beamScn = preload( \"res:\/\/blocks\/block.scn\" )\nconst Beam = preload(\"res:\/\/scripts\/Blocks\/Beam.gd\")\n\n# sounds\nvar samplePlayer = SamplePlayer.new()\n\nfunc addPickledBlock(block):\n\t# TODO add to puzzle\n\tvar b = block.toNode()\n\n\tprint (\"ADDED\")\n\tshape[b.blockPos] = b\n\n\t# TODO any special treatment for the wild blocks?\n\t# TODO keep track of puzzle.lasers ? How to?\n\n\tif not puzzleLoaded:\n\t\t# keep pickled block\n\t\tpuzzle.blocks.append(block)\n\n\t\t# keep track of puzzle.pairCounts\n\t\tvar layer = calcBlockLayerVec(b.blockPos)\n\t\tif b.getBlockType() == 2:\n\t\t\twhile puzzle.pairCount.size() <= layer:\n\t\t\t\tpuzzle.pairCount.append(0)\n\t\t\tpuzzle.pairCount[layer] += 0.5\n\n\n\tadd_child(b)\n\nfunc get_block(pos):\n\tif shape.has(pos):\n\t\treturn shape[pos]\n\telse:\n\t\treturn null\n\n# unused key argument needed for the tween_complete signal\nfunc remove_block(block_node, key=null):\n\tif block_node == null:\n\t\treturn\n\tprint (\"REMOVED\")\n\n\tshape[block_node.blockPos] = null\n\tfor child in block_node.get_children():\n\t\tblock_node.remove_and_delete_child(child)\n\tremove_and_delete_child(block_node)\n\n# Sets the puzzle for this GridMan.\nfunc set_puzzle(puzz):\n\t# delete all current nodes\n\tfor pos in shape:\n\t\tremove_block(shape[pos])\n\tpuzzleLoaded = false\n\n\t# Store the puzzle.\n\tpuzzle = puzz\n\n\t# Set the camera range to be relative to the layer count.\n\tvar cam = get_tree().get_root().get_node( \"Spatial\" ).get_node( \"Camera\" )\n\tprint( cam )\n\tvar totalSize = ( puzzle.puzzleLayers * 2 + 1 )\n\tcam.distance.val = 4.5 * totalSize\n\tcam.distance.min_ = 3 * totalSize\n\tcam.distance.max_ = 10 * totalSize\n\tcam.recalculate_camera()\n\n\t\t# # I can do my own counting!\n\t# needed for adding blocks in the editor\n\tfor block in puzzle.blocks:\n\t\t# Create a block node, add it to the tree\n\t\taddPickledBlock(block)\n\tpuzzleLoaded = true\n\n# Clears any selected blocks. WE SHOULD FIX THIS, THERE CAN ONLY BE ONE BLOCK SELECTED AT ANY ONE TIME, NO NEED FOR AN ARRAY!\nfunc clearSelection():\n\tfor bl in selectedBlocks:\n\t\tvar blo = get_node( bl )\n\t\tblo.setSelected(false)\n\t\tblo.scaleTweenNode(1.0).start()\n\tselectedBlocks = []\n\n# Add the selected block to the selected list. WE SHOULD FIX THIS, IT ONLY NEEDS TO STORE IT, NOT AN ARRAY!\nfunc addSelected(bl):\n\tselectedBlocks.append(bl)\n\n# Used for the multiplayer mode to force click a block on their side.\nfunc forceClickBlock( pos ):\n\tshape[pos].forceClick()\n\nfunc clickBlock( name ):\n\t#now check if that was the second block we picked. If it was, we want to\n\t#unselect the blocks again\n\tif (offClick):\n\t\toffClick = false\n\t\taddSelected(name)\n\t\tclearSelection()\n\telse:\n\t\toffClick = true;\n\t\taddSelected(name)\n\n# Calculates the layer that a block is on.\n# COPY OF FUNCTION IN PUZZLEMAN, IS THERE A BETTER WAY TO DO THIS?!\nfunc calcBlockLayer( x, y, z ):\n\treturn max( max( abs( x ), abs( y ) ), abs( z ) )\nfunc calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n# Handles keeping track of pairs being removed.\nfunc popPair( pos ):\n\tvar blayer = calcBlockLayerVec( pos )\n\tpuzzle.pairCount[blayer] -= 1\n\n\tif( puzzle.pairCount[blayer] == 0 ):\n\t\tprint(\"LAYER CLEARED\")\n\t\tif blayer == 1:\n\t\t\tprint( \"GAME OVER!\" )\n\t\t\tvar pauseMenu = get_tree().get_root().get_node( \"Spatial\" ).get_node( \"Camera\" ).pauseMenu\n\t\t\tpauseMenu.set_text(\"GAME OVER\\nSCORE:1,000,000\")\n\t\t\t# TODO set timeout!!!\n\t\t\tpauseMenu.popup_centered()\n\n\t\tfor b in shape:\n\t\t\tif not ( shape[b] == null ):\n\t\t\t\tif calcBlockLayerVec( b ) == blayer:\n\t\t\t\t\tif shape[b].getBlockType() == BLOCK_LASER:\n\t\t\t\t\t\tshape[b].forceActivate()\n\n\t\t# Fire beams.\n\t\tvar beamNum = 0\n\t\tfor l in range( puzzle.lasers.size() ):\n\t\t\tif calcBlockLayerVec( puzzle.lasers[l][0] ) == blayer:\n\t\t\t\t# Firin mah lazerz!\n\t\t\t\tvar beam = beamScn.instance()\n\n\t\t\t\tbeam.set_name( str(blayer) + \"_beam_\" + str(beamNum) )\n\t\t\t\tbeamNum += 1\n\t\t\t\tbeam.set_script( Beam )\n\n\t\t\t\tadd_child( beam )\n\t\t\t\tbeam.fire( puzzle.lasers[l][0], puzzle.lasers[l][1] )\n\n\t\t\t\tsamplePlayer.play( \"soundslikewillem_hitting_slinky\" )\n\n\nfunc _init():\n\t# Load sound\n\tsamplePlayer.set_voice_count(10)\n\tsamplePlayer.set_sample_library(ResourceLoader.load(\"new_samplelibrary.xml\"))\n\tprint(\"GridMan initialized\")\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"7e19714e927584b8f583d5e6fccee075f0bf9d69","subject":"fix : character sprite flips slide while falling and moving in an opposite direction","message":"fix : character sprite flips slide while falling and moving in an opposite direction\n","repos":"arnaudcoj\/godot_game_jam_2016,arnaudcoj\/godot_game_jam_2016","old_file":"sources\/scripts\/player\/player_controls.gd","new_file":"sources\/scripts\/player\/player_controls.gd","new_contents":"extends Node\n\nsignal controls_changed\n\nvar debug = false\n\nconst CONTROL_UP = \"move_up\"\nconst CONTROL_DOWN = \"move_down\"\nconst CONTROL_LEFT = \"move_left\"\nconst CONTROL_RIGHT = \"move_right\"\nconst CONTROL_RUN = \"run\"\nconst CONTROL_JUMP = \"jump\"\n\nexport(String, \"move_up\", \"move_down\", \"move_left\", \"move_right\", \"run\", \"jump\") var control_1 = \"move_right\"\nexport(String, \"move_up\", \"move_down\", \"move_left\", \"move_right\", \"run\", \"jump\") var control_2 = \"move_down\"\n\nonready var climb_area = preload(\"res:\/\/sources\/scripts\/levels\/climb_area.gd\")\n\nonready var player_sprites = get_node(\"sprites\")\nonready var interaction_area = get_node(\"interaction_area\")\n\nconst WALK_SPEED = 200\nconst JUMP_SPEED = 300\nconst RUN_SPEED = 500\nconst CLIMB_SPEED = 200\nconst GROUND_FRICTION_MULTIPLIER = 0.7\nconst GROUND_ACCELERATION_MULTIPLIER = 0.2\nconst AIR_FRICTION_MULTIPLIER = 0.95\nconst AIR_DIRECTION_MULTIPLIER = 0.15\nconst JUMP_TIME_MAX = 0.2\nconst FALLING_JUMP_DELAY = 0.2\n\nvar jumping = false\nvar jump_time = 0\nvar falling_time = 0\n\nconst IDLE = 0\nconst WALKING = 1\nconst RUNNING = 2\nconst JUMPING = 3\nconst FALLING = 4\nconst CLIMBING = 5\nvar fsm = IDLE\n\nvar touchscreen_left = -1\nvar touchscreen_right = -1\n\nconst JUMP_NOT_PRESSED = -1\nconst JUMP_PRESSED_LEFT = 0\nconst JUMP_PRESSED_RIGHT = 1\nvar jump_pressed = JUMP_NOT_PRESSED\n\nfunc _ready():\n\tset_process(true)\n\tset_process_input(true)\n\t\nfunc _input(event):\n\tif event.type == InputEvent.SCREEN_TOUCH:\n\t\tif event.pressed:\n\t\t\tif event.pos.y > 200:\n\t\t\t\tif event.pos.x > 1024 \/ 2 && touchscreen_right == -1:\n\t\t\t\t\ttouchscreen_right = event.index\n\t\t\t\telif event.pos.x <= 1024 \/ 2 && touchscreen_left == -1:\n\t\t\t\t\ttouchscreen_left = event.index\n\t\telse:\n\t\t\tif event.index == touchscreen_right:\n\t\t\t\ttouchscreen_right = -1\n\t\t\telif event.index == touchscreen_left:\n\t\t\t\ttouchscreen_left = -1\n\t\t\n\t\t\t#if we release jump button we can jump again\n\t\t\tif touchscreen_left == -1 && jump_pressed == JUMP_PRESSED_LEFT:\n\t\t\t\tjump_pressed = JUMP_NOT_PRESSED\n\t\t\telif touchscreen_right == -1 && jump_pressed == JUMP_PRESSED_RIGHT:\n\t\t\t\tjump_pressed = JUMP_NOT_PRESSED\n\telif event.type == InputEvent.KEY:\n\t\tif event.is_action_released(\"jump\"):\n\t\t\tjump_pressed = JUMP_NOT_PRESSED\n\t\nfunc release_controls():\n\ttouchscreen_right = -1\n\ttouchscreen_left = -1\n\t\nfunc _integrate_forces(state):\n\tif fsm == IDLE:\n\t\tintegrate_idle(state)\n\telif fsm == WALKING:\n\t\tintegrate_walking(state)\n\telif fsm == RUNNING:\n\t\tintegrate_running(state)\n\telif fsm == JUMPING:\n\t\tintegrate_jumping(state)\n\telif fsm == FALLING:\n\t\tintegrate_falling(state)\n\telif fsm == CLIMBING:\n\t\tintegrate_climbing(state)\n\t\t\nfunc integrate_idle(state):\n\tplayer_sprites.play(\"stand\")\n\tvar velocity = state.get_linear_velocity()\n\tvelocity.x *= GROUND_FRICTION_MULTIPLIER\n\tstate.set_linear_velocity(velocity)\n\nfunc integrate_walking(state):\n\tplayer_sprites.play(\"walk\")\n\tvar velocity = state.get_linear_velocity()\n\t\n\tif abs(velocity.x) > WALK_SPEED:\n\t\tif is_action_pressed_and_available(CONTROL_LEFT):\n\t\t\tplayer_sprites.set_flip_h(true)\n\t\telif is_action_pressed_and_available(CONTROL_RIGHT):\n\t\t\tplayer_sprites.set_flip_h(false)\n\t\tvelocity.x = clamp(velocity.x * (1 - GROUND_ACCELERATION_MULTIPLIER), -RUN_SPEED, RUN_SPEED)\n\telse:\n\t\tif is_action_pressed_and_available(CONTROL_LEFT):\n\t\t\tvelocity.x -= WALK_SPEED * GROUND_ACCELERATION_MULTIPLIER\n\t\t\tplayer_sprites.set_flip_h(true)\n\t\telif is_action_pressed_and_available(CONTROL_RIGHT):\n\t\t\tvelocity.x += WALK_SPEED * GROUND_ACCELERATION_MULTIPLIER\n\t\t\tplayer_sprites.set_flip_h(false)\n\n\t\tvelocity.x = clamp(velocity.x, -WALK_SPEED, WALK_SPEED)\n\n\tstate.set_linear_velocity(velocity)\n\t\t\nfunc integrate_running(state):\n\tplayer_sprites.play(\"walk\")\n\tvar velocity = state.get_linear_velocity()\n\t\n\tif is_action_pressed_and_available(CONTROL_LEFT):\n\t\tvelocity.x -= RUN_SPEED * GROUND_ACCELERATION_MULTIPLIER\n\t\tplayer_sprites.set_flip_h(true)\n\telif is_action_pressed_and_available(CONTROL_RIGHT):\n\t\tvelocity.x += RUN_SPEED * GROUND_ACCELERATION_MULTIPLIER\n\t\tplayer_sprites.set_flip_h(false)\n\t\t\n\tvelocity.x = clamp(velocity.x, -RUN_SPEED, RUN_SPEED)\n\t\n\tstate.set_linear_velocity(velocity)\n\t\t\nfunc integrate_falling(state):\n\tplayer_sprites.play(\"jump\")\n\tvar velocity = state.get_linear_velocity()\n\t\n\tif velocity.x > -WALK_SPEED && is_action_pressed_and_available(CONTROL_LEFT):\n\t\tvelocity.x -= WALK_SPEED * AIR_DIRECTION_MULTIPLIER\n\telif velocity.x < WALK_SPEED && is_action_pressed_and_available(CONTROL_RIGHT):\n\t\tvelocity.x += WALK_SPEED * AIR_DIRECTION_MULTIPLIER\n\telif !is_action_pressed_and_available(CONTROL_LEFT) && !is_action_pressed_and_available(CONTROL_RIGHT):\n\t\tvelocity.x *= AIR_FRICTION_MULTIPLIER\n\t\t\n\tvelocity.x = clamp(velocity.x, -RUN_SPEED, RUN_SPEED)\n\tstate.set_linear_velocity(velocity)\n\t\nfunc integrate_jumping(state):\n\tplayer_sprites.play(\"jump\")\n\tvar velocity = state.get_linear_velocity()\n\t\n\tif velocity.x > -WALK_SPEED && is_action_pressed_and_available(CONTROL_LEFT):\n\t\tplayer_sprites.set_flip_h(true)\n\t\tvelocity.x -= WALK_SPEED * AIR_DIRECTION_MULTIPLIER\n\telif velocity.x < WALK_SPEED && is_action_pressed_and_available(CONTROL_RIGHT):\n\t\tplayer_sprites.set_flip_h(false)\n\t\tvelocity.x += WALK_SPEED * AIR_DIRECTION_MULTIPLIER\n\telif !is_action_pressed_and_available(CONTROL_LEFT) && !is_action_pressed_and_available(CONTROL_RIGHT):\n\t\tvelocity.x *= AIR_FRICTION_MULTIPLIER\n\t\t\n\tvelocity.x = clamp(velocity.x, -RUN_SPEED, RUN_SPEED)\n\t\n\tvelocity.y = -JUMP_SPEED\n\tstate.set_linear_velocity(velocity)\n\nfunc integrate_climbing(state):\n\tplayer_sprites.play(\"jump\")\n\tvar velocity = state.get_linear_velocity()\n\t\n\tif is_action_pressed_and_available(CONTROL_UP):\n\t\tvelocity.y = -CLIMB_SPEED\n\telif is_action_pressed_and_available(CONTROL_DOWN):\n\t\tvelocity.y = CLIMB_SPEED\n\t\n\tif is_action_pressed_and_available(CONTROL_LEFT):\n\t\tvelocity.x = - WALK_SPEED * 0.6\n\t\tplayer_sprites.set_flip_h(true)\n\telif is_action_pressed_and_available(CONTROL_RIGHT):\n\t\tvelocity.x = WALK_SPEED * 0.6\n\t\tplayer_sprites.set_flip_h(false)\n\telse:\n\t\tvelocity.x = 0\n\t\n\tstate.set_linear_velocity(velocity)\n\nfunc _process(delta):\n\tvar can_climb = false\n\t\n\tvar overlapping_areas = interaction_area.get_overlapping_areas()\n\t\n\tfor area in overlapping_areas:\n\t\tif can_climb:\n\t\t\tbreak\n\t\tcan_climb = area extends climb_area\n\n\tif fsm == IDLE:\n\t\tif is_action_pressed_and_available(CONTROL_JUMP) && jump_pressed == JUMP_NOT_PRESSED:\n\t\t\tfsm = JUMPING\n\t\t\tset_jump_pressed()\n\t\t\tif debug: print(\"idle -> jump\")\n\t\telif is_action_pressed_and_available(CONTROL_LEFT) || is_action_pressed_and_available(CONTROL_RIGHT):\n\t\t\tfsm = WALKING\n\t\t\tif debug: print(\"idle -> walk\")\n\t\telif can_climb && ((is_action_pressed_and_available(CONTROL_UP) && !test_motion(Vector2(0,-5))) || (is_action_pressed_and_available(CONTROL_DOWN) && !test_motion(Vector2(0,5)))):\n\t\t\t#check if can climb and if thera are obstacles where we want to climb\n\t\t\tfsm = CLIMBING\n\t\t\tif debug: print(\"idle -> climb\")\n\t\telif !test_motion(Vector2(0,5)):\n\t\t\tfsm = FALLING\n\t\t\tif debug: print(\"idle -> fall\")\n\t\t\t\n\telif fsm == WALKING:\n\t\tif !is_action_pressed_and_available(CONTROL_LEFT) && !is_action_pressed_and_available(CONTROL_RIGHT):\n\t\t\tfsm = IDLE\n\t\t\tif debug: print(\"walk -> idle\")\n\t\telif is_action_pressed_and_available(CONTROL_RUN):\n\t\t\tfsm = RUNNING\n\t\t\tif debug: print(\"walk -> run\")\n\t\telif is_action_pressed_and_available(CONTROL_JUMP) && jump_pressed == JUMP_NOT_PRESSED:\n\t\t\tfsm = JUMPING\n\t\t\tset_jump_pressed()\n\t\t\tif debug: print(\"walk -> jump\")\n\t\telif can_climb && ((is_action_pressed_and_available(CONTROL_UP) && !test_motion(Vector2(0,-5))) || (is_action_pressed_and_available(CONTROL_DOWN) && !test_motion(Vector2(0,5)))):\n\t\t\tfsm = CLIMBING\n\t\t\tif debug: print(\"walk -> climb\")\n\t\telif !test_motion(Vector2(0,5)):\n\t\t\tfsm = FALLING\n\t\t\tif debug: print(\"walk -> fall\")\n\t\t\t\n\telif fsm == RUNNING:\n\t\tif !is_action_pressed_and_available(CONTROL_RUN):\n\t\t\tfsm = WALKING\n\t\t\tif debug: print(\"run -> walk\")\n\t\telif !is_action_pressed_and_available(CONTROL_LEFT) && !is_action_pressed_and_available(CONTROL_RIGHT):\n\t\t\tfsm = IDLE\n\t\t\tif debug: print(\"run -> idle\")\n\t\telif is_action_pressed_and_available(CONTROL_JUMP) && jump_pressed == JUMP_NOT_PRESSED :\n\t\t\tfsm = JUMPING\n\t\t\tset_jump_pressed()\n\t\t\tif debug: print(\"run -> jump\")\n\t\telif can_climb && ((is_action_pressed_and_available(CONTROL_UP) && !test_motion(Vector2(0,-5))) || (is_action_pressed_and_available(CONTROL_DOWN) && !test_motion(Vector2(0,5)))):\n\t\t\t#check if can climb and if thera are obstacles where we want to climb\n\t\t\tfsm = CLIMBING\n\t\t\tif debug: print(\"run -> climb\")\n\t\telif !test_motion(Vector2(0,5)):\n\t\t\tfsm = FALLING\n\t\t\tif debug: print(\"run -> fall\")\n\t\t\t\n\telif fsm == CLIMBING:\n\t\tif !can_climb:\n\t\t\tfsm = FALLING\n\t\t\tif debug: print(\"climb -> fall\")\n\t\telif is_action_pressed_and_available(CONTROL_JUMP) && jump_pressed == JUMP_NOT_PRESSED :\n\t\t\tfsm = JUMPING\n\t\t\tset_jump_pressed()\n\t\t\tif debug: print(\"climb -> jump\")\n\t\telif !is_action_pressed_and_available(CONTROL_UP) && !is_action_pressed_and_available(CONTROL_DOWN) && test_motion(Vector2(0,5)):\n\t\t\tfsm = IDLE\n\t\t\tif debug: print(\"climb -> idle\")\n\t\t\t\n\telif fsm == FALLING:\n\t\tfalling_time += delta\n\t\tif can_climb && ((is_action_pressed_and_available(CONTROL_UP) && !test_motion(Vector2(0,-5))) || (is_action_pressed_and_available(CONTROL_DOWN) && !test_motion(Vector2(0,5)))):\n\t\t\t#check if can climb and if thera are obstacles where we want to climb\n\t\t\tfsm = CLIMBING\n\t\t\tfalling_time = 0\n\t\t\tif debug: print(\"fall -> climb\")\n\t\telif test_motion(Vector2(0,5)):\n\t\t\tfsm = IDLE\n\t\t\tfalling_time = 0\n\t\t\tif debug: print(\"fall -> idle\")\n\t\telif is_action_pressed_and_available(CONTROL_JUMP) && jump_pressed == JUMP_NOT_PRESSED && falling_time < FALLING_JUMP_DELAY:\n\t\t\tfsm = JUMPING\n\t\t\tset_jump_pressed()\n\t\t\tif debug: print(\"fall -> jump\")\n\t\t\t\n\telif fsm == JUMPING:\n\t\tjump_time += delta\n\t\tif !is_action_pressed_and_available(CONTROL_JUMP) || jump_time > JUMP_TIME_MAX:\n\t\t\tfsm = FALLING\n\t\t\tjump_time = 0\n\t\t\tfalling_time = FALLING_JUMP_DELAY\n\t\t\tif debug: print(\"jump -> fall\")\n\t\t\t\nfunc is_action_pressed_and_available(action):\n\treturn ((action == control_1 || action == control_2) && Input.is_action_pressed(action)) || (touchscreen_left != -1 && action == control_1) || (touchscreen_right != -1 && action == control_2)\n\nfunc change_controls(control_1, control_2):\n\tself.control_1 = control_1\n\tself.control_2 = control_2\n\temit_signal(\"controls_changed\", self)\n\nfunc set_jump_pressed():\n\tif jump_pressed == JUMP_NOT_PRESSED:\n\t\tif control_1 == \"jump\":\n\t\t\tjump_pressed = JUMP_PRESSED_LEFT\n\t\telif control_2 == \"jump\":\n\t\t\tjump_pressed = JUMP_PRESSED_RIGHT","old_contents":"extends Node\n\nsignal controls_changed\n\nvar debug = false\n\nconst CONTROL_UP = \"move_up\"\nconst CONTROL_DOWN = \"move_down\"\nconst CONTROL_LEFT = \"move_left\"\nconst CONTROL_RIGHT = \"move_right\"\nconst CONTROL_RUN = \"run\"\nconst CONTROL_JUMP = \"jump\"\n\nexport(String, \"move_up\", \"move_down\", \"move_left\", \"move_right\", \"run\", \"jump\") var control_1 = \"move_right\"\nexport(String, \"move_up\", \"move_down\", \"move_left\", \"move_right\", \"run\", \"jump\") var control_2 = \"move_down\"\n\nonready var climb_area = preload(\"res:\/\/sources\/scripts\/levels\/climb_area.gd\")\n\nonready var player_sprites = get_node(\"sprites\")\nonready var interaction_area = get_node(\"interaction_area\")\n\nconst WALK_SPEED = 200\nconst JUMP_SPEED = 300\nconst RUN_SPEED = 500\nconst CLIMB_SPEED = 200\nconst GROUND_FRICTION_MULTIPLIER = 0.7\nconst GROUND_ACCELERATION_MULTIPLIER = 0.2\nconst AIR_FRICTION_MULTIPLIER = 0.95\nconst AIR_DIRECTION_MULTIPLIER = 0.15\nconst JUMP_TIME_MAX = 0.2\nconst FALLING_JUMP_DELAY = 0.2\n\nvar jumping = false\nvar jump_time = 0\nvar falling_time = 0\n\nconst IDLE = 0\nconst WALKING = 1\nconst RUNNING = 2\nconst JUMPING = 3\nconst FALLING = 4\nconst CLIMBING = 5\nvar fsm = IDLE\n\nvar touchscreen_left = -1\nvar touchscreen_right = -1\n\nconst JUMP_NOT_PRESSED = -1\nconst JUMP_PRESSED_LEFT = 0\nconst JUMP_PRESSED_RIGHT = 1\nvar jump_pressed = JUMP_NOT_PRESSED\n\nfunc _ready():\n\tset_process(true)\n\tset_process_input(true)\n\t\nfunc _input(event):\n\tif event.type == InputEvent.SCREEN_TOUCH:\n\t\tif event.pressed:\n\t\t\tif event.pos.y > 200:\n\t\t\t\tif event.pos.x > 1024 \/ 2 && touchscreen_right == -1:\n\t\t\t\t\ttouchscreen_right = event.index\n\t\t\t\telif event.pos.x <= 1024 \/ 2 && touchscreen_left == -1:\n\t\t\t\t\ttouchscreen_left = event.index\n\t\telse:\n\t\t\tif event.index == touchscreen_right:\n\t\t\t\ttouchscreen_right = -1\n\t\t\telif event.index == touchscreen_left:\n\t\t\t\ttouchscreen_left = -1\n\t\t\n\t\t\t#if we release jump button we can jump again\n\t\t\tif touchscreen_left == -1 && jump_pressed == JUMP_PRESSED_LEFT:\n\t\t\t\tjump_pressed = JUMP_NOT_PRESSED\n\t\t\telif touchscreen_right == -1 && jump_pressed == JUMP_PRESSED_RIGHT:\n\t\t\t\tjump_pressed = JUMP_NOT_PRESSED\n\telif event.type == InputEvent.KEY:\n\t\tif event.is_action_released(\"jump\"):\n\t\t\tjump_pressed = JUMP_NOT_PRESSED\n\t\nfunc release_controls():\n\ttouchscreen_right = -1\n\ttouchscreen_left = -1\n\t\nfunc _integrate_forces(state):\n\tif fsm == IDLE:\n\t\tintegrate_idle(state)\n\telif fsm == WALKING:\n\t\tintegrate_walking(state)\n\telif fsm == RUNNING:\n\t\tintegrate_running(state)\n\telif fsm == JUMPING:\n\t\tintegrate_jumping(state)\n\telif fsm == FALLING:\n\t\tintegrate_falling(state)\n\telif fsm == CLIMBING:\n\t\tintegrate_climbing(state)\n\t\t\nfunc integrate_idle(state):\n\tplayer_sprites.play(\"stand\")\n\tvar velocity = state.get_linear_velocity()\n\tvelocity.x *= GROUND_FRICTION_MULTIPLIER\n\tstate.set_linear_velocity(velocity)\n\nfunc integrate_walking(state):\n\tplayer_sprites.play(\"walk\")\n\tvar velocity = state.get_linear_velocity()\n\t\n\tif abs(velocity.x) > WALK_SPEED:\n\t\tif is_action_pressed_and_available(CONTROL_LEFT):\n\t\t\tplayer_sprites.set_flip_h(true)\n\t\telif is_action_pressed_and_available(CONTROL_RIGHT):\n\t\t\tplayer_sprites.set_flip_h(false)\n\t\tvelocity.x = clamp(velocity.x * (1 - GROUND_ACCELERATION_MULTIPLIER), -RUN_SPEED, RUN_SPEED)\n\telse:\n\t\tif is_action_pressed_and_available(CONTROL_LEFT):\n\t\t\tvelocity.x -= WALK_SPEED * GROUND_ACCELERATION_MULTIPLIER\n\t\t\tplayer_sprites.set_flip_h(true)\n\t\telif is_action_pressed_and_available(CONTROL_RIGHT):\n\t\t\tvelocity.x += WALK_SPEED * GROUND_ACCELERATION_MULTIPLIER\n\t\t\tplayer_sprites.set_flip_h(false)\n\n\t\tvelocity.x = clamp(velocity.x, -WALK_SPEED, WALK_SPEED)\n\n\tstate.set_linear_velocity(velocity)\n\t\t\nfunc integrate_running(state):\n\tplayer_sprites.play(\"walk\")\n\tvar velocity = state.get_linear_velocity()\n\t\n\tif is_action_pressed_and_available(CONTROL_LEFT):\n\t\tvelocity.x -= RUN_SPEED * GROUND_ACCELERATION_MULTIPLIER\n\t\tplayer_sprites.set_flip_h(true)\n\telif is_action_pressed_and_available(CONTROL_RIGHT):\n\t\tvelocity.x += RUN_SPEED * GROUND_ACCELERATION_MULTIPLIER\n\t\tplayer_sprites.set_flip_h(false)\n\t\t\n\tvelocity.x = clamp(velocity.x, -RUN_SPEED, RUN_SPEED)\n\t\n\tstate.set_linear_velocity(velocity)\n\t\t\nfunc integrate_falling(state):\n\tplayer_sprites.play(\"jump\")\n\tvar velocity = state.get_linear_velocity()\n\t\n\tif velocity.x > -WALK_SPEED && is_action_pressed_and_available(CONTROL_LEFT):\n\t\tplayer_sprites.set_flip_h(true)\n\t\tvelocity.x -= WALK_SPEED * AIR_DIRECTION_MULTIPLIER\n\telif velocity.x < WALK_SPEED && is_action_pressed_and_available(CONTROL_RIGHT):\n\t\tplayer_sprites.set_flip_h(false)\n\t\tvelocity.x += WALK_SPEED * AIR_DIRECTION_MULTIPLIER\n\telif !is_action_pressed_and_available(CONTROL_LEFT) && !is_action_pressed_and_available(CONTROL_RIGHT):\n\t\tvelocity.x *= AIR_FRICTION_MULTIPLIER\n\t\t\n\tvelocity.x = clamp(velocity.x, -RUN_SPEED, RUN_SPEED)\n\tstate.set_linear_velocity(velocity)\n\t\nfunc integrate_jumping(state):\n\tplayer_sprites.play(\"jump\")\n\tvar velocity = state.get_linear_velocity()\n\t\n\tif velocity.x > -WALK_SPEED && is_action_pressed_and_available(CONTROL_LEFT):\n\t\tplayer_sprites.set_flip_h(true)\n\t\tvelocity.x -= WALK_SPEED * AIR_DIRECTION_MULTIPLIER\n\telif velocity.x < WALK_SPEED && is_action_pressed_and_available(CONTROL_RIGHT):\n\t\tplayer_sprites.set_flip_h(false)\n\t\tvelocity.x += WALK_SPEED * AIR_DIRECTION_MULTIPLIER\n\telif !is_action_pressed_and_available(CONTROL_LEFT) && !is_action_pressed_and_available(CONTROL_RIGHT):\n\t\tvelocity.x *= AIR_FRICTION_MULTIPLIER\n\t\t\n\tvelocity.x = clamp(velocity.x, -RUN_SPEED, RUN_SPEED)\n\t\n\tvelocity.y = -JUMP_SPEED\n\tstate.set_linear_velocity(velocity)\n\nfunc integrate_climbing(state):\n\tplayer_sprites.play(\"jump\")\n\tvar velocity = state.get_linear_velocity()\n\t\n\tif is_action_pressed_and_available(CONTROL_UP):\n\t\tvelocity.y = -CLIMB_SPEED\n\telif is_action_pressed_and_available(CONTROL_DOWN):\n\t\tvelocity.y = CLIMB_SPEED\n\t\n\tif is_action_pressed_and_available(CONTROL_LEFT):\n\t\tvelocity.x = - WALK_SPEED * 0.6\n\t\tplayer_sprites.set_flip_h(true)\n\telif is_action_pressed_and_available(CONTROL_RIGHT):\n\t\tvelocity.x = WALK_SPEED * 0.6\n\t\tplayer_sprites.set_flip_h(false)\n\telse:\n\t\tvelocity.x = 0\n\t\n\tstate.set_linear_velocity(velocity)\n\nfunc _process(delta):\n\tvar can_climb = false\n\t\n\tvar overlapping_areas = interaction_area.get_overlapping_areas()\n\t\n\tfor area in overlapping_areas:\n\t\tif can_climb:\n\t\t\tbreak\n\t\tcan_climb = area extends climb_area\n\n\tif fsm == IDLE:\n\t\tif is_action_pressed_and_available(CONTROL_JUMP) && jump_pressed == JUMP_NOT_PRESSED:\n\t\t\tfsm = JUMPING\n\t\t\tset_jump_pressed()\n\t\t\tif debug: print(\"idle -> jump\")\n\t\telif is_action_pressed_and_available(CONTROL_LEFT) || is_action_pressed_and_available(CONTROL_RIGHT):\n\t\t\tfsm = WALKING\n\t\t\tif debug: print(\"idle -> walk\")\n\t\telif can_climb && ((is_action_pressed_and_available(CONTROL_UP) && !test_motion(Vector2(0,-5))) || (is_action_pressed_and_available(CONTROL_DOWN) && !test_motion(Vector2(0,5)))):\n\t\t\t#check if can climb and if thera are obstacles where we want to climb\n\t\t\tfsm = CLIMBING\n\t\t\tif debug: print(\"idle -> climb\")\n\t\telif !test_motion(Vector2(0,5)):\n\t\t\tfsm = FALLING\n\t\t\tif debug: print(\"idle -> fall\")\n\t\t\t\n\telif fsm == WALKING:\n\t\tif !is_action_pressed_and_available(CONTROL_LEFT) && !is_action_pressed_and_available(CONTROL_RIGHT):\n\t\t\tfsm = IDLE\n\t\t\tif debug: print(\"walk -> idle\")\n\t\telif is_action_pressed_and_available(CONTROL_RUN):\n\t\t\tfsm = RUNNING\n\t\t\tif debug: print(\"walk -> run\")\n\t\telif is_action_pressed_and_available(CONTROL_JUMP) && jump_pressed == JUMP_NOT_PRESSED:\n\t\t\tfsm = JUMPING\n\t\t\tset_jump_pressed()\n\t\t\tif debug: print(\"walk -> jump\")\n\t\telif can_climb && ((is_action_pressed_and_available(CONTROL_UP) && !test_motion(Vector2(0,-5))) || (is_action_pressed_and_available(CONTROL_DOWN) && !test_motion(Vector2(0,5)))):\n\t\t\tfsm = CLIMBING\n\t\t\tif debug: print(\"walk -> climb\")\n\t\telif !test_motion(Vector2(0,5)):\n\t\t\tfsm = FALLING\n\t\t\tif debug: print(\"walk -> fall\")\n\t\t\t\n\telif fsm == RUNNING:\n\t\tif !is_action_pressed_and_available(CONTROL_RUN):\n\t\t\tfsm = WALKING\n\t\t\tif debug: print(\"run -> walk\")\n\t\telif !is_action_pressed_and_available(CONTROL_LEFT) && !is_action_pressed_and_available(CONTROL_RIGHT):\n\t\t\tfsm = IDLE\n\t\t\tif debug: print(\"run -> idle\")\n\t\telif is_action_pressed_and_available(CONTROL_JUMP) && jump_pressed == JUMP_NOT_PRESSED :\n\t\t\tfsm = JUMPING\n\t\t\tset_jump_pressed()\n\t\t\tif debug: print(\"run -> jump\")\n\t\telif can_climb && ((is_action_pressed_and_available(CONTROL_UP) && !test_motion(Vector2(0,-5))) || (is_action_pressed_and_available(CONTROL_DOWN) && !test_motion(Vector2(0,5)))):\n\t\t\t#check if can climb and if thera are obstacles where we want to climb\n\t\t\tfsm = CLIMBING\n\t\t\tif debug: print(\"run -> climb\")\n\t\telif !test_motion(Vector2(0,5)):\n\t\t\tfsm = FALLING\n\t\t\tif debug: print(\"run -> fall\")\n\t\t\t\n\telif fsm == CLIMBING:\n\t\tif !can_climb:\n\t\t\tfsm = FALLING\n\t\t\tif debug: print(\"climb -> fall\")\n\t\telif is_action_pressed_and_available(CONTROL_JUMP) && jump_pressed == JUMP_NOT_PRESSED :\n\t\t\tfsm = JUMPING\n\t\t\tset_jump_pressed()\n\t\t\tif debug: print(\"climb -> jump\")\n\t\telif !is_action_pressed_and_available(CONTROL_UP) && !is_action_pressed_and_available(CONTROL_DOWN) && test_motion(Vector2(0,5)):\n\t\t\tfsm = IDLE\n\t\t\tif debug: print(\"climb -> idle\")\n\t\t\t\n\telif fsm == FALLING:\n\t\tfalling_time += delta\n\t\tif can_climb && ((is_action_pressed_and_available(CONTROL_UP) && !test_motion(Vector2(0,-5))) || (is_action_pressed_and_available(CONTROL_DOWN) && !test_motion(Vector2(0,5)))):\n\t\t\t#check if can climb and if thera are obstacles where we want to climb\n\t\t\tfsm = CLIMBING\n\t\t\tfalling_time = 0\n\t\t\tif debug: print(\"fall -> climb\")\n\t\telif test_motion(Vector2(0,5)):\n\t\t\tfsm = IDLE\n\t\t\tfalling_time = 0\n\t\t\tif debug: print(\"fall -> idle\")\n\t\telif is_action_pressed_and_available(CONTROL_JUMP) && jump_pressed == JUMP_NOT_PRESSED && falling_time < FALLING_JUMP_DELAY:\n\t\t\tfsm = JUMPING\n\t\t\tset_jump_pressed()\n\t\t\tif debug: print(\"fall -> jump\")\n\t\t\t\n\telif fsm == JUMPING:\n\t\tjump_time += delta\n\t\tif !is_action_pressed_and_available(CONTROL_JUMP) || jump_time > JUMP_TIME_MAX:\n\t\t\tfsm = FALLING\n\t\t\tjump_time = 0\n\t\t\tfalling_time = FALLING_JUMP_DELAY\n\t\t\tif debug: print(\"jump -> fall\")\n\t\t\t\nfunc is_action_pressed_and_available(action):\n\treturn ((action == control_1 || action == control_2) && Input.is_action_pressed(action)) || (touchscreen_left != -1 && action == control_1) || (touchscreen_right != -1 && action == control_2)\n\nfunc change_controls(control_1, control_2):\n\tself.control_1 = control_1\n\tself.control_2 = control_2\n\temit_signal(\"controls_changed\", self)\n\nfunc set_jump_pressed():\n\tif jump_pressed == JUMP_NOT_PRESSED:\n\t\tif control_1 == \"jump\":\n\t\t\tjump_pressed = JUMP_PRESSED_LEFT\n\t\telif control_2 == \"jump\":\n\t\t\tjump_pressed = JUMP_PRESSED_RIGHT","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"5c324495fdb49118c7d2257fc346e62aaa97bc20","subject":"gd \"G\u00e0idhlig\" translation #16343. Author: bretasker.","message":"gd \"G\u00e0idhlig\" translation #16343. Author: bretasker.\n","repos":"arex1337\/lila,arex1337\/lila,arex1337\/lila,clarkerubber\/lila,clarkerubber\/lila,luanlv\/lila,luanlv\/lila,arex1337\/lila,clarkerubber\/lila,luanlv\/lila,clarkerubber\/lila,luanlv\/lila,clarkerubber\/lila,clarkerubber\/lila,luanlv\/lila,luanlv\/lila,arex1337\/lila,clarkerubber\/lila,arex1337\/lila,arex1337\/lila,luanlv\/lila","old_file":"modules\/i18n\/messages\/messages.gd","new_file":"modules\/i18n\/messages\/messages.gd","new_contents":"playWithAFriend=Cluich c\u00f2mhla ri caraid\nplayWithTheMachine=Cluich an aghaidh a' choimpiutair\ntoInviteSomeoneToPlayGiveThisUrl=Gus cuireadh a thoirt do chuideigin, thoir an url seo dha\ngameOver=Cr\u00ecoch a\u2019 gheama\nwaitingForOpponent=A\u2019 feitheamh air n\u00e0mhaid\nwaiting=A\u2019 feitheamh\nyourTurn=An turas agad\naiNameLevelAiLevel=%s inbhe %s\nlevel=Inbhe\ntoggleTheChat=Toglaich a\u2019 chabadaich\ntoggleSound=Toglaich fuaim\nchat=Cabadaich\nresign=G\u00e8ill\ncheckmate=Tul-chasg\nstalemate=Clos-cluiche\nwhite=Geal\nblack=Dubh\nrandomColor=Dath air thuaiream\ncreateAGame=Cruthaich geama\nwhiteIsVictorious=Bhuannaich geal\nblackIsVictorious=Bhuannaich dubh\nkingInTheCenter=R\u00ecgh sa mheadhan\nthreeChecks=Tr\u00ec caisg\nraceFinished=R\u00e8is cr\u00ecochnaichte\nvariantEnding=Caisg den t-se\u00f2rsa seo\nnewOpponent=N\u00e0mhaid \u00f9r\nyourOpponentWantsToPlayANewGameWithYou=Tha an n\u00e0mhaid agad airson geama \u00f9r a chluich \u2019nad aghaidh\njoinTheGame=Thig a-steach dhan gheama\nwhitePlays=Tha geal a\u2019 cluich\nblackPlays=Tha dubh a\u2019 cluich\ntheOtherPlayerHasLeftTheGameYouCanForceResignationOrWaitForHim=Tha an cluicheadair eile air a' gheama fh\u00e0gail. Is urrainn dhut g\u00e8illeadh a chur air, geama ionnannach a ghairm, no feitheamh air a shon.\nmakeYourOpponentResign=Cuir g\u00e8illeadh air an n\u00e0mhaid agad\nforceResignation=Gairm buaidh\nforceDraw=Gairm geama ionnannach\ntalkInChat=D\u00e8an cabadaich\ntheFirstPersonToComeOnThisUrlWillPlayWithYou=Cluichidh a\u2019 chiad neach a thig a-steach air an url seo c\u00f2mhla riut.\nwhiteResigned=Gh\u00e8ill geal\nblackResigned=Gh\u00e8ill dubh\nwhiteLeftTheGame=Dh\u2019fh\u00e0g geal an geama\nblackLeftTheGame=Dh\u2019fh\u00e0g dubh an geama\nshareThisUrlToLetSpectatorsSeeTheGame=Co-roinn an url seo gus luchd-amhairc a leigeil a-steach dhan gheama\ntheComputerAnalysisHasFailed=Dh\u2019fh\u00e0illig le anailis a\u2019 choimpiutair\nviewTheComputerAnalysis=Seall anailis a\u2019 choimpiutair\nrequestAComputerAnalysis=Iarr anailis air a\u2019 choimpiutair\ncomputerAnalysis=Anailis a\u2019 choimpiutair\nanalysis=B\u00f2rd sgr\u00f9daidh\nblunders=Tuislidhean\nmistakes=Mearachdan\ninaccuracies=Neo-eagnaidhean\nmoveTimes=\u00d9ine nan gluasadan\nflipBoard=D\u00e8an flip air a\u2019 bh\u00f2rd\nthreefoldRepetition=Treas ath-nochdadh\nclaimADraw=Gairm co-tharraing\nofferDraw=Tairg co-tharraing\ndraw=Co-tharraing\nnbConnectedPlayers=%s cluicheadairean\ngamesBeingPlayedRightNow=Geamannan a tha \u2019gan cluich an-dr\u00e0sta fh\u00e8in\nviewAllNbGames=%s geamannan\nviewNbCheckmates=%s tul-chaisg\nnbBookmarks=%s comharran-l\u00ecn\nnbPopularGames=%s geamannan m\u00f2r-ch\u00f2rdte\nnbAnalysedGames=%s geamannan sgr\u00f9daichte\nbookmarkedByNbPlayers=Comharra-leabhair le %s cluicheadairean\nviewInFullSize=Seall sa mheud iomlan\nlogOut=Log a-mach\nsignIn=Log a-steach\nnewToLichess=\u00d9r air Lichess?\nyouNeedAnAccountToDoThat=Tha feum agad air cunntas gus sin a dh\u00e8anamh\nsignUp=Cl\u00e0raich\ngames=Geamannan\nforum=B\u00f2rd-brath\nxPostedInForumY=Sgr\u00ecobh %s san fh\u00f2ram %s\nlatestForumPosts=Na postaichean as \u00f9ire\nplayers=Cluicheadairean\nminutesPerSide=Mionaidean gach taobh\nvariant=Caochladh\nvariants=Se\u00f2rsachan\ntimeControl=Smachd air an \u00f9ine\nrealTime=F\u00ecor-\u00f9ine\ndaysPerTurn=L\u00e0ithean gach cuairt\noneDay=Aon latha\nnbDays=%s l\u00e0(ithean)\nnbHours=%s uair(ean)\ntime=\u00d9ine\nrating=Rangachadh\nusername=Ainm-cleachdaidh\nusernameOrEmail=Far-ainm\npassword=Facal-faire\nhaveAnAccount=A bheil cunntas agad?\nchangePassword=Atharraich am facal-faire\nchangeEmail=Atharraich am post-d\nemail=Post-d\nemailIsOptional=Tha am post-d roghainneil. cleachdaich Lichess an se\u00f2ladh puist-d agad gus am facal-faire agad ath-shuidheachadh ma dh\u00ecochuimhnicheas tu e.\npasswordReset=Ath-shuidheachadh an fhacail-fhaire\nforgotPassword=An do dh\u00ecochuimhnich thu am facal-faire?\nrank=Inbhe\ngamesPlayed=Geamannan air an cluich\nnbGamesWithYou=%s geamannan c\u00f2mhla riut\ndeclineInvitation=Di\u00f9lt cuireadh\ncancel=Sguir dheth\ntimeOut=Dh\u2019fhalbh an \u00f9ine\ndrawOfferSent=Chaidh tairgse airson co-tharraing a chur\ndrawOfferDeclined=Dhi\u00f9ltadh do thairgse airson co-tharraing\ndrawOfferAccepted=Ghabhadh ri do thairgse airson co-tharraing\ndrawOfferCanceled=Sguireadh de do thairgse airson co-tharraing\nwhiteOffersDraw=Tha geal a' tairgse co-tharraing\nblackOffersDraw=Tha dubh a' tairgse co-tharraing\nwhiteDeclinesDraw=Tha geal a' di\u00f9ltadh co-tharraing\nblackDeclinesDraw=Tha dubh a' di\u00f9ltadh co-tharraing\nyourOpponentOffersADraw=Tha an n\u00e0mhaid agad a\u2019 tairgse co-tharraing\naccept=Gabh ris\ndecline=Di\u00f9lt\nplayingRightNow=A\u2019 cluich an-dr\u00e0sta fh\u00e8in\nfinished=Cr\u00ecochnaichte\nabortGame=Stad an geama\ngameAborted=Chaidh sgur dhen gheama\nstandard=Coitcheann\nunlimited=Gun chr\u00ecoch\nmode=Modh\ncasual=Gun rangachadh\nrated=Rangaichte\nthisGameIsRated=Tha an geama seo rangaichte\nrematch=Ath-mhaids\nrematchOfferSent=Chaidh tairgse airson ath-mhaids a chur\nrematchOfferAccepted=Ghabhadh ri do thairgse airson ath-mhaids\nrematchOfferCanceled=Chaidh sgur dhe thairgse ath-mhaids\nrematchOfferDeclined=Tairgse ath-mhaids air a di\u00f9ltadh\ncancelRematchOffer=Sguir dhe thairgse ath-mhaids\nviewRematch=Seall an ath-mhaids\nplay=Cluich\ninbox=Bogsa a-steach\nchatRoom=Se\u00f2mar cabadaich\nspectatorRoom=Se\u00f2mar an luchd-amhairc\ncomposeMessage=Sgr\u00ecobh teachdaireachd\nnoNewMessages=Gun teachdaireachd \u00f9r\nsubject=Cuspair\nrecipient=Faightear\nsend=Cuir\nincrementInSeconds=Ioncramaid ann an diogan\nfreeOnlineChess=T\u00e0ileasg air loidhne an-asgaidh\nspectators=Luchd-amhairc:\nnbWins=Bhuannaich %s\nnbLosses=Chaill %s\nnbDraws=Co-tharraing %s\nexportGames=\u00c0s-phortaich geamannan\nratingRange=Rainse an rangachaidh\ngiveNbSeconds=Thoir %s diogan\npremoveEnabledClickAnywhereToCancel=Ro-ghluasad an comas - briog \u00e0ite sam bith airson sgur dheth\nthisPlayerUsesChessComputerAssistance=Tha an cluicheadair seo a\u2019 cleachdadh taic coimpiutair taileisg\nopening=Fosgladh\ntakeback=Tarraing air ais\nproposeATakeback=Tairg tarraing air ais\ntakebackPropositionSent=Tairgse tarraing air ais air a cur\ntakebackPropositionDeclined=Tairgse tarraing air ais air a di\u00f9ltadh\ntakebackPropositionAccepted=Air gabhail ri tairgse tarraing air ais\ntakebackPropositionCanceled=Chaidh sgur dhe thairgse tarraing air ais\nyourOpponentProposesATakeback=Tha an n\u00e0mhaid a\u2019 tairgse tarraing air ais\nbookmarkThisGame=Cruthaich comharra-l\u00ecn airson a\u2019 gheama seo.\nsearch=Lorg\nadvancedSearch=Lorg adhartach\ntournament=F\u00e8ill-chluich\ntournaments=F\u00e8illean-chluich\ntournamentPoints=Puingean f\u00e8ill-chluich\nviewTournament=Seall an fh\u00e8ill-chluich\nbackToTournament=Till dhan fh\u00e8ill-chluich\nbackToGame=Till dhan gheama\nfreeOnlineChessGamePlayChessNowInACleanInterfaceNoRegistrationNoAdsNoPluginRequiredPlayChessWithComputerFriendsOrRandomOpponents=T\u00e0ileasg air loidhne an-asgaidh. Cluich t\u00e0ileasg ann am pr\u00f2gram air a bheil dreach glan. Gun chl\u00e0radh, gun sanasachd, gun fheum air plugan. Cluich t\u00e0ileasg an aghaidh a\u2019 choimpiutair, charaidean no n\u00e0imhdean air thuaiream.\nteams=Sgiobaidhean\nnbMembers=%s ball\nallTeams=A h-uile sgioba\nnewTeam=Sgioba \u00f9r\nmyTeams=Na sgiobaidhean agam\nnoTeamFound=Cha deach sgioba a lorg\njoinTeam=Gabh p\u00e0irt san sgioba\nquitTeam=F\u00e0g an sgioba\nanyoneCanJoin=Faodaidh duine sam bith p\u00e0irt a ghabhail ann\naConfirmationIsRequiredToJoin=Tha feum air dearbhadh gus p\u00e0irt a ghabhail ann\njoiningPolicy=Poileasaidh na ballrachd\nteamLeader=Ceannard an sgioba\nteamBestPlayers=Na cluicheadairean as fhearr\nteamRecentMembers=Na buill as \u00f9ire\nxJoinedTeamY=Ghabh %s ballrachd san sgioba %s\nxCreatedTeamY=Chruthaich %s an sgioba %s\naverageElo=Rangachadh cuibheasach\nlocation=\u00c0ite\nsettings=Roghainnean\nfilterGames=Criathraich na geamannan\nreset=Ath-shuidhich\napply=Cuir an s\u00e0s\nleaderboard=Cl\u00e0r nan curaidh\npasteTheFenStringHere=Cuir a-steach an t-sreang FEN an-seo\npasteThePgnStringHere=Cuir a-steach an t-sreang PGN an-seo\nfromPosition=On t-suidheachadh\ncontinueFromHere=Lean air adhart on a sheo\nimportGame=Ion-phortaich geama\nnbImportedGames=%s geamannan air an ion-phortadh\nthisIsAChessCaptcha=Seo CAPTCHA t\u00e0ileisg.\nclickOnTheBoardToMakeYourMove=Briog air a\u2019 bh\u00f2rd airson gluasad \u2019s dearbhaich gur e duine a th\u2019 annad.\nnotACheckmate=Chan e tul-chasg a th\u2019 ann\ncolorPlaysCheckmateInOne=Tha %s a\u2019 cluich; tul-chasg an ceann gluasaid\nretry=Feuch ris a-rithist\nreconnecting=Ag ath-cheangal\nonlineFriends=Caraidean air loidhne\nnoFriendsOnline=Chan eil caraid air loidhne\nfindFriends=Lorg caraidean\nfavoriteOpponents=Na farpaisichean as annsa leat\nfollow=Lean\nfollowing=A\u2019 leantainn\nunfollow=Na lean an corr\nblock=Bac\nblocked=Bacte\nunblock=D\u00ec-bhac\nfollowsYou=\u2019Gad leantainn\nxStartedFollowingY=Th\u00f2isich %s a\u2019 leantainn %s\nnbFollowers=%s luchd-leantainn\nnbFollowing=%s a' leantainn\nmore=Barrachd\nmemberSince=Ball o chionn\nlastSeenActive=An logadh a-steach mu dheireadh %s\nchallengeToPlay=Thoir d\u00f9bhlan cluiche dha\nplayer=Cluicheadair\nlist=Liosta\ngraph=Graf\nlessThanNbMinutes=Nas lugha na %s mionaidean\nxToYMinutes=%s gu %s mionaidean\ntextIsTooShort=Tha an teacsa ro ghoirid.\ntextIsTooLong=Tha an teacsa ro fhada.\nrequired=Riatanach.\nopenTournaments=F\u00e8ill-chluichean fosgailte\nduration=Faid\nwinner=Buannaiche\nstanding=Suidheachadh\ncreateANewTournament=Cruthaich f\u00e8ill-chluich \u00f9r\njoin=Gabh p\u00e0irt ann\nwithdraw=C\u00f9laich\npoints=Puingean\nwins=Buaidhean\nlosses=Ruaigean\nwinStreak=Sreath de bhuaidhean\ncreatedBy=Air a chruthachadh le\ntournamentIsStarting=Tha an fh\u00e8ill-chluich gu bhith t\u00f2iseachadh\nmembersOnly=Buill a-mh\u00e0in\nboardEditor=Deasaiche a\u2019 bh\u00f9ird\nstartPosition=Suidheachadh an t\u00f2iseachaidh\nclearBoard=Falamhaich am b\u00f2rd\nsavePosition=S\u00e0bhail an suidheachadh\nloadPosition=Luchdaich suidheachadh\nisPrivate=Pr\u00ecobhaideach\nreportXToModerators=Cuir gearan mu %s dha na maoir\nprofile=Pr\u00f2ifil\neditProfile=Deasaich a\u2019 phr\u00f2ifil\nfirstName=Ainm\nlastName=Sloinneadh\nbiography=Eachdraidh-beatha\ncountry=D\u00f9thaich\npreferences=Roghainnean\nwatchLichessTV=Coimhead air tbh Lichess\npreviouslyOnLichessTV=Air tbh Lichess roimhe\nonlinePlayers=Cluicheadairean air loidhne\nactiveToday=Gn\u00ecomhach an-diugh\nactivePlayers=Cluicheadairean gn\u00ecomhach\nbewareTheGameIsRatedButHasNoClock=Thoir an aire, th\u00e8id an geama seo rangachadh ach chan eil uaireadair aige!\ntraining=Tr\u00e8anadh\nyourPuzzleRatingX=An rangachadh agad: %s\nfindTheBestMoveForWhite=Lorg an gluasad as fhearr airson geal.\nfindTheBestMoveForBlack=Lorg an gluasad as fhearr airson dubh.\ntoTrackYourProgress=Gus s\u00f9il a chumail air d\u2019 adhartas:\ntrainingSignupExplanation=Bheir Lichess t\u00f2imhseachain dhut a bhios freagarrach dhan chomas agad ach am faigh thu tr\u00e8anadh as iomchaidh.\nrecentlyPlayedPuzzles=T\u00f2imhseachain o chionn goirid\npuzzleId=T\u00f2imhseachan %s\npuzzleOfTheDay=T\u00f2imhseachan an latha\nclickToSolve=Briog an-seo airson fhuasgladh\ngoodMove=Seo gluasad math\nbutYouCanDoBetter=Ach tha gluasad nas fhearr ann.\nbestMove=Seo an gluasad as fhearr!\nkeepGoing=Cum ort...\npuzzleFailed=Cha deach leat\nbutYouCanKeepTrying=Ach faodaidh tu feuchainn a-rithist.\nvictory=Buaidh!\ngiveUp=Thoir g\u00e8ill\npuzzleSolvedInXSeconds=Rinn thu a\u2019 ch\u00f9is air an ceann %s diog.\nwasThisPuzzleAnyGood=An robh an t\u00f2imhseachan seo math?\npleaseVotePuzzle=Cuidich lichess \u2019s cuir bh\u00f2t ann leis an t-saighead suas no s\u00ecos:\nthankYou=M\u00f2ran taing!\nratingX=Rangachadh: %s\nplayedXTimes=Air a chluich %s turas\nfromGameLink=On gheama %s\nstartTraining=T\u00f2isich air an tr\u00e8anadh\ncontinueTraining=Lean air adhart leis an tr\u00e8anadh\nretryThisPuzzle=Feuch ris an t\u00f2imhseachan seo a-rithist\nthisPuzzleIsCorrect=Tha an t\u00f2imhseachan seo ceart is inntinneach\nthisPuzzleIsWrong=Tha an t\u00f2imhseachan seo cearr no d\u00f2rainneach\nyouHaveNbSecondsToMakeYourFirstMove=Tha %s diog(an) air fh\u00e0gail dhut airson a' chiad gluasaid agad!\nnbGamesInPlay=%s geama 'gan cluich\nopeningId=Fosgladh %s\nyourOpeningRatingX=An rangachadh fosglaidh agad: %s\nfindNbStrongMoves=Lorg %s gluasad(an) l\u00e0idir\nthisMoveGivesYourOpponentTheAdvantage=Tha an gluasad seo a' toirt buannachd dha do n\u00e0mhaid\nopeningFailed=Dh'fh\u00e0illig leis an fhosgladh\nopeningSolved=Chaidh am fosgladh fhuasgladh\nrecentlyPlayedOpenings=Fosglaidhean a chaidh a chluich o chionn goirid\npuzzles=T\u00f2imhseachain\ncoordinates=Co-chomharran\nopenings=Fosglaidhean\nlatestUpdates=Na naidheachdan as \u00f9ire\ntournamentWinners=Feadhainn a bhuannaich f\u00e8ill-chluich\nname=Ainm\ndescription=Tuairisgeul\nno=Chan eil\nyes=Tha\nhelp=Cobhair:\ncreateANewTopic=Cruthaich cuspair \u00f9r\ntopics=Cuspairean\nposts=Postaichean\nlastPost=Am post mu dheireadh\nviews=Air a shealltainn\nreplies=Freagairtean\nreplyToThisTopic=Freagair dhan chuspair seo\nreply=Freagair\nmessage=Teachdaireachd\ncreateTheTopic=Cruthaich an cuspair\nreportAUser=D\u00e8an aithris air cleachdaiche\nuser=Cleachdaiche\nreason=Adhbhar\nwhatIsIheMatter=D\u00e8 an trioblaid?\ncheat=Cealgaireachd\ninsult=Mosach\ntroll=Troll\nother=Adhbhar eile\nby=le %s\nthisTopicIsNowClosed=Tha an cuspair seo d\u00f9inte a-nis.\ntheming=\u00d9rlar\nblog=Bloga\nquestionsAndAnswers=Ceistean & Freagairtean\nnotes=N\u00f2taichean\ntypePrivateNotesHere=Sgr\u00ecobh notaichean pr\u00ecobhaideach an seo\nprivacy=Pr\u00ecobhaideachd\nsound=Fuaim\nnormal=Meadhanach\nalways=An c\u00f2mhnaidh\ndifficultyEasy=Furasta\ndifficultyNormal=Meadhanach\ndifficultyHard=Doirbh\nxCompetesInY=%s a' gabhail p\u00e0irt ann an %s\ntimeline=Loidhne-t\u00ecm\nseeAllTournaments=Faic na f\u00e8illean-cluich uile\nstarting=A' t\u00f2iseachadh:\nyourCityRegionOrDepartment=Do bhaile, do sg\u00ecre no do mh\u00f3r-roinn.\nbiographyDescription=Innis mu do dheidhinn, de 's toigh leat ann an t\u00e0ileasg, na fosglaidhean as fhearr leat, geamannan, cluicheadairean...\nmaximumNbCharacters=A' chuid as motha: %s caractarean.\nlearn=Ionnsaich\ncommunity=Coimhearsnachd\ntools=Goireasean\nincrement=Ioncramaid\nboard=B\u00f2rd\npieces=P\u00ecosan\nmenu=Cl\u00e0r-taice\nnbForumPosts=%s Puist air F\u00f2ram\ntpTimeSpentPlaying=\u00d9ine a' cluich: %s\nwatchGames=Coimhead geamannan\ntpTimeSpentOnTV=\u00d9ine air tbh: %s\nwatch=Coimhead\nvideoLibrary=Cruinneachadh bhidiothan\ncontact=Cuir fios\nlichessTournaments=F\u00e9illean-chluich Lichess\ntournamentOfficial=Oifigeil\ntimeBeforeTournamentStarts=\u00d9ine mus t\u00f2isich an fh\u00e9ill-chluich\nyouAreBetterThanPercentOfPerfTypePlayers=Tha thu nas fhearr na %s de chluicheadairean %s.\nconfirmResignation=Cinntich an g\u00e8illeadh\n","old_contents":"playWithAFriend=Cluich c\u00f2mhla ri caraid\nplayWithTheMachine=Cluich an aghaidh a' choimpiutair\ntoInviteSomeoneToPlayGiveThisUrl=Gus cuireadh a thoirt do chuideigin, thoir an url seo dha\ngameOver=Cr\u00ecoch a\u2019 gheama\nwaitingForOpponent=A\u2019 feitheamh air n\u00e0mhaid\nwaiting=A\u2019 feitheamh\nyourTurn=An turas agad\naiNameLevelAiLevel=%s inbhe %s\nlevel=Inbhe\ntoggleTheChat=Toglaich a\u2019 chabadaich\ntoggleSound=Toglaich fuaim\nchat=Cabadaich\nresign=G\u00e8ill\ncheckmate=Tul-chasg\nstalemate=Clos-cluiche\nwhite=Geal\nblack=Dubh\nrandomColor=Dath air thuaiream\ncreateAGame=Cruthaich geama\nwhiteIsVictorious=Bhuannaich geal\nblackIsVictorious=Bhuannaich dubh\nkingInTheCenter=R\u00ecgh sa mheadhan\nthreeChecks=Tr\u00ec caisg\nnewOpponent=N\u00e0mhaid \u00f9r\nyourOpponentWantsToPlayANewGameWithYou=Tha an n\u00e0mhaid agad airson geama \u00f9r a chluich \u2019nad aghaidh\njoinTheGame=Thig a-steach dhan gheama\nwhitePlays=Tha geal a\u2019 cluich\nblackPlays=Tha dubh a\u2019 cluich\ntheOtherPlayerHasLeftTheGameYouCanForceResignationOrWaitForHim=Tha an cluicheadair eile air a' gheama fh\u00e0gail. Is urrainn dhut g\u00e8illeadh a chur air, geama ionnannach a ghairm, no feitheamh air a shon.\nmakeYourOpponentResign=Cuir g\u00e8illeadh air an n\u00e0mhaid agad\nforceResignation=Gairm buaidh\nforceDraw=Gairm geama ionnannach\ntalkInChat=D\u00e8an cabadaich\ntheFirstPersonToComeOnThisUrlWillPlayWithYou=Cluichidh a\u2019 chiad neach a thig a-steach air an url seo c\u00f2mhla riut.\nwhiteResigned=Gh\u00e8ill geal\nblackResigned=Gh\u00e8ill dubh\nwhiteLeftTheGame=Dh\u2019fh\u00e0g geal an geama\nblackLeftTheGame=Dh\u2019fh\u00e0g dubh an geama\nshareThisUrlToLetSpectatorsSeeTheGame=Co-roinn an url seo gus luchd-amhairc a leigeil a-steach dhan gheama\ntheComputerAnalysisHasFailed=Dh\u2019fh\u00e0illig le anailis a\u2019 choimpiutair\nviewTheComputerAnalysis=Seall anailis a\u2019 choimpiutair\nrequestAComputerAnalysis=Iarr anailis air a\u2019 choimpiutair\ncomputerAnalysis=Anailis a\u2019 choimpiutair\nanalysis=B\u00f2rd sgr\u00f9daidh\nblunders=Tuislidhean\nmistakes=Mearachdan\ninaccuracies=Neo-eagnaidhean\nmoveTimes=\u00d9ine nan gluasadan\nflipBoard=D\u00e8an flip air a\u2019 bh\u00f2rd\nthreefoldRepetition=Treas ath-nochdadh\nclaimADraw=Gairm geama ionnannach\nofferDraw=Tairg geama ionnannach\ndraw=Geama ionnannach\nnbConnectedPlayers=%s cluicheadairean\ngamesBeingPlayedRightNow=Geamannan a tha \u2019gan cluich an-dr\u00e0sta fh\u00e8in\nviewAllNbGames=%s geamannan\nviewNbCheckmates=%s tul-chaisg\nnbBookmarks=%s comharran-l\u00ecn\nnbPopularGames=%s geamannan m\u00f2r-ch\u00f2rdte\nnbAnalysedGames=%s geamannan sgr\u00f9daichte\nbookmarkedByNbPlayers=Comharra-leabhair le %s cluicheadairean\nviewInFullSize=Seall sa mheud iomlan\nlogOut=Log a-mach\nsignIn=Log a-steach\nnewToLichess=\u00d9r air Lichess?\nyouNeedAnAccountToDoThat=Tha feum agad air cunntas gus sin a dh\u00e8anamh\nsignUp=Cl\u00e0raich\ngames=Geamannan\nforum=B\u00f2rd-brath\nxPostedInForumY=Sgr\u00ecobh %s san fh\u00f2ram %s\nlatestForumPosts=Na postaichean as \u00f9ire\nplayers=Cluicheadairean\nminutesPerSide=Mionaidean gach taobh\nvariant=Caochladh\nvariants=Se\u00f2rsachan\ntimeControl=Smachd air an \u00f9ine\nrealTime=F\u00ecor-\u00f9ine\ndaysPerTurn=L\u00e0ithean gach cuairt\noneDay=Aon latha\nnbDays=%s l\u00e0(ithean)\nnbHours=%s uair(ean)\ntime=\u00d9ine\nrating=Rangachadh\nusername=Ainm-cleachdaidh\nusernameOrEmail=Far-ainm\npassword=Facal-faire\nhaveAnAccount=A bheil cunntas agad?\nchangePassword=Atharraich am facal-faire\nchangeEmail=Atharraich am post-d\nemail=Post-d\nemailIsOptional=Tha am post-d roghainneil. cleachdaich Lichess an se\u00f2ladh puist-d agad gus am facal-faire agad ath-shuidheachadh ma dh\u00ecochuimhnicheas tu e.\npasswordReset=Ath-shuidheachadh an fhacail-fhaire\nforgotPassword=An do dh\u00ecochuimhnich thu am facal-faire?\nrank=Inbhe\ngamesPlayed=Geamannan air an cluich\nnbGamesWithYou=%s geamannan c\u00f2mhla riut\ndeclineInvitation=Di\u00f9lt cuireadh\ncancel=Sguir dheth\ntimeOut=Dh\u2019fhalbh an \u00f9ine\ndrawOfferSent=Chaidh tairgse airson geama ionnanach a chur\ndrawOfferDeclined=Dhi\u00f9ltadh do thairgse airson geama ionnanach\ndrawOfferAccepted=Ghabhadh ri do thairgse airson geama ionnanach\ndrawOfferCanceled=Sguireadh de do thairgse airson geama ionnanach\nwhiteOffersDraw=Tha geal a' tairgse geama ionnannach\nblackOffersDraw=Tha dubh a' tairgse geama ionnannach\nwhiteDeclinesDraw=Tha geal a' di\u00f9ltadh geama ionnannach\nblackDeclinesDraw=Tha dubh a' di\u00f9ltadh geama ionnannach\nyourOpponentOffersADraw=Tha an n\u00e0mhaid agad a\u2019 tairgse geama ionnanach\naccept=Gabh ris\ndecline=Di\u00f9lt\nplayingRightNow=A\u2019 cluich an-dr\u00e0sta fh\u00e8in\nfinished=Cr\u00ecochnaichte\nabortGame=Stad an geama\ngameAborted=Chaidh sgur dhen gheama\nstandard=Coitcheann\nunlimited=Gun chr\u00ecoch\nmode=Modh\ncasual=Gun rangachadh\nrated=Rangaichte\nthisGameIsRated=Tha an geama seo rangaichte\nrematch=Ath-mhaids\nrematchOfferSent=Chaidh tairgse airson ath-mhaids a chur\nrematchOfferAccepted=Ghabhadh ri do thairgse airson ath-mhaids\nrematchOfferCanceled=Chaidh sgur dhe thairgse ath-mhaids\nrematchOfferDeclined=Tairgse ath-mhaids air a di\u00f9ltadh\ncancelRematchOffer=Sguir dhe thairgse ath-mhaids\nviewRematch=Seall an ath-mhaids\nplay=Cluich\ninbox=Bogsa a-steach\nchatRoom=Se\u00f2mar cabadaich\nspectatorRoom=Se\u00f2mar an luchd-amhairc\ncomposeMessage=Sgr\u00ecobh teachdaireachd\nnoNewMessages=Gun teachdaireachd \u00f9r\nsubject=Cuspair\nrecipient=Faightear\nsend=Cuir\nincrementInSeconds=Ioncramaid ann an diogan\nfreeOnlineChess=T\u00e0ileasg air loidhne an-asgaidh\nspectators=Luchd-amhairc:\nnbWins=Bhuannaich %s\nnbLosses=Chaill %s\nnbDraws=Geama ionnanach le %s\nexportGames=\u00c0s-phortaich geamannan\nratingRange=Rainse an rangachaidh\ngiveNbSeconds=Thoir %s diogan\npremoveEnabledClickAnywhereToCancel=Ro-ghluasad an comas - briog \u00e0ite sam bith airson sgur dheth\nthisPlayerUsesChessComputerAssistance=Tha an cluicheadair seo a\u2019 cleachdadh taic coimpiutair taileisg\nopening=Fosgladh\ntakeback=Tarraing air ais\nproposeATakeback=Tairg tarraing air ais\ntakebackPropositionSent=Tairgse tarraing air ais air a cur\ntakebackPropositionDeclined=Tairgse tarraing air ais air a di\u00f9ltadh\ntakebackPropositionAccepted=Air gabhail ri tairgse tarraing air ais\ntakebackPropositionCanceled=Chaidh sgur dhe thairgse tarraing air ais\nyourOpponentProposesATakeback=Tha an n\u00e0mhaid a\u2019 tairgse tarraing air ais\nbookmarkThisGame=Cruthaich comharra-l\u00ecn airson a\u2019 gheama seo.\nsearch=Lorg\nadvancedSearch=Lorg adhartach\ntournament=F\u00e8ill-chluich\ntournaments=F\u00e8ill-chluichean\ntournamentPoints=Puingean f\u00e8ill-chluich\nviewTournament=Seall an fh\u00e8ill-chluich\nbackToTournament=Till dhan fh\u00e8ill-chluich\nbackToGame=Till dhan gheama\nfreeOnlineChessGamePlayChessNowInACleanInterfaceNoRegistrationNoAdsNoPluginRequiredPlayChessWithComputerFriendsOrRandomOpponents=T\u00e0ileasg air loidhne an-asgaidh. Cluich t\u00e0ileasg ann am pr\u00f2gram air a bheil dreach glan. Gun chl\u00e0radh, gun sanasachd, gun fheum air plugan. Cluich t\u00e0ileasg an aghaidh a\u2019 choimpiutair, charaidean no n\u00e0imhdean air thuaiream.\nteams=Sgiobaidhean\nnbMembers=%s ball\nallTeams=A h-uile sgioba\nnewTeam=Sgioba \u00f9r\nmyTeams=Na sgiobaidhean agam\nnoTeamFound=Cha deach sgioba a lorg\njoinTeam=Gabh p\u00e0irt san sgioba\nquitTeam=F\u00e0g an sgioba\nanyoneCanJoin=Faodaidh duine sam bith p\u00e0irt a ghabhail ann\naConfirmationIsRequiredToJoin=Tha feum air dearbhadh gus p\u00e0irt a ghabhail ann\njoiningPolicy=Poileasaidh na ballrachd\nteamLeader=Ceannard an sgioba\nteamBestPlayers=Na cluicheadairean as fhearr\nteamRecentMembers=Na buill as \u00f9ire\nxJoinedTeamY=Ghabh %s ballrachd san sgioba %s\nxCreatedTeamY=Chruthaich %s an sgioba %s\naverageElo=Rangachadh cuibheasach\nlocation=\u00c0ite\nsettings=Roghainnean\nfilterGames=Criathraich na geamannan\nreset=Ath-shuidhich\napply=Cuir an s\u00e0s\nleaderboard=Cl\u00e0r nan curaidh\npasteTheFenStringHere=Cuir a-steach an t-sreang FEN an-seo\npasteThePgnStringHere=Cuir a-steach an t-sreang PGN an-seo\nfromPosition=On t-suidheachadh\ncontinueFromHere=Lean air adhart on a sheo\nimportGame=Ion-phortaich geama\nnbImportedGames=%s geamannan air an ion-phortadh\nthisIsAChessCaptcha=Seo CAPTCHA t\u00e0ileisg.\nclickOnTheBoardToMakeYourMove=Briog air a\u2019 bh\u00f2rd airson gluasad \u2019s dearbhaich gur e duine a th\u2019 annad.\nnotACheckmate=Chan e tul-chasg a th\u2019 ann\ncolorPlaysCheckmateInOne=Tha %s a\u2019 cluich; tul-chasg an ceann gluasaid\nretry=Feuch ris a-rithist\nreconnecting=Ag ath-cheangal\nonlineFriends=Caraidean air loidhne\nnoFriendsOnline=Chan eil caraid air loidhne\nfindFriends=Lorg caraidean\nfavoriteOpponents=Na farpaisichean as annsa leat\nfollow=Lean air\nfollowing=A\u2019 leantainn air\nunfollow=Na lean air tuilleadh\nblock=Bac\nblocked=Bacte\nunblock=D\u00ec-bhac\nfollowsYou=\u2019Gad leantainn\nxStartedFollowingY=Th\u00f2isich %s a\u2019 leantainn air %s\nnbFollowers=%s luchd-leantainn\nnbFollowing=%s \u2019ga leantainn\nmore=Barrachd\nmemberSince=Ball o chionn\nlastSeenActive=An logadh a-steach mu dheireadh %s\nchallengeToPlay=Thoir d\u00f9bhlan cluiche dha\nplayer=Cluicheadair\nlist=Liosta\ngraph=Graf\nlessThanNbMinutes=Nas lugha na %s mionaidean\nxToYMinutes=%s gu %s mionaidean\ntextIsTooShort=Tha an teacsa ro ghoirid.\ntextIsTooLong=Tha an teacsa ro fhada.\nrequired=Riatanach.\nopenTournaments=F\u00e8ill-chluichean fosgailte\nduration=Faid\nwinner=Buannaiche\nstanding=A\u2019 seasamh\ncreateANewTournament=Cruthaich f\u00e8ill-chluich \u00f9r\njoin=Gabh p\u00e0irt ann\nwithdraw=C\u00f9laich\npoints=Puingean\nwins=Buaidhean\nlosses=Ruaigean\nwinStreak=Sreath de bhuaidhean\ncreatedBy=Air a chruthachadh le\ntournamentIsStarting=Tha an fh\u00e8ill-chluich gu bhith t\u00f2iseachadh\nmembersOnly=Buill a-mh\u00e0in\nboardEditor=Deasaiche a\u2019 bh\u00f9ird\nstartPosition=Suidheachadh an t\u00f2iseachaidh\nclearBoard=Falamhaich am b\u00f2rd\nsavePosition=S\u00e0bhail an suidheachadh\nloadPosition=Luchdaich suidheachadh\nisPrivate=Pr\u00ecobhaideach\nreportXToModerators=Cuir gearan mu %s dha na maoir\nprofile=Pr\u00f2ifil\neditProfile=Deasaich a\u2019 phr\u00f2ifil\nfirstName=Ainm\nlastName=Sloinneadh\nbiography=Eachdraidh-beatha\ncountry=D\u00f9thaich\npreferences=Roghainnean\nwatchLichessTV=Coimhead air TBh Lichess\npreviouslyOnLichessTV=Air Tbh Lichess roimhe\nonlinePlayers=Cluicheadairean air loidhne\nactiveToday=Gn\u00ecomhach an-diugh\nactivePlayers=Cluicheadairean gn\u00ecomhach\nbewareTheGameIsRatedButHasNoClock=Thoir an aire, th\u00e8id an geama seo rangachadh ach chan eil uaireadair aige!\ntraining=Tr\u00e8anadh\nyourPuzzleRatingX=An rangachadh agad: %s\nfindTheBestMoveForWhite=Lorg an gluasad as fhearr airson geal.\nfindTheBestMoveForBlack=Lorg an gluasad as fhearr airson dubh.\ntoTrackYourProgress=Gus s\u00f9il a chumail air d\u2019 adhartas:\ntrainingSignupExplanation=Bheir Lichess t\u00f2imhseachain dhut a bhios freagarrach dhan chomas agad ach am faigh thu tr\u00e8anadh as iomchaidh.\nrecentlyPlayedPuzzles=T\u00f2imhseachain o chionn goirid\npuzzleId=T\u00f2imhseachan %s\npuzzleOfTheDay=T\u00f2imhseachan an latha\nclickToSolve=Briog an-seo airson fhuasgladh\ngoodMove=Seo gluasad math\nbutYouCanDoBetter=Ach tha gluasad nas fhearr ann.\nbestMove=Seo an gluasad as fhearr!\nkeepGoing=Cum ort...\npuzzleFailed=Cha deach leat\nbutYouCanKeepTrying=Ach faodaidh tu feuchainn a-rithist.\nvictory=Buaidh!\ngiveUp=Thoir g\u00e8ill\npuzzleSolvedInXSeconds=Rinn thu a\u2019 ch\u00f9is air an ceann %s diog.\nwasThisPuzzleAnyGood=An robh an t\u00f2imhseachan seo math?\npleaseVotePuzzle=Cuidich lichess \u2019s cuir bh\u00f2t ann leis an t-saighead suas no s\u00ecos:\nthankYou=M\u00f2ran taing!\nratingX=Rangachadh: %s\nplayedXTimes=Air a chluich %s turas\nfromGameLink=On gheama %s\nstartTraining=T\u00f2isich air an tr\u00e8anadh\ncontinueTraining=Lean air adhart leis an tr\u00e8anadh\nretryThisPuzzle=Feuch ris an t\u00f2imhseachan seo a-rithist\nthisPuzzleIsCorrect=Tha an t\u00f2imhseachan seo ceart is inntinneach\nthisPuzzleIsWrong=Tha an t\u00f2imhseachan seo cearr no d\u00f2rainneach\nyouHaveNbSecondsToMakeYourFirstMove=Tha %s diog(an) air fh\u00e0gail dhut airson a' chiad gluasaid agad!\nnbGamesInPlay=%s geama 'gan cluich\nopeningId=Fosgladh %s\nyourOpeningRatingX=An rangachadh fosglaidh agad: %s\nfindNbStrongMoves=Lorg %s gluasad(an) l\u00e0idir\nopeningFailed=Dh'fh\u00e0illig leis an fhosgladh\nopeningSolved=Chaidh am fosgladh fhuasgladh\nrecentlyPlayedOpenings=Fosglaidhean a chaidh a chluich o chionn goirid\npuzzles=T\u00f2imhseachain\ncoordinates=Co-chomharran\nopenings=Fosglaidhean\nlatestUpdates=Na naidheachdan as \u00f9ire\ntournamentWinners=Feadhainn a bhuannaich f\u00e8ill-chluich\nname=Ainm\ndescription=Tuairisgeul\nno=Tha\nyes=Chan eil\nhelp=Cobhair:\ncreateANewTopic=Cruthaich cuspair \u00f9r\ntopics=Cuspairean\nposts=Postaichean\nlastPost=Am post mu dheireadh\nviews=Air a shealltainn\nreplies=Freagairtean\nreplyToThisTopic=Freagair dhan chuspair seo\nreply=Freagair\nmessage=Teachdaireachd\ncreateTheTopic=Cruthaich an cuspair\nreportAUser=D\u00e8an aithris air cleachdaiche\nuser=Cleachdaiche\nreason=Adhbhar\nwhatIsIheMatter=D\u00e8 an trioblaid?\ncheat=Cealgaireachd\ninsult=Mosach\ntroll=Troll\nother=Adhbhar eile\nby=le %s\nthisTopicIsNowClosed=Tha an cuspair seo d\u00f9inte a-nis.\ntheming=\u00d9rlar\nblog=Bloga\nquestionsAndAnswers=Ceistean & Freagairtean\nnotes=N\u00f2taichean\ntypePrivateNotesHere=Sgr\u00ecobh notaichean pr\u00ecobhaideach an seo\nprivacy=Pr\u00ecobhaideachd\nsound=Fuaim\ndifficultyEasy=Furasta\ndifficultyNormal=Meadhanach\ndifficultyHard=Doirbh\ntimeline=Loidhne-t\u00ecm\nseeAllTournaments=Faic na f\u00e8illean-cluich uile\nstarting=A' t\u00f2iseachadh\nyourCityRegionOrDepartment=Do bhaile, do sg\u00ecre no do mh\u00f3r-roinn.\ncommunity=Coimhearsnachd\ntools=Goireasean\nmenu=Cl\u00e0r-taice\nwatchGames=Coimhead geamannan\ntpTimeSpentOnTV=\u00d9ine air tbh: %s\nwatch=Coimhead\nvideoLibrary=Cruinneachadh bhidiothan\ncontact=Cuir fios\nlichessTournaments=F\u00e9illean-chluich Lichess\ntournamentOfficial=Oifigeil\ntimeBeforeTournamentStarts=\u00d9ine mus t\u00f2isich an fh\u00e9ill-chluich\nyouAreBetterThanPercentOfPerfTypePlayers=Tha thu nas fhearr na %s de chluicheadairean %s.\nconfirmResignation=Cinntich an g\u00e8illeadh\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"GDScript"} {"commit":"a44a38c64008cad635512bc95ecae05bd601e62e","subject":"fix : after finishing the level was restarting. Now shows the home menu","message":"fix : after finishing the level was restarting. Now shows the home menu\n","repos":"arnaudcoj\/godot_game_jam_2016,arnaudcoj\/godot_game_jam_2016","old_file":"sources\/scripts\/player\/player_behaviour.gd","new_file":"sources\/scripts\/player\/player_behaviour.gd","new_contents":"\nextends Node\n\nonready var player = get_parent()\n\nfunc _ready():\n\tpass\n\nfunc die():\n\tget_tree().get_root().get_node(\"root\").restart()\n\nfunc change_controls(control_1, control_2):\n\tif player != null:\n\t\tplayer.change_controls(control_1, control_2)\n\t\nfunc exit():\n\tget_tree().get_root().get_node(\"root\").show_menu()","old_contents":"\nextends Node\n\nonready var player = get_parent()\n\nfunc _ready():\n\tpass\n\nfunc die():\n\tget_tree().get_root().get_node(\"root\").restart()\n\nfunc change_controls(control_1, control_2):\n\tif player != null:\n\t\tplayer.change_controls(control_1, control_2)\n\t\nfunc exit():\n\tget_tree().get_root().get_node(\"root\").restart()","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"9954ff3bb38ef88de12dd44988c9f0f91c73f259","subject":"Implemented manual move_and_slide in anticipation for 2.2 <3","message":"Implemented manual move_and_slide in anticipation for 2.2 <3\n","repos":"NiclasEriksen\/godot_rpg","old_file":"scripts\/player_control.gd","new_file":"scripts\/player_control.gd","new_contents":"\nextends Node2D\n\n# member variables here, example:\n# var a=2\n# var b=\"textvar\"\n\nvar jump_cd = false\nsignal moved(pos, rot)\nsignal jump\nsignal attack\nvar attacking = false\nvar sprinting = false\nvar vel = Vector2(0, 0)\nvar cur_vel = 0\nvar max_vel = 150\nvar sprint_factor = 1.5\nvar rot_spd = 3\nvar root = null\nvar anim = null\n\n# Actual game data\nvar max_hp = 10\nvar cur_hp = max_hp\nvar max_mp = 5\nvar cur_mp = max_mp\n\nfunc _ready():\n\tset(\"cur_hp\", get(\"max_hp\") \/ 5)\n\tself.set_process(true)\n\tself.set_process_input(true)\n\troot = get_tree().get_root().get_node(\"Game\")\n\tanim = get_node(\"BodyAnimation\")\n\nfunc apply_stat(effect, attr, amount):\n\tif get(\"cur_\" + attr):\n\t\tif effect == \"increase\":\n\t\t\tif get(\"max_\" + attr):\n\t\t\t\tvar m = get(\"max_\" + attr)\n\t\t\t\tif get(\"cur_\" + attr) + amount < m:\n\t\t\t\t\tset(\"cur_\" + attr, get(\"cur_\" + attr) + amount)\n\t\t\t\telse:\n\t\t\t\t\tset(\"cur_\" + attr, m)\n\t\t\telse:\n\t\t\t\tset(\"cur_\" + attr, get(\"cur_\" + attr) + amount)\n\t\tif effect == \"decrease\":\n\t\t\tset(\"cur_\" + attr, get(\"cur_\" + attr) - amount)\n\n\nfunc _input(event):\n\tif event.is_action_pressed(\"MOVE_UP\"):\n\t\tvel.y = vel.y - max_vel\n\telif event.is_action_released(\"MOVE_UP\"):\n\t\tvel.y = vel.y + max_vel\n\tif event.is_action_pressed(\"MOVE_DOWN\"):\n\t\tvel.y = vel.y + max_vel\n\telif event.is_action_released(\"MOVE_DOWN\"):\n\t\tvel.y = vel.y - max_vel\n\tif event.is_action_pressed(\"MOVE_LEFT\"):\n\t\tvel.x = vel.x - max_vel\n\t\t# set_rot(get_rot() - 0.01)\n\telif event.is_action_released(\"MOVE_LEFT\"):\n\t\tvel.x = vel.x + max_vel\n\tif event.is_action_pressed(\"MOVE_RIGHT\"):\n\t\tvel.x = vel.x + max_vel\n\t\t# set_rot(get_rot() + 0.01)\n\telif event.is_action_released(\"MOVE_RIGHT\"):\n\t\tvel.x = vel.x - max_vel\n\nfunc _process(delta):\n\t# var r = get_rot()\n\tif Input.is_action_pressed(\"ATTACK\"):\n\t\tif not attacking:\n\t\t\temit_signal(\"attack\")\n\t\t\tattacking = true\n\telse:\n\t\tattacking = false\n\n\tif Input.is_action_pressed(\"MOVE_JUMP\"):\n\t\tself.jump()\n\t\n\tvar r = 0\n\t\n\tif root:\n\t\tr = get_angle_to(root.get_global_mouse_pos()) * (rot_spd * delta)\n\t\trotate(r)\n\t\t# if Input.is_action_pressed(\"MOUSE_ROTATE\"):\n\t\t# \tr = get_angle_to(root.get_global_mouse_pos()) * (rot_spd * delta)\n\t\t#\tif Input.is_action_pressed(\"MOVE_LEFT\"):\n\t\t#\t\tvel.x = max_vel\n\t\t#\telif Input.is_action_pressed(\"MOVE_RIGHT\"):\n\t\t#\t\tvel.x = -max_vel\n\t\t#else:\n\t\t#\tif Input.is_action_pressed(\"MOVE_LEFT\"):\n\t\t#\t\trotate(rot_spd * delta)\n\t\t#\tif Input.is_action_pressed(\"MOVE_RIGHT\"):\n\t\t#\t\trotate(-(rot_spd * delta))\n\t\t# print(vel.rotated(get_rot()), vel)\n\t\t# self.move_and_slide(vel * 50 * delta)\n\t\t# self.move(vel.rotated(get_rot()) * delta)\n\t\tvar motion = vel * delta\n\t\tmotion = move(motion)\n\t\tif (is_colliding()):\n \tvar n = get_collision_normal()\n \tmotion = n.slide(motion)\n \t# vel = n.slide(vel)\n \tmove(motion)\n\n\tself.emit_signal(\"moved\", get_pos(), get_rot())\n\tif anim:\n\t\tif vel.x > 0.0 or vel.x < 0.0 or vel.y > 0.0 or vel.y < 0.0:\n\t\t\tif not anim.is_playing():\n\t\t\t\tanim.play(\"Walk\")\n\t\t\telse:\n\t\t\t\tif Input.is_action_pressed(\"SPRINT\"):\n\t\t\t\t\tanim.set_speed(sprint_factor)\n\t\t\t\telse:\n\t\t\t\t\tanim.set_speed(1)\n\t\t\t\t# print(\"Starting\")\n\t\telse:\n\t\t\tif anim.is_playing():\n\t\t\t\t# print(\"Stopping\")\n\t\t\t\tanim.stop(true)\n\t\t\n\nfunc jump():\n\tself.emit_signal(\"jump\")\n\tself.emit_signal(\"moved\", get_pos(), get_rot())\n","old_contents":"\nextends Node2D\n\n# member variables here, example:\n# var a=2\n# var b=\"textvar\"\n\nvar jump_cd = false\nsignal moved(pos, rot)\nsignal jump\nsignal attack\nvar attacking = false\nvar sprinting = false\nvar vel = Vector2(0, 0)\nvar cur_vel = 0\nvar max_vel = 150\nvar sprint_factor = 1.5\nvar rot_spd = 3\nvar root = null\nvar anim = null\n\n# Actual game data\nvar max_hp = 10\nvar cur_hp = max_hp\nvar max_mp = 5\nvar cur_mp = max_mp\n\nfunc _ready():\n\tset(\"cur_hp\", get(\"max_hp\") \/ 5)\n\tself.set_process(true)\n\tself.set_process_input(true)\n\troot = get_tree().get_root().get_node(\"Game\")\n\tanim = get_node(\"BodyAnimation\")\n\nfunc apply_stat(effect, attr, amount):\n\tif get(\"cur_\" + attr):\n\t\tif effect == \"increase\":\n\t\t\tif get(\"max_\" + attr):\n\t\t\t\tvar m = get(\"max_\" + attr)\n\t\t\t\tif get(\"cur_\" + attr) + amount < m:\n\t\t\t\t\tset(\"cur_\" + attr, get(\"cur_\" + attr) + amount)\n\t\t\t\telse:\n\t\t\t\t\tset(\"cur_\" + attr, m)\n\t\t\telse:\n\t\t\t\tset(\"cur_\" + attr, get(\"cur_\" + attr) + amount)\n\t\tif effect == \"decrease\":\n\t\t\tset(\"cur_\" + attr, get(\"cur_\" + attr) - amount)\n\n\nfunc _input(event):\n\tif event.is_action_pressed(\"MOVE_UP\"):\n\t\tvel.y = vel.y - max_vel\n\telif event.is_action_released(\"MOVE_UP\"):\n\t\tvel.y = vel.y + max_vel\n\tif event.is_action_pressed(\"MOVE_DOWN\"):\n\t\tvel.y = vel.y + max_vel\n\telif event.is_action_released(\"MOVE_DOWN\"):\n\t\tvel.y = vel.y - max_vel\n\tif event.is_action_pressed(\"MOVE_LEFT\"):\n\t\tvel.x = vel.x - max_vel\n\t\t# set_rot(get_rot() - 0.01)\n\telif event.is_action_released(\"MOVE_LEFT\"):\n\t\tvel.x = vel.x + max_vel\n\tif event.is_action_pressed(\"MOVE_RIGHT\"):\n\t\tvel.x = vel.x + max_vel\n\t\t# set_rot(get_rot() + 0.01)\n\telif event.is_action_released(\"MOVE_RIGHT\"):\n\t\tvel.x = vel.x - max_vel\n\nfunc _process(delta):\n\t# var r = get_rot()\n\tif Input.is_action_pressed(\"ATTACK\"):\n\t\tif not attacking:\n\t\t\temit_signal(\"attack\")\n\t\t\tattacking = true\n\telse:\n\t\tattacking = false\n\n\tif Input.is_action_pressed(\"MOVE_JUMP\"):\n\t\tself.jump()\n\t\n\tvar r = 0\n\t\n\tif root:\n\t\tr = get_angle_to(root.get_global_mouse_pos()) * (rot_spd * delta)\n\t\trotate(r)\n\t\t# if Input.is_action_pressed(\"MOUSE_ROTATE\"):\n\t\t# \tr = get_angle_to(root.get_global_mouse_pos()) * (rot_spd * delta)\n\t\t#\tif Input.is_action_pressed(\"MOVE_LEFT\"):\n\t\t#\t\tvel.x = max_vel\n\t\t#\telif Input.is_action_pressed(\"MOVE_RIGHT\"):\n\t\t#\t\tvel.x = -max_vel\n\t\t#else:\n\t\t#\tif Input.is_action_pressed(\"MOVE_LEFT\"):\n\t\t#\t\trotate(rot_spd * delta)\n\t\t#\tif Input.is_action_pressed(\"MOVE_RIGHT\"):\n\t\t#\t\trotate(-(rot_spd * delta))\n\n\tif Input.is_action_pressed(\"SPRINT\"):\n\t\t# self.move_and_slide(vel * 75 * delta)\n\t\tself.move(vel * 1.5 * delta)\n\telse:\n\t\t# print(vel.rotated(get_rot()), vel)\n\t\t# self.move_and_slide(vel * 50 * delta)\n\t\t# self.move(vel.rotated(get_rot()) * delta)\n\t\tself.move(vel * delta)\n\n\tself.emit_signal(\"moved\", get_pos(), get_rot())\n\tif anim:\n\t\tif vel.x > 0.0 or vel.x < 0.0 or vel.y > 0.0 or vel.y < 0.0:\n\t\t\tif not anim.is_playing():\n\t\t\t\tanim.play(\"Walk\")\n\t\t\telse:\n\t\t\t\tif Input.is_action_pressed(\"SPRINT\"):\n\t\t\t\t\tanim.set_speed(sprint_factor)\n\t\t\t\telse:\n\t\t\t\t\tanim.set_speed(1)\n\t\t\t\t# print(\"Starting\")\n\t\telse:\n\t\t\tif anim.is_playing():\n\t\t\t\t# print(\"Stopping\")\n\t\t\t\tanim.stop(true)\n\t\t\n\nfunc jump():\n\tself.emit_signal(\"jump\")\n\tself.emit_signal(\"moved\", get_pos(), get_rot())\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"3b49706c78ec68f43c2e75232461bcaec8271024","subject":"nicer and more random easter eggs","message":"nicer and more random easter eggs\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/CameraControl.gd","new_file":"src\/scripts\/CameraControl.gd","new_contents":"# Make this work on touch:\n# catch InputEventScreenDrag, InputEventScreenTouch\n# write two-finger zoom\n\n\n# camera function that uses the mouse wheel to zoom\nextends Camera\n\n\n# global working variables\nvar turn = Vector2( 0.0, 0.0 ) # the amount the mouse has turned\nvar mouseposlast = Input.get_mouse_pos() # the mouses last position\nvar pos = Vector3(0.0,0.0,0.0) # the position of the camera\nvar up = Vector3(0.0,1.0,0.0) # the normalized 'up' vector pointing vertically\nvar target = Vector3(0.0,0.0,0.0) # the look at target\n\n\n# global tweakable parameters\nvar distance = { val = 16.0, max_ = 50, min_ = 15 }\nvar zoom_rate = 100 # the rate at which the camera zooms in and out of the target\nvar orbitrate = 20 # the rate the camera orbits the target when the mouse is moved\nvar target_move_rate = 1.0 # the rate the target look at point moves\n\n# Pause menu GUI item.\nvar pauseMenu\n\nfunc toMenu():\n\tvar menus = load( \"res:\/\/menus.scn\" ).instance()\n\tmenus.skipTitle(true)\n\tload(\"res:\/\/scripts\/GUIManager.gd\").goto_scene(get_tree(), [menus], true)\n\n\n# called once after node is setup\nfunc _ready():\n\tset_process_input(true) # process user input events here\n\t# Input.set_mouse_mode(2) # mouse mode captured\n\n\t# Setup the pause menu.\n\tpauseMenu = preload( \"res:\/\/dialog.scn\" ).instance()\n\tget_tree().get_root().add_child( pauseMenu )\n\tpauseMenu.hide()\n\n\tpauseMenu.get_label().set_autowrap(true)\n\n\tpauseMenu.set_pause_mode(PAUSE_MODE_PROCESS)\n\tpauseMenu.set_text(easter_eggs[randi() % easter_eggs.size()])\n\n\tpauseMenu.get_ok().connect(\"pressed\", self, \"toMenu\")\n\tpauseMenu.get_cancel().connect(\"pressed\", pauseMenu, \"hide\")\n\n\tpauseMenu.get_ok().set_text(\"Menu\")\n\tpauseMenu.get_cancel().set_text(\"Return to game\")\n\n\tpauseMenu.get_ok().set_pause_mode(PAUSE_MODE_PROCESS)\n\tpauseMenu.get_cancel().set_pause_mode(PAUSE_MODE_PROCESS)\n\n\t# pause when shown\n\tpauseMenu.connect(\"about_to_show\", self, \"preparePauseMenu\")\n\t# unpause when gone\n\tpauseMenu.connect(\"popup_hide\", get_tree(), \"set_pause\", [false])\n\tpauseMenu.connect(\"hide\", get_tree(), \"set_pause\", [false])\n\nconst easter_eggs = [\"There are no cheat codes for this game\", \"Get as much sleep as you can\",\n\t \"You are one of a kind, to a certain extent\",\n\t \"All block abusers report to the incinarator\",\n\t \"learnyouahaskell.com good for you, promise\",\n\t \"When storing carrots, take them out of the plastic packaging and wrap them in paper towels. They will last weeks longer. -- junta12\"\n\t ]\n\nfunc preparePauseMenu(arg0=null, arg1=null, arg2=null):\n\tvar txt = easter_eggs[randi() % easter_eggs.size()]\n\tpauseMenu.set_text(txt)\n\tget_tree().set_pause(true)\n\n\n# Repositions the camera based on the zoom level.\nfunc recalculate_camera():\n\tpos = get_translation();\n\tpos.z = distance.val;\n\tset_translation( pos )\n\n\n# called to handle a user input event\nfunc _input(ev):\n # if the user spins the mouse wheel up move the camera closer\n\tif (ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_WHEEL_UP):\n\t\tif (distance.val > distance.min_):\n\t\t\tdistance.val -= zoom_rate * get_process_delta_time()\n # if the user spins the mouse wheel down move the camera farther away\n\telif (ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_WHEEL_DOWN):\n\t\tif (distance.val < distance.max_):\n\t\t\tdistance.val += zoom_rate * get_process_delta_time()\n # if a cancel action is input close the application\n\telif (ev.is_action(\"ui_cancel\")):\n\t\t#OS.get_main_loop().quit()\n\t\tpauseMenu.popup_centered()\n\telse:\n\t\treturn\n\n\trecalculate_camera()\n","old_contents":"# Make this work on touch:\n# catch InputEventScreenDrag, InputEventScreenTouch\n# write two-finger zoom\n\n\n# camera function that uses the mouse wheel to zoom\nextends Camera\n\n\n# global working variables\nvar turn = Vector2( 0.0, 0.0 ) # the amount the mouse has turned\nvar mouseposlast = Input.get_mouse_pos() # the mouses last position\nvar pos = Vector3(0.0,0.0,0.0) # the position of the camera\nvar up = Vector3(0.0,1.0,0.0) # the normalized 'up' vector pointing vertically\nvar target = Vector3(0.0,0.0,0.0) # the look at target\n\n\n# global tweakable parameters\nvar distance = { val = 16.0, max_ = 50, min_ = 15 }\nvar zoom_rate = 100 # the rate at which the camera zooms in and out of the target\nvar orbitrate = 20 # the rate the camera orbits the target when the mouse is moved\nvar target_move_rate = 1.0 # the rate the target look at point moves\n\n# Pause menu GUI item.\nvar pauseMenu\n\nfunc toMenu():\n\tvar menus = load( \"res:\/\/menus.scn\" ).instance()\n\tmenus.skipTitle(true)\n\tload(\"res:\/\/scripts\/GUIManager.gd\").goto_scene(get_tree(), [menus], true)\n\n\n# called once after node is setup\nfunc _ready():\n\tset_process_input(true) # process user input events here\n\t# Input.set_mouse_mode(2) # mouse mode captured\n\n\t# Setup the pause menu.\n\tpauseMenu = preload( \"res:\/\/dialog.scn\" ).instance()\n\tget_tree().get_root().add_child( pauseMenu )\n\tpauseMenu.hide()\n\n\tpauseMenu.get_label().set_autowrap(true)\n\n\tpauseMenu.set_pause_mode(PAUSE_MODE_PROCESS)\n\tpauseMenu.set_text(easter_eggs[randi() % easter_eggs.size()])\n\n\tpauseMenu.get_ok().connect(\"pressed\", self, \"toMenu\")\n\tpauseMenu.get_cancel().connect(\"pressed\", pauseMenu, \"hide\")\n\n\tpauseMenu.get_ok().set_text(\"Menu\")\n\tpauseMenu.get_cancel().set_text(\"Return to game\")\n\n\tpauseMenu.get_ok().set_pause_mode(PAUSE_MODE_PROCESS)\n\tpauseMenu.get_cancel().set_pause_mode(PAUSE_MODE_PROCESS)\n\n\t# pause when shown\n\tpauseMenu.connect(\"about_to_show\", self, \"preparePauseMenu\")\n\t# unpause when gone\n\tpauseMenu.connect(\"popup_hide\", get_tree(), \"set_pause\", [false])\n\tpauseMenu.connect(\"hide\", get_tree(), \"set_pause\", [false])\n\nconst easter_eggs = [\"There are no cheat codes for this game\", \"Get as much sleep as you can\",\n\t \"Get out while you still can\",\n\t \"You are one of a kind, to a certain extent\",\n\t \"All block abusers report to the incinarator\",\n\t \"learnyouahaskell.com good for you, promise\",\n\t \"When storing carrots, take them out of the plastic packaging and wrap them in paper towels. They will last weeks longer. -- junta12\"\n\t ]\n\nfunc preparePauseMenu(arg0=null, arg1=null, arg2=null):\n\tpauseMenu.set_text(easter_eggs[randi() % easter_eggs.size()])\n\tget_tree().set_pause(true)\n\n\n# Repositions the camera based on the zoom level.\nfunc recalculate_camera():\n\tpos = get_translation();\n\tpos.z = distance.val;\n\tset_translation( pos )\n\n\n# called to handle a user input event\nfunc _input(ev):\n # if the user spins the mouse wheel up move the camera closer\n\tif (ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_WHEEL_UP):\n\t\tif (distance.val > distance.min_):\n\t\t\tdistance.val -= zoom_rate * get_process_delta_time()\n # if the user spins the mouse wheel down move the camera farther away\n\telif (ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_WHEEL_DOWN):\n\t\tif (distance.val < distance.max_):\n\t\t\tdistance.val += zoom_rate * get_process_delta_time()\n # if a cancel action is input close the application\n\telif (ev.is_action(\"ui_cancel\")):\n\t\t#OS.get_main_loop().quit()\n\t\tpauseMenu.popup_centered()\n\telse:\n\t\treturn\n\n\trecalculate_camera()\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"18c3e25fde33c7d9404f860daafdd75280073e41","subject":"Removed redundant code in the kinematic 3D demo.","message":"Removed redundant code in the kinematic 3D demo.\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"3d\/kinematic_char\/cubio.gd","new_file":"3d\/kinematic_char\/cubio.gd","new_contents":"\nextends KinematicBody\n\n# member variables here, example:\n# var a=2\n# var b=\"textvar\"\n\nvar g = -9.8\nvar vel = Vector3()\nconst MAX_SPEED = 5\nconst JUMP_SPEED = 7\nconst ACCEL= 2\nconst DEACCEL= 4\nconst MAX_SLOPE_ANGLE = 30\n\nfunc _fixed_process(delta):\n\n\tvar dir = Vector3() #where does the player intend to walk to\n\tvar cam_xform = get_node(\"target\/camera\").get_global_transform()\n\t\n\tif (Input.is_action_pressed(\"move_forward\")):\n\t\tdir+=-cam_xform.basis[2] \n\tif (Input.is_action_pressed(\"move_backwards\")):\n\t\tdir+=cam_xform.basis[2] \n\tif (Input.is_action_pressed(\"move_left\")):\n\t\tdir+=-cam_xform.basis[0] \n\tif (Input.is_action_pressed(\"move_right\")):\n\t\tdir+=cam_xform.basis[0] \n\n\tdir.y=0\n\tdir=dir.normalized()\n\n\tvel.y+=delta*g\n\t\n\tvar hvel = vel\n\thvel.y=0\t\n\t\n\tvar target = dir*MAX_SPEED\n\tvar accel\n\tif (dir.dot(hvel) >0):\n\t\taccel=ACCEL\n\telse:\n\t\taccel=DEACCEL\n\t\t\n\thvel = hvel.linear_interpolate(target,accel*delta)\n\t\n\tvel.x=hvel.x;\n\tvel.z=hvel.z\t\n\n\tvar motion = move(vel*delta)\n\n\tvar on_floor = false\n\tvar original_vel = vel\n\n\n\tvar floor_velocity=Vector3()\n\n\tvar attempts=4\n\t\n\twhile(is_colliding() and attempts):\n\t\tvar n=get_collision_normal()\n\n\t\tif ( rad2deg(acos(n.dot( Vector3(0,1,0)))) < MAX_SLOPE_ANGLE ):\n\t\t\t\t#if angle to the \"up\" vectors is < angle tolerance\n\t\t\t\t#char is on floor\n\t\t\t\tfloor_velocity=get_collider_velocity()\n\t\t\t\ton_floor=true\t\t\t\n\t\t\t\n\t\tmotion = n.slide(motion)\n\t\tvel = n.slide(vel)\n\t\tif (original_vel.dot(vel) > 0):\n\t\t\t#do not allow to slide towads the opposite direction we were coming from\n\t\t\tmotion=move(motion)\n\t\t\tif (motion.length()<0.001):\n\t\t\t\tbreak\n\t\tattempts-=1\n\n\tif (on_floor and floor_velocity!=Vector3()):\n\t\t\tmove(floor_velocity*delta)\n\t\n\tif (on_floor and Input.is_action_pressed(\"jump\")):\n\t\tvel.y=JUMP_SPEED\n\t\t\n\tvar crid = get_node(\"..\/elevator1\").get_rid()\n#\tprint(crid,\" : \",PS.body_get_state(crid,PS.BODY_STATE_TRANSFORM))\n\nfunc _ready():\n\t# Initalization here\n\tset_fixed_process(true)\n\tpass\n\n\nfunc _on_tcube_body_enter( body ):\n\tget_node(\"..\/ty\").show()\n\tpass # replace with function body\n","old_contents":"\nextends KinematicBody\n\n# member variables here, example:\n# var a=2\n# var b=\"textvar\"\n\nvar g = -9.8\nvar vel = Vector3()\nconst MAX_SPEED = 5\nconst JUMP_SPEED = 7\nconst ACCEL= 2\nconst DEACCEL= 4\nconst MAX_SLOPE_ANGLE = 30\n\nfunc _fixed_process(delta):\n\n\tvar dir = Vector3() #where does the player intend to walk to\n\tvar cam_xform = get_node(\"target\/camera\").get_global_transform()\n\t\n\tif (Input.is_action_pressed(\"move_forward\")):\n\t\tdir+=-cam_xform.basis[2] \n\tif (Input.is_action_pressed(\"move_backwards\")):\n\t\tdir+=cam_xform.basis[2] \n\tif (Input.is_action_pressed(\"move_left\")):\n\t\tdir+=-cam_xform.basis[0] \n\tif (Input.is_action_pressed(\"move_right\")):\n\t\tdir+=cam_xform.basis[0] \n\n\tdir.y=0\n\tdir=dir.normalized()\n\n\tvel.y+=delta*g\n\t\n\tvar hvel = vel\n\thvel.y=0\t\n\t\n\tvar target = dir*MAX_SPEED\n\tvar accel\n\tif (dir.dot(hvel) >0):\n\t\taccel=ACCEL\n\telse:\n\t\taccel=DEACCEL\n\t\t\n\thvel = hvel.linear_interpolate(target,accel*delta)\n\t\n\tvel.x=hvel.x;\n\tvel.z=hvel.z\t\n\t\t\n\tvar motion = vel*delta\n\tmotion=move(vel*delta)\n\n\tvar on_floor = false\n\tvar original_vel = vel\n\n\n\tvar floor_velocity=Vector3()\n\n\tvar attempts=4\n\t\n\twhile(is_colliding() and attempts):\n\t\tvar n=get_collision_normal()\n\n\t\tif ( rad2deg(acos(n.dot( Vector3(0,1,0)))) < MAX_SLOPE_ANGLE ):\n\t\t\t\t#if angle to the \"up\" vectors is < angle tolerance\n\t\t\t\t#char is on floor\n\t\t\t\tfloor_velocity=get_collider_velocity()\n\t\t\t\ton_floor=true\t\t\t\n\t\t\t\n\t\tmotion = n.slide(motion)\n\t\tvel = n.slide(vel)\n\t\tif (original_vel.dot(vel) > 0):\n\t\t\t#do not allow to slide towads the opposite direction we were coming from\n\t\t\tmotion=move(motion)\n\t\t\tif (motion.length()<0.001):\n\t\t\t\tbreak\n\t\tattempts-=1\n\n\tif (on_floor and floor_velocity!=Vector3()):\n\t\t\tmove(floor_velocity*delta)\n\t\n\tif (on_floor and Input.is_action_pressed(\"jump\")):\n\t\tvel.y=JUMP_SPEED\n\t\t\n\tvar crid = get_node(\"..\/elevator1\").get_rid()\n#\tprint(crid,\" : \",PS.body_get_state(crid,PS.BODY_STATE_TRANSFORM))\n\nfunc _ready():\n\t# Initalization here\n\tset_fixed_process(true)\n\tpass\n\n\nfunc _on_tcube_body_enter( body ):\n\tget_node(\"..\/ty\").show()\n\tpass # replace with function body\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"865318334c0546baa3e9e6091d4bb8d68b364a25","subject":"1.Change interpolate_callback:p_times_in_sec argument before p_callback argument(more readable) 2.NodePath replace to instance_ID(can control object doe's not in scene tree) 3.Change interpolate types from Node to Object, can control more types(etc script class object) 4.Add pending_update counter, avoid insert\/remove interpolates-list while traversal it","message":"1.Change interpolate_callback:p_times_in_sec argument before p_callback argument(more readable)\n2.NodePath replace to instance_ID(can control object doe's not in scene tree)\n3.Change interpolate types from Node to Object, can control more types(etc script class object)\n4.Add pending_update counter, avoid insert\/remove interpolates-list while traversal it\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"misc\/tween\/main.gd","new_file":"misc\/tween\/main.gd","new_contents":"\nextends Control\n\n# member variables here, example:\n# var a=2\n# var b=\"textvar\"\n\nvar trans = [\"linear\", \"sine\", \"quint\", \"quart\", \"quad\", \"expo\", \"elastic\", \"cubic\", \"circ\", \"bounce\", \"back\"]\nvar eases = [\"in\", \"out\", \"in_out\", \"out_in\"]\nvar modes = [\"move\", \"color\", \"scale\", \"rotate\", \"callback\", \"follow\", \"repeat\", \"pause\"]\n\nvar state = {\n\ttrans = Tween.TRANS_LINEAR,\n\teases = Tween.EASE_IN,\n}\n\nfunc _ready():\n\tfor index in range(trans.size()):\n\t\tvar name = trans[index]\n\t\tget_node(\"trans\/\" + name).connect(\"pressed\", self, \"on_trans_changed\", [name, index])\n\t\n\tfor index in range(eases.size()):\n\t\tvar name = eases[index]\n\t\tget_node(\"eases\/\" + name).connect(\"pressed\", self, \"on_eases_changed\", [name, index])\n\t\n\tfor index in range(modes.size()):\n\t\tvar name = modes[index]\n\t\tget_node(\"modes\/\" + name).connect(\"pressed\", self, \"on_modes_changed\", [name])\n\t\n\tget_node(\"color\/color_from\").set_color(Color(1, 0, 0, 1))\n\tget_node(\"color\/color_from\").connect(\"color_changed\", self, \"on_color_changed\")\n\t\n\tget_node(\"color\/color_to\").set_color(Color(0, 1, 1, 1))\n\tget_node(\"color\/color_to\").connect(\"color_changed\", self, \"on_color_changed\")\n\t\n\tget_node(\"trans\/linear\").set_pressed(true)\n\tget_node(\"eases\/in\").set_pressed(true)\n\tget_node(\"modes\/move\").set_pressed(true)\n\tget_node(\"modes\/repeat\").set_pressed(true)\n\t\n\treset_tween()\n\t\n\t# Initalization here\n\tpass\n\nfunc on_trans_changed(name, index):\n\tfor index in range(trans.size()):\n\t\tvar pressed = trans[index] == name\n\t\tvar btn = get_node(\"trans\/\" + trans[index])\n\t\t\n\t\tbtn.set_pressed(pressed)\n\t\tbtn.set_ignore_mouse(pressed)\n\t\n\tstate.trans = index\n\treset_tween()\n\t\nfunc on_eases_changed(name, index):\n\tfor index in range(eases.size()):\n\t\tvar pressed = eases[index] == name\n\t\tvar btn = get_node(\"eases\/\" + eases[index])\n\t\t\n\t\tbtn.set_pressed(pressed)\n\t\tbtn.set_ignore_mouse(pressed)\n\t\n\tstate.eases = index\n\treset_tween()\n\t\nfunc on_modes_changed(name):\n\tvar tween = get_node(\"tween\")\n\tif name == \"pause\":\n\t\tif get_node(\"modes\/pause\").is_pressed():\n\t\t\ttween.stop_all()\n\t\t\tget_node(\"timeline\").set_ignore_mouse(false)\n\t\telse:\n\t\t\ttween.resume_all()\n\t\t\tget_node(\"timeline\").set_ignore_mouse(true)\n\telse:\n\t\treset_tween()\n\t\nfunc on_color_changed(color):\n\treset_tween()\n\t\nfunc reset_tween():\n\tvar tween = get_node(\"tween\")\n\tvar pos = tween.tell()\n\ttween.reset_all()\n\ttween.remove_all()\n\t\n\tvar sprite = get_node(\"tween\/area\/sprite\")\n\tvar follow = get_node(\"tween\/area\/follow\")\n\tvar follow_2 = get_node(\"tween\/area\/follow_2\")\n\tvar size = get_node(\"tween\/area\").get_size()\n\n\tif get_node(\"modes\/move\").is_pressed():\n\t\ttween.interpolate_method(sprite, \"set_pos\", Vector2(0,0), Vector2(size.width, size.height), 2, state.trans, state.eases)\n\t\ttween.interpolate_property(sprite, \"transform\/pos\", Vector2(size.width,size.height), Vector2(0, 0), 2, state.trans, state.eases, 2)\n\t\n\tif get_node(\"modes\/color\").is_pressed():\n\t\ttween.interpolate_method(sprite, \"set_modulate\", get_node(\"color\/color_from\").get_color(), get_node(\"color\/color_to\").get_color(), 2, state.trans, state.eases)\n\t\ttween.interpolate_property(sprite, \"modulate\", get_node(\"color\/color_to\").get_color(), get_node(\"color\/color_from\").get_color(), 2, state.trans, state.eases, 2)\n\telse:\n\t\tsprite.set_modulate(Color(1, 1, 1, 1))\n\t\n\tif get_node(\"modes\/scale\").is_pressed():\n\t\ttween.interpolate_method(sprite, \"set_scale\", Vector2(0.5,0.5), Vector2(1.5, 1.5), 2, state.trans, state.eases)\n\t\ttween.interpolate_property(sprite, \"transform\/scale\", Vector2(1.5,1.5), Vector2(0.5, 0.5), 2, state.trans, state.eases, 2)\n\telse:\n\t\tsprite.set_scale(Vector2(1, 1))\n\t\n\tif get_node(\"modes\/rotate\").is_pressed():\n\t\ttween.interpolate_method(sprite, \"_set_rotd\", 0, 360, 2, state.trans, state.eases)\n\t\ttween.interpolate_property(sprite, \"transform\/rot\", 360, 0, 2, state.trans, state.eases, 2)\n\t\n\tif get_node(\"modes\/callback\").is_pressed():\n\t\ttween.interpolate_callback(self, 0.5, \"on_callback\", \"0.5 second's after\")\n\t\ttween.interpolate_callback(self, 0.2, \"on_callback\", \"1.2 second's after\")\n\t\n\tif get_node(\"modes\/follow\").is_pressed():\n\t\tfollow.show()\n\t\tfollow_2.show()\n\t\t\n\t\ttween.follow_method(follow, \"set_pos\", Vector2(0, size.height), sprite, \"get_pos\", 2, state.trans, state.eases)\n\t\ttween.targeting_method(follow, \"set_pos\", sprite, \"get_pos\", Vector2(0, size.height), 2, state.trans, state.eases, 2)\n\t\t\n\t\ttween.targeting_property(follow_2, \"transform\/pos\", sprite, \"transform\/pos\", Vector2(size.width, 0), 2, state.trans, state.eases)\n\t\ttween.follow_property(follow_2, \"transform\/pos\", Vector2(size.width, 0), sprite, \"transform\/pos\", 2, state.trans, state.eases, 2)\n\telse:\n\t\tfollow.hide()\n\t\tfollow_2.hide()\n\t\n\ttween.set_repeat(get_node(\"modes\/repeat\").is_pressed())\n\ttween.start()\n\ttween.seek(pos)\n\t\n\tif get_node(\"modes\/pause\").is_pressed():\n\t\ttween.stop_all()\n\t\tget_node(\"timeline\").set_ignore_mouse(false)\n\t\tget_node(\"timeline\").set_value(0)\n\telse:\n\t\ttween.resume_all()\n\t\tget_node(\"timeline\").set_ignore_mouse(true)\n\t\nfunc _on_tween_step( object, key, elapsed, value ):\n\n\tvar timeline = get_node(\"timeline\")\n\n\tvar tween = get_node(\"tween\")\n\tvar runtime = tween.get_runtime()\n\n\tvar ratio = 100 * (elapsed \/ runtime)\n\ttimeline.set_value(ratio)\n\t\n\nfunc _on_timeline_value_changed( value ):\n\tif !get_node(\"modes\/pause\").is_pressed():\n\t\treturn\n\t\n\tvar tween = get_node(\"tween\")\n\tvar runtime = tween.get_runtime()\n\ttween.seek(runtime * value \/ 100)\n\t\nfunc on_callback(arg):\n\tvar label = get_node(\"tween\/area\/label\")\n\tlabel.add_text(\"on_callback -> \" + arg + \"\\n\")\n","old_contents":"\nextends Control\n\n# member variables here, example:\n# var a=2\n# var b=\"textvar\"\n\nvar trans = [\"linear\", \"sine\", \"quint\", \"quart\", \"quad\", \"expo\", \"elastic\", \"cubic\", \"circ\", \"bounce\", \"back\"]\nvar eases = [\"in\", \"out\", \"in_out\", \"out_in\"]\nvar modes = [\"move\", \"color\", \"scale\", \"rotate\", \"callback\", \"follow\", \"repeat\", \"pause\"]\n\nvar state = {\n\ttrans = Tween.TRANS_LINEAR,\n\teases = Tween.EASE_IN,\n}\n\nfunc _ready():\n\tfor index in range(trans.size()):\n\t\tvar name = trans[index]\n\t\tget_node(\"trans\/\" + name).connect(\"pressed\", self, \"on_trans_changed\", [name, index])\n\t\n\tfor index in range(eases.size()):\n\t\tvar name = eases[index]\n\t\tget_node(\"eases\/\" + name).connect(\"pressed\", self, \"on_eases_changed\", [name, index])\n\t\n\tfor index in range(modes.size()):\n\t\tvar name = modes[index]\n\t\tget_node(\"modes\/\" + name).connect(\"pressed\", self, \"on_modes_changed\", [name])\n\t\n\tget_node(\"color\/color_from\").set_color(Color(1, 0, 0, 1))\n\tget_node(\"color\/color_from\").connect(\"color_changed\", self, \"on_color_changed\")\n\t\n\tget_node(\"color\/color_to\").set_color(Color(0, 1, 1, 1))\n\tget_node(\"color\/color_to\").connect(\"color_changed\", self, \"on_color_changed\")\n\t\n\tget_node(\"trans\/linear\").set_pressed(true)\n\tget_node(\"eases\/in\").set_pressed(true)\n\tget_node(\"modes\/move\").set_pressed(true)\n\tget_node(\"modes\/repeat\").set_pressed(true)\n\t\n\treset_tween()\n\t\n\t# Initalization here\n\tpass\n\nfunc on_trans_changed(name, index):\n\tfor index in range(trans.size()):\n\t\tvar pressed = trans[index] == name\n\t\tvar btn = get_node(\"trans\/\" + trans[index])\n\t\t\n\t\tbtn.set_pressed(pressed)\n\t\tbtn.set_ignore_mouse(pressed)\n\t\n\tstate.trans = index\n\treset_tween()\n\t\nfunc on_eases_changed(name, index):\n\tfor index in range(eases.size()):\n\t\tvar pressed = eases[index] == name\n\t\tvar btn = get_node(\"eases\/\" + eases[index])\n\t\t\n\t\tbtn.set_pressed(pressed)\n\t\tbtn.set_ignore_mouse(pressed)\n\t\n\tstate.eases = index\n\treset_tween()\n\t\nfunc on_modes_changed(name):\n\tvar tween = get_node(\"tween\")\n\tif name == \"pause\":\n\t\tif get_node(\"modes\/pause\").is_pressed():\n\t\t\ttween.stop_all()\n\t\t\tget_node(\"timeline\").set_ignore_mouse(false)\n\t\telse:\n\t\t\ttween.resume_all()\n\t\t\tget_node(\"timeline\").set_ignore_mouse(true)\n\telse:\n\t\treset_tween()\n\t\nfunc on_color_changed(color):\n\treset_tween()\n\t\nfunc reset_tween():\n\tvar tween = get_node(\"tween\")\n\tvar pos = tween.tell()\n\ttween.reset_all()\n\ttween.remove_all()\n\t\n\tvar sprite = get_node(\"tween\/area\/sprite\")\n\tvar follow = get_node(\"tween\/area\/follow\")\n\tvar follow_2 = get_node(\"tween\/area\/follow_2\")\n\tvar size = get_node(\"tween\/area\").get_size()\n\n\tif get_node(\"modes\/move\").is_pressed():\n\t\ttween.interpolate_method(sprite, \"set_pos\", Vector2(0,0), Vector2(size.width, size.height), 2, state.trans, state.eases)\n\t\ttween.interpolate_property(sprite, \"transform\/pos\", Vector2(size.width,size.height), Vector2(0, 0), 2, state.trans, state.eases, 2)\n\t\n\tif get_node(\"modes\/color\").is_pressed():\n\t\ttween.interpolate_method(sprite, \"set_modulate\", get_node(\"color\/color_from\").get_color(), get_node(\"color\/color_to\").get_color(), 2, state.trans, state.eases)\n\t\ttween.interpolate_property(sprite, \"modulate\", get_node(\"color\/color_to\").get_color(), get_node(\"color\/color_from\").get_color(), 2, state.trans, state.eases, 2)\n\telse:\n\t\tsprite.set_modulate(Color(1, 1, 1, 1))\n\t\n\tif get_node(\"modes\/scale\").is_pressed():\n\t\ttween.interpolate_method(sprite, \"set_scale\", Vector2(0.5,0.5), Vector2(1.5, 1.5), 2, state.trans, state.eases)\n\t\ttween.interpolate_property(sprite, \"transform\/scale\", Vector2(1.5,1.5), Vector2(0.5, 0.5), 2, state.trans, state.eases, 2)\n\telse:\n\t\tsprite.set_scale(Vector2(1, 1))\n\t\n\tif get_node(\"modes\/rotate\").is_pressed():\n\t\ttween.interpolate_method(sprite, \"_set_rotd\", 0, 360, 2, state.trans, state.eases)\n\t\ttween.interpolate_property(sprite, \"transform\/rot\", 360, 0, 2, state.trans, state.eases, 2)\n\t\n\tif get_node(\"modes\/callback\").is_pressed():\n\t\ttween.interpolate_callback(self, \"on_callback\", 0.5, \"0.5 second's after\")\n\t\ttween.interpolate_callback(self, \"on_callback\", 1.2, \"1.2 second's after\")\n\t\n\tif get_node(\"modes\/follow\").is_pressed():\n\t\tfollow.show()\n\t\tfollow_2.show()\n\t\t\n\t\ttween.follow_method(follow, \"set_pos\", Vector2(0, size.height), sprite, \"get_pos\", 2, state.trans, state.eases)\n\t\ttween.targeting_method(follow, \"set_pos\", sprite, \"get_pos\", Vector2(0, size.height), 2, state.trans, state.eases, 2)\n\t\t\n\t\ttween.targeting_property(follow_2, \"transform\/pos\", sprite, \"transform\/pos\", Vector2(size.width, 0), 2, state.trans, state.eases)\n\t\ttween.follow_property(follow_2, \"transform\/pos\", Vector2(size.width, 0), sprite, \"transform\/pos\", 2, state.trans, state.eases, 2)\n\telse:\n\t\tfollow.hide()\n\t\tfollow_2.hide()\n\t\n\ttween.set_repeat(get_node(\"modes\/repeat\").is_pressed())\n\ttween.start()\n\ttween.seek(pos)\n\t\n\tif get_node(\"modes\/pause\").is_pressed():\n\t\ttween.stop_all()\n\t\tget_node(\"timeline\").set_ignore_mouse(false)\n\t\tget_node(\"timeline\").set_value(0)\n\telse:\n\t\ttween.resume_all()\n\t\tget_node(\"timeline\").set_ignore_mouse(true)\n\t\nfunc _on_tween_step( object, key, elapsed, value ):\n\n\tvar timeline = get_node(\"timeline\")\n\n\tvar tween = get_node(\"tween\")\n\tvar runtime = tween.get_runtime()\n\n\tvar ratio = 100 * (elapsed \/ runtime)\n\ttimeline.set_value(ratio)\n\t\n\nfunc _on_timeline_value_changed( value ):\n\tif !get_node(\"modes\/pause\").is_pressed():\n\t\treturn\n\t\n\tvar tween = get_node(\"tween\")\n\tvar runtime = tween.get_runtime()\n\ttween.seek(runtime * value \/ 100)\n\t\nfunc on_callback(arg):\n\tvar label = get_node(\"tween\/area\/label\")\n\tlabel.add_text(\"on_callback -> \" + arg + \"\\n\")\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"f2fc4005b3c6c1aeb378092b5cf7a3c61b9efabc","subject":"Fix zoom beginning at the wrong position","message":"Fix zoom beginning at the wrong position\n","repos":"mvr\/abyme","old_file":"Director.gd","new_file":"Director.gd","new_contents":"extends Node2D\n\nvar player_block = null\n\n# As a world position\nvar distant_home = Vector2(-1000000, -1000000)\nvar camera_target = Vector2(0, 0)\nvar camera_pos = Vector2(0, 0)\nvar camera_zoom = 1\nvar camera_zoom_target = 1\n\nfunc _ready():\n\tVisualServer.set_default_clear_color(Constants.background_fade)\n\tself.set_pos(self.distant_home)\n\tself.set_fixed_process(true)\n\nfunc setup():\n\tself.find_target()\n\tself.camera_pos = self.camera_target\n\nfunc int_exp(i,e):\n\tif e < 0:\n\t\treturn 1.0 \/ int_exp(i,-e)\n\tif e == 0:\n\t\treturn 1\n\telse:\n\t\treturn i * int_exp(i, e-1)\n\nfunc log_base(x, b):\n\treturn log(x) \/ log(b)\n\n################################################################################\n## Drawing\n\nfunc draw_rect(rect, colour, width):\n\tvar corner1 = rect.pos\n\tvar corner2 = rect.pos + Vector2(0, rect.size.y)\n\tvar corner3 = rect.end\n\tvar corner4 = rect.pos + Vector2(rect.size.x, 0)\n\n\tself.draw_line(corner1, corner2, colour, width)\n\tself.draw_line(corner2, corner3, colour, width)\n\tself.draw_line(corner3, corner4, colour, width)\n\tself.draw_line(corner4, corner1, colour, width)\n\nfunc draw_tilemap_manually(block, pos, scale, depth, start_depth):\n\tvar tileset = block.tilemap.get_tileset()\n\tvar block_screen_size = block.tilemap.get_cell_size() * int_exp(Constants.block_size, scale)\n\tvar cell_screen_size = block.tilemap.get_cell_size() * int_exp(Constants.block_size, scale - 1)\n\n\tvar fade_colour = null\n\tif depth == start_depth :\n\t\tvar fade_amount = log_base(self.camera_zoom, Constants.block_size)\n\t\tfade_colour = Color(1,1,1).linear_interpolate(Constants.background_fade, fade_amount)\n\telif depth < start_depth:\n\t\tfade_colour = Constants.background_fade\n\telse:\n\t\tfade_colour = Color(1,1,1)\n\n\tfor i in range(Constants.block_size):\n\t\tfor j in range(Constants.block_size):\n\t\t\tvar tile = block.tilemap.get_cell(i, j)\n\t\t\tvar texture = tileset.tile_get_texture(tile)\n\t\t\tvar corner = pos + cell_screen_size * Vector2(i, j)\n\t\t\tvar drawrect = Rect2(corner, cell_screen_size)\n\t\t\tself.draw_texture_rect(texture, drawrect, false, fade_colour)\n\nfunc draw_block_manually(block, pos, scale, depth, start_depth, max_depth):\n\tif depth > max_depth:\n\t\t# Just use existing texture\n\t\tvar block_screen_size = block.tilemap.get_cell_size() * int_exp(Constants.block_size, scale)\n\t\tvar drawrect = Rect2(pos, block_screen_size)\n\t\tvar texture = block.viewport.get_render_target_texture()\n\t\tself.draw_texture_rect(texture, drawrect, false)\n\t\treturn\n\n\tvar block_screen_size = block.tilemap.get_cell_size() * int_exp(Constants.block_size, scale)\n\tvar cell_screen_size = block.tilemap.get_cell_size() * int_exp(Constants.block_size, scale - 1)\n\n\tif depth == 0:\n\t\tself.draw_tilemap_manually(block, pos, scale, depth, start_depth)\n\n\t# This ordering is required to stop things drawing over each other\n\tfor b in block.child_blocks:\n\t\tvar child_pos = pos + (b.visual_position_on_parent() * cell_screen_size)\n\t\tself.draw_tilemap_manually(b, child_pos, scale - 1, depth + 1, start_depth)\n\n\tfor b in block.child_blocks:\n\t\tvar child_pos = pos + (b.visual_position_on_parent() * cell_screen_size)\n\t\tself.draw_block_manually(b, child_pos, scale - 1, depth + 1, start_depth, max_depth)\n\n\t# for b in block.child_blocks:\n\t# \tvar child_pos = pos + (b.visual_position_on_parent() * cell_screen_size)\n\n\t# \tvar corner1 = child_pos\n\t# \tvar corner2 = child_pos + Vector2(0, cell_screen_size.y)\n\t# \tvar corner3 = child_pos + Vector2(cell_screen_size.x, cell_screen_size.y)\n\t# \tvar corner4 = child_pos + Vector2(cell_screen_size.x, 0)\n\n\t# \tvar grey = Color(0.5, 0.5, 0.5)\n\t# \tself.draw_line(corner1, corner2, grey, 1)\n\t# \tself.draw_line(corner2, corner3, grey, 1)\n\t# \tself.draw_line(corner3, corner4, grey, 1)\n\t# \tself.draw_line(corner4, corner1, grey, 1)\n\nfunc draw_with_parents(block, pos, depth, up_depth, down_depth):\n\tif depth == up_depth:\n\t\tself.draw_block_manually(block, pos, depth+1, 0, up_depth, up_depth + down_depth)\n\t\treturn\n\n\tvar background_offset = -block.visual_position_on_parent() * block.tilemap.get_cell_size() * int_exp(Constants.block_size, depth + 1)\n\n\tself.draw_with_parents(block.parent_block, pos + background_offset, depth + 1, up_depth, down_depth)\n\nfunc _draw():\n\tself.draw_with_parents(self.player_block.parent_block, Vector2(0, 0), 0, 4, 0)\n\n\tvar parent_rect = Rect2(Vector2(0,0), self.player_block.tilemap.get_cell_size() * Constants.block_size)\n\t# self.draw_rect(parent_rect, Constants.player_highlight, 1)\n\n\tvar self_rect = Rect2(self.player_block.visual_position_on_parent() * self.player_block.tilemap.get_cell_size(), self.player_block.tilemap.get_cell_size())\n\tself.draw_rect(self_rect, Constants.player_highlight, 1)\n\nfunc _fixed_process(delta):\n\tfind_target()\n\tadjust_camera(delta)\n\tset_camera()\n\tself.update()\n\n################################################################################\n## Camera\n\nfunc move_camera(move_vect):\n\tvar block_size = Constants.block_size * self.player_block.tilemap.get_cell_size()\n\tself.camera_pos -= move_vect * block_size\n\nfunc zoom_camera():\n\tvar previous_block_size = self.player_block.tilemap.get_cell_size()\n\tvar block_size = Constants.block_size * self.player_block.tilemap.get_cell_size()\n\tvar block_center = Vector2(0.5, 0.5) * block_size\n\n\t# Currently this works by assuming self.player_block has already been replaced\n\tvar shift_pos = (self.player_block.visual_position_on_parent() + Vector2(0.5, 0.5)) * previous_block_size\n\n\tself.camera_pos = (self.camera_pos - block_center) \/ Constants.block_size + shift_pos\n\tself.camera_zoom *= Constants.block_size\n\nfunc find_target():\n\tvar block_size = Constants.block_size * self.player_block.tilemap.get_cell_size()\n\tvar block_grid_position = Vector2(0, 0)\n\tvar block_center = (block_grid_position + Vector2(0.5, 0.5)) * block_size\n\n\tself.camera_target = block_center\n\nfunc adjust_camera(delta):\n\tvar diff = self.camera_target - self.camera_pos\n\tself.camera_pos += diff * Constants.camera_lerp * delta\n\n\tvar zoom_diff = self.camera_zoom_target - self.camera_zoom\n\tself.camera_zoom += zoom_diff * Constants.camera_zoom_lerp * delta\n\nfunc set_camera():\n\tvar screen_center = self.get_viewport().get_rect().size \/ 2\n\tvar screen_transform = Matrix32(0, screen_center)\n\n\tvar camera_transform = Matrix32(0, -self.camera_pos - self.distant_home).scaled(Vector2(camera_zoom, camera_zoom))\n\tself.get_viewport().set_canvas_transform(screen_transform*camera_transform)\n","old_contents":"extends Node2D\n\nvar player_block = null\n\n# As a world position\nvar distant_home = Vector2(-1000000, -1000000)\nvar camera_target = Vector2(0, 0)\nvar camera_pos = Vector2(0, 0)\nvar camera_zoom = 1\nvar camera_zoom_target = 1\n\nfunc _ready():\n\tVisualServer.set_default_clear_color(Constants.background_fade)\n\tself.set_pos(self.distant_home)\n\tself.set_fixed_process(true)\n\nfunc setup():\n\tself.find_target()\n\tself.camera_pos = self.camera_target\n\nfunc int_exp(i,e):\n\tif e < 0:\n\t\treturn 1.0 \/ int_exp(i,-e)\n\tif e == 0:\n\t\treturn 1\n\telse:\n\t\treturn i * int_exp(i, e-1)\n\nfunc log_base(x, b):\n\treturn log(x) \/ log(b)\n\n################################################################################\n## Drawing\n\nfunc draw_rect(rect, colour, width):\n\tvar corner1 = rect.pos\n\tvar corner2 = rect.pos + Vector2(0, rect.size.y)\n\tvar corner3 = rect.end\n\tvar corner4 = rect.pos + Vector2(rect.size.x, 0)\n\n\tself.draw_line(corner1, corner2, colour, width)\n\tself.draw_line(corner2, corner3, colour, width)\n\tself.draw_line(corner3, corner4, colour, width)\n\tself.draw_line(corner4, corner1, colour, width)\n\nfunc draw_tilemap_manually(block, pos, scale, depth, start_depth):\n\tvar tileset = block.tilemap.get_tileset()\n\tvar block_screen_size = block.tilemap.get_cell_size() * int_exp(Constants.block_size, scale)\n\tvar cell_screen_size = block.tilemap.get_cell_size() * int_exp(Constants.block_size, scale - 1)\n\n\tvar fade_colour = null\n\tif depth == start_depth :\n\t\tvar fade_amount = log_base(self.camera_zoom, Constants.block_size)\n\t\tfade_colour = Color(1,1,1).linear_interpolate(Constants.background_fade, fade_amount)\n\telif depth < start_depth:\n\t\tfade_colour = Constants.background_fade\n\telse:\n\t\tfade_colour = Color(1,1,1)\n\n\tfor i in range(Constants.block_size):\n\t\tfor j in range(Constants.block_size):\n\t\t\tvar tile = block.tilemap.get_cell(i, j)\n\t\t\tvar texture = tileset.tile_get_texture(tile)\n\t\t\tvar corner = pos + cell_screen_size * Vector2(i, j)\n\t\t\tvar drawrect = Rect2(corner, cell_screen_size)\n\t\t\tself.draw_texture_rect(texture, drawrect, false, fade_colour)\n\nfunc draw_block_manually(block, pos, scale, depth, start_depth, max_depth):\n\tif depth > max_depth:\n\t\t# Just use existing texture\n\t\tvar block_screen_size = block.tilemap.get_cell_size() * int_exp(Constants.block_size, scale)\n\t\tvar drawrect = Rect2(pos, block_screen_size)\n\t\tvar texture = block.viewport.get_render_target_texture()\n\t\tself.draw_texture_rect(texture, drawrect, false)\n\t\treturn\n\n\tvar block_screen_size = block.tilemap.get_cell_size() * int_exp(Constants.block_size, scale)\n\tvar cell_screen_size = block.tilemap.get_cell_size() * int_exp(Constants.block_size, scale - 1)\n\n\tif depth == 0:\n\t\tself.draw_tilemap_manually(block, pos, scale, depth, start_depth)\n\n\t# This ordering is required to stop things drawing over each other\n\tfor b in block.child_blocks:\n\t\tvar child_pos = pos + (b.visual_position_on_parent() * cell_screen_size)\n\t\tself.draw_tilemap_manually(b, child_pos, scale - 1, depth + 1, start_depth)\n\n\tfor b in block.child_blocks:\n\t\tvar child_pos = pos + (b.visual_position_on_parent() * cell_screen_size)\n\t\tself.draw_block_manually(b, child_pos, scale - 1, depth + 1, start_depth, max_depth)\n\n\t# for b in block.child_blocks:\n\t# \tvar child_pos = pos + (b.visual_position_on_parent() * cell_screen_size)\n\n\t# \tvar corner1 = child_pos\n\t# \tvar corner2 = child_pos + Vector2(0, cell_screen_size.y)\n\t# \tvar corner3 = child_pos + Vector2(cell_screen_size.x, cell_screen_size.y)\n\t# \tvar corner4 = child_pos + Vector2(cell_screen_size.x, 0)\n\n\t# \tvar grey = Color(0.5, 0.5, 0.5)\n\t# \tself.draw_line(corner1, corner2, grey, 1)\n\t# \tself.draw_line(corner2, corner3, grey, 1)\n\t# \tself.draw_line(corner3, corner4, grey, 1)\n\t# \tself.draw_line(corner4, corner1, grey, 1)\n\nfunc draw_with_parents(block, pos, depth, up_depth, down_depth):\n\tif depth == up_depth:\n\t\tself.draw_block_manually(block, pos, depth+1, 0, up_depth, up_depth + down_depth)\n\t\treturn\n\n\tvar background_offset = -block.visual_position_on_parent() * block.tilemap.get_cell_size() * int_exp(Constants.block_size, depth + 1)\n\n\tself.draw_with_parents(block.parent_block, pos + background_offset, depth + 1, up_depth, down_depth)\n\nfunc _draw():\n\tself.draw_with_parents(self.player_block.parent_block, Vector2(0, 0), 0, 4, 0)\n\n\tvar parent_rect = Rect2(Vector2(0,0), self.player_block.tilemap.get_cell_size() * Constants.block_size)\n\t# self.draw_rect(parent_rect, Constants.player_highlight, 1)\n\n\tvar self_rect = Rect2(self.player_block.visual_position_on_parent() * self.player_block.tilemap.get_cell_size(), self.player_block.tilemap.get_cell_size())\n\tself.draw_rect(self_rect, Constants.player_highlight, 1)\n\nfunc _fixed_process(delta):\n\tfind_target()\n\tadjust_camera(delta)\n\tset_camera()\n\tself.update()\n\n################################################################################\n## Camera\n\nfunc move_camera(move_vect):\n\tvar block_size = Constants.block_size * self.player_block.tilemap.get_cell_size()\n\tself.camera_pos -= move_vect * block_size\n\nfunc zoom_camera():\n\tvar previous_block_size = self.player_block.tilemap.get_cell_size()\n\tvar block_size = Constants.block_size * self.player_block.tilemap.get_cell_size()\n\tvar block_center = Vector2(0.5, 0.5) * block_size\n\n\t# Currently this works by assuming self.player_block has already been replaced\n\tvar shift_pos = (self.player_block.visual_position_on_parent() + Vector2(0.5, 0.5)) * previous_block_size\n\n\t# TODO: The camera_pos should be adjusted somehow relative to camera_zoom\n\tself.camera_pos += - block_center + shift_pos\n\tself.camera_zoom *= Constants.block_size\n\nfunc find_target():\n\tvar block_size = Constants.block_size * self.player_block.tilemap.get_cell_size()\n\tvar block_grid_position = Vector2(0, 0)\n\tvar block_center = (block_grid_position + Vector2(0.5, 0.5)) * block_size\n\n\tself.camera_target = self.distant_home + block_center\n\nfunc adjust_camera(delta):\n\tvar diff = self.camera_target - self.camera_pos\n\tself.camera_pos += diff * Constants.camera_lerp * delta\n\n\tvar zoom_diff = self.camera_zoom_target - self.camera_zoom\n\tself.camera_zoom += zoom_diff * Constants.camera_zoom_lerp * delta\n\nfunc set_camera():\n\tvar screen_center = self.get_viewport().get_rect().size \/ 2\n\tvar screen_transform = Matrix32(0, screen_center)\n\n\tvar camera_transform = Matrix32(0, -self.camera_pos).scaled(Vector2(camera_zoom, camera_zoom))\n\tself.get_viewport().set_canvas_transform(screen_transform*camera_transform)\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"GDScript"} {"commit":"697533fb7d4c067d6151fe991b1b937e026649fc","subject":"Revert \"mainPuzzle off by default. seed random number gen. save puzzles by seed into SavedPuzzles\/. GridMan in charge of its own shape.\"","message":"Revert \"mainPuzzle off by default. seed random number gen. save puzzles by seed into SavedPuzzles\/. GridMan in charge of its own shape.\"\n\nThis reverts commit a3161604947b9b35d7eac9063239b68181eefd14.\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/GridMan.gd","new_file":"src\/scripts\/GridMan.gd","new_contents":"extends Spatial\n\n# Is there a better way to do this?\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\n# Shape dictionary to access blocks quickly by position.\nvar shape = {}\n\n# Block selection handling.\nvar offClick = false\nvar selectedBlocks = []\n\n# Puzzle vars.\nvar puzzle\n\n# Beam stuff.\nconst beamScn = preload( \"res:\/\/blocks\/block.scn\" )\nconst Beam = preload(\"res:\/\/scripts\/Blocks\/Beam.gd\")\n\n# sounds\nvar samplePlayer = SamplePlayer.new()\n\nfunc addPickledBlock(block):\n\t# TODO add to puzzle\n\tvar b = block.toNode()\n\n\tprint (\"ADDED\")\n\tshape[b.blockPos] = b\n\n\t# TODO any special treatment for the wild blocks?\n\t# TODO keep track of puzzle.lasers ? How to?\n\n\tif not puzzleLoaded:\n\t\t# keep pickled block\n\t\tpuzzle.blocks.append(block)\n\n\t\t# keep track of puzzle.pairCounts\n\t\tvar layer = calcBlockLayerVec(b.blockPos)\n\t\tif b.getBlockType() == 2:\n\t\t\twhile puzzle.pairCount.size() <= layer:\n\t\t\t\tpuzzle.pairCount.append(0)\n\t\t\tpuzzle.pairCount[layer] += 0.5\n\n\n\tadd_child(b)\n\nfunc get_block(pos):\n\tif shape.has(pos):\n\t\treturn shape[pos]\n\telse:\n\t\treturn null\n\n# unused key argument needed for the tween_complete signal\nfunc remove_block(block_node, key=null):\n\tif block_node == null:\n\t\treturn\n\tprint (\"REMOVED\")\n\n\tshape[block_node.blockPos] = null\n\tfor child in block_node.get_children():\n\t\tblock_node.remove_and_delete_child(child)\n\tremove_and_delete_child(block_node)\n\n# Sets the puzzle for this GridMan.\nfunc set_puzzle(puzz):\n\t# delete all current nodes\n\tfor pos in shape:\n\t\tremove_block(shape[pos])\n\tpuzzleLoaded = false\n\n\t# Store the puzzle.\n\tpuzzle = puzz\n\n\t# Set the camera range to be relative to the layer count.\n\tvar cam = get_tree().get_root().get_node( \"Spatial\" ).get_node( \"Camera\" )\n\tprint( cam )\n\tvar totalSize = ( puzzle.puzzleLayers * 2 + 1 )\n\tcam.distance.val = 4.5 * totalSize\n\tcam.distance.min_ = 3 * totalSize\n\tcam.distance.max_ = 10 * totalSize\n\tcam.recalculate_camera()\n\n\t\t# # I can do my own counting!\n\t# needed for adding blocks in the editor\n\tfor block in puzzle.blocks:\n\t\t# Create a block node, add it to the tree\n\t\taddPickledBlock(block)\n\tpuzzleLoaded = true\n\n# Clears any selected blocks. WE SHOULD FIX THIS, THERE CAN ONLY BE ONE BLOCK SELECTED AT ANY ONE TIME, NO NEED FOR AN ARRAY!\nfunc clearSelection():\n\tfor bl in selectedBlocks:\n\t\tvar blo = get_node( bl )\n\t\tblo.setSelected(false)\n\t\tblo.scaleTweenNode(1.0).start()\n\tselectedBlocks = []\n\n# Add the selected block to the selected list. WE SHOULD FIX THIS, IT ONLY NEEDS TO STORE IT, NOT AN ARRAY!\nfunc addSelected(bl):\n\tselectedBlocks.append(bl)\n\n# Used for the multiplayer mode to force click a block on their side.\nfunc forceClickBlock( pos ):\n\tshape[pos].forceClick()\n\nfunc clickBlock( name ):\n\t#now check if that was the second block we picked. If it was, we want to\n\t#unselect the blocks again\n\tif (offClick):\n\t\toffClick = false\n\t\taddSelected(name)\n\t\tclearSelection()\n\telse:\n\t\toffClick = true;\n\t\taddSelected(name)\n\n# Calculates the layer that a block is on.\n# COPY OF FUNCTION IN PUZZLEMAN, IS THERE A BETTER WAY TO DO THIS?!\nfunc calcBlockLayer( x, y, z ):\n\treturn max( max( abs( x ), abs( y ) ), abs( z ) )\nfunc calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n# Handles keeping track of pairs being removed.\nfunc popPair( pos ):\n\tvar blayer = calcBlockLayerVec( pos )\n\tpuzzle.pairCount[blayer] -= 1\n\n\tif( puzzle.pairCount[blayer] == 0 ):\n\t\tprint(\"LAYER CLEARED\")\n\t\tif blayer == 1:\n\t\t\tprint( \"GAME OVER!\" )\n\t\t\tvar pauseMenu = get_tree().get_root().get_node( \"Spatial\" ).get_node( \"Camera\" ).pauseMenu\n\t\t\tpauseMenu.set_text(\"GAME OVER\\nSCORE:1,000,000\")\n\t\t\t# TODO set timeout!!!\n\t\t\tpauseMenu.popup_centered()\n\n\t\tfor b in shape:\n\t\t\tif not ( shape[b] == null ):\n\t\t\t\tif calcBlockLayerVec( b ) == blayer:\n\t\t\t\t\tif shape[b].getBlockType() == BLOCK_LASER:\n\t\t\t\t\t\tshape[b].forceActivate()\n\n\t\t# Fire beams.\n\t\tvar beamNum = 0\n\t\tfor l in range( puzzle.lasers.size() ):\n\t\t\tif calcBlockLayerVec( puzzle.lasers[l][0] ) == blayer:\n\t\t\t\t# Firin mah lazerz!\n\t\t\t\tvar beam = beamScn.instance()\n\n\t\t\t\tbeam.set_name( str(blayer) + \"_beam_\" + str(beamNum) )\n\t\t\t\tbeamNum += 1\n\t\t\t\tbeam.set_script( Beam )\n\n\t\t\t\tadd_child( beam )\n\t\t\t\tbeam.fire( puzzle.lasers[l][0], puzzle.lasers[l][1] )\n\n\t\t\t\tsamplePlayer.play( \"soundslikewillem_hitting_slinky\" )\n\n\nfunc _init():\n\t# Load sound\n\tsamplePlayer.set_voice_count(10)\n\tsamplePlayer.set_sample_library(ResourceLoader.load(\"new_samplelibrary.xml\"))\n\tprint(\"GridMan initialized\")\n\n","old_contents":"extends Spatial\n\n# Is there a better way to do this?\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\n# Shape dictionary to access blocks quickly by position.\nvar shape = {}\n\n# Block selection handling.\nvar offClick = false\nvar selectedBlocks = []\n\n# Puzzle vars.\nvar puzzle\nvar puzzleLoaded = false\n\n# Beam stuff.\nconst beamScn = preload( \"res:\/\/blocks\/block.scn\" )\nconst Beam = preload(\"res:\/\/scripts\/Blocks\/Beam.gd\")\n\n# sounds\nvar samplePlayer = SamplePlayer.new()\n\nfunc addPickledBlock(block):\n\t# TODO add to puzzle\n\tvar b = block.toNode()\n\n\tprint (\"ADDED\")\n\tshape[b.blockPos] = b\n\n\t# TODO any special treatment for the wild blocks?\n\t# TODO keep track of puzzle.lasers ? How to?\n\n\tif puzzleLoaded:\n\t\t# keep pickled block\n\t\tpuzzle.blocks.append(block)\n\n\t\t# keep track of puzzle.pairCounts\n\t\tvar layer = calcBlockLayerVec(b.blockPos)\n\t\tif b.getBlockType() == 2:\n\t\t\twhile puzzle.pairCount.size() <= layer:\n\t\t\t\tpuzzle.pairCount.append(0)\n\t\t\tpuzzle.pairCount[layer] += 0.5\n\n\n\tadd_child(b)\n\nfunc get_block(pos):\n\tif shape.has(pos):\n\t\treturn shape[pos]\n\telse:\n\t\treturn null\n\n# unused key argument needed for the tween_complete signal\nfunc remove_block(block_node, key=null):\n\tif block_node == null:\n\t\treturn\n\tprint (\"REMOVED\")\n\n\tshape[block_node.blockPos] = null\n\tfor child in block_node.get_children():\n\t\tblock_node.remove_and_delete_child(child)\n\tremove_and_delete_child(block_node)\n\n# Sets the puzzle for this GridMan.\nfunc set_puzzle(puzz):\n\t# delete all current nodes\n\tfor pos in shape:\n\t\tremove_block(shape[pos])\n\tpuzzleLoaded = false\n\n\t# Store the puzzle.\n\tpuzzle = puzz\n\n\t# Set the camera range to be relative to the layer count.\n\tvar cam = get_tree().get_root().get_node( \"Spatial\" ).get_node( \"Camera\" )\n\tprint( cam )\n\tvar totalSize = ( puzzle.puzzleLayers * 2 + 1 )\n\tcam.distance.val = 4.5 * totalSize\n\tcam.distance.min_ = 3 * totalSize\n\tcam.distance.max_ = 10 * totalSize\n\tcam.recalculate_camera()\n\n\t\t# # I can do my own counting!\n\t# needed for adding blocks in the editor\n\tfor block in puzzle.blocks:\n\t\t# Create a block node, add it to the tree\n\t\taddPickledBlock(block)\n\tpuzzleLoaded = true\n\n# Clears any selected blocks. WE SHOULD FIX THIS, THERE CAN ONLY BE ONE BLOCK SELECTED AT ANY ONE TIME, NO NEED FOR AN ARRAY!\nfunc clearSelection():\n\tfor bl in selectedBlocks:\n\t\tvar blo = get_node( bl )\n\t\tblo.setSelected(false)\n\t\tblo.scaleTweenNode(1.0).start()\n\tselectedBlocks = []\n\n# Add the selected block to the selected list. WE SHOULD FIX THIS, IT ONLY NEEDS TO STORE IT, NOT AN ARRAY!\nfunc addSelected(bl):\n\tselectedBlocks.append(bl)\n\n# Used for the multiplayer mode to force click a block on their side.\nfunc forceClickBlock( pos ):\n\tshape[pos].forceClick()\n\nfunc clickBlock( name ):\n\t#now check if that was the second block we picked. If it was, we want to\n\t#unselect the blocks again\n\tif (offClick):\n\t\toffClick = false\n\t\taddSelected(name)\n\t\tclearSelection()\n\telse:\n\t\toffClick = true;\n\t\taddSelected(name)\n\n# Calculates the layer that a block is on.\n# COPY OF FUNCTION IN PUZZLEMAN, IS THERE A BETTER WAY TO DO THIS?!\nfunc calcBlockLayer( x, y, z ):\n\treturn max( max( abs( x ), abs( y ) ), abs( z ) )\nfunc calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n# Handles keeping track of pairs being removed.\nfunc popPair( pos ):\n\tvar blayer = calcBlockLayerVec( pos )\n\tpuzzle.pairCount[blayer] -= 1\n\n\tif( puzzle.pairCount[blayer] == 0 ):\n\t\tprint(\"LAYER CLEARED\")\n\t\tif blayer == 1:\n\t\t\tprint( \"GAME OVER!\" )\n\t\t\tvar pauseMenu = get_tree().get_root().get_node( \"Spatial\" ).get_node( \"Camera\" ).pauseMenu\n\t\t\tpauseMenu.set_text(\"GAME OVER\\nSCORE:1,000,000\")\n\t\t\t# TODO set timeout!!!\n\t\t\tpauseMenu.popup_centered()\n\n\t\tfor b in shape:\n\t\t\tif not ( shape[b] == null ):\n\t\t\t\tif calcBlockLayerVec( b ) == blayer:\n\t\t\t\t\tif shape[b].getBlockType() == BLOCK_LASER:\n\t\t\t\t\t\tshape[b].forceActivate()\n\n\t\t# Fire beams.\n\t\tvar beamNum = 0\n\t\tfor l in range( puzzle.lasers.size() ):\n\t\t\tif calcBlockLayerVec( puzzle.lasers[l][0] ) == blayer:\n\t\t\t\t# Firin mah lazerz!\n\t\t\t\tvar beam = beamScn.instance()\n\n\t\t\t\tbeam.set_name( str(blayer) + \"_beam_\" + str(beamNum) )\n\t\t\t\tbeamNum += 1\n\t\t\t\tbeam.set_script( Beam )\n\n\t\t\t\tadd_child( beam )\n\t\t\t\tbeam.fire( puzzle.lasers[l][0], puzzle.lasers[l][1] )\n\n\t\t\t\tsamplePlayer.play( \"soundslikewillem_hitting_slinky\" )\n\n\nfunc _init():\n\t# Load sound\n\tsamplePlayer.set_voice_count(10)\n\tsamplePlayer.set_sample_library(ResourceLoader.load(\"new_samplelibrary.xml\"))\n\tprint(\"GridMan initialized\")\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"24a3b9d72a2de80445abc993abdcd7fac047fd11","subject":"testing gdscript.vim, no real changes","message":"testing gdscript.vim, no real changes\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/PuzzleManager.gd","new_file":"src\/scripts\/PuzzleManager.gd","new_contents":"const PUZZLE_5x5\t\t= 5\nconst PUZZLE_7x7\t\t= 7\nconst blockColors = [\"Blue\", \"Orange\", \"Red\", \"Yellow\"]\n\n# Preload paired blocks\nconst pairedBlock = preload(\"Blocks\/PairedBlock.gd\")\nconst flyBlock = preload(\"Blocks\/FlyawayTestBlock.gd\")\nconst blockScn = preload( \"res:\/\/blocks\/block.scn\" )\n\n\n\n# Stores a puzzle in a convenient class.\nclass Puzzle:\n\tvar puzzleType\n\tvar blocks = []\n\n# Holds all of the steps needed to solve a puzzle.\nclass PuzzleSteps:\n\tvar solveable\n\n# Randomly shuffle an array.\nfunc shuffleArray( arr ):\n\tfor i in range( arr.size() - 1, 1, -1 ):\n\t\t# works great! print( \"SWAP\" )\n\t\tvar swapVal = randi() % (i + 1)\n\t\tvar temp = arr[swapVal]\n\t\tarr[swapVal] = arr[i]\n\t\tarr[i] = temp\n\n# Generates a solveable puzzle.\nfunc generatePuzzle( type ):\n\tvar blockID = 0\n\tvar puzzle = Puzzle.new()\n\tpuzzle.puzzleType = type\n\n\tvar middle = type \/ 2\n\n\t# create all possible positions\n\tvar shape = []\n\tfor x in range( type ):\n\t\tfor y in range( type ):\n\t\t\tfor z in range( type ):\n\t\t\t\tshape.append(Vector3(x,y,z))\n\n\t# assign blocks to positions\n\tvar prevBlock = null\n\tvar even = false\n\tfor pos in shape:\n\t\tvar x = pos.x\n\t\tvar y = pos.y\n\t\tvar z = pos.z\n\t\tif (x == middle && y == middle && z == middle):\n\t\t\tcontinue\n\t\tvar b = PickledBlock.new()\n\t\tb.blockPos = pos\n\t\tb.name = \"block\" + str(blockID)\n\n\t\tblockID += 1\n\t\tpuzzle.blocks.append( b )\n\n\t\tif (x == y and y == z):\n\t\t\tb.setBlockClass(\"LaserBlock\")\n\t\telse:\n\t\t\tif even:\n\t\t\t\tvar randColor = blockColors[randi() % blockColors.size()]\n\t\t\t\tb.setBlockClass(\"PairedBlock\") \\\n\t\t\t\t\t.setPairName(prevBlock.name) \\\n\t\t\t\t\t.setTextureName(randColor)\n\n\t\t\t\tprevBlock.setBlockClass(\"PairedBlock\") \\\n\t\t\t\t\t.setPairName(b.name) \\\n\t\t\t\t\t.setTextureName(randColor)\n\t\t\teven = not even\n\t\t\tprevBlock = b\n\n\n\n\t# TODO, proposed algorithm:\n\t# make blocks, pairs are adjacent\n\t# shuffle board, half the blocks pick a \"nearby\" block to swap places with\n\t# nearby = same layer, somewhere accessible to the user\n\n\t# Randomize the order of the blocks.\n\t#self.shuffleArray( puzzle.blocks )\n\n\t# Assign block types in pairs.\n#\tfor i in range( 0, puzzle.blocks.size(), 2 ):\n#\t\tvar randColor = blockColors[randi() % blockColors.size()]\n#\t\tpuzzle.blocks[i].setBlockClass(\"PairedBlock\") \\\n#\t\t\t.setPairName(puzzle.blocks[i+1].name) \\\n#\t\t\t.setTextureName(randColor)\n#\n#\t\tpuzzle.blocks[i+1].setBlockClass(\"PairedBlock\") \\\n#\t\t\t.setPairName(puzzle.blocks[i].name) \\\n#\t\t\t.setTextureName(randColor)\n\n\treturn puzzle\n\n# Determines if a puzzle is solveable.\nfunc solvePuzzle( puzzle ):\n\t# Simply use the SolvePuzzleSteps function and return the solveable part.\n\tvar ps = solvePuzzleSteps()\n\treturn ps.solveable\n\n# Determines if a puzzle is solveable and returns the steps needed to solve it.\nfunc solvePuzzleSteps( puzzle ):\n\tvar puzzleSteps = PuzzleSteps.new()\n\tpuzzleSteps.solveable = true\n\n\t# SOLVER\n\n\treturn puzzleSteps\n\n\nclass PickledBlock:\n\tvar name\n\tvar blockClass\n\tvar pairName\n\tvar textureName\n\tvar blockPos\n\n\tfunc setName(n):\n\t\tname = n\n\t\treturn self\n\n\tfunc setPairName(n):\n\t\tpairName = n\n\t\treturn self\n\n\tfunc setBlockClass(c):\n\t\tblockClass = c\n\t\treturn self\n\n\tfunc setTextureName(t):\n\t\ttextureName = t\n\t\treturn self\n\n\tfunc toString():\n\t\treturn str(name) + \": \" + str(blockClass)\n\n\tfunc toNode(gen):\n\t\t# instantiate a block scene, assign the appropriate script to it\n\t\tvar n = blockScn.instance()\n\t\tn.set_script(load(\"res:\/\/scripts\/Blocks\/\" + blockClass + \".gd\"))\n\n\t\t# configure block node\n\t\tn.setName(name).setTexture()\n\n\t\tif blockClass == \"PairedBlock\":\n\t\t\tn.setPairName(pairName).setTexture(textureName)\n\t\treturn n\n","old_contents":"const PUZZLE_5x5\t\t= 5\nconst PUZZLE_7x7\t\t= 7\nconst blockColors = [\"Blue\", \"Orange\", \"Red\", \"Yellow\"]\n\n# Preload paired blocks\nconst pairedBlock = preload(\"Blocks\/PairedBlock.gd\")\nconst flyBlock = preload(\"Blocks\/FlyawayTestBlock.gd\")\nconst blockScn = preload( \"res:\/\/blocks\/block.scn\" )\n\n\n# Stores a puzzle in a convenient class.\nclass Puzzle:\n\tvar puzzleType\n\tvar blocks = []\n\n# Holds all of the steps needed to solve a puzzle.\nclass PuzzleSteps:\n\tvar solveable\n\t\n# Randomly shuffle an array.\nfunc shuffleArray( arr ):\n\tfor i in range( arr.size() - 1, 1, -1 ):\n\t\t# works great! print( \"SWAP\" )\n\t\tvar swapVal = randi() % (i + 1)\n\t\tvar temp = arr[swapVal]\n\t\tarr[swapVal] = arr[i]\n\t\tarr[i] = temp\n\n# Generates a solveable puzzle.\nfunc generatePuzzle( type ):\n\tvar blockID = 0\n\tvar puzzle = Puzzle.new()\n\tpuzzle.puzzleType = type\n\t\n\tvar middle = type \/ 2\n\t\n\t# create all possible positions\n\tvar shape = []\n\tfor x in range( type ):\n\t\tfor y in range( type ):\n\t\t\tfor z in range( type ):\n\t\t\t\tshape.append(Vector3(x,y,z))\n\t\n\t# assign blocks to positions\n\tvar prevBlock = null\n\tvar even = false\n\tfor pos in shape:\n\t\tvar x = pos.x\n\t\tvar y = pos.y\n\t\tvar z = pos.z\n\t\tif (x == middle && y == middle && z == middle):\n\t\t\tcontinue\n\t\tvar b = PickledBlock.new()\n\t\tb.blockPos = pos\n\t\tb.name = \"block\" + str(blockID)\n\t\t\n\t\tblockID += 1\n\t\tpuzzle.blocks.append( b )\n\t\t\t\n\t\tif (x == y and y == z):\n\t\t\tb.setBlockClass(\"LaserBlock\")\n\t\telse:\n\t\t\tif even:\n\t\t\t\tvar randColor = blockColors[randi() % blockColors.size()]\n\t\t\t\tb.setBlockClass(\"PairedBlock\") \\\n\t\t\t\t\t.setPairName(prevBlock.name) \\\n\t\t\t\t\t.setTextureName(randColor)\n\t\n\t\t\t\tprevBlock.setBlockClass(\"PairedBlock\") \\\n\t\t\t\t\t.setPairName(b.name) \\\n\t\t\t\t\t.setTextureName(randColor)\n\t\t\teven = not even\n\t\t\tprevBlock = b\n\t\t\t\t\n\n\t\n\t# TODO, proposed algorithm:\n\t# make blocks, pairs are adjacent\n\t# shuffle board, half the blocks pick a \"nearby\" block to swap places with\n\t# nearby = same layer, somewhere accessible to the user\n\t\n\t# Randomize the order of the blocks.\n\t#self.shuffleArray( puzzle.blocks )\n\t\n\t# Assign block types in pairs.\n#\tfor i in range( 0, puzzle.blocks.size(), 2 ):\n#\t\tvar randColor = blockColors[randi() % blockColors.size()]\n#\t\tpuzzle.blocks[i].setBlockClass(\"PairedBlock\") \\\n#\t\t\t.setPairName(puzzle.blocks[i+1].name) \\\n#\t\t\t.setTextureName(randColor)\n#\t\t\t\n#\t\tpuzzle.blocks[i+1].setBlockClass(\"PairedBlock\") \\\n#\t\t\t.setPairName(puzzle.blocks[i].name) \\\n#\t\t\t.setTextureName(randColor)\n\t\n\treturn puzzle\n\t\n# Determines if a puzzle is solveable.\nfunc solvePuzzle( puzzle ):\n\t# Simply use the SolvePuzzleSteps function and return the solveable part.\n\tvar ps = solvePuzzleSteps()\n\treturn ps.solveable\n\t\n# Determines if a puzzle is solveable and returns the steps needed to solve it.\nfunc solvePuzzleSteps( puzzle ):\n\tvar puzzleSteps = PuzzleSteps.new()\n\tpuzzleSteps.solveable = true\n\t\n\t# SOLVER\n\t\n\treturn puzzleSteps\n\t\n\nclass PickledBlock:\n\tvar name\n\tvar blockClass\n\tvar pairName\n\tvar textureName\n\tvar blockPos\n\t\n\tfunc setName(n):\n\t\tname = n\n\t\treturn self\n\t\t\n\tfunc setPairName(n):\n\t\tpairName = n\n\t\treturn self\n\t\t\n\tfunc setBlockClass(c):\n\t\tblockClass = c\n\t\treturn self\n\t\t\n\tfunc setTextureName(t):\n\t\ttextureName = t\n\t\treturn self\n\t\t\n\tfunc toString():\n\t\treturn str(name) + \": \" + str(blockClass)\n\n\tfunc toNode(gen):\n\t\t# instantiate a block scene, assign the appropriate script to it\n\t\tvar n = blockScn.instance()\n\t\tn.set_script(load(\"res:\/\/scripts\/Blocks\/\" + blockClass + \".gd\"))\n\t\t\n\t\t# configure block node\n\t\tn.setName(name).setTexture()\n\n\t\tif blockClass == \"PairedBlock\":\n\t\t\tn.setPairName(pairName).setTexture(textureName)\n\t\treturn n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"16306fa86018340ddb789b51215e8d28b6892cc1","subject":"Extract layer calculation to separate function","message":"Extract layer calculation to separate function\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/PuzzleManager.gd","new_file":"src\/scripts\/PuzzleManager.gd","new_contents":"const DIFF_EASY\t\t= 0\nconst DIFF_MEDIUM\t= 1\nconst DIFF_HARD\t\t= 2\n\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\nconst blockColors = [\"Blue\", \"Orange\", \"Red\", \"Yellow\", \"Purple\", \"Green\"]\nconst wildColors = [\"WildBlue\", \"WildOrange\", \"WildRed\", \"WildYellow\", \"WildPurple\", \"WildGreen\"]\n\n# Preload paired blocks\nconst blockScn = preload( \"res:\/\/blocks\/block.scn\" )\nconst blocks = [ preload( \"Blocks\/LaserBlock.gd\" )\n\t\t\t , preload( \"Blocks\/LaserBlock.gd\" )\n\t\t\t , preload( \"Blocks\/PairedBlock.gd\" )\n\t\t\t , preload( \"Blocks\/LaserBlock.gd\" )\n\t\t\t ]\nconst aBlock = preload( \"Blocks\/AbstractBlock.gd\" )\n\n# Hash map of all possible positions\nvar shape = {}\n\n# Stores a puzzle in a convenient class.\nclass Puzzle:\n\tvar puzzleName\n\tvar puzzleLayers\n\tvar blocks = []\n\t\n\t# Determines if a puzzle is solveable.\n\tfunc solvePuzzle():\n\t\t# Simply use the solvePuzzleSteps function and return the solveable part.\n\t\tvar ps = self.solvePuzzleSteps()\n\t\treturn ps.solveable\n\t\n\t# Determines if a puzzle is solveable and returns the steps needed to solve it.\n\tfunc solvePuzzleSteps():\n\t\tvar puzzleSteps = PuzzleSteps.new()\n\t\tpuzzleSteps.solveable = true\n\t\n\t\t# SOLVER\n\t\n\t\treturn puzzleSteps\n\t\n\t# Holds all of the steps needed to solve a puzzle.\n\tclass PuzzleSteps:\n\t\tvar solveable\n\n# Randomly shuffle an array.\nfunc shuffleArray( arr ):\n\tfor i in range( arr.size() - 1, 1, -1 ):\n\t\t# works great! print( \"SWAP\" )\n\t\tvar swapVal = randi() % (i + 1)\n\t\tvar temp = arr[swapVal]\n\t\tarr[swapVal] = arr[i]\n\t\tarr[i] = temp\n\t\t\n\n# calculate the layer; move into a method so that it can be used elsewhere\nfunc calcBlockLayer( x, y, z ):\n\tvar layer = max( max( abs( x ), abs( y ) ), abs( z ) )\n\treturn layer\n\n# Determines the block type based on puzzle size and difficulty.\nfunc getBlockType( difficulty, x, y, z ):\n\t# Determine if this is the goal block.\n\tif x == 0 and y == 0 and z == 0:\n\t\treturn BLOCK_GOAL\n\n\t# Determine the layer this block is on.\n\tvar layer = calcBlockLayer( x, y, z )\n\n\t# Determine how many blocks are on the outer part of the layer.\n\tvar layerCount = 0\n\tif abs( x ) == layer:\n\t\tlayerCount += 1\n\tif abs( y ) == layer:\n\t\tlayerCount += 1\n\tif abs( z ) == layer:\n\t\tlayerCount += 1\n\n\t# Determine if this block is a laser.\n\tif difficulty == DIFF_EASY or difficulty == DIFF_MEDIUM:\n\t\tif layerCount == 3:\n\t\t\treturn BLOCK_LASER\n\n\tif difficulty == DIFF_HARD:\n\t\tif abs( x ) == abs( z ) and y == 0:\n\t\t\treturn BLOCK_LASER\n\n\t# Determine if this block is a wild block.\n\tif difficulty == DIFF_EASY:\n\t\tif layerCount == 2:\n\t\t\treturn BLOCK_WILD\n\n\tif difficulty == DIFF_MEDIUM:\n\t\tif layerCount == 2:\n\t\t\tif y == layer || y == -layer:\n\t\t\t\treturn BLOCK_WILD\n\n\tif difficulty == DIFF_HARD:\n\t\tif layerCount == 1:\n\t\t\tif y == 0:\n\t\t\t\treturn BLOCK_WILD\n\n\t# Otherwise it's a normal block.\n\treturn BLOCK_PAIR\n\n# Generates a solveable puzzle.\nfunc generatePuzzle( layers, difficulty ):\n\tvar blockID = 0\n\tvar puzzle = Puzzle.new()\n\tpuzzle.puzzleName = \"RANDOM PUZZLE\"\n\tpuzzle.puzzleLayers = layers\n\n\t# Create all possible positions.\n\tvar allblocks = []\n\tfor x in range( -layers, layers + 1 ):\n\t\tfor y in range( -layers, layers + 1 ):\n\t\t\tfor z in range( -layers, layers + 1 ):\n\t\t\t\tallblocks.append(Vector3(x,y,z))\n\t\t\t\tshape[Vector3(x,y,z)] = null\n\t\t\t\t\n\tshuffleArray( allblocks )\n\n\t# Assign block types based on position.\n\tvar prevBlock = null\n\tvar even = false\n\tvar prevLaser = null\n\tvar laserEven = false\n\tfor pos in allblocks:\n\t\tvar x = pos.x\n\t\tvar y = pos.y\n\t\tvar z = pos.z\n\n\t\tvar t = getBlockType( difficulty, x, y, z )\n\n\t\tif t == BLOCK_GOAL:\n\t\t\tcontinue\n\n\t\tvar b = PickledBlock.new()\n\t\tb.blockPos = pos\n\t\tb.name = blockID\n\n\t\tblockID += 1\n\t\tpuzzle.blocks.append( b )\n\n\t\tif t == BLOCK_LASER:\n\t\t\tb.setBlockClass(BLOCK_LASER)\n\t\t\tif laserEven:\n\t\t\t\tb.setPairName(prevLaser.name) \\\n\t\t\t\t.setLaserExtent(prevLaser.blockPos - b.blockPos)\n\n\t\t\t\tprevLaser.setPairName(b.name) \\\n\t\t\t\t.setLaserExtent(b.blockPos - prevLaser.blockPos)\n\t\t\tlaserEven = not laserEven\n\t\t\tprevLaser = b\n\t\t\tcontinue\n\n\t\tif t == BLOCK_WILD:\n\t\t\tb.setBlockClass(BLOCK_PAIR) \\\n\t\t\t\t.setTextureName(wildColors[randi() % wildColors.size()])\n\t\t\tcontinue\n\n\t\tif even:\n\t\t\tvar randColor = blockColors[randi() % blockColors.size()]\n\t\t\tb.setBlockClass(BLOCK_PAIR) \\\n\t\t\t\t.setPairName(prevBlock.name) \\\n\t\t\t\t.setTextureName(randColor)\n\n\t\t\tprevBlock.setBlockClass(BLOCK_PAIR) \\\n\t\t\t\t.setPairName(b.name) \\\n\t\t\t\t.setTextureName(randColor)\n\t\teven = not even\n\t\tprevBlock = b\n\n\treturn puzzle\n\n\nclass PickledBlock:\n\tvar name\n\tvar blockClass = BLOCK_PAIR\n\tvar pairName\n\tvar textureName = \"Red\"\n\tvar blockPos\n\tvar laserExtent\n\n\tfunc setName(n):\n\t\tname = n\n\t\treturn self\n\n\tfunc setPairName(n):\n\t\tpairName = n\n\t\treturn self\n\n\tfunc setLaserExtent(n):\n\t\tlaserExtent = n\n\t\treturn self\n\n\tfunc setBlockClass(c):\n\t\tblockClass = c\n\t\treturn self\n\n\tfunc setTextureName(t):\n\t\ttextureName = t\n\t\treturn self\n\n\tfunc toString():\n\t\treturn str(name) + \": \" + str(blockClass)\n\n\tfunc toNode():\n\t\t# instantiate a block scene, assign the appropriate script to it\n\t\tvar n = blockScn.instance()\n\t\tn.set_script(blocks[blockClass])\n\n\t\t# configure block node\n\t\tn.setName(str(name)).setTexture()\n\t\tn.blockPos = blockPos\n\t\tif blockClass == BLOCK_PAIR:\n\t\t\tn.setPairName(pairName).setTexture(textureName)\n\n\t\tif blockClass == BLOCK_LASER:\n\t\t\tn.setPairName(pairName).setExtent(laserExtent)\n\t\treturn n\n\t\t\n\t# Convert this object to a dictionary.\n\tfunc toDict():\n\t\tvar di = { n = name\n\t\t \t , bC = blockClass\n\t\t\t , pN = pairName\n\t\t\t , tN = textureName\n\t\t\t , bP = blockPos\n\t\t\t , lE = laserExtent\n\t\t\t }\n\t\treturn di\n\t\t\t\n\t# Make this object from a dictionary.\n\tfunc fromDict( di ):\n\t\tname = di.n\n\t\tblockClass = di.bC\n\t\tpairName = di.pN\n\t\ttextureName = di.tN\n\t\tblockPos = di.bP\n\t\tlaserExtent = di.lE\n\n","old_contents":"const DIFF_EASY\t\t= 0\nconst DIFF_MEDIUM\t= 1\nconst DIFF_HARD\t\t= 2\n\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\nconst blockColors = [\"Blue\", \"Orange\", \"Red\", \"Yellow\", \"Purple\", \"Green\"]\nconst wildColors = [\"WildBlue\", \"WildOrange\", \"WildRed\", \"WildYellow\", \"WildPurple\", \"WildGreen\"]\n\n# Preload paired blocks\nconst blockScn = preload( \"res:\/\/blocks\/block.scn\" )\nconst blocks = [ preload( \"Blocks\/LaserBlock.gd\" )\n\t\t\t , preload( \"Blocks\/LaserBlock.gd\" )\n\t\t\t , preload( \"Blocks\/PairedBlock.gd\" )\n\t\t\t , preload( \"Blocks\/LaserBlock.gd\" )\n\t\t\t ]\nconst aBlock = preload( \"Blocks\/AbstractBlock.gd\" )\n\n# Hash map of all possible positions\nvar shape = {}\n\n# Stores a puzzle in a convenient class.\nclass Puzzle:\n\tvar puzzleName\n\tvar puzzleLayers\n\tvar blocks = []\n\t\n\t# Determines if a puzzle is solveable.\n\tfunc solvePuzzle():\n\t\t# Simply use the solvePuzzleSteps function and return the solveable part.\n\t\tvar ps = self.solvePuzzleSteps()\n\t\treturn ps.solveable\n\t\n\t# Determines if a puzzle is solveable and returns the steps needed to solve it.\n\tfunc solvePuzzleSteps():\n\t\tvar puzzleSteps = PuzzleSteps.new()\n\t\tpuzzleSteps.solveable = true\n\t\n\t\t# SOLVER\n\t\n\t\treturn puzzleSteps\n\t\n\t# Holds all of the steps needed to solve a puzzle.\n\tclass PuzzleSteps:\n\t\tvar solveable\n\n# Randomly shuffle an array.\nfunc shuffleArray( arr ):\n\tfor i in range( arr.size() - 1, 1, -1 ):\n\t\t# works great! print( \"SWAP\" )\n\t\tvar swapVal = randi() % (i + 1)\n\t\tvar temp = arr[swapVal]\n\t\tarr[swapVal] = arr[i]\n\t\tarr[i] = temp\n\n# Determines the block type based on puzzle size and difficulty.\nfunc getBlockType( difficulty, x, y, z ):\n\t# Determine if this is the goal block.\n\tif x == 0 and y == 0 and z == 0:\n\t\treturn BLOCK_GOAL\n\n\t# Determine the layer this block is on.\n\tvar layer = max( max( abs( x ), abs( y ) ), abs( z ) )\n\n\t# Determine how many blocks are on the outer part of the layer.\n\tvar layerCount = 0\n\tif abs( x ) == layer:\n\t\tlayerCount += 1\n\tif abs( y ) == layer:\n\t\tlayerCount += 1\n\tif abs( z ) == layer:\n\t\tlayerCount += 1\n\n\t# Determine if this block is a laser.\n\tif difficulty == DIFF_EASY or difficulty == DIFF_MEDIUM:\n\t\tif layerCount == 3:\n\t\t\treturn BLOCK_LASER\n\n\tif difficulty == DIFF_HARD:\n\t\tif abs( x ) == abs( z ) and y == 0:\n\t\t\treturn BLOCK_LASER\n\n\t# Determine if this block is a wild block.\n\tif difficulty == DIFF_EASY:\n\t\tif layerCount == 2:\n\t\t\treturn BLOCK_WILD\n\n\tif difficulty == DIFF_MEDIUM:\n\t\tif layerCount == 2:\n\t\t\tif y == layer || y == -layer:\n\t\t\t\treturn BLOCK_WILD\n\n\tif difficulty == DIFF_HARD:\n\t\tif layerCount == 1:\n\t\t\tif y == 0:\n\t\t\t\treturn BLOCK_WILD\n\n\t# Otherwise it's a normal block.\n\treturn BLOCK_PAIR\n\n# Generates a solveable puzzle.\nfunc generatePuzzle( layers, difficulty ):\n\tvar blockID = 0\n\tvar puzzle = Puzzle.new()\n\tpuzzle.puzzleName = \"RANDOM PUZZLE\"\n\tpuzzle.puzzleLayers = layers\n\n\t# Create all possible positions.\n\tvar allblocks = []\n\tfor x in range( -layers, layers + 1 ):\n\t\tfor y in range( -layers, layers + 1 ):\n\t\t\tfor z in range( -layers, layers + 1 ):\n\t\t\t\tallblocks.append(Vector3(x,y,z))\n\t\t\t\tshape[Vector3(x,y,z)] = null\n\t\t\t\t\n\tshuffleArray( allblocks )\n\n\t# Assign block types based on position.\n\tvar prevBlock = null\n\tvar even = false\n\tvar prevLaser = null\n\tvar laserEven = false\n\tfor pos in allblocks:\n\t\tvar x = pos.x\n\t\tvar y = pos.y\n\t\tvar z = pos.z\n\n\t\tvar t = getBlockType( difficulty, x, y, z )\n\n\t\tif t == BLOCK_GOAL:\n\t\t\tcontinue\n\n\t\tvar b = PickledBlock.new()\n\t\tb.blockPos = pos\n\t\tb.name = blockID\n\n\t\tblockID += 1\n\t\tpuzzle.blocks.append( b )\n\n\t\tif t == BLOCK_LASER:\n\t\t\tb.setBlockClass(BLOCK_LASER)\n\t\t\tif laserEven:\n\t\t\t\tb.setPairName(prevLaser.name) \\\n\t\t\t\t.setLaserExtent(prevLaser.blockPos - b.blockPos)\n\n\t\t\t\tprevLaser.setPairName(b.name) \\\n\t\t\t\t.setLaserExtent(b.blockPos - prevLaser.blockPos)\n\t\t\tlaserEven = not laserEven\n\t\t\tprevLaser = b\n\t\t\tcontinue\n\n\t\tif t == BLOCK_WILD:\n\t\t\tb.setBlockClass(BLOCK_PAIR) \\\n\t\t\t\t.setTextureName(wildColors[randi() % wildColors.size()])\n\t\t\tcontinue\n\n\t\tif even:\n\t\t\tvar randColor = blockColors[randi() % blockColors.size()]\n\t\t\tb.setBlockClass(BLOCK_PAIR) \\\n\t\t\t\t.setPairName(prevBlock.name) \\\n\t\t\t\t.setTextureName(randColor)\n\n\t\t\tprevBlock.setBlockClass(BLOCK_PAIR) \\\n\t\t\t\t.setPairName(b.name) \\\n\t\t\t\t.setTextureName(randColor)\n\t\teven = not even\n\t\tprevBlock = b\n\n\treturn puzzle\n\n\nclass PickledBlock:\n\tvar name\n\tvar blockClass = BLOCK_PAIR\n\tvar pairName\n\tvar textureName = \"Red\"\n\tvar blockPos\n\tvar laserExtent\n\n\tfunc setName(n):\n\t\tname = n\n\t\treturn self\n\n\tfunc setPairName(n):\n\t\tpairName = n\n\t\treturn self\n\n\tfunc setLaserExtent(n):\n\t\tlaserExtent = n\n\t\treturn self\n\n\tfunc setBlockClass(c):\n\t\tblockClass = c\n\t\treturn self\n\n\tfunc setTextureName(t):\n\t\ttextureName = t\n\t\treturn self\n\n\tfunc toString():\n\t\treturn str(name) + \": \" + str(blockClass)\n\n\tfunc toNode():\n\t\t# instantiate a block scene, assign the appropriate script to it\n\t\tvar n = blockScn.instance()\n\t\tn.set_script(blocks[blockClass])\n\n\t\t# configure block node\n\t\tn.setName(str(name)).setTexture()\n\t\tn.blockPos = blockPos\n\t\tif blockClass == BLOCK_PAIR:\n\t\t\tn.setPairName(pairName).setTexture(textureName)\n\n\t\tif blockClass == BLOCK_LASER:\n\t\t\tn.setPairName(pairName).setExtent(laserExtent)\n\t\treturn n\n\t\t\n\t# Convert this object to a dictionary.\n\tfunc toDict():\n\t\tvar di = { n = name\n\t\t \t , bC = blockClass\n\t\t\t , pN = pairName\n\t\t\t , tN = textureName\n\t\t\t , bP = blockPos\n\t\t\t , lE = laserExtent\n\t\t\t }\n\t\treturn di\n\t\t\t\n\t# Make this object from a dictionary.\n\tfunc fromDict( di ):\n\t\tname = di.n\n\t\tblockClass = di.bC\n\t\tpairName = di.pN\n\t\ttextureName = di.tN\n\t\tblockPos = di.bP\n\t\tlaserExtent = di.lE\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"b8b3695036ba7dee163c68f5bc0ded2371502554","subject":"Adjust banner for display with type senser orientation","message":"Adjust banner for display with type senser orientation\n","repos":"jlopezcur\/GodotAdmob,jlopezcur\/GodotAdmob","old_file":"example\/main_.gd","new_file":"example\/main_.gd","new_contents":"","old_contents":"\nextends Node\n\nvar adMob\n\nfunc _ready():\n\tset_process(true)\n\tif(Globals.has_singleton(\"AdMob\")):\n\t\tadMob\t\t= Globals.get_singleton(\"AdMob\")\n\t\tadMob.init(true, true, \"ca-app-pub-XXXXXXXXXXXXXXXX\/XXXXXXXXXX\")\t[Place your Ad Unit ID here, and delete this message.]\n\t\t#var adWidth\t\t= adMob.getAdWidth()\n\t\t#var adHeight\t= adMob.getAdHeight()\n\telse:\n\t\tadMob\t= null\n\t\nfunc _process(delta):\n\tif(null != adMob):\n\t\tadMob.showBanner(true)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"863479026080e18e5e667f2045c563376caf2063","subject":"Clean up comments for GUI manager script","message":"Clean up comments for GUI manager script\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/GUIManager.gd","new_file":"src\/scripts\/GUIManager.gd","new_contents":"# This script manages all of the GUI elements.\n# It switches between the states of the GUI allowing\n# the user to start games, edit the options or connect\n# to a multiplayer game.\n\nextends Node\n\n# network variables\nvar network\n\n# State variables.\nvar menuOn\nvar splashTween\n\n# Timers.\nvar timer\nvar initialWait = .5\nvar splashTimer = 2.0\nvar warningTimer = 5.0\n\n# GUI pieces.\nvar Splash_Team5\nvar Splash_Warning\nvar Menu_Main\nvar Menu_Chooser\nvar Menu_MP\nvar Menu_HostGame\nvar Menu_JoinGame\nvar Menu_Options\n\n# Menu state values. Used to switch between them.\nvar MENU_INIT\t\t\t= 0\nvar MENU_SPLASHTEAM5\t= 1\nvar MENU_SPLASHWARNING\t= 2\nvar MENU_MAIN\t\t\t= 3\nvar MENU_CHOOSER\t\t= 4\nvar MENU_MP\t\t\t\t= 5\nvar MENU_HOSTGAME\t\t= 6\nvar MENU_JOINGAME\t\t= 7\nvar MENU_OPTIONS\t\t= 8\n\n# Main Menu Theme\nvar samplePlayer = StreamPlayer.new()\nvar songs = [load(\"res:\/\/main_theme_antris.ogg\")]\n\n# Function to be called once for setup.\nfunc _ready():\n\t# Initial setup.\n\tmenuOn = MENU_INIT\n\ttimer = 0.0\n\tset_process( true )\n\tset_process_input( true )\n\n\t# Setup the splash fader tween.\n\tsplashTween = Tween.new()\n\tget_node( \"SplashFader\" ).add_child( splashTween )\n\tsplashTween.interpolate_method( get_node( \"SplashFader\" ), \"set_opacity\", 1.0, 0.0, 1.0, Tween.TRANS_CUBIC, Tween.EASE_IN_OUT )\n\n\t# Gather all of the menus.\n\tSplash_Team5 = get_node( \"SplashTeam5\" )\n\tSplash_Warning = get_node( \"SplashWarning\" )\n\tMenu_Main = get_node( \"MainMenu\" )\n\tMenu_Chooser = get_node( \"ChooserMenu\" )\n\tMenu_MP = get_node( \"Multiplayer\" )\n\tMenu_HostGame = get_node( \"HostGame\" )\n\tMenu_JoinGame = get_node( \"JoinGame\" )\n\tMenu_Options = get_node( \"OptionsMenu\" )\n\t\n\tGlobals.set(\"Network\", load(\"res:\/\/scripts\/Network.gd\").new())\n\tnetwork = Globals.get(\"Network\")\n\t\n\tvar scn = load(\"res:\/\/networkProxy.scn\")\n\tadd_child(scn.instance())\n\tnetwork.root = get_tree().get_root()\n\n\t# Load the config.\n\tvar config = preload( \"res:\/\/scripts\/DataManager.gd\" ).new().loadConfig()\n\t\n\tget_node(\"OptionsMenu\/Panel\/OnlineName\/LineEdit\").set_text( config.name )\n\tget_node(\"OptionsMenu\/Panel\/SoundVolume\/SoundSlider\").set_value( config.soundvolume )\n\tget_node(\"OptionsMenu\/Panel\/MusicVolume\/MusicSlider\").set_value( config.musicvolume )\n\t\n\tnetwork.port = config.portnumber\n\n\t# Main Menu Theme\n\tadd_child(samplePlayer)\n\tsamplePlayer.set_stream(songs[0])\n\tsamplePlayer.play()\n\t\n# Function to update the GUI.\nfunc _process( delta ):\n\t# Handle the initial wait.\n\tif( menuOn == MENU_INIT ):\n\t\tif( timer > initialWait ):\n\t\t\tmenuOn = MENU_SPLASHTEAM5\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiIn()\n\n\t# Handle the Team5 splash screen.\n\tif( menuOn == MENU_SPLASHTEAM5 ):\n\t\tif( timer > splashTimer ):\n\t\t\tmenuOn = MENU_SPLASHWARNING\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiOut()\n\t\t\tSplash_Warning.guiIn()\n\n\t# Handle the warning splash screen.\n\tif( menuOn == MENU_SPLASHWARNING ):\n\t\tif( timer > warningTimer ):\n\t\t\tmenuOn = MENU_MAIN\n\t\t\ttimer = 0.0\n\t\t\tSplash_Warning.guiOut()\n\t\t\tMenu_Main.guiIn()\n\t\t\tsplashTween.start()\n\n\t# Increase the timer each frame.\n\ttimer += delta\n\n# Handle the input events.\nfunc _input( ev ):\n\t# Handle skip splash screens.\n\tif( !ev.is_pressed() and ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT ):\n\t\tif( menuOn == MENU_SPLASHTEAM5 || menuOn == MENU_SPLASHWARNING ):\n\t\t\ttimer = 999.0;\n\n\t# Handle exit.\n\tif( ev.is_action( \"ui_cancel\" ) ):\n\t\texit()\n\nfunc exit():\n\tprint( \"Exiting\" )\n\tOS.get_main_loop().quit()\n\nfunc _on_Exit_pressed():\n\texit()\n\n# TODO save to ConfigFile, load this on beginning\nfunc _on_Options_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Options.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_OPTIONS\n\tget_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\").set_text(str(network.port))\n\nfunc _on_Cancel_pressed():\n\tMenu_Options.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_SaveQuit_pressed():\n\t# Save the options.\n\t\n\tvar config = { name = get_node(\"OptionsMenu\/Panel\/OnlineName\/LineEdit\").get_text()\n\t\t\t\t , soundvolume = get_node(\"OptionsMenu\/Panel\/SoundVolume\/SoundSlider\").get_value()\n\t\t\t\t , musicvolume = get_node(\"OptionsMenu\/Panel\/MusicVolume\/MusicSlider\").get_value()\n\t\t\t\t , portnumber = get_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\").get_text()\n\t\t\t\t }\n\n\tpreload( \"res:\/\/scripts\/DataManager.gd\" ).new().saveConfig( config )\n\t\n\tvar field = get_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\")\n\tnetwork.setPort(field.get_text())\n\tnetwork.setPort(field.get_text())\n\t_on_Cancel_pressed()\n\nfunc _on_SP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Chooser.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_CHOOSER\n\nfunc _on_MainMenu_pressed():\n\tMenu_Chooser.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MainMenuMP_pressed():\n\tMenu_MP.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_MP.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MP\n\nfunc _on_MainMenuHG_pressed():\n\tMenu_HostGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\tnetwork.disconnect()\n\nfunc _on_HostGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_HostGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_HOSTGAME\n\t\n\tif !network.isHost and !network.isNetwork:\n\t\tprint(\"calling!\")\n\t\tnetwork.host(network.port)\n\t\tget_node(\"HostGame\/Panel\/Waiting\").set_text(\"Waiting for player to join on port \" + str(network.port) + \"...\")\n\nfunc _on_JoinGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_JoinGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_JOINGAME\n\nfunc _on_MainMenuJG_pressed():\n\tMenu_JoinGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\tif (network.isClient):\n\t\tnetwork.disconnect()\n\nfunc _on_RandomPuzzle_pressed():\n\tvar root = get_tree().get_root()\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\troot.add_child( ResourceLoader.load( \"res:\/\/puzzle.scn\" ).instance() )\n\n\nfunc _on_Join_pressed():\n\tvar IPPanel = get_node(\"JoinGame\/Panel\/IPAddress\")\n\tvar ip = IPPanel.get_text();\n\t\n\tif (ip.empty()):\n\t\treturn\n\t\n\tif !network.isClient:\n\t\tnetwork.connectTo(ip, network.port)\n\n\nfunc _on_Editor_pressed():\n\tvar root = get_tree().get_root()\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\troot.add_child( ResourceLoader.load( \"res:\/\/editor.scn\" ).instance() )\n\n","old_contents":"# This script manages all of the GUI elements.\n# It switches between the states of the GUI allowing\n# the user to start games, edit the options or connect\n# to a multiplayer game.\n\nextends Node\n\n# network variables\nvar network\n\n# State variables.\nvar menuOn\nvar splashTween\n\n# Timers.\nvar timer\nvar initialWait = .5\nvar splashTimer = 2.0\nvar warningTimer = 5.0\n\n# GUI pieces.\nvar Splash_Team5\nvar Splash_Warning\nvar Menu_Main\nvar Menu_Chooser\nvar Menu_MP\nvar Menu_HostGame\nvar Menu_JoinGame\nvar Menu_Options\n\n# Menu state values. Used to switch between them.\nvar MENU_INIT\t\t\t= 0\nvar MENU_SPLASHTEAM5\t= 1\nvar MENU_SPLASHWARNING\t= 2\nvar MENU_MAIN\t\t\t= 3\nvar MENU_CHOOSER\t\t= 4\nvar MENU_MP\t\t\t\t= 5\nvar MENU_HOSTGAME\t\t= 6\nvar MENU_JOINGAME\t\t= 7\nvar MENU_OPTIONS\t\t= 8\n\n# Main Menu Theme\nvar samplePlayer = StreamPlayer.new()\nvar songs = [load(\"res:\/\/main_theme_antris.ogg\")]\n\n# Function to be called once for setup.\nfunc _ready():\n\t# Initial setup.\n\tmenuOn = MENU_INIT\n\ttimer = 0.0\n\tset_process( true )\n\tset_process_input( true )\n\n\t# Setup the splash fader tween.\n\tsplashTween = Tween.new()\n\tget_node( \"SplashFader\" ).add_child( splashTween )\n\tsplashTween.interpolate_method( get_node( \"SplashFader\" ), \"set_opacity\", 1.0, 0.0, 1.0, Tween.TRANS_CUBIC, Tween.EASE_IN_OUT )\n\n\t# Gather all of the menus.\n\tSplash_Team5 = get_node( \"SplashTeam5\" )\n\tSplash_Warning = get_node( \"SplashWarning\" )\n\tMenu_Main = get_node( \"MainMenu\" )\n\tMenu_Chooser = get_node( \"ChooserMenu\" )\n\tMenu_MP = get_node( \"Multiplayer\" )\n\tMenu_HostGame = get_node( \"HostGame\" )\n\tMenu_JoinGame = get_node( \"JoinGame\" )\n\tMenu_Options = get_node( \"OptionsMenu\" )\n\t\n\tGlobals.set(\"Network\", load(\"res:\/\/scripts\/Network.gd\").new())\n\tnetwork = Globals.get(\"Network\")\n\t\n\tvar scn = load(\"res:\/\/networkProxy.scn\")\n\tadd_child(scn.instance())\n\t#get_tree().get_root().add_child(network)\n\t\n\t#get_tree().get_root().add_child(network)\n\tnetwork.root = get_tree().get_root()\n\n\t# Load the config.\n\tvar config = preload( \"res:\/\/scripts\/DataManager.gd\" ).new().loadConfig()\n\t\n\tget_node(\"OptionsMenu\/Panel\/OnlineName\/LineEdit\").set_text( config.name )\n\tget_node(\"OptionsMenu\/Panel\/SoundVolume\/SoundSlider\").set_value( config.soundvolume )\n\tget_node(\"OptionsMenu\/Panel\/MusicVolume\/MusicSlider\").set_value( config.musicvolume )\n\t#get_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\").set_text( config.portnumber )\n\t\n\tnetwork.port = config.portnumber\n\n\t# Main Menu Theme\n\tadd_child(samplePlayer)\n\tsamplePlayer.set_stream(songs[0])\n\tsamplePlayer.play()\n\t\n# Function to update the GUI.\nfunc _process( delta ):\n\t# Handle the initial wait.\n\tif( menuOn == MENU_INIT ):\n\t\tif( timer > initialWait ):\n\t\t\tmenuOn = MENU_SPLASHTEAM5\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiIn()\n\n\t# Handle the Team5 splash screen.\n\tif( menuOn == MENU_SPLASHTEAM5 ):\n\t\tif( timer > splashTimer ):\n\t\t\tmenuOn = MENU_SPLASHWARNING\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiOut()\n\t\t\tSplash_Warning.guiIn()\n\n\t# Handle the warning splash screen.\n\tif( menuOn == MENU_SPLASHWARNING ):\n\t\tif( timer > warningTimer ):\n\t\t\tmenuOn = MENU_MAIN\n\t\t\ttimer = 0.0\n\t\t\tSplash_Warning.guiOut()\n\t\t\tMenu_Main.guiIn()\n\t\t\tsplashTween.start()\n\n\t# Increase the timer each frame.\n\ttimer += delta\n\n# Handle the input events.\nfunc _input( ev ):\n\t# Handle skip splash screens.\n\tif( !ev.is_pressed() and ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT ):\n\t\tif( menuOn == MENU_SPLASHTEAM5 || menuOn == MENU_SPLASHWARNING ):\n\t\t\ttimer = 999.0;\n\n\t# Handle exit.\n\tif( ev.is_action( \"ui_cancel\" ) ):\n\t\texit()\n\nfunc exit():\n\tprint( \"Exiting\" )\n\tOS.get_main_loop().quit()\n\nfunc _on_Exit_pressed():\n\texit()\n\n# TODO save to ConfigFile, load this on beginning\nfunc _on_Options_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Options.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_OPTIONS\n\tget_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\").set_text(str(network.port))\n\nfunc _on_Cancel_pressed():\n\tMenu_Options.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_SaveQuit_pressed():\n\t# Save the options.\n\t\n\tvar config = { name = get_node(\"OptionsMenu\/Panel\/OnlineName\/LineEdit\").get_text()\n\t\t\t\t , soundvolume = get_node(\"OptionsMenu\/Panel\/SoundVolume\/SoundSlider\").get_value()\n\t\t\t\t , musicvolume = get_node(\"OptionsMenu\/Panel\/MusicVolume\/MusicSlider\").get_value()\n\t\t\t\t , portnumber = get_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\").get_text()\n\t\t\t\t }\n\n\tpreload( \"res:\/\/scripts\/DataManager.gd\" ).new().saveConfig( config )\n\t\n\tvar field = get_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\")\n\tnetwork.setPort(field.get_text())\n\tnetwork.setPort(field.get_text())\n\t_on_Cancel_pressed()\n\nfunc _on_SP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Chooser.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_CHOOSER\n\nfunc _on_MainMenu_pressed():\n\tMenu_Chooser.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MainMenuMP_pressed():\n\tMenu_MP.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_MP.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MP\n\nfunc _on_MainMenuHG_pressed():\n\tMenu_HostGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\tnetwork.disconnect()\n\nfunc _on_HostGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_HostGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_HOSTGAME\n\t\n\tif !network.isHost and !network.isNetwork:\n\t\tprint(\"calling!\")\n\t\tnetwork.host(network.port)\n\t\tget_node(\"HostGame\/Panel\/Waiting\").set_text(\"Waiting for player to join on port \" + str(network.port) + \"...\")\n\nfunc _on_JoinGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_JoinGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_JOINGAME\n\nfunc _on_MainMenuJG_pressed():\n\tMenu_JoinGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\tif (network.isClient):\n\t\tnetwork.disconnect()\n\nfunc _on_RandomPuzzle_pressed():\n\tvar root = get_tree().get_root()\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\troot.add_child( ResourceLoader.load( \"res:\/\/puzzle.scn\" ).instance() )\n\n\nfunc _on_Join_pressed():\n\tvar IPPanel = get_node(\"JoinGame\/Panel\/IPAddress\")\n\tvar ip = IPPanel.get_text();\n\t\n\tif (ip.empty()):\n\t\treturn\n\t\n\tif !network.isClient:\n\t\tnetwork.connectTo(ip, network.port)\n\n\nfunc _on_Editor_pressed():\n\tvar root = get_tree().get_root()\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\troot.add_child( ResourceLoader.load( \"res:\/\/editor.scn\" ).instance() )\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"e2b76c8dc152b9dbff448016b8797d9b70df1e32","subject":"fixed bug. too many arguments to function","message":"fixed bug. too many arguments to function\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/GUIManager.gd","new_file":"src\/scripts\/GUIManager.gd","new_contents":"# This script manages all of the GUI elements.\n# It switches between the states of the GUI allowing\n# the user to start games, edit the options or connect\n# to a multiplayer game.\n\nextends Node\n\n# network variables\nvar network\n\n# State variables.\nvar menuOn\nvar splashTween\n\n# Timers.\nvar timer\nvar initialWait = 0.5\nvar splashTimer = 2.0\nvar warningTimer = 5.0\n\n# GUI pieces.\nvar Splash_Team5\nvar Splash_Warning\nvar Menu_Main\nvar Menu_Chooser\nvar Menu_MP\nvar Menu_HostGame\nvar Menu_JoinGame\nvar Menu_Options\n\n# Menu state values. Used to switch between them.\nvar MENU_INIT\t\t\t= 0\nvar MENU_SPLASHTEAM5\t= 1\nvar MENU_SPLASHWARNING\t= 2\nvar MENU_MAIN\t\t\t= 3\nvar MENU_CHOOSER\t\t= 4\nvar MENU_MP\t\t\t\t= 5\nvar MENU_HOSTGAME\t\t= 6\nvar MENU_JOINGAME\t\t= 7\nvar MENU_OPTIONS\t\t= 8\n\n# Main Menu Theme\nvar samplePlayer = StreamPlayer.new()\nvar songs = [load(\"res:\/\/main_theme_antris.ogg\")]\n\n# Loader dialog\nvar saveDir\nvar fileDialog\n\nfunc skipTitle(skip):\n\tif skip:\n\t\tinitialWait = 0.01\n\t\tsplashTimer = 0.01\n\t\twarningTimer = 0.01\n\n# Function to be called once for setup.\nfunc _ready():\n\t# Initial setup.\n\tmenuOn = MENU_INIT\n\ttimer = 0.0\n\tset_process( true )\n\tset_process_input( true )\n\n\t# Setup the splash fader tween.\n\tsplashTween = Tween.new()\n\tget_node( \"SplashFader\" ).add_child( splashTween )\n\tsplashTween.interpolate_method( get_node( \"SplashFader\" ), \"set_opacity\", 1.0, 0.0, 1.0, Tween.TRANS_CUBIC, Tween.EASE_IN_OUT )\n\n\t# Gather all of the menus.\n\tSplash_Team5 = get_node( \"SplashTeam5\" )\n\tSplash_Warning = get_node( \"SplashWarning\" )\n\tMenu_Main = get_node( \"MainMenu\" )\n\tMenu_Chooser = get_node( \"ChooserMenu\" )\n\tMenu_MP = get_node( \"Multiplayer\" )\n\tMenu_HostGame = get_node( \"HostGame\" )\n\tMenu_JoinGame = get_node( \"JoinGame\" )\n\tMenu_Options = get_node( \"OptionsMenu\" )\n\n\tGlobals.set(\"Network\", load(\"res:\/\/scripts\/Network.gd\").new())\n\tnetwork = Globals.get(\"Network\")\n\n\tvar scn = load(\"res:\/\/networkProxy.scn\")\n\tadd_child(scn.instance())\n\tnetwork.root = get_tree().get_root()\n\n\t# Load the config.\n\tvar config = preload( \"res:\/\/scripts\/DataManager.gd\" ).new().loadConfig()\n\n\tget_node(\"OptionsMenu\/Panel\/OnlineName\/LineEdit\").set_text( config.name )\n\tget_node(\"OptionsMenu\/Panel\/SoundVolume\/SoundSlider\").set_value( config.soundvolume )\n\tget_node(\"OptionsMenu\/Panel\/MusicVolume\/MusicSlider\").set_value( config.musicvolume )\n\n\tnetwork.port = config.portnumber\n\n\t# Prepare puzzle loader dialog\n\tsaveDir = OS.get_data_dir() + \"\/PuzzleSaves\"\n\tfileDialog = preload(\"Editor.gd\").initLoadSaveDialog(self, get_tree(), saveDir)\n\n\t# Main Menu Theme\n\tadd_child(samplePlayer)\n\tsamplePlayer.set_stream(songs[0])\n\tsamplePlayer.play()\n\n# Function to update the GUI.\nfunc _process( delta ):\n\t# Handle the initial wait.\n\tif( menuOn == MENU_INIT ):\n\t\tif( timer > initialWait ):\n\t\t\tmenuOn = MENU_SPLASHTEAM5\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiIn()\n\n\t# Handle the Team5 splash screen.\n\tif( menuOn == MENU_SPLASHTEAM5 ):\n\t\tif( timer > splashTimer ):\n\t\t\tmenuOn = MENU_SPLASHWARNING\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiOut()\n\t\t\tSplash_Warning.guiIn()\n\n\t# Handle the warning splash screen.\n\tif( menuOn == MENU_SPLASHWARNING ):\n\t\tif( timer > warningTimer ):\n\t\t\tmenuOn = MENU_MAIN\n\t\t\ttimer = 0.0\n\t\t\tSplash_Warning.guiOut()\n\t\t\tMenu_Main.guiIn()\n\t\t\tsplashTween.start()\n\n\t# Increase the timer each frame.\n\ttimer += delta\n\n# Handle the input events.\nfunc _input( ev ):\n\t# Handle skip splash screens.\n\tif( !ev.is_pressed() and ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT ):\n\t\tif( menuOn == MENU_SPLASHTEAM5 || menuOn == MENU_SPLASHWARNING ):\n\t\t\ttimer = 999.0;\n\n\t# Handle exit.\n\tif( ev.is_action( \"ui_cancel\" ) ):\n\t\texit()\n\nfunc exit():\n\tprint( \"Exiting\" )\n\tOS.get_main_loop().quit()\n\nfunc _on_Exit_pressed():\n\texit()\n\n# TODO save to ConfigFile, load this on beginning\nfunc _on_Options_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Options.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_OPTIONS\n\tget_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\").set_text(str(network.port))\n\nfunc _on_Cancel_pressed():\n\tMenu_Options.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_SaveQuit_pressed():\n\t# Save the options.\n\n\tvar config = { name = get_node(\"OptionsMenu\/Panel\/OnlineName\/LineEdit\").get_text()\n\t\t\t\t , soundvolume = get_node(\"OptionsMenu\/Panel\/SoundVolume\/SoundSlider\").get_value()\n\t\t\t\t , musicvolume = get_node(\"OptionsMenu\/Panel\/MusicVolume\/MusicSlider\").get_value()\n\t\t\t\t , portnumber = get_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\").get_text()\n\t\t\t\t }\n\n\tpreload( \"res:\/\/scripts\/DataManager.gd\" ).new().saveConfig( config )\n\n\tvar field = get_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\")\n\tnetwork.setPort(field.get_text())\n\tnetwork.setPort(field.get_text())\n\t_on_Cancel_pressed()\n\nfunc _on_SP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Chooser.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_CHOOSER\n\nfunc _on_MainMenu_pressed():\n\tMenu_Chooser.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MainMenuMP_pressed():\n\tMenu_MP.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_MP.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MP\n\nfunc _on_MainMenuHG_pressed():\n\tMenu_HostGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\tnetwork.disconnect()\n\nfunc _on_HostGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_HostGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_HOSTGAME\n\n\tif !network.isHost and !network.isNetwork:\n\t\tprint(\"calling!\")\n\t\tnetwork.host(network.port)\n\t\tget_node(\"HostGame\/Panel\/Waiting\").set_text(\"Waiting for player to join on port \" + str(network.port) + \"...\")\n\nfunc _on_JoinGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_JoinGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_JOINGAME\n\nfunc _on_MainMenuJG_pressed():\n\tMenu_JoinGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\tif (network.isClient):\n\t\tnetwork.disconnect()\n\nfunc _on_RandomPuzzle_pressed(puzzle=null):\n\tvar root = get_tree().get_root()\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\troot.add_child( ResourceLoader.load( \"res:\/\/puzzleView.scn\" ).instance() )\n\tvar p = ResourceLoader.load( \"res:\/\/puzzle.scn\" ).instance()\n\n\tif puzzle != null:\n\t\tp.generateRandom = false\n\t\tp.get_node(\"GridView\/GridMan\").set_puzzle(puzzle)\n\t\tp.get_node(\"GridView\/GridMan\").setupCam()\n\n\troot.add_child( p )\n\n\nfunc _on_Join_pressed():\n\tvar IPPanel = get_node(\"JoinGame\/Panel\/IPAddress\")\n\tvar ip = IPPanel.get_text();\n\n\tif (ip.empty()):\n\t\treturn\n\n\tif !network.isClient:\n\t\tnetwork.connectTo(ip, network.port)\n\n\nfunc _on_Editor_pressed():\n\tvar root = get_tree().get_root()\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\troot.add_child( ResourceLoader.load( \"res:\/\/editor.scn\" ).instance() )\n\n\nfunc _on_LoadPuzzle_pressed():\n\tpreload(\"Editor.gd\").showLoadDialog(fileDialog, self)\n\n# called by the fileDialog\nfunc puzzleLoad():\n\tvar f = fileDialog.get_current_path()\n\tif f == null or f == \"\":\n\t\treturn\n\tprint(\"LOADING FROM \", f)\n\t_on_RandomPuzzle_pressed(preload(\"DataManager.gd\").loadPuzzle( f ))\n","old_contents":"# This script manages all of the GUI elements.\n# It switches between the states of the GUI allowing\n# the user to start games, edit the options or connect\n# to a multiplayer game.\n\nextends Node\n\n# network variables\nvar network\n\n# State variables.\nvar menuOn\nvar splashTween\n\n# Timers.\nvar timer\nvar initialWait = 0.5\nvar splashTimer = 2.0\nvar warningTimer = 5.0\n\n# GUI pieces.\nvar Splash_Team5\nvar Splash_Warning\nvar Menu_Main\nvar Menu_Chooser\nvar Menu_MP\nvar Menu_HostGame\nvar Menu_JoinGame\nvar Menu_Options\n\n# Menu state values. Used to switch between them.\nvar MENU_INIT\t\t\t= 0\nvar MENU_SPLASHTEAM5\t= 1\nvar MENU_SPLASHWARNING\t= 2\nvar MENU_MAIN\t\t\t= 3\nvar MENU_CHOOSER\t\t= 4\nvar MENU_MP\t\t\t\t= 5\nvar MENU_HOSTGAME\t\t= 6\nvar MENU_JOINGAME\t\t= 7\nvar MENU_OPTIONS\t\t= 8\n\n# Main Menu Theme\nvar samplePlayer = StreamPlayer.new()\nvar songs = [load(\"res:\/\/main_theme_antris.ogg\")]\n\n# Loader dialog\nvar saveDir\nvar fileDialog\n\nfunc skipTitle(skip):\n\tif skip:\n\t\tinitialWait = 0.01\n\t\tsplashTimer = 0.01\n\t\twarningTimer = 0.01\n\n# Function to be called once for setup.\nfunc _ready():\n\t# Initial setup.\n\tmenuOn = MENU_INIT\n\ttimer = 0.0\n\tset_process( true )\n\tset_process_input( true )\n\n\t# Setup the splash fader tween.\n\tsplashTween = Tween.new()\n\tget_node( \"SplashFader\" ).add_child( splashTween )\n\tsplashTween.interpolate_method( get_node( \"SplashFader\" ), \"set_opacity\", 1.0, 0.0, 1.0, Tween.TRANS_CUBIC, Tween.EASE_IN_OUT )\n\n\t# Gather all of the menus.\n\tSplash_Team5 = get_node( \"SplashTeam5\" )\n\tSplash_Warning = get_node( \"SplashWarning\" )\n\tMenu_Main = get_node( \"MainMenu\" )\n\tMenu_Chooser = get_node( \"ChooserMenu\" )\n\tMenu_MP = get_node( \"Multiplayer\" )\n\tMenu_HostGame = get_node( \"HostGame\" )\n\tMenu_JoinGame = get_node( \"JoinGame\" )\n\tMenu_Options = get_node( \"OptionsMenu\" )\n\n\tGlobals.set(\"Network\", load(\"res:\/\/scripts\/Network.gd\").new())\n\tnetwork = Globals.get(\"Network\")\n\n\tvar scn = load(\"res:\/\/networkProxy.scn\")\n\tadd_child(scn.instance())\n\tnetwork.root = get_tree().get_root()\n\n\t# Load the config.\n\tvar config = preload( \"res:\/\/scripts\/DataManager.gd\" ).new().loadConfig()\n\n\tget_node(\"OptionsMenu\/Panel\/OnlineName\/LineEdit\").set_text( config.name )\n\tget_node(\"OptionsMenu\/Panel\/SoundVolume\/SoundSlider\").set_value( config.soundvolume )\n\tget_node(\"OptionsMenu\/Panel\/MusicVolume\/MusicSlider\").set_value( config.musicvolume )\n\n\tnetwork.port = config.portnumber\n\n\t# Prepare puzzle loader dialog\n\tsaveDir = OS.get_data_dir() + \"\/PuzzleSaves\"\n\tfileDialog = preload(\"Editor.gd\").initLoadSaveDialog(self, get_tree(), saveDir)\n\n\t# Main Menu Theme\n\tadd_child(samplePlayer)\n\tsamplePlayer.set_stream(songs[0])\n\tsamplePlayer.play()\n\n# Function to update the GUI.\nfunc _process( delta ):\n\t# Handle the initial wait.\n\tif( menuOn == MENU_INIT ):\n\t\tif( timer > initialWait ):\n\t\t\tmenuOn = MENU_SPLASHTEAM5\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiIn()\n\n\t# Handle the Team5 splash screen.\n\tif( menuOn == MENU_SPLASHTEAM5 ):\n\t\tif( timer > splashTimer ):\n\t\t\tmenuOn = MENU_SPLASHWARNING\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiOut()\n\t\t\tSplash_Warning.guiIn()\n\n\t# Handle the warning splash screen.\n\tif( menuOn == MENU_SPLASHWARNING ):\n\t\tif( timer > warningTimer ):\n\t\t\tmenuOn = MENU_MAIN\n\t\t\ttimer = 0.0\n\t\t\tSplash_Warning.guiOut()\n\t\t\tMenu_Main.guiIn()\n\t\t\tsplashTween.start()\n\n\t# Increase the timer each frame.\n\ttimer += delta\n\n# Handle the input events.\nfunc _input( ev ):\n\t# Handle skip splash screens.\n\tif( !ev.is_pressed() and ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT ):\n\t\tif( menuOn == MENU_SPLASHTEAM5 || menuOn == MENU_SPLASHWARNING ):\n\t\t\ttimer = 999.0;\n\n\t# Handle exit.\n\tif( ev.is_action( \"ui_cancel\" ) ):\n\t\texit()\n\nfunc exit():\n\tprint( \"Exiting\" )\n\tOS.get_main_loop().quit()\n\nfunc _on_Exit_pressed():\n\texit()\n\n# TODO save to ConfigFile, load this on beginning\nfunc _on_Options_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Options.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_OPTIONS\n\tget_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\").set_text(str(network.port))\n\nfunc _on_Cancel_pressed():\n\tMenu_Options.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_SaveQuit_pressed():\n\t# Save the options.\n\n\tvar config = { name = get_node(\"OptionsMenu\/Panel\/OnlineName\/LineEdit\").get_text()\n\t\t\t\t , soundvolume = get_node(\"OptionsMenu\/Panel\/SoundVolume\/SoundSlider\").get_value()\n\t\t\t\t , musicvolume = get_node(\"OptionsMenu\/Panel\/MusicVolume\/MusicSlider\").get_value()\n\t\t\t\t , portnumber = get_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\").get_text()\n\t\t\t\t }\n\n\tpreload( \"res:\/\/scripts\/DataManager.gd\" ).new().saveConfig( config )\n\n\tvar field = get_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\")\n\tnetwork.setPort(field.get_text())\n\tnetwork.setPort(field.get_text())\n\t_on_Cancel_pressed()\n\nfunc _on_SP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Chooser.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_CHOOSER\n\nfunc _on_MainMenu_pressed():\n\tMenu_Chooser.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MainMenuMP_pressed():\n\tMenu_MP.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_MP.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MP\n\nfunc _on_MainMenuHG_pressed():\n\tMenu_HostGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\tnetwork.disconnect()\n\nfunc _on_HostGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_HostGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_HOSTGAME\n\n\tif !network.isHost and !network.isNetwork:\n\t\tprint(\"calling!\")\n\t\tnetwork.host(network.port)\n\t\tget_node(\"HostGame\/Panel\/Waiting\").set_text(\"Waiting for player to join on port \" + str(network.port) + \"...\")\n\nfunc _on_JoinGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_JoinGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_JOINGAME\n\nfunc _on_MainMenuJG_pressed():\n\tMenu_JoinGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\tif (network.isClient):\n\t\tnetwork.disconnect()\n\nfunc _on_RandomPuzzle_pressed(puzzle):\n\tvar root = get_tree().get_root()\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\troot.add_child( ResourceLoader.load( \"res:\/\/puzzleView.scn\" ).instance() )\n\n\tvar p = ResourceLoader.load( \"res:\/\/puzzle.scn\" ).instance()\n\tp.generateRandom = false\n\tp.get_node(\"GridView\/GridMan\").set_puzzle(puzzle)\n\troot.add_child( p )\n\tp.get_node(\"GridView\/GridMan\").setupCam()\n\n\nfunc _on_Join_pressed():\n\tvar IPPanel = get_node(\"JoinGame\/Panel\/IPAddress\")\n\tvar ip = IPPanel.get_text();\n\n\tif (ip.empty()):\n\t\treturn\n\n\tif !network.isClient:\n\t\tnetwork.connectTo(ip, network.port)\n\n\nfunc _on_Editor_pressed():\n\tvar root = get_tree().get_root()\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\troot.add_child( ResourceLoader.load( \"res:\/\/editor.scn\" ).instance() )\n\n\nfunc _on_LoadPuzzle_pressed():\n\tpreload(\"Editor.gd\").showLoadDialog(fileDialog, self)\n\n# called by the fileDialog\nfunc puzzleLoad():\n\tvar f = fileDialog.get_current_path()\n\tif f == null or f == \"\":\n\t\treturn\n\tprint(\"LOADING FROM \", f)\n\t_on_RandomPuzzle_pressed(preload(\"DataManager.gd\").loadPuzzle( f ))\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"9416ce1b84af3d57dd03cae1eb27acf198e8d3b8","subject":"static functions","message":"static functions\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/PuzzleManager.gd","new_file":"src\/scripts\/PuzzleManager.gd","new_contents":"const DIFF_EASY\t\t= 0\nconst DIFF_MEDIUM\t= 1\nconst DIFF_HARD\t\t= 2\n\n# this order is important\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\nconst SOLVER_ERROR_NONE\t\t\t\t= 0\nconst SOLVER_ERROR_MISSING_PAIR\t\t= 1\n\nconst blockColors = [\"Blue\", \"Orange\", \"Red\", \"Yellow\", \"Purple\", \"Green\"]\n\n# Preload paired blocks\nconst blockScn = preload( \"res:\/\/blocks\/block.scn\" )\nconst blockScripts = [ preload( \"Blocks\/LaserBlock.gd\" )\n\t\t\t \t , preload( \"Blocks\/WildBlock.gd\" )\n\t\t\t \t , preload( \"Blocks\/PairedBlock.gd\" )\n\t\t\t \t , preload( \"Blocks\/LaserBlock.gd\" )\n\t\t\t \t ]\n\n# Hash map of all possible positions\nvar shape = {}\n\n# Calculates the layer that a block is on.\nstatic func calcBlockLayer( x, y, z ):\n\treturn max( max( abs( x ), abs( y ) ), abs( z ) )\n# THIS IS EVERYWHERE, ANY BETTER WAY TO HAVE FUNCTIONS BETWEEN SCRIPTS?\nstatic func calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n# Stores a puzzle in a convenient class.\nclass Puzzle:\n\n\tvar puzzleName\t\t\t# The name of the puzzle.\n\tvar puzzleLayers\t\t# The amount of layers the puzzle has.\n\tvar pairCount = []\t\t# The amount of pair blocks on each layer.\n\tvar blocks = []\t\t\t# Information on all of the blocks in the puzzle.\n\tvar lasers = []\t\t\t# Laser connections.\n\tvar puzzleMan\t\t\t# Stores the puzzle manager for making pickled blocks.\n\n\t# Converts a puzzle to a dictionary.\n\tfunc toDict():\n\t\tvar blockArr = []\n\t\tfor b in range( blocks.size() ):\n\t\t\tblockArr.append( blocks[b].toDict() )\n\n\t\tvar di = { pN = puzzleName\n\t\t \t , pL = puzzleLayers\n\t\t\t\t , bL = blockArr\n\t\t\t\t , pC = pairCount\n\t\t\t\t , lS = lasers\n\t\t\t }\n\t\treturn di\n\n\t# Converts a dictionary to a puzzle.\n\tfunc fromDict( di ):\n\t\tpuzzleName = di.pN\n\t\tpuzzleLayers = di.pL\n\t\tpairCount = di.pC\n\t\tlasers = di.lS\n\n\t\tfor b in range( di.bL.size() ):\n\t\t\tvar nb = puzzleMan.PickledBlock.new()\n\t\t\tnb.fromDict( di.bL[b] )\n\t\t\tblocks.append( nb )\n\t\treturn\n\n\t# Class that stores a solution or the errors in a puzzle.\n\tclass PuzzleSteps:\n\t\tvar solveable = false\n\t\tvar error = SOLVER_ERROR_NONE\n\t\tvar errorBlock = null\n\t\tvar solveSteps = []\n\n\t# THIS IS EVERYWHERE, ANY BETTER WAY TO HAVE FUNCTIONS BETWEEN SCRIPTS?\n\t# duplicate of the global definition above? Either way godot is chill and\n\t# doesn't complain\n\tfunc calcBlockLayerVec( pos ):\n\t\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n\t# Determines if a puzzle is solveable.\n\tfunc solvePuzzle():\n\t\t# Simply use the solvePuzzleSteps function and return the solveable part.\n\t\tvar ps = self.solvePuzzleSteps()\n\t\treturn ps.solveable\n\n\t# Determines if a puzzle is solveable and returns the steps needed to solve it.\n\tfunc solvePuzzleSteps():\n\t\tvar puzzleSteps = PuzzleSteps.new()\n\n\t\tvar pairs = []\n\n\t\t# Add new dictionary for each later.\n\t\tfor l in range( puzzleLayers + 1 ):\n\t\t\tpairs.append( {} )\n\n\t\t# Gather paired blocks from the puzzle.\n\t\tfor b in blocks:\n\t\t\tif b.blockClass == BLOCK_PAIR:\n\t\t\t\tb.solverFlag = false\n\t\t\t\tpairs[calcBlockLayerVec(b.blockPos)][b.name] = b\n\n\t\t# Make sure each pair block has a valid pair on the same layer.\n\t\tfor l in pairs:\n\t\t\tfor p in l:\n\t\t\t\tif l.has( l[p].pairName ):\n\t\t\t\t\tif( not l[p].solverFlag ):\n\t\t\t\t\t\tl[p].solverFlag = true\n\t\t\t\t\t\tl[l[p].pairName].solverFlag = true\n\t\t\t\t\t\tpuzzleSteps.solveSteps.append( [ l[p].blockPos, l[l[p].pairName].blockPos ] )\n\t\t\t\telse:\n\t\t\t\t\tpuzzleSteps.error = SOLVER_ERROR_MISSING_PAIR\n\t\t\t\t\tpuzzleSteps.errorBlock = l[p]\n\t\t\t\t\treturn puzzleSteps\n\n\t\tpuzzleSteps.solveable = true\n\t\treturn puzzleSteps\n\n# Randomly shuffle an array.\nfunc shuffleArray( arr ):\n\tfor i in range( arr.size() - 1, 1, -1 ):\n\t\tvar swapVal = randi() % (i + 1)\n\t\tvar temp = arr[swapVal]\n\t\tarr[swapVal] = arr[i]\n\t\tarr[i] = temp\n\n# Determines the block type based on puzzle size and difficulty.\nfunc getBlockType( difficulty, pos ):\n\t# Determine if this is the goal block.\n\tif pos.x == 0 and pos.y == 0 and pos.z == 0:\n\t\treturn BLOCK_GOAL\n\n\t# Determine the layer this block is on.\n\tvar layer = calcBlockLayerVec( pos )\n\n\t# Determine how many blocks are on the outer part of the layer.\n\tvar layerCount = 0\n\tif abs( pos.x ) == layer:\n\t\tlayerCount += 1\n\tif abs( pos.y ) == layer:\n\t\tlayerCount += 1\n\tif abs( pos.z ) == layer:\n\t\tlayerCount += 1\n\n\t# Determine if this block is a laser.\n\tif difficulty == DIFF_EASY or difficulty == DIFF_MEDIUM:\n\t\tif layerCount == 3:\n\t\t\treturn BLOCK_LASER\n\n\tif difficulty == DIFF_HARD:\n\t\tif abs( pos.x ) == abs( pos.z ) and pos.y == 0:\n\t\t\treturn BLOCK_LASER\n\n\t# Determine if this block is a wild block.\n\tif difficulty == DIFF_EASY:\n\t\tif layerCount == 2:\n\t\t\treturn BLOCK_WILD\n\n\tif difficulty == DIFF_MEDIUM:\n\t\tif layerCount == 2:\n\t\t\tif pos.y == layer || pos.y == -layer:\n\t\t\t\treturn BLOCK_WILD\n\n\tif difficulty == DIFF_HARD:\n\t\tif layerCount == 1:\n\t\t\tif pos.y == 0:\n\t\t\t\treturn BLOCK_WILD\n\n\t# Otherwise it's a normal block.\n\treturn BLOCK_PAIR\n\n# Generates a solveable puzzle.\nfunc generatePuzzle( layers, difficulty ):\n\tvar blockID = 0\n\tvar puzzle = Puzzle.new()\n\tpuzzle.puzzleName = \"RANDOM PUZZLE\"\n\tpuzzle.puzzleLayers = layers\n\n\t# Create all possible positions.\n\tvar layeredblocks = []\n\tfor l in range( 0, layers + 1 ):\n\t\tlayeredblocks.append( [] )\n\t\tpuzzle.pairCount.append( 0 )\n\tfor x in range( -layers, layers + 1 ):\n\t\tfor y in range( -layers, layers + 1 ):\n\t\t\tfor z in range( -layers, layers + 1 ):\n\t\t\t\tlayeredblocks[calcBlockLayer( x, y, z )].append(Vector3(x,y,z))\n\t\t\t\tshape[Vector3(x,y,z)] = null\n\n\t# Generate laser lines.\n\tfor l in range( 1, layers + 1 ):\n\t\tif difficulty == DIFF_MEDIUM or difficulty == DIFF_EASY:\n\t\t\tfor lx in [ -l, l ]:\n\t\t\t\tfor ly in [ -l, l ]:\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, ly, lx ), Vector3( lx*-1, ly, lx )] )\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, ly, lx ), Vector3( lx, ly, lx*-1 )] )\n\n\t\tif difficulty == DIFF_EASY:\n\t\t\tfor lx in [ -l, l ]:\n\t\t\t\tfor lz in [ -l, l ]:\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, l, lz ), Vector3( lx, -l, lz )] )\n\n\t\tif difficulty == DIFF_HARD:\n\t\t\tfor lx in [ -l, l ]:\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, 0, lx ), Vector3( lx*-1, 0, lx )] )\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, 0, lx ), Vector3( lx, 0, lx*-1 )] )\n\n\t# Assign block types based on position.\n\tfor l in range( 0, layers + 1 ):\n\t\t# Randomize the pairs.\n\t\tshuffleArray( layeredblocks[l] )\n\t\t# print( \"NUM \", layeredblocks[l].size() )\n\t\tvar prevBlock = null\n\t\tvar even = false\n\t\tfor pos in layeredblocks[l]:\n\t\t\tvar x = pos.x\n\t\t\tvar y = pos.y\n\t\t\tvar z = pos.z\n\n\t\t\tvar t = getBlockType( difficulty, pos )\n\n\t\t\tif t == BLOCK_GOAL:\n\t\t\t\tcontinue\n\n\t\t\tvar b = PickledBlock.new()\n\t\t\tb.blockPos = pos\n\t\t\tb.name = blockID\n\n\t\t\tblockID += 1\n\t\t\tpuzzle.blocks.append( b )\n\n\t\t\tif t == BLOCK_LASER:\n\t\t\t\tb.setBlockClass(BLOCK_LASER)\\\n\t\t\t\t\t.setLaserExtent( Vector3( 0, 1, 0 ) )\n\t\t\t\tcontinue\n\n\t\t\tif t == BLOCK_WILD:\n\t\t\t\tb.setBlockClass(BLOCK_WILD) \\\n\t\t\t\t\t.setTextureName(blockColors[randi() % blockColors.size()])\n\t\t\t\tcontinue\n\n\t\t\tif even:\n\t\t\t\t# Count this pair.\n\t\t\t\tpuzzle.pairCount[l] += 1\n\n\t\t\t\tvar randColor = blockColors[randi() % blockColors.size()]\n\t\t\t\tb.setBlockClass(BLOCK_PAIR) \\\n\t\t\t\t\t.setPairName(prevBlock.name) \\\n\t\t\t\t\t.setTextureName(randColor)\n\n\t\t\t\tprevBlock.setBlockClass(BLOCK_PAIR) \\\n\t\t\t\t\t.setPairName(b.name) \\\n\t\t\t\t\t.setTextureName(randColor)\n\t\t\teven = not even\n\t\t\tprevBlock = b\n\n\treturn puzzle\n\n# Storage class for blocks in a puzzle.\nclass PickledBlock:\n\tvar name\n\tvar blockClass = BLOCK_PAIR\n\tvar pairName\n\tvar textureName = \"Red\"\n\tvar blockPos\n\tvar laserExtent\n\tvar solverFlag\t\t# Keeps track of this block, only user for the solver.\n\n\tfunc setName(n):\n\t\tname = n\n\t\treturn self\n\n\tfunc setPairName(n):\n\t\tpairName = n\n\t\treturn self\n\n\tfunc setLaserExtent(n):\n\t\tlaserExtent = n\n\t\treturn self\n\n\tfunc setBlockPos(n):\n\t\tblockPos = n\n\t\treturn self\n\n\tfunc setBlockClass(c):\n\t\tblockClass = c\n\t\treturn self\n\n\tfunc setTextureName(t):\n\t\ttextureName = t\n\t\treturn self\n\n\tfunc toString():\n\t\treturn str(name) + \": \" + str(blockClass) + \" @ \" + str(blockPos)\n\n\tfunc toNode():\n\t\t# instantiate a block scene, assign the appropriate script to it\n\t\tvar n = blockScn.instance()\n\t\tn.set_script(blockScripts[blockClass])\n\n\t\tn.set_translation(blockPos * 2)\n\t\tn.blockPos = blockPos\n\n\t\tn.setName(str(name)).setTexture()\n\n\t\tn.setBlockType( blockClass )\n\n\t\tif blockClass == BLOCK_PAIR:\n\t\t\tn.setPairName(pairName).setTexture(textureName)\n\n\t\tif blockClass == BLOCK_WILD:\n\t\t\tn.setTexture(textureName)\n\n\t\tif blockClass == BLOCK_LASER:\n\t\t\tn.setPairName(pairName).setExtent(laserExtent)\n\t\treturn n\n\n\t# test me plz\n\tfunc fromNode(n):\n\t\tblockPos = n.blockPos\n\n\t\tname = n.name_int\n\n\t\tblockClass = n.getBlockType()\n\n\t\tif blockClass == BLOCK_PAIR:\n\t\t\tpairName = n.pairName\n\t\t\ttextureName = n.textureName\n\n\t\tif blockClass == BLOCK_WILD:\n\t\t\ttextureName = n.textureName\n\n\t\tif blockClass == BLOCK_LASER:\n\t\t\tpairName = n.pairName\n\n\t# Convert this object to a dictionary.\n\tfunc toDict():\n\t\tvar di = { n = name\n\t\t \t , bC = blockClass\n\t\t\t , pN = pairName\n\t\t\t , tN = textureName\n\t\t\t , bP = blockPos\n\t\t\t , lE = laserExtent\n\t\t\t }\n\t\treturn di\n\n\t# Make this object from a dictionary.\n\tfunc fromDict( di ):\n\t\tname = di.n\n\t\tblockClass = di.bC\n\t\tpairName = di.pN\n\t\ttextureName = di.tN\n\t\tblockPos = di.bP\n\t\tlaserExtent = di.lE\n\n","old_contents":"const DIFF_EASY\t\t= 0\nconst DIFF_MEDIUM\t= 1\nconst DIFF_HARD\t\t= 2\n\n# this order is important\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\nconst SOLVER_ERROR_NONE\t\t\t\t= 0\nconst SOLVER_ERROR_MISSING_PAIR\t\t= 1\n\nconst blockColors = [\"Blue\", \"Orange\", \"Red\", \"Yellow\", \"Purple\", \"Green\"]\n\n# Preload paired blocks\nconst blockScn = preload( \"res:\/\/blocks\/block.scn\" )\nconst blockScripts = [ preload( \"Blocks\/LaserBlock.gd\" )\n\t\t\t \t , preload( \"Blocks\/WildBlock.gd\" )\n\t\t\t \t , preload( \"Blocks\/PairedBlock.gd\" )\n\t\t\t \t , preload( \"Blocks\/LaserBlock.gd\" )\n\t\t\t \t ]\n\n# Hash map of all possible positions\nvar shape = {}\n\n# Calculates the layer that a block is on.\nfunc calcBlockLayer( x, y, z ):\n\treturn max( max( abs( x ), abs( y ) ), abs( z ) )\n# THIS IS EVERYWHERE, ANY BETTER WAY TO HAVE FUNCTIONS BETWEEN SCRIPTS?\nfunc calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n# Stores a puzzle in a convenient class.\nclass Puzzle:\n\n\tvar puzzleName\t\t\t# The name of the puzzle.\n\tvar puzzleLayers\t\t# The amount of layers the puzzle has.\n\tvar pairCount = []\t\t# The amount of pair blocks on each layer.\n\tvar blocks = []\t\t\t# Information on all of the blocks in the puzzle.\n\tvar lasers = []\t\t\t# Laser connections.\n\tvar puzzleMan\t\t\t# Stores the puzzle manager for making pickled blocks.\n\n\t# Converts a puzzle to a dictionary.\n\tfunc toDict():\n\t\tvar blockArr = []\n\t\tfor b in range( blocks.size() ):\n\t\t\tblockArr.append( blocks[b].toDict() )\n\n\t\tvar di = { pN = puzzleName\n\t\t \t , pL = puzzleLayers\n\t\t\t\t , bL = blockArr\n\t\t\t\t , pC = pairCount\n\t\t\t\t , lS = lasers\n\t\t\t }\n\t\treturn di\n\n\t# Converts a dictionary to a puzzle.\n\tfunc fromDict( di ):\n\t\tpuzzleName = di.pN\n\t\tpuzzleLayers = di.pL\n\t\tpairCount = di.pC\n\t\tlasers = di.lS\n\n\t\tfor b in range( di.bL.size() ):\n\t\t\tvar nb = puzzleMan.PickledBlock.new()\n\t\t\tnb.fromDict( di.bL[b] )\n\t\t\tblocks.append( nb )\n\t\treturn\n\n\t# Class that stores a solution or the errors in a puzzle.\n\tclass PuzzleSteps:\n\t\tvar solveable = false\n\t\tvar error = SOLVER_ERROR_NONE\n\t\tvar errorBlock = null\n\t\tvar solveSteps = []\n\n\t# THIS IS EVERYWHERE, ANY BETTER WAY TO HAVE FUNCTIONS BETWEEN SCRIPTS?\n\t# duplicate of the global definition above? Either way godot is chill and\n\t# doesn't complain\n\tfunc calcBlockLayerVec( pos ):\n\t\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n\t# Determines if a puzzle is solveable.\n\tfunc solvePuzzle():\n\t\t# Simply use the solvePuzzleSteps function and return the solveable part.\n\t\tvar ps = self.solvePuzzleSteps()\n\t\treturn ps.solveable\n\n\t# Determines if a puzzle is solveable and returns the steps needed to solve it.\n\tfunc solvePuzzleSteps():\n\t\tvar puzzleSteps = PuzzleSteps.new()\n\n\t\tvar pairs = []\n\n\t\t# Add new dictionary for each later.\n\t\tfor l in range( puzzleLayers + 1 ):\n\t\t\tpairs.append( {} )\n\n\t\t# Gather paired blocks from the puzzle.\n\t\tfor b in blocks:\n\t\t\tif b.blockClass == BLOCK_PAIR:\n\t\t\t\tb.solverFlag = false\n\t\t\t\tpairs[calcBlockLayerVec(b.blockPos)][b.name] = b\n\n\t\t# Make sure each pair block has a valid pair on the same layer.\n\t\tfor l in pairs:\n\t\t\tfor p in l:\n\t\t\t\tif l.has( l[p].pairName ):\n\t\t\t\t\tif( not l[p].solverFlag ):\n\t\t\t\t\t\tl[p].solverFlag = true\n\t\t\t\t\t\tl[l[p].pairName].solverFlag = true\n\t\t\t\t\t\tpuzzleSteps.solveSteps.append( [ l[p].blockPos, l[l[p].pairName].blockPos ] )\n\t\t\t\telse:\n\t\t\t\t\tpuzzleSteps.error = SOLVER_ERROR_MISSING_PAIR\n\t\t\t\t\tpuzzleSteps.errorBlock = l[p]\n\t\t\t\t\treturn puzzleSteps\n\n\t\tpuzzleSteps.solveable = true\n\t\treturn puzzleSteps\n\n# Randomly shuffle an array.\nfunc shuffleArray( arr ):\n\tfor i in range( arr.size() - 1, 1, -1 ):\n\t\tvar swapVal = randi() % (i + 1)\n\t\tvar temp = arr[swapVal]\n\t\tarr[swapVal] = arr[i]\n\t\tarr[i] = temp\n\n# Determines the block type based on puzzle size and difficulty.\nfunc getBlockType( difficulty, pos ):\n\t# Determine if this is the goal block.\n\tif pos.x == 0 and pos.y == 0 and pos.z == 0:\n\t\treturn BLOCK_GOAL\n\n\t# Determine the layer this block is on.\n\tvar layer = calcBlockLayerVec( pos )\n\n\t# Determine how many blocks are on the outer part of the layer.\n\tvar layerCount = 0\n\tif abs( pos.x ) == layer:\n\t\tlayerCount += 1\n\tif abs( pos.y ) == layer:\n\t\tlayerCount += 1\n\tif abs( pos.z ) == layer:\n\t\tlayerCount += 1\n\n\t# Determine if this block is a laser.\n\tif difficulty == DIFF_EASY or difficulty == DIFF_MEDIUM:\n\t\tif layerCount == 3:\n\t\t\treturn BLOCK_LASER\n\n\tif difficulty == DIFF_HARD:\n\t\tif abs( pos.x ) == abs( pos.z ) and pos.y == 0:\n\t\t\treturn BLOCK_LASER\n\n\t# Determine if this block is a wild block.\n\tif difficulty == DIFF_EASY:\n\t\tif layerCount == 2:\n\t\t\treturn BLOCK_WILD\n\n\tif difficulty == DIFF_MEDIUM:\n\t\tif layerCount == 2:\n\t\t\tif pos.y == layer || pos.y == -layer:\n\t\t\t\treturn BLOCK_WILD\n\n\tif difficulty == DIFF_HARD:\n\t\tif layerCount == 1:\n\t\t\tif pos.y == 0:\n\t\t\t\treturn BLOCK_WILD\n\n\t# Otherwise it's a normal block.\n\treturn BLOCK_PAIR\n\n# Generates a solveable puzzle.\nfunc generatePuzzle( layers, difficulty ):\n\tvar blockID = 0\n\tvar puzzle = Puzzle.new()\n\tpuzzle.puzzleName = \"RANDOM PUZZLE\"\n\tpuzzle.puzzleLayers = layers\n\n\t# Create all possible positions.\n\tvar layeredblocks = []\n\tfor l in range( 0, layers + 1 ):\n\t\tlayeredblocks.append( [] )\n\t\tpuzzle.pairCount.append( 0 )\n\tfor x in range( -layers, layers + 1 ):\n\t\tfor y in range( -layers, layers + 1 ):\n\t\t\tfor z in range( -layers, layers + 1 ):\n\t\t\t\tlayeredblocks[calcBlockLayer( x, y, z )].append(Vector3(x,y,z))\n\t\t\t\tshape[Vector3(x,y,z)] = null\n\n\t# Generate laser lines.\n\tfor l in range( 1, layers + 1 ):\n\t\tif difficulty == DIFF_MEDIUM or difficulty == DIFF_EASY:\n\t\t\tfor lx in [ -l, l ]:\n\t\t\t\tfor ly in [ -l, l ]:\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, ly, lx ), Vector3( lx*-1, ly, lx )] )\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, ly, lx ), Vector3( lx, ly, lx*-1 )] )\n\n\t\tif difficulty == DIFF_EASY:\n\t\t\tfor lx in [ -l, l ]:\n\t\t\t\tfor lz in [ -l, l ]:\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, l, lz ), Vector3( lx, -l, lz )] )\n\n\t\tif difficulty == DIFF_HARD:\n\t\t\tfor lx in [ -l, l ]:\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, 0, lx ), Vector3( lx*-1, 0, lx )] )\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, 0, lx ), Vector3( lx, 0, lx*-1 )] )\n\n\t# Assign block types based on position.\n\tfor l in range( 0, layers + 1 ):\n\t\t# Randomize the pairs.\n\t\tshuffleArray( layeredblocks[l] )\n\t\t# print( \"NUM \", layeredblocks[l].size() )\n\t\tvar prevBlock = null\n\t\tvar even = false\n\t\tfor pos in layeredblocks[l]:\n\t\t\tvar x = pos.x\n\t\t\tvar y = pos.y\n\t\t\tvar z = pos.z\n\n\t\t\tvar t = getBlockType( difficulty, pos )\n\n\t\t\tif t == BLOCK_GOAL:\n\t\t\t\tcontinue\n\n\t\t\tvar b = PickledBlock.new()\n\t\t\tb.blockPos = pos\n\t\t\tb.name = blockID\n\n\t\t\tblockID += 1\n\t\t\tpuzzle.blocks.append( b )\n\n\t\t\tif t == BLOCK_LASER:\n\t\t\t\tb.setBlockClass(BLOCK_LASER)\\\n\t\t\t\t\t.setLaserExtent( Vector3( 0, 1, 0 ) )\n\t\t\t\tcontinue\n\n\t\t\tif t == BLOCK_WILD:\n\t\t\t\tb.setBlockClass(BLOCK_WILD) \\\n\t\t\t\t\t.setTextureName(blockColors[randi() % blockColors.size()])\n\t\t\t\tcontinue\n\n\t\t\tif even:\n\t\t\t\t# Count this pair.\n\t\t\t\tpuzzle.pairCount[l] += 1\n\n\t\t\t\tvar randColor = blockColors[randi() % blockColors.size()]\n\t\t\t\tb.setBlockClass(BLOCK_PAIR) \\\n\t\t\t\t\t.setPairName(prevBlock.name) \\\n\t\t\t\t\t.setTextureName(randColor)\n\n\t\t\t\tprevBlock.setBlockClass(BLOCK_PAIR) \\\n\t\t\t\t\t.setPairName(b.name) \\\n\t\t\t\t\t.setTextureName(randColor)\n\t\t\teven = not even\n\t\t\tprevBlock = b\n\n\treturn puzzle\n\n# Storage class for blocks in a puzzle.\nclass PickledBlock:\n\tvar name\n\tvar blockClass = BLOCK_PAIR\n\tvar pairName\n\tvar textureName = \"Red\"\n\tvar blockPos\n\tvar laserExtent\n\tvar solverFlag\t\t# Keeps track of this block, only user for the solver.\n\n\tfunc setName(n):\n\t\tname = n\n\t\treturn self\n\n\tfunc setPairName(n):\n\t\tpairName = n\n\t\treturn self\n\n\tfunc setLaserExtent(n):\n\t\tlaserExtent = n\n\t\treturn self\n\n\tfunc setBlockPos(n):\n\t\tblockPos = n\n\t\treturn self\n\n\tfunc setBlockClass(c):\n\t\tblockClass = c\n\t\treturn self\n\n\tfunc setTextureName(t):\n\t\ttextureName = t\n\t\treturn self\n\n\tfunc toString():\n\t\treturn str(name) + \": \" + str(blockClass) + \" @ \" + str(blockPos)\n\n\tfunc toNode():\n\t\t# instantiate a block scene, assign the appropriate script to it\n\t\tvar n = blockScn.instance()\n\t\tn.set_script(blockScripts[blockClass])\n\n\t\tn.set_translation(blockPos * 2)\n\t\tn.blockPos = blockPos\n\n\t\tn.setName(str(name)).setTexture()\n\n\t\tn.setBlockType( blockClass )\n\n\t\tif blockClass == BLOCK_PAIR:\n\t\t\tn.setPairName(pairName).setTexture(textureName)\n\n\t\tif blockClass == BLOCK_WILD:\n\t\t\tn.setTexture(textureName)\n\n\t\tif blockClass == BLOCK_LASER:\n\t\t\tn.setPairName(pairName).setExtent(laserExtent)\n\t\treturn n\n\n\t# test me plz\n\tfunc fromNode(n):\n\t\tblockPos = n.blockPos\n\n\t\tname = n.name_int\n\n\t\tblockClass = n.getBlockType()\n\n\t\tif blockClass == BLOCK_PAIR:\n\t\t\tpairName = n.pairName\n\t\t\ttextureName = n.textureName\n\n\t\tif blockClass == BLOCK_WILD:\n\t\t\ttextureName = n.textureName\n\n\t\tif blockClass == BLOCK_LASER:\n\t\t\tpairName = n.pairName\n\n\t# Convert this object to a dictionary.\n\tfunc toDict():\n\t\tvar di = { n = name\n\t\t \t , bC = blockClass\n\t\t\t , pN = pairName\n\t\t\t , tN = textureName\n\t\t\t , bP = blockPos\n\t\t\t , lE = laserExtent\n\t\t\t }\n\t\treturn di\n\n\t# Make this object from a dictionary.\n\tfunc fromDict( di ):\n\t\tname = di.n\n\t\tblockClass = di.bC\n\t\tpairName = di.pN\n\t\ttextureName = di.tN\n\t\tblockPos = di.bP\n\t\tlaserExtent = di.lE\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"ec272038738d9549435a1ccf4546bf5e1fc70ba7","subject":"Clean up comments for DataManager","message":"Clean up comments for DataManager\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/DataManager.gd","new_file":"src\/scripts\/DataManager.gd","new_contents":"var PuzzleManScript = preload( \"res:\/\/scripts\/PuzzleManager.gd\" )\n\n# Saves the config settings to a file.\nfunc saveConfig( config ):\n\tvar file = File.new()\n\tfile.open( \"config.cfg\", File.WRITE )\n\t\n\tif file.is_open():\n\t\tfile.store_var( config.name )\n\t\tfile.store_var( config.soundvolume )\n\t\tfile.store_var( config.musicvolume )\n\t\tfile.store_var( config.portnumber )\n\t\tfile.close()\n\n# Loads the config settings from a file.\nfunc loadConfig():\n\tvar file = File.new()\n\tfile.open( \"config.cfg\", File.READ )\n\t\n\tvar config = {}\n\t\n\tif file.is_open():\n\t\tconfig.name = file.get_var()\n\t\tconfig.soundvolume = file.get_var()\n\t\tconfig.musicvolume = file.get_var()\n\t\tconfig.portnumber = file.get_var()\n\t\tfile.close()\n\t\t\n\treturn config\n\n# Saves a puzzle to the file given.\nfunc savePuzzle( name, puzzle ):\n\tprint( puzzle.puzzleName )\n\tvar file = File.new()\n\tfile.open( name, File.WRITE )\n\t\n\tvar di = puzzle.toDict()\n\t\n\tif file.is_open():\n\t\tfile.store_var( di )\n\t\tfile.close()\n\n# Loads a puzzle for the file given.\nfunc loadPuzzle( name ):\n\tvar file = File.new()\n\tvar puzzleMan = PuzzleManScript.new()\n\tvar puzzle = puzzleMan.Puzzle.new()\n\tpuzzle.puzzleMan = puzzleMan\n\tfile.open( name, File.READ )\n\t\n\tif file.is_open():\n\t\tpuzzle.fromDict( file.get_var() )\n\t\tfile.close()\n\t\n\treturn puzzle","old_contents":"var PuzzleManScript = preload( \"res:\/\/scripts\/PuzzleManager.gd\" )\n\n# Saves the config settings to a file.\nfunc saveConfig( config ):\n\tvar file = File.new()\n\tfile.open( \"config.cfg\", File.WRITE )\n\t\n\tif file.is_open():\n\t\tfile.store_var( config.name )\n\t\tfile.store_var( config.soundvolume )\n\t\tfile.store_var( config.musicvolume )\n\t\tfile.store_var( config.portnumber )\n\t\tfile.close()\n\n# Loads the config settings from a file.\nfunc loadConfig():\n\tvar file = File.new()\n\tfile.open( \"config.cfg\", File.READ )\n\t\n\tvar config = {}\n\t\n\tif file.is_open():\n\t\tconfig.name = file.get_var()\n\t\tconfig.soundvolume = file.get_var()\n\t\tconfig.musicvolume = file.get_var()\n\t\tconfig.portnumber = file.get_var()\n\t\tfile.close()\n\t\t\n\treturn config\n\t\n# Serializes the puzzle into a dictionary.\n#function serializePuzzle():\n\n\n# Deserializes the puzzle from a dictionary.\n#function deserializePuzzle():\n\n\n# Saves a puzzle to the file given.\nfunc savePuzzle( name, puzzle ):\n\tprint( puzzle.puzzleName )\n\tvar file = File.new()\n\tfile.open( name, File.WRITE )\n\t\n\tvar di = puzzle.toDict()\n\t\n\tif file.is_open():\n\t\tfile.store_var( di )\n\t\t#file.store_var( puzzle.puzzleName )\n\t\t#file.store_var( puzzle.puzzleLayers )\n\t\t#file.store_var( puzzle.blocks.size() )\n\t\t#for b in range( puzzle.blocks.size() ):\n\t\t#\tfile.store_var( puzzle.blocks[b].toDict() )\n\t\tfile.close()\n\n# Loads a puzzle for the file given.\nfunc loadPuzzle( name ):\n\tvar file = File.new()\n\tvar puzzleMan = PuzzleManScript.new()\n\tvar puzzle = puzzleMan.Puzzle.new()\n\tpuzzle.puzzleMan = puzzleMan\n\tfile.open( name, File.READ )\n\t\n\tif file.is_open():\n\t\tpuzzle.fromDict( file.get_var() )\n\t\t#puzzle.puzzleName = file.get_var()\n\t\t#puzzle.puzzleLayers = file.get_var()\n\t\t#var blockNum = file.get_var()\n\t\t#for b in range( blockNum ):\n\t\t#\tvar b = puzzleMan.PickledBlock.new()\n\t\t#\tb.fromDict( file.get_var() )\n\t\t#\tpuzzle.blocks.append( b )\n\t\tfile.close()\n\t\n\treturn puzzle","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"7ff2b37826b2d3c0ff3c393fd287f976b52df4e9","subject":"Added door to cheese room","message":"Added door to cheese room\n","repos":"P1X-in\/rat-is-fat","old_file":"scripts\/map\/rooms\/easy3_room.gd","new_file":"scripts\/map\/rooms\/easy3_room.gd","new_contents":"extends \"res:\/\/scripts\/map\/rooms\/abstract_room.gd\"\n\nfunc _init():\n self.room = [\n [ 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6],\n [ 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9],\n [ 7, 0, 0, 15, 10, 10, 10, 10, 10, 10, 10, 10, 10, 16, 0, 0, 9],\n [ 7, 0, 0, 9, 4, 5, 5, 5, 5, 5, 5, 5, 6, 7, 0, 0, 9],\n [ 7, 0, 0, 9, 7, 0, 0, 0, 0, 0, 0, 0, 9, 7, 0, 0, 9],\n [ 7, 0, 0, 9, 7, 0, 0, 0, 0, 0, 0, 0, 9, 7, 0, 0, 9],\n [ 7, 0, 0, 9, 7, 0, 0, 0, 0, 0, 0, 0, 9, 7, 0, 0, 9],\n [ 7, 0, 0, 9, 12, 10, 10, 26, 27, 28, 10, 10, 11, 7, 0, 0, 9],\n [ 7, 0, 0, 13, 5, 5, 5, 21, 19, 20, 5, 5, 5, 14, 0, 0, 9],\n [ 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9],\n [12, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11],\n ]\n\n self.enemies = [\n [3, 3, null, 1],\n [14, 3, null, 1],\n [3, 8, null, 1],\n [14, 8, null, 1],\n ]\n\n self.items = [\n [7, 5, 'cheese']\n ]\n\n self.doors = [\n [7, 7, 'south'],\n [7, 8, 'north']\n ]","old_contents":"extends \"res:\/\/scripts\/map\/rooms\/abstract_room.gd\"\n\nfunc _init():\n self.room = [\n [ 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6],\n [ 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9],\n [ 7, 0, 0, 15, 10, 10, 10, 10, 10, 10, 10, 10, 10, 16, 0, 0, 9],\n [ 7, 0, 0, 9, 4, 5, 5, 5, 5, 5, 5, 5, 6, 7, 0, 0, 9],\n [ 7, 0, 0, 9, 7, 0, 0, 0, 0, 0, 0, 0, 9, 7, 0, 0, 9],\n [ 7, 0, 0, 9, 7, 0, 0, 0, 0, 0, 0, 0, 9, 7, 0, 0, 9],\n [ 7, 0, 0, 9, 7, 0, 0, 0, 0, 0, 0, 0, 9, 7, 0, 0, 9],\n [ 7, 0, 0, 9, 12, 10, 10, 10, 10, 10, 10, 10, 11, 7, 0, 0, 9],\n [ 7, 0, 0, 13, 5, 5, 5, 5, 5, 5, 5, 5, 5, 14, 0, 0, 9],\n [ 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9],\n [12, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11],\n ]\n\n self.enemies = [\n [3, 3, null, 1],\n [14, 3, null, 1],\n [3, 8, null, 1],\n [14, 8, null, 1],\n ]\n\n self.items = [\n [7, 5, 'cheese']\n ]","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"df98b04a4ebff25e62be66d3e1f3c0f5caae6126","subject":"fix nil value on path","message":"fix nil value on path","repos":"marcosbitetti\/Godot-Websocket","old_file":"websocket.gd","new_file":"websocket.gd","new_contents":"\nextends StreamPeerTCP\n\nconst MAGIC_STRING = \"258EAFA5-E914-47DA-95CA-C5AB0DC85B11\"\nconst USER_AGENT = \"Godot-client\"\n\n\nconst MESSAGE_RECIEVED = \"msg_recieved\"\nconst BINARY_RECIEVED = \"binary_recieved\"\n\nvar thread = Thread.new()\nvar host = '127.0.0.1'\nvar host_only = host\nvar path = null\nvar port = 80\nvar TIMEOUT = 30\nvar error = ''\nvar messages = []\nvar reciever = null\nvar reciever_f = null\nvar reciever_binary = null\nvar reciever_binary_f = null\n\nvar close_listener = Node.new()\nvar dispatcher = Reference.new()\n\nfunc _run(_self):\n\t###\n\t# Handshake\n\t###\n\tvar tm = 0.0\n\t\n\t# connect\n\twhile true:\n\t\tif get_status()==STATUS_ERROR:\n\t\t\terror = 'Connection fail'\n\t\t\treturn\n\t\tif get_status()==STATUS_CONNECTED:\n\t\t\tbreak\n\t\ttm += 0.1\n\t\tif tm>TIMEOUT:\n\t\t\terror = 'Connection timeout'\n\t\t\treturn\n\t\tOS.delay_msec(100)\n\t\n\tvar _host = self.host\n\tif self.port != 80:\n\t\t_host += ':' + str(self.port)\n\tvar header = ''\n\tvar data = ''\n\t\n\t\n\theader = \"GET \/\"+self.path+\" HTTP\/1.1\\r\\n\"\n\theader += \"Host: \"+self.host_only+\"\\r\\n\"\n\theader += \"Connection: Upgrade\\r\\n\"\n\theader += \"Pragma: no-cache\\r\\n\"\n\theader += \"Cache-Control: no-cache\\r\\n\"\n\theader += \"Upgrade: websocket\\r\\n\"\n\t#header += \"Origin: http:\/\/127.0.0.1:3001\\r\\n\"\n\theader += \"Sec-WebSocket-Version: 13\\r\\n\"\n\theader += \"User-Agent: \"+USER_AGENT+\"\\r\\n\"\n\theader += \"Accept-Encoding: gzip, deflate, sdch\\r\\n\"\n\theader += \"Accept-Language: \"+str(OS.get_locale())+\";q=0.8,en-US;q=0.6,en;q=0.4\\r\\n\"\n\t#header += \"Sec-WebSocket-Key: \"+send_secure+\"\\r\\n\"\n\theader += \"Sec-WebSocket-Key: 6Aw8vTgcG5EvXdQywVvbh_3fMxvd4Q7dcL2caAHAFjV\\r\\n\"\n\theader += \"Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits\\r\\n\"\n\theader += \"\\r\\n\"\n\t#print(header)\n\t\n\tif OK!=put_data( header.to_ascii() ):\n\t\tprint('error sending handshake headers')\n\t\treturn\n\n\tdata = ''\n\ttm = 0.0\n\tvar start_read = false\n\twhile true:\n\t\tif get_available_bytes()>0 and not start_read:\n\t\t\tdata += get_string(get_available_bytes())\n\t\t\tstart_read = true\n\t\telif get_available_bytes()==0 and start_read:\n\t\t\tbreak\n\t\t\n\t\tOS.delay_msec(100)\n\t\ttm += 0.1\n\t\tif tm>TIMEOUT:\n\t\t\tprint('timeout')\n\t\t\treturn\n\t#print(data)\n\n\tvar connection_ok = false\n\tfor lin in data.split(\"\\n\"):\n\t\tif lin.find(\"HTTP\/1.1 101\")>-1:\n\t\t\tconnection_ok = true\n\t\t# other headers can by cheched here\n\t\n\tif not connection_ok:\n\t\t#print(data)\n\t\tprint(\"Not connection ok\")\n\t\treturn\n\t\n\tdata = ''\n\tvar is_reading_frame = false\n\tvar size = 0\n\tvar byte = 0\n\tvar fin = 0\n\tvar opcode = 0\n\twhile is_connected():\n\t\tif get_available_bytes()>0:\n\t\t\tif not is_reading_frame:\n\t\t\t\t# frame\n\t\t\t\tbyte = get_8()\n\t\t\t\tfin = byte & 0x80\n\t\t\t\topcode = byte & 0x0F\n\t\t\t\tbyte = get_8()\n\t\t\t\tvar mskd = byte & 0x80\n\t\t\t\tvar payload = byte & 0x7F\n\t\t\t\t#printt('length', get_available_bytes())\n\t\t\t\t#printt(fin,mskd,opcode,payload)\n\t\t\t\t#if fin:\n\t\t\t\t#data += get_string(get_available_bytes())\n\t\t\t\tif payload<126:\n\t\t\t\t\t# size of data = payload\n\t\t\t\t\tdata += get_string(payload)\n\t\t\t\t\tif fin:\n\t\t\t\t\t\tif reciever:\n\t\t\t\t\t\t\tdispatcher.emit_signal(MESSAGE_RECIEVED, data)\n\t\t\t\t\t\tdata = ''\n\t\t\t\telse:\n\t\t\t\t\tsize = 0\n\t\t\t\t\tif payload==126:\n\t\t\t\t\t\t# 16-bit size\n\t\t\t\t\t\tsize = get_u16()\n\t\t\t\t\t\t#printt(size,'of data')\n\t\t\t\t\tif get_available_bytes()0:\n\t\t\tvar msg = messages[0]\n\t\t\tmessages.pop_front()\n\t\t\t\n\t\t\t# mount frame\n\t\t\tvar byte = 0x80 # fin\n\t\t\tbyte = byte | 0x01 # text frame\n\t\t\tput_8(byte)\n\t\t\tbyte = 0x80 | msg.length() # mask flag and payload size\n\t\t\tput_u8(byte)\n\t\t\tbyte = randi() # mask 32 bit int\n\t\t\tput_32(byte)\n\t\t\tvar masked = _mask(byte,msg)\n\t\t\tfor i in range(masked.size()):\n\t\t\t\tput_u8(masked[i])\n\t\t\tprint(msg+\" sent\")\n\t\t\t\n\t\tOS.delay_msec(3)\n\t\n\nfunc send(msg):\n\tmessages.append(msg)\n\n\nfunc start(host,port,path=null):\n\tself.host_only = host\n\tif path == null:\n\t\tself.host = host\n\t\tpath = ''\n\telse:\n\t\tself.host = host+\"\/\"+path\n\tself.path = path\n\tself.port = port\n\tset_big_endian(true)\n\tprint(IP.get_local_addresses())\n\tif OK==connect(IP.resolve_hostname(host),port):\n\t\tthread.start(self,'_run', self)\n\telse:\n\t\tprint('no')\n\nfunc set_reciever(o,f):\n\tif reciever:\n\t\tunset_reciever()\n\treciever = o\n\treciever_f = f\n\tdispatcher.connect( MESSAGE_RECIEVED, reciever, reciever_f)\n\nfunc set_binary_reciever(o,f):\n\tif reciever_binary:\n\t\tunset_binary_reciever()\n\treciever_binary = o\n\treciever_binary_f = f\n\tdispatcher.connect( MESSAGE_RECIEVED, reciever_binary, reciever_binary_f)\n\nfunc unset_reciever():\n\tdispatcher.disconnect( MESSAGE_RECIEVED, reciever, reciever_f)\n\treciever = null\n\treciever_f = null\n\nfunc unset_binary_reciever():\n\tdispatcher.disconnect( MESSAGE_RECIEVED, reciever_binary, reciever_binary_f)\n\treciever_binary = null\n\treciever_binary_f = null\n\t\nfunc _init(reference).():\n\tdispatcher.add_user_signal(MESSAGE_RECIEVED)\n\tdispatcher.add_user_signal(BINARY_RECIEVED)\n\nfunc _mask(_m, _d):\n\t_m = int_to_hex(_m)\n\t_d=_d.to_utf8()\n\tvar ret = []\n\tfor i in range(_d.size()):\n\t\tret.append(_d[i] ^ _m[i % 4])\n\treturn ret\n\nfunc int_to_hex(n):\n\tn = var2bytes(n)\n\tn.invert()\n\tn.resize(n.size()-4)\n\treturn n\n","old_contents":"\nextends StreamPeerTCP\n\nconst MAGIC_STRING = \"258EAFA5-E914-47DA-95CA-C5AB0DC85B11\"\nconst USER_AGENT = \"Godot-client\"\n\n\nconst MESSAGE_RECIEVED = \"msg_recieved\"\nconst BINARY_RECIEVED = \"binary_recieved\"\n\nvar thread = Thread.new()\nvar host = '127.0.0.1'\nvar host_only = host\nvar path = null\nvar port = 80\nvar TIMEOUT = 30\nvar error = ''\nvar messages = []\nvar reciever = null\nvar reciever_f = null\nvar reciever_binary = null\nvar reciever_binary_f = null\n\nvar close_listener = Node.new()\nvar dispatcher = Reference.new()\n\nfunc _run(_self):\n\t###\n\t# Handshake\n\t###\n\tvar tm = 0.0\n\t\n\t# connect\n\twhile true:\n\t\tif get_status()==STATUS_ERROR:\n\t\t\terror = 'Connection fail'\n\t\t\treturn\n\t\tif get_status()==STATUS_CONNECTED:\n\t\t\tbreak\n\t\ttm += 0.1\n\t\tif tm>TIMEOUT:\n\t\t\terror = 'Connection timeout'\n\t\t\treturn\n\t\tOS.delay_msec(100)\n\t\n\tvar _host = self.host\n\tif self.port != 80:\n\t\t_host += ':' + str(self.port)\n\tvar header = ''\n\tvar data = ''\n\t\n\t\n\theader = \"GET \/\"+self.path+\" HTTP\/1.1\\r\\n\"\n\theader += \"Host: \"+self.host_only+\"\\r\\n\"\n\theader += \"Connection: Upgrade\\r\\n\"\n\theader += \"Pragma: no-cache\\r\\n\"\n\theader += \"Cache-Control: no-cache\\r\\n\"\n\theader += \"Upgrade: websocket\\r\\n\"\n\t#header += \"Origin: http:\/\/127.0.0.1:3001\\r\\n\"\n\theader += \"Sec-WebSocket-Version: 13\\r\\n\"\n\theader += \"User-Agent: \"+USER_AGENT+\"\\r\\n\"\n\theader += \"Accept-Encoding: gzip, deflate, sdch\\r\\n\"\n\theader += \"Accept-Language: \"+str(OS.get_locale())+\";q=0.8,en-US;q=0.6,en;q=0.4\\r\\n\"\n\t#header += \"Sec-WebSocket-Key: \"+send_secure+\"\\r\\n\"\n\theader += \"Sec-WebSocket-Key: 6Aw8vTgcG5EvXdQywVvbh_3fMxvd4Q7dcL2caAHAFjV\\r\\n\"\n\theader += \"Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits\\r\\n\"\n\theader += \"\\r\\n\"\n\t#print(header)\n\t\n\tif OK!=put_data( header.to_ascii() ):\n\t\tprint('error sending handshake headers')\n\t\treturn\n\n\tdata = ''\n\ttm = 0.0\n\tvar start_read = false\n\twhile true:\n\t\tif get_available_bytes()>0 and not start_read:\n\t\t\tdata += get_string(get_available_bytes())\n\t\t\tstart_read = true\n\t\telif get_available_bytes()==0 and start_read:\n\t\t\tbreak\n\t\t\n\t\tOS.delay_msec(100)\n\t\ttm += 0.1\n\t\tif tm>TIMEOUT:\n\t\t\tprint('timeout')\n\t\t\treturn\n\t#print(data)\n\n\tvar connection_ok = false\n\tfor lin in data.split(\"\\n\"):\n\t\tif lin.find(\"HTTP\/1.1 101\")>-1:\n\t\t\tconnection_ok = true\n\t\t# other headers can by cheched here\n\t\n\tif not connection_ok:\n\t\t#print(data)\n\t\tprint(\"Not connection ok\")\n\t\treturn\n\t\n\tdata = ''\n\tvar is_reading_frame = false\n\tvar size = 0\n\tvar byte = 0\n\tvar fin = 0\n\tvar opcode = 0\n\twhile is_connected():\n\t\tif get_available_bytes()>0:\n\t\t\tif not is_reading_frame:\n\t\t\t\t# frame\n\t\t\t\tbyte = get_8()\n\t\t\t\tfin = byte & 0x80\n\t\t\t\topcode = byte & 0x0F\n\t\t\t\tbyte = get_8()\n\t\t\t\tvar mskd = byte & 0x80\n\t\t\t\tvar payload = byte & 0x7F\n\t\t\t\t#printt('length', get_available_bytes())\n\t\t\t\t#printt(fin,mskd,opcode,payload)\n\t\t\t\t#if fin:\n\t\t\t\t#data += get_string(get_available_bytes())\n\t\t\t\tif payload<126:\n\t\t\t\t\t# size of data = payload\n\t\t\t\t\tdata += get_string(payload)\n\t\t\t\t\tif fin:\n\t\t\t\t\t\tif reciever:\n\t\t\t\t\t\t\tdispatcher.emit_signal(MESSAGE_RECIEVED, data)\n\t\t\t\t\t\tdata = ''\n\t\t\t\telse:\n\t\t\t\t\tsize = 0\n\t\t\t\t\tif payload==126:\n\t\t\t\t\t\t# 16-bit size\n\t\t\t\t\t\tsize = get_u16()\n\t\t\t\t\t\t#printt(size,'of data')\n\t\t\t\t\tif get_available_bytes()0:\n\t\t\tvar msg = messages[0]\n\t\t\tmessages.pop_front()\n\t\t\t\n\t\t\t# mount frame\n\t\t\tvar byte = 0x80 # fin\n\t\t\tbyte = byte | 0x01 # text frame\n\t\t\tput_8(byte)\n\t\t\tbyte = 0x80 | msg.length() # mask flag and payload size\n\t\t\tput_u8(byte)\n\t\t\tbyte = randi() # mask 32 bit int\n\t\t\tput_32(byte)\n\t\t\tvar masked = _mask(byte,msg)\n\t\t\tfor i in range(masked.size()):\n\t\t\t\tput_u8(masked[i])\n\t\t\tprint(msg+\" sent\")\n\t\t\t\n\t\tOS.delay_msec(3)\n\t\n\nfunc send(msg):\n\tmessages.append(msg)\n\n\nfunc start(host,port,path=null):\n\tself.host_only = host\n\tif path == null:\n\t\tself.host = host\n\telse:\n\t\tself.host = host+\"\/\"+path\n\tself.path = path\n\tself.port = port\n\tset_big_endian(true)\n\tprint(IP.get_local_addresses())\n\tif OK==connect(IP.resolve_hostname(host),port):\n\t\tthread.start(self,'_run', self)\n\telse:\n\t\tprint('no')\n\nfunc set_reciever(o,f):\n\tif reciever:\n\t\tunset_reciever()\n\treciever = o\n\treciever_f = f\n\tdispatcher.connect( MESSAGE_RECIEVED, reciever, reciever_f)\n\nfunc set_binary_reciever(o,f):\n\tif reciever_binary:\n\t\tunset_binary_reciever()\n\treciever_binary = o\n\treciever_binary_f = f\n\tdispatcher.connect( MESSAGE_RECIEVED, reciever_binary, reciever_binary_f)\n\nfunc unset_reciever():\n\tdispatcher.disconnect( MESSAGE_RECIEVED, reciever, reciever_f)\n\treciever = null\n\treciever_f = null\n\nfunc unset_binary_reciever():\n\tdispatcher.disconnect( MESSAGE_RECIEVED, reciever_binary, reciever_binary_f)\n\treciever_binary = null\n\treciever_binary_f = null\n\t\nfunc _init(reference).():\n\tdispatcher.add_user_signal(MESSAGE_RECIEVED)\n\tdispatcher.add_user_signal(BINARY_RECIEVED)\n\nfunc _mask(_m, _d):\n\t_m = int_to_hex(_m)\n\t_d=_d.to_utf8()\n\tvar ret = []\n\tfor i in range(_d.size()):\n\t\tret.append(_d[i] ^ _m[i % 4])\n\treturn ret\n\nfunc int_to_hex(n):\n\tn = var2bytes(n)\n\tn.invert()\n\tn.resize(n.size()-4)\n\treturn n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"f91f3e852b088146f6859a6456b378ada2ce1fb0","subject":"Fixed spawn item position to avoid overlap to each other.","message":"Fixed spawn item position to avoid overlap to each other.\n","repos":"CSaratakij\/jam-2016-remake","old_file":"src\/spawner\/item_spawner.gd","new_file":"src\/spawner\/item_spawner.gd","new_contents":"\nextends Node2D\n\nconst MAX_ITEMS_PER_FLOOR = 4\nconst ITEM_MARGIN = Vector2(30, 0)\nconst STEP = Vector2(100, 0)\nconst ITEMS = [\n\tpreload(\"res:\/\/health\/health.tscn\"),\n\tpreload(\"res:\/\/mask\/mask.tscn\")\n]\n\nvar healths = []\nvar masks = []\nvar spawned_list = []\n\nonready var start_point = get_node(\"start_point\")\nonready var end_point = get_node(\"end_point\")\n\nfunc _ready():\n\tvar health = ITEMS[0].instance()\n\tvar mask = ITEMS[1].instance()\n\tfor index in range(MAX_ITEMS_PER_FLOOR):\n\t\thealths.append(health.duplicate())\n\t\tmasks.append(mask.duplicate())\n\t\tadd_child(healths[ index ])\n\t\tadd_child(masks[ index ])\n\nfunc spawn():\n\trandomize()\n\tvar total_spawn = int(rand_range(0, MAX_ITEMS_PER_FLOOR + 1))\n\tif total_spawn > 0:\n\t\tfor index in range(total_spawn):\n\t\t\tvar random_item_id = int(rand_range(0, ITEMS.size()))\n\t\t\tif random_item_id == 0:\n\t\t\t\tspawned_list.append(healths[ random_item_id ])\n\t\t\telif random_item_id == 1:\n\t\t\t\tvar random_mask_id = int(rand_range(0, 2))\n\t\t\t\tmasks[ index ].set_type(random_mask_id)\n\t\t\t\tspawned_list.append(masks[ index ])\n\t\tvar start_spawn_point = start_point.get_global_pos()\n\t\tvar interval = Vector2(abs(start_point.get_global_pos().x - end_point.get_global_pos().x), start_point.get_global_pos().y)\n\t\tvar next_point = start_spawn_point + interval\n\t\tfor item in spawned_list:\n\t\t\tvar spawn_point = Vector2(rand_range(start_spawn_point.x, next_point.x + 1), start_spawn_point.y)\n\t\t\tstart_spawn_point += ITEM_MARGIN\n\t\t\tnext_point = start_spawn_point + interval\n\t\t\titem.set_global_pos(spawn_point)\n\t\t\titem.show()\n\nfunc reset():\n\tfor item in spawned_list:\n\t\titem.hide()\n\t\titem.set_global_pos(get_global_pos())\n\tspawned_list.clear()","old_contents":"\nextends Node2D\n\nconst MAX_ITEMS_PER_FLOOR = 4\nconst STEP = Vector2(100, 0)\nconst ITEMS = [\n\tpreload(\"res:\/\/health\/health.tscn\"),\n\tpreload(\"res:\/\/mask\/mask.tscn\")\n]\n\nvar healths = []\nvar masks = []\nvar spawned_list = []\n\nonready var start_point = get_node(\"start_point\")\nonready var end_point = get_node(\"end_point\")\n\nfunc _ready():\n\tvar health = ITEMS[0].instance()\n\tvar mask = ITEMS[1].instance()\n\tfor index in range(MAX_ITEMS_PER_FLOOR):\n\t\thealths.append(health.duplicate())\n\t\tmasks.append(mask.duplicate())\n\t\tadd_child(healths[ index ])\n\t\tadd_child(masks[ index ])\n\nfunc spawn():\n\trandomize()\n\tvar total_spawn = int(rand_range(0, MAX_ITEMS_PER_FLOOR + 1))\n\tfor index in range(total_spawn):\n\t\tvar random_item_id = int(rand_range(0, ITEMS.size()))\n\t\tif random_item_id == 0:\n\t\t\tspawned_list.append(healths[ random_item_id ])\n\t\telif random_item_id == 1:\n\t\t\tvar random_mask_id = int(rand_range(0, 2))\n\t\t\tmasks[ index ].set_type(random_mask_id)\n\t\t\tspawned_list.append(masks[ index ])\n\tfor item in spawned_list:\n\t\tvar spawn_point = Vector2(rand_range(start_point.get_global_pos().x, end_point.get_global_pos().x), start_point.get_global_pos().y)\n\t\titem.set_global_pos(spawn_point)\n\t\titem.show()\n\nfunc reset():\n\tfor item in spawned_list:\n\t\titem.hide()\n\t\titem.set_global_pos(get_global_pos())\n\tspawned_list.clear()","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"31e6c6ca8fa84ff5e2c7e007a68eae1a54115f26","subject":"Changed *_scene() to *_tree()","message":"Changed *_scene() to *_tree()\n\nChanged _enter_scene and _exit_scene() to _enter_tree() and _exit_tree() in the time-example, because the *_scene no longer work.","repos":"Brickcaster\/godot,xiaoyanit\/godot,OpenSocialGames\/godot,mrezai\/godot,pixelpicosean\/my-godot-2.1,blackwc\/godot,ficoos\/godot,supriyantomaftuh\/godot,FullMeta\/godot,vastcharade\/godot,gcbeyond\/godot,zj8487\/godot,RandomShaper\/godot,sanikoyes\/godot,mrezai\/godot,TheBoyThePlay\/godot,FullMeta\/godot,NateWardawg\/godot,jackmakesthings\/godot,sh95119\/godot,quabug\/godot,Brickcaster\/godot,didier-v\/godot,kimsunzun\/godot,cpascal\/godot,FullMeta\/godot,RandomShaper\/godot,a12n\/godot,kimsunzun\/godot,vnen\/godot,torgartor21\/godot,RandomShaper\/godot,HatiEth\/godot,karolgotowala\/godot,josempans\/godot,MrMaidx\/godot,sanikoyes\/godot,HatiEth\/godot,a12n\/godot,BastiaanOlij\/godot,n-pigeon\/godot,josempans\/godot,jackmakesthings\/godot,azurvii\/godot,gau-veldt\/godot,TheBoyThePlay\/godot,crr0004\/godot,pkowal1982\/godot,Faless\/godot,hitjim\/godot,Valentactive\/godot,firefly2442\/godot,pkowal1982\/godot,NateWardawg\/godot,mikica1986vee\/godot,ZuBsPaCe\/godot,mamarilmanson\/godot,marynate\/godot,vastcharade\/godot,BastiaanOlij\/godot,supriyantomaftuh\/godot,honix\/godot,HatiEth\/godot,rollenrolm\/godot,BogusCurry\/godot,serafinfernandez\/godot,marynate\/godot,didier-v\/godot,BogusCurry\/godot,Paulloz\/godot,zj8487\/godot,youprofit\/godot,MarianoGnu\/godot,TheBoyThePlay\/godot,BastiaanOlij\/godot,mcanders\/godot,jackmakesthings\/godot,karolgotowala\/godot,a12n\/godot,TheBoyThePlay\/godot,serafinfernandez\/godot,liuyucoder\/godot,serafinfernandez\/godot,mcanders\/godot,zicklag\/godot,RandomShaper\/godot,quabug\/godot,Zylann\/godot,torgartor21\/godot,RebelliousX\/Go_Dot,ficoos\/godot,est31\/godot,FateAce\/godot,HatiEth\/godot,jjdicharry\/godot,jackmakesthings\/godot,zj8487\/godot,OpenSocialGames\/godot,ex\/godot,agusbena\/godot,BoDonkey\/godot,godotengine\/godot,ianholing\/godot,groud\/godot,didier-v\/godot,mrezai\/godot,liuyucoder\/godot,supriyantomaftuh\/godot,FateAce\/godot,exabon\/godot,sergicollado\/godot,hipgraphics\/godot,Valentactive\/godot,teamblubee\/godot,lietu\/godot,mikica1986vee\/GodotArrayEditorStuff,azurvii\/godot,guilhermefelipecgs\/godot,Shockblast\/godot,Shockblast\/godot,torgartor21\/godot,Zylann\/godot,iap-mutant\/godot,OpenSocialGames\/godot,n-pigeon\/godot,TheHX\/godot,sanikoyes\/godot,Max-Might\/godot,ricpelo\/godot,ricpelo\/godot,marynate\/godot,gau-veldt\/godot,agusbena\/godot,JoshuaGrams\/godot,DStomtom\/godot,Paulloz\/godot,godotengine\/godot,BoDonkey\/godot,est31\/godot,crr0004\/godot,mikica1986vee\/GodotArrayEditorStuff,mikica1986vee\/godot,mamarilmanson\/godot,DStomtom\/godot,crr0004\/godot,MarianoGnu\/godot,Hodes\/godot,hipgraphics\/godot,RebelliousX\/Go_Dot,pixelpicosean\/my-godot-2.1,marynate\/godot,quabug\/godot,MrMaidx\/godot,ex\/godot,MrMaidx\/godot,youprofit\/godot,iap-mutant\/godot,Paulloz\/godot,FateAce\/godot,mrezai\/godot,ianholing\/godot,firefly2442\/godot,pixelpicosean\/my-godot-2.1,quabug\/godot,hitjim\/godot,Marqin\/godot,mcanders\/godot,blackwc\/godot,sh95119\/godot,Shockblast\/godot,Marqin\/godot,okamstudio\/godot,DStomtom\/godot,quabug\/godot,blackwc\/godot,crr0004\/godot,Valentactive\/godot,ZuBsPaCe\/godot,FullMeta\/godot,opmana\/godot,gau-veldt\/godot,ageazrael\/godot,xiaoyanit\/godot,rollenrolm\/godot,karolgotowala\/godot,xiaoyanit\/godot,DmitriySalnikov\/godot,mikica1986vee\/Godot_android_tegra_fallback,jackmakesthings\/godot,sanikoyes\/godot,dreamsxin\/godot,n-pigeon\/godot,vastcharade\/godot,firefly2442\/godot,cpascal\/godot,supriyantomaftuh\/godot,lietu\/godot,akien-mga\/godot,jjdicharry\/godot,HatiEth\/godot,Faless\/godot,dreamsxin\/godot,MarianoGnu\/godot,OpenSocialGames\/godot,sergicollado\/godot,DmitriySalnikov\/godot,godotengine\/godot,iap-mutant\/godot,NateWardawg\/godot,youprofit\/godot,ZuBsPaCe\/godot,a12n\/godot,firefly2442\/godot,sh95119\/godot,FateAce\/godot,vkbsb\/godot,liuyucoder\/godot,lietu\/godot,jjdicharry\/godot,serafinfernandez\/godot,jjdicharry\/godot,Marqin\/godot,cpascal\/godot,Shockblast\/godot,MarianoGnu\/godot,est31\/godot,hipgraphics\/godot,TheHX\/godot,mikica1986vee\/Godot_android_tegra_fallback,mikica1986vee\/Godot_android_tegra_fallback,Hodes\/godot,karolgotowala\/godot,shackra\/godot,Brickcaster\/godot,TheBoyThePlay\/godot,kimsunzun\/godot,Valentactive\/godot,ZuBsPaCe\/godot,kimsunzun\/godot,BogusCurry\/godot,hipgraphics\/godot,FullMeta\/godot,teamblubee\/godot,Max-Might\/godot,wardw\/godot,ianholing\/godot,torgartor21\/godot,FullMeta\/godot,BogusCurry\/godot,vastcharade\/godot,okamstudio\/godot,zicklag\/godot,didier-v\/godot,honix\/godot,sh95119\/godot,zj8487\/godot,BastiaanOlij\/godot,JoshuaGrams\/godot,Zylann\/godot,TheBoyThePlay\/godot,honix\/godot,TheBoyThePlay\/godot,Brickcaster\/godot,agusbena\/godot,quabug\/godot,tomreyn\/godot,lietu\/godot,liuyucoder\/godot,OpenSocialGames\/godot,dreamsxin\/godot,ageazrael\/godot,Marqin\/godot,ZuBsPaCe\/godot,iap-mutant\/godot,TheBoyThePlay\/godot,morrow1nd\/godot,NateWardawg\/godot,jejung\/godot,azurvii\/godot,NateWardawg\/godot,tomreyn\/godot,teamblubee\/godot,jjdicharry\/godot,ageazrael\/godot,pkowal1982\/godot,sanikoyes\/godot,teamblubee\/godot,dreamsxin\/godot,BoDonkey\/godot,agusbena\/godot,MarianoGnu\/godot,jejung\/godot,BoDonkey\/godot,huziyizero\/godot,vkbsb\/godot,youprofit\/godot,mikica1986vee\/godot,guilhermefelipecgs\/godot,TheBoyThePlay\/godot,huziyizero\/godot,MrMaidx\/godot,Brickcaster\/godot,marynate\/godot,liuyucoder\/godot,akien-mga\/godot,jejung\/godot,okamstudio\/godot,vastcharade\/godot,Faless\/godot,liuyucoder\/godot,honix\/godot,groud\/godot,iap-mutant\/godot,mikica1986vee\/GodotArrayEditorStuff,mikica1986vee\/Godot_android_tegra_fallback,Valentactive\/godot,gau-veldt\/godot,cpascal\/godot,marynate\/godot,DStomtom\/godot,kimsunzun\/godot,kimsunzun\/godot,NateWardawg\/godot,josempans\/godot,MarianoGnu\/godot,DmitriySalnikov\/godot,est31\/godot,sh95119\/godot,guilhermefelipecgs\/godot,crr0004\/godot,JoshuaGrams\/godot,cpascal\/godot,vkbsb\/godot,rollenrolm\/godot,zicklag\/godot,honix\/godot,JoshuaGrams\/godot,okamstudio\/godot,godotengine\/godot,josempans\/godot,MrMaidx\/godot,wardw\/godot,youprofit\/godot,exabon\/godot,Paulloz\/godot,BogusCurry\/godot,xiaoyanit\/godot,groud\/godot,zj8487\/godot,Paulloz\/godot,DStomtom\/godot,shackra\/godot,cpascal\/godot,Zylann\/godot,mikica1986vee\/godot,marynate\/godot,youprofit\/godot,mikica1986vee\/godot,marynate\/godot,zj8487\/godot,shackra\/godot,RebelliousX\/Go_Dot,morrow1nd\/godot,wardw\/godot,godotengine\/godot,cpascal\/godot,zj8487\/godot,Hodes\/godot,mcanders\/godot,blackwc\/godot,honix\/godot,youprofit\/godot,Marqin\/godot,liuyucoder\/godot,firefly2442\/godot,Max-Might\/godot,MarianoGnu\/godot,mikica1986vee\/GodotArrayEditorStuff,mrezai\/godot,youprofit\/godot,torgartor21\/godot,youprofit\/godot,guilhermefelipecgs\/godot,BogusCurry\/godot,mikica1986vee\/Godot_android_tegra_fallback,pixelpicosean\/my-godot-2.1,gcbeyond\/godot,mikica1986vee\/godot,a12n\/godot,mikica1986vee\/Godot_android_tegra_fallback,vkbsb\/godot,vnen\/godot,opmana\/godot,hitjim\/godot,lietu\/godot,ricpelo\/godot,ficoos\/godot,jejung\/godot,azurvii\/godot,wardw\/godot,teamblubee\/godot,BoDonkey\/godot,tomreyn\/godot,mikica1986vee\/godot,Faless\/godot,azurvii\/godot,Zylann\/godot,n-pigeon\/godot,buckle2000\/godot,agusbena\/godot,sh95119\/godot,torgartor21\/godot,OpenSocialGames\/godot,mikica1986vee\/godot,davidalpha\/godot,xiaoyanit\/godot,lietu\/godot,okamstudio\/godot,DmitriySalnikov\/godot,wardw\/godot,buckle2000\/godot,supriyantomaftuh\/godot,vastcharade\/godot,godotengine\/godot,teamblubee\/godot,blackwc\/godot,torgartor21\/godot,iap-mutant\/godot,iap-mutant\/godot,josempans\/godot,firefly2442\/godot,ianholing\/godot,HatiEth\/godot,Valentactive\/godot,TheHX\/godot,shackra\/godot,sergicollado\/godot,pkowal1982\/godot,RandomShaper\/godot,DmitriySalnikov\/godot,firefly2442\/godot,sh95119\/godot,godotengine\/godot,dreamsxin\/godot,DStomtom\/godot,buckle2000\/godot,Paulloz\/godot,FullMeta\/godot,gcbeyond\/godot,liuyucoder\/godot,wardw\/godot,serafinfernandez\/godot,gcbeyond\/godot,xiaoyanit\/godot,okamstudio\/godot,agusbena\/godot,crr0004\/godot,mikica1986vee\/GodotArrayEditorStuff,gcbeyond\/godot,didier-v\/godot,hitjim\/godot,mikica1986vee\/GodotArrayEditorStuff,karolgotowala\/godot,Shockblast\/godot,hitjim\/godot,BogusCurry\/godot,dreamsxin\/godot,shackra\/godot,buckle2000\/godot,OpenSocialGames\/godot,exabon\/godot,quabug\/godot,BogusCurry\/godot,davidalpha\/godot,Max-Might\/godot,wardw\/godot,HatiEth\/godot,akien-mga\/godot,hipgraphics\/godot,mamarilmanson\/godot,marynate\/godot,Hodes\/godot,mamarilmanson\/godot,mikica1986vee\/GodotArrayEditorStuff,morrow1nd\/godot,gcbeyond\/godot,torgartor21\/godot,gcbeyond\/godot,karolgotowala\/godot,JoshuaGrams\/godot,ianholing\/godot,ricpelo\/godot,hitjim\/godot,pkowal1982\/godot,quabug\/godot,cpascal\/godot,iap-mutant\/godot,HatiEth\/godot,n-pigeon\/godot,zicklag\/godot,zicklag\/godot,a12n\/godot,jjdicharry\/godot,lietu\/godot,mikica1986vee\/Godot_android_tegra_fallback,DStomtom\/godot,kimsunzun\/godot,shackra\/godot,DmitriySalnikov\/godot,hitjim\/godot,Faless\/godot,hipgraphics\/godot,guilhermefelipecgs\/godot,TheHX\/godot,karolgotowala\/godot,Zylann\/godot,okamstudio\/godot,crr0004\/godot,cpascal\/godot,hipgraphics\/godot,sergicollado\/godot,opmana\/godot,davidalpha\/godot,mikica1986vee\/Godot_android_tegra_fallback,ex\/godot,BoDonkey\/godot,zicklag\/godot,pkowal1982\/godot,blackwc\/godot,a12n\/godot,liuyucoder\/godot,OpenSocialGames\/godot,mrezai\/godot,Marqin\/godot,kimsunzun\/godot,sergicollado\/godot,sergicollado\/godot,jackmakesthings\/godot,Hodes\/godot,exabon\/godot,ficoos\/godot,davidalpha\/godot,mcanders\/godot,dreamsxin\/godot,OpenSocialGames\/godot,sh95119\/godot,akien-mga\/godot,ex\/godot,morrow1nd\/godot,Faless\/godot,blackwc\/godot,teamblubee\/godot,dreamsxin\/godot,DmitriySalnikov\/godot,xiaoyanit\/godot,morrow1nd\/godot,serafinfernandez\/godot,jackmakesthings\/godot,groud\/godot,davidalpha\/godot,supriyantomaftuh\/godot,torgartor21\/godot,ZuBsPaCe\/godot,mamarilmanson\/godot,kimsunzun\/godot,jjdicharry\/godot,ficoos\/godot,BoDonkey\/godot,jackmakesthings\/godot,mikica1986vee\/GodotArrayEditorStuff,vnen\/godot,TheHX\/godot,ficoos\/godot,DStomtom\/godot,huziyizero\/godot,lietu\/godot,hipgraphics\/godot,cpascal\/godot,karolgotowala\/godot,lietu\/godot,lietu\/godot,jjdicharry\/godot,vnen\/godot,agusbena\/godot,didier-v\/godot,n-pigeon\/godot,ex\/godot,agusbena\/godot,blackwc\/godot,jjdicharry\/godot,ricpelo\/godot,Paulloz\/godot,vnen\/godot,a12n\/godot,mamarilmanson\/godot,vkbsb\/godot,crr0004\/godot,okamstudio\/godot,hipgraphics\/godot,buckle2000\/godot,mikica1986vee\/GodotArrayEditorStuff,sanikoyes\/godot,BoDonkey\/godot,ricpelo\/godot,crr0004\/godot,vastcharade\/godot,ianholing\/godot,ageazrael\/godot,rollenrolm\/godot,Zylann\/godot,Shockblast\/godot,vnen\/godot,sh95119\/godot,sanikoyes\/godot,FullMeta\/godot,NateWardawg\/godot,DStomtom\/godot,ZuBsPaCe\/godot,davidalpha\/godot,MarianoGnu\/godot,pixelpicosean\/my-godot-2.1,zj8487\/godot,okamstudio\/godot,josempans\/godot,jejung\/godot,mamarilmanson\/godot,gau-veldt\/godot,FateAce\/godot,didier-v\/godot,karolgotowala\/godot,vastcharade\/godot,hitjim\/godot,shackra\/godot,opmana\/godot,BogusCurry\/godot,gcbeyond\/godot,dreamsxin\/godot,huziyizero\/godot,Shockblast\/godot,zj8487\/godot,okamstudio\/godot,pkowal1982\/godot,iap-mutant\/godot,RebelliousX\/Go_Dot,hitjim\/godot,huziyizero\/godot,azurvii\/godot,ex\/godot,ZuBsPaCe\/godot,buckle2000\/godot,ricpelo\/godot,TheBoyThePlay\/godot,teamblubee\/godot,guilhermefelipecgs\/godot,BastiaanOlij\/godot,guilhermefelipecgs\/godot,supriyantomaftuh\/godot,BastiaanOlij\/godot,sh95119\/godot,blackwc\/godot,vkbsb\/godot,serafinfernandez\/godot,Shockblast\/godot,Hodes\/godot,ianholing\/godot,mikica1986vee\/Godot_android_tegra_fallback,wardw\/godot,mikica1986vee\/GodotArrayEditorStuff,n-pigeon\/godot,Faless\/godot,liuyucoder\/godot,hitjim\/godot,vkbsb\/godot,mikica1986vee\/godot,jackmakesthings\/godot,davidalpha\/godot,akien-mga\/godot,OpenSocialGames\/godot,teamblubee\/godot,BastiaanOlij\/godot,NateWardawg\/godot,MrMaidx\/godot,youprofit\/godot,dreamsxin\/godot,didier-v\/godot,RandomShaper\/godot,FullMeta\/godot,mrezai\/godot,jejung\/godot,opmana\/godot,Max-Might\/godot,ricpelo\/godot,vastcharade\/godot,DStomtom\/godot,sanikoyes\/godot,guilhermefelipecgs\/godot,BoDonkey\/godot,HatiEth\/godot,akien-mga\/godot,Valentactive\/godot,NateWardawg\/godot,quabug\/godot,rollenrolm\/godot,karolgotowala\/godot,xiaoyanit\/godot,shackra\/godot,FullMeta\/godot,groud\/godot,xiaoyanit\/godot,jjdicharry\/godot,wardw\/godot,HatiEth\/godot,didier-v\/godot,mamarilmanson\/godot,iap-mutant\/godot,wardw\/godot,ageazrael\/godot,quabug\/godot,est31\/godot,tomreyn\/godot,davidalpha\/godot,ianholing\/godot,didier-v\/godot,marynate\/godot,est31\/godot,tomreyn\/godot,Valentactive\/godot,RebelliousX\/Go_Dot,gcbeyond\/godot,akien-mga\/godot,shackra\/godot,mikica1986vee\/Godot_android_tegra_fallback,kimsunzun\/godot,mikica1986vee\/godot,torgartor21\/godot,crr0004\/godot,ageazrael\/godot,vkbsb\/godot,mamarilmanson\/godot,Faless\/godot,serafinfernandez\/godot,davidalpha\/godot,shackra\/godot,jackmakesthings\/godot,Max-Might\/godot,josempans\/godot,sergicollado\/godot,mcanders\/godot,ricpelo\/godot,ex\/godot,exabon\/godot,supriyantomaftuh\/godot,JoshuaGrams\/godot,blackwc\/godot,xiaoyanit\/godot,gcbeyond\/godot,Brickcaster\/godot,sergicollado\/godot,RandomShaper\/godot,supriyantomaftuh\/godot,ianholing\/godot,mrezai\/godot,teamblubee\/godot,josempans\/godot,hipgraphics\/godot,serafinfernandez\/godot,ianholing\/godot,supriyantomaftuh\/godot,mamarilmanson\/godot,vastcharade\/godot,FateAce\/godot,ageazrael\/godot,BastiaanOlij\/godot,morrow1nd\/godot,Zylann\/godot,pkowal1982\/godot,sergicollado\/godot,a12n\/godot,BoDonkey\/godot,a12n\/godot,RebelliousX\/Go_Dot,zj8487\/godot,serafinfernandez\/godot,godotengine\/godot,ricpelo\/godot,vnen\/godot,firefly2442\/godot,ex\/godot,vnen\/godot,akien-mga\/godot,BogusCurry\/godot,Brickcaster\/godot,exabon\/godot,davidalpha\/godot,groud\/godot,sergicollado\/godot","old_file":"tools\/script_plugins\/time\/time.gd","new_file":"tools\/script_plugins\/time\/time.gd","new_contents":"tool # Always declare as Tool, if it's meant to run in the editor.\nextends EditorPlugin\n\nvar timer = null\nvar label = null\n\nfunc _timeout():\n\tif (label):\n\t\tvar time = OS.get_time()\n\t\tlabel.set_text(str(time.hour).pad_zeros(2)+\":\"+str(time.minute).pad_zeros(2)+\":\"+str(time.second).pad_zeros(2))\n\nfunc get_name(): \n\treturn \"The Time\"\n\n\nfunc _init():\n\tprint(\"PLUGIN INIT\")\n\ttimer = Timer.new()\n\tadd_child(timer)\n\ttimer.set_wait_time(0.5)\n\ttimer.set_one_shot(false)\n\ttimer.connect(\"timeout\",self,\"_timeout\")\n \nfunc _enter_tree():\n\tlabel = Label.new()\n\tadd_custom_control(CONTAINER_TOOLBAR,label)\n\ttimer.start()\n\t\nfunc _exit_tree():\n\ttimer.stop()\n\tlabel.free()\n\tlabel=null\n","old_contents":"tool # Always declare as Tool, if it's meant to run in the editor.\nextends EditorPlugin\n\nvar timer = null\nvar label = null\n\nfunc _timeout():\n\tif (label):\n\t\tvar time = OS.get_time()\n\t\tlabel.set_text(str(time.hour).pad_zeros(2)+\":\"+str(time.minute).pad_zeros(2)+\":\"+str(time.second).pad_zeros(2))\n\nfunc get_name(): \n\treturn \"The Time\"\n\n\nfunc _init():\n\tprint(\"PLUGIN INIT\")\n\ttimer = Timer.new()\n\tadd_child(timer)\n\ttimer.set_wait_time(0.5)\n\ttimer.set_one_shot(false)\n\ttimer.connect(\"timeout\",self,\"_timeout\")\n \nfunc _enter_scene():\n\tlabel = Label.new()\n\tadd_custom_control(CONTAINER_TOOLBAR,label)\n\ttimer.start()\n\t\nfunc _exit_scene():\n\ttimer.stop()\n\tlabel.free()\n\tlabel=null\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"1e44578b1ec77516e0bfe16e22faaa95bef1d1d7","subject":"Fixed basis -> quat casting","message":"Fixed basis -> quat casting\n\nNoticed a lot of error spat out because of unnormalized basis.\nI simply followed the suggestion to use get_rotation_quat() instead of using constructor of Quat(x).\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"3d\/material_testers\/tester.gd","new_file":"3d\/material_testers\/tester.gd","new_contents":"extends Spatial\n\n# class member variables go here, for example:\n# var a = 2\n# var b = \"textvar\"\n\nconst INTERP_SPEED = 2\nvar tester_index = 0\nconst ROT_SPEED = 0.15\nvar rot_x = 0\nvar rot_y = 0\nvar zoom = 0\nconst ZOOM_SPEED = 0.1\nconst ZOOM_MAX = 2.5\n\nvar hdrs=[\n\t{ path=\"res:\/\/schelde.hdr\", name=\"Riverside\"},\n\t{ path=\"res:\/\/lobby.hdr\", name=\"Lobby\"},\n\t{ path=\"res:\/\/park.hdr\", name=\"Park\"},\n\t{ path=\"res:\/\/night.hdr\", name=\"Night\"},\n\t{ path=\"res:\/\/experiment.hdr\", name=\"Experiment\"},\n]\n\nfunc _ready():\n\tfor h in hdrs:\t\n\t\tget_node(\"ui\/bg\").add_item(h.name)\n\nfunc _unhandled_input(ev):\n\n\tif ev is InputEventMouseButton and ev.button_index == BUTTON_WHEEL_UP:\n\t\tif zoom < ZOOM_MAX:\n\t\t\tzoom += ZOOM_SPEED\n\t\t\tget_node(\"camera\/base\/rotation\/camera\").translation.z = -zoom\n\n\tif ev is InputEventMouseButton and ev.button_index == BUTTON_WHEEL_DOWN:\n\t\tif zoom > 0:\n\t\t\tzoom -= ZOOM_SPEED\n\t\t\tget_node(\"camera\/base\/rotation\/camera\").translation.z = -zoom\n\t\n\tif ev is InputEventMouseMotion and ev.button_mask & BUTTON_MASK_LEFT:\n\t\trot_y += ev.relative.x * ROT_SPEED\t\n\t\trot_x += ev.relative.y * ROT_SPEED\n\t\trot_y = clamp(rot_y, -180, 180)\n\t\trot_x = clamp(rot_x, 0, 150)\n\t\tvar t = Transform()\n\t\tt = t.rotated(Vector3(0, 0, 1), rot_x * PI \/ 180.0)\n\t\tt = t.rotated(Vector3(0, 1, 0), -rot_y * PI \/ 180.0)\n\t\tget_node(\"camera\/base\").transform.basis = t.basis\n\t\t\n\t\nfunc _process(delta):\n\tvar xform = get_node(\"testers\").get_child(tester_index).get_node(\"MeshInstance\").global_transform\n\tvar p = xform.origin\n\tvar r = xform.basis.get_rotation_quat()\n\tvar from_xform = get_node(\"camera\").transform\n\tvar from_p = from_xform.origin\n\tvar from_r = Quat(from_xform.basis)\n\t\n\tp = from_p.linear_interpolate(p, INTERP_SPEED * delta)\n\tr = from_r.slerp(r, INTERP_SPEED * delta)\n\t\n\tvar m = Transform(r)\n\tm.origin = p\n\t\n\tget_node(\"camera\").transform = m\n\tget_node(\"ui\/label\").text = get_node(\"testers\").get_child(tester_index).get_name()\n\t\t\t\n\t\nfunc _on_prev_pressed():\n\tif tester_index > 0:\n\t\ttester_index -= 1\n\n\nfunc _on_next_pressed():\n\tif tester_index < get_node(\"testers\").get_child_count() -1:\n\t\ttester_index += 1\n\n\nfunc _on_bg_item_selected( ID ):\n\tget_node(\"environment\").environment.background_sky.panorama = load(hdrs[ID].path)\n","old_contents":"extends Spatial\n\n# class member variables go here, for example:\n# var a = 2\n# var b = \"textvar\"\n\nconst INTERP_SPEED = 2\nvar tester_index = 0\nconst ROT_SPEED = 0.15\nvar rot_x = 0\nvar rot_y = 0\nvar zoom = 0\nconst ZOOM_SPEED = 0.1\nconst ZOOM_MAX = 2.5\n\nvar hdrs=[\n\t{ path=\"res:\/\/schelde.hdr\", name=\"Riverside\"},\n\t{ path=\"res:\/\/lobby.hdr\", name=\"Lobby\"},\n\t{ path=\"res:\/\/park.hdr\", name=\"Park\"},\n\t{ path=\"res:\/\/night.hdr\", name=\"Night\"},\n\t{ path=\"res:\/\/experiment.hdr\", name=\"Experiment\"},\n]\n\nfunc _ready():\n\tfor h in hdrs:\t\n\t\tget_node(\"ui\/bg\").add_item(h.name)\n\nfunc _unhandled_input(ev):\n\n\tif ev is InputEventMouseButton and ev.button_index == BUTTON_WHEEL_UP:\n\t\tif zoom < ZOOM_MAX:\n\t\t\tzoom += ZOOM_SPEED\n\t\t\tget_node(\"camera\/base\/rotation\/camera\").translation.z = -zoom\n\n\tif ev is InputEventMouseButton and ev.button_index == BUTTON_WHEEL_DOWN:\n\t\tif zoom > 0:\n\t\t\tzoom -= ZOOM_SPEED\n\t\t\tget_node(\"camera\/base\/rotation\/camera\").translation.z = -zoom\n\t\n\tif ev is InputEventMouseMotion and ev.button_mask & BUTTON_MASK_LEFT:\n\t\trot_y += ev.relative.x * ROT_SPEED\t\n\t\trot_x += ev.relative.y * ROT_SPEED\n\t\trot_y = clamp(rot_y, -180, 180)\n\t\trot_x = clamp(rot_x, 0, 150)\n\t\tvar t = Transform()\n\t\tt = t.rotated(Vector3(0, 0, 1), rot_x * PI \/ 180.0)\n\t\tt = t.rotated(Vector3(0, 1, 0), -rot_y * PI \/ 180.0)\n\t\tget_node(\"camera\/base\").transform.basis = t.basis\n\t\t\n\t\nfunc _process(delta):\n\tvar xform = get_node(\"testers\").get_child(tester_index).get_node(\"MeshInstance\").global_transform\n\tvar p = xform.origin\n\tvar r = Quat(xform.basis)\n\tvar from_xform = get_node(\"camera\").transform\n\tvar from_p = from_xform.origin\n\tvar from_r = Quat(from_xform.basis)\n\t\n\tp = from_p.linear_interpolate(p, INTERP_SPEED * delta)\n\tr = from_r.slerp(r, INTERP_SPEED * delta)\n\t\n\tvar m = Transform(r)\n\tm.origin = p\n\t\n\tget_node(\"camera\").transform = m\n\tget_node(\"ui\/label\").text = get_node(\"testers\").get_child(tester_index).get_name()\n\t\t\t\n\t\nfunc _on_prev_pressed():\n\tif tester_index > 0:\n\t\ttester_index -= 1\n\n\nfunc _on_next_pressed():\n\tif tester_index < get_node(\"testers\").get_child_count() -1:\n\t\ttester_index += 1\n\n\nfunc _on_bg_item_selected( ID ):\n\tget_node(\"environment\").environment.background_sky.panorama = load(hdrs[ID].path)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"2b10e6724e44e114f0e464231a97573b662ec0df","subject":"Fix leaked object - Label (#648)","message":"Fix leaked object - Label (#648)\n\nThis fixes a warning of leaked instances.","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"gui\/theming_override\/test.gd","new_file":"gui\/theming_override\/test.gd","new_contents":"extends Control\n\n# This script demonstrates how to alter StyleBoxes at runtime.\n# Custom theme item properties aren't considered Object properties per se.\n# This means that you should use `add_stylebox_override(\"normal\", ...)`\n# instead of `set(\"custom_styles\/normal\", ...)`.\n\nonready var label = $VBoxContainer\/Label\nonready var button = $VBoxContainer\/Button\nonready var button2 = $VBoxContainer\/Button2\nonready var reset_all_button = $VBoxContainer\/ResetAllButton\n# Save the label color so it can be reset.\nonready var default_label_color = label.get_color(\"font_color\")\n\nfunc _ready():\n\t# Focus the first button automatically for keyboard\/controller-friendly navigation.\n\tbutton.grab_focus()\n\n\nfunc _on_button_pressed():\n\t# We have to modify the normal, hover and pressed styleboxes all at once\n\t# to get a correct appearance when the button is hovered or pressed.\n\t# We can't use a single StyleBox for all of them as these have different\n\t# background colors.\n\tvar new_stylebox_normal = button.get_stylebox(\"normal\").duplicate()\n\tnew_stylebox_normal.border_color = Color(1, 1, 0)\n\tvar new_stylebox_hover = button.get_stylebox(\"hover\").duplicate()\n\tnew_stylebox_hover.border_color = Color(1, 1, 0)\n\tvar new_stylebox_pressed = button.get_stylebox(\"pressed\").duplicate()\n\tnew_stylebox_pressed.border_color = Color(1, 1, 0)\n\n\tbutton.add_stylebox_override(\"normal\", new_stylebox_normal)\n\tbutton.add_stylebox_override(\"hover\", new_stylebox_hover)\n\tbutton.add_stylebox_override(\"pressed\", new_stylebox_pressed)\n\n\tlabel.add_color_override(\"font_color\", Color(1, 1, 0.5))\n\n\nfunc _on_button2_pressed():\n\tvar new_stylebox_normal = button2.get_stylebox(\"normal\").duplicate()\n\tnew_stylebox_normal.border_color = Color(0, 1, 0.5)\n\tvar new_stylebox_hover = button2.get_stylebox(\"hover\").duplicate()\n\tnew_stylebox_hover.border_color = Color(0, 1, 0.5)\n\tvar new_stylebox_pressed = button2.get_stylebox(\"pressed\").duplicate()\n\tnew_stylebox_pressed.border_color = Color(0, 1, 0.5)\n\n\tbutton2.add_stylebox_override(\"normal\", new_stylebox_normal)\n\tbutton2.add_stylebox_override(\"hover\", new_stylebox_hover)\n\tbutton2.add_stylebox_override(\"pressed\", new_stylebox_pressed)\n\n\tlabel.add_color_override(\"font_color\", Color(0.5, 1, 0.75))\n\n\nfunc _on_reset_all_button_pressed():\n\t# Resetting a theme override is done by setting the property to:\n\t# - `null` for fonts, icons, styleboxes, and shaders.\n\t# - `0` for constants.\n\t# - Colors must be reset manually by adding the previous color value as an override.\n\tbutton.add_stylebox_override(\"normal\", null)\n\tbutton.add_stylebox_override(\"hover\", null)\n\tbutton.add_stylebox_override(\"pressed\", null)\n\n\tbutton2.add_stylebox_override(\"normal\", null)\n\tbutton2.add_stylebox_override(\"hover\", null)\n\tbutton2.add_stylebox_override(\"pressed\", null)\n\n\tlabel.add_color_override(\"font_color\", default_label_color)\n","old_contents":"extends Control\n\n# This script demonstrates how to alter StyleBoxes at runtime.\n# Custom theme item properties aren't considered Object properties per se.\n# This means that you should use `add_stylebox_override(\"normal\", ...)`\n# instead of `set(\"custom_styles\/normal\", ...)`.\n\nonready var label = $VBoxContainer\/Label\nonready var button = $VBoxContainer\/Button\nonready var button2 = $VBoxContainer\/Button2\nonready var reset_all_button = $VBoxContainer\/ResetAllButton\n\n\nfunc _ready():\n\t# Focus the first button automatically for keyboard\/controller-friendly navigation.\n\tbutton.grab_focus()\n\n\nfunc _on_button_pressed():\n\t# We have to modify the normal, hover and pressed styleboxes all at once\n\t# to get a correct appearance when the button is hovered or pressed.\n\t# We can't use a single StyleBox for all of them as these have different\n\t# background colors.\n\tvar new_stylebox_normal = button.get_stylebox(\"normal\").duplicate()\n\tnew_stylebox_normal.border_color = Color(1, 1, 0)\n\tvar new_stylebox_hover = button.get_stylebox(\"hover\").duplicate()\n\tnew_stylebox_hover.border_color = Color(1, 1, 0)\n\tvar new_stylebox_pressed = button.get_stylebox(\"pressed\").duplicate()\n\tnew_stylebox_pressed.border_color = Color(1, 1, 0)\n\n\tbutton.add_stylebox_override(\"normal\", new_stylebox_normal)\n\tbutton.add_stylebox_override(\"hover\", new_stylebox_hover)\n\tbutton.add_stylebox_override(\"pressed\", new_stylebox_pressed)\n\n\tlabel.add_color_override(\"font_color\", Color(1, 1, 0.5))\n\n\nfunc _on_button2_pressed():\n\tvar new_stylebox_normal = button2.get_stylebox(\"normal\").duplicate()\n\tnew_stylebox_normal.border_color = Color(0, 1, 0.5)\n\tvar new_stylebox_hover = button2.get_stylebox(\"hover\").duplicate()\n\tnew_stylebox_hover.border_color = Color(0, 1, 0.5)\n\tvar new_stylebox_pressed = button2.get_stylebox(\"pressed\").duplicate()\n\tnew_stylebox_pressed.border_color = Color(0, 1, 0.5)\n\n\tbutton2.add_stylebox_override(\"normal\", new_stylebox_normal)\n\tbutton2.add_stylebox_override(\"hover\", new_stylebox_hover)\n\tbutton2.add_stylebox_override(\"pressed\", new_stylebox_pressed)\n\n\tlabel.add_color_override(\"font_color\", Color(0.5, 1, 0.75))\n\n\nfunc _on_reset_all_button_pressed():\n\t# Resetting a theme override is done by setting the property to:\n\t# - `null` for fonts, icons, styleboxes, and shaders.\n\t# - `0` for constants.\n\t# - Colors must be reset manually by adding the previous color value as an override.\n\tbutton.add_stylebox_override(\"normal\", null)\n\tbutton.add_stylebox_override(\"hover\", null)\n\tbutton.add_stylebox_override(\"pressed\", null)\n\n\tbutton2.add_stylebox_override(\"normal\", null)\n\tbutton2.add_stylebox_override(\"hover\", null)\n\tbutton2.add_stylebox_override(\"pressed\", null)\n\n\t# If you don't have any references to the previous color value,\n\t# you can instance a node at runtime to get this value.\n\tvar default_label_color = Label.new().get_color(\"font_color\")\n\tlabel.add_color_override(\"font_color\", default_label_color)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"ea01309d568d3dd527eca8e0151c810ed282d521","subject":"Fix small mistakes with new Android IAP API","message":"Fix small mistakes with new Android IAP API\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"misc\/android_iap\/iap_demo.gd","new_file":"misc\/android_iap\/iap_demo.gd","new_contents":"extends Control\n\nconst TEST_ITEM_SKU = \"my_in_app_purchase_sku\"\n\nonready var alert_dialog = $AlertDialog\nonready var label = $Label\n\nvar payment = null\nvar test_item_purchase_token = null\n\nfunc _ready():\n\tif Engine.has_singleton(\"GodotPayment\"):\n\t\tlabel.text += \"\\n\\n\\nTest item SKU: %s\" % TEST_ITEM_SKU\n\n\t\tpayment = Engine.get_singleton(\"GodotPayment\")\n\t\tpayment.connect(\"connected\", self, \"_on_connected\") # No params\n\t\tpayment.connect(\"disconnected\", self, \"_on_disconnected\") # No params\n\t\tpayment.connect(\"connect_error\", self, \"_on_connect_error\") # Response ID (int), Debug message (string)\n\t\tpayment.connect(\"purchases_updated\", self, \"_on_purchases_updated\") # Purchases (Dictionary[])\n\t\tpayment.connect(\"purchase_error\", self, \"_on_purchase_error\") # Response ID (int), Debug message (string)\n\t\tpayment.connect(\"sku_details_query_completed\", self, \"_on_sku_details_query_completed\") # SKUs (Dictionary[])\n\t\tpayment.connect(\"sku_details_query_error\", self, \"_on_sku_details_query_error\") # Response ID (int), Debug message (string), Queried SKUs (string[])\n\t\tpayment.connect(\"purchase_acknowledged\", self, \"_on_purchase_acknowledged\") # Purchase token (string)\n\t\tpayment.connect(\"purchase_acknowledgement_error\", self, \"_on_purchase_acknowledgement_error\") # Response ID (int), Debug message (string), Purchase token (string)\n\t\tpayment.connect(\"purchase_consumed\", self, \"_on_purchase_consumed\") # Purchase token (string)\n\t\tpayment.connect(\"purchase_consumption_error\", self, \"_on_purchase_consumption_error\") # Response ID (int), Debug message (string), Purchase token (string)\n\t\tpayment.startConnection()\n\telse:\n\t\tshow_alert(\"Android IAP support is not enabled. Make sure you have enabled 'Custom Build' and the GodotPayment plugin in your Android export settings! This application will not work.\")\n\n\nfunc show_alert(text):\n\talert_dialog.dialog_text = text\n\talert_dialog.popup_centered()\n\n\nfunc _on_connected():\n\tprint(\"PurchaseManager connected\")\n\n\t# We must acknowledge all puchases.\n\t# See https:\/\/developer.android.com\/google\/play\/billing\/integrate#process for more information\n\tvar query = payment.queryPurchases(\"inapp\") # Use \"subs\" for subscriptions\n\tvar purchase_token = null\n\tif query.status == OK:\n\t\tfor purchase in query.purchases:\n\t\t\tif !purchase.is_acknowledged:\n\t\t\t\tprint(\"Purchase \" + str(purchase.sku) + \" has not been acknowledged. Acknowledging...\")\n\t\t\t\tpayment.acknowledgePurchase(purchase.purchase_token)\n\telse:\n\t\tprint(\"Purchase query failed: %d\" % query.status)\n\n\nfunc _on_sku_details_query_completed(sku_details):\n\tfor available_sku in sku_details:\n\t\tshow_alert(to_json(available_sku))\n\n\nfunc _on_purchases_updated(purchases):\n\tprint(\"Purchases updated: %s\" % to_json(purchases))\n\n\t# See _on_connected\n\tfor purchase in purchases:\n\t\tif !purchase.is_acknowledged:\n\t\t\tprint(\"Purchase \" + str(purchase.sku) + \" has not been acknowledged. Acknowledging...\")\n\t\t\tpayment.acknowledgePurchase(purchase.purchase_token)\n\n\tif purchases.size() > 0:\n\t\ttest_item_purchase_token = purchases[purchases.size() - 1].purchase_token\n\n\nfunc _on_purchase_acknowledged(purchase_token):\n\tprint(\"Purchase acknowledged: %s\" % purchase_token)\n\n\nfunc _on_purchase_consumed(purchase_token):\n\tshow_alert(\"Purchase consumed successfully: %s\" % purchase_token)\n\n\nfunc _on_purchase_error(code, message):\n\tshow_alert(\"Purchase error %d: %s\" % [code, message])\n\n\nfunc _on_purchase_acknowledgement_error(code, message):\n\tshow_alert(\"Purchase acknowledgement error %d: %s\" % [code, message])\n\n\nfunc _on_purchase_consumption_error(code, message, purchase_token):\n\tshow_alert(\"Purchase consumption error %d: %s, purchase token: %s\" % [code, message, purchase_token])\n\n\nfunc _on_sku_details_query_error(code, message):\n\tshow_alert(\"SKU details query error %d: %s\" % [code, message])\n\n\nfunc _on_disconnected():\n\tshow_alert(\"GodotPayment disconnected. Will try to reconnect in 10s...\")\n\tyield(get_tree().create_timer(10), \"timeout\")\n\tpayment.startConnection()\n\n\n# GUI\nfunc _on_QuerySkuDetailsButton_pressed():\n\tpayment.querySkuDetails([TEST_ITEM_SKU], \"inapp\") # Use \"subs\" for subscriptions\n\n\nfunc _on_PurchaseButton_pressed():\n\tvar response = payment.purchase(TEST_ITEM_SKU)\n\tif response.status != OK:\n\t\tshow_alert(\"Purchase error %d: %s\" % [response.response_code, response.debug_message])\n\n\nfunc _on_ConsumeButton_pressed():\n\tif test_item_purchase_token == null:\n\t\tshow_alert(\"You need to set 'test_item_purchase_token' first! (either by hand or in code)\")\n\t\treturn\n\n\tpayment.consumePurchase(test_item_purchase_token)\n","old_contents":"extends Control\n\nconst TEST_ITEM_SKU = \"my_in_app_purchase_sku\"\n\nonready var alert_dialog = $AlertDialog\nonready var label = $Label\n\nvar payment = null\nvar test_item_purchase_token = null\n\nfunc _ready():\n\tif Engine.has_singleton(\"GodotPayment\"):\n\t\tlabel.text += \"\\n\\n\\nTest item SKU: %s\" % TEST_ITEM_SKU\n\n\t\tpayment = Engine.get_singleton(\"GodotPayment\")\n\t\tpayment.connect(\"connected\", self, \"_on_connected\") # No params\n\t\tpayment.connect(\"disconnected\", self, \"_on_disconnected\") # No params\n\t\tpayment.connect(\"connect_error\", self, \"_on_connect_error\") # Response ID (int), Debug message (string)\n\t\tpayment.connect(\"purchases_updated\", self, \"_on_purchases_updated\") # Purchases (Dictionary[])\n\t\tpayment.connect(\"purchase_error\", self, \"_on_purchase_error\") # Response ID (int), Debug message (string)\n\t\tpayment.connect(\"sku_details_query_completed\", self, \"_on_sku_details_query_completed\") # SKUs (Dictionary[])\n\t\tpayment.connect(\"sku_details_query_error\", self, \"_on_sku_details_query_error\") # Response ID (int), Debug message (string), Queried SKUs (string[])\n\t\tpayment.connect(\"purchase_acknowledged\", self, \"_on_purchase_acknowledged\") # Purchase token (string)\n\t\tpayment.connect(\"purchase_acknowledgement_error\", self, \"_on_purchase_acknowledgement_error\") # Response ID (int), Debug message (string), Purchase token (string)\n\t\tpayment.connect(\"purchase_consumed\", self, \"_on_purchase_consumed\") # Purchase token (string)\n\t\tpayment.connect(\"purchase_consumption_error\", self, \"_on_purchase_consumption_error\") # Response ID (int), Debug message (string), Purchase token (string)\n\t\tpayment.startConnection()\n\telse:\n\t\tshow_alert(\"Android IAP support is not enabled. Make sure you have enabled 'Custom Build' and the GodotPayment plugin in your Android export settings! This application will not work.\")\n\n\nfunc show_alert(text):\n\talert_dialog.dialog_text = text\n\talert_dialog.popup_centered()\n\n\nfunc _on_connected():\n\tprint(\"PurchaseManager connected\")\n\n\t# We must acknowledge all puchases.\n\t# See https:\/\/developer.android.com\/google\/play\/billing\/integrate#process for more information\n\tvar query = payment.queryPurchases(\"inapp\") # Use \"subs\" for subscriptions\n\tvar purchase_token = null\n\tif query.status == OK:\n\t\tfor purchase in query.purchases:\n\t\t\tif !purchase.is_acknowledged:\n\t\t\t\tprint(\"Purchase \" + str(purchase.sku) + \" has not been acknowledged. Acknowledging...\")\n\t\t\t\tpayment.acknowledgePurchase(purchase.purchase_token)\n\telse:\n\t\tprint(\"Purchase query failed: %d\" % query.status)\n\n\nfunc _on_sku_details_query_completed(sku_details):\n\tfor available_sku in sku_details:\n\t\tshow_alert(to_json(available_sku))\n\n\nfunc _on_purchases_updated(purchases):\n\tprint(\"Purchases updated: %s\" % to_json(purchases))\n\n\t# See _on_connected\n\tfor purchase in purchases:\n\t\tif !purchase.is_acknowledged:\n\t\t\tprint(\"Purchase \" + str(purchase.sku) + \" has not been acknowledged. Acknowledging...\")\n\t\t\tpayment.acknowledgePurchase(purchase.purchase_token)\n\n\tif purchases.size() > 0:\n\t\ttest_item_purchase_token = purchases[purchases.size() - 1].purchase_token\n\n\nfunc _on_purchase_acknowledged(purchase_token):\n\tprint(\"Purchase acknowledged: %s\" % purchase_token)\n\n\nfunc _on_purchase_consumed(purchase_token):\n\tshow_alert(\"Purchase consumed successfully: %s\" % purchase_token)\n\n\nfunc _on_purchase_error(code, message):\n\tshow_alert(\"Purchase error %d: %s\" % [code, message])\n\n\nfunc _on_purchase_acknowledgement_error(code, message):\n\tshow_alert(\"Purchase acknowledgement error %d: %s\" % [code, message])\n\n\nfunc _on_purchase_consumption_error(code, message):\n\tshow_alert(\"Purchase consumption error %d: %s\" % [code, message])\n\n\nfunc _on_sku_details_query_error(code, message):\n\tshow_alert(\"SKU details query error %d: %s\" % [code, message])\n\n\nfunc _on_disconnected():\n\tshow_alert(\"GodotPayment disconnected. Will try to reconnect in 10s...\")\n\tyield(get_tree().create_timer(10), \"timeout\")\n\tpayment.startConnection()\n\n\n# GUI\nfunc _on_QuerySkuDetailsButton_pressed():\n\tpayment.querySkuDetails([TEST_ITEM_SKU])\n\n\nfunc _on_PurchaseButton_pressed():\n\tvar response = payment.purchase(TEST_ITEM_SKU)\n\tif response.status != OK:\n\t\tshow_alert(\"Purchase error %d: %s\" % [response.response_code, response.debug_message])\n\n\nfunc _on_ConsumeButton_pressed():\n\tif test_item_purchase_token == null:\n\t\tshow_alert(\"You need to set 'test_item_purchase_token' first! (either by hand or in code)\")\n\t\treturn\n\n\tpayment.consumePurchase(test_item_purchase_token)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"ac47a1a686e06e3e8bcb665feed206f32fb126b1","subject":"Minor fix.","message":"Minor fix.\n\nFix.\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Blocks\/PairedBlock.gd","new_file":"src\/scripts\/Blocks\/PairedBlock.gd","new_contents":"extends \"AbstractBlock.gd\"\n\n# Is there a better way to do this?\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\nvar textureName\n\nfunc setTexture(textureName=\"Red\"):\n\tvar img = Image()\n\tself.textureName = textureName\n\tprint( self.textureName )\n\t#var mat = load(\"res:\/\/materials\/block_\" + textureName + \".mtl\")\n\tprint( Globals.get( \"MaterialMaker\" ) )\n\tself.get_node(\"MeshInstance\").set_material_override( Globals.get( \"MaterialMaker\" ).blockMats[textureName] )\n\treturn self\n\n# Animate the removal of this block and its pair.\nfunc popBlock( pairNode, justFly=false ):\n\tget_parent().samplePlayer.play(\"deraj_pop_sound_low\")\n\t# fly away\n\tvar tweenNode = newTweenNode()\n\ttweenNode.interpolate_method( self, \"set_translation\", \\\n\t\tself.get_translation(), self.get_translation().normalized() * far_away_corner, \\\n\t\t1, Tween.TRANS_CIRC, Tween.EASE_IN_OUT )\n\n\t# remove on animation end\n\ttweenNode.connect(\"tween_complete\", self, \"request_remove\")\n\ttweenNode.start()\n\t# just one call to activate...\n\tif not justFly:\n\t\tpairNode.activate(true)\n\t\tget_parent().popPair( blockPos )\n\n# THIS IS EVERYWHERE, ANY BETTER WAY TO HAVE FUNCTIONS BETWEEN SCRIPTS?\nfunc calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n# fly away only if self.pairName is selected\nfunc activate(justFly = false):\n\tvar gridMan = get_parent()\n\tif gridMan.selectedBlocks.size() > 0:\n\t\tvar selBlock = gridMan.get_node( gridMan.selectedBlocks[0] )\n\n\t\tif selBlock.getBlockType() == BLOCK_WILD:\n\t\t\tif selBlock.textureName == textureName.substr( 0, selBlock.textureName.length() ):\n\t\t\t\tif calcBlockLayerVec( selBlock.blockPos ) == calcBlockLayerVec( blockPos ):\n\t\t\t\t\tgridMan.clearSelection()\n\t\t\t\t\tselBlock.popBlock()\n\t\t\t\t\tforceActivate()\n\n\t\t\t\t\treturn\n\n\tvar pairNode = pairActivate()\n\tif pairNode == null:\n\t\treturn\n\tif pairNode.selected:\n\t\tpopBlock( pairNode, justFly )\n\n\n# Force the pair to activate.\nfunc forceActivate():\n\tvar pairNode = pairActivate()\n\tif pairNode == null:\n\t\treturn\n\n\tpopBlock( pairNode )\n\n","old_contents":"extends \"AbstractBlock.gd\"\n\n# Is there a better way to do this?\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\nvar textureName\n\nfunc setTexture(textureName=\"Red\"):\n\tvar img = Image()\n\tself.textureName = textureName\n\tprint( self.textureName )\n\t#var mat = load(\"res:\/\/materials\/block_\" + textureName + \".mtl\")\n\tprint( Globals.get( \"MaterialMaker\" ) )\n\tself.get_node(\"MeshInstance\").set_material_override( Globals.get( \"MaterialMaker\" ).blockMats[textureName] )\n\treturn self\n\n# Animate the removal of this block and its pair.\nfunc popBlock( pairNode, justFly=false ):\n\tget_parent().samplePlayer.play(\"deraj_pop_sound_low\")\n\t# fly away\n\tvar tweenNode = newTweenNode()\n\ttweenNode.interpolate_method( self, \"set_translation\", \\\n\t\tself.get_translation(), self.get_translation().normalized() * far_away_corner, \\\n\t\t1, Tween.TRANS_CIRC, Tween.EASE_IN_OUT )\n\n\t# remove on animation end\n\ttweenNode.connect(\"tween_complete\", self, \"request_remove\")\n\ttweenNode.start()\n\t# just one call to activate...\n\tif not justFly:\n\t\tpairNode.activate(true)\n\t\tget_parent().popPair( blockPos )\n\n# THIS IS EVERYWHERE, ANY BETTER WAY TO HAVE FUNCTIONS BETWEEN SCRIPTS?\nfunc calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n# fly away only if self.pairName is selected\nfunc activate(justFly = false):\n\tvar gridMan = get_parent()\n\tif gridMan.selectedBlocks.size() > 0:\n\t\tvar selBlock = gridMan.get_node( gridMan.selectedBlocks[0] )\n\n\t\tif selBlock.getBlockType() == BLOCK_WILD:\n\t\t\tprint( selBlock.textureName )\n\t\t\tprint( textureName.substr( 0, selBlock.textureName.length() ) )\n\t\t\tif selBlock.textureName == textureName.substr( 0, selBlock.textureName.length() ):\n\t\t\t\tif calcBlockLayerVec( selBlock.blockPos ) == calcBlockLayerVec( blockPos ):\n\t\t\t\t\tgridMan.clearSelection()\n\t\t\t\t\tselBlock.popBlock()\n\t\t\t\t\tforceActivate()\n\n\t\t\t\t\treturn\n\n\tvar pairNode = pairActivate()\n\tif pairNode == null:\n\t\treturn\n\tif pairNode.selected:\n\t\tpopBlock( pairNode, justFly )\n\n\n# Force the pair to activate.\nfunc forceActivate():\n\tvar pairNode = pairActivate()\n\tif pairNode == null:\n\t\treturn\n\n\tpopBlock( pairNode )\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"87cfcb7a4f2d9b8cfe05c81f0738d3ca25caf239","subject":"Update Android IAP demo for v1.1 of PBL plugin","message":"Update Android IAP demo for v1.1 of PBL plugin\n\nMinor update to reflect an API change in v1.1 of the\nGoogle Play Billing Library plugin.\n\nThe queryPurchases function changed to be asyncronous,\nadded a query_purchases_response callback to process\nthe results.\n\nThis change is dependent on the contents of:\nhttps:\/\/github.com\/godotengine\/godot-google-play-billing\/pull\/25\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"mobile\/android_iap\/iap_demo.gd","new_file":"mobile\/android_iap\/iap_demo.gd","new_contents":"extends Control\n\nconst TEST_ITEM_SKU = \"my_in_app_purchase_sku\"\n\nonready var alert_dialog = $AlertDialog\nonready var label = $Label\n\nvar payment = null\nvar test_item_purchase_token = null\n\nfunc _ready():\n\tif Engine.has_singleton(\"GodotGooglePlayBilling\"):\n\t\tlabel.text += \"\\n\\n\\nTest item SKU: %s\" % TEST_ITEM_SKU\n\n\t\tpayment = Engine.get_singleton(\"GodotGooglePlayBilling\")\n\t\t# No params.\n\t\tpayment.connect(\"connected\", self, \"_on_connected\")\n\t\t# No params.\n\t\tpayment.connect(\"disconnected\", self, \"_on_disconnected\")\n\t\t# Response ID (int), Debug message (string).\n\t\tpayment.connect(\"connect_error\", self, \"_on_connect_error\")\n\t\t# Purchases (Dictionary[]).\n\t\tpayment.connect(\"purchases_updated\", self, \"_on_purchases_updated\")\n\t\t# Response ID (int), Debug message (string).\n\t\tpayment.connect(\"purchase_error\", self, \"_on_purchase_error\")\n\t\t# SKUs (Dictionary[]).\n\t\tpayment.connect(\"sku_details_query_completed\", self, \"_on_sku_details_query_completed\")\n\t\t# Response ID (int), Debug message (string), Queried SKUs (string[]).\n\t\tpayment.connect(\"sku_details_query_error\", self, \"_on_sku_details_query_error\")\n\t\t# Purchase token (string).\n\t\tpayment.connect(\"purchase_acknowledged\", self, \"_on_purchase_acknowledged\")\n\t\t# Response ID (int), Debug message (string), Purchase token (string).\n\t\tpayment.connect(\"purchase_acknowledgement_error\", self, \"_on_purchase_acknowledgement_error\")\n\t\t# Purchase token (string).\n\t\tpayment.connect(\"purchase_consumed\", self, \"_on_purchase_consumed\")\n\t\t# Response ID (int), Debug message (string), Purchase token (string).\n\t\tpayment.connect(\"purchase_consumption_error\", self, \"_on_purchase_consumption_error\")\n\t\t# Purchases (Dictionary[])\n\t\tpayment.connect(\"query_purchases_response\", self, \"_on_query_purchases_response\")\n\t\tpayment.startConnection()\n\telse:\n\t\tshow_alert(\"Android IAP support is not enabled. Make sure you have enabled 'Custom Build' and installed and enabled the GodotGooglePlayBilling plugin in your Android export settings! This application will not work.\")\n\n\nfunc show_alert(text):\n\talert_dialog.dialog_text = text\n\talert_dialog.popup_centered()\n\n\nfunc _on_connected():\n\tprint(\"PurchaseManager connected\")\n\tpayment.queryPurchases(\"inapp\") # Use \"subs\" for subscriptions.\n\n\nfunc _on_query_purchases_response(query_result):\n\tif query_result.status == OK:\n\t\tfor purchase in query_result.purchases:\n\t\t\t# We must acknowledge all puchases.\n\t\t\t# See https:\/\/developer.android.com\/google\/play\/billing\/integrate#process for more information\n\t\t\tif not purchase.is_acknowledged:\n\t\t\t\tprint(\"Purchase \" + str(purchase.sku) + \" has not been acknowledged. Acknowledging...\")\n\t\t\t\tpayment.acknowledgePurchase(purchase.purchase_token)\n\telse:\n\t\tprint(\"queryPurchases failed, response code: \",\n\t\t\t\tquery_result.response_code,\n\t\t\t\t\" debug message: \", query_result.debug_message)\n\n\nfunc _on_sku_details_query_completed(sku_details):\n\tfor available_sku in sku_details:\n\t\tshow_alert(to_json(available_sku))\n\n\nfunc _on_purchases_updated(purchases):\n\tprint(\"Purchases updated: %s\" % to_json(purchases))\n\n\t# See _on_connected\n\tfor purchase in purchases:\n\t\tif not purchase.is_acknowledged:\n\t\t\tprint(\"Purchase \" + str(purchase.sku) + \" has not been acknowledged. Acknowledging...\")\n\t\t\tpayment.acknowledgePurchase(purchase.purchase_token)\n\n\tif purchases.size() > 0:\n\t\ttest_item_purchase_token = purchases[purchases.size() - 1].purchase_token\n\n\nfunc _on_purchase_acknowledged(purchase_token):\n\tprint(\"Purchase acknowledged: %s\" % purchase_token)\n\n\nfunc _on_purchase_consumed(purchase_token):\n\tshow_alert(\"Purchase consumed successfully: %s\" % purchase_token)\n\n\nfunc _on_purchase_error(code, message):\n\tshow_alert(\"Purchase error %d: %s\" % [code, message])\n\n\nfunc _on_purchase_acknowledgement_error(code, message):\n\tshow_alert(\"Purchase acknowledgement error %d: %s\" % [code, message])\n\n\nfunc _on_purchase_consumption_error(code, message, purchase_token):\n\tshow_alert(\"Purchase consumption error %d: %s, purchase token: %s\" % [code, message, purchase_token])\n\n\nfunc _on_sku_details_query_error(code, message):\n\tshow_alert(\"SKU details query error %d: %s\" % [code, message])\n\n\nfunc _on_disconnected():\n\tshow_alert(\"GodotGooglePlayBilling disconnected. Will try to reconnect in 10s...\")\n\tyield(get_tree().create_timer(10), \"timeout\")\n\tpayment.startConnection()\n\n\n# GUI\nfunc _on_QuerySkuDetailsButton_pressed():\n\tpayment.querySkuDetails([TEST_ITEM_SKU], \"inapp\") # Use \"subs\" for subscriptions.\n\n\nfunc _on_PurchaseButton_pressed():\n\tvar response = payment.purchase(TEST_ITEM_SKU)\n\tif response.status != OK:\n\t\tshow_alert(\"Purchase error %s: %s\" % [response.response_code, response.debug_message])\n\n\nfunc _on_ConsumeButton_pressed():\n\tif test_item_purchase_token == null:\n\t\tshow_alert(\"You need to set 'test_item_purchase_token' first! (either by hand or in code)\")\n\t\treturn\n\n\tpayment.consumePurchase(test_item_purchase_token)\n","old_contents":"extends Control\n\nconst TEST_ITEM_SKU = \"my_in_app_purchase_sku\"\n\nonready var alert_dialog = $AlertDialog\nonready var label = $Label\n\nvar payment = null\nvar test_item_purchase_token = null\n\nfunc _ready():\n\tif Engine.has_singleton(\"GodotGooglePlayBilling\"):\n\t\tlabel.text += \"\\n\\n\\nTest item SKU: %s\" % TEST_ITEM_SKU\n\n\t\tpayment = Engine.get_singleton(\"GodotGooglePlayBilling\")\n\t\t# No params.\n\t\tpayment.connect(\"connected\", self, \"_on_connected\")\n\t\t# No params.\n\t\tpayment.connect(\"disconnected\", self, \"_on_disconnected\")\n\t\t# Response ID (int), Debug message (string).\n\t\tpayment.connect(\"connect_error\", self, \"_on_connect_error\")\n\t\t# Purchases (Dictionary[]).\n\t\tpayment.connect(\"purchases_updated\", self, \"_on_purchases_updated\")\n\t\t# Response ID (int), Debug message (string).\n\t\tpayment.connect(\"purchase_error\", self, \"_on_purchase_error\")\n\t\t# SKUs (Dictionary[]).\n\t\tpayment.connect(\"sku_details_query_completed\", self, \"_on_sku_details_query_completed\")\n\t\t# Response ID (int), Debug message (string), Queried SKUs (string[]).\n\t\tpayment.connect(\"sku_details_query_error\", self, \"_on_sku_details_query_error\")\n\t\t# Purchase token (string).\n\t\tpayment.connect(\"purchase_acknowledged\", self, \"_on_purchase_acknowledged\")\n\t\t# Response ID (int), Debug message (string), Purchase token (string).\n\t\tpayment.connect(\"purchase_acknowledgement_error\", self, \"_on_purchase_acknowledgement_error\")\n\t\t# Purchase token (string).\n\t\tpayment.connect(\"purchase_consumed\", self, \"_on_purchase_consumed\")\n\t\t# Response ID (int), Debug message (string), Purchase token (string).\n\t\tpayment.connect(\"purchase_consumption_error\", self, \"_on_purchase_consumption_error\")\n\t\tpayment.startConnection()\n\telse:\n\t\tshow_alert(\"Android IAP support is not enabled. Make sure you have enabled 'Custom Build' and installed and enabled the GodotGooglePlayBilling plugin in your Android export settings! This application will not work.\")\n\n\nfunc show_alert(text):\n\talert_dialog.dialog_text = text\n\talert_dialog.popup_centered()\n\n\nfunc _on_connected():\n\tprint(\"PurchaseManager connected\")\n\n\t# We must acknowledge all puchases.\n\t# See https:\/\/developer.android.com\/google\/play\/billing\/integrate#process for more information\n\tvar query = payment.queryPurchases(\"inapp\") # Use \"subs\" for subscriptions.\n\tif query.status == OK:\n\t\tfor purchase in query.purchases:\n\t\t\tif not purchase.is_acknowledged:\n\t\t\t\tprint(\"Purchase \" + str(purchase.sku) + \" has not been acknowledged. Acknowledging...\")\n\t\t\t\tpayment.acknowledgePurchase(purchase.purchase_token)\n\telse:\n\t\tprint(\"Purchase query failed: %d\" % query.status)\n\n\nfunc _on_sku_details_query_completed(sku_details):\n\tfor available_sku in sku_details:\n\t\tshow_alert(to_json(available_sku))\n\n\nfunc _on_purchases_updated(purchases):\n\tprint(\"Purchases updated: %s\" % to_json(purchases))\n\n\t# See _on_connected\n\tfor purchase in purchases:\n\t\tif not purchase.is_acknowledged:\n\t\t\tprint(\"Purchase \" + str(purchase.sku) + \" has not been acknowledged. Acknowledging...\")\n\t\t\tpayment.acknowledgePurchase(purchase.purchase_token)\n\n\tif purchases.size() > 0:\n\t\ttest_item_purchase_token = purchases[purchases.size() - 1].purchase_token\n\n\nfunc _on_purchase_acknowledged(purchase_token):\n\tprint(\"Purchase acknowledged: %s\" % purchase_token)\n\n\nfunc _on_purchase_consumed(purchase_token):\n\tshow_alert(\"Purchase consumed successfully: %s\" % purchase_token)\n\n\nfunc _on_purchase_error(code, message):\n\tshow_alert(\"Purchase error %d: %s\" % [code, message])\n\n\nfunc _on_purchase_acknowledgement_error(code, message):\n\tshow_alert(\"Purchase acknowledgement error %d: %s\" % [code, message])\n\n\nfunc _on_purchase_consumption_error(code, message, purchase_token):\n\tshow_alert(\"Purchase consumption error %d: %s, purchase token: %s\" % [code, message, purchase_token])\n\n\nfunc _on_sku_details_query_error(code, message):\n\tshow_alert(\"SKU details query error %d: %s\" % [code, message])\n\n\nfunc _on_disconnected():\n\tshow_alert(\"GodotGooglePlayBilling disconnected. Will try to reconnect in 10s...\")\n\tyield(get_tree().create_timer(10), \"timeout\")\n\tpayment.startConnection()\n\n\n# GUI\nfunc _on_QuerySkuDetailsButton_pressed():\n\tpayment.querySkuDetails([TEST_ITEM_SKU], \"inapp\") # Use \"subs\" for subscriptions.\n\n\nfunc _on_PurchaseButton_pressed():\n\tvar response = payment.purchase(TEST_ITEM_SKU)\n\tif response.status != OK:\n\t\tshow_alert(\"Purchase error %s: %s\" % [response.response_code, response.debug_message])\n\n\nfunc _on_ConsumeButton_pressed():\n\tif test_item_purchase_token == null:\n\t\tshow_alert(\"You need to set 'test_item_purchase_token' first! (either by hand or in code)\")\n\t\treturn\n\n\tpayment.consumePurchase(test_item_purchase_token)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"7c0f926725e14cb7f6c52995937f34080a55d4e4","subject":"Load only intro pages for reception screen.","message":"Load only intro pages for reception screen.\n","repos":"Bitiquinho\/Jogo-Educacional-Producao,Bitiquinho\/Jogo-Educacional-Producao,Bitiquinho\/Jogo-Educacional-Producao","old_file":"assets\/scripts\/reception_stage.gd","new_file":"assets\/scripts\/reception_stage.gd","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"mit","lang":"GDScript"} {"commit":"8a3f5ad34420d88a111300373078316442fada15","subject":"abstract block sends network data on click","message":"abstract block sends network data on click\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Blocks\/AbstractBlock.gd","new_file":"src\/scripts\/Blocks\/AbstractBlock.gd","new_contents":"\nextends RigidBody\n\nvar name_int\nvar name\nvar pairName\nvar selected = false\nvar blockPos\nvar blockLayer\nvar blockType\nconst far_away_corner = Vector3(110, 110, 110)\n\nvar editor\n\nstatic func nameToNodeName(n):\n\treturn \"block\" + str(n)\n\nfunc setName(n):\n\tname_int = n\n\tname = nameToNodeName(n)\n\tset_name(nameToNodeName(n))\n\treturn self\n\nfunc setPairName(n):\n\tpairName = nameToNodeName(n)\n\treturn self\n\nfunc setBlockLayer(n):\n\tblockLayer = n\n\treturn self\n\nfunc getBlockLayer():\n\treturn blockLayer\n\nfunc setBlockType( blockT ):\n\tblockType = blockT\n\treturn self\n\nfunc getBlockType():\n\treturn blockType\n\nfunc setSelected(sel):\n\tselected = sel\n\treturn self\n\nfunc forceClick(click_normal=null):\n\tvar network = Globals.get(\"Network\")\n\tif (not network == null and get_node(\"..\/..\/..\/..\/Puzzle\").mainPuzzle and network.isNetwork):\n\t\t\tnetwork.sendBlockUpdate(blockPos)\n\n\tif click_normal != null and editor != null:\n\t\tif editor.shouldAddNeighbor():\n\t\t\taddNeighbor(editor, click_normal)\n\t\t\treturn\n\t\tif editor.shouldReplaceSelf() or editor.shouldRemoveSelf():\n\t\t\t# lasers cannot be removed by the editor\n\t\t\tif blockType == get_parent().get_parent().get_parent().puzzleMan.BLOCK_LASER:\n\t\t\t\treturn\n\n\t\t\t# maybe replace self\n\t\t\tif editor.shouldReplaceSelf():\n\t\t\t\taddNeighbor(editor, 0 * click_normal)\n\t\t\tif pairName != null:\n\t\t\t\tvar pair = get_parent().get_node(pairName)\n\t\t\t\tif pair != null:\n\t\t\t\t\tpair.request_remove()\n\t\t\trequest_remove()\n\t\t\treturn\n\telse:\n\t\tactivate()\n\t\tget_parent().clickBlock( name )\n\nfunc addNeighbor(editor, click_normal):\n\tvar t = get_parent().get_parent().get_transform().inverse()\n\teditor.addBlock(blockPos + t * click_normal)\n\n\n# catch clicks\/taps\nfunc _input_event( camera, ev, click_pos, click_normal, shape_idx ):\n\tif ((ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT)\n\tor (ev.type==InputEvent.SCREEN_TOUCH)):\n\t\tif (get_parent().get_parent().active and ev.is_pressed()):\n\t\t\tforceClick(click_normal)\n\n# returns this block's pairNode or null\nfunc pairActivate():\n\tselected = true\n\n\t# is my pair Nil?\n\tif not get_parent().has_node(str(pairName)):\n\t\tscaleTweenNode(0.9, 0.2, Tween.TRANS_EXPO).start()\n\t\treturn null\n\n\t# get my pair node\n\tvar pairNode = get_parent().get_node(pairName)\n\n\t# enlarge if the other guy's unselected\n\tif not pairNode.selected:\n\t\tscaleTweenNode(1.1, 0.2, Tween.TRANS_EXPO).start()\n\treturn pairNode\n\n\n# returns a tween node that uniformly changes the object's scale\n# call start() on the returned object\nfunc scaleTweenNode(scale, time=1, transType=Tween.TRANS_BOUNCE):\n\tvar tweenNode = newTweenNode()\n\ttweenNode.interpolate_method( self, \"set_scale\", \\\n\t\tself.get_scale(), Vector3(scale, scale, scale), \\\n\t\ttime, transType, Tween.EASE_OUT )\n\n\treturn tweenNode\n\n# adds a tween transition node to the tree\nfunc newTweenNode():\n\tvar tween = Tween.new()\n\tadd_child(tween)\n\treturn tween\n\nfunc request_remove(node=null, key=null):\n\tvar n = scaleTweenNode(0.001, 0.25, Tween.TRANS_QUART)\n\tn.start()\n\tn.connect(\"tween_complete\", get_parent(), \"remove_block\", [self])\n\nfunc _ready():\n\tif get_tree().get_root().has_node(\"EditorSpatial\"):\n\t\teditor = get_tree().get_root().get_node(\"EditorSpatial\")\n\tset_ray_pickable(true)\n","old_contents":"\nextends RigidBody\n\nvar name_int\nvar name\nvar pairName\nvar selected = false\nvar blockPos\nvar blockLayer\nvar blockType\nconst far_away_corner = Vector3(110, 110, 110)\n\nvar editor\n\nstatic func nameToNodeName(n):\n\treturn \"block\" + str(n)\n\nfunc setName(n):\n\tname_int = n\n\tname = nameToNodeName(n)\n\tset_name(nameToNodeName(n))\n\treturn self\n\nfunc setPairName(n):\n\tpairName = nameToNodeName(n)\n\treturn self\n\nfunc setBlockLayer(n):\n\tblockLayer = n\n\treturn self\n\nfunc getBlockLayer():\n\treturn blockLayer\n\nfunc setBlockType( blockT ):\n\tblockType = blockT\n\treturn self\n\nfunc getBlockType():\n\treturn blockType\n\nfunc setSelected(sel):\n\tselected = sel\n\treturn self\n\nfunc forceClick(click_normal):\n\tif editor != null:\n\t\tif editor.shouldAddNeighbor():\n\t\t\taddNeighbor(editor, click_normal)\n\t\t\treturn\n\t\tif editor.shouldReplaceSelf() or editor.shouldRemoveSelf():\n\t\t\t# lasers cannot be removed by the editor\n\t\t\tif blockType == get_parent().get_parent().get_parent().puzzleMan.BLOCK_LASER:\n\t\t\t\treturn\n\n\t\t\t# maybe replace self\n\t\t\tif editor.shouldReplaceSelf():\n\t\t\t\taddNeighbor(editor, 0 * click_normal)\n\t\t\tif pairName != null:\n\t\t\t\tvar pair = get_parent().get_node(pairName)\n\t\t\t\tif pair != null:\n\t\t\t\t\tpair.request_remove()\n\t\t\trequest_remove()\n\t\t\treturn\n\telse:\n\t\tactivate()\n\t\tget_parent().clickBlock( name )\n\nfunc addNeighbor(editor, click_normal):\n\tvar t = get_parent().get_parent().get_transform().inverse()\n\teditor.addBlock(blockPos + t * click_normal)\n\n\n# catch clicks\/taps\nfunc _input_event( camera, ev, click_pos, click_normal, shape_idx ):\n\tif ((ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT)\n\tor (ev.type==InputEvent.SCREEN_TOUCH)):\n\t\tif (get_parent().get_parent().active and ev.is_pressed()):\n\t\t\tforceClick(click_normal)\n\n# returns this block's pairNode or null\nfunc pairActivate():\n\tselected = true\n\n\t# is my pair Nil?\n\tif not get_parent().has_node(str(pairName)):\n\t\tscaleTweenNode(0.9, 0.2, Tween.TRANS_EXPO).start()\n\t\treturn null\n\n\t# get my pair node\n\tvar pairNode = get_parent().get_node(pairName)\n\n\t# enlarge if the other guy's unselected\n\tif not pairNode.selected:\n\t\tscaleTweenNode(1.1, 0.2, Tween.TRANS_EXPO).start()\n\treturn pairNode\n\n\n# returns a tween node that uniformly changes the object's scale\n# call start() on the returned object\nfunc scaleTweenNode(scale, time=1, transType=Tween.TRANS_BOUNCE):\n\tvar tweenNode = newTweenNode()\n\ttweenNode.interpolate_method( self, \"set_scale\", \\\n\t\tself.get_scale(), Vector3(scale, scale, scale), \\\n\t\ttime, transType, Tween.EASE_OUT )\n\n\treturn tweenNode\n\n# adds a tween transition node to the tree\nfunc newTweenNode():\n\tvar tween = Tween.new()\n\tadd_child(tween)\n\treturn tween\n\nfunc request_remove(node=null, key=null):\n\tvar n = scaleTweenNode(0.001, 0.25, Tween.TRANS_QUART)\n\tn.start()\n\tn.connect(\"tween_complete\", get_parent(), \"remove_block\", [self])\n\nfunc _ready():\n\tif get_tree().get_root().has_node(\"EditorSpatial\"):\n\t\teditor = get_tree().get_root().get_node(\"EditorSpatial\")\n\tset_ray_pickable(true)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"9bf715a1397a27ee0c282e017b855e702d6e23c8","subject":"Player position limited to circle","message":"Player position limited to circle\n","repos":"BK-TN\/IncendiumGame","old_file":"incendium\/scripts\/Player.gd","new_file":"incendium\/scripts\/Player.gd","new_contents":"\nextends Node2D\n\nconst SPEED = 420 \/1.42\nconst FIRE_TIME = 0.05\n\nexport var polar_controls = false\nvar angle = 0\nvar dist = 200\nvar bullet_p = preload(\"res:\/\/objects\/Bullet.tscn\")\nvar fire_timer = 0\n\nvar hits = 0\n\nfunc _ready():\n\tset_process(true)\n\nfunc _process(delta):\n\tif Input.is_key_pressed(KEY_LEFT):\n\t\tif polar_controls:\n\t\t\tangle += (delta \/ dist) * SPEED\n\t\telse:\n\t\t\ttranslate(Vector2(-delta,0) * SPEED)\n\tif Input.is_key_pressed(KEY_RIGHT):\n\t\tif polar_controls:\n\t\t\tangle -= (delta \/ dist) * SPEED\n\t\telse:\n\t\t\ttranslate(Vector2(delta,0) * SPEED)\n\tif Input.is_key_pressed(KEY_UP):\n\t\tif polar_controls:\n\t\t\tdist -= delta * SPEED\n\t\t\tif dist < 0.1: dist = 0.1\n\t\telse:\n\t\t\ttranslate(Vector2(0,-delta) * SPEED)\n\tif Input.is_key_pressed(KEY_DOWN):\n\t\tif polar_controls:\n\t\t\tdist += delta * SPEED \n\t\telse:\n\t\t\ttranslate(Vector2(0,delta) * SPEED)\n\t\n\tvar center = Vector2(720\/2,720\/2)\n\t\n\tif polar_controls:\n\t\tset_pos(center + Vector2(cos(angle),sin(angle)) * dist)\n\n\tvar towards_center = (center - get_pos()).normalized()\n\t\n\tif fire_timer > 0:\n\t\tfire_timer -= delta\n\t\n\tif (Input.is_key_pressed(KEY_SPACE) or Input.is_key_pressed(KEY_F)) and fire_timer <= 0:\n\t\tvar bullet = bullet_p.instance()\n\t\tbullet.set_pos(get_pos())\n\t\tbullet.velocity = towards_center * 800\n\t\tget_tree().get_root().add_child(bullet)\n\t\tfire_timer = FIRE_TIME\n\n\tset_rot(atan2(towards_center.x,towards_center.y) - PI\/2)\n\t\n\t# Limit position to circle\n\tif center.distance_to(get_pos()) > 720\/2:\n\t\tset_pos((get_pos() - center).normalized() * 720\/2 + center)\n\nfunc _on_RegularPolygon_area_enter( area ):\n\tget_node(\"RegularPolygon\/Polygon2D\").set_color(Color(0,1,0))\n\tif area.get_groups().has(\"damage_player\"):\n\t\tarea.get_parent().queue_free()\n\t\tvar size = area.size\n\t\thits += size\n\t\tget_node(\"..\/Label\").set_text(\"Hits: \" + str(hits))\n\nfunc _on_RegularPolygon_area_exit( area ):\n\tget_node(\"RegularPolygon\/Polygon2D\").set_color(Color(1,1,1))\n","old_contents":"\nextends Node2D\n\nconst SPEED = 420 \/1.42\nconst FIRE_TIME = 0.05\n\nexport var polar_controls = false\nvar angle = 0\nvar dist = 200\nvar bullet_p = preload(\"res:\/\/objects\/Bullet.tscn\")\nvar fire_timer = 0\n\nvar hits = 0\n\nfunc _ready():\n\tset_process(true)\n\nfunc _process(delta):\n\tif Input.is_key_pressed(KEY_LEFT):\n\t\tif polar_controls:\n\t\t\tangle += (delta \/ dist) * SPEED\n\t\telse:\n\t\t\ttranslate(Vector2(-delta,0) * SPEED)\n\tif Input.is_key_pressed(KEY_RIGHT):\n\t\tif polar_controls:\n\t\t\tangle -= (delta \/ dist) * SPEED\n\t\telse:\n\t\t\ttranslate(Vector2(delta,0) * SPEED)\n\tif Input.is_key_pressed(KEY_UP):\n\t\tif polar_controls:\n\t\t\tdist -= delta * SPEED\n\t\t\tif dist < 0.1: dist = 0.1\n\t\telse:\n\t\t\ttranslate(Vector2(0,-delta) * SPEED)\n\tif Input.is_key_pressed(KEY_DOWN):\n\t\tif polar_controls:\n\t\t\tdist += delta * SPEED \n\t\telse:\n\t\t\ttranslate(Vector2(0,delta) * SPEED)\n\t\n\tvar center = Vector2(720\/2,720\/2)\n\t\n\tif polar_controls:\n\t\tset_pos(center + Vector2(cos(angle),sin(angle)) * dist)\n\n\tvar towards_center = (center - get_pos()).normalized()\n\t\n\tif fire_timer > 0:\n\t\tfire_timer -= delta\n\t\n\tif (Input.is_key_pressed(KEY_SPACE) or Input.is_key_pressed(KEY_F)) and fire_timer <= 0:\n\t\tvar bullet = bullet_p.instance()\n\t\tbullet.set_pos(get_pos())\n\t\tbullet.velocity = towards_center * 800\n\t\tget_tree().get_root().add_child(bullet)\n\t\tfire_timer = FIRE_TIME\n\n\tset_rot(atan2(towards_center.x,towards_center.y) - PI\/2)\n\nfunc _on_RegularPolygon_area_enter( area ):\n\tget_node(\"RegularPolygon\/Polygon2D\").set_color(Color(0,1,0))\n\tif area.get_groups().has(\"damage_player\"):\n\t\tarea.get_parent().queue_free()\n\t\tvar size = area.size\n\t\thits += size\n\t\tget_node(\"..\/Label\").set_text(\"Hits: \" + str(hits))\n\nfunc _on_RegularPolygon_area_exit( area ):\n\tget_node(\"RegularPolygon\/Polygon2D\").set_color(Color(1,1,1))\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"730b27f28b4fa8fdf40fd6177b2888468490b06d","subject":"cleaning code a little","message":"cleaning code a little\n","repos":"MartiniMoe\/Amal,MartiniMoe\/handala","old_file":"scripts\/scene.gd","new_file":"scripts\/scene.gd","new_contents":"extends Navigation2D\n\n# Member variables\nconst SPEED = 100.0\nconst TALK_DISTANCE = 50\n\nexport var scale_enabled = false\nexport var scale_factor = 500\n\nvar npc_clicked = null\n\nvar begin = Vector2()\nvar end = Vector2()\nvar path = []\n\nvar left_corner = Vector2(110,1084)\nvar right_corner = Vector2(1748,1084)\n\nvar mouseOver = null\n\n\nfunc _process(delta):\n\tif (path.size() > 1):\n\t\tvar to_walk = delta*SPEED\n\t\t\n\t\tif !get_node(\"player\/AnimationPlayer\").is_playing():\n\t\t\tget_node(\"player\/AnimationPlayer\").play(\"walk\")\n\t\tscale_player()\n\t\t\n\t\twhile(to_walk > 0 and path.size() >= 2):\n\t\t\tvar pfrom = path[path.size() - 1]\n\t\t\tvar pto = path[path.size() - 2]\n\t\t\tvar d = pfrom.distance_to(pto)\n\t\t\tif (d <= to_walk):\n\t\t\t\tpath.remove(path.size() - 1)\n\t\t\t\tto_walk -= d\n\t\t\telse:\n\t\t\t\tpath[path.size() - 1] = pfrom.linear_interpolate(pto, to_walk\/d)\n\t\t\t\tto_walk = 0\n\t\t\n\t\tvar atpos = path[path.size() - 1]\n\t\tget_node(\"player\").set_pos(atpos)\n\t\t\n\t\tif (path.size() < 2):\n\t\t\tpath = []\n\t\t\tget_node(\"player\/AnimationPlayer\").seek(0.0, true)\n\t\t\tget_node(\"player\/AnimationPlayer\").stop_all()\n\t\t\tset_process(false)\n\t\t\tvar npc_near = check_npc_near()\n\t\t\tif (npc_near != null && npc_clicked != null) && (npc_clicked == npc_near):\n\t\t\t\t\tnpc_clicked.show_dialogue()\n\t\t\t\n\t\t\tif get_node(\"player\/Area2D\").get_overlapping_areas().size() > 0:\n\t\t\t\tget_node(\"player\/Area2D\").get_overlapping_areas()[0].teleport()\n\telse:\n\t\tset_process(false)\n\n\n\nfunc check_npc_clicked(clickPos):\n\tvar character = get_node(\"player\")\n\tfor npc in get_children():\n\t\tif npc.is_in_group(\"npc_dialogue\"):\n\t\t\tvar npc_x = npc.get_pos().x\n\t\t\tvar npc_y = npc.get_pos().y\n\t\t\tvar npc_width = npc.get_region_rect().size.x\n\t\t\tvar npc_height = npc.get_region_rect().size.y\n\t\t\tif (clickPos.x > (npc_x - npc_width\/2) && clickPos.x < (npc_x + npc_width\/2)):\n\t\t\t\tif (clickPos.y > (npc_y - npc_height\/2) && clickPos.y < (npc_y + npc_height\/2)):\n\t\t\t\t\treturn npc\n\t\t\tnpc.hide_dialogue()\n\treturn null\n\nfunc check_npc_near():\n\tvar character = get_node(\"player\")\n\tfor npc in get_children():\n\t\tif npc.is_in_group(\"npc_dialogue\"):\n\t\t\tvar npc_x = npc.get_pos().x\n\t\t\tvar npc_y = npc.get_pos().y\n\t\t\tvar npc_width = npc.get_region_rect().size.x\n\t\t\tvar npc_height = npc.get_region_rect().size.y\n\t\t\tif character.get_pos().x > (npc_x - npc_width\/2 - TALK_DISTANCE) && character.get_pos().x < (npc_x + npc_width\/2 + TALK_DISTANCE):\n\t\t\t\tif character.get_pos().y > (npc_y - npc_height\/2 - TALK_DISTANCE) && character.get_pos().y < (npc_y + npc_height\/2 + TALK_DISTANCE):\n\t\t\t\t\treturn npc\n\treturn null\n\n\nfunc _update_path():\n\tvar p = get_simple_path(begin, end, true)\n\tpath = Array(p) # Vector2array too complex to use, convert to regular array\n\tpath.invert()\n\t\n\tset_process(true)\n\n\nfunc _input(event):\n\tif (event.type == InputEvent.MOUSE_BUTTON and event.pressed and event.button_index == 1):\n\t\tbegin = get_node(\"player\").get_pos()\n\t\t\n\t\tnpc_clicked = check_npc_clicked(event.pos - get_pos())\n\t\t\n\t\t# Mouse to local navigation coordinates\n\t\tend = event.pos - get_pos()\n\t\t_update_path()\n\nfunc scale_player():\n\tif scale_enabled:\n\t\tvar scale = log(get_node(\"player\").get_pos().y\/scale_factor)\n\t\tget_node(\"player\").set_scale(Vector2(scale, scale))\n\nfunc set_playerPos_left():\n\tget_node(\"player\").set_pos(left_corner)\n\nfunc set_playerPos_right():\n\tget_node(\"player\").set_pos(right_corner)\n\n\nfunc _ready():\n\tscale_player()\n\tfor npc in get_children():\n\t\tif npc.is_in_group(\"npc_dialogue\"):\n\t\t\tnpc.hide_dialogue()\n\tset_process_input(true)\n\n","old_contents":"extends Navigation2D\n\n# Member variables\nconst SPEED = 100.0\nconst TALK_DISTANCE = 50\n\nexport var scale_enabled = false\nexport var scale_factor = 500\n\nvar npc_clicked = null\n\nvar begin = Vector2()\nvar end = Vector2()\nvar path = []\n\nvar left_corner = Vector2(110,1084)\nvar right_corner = Vector2(1748,1084)\n\nvar mouseOver = null\n\n\nfunc _process(delta):\n\tif (path.size() > 1):\n\t\tvar to_walk = delta*SPEED\n\t\t\n\t\tif !get_node(\"player\/AnimationPlayer\").is_playing():\n\t\t\t#get_node(\"player\/AnimationPlayer\").get_animation(\"walk\").set_loop(true)\n\t\t\tget_node(\"player\/AnimationPlayer\").play(\"walk\")\n\t\tscale_player()\n\t\t\n\t\twhile(to_walk > 0 and path.size() >= 2):\n\t\t\tvar pfrom = path[path.size() - 1]\n\t\t\tvar pto = path[path.size() - 2]\n\t\t\tvar d = pfrom.distance_to(pto)\n\t\t\tif (d <= to_walk):\n\t\t\t\tpath.remove(path.size() - 1)\n\t\t\t\tto_walk -= d\n\t\t\telse:\n\t\t\t\tpath[path.size() - 1] = pfrom.linear_interpolate(pto, to_walk\/d)\n\t\t\t\tto_walk = 0\n\t\t\n\t\tvar atpos = path[path.size() - 1]\n\t\tget_node(\"player\").set_pos(atpos)\n\t\t\n\t\tif (path.size() < 2):\n\t\t\tpath = []\n\t\t\t#get_node(\"player\/AnimationPlayer\").get_animation(\"walk\").set_loop(false)\n\t\t\tget_node(\"player\/AnimationPlayer\").seek(0.0, true)\n\t\t\tget_node(\"player\/AnimationPlayer\").stop_all()\n\t\t\tset_process(false)\n\t\t\tvar npc_near = check_npc_near()\n\t\t\tif (npc_near != null && npc_clicked != null) && (npc_clicked == npc_near):\n\t\t\t\t\tnpc_clicked.show_dialogue()\n\t\t\t\n\t\t\tif get_node(\"player\/Area2D\").get_overlapping_areas().size() > 0:\n\t\t\t\tget_node(\"player\/Area2D\").get_overlapping_areas()[0].teleport()\n\t\t\t\n#\t\t\tif scene_right != null && scene_right != \"\" && get_node(\"player\").get_pos().x > 1900:\n#\t\t\t\ttransition.fade_to(scene_right)\n#\t\t\tif scene_top != null && scene_top != \"\" && get_node(\"player\").get_pos().y < 720:\n#\t\t\t\ttransition.fade_to(scene_top)\n\telse:\n\t\tset_process(false)\n\n\n\nfunc check_npc_clicked(clickPos):\n\tvar character = get_node(\"player\")\n\tfor npc in get_children():\n\t\tif npc.is_in_group(\"npc_dialogue\"):\n\t\t\tvar npc_x = npc.get_pos().x\n\t\t\tvar npc_y = npc.get_pos().y\n\t\t\tvar npc_width = npc.get_region_rect().size.x\n\t\t\tvar npc_height = npc.get_region_rect().size.y\n\t\t\tif (clickPos.x > (npc_x - npc_width\/2) && clickPos.x < (npc_x + npc_width\/2)):\n\t\t\t\tif (clickPos.y > (npc_y - npc_height\/2) && clickPos.y < (npc_y + npc_height\/2)):\n\t\t\t\t\treturn npc\n\t\t\tnpc.hide_dialogue()\n\treturn null\n\nfunc check_npc_near():\n\tvar character = get_node(\"player\")\n\tfor npc in get_children():\n\t\tif npc.is_in_group(\"npc_dialogue\"):\n\t\t\tvar npc_x = npc.get_pos().x\n\t\t\tvar npc_y = npc.get_pos().y\n\t\t\tvar npc_width = npc.get_region_rect().size.x\n\t\t\tvar npc_height = npc.get_region_rect().size.y\n\t\t\tif character.get_pos().x > (npc_x - npc_width\/2 - TALK_DISTANCE) && character.get_pos().x < (npc_x + npc_width\/2 + TALK_DISTANCE):\n\t\t\t\tif character.get_pos().y > (npc_y - npc_height\/2 - TALK_DISTANCE) && character.get_pos().y < (npc_y + npc_height\/2 + TALK_DISTANCE):\n\t\t\t\t\treturn npc\n\treturn null\n\n\nfunc _update_path():\n\tvar p = get_simple_path(begin, end, true)\n\tpath = Array(p) # Vector2array too complex to use, convert to regular array\n\tpath.invert()\n\t\n\tset_process(true)\n\n\nfunc _input(event):\n\tif (event.type == InputEvent.MOUSE_BUTTON and event.pressed and event.button_index == 1):\n\t\tbegin = get_node(\"player\").get_pos()\n\t\t\n\t\tnpc_clicked = check_npc_clicked(event.pos - get_pos())\n\t\t\n\t\t# Mouse to local navigation coordinates\n\t\tend = event.pos - get_pos()\n\t\t_update_path()\n\t\"\"\"if(event.type == InputEvent.MOUSE_MOTION):\n\t\tmouseOver = check_mouseover(event.pos)\n\t\tif mouseOver:\n\t\t\tget_node(\"enterScene\").show()\n\t\telse:\n\t\t\tget_node(\"enterScene\").hide()\"\"\"\n\nfunc scale_player():\n\tif scale_enabled:\n\t\tvar scale = log(get_node(\"player\").get_pos().y\/scale_factor)\n\t\tget_node(\"player\").set_scale(Vector2(scale, scale))\n\nfunc set_playerPos_left():\n\tget_node(\"player\").set_pos(left_corner)\n\nfunc set_playerPos_right():\n\tget_node(\"player\").set_pos(right_corner)\n\n\nfunc _ready():\n\tscale_player()\n\tfor npc in get_children():\n\t\tif npc.is_in_group(\"npc_dialogue\"):\n\t\t\tnpc.hide_dialogue()\n\tset_process_input(true)\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"f4c261f8f7d0bca562e83352f2f2de9bcce5c226","subject":"Added attach\/detach to objects","message":"Added attach\/detach to objects\n","repos":"P1X-in\/rat-is-fat","old_file":"scripts\/object.gd","new_file":"scripts\/object.gd","new_contents":"var bag\n\nvar hp\nvar max_hp\n\nvar avatar\nvar is_processing = false\nvar initial_position = Vector2(0, 0)\nvar push_back = false\n\nfunc _init(bag):\n self.bag = bag\n self.max_hp = 10\n self.hp = 10\n\n\nfunc get_hp():\n return self.hp\n\nfunc set_hp(hp):\n if hp <= 0:\n self.die()\n else:\n if hp <= self.max_hp:\n self.hp = hp\n else:\n self.hp = self.max_hp\n\nfunc get_pos():\n return self.avatar.get_pos()\n\nfunc get_screen_pos():\n var position = self.get_pos()\n var global_x = position.x \/ self.bag.camera.zoom.x\n var global_y = position.y \/ self.bag.camera.zoom.y\n return Vector2(global_x, global_y)\n\nfunc spawn(position):\n self.attach()\n self.initial_position = position\n self.avatar.set_pos(self.initial_position)\n\nfunc despawn():\n self.detach()\n self.avatar.queue_free()\n\nfunc attach():\n self.is_processing = true\n self.bag.action_controller.attach_object(self.avatar)\n\nfunc detach():\n self.is_processing = false\n self.bag.action_controller.detach_object(self.avatar)\n\nfunc die():\n self.is_processing = false\n self.despawn()\n\nfunc calculate_distance_to_object(moving_object):\n return self.calculate_distance(moving_object.get_pos())\n\nfunc calculate_distance(their_position):\n var my_position = self.get_pos()\n var delta_x = abs(my_position.x) - abs(their_position.x)\n var delta_y = abs(my_position.y) - abs(their_position.y)\n\n return sqrt(delta_x * delta_x + delta_y * delta_y)\n\nfunc recieve_damage(damage):\n self.set_hp(self.hp - damage)\n\n\n","old_contents":"var bag\n\nvar hp\nvar max_hp\n\nvar avatar\nvar is_processing = false\nvar initial_position = Vector2(0, 0)\nvar push_back = false\n\nfunc _init(bag):\n self.bag = bag\n self.max_hp = 10\n self.hp = 10\n\n\nfunc get_hp():\n return self.hp\n\nfunc set_hp(hp):\n if hp <= 0:\n self.die()\n else:\n if hp <= self.max_hp:\n self.hp = hp\n else:\n self.hp = self.max_hp\n\nfunc get_pos():\n return self.avatar.get_pos()\n\nfunc get_screen_pos():\n var position = self.get_pos()\n var global_x = position.x \/ self.bag.camera.zoom.x\n var global_y = position.y \/ self.bag.camera.zoom.y\n return Vector2(global_x, global_y)\n\nfunc spawn(position):\n self.is_processing = true\n self.initial_position = position\n self.bag.action_controller.attach_object(self.avatar)\n self.avatar.set_pos(self.initial_position)\n\nfunc despawn():\n self.bag.action_controller.detach_object(self.avatar)\n self.avatar.queue_free()\n\nfunc die():\n self.is_processing = false\n self.despawn()\n\nfunc calculate_distance_to_object(moving_object):\n return self.calculate_distance(moving_object.get_pos())\n\nfunc calculate_distance(their_position):\n var my_position = self.get_pos()\n var delta_x = abs(my_position.x) - abs(their_position.x)\n var delta_y = abs(my_position.y) - abs(their_position.y)\n\n return sqrt(delta_x * delta_x + delta_y * delta_y)\n\nfunc recieve_damage(damage):\n self.set_hp(self.hp - damage)\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"4646a80f419c17d92c0267f351152624bf6e9a2f","subject":"Move leds.gd","message":"Move leds.gd\n","repos":"Cytrill\/srvr","old_file":"leds.gd","new_file":"leds.gd","new_contents":"","old_contents":"extends Node\n\nfunc set_led(js, led, red, green, blue, brightness):\n\tvar data = RawArray()\n\n\tdata.push_back(0x20 + led)\n\tdata.push_back(red)\n\tdata.push_back(green)\n\tdata.push_back(blue)\n\tdata.push_back(green)\n\tdata.push_back(0x20 + led)\n\n\tvar udp = PacketPeerUDP.new()\n\n\tvar host = Input.get_joy_name(js)\n\tvar port = 1337\n\n\tvar status = udp.set_send_address(host, port)\n\n\tif status == OK:\n\t\tudp.put_packet(data)\n\t\n\tudp.close()\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"GDScript"} {"commit":"7937f83ce2ee8408faec750ba7232264c9f74dbd","subject":"Comment out some now unused code","message":"Comment out some now unused code\n","repos":"mvr\/abyme","old_file":"Block.gd","new_file":"Block.gd","new_contents":"extends Node2D\n\n################################################################################\n### Vars\n\n# Gameplay\nonready var tilemap = self.get_node(\"TileMap\")\nenum TILES {TILE_EMPTY, TILE_WALL}\n\nexport(NodePath) var parent_block_path = null\nexport(Vector2) var position_on_parent = Vector2(0, 0)\nexport(bool) var is_player = false\n\nvar parent_block = null\nvar child_blocks = []\n\n# Movement animation\nvar is_moving = false\nvar move_vector = Vector2(0.0, 0.0)\nvar previous_parent = null\nvar previous_position_on_parent = self.position_on_parent\n\nvar current_move_time = 0\n\n# Drawing\nonready var viewport = self.get_node(\"SelfViewport\")\nonready var self_rect = self.get_self_rect()\n\n################################################################################\n### Setup\n\nfunc _ready():\n\t# Add to block group\n\tself.add_to_group(\"blocks\")\n\n\t# Setup viewport\n\tviewport.set_world_2d(self.get_world_2d())\n\tviewport.set_rect(self.self_rect)\n\t#viewport.set_size_override(true, self.self_rect.size)\n\t#viewport.set_size_override_stretch(true)\n\tvar transform = Matrix32(0, -self.self_rect.pos)\n\tviewport.set_canvas_transform(transform)\n\n\tself.set_fixed_process(true)\n\n\n################################################################################\n### Parents and Siblings\n\nfunc find_children():\n\tvar all_blocks = get_tree().get_nodes_in_group(\"blocks\")\n\tvar child_blocks = []\n\tfor b in all_blocks:\n\t\tif b.parent_block == self:\n\t\t\tchild_blocks.append(b)\n\treturn child_blocks\n\nfunc set_child_blocks():\n\tself.child_blocks = self.find_children()\n\nfunc find_parent_block():\n\tself.parent_block = self.get_node(self.parent_block_path)\n\tself.previous_parent = self.parent_block\n\n################################################################################\n### Block position\n# Represents a square in the world\n\nclass BlockPosition:\n\tvar block = null\n\tvar position = Vector2(0, 0)\n\n\tfunc _init(b, p):\n\t\tself.block = b\n\t\tself.position = p\n\n\tfunc get_tile_id():\n\t\treturn self.block.tilemap.get_cell(self.position.x, self.position.y)\n\n\tfunc adjacent(move_vect):\n\t\treturn adjacent_recurse(move_vect, self.block)\n\n\tfunc adjacent_recurse(move_vect, original):\n\t\tvar newpos = self.position + move_vect\n\n\t\tif newpos.x < 0:\n\t\t\tnewpos.x = Constants.block_size - 1\n\t\telif newpos.x >= Constants.block_size:\n\t\t\tnewpos.x = 0\n\t\telif newpos.y < 0:\n\t\t\tnewpos.y = Constants.block_size - 1\n\t\telif newpos.y >= Constants.block_size:\n\t\t\tnewpos.y = 0\n\t\telse:\n\t\t\treturn get_script().new(self.block, newpos)\n\n\t\t# We left the block\n\n\t\tif self.block.parent_block == original:\n\t\t\treturn null\n\n\t\tvar newsquare = self.block.own_position().adjacent_recurse(move_vect, original)\n\n\t\tif newsquare == null:\n\t\t\treturn null\n\n\t\tvar newblock = newsquare.block_at()\n\n\t\tif newblock == null:\n\t\t\treturn null\n\n\t\treturn get_script().new(newblock, newpos)\n\n\tfunc is_underlying_walkable():\n\t\treturn self.get_tile_id() == TILE_EMPTY\n\n\tfunc block_at():\n\t\tfor b in self.block.child_blocks:\n\t\t\tif b.position_on_parent == self.position:\n\t\t\t\treturn b\n\t\treturn null\n\n\tfunc is_empty():\n\t\tif not self.is_underlying_walkable():\n\t\t\treturn false\n\n\t\tif not self.block_at() == null:\n\t\t\treturn false\n\n\t\treturn true\n\nfunc own_position():\n\treturn BlockPosition.new(parent_block, position_on_parent)\n\n# func adjacent_blocks():\n# \treturn adjacent_blocks_with_displacement().keys()\n\n# func adjacent_blocks_with_displacement():\n# \tvar adjacents = {}\n# \tvar a = null\n\n# \ta = self.own_position().adjacent(\"left\")\n# \tif not a == null:\n# \t\tvar b = a.block_at()\n# \t\tif not b == null:\n# \t\t\tadjacents[b] = Vector2(-1, 0)\n\n# \ta = self.own_position().adjacent(\"right\")\n# \tif not a == null:\n# \t\tvar b = a.block_at()\n# \t\tif not b == null:\n# \t\t\tadjacents[b] = Vector2(1, 0)\n\n# \ta = self.own_position().adjacent(\"up\")\n# \tif not a == null:\n# \t\tvar b = a.block_at()\n# \t\tif not b == null:\n# \t\t\tadjacents[b] = Vector2(0, -1)\n\n# \ta = self.own_position().adjacent(\"down\")\n# \tif not a == null:\n# \t\tvar b = a.block_at()\n# \t\tif not b == null:\n# \t\t\tadjacents[b] = Vector2(0, 1)\n\n# \treturn adjacents\n\n################################################################################\n### Drawing\n\nfunc get_self_rect():\n\tvar pos = tilemap.get_global_pos()\n\t# TODO: scale?\n\tvar s = Constants.block_size * tilemap.get_cell_size()\n\treturn Rect2(pos, s)\n\nfunc visual_position_on_parent():\n\tif self.is_moving:\n\t\tvar t = easing_function(self.current_move_time \/ Constants.move_duration)\n\n\t\treturn interpolate(t, self.position_on_parent - self.move_vector, self.position_on_parent)\n\telse:\n\t\treturn self.position_on_parent\n\nfunc draw_self_texture_on(block, position):\n\tvar texture = self.viewport.get_render_target_texture()\n\n\tvar to_parent_transform = block.get_global_transform() * self.get_global_transform().affine_inverse()\n\n\tvar cell_size = self.tilemap.get_cell_size() # TODO: self?\n\tvar drawrect = Rect2(position, cell_size)\n\n\tself.draw_set_transform_matrix(to_parent_transform)\n\tself.draw_texture_rect(texture, drawrect, false)\n\nfunc _draw(): # TODO: think about clearing the render target every frame\n\t# Border\n\t# var s = Constants.block_size * tilemap.get_cell_size().x\n\t# var grey = Color(0.5, 0.5, 0.5)\n\t# self.draw_line(Vector2(0, 0), Vector2(0, s), grey, 1)\n\t# self.draw_line(Vector2(0, s), Vector2(s, s), grey, 1)\n\t# self.draw_line(Vector2(s, s), Vector2(s, 0), grey, 1)\n\t# self.draw_line(Vector2(s, 0), Vector2(0, 0), grey, 1)\n\n\tif self.is_moving:\n\t\tvar t = easing_function(self.current_move_time \/ Constants.move_duration)\n\n\t\tvar newpos = self.parent_block.tilemap.map_to_world(self.position_on_parent)\n\t\tvar oldpos = self.parent_block.tilemap.map_to_world(self.position_on_parent - self.move_vector)\n\n\t\tvar pos = interpolate(t, oldpos, newpos)\n\t\tself.draw_self_texture_on(self.parent_block, pos)\n\n\t\tif not self.previous_parent == self.parent_block:\n\t\t\tvar newpos = self.previous_parent.tilemap.map_to_world(self.previous_position_on_parent + self.move_vector)\n\t\t\tvar oldpos = self.previous_parent.tilemap.map_to_world(self.previous_position_on_parent)\n\n\t\t\tvar pos = interpolate(t, oldpos, newpos)\n\t\t\tself.draw_self_texture_on(self.previous_parent, pos)\n\telse:\n\t\tvar worldcoords = self.parent_block.tilemap.map_to_world(self.position_on_parent)\n\t\tself.draw_self_texture_on(self.parent_block, worldcoords)\n\nfunc interpolate(t, x1, x2):\n\treturn (1-t)*x1 + t*x2\n\nfunc easing_function(t):\n\tvar u0 = 0\n\tvar u1 = 0.2\n\tvar u2 = 0.95\n\tvar u3 = 1\n\treturn u0 * (1-t*t*t) + 3*u1*(1-t*t)*t + 3*u2*(1-t)*t*t + u3*t*t*t*t\n\nfunc _fixed_process(delta):\n\tif self.is_moving:\n\t\tself.current_move_time += delta\n\t\tif self.current_move_time > Constants.move_duration:\n\t\t\tself.is_moving = false\n\t\t\tself.current_move_time = 0\n\n\t\tself.update()\n\n################################################################################\n### Movement\n\nfunc try_move(move_vect):\n\tif self.is_moving:\n\t\treturn\n\n\tvar a = self.own_position().adjacent(move_vect)\n\tif a == null:\n\t\treturn\n\n\tif a.is_empty():\n\t\tdo_move(move_vect, a)\n\nfunc do_move(move_vect, new_square):\n\tself.is_moving = true\n\tself.move_vector = move_vect\n\n\tself.previous_parent = self.parent_block\n\tself.previous_position_on_parent = self.position_on_parent\n\n\tself.parent_block = new_square.block\n\tself.position_on_parent = new_square.position\n\n\tif not self.parent_block == self.previous_parent:\n\t\tself.previous_parent.child_blocks.erase(self)\n\t\tself.parent_block.child_blocks.append(self)\n","old_contents":"extends Node2D\n\n################################################################################\n### Vars\n\n# Gameplay\nonready var tilemap = self.get_node(\"TileMap\")\nenum TILES {TILE_EMPTY, TILE_WALL}\n\nexport(NodePath) var parent_block_path = null\nexport(Vector2) var position_on_parent = Vector2(0, 0)\nexport(bool) var is_player = false\n\nvar parent_block = null\nvar child_blocks = []\n\n# Movement animation\nvar is_moving = false\nvar move_vector = Vector2(0.0, 0.0)\nvar previous_parent = null\nvar previous_position_on_parent = self.position_on_parent\n\nvar current_move_time = 0\n\n# Drawing\nonready var viewport = self.get_node(\"SelfViewport\")\nonready var self_rect = self.get_self_rect()\n\n################################################################################\n### Setup\n\nfunc _ready():\n\t# Add to block group\n\tself.add_to_group(\"blocks\")\n\n\t# Setup viewport\n\tviewport.set_world_2d(self.get_world_2d())\n\tviewport.set_rect(self.self_rect)\n\t#viewport.set_size_override(true, self.self_rect.size)\n\t#viewport.set_size_override_stretch(true)\n\tvar transform = Matrix32(0, -self.self_rect.pos)\n\tviewport.set_canvas_transform(transform)\n\n\tself.set_fixed_process(true)\n\n\n################################################################################\n### Parents and Siblings\n\nfunc find_children():\n\tvar all_blocks = get_tree().get_nodes_in_group(\"blocks\")\n\tvar child_blocks = []\n\tfor b in all_blocks:\n\t\tif b.parent_block == self:\n\t\t\tchild_blocks.append(b)\n\treturn child_blocks\n\nfunc set_child_blocks():\n\tself.child_blocks = self.find_children()\n\nfunc find_parent_block():\n\tself.parent_block = self.get_node(self.parent_block_path)\n\tself.previous_parent = self.parent_block\n\n################################################################################\n### Block position\n# Represents a square in the world\n\nclass BlockPosition:\n\tvar block = null\n\tvar position = Vector2(0, 0)\n\n\tfunc _init(b, p):\n\t\tself.block = b\n\t\tself.position = p\n\n\tfunc get_tile_id():\n\t\treturn self.block.tilemap.get_cell(self.position.x, self.position.y)\n\n\tfunc adjacent(move_vect):\n\t\treturn adjacent_recurse(move_vect, self.block)\n\n\tfunc adjacent_recurse(move_vect, original):\n\t\tvar newpos = self.position + move_vect\n\n\t\tif newpos.x < 0:\n\t\t\tnewpos.x = Constants.block_size - 1\n\t\telif newpos.x >= Constants.block_size:\n\t\t\tnewpos.x = 0\n\t\telif newpos.y < 0:\n\t\t\tnewpos.y = Constants.block_size - 1\n\t\telif newpos.y >= Constants.block_size:\n\t\t\tnewpos.y = 0\n\t\telse:\n\t\t\treturn get_script().new(self.block, newpos)\n\n\t\t# We left the block\n\n\t\tif self.block.parent_block == original:\n\t\t\treturn null\n\n\t\tvar newsquare = self.block.own_position().adjacent_recurse(move_vect, original)\n\n\t\tif newsquare == null:\n\t\t\treturn null\n\n\t\tvar newblock = newsquare.block_at()\n\n\t\tif newblock == null:\n\t\t\treturn null\n\n\t\treturn get_script().new(newblock, newpos)\n\n\tfunc is_underlying_walkable():\n\t\treturn self.get_tile_id() == TILE_EMPTY\n\n\tfunc block_at():\n\t\tfor b in self.block.child_blocks:\n\t\t\tif b.position_on_parent == self.position:\n\t\t\t\treturn b\n\t\treturn null\n\n\tfunc is_empty():\n\t\tif not self.is_underlying_walkable():\n\t\t\treturn false\n\n\t\tif not self.block_at() == null:\n\t\t\treturn false\n\n\t\treturn true\n\nfunc own_position():\n\treturn BlockPosition.new(parent_block, position_on_parent)\n\nfunc adjacent_blocks():\n\treturn adjacent_blocks_with_displacement().keys()\n\nfunc adjacent_blocks_with_displacement():\n\tvar adjacents = {}\n\tvar a = null\n\n\ta = self.own_position().adjacent(\"left\")\n\tif not a == null:\n\t\tvar b = a.block_at()\n\t\tif not b == null:\n\t\t\tadjacents[b] = Vector2(-1, 0)\n\n\ta = self.own_position().adjacent(\"right\")\n\tif not a == null:\n\t\tvar b = a.block_at()\n\t\tif not b == null:\n\t\t\tadjacents[b] = Vector2(1, 0)\n\n\ta = self.own_position().adjacent(\"up\")\n\tif not a == null:\n\t\tvar b = a.block_at()\n\t\tif not b == null:\n\t\t\tadjacents[b] = Vector2(0, -1)\n\n\ta = self.own_position().adjacent(\"down\")\n\tif not a == null:\n\t\tvar b = a.block_at()\n\t\tif not b == null:\n\t\t\tadjacents[b] = Vector2(0, 1)\n\n\treturn adjacents\n\n################################################################################\n### Drawing\n\nfunc get_self_rect():\n\tvar pos = tilemap.get_global_pos()\n\t# TODO: scale?\n\tvar s = Constants.block_size * tilemap.get_cell_size()\n\treturn Rect2(pos, s)\n\nfunc visual_position_on_parent():\n\tif self.is_moving:\n\t\tvar t = easing_function(self.current_move_time \/ Constants.move_duration)\n\n\t\treturn interpolate(t, self.position_on_parent - self.move_vector, self.position_on_parent)\n\telse:\n\t\treturn self.position_on_parent\n\nfunc draw_self_texture_on(block, position):\n\tvar texture = self.viewport.get_render_target_texture()\n\n\tvar to_parent_transform = block.get_global_transform() * self.get_global_transform().affine_inverse()\n\n\tvar cell_size = self.tilemap.get_cell_size() # TODO: self?\n\tvar drawrect = Rect2(position, cell_size)\n\n\tself.draw_set_transform_matrix(to_parent_transform)\n\tself.draw_texture_rect(texture, drawrect, false)\n\nfunc _draw(): # TODO: think about clearing the render target every frame\n\t# Border\n\t# var s = Constants.block_size * tilemap.get_cell_size().x\n\t# var grey = Color(0.5, 0.5, 0.5)\n\t# self.draw_line(Vector2(0, 0), Vector2(0, s), grey, 1)\n\t# self.draw_line(Vector2(0, s), Vector2(s, s), grey, 1)\n\t# self.draw_line(Vector2(s, s), Vector2(s, 0), grey, 1)\n\t# self.draw_line(Vector2(s, 0), Vector2(0, 0), grey, 1)\n\n\tif self.is_moving:\n\t\tvar t = easing_function(self.current_move_time \/ Constants.move_duration)\n\n\t\tvar newpos = self.parent_block.tilemap.map_to_world(self.position_on_parent)\n\t\tvar oldpos = self.parent_block.tilemap.map_to_world(self.position_on_parent - self.move_vector)\n\n\t\tvar pos = interpolate(t, oldpos, newpos)\n\t\tself.draw_self_texture_on(self.parent_block, pos)\n\n\t\tif not self.previous_parent == self.parent_block:\n\t\t\tvar newpos = self.previous_parent.tilemap.map_to_world(self.previous_position_on_parent + self.move_vector)\n\t\t\tvar oldpos = self.previous_parent.tilemap.map_to_world(self.previous_position_on_parent)\n\n\t\t\tvar pos = interpolate(t, oldpos, newpos)\n\t\t\tself.draw_self_texture_on(self.previous_parent, pos)\n\telse:\n\t\tvar worldcoords = self.parent_block.tilemap.map_to_world(self.position_on_parent)\n\t\tself.draw_self_texture_on(self.parent_block, worldcoords)\n\nfunc interpolate(t, x1, x2):\n\treturn (1-t)*x1 + t*x2\n\nfunc easing_function(t):\n\tvar u0 = 0\n\tvar u1 = 0.2\n\tvar u2 = 0.95\n\tvar u3 = 1\n\treturn u0 * (1-t*t*t) + 3*u1*(1-t*t)*t + 3*u2*(1-t)*t*t + u3*t*t*t*t\n\nfunc _fixed_process(delta):\n\tif self.is_moving:\n\t\tself.current_move_time += delta\n\t\tif self.current_move_time > Constants.move_duration:\n\t\t\tself.is_moving = false\n\t\t\tself.current_move_time = 0\n\n\t\tself.update()\n\n################################################################################\n### Movement\n\nfunc try_move(move_vect):\n\tif self.is_moving:\n\t\treturn\n\n\tvar a = self.own_position().adjacent(move_vect)\n\tif a == null:\n\t\treturn\n\n\tif a.is_empty():\n\t\tdo_move(move_vect, a)\n\nfunc do_move(move_vect, new_square):\n\tself.is_moving = true\n\tself.move_vector = move_vect\n\n\tself.previous_parent = self.parent_block\n\tself.previous_position_on_parent = self.position_on_parent\n\n\tself.parent_block = new_square.block\n\tself.position_on_parent = new_square.position\n\n\tif not self.parent_block == self.previous_parent:\n\t\tself.previous_parent.child_blocks.erase(self)\n\t\tself.parent_block.child_blocks.append(self)\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"GDScript"} {"commit":"cc00e3eccb2b99bc0952916745c7d84df3c2f4c3","subject":"use toNode","message":"use toNode\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/sean_tests.gd","new_file":"src\/scripts\/sean_tests.gd","new_contents":"extends \"res:\/\/scripts\/gut.gd\".Test\n\nvar puzzleManScript = load(\"res:\/\/scripts\/PuzzleManager.gd\")\n\nfunc setup():\n\tgut.p(\"ran setup\", 2)\n\nfunc teardown():\n\tgut.p(\"ran teardown\")\n\nfunc test_assert_eq_block_name_is_equal():\n\tvar pMan = puzzleManScript.new()\n\tvar pickle = pMan.PickledBlock.new()\n\tpickle.setName(\"TestPickledBlock\")\n\tvar node = pickle.toNode()\n\tgut.assert_eq(node.name, 'TestPickledBlock', \"Should pass\")\n","old_contents":"extends \"res:\/\/scripts\/gut.gd\".Test\n\nvar puzzleManScript = load(\"res:\/\/scripts\/PuzzleManager.gd\")\n\nfunc setup():\n\tgut.p(\"ran setup\", 2)\n\nfunc teardown():\n\tgut.p(\"ran teardown\")\n\nfunc test_assert_eq_number_is_equal():\n\tvar pMan = puzzleManScript.new()\n\tvar pickle = pMan.PickledBlock.new()\n\tgut.assert_eq('asf', 'asdf', \"Should pass\")\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"e5951daa08a5ee5e510bfeba65ea940c96b2187b","subject":"changed blocks to be a dictionary mapping positions to blocks","message":"changed blocks to be a dictionary mapping positions to blocks\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/PuzzleManager.gd","new_file":"src\/scripts\/PuzzleManager.gd","new_contents":"const DIFF_EASY\t\t= 0\nconst DIFF_MEDIUM\t= 1\nconst DIFF_HARD\t\t= 2\n\n# this order is important\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\nconst SOLVER_ERROR_NONE\t\t\t\t= 0\nconst SOLVER_ERROR_MISSING_PAIR\t\t= 1\n\nconst blockColors = [\"Blue\", \"Orange\", \"Red\", \"Yellow\", \"Purple\", \"Green\"]\n\n# Preload paired blocks\nconst blockScn = preload( \"res:\/\/blocks\/block.scn\" )\nconst blockScripts = [ preload( \"Blocks\/LaserBlock.gd\" )\n\t\t\t \t , preload( \"Blocks\/WildBlock.gd\" )\n\t\t\t \t , preload( \"Blocks\/PairedBlock.gd\" )\n\t\t\t \t , preload( \"Blocks\/LaserBlock.gd\" )\n\t\t\t \t ]\n\n# Hash map of all possible positions\nvar shape = {}\n\n# Calculates the layer that a block is on.\nstatic func calcBlockLayer( x, y, z ):\n\treturn max( max( abs( x ), abs( y ) ), abs( z ) )\n# THIS IS EVERYWHERE, ANY BETTER WAY TO HAVE FUNCTIONS BETWEEN SCRIPTS?\nstatic func calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n# Stores a puzzle in a convenient class.\nclass Puzzle:\n\n\tvar puzzleName\t\t\t# The name of the puzzle.\n\tvar puzzleLayers\t\t# The amount of layers the puzzle has.\n\tvar pairCount = []\t\t# The amount of pair blocks on each layer.\n\tvar shape = {}\t\t\t# All blocks indexed by position\n\tvar lasers = []\t\t\t# Laser connections.\n\tvar puzzleMan\t\t\t# Stores the puzzle manager for making pickled blocks.\n\n\t# Converts a puzzle to a dictionary.\n\tfunc toDict():\n\t\tvar blocksArray = []\n\t\tfor k in shape.keys():\n\t\t\tif shape[k] == null:\n\t\t\t\tcontinue\n\t\t\tblocksArray.append(shape[k].toDict())\n\n\t\tvar di = { pN = puzzleName\n\t\t \t , pL = puzzleLayers\n\t\t\t\t , bL = blocksArray\n\t\t\t\t , pC = pairCount\n\t\t\t\t , lS = lasers\n\t\t\t }\n\t\treturn di\n\n\t# Converts a dictionary to a puzzle.\n\tfunc fromDict( di ):\n\t\tpuzzleName = di.pN\n\t\tpuzzleLayers = di.pL\n\t\tpairCount = di.pC\n\t\tlasers = di.lS\n\n\t\tfor block in di.bL:\n\t\t\tvar nb = puzzleMan.PickledBlock.new()\n\t\t\tnb.fromDict( block )\n\t\t\tshape[nb.blockPos] = nb\n\t\treturn\n\n\t# Class that stores a solution or the errors in a puzzle.\n\tclass PuzzleSteps:\n\t\tvar solveable = false\n\t\tvar error = SOLVER_ERROR_NONE\n\t\tvar errorBlock = null\n\t\tvar solveSteps = []\n\n\t# THIS IS EVERYWHERE, ANY BETTER WAY TO HAVE FUNCTIONS BETWEEN SCRIPTS?\n\t# duplicate of the global definition above? Either way godot is chill and\n\t# doesn't complain\n\tfunc calcBlockLayerVec( pos ):\n\t\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n\t# Determines if a puzzle is solveable.\n\tfunc solvePuzzle():\n\t\t# Simply use the solvePuzzleSteps function and return the solveable part.\n\t\tvar ps = self.solvePuzzleSteps()\n\t\treturn ps.solveable\n\n\t# Determines if a puzzle is solveable and returns the steps needed to solve it.\n\tfunc solvePuzzleSteps():\n\t\tvar puzzleSteps = PuzzleSteps.new()\n\n\t\tvar pairs = []\n\n\t\t# Add new dictionary for each later.\n\t\tfor l in range( puzzleLayers + 1 ):\n\t\t\tpairs.append( {} )\n\n\t\t# Gather paired blocks from the puzzle.\n\t\tfor k in shape.keys():\n\t\t\tvar b = shape[k]\n\t\t\tif b.blockClass == BLOCK_PAIR:\n\t\t\t\tb.solverFlag = false\n\t\t\t\tpairs[calcBlockLayerVec(b.blockPos)][b.name] = b\n\n\t\t# Make sure each pair block has a valid pair on the same layer.\n\t\tfor l in pairs:\n\t\t\tfor p in l:\n\t\t\t\tif l.has( l[p].pairName ):\n\t\t\t\t\tif( not l[p].solverFlag ):\n\t\t\t\t\t\tl[p].solverFlag = true\n\t\t\t\t\t\tl[l[p].pairName].solverFlag = true\n\t\t\t\t\t\tpuzzleSteps.solveSteps.append( [ l[p].blockPos, l[l[p].pairName].blockPos ] )\n\t\t\t\telse:\n\t\t\t\t\tpuzzleSteps.error = SOLVER_ERROR_MISSING_PAIR\n\t\t\t\t\tpuzzleSteps.errorBlock = l[p]\n\t\t\t\t\treturn puzzleSteps\n\n\t\tpuzzleSteps.solveable = true\n\t\treturn puzzleSteps\n\n# Randomly shuffle an array.\nfunc shuffleArray( arr ):\n\tfor i in range( arr.size() - 1, 1, -1 ):\n\t\tvar swapVal = randi() % (i + 1)\n\t\tvar temp = arr[swapVal]\n\t\tarr[swapVal] = arr[i]\n\t\tarr[i] = temp\n\n# Determines the block type based on puzzle size and difficulty.\nfunc getBlockType( difficulty, pos ):\n\t# Determine if this is the goal block.\n\tif pos.x == 0 and pos.y == 0 and pos.z == 0:\n\t\treturn BLOCK_GOAL\n\n\t# Determine the layer this block is on.\n\tvar layer = calcBlockLayerVec( pos )\n\n\t# Determine how many blocks are on the outer part of the layer.\n\tvar layerCount = 0\n\tif abs( pos.x ) == layer:\n\t\tlayerCount += 1\n\tif abs( pos.y ) == layer:\n\t\tlayerCount += 1\n\tif abs( pos.z ) == layer:\n\t\tlayerCount += 1\n\n\t# Determine if this block is a laser.\n\tif difficulty == DIFF_EASY or difficulty == DIFF_MEDIUM:\n\t\tif layerCount == 3:\n\t\t\treturn BLOCK_LASER\n\n\tif difficulty == DIFF_HARD:\n\t\tif abs( pos.x ) == abs( pos.z ) and pos.y == 0:\n\t\t\treturn BLOCK_LASER\n\n\t# Determine if this block is a wild block.\n\tif difficulty == DIFF_EASY:\n\t\tif layerCount == 2:\n\t\t\treturn BLOCK_WILD\n\n\tif difficulty == DIFF_MEDIUM:\n\t\tif layerCount == 2:\n\t\t\tif pos.y == layer || pos.y == -layer:\n\t\t\t\treturn BLOCK_WILD\n\n\tif difficulty == DIFF_HARD:\n\t\tif layerCount == 1:\n\t\t\tif pos.y == 0:\n\t\t\t\treturn BLOCK_WILD\n\n\t# Otherwise it's a normal block.\n\treturn BLOCK_PAIR\n\n# Generates a solveable puzzle.\nfunc generatePuzzle( layers, difficulty ):\n\tvar blockID = 0\n\tvar puzzle = Puzzle.new()\n\tpuzzle.puzzleName = \"RANDOM PUZZLE\"\n\tpuzzle.puzzleLayers = layers\n\n\t# Create all possible positions.\n\tvar layeredblocks = []\n\tfor l in range( 0, layers + 1 ):\n\t\tlayeredblocks.append( [] )\n\t\tpuzzle.pairCount.append( 0 )\n\tfor x in range( -layers, layers + 1 ):\n\t\tfor y in range( -layers, layers + 1 ):\n\t\t\tfor z in range( -layers, layers + 1 ):\n\t\t\t\tlayeredblocks[calcBlockLayer( x, y, z )].append(Vector3(x,y,z))\n\n\t# Generate laser lines.\n\tfor l in range( 1, layers + 1 ):\n\t\tif difficulty == DIFF_MEDIUM or difficulty == DIFF_EASY:\n\t\t\tfor lx in [ -l, l ]:\n\t\t\t\tfor ly in [ -l, l ]:\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, ly, lx ), Vector3( lx*-1, ly, lx )] )\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, ly, lx ), Vector3( lx, ly, lx*-1 )] )\n\n\t\tif difficulty == DIFF_EASY:\n\t\t\tfor lx in [ -l, l ]:\n\t\t\t\tfor lz in [ -l, l ]:\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, l, lz ), Vector3( lx, -l, lz )] )\n\n\t\tif difficulty == DIFF_HARD:\n\t\t\tfor lx in [ -l, l ]:\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, 0, lx ), Vector3( lx*-1, 0, lx )] )\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, 0, lx ), Vector3( lx, 0, lx*-1 )] )\n\n\t# Assign block types based on position.\n\tfor l in range( 0, layers + 1 ):\n\t\t# Randomize the pairs.\n\t\tshuffleArray( layeredblocks[l] )\n\t\t# print( \"NUM \", layeredblocks[l].size() )\n\t\tvar prevBlock = null\n\t\tvar even = false\n\t\tfor pos in layeredblocks[l]:\n\t\t\tvar x = pos.x\n\t\t\tvar y = pos.y\n\t\t\tvar z = pos.z\n\n\t\t\tvar t = getBlockType( difficulty, pos )\n\n\t\t\tif t == BLOCK_GOAL:\n\t\t\t\tcontinue\n\n\t\t\tvar b = PickledBlock.new()\n\t\t\tb.blockPos = pos\n\t\t\tb.name = blockID\n\n\t\t\tblockID += 1\n\t\t\tpuzzle.shape[pos] = b\n\n\t\t\tif t == BLOCK_LASER:\n\t\t\t\tb.setBlockClass(BLOCK_LASER)\\\n\t\t\t\t\t.setLaserExtent( Vector3( 0, 1, 0 ) )\n\t\t\t\tcontinue\n\n\t\t\tif t == BLOCK_WILD:\n\t\t\t\tb.setBlockClass(BLOCK_WILD) \\\n\t\t\t\t\t.setTextureName(blockColors[randi() % blockColors.size()])\n\t\t\t\tcontinue\n\n\t\t\tif even:\n\t\t\t\t# Count this pair.\n\t\t\t\tpuzzle.pairCount[l] += 1\n\n\t\t\t\tvar randColor = blockColors[randi() % blockColors.size()]\n\t\t\t\tb.setBlockClass(BLOCK_PAIR) \\\n\t\t\t\t\t.setPairName(prevBlock.name) \\\n\t\t\t\t\t.setTextureName(randColor)\n\n\t\t\t\tprevBlock.setBlockClass(BLOCK_PAIR) \\\n\t\t\t\t\t.setPairName(b.name) \\\n\t\t\t\t\t.setTextureName(randColor)\n\t\t\teven = not even\n\t\t\tprevBlock = b\n\n\treturn puzzle\n\n# Storage class for blocks in a puzzle.\nclass PickledBlock:\n\tvar name\n\tvar blockClass = BLOCK_PAIR\n\tvar pairName\n\tvar textureName = \"Red\"\n\tvar blockPos\n\tvar laserExtent\n\tvar solverFlag\t\t# Keeps track of this block, only user for the solver.\n\n\tfunc setName(n):\n\t\tname = n\n\t\treturn self\n\n\tfunc setPairName(n):\n\t\tpairName = n\n\t\treturn self\n\n\tfunc setLaserExtent(n):\n\t\tlaserExtent = n\n\t\treturn self\n\n\tfunc setBlockPos(n):\n\t\tblockPos = n\n\t\treturn self\n\n\tfunc setBlockClass(c):\n\t\tblockClass = c\n\t\treturn self\n\n\tfunc setTextureName(t):\n\t\ttextureName = t\n\t\treturn self\n\n\tfunc toString():\n\t\treturn str(name) + \": \" + str(blockClass) + \" @ \" + str(blockPos)\n\n\tfunc toNode():\n\t\t# instantiate a block scene, assign the appropriate script to it\n\t\tvar n = blockScn.instance()\n\t\tn.set_script(blockScripts[blockClass])\n\n\t\tn.set_translation(blockPos * 2)\n\t\tn.blockPos = blockPos\n\n\t\tn.setName(str(name)).setTexture()\n\n\t\tn.setBlockType( blockClass )\n\n\t\tif blockClass == BLOCK_PAIR:\n\t\t\tn.setPairName(pairName).setTexture(textureName)\n\n\t\tif blockClass == BLOCK_WILD:\n\t\t\tn.setTexture(textureName)\n\n\t\tif blockClass == BLOCK_LASER:\n\t\t\tn.setPairName(pairName).setExtent(laserExtent)\n\t\treturn n\n\n\t# test me plz\n\tfunc fromNode(n):\n\t\tblockPos = n.blockPos\n\n\t\tname = n.name_int\n\n\t\tblockClass = n.getBlockType()\n\n\t\tif blockClass == BLOCK_PAIR:\n\t\t\tpairName = n.pairName\n\t\t\ttextureName = n.textureName\n\n\t\tif blockClass == BLOCK_WILD:\n\t\t\ttextureName = n.textureName\n\n\t\tif blockClass == BLOCK_LASER:\n\t\t\tpairName = n.pairName\n\n\t# Convert this object to a dictionary.\n\tfunc toDict():\n\t\tvar di = { n = name\n\t\t \t , bC = blockClass\n\t\t\t , pN = pairName\n\t\t\t , tN = textureName\n\t\t\t , bP = blockPos\n\t\t\t , lE = laserExtent\n\t\t\t }\n\t\treturn di\n\n\t# Make this object from a dictionary.\n\tfunc fromDict( di ):\n\t\tname = di.n\n\t\tblockClass = di.bC\n\t\tpairName = di.pN\n\t\ttextureName = di.tN\n\t\tblockPos = di.bP\n\t\tlaserExtent = di.lE\n\n","old_contents":"const DIFF_EASY\t\t= 0\nconst DIFF_MEDIUM\t= 1\nconst DIFF_HARD\t\t= 2\n\n# this order is important\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\nconst SOLVER_ERROR_NONE\t\t\t\t= 0\nconst SOLVER_ERROR_MISSING_PAIR\t\t= 1\n\nconst blockColors = [\"Blue\", \"Orange\", \"Red\", \"Yellow\", \"Purple\", \"Green\"]\n\n# Preload paired blocks\nconst blockScn = preload( \"res:\/\/blocks\/block.scn\" )\nconst blockScripts = [ preload( \"Blocks\/LaserBlock.gd\" )\n\t\t\t \t , preload( \"Blocks\/WildBlock.gd\" )\n\t\t\t \t , preload( \"Blocks\/PairedBlock.gd\" )\n\t\t\t \t , preload( \"Blocks\/LaserBlock.gd\" )\n\t\t\t \t ]\n\n# Hash map of all possible positions\nvar shape = {}\n\n# Calculates the layer that a block is on.\nstatic func calcBlockLayer( x, y, z ):\n\treturn max( max( abs( x ), abs( y ) ), abs( z ) )\n# THIS IS EVERYWHERE, ANY BETTER WAY TO HAVE FUNCTIONS BETWEEN SCRIPTS?\nstatic func calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n# Stores a puzzle in a convenient class.\nclass Puzzle:\n\n\tvar puzzleName\t\t\t# The name of the puzzle.\n\tvar puzzleLayers\t\t# The amount of layers the puzzle has.\n\tvar pairCount = []\t\t# The amount of pair blocks on each layer.\n\tvar blocks = []\t\t\t# Information on all of the blocks in the puzzle.\n\tvar lasers = []\t\t\t# Laser connections.\n\tvar puzzleMan\t\t\t# Stores the puzzle manager for making pickled blocks.\n\n\t# Converts a puzzle to a dictionary.\n\tfunc toDict():\n\t\tvar blockArr = []\n\t\tfor b in range( blocks.size() ):\n\t\t\tblockArr.append( blocks[b].toDict() )\n\n\t\tvar di = { pN = puzzleName\n\t\t \t , pL = puzzleLayers\n\t\t\t\t , bL = blockArr\n\t\t\t\t , pC = pairCount\n\t\t\t\t , lS = lasers\n\t\t\t }\n\t\treturn di\n\n\t# Converts a dictionary to a puzzle.\n\tfunc fromDict( di ):\n\t\tpuzzleName = di.pN\n\t\tpuzzleLayers = di.pL\n\t\tpairCount = di.pC\n\t\tlasers = di.lS\n\n\t\tfor b in range( di.bL.size() ):\n\t\t\tvar nb = puzzleMan.PickledBlock.new()\n\t\t\tnb.fromDict( di.bL[b] )\n\t\t\tblocks.append( nb )\n\t\treturn\n\n\t# Class that stores a solution or the errors in a puzzle.\n\tclass PuzzleSteps:\n\t\tvar solveable = false\n\t\tvar error = SOLVER_ERROR_NONE\n\t\tvar errorBlock = null\n\t\tvar solveSteps = []\n\n\t# THIS IS EVERYWHERE, ANY BETTER WAY TO HAVE FUNCTIONS BETWEEN SCRIPTS?\n\t# duplicate of the global definition above? Either way godot is chill and\n\t# doesn't complain\n\tfunc calcBlockLayerVec( pos ):\n\t\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n\t# Determines if a puzzle is solveable.\n\tfunc solvePuzzle():\n\t\t# Simply use the solvePuzzleSteps function and return the solveable part.\n\t\tvar ps = self.solvePuzzleSteps()\n\t\treturn ps.solveable\n\n\t# Determines if a puzzle is solveable and returns the steps needed to solve it.\n\tfunc solvePuzzleSteps():\n\t\tvar puzzleSteps = PuzzleSteps.new()\n\n\t\tvar pairs = []\n\n\t\t# Add new dictionary for each later.\n\t\tfor l in range( puzzleLayers + 1 ):\n\t\t\tpairs.append( {} )\n\n\t\t# Gather paired blocks from the puzzle.\n\t\tfor b in blocks:\n\t\t\tif b.blockClass == BLOCK_PAIR:\n\t\t\t\tb.solverFlag = false\n\t\t\t\tpairs[calcBlockLayerVec(b.blockPos)][b.name] = b\n\n\t\t# Make sure each pair block has a valid pair on the same layer.\n\t\tfor l in pairs:\n\t\t\tfor p in l:\n\t\t\t\tif l.has( l[p].pairName ):\n\t\t\t\t\tif( not l[p].solverFlag ):\n\t\t\t\t\t\tl[p].solverFlag = true\n\t\t\t\t\t\tl[l[p].pairName].solverFlag = true\n\t\t\t\t\t\tpuzzleSteps.solveSteps.append( [ l[p].blockPos, l[l[p].pairName].blockPos ] )\n\t\t\t\telse:\n\t\t\t\t\tpuzzleSteps.error = SOLVER_ERROR_MISSING_PAIR\n\t\t\t\t\tpuzzleSteps.errorBlock = l[p]\n\t\t\t\t\treturn puzzleSteps\n\n\t\tpuzzleSteps.solveable = true\n\t\treturn puzzleSteps\n\n# Randomly shuffle an array.\nfunc shuffleArray( arr ):\n\tfor i in range( arr.size() - 1, 1, -1 ):\n\t\tvar swapVal = randi() % (i + 1)\n\t\tvar temp = arr[swapVal]\n\t\tarr[swapVal] = arr[i]\n\t\tarr[i] = temp\n\n# Determines the block type based on puzzle size and difficulty.\nfunc getBlockType( difficulty, pos ):\n\t# Determine if this is the goal block.\n\tif pos.x == 0 and pos.y == 0 and pos.z == 0:\n\t\treturn BLOCK_GOAL\n\n\t# Determine the layer this block is on.\n\tvar layer = calcBlockLayerVec( pos )\n\n\t# Determine how many blocks are on the outer part of the layer.\n\tvar layerCount = 0\n\tif abs( pos.x ) == layer:\n\t\tlayerCount += 1\n\tif abs( pos.y ) == layer:\n\t\tlayerCount += 1\n\tif abs( pos.z ) == layer:\n\t\tlayerCount += 1\n\n\t# Determine if this block is a laser.\n\tif difficulty == DIFF_EASY or difficulty == DIFF_MEDIUM:\n\t\tif layerCount == 3:\n\t\t\treturn BLOCK_LASER\n\n\tif difficulty == DIFF_HARD:\n\t\tif abs( pos.x ) == abs( pos.z ) and pos.y == 0:\n\t\t\treturn BLOCK_LASER\n\n\t# Determine if this block is a wild block.\n\tif difficulty == DIFF_EASY:\n\t\tif layerCount == 2:\n\t\t\treturn BLOCK_WILD\n\n\tif difficulty == DIFF_MEDIUM:\n\t\tif layerCount == 2:\n\t\t\tif pos.y == layer || pos.y == -layer:\n\t\t\t\treturn BLOCK_WILD\n\n\tif difficulty == DIFF_HARD:\n\t\tif layerCount == 1:\n\t\t\tif pos.y == 0:\n\t\t\t\treturn BLOCK_WILD\n\n\t# Otherwise it's a normal block.\n\treturn BLOCK_PAIR\n\n# Generates a solveable puzzle.\nfunc generatePuzzle( layers, difficulty ):\n\tvar blockID = 0\n\tvar puzzle = Puzzle.new()\n\tpuzzle.puzzleName = \"RANDOM PUZZLE\"\n\tpuzzle.puzzleLayers = layers\n\n\t# Create all possible positions.\n\tvar layeredblocks = []\n\tfor l in range( 0, layers + 1 ):\n\t\tlayeredblocks.append( [] )\n\t\tpuzzle.pairCount.append( 0 )\n\tfor x in range( -layers, layers + 1 ):\n\t\tfor y in range( -layers, layers + 1 ):\n\t\t\tfor z in range( -layers, layers + 1 ):\n\t\t\t\tlayeredblocks[calcBlockLayer( x, y, z )].append(Vector3(x,y,z))\n\t\t\t\tshape[Vector3(x,y,z)] = null\n\n\t# Generate laser lines.\n\tfor l in range( 1, layers + 1 ):\n\t\tif difficulty == DIFF_MEDIUM or difficulty == DIFF_EASY:\n\t\t\tfor lx in [ -l, l ]:\n\t\t\t\tfor ly in [ -l, l ]:\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, ly, lx ), Vector3( lx*-1, ly, lx )] )\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, ly, lx ), Vector3( lx, ly, lx*-1 )] )\n\n\t\tif difficulty == DIFF_EASY:\n\t\t\tfor lx in [ -l, l ]:\n\t\t\t\tfor lz in [ -l, l ]:\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, l, lz ), Vector3( lx, -l, lz )] )\n\n\t\tif difficulty == DIFF_HARD:\n\t\t\tfor lx in [ -l, l ]:\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, 0, lx ), Vector3( lx*-1, 0, lx )] )\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, 0, lx ), Vector3( lx, 0, lx*-1 )] )\n\n\t# Assign block types based on position.\n\tfor l in range( 0, layers + 1 ):\n\t\t# Randomize the pairs.\n\t\tshuffleArray( layeredblocks[l] )\n\t\t# print( \"NUM \", layeredblocks[l].size() )\n\t\tvar prevBlock = null\n\t\tvar even = false\n\t\tfor pos in layeredblocks[l]:\n\t\t\tvar x = pos.x\n\t\t\tvar y = pos.y\n\t\t\tvar z = pos.z\n\n\t\t\tvar t = getBlockType( difficulty, pos )\n\n\t\t\tif t == BLOCK_GOAL:\n\t\t\t\tcontinue\n\n\t\t\tvar b = PickledBlock.new()\n\t\t\tb.blockPos = pos\n\t\t\tb.name = blockID\n\n\t\t\tblockID += 1\n\t\t\tpuzzle.blocks.append( b )\n\n\t\t\tif t == BLOCK_LASER:\n\t\t\t\tb.setBlockClass(BLOCK_LASER)\\\n\t\t\t\t\t.setLaserExtent( Vector3( 0, 1, 0 ) )\n\t\t\t\tcontinue\n\n\t\t\tif t == BLOCK_WILD:\n\t\t\t\tb.setBlockClass(BLOCK_WILD) \\\n\t\t\t\t\t.setTextureName(blockColors[randi() % blockColors.size()])\n\t\t\t\tcontinue\n\n\t\t\tif even:\n\t\t\t\t# Count this pair.\n\t\t\t\tpuzzle.pairCount[l] += 1\n\n\t\t\t\tvar randColor = blockColors[randi() % blockColors.size()]\n\t\t\t\tb.setBlockClass(BLOCK_PAIR) \\\n\t\t\t\t\t.setPairName(prevBlock.name) \\\n\t\t\t\t\t.setTextureName(randColor)\n\n\t\t\t\tprevBlock.setBlockClass(BLOCK_PAIR) \\\n\t\t\t\t\t.setPairName(b.name) \\\n\t\t\t\t\t.setTextureName(randColor)\n\t\t\teven = not even\n\t\t\tprevBlock = b\n\n\treturn puzzle\n\n# Storage class for blocks in a puzzle.\nclass PickledBlock:\n\tvar name\n\tvar blockClass = BLOCK_PAIR\n\tvar pairName\n\tvar textureName = \"Red\"\n\tvar blockPos\n\tvar laserExtent\n\tvar solverFlag\t\t# Keeps track of this block, only user for the solver.\n\n\tfunc setName(n):\n\t\tname = n\n\t\treturn self\n\n\tfunc setPairName(n):\n\t\tpairName = n\n\t\treturn self\n\n\tfunc setLaserExtent(n):\n\t\tlaserExtent = n\n\t\treturn self\n\n\tfunc setBlockPos(n):\n\t\tblockPos = n\n\t\treturn self\n\n\tfunc setBlockClass(c):\n\t\tblockClass = c\n\t\treturn self\n\n\tfunc setTextureName(t):\n\t\ttextureName = t\n\t\treturn self\n\n\tfunc toString():\n\t\treturn str(name) + \": \" + str(blockClass) + \" @ \" + str(blockPos)\n\n\tfunc toNode():\n\t\t# instantiate a block scene, assign the appropriate script to it\n\t\tvar n = blockScn.instance()\n\t\tn.set_script(blockScripts[blockClass])\n\n\t\tn.set_translation(blockPos * 2)\n\t\tn.blockPos = blockPos\n\n\t\tn.setName(str(name)).setTexture()\n\n\t\tn.setBlockType( blockClass )\n\n\t\tif blockClass == BLOCK_PAIR:\n\t\t\tn.setPairName(pairName).setTexture(textureName)\n\n\t\tif blockClass == BLOCK_WILD:\n\t\t\tn.setTexture(textureName)\n\n\t\tif blockClass == BLOCK_LASER:\n\t\t\tn.setPairName(pairName).setExtent(laserExtent)\n\t\treturn n\n\n\t# test me plz\n\tfunc fromNode(n):\n\t\tblockPos = n.blockPos\n\n\t\tname = n.name_int\n\n\t\tblockClass = n.getBlockType()\n\n\t\tif blockClass == BLOCK_PAIR:\n\t\t\tpairName = n.pairName\n\t\t\ttextureName = n.textureName\n\n\t\tif blockClass == BLOCK_WILD:\n\t\t\ttextureName = n.textureName\n\n\t\tif blockClass == BLOCK_LASER:\n\t\t\tpairName = n.pairName\n\n\t# Convert this object to a dictionary.\n\tfunc toDict():\n\t\tvar di = { n = name\n\t\t \t , bC = blockClass\n\t\t\t , pN = pairName\n\t\t\t , tN = textureName\n\t\t\t , bP = blockPos\n\t\t\t , lE = laserExtent\n\t\t\t }\n\t\treturn di\n\n\t# Make this object from a dictionary.\n\tfunc fromDict( di ):\n\t\tname = di.n\n\t\tblockClass = di.bC\n\t\tpairName = di.pN\n\t\ttextureName = di.tN\n\t\tblockPos = di.bP\n\t\tlaserExtent = di.lE\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"829cde0867ab5b5a5a9f1317db59189814745370","subject":"Tests and fixes for bugs that tests discovered.","message":"Tests and fixes for bugs that tests discovered.\n","repos":"groboclown\/godot-bootstrap","old_file":"components\/long_text\/long_text.gd","new_file":"components\/long_text\/long_text.gd","new_contents":"\n\n# A text label that scrolls on and on.\n\nextends Container\n\n\nexport(int, 0, 1000) var indent_pixels = 20 setget indent_spaces_changed\nexport(float, 0, 10) var paragraph_separation = 1.8 setget paragraph_separation_changed\nexport(float, 0, 10) var line_height = 1.5 setget line_height_changed\nexport(Color, RGBA) var color\nexport(Font) var font setget font_changed\nexport(String) var text setget text_changed\n\nvar _trtext\nvar _line_pos = []\nvar _height = 0\nvar _changed = false\n\nvar _actual_width\nvar _minimum_width\n\nconst CH_SPACE = 32\nconst CH_TAB = 9\nconst CH_LF = 13\nconst CH_CR = 10\nconst CH_BACKSLASH = 92\nconst CH_N = 110\nconst CH_T = 116\n\nfunc _init():\n\tconnect(\"resized\", self, \"_on_resized\")\n\tconnect(\"minimum_size_changed\", self, \"_on_minimum_changed\")\n\tconnect(\"size_flags_changed\", self, \"_on_resized\")\n\tconnect(\"item_rect_changed\", self, \"_on_resized\")\n\n\nfunc _ready():\n\tif get_parent() extends ScrollContainer:\n\t\tget_parent().connect(\"resized\", self, \"recalculate\")\n\tif _changed:\n\t\trecalculate()\n\tif _actual_width == null:\n\t\t_actual_width = get_minimum_size().x\n\n\t\t\nfunc _on_minimum_changed():\n\tvar size = get_minimum_size()\n\tif _minimum_width == null || size.x != _actual_width:\n\t\t# it hasn't been called, or was explicitly changed outside\n\t\t# of the below method.\n\t\t_minimum_width = size.x\n\t\tif _minimum_width > _actual_width:\n\t\t\t_actual_width = _minimum_width\n\t\t\t_changed = true\n\t\t\n\nfunc _on_resized():\n\t# Prevents the explicit setting of the minimum size below from messing with\n\t# the actual size.\n\tvar new_width = max(get_minimum_size().x, get_size().x)\n\tif _actual_width != new_width:\n\t\t_actual_width = new_width\n\t\t_changed = true\n\t\n\nfunc _draw():\n\tif _changed:\n\t\trecalculate()\n\tvar fnt = font\n\tif fnt == null:\n\t\tfnt = get_font(\"font\", \"Label\")\n\tvar c = color\n\tif c == null:\n\t\tc = get_color(\"font_color\", \"Label\")\n\tfor line in _line_pos:\n\t\tdraw_string(fnt, line[1], line[0], c)\n\nfunc indent_spaces_changed(newval):\n\t_changed = true\n\nfunc paragraph_separation_changed(newval):\n\t_changed = true\n\nfunc line_height_changed(newval):\n\t_changed = true\n\nfunc font_changed(newval):\n\t_changed = true\n\nfunc text_changed(newval):\n\t_changed = true\n\t_trtext = []\n\tvar t = null\n\tif newval != null:\n\t\tt = tr(newval)\n\tif t == null:\n\t\treturn\n\t# escape the text\n\tvar esc = false\n\tvar txt = \"\"\n\tvar first = 0\n\tvar i\n\tfor i in range(0, t.length()):\n\t\tvar ch = t.ord_at(i)\n\t\tif esc:\n\t\t\tesc = false\n\t\t\tif ch == CH_N:\n\t\t\t\ttxt = txt.strip_edges()\n\t\t\t\tif txt.length() > 0:\n\t\t\t\t\t_trtext.append(txt)\n\t\t\t\ttxt = \"\"\n\t\t\t\tfirst = i + 1\n\t\t\telif ch == CH_T:\n\t\t\t\t# change to a space\n\t\t\t\tif i - 1 > first:\n\t\t\t\t\ttxt += t.substr(first, i - 1)\n\t\t\t\ttxt += ' '\n\t\t\t\tfirst = i + 1\n\t\t\telse:\n\t\t\t\t# Just use the un-escaped value\n\t\t\t\tfirst = i\n\t\telif ch == CH_BACKSLASH:\n\t\t\tif i > first:\n\t\t\t\ttxt += t.substr(first, i - first)\n\t\t\tesc = true\n\t\telif (ch == CH_CR || ch == CH_LF):\n\t\t\tif i > first:\n\t\t\t\ttxt += t.substr(first, i - first)\n\t\t\ttxt = txt.strip_edges()\n\t\t\tif txt.length() > 0:\n\t\t\t\t_trtext.append(txt)\n\t\t\ttxt = \"\"\n\t\t\tfirst = i + 1\n\t\telif ch == CH_TAB:\n\t\t\tif i > first:\n\t\t\t\ttxt += t.substr(first, i - first)\n\t\t\ttxt += ' '\n\t\t\tfirst = i + 1\n\t\t# else ch is a normal character; it is just added to the\n\t\t# pending substring\n\tif t.length() > first:\n\t\ttxt += t.right(first)\n\t\ttxt = txt.strip_edges()\n\t\tif txt.length() > 0:\n\t\t\t_trtext.append(txt)\n\n\nfunc get_font():\n\tif font == null:\n\t\treturn get_font(\"font\", \"Label\")\n\treturn font\n\n\nfunc recalculate():\n\t_changed = false\n\t\n\tvar widget_width = _actual_width\n\tif widget_width == null:\n\t\tif _minimum_width == null:\n\t\t\t_minimum_width = get_minimum_size().x\n\t\twidget_width = max(get_size().x, _minimum_width)\n\tif get_parent() != null && get_parent() extends ScrollContainer:\n\t\tvar pw = get_parent().get_size().x\n\t\tif pw > 0:\n\t\t\tvar k = get_parent().get_node(\"_v_scroll\")\n\t\t\tif k != null:\n\t\t\t\tpw -= max(k.get_size().x, 10)\n\t\t\tif pw < widget_width:\n\t\t\t\twidget_width = pw\n\t\n\tvar start_x = 0\n\tvar fnt = get_font()\n\tvar font_height = float(fnt.get_height())\n\tvar psep = int(paragraph_separation * font_height)\n\tvar lsep = int(line_height * font_height)\n\t_line_pos = []\n\t# We start drawing strings at the bottom of the string.\n\tvar y_pos = -psep + lsep\n\tfor txt in _trtext:\n\t\t# start of an explicit new line\n\t\ty_pos += psep\n\t\tvar tlen = txt.length() - 1\n\t\tvar tpos\n\t\t# We trim the lines, so that they start with non-whitespace\n\t\t# Therefore, the first character of a line is the start of the word.\n\t\tvar linestart_pos = 0\n\t\tvar wordstart_pos = 0\n\t\tvar word_width = 0\n\t\tvar wordend_pos = -1\n\t\tvar on_space = false\n\t\tvar x_pos = indent_pixels + start_x\n\t\tvar width = indent_pixels\n\t\tfor tpos in range(0, tlen + 1):\n\t\t\tvar ch = txt.ord_at(tpos)\n\t\t\tif ch == CH_SPACE:\n\t\t\t\tif not on_space:\n\t\t\t\t\ton_space = true\n\t\t\t\t\twordend_pos = tpos\n\t\t\t\t\twordstart_pos = -1\n\t\t\t\t\tword_width = 0\n\t\t\telse:\n\t\t\t\tif linestart_pos < 0:\n\t\t\t\t\tlinestart_pos = tpos\n\t\t\t\tif wordstart_pos < 0:\n\t\t\t\t\twordstart_pos = tpos\n\t\t\t\t\tword_width = 0\n\t\t\t\ton_space = false\n\t\t\tvar cn = 0\n\t\t\tif tpos + 1 <= tlen:\n\t\t\t\tcn = txt.ord_at(tpos + 1)\n\t\t\tvar cw = fnt.get_char_size(ch, cn).x\n\t\t\twidth += cw\n\t\t\tword_width += cw\n\t\t\tif tpos >= tlen:\n\t\t\t\t# end of the line; stick everything into the end.\n\t\t\t\t# We trim the text, so the last character is non-whitespace.\n\t\t\t\t_line_pos.append([\n\t\t\t\t\t# text\n\t\t\t\t\ttxt.right(linestart_pos),\n\t\t\t\t\t\n\t\t\t\t\t# draw position\n\t\t\t\t\tVector2(x_pos, y_pos)\n\t\t\t\t])\n\t\t\t\t# No need to change x_pos or the other loop variables\n\t\t\t\ty_pos += lsep\n\t\t\telif width >= widget_width:\n\t\t\t\t# Soft end of line\n\t\t\t\tvar next_linestart = wordstart_pos\n\t\t\t\tvar next_wordstart = -1\n\t\t\t\tvar next_word_width = word_width - width\n\t\t\t\tif wordend_pos < 0:\n\t\t\t\t\t# in the middle of the word.\n\t\t\t\t\tif wordstart_pos < 0:\n\t\t\t\t\t\t# No word in the line. Just skip it\n\t\t\t\t\t\twidth = 0\n\t\t\t\t\t\tx_pos = start_x\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t# only one word; cut this one at the break.\n\t\t\t\t\t# TODO add a hyphen\n\t\t\t\t\twordend_pos = tpos\n\t\t\t\t\tnext_linestart = tpos\n\t\t\t\t\tnext_wordstart = tpos\n\t\t\t\t\tword_width = cw\n\t\t\t\t\tnext_word_width = cw\n\t\t\t\t\n\t\t\t\t# soft end of line\n\t\t\t\t_line_pos.append([\n\t\t\t\t\t# text\n\t\t\t\t\ttxt.substr(linestart_pos, wordend_pos - linestart_pos),\n\t\t\t\t\t\n\t\t\t\t\t# draw position\n\t\t\t\t\tVector2(x_pos, y_pos)\n\t\t\t\t])\n\t\t\t\t\n\t\t\t\tx_pos = start_x\n\t\t\t\twidth = word_width\n\t\t\t\tword_width = next_word_width\n\t\t\t\ty_pos += lsep\n\t\t\t\twordstart_pos = next_wordstart\n\t\t\t\twordend_pos = -1\n\t\t\t\tlinestart_pos = next_linestart\n\t\t\t\t\n\tset_custom_minimum_size(Vector2(widget_width, y_pos))\n\t\n\n","old_contents":"\n\n# A text label that scrolls on and on.\n\nextends Container\n\n\nexport(int, 0, 1000) var indent_pixels = 20 setget indent_spaces_changed\nexport(float, 0, 10) var paragraph_separation = 1.8 setget paragraph_separation_changed\nexport(float, 0, 10) var line_height = 1.5 setget line_height_changed\nexport(Color, RGBA) var color\nexport(Font) var font setget font_changed\nexport(String) var text setget text_changed\n\nvar _trtext\nvar _line_pos = []\nvar _height = 0\nvar _changed = false\n\nvar _actual_width\nvar _minimum_width\n\nconst CH_SPACE = 32\nconst CH_TAB = 9\nconst CH_LF = 13\nconst CH_CR = 10\nconst CH_BACKSLASH = 92\nconst CH_N = 110\nconst CH_T = 116\n\nfunc _init():\n\tconnect(\"resized\", self, \"_on_resized\")\n\tconnect(\"minimum_size_changed\", self, \"_on_minimum_changed\")\n\tconnect(\"size_flags_changed\", self, \"_on_resized\")\n\tconnect(\"item_rect_changed\", self, \"_on_resized\")\n\n\nfunc _ready():\n\tif get_parent() extends ScrollContainer:\n\t\tget_parent().connect(\"resized\", self, \"recalculate\")\n\tif _changed:\n\t\trecalculate()\n\tif _actual_width == null:\n\t\t_actual_width = get_minimum_size().x\n\n\t\t\nfunc _on_minimum_changed():\n\tvar size = get_minimum_size()\n\tif _minimum_width == null || size.x != _actual_width:\n\t\t# it hasn't been called, or was explicitly changed outside\n\t\t# of the below method.\n\t\t_minimum_width = size.x\n\t\tif _minimum_width > _actual_width:\n\t\t\t_actual_width = _minimum_width\n\t\t\t_changed = true\n\t\t\n\nfunc _on_resized():\n\t# Prevents the explicit setting of the minimum size below from messing with\n\t# the actual size.\n\tvar new_width = max(get_minimum_size().x, get_size().x)\n\tif _actual_width != new_width:\n\t\t_actual_width = new_width\n\t\t_changed = true\n\t\n\nfunc _draw():\n\tif _changed:\n\t\trecalculate()\n\tvar fnt = font\n\tif fnt == null:\n\t\tfnt = get_font(\"font\", \"Label\")\n\tvar c = color\n\tif c == null:\n\t\tc = get_color(\"font_color\", \"Label\")\n\tfor line in _line_pos:\n\t\tdraw_string(fnt, line[1], line[0], c)\n\nfunc indent_spaces_changed(newval):\n\t_changed = true\n\nfunc paragraph_separation_changed(newval):\n\t_changed = true\n\nfunc line_height_changed(newval):\n\t_changed = true\n\nfunc font_changed(newval):\n\t_changed = true\n\nfunc text_changed(newval):\n\t_changed = true\n\t_trtext = []\n\tvar t = null\n\tif newval != null:\n\t\tt = tr(newval)\n\tif t == null:\n\t\treturn\n\t# escape the text\n\tvar esc = false\n\tvar txt = \"\"\n\tvar first = 0\n\tvar i\n\tfor i in range(0, t.length()):\n\t\tvar ch = t.ord_at(i)\n\t\tif esc:\n\t\t\tesc = false\n\t\t\tif ch == CH_N:\n\t\t\t\ttxt = txt.strip_edges()\n\t\t\t\tif txt.length() > 0:\n\t\t\t\t\t_trtext.append(txt)\n\t\t\t\ttxt = \"\"\n\t\t\t\tfirst = i + 1\n\t\t\telif ch == CH_T:\n\t\t\t\t# change to a space\n\t\t\t\tif i - 1 > first:\n\t\t\t\t\ttxt += t.substr(first, i - 1)\n\t\t\t\ttxt += ' '\n\t\t\t\tfirst = i + 1\n\t\t\telse:\n\t\t\t\t# Just use the un-escaped value\n\t\t\t\tfirst = i\n\t\telif ch == CH_BACKSLASH:\n\t\t\tif i > first:\n\t\t\t\ttxt += t.substr(first, i - first)\n\t\t\tesc = true\n\t\telif (ch == CH_CR || ch == CH_LF):\n\t\t\tif i > first:\n\t\t\t\ttxt += t.substr(first, i - first)\n\t\t\ttxt = txt.strip_edges()\n\t\t\tif txt.length() > 0:\n\t\t\t\t_trtext.append(txt)\n\t\t\ttxt = \"\"\n\t\t\tfirst = i + 1\n\t\telif ch == CH_TAB:\n\t\t\tif i > first:\n\t\t\t\ttxt += t.substr(first, i - first)\n\t\t\ttxt += ' '\n\t\t\tfirst = i + 1\n\t\t# else ch is a normal character; it is just added to the\n\t\t# pending substring\n\tif t.length() > first:\n\t\ttxt += t.right(first)\n\t\ttxt = txt.strip_edges()\n\t\tif txt.length() > 0:\n\t\t\t_trtext.append(txt)\n\n\nfunc get_font():\n\tif font == null:\n\t\treturn get_font(\"font\", \"Label\")\n\treturn font\n\n\nfunc recalculate():\n\t_changed = false\n\t\n\tvar widget_width = _actual_width\n\tif get_parent() != null && get_parent() extends ScrollContainer:\n\t\tvar pw = get_parent().get_size().x\n\t\tif pw > 0:\n\t\t\tvar k = get_parent().get_node(\"_v_scroll\")\n\t\t\tif k != null:\n\t\t\t\tpw -= max(k.get_size().x, 10)\n\t\t\tif pw < widget_width:\n\t\t\t\twidget_width = pw\n\t\n\tvar start_x = 0\n\tvar fnt = get_font()\n\tvar font_height = float(fnt.get_height())\n\tvar psep = int(paragraph_separation * font_height)\n\tvar lsep = int(line_height * font_height)\n\t_line_pos = []\n\t# We start drawing strings at the bottom of the string.\n\tvar y_pos = -psep + lsep\n\tfor txt in _trtext:\n\t\t# start of an explicit new line\n\t\ty_pos += psep\n\t\tvar tlen = txt.length() - 1\n\t\tvar tpos\n\t\t# We trim the lines, so that they start with non-whitespace\n\t\t# Therefore, the first character of a line is the start of the word.\n\t\tvar linestart_pos = 0\n\t\tvar wordstart_pos = 0\n\t\tvar word_width = 0\n\t\tvar wordend_pos = -1\n\t\tvar on_space = false\n\t\tvar x_pos = indent_pixels + start_x\n\t\tvar width = indent_pixels\n\t\tfor tpos in range(0, tlen + 1):\n\t\t\tvar ch = txt.ord_at(tpos)\n\t\t\tif ch == CH_SPACE:\n\t\t\t\tif not on_space:\n\t\t\t\t\ton_space = true\n\t\t\t\t\twordend_pos = tpos\n\t\t\t\t\twordstart_pos = -1\n\t\t\t\t\tword_width = 0\n\t\t\telse:\n\t\t\t\tif linestart_pos < 0:\n\t\t\t\t\tlinestart_pos = tpos\n\t\t\t\tif wordstart_pos < 0:\n\t\t\t\t\twordstart_pos = tpos\n\t\t\t\t\tword_width = 0\n\t\t\t\ton_space = false\n\t\t\tvar cn = 0\n\t\t\tif tpos + 1 <= tlen:\n\t\t\t\tcn = txt.ord_at(tpos + 1)\n\t\t\tvar cw = fnt.get_char_size(ch, cn).x\n\t\t\twidth += cw\n\t\t\tword_width += cw\n\t\t\tif tpos >= tlen:\n\t\t\t\t# end of the line; stick everything into the end.\n\t\t\t\t# We trim the text, so the last character is non-whitespace.\n\t\t\t\t_line_pos.append([\n\t\t\t\t\t# text\n\t\t\t\t\ttxt.right(linestart_pos),\n\t\t\t\t\t\n\t\t\t\t\t# draw position\n\t\t\t\t\tVector2(x_pos, y_pos)\n\t\t\t\t])\n\t\t\t\t# No need to change x_pos or the other loop variables\n\t\t\t\ty_pos += lsep\n\t\t\telif width >= widget_width:\n\t\t\t\t# Soft end of line\n\t\t\t\tvar next_linestart = wordstart_pos\n\t\t\t\tvar next_wordstart = -1\n\t\t\t\tvar next_word_width = word_width - width\n\t\t\t\tif wordend_pos < 0:\n\t\t\t\t\t# in the middle of the word.\n\t\t\t\t\tif wordstart_pos < 0:\n\t\t\t\t\t\t# No word in the line. Just skip it\n\t\t\t\t\t\twidth = 0\n\t\t\t\t\t\tx_pos = start_x\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t# only one word; cut this one at the break.\n\t\t\t\t\t# TODO add a hyphen\n\t\t\t\t\twordend_pos = tpos\n\t\t\t\t\tnext_linestart = tpos\n\t\t\t\t\tnext_wordstart = tpos\n\t\t\t\t\tword_width = cw\n\t\t\t\t\tnext_word_width = cw\n\t\t\t\t\n\t\t\t\t# soft end of line\n\t\t\t\t_line_pos.append([\n\t\t\t\t\t# text\n\t\t\t\t\ttxt.substr(linestart_pos, wordend_pos - linestart_pos),\n\t\t\t\t\t\n\t\t\t\t\t# draw position\n\t\t\t\t\tVector2(x_pos, y_pos)\n\t\t\t\t])\n\t\t\t\t\n\t\t\t\tx_pos = start_x\n\t\t\t\twidth = word_width\n\t\t\t\tword_width = next_word_width\n\t\t\t\ty_pos += lsep\n\t\t\t\twordstart_pos = next_wordstart\n\t\t\t\twordend_pos = -1\n\t\t\t\tlinestart_pos = next_linestart\n\t\t\t\t\n\tset_custom_minimum_size(Vector2(widget_width, y_pos))\n\t\n\n","returncode":0,"stderr":"","license":"cc0-1.0","lang":"GDScript"} {"commit":"8ab077a9c3b95a40b8faf5d2bc4654070b1be326","subject":"Added fuel gauge size factor","message":"Added fuel gauge size factor\n","repos":"P1X-in\/boctok","old_file":"scripts\/services\/fuel_gauge.gd","new_file":"scripts\/services\/fuel_gauge.gd","new_contents":"extends Control\n\nconst SIZE_FACTOR = 4\n\nvar bar\nvar scale\n\nfunc _ready():\n self.bar = self.get_node('huds\/level')\n self.scale = Vector2(1, -1)\n\nfunc update_fuel(amount):\n self.scale.y = float(-1 * amount) \/ 100.0 * self.SIZE_FACTOR\n print(self.scale)\n self.bar.set_scale(self.scale)\n","old_contents":"extends Control\n\nvar bar\nvar scale\n\nfunc _ready():\n self.bar = self.get_node('huds\/level')\n self.scale = Vector2(1, -1)\n\nfunc update_fuel(amount):\n self.scale.y = float(-1 * amount) \/ 100.0\n print(self.scale)\n self.bar.set_scale(self.scale)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"06dfab25a514a039882908d095c62c606096eb33","subject":"Made voidTombs array, etc.","message":"Made voidTombs array, etc.\n\nMade voidTombs and playerHealth arrays. Still need to fix which holes\nare void, and which ones have tombstones.\n","repos":"DaddySmash\/GraphicsGame,DaddySmash\/GraphicsGame","old_file":"app\/code\/zombiesGo.gd","new_file":"app\/code\/zombiesGo.gd","new_contents":"extends Node\n\n#get_node(\"\/root\/global\").enteringOS <--This is the proper method to quit to desktop.\n#get_node(\"\/root\/global\").enteringMenu <--This is the proper method to get to the main menu.\n#get_node(\"\/root\/global\").currentDifficulty <--This is the proper method to get the difficulty.\n\n#Time based variables.\n#var eclipseRatio = null\n\n#Player stuff.\nvar playerScore = null\nvar playerTime = null\nvar playerDifficulty = null #This has to be between 0 and 3 to match the size of xSizeArray and ySizeArray.\n#var specialAbilityAmmo = null\nvar tombArray = []\nvar tombOrigen = null\nvar tombs = null\nvar tombNumberTotal = 0\nvar xSizeArray = [3, 3, 4, 6] #[Easy, Normal, Hard, Insane]\nvar ySizeArray = [1, 2, 3, 3] #[Easy, Normal, Hard, Insane]\nvar playerHealth = [3, 3, 3, 3] #[Easy, Normal, Hard, Insane]\nvar voidTombs = [0, 1, 2, 3] #[Easy, Normal, Hard, Insane] These tomb placeholders do not have any zombies coming up.\nvar howDiedTombCount = 3 #this is a count of the number of different flavor texts that go on tombstones.\nvar xTombSpacing = null\nvar yTombSpacing = null\nvar tombStyle = null\nvar tombList = []\n\n#var tombArray = [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\", \"J\", \"K\", \"L\", \"M\", \"N\", \"O\", \"P\", \"Q\", \"R\", \"S\", \"T\", \"U\", \"V\", \"W\", \"X\", \"Y\", \"Z\", \",\", \".\", \"_\", \"-\"]\n\nfunc _ready():\n\tget_scene().set_auto_accept_quit(false) #Enables: _notification(what) to recieve MainLoop.NOTIFICATION_WM_QUIT_REQUEST\n\tset_process(true) #Enables: _process(delta) to run every frame.\n\tplayerDifficulty = get_node(\"\/root\/global\").currentDifficulty\n\t\n\ttombs = get_node(\"tombs\")\n\txTombSpacing = 200\n\tyTombSpacing = 175\n\n\t#for g in range(glyphArray.size()):\n\t#\tn = load(\"res:\/\/scene\/getNameGlyph.xscn\").instance()\n\t#\tglyph.add_child(n)\n\t\n\ttombArray.resize(0)\n\tfor x in range(xSizeArray[playerDifficulty]):\n\t\ttombArray.append([])\n\t\tfor y in range(ySizeArray[playerDifficulty]):\n\t\t\ttombArray[x].append(load(\"res:\/\/scene\/zombiesGoTomb.xscn\").instance())\n\t\t\t#print(\"Hello World \" + str(x) + \", \" + str(y))\n\t\t\t#MARGIN_LEFT, MARGIN_TOP, MARGIN_RIGHT, MARGIN_BOTTOM\n\t\t\ttombArray[x][y].set_margin(MARGIN_LEFT, 1280\/2 - xSizeArray[playerDifficulty]*xTombSpacing\/2 + x * xTombSpacing + floor(rand_range( -xTombSpacing*.2, xTombSpacing*.2)))\n\t\t\ttombArray[x][y].set_margin(MARGIN_TOP, 720\/2 - ySizeArray[playerDifficulty]*yTombSpacing\/2 + y * yTombSpacing)\n\t\t\ttombs.add_child(tombArray[x][y])\n\t\t\t\n\t\n\t#Init settings for round.\n\t#eclipseRatio = (difficulty - 1) * 0.2\n\tplayerScore = 0\n\tplayerTime = 0\n\t#specialAbilityAmmo = 0\n\t\n\t#Create List\n\ttombList.resize(0)\n\tfor x in range(xSizeArray[playerDifficulty]):\n\t\tfor y in range(ySizeArray[playerDifficulty]):\n\t\t\ttombList.append(tombArray[x][y])\n\t\t\t\n\t\t\t\n\t\t\t#tombStyle = floor(rand_range( 0, 3)) #If floor ever returns the high value, it will be a bug on this line.\n\t\t\t#tombArray[x][y].get_node(\"normalTomb\").show()\n\t\t\t#tombArray[x][y].get_node(\"backHole\").show()\n\t\t\t#tombArray[x][y].get_node(\"frontHole\").show()\n\t\n\tfor c in range(playerHealth[playerDifficulty]): #Make normal tombs for player health.\n\t\tif tombList.empty():\n\t\t\tcontinue\n\t\tvar i = floor(rand_range(0, tombList.size()))\n\t\ttombList[i].get_node(\"normalTomb\").show()\n\t\ttombList[i].get_node(\"frontHole\").show()\n\t\ttombList[i].get_node(\"backHole\").show()\n\t\ttombList[i].get_node(\"rubbleHole\").show()\n\t\ttombList.remove(i)\n\t\t\n\tfor c in range(voidTombs[playerDifficulty]): #Make voild tombs.\n\t\tif tombList.empty():\n\t\t\tcontinue\n\t\tvar i = floor(rand_range(0, tombList.size()))\n\t\ttombList.remove(i)\n\t\n\tfor i in range(tombList.size()): #Make the rest of the tombs.\n\t\tvar r = floor(rand_range(0, 3))\n\t\tif r == 0:\n\t\t\ttombList[i].get_node(\"brokenTomb\").show()\n\t\t\ttombList[i].get_node(\"frontHole\").show()\n\t\t\ttombList[i].get_node(\"backHole\").show()\n\t\t\ttombList[i].get_node(\"rubbleHole\").show()\n\t\telif r == 1:\n\t\t\ttombList[i].get_node(\"missingTomb\").show()\n\t\t\ttombList[i].get_node(\"frontHole\").show()\n\t\t\ttombList[i].get_node(\"backHole\").show()\n\t\t\ttombList[i].get_node(\"rubbleHole\").show()\n\t\telse:\n\t\t\ttombList[i].get_node(\"frontHole\").show()\n\t\t\ttombList[i].get_node(\"backHole\").show()\n\t\t\ttombList[i].get_node(\"rubbleHole\").show()\n\t\t\tpass\n\nfunc _notification(what):\n\tif (what==MainLoop.NOTIFICATION_WM_QUIT_REQUEST):\n\t\t#Submit current game and save highArray before exiting.\n\t\tget_node(\"\/root\/global\").enteringOS = true\n\t\tget_node(\"\/root\/global\").updateHighScore(rand_range(0, 9999), rand_range(0, 59))\n\nfunc _process(delta):\n\t#This is ran every frame.\n\t#get_node(\"\/root\/global\").timeString(time)\n\tplayerTime = playerTime + delta\n\tget_node(\"displayPlayerTimeOnScreen\").set_text(get_node(\"\/root\/global\").timeString(playerTime))\n\t\n\nfunc _on_backGround_pressed():\n\t#Submit current game and save highArray before ending round.\n\t#updateHighScore(score, time)\n\tget_node(\"\/root\/global\").enteringMenu = true\n\tget_node(\"\/root\/global\").updateHighScore(rand_range(0, 9999), rand_range(0, 59))\n\nfunc _on_frontGround_pressed():\n\t#Submit current game and save highArray before ending round.\n\t#updateHighScore(score, time)\n\tget_node(\"\/root\/global\").enteringMenu = true\n\tget_node(\"\/root\/global\").updateHighScore(rand_range(0, 9999), rand_range(0, 59))","old_contents":"extends Node\n\n#get_node(\"\/root\/global\").enteringOS <--This is the proper method to quit to desktop.\n#get_node(\"\/root\/global\").enteringMenu <--This is the proper method to get to the main menu.\n#get_node(\"\/root\/global\").currentDifficulty <--This is the proper method to get the difficulty.\n\n#Time based variables.\n#var eclipseRatio = null\n\n#Player stuff.\nvar playerScore = null\nvar playerTime = null\nvar playerDifficulty = null #This has to be between 0 and 3 to match the size of xSizeArray and ySizeArray.\nvar playerHealth = null\n#var specialAbilityAmmo = null\nvar tombArray = []\nvar tombOrigen = null\nvar tombs = null\nvar tombNumberTotal = 0\nvar xSizeArray = [3, 3, 4, 6] #[Easy, Normal, Hard, Insane]\nvar ySizeArray = [1, 2, 3, 3] #[Easy, Normal, Hard, Insane]\nvar howDiedTombCount = 3 #this is a count of the number of different flavor texts that go on tombstones.\nvar xTombSpacing = null\nvar yTombSpacing = null\nvar tombStyle = null\nvar tombList = []\nvar voidTombs = null #These tomb placeholders do not have any zombies coming up.\n\n#var tombArray = [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\", \"J\", \"K\", \"L\", \"M\", \"N\", \"O\", \"P\", \"Q\", \"R\", \"S\", \"T\", \"U\", \"V\", \"W\", \"X\", \"Y\", \"Z\", \",\", \".\", \"_\", \"-\"]\n\nfunc _ready():\n\tget_scene().set_auto_accept_quit(false) #Enables: _notification(what) to recieve MainLoop.NOTIFICATION_WM_QUIT_REQUEST\n\tset_process(true) #Enables: _process(delta) to run every frame.\n\tplayerDifficulty = get_node(\"\/root\/global\").currentDifficulty\n\t\n\ttombs = get_node(\"tombs\")\n\txTombSpacing = 200\n\tyTombSpacing = 175\n\n\t#for g in range(glyphArray.size()):\n\t#\tn = load(\"res:\/\/scene\/getNameGlyph.xscn\").instance()\n\t#\tglyph.add_child(n)\n\t\n\ttombArray.resize(0)\n\tfor x in range(xSizeArray[playerDifficulty]):\n\t\ttombArray.append([])\n\t\tfor y in range(ySizeArray[playerDifficulty]):\n\t\t\ttombArray[x].append(load(\"res:\/\/scene\/zombiesGoTomb.xscn\").instance())\n\t\t\t#print(\"Hello World \" + str(x) + \", \" + str(y))\n\t\t\t#MARGIN_LEFT, MARGIN_TOP, MARGIN_RIGHT, MARGIN_BOTTOM\n\t\t\ttombArray[x][y].set_margin(MARGIN_LEFT, 1280\/2 - xSizeArray[playerDifficulty]*xTombSpacing\/2 + x * xTombSpacing + floor(rand_range( -xTombSpacing*.2, xTombSpacing*.2)))\n\t\t\ttombArray[x][y].set_margin(MARGIN_TOP, 720\/2 - ySizeArray[playerDifficulty]*yTombSpacing\/2 + y * yTombSpacing)\n\t\t\ttombs.add_child(tombArray[x][y])\n\t\t\t\n\t\n\t#Init settings for round.\n\t#eclipseRatio = (difficulty - 1) * 0.2\n\tplayerScore = 0\n\tplayerTime = 0\n\t#specialAbilityAmmo = 0\n\tif playerDifficulty == 0: #Convert player health to an array like xSizeArray.\n\t\tplayerHealth = 3\n\t\tvoidTombs = 0 #Convert void tombs to an array like xSizeArray.\n\tif playerDifficulty == 1:\n\t\tplayerHealth = 3\n\t\tvoidTombs = 1\n\tif playerDifficulty == 2:\n\t\tplayerHealth = 3\n\t\tvoidTombs = 2\n\tif playerDifficulty == 3:\n\t\tplayerHealth = 3\n\t\tvoidTombs = 3\n\t\n\t#Create List\n\ttombList.resize(0)\n\tfor x in range(xSizeArray[playerDifficulty]):\n\t\tfor y in range(ySizeArray[playerDifficulty]):\n\t\t\ttombList.append(tombArray[x][y])\n\t\t\t\n\t\t\t\n\t\t\t#tombStyle = floor(rand_range( 0, 3)) #If floor ever returns the high value, it will be a bug on this line.\n\t\t\t#tombArray[x][y].get_node(\"normalTomb\").show()\n\t\t\t#tombArray[x][y].get_node(\"backHole\").show()\n\t\t\t#tombArray[x][y].get_node(\"frontHole\").show()\n\t\n\tfor c in range(playerHealth):\n\t\tif tombList.empty():\n\t\t\tcontinue\n\t\tvar i = floor(rand_range(0, tombList.size()))\n\t\ttombList[i].get_node(\"normalTomb\").show()\n\t\ttombList.remove(i)\n\t\n\tfor i in range(tombList.size()):\n\t\tvar r = floor(rand_range(0, 3))\n\t\tif r == 1:\n\t\t\ttombList[i].get_node(\"brokenTomb\").show()\n\t\telif r == 2:\n\t\t\ttombList[i].get_node(\"missingTomb\").show()\n\t\telse:\n\t\t\tpass\n\nfunc _notification(what):\n\tif (what==MainLoop.NOTIFICATION_WM_QUIT_REQUEST):\n\t\t#Submit current game and save highArray before exiting.\n\t\tget_node(\"\/root\/global\").enteringOS = true\n\t\tget_node(\"\/root\/global\").updateHighScore(rand_range(0, 9999), rand_range(0, 59))\n\nfunc _process(delta):\n\t#This is ran every frame.\n\t#get_node(\"\/root\/global\").timeString(time)\n\tplayerTime = playerTime + delta\n\tget_node(\"displayPlayerTimeOnScreen\").set_text(get_node(\"\/root\/global\").timeString(playerTime))\n\t\n\nfunc _on_backGround_pressed():\n\t#Submit current game and save highArray before ending round.\n\t#updateHighScore(score, time)\n\tget_node(\"\/root\/global\").enteringMenu = true\n\tget_node(\"\/root\/global\").updateHighScore(rand_range(0, 9999), rand_range(0, 59))\n\nfunc _on_frontGround_pressed():\n\t#Submit current game and save highArray before ending round.\n\t#updateHighScore(score, time)\n\tget_node(\"\/root\/global\").enteringMenu = true\n\tget_node(\"\/root\/global\").updateHighScore(rand_range(0, 9999), rand_range(0, 59))","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"f4e944bd7a82d8d700edf5c745b9c6816a5654ed","subject":"Fixing border","message":"Fixing border\n","repos":"P1X-in\/boctok","old_file":"scripts\/space.gd","new_file":"scripts\/space.gd","new_contents":"extends Control\n\nfunc _draw():\n var center = Vector2(5000,5000)\n var radius = 4999\n var angle_from = 0\n var angle_to = 360\n var color = Color(1.0, 0.0, 0.0)\n draw_circle_arc( center, radius, angle_from, angle_to, color )\n\n\nfunc draw_circle_arc( center, radius, angle_from, angle_to, color ):\n var nb_points = 360\n var points_arc = Vector2Array()\n\n for i in range(nb_points+1):\n var angle_point = angle_from + i*(angle_to-angle_from)\/nb_points - 90\n var point = center + Vector2( cos(deg2rad(angle_point)), sin(deg2rad(angle_point)) ) * radius\n points_arc.push_back( point )\n\n for indexPoint in range(nb_points):\n draw_line(points_arc[indexPoint], points_arc[indexPoint+1], color)","old_contents":"extends Control\n\nfunc _draw():\n var center = Vector2(0,0)\n var radius = 5000\n var angle_from = 0\n var angle_to = 360\n var color = Color(1.0, 0.0, 0.0)\n draw_circle_arc( center, radius, angle_from, angle_to, color )\n\n\nfunc draw_circle_arc( center, radius, angle_from, angle_to, color ):\n var nb_points = 32\n var points_arc = Vector2Array()\n\n for i in range(nb_points+1):\n var angle_point = angle_from + i*(angle_to-angle_from)\/nb_points - 90\n var point = center + Vector2( cos(deg2rad(angle_point)), sin(deg2rad(angle_point)) ) * radius\n points_arc.push_back( point )\n\n for indexPoint in range(nb_points):\n draw_line(points_arc[indexPoint], points_arc[indexPoint+1], color)","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"03927e3896f85f4be209426e4ce3bb1e8ac1f5fa","subject":"Clear tombstones on game over","message":"Clear tombstones on game over\n","repos":"P1X-in\/rat-is-fat","old_file":"scripts\/controllers\/action_controller.gd","new_file":"scripts\/controllers\/action_controller.gd","new_contents":"\nvar bag\n\nvar game_board = preload(\"res:\/\/scenes\/game_board.xscn\").instance()\nvar tilemap\nvar z_index\n\nfunc _init_bag(bag):\n self.bag = bag\n self.tilemap = self.game_board.get_node('level\/TileMap\/')\n self.z_index = self.tilemap.get_node('z_index')\n\nfunc start_game():\n self.bag.game_state.game_in_progress = true\n self.bag.root.add_child(self.game_board)\n self.bag.map.generate_map(self.bag.game_state.level)\n self.bag.map.switch_to_cell(self.bag.map.start_cell)\n self.bag.hud.show()\n\nfunc end_game():\n self.bag.game_state.current_cell.detach_persistent_objects()\n self.bag.game_state.game_in_progress = false\n self.bag.root.remove_child(self.game_board)\n self.bag.hud.hide()\n self.bag.reset()\n\nfunc next_level(next):\n var level_settings\n if next == 'next':\n self.bag.game_state.level = self.bag.game_state.level + 1\n level_settings = self.bag.game_state.levels[self.bag.game_state.level]\n self.bag.map.generate_map(self.bag.game_state.level)\n self.bag.map.switch_to_cell(self.bag.map.start_cell)\n self.bag.players.move_to_entry_position('initial')\n elif next == 'end':\n self.end_game()\n\nfunc attach_object(object):\n self.game_board.add_child(object)\n\nfunc detach_object(object):\n self.game_board.remove_child(object)","old_contents":"\nvar bag\n\nvar game_board = preload(\"res:\/\/scenes\/game_board.xscn\").instance()\nvar tilemap\nvar z_index\n\nfunc _init_bag(bag):\n self.bag = bag\n self.tilemap = self.game_board.get_node('level\/TileMap\/')\n self.z_index = self.tilemap.get_node('z_index')\n\nfunc start_game():\n self.bag.game_state.game_in_progress = true\n self.bag.root.add_child(self.game_board)\n self.bag.map.generate_map(self.bag.game_state.level)\n self.bag.map.switch_to_cell(self.bag.map.start_cell)\n self.bag.hud.show()\n\nfunc end_game():\n self.bag.game_state.game_in_progress = false\n self.bag.root.remove_child(self.game_board)\n self.bag.hud.hide()\n self.bag.reset()\n\nfunc next_level(next):\n var level_settings\n if next == 'next':\n self.bag.game_state.level = self.bag.game_state.level + 1\n level_settings = self.bag.game_state.levels[self.bag.game_state.level]\n self.bag.map.generate_map(self.bag.game_state.level)\n self.bag.map.switch_to_cell(self.bag.map.start_cell)\n self.bag.players.move_to_entry_position('initial')\n elif next == 'end':\n self.end_game()\n\nfunc attach_object(object):\n self.game_board.add_child(object)\n\nfunc detach_object(object):\n self.game_board.remove_child(object)","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"f80002bd347dfd78daea08b4ef9e6142c2bb2d2a","subject":"Change totems sprite -> corresponding to their type at soon as the totem's node is enter the tree and send the signal ready","message":"Change totems sprite -> corresponding to their type at soon as the totem's node is enter the tree and send the signal ready\n","repos":"CSaratakij\/jam-2016-remake","old_file":"src\/totems\/totem.gd","new_file":"src\/totems\/totem.gd","new_contents":"\nextends KinematicBody2D\n\nconst GRAVITY = 180\n\nexport var type_id = 0\n\nvar is_active = false\nvar velocity = Vector2()\nvar motion = Vector2()\n\nvar totem_sprites = [\n\tpreload(\"res:\/\/totems\/totem1.png\"),\n\tpreload(\"res:\/\/totems\/totem2.png\"),\n\tpreload(\"res:\/\/totems\/totem3.png\")\n\t]\n\nonready var _sprite = get_node(\"Sprite\")\nonready var _collision = get_node(\"CollisionShape2D\")\n\nfunc _ready():\n\tset_fixed_process(true)\n\t_sprite.set_texture(totem_sprites[ type_id ])\n\nfunc _fixed_process(delta):\n\t_collision.set_trigger(not is_active)\n\tif is_active:\n\t\tvelocity.y += GRAVITY * delta\n\t\tmotion = velocity * delta\n\t\tmove(motion)\n\nfunc set_active(active):\n\tis_active = active\n\nfunc set_type(index):\n\ttype_id = index\n\t_sprite.set_texture(totem_sprites[ index ])\n\nfunc max_type():\n\treturn totem_sprites.size()\n","old_contents":"\nextends KinematicBody2D\n\nconst GRAVITY = 180\n\nexport var type_id = 0\n\nvar is_active = false\nvar velocity = Vector2()\nvar motion = Vector2()\n\nvar totem_sprites = [\n\tpreload(\"res:\/\/totems\/totem1.png\"),\n\tpreload(\"res:\/\/totems\/totem2.png\"),\n\tpreload(\"res:\/\/totems\/totem3.png\")\n\t]\n\nonready var _sprite = get_node(\"Sprite\")\nonready var _collision = get_node(\"CollisionShape2D\")\n\nfunc _ready():\n\tset_fixed_process(true)\n\nfunc _fixed_process(delta):\n\t_collision.set_trigger(not is_active)\n\tif is_active:\n\t\tvelocity.y += GRAVITY * delta\n\t\tmotion = velocity * delta\n\t\tmove(motion)\n\nfunc set_active(active):\n\tis_active = active\n\nfunc set_type(index):\n\ttype_id = index\n\t_sprite.set_texture(totem_sprites[index])\n\nfunc max_type():\n\treturn totem_sprites.size()\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"f3d2a82064379f296309aecaf4452d19b027df99","subject":"Skip backfaces when drawing","message":"Skip backfaces when drawing\n\nUse the dot product of the face normal and cameras forward vector to check if the face is facing the camera.","repos":"TassuP\/GodotStuff,TassuP\/GodotStuff","old_file":"TexturePainterDemo\/DrawToTexture.gd","new_file":"TexturePainterDemo\/DrawToTexture.gd","new_contents":"extends Spatial\n\nconst ray_length = 100\nvar col = Color(1,1,1,1)\nfunc _ready():\n\tset_process(true)\n\n\nfunc _process(delta):\n\tif(Input.is_mouse_button_pressed(BUTTON_MASK_LEFT)):\n\t\tshoot(col)\n\n\nfunc shoot(var color):\n\tvar camera = get_node(\"Camera\")\n\tvar ray = camera.get_node(\"RayCast\")\n\tvar mousepos = get_viewport().get_mouse_pos()\n\t\n\t# shoot in the direction of the mouse\n\tvar to = camera.project_ray_normal(mousepos) * ray_length\n\tray.set_cast_to(to)\n\t\n\t# did it hit?\n\tif(ray.is_colliding()):\n\t\tvar object = ray.get_collider()\n#\t\tprint(object.get_name())\n\t\t\n\t\t# Get the mesh\n\t\tvar meshinst = object.get_node(\"MeshInstance\")\n\t\tvar mesh = meshinst.get_mesh()\n\t\tvar mdt = MeshDataTool.new()\n\t\tmdt.create_from_surface(mesh,0)# <-- lets just stay in the first surface\n\t\t\n\t\t# loop trough the faces\n\t\tvar i=0\n\t\twhile(i0):\n\t\t\t\t\n\t\t\t\t# indices of the verts\n\t\t\t\tvar i0 = mdt.get_face_vertex(i,0)\n\t\t\t\tvar i1 = mdt.get_face_vertex(i,1)\n\t\t\t\tvar i2 = mdt.get_face_vertex(i,2)\n\t\t\t\t\n\t\t\t\t# get unprojected vertices (3d->2d)\n\t\t\t\tvar A = camera.unproject_position(object.get_transform().xform(mdt.get_vertex(i0)))\n\t\t\t\tvar B = camera.unproject_position(object.get_transform().xform(mdt.get_vertex(i1)))\n\t\t\t\tvar C = camera.unproject_position(object.get_transform().xform(mdt.get_vertex(i2)))\n\t\t\t\tvar P = mousepos\n\t\t\t\t\n\t\t\t\t# Next comes some weird black magic that I don't really understand\n\t\t\t\t# http:\/\/blackpawn.com\/texts\/pointinpoly\/\n\t\t\t\t\n\t\t\t\t# Compute vectors \n\t\t\t\tvar v0 = C - A\n\t\t\t\tvar v1 = B - A\n\t\t\t\tvar v2 = P - A\n\t\t\t\t\n\t\t\t\t# Compute dot products\n\t\t\t\tvar dot00 = v0.dot(v0)\n\t\t\t\tvar dot01 = v0.dot(v1)\n\t\t\t\tvar dot02 = v0.dot(v2)\n\t\t\t\tvar dot11 = v1.dot(v1)\n\t\t\t\tvar dot12 = v1.dot(v2)\n\t\t\t\t\n\t\t\t\t# Compute barycentric coordinates\n\t\t\t\tvar invDenom = 1 \/ (dot00 * dot11 - dot01 * dot01)\n\t\t\t\tvar u = (dot11 * dot02 - dot01 * dot12) * invDenom\n\t\t\t\tvar v = (dot00 * dot12 - dot01 * dot02) * invDenom\n\t\t\t\t\n\t\t\t\t# Check if point is in triangle\n\t\t\t\tif((u >= 0) && (v >= 0) && (u + v < 1)):\n\t\t\t\t\t\n\t\t\t\t\t# perform the same weird math for the UV but inverted\n\t\t\t\t\tvar a = mdt.get_vertex_uv(i0)\n\t\t\t\t\tvar b = mdt.get_vertex_uv(i1)\n\t\t\t\t\tvar c = mdt.get_vertex_uv(i2)\n\t\t\t\t\tvar P = a + u * (c - a) + v * (b - a)\n\t\t\t\t\t\n\t\t\t\t\t# finally draw the pixel\n\t\t\t\t\tmeshinst.plot_px(P.x,P.y,color)\n\t\t\t\t\n\t\t\ti+=1\n\t\t\n\t\t\n\nfunc _on_ColorPickerButton_color_changed( color ):\n\tcol = color\n\n","old_contents":"extends Spatial\n\nconst ray_length = 100\nvar col = Color(1,1,1,1)\nfunc _ready():\n\tset_process(true)\n\n\nfunc _process(delta):\n\tif(Input.is_mouse_button_pressed(BUTTON_MASK_LEFT)):\n\t\tshoot(col)\n\n\nfunc shoot(var color):\n\tvar camera = get_node(\"Camera\")\n\tvar ray = camera.get_node(\"RayCast\")\n\tvar mousepos = get_viewport().get_mouse_pos()\n\t\n\t# shoot in the direction of the mouse\n\tvar to = camera.project_ray_normal(mousepos) * ray_length\n\tray.set_cast_to(to)\n\t\n\t# did it hit?\n\tif(ray.is_colliding()):\n\t\tvar object = ray.get_collider()\n#\t\tprint(object.get_name())\n\t\t\n\t\t# Get the mesh\n\t\tvar meshinst = object.get_node(\"MeshInstance\")\n\t\tvar mesh = meshinst.get_mesh()\n\t\tvar mdt = MeshDataTool.new()\n\t\tmdt.create_from_surface(mesh,0)# <-- lets just stay in the first surface\n\t\t\n\t\t# loop trough the faces\n\t\tvar i=0\n\t\twhile(i2d)\n\t\t\tvar A = camera.unproject_position(object.get_transform().xform(mdt.get_vertex(i0)))\n\t\t\tvar B = camera.unproject_position(object.get_transform().xform(mdt.get_vertex(i1)))\n\t\t\tvar C = camera.unproject_position(object.get_transform().xform(mdt.get_vertex(i2)))\n\t\t\tvar P = mousepos\n\t\t\t\n\t\t\t# Next comes some weird black magic that I don't really understand\n\t\t\t# http:\/\/blackpawn.com\/texts\/pointinpoly\/\n\t\t\t\n\t\t\t# Compute vectors \n\t\t\tvar v0 = C - A\n\t\t\tvar v1 = B - A\n\t\t\tvar v2 = P - A\n\t\t\t\n\t\t\t# Compute dot products\n\t\t\tvar dot00 = v0.dot(v0)\n\t\t\tvar dot01 = v0.dot(v1)\n\t\t\tvar dot02 = v0.dot(v2)\n\t\t\tvar dot11 = v1.dot(v1)\n\t\t\tvar dot12 = v1.dot(v2)\n\t\t\t\n\t\t\t# Compute barycentric coordinates\n\t\t\tvar invDenom = 1 \/ (dot00 * dot11 - dot01 * dot01)\n\t\t\tvar u = (dot11 * dot02 - dot01 * dot12) * invDenom\n\t\t\tvar v = (dot00 * dot12 - dot01 * dot02) * invDenom\n\t\t\t\n\t\t\t# Check if point is in triangle\n\t\t\tif((u >= 0) && (v >= 0) && (u + v < 1)):\n\t\t\t\t\n\t\t\t\t# perform the same weird math for the UV but inverted\n\t\t\t\tvar a = mdt.get_vertex_uv(i0)\n\t\t\t\tvar b = mdt.get_vertex_uv(i1)\n\t\t\t\tvar c = mdt.get_vertex_uv(i2)\n\t\t\t\tvar P = a + u * (c - a) + v * (b - a)\n\t\t\t\t\n\t\t\t\t# finally draw the pixel\n\t\t\t\tmeshinst.plot_px(P.x,P.y,color)\n\t\t\t\t\n\t\t\ti+=1\n\t\t\n\t\t\n\nfunc _on_ColorPickerButton_color_changed( color ):\n\tcol = color\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"f6ec6f4a55fd15ee42c3a15e3dfe64b46f799282","subject":"Removed slot","message":"Removed slot\n","repos":"Acvarium\/BabylonTower2,Acvarium\/BabylonTower2","old_file":"scripts\/2d\/main.gd","new_file":"scripts\/2d\/main.gd","new_contents":"extends Node2D\nvar mainArray = []\nconst BALL_SIZE = 64\nvar ballObj = load(\"res:\/\/objects\/ball.tscn\")\nvar ballPressed = false\nvar ballPressedName = ''\nvar shiftPressed = Vector2(0,0)\n\nfunc _fixed_process(delta):\n\tvar mouse = get_viewport().get_mouse_pos()\n\n\tvar ballPressedPos = findBallByName(ballPressedName)\n\t\n\tif ballPressed:\n\n\t\tvar mouseOnGrid = Vector2(0,0)\n\t\tvar onGrid = Vector2(0,0)\n\n\t\tmouseOnGrid.x = int((mouse.x - ballPressedPos.x) \/ 64) - 1 \n\t\tmouseOnGrid.y = int((mouse.y - 32 - ballPressedPos.y) \/ 64)\n\n\t\tonGrid.x = (int((mouse.x - ballPressedPos.x) \/ 64) - 1) - ballPressedPos.x\n\t\tonGrid.y = int((mouse.y - 32 - ballPressedPos.y) \/ 64) - ballPressedPos.y\n\n\t\tif onGrid.x != 0:\n\t\t\tvar ballsToShift = []\n\t\t\tif ballPressedPos.y > 6:\n\t\t\t\tballsToShift.append(get_node(\"balls\/b\" + ballPressedName))\n\t\t\telse:\n\t\t\t\tfor i in range(6):\n\t\t\t\t\tvar b = get_node(\"balls\/b\" + mainArray[i * 7 + ballPressedPos.y])\n\t\t\t\t\tballsToShift.append(b)\n\t\t\tfor i in range(ballsToShift.size()):\n\n\t\t\t\tvar b = get_node(\"balls\/b\" + mainArray[mainArray.size() - 1])\n\t\t\t\tif ballPressedPos.y < 7:\n\t\t\t\t\tb = get_node(\"balls\/b\" + mainArray[i * 7 + ballPressedPos.y])\n\t\t\t\tvar pos = b.get_pos()\n\t\t\t\tpos.x = i * 64 + mouseOnGrid.x * 64 - ballPressedPos.x * 64\n\t\t\t\tif ballPressedPos.y > 6:\n\t\t\t\t\tpos.x = i * 64 + mouseOnGrid.x * 64\n\t\t\t\tif pos.x > 64 * 6 - 32:\n\t\t\t\t\tpos.x -= 64 * 6\n\t\t\t\telif pos.x < 0:\n\t\t\t\t\tpos.x += 64 * 6\n\t\t\t\tb.set_pos(pos)\n\t\t\tshiftPressed = Vector2(ballPressedPos.y, onGrid.x)\n\nfunc _ready():\n\trandomize()\n\tset_process_input(true)\n\tset_fixed_process(true)\n#\u041a\u043b\u044e\u0447\u043e\u0432\u0438\u0439 \u043c\u0430\u0441\u0438\u0432, \u0432 \u043a\u043e\u0442\u0440\u043e\u043c\u0443 \u0437\u0431\u0435\u0440\u0456\u0433\u0430\u044e\u0442\u044c\u0441\u044f \u0434\u0430\u043d\u0456 \u043f\u0440\u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044f \u043a\u043e\u043b\u044c\u043e\u0440\u043e\u0432\u0438\u0445 \u043a\u0443\u043b\u044c\u043e\u043a\n\tmainArray = [ 'r1', 'r2', 'r3', 'r4', 'r5', 'r6', 'r7',\n\t\t\t\t 'o1', 'o2', 'o3', 'o4', 'o5', 'o6', 'o7',\n\t\t\t\t 'y1', 'y2', 'y3', 'y4', 'y5', 'y6', 'y7',\n\t\t\t\t 'g1', 'g2', 'g3', 'g4', 'g5', 'g6', 'g7',\n\t\t\t\t 'b1', 'b2', 'b3', 'b4', 'b5', 'b6', 'b7',\n\t\t\t\t 'p1', 'p2', 'p3', 'p4', 'p5', 'p6', ''] \n#\u0421\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f \u043a\u0443\u043b\u044c\u043e\u043a \u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u043d\u043e \u0434\u043e \u043a\u043b\u044e\u0447\u043e\u0432\u043e\u0433\u043e \u043c\u0430\u0441\u0438\u0432\u0443\n\tshuffleBalls()\n\tupdateBalls()\n\t\n#\u041e\u0431\u0440\u043e\u0431\u043a\u0430 \u043f\u043e\u0434\u0456\u0439 (\u043d\u0430\u0442\u0438\u0441\u043a\u0430\u043d\u043d\u044f \u043a\u043b\u0430\u0432\u0456\u0448)\nfunc _input(event):\n\tif event.is_action_released(\"space\"): \n\t\tshuffleBalls()\n\t\tupdateBalls()\n\tif event.is_action_released(\"LMB\"):\n\n\t\tif shiftPressed.y != 0:\n\t\t\tshiftRow(shiftPressed.x, shiftPressed.y)\n\t\telse:\n\t\t\tif findBallByName('').x == findBallByName(ballPressedName).x and ballPressed:\n\n\t\t\t\tvar sCol = findBallByName(ballPressedName).x\n\t\t\t\tcutCol(findBallByName(ballPressedName))\n\t\t\t\tupdateBalls()\n\t\tballPressed = false\n\t\tupdateBalls()\n\t\tshiftPressed = Vector2(0,0)\n\n#\u0421\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f \u043e\u0434\u043d\u0456\u0454\u0457 \u043a\u0443\u043b\u044c\u043a\u0438 \u0437\u0430 \u0437\u0430\u0434\u0430\u043d\u0438\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438\nfunc createBall(name):\n\tvar balls = get_node(\"balls\")\n\tvar ball = ballObj.instance()\n\tball.set_name(name)\n\tballs.add_child(ball)\n\tvar color = Color(0,0,0,1)\n\tif name != 'b':\n\t\tcolor = toColor(name[1])\n\tball.setColor(color)\n\t\n#\u041f\u0435\u0440\u0435\u0444\u0430\u0440\u0431\u0443\u0432\u0430\u043d\u043d\u044f \u043a\u0443\u043b\u044c\u043e\u043a \u0443 \u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u043d\u0456\u0441\u0442\u044c \u0434\u043e \u0437\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0445 \u0432 \u043a\u043b\u044e\u0447\u043e\u0432\u043e\u043c\u0443 \u043c\u0430\u0441\u0438\u0432\u0456 \u043a\u043e\u043b\u044c\u043e\u0440\u0456\u0432\nfunc toColor(colorMark):\n\tvar color = Color(1,0,1,1)\n\tif not colorMark: \t\t\t#\u041f\u043e\u0440\u043e\u0436\u043d\u044f \u043a\u043e\u043c\u0456\u0440\u043a\u0430\n\t\tcolor = Color(1,1,0,1)\n\telif colorMark == 'r':\t\t#\u0427\u0435\u0440\u0432\u043e\u043d\u0456\n\t\tcolor = Color(1,0,0,1)\n\telif colorMark == 'g':\t\t#\u0417\u0435\u043b\u0435\u043d\u0456\n\t\tcolor = Color(0,0.6,0,1)\n\telif colorMark == 'b':\t\t#\u0421\u0438\u043d\u0456\n\t\tcolor = Color(0,0,1,1)\n\telif colorMark == 'o':\t\t#\u041f\u043e\u043c\u0430\u0440\u0430\u043d\u0447\u0435\u0432\u0456\n\t\tcolor = Color(1.0, 0.5, 0.0, 1.0)\n\telif colorMark == 'y':\t\t#\u0416\u043e\u0432\u0442\u0456\n\t\tcolor = Color(0.65, 0.65, 0.0, 1.0)\n\telif colorMark == 'p':\t\t#\u0424\u0456\u043e\u043b\u0435\u0442\u043e\u0432\u0456\n\t\tcolor = Color(0.65, 0.0, 0.65, 1.0)\n\treturn color\n\n#\u0417\u043c\u0456\u0449\u0435\u043d\u043d\u044f \u0440\u044f\u0434\u043a\u0430 \u043b\u0456\u0432\u043e\u0440\u0443\u0447 \u0430\u0431\u043e \u043f\u0440\u0430\u0432\u043e\u0440\u0443\u0447\nfunc shiftRow(row, dir):\n\tvar tempRow = []\n\tfor i in range(6):\n\t\ttempRow.append(mainArray[i * 7 + row])\n\tvar tail\n\tif dir < 0:\n\t\tfor j in range(abs(dir)):\n\t\t\ttail = tempRow[0]\n\t\t\tfor i in range(tempRow.size() - 1):\n\t\t\t\ttempRow[i] = tempRow[i+1]\n\t\t\ttempRow[tempRow.size() - 1] = tail\n\telif dir > 0:\n\t\tfor j in range(abs(dir)):\n\t\t\ttail = tempRow[tempRow.size() - 1]\n\t\t\tfor i in range((tempRow.size() - 1), 0 , -1):\n\t\t\t\ttempRow[i] = tempRow[i - 1]\n\t\t\ttempRow[0] = tail\n\tfor i in range(6):\n\t\tmainArray[i * 7 + row] = tempRow[i]\n\t\t\nfunc findBallByName(name):\n\tvar index = 0\n\tfor b in mainArray:\n\t\tif b == name:\n\t\t\tvar col = int(index \/ 7)\n\t\t\tvar row = (index - col * 7)\n\t\t\treturn(Vector2(col,row))\n\t\tindex += 1\n\n#\u041f\u0435\u0440\u0435\u043c\u0456\u0448\u0430\u0442\u0438 \u043a\u0443\u043b\u044c\u043a\u0438\nfunc shuffleBalls():\n\tvar shuffledList = [] \n\tvar indexList = range(mainArray.size())\n\tfor i in range(mainArray.size()):\n\t\tvar x = randi()%indexList.size()\n\t\tshuffledList.append(mainArray[indexList[x]])\n\t\tindexList.remove(x)\n\tmainArray = shuffledList\n\n\n#\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044f \u043f\u043e\u0437\u0438\u0446\u0456\u0439 \u043a\u0443\u043b\u044c\u043e\u043a\nfunc updateBalls():\n\tvar index = 0\n\tvar table = []\n\tfor b in mainArray:\n\t\tvar col = int(index \/ 7)\n\t\tvar row = (index - col * 7)\n\t\tvar name = \"b\" + mainArray[index]\n\t\tif not get_node(\"balls\/\" + name):\n\t\t\tcreateBall(name)\n\t\tget_node(\"balls\" + \"\/b\" + mainArray[index]).set_pos(Vector2(col * (BALL_SIZE), row * (BALL_SIZE)))\n\t\tindex += 1\n\n#\u041e\u0431\u0440\u043e\u0431\u043a\u0430 \u0441\u0438\u0433\u043d\u0430\u043b\u0456\u0432 \u043a\u043d\u043e\u043f\u043e\u043a\nfunc _signal_arrow(rowDir):\n\tshiftRow(abs(rowDir) - 1, sign(int(rowDir)))\n\tupdateBalls()\n\nfunc cutCol(ball):\n\tvar column = []\n\tvar i\n\tfor b in range(7):\n\t\ti = b + (ball.x * 7)\n\t\tcolumn.append(mainArray[i])\n\tvar empty = findBallByName('')\n\n\tvar dir = 1\n\tif empty.y > ball.y:\n\t\tdir = -1\n\ti = empty.y\n\twhile(i != ball.y):\n\t\tcolumn[i] = column[i + dir]\n\t\t\n\t\ti += dir\n\tcolumn[ball.y] = ''\n\n\n\tfor b in range(7):\n\t\ti = b + (ball.x * 7)\n\t\tmainArray[i] = column[b]\n\nfunc _signal_ballClicked(name):\n\tif name != 'b':\n\t\tname = name[1] + name[2]\n\t\tballPressedName = name\n\telse:\n\t\tballPressedName = ''\n\tballPressed = true\n","old_contents":"extends Node2D\nvar mainArray = []\nconst BALL_SIZE = 64\nvar ballObj = load(\"res:\/\/objects\/ball.tscn\")\nvar slot = 0\nvar ballPressed = false\nvar ballPressedName = ''\nvar shiftPressed = Vector2(0,0)\n\nfunc _fixed_process(delta):\n\tvar mouse = get_viewport().get_mouse_pos()\n\n\tvar ballPressedPos = findBallByName(ballPressedName)\n\t\n\tif ballPressed:\n\n\t\tvar mouseOnGrid = Vector2(0,0)\n\t\tvar onGrid = Vector2(0,0)\n\n\t\tmouseOnGrid.x = int((mouse.x - ballPressedPos.x) \/ 64) - 1 \n\t\tmouseOnGrid.y = int((mouse.y - 32 - ballPressedPos.y) \/ 64)\n\n\n\t\tonGrid.x = (int((mouse.x - ballPressedPos.x) \/ 64) - 1) - ballPressedPos.x\n\t\tonGrid.y = int((mouse.y - 32 - ballPressedPos.y) \/ 64) - ballPressedPos.y\n\n\n\t\tif onGrid.x != 0:\n\t\t\tvar ballsToShift = []\n\t\t\tif ballPressedPos.y > 6:\n\t\t\t\tballsToShift.append(get_node(\"balls\/b\" + ballPressedName))\n\n\t\t\telse:\n\t\t\t\tfor i in range(6):\n\t\t\t\t\tvar b = get_node(\"balls\/b\" + mainArray[i * 7 + ballPressedPos.y])\n\t\t\t\t\tballsToShift.append(b)\n\t\t\tfor i in range(ballsToShift.size()):\n\n\t\t\t\tvar b = get_node(\"balls\/b\" + mainArray[mainArray.size() - 1])\n\t\t\t\tif ballPressedPos.y < 7:\n\t\t\t\t\tb = get_node(\"balls\/b\" + mainArray[i * 7 + ballPressedPos.y])\n\t\t\t\tvar pos = b.get_pos()\n\t\t\t\tpos.x = i * 64 + mouseOnGrid.x * 64 - ballPressedPos.x * 64\n\t\t\t\tif ballPressedPos.y > 6:\n\t\t\t\t\tpos.x = i * 64 + mouseOnGrid.x * 64\n\t\t\t\tif pos.x > 64 * 6 - 32:\n\t\t\t\t\tpos.x -= 64 * 6\n\t\t\t\telif pos.x < 0:\n\t\t\t\t\tpos.x += 64 * 6\n\t\t\t\tb.set_pos(pos)\n\t\t\tshiftPressed = Vector2(ballPressedPos.y, onGrid.x)\n\nfunc _ready():\n\trandomize()\n\tset_process_input(true)\n\tset_fixed_process(true)\n#\u041a\u043b\u044e\u0447\u043e\u0432\u0438\u0439 \u043c\u0430\u0441\u0438\u0432, \u0432 \u043a\u043e\u0442\u0440\u043e\u043c\u0443 \u0437\u0431\u0435\u0440\u0456\u0433\u0430\u044e\u0442\u044c\u0441\u044f \u0434\u0430\u043d\u0456 \u043f\u0440\u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044f \u043a\u043e\u043b\u044c\u043e\u0440\u043e\u0432\u0438\u0445 \u043a\u0443\u043b\u044c\u043e\u043a\n\tmainArray = [ 'r1', 'r2', 'r3', 'r4', 'r5', 'r6', 'r7',\n\t\t\t\t 'o1', 'o2', 'o3', 'o4', 'o5', 'o6', 'o7',\n\t\t\t\t 'y1', 'y2', 'y3', 'y4', 'y5', 'y6', 'y7',\n\t\t\t\t 'g1', 'g2', 'g3', 'g4', 'g5', 'g6', 'g7',\n\t\t\t\t 'b1', 'b2', 'b3', 'b4', 'b5', 'b6', 'b7',\n\t\t\t\t 'p1', 'p2', 'p3', 'p4', 'p5', 'p6', 'p7', \n\t\t\t\t ''] \n#\u0421\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f \u043a\u0443\u043b\u044c\u043e\u043a \u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u043d\u043e \u0434\u043e \u043a\u043b\u044e\u0447\u043e\u0432\u043e\u0433\u043e \u043c\u0430\u0441\u0438\u0432\u0443\n\tshuffleBalls()\n\tupdateBalls()\n\t\n#\u041e\u0431\u0440\u043e\u0431\u043a\u0430 \u043f\u043e\u0434\u0456\u0439 (\u043d\u0430\u0442\u0438\u0441\u043a\u0430\u043d\u043d\u044f \u043a\u043b\u0430\u0432\u0456\u0448)\nfunc _input(event):\n\tif event.is_action_released(\"space\"): \n\t\tshuffleBalls()\n\t\tupdateBalls()\n\tif event.is_action_released(\"LMB\"):\n\t\tballPressed = false\n\n\t\tif shiftPressed.y != 0:\n\t\t\tshiftRow(shiftPressed.x, shiftPressed.y)\n\t\telse:\n\t\t\tif findBallByName('').x == findBallByName(ballPressedName).x:\n\n\t\t\t\tvar sCol = findBallByName(ballPressedName).x\n\t\t\t\tcutCol(findBallByName(ballPressedName))\n\t\t\t\tupdateBalls()\n\t\tupdateBalls()\n\t\tshiftPressed = Vector2(0,0)\n\n#\u0421\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f \u043e\u0434\u043d\u0456\u0454\u0457 \u043a\u0443\u043b\u044c\u043a\u0438 \u0437\u0430 \u0437\u0430\u0434\u0430\u043d\u0438\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438\nfunc createBall(name):\n\tvar balls = get_node(\"balls\")\n\tvar ball = ballObj.instance()\n\tball.set_name(name)\n\tballs.add_child(ball)\n\tvar color = Color(0,0,0,1)\n\tif name != 'b':\n\t\tcolor = toColor(name[1])\n\tball.setColor(color)\n\t\n#\u041f\u0435\u0440\u0435\u0444\u0430\u0440\u0431\u0443\u0432\u0430\u043d\u043d\u044f \u043a\u0443\u043b\u044c\u043e\u043a \u0443 \u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u043d\u0456\u0441\u0442\u044c \u0434\u043e \u0437\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0445 \u0432 \u043a\u043b\u044e\u0447\u043e\u0432\u043e\u043c\u0443 \u043c\u0430\u0441\u0438\u0432\u0456 \u043a\u043e\u043b\u044c\u043e\u0440\u0456\u0432\nfunc toColor(colorMark):\n\tvar color = Color(1,1,1,1)\n\tif not colorMark: \t\t\t#\u041f\u043e\u0440\u043e\u0436\u043d\u044f \u043a\u043e\u043c\u0456\u0440\u043a\u0430\n\t\tcolor = Color(0,0,0,1)\n\telif colorMark == 'r':\t\t#\u0427\u0435\u0440\u0432\u043e\u043d\u0456\n\t\tcolor = Color(1,0,0,1)\n\telif colorMark == 'g':\t\t#\u0417\u0435\u043b\u0435\u043d\u0456\n\t\tcolor = Color(0,0.6,0,1)\n\telif colorMark == 'b':\t\t#\u0421\u0438\u043d\u0456\n\t\tcolor = Color(0,0,1,1)\n\telif colorMark == 'o':\t\t#\u041f\u043e\u043c\u0430\u0440\u0430\u043d\u0447\u0435\u0432\u0456\n\t\tcolor = Color(1.0, 0.5, 0.0, 1.0)\n\telif colorMark == 'y':\t\t#\u0416\u043e\u0432\u0442\u0456\n\t\tcolor = Color(0.65, 0.65, 0.0, 1.0)\n\telif colorMark == 'p':\t\t#\u0424\u0456\u043e\u043b\u0435\u0442\u043e\u0432\u0456\n\t\tcolor = Color(0.65, 0.0, 0.65, 1.0)\n\treturn color\n\n#\u0417\u043c\u0456\u0449\u0435\u043d\u043d\u044f \u0440\u044f\u0434\u043a\u0430 \u043b\u0456\u0432\u043e\u0440\u0443\u0447 \u0430\u0431\u043e \u043f\u0440\u0430\u0432\u043e\u0440\u0443\u0447\nfunc shiftRow(row, dir):\n\tif abs(row) == 7:\n\t\tslot += dir\n\t\tif slot < 0:\n\t\t\tslot = 5\n\t\telif slot > 5:\n\t\t\tslot = 0\n\t\treturn 0\n\tvar tempRow = []\n\tfor i in range(6):\n\t\ttempRow.append(mainArray[i * 7 + row])\n\tvar tail\n\tif dir < 0:\n\t\tfor j in range(abs(dir)):\n\t\t\ttail = tempRow[0]\n\t\t\tfor i in range(tempRow.size() - 1):\n\t\t\t\ttempRow[i] = tempRow[i+1]\n\t\t\ttempRow[tempRow.size() - 1] = tail\n\telif dir > 0:\n\t\tfor j in range(abs(dir)):\n\t\t\ttail = tempRow[tempRow.size() - 1]\n\t\t\tfor i in range((tempRow.size() - 1), 0 , -1):\n\t\t\t\ttempRow[i] = tempRow[i - 1]\n\t\t\ttempRow[0] = tail\n\tfor i in range(6):\n\t\tmainArray[i * 7 + row] = tempRow[i]\n\t\t\nfunc findBallByName(name):\n\tvar index = 0\n\tfor b in mainArray:\n\t\tif b == name:\n\t\t\tvar col = int(index \/ 7)\n\t\t\tvar row = (index - col * 7)\n\t\t\tif index == mainArray.size() - 1:\n\t\t\t\treturn(Vector2(slot,7))\n\t\t\treturn(Vector2(col,row))\n\t\tindex += 1\n\n#\u041f\u0435\u0440\u0435\u043c\u0456\u0448\u0430\u0442\u0438 \u043a\u0443\u043b\u044c\u043a\u0438\nfunc shuffleBalls():\n\tvar shuffledList = [] \n\tvar indexList = range(mainArray.size())\n\tfor i in range(mainArray.size()):\n\t\tvar x = randi()%indexList.size()\n\t\tshuffledList.append(mainArray[indexList[x]])\n\t\tindexList.remove(x)\n\tmainArray = shuffledList\n\tslot = randi()%6\n\n#\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044f \u043f\u043e\u0437\u0438\u0446\u0456\u0439 \u043a\u0443\u043b\u044c\u043e\u043a\nfunc updateBalls():\n\tvar index = 0\n\tvar table = []\n\tfor b in mainArray:\n\t\tvar col = int(index \/ 7)\n\t\tvar row = (index - col * 7)\n\t\tvar name = \"b\" + mainArray[index]\n\t\tif not get_node(\"balls\/\" + name):\n\t\t\tcreateBall(name)\n\t\tif index < mainArray.size() - 1:\n\t\t\tget_node(\"balls\" + \"\/b\" + mainArray[index]).set_pos(Vector2(col * (BALL_SIZE), row * (BALL_SIZE)))\n\t\telse:\n\t\t\tget_node(\"balls\" + \"\/b\" + mainArray[index]).set_pos(Vector2(slot * BALL_SIZE, 7 * BALL_SIZE))\t\n\t\tindex += 1\n\n#\u041e\u0431\u0440\u043e\u0431\u043a\u0430 \u0441\u0438\u0433\u043d\u0430\u043b\u0456\u0432 \u043a\u043d\u043e\u043f\u043e\u043a\nfunc _signal_arrow(rowDir):\n\t\tshiftRow(abs(rowDir) - 1, sign(int(rowDir)))\n\t\tupdateBalls()\n\nfunc cutCol(ball):\n\tvar column = []\n\tvar i\n\tfor b in range(7):\n\t\ti = b + (ball.x * 7)\n\t\tcolumn.append(mainArray[i])\n\tif slot == ball.x:\n\t\tcolumn.append(mainArray[mainArray.size() - 1])\n\tvar empty = findBallByName('')\n\n\tvar dir = 1\n\tif empty.y > ball.y:\n\t\tdir = -1\n\ti = empty.y\n\twhile(i != ball.y):\n\t\tcolumn[i] = column[i + dir]\n\t\t\n\t\ti += dir\n\tcolumn[ball.y] = ''\n\n\n\tfor b in range(7):\n\t\ti = b + (ball.x * 7)\n\t\tmainArray[i] = column[b]\n\tif slot == ball.x:\n\t\tmainArray[mainArray.size() - 1] = column[column.size() - 1]\n\nfunc _signal_ballClicked(name):\n\tif name != 'b':\n\t\tname = name[1] + name[2]\n\t\tballPressedName = name\n\telse:\n\t\tballPressedName = ''\n\tballPressed = true\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"82218ae5348fd7dbf14ce05bdfd86fdd8b584b62","subject":"random flower","message":"random flower\n","repos":"w84death\/mountain-of-hope","old_file":"scripts\/flowers.gd","new_file":"scripts\/flowers.gd","new_contents":"\nextends Sprite\n\nvar r\n\nfunc _ready():\n\tr = randi()*(self.get_hframes()*self.get_vframes())\n\tself.set_frame(r);\n\tpass\n\n\n","old_contents":"\nextends Sprite\n\n# member variables here, example:\n# var a=2\n# var b=\"textvar\"\nvar r\n\nfunc _ready():\n\t#r = rand()*self.get_hframes()\n\t#self.set_frame(r);\n\tpass\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"65d7e048c563f290f203bd88124cbe82f8d0af27","subject":"Fix for omnidirectional attack","message":"Fix for omnidirectional attack\n","repos":"P1X-in\/rat-is-fat","old_file":"scripts\/enemies.gd","new_file":"scripts\/enemies.gd","new_contents":"\nvar bag\n\nvar enemy_templates = {\n #easy\n 'shia' : preload(\"res:\/\/scripts\/enemies\/shia.gd\"),\n 'retarded_rat' : preload(\"res:\/\/scripts\/enemies\/retarded_rat.gd\"),\n 'fat_rat' : preload(\"res:\/\/scripts\/enemies\/fat_rat.gd\"),\n 'jumping_rat' : preload(\"res:\/\/scripts\/enemies\/jumping_rat.gd\"),\n 'spider' : preload(\"res:\/\/scripts\/enemies\/spider.gd\"),\n\n #boss\n 'shia_prime' : preload(\"res:\/\/scripts\/enemies\/shia_prime.gd\"),\n 'doge_prime' : preload(\"res:\/\/scripts\/enemies\/doge_prime.gd\"),\n 'noser_prime' : preload(\"res:\/\/scripts\/enemies\/noser_prime.gd\"),\n 'noser_prime_medium' : preload(\"res:\/\/scripts\/enemies\/noser_prime_medium.gd\"),\n 'noser_prime_small' : preload(\"res:\/\/scripts\/enemies\/noser_prime_small.gd\"),\n 'noser_prime_tiny' : preload(\"res:\/\/scripts\/enemies\/noser_prime_tiny.gd\"),\n}\n\nvar enemy_difficulties = [\n [],\n ['retarded_rat', 'fat_rat', 'jumping_rat', 'spider'],\n ['shia'],\n]\n\nvar enemies_list = {}\n\nfunc _init_bag(bag):\n self.bag = bag\n\nfunc spawn(name, map_position):\n var global_position = self.bag.room_loader.translate_position(map_position)\n return self.spawn_global(name, global_position)\n\nfunc spawn_global(name, global_position):\n var new_enemy = self.enemy_templates[name].new(self.bag)\n new_enemy.spawn(global_position)\n self.add_enemy(new_enemy)\n return new_enemy\n\nfunc reset():\n for enemy in self.enemies_list:\n self.enemies_list[enemy].detach()\n self.enemies_list.clear()\n\nfunc add_enemy(enemy):\n self.enemies_list[enemy.get_instance_ID()] = enemy\n\nfunc del_enemy(enemy):\n self.enemies_list.erase(enemy.get_instance_ID())\n if self.enemies_list.size() == 0:\n self.bag.room_loader.open_doors()\n self.bag.game_state.current_cell.clear = true\n\nfunc get_enemies_near_object(object, attack_range, attack_direction, attack_width):\n var result = []\n for instance_id in self.enemies_list:\n if self.is_enemy_in_cone(self.enemies_list[instance_id], object, attack_range, attack_direction, attack_width):\n result.append(self.enemies_list[instance_id])\n\n return result\n\nfunc is_enemy_in_cone(enemy, object, attack_range, attack_direction, attack_width):\n var enemy_position\n var object_position\n var position_delta\n var attack_vector\n var angle\n var melee_range = 3\n\n var distance = enemy.calculate_distance_to_object(object)\n\n if distance < melee_range:\n return true\n\n if distance < attack_range:\n enemy_position = enemy.get_pos()\n attack_vector = Vector2(attack_direction[0], attack_direction[1])\n object_position = object.get_pos()\n position_delta = Vector2(enemy_position.x - object_position.x, enemy_position.y - object_position.y)\n angle = attack_vector.angle_to(position_delta)\n\n if abs(angle) < attack_width:\n return true\n return false\n\nfunc get_random_enemy_name(difficulty):\n randomize()\n var apropriate_enemies = self.enemy_difficulties[difficulty]\n return apropriate_enemies[randi() % apropriate_enemies.size()]\n\n","old_contents":"\nvar bag\n\nvar enemy_templates = {\n #easy\n 'shia' : preload(\"res:\/\/scripts\/enemies\/shia.gd\"),\n 'retarded_rat' : preload(\"res:\/\/scripts\/enemies\/retarded_rat.gd\"),\n 'fat_rat' : preload(\"res:\/\/scripts\/enemies\/fat_rat.gd\"),\n 'jumping_rat' : preload(\"res:\/\/scripts\/enemies\/jumping_rat.gd\"),\n 'spider' : preload(\"res:\/\/scripts\/enemies\/spider.gd\"),\n\n #boss\n 'shia_prime' : preload(\"res:\/\/scripts\/enemies\/shia_prime.gd\"),\n 'doge_prime' : preload(\"res:\/\/scripts\/enemies\/doge_prime.gd\"),\n 'noser_prime' : preload(\"res:\/\/scripts\/enemies\/noser_prime.gd\"),\n 'noser_prime_medium' : preload(\"res:\/\/scripts\/enemies\/noser_prime_medium.gd\"),\n 'noser_prime_small' : preload(\"res:\/\/scripts\/enemies\/noser_prime_small.gd\"),\n 'noser_prime_tiny' : preload(\"res:\/\/scripts\/enemies\/noser_prime_tiny.gd\"),\n}\n\nvar enemy_difficulties = [\n [],\n ['retarded_rat', 'fat_rat', 'jumping_rat', 'spider'],\n ['shia'],\n]\n\nvar enemies_list = {}\n\nfunc _init_bag(bag):\n self.bag = bag\n\nfunc spawn(name, map_position):\n var global_position = self.bag.room_loader.translate_position(map_position)\n return self.spawn_global(name, global_position)\n\nfunc spawn_global(name, global_position):\n var new_enemy = self.enemy_templates[name].new(self.bag)\n new_enemy.spawn(global_position)\n self.add_enemy(new_enemy)\n return new_enemy\n\nfunc reset():\n for enemy in self.enemies_list:\n self.enemies_list[enemy].detach()\n self.enemies_list.clear()\n\nfunc add_enemy(enemy):\n self.enemies_list[enemy.get_instance_ID()] = enemy\n\nfunc del_enemy(enemy):\n self.enemies_list.erase(enemy.get_instance_ID())\n if self.enemies_list.size() == 0:\n self.bag.room_loader.open_doors()\n self.bag.game_state.current_cell.clear = true\n\nfunc get_enemies_near_object(object, attack_range, attack_direction, attack_width):\n var result = []\n for instance_id in self.enemies_list:\n if self.is_enemy_in_cone(self.enemies_list[instance_id], object, attack_range, attack_direction, attack_width):\n result.append(self.enemies_list[instance_id])\n\n return result\n\nfunc is_enemy_in_cone(enemy, object, attack_range, attack_direction, attack_width):\n var enemy_position\n var object_position\n var position_delta_x\n var position_delta_y\n var angle\n var back_offset = 3\n var melee_range = 3\n\n var distance = enemy.calculate_distance_to_object(object)\n\n if distance < melee_range:\n return true\n\n if distance < attack_range:\n enemy_position = enemy.get_pos()\n object_position = object.get_pos() - Vector2(attack_direction[0], attack_direction[1]) * back_offset\n position_delta_x = enemy_position.x - object_position.x\n position_delta_y = enemy_position.y - object_position.y\n angle = atan2(position_delta_x * attack_direction[1] - position_delta_y * attack_direction[0], position_delta_x * attack_direction[0] + position_delta_y * attack_direction[1] )\n if abs(angle) < attack_width:\n return true\n return false\n\nfunc get_random_enemy_name(difficulty):\n randomize()\n var apropriate_enemies = self.enemy_difficulties[difficulty]\n return apropriate_enemies[randi() % apropriate_enemies.size()]\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"b43dcc5244473f4f22450afcf9d68128fb177f8a","subject":"Cleared starting room","message":"Cleared starting room\n","repos":"P1X-in\/rat-is-fat","old_file":"scripts\/map\/rooms\/start_room.gd","new_file":"scripts\/map\/rooms\/start_room.gd","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"mit","lang":"GDScript"} {"commit":"0a948e1c4ca9b1c82a672302483e4b68835b8c40","subject":"Tried to finish zombieMove, but bug","message":"Tried to finish zombieMove, but bug\n\nThis commit is to document a bug, so I can reproduce it at will. Run\nthe program and see that the output is supposed to be texture, but\ninstead is a 'Nil'.\n","repos":"DaddySmash\/GraphicsGame,DaddySmash\/GraphicsGame","old_file":"app\/code\/zombiesGo.gd","new_file":"app\/code\/zombiesGo.gd","new_contents":"extends Node\n\n#get_node(\"\/root\/global\").enteringOS <--This is the proper method to quit to desktop.\n#get_node(\"\/root\/global\").enteringMenu <--This is the proper method to get to the main menu.\n#get_node(\"\/root\/global\").currentDifficulty <--This is the proper method to get the difficulty.\n#get_node(\"\/root\/global\").disableInputForXMs(1000) <--This is the proper method to rapid inputs.\n\n#Time based variables.\n#var eclipseRatio = null\n\n#Player stuff.\nvar playerScore = null\nvar playerTime = null #Units are in seconds.\nvar playerDifficulty = null #This has to be between 0 and 3 to match the size of xSizeArray and ySizeArray.\n#var specialAbilityAmmo = null\nvar tombArray = []\nvar tombOrigen = null\nvar tombs = null\nvar tombNumberTotal = 0 \nvar zombieData = [] #[{\"node\":sub-scene, \"zombieTime\":time, \"zombieStart\":rand_range(0, 4), \"zombieType\":\"type\", \"tombType\":\"type\"}, {...}, ...]\n#zombieData[0] = {\"node\":sub-scene, \"zombieTime\":time}\n#zombieData[1].node = sub-scene\nconst xTombSpacing = 200\nconst yTombSpacing = 175\nvar tombStyle = null\nvar tombList = []\nvar time = null\n\nvar xSizeArray = [3, 3, 4, 6] #[Easy, Normal, Hard, Insane]\nvar ySizeArray = [1, 2, 3, 3] #[Easy, Normal, Hard, Insane]\nvar playerHealth = [3, 3, 3, 3] #[Easy, Normal, Hard, Insane]\nvar voidTombs = [0, 1, 2, 3] #[Easy, Normal, Hard, Insane] These tomb placeholders do not have any zombies coming up.\nvar howDiedTombCount = 3 #this is a count of the number of different flavor texts that go on tombstones.\n#var tombArray = [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\", \"J\", \"K\", \"L\", \"M\", \"N\", \"O\", \"P\", \"Q\", \"R\", \"S\", \"T\", \"U\", \"V\", \"W\", \"X\", \"Y\", \"Z\", \",\", \".\", \"_\", \"-\"]\n\nfunc zombieStart(index): #Don't call unless zombie is below ground.\n\tzombieData[index].zombieTime = rand_range(1.85, 2.15) #This needs to be in seconds to match playerTime.\n\tzombieData[index].zombieStart = max(playerTime, 1) + rand_range(0, 4) #This needs to be in seconds to match playerTime.\n\t\n\tif zombieData[index].node.get_node(\"rubbleHole\").visible:\n\t\tzombieData[index].zombieType = \"missing\"\n\telse:\n\t\tif floor(rand_range(0, 3)) == 0:\n\t\t\tzombieData[index].zombieType = \"hat\"\n\t\telse:\n\t\t\tzombieData[index].zombieType = \"normal\"\n\nfunc zombieDataInit():\n\tcreateTombList()\n\t\n\tfor c in range(playerHealth[playerDifficulty]): #Make normal tombs for player health.\n\t\tif tombList.empty():\n\t\t\tcontinue\n\t\tvar i = floor(rand_range(0, tombList.size()))\n\t\ttombList[i].get_node(\"normalTomb\").show()\n\t\ttombList[i].get_node(\"frontHole\").show()\n\t\ttombList[i].get_node(\"backHole\").show()\n\t\t#tombList[i].get_node(\"rubbleHole\").show()\n\t\ttombList.remove(i)\n\t\t\n\tfor c in range(voidTombs[playerDifficulty]): #Make void tombs.\n\t\tif tombList.empty():\n\t\t\tcontinue\n\t\tvar i = floor(rand_range(0, tombList.size()))\n\t\ttombList[i].get_node(\"rubbleHole\").show()\n\t\ttombList.remove(i)\n\t\n\tfor i in range(tombList.size()): #Make the rest of the tombs.\n\t\tif tombList.empty():\n\t\t\tcontinue\n\t\tvar r = floor(rand_range(0, 2))\n\t\tif r == 0:\n\t\t\ttombList[i].get_node(\"brokenTomb\").show()\n\t\t\ttombList[i].get_node(\"frontHole\").show()\n\t\t\ttombList[i].get_node(\"backHole\").show()\n\t\t\t#tombList[i].get_node(\"rubbleHole\").show()\n\t\telif r == 1:\n\t\t\ttombList[i].get_node(\"missingTomb\").show()\n\t\t\ttombList[i].get_node(\"frontHole\").show()\n\t\t\ttombList[i].get_node(\"backHole\").show()\n\t\t\t#tombList[i].get_node(\"rubbleHole\").show()\n\t\telse:\n\t\t\tpass\n\t\t\t\n\tcreateTombList()\n\tzombieData.resize(0)\n\tfor x in range(xSizeArray[playerDifficulty]):\n\t\tfor y in range(ySizeArray[playerDifficulty]):\n\t\t\tzombieData.append({\"node\":tombArray[x][y], \"zombieTime\":0, \"zombieStart\":0, \"MARGIN_TOP\":tombArray[x][y].get_margin(MARGIN_TOP)})\n\tfor c in range(zombieData.size()):\n\t\tif zombieData.empty():\n\t\t\tcontinue\n\t\t\t\n\t\tprint(zombieData)\n\t\tprint(zombieData[c])\n\t\tprint(zombieData[c].node)\n\t\tprint(zombieData[c].node.get_node(\"rubbleHole\"))\n\t\tprint(zombieData[c].node.get_node(\"rubbleHole\").visible)\n\t\t\n\t\tif zombieData[c].node.get_node(\"rubbleHole\").visible:\n\t\t\tzombieData[c].zombieType = \"missing\"\n\t\tzombieStart(c)\n\nfunc getIndexFromNode(node): #When passed a node, find that node's index inside of zombieData.\n\tfor c in range(zombieData.size()):\n\t\tif zombieData.empty():\n\t\t\tcontinue\n\t\tif zombieData[c].node == node:\n\t\t\treturn c\n\treturn null\n\nfunc _ready():\n\tget_tree().set_auto_accept_quit(false) #Enables: _notification(what) to recieve MainLoop.NOTIFICATION_WM_QUIT_REQUEST\n\tset_process(true) #Enables: _process(delta) to run every frame.\n\tplayerDifficulty = get_node(\"\/root\/global\").currentDifficulty\n\t\n\ttombs = get_node(\"tombs\")\n\t\n\t#for g in range(glyphArray.size()):\n\t#\tn = load(\"res:\/\/scene\/getNameGlyph.xscn\").instance()\n\t#\tglyph.add_child(n)\n\t\n\ttombArray.resize(0) #This initiallizes the tombArray to empty before we start adding to it.\n\tfor x in range(xSizeArray[playerDifficulty]):\n\t\ttombArray.append([])\n\t\tfor y in range(ySizeArray[playerDifficulty]):\n\t\t\ttombArray[x].append(load(\"res:\/\/scene\/zombiesGoTomb.xscn\").instance())\n\t\t\t#print(\"Hello World \" + str(x) + \", \" + str(y))\n\t\t\t#MARGIN_LEFT, MARGIN_TOP, MARGIN_RIGHT, MARGIN_BOTTOM\n\t\t\ttombArray[x][y].set_margin(MARGIN_LEFT, 1280\/2 - xSizeArray[playerDifficulty]*xTombSpacing\/2 + x * xTombSpacing + floor(rand_range( -xTombSpacing*.2, xTombSpacing*.2)))\n\t\t\ttombArray[x][y].set_margin(MARGIN_TOP, 720\/2 - ySizeArray[playerDifficulty]*yTombSpacing\/2 + y * yTombSpacing)\n\t\t\ttombs.add_child(tombArray[x][y])\n\t\t\t\n\t\n\t#Init settings for round.\n\t#eclipseRatio = (difficulty - 1) * 0.2\n\tplayerScore = 0\n\tplayerTime = 0\n\t#specialAbilityAmmo = 0\n\t\n\n\tzombieDataInit()\n\t\n\nfunc createTombList(): #Create List\n\ttombList.resize(0)\n\tfor x in range(xSizeArray[playerDifficulty]):\n\t\tfor y in range(ySizeArray[playerDifficulty]):\n\t\t\ttombList.append(tombArray[x][y])\n\nfunc _notification(what):\n\tif (what==MainLoop.NOTIFICATION_WM_QUIT_REQUEST):\n\t\t#Submit current game and save highArray before exiting.\n\t\tget_node(\"\/root\/global\").enteringOS = true\n\t\tget_node(\"\/root\/global\").updateHighScore(rand_range(0, 9999), rand_range(0, 59))\n\nfunc _process(delta):\n\t#This is ran every frame.\n\t#get_node(\"\/root\/global\").timeString(time)\n\tplayerTime = playerTime + delta\n\tget_node(\"displayPlayerTimeOnScreen\").set_text(get_node(\"\/root\/global\").timeString(playerTime))\n\ttime = int(floor(playerTime))\n\t# Check for death.\n\tif playerDifficulty == 3:\n\t\t#isDied()= true\n\t\tpass\n\t\t\n\tzombieMove()\n\t\t\n\t\t#if time <= 2:\n\t\t#\tzombieMove() = true\n\t\t#else:\n\t\t#\tzombieMove() = false\n\nfunc isDied():\n\tget_node(\"\/root\/global\").enteringMenu = true\n\tget_node(\"\/root\/global\").updateHighScore(playerScore, playerTime)\n\nfunc _on_backGround_pressed():\n\tif get_node(\"\/root\/global\").isInputEnabled():\n\t\t#Submit current game and save highArray before ending round.\n\t\t#updateHighScore(score, time)\n\t\tget_node(\"\/root\/global\").enteringMenu = true\n\t\tget_node(\"\/root\/global\").updateHighScore(rand_range(0, 9999), rand_range(0, 59))\n\nfunc zombieMove(): #Move zombies up, then down, based on playerTime, zombieTime, zombieStart.\n\tfor c in range(zombieData.size()):\n\n\t\tif zombieData.empty():\n\t\t\tcontinue\n\n\t\tif zombieData[c].zombieType == \"normal\":\n\t\t\tzombieData[c].node.get_node(\"zombieNormal\").show()\n\t\t\tzombieData[c].node.get_node(\"zombieHat\").hide()\n\t\t\tif playerTime < zombieData[c].zombieStart: #Before start\n\t\t\t\tzombieData[c].node.get_node(\"zombieNormal\").set_margin(MARGIN_TOP, 0)\n\t\t\t\t\n\t\t\telif playerTime < (zombieData[c].zombieStart + (zombieData[c].zombieTime \/ 2)): #Going up\n\t\t\t\tzombieData[c].node.get_node(\"zombieNormal\").set_margin(MARGIN_TOP, ((-190 \/ zombieData[c].zombieTime) * playerTime) + (zombieData[c].zombieStart * (190 \/ zombieData[c].zombieTime)))\n\t\t\t\t\n\t\t\telif playerTime < (zombieData[c].zombieStart + zombieData[c].zombieTime): #Going down\n\t\t\t\tzombieData[c].node.get_node(\"zombieNormal\").set_margin(MARGIN_TOP, ((190 \/ zombieData[c].zombieTime) * playerTime) - ((zombieData[c].zombieStart + zombieData[c].zombieTime) * (190 \/ zombieData[c].zombieTime)))\n\t\t\t\t\n\t\t\telse: #playerTime >= (zombieData[c].zombieStart + zombieData[c].zombieTime): #Reset zombieStart\n\t\t\t\tzombieData[c].node.get_node(\"zombieNormal\").set_margin(MARGIN_TOP, 0)\n\t\t\t\tzombieStart(c)\n\t\t\t\t\n\t\telif zombieData[c].zombieType == \"hat\":\n\t\t\tzombieData[c].node.get_node(\"zombieNormal\").hide()\n\t\t\tzombieData[c].node.get_node(\"zombieHat\").show()\n\t\t\tif playerTime < zombieData[c].zombieStart: #Before start\n\t\t\t\tzombieData[c].node.get_node(\"zombieHat\").set_margin(MARGIN_TOP, 0)\n\t\t\t\t\n\t\t\telif playerTime < (zombieData[c].zombieStart + (zombieData[c].zombieTime \/ 2)): #Going up\n\t\t\t\tzombieData[c].node.get_node(\"zombieHat\").set_margin(MARGIN_TOP, ((-190 \/ zombieData[c].zombieTime) * playerTime) + (zombieData[c].zombieStart * (190 \/ zombieData[c].zombieTime)))\n\t\t\t\t\n\t\t\telif playerTime < (zombieData[c].zombieStart + zombieData[c].zombieTime): #Going down\n\t\t\t\tzombieData[c].node.get_node(\"zombieHat\").set_margin(MARGIN_TOP, ((190 \/ zombieData[c].zombieTime) * playerTime) - ((zombieData[c].zombieStart + zombieData[c].zombieTime) * (190 \/ zombieData[c].zombieTime)))\n\t\t\t\t\n\t\t\telse: #playerTime >= (zombieData[c].zombieStart + zombieData[c].zombieTime): #Reset zombieStart\n\t\t\t\tzombieData[c].node.get_node(\"zombieHat\").set_margin(MARGIN_TOP, 0)\n\t\t\t\tzombieStart(c)\n\t\telif zombieData[c].zombieType == \"missing\":\n\t\t\tzombieData[c].node.get_node(\"zombieNormal\").hide()\n\t\t\tzombieData[c].node.get_node(\"zombieHat\").hide()\n\t\telse:\n\t\t\tprint(\"Variable zombieType is set to an incorrect value.\")\n\t\t\tcontinue\n","old_contents":"extends Node\n\n#get_node(\"\/root\/global\").enteringOS <--This is the proper method to quit to desktop.\n#get_node(\"\/root\/global\").enteringMenu <--This is the proper method to get to the main menu.\n#get_node(\"\/root\/global\").currentDifficulty <--This is the proper method to get the difficulty.\n#get_node(\"\/root\/global\").disableInputForXMs(1000) <--This is the proper method to rapid inputs.\n\n#Time based variables.\n#var eclipseRatio = null\n\n#Player stuff.\nvar playerScore = null\nvar playerTime = null #Units are in seconds.\nvar playerDifficulty = null #This has to be between 0 and 3 to match the size of xSizeArray and ySizeArray.\n#var specialAbilityAmmo = null\nvar tombArray = []\nvar tombOrigen = null\nvar tombs = null\nvar tombNumberTotal = 0 \nvar zombieData = [] #[{\"node\":tomb, \"zombieTime\":time, \"zombieStart\":rand_range(0, 4)}, {...}, ...]\n#zombieData[0] = {\"node\":tomb, \"zombieTime\":time}\n#zombieData[1].node = tomb\nconst xTombSpacing = 200\nconst yTombSpacing = 175\nvar tombStyle = null\nvar tombList = []\nvar time = null\n\nvar xSizeArray = [3, 3, 4, 6] #[Easy, Normal, Hard, Insane]\nvar ySizeArray = [1, 2, 3, 3] #[Easy, Normal, Hard, Insane]\nvar playerHealth = [3, 3, 3, 3] #[Easy, Normal, Hard, Insane]\nvar voidTombs = [0, 1, 2, 3] #[Easy, Normal, Hard, Insane] These tomb placeholders do not have any zombies coming up.\nvar howDiedTombCount = 3 #this is a count of the number of different flavor texts that go on tombstones.\n#var tombArray = [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\", \"J\", \"K\", \"L\", \"M\", \"N\", \"O\", \"P\", \"Q\", \"R\", \"S\", \"T\", \"U\", \"V\", \"W\", \"X\", \"Y\", \"Z\", \",\", \".\", \"_\", \"-\"]\n\nfunc zombieStart(index): #Don't call unless zombie is below ground.\n\tzombieData[index].zombieTime = rand_range(1.85, 2.15) #This needs to be in seconds to match playerTime.\n\tzombieData[index].zombieStart = max(playerTime, 1) + rand_range(0, 4) #This needs to be in seconds to match playerTime.\n\nfunc zombieDataInit():\n\tzombieData.resize(0)\n\tfor x in range(xSizeArray[playerDifficulty]):\n\t\tfor y in range(ySizeArray[playerDifficulty]):\n\t\t\tzombieData.append({\"node\":tombArray[x][y], \"zombieTime\":0, \"zombieStart\":0, \"MARGIN_TOP\":tombArray[x][y].get_margin(MARGIN_TOP)})\n\tfor c in range(zombieData.size()):\n\t\tif zombieData.empty():\n\t\t\tcontinue\n\t\tzombieStart(c)\n\nfunc getIndexFromNode(node): #When passed a node, find that node's index inside of zombieData.\n\tfor c in range(zombieData.size()):\n\t\tif zombieData.empty():\n\t\t\tcontinue\n\t\tif zombieData[c].node == node:\n\t\t\treturn c\n\treturn null\n\nfunc _ready():\n\tget_tree().set_auto_accept_quit(false) #Enables: _notification(what) to recieve MainLoop.NOTIFICATION_WM_QUIT_REQUEST\n\tset_process(true) #Enables: _process(delta) to run every frame.\n\tplayerDifficulty = get_node(\"\/root\/global\").currentDifficulty\n\t\n\ttombs = get_node(\"tombs\")\n\t\n\t#for g in range(glyphArray.size()):\n\t#\tn = load(\"res:\/\/scene\/getNameGlyph.xscn\").instance()\n\t#\tglyph.add_child(n)\n\t\n\ttombArray.resize(0) #This initiallizes the tombArray to empty before we start adding to it.\n\tfor x in range(xSizeArray[playerDifficulty]):\n\t\ttombArray.append([])\n\t\tfor y in range(ySizeArray[playerDifficulty]):\n\t\t\ttombArray[x].append(load(\"res:\/\/scene\/zombiesGoTomb.xscn\").instance())\n\t\t\t#print(\"Hello World \" + str(x) + \", \" + str(y))\n\t\t\t#MARGIN_LEFT, MARGIN_TOP, MARGIN_RIGHT, MARGIN_BOTTOM\n\t\t\ttombArray[x][y].set_margin(MARGIN_LEFT, 1280\/2 - xSizeArray[playerDifficulty]*xTombSpacing\/2 + x * xTombSpacing + floor(rand_range( -xTombSpacing*.2, xTombSpacing*.2)))\n\t\t\ttombArray[x][y].set_margin(MARGIN_TOP, 720\/2 - ySizeArray[playerDifficulty]*yTombSpacing\/2 + y * yTombSpacing)\n\t\t\ttombs.add_child(tombArray[x][y])\n\t\t\t\n\t\n\t#Init settings for round.\n\t#eclipseRatio = (difficulty - 1) * 0.2\n\tplayerScore = 0\n\tplayerTime = 0\n\t#specialAbilityAmmo = 0\n\t\n\tcreateTombList()\n\t\n\tfor c in range(playerHealth[playerDifficulty]): #Make normal tombs for player health.\n\t\tif tombList.empty():\n\t\t\tcontinue\n\t\tvar i = floor(rand_range(0, tombList.size()))\n\t\ttombList[i].get_node(\"normalTomb\").show()\n\t\ttombList[i].get_node(\"frontHole\").show()\n\t\ttombList[i].get_node(\"backHole\").show()\n\t\t#tombList[i].get_node(\"rubbleHole\").show()\n\t\ttombList.remove(i)\n\t\t\n\tfor c in range(voidTombs[playerDifficulty]): #Make void tombs.\n\t\tif tombList.empty():\n\t\t\tcontinue\n\t\tvar i = floor(rand_range(0, tombList.size()))\n\t\ttombList[i].get_node(\"rubbleHole\").show()\n\t\ttombList.remove(i)\n\t\n\tfor i in range(tombList.size()): #Make the rest of the tombs.\n\t\tif tombList.empty():\n\t\t\tcontinue\n\t\tvar r = floor(rand_range(0, 2))\n\t\tif r == 0:\n\t\t\ttombList[i].get_node(\"brokenTomb\").show()\n\t\t\ttombList[i].get_node(\"frontHole\").show()\n\t\t\ttombList[i].get_node(\"backHole\").show()\n\t\t\t#tombList[i].get_node(\"rubbleHole\").show()\n\t\telif r == 1:\n\t\t\ttombList[i].get_node(\"missingTomb\").show()\n\t\t\ttombList[i].get_node(\"frontHole\").show()\n\t\t\ttombList[i].get_node(\"backHole\").show()\n\t\t\t#tombList[i].get_node(\"rubbleHole\").show()\n\t\telse:\n\t\t\tpass\n\t\t\t\n\tcreateTombList()\n\tzombieDataInit()\n\t\n\nfunc createTombList(): #Create List\n\ttombList.resize(0)\n\tfor x in range(xSizeArray[playerDifficulty]):\n\t\tfor y in range(ySizeArray[playerDifficulty]):\n\t\t\ttombList.append(tombArray[x][y])\n\nfunc _notification(what):\n\tif (what==MainLoop.NOTIFICATION_WM_QUIT_REQUEST):\n\t\t#Submit current game and save highArray before exiting.\n\t\tget_node(\"\/root\/global\").enteringOS = true\n\t\tget_node(\"\/root\/global\").updateHighScore(rand_range(0, 9999), rand_range(0, 59))\n\nfunc _process(delta):\n\t#This is ran every frame.\n\t#get_node(\"\/root\/global\").timeString(time)\n\tplayerTime = playerTime + delta\n\tget_node(\"displayPlayerTimeOnScreen\").set_text(get_node(\"\/root\/global\").timeString(playerTime))\n\ttime = int(floor(playerTime))\n\t# Check for death.\n\tif playerDifficulty == 3:\n\t\t#isDied()= true\n\t\tpass\n\t\t\n\tzombieMove()\n\t\t\n\t\t#if time <= 2:\n\t\t#\tzombieMove() = true\n\t\t#else:\n\t\t#\tzombieMove() = false\n\nfunc isDied():\n\tget_node(\"\/root\/global\").enteringMenu = true\n\tget_node(\"\/root\/global\").updateHighScore(playerScore, playerTime)\n\nfunc _on_backGround_pressed():\n\tif get_node(\"\/root\/global\").isInputEnabled():\n\t\t#Submit current game and save highArray before ending round.\n\t\t#updateHighScore(score, time)\n\t\tget_node(\"\/root\/global\").enteringMenu = true\n\t\tget_node(\"\/root\/global\").updateHighScore(rand_range(0, 9999), rand_range(0, 59))\n\nfunc zombieMove(): #Move zombies up, then down, based on playerTime, zombieTime, zombieStart.\n\tfor c in range(zombieData.size()):\n\t\tif zombieData.empty():\n\t\t\tcontinue\n\t\tzombieData[c].node.get_node(\"zombieNormal\").show()\n\t\tif playerTime < zombieData[c].zombieStart: #Before start\n\t\t\tzombieData[c].node.get_node(\"zombieNormal\").set_margin(MARGIN_TOP, 0)\n\t\t\t\n\t\telif playerTime < (zombieData[c].zombieStart + (zombieData[c].zombieTime \/ 2)): #Going up\n\t\t\tzombieData[c].node.get_node(\"zombieNormal\").set_margin(MARGIN_TOP, ((-190 \/ zombieData[c].zombieTime) * playerTime) + (zombieData[c].zombieStart * (190 \/ zombieData[c].zombieTime)))\n\t\t\t\n\t\telif playerTime < (zombieData[c].zombieStart + zombieData[c].zombieTime): #Going down\n\t\t\tzombieData[c].node.get_node(\"zombieNormal\").set_margin(MARGIN_TOP, ((190 \/ zombieData[c].zombieTime) * playerTime) - ((zombieData[c].zombieStart + zombieData[c].zombieTime) * (190 \/ zombieData[c].zombieTime)))\n\t\t\t\n\t\telse: #playerTime >= (zombieData[c].zombieStart + zombieData[c].zombieTime): #Reset zombieStart\n\t\t\tzombieData[c].node.get_node(\"zombieNormal\").set_margin(MARGIN_TOP, 0)\n\t\t\tzombieStart(c)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"f91fe01f3ec557fedcb9994fa4cdfdec6cf80c83","subject":"Set the reset position from the initial start position in KC3D","message":"Set the reset position from the initial start position in KC3D\n\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"3d\/kinematic_character\/player\/cubio.gd","new_file":"3d\/kinematic_character\/player\/cubio.gd","new_contents":"extends KinematicBody\n\nconst MAX_SPEED = 3\nconst JUMP_SPEED = 5\nconst ACCELERATION = 2\nconst DECELERATION = 4\n\nonready var camera = $Target\/Camera\nonready var gravity = -ProjectSettings.get_setting(\"physics\/3d\/default_gravity\")\nonready var start_position = translation\nvar velocity: Vector3\n\nfunc _physics_process(delta):\n\tif Input.is_action_just_pressed(\"exit\"):\n\t\tget_tree().quit()\n\tif Input.is_action_just_pressed(\"reset_position\"):\n\t\ttranslation = start_position\n\n\tvar dir = Vector3()\n\tdir.x = Input.get_action_strength(\"move_right\") - Input.get_action_strength(\"move_left\")\n\tdir.z = Input.get_action_strength(\"move_back\") - Input.get_action_strength(\"move_forward\")\n\n\t# Get the camera's transform basis, but remove the X rotation such\n\t# that the Y axis is up and Z is horizontal.\n\tvar cam_basis = camera.global_transform.basis\n\tvar basis = cam_basis.rotated(cam_basis.x, -cam_basis.get_euler().x)\n\tdir = basis.xform(dir)\n\n\t# Limit the input to a length of 1. length_squared is faster to check.\n\tif dir.length_squared() > 1:\n\t\tdir \/= dir.length()\n\n\t# Apply gravity.\n\tvelocity.y += delta * gravity\n\n\t# Using only the horizontal velocity, interpolate towards the input.\n\tvar hvel = velocity\n\thvel.y = 0\n\n\tvar target = dir * MAX_SPEED\n\tvar acceleration\n\tif dir.dot(hvel) > 0:\n\t\tacceleration = ACCELERATION\n\telse:\n\t\tacceleration = DECELERATION\n\n\thvel = hvel.linear_interpolate(target, acceleration * delta)\n\n\t# Assign hvel's values back to velocity, and then move.\n\tvelocity.x = hvel.x\n\tvelocity.z = hvel.z\n\tvelocity = move_and_slide(velocity, Vector3.UP)\n\n\t# Jumping code. is_on_floor() must come after move_and_slide().\n\tif is_on_floor() and Input.is_action_pressed(\"jump\"):\n\t\tvelocity.y = JUMP_SPEED\n\n\nfunc _on_tcube_body_entered(body):\n\tif body == self:\n\t\tget_node(\"WinText\").show()\n","old_contents":"extends KinematicBody\n\nconst MAX_SPEED = 3\nconst JUMP_SPEED = 5\nconst ACCELERATION = 2\nconst DECELERATION = 4\n\nonready var gravity = -ProjectSettings.get_setting(\"physics\/3d\/default_gravity\")\nvar velocity: Vector3\n\nfunc _physics_process(delta):\n\tif Input.is_action_just_pressed(\"exit\"):\n\t\tget_tree().quit()\n\tif Input.is_action_just_pressed(\"reset_position\"):\n\t\ttranslation = Vector3(-3, 4, 8)\n\n\tvar dir = Vector3()\n\tdir.x = Input.get_action_strength(\"move_right\") - Input.get_action_strength(\"move_left\")\n\tdir.z = Input.get_action_strength(\"move_back\") - Input.get_action_strength(\"move_forward\")\n\n\t# Get the camera's transform basis, but remove the X rotation such\n\t# that the Y axis is up and Z is horizontal.\n\tvar cam_basis = $Target\/Camera.global_transform.basis\n\tvar basis = cam_basis.rotated(cam_basis.x, -cam_basis.get_euler().x)\n\tdir = basis.xform(dir)\n\n\t# Limit the input to a length of 1. length_squared is faster to check.\n\tif dir.length_squared() > 1:\n\t\tdir \/= dir.length()\n\n\t# Apply gravity.\n\tvelocity.y += delta * gravity\n\n\t# Using only the horizontal velocity, interpolate towards the input.\n\tvar hvel = velocity\n\thvel.y = 0\n\n\tvar target = dir * MAX_SPEED\n\tvar acceleration\n\tif dir.dot(hvel) > 0:\n\t\tacceleration = ACCELERATION\n\telse:\n\t\tacceleration = DECELERATION\n\n\thvel = hvel.linear_interpolate(target, acceleration * delta)\n\n\t# Assign hvel's values back to velocity, and then move.\n\tvelocity.x = hvel.x\n\tvelocity.z = hvel.z\n\tvelocity = move_and_slide(velocity, Vector3.UP)\n\n\t# Jumping code. is_on_floor() must come after move_and_slide().\n\tif is_on_floor() and Input.is_action_pressed(\"jump\"):\n\t\tvelocity.y = JUMP_SPEED\n\n\nfunc _on_tcube_body_entered(body):\n\tif body == self:\n\t\tget_node(\"WinText\").show()\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"8b706b13e37df711c1d41262e268f92e18b80703","subject":"added sprite rotation for direction","message":"added sprite rotation for direction\n","repos":"Anatolij-Grigorjev\/GodotExperimentBeatIt","old_file":"game\/player\/player.gd","new_file":"game\/player\/player.gd","new_contents":"extends Area2D\n#quick access to constnats\nonready var CONST = get_node(\"\/root\/const\")\n\nconst MOVESPEED_X = 100\nconst MOVESPEED_Y = 50\n\n#quick access to animator\nonready var anim = get_node(\"anim\")\nonready var sprites_attack = get_node(\"sprites_attack\")\nonready var sprites_move = get_node(\"sprites_move\")\n\nvar curr_anim = \"\"\nvar current_sprite\n\nfunc _fixed_process(delta):\n\t\n\tvar next_anim = CONST.PLAYER_ANIM_IDLE\n\tcurrent_sprite = sprites_move\n\t#gather inputs\n\tvar move_left = Input.is_action_pressed(\"move_left\")\n\tvar move_right = Input.is_action_pressed(\"move_right\")\n\tvar move_up = Input.is_action_pressed(\"move_up\")\n\tvar move_down = Input.is_action_pressed(\"move_down\")\n\t\n\t\n\tvar pos = get_pos()\n\tvar move_vector = Vector2()\n\tif (move_left):\n\t\tmove_vector.x = -MOVESPEED_X\n\tif (move_right):\n\t\tmove_vector.x = MOVESPEED_X\n\tif (move_up):\n\t\tmove_vector.y = -MOVESPEED_Y\n\tif (move_down):\n\t\tmove_vector.y = MOVESPEED_Y\n\t\n\t#integrate new position\n\tset_pos(pos + (move_vector * delta))\n\t\n\t#some movement involved\n\tif (move_vector.length_squared() != 0):\n\t\tnext_anim = CONST.PLAYER_ANIM_WALK\n\t\t#flip sprite if direction change\n\t\tif (move_vector.x < 0 and move_left):\n\t\t\tcurrent_sprite.set_scale(Vector2(-1.0, 1.0))\n\t\telif (move_vector.x > 0 and move_right):\n\t\t\tcurrent_sprite.set_scale(Vector2(1.0, 1.0))\n\t\n\n\tif (curr_anim != next_anim):\n\t\tcurr_anim = next_anim\n\t\tanim.play(curr_anim)\n\n\nfunc _ready():\n\tset_fixed_process(true)\n\tpass\n\n\n","old_contents":"extends Area2D\n#quick access to constnats\nonready var CONST = get_node(\"\/root\/const\")\n\nconst MOVESPEED_X = 100\nconst MOVESPEED_Y = 50\n\n#quick access to animator\nonready var anim = get_node(\"anim\")\n\nvar curr_anim = \"\"\n\nfunc _fixed_process(delta):\n\t\n\tvar next_anim = CONST.PLAYER_ANIM_IDLE\n\t#gather inputs\n\tvar move_left = Input.is_action_pressed(\"move_left\")\n\tvar move_right = Input.is_action_pressed(\"move_right\")\n\tvar move_up = Input.is_action_pressed(\"move_up\")\n\tvar move_down = Input.is_action_pressed(\"move_down\")\n\t\n\tvar pos = get_pos()\n\tvar move_vector = Vector2()\n\tif (move_left):\n\t\tmove_vector.x = -MOVESPEED_X\n\tif (move_right):\n\t\tmove_vector.x = MOVESPEED_X\n\tif (move_up):\n\t\tmove_vector.y = -MOVESPEED_Y\n\tif (move_down):\n\t\tmove_vector.y = MOVESPEED_Y\n\t\n\t#integrate new position\n\tset_pos(pos + (move_vector * delta))\n\t\n\t#some movement involved\n\tif (move_vector.length_squared() != 0):\n\t\tnext_anim = CONST.PLAYER_ANIM_WALK\n\t\n\tif (curr_anim != next_anim):\n\t\tcurr_anim = next_anim\n\t\tanim.play(curr_anim)\n\n\nfunc _ready():\n\tset_fixed_process(true)\n\tpass\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"bc6c7a213c22923d93bd7d79fb68753b799d7c55","subject":"Fixed boss room break","message":"Fixed boss room break\n","repos":"P1X-in\/rat-is-fat","old_file":"scripts\/map\/rooms\/boss1_room.gd","new_file":"scripts\/map\/rooms\/boss1_room.gd","new_contents":"extends \"res:\/\/scripts\/map\/rooms\/abstract_room.gd\"\n\nfunc _init():\n self.room = [\n [ 4, 5, 5, 5, 6, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6],\n [ 7, 0, 29, 0, 9, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9],\n [12, 26, 27, 28, 11, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9],\n [ 4, 21, 19, 20, 5, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9],\n [ 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9],\n [ 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9],\n [ 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9],\n [ 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9],\n [ 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9],\n [ 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9],\n [12, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11],\n ]\n\n self.enemies = [\n [14, 2, 'doge_prime'],\n ]\n\n self.doors = [\n [1, 2, 'south'],\n [1, 3, 'north']\n ]\n\n self.exits = [\n [2, 1, 'next']\n ]\n","old_contents":"extends \"res:\/\/scripts\/map\/rooms\/abstract_room.gd\"\n\nfunc _init():\n self.room = [\n [ 4, 5, 5, 5, 6, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6],\n [ 7, 0, 29, 0, 9, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9],\n [12, 26, 27, 28, 11, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9],\n [ 4, 21, 19, 20, 5, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9],\n [ 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9],\n [ 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9],\n [ 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9],\n [ 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9],\n [ 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9],\n [ 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9],\n [12, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11],\n ]\n\n self.enemies = [\n [14, 2, 'noser'],\n ]\n\n self.doors = [\n [1, 2, 'south'],\n [1, 3, 'north']\n ]\n\n self.exits = [\n [2, 1, 'next']\n ]\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"362b77aacb394ed3cb400dc3d1f040bba44a92a7","subject":"Change mouse cursor when mouse button is pressed\/released","message":"Change mouse cursor when mouse button is pressed\/released\n","repos":"NiclasEriksen\/godot_rpg","old_file":"scripts\/global.gd","new_file":"scripts\/global.gd","new_contents":"\r\nextends Node\r\n\r\nvar currentScene = null\r\nvar map = null\r\nonready var cur1 = load(\"res:\/\/resources\/ui\/cursor1.png\")\r\nonready var cur2 = load(\"res:\/\/resources\/ui\/cursor2.png\")\r\n\r\nvar PlayerName = \"Niclas\"\r\nvar MAP_WIDTH = 40\r\nvar MAP_HEIGHT = 30\r\n\r\nfunc _ready():\r\n\t# print(currentScene, \"hei\")\r\n\tcurrentScene = get_tree().get_root().get_child(get_tree().get_root().get_child_count() -1)\r\n\tset_process_input(true)\r\n\r\nfunc _input(event):\r\n\tif event.type == InputEvent.MOUSE_BUTTON:\r\n\t\tif event.is_pressed():\r\n\t\t\tInput.set_custom_mouse_cursor(cur2)\r\n\t\telse:\r\n\t\t\tInput.set_custom_mouse_cursor(cur1)\r\n\r\nfunc set_scene(scene):\r\n\tcurrentScene.queue_free()\r\n\tvar s = ResourceLoader.load(scene)\r\n\tcurrentScene = s.instance()\r\n\tget_tree().get_root().add_child(currentScene)\r\n\r\nfunc set_map(mapname):\r\n\tvar mappath = \"res:\/\/maps\/\" + mapname\r\n\tif (File.new().file_exists(mappath)):\r\n\t\tmap = mappath\r\n\t\treturn true\r\n\telse:\r\n\t\tprint(\"Map not found: \", mappath)\r\n\t\treturn false\r\n\r\nfunc get_map():\r\n\treturn map\r\n\r\nfunc get_player_name():\r\n\treturn PlayerName\r\n","old_contents":"\r\nextends Node\r\n\r\nvar currentScene = null\r\nvar map = null\r\n\r\nvar PlayerName = \"Niclas\"\r\nvar MAP_WIDTH = 40\r\nvar MAP_HEIGHT = 30\r\n\r\nfunc _ready():\r\n\t# print(currentScene, \"hei\")\r\n\tcurrentScene = get_tree().get_root().get_child(get_tree().get_root().get_child_count() -1)\r\n\r\nfunc set_scene(scene):\r\n\tcurrentScene.queue_free()\r\n\tvar s = ResourceLoader.load(scene)\r\n\tcurrentScene = s.instance()\r\n\tget_tree().get_root().add_child(currentScene)\r\n\r\nfunc set_map(mapname):\r\n\tvar mappath = \"res:\/\/maps\/\" + mapname\r\n\tif (File.new().file_exists(mappath)):\r\n\t\tmap = mappath\r\n\t\treturn true\r\n\telse:\r\n\t\tprint(\"Map not found: \", mappath)\r\n\t\treturn false\r\n\r\nfunc get_map():\r\n\treturn map\r\n\r\nfunc get_player_name():\r\n\treturn PlayerName\r\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"ba614c5f6ad19401660df0d71ff2b47555645a05","subject":"better message","message":"better message\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/GridMan.gd","new_file":"src\/scripts\/GridMan.gd","new_contents":"extends Spatial\n\n# Is there a better way to do this?\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\n# Block selection handling.\nvar offClick = false\nvar selectedBlocks = []\n\n# Puzzle vars.\nvar puzzle\nvar puzzleLoaded = false\nvar blockNodes = {}\n\nvar puzzleScn\n\n# Beam stuff.\nconst beamScn = preload( \"res:\/\/blocks\/block.scn\" )\nconst Beam = preload(\"res:\/\/scripts\/Blocks\/Beam.gd\")\n\n# sounds\nvar samplePlayer = SamplePlayer.new()\n\nfunc addPickledBlock(block):\n\tvar b = block.toNode()\n\n\t# TODO any special treatment for the wild blocks?\n\t# TODO keep track of puzzle.lasers ? How to?\n\tblockNodes[block.blockPos] = b\n\n\tif puzzleLoaded:\n\t\t# keep pickled block\n\t\tpuzzle.shape[block.blockPos] = block\n\n\t\t# keep track of puzzle.pairCounts\n\t\tvar layer = calcBlockLayerVec(b.blockPos)\n\t\tif b.getBlockType() == 2:\n\t\t\twhile puzzle.pairCount.size() <= layer:\n\t\t\t\tpuzzle.pairCount.append(0)\n\t\t\tpuzzle.puzzleLayers = puzzle.pairCount.size() - 1\n\t\t\tpuzzle.pairCount[layer] += 0.5\n\n\n\tadd_child(b)\n\treturn b\n\nfunc get_block(pos):\n\tif blockNodes.has(pos):\n\t\treturn blockNodes[pos]\n\telse:\n\t\treturn null\n\n# unused key argument needed for the tween_complete signal\nfunc remove_block(block=null, key=null):\n\tvar block_node = blockNodes[block.blockPos]\n\tpuzzle.shape[block_node.blockPos] = null\n\n\tif block_node == null:\n\t\treturn\n\n\tblockNodes[block_node.blockPos] = null\n\n\tfor child in block_node.get_children():\n\t\tblock_node.remove_and_delete_child(child)\n\tremove_and_delete_child(block_node)\n\n# Sets the puzzle for this GridMan.\nfunc set_puzzle(puzz):\n\t# verify puzzle\n\tif puzz == null:\n\t\tprint(\"INVALID PUZZLE\")\n\t\treturn\n\n\t# delete all current nodes\n\tif puzzle != null:\n\t\tfor pos in puzzle.shape:\n\t\t\tremove_block(puzzle.shape[pos])\n\tpuzzleLoaded = false\n\t#print( puzzDict.type() )\n\tprint(\"This is puzz: \", puzz )\n\n\tpuzzle = puzz\n\n\t# Load in the puzzle from dictionary\n\t#puzzle.fromDict(puzzDict)\n\n\t\t# # I can do my own counting!\n\t# needed for adding blocks in the editor\n\tfor k in puzzle.shape:\n\t\t# Create a block node, add it to the tree\n\t\taddPickledBlock(puzzle.shape[k])\n\tpuzzleLoaded = true\n\n# Clears any selected blocks. WE SHOULD FIX THIS, THERE CAN ONLY BE ONE BLOCK SELECTED AT ANY ONE TIME, NO NEED FOR AN ARRAY!\nfunc clearSelection():\n\tfor bl in selectedBlocks:\n\t\tvar blo = get_node( bl )\n\t\tblo.setSelected(false)\n\t\tblo.scaleTweenNode(1.0).start()\n\tselectedBlocks = []\n\n# Add the selected block to the selected list. WE SHOULD FIX THIS, IT ONLY NEEDS TO STORE IT, NOT AN ARRAY!\nfunc addSelected(bl):\n\tselectedBlocks.append(bl)\n\n# Used for the multiplayer mode to force click a block on their side.\nfunc forceClickBlock( pos ):\n\tblockNodes[pos].forceClick()\n\nfunc clickBlock( name ):\n\t#now check if that was the second block we picked. If it was, we want to\n\t#unselect the blocks again\n\tif (offClick):\n\t\toffClick = false\n\t\taddSelected(name)\n\t\tclearSelection()\n\telse:\n\t\toffClick = true;\n\t\taddSelected(name)\n\n# Calculates the layer that a block is on.\n# COPY OF FUNCTION IN PUZZLEMAN, IS THERE A BETTER WAY TO DO THIS?!\nfunc calcBlockLayer( x, y, z ):\n\treturn max( max( abs( x ), abs( y ) ), abs( z ) )\nfunc calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\nfunc beatenWithScore(othersScore):\n\tprint( \"BEATEN!\" )\n\tvar pauseMenu = get_tree().get_root().get_node( \"Spatial\" ).get_node( \"Camera\" ).pauseMenu\n\tpauseMenu.set_title(\"Game Over\")\n\tpauseMenu.set_text(\"GAME OVER\\nYou've been beaten with time: \" + puzzleScn.formatTime(othersScore))\n\tpauseMenu.popup_centered()\n\nfunc win():\n\tprint( \"GAME OVER!\" )\n\tvar pauseMenu = get_tree().get_root().get_node( \"Spatial\" ).get_node( \"Camera\" ).pauseMenu\n\tpauseMenu.set_title(\"Game Over\")\n\tpauseMenu.set_text(\"GAME OVER\\nYou win with time: \" + puzzleScn.formatTime(get_parent().get_parent().time.val))\n\tpauseMenu.popup_centered()\n\n\n# Handles keeping track of pairs being removed.\nfunc popPair( pos ):\n\tvar blayer = calcBlockLayerVec( pos )\n\tpuzzle.pairCount[blayer] -= 1\n\n\tif( puzzle.pairCount[blayer] == 0 ):\n\t\tprint(\"LAYER CLEARED\")\n\t\tif blayer == 1:\n\t\t\twin()\n\n\t\tfor b in puzzle.shape:\n\t\t\tif not ( puzzle.shape[b] == null ):\n\t\t\t\tif calcBlockLayerVec( b ) == blayer:\n\t\t\t\t\tif blockNodes[b].getBlockType() == BLOCK_LASER:\n\t\t\t\t\t\tblockNodes[b].forceActivate()\n\n\t\t# Fire beams.\n\t\tvar beamNum = 0\n\t\tfor l in range( puzzle.lasers.size() ):\n\t\t\tif calcBlockLayerVec( puzzle.lasers[l][0] ) == blayer:\n\t\t\t\t# Firin mah lazerz!\n\t\t\t\tvar beam = beamScn.instance()\n\n\t\t\t\tbeam.set_name( str(blayer) + \"_beam_\" + str(beamNum) )\n\t\t\t\tbeamNum += 1\n\t\t\t\tbeam.set_script( Beam )\n\n\t\t\t\tadd_child( beam )\n\t\t\t\tbeam.fire( puzzle.lasers[l][0], puzzle.lasers[l][1] )\n\n\t\t\t\tsamplePlayer.play( \"soundslikewillem_hitting_slinky\" )\n\n\nfunc _init():\n\t# Load sound\n\tsamplePlayer.set_voice_count(10)\n\tsamplePlayer.set_sample_library(ResourceLoader.load(\"new_samplelibrary.xml\"))\n\tprint(\"GridMan initialized\")\n\nfunc _ready():\n\tsetupCam()\n\n\tpuzzleScn = get_parent().get_parent()\n\n\nfunc setupCam():\n\tvar cam = get_tree().get_root().get_node( \"Spatial\/Camera\" )\n\tif cam == null or puzzle == null:\n\t\treturn\n\tvar totalSize = ( puzzle.puzzleLayers * 2 + 1 )\n\tcam.distance.val = 4.5 * totalSize\n\tcam.distance.min_ = 3 * totalSize\n\tcam.distance.max_ = 10 * totalSize\n\tcam.recalculate_camera()\n\n\n","old_contents":"extends Spatial\n\n# Is there a better way to do this?\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\n# Block selection handling.\nvar offClick = false\nvar selectedBlocks = []\n\n# Puzzle vars.\nvar puzzle\nvar puzzleLoaded = false\nvar blockNodes = {}\n\nvar puzzleScn\n\n# Beam stuff.\nconst beamScn = preload( \"res:\/\/blocks\/block.scn\" )\nconst Beam = preload(\"res:\/\/scripts\/Blocks\/Beam.gd\")\n\n# sounds\nvar samplePlayer = SamplePlayer.new()\n\nfunc addPickledBlock(block):\n\tvar b = block.toNode()\n\n\t# TODO any special treatment for the wild blocks?\n\t# TODO keep track of puzzle.lasers ? How to?\n\tblockNodes[block.blockPos] = b\n\n\tif puzzleLoaded:\n\t\t# keep pickled block\n\t\tpuzzle.shape[block.blockPos] = block\n\n\t\t# keep track of puzzle.pairCounts\n\t\tvar layer = calcBlockLayerVec(b.blockPos)\n\t\tif b.getBlockType() == 2:\n\t\t\twhile puzzle.pairCount.size() <= layer:\n\t\t\t\tpuzzle.pairCount.append(0)\n\t\t\tpuzzle.puzzleLayers = puzzle.pairCount.size() - 1\n\t\t\tpuzzle.pairCount[layer] += 0.5\n\n\n\tadd_child(b)\n\treturn b\n\nfunc get_block(pos):\n\tif blockNodes.has(pos):\n\t\treturn blockNodes[pos]\n\telse:\n\t\treturn null\n\n# unused key argument needed for the tween_complete signal\nfunc remove_block(block=null, key=null):\n\tvar block_node = blockNodes[block.blockPos]\n\tpuzzle.shape[block_node.blockPos] = null\n\n\tif block_node == null:\n\t\treturn\n\n\tblockNodes[block_node.blockPos] = null\n\n\tfor child in block_node.get_children():\n\t\tblock_node.remove_and_delete_child(child)\n\tremove_and_delete_child(block_node)\n\n# Sets the puzzle for this GridMan.\nfunc set_puzzle(puzz):\n\t# verify puzzle\n\tif puzz == null:\n\t\tprint(\"INVALID PUZZLE\")\n\t\treturn\n\n\t# delete all current nodes\n\tif puzzle != null:\n\t\tfor pos in puzzle.shape:\n\t\t\tremove_block(puzzle.shape[pos])\n\tpuzzleLoaded = false\n\t#print( puzzDict.type() )\n\tprint(\"This is puzz: \", puzz )\n\t\n\tpuzzle = puzz\n\n\t# Load in the puzzle from dictionary\n\t#puzzle.fromDict(puzzDict)\n\n\t\t# # I can do my own counting!\n\t# needed for adding blocks in the editor\n\tfor k in puzzle.shape:\n\t\t# Create a block node, add it to the tree\n\t\taddPickledBlock(puzzle.shape[k])\n\tpuzzleLoaded = true\n\n# Clears any selected blocks. WE SHOULD FIX THIS, THERE CAN ONLY BE ONE BLOCK SELECTED AT ANY ONE TIME, NO NEED FOR AN ARRAY!\nfunc clearSelection():\n\tfor bl in selectedBlocks:\n\t\tvar blo = get_node( bl )\n\t\tblo.setSelected(false)\n\t\tblo.scaleTweenNode(1.0).start()\n\tselectedBlocks = []\n\n# Add the selected block to the selected list. WE SHOULD FIX THIS, IT ONLY NEEDS TO STORE IT, NOT AN ARRAY!\nfunc addSelected(bl):\n\tselectedBlocks.append(bl)\n\n# Used for the multiplayer mode to force click a block on their side.\nfunc forceClickBlock( pos ):\n\tblockNodes[pos].forceClick()\n\nfunc clickBlock( name ):\n\t#now check if that was the second block we picked. If it was, we want to\n\t#unselect the blocks again\n\tif (offClick):\n\t\toffClick = false\n\t\taddSelected(name)\n\t\tclearSelection()\n\telse:\n\t\toffClick = true;\n\t\taddSelected(name)\n\n# Calculates the layer that a block is on.\n# COPY OF FUNCTION IN PUZZLEMAN, IS THERE A BETTER WAY TO DO THIS?!\nfunc calcBlockLayer( x, y, z ):\n\treturn max( max( abs( x ), abs( y ) ), abs( z ) )\nfunc calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\nfunc beatenWithScore(othersScore):\n\tprint( \"BEATEN!\" )\n\tvar pauseMenu = get_tree().get_root().get_node( \"Spatial\" ).get_node( \"Camera\" ).pauseMenu\n\tpauseMenu.set_text(\"GAME OVER\\nYou've been beaten with time: \" + puzzleScn.formatTime(othersScore))\n\tpauseMenu.popup_centered()\n\nfunc win():\n\tprint( \"GAME OVER!\" )\n\tvar pauseMenu = get_tree().get_root().get_node( \"Spatial\" ).get_node( \"Camera\" ).pauseMenu\n\tpauseMenu.set_text(\"GAME OVER\\nYou win with time: \" + puzzleScn.formatTime(get_parent().get_parent().time.val))\n\tpauseMenu.popup_centered()\n\n\n# Handles keeping track of pairs being removed.\nfunc popPair( pos ):\n\tvar blayer = calcBlockLayerVec( pos )\n\tpuzzle.pairCount[blayer] -= 1\n\n\tif( puzzle.pairCount[blayer] == 0 ):\n\t\tprint(\"LAYER CLEARED\")\n\t\tif blayer == 1:\n\t\t\twin()\n\n\t\tfor b in puzzle.shape:\n\t\t\tif not ( puzzle.shape[b] == null ):\n\t\t\t\tif calcBlockLayerVec( b ) == blayer:\n\t\t\t\t\tif blockNodes[b].getBlockType() == BLOCK_LASER:\n\t\t\t\t\t\tblockNodes[b].forceActivate()\n\n\t\t# Fire beams.\n\t\tvar beamNum = 0\n\t\tfor l in range( puzzle.lasers.size() ):\n\t\t\tif calcBlockLayerVec( puzzle.lasers[l][0] ) == blayer:\n\t\t\t\t# Firin mah lazerz!\n\t\t\t\tvar beam = beamScn.instance()\n\n\t\t\t\tbeam.set_name( str(blayer) + \"_beam_\" + str(beamNum) )\n\t\t\t\tbeamNum += 1\n\t\t\t\tbeam.set_script( Beam )\n\n\t\t\t\tadd_child( beam )\n\t\t\t\tbeam.fire( puzzle.lasers[l][0], puzzle.lasers[l][1] )\n\n\t\t\t\tsamplePlayer.play( \"soundslikewillem_hitting_slinky\" )\n\n\nfunc _init():\n\t# Load sound\n\tsamplePlayer.set_voice_count(10)\n\tsamplePlayer.set_sample_library(ResourceLoader.load(\"new_samplelibrary.xml\"))\n\tprint(\"GridMan initialized\")\n\nfunc _ready():\n\tsetupCam()\n\n\tpuzzleScn = get_parent().get_parent()\n\n\nfunc setupCam():\n\tvar cam = get_tree().get_root().get_node( \"Spatial\/Camera\" )\n\tif cam == null or puzzle == null:\n\t\treturn\n\tvar totalSize = ( puzzle.puzzleLayers * 2 + 1 )\n\tcam.distance.val = 4.5 * totalSize\n\tcam.distance.min_ = 3 * totalSize\n\tcam.distance.max_ = 10 * totalSize\n\tcam.recalculate_camera()\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"cf98fed099e07e91ad7255f27fdeb96175c71f8d","subject":"forgot to check on floor before jumping","message":"forgot to check on floor before jumping\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"2d\/platformer\/player.gd","new_file":"2d\/platformer\/player.gd","new_contents":"\nextends KinematicBody2D\n\nconst GRAVITY_VEC = Vector2(0,900)\nconst FLOOR_NORMAL = Vector2(0,-1)\nconst SLOPE_SLIDE_STOP = 25.0\nconst MIN_ONAIR_TIME = 0.1\nconst WALK_SPEED = 250 # pixels\/sec\nconst JUMP_SPEED = 480\nconst SIDING_CHANGE_SPEED = 10\nconst BULLET_VELOCITY = 1000\nconst SHOOT_TIME_SHOW_WEAPON = 0.2\n\nvar linear_vel = Vector2()\nvar onair_time = 0 # \nvar on_floor = false\nvar shoot_time=99999 #time since last shot\n\nvar anim=\"\"\n\n#cache the sprite here for fast access (we will set scale to flip it often)\nonready var sprite = get_node(\"sprite\")\n\nfunc _fixed_process(delta):\n\t\n\t#increment counters\n\t\n\tonair_time+=delta\n\tshoot_time+=delta\n\t\n\t\n\t### MOVEMENT ###\n\t\n\t# Apply Gravity\n\tlinear_vel += delta * GRAVITY_VEC\n\t# Move and Slide\n\tlinear_vel = move_and_slide( linear_vel, FLOOR_NORMAL, SLOPE_SLIDE_STOP )\n\t# Detect Floor\n\tif (is_move_and_slide_on_floor()):\n\t\tonair_time=0\t\t\n\t\t\n\ton_floor = onair_time < MIN_ONAIR_TIME\n\t\n\t### CONTROL ###\n\t\n\t# Horizontal Movement\n\tvar target_speed = 0\n\tif (Input.is_action_pressed(\"move_left\")):\n\t\ttarget_speed += -1\n\tif (Input.is_action_pressed(\"move_right\")):\n\t\ttarget_speed += 1\n\t\t\n\ttarget_speed *= WALK_SPEED\n\tlinear_vel.x = lerp( linear_vel.x, target_speed, 0.1 )\n\t\n\t# Jumping\n\tif (on_floor and Input.is_action_just_pressed(\"jump\")):\n\t\tlinear_vel.y=-JUMP_SPEED\n\t\tget_node(\"sound\").play(\"jump\")\n\t\n\t# Shooting\t\t\n\t\n\tif (Input.is_action_just_pressed(\"shoot\")):\n\t\t\n\t\tvar bullet = preload(\"res:\/\/bullet.tscn\").instance()\n\t\tbullet.set_pos( get_node(\"sprite\/bullet_shoot\").get_global_pos() ) #use node for shoot position\n\t\tbullet.set_linear_velocity( Vector2( sprite.get_scale().x * BULLET_VELOCITY,0 ) )\t\t\n\t\tbullet.add_collision_exception_with(self) # don't want player to collide with bullet\n\t\tget_parent().add_child( bullet ) #don't want bullet to move with me, so add it as child of parent\n\t\tget_node(\"sound\").play(\"shoot\")\n\t\tshoot_time=0\n\t\t\n\t\t\n\t### ANIMATION ###\n\t\n\tvar new_anim=\"idle\"\n\t\n\tif (on_floor):\n\t\tif (linear_vel.x < -SIDING_CHANGE_SPEED):\n\t\t\tsprite.set_scale( Vector2( -1, 1 ) )\n\t\t\tnew_anim=\"run\"\n\t\t\t\n\t\tif (linear_vel.x > SIDING_CHANGE_SPEED):\n\t\t\tsprite.set_scale( Vector2( 1, 1 ) )\n\t\t\tnew_anim=\"run\"\n\t\t\t\n\telse:\n\t\t\n\t\tif (linear_vel.y < 0 ):\n\t\t\tnew_anim=\"jumping\"\n\t\telse:\n\t\t\tnew_anim=\"falling\"\n\t\t\n\tif (shoot_time < SHOOT_TIME_SHOW_WEAPON):\n\t\tnew_anim+=\"_weapon\"\n\t\n\tif (new_anim!=anim):\n\t\tanim=new_anim\n\t\tget_node(\"anim\").play(anim)\n\t\n\t\nfunc _ready():\n\tset_fixed_process(true)\n\n","old_contents":"\nextends KinematicBody2D\n\nconst GRAVITY_VEC = Vector2(0,900)\nconst FLOOR_NORMAL = Vector2(0,-1)\nconst SLOPE_SLIDE_STOP = 25.0\nconst MIN_ONAIR_TIME = 0.1\nconst WALK_SPEED = 250 # pixels\/sec\nconst JUMP_SPEED = 480\nconst SIDING_CHANGE_SPEED = 10\nconst BULLET_VELOCITY = 1000\nconst SHOOT_TIME_SHOW_WEAPON = 0.2\n\nvar linear_vel = Vector2()\nvar onair_time = 0 # \nvar on_floor = false\nvar shoot_time=99999 #time since last shot\n\nvar anim=\"\"\n\n#cache the sprite here for fast access (we will set scale to flip it often)\nonready var sprite = get_node(\"sprite\")\n\nfunc _fixed_process(delta):\n\t\n\t#increment counters\n\t\n\tonair_time+=delta\n\tshoot_time+=delta\n\t\n\t\n\t### MOVEMENT ###\n\t\n\t# Apply Gravity\n\tlinear_vel += delta * GRAVITY_VEC\n\t# Move and Slide\n\tlinear_vel = move_and_slide( linear_vel, FLOOR_NORMAL, SLOPE_SLIDE_STOP )\n\t# Detect Floor\n\tif (is_move_and_slide_on_floor()):\n\t\tonair_time=0\t\t\n\t\t\n\ton_floor = onair_time < MIN_ONAIR_TIME\n\t\n\t### CONTROL ###\n\t\n\t# Horizontal Movement\n\tvar target_speed = 0\n\tif (Input.is_action_pressed(\"move_left\")):\n\t\ttarget_speed += -1\n\tif (Input.is_action_pressed(\"move_right\")):\n\t\ttarget_speed += 1\n\t\t\n\ttarget_speed *= WALK_SPEED\n\tlinear_vel.x = lerp( linear_vel.x, target_speed, 0.1 )\n\t\n\t# Jumping\n\tif (Input.is_action_just_pressed(\"jump\")):\n\t\tlinear_vel.y=-JUMP_SPEED\n\t\tget_node(\"sound\").play(\"jump\")\n\t\n\t# Shooting\t\t\n\t\n\tif (Input.is_action_just_pressed(\"shoot\")):\n\t\t\n\t\tvar bullet = preload(\"res:\/\/bullet.tscn\").instance()\n\t\tbullet.set_pos( get_node(\"sprite\/bullet_shoot\").get_global_pos() ) #use node for shoot position\n\t\tbullet.set_linear_velocity( Vector2( sprite.get_scale().x * BULLET_VELOCITY,0 ) )\t\t\n\t\tbullet.add_collision_exception_with(self) # don't want player to collide with bullet\n\t\tget_parent().add_child( bullet ) #don't want bullet to move with me, so add it as child of parent\n\t\tget_node(\"sound\").play(\"shoot\")\n\t\tshoot_time=0\n\t\t\n\t\t\n\t### ANIMATION ###\n\t\n\tvar new_anim=\"idle\"\n\t\n\tif (on_floor):\n\t\tif (linear_vel.x < -SIDING_CHANGE_SPEED):\n\t\t\tsprite.set_scale( Vector2( -1, 1 ) )\n\t\t\tnew_anim=\"run\"\n\t\t\t\n\t\tif (linear_vel.x > SIDING_CHANGE_SPEED):\n\t\t\tsprite.set_scale( Vector2( 1, 1 ) )\n\t\t\tnew_anim=\"run\"\n\t\t\t\n\telse:\n\t\t\n\t\tif (linear_vel.y < 0 ):\n\t\t\tnew_anim=\"jumping\"\n\t\telse:\n\t\t\tnew_anim=\"falling\"\n\t\t\n\tif (shoot_time < SHOOT_TIME_SHOW_WEAPON):\n\t\tnew_anim+=\"_weapon\"\n\t\n\tif (new_anim!=anim):\n\t\tanim=new_anim\n\t\tget_node(\"anim\").play(anim)\n\t\n\t\nfunc _ready():\n\tset_fixed_process(true)\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"bbfa72a7ec6d37e790b90386bdc8cde954977641","subject":"Shorter version","message":"Shorter version\n\nWorks the same, but is shorter and more optimized (no _process function)","repos":"jlopezcur\/GodotAdmob,jlopezcur\/GodotAdmob","old_file":"example\/main.gd","new_file":"example\/main.gd","new_contents":"extends Node\n\nvar admob = null\nvar isTop = true\nvar ad_id = \"ca-app-pub-XXXXXXXXXXXXXXXX\/XXXXXXXXXX\" [Replace with your Ad Unit ID and delete this message.]\n\nfunc _ready():\n\tget_tree().connect(\"screen_resized\",self,\"update_size\")\n\tif(Globals.has_singleton(\"AdMob\")):\n\t\tadmob = Globals.get_singleton(\"AdMob\")\n\t\tadmob.init(true, isTop, ad_id)\n\t\tadmob.showBanner(true)\n\t\nfunc update_size():\n\tif(admob != null):\n\t\tprint(admob.getAdWidth(), \", \", admob.getAdHeight())\n\t\tadmob.resize(isTop)\n","old_contents":"\nextends Node\n\nvar admob\nvar sizeOld\nvar isTop\n\nfunc _ready():\n\tset_process(true)\n\tsizeOld\t\t= OS.get_video_mode_size()\n\tisTop\t\t= true\n\tif(Globals.has_singleton(\"AdMob\")):\n\t\tadmob\t\t= Globals.get_singleton(\"AdMob\")\n\t\tadmob.init(true, isTop, \"ca-app-pub-XXXXXXXXXXXXXXXX\/XXXXXXXXXX\")\t[Place your Ad Unit ID and delete this message.]\n\t\tadmob.showBanner(true)\n\telse:\n\t\tadmob\t= null\n\t\nfunc _process(delta):\n\tvar size\t= OS.get_video_mode_size()\n\t\n\tif( ((sizeOld.x - size.x) != 0) || ((sizeOld.y - size.y) != 0) ):\n\t\tsizeOld\t= size\n\t\tif(null != admob):\n\t\t\tprint(admob.getAdWidth(), \", \", admob.getAdHeight())\n\t\t\tadmob.resize(isTop)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"67bf14bbbbbdcbb6b6f995a54603d1695766ea6e","subject":"Removed redundant code in the kinematic 3D demo.","message":"Removed redundant code in the kinematic 3D demo.\n","repos":"Brickcaster\/godot,gcbeyond\/godot,mrezai\/godot,OpenSocialGames\/godot,ageazrael\/godot,RebelliousX\/Go_Dot,pixelpicosean\/my-godot-2.1,hipgraphics\/godot,ZuBsPaCe\/godot,lietu\/godot,TheBoyThePlay\/godot,ricpelo\/godot,pixelpicosean\/my-godot-2.1,Zylann\/godot,marynate\/godot,MrMaidx\/godot,Brickcaster\/godot,BoDonkey\/godot,Faless\/godot,ageazrael\/godot,BoDonkey\/godot,ex\/godot,jjdicharry\/godot,DmitriySalnikov\/godot,BogusCurry\/godot,supriyantomaftuh\/godot,didier-v\/godot,torgartor21\/godot,akien-mga\/godot,morrow1nd\/godot,shackra\/godot,godotengine\/godot,dreamsxin\/godot,ageazrael\/godot,lietu\/godot,karolgotowala\/godot,jackmakesthings\/godot,xiaoyanit\/godot,HatiEth\/godot,marynate\/godot,est31\/godot,sh95119\/godot,sh95119\/godot,pixelpicosean\/my-godot-2.1,Zylann\/godot,sergicollado\/godot,mikica1986vee\/GodotArrayEditorStuff,BogusCurry\/godot,HatiEth\/godot,josempans\/godot,guilhermefelipecgs\/godot,cpascal\/godot,Zylann\/godot,gcbeyond\/godot,azurvii\/godot,TheBoyThePlay\/godot,zicklag\/godot,jjdicharry\/godot,youprofit\/godot,opmana\/godot,Valentactive\/godot,xiaoyanit\/godot,a12n\/godot,Marqin\/godot,jjdicharry\/godot,TheBoyThePlay\/godot,godotengine\/godot,xiaoyanit\/godot,a12n\/godot,HatiEth\/godot,jjdicharry\/godot,Valentactive\/godot,crr0004\/godot,kimsunzun\/godot,blackwc\/godot,NateWardawg\/godot,lietu\/godot,marynate\/godot,guilhermefelipecgs\/godot,mcanders\/godot,rollenrolm\/godot,vkbsb\/godot,kimsunzun\/godot,Brickcaster\/godot,akien-mga\/godot,HatiEth\/godot,jjdicharry\/godot,vkbsb\/godot,iap-mutant\/godot,guilhermefelipecgs\/godot,agusbena\/godot,mikica1986vee\/GodotArrayEditorStuff,liuyucoder\/godot,vastcharade\/godot,davidalpha\/godot,jejung\/godot,hipgraphics\/godot,ex\/godot,youprofit\/godot,mamarilmanson\/godot,pkowal1982\/godot,hipgraphics\/godot,sh95119\/godot,DStomtom\/godot,Hodes\/godot,ex\/godot,mikica1986vee\/Godot_android_tegra_fallback,vkbsb\/godot,godotengine\/godot,Shockblast\/godot,teamblubee\/godot,BastiaanOlij\/godot,firefly2442\/godot,DStomtom\/godot,n-pigeon\/godot,ficoos\/godot,buckle2000\/godot,sh95119\/godot,MarianoGnu\/godot,cpascal\/godot,n-pigeon\/godot,crr0004\/godot,RebelliousX\/Go_Dot,jackmakesthings\/godot,sergicollado\/godot,didier-v\/godot,huziyizero\/godot,cpascal\/godot,blackwc\/godot,sergicollado\/godot,vastcharade\/godot,HatiEth\/godot,MarianoGnu\/godot,BastiaanOlij\/godot,mikica1986vee\/Godot_android_tegra_fallback,ricpelo\/godot,Brickcaster\/godot,a12n\/godot,jjdicharry\/godot,vastcharade\/godot,BoDonkey\/godot,mamarilmanson\/godot,ianholing\/godot,TheHX\/godot,OpenSocialGames\/godot,ex\/godot,iap-mutant\/godot,kimsunzun\/godot,BogusCurry\/godot,pkowal1982\/godot,Shockblast\/godot,opmana\/godot,BoDonkey\/godot,gau-veldt\/godot,DStomtom\/godot,didier-v\/godot,supriyantomaftuh\/godot,mikica1986vee\/GodotArrayEditorStuff,cpascal\/godot,davidalpha\/godot,BoDonkey\/godot,rollenrolm\/godot,mikica1986vee\/godot,ianholing\/godot,TheBoyThePlay\/godot,RandomShaper\/godot,mikica1986vee\/godot,mrezai\/godot,Faless\/godot,Zylann\/godot,josempans\/godot,DmitriySalnikov\/godot,sanikoyes\/godot,dreamsxin\/godot,ZuBsPaCe\/godot,karolgotowala\/godot,youprofit\/godot,karolgotowala\/godot,xiaoyanit\/godot,jackmakesthings\/godot,vnen\/godot,karolgotowala\/godot,ficoos\/godot,lietu\/godot,blackwc\/godot,TheBoyThePlay\/godot,ex\/godot,zj8487\/godot,ianholing\/godot,groud\/godot,sergicollado\/godot,azurvii\/godot,Valentactive\/godot,honix\/godot,xiaoyanit\/godot,firefly2442\/godot,BastiaanOlij\/godot,mikica1986vee\/Godot_android_tegra_fallback,sanikoyes\/godot,est31\/godot,liuyucoder\/godot,crr0004\/godot,cpascal\/godot,crr0004\/godot,NateWardawg\/godot,gcbeyond\/godot,xiaoyanit\/godot,gcbeyond\/godot,opmana\/godot,mikica1986vee\/Godot_android_tegra_fallback,a12n\/godot,BastiaanOlij\/godot,opmana\/godot,TheBoyThePlay\/godot,TheBoyThePlay\/godot,mikica1986vee\/godot,gau-veldt\/godot,RandomShaper\/godot,FullMeta\/godot,mamarilmanson\/godot,morrow1nd\/godot,sergicollado\/godot,BastiaanOlij\/godot,OpenSocialGames\/godot,marynate\/godot,okamstudio\/godot,MrMaidx\/godot,crr0004\/godot,iap-mutant\/godot,firefly2442\/godot,liuyucoder\/godot,shackra\/godot,davidalpha\/godot,serafinfernandez\/godot,FateAce\/godot,DmitriySalnikov\/godot,zj8487\/godot,youprofit\/godot,agusbena\/godot,n-pigeon\/godot,sanikoyes\/godot,Brickcaster\/godot,teamblubee\/godot,MarianoGnu\/godot,pkowal1982\/godot,mikica1986vee\/godot,jackmakesthings\/godot,didier-v\/godot,Hodes\/godot,cpascal\/godot,dreamsxin\/godot,liuyucoder\/godot,sergicollado\/godot,Valentactive\/godot,honix\/godot,supriyantomaftuh\/godot,wardw\/godot,blackwc\/godot,shackra\/godot,didier-v\/godot,huziyizero\/godot,torgartor21\/godot,exabon\/godot,est31\/godot,exabon\/godot,shackra\/godot,sh95119\/godot,Shockblast\/godot,mikica1986vee\/Godot_android_tegra_fallback,wardw\/godot,FullMeta\/godot,serafinfernandez\/godot,RandomShaper\/godot,kimsunzun\/godot,RebelliousX\/Go_Dot,NateWardawg\/godot,vastcharade\/godot,agusbena\/godot,zicklag\/godot,sergicollado\/godot,teamblubee\/godot,wardw\/godot,sh95119\/godot,kimsunzun\/godot,FullMeta\/godot,n-pigeon\/godot,JoshuaGrams\/godot,gcbeyond\/godot,godotengine\/godot,jjdicharry\/godot,Max-Might\/godot,honix\/godot,kimsunzun\/godot,exabon\/godot,wardw\/godot,HatiEth\/godot,marynate\/godot,mrezai\/godot,MrMaidx\/godot,Paulloz\/godot,rollenrolm\/godot,mikica1986vee\/GodotArrayEditorStuff,iap-mutant\/godot,josempans\/godot,vastcharade\/godot,pkowal1982\/godot,mamarilmanson\/godot,MarianoGnu\/godot,davidalpha\/godot,godotengine\/godot,jjdicharry\/godot,a12n\/godot,tomreyn\/godot,gcbeyond\/godot,teamblubee\/godot,wardw\/godot,hitjim\/godot,didier-v\/godot,mikica1986vee\/Godot_android_tegra_fallback,dreamsxin\/godot,crr0004\/godot,jjdicharry\/godot,Valentactive\/godot,tomreyn\/godot,quabug\/godot,jackmakesthings\/godot,didier-v\/godot,liuyucoder\/godot,torgartor21\/godot,RandomShaper\/godot,Faless\/godot,est31\/godot,MrMaidx\/godot,FullMeta\/godot,serafinfernandez\/godot,Max-Might\/godot,JoshuaGrams\/godot,sh95119\/godot,mikica1986vee\/Godot_android_tegra_fallback,TheBoyThePlay\/godot,hitjim\/godot,hipgraphics\/godot,sanikoyes\/godot,gcbeyond\/godot,groud\/godot,MarianoGnu\/godot,firefly2442\/godot,didier-v\/godot,vastcharade\/godot,crr0004\/godot,BogusCurry\/godot,lietu\/godot,torgartor21\/godot,mrezai\/godot,pkowal1982\/godot,vkbsb\/godot,serafinfernandez\/godot,torgartor21\/godot,gcbeyond\/godot,groud\/godot,wardw\/godot,Zylann\/godot,gcbeyond\/godot,OpenSocialGames\/godot,agusbena\/godot,Marqin\/godot,DStomtom\/godot,supriyantomaftuh\/godot,supriyantomaftuh\/godot,blackwc\/godot,gau-veldt\/godot,Paulloz\/godot,Max-Might\/godot,DmitriySalnikov\/godot,FullMeta\/godot,Faless\/godot,exabon\/godot,ex\/godot,ianholing\/godot,Valentactive\/godot,wardw\/godot,teamblubee\/godot,ZuBsPaCe\/godot,dreamsxin\/godot,zj8487\/godot,NateWardawg\/godot,serafinfernandez\/godot,mrezai\/godot,ianholing\/godot,supriyantomaftuh\/godot,shackra\/godot,OpenSocialGames\/godot,Brickcaster\/godot,iap-mutant\/godot,dreamsxin\/godot,vastcharade\/godot,tomreyn\/godot,OpenSocialGames\/godot,HatiEth\/godot,davidalpha\/godot,mrezai\/godot,est31\/godot,Max-Might\/godot,vnen\/godot,Paulloz\/godot,hitjim\/godot,Max-Might\/godot,MarianoGnu\/godot,JoshuaGrams\/godot,OpenSocialGames\/godot,josempans\/godot,mrezai\/godot,josempans\/godot,tomreyn\/godot,zicklag\/godot,JoshuaGrams\/godot,serafinfernandez\/godot,sergicollado\/godot,NateWardawg\/godot,akien-mga\/godot,jejung\/godot,FateAce\/godot,hipgraphics\/godot,quabug\/godot,FullMeta\/godot,Zylann\/godot,jjdicharry\/godot,mrezai\/godot,karolgotowala\/godot,mamarilmanson\/godot,rollenrolm\/godot,tomreyn\/godot,pixelpicosean\/my-godot-2.1,zj8487\/godot,Faless\/godot,BastiaanOlij\/godot,wardw\/godot,guilhermefelipecgs\/godot,lietu\/godot,RebelliousX\/Go_Dot,opmana\/godot,sergicollado\/godot,morrow1nd\/godot,rollenrolm\/godot,BogusCurry\/godot,firefly2442\/godot,davidalpha\/godot,azurvii\/godot,josempans\/godot,vnen\/godot,hipgraphics\/godot,shackra\/godot,a12n\/godot,vnen\/godot,morrow1nd\/godot,ricpelo\/godot,HatiEth\/godot,mikica1986vee\/GodotArrayEditorStuff,karolgotowala\/godot,okamstudio\/godot,ficoos\/godot,jejung\/godot,pkowal1982\/godot,guilhermefelipecgs\/godot,RandomShaper\/godot,mcanders\/godot,cpascal\/godot,mikica1986vee\/Godot_android_tegra_fallback,iap-mutant\/godot,ZuBsPaCe\/godot,karolgotowala\/godot,didier-v\/godot,okamstudio\/godot,crr0004\/godot,Hodes\/godot,ZuBsPaCe\/godot,mamarilmanson\/godot,huziyizero\/godot,vastcharade\/godot,sanikoyes\/godot,liuyucoder\/godot,godotengine\/godot,josempans\/godot,mcanders\/godot,Shockblast\/godot,didier-v\/godot,JoshuaGrams\/godot,supriyantomaftuh\/godot,marynate\/godot,quabug\/godot,zj8487\/godot,gau-veldt\/godot,n-pigeon\/godot,morrow1nd\/godot,mikica1986vee\/GodotArrayEditorStuff,torgartor21\/godot,mikica1986vee\/GodotArrayEditorStuff,sanikoyes\/godot,Marqin\/godot,ricpelo\/godot,Shockblast\/godot,youprofit\/godot,honix\/godot,hipgraphics\/godot,blackwc\/godot,buckle2000\/godot,mamarilmanson\/godot,ianholing\/godot,wardw\/godot,ZuBsPaCe\/godot,firefly2442\/godot,okamstudio\/godot,jejung\/godot,MrMaidx\/godot,iap-mutant\/godot,sanikoyes\/godot,akien-mga\/godot,blackwc\/godot,shackra\/godot,Faless\/godot,serafinfernandez\/godot,buckle2000\/godot,vnen\/godot,mikica1986vee\/GodotArrayEditorStuff,Paulloz\/godot,TheBoyThePlay\/godot,hitjim\/godot,DStomtom\/godot,FullMeta\/godot,godotengine\/godot,mamarilmanson\/godot,Hodes\/godot,TheHX\/godot,liuyucoder\/godot,FullMeta\/godot,BastiaanOlij\/godot,pixelpicosean\/my-godot-2.1,exabon\/godot,huziyizero\/godot,ficoos\/godot,lietu\/godot,jejung\/godot,BoDonkey\/godot,honix\/godot,ianholing\/godot,zj8487\/godot,buckle2000\/godot,serafinfernandez\/godot,buckle2000\/godot,okamstudio\/godot,FullMeta\/godot,est31\/godot,agusbena\/godot,crr0004\/godot,quabug\/godot,okamstudio\/godot,serafinfernandez\/godot,agusbena\/godot,ex\/godot,DStomtom\/godot,youprofit\/godot,mikica1986vee\/godot,Shockblast\/godot,jackmakesthings\/godot,vkbsb\/godot,MarianoGnu\/godot,jackmakesthings\/godot,kimsunzun\/godot,Marqin\/godot,gau-veldt\/godot,ricpelo\/godot,shackra\/godot,hipgraphics\/godot,sh95119\/godot,serafinfernandez\/godot,BoDonkey\/godot,teamblubee\/godot,Valentactive\/godot,ianholing\/godot,FateAce\/godot,youprofit\/godot,TheHX\/godot,mikica1986vee\/godot,marynate\/godot,mcanders\/godot,ianholing\/godot,iap-mutant\/godot,hitjim\/godot,BogusCurry\/godot,Valentactive\/godot,RandomShaper\/godot,lietu\/godot,TheBoyThePlay\/godot,mikica1986vee\/GodotArrayEditorStuff,zicklag\/godot,groud\/godot,lietu\/godot,dreamsxin\/godot,marynate\/godot,teamblubee\/godot,josempans\/godot,ianholing\/godot,BogusCurry\/godot,cpascal\/godot,torgartor21\/godot,okamstudio\/godot,Hodes\/godot,ZuBsPaCe\/godot,quabug\/godot,groud\/godot,sanikoyes\/godot,vnen\/godot,n-pigeon\/godot,BoDonkey\/godot,liuyucoder\/godot,vastcharade\/godot,zj8487\/godot,FullMeta\/godot,hitjim\/godot,akien-mga\/godot,HatiEth\/godot,youprofit\/godot,TheHX\/godot,DStomtom\/godot,zicklag\/godot,marynate\/godot,davidalpha\/godot,mikica1986vee\/Godot_android_tegra_fallback,crr0004\/godot,ageazrael\/godot,hitjim\/godot,ageazrael\/godot,liuyucoder\/godot,NateWardawg\/godot,DStomtom\/godot,huziyizero\/godot,mcanders\/godot,mikica1986vee\/godot,firefly2442\/godot,kimsunzun\/godot,quabug\/godot,a12n\/godot,zj8487\/godot,kimsunzun\/godot,hitjim\/godot,davidalpha\/godot,hitjim\/godot,ficoos\/godot,BastiaanOlij\/godot,Zylann\/godot,FateAce\/godot,hitjim\/godot,DmitriySalnikov\/godot,jejung\/godot,NateWardawg\/godot,Hodes\/godot,mcanders\/godot,RebelliousX\/Go_Dot,ageazrael\/godot,exabon\/godot,JoshuaGrams\/godot,Paulloz\/godot,NateWardawg\/godot,teamblubee\/godot,Paulloz\/godot,TheHX\/godot,FateAce\/godot,DStomtom\/godot,hipgraphics\/godot,supriyantomaftuh\/godot,zj8487\/godot,mikica1986vee\/godot,ricpelo\/godot,agusbena\/godot,akien-mga\/godot,ficoos\/godot,karolgotowala\/godot,kimsunzun\/godot,ex\/godot,jackmakesthings\/godot,BogusCurry\/godot,BoDonkey\/godot,teamblubee\/godot,vkbsb\/godot,Marqin\/godot,pkowal1982\/godot,azurvii\/godot,BogusCurry\/godot,sh95119\/godot,NateWardawg\/godot,DStomtom\/godot,gcbeyond\/godot,a12n\/godot,mamarilmanson\/godot,RandomShaper\/godot,iap-mutant\/godot,supriyantomaftuh\/godot,quabug\/godot,buckle2000\/godot,quabug\/godot,groud\/godot,vkbsb\/godot,blackwc\/godot,teamblubee\/godot,vnen\/godot,karolgotowala\/godot,shackra\/godot,firefly2442\/godot,okamstudio\/godot,sh95119\/godot,jackmakesthings\/godot,ricpelo\/godot,Shockblast\/godot,azurvii\/godot,mamarilmanson\/godot,Paulloz\/godot,supriyantomaftuh\/godot,Zylann\/godot,Shockblast\/godot,hipgraphics\/godot,azurvii\/godot,torgartor21\/godot,sergicollado\/godot,marynate\/godot,lietu\/godot,torgartor21\/godot,morrow1nd\/godot,dreamsxin\/godot,quabug\/godot,quabug\/godot,zj8487\/godot,DmitriySalnikov\/godot,mikica1986vee\/GodotArrayEditorStuff,vkbsb\/godot,mikica1986vee\/godot,Faless\/godot,dreamsxin\/godot,karolgotowala\/godot,okamstudio\/godot,akien-mga\/godot,cpascal\/godot,guilhermefelipecgs\/godot,HatiEth\/godot,RebelliousX\/Go_Dot,youprofit\/godot,blackwc\/godot,a12n\/godot,torgartor21\/godot,a12n\/godot,OpenSocialGames\/godot,shackra\/godot,Max-Might\/godot,guilhermefelipecgs\/godot,BogusCurry\/godot,ricpelo\/godot,xiaoyanit\/godot,blackwc\/godot,jackmakesthings\/godot,guilhermefelipecgs\/godot,Brickcaster\/godot,wardw\/godot,BoDonkey\/godot,godotengine\/godot,OpenSocialGames\/godot,mikica1986vee\/godot,mikica1986vee\/Godot_android_tegra_fallback,FateAce\/godot,pkowal1982\/godot,ricpelo\/godot,OpenSocialGames\/godot,MarianoGnu\/godot,honix\/godot,ricpelo\/godot,agusbena\/godot,xiaoyanit\/godot,dreamsxin\/godot,xiaoyanit\/godot,okamstudio\/godot,cpascal\/godot,iap-mutant\/godot,DmitriySalnikov\/godot,xiaoyanit\/godot,youprofit\/godot,Faless\/godot,ZuBsPaCe\/godot,davidalpha\/godot,ageazrael\/godot,davidalpha\/godot,liuyucoder\/godot,Marqin\/godot,n-pigeon\/godot,MrMaidx\/godot,vastcharade\/godot,zicklag\/godot,akien-mga\/godot,vnen\/godot","old_file":"demos\/3d\/kinematic_char\/cubio.gd","new_file":"demos\/3d\/kinematic_char\/cubio.gd","new_contents":"\nextends KinematicBody\n\n# member variables here, example:\n# var a=2\n# var b=\"textvar\"\n\nvar g = -9.8\nvar vel = Vector3()\nconst MAX_SPEED = 5\nconst JUMP_SPEED = 7\nconst ACCEL= 2\nconst DEACCEL= 4\nconst MAX_SLOPE_ANGLE = 30\n\nfunc _fixed_process(delta):\n\n\tvar dir = Vector3() #where does the player intend to walk to\n\tvar cam_xform = get_node(\"target\/camera\").get_global_transform()\n\t\n\tif (Input.is_action_pressed(\"move_forward\")):\n\t\tdir+=-cam_xform.basis[2] \n\tif (Input.is_action_pressed(\"move_backwards\")):\n\t\tdir+=cam_xform.basis[2] \n\tif (Input.is_action_pressed(\"move_left\")):\n\t\tdir+=-cam_xform.basis[0] \n\tif (Input.is_action_pressed(\"move_right\")):\n\t\tdir+=cam_xform.basis[0] \n\n\tdir.y=0\n\tdir=dir.normalized()\n\n\tvel.y+=delta*g\n\t\n\tvar hvel = vel\n\thvel.y=0\t\n\t\n\tvar target = dir*MAX_SPEED\n\tvar accel\n\tif (dir.dot(hvel) >0):\n\t\taccel=ACCEL\n\telse:\n\t\taccel=DEACCEL\n\t\t\n\thvel = hvel.linear_interpolate(target,accel*delta)\n\t\n\tvel.x=hvel.x;\n\tvel.z=hvel.z\t\n\n\tvar motion = move(vel*delta)\n\n\tvar on_floor = false\n\tvar original_vel = vel\n\n\n\tvar floor_velocity=Vector3()\n\n\tvar attempts=4\n\t\n\twhile(is_colliding() and attempts):\n\t\tvar n=get_collision_normal()\n\n\t\tif ( rad2deg(acos(n.dot( Vector3(0,1,0)))) < MAX_SLOPE_ANGLE ):\n\t\t\t\t#if angle to the \"up\" vectors is < angle tolerance\n\t\t\t\t#char is on floor\n\t\t\t\tfloor_velocity=get_collider_velocity()\n\t\t\t\ton_floor=true\t\t\t\n\t\t\t\n\t\tmotion = n.slide(motion)\n\t\tvel = n.slide(vel)\n\t\tif (original_vel.dot(vel) > 0):\n\t\t\t#do not allow to slide towads the opposite direction we were coming from\n\t\t\tmotion=move(motion)\n\t\t\tif (motion.length()<0.001):\n\t\t\t\tbreak\n\t\tattempts-=1\n\n\tif (on_floor and floor_velocity!=Vector3()):\n\t\t\tmove(floor_velocity*delta)\n\t\n\tif (on_floor and Input.is_action_pressed(\"jump\")):\n\t\tvel.y=JUMP_SPEED\n\t\t\n\tvar crid = get_node(\"..\/elevator1\").get_rid()\n#\tprint(crid,\" : \",PS.body_get_state(crid,PS.BODY_STATE_TRANSFORM))\n\nfunc _ready():\n\t# Initalization here\n\tset_fixed_process(true)\n\tpass\n\n\nfunc _on_tcube_body_enter( body ):\n\tget_node(\"..\/ty\").show()\n\tpass # replace with function body\n","old_contents":"\nextends KinematicBody\n\n# member variables here, example:\n# var a=2\n# var b=\"textvar\"\n\nvar g = -9.8\nvar vel = Vector3()\nconst MAX_SPEED = 5\nconst JUMP_SPEED = 7\nconst ACCEL= 2\nconst DEACCEL= 4\nconst MAX_SLOPE_ANGLE = 30\n\nfunc _fixed_process(delta):\n\n\tvar dir = Vector3() #where does the player intend to walk to\n\tvar cam_xform = get_node(\"target\/camera\").get_global_transform()\n\t\n\tif (Input.is_action_pressed(\"move_forward\")):\n\t\tdir+=-cam_xform.basis[2] \n\tif (Input.is_action_pressed(\"move_backwards\")):\n\t\tdir+=cam_xform.basis[2] \n\tif (Input.is_action_pressed(\"move_left\")):\n\t\tdir+=-cam_xform.basis[0] \n\tif (Input.is_action_pressed(\"move_right\")):\n\t\tdir+=cam_xform.basis[0] \n\n\tdir.y=0\n\tdir=dir.normalized()\n\n\tvel.y+=delta*g\n\t\n\tvar hvel = vel\n\thvel.y=0\t\n\t\n\tvar target = dir*MAX_SPEED\n\tvar accel\n\tif (dir.dot(hvel) >0):\n\t\taccel=ACCEL\n\telse:\n\t\taccel=DEACCEL\n\t\t\n\thvel = hvel.linear_interpolate(target,accel*delta)\n\t\n\tvel.x=hvel.x;\n\tvel.z=hvel.z\t\n\t\t\n\tvar motion = vel*delta\n\tmotion=move(vel*delta)\n\n\tvar on_floor = false\n\tvar original_vel = vel\n\n\n\tvar floor_velocity=Vector3()\n\n\tvar attempts=4\n\t\n\twhile(is_colliding() and attempts):\n\t\tvar n=get_collision_normal()\n\n\t\tif ( rad2deg(acos(n.dot( Vector3(0,1,0)))) < MAX_SLOPE_ANGLE ):\n\t\t\t\t#if angle to the \"up\" vectors is < angle tolerance\n\t\t\t\t#char is on floor\n\t\t\t\tfloor_velocity=get_collider_velocity()\n\t\t\t\ton_floor=true\t\t\t\n\t\t\t\n\t\tmotion = n.slide(motion)\n\t\tvel = n.slide(vel)\n\t\tif (original_vel.dot(vel) > 0):\n\t\t\t#do not allow to slide towads the opposite direction we were coming from\n\t\t\tmotion=move(motion)\n\t\t\tif (motion.length()<0.001):\n\t\t\t\tbreak\n\t\tattempts-=1\n\n\tif (on_floor and floor_velocity!=Vector3()):\n\t\t\tmove(floor_velocity*delta)\n\t\n\tif (on_floor and Input.is_action_pressed(\"jump\")):\n\t\tvel.y=JUMP_SPEED\n\t\t\n\tvar crid = get_node(\"..\/elevator1\").get_rid()\n#\tprint(crid,\" : \",PS.body_get_state(crid,PS.BODY_STATE_TRANSFORM))\n\nfunc _ready():\n\t# Initalization here\n\tset_fixed_process(true)\n\tpass\n\n\nfunc _on_tcube_body_enter( body ):\n\tget_node(\"..\/ty\").show()\n\tpass # replace with function body\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"f9ff164fed377bd9856bcb4fd6399a1110bb5882","subject":"-renamed function to get object from instance id -added function to get list of tiles used","message":"-renamed function to get object from instance id\n-added function to get list of tiles used\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"misc\/autoload\/global.gd","new_file":"misc\/autoload\/global.gd","new_contents":"extends Node\n\n\nvar current_scene = null\n\n\nfunc goto_scene(path):\n\n\t# This function will usually be called from a signal callback,\n\t# or some other function from the running scene.\n\t# Deleting the current scene at this point might be\n\t# a bad idea, because it may be inside of a callback or function of it.\n\t# The worst case will be a crash or unexpected behavior.\n\n\t# The way around this is deferring the load to a later time, when\n\t# it is ensured that no code from the current scene is running:\n\n\tcall_deferred(\"_deferred_goto_scene\",path)\n\n\nfunc _deferred_goto_scene(path):\n\n\t# Immediately free the current scene,\n\t# there is no risk here.\t\n\tcurrent_scene.free()\n\n\t# Load new scene\n\tvar s = ResourceLoader.load(path)\n\n\t# Instance the new scene\n\tcurrent_scene = s.instance()\n\n\t# Add it to the active scene, as child of root\n\tget_tree().get_root().add_child(current_scene)\n\n\nfunc _ready():\n\t# Get the current scene, the first time.\n\t# it is always the last child of root,\n\t# after the autoloaded nodes.\n\n\tvar root = get_tree().get_root()\n\tcurrent_scene = root.get_child( root.get_child_count() -1 )\n","old_contents":"extends Node\n\n\nvar current_scene = null\n\nfunc _deferred_goto_scene(path):\n\n\t# Immediately free the current scene,\n # there is no risk here.\t\n\tcurrent_scene.free()\n\n\t# Load new scene\n\tvar s = ResourceLoader.load(path)\n\n\t# Instance the new scene\n\tcurrent_scene = s.instance()\n\n\t# Add it to the active scene, as child of root\n\tget_tree().get_root().add_child(current_scene)\n\nfunc goto_scene(path):\n\n\t# This function will usually be called from a signal callback,\n # or some other function from the running scene.\n\t# Deleting the current scene at this point might be\n # a bad idea, because it may be inside of a callback or function of it.\n\t# The worst case will be a crash or unexpected behavior.\n\n\t# The way around this is deferring the load to a later time, when\n # it is ensured that no code from the current scene is running:\n\n\tcall_deferred(\"_deferred_goto_scene\",path)\n\n\nfunc _ready():\n\t# Get the current scene, the first time.\n\t# it is always the last child of root,\n\t# after the autoloaded nodes.\n\n\tvar root = get_tree().get_root()\n\tcurrent_scene = root.get_child( root.get_child_count() -1 )\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"85fab08f4e9f039e07394fd409e48eec63a7e863","subject":"Agin check that the network is connected bfore trying to throw messages","message":"Agin check that the network is connected bfore trying to throw messages\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/GridView.gd","new_file":"src\/scripts\/GridView.gd","new_contents":"# global working variables\nvar turn = Vector2( 0.0, 0.0 ) # the amount the mouse has turned\nvar mouseposlast = Input.get_mouse_pos() # the mouses last position\n\n# global tweakable parameters\nvar orbitrate = 10 # the rate the camera orbits the target when the mouse is moved\nvar active = true\n\nfunc _ready():\n\t# Initalization here\n\tset_process_input(true) # process user input events here\n\n# called to handle a user input event\nfunc _input(ev):\n\tif (not active):\n\t\treturn\n\t# If the mouse has been moved\n\tif (ev.type==InputEvent.SCREEN_DRAG or (ev.type==InputEvent.MOUSE_MOTION and ev.button_mask == 1)):\n\t\t# calculate the delta change from the last mouse movement\n\t\tvar mousedelta = (mouseposlast - ev.pos)\n\t\t# scale the mouse delta to a useful value\n\t\tturn = mousedelta \/ orbitrate\n\t\t# perform the rotation\n\t\tvar currentTransform = get_transform().basis\n\t\tvar dtime = get_process_delta_time()\n\t\tcurrentTransform = Matrix3( Vector3(0, 1, 0), PI * turn.x * dtime ) * currentTransform\n\t\tcurrentTransform = Matrix3( Vector3(1, 0, 0), PI * turn.y * dtime ) * currentTransform\n\t\tset_transform( Transform( currentTransform ) )\n\t\tvar Network = Globals.get(\"Network\")\n\t\tif (Network != null and Network.isNetwork):\n\t\t\tNetwork.sendTransform(currentTransform)\n\t\n\t\n\n\t\t# record the last position of the mousedelta\n\n\tif (ev.type==InputEvent.SCREEN_DRAG or ev.type==InputEvent.MOUSE_MOTION):\n\t\tmouseposlast = ev.pos\n\t# Android does not like this: Input.get_mouse_pos()\n","old_contents":"# global working variables\nvar turn = Vector2( 0.0, 0.0 ) # the amount the mouse has turned\nvar mouseposlast = Input.get_mouse_pos() # the mouses last position\n\n# global tweakable parameters\nvar orbitrate = 10 # the rate the camera orbits the target when the mouse is moved\nvar active = true\n\nfunc _ready():\n\t# Initalization here\n\tset_process_input(true) # process user input events here\n\n# called to handle a user input event\nfunc _input(ev):\n\tif (not active):\n\t\treturn\n\t# If the mouse has been moved\n\tif (ev.type==InputEvent.SCREEN_DRAG or (ev.type==InputEvent.MOUSE_MOTION and ev.button_mask == 1)):\n\t\t# calculate the delta change from the last mouse movement\n\t\tvar mousedelta = (mouseposlast - ev.pos)\n\t\t# scale the mouse delta to a useful value\n\t\tturn = mousedelta \/ orbitrate\n\t\t# perform the rotation\n\t\tvar currentTransform = get_transform().basis\n\t\tvar dtime = get_process_delta_time()\n\t\tcurrentTransform = Matrix3( Vector3(0, 1, 0), PI * turn.x * dtime ) * currentTransform\n\t\tcurrentTransform = Matrix3( Vector3(1, 0, 0), PI * turn.y * dtime ) * currentTransform\n\t\tset_transform( Transform( currentTransform ) )\n\t\tvar Network = Globals.get(\"Network\")\n\t\tif Network != null:\n\t\t\tNetwork.sendTransform(currentTransform)\n\t\n\t\n\n\t\t# record the last position of the mousedelta\n\n\tif (ev.type==InputEvent.SCREEN_DRAG or ev.type==InputEvent.MOUSE_MOTION):\n\t\tmouseposlast = ev.pos\n\t# Android does not like this: Input.get_mouse_pos()\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"97013703aea78348872d22506ceba650a5ca7ce6","subject":"slightly simpler","message":"slightly simpler\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Puzzle.gd","new_file":"src\/scripts\/Puzzle.gd","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"mit","lang":"GDScript"} {"commit":"0239dd204ddfa3dcdb62ac9155c8aaa6e1c729bf","subject":"quiet","message":"quiet\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Blocks\/PairedBlock.gd","new_file":"src\/scripts\/Blocks\/PairedBlock.gd","new_contents":"extends \"AbstractBlock.gd\"\n\n# Is there a better way to do this?\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\nvar textureName\n\nfunc setTexture(textureName=\"Red1\"):\n\tvar img = Image()\n\tself.textureName = textureName\n\tget_node(\"MeshInstance\").set_material_override( load(\"res:\/\/glyph_materials\/\" + textureName + \".mtl\") )\n\treturn self\n\n# Animate the removal of this block and its pair.\nfunc popBlock( pairNode, justFly=false ):\n\tget_parent().samplePlayer.play(\"deraj_pop_sound_low\")\n\t# fly away\n\tvar tweenNode = newTweenNode()\n\ttweenNode.interpolate_method( self, \"set_translation\", \\\n\t\tself.get_translation(), self.get_translation().normalized() * far_away_corner, \\\n\t\t1, Tween.TRANS_CIRC, Tween.EASE_IN_OUT )\n\n\t# remove on animation end\n\ttweenNode.connect(\"tween_complete\", self, \"request_remove\")\n\ttweenNode.start()\n\t# just one call to activate...\n\tif not justFly:\n\t\tpairNode.activate(true)\n\t\tget_parent().popPair( blockPos )\n\n# THIS IS EVERYWHERE, ANY BETTER WAY TO HAVE FUNCTIONS BETWEEN SCRIPTS?\nfunc calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n# fly away only if self.pairName is selected\nfunc activate(justFly = false):\n\tvar gridMan = get_parent()\n\tif gridMan.selectedBlocks.size() > 0:\n\t\tvar selBlock = gridMan.get_node( gridMan.selectedBlocks[0] )\n\n\t\tif selBlock.getBlockType() == BLOCK_WILD:\n\t\t\tif selBlock.textureName == textureName.substr( 0, selBlock.textureName.length() ):\n\t\t\t\tif calcBlockLayerVec( selBlock.blockPos ) == calcBlockLayerVec( blockPos ):\n\t\t\t\t\tgridMan.clearSelection()\n\t\t\t\t\tselBlock.popBlock()\n\t\t\t\t\tforceActivate()\n\n\t\t\t\t\treturn\n\n\tvar pairNode = pairActivate()\n\tif pairNode == null:\n\t\treturn\n\tif pairNode.selected:\n\t\tpopBlock( pairNode, justFly )\n\n\n# Force the pair to activate.\nfunc forceActivate():\n\tvar pairNode = pairActivate()\n\tif pairNode == null:\n\t\treturn\n\n\tpopBlock( pairNode )\n\n","old_contents":"extends \"AbstractBlock.gd\"\n\n# Is there a better way to do this?\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\nvar textureName\n\nfunc setTexture(textureName=\"Red1\"):\n\tprint(textureName)\n\tvar img = Image()\n\tself.textureName = textureName\n\tget_node(\"MeshInstance\").set_material_override( load(\"res:\/\/glyph_materials\/\" + textureName + \".mtl\") )\n\treturn self\n\n# Animate the removal of this block and its pair.\nfunc popBlock( pairNode, justFly=false ):\n\tget_parent().samplePlayer.play(\"deraj_pop_sound_low\")\n\t# fly away\n\tvar tweenNode = newTweenNode()\n\ttweenNode.interpolate_method( self, \"set_translation\", \\\n\t\tself.get_translation(), self.get_translation().normalized() * far_away_corner, \\\n\t\t1, Tween.TRANS_CIRC, Tween.EASE_IN_OUT )\n\n\t# remove on animation end\n\ttweenNode.connect(\"tween_complete\", self, \"request_remove\")\n\ttweenNode.start()\n\t# just one call to activate...\n\tif not justFly:\n\t\tpairNode.activate(true)\n\t\tget_parent().popPair( blockPos )\n\n# THIS IS EVERYWHERE, ANY BETTER WAY TO HAVE FUNCTIONS BETWEEN SCRIPTS?\nfunc calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n# fly away only if self.pairName is selected\nfunc activate(justFly = false):\n\tvar gridMan = get_parent()\n\tif gridMan.selectedBlocks.size() > 0:\n\t\tvar selBlock = gridMan.get_node( gridMan.selectedBlocks[0] )\n\n\t\tif selBlock.getBlockType() == BLOCK_WILD:\n\t\t\tprint( selBlock.textureName )\n\t\t\tprint( textureName.substr( 0, selBlock.textureName.length() ) )\n\t\t\tif selBlock.textureName == textureName.substr( 0, selBlock.textureName.length() ):\n\t\t\t\tif calcBlockLayerVec( selBlock.blockPos ) == calcBlockLayerVec( blockPos ):\n\t\t\t\t\tgridMan.clearSelection()\n\t\t\t\t\tselBlock.popBlock()\n\t\t\t\t\tforceActivate()\n\n\t\t\t\t\treturn\n\n\tvar pairNode = pairActivate()\n\tif pairNode == null:\n\t\treturn\n\tif pairNode.selected:\n\t\tpopBlock( pairNode, justFly )\n\n\n# Force the pair to activate.\nfunc forceActivate():\n\tvar pairNode = pairActivate()\n\tif pairNode == null:\n\t\treturn\n\n\tpopBlock( pairNode )\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"70e7ddad81ea0960aa2be89172ffa11fc3b89f94","subject":"Fixed double reporting of test suite results.","message":"Fixed double reporting of test suite results.\n","repos":"groboclown\/godot-bootstrap","old_file":"components\/unit_tests\/main.gd","new_file":"components\/unit_tests\/main.gd","new_contents":"# Run as \"godot -s main.gd\"\r\n\r\nextends SceneTree\r\n\r\nconst TEST_SOURCES = \"res:\/\/tests\/\"\r\nvar BASE_TEST_CLASS = load(TEST_SOURCES + \"base.gd\")\r\n\r\nfunc _init():\r\n\tvar tests = find_tests_from_dir(TEST_SOURCES)\r\n\trun_tests(tests)\r\n\tquit()\r\n\r\n\r\nfunc find_tests_from_dir(path):\r\n\t#print(\"Finding in \" + path)\r\n\tvar ret = []\r\n\tvar dir = Directory.new()\r\n\tdir.open(path)\r\n\tdir.list_dir_begin()\r\n\tvar file_name = dir.get_next()\r\n\twhile file_name != \"\":\r\n\t\tvar name = path + file_name\r\n\t\tif dir.current_is_dir():\r\n\t\t\t#print(\"Checking dir \" + file_name + \" [\" + file_name.right(file_name.length() - 6)+ \"]\")\r\n\t\t\tif file_name.right(file_name.length() - 6) == \"_tests\":\r\n\t\t\t\tfor f in find_tests_from_dir(name + \"\/\"):\r\n\t\t\t\t\tret.append(f)\r\n\t\telse:\r\n\t\t\tvar f = File.new()\r\n\t\t\t#print(\"Checking file \" + name)\r\n\t\t\tif name.right(name.length() - 3) == \".gd\" && f.file_exists(name):\r\n\t\t\t\t# print(\"TEST ADDED \" + name)\r\n\t\t\t\tret.append(name)\r\n\t\tfile_name = dir.get_next()\r\n\tdir.list_dir_end()\r\n\treturn ret\r\n\r\n\r\nfunc run_tests(tests):\r\n\tvar results = ResultCollector.new()\r\n\tfor test in tests:\r\n\t\tvar test_instance = create_test(test)\r\n\t\tif test_instance != null:\r\n\t\t\trun_test(test, test_instance, results)\r\n\tresults._end()\r\n\r\n\r\n\r\nfunc run_test(test_file, test_instance, results):\r\n\t# print(\"Running \" + test_file)\r\n\ttest_instance.filename = test_file.get_file()\r\n\ttest_instance.filename = test_instance.filename.left(test_instance.filename.length() - 3)\r\n\ttest_instance.run(results)\r\n\r\n\r\nfunc create_test(test_file):\r\n\tif test_file.to_lower().find(\"\/test_\") < 0:\r\n\t\t# don't even report it.\r\n\t\t#print(\"ignoring \" + test_file)\r\n\t\treturn null\r\n\tvar test_class = load(test_file)\r\n\tif test_class != null:\r\n\t\tvar test_instance = test_class.new()\r\n\t\tif test_instance != null && test_instance extends BASE_TEST_CLASS:\r\n\t\t\treturn test_instance\r\n\t\tprint(\"*** SETUP ERROR: Not a valid test instance: \" + test_file)\r\n\telse:\r\n\t\tprint(\"*** SETUP ERROR: Could not load file \" + test_file)\r\n\treturn null\r\n\r\n\r\nclass ResultCollector:\r\n\t# This can be replaced or modified to allow for different kinds of output.\r\n\t# For example, a version could output the test results as a JSON object.\r\n\r\n\t# Results for all suites\r\n\tvar suites = []\r\n\r\n\t# Current suite data\r\n\tvar suite_name = null\r\n\tvar test_stack = []\r\n\tvar current_suite = null\r\n\tvar current_test = null\r\n\r\n\tfunc start_suite(name):\r\n\t\tif suite_name != null:\r\n\t\t\tend_suite()\r\n\t\tsuite_name = name\r\n\r\n\t\t# The start and end of the suite should be the suite-wide setup\/teardown\r\n\t\tcurrent_test = {\r\n\t\t\t\"name\": \"<>\",\r\n\t\t\t\"errors\": []\r\n\t\t}\r\n\t\ttest_stack = [ current_test ]\r\n\t\tcurrent_suite = {\r\n\t\t\t\"name\": suite_name,\r\n\t\t\t\"tests\": [ current_test ],\r\n\t\t\t\"error_count\": 0\r\n\t\t}\r\n\t\tsuites.append(current_suite)\r\n\r\n\tfunc end_suite():\r\n\t\tif suite_name == null:\r\n\t\t\treturn\r\n\t\tif current_suite[\"error_count\"] <= 0:\r\n\t\t\tprint(suite_name + \": Success (\" + str(current_suite[\"tests\"].size()) + \" tests)\")\r\n\t\telse:\r\n\t\t\tprint(suite_name + \": Failed (\" + str(current_suite[\"error_count\"]) + \" errors, \" + str(current_suite[\"tests\"].size()) + \" tests)\")\r\n\t\tsuite_name = null\r\n\t\tcurrent_suite = null\r\n\t\tcurrent_test = null\r\n\r\n\tfunc start_test(test_name):\r\n\t\tcurrent_test = { \"name\": test_name, \"errors\": [] }\r\n\t\ttest_stack.append(current_test)\r\n\t\tcurrent_suite[\"tests\"].append(current_test)\r\n\r\n\tfunc end_test():\r\n\t\tif test_stack.size() > 0:\r\n\t\t\tcurrent_test = test_stack[test_stack.size() - 1]\r\n\t\t\ttest_stack.pop_back()\r\n\t\telse:\r\n\t\t\tcurrent_test = null\r\n\r\n\tfunc add_error(text):\r\n\t\tif current_suite == null || current_test == null:\r\n\t\t\t# We're outside the context of a suite or test. Shouldn't happen.\r\n\t\t\tprinterr(\"<> Failed: \" + text)\r\n\t\telse:\r\n\t\t\tcurrent_test[\"errors\"].append(text)\r\n\t\t\tcurrent_suite[\"error_count\"] += 1\r\n\t\t\tprinterr(suite_name + \"::\" + current_test[\"name\"] + \": \" + text)\r\n\r\n\t\t# It would be nice if we could capture the stack, so that the errors\r\n\t\t# could be assembled in a better form. But, currently, Godot does not\r\n\t\t# support this.\r\n\t\tprint_stack()\r\n\r\n\tfunc has_error():\r\n\t\tif current_test == null:\r\n\t\t\treturn false\r\n\t\treturn current_test[\"errors\"].size() > 0\r\n\r\n\r\n\tfunc _end():\r\n\t\t# All test results are displayed during execution.\r\n\t\t# But we'll post a final summary\r\n\t\tvar test_count = 0\r\n\t\tvar error_count = 0\r\n\t\tvar result\r\n\t\tfor result in suites:\r\n\t\t\ttest_count += result[\"tests\"].size()\r\n\t\t\terror_count += result[\"error_count\"]\r\n\t\tprint(\"==============================\")\r\n\t\tif error_count > 0:\r\n\t\t\tprinterr(\"**** Test Failures ****\")\r\n\t\telse:\r\n\t\t\tprinterr(\"**** Success ****\")\r\n\t\tprinterr(\"Total Tests Ran: \" + str(test_count))\r\n\t\tprinterr(\"Total Errors: \" + str(error_count))\r\n","old_contents":"# Run as \"godot -s main.gd\"\r\n\r\nextends SceneTree\r\n\r\nconst TEST_SOURCES = \"res:\/\/tests\/\"\r\nvar BASE_TEST_CLASS = load(TEST_SOURCES + \"base.gd\")\r\n\r\nfunc _init():\r\n\tvar tests = find_tests_from_dir(TEST_SOURCES)\r\n\trun_tests(tests)\r\n\tquit()\r\n\r\n\r\nfunc find_tests_from_dir(path):\r\n\t#print(\"Finding in \" + path)\r\n\tvar ret = []\r\n\tvar dir = Directory.new()\r\n\tdir.open(path)\r\n\tdir.list_dir_begin()\r\n\tvar file_name = dir.get_next()\r\n\twhile file_name != \"\":\r\n\t\tvar name = path + file_name\r\n\t\tif dir.current_is_dir():\r\n\t\t\t#print(\"Checking dir \" + file_name + \" [\" + file_name.right(file_name.length() - 6)+ \"]\")\r\n\t\t\tif file_name.right(file_name.length() - 6) == \"_tests\":\r\n\t\t\t\tfor f in find_tests_from_dir(name + \"\/\"):\r\n\t\t\t\t\tret.append(f)\r\n\t\telse:\r\n\t\t\tvar f = File.new()\r\n\t\t\t#print(\"Checking file \" + name)\r\n\t\t\tif name.right(name.length() - 3) == \".gd\" && f.file_exists(name):\r\n\t\t\t\t#print(\"added \" + name)\r\n\t\t\t\tret.append(name)\r\n\t\tfile_name = dir.get_next()\r\n\tdir.list_dir_end()\r\n\treturn ret\r\n\r\n\r\nfunc run_tests(tests):\r\n\tvar results = ResultCollector.new()\r\n\tfor test in tests:\r\n\t\tvar test_instance = create_test(test)\r\n\t\tif test_instance != null:\r\n\t\t\trun_test(test, test_instance, results)\r\n\tresults._end()\r\n\r\n\r\n\r\nfunc run_test(test_file, test_instance, results):\r\n\t# print(\"Running \" + test_file)\r\n\ttest_instance.filename = test_file.get_file()\r\n\ttest_instance.filename = test_instance.filename.left(test_instance.filename.length() - 3)\r\n\ttest_instance.run(results)\r\n\r\n\r\nfunc create_test(test_file):\r\n\tif test_file.to_lower().find(\"\/test_\") < 0:\r\n\t\t# don't even report it.\r\n\t\t#print(\"ignoring \" + test_file)\r\n\t\treturn null\r\n\tvar test_class = load(test_file)\r\n\tif test_class != null:\r\n\t\tvar test_instance = test_class.new()\r\n\t\tif test_instance != null && test_instance extends BASE_TEST_CLASS:\r\n\t\t\treturn test_instance\r\n\t\tprint(\"*** SETUP ERROR: Not a valid test instance: \" + test_file)\r\n\telse:\r\n\t\tprint(\"*** SETUP ERROR: Could not load file \" + test_file)\r\n\treturn null\r\n\r\n\r\nclass ResultCollector:\r\n\t# This can be replaced or modified to allow for different kinds of output.\r\n\t# For example, a version could output the test results as a JSON object.\r\n\r\n\t# Results for all suites\r\n\tvar suites = []\r\n\r\n\t# Current suite data\r\n\tvar suite_name = null\r\n\tvar test_stack = []\r\n\tvar current_suite = null\r\n\tvar current_test = null\r\n\r\n\tfunc start_suite(name):\r\n\t\tif suite_name != null:\r\n\t\t\tend_suite()\r\n\t\tsuite_name = name\r\n\r\n\t\t# The start and end of the suite should be the suite-wide setup\/teardown\r\n\t\tcurrent_test = {\r\n\t\t\t\"name\": \"<>\",\r\n\t\t\t\"errors\": []\r\n\t\t}\r\n\t\ttest_stack = [ current_test ]\r\n\t\tcurrent_suite = {\r\n\t\t\t\"name\": suite_name,\r\n\t\t\t\"tests\": [ current_test ],\r\n\t\t\t\"error_count\": 0\r\n\t\t}\r\n\t\tsuites.append(current_suite)\r\n\r\n\tfunc end_suite():\r\n\t\tif suite_name == null:\r\n\t\t\treturn\r\n\t\tif current_suite[\"error_count\"] <= 0:\r\n\t\t\tprint(suite_name + \": Success (\" + str(current_suite[\"tests\"].size()) + \" tests)\")\r\n\t\t\treturn\r\n\t\tprint(suite_name + \": Failed (\" + str(current_suite[\"error_count\"]) + \" errors, \" + str(current_suite[\"tests\"].size()) + \" tests)\")\r\n\t\tsuite_name = null\r\n\t\tcurrent_suite = null\r\n\t\tcurrent_test = null\r\n\r\n\tfunc start_test(test_name):\r\n\t\tcurrent_test = { \"name\": test_name, \"errors\": [] }\r\n\t\ttest_stack.append(current_test)\r\n\t\tcurrent_suite[\"tests\"].append(current_test)\r\n\r\n\tfunc end_test():\r\n\t\tif test_stack.size() > 0:\r\n\t\t\tcurrent_test = test_stack[test_stack.size() - 1]\r\n\t\t\ttest_stack.pop_back()\r\n\t\telse:\r\n\t\t\tcurrent_test = null\r\n\r\n\tfunc add_error(text):\r\n\t\tif current_suite == null || current_test == null:\r\n\t\t\t# We're outside the context of a suite or test. Shouldn't happen.\r\n\t\t\tprinterr(\"<> Failed: \" + text)\r\n\t\telse:\r\n\t\t\tcurrent_test[\"errors\"].append(text)\r\n\t\t\tcurrent_suite[\"error_count\"] += 1\r\n\t\t\tprinterr(suite_name + \"::\" + current_test[\"name\"] + \": \" + text)\r\n\r\n\t\t# It would be nice if we could capture the stack, so that the errors\r\n\t\t# could be assembled in a better form. But, currently, Godot does not\r\n\t\t# support this.\r\n\t\tprint_stack()\r\n\r\n\tfunc has_error():\r\n\t\tif current_test == null:\r\n\t\t\treturn false\r\n\t\treturn current_test[\"errors\"].size() > 0\r\n\r\n\r\n\tfunc _end():\r\n\t\t# All test results are displayed during execution.\r\n\t\t# But we'll post a final summary\r\n\t\tvar test_count = 0\r\n\t\tvar error_count = 0\r\n\t\tvar result\r\n\t\tfor result in suites:\r\n\t\t\ttest_count += result[\"tests\"].size()\r\n\t\t\terror_count += result[\"error_count\"]\r\n\t\tprint(\"==============================\")\r\n\t\tif error_count > 0:\r\n\t\t\tprinterr(\"**** Test Failures ****\")\r\n\t\telse:\r\n\t\t\tprinterr(\"**** Success ****\")\r\n\t\tprinterr(\"Total Tests Ran: \" + str(test_count))\r\n\t\tprinterr(\"Total Errors: \" + str(error_count))\r\n","returncode":0,"stderr":"","license":"cc0-1.0","lang":"GDScript"} {"commit":"56cd6f531cb86ef92681aceb42b3d60fcdb52858","subject":"Fixed hats for players","message":"Fixed hats for players\n","repos":"P1X-in\/rat-is-fat","old_file":"scripts\/player.gd","new_file":"scripts\/player.gd","new_contents":"extends \"res:\/\/scripts\/moving_object.gd\"\n\nvar is_playing = false\nvar is_alive = true\nvar attack_range = 100\nvar attack_width = PI * 0.33\nvar attack_strength = 1\nvar blast\n\nvar target_cone\nvar target_cone_vector = [0, 0]\nvar target_cone_angle = 0.0\n\nvar panel\n\nfunc _init(bag, player_id).(bag):\n self.bag = bag\n self.velocity = 200\n self.avatar = preload(\"res:\/\/scenes\/player\/player.xscn\").instance()\n self.body_part_head = self.avatar.get_node('head')\n self.hat = self.body_part_head.get_node('hat')\n self.body_part_body = self.avatar.get_node('body')\n self.body_part_footer = self.avatar.get_node('footer')\n self.target_cone = self.avatar.get_node('attack_cone')\n self.animations = self.avatar.get_node('body_animations')\n self.blast = self.avatar.get_node('blast_animations')\n\n self.bind_gamepad(player_id)\n self.panel = self.bag.hud.bind_player_panel(player_id)\n self.hat.set_frame(player_id)\n\nfunc bind_gamepad(id):\n var gamepad = self.bag.input.devices['pad' + str(id)]\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_enter_game_gamepad.gd\").new(self.bag, self))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_axis.gd\").new(self.bag, self, 0))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_axis.gd\").new(self.bag, self, 1))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_gamepad.gd\").new(self.bag, self, 2))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_gamepad.gd\").new(self.bag, self, 3))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_gamepad.gd\").new(self.bag, self))\n\nfunc bind_keyboard_and_mouse():\n var keyboard = self.bag.input.devices['keyboard']\n var mouse = self.bag.input.devices['mouse']\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_enter_game_keyboard.gd\").new(self.bag, self))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 1, KEY_W, -1))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 1, KEY_S, 1))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 0, KEY_A, -1))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 0, KEY_D, 1))\n mouse.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_mouse.gd\").new(self.bag, self))\n mouse.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_mouse.gd\").new(self.bag, self))\n\nfunc enter_game():\n self.is_playing = true\n self.spawn(self.bag.room_loader.get_spawn_position('initial'))\n self.panel.show()\n\nfunc spawn(position):\n self.is_alive = true\n .spawn(position)\n\nfunc die():\n self.is_alive = false\n .die()\n\nfunc process(delta):\n self.adjust_attack_cone()\n\n .process(delta)\n\nfunc modify_position(delta):\n .modify_position(delta)\n self.flip(self.target_cone_vector[0])\n if not self.animations.is_playing():\n self.animations.play('run')\n\n self.handle_items()\n\n\nfunc handle_items():\n var items = self.bag.items.get_items_near_object(self)\n for item in items:\n print('ITEM _ FOUNDh')\n\nfunc adjust_attack_cone():\n if abs(self.target_cone_vector[0]) < self.AXIS_THRESHOLD || abs(self.target_cone_vector[1]) < self.AXIS_THRESHOLD:\n return\n\n self.target_cone_angle = -atan2(self.target_cone_vector[1], self.target_cone_vector[0]) - PI\/2\n self.target_cone.set_rot(self.target_cone_angle)\n\nfunc attack():\n var enemies\n var random_attack = 'attack'+ str(1 + randi() % 2)\n\n if not self.animations.get_current_animation() == 'attack1' and not self.animations.get_current_animation() == 'attack2' :\n self.animations.play(random_attack);\n self.blast.play('blast')\n elif not self.animations.is_playing():\n if self.animations.get_current_animation() == 'attack1':\n self.animations.play('attack2')\n else:\n self.animations.play('attack1')\n self.blast.play('blast')\n\n enemies = self.bag.enemies.get_enemies_near_object(self, self.attack_range, self.target_cone_vector, self.attack_width)\n for enemy in enemies:\n enemy.recieve_damage(self.attack_strength)\n enemy.push_back(self)\n\nfunc get_power(amount):\n self.attack_strength += amount\n if self.attack_range >= 16:\n self.die();\n\n self.hp -= amount\n self.max_hp -= amount\n\nfunc get_fat(amount):\n self.hp += amount\n self.max_hp += amount\n\nfunc check_colisions():\n return\n #print ('fff', self.avatar)\n\n\n","old_contents":"extends \"res:\/\/scripts\/moving_object.gd\"\n\nvar is_playing = false\nvar is_alive = true\nvar attack_range = 100\nvar attack_width = PI * 0.33\nvar attack_strength = 1\nvar blast\n\nvar target_cone\nvar target_cone_vector = [0, 0]\nvar target_cone_angle = 0.0\n\nvar panel\n\nfunc _init(bag, player_id).(bag):\n self.bag = bag\n self.velocity = 200\n self.avatar = preload(\"res:\/\/scenes\/player\/player.xscn\").instance()\n self.body_part_head = self.avatar.get_node('head')\n self.hat = self.body_part_head.get_node('hat')\n self.body_part_body = self.avatar.get_node('body')\n self.body_part_footer = self.avatar.get_node('footer')\n self.target_cone = self.avatar.get_node('attack_cone')\n self.animations = self.avatar.get_node('body_animations')\n self.blast = self.avatar.get_node('blast_animations')\n\n self.bind_gamepad(player_id)\n self.panel = self.bag.hud.bind_player_panel(player_id)\n\nfunc bind_gamepad(id):\n var gamepad = self.bag.input.devices['pad' + str(id)]\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_enter_game_gamepad.gd\").new(self.bag, self))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_axis.gd\").new(self.bag, self, 0))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_axis.gd\").new(self.bag, self, 1))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_gamepad.gd\").new(self.bag, self, 2))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_gamepad.gd\").new(self.bag, self, 3))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_gamepad.gd\").new(self.bag, self))\n\nfunc bind_keyboard_and_mouse():\n var keyboard = self.bag.input.devices['keyboard']\n var mouse = self.bag.input.devices['mouse']\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_enter_game_keyboard.gd\").new(self.bag, self))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 1, KEY_W, -1))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 1, KEY_S, 1))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 0, KEY_A, -1))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 0, KEY_D, 1))\n mouse.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_mouse.gd\").new(self.bag, self))\n mouse.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_mouse.gd\").new(self.bag, self))\n\nfunc enter_game():\n self.is_playing = true\n self.spawn(self.bag.room_loader.get_spawn_position('initial'))\n self.panel.show()\n randomize()\n self.hat.set_frame(randi()%4)\n\nfunc spawn(position):\n self.is_alive = true\n .spawn(position)\n\nfunc die():\n self.is_alive = false\n .die()\n\nfunc process(delta):\n self.adjust_attack_cone()\n\n .process(delta)\n\nfunc modify_position(delta):\n .modify_position(delta)\n self.flip(self.target_cone_vector[0])\n if not self.animations.is_playing():\n self.animations.play('run')\n\n self.handle_items()\n\n\nfunc handle_items():\n var items = self.bag.items.get_items_near_object(self)\n for item in items:\n print('ITEM _ FOUNDh')\n\nfunc adjust_attack_cone():\n if abs(self.target_cone_vector[0]) < self.AXIS_THRESHOLD || abs(self.target_cone_vector[1]) < self.AXIS_THRESHOLD:\n return\n\n self.target_cone_angle = -atan2(self.target_cone_vector[1], self.target_cone_vector[0]) - PI\/2\n self.target_cone.set_rot(self.target_cone_angle)\n\nfunc attack():\n var enemies\n var random_attack = 'attack'+ str(1 + randi() % 2)\n\n if not self.animations.get_current_animation() == 'attack1' and not self.animations.get_current_animation() == 'attack2' :\n self.animations.play(random_attack);\n self.blast.play('blast')\n elif not self.animations.is_playing():\n if self.animations.get_current_animation() == 'attack1':\n self.animations.play('attack2')\n else:\n self.animations.play('attack1')\n self.blast.play('blast')\n\n enemies = self.bag.enemies.get_enemies_near_object(self, self.attack_range, self.target_cone_vector, self.attack_width)\n for enemy in enemies:\n enemy.recieve_damage(self.attack_strength)\n enemy.push_back(self)\n\nfunc get_power(amount):\n self.attack_strength += amount\n if self.attack_range >= 16:\n self.die();\n\n self.hp -= amount\n self.max_hp -= amount\n\nfunc get_fat(amount):\n self.hp += amount\n self.max_hp += amount\n\nfunc check_colisions():\n return\n #print ('fff', self.avatar)\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"f9a12d2d1995c66ae2631ccfd8ccac741f84baad","subject":"Joystick demo script cleanup","message":"Joystick demo script cleanup\n\nRemoves a leftover variable and uses constants instead of magic numbers.\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"misc\/joysticks\/joysticks.gd","new_file":"misc\/joysticks\/joysticks.gd","new_contents":"\nextends Node2D\n\n# Joysticks demo, written by Dana Olson \n#\n# This is a demo of joystick support, and doubles as a testing application\n# inspired by and similar to jstest-gtk.\n#\n# Licensed under the MIT license\n\n# Member variables\nvar joy_num\nvar cur_joy\nvar axis_value\n\nconst DEADZONE = 0.2\n\nfunc _fixed_process(delta):\n\t# Get the joystick device number from the spinbox\n\tjoy_num = get_node(\"joy_num\").get_value()\n\n\t# Display the name of the joystick if we haven't already\n\tif joy_num != cur_joy:\n\t\tcur_joy = joy_num\n\t\tget_node(\"joy_name\").set_text(Input.get_joy_name(joy_num))\n\n\t# Loop through the axes and show their current values\n\tfor axis in range(JOY_ANALOG_0_X, JOY_AXIS_MAX):\n\t\taxis_value = Input.get_joy_axis(joy_num, axis)\n\t\tget_node(\"axis_prog\" + str(axis)).set_value(100*axis_value)\n\t\tget_node(\"axis_val\" + str(axis)).set_text(str(axis_value))\n\t\t# Show joystick direction indicators\n\t\tif (axis <= JOY_ANALOG_1_Y):\n\t\t\tif (abs(axis_value) < DEADZONE):\n\t\t\t\tget_node(\"diagram\/axes\/\" + str(axis) + \"+\").hide()\n\t\t\t\tget_node(\"diagram\/axes\/\" + str(axis) + \"-\").hide()\n\t\t\telif (axis_value > 0):\n\t\t\t\tget_node(\"diagram\/axes\/\" + str(axis) + \"+\").show()\n\t\t\telse:\n\t\t\t\tget_node(\"diagram\/axes\/\" + str(axis) + \"-\").show()\n\n\t# Loop through the buttons and highlight the ones that are pressed\n\tfor btn in range(JOY_BUTTON_0, JOY_BUTTON_MAX):\n\t\tif (Input.is_joy_button_pressed(joy_num, btn)):\n\t\t\tget_node(\"btn\" + str(btn)).add_color_override(\"font_color\", Color(1, 1, 1, 1))\n\t\t\tget_node(\"diagram\/buttons\/\" + str(btn)).show()\n\t\telse:\n\t\t\tget_node(\"btn\" + str(btn)).add_color_override(\"font_color\", Color(0.2, 0.1, 0.3, 1))\n\t\t\tget_node(\"diagram\/buttons\/\" + str(btn)).hide()\n\nfunc _ready():\n\tset_fixed_process(true)\n\tInput.connect(\"joy_connection_changed\", self, \"_on_joy_connection_changed\")\n\n#Called whenever a joystick has been connected or disconnected.\nfunc _on_joy_connection_changed(device_id, connected):\n\tif device_id == cur_joy:\n\t\tif connected:\n\t\t\tget_node(\"joy_name\").set_text(Input.get_joy_name(device_id))\n\t\telse:\n\t\t\tget_node(\"joy_name\").set_text(\"\")\n","old_contents":"\nextends Node2D\n\n# Joysticks demo, written by Dana Olson \n#\n# This is a demo of joystick support, and doubles as a testing application\n# inspired by and similar to jstest-gtk.\n#\n# Licensed under the MIT license\n\n# Member variables\nvar joy_num\nvar cur_joy\nvar axis_value\nvar btn_state\n\nconst DEADZONE = 0.2\n\nfunc _fixed_process(delta):\n\t# Get the joystick device number from the spinbox\n\tjoy_num = get_node(\"joy_num\").get_value()\n\n\t# Display the name of the joystick if we haven't already\n\tif joy_num != cur_joy:\n\t\tcur_joy = joy_num\n\t\tget_node(\"joy_name\").set_text(Input.get_joy_name(joy_num))\n\n\t# Loop through the axes and show their current values\n\tfor axis in range(0, 8):\n\t\taxis_value = Input.get_joy_axis(joy_num, axis)\n\t\tget_node(\"axis_prog\" + str(axis)).set_value(100*axis_value)\n\t\tget_node(\"axis_val\" + str(axis)).set_text(str(axis_value))\n\t\tif (axis < 4):\n\t\t\tif (abs(axis_value) < DEADZONE):\n\t\t\t\tget_node(\"diagram\/axes\/\" + str(axis) + \"+\").hide()\n\t\t\t\tget_node(\"diagram\/axes\/\" + str(axis) + \"-\").hide()\n\t\t\telif (axis_value > 0):\n\t\t\t\tget_node(\"diagram\/axes\/\" + str(axis) + \"+\").show()\n\t\t\telse:\n\t\t\t\tget_node(\"diagram\/axes\/\" + str(axis) + \"-\").show()\n\n\t# Loop through the buttons and highlight the ones that are pressed\n\tfor btn in range(0, 16):\n\t\tbtn_state = 1\n\t\tif (Input.is_joy_button_pressed(joy_num, btn)):\n\t\t\tget_node(\"btn\" + str(btn)).add_color_override(\"font_color\", Color(1, 1, 1, 1))\n\t\t\tget_node(\"diagram\/buttons\/\" + str(btn)).show()\n\t\telse:\n\t\t\tget_node(\"btn\" + str(btn)).add_color_override(\"font_color\", Color(0.2, 0.1, 0.3, 1))\n\t\t\tget_node(\"diagram\/buttons\/\" + str(btn)).hide()\n\nfunc _ready():\n\tset_fixed_process(true)\n\tInput.connect(\"joy_connection_changed\", self, \"_on_joy_connection_changed\")\n\n#Called whenever a joystick has been connected or disconnected.\nfunc _on_joy_connection_changed(device_id, connected):\n\tif device_id == cur_joy:\n\t\tif connected:\n\t\t\tget_node(\"joy_name\").set_text(Input.get_joy_name(device_id))\n\t\telse:\n\t\t\tget_node(\"joy_name\").set_text(\"\")\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"bcc8f64d7a2f3ec012bfd0e11003cf9a29c3a0b7","subject":"Platformer 2D: Simplify controller with proper is_on_floor usage","message":"Platformer 2D: Simplify controller with proper is_on_floor usage\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"2d\/platformer\/player.gd","new_file":"2d\/platformer\/player.gd","new_contents":"extends KinematicBody2D\n\nconst GRAVITY_VEC = Vector2(0, 900)\nconst FLOOR_NORMAL = Vector2(0, -1)\nconst SLOPE_SLIDE_STOP = 25.0\nconst WALK_SPEED = 250 # pixels\/sec\nconst JUMP_SPEED = 480\nconst SIDING_CHANGE_SPEED = 10\nconst BULLET_VELOCITY = 1000\nconst SHOOT_TIME_SHOW_WEAPON = 0.2\n\nvar linear_vel = Vector2()\nvar on_floor = false\nvar shoot_time = 99999 # time since last shot\n\nvar anim = \"\"\n\n# cache the sprite here for fast access (we will set scale to flip it often)\nonready var sprite = $sprite\n\nfunc _physics_process(delta):\n\t# Increment counters\n\tshoot_time += delta\n\n\t### MOVEMENT ###\n\n\t# Apply gravity\n\tlinear_vel += delta * GRAVITY_VEC\n\t# Move and slide\n\tlinear_vel = move_and_slide(linear_vel, FLOOR_NORMAL, SLOPE_SLIDE_STOP)\n\t# Detect if we are on floor - only works if called *after* move_and_slide\n\tvar on_floor = is_on_floor()\n\n\t### CONTROL ###\n\n\t# Horizontal movement\n\tvar target_speed = 0\n\tif Input.is_action_pressed(\"move_left\"):\n\t\ttarget_speed -= 1\n\tif Input.is_action_pressed(\"move_right\"):\n\t\ttarget_speed += 1\n\n\ttarget_speed *= WALK_SPEED\n\tlinear_vel.x = lerp(linear_vel.x, target_speed, 0.1)\n\n\t# Jumping\n\tif on_floor and Input.is_action_just_pressed(\"jump\"):\n\t\tlinear_vel.y = -JUMP_SPEED\n\t\t$sound_jump.play()\n\n\t# Shooting\n\tif Input.is_action_just_pressed(\"shoot\"):\n\t\tvar bullet = preload(\"res:\/\/bullet.tscn\").instance()\n\t\tbullet.position = $sprite\/bullet_shoot.global_position # use node for shoot position\n\t\tbullet.linear_velocity = Vector2(sprite.scale.x * BULLET_VELOCITY, 0)\n\t\tbullet.add_collision_exception_with(self) # don't want player to collide with bullet\n\t\tget_parent().add_child(bullet) # don't want bullet to move with me, so add it as child of parent\n\t\t$sound_shoot.play()\n\t\tshoot_time = 0\n\n\t### ANIMATION ###\n\n\tvar new_anim = \"idle\"\n\n\tif on_floor:\n\t\tif linear_vel.x < -SIDING_CHANGE_SPEED:\n\t\t\tsprite.scale.x = -1\n\t\t\tnew_anim = \"run\"\n\n\t\tif linear_vel.x > SIDING_CHANGE_SPEED:\n\t\t\tsprite.scale.x = 1\n\t\t\tnew_anim = \"run\"\n\telse:\n\t\t# We want the character to immediately change facing side when the player\n\t\t# tries to change direction, during air control.\n\t\t# This allows for example the player to shoot quickly left then right.\n\t\tif Input.is_action_pressed(\"move_left\") and not Input.is_action_pressed(\"move_right\"):\n\t\t\tsprite.scale.x = -1\n\t\tif Input.is_action_pressed(\"move_right\") and not Input.is_action_pressed(\"move_left\"):\n\t\t\tsprite.scale.x = 1\n\n\t\tif linear_vel.y < 0:\n\t\t\tnew_anim = \"jumping\"\n\t\telse:\n\t\t\tnew_anim = \"falling\"\n\n\tif shoot_time < SHOOT_TIME_SHOW_WEAPON:\n\t\tnew_anim += \"_weapon\"\n\n\tif new_anim != anim:\n\t\tanim = new_anim\n\t\t$anim.play(anim)\n","old_contents":"extends KinematicBody2D\n\nconst GRAVITY_VEC = Vector2(0, 900)\nconst FLOOR_NORMAL = Vector2(0, -1)\nconst SLOPE_SLIDE_STOP = 25.0\nconst MIN_ONAIR_TIME = 0.1\nconst WALK_SPEED = 250 # pixels\/sec\nconst JUMP_SPEED = 480\nconst SIDING_CHANGE_SPEED = 10\nconst BULLET_VELOCITY = 1000\nconst SHOOT_TIME_SHOW_WEAPON = 0.2\n\nvar linear_vel = Vector2()\nvar onair_time = 0 #\nvar on_floor = false\nvar shoot_time=99999 #time since last shot\n\nvar anim=\"\"\n\n#cache the sprite here for fast access (we will set scale to flip it often)\nonready var sprite = $sprite\n\nfunc _physics_process(delta):\n\t#increment counters\n\n\tonair_time += delta\n\tshoot_time += delta\n\n\t### MOVEMENT ###\n\n\t# Apply Gravity\n\tlinear_vel += delta * GRAVITY_VEC\n\t# Move and Slide\n\tlinear_vel = move_and_slide(linear_vel, FLOOR_NORMAL, SLOPE_SLIDE_STOP)\n\t# Detect Floor\n\tif is_on_floor():\n\t\tonair_time = 0\n\n\ton_floor = onair_time < MIN_ONAIR_TIME\n\n\t### CONTROL ###\n\n\t# Horizontal Movement\n\tvar target_speed = 0\n\tif Input.is_action_pressed(\"move_left\"):\n\t\ttarget_speed += -1\n\tif Input.is_action_pressed(\"move_right\"):\n\t\ttarget_speed += 1\n\n\ttarget_speed *= WALK_SPEED\n\tlinear_vel.x = lerp(linear_vel.x, target_speed, 0.1)\n\n\t# Jumping\n\tif on_floor and Input.is_action_just_pressed(\"jump\"):\n\t\tlinear_vel.y = -JUMP_SPEED\n\t\t$sound_jump.play()\n\n\t# Shooting\n\tif Input.is_action_just_pressed(\"shoot\"):\n\t\tvar bullet = preload(\"res:\/\/bullet.tscn\").instance()\n\t\tbullet.position = $sprite\/bullet_shoot.global_position #use node for shoot position\n\t\tbullet.linear_velocity = Vector2(sprite.scale.x * BULLET_VELOCITY, 0)\n\t\tbullet.add_collision_exception_with(self) # don't want player to collide with bullet\n\t\tget_parent().add_child(bullet) #don't want bullet to move with me, so add it as child of parent\n\t\t$sound_shoot.play()\n\t\tshoot_time = 0\n\n\t### ANIMATION ###\n\n\tvar new_anim = \"idle\"\n\n\tif on_floor:\n\t\tif linear_vel.x < -SIDING_CHANGE_SPEED:\n\t\t\tsprite.scale.x = -1\n\t\t\tnew_anim = \"run\"\n\n\t\tif linear_vel.x > SIDING_CHANGE_SPEED:\n\t\t\tsprite.scale.x = 1\n\t\t\tnew_anim = \"run\"\n\telse:\n\t\t# We want the character to immediately change facing side when the player\n\t\t# tries to change direction, during air control.\n\t\t# This allows for example the player to shoot quickly left then right.\n\t\tif Input.is_action_pressed(\"move_left\") and not Input.is_action_pressed(\"move_right\"):\n\t\t\tsprite.scale.x = -1\n\t\tif Input.is_action_pressed(\"move_right\") and not Input.is_action_pressed(\"move_left\"):\n\t\t\tsprite.scale.x = 1\n\n\t\tif linear_vel.y < 0:\n\t\t\tnew_anim = \"jumping\"\n\t\telse:\n\t\t\tnew_anim = \"falling\"\n\n\tif shoot_time < SHOOT_TIME_SHOW_WEAPON:\n\t\tnew_anim += \"_weapon\"\n\n\tif new_anim != anim:\n\t\tanim = new_anim\n\t\t$anim.play(anim)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"2ab864d60e316ac60016fc23b957df9aed3757a9","subject":"Changed how the player moves.","message":"Changed how the player moves.\n","repos":"NiclasEriksen\/godot_rpg","old_file":"scripts\/player_control.gd","new_file":"scripts\/player_control.gd","new_contents":"\nextends Node2D\n\n# member variables here, example:\n# var a=2\n# var b=\"textvar\"\n\nvar jump_cd = false\nsignal moved(pos)\nsignal jump\nsignal attack\nvar attacking = false\nvar sprinting = false\nvar vel = Vector2(0, 0)\nvar cur_vel = 0\nvar max_vel = 150\nvar sprint_factor = 1.5\nvar rot_spd = 5\nvar root = null\nvar anim = null\n\nfunc _ready():\n\tself.set_process(true)\n\tself.set_process_input(true)\n\troot = get_tree().get_root().get_node(\"Game\")\n\tanim = get_node(\"BodyAnimation\")\n\nfunc _draw():\n\tpass\n\nfunc _input(event):\n\tif event.is_action_pressed(\"MOVE_UP\"):\n\t\tvel.y = vel.y + max_vel\n\telif event.is_action_released(\"MOVE_UP\"):\n\t\tvel.y = vel.y - max_vel\n\tif event.is_action_pressed(\"MOVE_DOWN\"):\n\t\tvel.y = vel.y - max_vel\n\telif event.is_action_released(\"MOVE_DOWN\"):\n\t\tvel.y = vel.y + max_vel\n\tif event.is_action_pressed(\"MOVE_LEFT\"):\n\t\tvel.x = vel.x + max_vel\n\telif event.is_action_released(\"MOVE_LEFT\"):\n\t\tvel.x = vel.x - max_vel\n\tif event.is_action_pressed(\"MOVE_RIGHT\"):\n\t\tvel.x = vel.x - max_vel\n\telif event.is_action_released(\"MOVE_RIGHT\"):\n\t\tvel.x = vel.x + max_vel\n\nfunc _process(delta):\n\tif Input.is_action_pressed(\"ATTACK\"):\n\t\tif not attacking:\n\t\t\temit_signal(\"attack\")\n\t\t\tattacking = true\n\telse:\n\t\tattacking = false\n\n\tif Input.is_action_pressed(\"MOVE_JUMP\"):\n\t\tself.jump()\n\t\n\tif root:\n\t\tvar r = get_angle_to(root.get_global_mouse_pos()) * (rot_spd * delta)\n\t\trotate(r)\n\n\tif Input.is_action_pressed(\"SPRINT\"):\n\t\t# self.move_and_slide(vel * 75 * delta)\n\t\tself.move(vel * 1.5 * delta)\n\telse:\n\t\tprint(vel.rotated(get_rot()), vel)\n\t\t# self.move_and_slide(vel * 50 * delta)\n\t\tself.move(vel.rotated(get_rot()) * delta)\n\n\tself.emit_signal(\"moved\", self.get_pos())\n\tif anim:\n\t\tif vel.x > 0.0 or vel.x < 0.0 or vel.y > 0.0 or vel.y < 0.0:\n\t\t\tif not anim.is_playing():\n\t\t\t\tanim.play(\"Walk\")\n\t\t\telse:\n\t\t\t\tif Input.is_action_pressed(\"SPRINT\"):\n\t\t\t\t\tanim.set_speed(sprint_factor)\n\t\t\t\telse:\n\t\t\t\t\tanim.set_speed(1)\n\t\t\t\t# print(\"Starting\")\n\t\telse:\n\t\t\tif anim.is_playing():\n\t\t\t\t# print(\"Stopping\")\n\t\t\t\tanim.stop(true)\n\t\t\n\nfunc jump():\n\tself.emit_signal(\"jump\")\n\tself.emit_signal(\"moved\", self.get_pos())\n","old_contents":"\nextends Node2D\n\n# member variables here, example:\n# var a=2\n# var b=\"textvar\"\n\nvar jump_cd = false\nsignal moved(pos)\nsignal jump\nsignal attack\nvar attacking = false\nvar sprinting = false\nvar vel = Vector2(0, 0)\nvar cur_vel = 0\nvar max_vel = 150\nvar sprint_factor = 1.5\nvar rot_spd = 5\nvar root = null\nvar anim = null\n\nfunc _ready():\n\tself.set_process(true)\n\tself.set_process_input(true)\n\troot = get_tree().get_root().get_node(\"Game\")\n\tanim = get_node(\"BodyAnimation\")\n\nfunc _draw():\n\tpass\n\nfunc _input(event):\n\tif event.is_action_pressed(\"MOVE_UP\"):\n\t\tvel.y = vel.y - max_vel\n\telif event.is_action_released(\"MOVE_UP\"):\n\t\tvel.y = vel.y + max_vel\n\tif event.is_action_pressed(\"MOVE_DOWN\"):\n\t\tvel.y = vel.y + max_vel\n\telif event.is_action_released(\"MOVE_DOWN\"):\n\t\tvel.y = vel.y - max_vel\n\tif event.is_action_pressed(\"MOVE_LEFT\"):\n\t\tvel.x = vel.x - max_vel\n\telif event.is_action_released(\"MOVE_LEFT\"):\n\t\tvel.x = vel.x + max_vel\n\tif event.is_action_pressed(\"MOVE_RIGHT\"):\n\t\tvel.x = vel.x + max_vel\n\telif event.is_action_released(\"MOVE_RIGHT\"):\n\t\tvel.x = vel.x - max_vel\n\nfunc _process(delta):\n\tif Input.is_action_pressed(\"ATTACK\"):\n\t\tif not attacking:\n\t\t\temit_signal(\"attack\")\n\t\t\tattacking = true\n\telse:\n\t\tattacking = false\n\n\tif Input.is_action_pressed(\"MOVE_JUMP\"):\n\t\tself.jump()\n\t\n\tif root:\n\t\tvar r = get_angle_to(root.get_global_mouse_pos()) * (rot_spd * delta)\n\t\trotate(r)\n\n\tif Input.is_action_pressed(\"SPRINT\"):\n\t\t# self.move_and_slide(vel * 75 * delta)\n\t\tself.move(vel * 1.5 * delta)\n\telse:\n\t\t# self.move_and_slide(vel * 50 * delta)\n\t\tself.move(vel * delta)\n\n\tself.emit_signal(\"moved\", self.get_pos())\n\tif anim:\n\t\tif vel.x > 0.0 or vel.x < 0.0 or vel.y > 0.0 or vel.y < 0.0:\n\t\t\tif not anim.is_playing():\n\t\t\t\tanim.play(\"Walk\")\n\t\t\telse:\n\t\t\t\tif Input.is_action_pressed(\"SPRINT\"):\n\t\t\t\t\tanim.set_speed(sprint_factor)\n\t\t\t\telse:\n\t\t\t\t\tanim.set_speed(1)\n\t\t\t\t# print(\"Starting\")\n\t\telse:\n\t\t\tif anim.is_playing():\n\t\t\t\t# print(\"Stopping\")\n\t\t\t\tanim.stop(true)\n\t\t\n\nfunc jump():\n\tself.emit_signal(\"jump\")\n\tself.emit_signal(\"moved\", self.get_pos())\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"dd739668b47d096b21ded08f8a40f40baaed644d","subject":"Fix bug that could prevent cubio from saving the princess","message":"Fix bug that could prevent cubio from saving the princess\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"3d\/kinematic_char\/cubio.gd","new_file":"3d\/kinematic_char\/cubio.gd","new_contents":"\nextends KinematicBody\n\n# Member variables\nvar g = -9.8\nvar vel = Vector3()\nconst MAX_SPEED = 5\nconst JUMP_SPEED = 7\nconst ACCEL= 2\nconst DEACCEL= 4\nconst MAX_SLOPE_ANGLE = 30\n\n\nfunc _fixed_process(delta):\n\tvar dir = Vector3() # Where does the player intend to walk to\n\tvar cam_xform = get_node(\"target\/camera\").get_global_transform()\n\t\n\tif (Input.is_action_pressed(\"move_forward\")):\n\t\tdir += -cam_xform.basis[2]\n\tif (Input.is_action_pressed(\"move_backwards\")):\n\t\tdir += cam_xform.basis[2]\n\tif (Input.is_action_pressed(\"move_left\")):\n\t\tdir += -cam_xform.basis[0]\n\tif (Input.is_action_pressed(\"move_right\")):\n\t\tdir += cam_xform.basis[0]\n\t\n\tdir.y = 0\n\tdir = dir.normalized()\n\t\n\tvel.y += delta*g\n\t\n\tvar hvel = vel\n\thvel.y = 0\n\t\n\tvar target = dir*MAX_SPEED\n\tvar accel\n\tif (dir.dot(hvel) > 0):\n\t\taccel = ACCEL\n\telse:\n\t\taccel = DEACCEL\n\t\n\thvel = hvel.linear_interpolate(target, accel*delta)\n\t\n\tvel.x = hvel.x\n\tvel.z = hvel.z\n\t\n\tvar motion = move(vel*delta)\n\t\n\tvar on_floor = false\n\tvar original_vel = vel\n\tvar floor_velocity = Vector3()\n\tvar attempts = 4\n\t\n\twhile(is_colliding() and attempts):\n\t\tvar n = get_collision_normal()\n\t\t\n\t\tif (rad2deg(acos(n.dot(Vector3(0, 1, 0)))) < MAX_SLOPE_ANGLE):\n\t\t\t\t# If angle to the \"up\" vectors is < angle tolerance,\n\t\t\t\t# char is on floor\n\t\t\t\tfloor_velocity = get_collider_velocity()\n\t\t\t\ton_floor = true\n\t\t\t\n\t\tmotion = n.slide(motion)\n\t\tvel = n.slide(vel)\n\t\tif (original_vel.dot(vel) > 0):\n\t\t\t# Do not allow to slide towads the opposite direction we were coming from\n\t\t\tmotion=move(motion)\n\t\t\tif (motion.length() < 0.001):\n\t\t\t\tbreak\n\t\tattempts -= 1\n\t\n\tif (on_floor and floor_velocity != Vector3()):\n\t\tmove(floor_velocity*delta)\n\t\n\tif (on_floor and Input.is_action_pressed(\"jump\")):\n\t\tvel.y = JUMP_SPEED\n\t\n\tvar crid = get_node(\"..\/elevator1\").get_rid()\n\n\nfunc _ready():\n\tset_fixed_process(true)\n\n\nfunc _on_tcube_body_enter(body):\n\tif (body == self):\n\t\tget_node(\"..\/ty\").show()\n","old_contents":"\nextends KinematicBody\n\n# Member variables\nvar g = -9.8\nvar vel = Vector3()\nconst MAX_SPEED = 5\nconst JUMP_SPEED = 7\nconst ACCEL= 2\nconst DEACCEL= 4\nconst MAX_SLOPE_ANGLE = 30\n\n\nfunc _fixed_process(delta):\n\tvar dir = Vector3() # Where does the player intend to walk to\n\tvar cam_xform = get_node(\"target\/camera\").get_global_transform()\n\t\n\tif (Input.is_action_pressed(\"move_forward\")):\n\t\tdir += -cam_xform.basis[2]\n\tif (Input.is_action_pressed(\"move_backwards\")):\n\t\tdir += cam_xform.basis[2]\n\tif (Input.is_action_pressed(\"move_left\")):\n\t\tdir += -cam_xform.basis[0]\n\tif (Input.is_action_pressed(\"move_right\")):\n\t\tdir += cam_xform.basis[0]\n\t\n\tdir.y = 0\n\tdir = dir.normalized()\n\t\n\tvel.y += delta*g\n\t\n\tvar hvel = vel\n\thvel.y = 0\n\t\n\tvar target = dir*MAX_SPEED\n\tvar accel\n\tif (dir.dot(hvel) > 0):\n\t\taccel = ACCEL\n\telse:\n\t\taccel = DEACCEL\n\t\n\thvel = hvel.linear_interpolate(target, accel*delta)\n\t\n\tvel.x = hvel.x\n\tvel.z = hvel.z\n\t\n\tvar motion = move(vel*delta)\n\t\n\tvar on_floor = false\n\tvar original_vel = vel\n\tvar floor_velocity = Vector3()\n\tvar attempts = 4\n\t\n\twhile(is_colliding() and attempts):\n\t\tvar n = get_collision_normal()\n\t\t\n\t\tif (rad2deg(acos(n.dot(Vector3(0, 1, 0)))) < MAX_SLOPE_ANGLE):\n\t\t\t\t# If angle to the \"up\" vectors is < angle tolerance,\n\t\t\t\t# char is on floor\n\t\t\t\tfloor_velocity = get_collider_velocity()\n\t\t\t\ton_floor = true\n\t\t\t\n\t\tmotion = n.slide(motion)\n\t\tvel = n.slide(vel)\n\t\tif (original_vel.dot(vel) > 0):\n\t\t\t# Do not allow to slide towads the opposite direction we were coming from\n\t\t\tmotion=move(motion)\n\t\t\tif (motion.length() < 0.001):\n\t\t\t\tbreak\n\t\tattempts -= 1\n\t\n\tif (on_floor and floor_velocity != Vector3()):\n\t\tmove(floor_velocity*delta)\n\t\n\tif (on_floor and Input.is_action_pressed(\"jump\")):\n\t\tvel.y = JUMP_SPEED\n\t\n\tvar crid = get_node(\"..\/elevator1\").get_rid()\n\n\nfunc _ready():\n\tset_fixed_process(true)\n\n\nfunc _on_tcube_body_enter(body):\n\tget_node(\"..\/ty\").show()\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"ad587cc27f4c0a25862a6b0fcbbe1af0b9ae4997","subject":"Update cubio.gd","message":"Update cubio.gd\n\na little wrong only.","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"3d\/kinematic_char\/cubio.gd","new_file":"3d\/kinematic_char\/cubio.gd","new_contents":"\nextends KinematicBody\n\n# member variables here, example:\n# var a=2\n# var b=\"textvar\"\n\nvar g = -9.8\nvar vel = Vector3()\nconst MAX_SPEED = 5\nconst JUMP_SPEED = 7\nconst ACCEL= 2\nconst DEACCEL= 4\nconst MAX_SLOPE_ANGLE = 30\n\nfunc _fixed_process(delta):\n\n\tvar dir = Vector3() #where does the player intend to walk to\n\tvar cam_xform = get_node(\"target\/camera\").get_global_transform()\n\t\n\tif (Input.is_action_pressed(\"move_forward\")):\n\t\tdir+=-cam_xform.basis[2] \n\tif (Input.is_action_pressed(\"move_backwards\")):\n\t\tdir+=cam_xform.basis[2] \n\tif (Input.is_action_pressed(\"move_left\")):\n\t\tdir+=-cam_xform.basis[0] \n\tif (Input.is_action_pressed(\"move_right\")):\n\t\tdir+=cam_xform.basis[0] \n\n\tdir.y=0\n\tdir=dir.normalized()\n\n\tvel.y+=delta*g\n\t\n\tvar hvel = vel\n\thvel.y=0\t\n\t\n\tvar target = dir*MAX_SPEED\n\tvar accel\n\tif (dir.dot(hvel) >0):\n\t\taccel=ACCEL\n\telse:\n\t\taccel=DEACCEL\n\t\t\n\thvel = hvel.linear_interpolate(target,accel*delta)\n\t\n\tvel.x=hvel.x;\n\tvel.z=hvel.z\t\n\t\t\n\tvar motion = vel*delta\n\tmotion=move(vel*delta)\n\n\tvar on_floor = false\n\tvar original_vel = vel\n\n\n\tvar floor_velocity=Vector3()\n\n\tvar attempts=4\n\t\n\twhile(is_colliding() and attempts):\n\t\tvar n=get_collision_normal()\n\n\t\tif ( rad2deg(acos(n.dot( Vector3(0,1,0)))) < MAX_SLOPE_ANGLE ):\n\t\t\t\t#if angle to the \"up\" vectors is < angle tolerance\n\t\t\t\t#char is on floor\n\t\t\t\tfloor_velocity=get_collider_velocity()\n\t\t\t\ton_floor=true\t\t\t\n\t\t\t\n\t\tmotion = n.slide(motion)\n\t\tvel = n.slide(vel)\n\t\tif (original_vel.dot(vel) > 0):\n\t\t\t#do not allow to slide towads the opposite direction we were coming from\n\t\t\tmotion=move(motion)\n\t\t\tif (motion.length()<0.001):\n\t\t\t\tbreak\n\t\tattempts-=1\n\n\tif (on_floor and floor_velocity!=Vector3()):\n\t\t\tmove(floor_velocity*delta)\n\t\n\tif (on_floor and Input.is_action_pressed(\"jump\")):\n\t\tvel.y=JUMP_SPEED\n\t\t\n\tvar crid = get_node(\"..\/elevator1\").get_rid()\n#\tprint(crid,\" : \",PS.body_get_state(crid,PS.BODY_STATE_TRANSFORM))\n\nfunc _ready():\n\t# Initalization here\n\tset_fixed_process(true)\n\tpass\n\n\nfunc _on_tcube_body_enter( body ):\n\tget_node(\"..\/ty\").show()\n\tpass # replace with function body\n","old_contents":"\nextends KinematicBody\n\n# member variables here, example:\n# var a=2\n# var b=\"textvar\"\n\nvar g = -9.8\nvar vel = Vector3()\nconst MAX_SPEED = 5\nconst JUMP_SPEED = 7\nconst ACCEL= 2\nconst DEACCEL= 4\nconst MAX_SLOPE_ANGLE = 30\n\nfunc _fixed_process(delta):\n\n\tvar dir = Vector3() #where does the player intend to walk to\n\tvar cam_xform = get_node(\"target\/camera\").get_global_transform()\n\t\n\tif (Input.is_action_pressed(\"move_forward\")):\n\t\tdir+=-cam_xform.basis[2] \n\tif (Input.is_action_pressed(\"move_backwards\")):\n\t\tdir+=cam_xform.basis[2] \n\tif (Input.is_action_pressed(\"move_left\")):\n\t\tdir+=-cam_xform.basis[0] \n\tif (Input.is_action_pressed(\"move_right\")):\n\t\tdir+=cam_xform.basis[0] \n\n\tdir.y=0\n\tdir=dir.normalized()\n\n\tvel.y+=delta*g\n\t\n\tvar hvel = vel\n\thvel.y=0\t\n\t\n\tvar target = dir*MAX_SPEED\n\tvar accel\n\tif (dir.dot(hvel) >0):\n\t\taccel=ACCEL\n\telse:\n\t\taccel=DEACCEL\n\t\t\n\thvel = hvel.linear_interpolate(target,accel*delta)\n\t\n\tvel.x=hvel.x;\n\tvel.z=hvel.z\t\n\t\t\n\tvar motion = vel*delta\n\tmotion=move(vel*delta)\n\n\tvar on_floor = false\n\tvar original_vel = vel\n\n\n\tvar floor_velocity=Vector2()\n\n\tvar attempts=4\n\t\n\twhile(is_colliding() and attempts):\n\t\tvar n=get_collision_normal()\n\n\t\tif ( rad2deg(acos(n.dot( Vector3(0,1,0)))) < MAX_SLOPE_ANGLE ):\n\t\t\t\t#if angle to the \"up\" vectors is < angle tolerance\n\t\t\t\t#char is on floor\n\t\t\t\tfloor_velocity=get_collider_velocity()\n\t\t\t\ton_floor=true\t\t\t\n\t\t\t\n\t\tmotion = n.slide(motion)\n\t\tvel = n.slide(vel)\n\t\tif (original_vel.dot(vel) > 0):\n\t\t\t#do not allow to slide towads the opposite direction we were coming from\n\t\t\tmotion=move(motion)\n\t\t\tif (motion.length()<0.001):\n\t\t\t\tbreak\n\t\tattempts-=1\n\n\tif (on_floor and floor_velocity!=Vector3()):\n\t\t\tmove(floor_velocity*delta)\n\t\n\tif (on_floor and Input.is_action_pressed(\"jump\")):\n\t\tvel.y=JUMP_SPEED\n\t\t\n\tvar crid = get_node(\"..\/elevator1\").get_rid()\n#\tprint(crid,\" : \",PS.body_get_state(crid,PS.BODY_STATE_TRANSFORM))\n\nfunc _ready():\n\t# Initalization here\n\tset_fixed_process(true)\n\tpass\n\n\nfunc _on_tcube_body_enter( body ):\n\tget_node(\"..\/ty\").show()\n\tpass # replace with function body\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"6053185217e67ff70ea80bd00a9a2f79baf4e425","subject":"sfx node disabled","message":"sfx node disabled\n","repos":"AlexHolly\/captain-holetooth,shelltitan\/captain-holetooth,AlexHolly\/captain-holetooth,shelltitan\/captain-holetooth","old_file":"src\/screens\/hud\/hud.gd","new_file":"src\/screens\/hud\/hud.gd","new_contents":"extends CanvasLayer\n\nexport (NodePath) var collected_text #= get_node(\"hudframe\/items_label\/score_display\")\nexport (NodePath) var score_text #final_score_text = get_node(\"hudframe\/finalscore_label\/final_scoredisplay\")\nexport (NodePath) var highscore_text #= get_node(\"hudframe\/highscore_label\/highscore_display\")\nexport (NodePath) var sound_off_button #= get_node(\"hudframe\/sound_off\")\n\nonready var animations = get_node(\"animations\")\n\nfunc _on_met_yan():\n#\tget_node(\"sfx\").play(\"card_unlock\")\n\tanimations.play(\"yan_unlock_anim\")\n\nfunc _ready():\n\tvar yan = get_parent().find_node(\"Yan\")\n\tprint (yan.get_name())\n\tif yan:\n\t\tprint(\"Yan is present\")\n\t\tyan.connect(\"met_yan\", self,\"_on_met_yan\")\n\t\tanimations.play(\"yan_unlock_anim\")\n\t\tprint(\"working\")\n\t\n\tupdate_scores()\n\tgame.connect(\"scores_changed\", self, \"update_scores\")\n\tupdate_sound_hud()\n\n\n# Update scores\nfunc update_scores():\n\tget_node(collected_text).set_text(str(game.items_collected))\n\tget_node(score_text).set_text(str(game.score))\n\tget_node(highscore_text).set_text(str(game.high_score))\n\nfunc _on_go_to_menu_pressed():\n\ttransition.fade_to(\"res:\/\/src\/screens\/menu\/menu.tscn\")\n\n\n# Toggles music on\/off while keeping the stored volume that may have been set elsewhere\nfunc _on_sound_off_pressed():\n\t# Turns off music completely, or returns it back to normal\n\tif(global.music.enabled):\n\t\tAudioServer.set_stream_global_volume_scale(0)\n\telse:\n\t\tAudioServer.set_stream_global_volume_scale(global.music.volume)\n\t\n\t# Toggle bool\n\tglobal.music.enabled = !global.music.enabled\n\t\n\t# Update sound HUD\n\tupdate_sound_hud()\n\n\n# Updates sound HUD\nfunc update_sound_hud():\n\tif(global.music.enabled):\n\t\tget_node(sound_off_button).set_pressed(true) # res:\/\/src\/screens\/hud\/sound_on.png\n\telse:\n\t\tget_node(sound_off_button).set_pressed(false) # res:\/\/src\/screens\/hud\/sound_off.png","old_contents":"extends CanvasLayer\n\nexport (NodePath) var collected_text #= get_node(\"hudframe\/items_label\/score_display\")\nexport (NodePath) var score_text #final_score_text = get_node(\"hudframe\/finalscore_label\/final_scoredisplay\")\nexport (NodePath) var highscore_text #= get_node(\"hudframe\/highscore_label\/highscore_display\")\nexport (NodePath) var sound_off_button #= get_node(\"hudframe\/sound_off\")\n\nonready var animations = get_node(\"animations\")\n\nfunc _on_met_yan():\n\tget_node(\"sfx\").play(\"card_unlock\")\n\tanimations.play(\"yan_unlock_anim\")\n\nfunc _ready():\n\tvar yan = get_parent().find_node(\"Yan\")\n\tprint (yan.get_name())\n\tif yan:\n\t\tprint(\"Yan is present\")\n\t\tyan.connect(\"met_yan\", self,\"_on_met_yan\")\n\t\tanimations.play(\"yan_unlock_anim\")\n\t\tprint(\"working\")\n\t\n\tupdate_scores()\n\tgame.connect(\"scores_changed\", self, \"update_scores\")\n\tupdate_sound_hud()\n\n\n# Update scores\nfunc update_scores():\n\tget_node(collected_text).set_text(str(game.items_collected))\n\tget_node(score_text).set_text(str(game.score))\n\tget_node(highscore_text).set_text(str(game.high_score))\n\nfunc _on_go_to_menu_pressed():\n\ttransition.fade_to(\"res:\/\/src\/screens\/menu\/menu.tscn\")\n\n\n# Toggles music on\/off while keeping the stored volume that may have been set elsewhere\nfunc _on_sound_off_pressed():\n\t# Turns off music completely, or returns it back to normal\n\tif(global.music.enabled):\n\t\tAudioServer.set_stream_global_volume_scale(0)\n\telse:\n\t\tAudioServer.set_stream_global_volume_scale(global.music.volume)\n\t\n\t# Toggle bool\n\tglobal.music.enabled = !global.music.enabled\n\t\n\t# Update sound HUD\n\tupdate_sound_hud()\n\n\n# Updates sound HUD\nfunc update_sound_hud():\n\tif(global.music.enabled):\n\t\tget_node(sound_off_button).set_pressed(true) # res:\/\/src\/screens\/hud\/sound_on.png\n\telse:\n\t\tget_node(sound_off_button).set_pressed(false) # res:\/\/src\/screens\/hud\/sound_off.png","returncode":0,"stderr":"","license":"apache-2.0","lang":"GDScript"} {"commit":"de1087d9cea74db10b86e8a10e3293be5d9f2f17","subject":"Mouse control mode (semi broken)","message":"Mouse control mode (semi broken)\n\n","repos":"BK-TN\/IncendiumGame","old_file":"incendium\/scripts\/Player.gd","new_file":"incendium\/scripts\/Player.gd","new_contents":"# PLAYER class\n# Moves n shoots\n\nextends Node2D\n\nconst SPEED = 420 \/ 1.42\nconst ACCEL = 3000\n\nexport var polar_controls = false\nvar use_mouse = false\nvar angle = 0\nvar dist = 200\nvar shield_cooldown = 0\nvar fire_timer = 0\nvar velocity = Vector2(0,0)\n\nconst MAX_HEALTH = 100\nvar health = MAX_HEALTH\n\nvar inv_time = 0\n\nvar col = Color(1,1,1)\n\nfunc _ready():\n\tset_process(true)\n\tset_process_input(true)\n\t\nfunc _input(event):\n\t# Input method switching\n\tif event.type == InputEvent.KEY:\n\t\tif event.scancode == KEY_M && event.pressed == true:\n\t\t\tuse_mouse = !use_mouse\n\nfunc _process(delta):\n\t# Input gathering\n\tvar input_vec = Vector2(0,0)\n\t# Keyboard\n\tif !use_mouse:\n\t\tif Input.is_key_pressed(KEY_LEFT):\n\t\t\tinput_vec += Vector2(-1,0)\n\t\tif Input.is_key_pressed(KEY_RIGHT):\n\t\t\tinput_vec += Vector2(1,0)\n\t\tif Input.is_key_pressed(KEY_UP):\n\t\t\tinput_vec += Vector2(0,-1)\n\t\tif Input.is_key_pressed(KEY_DOWN):\n\t\t\tinput_vec += Vector2(0,1)\n\t# Mouse\n\telse:\n\t\tvar mouse_pos = get_viewport().get_mouse_pos()\n\t\t\n\t\tvar relative_pos = mouse_pos - get_global_pos()\n\t\t\n\t\tif relative_pos.length() > velocity.length():\n\t\t\tinput_vec = relative_pos.normalized()\n\t\n\t# Normal movement\n\tif !polar_controls:\n\t\tvar target_velocity = input_vec.normalized() * SPEED\n\t\t\n\t\tvar towards_target = target_velocity - velocity\n\t\tvar dist_to_target = towards_target.length()\n\t\ttowards_target = towards_target.normalized()\n\t\ttowards_target *= min(ACCEL * delta, dist_to_target)\n\t\t\n\t\tvelocity += towards_target\n\t\ttranslate(velocity * delta)\n\t\n\t#TODO: Polar movement\n\t\t\t\t#if polar_controls:\n\t\t\t\t#angle += (delta \/ dist) * SPEED\n\t\t\t\t\n\t\t\t\t#if polar_controls:\n\t\t\t\t#angle -= (delta \/ dist) * SPEED\n\t\t\t\t\n\t\t\t\t#if polar_controls:\n\t\t\t\t#dist -= delta * SPEED\n\t\t\t\t#if dist < 0.1: dist = 0.1\n\t\t\t\t\n\t\t\t\t#if polar_controls:\n\t\t\t\t#dist += delta * SPEED \n\t\t\t\t\n\t\t\t\t#if polar_controls:\n\t\t\t\t#\tset_pos(center + Vector2(cos(angle),sin(angle)) * dist)\n\t\n\tvar center = Vector2(720\/2,720\/2)\n\tvar towards_center = (center - get_pos()).normalized()\n\t\n\t# Rotate towards center\n\tset_rot(atan2(towards_center.x,towards_center.y) - PI\/2)\n\t\n\t# Limit position to circle\n\tif center.distance_to(get_pos()) > 720\/2:\n\t\tset_pos((get_pos() - center).normalized() * 720\/2 + center)\n\t\n\tcol = col.linear_interpolate(Color(1,1,1),delta * 10)\n\tget_node(\"RegularPolygon\/Polygon2D\").set_color(col)\n\t\n\t# Timers\n\tif inv_time > 0:\n\t\tinv_time -= delta\n\t\n\tif fire_timer > 0:\n\t\tfire_timer -= delta\n\t\t\n\tif shield_cooldown > 0:\n\t\tshield_cooldown -= delta\n\t\n\t# Shooting\n\tvar shooting = false\n\tif use_mouse:\n\t\tshooting = Input.is_mouse_button_pressed(BUTTON_LEFT)\n\telse:\n\t\tshooting = Input.is_key_pressed(KEY_SPACE) || Input.is_key_pressed(KEY_F)\n\t\t\n\tif shooting && fire_timer <= 0:\n\t\tvar bullet = preload(\"res:\/\/objects\/Bullet.tscn\").instance()\n\t\tbullet.set_pos(get_pos())\n\t\tget_tree().get_root().get_node(\"Game\/SFX\").set_default_pitch_scale(rand_range(0.9,1.1))\n\t\tget_tree().get_root().get_node(\"Game\/SFX\").play(\"Laser_Shoot14\")\n\t\t#bullet.get_node(\"RegularPolygon\").size = 1\n\t\tbullet.damage = 1\n\t\t\n\t\tvar dir = atan2(towards_center.y,towards_center.x)\n\t\tvar len = 600\n\t\t\n\t\tvar spread = 0.05\n\t\tvar rot = rand_range(-spread,spread)\n\t\tvar final = dir + rot\n\t\t\n\t\tbullet.velocity = Vector2(cos(final),sin(final)) * len\n\t\tget_tree().get_root().add_child(bullet,false)\n\t\tfire_timer = 0.05\n\t\n\t# Shield\n\tvar shielding = false\n\tif use_mouse:\n\t\tshielding = Input.is_mouse_button_pressed(BUTTON_RIGHT)\n\telse:\n\t\tshielding = Input.is_key_pressed(KEY_D)\n\n\tif shielding && shield_cooldown <= 0:\n\t\tvar shield = preload(\"res:\/\/objects\/PlayerShield.tscn\").instance()\n\t\tshield.node_to_follow = get_path()\n\t\tget_tree().get_root().add_child(shield)\n\t\tshield.set_global_pos(get_global_pos())\n\t\tshield_cooldown = 6\n\nfunc _on_RegularPolygon_area_enter( area ):\n\tif area.get_groups().has(\"damage_player\"):\n\t\tvar bullet = area.get_parent()\n\t\tbullet.queue_free()\n\t\tvar dmgtotake = bullet.damage * 2\n\t\tlose_health(dmgtotake)\n\tif area.get_groups().has(\"damage_player_solid\") && area.get_parent().enabled:\n\t\tlose_health(100)\n\nfunc lose_health(hp):\n\tif inv_time <= 0:\n\t\thealth -= hp\n\t\tinv_time = 1\n\t\tcol = Color(1,0,0)\n\t\tget_parent().score_mult = 1\n\t\tget_parent().score_mult_timer = 0\n\t\tif health <= 0:\n\t\t\tfor i in range(0,8):\n\t\t\t\tvar explosion_instance = preload(\"res:\/\/objects\/Explosion.tscn\").instance()\n\t\t\t\texplosion_instance.get_node(\"RegularPolygon\").size = get_node(\"RegularPolygon\").size\n\t\t\t\texplosion_instance.get_node(\"RegularPolygon\/Polygon2D\").set_color(get_node(\"RegularPolygon\/Polygon2D\").get_color())\n\t\t\t\t# explosion_instance.velocity = Vector2(0,0)\n\t\t\t\tget_tree().get_root().add_child(explosion_instance)\n\t\t\t\texplosion_instance.set_global_pos(get_global_pos())\n\t\t\tOS.set_time_scale(0.02)\n\t\t\tqueue_free()\n\nfunc _on_RegularPolygon_area_exit( area ):\n\tpass\n","old_contents":"# PLAYER class\n# Moves n shoots\n\nextends Node2D\n\nconst SPEED = 420 \/ 1.42\nconst ACCEL = 3000\n\nexport var polar_controls = false\nvar angle = 0\nvar dist = 200\nvar shield_cooldown = 0\nvar fire_timer = 0\nvar velocity = Vector2(0,0)\n\nconst MAX_HEALTH = 100\nvar health = MAX_HEALTH\n\nvar inv_time = 0\n\nvar col = Color(1,1,1)\n\nfunc _ready():\n\tset_process(true)\n\nfunc _process(delta):\n\tvar target_velocity = Vector2(0,0)\n\tif Input.is_key_pressed(KEY_LEFT):\n\t\tif polar_controls:\n\t\t\tangle += (delta \/ dist) * SPEED\n\t\telse:\n\t\t\ttarget_velocity += Vector2(-1,0)\n\tif Input.is_key_pressed(KEY_RIGHT):\n\t\tif polar_controls:\n\t\t\tangle -= (delta \/ dist) * SPEED\n\t\telse:\n\t\t\ttarget_velocity += Vector2(1,0)\n\tif Input.is_key_pressed(KEY_UP):\n\t\tif polar_controls:\n\t\t\tdist -= delta * SPEED\n\t\t\tif dist < 0.1: dist = 0.1\n\t\telse:\n\t\t\ttarget_velocity += Vector2(0,-1)\n\tif Input.is_key_pressed(KEY_DOWN):\n\t\tif polar_controls:\n\t\t\tdist += delta * SPEED \n\t\telse:\n\t\t\ttarget_velocity += Vector2(0,1)\n\t\t\n\ttarget_velocity = target_velocity.normalized() * SPEED\n\t\n\tvar towards_target = target_velocity - velocity\n\tvar dist_to_target = towards_target.length()\n\ttowards_target = towards_target.normalized()\n\ttowards_target *= min(ACCEL * delta, dist_to_target)\n\t\n\tvelocity += towards_target\n\ttranslate(velocity * delta)\n\t\n\tvar center = Vector2(720\/2,720\/2)\n\t\n\tif polar_controls:\n\t\tset_pos(center + Vector2(cos(angle),sin(angle)) * dist)\n\n\tvar towards_center = (center - get_pos()).normalized()\n\t\n\tcol = col.linear_interpolate(Color(1,1,1),delta * 10)\n\tget_node(\"RegularPolygon\/Polygon2D\").set_color(col)\n\t\n\tif inv_time > 0:\n\t\tinv_time -= delta\n\t\n\tif fire_timer > 0:\n\t\tfire_timer -= delta\n\t\n\tif (Input.is_key_pressed(KEY_SPACE) or Input.is_key_pressed(KEY_F)) and fire_timer <= 0:\n\t\tvar bullet = preload(\"res:\/\/objects\/Bullet.tscn\").instance()\n\t\tbullet.set_pos(get_pos())\n\t\tget_tree().get_root().get_node(\"Game\/SFX\").set_default_pitch_scale(rand_range(0.9,1.1))\n\t\tget_tree().get_root().get_node(\"Game\/SFX\").play(\"Laser_Shoot14\")\n\t\t#bullet.get_node(\"RegularPolygon\").size = 1\n\t\tbullet.damage = 1\n\t\t\n\t\tvar dir = atan2(towards_center.y,towards_center.x)\n\t\tvar len = 600\n\t\t\n\t\tvar spread = 0.05\n\t\tvar rot = rand_range(-spread,spread)\n\t\tvar final = dir + rot\n\t\t\n\t\tbullet.velocity = Vector2(cos(final),sin(final)) * len\n\t\tget_tree().get_root().add_child(bullet,false)\n\t\tfire_timer = 0.05\n\t\t\n\tif shield_cooldown > 0:\n\t\tshield_cooldown -= delta\n\t\n\tif Input.is_key_pressed(KEY_D) and shield_cooldown <= 0:\n\t\tvar shield = preload(\"res:\/\/objects\/PlayerShield.tscn\").instance()\n\t\tshield.node_to_follow = get_path()\n\t\tget_tree().get_root().add_child(shield)\n\t\tshield.set_global_pos(get_global_pos())\n\t\tshield_cooldown = 6\n\n\tset_rot(atan2(towards_center.x,towards_center.y) - PI\/2)\n\t\n\t# Limit position to circle\n\tif center.distance_to(get_pos()) > 720\/2:\n\t\tset_pos((get_pos() - center).normalized() * 720\/2 + center)\n\nfunc _on_RegularPolygon_area_enter( area ):\n\tif area.get_groups().has(\"damage_player\"):\n\t\tvar bullet = area.get_parent()\n\t\tbullet.queue_free()\n\t\tvar dmgtotake = bullet.damage * 2\n\t\tlose_health(dmgtotake)\n\tif area.get_groups().has(\"damage_player_solid\") && area.get_parent().enabled:\n\t\tlose_health(100)\n\nfunc lose_health(hp):\n\tif inv_time <= 0:\n\t\thealth -= hp\n\t\tinv_time = 1\n\t\tcol = Color(1,0,0)\n\t\tget_parent().score_mult = 1\n\t\tget_parent().score_mult_timer = 0\n\t\tif health <= 0:\n\t\t\tfor i in range(0,8):\n\t\t\t\tvar explosion_instance = preload(\"res:\/\/objects\/Explosion.tscn\").instance()\n\t\t\t\texplosion_instance.get_node(\"RegularPolygon\").size = get_node(\"RegularPolygon\").size\n\t\t\t\texplosion_instance.get_node(\"RegularPolygon\/Polygon2D\").set_color(get_node(\"RegularPolygon\/Polygon2D\").get_color())\n\t\t\t\t# explosion_instance.velocity = Vector2(0,0)\n\t\t\t\tget_tree().get_root().add_child(explosion_instance)\n\t\t\t\texplosion_instance.set_global_pos(get_global_pos())\n\t\t\tOS.set_time_scale(0.02)\n\t\t\tqueue_free()\n\nfunc _on_RegularPolygon_area_exit( area ):\n\tpass\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"2fbb64ceefa350bca654efe419d0fabdafb301ce","subject":"Fix textures locations for rewards","message":"Fix textures locations for rewards\n","repos":"AlexHolly\/captain-holetooth,shelltitan\/captain-holetooth,AlexHolly\/captain-holetooth,shelltitan\/captain-holetooth","old_file":"src\/objects\/rewards\/random_coin.gd","new_file":"src\/objects\/rewards\/random_coin.gd","new_contents":"\nextends Node2D\n\nsignal taken\n\nonready var anim = get_node(\"anim\")\n\nfunc _ready():\n\t# randomize items texture and animation\n\tvar sprite = get_node(\"sprite\")\n\tvar tex_num = randi()%11+1\n\tvar seek = randi()%4+1\n\tvar tex_name = (\"res:\/\/src\/objects\/rewards\/\" + str(tex_num) + \".tex\")\n\tvar tex = load(tex_name)\n\tanim.seek(seek, false)\n\tsprite.set_texture(tex)\n\nfunc take():\n\tget_node(\"sfx\").play(\"chime\")\n\tanim.play(\"taken\")\n\tyield(anim, \"finished\")\n\temit_signal(\"taken\")\n\tqueue_free()","old_contents":"\nextends Node2D\n\nsignal taken\n\nonready var anim = get_node(\"anim\")\n\nfunc _ready():\n\t# randomize items texture and animation\n\tvar sprite = get_node(\"sprite\")\n\tvar tex_num = randi()%11+1\n\tvar seek = randi()%4+1\n\tvar tex_name = (\"res:\/\/res\/objects\/rewards\/\" + str(tex_num) + \".tex\")\n\tvar tex = load(tex_name)\n\tanim.seek(seek, false)\n\tsprite.set_texture(tex)\n\nfunc take():\n\tget_node(\"sfx\").play(\"chime\")\n\tanim.play(\"taken\")\n\tyield(anim, \"finished\")\n\temit_signal(\"taken\")\n\tqueue_free()","returncode":0,"stderr":"","license":"apache-2.0","lang":"GDScript"} {"commit":"f180137bfb6609738e3d2f1a90d7ab46eaf6cb15","subject":"made a change","message":"made a change\n\ndoot doot\n","repos":"PurdueIndieGameDev\/SpaceProject","old_file":"game\/script\/main.gd","new_file":"game\/script\/main.gd","new_contents":"extends Node\n\nonready var ui = get_node(\"ui\")\nonready var game = get_node(\"ui\/Control\/VBoxContainer\/HBoxContainer\/Control\/Viewport\/game\")\n\n# prints cool to the console\nfunc cool():\n\tprint('cool')\n\n# does some rad thing\nfunc rad():\n\tprint(\"wowzer!\")\n\n\n# All temp stuff for console\n\nfunc _ready():\n\tset_process_input(true)\n\nfunc _input(event):\n\tif event.is_action_pressed(\"console\"):\n\t\tget_node(\"WindowDialog\").popup()\n\t\tget_node(\"WindowDialog\/VBoxContainer\/LineEdit\").grab_focus()\n\n\n# stupid shit for console (hit ` [tilde])\nfunc _on_LineEdit_text_entered( text ):\n\tvar console = get_node(\"WindowDialog\/VBoxContainer\/Label\")\n\tvar ret = \"Error\"\n\tvar a = text.split('.')\n\tif a != null and a.size() > 1:\n\t\tvar target = find_node(a[0])\n\t\tif target != null:\n\t\t\tvar b = a[1].split('(')\n\t\t\tif b != null and b.size() > 0:\n\t\t\t\tvar function = b[0]\n\t\t\t\tvar s = text.find('(')\n\t\t\t\tif s != -1:\n\t\t\t\t\tvar args = text.right(s + 1)\n\t\t\t\t\targs = args.split(')')\n\t\t\t\t\tif args.size() > 0:\n\t\t\t\t\t\targs = args[0].split(',')\n\t\t\t\t\t\tif args.size() == 0:\n\t\t\t\t\t\t\tif target.has_method(function):\n\t\t\t\t\t\t\t\tret = target.call(function)\n\t\t\t\t\t\telif args.size() == 1:\n\t\t\t\t\t\t\tif target.has_method(function):\n\t\t\t\t\t\t\t\tret = target.call(function, args[0])\n\t\t\t\t\t\telif args.size() == 2:\n\t\t\t\t\t\t\tif target.has_method(function):\n\t\t\t\t\t\t\t\tret = target.call(function, args[0], args[1])\n\t\t\t\t\t\telif args.size() == 3:\n\t\t\t\t\t\t\tif target.has_method(function):\n\t\t\t\t\t\t\t\tret = target.call(function, args[0], args[1], args[2])\n\t\t\t\t\t\telif args.size() == 4:\n\t\t\t\t\t\t\tif target.has_method(function):\n\t\t\t\t\t\t\t\tret = target.call(function, args[0], args[1], args[2], args[4])\n\tif ret == null:\n\t\tret = \"null\"\n\tconsole.set_text(ret + '\\n'+ console.get_text())\n\tget_node(\"WindowDialog\/VBoxContainer\/LineEdit\").clear()\nfunc _on_LineEdit_text_changed( text ):\n\tif text == '`':\n\t\tget_node(\"WindowDialog\/VBoxContainer\/LineEdit\").clear()\n","old_contents":"extends Node\n\nonready var ui = get_node(\"ui\")\nonready var game = get_node(\"ui\/Control\/VBoxContainer\/HBoxContainer\/Control\/Viewport\/game\")\n\n# prints cool to the console\nfunc cool():\n\tprint('cool')\n\n\n\n\n# All temp stuff for console\n\nfunc _ready():\n\tset_process_input(true)\n\nfunc _input(event):\n\tif event.is_action_pressed(\"console\"):\n\t\tget_node(\"WindowDialog\").popup()\n\t\tget_node(\"WindowDialog\/VBoxContainer\/LineEdit\").grab_focus()\n\n\n# stupid shit for console (hit ` [tilde])\nfunc _on_LineEdit_text_entered( text ):\n\tvar console = get_node(\"WindowDialog\/VBoxContainer\/Label\")\n\tvar ret = \"Error\"\n\tvar a = text.split('.')\n\tif a != null and a.size() > 1:\n\t\tvar target = find_node(a[0])\n\t\tif target != null:\n\t\t\tvar b = a[1].split('(')\n\t\t\tif b != null and b.size() > 0:\n\t\t\t\tvar function = b[0]\n\t\t\t\tvar s = text.find('(')\n\t\t\t\tif s != -1:\n\t\t\t\t\tvar args = text.right(s + 1)\n\t\t\t\t\targs = args.split(')')\n\t\t\t\t\tif args.size() > 0:\n\t\t\t\t\t\targs = args[0].split(',')\n\t\t\t\t\t\tif args.size() == 0:\n\t\t\t\t\t\t\tif target.has_method(function):\n\t\t\t\t\t\t\t\tret = target.call(function)\n\t\t\t\t\t\telif args.size() == 1:\n\t\t\t\t\t\t\tif target.has_method(function):\n\t\t\t\t\t\t\t\tret = target.call(function, args[0])\n\t\t\t\t\t\telif args.size() == 2:\n\t\t\t\t\t\t\tif target.has_method(function):\n\t\t\t\t\t\t\t\tret = target.call(function, args[0], args[1])\n\t\t\t\t\t\telif args.size() == 3:\n\t\t\t\t\t\t\tif target.has_method(function):\n\t\t\t\t\t\t\t\tret = target.call(function, args[0], args[1], args[2])\n\t\t\t\t\t\telif args.size() == 4:\n\t\t\t\t\t\t\tif target.has_method(function):\n\t\t\t\t\t\t\t\tret = target.call(function, args[0], args[1], args[2], args[4])\n\tif ret == null:\n\t\tret = \"null\"\n\tconsole.set_text(ret + '\\n'+ console.get_text())\n\tget_node(\"WindowDialog\/VBoxContainer\/LineEdit\").clear()\nfunc _on_LineEdit_text_changed( text ):\n\tif text == '`':\n\t\tget_node(\"WindowDialog\/VBoxContainer\/LineEdit\").clear()\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"321f32528e01035736c2a2e39638b231a2d0deb9","subject":"made nameToNodeName a static function","message":"made nameToNodeName a static function\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Blocks\/AbstractBlock.gd","new_file":"src\/scripts\/Blocks\/AbstractBlock.gd","new_contents":"extends RigidBody\n\nvar name\nvar pairName\nvar selected = false\nvar blockPos\nvar blockLayer\nconst far_away_corner = Vector3(80, 80, 80)\n\nstatic func nameToNodeName(n):\n\treturn \"block\" + str(n)\n\nfunc setName(n):\n\tname = nameToNodeName(n)\n\tset_name(nameToNodeName(n))\n\treturn self\n\nfunc setPairName(n):\n\tpairName = nameToNodeName(n)\n\treturn self\n\nfunc setBlockLayer(n):\n\tblockLayer = n\n\treturn self\n\nfunc getBlockLayer():\n\treturn blockLayer\n\nfunc setSelected(sel):\n\tselected = sel\n\treturn self\n\n# catch clicks\/taps\nfunc _input_event( camera, ev, click_pos, click_normal, shape_idx ):\n\tif ((ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT)\n\tor (ev.type==InputEvent.SCREEN_TOUCH)):\n\t\tif (get_parent().get_parent().active and ev.is_pressed()):\n\t\t\tactivate(ev, click_pos, click_normal)\n\n\t\t\t#now check if that was the second block we picked. If it was, we want to\n\t\t\t#unselect the blocks again\n\t\t\tvar gridView = get_parent().get_parent()\n\t\t\tif (gridView.offClick):\n\t\t\t\tprint(\"omg\")\n\t\t\t\tgridView.offClick = false\n\t\t\t\tgridView.addSelected(name)\n\t\t\t\tgridView.clearSelection()\n\t\t\telse:\n\t\t\t\tprint(\"lulz\")\n\t\t\t\tgridView.offClick = true;\n\t\t\t\tgridView.addSelected(name)\n\n# returns this block's pairNode or null\nfunc pairActivate(ev, click_pos, click_normal):\n\tselected = true\n\n\t# is my pair Nil?\n\tif pairName == null or get_parent() == null or not get_parent().has_node(str(pairName)):\n\t\tscaleTweenNode(0.9, 0.2, Tween.TRANS_EXPO).start()\n\t\treturn null\n\n\t# get my pair node\n\tvar pairNode = get_parent().get_node(pairName)\n\n\t# enlarge if the other guy's unselected\n\tif not pairNode.selected:\n\t\tscaleTweenNode(1.1, 0.2, Tween.TRANS_EXPO).start()\n\treturn pairNode\n\n\n# returns a tween node that uniformly changes the object's scale\n# call start() on the returned object\nfunc scaleTweenNode(scale, time=1, transType=Tween.TRANS_BOUNCE):\n\tvar tweenNode = newTweenNode()\n\ttweenNode.interpolate_method( self, \"set_scale\", \\\n\t\tself.get_scale(), Vector3(scale, scale, scale), \\\n\t\ttime, transType, Tween.EASE_OUT )\n\n\treturn tweenNode\n\n# adds a tween transition node to the tree\nfunc newTweenNode():\n\tvar tween = Tween.new()\n\tadd_child(tween)\n\treturn tween\n\nfunc remove_with_pop(node, key):\n\tget_parent().samplePlayer.play(\"deraj_pop_sound\")\n\tget_parent().remove_block(self)\n\nfunc _ready():\n\tset_ray_pickable(true)\n\t#var img;\n\t#img.load(\"res:\/\/textures\/Block_\" + textureName + \".png\")\n","old_contents":"extends RigidBody\n\nvar name\nvar pairName\nvar selected = false\nvar blockPos\nvar blockLayer\nconst far_away_corner = Vector3(80, 80, 80)\n\nfunc nameToNodeName(n):\n\treturn \"block\" + str(n)\n\nfunc setName(n):\n\tname = nameToNodeName(n)\n\tset_name(nameToNodeName(n))\n\treturn self\n\nfunc setPairName(n):\n\tpairName = nameToNodeName(n)\n\treturn self\n\nfunc setBlockLayer(n):\n\tblockLayer = n\n\treturn self\n\nfunc getBlockLayer():\n\treturn blockLayer\n\nfunc setSelected(sel):\n\tselected = sel\n\treturn self\n\n# catch clicks\/taps\nfunc _input_event( camera, ev, click_pos, click_normal, shape_idx ):\n\tif ((ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT)\n\tor (ev.type==InputEvent.SCREEN_TOUCH)):\n\t\tif (get_parent().get_parent().active and ev.is_pressed()):\n\t\t\tactivate(ev, click_pos, click_normal)\n\n\t\t\t#now check if that was the second block we picked. If it was, we want to\n\t\t\t#unselect the blocks again\n\t\t\tvar gridView = get_parent().get_parent()\n\t\t\tif (gridView.offClick):\n\t\t\t\tprint(\"omg\")\n\t\t\t\tgridView.offClick = false\n\t\t\t\tgridView.addSelected(name)\n\t\t\t\tgridView.clearSelection()\n\t\t\telse:\n\t\t\t\tprint(\"lulz\")\n\t\t\t\tgridView.offClick = true;\n\t\t\t\tgridView.addSelected(name)\n\n# returns this block's pairNode or null\nfunc pairActivate(ev, click_pos, click_normal):\n\tselected = true\n\n\t# is my pair Nil?\n\tif pairName == null or get_parent() == null or not get_parent().has_node(str(pairName)):\n\t\tscaleTweenNode(0.9, 0.2, Tween.TRANS_EXPO).start()\n\t\treturn null\n\n\t# get my pair node\n\tvar pairNode = get_parent().get_node(pairName)\n\n\t# enlarge if the other guy's unselected\n\tif not pairNode.selected:\n\t\tscaleTweenNode(1.1, 0.2, Tween.TRANS_EXPO).start()\n\treturn pairNode\n\n\n# returns a tween node that uniformly changes the object's scale\n# call start() on the returned object\nfunc scaleTweenNode(scale, time=1, transType=Tween.TRANS_BOUNCE):\n\tvar tweenNode = newTweenNode()\n\ttweenNode.interpolate_method( self, \"set_scale\", \\\n\t\tself.get_scale(), Vector3(scale, scale, scale), \\\n\t\ttime, transType, Tween.EASE_OUT )\n\n\treturn tweenNode\n\n# adds a tween transition node to the tree\nfunc newTweenNode():\n\tvar tween = Tween.new()\n\tadd_child(tween)\n\treturn tween\n\nfunc remove_with_pop(node, key):\n\tget_parent().samplePlayer.play(\"deraj_pop_sound\")\n\tget_parent().remove_block(self)\n\nfunc _ready():\n\tset_ray_pickable(true)\n\t#var img;\n\t#img.load(\"res:\/\/textures\/Block_\" + textureName + \".png\")\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"ee1e8ba917fe9fe624a53aec5c2bf2e0f3b922f8","subject":"Switch the random functions to be static.","message":"Switch the random functions to be static.\n","repos":"groboclown\/godot-bootstrap","old_file":"components\/rand_persist\/rand_persist.gd","new_file":"components\/rand_persist\/rand_persist.gd","new_contents":"#\r\n#\r\n#\r\n\r\nstatic func rand_int_range(from, to, storage, key):\r\n\tvar delta = to - from\r\n\treturn from + (rand_int(storage, key) % delta)\r\n\r\nstatic func rand_float_range(from, to, storage, key):\r\n\tvar delta = to - from\r\n\treturn from + (rand_float(storage, key) * delta)\r\n\r\nstatic func rand_float(storage, key):\r\n\t# Random float value from 0 to 1\r\n\treturn min(float(rand_int(storage, key)) \/ 2147483647.0, 1.0)\r\n\r\nstatic func shuffle(list, storage, key):\r\n\t# Randomly shuffle the items within the list,\r\n\t# and update the storage seed. Returns the passed-in list.\r\n\tvar i\r\n\tfor i in range(0, list.size() - 1):\r\n\t\tlist[i] = rand_int_range(i + 1, list.size(), storage, key)\r\n\treturn list\r\n\r\nstatic func rand_int(storage, key):\r\n\t# Random number from 0 to 2147483647\r\n\tvar seed_val = null\r\n\tif storage != null and storage.has(key):\r\n\t\tseed_val = storage[key]\r\n\telse:\r\n\t\tseed_val = randf()\r\n\tvar rv = rand_seed(seed_val)\r\n\tif storage != null:\r\n\t\tstorage[key] = rv[1]\r\n\treturn rv[0]\r\n","old_contents":"#\r\n#\r\n#\r\n\r\nfunc rand_int_range(from, to, storage, key):\r\n\tvar delta = to - from\r\n\treturn from + (rand_int(storage, key) % delta)\r\n\r\nfunc rand_float_range(from, to, storage, key):\r\n\tvar delta = to - from\r\n\treturn from + (rand_float(storage, key) * delta)\r\n\r\nfunc rand_float(storage, key):\r\n\t# Random float value from 0 to 1\r\n\treturn min(float(rand_int(storage, key)) \/ 2147483647.0, 1.0)\r\n\r\nfunc shuffle(list, storage, key):\r\n\t# Randomly shuffle the items within the list,\r\n\t# and update the storage seed. Returns the passed-in list.\r\n\tvar i\r\n\tfor i in range(0, list.size() - 1):\r\n\t\tlist[i] = rand_int_range(i + 1, list.size(), storage, key)\r\n\treturn list\r\n\r\nfunc rand_int(storage, key):\r\n\t# Random number from 0 to 2147483647\r\n\tvar seed_val = null\r\n\tif storage != null and storage.has(key):\r\n\t\tseed_val = storage[key]\r\n\telse:\r\n\t\tseed_val = randf()\r\n\tvar rv = rand_seed(seed_val)\r\n\tif storage != null:\r\n\t\tstorage[key] = rv[1]\r\n\treturn rv[0]\r\n","returncode":0,"stderr":"","license":"cc0-1.0","lang":"GDScript"} {"commit":"249b3fe076c526cafbe3734effa3292f0e30dcae","subject":"added working Viewport code","message":"added working Viewport code\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Puzzle.gd","new_file":"src\/scripts\/Puzzle.gd","new_contents":"extends Spatial\n\n# proposed script manager:\n# var PuzzleManScript = get_node(\"Globals\").get(\"PuzzleManScript\")\n\nvar PuzzleManScript = preload( \"res:\/\/scripts\/PuzzleManager.gd\" )\nvar PuzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar puzzleMan\nvar mainPuzzle = true\n\n# Called for initialization\nfunc _ready():\n\tpuzzleMan = PuzzleManScript.new()\n\tvar puzzle = puzzleMan.generatePuzzle( 2, puzzleMan.DIFF_EASY )\n\n\tprint(\"Generated \", puzzle.blocks.size(), \" blocks.\" )\n\n\t# Place the blocks in the puzzle.\n\tvar gridMan = get_node( \"GridView\/GridMan\" )\n\tgridMan.shape = puzzleMan.shape\n\tgridMan.set_puzzle(puzzle)\n\tfor block in puzzle.blocks:\n\t\t# Create a block node, add it to the tree\n\t\tvar b = block.toNode()\n\t\tgridMan.shape[b.blockPos] = b\n\t\tgridMan.add_block(b)\n\t\tgridMan.get_child(block.name) \\\n\t\t\t.set_translation(block.blockPos * 2 )\n\t\n\tif mainPuzzle:\n\t\tvar p = PuzzleScn.instance()\n\t\tp.mainPuzzle = false\n\t\tp.set_scale(Vector3(0.5, 0.5, 0.5))\n\t\tp.set_translation(Vector3(20, 0, 0))\n\t\t\n\t\tvar v = Viewport.new()\n\t\tv.set_as_render_target(true)\n\t\tv.set_world(p.get_world())\n\t\tv.set_rect(Rect2(0, 0, 100, 100))\n\t\tv.set_physics_object_picking(false)\n\t\tv.add_child(p)\n\t\tadd_child(v)\n\t\t\n\n","old_contents":"extends Spatial\n\n# proposed script manager:\n# var PuzzleManScript = get_node(\"Globals\").get(\"PuzzleManScript\")\n\nvar PuzzleManScript = preload( \"res:\/\/scripts\/PuzzleManager.gd\" )\nvar puzzleMan\n\n# Called for initialization\nfunc _ready():\n\tpuzzleMan = PuzzleManScript.new()\n\tvar puzzle = puzzleMan.generatePuzzle( 2, puzzleMan.DIFF_EASY )\n\n\tprint(\"Generated \", puzzle.blocks.size(), \" blocks.\" )\n\n\t# Place the blocks in the puzzle.\n\tvar gridMan = get_node( \"GridView\/GridMan\" )\n\tgridMan.shape = puzzleMan.shape\n\tgridMan.set_puzzle(puzzle)\n\tfor block in puzzle.blocks:\n\t\t# Create a block node, add it to the tree\n\t\tvar b = block.toNode()\n\t\tgridMan.shape[b.blockPos] = b\n\t\tgridMan.add_block(b)\n\t\tgridMan.get_child(block.name) \\\n\t\t\t.set_translation(block.blockPos * 2 )\n\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"389909ef21af84f8bd45b0aed6dc0f530eeaa174","subject":"default config values","message":"default config values\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/DataManager.gd","new_file":"src\/scripts\/DataManager.gd","new_contents":"# Saves the config settings to a file.\nstatic func saveConfig( config ):\n\tvar file = File.new()\n\tfile.open( \"config.cfg\", File.WRITE )\n\n\tif file.is_open():\n\t\tfile.store_var( config.name )\n\t\tfile.store_var( config.soundvolume )\n\t\tfile.store_var( config.musicvolume )\n\t\tfile.store_var( config.portnumber )\n\t\tfile.close()\n\n# Loads the config settings from a file.\nstatic func loadConfig():\n\tvar file = File.new()\n\tfile.open( \"config.cfg\", File.READ )\n\n\tvar config = {}\n\n\tif file.is_open():\n\t\tconfig.name = file.get_var()\n\t\tconfig.soundvolume = file.get_var()\n\t\tconfig.musicvolume = file.get_var()\n\t\tconfig.portnumber = file.get_var()\n\t\tfile.close()\n\telse:\n\t\tconfig.name = \"Testificate\"\n\t\tconfig.soundvolume = 0.5\n\t\tconfig.musicvolume = 0.5\n\t\tconfig.portnumber = 54321\n\n\treturn config\n\n# Saves a puzzle to the file given.\nstatic func savePuzzle( name, puzzle ):\n\tprint( puzzle.puzzleName )\n\tvar file = File.new()\n\tfile.open( name, File.WRITE )\n\n\tvar di = puzzle.toDict()\n\n\tif file.is_open():\n\t\tfile.store_var( di )\n\t\tfile.close()\n\n# Loads a puzzle for the file given.\nstatic func loadPuzzle( name ):\n\tvar PuzzleManScript = preload( \"res:\/\/scripts\/PuzzleManager.gd\" )\n\n\tvar file = File.new()\n\tvar puzzleMan = PuzzleManScript.new()\n\tvar puzzle = puzzleMan.Puzzle.new()\n\tpuzzle.puzzleMan = puzzleMan\n\tfile.open( name, File.READ )\n\n\tif file.is_open():\n\t\tpuzzle.fromDict( file.get_var() )\n\t\tfile.close()\n\n\treturn puzzle\n","old_contents":"# Saves the config settings to a file.\nstatic func saveConfig( config ):\n\tvar file = File.new()\n\tfile.open( \"config.cfg\", File.WRITE )\n\n\tif file.is_open():\n\t\tfile.store_var( config.name )\n\t\tfile.store_var( config.soundvolume )\n\t\tfile.store_var( config.musicvolume )\n\t\tfile.store_var( config.portnumber )\n\t\tfile.close()\n\n# Loads the config settings from a file.\nstatic func loadConfig():\n\tvar file = File.new()\n\tfile.open( \"config.cfg\", File.READ )\n\n\tvar config = {}\n\n\tif file.is_open():\n\t\tconfig.name = file.get_var()\n\t\tconfig.soundvolume = file.get_var()\n\t\tconfig.musicvolume = file.get_var()\n\t\tconfig.portnumber = file.get_var()\n\t\tfile.close()\n\n\treturn config\n\n# Saves a puzzle to the file given.\nstatic func savePuzzle( name, puzzle ):\n\tprint( puzzle.puzzleName )\n\tvar file = File.new()\n\tfile.open( name, File.WRITE )\n\n\tvar di = puzzle.toDict()\n\n\tif file.is_open():\n\t\tfile.store_var( di )\n\t\tfile.close()\n\n# Loads a puzzle for the file given.\nstatic func loadPuzzle( name ):\n\tvar PuzzleManScript = preload( \"res:\/\/scripts\/PuzzleManager.gd\" )\n\n\tvar file = File.new()\n\tvar puzzleMan = PuzzleManScript.new()\n\tvar puzzle = puzzleMan.Puzzle.new()\n\tpuzzle.puzzleMan = puzzleMan\n\tfile.open( name, File.READ )\n\n\tif file.is_open():\n\t\tpuzzle.fromDict( file.get_var() )\n\t\tfile.close()\n\n\treturn puzzle\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"82c0bfed54fc24ab89bedf6251e4fb00a60af46f","subject":"commented out print statements","message":"commented out print statements\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/PuzzleManager.gd","new_file":"src\/scripts\/PuzzleManager.gd","new_contents":"const DIFF_EASY\t\t= 0\nconst DIFF_MEDIUM\t= 1\nconst DIFF_HARD\t\t= 2\n\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\nconst blockColors = [\"Blue\", \"Orange\", \"Red\", \"Yellow\", \"Purple\", \"Green\"]\nconst wildColors = [\"WildBlue\", \"WildOrange\", \"WildRed\", \"WildYellow\", \"WildPurple\", \"WildGreen\"]\n\n# Preload paired blocks\nconst blockScn = preload( \"res:\/\/blocks\/block.scn\" )\nconst blockScripts = [ preload( \"Blocks\/LaserBlock.gd\" )\n\t\t\t \t , preload( \"Blocks\/LaserBlock.gd\" )\n\t\t\t \t , preload( \"Blocks\/PairedBlock.gd\" )\n\t\t\t \t , preload( \"Blocks\/LaserBlock.gd\" )\n\t\t\t \t ]\nconst aBlock = preload( \"Blocks\/AbstractBlock.gd\" )\n\n# Hash map of all possible positions\nvar shape = {}\n\n# Stores a puzzle in a convenient class.\nclass Puzzle:\n\tvar puzzleName\n\tvar puzzleLayers\n\tvar blocks = []\n\tvar lasers = []\n\t\n\tvar puzzleMan\n\t\n\t# Converts a puzzle to a dictionary.\n\tfunc toDict():\n\t\tvar blockArr = []\n\t\tfor b in range( blocks.size() ):\n\t\t\tblockArr.append( blocks[b].toDict() )\n\t\n\t\tvar di = { pN = puzzleName\n\t\t \t , pL = puzzleLayers\n\t\t\t\t , bL = blockArr\n\t\t\t }\n\t\treturn di\n\t\n\t# Converts a dictionary to a puzzle.\n\tfunc fromDict( di ):\n\t\tpuzzleName = di.pN\n\t\tpuzzleLayers = di.pL\n\t\tfor b in range( di.bL.size() ):\n\t\t\tvar nb = puzzleMan.PickledBlock.new()\n\t\t\tnb.fromDict( di.bL[b] )\n\t\t\tblocks.append( nb )\n\t\treturn\n\t\n\t# Determines if a puzzle is solveable.\n\tfunc solvePuzzle():\n\t\t# Simply use the solvePuzzleSteps function and return the solveable part.\n\t\tvar ps = self.solvePuzzleSteps()\n\t\treturn ps.solveable\n\t\n\t# Determines if a puzzle is solveable and returns the steps needed to solve it.\n\tfunc solvePuzzleSteps():\n\t\tvar puzzleSteps = PuzzleSteps.new()\n\t\tpuzzleSteps.solveable = true\n\t\n\t\t# SOLVER\n\t\n\t\treturn puzzleSteps\n\t\n\t# Holds all of the steps needed to solve a puzzle.\n\tclass PuzzleSteps:\n\t\tvar solveable\n\n# Randomly shuffle an array.\nfunc shuffleArray( arr ):\n\tfor i in range( arr.size() - 1, 1, -1 ):\n\t\tvar swapVal = randi() % (i + 1)\n\t\tvar temp = arr[swapVal]\n\t\tarr[swapVal] = arr[i]\n\t\tarr[i] = temp\n\t\t\n\n# calculate the layer; move into a method so that it can be used elsewhere\nfunc calcBlockLayer( x, y, z ):\n\treturn max( max( abs( x ), abs( y ) ), abs( z ) )\n\n# Determines the block type based on puzzle size and difficulty.\nfunc getBlockType( difficulty, x, y, z ):\n\t# Determine if this is the goal block.\n\tif x == 0 and y == 0 and z == 0:\n\t\treturn BLOCK_GOAL\n\n\t# Determine the layer this block is on.\n\tvar layer = calcBlockLayer( x, y, z )\n\n\t# Determine how many blocks are on the outer part of the layer.\n\tvar layerCount = 0\n\tif abs( x ) == layer:\n\t\tlayerCount += 1\n\tif abs( y ) == layer:\n\t\tlayerCount += 1\n\tif abs( z ) == layer:\n\t\tlayerCount += 1\n\n\t# Determine if this block is a laser.\n\tif difficulty == DIFF_EASY or difficulty == DIFF_MEDIUM:\n\t\tif layerCount == 3:\n\t\t\treturn BLOCK_LASER\n\n\tif difficulty == DIFF_HARD:\n\t\tif abs( x ) == abs( z ) and y == 0:\n\t\t\treturn BLOCK_LASER\n\n\t# Determine if this block is a wild block.\n\tif difficulty == DIFF_EASY:\n\t\tif layerCount == 2:\n\t\t\treturn BLOCK_WILD\n\n\tif difficulty == DIFF_MEDIUM:\n\t\tif layerCount == 2:\n\t\t\tif y == layer || y == -layer:\n\t\t\t\treturn BLOCK_WILD\n\n\tif difficulty == DIFF_HARD:\n\t\tif layerCount == 1:\n\t\t\tif y == 0:\n\t\t\t\treturn BLOCK_WILD\n\n\t# Otherwise it's a normal block.\n\treturn BLOCK_PAIR\n\n# Generates a solveable puzzle.\nfunc generatePuzzle( layers, difficulty ):\n\tvar blockID = 0\n\tvar puzzle = Puzzle.new()\n\tpuzzle.puzzleName = \"RANDOM PUZZLE\"\n\tpuzzle.puzzleLayers = layers\n\t\n\t# Create all possible positions.\n\tvar layeredblocks = []\n\tfor l in range( 0, layers + 1 ):\n\t\tlayeredblocks.append( [] )\n\tfor x in range( -layers, layers + 1 ):\n\t\tfor y in range( -layers, layers + 1 ):\n\t\t\tfor z in range( -layers, layers + 1 ):\n\t\t\t\tlayeredblocks[calcBlockLayer( x, y, z )].append(Vector3(x,y,z))\n\t\t\t\tshape[Vector3(x,y,z)] = null\n\n\t# Generate laser lines.\n\tfor l in range( 1, layers + 1 ):\n\t\tif difficulty == DIFF_EASY:\n\t\t\tfor lx in [ -l, l ]:\n\t\t\t\tfor lz in [ -l, l ]:\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, lx, lz ), Vector3( lx + lx*-1, lx, lz )] )\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, lx, lz ), Vector3( lx, lx + lx*-1, lz )] )\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, lx, lz ), Vector3( lx, lx, lz + lz*-1 )] )\n\t\t\t\t\t\t\n\tfor l in puzzle.lasers:\n\t\tpass # print( l )\n\t\t\n\t# print( \"LASERS \", puzzle.lasers.size() )\n\n\t# Assign block types based on position.\n\tfor l in range( 0, layers + 1 ):\n\t\t# Randomize the pairs.\n\t\tshuffleArray( layeredblocks[l] )\n\t\t# print( \"NUM \", layeredblocks[l].size() )\n\t\tvar prevBlock = null\n\t\tvar even = false\n\t\tvar prevLaser = null\n\t\tvar laserEven = false\n\t\tfor pos in layeredblocks[l]:\n\t\t\tvar x = pos.x\n\t\t\tvar y = pos.y\n\t\t\tvar z = pos.z\n\t\n\t\t\tvar t = getBlockType( difficulty, x, y, z )\n\t\n\t\t\tif t == BLOCK_GOAL:\n\t\t\t\tcontinue\n\t\n\t\t\tvar b = PickledBlock.new()\n\t\t\tb.blockPos = pos\n\t\t\tb.name = blockID\n\t\n\t\t\tblockID += 1\n\t\t\tpuzzle.blocks.append( b )\n\t\n\t\t\tif t == BLOCK_LASER:\n\t\t\t\tb.setBlockClass(BLOCK_LASER)\n\t\t\t\tif laserEven:\n\t\t\t\t\tb.setPairName(prevLaser.name) \\\n\t\t\t\t\t.setLaserExtent(prevLaser.blockPos - b.blockPos)\n\t\n\t\t\t\t\tprevLaser.setPairName(b.name) \\\n\t\t\t\t\t.setLaserExtent(b.blockPos - prevLaser.blockPos)\n\t\t\t\tlaserEven = not laserEven\n\t\t\t\tprevLaser = b\n\t\t\t\tcontinue\n\t\n\t\t\tif t == BLOCK_WILD:\n\t\t\t\tb.setBlockClass(BLOCK_PAIR) \\\n\t\t\t\t\t.setTextureName(wildColors[randi() % wildColors.size()])\n\t\t\t\tcontinue\n\t\n\t\t\tif even:\n\t\t\t\tvar randColor = blockColors[randi() % blockColors.size()]\n\t\t\t\tb.setBlockClass(BLOCK_PAIR) \\\n\t\t\t\t\t.setPairName(prevBlock.name) \\\n\t\t\t\t\t.setTextureName(randColor)\n\t\n\t\t\t\tprevBlock.setBlockClass(BLOCK_PAIR) \\\n\t\t\t\t\t.setPairName(b.name) \\\n\t\t\t\t\t.setTextureName(randColor)\n\t\t\teven = not even\n\t\t\tprevBlock = b\n\n\treturn puzzle\n\nclass PickledBlock:\n\tvar name\n\tvar blockClass = BLOCK_PAIR\n\tvar pairName\n\tvar textureName = \"Red\"\n\tvar blockPos\n\tvar laserExtent\n\n\tfunc setName(n):\n\t\tname = n\n\t\treturn self\n\n\tfunc setPairName(n):\n\t\tpairName = n\n\t\treturn self\n\n\tfunc setLaserExtent(n):\n\t\tlaserExtent = n\n\t\treturn self\n\n\tfunc setBlockClass(c):\n\t\tblockClass = c\n\t\treturn self\n\n\tfunc setTextureName(t):\n\t\ttextureName = t\n\t\treturn self\n\n\tfunc toString():\n\t\treturn str(name) + \": \" + str(blockClass)\n\n\tfunc toNode():\n\t\t# instantiate a block scene, assign the appropriate script to it\n\t\tvar n = blockScn.instance()\n\t\tn.set_script(blockScripts[blockClass])\n\n\t\t# configure block node\n\t\tn.setName(str(name)).setTexture()\n\t\tn.blockPos = blockPos\n\t\tif blockClass == BLOCK_PAIR:\n\t\t\tn.setPairName(pairName).setTexture(textureName)\n\n\t\tif blockClass == BLOCK_LASER:\n\t\t\tn.setPairName(pairName).setExtent(laserExtent)\n\t\treturn n\n\t\t\n\t# Convert this object to a dictionary.\n\tfunc toDict():\n\t\tvar di = { n = name\n\t\t \t , bC = blockClass\n\t\t\t , pN = pairName\n\t\t\t , tN = textureName\n\t\t\t , bP = blockPos\n\t\t\t , lE = laserExtent\n\t\t\t }\n\t\treturn di\n\t\t\t\n\t# Make this object from a dictionary.\n\tfunc fromDict( di ):\n\t\tname = di.n\n\t\tblockClass = di.bC\n\t\tpairName = di.pN\n\t\ttextureName = di.tN\n\t\tblockPos = di.bP\n\t\tlaserExtent = di.lE\n\n","old_contents":"const DIFF_EASY\t\t= 0\nconst DIFF_MEDIUM\t= 1\nconst DIFF_HARD\t\t= 2\n\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\nconst blockColors = [\"Blue\", \"Orange\", \"Red\", \"Yellow\", \"Purple\", \"Green\"]\nconst wildColors = [\"WildBlue\", \"WildOrange\", \"WildRed\", \"WildYellow\", \"WildPurple\", \"WildGreen\"]\n\n# Preload paired blocks\nconst blockScn = preload( \"res:\/\/blocks\/block.scn\" )\nconst blockScripts = [ preload( \"Blocks\/LaserBlock.gd\" )\n\t\t\t \t , preload( \"Blocks\/LaserBlock.gd\" )\n\t\t\t \t , preload( \"Blocks\/PairedBlock.gd\" )\n\t\t\t \t , preload( \"Blocks\/LaserBlock.gd\" )\n\t\t\t \t ]\nconst aBlock = preload( \"Blocks\/AbstractBlock.gd\" )\n\n# Hash map of all possible positions\nvar shape = {}\n\n# Stores a puzzle in a convenient class.\nclass Puzzle:\n\tvar puzzleName\n\tvar puzzleLayers\n\tvar blocks = []\n\tvar lasers = []\n\t\n\tvar puzzleMan\n\t\n\t# Converts a puzzle to a dictionary.\n\tfunc toDict():\n\t\tvar blockArr = []\n\t\tfor b in range( blocks.size() ):\n\t\t\tblockArr.append( blocks[b].toDict() )\n\t\n\t\tvar di = { pN = puzzleName\n\t\t \t , pL = puzzleLayers\n\t\t\t\t , bL = blockArr\n\t\t\t }\n\t\treturn di\n\t\n\t# Converts a dictionary to a puzzle.\n\tfunc fromDict( di ):\n\t\tpuzzleName = di.pN\n\t\tpuzzleLayers = di.pL\n\t\tfor b in range( di.bL.size() ):\n\t\t\tvar nb = puzzleMan.PickledBlock.new()\n\t\t\tnb.fromDict( di.bL[b] )\n\t\t\tblocks.append( nb )\n\t\treturn\n\t\n\t# Determines if a puzzle is solveable.\n\tfunc solvePuzzle():\n\t\t# Simply use the solvePuzzleSteps function and return the solveable part.\n\t\tvar ps = self.solvePuzzleSteps()\n\t\treturn ps.solveable\n\t\n\t# Determines if a puzzle is solveable and returns the steps needed to solve it.\n\tfunc solvePuzzleSteps():\n\t\tvar puzzleSteps = PuzzleSteps.new()\n\t\tpuzzleSteps.solveable = true\n\t\n\t\t# SOLVER\n\t\n\t\treturn puzzleSteps\n\t\n\t# Holds all of the steps needed to solve a puzzle.\n\tclass PuzzleSteps:\n\t\tvar solveable\n\n# Randomly shuffle an array.\nfunc shuffleArray( arr ):\n\tfor i in range( arr.size() - 1, 1, -1 ):\n\t\t# works great! print( \"SWAP\" )\n\t\tvar swapVal = randi() % (i + 1)\n\t\tvar temp = arr[swapVal]\n\t\tarr[swapVal] = arr[i]\n\t\tarr[i] = temp\n\t\t\n\n# calculate the layer; move into a method so that it can be used elsewhere\nfunc calcBlockLayer( x, y, z ):\n\treturn max( max( abs( x ), abs( y ) ), abs( z ) )\n\n# Determines the block type based on puzzle size and difficulty.\nfunc getBlockType( difficulty, x, y, z ):\n\t# Determine if this is the goal block.\n\tif x == 0 and y == 0 and z == 0:\n\t\treturn BLOCK_GOAL\n\n\t# Determine the layer this block is on.\n\tvar layer = calcBlockLayer( x, y, z )\n\n\t# Determine how many blocks are on the outer part of the layer.\n\tvar layerCount = 0\n\tif abs( x ) == layer:\n\t\tlayerCount += 1\n\tif abs( y ) == layer:\n\t\tlayerCount += 1\n\tif abs( z ) == layer:\n\t\tlayerCount += 1\n\n\t# Determine if this block is a laser.\n\tif difficulty == DIFF_EASY or difficulty == DIFF_MEDIUM:\n\t\tif layerCount == 3:\n\t\t\treturn BLOCK_LASER\n\n\tif difficulty == DIFF_HARD:\n\t\tif abs( x ) == abs( z ) and y == 0:\n\t\t\treturn BLOCK_LASER\n\n\t# Determine if this block is a wild block.\n\tif difficulty == DIFF_EASY:\n\t\tif layerCount == 2:\n\t\t\treturn BLOCK_WILD\n\n\tif difficulty == DIFF_MEDIUM:\n\t\tif layerCount == 2:\n\t\t\tif y == layer || y == -layer:\n\t\t\t\treturn BLOCK_WILD\n\n\tif difficulty == DIFF_HARD:\n\t\tif layerCount == 1:\n\t\t\tif y == 0:\n\t\t\t\treturn BLOCK_WILD\n\n\t# Otherwise it's a normal block.\n\treturn BLOCK_PAIR\n\n# Generates a solveable puzzle.\nfunc generatePuzzle( layers, difficulty ):\n\tvar blockID = 0\n\tvar puzzle = Puzzle.new()\n\tpuzzle.puzzleName = \"RANDOM PUZZLE\"\n\tpuzzle.puzzleLayers = layers\n\t\n\t# Create all possible positions.\n\tvar layeredblocks = []\n\tfor l in range( 0, layers + 1 ):\n\t\tlayeredblocks.append( [] )\n\tfor x in range( -layers, layers + 1 ):\n\t\tfor y in range( -layers, layers + 1 ):\n\t\t\tfor z in range( -layers, layers + 1 ):\n\t\t\t\tlayeredblocks[calcBlockLayer( x, y, z )].append(Vector3(x,y,z))\n\t\t\t\tshape[Vector3(x,y,z)] = null\n\n\t# Generate laser lines.\n\tfor l in range( 1, layers + 1 ):\n\t\tif difficulty == DIFF_EASY:\n\t\t\tfor lx in [ -l, l ]:\n\t\t\t\tfor lz in [ -l, l ]:\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, lx, lz ), Vector3( lx + lx*-1, lx, lz )] )\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, lx, lz ), Vector3( lx, lx + lx*-1, lz )] )\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, lx, lz ), Vector3( lx, lx, lz + lz*-1 )] )\n\t\t\t\t\t\t\n\tfor l in puzzle.lasers:\n\t\tprint( l )\n\t\t\n\tprint( \"LASERS \", puzzle.lasers.size() )\n\n\t# Assign block types based on position.\n\tfor l in range( 0, layers + 1 ):\n\t\t# Randomize the pairs.\n\t\tshuffleArray( layeredblocks[l] )\n\t\tprint( \"NUM \", layeredblocks[l].size() )\n\t\tvar prevBlock = null\n\t\tvar even = false\n\t\tvar prevLaser = null\n\t\tvar laserEven = false\n\t\tfor pos in layeredblocks[l]:\n\t\t\tvar x = pos.x\n\t\t\tvar y = pos.y\n\t\t\tvar z = pos.z\n\t\n\t\t\tvar t = getBlockType( difficulty, x, y, z )\n\t\n\t\t\tif t == BLOCK_GOAL:\n\t\t\t\tcontinue\n\t\n\t\t\tvar b = PickledBlock.new()\n\t\t\tb.blockPos = pos\n\t\t\tb.name = blockID\n\t\n\t\t\tblockID += 1\n\t\t\tpuzzle.blocks.append( b )\n\t\n\t\t\tif t == BLOCK_LASER:\n\t\t\t\tb.setBlockClass(BLOCK_LASER)\n\t\t\t\tif laserEven:\n\t\t\t\t\tb.setPairName(prevLaser.name) \\\n\t\t\t\t\t.setLaserExtent(prevLaser.blockPos - b.blockPos)\n\t\n\t\t\t\t\tprevLaser.setPairName(b.name) \\\n\t\t\t\t\t.setLaserExtent(b.blockPos - prevLaser.blockPos)\n\t\t\t\tlaserEven = not laserEven\n\t\t\t\tprevLaser = b\n\t\t\t\tcontinue\n\t\n\t\t\tif t == BLOCK_WILD:\n\t\t\t\tb.setBlockClass(BLOCK_PAIR) \\\n\t\t\t\t\t.setTextureName(wildColors[randi() % wildColors.size()])\n\t\t\t\tcontinue\n\t\n\t\t\tif even:\n\t\t\t\tvar randColor = blockColors[randi() % blockColors.size()]\n\t\t\t\tb.setBlockClass(BLOCK_PAIR) \\\n\t\t\t\t\t.setPairName(prevBlock.name) \\\n\t\t\t\t\t.setTextureName(randColor)\n\t\n\t\t\t\tprevBlock.setBlockClass(BLOCK_PAIR) \\\n\t\t\t\t\t.setPairName(b.name) \\\n\t\t\t\t\t.setTextureName(randColor)\n\t\t\teven = not even\n\t\t\tprevBlock = b\n\n\treturn puzzle\n\nclass PickledBlock:\n\tvar name\n\tvar blockClass = BLOCK_PAIR\n\tvar pairName\n\tvar textureName = \"Red\"\n\tvar blockPos\n\tvar laserExtent\n\n\tfunc setName(n):\n\t\tname = n\n\t\treturn self\n\n\tfunc setPairName(n):\n\t\tpairName = n\n\t\treturn self\n\n\tfunc setLaserExtent(n):\n\t\tlaserExtent = n\n\t\treturn self\n\n\tfunc setBlockClass(c):\n\t\tblockClass = c\n\t\treturn self\n\n\tfunc setTextureName(t):\n\t\ttextureName = t\n\t\treturn self\n\n\tfunc toString():\n\t\treturn str(name) + \": \" + str(blockClass)\n\n\tfunc toNode():\n\t\t# instantiate a block scene, assign the appropriate script to it\n\t\tvar n = blockScn.instance()\n\t\tn.set_script(blockScripts[blockClass])\n\n\t\t# configure block node\n\t\tn.setName(str(name)).setTexture()\n\t\tn.blockPos = blockPos\n\t\tif blockClass == BLOCK_PAIR:\n\t\t\tn.setPairName(pairName).setTexture(textureName)\n\n\t\tif blockClass == BLOCK_LASER:\n\t\t\tn.setPairName(pairName).setExtent(laserExtent)\n\t\treturn n\n\t\t\n\t# Convert this object to a dictionary.\n\tfunc toDict():\n\t\tvar di = { n = name\n\t\t \t , bC = blockClass\n\t\t\t , pN = pairName\n\t\t\t , tN = textureName\n\t\t\t , bP = blockPos\n\t\t\t , lE = laserExtent\n\t\t\t }\n\t\treturn di\n\t\t\t\n\t# Make this object from a dictionary.\n\tfunc fromDict( di ):\n\t\tname = di.n\n\t\tblockClass = di.bC\n\t\tpairName = di.pN\n\t\ttextureName = di.tN\n\t\tblockPos = di.bP\n\t\tlaserExtent = di.lE\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"cfb9574f49788f16247f4f922d7efa94e006080e","subject":"Change network port","message":"Change network port\n","repos":"h4de5\/spiel4","old_file":"game\/autoloads\/network_manager.gd","new_file":"game\/autoloads\/network_manager.gd","new_contents":"extends Node\n\nvar connection_id\n\nvar SERVER_IP = \"127.0.0.1\"\n#var SERVER_IP = \"82.149.113.37\"\n#var SERVER_IP = \"192.168.0.10\"\nvar SERVER_PORT = 8910\nvar MAX_PLAYERS = 512\n\n# Signals to let lobby GUI know what's going on\n\n# when a player has been added, or removed\nsignal peer_list_changed(player_pool_size, networkid, add_or_remove) # server only signal\n\n# when the game is switched to client mode\nsignal start_client()\n# when the game is switched to server mode\nsignal start_server()\n# when the game is switched to offline mode\nsignal start_offline()\n\n# when external ip address has been determined\nsignal determined_external_ip(ip)\n\n# when the client is connected to the server\nsignal connected_as_client()\n\n\n\n#signal connection_failed()\n#signal connection_succeeded()\n#signal game_ended()\n#signal game_error(what)\n\n\n# Connect all functions\nfunc _ready():\n\n\tget_tree().connect(\"network_peer_connected\", self, \"network_peer_connected\")\n\tget_tree().connect(\"network_peer_disconnected\", self, \"network_peer_disconnected\")\n\t#get_tree().connect(\"peer_connected\", self, \"peer_connected\")\n\t#get_tree().connect(\"peer_disconnected\", self, \"peer_disconnected\")\n\tget_tree().connect(\"connected_to_server\", self, \"connected_to_server\")\n\tget_tree().connect(\"connection_failed\", self, \"connection_failed\")\n\t#get_tree().connect(\"connection_succeeded\", self, \"connection_succeeded\")\n\n\tget_tree().connect(\"server_disconnected\", self, \"server_disconnected\")\n\n\tset_physics_process(false)\n\n\tinit_local_information()\n\n\n# methods to check current status\n\nfunc is_network_activated():\n\treturn get_tree().has_meta(\"network_peer\")\n\nfunc is_offline():\n\treturn not is_network_activated()\n\nfunc is_server():\n\tif is_network_activated() and get_tree().is_network_server():\n\t\treturn true\n\telse :\n\t\treturn false\n\nfunc is_master(node):\n\tif is_network_activated() and node.is_network_master():\n\t\treturn true\n\telse :\n\t\treturn false\n\nfunc is_slave(node):\n\tif is_network_activated() and not node.is_network_master():\n\t\treturn true\n\telse :\n\t\treturn false\n\n\n# send updates to other clients\nfunc _physics_process(delta):\n\t_single_process()\n\nfunc _single_process():\n\tif (get_tree().has_meta(\"network_peer\") and get_tree().is_network_server()):\n\t\t#print (\"sending network update..\")\n\t\tfor group in object_locator.objects_registered:\n\t\t\tfor obj in object_locator.objects_registered[group]:\n\t\t\t\tif obj.is_network_master():\n\t\t\t\t\tobj.rpc_unreliable(\"set_network_update\", obj.get_network_update())\n\n\n\n# Player info, associate ID to data\nvar player_info = {}\n# Info we send to other players\nvar my_info = { }\n\nvar players_done = []\n\nfunc resolved_external_address(result, response_code, headers, body, params = []):\n\tvar response = http.on_request_completed(result, response_code, headers, body, params)\n\tif response and response.body:\n\t\tmy_info['ip'].append(response.body)\n\t\t# my_info['ip'] += ','+ response.body\n\t\tprint(\"added external IP to my info: \", my_info.ip)\n\t\temit_signal(\"determined_external_ip\", my_info.ip)\n\n\nfunc resolve_external_address():\n\thttp.send(\"http:\/\/ip.icb.at\", \"\", \"\", \"resolved_external_address\", self)\n\nfunc init_local_information():\n\n\t# get all local adresses\n\tvar ip_all = IP.get_local_addresses()\n\tvar ip_valid = []\n\t# only add valid ones (no localhost, no ipv6, no ms fallback\n\tfor ip in ip_all:\n\t\tprint(\"Found local IP: \", ip)\n\t\tif ip.find(':') != -1: continue\n\t\telif ip.substr(0,4) == '127.': continue\n\t\telif ip.substr(0,4) == '169.': continue\n\t\telse: ip_valid.append(ip)\n\n#\tmy_info[\"ip\"] = PoolStringArray(ip_valid).join(\",\")\n\tmy_info[\"ip\"] = ip_valid\n\tcall_deferred(\"resolve_external_address\")\n\n\tmy_info[\"os\"] = OS.get_name()\n\tmy_info[\"device\"] = OS.get_model_name()\n\tvar username = OS.get_user_data_dir()\n\n\t# remove everything before first slash\n\tvar pos = username.find(\"\/\")\n\tusername = username.substr(pos+1, username.length() - pos)\n\t# remove \/Users\/ and \/home\/\n\tusername = username.replacen(\"Users\/\", \"\").replacen(\"home\/\", \"\")\n\t# remove everything after next slash\n\tif username.find(\"\/\") > 0:\n\t\tusername = username.substr(0, username.find(\"\/\"))\n\tmy_info[\"username\"] = username\n\n\tprint(\"my infos: \", my_info)\n\n\n# Will go unused, not useful here\nfunc network_peer_connected(id):\n\tprint (\"network_peer_connected\")\n\temit_signal(\"peer_list_changed\", player_info.size(), id, 1)\n\nfunc network_peer_disconnected(id):\n\tprint (\"network_peer_disconnected\")\n\t# Erase player from info\n\tplayer_info.erase(id)\n\temit_signal(\"peer_list_changed\", player_info.size(), id, -1)\n\nfunc connected_to_server():\n\tprint (\"connected_to_server\")\n\temit_signal(\"connected_as_client\")\n\n\t# Only called on clients, not server. Send my ID and info to all the other peers\n\trpc(\"register_player\", get_tree().get_network_unique_id(), my_info)\n\n# Server kicked us, show error and abort\nfunc server_disconnected():\n\tprint (\"server_disconnected\")\n\tget_tree().set_meta(\"network_peer\", null)\n\temit_signal(\"start_offline\")\n\n# Could not even connect to server, abort\nfunc connection_failed():\n\tprint (\"connection_failed\")\n\tget_tree().set_meta(\"network_peer\", null)\n\temit_signal(\"start_offline\")\n\nfunc connection_succeeded():\n\tprint (\"connection_succeeded\")\n\t#get_tree().set_meta(\"network_peer\", null)\n\t#emit_signal(\"start_offline\")\n\n\nfunc disconnect_game():\n\tprint (\"disconnect_game\")\n\n\tvar peer = get_tree().get_meta(\"network_peer\")\n\tif peer:\n\t\tpeer.close_connection()\n\n\tget_tree().set_meta(\"network_peer\", null)\n\temit_signal(\"start_offline\")\n\nfunc split_path(path):\n\t# \/root\/game\/objects\/Asteroid2\n\t# > objects\n\tvar parts = String(path).split(\"\/\", false)\n\treturn parts[2]\n\n\n#remote func register_player(id, info):\nremote func register_player(id, info):\n\tprint (\"register_player \", id , ' info ', info )\n\t# Store the info\n\tplayer_info[id] = info\n\t# If I'm the server, let the new guy know about existing players\n\tif (get_tree().is_network_server()):\n\t\t# Send my info to new player\n\t\trpc_id(id, \"register_player\", 1, my_info)\n\n\t\temit_signal(\"peer_list_changed\", player_info.size(), id, -1)\n\n\t\t# go through all game objects, and spawn them accordingly on the new peer\n\t\tfor group in object_locator.objects_registered:\n\t\t\tfor obj in object_locator.objects_registered[group]:\n\t\t\t\tget_node(global.scene_tree_game).rpc_id(id, \"spawn_object\", obj.scene_path, split_path(obj.get_path()))\n\n\t\t# Send the info of existing players\n\t\t# no in use\n\t\tfor peer_id in player_info:\n\t\t\trpc_id(id, \"register_player\", peer_id, player_info[peer_id])\n\n\t\t# Call function to update lobby UI here\n\t\t# called on all peers\n\t\trpc(\"pre_configure_game\")\n\nremote func pre_configure_game():\n\tprint (\"pre_configure_game\")\n\n\t# game is paused for now\n\tget_tree().set_pause(true) # Pre-pause\n\t# The rest is the same as in the code in the previous section (look above)\n\tvar selfPeerID = get_tree().get_network_unique_id()\n\n\t# Tell server (remember, server is always ID=1) that this peer is done pre-configuring\n\trpc_id(1, \"done_preconfiguring\", selfPeerID)\n\n\n# waits until all clients sent \"done\"\nremote func done_preconfiguring(who):\n\tprint (\"done_preconfiguring\")\n\n\t# Here is some checks you can do, as example\n\tassert(get_tree().is_network_server())\n\tassert(who in player_info) # Exists\n\tassert(not who in players_done) # Was not added yet\n\n\tplayers_done.append(who)\n\n\tif (players_done.size() == player_info.size()):\n\t\trpc(\"post_configure_game\")\n\n# .. then continues the game\nremote func post_configure_game():\n\tprint (\"post_configure_game\")\n\tget_tree().set_pause(false)\n\t# Game starts now!\n\n#\nfunc start_server():\n\tprint (\"starting server...\")\n\tvar peer = NetworkedMultiplayerENet.new()\n\tvar status = peer.create_server(SERVER_PORT, MAX_PLAYERS)\n\n\tprint (\"status: \", status)\n\n\tif status == 0:\n\n\t\tget_tree().set_network_peer(peer)\n\t\tget_tree().set_meta(\"network_peer\", peer)\n\n\t\tset_physics_process(true)\n\n\t\temit_signal(\"start_server\")\n\t\thttp.send(\"https:\/\/dev.pauschenwein.net\/spiel4\/lobby.php\",\n\t\t\t{\"server\": \"start\"}, my_info, \"registered_server\", self)\n\n\telse :\n\t\tprint (\"Starting Server failed: \", status)\n\t\tpeer.close_connection()\n\n\nfunc start_client():\n\tprint (\"connect to server..\")\n\tvar peer = NetworkedMultiplayerENet.new()\n\tpeer.create_client(SERVER_IP, SERVER_PORT)\n\tget_tree().set_network_peer(peer)\n\tget_tree().set_meta(\"network_peer\", peer)\n\n\tset_physics_process(false)\n\n\t# clearing is done via signals now - because cool\n\temit_signal(\"start_client\")\n\n\nfunc registered_server(result, response_code, headers, body, params = []):\n\tprint(\"registered_server: \", result)\n\n\tvar response = http.on_request_completed(result, response_code, headers, body, params)\n\tif response and response.body:\n\t\tprint(\"response Body: \", response.body)\n","old_contents":"extends Node\n\nvar connection_id\n\nvar SERVER_IP = \"127.0.0.1\"\nvar SERVER_PORT = 32112\nvar MAX_PLAYERS = 512\n\n# Signals to let lobby GUI know what's going on\n\n# when a player has been added, or removed\nsignal peer_list_changed(player_pool_size, networkid, add_or_remove) # server only signal\n\n# when the game is switched to client mode\nsignal start_client()\n# when the game is switched to server mode\nsignal start_server()\n# when the game is switched to offline mode\nsignal start_offline()\n\n# when external ip address has been determined\nsignal determined_external_ip(ip)\n\n# when the client is connected to the server\nsignal connected_as_client()\n\n\n\n#signal connection_failed()\n#signal connection_succeeded()\n#signal game_ended()\n#signal game_error(what)\n\n\n# Connect all functions\nfunc _ready():\n\n\tget_tree().connect(\"network_peer_connected\", self, \"network_peer_connected\")\n\tget_tree().connect(\"network_peer_disconnected\", self, \"network_peer_disconnected\")\n\t#get_tree().connect(\"peer_connected\", self, \"peer_connected\")\n\t#get_tree().connect(\"peer_disconnected\", self, \"peer_disconnected\")\n\tget_tree().connect(\"connected_to_server\", self, \"connected_to_server\")\n\tget_tree().connect(\"connection_failed\", self, \"connection_failed\")\n\t#get_tree().connect(\"connection_succeeded\", self, \"connection_succeeded\")\n\n\tget_tree().connect(\"server_disconnected\", self, \"server_disconnected\")\n\n\tset_physics_process(false)\n\n\tinit_local_information()\n\n\n# methods to check current status\n\nfunc is_network_activated():\n\treturn get_tree().has_meta(\"network_peer\")\n\nfunc is_offline():\n\treturn not is_network_activated()\n\nfunc is_server():\n\tif is_network_activated() and get_tree().is_network_server():\n\t\treturn true\n\telse :\n\t\treturn false\n\nfunc is_master(node):\n\tif is_network_activated() and node.is_network_master():\n\t\treturn true\n\telse :\n\t\treturn false\n\nfunc is_slave(node):\n\tif is_network_activated() and not node.is_network_master():\n\t\treturn true\n\telse :\n\t\treturn false\n\n\n# send updates to other clients\nfunc _physics_process(delta):\n\t_single_process()\n\nfunc _single_process():\n\tif (get_tree().has_meta(\"network_peer\") and get_tree().is_network_server()):\n\t\t#print (\"sending network update..\")\n\t\tfor group in object_locator.objects_registered:\n\t\t\tfor obj in object_locator.objects_registered[group]:\n\t\t\t\tif obj.is_network_master():\n\t\t\t\t\tobj.rpc_unreliable(\"set_network_update\", obj.get_network_update())\n\n\n\n# Player info, associate ID to data\nvar player_info = {}\n# Info we send to other players\nvar my_info = { }\n\nvar players_done = []\n\nfunc resolved_external_address(result, response_code, headers, body, params = []):\n\tvar response = http.on_request_completed(result, response_code, headers, body, params)\n\tif response and response.body:\n\t\tmy_info['ip'].append(response.body)\n\t\t# my_info['ip'] += ','+ response.body\n\t\tprint(\"added external IP to my info: \", my_info.ip)\n\t\temit_signal(\"determined_external_ip\", my_info.ip)\n\n\nfunc resolve_external_address():\n\thttp.send(\"http:\/\/ip.icb.at\", \"\", \"\", \"resolved_external_address\", self)\n\nfunc init_local_information():\n\n\t# get all local adresses\n\tvar ip_all = IP.get_local_addresses()\n\tvar ip_valid = []\n\t# only add valid ones (no localhost, no ipv6, no ms fallback\n\tfor ip in ip_all:\n\t\tif ip.find(':') != -1: continue\n\t\telif ip.substr(0,4) == '127.': continue\n\t\telif ip.substr(0,4) == '169.': continue\n\t\telse: ip_valid.append(ip)\n\n#\tmy_info[\"ip\"] = PoolStringArray(ip_valid).join(\",\")\n\tmy_info[\"ip\"] = ip_valid\n\tcall_deferred(\"resolve_external_address\")\n\n\tmy_info[\"os\"] = OS.get_name()\n\tmy_info[\"device\"] = OS.get_model_name()\n\tvar username = OS.get_user_data_dir()\n\n\t# remove everything before first slash\n\tvar pos = username.find(\"\/\")\n\tusername = username.substr(pos+1, username.length() - pos)\n\t# remove \/Users\/ and \/home\/\n\tusername = username.replacen(\"Users\/\", \"\").replacen(\"home\/\", \"\")\n\t# remove everything after next slash\n\tif username.find(\"\/\") > 0:\n\t\tusername = username.substr(0, username.find(\"\/\"))\n\tmy_info[\"username\"] = username\n\n\tprint(\"my infos: \", my_info)\n\n\n# Will go unused, not useful here\nfunc network_peer_connected(id):\n\tprint (\"network_peer_connected\")\n\temit_signal(\"peer_list_changed\", player_info.size(), id, 1)\n\nfunc network_peer_disconnected(id):\n\tprint (\"network_peer_disconnected\")\n\t# Erase player from info\n\tplayer_info.erase(id)\n\temit_signal(\"peer_list_changed\", player_info.size(), id, -1)\n\nfunc connected_to_server():\n\tprint (\"connected_to_server\")\n\temit_signal(\"connected_as_client\")\n\n\t# Only called on clients, not server. Send my ID and info to all the other peers\n\trpc(\"register_player\", get_tree().get_network_unique_id(), my_info)\n\n# Server kicked us, show error and abort\nfunc server_disconnected():\n\tprint (\"server_disconnected\")\n\tget_tree().set_meta(\"network_peer\", null)\n\temit_signal(\"start_offline\")\n\n# Could not even connect to server, abort\nfunc connection_failed():\n\tprint (\"connection_failed\")\n\tget_tree().set_meta(\"network_peer\", null)\n\temit_signal(\"start_offline\")\n\nfunc connection_succeeded():\n\tprint (\"connection_succeeded\")\n\t#get_tree().set_meta(\"network_peer\", null)\n\t#emit_signal(\"start_offline\")\n\n\nfunc disconnect_game():\n\tprint (\"disconnect_game\")\n\n\tvar peer = get_tree().get_meta(\"network_peer\")\n\tif peer:\n\t\tpeer.close_connection()\n\n\tget_tree().set_meta(\"network_peer\", null)\n\temit_signal(\"start_offline\")\n\nfunc split_path(path):\n\t# \/root\/game\/objects\/Asteroid2\n\t# > objects\n\tvar parts = String(path).split(\"\/\", false)\n\treturn parts[2]\n\n\n#remote func register_player(id, info):\nremote func register_player(id, info):\n\tprint (\"register_player \", id , ' info ', info )\n\t# Store the info\n\tplayer_info[id] = info\n\t# If I'm the server, let the new guy know about existing players\n\tif (get_tree().is_network_server()):\n\t\t# Send my info to new player\n\t\trpc_id(id, \"register_player\", 1, my_info)\n\n\t\temit_signal(\"peer_list_changed\", player_info.size(), id, -1)\n\n\t\t# go through all game objects, and spawn them accordingly on the new peer\n\t\tfor group in object_locator.objects_registered:\n\t\t\tfor obj in object_locator.objects_registered[group]:\n\t\t\t\tget_node(global.scene_tree_game).rpc_id(id, \"spawn_object\", obj.scene_path, split_path(obj.get_path()))\n\n\t\t# Send the info of existing players\n\t\t# no in use\n\t\tfor peer_id in player_info:\n\t\t\trpc_id(id, \"register_player\", peer_id, player_info[peer_id])\n\n\t\t# Call function to update lobby UI here\n\t\t# called on all peers\n\t\trpc(\"pre_configure_game\")\n\nremote func pre_configure_game():\n\tprint (\"pre_configure_game\")\n\n\t# game is paused for now\n\tget_tree().set_pause(true) # Pre-pause\n\t# The rest is the same as in the code in the previous section (look above)\n\tvar selfPeerID = get_tree().get_network_unique_id()\n\n\t# Tell server (remember, server is always ID=1) that this peer is done pre-configuring\n\trpc_id(1, \"done_preconfiguring\", selfPeerID)\n\n\n# waits until all clients sent \"done\"\nremote func done_preconfiguring(who):\n\tprint (\"done_preconfiguring\")\n\n\t# Here is some checks you can do, as example\n\tassert(get_tree().is_network_server())\n\tassert(who in player_info) # Exists\n\tassert(not who in players_done) # Was not added yet\n\n\tplayers_done.append(who)\n\n\tif (players_done.size() == player_info.size()):\n\t\trpc(\"post_configure_game\")\n\n# .. then continues the game\nremote func post_configure_game():\n\tprint (\"post_configure_game\")\n\tget_tree().set_pause(false)\n\t# Game starts now!\n\n#\nfunc start_server():\n\tprint (\"starting server...\")\n\tvar peer = NetworkedMultiplayerENet.new()\n\tvar status = peer.create_server(SERVER_PORT, MAX_PLAYERS)\n\n\tprint (\"status: \", status)\n\n\tif status == 0:\n\n\t\tget_tree().set_network_peer(peer)\n\t\tget_tree().set_meta(\"network_peer\", peer)\n\n\t\tset_physics_process(true)\n\n\t\temit_signal(\"start_server\")\n\t\thttp.send(\"https:\/\/dev.pauschenwein.net\/spiel4\/lobby.php\",\n\t\t\t{\"server\": \"start\"}, my_info, \"registered_server\", self)\n\n\telse :\n\t\tprint (\"Starting Server failed: \", status)\n\t\tpeer.close_connection()\n\n\nfunc start_client():\n\tprint (\"connect to server..\")\n\tvar peer = NetworkedMultiplayerENet.new()\n\tpeer.create_client(SERVER_IP, SERVER_PORT)\n\tget_tree().set_network_peer(peer)\n\tget_tree().set_meta(\"network_peer\", peer)\n\n\tset_physics_process(false)\n\n\t# clearing is done via signals now - because cool\n\temit_signal(\"start_client\")\n\n\nfunc registered_server(result, response_code, headers, body, params = []):\n\tprint(\"registered_server: \", result)\n\n\tvar response = http.on_request_completed(result, response_code, headers, body, params)\n\tif response and response.body:\n\t\tprint(\"response Body: \", response.body)\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"GDScript"} {"commit":"1b07d9a3d70398f1fba61d212a49e8ab34edfeaa","subject":"Update GUIManager.gd","message":"Update GUIManager.gd\n\nAdded splash skip and comments.","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/GUIManager.gd","new_file":"src\/scripts\/GUIManager.gd","new_contents":"# This script manages all of the GUI elements.\n# It switches between the states of the GUI allowing\n# the user to start games, edit the options or connect\n# to a multiplayer game.\n\nextends Node\n\n# State variables.\nvar menuOn\nvar splashTween\n\n# Timers.\nvar timer\nvar initialWait = .5\nvar splashTimer = 2.0\nvar warningTimer = 5.0\n\n# GUI pieces.\nvar Splash_Team5\nvar Splash_Warning\nvar Menu_Main\nvar Menu_Chooser\nvar Menu_MP\nvar Menu_HostGame\nvar Menu_JoinGame\nvar Menu_Options\n\n# Menu state values. Used to switch between them.\nvar MENU_INIT\t\t\t= 0\nvar MENU_SPLASHTEAM5\t= 1\nvar MENU_SPLASHWARNING\t= 2\nvar MENU_MAIN\t\t\t= 3\nvar MENU_CHOOSER\t\t= 4\nvar MENU_MP\t\t\t\t= 5\nvar MENU_HOSTGAME\t\t= 6\nvar MENU_JOINGAME\t\t= 7\nvar MENU_OPTIONS\t\t= 8\n\n# Function to be called once for setup.\nfunc _ready():\n\t# Initial setup.\n\tmenuOn = MENU_INIT\n\ttimer = 0.0\n\tset_process( true )\n\tset_process_input( true )\n\t\n\t# Setup the splash fader tween.\n\tsplashTween = Tween.new()\n\tget_node( \"SplashFader\" ).add_child( splashTween )\n\tsplashTween.interpolate_method( get_node( \"SplashFader\" ), \"set_opacity\", 1.0, 0.0, 1.0, Tween.TRANS_CUBIC, Tween.EASE_IN_OUT )\n\t\n\t# Gather all of the menus.\n\tSplash_Team5 = get_node( \"SplashTeam5\" )\n\tSplash_Warning = get_node( \"SplashWarning\" )\n\tMenu_Main = get_node( \"MainMenu\" )\n\tMenu_Chooser = get_node( \"ChooserMenu\" )\n\tMenu_MP = get_node( \"Multiplayer\" )\n\tMenu_HostGame = get_node( \"HostGame\" )\n\tMenu_JoinGame = get_node( \"JoinGame\" )\n\tMenu_Options = get_node( \"OptionsMenu\" )\n\n# Function to update the GUI.\nfunc _process( delta ):\n\t# Handle the initial wait.\n\tif( menuOn == MENU_INIT ):\n\t\tif( timer > initialWait ):\n\t\t\tmenuOn = MENU_SPLASHTEAM5\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiIn()\n\t\t\t\n\t# Handle the Team5 splash screen.\n\tif( menuOn == MENU_SPLASHTEAM5 ):\n\t\tif( timer > splashTimer ):\n\t\t\tmenuOn = MENU_SPLASHWARNING\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiOut()\n\t\t\tSplash_Warning.guiIn()\n\t\t\t\n\t# Handle the warning splash screen.\n\tif( menuOn == MENU_SPLASHWARNING ):\n\t\tif( timer > warningTimer ):\n\t\t\tmenuOn = MENU_MAIN\n\t\t\ttimer = 0.0\n\t\t\tSplash_Warning.guiOut()\n\t\t\tMenu_Main.guiIn()\n\t\t\tsplashTween.start()\n\t\t\t\n\t# Increase the timer each frame.\n\ttimer += delta\n\n# Handle the input events.\nfunc _input( ev ):\n\t# Handle skip splash screens.\n\tif( !ev.is_pressed() and ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT ):\n\t\tif( menuOn == MENU_SPLASHTEAM5 || menuOn == MENU_SPLASHWARNING ):\n\t\t\ttimer = 999.0;\n\n\t# Handle exit.\n\tif( ev.is_action( \"ui_cancel\" ) ):\n\t\texit()\n\nfunc exit():\n\tprint( \"Exiting\" )\n\tOS.get_main_loop().quit()\n\nfunc _on_Exit_pressed():\n\texit()\n\nfunc _on_Options_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Options.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_OPTIONS\n\nfunc _on_Cancel_pressed():\n\tMenu_Options.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_SaveQuit_pressed():\n\t# Add save options here.\n\t_on_Cancel_pressed()\n\nfunc _on_SP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Chooser.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_CHOOSER\n\nfunc _on_MainMenu_pressed():\n\tMenu_Chooser.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MainMenuMP_pressed():\n\tMenu_MP.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_MP.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MP\n\nfunc _on_MainMenuHG_pressed():\n\tMenu_HostGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_HostGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_HostGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_HOSTGAME\n\nfunc _on_JoinGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_JoinGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_JOINGAME\n\nfunc _on_MainMenuJG_pressed():\n\tMenu_JoinGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_RandomPuzzle_pressed():\n\tvar root = get_tree().get_root()\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\troot.add_child( ResourceLoader.load( \"res:\/\/puzzle.scn\" ).instance() )\n\t\n","old_contents":"extends Node\n\nvar menuOn\nvar timer\nvar splashTween\n\nvar initialWait = .5\nvar splashTimer = 2.0\nvar warningTimer = 5.0\n\nvar Splash_Team5\nvar Splash_Warning\nvar Menu_Main\nvar Menu_Chooser\nvar Menu_MP\nvar Menu_HostGame\nvar Menu_JoinGame\nvar Menu_Options\n\nvar MENU_INIT\t\t\t= 0\nvar MENU_SPLASHTEAM5\t= 1\nvar MENU_SPLASHWARNING\t= 2\nvar MENU_MAIN\t\t\t= 3\nvar MENU_CHOOSER\t\t= 4\nvar MENU_MP\t\t\t\t= 5\nvar MENU_HOSTGAME\t\t= 6\nvar MENU_JOINGAME\t\t= 7\nvar MENU_OPTIONS\t\t= 8\n\nfunc _ready():\n\t# Initial setup.\n\tmenuOn = MENU_INIT\n\ttimer = 0.0\n\tset_process( true )\n\tset_process_input( true )\n\t\n\t# Setup the splash fader tween.\n\tsplashTween = Tween.new()\n\tget_node( \"SplashFader\" ).add_child( splashTween )\n\tsplashTween.interpolate_method( get_node( \"SplashFader\" ), \"set_opacity\", 1.0, 0.0, 1.0, Tween.TRANS_CUBIC, Tween.EASE_IN_OUT )\n\t\n\t# Gather all of the menus.\n\tSplash_Team5 = get_node( \"SplashTeam5\" )\n\tSplash_Warning = get_node( \"SplashWarning\" )\n\tMenu_Main = get_node( \"MainMenu\" )\n\tMenu_Chooser = get_node( \"ChooserMenu\" )\n\tMenu_MP = get_node( \"Multiplayer\" )\n\tMenu_HostGame = get_node( \"HostGame\" )\n\tMenu_JoinGame = get_node( \"JoinGame\" )\n\tMenu_Options = get_node( \"OptionsMenu\" )\n\nfunc _process( delta ):\n\t# Handle the initial wait.\n\tif( menuOn == MENU_INIT ):\n\t\tif( timer > initialWait ):\n\t\t\tmenuOn = MENU_SPLASHTEAM5\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiIn()\n\t\t\t\n\t# Handle the Team5 splash screen.\n\tif( menuOn == MENU_SPLASHTEAM5 ):\n\t\tif( timer > splashTimer ):\n\t\t\tmenuOn = MENU_SPLASHWARNING\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiOut()\n\t\t\tSplash_Warning.guiIn()\n\t\t\t\n\t# Handle the warning splash screen.\n\tif( menuOn == MENU_SPLASHWARNING ):\n\t\tif( timer > warningTimer ):\n\t\t\tmenuOn = MENU_MAIN\n\t\t\ttimer = 0.0\n\t\t\tSplash_Warning.guiOut()\n\t\t\tMenu_Main.guiIn()\n\t\t\tsplashTween.start()\n\t\t\t\n\t# Increase the timer each frame.\n\ttimer += delta\n\nfunc _input( ev ):\n\t# Handle exit.\n\tif( ev.is_action( \"ui_cancel\" ) ):\n\t\texit()\n\nfunc exit():\n\tprint( \"Exiting\" )\n\tOS.get_main_loop().quit()\n\nfunc _on_Exit_pressed():\n\texit()\n\nfunc _on_Options_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Options.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_OPTIONS\n\nfunc _on_Cancel_pressed():\n\tMenu_Options.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_SaveQuit_pressed():\n\t# Add save options here.\n\t_on_Cancel_pressed()\n\nfunc _on_SP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Chooser.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_CHOOSER\n\nfunc _on_MainMenu_pressed():\n\tMenu_Chooser.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MainMenuMP_pressed():\n\tMenu_MP.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_MP.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MP\n\nfunc _on_MainMenuHG_pressed():\n\tMenu_HostGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_HostGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_HostGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_HOSTGAME\n\nfunc _on_JoinGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_JoinGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_JOINGAME\n\nfunc _on_MainMenuJG_pressed():\n\tMenu_JoinGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\n\nfunc _on_RandomPuzzle_pressed():\n\tvar root = get_tree().get_root()\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\troot.add_child( ResourceLoader.load( \"res:\/\/puzzle.scn\" ).instance() )\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"5f0c38afd56c61032a2bd9cbf378c4ad6ac52595","subject":"Fix deep equality checking to use a \"near\" double comparison to allow for floating point errors.","message":"Fix deep equality checking to use a \"near\" double comparison to allow for floating point errors.\n","repos":"groboclown\/godot-bootstrap","old_file":"components\/unit_tests\/base.gd","new_file":"components\/unit_tests\/base.gd","new_contents":"# base test class\r\n\r\n#extends Object\r\n\r\nvar _tests = []\r\nvar filename = \"\"\r\nvar _results = null\r\n\r\nfunc _init():\r\n\tvar t\r\n\tfor t in get_method_list():\r\n\t\t# print(t.to_json())\r\n\t\tif t[\"name\"].begins_with(\"test_\") && t[\"args\"].size() <= 0:\r\n\t\t\tadd(t[\"name\"])\r\n\r\n\r\nfunc class_setup():\r\n\tpass\r\n\r\n\r\nfunc class_teardown():\r\n\tpass\r\n\r\n\r\nfunc setup():\r\n\tpass\r\n\r\n\r\nfunc teardown():\r\n\tpass\r\n\r\n\r\n# ------------------------------------------------------------------------\r\n\r\n\r\nfunc add(test_name):\r\n\tif test_name == null:\r\n\t\treturn\r\n\tif typeof(test_name) == TYPE_STRING:\r\n\t\tif not(test_name in _tests):\r\n\t\t\t_tests.append(test_name)\r\n\telse:\r\n\t\tvar t\r\n\t\tfor t in test_name:\r\n\t\t\tif t != null && not(t in _tests):\r\n\t\t\t\t_tests.append(t)\r\n\r\n\r\nfunc add_all(all_tests):\r\n\tadd(all_tests)\r\n\r\n\r\nfunc set_tests(test_names):\r\n\t_tests = []\r\n\tadd(test_names)\r\n\r\n\r\nfunc skip(test_name):\r\n\tif test_name == null:\r\n\t\treturn\r\n\tif typeof(test_name) == TYPE_STRING:\r\n\t\t_tests.erase(test_name)\r\n\telse:\r\n\t\tvar t\r\n\t\tfor t in test_name:\r\n\t\t\t_tests.erase(test_name)\r\n\r\n\r\n# ------------------------------------------------------------------------\r\n\r\n\r\nfunc check_true(text, bool_val):\r\n\tif ! bool_val:\r\n\t\tif _results != null:\r\n\t\t\t_results.add_error(text)\r\n\t\treturn false\r\n\treturn true\r\n\r\nfunc check_that(text, actual, matcher):\r\n\treturn check_true(text + \": \" + matcher.describe(actual), matcher.matches(actual))\r\n\r\nfunc check(text = \"\"):\r\n\treturn Checker.new(_results, text)\r\n\r\n\r\n\r\n\r\n# ------------------------------------------------------------------------\r\n\r\n# result_collector must implement these methods:\r\n# func start_suite(suite_name)\r\n# func end_suite()\r\n# func start_test(name)\r\n# func end_test()\r\n# func add_error(message)\r\n# func has_errors() (does the current suite have any errors?)\r\n\r\n\r\nfunc run(result_collector):\r\n\tself._results = result_collector\r\n\tresult_collector.start_suite(filename)\r\n\tclass_setup()\r\n\tif result_collector.has_error():\r\n\t\treturn\r\n\r\n\tvar t\r\n\tfor t in _tests:\r\n\t\tif has_method(t):\r\n\t\t\trun_test(t)\r\n\t\telse:\r\n\t\t\tresult_collector.add_error(\"Setup Error: requested function does not exist: \" + t)\r\n\r\n\tclass_teardown()\r\n\tresult_collector.end_suite()\r\n\r\n\r\nfunc run_test(name):\r\n\tif _results != null:\r\n\t\t_results.start_test(name)\r\n\tsetup()\r\n\tcall(name)\r\n\tteardown()\r\n\tif _results != null:\r\n\t\t_results.end_test()\r\n\r\n\r\n# -------------------------------------------------------------------------\r\n\r\n\r\nclass Matcher:\r\n\tfunc matches(value):\r\n\t\treturn false\r\n\tfunc describe(value):\r\n\t\treturn \"\"\r\n\tfunc _as_str(value):\r\n\t\tif value == null:\r\n\t\t\treturn \"\"\r\n\t\tif typeof(value) == TYPE_DICTIONARY:\r\n\t\t\treturn value.to_json()\r\n\t\treturn \"[\" + str(value) + \"]\"\r\n\tfunc _is_list(value):\r\n\t\t# return typeof(value) == TYPE_ARRAY || typeof(value) == TYPE_INT_ARRAY || typeof(value) == TYPE_REAL_ARRAY || typeof(value) == TYPE_STRING_ARRAY\r\n\t\t# All the arrays are in this specific range.\r\n\t\t# This needs to be checked against future versions of Godot.\r\n\t\tvar v = typeof(value)\r\n\t\treturn v >= TYPE_ARRAY && v <= TYPE_COLOR_ARRAY\r\n\r\n\r\nclass IsMatcher:\r\n\textends Matcher\r\n\tvar val\r\n\tvar _epsilon\r\n\r\n\tfunc _init(v, epsilon = 0.00001):\r\n\t\tval = v\r\n\t\t_epsilon = epsilon\r\n\r\n\tfunc matches(value):\r\n\t\treturn _inner_match(val, value, [])\r\n\r\n\tfunc _inner_match(v1, v2, seen):\r\n\t\tseen.append(v2)\r\n\t\t# Check lists the same way\r\n\t\tif _is_list(v1) && _is_list(v2):\r\n\t\t\tif v1.size() != v2.size():\r\n\t\t\t\treturn false\r\n\t\t\tvar i\r\n\t\t\tfor i in range(0, v1.size()):\r\n\t\t\t\tif v2[i] in seen:\r\n\t\t\t\t\t# This isn't a correct check; instead,\r\n\t\t\t\t\t# we need to ensure that the seen version of v2[i]\r\n\t\t\t\t\t# matches up with the corresponding seen version of v1[i]\r\n\t\t\t\t\tif v1[i] != v2[i]:\r\n\t\t\t\t\t\treturn false\r\n\t\t\t\t\t# Else prevent infinite loop by just\r\n\t\t\t\t\t# saying it's right.\r\n\t\t\t\telif ! _inner_match(v1[i], v2[i], seen):\r\n\t\t\t\t\treturn false\r\n\t\t\treturn true\r\n\t\t# Cannot perform a \"==\" if the types are different\r\n\t\tif typeof(v1) != typeof(v2):\r\n\t\t\treturn false\r\n\t\tif v1 == v2:\r\n\t\t\treturn true\r\n\t\tif typeof(v1) == TYPE_DICTIONARY:\r\n\t\t\tif v1.size() != v2.size():\r\n\t\t\t\treturn false\r\n\t\t\tvar k\r\n\t\t\tfor k in v1:\r\n\t\t\t\tif not (k in v2):\r\n\t\t\t\t\treturn false\r\n\t\t\t\tif v2[k] in seen:\r\n\t\t\t\t\t# This isn't a correct check; instead,\r\n\t\t\t\t\t# we need to ensure that the seen version of v2[i]\r\n\t\t\t\t\t# matches up with the corresponding seen version of v1[i]\r\n\t\t\t\t\tif v1[k] != v2[k]:\r\n\t\t\t\t\t\treturn false\r\n\t\t\t\telif ! _inner_match(v1[k], v2[k], seen):\r\n\t\t\t\t\treturn false\r\n\t\t\treturn true\r\n\t\tif typeof(v1) == TYPE_REAL:\r\n\t\t\t# Closeness\r\n\t\t\treturn abs(float(v1) - v2) <= _epsilon\r\n\t\t# Any other type should have == match right.\r\n\t\treturn false\r\n\r\n\tfunc describe(value):\r\n\t\treturn \"expected \" + _as_str(val) + \", found \" + _as_str(value)\r\n\r\n\r\n\r\nstatic func is(value, epsilon = 0.00001):\r\n\t# \"is\" can be used to make a clear English-like sentence.\r\n\t# So, if the value is a matcher, then just use that matcher instead of\r\n\t# adding another layer around \"is\".\r\n\tif typeof(value) == TYPE_OBJECT && value.has_method(\"matches\") && value.has_method(\"describe\"):\r\n\t\treturn value\r\n\t# Need to wrap the value in an is check.\r\n\treturn IsMatcher.new(value, epsilon)\r\n\r\n\r\nstatic func equals(value):\r\n\treturn IsMatcher.new(value)\r\n\r\n\r\nclass NotMatcher:\r\n\tvar val\r\n\r\n\tfunc _init(v):\r\n\t\tif typeof(v) == TYPE_OBJECT && v extends Matcher:\r\n\t\t\tval = v\r\n\t\telse:\r\n\t\t\tval = IsMatcher.new(v)\r\n\r\n\tfunc matches(value):\r\n\t\treturn ! val.matches(value)\r\n\r\n\tfunc describe(value):\r\n\t\treturn \"expected not: \" + val.describe(value)\r\n\r\n\r\n\r\nstatic func is_not(value):\r\n\treturn NotMatcher.new(value)\r\n\r\n\r\n\r\nclass BetweenMatcher:\r\n\tvar lo\r\n\tvar hi\r\n\r\n\tfunc _init(l, h):\r\n\t\tlo = float(l)\r\n\t\thi = float(h)\r\n\r\n\tfunc matches(value):\r\n\t\treturn value != null && float(value) >= lo && float(value) <= hi\r\n\r\n\tfunc describe(value):\r\n\t\treturn \"expected [\" + str(lo) + \", \" + str(hi) + \"], found \" + str(value)\r\n\r\n\r\n\r\nstatic func between(lo, hi):\r\n\treturn BetweenMatcher.new(lo, hi)\r\n\r\n\r\nclass NearMatcher:\r\n\tvar _epsilon\r\n\tvar _val\r\n\r\n\tfunc _init(val, epsilon = 0.00001):\r\n\t\t_epsilon = float(epsilon)\r\n\t\t_val = float(val)\r\n\r\n\tfunc matches(value):\r\n\t\treturn abs(float(value) - _val) <= _epsilon\r\n\r\n\tfunc describe(value):\r\n\t\treturn \"expected \" + str(_val) + \" within \" + str(_epsilon) + \", found \" + str(value)\r\n\r\n\r\nstatic func near(val, epsilon = 0.00001):\r\n\treturn NearMatcher.new(val, epsilon)\r\n\r\n\r\nclass ContainsMatcher:\r\n\textends Matcher\r\n\tvar _val\r\n\r\n\tfunc _init(val):\r\n\t\t_val = val\r\n\r\n\tfunc matches(actual):\r\n\t\tif actual == null:\r\n\t\t\treturn false\r\n\t\tif typeof(actual) == TYPE_STRING:\r\n\t\t\t# Expect a string to contain a sub-string\r\n\t\t\treturn actual.find(_val) >= 0\r\n\t\tif _is_list(actual):\r\n\t\t\tif _is_list(_val):\r\n\t\t\t\t# each \"val\" must be in the actual list\r\n\t\t\t\tvar v\r\n\t\t\t\tfor v in _val:\r\n\t\t\t\t\tif ! (v in actual):\r\n\t\t\t\t\t\treturn false\r\n\t\t\t\treturn true\r\n\t\t\treturn _val in actual\r\n\t\tif typeof(actual) == TYPE_RECT2:\r\n\t\t\tif typeof(_val) == TYPE_RECT2:\r\n\t\t\t\treturn actual.encloses(_val)\r\n\t\t\tif typeof(_val) == TYPE_VECTOR2:\r\n\t\t\t\treturn actual.has_point(_val)\r\n\t\t\treturn false\r\n\t\tif typeof(actual) == TYPE_PLANE:\r\n\t\t\tif typeof(_val) == TYPE_VECTOR3:\r\n\t\t\t\treturn actual.has_point(_val)\r\n\t\t\treturn false\r\n\t\tif typeof(actual) == TYPE_DICTIONARY:\r\n\t\t\tif _is_list(_val):\r\n\t\t\t\treturn actual.has_all(_val)\r\n\t\t \treturn actual.has(_val)\r\n\r\n\r\n\t\t# These don't really make sense.\r\n\r\n\t\t# Object values should just be checked for equality.\r\n\t\t#if typeof(actual) == TYPE_OBJECT:\r\n\t\t#\treturn actual.get(_val) != null\r\n\r\n\t\treturn false\r\n\r\n\tfunc describe(actual):\r\n\t\treturn \"expected \" + _as_str(actual) + \" to contain \" + _as_str(_val)\r\n\r\nstatic func contains(val):\r\n\treturn ContainsMatcher.new(val)\r\n\r\n\r\nclass EmptyMatcher:\r\n\textends Matcher\r\n\r\n\tfunc matches(actual):\r\n\t\tif _is_list(actual):\r\n\t\t\treturn actual.size() <= 0\r\n\t\tif typeof(actual) == TYPE_DICTIONARY:\r\n\t\t\treturn actual.keys().size() <= 0\r\n\t\treturn false\r\n\r\n\tfunc describe(actual):\r\n\t\tif _is_list(actual):\r\n\t\t\treturn \"expected \" + _as_str(actual) + \" to be an empty list\"\r\n\t\tif typeof(actual) == TYPE_DICTIONARY:\r\n\t\t\treturn \"expected \" + _as_str(actual) + \" to be an empty dictionary\"\r\n\t\treturn \"expected \" + _as_str(actual) + \" to be an empty list or dictionary\"\r\n\r\nstatic func empty():\r\n\treturn EmptyMatcher.new()\r\n\r\n\r\n# ---------------------------------------------------------------------------\r\n\r\nclass Checker:\r\n\tvar _text\r\n\tvar _results\r\n\r\n\tfunc _init(results, text):\r\n\t\t_results = results\r\n\t\t_text = text\r\n\r\n\tfunc that(actual, matcher):\r\n\t\tvar res\r\n\t\tvar msg\r\n\t\tif typeof(matcher) == TYPE_BOOL:\r\n\t\t\tres = matcher\r\n\t\t\tmsg = _text\r\n\t\telse:\r\n\t\t\tres = matcher.matches(actual)\r\n\t\t\tmsg = _text + \": \" + matcher.describe(actual)\r\n\t\tif ! res:\r\n\t\t\tif _results != null:\r\n\t\t\t\t_results.add_error(msg)\r\n\t\t\treturn false\r\n\t\treturn true\r\n","old_contents":"# base test class\r\n\r\n#extends Object\r\n\r\nvar _tests = []\r\nvar filename = \"\"\r\nvar _results = null\r\n\r\nfunc _init():\r\n\tvar t\r\n\tfor t in get_method_list():\r\n\t\t# print(t.to_json())\r\n\t\tif t[\"name\"].begins_with(\"test_\") && t[\"args\"].size() <= 0:\r\n\t\t\tadd(t[\"name\"])\r\n\r\n\r\nfunc class_setup():\r\n\tpass\r\n\r\n\r\nfunc class_teardown():\r\n\tpass\r\n\r\n\r\nfunc setup():\r\n\tpass\r\n\r\n\r\nfunc teardown():\r\n\tpass\r\n\r\n\r\n# ------------------------------------------------------------------------\r\n\r\n\r\nfunc add(test_name):\r\n\tif test_name == null:\r\n\t\treturn\r\n\tif typeof(test_name) == TYPE_STRING:\r\n\t\tif not(test_name in _tests):\r\n\t\t\t_tests.append(test_name)\r\n\telse:\r\n\t\tvar t\r\n\t\tfor t in test_name:\r\n\t\t\tif t != null && not(t in _tests):\r\n\t\t\t\t_tests.append(t)\r\n\r\n\r\nfunc add_all(all_tests):\r\n\tadd(all_tests)\r\n\r\n\r\nfunc set_tests(test_names):\r\n\t_tests = []\r\n\tadd(test_names)\r\n\r\n\r\nfunc skip(test_name):\r\n\tif test_name == null:\r\n\t\treturn\r\n\tif typeof(test_name) == TYPE_STRING:\r\n\t\t_tests.erase(test_name)\r\n\telse:\r\n\t\tvar t\r\n\t\tfor t in test_name:\r\n\t\t\t_tests.erase(test_name)\r\n\r\n\r\n# ------------------------------------------------------------------------\r\n\r\n\r\nfunc check_true(text, bool_val):\r\n\tif ! bool_val:\r\n\t\tif _results != null:\r\n\t\t\t_results.add_error(text)\r\n\t\treturn false\r\n\treturn true\r\n\r\nfunc check_that(text, actual, matcher):\r\n\treturn check_true(text + \": \" + matcher.describe(actual), matcher.matches(actual))\r\n\r\nfunc check(text = \"\"):\r\n\treturn Checker.new(_results, text)\r\n\r\n\r\n\r\n\r\n# ------------------------------------------------------------------------\r\n\r\n# result_collector must implement these methods:\r\n# func start_suite(suite_name)\r\n# func end_suite()\r\n# func start_test(name)\r\n# func end_test()\r\n# func add_error(message)\r\n# func has_errors() (does the current suite have any errors?)\r\n\r\n\r\nfunc run(result_collector):\r\n\tself._results = result_collector\r\n\tresult_collector.start_suite(filename)\r\n\tclass_setup()\r\n\tif result_collector.has_error():\r\n\t\treturn\r\n\r\n\tvar t\r\n\tfor t in _tests:\r\n\t\tif has_method(t):\r\n\t\t\trun_test(t)\r\n\t\telse:\r\n\t\t\tresult_collector.add_error(\"Setup Error: requested function does not exist: \" + t)\r\n\r\n\tclass_teardown()\r\n\tresult_collector.end_suite()\r\n\r\n\r\nfunc run_test(name):\r\n\tif _results != null:\r\n\t\t_results.start_test(name)\r\n\tsetup()\r\n\tcall(name)\r\n\tteardown()\r\n\tif _results != null:\r\n\t\t_results.end_test()\r\n\r\n\r\n# -------------------------------------------------------------------------\r\n\r\n\r\nclass Matcher:\r\n\tfunc matches(value):\r\n\t\treturn false\r\n\tfunc describe(value):\r\n\t\treturn \"\"\r\n\tfunc _as_str(value):\r\n\t\tif value == null:\r\n\t\t\treturn \"\"\r\n\t\tif typeof(value) == TYPE_DICTIONARY:\r\n\t\t\treturn value.to_json()\r\n\t\treturn \"[\" + str(value) + \"]\"\r\n\tfunc _is_list(value):\r\n\t\t# return typeof(value) == TYPE_ARRAY || typeof(value) == TYPE_INT_ARRAY || typeof(value) == TYPE_REAL_ARRAY || typeof(value) == TYPE_STRING_ARRAY\r\n\t\t# All the arrays are in this specific range.\r\n\t\t# This needs to be checked against future versions of Godot.\r\n\t\tvar v = typeof(value)\r\n\t\treturn v >= TYPE_ARRAY && v <= TYPE_COLOR_ARRAY\r\n\r\n\r\nclass IsMatcher:\r\n\textends Matcher\r\n\tvar val\r\n\r\n\tfunc _init(v):\r\n\t\tval = v\r\n\r\n\tfunc matches(value):\r\n\t\treturn _inner_match(val, value, [])\r\n\r\n\tfunc _inner_match(v1, v2, seen):\r\n\t\tseen.append(v2)\r\n\t\t# Check lists the same way\r\n\t\tif _is_list(v1) && _is_list(v2):\r\n\t\t\tif v1.size() != v2.size():\r\n\t\t\t\treturn false\r\n\t\t\tvar i\r\n\t\t\tfor i in range(0, v1.size()):\r\n\t\t\t\tif v2[i] in seen:\r\n\t\t\t\t\t# This isn't a correct check; instead,\r\n\t\t\t\t\t# we need to ensure that the seen version of v2[i]\r\n\t\t\t\t\t# matches up with the corresponding seen version of v1[i]\r\n\t\t\t\t\tif v1[i] != v2[i]:\r\n\t\t\t\t\t\treturn false\r\n\t\t\t\t\t# Else prevent infinite loop by just\r\n\t\t\t\t\t# saying it's right.\r\n\t\t\t\telif ! _inner_match(v1[i], v2[i], seen):\r\n\t\t\t\t\treturn false\r\n\t\t\treturn true\r\n\t\t# Cannot perform a \"==\" if the types are different\r\n\t\tif typeof(v1) != typeof(v2):\r\n\t\t\treturn false\r\n\t\tif v1 == v2:\r\n\t\t\treturn true\r\n\t\tif typeof(v1) == TYPE_DICTIONARY:\r\n\t\t\tif v1.size() != v2.size():\r\n\t\t\t\treturn false\r\n\t\t\tvar k\r\n\t\t\tfor k in v1:\r\n\t\t\t\tif not (k in v2):\r\n\t\t\t\t\treturn false\r\n\t\t\t\tif v2[k] in seen:\r\n\t\t\t\t\t# This isn't a correct check; instead,\r\n\t\t\t\t\t# we need to ensure that the seen version of v2[i]\r\n\t\t\t\t\t# matches up with the corresponding seen version of v1[i]\r\n\t\t\t\t\tif v1[k] != v2[k]:\r\n\t\t\t\t\t\treturn false\r\n\t\t\t\telif ! _inner_match(v1[k], v2[k], seen):\r\n\t\t\t\t\treturn false\r\n\t\t\treturn true\r\n\t\tif typeof(v1) == TYPE_REAL:\r\n\t\t\t# Closeness\r\n\t\t\treturn abs(float(v1) - v2) <= 0.0000001\r\n\t\t# Any other type should have == match right.\r\n\t\treturn false\r\n\r\n\tfunc describe(value):\r\n\t\treturn \"expected \" + _as_str(val) + \", found \" + _as_str(value)\r\n\r\n\r\n\r\nstatic func is(value):\r\n\t# \"is\" can be used to make a clear English-like sentence.\r\n\t# So, if the value is a matcher, then just use that matcher instead of\r\n\t# adding another layer around \"is\".\r\n\tif typeof(value) == TYPE_OBJECT && value.has_method(\"matches\") && value.has_method(\"describe\"):\r\n\t\treturn value\r\n\t# Need to wrap the value in an is check.\r\n\treturn IsMatcher.new(value)\r\n\r\n\r\nstatic func equals(value):\r\n\treturn IsMatcher.new(value)\r\n\r\n\r\nclass NotMatcher:\r\n\tvar val\r\n\r\n\tfunc _init(v):\r\n\t\tif typeof(v) == TYPE_OBJECT && v extends Matcher:\r\n\t\t\tval = v\r\n\t\telse:\r\n\t\t\tval = IsMatcher.new(v)\r\n\r\n\tfunc matches(value):\r\n\t\treturn ! val.matches(value)\r\n\r\n\tfunc describe(value):\r\n\t\treturn \"expected not: \" + val.describe(value)\r\n\r\n\r\n\r\nstatic func is_not(value):\r\n\treturn NotMatcher.new(value)\r\n\r\n\r\n\r\nclass BetweenMatcher:\r\n\tvar lo\r\n\tvar hi\r\n\r\n\tfunc _init(l, h):\r\n\t\tlo = float(l)\r\n\t\thi = float(h)\r\n\r\n\tfunc matches(value):\r\n\t\treturn value != null && float(value) >= lo && float(value) <= hi\r\n\r\n\tfunc describe(value):\r\n\t\treturn \"expected [\" + str(lo) + \", \" + str(hi) + \"], found \" + str(value)\r\n\r\n\r\n\r\nstatic func between(lo, hi):\r\n\treturn BetweenMatcher.new(lo, hi)\r\n\r\n\r\nclass NearMatcher:\r\n\tvar _epsilon\r\n\tvar _val\r\n\r\n\tfunc _init(val, epsilon = 0.00001):\r\n\t\t_epsilon = float(epsilon)\r\n\t\t_val = float(val)\r\n\r\n\tfunc matches(value):\r\n\t\treturn abs(float(value) - _val) <= _epsilon\r\n\r\n\tfunc describe(value):\r\n\t\treturn \"expected \" + str(_val) + \" within \" + str(_epsilon) + \", found \" + str(value)\r\n\r\n\r\nstatic func near(val, epsilon = 0.00001):\r\n\treturn NearMatcher.new(val, epsilon)\r\n\r\n\r\nclass ContainsMatcher:\r\n\textends Matcher\r\n\tvar _val\r\n\r\n\tfunc _init(val):\r\n\t\t_val = val\r\n\r\n\tfunc matches(actual):\r\n\t\tif actual == null:\r\n\t\t\treturn false\r\n\t\tif typeof(actual) == TYPE_STRING:\r\n\t\t\t# Expect a string to contain a sub-string\r\n\t\t\treturn actual.find(_val) >= 0\r\n\t\tif _is_list(actual):\r\n\t\t\tif _is_list(_val):\r\n\t\t\t\t# each \"val\" must be in the actual list\r\n\t\t\t\tvar v\r\n\t\t\t\tfor v in _val:\r\n\t\t\t\t\tif ! (v in actual):\r\n\t\t\t\t\t\treturn false\r\n\t\t\t\treturn true\r\n\t\t\treturn _val in actual\r\n\t\tif typeof(actual) == TYPE_RECT2:\r\n\t\t\tif typeof(_val) == TYPE_RECT2:\r\n\t\t\t\treturn actual.encloses(_val)\r\n\t\t\tif typeof(_val) == TYPE_VECTOR2:\r\n\t\t\t\treturn actual.has_point(_val)\r\n\t\t\treturn false\r\n\t\tif typeof(actual) == TYPE_PLANE:\r\n\t\t\tif typeof(_val) == TYPE_VECTOR3:\r\n\t\t\t\treturn actual.has_point(_val)\r\n\t\t\treturn false\r\n\t\tif typeof(actual) == TYPE_DICTIONARY:\r\n\t\t\tif _is_list(_val):\r\n\t\t\t\treturn actual.has_all(_val)\r\n\t\t \treturn actual.has(_val)\r\n\r\n\r\n\t\t# These don't really make sense.\r\n\r\n\t\t# Object values should just be checked for equality.\r\n\t\t#if typeof(actual) == TYPE_OBJECT:\r\n\t\t#\treturn actual.get(_val) != null\r\n\r\n\t\treturn false\r\n\r\n\tfunc describe(actual):\r\n\t\treturn \"expected \" + _as_str(actual) + \" to contain \" + _as_str(_val)\r\n\r\nstatic func contains(val):\r\n\treturn ContainsMatcher.new(val)\r\n\r\n\r\nclass EmptyMatcher:\r\n\textends Matcher\r\n\r\n\tfunc matches(actual):\r\n\t\tif _is_list(actual):\r\n\t\t\treturn actual.size() <= 0\r\n\t\tif typeof(actual) == TYPE_DICTIONARY:\r\n\t\t\treturn actual.keys().size() <= 0\r\n\t\treturn false\r\n\r\n\tfunc describe(actual):\r\n\t\tif _is_list(actual):\r\n\t\t\treturn \"expected \" + _as_str(actual) + \" to be an empty list\"\r\n\t\tif typeof(actual) == TYPE_DICTIONARY:\r\n\t\t\treturn \"expected \" + _as_str(actual) + \" to be an empty dictionary\"\r\n\t\treturn \"expected \" + _as_str(actual) + \" to be an empty list or dictionary\"\r\n\r\nstatic func empty():\r\n\treturn EmptyMatcher.new()\r\n\r\n\r\n# ---------------------------------------------------------------------------\r\n\r\nclass Checker:\r\n\tvar _text\r\n\tvar _results\r\n\r\n\tfunc _init(results, text):\r\n\t\t_results = results\r\n\t\t_text = text\r\n\r\n\tfunc that(actual, matcher):\r\n\t\tvar res\r\n\t\tvar msg\r\n\t\tif typeof(matcher) == TYPE_BOOL:\r\n\t\t\tres = matcher\r\n\t\t\tmsg = _text\r\n\t\telse:\r\n\t\t\tres = matcher.matches(actual)\r\n\t\t\tmsg = _text + \": \" + matcher.describe(actual)\r\n\t\tif ! res:\r\n\t\t\tif _results != null:\r\n\t\t\t\t_results.add_error(msg)\r\n\t\t\treturn false\r\n\t\treturn true\r\n","returncode":0,"stderr":"","license":"cc0-1.0","lang":"GDScript"} {"commit":"ed3461f7ab94b44aa849cbfc4f0cbb4378ed2090","subject":"Fix for input_mapping: Fixed bug when you push a key before you press a button.","message":"Fix for input_mapping:\nFixed bug when you push a key before you press a button.\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"gui\/input_mapping\/controls.gd","new_file":"gui\/input_mapping\/controls.gd","new_contents":"extends Control\n\n# Note for the reader:\n#\n# This demo conveniently uses the same names for actions and for the container nodes\n# that hold each remapping button. This allow to get back to the button based simply\n# on the name of the corresponding action, but it might not be so simple in your project.\n#\n# A better approach for large-scale input remapping might be to do the connections between\n# buttons and wait_for_input through the code, passing as arguments both the name of the\n# action and the node, e.g.:\n# button.connect(\"pressed\", self, \"wait_for_input\", [ button, action ])\n\n# Constants\nconst INPUT_ACTIONS = [ \"move_up\", \"move_down\", \"move_left\", \"move_right\", \"jump\" ]\nconst CONFIG_FILE = \"user:\/\/input.cfg\"\n\n# Member variables\nvar action # To register the action the UI is currently handling\nvar button # Button node corresponding to the above action\n\n\n# Load\/save input mapping to a config file\n# Changes done while testing the demo will be persistent, saved to CONFIG_FILE\n\nfunc load_config():\n\tvar config = ConfigFile.new()\n\tvar err = config.load(CONFIG_FILE)\n\tif err: # Assuming that file is missing, generate default config\n\t\tfor action_name in INPUT_ACTIONS:\n\t\t\tvar action_list = InputMap.get_action_list(action_name)\n\t\t\t# There could be multiple actions in the list, but we save the first one by default\n\t\t\tvar scancode = OS.get_scancode_string(action_list[0].scancode)\n\t\t\tconfig.set_value(\"input\", action_name, scancode)\n\t\tconfig.save(CONFIG_FILE)\n\telse: # ConfigFile was properly loaded, initialize InputMap\n\t\tfor action_name in config.get_section_keys(\"input\"):\n\t\t\t# Get the key scancode corresponding to the saved human-readable string\n\t\t\tvar scancode = OS.find_scancode_from_string(config.get_value(\"input\", action_name))\n\t\t\t# Create a new event object based on the saved scancode\n\t\t\tvar event = InputEventKey.new()\n\t\t\tevent.scancode = scancode\n\t\t\t# Replace old action (key) events by the new one\n\t\t\tfor old_event in InputMap.get_action_list(action_name):\n\t\t\t\tif old_event is InputEventKey:\n\t\t\t\t\tInputMap.action_erase_event(action_name, old_event)\n\t\t\tInputMap.action_add_event(action_name, event)\n\n\nfunc save_to_config(section, key, value):\n\t\"\"\"Helper function to redefine a parameter in the settings file\"\"\"\n\tvar config = ConfigFile.new()\n\tvar err = config.load(CONFIG_FILE)\n\tif err:\n\t\tprint(\"Error code when loading config file: \", err)\n\telse:\n\t\tconfig.set_value(section, key, value)\n\t\tconfig.save(CONFIG_FILE)\n\n\n# Input management\n\nfunc wait_for_input(action_bind):\n\taction = action_bind\n\t# See note at the beginning of the script\n\tbutton = get_node(\"bindings\").get_node(action).get_node(\"Button\")\n\tget_node(\"contextual_help\").text = \"Press a key to assign to the '\" + action + \"' action.\"\n\tset_process_input(true)\n\n\nfunc _input(event):\n\t# Handle the first pressed key\n\tif event is InputEventKey:\n\t\t# Register the event as handled and stop polling\n\t\tget_tree().set_input_as_handled()\n\t\tset_process_input(false)\n\t\t# Reinitialise the contextual help label\n\t\tget_node(\"contextual_help\").text = \"Click a key binding to reassign it, or press the Cancel action.\"\n\t\tif not event.is_action(\"ui_cancel\"):\n\t\t\t# Display the string corresponding to the pressed key\n\t\t\tvar scancode = OS.get_scancode_string(event.scancode)\n\t\t\tbutton.text = scancode\n\t\t\t# Start by removing previously key binding(s)\n\t\t\tfor old_event in InputMap.get_action_list(action):\n\t\t\t\tInputMap.action_erase_event(action, old_event)\n\t\t\t# Add the new key binding\n\t\t\tInputMap.action_add_event(action, event)\n\t\t\tsave_to_config(\"input\", action, scancode)\n\n\nfunc _ready():\n\t# Load config if existing, if not it will be generated with default values\n\tload_config()\n\t# Initialise each button with the default key binding from InputMap\n\tfor action in INPUT_ACTIONS:\n\t\t# We assume that the key binding that we want is the first one (0), if there are several\n\t\tvar input_event = InputMap.get_action_list(action)[0]\n\t\t# See note at the beginning of the script\n\t\tvar button = get_node(\"bindings\").get_node(action).get_node(\"Button\")\n\t\tbutton.text = OS.get_scancode_string(input_event.scancode)\n\t\tbutton.connect(\"pressed\", self, \"wait_for_input\", [action])\n\t\n\t# Do not start processing input until a button is pressed\n\tset_process_input(false)\n","old_contents":"extends Control\n\n# Note for the reader:\n#\n# This demo conveniently uses the same names for actions and for the container nodes\n# that hold each remapping button. This allow to get back to the button based simply\n# on the name of the corresponding action, but it might not be so simple in your project.\n#\n# A better approach for large-scale input remapping might be to do the connections between\n# buttons and wait_for_input through the code, passing as arguments both the name of the\n# action and the node, e.g.:\n# button.connect(\"pressed\", self, \"wait_for_input\", [ button, action ])\n\n# Constants\nconst INPUT_ACTIONS = [ \"move_up\", \"move_down\", \"move_left\", \"move_right\", \"jump\" ]\nconst CONFIG_FILE = \"user:\/\/input.cfg\"\n\n# Member variables\nvar action # To register the action the UI is currently handling\nvar button # Button node corresponding to the above action\n\n\n# Load\/save input mapping to a config file\n# Changes done while testing the demo will be persistent, saved to CONFIG_FILE\n\nfunc load_config():\n\tvar config = ConfigFile.new()\n\tvar err = config.load(CONFIG_FILE)\n\tif err: # Assuming that file is missing, generate default config\n\t\tfor action_name in INPUT_ACTIONS:\n\t\t\tvar action_list = InputMap.get_action_list(action_name)\n\t\t\t# There could be multiple actions in the list, but we save the first one by default\n\t\t\tvar scancode = OS.get_scancode_string(action_list[0].scancode)\n\t\t\tconfig.set_value(\"input\", action_name, scancode)\n\t\tconfig.save(CONFIG_FILE)\n\telse: # ConfigFile was properly loaded, initialize InputMap\n\t\tfor action_name in config.get_section_keys(\"input\"):\n\t\t\t# Get the key scancode corresponding to the saved human-readable string\n\t\t\tvar scancode = OS.find_scancode_from_string(config.get_value(\"input\", action_name))\n\t\t\t# Create a new event object based on the saved scancode\n\t\t\tvar event = InputEventKey.new()\n\t\t\tevent.scancode = scancode\n\t\t\t# Replace old action (key) events by the new one\n\t\t\tfor old_event in InputMap.get_action_list(action_name):\n\t\t\t\tif old_event is InputEventKey:\n\t\t\t\t\tInputMap.action_erase_event(action_name, old_event)\n\t\t\tInputMap.action_add_event(action_name, event)\n\n\nfunc save_to_config(section, key, value):\n\t\"\"\"Helper function to redefine a parameter in the settings file\"\"\"\n\tvar config = ConfigFile.new()\n\tvar err = config.load(CONFIG_FILE)\n\tif err:\n\t\tprint(\"Error code when loading config file: \", err)\n\telse:\n\t\tconfig.set_value(section, key, value)\n\t\tconfig.save(CONFIG_FILE)\n\n\n# Input management\n\nfunc wait_for_input(action_bind):\n\taction = action_bind\n\t# See note at the beginning of the script\n\tbutton = get_node(\"bindings\").get_node(action).get_node(\"Button\")\n\tget_node(\"contextual_help\").text = \"Press a key to assign to the '\" + action + \"' action.\"\n\tset_process_input(true)\n\n\nfunc _input(event):\n\t# Handle the first pressed key\n\tif event is InputEventKey:\n\t\t# Register the event as handled and stop polling\n\t\tget_tree().set_input_as_handled()\n\t\tset_process_input(false)\n\t\t# Reinitialise the contextual help label\n\t\tget_node(\"contextual_help\").text = \"Click a key binding to reassign it, or press the Cancel action.\"\n\t\tif not event.is_action(\"ui_cancel\"):\n\t\t\t# Display the string corresponding to the pressed key\n\t\t\tvar scancode = OS.get_scancode_string(event.scancode)\n\t\t\tbutton.text = scancode\n\t\t\t# Start by removing previously key binding(s)\n\t\t\tfor old_event in InputMap.get_action_list(action):\n\t\t\t\tInputMap.action_erase_event(action, old_event)\n\t\t\t# Add the new key binding\n\t\t\tInputMap.action_add_event(action, event)\n\t\t\tsave_to_config(\"input\", action, scancode)\n\n\nfunc _ready():\n\t# Load config if existing, if not it will be generated with default values\n\tload_config()\n\t# Initialise each button with the default key binding from InputMap\n\tfor action in INPUT_ACTIONS:\n\t\t# We assume that the key binding that we want is the first one (0), if there are several\n\t\tvar input_event = InputMap.get_action_list(action)[0]\n\t\t# See note at the beginning of the script\n\t\tvar button = get_node(\"bindings\").get_node(action).get_node(\"Button\")\n\t\tbutton.text = OS.get_scancode_string(input_event.scancode)\n\t\tbutton.connect(\"pressed\", self, \"wait_for_input\", [action])\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"62b13f41e12cea6c47c15979488098f05a8416ea","subject":"Fixed typo and standardised spacing","message":"Fixed typo and standardised spacing\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"2d\/pong\/pong.gd","new_file":"2d\/pong\/pong.gd","new_contents":"\nextends Node2D\n\n#member variables here, example:\n#var a=2\n#var b=\"textvar\"\nconst INITIAL_BALL_SPEED = 80\nvar ball_speed = INITIAL_BALL_SPEED\nvar screen_size = Vector2(640,400)\n#default ball direction\nvar direction = Vector2(-1,0)\nvar pad_size = Vector2(8,32)\nconst PAD_SPEED = 150\n\n\nfunc _process(delta):\n\n\n\t#get ball position and pad rectangles\n\tvar ball_pos = get_node(\"ball\").get_pos()\n\tvar left_rect = Rect2( get_node(\"left\").get_pos() - pad_size*0.5, pad_size )\n\tvar right_rect = Rect2( get_node(\"right\").get_pos() - pad_size*0.5, pad_size )\n\t\n\t#integrate new ball postion\n\tball_pos+=direction*ball_speed*delta\n\t\n\t#flip when touching roof or floor\n\tif ( (ball_pos.y<0 and direction.y <0) or (ball_pos.y>screen_size.y and direction.y>0)):\n\t\tdirection.y = -direction.y\n\t\t\n\t#flip, change direction and increase speed when touching pads\t\n\tif ( (left_rect.has_point(ball_pos) and direction.x < 0) or (right_rect.has_point(ball_pos) and direction.x > 0)):\n\t\tdirection.x=-direction.x\n\t\tball_speed*=1.1\n\t\tdirection.y=randf()*2.0-1\n\t\tdirection = direction.normalized()\n\n\t#check gameover\n\tif (ball_pos.x<0 or ball_pos.x>screen_size.x):\n\t\tball_pos=screen_size*0.5\n\t\tball_speed=INITIAL_BALL_SPEED\n\t\tdirection=Vector2(-1,0)\n\t\t\t\n\t\t\t\t\t\t\n\tget_node(\"ball\").set_pos(ball_pos)\n\n\t#move left pad\n\tvar left_pos = get_node(\"left\").get_pos()\n\t\n\tif (left_pos.y > 0 and Input.is_action_pressed(\"left_move_up\")):\n\t\tleft_pos.y+=-PAD_SPEED*delta\n\tif (left_pos.y < screen_size.y and Input.is_action_pressed(\"left_move_down\")):\n\t\tleft_pos.y+=PAD_SPEED*delta\n\t\t\n\tget_node(\"left\").set_pos(left_pos)\n\t\t\n\t#move right pad\t\n\tvar right_pos = get_node(\"right\").get_pos()\n\t\n\tif (right_pos.y > 0 and Input.is_action_pressed(\"right_move_up\")):\n\t\tright_pos.y+=-PAD_SPEED*delta\n\tif (right_pos.y < screen_size.y and Input.is_action_pressed(\"right_move_down\")):\n\t\tright_pos.y+=PAD_SPEED*delta\n\t\t\n\tget_node(\"right\").set_pos(right_pos)\n\t\n\t \n\nfunc _ready():\n\tscreen_size = get_viewport_rect().size #get actual size\n\tpad_size = get_node(\"left\").get_texture().get_size()\n\tset_process(true)\n\n","old_contents":"\nextends Node2D\n\n# member variables here, example:\n# var a=2\n# var b=\"textvar\"\nconst INITIAL_BALL_SPEED = 80\nvar ball_speed = INITIAL_BALL_SPEED\nvar screen_size = Vector2(640,400)\n#default ball direction\nvar direction = Vector2(-1,0)\nvar pad_size = Vector2(8,32)\nconst PAD_SPEED = 150\n\n\nfunc _process(delta):\n\n\n\t# get ball positio and pad rectangles\n\tvar ball_pos = get_node(\"ball\").get_pos()\n\tvar left_rect = Rect2( get_node(\"left\").get_pos() - pad_size*0.5, pad_size )\n\tvar right_rect = Rect2( get_node(\"right\").get_pos() - pad_size*0.5, pad_size )\n\t\n\t#integrate new ball postion\n\tball_pos+=direction*ball_speed*delta\n\t\n\t#flip when touching roof or floor\n\tif ( (ball_pos.y<0 and direction.y <0) or (ball_pos.y>screen_size.y and direction.y>0)):\n\t\tdirection.y = -direction.y\n\t\t\n\t#flip, change direction and increase speed when touching pads\t\n\tif ( (left_rect.has_point(ball_pos) and direction.x < 0) or (right_rect.has_point(ball_pos) and direction.x > 0)):\n\t\tdirection.x=-direction.x\n\t\tball_speed*=1.1\n\t\tdirection.y=randf()*2.0-1\n\t\tdirection = direction.normalized()\n\n\t#check gameover\n\tif (ball_pos.x<0 or ball_pos.x>screen_size.x):\n\t\tball_pos=screen_size*0.5\n\t\tball_speed=INITIAL_BALL_SPEED\n\t\tdirection=Vector2(-1,0)\n\t\t\t\n\t\t\t\t\t\t\n\tget_node(\"ball\").set_pos(ball_pos)\n\n\t#move left pad\t\n\tvar left_pos = get_node(\"left\").get_pos()\n\t\n\tif (left_pos.y > 0 and Input.is_action_pressed(\"left_move_up\")):\n\t\tleft_pos.y+=-PAD_SPEED*delta\n\tif (left_pos.y < screen_size.y and Input.is_action_pressed(\"left_move_down\")):\n\t\tleft_pos.y+=PAD_SPEED*delta\n\t\t\n\tget_node(\"left\").set_pos(left_pos)\n\t\t\n\t#move right pad\t\n\tvar right_pos = get_node(\"right\").get_pos()\n\t\n\tif (right_pos.y > 0 and Input.is_action_pressed(\"right_move_up\")):\n\t\tright_pos.y+=-PAD_SPEED*delta\n\tif (right_pos.y < screen_size.y and Input.is_action_pressed(\"right_move_down\")):\n\t\tright_pos.y+=PAD_SPEED*delta\n\t\t\n\tget_node(\"right\").set_pos(right_pos)\n\t\n\t \n\nfunc _ready():\n\tscreen_size = get_viewport_rect().size # get actual size\n\tpad_size = get_node(\"left\").get_texture().get_size()\n\tset_process(true)\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"1854176e741e7ce71bdb678185678f97f6052447","subject":"Updated documentation","message":"Updated documentation\n","repos":"jesselansdown\/Gurobify,jesselansdown\/Gurobify","old_file":"gap\/Gurobify.gd","new_file":"gap\/Gurobify.gd","new_contents":"# Gurobify: Gurobify provides an interface to Gurobi from GAP.\n#\n# Copyright (c) 2017 - 2021 Jesse Lansdown\n#\n# This Source Code Form is subject to the terms of the Mozilla\n# Public License, v. 2.0. If a copy of the MPL was not distributed\n# with this file, You can obtain one at https:\/\/mozilla.org\/MPL\/2.0\/.\n\n\n\n# Declarations\n#\n\n\nDeclareCategory( \"IsGurobiModel\", IsObject );\n\n\nGurobiObjectFamily := NewFamily( \"GurobiObjectFamily\" );\n\nBindGlobal(\"TheTypeGurobiModel\", NewType( GurobiObjectFamily, IsGurobiModel ));\n\n\nDeclareOperation( \"GurobiNewModel\",\n\t[IsList]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Deleting Constraints\n#! @Arguments Model, ConstraintName\n#! @Returns true\/false\n#! @Description\n#!\tDeletes all constraints with the name ConstraintName\nDeclareOperation(\"GurobiDeleteConstraintsWithName\",\n\t[IsGurobiModel, IsString]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Deleting Constraints\n#! @Arguments Model, ConstraintEquation, ConstraintSense, ConstraintRHSValue[, ConstraintName]\n#! @Returns true\n#! @Description\n#!\tSame as below, except that ConstraintRHS value takes an integer value.\nDeclareOperation( \"GurobiAddConstraint\",\n\t[ IsGurobiModel, IsList, IsString, IsInt, IsString]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Deleting Constraints\n#! @Arguments Model, ConstraintEquation, ConstraintSense, ConstraintRHSValue[, ConstraintName]\n#! @Returns true\n#! @Description\n#!\tAdds a constraint to a gurobi model. ConstraintEquation must be a list, \n#!\tsuch that each entry is the coefficient (including $0$ coefficents) of the corresponding variable\n#! \tin the constraint equation. The ConstraintSense must be one of \"<\", \">\" or \"=\",\n#!\twhere Gurobi interprets < as <= and > as >=. The ConstraintRHSValue is the value on the\n#!\tright hand side of the constraint. A constraint may optionally be given a name, which helps to identify\n#!\tthe constraint if it is to be deleted at some point. If no constraint name is given, then a constraint is\n#!\tsimply assigned the name \"UnNamedConstraint\".\n#!\tNote that a model must be updated or optimised before any additional constraints become effective.\nDeclareOperation( \"GurobiAddConstraint\",\n\t[ IsGurobiModel, IsList, IsString, IsFloat, IsString] );\n\nDeclareOperation( \"GurobiAddConstraint\",\n\t[ IsGurobiModel, IsList, IsString, IsFloat]);\n\nDeclareOperation( \"GurobiAddConstraint\",\n\t[ IsGurobiModel, IsList, IsString, IsInt]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Deleting Constraints\n#! @Arguments Model, ConstraintEquations, ConstraintSenses, ConstraintRHSValues[, ConstraintNames]\n#! @Returns true\n#! @Description\n#!\tAdd multiple constraints to a model at one time. The arguments (except Model)\n#!\tare lists, such that the i-th entries of each list determine a single constraint in\n#!\tthe same manner as for the operation GurobiAddConstraint. ConstraintNames is an optional argument,\n#!\tand must be given for all constraints, or not at all.\n#! If ConstraintSenses and ConstraintRHSValues are all the same, then rather than providing a list, one may\n#! simply provide a single string for the constraint sense and a single float or integer for the right hand side.\nDeclareOperation( \"GurobiAddMultipleConstraints\",\n\t[ IsGurobiModel, IsList, IsList, IsList, IsList] );\n\n#! @Chapter Using Gurobify\n#! @Section Optimising A Model\n#! @Arguments Model\n#! @Returns Solution\n#! @Description\n#!\tDisplay the solution found for a successfuly optimised model. Note that if a solution has not been optimised, is infeasible, or\n#!\tthe optimisation was not completed, then this will return an error. Thus it is advisable to first check the optimisation status.\nDeclareOperation( \"GurobiSolution\",\n\t[ IsGurobiModel] );\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, TimeLimit\n#! @Returns true\n#! @Description\n#!\tSet a time limit for a Gurobi model. Note that TimeLimit should be a float, however an integer value can be given\n#!\twhich will be automatically converted to a float.\nDeclareOperation( \"GurobiSetTimeLimit\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, BestObjectiveBoundStop\n#! @Returns true\n#! @Description\n#!\tOptimisation will terminate if a feasible solution is found with objective value at least as good as BestObjectiveBoundStop.\n#!\tNote that BestObjectiveBoundStop should be a float, however an integer value can be given\n#!\twhich will be automatically converted to a float.\nDeclareOperation( \"GurobiSetBestObjectiveBoundStop\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, CutOff\n#! @Returns true\n#! @Description\n#!\tOptimisation will terminate if the objective value is worse than CutOff.\n#!\tNote that CutOff should be a float, an integer value can be given\n#!\twhich will be automatically converted to a float.\nDeclareOperation( \"GurobiSetCutOff\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Modifying Objective Functions\n#! @Arguments Model\n#! @Returns true\n#! @Description\n#!\tSets the model sense to maximise. When the model is optimised, it will try to maximise the objective function.\nDeclareOperation(\"GurobiMaximiseModel\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Modifying Objective Functions\n#! @Arguments Model\n#! @Returns true\n#! @Description\n#!\tSets the model sense to minimise. When the model is optimised, it will try to minimise the objective function.\nDeclareOperation(\"GurobiMinimiseModel\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Modifying Objective Functions\n#! @Arguments Model, ObjectiveValues\n#! @Returns true\n#! @Description\n#!\tSet the objective function for a model. ObjectiveValues is a list of coefficients (including $0$ coefficeints)\n#!\tcorresponding to each of the variables\nDeclareOperation( \"GurobiSetObjectiveFunction\",\n\t[ IsGurobiModel, IsList] );\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Modifying Objective Functions\n#! @Arguments Model\n#! @Returns List of coefficients of the objective function\n#! @Description\n#!\tView the objective function for a model.\nDeclareOperation( \"GurobiObjectiveFunction\",\n\t[ IsGurobiModel] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns Number of variables\n#! @Description\n#!\tReturns the number of variables in the model.\nDeclareOperation(\"GurobiNumberOfVariables\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns Number of linear constraints\n#! @Description\n#!\tReturns the number of linear constraints in the model.\nDeclareOperation(\"GurobiNumberOfConstraints\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Optimising A Model\n#! @Arguments Model\n#! @Returns objective value\n#! @Description\n#!\tReturns the objective value of the current solution.\nDeclareOperation(\"GurobiObjectiveValue\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns objective bound\n#! @Description\n#!\tReturns the best known bound on the objective value of the model.\nDeclareOperation(\"GurobiObjectiveBound\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns run time of optimisation\n#! @Description\n#!\tReturns the wall clock runtime in seconds for the most recent optimisation.\nDeclareOperation(\"GurobiRunTime\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Optimising A Model\n#! @Arguments Model\n#! @Returns optimisation status code\n#! @Description\n#!\tReturns the optimisation status code of the most recent optimisation. Refer to the Gurobi documentation for more\n#!\ton the optimisation statuses, or alternatively refer to the Appendix of this manual.\nDeclareOperation(\"GurobiOptimisationStatus\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns numeric focus\n#! @Description\n#!\tReturns the numeric focus value of the model. The numeric focus is a value in the set [0,1,2,3]. A numeric focus of $0$ sets the\n#!\tnumeric focus automatically, preferencing speed. Values between 1 and 3 increase the care taken in computations \n#!\tas the value increases, but also take longer. The default value is 0.\nDeclareOperation(\"GurobiNumericFocus\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, NumericFocus\n#! @Returns true\n#! @Description\n#!\tSet the numeric focus for a model. Numeric focus must be in the set [0,1,2,3]. A numeric focus of $0$ sets the\n#!\tnumeric focus automatically, preferencing speed. Values between 1 and 3 increase the care taken in computations \n#!\tas the value increases, but also take longer. The default value is 0.\nDeclareOperation( \"GurobiSetNumericFocus\",\n\t[ IsGurobiModel, IsInt] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns time limit\n#! @Description\n#!\tReturns the time limit for the model. The default value is infinity.\nDeclareOperation(\"GurobiTimeLimit\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns cutoff value\n#! @Description\n#!\tReturns the cutoff value for the model. Optimisation will terminate if the objective value is worse than CutOff.\n#!\tThe default value is infinity for minimisation, and negative infinity for maximisation.\nDeclareOperation(\"GurobiCutOff\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns best objective bound limit value\n#! @Description\n#!\tReturns the best objective bound limit value for the model.\n#!\tOptimisation will terminate if a feasible solution is found with objective value at least as good as the best objective bound.\n#!\tThe default value is negative infinity.\nDeclareOperation(\"GurobiBestObjectiveBoundStop\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, MIPFocus\n#! @Returns true\n#! @Description\n#!\tSet the MIP focus for a model. The mip focus must be in the set [0,1,2,3], and the default value is 0.\n#!\tThe MIP focus alows you to prioritise finding solutions or proving their optimality. See the Gurobi \n#!\tdocumentation for more information.\nDeclareOperation( \"GurobiSetMIPFocus\",\n\t[ IsGurobiModel, IsInt] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns MIP focus\n#! @Description\n#!\tReturns the MIP focus value for the model. The mip focus must be in the set [0,1,2,3], and the default value is 0.\n#!\tThe MIP focus alows you to prioritise finding solutions or proving their optimality. See the Gurobi \n#!\tdocumentation for more information.\nDeclareOperation(\"GurobiMIPFocus\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, BestBdStop\n#! @Returns true\n#! @Description\n#!\tSet the best bound stopping value for a model. Terminates optimisation as soon as the value\n#!\tof the best bound is determined to be at least as good as the best bound stopping value. Default value is infinity.\nDeclareOperation( \"GurobiSetBestBoundStop\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns Best bound stopping value\n#! @Description\n#!\tReturns the best bound stopping value for the model. Optimisation terminates as soon as the value\n#!\tof the best bound is determined to be at least as good as the best bound stopping value. Default value is infinity.\nDeclareOperation(\"GurobiBestBoundStop\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, BestBdStop\n#! @Returns true\n#! @Description\n#!\tSet the limit for the maximum number of MIP solutions to find.\n#!\tDefault value is $2,000,000,000$.\nDeclareOperation( \"GurobiSetSolutionLimit\",\n\t[ IsGurobiModel, IsInt] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns solution limit value\n#! @Description\n#!\tReturns the solution limit value for the model. This value limits the maximum number of MIP solutions that will be found.\n#!\tDefault value is $2,000,000,000$.\nDeclareOperation(\"GurobiSolutionLimit\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, IterationLimit\n#! @Returns true\n#! @Description\n#!\tSet the limit for the maximum number of simplex iterations performed. Default value is infinity.\nDeclareOperation( \"GurobiSetIterationLimit\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns Iteration limit\n#! @Description\n#!\tReturns the iteration limit value for the model, which limits the number of simplex iterations performed during optimisation.\n#!\tDefault value is infinity.\nDeclareOperation(\"GurobiIterationLimit\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, NodeLimit\n#! @Returns true\n#! @Description\n#!\tSet the limit for the maximum number of MIP nodes explored.\n#!\tThe default value is infinity.\nDeclareOperation( \"GurobiSetNodeLimit\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns Node limit\n#! @Description\n#!\tReturns the node limit value for the model, which limits the number of MIP nodes explored during optimisation.\n#!\tThe default value is infinity.\nDeclareOperation(\"GurobiNodeLimit\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns \n#! @Description\n#!\tReturns the names of the variables in the model. This list acts as the index set for\n#!\tany lists of variable coefficients, such as in GurobiAddConstraint or GurobiSetObjectiveFunction.\nDeclareOperation(\"GurobiVariableNames\",\n\t[IsGurobiModel]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Creating Or Reading A Model\n#! @Arguments VariableTypes[, VariableNames]\n#! @Returns A Gurobi model\n#! @Description\n#! Creates a gurobi model with variables defined by VariableTypes. VariableTypes must be a list of strings, \n#!\twhere each entry is the type of the corresponding variable.\n#! Accepted variable types are \"CONTINUOUS\", \"BINARY\", \"INTEGER\", \"SEMICONT\", or \"SEMIINT\". The variable types are not case sensitive.\n#! Refer to the Gurobi documentation for more information on the variable types.\n#! Optionally takes the names of the variables as a list of strings.\n#! If all variables are of the same type, then you may instead give arguments n, v, where n is the number\n#! of variables and v is the variable type.\nDeclareOperation( \"GurobiNewModel\",\n\t[IsList, IsList]);\n\n\n\n#! @Chapter Using Gurobify\n#! @Section Creating Or Reading A Model\n#! @Arguments Model, VariableNames\n#! @Returns true\n#! @Description\n#! Assigns each variable a new name from a list of names. The names must be strings. \nDeclareOperation(\"GurobiSetVariableNames\",\n\t\t[IsGurobiModel, IsList]);\n\n\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, Switch\n#! @Returns true\n#! @Description\n#! Turns console logging on or off. If Switch is true the output of Gurobi will be printed to the screen,\n#!\tand if it is false the output will be supressed. The default for Gurobify is to supress the output.\nDeclareOperation(\"GurobiSetLogToConsole\",\n\t\t[IsGurobiModel, IsBool]);\n\n\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns true\/false\n#! @Description\n#!\tReturns true if the Gurobi output is set to display to the screen, and false if the output is supressed.\n#!\tGurobify suppresses the output by default.\nDeclareOperation(\"GurobiLogToConsole\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Optimising A Model\n#! @Arguments Model, Size\n#! @Returns Set of all solutions.\n#! @Description\n#!\tThis function finds all possible solutions of a given size, for a model with only binary variables.\n#!\tTakes a Gurobi model and repeatedly optimises it, each time adding the previous solution as a\n#!\tconstraint so that it isn't found again. This continues until all solutions are found, and\n#!\tthen they are returned as a set. During the process the number of found solutions is displayed.\n#!\tNote:\n#!\t\t- Only for models where every variable is a binary variable.\n#!\t\t- Only finds solution sets of a given size.\nDeclareOperation(\"GurobiFindAllBinarySolutions\",\n\t[IsGurobiModel, IsPosInt]);\n\n#! @Chapter Using Gurobify\n#! @Section Optimising A Model\n#! @Arguments Model, Size, Group\n#! @Returns Set of all solutions.\n#! @Description\n#!\tThis function finds all possible solutions of a given size, for a model with only binary variables.\n#!\tSame as above, except that it also takes a permutation group acting on the index set of variables.\n#!\tInstead of finding all solutions directly, the group is used to find the orbit of each new\n#!\tsolution, and these are then all returned at the end, and used as constraints until then.\n#!\tAn option value may also be given which will only return the representatives of each orbit of the\n#!\tsolutions. Hence it returns all the unique solutions up to equivalence under the group.\n#!\tThis saves on memory, and the remaing solutions may be refound by generating the\n#!\torbit under the group. To invoke this option place a colon after the group argument and then put\n#!\trepresentatives:=true so for example GurobiFindAllSolutions(model, size, gp : representatives:=true);\nDeclareOperation(\"GurobiFindAllBinarySolutions\",\n\t[IsGurobiModel, IsPosInt, IsGroup]);\n\n#! @Chapter Using Gurobify\n#! @Section Additional Functionality\n#! @Arguments IndexSet, NumberOfIndices\n#! @Returns Characterisitc vector\n#! @Description\n#!\tTakes a list of integers which form a subset of the set [1 .. n], where n is the second argument,\n#!\tand converts the set of indices to its characteristic vector. For example, if n = 5, the set\n#!\t[1,3] would be converted to [1, 0, 1, 0, 0]. It is useful to be able to convert between the two,\n#!\tsince Gurobify always takes the characteristic vector (for example when taking constraints),\n#!\tyet the set of indices is generally more helpful for the user.\nDeclareOperation(\"IndexSetToCharacteristicVector\",\n\t[IsList, IsPosInt]);\n\n#! @Chapter Using Gurobify\n#! @Section Additional Functionality\n#! @Arguments CharacteristicVector\n#! @Returns Characterisitc vector\n#! @Description\n#!\tTakes a characteristic vector and returns the set of indices corresponding to it. This reverses the\n#!\tprocess which occurs with IndexSetToCharacteristicVector. It is particularly useful to convert the\n#!\toutput of a Gurobi solution back in terms of the variables. For example, the characteristic vector\n#!\t[1, 0, 1, 0, 0] would return the index set [1,3]. Note that since the function expects a characteristic \n#!\tvector it doesn't account for any weightings, and is only interested in whether or not the corresponding \n#!\tindex is present, and as such it rounds each entry to the nearest integer and checks that it is non-zero.\n#!\tHence it is particularly suitable for use with binary variables. \nDeclareOperation(\"CharacteristicVectorToIndexSet\",\n\t[IsList]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Additional Functionality\n#! @Arguments Subset, FullSet\n#! @Returns Characterisitc vector\n#! @Description\n#!\tTakes a subset of some set, and returns the characteristic vector where the entries of the characteristic\n#!\tvector are indexed by the full set. For example, the subset [\"c\"] of [\"a\", \"c\", \"n\", \"q\"] would give the \n#!\tcharacteristic vector [0, 1, 0, 0]. This removes the need to first find the index set of the subset.\nDeclareOperation(\"SubsetToCharacteristicVector\",\n\t[IsList, IsList]);\n\n#! @Chapter Using Gurobify\n#! @Section Additional Functionality\n#! @Arguments CharacteristicVector\n#! @Returns Characterisitc vector\n#! @Description\n#!\tTakes a characteristic vector and some set which it takes to be indexing the entries of the characteristic \n#!\tvector. It then returns the subset of the full set corresponding to the non-zero entries of the characteristic \n#!\tvector. This is the reverse process to SubsetToCharacteristicVector. Note again that the characteristic vector \n#!\tis rounded to an integer before being compared to 0. As an example, the characteristic vector [0, 1, 0, 0] with \n#!\tthe set [\"a\", \"c\", \"n\", \"q\"] would return [\"c\"]. This removes the need to first return an index set before \n#!\tfinding the subset.\nDeclareOperation(\"CharacteristicVectorToSubset\",\n\t[IsList, IsList]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns \n#! @Description\n#!\tReturns the types of the variables in the model.\nDeclareOperation(\"GurobiVariableTypes\",\n\t[IsGurobiModel]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, MethodType\n#! @Returns true\n#! @Description\n#!\tSet the method used to solve a model. \n#!\t-1=automatic (this is the default),\n#!\t0=primal simplex,\n#!\t1=dual simplex,\n#!\t2=barrier,\n#!\t3=concurrent,\n#!\t4=deterministic concurrent,\n#!\t5=deterministic concurrent simplex.\n#!\tSee the Gurobi documentation for more details.\nDeclareOperation( \"GurobiSetMethod\",\n\t[ IsGurobiModel, IsInt] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns MethodType\n#! @Description\n#!\tReturns the method used to solve a model. See the Gurobi documentation for more details.\nDeclareOperation(\"GurobiMethod\",\n\t[IsGurobiModel]);\n\n\n\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, ThreadCount\n#! @Returns true\n#! @Description\n#!\tSet the number of threads Gurobi is allowed to use. The default value is 0,\n#!\twhich will use as many cores as it wants. See the Gurobi documentation for more details.\nDeclareOperation( \"GurobiSetThreads\",\n\t[ IsGurobiModel, IsInt] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns ThreadCount\n#! @Description\n#!\tReturns number of threads Gurobi is allowed to use. See the Gurobi documentation for more details.\nDeclareOperation(\"GurobiThreads\",\n\t[IsGurobiModel]);\n","old_contents":"# Gurobify: Gurobify provides an interface to Gurobi from GAP.\n#\n# Copyright (c) 2017 - 2021 Jesse Lansdown\n#\n# This Source Code Form is subject to the terms of the Mozilla\n# Public License, v. 2.0. If a copy of the MPL was not distributed\n# with this file, You can obtain one at https:\/\/mozilla.org\/MPL\/2.0\/.\n\n\n\n# Declarations\n#\n\n\nDeclareCategory( \"IsGurobiModel\", IsObject );\n\n\nGurobiObjectFamily := NewFamily( \"GurobiObjectFamily\" );\n\nBindGlobal(\"TheTypeGurobiModel\", NewType( GurobiObjectFamily, IsGurobiModel ));\n\n\nDeclareOperation( \"GurobiNewModel\",\n\t[IsList]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Deleting Constraints\n#! @Arguments Model, ConstraintName\n#! @Returns true\/false\n#! @Description\n#!\tDeletes all constraints with the name ConstraintName\nDeclareOperation(\"GurobiDeleteConstraintsWithName\",\n\t[IsGurobiModel, IsString]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Deleting Constraints\n#! @Arguments Model, ConstraintEquation, ConstraintSense, ConstraintRHSValue[, ConstraintName]\n#! @Returns true\n#! @Description\n#!\tSame as below, except that ConstraintRHS value takes an integer value.\nDeclareOperation( \"GurobiAddConstraint\",\n\t[ IsGurobiModel, IsList, IsString, IsInt, IsString]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Deleting Constraints\n#! @Arguments Model, ConstraintEquation, ConstraintSense, ConstraintRHSValue[, ConstraintName]\n#! @Returns true\n#! @Description\n#!\tAdds a constraint to a gurobi model. ConstraintEquation must be a list, \n#!\tsuch that each entry is the coefficient (including $0$ coefficents) of the corresponding variable\n#! \tin the constraint equation. The ConstraintSense must be one of \"<\", \">\" or \"=\",\n#!\twhere Gurobi interprets < as <= and > as >=. The ConstraintRHSValue is the value on the\n#!\tright hand side of the constraint. A constraint may optionally be given a name, which helps to identify\n#!\tthe constraint if it is to be deleted at some point. If no constraint name is given, then a constraint is\n#!\tsimply assigned the name \"UnNamedConstraint\".\n#!\tNote that a model must be updated or optimised before any additional constraints become effective.\nDeclareOperation( \"GurobiAddConstraint\",\n\t[ IsGurobiModel, IsList, IsString, IsFloat, IsString] );\n\nDeclareOperation( \"GurobiAddConstraint\",\n\t[ IsGurobiModel, IsList, IsString, IsFloat]);\n\nDeclareOperation( \"GurobiAddConstraint\",\n\t[ IsGurobiModel, IsList, IsString, IsInt]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Deleting Constraints\n#! @Arguments Model, ConstraintEquations, ConstraintSenses, ConstraintRHSValues[, ConstraintNames]\n#! @Returns true\n#! @Description\n#!\tAdd multiple constraints to a model at one time. The arguments (except Model)\n#!\tare lists, such that the i-th entries of each list determine a single constraint in\n#!\tthe same manner as for the operation GurobiAddConstraint. ConstraintNames is an optional argument,\n#!\tand must be given for all constraints, or not at all.\nDeclareOperation( \"GurobiAddMultipleConstraints\",\n\t[ IsGurobiModel, IsList, IsList, IsList, IsList] );\n\n#! @Chapter Using Gurobify\n#! @Section Optimising A Model\n#! @Arguments Model\n#! @Returns Solution\n#! @Description\n#!\tDisplay the solution found for a successfuly optimised model. Note that if a solution has not been optimised, is infeasible, or\n#!\tthe optimisation was not completed, then this will return an error. Thus it is advisable to first check the optimisation status.\nDeclareOperation( \"GurobiSolution\",\n\t[ IsGurobiModel] );\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, TimeLimit\n#! @Returns true\n#! @Description\n#!\tSet a time limit for a Gurobi model. Note that TimeLimit should be a float, however an integer value can be given\n#!\twhich will be automatically converted to a float.\nDeclareOperation( \"GurobiSetTimeLimit\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, BestObjectiveBoundStop\n#! @Returns true\n#! @Description\n#!\tOptimisation will terminate if a feasible solution is found with objective value at least as good as BestObjectiveBoundStop.\n#!\tNote that BestObjectiveBoundStop should be a float, however an integer value can be given\n#!\twhich will be automatically converted to a float.\nDeclareOperation( \"GurobiSetBestObjectiveBoundStop\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, CutOff\n#! @Returns true\n#! @Description\n#!\tOptimisation will terminate if the objective value is worse than CutOff.\n#!\tNote that CutOff should be a float, an integer value can be given\n#!\twhich will be automatically converted to a float.\nDeclareOperation( \"GurobiSetCutOff\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Modifying Objective Functions\n#! @Arguments Model\n#! @Returns true\n#! @Description\n#!\tSets the model sense to maximise. When the model is optimised, it will try to maximise the objective function.\nDeclareOperation(\"GurobiMaximiseModel\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Modifying Objective Functions\n#! @Arguments Model\n#! @Returns true\n#! @Description\n#!\tSets the model sense to minimise. When the model is optimised, it will try to minimise the objective function.\nDeclareOperation(\"GurobiMinimiseModel\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Modifying Objective Functions\n#! @Arguments Model, ObjectiveValues\n#! @Returns true\n#! @Description\n#!\tSet the objective function for a model. ObjectiveValues is a list of coefficients (including $0$ coefficeints)\n#!\tcorresponding to each of the variables\nDeclareOperation( \"GurobiSetObjectiveFunction\",\n\t[ IsGurobiModel, IsList] );\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Modifying Objective Functions\n#! @Arguments Model\n#! @Returns List of coefficients of the objective function\n#! @Description\n#!\tView the objective function for a model.\nDeclareOperation( \"GurobiObjectiveFunction\",\n\t[ IsGurobiModel] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns Number of variables\n#! @Description\n#!\tReturns the number of variables in the model.\nDeclareOperation(\"GurobiNumberOfVariables\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns Number of linear constraints\n#! @Description\n#!\tReturns the number of linear constraints in the model.\nDeclareOperation(\"GurobiNumberOfConstraints\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Optimising A Model\n#! @Arguments Model\n#! @Returns objective value\n#! @Description\n#!\tReturns the objective value of the current solution.\nDeclareOperation(\"GurobiObjectiveValue\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns objective bound\n#! @Description\n#!\tReturns the best known bound on the objective value of the model.\nDeclareOperation(\"GurobiObjectiveBound\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns run time of optimisation\n#! @Description\n#!\tReturns the wall clock runtime in seconds for the most recent optimisation.\nDeclareOperation(\"GurobiRunTime\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Optimising A Model\n#! @Arguments Model\n#! @Returns optimisation status code\n#! @Description\n#!\tReturns the optimisation status code of the most recent optimisation. Refer to the Gurobi documentation for more\n#!\ton the optimisation statuses, or alternatively refer to the Appendix of this manual.\nDeclareOperation(\"GurobiOptimisationStatus\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns numeric focus\n#! @Description\n#!\tReturns the numeric focus value of the model. The numeric focus is a value in the set [0,1,2,3]. A numeric focus of $0$ sets the\n#!\tnumeric focus automatically, preferencing speed. Values between 1 and 3 increase the care taken in computations \n#!\tas the value increases, but also take longer. The default value is 0.\nDeclareOperation(\"GurobiNumericFocus\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, NumericFocus\n#! @Returns true\n#! @Description\n#!\tSet the numeric focus for a model. Numeric focus must be in the set [0,1,2,3]. A numeric focus of $0$ sets the\n#!\tnumeric focus automatically, preferencing speed. Values between 1 and 3 increase the care taken in computations \n#!\tas the value increases, but also take longer. The default value is 0.\nDeclareOperation( \"GurobiSetNumericFocus\",\n\t[ IsGurobiModel, IsInt] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns time limit\n#! @Description\n#!\tReturns the time limit for the model. The default value is infinity.\nDeclareOperation(\"GurobiTimeLimit\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns cutoff value\n#! @Description\n#!\tReturns the cutoff value for the model. Optimisation will terminate if the objective value is worse than CutOff.\n#!\tThe default value is infinity for minimisation, and negative infinity for maximisation.\nDeclareOperation(\"GurobiCutOff\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns best objective bound limit value\n#! @Description\n#!\tReturns the best objective bound limit value for the model.\n#!\tOptimisation will terminate if a feasible solution is found with objective value at least as good as the best objective bound.\n#!\tThe default value is negative infinity.\nDeclareOperation(\"GurobiBestObjectiveBoundStop\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, MIPFocus\n#! @Returns true\n#! @Description\n#!\tSet the MIP focus for a model. The mip focus must be in the set [0,1,2,3], and the default value is 0.\n#!\tThe MIP focus alows you to prioritise finding solutions or proving their optimality. See the Gurobi \n#!\tdocumentation for more information.\nDeclareOperation( \"GurobiSetMIPFocus\",\n\t[ IsGurobiModel, IsInt] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns MIP focus\n#! @Description\n#!\tReturns the MIP focus value for the model. The mip focus must be in the set [0,1,2,3], and the default value is 0.\n#!\tThe MIP focus alows you to prioritise finding solutions or proving their optimality. See the Gurobi \n#!\tdocumentation for more information.\nDeclareOperation(\"GurobiMIPFocus\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, BestBdStop\n#! @Returns true\n#! @Description\n#!\tSet the best bound stopping value for a model. Terminates optimisation as soon as the value\n#!\tof the best bound is determined to be at least as good as the best bound stopping value. Default value is infinity.\nDeclareOperation( \"GurobiSetBestBoundStop\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns Best bound stopping value\n#! @Description\n#!\tReturns the best bound stopping value for the model. Optimisation terminates as soon as the value\n#!\tof the best bound is determined to be at least as good as the best bound stopping value. Default value is infinity.\nDeclareOperation(\"GurobiBestBoundStop\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, BestBdStop\n#! @Returns true\n#! @Description\n#!\tSet the limit for the maximum number of MIP solutions to find.\n#!\tDefault value is $2,000,000,000$.\nDeclareOperation( \"GurobiSetSolutionLimit\",\n\t[ IsGurobiModel, IsInt] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns solution limit value\n#! @Description\n#!\tReturns the solution limit value for the model. This value limits the maximum number of MIP solutions that will be found.\n#!\tDefault value is $2,000,000,000$.\nDeclareOperation(\"GurobiSolutionLimit\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, IterationLimit\n#! @Returns true\n#! @Description\n#!\tSet the limit for the maximum number of simplex iterations performed. Default value is infinity.\nDeclareOperation( \"GurobiSetIterationLimit\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns Iteration limit\n#! @Description\n#!\tReturns the iteration limit value for the model, which limits the number of simplex iterations performed during optimisation.\n#!\tDefault value is infinity.\nDeclareOperation(\"GurobiIterationLimit\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, NodeLimit\n#! @Returns true\n#! @Description\n#!\tSet the limit for the maximum number of MIP nodes explored.\n#!\tThe default value is infinity.\nDeclareOperation( \"GurobiSetNodeLimit\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns Node limit\n#! @Description\n#!\tReturns the node limit value for the model, which limits the number of MIP nodes explored during optimisation.\n#!\tThe default value is infinity.\nDeclareOperation(\"GurobiNodeLimit\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns \n#! @Description\n#!\tReturns the names of the variables in the model. This list acts as the index set for\n#!\tany lists of variable coefficients, such as in GurobiAddConstraint or GurobiSetObjectiveFunction.\nDeclareOperation(\"GurobiVariableNames\",\n\t[IsGurobiModel]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Creating Or Reading A Model\n#! @Arguments VariableTypes[, VariableNames]\n#! @Returns A Gurobi model\n#! @Description\n#! Creates a gurobi model with variables defined by VariableTypes. VariableTypes must be a list of strings, \n#!\twhere each entry is the type of the corresponding variable.\n#! Accepted variable types are \"CONTINUOUS\", \"BINARY\", \"INTEGER\", \"SEMICONT\", or \"SEMIINT\". The variable types are not case sensitive.\n#! Refer to the Gurobi documentation for more information on the variable types.\n#! Optionally takes the names of the variables as a list of strings.\nDeclareOperation( \"GurobiNewModel\",\n\t[IsList, IsList]);\n\n\n\n#! @Chapter Using Gurobify\n#! @Section Creating Or Reading A Model\n#! @Arguments Model, VariableNames\n#! @Returns true\n#! @Description\n#! Assigns each variable a new name from a list of names. The names must be strings. \nDeclareOperation(\"GurobiSetVariableNames\",\n\t\t[IsGurobiModel, IsList]);\n\n\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, Switch\n#! @Returns true\n#! @Description\n#! Turns console logging on or off. If Switch is true the output of Gurobi will be printed to the screen,\n#!\tand if it is false the output will be supressed. The default for Gurobify is to supress the output.\nDeclareOperation(\"GurobiSetLogToConsole\",\n\t\t[IsGurobiModel, IsBool]);\n\n\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns true\/false\n#! @Description\n#!\tReturns true if the Gurobi output is set to display to the screen, and false if the output is supressed.\n#!\tGurobify suppresses the output by default.\nDeclareOperation(\"GurobiLogToConsole\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Optimising A Model\n#! @Arguments Model, Size\n#! @Returns Set of all solutions.\n#! @Description\n#!\tThis function finds all possible solutions of a given size, for a model with only binary variables.\n#!\tTakes a Gurobi model and repeatedly optimises it, each time adding the previous solution as a\n#!\tconstraint so that it isn't found again. This continues until all solutions are found, and\n#!\tthen they are returned as a set. During the process the number of found solutions is displayed.\n#!\tNote:\n#!\t\t- Only for models where every variable is a binary variable.\n#!\t\t- Only finds solution sets of a given size.\nDeclareOperation(\"GurobiFindAllBinarySolutions\",\n\t[IsGurobiModel, IsPosInt]);\n\n#! @Chapter Using Gurobify\n#! @Section Optimising A Model\n#! @Arguments Model, Size, Group\n#! @Returns Set of all solutions.\n#! @Description\n#!\tThis function finds all possible solutions of a given size, for a model with only binary variables.\n#!\tSame as above, except that it also takes a permutation group acting on the index set of variables.\n#!\tInstead of finding all solutions directly, the group is used to find the orbit of each new\n#!\tsolution, and these are then all returned at the end, and used as constraints until then.\n#!\tAn option value may also be given which will only return the representatives of each orbit of the\n#!\tsolutions. Hence it returns all the unique solutions up to equivalence under the group.\n#!\tThis saves on memory, and the remaing solutions may be refound by generating the\n#!\torbit under the group. To invoke this option place a colon after the group argument and then put\n#!\trepresentatives:=true so for example GurobiFindAllSolutions(model, size, gp : representatives:=true);\nDeclareOperation(\"GurobiFindAllBinarySolutions\",\n\t[IsGurobiModel, IsPosInt, IsGroup]);\n\n#! @Chapter Using Gurobify\n#! @Section Additional Functionality\n#! @Arguments IndexSet, NumberOfIndices\n#! @Returns Characterisitc vector\n#! @Description\n#!\tTakes a list of integers which form a subset of the set [1 .. n], where n is the second argument,\n#!\tand converts the set of indices to its characteristic vector. For example, if n = 5, the set\n#!\t[1,3] would be converted to [1, 0, 1, 0, 0]. It is useful to be able to convert between the two,\n#!\tsince Gurobify always takes the characteristic vector (for example when taking constraints),\n#!\tyet the set of indices is generally more helpful for the user.\nDeclareOperation(\"IndexSetToCharacteristicVector\",\n\t[IsList, IsPosInt]);\n\n#! @Chapter Using Gurobify\n#! @Section Additional Functionality\n#! @Arguments CharacteristicVector\n#! @Returns Characterisitc vector\n#! @Description\n#!\tTakes a characteristic vector and returns the set of indices corresponding to it. This reverses the\n#!\tprocess which occurs with IndexSetToCharacteristicVector. It is particularly useful to convert the\n#!\toutput of a Gurobi solution back in terms of the variables. For example, the characteristic vector\n#!\t[1, 0, 1, 0, 0] would return the index set [1,3]. Note that since the function expects a characteristic \n#!\tvector it doesn't account for any weightings, and is only interested in whether or not the corresponding \n#!\tindex is present, and as such it rounds each entry to the nearest integer and checks that it is non-zero.\n#!\tHence it is particularly suitable for use with binary variables. \nDeclareOperation(\"CharacteristicVectorToIndexSet\",\n\t[IsList]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Additional Functionality\n#! @Arguments Subset, FullSet\n#! @Returns Characterisitc vector\n#! @Description\n#!\tTakes a subset of some set, and returns the characteristic vector where the entries of the characteristic\n#!\tvector are indexed by the full set. For example, the subset [\"c\"] of [\"a\", \"c\", \"n\", \"q\"] would give the \n#!\tcharacteristic vector [0, 1, 0, 0]. This removes the need to first find the index set of the subset.\nDeclareOperation(\"SubsetToCharacteristicVector\",\n\t[IsList, IsList]);\n\n#! @Chapter Using Gurobify\n#! @Section Additional Functionality\n#! @Arguments CharacteristicVector\n#! @Returns Characterisitc vector\n#! @Description\n#!\tTakes a characteristic vector and some set which it takes to be indexing the entries of the characteristic \n#!\tvector. It then returns the subset of the full set corresponding to the non-zero entries of the characteristic \n#!\tvector. This is the reverse process to SubsetToCharacteristicVector. Note again that the characteristic vector \n#!\tis rounded to an integer before being compared to 0. As an example, the characteristic vector [0, 1, 0, 0] with \n#!\tthe set [\"a\", \"c\", \"n\", \"q\"] would return [\"c\"]. This removes the need to first return an index set before \n#!\tfinding the subset.\nDeclareOperation(\"CharacteristicVectorToSubset\",\n\t[IsList, IsList]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns \n#! @Description\n#!\tReturns the types of the variables in the model.\nDeclareOperation(\"GurobiVariableTypes\",\n\t[IsGurobiModel]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, MethodType\n#! @Returns true\n#! @Description\n#!\tSet the method used to solve a model. \n#!\t-1=automatic (this is the default),\n#!\t0=primal simplex,\n#!\t1=dual simplex,\n#!\t2=barrier,\n#!\t3=concurrent,\n#!\t4=deterministic concurrent,\n#!\t5=deterministic concurrent simplex.\n#!\tSee the Gurobi documentation for more details.\nDeclareOperation( \"GurobiSetMethod\",\n\t[ IsGurobiModel, IsInt] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns MethodType\n#! @Description\n#!\tReturns the method used to solve a model. See the Gurobi documentation for more details.\nDeclareOperation(\"GurobiMethod\",\n\t[IsGurobiModel]);\n\n\n\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, ThreadCount\n#! @Returns true\n#! @Description\n#!\tSet the number of threads Gurobi is allowed to use. The default value is 0,\n#!\twhich will use as many cores as it wants. See the Gurobi documentation for more details.\nDeclareOperation( \"GurobiSetThreads\",\n\t[ IsGurobiModel, IsInt] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns ThreadCount\n#! @Description\n#!\tReturns number of threads Gurobi is allowed to use. See the Gurobi documentation for more details.\nDeclareOperation(\"GurobiThreads\",\n\t[IsGurobiModel]);\n","returncode":0,"stderr":"","license":"mpl-2.0","lang":"GDScript"} {"commit":"ba6f4a217f8543805fc01680d409ea4db9f16a0b","subject":"better dialog logic. pause game. work during pause.","message":"better dialog logic. pause game. work during pause.\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Editor.gd","new_file":"src\/scripts\/Editor.gd","new_contents":"extends Spatial\n\nvar puzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar puzzle\nvar puzzleMan\n\nvar gridMan\nvar prevBlock = null\n\nvar fileDialog = load(\"res:\/\/fileDialog.scn\").instance()\nvar gui = [\n\t[\"status\", Label.new()], # plz keep me as first element, referenced as gui[0] later\n\t[\"save_pzl\", Button.new()],\n\t[\"load_pzl\", Button.new()],\n\t[\"remove_layer\", Button.new()],\n\t[\"random_layer\", Button.new()],\n\t# THESE SHOULD BE Options instead of left, label, right\n\t[\"class_toggle\", {\n\t\tleft=Button.new(),\n\t\tright=Button.new(),\n\t\tlabel=Label.new(),\n\t\tvalues=[\"LZR\", \"WILD\", \"PAIR\", \"GOAL\"],\n\t\tvalue=\"PAIR\"\n\t}],\n\t[\"color_toggle\", {\n\t\tleft=Button.new(),\n\t\tright=Button.new(),\n\t\tlabel=Label.new(),\n\t\tvalues=preload(\"res:\/\/scripts\/PuzzleManager.gd\").blockColors,\n\t\tvalue=\"Red\"\n\t}],\n\t[\"action_toggle\", {\n\t\tleft=Button.new(),\n\t\tright=Button.new(),\n\t\tlabel=Label.new(),\n\t\tvalues=[\"Add\", \"Remove\", \"Replace\"],\n\t\tvalue=\"Add\"\n\t}],\n\t[\"test_pzl\", Button.new()],\n]\n\nfunc shouldAddNeighbor():\n\treturn true\n\nfunc shouldReplaceSelf():\n\treturn false\n\nfunc shouldRemoveSelf():\n\treturn false\n\nfunc newPickledBlock():\n\tvar b = puzzleMan.PickledBlock.new()\\\n\t\t.setName(gridMan.shape.keys().size())\\\n\tif prevBlock != null:\n\t\tb.setPairName(prevBlock.name)\n\t\tgridMan.get_node(prevBlock.toNode().name).setPairName(b.name)\n\t\tprevBlock = null\n\t\tgui[0][1].set_text(\"STATUS: ERROR, ADD PAIR\")\n\telse:\n\t\tprevBlock = b\n\t\tgui[0][1].set_text(\"STATUS: NOMINAL\")\n\treturn b\n\nfunc updateToggle(togg, increase):\n\tif increase:\n\t\tvar next_ix = togg.values.find(togg.value) + 1\n\t\tif (next_ix >= togg.values.size()):\n\t\t\tnext_ix = 0\n\t\ttogg.value = togg.values[next_ix]\n\telse:\n\t\tvar next_ix = togg.values.find(togg.value) - 1\n\t\tif (next_ix < 0):\n\t\t\tnext_ix = togg.values.size() - 1\n\t\ttogg.value = togg.values[next_ix]\n\ttogg.label.set_text(togg.value)\n\nfunc showFileDialog(loadInstead=false):\n\tget_tree().set_pause(true)\n\tfileDialog.popup_centered()\n\t\n\tif loadInstead:\n\t\tfileDialog.connect(\"confirmed\", self, \"puzzleLoad\")\n\telse:\n\t\tfileDialog.connect(\"confirmed\", self, \"puzzleSave\")\n\t\nfunc puzzleSave():\n\tprint(\"SAVING TO \", fileDialog.get_current_file() )\n\tget_tree().set_pause(false)\n\nfunc puzzleLoad():\n\tprint(\"LOADING FROM \", fileDialog.get_current_file() )\n\tget_tree().set_pause(false)\n\nfunc _ready():\n\tpuzzle = puzzleScn.instance()\n\tgridMan = puzzle.get_node(\"GridView\/GridMan\")\n\tpuzzle.mainPuzzle = false\n\t\n\t# hide and disable timer\n\tpuzzle.time.on = false;\n\tpuzzle.time.val = ''\n\t\n\tpuzzle.set_as_toplevel(true)\n\n\tadd_child(puzzle)\n\t\n\tprint(puzzle.get_tree() == get_tree())\n\tpuzzleMan = puzzle.puzzleMan\n\n\tset_process_input(true)\n\n\tvar theme = preload(\"res:\/\/themes\/MainTheme.thm\")\n\t\n\n\tfileDialog.set_title(\"Select Puzzle Filename\")\n\tfileDialog.set_access(FileDialog.ACCESS_USERDATA)\n\t\n\t# MainTheme leaks on bottom\n\tvar dialogTheme = Theme.new()\n\tdialogTheme.copy_default_theme()\n\tfileDialog.set_theme(dialogTheme)\n\t\n\t# work even if game is paused\n\tfileDialog.set_pause_mode(PAUSE_MODE_PROCESS)\n\n\t# unpause if user cancels\n\tfileDialog.connect(\"popup_hide\", get_tree(), \"set_pause\", [false])\n\tfileDialog.hide()\n\tadd_child(fileDialog)\n\t\n\tvar y = 0\n\tfor control in gui:\n\t\ty += 45\n\t\tif control[0].rfind('_toggle') > 0:\n\t\t\tvar togg = control[1]\n\t\t\tfor cont in togg.keys():\n\t\t\t\tif not cont.begins_with('value'):\n\t\t\t\t\tvar e = togg[cont]\n\t\t\t\t\te.set_pos(Vector2(10, y))\n\t\t\t\t\te.set_theme(theme)\n\t\t\t\t\tadd_child(e)\n\n\t\t\ttogg.left.set_text(\"<\")\n\t\t\ttogg.left.connect('pressed', self, 'updateToggle', [togg, false])\n\n\t\t\ttogg.label.set_pos(Vector2(90, y + 4))\n\t\t\ttogg.label.set_text(togg.value)\n\n\t\t\ttogg.right.set_pos(Vector2(55, y))\n\t\t\ttogg.right.set_text(\">\")\n\t\t\ttogg.right.connect('pressed', self, 'updateToggle', [togg, true])\n\n\t\telse:\n\t\t\tvar e = control[1]\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tif e extends Button:\n\t\t\t\te.set_text(control[0])\n\t\t\tif control[0] == 'save_pzl' :\n\t\t\t\te.connect('pressed', self, 'showFileDialog')\n\t\t\tif control[0] == 'load_pzl' :\n\t\t\t\te.connect('pressed', self, 'showFileDialog', [true])\n\t\t\tif control[0] == 'status':\n\t\t\t\tcontrol[1].set_text('STATUS: NOMINAL')\n\t\t\tadd_child(e)\n\n\n","old_contents":"extends Spatial\n\nvar puzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar puzzle\nvar puzzleMan\n\nvar gridMan\nvar prevBlock = null\n\nvar fileDialog = load(\"res:\/\/fileDialog.scn\").instance()\nvar gui = [\n\t[\"status\", Label.new()], # plz keep me as first element, referenced as gui[0] later\n\t[\"save_pzl\", Button.new()],\n\t[\"load_pzl\", Button.new()],\n\t[\"remove_layer\", Button.new()],\n\t[\"random_layer\", Button.new()],\n\t# THESE SHOULD BE Options instead of left, label, right\n\t[\"class_toggle\", {\n\t\tleft=Button.new(),\n\t\tright=Button.new(),\n\t\tlabel=Label.new(),\n\t\tvalues=[\"LZR\", \"WILD\", \"PAIR\", \"GOAL\"],\n\t\tvalue=\"PAIR\"\n\t}],\n\t[\"color_toggle\", {\n\t\tleft=Button.new(),\n\t\tright=Button.new(),\n\t\tlabel=Label.new(),\n\t\tvalues=preload(\"res:\/\/scripts\/PuzzleManager.gd\").blockColors,\n\t\tvalue=\"Red\"\n\t}],\n\t[\"action_toggle\", {\n\t\tleft=Button.new(),\n\t\tright=Button.new(),\n\t\tlabel=Label.new(),\n\t\tvalues=[\"Add\", \"Remove\", \"Replace\"],\n\t\tvalue=\"Add\"\n\t}],\n\t[\"test_pzl\", Button.new()],\n]\n\nfunc shouldAddNeighbor():\n\treturn true\n\nfunc shouldReplaceSelf():\n\treturn false\n\nfunc shouldRemoveSelf():\n\treturn false\n\nfunc newPickledBlock():\n\tvar b = puzzleMan.PickledBlock.new()\\\n\t\t.setName(gridMan.shape.keys().size())\\\n\tif prevBlock != null:\n\t\tb.setPairName(prevBlock.name)\n\t\tgridMan.get_node(prevBlock.toNode().name).setPairName(b.name)\n\t\tprevBlock = null\n\t\tgui[0][1].set_text(\"STATUS: ERROR, ADD PAIR\")\n\telse:\n\t\tprevBlock = b\n\t\tgui[0][1].set_text(\"STATUS: NOMINAL\")\n\treturn b\n\nfunc updateToggle(togg, increase):\n\tif increase:\n\t\tvar next_ix = togg.values.find(togg.value) + 1\n\t\tif (next_ix >= togg.values.size()):\n\t\t\tnext_ix = 0\n\t\ttogg.value = togg.values[next_ix]\n\telse:\n\t\tvar next_ix = togg.values.find(togg.value) - 1\n\t\tif (next_ix < 0):\n\t\t\tnext_ix = togg.values.size() - 1\n\t\ttogg.value = togg.values[next_ix]\n\ttogg.label.set_text(togg.value)\n\nfunc puzzleSave(loadInstead=false):\n\tfileDialog.popup_centered()\n\n\n\nfunc _ready():\n\tpuzzle = puzzleScn.instance()\n\tgridMan = puzzle.get_node(\"GridView\/GridMan\")\n\tpuzzle.mainPuzzle = false\n\tpuzzle.time.on = false;\n\tpuzzle.time.val = ''\n\tpuzzle.set_as_toplevel(true)\n\n\tadd_child(puzzle)\n\tpuzzleMan = puzzle.puzzleMan\n\n\tset_process_input(true)\n\n\tvar theme = preload(\"res:\/\/themes\/MainTheme.thm\")\n\tvar dialogTheme = Theme.new()\n\tdialogTheme.copy_default_theme()\n\n\tfileDialog.set_title(\"Select Puzzle Filename\")\n\tfileDialog.set_access(FileDialog.ACCESS_USERDATA)\n\tfileDialog.set_theme(dialogTheme)\n\tfileDialog.hide()\n\tadd_child(fileDialog)\n\t\n\tvar y = 0\n\tfor control in gui:\n\t\ty += 45\n\t\tif control[0].rfind('_toggle') > 0:\n\t\t\tvar togg = control[1]\n\t\t\tfor cont in togg.keys():\n\t\t\t\tif not cont.begins_with('value'):\n\t\t\t\t\tvar e = togg[cont]\n\t\t\t\t\te.set_pos(Vector2(10, y))\n\t\t\t\t\te.set_theme(theme)\n\t\t\t\t\tadd_child(e)\n\n\t\t\ttogg.left.set_text(\"<\")\n\t\t\ttogg.left.connect('pressed', self, 'updateToggle', [togg, false])\n\n\t\t\ttogg.label.set_pos(Vector2(90, y + 4))\n\t\t\ttogg.label.set_text(togg.value)\n\n\t\t\ttogg.right.set_pos(Vector2(55, y))\n\t\t\ttogg.right.set_text(\">\")\n\t\t\ttogg.right.connect('pressed', self, 'updateToggle', [togg, true])\n\n\t\telse:\n\t\t\tvar e = control[1]\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tif e extends Button:\n\t\t\t\te.set_text(control[0])\n\t\t\tif control[0] == 'save_pzl' :\n\t\t\t\te.connect('pressed', self, 'puzzleSave')\n\t\t\tif control[0] == 'load_pzl' :\n\t\t\t\te.connect('pressed', self, 'puzzleSave', [true])\n\t\t\tif control[0] == 'status':\n\t\t\t\tcontrol[1].set_text('STATUS: NOMINAL')\n\t\t\tadd_child(e)\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"9a961de45e00d30735239b0a75a6f1cd79a6965d","subject":"saner initialization","message":"saner initialization\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Puzzle.gd","new_file":"src\/scripts\/Puzzle.gd","new_contents":"extends Spatial\n\n# proposed script manager:\n# var PuzzleManScript = get_node(\"Globals\").get(\"PuzzleManScript\")\n\nvar DataMan = preload( \"res:\/\/scripts\/DataManager.gd\" ).new()\nvar PuzzleManScript = preload( \"res:\/\/scripts\/PuzzleManager.gd\" )\nvar PuzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar puzzleMan\nvar otherPuzzle\nvar mainPuzzle = true\n\nvar time = {\n\t\ton = true,\n\t\tval = 0.0,\n\t\tlabel = Label.new(),\n\t\ttween = Tween.new() }\n\nfunc addTimer():\n\tadd_child(time.label)\n\tadd_child(time.tween)\n\ttime.label.set_pos(Vector2(15,15))\n\n\ttime.label.set_theme(load(\"res:\/\/themes\/MainTheme.thm\"))\n\ttime.tween.interpolate_method(time.label, \"set_pos\", \\\n\t\t\ttime.label.get_pos(), time.label.get_pos()*2, 0.5, \\\n\t\t\tTween.TRANS_BOUNCE, Tween.EASE_OUT)\n\ttime.tween.start()\n\ttime.label.set_text(str(time.val))\n\nfunc formatTime(t):\n\tvar mins = floor(t \/ 60)\n\tvar secs = fmod(floor(t), 60)\n\tvar millis = floor((t - floor(t)) * 1000)\n\treturn str(mins) + \":\" + str(secs).pad_zeros(2) + \":\" + str(millis).pad_zeros(3)\n\nfunc _process(dTime):\n\t# start label tween on\n\ttime.val += dTime\n\ttime.label.set_text(formatTime(time.val))\n\tif fmod(time.val, 10) < 0.1:\n\t\ttime.tween.seek(0.0)\n\n# Called for initialization\nfunc _ready():\n\tif time.on:\n\t\tset_process(true) # needed for time keeping\n\tpuzzleMan = PuzzleManScript.new()\n\tvar puzzle = puzzleMan.generatePuzzle( 2, puzzleMan.DIFF_EASY )\n\tpuzzle.puzzleMan = puzzleMan\n\n\tprint(\"Generated \", puzzle.blocks.size(), \" blocks.\" )\n\n\tprint( \"Saving...\" )\n\tDataMan.savePuzzle( \"TestPuzzle.pzl\", puzzle )\n\n\tpuzzle = 0\n\n\tpuzzle = DataMan.loadPuzzle( \"TestPuzzle.pzl\" )\n\n\tvar steps = puzzle.solvePuzzleSteps()\n\tprint( \"PUZZLE IS SOLVEABLE?: \", steps.solveable )\n\n\taddTimer()\n\n\t# Place the blocks in the puzzle.\n\tvar gridMan = get_node( \"GridView\/GridMan\" )\n\tgridMan.shape = puzzleMan.shape\n\tgridMan.set_puzzle(puzzle)\n\tfor block in puzzle.blocks:\n\t\t# Create a block node, add it to the tree\n\t\tgridMan.add_block(block.toNode())\n\n\t# make a new puzzle, embed using Viewport\n\tif mainPuzzle:\n\t\tvar p = PuzzleScn.instance()\n\t\tp.remove_and_delete_child(p.get_node(\"Lights\"))\n\t\tp.get_node(\"GridView\").active = false\n\t\tp.mainPuzzle = false\n\t\tp.set_scale(Vector3(0.5, 0.5, 0.5))\n\t\tp.set_translation(Vector3(10, 5, -20))\n\n\t\tvar v = Viewport.new()\n\t\tvar c = Control.new()\n\n\t\tv.set_world(p.get_world())\n\t\tv.set_rect(Rect2(0, 0, 100, 100))\n\t\tv.set_physics_object_picking(false)\n\t\tget_node(\"Camera\").add_child(p)\n\t\tv.add_child(p)\n\t\tadd_child(c)\n\t\tc.add_child(v)\n\t\totherPuzzle = p #for use with network\n# child of control? easier input\n\n\n","old_contents":"extends Spatial\n\n# proposed script manager:\n# var PuzzleManScript = get_node(\"Globals\").get(\"PuzzleManScript\")\n\nvar DataMan = preload( \"res:\/\/scripts\/DataManager.gd\" ).new()\nvar PuzzleManScript = preload( \"res:\/\/scripts\/PuzzleManager.gd\" )\nvar PuzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar puzzleMan\nvar otherPuzzle\nvar mainPuzzle = true\n\nvar time = {\n\t\ton = true,\n\t\tval = 0.0,\n\t\tlabel = null,\n\t\ttween = null }\n\nfunc addTimer():\n\ttime.label = Label.new()\n\ttime.tween = Tween.new()\n\tadd_child(time.label)\n\tadd_child(time.tween)\n\ttime.label.set_pos(Vector2(15,15))\n\n\ttime.label.set_theme(load(\"res:\/\/themes\/MainTheme.thm\"))\n\ttime.tween.interpolate_method(time.label, \"set_pos\", \\\n\t\t\ttime.label.get_pos(), time.label.get_pos()*2, 0.5, \\\n\t\t\tTween.TRANS_BOUNCE, Tween.EASE_OUT)\n\ttime.tween.start()\n\ttime.label.set_text(str(time.val))\n\nfunc formatTime(t):\n\tvar mins = floor(t \/ 60)\n\tvar secs = fmod(floor(t), 60)\n\tvar millis = floor((t - floor(t)) * 1000)\n\treturn str(mins) + \":\" + str(secs).pad_zeros(2) + \":\" + str(millis).pad_zeros(3)\n\nfunc _process(dTime):\n\t# start label tween on\n\ttime.val += dTime\n\ttime.label.set_text(formatTime(time.val))\n\tif fmod(time.val, 10) < 0.1:\n\t\ttime.tween.seek(0.0)\n\n# Called for initialization\nfunc _ready():\n\tif time.on:\n\t\tset_process(true) # needed for time keeping\n\tpuzzleMan = PuzzleManScript.new()\n\tvar puzzle = puzzleMan.generatePuzzle( 2, puzzleMan.DIFF_EASY )\n\tpuzzle.puzzleMan = puzzleMan\n\n\tprint(\"Generated \", puzzle.blocks.size(), \" blocks.\" )\n\n\tprint( \"Saving...\" )\n\tDataMan.savePuzzle( \"TestPuzzle.pzl\", puzzle )\n\n\tpuzzle = 0\n\n\tpuzzle = DataMan.loadPuzzle( \"TestPuzzle.pzl\" )\n\n\tvar steps = puzzle.solvePuzzleSteps()\n\tprint( \"PUZZLE IS SOLVEABLE?: \", steps.solveable )\n\n\taddTimer()\n\n\t# Place the blocks in the puzzle.\n\tvar gridMan = get_node( \"GridView\/GridMan\" )\n\tgridMan.shape = puzzleMan.shape\n\tgridMan.set_puzzle(puzzle)\n\tfor block in puzzle.blocks:\n\t\t# Create a block node, add it to the tree\n\t\tgridMan.add_block(block.toNode())\n\n\t# make a new puzzle, embed using Viewport\n\tif mainPuzzle:\n\t\tvar p = PuzzleScn.instance()\n\t\tp.remove_and_delete_child(p.get_node(\"Lights\"))\n\t\tp.get_node(\"GridView\").active = false\n\t\tp.mainPuzzle = false\n\t\tp.set_scale(Vector3(0.5, 0.5, 0.5))\n\t\tp.set_translation(Vector3(10, 5, -20))\n\n\t\tvar v = Viewport.new()\n\t\tvar c = Control.new()\n\n\t\tv.set_world(p.get_world())\n\t\tv.set_rect(Rect2(0, 0, 100, 100))\n\t\tv.set_physics_object_picking(false)\n\t\tget_node(\"Camera\").add_child(p)\n\t\tv.add_child(p)\n\t\tadd_child(c)\n\t\tc.add_child(v)\n\t\totherPuzzle = p #for use with network\n# child of control? easier input\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"46441cedc57c6d39debcbe3f27d17cb2a6a0d0cf","subject":"Cleaned","message":"Cleaned\n","repos":"Acvarium\/BabylonTower2,Acvarium\/BabylonTower2","old_file":"scripts\/2d\/main.gd","new_file":"scripts\/2d\/main.gd","new_contents":"extends Node2D\nvar mainArray = []\nconst BALL_SIZE = 64\nvar ballObj = load(\"res:\/\/objects\/ball.tscn\")\nvar slot = 0\nvar ballPressed = false\nvar ballPressedName = ''\nvar shiftPressed = Vector2(0,0)\n\nfunc _fixed_process(delta):\n\tvar mouse = get_viewport().get_mouse_pos()\n\tvar ss = str(mouse)\n\tvar ballPressedPos = findBallByName(ballPressedName)\n\t\n\tif ballPressed:\n\t\tss += \" __\" + str(ballPressedPos)\n\t\tvar mouseOnGrid = Vector2(0,0)\n\t\tvar onGrid = Vector2(0,0)\n\n\t\tmouseOnGrid.x = int((mouse.x - ballPressedPos.x) \/ 64) - 1 \n\t\tmouseOnGrid.y = int((mouse.y - 32 - ballPressedPos.y) \/ 64)\n\t\tss += \" **\" + str(mouseOnGrid)\n\n\t\tonGrid.x = (int((mouse.x - ballPressedPos.x) \/ 64) - 1) - ballPressedPos.x\n\t\tonGrid.y = int((mouse.y - 32 - ballPressedPos.y) \/ 64) - ballPressedPos.y\n\t\tss += \" \" + str(onGrid)\n\n\t\tif onGrid.x != 0:\n\t\t\tvar ballsToShift = []\n\t\t\tif ballPressedPos.y > 6:\n\t\t\t\tballsToShift.append(get_node(\"balls\/b\" + ballPressedName))\n\n\t\t\telse:\n\t\t\t\tfor i in range(6):\n\t\t\t\t\tvar b = get_node(\"balls\/b\" + mainArray[i * 7 + ballPressedPos.y])\n\t\t\t\t\tballsToShift.append(b)\n\t\t\tfor i in range(ballsToShift.size()):\n\n\t\t\t\tvar b = get_node(\"balls\/b\" + mainArray[mainArray.size() - 1])\n\t\t\t\tif ballPressedPos.y < 7:\n\t\t\t\t\tb = get_node(\"balls\/b\" + mainArray[i * 7 + ballPressedPos.y])\n\t\t\t\tvar pos = b.get_pos()\n\t\t\t\tpos.x = i * 64 + mouseOnGrid.x * 64 - ballPressedPos.x * 64\n\t\t\t\tif ballPressedPos.y > 6:\n\t\t\t\t\tpos.x = i * 64 + mouseOnGrid.x * 64\n\t\t\t\tif pos.x > 64 * 6 - 32:\n\t\t\t\t\tpos.x -= 64 * 6\n\t\t\t\telif pos.x < 0:\n\t\t\t\t\tpos.x += 64 * 6\n\t\t\t\tb.set_pos(pos)\n\t\t\tshiftPressed = Vector2(ballPressedPos.y, onGrid.x)\n\n\tget_node(\"txt\").set_text(ss)\n\tpass\n\nfunc _ready():\n\trandomize()\n\tset_process_input(true)\n\tset_fixed_process(true)\n#\u041a\u043b\u044e\u0447\u043e\u0432\u0438\u0439 \u043c\u0430\u0441\u0438\u0432, \u0432 \u043a\u043e\u0442\u0440\u043e\u043c\u0443 \u0437\u0431\u0435\u0440\u0456\u0433\u0430\u044e\u0442\u044c\u0441\u044f \u0434\u0430\u043d\u0456 \u043f\u0440\u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044f \u043a\u043e\u043b\u044c\u043e\u0440\u043e\u0432\u0438\u0445 \u043a\u0443\u043b\u044c\u043e\u043a\n\tmainArray = [ 'r1', 'r2', 'r3', 'r4', 'r5', 'r6', 'r7',\n\t\t\t\t 'o1', 'o2', 'o3', 'o4', 'o5', 'o6', 'o7',\n\t\t\t\t 'y1', 'y2', 'y3', 'y4', 'y5', 'y6', 'y7',\n\t\t\t\t 'g1', 'g2', 'g3', 'g4', 'g5', 'g6', 'g7',\n\t\t\t\t 'b1', 'b2', 'b3', 'b4', 'b5', 'b6', 'b7',\n\t\t\t\t 'p1', 'p2', 'p3', 'p4', 'p5', 'p6', 'p7', \n\t\t\t\t ''] \n#\u0421\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f \u043a\u0443\u043b\u044c\u043e\u043a \u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u043d\u043e \u0434\u043e \u043a\u043b\u044e\u0447\u043e\u0432\u043e\u0433\u043e \u043c\u0430\u0441\u0438\u0432\u0443\n\tshuffleBalls()\n\tupdateBalls()\n\t\n#\u041e\u0431\u0440\u043e\u0431\u043a\u0430 \u043f\u043e\u0434\u0456\u0439 (\u043d\u0430\u0442\u0438\u0441\u043a\u0430\u043d\u043d\u044f \u043a\u043b\u0430\u0432\u0456\u0448)\nfunc _input(event):\n\tif event.is_action_released(\"space\"): \n\t\tshuffleBalls()\n\t\tupdateBalls()\n\tif event.is_action_released(\"LMB\"):\n\t\tballPressed = false\n\n\t\tif shiftPressed.y != 0:\n\t\t\tshiftRow(shiftPressed.x, shiftPressed.y)\n\t\telse:\n\t\t\tif findBallByName('').x == findBallByName(ballPressedName).x:\n\n\t\t\t\tvar sCol = findBallByName(ballPressedName).x\n\t\t\t\tcutCol(findBallByName(ballPressedName))\n\t\t\t\tupdateBalls()\n\t\tupdateBalls()\n\t\tshiftPressed = Vector2(0,0)\n\n#\u0421\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f \u043e\u0434\u043d\u0456\u0454\u0457 \u043a\u0443\u043b\u044c\u043a\u0438 \u0437\u0430 \u0437\u0430\u0434\u0430\u043d\u0438\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438\nfunc createBall(name):\n\tvar balls = get_node(\"balls\")\n\tvar ball = ballObj.instance()\n\tball.set_name(name)\n\tballs.add_child(ball)\n\tvar color = Color(0,0,0,1)\n\tif name != 'b':\n\t\tcolor = toColor(name[1])\n\tball.setColor(color)\n\t\n#\u041f\u0435\u0440\u0435\u0444\u0430\u0440\u0431\u0443\u0432\u0430\u043d\u043d\u044f \u043a\u0443\u043b\u044c\u043e\u043a \u0443 \u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u043d\u0456\u0441\u0442\u044c \u0434\u043e \u0437\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0445 \u0432 \u043a\u043b\u044e\u0447\u043e\u0432\u043e\u043c\u0443 \u043c\u0430\u0441\u0438\u0432\u0456 \u043a\u043e\u043b\u044c\u043e\u0440\u0456\u0432\nfunc toColor(colorMark):\n\tvar color = Color(1,1,1,1)\n\tif not colorMark: \t\t\t#\u041f\u043e\u0440\u043e\u0436\u043d\u044f \u043a\u043e\u043c\u0456\u0440\u043a\u0430\n\t\tcolor = Color(0,0,0,1)\n\telif colorMark == 'r':\t\t#\u0427\u0435\u0440\u0432\u043e\u043d\u0456\n\t\tcolor = Color(1,0,0,1)\n\telif colorMark == 'g':\t\t#\u0417\u0435\u043b\u0435\u043d\u0456\n\t\tcolor = Color(0,0.6,0,1)\n\telif colorMark == 'b':\t\t#\u0421\u0438\u043d\u0456\n\t\tcolor = Color(0,0,1,1)\n\telif colorMark == 'o':\t\t#\u041f\u043e\u043c\u0430\u0440\u0430\u043d\u0447\u0435\u0432\u0456\n\t\tcolor = Color(1.0, 0.5, 0.0, 1.0)\n\telif colorMark == 'y':\t\t#\u0416\u043e\u0432\u0442\u0456\n\t\tcolor = Color(0.65, 0.65, 0.0, 1.0)\n\telif colorMark == 'p':\t\t#\u0424\u0456\u043e\u043b\u0435\u0442\u043e\u0432\u0456\n\t\tcolor = Color(0.65, 0.0, 0.65, 1.0)\n\treturn color\n\n#\u0417\u043c\u0456\u0449\u0435\u043d\u043d\u044f \u0440\u044f\u0434\u043a\u0430 \u043b\u0456\u0432\u043e\u0440\u0443\u0447 \u0430\u0431\u043e \u043f\u0440\u0430\u0432\u043e\u0440\u0443\u0447\nfunc shiftRow(row, dir):\n\tif abs(row) == 7:\n\t\tslot += dir\n\t\tif slot < 0:\n\t\t\tslot = 5\n\t\telif slot > 5:\n\t\t\tslot = 0\n\t\treturn 0\n\tvar tempRow = []\n\tfor i in range(6):\n\t\ttempRow.append(mainArray[i * 7 + row])\n\tvar tail\n\tif dir < 0:\n\t\tfor j in range(abs(dir)):\n\t\t\ttail = tempRow[0]\n\t\t\tfor i in range(tempRow.size() - 1):\n\t\t\t\ttempRow[i] = tempRow[i+1]\n\t\t\ttempRow[tempRow.size() - 1] = tail\n\telif dir > 0:\n\t\tfor j in range(abs(dir)):\n\t\t\ttail = tempRow[tempRow.size() - 1]\n\t\t\tfor i in range((tempRow.size() - 1), 0 , -1):\n\t\t\t\ttempRow[i] = tempRow[i - 1]\n\t\t\ttempRow[0] = tail\n\tfor i in range(6):\n\t\tmainArray[i * 7 + row] = tempRow[i]\n\t\t\nfunc findBallByName(name):\n\tvar index = 0\n\tfor b in mainArray:\n\t\tif b == name:\n\t\t\tvar col = int(index \/ 7)\n\t\t\tvar row = (index - col * 7)\n\t\t\tif index == mainArray.size() - 1:\n\t\t\t\treturn(Vector2(slot,7))\n\t\t\treturn(Vector2(col,row))\n\t\tindex += 1\n\n\n#\u041f\u0435\u0440\u0435\u043c\u0456\u0448\u0430\u0442\u0438 \u043a\u0443\u043b\u044c\u043a\u0438\nfunc shuffleBalls():\n\tvar shuffledList = [] \n\tvar indexList = range(mainArray.size())\n\tfor i in range(mainArray.size()):\n\t\tvar x = randi()%indexList.size()\n\t\tshuffledList.append(mainArray[indexList[x]])\n\t\tindexList.remove(x)\n\tmainArray = shuffledList\n\tslot = randi()%6\n\n#\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044f \u043f\u043e\u0437\u0438\u0446\u0456\u0439 \u043a\u0443\u043b\u044c\u043e\u043a\nfunc updateBalls():\n\tvar index = 0\n\tvar table = []\n\tfor b in mainArray:\n\t\tvar col = int(index \/ 7)\n\t\tvar row = (index - col * 7)\n\t\tvar name = \"b\" + mainArray[index]\n\t\tif not get_node(\"balls\/\" + name):\n\t\t\tcreateBall(name)\n\t\tif index < mainArray.size() - 1:\n\t\t\tget_node(\"balls\" + \"\/b\" + mainArray[index]).set_pos(Vector2(col * (BALL_SIZE), row * (BALL_SIZE)))\n\t\telse:\n\t\t\tget_node(\"balls\" + \"\/b\" + mainArray[index]).set_pos(Vector2(slot * BALL_SIZE, 7 * BALL_SIZE))\t\n\t\tindex += 1\n\n#\u041e\u0431\u0440\u043e\u0431\u043a\u0430 \u0441\u0438\u0433\u043d\u0430\u043b\u0456\u0432 \u043a\u043d\u043e\u043f\u043e\u043a\nfunc _signal_arrow(rowDir):\n\t\tshiftRow(abs(rowDir) - 1, sign(int(rowDir)))\n\t\tupdateBalls()\n\nfunc cutCol(ball):\n\tvar column = []\n\tvar i\n\tfor b in range(7):\n\t\ti = b + (ball.x * 7)\n\t\tcolumn.append(mainArray[i])\n\tif slot == ball.x:\n\t\tcolumn.append(mainArray[mainArray.size() - 1])\n\tvar empty = findBallByName('')\n\n\tvar dir = 1\n\tif empty.y > ball.y:\n\t\tdir = -1\n\ti = empty.y\n\twhile(i != ball.y):\n\t\tcolumn[i] = column[i + dir]\n\t\t\n\t\ti += dir\n\tcolumn[ball.y] = ''\n\n\n\tfor b in range(7):\n\t\ti = b + (ball.x * 7)\n\t\tmainArray[i] = column[b]\n\tif slot == ball.x:\n\t\tmainArray[mainArray.size() - 1] = column[column.size() - 1]\n\nfunc _signal_ballClicked(name):\n\tif name != 'b':\n\t\tname = name[1] + name[2]\n\t\tballPressedName = name\n\telse:\n\t\tballPressedName = ''\n\tballPressed = true\n","old_contents":"extends Node2D\nvar mainArray = []\nconst BALL_SIZE = 64\nvar ballObj = load(\"res:\/\/objects\/ball.tscn\")\nvar slot = 0\nvar ballPressed = false\nvar ballPressedName = ''\nvar shiftPressed = Vector2(0,0)\n#var ballPressedPos = Vector2(0,0)\n\nfunc _fixed_process(delta):\n\tvar mouse = get_viewport().get_mouse_pos()\n\tvar ss = str(mouse)\n\tvar ballPressedPos = findBallByName(ballPressedName)\n\t\n\tif ballPressed:\n\t\tss += \" __\" + str(ballPressedPos)\n\t\tvar mouseOnGrid = Vector2(0,0)\n\t\tvar onGrid = Vector2(0,0)\n\n\t\tmouseOnGrid.x = int((mouse.x - ballPressedPos.x) \/ 64) - 1 \n\t\tmouseOnGrid.y = int((mouse.y - 32 - ballPressedPos.y) \/ 64)\n\t\tss += \" **\" + str(mouseOnGrid)\n\n\t\tonGrid.x = (int((mouse.x - ballPressedPos.x) \/ 64) - 1) - ballPressedPos.x\n\t\tonGrid.y = int((mouse.y - 32 - ballPressedPos.y) \/ 64) - ballPressedPos.y\n\t\tss += \" \" + str(onGrid)\n\n\t\tif onGrid.x != 0:\n\t\t\tvar ballsToShift = []\n\t\t\tif ballPressedPos.y > 6:\n\t\t\t\tballsToShift.append(get_node(\"balls\/b\" + ballPressedName))\n\t\t\t\tprint(ballPressedName)\n\t\t\telse:\n\t\t\t\tfor i in range(6):\n\t\t\t\t\tvar b = get_node(\"balls\/b\" + mainArray[i * 7 + ballPressedPos.y])\n\t\t\t\t\tballsToShift.append(b)\n\t\t\tfor i in range(ballsToShift.size()):\n\t\t\t\tprint(i)\n\t\t\t\tvar b = get_node(\"balls\/b\" + mainArray[mainArray.size() - 1])\n\t\t\t\tif ballPressedPos.y < 7:\n\t\t\t\t\tb = get_node(\"balls\/b\" + mainArray[i * 7 + ballPressedPos.y])\n\t\t\t\tvar pos = b.get_pos()\n\t\t\t\tpos.x = i * 64 + mouseOnGrid.x * 64 - ballPressedPos.x * 64\n\t\t\t\tif ballPressedPos.y > 6:\n\t\t\t\t\tpos.x = i * 64 + mouseOnGrid.x * 64\n\t\t\t\tprint(ballPressedPos)\n\t\t\t\tif pos.x > 64 * 6 - 32:\n\t\t\t\t\tpos.x -= 64 * 6\n\t\t\t\telif pos.x < 0:\n\t\t\t\t\tpos.x += 64 * 6\n\t\t\t\tb.set_pos(pos)\n\t\t\tshiftPressed = Vector2(ballPressedPos.y, onGrid.x)\n\n\tget_node(\"txt\").set_text(ss)\n\tpass\n\nfunc _ready():\n\trandomize()\n\tset_process_input(true)\n\tset_fixed_process(true)\n#\u041a\u043b\u044e\u0447\u043e\u0432\u0438\u0439 \u043c\u0430\u0441\u0438\u0432, \u0432 \u043a\u043e\u0442\u0440\u043e\u043c\u0443 \u0437\u0431\u0435\u0440\u0456\u0433\u0430\u044e\u0442\u044c\u0441\u044f \u0434\u0430\u043d\u0456 \u043f\u0440\u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044f \u043a\u043e\u043b\u044c\u043e\u0440\u043e\u0432\u0438\u0445 \u043a\u0443\u043b\u044c\u043e\u043a\n\tmainArray = [ 'r1', 'r2', 'r3', 'r4', 'r5', 'r6', 'r7',\n\t\t\t\t 'o1', 'o2', 'o3', 'o4', 'o5', 'o6', 'o7',\n\t\t\t\t 'y1', 'y2', 'y3', 'y4', 'y5', 'y6', 'y7',\n\t\t\t\t 'g1', 'g2', 'g3', 'g4', 'g5', 'g6', 'g7',\n\t\t\t\t 'b1', 'b2', 'b3', 'b4', 'b5', 'b6', 'b7',\n\t\t\t\t 'p1', 'p2', 'p3', 'p4', 'p5', 'p6', 'p7', \n\t\t\t\t ''] \n#\u0421\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f \u043a\u0443\u043b\u044c\u043e\u043a \u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u043d\u043e \u0434\u043e \u043a\u043b\u044e\u0447\u043e\u0432\u043e\u0433\u043e \u043c\u0430\u0441\u0438\u0432\u0443\n\tshuffleBalls()\n\tupdateBalls()\n\t\n#\u041e\u0431\u0440\u043e\u0431\u043a\u0430 \u043f\u043e\u0434\u0456\u0439 (\u043d\u0430\u0442\u0438\u0441\u043a\u0430\u043d\u043d\u044f \u043a\u043b\u0430\u0432\u0456\u0448)\nfunc _input(event):\n\tif event.is_action_released(\"space\"): \n\t\tshuffleBalls()\n\t\tupdateBalls()\n\tif event.is_action_released(\"LMB\"):\n\t\tballPressed = false\n\n\t\tif shiftPressed.y != 0:\n\t\t\tshiftRow(shiftPressed.x, shiftPressed.y)\n\t\telse:\n\t\t\tif findBallByName('').x == findBallByName(ballPressedName).x:\n\t\t\t\t#print(findBallByName(name))\n\t\t\t\tvar sCol = findBallByName(ballPressedName).x\n\t\t\t\tcutCol(findBallByName(ballPressedName))\n\t\t\t\tupdateBalls()\n\t\tupdateBalls()\n\t\tshiftPressed = Vector2(0,0)\n\n#\u0421\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f \u043e\u0434\u043d\u0456\u0454\u0457 \u043a\u0443\u043b\u044c\u043a\u0438 \u0437\u0430 \u0437\u0430\u0434\u0430\u043d\u0438\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438\nfunc createBall(name):\n\tvar balls = get_node(\"balls\")\n\tvar ball = ballObj.instance()\n\tball.set_name(name)\n\tballs.add_child(ball)\n\tvar color = Color(0,0,0,1)\n\tif name != 'b':\n\t\tcolor = toColor(name[1])\n\tball.setColor(color)\n\t\n#\u041f\u0435\u0440\u0435\u0444\u0430\u0440\u0431\u0443\u0432\u0430\u043d\u043d\u044f \u043a\u0443\u043b\u044c\u043e\u043a \u0443 \u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u043d\u0456\u0441\u0442\u044c \u0434\u043e \u0437\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0445 \u0432 \u043a\u043b\u044e\u0447\u043e\u0432\u043e\u043c\u0443 \u043c\u0430\u0441\u0438\u0432\u0456 \u043a\u043e\u043b\u044c\u043e\u0440\u0456\u0432\nfunc toColor(colorMark):\n\tvar color = Color(1,1,1,1)\n\tif not colorMark: \t\t\t#\u041f\u043e\u0440\u043e\u0436\u043d\u044f \u043a\u043e\u043c\u0456\u0440\u043a\u0430\n\t\tcolor = Color(0,0,0,1)\n\telif colorMark == 'r':\t\t#\u0427\u0435\u0440\u0432\u043e\u043d\u0456\n\t\tcolor = Color(1,0,0,1)\n\telif colorMark == 'g':\t\t#\u0417\u0435\u043b\u0435\u043d\u0456\n\t\tcolor = Color(0,0.6,0,1)\n\telif colorMark == 'b':\t\t#\u0421\u0438\u043d\u0456\n\t\tcolor = Color(0,0,1,1)\n\telif colorMark == 'o':\t\t#\u041f\u043e\u043c\u0430\u0440\u0430\u043d\u0447\u0435\u0432\u0456\n\t\tcolor = Color(1.0, 0.5, 0.0, 1.0)\n\telif colorMark == 'y':\t\t#\u0416\u043e\u0432\u0442\u0456\n\t\tcolor = Color(0.65, 0.65, 0.0, 1.0)\n\telif colorMark == 'p':\t\t#\u0424\u0456\u043e\u043b\u0435\u0442\u043e\u0432\u0456\n\t\tcolor = Color(0.65, 0.0, 0.65, 1.0)\n\treturn color\n\n#\u0417\u043c\u0456\u0449\u0435\u043d\u043d\u044f \u0440\u044f\u0434\u043a\u0430 \u043b\u0456\u0432\u043e\u0440\u0443\u0447 \u0430\u0431\u043e \u043f\u0440\u0430\u0432\u043e\u0440\u0443\u0447\nfunc shiftRow(row, dir):\n\tif abs(row) == 7:\n\t\tslot += dir\n\t\tif slot < 0:\n\t\t\tslot = 5\n\t\telif slot > 5:\n\t\t\tslot = 0\n\t\treturn 0\n\tvar tempRow = []\n\tfor i in range(6):\n\t\ttempRow.append(mainArray[i * 7 + row])\n\tvar tail\n\tif dir < 0:\n\t\tfor j in range(abs(dir)):\n\t\t\ttail = tempRow[0]\n\t\t\tfor i in range(tempRow.size() - 1):\n\t\t\t\ttempRow[i] = tempRow[i+1]\n\t\t\ttempRow[tempRow.size() - 1] = tail\n\telif dir > 0:\n\t\tfor j in range(abs(dir)):\n\t\t\ttail = tempRow[tempRow.size() - 1]\n\t\t\tfor i in range((tempRow.size() - 1), 0 , -1):\n\t\t\t\ttempRow[i] = tempRow[i - 1]\n\t\t\ttempRow[0] = tail\n\tfor i in range(6):\n\t\tmainArray[i * 7 + row] = tempRow[i]\n\t\t\nfunc findBallByName(name):\n\tvar index = 0\n\tfor b in mainArray:\n\t\tif b == name:\n\t\t\tvar col = int(index \/ 7)\n\t\t\tvar row = (index - col * 7)\n\t\t\tif index == mainArray.size() - 1:\n\t\t\t\treturn(Vector2(slot,7))\n\t\t\treturn(Vector2(col,row))\n\t\tindex += 1\n\n\n#\u041f\u0435\u0440\u0435\u043c\u0456\u0448\u0430\u0442\u0438 \u043a\u0443\u043b\u044c\u043a\u0438\nfunc shuffleBalls():\n\tvar shuffledList = [] \n\tvar indexList = range(mainArray.size())\n\tfor i in range(mainArray.size()):\n\t\tvar x = randi()%indexList.size()\n\t\tshuffledList.append(mainArray[indexList[x]])\n\t\tindexList.remove(x)\n\tmainArray = shuffledList\n\tslot = randi()%6\n\n#\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044f \u043f\u043e\u0437\u0438\u0446\u0456\u0439 \u043a\u0443\u043b\u044c\u043e\u043a\nfunc updateBalls():\n\tvar index = 0\n\tvar table = []\n\tfor b in mainArray:\n\t\tvar col = int(index \/ 7)\n\t\tvar row = (index - col * 7)\n\t\tvar name = \"b\" + mainArray[index]\n\t\tif not get_node(\"balls\/\" + name):\n\t\t\tcreateBall(name)\n\t\tif index < mainArray.size() - 1:\n\t\t\tget_node(\"balls\" + \"\/b\" + mainArray[index]).set_pos(Vector2(col * (BALL_SIZE), row * (BALL_SIZE)))\n\t\telse:\n\t\t\tget_node(\"balls\" + \"\/b\" + mainArray[index]).set_pos(Vector2(slot * BALL_SIZE, 7 * BALL_SIZE))\t\n\t\tindex += 1\n\n#\u041e\u0431\u0440\u043e\u0431\u043a\u0430 \u0441\u0438\u0433\u043d\u0430\u043b\u0456\u0432 \u043a\u043d\u043e\u043f\u043e\u043a\nfunc _signal_arrow(rowDir):\n\t\tshiftRow(abs(rowDir) - 1, sign(int(rowDir)))\n\t\tupdateBalls()\n\nfunc cutCol(ball):\n\tvar column = []\n\tvar i\n\tfor b in range(7):\n\t\ti = b + (ball.x * 7)\n\t\tcolumn.append(mainArray[i])\n\tif slot == ball.x:\n\t\tcolumn.append(mainArray[mainArray.size() - 1])\n\tvar empty = findBallByName('')\n\n\tvar dir = 1\n\tif empty.y > ball.y:\n\t\tdir = -1\n\ti = empty.y\n\twhile(i != ball.y):\n\t\tcolumn[i] = column[i + dir]\n\t\t\n\t\ti += dir\n\tcolumn[ball.y] = ''\n\n\n\tfor b in range(7):\n\t\ti = b + (ball.x * 7)\n\t\tmainArray[i] = column[b]\n\tif slot == ball.x:\n\t\tmainArray[mainArray.size() - 1] = column[column.size() - 1]\n\nfunc _signal_ballClicked(name):\n\tif name != 'b':\n\t\tname = name[1] + name[2]\n\t\tballPressedName = name\n\telse:\n\t\tballPressedName = ''\n\tballPressed = true\n\n#\t\tif findBallByName('').x == findBallByName(name).x:\n#\t\t\tprint(findBallByName(name))\n#\t\t\tvar sCol = findBallByName(name).x\n#\t\t\tcutCol(findBallByName(name))\n#\t\t\tupdateBalls()\n\t\t\t\n\t\t\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"28313b26506f0a1e3c4f601961855850b4095caa","subject":"clearer name BLOCK_TRANSFORM -> PUZZLE_TRANSFORM. puzzle is sent over network","message":"clearer name BLOCK_TRANSFORM -> PUZZLE_TRANSFORM. puzzle is sent over network\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Network.gd","new_file":"src\/scripts\/Network.gd","new_contents":"# Core networking\n\nextends Node\n\nconst REMOTE_FINISH = 0\nconst REMOTE_START = 1\nconst REMOTE_QUIT = 2\nconst REMOTE_BLOCK = 4\nconst REMOTE_PUZZLE_TRANSFORM = 5\nconst REMOTE_BLOCK_UPDATE = 6\n\nvar port = 54321\nvar root\nvar isNetwork\nvar isHost\nvar isClient = false\nvar server\nvar client\nvar connection\nvar proxy\n\nvar thisPuzzle\n\n#Store the peer stream used by both the lcient and server\nvar stream\n\nfunc _ready():\n\tisNetwork = false\n\tisHost = false\n\tvar label = get_tree().get_root().get_node(\"GUIManager\/OptionsMenu\/Panel\/PortField\/LineEdit\")\n\tif not label == null:\n\t\tlabel.set_text(str(port))\n\nfunc setPort(pt):\n\tport = pt;\n\nfunc connectTo(ip, pt):\n\tisClient = true #just to tell if it's doing something :S\n\tconnection = PacketPeerStream.new()\n\tstream = StreamPeerTCP.new()\n\tconnection.set_stream_peer(stream)\n\tstream.connect(ip, pt);\n\n\tif stream.get_status() == stream.STATUS_CONNECTED or stream.get_status() == stream.STATUS_CONNECTING:\n\t\tprint(\"Connecting to \" + ip + \":\" + str(port));\n\t\tproxy.set_process(true)\n\t\t#leave is_network as false to indicate we're still waiting for connection\n\n\nfunc host(pt):\n\tserver = TCP_Server.new()\n\t#connection = PacketPeerStream.new()\n\tisHost = true\n\tprint(\"Starting listening server on port \" + str(pt))\n\tif server.listen(pt) == 0:\n\t\tproxy.set_process(true)\n\t\tprint(\"Listening...\")\n\telse:\n\t\tprint(\"Failed to start server on port \" + str(pt));\n\nfunc _process(delta):\n\tif (isHost):\n\t\t#server processing stuff\n\t\t#use isNetwork to determine if we're still listening\n\t\tif !isNetwork:\n\t\t\tif server.is_connection_available():\n\t\t\t\tstream = server.take_connection()\n\t\t\t\tconnection = PacketPeerStream.new()\n\t\t\t\tconnection.set_stream_peer(stream)\n\t\t\t\tprint(\"Connecting with player...\")\n\t\t\t\tisNetwork = true\n\t\t\t\tserver.stop()\n\n\t\t\t\tgotoPuzzle()\n\n\t\t\t\tthisPuzzle = root.get_node(\"Puzzle\")\n\t\t\t\t#MAKE CALL TO PUZZLE SELECTER\n\t\telse: #not listening anymore, have a client\n\t\t\t#do quick check to make sure we're still\n\t\t\t#connected\n\t\t\tif !stream.is_connected():\n\t\t\t\tprint(\"Lost Connection!\");\n\t\t\t\tisNetwork = false\n\t\t\t\tproxy.set_process(false)\n\t\t\t\t#QUIT GAME\n\t\t\t\treturn\n\t\t\t#check if we have any data\n\t\t\tif connection.get_available_packet_count() > 0:\n\t\t\t\t#have to be careful about more than 1 packet per frame\n\t\t\t\tfor i in range(connection.get_available_packet_count()):\n\t\t\t\t\tvar dataArray = connection.get_var()\n\t\t\t\t\tProcessServerData(dataArray)\n\n\telse:\n\t\t#client processing stuff\n\t\tif !isNetwork:\n\t\t\t#Still waiting for connection confirmed\n\t\t\tif stream.get_status() == stream.STATUS_CONNECTED:\n\t\t\t\tprint(\"Connection established!\")\n\t\t\t\tisNetwork = true\n\n\t\t\t\tgotoPuzzle()\n\n\t\t\t\tthisPuzzle = root.get_node(\"Puzzle\")\n\t\t\t\treturn\n\t\t\tif stream.get_status() == stream.STATUS_NONE or stream.get_status() == stream.STATUS_ERROR:\n\t\t\t\tprint(\"Error establishing connection!\")\n\t\t\t\tproxy.set_process(false)\n\t\t\t\treturn\n\t\t\t\t#stop running process loop, cause we have no connection\n\t\telse:\n\t\t\t#connecton established and confirmed. Do regular data processing\n\t\t\t#check if we have any data\n\t\t\tif connection.get_available_packet_count() > 0:\n\t\t\t\tfor i in range(connection.get_available_packet_count()):\n\t\t\t\t\tvar dataArray = connection.get_var()\n\t\t\t\t\tProcessServerData(dataArray)\n\t\t\t\t\t#Call the server process script cuase it's peer to peer and we have the same functions!\n\n\nfunc disconnect():\n\t#need to do lots of things! If the server is open and listening, but has no connection just stop listening!\n\tif isHost and !isNetwork:\n\t\t#this means we're waiting for connection still\n\t\tserver.stop()\n\t\tprint(\"closing server listener!\")\n\telif isHost and isNetwork:\n\t\t#have connections. Need to send them stop packet, and close connection\n\t\tconnection.put_var([REMOTE_QUIT])\n\t\tstream.disconnect()\n\t\tprint(\"Closing connection to remote player...\")\n\telif !isHost and !isNetwork:\n\t\tstream.disconnect()\n\t\tprint(\"Halting connection request...\")\n\telif !isHost and isNetwork:\n\t\t#connected to server already\n\t\tstream.disconnect()\n\t\tprint(\"Disconnecting from server...\")\n\n\t#no matter where we wre before disconnect, set network to false and return to beginning screen!\n\tisNetwork = false;\n\tisHost = false;\n\tisClient = false;\n\n\tproxy.set_process(false)\n\n\n\tgotoMenu()\n\n\nfunc ProcessServerData(dataArray):\n\t#have an array of data. First element should be identifying int\n\tvar ID = dataArray[0]\n\tvar puzzle = root.get_node( \"Puzzle\" )\n\tvar gridMan = puzzle.otherPuzzle.get_node(\"GridView\/GridMan\")\n\t#no switch statement. I'm crying right now while i type this. My fingers are bleeding\n\tif ID == REMOTE_START:\n\t\t#read other person's puzzle\n\t\tprint(\"remote_stuff\")\n\t\tgridMan.set_puzzle(dataArray[1])\n\telif ID == REMOTE_FINISH:\n\t\t#again, do ending stuff\n\t\tprint(\"remote_finish: \" + str(dataArray[1]))\n\t\tgridMan.beatenWithScore(dataArray[1])\n\telif ID == REMOTE_QUIT:\n\t\t#omg those jerks!\n\t\tprint(\"remote_quit\")\n\t\tdisconnect()\n\telif ID == REMOTE_BLOCK:\n\t\t#get their block ifnormation!\n\t\tprint(\"remote_block\")\n\telif ID == REMOTE_PUZZLE_TRANSFORM:\n\t\t#sent block information\n\t\tvar translation = dataArray[1]\n\t\tthisPuzzle.otherPuzzle.set_transform(Transform( translation ))\n# better measurements!!!!\t\tthisPuzzle.otherPuzzle.set_translation(Vector3(20, 12, -40))\n##############3\n\t\tthisPuzzle.otherPuzzle.set_translation(Vector3(10, 5, -20))\n\telif ID == REMOTE_BLOCK_UPDATE:\n\t\t#sent an updated block pair\n\t\tprint(\"block update\")\n\t\tvar pos = dataArray[1]\n\t\tgridMan.forceClickBlock(pos)\n\nfunc sendStart(puzzle):\n\tif !isNetwork:\n\t\tprint(\"Error sending start packet: not connected!\")\n\t\treturn\n\tvar er = connection.put_var([REMOTE_START, puzzle])\n\nfunc sendBlockUpdate(pos):\n\tif !isNetwork:\n\t\tprint(\"Error sending start packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_BLOCK_UPDATE, pos])\n\nfunc sendFinish(score):\n\tif !isNetwork:\n\t\tprint(\"Error sending finish packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_FINISH, root.get_node(\"Puzzle\").time.val])\n\nfunc sendQuit():\n\tif !isNetwork:\n\t\tprint(\"Error sending finish packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_QUIT])\n\nfunc sendTransform(translation):\n\tif !isNetwork:\n\t\tprint(\"Cannot send transformation over an unitialized network!\")\n\t\treturn\n\tconnection.put_var([REMOTE_PUZZLE_TRANSFORM, translation])\n\tprint(\"it got here\")\n\n\nfunc gotoMenu():\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\troot.add_child( load(\"res:\/\/menus.scn\") )\n\nfunc gotoPuzzle():\n\tvar guiMan = preload(\"GUIManager.gd\").new()\n\tguiMan.gotoPuzzleScene(root, true) # network = true\n","old_contents":"# Core networking\n\nextends Node\n\nconst REMOTE_FINISH = 0\nconst REMOTE_START = 1\nconst REMOTE_QUIT = 2\nconst REMOTE_BLOCK = 4\nconst REMOTE_BLOCK_TRANSFORM = 5\nconst REMOTE_BLOCK_UPDATE = 6\n\nvar port = 54321\nvar root\nvar isNetwork\nvar isHost\nvar isClient = false\nvar server\nvar client\nvar connection\nvar proxy\n\nvar remotePuzzle\n\n#Store the peer stream used by both the lcient and server\nvar stream\n\nfunc _ready():\n\tisNetwork = false\n\tisHost = false\n\tvar label = get_tree().get_root().get_node(\"GUIManager\/OptionsMenu\/Panel\/PortField\/LineEdit\")\n\tif not label == null:\n\t\tlabel.set_text(str(port))\n\nfunc setPort(pt):\n\tport = pt;\n\nfunc connectTo(ip, pt):\n\tisClient = true #just to tell if it's doing something :S\n\tconnection = PacketPeerStream.new()\n\tstream = StreamPeerTCP.new()\n\tconnection.set_stream_peer(stream)\n\tstream.connect(ip, pt);\n\n\tif stream.get_status() == stream.STATUS_CONNECTED or stream.get_status() == stream.STATUS_CONNECTING:\n\t\tprint(\"Connecting to \" + ip + \":\" + str(port));\n\t\tproxy.set_process(true)\n\t\t#leave is_network as false to indicate we're still waiting for connection\n\n\nfunc host(pt):\n\tserver = TCP_Server.new()\n\t#connection = PacketPeerStream.new()\n\tisHost = true\n\tprint(\"Starting listening server on port \" + str(pt))\n\tif server.listen(pt) == 0:\n\t\tproxy.set_process(true)\n\t\tprint(\"Listening...\")\n\telse:\n\t\tprint(\"Failed to start server on port \" + str(pt));\n\nfunc _process(delta):\n\tif (isHost):\n\t\t#server processing stuff\n\t\t#use isNetwork to determine if we're still listening\n\t\tif !isNetwork:\n\t\t\tif server.is_connection_available():\n\t\t\t\tstream = server.take_connection()\n\t\t\t\tconnection = PacketPeerStream.new()\n\t\t\t\tconnection.set_stream_peer(stream)\n\t\t\t\tprint(\"Connecting with player...\")\n\t\t\t\tisNetwork = true\n\t\t\t\tserver.stop()\n\n\t\t\t\tgotoPuzzle()\n\n\t\t\t\tremotePuzzle = root.get_node(\"Puzzle\")\n\t\t\t\t#MAKE CALL TO PUZZLE SELECTER\n\t\telse: #not listening anymore, have a client\n\t\t\t#do quick check to make sure we're still\n\t\t\t#connected\n\t\t\tif !stream.is_connected():\n\t\t\t\tprint(\"Lost Connection!\");\n\t\t\t\tisNetwork = false\n\t\t\t\tproxy.set_process(false)\n\t\t\t\t#QUIT GAME\n\t\t\t\treturn\n\t\t\t#check if we have any data\n\t\t\tif connection.get_available_packet_count() > 0:\n\t\t\t\t#have to be careful about more than 1 packet per frame\n\t\t\t\tfor i in range(connection.get_available_packet_count()):\n\t\t\t\t\tvar dataArray = connection.get_var()\n\t\t\t\t\tProcessServerData(dataArray)\n\n\telse:\n\t\t#client processing stuff\n\t\tif !isNetwork:\n\t\t\t#Still waiting for connection confirmed\n\t\t\tif stream.get_status() == stream.STATUS_CONNECTED:\n\t\t\t\tprint(\"Connection established!\")\n\t\t\t\tisNetwork = true\n\n\t\t\t\tgotoPuzzle()\n\n\t\t\t\tremotePuzzle = root.get_node(\"Puzzle\")\n\t\t\t\treturn\n\t\t\tif stream.get_status() == stream.STATUS_NONE or stream.get_status() == stream.STATUS_ERROR:\n\t\t\t\tprint(\"Error establishing connection!\")\n\t\t\t\tproxy.set_process(false)\n\t\t\t\treturn\n\t\t\t\t#stop running process loop, cause we have no connection\n\t\telse:\n\t\t\t#connecton established and confirmed. Do regular data processing\n\t\t\t#check if we have any data\n\t\t\tif connection.get_available_packet_count() > 0:\n\t\t\t\tfor i in range(connection.get_available_packet_count()):\n\t\t\t\t\tvar dataArray = connection.get_var()\n\t\t\t\t\tProcessServerData(dataArray)\n\t\t\t\t\t#Call the server process script cuase it's peer to peer and we have the same functions!\n\n\nfunc disconnect():\n\t#need to do lots of things! If the server is open and listening, but has no connection just stop listening!\n\tif isHost and !isNetwork:\n\t\t#this means we're waiting for connection still\n\t\tserver.stop()\n\t\tprint(\"closing server listener!\")\n\telif isHost and isNetwork:\n\t\t#have connections. Need to send them stop packet, and close connection\n\t\tconnection.put_var([REMOTE_QUIT])\n\t\tstream.disconnect()\n\t\tprint(\"Closing connection to remote player...\")\n\telif !isHost and !isNetwork:\n\t\tstream.disconnect()\n\t\tprint(\"Halting connection request...\")\n\telif !isHost and isNetwork:\n\t\t#connected to server already\n\t\tstream.disconnect()\n\t\tprint(\"Disconnecting from server...\")\n\n\t#no matter where we wre before disconnect, set network to false and return to beginning screen!\n\tisNetwork = false;\n\tisHost = false;\n\tisClient = false;\n\n\tproxy.set_process(false)\n\n\n\tgotoMenu()\n\n\nfunc ProcessServerData(dataArray):\n\t#have an array of data. First element should be identifying int\n\tvar ID = dataArray[0]\n\tprint(ID)\n\t#no switch statement. I'm crying right now while i type this. My fingers are bleeding\n\tif ID == REMOTE_START:\n\t\t#do start something or something whut\n\t\tprint(\"remote_stuff\")\n\telif ID == REMOTE_FINISH:\n\t\t#again, do ending stuff\n\t\tprint(\"remote_finish: \" + str(dataArray[1]))\n\telif ID == REMOTE_QUIT:\n\t\t#omg those jerks!\n\t\tprint(\"remote_quit\")\n\t\tdisconnect()\n\telif ID == REMOTE_BLOCK:\n\t\t#get their block ifnormation!\n\t\tprint(\"remote_block\")\n\telif ID == REMOTE_BLOCK_TRANSFORM:\n\t\t#sent block information\n\t\tprint(\"block TRANSFORM!!!!!!!!!!!\")\n\t\t#var scale = dataArray[1]\n\t\tvar translation = dataArray[1]\n\t\t#remotePuzzle.otherPuzzle.set_scale(scale)\n\t\tremotePuzzle.otherPuzzle.set_transform(Transform( translation ))\n\t\tremotePuzzle.otherPuzzle.set_translation(Vector3(20, 12, -40))\n\telif ID == REMOTE_BLOCK_UPDATE:\n\t\t#sent an updated block pair\n\t\tprint(\"block update\")\n\t\tvar puzzle = root.get_node( \"Puzzle\" )\n\t\tvar pos = dataArray[1]\n\t\tpuzzle.otherPuzzle.get_node(\"GridView\/GridMan\").forceClickBlock(pos)\n\nfunc sendStart():\n\tif !isNetwork:\n\t\tprint(\"Error sending start packet: not connected!\")\n\t\treturn\n\tvar er = connection.put_var([REMOTE_START])\n\tprint(\"Sending start and got [\" + str(er) + \"]\")\n\nfunc sendBlockUpdate(pos):\n\tif !isNetwork:\n\t\tprint(\"Error sending start packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_BLOCK_UPDATE, pos])\n\nfunc sendFinish(score):\n\tif !isNetwork:\n\t\tprint(\"Error sending finish packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_FINISH, score])\n\nfunc sendQuit():\n\tif !isNetwork:\n\t\tprint(\"Error sending finish packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_QUIT])\n\nfunc sendTransform(translation):\n\tif !isNetwork:\n\t\tprint(\"Cannot send transformation over an unitialized network!\")\n\t\treturn\n\tconnection.put_var([REMOTE_BLOCK_TRANSFORM, translation])\n\tprint(\"it got here\")\n\n\nfunc gotoMenu():\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\troot.add_child( load(\"res:\/\/menus.scn\") )\n\nfunc gotoPuzzle():\n\tvar guiMan = preload(\"GUIManager.gd\").new()\n\tguiMan.gotoPuzzleScene(root, true) # network = true\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"7a7af4cf4e32847c990086f7522cb246a869b8c9","subject":"Don't check bullet collision with other bullets in the Bullet shower demo","message":"Don't check bullet collision with other bullets in the Bullet shower demo\n\nThis improves performance by reducing the number of collision checks\nthat need to be done.\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"2d\/bullet_shower\/bullets.gd","new_file":"2d\/bullet_shower\/bullets.gd","new_contents":"extends Node2D\n# This demo is an example of controling a high number of 2D objects with logic\n# and collision without using nodes in the scene. This technique is a lot more\n# efficient than using instancing and nodes, but requires more programming and\n# is less visual. Bullets are managed together in the `bullets.gd` script.\n\nconst BULLET_COUNT = 500\nconst SPEED_MIN = 20\nconst SPEED_MAX = 80\n\nconst bullet_image = preload(\"res:\/\/bullet.png\")\n\nvar bullets = []\nvar shape\n\n\nclass Bullet:\n\tvar position = Vector2()\n\tvar speed = 1.0\n\t# The body is stored as a RID, which is an \"opaque\" way to access resources.\n\t# With large amounts of objects (thousands or more), it can be significantly\n\t# faster to use RIDs compared to a high-level approach.\n\tvar body = RID()\n\n\nfunc _ready():\n\trandomize()\n\n\tshape = Physics2DServer.circle_shape_create()\n\t# Set the collision shape's radius for each bullet in pixels.\n\tPhysics2DServer.shape_set_data(shape, 8)\n\n\tfor _i in BULLET_COUNT:\n\t\tvar bullet = Bullet.new()\n\t\t# Give each bullet its own speed.\n\t\tbullet.speed = rand_range(SPEED_MIN, SPEED_MAX)\n\t\tbullet.body = Physics2DServer.body_create()\n\n\t\tPhysics2DServer.body_set_space(bullet.body, get_world_2d().get_space())\n\t\tPhysics2DServer.body_add_shape(bullet.body, shape)\n\t\t# Don't make bullets check collision with other bullets to improve performance.\n\t\t# Their collision mask is still configured to the default value, which allows\n\t\t# bullets to detect collisions with the player.\n\t\tPhysics2DServer.body_set_collision_layer(bullet.body, 0)\n\n\t\t# Place bullets randomly on the viewport and move bullets outside the\n\t\t# play area so that they fade in nicely.\n\t\tbullet.position = Vector2(\n\t\t\trand_range(0, get_viewport_rect().size.x) + get_viewport_rect().size.x,\n\t\t\trand_range(0, get_viewport_rect().size.y)\n\t\t)\n\t\tvar transform2d = Transform2D()\n\t\ttransform2d.origin = bullet.position\n\t\tPhysics2DServer.body_set_state(bullet.body, Physics2DServer.BODY_STATE_TRANSFORM, transform2d)\n\n\t\tbullets.push_back(bullet)\n\n\nfunc _process(_delta):\n\t# Order the CanvasItem to update every frame.\n\tupdate()\n\n\nfunc _physics_process(delta):\n\tvar transform2d = Transform2D()\n\tvar offset = get_viewport_rect().size.x + 16\n\tfor bullet in bullets:\n\t\tbullet.position.x -= bullet.speed * delta\n\n\t\tif bullet.position.x < -16:\n\t\t\t# The bullet has left the screen; move it back to the right.\n\t\t\tbullet.position.x = offset\n\n\t\ttransform2d.origin = bullet.position\n\n\t\tPhysics2DServer.body_set_state(bullet.body, Physics2DServer.BODY_STATE_TRANSFORM, transform2d)\n\n\n# Instead of drawing each bullet individually in a script attached to each bullet,\n# we are drawing *all* the bullets at once here.\nfunc _draw():\n\tvar offset = -bullet_image.get_size() * 0.5\n\tfor bullet in bullets:\n\t\tdraw_texture(bullet_image, bullet.position + offset)\n\n\n# Perform cleanup operations (required to exit without error messages in the console).\nfunc _exit_tree():\n\tfor bullet in bullets:\n\t\tPhysics2DServer.free_rid(bullet.body)\n\n\tPhysics2DServer.free_rid(shape)\n\tbullets.clear()\n","old_contents":"extends Node2D\n# This demo is an example of controling a high number of 2D objects with logic\n# and collision without using nodes in the scene. This technique is a lot more\n# efficient than using instancing and nodes, but requires more programming and\n# is less visual. Bullets are managed together in the `bullets.gd` script.\n\nconst BULLET_COUNT = 500\nconst SPEED_MIN = 20\nconst SPEED_MAX = 80\n\nconst bullet_image = preload(\"res:\/\/bullet.png\")\n\nvar bullets = []\nvar shape\n\n\nclass Bullet:\n\tvar position = Vector2()\n\tvar speed = 1.0\n\t# The body is stored as a RID, which is an \"opaque\" way to access resources.\n\t# With large amounts of objects (thousands or more), it can be significantly\n\t# faster to use RIDs compared to a high-level approach.\n\tvar body = RID()\n\n\nfunc _ready():\n\trandomize()\n\n\tshape = Physics2DServer.circle_shape_create()\n\t# Set the collision shape's radius for each bullet in pixels.\n\tPhysics2DServer.shape_set_data(shape, 8)\n\n\tfor _i in BULLET_COUNT:\n\t\tvar bullet = Bullet.new()\n\t\t# Give each bullet its own speed.\n\t\tbullet.speed = rand_range(SPEED_MIN, SPEED_MAX)\n\t\tbullet.body = Physics2DServer.body_create()\n\n\t\tPhysics2DServer.body_set_space(bullet.body, get_world_2d().get_space())\n\t\tPhysics2DServer.body_add_shape(bullet.body, shape)\n\n\t\t# Place bullets randomly on the viewport and move bullets outside the\n\t\t# play area so that they fade in nicely.\n\t\tbullet.position = Vector2(\n\t\t\trand_range(0, get_viewport_rect().size.x) + get_viewport_rect().size.x,\n\t\t\trand_range(0, get_viewport_rect().size.y)\n\t\t)\n\t\tvar transform2d = Transform2D()\n\t\ttransform2d.origin = bullet.position\n\t\tPhysics2DServer.body_set_state(bullet.body, Physics2DServer.BODY_STATE_TRANSFORM, transform2d)\n\n\t\tbullets.push_back(bullet)\n\n\nfunc _process(_delta):\n\t# Order the CanvasItem to update every frame.\n\tupdate()\n\n\nfunc _physics_process(delta):\n\tvar transform2d = Transform2D()\n\tvar offset = get_viewport_rect().size.x + 16\n\tfor bullet in bullets:\n\t\tbullet.position.x -= bullet.speed * delta\n\n\t\tif bullet.position.x < -16:\n\t\t\t# The bullet has left the screen; move it back to the right.\n\t\t\tbullet.position.x = offset\n\n\t\ttransform2d.origin = bullet.position\n\n\t\tPhysics2DServer.body_set_state(bullet.body, Physics2DServer.BODY_STATE_TRANSFORM, transform2d)\n\n\n# Instead of drawing each bullet individually in a script attached to each bullet,\n# we are drawing *all* the bullets at once here.\nfunc _draw():\n\tvar offset = -bullet_image.get_size() * 0.5\n\tfor bullet in bullets:\n\t\tdraw_texture(bullet_image, bullet.position + offset)\n\n\n# Perform cleanup operations (required to exit without error messages in the console).\nfunc _exit_tree():\n\tfor bullet in bullets:\n\t\tPhysics2DServer.free_rid(bullet.body)\n\n\tPhysics2DServer.free_rid(shape)\n\tbullets.clear()\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"5c13d2126017fc25c44c058cb2d8e02f5f4030ee","subject":"Docs: 2D Platformer - Update Pause Mode Comments","message":"Docs: 2D Platformer - Update Pause Mode Comments\n\nI believe this comment got out-of-date (based on the fact that the `Stage` scene seems like something that was in an older version of the demo: https:\/\/github.com\/godotengine\/godot-demo-projects\/blob\/81441c42b79e38e54c2bc38acee3205f22431738\/2d\/platformer\/Stage.tscn), so updated the commment to reflect the current state of the demo, along with some other information that I thought a developer might find helpful.\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"2d\/platformer\/src\/Main\/Game.gd","new_file":"2d\/platformer\/src\/Main\/Game.gd","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"mit","lang":"GDScript"} {"commit":"6dbb3ba3c3df8ff1ac4cceb4776cb0b432233420","subject":"Randomized platform positions","message":"Randomized platform positions\n","repos":"w84death\/mountain-of-hope","old_file":"scripts\/map\/map.gd","new_file":"scripts\/map\/map.gd","new_contents":"\nvar bag\n\nvar segments = []\nvar last_visited_segment = -1\n\nvar SCREEN_WIDTH = Globals.get(\"display\/width\")\nvar SCREEN_HEIGHT = Globals.get(\"display\/height\")\nvar SCREEN_MARGIN = 200\n\nvar SEGMENT_SIZE = 60\nvar SEGMENT_LINE_HEIGHT = 36\n\nvar WALL_HEIGHT = 39\nvar WALL_HALF_WIDTH = 36\n\nvar platforms = [\n { 'width' : 100, 'template' : preload('res:\/\/scenes\/map\/platform_grass.xscn') }\n]\n\nvar left_wall_template = preload('res:\/\/scenes\/map\/wall_left.xscn')\nvar right_wall_template = preload('res:\/\/scenes\/map\/wall_right.xscn')\nvar separator_template = preload('res:\/\/scenes\/map\/base_platform.xscn')\nvar playable_width = 0\n\n\nfunc _init_bag(bag):\n self.bag = bag\n self.playable_width = self.SCREEN_WIDTH - (self.SCREEN_MARGIN * 2)\n self.reset_map()\n\nfunc reset_map():\n for segment in self.segments:\n self.destroy_unused_segment(segment)\n self.segments.clear()\n\n\nfunc generate_next_map_segment():\n var next_segment_index = self.segments.size()\n\n var new_segment = []\n\n new_segment = self.add_walls(new_segment)\n new_segment = self.add_separator(new_segment)\n new_segment = self.add_platforms(new_segment)\n\n self.segments.append(new_segment)\n self.apply_segment(next_segment_index)\n self.destroy_unused_segment_by_id(next_segment_index - 3)\n\nfunc apply_segment(id):\n var segment_offset = id * self.SEGMENT_SIZE * self.SEGMENT_LINE_HEIGHT\n for object in self.segments[id]:\n self.bag.action_controller.attach_object(object.object)\n object.object.set_global_pos(Vector2(object.x, -object.y - segment_offset))\n\nfunc destroy_unused_segment_by_id(id):\n if id < 0:\n return\n\n self.destroy_unused_segment(self.segments[id])\n\nfunc destroy_unused_segment(segment):\n for object in segment:\n self.bag.action_controller.detach_object(object.object)\n object.object.queue_free()\n\n segment.clear()\n\nfunc add_segment_object(segment, x, y, object):\n segment.append({\n 'x' : x,\n 'y' : y,\n 'object' : object\n })\n\n return segment\n\nfunc add_separator(segment):\n var separator_platform = self.separator_template.instance()\n segment = self.add_segment_object(segment, -10, self.SEGMENT_LINE_HEIGHT, separator_platform)\n return segment\n\nfunc add_walls(segment):\n var height = 0\n var left_wall\n var right_wall\n var wall_offset\n var real_height\n\n while height < self.SEGMENT_SIZE:\n left_wall = self.left_wall_template.instance()\n right_wall = self.right_wall_template.instance()\n\n wall_offset = self.SCREEN_MARGIN - self.WALL_HALF_WIDTH\n real_height = (height + self.WALL_HEIGHT \/ 2) * self.SEGMENT_LINE_HEIGHT\n segment = self.add_segment_object(segment, wall_offset, real_height, left_wall)\n segment = self.add_segment_object(segment, wall_offset + self.playable_width + self.WALL_HALF_WIDTH * 2, real_height, right_wall)\n\n height = height + self.WALL_HEIGHT\n return segment\n\nfunc update_segments(player_height):\n var segment_height = self.SEGMENT_SIZE * self.SEGMENT_LINE_HEIGHT\n var overflow = player_height % segment_height\n\n var segment_num = (player_height - overflow) \/ segment_height\n\n if overflow > 100 && segment_num > self.last_visited_segment:\n self.last_visited_segment = segment_num\n self.generate_next_map_segment()\n\nfunc add_platforms(segment):\n var iterator = 2\n var last_iterator = 0\n\n randomize()\n\n while iterator < self.SEGMENT_SIZE - 3:\n segment = self.generate_single_platform(segment, iterator)\n\n last_iterator = iterator\n\n if randi() % 10 == 0:\n iterator = iterator + 2\n else:\n if randi() % 2 == 0:\n iterator = iterator + 3\n else:\n iterator = iterator + 4\n\n if last_iterator < self.SEGMENT_SIZE - 3:\n segment = self.generate_single_platform(segment, self.SEGMENT_SIZE - 3)\n\n return segment\n\nfunc generate_single_platform(segment, iterator):\n var template = self.platforms[randi() % self.platforms.size()]\n var new_platform = template.template.instance()\n\n var horizontal_position = randi() % (self.playable_width - template.width)\n horizontal_position = horizontal_position + self.SCREEN_MARGIN + int(template.width \/ 2)\n\n segment = self.add_segment_object(segment, horizontal_position, (iterator + 1) * self.SEGMENT_LINE_HEIGHT, new_platform)\n\n return segment","old_contents":"\nvar bag\n\nvar segments = []\nvar last_visited_segment = -1\n\nvar SCREEN_WIDTH = Globals.get(\"display\/width\")\nvar SCREEN_HEIGHT = Globals.get(\"display\/height\")\nvar SCREEN_MARGIN = 200\n\nvar SEGMENT_SIZE = 60\nvar SEGMENT_LINE_HEIGHT = 36\n\nvar WALL_HEIGHT = 39\nvar WALL_HALF_WIDTH = 36\n\nvar platforms = [\n { 'width' : 100, 'template' : preload('res:\/\/scenes\/map\/platform_grass.xscn') }\n]\n\nvar left_wall_template = preload('res:\/\/scenes\/map\/wall_left.xscn')\nvar right_wall_template = preload('res:\/\/scenes\/map\/wall_right.xscn')\nvar separator_template = preload('res:\/\/scenes\/map\/base_platform.xscn')\nvar playable_width = 0\n\n\nfunc _init_bag(bag):\n self.bag = bag\n self.playable_width = self.SCREEN_WIDTH - (self.SCREEN_MARGIN * 2)\n self.reset_map()\n\nfunc reset_map():\n for segment in self.segments:\n self.destroy_unused_segment(segment)\n self.segments.clear()\n\n\nfunc generate_next_map_segment():\n var next_segment_index = self.segments.size()\n\n var new_segment = []\n\n new_segment = self.add_walls(new_segment)\n new_segment = self.add_separator(new_segment)\n new_segment = self.add_platforms(new_segment)\n\n self.segments.append(new_segment)\n self.apply_segment(next_segment_index)\n self.destroy_unused_segment_by_id(next_segment_index - 3)\n\nfunc apply_segment(id):\n var segment_offset = id * self.SEGMENT_SIZE * self.SEGMENT_LINE_HEIGHT\n for object in self.segments[id]:\n self.bag.action_controller.attach_object(object.object)\n object.object.set_global_pos(Vector2(object.x, -object.y - segment_offset))\n\nfunc destroy_unused_segment_by_id(id):\n if id < 0:\n return\n\n self.destroy_unused_segment(self.segments[id])\n\nfunc destroy_unused_segment(segment):\n for object in segment:\n self.bag.action_controller.detach_object(object.object)\n object.object.queue_free()\n\n segment.clear()\n\nfunc add_segment_object(segment, x, y, object):\n segment.append({\n 'x' : x,\n 'y' : y,\n 'object' : object\n })\n\n return segment\n\nfunc add_separator(segment):\n var separator_platform = self.separator_template.instance()\n segment = self.add_segment_object(segment, -10, self.SEGMENT_LINE_HEIGHT, separator_platform)\n return segment\n\nfunc add_walls(segment):\n var height = 0\n var left_wall\n var right_wall\n var wall_offset\n var real_height\n\n while height < self.SEGMENT_SIZE:\n left_wall = self.left_wall_template.instance()\n right_wall = self.right_wall_template.instance()\n\n wall_offset = self.SCREEN_MARGIN - self.WALL_HALF_WIDTH\n real_height = (height + self.WALL_HEIGHT \/ 2) * self.SEGMENT_LINE_HEIGHT\n segment = self.add_segment_object(segment, wall_offset, real_height, left_wall)\n segment = self.add_segment_object(segment, wall_offset + self.playable_width + self.WALL_HALF_WIDTH * 2, real_height, right_wall)\n\n height = height + self.WALL_HEIGHT\n return segment\n\nfunc update_segments(player_height):\n var segment_height = self.SEGMENT_SIZE * self.SEGMENT_LINE_HEIGHT\n var overflow = player_height % segment_height\n\n var segment_num = (player_height - overflow) \/ segment_height\n\n if overflow > 100 && segment_num > self.last_visited_segment:\n self.last_visited_segment = segment_num\n self.generate_next_map_segment()\n\nfunc add_platforms(segment):\n var iterator = 2\n var new_platform\n\n while iterator < self.SEGMENT_SIZE - 1:\n new_platform = self.platforms[0].template.instance()\n\n segment = self.add_segment_object(segment, 400, (iterator + 1) * self.SEGMENT_LINE_HEIGHT, new_platform)\n iterator = iterator + 2\n\n return segment","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"d21f72adf2c7951fef1f5fd7e21234808bc23c38","subject":"Fixed typo and standardised spacing","message":"Fixed typo and standardised spacing\n","repos":"Hodes\/godot,ianholing\/godot,wardw\/godot,honix\/godot,kimsunzun\/godot,ZuBsPaCe\/godot,hitjim\/godot,supriyantomaftuh\/godot,vkbsb\/godot,hitjim\/godot,sh95119\/godot,okamstudio\/godot,zicklag\/godot,kimsunzun\/godot,guilhermefelipecgs\/godot,mikica1986vee\/Godot_android_tegra_fallback,Shockblast\/godot,DustinTriplett\/godot,DustinTriplett\/godot,crr0004\/godot,dreamsxin\/godot,BogusCurry\/godot,NateWardawg\/godot,zj8487\/godot,mcanders\/godot,karolgotowala\/godot,gau-veldt\/godot,mikica1986vee\/godot,Zylann\/godot,honix\/godot,DStomtom\/godot,sanikoyes\/godot,Brickcaster\/godot,mikica1986vee\/GodotArrayEditorStuff,davidalpha\/godot,hipgraphics\/godot,hipgraphics\/godot,honix\/godot,akien-mga\/godot,hitjim\/godot,vkbsb\/godot,DmitriySalnikov\/godot,NateWardawg\/godot,youprofit\/godot,morrow1nd\/godot,MarianoGnu\/godot,gokudomatic\/godot,mikica1986vee\/godot,dreamsxin\/godot,a12n\/godot,NateWardawg\/godot,marynate\/godot,vkbsb\/godot,jjdicharry\/godot,BoDonkey\/godot,sh95119\/godot,ageazrael\/godot,didier-v\/godot,mrezai\/godot,didier-v\/godot,exabon\/godot,JoshuaGrams\/godot,TheBoyThePlay\/godot,MarianoGnu\/godot,gau-veldt\/godot,akien-mga\/godot,ageazrael\/godot,dreamsxin\/godot,karolgotowala\/godot,TheHX\/godot,mikica1986vee\/Godot_android_tegra_fallback,gokudomatic\/godot,BastiaanOlij\/godot,groud\/godot,ex\/godot,Brickcaster\/godot,crr0004\/godot,BogusCurry\/godot,jjdicharry\/godot,mikica1986vee\/Godot_VideoModeStuff,Faless\/godot,zj8487\/godot,godotengine\/godot,FateAce\/godot,buckle2000\/godot,TheBoyThePlay\/godot,xiaoyanit\/godot,josempans\/godot,cpascal\/godot,akien-mga\/godot,DStomtom\/godot,vnen\/godot,hitjim\/godot,mikica1986vee\/godot_build_fix,a12n\/godot,serafinfernandez\/godot,Paulloz\/godot,tomreyn\/godot,shackra\/godot,FullMeta\/godot,sh95119\/godot,marynate\/godot,sanikoyes\/godot,mamarilmanson\/godot,Zylann\/godot,BastiaanOlij\/godot,liuyucoder\/godot,marynate\/godot,RandomShaper\/godot,liuyucoder\/godot,supriyantomaftuh\/godot,tomasy23\/evertonkrosnodart,guilhermefelipecgs\/godot,liuyucoder\/godot,zj8487\/godot,BastiaanOlij\/godot,youprofit\/godot,azurvii\/godot,ZuBsPaCe\/godot,BoDonkey\/godot,blackwc\/godot,MarianoGnu\/godot,zicklag\/godot,ricpelo\/godot,est31\/godot,mikica1986vee\/godot,OpenSocialGames\/godot,Hodes\/godot,wardw\/godot,vastcharade\/godot,MrMaidx\/godot,cpascal\/godot,jackmakesthings\/godot,gcbeyond\/godot,mikica1986vee\/Godot_VideoModeStuff,exabon\/godot,okamstudio\/godot,Hodes\/godot,karolgotowala\/godot,zj8487\/godot,sergicollado\/godot,ex\/godot,ageazrael\/godot,hitjim\/godot,MarianoGnu\/godot,youprofit\/godot,shackra\/godot,jejung\/godot,est31\/godot,torgartor21\/godot,firefly2442\/godot,cpascal\/godot,josempans\/godot,zj8487\/godot,TheHX\/godot,teamblubee\/godot,didier-v\/godot,DStomtom\/godot,Brickcaster\/godot,jjdicharry\/godot,dreamsxin\/godot,jackmakesthings\/godot,hitjim\/godot,shackra\/godot,godotengine\/godot,jjdicharry\/godot,Marqin\/godot,liuyucoder\/godot,quabug\/godot,Zylann\/godot,FullMeta\/godot,Zylann\/godot,serafinfernandez\/godot,BogusCurry\/godot,okamstudio\/godot,hipgraphics\/godot,ficoos\/godot,serafinfernandez\/godot,gcbeyond\/godot,pkowal1982\/godot,RebelliousX\/Go_Dot,FateAce\/godot,mikica1986vee\/godot,RebelliousX\/Go_Dot,vastcharade\/godot,BogusCurry\/godot,gokudomatic\/godot,mamarilmanson\/godot,didier-v\/godot,Paulloz\/godot,tomasy23\/evertonkrosnodart,mikica1986vee\/godot,ageazrael\/godot,vnen\/godot,ianholing\/godot,honix\/godot,sergicollado\/godot,zj8487\/godot,vnen\/godot,godotengine\/godot,mcanders\/godot,mikica1986vee\/godot,Marqin\/godot,azurvii\/godot,pixelpicosean\/my-godot-2.1,crr0004\/godot,TheHX\/godot,huziyizero\/godot,BastiaanOlij\/godot,iap-mutant\/godot,mcanders\/godot,MrMaidx\/godot,FullMeta\/godot,xiaoyanit\/godot,tomasy23\/evertonkrosnodart,davidalpha\/godot,torgartor21\/godot,davidalpha\/godot,a12n\/godot,torgartor21\/godot,BogusCurry\/godot,vastcharade\/godot,teamblubee\/godot,torgartor21\/godot,vkbsb\/godot,gokudomatic\/godot,HatiEth\/godot,Shockblast\/godot,RandomShaper\/godot,davidalpha\/godot,Brickcaster\/godot,didier-v\/godot,ficoos\/godot,ricpelo\/godot,xiaoyanit\/godot,mrezai\/godot,BogusCurry\/godot,quabug\/godot,DustinTriplett\/godot,josempans\/godot,mikica1986vee\/Godot_android_tegra_fallback,Valentactive\/godot,mikica1986vee\/godot_build_fix,mikica1986vee\/godot_build_fix,hipgraphics\/godot,RebelliousX\/Go_Dot,jackmakesthings\/godot,gcbeyond\/godot,godotengine\/godot,cpascal\/godot,hipgraphics\/godot,mikica1986vee\/godot_build_fix,marynate\/godot,akien-mga\/godot,gau-veldt\/godot,rollenrolm\/godot,ianholing\/godot,agusbena\/godot,vkbsb\/godot,vastcharade\/godot,exabon\/godot,mikica1986vee\/GodotArrayEditorStuff,liuyucoder\/godot,Marqin\/godot,marynate\/godot,honix\/godot,blackwc\/godot,zicklag\/godot,BastiaanOlij\/godot,mamarilmanson\/godot,n-pigeon\/godot,akien-mga\/godot,FateAce\/godot,mikica1986vee\/godot_build_fix,JoshuaGrams\/godot,mikica1986vee\/Godot_android_tegra_fallback,rollenrolm\/godot,gcbeyond\/godot,vastcharade\/godot,teamblubee\/godot,liuyucoder\/godot,firefly2442\/godot,shackra\/godot,gokudomatic\/godot,OpenSocialGames\/godot,josempans\/godot,DStomtom\/godot,quabug\/godot,ex\/godot,didier-v\/godot,sh95119\/godot,mikica1986vee\/godot_build_fix,Paulloz\/godot,TheBoyThePlay\/godot,Shockblast\/godot,youprofit\/godot,NateWardawg\/godot,cpascal\/godot,JoshuaGrams\/godot,kimsunzun\/godot,mamarilmanson\/godot,BogusCurry\/godot,mrezai\/godot,mikica1986vee\/Godot_android_tegra_fallback,HatiEth\/godot,marynate\/godot,mamarilmanson\/godot,firefly2442\/godot,jjdicharry\/godot,gcbeyond\/godot,gcbeyond\/godot,dreamsxin\/godot,Shockblast\/godot,OpenSocialGames\/godot,Paulloz\/godot,youprofit\/godot,blackwc\/godot,ZuBsPaCe\/godot,liuyucoder\/godot,torgartor21\/godot,gokudomatic\/godot,DmitriySalnikov\/godot,groud\/godot,Marqin\/godot,jejung\/godot,MarianoGnu\/godot,ZuBsPaCe\/godot,sergicollado\/godot,ZuBsPaCe\/godot,okamstudio\/godot,jejung\/godot,ex\/godot,dreamsxin\/godot,Valentactive\/godot,opmana\/godot,BoDonkey\/godot,lietu\/godot,azurvii\/godot,DmitriySalnikov\/godot,cpascal\/godot,gcbeyond\/godot,ageazrael\/godot,hipgraphics\/godot,quabug\/godot,jackmakesthings\/godot,vastcharade\/godot,TheBoyThePlay\/godot,ianholing\/godot,ricpelo\/godot,ficoos\/godot,groud\/godot,zj8487\/godot,teamblubee\/godot,Max-Might\/godot,davidalpha\/godot,buckle2000\/godot,kimsunzun\/godot,ficoos\/godot,gokudomatic\/godot,Shockblast\/godot,okamstudio\/godot,guilhermefelipecgs\/godot,xiaoyanit\/godot,Brickcaster\/godot,wardw\/godot,OpenSocialGames\/godot,mcanders\/godot,xiaoyanit\/godot,TheBoyThePlay\/godot,pixelpicosean\/my-godot-2.1,jejung\/godot,torgartor21\/godot,huziyizero\/godot,hipgraphics\/godot,lietu\/godot,iap-mutant\/godot,ageazrael\/godot,karolgotowala\/godot,mikica1986vee\/GodotArrayEditorStuff,hitjim\/godot,serafinfernandez\/godot,tomreyn\/godot,gokudomatic\/godot,BoDonkey\/godot,mamarilmanson\/godot,cpascal\/godot,okamstudio\/godot,pixelpicosean\/my-godot-2.1,mikica1986vee\/Godot_VideoModeStuff,ageazrael\/godot,BoDonkey\/godot,kimsunzun\/godot,agusbena\/godot,ricpelo\/godot,davidalpha\/godot,sh95119\/godot,pkowal1982\/godot,DStomtom\/godot,opmana\/godot,quabug\/godot,OpenSocialGames\/godot,zicklag\/godot,BastiaanOlij\/godot,ricpelo\/godot,quabug\/godot,TheBoyThePlay\/godot,lietu\/godot,Faless\/godot,supriyantomaftuh\/godot,ricpelo\/godot,sh95119\/godot,supriyantomaftuh\/godot,HatiEth\/godot,torgartor21\/godot,mikica1986vee\/Godot_android_tegra_fallback,gcbeyond\/godot,josempans\/godot,didier-v\/godot,sanikoyes\/godot,Marqin\/godot,BoDonkey\/godot,DustinTriplett\/godot,teamblubee\/godot,marynate\/godot,mikica1986vee\/godot,serafinfernandez\/godot,serafinfernandez\/godot,jackmakesthings\/godot,sanikoyes\/godot,liuyucoder\/godot,OpenSocialGames\/godot,dreamsxin\/godot,est31\/godot,pkowal1982\/godot,mikica1986vee\/Godot_android_tegra_fallback,mrezai\/godot,MarianoGnu\/godot,RebelliousX\/Go_Dot,iap-mutant\/godot,ricpelo\/godot,quabug\/godot,crr0004\/godot,iap-mutant\/godot,kimsunzun\/godot,shackra\/godot,sh95119\/godot,mamarilmanson\/godot,ex\/godot,morrow1nd\/godot,vnen\/godot,DStomtom\/godot,crr0004\/godot,FullMeta\/godot,shackra\/godot,gcbeyond\/godot,RandomShaper\/godot,Brickcaster\/godot,tomasy23\/evertonkrosnodart,RandomShaper\/godot,okamstudio\/godot,lietu\/godot,hitjim\/godot,mikica1986vee\/Godot_VideoModeStuff,Brickcaster\/godot,teamblubee\/godot,jjdicharry\/godot,xiaoyanit\/godot,gokudomatic\/godot,FullMeta\/godot,ficoos\/godot,ex\/godot,mikica1986vee\/GodotArrayEditorStuff,pkowal1982\/godot,gcbeyond\/godot,blackwc\/godot,DStomtom\/godot,mikica1986vee\/Godot_android_tegra_fallback,mikica1986vee\/GodotArrayEditorStuff,hipgraphics\/godot,jackmakesthings\/godot,torgartor21\/godot,iap-mutant\/godot,cpascal\/godot,serafinfernandez\/godot,NateWardawg\/godot,lietu\/godot,tomasy23\/evertonkrosnodart,ianholing\/godot,dreamsxin\/godot,opmana\/godot,zj8487\/godot,blackwc\/godot,karolgotowala\/godot,mrezai\/godot,Paulloz\/godot,agusbena\/godot,shackra\/godot,supriyantomaftuh\/godot,crr0004\/godot,rollenrolm\/godot,lietu\/godot,didier-v\/godot,firefly2442\/godot,Marqin\/godot,n-pigeon\/godot,BoDonkey\/godot,Max-Might\/godot,sanikoyes\/godot,wardw\/godot,mikica1986vee\/GodotArrayEditorStuff,azurvii\/godot,vkbsb\/godot,a12n\/godot,ianholing\/godot,DStomtom\/godot,Zylann\/godot,pkowal1982\/godot,morrow1nd\/godot,pkowal1982\/godot,hipgraphics\/godot,OpenSocialGames\/godot,mamarilmanson\/godot,Valentactive\/godot,huziyizero\/godot,blackwc\/godot,TheBoyThePlay\/godot,iap-mutant\/godot,TheBoyThePlay\/godot,didier-v\/godot,mikica1986vee\/Godot_android_tegra_fallback,Shockblast\/godot,mrezai\/godot,a12n\/godot,BoDonkey\/godot,davidalpha\/godot,Paulloz\/godot,DStomtom\/godot,crr0004\/godot,wardw\/godot,MrMaidx\/godot,supriyantomaftuh\/godot,josempans\/godot,akien-mga\/godot,sh95119\/godot,exabon\/godot,mrezai\/godot,karolgotowala\/godot,godotengine\/godot,TheBoyThePlay\/godot,jjdicharry\/godot,godotengine\/godot,est31\/godot,FullMeta\/godot,pkowal1982\/godot,jjdicharry\/godot,marynate\/godot,akien-mga\/godot,TheHX\/godot,davidalpha\/godot,BogusCurry\/godot,HatiEth\/godot,ricpelo\/godot,RebelliousX\/Go_Dot,FateAce\/godot,HatiEth\/godot,blackwc\/godot,ex\/godot,sanikoyes\/godot,vastcharade\/godot,HatiEth\/godot,blackwc\/godot,JoshuaGrams\/godot,pixelpicosean\/my-godot-2.1,karolgotowala\/godot,MrMaidx\/godot,mcanders\/godot,godotengine\/godot,jackmakesthings\/godot,sh95119\/godot,agusbena\/godot,DmitriySalnikov\/godot,RandomShaper\/godot,cpascal\/godot,MrMaidx\/godot,teamblubee\/godot,Hodes\/godot,buckle2000\/godot,HatiEth\/godot,guilhermefelipecgs\/godot,guilhermefelipecgs\/godot,youprofit\/godot,akien-mga\/godot,blackwc\/godot,agusbena\/godot,mamarilmanson\/godot,okamstudio\/godot,NateWardawg\/godot,liuyucoder\/godot,FateAce\/godot,sergicollado\/godot,mikica1986vee\/Godot_VideoModeStuff,youprofit\/godot,sergicollado\/godot,tomasy23\/evertonkrosnodart,n-pigeon\/godot,Faless\/godot,NateWardawg\/godot,karolgotowala\/godot,a12n\/godot,est31\/godot,firefly2442\/godot,a12n\/godot,shackra\/godot,Valentactive\/godot,TheHX\/godot,JoshuaGrams\/godot,mikica1986vee\/godot_build_fix,Valentactive\/godot,FullMeta\/godot,serafinfernandez\/godot,sh95119\/godot,vastcharade\/godot,BoDonkey\/godot,Zylann\/godot,shackra\/godot,xiaoyanit\/godot,wardw\/godot,mikica1986vee\/GodotArrayEditorStuff,sanikoyes\/godot,guilhermefelipecgs\/godot,ianholing\/godot,exabon\/godot,TheBoyThePlay\/godot,iap-mutant\/godot,a12n\/godot,OpenSocialGames\/godot,youprofit\/godot,morrow1nd\/godot,buckle2000\/godot,HatiEth\/godot,davidalpha\/godot,youprofit\/godot,teamblubee\/godot,RandomShaper\/godot,FullMeta\/godot,ex\/godot,iap-mutant\/godot,quabug\/godot,mikica1986vee\/GodotArrayEditorStuff,DustinTriplett\/godot,Faless\/godot,DStomtom\/godot,ricpelo\/godot,agusbena\/godot,tomreyn\/godot,okamstudio\/godot,huziyizero\/godot,ianholing\/godot,opmana\/godot,marynate\/godot,teamblubee\/godot,Paulloz\/godot,DmitriySalnikov\/godot,sergicollado\/godot,zj8487\/godot,azurvii\/godot,vastcharade\/godot,youprofit\/godot,davidalpha\/godot,Max-Might\/godot,BastiaanOlij\/godot,supriyantomaftuh\/godot,buckle2000\/godot,tomasy23\/evertonkrosnodart,tomreyn\/godot,morrow1nd\/godot,a12n\/godot,teamblubee\/godot,FateAce\/godot,crr0004\/godot,ianholing\/godot,OpenSocialGames\/godot,rollenrolm\/godot,opmana\/godot,okamstudio\/godot,Hodes\/godot,mikica1986vee\/Godot_VideoModeStuff,guilhermefelipecgs\/godot,kimsunzun\/godot,NateWardawg\/godot,serafinfernandez\/godot,RebelliousX\/Go_Dot,ZuBsPaCe\/godot,morrow1nd\/godot,Faless\/godot,liuyucoder\/godot,crr0004\/godot,vnen\/godot,Shockblast\/godot,n-pigeon\/godot,sergicollado\/godot,quabug\/godot,josempans\/godot,Zylann\/godot,torgartor21\/godot,vkbsb\/godot,wardw\/godot,iap-mutant\/godot,vnen\/godot,dreamsxin\/godot,DustinTriplett\/godot,FullMeta\/godot,firefly2442\/godot,gokudomatic\/godot,xiaoyanit\/godot,iap-mutant\/godot,serafinfernandez\/godot,Max-Might\/godot,zicklag\/godot,DustinTriplett\/godot,vnen\/godot,cpascal\/godot,jejung\/godot,blackwc\/godot,OpenSocialGames\/godot,jackmakesthings\/godot,mikica1986vee\/godot,Zylann\/godot,Valentactive\/godot,n-pigeon\/godot,zj8487\/godot,BastiaanOlij\/godot,NateWardawg\/godot,Max-Might\/godot,DmitriySalnikov\/godot,dreamsxin\/godot,mrezai\/godot,torgartor21\/godot,HatiEth\/godot,quabug\/godot,est31\/godot,didier-v\/godot,Faless\/godot,jackmakesthings\/godot,ricpelo\/godot,hipgraphics\/godot,MarianoGnu\/godot,huziyizero\/godot,kimsunzun\/godot,xiaoyanit\/godot,xiaoyanit\/godot,MrMaidx\/godot,wardw\/godot,pixelpicosean\/my-godot-2.1,DmitriySalnikov\/godot,buckle2000\/godot,supriyantomaftuh\/godot,kimsunzun\/godot,shackra\/godot,mikica1986vee\/GodotArrayEditorStuff,vkbsb\/godot,ficoos\/godot,firefly2442\/godot,mikica1986vee\/godot,ZuBsPaCe\/godot,mamarilmanson\/godot,lietu\/godot,azurvii\/godot,BogusCurry\/godot,jjdicharry\/godot,guilhermefelipecgs\/godot,wardw\/godot,lietu\/godot,mikica1986vee\/Godot_VideoModeStuff,FullMeta\/godot,DustinTriplett\/godot,HatiEth\/godot,karolgotowala\/godot,supriyantomaftuh\/godot,ianholing\/godot,agusbena\/godot,jjdicharry\/godot,supriyantomaftuh\/godot,RandomShaper\/godot,mcanders\/godot,sanikoyes\/godot,sergicollado\/godot,kimsunzun\/godot,mikica1986vee\/godot,mikica1986vee\/GodotArrayEditorStuff,vastcharade\/godot,crr0004\/godot,Shockblast\/godot,lietu\/godot,tomreyn\/godot,sergicollado\/godot,mikica1986vee\/Godot_android_tegra_fallback,ZuBsPaCe\/godot,jejung\/godot,agusbena\/godot,vnen\/godot,tomasy23\/evertonkrosnodart,honix\/godot,sergicollado\/godot,Max-Might\/godot,groud\/godot,marynate\/godot,karolgotowala\/godot,rollenrolm\/godot,jackmakesthings\/godot,lietu\/godot,gau-veldt\/godot,Faless\/godot,gau-veldt\/godot,Valentactive\/godot,BogusCurry\/godot,wardw\/godot,BoDonkey\/godot,JoshuaGrams\/godot,n-pigeon\/godot,godotengine\/godot,Hodes\/godot,n-pigeon\/godot,mikica1986vee\/godot_build_fix,josempans\/godot,hitjim\/godot,firefly2442\/godot,MarianoGnu\/godot,Valentactive\/godot,hitjim\/godot,groud\/godot,Faless\/godot,exabon\/godot,zicklag\/godot,groud\/godot,pkowal1982\/godot,a12n\/godot,mikica1986vee\/Godot_VideoModeStuff","old_file":"demos\/2d\/pong\/pong.gd","new_file":"demos\/2d\/pong\/pong.gd","new_contents":"\nextends Node2D\n\n#member variables here, example:\n#var a=2\n#var b=\"textvar\"\nconst INITIAL_BALL_SPEED = 80\nvar ball_speed = INITIAL_BALL_SPEED\nvar screen_size = Vector2(640,400)\n#default ball direction\nvar direction = Vector2(-1,0)\nvar pad_size = Vector2(8,32)\nconst PAD_SPEED = 150\n\n\nfunc _process(delta):\n\n\n\t#get ball position and pad rectangles\n\tvar ball_pos = get_node(\"ball\").get_pos()\n\tvar left_rect = Rect2( get_node(\"left\").get_pos() - pad_size*0.5, pad_size )\n\tvar right_rect = Rect2( get_node(\"right\").get_pos() - pad_size*0.5, pad_size )\n\t\n\t#integrate new ball postion\n\tball_pos+=direction*ball_speed*delta\n\t\n\t#flip when touching roof or floor\n\tif ( (ball_pos.y<0 and direction.y <0) or (ball_pos.y>screen_size.y and direction.y>0)):\n\t\tdirection.y = -direction.y\n\t\t\n\t#flip, change direction and increase speed when touching pads\t\n\tif ( (left_rect.has_point(ball_pos) and direction.x < 0) or (right_rect.has_point(ball_pos) and direction.x > 0)):\n\t\tdirection.x=-direction.x\n\t\tball_speed*=1.1\n\t\tdirection.y=randf()*2.0-1\n\t\tdirection = direction.normalized()\n\n\t#check gameover\n\tif (ball_pos.x<0 or ball_pos.x>screen_size.x):\n\t\tball_pos=screen_size*0.5\n\t\tball_speed=INITIAL_BALL_SPEED\n\t\tdirection=Vector2(-1,0)\n\t\t\t\n\t\t\t\t\t\t\n\tget_node(\"ball\").set_pos(ball_pos)\n\n\t#move left pad\n\tvar left_pos = get_node(\"left\").get_pos()\n\t\n\tif (left_pos.y > 0 and Input.is_action_pressed(\"left_move_up\")):\n\t\tleft_pos.y+=-PAD_SPEED*delta\n\tif (left_pos.y < screen_size.y and Input.is_action_pressed(\"left_move_down\")):\n\t\tleft_pos.y+=PAD_SPEED*delta\n\t\t\n\tget_node(\"left\").set_pos(left_pos)\n\t\t\n\t#move right pad\t\n\tvar right_pos = get_node(\"right\").get_pos()\n\t\n\tif (right_pos.y > 0 and Input.is_action_pressed(\"right_move_up\")):\n\t\tright_pos.y+=-PAD_SPEED*delta\n\tif (right_pos.y < screen_size.y and Input.is_action_pressed(\"right_move_down\")):\n\t\tright_pos.y+=PAD_SPEED*delta\n\t\t\n\tget_node(\"right\").set_pos(right_pos)\n\t\n\t \n\nfunc _ready():\n\tscreen_size = get_viewport_rect().size #get actual size\n\tpad_size = get_node(\"left\").get_texture().get_size()\n\tset_process(true)\n\n","old_contents":"\nextends Node2D\n\n# member variables here, example:\n# var a=2\n# var b=\"textvar\"\nconst INITIAL_BALL_SPEED = 80\nvar ball_speed = INITIAL_BALL_SPEED\nvar screen_size = Vector2(640,400)\n#default ball direction\nvar direction = Vector2(-1,0)\nvar pad_size = Vector2(8,32)\nconst PAD_SPEED = 150\n\n\nfunc _process(delta):\n\n\n\t# get ball positio and pad rectangles\n\tvar ball_pos = get_node(\"ball\").get_pos()\n\tvar left_rect = Rect2( get_node(\"left\").get_pos() - pad_size*0.5, pad_size )\n\tvar right_rect = Rect2( get_node(\"right\").get_pos() - pad_size*0.5, pad_size )\n\t\n\t#integrate new ball postion\n\tball_pos+=direction*ball_speed*delta\n\t\n\t#flip when touching roof or floor\n\tif ( (ball_pos.y<0 and direction.y <0) or (ball_pos.y>screen_size.y and direction.y>0)):\n\t\tdirection.y = -direction.y\n\t\t\n\t#flip, change direction and increase speed when touching pads\t\n\tif ( (left_rect.has_point(ball_pos) and direction.x < 0) or (right_rect.has_point(ball_pos) and direction.x > 0)):\n\t\tdirection.x=-direction.x\n\t\tball_speed*=1.1\n\t\tdirection.y=randf()*2.0-1\n\t\tdirection = direction.normalized()\n\n\t#check gameover\n\tif (ball_pos.x<0 or ball_pos.x>screen_size.x):\n\t\tball_pos=screen_size*0.5\n\t\tball_speed=INITIAL_BALL_SPEED\n\t\tdirection=Vector2(-1,0)\n\t\t\t\n\t\t\t\t\t\t\n\tget_node(\"ball\").set_pos(ball_pos)\n\n\t#move left pad\t\n\tvar left_pos = get_node(\"left\").get_pos()\n\t\n\tif (left_pos.y > 0 and Input.is_action_pressed(\"left_move_up\")):\n\t\tleft_pos.y+=-PAD_SPEED*delta\n\tif (left_pos.y < screen_size.y and Input.is_action_pressed(\"left_move_down\")):\n\t\tleft_pos.y+=PAD_SPEED*delta\n\t\t\n\tget_node(\"left\").set_pos(left_pos)\n\t\t\n\t#move right pad\t\n\tvar right_pos = get_node(\"right\").get_pos()\n\t\n\tif (right_pos.y > 0 and Input.is_action_pressed(\"right_move_up\")):\n\t\tright_pos.y+=-PAD_SPEED*delta\n\tif (right_pos.y < screen_size.y and Input.is_action_pressed(\"right_move_down\")):\n\t\tright_pos.y+=PAD_SPEED*delta\n\t\t\n\tget_node(\"right\").set_pos(right_pos)\n\t\n\t \n\nfunc _ready():\n\tscreen_size = get_viewport_rect().size # get actual size\n\tpad_size = get_node(\"left\").get_texture().get_size()\n\tset_process(true)\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"7a9b45f1569450de1ce0b26f65a25c0d37ff074b","subject":"Update Viewports tutorial to use \"frame_post_draw\"","message":"Update Viewports tutorial to use \"frame_post_draw\"\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"viewport\/screen_capture\/screen_capture.gd","new_file":"viewport\/screen_capture\/screen_capture.gd","new_contents":"extends Node\n\nonready var captured_image = $CapturedImage\n\nfunc _on_CaptureButton_pressed():\n\tget_viewport().set_clear_mode(Viewport.CLEAR_MODE_ONLY_NEXT_FRAME)\n\t# Wait until the frame has finished before getting the texture.\n\tyield(VisualServer, \"frame_post_draw\")\n\n\t# Retrieve the captured image.\n\tvar img = get_viewport().get_texture().get_data()\n\n\t# Flip it on the y-axis (because it's flipped).\n\timg.flip_y()\n\n\t# Create a texture for it.\n\tvar tex = ImageTexture.new()\n\ttex.create_from_image(img)\n\n\t# Set the texture to the captured image node.\n\tcaptured_image.set_texture(tex)\n","old_contents":"extends Node\n\nonready var captured_image = $CapturedImage\n\nfunc _on_CaptureButton_pressed():\n\tget_viewport().set_clear_mode(Viewport.CLEAR_MODE_ONLY_NEXT_FRAME)\n\t# Let two frames pass to make sure the screen was captured.\n\tyield(get_tree(), \"idle_frame\")\n\tyield(get_tree(), \"idle_frame\")\n\n\t# Retrieve the captured image.\n\tvar img = get_viewport().get_texture().get_data()\n\n\t# Flip it on the y-axis (because it's flipped).\n\timg.flip_y()\n\n\t# Create a texture for it.\n\tvar tex = ImageTexture.new()\n\ttex.create_from_image(img)\n\n\t# Set the texture to the captured image node.\n\tcaptured_image.set_texture(tex)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"f5f98f6b8b2fd2222d56f7517eadda8c36d8990a","subject":"Fixed map offsets","message":"Fixed map offsets\n","repos":"P1X-in\/rat-is-fat","old_file":"scripts\/map\/room_loader.gd","new_file":"scripts\/map\/room_loader.gd","new_contents":"\n\nvar bag\nvar tilemap\nvar room_max_size = Vector2(20, 12)\nvar side_offset = 3\n\nvar room_templates = {\n 'start' : preload(\"res:\/\/scripts\/map\/rooms\/start_room.gd\")\n}\n\nfunc _init_bag(bag):\n self.bag = bag\n self.tilemap = self.bag.action_controller.tilemap\n\nfunc load_room(template_name):\n self.clear_space()\n self.bag.game_state.current_room = self.room_templates[template_name].new()\n self.apply_room_data(self.bag.game_state.current_room.room)\n\nfunc clear_space():\n for x in range(self.room_max_size.x):\n for y in range(self.room_max_size.y):\n self.tilemap.set_cell(x, y, -1)\n\nfunc apply_room_data(data):\n var row\n for y in range(0, data.size()):\n row = data[y]\n for x in range(0, row.size()):\n self.tilemap.set_cell(x + self.side_offset, y, data[y][x])\n","old_contents":"\n\nvar bag\nvar tilemap\nvar room_max_size = Vector2(20, 12)\nvar top_offset = 0\nvar side_offset = 3\n\nvar room_templates = {\n 'start' : preload(\"res:\/\/scripts\/map\/rooms\/start_room.gd\")\n}\n\nfunc _init_bag(bag):\n self.bag = bag\n self.tilemap = self.bag.action_controller.tilemap\n\nfunc load_room(template_name):\n self.clear_space()\n self.bag.game_state.current_room = self.room_templates[template_name].new()\n self.apply_room_data(self.bag.game_state.current_room.room)\n\nfunc clear_space():\n for x in range(self.room_max_size.x):\n for y in range(self.room_max_size.y):\n self.tilemap.set_cell(x, y, -1)\n\nfunc apply_room_data(data):\n var row\n for y in range(0, data.size() - (self.top_offset)):\n row = data[y]\n for x in range(0, row.size() - self.side_offset):\n self.tilemap.set_cell(x + self.side_offset, y + self.top_offset, data[y][x])\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"9bc452ac7544f98d37ec67cf16835b232d975ff8","subject":"tweens were not working with get_parent() and \"remove_block\". no idea why, even tried adding key=null to remove_block","message":"tweens were not working with get_parent() and \"remove_block\". no idea why, even tried adding key=null to remove_block\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Blocks\/AbstractBlock.gd","new_file":"src\/scripts\/Blocks\/AbstractBlock.gd","new_contents":"\nextends RigidBody\n\nvar name_int\nvar name\nvar pairName\nvar selected = false\nvar blockPos\nvar blockLayer\nvar blockType\nconst far_away_corner = Vector3(110, 110, 110)\n\nvar editor\n\nstatic func nameToNodeName(n):\n\treturn \"block\" + str(n)\n\nfunc setName(n):\n\tname_int = n\n\tname = nameToNodeName(n)\n\tset_name(nameToNodeName(n))\n\treturn self\n\nfunc setPairName(n):\n\tpairName = nameToNodeName(n)\n\treturn self\n\nfunc setBlockLayer(n):\n\tblockLayer = n\n\treturn self\n\nfunc getBlockLayer():\n\treturn blockLayer\n\nfunc setBlockType( blockT ):\n\tblockType = blockT\n\treturn self\n\nfunc getBlockType():\n\treturn blockType\n\nfunc setSelected(sel):\n\tselected = sel\n\treturn self\n\nfunc forceClick():\n\tactivate()\n\tget_parent().clickBlock( name )\n\nfunc addNeighbor(editor, click_normal):\n\tvar t = get_parent().get_parent().get_transform().inverse()\n\tvar b = editor.newPickledBlock().setBlockPos(blockPos + t * click_normal)\n\tget_parent().add_block(b.toNode())\n\n\n# catch clicks\/taps\nfunc _input_event( camera, ev, click_pos, click_normal, shape_idx ):\n\tif ((ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT)\n\tor (ev.type==InputEvent.SCREEN_TOUCH)):\n\t\tif (get_parent().get_parent().active and ev.is_pressed()):\n\t\t\tif editor != null:\n\t\t\t\tif editor.shouldAddNeighbor():\n\t\t\t\t\taddNeighbor(editor, click_normal)\n\t\t\t\t\treturn\n\t\t\t\tif editor.shouldReplaceSelf():\n\t\t\t\t\taddNeighbor(editor, 0 * click_normal)\n\t\t\t\t\tremove_with_pop(self, null)\n\t\t\t\t\treturn\n\t\t\t\tif editor.shouldRemoveSelf():\n\t\t\t\t\tremove_with_pop(self, null)\n\t\t\t\t\treturn\n\t\t\telse:\n\t\t\t\tforceClick()\n\n# returns this block's pairNode or null\nfunc pairActivate():\n\tselected = true\n\n\t# is my pair Nil?\n\tif pairName == null or get_parent() == null or not get_parent().has_node(pairName):\n\t\tscaleTweenNode(0.9, 0.2, Tween.TRANS_EXPO).start()\n\t\treturn null\n\n\t# get my pair node\n\tvar pairNode = get_parent().get_node(pairName)\n\n\t# enlarge if the other guy's unselected\n\tif not pairNode.selected:\n\t\tscaleTweenNode(1.1, 0.2, Tween.TRANS_EXPO).start()\n\treturn pairNode\n\n\n# returns a tween node that uniformly changes the object's scale\n# call start() on the returned object\nfunc scaleTweenNode(scale, time=1, transType=Tween.TRANS_BOUNCE):\n\tvar tweenNode = newTweenNode()\n\ttweenNode.interpolate_method( self, \"set_scale\", \\\n\t\tself.get_scale(), Vector3(scale, scale, scale), \\\n\t\ttime, transType, Tween.EASE_OUT )\n\n\treturn tweenNode\n\n# adds a tween transition node to the tree\nfunc newTweenNode():\n\tvar tween = Tween.new()\n\tadd_child(tween)\n\treturn tween\n\nfunc request_remove(node=null, key=null):\n\tget_parent().remove_block(self)\n\nfunc _ready():\n\teditor = get_tree().get_root().get_node(\"EditorSpatial\")\n\tset_ray_pickable(true)\n","old_contents":"\nextends RigidBody\n\nvar name_int\nvar name\nvar pairName\nvar selected = false\nvar blockPos\nvar blockLayer\nvar blockType\nconst far_away_corner = Vector3(110, 110, 110)\n\nvar editor\n\nstatic func nameToNodeName(n):\n\treturn \"block\" + str(n)\n\nfunc setName(n):\n\tname_int = n\n\tname = nameToNodeName(n)\n\tset_name(nameToNodeName(n))\n\treturn self\n\nfunc setPairName(n):\n\tpairName = nameToNodeName(n)\n\treturn self\n\nfunc setBlockLayer(n):\n\tblockLayer = n\n\treturn self\n\nfunc getBlockLayer():\n\treturn blockLayer\n\nfunc setBlockType( blockT ):\n\tblockType = blockT\n\treturn self\n\nfunc getBlockType():\n\treturn blockType\n\nfunc setSelected(sel):\n\tselected = sel\n\treturn self\n\nfunc forceClick():\n\tactivate()\n\tget_parent().clickBlock( name )\n\nfunc addNeighbor(editor, click_normal):\n\tvar t = get_parent().get_parent().get_transform().inverse()\n\tvar b = editor.newPickledBlock().setBlockPos(blockPos + t * click_normal)\n\tget_parent().add_block(b.toNode())\n\n\n# catch clicks\/taps\nfunc _input_event( camera, ev, click_pos, click_normal, shape_idx ):\n\tif ((ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT)\n\tor (ev.type==InputEvent.SCREEN_TOUCH)):\n\t\tif (get_parent().get_parent().active and ev.is_pressed()):\n\t\t\tif editor != null:\n\t\t\t\tif editor.shouldAddNeighbor():\n\t\t\t\t\taddNeighbor(editor, click_normal)\n\t\t\t\t\treturn\n\t\t\t\tif editor.shouldReplaceSelf():\n\t\t\t\t\taddNeighbor(editor, 0 * click_normal)\n\t\t\t\t\tremove_with_pop(self, null)\n\t\t\t\t\treturn\n\t\t\t\tif editor.shouldRemoveSelf():\n\t\t\t\t\tremove_with_pop(self, null)\n\t\t\t\t\treturn\n\t\t\telse:\n\t\t\t\tforceClick()\n\n# returns this block's pairNode or null\nfunc pairActivate():\n\tselected = true\n\n\t# is my pair Nil?\n\tif pairName == null or get_parent() == null or not get_parent().has_node(pairName):\n\t\tscaleTweenNode(0.9, 0.2, Tween.TRANS_EXPO).start()\n\t\treturn null\n\n\t# get my pair node\n\tvar pairNode = get_parent().get_node(pairName)\n\n\t# enlarge if the other guy's unselected\n\tif not pairNode.selected:\n\t\tscaleTweenNode(1.1, 0.2, Tween.TRANS_EXPO).start()\n\treturn pairNode\n\n\n# returns a tween node that uniformly changes the object's scale\n# call start() on the returned object\nfunc scaleTweenNode(scale, time=1, transType=Tween.TRANS_BOUNCE):\n\tvar tweenNode = newTweenNode()\n\ttweenNode.interpolate_method( self, \"set_scale\", \\\n\t\tself.get_scale(), Vector3(scale, scale, scale), \\\n\t\ttime, transType, Tween.EASE_OUT )\n\n\treturn tweenNode\n\n# adds a tween transition node to the tree\nfunc newTweenNode():\n\tvar tween = Tween.new()\n\tadd_child(tween)\n\treturn tween\n\nfunc remove_with_pop(node, key=null):\n\tget_parent().samplePlayer.play(\"deraj_pop_sound\")\n\tget_parent().remove_block(self)\n\nfunc _ready():\n\teditor = get_tree().get_root().get_node(\"EditorSpatial\")\n\tset_ray_pickable(true)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"c88471dd811986cb522a1e13dc751111e6e467dc","subject":"Added random tombs to be player life","message":"Added random tombs to be player life\n","repos":"DaddySmash\/GraphicsGame,DaddySmash\/GraphicsGame","old_file":"app\/code\/zombiesGo.gd","new_file":"app\/code\/zombiesGo.gd","new_contents":"extends Node\n\n#get_node(\"\/root\/global\").enteringOS <--This is the proper method to quit to desktop.\n#get_node(\"\/root\/global\").enteringMenu <--This is the proper method to get to the main menu.\n#get_node(\"\/root\/global\").currentDifficulty <--This is the proper method to get the difficulty.\n\n#Time based variables.\n#var eclipseRatio = null\n\n#Player stuff.\nvar playerScore = null\nvar playerTime = null\nvar playerDifficulty = null #This has to be between 0 and 3 to match the size of xSizeArray and ySizeArray.\nvar playerHealth = null\n#var specialAbilityAmmo = null\nvar tombArray = []\nvar tombOrigen = null\nvar tombs = null\nvar tombNumberTotal = 0\nvar xSizeArray = [3, 3, 4, 6] #[Easy, Normal, Hard, Insane]\nvar ySizeArray = [1, 2, 3, 3] #[Easy, Normal, Hard, Insane]\nvar howDiedTombCount = 3 #this is a count of the number of different flavor texts that go on tombstones.\nvar xTombSpacing = null\nvar yTombSpacing = null\nvar tombStyle = null\nvar tombList = []\n\n#var tombArray = [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\", \"J\", \"K\", \"L\", \"M\", \"N\", \"O\", \"P\", \"Q\", \"R\", \"S\", \"T\", \"U\", \"V\", \"W\", \"X\", \"Y\", \"Z\", \",\", \".\", \"_\", \"-\"]\n\nfunc _ready():\n\tget_scene().set_auto_accept_quit(false) #Enables: _notification(what) to recieve MainLoop.NOTIFICATION_WM_QUIT_REQUEST\n\tset_process(true) #Enables: _process(delta) to run every frame.\n\tplayerDifficulty = get_node(\"\/root\/global\").currentDifficulty\n\t\n\ttombs = get_node(\"tombs\")\n\txTombSpacing = 200\n\tyTombSpacing = 175\n\n\t#for g in range(glyphArray.size()):\n\t#\tn = load(\"res:\/\/scene\/getNameGlyph.xscn\").instance()\n\t#\tglyph.add_child(n)\n\t\n\ttombArray.resize(0)\n\tfor x in range(xSizeArray[playerDifficulty]):\n\t\ttombArray.append([])\n\t\tfor y in range(ySizeArray[playerDifficulty]):\n\t\t\ttombArray[x].append(load(\"res:\/\/scene\/zombiesGoTomb.xscn\").instance())\n\t\t\t#print(\"Hello World \" + str(x) + \", \" + str(y))\n\t\t\t#MARGIN_LEFT, MARGIN_TOP, MARGIN_RIGHT, MARGIN_BOTTOM\n\t\t\ttombArray[x][y].set_margin(MARGIN_LEFT, 1280\/2 - xSizeArray[playerDifficulty]*xTombSpacing\/2 + x * xTombSpacing)\n\t\t\ttombArray[x][y].set_margin(MARGIN_TOP, 720\/2 - ySizeArray[playerDifficulty]*yTombSpacing\/2 + y * yTombSpacing)\n\t\t\ttombs.add_child(tombArray[x][y])\n\t\t\t\n\t\n\t#Init settings for round.\n\t#eclipseRatio = (difficulty - 1) * 0.2\n\tplayerScore = 0\n\tplayerTime = 0\n\t#specialAbilityAmmo = 0\n\tif playerDifficulty == 0:\n\t\tplayerHealth = 3\n\tif playerDifficulty == 1:\n\t\tplayerHealth = 3\n\tif playerDifficulty == 2:\n\t\tplayerHealth = 3\n\tif playerDifficulty == 3:\n\t\tplayerHealth = 3\n\t\n\t#Create List\n\ttombList.resize(0)\n\tfor x in range(xSizeArray[playerDifficulty]):\n\t\tfor y in range(ySizeArray[playerDifficulty]):\n\t\t\ttombList.append(tombArray[x][y])\n\t\t\t\n\t\t\t\n\t\t\t#tombStyle = floor(rand_range( 0, 3)) #If floor ever returns the high value, it will be a bug on this line.\n\t\t\t#tombArray[x][y].get_node(\"normalTomb\").show()\n\t\t\t#tombArray[x][y].get_node(\"backHole\").show()\n\t\t\t#tombArray[x][y].get_node(\"frontHole\").show()\n\t\n\tfor c in range(playerHealth):\n\t\tvar h = floor(rand_range(0, tombList.size()))\n\t\ttombList[h].get_node(\"normalTomb\").show()\n\nfunc _notification(what):\n\tif (what==MainLoop.NOTIFICATION_WM_QUIT_REQUEST):\n\t\t#Submit current game and save highArray before exiting.\n\t\tget_node(\"\/root\/global\").enteringOS = true\n\t\tget_node(\"\/root\/global\").updateHighScore(rand_range(0, 9999), rand_range(0, 59))\n\nfunc _process(delta):\n\t#This is ran every frame.\n\t#get_node(\"\/root\/global\").timeString(time)\n\tplayerTime = playerTime + delta\n\tget_node(\"displayPlayerTimeOnScreen\").set_text(get_node(\"\/root\/global\").timeString(playerTime))\n\t\n\nfunc _on_backGround_pressed():\n\t#Submit current game and save highArray before ending round.\n\t#updateHighScore(score, time)\n\tget_node(\"\/root\/global\").enteringMenu = true\n\tget_node(\"\/root\/global\").updateHighScore(rand_range(0, 9999), rand_range(0, 59))\n\nfunc _on_frontGround_pressed():\n\t#Submit current game and save highArray before ending round.\n\t#updateHighScore(score, time)\n\tget_node(\"\/root\/global\").enteringMenu = true\n\tget_node(\"\/root\/global\").updateHighScore(rand_range(0, 9999), rand_range(0, 59))","old_contents":"extends Node\n\n#get_node(\"\/root\/global\").enteringOS <--This is the proper method to quit to desktop.\n#get_node(\"\/root\/global\").enteringMenu <--This is the proper method to get to the main menu.\n#get_node(\"\/root\/global\").currentDifficulty <--This is the proper method to get the difficulty.\n\n#Time based variables.\n#var eclipseRatio = null\n\n#Player stuff.\nvar playerScore = null\nvar playerTime = null\nvar playerDifficulty = null #This has to be between 0 and 3 to match the size of xSizeArray and ySizeArray.\n#var playerHealth = null\n#var specialAbilityAmmo = null\nvar tombArray = []\nvar tombOrigen = null\nvar tombs = null\nvar tombNumberTotal = 0\nvar xSizeArray = [3, 3, 4, 6] #[Easy, Normal, Hard, Insane]\nvar ySizeArray = [1, 2, 3, 3] #[Easy, Normal, Hard, Insane]\nvar howDiedTombCount = 3 #this is a count of the number of different flavor texts that go on tombstones.\nvar xTombSpacing = null\nvar yTombSpacing = null\n\n#var tombArray = [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\", \"J\", \"K\", \"L\", \"M\", \"N\", \"O\", \"P\", \"Q\", \"R\", \"S\", \"T\", \"U\", \"V\", \"W\", \"X\", \"Y\", \"Z\", \",\", \".\", \"_\", \"-\"]\n\nfunc _ready():\n\tget_scene().set_auto_accept_quit(false) #Enables: _notification(what) to recieve MainLoop.NOTIFICATION_WM_QUIT_REQUEST\n\tset_process(true) #Enables: _process(delta) to run every frame.\n\tplayerDifficulty = get_node(\"\/root\/global\").currentDifficulty\n\t\n\ttombs = get_node(\"tombs\")\n\txTombSpacing = 200\n\tyTombSpacing = 175\n\n\t#for g in range(glyphArray.size()):\n\t#\tn = load(\"res:\/\/scene\/getNameGlyph.xscn\").instance()\n\t#\tglyph.add_child(n)\n\t\n\tfor x in range(xSizeArray[playerDifficulty]):\n\t\ttombArray.append([])\n\t\tfor y in range(ySizeArray[playerDifficulty]):\n\t\t\ttombArray[x].append(load(\"res:\/\/scene\/zombiesGoTomb.xscn\").instance())\n\t\t\t#print(\"Hello World \" + str(x) + \", \" + str(y))\n\t\t\t#MARGIN_LEFT, MARGIN_TOP, MARGIN_RIGHT, MARGIN_BOTTOM\n\t\t\ttombArray[x][y].set_margin(MARGIN_LEFT, 1280\/2 - xSizeArray[playerDifficulty]*xTombSpacing\/2 + x * xTombSpacing)\n\t\t\ttombArray[x][y].set_margin(MARGIN_TOP, 720\/2 - ySizeArray[playerDifficulty]*yTombSpacing\/2 + y * yTombSpacing)\n\t\t\ttombs.add_child(tombArray[x][y])\n\t\t\t\n\t\n\t#Init settings for round.\n\t#eclipseRatio = (difficulty - 1) * 0.2\n\tplayerScore = 0\n\tplayerTime = 0\n\t#specialAbilityAmmo = 0\n\t#if playerDifficulty == 1:\n\t#\tplayerHealth = 3\n\t#if playerDifficulty == 2:\n\t#\tplayerHealth = 6\n\t#if playerDifficulty == 3:\n\t#\tplayerHealth = 5\n\t#if playerDifficulty == 4:\n\t#\tplayerHealth = 4\n\n\tfor x in range(xSizeArray[playerDifficulty]):\n\t\tfor y in range(ySizeArray[playerDifficulty]):\n\t\t\ttombArray[x][y].get_node(\"normalTomb\").show()\n\t\t\ttombArray[x][y].get_node(\"backHole\").show()\n\t\t\ttombArray[x][y].get_node(\"frontHole\").show()\n\n\nfunc _notification(what):\n\tif (what==MainLoop.NOTIFICATION_WM_QUIT_REQUEST):\n\t\t#Submit current game and save highArray before exiting.\n\t\tget_node(\"\/root\/global\").enteringOS = true\n\t\tget_node(\"\/root\/global\").updateHighScore(rand_range(0, 9999), rand_range(0, 59))\n\nfunc _process(delta):\n\t#This is ran every frame.\n\t#get_node(\"\/root\/global\").timeString(time)\n\tplayerTime = playerTime + delta\n\tget_node(\"displayPlayerTimeOnScreen\").set_text(get_node(\"\/root\/global\").timeString(playerTime))\n\t\n\nfunc _on_backGround_pressed():\n\t#Submit current game and save highArray before ending round.\n\t#updateHighScore(score, time)\n\tget_node(\"\/root\/global\").enteringMenu = true\n\tget_node(\"\/root\/global\").updateHighScore(rand_range(0, 9999), rand_range(0, 59))\n\nfunc _on_frontGround_pressed():\n\t#Submit current game and save highArray before ending round.\n\t#updateHighScore(score, time)\n\tget_node(\"\/root\/global\").enteringMenu = true\n\tget_node(\"\/root\/global\").updateHighScore(rand_range(0, 9999), rand_range(0, 59))","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"b0cb985f8fe95b6e6396afa8ad724c20374a1988","subject":"Large improvements on scene packing and management -Ability to edit and keep changes of instanced scenes and sub-scenes -Ability to inherit from other scenes","message":"Large improvements on scene packing and management\n-Ability to edit and keep changes of instanced scenes and sub-scenes\n-Ability to inherit from other scenes\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"2d\/platformer\/coin.gd","new_file":"2d\/platformer\/coin.gd","new_contents":"\nextends Area2D\n\n# member variables here, example:\n# var a=2\n# var b=\"textvar\"\n\nvar taken=false\n\n\nfunc _on_body_enter( body ):\n\tif (not taken and body extends preload(\"res:\/\/player.gd\")):\n\t\tget_node(\"anim\").play(\"taken\")\n\t\ttaken=true\n\n\nfunc _ready():\n\t# Initalization here\n\tpass\n\n\n\nfunc _on_coin_area_enter( area ):\n\tpass # replace with function body\n\n\nfunc _on_coin_area_enter_shape( area_id, area, area_shape, area_shape ):\n\tpass # replace with function body\n","old_contents":"\nextends Area2D\n\n# member variables here, example:\n# var a=2\n# var b=\"textvar\"\n\nvar taken=false\n\n\nfunc _on_body_enter( body ):\n\tif (not taken and body extends preload(\"res:\/\/player.gd\")):\n\t\tget_node(\"anim\").play(\"taken\")\n\t\ttaken=true\n\n\nfunc _ready():\n\t# Initalization here\n\tpass\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"3a660c2726ced23dd50e115ca398f4bfb2cf6dc5","subject":"Clean up comments for Puzzle.gd","message":"Clean up comments for Puzzle.gd\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Puzzle.gd","new_file":"src\/scripts\/Puzzle.gd","new_contents":"# Provides functionality for the puzzle itself\n\nextends Spatial\n\nvar DataMan = preload( \"res:\/\/scripts\/DataManager.gd\" ).new()\nvar PuzzleManScript = preload( \"res:\/\/scripts\/PuzzleManager.gd\" )\nvar PuzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar puzzleMan\nvar otherPuzzle\nvar mainPuzzle = true\n\nvar time = {\n\t\ton = true,\n\t\tval = 0.0,\n\t\tlabel = null,\n\t\ttween = null }\n\nfunc addTimer():\n\ttime.label = Label.new()\n\ttime.tween = Tween.new()\n\tadd_child(time.label)\n\tadd_child(time.tween)\n\ttime.label.set_pos(Vector2(15,15))\n\n\ttime.label.set_theme(load(\"res:\/\/themes\/MainTheme.thm\"))\n\ttime.tween.interpolate_method(time.label, \"set_pos\", \\\n\t\t\ttime.label.get_pos(), time.label.get_pos()*2, 0.5, \\\n\t\t\tTween.TRANS_BOUNCE, Tween.EASE_OUT)\n\ttime.tween.start()\n\ttime.label.set_text(str(time.val))\n\nfunc formatTime(t):\n\tvar mins = floor(t \/ 60)\n\tvar secs = fmod(floor(t), 60)\n\tvar millis = floor((t - floor(t)) * 1000)\n\treturn str(mins) + \":\" + str(secs).pad_zeros(2) + \":\" + str(millis).pad_zeros(3)\n\nfunc _process(dTime):\n\t# start label tween on\n\ttime.val += dTime\n\ttime.label.set_text(formatTime(time.val))\n\tif fmod(time.val, 10) < 0.1:\n\t\ttime.tween.seek(0.0)\n\n# Called for initialization\nfunc _ready():\n\tif time.on:\n\t\tset_process(true) # needed for time keeping\n\tpuzzleMan = PuzzleManScript.new()\n\tvar puzzle = puzzleMan.generatePuzzle( 2, puzzleMan.DIFF_EASY )\n\tpuzzle.puzzleMan = puzzleMan\n\t\n\t#set up network stuffs\n\tadd_child(load(\"res:\/\/networkProxy.scn\").instance())\n\tGlobals.get(\"Network\").proxy.set_process(true)\n\n\tprint(\"Generated \", puzzle.blocks.size(), \" blocks.\" )\n\t\n\tprint( \"Saving...\" )\n\tDataMan.savePuzzle( \"TestPuzzle.pzl\", puzzle )\n\t\n\tpuzzle = 0\n\t\n\tpuzzle = DataMan.loadPuzzle( \"TestPuzzle.pzl\" )\n\t\n\tvar steps = puzzle.solvePuzzleSteps()\n\tprint( \"PUZZLE IS SOLVEABLE?: \", steps.solveable )\n\n\taddTimer()\n\n\t# Place the blocks in the puzzle.\n\tvar gridMan = get_node( \"GridView\/GridMan\" )\n\tgridMan.shape = puzzleMan.shape\n\tgridMan.set_puzzle(puzzle)\n\tfor block in puzzle.blocks:\n\t\t# Create a block node, add it to the tree\n\t\tvar b = block.toNode()\n\t\tgridMan.add_block(b)\n\t\tgridMan.get_child(block.name) \\\n\t\t\t.set_translation(block.blockPos * 2 )\n\n\t# make a new puzzle, embed using Viewport\n\tif mainPuzzle:\n\t\tvar p = PuzzleScn.instance()\n\t\tp.get_node(\"GridView\").active = false\n\t\tp.mainPuzzle = false\n\t\tp.set_scale(Vector3(0.5, 0.5, 0.5))\n\t\tp.set_translation(Vector3(10, 5, -20))\n\n\t\tvar v = Viewport.new()\n\t\tvar c = Control.new()\n\n\t\tv.set_world(p.get_world())\n\t\tv.set_rect(Rect2(0, 0, 100, 100))\n\t\tv.set_physics_object_picking(false)\n\t\tget_node(\"Camera\").add_child(p)\n\t\tv.add_child(p)\n\t\tadd_child(c)\n\t\tc.add_child(v)\n\t\totherPuzzle = p #for use with network\n# child of control? easier input\n\n\n","old_contents":"extends Spatial\n\n# proposed script manager:\n# var PuzzleManScript = get_node(\"Globals\").get(\"PuzzleManScript\")\n\nvar DataMan = preload( \"res:\/\/scripts\/DataManager.gd\" ).new()\nvar PuzzleManScript = preload( \"res:\/\/scripts\/PuzzleManager.gd\" )\nvar PuzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar puzzleMan\nvar otherPuzzle\nvar mainPuzzle = true\n\nvar time = {\n\t\ton = true,\n\t\tval = 0.0,\n\t\tlabel = null,\n\t\ttween = null }\n\nfunc addTimer():\n\ttime.label = Label.new()\n\ttime.tween = Tween.new()\n\tadd_child(time.label)\n\tadd_child(time.tween)\n\ttime.label.set_pos(Vector2(15,15))\n\n\ttime.label.set_theme(load(\"res:\/\/themes\/MainTheme.thm\"))\n\ttime.tween.interpolate_method(time.label, \"set_pos\", \\\n\t\t\ttime.label.get_pos(), time.label.get_pos()*2, 0.5, \\\n\t\t\tTween.TRANS_BOUNCE, Tween.EASE_OUT)\n\ttime.tween.start()\n\ttime.label.set_text(str(time.val))\n\nfunc formatTime(t):\n\tvar mins = floor(t \/ 60)\n\tvar secs = fmod(floor(t), 60)\n\tvar millis = floor((t - floor(t)) * 1000)\n\treturn str(mins) + \":\" + str(secs).pad_zeros(2) + \":\" + str(millis).pad_zeros(3)\n\nfunc _process(dTime):\n\t# start label tween on\n\ttime.val += dTime\n\ttime.label.set_text(formatTime(time.val))\n\tif fmod(time.val, 10) < 0.1:\n\t\ttime.tween.seek(0.0)\n\n# Called for initialization\nfunc _ready():\n\tif time.on:\n\t\tset_process(true) # needed for time keeping\n\tpuzzleMan = PuzzleManScript.new()\n\tvar puzzle = puzzleMan.generatePuzzle( 2, puzzleMan.DIFF_EASY )\n\tpuzzle.puzzleMan = puzzleMan\n\t\n\t#set up network stuffs\n\tadd_child(load(\"res:\/\/networkProxy.scn\").instance())\n\tGlobals.get(\"Network\").proxy.set_process(true)\n\n\tprint(\"Generated \", puzzle.blocks.size(), \" blocks.\" )\n\t\n\tprint( \"Saving...\" )\n\tDataMan.savePuzzle( \"TestPuzzle.pzl\", puzzle )\n\t\n\tpuzzle = 0\n\t\n\tpuzzle = DataMan.loadPuzzle( \"TestPuzzle.pzl\" )\n\t\n\tvar steps = puzzle.solvePuzzleSteps()\n\tprint( \"PUZZLE IS SOLVEABLE?: \", steps.solveable )\n\n\taddTimer()\n\n\t# Place the blocks in the puzzle.\n\tvar gridMan = get_node( \"GridView\/GridMan\" )\n\tgridMan.shape = puzzleMan.shape\n\tgridMan.set_puzzle(puzzle)\n\tfor block in puzzle.blocks:\n\t\t# Create a block node, add it to the tree\n\t\tvar b = block.toNode()\n\t\tgridMan.add_block(b)\n\t\tgridMan.get_child(block.name) \\\n\t\t\t.set_translation(block.blockPos * 2 )\n\n\t# make a new puzzle, embed using Viewport\n\tif mainPuzzle:\n\t\tvar p = PuzzleScn.instance()\n\t\tp.get_node(\"GridView\").active = false\n\t\tp.mainPuzzle = false\n\t\tp.set_scale(Vector3(0.5, 0.5, 0.5))\n\t\tp.set_translation(Vector3(10, 5, -20))\n\n\t\tvar v = Viewport.new()\n\t\tvar c = Control.new()\n\n\t\tv.set_world(p.get_world())\n\t\tv.set_rect(Rect2(0, 0, 100, 100))\n\t\tv.set_physics_object_picking(false)\n\t\tget_node(\"Camera\").add_child(p)\n\t\tv.add_child(p)\n\t\tadd_child(c)\n\t\tc.add_child(v)\n\t\totherPuzzle = p #for use with network\n# child of control? easier input\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"7dc5c102b2599a6385a87b6137548905bb99dd25","subject":"Change Map collision layer opacity","message":"Change Map collision layer opacity\n\nTo have a see-through and don't destroy the eyes.\n","repos":"vnen\/xna-rpg-godot,vnen\/xna-rpg-godot","old_file":"project\/addons\/xml_tools\/map_parser.gd","new_file":"project\/addons\/xml_tools\/map_parser.gd","new_contents":"# The MIT License (MIT)\n#\n# Copyright (c) 2016 George Marques\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in all\n# copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n# SOFTWARE.\n\ntool\nextends \"res:\/\/addons\/xml_tools\/base_parser.gd\"\n\nfunc parse(file, parent, metadata):\n\n\tvar err = open(file)\n\tif err != OK:\n\t\treturn err\n\n\t# Read the header of the file to make sure it's a Map\n\terr = read_header(\"Map\")\n\tif err != OK:\n\t\treturn err\n\n\tvar map_data = {}\n\n\t# Read the map dimension\n\terr = read_vector2(\"MapDimensions\", map_data)\n\tif err != OK:\n\t\treturn err\n\n\t# Read the tile size\n\terr = read_vector2(\"TileSize\", map_data)\n\tif err != OK:\n\t\treturn err\n\n\t# Read the spawn position\n\terr = read_vector2(\"SpawnMapPosition\", map_data)\n\tif err != OK:\n\t\treturn err\n\n\t# Read the tileset name\n\terr = read_string(\"TextureName\", map_data)\n\tif err != OK:\n\t\treturn err\n\n\t# Read the battle background texture\n\terr = read_string(\"CombatTextureName\", map_data)\n\tif err != OK:\n\t\treturn err\n\n\t# Read the music theme name\n\terr = read_string(\"MusicCueName\", map_data)\n\tif err != OK:\n\t\treturn err\n\n\t# Read the battle theme name\n\terr = read_string(\"CombatMusicCueName\", map_data)\n\tif err != OK:\n\t\treturn err\n\n\t# Read the tilemap base layer\n\terr = read_int_array(\"BaseLayer\", map_data)\n\tif err != OK:\n\t\treturn err\n\n\t# Read the tilemap fringe layer\n\terr = read_int_array(\"FringeLayer\", map_data)\n\tif err != OK:\n\t\treturn err\n\n\t# Read the tilemap object layer\n\terr = read_int_array(\"ObjectLayer\", map_data)\n\tif err != OK:\n\t\treturn err\n\n\t# Read the tilemap colision layer\n\terr = read_int_array(\"CollisionLayer\", map_data)\n\tif err != OK:\n\t\treturn err\n\t\n\t# Read the portals\n\terr = read_object_array(\"Portals\", map_data, funcref(self, \"parse_portal_item\"))\n\tif err != OK:\n\t\treturn err\n\t\n\t# Read the portal entries\n\terr = read_object_array(\"PortalEntries\", map_data, funcref(self, \"parse_entry_item\"))\n\tif err != OK:\n\t\treturn err\n\t\n\t# Read the chest entries\n\terr = read_object_array(\"ChestEntries\", map_data, funcref(self, \"parse_entry_item\"))\n\tif err != OK:\n\t\treturn err\n\t\t\n\t# Read the fixed combat entries\n\terr = read_object_array(\"FixedCombatEntries\", map_data, funcref(self, \"parse_entry_item_with_direction\"))\n\tif err != OK:\n\t\treturn err\n\t\n\t# Read the random combat data\n\terr = read_random_combat(map_data)\n\tif err != OK:\n\t\treturn err\n\t\n\t# Read the quest NPCs\n\terr = read_object_array(\"QuestNpcEntries\", map_data, funcref(self, \"parse_entry_item_with_direction\"))\n\tif err != OK:\n\t\treturn err\n\t\n\t# Read the regular NPCs\n\terr = read_object_array(\"PlayerNpcEntries\", map_data, funcref(self, \"parse_entry_item_with_direction\"))\n\tif err != OK:\n\t\treturn err\n\t\n\t# Read the Inns\n\terr = read_object_array(\"InnEntries\", map_data, funcref(self, \"parse_entry_item\"))\n\tif err != OK:\n\t\treturn err\n\t\n\t# Read the Stores\n\terr = read_object_array(\"StoreEntries\", map_data, funcref(self, \"parse_entry_item\"))\n\tif err != OK:\n\t\treturn err\n\t\t\n\t# Finished :)\n\n\treturn make_map(parent, map_data, metadata)\n\n# Parse each portal item\nfunc parse_portal_item(parser):\n\tvar portal = {}\n\t\n\t# Read the name of the portal\n\tvar err = read_string(\"Name\", portal)\n\tif err != OK:\n\t\treturn err\n\t\n\t# Read the landing pos of the portal\n\terr = read_vector2(\"LandingMapPosition\", portal)\n\tif err != OK:\n\t\treturn err\n\t\n\t# Read the destination map of the portal\n\terr = read_string(\"DestinationMapContentName\", portal)\n\tif err != OK:\n\t\treturn err\n\t\n\t# Read the destination portal of the portal\n\terr = read_string(\"DestinationMapPortalName\", portal)\n\tif err != OK:\n\t\treturn err\n\t\n\t# Read the end element\n\terr = read()\n\tif err != OK:\n\t\treturn err\n\t\n\treturn portal\n\n\n# Parse each entry item. For portal and chest entries.\nfunc parse_entry_item(parser):\n\tvar entry = {}\n\t\n\t# Read the content name of the entry\n\tvar err = read_string(\"ContentName\", entry)\n\tif err != OK:\n\t\treturn err\n\t\n\t# Read the map pos of the entry\n\terr = read_vector2(\"MapPosition\", entry)\n\tif err != OK:\n\t\treturn err\n\t\n\treturn entry\n\n# Parse each entry item with direction data. For NPCs.\nfunc parse_entry_item_with_direction(parser):\n\tvar entry = {}\n\t\n\t# Read the content name of the entry\n\tvar err = read_string(\"ContentName\", entry)\n\tif err != OK:\n\t\treturn err\n\t\n\t# Read the map pos of the entry\n\terr = read_vector2(\"MapPosition\", entry)\n\tif err != OK:\n\t\treturn err\n\t\n\t# Read the direction of the entry\n\tvar err = read_string(\"Direction\", entry)\n\tif err != OK:\n\t\treturn err\n\t\n\treturn entry\n\n# Read the random combat information.\nfunc read_random_combat(map_data):\n\tvar err = next_element(\"RandomCombat\")\n\tif err != OK:\n\t\treturn err\n\t\n\tvar random_combat = {}\n\t\n\terr = read_int(\"CombatProbability\", random_combat)\n\tif err != OK:\n\t\treturn err\n\t\n\terr = read_int(\"FleeProbability\", random_combat)\n\tif err != OK:\n\t\treturn err\n\t\n\terr = read_range(\"MonsterCountRange\", random_combat)\n\tif err != OK:\n\t\treturn err\n\t\n\terr = read_object_array(\"Entries\", random_combat, funcref(self, \"parse_randomcombat_entry_item\"))\n\tif err != OK:\n\t\treturn err\n\t\n\tmap_data[\"RandomCombat\"] = random_combat\n\treturn OK\n\n# Parse each random combat monsetr entry item.\nfunc parse_randomcombat_entry_item(parser):\n\tvar entry = {}\n\t\n\t# Read the content name of the entry\n\tvar err = read_string(\"ContentName\", entry)\n\tif err != OK:\n\t\treturn err\n\t\n\t# Read the count the entry\n\terr = read_int(\"Count\", entry)\n\tif err != OK:\n\t\treturn err\n\t\n\t# Read the weight of the entry\n\tvar err = read_int(\"Weight\", entry)\n\tif err != OK:\n\t\treturn err\n\t\n\treturn entry\n\n# Build the map resource based on the parsed data.\nfunc make_map(parent, map_data, metadata):\n\t# Load the tileset resource\n\tvar tileset = load(metadata.get_option(\"tileset_dir\").plus_file(map_data[\"TextureName\"] + \".res\"))\n\tif tileset == null:\n\t\treturn ERR_CANT_AQUIRE_RESOURCE\n\n\t# Set the map name\n\tparent.set_name(asset_name)\n\n\t# Create the tilemaps root\n\tvar tilemaps = Node2D.new()\n\ttilemaps.set_name(\"TileMaps\")\n\tparent.add_child(tilemaps)\n\ttilemaps.set_owner(parent)\n\n\t# Create base layer\n\tvar base_layer = TileMap.new()\n\tbase_layer.set_name(\"BaseLayer\")\n\tbase_layer.set_cell_size(map_data[\"TileSize\"])\n\tbase_layer.set_tileset(tileset)\n\tfill_tilemap(base_layer, map_data[\"BaseLayer\"], map_data[\"MapDimensions\"])\n\ttilemaps.add_child(base_layer)\n\tbase_layer.set_owner(parent)\n\n\t# Create fringe layer\n\tvar fringe_layer = TileMap.new()\n\tfringe_layer.set_name(\"FringeLayer\")\n\tfringe_layer.set_cell_size(map_data[\"TileSize\"])\n\tfringe_layer.set_tileset(tileset)\n\tfill_tilemap(fringe_layer, map_data[\"FringeLayer\"], map_data[\"MapDimensions\"])\n\ttilemaps.add_child(fringe_layer)\n\tfringe_layer.set_owner(parent)\n\n\t# Create object layer\n\tvar object_layer = TileMap.new()\n\tobject_layer.set_name(\"ObjectLayer\")\n\tobject_layer.set_cell_size(map_data[\"TileSize\"])\n\tobject_layer.set_tileset(tileset)\n\tfill_tilemap(object_layer, map_data[\"ObjectLayer\"], map_data[\"MapDimensions\"])\n\ttilemaps.add_child(object_layer)\n\tobject_layer.set_owner(parent)\n\n\t# Create collision layer tileset dummy texture\n\tvar collision_image = Image(map_data[\"TileSize\"].x * 2, map_data[\"TileSize\"].y, false, Image.FORMAT_RGBA)\n\tfor y in range(map_data[\"TileSize\"].y):\n\t\tfor x in range(map_data[\"TileSize\"].x):\n\t\t\tcollision_image.put_pixel(x, y, Color(0,0,0,0))\n\t\t\tcollision_image.put_pixel(map_data[\"TileSize\"].x + x, y, Color(1,0,0,0.3))\n\t\t\tpass\n\tvar collision_texture = ImageTexture.new()\n\tcollision_texture.create_from_image(collision_image, 0)\n\n\t# Create collision layer tileset\n\tvar collision_tileset = TileSet.new()\n\tcollision_tileset.create_tile(0)\n\tcollision_tileset.tile_set_name(0, \"Passable\")\n\tcollision_tileset.tile_set_texture(0, collision_texture)\n\tcollision_tileset.tile_set_region(0, Rect2(0, 0, map_data[\"TileSize\"].x, map_data[\"TileSize\"].y))\n\tcollision_tileset.create_tile(1)\n\tcollision_tileset.tile_set_name(1, \"Impassable\")\n\tcollision_tileset.tile_set_texture(1, collision_texture)\n\tcollision_tileset.tile_set_region(1, Rect2(map_data[\"TileSize\"].x, 0, map_data[\"TileSize\"].x, map_data[\"TileSize\"].y))\n\tvar col_shape = RectangleShape2D.new()\n\tcol_shape.set_extents(map_data[\"TileSize\"] \/ 2)\n\tcollision_tileset.tile_set_shape(1, col_shape)\n\tcollision_tileset.tile_set_shape_offset(1, map_data[\"TileSize\"] \/ 2)\n\n\t# Create collision layer\n\tvar collision_layer = TileMap.new()\n\tcollision_layer.set_name(\"CollisionLayer\")\n\tcollision_layer.set_cell_size(map_data[\"TileSize\"])\n\tcollision_layer.set_tileset(collision_tileset)\n\tfill_tilemap(collision_layer, map_data[\"CollisionLayer\"], map_data[\"MapDimensions\"])\n\ttilemaps.add_child(collision_layer)\n\tcollision_layer.set_owner(parent)\n\tcollision_layer.set_hidden(true)\n\n\t# Create spawn point\n\tvar spawn = Position2D.new()\n\tspawn.set_name(\"SpawnPosition\")\n\tspawn.set_pos((map_data[\"SpawnMapPosition\"] * map_data[\"TileSize\"]) + (map_data[\"TileSize\"] \/ 2))\n\tparent.add_child(spawn)\n\tspawn.set_owner(parent)\n\n\treturn OK\n\n# Helper function to fill a tilemap based on an IntArray.\nfunc fill_tilemap(tilemap, data, dimensions):\n\tfor i in range(data.size()):\n\t\tvar cell = data[i]\n\t\tvar x = int(fmod(i, dimensions.x))\n\t\tvar y = int(i \/ dimensions.x)\n\t\ttilemap.set_cell(x, y, cell)\n","old_contents":"# The MIT License (MIT)\n#\n# Copyright (c) 2016 George Marques\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in all\n# copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n# SOFTWARE.\n\ntool\nextends \"res:\/\/addons\/xml_tools\/base_parser.gd\"\n\nfunc parse(file, parent, metadata):\n\n\tvar err = open(file)\n\tif err != OK:\n\t\treturn err\n\n\t# Read the header of the file to make sure it's a Map\n\terr = read_header(\"Map\")\n\tif err != OK:\n\t\treturn err\n\n\tvar map_data = {}\n\n\t# Read the map dimension\n\terr = read_vector2(\"MapDimensions\", map_data)\n\tif err != OK:\n\t\treturn err\n\n\t# Read the tile size\n\terr = read_vector2(\"TileSize\", map_data)\n\tif err != OK:\n\t\treturn err\n\n\t# Read the spawn position\n\terr = read_vector2(\"SpawnMapPosition\", map_data)\n\tif err != OK:\n\t\treturn err\n\n\t# Read the tileset name\n\terr = read_string(\"TextureName\", map_data)\n\tif err != OK:\n\t\treturn err\n\n\t# Read the battle background texture\n\terr = read_string(\"CombatTextureName\", map_data)\n\tif err != OK:\n\t\treturn err\n\n\t# Read the music theme name\n\terr = read_string(\"MusicCueName\", map_data)\n\tif err != OK:\n\t\treturn err\n\n\t# Read the battle theme name\n\terr = read_string(\"CombatMusicCueName\", map_data)\n\tif err != OK:\n\t\treturn err\n\n\t# Read the tilemap base layer\n\terr = read_int_array(\"BaseLayer\", map_data)\n\tif err != OK:\n\t\treturn err\n\n\t# Read the tilemap fringe layer\n\terr = read_int_array(\"FringeLayer\", map_data)\n\tif err != OK:\n\t\treturn err\n\n\t# Read the tilemap object layer\n\terr = read_int_array(\"ObjectLayer\", map_data)\n\tif err != OK:\n\t\treturn err\n\n\t# Read the tilemap colision layer\n\terr = read_int_array(\"CollisionLayer\", map_data)\n\tif err != OK:\n\t\treturn err\n\t\n\t# Read the portals\n\terr = read_object_array(\"Portals\", map_data, funcref(self, \"parse_portal_item\"))\n\tif err != OK:\n\t\treturn err\n\t\n\t# Read the portal entries\n\terr = read_object_array(\"PortalEntries\", map_data, funcref(self, \"parse_entry_item\"))\n\tif err != OK:\n\t\treturn err\n\t\n\t# Read the chest entries\n\terr = read_object_array(\"ChestEntries\", map_data, funcref(self, \"parse_entry_item\"))\n\tif err != OK:\n\t\treturn err\n\t\t\n\t# Read the fixed combat entries\n\terr = read_object_array(\"FixedCombatEntries\", map_data, funcref(self, \"parse_entry_item_with_direction\"))\n\tif err != OK:\n\t\treturn err\n\t\n\t# Read the random combat data\n\terr = read_random_combat(map_data)\n\tif err != OK:\n\t\treturn err\n\t\n\t# Read the quest NPCs\n\terr = read_object_array(\"QuestNpcEntries\", map_data, funcref(self, \"parse_entry_item_with_direction\"))\n\tif err != OK:\n\t\treturn err\n\t\n\t# Read the regular NPCs\n\terr = read_object_array(\"PlayerNpcEntries\", map_data, funcref(self, \"parse_entry_item_with_direction\"))\n\tif err != OK:\n\t\treturn err\n\t\n\t# Read the Inns\n\terr = read_object_array(\"InnEntries\", map_data, funcref(self, \"parse_entry_item\"))\n\tif err != OK:\n\t\treturn err\n\t\n\t# Read the Stores\n\terr = read_object_array(\"StoreEntries\", map_data, funcref(self, \"parse_entry_item\"))\n\tif err != OK:\n\t\treturn err\n\t\t\n\t# Finished :)\n\n\treturn make_map(parent, map_data, metadata)\n\n# Parse each portal item\nfunc parse_portal_item(parser):\n\tvar portal = {}\n\t\n\t# Read the name of the portal\n\tvar err = read_string(\"Name\", portal)\n\tif err != OK:\n\t\treturn err\n\t\n\t# Read the landing pos of the portal\n\terr = read_vector2(\"LandingMapPosition\", portal)\n\tif err != OK:\n\t\treturn err\n\t\n\t# Read the destination map of the portal\n\terr = read_string(\"DestinationMapContentName\", portal)\n\tif err != OK:\n\t\treturn err\n\t\n\t# Read the destination portal of the portal\n\terr = read_string(\"DestinationMapPortalName\", portal)\n\tif err != OK:\n\t\treturn err\n\t\n\t# Read the end element\n\terr = read()\n\tif err != OK:\n\t\treturn err\n\t\n\treturn portal\n\n\n# Parse each entry item. For portal and chest entries.\nfunc parse_entry_item(parser):\n\tvar entry = {}\n\t\n\t# Read the content name of the entry\n\tvar err = read_string(\"ContentName\", entry)\n\tif err != OK:\n\t\treturn err\n\t\n\t# Read the map pos of the entry\n\terr = read_vector2(\"MapPosition\", entry)\n\tif err != OK:\n\t\treturn err\n\t\n\treturn entry\n\n# Parse each entry item with direction data. For NPCs.\nfunc parse_entry_item_with_direction(parser):\n\tvar entry = {}\n\t\n\t# Read the content name of the entry\n\tvar err = read_string(\"ContentName\", entry)\n\tif err != OK:\n\t\treturn err\n\t\n\t# Read the map pos of the entry\n\terr = read_vector2(\"MapPosition\", entry)\n\tif err != OK:\n\t\treturn err\n\t\n\t# Read the direction of the entry\n\tvar err = read_string(\"Direction\", entry)\n\tif err != OK:\n\t\treturn err\n\t\n\treturn entry\n\n# Read the random combat information.\nfunc read_random_combat(map_data):\n\tvar err = next_element(\"RandomCombat\")\n\tif err != OK:\n\t\treturn err\n\t\n\tvar random_combat = {}\n\t\n\terr = read_int(\"CombatProbability\", random_combat)\n\tif err != OK:\n\t\treturn err\n\t\n\terr = read_int(\"FleeProbability\", random_combat)\n\tif err != OK:\n\t\treturn err\n\t\n\terr = read_range(\"MonsterCountRange\", random_combat)\n\tif err != OK:\n\t\treturn err\n\t\n\terr = read_object_array(\"Entries\", random_combat, funcref(self, \"parse_randomcombat_entry_item\"))\n\tif err != OK:\n\t\treturn err\n\t\n\tmap_data[\"RandomCombat\"] = random_combat\n\treturn OK\n\n# Parse each random combat monsetr entry item.\nfunc parse_randomcombat_entry_item(parser):\n\tvar entry = {}\n\t\n\t# Read the content name of the entry\n\tvar err = read_string(\"ContentName\", entry)\n\tif err != OK:\n\t\treturn err\n\t\n\t# Read the count the entry\n\terr = read_int(\"Count\", entry)\n\tif err != OK:\n\t\treturn err\n\t\n\t# Read the weight of the entry\n\tvar err = read_int(\"Weight\", entry)\n\tif err != OK:\n\t\treturn err\n\t\n\treturn entry\n\n# Build the map resource based on the parsed data.\nfunc make_map(parent, map_data, metadata):\n\t# Load the tileset resource\n\tvar tileset = load(metadata.get_option(\"tileset_dir\").plus_file(map_data[\"TextureName\"] + \".res\"))\n\tif tileset == null:\n\t\treturn ERR_CANT_AQUIRE_RESOURCE\n\n\t# Set the map name\n\tparent.set_name(asset_name)\n\n\t# Create the tilemaps root\n\tvar tilemaps = Node2D.new()\n\ttilemaps.set_name(\"TileMaps\")\n\tparent.add_child(tilemaps)\n\ttilemaps.set_owner(parent)\n\n\t# Create base layer\n\tvar base_layer = TileMap.new()\n\tbase_layer.set_name(\"BaseLayer\")\n\tbase_layer.set_cell_size(map_data[\"TileSize\"])\n\tbase_layer.set_tileset(tileset)\n\tfill_tilemap(base_layer, map_data[\"BaseLayer\"], map_data[\"MapDimensions\"])\n\ttilemaps.add_child(base_layer)\n\tbase_layer.set_owner(parent)\n\n\t# Create fringe layer\n\tvar fringe_layer = TileMap.new()\n\tfringe_layer.set_name(\"FringeLayer\")\n\tfringe_layer.set_cell_size(map_data[\"TileSize\"])\n\tfringe_layer.set_tileset(tileset)\n\tfill_tilemap(fringe_layer, map_data[\"FringeLayer\"], map_data[\"MapDimensions\"])\n\ttilemaps.add_child(fringe_layer)\n\tfringe_layer.set_owner(parent)\n\n\t# Create object layer\n\tvar object_layer = TileMap.new()\n\tobject_layer.set_name(\"ObjectLayer\")\n\tobject_layer.set_cell_size(map_data[\"TileSize\"])\n\tobject_layer.set_tileset(tileset)\n\tfill_tilemap(object_layer, map_data[\"ObjectLayer\"], map_data[\"MapDimensions\"])\n\ttilemaps.add_child(object_layer)\n\tobject_layer.set_owner(parent)\n\n\t# Create collision layer tileset dummy texture\n\tvar collision_image = Image(map_data[\"TileSize\"].x * 2, map_data[\"TileSize\"].y, false, Image.FORMAT_RGBA)\n\tfor y in range(map_data[\"TileSize\"].y):\n\t\tfor x in range(map_data[\"TileSize\"].x):\n\t\t\tcollision_image.put_pixel(x, y, Color(0,0,0,0))\n\t\t\tcollision_image.put_pixel(map_data[\"TileSize\"].x + x, y, Color(1,0,0,1))\n\t\t\tpass\n\tvar collision_texture = ImageTexture.new()\n\tcollision_texture.create_from_image(collision_image, 0)\n\n\t# Create collision layer tileset\n\tvar collision_tileset = TileSet.new()\n\tcollision_tileset.create_tile(0)\n\tcollision_tileset.tile_set_name(0, \"Passable\")\n\tcollision_tileset.tile_set_texture(0, collision_texture)\n\tcollision_tileset.tile_set_region(0, Rect2(0, 0, map_data[\"TileSize\"].x, map_data[\"TileSize\"].y))\n\tcollision_tileset.create_tile(1)\n\tcollision_tileset.tile_set_name(1, \"Impassable\")\n\tcollision_tileset.tile_set_texture(1, collision_texture)\n\tcollision_tileset.tile_set_region(1, Rect2(map_data[\"TileSize\"].x, 0, map_data[\"TileSize\"].x, map_data[\"TileSize\"].y))\n\tvar col_shape = RectangleShape2D.new()\n\tcol_shape.set_extents(map_data[\"TileSize\"] \/ 2)\n\tcollision_tileset.tile_set_shape(1, col_shape)\n\tcollision_tileset.tile_set_shape_offset(1, map_data[\"TileSize\"] \/ 2)\n\n\t# Create collision layer\n\tvar collision_layer = TileMap.new()\n\tcollision_layer.set_name(\"CollisionLayer\")\n\tcollision_layer.set_cell_size(map_data[\"TileSize\"])\n\tcollision_layer.set_tileset(collision_tileset)\n\tfill_tilemap(collision_layer, map_data[\"CollisionLayer\"], map_data[\"MapDimensions\"])\n\ttilemaps.add_child(collision_layer)\n\tcollision_layer.set_owner(parent)\n\tcollision_layer.set_hidden(true)\n\n\t# Create spawn point\n\tvar spawn = Position2D.new()\n\tspawn.set_name(\"SpawnPosition\")\n\tspawn.set_pos((map_data[\"SpawnMapPosition\"] * map_data[\"TileSize\"]) + (map_data[\"TileSize\"] \/ 2))\n\tparent.add_child(spawn)\n\tspawn.set_owner(parent)\n\n\treturn OK\n\n# Helper function to fill a tilemap based on an IntArray.\nfunc fill_tilemap(tilemap, data, dimensions):\n\tfor i in range(data.size()):\n\t\tvar cell = data[i]\n\t\tvar x = int(fmod(i, dimensions.x))\n\t\tvar y = int(i \/ dimensions.x)\n\t\ttilemap.set_cell(x, y, cell)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"0e54ab5b7071920a5cba7a408f4a8320af151454","subject":"Restored old Doge HP","message":"Restored old Doge HP\n","repos":"P1X-in\/rat-is-fat","old_file":"scripts\/enemies\/doge_prime.gd","new_file":"scripts\/enemies\/doge_prime.gd","new_contents":"extends \"res:\/\/scripts\/enemies\/abstract_boss.gd\"\n\nconst IRRITATED_TIMER = 2\n\nvar irritated = false\nvar calm = true\n\nvar body_angry\nvar body_moving\n\nvar path_points = [\n Vector2(17, 2),\n Vector2(17, 8),\n Vector2(5, 8),\n]\nvar path_points_global = []\nvar target_point = null\nvar current_point = 0\n\nfunc _init(bag).(bag):\n self.avatar = preload(\"res:\/\/scenes\/enemies\/doge_prime.xscn\").instance()\n self.body_part_head = self.avatar.get_node('body')\n self.body_part_body = self.avatar.get_node('body')\n self.body_part_footer = self.avatar.get_node('body')\n self.animations = self.avatar.get_node('body_animations')\n\n self.body_angry = self.avatar.get_node('body2')\n self.body_moving = self.avatar.get_node('body3')\n\n self.velocity = 250\n self.attack_range = 75\n self.aggro_range = 75\n self.attack_strength = 3\n self.attack_cooldown = 3\n self.max_hp = 25\n self.hp = 25\n self.score = 200\n\n self.stun_duration = 0.4\n self.mass = 30\n\n self.calm = true\n self.irritated = false\n\n self.phase_hp_thresholds = [\n [25, 2],\n ]\n\n for point in self.path_points:\n self.path_points_global.push_back(self.bag.room_loader.translate_position(point))\n\nfunc process_ai():\n var distance\n var direction = Vector2(0, 0)\n\n self.target = null\n if not self.calm:\n for player in self.bag.players.players:\n if player.is_playing && player.is_alive:\n distance = self.calculate_distance_to_object(player)\n if distance < self.aggro_range:\n if self.target != null:\n if self.calculate_distance_to_object(self.target) > distance:\n self.target = player\n else:\n self.target = player\n break\n\n if self.calm and not self.irritated:\n for player in self.bag.players.players:\n if player.is_playing && player.is_alive:\n distance = self.calculate_distance_to_object(player)\n if distance < self.aggro_range:\n self.irritate()\n break\n\n if self.target != null:\n distance = self.calculate_distance_to_object(self.target)\n if not self.target.is_alive || distance > self.aggro_range:\n self.target = null\n elif distance < self.attack_range and not self.is_attack_on_cooldown:\n self.attack()\n\n if self.target_point != null:\n distance = self.calculate_distance(self.target_point)\n if distance < 5:\n self.target_point = null\n self.calm_down()\n else:\n direction = self.cast_movement_vector(self.target_point)\n\n self.movement_vector[0] = direction.x\n self.movement_vector[1] = direction.y\n\nfunc enrage():\n self.is_invulnerable = true\n self.calm = false\n self.pick_next_point()\n self.body_angry.hide()\n self.body_moving.show()\n self.body_part_body.hide()\n\nfunc calm_down():\n self.is_invulnerable = false\n self.calm = true\n self.irritated = false\n self.body_angry.hide()\n self.body_moving.hide()\n self.body_part_body.show()\n\n var timer = randi() % 3\n timer += 2\n\n self.bag.timers.set_timeout(timer, self, 'irritate')\n\nfunc irritate():\n if self.irritated:\n return\n\n self.irritated = true\n self.body_part_body.hide()\n self.body_angry.show()\n self.body_moving.hide()\n self.bag.timers.set_timeout(self.IRRITATED_TIMER, self, 'enrage')\n\nfunc phase2():\n return\n\nfunc pick_next_point():\n var next_point = self.current_point\n\n while (next_point == self.current_point):\n next_point = randi() % self.path_points_global.size()\n\n self.current_point = next_point\n self.target_point = self.path_points_global[next_point]\n\n\nfunc push_back(enemy):\n if not self.irritated:\n self.irritate()\n\nfunc flip_body_parts(flip_flag):\n .flip_body_parts(flip_flag)\n self.body_angry.set_flip_h(flip_flag)\n self.body_moving.set_flip_h(flip_flag)\n","old_contents":"extends \"res:\/\/scripts\/enemies\/abstract_boss.gd\"\n\nconst IRRITATED_TIMER = 2\n\nvar irritated = false\nvar calm = true\n\nvar body_angry\nvar body_moving\n\nvar path_points = [\n Vector2(17, 2),\n Vector2(17, 8),\n Vector2(5, 8),\n]\nvar path_points_global = []\nvar target_point = null\nvar current_point = 0\n\nfunc _init(bag).(bag):\n self.avatar = preload(\"res:\/\/scenes\/enemies\/doge_prime.xscn\").instance()\n self.body_part_head = self.avatar.get_node('body')\n self.body_part_body = self.avatar.get_node('body')\n self.body_part_footer = self.avatar.get_node('body')\n self.animations = self.avatar.get_node('body_animations')\n\n self.body_angry = self.avatar.get_node('body2')\n self.body_moving = self.avatar.get_node('body3')\n\n self.velocity = 250\n self.attack_range = 75\n self.aggro_range = 75\n self.attack_strength = 3\n self.attack_cooldown = 3\n self.max_hp = 40\n self.hp = 40\n self.score = 200\n\n self.stun_duration = 0.4\n self.mass = 30\n\n self.calm = true\n self.irritated = false\n\n self.phase_hp_thresholds = [\n [25, 2],\n ]\n\n for point in self.path_points:\n self.path_points_global.push_back(self.bag.room_loader.translate_position(point))\n\nfunc process_ai():\n var distance\n var direction = Vector2(0, 0)\n\n self.target = null\n if not self.calm:\n for player in self.bag.players.players:\n if player.is_playing && player.is_alive:\n distance = self.calculate_distance_to_object(player)\n if distance < self.aggro_range:\n if self.target != null:\n if self.calculate_distance_to_object(self.target) > distance:\n self.target = player\n else:\n self.target = player\n break\n\n if self.calm and not self.irritated:\n for player in self.bag.players.players:\n if player.is_playing && player.is_alive:\n distance = self.calculate_distance_to_object(player)\n if distance < self.aggro_range:\n self.irritate()\n break\n\n if self.target != null:\n distance = self.calculate_distance_to_object(self.target)\n if not self.target.is_alive || distance > self.aggro_range:\n self.target = null\n elif distance < self.attack_range and not self.is_attack_on_cooldown:\n self.attack()\n\n if self.target_point != null:\n distance = self.calculate_distance(self.target_point)\n if distance < 5:\n self.target_point = null\n self.calm_down()\n else:\n direction = self.cast_movement_vector(self.target_point)\n\n self.movement_vector[0] = direction.x\n self.movement_vector[1] = direction.y\n\nfunc enrage():\n self.is_invulnerable = true\n self.calm = false\n self.pick_next_point()\n self.body_angry.hide()\n self.body_moving.show()\n self.body_part_body.hide()\n\nfunc calm_down():\n self.is_invulnerable = false\n self.calm = true\n self.irritated = false\n self.body_angry.hide()\n self.body_moving.hide()\n self.body_part_body.show()\n\n var timer = randi() % 3\n timer += 2\n\n self.bag.timers.set_timeout(timer, self, 'irritate')\n\nfunc irritate():\n if self.irritated:\n return\n\n self.irritated = true\n self.body_part_body.hide()\n self.body_angry.show()\n self.body_moving.hide()\n self.bag.timers.set_timeout(self.IRRITATED_TIMER, self, 'enrage')\n\nfunc phase2():\n return\n\nfunc pick_next_point():\n var next_point = self.current_point\n\n while (next_point == self.current_point):\n next_point = randi() % self.path_points_global.size()\n\n self.current_point = next_point\n self.target_point = self.path_points_global[next_point]\n\n\nfunc push_back(enemy):\n if not self.irritated:\n self.irritate()\n\nfunc flip_body_parts(flip_flag):\n .flip_body_parts(flip_flag)\n self.body_angry.set_flip_h(flip_flag)\n self.body_moving.set_flip_h(flip_flag)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"c4becf227d83cb2987e3a73f2f6f4829a6e834a4","subject":"change block removal behavior","message":"change block removal behavior\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/GridMan.gd","new_file":"src\/scripts\/GridMan.gd","new_contents":"extends Spatial\n\n# block positions\nvar shape = {}\n\n# sounds\nvar samplePlayer = SamplePlayer.new()\n\nfunc add_block(b):\n\tshape[b.blockPos] = b\n\tadd_child(b)\n\nfunc get_block(pos):\n\tif shape.has(pos):\n\t\treturn shape[pos]\n\telse:\n\t\treturn null\n\nfunc remove_block(block_node):\n\tshape[block_node.blockPos] = null\n\t# TODO scan_layer, fire lasers if empty\n\tfor child in block_node.get_children():\n\t\tblock_node.remove_and_delete_child(child)\n\tremove_and_delete_child(block_node)\n\n# TODO wild block selected? can click any pair. can deselect wild block.\nvar wildBlockSelected = null\n\nfunc set_puzzle(puzzle):\n\tpuzzle = puzzle\n\t# Initalization here\n\tsamplePlayer.set_voice_count(puzzle.puzzleLayers * 2)\n\tsamplePlayer.set_sample_library(ResourceLoader.load(\"new_samplelibrary.xml\"))\n\n\n\n","old_contents":"extends Spatial\n\n# block positions\nvar shape = {}\n\n# sounds\nvar samplePlayer = SamplePlayer.new()\n\nfunc add_block(b):\n\tshape[b.blockPos] = b\n\tadd_child(b)\n\nfunc get_block(pos):\n\tif shape.has(pos):\n\t\treturn shape[pos]\n\telse:\n\t\treturn null\n\nfunc remove_block(block_node):\n\tif shape[block_node.blockPos] == null:\n\t\treturn\n\tshape[block_node.blockPos] = null\n\tremove_and_delete_child(block_node)\n\t# TODO scan_layer, fire lasers if empty\n\n# TODO wild block selected? can click any pair. can deselect wild block.\nvar wildBlockSelected = null\n\nfunc set_puzzle(puzzle):\n\tpuzzle = puzzle\n\t# Initalization here\n\tsamplePlayer.set_voice_count(puzzle.puzzleLayers * 2)\n\tsamplePlayer.set_sample_library(ResourceLoader.load(\"new_samplelibrary.xml\"))\n\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"2843efe0ce42acc3ef6addbda8674ec43c9e1025","subject":"gd \"G\u00e0idhlig\" translation #4233. Author: GunChleoc. String fix","message":"gd \"G\u00e0idhlig\" translation #4233. Author: GunChleoc. String fix\n","repos":"TangentialAlan\/lila,terokinnunen\/lila,ccampo133\/lila,pavelo65\/lila,Unihedro\/lila,bjhaid\/lila,JimmyMow\/lila,luanlv\/lila,systemovich\/lila,ccampo133\/lila,Enigmahack\/lila,elioair\/lila,arex1337\/lila,samuel-soubeyran\/lila,abougouffa\/lila,abougouffa\/lila,systemovich\/lila,TangentialAlan\/lila,luanlv\/lila,clarkerubber\/lila,luanlv\/lila,clarkerubber\/lila,pavelo65\/lila,abougouffa\/lila,Happy0\/lila,ccampo133\/lila,ccampo133\/lila,TangentialAlan\/lila,Happy0\/lila,danilovsergey\/i-bur,luanlv\/lila,Unihedro\/lila,Enigmahack\/lila,bjhaid\/lila,Happy0\/lila,JimmyMow\/lila,samuel-soubeyran\/lila,terokinnunen\/lila,TangentialAlan\/lila,r0k3\/lila,elioair\/lila,TangentialAlan\/lila,ccampo133\/lila,JimmyMow\/lila,terokinnunen\/lila,Enigmahack\/lila,clarkerubber\/lila,bjhaid\/lila,r0k3\/lila,elioair\/lila,systemovich\/lila,pawank\/lila,Happy0\/lila,Unihedro\/lila,pavelo65\/lila,pawank\/lila,Unihedro\/lila,pawank\/lila,abougouffa\/lila,pawank\/lila,TangentialAlan\/lila,samuel-soubeyran\/lila,pavelo65\/lila,JimmyMow\/lila,systemovich\/lila,abougouffa\/lila,samuel-soubeyran\/lila,pavelo65\/lila,samuel-soubeyran\/lila,abougouffa\/lila,arex1337\/lila,Enigmahack\/lila,TangentialAlan\/lila,elioair\/lila,systemovich\/lila,clarkerubber\/lila,Unihedro\/lila,r0k3\/lila,pawank\/lila,terokinnunen\/lila,terokinnunen\/lila,r0k3\/lila,bjhaid\/lila,Enigmahack\/lila,arex1337\/lila,arex1337\/lila,danilovsergey\/i-bur,danilovsergey\/i-bur,Enigmahack\/lila,elioair\/lila,Happy0\/lila,bjhaid\/lila,luanlv\/lila,danilovsergey\/i-bur,samuel-soubeyran\/lila,Happy0\/lila,pavelo65\/lila,ccampo133\/lila,samuel-soubeyran\/lila,pawank\/lila,clarkerubber\/lila,terokinnunen\/lila,bjhaid\/lila,clarkerubber\/lila,systemovich\/lila,danilovsergey\/i-bur,Unihedro\/lila,Unihedro\/lila,ccampo133\/lila,r0k3\/lila,danilovsergey\/i-bur,arex1337\/lila,Enigmahack\/lila,bjhaid\/lila,luanlv\/lila,Happy0\/lila,danilovsergey\/i-bur,clarkerubber\/lila,elioair\/lila,r0k3\/lila,luanlv\/lila,abougouffa\/lila,r0k3\/lila,pawank\/lila,arex1337\/lila,JimmyMow\/lila,terokinnunen\/lila,pavelo65\/lila,systemovich\/lila,arex1337\/lila,elioair\/lila,JimmyMow\/lila,JimmyMow\/lila","old_file":"conf\/messages.gd","new_file":"conf\/messages.gd","new_contents":"playWithAFriend=Cluich c\u00f2mhla ri caraid\ninviteAFriendToPlayWithYou=Thoir cuireadh do charaid gus cluich c\u00f2mhla riut\nplayWithTheMachine=Cluich an aghaidh a' choimpiutair\nchallengeTheArtificialIntelligence=Thoir d\u00f9bhlan dhan inntinn fhuadain\ntoInviteSomeoneToPlayGiveThisUrl=Gus cuireadh a thoirt do chuideigin, thoir an url seo seachad\ngameOver=Cr\u00ecoch a\u2019 gheama\nwaitingForOpponent=A\u2019 feitheamh air n\u00e0mhaid\nwaiting=A\u2019 feitheamh\nyourTurn=An turas agad\naiNameLevelAiLevel=%s inbhe %s\nlevel=Inbhe\ntoggleTheChat=Toglaich a\u2019 chabadaich\ntoggleSound=Toglaich fuaim\nchat=Cabadaich\nresign=G\u00e8ill\ncheckmate=Tul-chasg\nstalemate=Clos-cluiche\nwhite=Geal\nblack=Dubh\ncreateAGame=Cruthaich geama\nnoGameAvailableRightNowCreateOne=Chan eil geama ri fhaighinn an-dr\u00e0sta, cruthaich fear \u00f9r!\nwhiteIsVictorious=Bhuannaich geal\nblackIsVictorious=Bhuannaich dubh\nplayWithTheSameOpponentAgain=Cluich an aghaidh an aon n\u00e0mhaid a-rithist\nnewOpponent=N\u00e0mhaid \u00f9r\nplayWithAnotherOpponent=Cluich an aghaidh n\u00e0mhaid eile\nyourOpponentWantsToPlayANewGameWithYou=Tha an n\u00e0mhaid agad airson geama \u00f9r a chluich c\u00f2mhla riut\njoinTheGame=Thig a-steach dhan gheama\nwhitePlays=Tha geal a\u2019 cluich\nblackPlays=Tha dubh a\u2019 cluich\ntheOtherPlayerHasLeftTheGameYouCanForceResignationOrWaitForHim=Tha an geamaiche eile air a' gheama fh\u00e0gail. Is urrainn dhut g\u00e8illeadh a chur air, no feitheamh air a shon.\nmakeYourOpponentResign=Cuir g\u00e8illeadh air an n\u00e0mhaid agad\nforceResignation=Cuir g\u00e8illeadh air an n\u00e0mhaid agad\ntalkInChat=D\u00e8an cabadaich\ntheFirstPersonToComeOnThisUrlWillPlayWithYou=Cluichidh a\u2019 chiad neach a thig a-steach air an url seo c\u00f2mhla riut.\nwhiteCreatesTheGame=Tha geal a\u2019 cruthachadh a\u2019 gheama\nblackCreatesTheGame=Tha dubh a\u2019 cruthachadh a\u2019 gheama\nwhiteJoinsTheGame=Th\u00e0inig geal a-steach dhan gheama\nblackJoinsTheGame=Th\u00e0inig dubh a-steach dhan gheama\nwhiteResigned=Gh\u00e8ill geal\nblackResigned=Gh\u00e8ill dubh\nwhiteLeftTheGame=Dh\u2019fh\u00e0g geal an geama\nblackLeftTheGame=Dh\u2019fh\u00e0g dubh an geama\nshareThisUrlToLetSpectatorsSeeTheGame=Co-roinn an url seo gus luchd-amhairc a leigeil a-steach dhan gheama\nyouAreViewingThisGameAsASpectator=Tha thu a\u2019 coimhead air a\u2019 gheama seo nad neach-amhairc\nreplayAndAnalyse=Ath-chluich is sgr\u00f9daich\ncomputerAnalysisInProgress=Tha anailis a' choimpiutair a' dol\ntheComputerAnalysisYouRequestedIsNowAvailable=Tha anailis a' choimpiutair a dh'iarr thu ri fhaighinn a-nis\nviewGameStats=Faic stadastaig a\u2019 gheama\nflipBoard=D\u00e8an flip air a\u2019 bh\u00f2rd\nthreefoldRepetition=Treas ath-nochdadh\nclaimADraw=Tagair geama ionnanach\nofferDraw=Tairg geama ionnanach\ndraw=Geama ionnanach\nnbConnectedPlayers=Tha %s geamaichean ceangailte\ntalkAboutChessAndDiscussLichessFeaturesInTheForum=Bruidhinn mu th\u00e0ileasg agus deasbad air na feartan aig lichess air a\u2019 bh\u00f2rd-bhrath\nseeTheGamesBeingPlayedInRealTime=Seall air na geamaichean a tha gan cluich ann am f\u00ecor-\u00f9ine\ngamesBeingPlayedRightNow=Geamaichean a tha gan cluich an-dr\u00e0sta fh\u00e8in\nviewAllNbGames=Seall air a h-uile %s de na geamaichean\nviewNbCheckmates=Seall na chur %s de thul-chasg\nnbBookmarks=%s Comharran-l\u00ecn\nnbPopularGames=%s geamannan m\u00f2r-ch\u00f2rdte\nnbAnalysedGames=%s geamannan sgr\u00f9daichte\nbookmarkedByNbPlayers=Comharra-leabhair le %s cluicheadairean\nviewInFullSize=Seall sa mheud iomlan\nlogOut=Log a-mach\nsignIn=Log a-steach\nsignUp=Cl\u00e0raich\npeople=Daoine\ngames=Geamannan\nforum=B\u00f2rd-brath\nchessPlayers=Geamaichean t\u00e0ileisg\nminutesPerSide=Mionaidean an taobh\nvariant=Caochladh\ntimeControl=Smachdadh-\u00f9ine\nstart=Toiseach\nusername=Far-ainm\npassword=Facal-faire\nhaveAnAccount=A bheil cunntas agad?\nallYouNeedIsAUsernameAndAPassword=Chan eil a dh\u00ecth ort ach far-ainm agus facal-faire\nlearnMoreAboutLichess=Ionnsaich barrachd mu lichess\nrank=Inbhe\ngamesPlayed=Geamannan air an cluich\ndeclineInvitation=Di\u00f9lt cuireadh\ncancel=Sguir dheth\ntimeOut=Dh\u2019fhalbh an \u00f9ine\ndrawOfferSent=Chaidh tairgse airson geama ionnanach a chur\ndrawOfferDeclined=Dhi\u00f9ltadh do thairgse airson geama ionnanach\ndrawOfferAccepted=Ghabhadh ri do thairgse airson geama ionnanach\ndrawOfferCanceled=Sguireadh de do thairgse airson geama ionnanach\nyourOpponentOffersADraw=Tha an n\u00e0mhaid agad a\u2019 tairgse geama ionnanach\naccept=Gabh ris\ndecline=Di\u00f9lt\nplayingRightNow=A\u2019 cluich an-dr\u00e0sta fh\u00e8in\nabortGame=Stad an geama\ngameAborted=Chaidh an geama a stad\nstandard=Coitcheann\nunlimited=Gun chr\u00ecoch\nmode=Modh\ncasual=Gun rangachadh\nrated=Rangaichte\nthisGameIsRated=Tha an geama seo rangaichte\nrematch=Ath-mhaids\nrematchOfferSent=Chaidh tairgse airson ath-chluich a chur\nrematchOfferAccepted=Ghabhadh ri do thairgse airson ath-chluich\nrematchOfferCanceled=Chaidh sgur dhe thairgse ath-mhaids\nrematchOfferDeclined=Tairgse ath-mhaids air a di\u00f9ltadh\ncancelRematchOffer=Sguir dhe thairgse ath-mhaids\nviewRematch=Seall air ath-mhaids\nplay=Cluich\ninbox=Bogsa a-steach\nchatRoom=Se\u00f2mar cabadaich\nspectatorRoom=Se\u00f2mar amhairc\ncomposeMessage=Sgr\u00ecobh teachdaireachd\nsentMessages=Teachdaireachdan air an cur\nincrementInSeconds=Ioncramaid ann an diogan\nfreeOnlineChess=T\u00e0ileasg air loidhne an asgaidh\nspectators=Luchd-amhairc:\nnbWins=Bhuannaich %s\nnbLosses=Chaill %s\nnbDraws=Geama ionnanach le %s\nexportGames=\u00c0s-phortaich geamannan\ncolor=dath\neloRange=Rainse Elo\ngiveNbSeconds=Thoir %s diog(an)\nwhoIsOnline=C\u00f2 tha air loidhne\nallPlayers=A h-uile cluicheadair\npremoveEnabledClickAnywhereToCancel=Ro-ghluasad an comas - d\u00e8an briogadh \u00e0ite sam bith gus sgur dheth\nthisPlayerUsesChessComputerAssistance=Tha an cluicheadair seo a\u2019 cleachdadh taic coimpiutair taileisg\nopening=Fosgladh\ntakeback=Tarraing air ais\nproposeATakeback=Tairg tarraing air ais\ntakebackPropositionSent=Tairgse tarraing air ais air a cur\ntakebackPropositionDeclined=Tairgse tarraing air ais air a di\u00f9ltadh\ntakebackPropositionAccepted=Air gabhail ri tairgse tarraing air ais\ntakebackPropositionCanceled=Chaidh sgur dhe thairgse tarraing air ais\nyourOpponentProposesATakeback=Tha am farpaiseach a\u2019 tairgse tarraing air ais\nbookmarkThisGame=Cruthaich comharra-l\u00ecn airson an geama seo.\ntoggleBackground=Toglaich dath a\u2019 ch\u00f9laibh\nadvancedSearch=Lorg adhartach\ntournament=F\u00e8ill-chluich\ntournamentPoints=Puingean f\u00e8ill-chluich\nviewTournament=Seall an fh\u00e8ill-chluich\nfreeOnlineChessGamePlayChessNowInACleanInterfaceNoRegistrationNoAdsNoPluginRequiredPlayChessWithComputerFriendsOrRandomOpponents=T\u00e0ileasg air loidhne an asgaidh. Cluich t\u00e0ileasg ann am pr\u00f2gram air a bheil dreach glan. Gun chl\u00e0radh, gun sanasachd, gun fheum air plugan. Cluich t\u00e0ileasg an aghaidh a\u2019 choimpiutair, charaidean no n\u00e0imhdean air thuaiream.\nteams=Sgiobaidhean\nnbMembers=%s ball\nallTeams=A h-uile sgioba\nnewTeam=Sgioba \u00f9r\nmyTeams=Na sgiobaidhean agam\nnoTeamFound=Cha deach sgioba a lorg\njoinTeam=Gabh sa sgioba\nquitTeam=F\u00e0g an sgioba\nanyoneCanJoin=Faodaidh duine sam bith a ghabhail ann\naConfirmationIsRequiredToJoin=Tha dearbhadh a dh\u00ecth gus gabhail ann\njoiningPolicy=Poileasaidh gabhail ann\nteamLeader=Ceannard an sgioba\nteamBestPlayers=Ar cluicheadairean as fhearr\nteamRecentMembers=Ar buill as \u00f9ire\naverageElo=Elo cuibheasach\nlocation=\u00c0ite\nsettings=Roghainnean\nfilterGames=Criathraich na geamannan\nreset=Ath-shuidhich\napply=Cuir an s\u00e0s\nleaderboard=Cl\u00e0r na l\u00ecge\npasteTheFenStringHere=Cuir a-steach an t-sreang FEN an-seo\npasteThePgnStringHere=Cuir a-steach an t-sreang PGN an-seo\nfromPosition=On ionad\ncontinueFromHere=Lean air adhart on a sheo\nimportGame=Ion-phortaich geama\nnbImportedGames=%s geama(ichean) air ion-phortadh\n","old_contents":"playWithAFriend=Cluich c\u00f2mhla ri caraid\ninviteAFriendToPlayWithYou=Thoir cuireadh do charaid gus cluich c\u00f2mhla riut\nplayWithTheMachine=Cluich an aghaidh a' choimpiutair\nchallengeTheArtificialIntelligence=Thoir ionnsaigh air an inntinn fhuadain\ntoInviteSomeoneToPlayGiveThisUrl=Gus cuireadh a thoirt do chuideigin, thoir an url seo seachad\ngameOver=Cr\u00ecoch a\u2019 gheama\nwaitingForOpponent=A\u2019 feitheamh air n\u00e0mhaid\nwaiting=A\u2019 feitheamh\nyourTurn=An turas agad\naiNameLevelAiLevel=%s inbhe %s\nlevel=Inbhe\ntoggleTheChat=Toglaich a\u2019 chabadaich\ntoggleSound=Toglaich fuaim\nchat=Cabadaich\nresign=G\u00e8ill\ncheckmate=Tul-chasg\nstalemate=Clos-cluiche\nwhite=Geal\nblack=Dubh\ncreateAGame=Cruthaich geama\nnoGameAvailableRightNowCreateOne=Chan eil geama ri fhaighinn an-dr\u00e0sta, cruthaich fear \u00f9r!\nwhiteIsVictorious=Bhuannaich geal\nblackIsVictorious=Bhuannaich dubh\nplayWithTheSameOpponentAgain=Cluich an aghaidh an aon n\u00e0mhaid a-rithist\nnewOpponent=N\u00e0mhaid \u00f9r\nplayWithAnotherOpponent=Cluich an aghaidh n\u00e0mhaid eile\nyourOpponentWantsToPlayANewGameWithYou=Tha an n\u00e0mhaid agad airson geama \u00f9r a chluich c\u00f2mhla riut\njoinTheGame=Thig a-steach dhan gheama\nwhitePlays=Tha geal a\u2019 cluich\nblackPlays=Tha dubh a\u2019 cluich\ntheOtherPlayerHasLeftTheGameYouCanForceResignationOrWaitForHim=Tha an geamaiche eile air a' gheama fh\u00e0gail. Is urrainn dhut g\u00e8illeadh a chur air, no feitheamh air a shon.\nmakeYourOpponentResign=Cuir g\u00e8illeadh air an n\u00e0mhaid agad\nforceResignation=Cuir g\u00e8illeadh air an n\u00e0mhaid agad\ntalkInChat=D\u00e8an cabadaich\ntheFirstPersonToComeOnThisUrlWillPlayWithYou=Cluichidh a\u2019 chiad neach a thig a-steach air an url seo c\u00f2mhla riut.\nwhiteCreatesTheGame=Tha geal a\u2019 cruthachadh a\u2019 gheama\nblackCreatesTheGame=Tha dubh a\u2019 cruthachadh a\u2019 gheama\nwhiteJoinsTheGame=Th\u00e0inig geal a-steach dhan gheama\nblackJoinsTheGame=Th\u00e0inig dubh a-steach dhan gheama\nwhiteResigned=Gh\u00e8ill geal\nblackResigned=Gh\u00e8ill dubh\nwhiteLeftTheGame=Dh\u2019fh\u00e0g geal an geama\nblackLeftTheGame=Dh\u2019fh\u00e0g dubh an geama\nshareThisUrlToLetSpectatorsSeeTheGame=Co-roinn an url seo gus luchd-amhairc a leigeil a-steach dhan gheama\nyouAreViewingThisGameAsASpectator=Tha thu a\u2019 coimhead air a\u2019 gheama seo nad neach-amhairc\nreplayAndAnalyse=Ath-chluich is sgr\u00f9daich\nviewGameStats=Faic stadastaig a\u2019 gheama\nflipBoard=D\u00e8an flip air a\u2019 bh\u00f2rd\nthreefoldRepetition=Treas ath-nochdadh\nclaimADraw=Tagair geama ionnanach\nofferDraw=Tairg geama ionnanach\ndraw=Geama ionnanach\nnbConnectedPlayers=Tha %s geamaichean ceangailte\ntalkAboutChessAndDiscussLichessFeaturesInTheForum=Bruidhinn mu th\u00e0ileasg agus deasbad air na feartan aig lichess air a\u2019 bh\u00f2rd-bhrath\nseeTheGamesBeingPlayedInRealTime=Seall air na geamaichean a tha gan cluich ann am f\u00ecor-\u00f9ine\ngamesBeingPlayedRightNow=Geamaichean a tha gan cluich an-dr\u00e0sta fh\u00e8in\nviewAllNbGames=Seall air a h-uile %s de na geamaichean\nviewNbCheckmates=Seall na chur %s de thul-chasg\nnbBookmarks=%s Comharran-l\u00ecn\nnbPopularGames=%s geamannan m\u00f2r-ch\u00f2rdte\nnbAnalysedGames=%s geamannan sgr\u00f9daichte\nbookmarkedByNbPlayers=Comharra-leabhair le %s cluicheadairean\nviewInFullSize=Seall sa mheud iomlan\nlogOut=Log a-mach\nsignIn=Log a-steach\nsignUp=Cl\u00e0raich\npeople=Daoine\ngames=Geamannan\nforum=B\u00f2rd-brath\nchessPlayers=Geamaichean t\u00e0ileisg\nminutesPerSide=Mionaidean an taobh\nvariant=Caochladh\ntimeControl=Smachdadh-\u00f9ine\nstart=Toiseach\nusername=Far-ainm\npassword=Facal-faire\nhaveAnAccount=A bheil cunntas agad?\nallYouNeedIsAUsernameAndAPassword=Chan eil a dh\u00ecth ort ach far-ainm agus facal-faire\nlearnMoreAboutLichess=Ionnsaich barrachd mu lichess\nrank=Inbhe\ngamesPlayed=Geamannan air an cluich\ndeclineInvitation=Di\u00f9lt cuireadh\ncancel=Sguir dheth\ntimeOut=Dh\u2019fhalbh an \u00f9ine\ndrawOfferSent=Chaidh tairgse airson geama ionnanach a chur\ndrawOfferDeclined=Dhi\u00f9ltadh do thairgse airson geama ionnanach\ndrawOfferAccepted=Ghabhadh ri do thairgse airson geama ionnanach\ndrawOfferCanceled=Sguireadh de do thairgse airson geama ionnanach\nyourOpponentOffersADraw=Tha an n\u00e0mhaid agad a\u2019 tairgse geama ionnanach\naccept=Gabh ris\ndecline=Di\u00f9lt\nplayingRightNow=A\u2019 cluich an-dr\u00e0sta fh\u00e8in\nabortGame=Stad an geama\ngameAborted=Chaidh an geama a stad\nstandard=Coitcheann\nunlimited=Gun chr\u00ecoch\nmode=Modh\ncasual=Gun rangachadh\nrated=Rangaichte\nthisGameIsRated=Tha an geama seo rangaichte\nrematch=Ath-mhaids\nrematchOfferSent=Chaidh tairgse airson ath-chluich a chur\nrematchOfferAccepted=Ghabhadh ri do thairgse airson ath-chluich\nrematchOfferCanceled=Chaidh sgur dhe thairgse ath-mhaids\nrematchOfferDeclined=Tairgse ath-mhaids air a di\u00f9ltadh\ncancelRematchOffer=Sguir dhe thairgse ath-mhaids\nviewRematch=Seall air ath-mhaids\nplay=Cluich\ninbox=Bogsa a-steach\nchatRoom=Se\u00f2mar cabadaich\nspectatorRoom=Se\u00f2mar amhairc\ncomposeMessage=Sgr\u00ecobh teachdaireachd\nsentMessages=Teachdaireachdan air an cur\nincrementInSeconds=Ioncramaid ann an diogan\nfreeOnlineChess=T\u00e0ileasg air loidhne an asgaidh\nspectators=Luchd-amhairc:\nnbWins=Bhuannaich %s\nnbLosses=Chaill %s\nnbDraws=Geama ionnanach le %s\nexportGames=\u00c0s-phortaich geamannan\ncolor=dath\neloRange=Rainse Elo\ngiveNbSeconds=Thoir %s diog(an)\nwhoIsOnline=C\u00f2 tha air loidhne\nallPlayers=A h-uile cluicheadair\npremoveEnabledClickAnywhereToCancel=Ro-ghluasad an comas - d\u00e8an briogadh \u00e0ite sam bith gus sgur dheth\nthisPlayerUsesChessComputerAssistance=Tha an cluicheadair seo a\u2019 cleachdadh taic coimpiutair taileisg\nopening=Fosgladh\ntakeback=Tarraing air ais\nproposeATakeback=Tairg tarraing air ais\ntakebackPropositionSent=Tairgse tarraing air ais air a cur\ntakebackPropositionDeclined=Tairgse tarraing air ais air a di\u00f9ltadh\ntakebackPropositionAccepted=Air gabhail ri tairgse tarraing air ais\ntakebackPropositionCanceled=Chaidh sgur dhe thairgse tarraing air ais\nyourOpponentProposesATakeback=Tha am farpaiseach a\u2019 tairgse tarraing air ais\nbookmarkThisGame=Cruthaich comharra-l\u00ecn airson an geama seo.\ntoggleBackground=Toglaich dath a\u2019 ch\u00f9laibh\nadvancedSearch=Lorg adhartach\ntournament=F\u00e8ill-chluich\ntournamentPoints=Puingean f\u00e8ill-chluich\nviewTournament=Seall an fh\u00e8ill-chluich\nfreeOnlineChessGamePlayChessNowInACleanInterfaceNoRegistrationNoAdsNoPluginRequiredPlayChessWithComputerFriendsOrRandomOpponents=T\u00e0ileasg air loidhne an asgaidh. Cluich t\u00e0ileasg ann am pr\u00f2gram air a bheil dreach glan. Gun chl\u00e0radh, gun sanasachd, gun fheum air plugan. Cluich t\u00e0ileasg an aghaidh a\u2019 choimpiutair, charaidean no n\u00e0imhdean air thuaiream.\nteams=Sgiobaidhean\nnbMembers=%s ball\nallTeams=A h-uile sgioba\nnewTeam=Sgioba \u00f9r\nmyTeams=Na sgiobaidhean agam\nnoTeamFound=Cha deach sgioba a lorg\njoinTeam=Gabh sa sgioba\nquitTeam=F\u00e0g an sgioba\nanyoneCanJoin=Faodaidh duine sam bith a ghabhail ann\naConfirmationIsRequiredToJoin=Tha dearbhadh a dh\u00ecth gus gabhail ann\njoiningPolicy=Poileasaidh gabhail ann\nteamLeader=Ceannard an sgioba\nteamBestPlayers=Ar cluicheadairean as fhearr\nteamRecentMembers=Ar buill as \u00f9ire\naverageElo=Elo cuibheasach\nlocation=\u00c0ite\nsettings=Roghainnean\nfilterGames=Criathraich na geamannan\nreset=Ath-shuidhich\napply=Cuir an s\u00e0s\nleaderboard=Cl\u00e0r na l\u00ecge\npasteTheFenStringHere=Cuir a-steach an t-sreang FEN an-seo\npasteThePgnStringHere=Cuir a-steach an t-sreang PGN an-seo\nfromPosition=On ionad\ncontinueFromHere=Lean air adhart on a sheo\nimportGame=Ion-phortaich geama\nnbImportedGames=%s geama(ichean) air ion-phortadh\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"GDScript"} {"commit":"1dd72a78b585bc87a3e154fe95a834580cd41ad9","subject":"Make buttons show when window lose focus","message":"Make buttons show when window lose focus\n","repos":"vnen\/xna-rpg-godot,vnen\/xna-rpg-godot","old_file":"project\/menus\/menu_button.gd","new_file":"project\/menus\/menu_button.gd","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"mit","lang":"GDScript"} {"commit":"c8387cc53635b7871c8eda14ae4523f9f3459305","subject":"recounts pairs. needed for adding paired blocks in editor","message":"recounts pairs. needed for adding paired blocks in editor\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/GridMan.gd","new_file":"src\/scripts\/GridMan.gd","new_contents":"extends Spatial\n\n# Is there a better way to do this?\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\n# Shape dictionary to access blocks quickly by position.\nvar shape = {}\n\n# Block selection handling.\nvar offClick = false\nvar selectedBlocks = []\n\n# Puzzle vars.\nvar puzzle\n\n# Beam stuff.\nconst beamScn = preload( \"res:\/\/blocks\/block.scn\" )\nconst Beam = preload(\"res:\/\/scripts\/Blocks\/Beam.gd\")\n\n# sounds\nvar samplePlayer = SamplePlayer.new()\n\nfunc add_block(b):\n\tprint (\"ADDED\")\n\tshape[b.blockPos] = b\n\n\t# TODO any special treatment for the wild blocks?\n\t# TODO keep track of puzzle.lasers ? How to?\n\n\t# keep track of puzzle.pairCounts\n\tvar layer = calcBlockLayerVec(b.blockPos)\n\tif b.getBlockType() == 2:\n\t\twhile puzzle.pairCount.size() <= layer:\n\t\t\tpuzzle.pairCount.append(0)\n\t\tpuzzle.pairCount[layer] += 0.5\n\n\tadd_child(b)\n\nfunc get_block(pos):\n\tif shape.has(pos):\n\t\treturn shape[pos]\n\telse:\n\t\treturn null\n\n# unused key argument needed for the tween_complete signal\nfunc remove_block(block_node, key=null):\n\tif block_node == null:\n\t\treturn\n\tprint (\"REMOVED\")\n\tif block_node.get_script() == preload(\"Blocks\/PairedBlock.gd\"):\n\t\tprint(\"PAIRED RM\")\n\tshape[block_node.blockPos] = null\n\tfor child in block_node.get_children():\n\t\tblock_node.remove_and_delete_child(child)\n\tremove_and_delete_child(block_node)\n\n# Sets the puzzle for this GridMan.\nfunc set_puzzle(puzz):\n\t# delete all current nodes\n\tfor pos in shape:\n\t\tremove_block(shape[pos])\n\n\t# Store the puzzle.\n\tpuzzle = puzz\n\n\t# Set the camera range to be relative to the layer count.\n\tvar cam = get_parent().get_parent().get_node( \"Camera\" )\n\tvar totalSize = ( puzzle.puzzleLayers * 2 + 1 )\n\tcam.distance.val = 4.5 * totalSize\n\tcam.distance.min_ = 3 * totalSize\n\tcam.distance.max_ = 10 * totalSize\n\tcam.recalculate_camera()\n\n\t\t# # I can do my own counting!\n\t# needed for adding blocks in the editor\n\tpuzzle.pairCount = []\n\tfor block in puzzle.blocks:\n\t\t# Create a block node, add it to the tree\n\t\tadd_block(block.toNode())\n\n# Clears any selected blocks. WE SHOULD FIX THIS, THERE CAN ONLY BE ONE BLOCK SELECTED AT ANY ONE TIME, NO NEED FOR AN ARRAY!\nfunc clearSelection():\n\tfor bl in selectedBlocks:\n\t\tvar blo = get_node( bl )\n\t\tblo.setSelected(false)\n\t\tblo.scaleTweenNode(1.0).start()\n\tselectedBlocks = []\n\n# Add the selected block to the selected list. WE SHOULD FIX THIS, IT ONLY NEEDS TO STORE IT, NOT AN ARRAY!\nfunc addSelected(bl):\n\tselectedBlocks.append(bl)\n\n# Used for the multiplayer mode to force click a block on their side.\nfunc forceClickBlock( pos ):\n\tshape[pos].forceClick()\n\nfunc clickBlock( name ):\n\t#now check if that was the second block we picked. If it was, we want to\n\t#unselect the blocks again\n\tif (offClick):\n\t\toffClick = false\n\t\taddSelected(name)\n\t\tclearSelection()\n\telse:\n\t\toffClick = true;\n\t\taddSelected(name)\n\n# Calculates the layer that a block is on.\n# COPY OF FUNCTION IN PUZZLEMAN, IS THERE A BETTER WAY TO DO THIS?!\nfunc calcBlockLayer( x, y, z ):\n\treturn max( max( abs( x ), abs( y ) ), abs( z ) )\nfunc calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n# Handles keeping track of pairs being removed.\nfunc popPair( pos ):\n\tvar blayer = calcBlockLayerVec( pos )\n\tpuzzle.pairCount[blayer] -= 1\n\n\tif( puzzle.pairCount[blayer] == 0 ):\n\t\tprint(\"LAYER CLEARED\")\n\t\tif blayer == 1:\n\t\t\tprint( \"GAME OVER!\" )\n\n\t\tfor b in shape:\n\t\t\tif not ( shape[b] == null ):\n\t\t\t\tif calcBlockLayerVec( b ) == blayer:\n\t\t\t\t\tif shape[b].getBlockType() == BLOCK_LASER:\n\t\t\t\t\t\tshape[b].forceActivate()\n\n\t\t# Fire beams.\n\t\tvar beamNum = 0\n\t\tfor l in range( puzzle.lasers.size() ):\n\t\t\tif calcBlockLayerVec( puzzle.lasers[l][0] ) == blayer:\n\t\t\t\t# Firin mah lazerz!\n\t\t\t\tvar beam = beamScn.instance()\n\n\t\t\t\tbeam.set_name( str(blayer) + \"_beam_\" + str(beamNum) )\n\t\t\t\tbeamNum += 1\n\t\t\t\tbeam.set_script( Beam )\n\n\t\t\t\tadd_child( beam )\n\t\t\t\tbeam.fire( puzzle.lasers[l][0], puzzle.lasers[l][1] )\n\n\t\t\t\tsamplePlayer.play( \"soundslikewillem_hitting_slinky\" )\n\n\nfunc _init():\n\t# Load sound\n\tsamplePlayer.set_voice_count(10)\n\tsamplePlayer.set_sample_library(ResourceLoader.load(\"new_samplelibrary.xml\"))\n\tprint(\"GridMan initialized\")\n\n","old_contents":"extends Spatial\n\n# Is there a better way to do this?\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\n# Shape dictionary to access blocks quickly by position.\nvar shape = {}\n\n# Block selection handling.\nvar offClick = false\nvar selectedBlocks = []\n\n# Puzzle vars.\nvar puzzle\n\n# Beam stuff.\nconst beamScn = preload( \"res:\/\/blocks\/block.scn\" )\nconst Beam = preload(\"res:\/\/scripts\/Blocks\/Beam.gd\")\n\n# sounds\nvar samplePlayer = SamplePlayer.new()\n\nfunc add_block(b):\n\tprint (\"ADDED\")\n\tshape[b.blockPos] = b\n\n\t# any special treatment for the wild blocks?\n\t# keep track of puzzle.lasers\n\t# keep track of puzzle.pairCounts\n\tif b.getBlockType() == 2:\n\t\tvar layer = calcBlockLayerVec(b.blockPos)\n\t\twhile puzzle.pairCount.size() <= layer:\n\t\t\t\tpuzzle.pairCount.append(0)\n\n\t\t# preload(\"res:\/\/trust\")\n\t\tpuzzle.pairCount[layer] += 0.5\n\n\tadd_child(b)\n\nfunc get_block(pos):\n\tif shape.has(pos):\n\t\treturn shape[pos]\n\telse:\n\t\treturn null\n\n# unused key argument needed for the tween_complete signal\nfunc remove_block(block_node, key=null):\n\tif block_node == null:\n\t\treturn\n\tprint (\"REMOVED\")\n\tif block_node.get_script() == preload(\"Blocks\/PairedBlock.gd\"):\n\t\tprint(\"PAIRED RM\")\n\tshape[block_node.blockPos] = null\n\tfor child in block_node.get_children():\n\t\tblock_node.remove_and_delete_child(child)\n\tremove_and_delete_child(block_node)\n\n# Sets the puzzle for this GridMan.\nfunc set_puzzle(puzz):\n\t# delete all current nodes\n\tfor pos in shape:\n\t\tremove_block(shape[pos])\n\tprint(shape)\n\n\t# Store the puzzle.\n\tpuzzle = puzz\n\n\t# Set the camera range to be relative to the layer count.\n\tvar cam = get_parent().get_parent().get_node( \"Camera\" )\n\tvar totalSize = ( puzzle.puzzleLayers * 2 + 1 )\n\tcam.distance.val = 4.5 * totalSize\n\tcam.distance.min_ = 3 * totalSize\n\tcam.distance.max_ = 10 * totalSize\n\tcam.recalculate_camera()\n\n\tfor block in puzzle.blocks:\n\t\t# Create a block node, add it to the tree\n\t\tadd_block(block.toNode())\n\n# Clears any selected blocks. WE SHOULD FIX THIS, THERE CAN ONLY BE ONE BLOCK SELECTED AT ANY ONE TIME, NO NEED FOR AN ARRAY!\nfunc clearSelection():\n\tfor bl in selectedBlocks:\n\t\tvar blo = get_node( bl )\n\t\tblo.setSelected(false)\n\t\tblo.scaleTweenNode(1.0).start()\n\tselectedBlocks = []\n\n# Add the selected block to the selected list. WE SHOULD FIX THIS, IT ONLY NEEDS TO STORE IT, NOT AN ARRAY!\nfunc addSelected(bl):\n\tselectedBlocks.append(bl)\n\n# Used for the multiplayer mode to force click a block on their side.\nfunc forceClickBlock( pos ):\n\tshape[pos].forceClick()\n\nfunc clickBlock( name ):\n\t#now check if that was the second block we picked. If it was, we want to\n\t#unselect the blocks again\n\tif (offClick):\n\t\toffClick = false\n\t\taddSelected(name)\n\t\tclearSelection()\n\telse:\n\t\toffClick = true;\n\t\taddSelected(name)\n\n# Calculates the layer that a block is on.\n# COPY OF FUNCTION IN PUZZLEMAN, IS THERE A BETTER WAY TO DO THIS?!\nfunc calcBlockLayer( x, y, z ):\n\treturn max( max( abs( x ), abs( y ) ), abs( z ) )\nfunc calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n# Handles keeping track of pairs being removed.\nfunc popPair( pos ):\n\tvar blayer = calcBlockLayerVec( pos )\n\tpuzzle.pairCount[blayer] -= 1\n\tprint(\"POP, \", puzzle.pairCount)\n\n\tif( puzzle.pairCount[blayer] == 0 ):\n\t\tprint(\"LAYER CLEARED\")\n\t\tif blayer == 1:\n\t\t\tprint( \"GAME OVER!\" )\n\n\t\tfor b in shape:\n\t\t\tif not ( shape[b] == null ):\n\t\t\t\tif calcBlockLayerVec( b ) == blayer:\n\t\t\t\t\tif shape[b].getBlockType() == BLOCK_LASER:\n\t\t\t\t\t\tshape[b].forceActivate()\n\n\t\t# Fire beams.\n\t\tvar beamNum = 0\n\t\tfor l in range( puzzle.lasers.size() ):\n\t\t\tif calcBlockLayerVec( puzzle.lasers[l][0] ) == blayer:\n\t\t\t\t# Firin mah lazerz!\n\t\t\t\tvar beam = beamScn.instance()\n\n\t\t\t\tbeam.set_name( str(blayer) + \"_beam_\" + str(beamNum) )\n\t\t\t\tbeamNum += 1\n\t\t\t\tbeam.set_script( Beam )\n\n\t\t\t\tadd_child( beam )\n\t\t\t\tbeam.fire( puzzle.lasers[l][0], puzzle.lasers[l][1] )\n\n\t\t\t\tsamplePlayer.play( \"soundslikewillem_hitting_slinky\" )\n\n\nfunc _init():\n\t# Load sound\n\tsamplePlayer.set_voice_count(10)\n\tsamplePlayer.set_sample_library(ResourceLoader.load(\"new_samplelibrary.xml\"))\n\tprint(\"GridMan initialized\")\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"76601c40f49f494c8c5287c9bb9ca19489e03a0b","subject":"Added a transform message and update teh constants fort mesage types","message":"Added a transform message and update teh constants fort mesage types\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Network.gd","new_file":"src\/scripts\/Network.gd","new_contents":"\nextends Node\n\nconst REMOTE_FINISH = 0\nconst REMOTE_START = 1\nconst REMOTE_QUIT = 2\nconst REMOTE_BLOCK = 4\nconst REMOTE_BLOCK_TRANSFORM = 5\nconst REMOTE_BLOCK_UPDATE = 6\n\nvar port = 54321\nvar root\nvar isNetwork\nvar isHost\nvar isClient\nvar server\nvar client\nvar connection\n\nvar remotePuzzle\n\n#Store the peer stream used by both the lcient and server\nvar stream\n\nfunc _ready():\n\tisNetwork = false\n\tisHost = false\n\tget_tree().get_root().get_node(\"GUIManager\/OptionsMenu\/Panel\/PortField\/LineEdit\").set_text(str(port))\n\nfunc setPort(pt):\n\tport = pt;\n\nfunc connectTo(ip, pt):\n\tisClient = true #just to tell if it's doing something :S\n\tconnection = PacketPeerStream.new()\n\tstream = StreamPeerTCP.new()\n\tconnection.set_stream_peer(stream)\n\tstream.connect(ip, pt);\n\t\n\tif stream.get_status() == stream.STATUS_CONNECTED or stream.get_status() == stream.STATUS_CONNECTING:\n\t\tprint(\"Connecting to \" + ip + \":\" + str(port));\n\t\tset_process(true)\n\t\t#leave is_network as false to indicate we're still waiting for connection\n\t\n\t\nfunc host(pt):\n\tserver = TCP_Server.new()\n\tconnection = PacketPeerStream.new()\n\tisHost = true\n\tprint(\"Starting listening server on port \" + str(pt))\n\tif server.listen(pt) == 0:\n\t\tset_process(true)\n\t\tprint(\"Listening...\")\n\telse:\n\t\tprint(\"Failed to start server on port \" + str(pt));\n\t\nfunc _process(delta):\n\tif (isHost):\n\t\t#server processing stuff\n\t\t#use isNetwork to determine if we're still listening\n\t\tif !isNetwork:\n\t\t\tif server.is_connection_available():\n\t\t\t\tstream = server.take_connection()\n\t\t\t\tconnection = PacketPeerStream.new()\n\t\t\t\tconnection.set_stream_peer(stream)\n\t\t\t\tprint(\"Connecting with player...\")\n\t\t\t\tisNetwork = true\n\t\t\t\tserver.stop()\n\t\t\t\tchangeScene(\"res:\/\/network_test.scn\")\n\t\t\t\tremotePuzzle = root.get_node(\"Spatial\")\n\t\t\t\t#MAKE CALL TO PUZZLE SELECTER\n\t\telse: #not listening anymore, have a client\n\t\t\t#do quick check to make sure we're still\n\t\t\t#connected\n\t\t\tif !stream.is_connected():\n\t\t\t\tprint(\"Lost Connection!\");\n\t\t\t\tisNetwork = false\n\t\t\t\tset_process(false)\n\t\t\t\t#QUIT GAME\n\t\t\t\treturn\n\t\t\t#check if we have any data\n\t\t\tif connection.get_available_packet_count() > 0:\n\t\t\t\t#have to be careful about more than 1 packet per frame\n\t\t\t\tfor i in range(connection.get_available_packet_count()):\n\t\t\t\t\tvar dataArray = connection.get_var()\n\t\t\t\t\tprocessServerData(dataArray)\n\t\t\t\t\t\n\telse:\n\t\t#client processing stuff\n\t\tif !isNetwork:\n\t\t\t#Still waiting for connection confirmed\n\t\t\tif stream.get_status() == stream.STATUS_CONNECTED:\n\t\t\t\tprint(\"Connection established!\")\n\t\t\t\tisNetwork = true\n\t\t\t\tchangeScene(\"res:\/\/network_test.scn\")\n\t\t\t\tremotePuzzle = root.get_node(\"Spatial\")\n\t\t\t\treturn\n\t\t\tif stream.get_status() == stream.STATUS_NONE or stream.get_status() == stream.STATUS_ERROR:\n\t\t\t\tprint(\"Error establishing connection!\")\n\t\t\t\tset_process(false)\n\t\t\t\treturn\n\t\t\t\t#stop running process loop, cause we have no connection\n\t\telse:\n\t\t\t#connecton established and confirmed. Do regular data processing\n\t\t\t#check if we have any data\n\t\t\tif connection.get_available_packet_count() > 0:\n\t\t\t\tfor i in range(connection.get_available_packet_count()):\n\t\t\t\t\tvar dataArray = connection.get_var()\n\t\t\t\t\tprocessServerData(dataArray)\n\t\t\t\t\t#Call the server process script cuase it's peer to peer and we have the same functions!\n\n\nfunc disconnect():\n\t#need to do lots of things! If the server is open and listening, but has no connection just stop listening!\n\tif isHost and !isNetwork:\n\t\t#this means we're waiting for connection still\n\t\tserver.stop()\n\t\tprint(\"closing server listener!\")\n\telif isHost and isNetwork:\n\t\t#have connections. Need to send them stop packet, and close connection\n\t\tconnection.put_var([REMOTE_QUIT])\n\t\tstream.disconnect()\n\t\tprint(\"Closing connection to remote player...\")\n\telif !isHost and !isNetwork:\n\t\tstream.disconnect()\n\t\tprint(\"Halting connection request...\")\n\telif !isHost and isNetwork:\n\t\t#connected to server already\n\t\tstream.disconnect()\n\t\tprint(\"Disconnecting from server...\")\n\t\n\t#no matter where we wre before disconnect, set network to false and return to beginning screen!\n\tisNetwork = false;\n\tisHost = false;\n\tisClient = false;\n\t\n\tset_process(false)\n\t\n\tchangeScene(\"res:\/\/menus.scn\")\n\n\n\nfunc ProcessServerData(dataArray):\n\t#have an array of data. First element should be identifying int\n\tvar ID = dataArray[0]\n\tprint(ID)\n\t#no swithc statement. I'm crying right now while i type this. My fingers are bleeding\n\tif ID == REMOTE_START:\n\t\t#do start something or something whut\n\t\tprint(\"remote_stuff\")\n\telif ID == REMOTE_FINISH:\n\t\t#again, do ending stuff\n\t\tprint(\"remote_finish: \" + str(dataArray[1]))\n\telif ID == REMOTE_QUIT:\n\t\t#omg those jerks!\n\t\tprint(\"remote_quit\")\n\t\tdisconnect()\n\telif ID == REMOTE_BLOCK:\n\t\t#get their block ifnormation!\n\t\tprint(\"remote_block\")\n\telif ID == REMOTE_BLOCK_TRANSFORM:\n\t\t#sent block information\n\t\tprint(\"block TRANSFORM!!!!!!!!!!!\")\n\t\tvar scale = dataArray[1]\n\t\tvar translation = dataArray[2]\n\t\tremotePuzzle.otherPuzzle.set_scale(scale)\n\t\tremotePuzzle.otherPuzzle.set_translation(translation)\n\nfunc sendStart():\n\tif !isNetwork:\n\t\tprint(\"Error sending start packet: not connected!\")\n\t\treturn\n\tvar er = connection.put_var([REMOTE_START])\n\tprint(\"Sending start and got [\" + str(er) + \"]\")\n\nfunc sendFinish(score):\n\tif !isNetwork:\n\t\tprint(\"Error sending finish packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_FINISH, score])\n\nfunc sendQuit():\n\tif !isNetwork:\n\t\tprint(\"Error sending finish packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_QUIT])\n\nfunc sendTransform(scale, translation):\n\tif !isNetwork:\n\t\tprint(\"Cannot send transformation over an unitialized network!\")\n\t\treturn\n\tconnection.put_var([REMOTE_BLOCK_TRANSFORM, scale, translation])\n\n\n\nfunc changeScene(scene):\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\t#root.get_child( 0).queue_free()\n\troot.add_child( ResourceLoader.load( scene ).instance() )\n","old_contents":"\nextends Node\n\nconst REMOTE_FINISH = 0\nconst REMOTE_START = 1\nconst REMOTE_QUIT = 2\nconst REMOTE_BLOCK = 4\nconst REMOTE_MSG = 5\n\nvar port = 54321\nvar root\nvar isNetwork\nvar isHost\nvar isClient\nvar server\nvar client\nvar connection\n#Store the peer stream used by both the lcient and server\nvar stream\n\nfunc _ready():\n\tisNetwork = false\n\tisHost = false\n\tget_tree().get_root().get_node(\"GUIManager\/OptionsMenu\/Panel\/PortField\/LineEdit\").set_text(str(port))\n\nfunc setPort(pt):\n\tport = pt;\n\nfunc connectTo(ip, pt):\n\tisClient = true #just to tell if it's doing something :S\n\tconnection = PacketPeerStream.new()\n\tstream = StreamPeerTCP.new()\n\tconnection.set_stream_peer(stream)\n\tstream.connect(ip, pt);\n\t\n\tif stream.get_status() == stream.STATUS_CONNECTED or stream.get_status() == stream.STATUS_CONNECTING:\n\t\tprint(\"Connecting to \" + ip + \":\" + str(port));\n\t\tset_process(true)\n\t\t#leave is_network as false to indicate we're still waiting for connection\n\t\n\t\nfunc host(pt):\n\tserver = TCP_Server.new()\n\tconnection = PacketPeerStream.new()\n\tisHost = true\n\tprint(\"Starting listening server on port \" + str(pt))\n\tif server.listen(pt) == 0:\n\t\tset_process(true)\n\t\tprint(\"Listening...\")\n\telse:\n\t\tprint(\"Failed to start server on port \" + str(pt));\n\t\nfunc _process(delta):\n\tif (isHost):\n\t\t#server processing stuff\n\t\t#use isNetwork to determine if we're still listening\n\t\tif !isNetwork:\n\t\t\tif server.is_connection_available():\n\t\t\t\tstream = server.take_connection()\n\t\t\t\tconnection = PacketPeerStream.new()\n\t\t\t\tconnection.set_stream_peer(stream)\n\t\t\t\tprint(\"Connecting with player...\")\n\t\t\t\tisNetwork = true\n\t\t\t\tserver.stop()\n\t\t\t\tchangeScene(\"res:\/\/network_test.scn\")\n\t\t\t\t#MAKE CALL TO PUZZLE SELECTER\n\t\telse: #not listening anymore, have a client\n\t\t\t#do quick check to make sure we're still\n\t\t\t#connected\n\t\t\tif !stream.is_connected():\n\t\t\t\tprint(\"Lost Connection!\");\n\t\t\t\tisNetwork = false\n\t\t\t\tset_process(false)\n\t\t\t\t#QUIT GAME\n\t\t\t\treturn\n\t\t\t#check if we have any data\n\t\t\tif connection.get_available_packet_count() > 0:\n\t\t\t\t#have to be careful about more than 1 packet per frame\n\t\t\t\tfor i in range(connection.get_available_packet_count()):\n\t\t\t\t\tvar dataArray = connection.get_var()\n\t\t\t\t\tprocessServerData(dataArray)\n\t\t\t\t\t\n\telse:\n\t\t#client processing stuff\n\t\tif !isNetwork:\n\t\t\t#Still waiting for connection confirmed\n\t\t\tif stream.get_status() == stream.STATUS_CONNECTED:\n\t\t\t\tprint(\"Connection established!\")\n\t\t\t\tisNetwork = true\n\t\t\t\tchangeScene(\"res:\/\/network_test.scn\")\n\t\t\t\treturn\n\t\t\tif stream.get_status() == stream.STATUS_NONE or stream.get_status() == stream.STATUS_ERROR:\n\t\t\t\tprint(\"Error establishing connection!\")\n\t\t\t\tset_process(false)\n\t\t\t\treturn\n\t\t\t\t#stop running process loop, cause we have no connection\n\t\telse:\n\t\t\t#connecton established and confirmed. Do regular data processing\n\t\t\t#check if we have any data\n\t\t\tif connection.get_available_packet_count() > 0:\n\t\t\t\tfor i in range(connection.get_available_packet_count()):\n\t\t\t\t\tvar dataArray = connection.get_var()\n\t\t\t\t\tprocessServerData(dataArray)\n\t\t\t\t\t#Call the server process script cuase it's peer to peer and we have the same functions!\n\n\nfunc disconnect():\n\t#need to do lots of things! If the server is open and listening, but has no connection just stop listening!\n\tif isHost and !isNetwork:\n\t\t#this means we're waiting for connection still\n\t\tserver.stop()\n\t\tprint(\"closing server listener!\")\n\telif isHost and isNetwork:\n\t\t#have connections. Need to send them stop packet, and close connection\n\t\tconnection.put_var([REMOTE_QUIT])\n\t\tstream.disconnect()\n\t\tprint(\"Closing connection to remote player...\")\n\telif !isHost and !isNetwork:\n\t\tstream.disconnect()\n\t\tprint(\"Halting connection request...\")\n\telif !isHost and isNetwork:\n\t\t#connected to server already\n\t\tstream.disconnect()\n\t\tprint(\"Disconnecting from server...\")\n\t\n\t#no matter where we wre before disconnect, set network to false and return to beginning screen!\n\tisNetwork = false;\n\tisHost = false;\n\tisClient = false;\n\t\n\tset_process(false)\n\t\n\tchangeScene(\"res:\/\/menus.scn\")\n\n\n\nfunc ProcessServerData(dataArray):\n\t#have an array of data. First element should be identifying int\n\tvar ID = dataArray[0]\n\tprint(ID)\n\t#no swithc statement. I'm crying right now while i type this. My fingers are bleeding\n\tif ID == REMOTE_START:\n\t\t#do start something or something whut\n\t\tprint(\"remote_stuff\")\n\telif ID == REMOTE_FINISH:\n\t\t#again, do ending stuff\n\t\tprint(\"remote_finish: \" + str(dataArray[1]))\n\telif ID == REMOTE_QUIT:\n\t\t#omg those jerks!\n\t\tprint(\"remote_quit\")\n\t\tdisconnect()\n\telif ID == REMOTE_BLOCK:\n\t\t#get their block ifnormation!\n\t\tprint(\"remote_block\")\n\telif ID == REMOTE_MSG:\n\t\t#sent some sort of message?\n\t\tprint(\"remote_msg\")\n\nfunc sendStart():\n\tif !isNetwork:\n\t\tprint(\"Error sending start packet: not connected!\")\n\t\treturn\n\tvar er = connection.put_var([REMOTE_START])\n\tprint(\"Sending start and got [\" + str(er) + \"]\")\n\nfunc sendFinish(score):\n\tif !isNetwork:\n\t\tprint(\"Error sending finish packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_FINISH, score])\n\nfunc sendQuit():\n\tif !isNetwork:\n\t\tprint(\"Error sending finish packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_QUIT])\n\n\n\n\nfunc changeScene(scene):\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\t#root.get_child( 0).queue_free()\n\troot.add_child( ResourceLoader.load( scene ).instance() )\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"d53dd018973fd33c38bc2587c024fe01c75b88bd","subject":"Update iap.gd","message":"Update iap.gd","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"misc\/android_iap\/iap.gd","new_file":"misc\/android_iap\/iap.gd","new_contents":"\nextends Node\n\nsignal purchase_success(item_name)\nsignal purchase_fail\nsignal purchase_cancel\nsignal purchase_owned(item_name)\n\nsignal has_purchased(item_name)\n\nsignal consume_success(item_name)\nsignal consume_fail\nsignal consume_not_required\n\nsignal sku_details_complete\nsignal sku_details_error\n\nonready var payment = Engine.get_singleton(\"GodotPayments\")\n\nfunc _ready():\n\tif payment:\n\t\t# set callback with this script instance\n\t\tpayment.setPurchaseCallbackId(get_instance_ID())\n\n# set consume purchased item automatically after purchase, defulat value is true\nfunc set_auto_consume(auto):\n\tif payment:\n\t\tpayment.setAutoConsume(auto)\n\n\n# request user owned item, callback : has_purchased\nfunc request_purchased():\n\tif payment:\n\t\tpayment.requestPurchased()\n\nfunc has_purchased(receipt, signature, sku):\n\tif sku == \"\":\n\t\tprint(\"has_purchased : nothing\")\n\t\temit_signal(\"has_purchased\", null)\n\telse:\n\t\tprint(\"has_purchased : \", sku)\n\t\temit_signal(\"has_purchased\", sku)\n\n\n# purchase item\n# callback : purchase_success, purchase_fail, purchase_cancel, purchase_owned\nfunc purchase(item_name):\n\tif payment:\n\t\t# transaction_id could be any string that used for validation internally in java\n\t\tpayment.purchase(item_name, \"transaction_id\")\n\nfunc purchase_success(receipt, signature, sku):\n\tprint(\"purchase_success : \", sku)\n\temit_signal(\"purchase_success\", sku)\n\nfunc purchase_fail():\n\tprint(\"purchase_fail\")\n\temit_signal(\"purchase_fail\")\n\nfunc purchase_cancel():\n\tprint(\"purchase_cancel\")\n\temit_signal(\"purchase_cancel\")\n\nfunc purchase_owned(sku):\n\tprint(\"purchase_owned : \", sku)\n\temit_signal(\"purchase_owned\", sku)\n\n\n# consume purchased item\n# callback : consume_success, consume_fail\nfunc consume(item_name):\n\tif payment:\n\t\tpayment.consume(item_name)\n\n# consume all purchased items\nfunc consume_all():\n\tif payment:\n\t\tpayment.consumeUnconsumedPurchases()\n\nfunc consume_success(receipt, signature, sku):\n\tprint(\"consume_success : \", sku)\n\temit_signal(\"consume_success\", sku)\n\n# if consume fail, need to call request_purchased() to get purchase token from google\n# then try to consume again\nfunc consume_fail():\n\temit_signal(\"consume_fail\")\n\n# no purchased item to consume\nfunc consume_not_required():\n\temit_signal(\"consume_not_required\")\n\n\n# detail info of IAP items\n# sku_details = {\n# product_id (String) : {\n# type (String),\n# product_id (String),\n# title (String),\n# description (String),\n# price (String), # this can be used to display price for each country with their own currency\n# price_currency_code (String),\n# price_amount (float)\n# },\n# ...\n# }\nvar sku_details = {}\n\n# query for details of IAP items\n# callback : sku_details_complete\nfunc sku_details_query(list):\n\tif payment:\n\t\tvar sku_list = StringArray(list)\n\t\tpayment.querySkuDetails(sku_list)\n\nfunc sku_details_complete(result):\n\tprint(\"sku_details_complete : \", result)\n\tfor key in result.keys():\n\t\tsku_details[key] = result[key]\n\temit_signal(\"sku_details_complete\")\n\nfunc sku_details_error(error_message):\n\tprint(\"error_sku_details = \", error_message)\n\temit_signal(\"sku_details_error\")\n","old_contents":"\nextends Node\n\nsignal purchase_success(item_name)\nsignal purchase_fail\nsignal purchase_cancel\nsignal purchase_owned(item_name)\n\nsignal has_purchased(item_name)\n\nsignal consume_success(item_name)\nsignal consume_fail\nsignal consume_not_required\n\nsignal sku_details_complete\nsignal sku_details_error\n\nonready var payment = ProjectSettings.get_singleton(\"GodotPayments\")\n\nfunc _ready():\n\tif payment:\n\t\t# set callback with this script instance\n\t\tpayment.setPurchaseCallbackId(get_instance_ID())\n\n# set consume purchased item automatically after purchase, defulat value is true\nfunc set_auto_consume(auto):\n\tif payment:\n\t\tpayment.setAutoConsume(auto)\n\n\n# request user owned item, callback : has_purchased\nfunc request_purchased():\n\tif payment:\n\t\tpayment.requestPurchased()\n\nfunc has_purchased(receipt, signature, sku):\n\tif sku == \"\":\n\t\tprint(\"has_purchased : nothing\")\n\t\temit_signal(\"has_purchased\", null)\n\telse:\n\t\tprint(\"has_purchased : \", sku)\n\t\temit_signal(\"has_purchased\", sku)\n\n\n# purchase item\n# callback : purchase_success, purchase_fail, purchase_cancel, purchase_owned\nfunc purchase(item_name):\n\tif payment:\n\t\t# transaction_id could be any string that used for validation internally in java\n\t\tpayment.purchase(item_name, \"transaction_id\")\n\nfunc purchase_success(receipt, signature, sku):\n\tprint(\"purchase_success : \", sku)\n\temit_signal(\"purchase_success\", sku)\n\nfunc purchase_fail():\n\tprint(\"purchase_fail\")\n\temit_signal(\"purchase_fail\")\n\nfunc purchase_cancel():\n\tprint(\"purchase_cancel\")\n\temit_signal(\"purchase_cancel\")\n\nfunc purchase_owned(sku):\n\tprint(\"purchase_owned : \", sku)\n\temit_signal(\"purchase_owned\", sku)\n\n\n# consume purchased item\n# callback : consume_success, consume_fail\nfunc consume(item_name):\n\tif payment:\n\t\tpayment.consume(item_name)\n\n# consume all purchased items\nfunc consume_all():\n\tif payment:\n\t\tpayment.consumeUnconsumedPurchases()\n\nfunc consume_success(receipt, signature, sku):\n\tprint(\"consume_success : \", sku)\n\temit_signal(\"consume_success\", sku)\n\n# if consume fail, need to call request_purchased() to get purchase token from google\n# then try to consume again\nfunc consume_fail():\n\temit_signal(\"consume_fail\")\n\n# no purchased item to consume\nfunc consume_not_required():\n\temit_signal(\"consume_not_required\")\n\n\n# detail info of IAP items\n# sku_details = {\n# product_id (String) : {\n# type (String),\n# product_id (String),\n# title (String),\n# description (String),\n# price (String), # this can be used to display price for each country with their own currency\n# price_currency_code (String),\n# price_amount (float)\n# },\n# ...\n# }\nvar sku_details = {}\n\n# query for details of IAP items\n# callback : sku_details_complete\nfunc sku_details_query(list):\n\tif payment:\n\t\tvar sku_list = StringArray(list)\n\t\tpayment.querySkuDetails(sku_list)\n\nfunc sku_details_complete(result):\n\tprint(\"sku_details_complete : \", result)\n\tfor key in result.keys():\n\t\tsku_details[key] = result[key]\n\temit_signal(\"sku_details_complete\")\n\nfunc sku_details_error(error_message):\n\tprint(\"error_sku_details = \", error_message)\n\temit_signal(\"sku_details_error\")\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"3534533d57a9eefcefe054dc2cc37ea970efe8be","subject":"Expose ResourceImportMetadata::set_source_md5 for script","message":"Expose ResourceImportMetadata::set_source_md5 for script\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"plugins\/custom_import_plugin\/import_plugin.gd","new_file":"plugins\/custom_import_plugin\/import_plugin.gd","new_contents":"tool\n\nextends EditorImportPlugin\n\n\n# Simple plugin that imports a text file with extension .mtxt\n# which contains 3 integers in format R,G,B (0-255)\n# (see example .mtxt in this folder)\n# Imported file is converted to a material\n\nvar dialog = null\n\nfunc get_name():\n\treturn \"silly_material\"\n\nfunc get_visible_name():\n\treturn \"Silly Material\"\n\nfunc import_dialog(path):\n\tvar md = null\n\tif (path!=\"\"):\n\t\tmd = ResourceLoader.load_import_metadata(path)\n\tdialog.configure(self,path,md)\n\tdialog.popup_centered()\n\nfunc import(path,metadata):\n\n\tassert(metadata.get_source_count() == 1)\n\n\tvar source = metadata.get_source_path(0)\n\tvar use_red_anyway = metadata.get_option(\"use_red_anyway\")\n\n\tvar f = File.new()\n\tvar err = f.open(source,File.READ)\n\tif (err!=OK):\n\t\treturn ERR_CANT_OPEN\n\n\tvar l = f.get_line()\n\n\tf.close()\n\n\tvar channels = l.split(\",\")\n\tif (channels.size()!=3):\n\t\treturn ERR_PARSE_ERROR\n\n\tvar color = Color8(int(channels[0]),int(channels[1]),int(channels[2]))\n\n\tvar material\n\n\tif (ResourceLoader.has(path)):\n\t\t# Material is in use, update it\n\t\tmaterial = ResourceLoader.load(path)\n\telse:\n\t\t# Material not in use, create\n\t\tmaterial = FixedMaterial.new()\n\n\tif (use_red_anyway):\n\t\tcolor=Color8(255,0,0)\n\n\tmaterial.set_parameter(FixedMaterial.PARAM_DIFFUSE,color)\n\n\t# Make sure import metadata links to this plugin\n\n\tmetadata.set_editor(\"silly_material\")\n\n\t# Update the md5 value of the source file\n\n\tmetadata.set_source_md5(0, f.get_md5(source))\n\n\t# Update the import metadata\n\n\tmaterial.set_import_metadata(metadata)\n\n\n\t# Save\n\terr = ResourceSaver.save(path,material)\n\n\treturn err\n\n\nfunc config(base_control):\n\n\tdialog = preload(\"res:\/\/addons\/custom_import_plugin\/material_dialog.tscn\").instance()\n\tbase_control.add_child(dialog)\n","old_contents":"tool\n\nextends EditorImportPlugin\n\n\n# Simple plugin that imports a text file with extension .mtxt\n# which contains 3 integers in format R,G,B (0-255)\n# (see example .mtxt in this folder)\n# Imported file is converted to a material\n\nvar dialog = null\n\nfunc get_name():\n\treturn \"silly_material\"\n\nfunc get_visible_name():\n\treturn \"Silly Material\"\n\nfunc import_dialog(path):\n\tvar md = null\n\tif (path!=\"\"):\n\t\tmd = ResourceLoader.load_import_metadata(path)\n\tdialog.configure(self,path,md)\n\tdialog.popup_centered()\n\nfunc import(path,metadata):\n\n\tassert(metadata.get_source_count() == 1)\n\n\tvar source = metadata.get_source_path(0)\n\tvar use_red_anyway = metadata.get_option(\"use_red_anyway\")\n\n\tvar f = File.new()\n\tvar err = f.open(source,File.READ)\n\tif (err!=OK):\n\t\treturn ERR_CANT_OPEN\n\n\tvar l = f.get_line()\n\n\tf.close()\n\n\tvar channels = l.split(\",\")\n\tif (channels.size()!=3):\n\t\treturn ERR_PARSE_ERROR\n\n\tvar color = Color8(int(channels[0]),int(channels[1]),int(channels[2]))\n\n\tvar material\n\n\tif (ResourceLoader.has(path)):\n\t\t# Material is in use, update it\n\t\tmaterial = ResourceLoader.load(path)\n\telse:\n\t\t# Material not in use, create\n\t\tmaterial = FixedMaterial.new()\n\n\tif (use_red_anyway):\n\t\tcolor=Color8(255,0,0)\n\t\n\tmaterial.set_parameter(FixedMaterial.PARAM_DIFFUSE,color)\t\n\n\t# Make sure import metadata links to this plugin\n\t\n\tmetadata.set_editor(\"silly_material\")\n\n\t# Update the import metadata\n\n\tmaterial.set_import_metadata(metadata)\n\t\n\n\t# Save\n\terr = ResourceSaver.save(path,material)\n\n\treturn err\n\n\nfunc config(base_control):\n\n\tdialog = preload(\"res:\/\/addons\/custom_import_plugin\/material_dialog.tscn\").instance()\n\tbase_control.add_child(dialog)\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"851840c50f41e0580cac32ecf01c6fc83246b01f","subject":"Performance improvements for the long text display.","message":"Performance improvements for the long text display.\n","repos":"groboclown\/godot-bootstrap","old_file":"components\/long_text\/long_text.gd","new_file":"components\/long_text\/long_text.gd","new_contents":"\n\n# A text label that scrolls on and on.\n\nextends Container\n\n\nexport(int, 0, 1000) var indent_pixels = 20 setget indent_spaces_changed\nexport(float, 0, 10) var paragraph_separation = 1.8 setget paragraph_separation_changed\nexport(float, 0, 10) var line_height = 1.5 setget line_height_changed\nexport(Color, RGBA) var color\nexport(Font) var font setget font_changed\nexport(String) var text setget text_changed\n\nvar _trtext\nvar _line_pos = []\nvar _height = 0\nvar _changed = false\n\nconst CH_SPACE = 32\nconst CH_TAB = 9\nconst CH_LF = 13\nconst CH_CR = 10\nconst CH_BACKSLASH = 92\nconst CH_N = 110\nconst CH_T = 116\n\nfunc _init():\n\tconnect(\"resized\", self, \"recalculate\")\n\tconnect(\"minimum_size_changed\", self, \"recalculate\")\n\tconnect(\"size_flags_changed\", self, \"recalculate\")\n\n\nfunc _ready():\n\tif get_parent() extends ScrollContainer:\n\t\tget_parent().connect(\"resized\", self, \"recalculate\")\n\tif _changed:\n\t\trecalculate()\n\n\n\nfunc _draw():\n\tif _changed:\n\t\trecalculate()\n\tvar fnt = font\n\tif fnt == null:\n\t\tfnt = get_font(\"font\", \"Label\")\n\tvar c = color\n\tif c == null:\n\t\tc = get_color(\"font_color\", \"Label\")\n\tfor line in _line_pos:\n\t\tdraw_string(fnt, line[1], line[0], c)\n\nfunc indent_spaces_changed(newval):\n\t_changed = true\n\nfunc paragraph_separation_changed(newval):\n\t_changed = true\n\nfunc line_height_changed(newval):\n\t_changed = true\n\nfunc font_changed(newval):\n\t_changed = true\n\nfunc text_changed(newval):\n\t_changed = true\n\t_trtext = []\n\tvar t = null\n\tif newval != null:\n\t\tt = tr(newval)\n\tif t == null:\n\t\treturn\n\t# escape the text\n\tvar esc = false\n\tvar txt = \"\"\n\tvar first = 0\n\tvar i\n\tfor i in range(0, t.length()):\n\t\tvar ch = t.ord_at(i)\n\t\tif esc:\n\t\t\tesc = false\n\t\t\tif ch == CH_N:\n\t\t\t\tif i - 1 > first:\n\t\t\t\t\ttxt += t.substring(first, i - 1)\n\t\t\t\ttxt = txt.strip_edges()\n\t\t\t\tif txt.length() > 0:\n\t\t\t\t\t_trtext.append(txt)\n\t\t\t\ttxt = \"\"\n\t\t\t\tfirst = i + 1\n\t\t\telif ch == CH_T:\n\t\t\t\t# change to a space\n\t\t\t\tif i - 1 > first:\n\t\t\t\t\ttxt += t.substring(first, i - 1)\n\t\t\t\ttxt += ' '\n\t\t\t\tfirst = i + 1\n\t\t\telse:\n\t\t\t\t# Just use the un-escaped value\n\t\t\t\tfirst = i\n\t\telif ch == CH_BACKSLASH:\n\t\t\tif i > first:\n\t\t\t\ttxt += t.substr(first, i - first)\n\t\t\tesc = true\n\t\telif (ch == CH_CR || ch == CH_LF):\n\t\t\tif i > first:\n\t\t\t\ttxt += t.substr(first, i - first)\n\t\t\ttxt = txt.strip_edges()\n\t\t\tif txt.length() > 0:\n\t\t\t\t_trtext.append(txt)\n\t\t\ttxt = \"\"\n\t\t\tfirst = i + 1\n\t\telif ch == CH_TAB:\n\t\t\tif i > first:\n\t\t\t\ttxt += t.substr(first, i - first)\n\t\t\ttxt += ' '\n\t\t\tfirst = i + 1\n\t\t# else ch is a normal character; it is just added to the\n\t\t# pending substring\n\tif t.length() > first:\n\t\ttxt += t.right(first)\n\t\ttxt = txt.strip_edges()\n\t\tif txt.length() > 0:\n\t\t\t_trtext.append(txt)\n\n\nfunc recalculate():\n\t_changed = false\n\t\n\tvar widget_width = max(get_minimum_size().x, get_size().x)\n\tif get_parent() != null && get_parent() extends ScrollContainer:\n\t\tvar pw = get_parent().get_size().x\n\t\tif pw > 0:\n\t\t\tvar k = get_parent().get_node(\"_v_scroll\")\n\t\t\tif k != null:\n\t\t\t\tpw -= max(k.get_size().x, 10)\n\t\t\tif pw < widget_width:\n\t\t\t\twidget_width = pw\n\t\n\tvar start_x = 0\n\tvar fnt = font\n\tif fnt == null:\n\t\tfnt = get_font(\"font\", \"Label\")\n\tvar font_height = float(fnt.get_height())\n\tvar psep = int(paragraph_separation * font_height)\n\tvar lsep = int(line_height * font_height)\n\t_line_pos = []\n\t# We start drawing strings at the bottom of the string.\n\tvar y_pos = -psep + lsep\n\tfor txt in _trtext:\n\t\t# start of an explicit new line\n\t\ty_pos += psep\n\t\tvar tlen = txt.length() - 1\n\t\tvar tpos\n\t\t# We trim the lines, so that they start with non-whitespace\n\t\t# Therefore, the first character of a line is the start of the word.\n\t\tvar linestart_pos = 0\n\t\tvar wordstart_pos = 0\n\t\tvar word_width = 0\n\t\tvar wordend_pos = -1\n\t\tvar on_space = false\n\t\tvar x_pos = indent_pixels + start_x\n\t\tvar width = indent_pixels\n\t\tfor tpos in range(0, tlen + 1):\n\t\t\tvar ch = txt.ord_at(tpos)\n\t\t\tif ch == CH_SPACE:\n\t\t\t\tif not on_space:\n\t\t\t\t\ton_space = true\n\t\t\t\t\twordend_pos = tpos\n\t\t\t\t\twordstart_pos = -1\n\t\t\t\t\tword_width = 0\n\t\t\telse:\n\t\t\t\tif linestart_pos < 0:\n\t\t\t\t\tlinestart_pos = tpos\n\t\t\t\tif wordstart_pos < 0:\n\t\t\t\t\twordstart_pos = tpos\n\t\t\t\t\tword_width = 0\n\t\t\t\ton_space = false\n\t\t\tvar cn = 0\n\t\t\tif tpos + 1 <= tlen:\n\t\t\t\tcn = txt.ord_at(tpos + 1)\n\t\t\tvar cw = fnt.get_char_size(ch, cn).x\n\t\t\twidth += cw\n\t\t\tword_width += cw\n\t\t\tif tpos >= tlen:\n\t\t\t\t# end of the line; stick everything into the end.\n\t\t\t\t# We trim the text, so the last character is non-whitespace.\n\t\t\t\t_line_pos.append([\n\t\t\t\t\t# text\n\t\t\t\t\ttxt.right(linestart_pos),\n\t\t\t\t\t\n\t\t\t\t\t# draw position\n\t\t\t\t\tVector2(x_pos, y_pos)\n\t\t\t\t])\n\t\t\t\t# No need to change x_pos or the other loop variables\n\t\t\t\ty_pos += lsep\n\t\t\telif width >= widget_width:\n\t\t\t\t# Soft end of line\n\t\t\t\tvar next_linestart = wordstart_pos\n\t\t\t\tvar next_wordstart = -1\n\t\t\t\tif wordend_pos < 0:\n\t\t\t\t\t# in the middle of the word.\n\t\t\t\t\tif wordstart_pos < 0:\n\t\t\t\t\t\t# No word in the line. Just skip it\n\t\t\t\t\t\twidth = 0\n\t\t\t\t\t\tx_pos = start_x\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t# only one word; cut this one at the break.\n\t\t\t\t\t# TODO add a hyphen\n\t\t\t\t\twordend_pos = tpos\n\t\t\t\t\tnext_linestart = tpos\n\t\t\t\t\tnext_wordstart = tpos\n\t\t\t\t\tword_width = 0\n\t\t\t\t\n\t\t\t\t# soft end of line\n\t\t\t\t_line_pos.append([\n\t\t\t\t\t# text\n\t\t\t\t\ttxt.substr(linestart_pos, wordend_pos - linestart_pos),\n\t\t\t\t\t\n\t\t\t\t\t# draw position\n\t\t\t\t\tVector2(x_pos, y_pos)\n\t\t\t\t])\n\t\t\t\t\n\t\t\t\tx_pos = start_x\n\t\t\t\tvar next_word_width = word_width - width\n\t\t\t\twidth = word_width\n\t\t\t\tword_width = next_word_width\n\t\t\t\ty_pos += lsep\n\t\t\t\twordstart_pos = next_wordstart\n\t\t\t\twordend_pos = -1\n\t\t\t\tlinestart_pos = next_linestart\n\tset_custom_minimum_size(Vector2(widget_width, y_pos))\n\t\n\n","old_contents":"\n\n# A text label that scrolls on and on.\n\nextends Container\n\n\nexport(int, 0, 1000) var indent_pixels = 20 setget indent_spaces_changed\nexport(float, 0, 10) var paragraph_separation = 1.8 setget paragraph_separation_changed\nexport(float, 0, 10) var line_height = 1.5 setget line_height_changed\nexport(Color, RGBA) var color\nexport(Font) var font setget font_changed\nexport(String) var text setget text_changed\n\nvar _trtext\nvar _line_pos = []\nvar _height = 0\nvar _changed = false\n\nconst CH_SPACE = 32\nconst CH_TAB = 9\nconst CH_LF = 13\nconst CH_CR = 10\nconst CH_BACKSLASH = 92\nconst CH_N = 110\nconst CH_T = 116\n\nfunc _init():\n\tconnect(\"resized\", self, \"recalculate\")\n\tconnect(\"minimum_size_changed\", self, \"recalculate\")\n\tconnect(\"size_flags_changed\", self, \"recalculate\")\n\n\nfunc _ready():\n\tif get_parent() extends ScrollContainer:\n\t\tget_parent().connect(\"resized\", self, \"recalculate\")\n\tif _changed:\n\t\trecalculate()\n\n\n\nfunc _draw():\n\tif _changed:\n\t\trecalculate()\n\tvar fnt = font\n\tif fnt == null:\n\t\tfnt = get_font(\"font\", \"Label\")\n\tvar c = color\n\tif c == null:\n\t\tc = get_color(\"font_color\", \"Label\")\n\tfor line in _line_pos:\n\t\tdraw_string(fnt, line[1], line[0], c)\n\nfunc indent_spaces_changed(newval):\n\t_changed = true\n\nfunc paragraph_separation_changed(newval):\n\t_changed = true\n\nfunc line_height_changed(newval):\n\t_changed = true\n\nfunc font_changed(newval):\n\t_changed = true\n\nfunc text_changed(newval):\n\t_changed = true\n\t_trtext = []\n\tvar t = null\n\tif newval != null:\n\t\tt = tr(newval)\n\tif t == null:\n\t\treturn\n\t# escape the text\n\tvar esc = false\n\tvar txt = \"\"\n\tvar first = 0\n\tvar i\n\tfor i in range(0, t.length()):\n\t\tvar ch = t.ord_at(i)\n\t\tif esc:\n\t\t\tesc = false\n\t\t\tif ch == CH_N:\n\t\t\t\tif i - 1 > first:\n\t\t\t\t\ttxt += t.substring(first, i - 1)\n\t\t\t\ttxt = txt.strip_edges()\n\t\t\t\tif txt.length() > 0:\n\t\t\t\t\t_trtext.append(txt)\n\t\t\t\ttxt = \"\"\n\t\t\t\tfirst = i + 1\n\t\t\telif ch == CH_T:\n\t\t\t\t# change to a space\n\t\t\t\tif i - 1 > first:\n\t\t\t\t\ttxt += t.substring(first, i - 1)\n\t\t\t\ttxt += ' '\n\t\t\t\tfirst = i + 1\n\t\t\telse:\n\t\t\t\t# Just use the un-escaped value\n\t\t\t\tfirst = i\n\t\telif ch == CH_BACKSLASH:\n\t\t\tif i > first:\n\t\t\t\ttxt += t.substr(first, i - first)\n\t\t\tesc = true\n\t\telif (ch == CH_CR || ch == CH_LF):\n\t\t\tif i > first:\n\t\t\t\ttxt += t.substr(first, i - first)\n\t\t\ttxt = txt.strip_edges()\n\t\t\tif txt.length() > 0:\n\t\t\t\t_trtext.append(txt)\n\t\t\ttxt = \"\"\n\t\t\tfirst = i + 1\n\t\telif ch == CH_TAB:\n\t\t\tif i > first:\n\t\t\t\ttxt += t.substr(first, i - first)\n\t\t\ttxt += ' '\n\t\t\tfirst = i + 1\n\t\t# else ch is a normal character; it is just added to the\n\t\t# pending substring\n\tif t.length() > first:\n\t\ttxt += t.right(first)\n\t\ttxt = txt.strip_edges()\n\t\tif txt.length() > 0:\n\t\t\t_trtext.append(txt)\n\n\nfunc recalculate():\n\t_changed = false\n\t\n\tvar widget_width = max(get_minimum_size().x, get_size().x)\n\tif get_parent() != null && get_parent() extends ScrollContainer:\n\t\tvar pw = get_parent().get_size().x\n\t\tif pw > 0:\n\t\t\tvar k = get_parent().get_node(\"_v_scroll\")\n\t\t\tif k != null:\n\t\t\t\tpw -= max(k.get_size().x, 10)\n\t\t\tif pw < widget_width:\n\t\t\t\twidget_width = pw\n\t\n\tvar start_x = 0\n\tvar fnt = font\n\tif fnt == null:\n\t\tfnt = get_font(\"font\", \"Label\")\n\tvar font_height = float(fnt.get_height())\n\tvar psep = int(paragraph_separation * font_height)\n\tvar lsep = int(line_height * font_height)\n\t_line_pos = []\n\t# We start drawing strings at the bottom of the string.\n\tvar y_pos = -psep + lsep\n\tfor txt in _trtext:\n\t\t# start of an explicit new line\n\t\ty_pos += psep\n\t\tvar tlen = txt.length() - 1\n\t\tvar tpos\n\t\t# We trim the lines, so that they start with non-whitespace\n\t\t# Therefore, the first character of a line is the start of the word.\n\t\tvar linestart_pos = 0\n\t\tvar wordstart_pos = 0\n\t\tvar word_width = 0\n\t\tvar wordend_pos = -1\n\t\tvar on_space = false\n\t\tvar x_pos = indent_pixels + start_x\n\t\tvar width = indent_pixels\n\t\tprint(\"line start: 0\")\n\t\tfor tpos in range(0, tlen + 1):\n\t\t\tvar ch = txt.ord_at(tpos)\n\t\t\tif ch == CH_SPACE:\n\t\t\t\tif not on_space:\n\t\t\t\t\tprint(\"word end: \" + str(tpos))\n\t\t\t\t\ton_space = true\n\t\t\t\t\twordend_pos = tpos\n\t\t\t\t\twordstart_pos = -1\n\t\t\t\t\tword_width = 0\n\t\t\telse:\n\t\t\t\tif linestart_pos < 0:\n\t\t\t\t\tlinestart_pos = tpos\n\t\t\t\t\tprint(\"line start: \" + str(tpos))\n\t\t\t\tif wordstart_pos < 0:\n\t\t\t\t\tprint(\"word start: \" + str(tpos))\n\t\t\t\t\twordstart_pos = tpos\n\t\t\t\t\tword_width = 0\n\t\t\t\ton_space = false\n\t\t\tvar cn = 0\n\t\t\tif tpos + 1 <= tlen:\n\t\t\t\tcn = txt.ord_at(tpos + 1)\n\t\t\tvar cw = fnt.get_char_size(ch, cn).x\n\t\t\twidth += cw\n\t\t\tword_width += cw\n\t\t\tif tpos >= tlen:\n\t\t\t\t# end of the line; stick everything into the end.\n\t\t\t\t# We trim the text, so the last character is non-whitespace.\n\t\t\t\tprint(\"--eol[\" + txt.right(linestart_pos) + \"] \" + str(width) + \"\/\" + str(widget_width))\n\t\t\t\t_line_pos.append([\n\t\t\t\t\t# text\n\t\t\t\t\ttxt.right(linestart_pos),\n\t\t\t\t\t\n\t\t\t\t\t# draw position\n\t\t\t\t\tVector2(x_pos, y_pos)\n\t\t\t\t])\n\t\t\t\t# No need to change x_pos or the other loop variables\n\t\t\t\ty_pos += lsep\n\t\t\telif width >= widget_width:\n\t\t\t\t# Soft end of line\n\t\t\t\tvar next_linestart = wordstart_pos\n\t\t\t\tvar next_wordstart = -1\n\t\t\t\tif wordend_pos < 0:\n\t\t\t\t\t# in the middle of the word.\n\t\t\t\t\tif wordstart_pos < 0:\n\t\t\t\t\t\t# No word in the line. Just skip it\n\t\t\t\t\t\twidth = 0\n\t\t\t\t\t\tx_pos = start_x\n\t\t\t\t\t\tprint(\"skipped line\")\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t# only one word; cut this one at the break.\n\t\t\t\t\t# TODO add a hyphen\n\t\t\t\t\twordend_pos = tpos\n\t\t\t\t\tnext_linestart = tpos\n\t\t\t\t\tnext_wordstart = tpos\n\t\t\t\t\tword_width = 0\n\t\t\t\t\tprint(\"word end: \" + str(tpos))\n\t\t\t\t\n\t\t\t\tprint(\"--sle[\" + txt.substr(linestart_pos, wordend_pos - linestart_pos) + \"] \" + str(width) + \"\/\" + str(widget_width))\n\t\t\t\t\n\t\t\t\t# soft end of line\n\t\t\t\t_line_pos.append([\n\t\t\t\t\t# text\n\t\t\t\t\ttxt.substr(linestart_pos, wordend_pos - linestart_pos),\n\t\t\t\t\t\n\t\t\t\t\t# draw position\n\t\t\t\t\tVector2(x_pos, y_pos)\n\t\t\t\t])\n\t\t\t\t\n\t\t\t\tx_pos = start_x\n\t\t\t\tvar next_word_width = word_width - width\n\t\t\t\twidth = word_width\n\t\t\t\tword_width = next_word_width\n\t\t\t\ty_pos += lsep\n\t\t\t\twordstart_pos = next_wordstart\n\t\t\t\twordend_pos = -1\n\t\t\t\tlinestart_pos = next_linestart\n\t\t\t\tprint(\"line start: \" + str(linestart_pos))\n\t\t\t\tprint(\"word start: \" + str(wordstart_pos))\n\t\t\t\tprint(\"word end: -1\")\n\tset_custom_minimum_size(Vector2(widget_width, y_pos))\n\t\n\n","returncode":0,"stderr":"","license":"cc0-1.0","lang":"GDScript"} {"commit":"65fcb615ecd8dab4a674c059fc4524d8f9508071","subject":"remove old puzzle creation","message":"remove old puzzle creation\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/GridMan.gd","new_file":"src\/scripts\/GridMan.gd","new_contents":"extends Spatial\n\n# Is there a better way to do this?\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\n# Block selection handling.\nvar offClick = false\nvar selectedBlocks = []\n\n# Puzzle vars.\nvar puzzle\nvar puzzleLoaded = false\nvar blockNodes = {}\n\nvar puzzleScn\n\n# Beam stuff.\nconst beamScn = preload( \"res:\/\/blocks\/block.scn\" )\nconst Beam = preload(\"res:\/\/scripts\/Blocks\/Beam.gd\")\n\n# sounds\nvar samplePlayer = SamplePlayer.new()\n\nfunc addPickledBlock(block):\n\tvar b = block.toNode()\n\n\t# TODO any special treatment for the wild blocks?\n\t# TODO keep track of puzzle.lasers ? How to?\n\tblockNodes[block.blockPos] = b\n\n\tif puzzleLoaded:\n\t\t# keep pickled block\n\t\tpuzzle.shape[block.blockPos] = block\n\n\t\t# keep track of puzzle.pairCounts\n\t\tvar layer = calcBlockLayerVec(b.blockPos)\n\t\tif b.getBlockType() == 2:\n\t\t\twhile puzzle.pairCount.size() <= layer:\n\t\t\t\tpuzzle.pairCount.append(0)\n\t\t\tpuzzle.puzzleLayers = puzzle.pairCount.size() - 1\n\t\t\tpuzzle.pairCount[layer] += 0.5\n\n\n\tadd_child(b)\n\treturn b\n\nfunc get_block(pos):\n\tif blockNodes.has(pos):\n\t\treturn blockNodes[pos]\n\telse:\n\t\treturn null\n\n# unused key argument needed for the tween_complete signal\nfunc remove_block(block, key=null):\n\tvar block_node = blockNodes[block.blockPos]\n\n\tpuzzle.shape[block_node.blockPos] = null\n\tblockNodes[block_node.blockPos] = null\n\n\tif block_node == null:\n\t\treturn\n\n\tfor child in block_node.get_children():\n\t\tblock_node.remove_and_delete_child(child)\n\tremove_and_delete_child(block_node)\n\n# Sets the puzzle for this GridMan.\nfunc set_puzzle(puzz):\n\t# verify puzzle\n\tif puzz == null:\n\t\tprint(\"INVALID PUZZLE\")\n\t\treturn\n\n\t# delete all current nodes\n\tif puzzle != null:\n\t\tfor pos in puzzle.shape:\n\t\t\tremove_block(puzzle.shape[pos])\n\tpuzzleLoaded = false\n\t#print( puzzDict.type() )\n\tprint(\"This is puzz: \", puzz )\n\t\n\tpuzzle = puzz\n\n\t# Load in the puzzle from dictionary\n\t#puzzle.fromDict(puzzDict)\n\n\t\t# # I can do my own counting!\n\t# needed for adding blocks in the editor\n\tfor k in puzzle.shape:\n\t\t# Create a block node, add it to the tree\n\t\taddPickledBlock(puzzle.shape[k])\n\tpuzzleLoaded = true\n\n# Clears any selected blocks. WE SHOULD FIX THIS, THERE CAN ONLY BE ONE BLOCK SELECTED AT ANY ONE TIME, NO NEED FOR AN ARRAY!\nfunc clearSelection():\n\tfor bl in selectedBlocks:\n\t\tvar blo = get_node( bl )\n\t\tblo.setSelected(false)\n\t\tblo.scaleTweenNode(1.0).start()\n\tselectedBlocks = []\n\n# Add the selected block to the selected list. WE SHOULD FIX THIS, IT ONLY NEEDS TO STORE IT, NOT AN ARRAY!\nfunc addSelected(bl):\n\tselectedBlocks.append(bl)\n\n# Used for the multiplayer mode to force click a block on their side.\nfunc forceClickBlock( pos ):\n\tblockNodes[pos].forceClick()\n\nfunc clickBlock( name ):\n\t#now check if that was the second block we picked. If it was, we want to\n\t#unselect the blocks again\n\tif (offClick):\n\t\toffClick = false\n\t\taddSelected(name)\n\t\tclearSelection()\n\telse:\n\t\toffClick = true;\n\t\taddSelected(name)\n\n# Calculates the layer that a block is on.\n# COPY OF FUNCTION IN PUZZLEMAN, IS THERE A BETTER WAY TO DO THIS?!\nfunc calcBlockLayer( x, y, z ):\n\treturn max( max( abs( x ), abs( y ) ), abs( z ) )\nfunc calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\nfunc beatenWithScore(othersScore):\n\tprint( \"BEATEN!\" )\n\tvar pauseMenu = get_tree().get_root().get_node( \"Spatial\" ).get_node( \"Camera\" ).pauseMenu\n\tpauseMenu.set_text(\"GAME OVER\\nYou've been beaten with time: \" + puzzleScn.formatTime(othersScore))\n\tpauseMenu.popup_centered()\n\nfunc win():\n\tprint( \"GAME OVER!\" )\n\tvar pauseMenu = get_tree().get_root().get_node( \"Spatial\" ).get_node( \"Camera\" ).pauseMenu\n\tpauseMenu.set_text(\"GAME OVER\\nYou win with time: \" + puzzleScn.formatTime(get_parent().get_parent().time.val))\n\tpauseMenu.popup_centered()\n\n\n# Handles keeping track of pairs being removed.\nfunc popPair( pos ):\n\tvar blayer = calcBlockLayerVec( pos )\n\tpuzzle.pairCount[blayer] -= 1\n\n\tif( puzzle.pairCount[blayer] == 0 ):\n\t\tprint(\"LAYER CLEARED\")\n\t\tif blayer == 1:\n\t\t\twin()\n\n\t\tfor b in puzzle.shape:\n\t\t\tif not ( puzzle.shape[b] == null ):\n\t\t\t\tif calcBlockLayerVec( b ) == blayer:\n\t\t\t\t\tif blockNodes[b].getBlockType() == BLOCK_LASER:\n\t\t\t\t\t\tblockNodes[b].forceActivate()\n\n\t\t# Fire beams.\n\t\tvar beamNum = 0\n\t\tfor l in range( puzzle.lasers.size() ):\n\t\t\tif calcBlockLayerVec( puzzle.lasers[l][0] ) == blayer:\n\t\t\t\t# Firin mah lazerz!\n\t\t\t\tvar beam = beamScn.instance()\n\n\t\t\t\tbeam.set_name( str(blayer) + \"_beam_\" + str(beamNum) )\n\t\t\t\tbeamNum += 1\n\t\t\t\tbeam.set_script( Beam )\n\n\t\t\t\tadd_child( beam )\n\t\t\t\tbeam.fire( puzzle.lasers[l][0], puzzle.lasers[l][1] )\n\n\t\t\t\tsamplePlayer.play( \"soundslikewillem_hitting_slinky\" )\n\n\nfunc _init():\n\t# Load sound\n\tsamplePlayer.set_voice_count(10)\n\tsamplePlayer.set_sample_library(ResourceLoader.load(\"new_samplelibrary.xml\"))\n\tprint(\"GridMan initialized\")\n\nfunc _ready():\n\tsetupCam()\n\t\n\tpuzzleScn = get_parent().get_parent()\n\n\nfunc setupCam():\n\tvar cam = get_tree().get_root().get_node( \"Spatial\/Camera\" )\n\tif cam == null or puzzle == null:\n\t\treturn\n\tvar totalSize = ( puzzle.puzzleLayers * 2 + 1 )\n\tcam.distance.val = 4.5 * totalSize\n\tcam.distance.min_ = 3 * totalSize\n\tcam.distance.max_ = 10 * totalSize\n\tcam.recalculate_camera()\n\n\n","old_contents":"extends Spatial\n\n# Is there a better way to do this?\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\n# Block selection handling.\nvar offClick = false\nvar selectedBlocks = []\n\n# Puzzle vars.\nvar puzzle\nvar puzzleLoaded = false\nvar blockNodes = {}\n\nvar puzzleScn\n\n# Beam stuff.\nconst beamScn = preload( \"res:\/\/blocks\/block.scn\" )\nconst Beam = preload(\"res:\/\/scripts\/Blocks\/Beam.gd\")\n\n# sounds\nvar samplePlayer = SamplePlayer.new()\n\nfunc addPickledBlock(block):\n\tvar b = block.toNode()\n\n\t# TODO any special treatment for the wild blocks?\n\t# TODO keep track of puzzle.lasers ? How to?\n\tblockNodes[block.blockPos] = b\n\n\tif puzzleLoaded:\n\t\t# keep pickled block\n\t\tpuzzle.shape[block.blockPos] = block\n\n\t\t# keep track of puzzle.pairCounts\n\t\tvar layer = calcBlockLayerVec(b.blockPos)\n\t\tif b.getBlockType() == 2:\n\t\t\twhile puzzle.pairCount.size() <= layer:\n\t\t\t\tpuzzle.pairCount.append(0)\n\t\t\tpuzzle.puzzleLayers = puzzle.pairCount.size() - 1\n\t\t\tpuzzle.pairCount[layer] += 0.5\n\n\n\tadd_child(b)\n\treturn b\n\nfunc get_block(pos):\n\tif blockNodes.has(pos):\n\t\treturn blockNodes[pos]\n\telse:\n\t\treturn null\n\n# unused key argument needed for the tween_complete signal\nfunc remove_block(block, key=null):\n\tvar block_node = blockNodes[block.blockPos]\n\n\tpuzzle.shape[block_node.blockPos] = null\n\tblockNodes[block_node.blockPos] = null\n\n\tif block_node == null:\n\t\treturn\n\n\tfor child in block_node.get_children():\n\t\tblock_node.remove_and_delete_child(child)\n\tremove_and_delete_child(block_node)\n\n# Sets the puzzle for this GridMan.\nfunc set_puzzle(puzz):\n\t# verify puzzle\n\tif puzz == null:\n\t\tprint(\"INVALID PUZZLE\")\n\t\treturn\n\n\t# delete all current nodes\n\tif puzzle != null:\n\t\tfor pos in puzzle.shape:\n\t\t\tremove_block(puzzle.shape[pos])\n\telse:\n\t\tpuzzle = get_parent().get_parent().puzzleMan.Puzzle.new()\n\tpuzzleLoaded = false\n\t#print( puzzDict.type() )\n\tprint(\"This is puzz: \", puzzDict )\n\t\n\tpuzzle = puzz\n\n\t# Load in the puzzle from dictionary\n\t#puzzle.fromDict(puzzDict)\n\n\t\t# # I can do my own counting!\n\t# needed for adding blocks in the editor\n\tfor k in puzzle.shape:\n\t\t# Create a block node, add it to the tree\n\t\taddPickledBlock(puzzle.shape[k])\n\tpuzzleLoaded = true\n\n# Clears any selected blocks. WE SHOULD FIX THIS, THERE CAN ONLY BE ONE BLOCK SELECTED AT ANY ONE TIME, NO NEED FOR AN ARRAY!\nfunc clearSelection():\n\tfor bl in selectedBlocks:\n\t\tvar blo = get_node( bl )\n\t\tblo.setSelected(false)\n\t\tblo.scaleTweenNode(1.0).start()\n\tselectedBlocks = []\n\n# Add the selected block to the selected list. WE SHOULD FIX THIS, IT ONLY NEEDS TO STORE IT, NOT AN ARRAY!\nfunc addSelected(bl):\n\tselectedBlocks.append(bl)\n\n# Used for the multiplayer mode to force click a block on their side.\nfunc forceClickBlock( pos ):\n\tblockNodes[pos].forceClick()\n\nfunc clickBlock( name ):\n\t#now check if that was the second block we picked. If it was, we want to\n\t#unselect the blocks again\n\tif (offClick):\n\t\toffClick = false\n\t\taddSelected(name)\n\t\tclearSelection()\n\telse:\n\t\toffClick = true;\n\t\taddSelected(name)\n\n# Calculates the layer that a block is on.\n# COPY OF FUNCTION IN PUZZLEMAN, IS THERE A BETTER WAY TO DO THIS?!\nfunc calcBlockLayer( x, y, z ):\n\treturn max( max( abs( x ), abs( y ) ), abs( z ) )\nfunc calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\nfunc beatenWithScore(othersScore):\n\tprint( \"BEATEN!\" )\n\tvar pauseMenu = get_tree().get_root().get_node( \"Spatial\" ).get_node( \"Camera\" ).pauseMenu\n\tpauseMenu.set_text(\"GAME OVER\\nYou've been beaten with time: \" + puzzleScn.formatTime(othersScore))\n\tpauseMenu.popup_centered()\n\nfunc win():\n\tprint( \"GAME OVER!\" )\n\tvar pauseMenu = get_tree().get_root().get_node( \"Spatial\" ).get_node( \"Camera\" ).pauseMenu\n\tpauseMenu.set_text(\"GAME OVER\\nYou win with time: \" + puzzleScn.formatTime(get_parent().get_parent().time.val))\n\tpauseMenu.popup_centered()\n\n\n# Handles keeping track of pairs being removed.\nfunc popPair( pos ):\n\tvar blayer = calcBlockLayerVec( pos )\n\tpuzzle.pairCount[blayer] -= 1\n\n\tif( puzzle.pairCount[blayer] == 0 ):\n\t\tprint(\"LAYER CLEARED\")\n\t\tif blayer == 1:\n\t\t\twin()\n\n\t\tfor b in puzzle.shape:\n\t\t\tif not ( puzzle.shape[b] == null ):\n\t\t\t\tif calcBlockLayerVec( b ) == blayer:\n\t\t\t\t\tif blockNodes[b].getBlockType() == BLOCK_LASER:\n\t\t\t\t\t\tblockNodes[b].forceActivate()\n\n\t\t# Fire beams.\n\t\tvar beamNum = 0\n\t\tfor l in range( puzzle.lasers.size() ):\n\t\t\tif calcBlockLayerVec( puzzle.lasers[l][0] ) == blayer:\n\t\t\t\t# Firin mah lazerz!\n\t\t\t\tvar beam = beamScn.instance()\n\n\t\t\t\tbeam.set_name( str(blayer) + \"_beam_\" + str(beamNum) )\n\t\t\t\tbeamNum += 1\n\t\t\t\tbeam.set_script( Beam )\n\n\t\t\t\tadd_child( beam )\n\t\t\t\tbeam.fire( puzzle.lasers[l][0], puzzle.lasers[l][1] )\n\n\t\t\t\tsamplePlayer.play( \"soundslikewillem_hitting_slinky\" )\n\n\nfunc _init():\n\t# Load sound\n\tsamplePlayer.set_voice_count(10)\n\tsamplePlayer.set_sample_library(ResourceLoader.load(\"new_samplelibrary.xml\"))\n\tprint(\"GridMan initialized\")\n\nfunc _ready():\n\tsetupCam()\n\t\n\tpuzzleScn = get_parent().get_parent()\n\n\nfunc setupCam():\n\tvar cam = get_tree().get_root().get_node( \"Spatial\/Camera\" )\n\tif cam == null or puzzle == null:\n\t\treturn\n\tvar totalSize = ( puzzle.puzzleLayers * 2 + 1 )\n\tcam.distance.val = 4.5 * totalSize\n\tcam.distance.min_ = 3 * totalSize\n\tcam.distance.max_ = 10 * totalSize\n\tcam.recalculate_camera()\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"81eb72fbad4da8b1d84a8d194827670d3d975449","subject":"static puzzle scene switcher","message":"static puzzle scene switcher\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/GUIManager.gd","new_file":"src\/scripts\/GUIManager.gd","new_contents":"# This script manages all of the GUI elements.\n# It switches between the states of the GUI allowing\n# the user to start games, edit the options or connect\n# to a multiplayer game.\n\nextends Node\n\n# network variables\nvar network\n\n# State variables.\nvar menuOn\nvar splashTween\n\n# Timers.\nvar timer\nvar initialWait = 0.5\nvar splashTimer = 2.0\nvar warningTimer = 5.0\n\n# GUI pieces.\nvar Splash_Team5\nvar Splash_Warning\nvar Menu_Main\nvar Menu_Chooser\nvar Menu_MP\nvar Menu_HostGame\nvar Menu_JoinGame\nvar Menu_Options\n\n# Menu state values. Used to switch between them.\nvar MENU_INIT\t\t\t= 0\nvar MENU_SPLASHTEAM5\t= 1\nvar MENU_SPLASHWARNING\t= 2\nvar MENU_MAIN\t\t\t= 3\nvar MENU_CHOOSER\t\t= 4\nvar MENU_MP\t\t\t\t= 5\nvar MENU_HOSTGAME\t\t= 6\nvar MENU_JOINGAME\t\t= 7\nvar MENU_OPTIONS\t\t= 8\n\n# Main Menu Theme\nvar samplePlayer = StreamPlayer.new()\nvar songs = [load(\"res:\/\/main_theme_antris.ogg\")]\n\n# Loader dialog\nvar saveDir\nvar fileDialog\n\nfunc skipTitle(skip):\n\tif skip:\n\t\tinitialWait = 0.01\n\t\tsplashTimer = 0.01\n\t\twarningTimer = 0.01\n\n# Function to be called once for setup.\nfunc _ready():\n\t# Initial setup.\n\tmenuOn = MENU_INIT\n\ttimer = 0.0\n\tset_process( true )\n\tset_process_input( true )\n\n\t# Setup the splash fader tween.\n\tsplashTween = Tween.new()\n\tget_node( \"SplashFader\" ).add_child( splashTween )\n\tsplashTween.interpolate_method( get_node( \"SplashFader\" ), \"set_opacity\", 1.0, 0.0, 1.0, Tween.TRANS_CUBIC, Tween.EASE_IN_OUT )\n\n\t# Gather all of the menus.\n\tSplash_Team5 = get_node( \"SplashTeam5\" )\n\tSplash_Warning = get_node( \"SplashWarning\" )\n\tMenu_Main = get_node( \"MainMenu\" )\n\tMenu_Chooser = get_node( \"ChooserMenu\" )\n\tMenu_MP = get_node( \"Multiplayer\" )\n\tMenu_HostGame = get_node( \"HostGame\" )\n\tMenu_JoinGame = get_node( \"JoinGame\" )\n\tMenu_Options = get_node( \"OptionsMenu\" )\n\n\tGlobals.set(\"Network\", load(\"res:\/\/scripts\/Network.gd\").new())\n\tnetwork = Globals.get(\"Network\")\n\n\tvar scn = load(\"res:\/\/networkProxy.scn\")\n\tadd_child(scn.instance())\n\tnetwork.root = get_tree().get_root()\n\n\t# Load the config.\n\tvar config = preload( \"res:\/\/scripts\/DataManager.gd\" ).new().loadConfig()\n\n\tget_node(\"OptionsMenu\/Panel\/OnlineName\/LineEdit\").set_text( config.name )\n\tget_node(\"OptionsMenu\/Panel\/SoundVolume\/SoundSlider\").set_value( config.soundvolume )\n\tget_node(\"OptionsMenu\/Panel\/MusicVolume\/MusicSlider\").set_value( config.musicvolume )\n\n\tnetwork.port = config.portnumber\n\n\t# Prepare puzzle loader dialog\n\tsaveDir = OS.get_data_dir() + \"\/PuzzleSaves\"\n\tfileDialog = preload(\"Editor.gd\").initLoadSaveDialog(self, get_tree(), saveDir)\n\n\t# Main Menu Theme\n\tadd_child(samplePlayer)\n\tsamplePlayer.set_stream(songs[0])\n\tsamplePlayer.play()\n\n# Function to update the GUI.\nfunc _process( delta ):\n\t# Handle the initial wait.\n\tif( menuOn == MENU_INIT ):\n\t\tif( timer > initialWait ):\n\t\t\tmenuOn = MENU_SPLASHTEAM5\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiIn()\n\n\t# Handle the Team5 splash screen.\n\tif( menuOn == MENU_SPLASHTEAM5 ):\n\t\tif( timer > splashTimer ):\n\t\t\tmenuOn = MENU_SPLASHWARNING\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiOut()\n\t\t\tSplash_Warning.guiIn()\n\n\t# Handle the warning splash screen.\n\tif( menuOn == MENU_SPLASHWARNING ):\n\t\tif( timer > warningTimer ):\n\t\t\tmenuOn = MENU_MAIN\n\t\t\ttimer = 0.0\n\t\t\tSplash_Warning.guiOut()\n\t\t\tMenu_Main.guiIn()\n\t\t\tsplashTween.start()\n\n\t# Increase the timer each frame.\n\ttimer += delta\n\n# Handle the input events.\nfunc _input( ev ):\n\t# Handle skip splash screens.\n\tif( !ev.is_pressed() and ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT ):\n\t\tif( menuOn == MENU_SPLASHTEAM5 || menuOn == MENU_SPLASHWARNING ):\n\t\t\ttimer = 999.0;\n\n\t# Handle exit.\n\tif( ev.is_action( \"ui_cancel\" ) ):\n\t\texit()\n\nfunc exit():\n\tprint( \"Exiting\" )\n\tOS.get_main_loop().quit()\n\nfunc _on_Exit_pressed():\n\texit()\n\n# TODO save to ConfigFile, load this on beginning\nfunc _on_Options_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Options.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_OPTIONS\n\tget_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\").set_text(str(network.port))\n\nfunc _on_Cancel_pressed():\n\tMenu_Options.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_SaveQuit_pressed():\n\t# Save the options.\n\n\tvar config = { name = get_node(\"OptionsMenu\/Panel\/OnlineName\/LineEdit\").get_text()\n\t\t\t\t , soundvolume = get_node(\"OptionsMenu\/Panel\/SoundVolume\/SoundSlider\").get_value()\n\t\t\t\t , musicvolume = get_node(\"OptionsMenu\/Panel\/MusicVolume\/MusicSlider\").get_value()\n\t\t\t\t , portnumber = get_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\").get_text()\n\t\t\t\t }\n\n\tpreload( \"res:\/\/scripts\/DataManager.gd\" ).new().saveConfig( config )\n\n\tvar field = get_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\")\n\tnetwork.setPort(field.get_text())\n\tnetwork.setPort(field.get_text())\n\t_on_Cancel_pressed()\n\nfunc _on_SP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Chooser.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_CHOOSER\n\nfunc _on_MainMenu_pressed():\n\tMenu_Chooser.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MainMenuMP_pressed():\n\tMenu_MP.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_MP.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MP\n\nfunc _on_MainMenuHG_pressed():\n\tMenu_HostGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\tnetwork.disconnect()\n\nfunc _on_HostGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_HostGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_HOSTGAME\n\n\tif !network.isHost and !network.isNetwork:\n\t\tprint(\"calling!\")\n\t\tnetwork.host(network.port)\n\t\tget_node(\"HostGame\/Panel\/Waiting\").set_text(\"Waiting for player to join on port \" + str(network.port) + \"...\")\n\nfunc _on_JoinGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_JoinGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_JOINGAME\n\nfunc _on_MainMenuJG_pressed():\n\tMenu_JoinGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\tif (network.isClient):\n\t\tnetwork.disconnect()\n\nfunc _on_RandomPuzzle_pressed(puzzle=null):\n\tgotoPuzzleScene(get_tree().get_root(), false, puzzle)\n\nstatic func gotoPuzzleScene(root, networked=false, puzzle=null):\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\troot.add_child( preload( \"res:\/\/puzzleView.scn\" ).instance() )\n\tvar p = preload( \"res:\/\/puzzle.scn\" ).instance()\n\tp.mainPuzzle = networked\n\n\tif puzzle != null:\n\t\tp.generateRandom = false\n\t\tp.get_node(\"GridView\/GridMan\").set_puzzle(puzzle)\n\t\tp.get_node(\"GridView\/GridMan\").setupCam()\n\n\troot.add_child( p )\n\n\nfunc _on_Join_pressed():\n\tvar IPPanel = get_node(\"JoinGame\/Panel\/IPAddress\")\n\tvar ip = IPPanel.get_text();\n\n\tif (ip.empty()):\n\t\treturn\n\n\tif !network.isClient:\n\t\tnetwork.connectTo(ip, network.port)\n\n\nfunc _on_Editor_pressed():\n\tvar root = get_tree().get_root()\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\troot.add_child( ResourceLoader.load( \"res:\/\/editor.scn\" ).instance() )\n\n\nfunc _on_LoadPuzzle_pressed():\n\tpreload(\"Editor.gd\").showLoadDialog(fileDialog, self)\n\n# called by the fileDialog\nfunc puzzleLoad():\n\tvar f = fileDialog.get_current_path()\n\tif f == null or f == \"\":\n\t\treturn\n\tprint(\"LOADING FROM \", f)\n\t_on_RandomPuzzle_pressed(preload(\"DataManager.gd\").loadPuzzle( f ))\n","old_contents":"# This script manages all of the GUI elements.\n# It switches between the states of the GUI allowing\n# the user to start games, edit the options or connect\n# to a multiplayer game.\n\nextends Node\n\n# network variables\nvar network\n\n# State variables.\nvar menuOn\nvar splashTween\n\n# Timers.\nvar timer\nvar initialWait = 0.5\nvar splashTimer = 2.0\nvar warningTimer = 5.0\n\n# GUI pieces.\nvar Splash_Team5\nvar Splash_Warning\nvar Menu_Main\nvar Menu_Chooser\nvar Menu_MP\nvar Menu_HostGame\nvar Menu_JoinGame\nvar Menu_Options\n\n# Menu state values. Used to switch between them.\nvar MENU_INIT\t\t\t= 0\nvar MENU_SPLASHTEAM5\t= 1\nvar MENU_SPLASHWARNING\t= 2\nvar MENU_MAIN\t\t\t= 3\nvar MENU_CHOOSER\t\t= 4\nvar MENU_MP\t\t\t\t= 5\nvar MENU_HOSTGAME\t\t= 6\nvar MENU_JOINGAME\t\t= 7\nvar MENU_OPTIONS\t\t= 8\n\n# Main Menu Theme\nvar samplePlayer = StreamPlayer.new()\nvar songs = [load(\"res:\/\/main_theme_antris.ogg\")]\n\n# Loader dialog\nvar saveDir\nvar fileDialog\n\nfunc skipTitle(skip):\n\tif skip:\n\t\tinitialWait = 0.01\n\t\tsplashTimer = 0.01\n\t\twarningTimer = 0.01\n\n# Function to be called once for setup.\nfunc _ready():\n\t# Initial setup.\n\tmenuOn = MENU_INIT\n\ttimer = 0.0\n\tset_process( true )\n\tset_process_input( true )\n\n\t# Setup the splash fader tween.\n\tsplashTween = Tween.new()\n\tget_node( \"SplashFader\" ).add_child( splashTween )\n\tsplashTween.interpolate_method( get_node( \"SplashFader\" ), \"set_opacity\", 1.0, 0.0, 1.0, Tween.TRANS_CUBIC, Tween.EASE_IN_OUT )\n\n\t# Gather all of the menus.\n\tSplash_Team5 = get_node( \"SplashTeam5\" )\n\tSplash_Warning = get_node( \"SplashWarning\" )\n\tMenu_Main = get_node( \"MainMenu\" )\n\tMenu_Chooser = get_node( \"ChooserMenu\" )\n\tMenu_MP = get_node( \"Multiplayer\" )\n\tMenu_HostGame = get_node( \"HostGame\" )\n\tMenu_JoinGame = get_node( \"JoinGame\" )\n\tMenu_Options = get_node( \"OptionsMenu\" )\n\n\tGlobals.set(\"Network\", load(\"res:\/\/scripts\/Network.gd\").new())\n\tnetwork = Globals.get(\"Network\")\n\n\tvar scn = load(\"res:\/\/networkProxy.scn\")\n\tadd_child(scn.instance())\n\tnetwork.root = get_tree().get_root()\n\n\t# Load the config.\n\tvar config = preload( \"res:\/\/scripts\/DataManager.gd\" ).new().loadConfig()\n\n\tget_node(\"OptionsMenu\/Panel\/OnlineName\/LineEdit\").set_text( config.name )\n\tget_node(\"OptionsMenu\/Panel\/SoundVolume\/SoundSlider\").set_value( config.soundvolume )\n\tget_node(\"OptionsMenu\/Panel\/MusicVolume\/MusicSlider\").set_value( config.musicvolume )\n\n\tnetwork.port = config.portnumber\n\n\t# Prepare puzzle loader dialog\n\tsaveDir = OS.get_data_dir() + \"\/PuzzleSaves\"\n\tfileDialog = preload(\"Editor.gd\").initLoadSaveDialog(self, get_tree(), saveDir)\n\n\t# Main Menu Theme\n\tadd_child(samplePlayer)\n\tsamplePlayer.set_stream(songs[0])\n\tsamplePlayer.play()\n\n# Function to update the GUI.\nfunc _process( delta ):\n\t# Handle the initial wait.\n\tif( menuOn == MENU_INIT ):\n\t\tif( timer > initialWait ):\n\t\t\tmenuOn = MENU_SPLASHTEAM5\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiIn()\n\n\t# Handle the Team5 splash screen.\n\tif( menuOn == MENU_SPLASHTEAM5 ):\n\t\tif( timer > splashTimer ):\n\t\t\tmenuOn = MENU_SPLASHWARNING\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiOut()\n\t\t\tSplash_Warning.guiIn()\n\n\t# Handle the warning splash screen.\n\tif( menuOn == MENU_SPLASHWARNING ):\n\t\tif( timer > warningTimer ):\n\t\t\tmenuOn = MENU_MAIN\n\t\t\ttimer = 0.0\n\t\t\tSplash_Warning.guiOut()\n\t\t\tMenu_Main.guiIn()\n\t\t\tsplashTween.start()\n\n\t# Increase the timer each frame.\n\ttimer += delta\n\n# Handle the input events.\nfunc _input( ev ):\n\t# Handle skip splash screens.\n\tif( !ev.is_pressed() and ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT ):\n\t\tif( menuOn == MENU_SPLASHTEAM5 || menuOn == MENU_SPLASHWARNING ):\n\t\t\ttimer = 999.0;\n\n\t# Handle exit.\n\tif( ev.is_action( \"ui_cancel\" ) ):\n\t\texit()\n\nfunc exit():\n\tprint( \"Exiting\" )\n\tOS.get_main_loop().quit()\n\nfunc _on_Exit_pressed():\n\texit()\n\n# TODO save to ConfigFile, load this on beginning\nfunc _on_Options_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Options.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_OPTIONS\n\tget_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\").set_text(str(network.port))\n\nfunc _on_Cancel_pressed():\n\tMenu_Options.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_SaveQuit_pressed():\n\t# Save the options.\n\n\tvar config = { name = get_node(\"OptionsMenu\/Panel\/OnlineName\/LineEdit\").get_text()\n\t\t\t\t , soundvolume = get_node(\"OptionsMenu\/Panel\/SoundVolume\/SoundSlider\").get_value()\n\t\t\t\t , musicvolume = get_node(\"OptionsMenu\/Panel\/MusicVolume\/MusicSlider\").get_value()\n\t\t\t\t , portnumber = get_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\").get_text()\n\t\t\t\t }\n\n\tpreload( \"res:\/\/scripts\/DataManager.gd\" ).new().saveConfig( config )\n\n\tvar field = get_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\")\n\tnetwork.setPort(field.get_text())\n\tnetwork.setPort(field.get_text())\n\t_on_Cancel_pressed()\n\nfunc _on_SP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Chooser.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_CHOOSER\n\nfunc _on_MainMenu_pressed():\n\tMenu_Chooser.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MainMenuMP_pressed():\n\tMenu_MP.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_MP.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MP\n\nfunc _on_MainMenuHG_pressed():\n\tMenu_HostGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\tnetwork.disconnect()\n\nfunc _on_HostGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_HostGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_HOSTGAME\n\n\tif !network.isHost and !network.isNetwork:\n\t\tprint(\"calling!\")\n\t\tnetwork.host(network.port)\n\t\tget_node(\"HostGame\/Panel\/Waiting\").set_text(\"Waiting for player to join on port \" + str(network.port) + \"...\")\n\nfunc _on_JoinGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_JoinGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_JOINGAME\n\nfunc _on_MainMenuJG_pressed():\n\tMenu_JoinGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\tif (network.isClient):\n\t\tnetwork.disconnect()\n\nfunc _on_RandomPuzzle_pressed(puzzle=null):\n\tvar root = get_tree().get_root()\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\troot.add_child( ResourceLoader.load( \"res:\/\/puzzleView.scn\" ).instance() )\n\tvar p = ResourceLoader.load( \"res:\/\/puzzle.scn\" ).instance()\n\n\tif puzzle != null:\n\t\tp.generateRandom = false\n\t\tp.get_node(\"GridView\/GridMan\").set_puzzle(puzzle)\n\t\tp.get_node(\"GridView\/GridMan\").setupCam()\n\n\troot.add_child( p )\n\n\nfunc _on_Join_pressed():\n\tvar IPPanel = get_node(\"JoinGame\/Panel\/IPAddress\")\n\tvar ip = IPPanel.get_text();\n\n\tif (ip.empty()):\n\t\treturn\n\n\tif !network.isClient:\n\t\tnetwork.connectTo(ip, network.port)\n\n\nfunc _on_Editor_pressed():\n\tvar root = get_tree().get_root()\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\troot.add_child( ResourceLoader.load( \"res:\/\/editor.scn\" ).instance() )\n\n\nfunc _on_LoadPuzzle_pressed():\n\tpreload(\"Editor.gd\").showLoadDialog(fileDialog, self)\n\n# called by the fileDialog\nfunc puzzleLoad():\n\tvar f = fileDialog.get_current_path()\n\tif f == null or f == \"\":\n\t\treturn\n\tprint(\"LOADING FROM \", f)\n\t_on_RandomPuzzle_pressed(preload(\"DataManager.gd\").loadPuzzle( f ))\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"e21c0c39cfc4ecfa6c3fe951c6d3e4318e47bb68","subject":"close the program once tests are done","message":"close the program once tests are done\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/TestDriver.gd","new_file":"src\/scripts\/TestDriver.gd","new_contents":"extends Node\n\nfunc _ready():\n\t#get an instance of gut\n\tvar tester = load('res:\/\/scripts\/gut.gd').new()\n\tadd_child(tester)\n\ttester.set_should_print_to_console(true)\n\ttester.add_script('res:\/\/scripts\/sean_tests.gd')\n\ttester.test_scripts()\n\n\t# close on test end\n\tprint(\"\\n\\tResources in use:\")\n\tOS.print_resources_in_use(true)\n\tOS.get_main_loop().quit()\n","old_contents":"extends Node\n\nfunc _ready():\n\t#get an instance of gut\n\tvar tester = load('res:\/\/scripts\/gut.gd').new()\n\tadd_child(tester)\n\ttester.set_should_print_to_console(true)\n\ttester.add_script('res:\/\/scripts\/sean_tests.gd')\n\ttester.test_scripts()\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"05b22b934cecf4f5c7ba5fa02d9c51740755acd1","subject":"Change Godot's default background clear colour","message":"Change Godot's default background clear colour\n","repos":"mvr\/abyme","old_file":"Director.gd","new_file":"Director.gd","new_contents":"extends Node2D\n\nvar player_block = null\n\n# As a world position\nvar distant_home = Vector2(-1000000, -1000000)\nvar camera_target = Vector2(0, 0)\nvar camera_pos = Vector2(0, 0)\nvar camera_zoom = 1\nvar camera_zoom_target = 1\n\nfunc _ready():\n\tVisualServer.set_default_clear_color(Constants.background_fade)\n\tself.set_pos(self.distant_home)\n\tself.set_fixed_process(true)\n\nfunc setup():\n\tself.find_target()\n\tself.camera_pos = self.camera_target\n\nfunc int_exp(i,e):\n\tif e < 0:\n\t\treturn 1.0 \/ int_exp(i,-e)\n\tif e == 0:\n\t\treturn 1\n\telse:\n\t\treturn i * int_exp(i, e-1)\n\nfunc log_base(x, b):\n\treturn log(x) \/ log(b)\n\n################################################################################\n## Drawing\n\nfunc draw_rect(rect, colour, width):\n\tvar corner1 = rect.pos\n\tvar corner2 = rect.pos + Vector2(0, rect.size.y)\n\tvar corner3 = rect.end\n\tvar corner4 = rect.pos + Vector2(rect.size.x, 0)\n\n\tself.draw_line(corner1, corner2, colour, width)\n\tself.draw_line(corner2, corner3, colour, width)\n\tself.draw_line(corner3, corner4, colour, width)\n\tself.draw_line(corner4, corner1, colour, width)\n\nfunc draw_tilemap_manually(block, pos, scale, depth, start_depth):\n\tvar tileset = block.tilemap.get_tileset()\n\tvar block_screen_size = block.tilemap.get_cell_size() * int_exp(Constants.block_size, scale)\n\tvar cell_screen_size = block.tilemap.get_cell_size() * int_exp(Constants.block_size, scale - 1)\n\n\tvar fade_colour = null\n\tif depth == start_depth :\n\t\tvar fade_amount = log_base(self.camera_zoom, Constants.block_size)\n\t\tfade_colour = Color(1,1,1).linear_interpolate(Constants.background_fade, fade_amount)\n\telif depth < start_depth:\n\t\tfade_colour = Constants.background_fade\n\telse:\n\t\tfade_colour = Color(1,1,1)\n\n\tfor i in range(Constants.block_size):\n\t\tfor j in range(Constants.block_size):\n\t\t\tvar tile = block.tilemap.get_cell(i, j)\n\t\t\tvar texture = tileset.tile_get_texture(tile)\n\t\t\tvar corner = pos + cell_screen_size * Vector2(i, j)\n\t\t\tvar drawrect = Rect2(corner, cell_screen_size)\n\t\t\tself.draw_texture_rect(texture, drawrect, false, fade_colour)\n\nfunc draw_block_manually(block, pos, scale, depth, start_depth, max_depth):\n\tif depth > max_depth:\n\t\t# Just use existing texture\n\t\tvar block_screen_size = block.tilemap.get_cell_size() * int_exp(Constants.block_size, scale)\n\t\tvar drawrect = Rect2(pos, block_screen_size)\n\t\tvar texture = block.viewport.get_render_target_texture()\n\t\tself.draw_texture_rect(texture, drawrect, false)\n\t\treturn\n\n\tvar block_screen_size = block.tilemap.get_cell_size() * int_exp(Constants.block_size, scale)\n\tvar cell_screen_size = block.tilemap.get_cell_size() * int_exp(Constants.block_size, scale - 1)\n\n\tif depth == 0:\n\t\tself.draw_tilemap_manually(block, pos, scale, depth, start_depth)\n\n\t# This ordering is required to stop things drawing over each other\n\tfor b in block.child_blocks:\n\t\tvar child_pos = pos + (b.visual_position_on_parent() * cell_screen_size)\n\t\tself.draw_tilemap_manually(b, child_pos, scale - 1, depth + 1, start_depth)\n\n\tfor b in block.child_blocks:\n\t\tvar child_pos = pos + (b.visual_position_on_parent() * cell_screen_size)\n\t\tself.draw_block_manually(b, child_pos, scale - 1, depth + 1, start_depth, max_depth)\n\n\t# for b in block.child_blocks:\n\t# \tvar child_pos = pos + (b.visual_position_on_parent() * cell_screen_size)\n\n\t# \tvar corner1 = child_pos\n\t# \tvar corner2 = child_pos + Vector2(0, cell_screen_size.y)\n\t# \tvar corner3 = child_pos + Vector2(cell_screen_size.x, cell_screen_size.y)\n\t# \tvar corner4 = child_pos + Vector2(cell_screen_size.x, 0)\n\n\t# \tvar grey = Color(0.5, 0.5, 0.5)\n\t# \tself.draw_line(corner1, corner2, grey, 1)\n\t# \tself.draw_line(corner2, corner3, grey, 1)\n\t# \tself.draw_line(corner3, corner4, grey, 1)\n\t# \tself.draw_line(corner4, corner1, grey, 1)\n\nfunc draw_with_parents(block, pos, depth, up_depth, down_depth):\n\tif depth == up_depth:\n\t\tself.draw_block_manually(block, pos, depth+1, 0, up_depth, up_depth + down_depth)\n\t\treturn\n\n\tvar background_offset = -block.visual_position_on_parent() * block.tilemap.get_cell_size() * int_exp(Constants.block_size, depth + 1)\n\n\tself.draw_with_parents(block.parent_block, pos + background_offset, depth + 1, up_depth, down_depth)\n\nfunc _draw():\n\tself.draw_with_parents(self.player_block.parent_block, Vector2(0, 0), 0, 4, 0)\n\n\tvar parent_rect = Rect2(Vector2(0,0), self.player_block.tilemap.get_cell_size() * Constants.block_size)\n\t# self.draw_rect(parent_rect, Constants.player_highlight, 1)\n\n\tvar self_rect = Rect2(self.player_block.visual_position_on_parent() * self.player_block.tilemap.get_cell_size(), self.player_block.tilemap.get_cell_size())\n\tself.draw_rect(self_rect, Constants.player_highlight, 1)\n\nfunc _fixed_process(delta):\n\tfind_target()\n\tadjust_camera(delta)\n\tset_camera()\n\tself.update()\n\n################################################################################\n## Camera\n\nfunc move_camera(move_vect):\n\tvar block_size = Constants.block_size * self.player_block.tilemap.get_cell_size()\n\tself.camera_pos -= move_vect * block_size\n\nfunc zoom_camera():\n\tvar previous_block_size = self.player_block.tilemap.get_cell_size()\n\tvar block_size = Constants.block_size * self.player_block.tilemap.get_cell_size()\n\tvar block_center = Vector2(0.5, 0.5) * block_size\n\n\t# Currently this works by assuming self.player_block has already been replaced\n\tvar shift_pos = (self.player_block.visual_position_on_parent() + Vector2(0.5, 0.5)) * previous_block_size\n\n\t# TODO: The camera_pos should be adjusted somehow relative to camera_zoom\n\tself.camera_pos += - block_center + shift_pos\n\tself.camera_zoom *= Constants.block_size\n\nfunc find_target():\n\tvar block_size = Constants.block_size * self.player_block.tilemap.get_cell_size()\n\tvar block_grid_position = Vector2(0, 0)\n\tvar block_center = (block_grid_position + Vector2(0.5, 0.5)) * block_size\n\n\tself.camera_target = self.distant_home + block_center\n\nfunc adjust_camera(delta):\n\tvar diff = self.camera_target - self.camera_pos\n\tself.camera_pos += diff * Constants.camera_lerp * delta\n\n\tvar zoom_diff = self.camera_zoom_target - self.camera_zoom\n\tself.camera_zoom += zoom_diff * Constants.camera_zoom_lerp * delta\n\nfunc set_camera():\n\tvar screen_center = self.get_viewport().get_rect().size \/ 2\n\tvar screen_transform = Matrix32(0, screen_center)\n\n\tvar camera_transform = Matrix32(0, -self.camera_pos).scaled(Vector2(camera_zoom, camera_zoom))\n\tself.get_viewport().set_canvas_transform(screen_transform*camera_transform)\n","old_contents":"extends Node2D\n\nvar player_block = null\n\n# As a world position\nvar distant_home = Vector2(-1000000, -1000000)\nvar camera_target = Vector2(0, 0)\nvar camera_pos = Vector2(0, 0)\nvar camera_zoom = 1\nvar camera_zoom_target = 1\n\nfunc _ready():\n\tself.set_pos(self.distant_home)\n\tself.set_fixed_process(true)\n\nfunc setup():\n\tself.find_target()\n\tself.camera_pos = self.camera_target\n\nfunc int_exp(i,e):\n\tif e < 0:\n\t\treturn 1.0 \/ int_exp(i,-e)\n\tif e == 0:\n\t\treturn 1\n\telse:\n\t\treturn i * int_exp(i, e-1)\n\nfunc log_base(x, b):\n\treturn log(x) \/ log(b)\n\n################################################################################\n## Drawing\n\nfunc draw_rect(rect, colour, width):\n\tvar corner1 = rect.pos\n\tvar corner2 = rect.pos + Vector2(0, rect.size.y)\n\tvar corner3 = rect.end\n\tvar corner4 = rect.pos + Vector2(rect.size.x, 0)\n\n\tself.draw_line(corner1, corner2, colour, width)\n\tself.draw_line(corner2, corner3, colour, width)\n\tself.draw_line(corner3, corner4, colour, width)\n\tself.draw_line(corner4, corner1, colour, width)\n\nfunc draw_tilemap_manually(block, pos, scale, depth, start_depth):\n\tvar tileset = block.tilemap.get_tileset()\n\tvar block_screen_size = block.tilemap.get_cell_size() * int_exp(Constants.block_size, scale)\n\tvar cell_screen_size = block.tilemap.get_cell_size() * int_exp(Constants.block_size, scale - 1)\n\n\tvar fade_colour = null\n\tif depth == start_depth :\n\t\tvar fade_amount = log_base(self.camera_zoom, Constants.block_size)\n\t\tfade_colour = Color(1,1,1).linear_interpolate(Constants.background_fade, fade_amount)\n\telif depth < start_depth:\n\t\tfade_colour = Constants.background_fade\n\telse:\n\t\tfade_colour = Color(1,1,1)\n\n\tfor i in range(Constants.block_size):\n\t\tfor j in range(Constants.block_size):\n\t\t\tvar tile = block.tilemap.get_cell(i, j)\n\t\t\tvar texture = tileset.tile_get_texture(tile)\n\t\t\tvar corner = pos + cell_screen_size * Vector2(i, j)\n\t\t\tvar drawrect = Rect2(corner, cell_screen_size)\n\t\t\tself.draw_texture_rect(texture, drawrect, false, fade_colour)\n\nfunc draw_block_manually(block, pos, scale, depth, start_depth, max_depth):\n\tif depth > max_depth:\n\t\t# Just use existing texture\n\t\tvar block_screen_size = block.tilemap.get_cell_size() * int_exp(Constants.block_size, scale)\n\t\tvar drawrect = Rect2(pos, block_screen_size)\n\t\tvar texture = block.viewport.get_render_target_texture()\n\t\tself.draw_texture_rect(texture, drawrect, false)\n\t\treturn\n\n\tvar block_screen_size = block.tilemap.get_cell_size() * int_exp(Constants.block_size, scale)\n\tvar cell_screen_size = block.tilemap.get_cell_size() * int_exp(Constants.block_size, scale - 1)\n\n\tif depth == 0:\n\t\tself.draw_tilemap_manually(block, pos, scale, depth, start_depth)\n\n\t# This ordering is required to stop things drawing over each other\n\tfor b in block.child_blocks:\n\t\tvar child_pos = pos + (b.visual_position_on_parent() * cell_screen_size)\n\t\tself.draw_tilemap_manually(b, child_pos, scale - 1, depth + 1, start_depth)\n\n\tfor b in block.child_blocks:\n\t\tvar child_pos = pos + (b.visual_position_on_parent() * cell_screen_size)\n\t\tself.draw_block_manually(b, child_pos, scale - 1, depth + 1, start_depth, max_depth)\n\n\t# for b in block.child_blocks:\n\t# \tvar child_pos = pos + (b.visual_position_on_parent() * cell_screen_size)\n\n\t# \tvar corner1 = child_pos\n\t# \tvar corner2 = child_pos + Vector2(0, cell_screen_size.y)\n\t# \tvar corner3 = child_pos + Vector2(cell_screen_size.x, cell_screen_size.y)\n\t# \tvar corner4 = child_pos + Vector2(cell_screen_size.x, 0)\n\n\t# \tvar grey = Color(0.5, 0.5, 0.5)\n\t# \tself.draw_line(corner1, corner2, grey, 1)\n\t# \tself.draw_line(corner2, corner3, grey, 1)\n\t# \tself.draw_line(corner3, corner4, grey, 1)\n\t# \tself.draw_line(corner4, corner1, grey, 1)\n\nfunc draw_with_parents(block, pos, depth, up_depth, down_depth):\n\tif depth == up_depth:\n\t\tself.draw_block_manually(block, pos, depth+1, 0, up_depth, up_depth + down_depth)\n\t\treturn\n\n\tvar background_offset = -block.visual_position_on_parent() * block.tilemap.get_cell_size() * int_exp(Constants.block_size, depth + 1)\n\n\tself.draw_with_parents(block.parent_block, pos + background_offset, depth + 1, up_depth, down_depth)\n\nfunc _draw():\n\tself.draw_with_parents(self.player_block.parent_block, Vector2(0, 0), 0, 4, 0)\n\n\tvar parent_rect = Rect2(Vector2(0,0), self.player_block.tilemap.get_cell_size() * Constants.block_size)\n\t# self.draw_rect(parent_rect, Constants.player_highlight, 1)\n\n\tvar self_rect = Rect2(self.player_block.visual_position_on_parent() * self.player_block.tilemap.get_cell_size(), self.player_block.tilemap.get_cell_size())\n\tself.draw_rect(self_rect, Constants.player_highlight, 1)\n\nfunc _fixed_process(delta):\n\tfind_target()\n\tadjust_camera(delta)\n\tset_camera()\n\tself.update()\n\n################################################################################\n## Camera\n\nfunc move_camera(move_vect):\n\tvar block_size = Constants.block_size * self.player_block.tilemap.get_cell_size()\n\tself.camera_pos -= move_vect * block_size\n\nfunc zoom_camera():\n\tvar previous_block_size = self.player_block.tilemap.get_cell_size()\n\tvar block_size = Constants.block_size * self.player_block.tilemap.get_cell_size()\n\tvar block_center = Vector2(0.5, 0.5) * block_size\n\n\t# Currently this works by assuming self.player_block has already been replaced\n\tvar shift_pos = (self.player_block.visual_position_on_parent() + Vector2(0.5, 0.5)) * previous_block_size\n\n\t# TODO: The camera_pos should be adjusted somehow relative to camera_zoom\n\tself.camera_pos += - block_center + shift_pos\n\tself.camera_zoom *= Constants.block_size\n\nfunc find_target():\n\tvar block_size = Constants.block_size * self.player_block.tilemap.get_cell_size()\n\tvar block_grid_position = Vector2(0, 0)\n\tvar block_center = (block_grid_position + Vector2(0.5, 0.5)) * block_size\n\n\tself.camera_target = self.distant_home + block_center\n\nfunc adjust_camera(delta):\n\tvar diff = self.camera_target - self.camera_pos\n\tself.camera_pos += diff * Constants.camera_lerp * delta\n\n\tvar zoom_diff = self.camera_zoom_target - self.camera_zoom\n\tself.camera_zoom += zoom_diff * Constants.camera_zoom_lerp * delta\n\nfunc set_camera():\n\tvar screen_center = self.get_viewport().get_rect().size \/ 2\n\tvar screen_transform = Matrix32(0, screen_center)\n\n\tvar camera_transform = Matrix32(0, -self.camera_pos).scaled(Vector2(camera_zoom, camera_zoom))\n\tself.get_viewport().set_canvas_transform(screen_transform*camera_transform)\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"GDScript"} {"commit":"2ea6821406b296478eb3a9771ed2cd4c01224374","subject":"Delete line without functionality","message":"Delete line without functionality","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"2d\/kinematic_char\/player.gd","new_file":"2d\/kinematic_char\/player.gd","new_contents":"\nextends KinematicBody2D\n\n#This is a simple collision demo showing how\n#the kinematic cotroller works.\n#move() will allow to move the node, and will\n#always move it to a non-colliding spot, \n#as long as it starts from a non-colliding spot too.\n\n\n#pixels \/ second\nconst GRAVITY = 500.0\n\n#Angle in degrees towards either side that the player can \n#consider \"floor\".\nconst FLOOR_ANGLE_TOLERANCE = 40\nconst WALK_FORCE = 600\nconst WALK_MIN_SPEED=10\nconst WALK_MAX_SPEED = 200\nconst STOP_FORCE = 1300\nconst JUMP_SPEED = 200\nconst JUMP_MAX_AIRBORNE_TIME=0.2\n\nconst SLIDE_STOP_VELOCITY=1.0 #one pixel per second\nconst SLIDE_STOP_MIN_TRAVEL=1.0 #one pixel\n\nvar velocity = Vector2()\nvar on_air_time=100\nvar jumping=false\n\nvar prev_jump_pressed=false\n\nfunc _fixed_process(delta):\n\n\t#create forces\n\tvar force = Vector2(0,GRAVITY)\n\t\n\tvar walk_left = Input.is_action_pressed(\"move_left\")\n\tvar walk_right = Input.is_action_pressed(\"move_right\")\n\tvar jump = Input.is_action_pressed(\"jump\")\n\n\tvar stop=true\n\t\n\tif (walk_left):\n\t\tif (velocity.x<=WALK_MIN_SPEED and velocity.x > -WALK_MAX_SPEED):\n\t\t\tforce.x-=WALK_FORCE\t\t\t\n\t\t\tstop=false\n\t\t\n\telif (walk_right):\n\t\tif (velocity.x>=-WALK_MIN_SPEED and velocity.x < WALK_MAX_SPEED):\n\t\t\tforce.x+=WALK_FORCE\n\t\t\tstop=false\n\t\n\tif (stop):\n\t\tvar vsign = sign(velocity.x)\n\t\tvar vlen = abs(velocity.x)\n\t\t\n\t\tvlen -= STOP_FORCE * delta\n\t\tif (vlen<0):\n\t\t\tvlen=0\n\t\t\t\n\t\tvelocity.x=vlen*vsign\n\t\t\n\n\t\t\n\t#integrate forces to velocity\n\tvelocity += force * delta\n\t\n\t#integrate velocity into motion and move\n\tvar motion = velocity * delta\n\n\t#move and consume motion\n\tmotion = move(motion)\n\n\n\tvar floor_velocity=Vector2()\n\n\tif (is_colliding()):\n\t\t# you can check which tile was collision against with this\n\t\t# print(get_collider_metadata())\n\n\t\t#ran against something, is it the floor? get normal\n\t\tvar n = get_collision_normal()\n\n\t\tif ( rad2deg(acos(n.dot( Vector2(0,-1)))) < FLOOR_ANGLE_TOLERANCE ):\n\t\t\t#if angle to the \"up\" vectors is < angle tolerance\n\t\t\t#char is on floor\n\t\t\ton_air_time=0\n\t\t\tfloor_velocity=get_collider_velocity()\n\t\t\t\n\n\t\tif (on_air_time==0 and force.x==0 and get_travel().length() < SLIDE_STOP_MIN_TRAVEL and abs(velocity.x) < SLIDE_STOP_VELOCITY and get_collider_velocity()==Vector2()):\n\t\t\t#Since this formula will always slide the character around, \n\t\t\t#a special case must be considered to to stop it from moving \n\t\t\t#if standing on an inclined floor. Conditions are:\n\t\t\t# 1) Standing on floor (on_air_time==0)\n\t\t\t# 2) Did not move more than one pixel (get_travel().length() < SLIDE_STOP_MIN_TRAVEL)\n\t\t\t# 3) Not moving horizontally (abs(velocity.x) < SLIDE_STOP_VELOCITY)\n\t\t\t# 4) Collider is not moving\n\t\t\t\t\t\t\n\t\t\trevert_motion()\n\t\t\tvelocity.y=0.0\n\n\t\telse:\n\t\t\t#For every other case of motion,our motion was interrupted.\n\t\t\t#Try to complete the motion by \"sliding\"\n\t\t\t#by the normal\t\t\t\t\n\t\t\t\n\t\t\tmotion = n.slide(motion)\n\t\t\tvelocity = n.slide(velocity)\t\t\n\t\t\t#then move again\n\t\t\tmove(motion)\n\n\tif (floor_velocity!=Vector2()):\n\t\t#if floor moves, move with floor\n\t\tmove(floor_velocity*delta)\n\n\tif (jumping and velocity.y>0):\n\t\t#if falling, no longer jumping\n\t\tjumping=false\n\t\t\n\tif (on_air_time -WALK_MAX_SPEED):\n\t\t\tforce.x-=WALK_FORCE\t\t\t\n\t\t\tstop=false\n\t\t\n\telif (walk_right):\n\t\tif (velocity.x>=-WALK_MIN_SPEED and velocity.x < WALK_MAX_SPEED):\n\t\t\tforce.x+=WALK_FORCE\n\t\t\tstop=false\n\t\n\tif (stop):\n\t\tvar vsign = sign(velocity.x)\n\t\tvar vlen = abs(velocity.x)\n\t\t\n\t\tvlen -= STOP_FORCE * delta\n\t\tif (vlen<0):\n\t\t\tvlen=0\n\t\t\t\n\t\tvelocity.x=vlen*vsign\n\t\t\n\n\t\t\n\t#integrate forces to velocity\n\tvelocity += force * delta\n\t\n\t#integrate velocity into motion and move\n\tvar motion = velocity * delta\n\n\t#move and consume motion\n\tmotion = move(motion)\n\n\n\tvar floor_velocity=Vector2()\n\n\tif (is_colliding()):\n\t\t# you can check which tile was collision against with this\n\t\t# print(get_collider_metadata())\n\n\t\t#ran against something, is it the floor? get normal\n\t\tvar n = get_collision_normal()\n\n\t\tif ( rad2deg(acos(n.dot( Vector2(0,-1)))) < FLOOR_ANGLE_TOLERANCE ):\n\t\t\t#if angle to the \"up\" vectors is < angle tolerance\n\t\t\t#char is on floor\n\t\t\ton_air_time=0\n\t\t\tfloor_velocity=get_collider_velocity()\n\t\t\t\n\n\t\tif (on_air_time==0 and force.x==0 and get_travel().length() < SLIDE_STOP_MIN_TRAVEL and abs(velocity.x) < SLIDE_STOP_VELOCITY and get_collider_velocity()==Vector2()):\n\t\t\t#Since this formula will always slide the character around, \n\t\t\t#a special case must be considered to to stop it from moving \n\t\t\t#if standing on an inclined floor. Conditions are:\n\t\t\t# 1) Standing on floor (on_air_time==0)\n\t\t\t# 2) Did not move more than one pixel (get_travel().length() < SLIDE_STOP_MIN_TRAVEL)\n\t\t\t# 3) Not moving horizontally (abs(velocity.x) < SLIDE_STOP_VELOCITY)\n\t\t\t# 4) Collider is not moving\n\t\t\t\t\t\t\n\t\t\trevert_motion()\n\t\t\tvelocity.y=0.0\n\n\t\telse:\n\t\t\t#For every other case of motion,our motion was interrupted.\n\t\t\t#Try to complete the motion by \"sliding\"\n\t\t\t#by the normal\t\t\t\t\n\t\t\t\n\t\t\tmotion = n.slide(motion)\n\t\t\tvelocity = n.slide(velocity)\t\t\n\t\t\t#then move again\n\t\t\tmove(motion)\n\n\tif (floor_velocity!=Vector2()):\n\t\t#if floor moves, move with floor\n\t\tmove(floor_velocity*delta)\n\n\tif (jumping and velocity.y>0):\n\t\t#if falling, no longer jumping\n\t\tjumping=false\n\t\t\n\tif (on_air_time 5 && buttonCheck <= 10):\n\t\t\tnew_button = rightButton.instance()\n\t\t\tget_node(\"\/root\/global\").currentButtonPrompt = \"right\"\n\t\t\tget_node(\"promptSpawn\").add_child(new_button)\n\t\t\tnew_button.set_size(Vector2(64,64))\n\t\t\n\t\t#instance block button prompt\n\t\tif(buttonCheck > 10 && buttonCheck <= 15):\n\t\t\tnew_button = blockButton.instance()\n\t\t\tget_node(\"\/root\/global\").currentButtonPrompt = \"block\"\n\t\t\tget_node(\"promptSpawn\").add_child(new_button)\n\t\t\tnew_button.set_size(Vector2(64,64))\n\t\t\tduration *= 1.0\n\t\t\t\n\t\t\tget_node(\"\/root\/global\").playerPressedButton = true\n\t\t\n\t\tt = Tween.new()\n\t\tadd_child(t)\n\t\t\n\t\tt.interpolate_property(new_button, \"rect\/pos\", Vector2(0,0), Vector2(-distance,0), duration, Tween.TRANS_LINEAR, Tween.EASE_OUT)\n\t\tt.interpolate_callback(self, duration, \"end_label\")\n\t\tt.start()\n\t\tisTweening = true\n\t\t\nfunc end_label():\n\tnew_button.queue_free()\n\tt.queue_free()\n\tisTweening = false\n\tget_node(\"\/root\/global\").currentButtonPrompt = \"none\"\n\tduration = 1.0\n\t\n\tif(get_node(\"\/root\/global\").playerPressedButton == true):\n\t\tget_node(\"\/root\/global\").playerPressedButton = false\n\telif(get_node(\"\/root\/global\").playerPressedButton == false && get_node(\"\/root\/global\").enemyHealth > 0):\n\t\tget_node(\"\/root\/global\").playerCurrentHealth -= 10\n\t\tget_node(\"\/root\/global\").playerCurrentCombo = 0\n\nfunc _on_buttonTimer_timeout():\n\tspawnBullet = true\n\tpass # replace with function body\n\n","old_contents":"extends Control\n\nvar time\n\nvar new_button\nvar buttonCheck\nvar spawnBullet = true\nvar t \nvar isTweening = false\nvar distance = 768\nvar duration = 1.25\n\nvar leftButton = preload(\"res:\/\/Scenes\/leftButton.tscn\")\nvar rightButton = preload(\"res:\/\/Scenes\/rightButton.tscn\")\nvar blockButton = preload(\"res:\/\/Scenes\/blockButton.tscn\")\n\nfunc _ready():\n\ttime = 1\n\tset_fixed_process(true)\n\tget_node(\"\/root\/global\").stopButtonPrompts = false\n\n\tget_node(\"\/root\/global\").levelText = \"Dungeon_Fight\"\n\tpass\n\nfunc _fixed_process(delta):\n\ttime -= delta\n\t\n\t#update player score and combo\n\tget_node(\"playerScore\").set_text(str(get_node(\"\/root\/global\").playerScore))\n\tget_node(\"playerCombo\").set_text(str(get_node(\"\/root\/global\").playerCurrentCombo))\n\t\n\t#update player health\n\tget_node(\"playerHealth\").set_value(get_node(\"\/root\/global\").playerCurrentHealth)\n\t\n\t#update enemy health\n\tget_node(\"enemyHealth\").set_value(get_node(\"\/root\/global\").enemyHealth)\n\t\n\tif(spawnBullet && time <= 0 && get_node(\"\/root\/global\").stopButtonPrompts == false):\n\t\tspawnBullet = false\n\t\tget_node(\"buttonTimer\").set_wait_time(duration)\n\t\tget_node(\"buttonTimer\").start()\n\t\tbuttonCheck = rand_range(0, 15)\n\t\t\n\t\t#instance left button prompt\n\t\tif(buttonCheck <= 5):\n\t\t\tnew_button = leftButton.instance()\n\t\t\tget_node(\"\/root\/global\").currentButtonPrompt = \"left\"\n\t\t\tget_node(\"promptSpawn\").add_child(new_button)\n\t\t\tnew_button.set_size(Vector2(64,64))\n\t\t\t\n\t\t#instance right button prompt\n\t\tif(buttonCheck > 5 && buttonCheck <= 10):\n\t\t\tnew_button = rightButton.instance()\n\t\t\tget_node(\"\/root\/global\").currentButtonPrompt = \"right\"\n\t\t\tget_node(\"promptSpawn\").add_child(new_button)\n\t\t\tnew_button.set_size(Vector2(64,64))\n\t\t\n\t\t#instance block button prompt\n\t\tif(buttonCheck > 10 && buttonCheck <= 15):\n\t\t\tnew_button = blockButton.instance()\n\t\t\tget_node(\"\/root\/global\").currentButtonPrompt = \"block\"\n\t\t\tget_node(\"promptSpawn\").add_child(new_button)\n\t\t\tnew_button.set_size(Vector2(64,64))\n\t\t\tduration *= 1.0\n\t\t\t\n\t\t\tget_node(\"\/root\/global\").playerPressedButton = true\n\t\t\n\t\tt = Tween.new()\n\t\tadd_child(t)\n\t\t\n\t\tt.interpolate_property(new_button, \"rect\/pos\", Vector2(0,0), Vector2(-distance,0), duration, Tween.TRANS_LINEAR, Tween.EASE_OUT)\n\t\tt.interpolate_callback(self, duration, \"end_label\")\n\t\tt.start()\n\t\tisTweening = true\n\t\t\nfunc end_label():\n\tnew_button.queue_free()\n\tt.queue_free()\n\tisTweening = false\n\tget_node(\"\/root\/global\").currentButtonPrompt = \"none\"\n\tduration = 1.0\n\t\n\tif(get_node(\"\/root\/global\").playerPressedButton == true):\n\t\tget_node(\"\/root\/global\").playerPressedButton = false\n\telif(get_node(\"\/root\/global\").playerPressedButton == false && get_node(\"\/root\/global\").enemyHealth > 0):\n\t\tget_node(\"\/root\/global\").playerCurrentHealth -= 10\n\nfunc _on_buttonTimer_timeout():\n\tspawnBullet = true\n\tpass # replace with function body\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"4e0eda125c93a353b07f4bcfc0cfc3ffb4711930","subject":"Changed player velocity to 100, it was difficult to test stuff.","message":"Changed player velocity to 100, it was difficult to test stuff.\n","repos":"NiclasEriksen\/godot_rpg","old_file":"scripts\/player_control.gd","new_file":"scripts\/player_control.gd","new_contents":"\nextends Node2D\n\n# member variables here, example:\n# var a=2\n# var b=\"textvar\"\n\nvar jump_cd = false\nsignal moved(pos, rot)\nsignal jump\nsignal attack\nvar attacking = false\nvar sprinting = false\nvar vel = Vector2(0, 0)\nvar cur_vel = 0\nvar max_vel = 100\nvar sprint_factor = 1.5\nvar rot_spd = 3\nvar root = null\nvar anim = null\n\n# Actual game data\nvar max_hp = 10\nvar cur_hp = max_hp\nvar max_mp = 5\nvar cur_mp = max_mp\n\nfunc _ready():\n\tset(\"cur_hp\", get(\"max_hp\") \/ 5)\n\tself.set_process(true)\n\tself.set_process_input(true)\n\troot = get_tree().get_root().get_node(\"Game\")\n\tanim = get_node(\"BodyAnimation\")\n\nfunc apply_stat(effect, attr, amount):\n\tif get(\"cur_\" + attr):\n\t\tif effect == \"increase\":\n\t\t\tif get(\"max_\" + attr):\n\t\t\t\tvar m = get(\"max_\" + attr)\n\t\t\t\tif get(\"cur_\" + attr) + amount < m:\n\t\t\t\t\tset(\"cur_\" + attr, get(\"cur_\" + attr) + amount)\n\t\t\t\telse:\n\t\t\t\t\tset(\"cur_\" + attr, m)\n\t\t\telse:\n\t\t\t\tset(\"cur_\" + attr, get(\"cur_\" + attr) + amount)\n\t\tif effect == \"decrease\":\n\t\t\tset(\"cur_\" + attr, get(\"cur_\" + attr) - amount)\n\n\nfunc _input(event):\n\tif event.is_action_pressed(\"MOVE_UP\"):\n\t\tvel.y = vel.y - max_vel\n\telif event.is_action_released(\"MOVE_UP\"):\n\t\tvel.y = vel.y + max_vel\n\tif event.is_action_pressed(\"MOVE_DOWN\"):\n\t\tvel.y = vel.y + max_vel\n\telif event.is_action_released(\"MOVE_DOWN\"):\n\t\tvel.y = vel.y - max_vel\n\tif event.is_action_pressed(\"MOVE_LEFT\"):\n\t\tvel.x = vel.x - max_vel\n\t\t# set_rot(get_rot() - 0.01)\n\telif event.is_action_released(\"MOVE_LEFT\"):\n\t\tvel.x = vel.x + max_vel\n\tif event.is_action_pressed(\"MOVE_RIGHT\"):\n\t\tvel.x = vel.x + max_vel\n\t\t# set_rot(get_rot() + 0.01)\n\telif event.is_action_released(\"MOVE_RIGHT\"):\n\t\tvel.x = vel.x - max_vel\n\nfunc _process(delta):\n\t# var r = get_rot()\n\tif Input.is_action_pressed(\"ATTACK\"):\n\t\tif not attacking:\n\t\t\temit_signal(\"attack\")\n\t\t\tattacking = true\n\telse:\n\t\tattacking = false\n\n\tif Input.is_action_pressed(\"MOVE_JUMP\"):\n\t\tself.jump()\n\t\n\tvar r = 0\n\t\n\tif root:\n\t\tr = get_angle_to(root.get_global_mouse_pos()) * (rot_spd * delta)\n\t\trotate(r)\n\t\t# if Input.is_action_pressed(\"MOUSE_ROTATE\"):\n\t\t# \tr = get_angle_to(root.get_global_mouse_pos()) * (rot_spd * delta)\n\t\t#\tif Input.is_action_pressed(\"MOVE_LEFT\"):\n\t\t#\t\tvel.x = max_vel\n\t\t#\telif Input.is_action_pressed(\"MOVE_RIGHT\"):\n\t\t#\t\tvel.x = -max_vel\n\t\t#else:\n\t\t#\tif Input.is_action_pressed(\"MOVE_LEFT\"):\n\t\t#\t\trotate(rot_spd * delta)\n\t\t#\tif Input.is_action_pressed(\"MOVE_RIGHT\"):\n\t\t#\t\trotate(-(rot_spd * delta))\n\t\t# print(vel.rotated(get_rot()), vel)\n\t\t# self.move_and_slide(vel * 50 * delta)\n\t\t# self.move(vel.rotated(get_rot()) * delta)\n\t\tvar motion = vel * delta\n\t\tmotion = move(motion)\n\t\tif (is_colliding()):\n \tvar n = get_collision_normal()\n \tmotion = n.slide(motion)\n \t# vel = n.slide(vel)\n \tmove(motion)\n\n\tself.emit_signal(\"moved\", get_pos(), get_rot())\n\tif anim:\n\t\tif vel.x > 0.0 or vel.x < 0.0 or vel.y > 0.0 or vel.y < 0.0:\n\t\t\tif not anim.is_playing():\n\t\t\t\tanim.play(\"Walk\")\n\t\t\telse:\n\t\t\t\tif Input.is_action_pressed(\"SPRINT\"):\n\t\t\t\t\tanim.set_speed(sprint_factor)\n\t\t\t\telse:\n\t\t\t\t\tanim.set_speed(1)\n\t\t\t\t# print(\"Starting\")\n\t\telse:\n\t\t\tif anim.is_playing():\n\t\t\t\t# print(\"Stopping\")\n\t\t\t\tanim.stop(true)\n\t\t\n\nfunc jump():\n\tself.emit_signal(\"jump\")\n\tself.emit_signal(\"moved\", get_pos(), get_rot())\n","old_contents":"\nextends Node2D\n\n# member variables here, example:\n# var a=2\n# var b=\"textvar\"\n\nvar jump_cd = false\nsignal moved(pos, rot)\nsignal jump\nsignal attack\nvar attacking = false\nvar sprinting = false\nvar vel = Vector2(0, 0)\nvar cur_vel = 0\nvar max_vel = 150\nvar sprint_factor = 1.5\nvar rot_spd = 3\nvar root = null\nvar anim = null\n\n# Actual game data\nvar max_hp = 10\nvar cur_hp = max_hp\nvar max_mp = 5\nvar cur_mp = max_mp\n\nfunc _ready():\n\tset(\"cur_hp\", get(\"max_hp\") \/ 5)\n\tself.set_process(true)\n\tself.set_process_input(true)\n\troot = get_tree().get_root().get_node(\"Game\")\n\tanim = get_node(\"BodyAnimation\")\n\nfunc apply_stat(effect, attr, amount):\n\tif get(\"cur_\" + attr):\n\t\tif effect == \"increase\":\n\t\t\tif get(\"max_\" + attr):\n\t\t\t\tvar m = get(\"max_\" + attr)\n\t\t\t\tif get(\"cur_\" + attr) + amount < m:\n\t\t\t\t\tset(\"cur_\" + attr, get(\"cur_\" + attr) + amount)\n\t\t\t\telse:\n\t\t\t\t\tset(\"cur_\" + attr, m)\n\t\t\telse:\n\t\t\t\tset(\"cur_\" + attr, get(\"cur_\" + attr) + amount)\n\t\tif effect == \"decrease\":\n\t\t\tset(\"cur_\" + attr, get(\"cur_\" + attr) - amount)\n\n\nfunc _input(event):\n\tif event.is_action_pressed(\"MOVE_UP\"):\n\t\tvel.y = vel.y - max_vel\n\telif event.is_action_released(\"MOVE_UP\"):\n\t\tvel.y = vel.y + max_vel\n\tif event.is_action_pressed(\"MOVE_DOWN\"):\n\t\tvel.y = vel.y + max_vel\n\telif event.is_action_released(\"MOVE_DOWN\"):\n\t\tvel.y = vel.y - max_vel\n\tif event.is_action_pressed(\"MOVE_LEFT\"):\n\t\tvel.x = vel.x - max_vel\n\t\t# set_rot(get_rot() - 0.01)\n\telif event.is_action_released(\"MOVE_LEFT\"):\n\t\tvel.x = vel.x + max_vel\n\tif event.is_action_pressed(\"MOVE_RIGHT\"):\n\t\tvel.x = vel.x + max_vel\n\t\t# set_rot(get_rot() + 0.01)\n\telif event.is_action_released(\"MOVE_RIGHT\"):\n\t\tvel.x = vel.x - max_vel\n\nfunc _process(delta):\n\t# var r = get_rot()\n\tif Input.is_action_pressed(\"ATTACK\"):\n\t\tif not attacking:\n\t\t\temit_signal(\"attack\")\n\t\t\tattacking = true\n\telse:\n\t\tattacking = false\n\n\tif Input.is_action_pressed(\"MOVE_JUMP\"):\n\t\tself.jump()\n\t\n\tvar r = 0\n\t\n\tif root:\n\t\tr = get_angle_to(root.get_global_mouse_pos()) * (rot_spd * delta)\n\t\trotate(r)\n\t\t# if Input.is_action_pressed(\"MOUSE_ROTATE\"):\n\t\t# \tr = get_angle_to(root.get_global_mouse_pos()) * (rot_spd * delta)\n\t\t#\tif Input.is_action_pressed(\"MOVE_LEFT\"):\n\t\t#\t\tvel.x = max_vel\n\t\t#\telif Input.is_action_pressed(\"MOVE_RIGHT\"):\n\t\t#\t\tvel.x = -max_vel\n\t\t#else:\n\t\t#\tif Input.is_action_pressed(\"MOVE_LEFT\"):\n\t\t#\t\trotate(rot_spd * delta)\n\t\t#\tif Input.is_action_pressed(\"MOVE_RIGHT\"):\n\t\t#\t\trotate(-(rot_spd * delta))\n\t\t# print(vel.rotated(get_rot()), vel)\n\t\t# self.move_and_slide(vel * 50 * delta)\n\t\t# self.move(vel.rotated(get_rot()) * delta)\n\t\tvar motion = vel * delta\n\t\tmotion = move(motion)\n\t\tif (is_colliding()):\n \tvar n = get_collision_normal()\n \tmotion = n.slide(motion)\n \t# vel = n.slide(vel)\n \tmove(motion)\n\n\tself.emit_signal(\"moved\", get_pos(), get_rot())\n\tif anim:\n\t\tif vel.x > 0.0 or vel.x < 0.0 or vel.y > 0.0 or vel.y < 0.0:\n\t\t\tif not anim.is_playing():\n\t\t\t\tanim.play(\"Walk\")\n\t\t\telse:\n\t\t\t\tif Input.is_action_pressed(\"SPRINT\"):\n\t\t\t\t\tanim.set_speed(sprint_factor)\n\t\t\t\telse:\n\t\t\t\t\tanim.set_speed(1)\n\t\t\t\t# print(\"Starting\")\n\t\telse:\n\t\t\tif anim.is_playing():\n\t\t\t\t# print(\"Stopping\")\n\t\t\t\tanim.stop(true)\n\t\t\n\nfunc jump():\n\tself.emit_signal(\"jump\")\n\tself.emit_signal(\"moved\", get_pos(), get_rot())\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"d306efb3a248034a25617549bdd4290b3b21d500","subject":"fixed seocndblock to camera","message":"fixed seocndblock to camera\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Puzzle.gd","new_file":"src\/scripts\/Puzzle.gd","new_contents":"extends Spatial\n\n# proposed script manager:\n# var PuzzleManScript = get_node(\"Globals\").get(\"PuzzleManScript\")\n\nvar DataMan = preload( \"res:\/\/scripts\/DataManager.gd\" ).new()\nvar PuzzleManScript = preload( \"res:\/\/scripts\/PuzzleManager.gd\" )\nvar PuzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar puzzleMan\nvar otherPuzzle\nvar mainPuzzle = true\n\nvar time = {\n\t\ton = true,\n\t\tval = 0.0,\n\t\tlabel = null,\n\t\ttween = null }\n\nfunc addTimer():\n\ttime.label = Label.new()\n\ttime.tween = Tween.new()\n\tadd_child(time.label)\n\tadd_child(time.tween)\n\ttime.label.set_pos(Vector2(15,15))\n\n\ttime.label.set_theme(load(\"res:\/\/themes\/MainTheme.thm\"))\n\ttime.tween.interpolate_method(time.label, \"set_pos\", \\\n\t\t\ttime.label.get_pos(), time.label.get_pos()*2, 0.5, \\\n\t\t\tTween.TRANS_BOUNCE, Tween.EASE_OUT)\n\ttime.tween.start()\n\ttime.label.set_text(str(time.val))\n\nfunc formatTime(t):\n\tvar mins = floor(t \/ 60)\n\tvar secs = fmod(floor(t), 60)\n\tvar millis = floor((t - floor(t)) * 1000)\n\treturn str(mins) + \":\" + str(secs).pad_zeros(2) + \":\" + str(millis).pad_zeros(3)\n\nfunc _process(dTime):\n\t# start label tween on\n\ttime.val += dTime\n\ttime.label.set_text(formatTime(time.val))\n\tif fmod(time.val, 10) < 0.1:\n\t\ttime.tween.seek(0.0)\n\n# Called for initialization\nfunc _ready():\n\tif time.on:\n\t\tset_process(true) # needed for time keeping\n\tpuzzleMan = PuzzleManScript.new()\n\tvar puzzle = puzzleMan.generatePuzzle( 2, puzzleMan.DIFF_EASY )\n\tpuzzle.puzzleMan = puzzleMan\n\n\tprint(\"Generated \", puzzle.blocks.size(), \" blocks.\" )\n\t\n\tprint( \"Saving...\" )\n\tDataMan.savePuzzle( \"TestPuzzle.pzl\", puzzle )\n\t\n\tpuzzle = 0\n\t\n\tpuzzle = DataMan.loadPuzzle( \"TestPuzzle.pzl\" )\n\t\n\tprint( puzzle.puzzleName )\n\tprint( puzzle.blocks.size() )\n\n\taddTimer()\n\n\t# Place the blocks in the puzzle.\n\tvar gridMan = get_node( \"GridView\/GridMan\" )\n\tgridMan.shape = puzzleMan.shape\n\tgridMan.set_puzzle(puzzle)\n\tfor block in puzzle.blocks:\n\t\t# Create a block node, add it to the tree\n\t\tvar b = block.toNode()\n\t\tgridMan.add_block(b)\n\t\tgridMan.get_child(block.name) \\\n\t\t\t.set_translation(block.blockPos * 2 )\n\n\t# make a new puzzle, embed using Viewport\n\tif mainPuzzle:\n\t\tvar p = PuzzleScn.instance()\n\t\tp.get_node(\"GridView\").active = false\n\t\tp.mainPuzzle = false\n\t\tp.set_scale(Vector3(0.5, 0.5, 0.5))\n\t\tp.set_translation(Vector3(10, 5, -20))\n\n\t\tvar v = Viewport.new()\n\t\tvar c = Control.new()\n\n\t\tv.set_world(p.get_world())\n\t\tv.set_rect(Rect2(0, 0, 100, 100))\n\t\tv.set_physics_object_picking(false)\n\t\tget_node(\"Camera\").add_child(p)\n\t\tv.add_child(p)\n\t\tadd_child(c)\n\t\tc.add_child(v)\n\t\totherPuzzle = p #for use with network\n# child of control? easier input\n\n\n","old_contents":"extends Spatial\n\n# proposed script manager:\n# var PuzzleManScript = get_node(\"Globals\").get(\"PuzzleManScript\")\n\nvar DataMan = preload( \"res:\/\/scripts\/DataManager.gd\" ).new()\nvar PuzzleManScript = preload( \"res:\/\/scripts\/PuzzleManager.gd\" )\nvar PuzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar puzzleMan\nvar otherPuzzle\nvar mainPuzzle = true\n\nvar time = {\n\t\ton = true,\n\t\tval = 0.0,\n\t\tlabel = null,\n\t\ttween = null }\n\nfunc addTimer():\n\ttime.label = Label.new()\n\ttime.tween = Tween.new()\n\tadd_child(time.label)\n\tadd_child(time.tween)\n\ttime.label.set_pos(Vector2(15,15))\n\n\ttime.label.set_theme(load(\"res:\/\/themes\/MainTheme.thm\"))\n\ttime.tween.interpolate_method(time.label, \"set_pos\", \\\n\t\t\ttime.label.get_pos(), time.label.get_pos()*2, 0.5, \\\n\t\t\tTween.TRANS_BOUNCE, Tween.EASE_OUT)\n\ttime.tween.start()\n\ttime.label.set_text(str(time.val))\n\nfunc formatTime(t):\n\tvar mins = floor(t \/ 60)\n\tvar secs = fmod(floor(t), 60)\n\tvar millis = floor((t - floor(t)) * 1000)\n\treturn str(mins) + \":\" + str(secs).pad_zeros(2) + \":\" + str(millis).pad_zeros(3)\n\nfunc _process(dTime):\n\t# start label tween on\n\ttime.val += dTime\n\ttime.label.set_text(formatTime(time.val))\n\tif fmod(time.val, 10) < 0.1:\n\t\ttime.tween.seek(0.0)\n\n# Called for initialization\nfunc _ready():\n\tif time.on:\n\t\tset_process(true) # needed for time keeping\n\tpuzzleMan = PuzzleManScript.new()\n\tvar puzzle = puzzleMan.generatePuzzle( 2, puzzleMan.DIFF_EASY )\n\tpuzzle.puzzleMan = puzzleMan\n\n\tprint(\"Generated \", puzzle.blocks.size(), \" blocks.\" )\n\t\n\tprint( \"Saving...\" )\n\tDataMan.savePuzzle( \"TestPuzzle.pzl\", puzzle )\n\t\n\tpuzzle = 0\n\t\n\tpuzzle = DataMan.loadPuzzle( \"TestPuzzle.pzl\" )\n\t\n\tprint( puzzle.puzzleName )\n\tprint( puzzle.blocks.size() )\n\n\taddTimer()\n\n\t# Place the blocks in the puzzle.\n\tvar gridMan = get_node( \"GridView\/GridMan\" )\n\tgridMan.shape = puzzleMan.shape\n\tgridMan.set_puzzle(puzzle)\n\tfor block in puzzle.blocks:\n\t\t# Create a block node, add it to the tree\n\t\tvar b = block.toNode()\n\t\tgridMan.add_block(b)\n\t\tgridMan.get_child(block.name) \\\n\t\t\t.set_translation(block.blockPos * 2 )\n\n\t# make a new puzzle, embed using Viewport\n\tif mainPuzzle:\n\t\tvar p = PuzzleScn.instance()\n\t\tp.get_node(\"GridView\").active = false\n\t\tp.mainPuzzle = false\n\t\tp.set_scale(Vector3(0.5, 0.5, 0.5))\n\t\tp.set_translation(Vector3(20, 0, 0))\n\n\t\tvar v = Viewport.new()\n\t\tvar c = Control.new()\n\n\t\tv.set_world(p.get_world())\n\t\tv.set_rect(Rect2(0, 0, 100, 100))\n\t\tv.set_physics_object_picking(false)\n\t\tv.add_child(p)\n\t\tadd_child(c)\n\t\tc.add_child(v)\n\t\totherPuzzle = p #for use with network\n# child of control? easier input\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"7d8f38d3a3fec9a5365f567f45316bc4e1b3ad78","subject":"Fixes expected animation names.","message":"Fixes expected animation names.\n","repos":"godotengine\/godot-tests,godotengine\/godot-tests","old_file":"tests\/blend_export\/test_45545.gd","new_file":"tests\/blend_export\/test_45545.gd","new_contents":"extends ColorRect\n\nconst GOLDEN_GLTF_SCENE: PackedScene = preload(\"res:\/\/gltf\/45545-relax-name-sanitization.gltf\")\n\n## These constants are the prefix part of the node names used in the golden glTF file.\n# Prefix for \"basic\" nodes, no import hints, no animation, etc...\nconst GLTF_PREFIX_BASIC: String = \"Basic_\"\n\n# Prefix for nodes that have an import hint.\nconst GLTF_PREFIX_HINTED: String = \"Hinted_\"\n\n# Prefix for nodes that have an associated animation.\nconst GLTF_PREFIX_ANIMATED: String = \"Animated_\"\n\n# The suffix for animations (all animations in the golden glTF file use the Blender default suffix\n# \"Action\" and the looping import hint \"-loop\".\nconst GLTF_SUFFIX_ANIMATION: String = \"Action-loop\"\n\n## These constants are the infix part of the node names used in the golden glTF file.\nconst GLTF_ALPHANUMERIC: String = \"Alphanumeric123\"\n# The last three symbols are:\n# https:\/\/en.wiktionary.org\/wiki\/%E3%82%B4#Japanese\n# https:\/\/en.wiktionary.org\/wiki\/%E3%83%89#Japanese\n# https:\/\/en.wiktionary.org\/wiki\/%E3%83%84#Japanese\nconst GLTF_KATAKANA: String = \"Katakana_\u30b4\u30c9\u30c4\"\n# The last two symbols are:\n# https:\/\/emojipedia.org\/grinning-face\n# https:\/\/emojipedia.org\/robot\/\nconst GLTF_EMOJI: String = \"Emoji_\ud83d\ude00\ud83e\udd16\"\nconst GLTF_ALLOWED_SYMBOLS: String = \"AllowedSymbols_!#$%^&*()-=[]{}';<>,~\"\nconst GLTF_DISALLOWED_NONCLASHING: String = \"Disallowed_Non-clashing_.:@\\\"\/\"\nconst GLTF_DISALLOWED_CLASHING_1: String = \"Disallowed_Clashing_.\"\nconst GLTF_DISALLOWED_CLASHING_2: String = \"Disallowed_Clashing_@\"\nconst GLTF_DISALLOWED_CLASHING_DEEP_TREE_1: String = \"Disallowed_Clashing_Deep_Tree_@\"\nconst GLTF_DISALLOWED_CLASHING_DEEP_TREE_2: String = \"Disallowed_Clashing_Deep_Tree_@@\"\nconst GLTF_DISALLOWED_CLASHING_DEEP_TREE_3: String = \"Disallowed_Clashing_Deep_Tree_@@@\"\n\nvar output: BoxContainer\nvar test_scene: Node\nvar test_animation_player: AnimationPlayer\n\n\nfunc _ready():\n\toutput = $ScrollContainer\/OutputWindow\n\ttest_scene = GOLDEN_GLTF_SCENE.instance()\n\ttest_animation_player = test_scene.get_node_or_null(\"AnimationPlayer\")\n\tif not test_animation_player:\n\t\t_add_line(\"ERROR: imported glTF scene has no AnimationPlayer node!\", Color.orangered)\n\t\tprint(\"FAIL: imported glTF scene has no AnimationPlayer so no tests will be run.\")\n\t\treturn\n\n\tvar passed_tests: Array = []\n\tvar failed_tests: Array = []\n\n\tfor method_name in _find_tests():\n\t\t_add_test_header(method_name)\n\t\tvar result: bool = self.call(method_name)\n\t\t_add_line(\" \")\n\t\tif result:\n\t\t\tpassed_tests.push_back(method_name)\n\t\telse:\n\t\t\tfailed_tests.push_back(method_name)\n\n\tif failed_tests:\n\t\tprint(\"FAIL: %d failed tests:\" % len(failed_tests))\n\t\tfor test in failed_tests:\n\t\t\tprint(\"\\t%s\" % test)\n\t\tprint(\"\")\n\t\tprint(\"Animations:\")\n\t\tfor animation_name in test_animation_player.get_animation_list():\n\t\t\tprint(\"\\t%s\" % animation_name)\n\telse:\n\t\tprint(\"PASS: Passed all %d tests\" % len(passed_tests))\n\n\nfunc _find_tests() -> Array:\n\tvar ret: Array = []\n\tfor method in get_method_list():\n\t\tvar method_name: String = method.get(\"name\")\n\t\tif method_name.begins_with(\"_test_\"):\n\t\t\tret.push_back(method_name)\n\tret.sort()\n\treturn ret\n\n\nfunc _add_test_header(method_name: String) -> void:\n\t_add_line(method_name, Color.royalblue)\n\n\nfunc _add_result(succeeded: bool, message: String) -> void:\n\tvar prefix: String = \" [OK] \" if succeeded else \" [FAIL] \"\n\t_add_line(prefix + message, Color.forestgreen if succeeded else Color.orangered)\n\n\nfunc _add_line(text: String, font_color: Color = Color.black) -> void:\n\tvar line: Label = Label.new()\n\tline.text = text\n\tline.add_theme_font_size_override(\"font_size\", 22)\n\tline.add_theme_color_override(\"font_color\", font_color)\n\toutput.add_child(line)\n\tprint(text)\n\n\nfunc _check_basic(original: String, expected: String) -> bool:\n\tvar node: Node = test_scene.get_node_or_null(expected)\n\tif not node:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Missing expected Godot node '%s' for glTF node '%s'\" % [expected, original])\n\t\treturn false\n\t_add_result(true, \"Found expected node '%s'\" % expected)\n\treturn true\n\n\nfunc _test_basic_alphanumeric_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_ALPHANUMERIC\n\tvar expected: String = original\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_allowed_symbols_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_ALLOWED_SYMBOLS\n\tvar expected: String = original\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_katakana_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_KATAKANA\n\tvar expected: String = original\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_emoji_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_EMOJI\n\tvar expected: String = original\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_disallowed_characters_are_stripped() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_NONCLASHING\n\tvar expected: String = GLTF_PREFIX_BASIC + \"Disallowed_Non-clashing_\"\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_disallowed_clashing_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_1\n\tvar expected: String = GLTF_PREFIX_BASIC + \"Disallowed_Clashing_\"\n\tif not _check_basic(original, expected):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_2\n\texpected = GLTF_PREFIX_BASIC + \"Disallowed_Clashing_2\"\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_disallowed_nested_nodes_are_uniquified() -> bool:\n\t# Note: Blender 9.2 serializes in prefix order, so the leaf child will be named first.\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_DEEP_TREE_1\n\tvar expected_root: String = GLTF_PREFIX_BASIC + \"Disallowed_Clashing_Deep_Tree_3\"\n\tif not _check_basic(original, expected_root):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_DEEP_TREE_2\n\tvar expected_mid = expected_root + \"\/\" + GLTF_PREFIX_BASIC + \"Disallowed_Clashing_Deep_Tree_2\"\n\tif not _check_basic(original, expected_mid):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_DEEP_TREE_3\n\tvar expected_leaf = expected_mid + \"\/\" + GLTF_PREFIX_BASIC + \"Disallowed_Clashing_Deep_Tree_\"\n\treturn _check_basic(original, expected_leaf)\n\n\n# Verifies that a node exists with the expected name and that it has a StaticBody3D child.\nfunc _check_hinted_col(original: String, expected: String) -> bool:\n\tvar node: Node = test_scene.get_node_or_null(expected)\n\tif not node:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Missing expected Godot node '%s' for glTF node '%s'\" % [expected, original])\n\t\treturn false\n\n\tvar collision_body: StaticBody3D = node.get_node_or_null(\"static_collision\")\n\tif not collision_body:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Missing 'static_collision' child for Godot node '%s' (glTF '%s')\" % [\n\t\t\t\texpected, original])\n\t\treturn false\n\n\t# This test assumes that if the static_collision node was created the -col hint was properly\n\t# handled (as that behavior should be tested elsewhere).\n\t_add_result(true, \"Expected node '%s' contains a static_collision StaticBody3D\" % expected)\n\treturn true\n\n\nfunc _test_hinted_alphanumeric_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_ALPHANUMERIC\n\tvar expected: String = original\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_allowed_symbols_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_ALLOWED_SYMBOLS\n\tvar expected: String = original\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_katakana_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_KATAKANA\n\tvar expected: String = original\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_emoji_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_EMOJI\n\tvar expected: String = original\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_disallowed_characters_are_stripped() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_DISALLOWED_NONCLASHING\n\tvar expected: String = GLTF_PREFIX_HINTED + \"Disallowed_Non-clashing_\"\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_disallowed_clashing_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_DISALLOWED_CLASHING_1\n\tvar expected: String = GLTF_PREFIX_HINTED + \"Disallowed_Clashing_\"\n\tif not _check_hinted_col(original, expected):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_HINTED + GLTF_DISALLOWED_CLASHING_2\n\texpected = GLTF_PREFIX_HINTED + \"Disallowed_Clashing_2\"\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_disallowed_nested_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_DISALLOWED_CLASHING_DEEP_TREE_1\n\tvar expected_root: String = GLTF_PREFIX_HINTED + \"Disallowed_Clashing_Deep_Tree_3\"\n\tif not _check_hinted_col(original, expected_root):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_HINTED + GLTF_DISALLOWED_CLASHING_DEEP_TREE_2\n\tvar expected_mid = expected_root + \"\/\" + GLTF_PREFIX_HINTED + \"Disallowed_Clashing_Deep_Tree_2\"\n\tif not _check_hinted_col(original, expected_mid):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_HINTED + GLTF_DISALLOWED_CLASHING_DEEP_TREE_3\n\tvar expected_leaf = expected_mid + \"\/\" + GLTF_PREFIX_HINTED + \"Disallowed_Clashing_Deep_Tree_\"\n\treturn _check_hinted_col(original, expected_leaf)\n\n\n# Verifies that a node exists with the expected name and that an associated animation exists.\nfunc _check_animated(original: String, expected: String, expected_animation: String = \"\") -> bool:\n\tvar node: Node = test_scene.get_node_or_null(expected)\n\tif not node:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Missing expected Godot node '%s' for glTF node '%s'\" % [expected, original])\n\t\treturn false\n\n\tif expected_animation.is_empty():\n\t\texpected_animation = expected + GLTF_SUFFIX_ANIMATION\n\tvar animation: Animation = test_animation_player.get_animation(expected_animation)\n\tif not animation:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Missing expected animation '%s' for Godot node '%s' (glTF '%s')\" % [\n\t\t\t\texpected_animation, expected, original])\n\t\treturn false\n\n\tvar track_count: int = animation.get_track_count()\n\tif track_count != 1:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Track count %d != 1 on animation '%s' for Godot node '%s' (glTF '%s')\" % [\n\t\t\t\ttrack_count, expected_animation, expected, original])\n\t\treturn false\n\n\t# All of the golden test animations are transforms.\n\tvar track_type: int = animation.track_get_type(0)\n\tif track_type != Animation.TYPE_TRANSFORM:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Unexpected track type %d on animation '%s' for Godot node '%s' (glTF '%s')\" % [\n\t\t\t\ttrack_type, expected_animation, expected, original])\n\t\treturn false\n\n\tvar track_key_count: int = animation.track_get_key_count(0)\n\tif track_key_count <= 0:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t(\"Animation track has unexpected %d (<= 0) key frames on animation '%s' for Godot node \\\n\t\t\t\t'%s' (glTF '%s')\" % [\n\t\t\t\t\ttrack_key_count, expected_animation, expected, original]))\n\t\treturn false\n\n\tvar track_path: NodePath = animation.track_get_path(0)\n\tvar expected_track_path = NodePath(expected)\n\tif track_path != expected_track_path:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t(\"Incorrect track_path '%s' (expected '%s') on animation '%s' for Godot node '%s' \\\n\t\t\t\t (glTF '%s')\" % [\n\t\t\t\t\ttrack_path, expected_track_path, expected_animation, expected, original]))\n\t\treturn false\n\n\t# This test assumes that if the static_collision node was created the -col hint was properly\n\t# handled (as that behavior should be tested elsewhere).\n\t_add_result(true, \"Expected node '%s' has an associated animation\" % expected)\n\treturn true\n\n\nfunc _test_animated_alphanumeric_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_ALPHANUMERIC\n\tvar expected: String = original\n\treturn _check_animated(original, expected)\n\n\nfunc _test_animated_allowed_symbols_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_ALLOWED_SYMBOLS\n\tvar expected_node: String = original\n\tvar expected_animation: String = original.replace(\",\", \"\").replace(\"[\", \"\")\n\texpected_animation += GLTF_SUFFIX_ANIMATION\n\treturn _check_animated(original, expected_node, expected_animation)\n\n\nfunc _test_animated_katakana_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_KATAKANA\n\tvar expected: String = original\n\treturn _check_animated(original, expected)\n\n\nfunc _test_animated_emoji_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_EMOJI\n\tvar expected: String = original\n\treturn _check_animated(original, expected)\n\n\nfunc _test_animated_disallowed_characters_are_stripped() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_DISALLOWED_NONCLASHING\n\tvar expected: String = GLTF_PREFIX_ANIMATED + \"Disallowed_Non-clashing_\"\n\treturn _check_animated(original, expected)\n\n\nfunc _test_animated_disallowed_clashing_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_DISALLOWED_CLASHING_1\n\tvar expected: String = GLTF_PREFIX_ANIMATED + \"Disallowed_Clashing_\"\n\t# WARNING: Animation name disambiguation is dependent on the order in the gltf file. The \n\t# ordering appears to be deterministic within a given Blender version, but if this fails\n\t# it would be good to first check that the ordering has not changed.\n\tvar expected_animation = GLTF_PREFIX_ANIMATED + \"Disallowed_Clashing_Action-loop\"\n\tif not _check_animated(original, expected, expected_animation):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_ANIMATED + GLTF_DISALLOWED_CLASHING_2\n\texpected = GLTF_PREFIX_ANIMATED + \"Disallowed_Clashing_2\"\n\texpected_animation = GLTF_PREFIX_ANIMATED + \"Disallowed_Clashing_Action-loop2\"\n\treturn _check_animated(original, expected, expected_animation)\n\n\nfunc _test_animated_disallowed_nested_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_DISALLOWED_CLASHING_DEEP_TREE_1\n\tvar expected_root: String = GLTF_PREFIX_ANIMATED + \"Disallowed_Clashing_Deep_Tree_3\"\n\t# WARNING: Animation name disambiguation is dependent on the order in the gltf file. The \n\t# ordering appears to be deterministic within a given Blender version, but if this fails\n\t# it would be good to first check that the ordering has not changed.\n\tvar expected_animation = GLTF_PREFIX_ANIMATED + \"Disallowed_Clashing_Deep_Tree_Action-loop\"\n\tif not _check_animated(original, expected_root, expected_animation):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_ANIMATED + GLTF_DISALLOWED_CLASHING_DEEP_TREE_2\n\tvar expected_mid = (expected_root + \"\/\" +\n\t\tGLTF_PREFIX_ANIMATED + \"Disallowed_Clashing_Deep_Tree_2\")\n\texpected_animation = GLTF_PREFIX_ANIMATED + \"Disallowed_Clashing_Deep_Tree_Action-loop2\"\n\tif not _check_animated(original, expected_mid, expected_animation):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_ANIMATED + GLTF_DISALLOWED_CLASHING_DEEP_TREE_3\n\tvar expected_leaf = (expected_mid + \"\/\" +\n\t\tGLTF_PREFIX_ANIMATED + \"Disallowed_Clashing_Deep_Tree_\")\n\texpected_animation = GLTF_PREFIX_ANIMATED + \"Disallowed_Clashing_Deep_Tree_Action-loop3\"\n\treturn _check_animated(original, expected_leaf, expected_animation)\n","old_contents":"extends ColorRect\n\nconst GOLDEN_GLTF_SCENE: PackedScene = preload(\"res:\/\/gltf\/45545-relax-name-sanitization.gltf\")\n\n## These constants are the prefix part of the node names used in the golden glTF file.\n# Prefix for \"basic\" nodes, no import hints, no animation, etc...\nconst GLTF_PREFIX_BASIC: String = \"Basic_\"\n\n# Prefix for nodes that have an import hint.\nconst GLTF_PREFIX_HINTED: String = \"Hinted_\"\n\n# Prefix for nodes that have an associated animation.\nconst GLTF_PREFIX_ANIMATED: String = \"Animated_\"\n\n# The suffix for animations (all animations in the golden glTF file use the Blender default suffix\n# \"Action\" and the looping import hint \"-loop\".\nconst GLTF_SUFFIX_ANIMATION: String = \"Action-loop\"\n\n## These constants are the infix part of the node names used in the golden glTF file.\nconst GLTF_ALPHANUMERIC: String = \"Alphanumeric123\"\n# The last three symbols are:\n# https:\/\/en.wiktionary.org\/wiki\/%E3%82%B4#Japanese\n# https:\/\/en.wiktionary.org\/wiki\/%E3%83%89#Japanese\n# https:\/\/en.wiktionary.org\/wiki\/%E3%83%84#Japanese\nconst GLTF_KATAKANA: String = \"Katakana_\u30b4\u30c9\u30c4\"\n# The last two symbols are:\n# https:\/\/emojipedia.org\/grinning-face\n# https:\/\/emojipedia.org\/robot\/\nconst GLTF_EMOJI: String = \"Emoji_\ud83d\ude00\ud83e\udd16\"\nconst GLTF_ALLOWED_SYMBOLS: String = \"AllowedSymbols_!#$%^&*()-=[]{}';<>,~\"\nconst GLTF_DISALLOWED_NONCLASHING: String = \"Disallowed_Non-clashing_.:@\\\"\/\"\nconst GLTF_DISALLOWED_CLASHING_1: String = \"Disallowed_Clashing_.\"\nconst GLTF_DISALLOWED_CLASHING_2: String = \"Disallowed_Clashing_@\"\nconst GLTF_DISALLOWED_CLASHING_DEEP_TREE_1: String = \"Disallowed_Clashing_Deep_Tree_@\"\nconst GLTF_DISALLOWED_CLASHING_DEEP_TREE_2: String = \"Disallowed_Clashing_Deep_Tree_@@\"\nconst GLTF_DISALLOWED_CLASHING_DEEP_TREE_3: String = \"Disallowed_Clashing_Deep_Tree_@@@\"\n\nvar output: BoxContainer\nvar test_scene: Node\nvar test_animation_player: AnimationPlayer\n\n\nfunc _ready():\n\toutput = $ScrollContainer\/OutputWindow\n\ttest_scene = GOLDEN_GLTF_SCENE.instance()\n\ttest_animation_player = test_scene.get_node_or_null(\"AnimationPlayer\")\n\tif not test_animation_player:\n\t\t_add_line(\"ERROR: imported glTF scene has no AnimationPlayer node!\", Color.orangered)\n\t\tprint(\"FAIL: imported glTF scene has no AnimationPlayer so no tests will be run.\")\n\t\treturn\n\n\tvar passed_tests: Array = []\n\tvar failed_tests: Array = []\n\n\tfor method_name in _find_tests():\n\t\t_add_test_header(method_name)\n\t\tvar result: bool = self.call(method_name)\n\t\t_add_line(\" \")\n\t\tif result:\n\t\t\tpassed_tests.push_back(method_name)\n\t\telse:\n\t\t\tfailed_tests.push_back(method_name)\n\n\tif failed_tests:\n\t\tprint(\"FAIL: %d failed tests:\" % len(failed_tests))\n\t\tfor test in failed_tests:\n\t\t\tprint(\"\\t%s\" % test)\n\t\tprint(\"\")\n\t\tprint(\"Animations:\")\n\t\tfor animation_name in test_animation_player.get_animation_list():\n\t\t\tprint(\"\\t%s\" % animation_name)\n\telse:\n\t\tprint(\"PASS: Passed all %d tests\" % len(passed_tests))\n\n\nfunc _find_tests() -> Array:\n\tvar ret: Array = []\n\tfor method in get_method_list():\n\t\tvar method_name: String = method.get(\"name\")\n\t\tif method_name.begins_with(\"_test_\"):\n\t\t\tret.push_back(method_name)\n\tret.sort()\n\treturn ret\n\n\nfunc _add_test_header(method_name: String) -> void:\n\t_add_line(method_name, Color.royalblue)\n\n\nfunc _add_result(succeeded: bool, message: String) -> void:\n\tvar prefix: String = \" [OK] \" if succeeded else \" [FAIL] \"\n\t_add_line(prefix + message, Color.forestgreen if succeeded else Color.orangered)\n\n\nfunc _add_line(text: String, font_color: Color = Color.black) -> void:\n\tvar line: Label = Label.new()\n\tline.text = text\n\tline.add_theme_font_size_override(\"font_size\", 22)\n\tline.add_theme_color_override(\"font_color\", font_color)\n\toutput.add_child(line)\n\tprint(text)\n\n\nfunc _check_basic(original: String, expected: String) -> bool:\n\tvar node: Node = test_scene.get_node_or_null(expected)\n\tif not node:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Missing expected Godot node '%s' for glTF node '%s'\" % [expected, original])\n\t\treturn false\n\t_add_result(true, \"Found expected node '%s'\" % expected)\n\treturn true\n\n\nfunc _test_basic_alphanumeric_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_ALPHANUMERIC\n\tvar expected: String = original\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_allowed_symbols_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_ALLOWED_SYMBOLS\n\tvar expected: String = original\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_katakana_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_KATAKANA\n\tvar expected: String = original\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_emoji_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_EMOJI\n\tvar expected: String = original\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_disallowed_characters_are_stripped() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_NONCLASHING\n\tvar expected: String = GLTF_PREFIX_BASIC + \"Disallowed_Non-clashing_\"\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_disallowed_clashing_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_1\n\tvar expected: String = GLTF_PREFIX_BASIC + \"Disallowed_Clashing_\"\n\tif not _check_basic(original, expected):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_2\n\texpected = GLTF_PREFIX_BASIC + \"Disallowed_Clashing_2\"\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_disallowed_nested_nodes_are_uniquified() -> bool:\n\t# Note: Blender 9.2 serializes in prefix order, so the leaf child will be named first.\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_DEEP_TREE_1\n\tvar expected_root: String = GLTF_PREFIX_BASIC + \"Disallowed_Clashing_Deep_Tree_3\"\n\tif not _check_basic(original, expected_root):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_DEEP_TREE_2\n\tvar expected_mid = expected_root + \"\/\" + GLTF_PREFIX_BASIC + \"Disallowed_Clashing_Deep_Tree_2\"\n\tif not _check_basic(original, expected_mid):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_DEEP_TREE_3\n\tvar expected_leaf = expected_mid + \"\/\" + GLTF_PREFIX_BASIC + \"Disallowed_Clashing_Deep_Tree_\"\n\treturn _check_basic(original, expected_leaf)\n\n\n# Verifies that a node exists with the expected name and that it has a StaticBody3D child.\nfunc _check_hinted_col(original: String, expected: String) -> bool:\n\tvar node: Node = test_scene.get_node_or_null(expected)\n\tif not node:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Missing expected Godot node '%s' for glTF node '%s'\" % [expected, original])\n\t\treturn false\n\n\tvar collision_body: StaticBody3D = node.get_node_or_null(\"static_collision\")\n\tif not collision_body:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Missing 'static_collision' child for Godot node '%s' (glTF '%s')\" % [\n\t\t\t\texpected, original])\n\t\treturn false\n\n\t# This test assumes that if the static_collision node was created the -col hint was properly\n\t# handled (as that behavior should be tested elsewhere).\n\t_add_result(true, \"Expected node '%s' contains a static_collision StaticBody3D\" % expected)\n\treturn true\n\n\nfunc _test_hinted_alphanumeric_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_ALPHANUMERIC\n\tvar expected: String = original\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_allowed_symbols_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_ALLOWED_SYMBOLS\n\tvar expected: String = original\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_katakana_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_KATAKANA\n\tvar expected: String = original\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_emoji_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_EMOJI\n\tvar expected: String = original\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_disallowed_characters_are_stripped() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_DISALLOWED_NONCLASHING\n\tvar expected: String = GLTF_PREFIX_HINTED + \"Disallowed_Non-clashing_\"\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_disallowed_clashing_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_DISALLOWED_CLASHING_1\n\tvar expected: String = GLTF_PREFIX_HINTED + \"Disallowed_Clashing_\"\n\tif not _check_hinted_col(original, expected):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_HINTED + GLTF_DISALLOWED_CLASHING_2\n\texpected = GLTF_PREFIX_HINTED + \"Disallowed_Clashing_2\"\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_disallowed_nested_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_DISALLOWED_CLASHING_DEEP_TREE_1\n\tvar expected_root: String = GLTF_PREFIX_HINTED + \"Disallowed_Clashing_Deep_Tree_3\"\n\tif not _check_hinted_col(original, expected_root):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_HINTED + GLTF_DISALLOWED_CLASHING_DEEP_TREE_2\n\tvar expected_mid = expected_root + \"\/\" + GLTF_PREFIX_HINTED + \"Disallowed_Clashing_Deep_Tree_2\"\n\tif not _check_hinted_col(original, expected_mid):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_HINTED + GLTF_DISALLOWED_CLASHING_DEEP_TREE_3\n\tvar expected_leaf = expected_mid + \"\/\" + GLTF_PREFIX_HINTED + \"Disallowed_Clashing_Deep_Tree_\"\n\treturn _check_hinted_col(original, expected_leaf)\n\n\n# Verifies that a node exists with the expected name and that an associated animation exists.\nfunc _check_animated(original: String, expected: String, expected_animation: String = \"\") -> bool:\n\tvar node: Node = test_scene.get_node_or_null(expected)\n\tif not node:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Missing expected Godot node '%s' for glTF node '%s'\" % [expected, original])\n\t\treturn false\n\n\tif expected_animation.is_empty():\n\t\texpected_animation = expected + GLTF_SUFFIX_ANIMATION\n\tvar animation: Animation = test_animation_player.get_animation(expected_animation)\n\tif not animation:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Missing expected animation '%s' for Godot node '%s' (glTF '%s')\" % [\n\t\t\t\texpected_animation, expected, original])\n\t\treturn false\n\n\tvar track_count: int = animation.get_track_count()\n\tif track_count != 1:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Track count %d != 1 on animation '%s' for Godot node '%s' (glTF '%s')\" % [\n\t\t\t\ttrack_count, expected_animation, expected, original])\n\t\treturn false\n\n\tvar track_type: int = animation.track_get_type(0)\n\tif track_type != Animation.TYPE_TRANSFORM:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Unexpected track type %d on animation '%s' for Godot node '%s' (glTF '%s')\" % [\n\t\t\t\ttrack_type, expected_animation, expected, original])\n\t\treturn false\n\n\tvar track_path: NodePath = animation.track_get_path(0)\n\tvar expected_track_path = NodePath(expected)\n\tif track_path != expected_track_path:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t(\"Incorrect track_path '%s' (expected '%s') on animation '%s' for Godot node '%s' \\\n\t\t\t\t (glTF '%s')\" % [\n\t\t\t\t\ttrack_path, expected_track_path, expected_animation, expected, original]))\n\t\treturn false\n\n\n\t# This test assumes that if the static_collision node was created the -col hint was properly\n\t# handled (as that behavior should be tested elsewhere).\n\t_add_result(true, \"Expected node '%s' has an associated animation\" % expected)\n\treturn true\n\n\nfunc _test_animated_alphanumeric_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_ALPHANUMERIC\n\tvar expected: String = original\n\treturn _check_animated(original, expected)\n\n\nfunc _test_animated_allowed_symbols_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_ALLOWED_SYMBOLS\n\tvar expected_node: String = original\n\tvar expected_animation: String = original.replace(\",\", \"\").replace(\"[\", \"\")\n\texpected_animation += GLTF_SUFFIX_ANIMATION\n\treturn _check_animated(original, expected_node, expected_animation)\n\n\nfunc _test_animated_katakana_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_KATAKANA\n\tvar expected: String = original\n\treturn _check_animated(original, expected)\n\n\nfunc _test_animated_emoji_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_EMOJI\n\tvar expected: String = original\n\treturn _check_animated(original, expected)\n\n\nfunc _test_animated_disallowed_characters_are_stripped() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_DISALLOWED_NONCLASHING\n\tvar expected: String = GLTF_PREFIX_ANIMATED + \"Disallowed_Non-clashing_\"\n\treturn _check_animated(original, expected)\n\n\nfunc _test_animated_disallowed_clashing_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_DISALLOWED_CLASHING_1\n\tvar expected: String = GLTF_PREFIX_ANIMATED + \"Disallowed_Clashing_\"\n\tif not _check_animated(original, expected):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_ANIMATED + GLTF_DISALLOWED_CLASHING_2\n\texpected = GLTF_PREFIX_ANIMATED + \"Disallowed_Clashing_2\"\n\treturn _check_animated(original, expected)\n\n\nfunc _test_animated_disallowed_nested_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_DISALLOWED_CLASHING_DEEP_TREE_1\n\tvar expected_root: String = GLTF_PREFIX_ANIMATED + \"Disallowed_Clashing_Deep_Tree_3\"\n\tif not _check_animated(original, expected_root):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_ANIMATED + GLTF_DISALLOWED_CLASHING_DEEP_TREE_2\n\tvar expected_mid = (expected_root + \"\/\" +\n\t\tGLTF_PREFIX_ANIMATED + \"Disallowed_Clashing_Deep_Tree_2\")\n\tif not _check_animated(original, expected_mid):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_ANIMATED + GLTF_DISALLOWED_CLASHING_DEEP_TREE_3\n\tvar expected_leaf = (expected_mid + \"\/\" +\n\t\tGLTF_PREFIX_ANIMATED + \"Disallowed_Clashing_Deep_Tree_\")\n\treturn _check_animated(original, expected_leaf)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"5a6ef7ae18272c11b1013774579cfed1b29c28bd","subject":"Fix minimum size issue with long text","message":"Fix minimum size issue with long text\n","repos":"groboclown\/godot-bootstrap","old_file":"components\/long_text\/long_text.gd","new_file":"components\/long_text\/long_text.gd","new_contents":"\n\n# A text label that scrolls on and on.\n\nextends Container\n\n\nexport(int, 0, 1000) var indent_pixels = 20 setget indent_spaces_changed\nexport(float, 0, 10) var paragraph_separation = 1.8 setget paragraph_separation_changed\nexport(float, 0, 10) var line_height = 1.5 setget line_height_changed\nexport(Color, RGBA) var color\nexport(Font) var font setget font_changed\nexport(String) var text setget text_changed\n\nvar _trtext\nvar _line_pos = []\nvar _height = 0\nvar _changed = false\n\nconst CH_SPACE = 32\nconst CH_TAB = 9\nconst CH_LF = 13\nconst CH_CR = 10\nconst CH_BACKSLASH = 92\nconst CH_N = 110\nconst CH_T = 116\n\nfunc _init():\n\tconnect(\"resized\", self, \"_on_resized\")\n\tconnect(\"minimum_size_changed\", self, \"_on_minimum_changed\")\n\tconnect(\"size_flags_changed\", self, \"_on_resized\")\n\tconnect(\"item_rect_changed\", self, \"_on_resized\")\n\n\nfunc _ready():\n\tif get_parent() extends ScrollContainer:\n\t\tget_parent().connect(\"resized\", self, \"recalculate\")\n\tif _changed:\n\t\trecalculate()\n\n\nfunc _on_minimum_changed():\n\t_changed = true\n\n\nfunc _on_resized():\n\t_changed = true\n\n\nfunc _draw():\n\tif _changed:\n\t\trecalculate()\n\tvar fnt = get_text_font()\n\tvar c = color\n\tif c == null:\n\t\tc = get_color(\"font_color\", \"Label\")\n\tfor line in _line_pos:\n\t\tdraw_string(fnt, line[1], line[0], c)\n\nfunc indent_spaces_changed(newval):\n\t_changed = true\n\nfunc paragraph_separation_changed(newval):\n\t_changed = true\n\nfunc line_height_changed(newval):\n\t_changed = true\n\nfunc font_changed(newval):\n\t_changed = true\n\nfunc text_changed(newval):\n\t_changed = true\n\t_trtext = []\n\tvar t = null\n\tif newval != null:\n\t\tt = tr(newval)\n\tif t == null:\n\t\treturn\n\t# escape the text\n\tvar esc = false\n\tvar txt = \"\"\n\tvar first = 0\n\tvar i\n\tfor i in range(0, t.length()):\n\t\tvar ch = t.ord_at(i)\n\t\tif esc:\n\t\t\tesc = false\n\t\t\tif ch == CH_N:\n\t\t\t\ttxt = txt.strip_edges()\n\t\t\t\tif txt.length() > 0:\n\t\t\t\t\t_trtext.append(txt)\n\t\t\t\ttxt = \"\"\n\t\t\t\tfirst = i + 1\n\t\t\telif ch == CH_T:\n\t\t\t\t# change to a space\n\t\t\t\tif i - 1 > first:\n\t\t\t\t\ttxt += t.substr(first, i - 1)\n\t\t\t\ttxt += ' '\n\t\t\t\tfirst = i + 1\n\t\t\telse:\n\t\t\t\t# Just use the un-escaped value\n\t\t\t\tfirst = i\n\t\telif ch == CH_BACKSLASH:\n\t\t\tif i > first:\n\t\t\t\ttxt += t.substr(first, i - first)\n\t\t\tesc = true\n\t\telif (ch == CH_CR || ch == CH_LF):\n\t\t\tif i > first:\n\t\t\t\ttxt += t.substr(first, i - first)\n\t\t\ttxt = txt.strip_edges()\n\t\t\tif txt.length() > 0:\n\t\t\t\t_trtext.append(txt)\n\t\t\ttxt = \"\"\n\t\t\tfirst = i + 1\n\t\telif ch == CH_TAB:\n\t\t\tif i > first:\n\t\t\t\ttxt += t.substr(first, i - first)\n\t\t\ttxt += ' '\n\t\t\tfirst = i + 1\n\t\t# else ch is a normal character; it is just added to the\n\t\t# pending substring\n\tif t.length() > first:\n\t\ttxt += t.right(first)\n\t\ttxt = txt.strip_edges()\n\t\tif txt.length() > 0:\n\t\t\t_trtext.append(txt)\n\n\nfunc get_text_font():\n\tif font == null:\n\t\treturn get_font(\"font\", \"Label\")\n\treturn font\n\n\nfunc recalculate():\n\t_changed = false\n\t\n\tvar widget_width = get_size().x\n\tif widget_width == null || widget_width <= 0:\n\t\twidget_width = max(get_size().x, get_minimum_size().x)\n\tif get_parent() != null:\n\t\tif widget_width <= 0:\n\t\t\twidget_width = get_parent_area_size().x\n\t\tif widget_width <= 0:\n\t\t\twidget_width = get_parent().get_size().x\n\t\tif get_parent() extends ScrollContainer:\n\t\t\tvar pw = get_parent().get_size().x\n\t\t\tif pw > 0:\n\t\t\t\tvar k = get_parent().get_node(\"_v_scroll\")\n\t\t\t\tif k != null:\n\t\t\t\t\tpw -= max(k.get_size().x, 10)\n\t\t\t\tif pw < widget_width:\n\t\t\t\t\twidget_width = pw\n\tprint(\"Using widget width \"+str(widget_width))\n\t\n\tvar start_x = 0\n\tvar fnt = get_text_font()\n\tvar font_height = float(fnt.get_height())\n\tvar psep = int(paragraph_separation * font_height)\n\tvar lsep = int(line_height * font_height)\n\t_line_pos = []\n\t# We start drawing strings at the bottom of the string.\n\tvar y_pos = -psep + lsep\n\tfor txt in _trtext:\n\t\t# start of an explicit new line\n\t\ty_pos += psep\n\t\tvar tlen = txt.length() - 1\n\t\tvar tpos\n\t\t# We trim the lines, so that they start with non-whitespace\n\t\t# Therefore, the first character of a line is the start of the word.\n\t\tvar linestart_pos = 0\n\t\tvar wordstart_pos = 0\n\t\tvar word_width = 0\n\t\tvar wordend_pos = -1\n\t\tvar on_space = false\n\t\tvar x_pos = indent_pixels + start_x\n\t\tvar width = indent_pixels\n\t\tfor tpos in range(0, tlen + 1):\n\t\t\tvar ch = txt.ord_at(tpos)\n\t\t\tif ch == CH_SPACE:\n\t\t\t\tif not on_space:\n\t\t\t\t\ton_space = true\n\t\t\t\t\twordend_pos = tpos\n\t\t\t\t\twordstart_pos = -1\n\t\t\t\t\tword_width = 0\n\t\t\telse:\n\t\t\t\tif linestart_pos < 0:\n\t\t\t\t\tlinestart_pos = tpos\n\t\t\t\tif wordstart_pos < 0:\n\t\t\t\t\twordstart_pos = tpos\n\t\t\t\t\tword_width = 0\n\t\t\t\ton_space = false\n\t\t\tvar cn = 0\n\t\t\tif tpos + 1 <= tlen:\n\t\t\t\tcn = txt.ord_at(tpos + 1)\n\t\t\tvar cw = fnt.get_char_size(ch, cn).x\n\t\t\twidth += cw\n\t\t\tword_width += cw\n\t\t\tif tpos >= tlen:\n\t\t\t\t# end of the line; stick everything into the end.\n\t\t\t\t# We trim the text, so the last character is non-whitespace.\n\t\t\t\t_line_pos.append([\n\t\t\t\t\t# text\n\t\t\t\t\ttxt.right(linestart_pos),\n\t\t\t\t\t\n\t\t\t\t\t# draw position\n\t\t\t\t\tVector2(x_pos, y_pos)\n\t\t\t\t])\n\t\t\t\t# No need to change x_pos or the other loop variables\n\t\t\t\ty_pos += lsep\n\t\t\telif width >= widget_width:\n\t\t\t\t# Soft end of line\n\t\t\t\tvar next_linestart = wordstart_pos\n\t\t\t\tvar next_wordstart = -1\n\t\t\t\tvar next_word_width = word_width - width\n\t\t\t\tif wordend_pos < 0:\n\t\t\t\t\t# in the middle of the word.\n\t\t\t\t\tif wordstart_pos < 0:\n\t\t\t\t\t\t# No word in the line. Just skip it\n\t\t\t\t\t\twidth = 0\n\t\t\t\t\t\tx_pos = start_x\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t# only one word; cut this one at the break.\n\t\t\t\t\t# TODO add a hyphen\n\t\t\t\t\twordend_pos = tpos\n\t\t\t\t\tnext_linestart = tpos\n\t\t\t\t\tnext_wordstart = tpos\n\t\t\t\t\tword_width = cw\n\t\t\t\t\tnext_word_width = cw\n\t\t\t\t\n\t\t\t\t# soft end of line\n\t\t\t\t_line_pos.append([\n\t\t\t\t\t# text\n\t\t\t\t\ttxt.substr(linestart_pos, wordend_pos - linestart_pos),\n\t\t\t\t\t\n\t\t\t\t\t# draw position\n\t\t\t\t\tVector2(x_pos, y_pos)\n\t\t\t\t])\n\t\t\t\t\n\t\t\t\tx_pos = start_x\n\t\t\t\twidth = word_width\n\t\t\t\tword_width = next_word_width\n\t\t\t\ty_pos += lsep\n\t\t\t\twordstart_pos = next_wordstart\n\t\t\t\twordend_pos = -1\n\t\t\t\tlinestart_pos = next_linestart\n\t\t\t\t\n\tset_custom_minimum_size(Vector2(0, y_pos))\n","old_contents":"\n\n# A text label that scrolls on and on.\n\nextends Container\n\n\nexport(int, 0, 1000) var indent_pixels = 20 setget indent_spaces_changed\nexport(float, 0, 10) var paragraph_separation = 1.8 setget paragraph_separation_changed\nexport(float, 0, 10) var line_height = 1.5 setget line_height_changed\nexport(Color, RGBA) var color\nexport(Font) var font setget font_changed\nexport(String) var text setget text_changed\n\nvar _trtext\nvar _line_pos = []\nvar _height = 0\nvar _changed = false\n\nvar _actual_width\nvar _minimum_width\n\nconst CH_SPACE = 32\nconst CH_TAB = 9\nconst CH_LF = 13\nconst CH_CR = 10\nconst CH_BACKSLASH = 92\nconst CH_N = 110\nconst CH_T = 116\n\nfunc _init():\n\tconnect(\"resized\", self, \"_on_resized\")\n\tconnect(\"minimum_size_changed\", self, \"_on_minimum_changed\")\n\tconnect(\"size_flags_changed\", self, \"_on_resized\")\n\tconnect(\"item_rect_changed\", self, \"_on_resized\")\n\n\nfunc _ready():\n\tif get_parent() extends ScrollContainer:\n\t\tget_parent().connect(\"resized\", self, \"recalculate\")\n\tif _changed:\n\t\trecalculate()\n\tif _actual_width == null:\n\t\t_actual_width = get_minimum_size().x\n\n\t\t\nfunc _on_minimum_changed():\n\tvar size = get_minimum_size()\n\tif _minimum_width == null || size.x != _actual_width:\n\t\t# it hasn't been called, or was explicitly changed outside\n\t\t# of the below method.\n\t\t_minimum_width = size.x\n\t\tif _minimum_width > _actual_width:\n\t\t\t_actual_width = _minimum_width\n\t\t\t_changed = true\n\t\t\n\nfunc _on_resized():\n\t# Prevents the explicit setting of the minimum size below from messing with\n\t# the actual size.\n\tvar new_width = max(get_minimum_size().x, get_size().x)\n\tif _actual_width != new_width:\n\t\t_actual_width = new_width\n\t\t_changed = true\n\t\n\nfunc _draw():\n\tif _changed:\n\t\trecalculate()\n\tvar fnt = get_text_font()\n\tvar c = color\n\tif c == null:\n\t\tc = get_color(\"font_color\", \"Label\")\n\tfor line in _line_pos:\n\t\tdraw_string(fnt, line[1], line[0], c)\n\nfunc indent_spaces_changed(newval):\n\t_changed = true\n\nfunc paragraph_separation_changed(newval):\n\t_changed = true\n\nfunc line_height_changed(newval):\n\t_changed = true\n\nfunc font_changed(newval):\n\t_changed = true\n\nfunc text_changed(newval):\n\t_changed = true\n\t_trtext = []\n\tvar t = null\n\tif newval != null:\n\t\tt = tr(newval)\n\tif t == null:\n\t\treturn\n\t# escape the text\n\tvar esc = false\n\tvar txt = \"\"\n\tvar first = 0\n\tvar i\n\tfor i in range(0, t.length()):\n\t\tvar ch = t.ord_at(i)\n\t\tif esc:\n\t\t\tesc = false\n\t\t\tif ch == CH_N:\n\t\t\t\ttxt = txt.strip_edges()\n\t\t\t\tif txt.length() > 0:\n\t\t\t\t\t_trtext.append(txt)\n\t\t\t\ttxt = \"\"\n\t\t\t\tfirst = i + 1\n\t\t\telif ch == CH_T:\n\t\t\t\t# change to a space\n\t\t\t\tif i - 1 > first:\n\t\t\t\t\ttxt += t.substr(first, i - 1)\n\t\t\t\ttxt += ' '\n\t\t\t\tfirst = i + 1\n\t\t\telse:\n\t\t\t\t# Just use the un-escaped value\n\t\t\t\tfirst = i\n\t\telif ch == CH_BACKSLASH:\n\t\t\tif i > first:\n\t\t\t\ttxt += t.substr(first, i - first)\n\t\t\tesc = true\n\t\telif (ch == CH_CR || ch == CH_LF):\n\t\t\tif i > first:\n\t\t\t\ttxt += t.substr(first, i - first)\n\t\t\ttxt = txt.strip_edges()\n\t\t\tif txt.length() > 0:\n\t\t\t\t_trtext.append(txt)\n\t\t\ttxt = \"\"\n\t\t\tfirst = i + 1\n\t\telif ch == CH_TAB:\n\t\t\tif i > first:\n\t\t\t\ttxt += t.substr(first, i - first)\n\t\t\ttxt += ' '\n\t\t\tfirst = i + 1\n\t\t# else ch is a normal character; it is just added to the\n\t\t# pending substring\n\tif t.length() > first:\n\t\ttxt += t.right(first)\n\t\ttxt = txt.strip_edges()\n\t\tif txt.length() > 0:\n\t\t\t_trtext.append(txt)\n\n\nfunc get_text_font():\n\tif font == null:\n\t\treturn get_font(\"font\", \"Label\")\n\treturn font\n\n\nfunc recalculate():\n\t_changed = false\n\t\n\tvar widget_width = _actual_width\n\tif widget_width == null || widget_width <= 0:\n\t\tif _minimum_width == null:\n\t\t\t_minimum_width = get_minimum_size().x\n\t\twidget_width = max(get_size().x, _minimum_width)\n\tif get_parent() != null && get_parent() extends ScrollContainer:\n\t\tvar pw = get_parent().get_size().x\n\t\tif pw > 0:\n\t\t\tvar k = get_parent().get_node(\"_v_scroll\")\n\t\t\tif k != null:\n\t\t\t\tpw -= max(k.get_size().x, 10)\n\t\t\tif pw < widget_width:\n\t\t\t\twidget_width = pw\n\t\n\tvar start_x = 0\n\tvar fnt = get_text_font()\n\tvar font_height = float(fnt.get_height())\n\tvar psep = int(paragraph_separation * font_height)\n\tvar lsep = int(line_height * font_height)\n\t_line_pos = []\n\t# We start drawing strings at the bottom of the string.\n\tvar y_pos = -psep + lsep\n\tfor txt in _trtext:\n\t\t# start of an explicit new line\n\t\ty_pos += psep\n\t\tvar tlen = txt.length() - 1\n\t\tvar tpos\n\t\t# We trim the lines, so that they start with non-whitespace\n\t\t# Therefore, the first character of a line is the start of the word.\n\t\tvar linestart_pos = 0\n\t\tvar wordstart_pos = 0\n\t\tvar word_width = 0\n\t\tvar wordend_pos = -1\n\t\tvar on_space = false\n\t\tvar x_pos = indent_pixels + start_x\n\t\tvar width = indent_pixels\n\t\tfor tpos in range(0, tlen + 1):\n\t\t\tvar ch = txt.ord_at(tpos)\n\t\t\tif ch == CH_SPACE:\n\t\t\t\tif not on_space:\n\t\t\t\t\ton_space = true\n\t\t\t\t\twordend_pos = tpos\n\t\t\t\t\twordstart_pos = -1\n\t\t\t\t\tword_width = 0\n\t\t\telse:\n\t\t\t\tif linestart_pos < 0:\n\t\t\t\t\tlinestart_pos = tpos\n\t\t\t\tif wordstart_pos < 0:\n\t\t\t\t\twordstart_pos = tpos\n\t\t\t\t\tword_width = 0\n\t\t\t\ton_space = false\n\t\t\tvar cn = 0\n\t\t\tif tpos + 1 <= tlen:\n\t\t\t\tcn = txt.ord_at(tpos + 1)\n\t\t\tvar cw = fnt.get_char_size(ch, cn).x\n\t\t\twidth += cw\n\t\t\tword_width += cw\n\t\t\tif tpos >= tlen:\n\t\t\t\t# end of the line; stick everything into the end.\n\t\t\t\t# We trim the text, so the last character is non-whitespace.\n\t\t\t\t_line_pos.append([\n\t\t\t\t\t# text\n\t\t\t\t\ttxt.right(linestart_pos),\n\t\t\t\t\t\n\t\t\t\t\t# draw position\n\t\t\t\t\tVector2(x_pos, y_pos)\n\t\t\t\t])\n\t\t\t\t# No need to change x_pos or the other loop variables\n\t\t\t\ty_pos += lsep\n\t\t\telif width >= widget_width:\n\t\t\t\t# Soft end of line\n\t\t\t\tvar next_linestart = wordstart_pos\n\t\t\t\tvar next_wordstart = -1\n\t\t\t\tvar next_word_width = word_width - width\n\t\t\t\tif wordend_pos < 0:\n\t\t\t\t\t# in the middle of the word.\n\t\t\t\t\tif wordstart_pos < 0:\n\t\t\t\t\t\t# No word in the line. Just skip it\n\t\t\t\t\t\twidth = 0\n\t\t\t\t\t\tx_pos = start_x\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t# only one word; cut this one at the break.\n\t\t\t\t\t# TODO add a hyphen\n\t\t\t\t\twordend_pos = tpos\n\t\t\t\t\tnext_linestart = tpos\n\t\t\t\t\tnext_wordstart = tpos\n\t\t\t\t\tword_width = cw\n\t\t\t\t\tnext_word_width = cw\n\t\t\t\t\n\t\t\t\t# soft end of line\n\t\t\t\t_line_pos.append([\n\t\t\t\t\t# text\n\t\t\t\t\ttxt.substr(linestart_pos, wordend_pos - linestart_pos),\n\t\t\t\t\t\n\t\t\t\t\t# draw position\n\t\t\t\t\tVector2(x_pos, y_pos)\n\t\t\t\t])\n\t\t\t\t\n\t\t\t\tx_pos = start_x\n\t\t\t\twidth = word_width\n\t\t\t\tword_width = next_word_width\n\t\t\t\ty_pos += lsep\n\t\t\t\twordstart_pos = next_wordstart\n\t\t\t\twordend_pos = -1\n\t\t\t\tlinestart_pos = next_linestart\n\t\t\t\t\n\tset_custom_minimum_size(Vector2(widget_width, y_pos))\n\t\n\n","returncode":0,"stderr":"","license":"cc0-1.0","lang":"GDScript"} {"commit":"dd11f6cf8951bb0470332518041c59feb528dcc8","subject":"fix-player-start-direction","message":"fix-player-start-direction\n","repos":"shelltitan\/captain-holetooth,AlexHolly\/captain-holetooth,shelltitan\/captain-holetooth,AlexHolly\/captain-holetooth","old_file":"src\/actors\/player\/player.gd","new_file":"src\/actors\/player\/player.gd","new_contents":"\nextends RigidBody2D\n\n# Member variables\nvar anim = \"\"\nvar siding_left = false\nvar jumping = false\nvar shooting = false\n\nvar WALK_ACCEL = 2000.0 # Higher = Better control, Lower = Sluggish\nvar WALK_DEACCEL = 2000.0\nvar WALK_MAX_VELOCITY = 300.0\nvar AIR_ACCEL = 300.0 # It's over 9000! \nvar AIR_DEACCEL = 2900.0 # Make it higher to give the player better air control, or slower to make the game more \"realistic\"\nvar JUMP_VELOCITY = 438\nvar STOP_JUMP_FORCE = 2000.0\n\nvar MAX_FLOOR_AIRBORNE_TIME = 0.15\n\nvar DIR_LEFT = Vector2(-1,1)\nvar DIR_RIGHT = Vector2(1,1)\nvar CURR_DIR = Vector2(-1,1)\nvar LAST_DIR = Vector2(0,0)\n\nvar airborne_time = 1e20\nvar shoot_time = 1e20\n\nvar MAX_SHOOT_POSE_TIME = 0.3\n\nvar bullet = preload(\"res:\/\/src\/actors\/player\/bullet.tscn\")\n\nvar floor_h_velocity = 0.0\nvar enemy\n\n#func beam_to(spawner):\n\t\n#\tvar spawnerpos = get_node(spawner).get_global_pos()\n#\tprint(\"Beam to active!\")\n#\tself.set_pos(spawnerpos)\n\n\nfunc _integrate_forces(s):\n\tvar linear_vel = s.get_linear_velocity()\n\tvar step = s.get_step()\n\t\n\tvar new_anim = anim\n\tvar new_siding_left = siding_left\n\t\n\t# Get the controls\n\tvar move_left = Input.is_action_pressed(\"move_left\")\n\tvar move_right = Input.is_action_pressed(\"move_right\")\n\tvar jump = Input.is_action_pressed(\"jump\")\n\tvar shoot = Input.is_action_pressed(\"shoot\")\n\tvar spawn = Input.is_action_pressed(\"spawn\")\n\t\n\t\n\tif spawn:\n\t\tvar e = enemy.instance()\n\t\tvar p = get_pos()\n\t\tp.y = p.y - 100\n\t\te.set_pos(p)\n\t\tget_parent().add_child(e)\n\t\n\t# Deapply prev floor velocity\n\tlinear_vel.x -= floor_h_velocity\n\tfloor_h_velocity = 0.0\n\t\n\t# Find the floor (a contact with upwards facing collision normal)\n\tvar found_floor = false\n\tvar floor_index = -1\n\t\n\tfor x in range(s.get_contact_count()):\n\t\tvar ci = s.get_contact_local_normal(x)\n\t\tif (ci.dot(Vector2(0, -1)) > 0.6):\n\t\t\tfound_floor = true\n\t\t\tfloor_index = x\n\t\n\t# Calculate air born time in order to control when to stop jump\n\t# from the user releasing jump or reaching max jump height\n\tif (found_floor):\n\t\tairborne_time = 0.0\n\telse:\n\t\tairborne_time += step # Time it spent in the air\n\t\n\tvar on_floor = airborne_time < MAX_FLOOR_AIRBORNE_TIME\n\n\t# Process jump\n\tif (jumping):\n\t\tif (linear_vel.y > 0):\n\t\t\t# Set off the jumping flag if going down\n\t\t\tjumping = false\n\n\t\tif (!jump):\n\t\t\tlinear_vel.y += STOP_JUMP_FORCE*step\n\t\n\tif (on_floor):\n\t\t# Process logic when character is on floor\n\t\tif (move_left and not move_right):\n\t\t\tCURR_DIR = DIR_LEFT\n\t\t\tif (linear_vel.x > -WALK_MAX_VELOCITY):\n\t\t\t\tlinear_vel.x -= WALK_ACCEL*step\n\t\t\t\t# Prevent player from exceeding max walk velocity\n\t\t\t\tif(linear_vel.x < -WALK_MAX_VELOCITY):\n\t\t\t\t\tlinear_vel.x = -WALK_MAX_VELOCITY\n\t\t\t\t\n\t\telif (move_right and not move_left):\n\t\t\tCURR_DIR = DIR_RIGHT\n\t\t\tif (linear_vel.x < WALK_MAX_VELOCITY):\n\t\t\t\tlinear_vel.x += WALK_ACCEL*step\n\t\t\t\t# Prevent player from exceeding max walk velocity\n\t\t\t\tif(linear_vel.x > WALK_MAX_VELOCITY):\n\t\t\t\t\tlinear_vel.x = WALK_MAX_VELOCITY\n\t\telse:\n\t\t\tvar xv = abs(linear_vel.x)\n\t\t\txv -= WALK_DEACCEL*step\n\t\t\tif (xv < 0):\n\t\t\t\txv = 0\n\t\t\tlinear_vel.x = sign(linear_vel.x)*xv\n\t\n\t\t# If we can, and want to JUMP - Jump!\n\t\tif (!jumping && jump):\n\t\t\t# Set velocity upwards \n\t\t\tlinear_vel.y = -JUMP_VELOCITY\n\t\t\t\n\t\t\t# Notify code that we are jumping\n\t\t\tjumping = true\n\t\t\t\n\t\t\t# Play the player's jump sound\n\t\t\tif !get_node(\"sfx\").is_active():\n\t\t\t\tget_node(\"sfx\").play(\"flupp\")\n\t\t\t# THIS IS FOR FUTURE USE - Its a statistics thing for players to see like \"Hey you only jumped 20 times during the whole game...\"\n\t\t\t# Whatever use it is, i think its a fun element to talk about :D\n\t\t\t# I don't care often about the \"use\" of things... just having it for fun is good enough ;)\n\t\t\tglobal.times_jumped = global.times_jumped +1\n\t\t\t# print(global.times_jumped)\n\t\t\t\n\t\t\t# Achievement for jumping 50 times - Increased jump height\n\t\t\tif (global.times_jumped > 50):\n\t\t\t\tJUMP_VELOCITY = 550\n\t\t\t\t# print(\"Yay! You can now jump higher\")\n\t\t\t\t# TODO: Print an achievement notification message to the player\n\t\t\n\t\t\n\t\t# Check jumping\n\t\tif (jumping):\n\t\t\t# Set the next animation\n\t\t\tnew_anim = \"jumping\"\n\t\t\n\t\t# Handling an idle player\n\t\telif (abs(linear_vel.x) < 0.1): # Using a 0.1 padding for when we consider the player to be idle\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"idle_weapon\"\n\t\t\telse:\n\t\t\t\tnew_anim = \"idle\"\n\t\t\n\t\t# The player is moving (not jumping)\n\t\telse:\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"run_weapon\"\n\t\t\telse:\n\t\t\t\tnew_anim = \"run\"\n\telse:\n\t\t# Process logic when the character is in the air\n\t\t# When we are only pressing LEFT movement\n\t\tif (move_left && !move_right):\n\t\t\tCURR_DIR = DIR_LEFT\n\t\t\tif (linear_vel.x > -WALK_MAX_VELOCITY):\n\t\t\t\t# linear_vel.x = -WALK_MAX_VELOCITY\n\t\t\t\tlinear_vel.x -= AIR_ACCEL*step\n\t\t\t\tif(linear_vel.x < -WALK_MAX_VELOCITY):\n\t\t\t\t\tlinear_vel.x = -WALK_MAX_VELOCITY\n\t\t\t\t\n\t\telif (move_right && !move_left):\n\t\t\tCURR_DIR = DIR_RIGHT\n\t\t\tif (linear_vel.x < WALK_MAX_VELOCITY):\n\t\t\t\t# linear_vel.x = WALK_MAX_VELOCITY\n\t\t\t\tlinear_vel.x += AIR_ACCEL*step\n\t\t\t\tif(linear_vel.x > WALK_MAX_VELOCITY):\n\t\t\t\t\tlinear_vel.x = WALK_MAX_VELOCITY\n\t\telse:\n\t\t\t# Deaccelerate air movement (quickly for a smooth gameplay experience)\n\t\t\tvar x_vel = abs(linear_vel.x)\n\t\t\tx_vel -= AIR_DEACCEL*step\n\t\t\tif (x_vel < 0):\n\t\t\t\tx_vel = 0\n\t\t\tlinear_vel.x = sign(linear_vel.x)*x_vel\n\t\t\n\t\tif (linear_vel.y < 0):\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"jumping_weapon\"\n\t\t\telse:\n\t\t\t\tnew_anim = \"jumping\"\n\t\telse:\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"falling_weapon\"\n\t\t\t\n\t\t\telse:\n\t\t\t\tnew_anim = \"falling\"\n\t\n\t# A good idea when impementing characters of all kinds,\n\t# compensates for physics imprecission, as well as human reaction delay.\n\tif (shoot and not shooting):\n\t\tshoot_time = 0\n\t\tvar bi = bullet.instance()\n\t\tvar ss\n\t\t#if (CURR_DIR==DIR_LEFT):\n\t\t#\tss = -1.0\n\t\t#else:\n\t\t#\tss = 1.0\n\t\tvar pos = get_pos() + get_node(\"bullet_shoot\").get_pos()*CURR_DIR\n\t\t\n\t\tbi.set_pos(pos)\n\t\tget_parent().add_child(bi)\n\t\t\n\t\tbi.set_linear_velocity(Vector2(800.0*CURR_DIR.x, -80))\n\t\tget_node(\"sprite\/smoke\").set_emitting(true)\n\t\tget_node(\"sfx\").play(\"schwuit\")\n\t\tPS2D.body_add_collision_exception(bi.get_rid(), get_rid()) # Make bullet and this not collide\n\telse:\n\t\tshoot_time += step\n\t# Check siding direction\n\t#if (linear_vel.x < 0 && move_left):\n\t#\tnew_siding_left = true\n\t#elif (linear_vel.x > 0 && move_right):\n\t#\tnew_siding_left = false\n\t\t\n\t# Update siding\n\tif (LAST_DIR!=CURR_DIR):\n\t\tif (move_left):\n\t\t\tget_node(\"sprite\").set_scale(DIR_LEFT)\n\t\t\tLAST_DIR = DIR_LEFT\n\t\telif(move_right):\n\t\t\tget_node(\"sprite\").set_scale(DIR_RIGHT)\n\t\t\tLAST_DIR = DIR_RIGHT\n\t\n\t# Change animation\n\tif (new_anim != anim):\n\t\tanim = new_anim\n\t\tget_node(\"anim\").play(anim)\n\t\n\tshooting = shoot\n\t\n\t# Apply floor velocity\n\tif (found_floor):\n\t\tfloor_h_velocity = s.get_contact_collider_velocity_at_pos(floor_index).x\n\t\tlinear_vel.x += floor_h_velocity\n\t\n\t# Finally, apply gravity and set back the linear velocity\n\tlinear_vel += s.get_total_gravity()*step\n\ts.set_linear_velocity(linear_vel)\n\t\n\n\nfunc _ready():\n\tset_process(true)\n\tenemy = ResourceLoader.load(\"res:\/\/scenes\/scn3-forest\/enemy.tscn\")\n\t# Update play time, has to go into a global function at some point\nfunc _process(delta):\n\tglobal.time_elapsed += delta\n\t#print(global.time_elapsed)\n\tif global.time_elapsed >= int(global.playtime_limit_seconds):\n\t\t#print(\"Time elpased!\")\n\t\t#show(Popup)\n\t\tglobal.time_elapsed = 0\n\n\n#\tif !Globals.has_singleton(\"Facebook\"):\n#\t\treturn\n#\tvar Facebook = Globals.get_singleton(\"Facebook\")\n#\tvar link = Globals.get(\"facebook\/link\")\n#\tvar icon = Globals.get(\"facebook\/icon\")\n#\tvar msg = \"I just sneezed on your wall! Beat my score and Stop the Running nose!\"\n#\tvar title = \"I just sneezed on your wall!\"\n#\tFacebook.post(\"feed\", msg, title, link, icon)\n","old_contents":"\nextends RigidBody2D\n\n# Member variables\nvar anim = \"\"\nvar siding_left = false\nvar jumping = false\nvar shooting = false\n\nvar WALK_ACCEL = 2000.0 # Higher = Better control, Lower = Sluggish\nvar WALK_DEACCEL = 2000.0\nvar WALK_MAX_VELOCITY = 300.0\nvar AIR_ACCEL = 300.0 # It's over 9000! \nvar AIR_DEACCEL = 2900.0 # Make it higher to give the player better air control, or slower to make the game more \"realistic\"\nvar JUMP_VELOCITY = 438\nvar STOP_JUMP_FORCE = 2000.0\n\nvar MAX_FLOOR_AIRBORNE_TIME = 0.15\n\nvar DIR_LEFT = Vector2(-1,1)\nvar DIR_RIGHT = Vector2(1,1)\nvar CURR_DIR = Vector2(-1,1)\nvar LAST_DIR = Vector2(-1,1)\n\nvar airborne_time = 1e20\nvar shoot_time = 1e20\n\nvar MAX_SHOOT_POSE_TIME = 0.3\n\nvar bullet = preload(\"res:\/\/src\/actors\/player\/bullet.tscn\")\n\nvar floor_h_velocity = 0.0\nvar enemy\n\n#func beam_to(spawner):\n\t\n#\tvar spawnerpos = get_node(spawner).get_global_pos()\n#\tprint(\"Beam to active!\")\n#\tself.set_pos(spawnerpos)\n\n\nfunc _integrate_forces(s):\n\tvar linear_vel = s.get_linear_velocity()\n\tvar step = s.get_step()\n\t\n\tvar new_anim = anim\n\tvar new_siding_left = siding_left\n\t\n\t# Get the controls\n\tvar move_left = Input.is_action_pressed(\"move_left\")\n\tvar move_right = Input.is_action_pressed(\"move_right\")\n\tvar jump = Input.is_action_pressed(\"jump\")\n\tvar shoot = Input.is_action_pressed(\"shoot\")\n\tvar spawn = Input.is_action_pressed(\"spawn\")\n\t\n\t\n\tif spawn:\n\t\tvar e = enemy.instance()\n\t\tvar p = get_pos()\n\t\tp.y = p.y - 100\n\t\te.set_pos(p)\n\t\tget_parent().add_child(e)\n\t\n\t# Deapply prev floor velocity\n\tlinear_vel.x -= floor_h_velocity\n\tfloor_h_velocity = 0.0\n\t\n\t# Find the floor (a contact with upwards facing collision normal)\n\tvar found_floor = false\n\tvar floor_index = -1\n\t\n\tfor x in range(s.get_contact_count()):\n\t\tvar ci = s.get_contact_local_normal(x)\n\t\tif (ci.dot(Vector2(0, -1)) > 0.6):\n\t\t\tfound_floor = true\n\t\t\tfloor_index = x\n\t\n\t# Calculate air born time in order to control when to stop jump\n\t# from the user releasing jump or reaching max jump height\n\tif (found_floor):\n\t\tairborne_time = 0.0\n\telse:\n\t\tairborne_time += step # Time it spent in the air\n\t\n\tvar on_floor = airborne_time < MAX_FLOOR_AIRBORNE_TIME\n\n\t# Process jump\n\tif (jumping):\n\t\tif (linear_vel.y > 0):\n\t\t\t# Set off the jumping flag if going down\n\t\t\tjumping = false\n\n\t\tif (!jump):\n\t\t\tlinear_vel.y += STOP_JUMP_FORCE*step\n\t\n\tif (on_floor):\n\t\t# Process logic when character is on floor\n\t\tif (move_left and not move_right):\n\t\t\tCURR_DIR = DIR_LEFT\n\t\t\tif (linear_vel.x > -WALK_MAX_VELOCITY):\n\t\t\t\tlinear_vel.x -= WALK_ACCEL*step\n\t\t\t\t# Prevent player from exceeding max walk velocity\n\t\t\t\tif(linear_vel.x < -WALK_MAX_VELOCITY):\n\t\t\t\t\tlinear_vel.x = -WALK_MAX_VELOCITY\n\t\t\t\t\n\t\telif (move_right and not move_left):\n\t\t\tCURR_DIR = DIR_RIGHT\n\t\t\tif (linear_vel.x < WALK_MAX_VELOCITY):\n\t\t\t\tlinear_vel.x += WALK_ACCEL*step\n\t\t\t\t# Prevent player from exceeding max walk velocity\n\t\t\t\tif(linear_vel.x > WALK_MAX_VELOCITY):\n\t\t\t\t\tlinear_vel.x = WALK_MAX_VELOCITY\n\t\telse:\n\t\t\tvar xv = abs(linear_vel.x)\n\t\t\txv -= WALK_DEACCEL*step\n\t\t\tif (xv < 0):\n\t\t\t\txv = 0\n\t\t\tlinear_vel.x = sign(linear_vel.x)*xv\n\t\n\t\t# If we can, and want to JUMP - Jump!\n\t\tif (!jumping && jump):\n\t\t\t# Set velocity upwards \n\t\t\tlinear_vel.y = -JUMP_VELOCITY\n\t\t\t\n\t\t\t# Notify code that we are jumping\n\t\t\tjumping = true\n\t\t\t\n\t\t\t# Play the player's jump sound\n\t\t\tif !get_node(\"sfx\").is_active():\n\t\t\t\tget_node(\"sfx\").play(\"flupp\")\n\t\t\t# THIS IS FOR FUTURE USE - Its a statistics thing for players to see like \"Hey you only jumped 20 times during the whole game...\"\n\t\t\t# Whatever use it is, i think its a fun element to talk about :D\n\t\t\t# I don't care often about the \"use\" of things... just having it for fun is good enough ;)\n\t\t\tglobal.times_jumped = global.times_jumped +1\n\t\t\t# print(global.times_jumped)\n\t\t\t\n\t\t\t# Achievement for jumping 50 times - Increased jump height\n\t\t\tif (global.times_jumped > 50):\n\t\t\t\tJUMP_VELOCITY = 550\n\t\t\t\t# print(\"Yay! You can now jump higher\")\n\t\t\t\t# TODO: Print an achievement notification message to the player\n\t\t\n\t\t\n\t\t# Check jumping\n\t\tif (jumping):\n\t\t\t# Set the next animation\n\t\t\tnew_anim = \"jumping\"\n\t\t\n\t\t# Handling an idle player\n\t\telif (abs(linear_vel.x) < 0.1): # Using a 0.1 padding for when we consider the player to be idle\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"idle_weapon\"\n\t\t\telse:\n\t\t\t\tnew_anim = \"idle\"\n\t\t\n\t\t# The player is moving (not jumping)\n\t\telse:\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"run_weapon\"\n\t\t\telse:\n\t\t\t\tnew_anim = \"run\"\n\telse:\n\t\t# Process logic when the character is in the air\n\t\t# When we are only pressing LEFT movement\n\t\tif (move_left && !move_right):\n\t\t\tCURR_DIR = DIR_LEFT\n\t\t\tif (linear_vel.x > -WALK_MAX_VELOCITY):\n\t\t\t\t# linear_vel.x = -WALK_MAX_VELOCITY\n\t\t\t\tlinear_vel.x -= AIR_ACCEL*step\n\t\t\t\tif(linear_vel.x < -WALK_MAX_VELOCITY):\n\t\t\t\t\tlinear_vel.x = -WALK_MAX_VELOCITY\n\t\t\t\t\n\t\telif (move_right && !move_left):\n\t\t\tCURR_DIR = DIR_RIGHT\n\t\t\tif (linear_vel.x < WALK_MAX_VELOCITY):\n\t\t\t\t# linear_vel.x = WALK_MAX_VELOCITY\n\t\t\t\tlinear_vel.x += AIR_ACCEL*step\n\t\t\t\tif(linear_vel.x > WALK_MAX_VELOCITY):\n\t\t\t\t\tlinear_vel.x = WALK_MAX_VELOCITY\n\t\telse:\n\t\t\t# Deaccelerate air movement (quickly for a smooth gameplay experience)\n\t\t\tvar x_vel = abs(linear_vel.x)\n\t\t\tx_vel -= AIR_DEACCEL*step\n\t\t\tif (x_vel < 0):\n\t\t\t\tx_vel = 0\n\t\t\tlinear_vel.x = sign(linear_vel.x)*x_vel\n\t\t\n\t\tif (linear_vel.y < 0):\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"jumping_weapon\"\n\t\t\telse:\n\t\t\t\tnew_anim = \"jumping\"\n\t\telse:\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"falling_weapon\"\n\t\t\t\n\t\t\telse:\n\t\t\t\tnew_anim = \"falling\"\n\t\n\t# A good idea when impementing characters of all kinds,\n\t# compensates for physics imprecission, as well as human reaction delay.\n\tif (shoot and not shooting):\n\t\tshoot_time = 0\n\t\tvar bi = bullet.instance()\n\t\tvar ss\n\t\t#if (CURR_DIR==DIR_LEFT):\n\t\t#\tss = -1.0\n\t\t#else:\n\t\t#\tss = 1.0\n\t\tvar pos = get_pos() + get_node(\"bullet_shoot\").get_pos()*CURR_DIR\n\t\t\n\t\tbi.set_pos(pos)\n\t\tget_parent().add_child(bi)\n\t\t\n\t\tbi.set_linear_velocity(Vector2(800.0*CURR_DIR.x, -80))\n\t\tget_node(\"sprite\/smoke\").set_emitting(true)\n\t\tget_node(\"sfx\").play(\"schwuit\")\n\t\tPS2D.body_add_collision_exception(bi.get_rid(), get_rid()) # Make bullet and this not collide\n\telse:\n\t\tshoot_time += step\n\t# Check siding direction\n\t#if (linear_vel.x < 0 && move_left):\n\t#\tnew_siding_left = true\n\t#elif (linear_vel.x > 0 && move_right):\n\t#\tnew_siding_left = false\n\t\t\n\t# Update siding\n\tif (LAST_DIR!=CURR_DIR):\n\t\tif (move_left):\n\t\t\tget_node(\"sprite\").set_scale(DIR_LEFT)\n\t\t\tLAST_DIR = DIR_LEFT\n\t\telif(move_right):\n\t\t\tget_node(\"sprite\").set_scale(DIR_RIGHT)\n\t\t\tLAST_DIR = DIR_RIGHT\n\t\n\t# Change animation\n\tif (new_anim != anim):\n\t\tanim = new_anim\n\t\tget_node(\"anim\").play(anim)\n\t\n\tshooting = shoot\n\t\n\t# Apply floor velocity\n\tif (found_floor):\n\t\tfloor_h_velocity = s.get_contact_collider_velocity_at_pos(floor_index).x\n\t\tlinear_vel.x += floor_h_velocity\n\t\n\t# Finally, apply gravity and set back the linear velocity\n\tlinear_vel += s.get_total_gravity()*step\n\ts.set_linear_velocity(linear_vel)\n\t\n\n\nfunc _ready():\n\tset_process(true)\n\tenemy = ResourceLoader.load(\"res:\/\/scenes\/scn3-forest\/enemy.tscn\")\n\t# Update play time, has to go into a global function at some point\nfunc _process(delta):\n\tglobal.time_elapsed += delta\n\t#print(global.time_elapsed)\n\tif global.time_elapsed >= int(global.playtime_limit_seconds):\n\t\t#print(\"Time elpased!\")\n\t\t#show(Popup)\n\t\tglobal.time_elapsed = 0\n\n\n#\tif !Globals.has_singleton(\"Facebook\"):\n#\t\treturn\n#\tvar Facebook = Globals.get_singleton(\"Facebook\")\n#\tvar link = Globals.get(\"facebook\/link\")\n#\tvar icon = Globals.get(\"facebook\/icon\")\n#\tvar msg = \"I just sneezed on your wall! Beat my score and Stop the Running nose!\"\n#\tvar title = \"I just sneezed on your wall!\"\n#\tFacebook.post(\"feed\", msg, title, link, icon)\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"GDScript"} {"commit":"5d63e6e5bc5c9cab761bfcb9d134bda331e8c706","subject":"bOss parts slowly regain health","message":"bOss parts slowly regain health\n","repos":"BK-TN\/IncendiumGame","old_file":"incendium\/scripts\/BossPart.gd","new_file":"incendium\/scripts\/BossPart.gd","new_contents":"\nextends Node2D\n\n# Set by Boss\nvar enabled\nvar rot_speed\nvar color\nvar max_health\nvar bullet_size\nvar bullet_count\nvar bullet_speed\nvar bullet_type\nvar shoot_interval\n# Health\nvar health\nvar health_fade = 0.0\n# Shooting\nvar bullet = preload(\"res:\/\/objects\/Bullet.tscn\")\nvar shoot_timer = 2\n# Misc\nvar last_pos\nvar velocity\nvar explosion = preload(\"res:\/\/objects\/Explosion.tscn\")\nvar scale = 0\n\nfunc _ready():\n\t# Called every time the node is added to the scene.\n\t# Initialization here\n\tset_process(true)\n\tif enabled:\n\t\tget_node(\"RegularPolygon\/Polygon2D\").set_color(color)\n\telse:\n\t\tget_node(\"RegularPolygon\/Polygon2D\").set_color(Color(0,0,0,0))\n\thealth = max_health\n\tlast_pos = get_global_pos()\n\t\n\tset_scale(Vector2(0,0))\n\t\nfunc _process(delta):\n\trotate(delta * rot_speed)\n\t\n\tif scale < 1:\n\t\tscale = min(1,lerp(scale,1,delta * 4))\n\t\tset_scale(Vector2(scale * scale, scale * scale))\n\t\n\tif health_fade > 0:\n\t\thealth_fade -= delta * 4\n\t\tif (health_fade < 0): health_fade = 0\n\t\tupdate()\n\t\n\tif health < max_health:\n\t\thealth += delta\n\t\tupdate()\n\t\n\tvelocity = get_global_pos() - last_pos\n\tlast_pos = get_global_pos()\n\t\n\tvar pos = get_global_pos()\n\t\n\tif enabled:\n\t\tshoot_timer -= delta\n\t\n\tif shoot_timer <= 0 and !any_active_child_parts():\n\t\tfor i in range(0,bullet_count):\n\t\t\tvar bullet_instance = bullet.instance()\n\t\t\t\n\t\t\t# Calculate bullet direction\n\t\t\tvar velocityAngle\n\t\t\tif velocity.x == 0 and velocity.y == 0:\n\t\t\t\t# Use rotation if no velocity\n\t\t\t\tvelocityAngle = get_rot() * 3\n\t\t\telse:\n\t\t\t\tvelocityAngle = atan2(velocity.y,velocity.x)\n\t\t\tvelocityAngle += (i \/ float(bullet_count)) * PI * 2\n\t\t\tvar bulletVelocity = Vector2(cos(velocityAngle),sin(velocityAngle)).normalized() * (bullet_speed)\n\t\t\t\n\t\t\tbullet_instance.type = bullet_type\n\t\t\tbullet_instance.velocity = bulletVelocity\n\t\t\tbullet_instance.get_node(\"RegularPolygon\/Polygon2D\").set_color(Color(1,1,1).linear_interpolate(color,0.4))\n\t\t\tbullet_instance.get_node(\"RegularPolygon\").size = bullet_size\n\t\t\tbullet_instance.get_node(\"RegularPolygon\").remove_from_group(\"damage_enemy\")\n\t\t\tbullet_instance.get_node(\"RegularPolygon\").add_to_group(\"damage_player\")\n\t\t\tbullet_instance.set_pos(get_global_pos())\n\t\t\tget_tree().get_root().add_child(bullet_instance)\n\t\t\t# var angle_towards_center = atan2(pos.x - 720\/2, pos.y - 720\/2)\n\t\t\tshoot_timer = shoot_interval # + (angle_towards_center * 0.4)\n\t\nfunc _on_RegularPolygon_area_enter(area):\n\tif area.get_groups().has(\"damage_enemy\") and !any_active_child_parts() and enabled:\n\t\tarea.get_parent().queue_free()\n\t\thealth -= 1\n\t\thealth_fade = 1.0\n\t\tif health <= 0:\n\t\t\tfor i in range(0,8):\n\t\t\t\tvar explosion_instance = explosion.instance()\n\t\t\t\texplosion_instance.get_node(\"RegularPolygon\").size = get_node(\"RegularPolygon\").size \/ 2\n\t\t\t\texplosion_instance.get_node(\"RegularPolygon\/Polygon2D\").set_color(color)\n\t\t\t\texplosion_instance.velocity = velocity * 100\n\t\t\t\tget_tree().get_root().add_child(explosion_instance)\n\t\t\t\texplosion_instance.set_global_pos(get_global_pos())\n\t\t\tqueue_free()\n\nfunc any_active_child_parts():\n\tfor child in get_children():\n\t\tif child.get(\"enabled\") == true:\n\t\t\treturn true\n\t\tif child.get(\"enabled\") == false:\n\t\t\tif child.any_active_child_parts():\n\t\t\t\treturn true\n\treturn false\n\nfunc _draw():\n\tif health < max_health: # if health_fade > 0: \n\t\tvar pgon = Vector2Array(get_node(\"RegularPolygon\/Polygon2D\").get_polygon())\n\t\tvar colors = Array()\n\t\tfor i in range(0,pgon.size()):\n\t\t\tpgon[i] = pgon[i] * (1.0 - float(health) \/ max_health)\n\t\t\tcolors.append(Color(1,1,1,lerp(0.5,1,health_fade)))\n\t\tdraw_polygon(pgon,colors)","old_contents":"\nextends Node2D\n\n# Set by Boss\nvar enabled\nvar rot_speed\nvar color\nvar max_health\nvar bullet_size\nvar bullet_count\nvar bullet_speed\nvar bullet_type\nvar shoot_interval\n# Health\nvar health\nvar health_fade = 0.0\n# Shooting\nvar bullet = preload(\"res:\/\/objects\/Bullet.tscn\")\nvar shoot_timer = 2\n# Misc\nvar last_pos\nvar velocity\nvar explosion = preload(\"res:\/\/objects\/Explosion.tscn\")\nvar scale = 0\n\nfunc _ready():\n\t# Called every time the node is added to the scene.\n\t# Initialization here\n\tset_process(true)\n\tif enabled:\n\t\tget_node(\"RegularPolygon\/Polygon2D\").set_color(color)\n\telse:\n\t\tget_node(\"RegularPolygon\/Polygon2D\").set_color(Color(0,0,0,0))\n\thealth = max_health\n\tlast_pos = get_global_pos()\n\t\n\tset_scale(Vector2(0,0))\n\t\nfunc _process(delta):\n\trotate(delta * rot_speed)\n\t\n\tif scale < 1:\n\t\tscale = min(1,lerp(scale,1,delta * 4))\n\t\tset_scale(Vector2(scale * scale, scale * scale))\n\t\n\tif health_fade > 0:\n\t\thealth_fade -= delta * 4\n\t\tif (health_fade < 0): health_fade = 0\n\t\tupdate()\n\t\n\tvelocity = get_global_pos() - last_pos\n\tlast_pos = get_global_pos()\n\t\n\tvar pos = get_global_pos()\n\t\n\tif enabled:\n\t\tshoot_timer -= delta\n\t\n\tif shoot_timer <= 0 and !any_active_child_parts():\n\t\tfor i in range(0,bullet_count):\n\t\t\tvar bullet_instance = bullet.instance()\n\t\t\t\n\t\t\t# Calculate bullet direction\n\t\t\tvar velocityAngle\n\t\t\tif velocity.x == 0 and velocity.y == 0:\n\t\t\t\t# Use rotation if no velocity\n\t\t\t\tvelocityAngle = get_rot() * 3\n\t\t\telse:\n\t\t\t\tvelocityAngle = atan2(velocity.y,velocity.x)\n\t\t\tvelocityAngle += (i \/ float(bullet_count)) * PI * 2\n\t\t\tvar bulletVelocity = Vector2(cos(velocityAngle),sin(velocityAngle)).normalized() * (bullet_speed)\n\t\t\t\n\t\t\tbullet_instance.type = bullet_type\n\t\t\tbullet_instance.velocity = bulletVelocity\n\t\t\tbullet_instance.get_node(\"RegularPolygon\/Polygon2D\").set_color(Color(1,1,1).linear_interpolate(color,0.4))\n\t\t\tbullet_instance.get_node(\"RegularPolygon\").size = bullet_size\n\t\t\tbullet_instance.get_node(\"RegularPolygon\").remove_from_group(\"damage_enemy\")\n\t\t\tbullet_instance.get_node(\"RegularPolygon\").add_to_group(\"damage_player\")\n\t\t\tbullet_instance.set_pos(get_global_pos())\n\t\t\tget_tree().get_root().add_child(bullet_instance)\n\t\t\t# var angle_towards_center = atan2(pos.x - 720\/2, pos.y - 720\/2)\n\t\t\tshoot_timer = shoot_interval # + (angle_towards_center * 0.4)\n\t\nfunc _on_RegularPolygon_area_enter(area):\n\tif area.get_groups().has(\"damage_enemy\") and !any_active_child_parts() and enabled:\n\t\tarea.get_parent().queue_free()\n\t\thealth -= 1\n\t\thealth_fade = 1.0\n\t\tif health <= 0:\n\t\t\tfor i in range(0,8):\n\t\t\t\tvar explosion_instance = explosion.instance()\n\t\t\t\texplosion_instance.get_node(\"RegularPolygon\").size = get_node(\"RegularPolygon\").size \/ 2\n\t\t\t\texplosion_instance.get_node(\"RegularPolygon\/Polygon2D\").set_color(color)\n\t\t\t\texplosion_instance.velocity = velocity * 100\n\t\t\t\tget_tree().get_root().add_child(explosion_instance)\n\t\t\t\texplosion_instance.set_global_pos(get_global_pos())\n\t\t\tqueue_free()\n\nfunc any_active_child_parts():\n\tfor child in get_children():\n\t\tif child.get(\"enabled\") == true:\n\t\t\treturn true\n\t\tif child.get(\"enabled\") == false:\n\t\t\tif child.any_active_child_parts():\n\t\t\t\treturn true\n\treturn false\n\nfunc _draw():\n\tif health < max_health: # if health_fade > 0: \n\t\tvar pgon = Vector2Array(get_node(\"RegularPolygon\/Polygon2D\").get_polygon())\n\t\tvar colors = Array()\n\t\tfor i in range(0,pgon.size()):\n\t\t\tpgon[i] = pgon[i] * (1.0 - float(health) \/ max_health)\n\t\t\tcolors.append(Color(1,1,1,lerp(0.5,1,health_fade)))\n\t\tdraw_polygon(pgon,colors)","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"78c7a48422702b9982e34e62d1e3715956d780a5","subject":"Re-write the 3d\/navmesh demo to be easier to follow","message":"Re-write the 3d\/navmesh demo to be easier to follow\n\nThe previous code had no comments and had some unintuitive steps.\nI've re-written and re-structured it, and added comments. Hopefully it\nwill be easier to follow for newcomers to Godot.\n\n * Re-write main methods\n * Various bugfixes (variable conflicts, edge cases)\n * Comment improvements\n * Whitespace fixes\n\nCo-authored-by: Aaron Franke \n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"3d\/navmesh\/navmesh.gd","new_file":"3d\/navmesh\/navmesh.gd","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"mit","lang":"GDScript"} {"commit":"de751ae15d19050e581a51b5d19a457951520f80","subject":"made static.","message":"made static.\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/DataManager.gd","new_file":"src\/scripts\/DataManager.gd","new_contents":"# Saves the config settings to a file.\nstatic func saveConfig( config ):\n\tvar file = File.new()\n\tfile.open( \"config.cfg\", File.WRITE )\n\n\tif file.is_open():\n\t\tfile.store_var( config.name )\n\t\tfile.store_var( config.soundvolume )\n\t\tfile.store_var( config.musicvolume )\n\t\tfile.store_var( config.portnumber )\n\t\tfile.close()\n\n# Loads the config settings from a file.\nstatic func loadConfig():\n\tvar file = File.new()\n\tfile.open( \"config.cfg\", File.READ )\n\n\tvar config = {}\n\n\tif file.is_open():\n\t\tconfig.name = file.get_var()\n\t\tconfig.soundvolume = file.get_var()\n\t\tconfig.musicvolume = file.get_var()\n\t\tconfig.portnumber = file.get_var()\n\t\tfile.close()\n\n\treturn config\n\n# Saves a puzzle to the file given.\nstatic func savePuzzle( name, puzzle ):\n\tprint( puzzle.puzzleName )\n\tvar file = File.new()\n\tfile.open( name, File.WRITE )\n\n\tvar di = puzzle.toDict()\n\n\tif file.is_open():\n\t\tfile.store_var( di )\n\t\tfile.close()\n\n# Loads a puzzle for the file given.\nstatic func loadPuzzle( name ):\n\tvar PuzzleManScript = preload( \"res:\/\/scripts\/PuzzleManager.gd\" )\n\n\tvar file = File.new()\n\tvar puzzleMan = PuzzleManScript.new()\n\tvar puzzle = puzzleMan.Puzzle.new()\n\tpuzzle.puzzleMan = puzzleMan\n\tfile.open( name, File.READ )\n\n\tif file.is_open():\n\t\tpuzzle.fromDict( file.get_var() )\n\t\tfile.close()\n\n\treturn puzzle\n","old_contents":"var PuzzleManScript = preload( \"res:\/\/scripts\/PuzzleManager.gd\" )\n\n# Saves the config settings to a file.\nfunc saveConfig( config ):\n\tvar file = File.new()\n\tfile.open( \"config.cfg\", File.WRITE )\n\t\n\tif file.is_open():\n\t\tfile.store_var( config.name )\n\t\tfile.store_var( config.soundvolume )\n\t\tfile.store_var( config.musicvolume )\n\t\tfile.store_var( config.portnumber )\n\t\tfile.close()\n\n# Loads the config settings from a file.\nfunc loadConfig():\n\tvar file = File.new()\n\tfile.open( \"config.cfg\", File.READ )\n\t\n\tvar config = {}\n\t\n\tif file.is_open():\n\t\tconfig.name = file.get_var()\n\t\tconfig.soundvolume = file.get_var()\n\t\tconfig.musicvolume = file.get_var()\n\t\tconfig.portnumber = file.get_var()\n\t\tfile.close()\n\t\t\n\treturn config\n\n# Saves a puzzle to the file given.\nfunc savePuzzle( name, puzzle ):\n\tprint( puzzle.puzzleName )\n\tvar file = File.new()\n\tfile.open( name, File.WRITE )\n\t\n\tvar di = puzzle.toDict()\n\t\n\tif file.is_open():\n\t\tfile.store_var( di )\n\t\tfile.close()\n\n# Loads a puzzle for the file given.\nfunc loadPuzzle( name ):\n\tvar file = File.new()\n\tvar puzzleMan = PuzzleManScript.new()\n\tvar puzzle = puzzleMan.Puzzle.new()\n\tpuzzle.puzzleMan = puzzleMan\n\tfile.open( name, File.READ )\n\t\n\tif file.is_open():\n\t\tpuzzle.fromDict( file.get_var() )\n\t\tfile.close()\n\t\n\treturn puzzle","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"a4da4abc03d404678ca407eddc208111960e5971","subject":"Reverted to is_action_pressed for older versions of godot.","message":"Reverted to is_action_pressed for older versions of godot.\n","repos":"NiclasEriksen\/godot_rpg","old_file":"scripts\/player_control.gd","new_file":"scripts\/player_control.gd","new_contents":"\nextends Node2D\n\n# member variables here, example:\n# var a=2\n# var b=\"textvar\"\n\nvar jump_cd = false\nsignal moved(pos)\nsignal jump\nsignal attack\nvar attacking = false\nvar sprinting = false\nvar vel = Vector2(0, 0)\nvar cur_vel = 0\nvar max_vel = 150\nvar sprint_factor = 1.5\nvar rot_spd = 5\nvar root = null\nvar anim = null\n\nfunc _ready():\n\tself.set_process(true)\n\tself.set_process_input(true)\n\troot = get_tree().get_root().get_node(\"Game\")\n\tanim = get_node(\"BodyAnimation\")\n\nfunc _draw():\n\tpass\n\nfunc _input(event):\n\tif event.is_action_pressed(\"MOVE_UP\"):\n\t\tvel.y = vel.y - max_vel\n\telif event.is_action_released(\"MOVE_UP\"):\n\t\tvel.y = vel.y + max_vel\n\tif event.is_action_pressed(\"MOVE_DOWN\"):\n\t\tvel.y = vel.y + max_vel\n\telif event.is_action_released(\"MOVE_DOWN\"):\n\t\tvel.y = vel.y - max_vel\n\tif event.is_action_pressed(\"MOVE_LEFT\"):\n\t\tvel.x = vel.x - max_vel\n\telif event.is_action_released(\"MOVE_LEFT\"):\n\t\tvel.x = vel.x + max_vel\n\tif event.is_action_pressed(\"MOVE_RIGHT\"):\n\t\tvel.x = vel.x + max_vel\n\telif event.is_action_released(\"MOVE_RIGHT\"):\n\t\tvel.x = vel.x - max_vel\n\nfunc _process(delta):\n\t# print(rand_range(0, 1))\n\t# vel = Vector2(0, 0)\n\t\n\n\tif Input.is_action_pressed(\"ATTACK\"):\n\t\tif not attacking:\n\t\t\temit_signal(\"attack\")\n\t\t\tattacking = true\n\telse:\n\t\tattacking = false\n\n\tif Input.is_action_pressed(\"MOVE_JUMP\"):\n\t\tself.jump()\n\t\n\tif root:\n\t\tvar r = get_angle_to(root.get_global_mouse_pos()) * (rot_spd * delta)\n\t\trotate(r)\n\n\tif Input.is_action_pressed(\"SPRINT\"):\n\t\tself.move_and_slide(vel * 75 * delta)\n\telse:\n\t\tself.move_and_slide(vel * 50 * delta)\n\n\tself.emit_signal(\"moved\", self.get_pos())\n\tif anim:\n\t\tif vel.x > 0.0 or vel.x < 0.0 or vel.y > 0.0 or vel.y < 0.0:\n\t\t\tif not anim.is_playing():\n\t\t\t\tanim.play(\"Walk\")\n\t\t\telse:\n\t\t\t\tif Input.is_action_pressed(\"SPRINT\"):\n\t\t\t\t\tanim.set_speed(sprint_factor)\n\t\t\t\telse:\n\t\t\t\t\tanim.set_speed(1)\n\t\t\t\t# print(\"Starting\")\n\t\telse:\n\t\t\tif anim.is_playing():\n\t\t\t\t# print(\"Stopping\")\n\t\t\t\tanim.stop(true)\n\t\t\n\nfunc jump():\n\tself.emit_signal(\"jump\")\n\tself.emit_signal(\"moved\", self.get_pos())\n","old_contents":"\nextends Node2D\n\n# member variables here, example:\n# var a=2\n# var b=\"textvar\"\n\nvar jump_cd = false\nsignal moved(pos)\nsignal jump\nsignal attack\nvar vel = Vector2(0, 0)\nvar cur_vel = 0\nvar max_vel = 150\nvar sprint_factor = 1.5\nvar rot_spd = 5\nvar root = null\nvar anim = null\n\nfunc _ready():\n\tself.set_process(true)\n\tself.set_process_input(true)\n\troot = get_tree().get_root().get_node(\"Game\")\n\tanim = get_node(\"BodyAnimation\")\n\nfunc _draw():\n\tpass\n\nfunc _input(event):\n\tif event.is_action_pressed(\"MOVE_UP\"):\n\t\tvel.y = vel.y - max_vel\n\telif event.is_action_released(\"MOVE_UP\"):\n\t\tvel.y = vel.y + max_vel\n\tif event.is_action_pressed(\"MOVE_DOWN\"):\n\t\tvel.y = vel.y + max_vel\n\telif event.is_action_released(\"MOVE_DOWN\"):\n\t\tvel.y = vel.y - max_vel\n\tif event.is_action_pressed(\"MOVE_LEFT\"):\n\t\tvel.x = vel.x - max_vel\n\telif event.is_action_released(\"MOVE_LEFT\"):\n\t\tvel.x = vel.x + max_vel\n\tif event.is_action_pressed(\"MOVE_RIGHT\"):\n\t\tvel.x = vel.x + max_vel\n\telif event.is_action_released(\"MOVE_RIGHT\"):\n\t\tvel.x = vel.x - max_vel\n\nfunc _process(delta):\n\t# print(rand_range(0, 1))\n\t# vel = Vector2(0, 0)\n\t\n\n\tif Input.is_action_just_pressed(\"ATTACK\"):\n\t\temit_signal(\"attack\")\n\n\tif Input.is_action_pressed(\"MOVE_JUMP\"):\n\t\tself.jump()\n\t\n\tif root:\n\t\tvar r = get_angle_to(root.get_global_mouse_pos()) * (rot_spd * delta)\n\t\trotate(r)\n\n\tif Input.is_action_pressed(\"SPRINT\"):\n\t\tself.move_and_slide(vel * 75 * delta)\n\telse:\n\t\tself.move_and_slide(vel * 50 * delta)\n\n\tself.emit_signal(\"moved\", self.get_pos())\n\tif anim:\n\t\tif vel.x > 0.0 or vel.x < 0.0 or vel.y > 0.0 or vel.y < 0.0:\n\t\t\tif not anim.is_playing():\n\t\t\t\tanim.play(\"Walk\")\n\t\t\telse:\n\t\t\t\tif Input.is_action_pressed(\"SPRINT\"):\n\t\t\t\t\tanim.set_speed(sprint_factor)\n\t\t\t\telse:\n\t\t\t\t\tanim.set_speed(1)\n\t\t\t\t# print(\"Starting\")\n\t\telse:\n\t\t\tif anim.is_playing():\n\t\t\t\t# print(\"Stopping\")\n\t\t\t\tanim.stop(true)\n\t\t\n\nfunc jump():\n\tself.emit_signal(\"jump\")\n\tself.emit_signal(\"moved\", self.get_pos())\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"b958d2855343e37c5771e64a8d378dc7e8f580af","subject":"improved layout","message":"improved layout\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/CameraControl.gd","new_file":"src\/scripts\/CameraControl.gd","new_contents":"# Make this work on touch:\n# catch InputEventScreenDrag, InputEventScreenTouch\n# write two-finger zoom\n\n\n# camera function that uses the mouse wheel to zoom\nextends Camera\n\n\n# global working variables\nvar turn = Vector2( 0.0, 0.0 ) # the amount the mouse has turned\nvar mouseposlast = Input.get_mouse_pos() # the mouses last position\nvar pos = Vector3(0.0,0.0,0.0) # the position of the camera\nvar up = Vector3(0.0,1.0,0.0) # the normalized 'up' vector pointing vertically\nvar target = Vector3(0.0,0.0,0.0) # the look at target\n\n\n# global tweakable parameters\nvar distance = { val = 16.0, max_ = 50, min_ = 15 }\nvar zoom_rate = 100 # the rate at which the camera zooms in and out of the target\nvar orbitrate = 20 # the rate the camera orbits the target when the mouse is moved\nvar target_move_rate = 1.0 # the rate the target look at point moves\n\n# Pause menu GUI item.\nvar pauseMenu\n\nfunc toMenu():\n\tvar menus = load( \"res:\/\/menus.scn\" ).instance()\n\tmenus.skipTitle(true)\n\tload(\"res:\/\/scripts\/GUIManager.gd\").goto_scene(get_tree(), [menus], true)\n\n\n# called once after node is setup\nfunc _ready():\n\tset_process_input(true) # process user input events here\n\t# Input.set_mouse_mode(2) # mouse mode captured\n\n\t# Setup the pause menu.\n\tpauseMenu = preload( \"res:\/\/dialog.scn\" ).instance()\n\tget_tree().get_root().add_child( pauseMenu )\n\tpauseMenu.hide()\n\n\tpauseMenu.get_label().set_autowrap(true)\n\n\tpauseMenu.set_pause_mode(PAUSE_MODE_PROCESS)\n\tpauseMenu.set_text(easter_eggs[randi() % easter_eggs.size()])\n\n\tpauseMenu.get_ok().connect(\"pressed\", self, \"toMenu\")\n\tpauseMenu.get_cancel().connect(\"pressed\", pauseMenu, \"hide\")\n\n\tpauseMenu.get_ok().set_text(\"Menu\")\n\tpauseMenu.get_cancel().set_text(\"Return to game\")\n\n\tpauseMenu.get_ok().set_pause_mode(PAUSE_MODE_PROCESS)\n\tpauseMenu.get_cancel().set_pause_mode(PAUSE_MODE_PROCESS)\n\n\t# pause when shown\n\tpauseMenu.connect(\"about_to_show\", self, \"preparePauseMenu\")\n\t# unpause when gone\n\tpauseMenu.connect(\"popup_hide\", get_tree(), \"set_pause\", [false])\n\tpauseMenu.connect(\"hide\", get_tree(), \"set_pause\", [false])\n\nconst easter_eggs = [\"There are no cheat codes for this game\", \"Get as much sleep as you can\",\n\t \"Get out while you still can\",\n\t \"You are one of a kind, to a certain extent\",\n\t \"All block abusers report to the incinarator\",\n\t \"learnyouahaskell.com good for you, promise\",\n\t \"When storing carrots, take them out of the plastic packaging and wrap them in paper towels. They will last weeks longer. -- junta12\"\n\t ]\n\nfunc preparePauseMenu(arg0=null, arg1=null, arg2=null):\n\tpauseMenu.set_text(easter_eggs[randi() % easter_eggs.size()])\n\tget_tree().set_pause(true)\n\n\n# Repositions the camera based on the zoom level.\nfunc recalculate_camera():\n\tpos = get_translation();\n\tpos.z = distance.val;\n\tset_translation( pos )\n\n\n# called to handle a user input event\nfunc _input(ev):\n # if the user spins the mouse wheel up move the camera closer\n\tif (ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_WHEEL_UP):\n\t\tif (distance.val > distance.min_):\n\t\t\tdistance.val -= zoom_rate * get_process_delta_time()\n # if the user spins the mouse wheel down move the camera farther away\n\telif (ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_WHEEL_DOWN):\n\t\tif (distance.val < distance.max_):\n\t\t\tdistance.val += zoom_rate * get_process_delta_time()\n # if a cancel action is input close the application\n\telif (ev.is_action(\"ui_cancel\")):\n\t\t#OS.get_main_loop().quit()\n\t\tpauseMenu.popup_centered()\n\telse:\n\t\treturn\n\n\trecalculate_camera()\n","old_contents":"# Make this work on touch:\n# catch InputEventScreenDrag, InputEventScreenTouch\n# write two-finger zoom\n\n\n# camera function that uses the mouse wheel to zoom\nextends Camera\n\n\n# global working variables\nvar turn = Vector2( 0.0, 0.0 ) # the amount the mouse has turned\nvar mouseposlast = Input.get_mouse_pos() # the mouses last position\nvar pos = Vector3(0.0,0.0,0.0) # the position of the camera\nvar up = Vector3(0.0,1.0,0.0) # the normalized 'up' vector pointing vertically\nvar target = Vector3(0.0,0.0,0.0) # the look at target\n\n\n# global tweakable parameters\nvar distance = { val = 16.0, max_ = 50, min_ = 15 }\nvar zoom_rate = 100 # the rate at which the camera zooms in and out of the target\nvar orbitrate = 20 # the rate the camera orbits the target when the mouse is moved\nvar target_move_rate = 1.0 # the rate the target look at point moves\n\n# Pause menu GUI item.\nvar pauseMenu\n\nfunc toMenu():\n\tvar menus = load( \"res:\/\/menus.scn\" ).instance()\n\tmenus.skipTitle(true)\n\tload(\"res:\/\/scripts\/GUIManager.gd\").goto_scene(get_tree(), [menus], true)\n\n\n# called once after node is setup\nfunc _ready():\n\tset_process_input(true) # process user input events here\n\t# Input.set_mouse_mode(2) # mouse mode captured\n\n\t# Setup the pause menu.\n\tpauseMenu = preload( \"res:\/\/dialog.scn\" ).instance()\n\tget_tree().get_root().add_child( pauseMenu )\n\tpauseMenu.hide()\n\n\tpauseMenu.set_pause_mode(PAUSE_MODE_PROCESS)\n\tpauseMenu.set_text(\"PAUSE\")\n\n\tpauseMenu.get_ok().connect(\"pressed\", self, \"toMenu\")\n\tpauseMenu.get_cancel().connect(\"pressed\", pauseMenu, \"hide\")\n\n\tpauseMenu.get_ok().set_text(\"Menu\")\n\tpauseMenu.get_cancel().set_text(\"Return to game\")\n\n\tpauseMenu.get_ok().set_pause_mode(PAUSE_MODE_PROCESS)\n\tpauseMenu.get_cancel().set_pause_mode(PAUSE_MODE_PROCESS)\n\n\t# pause when shown\n\tpauseMenu.connect(\"about_to_show\", get_tree(), \"set_pause\", [true])\n\t# unpause when gone\n\tpauseMenu.connect(\"popup_hide\", get_tree(), \"set_pause\", [false])\n\tpauseMenu.connect(\"hide\", get_tree(), \"set_pause\", [false])\n\n\n# Repositions the camera based on the zoom level.\nfunc recalculate_camera():\n\tpos = get_translation();\n\tpos.z = distance.val;\n\tset_translation( pos )\n\n\n# called to handle a user input event\nfunc _input(ev):\n # if the user spins the mouse wheel up move the camera closer\n\tif (ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_WHEEL_UP):\n\t\tif (distance.val > distance.min_):\n\t\t\tdistance.val -= zoom_rate * get_process_delta_time()\n # if the user spins the mouse wheel down move the camera farther away\n\telif (ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_WHEEL_DOWN):\n\t\tif (distance.val < distance.max_):\n\t\t\tdistance.val += zoom_rate * get_process_delta_time()\n # if a cancel action is input close the application\n\telif (ev.is_action(\"ui_cancel\")):\n\t\t#OS.get_main_loop().quit()\n\t\tpauseMenu.popup_centered()\n\telse:\n\t\treturn\n\n\trecalculate_camera()\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"9201c85566d7e6d1565623299f85b3d098836206","subject":"less buggy and debuggy","message":"less buggy and debuggy\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Blocks\/AbstractBlock.gd","new_file":"src\/scripts\/Blocks\/AbstractBlock.gd","new_contents":"\nextends RigidBody\n\nvar name_int\nvar name\nvar pairName\nvar selected = false\nvar blockPos\nvar blockLayer\nvar blockType\nconst far_away_corner = Vector3(110, 110, 110)\n\nvar editor\n\nstatic func nameToNodeName(n):\n\treturn \"block\" + str(n)\n\nfunc setName(n):\n\tname_int = n\n\tname = nameToNodeName(n)\n\tset_name(nameToNodeName(n))\n\treturn self\n\nfunc setPairName(n):\n\tpairName = nameToNodeName(n)\n\treturn self\n\nfunc setBlockLayer(n):\n\tblockLayer = n\n\treturn self\n\nfunc getBlockLayer():\n\treturn blockLayer\n\nfunc setBlockType( blockT ):\n\tblockType = blockT\n\treturn self\n\nfunc getBlockType():\n\treturn blockType\n\nfunc setSelected(sel):\n\tselected = sel\n\treturn self\n\nfunc forceClick():\n\tactivate()\n\tget_parent().clickBlock( name )\n\nfunc addNeighbor(editor, click_normal):\n\tvar t = get_parent().get_parent().get_transform().inverse()\n\tvar b = editor.newPickledBlock().setBlockPos(blockPos + t * click_normal)\n\tget_parent().add_block(b.toNode())\n\n\n# catch clicks\/taps\nfunc _input_event( camera, ev, click_pos, click_normal, shape_idx ):\n\tif ((ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT)\n\tor (ev.type==InputEvent.SCREEN_TOUCH)):\n\t\tif (get_parent().get_parent().active and ev.is_pressed()):\n\t\t\tif editor != null:\n\t\t\t\tif editor.shouldAddNeighbor():\n\t\t\t\t\taddNeighbor(editor, click_normal)\n\t\t\t\tif editor.shouldReplaceSelf():\n\t\t\t\t\tremove_with_pop(self, null)\n\t\t\t\t\taddNeighbor(editor, 0 * click_normal)\n\t\t\t\tif editor.shouldRemoveSelf():\n\t\t\t\t\tremove_with_pop(self, null)\n\t\t\telse:\n\t\t\t\tforceClick()\n\n# returns this block's pairNode or null\nfunc pairActivate():\n\tselected = true\n\n\t# is my pair Nil?\n\tif pairName == null or get_parent() == null or not get_parent().has_node(pairName):\n\t\tscaleTweenNode(0.9, 0.2, Tween.TRANS_EXPO).start()\n\t\treturn null\n\n\t# get my pair node\n\tvar pairNode = get_parent().get_node(pairName)\n\n\t# enlarge if the other guy's unselected\n\tif not pairNode.selected:\n\t\tscaleTweenNode(1.1, 0.2, Tween.TRANS_EXPO).start()\n\treturn pairNode\n\n\n# returns a tween node that uniformly changes the object's scale\n# call start() on the returned object\nfunc scaleTweenNode(scale, time=1, transType=Tween.TRANS_BOUNCE):\n\tvar tweenNode = newTweenNode()\n\ttweenNode.interpolate_method( self, \"set_scale\", \\\n\t\tself.get_scale(), Vector3(scale, scale, scale), \\\n\t\ttime, transType, Tween.EASE_OUT )\n\n\treturn tweenNode\n\n# adds a tween transition node to the tree\nfunc newTweenNode():\n\tvar tween = Tween.new()\n\tadd_child(tween)\n\treturn tween\n\nfunc remove_with_pop(node, key):\n\tget_parent().samplePlayer.play(\"deraj_pop_sound\")\n\tget_parent().remove_block(self)\n\nfunc _ready():\n\teditor = get_tree().get_root().get_node(\"EditorSpatial\")\n\tset_ray_pickable(true)\n","old_contents":"\nextends RigidBody\n\nvar name_int\nvar name\nvar pairName\nvar selected = false\nvar blockPos\nvar blockLayer\nvar blockType\nconst far_away_corner = Vector3(110, 110, 110)\n\nvar editor\n\nstatic func nameToNodeName(n):\n\treturn \"block\" + str(n)\n\nfunc setName(n):\n\tname_int = n\n\tname = nameToNodeName(n)\n\tset_name(nameToNodeName(n))\n\treturn self\n\nfunc setPairName(n):\n\tpairName = nameToNodeName(n)\n\treturn self\n\nfunc setBlockLayer(n):\n\tblockLayer = n\n\treturn self\n\nfunc getBlockLayer():\n\treturn blockLayer\n\nfunc setBlockType( blockT ):\n\tblockType = blockT\n\treturn self\n\nfunc getBlockType():\n\treturn blockType\n\nfunc setSelected(sel):\n\tselected = sel\n\treturn self\n\nfunc forceClick():\n\tactivate()\n\tget_parent().clickBlock( name )\n\nfunc addNeighbor(editor, click_normal):\n\tvar t = get_parent().get_parent().get_transform().inverse()\n\tvar b = editor.newPickledBlock().setBlockPos(blockPos + t * click_normal)\n\tget_parent().add_block(b.toNode())\n\n\n# catch clicks\/taps\nfunc _input_event( camera, ev, click_pos, click_normal, shape_idx ):\n\tif ((ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT)\n\tor (ev.type==InputEvent.SCREEN_TOUCH)):\n\t\tif (get_parent().get_parent().active and ev.is_pressed()):\n\t\t\tprint(editor)\n\t\t\tif editor != null:\n\t\t\t\tif editor.shouldAddNeighbor():\n\t\t\t\t\taddNeighbor(editor, click_normal)\n\t\t\t\tif editor.shouldReplaceSelf():\n\t\t\t\t\taddNeighbor(editor, 0 * click_normal)\n\t\t\t\tif editor.shouldRemoveSelf():\n\t\t\t\t\tremove_with_pop(self, null)\n\t\t\telse:\n\t\t\t\tforceClick()\n\n# returns this block's pairNode or null\nfunc pairActivate():\n\tselected = true\n\n\t# is my pair Nil?\n\tif pairName == null or get_parent() == null or not get_parent().has_node(pairName):\n\t\tscaleTweenNode(0.9, 0.2, Tween.TRANS_EXPO).start()\n\t\treturn null\n\n\t# get my pair node\n\tvar pairNode = get_parent().get_node(pairName)\n\n\t# enlarge if the other guy's unselected\n\tif not pairNode.selected:\n\t\tscaleTweenNode(1.1, 0.2, Tween.TRANS_EXPO).start()\n\treturn pairNode\n\n\n# returns a tween node that uniformly changes the object's scale\n# call start() on the returned object\nfunc scaleTweenNode(scale, time=1, transType=Tween.TRANS_BOUNCE):\n\tvar tweenNode = newTweenNode()\n\ttweenNode.interpolate_method( self, \"set_scale\", \\\n\t\tself.get_scale(), Vector3(scale, scale, scale), \\\n\t\ttime, transType, Tween.EASE_OUT )\n\n\treturn tweenNode\n\n# adds a tween transition node to the tree\nfunc newTweenNode():\n\tvar tween = Tween.new()\n\tadd_child(tween)\n\treturn tween\n\nfunc remove_with_pop(node, key):\n\tget_parent().samplePlayer.play(\"deraj_pop_sound\")\n\tget_parent().remove_block(self)\n\nfunc _ready():\n\teditor = get_tree().get_root().get_node(\"EditorSpatial\")\n\tset_ray_pickable(true)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"aa6baa277cd8f28056c2ef7927d500f83999faa2","subject":"pause title now returns to menu. Camera no longer in charge of adding puzzle.scn","message":"pause title now returns to menu. Camera no longer in charge of adding puzzle.scn\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/CameraControl.gd","new_file":"src\/scripts\/CameraControl.gd","new_contents":"# Make this work on touch:\n# catch InputEventScreenDrag, InputEventScreenTouch\n# write two-finger zoom\n\n\n# camera function that uses the mouse wheel to zoom\nextends Camera\n\n\n# global working variables\nvar turn = Vector2( 0.0, 0.0 ) # the amount the mouse has turned\nvar mouseposlast = Input.get_mouse_pos() # the mouses last position\nvar pos = Vector3(0.0,0.0,0.0) # the position of the camera\nvar up = Vector3(0.0,1.0,0.0) # the normalized 'up' vector pointing vertically\nvar target = Vector3(0.0,0.0,0.0) # the look at target\n\n\n# global tweakable parameters\nvar distance = { val = 16.0, max_ = 50, min_ = 15 }\nvar zoom_rate = 100 # the rate at which the camera zooms in and out of the target\nvar orbitrate = 20 # the rate the camera orbits the target when the mouse is moved\nvar target_move_rate = 1.0 # the rate the target look at point moves\n\n# Pause menu GUI item.\nvar pauseMenu\n\nfunc toMenu():\n\tvar root = get_tree().get_root()\n\tvar menus = preload( \"res:\/\/menus.scn\" ).instance()\n\tmenus.skipTitle(true)\n\tfor child in root.get_children():\n\t\tchild.queue_free()\n\troot.add_child(menus)\n\n# called once after node is setup\nfunc _ready():\n\tset_process_input(true) # process user input events here\n\t# Input.set_mouse_mode(2) # mouse mode captured\n\n\t# Setup the pause menu.\n\tpauseMenu = preload( \"res:\/\/dialog.scn\" ).instance()\n\tget_tree().get_root().add_child( pauseMenu )\n\tpauseMenu.hide()\n\n\tpauseMenu.set_pause_mode(PAUSE_MODE_PROCESS)\n\tpauseMenu.set_text(\"PAUSE\")\n\n\tpauseMenu.get_ok().connect(\"pressed\", self, \"toMenu\")\n\tpauseMenu.get_cancel().connect(\"pressed\", pauseMenu, \"hide\")\n\n\tpauseMenu.get_ok().set_text(\"Menu\")\n\tpauseMenu.get_cancel().set_text(\"Return to game\")\n\n\tpauseMenu.get_ok().set_pause_mode(PAUSE_MODE_PROCESS)\n\tpauseMenu.get_cancel().set_pause_mode(PAUSE_MODE_PROCESS)\n\n\t# pause when shown\n\tpauseMenu.connect(\"about_to_show\", get_tree(), \"set_pause\", [true])\n\t# unpause when gone\n\tpauseMenu.connect(\"popup_hide\", get_tree(), \"set_pause\", [false])\n\tpauseMenu.connect(\"hide\", get_tree(), \"set_pause\", [false])\n\n\n# Repositions the camera based on the zoom level.\nfunc recalculate_camera():\n\tpos = get_translation();\n\tpos.z = distance.val;\n\tset_translation( pos )\n\n\n# called to handle a user input event\nfunc _input(ev):\n # if the user spins the mouse wheel up move the camera closer\n\tif (ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_WHEEL_UP):\n\t\tif (distance.val > distance.min_):\n\t\t\tdistance.val -= zoom_rate * get_process_delta_time()\n # if the user spins the mouse wheel down move the camera farther away\n\telif (ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_WHEEL_DOWN):\n\t\tif (distance.val < distance.max_):\n\t\t\tdistance.val += zoom_rate * get_process_delta_time()\n # if a cancel action is input close the application\n\telif (ev.is_action(\"ui_cancel\")):\n\t\t#OS.get_main_loop().quit()\n\t\tpauseMenu.popup_centered()\n\telse:\n\t\treturn\n\n\trecalculate_camera()\n","old_contents":"# Make this work on touch:\n# catch InputEventScreenDrag, InputEventScreenTouch\n# write two-finger zoom\n\n# camera function that uses the mouse wheel to zoom\nextends Camera\n\n\n# global working variables\nvar turn = Vector2( 0.0, 0.0 ) # the amount the mouse has turned\nvar mouseposlast = Input.get_mouse_pos() # the mouses last position\nvar pos = Vector3(0.0,0.0,0.0) # the position of the camera\nvar up = Vector3(0.0,1.0,0.0) # the normalized 'up' vector pointing vertically\nvar target = Vector3(0.0,0.0,0.0) # the look at target\n\n\n# global tweakable parameters\nvar distance = { val = 16.0, max_ = 50, min_ = 15 }\nvar zoom_rate = 100 # the rate at which the camera zooms in and out of the target\nvar orbitrate = 20 # the rate the camera orbits the target when the mouse is moved\nvar target_move_rate = 1.0 # the rate the target look at point moves\n\n# Pause menu GUI item.\nvar pauseMenu\n\n# called once after node is setup\nfunc _ready():\n\tset_process_input(true) # process user input events here\n\t# Input.set_mouse_mode(2) # mouse mode captured\n\n\t# Setup the pause menu.\n\tpauseMenu = preload( \"res:\/\/dialog.scn\" ).instance()\n\tget_tree().get_root().add_child( pauseMenu )\n\tpauseMenu.hide()\n\n\tpauseMenu.set_pause_mode(PAUSE_MODE_PROCESS)\n\tpauseMenu.set_text(\"PAUSE. QUIT? CANCEL TO RETURN TO GAME.\\nSCORE:12101239\\nSteps taken:9001\")\n\n\tpauseMenu.get_ok().connect(\"pressed\", OS.get_main_loop(), \"quit\")\n\tpauseMenu.get_cancel().connect(\"pressed\", pauseMenu, \"hide\")\n\n\tpauseMenu.get_ok().set_text(\"Quit\")\n\tpauseMenu.get_cancel().set_text(\"Return to game\")\n\n\tpauseMenu.get_ok().set_pause_mode(PAUSE_MODE_PROCESS)\n\tpauseMenu.get_cancel().set_pause_mode(PAUSE_MODE_PROCESS)\n\n\t# pause when shown\n\tpauseMenu.connect(\"about_to_show\", get_tree(), \"set_pause\", [true])\n\t# unpause when gone\n\tpauseMenu.connect(\"popup_hide\", get_tree(), \"set_pause\", [false])\n\tpauseMenu.connect(\"hide\", get_tree(), \"set_pause\", [false])\n\n\n\t# Add the puzzle.\n\tget_tree().get_root().add_child( preload( \"res:\/\/puzzle.scn\" ).instance() )\n\tprint( get_parent() )\n\n# Repositions the camera based on the zoom level.\nfunc recalculate_camera():\n\tpos = get_translation();\n\tpos.z = distance.val;\n\tset_translation( pos )\n\n\n# called to handle a user input event\nfunc _input(ev):\n # if the user spins the mouse wheel up move the camera closer\n\tif (ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_WHEEL_UP):\n\t\tif (distance.val > distance.min_):\n\t\t\tdistance.val -= zoom_rate * get_process_delta_time()\n # if the user spins the mouse wheel down move the camera farther away\n\telif (ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_WHEEL_DOWN):\n\t\tif (distance.val < distance.max_):\n\t\t\tdistance.val += zoom_rate * get_process_delta_time()\n # if a cancel action is input close the application\n\telif (ev.is_action(\"ui_cancel\")):\n\t\t#OS.get_main_loop().quit()\n\t\tpauseMenu.popup_centered()\n\telse:\n\t\treturn\n\n\trecalculate_camera()\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"e5f7ccbb24589cb7af76fab75aced1282a5e66f2","subject":"Implement Mask Dash ability.","message":"Implement Mask Dash ability.\n","repos":"CSaratakij\/jam-2016-remake","old_file":"src\/player\/player.gd","new_file":"src\/player\/player.gd","new_contents":"\nextends KinematicBody2D\n\nconst mask_types = preload(\"res:\/\/mask\/mask.gd\").types\nconst totem_minimum_interval = preload(\"res:\/\/spawner\/totem_spawner.gd\").MIN_STEP\nconst GRAVITY = 980.0\nconst MOVE_SPEED = 240.0\nconst DASH_SPEED = 900.0\nconst JUMP_FORCE = 230.0\nconst POINT = 1\nconst INIT_MOVE_DIRECTION = Vector2(1, 1)\n\nvar score = 0\nvar _velocity = Vector2()\nvar _motion = Vector2()\nvar is_grounded = false\nvar _move_direction = INIT_MOVE_DIRECTION\nvar current_floor = 1\nvar current_mask = \"\"\nvar current_using_mask = \"\"\nvar using_mask_pos = Vector2()\nvar start_points = [\n\t\tMatrix32(0.0, Vector2(0, 80)),\n\t\tMatrix32(0.0, Vector2(715, 220)),\n\t\tMatrix32(0.0, Vector2(0, 360))\n\t]\nvar is_activate_mask = false\nvar is_using_mask = false\nvar total_released_jump = 0\n\nonready var tree = get_tree()\nonready var root = tree.get_root()\nonready var global = root.get_node(\"\/root\/global\")\nonready var _sprite = get_node(\"Sprite\")\nonready var _raycast = get_node(\"RayCast2D\")\nonready var _health = get_node(\"health\")\nonready var _sound_player = {\n\t\"player\" : get_node(\"SamplePlayer\/Player\"),\n\t\"item\" : get_node(\"SamplePlayer\/Item\")\n}\nonready var _timer = get_node(\"Timer\")\n\nfunc _ready():\n\tset_process(true)\n\tset_process_input(true)\n\tset_fixed_process(true)\n\nfunc _input(event):\n\tif event.type == InputEvent.MOUSE_BUTTON:\n\t\tis_activate_mask = event.doubleclick\n\telse:\n\t\tif event.is_action_pressed(\"jump\"):\n\t\t\tif _timer.get_time_left() == 0:\n\t\t\t\t_timer.start()\n\t\tif event.is_action_released(\"jump\"):\n\t\t\ttotal_released_jump += 1\n\t\t\tif total_released_jump == 2:\n\t\t\t\tis_activate_mask = _timer.get_time_left() != 0\n\t\t\t\t_timer.stop()\n\t\t\t\ttotal_released_jump = 0\n\nfunc _process(delta):\n\tif global.is_game_over():\n\t\t_sprite.hide()\n\telse:\n\t\t_sprite.show()\n\nfunc _fixed_process(delta):\n\tif _health.is_alive():\n\t\tif not global.is_game_over():\n\t\t\tif is_activate_mask:\n\t\t\t\tusing_mask_pos = get_global_pos()\n\t\t\t\tcurrent_using_mask = current_mask\n\t\t\t\tcurrent_mask = \"\"\n\t\t\t\tis_using_mask = true\n\t\t\t\tis_activate_mask = false\n\t\t\tif is_using_mask and not current_using_mask == \"\":\n\t\t\t\tif current_using_mask == mask_types[0]:\n\t\t\t\t\t_velocity.y = 0.0\n\t\t\t\t\t_velocity.x = DASH_SPEED * _move_direction.x\n\t\t\t\t\tif abs(get_global_pos().distance_to(using_mask_pos)) > totem_minimum_interval * 1.5:\n\t\t\t\t\t\tcurrent_using_mask = \"\"\n\t\t\t\t\t\tis_using_mask = false\n\t\t\t\telif current_using_mask == mask_types[1]:\n\t\t\t\t\tcurrent_using_mask = \"\"\n\t\t\t\t\tis_using_mask = false\n\t\t\telse:\n\t\t\t\tis_grounded = _raycast.is_colliding()\n\t\t\t\t_velocity.y += _move_direction.y * GRAVITY * delta\n\t\t\t\t_velocity.x = _move_direction.x * MOVE_SPEED\n\t\t\t\tif is_grounded:\n\t\t\t\t\tif Input.is_action_pressed(\"jump\"):\n\t\t\t\t\t\t_velocity.y = -JUMP_FORCE\n\t\t\t\t\t\t_sound_player[ \"player\" ].play(\"jump\")\n\t\telse:\n\t\t\t_velocity = Vector2(0, 0)\n\t\t\n\t\t_motion = _velocity * delta\n\t\t_motion = move(_motion)\n\t\n\t\tif is_colliding():\n\t\t\tvar n = get_collision_normal()\n\t\t\t_motion = n.slide(_motion)\n\t\t\t_velocity = n.slide(_velocity)\n\t\t\tmove(_motion)\n\nfunc get_current_floor():\n\treturn current_floor\n\nfunc get_current_mask():\n\treturn current_mask\n\nfunc change_move_direction_h():\n\t_move_direction.x *= -1\n\nfunc reset_move_direction():\n\t_move_direction = INIT_MOVE_DIRECTION\n\nfunc _on_Area2D_area_enter( area ):\n\tvar areas = area.get_groups()\n\tif areas.has(\"switch_side_trigger\"):\n\t\tglobal.add_score(POINT)\n\t\tcurrent_using_mask = \"\"\n\t\tis_using_mask = false\n\t\tif area.get_name() == \"floor1-2\":\n\t\t\tcurrent_floor = 2\n\t\t\tchange_move_direction_h()\n\t\t\t_sprite.set_flip_h(true)\n\t\telif area.get_name() == \"floor2-3\":\n\t\t\tcurrent_floor = 3\n\t\t\tchange_move_direction_h()\n\t\t\t_sprite.set_flip_h(false)\n\t\telif area.get_name() == \"floor3-1\":\n\t\t\tcurrent_floor = 1\n\t\tset_transform(start_points[current_floor - 1])\n\telif areas.has(\"health\"):\n\t\t_health.restore(1)\n\t\t_sound_player[ \"item\" ].play(\"item\")\n\t\tarea.hide()\n\t\tarea.set_global_pos(area.get_parent().get_global_pos())\n\t\t\n\telif areas.has(\"mask\"):\n\t\tcurrent_mask = area.get_type()\n\t\t_sound_player[ \"item\" ].play(\"bonus\")\n\t\tarea.hide()\n\t\tarea.set_global_pos(area.get_parent().get_global_pos())\n\nfunc _on_Area2D_body_enter( body ):\n\tvar groups = body.get_groups()\n\tif groups.has(\"totem\"):\n\t\t_health.remove(1)\n\t\t_sound_player[ \"player\" ].play(\"hit\")\n\t\tset_transform(start_points[current_floor - 1])\n","old_contents":"\nextends KinematicBody2D\n\nconst mask_types = preload(\"res:\/\/mask\/mask.gd\").types\nconst GRAVITY = 980.0\nconst MOVE_SPEED = 240.0\nconst JUMP_FORCE = 230.0\nconst POINT = 1\nconst INIT_MOVE_DIRECTION = Vector2(1, 1)\n\nvar score = 0\nvar _velocity = Vector2()\nvar _motion = Vector2()\nvar is_grounded = false\nvar _move_direction = INIT_MOVE_DIRECTION\nvar current_floor = 1\nvar current_mask = \"\"\nvar start_points = [\n\t\tMatrix32(0.0, Vector2(0, 80)),\n\t\tMatrix32(0.0, Vector2(715, 220)),\n\t\tMatrix32(0.0, Vector2(0, 360))\n\t]\nvar is_activate_mask = false\nvar total_released_jump = 0\n\nonready var tree = get_tree()\nonready var root = tree.get_root()\nonready var global = root.get_node(\"\/root\/global\")\nonready var _sprite = get_node(\"Sprite\")\nonready var _raycast = get_node(\"RayCast2D\")\nonready var _health = get_node(\"health\")\nonready var _sound_player = {\n\t\"player\" : get_node(\"SamplePlayer\/Player\"),\n\t\"item\" : get_node(\"SamplePlayer\/Item\")\n}\nonready var _timer = get_node(\"Timer\")\n\nfunc _ready():\n\tset_process(true)\n\tset_process_input(true)\n\tset_fixed_process(true)\n\nfunc _input(event):\n\tif event.type == InputEvent.MOUSE_BUTTON:\n\t\tis_activate_mask = event.doubleclick\n\telse:\n\t\tif event.is_action_pressed(\"jump\"):\n\t\t\tif _timer.get_time_left() == 0:\n\t\t\t\t_timer.start()\n\t\tif event.is_action_released(\"jump\"):\n\t\t\ttotal_released_jump += 1\n\t\t\tif total_released_jump == 2:\n\t\t\t\tis_activate_mask = _timer.get_time_left() != 0\n\t\t\t\t_timer.stop()\n\t\t\t\ttotal_released_jump = 0\n\nfunc _process(delta):\n\tif global.is_game_over():\n\t\t_sprite.hide()\n\telse:\n\t\t_sprite.show()\n\nfunc _fixed_process(delta):\n\tif _health.is_alive():\n\t\tis_grounded = _raycast.is_colliding()\n\t\t_velocity.y += _move_direction.y * GRAVITY * delta\n\t\n\t\tif not global.is_game_over():\n\t\t\t_velocity.x = _move_direction.x * MOVE_SPEED\n\t\telse:\n\t\t\t_velocity.x = 0.0\n\t\t\n\t\tif is_grounded:\n\t\t\tif Input.is_action_pressed(\"jump\"):\n\t\t\t\t_velocity.y = -JUMP_FORCE\n\t\t\t\t_sound_player[ \"player\" ].play(\"jump\")\n\t\t\n\t\tif is_activate_mask:\n\t\t\tif current_mask == mask_types[0]:\n\t\t\t\t_velocity.y = 0.0\n\t\t\t\t_velocity.x += 600 * _move_direction.x\n\t\t\t\tpass\n\t\t\telif current_mask == mask_types[1]:\n\t\t\t\tpass\n\t\t\tcurrent_mask = \"\"\n\t\t\tis_activate_mask = false\n\t\t\n\t\t_motion = _velocity * delta\n\t\t_motion = move(_motion)\n\t\n\t\tif is_colliding():\n\t\t\tvar n = get_collision_normal()\n\t\t\t_motion = n.slide(_motion)\n\t\t\t_velocity = n.slide(_velocity)\n\t\t\tmove(_motion)\n\nfunc get_current_floor():\n\treturn current_floor\n\nfunc get_current_mask():\n\treturn current_mask\n\nfunc change_move_direction_h():\n\t_move_direction.x *= -1\n\nfunc reset_move_direction():\n\t_move_direction = INIT_MOVE_DIRECTION\n\nfunc _on_Area2D_area_enter( area ):\n\tvar areas = area.get_groups()\n\tif areas.has(\"switch_side_trigger\"):\n\t\tglobal.add_score(POINT)\n\t\tif area.get_name() == \"floor1-2\":\n\t\t\tcurrent_floor = 2\n\t\t\tchange_move_direction_h()\n\t\t\t_sprite.set_flip_h(true)\n\t\telif area.get_name() == \"floor2-3\":\n\t\t\tcurrent_floor = 3\n\t\t\tchange_move_direction_h()\n\t\t\t_sprite.set_flip_h(false)\n\t\telif area.get_name() == \"floor3-1\":\n\t\t\tcurrent_floor = 1\n\t\tset_transform(start_points[current_floor - 1])\n\telif areas.has(\"health\"):\n\t\t_health.restore(1)\n\t\t_sound_player[ \"item\" ].play(\"item\")\n\t\tarea.hide()\n\t\tarea.set_global_pos(area.get_parent().get_global_pos())\n\t\t\n\telif areas.has(\"mask\"):\n\t\tcurrent_mask = area.get_type()\n\t\t_sound_player[ \"item\" ].play(\"bonus\")\n\t\tarea.hide()\n\t\tarea.set_global_pos(area.get_parent().get_global_pos())\n\nfunc _on_Area2D_body_enter( body ):\n\tvar groups = body.get_groups()\n\tif groups.has(\"totem\"):\n\t\t_health.remove(1)\n\t\t_sound_player[ \"player\" ].play(\"hit\")\n\t\tset_transform(start_points[current_floor - 1])\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"3ad4a7df6629e76787026449c05fa16d6574f2e5","subject":"Added zombieData","message":"Added zombieData\n","repos":"DaddySmash\/GraphicsGame,DaddySmash\/GraphicsGame","old_file":"app\/code\/zombiesGo.gd","new_file":"app\/code\/zombiesGo.gd","new_contents":"extends Node\n\n#get_node(\"\/root\/global\").enteringOS <--This is the proper method to quit to desktop.\n#get_node(\"\/root\/global\").enteringMenu <--This is the proper method to get to the main menu.\n#get_node(\"\/root\/global\").currentDifficulty <--This is the proper method to get the difficulty.\n\n#Time based variables.\n#var eclipseRatio = null\n\n#Player stuff.\nvar playerScore = null\nvar playerTime = null\nvar playerDifficulty = null #This has to be between 0 and 3 to match the size of xSizeArray and ySizeArray.\n#var specialAbilityAmmo = null\nvar tombArray = []\nvar tombOrigen = null\nvar tombs = null\nvar tombNumberTotal = 0\nvar zombieData = []\nvar xSizeArray = [3, 3, 4, 6] #[Easy, Normal, Hard, Insane]\nvar ySizeArray = [1, 2, 3, 3] #[Easy, Normal, Hard, Insane]\nvar playerHealth = [3, 3, 3, 3] #[Easy, Normal, Hard, Insane]\nvar voidTombs = [0, 1, 2, 3] #[Easy, Normal, Hard, Insane] These tomb placeholders do not have any zombies coming up.\nvar howDiedTombCount = 3 #this is a count of the number of different flavor texts that go on tombstones.\nvar xTombSpacing = null\nvar yTombSpacing = null\nvar tombStyle = null\nvar tombList = []\nvar time\nvar zombieTime = {}\n\n#var tombArray = [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\", \"J\", \"K\", \"L\", \"M\", \"N\", \"O\", \"P\", \"Q\", \"R\", \"S\", \"T\", \"U\", \"V\", \"W\", \"X\", \"Y\", \"Z\", \",\", \".\", \"_\", \"-\"]\n\nfunc _ready():\n\tget_scene().set_auto_accept_quit(false) #Enables: _notification(what) to recieve MainLoop.NOTIFICATION_WM_QUIT_REQUEST\n\tset_process(true) #Enables: _process(delta) to run every frame.\n\tplayerDifficulty = get_node(\"\/root\/global\").currentDifficulty\n\t\n\ttombs = get_node(\"tombs\")\n\txTombSpacing = 200\n\tyTombSpacing = 175\n\n\t#for g in range(glyphArray.size()):\n\t#\tn = load(\"res:\/\/scene\/getNameGlyph.xscn\").instance()\n\t#\tglyph.add_child(n)\n\t\n\ttombArray.resize(0)\n\tfor x in range(xSizeArray[playerDifficulty]):\n\t\ttombArray.append([])\n\t\tfor y in range(ySizeArray[playerDifficulty]):\n\t\t\ttombArray[x].append(load(\"res:\/\/scene\/zombiesGoTomb.xscn\").instance())\n\t\t\t#print(\"Hello World \" + str(x) + \", \" + str(y))\n\t\t\t#MARGIN_LEFT, MARGIN_TOP, MARGIN_RIGHT, MARGIN_BOTTOM\n\t\t\ttombArray[x][y].set_margin(MARGIN_LEFT, 1280\/2 - xSizeArray[playerDifficulty]*xTombSpacing\/2 + x * xTombSpacing + floor(rand_range( -xTombSpacing*.2, xTombSpacing*.2)))\n\t\t\ttombArray[x][y].set_margin(MARGIN_TOP, 720\/2 - ySizeArray[playerDifficulty]*yTombSpacing\/2 + y * yTombSpacing)\n\t\t\ttombs.add_child(tombArray[x][y])\n\t\t\t\n\t\n\t#Init settings for round.\n\t#eclipseRatio = (difficulty - 1) * 0.2\n\tplayerScore = 0\n\tplayerTime = 0\n\t#specialAbilityAmmo = 0\n\t\n\t#Create List\n\ttombList.resize(0)\n\tfor x in range(xSizeArray[playerDifficulty]):\n\t\tfor y in range(ySizeArray[playerDifficulty]):\n\t\t\ttombList.append(tombArray[x][y])\n\t\t\t\n\t\t\t\n\t\t\t#tombStyle = floor(rand_range( 0, 3)) #If floor ever returns the high value, it will be a bug on this line.\n\t\t\t#tombArray[x][y].get_node(\"normalTomb\").show()\n\t\t\t#tombArray[x][y].get_node(\"backHole\").show()\n\t\t\t#tombArray[x][y].get_node(\"frontHole\").show()\n\t\n\tfor c in range(playerHealth[playerDifficulty]): #Make normal tombs for player health.\n\t\tif tombList.empty():\n\t\t\tcontinue\n\t\tvar i = floor(rand_range(0, tombList.size()))\n\t\ttombList[i].get_node(\"normalTomb\").show()\n\t\ttombList[i].get_node(\"frontHole\").show()\n\t\ttombList[i].get_node(\"backHole\").show()\n\t\t#tombList[i].get_node(\"rubbleHole\").show()\n\t\ttombList.remove(i)\n\t\t\n\tfor c in range(voidTombs[playerDifficulty]): #Make voild tombs.\n\t\tif tombList.empty():\n\t\t\tcontinue\n\t\tvar i = floor(rand_range(0, tombList.size()))\n\t\ttombList[i].get_node(\"rubbleHole\").show()\n\t\ttombList.remove(i)\n\t\n\tfor i in range(tombList.size()): #Make the rest of the tombs.\n\t\tvar r = floor(rand_range(0, 2))\n\t\tif r == 0:\n\t\t\ttombList[i].get_node(\"brokenTomb\").show()\n\t\t\ttombList[i].get_node(\"frontHole\").show()\n\t\t\ttombList[i].get_node(\"backHole\").show()\n\t\t\t#tombList[i].get_node(\"rubbleHole\").show()\n\t\telif r == 1:\n\t\t\ttombList[i].get_node(\"missingTomb\").show()\n\t\t\ttombList[i].get_node(\"frontHole\").show()\n\t\t\ttombList[i].get_node(\"backHole\").show()\n\t\t\t#tombList[i].get_node(\"rubbleHole\").show()\n\t\telse:\n\t\t\tpass\n\t\t\t\n\tdata.resize(0)\n\tfor x in range(xSizeArray[playerDifficulty]):\n\t\tfor y in range(ySizeArray[playerDifficulty]):\n\t\t\tdata.append({node:tombArray[x][y], zombieTime:2})\n\t\t\t\n\n\nfunc _notification(what):\n\tif (what==MainLoop.NOTIFICATION_WM_QUIT_REQUEST):\n\t\t#Submit current game and save highArray before exiting.\n\t\tget_node(\"\/root\/global\").enteringOS = true\n\t\tget_node(\"\/root\/global\").updateHighScore(rand_range(0, 9999), rand_range(0, 59))\n\nfunc _process(delta):\n\t#This is ran every frame.\n\t#get_node(\"\/root\/global\").timeString(time)\n\tplayerTime = playerTime + delta\n\tget_node(\"displayPlayerTimeOnScreen\").set_text(get_node(\"\/root\/global\").timeString(playerTime))\n\ttime = int(floor(playerTime))\n\t\n\tif playerDifficulty == 3:\n\t\t#isDied()= true\n\t\tpass\n\t\t\n\tfor c in range(size(data{})): #Temporarily make all zombies show.\n\t\tvar i = floor(rand_range(0, tombList.size()))\n\t\ttombList[i].get_node(\"zombieNormal\").show()\n\t\t#if time <= 2:\n\t\t#\tzombieMove() = true\n\t\t#else:\n\t\t#\tzombieMove() = false\n\nfunc _on_backGround_pressed():\n\t#Submit current game and save highArray before ending round.\n\t#updateHighScore(score, time)\n\tget_node(\"\/root\/global\").enteringMenu = true\n\tget_node(\"\/root\/global\").updateHighScore(rand_range(0, 9999), rand_range(0, 59))\n\nfunc _on_frontGround_pressed():\n\t#Submit current game and save highArray before ending round.\n\t#updateHighScore(score, time)\n\tget_node(\"\/root\/global\").enteringMenu = true\n\tget_node(\"\/root\/global\").updateHighScore(rand_range(0, 9999), rand_range(0, 59))\n\t\nfunc isDied():\n\tget_node(\"\/root\/global\").enteringMenu = true\n\tget_node(\"\/root\/global\").updateHighScore(playerScore, playerTime)\n\t\nfunc zombieMove(): #Now move zombies up, then down. Use zombieTime.\n\tfor x in range(xSizeArray[playerDifficulty]):\n\t\tfor y in range(ySizeArray[playerDifficulty]):\n\t\t\t#MARGIN_LEFT, MARGIN_TOP, MARGIN_RIGHT, MARGIN_BOTTOM\n\t\t\tif time % 2 > 0.5:\n\t\t\t\t#This one runs second.\n\t\t\t\ttombArray[x][y].get_node(\"zombieNormal\").set_margin(MARGIN_TOP, tombArray[x][y].get_node(\"zombieNormal\").get_margin(MARGIN_TOP)+1)\n\t\t\telse:\n\t\t\t\t#This one runs first.\n\t\t\t\ttombArray[x][y].get_node(\"zombieNormal\").set_margin(MARGIN_TOP, tombArray[x][y].get_node(\"zombieNormal\").get_margin(MARGIN_TOP)-1)\n\tif time > 2:\n\t\treturn\n\t\t\nfunc getIndexFromNode(node):\n\t#Search data[] for this node.\n\treturn i","old_contents":"extends Node\n\n#get_node(\"\/root\/global\").enteringOS <--This is the proper method to quit to desktop.\n#get_node(\"\/root\/global\").enteringMenu <--This is the proper method to get to the main menu.\n#get_node(\"\/root\/global\").currentDifficulty <--This is the proper method to get the difficulty.\n\n#Time based variables.\n#var eclipseRatio = null\n\n#Player stuff.\nvar playerScore = null\nvar playerTime = null\nvar playerDifficulty = null #This has to be between 0 and 3 to match the size of xSizeArray and ySizeArray.\n#var specialAbilityAmmo = null\nvar tombArray = []\nvar tombOrigen = null\nvar tombs = null\nvar tombNumberTotal = 0\nvar xSizeArray = [3, 3, 4, 6] #[Easy, Normal, Hard, Insane]\nvar ySizeArray = [1, 2, 3, 3] #[Easy, Normal, Hard, Insane]\nvar playerHealth = [3, 3, 3, 3] #[Easy, Normal, Hard, Insane]\nvar voidTombs = [0, 1, 2, 3] #[Easy, Normal, Hard, Insane] These tomb placeholders do not have any zombies coming up.\nvar howDiedTombCount = 3 #this is a count of the number of different flavor texts that go on tombstones.\nvar xTombSpacing = null\nvar yTombSpacing = null\nvar tombStyle = null\nvar tombList = []\nvar time\n\n#var tombArray = [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\", \"J\", \"K\", \"L\", \"M\", \"N\", \"O\", \"P\", \"Q\", \"R\", \"S\", \"T\", \"U\", \"V\", \"W\", \"X\", \"Y\", \"Z\", \",\", \".\", \"_\", \"-\"]\n\nfunc _ready():\n\tget_scene().set_auto_accept_quit(false) #Enables: _notification(what) to recieve MainLoop.NOTIFICATION_WM_QUIT_REQUEST\n\tset_process(true) #Enables: _process(delta) to run every frame.\n\tplayerDifficulty = get_node(\"\/root\/global\").currentDifficulty\n\t\n\ttombs = get_node(\"tombs\")\n\txTombSpacing = 200\n\tyTombSpacing = 175\n\n\t#for g in range(glyphArray.size()):\n\t#\tn = load(\"res:\/\/scene\/getNameGlyph.xscn\").instance()\n\t#\tglyph.add_child(n)\n\t\n\ttombArray.resize(0)\n\tfor x in range(xSizeArray[playerDifficulty]):\n\t\ttombArray.append([])\n\t\tfor y in range(ySizeArray[playerDifficulty]):\n\t\t\ttombArray[x].append(load(\"res:\/\/scene\/zombiesGoTomb.xscn\").instance())\n\t\t\t#print(\"Hello World \" + str(x) + \", \" + str(y))\n\t\t\t#MARGIN_LEFT, MARGIN_TOP, MARGIN_RIGHT, MARGIN_BOTTOM\n\t\t\ttombArray[x][y].set_margin(MARGIN_LEFT, 1280\/2 - xSizeArray[playerDifficulty]*xTombSpacing\/2 + x * xTombSpacing + floor(rand_range( -xTombSpacing*.2, xTombSpacing*.2)))\n\t\t\ttombArray[x][y].set_margin(MARGIN_TOP, 720\/2 - ySizeArray[playerDifficulty]*yTombSpacing\/2 + y * yTombSpacing)\n\t\t\ttombs.add_child(tombArray[x][y])\n\t\t\t\n\t\n\t#Init settings for round.\n\t#eclipseRatio = (difficulty - 1) * 0.2\n\tplayerScore = 0\n\tplayerTime = 0\n\t#specialAbilityAmmo = 0\n\t\n\t#Create List\n\ttombList.resize(0)\n\tfor x in range(xSizeArray[playerDifficulty]):\n\t\tfor y in range(ySizeArray[playerDifficulty]):\n\t\t\ttombList.append(tombArray[x][y])\n\t\t\t\n\t\t\t\n\t\t\t#tombStyle = floor(rand_range( 0, 3)) #If floor ever returns the high value, it will be a bug on this line.\n\t\t\t#tombArray[x][y].get_node(\"normalTomb\").show()\n\t\t\t#tombArray[x][y].get_node(\"backHole\").show()\n\t\t\t#tombArray[x][y].get_node(\"frontHole\").show()\n\t\n\tfor c in range(playerHealth[playerDifficulty]): #Make normal tombs for player health.\n\t\tif tombList.empty():\n\t\t\tcontinue\n\t\tvar i = floor(rand_range(0, tombList.size()))\n\t\ttombList[i].get_node(\"normalTomb\").show()\n\t\ttombList[i].get_node(\"frontHole\").show()\n\t\ttombList[i].get_node(\"backHole\").show()\n\t\t#tombList[i].get_node(\"rubbleHole\").show()\n\t\ttombList.remove(i)\n\t\t\n\tfor c in range(voidTombs[playerDifficulty]): #Make voild tombs.\n\t\tif tombList.empty():\n\t\t\tcontinue\n\t\tvar i = floor(rand_range(0, tombList.size()))\n\t\ttombList[i].get_node(\"rubbleHole\").show()\n\t\ttombList.remove(i)\n\t\n\tfor i in range(tombList.size()): #Make the rest of the tombs.\n\t\tvar r = floor(rand_range(0, 2))\n\t\tif r == 0:\n\t\t\ttombList[i].get_node(\"brokenTomb\").show()\n\t\t\ttombList[i].get_node(\"frontHole\").show()\n\t\t\ttombList[i].get_node(\"backHole\").show()\n\t\t\t#tombList[i].get_node(\"rubbleHole\").show()\n\t\telif r == 1:\n\t\t\ttombList[i].get_node(\"missingTomb\").show()\n\t\t\ttombList[i].get_node(\"frontHole\").show()\n\t\t\ttombList[i].get_node(\"backHole\").show()\n\t\t\t#tombList[i].get_node(\"rubbleHole\").show()\n\t\telse:\n\t\t\tpass\n\t\t\t\n\ttombList.resize(0)\n\tfor x in range(xSizeArray[playerDifficulty]):\n\t\tfor y in range(ySizeArray[playerDifficulty]):\n\t\t\ttombList.append(tombArray[x][y])\n\nfunc _notification(what):\n\tif (what==MainLoop.NOTIFICATION_WM_QUIT_REQUEST):\n\t\t#Submit current game and save highArray before exiting.\n\t\tget_node(\"\/root\/global\").enteringOS = true\n\t\tget_node(\"\/root\/global\").updateHighScore(rand_range(0, 9999), rand_range(0, 59))\n\nfunc _process(delta):\n\t#This is ran every frame.\n\t#get_node(\"\/root\/global\").timeString(time)\n\tplayerTime = playerTime + delta\n\tget_node(\"displayPlayerTimeOnScreen\").set_text(get_node(\"\/root\/global\").timeString(playerTime))\n\tif playerDifficulty == 3:\n\t\t#isDied()= true\n\t\tpass\n\t\t\n\tfor c in range(playerHealth[playerDifficulty]): #Temporarily make all zombies show.\n\t\tif tombList.empty():\n\t\t\tcontinue\n\t\tvar i = floor(rand_range(0, tombList.size()))\n\t\ttombList[i].get_node(\"zombieNormal\").show()\n\t\t\n\t#Now move zombies.\n\ttime = int(floor(playerTime))\n\tfor x in range(xSizeArray[playerDifficulty]):\n\t\tfor y in range(ySizeArray[playerDifficulty]):\n\t\t\t#MARGIN_LEFT, MARGIN_TOP, MARGIN_RIGHT, MARGIN_BOTTOM\n\t\t\tif time % 2 > 0.5:\n\t\t\t\ttombArray[x][y].get_node(\"zombieNormal\").set_margin(MARGIN_TOP, tombArray[x][y].get_node(\"zombieNormal\").get_margin(MARGIN_TOP)+1)\n\t\t\telse:\n\t\t\t\ttombArray[x][y].get_node(\"zombieNormal\").set_margin(MARGIN_TOP, tombArray[x][y].get_node(\"zombieNormal\").get_margin(MARGIN_TOP)-1)\n\nfunc _on_backGround_pressed():\n\t#Submit current game and save highArray before ending round.\n\t#updateHighScore(score, time)\n\tget_node(\"\/root\/global\").enteringMenu = true\n\tget_node(\"\/root\/global\").updateHighScore(rand_range(0, 9999), rand_range(0, 59))\n\nfunc _on_frontGround_pressed():\n\t#Submit current game and save highArray before ending round.\n\t#updateHighScore(score, time)\n\tget_node(\"\/root\/global\").enteringMenu = true\n\tget_node(\"\/root\/global\").updateHighScore(rand_range(0, 9999), rand_range(0, 59))\n\t\nfunc isDied():\n\tget_node(\"\/root\/global\").enteringMenu = true\n\tget_node(\"\/root\/global\").updateHighScore(playerScore, playerTime)","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"240ab83f3b6c02a3fbfb3a967780d8792d9f5a0c","subject":"Made notes on playerHealth and voidTombs","message":"Made notes on playerHealth and voidTombs\n\nChange playerHealth and voidTombs to arrays like xSizeArray.\n","repos":"DaddySmash\/GraphicsGame,DaddySmash\/GraphicsGame","old_file":"app\/code\/zombiesGo.gd","new_file":"app\/code\/zombiesGo.gd","new_contents":"extends Node\n\n#get_node(\"\/root\/global\").enteringOS <--This is the proper method to quit to desktop.\n#get_node(\"\/root\/global\").enteringMenu <--This is the proper method to get to the main menu.\n#get_node(\"\/root\/global\").currentDifficulty <--This is the proper method to get the difficulty.\n\n#Time based variables.\n#var eclipseRatio = null\n\n#Player stuff.\nvar playerScore = null\nvar playerTime = null\nvar playerDifficulty = null #This has to be between 0 and 3 to match the size of xSizeArray and ySizeArray.\nvar playerHealth = null\n#var specialAbilityAmmo = null\nvar tombArray = []\nvar tombOrigen = null\nvar tombs = null\nvar tombNumberTotal = 0\nvar xSizeArray = [3, 3, 4, 6] #[Easy, Normal, Hard, Insane]\nvar ySizeArray = [1, 2, 3, 3] #[Easy, Normal, Hard, Insane]\nvar howDiedTombCount = 3 #this is a count of the number of different flavor texts that go on tombstones.\nvar xTombSpacing = null\nvar yTombSpacing = null\nvar tombStyle = null\nvar tombList = []\nvar voidTombs = null #These tomb placeholders do not have any zombies coming up.\n\n#var tombArray = [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\", \"J\", \"K\", \"L\", \"M\", \"N\", \"O\", \"P\", \"Q\", \"R\", \"S\", \"T\", \"U\", \"V\", \"W\", \"X\", \"Y\", \"Z\", \",\", \".\", \"_\", \"-\"]\n\nfunc _ready():\n\tget_scene().set_auto_accept_quit(false) #Enables: _notification(what) to recieve MainLoop.NOTIFICATION_WM_QUIT_REQUEST\n\tset_process(true) #Enables: _process(delta) to run every frame.\n\tplayerDifficulty = get_node(\"\/root\/global\").currentDifficulty\n\t\n\ttombs = get_node(\"tombs\")\n\txTombSpacing = 200\n\tyTombSpacing = 175\n\n\t#for g in range(glyphArray.size()):\n\t#\tn = load(\"res:\/\/scene\/getNameGlyph.xscn\").instance()\n\t#\tglyph.add_child(n)\n\t\n\ttombArray.resize(0)\n\tfor x in range(xSizeArray[playerDifficulty]):\n\t\ttombArray.append([])\n\t\tfor y in range(ySizeArray[playerDifficulty]):\n\t\t\ttombArray[x].append(load(\"res:\/\/scene\/zombiesGoTomb.xscn\").instance())\n\t\t\t#print(\"Hello World \" + str(x) + \", \" + str(y))\n\t\t\t#MARGIN_LEFT, MARGIN_TOP, MARGIN_RIGHT, MARGIN_BOTTOM\n\t\t\ttombArray[x][y].set_margin(MARGIN_LEFT, 1280\/2 - xSizeArray[playerDifficulty]*xTombSpacing\/2 + x * xTombSpacing + floor(rand_range( -xTombSpacing*.2, xTombSpacing*.2)))\n\t\t\ttombArray[x][y].set_margin(MARGIN_TOP, 720\/2 - ySizeArray[playerDifficulty]*yTombSpacing\/2 + y * yTombSpacing)\n\t\t\ttombs.add_child(tombArray[x][y])\n\t\t\t\n\t\n\t#Init settings for round.\n\t#eclipseRatio = (difficulty - 1) * 0.2\n\tplayerScore = 0\n\tplayerTime = 0\n\t#specialAbilityAmmo = 0\n\tif playerDifficulty == 0: #Convert player health to an array like xSizeArray.\n\t\tplayerHealth = 3\n\t\tvoidTombs = 0 #Convert void tombs to an array like xSizeArray.\n\tif playerDifficulty == 1:\n\t\tplayerHealth = 3\n\t\tvoidTombs = 1\n\tif playerDifficulty == 2:\n\t\tplayerHealth = 3\n\t\tvoidTombs = 2\n\tif playerDifficulty == 3:\n\t\tplayerHealth = 3\n\t\tvoidTombs = 3\n\t\n\t#Create List\n\ttombList.resize(0)\n\tfor x in range(xSizeArray[playerDifficulty]):\n\t\tfor y in range(ySizeArray[playerDifficulty]):\n\t\t\ttombList.append(tombArray[x][y])\n\t\t\t\n\t\t\t\n\t\t\t#tombStyle = floor(rand_range( 0, 3)) #If floor ever returns the high value, it will be a bug on this line.\n\t\t\t#tombArray[x][y].get_node(\"normalTomb\").show()\n\t\t\t#tombArray[x][y].get_node(\"backHole\").show()\n\t\t\t#tombArray[x][y].get_node(\"frontHole\").show()\n\t\n\tfor c in range(playerHealth):\n\t\tif tombList.empty():\n\t\t\tcontinue\n\t\tvar i = floor(rand_range(0, tombList.size()))\n\t\ttombList[i].get_node(\"normalTomb\").show()\n\t\ttombList.remove(i)\n\t\n\tfor i in range(tombList.size()):\n\t\tvar r = floor(rand_range(0, 3))\n\t\tif r == 1:\n\t\t\ttombList[i].get_node(\"brokenTomb\").show()\n\t\telif r == 2:\n\t\t\ttombList[i].get_node(\"missingTomb\").show()\n\t\telse:\n\t\t\tpass\n\nfunc _notification(what):\n\tif (what==MainLoop.NOTIFICATION_WM_QUIT_REQUEST):\n\t\t#Submit current game and save highArray before exiting.\n\t\tget_node(\"\/root\/global\").enteringOS = true\n\t\tget_node(\"\/root\/global\").updateHighScore(rand_range(0, 9999), rand_range(0, 59))\n\nfunc _process(delta):\n\t#This is ran every frame.\n\t#get_node(\"\/root\/global\").timeString(time)\n\tplayerTime = playerTime + delta\n\tget_node(\"displayPlayerTimeOnScreen\").set_text(get_node(\"\/root\/global\").timeString(playerTime))\n\t\n\nfunc _on_backGround_pressed():\n\t#Submit current game and save highArray before ending round.\n\t#updateHighScore(score, time)\n\tget_node(\"\/root\/global\").enteringMenu = true\n\tget_node(\"\/root\/global\").updateHighScore(rand_range(0, 9999), rand_range(0, 59))\n\nfunc _on_frontGround_pressed():\n\t#Submit current game and save highArray before ending round.\n\t#updateHighScore(score, time)\n\tget_node(\"\/root\/global\").enteringMenu = true\n\tget_node(\"\/root\/global\").updateHighScore(rand_range(0, 9999), rand_range(0, 59))","old_contents":"extends Node\n\n#get_node(\"\/root\/global\").enteringOS <--This is the proper method to quit to desktop.\n#get_node(\"\/root\/global\").enteringMenu <--This is the proper method to get to the main menu.\n#get_node(\"\/root\/global\").currentDifficulty <--This is the proper method to get the difficulty.\n\n#Time based variables.\n#var eclipseRatio = null\n\n#Player stuff.\nvar playerScore = null\nvar playerTime = null\nvar playerDifficulty = null #This has to be between 0 and 3 to match the size of xSizeArray and ySizeArray.\nvar playerHealth = null\n#var specialAbilityAmmo = null\nvar tombArray = []\nvar tombOrigen = null\nvar tombs = null\nvar tombNumberTotal = 0\nvar xSizeArray = [3, 3, 4, 6] #[Easy, Normal, Hard, Insane]\nvar ySizeArray = [1, 2, 3, 3] #[Easy, Normal, Hard, Insane]\nvar howDiedTombCount = 3 #this is a count of the number of different flavor texts that go on tombstones.\nvar xTombSpacing = null\nvar yTombSpacing = null\nvar tombStyle = null\nvar tombList = []\n\n#var tombArray = [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\", \"J\", \"K\", \"L\", \"M\", \"N\", \"O\", \"P\", \"Q\", \"R\", \"S\", \"T\", \"U\", \"V\", \"W\", \"X\", \"Y\", \"Z\", \",\", \".\", \"_\", \"-\"]\n\nfunc _ready():\n\tget_scene().set_auto_accept_quit(false) #Enables: _notification(what) to recieve MainLoop.NOTIFICATION_WM_QUIT_REQUEST\n\tset_process(true) #Enables: _process(delta) to run every frame.\n\tplayerDifficulty = get_node(\"\/root\/global\").currentDifficulty\n\t\n\ttombs = get_node(\"tombs\")\n\txTombSpacing = 200\n\tyTombSpacing = 175\n\n\t#for g in range(glyphArray.size()):\n\t#\tn = load(\"res:\/\/scene\/getNameGlyph.xscn\").instance()\n\t#\tglyph.add_child(n)\n\t\n\ttombArray.resize(0)\n\tfor x in range(xSizeArray[playerDifficulty]):\n\t\ttombArray.append([])\n\t\tfor y in range(ySizeArray[playerDifficulty]):\n\t\t\ttombArray[x].append(load(\"res:\/\/scene\/zombiesGoTomb.xscn\").instance())\n\t\t\t#print(\"Hello World \" + str(x) + \", \" + str(y))\n\t\t\t#MARGIN_LEFT, MARGIN_TOP, MARGIN_RIGHT, MARGIN_BOTTOM\n\t\t\ttombArray[x][y].set_margin(MARGIN_LEFT, 1280\/2 - xSizeArray[playerDifficulty]*xTombSpacing\/2 + x * xTombSpacing + floor(rand_range( -xTombSpacing*.2, xTombSpacing*.2)))\n\t\t\ttombArray[x][y].set_margin(MARGIN_TOP, 720\/2 - ySizeArray[playerDifficulty]*yTombSpacing\/2 + y * yTombSpacing)\n\t\t\ttombs.add_child(tombArray[x][y])\n\t\t\t\n\t\n\t#Init settings for round.\n\t#eclipseRatio = (difficulty - 1) * 0.2\n\tplayerScore = 0\n\tplayerTime = 0\n\t#specialAbilityAmmo = 0\n\tif playerDifficulty == 0:\n\t\tplayerHealth = 3\n\tif playerDifficulty == 1:\n\t\tplayerHealth = 3\n\tif playerDifficulty == 2:\n\t\tplayerHealth = 3\n\tif playerDifficulty == 3:\n\t\tplayerHealth = 3\n\t\n\t#Create List\n\ttombList.resize(0)\n\tfor x in range(xSizeArray[playerDifficulty]):\n\t\tfor y in range(ySizeArray[playerDifficulty]):\n\t\t\ttombList.append(tombArray[x][y])\n\t\t\t\n\t\t\t\n\t\t\t#tombStyle = floor(rand_range( 0, 3)) #If floor ever returns the high value, it will be a bug on this line.\n\t\t\t#tombArray[x][y].get_node(\"normalTomb\").show()\n\t\t\t#tombArray[x][y].get_node(\"backHole\").show()\n\t\t\t#tombArray[x][y].get_node(\"frontHole\").show()\n\t\n\tfor c in range(playerHealth):\n\t\tif tombList.empty():\n\t\t\tcontinue\n\t\tvar i = floor(rand_range(0, tombList.size()))\n\t\ttombList[i].get_node(\"normalTomb\").show()\n\t\ttombList.remove(i)\n\t\n\tfor i in range(tombList.size()):\n\t\tvar r = floor(rand_range(0, 3))\n\t\tif r == 1:\n\t\t\ttombList[i].get_node(\"brokenTomb\").show()\n\t\telif r == 2:\n\t\t\ttombList[i].get_node(\"missingTomb\").show()\n\t\telse:\n\t\t\tpass\n\nfunc _notification(what):\n\tif (what==MainLoop.NOTIFICATION_WM_QUIT_REQUEST):\n\t\t#Submit current game and save highArray before exiting.\n\t\tget_node(\"\/root\/global\").enteringOS = true\n\t\tget_node(\"\/root\/global\").updateHighScore(rand_range(0, 9999), rand_range(0, 59))\n\nfunc _process(delta):\n\t#This is ran every frame.\n\t#get_node(\"\/root\/global\").timeString(time)\n\tplayerTime = playerTime + delta\n\tget_node(\"displayPlayerTimeOnScreen\").set_text(get_node(\"\/root\/global\").timeString(playerTime))\n\t\n\nfunc _on_backGround_pressed():\n\t#Submit current game and save highArray before ending round.\n\t#updateHighScore(score, time)\n\tget_node(\"\/root\/global\").enteringMenu = true\n\tget_node(\"\/root\/global\").updateHighScore(rand_range(0, 9999), rand_range(0, 59))\n\nfunc _on_frontGround_pressed():\n\t#Submit current game and save highArray before ending round.\n\t#updateHighScore(score, time)\n\tget_node(\"\/root\/global\").enteringMenu = true\n\tget_node(\"\/root\/global\").updateHighScore(rand_range(0, 9999), rand_range(0, 59))","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"8dcefa64f19c2fe120af8ec17e06e415ba5216bb","subject":"small additions","message":"small additions\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/PuzzleManager.gd","new_file":"src\/scripts\/PuzzleManager.gd","new_contents":"const DIFF_EASY\t\t= 0\nconst DIFF_MEDIUM\t= 1\nconst DIFF_HARD\t\t= 2\n\n# this order is important\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\nconst SOLVER_ERROR_NONE\t\t\t\t= 0\nconst SOLVER_ERROR_MISSING_PAIR\t\t= 1\n\nconst blockColors = [\"Blue\", \"Orange\", \"Red\", \"Gray\", \"Purple\", \"Green\"]\n\n# Preload paired blocks\nconst blockScn = preload( \"res:\/\/blocks\/block.scn\" )\nconst blockScripts = [ preload( \"Blocks\/LaserBlock.gd\" )\n\t\t\t \t , preload( \"Blocks\/WildBlock.gd\" )\n\t\t\t \t , preload( \"Blocks\/PairedBlock.gd\" )\n\t\t\t \t , preload( \"Blocks\/LaserBlock.gd\" )\n\t\t\t \t ]\n\nvar glyphOn\n\n# Calculates the layer that a block is on.\nstatic func calcBlockLayer( x, y, z ):\n\treturn max( max( abs( x ), abs( y ) ), abs( z ) )\n# THIS IS EVERYWHERE, ANY BETTER WAY TO HAVE FUNCTIONS BETWEEN SCRIPTS?\nstatic func calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n# Stores a puzzle in a convenient class.\nclass Puzzle:\n\n\tvar puzzleName\t\t\t# The name of the puzzle.\n\tvar puzzleLayers\t\t# The amount of layers the puzzle has.\n\tvar pairCount = []\t\t# The amount of pair blocks on each layer.\n\tvar shape = {}\t\t\t# All blocks indexed by position\n\tvar lasers = []\t\t\t# Laser connections.\n\tvar puzzleMan\t\t\t# Stores the puzzle manager for making pickled blocks.\n\n\t# Converts a puzzle to a dictionary.\n\tfunc toDict():\n\t\tvar blocksArray = []\n\t\tfor k in shape.keys():\n\t\t\tif shape[k] == null:\n\t\t\t\tcontinue\n\t\t\tblocksArray.append(shape[k].toDict())\n\n\t\tvar di = { pN = puzzleName\n\t\t \t , pL = puzzleLayers\n\t\t\t\t , bL = blocksArray\n\t\t\t\t , pC = pairCount\n\t\t\t\t , lS = lasers\n\t\t\t }\n\t\treturn di\n\n\t# Converts a dictionary to a puzzle.\n\tfunc fromDict( di ):\n\t\tpuzzleName = di.pN\n\t\tpuzzleLayers = di.pL\n\t\tpairCount = di.pC\n\t\tlasers = di.lS\n\n\t\tfor block in di.bL:\n\t\t\tvar nb = puzzleMan.PickledBlock.new()\n\t\t\tnb.fromDict( block )\n\t\t\tshape[nb.blockPos] = nb\n\t\treturn\n\n\t# Class that stores a solution or the errors in a puzzle.\n\tclass PuzzleSteps:\n\t\tvar solveable = false\n\t\tvar error = SOLVER_ERROR_NONE\n\t\tvar errorBlock = null\n\t\tvar solveSteps = []\n\n\t# THIS IS EVERYWHERE, ANY BETTER WAY TO HAVE FUNCTIONS BETWEEN SCRIPTS?\n\t# duplicate of the global definition above? Either way godot is chill and\n\t# doesn't complain\n\tfunc calcBlockLayerVec( pos ):\n\t\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n\t# Determines if a puzzle is solveable.\n\tfunc solvePuzzle():\n\t\t# Simply use the solvePuzzleSteps function and return the solveable part.\n\t\tvar ps = self.solvePuzzleSteps()\n\t\treturn ps.solveable\n\n\t# Determines if a puzzle is solveable and returns the steps needed to solve it.\n\tfunc solvePuzzleSteps():\n\t\tvar puzzleSteps = PuzzleSteps.new()\n\n\t\tvar pairs = []\n\n\t\t# Add new dictionary for each later.\n\t\tfor l in range( puzzleLayers + 1 ):\n\t\t\tpairs.append( {} )\n\n\t\t# Gather paired blocks from the puzzle.\n\t\tfor k in shape.keys():\n\t\t\tvar b = shape[k]\n\t\t\tif b.blockClass == BLOCK_PAIR:\n\t\t\t\tb.solverFlag = false\n\t\t\t\tpairs[calcBlockLayerVec(b.blockPos)][b.name] = b\n\n\t\t# Make sure each pair block has a valid pair on the same layer.\n\t\tfor l in pairs:\n\t\t\tfor p in l:\n\t\t\t\tif l.has( l[p].pairName ):\n\t\t\t\t\tif( not l[p].solverFlag ):\n\t\t\t\t\t\tl[p].solverFlag = true\n\t\t\t\t\t\tl[l[p].pairName].solverFlag = true\n\t\t\t\t\t\tpuzzleSteps.solveSteps.append( [ l[p].blockPos, l[l[p].pairName].blockPos ] )\n\t\t\t\telse:\n\t\t\t\t\tpuzzleSteps.error = SOLVER_ERROR_MISSING_PAIR\n\t\t\t\t\tpuzzleSteps.errorBlock = l[p]\n\t\t\t\t\treturn puzzleSteps\n\n\t\tpuzzleSteps.solveable = true\n\t\treturn puzzleSteps\n\n# Randomly shuffle an array.\nfunc shuffleArray( arr ):\n\tfor i in range( arr.size() - 1, 1, -1 ):\n\t\tvar swapVal = randi() % (i + 1)\n\t\tvar temp = arr[swapVal]\n\t\tarr[swapVal] = arr[i]\n\t\tarr[i] = temp\n\n# Determines the block type based on puzzle size and difficulty.\nfunc getBlockType( difficulty, pos ):\n\t# Determine if this is the goal block.\n\tif pos.x == 0 and pos.y == 0 and pos.z == 0:\n\t\treturn BLOCK_GOAL\n\n\t# Determine the layer this block is on.\n\tvar layer = calcBlockLayerVec( pos )\n\n\t# Determine how many blocks are on the outer part of the layer.\n\tvar layerCount = 0\n\tif abs( pos.x ) == layer:\n\t\tlayerCount += 1\n\tif abs( pos.y ) == layer:\n\t\tlayerCount += 1\n\tif abs( pos.z ) == layer:\n\t\tlayerCount += 1\n\n\t# Determine if this block is a laser.\n\tif difficulty == DIFF_EASY or difficulty == DIFF_MEDIUM:\n\t\tif layerCount == 3:\n\t\t\treturn BLOCK_LASER\n\n\tif difficulty == DIFF_HARD:\n\t\tif abs( pos.x ) == abs( pos.z ) and pos.y == 0:\n\t\t\treturn BLOCK_LASER\n\n\t# Determine if this block is a wild block.\n\tif difficulty == DIFF_EASY:\n\t\tif layerCount == 2:\n\t\t\treturn BLOCK_WILD\n\n\tif difficulty == DIFF_MEDIUM:\n\t\tif layerCount == 2:\n\t\t\tif pos.y == layer || pos.y == -layer:\n\t\t\t\treturn BLOCK_WILD\n\n\tif difficulty == DIFF_HARD:\n\t\tif layerCount == 1:\n\t\t\tif pos.y == 0:\n\t\t\t\treturn BLOCK_WILD\n\n\t# Otherwise it's a normal block.\n\treturn BLOCK_PAIR\n\n# Generates a solveable puzzle.\nfunc generatePuzzle( layers, difficulty ):\n\tvar blockID = 0\n\tvar puzzle = Puzzle.new()\n\tpuzzle.puzzleName = \"RANDOM PUZZLE\"\n\tpuzzle.puzzleLayers = layers\n\n\tglyphOn = []\n\tfor g in range( blockColors.size() ):\n\t\tglyphOn.append( 0 )\n\n\t# Create all possible positions.\n\tvar layeredblocks = []\n\tfor l in range( 0, layers + 1 ):\n\t\tlayeredblocks.append( [] )\n\t\tpuzzle.pairCount.append( 0 )\n\tfor x in range( -layers, layers + 1 ):\n\t\tfor y in range( -layers, layers + 1 ):\n\t\t\tfor z in range( -layers, layers + 1 ):\n\t\t\t\tlayeredblocks[calcBlockLayer( x, y, z )].append(Vector3(x,y,z))\n\n\t# Generate laser lines.\n\tfor l in range( 1, layers + 1 ):\n\t\tif difficulty == DIFF_MEDIUM or difficulty == DIFF_EASY:\n\t\t\tfor lx in [ -l, l ]:\n\t\t\t\tfor ly in [ -l, l ]:\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, ly, lx ), Vector3( lx*-1, ly, lx )] )\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, ly, lx ), Vector3( lx, ly, lx*-1 )] )\n\n\t\tif difficulty == DIFF_EASY:\n\t\t\tfor lx in [ -l, l ]:\n\t\t\t\tfor lz in [ -l, l ]:\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, l, lz ), Vector3( lx, -l, lz )] )\n\n\t\tif difficulty == DIFF_HARD:\n\t\t\tfor lx in [ -l, l ]:\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, 0, lx ), Vector3( lx*-1, 0, lx )] )\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, 0, lx ), Vector3( lx, 0, lx*-1 )] )\n\n\t# Assign block types based on position.\n\tfor l in range( 0, layers + 1 ):\n\t\t# Randomize the pairs.\n\t\tshuffleArray( layeredblocks[l] )\n\t\t# print( \"NUM \", layeredblocks[l].size() )\n\t\tvar prevBlock = null\n\t\tvar even = false\n\t\tfor pos in layeredblocks[l]:\n\t\t\tvar x = pos.x\n\t\t\tvar y = pos.y\n\t\t\tvar z = pos.z\n\n\t\t\tvar t = getBlockType( difficulty, pos )\n\n\t\t\tif t == BLOCK_GOAL:\n\t\t\t\tcontinue\n\n\t\t\tvar b = PickledBlock.new()\n\t\t\tb.blockPos = pos\n\t\t\tb.name = blockID\n\n\t\t\tblockID += 1\n\t\t\tpuzzle.shape[pos] = b\n\n\t\t\tif t == BLOCK_LASER:\n\t\t\t\tb.setBlockClass(BLOCK_LASER)\\\n\t\t\t\t\t.setLaserExtent( Vector3( 0, 1, 0 ) )\n\t\t\t\tcontinue\n\n\t\t\tif t == BLOCK_WILD:\n\t\t\t\tb.setBlockClass(BLOCK_WILD) \\\n\t\t\t\t\t.setTextureName(blockColors[randi() % blockColors.size()])\n\t\t\t\tcontinue\n\n\t\t\tif even:\n\t\t\t\t# Count this pair.\n\t\t\t\tpuzzle.pairCount[l] += 1\n\n\t\t\t\tvar randColor = ( randi() % blockColors.size() )\n\t\t\t\tvar randMaterial = blockColors[randColor] + str( glyphOn[randColor] + 1 )\n\t\t\t\tglyphOn[randColor] += 1\n\t\t\t\tglyphOn[randColor] %= 3\n\t\t\t\tb.setBlockClass(BLOCK_PAIR) \\\n\t\t\t\t\t.setPairName(prevBlock.name) \\\n\t\t\t\t\t.setTextureName(randMaterial)\n\n\t\t\t\tprevBlock.setBlockClass(BLOCK_PAIR) \\\n\t\t\t\t\t.setPairName(b.name) \\\n\t\t\t\t\t.setTextureName(randMaterial)\n\t\t\teven = not even\n\t\t\tprevBlock = b\n\n\treturn puzzle\n\n# Storage class for blocks in a puzzle.\nclass PickledBlock:\n\tvar name\n\tvar blockClass = BLOCK_PAIR\n\tvar pairName\n\tvar textureName = \"Red\"\n\tvar blockPos\n\tvar laserExtent\n\tvar solverFlag\t\t# Keeps track of this block, only user for the solver.\n\n\tfunc setName(n):\n\t\tname = n\n\t\treturn self\n\n\tfunc setPairName(n):\n\t\tpairName = n\n\t\treturn self\n\n\tfunc setLaserExtent(n):\n\t\tlaserExtent = n\n\t\treturn self\n\n\tfunc setBlockPos(n):\n\t\tblockPos = n\n\t\treturn self\n\n\tfunc setBlockClass(c):\n\t\tblockClass = c\n\t\treturn self\n\n\tfunc setTextureName(t):\n\t\ttextureName = t\n\t\treturn self\n\n\tfunc toString():\n\t\treturn str(name) + \": \" + str(blockClass) + \" @ \" + str(blockPos)\n\n\tfunc toNode():\n\t\t# instantiate a block scene, assign the appropriate script to it\n\t\tvar n = blockScn.instance()\n\t\tn.set_script(blockScripts[blockClass])\n\n\t\tn.set_translation(blockPos * 2)\n\t\tn.blockPos = blockPos\n\n\t\tn.setName(str(name))\n\n\t\tn.setBlockType( blockClass )\n\n\t\tif blockClass == BLOCK_PAIR:\n\t\t\tn.setPairName(pairName).setTexture(textureName)\n\n\t\tif blockClass == BLOCK_WILD:\n\t\t\tn.setTexture(textureName)\n\n\t\tif blockClass == BLOCK_LASER:\n\t\t\tn.setPairName(pairName).setExtent(laserExtent).setTexture()\n\t\treturn n\n\n\t# test me plz\n\tfunc fromNode(n):\n\t\tblockPos = n.blockPos\n\n\t\tname = n.name_int\n\n\t\tblockClass = n.getBlockType()\n\n\t\tif blockClass == BLOCK_PAIR:\n\t\t\tpairName = n.pairName\n\t\t\ttextureName = n.textureName\n\n\t\tif blockClass == BLOCK_WILD:\n\t\t\ttextureName = n.textureName\n\n\t\tif blockClass == BLOCK_LASER:\n\t\t\tpairName = n.pairName\n\n\t# Convert this object to a dictionary.\n\tfunc toDict():\n\t\tvar di = { n = name\n\t\t \t , bC = blockClass\n\t\t\t , pN = pairName\n\t\t\t , tN = textureName\n\t\t\t , bP = blockPos\n\t\t\t , lE = laserExtent\n\t\t\t }\n\t\treturn di\n\n\t# Make this object from a dictionary.\n\tfunc fromDict( di ):\n\t\tname = di.n\n\t\tblockClass = di.bC\n\t\tpairName = di.pN\n\t\ttextureName = di.tN\n\t\tblockPos = di.bP\n\t\tlaserExtent = di.lE\n\n","old_contents":"const DIFF_EASY\t\t= 0\nconst DIFF_MEDIUM\t= 1\nconst DIFF_HARD\t\t= 2\n\n# this order is important\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\nconst SOLVER_ERROR_NONE\t\t\t\t= 0\nconst SOLVER_ERROR_MISSING_PAIR\t\t= 1\n\nconst blockColors = [\"Blue\", \"Orange\", \"Red\", \"Gray\", \"Purple\", \"Green\"]\n\n# Preload paired blocks\nconst blockScn = preload( \"res:\/\/blocks\/block.scn\" )\nconst blockScripts = [ preload( \"Blocks\/LaserBlock.gd\" )\n\t\t\t \t , preload( \"Blocks\/WildBlock.gd\" )\n\t\t\t \t , preload( \"Blocks\/PairedBlock.gd\" )\n\t\t\t \t , preload( \"Blocks\/LaserBlock.gd\" )\n\t\t\t \t ]\n\n# Hash map of all possible positions\nvar shape = {}\n\n# Calculates the layer that a block is on.\nstatic func calcBlockLayer( x, y, z ):\n\treturn max( max( abs( x ), abs( y ) ), abs( z ) )\n# THIS IS EVERYWHERE, ANY BETTER WAY TO HAVE FUNCTIONS BETWEEN SCRIPTS?\nstatic func calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n# Stores a puzzle in a convenient class.\nclass Puzzle:\n\n\tvar puzzleName\t\t\t# The name of the puzzle.\n\tvar puzzleLayers\t\t# The amount of layers the puzzle has.\n\tvar pairCount = []\t\t# The amount of pair blocks on each layer.\n\tvar shape = {}\t\t\t# All blocks indexed by position\n\tvar lasers = []\t\t\t# Laser connections.\n\tvar puzzleMan\t\t\t# Stores the puzzle manager for making pickled blocks.\n\n\t# Converts a puzzle to a dictionary.\n\tfunc toDict():\n\t\tvar blocksArray = []\n\t\tfor k in shape.keys():\n\t\t\tif shape[k] == null:\n\t\t\t\tcontinue\n\t\t\tblocksArray.append(shape[k].toDict())\n\n\t\tvar di = { pN = puzzleName\n\t\t \t , pL = puzzleLayers\n\t\t\t\t , bL = blocksArray\n\t\t\t\t , pC = pairCount\n\t\t\t\t , lS = lasers\n\t\t\t }\n\t\treturn di\n\n\t# Converts a dictionary to a puzzle.\n\tfunc fromDict( di ):\n\t\tpuzzleName = di.pN\n\t\tpuzzleLayers = di.pL\n\t\tpairCount = di.pC\n\t\tlasers = di.lS\n\n\t\tfor block in di.bL:\n\t\t\tvar nb = puzzleMan.PickledBlock.new()\n\t\t\tnb.fromDict( block )\n\t\t\tshape[nb.blockPos] = nb\n\t\treturn\n\n\t# Class that stores a solution or the errors in a puzzle.\n\tclass PuzzleSteps:\n\t\tvar solveable = false\n\t\tvar error = SOLVER_ERROR_NONE\n\t\tvar errorBlock = null\n\t\tvar solveSteps = []\n\n\t# THIS IS EVERYWHERE, ANY BETTER WAY TO HAVE FUNCTIONS BETWEEN SCRIPTS?\n\t# duplicate of the global definition above? Either way godot is chill and\n\t# doesn't complain\n\tfunc calcBlockLayerVec( pos ):\n\t\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n\t# Determines if a puzzle is solveable.\n\tfunc solvePuzzle():\n\t\t# Simply use the solvePuzzleSteps function and return the solveable part.\n\t\tvar ps = self.solvePuzzleSteps()\n\t\treturn ps.solveable\n\n\t# Determines if a puzzle is solveable and returns the steps needed to solve it.\n\tfunc solvePuzzleSteps():\n\t\tvar puzzleSteps = PuzzleSteps.new()\n\n\t\tvar pairs = []\n\n\t\t# Add new dictionary for each later.\n\t\tfor l in range( puzzleLayers + 1 ):\n\t\t\tpairs.append( {} )\n\n\t\t# Gather paired blocks from the puzzle.\n\t\tfor k in shape.keys():\n\t\t\tvar b = shape[k]\n\t\t\tif b.blockClass == BLOCK_PAIR:\n\t\t\t\tb.solverFlag = false\n\t\t\t\tpairs[calcBlockLayerVec(b.blockPos)][b.name] = b\n\n\t\t# Make sure each pair block has a valid pair on the same layer.\n\t\tfor l in pairs:\n\t\t\tfor p in l:\n\t\t\t\tif l.has( l[p].pairName ):\n\t\t\t\t\tif( not l[p].solverFlag ):\n\t\t\t\t\t\tl[p].solverFlag = true\n\t\t\t\t\t\tl[l[p].pairName].solverFlag = true\n\t\t\t\t\t\tpuzzleSteps.solveSteps.append( [ l[p].blockPos, l[l[p].pairName].blockPos ] )\n\t\t\t\telse:\n\t\t\t\t\tpuzzleSteps.error = SOLVER_ERROR_MISSING_PAIR\n\t\t\t\t\tpuzzleSteps.errorBlock = l[p]\n\t\t\t\t\treturn puzzleSteps\n\n\t\tpuzzleSteps.solveable = true\n\t\treturn puzzleSteps\n\n# Randomly shuffle an array.\nfunc shuffleArray( arr ):\n\tfor i in range( arr.size() - 1, 1, -1 ):\n\t\tvar swapVal = randi() % (i + 1)\n\t\tvar temp = arr[swapVal]\n\t\tarr[swapVal] = arr[i]\n\t\tarr[i] = temp\n\n# Determines the block type based on puzzle size and difficulty.\nfunc getBlockType( difficulty, pos ):\n\t# Determine if this is the goal block.\n\tif pos.x == 0 and pos.y == 0 and pos.z == 0:\n\t\treturn BLOCK_GOAL\n\n\t# Determine the layer this block is on.\n\tvar layer = calcBlockLayerVec( pos )\n\n\t# Determine how many blocks are on the outer part of the layer.\n\tvar layerCount = 0\n\tif abs( pos.x ) == layer:\n\t\tlayerCount += 1\n\tif abs( pos.y ) == layer:\n\t\tlayerCount += 1\n\tif abs( pos.z ) == layer:\n\t\tlayerCount += 1\n\n\t# Determine if this block is a laser.\n\tif difficulty == DIFF_EASY or difficulty == DIFF_MEDIUM:\n\t\tif layerCount == 3:\n\t\t\treturn BLOCK_LASER\n\n\tif difficulty == DIFF_HARD:\n\t\tif abs( pos.x ) == abs( pos.z ) and pos.y == 0:\n\t\t\treturn BLOCK_LASER\n\n\t# Determine if this block is a wild block.\n\tif difficulty == DIFF_EASY:\n\t\tif layerCount == 2:\n\t\t\treturn BLOCK_WILD\n\n\tif difficulty == DIFF_MEDIUM:\n\t\tif layerCount == 2:\n\t\t\tif pos.y == layer || pos.y == -layer:\n\t\t\t\treturn BLOCK_WILD\n\n\tif difficulty == DIFF_HARD:\n\t\tif layerCount == 1:\n\t\t\tif pos.y == 0:\n\t\t\t\treturn BLOCK_WILD\n\n\t# Otherwise it's a normal block.\n\treturn BLOCK_PAIR\n\n# Generates a solveable puzzle.\nfunc generatePuzzle( layers, difficulty ):\n\tvar blockID = 0\n\tvar puzzle = Puzzle.new()\n\tpuzzle.puzzleName = \"RANDOM PUZZLE\"\n\tpuzzle.puzzleLayers = layers\n\t\n\tvar glyphOn = []\n\tfor g in range( blockColors.size() ):\n\t\tglyphOn.append( 0 )\n\n\t# Create all possible positions.\n\tvar layeredblocks = []\n\tfor l in range( 0, layers + 1 ):\n\t\tlayeredblocks.append( [] )\n\t\tpuzzle.pairCount.append( 0 )\n\tfor x in range( -layers, layers + 1 ):\n\t\tfor y in range( -layers, layers + 1 ):\n\t\t\tfor z in range( -layers, layers + 1 ):\n\t\t\t\tlayeredblocks[calcBlockLayer( x, y, z )].append(Vector3(x,y,z))\n\n\t# Generate laser lines.\n\tfor l in range( 1, layers + 1 ):\n\t\tif difficulty == DIFF_MEDIUM or difficulty == DIFF_EASY:\n\t\t\tfor lx in [ -l, l ]:\n\t\t\t\tfor ly in [ -l, l ]:\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, ly, lx ), Vector3( lx*-1, ly, lx )] )\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, ly, lx ), Vector3( lx, ly, lx*-1 )] )\n\n\t\tif difficulty == DIFF_EASY:\n\t\t\tfor lx in [ -l, l ]:\n\t\t\t\tfor lz in [ -l, l ]:\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, l, lz ), Vector3( lx, -l, lz )] )\n\n\t\tif difficulty == DIFF_HARD:\n\t\t\tfor lx in [ -l, l ]:\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, 0, lx ), Vector3( lx*-1, 0, lx )] )\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, 0, lx ), Vector3( lx, 0, lx*-1 )] )\n\n\t# Assign block types based on position.\n\tfor l in range( 0, layers + 1 ):\n\t\t# Randomize the pairs.\n\t\tshuffleArray( layeredblocks[l] )\n\t\t# print( \"NUM \", layeredblocks[l].size() )\n\t\tvar prevBlock = null\n\t\tvar even = false\n\t\tfor pos in layeredblocks[l]:\n\t\t\tvar x = pos.x\n\t\t\tvar y = pos.y\n\t\t\tvar z = pos.z\n\n\t\t\tvar t = getBlockType( difficulty, pos )\n\n\t\t\tif t == BLOCK_GOAL:\n\t\t\t\tcontinue\n\n\t\t\tvar b = PickledBlock.new()\n\t\t\tb.blockPos = pos\n\t\t\tb.name = blockID\n\n\t\t\tblockID += 1\n\t\t\tpuzzle.shape[pos] = b\n\n\t\t\tif t == BLOCK_LASER:\n\t\t\t\tb.setBlockClass(BLOCK_LASER)\\\n\t\t\t\t\t.setLaserExtent( Vector3( 0, 1, 0 ) )\n\t\t\t\tcontinue\n\n\t\t\tif t == BLOCK_WILD:\n\t\t\t\tb.setBlockClass(BLOCK_WILD) \\\n\t\t\t\t\t.setTextureName(blockColors[randi() % blockColors.size()])\n\t\t\t\tcontinue\n\n\t\t\tif even:\n\t\t\t\t# Count this pair.\n\t\t\t\tpuzzle.pairCount[l] += 1\n\n\t\t\t\tvar randColor = ( randi() % blockColors.size() )\n\t\t\t\tvar randMaterial = blockColors[randColor] + str( glyphOn[randColor] + 1 )\n\t\t\t\tglyphOn[randColor] += 1\n\t\t\t\tglyphOn[randColor] %= 3\n\t\t\t\tb.setBlockClass(BLOCK_PAIR) \\\n\t\t\t\t\t.setPairName(prevBlock.name) \\\n\t\t\t\t\t.setTextureName(randMaterial)\n\n\t\t\t\tprevBlock.setBlockClass(BLOCK_PAIR) \\\n\t\t\t\t\t.setPairName(b.name) \\\n\t\t\t\t\t.setTextureName(randMaterial)\n\t\t\teven = not even\n\t\t\tprevBlock = b\n\n\treturn puzzle\n\n# Storage class for blocks in a puzzle.\nclass PickledBlock:\n\tvar name\n\tvar blockClass = BLOCK_PAIR\n\tvar pairName\n\tvar textureName = \"Red\"\n\tvar blockPos\n\tvar laserExtent\n\tvar solverFlag\t\t# Keeps track of this block, only user for the solver.\n\n\tfunc setName(n):\n\t\tname = n\n\t\treturn self\n\n\tfunc setPairName(n):\n\t\tpairName = n\n\t\treturn self\n\n\tfunc setLaserExtent(n):\n\t\tlaserExtent = n\n\t\treturn self\n\n\tfunc setBlockPos(n):\n\t\tblockPos = n\n\t\treturn self\n\n\tfunc setBlockClass(c):\n\t\tblockClass = c\n\t\treturn self\n\n\tfunc setTextureName(t):\n\t\ttextureName = t\n\t\treturn self\n\n\tfunc toString():\n\t\treturn str(name) + \": \" + str(blockClass) + \" @ \" + str(blockPos)\n\n\tfunc toNode():\n\t\t# instantiate a block scene, assign the appropriate script to it\n\t\tvar n = blockScn.instance()\n\t\tn.set_script(blockScripts[blockClass])\n\n\t\tn.set_translation(blockPos * 2)\n\t\tn.blockPos = blockPos\n\n\t\tn.setName(str(name)).setTexture( \"Red1\" )\n\n\t\tn.setBlockType( blockClass )\n\n\t\tif blockClass == BLOCK_PAIR:\n\t\t\tn.setPairName(pairName).setTexture(textureName)\n\n\t\tif blockClass == BLOCK_WILD:\n\t\t\tn.setTexture(textureName)\n\n\t\tif blockClass == BLOCK_LASER:\n\t\t\tn.setPairName(pairName).setExtent(laserExtent)\n\t\treturn n\n\n\t# test me plz\n\tfunc fromNode(n):\n\t\tblockPos = n.blockPos\n\n\t\tname = n.name_int\n\n\t\tblockClass = n.getBlockType()\n\n\t\tif blockClass == BLOCK_PAIR:\n\t\t\tpairName = n.pairName\n\t\t\ttextureName = n.textureName\n\n\t\tif blockClass == BLOCK_WILD:\n\t\t\ttextureName = n.textureName\n\n\t\tif blockClass == BLOCK_LASER:\n\t\t\tpairName = n.pairName\n\n\t# Convert this object to a dictionary.\n\tfunc toDict():\n\t\tvar di = { n = name\n\t\t \t , bC = blockClass\n\t\t\t , pN = pairName\n\t\t\t , tN = textureName\n\t\t\t , bP = blockPos\n\t\t\t , lE = laserExtent\n\t\t\t }\n\t\treturn di\n\n\t# Make this object from a dictionary.\n\tfunc fromDict( di ):\n\t\tname = di.n\n\t\tblockClass = di.bC\n\t\tpairName = di.pN\n\t\ttextureName = di.tN\n\t\tblockPos = di.bP\n\t\tlaserExtent = di.lE\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"c755404a614fd49c22c8128f3b5d051976c67229","subject":"Update GUIManager.gd","message":"Update GUIManager.gd\n\nQuick fix to splash screens. Can skip with mouse click and added a lot of comments.","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/GUIManager.gd","new_file":"src\/scripts\/GUIManager.gd","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"mit","lang":"GDScript"} {"commit":"f126634434520c0ae4e4df917bf001b2e6bcd712","subject":"GDScript test style fix","message":"GDScript test style fix\n","repos":"vnen\/godot,firefly2442\/godot,vkbsb\/godot,ZuBsPaCe\/godot,josempans\/godot,Zylann\/godot,pkowal1982\/godot,DmitriySalnikov\/godot,firefly2442\/godot,Valentactive\/godot,vnen\/godot,guilhermefelipecgs\/godot,josempans\/godot,vnen\/godot,DmitriySalnikov\/godot,Shockblast\/godot,godotengine\/godot,pkowal1982\/godot,vnen\/godot,akien-mga\/godot,akien-mga\/godot,josempans\/godot,firefly2442\/godot,vnen\/godot,BastiaanOlij\/godot,pkowal1982\/godot,Shockblast\/godot,Valentactive\/godot,vkbsb\/godot,Zylann\/godot,sanikoyes\/godot,pkowal1982\/godot,vkbsb\/godot,DmitriySalnikov\/godot,guilhermefelipecgs\/godot,Valentactive\/godot,godotengine\/godot,firefly2442\/godot,ZuBsPaCe\/godot,godotengine\/godot,ZuBsPaCe\/godot,pkowal1982\/godot,Faless\/godot,Zylann\/godot,firefly2442\/godot,sanikoyes\/godot,Zylann\/godot,ZuBsPaCe\/godot,godotengine\/godot,DmitriySalnikov\/godot,pkowal1982\/godot,Faless\/godot,Zylann\/godot,Valentactive\/godot,BastiaanOlij\/godot,Shockblast\/godot,Faless\/godot,Shockblast\/godot,ZuBsPaCe\/godot,godotengine\/godot,josempans\/godot,firefly2442\/godot,Shockblast\/godot,vkbsb\/godot,guilhermefelipecgs\/godot,sanikoyes\/godot,Valentactive\/godot,vkbsb\/godot,firefly2442\/godot,akien-mga\/godot,Zylann\/godot,vkbsb\/godot,Zylann\/godot,Shockblast\/godot,Valentactive\/godot,josempans\/godot,BastiaanOlij\/godot,sanikoyes\/godot,DmitriySalnikov\/godot,vkbsb\/godot,guilhermefelipecgs\/godot,sanikoyes\/godot,akien-mga\/godot,DmitriySalnikov\/godot,Shockblast\/godot,vnen\/godot,pkowal1982\/godot,josempans\/godot,akien-mga\/godot,guilhermefelipecgs\/godot,ZuBsPaCe\/godot,Faless\/godot,Faless\/godot,godotengine\/godot,josempans\/godot,Shockblast\/godot,Faless\/godot,BastiaanOlij\/godot,Valentactive\/godot,vnen\/godot,godotengine\/godot,akien-mga\/godot,sanikoyes\/godot,Faless\/godot,akien-mga\/godot,Valentactive\/godot,guilhermefelipecgs\/godot,sanikoyes\/godot,Zylann\/godot,josempans\/godot,BastiaanOlij\/godot,guilhermefelipecgs\/godot,pkowal1982\/godot,ZuBsPaCe\/godot,godotengine\/godot,firefly2442\/godot,DmitriySalnikov\/godot,sanikoyes\/godot,akien-mga\/godot,vnen\/godot,BastiaanOlij\/godot,vkbsb\/godot,ZuBsPaCe\/godot,BastiaanOlij\/godot,BastiaanOlij\/godot,guilhermefelipecgs\/godot,Faless\/godot","old_file":"modules\/gdscript\/tests\/scripts\/parser\/features\/str_preserves_case.gd","new_file":"modules\/gdscript\/tests\/scripts\/parser\/features\/str_preserves_case.gd","new_contents":"func test():\n\tvar null_var = null\n\tvar true_var: bool = true\n\tvar false_var: bool = false\n\tprint(str(null_var))\n\tprint(str(true_var))\n\tprint(str(false_var))\n","old_contents":"func test():\n\tvar null_var = null\n\tvar true_var:bool = true\n\tvar false_var:bool = false\n\tprint(str(null_var))\n\tprint(str(true_var))\n\tprint(str(false_var))\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"b6d571aed3bb604baf3184d7cc92d6137085de6a","subject":"Update main.gd","message":"Update main.gd","repos":"jlopezcur\/GodotAdmob,jlopezcur\/GodotAdmob","old_file":"example\/main.gd","new_file":"example\/main.gd","new_contents":"extends Node\n\nvar admob = null\nvar isReal = true\nvar isTop = true\nvar adId = \"ca-app-pub-XXXXXXXXXXXXXXXX\/XXXXXXXXXX\" # [Replace with your Ad Unit ID and delete this message.]\n\nfunc _ready():\n\tif(Globals.has_singleton(\"AdMob\")):\n\t\tadmob = Globals.get_singleton(\"AdMob\")\n\t\tadmob.init(isReal, get_instance_ID())\n\t\nfunc loadBanner():\n\tif admob != null:\n\t\tadmob.loadBanner(adId, isTop)\n\t\tget_tree().connect(\"screen_resized\", self, \"onResize\")\n\nfunc onResize():\n\tif admob != null:\n\t\tadmob.resize()\n\nfunc _on_admob_network_error():\n\tprint(\"Network Error\")\n\nfunc _on_admob_ad_loaded():\n\tprint(\"Ad loaded success\")\n","old_contents":"extends Node\n\nvar admob = null\nvar isReal = true\nvar isTop = true\nvar ad_id = \"ca-app-pub-XXXXXXXXXXXXXXXX\/XXXXXXXXXX\" # [Replace with your Ad Unit ID and delete this message.]\n\nfunc _ready():\n\tif(Globals.has_singleton(\"AdMob\")):\n\t\tadmob = Globals.get_singleton(\"AdMob\")\n\t\tadmob.init(isReal)\n\t\tadmob.loadBanner(ad_id, isTop)\n\t\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"53a7bd20f4726e5fb36c3ad9bc16e34c223b08ca","subject":"Improve the example with all callbacks and new features","message":"Improve the example with all callbacks and new features\n\n","repos":"jlopezcur\/GodotAdmob,jlopezcur\/GodotAdmob","old_file":"example\/main.gd","new_file":"example\/main.gd","new_contents":"extends Node2D\n\nvar admob = null\nvar isReal = false\nvar isTop = true\nvar adBannerId = \"ca-app-pub-XXXXXXXXXXXXXXXX\/XXXXXXXXXX\" # [Replace with your Ad Unit ID and delete this message.]\nvar adInterstitialId = \"ca-app-pub-XXXXXXXXXXXXXXXX\/XXXXXXXXXX\" # [Replace with your Ad Unit ID and delete this message.]\n\nfunc _ready():\n\tif(Globals.has_singleton(\"AdMob\")):\n\t\tadmob = Globals.get_singleton(\"AdMob\")\n\t\tadmob.init(isReal, get_instance_ID())\n\t\tloadBanner()\n\t\tloadInterstitial()\n\t\n\tget_tree().connect(\"screen_resized\", self, \"onResize\")\n\n# Loaders\n\nfunc loadBanner():\n\tif admob != null:\n\t\tadmob.loadBanner(adBannerId, isTop)\n\nfunc loadInterstitial():\n\tif admob != null:\n\t\tadmob.loadInterstitial(adInterstitialId)\n\n# Events\n\nfunc _on_BtnBanner_toggled(pressed):\n\tif admob != null:\n\t\tif pressed: admob.showBanner()\n\t\telse: admob.hideBanner()\n\nfunc _on_BtnInterstitial_pressed():\n\tif admob != null:\n\t\tadmob.showInterstitial()\n\nfunc _on_admob_network_error():\n\tprint(\"Network Error\")\n\nfunc _on_admob_ad_loaded():\n\tprint(\"Ad loaded success\")\n\tget_node(\"CanvasLayer\/BtnBanner\").set_disabled(false)\n\nfunc _on_interstitial_not_loaded():\n\tprint(\"Error: Interstitial not loaded\")\n\nfunc _on_interstitial_loaded():\n\tprint(\"Interstitial loaded\")\n\tget_node(\"CanvasLayer\/BtnInterstitial\").set_disabled(false)\n\nfunc _on_interstitial_close():\n\tprint(\"Interstitial closed\")\n\tget_node(\"CanvasLayer\/BtnInterstitial\").set_disabled(true)\n\n# Resize\n\nfunc onResize():\n\tif admob != null:\n\t\tadmob.resize()\n\n","old_contents":"extends Node\n\nvar admob = null\nvar isReal = true\nvar isTop = true\nvar adId = \"ca-app-pub-XXXXXXXXXXXXXXXX\/XXXXXXXXXX\" # [Replace with your Ad Unit ID and delete this message.]\n\nfunc _ready():\n\tif(Globals.has_singleton(\"AdMob\")):\n\t\tadmob = Globals.get_singleton(\"AdMob\")\n\t\tadmob.init(isReal, get_instance_ID())\n\t\nfunc loadBanner():\n\tif admob != null:\n\t\tadmob.loadBanner(adId, isTop)\n\t\tget_tree().connect(\"screen_resized\", self, \"onResize\")\n\nfunc onResize():\n\tif admob != null:\n\t\tadmob.resize()\n\nfunc _on_admob_network_error():\n\tprint(\"Network Error\")\n\nfunc _on_admob_ad_loaded():\n\tprint(\"Ad loaded success\")\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"181e16fa7d5144b5404f10cc4a3ddf3bd523f6b7","subject":"Ulepszy\u0142em map\u0119.","message":"Ulepszy\u0142em map\u0119.\n","repos":"Xpressik\/Podstawy-Gier-Komputerowych,Xpressik\/Podstawy-Gier-Komputerowych","old_file":"Assets\/savedCells.gd","new_file":"Assets\/savedCells.gd","new_contents":"\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\f\u0002\u0000\u0000\u0000\u000fAssembly-CSharp\u0004\u0001\u0000\u0000\u0000xSystem.Collections.Generic.List`1[[HexCellInfo, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]\u0003\u0000\u0000\u0000\u0006_items\u0005_size\b_version\u0004\u0000\u0000\rHexCellInfo[]\u0002\u0000\u0000\u0000\b\b\t\u0003\u0000\u0000\u0000,\u0001\u0000\u0000,\u0001\u0000\u0000\u0007\u0003\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0004\u000bHexCellInfo\u0002\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\t\u0005\u0000\u0000\u0000\t\u0006\u0000\u0000\u0000\t\u0007\u0000\u0000\u0000\t\b\u0000\u0000\u0000\t\t\u0000\u0000\u0000\t\n\u0000\u0000\u0000\t\u000b\u0000\u0000\u0000\t\f\u0000\u0000\u0000\t\r\u0000\u0000\u0000\t\u000e\u0000\u0000\u0000\t\u000f\u0000\u0000\u0000\t\u0010\u0000\u0000\u0000\t\u0011\u0000\u0000\u0000\t\u0012\u0000\u0000\u0000\t\u0013\u0000\u0000\u0000\t\u0014\u0000\u0000\u0000\t\u0015\u0000\u0000\u0000\t\u0016\u0000\u0000\u0000\t\u0017\u0000\u0000\u0000\t\u0018\u0000\u0000\u0000\t\u0019\u0000\u0000\u0000\t\u001a\u0000\u0000\u0000\t\u001b\u0000\u0000\u0000\t\u001c\u0000\u0000\u0000\t\u001d\u0000\u0000\u0000\t\u001e\u0000\u0000\u0000\t\u001f\u0000\u0000\u0000\t \u0000\u0000\u0000\t!\u0000\u0000\u0000\t\"\u0000\u0000\u0000\t#\u0000\u0000\u0000\t$\u0000\u0000\u0000\t%\u0000\u0000\u0000\t&\u0000\u0000\u0000\t'\u0000\u0000\u0000\t(\u0000\u0000\u0000\t)\u0000\u0000\u0000\t*\u0000\u0000\u0000\t+\u0000\u0000\u0000\t,\u0000\u0000\u0000\t-\u0000\u0000\u0000\t.\u0000\u0000\u0000\t\/\u0000\u0000\u0000\t0\u0000\u0000\u0000\t1\u0000\u0000\u0000\t2\u0000\u0000\u0000\t3\u0000\u0000\u0000\t4\u0000\u0000\u0000\t5\u0000\u0000\u0000\t6\u0000\u0000\u0000\t7\u0000\u0000\u0000\t8\u0000\u0000\u0000\t9\u0000\u0000\u0000\t:\u0000\u0000\u0000\t;\u0000\u0000\u0000\t<\u0000\u0000\u0000\t=\u0000\u0000\u0000\t>\u0000\u0000\u0000\t?\u0000\u0000\u0000\t@\u0000\u0000\u0000\tA\u0000\u0000\u0000\tB\u0000\u0000\u0000\tC\u0000\u0000\u0000\tD\u0000\u0000\u0000\tE\u0000\u0000\u0000\tF\u0000\u0000\u0000\tG\u0000\u0000\u0000\tH\u0000\u0000\u0000\tI\u0000\u0000\u0000\tJ\u0000\u0000\u0000\tK\u0000\u0000\u0000\tL\u0000\u0000\u0000\tM\u0000\u0000\u0000\tN\u0000\u0000\u0000\tO\u0000\u0000\u0000\tP\u0000\u0000\u0000\tQ\u0000\u0000\u0000\tR\u0000\u0000\u0000\tS\u0000\u0000\u0000\tT\u0000\u0000\u0000\tU\u0000\u0000\u0000\tV\u0000\u0000\u0000\tW\u0000\u0000\u0000\tX\u0000\u0000\u0000\tY\u0000\u0000\u0000\tZ\u0000\u0000\u0000\t[\u0000\u0000\u0000\t\\\u0000\u0000\u0000\t]\u0000\u0000\u0000\t^\u0000\u0000\u0000\t_\u0000\u0000\u0000\t`\u0000\u0000\u0000\ta\u0000\u0000\u0000\tb\u0000\u0000\u0000\tc\u0000\u0000\u0000\td\u0000\u0000\u0000\te\u0000\u0000\u0000\tf\u0000\u0000\u0000\tg\u0000\u0000\u0000\th\u0000\u0000\u0000\ti\u0000\u0000\u0000\tj\u0000\u0000\u0000\tk\u0000\u0000\u0000\tl\u0000\u0000\u0000\tm\u0000\u0000\u0000\tn\u0000\u0000\u0000\to\u0000\u0000\u0000\tp\u0000\u0000\u0000\tq\u0000\u0000\u0000\tr\u0000\u0000\u0000\ts\u0000\u0000\u0000\tt\u0000\u0000\u0000\tu\u0000\u0000\u0000\tv\u0000\u0000\u0000\tw\u0000\u0000\u0000\tx\u0000\u0000\u0000\ty\u0000\u0000\u0000\tz\u0000\u0000\u0000\t{\u0000\u0000\u0000\t|\u0000\u0000\u0000\t}\u0000\u0000\u0000\t~\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0001\u0000\u0000\t\u0001\u0001\u0000\u0000\t\u0002\u0001\u0000\u0000\t\u0003\u0001\u0000\u0000\t\u0004\u0001\u0000\u0000\t\u0005\u0001\u0000\u0000\t\u0006\u0001\u0000\u0000\t\u0007\u0001\u0000\u0000\t\b\u0001\u0000\u0000\t\t\u0001\u0000\u0000\t\n\u0001\u0000\u0000\t\u000b\u0001\u0000\u0000\t\f\u0001\u0000\u0000\t\r\u0001\u0000\u0000\t\u000e\u0001\u0000\u0000\t\u000f\u0001\u0000\u0000\t\u0010\u0001\u0000\u0000\t\u0011\u0001\u0000\u0000\t\u0012\u0001\u0000\u0000\t\u0013\u0001\u0000\u0000\t\u0014\u0001\u0000\u0000\t\u0015\u0001\u0000\u0000\t\u0016\u0001\u0000\u0000\t\u0017\u0001\u0000\u0000\t\u0018\u0001\u0000\u0000\t\u0019\u0001\u0000\u0000\t\u001a\u0001\u0000\u0000\t\u001b\u0001\u0000\u0000\t\u001c\u0001\u0000\u0000\t\u001d\u0001\u0000\u0000\t\u001e\u0001\u0000\u0000\t\u001f\u0001\u0000\u0000\t \u0001\u0000\u0000\t!\u0001\u0000\u0000\t\"\u0001\u0000\u0000\t#\u0001\u0000\u0000\t$\u0001\u0000\u0000\t%\u0001\u0000\u0000\t&\u0001\u0000\u0000\t'\u0001\u0000\u0000\t(\u0001\u0000\u0000\t)\u0001\u0000\u0000\t*\u0001\u0000\u0000\t+\u0001\u0000\u0000\t,\u0001\u0000\u0000\t-\u0001\u0000\u0000\t.\u0001\u0000\u0000\t\/\u0001\u0000\u0000\r\u0005\u0004\u0000\u0000\u0000\u000bHexCellInfo\f\u0000\u0000\u0000\televation\b_myColor\u0010hasIncomingRiver\u0010hasOutgoingRiver\rincomingRiver\routgoingRiver\nwaterLevel\fisUnderWater\bisWalled\nurbanLevel\nplantLevel\tfarmLevel\u0000\u0007\u0000\u0000\u0004\u0004\u0000\u0000\u0000\u0000\u0000\u0000\b\u000b\u0001\u0001\fHexDirection\u0002\u0000\u0000\u0000\fHexDirection\u0002\u0000\u0000\u0000\b\u0001\u0001\b\b\b\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t0\u0001\u0000\u0000\u0000\u0000\u00051\u0001\u0000\u0000\fHexDirection\u0001\u0000\u0000\u0000\u0007value__\u0000\b\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00012\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0005\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t3\u0001\u0000\u0000\u0000\u0000\u00014\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00015\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0006\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t6\u0001\u0000\u0000\u0000\u0000\u00017\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00018\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0007\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t9\u0001\u0000\u0000\u0000\u0000\u0001:\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001;\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\b\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t<\u0001\u0000\u0000\u0000\u0000\u0001=\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001>\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\t\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t?\u0001\u0000\u0000\u0000\u0000\u0001@\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001A\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\n\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tB\u0001\u0000\u0000\u0000\u0000\u0001C\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001D\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000b\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tE\u0001\u0000\u0000\u0000\u0000\u0001F\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001G\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\f\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tH\u0001\u0000\u0000\u0000\u0000\u0001I\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001J\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\r\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tK\u0001\u0000\u0000\u0000\u0000\u0001L\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001M\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000e\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tN\u0001\u0000\u0000\u0000\u0000\u0001O\u0001\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001P\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000f\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tQ\u0001\u0000\u0000\u0000\u0000\u0001R\u0001\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001S\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0010\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tT\u0001\u0000\u0000\u0000\u0000\u0001U\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001V\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0011\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tW\u0001\u0000\u0000\u0000\u0000\u0001X\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001Y\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0012\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tZ\u0001\u0000\u0000\u0000\u0000\u0001[\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\\\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0013\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t]\u0001\u0000\u0000\u0000\u0000\u0001^\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001_\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0014\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t`\u0001\u0000\u0000\u0000\u0000\u0001a\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001b\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0015\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tc\u0001\u0000\u0000\u0000\u0000\u0001d\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001e\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0016\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tf\u0001\u0000\u0000\u0000\u0000\u0001g\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001h\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0017\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\ti\u0001\u0000\u0000\u0000\u0000\u0001j\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001k\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0018\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tl\u0001\u0000\u0000\u0000\u0000\u0001m\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001n\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0019\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\to\u0001\u0000\u0000\u0000\u0000\u0001p\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001q\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001a\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\tr\u0001\u0000\u0000\u0000\u0000\u0001s\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001t\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001b\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\tu\u0001\u0000\u0000\u0000\u0000\u0001v\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001w\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001c\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\tx\u0001\u0000\u0000\u0000\u0000\u0001y\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001z\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001d\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t{\u0001\u0000\u0000\u0000\u0000\u0001|\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001}\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001e\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t~\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001f\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 \u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001!\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\"\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001#\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001$\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001%\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001&\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001'\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001(\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001)\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001*\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001+\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001,\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001-\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001.\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\/\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00010\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00011\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00012\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u00013\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00014\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00015\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00016\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00017\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0001\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00018\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0001\u0000\u0000\u0001\u0001\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00019\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0001\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001:\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001;\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0001\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001<\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0001\u0000\u0000\u0001\u0001\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001=\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0001\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001>\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001?\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001@\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001A\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001B\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001C\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001D\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001E\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001F\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0001G\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001H\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001I\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0000\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001J\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0002\u0000\u0000\u0000\u0000\u0001\u0003\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0004\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001K\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0005\u0002\u0000\u0000\u0000\u0000\u0001\u0006\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0007\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001L\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\b\u0002\u0000\u0000\u0000\u0000\u0001\t\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\n\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001M\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u000b\u0002\u0000\u0000\u0000\u0000\u0001\f\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\r\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001N\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u000e\u0002\u0000\u0000\u0000\u0000\u0001\u000f\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0010\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001O\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0011\u0002\u0000\u0000\u0000\u0000\u0001\u0012\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0013\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001P\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0014\u0002\u0000\u0000\u0000\u0000\u0001\u0015\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0016\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001Q\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0017\u0002\u0000\u0000\u0000\u0000\u0001\u0018\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0019\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001R\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u001a\u0002\u0000\u0000\u0000\u0000\u0001\u001b\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001c\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001S\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u001d\u0002\u0000\u0000\u0000\u0000\u0001\u001e\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001f\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001T\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0002\u0000\u0000\u0000\u0000\u0001!\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\"\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001U\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t#\u0002\u0000\u0000\u0000\u0000\u0001$\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001%\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001V\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t&\u0002\u0000\u0000\u0000\u0000\u0001'\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001(\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001W\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t)\u0002\u0000\u0000\u0000\u0000\u0001*\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001+\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001X\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t,\u0002\u0000\u0000\u0000\u0001\u0001-\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001.\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001Y\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t\/\u0002\u0000\u0000\u0000\u0000\u00010\u0002\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u00011\u0002\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001Z\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t2\u0002\u0000\u0000\u0000\u0000\u00013\u0002\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u00014\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0001[\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t5\u0002\u0000\u0000\u0000\u0000\u00016\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00017\u0002\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\\\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t8\u0002\u0000\u0000\u0000\u0000\u00019\u0002\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001:\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001]\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t;\u0002\u0000\u0000\u0000\u0000\u0001<\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001=\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001^\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t>\u0002\u0000\u0000\u0000\u0000\u0001?\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001@\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001_\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tA\u0002\u0000\u0000\u0000\u0000\u0001B\u0002\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0001C\u0002\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001`\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tD\u0002\u0000\u0000\u0000\u0000\u0001E\u0002\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001F\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001a\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tG\u0002\u0000\u0000\u0000\u0000\u0001H\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001I\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001b\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tJ\u0002\u0000\u0000\u0000\u0000\u0001K\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001L\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001c\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tM\u0002\u0000\u0000\u0000\u0000\u0001N\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001O\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001d\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tP\u0002\u0000\u0000\u0000\u0000\u0001Q\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001R\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001e\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tS\u0002\u0000\u0000\u0000\u0000\u0001T\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001U\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001f\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tV\u0002\u0000\u0000\u0000\u0000\u0001W\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001X\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001g\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tY\u0002\u0000\u0000\u0000\u0000\u0001Z\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001[\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001h\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\\\u0002\u0000\u0000\u0000\u0000\u0001]\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001^\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001i\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t_\u0002\u0000\u0000\u0000\u0000\u0001`\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001a\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001j\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tb\u0002\u0000\u0000\u0000\u0000\u0001c\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001d\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001k\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\te\u0002\u0000\u0000\u0001\u0001\u0001f\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001g\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001l\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\th\u0002\u0000\u0000\u0000\u0000\u0001i\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001j\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001m\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tk\u0002\u0000\u0000\u0000\u0000\u0001l\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001m\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001n\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tn\u0002\u0000\u0000\u0000\u0000\u0001o\u0002\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001p\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001o\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tq\u0002\u0000\u0000\u0000\u0000\u0001r\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001s\u0002\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001p\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tt\u0002\u0000\u0000\u0000\u0000\u0001u\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001v\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001q\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tw\u0002\u0000\u0000\u0000\u0000\u0001x\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001y\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001r\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tz\u0002\u0000\u0000\u0000\u0000\u0001{\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001|\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001s\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t}\u0002\u0000\u0000\u0000\u0000\u0001~\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001t\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001u\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001v\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001w\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0001\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001x\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001y\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001z\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001{\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001|\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001}\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001~\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0002\u0000\u0000\u0001\u0001\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0001\u0001\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0001\u0001\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0001\u0001\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0003\u0000\u0000\u0000\u0000\u0001\u0002\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0003\u0000\u0000\u0001\u0001\u0001\u0005\u0003\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0006\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0007\u0003\u0000\u0000\u0000\u0000\u0001\b\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\t\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\n\u0003\u0000\u0000\u0000\u0000\u0001\u000b\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\f\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\r\u0003\u0000\u0000\u0000\u0000\u0001\u000e\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000f\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0010\u0003\u0000\u0000\u0000\u0000\u0001\u0011\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0012\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0013\u0003\u0000\u0000\u0000\u0000\u0001\u0014\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0015\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0016\u0003\u0000\u0000\u0001\u0001\u0001\u0017\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0018\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0019\u0003\u0000\u0000\u0000\u0000\u0001\u001a\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u001b\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u001c\u0003\u0000\u0000\u0000\u0000\u0001\u001d\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001e\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u001f\u0003\u0000\u0000\u0000\u0000\u0001 \u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001!\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\"\u0003\u0000\u0000\u0000\u0000\u0001#\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001$\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t%\u0003\u0000\u0000\u0000\u0000\u0001&\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001'\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t(\u0003\u0000\u0000\u0000\u0000\u0001)\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001*\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t+\u0003\u0000\u0000\u0000\u0000\u0001,\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001-\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t.\u0003\u0000\u0000\u0000\u0000\u0001\/\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u00010\u0003\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t1\u0003\u0000\u0000\u0000\u0000\u00012\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00013\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\t4\u0003\u0000\u0000\u0000\u0000\u00015\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00016\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t7\u0003\u0000\u0000\u0000\u0000\u00018\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00019\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t:\u0003\u0000\u0000\u0000\u0000\u0001;\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001<\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t=\u0003\u0000\u0000\u0000\u0000\u0001>\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001?\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t@\u0003\u0000\u0000\u0001\u0001\u0001A\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001B\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\tC\u0003\u0000\u0000\u0000\u0000\u0001D\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001E\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tF\u0003\u0000\u0000\u0000\u0000\u0001G\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001H\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tI\u0003\u0000\u0000\u0000\u0000\u0001J\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001K\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tL\u0003\u0000\u0000\u0000\u0000\u0001M\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001N\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tO\u0003\u0000\u0000\u0000\u0000\u0001P\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001Q\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tR\u0003\u0000\u0000\u0001\u0001\u0001S\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0001T\u0003\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tU\u0003\u0000\u0000\u0000\u0000\u0001V\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001W\u0003\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tX\u0003\u0000\u0000\u0000\u0000\u0001Y\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001Z\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t[\u0003\u0000\u0000\u0000\u0000\u0001\\\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001]\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t^\u0003\u0000\u0000\u0000\u0000\u0001_\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001`\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\ta\u0003\u0000\u0000\u0000\u0000\u0001b\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001c\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\td\u0003\u0000\u0000\u0000\u0000\u0001e\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001f\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tg\u0003\u0000\u0000\u0000\u0000\u0001h\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001i\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tj\u0003\u0000\u0000\u0000\u0000\u0001k\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001l\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\tm\u0003\u0000\u0000\u0000\u0000\u0001n\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001o\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\tp\u0003\u0000\u0000\u0000\u0000\u0001q\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001r\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\ts\u0003\u0000\u0000\u0000\u0000\u0001t\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001u\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tv\u0003\u0000\u0000\u0000\u0000\u0001w\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001x\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\ty\u0003\u0000\u0000\u0000\u0000\u0001z\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001{\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\t|\u0003\u0000\u0000\u0001\u0001\u0001}\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001~\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0001\u0001\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\t\u0003\u0000\u0000\u0001\u0001\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0001\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\t\u0003\u0000\u0000\u0001\u0001\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0000\u0004\u0000\u0000\u0000\u0000\u0001\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0005\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0006\u0004\u0000\u0000\u0000\u0000\u0001\u0007\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\b\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\t\u0004\u0000\u0000\u0000\u0000\u0001\n\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000b\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\f\u0004\u0000\u0000\u0000\u0000\u0001\r\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000e\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u000f\u0004\u0000\u0000\u0000\u0000\u0001\u0010\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0011\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0012\u0004\u0000\u0000\u0000\u0000\u0001\u0013\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0014\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0015\u0004\u0000\u0000\u0000\u0000\u0001\u0016\u0004\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0017\u0004\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0018\u0004\u0000\u0000\u0000\u0000\u0001\u0019\u0004\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u001a\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u001b\u0004\u0000\u0000\u0000\u0000\u0001\u001c\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001d\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u001e\u0004\u0000\u0000\u0000\u0000\u0001\u001f\u0004\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001 \u0004\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t!\u0004\u0000\u0000\u0000\u0000\u0001\"\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001#\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t$\u0004\u0000\u0000\u0000\u0000\u0001%\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001&\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t'\u0004\u0000\u0000\u0000\u0000\u0001(\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001)\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t*\u0004\u0000\u0000\u0000\u0000\u0001+\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001,\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\t-\u0004\u0000\u0000\u0000\u0000\u0001.\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\/\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t0\u0004\u0000\u0000\u0000\u0000\u00011\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00012\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0005\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t3\u0004\u0000\u0000\u0001\u0001\u00014\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00015\u0004\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0006\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t6\u0004\u0000\u0000\u0000\u0000\u00017\u0004\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u00018\u0004\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0007\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t9\u0004\u0000\u0000\u0000\u0000\u0001:\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001;\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\b\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t<\u0004\u0000\u0000\u0000\u0000\u0001=\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001>\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\t\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t?\u0004\u0000\u0000\u0000\u0000\u0001@\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001A\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\n\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tB\u0004\u0000\u0000\u0000\u0000\u0001C\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001D\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000b\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tE\u0004\u0000\u0000\u0000\u0000\u0001F\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001G\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tH\u0004\u0000\u0000\u0000\u0000\u0001I\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001J\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\r\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tK\u0004\u0000\u0000\u0000\u0000\u0001L\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001M\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000e\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tN\u0004\u0000\u0000\u0000\u0000\u0001O\u0004\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001P\u0004\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tQ\u0004\u0000\u0000\u0000\u0000\u0001R\u0004\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001S\u0004\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0010\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tT\u0004\u0000\u0000\u0000\u0000\u0001U\u0004\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0001V\u0004\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0011\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tW\u0004\u0000\u0000\u0000\u0000\u0001X\u0004\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001Y\u0004\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0012\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tZ\u0004\u0000\u0000\u0000\u0000\u0001[\u0004\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\\\u0004\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0013\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t]\u0004\u0000\u0000\u0000\u0000\u0001^\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001_\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0014\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t`\u0004\u0000\u0000\u0000\u0000\u0001a\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001b\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0015\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tc\u0004\u0000\u0000\u0000\u0000\u0001d\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001e\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0016\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tf\u0004\u0000\u0000\u0000\u0000\u0001g\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001h\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0017\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\ti\u0004\u0000\u0000\u0000\u0000\u0001j\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001k\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0018\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tl\u0004\u0000\u0000\u0000\u0000\u0001m\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001n\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0019\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\to\u0004\u0000\u0000\u0000\u0001\u0001p\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001q\u0004\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001a\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tr\u0004\u0000\u0000\u0000\u0000\u0001s\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001t\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001b\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tu\u0004\u0000\u0000\u0000\u0000\u0001v\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001w\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001c\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tx\u0004\u0000\u0000\u0000\u0000\u0001y\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001z\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001d\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t{\u0004\u0000\u0000\u0000\u0000\u0001|\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001}\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001e\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t~\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 \u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001!\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\"\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001#\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001$\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001%\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001&\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001'\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001(\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001)\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001*\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001+\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001,\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001-\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001.\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\/\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u000f0\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f3\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f6\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f9\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f<\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f?\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fB\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fE\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fH\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fK\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fN\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fQ\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fT\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fW\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fZ\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f]\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f`\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fc\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000ff\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fi\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fl\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fo\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fr\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fu\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fx\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f{\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f~\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0005\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\b\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u000b\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u000e\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0011\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0014\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0017\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u001a\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u001d\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f \u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f#\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f&\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f)\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f,\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\/\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f2\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f5\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f8\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f;\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f>\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fA\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fD\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fG\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fJ\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fM\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fP\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fS\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fV\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fY\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\\\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f_\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fb\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fe\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fh\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fk\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fn\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fq\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000ft\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fw\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fz\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f}\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0007\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\n\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\r\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0010\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0013\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0016\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0019\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u001c\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u001f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\"\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f%\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f(\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f+\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f.\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f1\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f4\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f7\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f:\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f=\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f@\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fC\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fF\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fI\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fL\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fO\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fR\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fU\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fX\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f[\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f^\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fa\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fd\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fg\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fj\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fm\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fp\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fs\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fv\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fy\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f|\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0000\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0006\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\t\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0012\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0015\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0018\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u001b\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u001e\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f!\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f$\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f'\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f*\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f-\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f0\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f3\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f6\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f9\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f<\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f?\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fB\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fE\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fH\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fK\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fN\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fQ\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fT\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fW\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fZ\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f]\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f`\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fc\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000ff\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fi\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fl\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000fo\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000fr\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000fu\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000fx\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f{\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f~\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000b","old_contents":"\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\f\u0002\u0000\u0000\u0000\u000fAssembly-CSharp\u0004\u0001\u0000\u0000\u0000xSystem.Collections.Generic.List`1[[HexCellInfo, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]\u0003\u0000\u0000\u0000\u0006_items\u0005_size\b_version\u0004\u0000\u0000\rHexCellInfo[]\u0002\u0000\u0000\u0000\b\b\t\u0003\u0000\u0000\u0000,\u0001\u0000\u0000,\u0001\u0000\u0000\u0007\u0003\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0004\u000bHexCellInfo\u0002\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\t\u0005\u0000\u0000\u0000\t\u0006\u0000\u0000\u0000\t\u0007\u0000\u0000\u0000\t\b\u0000\u0000\u0000\t\t\u0000\u0000\u0000\t\n\u0000\u0000\u0000\t\u000b\u0000\u0000\u0000\t\f\u0000\u0000\u0000\t\r\u0000\u0000\u0000\t\u000e\u0000\u0000\u0000\t\u000f\u0000\u0000\u0000\t\u0010\u0000\u0000\u0000\t\u0011\u0000\u0000\u0000\t\u0012\u0000\u0000\u0000\t\u0013\u0000\u0000\u0000\t\u0014\u0000\u0000\u0000\t\u0015\u0000\u0000\u0000\t\u0016\u0000\u0000\u0000\t\u0017\u0000\u0000\u0000\t\u0018\u0000\u0000\u0000\t\u0019\u0000\u0000\u0000\t\u001a\u0000\u0000\u0000\t\u001b\u0000\u0000\u0000\t\u001c\u0000\u0000\u0000\t\u001d\u0000\u0000\u0000\t\u001e\u0000\u0000\u0000\t\u001f\u0000\u0000\u0000\t \u0000\u0000\u0000\t!\u0000\u0000\u0000\t\"\u0000\u0000\u0000\t#\u0000\u0000\u0000\t$\u0000\u0000\u0000\t%\u0000\u0000\u0000\t&\u0000\u0000\u0000\t'\u0000\u0000\u0000\t(\u0000\u0000\u0000\t)\u0000\u0000\u0000\t*\u0000\u0000\u0000\t+\u0000\u0000\u0000\t,\u0000\u0000\u0000\t-\u0000\u0000\u0000\t.\u0000\u0000\u0000\t\/\u0000\u0000\u0000\t0\u0000\u0000\u0000\t1\u0000\u0000\u0000\t2\u0000\u0000\u0000\t3\u0000\u0000\u0000\t4\u0000\u0000\u0000\t5\u0000\u0000\u0000\t6\u0000\u0000\u0000\t7\u0000\u0000\u0000\t8\u0000\u0000\u0000\t9\u0000\u0000\u0000\t:\u0000\u0000\u0000\t;\u0000\u0000\u0000\t<\u0000\u0000\u0000\t=\u0000\u0000\u0000\t>\u0000\u0000\u0000\t?\u0000\u0000\u0000\t@\u0000\u0000\u0000\tA\u0000\u0000\u0000\tB\u0000\u0000\u0000\tC\u0000\u0000\u0000\tD\u0000\u0000\u0000\tE\u0000\u0000\u0000\tF\u0000\u0000\u0000\tG\u0000\u0000\u0000\tH\u0000\u0000\u0000\tI\u0000\u0000\u0000\tJ\u0000\u0000\u0000\tK\u0000\u0000\u0000\tL\u0000\u0000\u0000\tM\u0000\u0000\u0000\tN\u0000\u0000\u0000\tO\u0000\u0000\u0000\tP\u0000\u0000\u0000\tQ\u0000\u0000\u0000\tR\u0000\u0000\u0000\tS\u0000\u0000\u0000\tT\u0000\u0000\u0000\tU\u0000\u0000\u0000\tV\u0000\u0000\u0000\tW\u0000\u0000\u0000\tX\u0000\u0000\u0000\tY\u0000\u0000\u0000\tZ\u0000\u0000\u0000\t[\u0000\u0000\u0000\t\\\u0000\u0000\u0000\t]\u0000\u0000\u0000\t^\u0000\u0000\u0000\t_\u0000\u0000\u0000\t`\u0000\u0000\u0000\ta\u0000\u0000\u0000\tb\u0000\u0000\u0000\tc\u0000\u0000\u0000\td\u0000\u0000\u0000\te\u0000\u0000\u0000\tf\u0000\u0000\u0000\tg\u0000\u0000\u0000\th\u0000\u0000\u0000\ti\u0000\u0000\u0000\tj\u0000\u0000\u0000\tk\u0000\u0000\u0000\tl\u0000\u0000\u0000\tm\u0000\u0000\u0000\tn\u0000\u0000\u0000\to\u0000\u0000\u0000\tp\u0000\u0000\u0000\tq\u0000\u0000\u0000\tr\u0000\u0000\u0000\ts\u0000\u0000\u0000\tt\u0000\u0000\u0000\tu\u0000\u0000\u0000\tv\u0000\u0000\u0000\tw\u0000\u0000\u0000\tx\u0000\u0000\u0000\ty\u0000\u0000\u0000\tz\u0000\u0000\u0000\t{\u0000\u0000\u0000\t|\u0000\u0000\u0000\t}\u0000\u0000\u0000\t~\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0001\u0000\u0000\t\u0001\u0001\u0000\u0000\t\u0002\u0001\u0000\u0000\t\u0003\u0001\u0000\u0000\t\u0004\u0001\u0000\u0000\t\u0005\u0001\u0000\u0000\t\u0006\u0001\u0000\u0000\t\u0007\u0001\u0000\u0000\t\b\u0001\u0000\u0000\t\t\u0001\u0000\u0000\t\n\u0001\u0000\u0000\t\u000b\u0001\u0000\u0000\t\f\u0001\u0000\u0000\t\r\u0001\u0000\u0000\t\u000e\u0001\u0000\u0000\t\u000f\u0001\u0000\u0000\t\u0010\u0001\u0000\u0000\t\u0011\u0001\u0000\u0000\t\u0012\u0001\u0000\u0000\t\u0013\u0001\u0000\u0000\t\u0014\u0001\u0000\u0000\t\u0015\u0001\u0000\u0000\t\u0016\u0001\u0000\u0000\t\u0017\u0001\u0000\u0000\t\u0018\u0001\u0000\u0000\t\u0019\u0001\u0000\u0000\t\u001a\u0001\u0000\u0000\t\u001b\u0001\u0000\u0000\t\u001c\u0001\u0000\u0000\t\u001d\u0001\u0000\u0000\t\u001e\u0001\u0000\u0000\t\u001f\u0001\u0000\u0000\t \u0001\u0000\u0000\t!\u0001\u0000\u0000\t\"\u0001\u0000\u0000\t#\u0001\u0000\u0000\t$\u0001\u0000\u0000\t%\u0001\u0000\u0000\t&\u0001\u0000\u0000\t'\u0001\u0000\u0000\t(\u0001\u0000\u0000\t)\u0001\u0000\u0000\t*\u0001\u0000\u0000\t+\u0001\u0000\u0000\t,\u0001\u0000\u0000\t-\u0001\u0000\u0000\t.\u0001\u0000\u0000\t\/\u0001\u0000\u0000\r\u0005\u0004\u0000\u0000\u0000\u000bHexCellInfo\f\u0000\u0000\u0000\televation\b_myColor\u0010hasIncomingRiver\u0010hasOutgoingRiver\rincomingRiver\routgoingRiver\nwaterLevel\fisUnderWater\bisWalled\nurbanLevel\nplantLevel\tfarmLevel\u0000\u0007\u0000\u0000\u0004\u0004\u0000\u0000\u0000\u0000\u0000\u0000\b\u000b\u0001\u0001\fHexDirection\u0002\u0000\u0000\u0000\fHexDirection\u0002\u0000\u0000\u0000\b\u0001\u0001\b\b\b\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t0\u0001\u0000\u0000\u0000\u0000\u00051\u0001\u0000\u0000\fHexDirection\u0001\u0000\u0000\u0000\u0007value__\u0000\b\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00012\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0005\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t3\u0001\u0000\u0000\u0000\u0000\u00014\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00015\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0006\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t6\u0001\u0000\u0000\u0000\u0000\u00017\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00018\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0007\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t9\u0001\u0000\u0000\u0000\u0000\u0001:\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001;\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\b\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t<\u0001\u0000\u0000\u0000\u0000\u0001=\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001>\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\t\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t?\u0001\u0000\u0000\u0000\u0000\u0001@\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001A\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\n\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tB\u0001\u0000\u0000\u0000\u0000\u0001C\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001D\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000b\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tE\u0001\u0000\u0000\u0000\u0000\u0001F\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001G\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\f\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tH\u0001\u0000\u0000\u0000\u0000\u0001I\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001J\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\r\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tK\u0001\u0000\u0000\u0000\u0000\u0001L\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001M\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000e\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tN\u0001\u0000\u0000\u0001\u0000\u0001O\u0001\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001P\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000f\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tQ\u0001\u0000\u0000\u0001\u0001\u0001R\u0001\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001S\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0010\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tT\u0001\u0000\u0000\u0001\u0000\u0001U\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001V\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0011\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tW\u0001\u0000\u0000\u0000\u0000\u0001X\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001Y\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0012\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tZ\u0001\u0000\u0000\u0000\u0000\u0001[\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\\\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0013\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t]\u0001\u0000\u0000\u0000\u0000\u0001^\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001_\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0014\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t`\u0001\u0000\u0000\u0000\u0000\u0001a\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001b\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0015\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tc\u0001\u0000\u0000\u0000\u0000\u0001d\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001e\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0016\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tf\u0001\u0000\u0000\u0000\u0000\u0001g\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001h\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0017\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\ti\u0001\u0000\u0000\u0000\u0000\u0001j\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001k\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0018\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tl\u0001\u0000\u0000\u0000\u0000\u0001m\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001n\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0019\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\to\u0001\u0000\u0000\u0000\u0000\u0001p\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001q\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001a\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\tr\u0001\u0000\u0000\u0000\u0000\u0001s\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001t\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001b\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\tu\u0001\u0000\u0000\u0000\u0000\u0001v\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001w\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001c\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\tx\u0001\u0000\u0000\u0000\u0000\u0001y\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001z\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001d\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t{\u0001\u0000\u0000\u0000\u0000\u0001|\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001}\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001e\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t~\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001f\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 \u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0001\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001!\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0001\u0001\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\"\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0001\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001#\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001$\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001%\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001&\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001'\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001(\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001)\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001*\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001+\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001,\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001-\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001.\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\/\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00010\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00011\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00012\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00013\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00014\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00015\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00016\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00017\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0001\u0001\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00018\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0001\u0000\u0000\u0001\u0001\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00019\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0001\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001:\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001;\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0001\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001<\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0001\u0000\u0000\u0001\u0001\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001=\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0001\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001>\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001?\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001@\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001A\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001B\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001C\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001D\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0001\u0001\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001E\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t\u0001\u0000\u0000\u0001\u0001\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001F\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0001\u0001\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001G\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0001\u0001\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001H\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0001\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001I\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0000\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001J\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0002\u0000\u0000\u0001\u0000\u0001\u0003\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0004\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001K\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0005\u0002\u0000\u0000\u0000\u0000\u0001\u0006\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0007\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001L\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\b\u0002\u0000\u0000\u0000\u0000\u0001\t\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\n\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001M\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u000b\u0002\u0000\u0000\u0000\u0000\u0001\f\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\r\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001N\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u000e\u0002\u0000\u0000\u0000\u0000\u0001\u000f\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0010\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001O\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0011\u0002\u0000\u0000\u0000\u0000\u0001\u0012\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0013\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001P\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0014\u0002\u0000\u0000\u0000\u0000\u0001\u0015\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0016\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001Q\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0017\u0002\u0000\u0000\u0000\u0000\u0001\u0018\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0019\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001R\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u001a\u0002\u0000\u0000\u0000\u0000\u0001\u001b\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001c\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001S\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u001d\u0002\u0000\u0000\u0000\u0000\u0001\u001e\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001f\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001T\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0002\u0000\u0000\u0000\u0000\u0001!\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\"\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001U\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t#\u0002\u0000\u0000\u0000\u0000\u0001$\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001%\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001V\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t&\u0002\u0000\u0000\u0000\u0000\u0001'\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001(\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001W\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t)\u0002\u0000\u0000\u0000\u0000\u0001*\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001+\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001X\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t,\u0002\u0000\u0000\u0000\u0001\u0001-\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001.\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001Y\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t\/\u0002\u0000\u0000\u0001\u0001\u00010\u0002\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u00011\u0002\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001Z\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t2\u0002\u0000\u0000\u0000\u0001\u00013\u0002\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u00014\u0002\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001[\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t5\u0002\u0000\u0000\u0001\u0000\u00016\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00017\u0002\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\\\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t8\u0002\u0000\u0000\u0000\u0000\u00019\u0002\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001:\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001]\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t;\u0002\u0000\u0000\u0000\u0000\u0001<\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001=\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001^\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t>\u0002\u0000\u0000\u0000\u0000\u0001?\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001@\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001_\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tA\u0002\u0000\u0000\u0000\u0000\u0001B\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001C\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001`\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tD\u0002\u0000\u0000\u0000\u0000\u0001E\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001F\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001a\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tG\u0002\u0000\u0000\u0000\u0000\u0001H\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001I\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001b\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tJ\u0002\u0000\u0000\u0000\u0000\u0001K\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001L\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001c\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tM\u0002\u0000\u0000\u0000\u0000\u0001N\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001O\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001d\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tP\u0002\u0000\u0000\u0000\u0000\u0001Q\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001R\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001e\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tS\u0002\u0000\u0000\u0000\u0000\u0001T\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001U\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001f\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tV\u0002\u0000\u0000\u0000\u0000\u0001W\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001X\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001g\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tY\u0002\u0000\u0000\u0000\u0000\u0001Z\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001[\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001h\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\\\u0002\u0000\u0000\u0000\u0000\u0001]\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001^\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001i\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t_\u0002\u0000\u0000\u0000\u0000\u0001`\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001a\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001j\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tb\u0002\u0000\u0000\u0000\u0000\u0001c\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001d\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001k\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\te\u0002\u0000\u0000\u0001\u0001\u0001f\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001g\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001l\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\th\u0002\u0000\u0000\u0000\u0000\u0001i\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001j\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001m\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tk\u0002\u0000\u0000\u0000\u0000\u0001l\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001m\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001n\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\tn\u0002\u0000\u0000\u0000\u0000\u0001o\u0002\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001p\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001o\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\tq\u0002\u0000\u0000\u0001\u0001\u0001r\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001s\u0002\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001p\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tt\u0002\u0000\u0000\u0000\u0000\u0001u\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001v\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001q\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tw\u0002\u0000\u0000\u0000\u0000\u0001x\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001y\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001r\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tz\u0002\u0000\u0000\u0000\u0000\u0001{\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001|\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001s\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t}\u0002\u0000\u0000\u0000\u0000\u0001~\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001t\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001u\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001v\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001w\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0001\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001x\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001y\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001z\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001{\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001|\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001}\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001~\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0002\u0000\u0000\u0001\u0001\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\t\u0002\u0000\u0000\u0001\u0001\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0001\u0001\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0001\u0001\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0001\u0001\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\t\u0002\u0000\u0000\u0001\u0001\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0001\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0003\u0000\u0000\u0000\u0000\u0001\u0002\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0003\u0000\u0000\u0001\u0001\u0001\u0005\u0003\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0006\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0007\u0003\u0000\u0000\u0000\u0000\u0001\b\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\t\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\n\u0003\u0000\u0000\u0000\u0000\u0001\u000b\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\f\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\r\u0003\u0000\u0000\u0000\u0000\u0001\u000e\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000f\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0010\u0003\u0000\u0000\u0000\u0000\u0001\u0011\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0012\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0013\u0003\u0000\u0000\u0000\u0000\u0001\u0014\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0015\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0016\u0003\u0000\u0000\u0001\u0001\u0001\u0017\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0018\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0019\u0003\u0000\u0000\u0000\u0000\u0001\u001a\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001b\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u001c\u0003\u0000\u0000\u0000\u0000\u0001\u001d\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001e\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u001f\u0003\u0000\u0000\u0000\u0000\u0001 \u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001!\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t\"\u0003\u0000\u0000\u0000\u0000\u0001#\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001$\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\t%\u0003\u0000\u0000\u0001\u0001\u0001&\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001'\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\t(\u0003\u0000\u0000\u0000\u0000\u0001)\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001*\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t+\u0003\u0000\u0000\u0000\u0000\u0001,\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001-\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t.\u0003\u0000\u0000\u0001\u0001\u0001\/\u0003\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u00010\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t1\u0003\u0000\u0000\u0000\u0000\u00012\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00013\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t4\u0003\u0000\u0000\u0000\u0000\u00015\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00016\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\t7\u0003\u0000\u0000\u0000\u0000\u00018\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00019\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t:\u0003\u0000\u0000\u0000\u0000\u0001;\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001<\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t=\u0003\u0000\u0000\u0000\u0000\u0001>\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001?\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t@\u0003\u0000\u0000\u0001\u0001\u0001A\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001B\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\tC\u0003\u0000\u0000\u0000\u0000\u0001D\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001E\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tF\u0003\u0000\u0000\u0000\u0000\u0001G\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001H\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tI\u0003\u0000\u0000\u0000\u0000\u0001J\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001K\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tL\u0003\u0000\u0000\u0000\u0000\u0001M\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001N\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tO\u0003\u0000\u0000\u0000\u0000\u0001P\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001Q\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tR\u0003\u0000\u0000\u0001\u0001\u0001S\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0001T\u0003\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tU\u0003\u0000\u0000\u0000\u0000\u0001V\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001W\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tX\u0003\u0000\u0000\u0000\u0000\u0001Y\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001Z\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t[\u0003\u0000\u0000\u0000\u0000\u0001\\\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001]\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\t^\u0003\u0000\u0000\u0001\u0000\u0001_\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001`\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\ta\u0003\u0000\u0000\u0000\u0001\u0001b\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001c\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\td\u0003\u0000\u0000\u0000\u0000\u0001e\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001f\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tg\u0003\u0000\u0000\u0001\u0001\u0001h\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001i\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tj\u0003\u0000\u0000\u0000\u0000\u0001k\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001l\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tm\u0003\u0000\u0000\u0000\u0000\u0001n\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001o\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tp\u0003\u0000\u0000\u0000\u0000\u0001q\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001r\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\ts\u0003\u0000\u0000\u0000\u0000\u0001t\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001u\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tv\u0003\u0000\u0000\u0000\u0000\u0001w\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001x\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\ty\u0003\u0000\u0000\u0000\u0000\u0001z\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001{\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\t|\u0003\u0000\u0000\u0001\u0001\u0001}\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001~\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0001\u0001\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0001\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0001\u0001\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\t\u0003\u0000\u0000\u0001\u0001\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0001\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0001\u0001\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0001\u0001\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0001\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0000\u0004\u0000\u0000\u0000\u0000\u0001\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0005\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0006\u0004\u0000\u0000\u0000\u0000\u0001\u0007\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\b\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\t\u0004\u0000\u0000\u0000\u0000\u0001\n\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000b\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\f\u0004\u0000\u0000\u0000\u0000\u0001\r\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000e\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u000f\u0004\u0000\u0000\u0000\u0000\u0001\u0010\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0011\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0012\u0004\u0000\u0000\u0000\u0000\u0001\u0013\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0014\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0015\u0004\u0000\u0000\u0001\u0001\u0001\u0016\u0004\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0017\u0004\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0018\u0004\u0000\u0000\u0001\u0001\u0001\u0019\u0004\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u001a\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u001b\u0004\u0000\u0000\u0000\u0000\u0001\u001c\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001d\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u001e\u0004\u0000\u0000\u0001\u0001\u0001\u001f\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001 \u0004\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t!\u0004\u0000\u0000\u0000\u0000\u0001\"\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001#\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t$\u0004\u0000\u0000\u0000\u0000\u0001%\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001&\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t'\u0004\u0000\u0000\u0000\u0000\u0001(\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001)\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t*\u0004\u0000\u0000\u0000\u0000\u0001+\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001,\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t-\u0004\u0000\u0000\u0000\u0000\u0001.\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\/\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t0\u0004\u0000\u0000\u0000\u0000\u00011\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00012\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0005\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t3\u0004\u0000\u0000\u0000\u0000\u00014\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00015\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0006\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t6\u0004\u0000\u0000\u0000\u0000\u00017\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00018\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0007\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t9\u0004\u0000\u0000\u0000\u0000\u0001:\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001;\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\b\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t<\u0004\u0000\u0000\u0000\u0000\u0001=\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001>\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\t\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t?\u0004\u0000\u0000\u0000\u0000\u0001@\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001A\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\n\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tB\u0004\u0000\u0000\u0000\u0000\u0001C\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001D\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000b\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tE\u0004\u0000\u0000\u0000\u0000\u0001F\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001G\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tH\u0004\u0000\u0000\u0000\u0000\u0001I\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001J\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\r\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tK\u0004\u0000\u0000\u0000\u0000\u0001L\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001M\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000e\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tN\u0004\u0000\u0000\u0001\u0001\u0001O\u0004\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001P\u0004\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tQ\u0004\u0000\u0000\u0001\u0001\u0001R\u0004\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001S\u0004\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0010\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tT\u0004\u0000\u0000\u0001\u0001\u0001U\u0004\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0001V\u0004\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0011\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tW\u0004\u0000\u0000\u0000\u0000\u0001X\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001Y\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0012\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tZ\u0004\u0000\u0000\u0000\u0001\u0001[\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\\\u0004\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0013\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t]\u0004\u0000\u0000\u0000\u0000\u0001^\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001_\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0014\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t`\u0004\u0000\u0000\u0000\u0000\u0001a\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001b\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0015\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tc\u0004\u0000\u0000\u0000\u0000\u0001d\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001e\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0016\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tf\u0004\u0000\u0000\u0000\u0000\u0001g\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001h\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0017\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\ti\u0004\u0000\u0000\u0000\u0000\u0001j\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001k\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0018\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tl\u0004\u0000\u0000\u0000\u0000\u0001m\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001n\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0019\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\to\u0004\u0000\u0000\u0000\u0000\u0001p\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001q\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001a\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tr\u0004\u0000\u0000\u0000\u0000\u0001s\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001t\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001b\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tu\u0004\u0000\u0000\u0000\u0000\u0001v\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001w\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001c\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tx\u0004\u0000\u0000\u0000\u0000\u0001y\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001z\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001d\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t{\u0004\u0000\u0000\u0000\u0000\u0001|\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001}\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001e\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t~\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 \u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001!\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\"\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001#\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0001\u0001\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001$\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0001\u0001\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001%\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001&\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001'\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001(\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001)\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001*\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001+\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001,\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001-\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001.\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\/\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u000f0\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f3\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f6\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f9\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f<\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f?\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fB\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fE\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fH\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fK\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fN\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fQ\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fT\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fW\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fZ\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f]\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f`\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fc\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000ff\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fi\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fl\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fo\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fr\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fu\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fx\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f{\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f~\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0002\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0005\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\b\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u000b\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u000e\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0011\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0014\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0017\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u001a\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u001d\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f \u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f#\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f&\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f)\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f,\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\/\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f2\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f5\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f8\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f;\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f>\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fA\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fD\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fG\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fJ\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fM\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fP\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fS\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fV\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fY\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\\\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f_\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fb\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fe\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fh\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fk\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fn\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fq\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000ft\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fw\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fz\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f}\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0007\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\n\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\r\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0010\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0013\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0016\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0019\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u001c\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u001f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\"\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f%\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f(\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f+\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f.\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f1\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f4\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f7\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f:\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f=\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f@\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fC\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fF\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fI\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fL\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fO\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fR\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fU\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fX\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f[\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f^\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fa\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fd\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fg\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000fj\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fm\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fp\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fs\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fv\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fy\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f|\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0000\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0003\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0006\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\t\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0012\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0015\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0018\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u001b\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u001e\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f!\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f$\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f'\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f*\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f-\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f0\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f3\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f6\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f9\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f<\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f?\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fB\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fE\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fH\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fK\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fN\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fQ\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fT\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fW\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fZ\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f]\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f`\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fc\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000ff\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fi\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fl\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fo\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fr\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fu\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000fx\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f{\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f~\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000b","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"c730b202bfc30dd8f0854afa6b6f1730bb0269de","subject":"commented signal stuff","message":"commented signal stuff\n","repos":"AlexHolly\/captain-holetooth,shelltitan\/captain-holetooth,shelltitan\/captain-holetooth,AlexHolly\/captain-holetooth","old_file":"src\/screens\/hud\/hud.gd","new_file":"src\/screens\/hud\/hud.gd","new_contents":"extends CanvasLayer\n\nexport (NodePath) var collected_text #= get_node(\"hudframe\/items_label\/score_display\")\nexport (NodePath) var score_text #final_score_text = get_node(\"hudframe\/finalscore_label\/final_scoredisplay\")\nexport (NodePath) var highscore_text #= get_node(\"hudframe\/highscore_label\/highscore_display\")\nexport (NodePath) var sound_off_button #= get_node(\"hudframe\/sound_off\")\n\nonready var animations = get_node(\"animations\")\n#onready var yan = get_parent().find_node(\"Yan\")\n#onready var whatsmyparent = get_parent().get_name()\n#onready var whatsmyowner = get_owner().get_name()\n\n#func _on_met_yan():\n#\tget_node(\"sfx\").play(\"card_unlock\")\n#\tanimations.play(\"yan_unlock_anim\")\n\nfunc _ready():\n#\tprint (\"My parent is: \" + whatsmyparent)\n#\tprint (\"My owner is: \" + whatsmyowner)\n\t\n#\tprint (yan.get_name())\n#\tif yan.has_node(\"Yan\"):\n#\t\tprint(\"Yan is present\")\n\t#yan.connect(\"met_yan\", self,\"_on_met_yan\")\n\tanimations.play(\"yan_unlock_anim\")\n\t\n\tupdate_scores()\n\tgame.connect(\"scores_changed\", self, \"update_scores\")\n\tupdate_sound_hud()\n\n\n# Update scores\nfunc update_scores():\n\tget_node(collected_text).set_text(str(game.items_collected))\n\tget_node(score_text).set_text(str(game.score))\n\tget_node(highscore_text).set_text(str(game.high_score))\n\nfunc _on_go_to_menu_pressed():\n\ttransition.fade_to(\"res:\/\/src\/screens\/menu\/menu.tscn\")\n\n\n# Toggles music on\/off while keeping the stored volume that may have been set elsewhere\nfunc _on_sound_off_pressed():\n\t# Turns off music completely, or returns it back to normal\n\tif(global.music.enabled):\n\t\tAudioServer.set_stream_global_volume_scale(0)\n\telse:\n\t\tAudioServer.set_stream_global_volume_scale(global.music.volume)\n\t\n\t# Toggle bool\n\tglobal.music.enabled = !global.music.enabled\n\t\n\t# Update sound HUD\n\tupdate_sound_hud()\n\n\n# Updates sound HUD\nfunc update_sound_hud():\n\tif(global.music.enabled):\n\t\tget_node(sound_off_button).set_pressed(true) # res:\/\/src\/screens\/hud\/sound_on.png\n\telse:\n\t\tget_node(sound_off_button).set_pressed(false) # res:\/\/src\/screens\/hud\/sound_off.png","old_contents":"extends CanvasLayer\n\nexport (NodePath) var collected_text #= get_node(\"hudframe\/items_label\/score_display\")\nexport (NodePath) var score_text #final_score_text = get_node(\"hudframe\/finalscore_label\/final_scoredisplay\")\nexport (NodePath) var highscore_text #= get_node(\"hudframe\/highscore_label\/highscore_display\")\nexport (NodePath) var sound_off_button #= get_node(\"hudframe\/sound_off\")\n\nonready var animations = get_node(\"animations\")\nonready var yan = get_parent().find_node(\"Yan\")\nonready var whatsmyparent = get_parent().get_name()\nonready var whatsmyowner = get_owner().get_name()\n\nfunc _on_met_yan():\n\tget_node(\"sfx\").play(\"card_unlock\")\n\tanimations.play(\"yan_unlock_anim\")\n\nfunc _ready():\n\tprint (\"My parent is: \" + whatsmyparent)\n\tprint (\"My owner is: \" + whatsmyowner)\n\t\n\tprint (yan.get_name())\n\tif yan.has_node(\"Yan\"):\n\t\tprint(\"Yan is present\")\n\t\tyan.connect(\"met_yan\", self,\"_on_met_yan\")\n\t\tanimations.play(\"yan_unlock_anim\")\n\t\n\tupdate_scores()\n\tgame.connect(\"scores_changed\", self, \"update_scores\")\n\tupdate_sound_hud()\n\n\n# Update scores\nfunc update_scores():\n\tget_node(collected_text).set_text(str(game.items_collected))\n\tget_node(score_text).set_text(str(game.score))\n\tget_node(highscore_text).set_text(str(game.high_score))\n\nfunc _on_go_to_menu_pressed():\n\ttransition.fade_to(\"res:\/\/src\/screens\/menu\/menu.tscn\")\n\n\n# Toggles music on\/off while keeping the stored volume that may have been set elsewhere\nfunc _on_sound_off_pressed():\n\t# Turns off music completely, or returns it back to normal\n\tif(global.music.enabled):\n\t\tAudioServer.set_stream_global_volume_scale(0)\n\telse:\n\t\tAudioServer.set_stream_global_volume_scale(global.music.volume)\n\t\n\t# Toggle bool\n\tglobal.music.enabled = !global.music.enabled\n\t\n\t# Update sound HUD\n\tupdate_sound_hud()\n\n\n# Updates sound HUD\nfunc update_sound_hud():\n\tif(global.music.enabled):\n\t\tget_node(sound_off_button).set_pressed(true) # res:\/\/src\/screens\/hud\/sound_on.png\n\telse:\n\t\tget_node(sound_off_button).set_pressed(false) # res:\/\/src\/screens\/hud\/sound_off.png","returncode":0,"stderr":"","license":"apache-2.0","lang":"GDScript"} {"commit":"2501c137bdf0d998a19878990c3a6adfaa67d861","subject":"Dynamic regex viewing in editor","message":"Dynamic regex viewing in editor\n\n","repos":"BK-TN\/IncendiumGame","old_file":"incendium\/scripts\/BossEditor.gd","new_file":"incendium\/scripts\/BossEditor.gd","new_contents":"\nextends Panel\n\n# member variables here, example:\n# var a=2\n# var b=\"textvar\"\n\nfunc _ready():\n\t# Called every time the node is added to the scene.\n\t# Initialization here\n\tset_process_input(true)\n\tset_process(true)\n\t\nfunc _process(delta):\n\tupdate()\n\nfunc _input(event):\n\tif event.type == InputEvent.KEY:\n\t\tif event.scancode == KEY_ENTER and event.pressed == true:\n\t\t\t_on_FightButton_pressed()\n\nfunc _on_FightButton_pressed():\n\tvar boss = preload(\"res:\/\/objects\/Boss.tscn\").instance()\n\tboss.base_size = get_node(\"BaseSizeField\").get_value()\n\tboss.base_health = get_node(\"BaseHealthField\").get_value()\n\tboss.size_dropoff = get_node(\"SideDropoffField\").get_value() \/ 100\n\tboss.base_rot_speed = get_node(\"BaseRotField\").get_value()\n\tboss.rot_speed_inc = get_node(\"RotIncField\").get_value()\n\tboss.start_color = get_node(\"StartColorField\").get_color()\n\tboss.end_color = get_node(\"EndColorField\").get_color()\n\tboss.regex = get_node(\"RegexField\").get_text()\n\t\n\tget_node(\"..\").add_child(boss)\n\tboss.set_global_pos(Vector2(360,360))\n\t\n\tget_node(\"..\").last_boss = boss\n\tget_node(\"..\").last_boss_wr = weakref(boss)\n\tget_node(\"..\").target_bgcol = boss.start_color.linear_interpolate(Color(0,0,0), 0.8)\n\tget_node(\"..\").target_fgcol = boss.end_color.linear_interpolate(Color(0,0,0), 0)\n\tget_node(\"..\").playing = true\n\tqueue_free()\n\nvar expr = RegEx.new()\n\nfunc _draw():\n\texpr.compile(get_node(\"RegexField\").get_text())\n\tdraw_boss_part(\"\")\n\t\nfunc draw_boss_part(id):\n\tvar find = expr.find(id)\n\tvar alive = false\n\tfor s in expr.get_captures():\n\t\tif(s == id):\n\t\t\talive = true\n\t\t\tbreak\n\t\n\tif alive:\n\t\tvar col = get_node(\"StartColorField\").get_color().linear_interpolate(get_node(\"EndColorField\").get_color(),id.length() \/ 4.0)\n\t\tvar poly = Vector2Array()\n\t\tvar s = get_node(\"BaseSizeField\").get_value() * pow(get_node(\"SideDropoffField\").get_value() \/ 100, id.length())\n\t\tvar base_pos = Vector2(500,360) + get_part_pos(id)\n\t\tfor i in range(3):\n\t\t\tvar t = i \/ 3.0 * 2 * PI\n\t\t\tpoly.append(base_pos + Vector2(cos(t)*s,sin(t)*s))\n\t\tdraw_colored_polygon(poly, col)\n\tif id.length() < 4:\n\t\tfor i in range(3):\n\t\t\tdraw_boss_part(id + str(i))\n\nfunc get_part_pos(id):\n\t#if(map.has(id)):\n#\t\treturn map.id\n\tif(id==\"\"):\n\t\treturn Vector2(0, 0)\n\tvar c = id[-1].to_float()\n\tvar depth = id.length() - 1\n\tvar parent_pos = get_part_pos(id.substr(0,depth))\n\tvar theta = c \/ 3.0 * 2 * PI\n\tvar r = get_node(\"BaseSizeField\").get_value() * pow(get_node(\"SideDropoffField\").get_value() \/ 100, depth)\n\tvar pos = parent_pos + Vector2(r * cos(-theta), r*sin(-theta)) \n\t#map.id = pos\n\treturn pos","old_contents":"\nextends Panel\n\n# member variables here, example:\n# var a=2\n# var b=\"textvar\"\n\nfunc _ready():\n\t# Called every time the node is added to the scene.\n\t# Initialization here\n\tset_process_input(true)\n\tset_process(true)\n\t\nfunc _process(delta):\n\tupdate()\n\nfunc _input(event):\n\tif event.type == InputEvent.KEY:\n\t\tif event.scancode == KEY_ENTER and event.pressed == true:\n\t\t\t_on_FightButton_pressed()\n\nfunc _on_FightButton_pressed():\n\tvar boss = preload(\"res:\/\/objects\/Boss.tscn\").instance()\n\tboss.base_size = get_node(\"BaseSizeField\").get_value()\n\tboss.base_health = get_node(\"BaseHealthField\").get_value()\n\tboss.size_dropoff = get_node(\"SideDropoffField\").get_value() \/ 100\n\tboss.base_rot_speed = get_node(\"BaseRotField\").get_value()\n\tboss.rot_speed_inc = get_node(\"RotIncField\").get_value()\n\tboss.start_color = get_node(\"StartColorField\").get_color()\n\tboss.end_color = get_node(\"EndColorField\").get_color()\n\tboss.regex = get_node(\"RegexField\").get_text()\n\t\n\tget_node(\"..\").add_child(boss)\n\tboss.set_global_pos(Vector2(360,360))\n\t\n\tget_node(\"..\").last_boss = boss\n\tget_node(\"..\").last_boss_wr = weakref(boss)\n\tget_node(\"..\").target_bgcol = boss.start_color.linear_interpolate(Color(0,0,0), 0.8)\n\tget_node(\"..\").target_fgcol = boss.end_color.linear_interpolate(Color(0,0,0), 0)\n\tget_node(\"..\").playing = true\n\tqueue_free()\n\nfunc _draw():\n\tdraw_boss_part(\"\")\n\t\nfunc draw_boss_part(id):\n\tvar col = get_node(\"StartColorField\").get_color().linear_interpolate(get_node(\"EndColorField\").get_color(),id.length() \/ 4.0)\n\tvar poly = Vector2Array()\n\tvar s = get_node(\"BaseSizeField\").get_value() * pow(get_node(\"SideDropoffField\").get_value() \/ 100, id.length())\n\tvar base_pos = Vector2(500,360) + get_part_pos(id)\n\tfor i in range(3):\n\t\tvar t = i \/ 3.0 * 2 * PI\n\t\tpoly.append(base_pos + Vector2(cos(t)*s,sin(t)*s))\n\tdraw_colored_polygon(poly, col)\n\tif id.length() < 4:\n\t\tfor i in range(3):\n\t\t\tdraw_boss_part(id + str(i))\n\nfunc get_part_pos(id):\n\t#if(map.has(id)):\n#\t\treturn map.id\n\tif(id==\"\"):\n\t\treturn Vector2(0, 0)\n\tvar c = id[-1].to_float()\n\tvar depth = id.length() - 1\n\tvar parent_pos = get_part_pos(id.substr(0,depth))\n\tvar theta = c \/ 3.0 * 2 * PI\n\tvar r = get_node(\"BaseSizeField\").get_value() * pow(get_node(\"SideDropoffField\").get_value() \/ 100, depth)\n\tvar pos = parent_pos + Vector2(r * cos(-theta), r*sin(-theta)) \n\t#map.id = pos\n\treturn pos","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"0a77d7bf4efc2b0946d348094146bd5a7a4e5b9d","subject":"Fixed & Refactored highScore to be understandable","message":"Fixed & Refactored highScore to be understandable\n","repos":"DaddySmash\/GraphicsGame,DaddySmash\/GraphicsGame","old_file":"app\/code\/highScore.gd","new_file":"app\/code\/highScore.gd","new_contents":"extends Node\n\n#Highscores that are saved to disk.\n# highArray[difficulty][rank][stat] = value\n# difficulty: range(SIZE_DIFFICULTY)\n# rank: range(SIZE_RANK)\n# stat: STAT_NAME, STAT_SCORE, STAT_TIME, STAT_NEW\n\nvar highArray\nvar highNode\nvar diffNode\nvar rankNode\nvar difficulty\n\nfunc _ready():\n\tget_tree().set_auto_accept_quit(false) #Enables: _notification(what) to recieve MainLoop.NOTIFICATION_WM_QUIT_REQUEST\n\thighArray = get_node(\"\/root\/global\").highArray\n\thighNode = get_node(\"highNode\")\n\t\n\tfor difficulty in range(get_node(\"\/root\/global\").SIZE_DIFFICULTY):\n\t\tdiffNode = highNode.get_node(\"difficulty \" + str(difficulty + 1))\n\t\tif diffNode == null or diffNode.is_type(\"TextureFrame\") == false:\n\t\t\tprint(diffNode)\n\t\t\tcontinue\n\t\t\n\t\tvar i = 0\n\t\tfor rank in range(get_node(\"\/root\/global\").SIZE_RANK - 1): # do not display the last row.\n\t\t\trankNode = diffNode.get_child(rank)\n\t\t\tif highArray[difficulty][rank][get_node(\"\/root\/global\").STAT_NEW]:\n\t\t\t\trankNode.set_normal_texture(load(\"res:\/\/visual\/atlasBloodyTomb.xatex\"))\n\t\t\t\n\t\t\tif i == diffNode.get_child_count() - 1: # do not randomize last tombs position.\n\t\t\t\ti = (rank + 1) * (100 + 175 \/ 9)\n\t\t\telse:\n\t\t\t\ti = (rank + 1) * (100 + 175 \/ 9) + (rand_range(-175 \/ 18, 175 \/ 18))\n\t\t\t\n\t\t\trankNode.set_margin(0, i)\n\t\t\trankNode.set_size(Vector2(100, 130))\n\t\t\trankNode.get_child(0).get_node(\"name\").set_text(str(highArray[difficulty][rank][get_node(\"\/root\/global\").STAT_NAME]))\n\t\t\trankNode.get_child(0).get_node(\"score\").set_text(str(highArray[difficulty][rank][get_node(\"\/root\/global\").STAT_SCORE]))\n\t\t\trankNode.get_child(0).get_node(\"time\").set_text(str(highArray[difficulty][rank][get_node(\"\/root\/global\").STAT_TIME]))\n\nfunc _notification(what):\n\tif (what==MainLoop.NOTIFICATION_WM_QUIT_REQUEST): #User demanding to enterOS()\n\t\tget_node(\"\/root\/global\").enteringOS = true\n\t\tget_node(\"\/root\/global\").enterOS()\n\nfunc _on_backGround_pressed():\n\tif get_node(\"\/root\/global\").isInputEnabled():\n\t\tif get_node(\"\/root\/global\").enteringOS:\n\t\t\tget_node(\"\/root\/global\").enterOS()\n\t\telse:\n\t\t\tget_node(\"\/root\/global\").enterMenu()","old_contents":"extends Node\n\n#Highscores that are saved to disk.\n# highArray[difficulty][rank][stat] = value\n# difficulty: range(SIZE_DIFFICULTY)\n# rank: range(SIZE_RANK)\n# stat: STAT_NAME, STAT_SCORE, STAT_TIME, STAT_NEW\n\nvar highArray\nvar highNode\nvar highCount\nvar diffNode\nvar rankNode\nvar difficulty\nvar d\n\nfunc _ready():\n\tget_tree().set_auto_accept_quit(false) #Enables: _notification(what) to recieve MainLoop.NOTIFICATION_WM_QUIT_REQUEST\n\thighArray = get_node(\"\/root\/global\").highArray\n\t#root.get_child(root.get_child_count() - 1)\n\thighNode = get_node(\"highNode\")\n\thighCount = highNode.get_child_count()\n\tdifficulty = -1\n\td = 0\n\tfor d in range(highCount):\n\t\tdiffNode = highNode.get_child(highCount - d - 1)\n\t\tif diffNode.is_type(\"TextureFrame\") == false:\n\t\t\tcontinue\n\t\t\n\t\tdifficulty += 1\n\t\tvar i = 0\n\t\tfor rank in range(diffNode.get_child_count()):\n\t\t\trankNode = diffNode.get_child(rank)\n\t\t\tif highArray[difficulty][rank][get_node(\"\/root\/global\").STAT_NEW]:\n\t\t\t\trankNode.set_normal_texture(load(\"res:\/\/visual\/atlasBloodyTomb.xatex\"))\n\t\t\t\n\t\t\tif i == diffNode.get_child_count() - 1: # do not randomize last tombs position.\n\t\t\t\ti = (rank + 1) * (100 + 175 \/ 9)\n\t\t\telse:\n\t\t\t\ti = (rank + 1) * (100 + 175 \/ 9) + (rand_range(-175 \/ 18, 175 \/ 18))\n\t\t\t\n\t\t\trankNode.set_margin(0, i)\n\t\t\trankNode.set_size(Vector2(100, 130))\n\t\t\trankNode.get_child(0).get_node(\"name\").set_text(str(highArray[difficulty][rank][get_node(\"\/root\/global\").STAT_NAME]))\n\t\t\trankNode.get_child(0).get_node(\"score\").set_text(str(highArray[difficulty][rank][get_node(\"\/root\/global\").STAT_SCORE]))\n\t\t\trankNode.get_child(0).get_node(\"time\").set_text(str(highArray[difficulty][rank][get_node(\"\/root\/global\").STAT_TIME]))\n\nfunc _notification(what):\n\tif (what==MainLoop.NOTIFICATION_WM_QUIT_REQUEST): #User demanding to enterOS()\n\t\tget_node(\"\/root\/global\").enteringOS = true\n\t\tget_node(\"\/root\/global\").enterOS()\n\nfunc _on_backGround_pressed():\n\tif get_node(\"\/root\/global\").isInputEnabled():\n\t\tif get_node(\"\/root\/global\").enteringOS:\n\t\t\tget_node(\"\/root\/global\").enterOS()\n\t\telse:\n\t\t\tget_node(\"\/root\/global\").enterMenu()","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"8464543a23a8409dc8f693c1bbb3d0784199e99b","subject":"simplifying steering to a single line with move_toward (#451)","message":"simplifying steering to a single line with move_toward (#451)\n\n* simplyfied the steering to a single line with lerp\r\n\r\nReplaced:\r\n\tif steer_target < steer_angle:\r\n\t\tsteer_angle -= STEER_SPEED * delta\r\n\t\tif steer_target > steer_angle:\r\n\t\t\tsteer_angle = steer_target\r\n\telif steer_target > steer_angle:\r\n\t\tsteer_angle += STEER_SPEED * delta\r\n\t\tif steer_target < steer_angle:\r\n\t\t\tsteer_angle = steer_target\r\n\t\r\n\tsteering = steer_angle\r\nwith\r\n\tsteering = lerp(steering, steer_target, STEER_SPEED)\r\n\r\nand lowered STEER_SPEED to 0.2\r\n\r\n* Update vehicle.gd\r\n\r\n* added space around *","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"3d\/truck_town\/vehicle.gd","new_file":"3d\/truck_town\/vehicle.gd","new_contents":"extends VehicleBody\n\nconst STEER_SPEED = 1\nconst STEER_LIMIT = 0.4\n\nvar steer_target = 0\n\nexport var engine_force_value = 40\n\nfunc _physics_process(delta):\n\tvar fwd_mps = transform.basis.xform_inv(linear_velocity).x\n\t\n\tsteer_target = Input.get_action_strength(\"turn_left\") - Input.get_action_strength(\"turn_right\")\n\tsteer_target *= STEER_LIMIT\n\t\n\tif Input.is_action_pressed(\"accelerate\"):\n\t\tengine_force = engine_force_value\n\telse:\n\t\tengine_force = 0\n\t\n\tif Input.is_action_pressed(\"reverse\"):\n\t\tif (fwd_mps >= -1):\n\t\t\tengine_force = -engine_force_value\n\t\telse:\n\t\t\tbrake = 1\n\telse:\n\t\tbrake = 0.0\n\t\n\tsteering = move_toward(steering, steer_target, STEER_SPEED * delta)\n","old_contents":"extends VehicleBody\n\nconst STEER_SPEED = 1\nconst STEER_LIMIT = 0.4\n\nvar steer_angle = 0\nvar steer_target = 0\n\nexport var engine_force_value = 40\n\nfunc _physics_process(delta):\n\tvar fwd_mps = transform.basis.xform_inv(linear_velocity).x\n\t\n\tsteer_target = Input.get_action_strength(\"turn_left\") - Input.get_action_strength(\"turn_right\")\n\tsteer_target *= STEER_LIMIT\n\t\n\tif Input.is_action_pressed(\"accelerate\"):\n\t\tengine_force = engine_force_value\n\telse:\n\t\tengine_force = 0\n\t\n\tif Input.is_action_pressed(\"reverse\"):\n\t\tif (fwd_mps >= -1):\n\t\t\tengine_force = -engine_force_value\n\t\telse:\n\t\t\tbrake = 1\n\telse:\n\t\tbrake = 0.0\n\t\n\tif steer_target < steer_angle:\n\t\tsteer_angle -= STEER_SPEED * delta\n\t\tif steer_target > steer_angle:\n\t\t\tsteer_angle = steer_target\n\telif steer_target > steer_angle:\n\t\tsteer_angle += STEER_SPEED * delta\n\t\tif steer_target < steer_angle:\n\t\t\tsteer_angle = steer_target\n\t\n\tsteering = steer_angle\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"9dc4f3506195624c1c9b16f41d603f8051acf5e7","subject":"Need some changes","message":"Need some changes\n\nNeed to change scene changer or do smth this it","repos":"DrUlysses\/FW-Godot-","old_file":"scripts\/global.gd","new_file":"scripts\/global.gd","new_contents":"\nextends Control\n\nvar currentScreen = \"intro.tscn\"\nvar previousScreen = \"intro.tscn\"\n\nvar options = {\nfullscreen = false,\nwindowSize = Vector2(OS.get_window_size()),\nscreenSize = Vector2(OS.get_screen_size())\n}\n\nvar level_0Player = {\nbullet = \"bullet_0\"\n}\n\nfunc save_game():\n\tvar f = File.new()\n\tvar err = f.open_encrypted_with_pass(\"user:\/\/savedata.bin\", File.WRITE, \"mamke_privet,_cheater_poganii\")\n\tf.store_var(options)\n\tf.close()\n\nfunc load_game():\n\tvar f = File.new()\n\tif !f.file_exists(\"user:\/\/savedata.bin\"):\n\t\treturn #Error! We don't have a save to load\n\tvar err = f.open_encrypted_with_pass(\"user:\/\/savedata.bin\", File.READ, \"mamke_privet,_cheater_poganii\")\n\toptions = f.get_var()\n\tf.close()\n\nfunc set_screen(sceneInScreensFolder):\n\t#add screen changer for all, or rework this systen, cos its pass not for all situations\n\tget_tree().change_scene(\"res:\/\/screens\/\" + sceneInScreensFolder)\n\tpreviousScreen = currentScreen\n\tcurrentScreen = sceneInScreensFolder\n\nfunc get_currentScreen(scene):\n\treturn(currentScreen)\n\nfunc get_previousScreen(scene):\n\treturn(previousScreen)\n\n#func save_game():\n#\tvar savegame = File.new()\n#\tsavegame.open(\"user:\/\/savegame.save\", File.WRITE)\n#\tvar savenodes = get_tree().get_nodes_in_group(\"Persist\")\n#\tfor i in savenodes:\n#\t\tvar nodedata = i.save()\n#\t\tsavegame.store_line(nodedata.to_json())\n#\t\tsavegame.close()\n#\n#func load_game():\n#\tvar savegame = File.new()\n#\tif !savegame.file_exists(\"user:\/\/savegame.save\"):\n#\t\treturn #Error! We don't have a save to load\n#\n# We need to revert the game state so we're not cloning objects during loading. This will vary wildly depending on the needs of a project, so take care with this step.\n# For our example, we will accomplish this by deleting savable objects.\n#\tvar savenodes = get_tree().get_nodes_in_group(\"Persist\")\n#\tfor i in savenodes:\n#\t\ti.queue_free()\n#\n# Load the file line by line and process that dictionary to restore the object it represents\n#\tvar currentline = {} # dict.parse_json() requires a declared dict.\n#\tsavegame.open(\"user:\/\/savegame.save\", File.READ)\n#\twhile (!savegame.eof_reached()):\n#\t\tcurrentline.parse_json(savegame.get_line())\n# First we need to create the object and add it to the tree and set its position.\n#\t\tvar newobject = load(currentline[\"filename\"]).instance()\n#\t\tget_node(currentline[\"parent\"]).add_child(newobject)\n#\t\tnewobject.set_pos(Vector2(currentline[\"posx\"],currentline[\"posy\"]))\n# Now we set the remaining variables.\n#\t\tfor i in currentline.keys():\n#\t\t\tif (i == \"filename\" or i == \"parent\" or i == \"posx\" or i == \"posy\"):\n#\t\t\t\tcontinue\n#\t\t\tnewobject.set(i, currentline[i])\n#\tsavegame.close()\n\nfunc _ready():\n\tload_game()\n\nfunc _exit_tree():\n\tsave_game()\n","old_contents":"\nextends Control\n\nvar options = {\nfullscreen = false,\nwindowSize = Vector2(OS.get_window_size()),\nscreenSize = Vector2(OS.get_screen_size())\n}\n\nvar level_0Player = {\nbullet = \"bullet_0\"\n}\n\nfunc save_game():\n\tvar f = File.new()\n\tvar err = f.open_encrypted_with_pass(\"user:\/\/savedata.bin\", File.WRITE, \"mamke_privet,_cheater_poganii\")\n\tf.store_var(options)\n\tf.close()\n\nfunc load_game():\n\tvar f = File.new()\n\tif !f.file_exists(\"user:\/\/savedata.bin\"):\n\t\treturn #Error! We don't have a save to load\n\tvar err = f.open_encrypted_with_pass(\"user:\/\/savedata.bin\", File.READ, \"mamke_privet,_cheater_poganii\")\n\toptions = f.get_var()\n\tf.close()\n\n#func save_game():\n#\tvar savegame = File.new()\n#\tsavegame.open(\"user:\/\/savegame.save\", File.WRITE)\n#\tvar savenodes = get_tree().get_nodes_in_group(\"Persist\")\n#\tfor i in savenodes:\n#\t\tvar nodedata = i.save()\n#\t\tsavegame.store_line(nodedata.to_json())\n#\t\tsavegame.close()\n#\n#func load_game():\n#\tvar savegame = File.new()\n#\tif !savegame.file_exists(\"user:\/\/savegame.save\"):\n#\t\treturn #Error! We don't have a save to load\n#\n# We need to revert the game state so we're not cloning objects during loading. This will vary wildly depending on the needs of a project, so take care with this step.\n# For our example, we will accomplish this by deleting savable objects.\n#\tvar savenodes = get_tree().get_nodes_in_group(\"Persist\")\n#\tfor i in savenodes:\n#\t\ti.queue_free()\n#\n# Load the file line by line and process that dictionary to restore the object it represents\n#\tvar currentline = {} # dict.parse_json() requires a declared dict.\n#\tsavegame.open(\"user:\/\/savegame.save\", File.READ)\n#\twhile (!savegame.eof_reached()):\n#\t\tcurrentline.parse_json(savegame.get_line())\n# First we need to create the object and add it to the tree and set its position.\n#\t\tvar newobject = load(currentline[\"filename\"]).instance()\n#\t\tget_node(currentline[\"parent\"]).add_child(newobject)\n#\t\tnewobject.set_pos(Vector2(currentline[\"posx\"],currentline[\"posy\"]))\n# Now we set the remaining variables.\n#\t\tfor i in currentline.keys():\n#\t\t\tif (i == \"filename\" or i == \"parent\" or i == \"posx\" or i == \"posy\"):\n#\t\t\t\tcontinue\n#\t\t\tnewobject.set(i, currentline[i])\n#\tsavegame.close()\n\nfunc _ready():\n\tload_game()\n\nfunc _exit_tree():\n\tsave_game()\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"c18bf9c06961c1ac41a6abe5609cca4947c7d742","subject":"add sub-puzzle to self, not to camera","message":"add sub-puzzle to self, not to camera\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Puzzle.gd","new_file":"src\/scripts\/Puzzle.gd","new_contents":"# Provides functionality for the puzzle itself\n\nextends Spatial\n\nvar DataMan = preload( \"res:\/\/scripts\/DataManager.gd\" ).new()\nvar PuzzleManScript = preload( \"res:\/\/scripts\/PuzzleManager.gd\" )\nvar PuzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar puzzleMan\nvar seed\nvar otherPuzzle\nvar generateRandom = true\nvar mainPuzzle = false\n\nvar time = {\n\t\ton = true,\n\t\tval = 0.0,\n\t\tlabel = Label.new(),\n\t\ttween = Tween.new() }\n\nfunc addTimer():\n\tadd_child(time.label)\n\tadd_child(time.tween)\n\ttime.label.set_pos(Vector2(15,15))\n\n\ttime.label.set_theme(load(\"res:\/\/themes\/MainTheme.thm\"))\n\ttime.tween.interpolate_method(time.label, \"set_pos\", \\\n\t\t\ttime.label.get_pos(), time.label.get_pos()*2, 0.5, \\\n\t\t\tTween.TRANS_BOUNCE, Tween.EASE_OUT)\n\ttime.tween.start()\n\ttime.label.set_text(str(time.val))\n\nfunc formatTime(t):\n\tvar mins = floor(t \/ 60)\n\tvar secs = fmod(floor(t), 60)\n\tvar millis = floor((t - floor(t)) * 1000)\n\treturn str(mins) + \":\" + str(secs).pad_zeros(2) + \":\" + str(millis).pad_zeros(3)\n\nfunc _process(dTime):\n\t# start label tween on\n\ttime.val += dTime\n\ttime.label.set_text(formatTime(time.val))\n\tif fmod(time.val, 10) < 0.1:\n\t\ttime.tween.seek(0.0)\n\n# Called for initialization\nfunc _ready():\n\tif time.on:\n\t\tset_process(true) # needed for time keeping\n\taddTimer()\n\n\t#set up network stuffs\n\tadd_child(load(\"res:\/\/networkProxy.scn\").instance())\n\tvar Network = Globals.get(\"Network\")\n\tif Network != null:\n\t\tNetwork.proxy.set_process(Network.isClient or Network.isHost)\n\n\n\t# generate puzzle\n\tpuzzleMan = PuzzleManScript.new()\n\n\tif generateRandom:\n\t\tseed = OS.get_unix_time() # unix time\n\t\tseed *= OS.get_ticks_msec() # initial time\n\t\tseed *= 1 + OS.get_time().second\n\t\tseed *= 1 + OS.get_date().weekday\n\t\tseed = abs(seed) % 7919 # 1000th prime\n\n\t\tvar puzzle = puzzleMan.generatePuzzle( 1, puzzleMan.DIFF_EASY )\n\t\tpuzzle.puzzleMan = puzzleMan\n\t\tvar steps = puzzle.solvePuzzleSteps()\n\t\tprint(\"Generated \", puzzle.shape.size(), \" blocks.\" )\n\t\tprint( \"PUZZLE IS SOLVEABLE?: \", steps.solveable )\n\n\t\tvar gridMan = get_node( \"GridView\/GridMan\" )\n\t\tDataMan.savePuzzle(\"test.pzl\", puzzle)\n\t\tvar pCopy = DataMan.loadPuzzle(\"test.pzl\")\n\t\tgridMan.set_puzzle(puzzle)\n\n\t# make a new puzzle, embed using Viewport\n\tif mainPuzzle:\n\t\tvar p = PuzzleScn.instance()\n\t\tp.get_node(\"GridView\").active = false\n\t\tp.mainPuzzle = false\n\t\tp.set_scale(Vector3(0.5, 0.5, 0.5))\n\t\tp.set_translation(Vector3(10, 5, -20))\n\n\t\tvar v = Viewport.new()\n\t\tvar c = Control.new()\n\n\t\tv.set_world(p.get_world())\n\t\tv.set_rect(Rect2(0, 0, 100, 100))\n\t\tv.set_physics_object_picking(false)\n\t\tadd_child(p)\n\t\tv.add_child(p)\n\t\tadd_child(c)\n\t\tc.add_child(v)\n\t\totherPuzzle = p #for use with network\n\n\n","old_contents":"# Provides functionality for the puzzle itself\n\nextends Spatial\n\nvar DataMan = preload( \"res:\/\/scripts\/DataManager.gd\" ).new()\nvar PuzzleManScript = preload( \"res:\/\/scripts\/PuzzleManager.gd\" )\nvar PuzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar puzzleMan\nvar seed\nvar otherPuzzle\nvar generateRandom = true\nvar mainPuzzle = false\n\nvar time = {\n\t\ton = true,\n\t\tval = 0.0,\n\t\tlabel = Label.new(),\n\t\ttween = Tween.new() }\n\nfunc addTimer():\n\tadd_child(time.label)\n\tadd_child(time.tween)\n\ttime.label.set_pos(Vector2(15,15))\n\n\ttime.label.set_theme(load(\"res:\/\/themes\/MainTheme.thm\"))\n\ttime.tween.interpolate_method(time.label, \"set_pos\", \\\n\t\t\ttime.label.get_pos(), time.label.get_pos()*2, 0.5, \\\n\t\t\tTween.TRANS_BOUNCE, Tween.EASE_OUT)\n\ttime.tween.start()\n\ttime.label.set_text(str(time.val))\n\nfunc formatTime(t):\n\tvar mins = floor(t \/ 60)\n\tvar secs = fmod(floor(t), 60)\n\tvar millis = floor((t - floor(t)) * 1000)\n\treturn str(mins) + \":\" + str(secs).pad_zeros(2) + \":\" + str(millis).pad_zeros(3)\n\nfunc _process(dTime):\n\t# start label tween on\n\ttime.val += dTime\n\ttime.label.set_text(formatTime(time.val))\n\tif fmod(time.val, 10) < 0.1:\n\t\ttime.tween.seek(0.0)\n\n# Called for initialization\nfunc _ready():\n\tif time.on:\n\t\tset_process(true) # needed for time keeping\n\taddTimer()\n\n\t#set up network stuffs\n\tadd_child(load(\"res:\/\/networkProxy.scn\").instance())\n\tvar Network = Globals.get(\"Network\")\n\tif Network != null:\n\t\tNetwork.proxy.set_process(Network.isClient or Network.isHost)\n\n\n\t# generate puzzle\n\tpuzzleMan = PuzzleManScript.new()\n\n\tif generateRandom:\n\t\tseed = OS.get_unix_time() # unix time\n\t\tseed *= OS.get_ticks_msec() # initial time\n\t\tseed *= 1 + OS.get_time().second\n\t\tseed *= 1 + OS.get_date().weekday\n\t\tseed = abs(seed) % 7919 # 1000th prime\n\n\t\tvar puzzle = puzzleMan.generatePuzzle( 1, puzzleMan.DIFF_EASY )\n\t\tpuzzle.puzzleMan = puzzleMan\n\t\tvar steps = puzzle.solvePuzzleSteps()\n\t\tprint(\"Generated \", puzzle.shape.size(), \" blocks.\" )\n\t\tprint( \"PUZZLE IS SOLVEABLE?: \", steps.solveable )\n\n\t\tget_node( \"GridView\/GridMan\" ).set_puzzle(puzzle)\n\n\t# make a new puzzle, embed using Viewport\n\tif mainPuzzle:\n\t\tvar p = PuzzleScn.instance()\n\t\t#p.remove_and_delete_child(p.get_node(\"Lights\"))\n\t\t#.remove_and_delete_child(p.get_node(\"Camera\"))\n\t\tp.get_node(\"GridView\").active = false\n\t\tp.mainPuzzle = false\n\t\tp.set_scale(Vector3(0.5, 0.5, 0.5))\n\t\tp.set_translation(Vector3(10, 5, -20))\n\n\t\tvar v = Viewport.new()\n\t\tvar c = Control.new()\n\n\t\tv.set_world(p.get_world())\n\t\tv.set_rect(Rect2(0, 0, 100, 100))\n\t\tv.set_physics_object_picking(false)\n\t\tget_tree().get_root().get_node( \"Spatial\" ).get_node( \"Camera\" ).add_child(p)\n\t\tv.add_child(p)\n\t\tadd_child(c)\n\t\tc.add_child(v)\n\t\totherPuzzle = p #for use with network\n# child of control? easier input\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"3775733922391639ea445a6ea86c8036fabae27e","subject":"random puzzle generation can now be toggled","message":"random puzzle generation can now be toggled\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Puzzle.gd","new_file":"src\/scripts\/Puzzle.gd","new_contents":"# Provides functionality for the puzzle itself\n\nextends Spatial\n\nvar DataMan = preload( \"res:\/\/scripts\/DataManager.gd\" ).new()\nvar PuzzleManScript = preload( \"res:\/\/scripts\/PuzzleManager.gd\" )\nvar PuzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar puzzleMan\nvar seed\nvar otherPuzzle\nvar generateRandom = true\nvar mainPuzzle = false\n\nvar time = {\n\t\ton = true,\n\t\tval = 0.0,\n\t\tlabel = Label.new(),\n\t\ttween = Tween.new() }\n\nfunc addTimer():\n\tadd_child(time.label)\n\tadd_child(time.tween)\n\ttime.label.set_pos(Vector2(15,15))\n\n\ttime.label.set_theme(load(\"res:\/\/themes\/MainTheme.thm\"))\n\ttime.tween.interpolate_method(time.label, \"set_pos\", \\\n\t\t\ttime.label.get_pos(), time.label.get_pos()*2, 0.5, \\\n\t\t\tTween.TRANS_BOUNCE, Tween.EASE_OUT)\n\ttime.tween.start()\n\ttime.label.set_text(str(time.val))\n\nfunc formatTime(t):\n\tvar mins = floor(t \/ 60)\n\tvar secs = fmod(floor(t), 60)\n\tvar millis = floor((t - floor(t)) * 1000)\n\treturn str(mins) + \":\" + str(secs).pad_zeros(2) + \":\" + str(millis).pad_zeros(3)\n\nfunc _process(dTime):\n\t# start label tween on\n\ttime.val += dTime\n\ttime.label.set_text(formatTime(time.val))\n\tif fmod(time.val, 10) < 0.1:\n\t\ttime.tween.seek(0.0)\n\n# Called for initialization\nfunc _ready():\n\tif time.on:\n\t\tset_process(true) # needed for time keeping\n\taddTimer()\n\n\t#set up network stuffs\n\tadd_child(load(\"res:\/\/networkProxy.scn\").instance())\n\tvar Network = Globals.get(\"Network\")\n\tif Network != null:\n\t\tNetwork.proxy.set_process(Network.isClient or Network.isHost)\n\n\n\t# generate puzzle\n\tpuzzleMan = PuzzleManScript.new()\n\tvar puzzle = puzzleMan.generatePuzzle( 1, puzzleMan.DIFF_EASY )\n\tpuzzle.puzzleMan = puzzleMan\n\n\tif generateRandom:\n\t\tseed = OS.get_unix_time() # unix time\n\t\tseed *= OS.get_ticks_msec() # initial time\n\t\tseed *= 1 + OS.get_time().second\n\t\tseed *= 1 + OS.get_date().weekday\n\t\tseed = abs(seed) % 7919 # 1000th prime\n\n\t\tprint(\"Generated \", puzzle.blocks.size(), \" blocks.\" )\n\t\tvar steps = puzzle.solvePuzzleSteps()\n\t\tprint( \"PUZZLE IS SOLVEABLE?: \", steps.solveable )\n\n\t\tget_node( \"GridView\/GridMan\" ).set_puzzle(puzzle)\n\n\t# make a new puzzle, embed using Viewport\n\tif mainPuzzle:\n\t\tvar p = PuzzleScn.instance()\n\t\t#p.remove_and_delete_child(p.get_node(\"Lights\"))\n\t\t#.remove_and_delete_child(p.get_node(\"Camera\"))\n\t\tp.get_node(\"GridView\").active = false\n\t\tp.mainPuzzle = false\n\t\tp.set_scale(Vector3(0.5, 0.5, 0.5))\n\t\tp.set_translation(Vector3(10, 5, -20))\n\n\t\tvar v = Viewport.new()\n\t\tvar c = Control.new()\n\n\t\tv.set_world(p.get_world())\n\t\tv.set_rect(Rect2(0, 0, 100, 100))\n\t\tv.set_physics_object_picking(false)\n\t\tget_tree().get_root().get_node( \"Spatial\" ).get_node( \"Camera\" ).add_child(p)\n\t\tv.add_child(p)\n\t\tadd_child(c)\n\t\tc.add_child(v)\n\t\totherPuzzle = p #for use with network\n# child of control? easier input\n\n\n","old_contents":"# Provides functionality for the puzzle itself\n\nextends Spatial\n\nvar DataMan = preload( \"res:\/\/scripts\/DataManager.gd\" ).new()\nvar PuzzleManScript = preload( \"res:\/\/scripts\/PuzzleManager.gd\" )\nvar PuzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar puzzleMan\nvar seed\nvar otherPuzzle\nvar mainPuzzle = false\n\nvar time = {\n\t\ton = true,\n\t\tval = 0.0,\n\t\tlabel = Label.new(),\n\t\ttween = Tween.new() }\n\nfunc addTimer():\n\tadd_child(time.label)\n\tadd_child(time.tween)\n\ttime.label.set_pos(Vector2(15,15))\n\n\ttime.label.set_theme(load(\"res:\/\/themes\/MainTheme.thm\"))\n\ttime.tween.interpolate_method(time.label, \"set_pos\", \\\n\t\t\ttime.label.get_pos(), time.label.get_pos()*2, 0.5, \\\n\t\t\tTween.TRANS_BOUNCE, Tween.EASE_OUT)\n\ttime.tween.start()\n\ttime.label.set_text(str(time.val))\n\nfunc formatTime(t):\n\tvar mins = floor(t \/ 60)\n\tvar secs = fmod(floor(t), 60)\n\tvar millis = floor((t - floor(t)) * 1000)\n\treturn str(mins) + \":\" + str(secs).pad_zeros(2) + \":\" + str(millis).pad_zeros(3)\n\nfunc _process(dTime):\n\t# start label tween on\n\ttime.val += dTime\n\ttime.label.set_text(formatTime(time.val))\n\tif fmod(time.val, 10) < 0.1:\n\t\ttime.tween.seek(0.0)\n\n# Called for initialization\nfunc _ready():\n\tseed = OS.get_unix_time() # unix time\n\tseed *= OS.get_ticks_msec() # initial time\n\tseed *= 1 + OS.get_time().second\n\tseed *= 1 + OS.get_date().weekday\n\tseed = abs(seed) % 7919 # 1000th prime\n\n\tif time.on:\n\t\tset_process(true) # needed for time keeping\n\n\t# generate puzzle\n\tpuzzleMan = PuzzleManScript.new()\n\tvar puzzle = puzzleMan.generatePuzzle( 1, puzzleMan.DIFF_EASY )\n\tpuzzle.puzzleMan = puzzleMan\n\n\t#set up network stuffs\n\tadd_child(load(\"res:\/\/networkProxy.scn\").instance())\n\tvar Network = Globals.get(\"Network\")\n\tif Network != null:\n\t\tNetwork.proxy.set_process(Network.isClient or Network.isHost)\n\n\tprint(\"Generated \", puzzle.blocks.size(), \" blocks.\" )\n\n\tprint( \"Saving seed \" + str(seed) + \"...\" )\n\tDataMan.savePuzzle( \"SavedPuzzles\/RandomPuzzle\" + str(seed) + \".pzl\", puzzle )\n\n\tpuzzle = 0\n\n\tpuzzle = DataMan.loadPuzzle( \"SavedPuzzles\/RandomPuzzle\" + str(seed) + \".pzl\" )\n\n\tvar steps = puzzle.solvePuzzleSteps()\n\tprint( \"PUZZLE IS SOLVEABLE?: \", steps.solveable )\n\n\taddTimer()\n\n\t# Place the blocks in the puzzle.\n\tvar gridMan = get_node( \"GridView\/GridMan\" )\n\tgridMan.set_puzzle(puzzle)\n\n\t# make a new puzzle, embed using Viewport\n\tif mainPuzzle:\n\t\tvar p = PuzzleScn.instance()\n\t\t#p.remove_and_delete_child(p.get_node(\"Lights\"))\n\t\t#.remove_and_delete_child(p.get_node(\"Camera\"))\n\t\tp.get_node(\"GridView\").active = false\n\t\tp.mainPuzzle = false\n\t\tp.set_scale(Vector3(0.5, 0.5, 0.5))\n\t\tp.set_translation(Vector3(10, 5, -20))\n\n\t\tvar v = Viewport.new()\n\t\tvar c = Control.new()\n\n\t\tv.set_world(p.get_world())\n\t\tv.set_rect(Rect2(0, 0, 100, 100))\n\t\tv.set_physics_object_picking(false)\n\t\tget_tree().get_root().get_node( \"Spatial\" ).get_node( \"Camera\" ).add_child(p)\n\t\tv.add_child(p)\n\t\tadd_child(c)\n\t\tc.add_child(v)\n\t\totherPuzzle = p #for use with network\n# child of control? easier input\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"22908ef711b16f39fafbae5c9703317419d62a88","subject":"Disabled input checking on navmesh skript, caused crash on mouse events.","message":"Disabled input checking on navmesh skript, caused crash on mouse events.\n","repos":"NiclasEriksen\/godot_rpg","old_file":"scripts\/navmesh.gd","new_file":"scripts\/navmesh.gd","new_contents":"extends Navigation2D\nvar path = []\nvar font = null\nvar drawTouch = false\nvar touchPos = Vector2(0,0)\nvar closestPos = Vector2(0,0)\n\nfunc _ready():\n\tfont = load(\"res:\/\/resources\/mono_font.fnt\")\n\t# set_process_input(true)\n\t# var n = get_node(\"Genmap1\")\n\t#var w = get_node(\"\/root\/globals\").MAP_WIDTH\n\t#var h = get_node(\"\/root\/globals\").MAP_HEIGHT\n\t#var clear_tile = n.get_tileset().find_tile_by_name(\"blank\")\n\t#for x in range(w):\n\t#\tfor y in range(h):\n\t#\t\tn.set_cell(x, y, clear_tile)\n\t#n.set_cell(4, 5, n.get_tileset().find_tile_by_name(\"wood_wall_l\"))\n\t#n.set_cell(25, 5, n.get_tileset().find_tile_by_name(\"wood_wall_r\"))\n\t#for x in range(20):\n\t#\tn.set_cell(5 + x, 5, n.get_tileset().find_tile_by_name(\"wood_wall_m\"))\n\nfunc _draw():\n\tif(path.size()):\n\t\tfor i in range(path.size()):\n\t\t\tdraw_string(font,Vector2(path[i].x,path[i].y - 20),str(i+1))\n\t\t\tdraw_circle(path[i],10,Color(1,1,1))\n\n\t\tif(drawTouch):\n\t\t\tdraw_circle(touchPos,10,Color(0,1,0))\n\t\t\tdraw_circle(closestPos,10,Color(0,1,0))\n\n\nfunc _input(event):\n\tif(event.type == InputEvent.MOUSE_BUTTON):\n\t\tif(event.button_index == 1):\n\t\t\tif(path.size()):\n\t\t\t\t# touchPos = get_parent().get_node(\"Player_object\").get_node(\"Camera2D\").get_translated_pos(Vector2(event.x, event.y))\n\t\t\t\ttouchPos = get_global_mouse_pos()\n\t\t\t\tdrawTouch = true\n\t\t\t\tclosestPos = get_closest_point(touchPos)\n\t\t\t\tprint(\"Drawing touch\")\n\t\t\t\tupdate()\n\n\t\tif(event.button_index == 2):\n\t\t\t# var sp = get_parent().get_node(\"Player_object\").get_node(\"Camera2D\").get_translated_pos(Vector2(event.x, event.y))\n\t\t\tvar sp = get_global_mouse_pos()\n\t\t\t#path = get_simple_path(get_parent().get_node(\"Mob 2\").get_pos(), sp)\n\t\t\tvar new_curve = Curve2D.new()\n\t\t\tfor p in path:\n\t\t\t\t# print(p)\n\t\t\t\tnew_curve.add_point(Vector2(p.x, p.y))\n\t\t\tget_parent().get_node(\"Mob 2\").get_node(\"Path2D\").set_curve(new_curve)\n\t\t\tget_parent().get_node(\"Mob 2\").get_node(\"Path2D\").get_node(\"PathFollow2D\").set_unit_offset(0.0)\n\t\t\tget_parent().get_node(\"Mob 2\").get_node(\"Path2D\").get_node(\"PathFollow2D\").set_loop(false)\n\t\t\t# print(get_parent().get_node(\"Mob 2\").get_node(\"Path2D\").get_node(\"PathFollow2D\"))\n\t\t\t# print(path)\n\t\t\tupdate()\n","old_contents":"extends Navigation2D\r\nvar path = []\r\nvar font = null\r\nvar drawTouch = false\r\nvar touchPos = Vector2(0,0)\r\nvar closestPos = Vector2(0,0)\r\n\r\nfunc _ready():\r\n\tfont = load(\"res:\/\/resources\/mono_font.fnt\")\r\n\tset_process_input(true)\r\n\t# var n = get_node(\"Genmap1\")\r\n\t#var w = get_node(\"\/root\/globals\").MAP_WIDTH\r\n\t#var h = get_node(\"\/root\/globals\").MAP_HEIGHT\r\n\t#var clear_tile = n.get_tileset().find_tile_by_name(\"blank\")\r\n\t#for x in range(w):\r\n\t#\tfor y in range(h):\r\n\t#\t\tn.set_cell(x, y, clear_tile)\r\n\t#n.set_cell(4, 5, n.get_tileset().find_tile_by_name(\"wood_wall_l\"))\r\n\t#n.set_cell(25, 5, n.get_tileset().find_tile_by_name(\"wood_wall_r\"))\r\n\t#for x in range(20):\r\n\t#\tn.set_cell(5 + x, 5, n.get_tileset().find_tile_by_name(\"wood_wall_m\"))\r\n\r\nfunc _draw():\r\n\tif(path.size()):\r\n\t\tfor i in range(path.size()):\r\n\t\t\tdraw_string(font,Vector2(path[i].x,path[i].y - 20),str(i+1))\r\n\t\t\tdraw_circle(path[i],10,Color(1,1,1))\r\n\r\n\t\tif(drawTouch):\r\n\t\t\tdraw_circle(touchPos,10,Color(0,1,0))\r\n\t\t\tdraw_circle(closestPos,10,Color(0,1,0))\r\n\r\n\r\nfunc _input(event):\r\n\tif(event.type == InputEvent.MOUSE_BUTTON):\r\n\t\tif(event.button_index == 1):\r\n\t\t\tif(path.size()):\r\n\t\t\t\t# touchPos = get_parent().get_node(\"Player_object\").get_node(\"Camera2D\").get_translated_pos(Vector2(event.x, event.y))\r\n\t\t\t\ttouchPos = get_global_mouse_pos()\r\n\t\t\t\tdrawTouch = true\r\n\t\t\t\tclosestPos = get_closest_point(touchPos)\r\n\t\t\t\tprint(\"Drawing touch\")\r\n\t\t\t\tupdate()\r\n\r\n\t\tif(event.button_index == 2):\r\n\t\t\t# var sp = get_parent().get_node(\"Player_object\").get_node(\"Camera2D\").get_translated_pos(Vector2(event.x, event.y))\r\n\t\t\tvar sp = get_global_mouse_pos()\r\n\t\t\tpath = get_simple_path(get_parent().get_node(\"Mob 2\").get_pos(), sp)\r\n\t\t\tvar new_curve = Curve2D.new()\r\n\t\t\tfor p in path:\r\n\t\t\t\t# print(p)\r\n\t\t\t\tnew_curve.add_point(Vector2(p.x, p.y))\r\n\t\t\tget_parent().get_node(\"Mob 2\").get_node(\"Path2D\").set_curve(new_curve)\r\n\t\t\tget_parent().get_node(\"Mob 2\").get_node(\"Path2D\").get_node(\"PathFollow2D\").set_unit_offset(0.0)\r\n\t\t\tget_parent().get_node(\"Mob 2\").get_node(\"Path2D\").get_node(\"PathFollow2D\").set_loop(false)\r\n\t\t\t# print(get_parent().get_node(\"Mob 2\").get_node(\"Path2D\").get_node(\"PathFollow2D\"))\r\n\t\t\t# print(path)\r\n\t\t\tupdate()\r\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"6f5da4222165017e49be4eb9fc6480443edd8769","subject":"Reverted hit rumble power","message":"Reverted hit rumble power\n","repos":"P1X-in\/boctok","old_file":"scripts\/entities\/rocket.gd","new_file":"scripts\/entities\/rocket.gd","new_contents":"extends RigidBody2D\n\nvar bag\nvar ship = preload(\"res:\/\/scripts\/ship.gd\")\n\nvar GRAVITY_FACTOR = 100000000000\n\nvar current_acceleration = Vector2(0, 0)\nvar current_gravity = Vector2(0, 0)\n\nvar initial_velocity = Vector2(0, 0)\nvar started = false\n\nvar engines = []\n\nvar owner\n\n\nfunc _integrate_forces(s):\n var pos = self.get_pos()\n\n if pos.distance_to(Vector2(5000, 5000)) > 3000:\n self.queue_free()\n\n var lv = s.get_linear_velocity()\n var step = s.get_step()\n\n var engines_on = {\"Main\" : true, \"Left\": false, \"Right\" : false}\n\n self.set_rot(lv.angle() + 3.14)\n\n self.current_gravity = s.get_total_gravity() * step * self.GRAVITY_FACTOR\n lv += self.current_gravity\n self.current_acceleration = lv\n\n if not self.started:\n lv += self.initial_velocity\n self.started = true\n\n s.set_linear_velocity(lv)\n self.__engines_start(engines_on)\n\nfunc _colliding_body(body):\n if body extends self.ship and body.player_id != self.owner:\n self.bag.players.players[self.owner].score += 10\n\n if body extends self.ship:\n var device_id = self.bag.players.players[body.player_id].gamepad_id\n Input.start_joy_vibration(device_id, 1, 0, 0.2)\n self.bag.players.players[body.player_id].swear()\n\n self.bag.sound.play('rocket_bang')\n self.bag.board.add_explosion(self.get_pos())\n self.queue_free()\n\nfunc __engines_start(engines):\n for engine in engines:\n if engines[engine] == true:\n self.engines[engine].set_emitting(true)\n\nfunc _ready():\n self.bag = self.get_node(\"\/root\/boctok\").bag\n set_fixed_process(true)\n var engines = self.get_node(\"Engines\")\n self.engines = {\n \"Main\" : engines.get_node(\"Main\"),\n \"Left\" : engines.get_node(\"Left\"),\n \"Right\" : engines.get_node(\"Right\"),\n }\n","old_contents":"extends RigidBody2D\n\nvar bag\nvar ship = preload(\"res:\/\/scripts\/ship.gd\")\n\nvar GRAVITY_FACTOR = 100000000000\n\nvar current_acceleration = Vector2(0, 0)\nvar current_gravity = Vector2(0, 0)\n\nvar initial_velocity = Vector2(0, 0)\nvar started = false\n\nvar engines = []\n\nvar owner\n\n\nfunc _integrate_forces(s):\n var pos = self.get_pos()\n\n if pos.distance_to(Vector2(5000, 5000)) > 3000:\n self.queue_free()\n\n var lv = s.get_linear_velocity()\n var step = s.get_step()\n\n var engines_on = {\"Main\" : true, \"Left\": false, \"Right\" : false}\n\n self.set_rot(lv.angle() + 3.14)\n\n self.current_gravity = s.get_total_gravity() * step * self.GRAVITY_FACTOR\n lv += self.current_gravity\n self.current_acceleration = lv\n\n if not self.started:\n lv += self.initial_velocity\n self.started = true\n\n s.set_linear_velocity(lv)\n self.__engines_start(engines_on)\n\nfunc _colliding_body(body):\n if body extends self.ship and body.player_id != self.owner:\n self.bag.players.players[self.owner].score += 10\n\n if body extends self.ship:\n var device_id = self.bag.players.players[body.player_id].gamepad_id\n Input.start_joy_vibration(device_id, 0.5, 0, 0.2)\n self.bag.players.players[body.player_id].swear()\n\n self.bag.sound.play('rocket_bang')\n self.bag.board.add_explosion(self.get_pos())\n self.queue_free()\n\nfunc __engines_start(engines):\n for engine in engines:\n if engines[engine] == true:\n self.engines[engine].set_emitting(true)\n\nfunc _ready():\n self.bag = self.get_node(\"\/root\/boctok\").bag\n set_fixed_process(true)\n var engines = self.get_node(\"Engines\")\n self.engines = {\n \"Main\" : engines.get_node(\"Main\"),\n \"Left\" : engines.get_node(\"Left\"),\n \"Right\" : engines.get_node(\"Right\"),\n }\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"db0f258000464e6fa7b1e871332186428e39a574","subject":"Want to merge.","message":"Want to merge.\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/PuzzleManager.gd","new_file":"src\/scripts\/PuzzleManager.gd","new_contents":"const DIFF_EASY\t\t= 0\nconst DIFF_MEDIUM\t= 1\nconst DIFF_HARD\t\t= 2\n\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\nconst blockColors = [\"Blue\", \"Orange\", \"Red\", \"Yellow\", \"Purple\", \"Green\"]\nconst wildColors = [\"WildBlue\", \"WildOrange\", \"WildRed\", \"WildYellow\", \"WildPurple\", \"WildGreen\"]\n\n# Preload paired blocks\nconst blockScn = preload( \"res:\/\/blocks\/block.scn\" )\nconst blockScripts = [ preload( \"Blocks\/LaserBlock.gd\" )\n\t\t\t \t , preload( \"Blocks\/LaserBlock.gd\" )\n\t\t\t \t , preload( \"Blocks\/PairedBlock.gd\" )\n\t\t\t \t , preload( \"Blocks\/LaserBlock.gd\" )\n\t\t\t \t ]\nconst aBlock = preload( \"Blocks\/AbstractBlock.gd\" )\n\n# Hash map of all possible positions\nvar shape = {}\n\n# Stores a puzzle in a convenient class.\nclass Puzzle:\n\tvar puzzleName\n\tvar puzzleLayers\n\tvar blocks = []\n\tvar lasers = []\n\t\n\tvar puzzleMan\n\t\n\t# Converts a puzzle to a dictionary.\n\tfunc toDict():\n\t\tvar blockArr = []\n\t\tfor b in range( blocks.size() ):\n\t\t\tblockArr.append( blocks[b].toDict() )\n\t\n\t\tvar di = { pN = puzzleName\n\t\t \t , pL = puzzleLayers\n\t\t\t\t , bL = blockArr\n\t\t\t }\n\t\treturn di\n\t\n\t# Converts a dictionary to a puzzle.\n\tfunc fromDict( di ):\n\t\tpuzzleName = di.pN\n\t\tpuzzleLayers = di.pL\n\t\tfor b in range( di.bL.size() ):\n\t\t\tvar nb = puzzleMan.PickledBlock.new()\n\t\t\tnb.fromDict( di.bL[b] )\n\t\t\tblocks.append( nb )\n\t\treturn\n\t\n\t# Determines if a puzzle is solveable.\n\tfunc solvePuzzle():\n\t\t# Simply use the solvePuzzleSteps function and return the solveable part.\n\t\tvar ps = self.solvePuzzleSteps()\n\t\treturn ps.solveable\n\t\n\t# Determines if a puzzle is solveable and returns the steps needed to solve it.\n\tfunc solvePuzzleSteps():\n\t\tvar puzzleSteps = PuzzleSteps.new()\n\t\tpuzzleSteps.solveable = true\n\t\n\t\tvar lasers = []\n\t\tvar pairs = []\n\t\tvar wildblocks = []\n\t\n\t\t# Split the blocks into lasers, pairs and wild blocks.\n\t\tfor b in blocks:\n\t\t\tif b.blockClass == BLOCK_PAIR:\n\t\t\t\tpairs.append( b )\n\t\t\tif b.blockClass == BLOCK_LASER:\n\t\t\t\tlasers.append( b )\n\t\t\tif b.blockClass == BLOCK_WILD:\n\t\t\t\twildblocks.append( b )\n\t\n\t\treturn puzzleSteps\n\t\n\t# Holds all of the steps needed to solve a puzzle.\n\tclass PuzzleSteps:\n\t\tvar solveable\n\n# Randomly shuffle an array.\nfunc shuffleArray( arr ):\n\tfor i in range( arr.size() - 1, 1, -1 ):\n\t\tvar swapVal = randi() % (i + 1)\n\t\tvar temp = arr[swapVal]\n\t\tarr[swapVal] = arr[i]\n\t\tarr[i] = temp\n\t\t\n\n# calculate the layer; move into a method so that it can be used elsewhere\nfunc calcBlockLayer( x, y, z ):\n\treturn max( max( abs( x ), abs( y ) ), abs( z ) )\n\n# Determines the block type based on puzzle size and difficulty.\nfunc getBlockType( difficulty, x, y, z ):\n\t# Determine if this is the goal block.\n\tif x == 0 and y == 0 and z == 0:\n\t\treturn BLOCK_GOAL\n\n\t# Determine the layer this block is on.\n\tvar layer = calcBlockLayer( x, y, z )\n\n\t# Determine how many blocks are on the outer part of the layer.\n\tvar layerCount = 0\n\tif abs( x ) == layer:\n\t\tlayerCount += 1\n\tif abs( y ) == layer:\n\t\tlayerCount += 1\n\tif abs( z ) == layer:\n\t\tlayerCount += 1\n\n\t# Determine if this block is a laser.\n\tif difficulty == DIFF_EASY or difficulty == DIFF_MEDIUM:\n\t\tif layerCount == 3:\n\t\t\treturn BLOCK_LASER\n\n\tif difficulty == DIFF_HARD:\n\t\tif abs( x ) == abs( z ) and y == 0:\n\t\t\treturn BLOCK_LASER\n\n\t# Determine if this block is a wild block.\n\tif difficulty == DIFF_EASY:\n\t\tif layerCount == 2:\n\t\t\treturn BLOCK_WILD\n\n\tif difficulty == DIFF_MEDIUM:\n\t\tif layerCount == 2:\n\t\t\tif y == layer || y == -layer:\n\t\t\t\treturn BLOCK_WILD\n\n\tif difficulty == DIFF_HARD:\n\t\tif layerCount == 1:\n\t\t\tif y == 0:\n\t\t\t\treturn BLOCK_WILD\n\n\t# Otherwise it's a normal block.\n\treturn BLOCK_PAIR\n\n# Generates a solveable puzzle.\nfunc generatePuzzle( layers, difficulty ):\n\tvar blockID = 0\n\tvar puzzle = Puzzle.new()\n\tpuzzle.puzzleName = \"RANDOM PUZZLE\"\n\tpuzzle.puzzleLayers = layers\n\t\n\t# Create all possible positions.\n\tvar layeredblocks = []\n\tfor l in range( 0, layers + 1 ):\n\t\tlayeredblocks.append( [] )\n\tfor x in range( -layers, layers + 1 ):\n\t\tfor y in range( -layers, layers + 1 ):\n\t\t\tfor z in range( -layers, layers + 1 ):\n\t\t\t\tlayeredblocks[calcBlockLayer( x, y, z )].append(Vector3(x,y,z))\n\t\t\t\tshape[Vector3(x,y,z)] = null\n\n\t# Generate laser lines.\n\tfor l in range( 1, layers + 1 ):\n\t\tif difficulty == DIFF_EASY:\n\t\t\tfor lx in [ -l, l ]:\n\t\t\t\tfor lz in [ -l, l ]:\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, lx, lz ), Vector3( lx + lx*-1, lx, lz )] )\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, lx, lz ), Vector3( lx, lx + lx*-1, lz )] )\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, lx, lz ), Vector3( lx, lx, lz + lz*-1 )] )\n\t\t\t\t\t\n\t\tif difficulty == DIFF_MEDIUM:\n\t\t\tfor lx in [ -l, l ]:\n\t\t\t\tfor ly in [ -l, l ]:\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, ly, lx ), Vector3( lx + lx*-1, ly, lx )] )\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, ly, lx ), Vector3( lx, ly, lx + lx*-1 )] )\n\t\t\t\t\t\n\t\tif difficulty == DIFF_HARD:\n\t\t\tfor lx in [ -l, l ]:\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, 0, lx ), Vector3( lx + lx*-1, 0, lx )] )\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, 0, lx ), Vector3( lx, 0, lx + lx*-1 )] )\n\t\t\t\t\t\t\n\t#for l in puzzle.lasers:\n\t#\tpass #print( l )\n\t\t\n\t# print( \"LASERS \", puzzle.lasers.size() )\n\n\t# Assign block types based on position.\n\tfor l in range( 0, layers + 1 ):\n\t\t# Randomize the pairs.\n\t\tshuffleArray( layeredblocks[l] )\n\t\t# print( \"NUM \", layeredblocks[l].size() )\n\t\tvar prevBlock = null\n\t\tvar even = false\n\t\tvar prevLaser = null\n\t\tvar laserEven = false\n\t\tfor pos in layeredblocks[l]:\n\t\t\tvar x = pos.x\n\t\t\tvar y = pos.y\n\t\t\tvar z = pos.z\n\t\n\t\t\tvar t = getBlockType( difficulty, x, y, z )\n\t\n\t\t\tif t == BLOCK_GOAL:\n\t\t\t\tcontinue\n\t\n\t\t\tvar b = PickledBlock.new()\n\t\t\tb.blockPos = pos\n\t\t\tb.name = blockID\n\t\n\t\t\tblockID += 1\n\t\t\tpuzzle.blocks.append( b )\n\t\n\t\t\tif t == BLOCK_LASER:\n\t\t\t\tb.setBlockClass(BLOCK_LASER)\n\t\t\t\tif laserEven:\n\t\t\t\t\tb.setPairName(prevLaser.name) \\\n\t\t\t\t\t.setLaserExtent(prevLaser.blockPos - b.blockPos)\n\t\n\t\t\t\t\tprevLaser.setPairName(b.name) \\\n\t\t\t\t\t.setLaserExtent(b.blockPos - prevLaser.blockPos)\n\t\t\t\tlaserEven = not laserEven\n\t\t\t\tprevLaser = b\n\t\t\t\tcontinue\n\t\n\t\t\tif t == BLOCK_WILD:\n\t\t\t\tb.setBlockClass(BLOCK_PAIR) \\\n\t\t\t\t\t.setTextureName(wildColors[randi() % wildColors.size()])\n\t\t\t\tcontinue\n\t\n\t\t\tif even:\n\t\t\t\tvar randColor = blockColors[randi() % blockColors.size()]\n\t\t\t\tb.setBlockClass(BLOCK_PAIR) \\\n\t\t\t\t\t.setPairName(prevBlock.name) \\\n\t\t\t\t\t.setTextureName(randColor)\n\t\n\t\t\t\tprevBlock.setBlockClass(BLOCK_PAIR) \\\n\t\t\t\t\t.setPairName(b.name) \\\n\t\t\t\t\t.setTextureName(randColor)\n\t\t\teven = not even\n\t\t\tprevBlock = b\n\n\treturn puzzle\n\nclass PickledBlock:\n\tvar name\n\tvar blockClass = BLOCK_PAIR\n\tvar pairName\n\tvar textureName = \"Red\"\n\tvar blockPos\n\tvar laserExtent\n\n\tfunc setName(n):\n\t\tname = n\n\t\treturn self\n\n\tfunc setPairName(n):\n\t\tpairName = n\n\t\treturn self\n\n\tfunc setLaserExtent(n):\n\t\tlaserExtent = n\n\t\treturn self\n\n\tfunc setBlockClass(c):\n\t\tblockClass = c\n\t\treturn self\n\n\tfunc setTextureName(t):\n\t\ttextureName = t\n\t\treturn self\n\n\tfunc toString():\n\t\treturn str(name) + \": \" + str(blockClass)\n\n\tfunc toNode():\n\t\t# instantiate a block scene, assign the appropriate script to it\n\t\tvar n = blockScn.instance()\n\t\tn.set_script(blockScripts[blockClass])\n\n\t\t# configure block node\n\t\tn.setName(str(name)).setTexture()\n\t\tn.blockPos = blockPos\n\t\tif blockClass == BLOCK_PAIR:\n\t\t\tn.setPairName(pairName).setTexture(textureName)\n\n\t\tif blockClass == BLOCK_LASER:\n\t\t\tn.setPairName(pairName).setExtent(laserExtent)\n\t\treturn n\n\t\t\n\t# Convert this object to a dictionary.\n\tfunc toDict():\n\t\tvar di = { n = name\n\t\t \t , bC = blockClass\n\t\t\t , pN = pairName\n\t\t\t , tN = textureName\n\t\t\t , bP = blockPos\n\t\t\t , lE = laserExtent\n\t\t\t }\n\t\treturn di\n\t\t\t\n\t# Make this object from a dictionary.\n\tfunc fromDict( di ):\n\t\tname = di.n\n\t\tblockClass = di.bC\n\t\tpairName = di.pN\n\t\ttextureName = di.tN\n\t\tblockPos = di.bP\n\t\tlaserExtent = di.lE\n\n","old_contents":"const DIFF_EASY\t\t= 0\nconst DIFF_MEDIUM\t= 1\nconst DIFF_HARD\t\t= 2\n\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\nconst blockColors = [\"Blue\", \"Orange\", \"Red\", \"Yellow\", \"Purple\", \"Green\"]\nconst wildColors = [\"WildBlue\", \"WildOrange\", \"WildRed\", \"WildYellow\", \"WildPurple\", \"WildGreen\"]\n\n# Preload paired blocks\nconst blockScn = preload( \"res:\/\/blocks\/block.scn\" )\nconst blockScripts = [ preload( \"Blocks\/LaserBlock.gd\" )\n\t\t\t \t , preload( \"Blocks\/LaserBlock.gd\" )\n\t\t\t \t , preload( \"Blocks\/PairedBlock.gd\" )\n\t\t\t \t , preload( \"Blocks\/LaserBlock.gd\" )\n\t\t\t \t ]\nconst aBlock = preload( \"Blocks\/AbstractBlock.gd\" )\n\n# Hash map of all possible positions\nvar shape = {}\n\n# Stores a puzzle in a convenient class.\nclass Puzzle:\n\tvar puzzleName\n\tvar puzzleLayers\n\tvar blocks = []\n\tvar lasers = []\n\t\n\tvar puzzleMan\n\t\n\t# Converts a puzzle to a dictionary.\n\tfunc toDict():\n\t\tvar blockArr = []\n\t\tfor b in range( blocks.size() ):\n\t\t\tblockArr.append( blocks[b].toDict() )\n\t\n\t\tvar di = { pN = puzzleName\n\t\t \t , pL = puzzleLayers\n\t\t\t\t , bL = blockArr\n\t\t\t }\n\t\treturn di\n\t\n\t# Converts a dictionary to a puzzle.\n\tfunc fromDict( di ):\n\t\tpuzzleName = di.pN\n\t\tpuzzleLayers = di.pL\n\t\tfor b in range( di.bL.size() ):\n\t\t\tvar nb = puzzleMan.PickledBlock.new()\n\t\t\tnb.fromDict( di.bL[b] )\n\t\t\tblocks.append( nb )\n\t\treturn\n\t\n\t# Determines if a puzzle is solveable.\n\tfunc solvePuzzle():\n\t\t# Simply use the solvePuzzleSteps function and return the solveable part.\n\t\tvar ps = self.solvePuzzleSteps()\n\t\treturn ps.solveable\n\t\n\t# Determines if a puzzle is solveable and returns the steps needed to solve it.\n\tfunc solvePuzzleSteps():\n\t\tvar puzzleSteps = PuzzleSteps.new()\n\t\tpuzzleSteps.solveable = true\n\t\n\t\t# SOLVER\n\t\n\t\treturn puzzleSteps\n\t\n\t# Holds all of the steps needed to solve a puzzle.\n\tclass PuzzleSteps:\n\t\tvar solveable\n\n# Randomly shuffle an array.\nfunc shuffleArray( arr ):\n\tfor i in range( arr.size() - 1, 1, -1 ):\n\t\tvar swapVal = randi() % (i + 1)\n\t\tvar temp = arr[swapVal]\n\t\tarr[swapVal] = arr[i]\n\t\tarr[i] = temp\n\t\t\n\n# calculate the layer; move into a method so that it can be used elsewhere\nfunc calcBlockLayer( x, y, z ):\n\treturn max( max( abs( x ), abs( y ) ), abs( z ) )\n\n# Determines the block type based on puzzle size and difficulty.\nfunc getBlockType( difficulty, x, y, z ):\n\t# Determine if this is the goal block.\n\tif x == 0 and y == 0 and z == 0:\n\t\treturn BLOCK_GOAL\n\n\t# Determine the layer this block is on.\n\tvar layer = calcBlockLayer( x, y, z )\n\n\t# Determine how many blocks are on the outer part of the layer.\n\tvar layerCount = 0\n\tif abs( x ) == layer:\n\t\tlayerCount += 1\n\tif abs( y ) == layer:\n\t\tlayerCount += 1\n\tif abs( z ) == layer:\n\t\tlayerCount += 1\n\n\t# Determine if this block is a laser.\n\tif difficulty == DIFF_EASY or difficulty == DIFF_MEDIUM:\n\t\tif layerCount == 3:\n\t\t\treturn BLOCK_LASER\n\n\tif difficulty == DIFF_HARD:\n\t\tif abs( x ) == abs( z ) and y == 0:\n\t\t\treturn BLOCK_LASER\n\n\t# Determine if this block is a wild block.\n\tif difficulty == DIFF_EASY:\n\t\tif layerCount == 2:\n\t\t\treturn BLOCK_WILD\n\n\tif difficulty == DIFF_MEDIUM:\n\t\tif layerCount == 2:\n\t\t\tif y == layer || y == -layer:\n\t\t\t\treturn BLOCK_WILD\n\n\tif difficulty == DIFF_HARD:\n\t\tif layerCount == 1:\n\t\t\tif y == 0:\n\t\t\t\treturn BLOCK_WILD\n\n\t# Otherwise it's a normal block.\n\treturn BLOCK_PAIR\n\n# Generates a solveable puzzle.\nfunc generatePuzzle( layers, difficulty ):\n\tvar blockID = 0\n\tvar puzzle = Puzzle.new()\n\tpuzzle.puzzleName = \"RANDOM PUZZLE\"\n\tpuzzle.puzzleLayers = layers\n\t\n\t# Create all possible positions.\n\tvar layeredblocks = []\n\tfor l in range( 0, layers + 1 ):\n\t\tlayeredblocks.append( [] )\n\tfor x in range( -layers, layers + 1 ):\n\t\tfor y in range( -layers, layers + 1 ):\n\t\t\tfor z in range( -layers, layers + 1 ):\n\t\t\t\tlayeredblocks[calcBlockLayer( x, y, z )].append(Vector3(x,y,z))\n\t\t\t\tshape[Vector3(x,y,z)] = null\n\n\t# Generate laser lines.\n\tfor l in range( 1, layers + 1 ):\n\t\tif difficulty == DIFF_EASY:\n\t\t\tfor lx in [ -l, l ]:\n\t\t\t\tfor lz in [ -l, l ]:\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, lx, lz ), Vector3( lx + lx*-1, lx, lz )] )\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, lx, lz ), Vector3( lx, lx + lx*-1, lz )] )\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, lx, lz ), Vector3( lx, lx, lz + lz*-1 )] )\n\t\t\t\t\t\n\t\tif difficulty == DIFF_MEDIUM:\n\t\t\tfor lx in [ -l, l ]:\n\t\t\t\tfor ly in [ -l, l ]:\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, ly, lx ), Vector3( lx + lx*-1, ly, lx )] )\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, ly, lx ), Vector3( lx, ly, lx + lx*-1 )] )\n\t\t\t\t\t\n\t\tif difficulty == DIFF_HARD:\n\t\t\tfor lx in [ -l, l ]:\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, 0, lx ), Vector3( lx + lx*-1, 0, lx )] )\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, 0, lx ), Vector3( lx, 0, lx + lx*-1 )] )\n\t\t\t\t\t\t\n\tfor l in puzzle.lasers:\n\t\tprint( l )\n\t\t\n\t# print( \"LASERS \", puzzle.lasers.size() )\n\n\t# Assign block types based on position.\n\tfor l in range( 0, layers + 1 ):\n\t\t# Randomize the pairs.\n\t\tshuffleArray( layeredblocks[l] )\n\t\t# print( \"NUM \", layeredblocks[l].size() )\n\t\tvar prevBlock = null\n\t\tvar even = false\n\t\tvar prevLaser = null\n\t\tvar laserEven = false\n\t\tfor pos in layeredblocks[l]:\n\t\t\tvar x = pos.x\n\t\t\tvar y = pos.y\n\t\t\tvar z = pos.z\n\t\n\t\t\tvar t = getBlockType( difficulty, x, y, z )\n\t\n\t\t\tif t == BLOCK_GOAL:\n\t\t\t\tcontinue\n\t\n\t\t\tvar b = PickledBlock.new()\n\t\t\tb.blockPos = pos\n\t\t\tb.name = blockID\n\t\n\t\t\tblockID += 1\n\t\t\tpuzzle.blocks.append( b )\n\t\n\t\t\tif t == BLOCK_LASER:\n\t\t\t\tb.setBlockClass(BLOCK_LASER)\n\t\t\t\tif laserEven:\n\t\t\t\t\tb.setPairName(prevLaser.name) \\\n\t\t\t\t\t.setLaserExtent(prevLaser.blockPos - b.blockPos)\n\t\n\t\t\t\t\tprevLaser.setPairName(b.name) \\\n\t\t\t\t\t.setLaserExtent(b.blockPos - prevLaser.blockPos)\n\t\t\t\tlaserEven = not laserEven\n\t\t\t\tprevLaser = b\n\t\t\t\tcontinue\n\t\n\t\t\tif t == BLOCK_WILD:\n\t\t\t\tb.setBlockClass(BLOCK_PAIR) \\\n\t\t\t\t\t.setTextureName(wildColors[randi() % wildColors.size()])\n\t\t\t\tcontinue\n\t\n\t\t\tif even:\n\t\t\t\tvar randColor = blockColors[randi() % blockColors.size()]\n\t\t\t\tb.setBlockClass(BLOCK_PAIR) \\\n\t\t\t\t\t.setPairName(prevBlock.name) \\\n\t\t\t\t\t.setTextureName(randColor)\n\t\n\t\t\t\tprevBlock.setBlockClass(BLOCK_PAIR) \\\n\t\t\t\t\t.setPairName(b.name) \\\n\t\t\t\t\t.setTextureName(randColor)\n\t\t\teven = not even\n\t\t\tprevBlock = b\n\n\treturn puzzle\n\nclass PickledBlock:\n\tvar name\n\tvar blockClass = BLOCK_PAIR\n\tvar pairName\n\tvar textureName = \"Red\"\n\tvar blockPos\n\tvar laserExtent\n\n\tfunc setName(n):\n\t\tname = n\n\t\treturn self\n\n\tfunc setPairName(n):\n\t\tpairName = n\n\t\treturn self\n\n\tfunc setLaserExtent(n):\n\t\tlaserExtent = n\n\t\treturn self\n\n\tfunc setBlockClass(c):\n\t\tblockClass = c\n\t\treturn self\n\n\tfunc setTextureName(t):\n\t\ttextureName = t\n\t\treturn self\n\n\tfunc toString():\n\t\treturn str(name) + \": \" + str(blockClass)\n\n\tfunc toNode():\n\t\t# instantiate a block scene, assign the appropriate script to it\n\t\tvar n = blockScn.instance()\n\t\tn.set_script(blockScripts[blockClass])\n\n\t\t# configure block node\n\t\tn.setName(str(name)).setTexture()\n\t\tn.blockPos = blockPos\n\t\tif blockClass == BLOCK_PAIR:\n\t\t\tn.setPairName(pairName).setTexture(textureName)\n\n\t\tif blockClass == BLOCK_LASER:\n\t\t\tn.setPairName(pairName).setExtent(laserExtent)\n\t\treturn n\n\t\t\n\t# Convert this object to a dictionary.\n\tfunc toDict():\n\t\tvar di = { n = name\n\t\t \t , bC = blockClass\n\t\t\t , pN = pairName\n\t\t\t , tN = textureName\n\t\t\t , bP = blockPos\n\t\t\t , lE = laserExtent\n\t\t\t }\n\t\treturn di\n\t\t\t\n\t# Make this object from a dictionary.\n\tfunc fromDict( di ):\n\t\tname = di.n\n\t\tblockClass = di.bC\n\t\tpairName = di.pN\n\t\ttextureName = di.tN\n\t\tblockPos = di.bP\n\t\tlaserExtent = di.lE\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"4d5caa3e8f4091695b6becc947b3a5279a085799","subject":"pad fix","message":"pad fix\n","repos":"P1X-in\/boctok","old_file":"scripts\/services\/players.gd","new_file":"scripts\/services\/players.gd","new_contents":"\n\nvar bag\n\nvar player_template = preload(\"res:\/\/scripts\/entities\/player.gd\")\nvar players = []\n\nfunc _init_bag(bag):\n self.bag = bag\n self.bind_players()\n\nfunc bind_players():\n self.players = [\n self.player_template.new(self.bag, 0),\n self.player_template.new(self.bag, 1),\n ]\n\n self.players[0].bind_keyboard()\n self.players[0].bind_gamepad(1)\n self.players[0].bind_camera(self.bag.board.viewport_left)\n self.players[0].bind_hud(self.bag.board.hud_left)\n self.players[1].bind_gamepad(0)\n self.players[1].bind_camera(self.bag.board.viewport_right)\n self.players[1].bind_hud(self.bag.board.hud_right)\n\nfunc is_gamepad_in_use(id):\n for player in self.players:\n if player.gamepad_id == id:\n return true\n return false\n\nfunc is_keyboard_in_use():\n for player in self.players:\n if player.keyboard_use:\n return true\n return false\n\nfunc spawn_players():\n self.players[0].spawn(Vector2(4000, 5000))\n self.players[1].spawn(Vector2(6000, 5000))\n\n\nfunc reset():\n for player in self.players:\n player.reset()\n","old_contents":"\n\nvar bag\n\nvar player_template = preload(\"res:\/\/scripts\/entities\/player.gd\")\nvar players = []\n\nfunc _init_bag(bag):\n self.bag = bag\n self.bind_players()\n\nfunc bind_players():\n self.players = [\n self.player_template.new(self.bag, 0),\n self.player_template.new(self.bag, 1),\n ]\n\n self.players[0].bind_keyboard()\n self.players[1].bind_gamepad(1)\n self.players[0].bind_camera(self.bag.board.viewport_left)\n self.players[0].bind_hud(self.bag.board.hud_left)\n self.players[1].bind_gamepad(0)\n self.players[1].bind_camera(self.bag.board.viewport_right)\n self.players[1].bind_hud(self.bag.board.hud_right)\n\nfunc is_gamepad_in_use(id):\n for player in self.players:\n if player.gamepad_id == id:\n return true\n return false\n\nfunc is_keyboard_in_use():\n for player in self.players:\n if player.keyboard_use:\n return true\n return false\n\nfunc spawn_players():\n self.players[0].spawn(Vector2(4000, 5000))\n self.players[1].spawn(Vector2(6000, 5000))\n\n\nfunc reset():\n for player in self.players:\n player.reset()\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"207e8b04dd7b2c8dc974a5d82b3ac83107a0da48","subject":"gd \"G\u00e0idhlig\" translation #1802. Author: GunChleoc.","message":"gd \"G\u00e0idhlig\" translation #1802. Author: GunChleoc.\n","repos":"bjhaid\/lila,Unihedro\/lila,clarkerubber\/lila,danilovsergey\/i-bur,ccampo133\/lila,bjhaid\/lila,systemovich\/lila,clarkerubber\/lila,abougouffa\/lila,pawank\/lila,danilovsergey\/i-bur,samuel-soubeyran\/lila,luanlv\/lila,Happy0\/lila,JimmyMow\/lila,terokinnunen\/lila,Enigmahack\/lila,samuel-soubeyran\/lila,pavelo65\/lila,systemovich\/lila,bjhaid\/lila,ccampo133\/lila,abougouffa\/lila,Enigmahack\/lila,Enigmahack\/lila,Unihedro\/lila,luanlv\/lila,pavelo65\/lila,r0k3\/lila,terokinnunen\/lila,samuel-soubeyran\/lila,TangentialAlan\/lila,terokinnunen\/lila,pavelo65\/lila,TangentialAlan\/lila,luanlv\/lila,danilovsergey\/i-bur,Happy0\/lila,samuel-soubeyran\/lila,pavelo65\/lila,Happy0\/lila,JimmyMow\/lila,TangentialAlan\/lila,r0k3\/lila,elioair\/lila,pawank\/lila,elioair\/lila,pavelo65\/lila,JimmyMow\/lila,danilovsergey\/i-bur,clarkerubber\/lila,pavelo65\/lila,Unihedro\/lila,Happy0\/lila,bjhaid\/lila,arex1337\/lila,bjhaid\/lila,luanlv\/lila,systemovich\/lila,r0k3\/lila,Enigmahack\/lila,Unihedro\/lila,Unihedro\/lila,Unihedro\/lila,TangentialAlan\/lila,arex1337\/lila,r0k3\/lila,JimmyMow\/lila,arex1337\/lila,luanlv\/lila,abougouffa\/lila,systemovich\/lila,systemovich\/lila,pawank\/lila,elioair\/lila,abougouffa\/lila,JimmyMow\/lila,elioair\/lila,abougouffa\/lila,arex1337\/lila,Happy0\/lila,elioair\/lila,ccampo133\/lila,luanlv\/lila,terokinnunen\/lila,samuel-soubeyran\/lila,arex1337\/lila,clarkerubber\/lila,r0k3\/lila,arex1337\/lila,danilovsergey\/i-bur,arex1337\/lila,abougouffa\/lila,Enigmahack\/lila,Unihedro\/lila,JimmyMow\/lila,danilovsergey\/i-bur,pawank\/lila,TangentialAlan\/lila,ccampo133\/lila,bjhaid\/lila,abougouffa\/lila,ccampo133\/lila,ccampo133\/lila,Enigmahack\/lila,clarkerubber\/lila,systemovich\/lila,r0k3\/lila,bjhaid\/lila,TangentialAlan\/lila,elioair\/lila,Happy0\/lila,JimmyMow\/lila,elioair\/lila,clarkerubber\/lila,samuel-soubeyran\/lila,danilovsergey\/i-bur,pawank\/lila,Enigmahack\/lila,terokinnunen\/lila,pawank\/lila,clarkerubber\/lila,terokinnunen\/lila,terokinnunen\/lila,samuel-soubeyran\/lila,pavelo65\/lila,TangentialAlan\/lila,Happy0\/lila,luanlv\/lila,r0k3\/lila,systemovich\/lila,pawank\/lila,ccampo133\/lila","old_file":"conf\/messages.gd","new_file":"conf\/messages.gd","new_contents":"playWithAFriend=Cluich c\u00f2mhla ri caraid\ninviteAFriendToPlayWithYou=Thoir cuireadh do charaid gus cluich c\u00f2mhla riut\nplayWithTheMachine=Cluich an aghaidh a' choimpiutair\nchallengeTheArtificialIntelligence=Thoir ionnsaigh air an inntinn fhuadain\ntoInviteSomeoneToPlayGiveThisUrl=Gus cuireadh a thoirt do chuideigin, thoir an url seo seachad\ngameOver=Cr\u00ecoch a\u2019 gheama\nwaitingForOpponent=A\u2019 feitheamh air n\u00e0mhaid\nwaiting=A\u2019 feitheamh\nyourTurn=An turas agad\naiNameLevelAiLevel=%s inbhe %s\nlevel=Inbhe\ntoggleTheChat=Toglaich a\u2019 chabadaich\ntoggleSound=Toglaich fuaim\nchat=Cabadaich\nresign=G\u00e8ill\ncheckmate=Tul-chasg\nstalemate=Clos-cluiche\nwhite=Geal\nblack=Dubh\ncreateAGame=Cruthaich geama\nnoGameAvailableRightNowCreateOne=Chan eil geama ri fhaighinn an-dr\u00e0sta, cruthaich fear \u00f9r!\nwhiteIsVictorious=Bhuannaich geal\nblackIsVictorious=Bhuannaich dubh\nplayWithTheSameOpponentAgain=Cluich an aghaidh an aon n\u00e0mhaid a-rithist\nnewOpponent=N\u00e0mhaid \u00f9r\nplayWithAnotherOpponent=Cluich an aghaidh n\u00e0mhaid eile\nyourOpponentWantsToPlayANewGameWithYou=Tha an n\u00e0mhaid agad airson geama \u00f9r a chluich c\u00f2mhla riut\njoinTheGame=Thig a-steach dhan gheama\nwhitePlays=Tha geal a\u2019 cluich\nblackPlays=Tha dubh a\u2019 cluich\ntheOtherPlayerHasLeftTheGameYouCanForceResignationOrWaitForHim=Tha an geamaiche eile air a' gheama fh\u00e0gail. Is urrainn dhut g\u00e8illeadh a chur air, no feitheamh air a shon.\nmakeYourOpponentResign=Cuir g\u00e8illeadh air an n\u00e0mhaid agad\nforceResignation=Cuir g\u00e8illeadh air an n\u00e0mhaid agad\ntalkInChat=D\u00e8an cabadaich\ntheFirstPersonToComeOnThisUrlWillPlayWithYou=Cluichidh a\u2019 chiad neach a thig a-steach air an url seo c\u00f2mhla riut.\nwhiteCreatesTheGame=Tha geal a\u2019 cruthachadh a\u2019 gheama\nblackCreatesTheGame=Tha dubh a\u2019 cruthachadh a\u2019 gheama\nwhiteJoinsTheGame=Th\u00e0inig geal a-steach dhan gheama\nblackJoinsTheGame=Th\u00e0inig dubh a-steach dhan gheama\nwhiteResigned=Gh\u00e8ill geal\nblackResigned=Gh\u00e8ill dubh\nwhiteLeftTheGame=Dh\u2019fh\u00e0g geal an geama\nblackLeftTheGame=Dh\u2019fh\u00e0g dubh an geama\nshareThisUrlToLetSpectatorsSeeTheGame=Co-roinn an url seo gus luchd-amhairc a leigeil a-steach dhan gheama\nyouAreViewingThisGameAsASpectator=Tha thu a\u2019 coimhead air a\u2019 gheama seo nad neach-amhairc\nreplayAndAnalyse=Ath-chluich is sgr\u00f9daich\nviewGameStats=Faic stadastaig a\u2019 gheama\nflipBoard=D\u00e8an flip air a\u2019 bh\u00f2rd\nthreefoldRepetition=Treas ath-nochdadh\nclaimADraw=Tagair geama ionnanach\nofferDraw=Tairg geama ionnanach\ndraw=Geama ionnanach\nnbConnectedPlayers=Tha %s geamaichean ceangailte\ntalkAboutChessAndDiscussLichessFeaturesInTheForum=Bruidhinn mu th\u00e0ileasg agus deasbad air na feartan aig lichess air a\u2019 bh\u00f2rd-bhrath\nseeTheGamesBeingPlayedInRealTime=Seall air na geamaichean a tha gan cluich ann am f\u00ecor-\u00f9ine\ngamesBeingPlayedRightNow=Geamaichean a tha gan cluich an-dr\u00e0sta fh\u00e8in\nviewAllNbGames=Seall air a h-uile %s de na geamaichean\nviewNbCheckmates=Seall na chur %s de thul-chasg\nnbBookmarks=%s Comharran-l\u00ecn\nnbPopularGames=%s geamannan m\u00f2r-ch\u00f2rdte\nnbAnalysedGames=%s geamannan sgr\u00f9daichte\nbookmarkedByNbPlayers=Comharra-leabhair le %s cluicheadairean\nviewInFullSize=Seall sa mheud iomlan\nlogOut=Log a-mach\nsignIn=Log a-steach\nsignUp=Cl\u00e0raich\npeople=Daoine\ngames=Geamannan\nforum=B\u00f2rd-brath\nchessPlayers=Geamaichean t\u00e0ileisg\nminutesPerSide=Mionaidean an taobh\nvariant=Caochladh\ntimeControl=Smachdadh-\u00f9ine\nstart=Toiseach\nusername=Far-ainm\npassword=Facal-faire\nhaveAnAccount=A bheil cunntas agad?\nallYouNeedIsAUsernameAndAPassword=Chan eil a dh\u00ecth ort ach far-ainm agus facal-faire\nlearnMoreAboutLichess=Ionnsaich barrachd mu lichess\nrank=Inbhe\ngamesPlayed=Geamannan air an cluich\ndeclineInvitation=Di\u00f9lt cuireadh\ncancel=Sguir dheth\ntimeOut=Dh\u2019fhalbh an \u00f9ine\ndrawOfferSent=Chaidh tairgse airson geama ionnanach a chur\ndrawOfferDeclined=Dhi\u00f9ltadh do thairgse airson geama ionnanach\ndrawOfferAccepted=Ghabhadh ri do thairgse airson geama ionnanach\ndrawOfferCanceled=Sguireadh de do thairgse airson geama ionnanach\nyourOpponentOffersADraw=Tha an n\u00e0mhaid agad a\u2019 tairgse geama ionnanach\naccept=Gabh ris\ndecline=Di\u00f9lt\nplayingRightNow=A\u2019 cluich an-dr\u00e0sta fh\u00e8in\nabortGame=Stad an geama\ngameAborted=Chaidh an geama a stad\nstandard=Coitcheann\nunlimited=Gun chr\u00ecoch\nmode=Modh\ncasual=Gun rangachadh\nrated=Rangaichte\nthisGameIsRated=Tha an geama seo rangaichte\nrematch=Ath-mhaids\nrematchOfferSent=Chaidh tairgse airson ath-chluich a chur\nrematchOfferAccepted=Ghabhadh ri do thairgse airson ath-chluich\nrematchOfferCanceled=Chaidh sgur dhe thairgse ath-mhaids\nrematchOfferDeclined=Tairgse ath-mhaids air a di\u00f9ltadh\ncancelRematchOffer=Sguir dhe thairgse ath-mhaids\nviewRematch=Seall air ath-mhaids\nplay=Cluich\ninbox=Bogsa a-steach\nchatRoom=Se\u00f2mar cabadaich\nspectatorRoom=Se\u00f2mar amhairc\ncomposeMessage=Sgr\u00ecobh teachdaireachd\nsentMessages=Teachdaireachdan air an cur\nincrementInSeconds=Ioncramaid ann an diogan\nfreeOnlineChess=T\u00e0ileasg air loidhne an asgaidh\nspectators=Luchd-amhairc:\nnbWins=Bhuannaich %s\nnbLosses=Chaill %s\nnbDraws=Geama ionnanach le %s\nexportGames=\u00c0s-phortaich geamannan\ncolor=dath\neloRange=Rainse Elo\ngiveNbSeconds=Thoir %s diog(an)\nsearchAPlayer=Lorg cluicheadair\nwhoIsOnline=C\u00f2 tha air loidhne\nallPlayers=A h-uile cluicheadair\npremoveEnabledClickAnywhereToCancel=Ro-ghluasad an comas - d\u00e8an briogadh \u00e0ite sam bith gus sgur dheth\nthisPlayerUsesChessComputerAssistance=Tha an cluicheadair seo a\u2019 cleachdadh taic coimpiutair taileisg\nopening=Fosgladh\ntakeback=Tarraing air ais\nproposeATakeback=Tairg tarraing air ais\ntakebackPropositionSent=Tairgse tarraing air ais air a cur\ntakebackPropositionDeclined=Tairgse tarraing air ais air a di\u00f9ltadh\ntakebackPropositionAccepted=Air gabhail ri tairgse tarraing air ais\ntakebackPropositionCanceled=Chaidh sgur dhe thairgse tarraing air ais\nyourOpponentProposesATakeback=Tha am farpaiseach a\u2019 tairgse tarraing air ais\nbookmarkThisGame=Cruthaich comharra-l\u00ecn airson an geama seo.\ntoggleBackground=Toglaich dath a\u2019 ch\u00f9laibh\nadvancedSearch=Lorg adhartach\ntournament=F\u00e8ill-chluich\ntournamentPoints=Puingean f\u00e8ill-chluich\nfreeOnlineChessGamePlayChessNowInACleanInterfaceNoRegistrationNoAdsNoPluginRequiredPlayChessWithComputerFriendsOrRandomOpponents=T\u00e0ileasg air loidhne an asgaidh. Cluich t\u00e0ileasg ann am pr\u00f2gram air a bheil dreach glan. Gun chl\u00e0radh, gun sanasachd, gun fheum air plugan. Cluich t\u00e0ileasg an aghaidh a\u2019 choimpiutair, charaidean no n\u00e0imhdean air thuaiream.\nteams=Sgiobaidhean\nnbMembers=%s ball\nallTeams=A h-uile sgioba\nnewTeam=Sgioba \u00f9r\nmyTeams=Na sgiobaidhean agam\nnoTeamFound=Cha deach sgioba a lorg\njoinTeam=Gabh sa sgioba\nquitTeam=F\u00e0g an sgioba\nanyoneCanJoin=Faodaidh duine sam bith a ghabhail ann\naConfirmationIsRequiredToJoin=Tha dearbhadh a dh\u00ecth gus gabhail ann\njoiningPolicy=Poileasaidh gabhail ann\nteamLeader=Ceannard an sgioba\nteamBestPlayers=Ar cluicheadairean as fhearr\nteamRecentMembers=Ar buill as \u00f9ire\naverageElo=ELO cuibheasach\nlocation=\u00c0ite\nsettings=Roghainnean\nfilterGames=Criathraich na geamannan\nreset=Ath-shuidhich\napply=Cuir an s\u00e0s\nleaderboard=Cl\u00e0r na l\u00ecge\npasteTheFenStringHere=Cuir an sreang FEN ann an-seo\npasteThePgnStringHere=Cuir an sreang PGN ann an-seo\nfromPosition=On ionad\ncontinueFromHere=Lean air adhart on a sheo\nimportGame=Ion-phortaich geama\nnbImportedGames=%s geamannan air ion-phortadh\n","old_contents":"playWithAFriend=Cluich c\u00f2mhla ri caraid\ninviteAFriendToPlayWithYou=Thoir cuireadh do charaid gus cluich c\u00f2mhla riut\nplayWithTheMachine=Cluich an aghaidh a' choimpiutair\nchallengeTheArtificialIntelligence=Thoir ionnsaigh air an inntinn fhuadain\ntoInviteSomeoneToPlayGiveThisUrl=Gus cuireadh a thoirt do chuideigin, thoir an url seo seachad\ngameOver=Cr\u00ecoch a\u2019 gheama\nwaitingForOpponent=A\u2019 feitheamh air n\u00e0mhaid\nwaiting=A\u2019 feitheamh\nyourTurn=An turas agad\naiNameLevelAiLevel=%s inbhe %s\nlevel=Inbhe\ntoggleTheChat=Toglaich a\u2019 chabadaich\ntoggleSound=Toglaich fuaim\nchat=Cabadaich\nresign=G\u00e8ill\ncheckmate=Tul-chasg\nstalemate=Clos-cluiche\nwhite=Geal\nblack=Dubh\ncreateAGame=Cruthaich geama\nnoGameAvailableRightNowCreateOne=Chan eil geama ri fhaighinn an-dr\u00e0sta, cruthaich fear \u00f9r!\nwhiteIsVictorious=Bhuannaich geal\nblackIsVictorious=Bhuannaich dubh\nplayWithTheSameOpponentAgain=Cluich an aghaidh an aon n\u00e0mhaid a-rithist\nnewOpponent=N\u00e0mhaid \u00f9r\nplayWithAnotherOpponent=Cluich an aghaidh n\u00e0mhaid eile\nyourOpponentWantsToPlayANewGameWithYou=Tha an n\u00e0mhaid agad airson geama \u00f9r a chluich c\u00f2mhla riut\njoinTheGame=Thig a-steach dhan gheama\nwhitePlays=Tha geal a\u2019 cluich\nblackPlays=Tha dubh a\u2019 cluich\ntheOtherPlayerHasLeftTheGameYouCanForceResignationOrWaitForHim=Tha an geamaiche eile air a' gheama fh\u00e0gail. Is urrainn dhut g\u00e8illeadh a chur air, no feitheamh air a shon.\nmakeYourOpponentResign=Cuir g\u00e8illeadh air an n\u00e0mhaid agad\nforceResignation=Cuir g\u00e8illeadh air an n\u00e0mhaid agad\ntalkInChat=D\u00e8an cabadaich\ntheFirstPersonToComeOnThisUrlWillPlayWithYou=Cluichidh a\u2019 chiad neach a thig a-steach air an url seo c\u00f2mhla riut.\nwhiteCreatesTheGame=Tha geal a\u2019 cruthachadh a\u2019 gheama\nblackCreatesTheGame=Tha dubh a\u2019 cruthachadh a\u2019 gheama\nwhiteJoinsTheGame=Th\u00e0inig geal a-steach dhan gheama\nblackJoinsTheGame=Th\u00e0inig dubh a-steach dhan gheama\nwhiteResigned=Gh\u00e8ill geal\nblackResigned=Gh\u00e8ill dubh\nwhiteLeftTheGame=Dh\u2019fh\u00e0g geal an geama\nblackLeftTheGame=Dh\u2019fh\u00e0g dubh an geama\nshareThisUrlToLetSpectatorsSeeTheGame=Co-roinn an url seo gus luchd-amhairc a leigeil a-steach dhan gheama\nyouAreViewingThisGameAsASpectator=Tha thu a\u2019 coimhead air a\u2019 gheama seo nad neach-amhairc\nreplayAndAnalyse=Ath-chluich is sgr\u00f9daich\nviewGameStats=Faic stadastaig a\u2019 gheama\nflipBoard=D\u00e8an flip air a\u2019 bh\u00f2rd\nthreefoldRepetition=Treas ath-nochdadh\nclaimADraw=Tagair geama ionnanach\nofferDraw=Tairg geama ionnanach\ndraw=Geama ionnanach\nnbConnectedPlayers=Tha %s geamaichean ceangailte\ntalkAboutChessAndDiscussLichessFeaturesInTheForum=Bruidhinn mu th\u00e0ileasg agus deasbad air na feartan aig lichess air a\u2019 bh\u00f2rd-bhrath\nseeTheGamesBeingPlayedInRealTime=Seall air na geamaichean a tha gan cluich ann am f\u00ecor-\u00f9ine\ngamesBeingPlayedRightNow=Geamaichean a tha gan cluich an-dr\u00e0sta fh\u00e8in\nviewAllNbGames=Seall air a h-uile %s de na geamaichean\nviewNbCheckmates=Seall na chur %s de thul-chasg\nnbBookmarks=%s Comharran-l\u00ecn\nnbPopularGames=%s geamannan m\u00f2r-ch\u00f2rdte\nnbAnalysedGames=%s geamannan sgr\u00f9daichte\nbookmarkedByNbPlayers=Comharra-leabhair le %s cluicheadairean\nviewInFullSize=Seall sa mheud iomlan\nlogOut=Log a-mach\nsignIn=Log a-steach\nsignUp=Cl\u00e0raich\npeople=Daoine\ngames=Geamannan\nforum=B\u00f2rd-brath\nchessPlayers=Geamaichean t\u00e0ileisg\nminutesPerSide=Mionaidean an taobh\nvariant=Caochladh\ntimeControl=Smachdadh-\u00f9ine\nstart=Toiseach\nusername=Far-ainm\npassword=Facal-faire\nhaveAnAccount=A bheil cunntas agad?\nallYouNeedIsAUsernameAndAPassword=Chan eil a dh\u00ecth ort ach far-ainm agus facal-faire\nlearnMoreAboutLichess=Ionnsaich barrachd mu lichess\nrank=Inbhe\ngamesPlayed=Geamannan air an cluich\ndeclineInvitation=Di\u00f9lt cuireadh\ncancel=Sguir dheth\ntimeOut=Dh\u2019fhalbh an \u00f9ine\ndrawOfferSent=Chaidh tairgse airson geama ionnanach a chur\ndrawOfferDeclined=Dhi\u00f9ltadh do thairgse airson geama ionnanach\ndrawOfferAccepted=Ghabhadh ri do thairgse airson geama ionnanach\ndrawOfferCanceled=Sguireadh de do thairgse airson geama ionnanach\nyourOpponentOffersADraw=Tha an n\u00e0mhaid agad a\u2019 tairgse geama ionnanach\naccept=Gabh ris\ndecline=Di\u00f9lt\nplayingRightNow=A\u2019 cluich an-dr\u00e0sta fh\u00e8in\nabortGame=Stad an geama\ngameAborted=Chaidh an geama a stad\nstandard=Coitcheann\nunlimited=Gun chr\u00ecoch\nmode=Modh\ncasual=Gun rangachadh\nrated=Rangaichte\nthisGameIsRated=Tha an geama seo rangaichte\nrematch=Ath-mhaids\nrematchOfferSent=Chaidh tairgse airson ath-chluich a chur\nrematchOfferAccepted=Ghabhadh ri do thairgse airson ath-chluich\nrematchOfferCanceled=Chaidh sgur dhe thairgse ath-mhaids\nrematchOfferDeclined=Tairgse ath-mhaids air a di\u00f9ltadh\ncancelRematchOffer=Sguir dhe thairgse ath-mhaids\nviewRematch=Seall air ath-mhaids\nplay=Cluich\ninbox=Bogsa a-steach\nchatRoom=Se\u00f2mar cabadaich\nspectatorRoom=Se\u00f2mar amhairc\ncomposeMessage=Sgr\u00ecobh teachdaireachd\nsentMessages=Teachdaireachdan air an cur\nincrementInSeconds=Ioncramaid ann an diogan\nfreeOnlineChess=T\u00e0ileasg air loidhne an asgaidh\nspectators=Luchd-amhairc:\nnbWins=Bhuannaich %s\nnbLosses=Chaill %s\nnbDraws=Geama ionnanach le %s\nexportGames=\u00c0s-phortaich geamannan\ncolor=dath\neloRange=Rainse Elo\ngiveNbSeconds=Thoir %s diog(an)\nsearchAPlayer=Lorg cluicheadair\nwhoIsOnline=C\u00f2 tha air loidhne\nallPlayers=A h-uile cluicheadair\npremoveEnabledClickAnywhereToCancel=Ro-ghluasad an comas - d\u00e8an briogadh \u00e0ite sam bith gus sgur dheth\nthisPlayerUsesChessComputerAssistance=Tha an cluicheadair seo a\u2019 cleachdadh taic coimpiutair taileisg\nopening=Fosgladh\ntakeback=Tarraing air ais\nproposeATakeback=Tairg tarraing air ais\ntakebackPropositionSent=Tairgse tarraing air ais air a cur\ntakebackPropositionDeclined=Tairgse tarraing air ais air a di\u00f9ltadh\ntakebackPropositionAccepted=Air gabhail ri tairgse tarraing air ais\ntakebackPropositionCanceled=Chaidh sgur dhe thairgse tarraing air ais\nyourOpponentProposesATakeback=Tha am farpaiseach a\u2019 tairgse tarraing air ais\nbookmarkThisGame=Cruthaich comharra-l\u00ecn airson an geama seo.\ntoggleBackground=Toglaich dath a\u2019 ch\u00f9laibh\nadvancedSearch=Lorg adhartach\ntournament=F\u00e8ill-chluich\ntournamentPoints=Puingean f\u00e8ill-chluich\nfreeOnlineChessGamePlayChessNowInACleanInterfaceNoRegistrationNoAdsNoPluginRequiredPlayChessWithComputerFriendsOrRandomOpponents=T\u00e0ileasg air loidhne an asgaidh. Cluich t\u00e0ileasg ann am pr\u00f2gram air a bheil dreach glan. Gun chl\u00e0radh, gun sanasachd, gun fheum air plugan. Cluich t\u00e0ileasg an aghaidh a\u2019 choimpiutair, charaidean no n\u00e0imhdean air thuaiream.\nteams=Sgiobaidhean\nnbMembers=%s ball\nallTeams=A h-uile sgioba\nnewTeam=Sgioba \u00f9r\nmyTeams=Na sgiobaidhean agam\nnoTeamFound=Cha deach sgioba a lorg\njoinTeam=Gabh sa sgioba\nquitTeam=F\u00e0g an sgioba\nanyoneCanJoin=Faodaidh duine sam bith a ghabhail ann\naConfirmationIsRequiredToJoin=Tha dearbhadh a dh\u00ecth gus gabhail ann\njoiningPolicy=Poileasaidh gabhail ann\nteamLeader=Ceannard an sgioba\nteamBestPlayers=Ar cluicheadairean as fhearr\nteamRecentMembers=Ar buill as \u00f9ire\naverageElo=ELO cuibheasach\nlocation=\u00c0ite\nsettings=Roghainnean\nfilterGames=Criathraich na geamannan\nreset=Ath-shuidhich\napply=Cuir an s\u00e0s\nleaderboard=Cl\u00e0r na l\u00ecge\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"f7cd1ad810d2d8d47bb7135cbb7819a280f817d2","subject":"Do not access database for reception page.","message":"Do not access database for reception page.\n","repos":"Bitiquinho\/Jogo-Educacional-Producao,Bitiquinho\/Jogo-Educacional-Producao,Bitiquinho\/Jogo-Educacional-Producao","old_file":"assets\/scripts\/reception_stage.gd","new_file":"assets\/scripts\/reception_stage.gd","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"mit","lang":"GDScript"} {"commit":"f88ac50c657dce69aade6ed9c8a191c3c56de46b","subject":"Fix typo children -> child_blocks","message":"Fix typo children -> child_blocks\n","repos":"mvr\/abyme","old_file":"Block.gd","new_file":"Block.gd","new_contents":"extends Node2D\n\n################################################################################\n### Vars\n\n# Gameplay\nonready var tilemap = self.get_node(\"TileMap\")\nenum TILES {TILE_EMPTY, TILE_WALL}\n\nexport(NodePath) var parent_block_path = null\nexport(Vector2) var position_on_parent = Vector2(0, 0)\nexport(bool) var is_player = false\n\nvar parent_block = null\nvar child_blocks = []\n\n# TODO: calculate?\nvar size = 5\n\n# Movement animation\nvar is_moving = false\nvar move_vector = Vector2(0.0, 0.0)\nvar previous_parent = null\nvar previous_position_on_parent = self.position_on_parent\nexport var move_duration = 0.5\nvar current_move_time = 0\n\n# Drawing\nonready var viewport = self.get_node(\"SelfViewport\")\nonready var self_rect = self.get_self_rect()\n\n################################################################################\n### Setup\n\nfunc _ready():\n\t# Add to block group\n\tself.add_to_group(\"blocks\")\n\n\t# Setup viewport\n\tviewport.set_world_2d(self.get_world_2d())\n\tviewport.set_rect(self.self_rect)\n\t#viewport.set_size_override(true, self.self_rect.size)\n\tvar transform = Matrix32(0, -self.self_rect.pos)\n\tviewport.set_canvas_transform(transform)\n\n\tself.set_fixed_process(true)\n\tself.set_process_input(true) # TODO: do input once in Level\n\n################################################################################\n### Parents and Siblings\n\nfunc find_children():\n\tvar all_blocks = get_tree().get_nodes_in_group(\"blocks\")\n\tvar child_blocks = []\n\tfor b in all_blocks:\n\t\tif b.parent_block == self:\n\t\t\tchild_blocks.append(b)\n\treturn child_blocks\n\nfunc set_child_blocks():\n\tself.child_blocks = self.find_children()\n\nfunc find_parent_block():\n\tself.parent_block = self.get_node(self.parent_block_path)\n\tself.previous_parent = self.parent_block\n\n################################################################################\n### Block position\n# Represents a square in the world\n\nclass BlockPosition:\n\tvar block = null\n\tvar position = Vector2(0, 0)\n\n\tfunc _init(b, p):\n\t\tself.block = b\n\t\tself.position = p\n\n\tfunc get_tile_id():\n\t\treturn self.block.tilemap.get_cell(self.position.x, self.position.y)\n\n\tfunc adjacent(direction):\n\t\treturn adjacent_recurse(direction, self.block)\n\n\tfunc direction_to_vect(direction):\n\t\tif direction == \"left\":\n\t\t\treturn Vector2(-1, 0)\n\t\telif direction == \"right\":\n\t\t\treturn Vector2(1, 0)\n\t\telif direction == \"up\":\n\t\t\treturn Vector2(0, -1)\n\t\telif direction == \"down\":\n\t\t\treturn Vector2(0, 1)\n\n\tfunc adjacent_recurse(direction, original):\n\t\tvar newpos = self.position + self.direction_to_vect(direction)\n\n\t\tif newpos.x < 0:\n\t\t\tnewpos.x = self.block.size - 1\n\t\telif newpos.x >= self.block.size:\n\t\t\tnewpos.x = 0\n\t\telif newpos.y < 0:\n\t\t\tnewpos.y = self.block.size - 1\n\t\telif newpos.y >= self.block.size:\n\t\t\tnewpos.y = 0\n\t\telse:\n\t\t\treturn get_script().new(self.block, newpos)\n\n\t\t# We left the block\n\n\t\tif self.block.parent_block == original:\n\t\t\treturn null\n\n\t\tvar newsquare = self.block.own_position().adjacent_recurse(direction, original)\n\n\t\tif newsquare == null:\n\t\t\treturn null\n\n\t\tvar newblock = newsquare.block_at()\n\n\t\tif newblock == null:\n\t\t\treturn null\n\n\t\treturn get_script().new(newblock, newpos)\n\n\tfunc is_underlying_walkable():\n\t\treturn self.get_tile_id() == TILE_EMPTY\n\n\tfunc block_at():\n\t\tfor b in self.block.child_blocks:\n\t\t\tif b.position_on_parent == self.position:\n\t\t\t\treturn b\n\t\treturn null\n\n\tfunc is_empty():\n\t\tif not self.is_underlying_walkable():\n\t\t\treturn false\n\n\t\tif not self.block_at() == null:\n\t\t\treturn false\n\n\t\treturn true\n\nfunc own_position():\n\treturn BlockPosition.new(parent_block, position_on_parent)\n\nfunc adjacent_blocks():\n\treturn adjacent_blocks_with_displacement().keys()\n\nfunc adjacent_blocks_with_displacement():\n\tvar adjacents = {}\n\tvar a = null\n\n\ta = self.own_position().adjacent(\"left\")\n\tif not a == null:\n\t\tvar b = a.block_at()\n\t\tif not b == null:\n\t\t\tadjacents[b] = Vector2(-1, 0)\n\n\ta = self.own_position().adjacent(\"right\")\n\tif not a == null:\n\t\tvar b = a.block_at()\n\t\tif not b == null:\n\t\t\tadjacents[b] = Vector2(1, 0)\n\n\ta = self.own_position().adjacent(\"up\")\n\tif not a == null:\n\t\tvar b = a.block_at()\n\t\tif not b == null:\n\t\t\tadjacents[b] = Vector2(0, -1)\n\n\ta = self.own_position().adjacent(\"down\")\n\tif not a == null:\n\t\tvar b = a.block_at()\n\t\tif not b == null:\n\t\t\tadjacents[b] = Vector2(0, 1)\n\n\treturn adjacents\n\n################################################################################\n### Drawing\n\nfunc get_self_rect():\n\tvar pos = tilemap.get_global_pos()\n\t# TODO: scale?\n\tvar s = self.size * tilemap.get_cell_size()\n\treturn Rect2(pos, s)\n\nfunc draw_self_on(block, position):\n\tvar texture = self.viewport.get_render_target_texture()\n\n\tvar to_parent_transform = block.get_global_transform() * self.get_global_transform().affine_inverse()\n\n\tvar tile_size = self.tilemap.get_cell_size() # TODO: self?\n\tvar drawrect = Rect2(position, tile_size)\n\n\tself.draw_set_transform_matrix(to_parent_transform)\n\tself.draw_texture_rect(texture, drawrect, false)\n\nfunc _draw(): # TODO: think about clearing the render target every frame\n\tif self.is_moving:\n\t\tvar t = easing_function(self.current_move_time \/ self.move_duration)\n\n\t\tvar newpos = self.parent_block.tilemap.map_to_world(self.position_on_parent)\n\t\tvar oldpos = self.parent_block.tilemap.map_to_world(self.position_on_parent - self.move_vector)\n\n\t\tvar pos = interpolate(t, oldpos, newpos)\n\t\tdraw_self_on(self.parent_block, pos)\n\n\t\tif not self.previous_parent == self.parent_block:\n\t\t\tvar newpos = self.previous_parent.tilemap.map_to_world(self.previous_position_on_parent + self.move_vector)\n\t\t\tvar oldpos = self.previous_parent.tilemap.map_to_world(self.previous_position_on_parent)\n\n\t\t\tvar pos = interpolate(t, oldpos, newpos)\n\t\t\tdraw_self_on(self.previous_parent, pos)\n\telse:\n\t\tvar worldcoords = self.parent_block.tilemap.map_to_world(self.position_on_parent)\n\t\tdraw_self_on(self.parent_block, worldcoords)\n\nfunc interpolate(t, x1, x2):\n\treturn (1-t)*x1 + t*x2\n\nfunc easing_function(t):\n\tvar u0 = 0\n\tvar u1 = 0.2\n\tvar u2 = 0.95\n\tvar u3 = 1\n\treturn u0 * (1-t*t*t) + 3*u1*(1-t*t)*t + 3*u2*(1-t)*t*t + u3*t*t*t*t\n\nfunc _fixed_process(delta):\n\tif self.is_moving:\n\t\tself.current_move_time += delta\n\t\tif self.current_move_time > self.move_duration:\n\t\t\tself.is_moving = false\n\t\t\tself.current_move_time = 0\n\n\t\tself.update()\n\n################################################################################\n### Movement\n\nfunc try_move(direction):\n\tif self.is_moving:\n\t\treturn\n\n\tvar a = self.own_position().adjacent(direction)\n\tif a == null:\n\t\treturn\n\n\tif a.is_empty():\n\t\tdo_move(direction, a)\n\nfunc do_move(direction, new_square):\n\tself.is_moving = true\n\n\t# TODO: silly\n\tself.move_vector = self.own_position().direction_to_vect(direction)\n\n\tself.previous_parent = self.parent_block\n\tself.previous_position_on_parent = self.position_on_parent\n\n\tself.parent_block = new_square.block\n\tself.position_on_parent = new_square.position\n\n\tif not self.parent_block == self.previous_parent:\n\t\tself.previous_parent.child_blocks.erase(self)\n\t\tself.parent_block.child_blocks.append(self)\n\nfunc _input(event):\n\tif not self.is_player:\n\t\treturn\n\n\tif event.is_action_pressed(\"move_left\"):\n\t\tself.try_move(\"left\")\n\n\tif event.is_action_pressed(\"move_right\"):\n\t\tself.try_move(\"right\")\n\n\tif event.is_action_pressed(\"move_up\"):\n\t\tself.try_move(\"up\")\n\n\tif event.is_action_pressed(\"move_down\"):\n\t\tself.try_move(\"down\")\n","old_contents":"extends Node2D\n\n################################################################################\n### Vars\n\n# Gameplay\nonready var tilemap = self.get_node(\"TileMap\")\nenum TILES {TILE_EMPTY, TILE_WALL}\n\nexport(NodePath) var parent_block_path = null\nexport(Vector2) var position_on_parent = Vector2(0, 0)\nexport(bool) var is_player = false\n\nvar parent_block = null\nvar child_blocks = []\n\n# TODO: calculate?\nvar size = 5\n\n# Movement animation\nvar is_moving = false\nvar move_vector = Vector2(0.0, 0.0)\nvar previous_parent = null\nvar previous_position_on_parent = self.position_on_parent\nexport var move_duration = 0.5\nvar current_move_time = 0\n\n# Drawing\nonready var viewport = self.get_node(\"SelfViewport\")\nonready var self_rect = self.get_self_rect()\n\n################################################################################\n### Setup\n\nfunc _ready():\n\t# Add to block group\n\tself.add_to_group(\"blocks\")\n\n\t# Setup viewport\n\tviewport.set_world_2d(self.get_world_2d())\n\tviewport.set_rect(self.self_rect)\n\t#viewport.set_size_override(true, self.self_rect.size)\n\tvar transform = Matrix32(0, -self.self_rect.pos)\n\tviewport.set_canvas_transform(transform)\n\n\tself.set_fixed_process(true)\n\tself.set_process_input(true) # TODO: do input once in Level\n\n################################################################################\n### Parents and Siblings\n\nfunc find_children():\n\tvar all_blocks = get_tree().get_nodes_in_group(\"blocks\")\n\tvar child_blocks = []\n\tfor b in all_blocks:\n\t\tif b.parent_block == self:\n\t\t\tchild_blocks.append(b)\n\treturn child_blocks\n\nfunc set_child_blocks():\n\tself.child_blocks = self.find_children()\n\nfunc find_parent_block():\n\tself.parent_block = self.get_node(self.parent_block_path)\n\tself.previous_parent = self.parent_block\n\n################################################################################\n### Block position\n# Represents a square in the world\n\nclass BlockPosition:\n\tvar block = null\n\tvar position = Vector2(0, 0)\n\n\tfunc _init(b, p):\n\t\tself.block = b\n\t\tself.position = p\n\n\tfunc get_tile_id():\n\t\treturn self.block.tilemap.get_cell(self.position.x, self.position.y)\n\n\tfunc adjacent(direction):\n\t\treturn adjacent_recurse(direction, self.block)\n\n\tfunc direction_to_vect(direction):\n\t\tif direction == \"left\":\n\t\t\treturn Vector2(-1, 0)\n\t\telif direction == \"right\":\n\t\t\treturn Vector2(1, 0)\n\t\telif direction == \"up\":\n\t\t\treturn Vector2(0, -1)\n\t\telif direction == \"down\":\n\t\t\treturn Vector2(0, 1)\n\n\tfunc adjacent_recurse(direction, original):\n\t\tvar newpos = self.position + self.direction_to_vect(direction)\n\n\t\tif newpos.x < 0:\n\t\t\tnewpos.x = self.block.size - 1\n\t\telif newpos.x >= self.block.size:\n\t\t\tnewpos.x = 0\n\t\telif newpos.y < 0:\n\t\t\tnewpos.y = self.block.size - 1\n\t\telif newpos.y >= self.block.size:\n\t\t\tnewpos.y = 0\n\t\telse:\n\t\t\treturn get_script().new(self.block, newpos)\n\n\t\t# We left the block\n\n\t\tif self.block.parent_block == original:\n\t\t\treturn null\n\n\t\tvar newsquare = self.block.own_position().adjacent_recurse(direction, original)\n\n\t\tif newsquare == null:\n\t\t\treturn null\n\n\t\tvar newblock = newsquare.block_at()\n\n\t\tif newblock == null:\n\t\t\treturn null\n\n\t\treturn get_script().new(newblock, newpos)\n\n\tfunc is_underlying_walkable():\n\t\treturn self.get_tile_id() == TILE_EMPTY\n\n\tfunc block_at():\n\t\tfor b in self.block.child_blocks:\n\t\t\tif b.position_on_parent == self.position:\n\t\t\t\treturn b\n\t\treturn null\n\n\tfunc is_empty():\n\t\tif not self.is_underlying_walkable():\n\t\t\treturn false\n\n\t\tif not self.block_at() == null:\n\t\t\treturn false\n\n\t\treturn true\n\nfunc own_position():\n\treturn BlockPosition.new(parent_block, position_on_parent)\n\nfunc adjacent_blocks():\n\treturn adjacent_blocks_with_displacement().keys()\n\nfunc adjacent_blocks_with_displacement():\n\tvar adjacents = {}\n\tvar a = null\n\n\ta = self.own_position().adjacent(\"left\")\n\tif not a == null:\n\t\tvar b = a.block_at()\n\t\tif not b == null:\n\t\t\tadjacents[b] = Vector2(-1, 0)\n\n\ta = self.own_position().adjacent(\"right\")\n\tif not a == null:\n\t\tvar b = a.block_at()\n\t\tif not b == null:\n\t\t\tadjacents[b] = Vector2(1, 0)\n\n\ta = self.own_position().adjacent(\"up\")\n\tif not a == null:\n\t\tvar b = a.block_at()\n\t\tif not b == null:\n\t\t\tadjacents[b] = Vector2(0, -1)\n\n\ta = self.own_position().adjacent(\"down\")\n\tif not a == null:\n\t\tvar b = a.block_at()\n\t\tif not b == null:\n\t\t\tadjacents[b] = Vector2(0, 1)\n\n\treturn adjacents\n\n################################################################################\n### Drawing\n\nfunc get_self_rect():\n\tvar pos = tilemap.get_global_pos()\n\t# TODO: scale?\n\tvar s = self.size * tilemap.get_cell_size()\n\treturn Rect2(pos, s)\n\nfunc draw_self_on(block, position):\n\tvar texture = self.viewport.get_render_target_texture()\n\n\tvar to_parent_transform = block.get_global_transform() * self.get_global_transform().affine_inverse()\n\n\tvar tile_size = self.tilemap.get_cell_size() # TODO: self?\n\tvar drawrect = Rect2(position, tile_size)\n\n\tself.draw_set_transform_matrix(to_parent_transform)\n\tself.draw_texture_rect(texture, drawrect, false)\n\nfunc _draw():\n\tif self.is_moving:\n\t\tvar t = easing_function(self.current_move_time \/ self.move_duration)\n\n\t\tvar newpos = self.parent_block.tilemap.map_to_world(self.position_on_parent)\n\t\tvar oldpos = self.parent_block.tilemap.map_to_world(self.position_on_parent - self.move_vector)\n\n\t\tvar pos = interpolate(t, oldpos, newpos)\n\t\tdraw_self_on(self.parent_block, pos)\n\n\t\tif not self.previous_parent == self.parent_block:\n\t\t\tvar newpos = self.previous_parent.tilemap.map_to_world(self.previous_position_on_parent + self.move_vector)\n\t\t\tvar oldpos = self.previous_parent.tilemap.map_to_world(self.previous_position_on_parent)\n\n\t\t\tvar pos = interpolate(t, oldpos, newpos)\n\t\t\tdraw_self_on(self.previous_parent, pos)\n\telse:\n\t\tvar worldcoords = self.parent_block.tilemap.map_to_world(self.position_on_parent)\n\t\tdraw_self_on(self.parent_block, worldcoords)\n\nfunc interpolate(t, x1, x2):\n\treturn (1-t)*x1 + t*x2\n\nfunc easing_function(t):\n\tvar u0 = 0\n\tvar u1 = 0.2\n\tvar u2 = 0.95\n\tvar u3 = 1\n\treturn u0 * (1-t*t*t) + 3*u1*(1-t*t)*t + 3*u2*(1-t)*t*t + u3*t*t*t*t\n\nfunc _fixed_process(delta):\n\tif self.is_moving:\n\t\tself.current_move_time += delta\n\t\tif self.current_move_time > self.move_duration:\n\t\t\tself.is_moving = false\n\t\t\tself.current_move_time = 0\n\n\t\tself.update()\n\n################################################################################\n### Movement\n\nfunc try_move(direction):\n\tif self.is_moving:\n\t\treturn\n\n\tvar a = self.own_position().adjacent(direction)\n\tif a == null:\n\t\treturn\n\n\tif a.is_empty():\n\t\tdo_move(direction, a)\n\nfunc do_move(direction, new_square):\n\tself.is_moving = true\n\n\t# TODO: silly\n\tself.move_vector = self.own_position().direction_to_vect(direction)\n\n\tself.previous_parent = self.parent_block\n\tself.previous_position_on_parent = self.position_on_parent\n\n\tself.parent_block = new_square.block\n\tself.position_on_parent = new_square.position\n\n\tif not self.parent_block == self.previous_parent:\n\t\tself.previous_parent.child_blocks.erase(self)\n\t\tself.parent_block.children.append(self)\n\nfunc _input(event):\n\tif not self.is_player:\n\t\treturn\n\n\tif event.is_action_pressed(\"move_left\"):\n\t\tself.try_move(\"left\")\n\n\tif event.is_action_pressed(\"move_right\"):\n\t\tself.try_move(\"right\")\n\n\tif event.is_action_pressed(\"move_up\"):\n\t\tself.try_move(\"up\")\n\n\tif event.is_action_pressed(\"move_down\"):\n\t\tself.try_move(\"down\")\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"GDScript"} {"commit":"6ce9d7f043df5ecf55c7fb2d67bfe581e1080909","subject":"Modified scoreboard to replace scores with same tag","message":"Modified scoreboard to replace scores with same tag\n","repos":"P1X-in\/rat-is-fat","old_file":"scripts\/hud\/scoreboard.gd","new_file":"scripts\/hud\/scoreboard.gd","new_contents":"\nconst SCOREBOARD_FILE_PATH = 'user:\/\/scoreboard.rif'\nconst TOP_SIZE = 5\n\nvar bag\nvar scoreboard_node\nvar game_over_labels\nvar win_label\nvar win_label_low_score\nvar lose_label\nvar scores_node\n\nvar tag_query_node\nvar tag_query_score_node\nvar tag_query_focus_node\n\nvar temp_tag_query\nvar temp_score\nvar temp_player_0_score\nvar temp_player_1_score\n\nvar scores = []\n\nvar score_nodes = []\n\nfunc _init_bag(bag):\n self.bag = bag\n self.scoreboard_node = self.bag.root.get_node(\"scoreboard\")\n self.game_over_labels = self.scoreboard_node.get_node(\"center\/game_over\")\n self.win_label = self.game_over_labels.get_node(\"win\")\n self.win_label_low_score = self.win_label.get_node(\"_low_score\")\n self.lose_label = self.game_over_labels.get_node(\"lose\")\n self.scores_node = self.scoreboard_node.get_node(\"center\/scores\")\n\n for i in range(self.TOP_SIZE):\n self.score_nodes.append(self.scores_node.get_node(\"score\" + str(i)))\n\n self.tag_query_node = self.scoreboard_node.get_node(\"center\/tag_query\")\n self.tag_query_score_node = self.tag_query_node.get_node(\"score\")\n self.tag_query_focus_node = self.tag_query_node.get_node(\"keyboard\/A\")\n\n self._initialize()\n\nfunc _initialize():\n self.load_scores_from_file()\n\nfunc show(win, timeout):\n self._take_snapshot()\n\n self.scoreboard_node.show()\n self.game_over_labels.show()\n if win:\n if self.is_eligible_for_board(self.temp_score):\n self.show_success_with_score()\n else:\n self.show_success_without_score()\n else:\n self.show_game_over()\n\n\nfunc hide():\n self.scoreboard_node.hide()\n self.game_over_labels.hide()\n self.scores_node.hide()\n self.tag_query_node.hide()\n\nfunc show_success_with_score():\n self.win_label.show()\n self.win_label_low_score.hide()\n self.lose_label.hide()\n self.show_tag_query()\n\nfunc show_success_without_score():\n self.win_label.show()\n self.win_label_low_score.show()\n self.lose_label.hide()\n self.show_scores_list()\n\nfunc show_game_over():\n self.win_label.hide()\n self.lose_label.show()\n self.show_scores_list()\n\nfunc show_tag_query():\n self.bag.game_state.tag_query_in_progress = true\n self.scores_node.hide()\n self.tag_query_node.show()\n self._fill_tag_query_score()\n self.tag_query_focus_node.grab_focus()\n\nfunc show_scores_list():\n self.scores_node.show()\n self.tag_query_node.hide()\n self._fill_scoreboard()\n\nfunc is_eligible_for_board(score):\n if self.scores.size() < self.TOP_SIZE:\n return true\n\n return score > self.scores[self.TOP_SIZE - 1]['score']\n\nfunc add_score(tag, player_0_score, player_1_score):\n var summary_score = player_0_score\n\n if player_1_score != null:\n summary_score += player_1_score\n\n self.scores.append({\n 'score' : summary_score,\n 'players' : [player_0_score, player_1_score],\n 'tag' : tag\n })\n\n self.scores.sort_custom(self, \"_custom_scoreboard_sort\")\n\n if self.scores.size() > self.TOP_SIZE:\n self.scores.pop_back()\n\n self.save_scores_to_file()\n\nfunc replace_score_if_better(tag, player_0_score, player_1_score):\n var summary_score = player_0_score\n\n if player_1_score != null:\n summary_score += player_1_score\n\n var score_index = self._find_score_by_tag(tag)\n\n if score_index == null:\n return\n\n if summary_score > self.scores[score_index]['score']:\n self.scores[score_index] = {\n 'score' : summary_score,\n 'players' : [player_0_score, player_1_score],\n 'tag' : tag\n }\n\n self.scores.sort_custom(self, \"_custom_scoreboard_sort\")\n self.save_scores_to_file()\n\nfunc add_or_replace_score(tag, player_0_score, player_1_score):\n if self._score_exists(tag):\n self.replace_score_if_better(tag, player_0_score, player_1_score)\n else:\n self.add_score(tag, player_0_score, player_1_score)\n\nfunc load_scores_from_file():\n self.scores = self.bag.file_handler.read(self.SCOREBOARD_FILE_PATH)\n\nfunc save_scores_to_file():\n self.bag.file_handler.write(self.SCOREBOARD_FILE_PATH, self.scores)\n\nfunc add_tag_query_character(character):\n if not self.bag.game_state.tag_query_in_progress:\n return\n\n var current_character\n for i in range(5):\n current_character = self.temp_tag_query[i]\n if current_character == '_':\n self.temp_tag_query[i] = character[0]\n self._fill_tag_query_score()\n\n if i == 4:\n self.add_or_replace_score(self.temp_tag_query, self.temp_player_0_score, self.temp_player_1_score)\n self.bag.game_state.tag_query_in_progress = false\n self.show_scores_list()\n\n return\n\n\nfunc _custom_scoreboard_sort(a, b):\n return a['score'] > b['score']\n\nfunc _fill_scoreboard():\n var scores_size = self.scores.size()\n var score\n\n for i in range(self.TOP_SIZE):\n if i >= scores_size:\n self.score_nodes[i].hide()\n else:\n score = self.scores[i]\n self.score_nodes[i].show()\n self.score_nodes[i].fill(score['tag'], score['players'][0], score['players'][1])\n\nfunc _take_snapshot():\n self.temp_score = self.bag.players.get_summary_score()\n self.temp_player_0_score = self.bag.players.get_player_score(0)\n self.temp_player_1_score = self.bag.players.get_player_score(1)\n self.temp_tag_query = \"_____\"\n\nfunc _fill_tag_query_score():\n self.tag_query_score_node.fill(self.temp_tag_query, self.temp_player_0_score, self.temp_player_1_score)\n\nfunc _score_exists(tag):\n var score = self._find_score_by_tag(tag)\n\n if score == null:\n return false\n else:\n return true\n\nfunc _find_score_by_tag(tag):\n var scores_size = self.scores.size()\n for i in range(self.TOP_SIZE):\n if i < scores_size and self.scores[i]['tag'] == tag:\n return i\n\n return null","old_contents":"\nconst SCOREBOARD_FILE_PATH = 'user:\/\/scoreboard.rif'\nconst TOP_SIZE = 5\n\nvar bag\nvar scoreboard_node\nvar game_over_labels\nvar win_label\nvar win_label_low_score\nvar lose_label\nvar scores_node\n\nvar tag_query_node\nvar tag_query_score_node\nvar tag_query_focus_node\n\nvar temp_tag_query\nvar temp_score\nvar temp_player_0_score\nvar temp_player_1_score\n\nvar scores = []\n\nvar score_nodes = []\n\nfunc _init_bag(bag):\n self.bag = bag\n self.scoreboard_node = self.bag.root.get_node(\"scoreboard\")\n self.game_over_labels = self.scoreboard_node.get_node(\"center\/game_over\")\n self.win_label = self.game_over_labels.get_node(\"win\")\n self.win_label_low_score = self.win_label.get_node(\"_low_score\")\n self.lose_label = self.game_over_labels.get_node(\"lose\")\n self.scores_node = self.scoreboard_node.get_node(\"center\/scores\")\n\n for i in range(self.TOP_SIZE):\n self.score_nodes.append(self.scores_node.get_node(\"score\" + str(i)))\n\n self.tag_query_node = self.scoreboard_node.get_node(\"center\/tag_query\")\n self.tag_query_score_node = self.tag_query_node.get_node(\"score\")\n self.tag_query_focus_node = self.tag_query_node.get_node(\"keyboard\/A\")\n\n self._initialize()\n\nfunc _initialize():\n self.load_scores_from_file()\n\nfunc show(win, timeout):\n self._take_snapshot()\n\n self.scoreboard_node.show()\n self.game_over_labels.show()\n if win:\n if self.is_eligible_for_board(self.temp_score):\n self.show_success_with_score()\n else:\n self.show_success_without_score()\n else:\n self.show_game_over()\n\n\nfunc hide():\n self.scoreboard_node.hide()\n self.game_over_labels.hide()\n self.scores_node.hide()\n self.tag_query_node.hide()\n\nfunc show_success_with_score():\n self.win_label.show()\n self.win_label_low_score.hide()\n self.lose_label.hide()\n self.show_tag_query()\n\nfunc show_success_without_score():\n self.win_label.show()\n self.win_label_low_score.show()\n self.lose_label.hide()\n self.show_scores_list()\n\nfunc show_game_over():\n self.win_label.hide()\n self.lose_label.show()\n self.show_scores_list()\n\nfunc show_tag_query():\n self.bag.game_state.tag_query_in_progress = true\n self.scores_node.hide()\n self.tag_query_node.show()\n self._fill_tag_query_score()\n self.tag_query_focus_node.grab_focus()\n\nfunc show_scores_list():\n self.scores_node.show()\n self.tag_query_node.hide()\n self._fill_scoreboard()\n\nfunc is_eligible_for_board(score):\n if self.scores.size() < self.TOP_SIZE:\n return true\n\n return score > self.scores[self.TOP_SIZE - 1]['score']\n\nfunc add_score(tag, player_0_score, player_1_score):\n var summary_score = player_0_score\n\n if player_1_score != null:\n summary_score += player_1_score\n\n self.scores.append({\n 'score' : summary_score,\n 'players' : [player_0_score, player_1_score],\n 'tag' : tag\n })\n\n self.scores.sort_custom(self, \"_custom_scoreboard_sort\")\n\n if self.scores.size() > self.TOP_SIZE:\n self.scores.pop_back()\n\n self.save_scores_to_file()\n\nfunc load_scores_from_file():\n self.scores = self.bag.file_handler.read(self.SCOREBOARD_FILE_PATH)\n\nfunc save_scores_to_file():\n self.bag.file_handler.write(self.SCOREBOARD_FILE_PATH, self.scores)\n\nfunc add_tag_query_character(character):\n if not self.bag.game_state.tag_query_in_progress:\n return\n\n var current_character\n for i in range(5):\n current_character = self.temp_tag_query[i]\n if current_character == '_':\n self.temp_tag_query[i] = character[0]\n self._fill_tag_query_score()\n\n if i == 4:\n self.add_score(self.temp_tag_query, self.temp_player_0_score, self.temp_player_1_score)\n self.bag.game_state.tag_query_in_progress = false\n self.show_scores_list()\n\n return\n\n\nfunc _custom_scoreboard_sort(a, b):\n return a['score'] > b['score']\n\nfunc _fill_scoreboard():\n var scores_size = self.scores.size()\n var score\n\n for i in range(self.TOP_SIZE):\n if i >= scores_size:\n self.score_nodes[i].hide()\n else:\n score = self.scores[i]\n self.score_nodes[i].show()\n self.score_nodes[i].fill(score['tag'], score['players'][0], score['players'][1])\n\nfunc _take_snapshot():\n self.temp_score = self.bag.players.get_summary_score()\n self.temp_player_0_score = self.bag.players.get_player_score(0)\n self.temp_player_1_score = self.bag.players.get_player_score(1)\n self.temp_tag_query = \"_____\"\n\nfunc _fill_tag_query_score():\n self.tag_query_score_node.fill(self.temp_tag_query, self.temp_player_0_score, self.temp_player_1_score)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"86b46c0b7ec624ba6584974bf021398b4d4db993","subject":"Joystick demo script cleanup","message":"Joystick demo script cleanup\n\nRemoves a leftover variable and uses constants instead of magic numbers.\n","repos":"BastiaanOlij\/godot,pkowal1982\/godot,Valentactive\/godot,sanikoyes\/godot,josempans\/godot,tomreyn\/godot,NateWardawg\/godot,tomreyn\/godot,Zylann\/godot,RandomShaper\/godot,josempans\/godot,azurvii\/godot,godotengine\/godot,groud\/godot,rollenrolm\/godot,JoshuaGrams\/godot,ZuBsPaCe\/godot,BastiaanOlij\/godot,opmana\/godot,azurvii\/godot,est31\/godot,vkbsb\/godot,mcanders\/godot,TheHX\/godot,Valentactive\/godot,pkowal1982\/godot,MarianoGnu\/godot,vkbsb\/godot,MrMaidx\/godot,MrMaidx\/godot,Hodes\/godot,gau-veldt\/godot,Faless\/godot,vnen\/godot,Shockblast\/godot,sanikoyes\/godot,iap-mutant\/godot,ex\/godot,Faless\/godot,sanikoyes\/godot,honix\/godot,exabon\/godot,firefly2442\/godot,NateWardawg\/godot,guilhermefelipecgs\/godot,vnen\/godot,RebelliousX\/Go_Dot,rollenrolm\/godot,NateWardawg\/godot,NateWardawg\/godot,pkowal1982\/godot,Hodes\/godot,azurvii\/godot,ZuBsPaCe\/godot,Zylann\/godot,Faless\/godot,ageazrael\/godot,est31\/godot,Shockblast\/godot,groud\/godot,rollenrolm\/godot,honix\/godot,Max-Might\/godot,BastiaanOlij\/godot,akien-mga\/godot,okamstudio\/godot,okamstudio\/godot,pixelpicosean\/my-godot-2.1,quabug\/godot,morrow1nd\/godot,MrMaidx\/godot,Marqin\/godot,tomreyn\/godot,zicklag\/godot,sanikoyes\/godot,firefly2442\/godot,firefly2442\/godot,jejung\/godot,groud\/godot,BastiaanOlij\/godot,FateAce\/godot,guilhermefelipecgs\/godot,est31\/godot,ex\/godot,quabug\/godot,guilhermefelipecgs\/godot,Valentactive\/godot,RebelliousX\/Go_Dot,ZuBsPaCe\/godot,vkbsb\/godot,Faless\/godot,gau-veldt\/godot,groud\/godot,Marqin\/godot,vkbsb\/godot,gau-veldt\/godot,azurvii\/godot,ficoos\/godot,mcanders\/godot,groud\/godot,FateAce\/godot,pkowal1982\/godot,Shockblast\/godot,MrMaidx\/godot,zicklag\/godot,guilhermefelipecgs\/godot,n-pigeon\/godot,godotengine\/godot,pixelpicosean\/my-godot-2.1,MarianoGnu\/godot,agusbena\/godot,ficoos\/godot,godotengine\/godot,Zylann\/godot,NateWardawg\/godot,mcanders\/godot,huziyizero\/godot,MarianoGnu\/godot,pixelpicosean\/my-godot-2.1,akien-mga\/godot,Marqin\/godot,godotengine\/godot,DmitriySalnikov\/godot,agusbena\/godot,vkbsb\/godot,n-pigeon\/godot,JoshuaGrams\/godot,morrow1nd\/godot,FateAce\/godot,quabug\/godot,sanikoyes\/godot,akien-mga\/godot,BastiaanOlij\/godot,est31\/godot,ficoos\/godot,quabug\/godot,godotengine\/godot,morrow1nd\/godot,huziyizero\/godot,Brickcaster\/godot,agusbena\/godot,ex\/godot,opmana\/godot,est31\/godot,vnen\/godot,azurvii\/godot,ageazrael\/godot,opmana\/godot,ageazrael\/godot,MarianoGnu\/godot,exabon\/godot,Hodes\/godot,quabug\/godot,azurvii\/godot,RandomShaper\/godot,MarianoGnu\/godot,iap-mutant\/godot,morrow1nd\/godot,honix\/godot,DmitriySalnikov\/godot,Valentactive\/godot,vnen\/godot,ex\/godot,RebelliousX\/Go_Dot,JoshuaGrams\/godot,vnen\/godot,okamstudio\/godot,Shockblast\/godot,rollenrolm\/godot,Brickcaster\/godot,pixelpicosean\/my-godot-2.1,exabon\/godot,Valentactive\/godot,NateWardawg\/godot,iap-mutant\/godot,groud\/godot,ageazrael\/godot,Brickcaster\/godot,mcanders\/godot,Paulloz\/godot,Paulloz\/godot,gau-veldt\/godot,quabug\/godot,godotengine\/godot,FateAce\/godot,FateAce\/godot,ZuBsPaCe\/godot,ZuBsPaCe\/godot,ageazrael\/godot,Marqin\/godot,akien-mga\/godot,ex\/godot,okamstudio\/godot,huziyizero\/godot,DmitriySalnikov\/godot,MarianoGnu\/godot,iap-mutant\/godot,huziyizero\/godot,okamstudio\/godot,jejung\/godot,quabug\/godot,honix\/godot,Max-Might\/godot,agusbena\/godot,agusbena\/godot,n-pigeon\/godot,tomreyn\/godot,Brickcaster\/godot,BastiaanOlij\/godot,buckle2000\/godot,jejung\/godot,akien-mga\/godot,RebelliousX\/Go_Dot,exabon\/godot,vnen\/godot,guilhermefelipecgs\/godot,n-pigeon\/godot,ageazrael\/godot,buckle2000\/godot,josempans\/godot,pkowal1982\/godot,zicklag\/godot,guilhermefelipecgs\/godot,ex\/godot,ex\/godot,Zylann\/godot,iap-mutant\/godot,zicklag\/godot,agusbena\/godot,ficoos\/godot,RandomShaper\/godot,sanikoyes\/godot,josempans\/godot,sanikoyes\/godot,DmitriySalnikov\/godot,ZuBsPaCe\/godot,quabug\/godot,TheHX\/godot,n-pigeon\/godot,akien-mga\/godot,ZuBsPaCe\/godot,honix\/godot,mcanders\/godot,MarianoGnu\/godot,RandomShaper\/godot,Paulloz\/godot,Max-Might\/godot,Brickcaster\/godot,RandomShaper\/godot,Zylann\/godot,vkbsb\/godot,huziyizero\/godot,DmitriySalnikov\/godot,Paulloz\/godot,okamstudio\/godot,MrMaidx\/godot,okamstudio\/godot,zicklag\/godot,buckle2000\/godot,NateWardawg\/godot,pkowal1982\/godot,TheHX\/godot,okamstudio\/godot,Valentactive\/godot,DmitriySalnikov\/godot,buckle2000\/godot,RebelliousX\/Go_Dot,Shockblast\/godot,iap-mutant\/godot,RandomShaper\/godot,est31\/godot,Hodes\/godot,JoshuaGrams\/godot,zicklag\/godot,firefly2442\/godot,okamstudio\/godot,firefly2442\/godot,agusbena\/godot,agusbena\/godot,Faless\/godot,guilhermefelipecgs\/godot,josempans\/godot,iap-mutant\/godot,TheHX\/godot,iap-mutant\/godot,FateAce\/godot,MarianoGnu\/godot,ficoos\/godot,TheHX\/godot,opmana\/godot,exabon\/godot,gau-veldt\/godot,Paulloz\/godot,godotengine\/godot,Paulloz\/godot,NateWardawg\/godot,Shockblast\/godot,josempans\/godot,Valentactive\/godot,Max-Might\/godot,honix\/godot,firefly2442\/godot,jejung\/godot,Faless\/godot,quabug\/godot,MrMaidx\/godot,firefly2442\/godot,DmitriySalnikov\/godot,Zylann\/godot,pkowal1982\/godot,josempans\/godot,JoshuaGrams\/godot,buckle2000\/godot,vkbsb\/godot,akien-mga\/godot,godotengine\/godot,Valentactive\/godot,n-pigeon\/godot,guilhermefelipecgs\/godot,ex\/godot,BastiaanOlij\/godot,Faless\/godot,akien-mga\/godot,okamstudio\/godot,n-pigeon\/godot,buckle2000\/godot,pkowal1982\/godot,Zylann\/godot,sanikoyes\/godot,mcanders\/godot,pixelpicosean\/my-godot-2.1,rollenrolm\/godot,vnen\/godot,iap-mutant\/godot,exabon\/godot,Max-Might\/godot,Paulloz\/godot,RandomShaper\/godot,Faless\/godot,JoshuaGrams\/godot,iap-mutant\/godot,Shockblast\/godot,quabug\/godot,ageazrael\/godot,ficoos\/godot,tomreyn\/godot,Brickcaster\/godot,Max-Might\/godot,vnen\/godot,morrow1nd\/godot,Zylann\/godot,jejung\/godot,ZuBsPaCe\/godot,Hodes\/godot,BastiaanOlij\/godot,Marqin\/godot,firefly2442\/godot,RebelliousX\/Go_Dot,morrow1nd\/godot,vkbsb\/godot,josempans\/godot,Shockblast\/godot,Marqin\/godot,jejung\/godot,NateWardawg\/godot,Hodes\/godot,Brickcaster\/godot,opmana\/godot","old_file":"demos\/misc\/joysticks\/joysticks.gd","new_file":"demos\/misc\/joysticks\/joysticks.gd","new_contents":"\nextends Node2D\n\n# Joysticks demo, written by Dana Olson \n#\n# This is a demo of joystick support, and doubles as a testing application\n# inspired by and similar to jstest-gtk.\n#\n# Licensed under the MIT license\n\n# Member variables\nvar joy_num\nvar cur_joy\nvar axis_value\n\nconst DEADZONE = 0.2\n\nfunc _fixed_process(delta):\n\t# Get the joystick device number from the spinbox\n\tjoy_num = get_node(\"joy_num\").get_value()\n\n\t# Display the name of the joystick if we haven't already\n\tif joy_num != cur_joy:\n\t\tcur_joy = joy_num\n\t\tget_node(\"joy_name\").set_text(Input.get_joy_name(joy_num))\n\n\t# Loop through the axes and show their current values\n\tfor axis in range(JOY_ANALOG_0_X, JOY_AXIS_MAX):\n\t\taxis_value = Input.get_joy_axis(joy_num, axis)\n\t\tget_node(\"axis_prog\" + str(axis)).set_value(100*axis_value)\n\t\tget_node(\"axis_val\" + str(axis)).set_text(str(axis_value))\n\t\t# Show joystick direction indicators\n\t\tif (axis <= JOY_ANALOG_1_Y):\n\t\t\tif (abs(axis_value) < DEADZONE):\n\t\t\t\tget_node(\"diagram\/axes\/\" + str(axis) + \"+\").hide()\n\t\t\t\tget_node(\"diagram\/axes\/\" + str(axis) + \"-\").hide()\n\t\t\telif (axis_value > 0):\n\t\t\t\tget_node(\"diagram\/axes\/\" + str(axis) + \"+\").show()\n\t\t\telse:\n\t\t\t\tget_node(\"diagram\/axes\/\" + str(axis) + \"-\").show()\n\n\t# Loop through the buttons and highlight the ones that are pressed\n\tfor btn in range(JOY_BUTTON_0, JOY_BUTTON_MAX):\n\t\tif (Input.is_joy_button_pressed(joy_num, btn)):\n\t\t\tget_node(\"btn\" + str(btn)).add_color_override(\"font_color\", Color(1, 1, 1, 1))\n\t\t\tget_node(\"diagram\/buttons\/\" + str(btn)).show()\n\t\telse:\n\t\t\tget_node(\"btn\" + str(btn)).add_color_override(\"font_color\", Color(0.2, 0.1, 0.3, 1))\n\t\t\tget_node(\"diagram\/buttons\/\" + str(btn)).hide()\n\nfunc _ready():\n\tset_fixed_process(true)\n\tInput.connect(\"joy_connection_changed\", self, \"_on_joy_connection_changed\")\n\n#Called whenever a joystick has been connected or disconnected.\nfunc _on_joy_connection_changed(device_id, connected):\n\tif device_id == cur_joy:\n\t\tif connected:\n\t\t\tget_node(\"joy_name\").set_text(Input.get_joy_name(device_id))\n\t\telse:\n\t\t\tget_node(\"joy_name\").set_text(\"\")\n","old_contents":"\nextends Node2D\n\n# Joysticks demo, written by Dana Olson \n#\n# This is a demo of joystick support, and doubles as a testing application\n# inspired by and similar to jstest-gtk.\n#\n# Licensed under the MIT license\n\n# Member variables\nvar joy_num\nvar cur_joy\nvar axis_value\nvar btn_state\n\nconst DEADZONE = 0.2\n\nfunc _fixed_process(delta):\n\t# Get the joystick device number from the spinbox\n\tjoy_num = get_node(\"joy_num\").get_value()\n\n\t# Display the name of the joystick if we haven't already\n\tif joy_num != cur_joy:\n\t\tcur_joy = joy_num\n\t\tget_node(\"joy_name\").set_text(Input.get_joy_name(joy_num))\n\n\t# Loop through the axes and show their current values\n\tfor axis in range(0, 8):\n\t\taxis_value = Input.get_joy_axis(joy_num, axis)\n\t\tget_node(\"axis_prog\" + str(axis)).set_value(100*axis_value)\n\t\tget_node(\"axis_val\" + str(axis)).set_text(str(axis_value))\n\t\tif (axis < 4):\n\t\t\tif (abs(axis_value) < DEADZONE):\n\t\t\t\tget_node(\"diagram\/axes\/\" + str(axis) + \"+\").hide()\n\t\t\t\tget_node(\"diagram\/axes\/\" + str(axis) + \"-\").hide()\n\t\t\telif (axis_value > 0):\n\t\t\t\tget_node(\"diagram\/axes\/\" + str(axis) + \"+\").show()\n\t\t\telse:\n\t\t\t\tget_node(\"diagram\/axes\/\" + str(axis) + \"-\").show()\n\n\t# Loop through the buttons and highlight the ones that are pressed\n\tfor btn in range(0, 16):\n\t\tbtn_state = 1\n\t\tif (Input.is_joy_button_pressed(joy_num, btn)):\n\t\t\tget_node(\"btn\" + str(btn)).add_color_override(\"font_color\", Color(1, 1, 1, 1))\n\t\t\tget_node(\"diagram\/buttons\/\" + str(btn)).show()\n\t\telse:\n\t\t\tget_node(\"btn\" + str(btn)).add_color_override(\"font_color\", Color(0.2, 0.1, 0.3, 1))\n\t\t\tget_node(\"diagram\/buttons\/\" + str(btn)).hide()\n\nfunc _ready():\n\tset_fixed_process(true)\n\tInput.connect(\"joy_connection_changed\", self, \"_on_joy_connection_changed\")\n\n#Called whenever a joystick has been connected or disconnected.\nfunc _on_joy_connection_changed(device_id, connected):\n\tif device_id == cur_joy:\n\t\tif connected:\n\t\t\tget_node(\"joy_name\").set_text(Input.get_joy_name(device_id))\n\t\telse:\n\t\t\tget_node(\"joy_name\").set_text(\"\")\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"45f5417822addcdc224980b29f10ce9ffc0de7cb","subject":"Add jump sound effect","message":"Add jump sound effect\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"2d\/platformer\/src\/Actors\/Player.gd","new_file":"2d\/platformer\/src\/Actors\/Player.gd","new_contents":"class_name Player\nextends Actor\n\n\n# warning-ignore:unused_signal\nsignal collect_coin()\n\nconst FLOOR_DETECT_DISTANCE = 20.0\n\nexport(String) var action_suffix = \"\"\n\nonready var platform_detector = $PlatformDetector\nonready var animation_player = $AnimationPlayer\nonready var shoot_timer = $ShootAnimation\nonready var sprite = $Sprite\nonready var sound_jump = $Jump\nonready var gun = sprite.get_node(@\"Gun\")\n\n\nfunc _ready():\n\t# Static types are necessary here to avoid warnings.\n\tvar camera: Camera2D = $Camera\n\tif action_suffix == \"_p1\":\n\t\tcamera.custom_viewport = $\"..\/..\"\n\telif action_suffix == \"_p2\":\n\t\tvar viewport: Viewport = $\"..\/..\/..\/..\/ViewportContainer2\/Viewport\"\n\t\tviewport.world_2d = ($\"..\/..\" as Viewport).world_2d\n\t\tcamera.custom_viewport = viewport\n\n\n# Physics process is a built-in loop in Godot.\n# If you define _physics_process on a node, Godot will call it every frame.\n\n# We use separate functions to calculate the direction and velocity to make this one easier to read.\n# At a glance, you can see that the physics process loop:\n# 1. Calculates the move direction.\n# 2. Calculates the move velocity.\n# 3. Moves the character.\n# 4. Updates the sprite direction.\n# 5. Shoots bullets.\n# 6. Updates the animation.\n\n# Splitting the physics process logic into functions not only makes it\n# easier to read, it help to change or improve the code later on:\n# - If you need to change a calculation, you can use Go To -> Function\n# (Ctrl Alt F) to quickly jump to the corresponding function.\n# - If you split the character into a state machine or more advanced pattern,\n# you can easily move individual functions.\nfunc _physics_process(_delta):\n\t# Play jump sound\n\tif Input.is_action_just_pressed(\"jump\" + action_suffix) and is_on_floor():\n\t\tsound_jump.play()\n\n\tvar direction = get_direction()\n\n\tvar is_jump_interrupted = Input.is_action_just_released(\"jump\" + action_suffix) and _velocity.y < 0.0\n\t_velocity = calculate_move_velocity(_velocity, direction, speed, is_jump_interrupted)\n\n\tvar snap_vector = Vector2.ZERO\n\tif direction.y == 0.0:\n\t\tsnap_vector = Vector2.DOWN * FLOOR_DETECT_DISTANCE\n\tvar is_on_platform = platform_detector.is_colliding()\n\t_velocity = move_and_slide_with_snap(\n\t\t_velocity, snap_vector, FLOOR_NORMAL, not is_on_platform, 4, 0.9, false\n\t)\n\n\t# When the character\u2019s direction changes, we want to to scale the Sprite accordingly to flip it.\n\t# This will make Robi face left or right depending on the direction you move.\n\tif direction.x != 0:\n\t\tif direction.x > 0:\n\t\t\tsprite.scale.x = 1\n\t\telse:\n\t\t\tsprite.scale.x = -1\n\n\t# We use the sprite's scale to store Robi\u2019s look direction which allows us to shoot\n\t# bullets forward.\n\t# There are many situations like these where you can reuse existing properties instead of\n\t# creating new variables.\n\tvar is_shooting = false\n\tif Input.is_action_just_pressed(\"shoot\" + action_suffix):\n\t\tis_shooting = gun.shoot(sprite.scale.x)\n\n\tvar animation = get_new_animation(is_shooting)\n\tif animation != animation_player.current_animation and shoot_timer.is_stopped():\n\t\tif is_shooting:\n\t\t\tshoot_timer.start()\n\t\tanimation_player.play(animation)\n\n\nfunc get_direction():\n\treturn Vector2(\n\t\tInput.get_action_strength(\"move_right\" + action_suffix) - Input.get_action_strength(\"move_left\" + action_suffix),\n\t\t-1 if is_on_floor() and Input.is_action_just_pressed(\"jump\" + action_suffix) else 0\n\t)\n\n\n# This function calculates a new velocity whenever you need it.\n# It allows you to interrupt jumps.\nfunc calculate_move_velocity(\n\t\tlinear_velocity,\n\t\tdirection,\n\t\tspeed,\n\t\tis_jump_interrupted\n\t):\n\tvar velocity = linear_velocity\n\tvelocity.x = speed.x * direction.x\n\tif direction.y != 0.0:\n\t\tvelocity.y = speed.y * direction.y\n\tif is_jump_interrupted:\n\t\t# Decrease the Y velocity by multiplying it, but don't set it to 0\n\t\t# as to not be too abrupt.\n\t\tvelocity.y *= 0.6\n\treturn velocity\n\n\nfunc get_new_animation(is_shooting = false):\n\tvar animation_new = \"\"\n\tif is_on_floor():\n\t\tif abs(_velocity.x) > 0.1:\n\t\t\tanimation_new = \"run\"\n\t\telse:\n\t\t\tanimation_new = \"idle\"\n\telse:\n\t\tif _velocity.y > 0:\n\t\t\tanimation_new = \"falling\"\n\t\telse:\n\t\t\tanimation_new = \"jumping\"\n\tif is_shooting:\n\t\tanimation_new += \"_weapon\"\n\treturn animation_new\n","old_contents":"class_name Player\nextends Actor\n\n\n# warning-ignore:unused_signal\nsignal collect_coin()\n\nconst FLOOR_DETECT_DISTANCE = 20.0\n\nexport(String) var action_suffix = \"\"\n\nonready var platform_detector = $PlatformDetector\nonready var animation_player = $AnimationPlayer\nonready var shoot_timer = $ShootAnimation\nonready var sprite = $Sprite\nonready var gun = sprite.get_node(@\"Gun\")\n\n\nfunc _ready():\n\t# Static types are necessary here to avoid warnings.\n\tvar camera: Camera2D = $Camera\n\tif action_suffix == \"_p1\":\n\t\tcamera.custom_viewport = $\"..\/..\"\n\telif action_suffix == \"_p2\":\n\t\tvar viewport: Viewport = $\"..\/..\/..\/..\/ViewportContainer2\/Viewport\"\n\t\tviewport.world_2d = ($\"..\/..\" as Viewport).world_2d\n\t\tcamera.custom_viewport = viewport\n\n\n# Physics process is a built-in loop in Godot.\n# If you define _physics_process on a node, Godot will call it every frame.\n\n# We use separate functions to calculate the direction and velocity to make this one easier to read.\n# At a glance, you can see that the physics process loop:\n# 1. Calculates the move direction.\n# 2. Calculates the move velocity.\n# 3. Moves the character.\n# 4. Updates the sprite direction.\n# 5. Shoots bullets.\n# 6. Updates the animation.\n\n# Splitting the physics process logic into functions not only makes it\n# easier to read, it help to change or improve the code later on:\n# - If you need to change a calculation, you can use Go To -> Function\n# (Ctrl Alt F) to quickly jump to the corresponding function.\n# - If you split the character into a state machine or more advanced pattern,\n# you can easily move individual functions.\nfunc _physics_process(_delta):\n\tvar direction = get_direction()\n\n\tvar is_jump_interrupted = Input.is_action_just_released(\"jump\" + action_suffix) and _velocity.y < 0.0\n\t_velocity = calculate_move_velocity(_velocity, direction, speed, is_jump_interrupted)\n\n\tvar snap_vector = Vector2.ZERO\n\tif direction.y == 0.0:\n\t\tsnap_vector = Vector2.DOWN * FLOOR_DETECT_DISTANCE\n\tvar is_on_platform = platform_detector.is_colliding()\n\t_velocity = move_and_slide_with_snap(\n\t\t_velocity, snap_vector, FLOOR_NORMAL, not is_on_platform, 4, 0.9, false\n\t)\n\n\t# When the character\u2019s direction changes, we want to to scale the Sprite accordingly to flip it.\n\t# This will make Robi face left or right depending on the direction you move.\n\tif direction.x != 0:\n\t\tif direction.x > 0:\n\t\t\tsprite.scale.x = 1\n\t\telse:\n\t\t\tsprite.scale.x = -1\n\n\t# We use the sprite's scale to store Robi\u2019s look direction which allows us to shoot\n\t# bullets forward.\n\t# There are many situations like these where you can reuse existing properties instead of\n\t# creating new variables.\n\tvar is_shooting = false\n\tif Input.is_action_just_pressed(\"shoot\" + action_suffix):\n\t\tis_shooting = gun.shoot(sprite.scale.x)\n\n\tvar animation = get_new_animation(is_shooting)\n\tif animation != animation_player.current_animation and shoot_timer.is_stopped():\n\t\tif is_shooting:\n\t\t\tshoot_timer.start()\n\t\tanimation_player.play(animation)\n\n\nfunc get_direction():\n\treturn Vector2(\n\t\tInput.get_action_strength(\"move_right\" + action_suffix) - Input.get_action_strength(\"move_left\" + action_suffix),\n\t\t-1 if is_on_floor() and Input.is_action_just_pressed(\"jump\" + action_suffix) else 0\n\t)\n\n\n# This function calculates a new velocity whenever you need it.\n# It allows you to interrupt jumps.\nfunc calculate_move_velocity(\n\t\tlinear_velocity,\n\t\tdirection,\n\t\tspeed,\n\t\tis_jump_interrupted\n\t):\n\tvar velocity = linear_velocity\n\tvelocity.x = speed.x * direction.x\n\tif direction.y != 0.0:\n\t\tvelocity.y = speed.y * direction.y\n\tif is_jump_interrupted:\n\t\t# Decrease the Y velocity by multiplying it, but don't set it to 0\n\t\t# as to not be too abrupt.\n\t\tvelocity.y *= 0.6\n\treturn velocity\n\n\nfunc get_new_animation(is_shooting = false):\n\tvar animation_new = \"\"\n\tif is_on_floor():\n\t\tif abs(_velocity.x) > 0.1:\n\t\t\tanimation_new = \"run\"\n\t\telse:\n\t\t\tanimation_new = \"idle\"\n\telse:\n\t\tif _velocity.y > 0:\n\t\t\tanimation_new = \"falling\"\n\t\telse:\n\t\t\tanimation_new = \"jumping\"\n\tif is_shooting:\n\t\tanimation_new += \"_weapon\"\n\treturn animation_new\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"a0a16aec3ae3a1df90ef8b5d1f041eca5e476f08","subject":"Remove leftover from the demos","message":"Remove leftover from the demos\n\nWas missed in c7d45ec085086ab86192a7890b9622320d57b89d.\n","repos":"Faless\/godot,zicklag\/godot,tomreyn\/godot,Marqin\/godot,FateAce\/godot,groud\/godot,okamstudio\/godot,Hodes\/godot,ex\/godot,DmitriySalnikov\/godot,mcanders\/godot,Valentactive\/godot,morrow1nd\/godot,godotengine\/godot,FateAce\/godot,akien-mga\/godot,n-pigeon\/godot,morrow1nd\/godot,akien-mga\/godot,firefly2442\/godot,sanikoyes\/godot,n-pigeon\/godot,vnen\/godot,pkowal1982\/godot,NateWardawg\/godot,JoshuaGrams\/godot,rollenrolm\/godot,Paulloz\/godot,TheHX\/godot,ex\/godot,RebelliousX\/Go_Dot,huziyizero\/godot,azurvii\/godot,ficoos\/godot,tomreyn\/godot,FateAce\/godot,honix\/godot,huziyizero\/godot,godotengine\/godot,akien-mga\/godot,ageazrael\/godot,FateAce\/godot,godotengine\/godot,DmitriySalnikov\/godot,guilhermefelipecgs\/godot,ex\/godot,groud\/godot,groud\/godot,firefly2442\/godot,Valentactive\/godot,Marqin\/godot,vnen\/godot,ficoos\/godot,pkowal1982\/godot,MrMaidx\/godot,RebelliousX\/Go_Dot,RandomShaper\/godot,MarianoGnu\/godot,n-pigeon\/godot,honix\/godot,mcanders\/godot,BastiaanOlij\/godot,Marqin\/godot,okamstudio\/godot,sanikoyes\/godot,Zylann\/godot,ZuBsPaCe\/godot,MarianoGnu\/godot,Paulloz\/godot,DmitriySalnikov\/godot,MrMaidx\/godot,Hodes\/godot,vnen\/godot,akien-mga\/godot,Valentactive\/godot,ex\/godot,DmitriySalnikov\/godot,pkowal1982\/godot,ageazrael\/godot,tomreyn\/godot,ex\/godot,vkbsb\/godot,Valentactive\/godot,Zylann\/godot,rollenrolm\/godot,RebelliousX\/Go_Dot,RandomShaper\/godot,sanikoyes\/godot,Shockblast\/godot,MarianoGnu\/godot,tomreyn\/godot,jejung\/godot,FateAce\/godot,Hodes\/godot,godotengine\/godot,jejung\/godot,akien-mga\/godot,BastiaanOlij\/godot,Max-Might\/godot,ex\/godot,Zylann\/godot,josempans\/godot,Paulloz\/godot,NateWardawg\/godot,rollenrolm\/godot,Shockblast\/godot,BastiaanOlij\/godot,Zylann\/godot,zicklag\/godot,Paulloz\/godot,opmana\/godot,pixelpicosean\/my-godot-2.1,firefly2442\/godot,josempans\/godot,okamstudio\/godot,MrMaidx\/godot,opmana\/godot,n-pigeon\/godot,okamstudio\/godot,okamstudio\/godot,huziyizero\/godot,okamstudio\/godot,Hodes\/godot,zicklag\/godot,guilhermefelipecgs\/godot,JoshuaGrams\/godot,guilhermefelipecgs\/godot,Faless\/godot,vkbsb\/godot,NateWardawg\/godot,MarianoGnu\/godot,pkowal1982\/godot,Faless\/godot,jejung\/godot,exabon\/godot,exabon\/godot,TheHX\/godot,ageazrael\/godot,ageazrael\/godot,ZuBsPaCe\/godot,vkbsb\/godot,Faless\/godot,Shockblast\/godot,DmitriySalnikov\/godot,firefly2442\/godot,morrow1nd\/godot,exabon\/godot,godotengine\/godot,BastiaanOlij\/godot,ex\/godot,ZuBsPaCe\/godot,Zylann\/godot,Max-Might\/godot,NateWardawg\/godot,n-pigeon\/godot,Brickcaster\/godot,JoshuaGrams\/godot,RandomShaper\/godot,n-pigeon\/godot,okamstudio\/godot,akien-mga\/godot,zicklag\/godot,sanikoyes\/godot,JoshuaGrams\/godot,jejung\/godot,vnen\/godot,vkbsb\/godot,ZuBsPaCe\/godot,vnen\/godot,okamstudio\/godot,groud\/godot,sanikoyes\/godot,pixelpicosean\/my-godot-2.1,Brickcaster\/godot,JoshuaGrams\/godot,ZuBsPaCe\/godot,est31\/godot,honix\/godot,honix\/godot,groud\/godot,azurvii\/godot,mcanders\/godot,mcanders\/godot,ageazrael\/godot,guilhermefelipecgs\/godot,Marqin\/godot,tomreyn\/godot,DmitriySalnikov\/godot,Hodes\/godot,Paulloz\/godot,Brickcaster\/godot,godotengine\/godot,Zylann\/godot,josempans\/godot,NateWardawg\/godot,josempans\/godot,est31\/godot,guilhermefelipecgs\/godot,opmana\/godot,gau-veldt\/godot,Shockblast\/godot,gau-veldt\/godot,jejung\/godot,okamstudio\/godot,Paulloz\/godot,morrow1nd\/godot,FateAce\/godot,josempans\/godot,vkbsb\/godot,guilhermefelipecgs\/godot,Marqin\/godot,Max-Might\/godot,godotengine\/godot,Valentactive\/godot,Max-Might\/godot,RebelliousX\/Go_Dot,exabon\/godot,opmana\/godot,Faless\/godot,Brickcaster\/godot,guilhermefelipecgs\/godot,JoshuaGrams\/godot,RandomShaper\/godot,Shockblast\/godot,huziyizero\/godot,pixelpicosean\/my-godot-2.1,Max-Might\/godot,sanikoyes\/godot,est31\/godot,firefly2442\/godot,akien-mga\/godot,ZuBsPaCe\/godot,Faless\/godot,jejung\/godot,Shockblast\/godot,MarianoGnu\/godot,ficoos\/godot,morrow1nd\/godot,azurvii\/godot,Hodes\/godot,MrMaidx\/godot,okamstudio\/godot,vkbsb\/godot,MrMaidx\/godot,pkowal1982\/godot,rollenrolm\/godot,mcanders\/godot,BastiaanOlij\/godot,MarianoGnu\/godot,RandomShaper\/godot,est31\/godot,Marqin\/godot,ZuBsPaCe\/godot,ficoos\/godot,pkowal1982\/godot,Shockblast\/godot,gau-veldt\/godot,NateWardawg\/godot,BastiaanOlij\/godot,vkbsb\/godot,ageazrael\/godot,Brickcaster\/godot,MarianoGnu\/godot,josempans\/godot,Max-Might\/godot,MrMaidx\/godot,firefly2442\/godot,zicklag\/godot,NateWardawg\/godot,ficoos\/godot,RandomShaper\/godot,Valentactive\/godot,MarianoGnu\/godot,TheHX\/godot,josempans\/godot,ZuBsPaCe\/godot,pkowal1982\/godot,est31\/godot,firefly2442\/godot,Paulloz\/godot,gau-veldt\/godot,Valentactive\/godot,mcanders\/godot,Valentactive\/godot,sanikoyes\/godot,godotengine\/godot,akien-mga\/godot,Brickcaster\/godot,vnen\/godot,azurvii\/godot,pixelpicosean\/my-godot-2.1,Faless\/godot,guilhermefelipecgs\/godot,vnen\/godot,vkbsb\/godot,RebelliousX\/Go_Dot,pixelpicosean\/my-godot-2.1,TheHX\/godot,azurvii\/godot,honix\/godot,pkowal1982\/godot,NateWardawg\/godot,DmitriySalnikov\/godot,huziyizero\/godot,TheHX\/godot,exabon\/godot,RebelliousX\/Go_Dot,Shockblast\/godot,groud\/godot,NateWardawg\/godot,josempans\/godot,Zylann\/godot,Zylann\/godot,n-pigeon\/godot,opmana\/godot,sanikoyes\/godot,rollenrolm\/godot,vnen\/godot,RandomShaper\/godot,ficoos\/godot,BastiaanOlij\/godot,ageazrael\/godot,firefly2442\/godot,BastiaanOlij\/godot,Faless\/godot,azurvii\/godot,morrow1nd\/godot,est31\/godot,Brickcaster\/godot,honix\/godot,exabon\/godot,ex\/godot,zicklag\/godot,gau-veldt\/godot","old_file":"demos\/plugins\/custom_import_plugin\/import_plugin.gd","new_file":"demos\/plugins\/custom_import_plugin\/import_plugin.gd","new_contents":"","old_contents":"tool\n\nextends EditorImportPlugin\n\n\n# Simple plugin that imports a text file with extension .mtxt\n# which contains 3 integers in format R,G,B (0-255)\n# (see example .mtxt in this folder)\n# Imported file is converted to a material\n\nvar dialog = null\n\nfunc get_name():\n\treturn \"silly_material\"\n\nfunc get_visible_name():\n\treturn \"Silly Material\"\n\nfunc import_dialog(path):\n\tvar md = null\n\tif (path!=\"\"):\n\t\tmd = ResourceLoader.load_import_metadata(path)\n\tdialog.configure(self,path,md)\n\tdialog.popup_centered()\n\nfunc import(path,metadata):\n\n\tassert(metadata.get_source_count() == 1)\n\n\tvar source = metadata.get_source_path(0)\n\tvar use_red_anyway = metadata.get_option(\"use_red_anyway\")\n\n\tvar f = File.new()\n\tvar err = f.open(source,File.READ)\n\tif (err!=OK):\n\t\treturn ERR_CANT_OPEN\n\n\tvar l = f.get_line()\n\n\tf.close()\n\n\tvar channels = l.split(\",\")\n\tif (channels.size()!=3):\n\t\treturn ERR_PARSE_ERROR\n\n\tvar color = Color8(int(channels[0]),int(channels[1]),int(channels[2]))\n\n\tvar material\n\n\tif (ResourceLoader.has(path)):\n\t\t# Material is in use, update it\n\t\tmaterial = ResourceLoader.load(path)\n\telse:\n\t\t# Material not in use, create\n\t\tmaterial = FixedMaterial.new()\n\n\tif (use_red_anyway):\n\t\tcolor=Color8(255,0,0)\n\n\tmaterial.set_parameter(FixedMaterial.PARAM_DIFFUSE,color)\n\n\t# Make sure import metadata links to this plugin\n\n\tmetadata.set_editor(\"silly_material\")\n\n\t# Update the md5 value of the source file\n\n\tmetadata.set_source_md5(0, f.get_md5(source))\n\n\t# Update the import metadata\n\n\tmaterial.set_import_metadata(metadata)\n\n\n\t# Save\n\terr = ResourceSaver.save(path,material)\n\n\treturn err\n\n\nfunc config(base_control):\n\n\tdialog = preload(\"res:\/\/addons\/custom_import_plugin\/material_dialog.tscn\").instance()\n\tbase_control.add_child(dialog)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"7386283e714a0cad783b961944ee5a9696069285","subject":"forceClick handles all activation now. one step closer to multiplayer editing","message":"forceClick handles all activation now. one step closer to multiplayer editing\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Blocks\/AbstractBlock.gd","new_file":"src\/scripts\/Blocks\/AbstractBlock.gd","new_contents":"\nextends RigidBody\n\nvar name_int\nvar name\nvar pairName\nvar selected = false\nvar blockPos\nvar blockLayer\nvar blockType\nconst far_away_corner = Vector3(110, 110, 110)\n\nvar editor\n\nstatic func nameToNodeName(n):\n\treturn \"block\" + str(n)\n\nfunc setName(n):\n\tname_int = n\n\tname = nameToNodeName(n)\n\tset_name(nameToNodeName(n))\n\treturn self\n\nfunc setPairName(n):\n\tpairName = nameToNodeName(n)\n\treturn self\n\nfunc setBlockLayer(n):\n\tblockLayer = n\n\treturn self\n\nfunc getBlockLayer():\n\treturn blockLayer\n\nfunc setBlockType( blockT ):\n\tblockType = blockT\n\treturn self\n\nfunc getBlockType():\n\treturn blockType\n\nfunc setSelected(sel):\n\tselected = sel\n\treturn self\n\nfunc forceClick(click_normal):\n\tif editor != null:\n\t\tif editor.shouldAddNeighbor():\n\t\t\taddNeighbor(editor, click_normal)\n\t\t\treturn\n\t\tif editor.shouldReplaceSelf():\n\t\t\taddNeighbor(editor, 0 * click_normal)\n\t\tif editor.shouldReplaceSelf() or editor.shouldRemoveSelf():\n\t\t\tif pairName != null:\n\t\t\t\tvar pair = get_parent().get_node(pairName)\n\t\t\t\tif pair != null:\n\t\t\t\t\tpair.request_remove()\n\t\t\trequest_remove()\n\t\t\treturn\n\telse:\n\t\tactivate()\n\t\tget_parent().clickBlock( name )\n\nfunc addNeighbor(editor, click_normal):\n\tvar t = get_parent().get_parent().get_transform().inverse()\n\tvar b = editor.newPickledBlock().setBlockPos(blockPos + t * click_normal)\n\tget_parent().add_block(b.toNode())\n\n\n# catch clicks\/taps\nfunc _input_event( camera, ev, click_pos, click_normal, shape_idx ):\n\tif ((ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT)\n\tor (ev.type==InputEvent.SCREEN_TOUCH)):\n\t\tif (get_parent().get_parent().active and ev.is_pressed()):\n\t\t\tforceClick(click_normal)\n\n# returns this block's pairNode or null\nfunc pairActivate():\n\tselected = true\n\n\t# is my pair Nil?\n\tif pairName == null or get_parent() == null or not get_parent().has_node(pairName):\n\t\tscaleTweenNode(0.9, 0.2, Tween.TRANS_EXPO).start()\n\t\treturn null\n\n\t# get my pair node\n\tvar pairNode = get_parent().get_node(pairName)\n\n\t# enlarge if the other guy's unselected\n\tif not pairNode.selected:\n\t\tscaleTweenNode(1.1, 0.2, Tween.TRANS_EXPO).start()\n\treturn pairNode\n\n\n# returns a tween node that uniformly changes the object's scale\n# call start() on the returned object\nfunc scaleTweenNode(scale, time=1, transType=Tween.TRANS_BOUNCE):\n\tvar tweenNode = newTweenNode()\n\ttweenNode.interpolate_method( self, \"set_scale\", \\\n\t\tself.get_scale(), Vector3(scale, scale, scale), \\\n\t\ttime, transType, Tween.EASE_OUT )\n\n\treturn tweenNode\n\n# adds a tween transition node to the tree\nfunc newTweenNode():\n\tvar tween = Tween.new()\n\tadd_child(tween)\n\treturn tween\n\nfunc request_remove(node=null, key=null):\n\tget_parent().remove_block(self)\n\nfunc _ready():\n\teditor = get_tree().get_root().get_node(\"EditorSpatial\")\n\tset_ray_pickable(true)\n","old_contents":"\nextends RigidBody\n\nvar name_int\nvar name\nvar pairName\nvar selected = false\nvar blockPos\nvar blockLayer\nvar blockType\nconst far_away_corner = Vector3(110, 110, 110)\n\nvar editor\n\nstatic func nameToNodeName(n):\n\treturn \"block\" + str(n)\n\nfunc setName(n):\n\tname_int = n\n\tname = nameToNodeName(n)\n\tset_name(nameToNodeName(n))\n\treturn self\n\nfunc setPairName(n):\n\tpairName = nameToNodeName(n)\n\treturn self\n\nfunc setBlockLayer(n):\n\tblockLayer = n\n\treturn self\n\nfunc getBlockLayer():\n\treturn blockLayer\n\nfunc setBlockType( blockT ):\n\tblockType = blockT\n\treturn self\n\nfunc getBlockType():\n\treturn blockType\n\nfunc setSelected(sel):\n\tselected = sel\n\treturn self\n\nfunc forceClick():\n\tactivate()\n\tget_parent().clickBlock( name )\n\nfunc addNeighbor(editor, click_normal):\n\tvar t = get_parent().get_parent().get_transform().inverse()\n\tvar b = editor.newPickledBlock().setBlockPos(blockPos + t * click_normal)\n\tget_parent().add_block(b.toNode())\n\n\n# catch clicks\/taps\nfunc _input_event( camera, ev, click_pos, click_normal, shape_idx ):\n\tif ((ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT)\n\tor (ev.type==InputEvent.SCREEN_TOUCH)):\n\t\tif (get_parent().get_parent().active and ev.is_pressed()):\n\t\t\tif editor != null:\n\t\t\t\tif editor.shouldAddNeighbor():\n\t\t\t\t\taddNeighbor(editor, click_normal)\n\t\t\t\t\treturn\n\t\t\t\tif editor.shouldReplaceSelf():\n\t\t\t\t\taddNeighbor(editor, 0 * click_normal)\n\t\t\t\t\tremove_with_pop(self, null)\n\t\t\t\t\treturn\n\t\t\t\tif editor.shouldRemoveSelf():\n\t\t\t\t\tremove_with_pop(self, null)\n\t\t\t\t\treturn\n\t\t\telse:\n\t\t\t\tforceClick()\n\n# returns this block's pairNode or null\nfunc pairActivate():\n\tselected = true\n\n\t# is my pair Nil?\n\tif pairName == null or get_parent() == null or not get_parent().has_node(pairName):\n\t\tscaleTweenNode(0.9, 0.2, Tween.TRANS_EXPO).start()\n\t\treturn null\n\n\t# get my pair node\n\tvar pairNode = get_parent().get_node(pairName)\n\n\t# enlarge if the other guy's unselected\n\tif not pairNode.selected:\n\t\tscaleTweenNode(1.1, 0.2, Tween.TRANS_EXPO).start()\n\treturn pairNode\n\n\n# returns a tween node that uniformly changes the object's scale\n# call start() on the returned object\nfunc scaleTweenNode(scale, time=1, transType=Tween.TRANS_BOUNCE):\n\tvar tweenNode = newTweenNode()\n\ttweenNode.interpolate_method( self, \"set_scale\", \\\n\t\tself.get_scale(), Vector3(scale, scale, scale), \\\n\t\ttime, transType, Tween.EASE_OUT )\n\n\treturn tweenNode\n\n# adds a tween transition node to the tree\nfunc newTweenNode():\n\tvar tween = Tween.new()\n\tadd_child(tween)\n\treturn tween\n\nfunc request_remove(node=null, key=null):\n\tget_parent().remove_block(self)\n\nfunc _ready():\n\teditor = get_tree().get_root().get_node(\"EditorSpatial\")\n\tset_ray_pickable(true)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"a59849cb8bc4c433c885ed6b5c57d0174dd16d2a","subject":"centralized set_puzzle","message":"centralized set_puzzle\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/GridMan.gd","new_file":"src\/scripts\/GridMan.gd","new_contents":"extends Spatial\n\n# Is there a better way to do this?\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\n# Shape dictionary to access blocks quickly by position.\nvar shape = {}\n\n# Block selection handling.\nvar offClick = false\nvar selectedBlocks = []\n\n# Puzzle vars.\nvar puzzle\nvar pairCount = []\n\n# Beam stuff.\nconst beamScn = preload( \"res:\/\/blocks\/block.scn\" )\nconst Beam = preload(\"res:\/\/scripts\/Blocks\/Beam.gd\")\n\n# sounds\nvar samplePlayer = SamplePlayer.new()\n\nfunc add_block(b):\n\tshape[b.blockPos] = b\n\n\tif b.getBlockType() == 2:\n\t\tvar layer = calcBlockLayerVec(b.blockPos)\n\t\twhile pairCount.size() <= layer:\n\t\t\t\tpairCount.append(0)\n\t\n\t\t# preload(\"res:\/\/trust\")\n\t\tpairCount[layer] += 0.5\n\n\tadd_child(b)\n\nfunc get_block(pos):\n\tif shape.has(pos):\n\t\treturn shape[pos]\n\telse:\n\t\treturn null\n\nfunc remove_block(block_node):\n\tshape[block_node.blockPos] = null\n\t# TODO scan_layer, fire lasers if empty\n\tfor child in block_node.get_children():\n\t\tblock_node.remove_and_delete_child(child)\n\tremove_and_delete_child(block_node)\n\n# TODO wild block selected? can click any pair. can deselect wild block.\nvar wildBlockSelected = null\n\n# Sets the puzzle for this GridMan.\nfunc set_puzzle(puzz):\n\t# TODO delete current puzzle\n\t\n\t# Store the puzzle.\n\tpuzzle = puzz\n\n\t# Initalization here\n\tsamplePlayer.set_voice_count(puzzle.puzzleLayers * 2)\n\tsamplePlayer.set_sample_library(ResourceLoader.load(\"new_samplelibrary.xml\"))\n\n\t# Set the camera range to be relative to the layer count.\n\tvar cam = get_parent().get_parent().get_node( \"Camera\" )\n\tvar totalSize = ( puzzle.puzzleLayers * 2 + 1 )\n\tcam.distance.val = 4.5 * totalSize\n\tcam.distance.min_ = 3 * totalSize\n\tcam.distance.max_ = 10 * totalSize\n\tcam.recalculate_camera()\n\t\n\tfor block in puzzle.blocks:\n\t\t# Create a block node, add it to the tree\n\t\tadd_block(block.toNode())\n\n# Clears any selected blocks. WE SHOULD FIX THIS, THERE CAN ONLY BE ONE BLOCK SELECTED AT ANY ONE TIME, NO NEED FOR AN ARRAY!\nfunc clearSelection():\n\tfor bl in selectedBlocks:\n\t\tvar blo = get_node( bl )\n\t\tblo.setSelected(false)\n\t\tblo.scaleTweenNode(1.0).start()\n\tselectedBlocks = []\n\n# Add the selected block to the selected list. WE SHOULD FIX THIS, IT ONLY NEEDS TO STORE IT, NOT AN ARRAY!\nfunc addSelected(bl):\n\tselectedBlocks.append(bl)\n\n# Used for the multiplayer mode to force click a block on their side.\nfunc forceClickBlock( pos ):\n\tshape[pos].forceClick()\n\nfunc clickBlock( name ):\n\t#now check if that was the second block we picked. If it was, we want to\n\t#unselect the blocks again\n\tif (offClick):\n\t\toffClick = false\n\t\taddSelected(name)\n\t\tclearSelection()\n\telse:\n\t\toffClick = true;\n\t\taddSelected(name)\n\n# Calculates the layer that a block is on.\n# COPY OF FUNCTION IN PUZZLEMAN, IS THERE A BETTER WAY TO DO THIS?!\nfunc calcBlockLayer( x, y, z ):\n\treturn max( max( abs( x ), abs( y ) ), abs( z ) )\nfunc calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n# Handles keeping track of pairs being removed.\nfunc popPair( pos ):\n\tvar blayer = calcBlockLayerVec( pos )\n\tpairCount[blayer] -= 1\n\n\tif( pairCount[blayer] == 0 ):\n\t\tprint(\"LAYER CLEARED\")\n\t\tif blayer == 1:\n\t\t\tprint( \"GAME OVER!\" )\n\n\t\tfor b in shape:\n\t\t\tif not ( shape[b] == null ):\n\t\t\t\tif calcBlockLayerVec( b ) == blayer:\n\t\t\t\t\tif shape[b].getBlockType() == BLOCK_LASER:\n\t\t\t\t\t\tshape[b].forceActivate()\n\n\t\t# Fire beams.\n\t\tvar beamNum = 0\n\t\tfor l in range( puzzle.lasers.size() ):\n\t\t\tif calcBlockLayerVec( puzzle.lasers[l][0] ) == blayer:\n\t\t\t\t# Firin mah lazerz!\n\t\t\t\tvar beam = beamScn.instance()\n\n\t\t\t\tbeam.set_name( str(blayer) + \"_beam_\" + str(beamNum) )\n\t\t\t\tbeamNum += 1\n\t\t\t\tbeam.set_script( Beam )\n\n\t\t\t\tadd_child( beam )\n\t\t\t\tbeam.fire( puzzle.lasers[l][0], puzzle.lasers[l][1] )\n\n\t\t\t\tsamplePlayer.play( \"soundslikewillem_hitting_slinky\" )\n\n","old_contents":"extends Spatial\n\n# Is there a better way to do this?\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\n# Shape dictionary to access blocks quickly by position.\nvar shape = {}\n\n# Block selection handling.\nvar offClick = false\nvar selectedBlocks = []\n\n# Puzzle vars.\nvar puzzle\nvar pairCount = []\n\n# Beam stuff.\nconst beamScn = preload( \"res:\/\/blocks\/block.scn\" )\nconst Beam = preload(\"res:\/\/scripts\/Blocks\/Beam.gd\")\n\n# sounds\nvar samplePlayer = SamplePlayer.new()\n\nfunc add_block(b):\n\tshape[b.blockPos] = b\n\n\tif b.getBlockType() == 2:\n\t\tvar layer = calcBlockLayerVec(b.blockPos)\n\t\twhile pairCount.size() <= layer:\n\t\t\t\tpairCount.append(0)\n\t\n\t\t# preload(\"res:\/\/trust\")\n\t\tpairCount[layer] += 0.5\n\n\tadd_child(b)\n\nfunc get_block(pos):\n\tif shape.has(pos):\n\t\treturn shape[pos]\n\telse:\n\t\treturn null\n\nfunc remove_block(block_node):\n\tshape[block_node.blockPos] = null\n\t# TODO scan_layer, fire lasers if empty\n\tfor child in block_node.get_children():\n\t\tblock_node.remove_and_delete_child(child)\n\tremove_and_delete_child(block_node)\n\n# TODO wild block selected? can click any pair. can deselect wild block.\nvar wildBlockSelected = null\n\n# Sets the puzzle for this GridMan.\nfunc set_puzzle(puzz):\n\t# Store the puzzle.\n\tpuzzle = puzz\n\n\t# Initalization here\n\tsamplePlayer.set_voice_count(puzzle.puzzleLayers * 2)\n\tsamplePlayer.set_sample_library(ResourceLoader.load(\"new_samplelibrary.xml\"))\n\n\t# Set the camera range to be relative to the layer count.\n\tvar cam = get_parent().get_parent().get_node( \"Camera\" )\n\tvar totalSize = ( puzzle.puzzleLayers * 2 + 1 )\n\tcam.distance.val = 4.5 * totalSize\n\tcam.distance.min_ = 3 * totalSize\n\tcam.distance.max_ = 10 * totalSize\n\tcam.recalculate_camera()\n\n# Clears any selected blocks. WE SHOULD FIX THIS, THERE CAN ONLY BE ONE BLOCK SELECTED AT ANY ONE TIME, NO NEED FOR AN ARRAY!\nfunc clearSelection():\n\tfor bl in selectedBlocks:\n\t\tvar blo = get_node( bl )\n\t\tblo.setSelected(false)\n\t\tblo.scaleTweenNode(1.0).start()\n\tselectedBlocks = []\n\n# Add the selected block to the selected list. WE SHOULD FIX THIS, IT ONLY NEEDS TO STORE IT, NOT AN ARRAY!\nfunc addSelected(bl):\n\tselectedBlocks.append(bl)\n\n# Used for the multiplayer mode to force click a block on their side.\nfunc forceClickBlock( pos ):\n\tshape[pos].forceClick()\n\nfunc clickBlock( name ):\n\t#now check if that was the second block we picked. If it was, we want to\n\t#unselect the blocks again\n\tif (offClick):\n\t\toffClick = false\n\t\taddSelected(name)\n\t\tclearSelection()\n\telse:\n\t\toffClick = true;\n\t\taddSelected(name)\n\n# Calculates the layer that a block is on.\n# COPY OF FUNCTION IN PUZZLEMAN, IS THERE A BETTER WAY TO DO THIS?!\nfunc calcBlockLayer( x, y, z ):\n\treturn max( max( abs( x ), abs( y ) ), abs( z ) )\nfunc calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n# Handles keeping track of pairs being removed.\nfunc popPair( pos ):\n\tvar blayer = calcBlockLayerVec( pos )\n\tpairCount[blayer] -= 1\n\n\tif( pairCount[blayer] == 0 ):\n\t\tprint(\"LAYER CLEARED\")\n\t\tif blayer == 1:\n\t\t\tprint( \"GAME OVER!\" )\n\n\t\tfor b in shape:\n\t\t\tif not ( shape[b] == null ):\n\t\t\t\tif calcBlockLayerVec( b ) == blayer:\n\t\t\t\t\tif shape[b].getBlockType() == BLOCK_LASER:\n\t\t\t\t\t\tshape[b].forceActivate()\n\n\t\t# Fire beams.\n\t\tvar beamNum = 0\n\t\tfor l in range( puzzle.lasers.size() ):\n\t\t\tif calcBlockLayerVec( puzzle.lasers[l][0] ) == blayer:\n\t\t\t\t# Firin mah lazerz!\n\t\t\t\tvar beam = beamScn.instance()\n\n\t\t\t\tbeam.set_name( str(blayer) + \"_beam_\" + str(beamNum) )\n\t\t\t\tbeamNum += 1\n\t\t\t\tbeam.set_script( Beam )\n\n\t\t\t\tadd_child( beam )\n\t\t\t\tbeam.fire( puzzle.lasers[l][0], puzzle.lasers[l][1] )\n\n\t\t\t\tsamplePlayer.play( \"soundslikewillem_hitting_slinky\" )\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"1e1fb3bb5da95b7e4c7efe6a895f2c9307468f32","subject":"add puzzle.scn once puzzleView.scn is ready. skipTitle() added","message":"add puzzle.scn once puzzleView.scn is ready. skipTitle() added\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/GUIManager.gd","new_file":"src\/scripts\/GUIManager.gd","new_contents":"# This script manages all of the GUI elements.\n# It switches between the states of the GUI allowing\n# the user to start games, edit the options or connect\n# to a multiplayer game.\n\nextends Node\n\n# network variables\nvar network\n\n# State variables.\nvar menuOn\nvar splashTween\n\n# Timers.\nvar timer\nvar initialWait = 0.5\nvar splashTimer = 2.0\nvar warningTimer = 5.0\n\n# GUI pieces.\nvar Splash_Team5\nvar Splash_Warning\nvar Menu_Main\nvar Menu_Chooser\nvar Menu_MP\nvar Menu_HostGame\nvar Menu_JoinGame\nvar Menu_Options\n\n# Menu state values. Used to switch between them.\nvar MENU_INIT\t\t\t= 0\nvar MENU_SPLASHTEAM5\t= 1\nvar MENU_SPLASHWARNING\t= 2\nvar MENU_MAIN\t\t\t= 3\nvar MENU_CHOOSER\t\t= 4\nvar MENU_MP\t\t\t\t= 5\nvar MENU_HOSTGAME\t\t= 6\nvar MENU_JOINGAME\t\t= 7\nvar MENU_OPTIONS\t\t= 8\n\n# Main Menu Theme\nvar samplePlayer = StreamPlayer.new()\nvar songs = [load(\"res:\/\/main_theme_antris.ogg\")]\n\nfunc skipTitle(skip):\n\tif skip:\n\t\tinitialWait = 0.01\n\t\tsplashTimer = 0.01\n\t\twarningTimer = 0.01\n\n# Function to be called once for setup.\nfunc _ready():\n\t# Initial setup.\n\tmenuOn = MENU_INIT\n\ttimer = 0.0\n\tset_process( true )\n\tset_process_input( true )\n\n\t# Setup the splash fader tween.\n\tsplashTween = Tween.new()\n\tget_node( \"SplashFader\" ).add_child( splashTween )\n\tsplashTween.interpolate_method( get_node( \"SplashFader\" ), \"set_opacity\", 1.0, 0.0, 1.0, Tween.TRANS_CUBIC, Tween.EASE_IN_OUT )\n\n\t# Gather all of the menus.\n\tSplash_Team5 = get_node( \"SplashTeam5\" )\n\tSplash_Warning = get_node( \"SplashWarning\" )\n\tMenu_Main = get_node( \"MainMenu\" )\n\tMenu_Chooser = get_node( \"ChooserMenu\" )\n\tMenu_MP = get_node( \"Multiplayer\" )\n\tMenu_HostGame = get_node( \"HostGame\" )\n\tMenu_JoinGame = get_node( \"JoinGame\" )\n\tMenu_Options = get_node( \"OptionsMenu\" )\n\n\tGlobals.set(\"Network\", load(\"res:\/\/scripts\/Network.gd\").new())\n\tnetwork = Globals.get(\"Network\")\n\n\tvar scn = load(\"res:\/\/networkProxy.scn\")\n\tadd_child(scn.instance())\n\tnetwork.root = get_tree().get_root()\n\n\t# Load the config.\n\tvar config = preload( \"res:\/\/scripts\/DataManager.gd\" ).new().loadConfig()\n\n\tget_node(\"OptionsMenu\/Panel\/OnlineName\/LineEdit\").set_text( config.name )\n\tget_node(\"OptionsMenu\/Panel\/SoundVolume\/SoundSlider\").set_value( config.soundvolume )\n\tget_node(\"OptionsMenu\/Panel\/MusicVolume\/MusicSlider\").set_value( config.musicvolume )\n\n\tnetwork.port = config.portnumber\n\n\t# Main Menu Theme\n\tadd_child(samplePlayer)\n\tsamplePlayer.set_stream(songs[0])\n\tsamplePlayer.play()\n\n# Function to update the GUI.\nfunc _process( delta ):\n\t# Handle the initial wait.\n\tif( menuOn == MENU_INIT ):\n\t\tif( timer > initialWait ):\n\t\t\tmenuOn = MENU_SPLASHTEAM5\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiIn()\n\n\t# Handle the Team5 splash screen.\n\tif( menuOn == MENU_SPLASHTEAM5 ):\n\t\tif( timer > splashTimer ):\n\t\t\tmenuOn = MENU_SPLASHWARNING\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiOut()\n\t\t\tSplash_Warning.guiIn()\n\n\t# Handle the warning splash screen.\n\tif( menuOn == MENU_SPLASHWARNING ):\n\t\tif( timer > warningTimer ):\n\t\t\tmenuOn = MENU_MAIN\n\t\t\ttimer = 0.0\n\t\t\tSplash_Warning.guiOut()\n\t\t\tMenu_Main.guiIn()\n\t\t\tsplashTween.start()\n\n\t# Increase the timer each frame.\n\ttimer += delta\n\n# Handle the input events.\nfunc _input( ev ):\n\t# Handle skip splash screens.\n\tif( !ev.is_pressed() and ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT ):\n\t\tif( menuOn == MENU_SPLASHTEAM5 || menuOn == MENU_SPLASHWARNING ):\n\t\t\ttimer = 999.0;\n\n\t# Handle exit.\n\tif( ev.is_action( \"ui_cancel\" ) ):\n\t\texit()\n\nfunc exit():\n\tprint( \"Exiting\" )\n\tOS.get_main_loop().quit()\n\nfunc _on_Exit_pressed():\n\texit()\n\n# TODO save to ConfigFile, load this on beginning\nfunc _on_Options_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Options.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_OPTIONS\n\tget_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\").set_text(str(network.port))\n\nfunc _on_Cancel_pressed():\n\tMenu_Options.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_SaveQuit_pressed():\n\t# Save the options.\n\n\tvar config = { name = get_node(\"OptionsMenu\/Panel\/OnlineName\/LineEdit\").get_text()\n\t\t\t\t , soundvolume = get_node(\"OptionsMenu\/Panel\/SoundVolume\/SoundSlider\").get_value()\n\t\t\t\t , musicvolume = get_node(\"OptionsMenu\/Panel\/MusicVolume\/MusicSlider\").get_value()\n\t\t\t\t , portnumber = get_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\").get_text()\n\t\t\t\t }\n\n\tpreload( \"res:\/\/scripts\/DataManager.gd\" ).new().saveConfig( config )\n\n\tvar field = get_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\")\n\tnetwork.setPort(field.get_text())\n\tnetwork.setPort(field.get_text())\n\t_on_Cancel_pressed()\n\nfunc _on_SP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Chooser.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_CHOOSER\n\nfunc _on_MainMenu_pressed():\n\tMenu_Chooser.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MainMenuMP_pressed():\n\tMenu_MP.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_MP.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MP\n\nfunc _on_MainMenuHG_pressed():\n\tMenu_HostGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\tnetwork.disconnect()\n\nfunc _on_HostGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_HostGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_HOSTGAME\n\n\tif !network.isHost and !network.isNetwork:\n\t\tprint(\"calling!\")\n\t\tnetwork.host(network.port)\n\t\tget_node(\"HostGame\/Panel\/Waiting\").set_text(\"Waiting for player to join on port \" + str(network.port) + \"...\")\n\nfunc _on_JoinGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_JoinGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_JOINGAME\n\nfunc _on_MainMenuJG_pressed():\n\tMenu_JoinGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\tif (network.isClient):\n\t\tnetwork.disconnect()\n\nfunc _on_RandomPuzzle_pressed():\n\tvar root = get_tree().get_root()\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\troot.add_child( ResourceLoader.load( \"res:\/\/puzzleView.scn\" ).instance() )\n\troot.add_child( ResourceLoader.load( \"res:\/\/puzzle.scn\" ).instance() )\n\n\nfunc _on_Join_pressed():\n\tvar IPPanel = get_node(\"JoinGame\/Panel\/IPAddress\")\n\tvar ip = IPPanel.get_text();\n\n\tif (ip.empty()):\n\t\treturn\n\n\tif !network.isClient:\n\t\tnetwork.connectTo(ip, network.port)\n\n\nfunc _on_Editor_pressed():\n\tvar root = get_tree().get_root()\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\troot.add_child( ResourceLoader.load( \"res:\/\/editor.scn\" ).instance() )\n\n","old_contents":"# This script manages all of the GUI elements.\n# It switches between the states of the GUI allowing\n# the user to start games, edit the options or connect\n# to a multiplayer game.\n\nextends Node\n\n# network variables\nvar network\n\n# State variables.\nvar menuOn\nvar splashTween\n\n# Timers.\nvar timer\nvar initialWait = .5\nvar splashTimer = 2.0\nvar warningTimer = 5.0\n\n# GUI pieces.\nvar Splash_Team5\nvar Splash_Warning\nvar Menu_Main\nvar Menu_Chooser\nvar Menu_MP\nvar Menu_HostGame\nvar Menu_JoinGame\nvar Menu_Options\n\n# Menu state values. Used to switch between them.\nvar MENU_INIT\t\t\t= 0\nvar MENU_SPLASHTEAM5\t= 1\nvar MENU_SPLASHWARNING\t= 2\nvar MENU_MAIN\t\t\t= 3\nvar MENU_CHOOSER\t\t= 4\nvar MENU_MP\t\t\t\t= 5\nvar MENU_HOSTGAME\t\t= 6\nvar MENU_JOINGAME\t\t= 7\nvar MENU_OPTIONS\t\t= 8\n\n# Main Menu Theme\nvar samplePlayer = StreamPlayer.new()\nvar songs = [load(\"res:\/\/main_theme_antris.ogg\")]\n\n# Function to be called once for setup.\nfunc _ready():\n\t# Initial setup.\n\tmenuOn = MENU_INIT\n\ttimer = 0.0\n\tset_process( true )\n\tset_process_input( true )\n\n\t# Setup the splash fader tween.\n\tsplashTween = Tween.new()\n\tget_node( \"SplashFader\" ).add_child( splashTween )\n\tsplashTween.interpolate_method( get_node( \"SplashFader\" ), \"set_opacity\", 1.0, 0.0, 1.0, Tween.TRANS_CUBIC, Tween.EASE_IN_OUT )\n\n\t# Gather all of the menus.\n\tSplash_Team5 = get_node( \"SplashTeam5\" )\n\tSplash_Warning = get_node( \"SplashWarning\" )\n\tMenu_Main = get_node( \"MainMenu\" )\n\tMenu_Chooser = get_node( \"ChooserMenu\" )\n\tMenu_MP = get_node( \"Multiplayer\" )\n\tMenu_HostGame = get_node( \"HostGame\" )\n\tMenu_JoinGame = get_node( \"JoinGame\" )\n\tMenu_Options = get_node( \"OptionsMenu\" )\n\t\n\tGlobals.set(\"Network\", load(\"res:\/\/scripts\/Network.gd\").new())\n\tnetwork = Globals.get(\"Network\")\n\t\n\tvar scn = load(\"res:\/\/networkProxy.scn\")\n\tadd_child(scn.instance())\n\tnetwork.root = get_tree().get_root()\n\n\t# Load the config.\n\tvar config = preload( \"res:\/\/scripts\/DataManager.gd\" ).new().loadConfig()\n\t\n\tget_node(\"OptionsMenu\/Panel\/OnlineName\/LineEdit\").set_text( config.name )\n\tget_node(\"OptionsMenu\/Panel\/SoundVolume\/SoundSlider\").set_value( config.soundvolume )\n\tget_node(\"OptionsMenu\/Panel\/MusicVolume\/MusicSlider\").set_value( config.musicvolume )\n\t\n\tnetwork.port = config.portnumber\n\n\t# Main Menu Theme\n\tadd_child(samplePlayer)\n\tsamplePlayer.set_stream(songs[0])\n\tsamplePlayer.play()\n\t\n# Function to update the GUI.\nfunc _process( delta ):\n\t# Handle the initial wait.\n\tif( menuOn == MENU_INIT ):\n\t\tif( timer > initialWait ):\n\t\t\tmenuOn = MENU_SPLASHTEAM5\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiIn()\n\n\t# Handle the Team5 splash screen.\n\tif( menuOn == MENU_SPLASHTEAM5 ):\n\t\tif( timer > splashTimer ):\n\t\t\tmenuOn = MENU_SPLASHWARNING\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiOut()\n\t\t\tSplash_Warning.guiIn()\n\n\t# Handle the warning splash screen.\n\tif( menuOn == MENU_SPLASHWARNING ):\n\t\tif( timer > warningTimer ):\n\t\t\tmenuOn = MENU_MAIN\n\t\t\ttimer = 0.0\n\t\t\tSplash_Warning.guiOut()\n\t\t\tMenu_Main.guiIn()\n\t\t\tsplashTween.start()\n\n\t# Increase the timer each frame.\n\ttimer += delta\n\n# Handle the input events.\nfunc _input( ev ):\n\t# Handle skip splash screens.\n\tif( !ev.is_pressed() and ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT ):\n\t\tif( menuOn == MENU_SPLASHTEAM5 || menuOn == MENU_SPLASHWARNING ):\n\t\t\ttimer = 999.0;\n\n\t# Handle exit.\n\tif( ev.is_action( \"ui_cancel\" ) ):\n\t\texit()\n\nfunc exit():\n\tprint( \"Exiting\" )\n\tOS.get_main_loop().quit()\n\nfunc _on_Exit_pressed():\n\texit()\n\n# TODO save to ConfigFile, load this on beginning\nfunc _on_Options_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Options.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_OPTIONS\n\tget_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\").set_text(str(network.port))\n\nfunc _on_Cancel_pressed():\n\tMenu_Options.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_SaveQuit_pressed():\n\t# Save the options.\n\t\n\tvar config = { name = get_node(\"OptionsMenu\/Panel\/OnlineName\/LineEdit\").get_text()\n\t\t\t\t , soundvolume = get_node(\"OptionsMenu\/Panel\/SoundVolume\/SoundSlider\").get_value()\n\t\t\t\t , musicvolume = get_node(\"OptionsMenu\/Panel\/MusicVolume\/MusicSlider\").get_value()\n\t\t\t\t , portnumber = get_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\").get_text()\n\t\t\t\t }\n\n\tpreload( \"res:\/\/scripts\/DataManager.gd\" ).new().saveConfig( config )\n\t\n\tvar field = get_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\")\n\tnetwork.setPort(field.get_text())\n\tnetwork.setPort(field.get_text())\n\t_on_Cancel_pressed()\n\nfunc _on_SP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Chooser.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_CHOOSER\n\nfunc _on_MainMenu_pressed():\n\tMenu_Chooser.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MainMenuMP_pressed():\n\tMenu_MP.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_MP.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MP\n\nfunc _on_MainMenuHG_pressed():\n\tMenu_HostGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\tnetwork.disconnect()\n\nfunc _on_HostGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_HostGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_HOSTGAME\n\t\n\tif !network.isHost and !network.isNetwork:\n\t\tprint(\"calling!\")\n\t\tnetwork.host(network.port)\n\t\tget_node(\"HostGame\/Panel\/Waiting\").set_text(\"Waiting for player to join on port \" + str(network.port) + \"...\")\n\nfunc _on_JoinGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_JoinGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_JOINGAME\n\nfunc _on_MainMenuJG_pressed():\n\tMenu_JoinGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\tif (network.isClient):\n\t\tnetwork.disconnect()\n\nfunc _on_RandomPuzzle_pressed():\n\tvar root = get_tree().get_root()\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\troot.add_child( ResourceLoader.load( \"res:\/\/puzzleView.scn\" ).instance() )\n\n\nfunc _on_Join_pressed():\n\tvar IPPanel = get_node(\"JoinGame\/Panel\/IPAddress\")\n\tvar ip = IPPanel.get_text();\n\t\n\tif (ip.empty()):\n\t\treturn\n\t\n\tif !network.isClient:\n\t\tnetwork.connectTo(ip, network.port)\n\n\nfunc _on_Editor_pressed():\n\tvar root = get_tree().get_root()\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\troot.add_child( ResourceLoader.load( \"res:\/\/editor.scn\" ).instance() )\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"e903c47676f00318b1b544b40535acf965ce5254","subject":"missing set","message":"missing set\n","repos":"mcmartins\/francy,mcmartins\/francy,mcmartins\/francy,mcmartins\/francy","old_file":"gap\/gap\/util.gd","new_file":"gap\/gap\/util.gd","new_contents":"#############################################################################\n##\n#W util.gd FRANCY library Manuel Martins\n##\n#Y Copyright (C) 2017 Manuel Martins\n##\n#! @Chapter Francy Util\n\n\n#############################################################################\n##\n#! @Section Operations\n#! In this section we show the Francy Util Operations.\n#! Contains utility methods to handle Object printing\/viewing, Sanitizing, etc.\n\n#! @Description\n#! This method will clone a Object<\/C> and return a sanitized record, traversing all the\n#! components and sanitizing when appropriate.\n#! Sanitizing in this context means, replace everything with it's string representation \n#! that can't be converted into JSON!\n#! @Arguments IsObject\n#! @Returns rec<\/C>\nDeclareOperation(\"Sanitize\", [IsObject]);\n\n#! @Description\n#! This method will merge the properties of 2 IsFrancyObjects<\/C> into one rec<\/C>.\n#! @Arguments IsFrancyObject, IsFrancyObject\n#! @Returns rec<\/C>\nDeclareOperation(\"MergeObjects\", [IsFrancyObject, IsFrancyObject]);\n\n#! @Description\n#! This method will generate a sequential ID for use as object identifier.\n#! @Returns IsString<\/C>\nDeclareOperation(\"GenerateID\", []);\n\n#! @Description\n#! Holds the latest generated ID.\n#! @Returns IsString<\/C>\nBindGlobal(\"FrancyGeneratedID\", 0);\nMakeReadWriteGlobal( \"FrancySequentialID\" );\n","old_contents":"#############################################################################\n##\n#W util.gd FRANCY library Manuel Martins\n##\n#Y Copyright (C) 2017 Manuel Martins\n##\n#! @Chapter Francy Util\n\n\n#############################################################################\n##\n#! @Section Operations\n#! In this section we show the Francy Util Operations.\n#! Contains utility methods to handle Object printing\/viewing, Sanitizing, etc.\n\n#! @Description\n#! This method will clone a Object<\/C> and return a sanitized record, traversing all the\n#! components and sanitizing when appropriate.\n#! Sanitizing in this context means, replace everything with it's string representation \n#! that can't be converted into JSON!\n#! @Arguments IsObject\n#! @Returns rec<\/C>\nDeclareOperation(\"Sanitize\", [IsObject]);\n\n#! @Description\n#! This method will merge the properties of 2 IsFrancyObjects<\/C> into one rec<\/C>.\n#! @Arguments IsFrancyObject, IsFrancyObject\n#! @Returns rec<\/C>\nDeclareOperation(\"MergeObjects\", [IsFrancyObject, IsFrancyObject]);\n\n#! @Description\n#! This method will generate a sequential ID for use as object identifier.\n#! @Returns IsString<\/C>\nDeclareOperation(\"GenerateID\", []);\n\n#! @Description\n#! Holds the latest generated ID.\n#! @Returns IsString<\/C>\nBindGlobal(\"FrancyGeneratedID\", 0);\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"1d1f69380fa560bfea8b858088cf346565fb3fb0","subject":"better pairname assignment","message":"better pairname assignment\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Editor.gd","new_file":"src\/scripts\/Editor.gd","new_contents":"extends Spatial\n\nvar puzzle\nvar puzzleMan\nvar DataMan = preload(\"res:\/\/scripts\/DataManager.gd\")\n\nvar gridMan\nvar prevBlocks = [] # keeps track of prevous color for pairs by layer\nvar blockColors = preload(\"res:\/\/scripts\/PuzzleManager.gd\").blockColors\nvar id\n\nvar saveDir = OS.get_data_dir() + \"\/PuzzleSaves\"\n\nvar fd\nvar gui = [\n\t[\"status\", Label.new()], # plz keep me as first element, referenced as gui[0] later\n\t[\"save_pzl\", Button.new()],\n\t[\"load_pzl\", Button.new()],\n\t[\"remove_layer\", Button.new()],\n\t[\"random_layer\", Button.new()],\n\t# THESE SHOULD BE Options instead of left, label, right\n\t[\"class_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=[\"LZR\", \"WILD\", \"PAIR\", \"GOAL\"],\n\t\tvalue=\"PAIR\"\n\t}],\n\t[\"color_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=blockColors,\n\t\tvalue=\"Blue\"\n\t}],\n\t[\"action_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=[\"Add\", \"Remove\", \"Replace\"],\n\t\tvalue=\"Add\"\n\t}],\n\t[\"test_pzl\", Button.new()],\n]\nvar action_ix = gui.size() - 1 - 1\nvar color_ix = gui.size() - 1 - 2\nvar class_ix = gui.size() - 1 - 3\n\n# gross style, cannot , but clean enough\nfunc shouldAddNeighbor():\n\treturn gui[action_ix][1].value == \"Add\"\n\nfunc shouldReplaceSelf():\n\treturn gui[action_ix][1].value == \"Replace\"\n\nfunc shouldRemoveSelf():\n\treturn gui[action_ix][1].value == \"Remove\"\n\n# called in AbstractBlock to add a new block\nfunc addBlock(pos):\n\tvar curColor = gui[color_ix][1].value\n\tvar b = puzzleMan.PickledBlock.new() \\\n\t\t.setName(id) \\\n\t\t.setTextureName(curColor) \\\n\t\t.setBlockPos(pos)\n\tvar layer = puzzleMan.calcBlockLayerVec(pos)\n\tid += 1\n\n\tif layer == 0 and not gui[class_ix][1].value == \"GOAL\":\n\t\treturn\n\n\t# expand prevblocks index\n\twhile prevBlocks.size() <= layer:\n\t\tvar d = {}\n\t\tfor k in blockColors:\n\t\t\td[k] = null\n\t\tprevBlocks.append(d)\n\n\tvar pb = prevBlocks[layer][curColor]\n\n\tif pb != null:\n\t\tvar prevName = pb.toNode().name\n\t\tprint(\"PAIR \", b.name, \" \", pb.name, \" IS \", prevName)\n\t\tvar pbNode = gridMan.get_node(prevName)\n\n\t\tb.setPairName(pb.name)\n\t\tpb.setPairName(b.name)\n\t\t# readd prev\n\t\tgridMan.remove_block(pb)\n\t\tgridMan.addPickledBlock(pb)\n\t\tprevBlocks[layer][curColor] = null\n\telse:\n\t\t# TODO SUPPORT GLYPHS HERE, SET PAIRWISE GLYPH\n\t\tprevBlocks[layer][curColor] = b\n\n\tgui[0][1].set_text(getPrevBlockErrors())\n\tvar block = gridMan.addPickledBlock(b)\n\tvar v = 0.01\n\tblock.set_scale(Vector3(v,v,v))\n\tblock.scaleTweenNode(1, 0.25, Tween.TRANS_QUART).start()\n\treturn b\n\nfunc getPrevBlockErrors():\n\t# hahaha, so bad\n\tvar missing = \"STATUS: \"\n\t# check every layer\n\tfor l in range(prevBlocks.size()):\n\t\t# check every color\n\t\tfor k in prevBlocks[l].keys():\n\t\t\tvar missed = false\n\t\t\tif prevBlocks[l][k] != null:\n\t\t\t\t# one message about the current layer\n\t\t\t\tif not missed:\n\t\t\t\t\tmissing += \" L\" + str(l) + \" \"\n\t\t\t\t\tmissed = true\n\t\t\t\tmissing += k.to_upper() + \" \" # bad way of constructing strings\n\tif missing == \"\":\n\t\tmissing += \"NOMINAL\"\n\treturn missing\n\nfunc changeValue(ix, togg):\n\ttogg.value = togg.values[ix]\n\nfunc _ready():\n\t# lights!\n\tget_tree().get_root().add_child(preload( \"res:\/\/puzzleView.scn\" ).instance())\n\tpuzzle = preload( \"res:\/\/puzzle.scn\" ).instance()\n\tpuzzle.mainPuzzle = false\n\n\t# hide and disable timer\n\tpuzzle.time.on = false;\n\tpuzzle.time.val = ''\n\tprint(puzzle.time)\n\n\tpuzzle.set_as_toplevel(true)\n\tget_tree().get_root().add_child(puzzle)\n\n\tgridMan = puzzle.get_node(\"GridView\/GridMan\")\n\tid = gridMan.puzzle.shape.size()\n\n\tpuzzleMan = puzzle.puzzleMan\n\n\tset_process_input(true)\n\n\tvar theme = preload(\"res:\/\/themes\/MainTheme.thm\")\n\tfd = initLoadSaveDialog(self, get_tree(), saveDir)\n\n\tvar y = 0\n\tfor control in gui:\n\t\ty += 45\n\t\tif control[0].rfind('_toggle') > 0:\n\t\t\tvar togg = control[1]\n\t\t\tvar e = togg.optionButt\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tadd_child(e)\n\n\t\t\t# index of items needed\n\t\t\te.connect(\"item_selected\", self, \"changeValue\", [togg])\n\t\t\tfor i in range(togg.values.size()):\n\t\t\t\te.add_item(togg.values[i], i)\n\t\t\t\t# e.add_icon_item(togg.values[i], i)\n\n\t\telse:\n\t\t\tvar e = control[1]\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tif e extends Button:\n\t\t\t\te.set_text(control[0])\n\t\t\tif control[0] == 'save_pzl' :\n\t\t\t\te.connect('pressed', self, 'showSaveDialog', [fd, self])\n\t\t\tif control[0] == 'load_pzl' :\n\t\t\t\te.connect('pressed', self, 'showLoadDialog', [fd, self])\n\t\t\tif control[0] == 'status':\n\t\t\t\tcontrol[1].set_text('STATUS: NOMINAL')\n\t\t\tadd_child(e)\n\n\nfunc puzzleSave():\n\tvar f = fd.get_current_path()\n\tif f == null or f == \"\":\n\t\treturn\n\tprint(\"SAVING TO \", f)\n\tDataMan.savePuzzle( f, gridMan.puzzle )\n\nfunc puzzleLoad():\n\tvar f = fd.get_current_path()\n\tif f == null or f == \"\":\n\t\treturn\n\tprint(\"LOADING FROM \", f)\n\tprevBlocks = []\n\tgridMan.set_puzzle(DataMan.loadPuzzle( f ))\n\nstatic func showLoadDialog(fileD, parent):\n\tif fileD.is_connected(\"confirmed\", parent, \"puzzleSave\"):\n\t\tfileD.disconnect(\"confirmed\", parent, \"puzzleSave\")\n\tfileD.connect(\"confirmed\", parent, \"puzzleLoad\")\n\tfileD.set_mode(FileDialog.MODE_OPEN_FILE)\n\n\tfileD.popup_centered()\n\nstatic func showSaveDialog(fileD, parent):\n\tif fileD.is_connected(\"confirmed\", parent, \"puzzleLoad\"):\n\t\tfileD.disconnect(\"confirmed\", parent, \"puzzleLoad\")\n\tfileD.connect(\"confirmed\", parent, \"puzzleSave\")\n\tfileD.set_mode(FileDialog.MODE_SAVE_FILE)\n\n\tfileD.popup_centered()\n\nstatic func initLoadSaveDialog(parent, tree, saveDir):\n\t# setup text in the file dialog\n\tvar fileDialog = load(\"res:\/\/fileDialog.scn\").instance()\n\tfileDialog.set_title(\"Select Puzzle Filename\")\n\tfileDialog.set_access(FileDialog.ACCESS_FILESYSTEM)\n\tfileDialog.add_filter(\"*.pzl ; Anttris Puzzle\")\n\n\tDirectory.new().make_dir_recursive(saveDir)\n\tfileDialog.set_current_dir(saveDir)\n\tprint(\"Saves in \", saveDir)\n\n\t# MainTheme leaks on bottom\n\tvar dialogTheme = Theme.new()\n\tdialogTheme.copy_default_theme()\n\tfileDialog.set_theme(dialogTheme)\n\n\t# work even if game is paused\n\tfileDialog.set_pause_mode(PAUSE_MODE_PROCESS)\n\n\t# unpause if user cancels\n\tfileDialog.connect(\"popup_hide\", tree, \"set_pause\", [false])\n\tfileDialog.connect(\"hide\", tree, \"set_pause\", [false])\n\tfileDialog.connect(\"about_to_show\", tree, \"set_pause\", [true])\n\tfileDialog.hide()\n\n\tparent.add_child(fileDialog)\n\tfileDialog.set_owner(parent)\n\treturn fileDialog\n","old_contents":"extends Spatial\n\nvar puzzle\nvar puzzleMan\nvar DataMan = preload(\"res:\/\/scripts\/DataManager.gd\")\n\nvar gridMan\nvar prevBlocks = [] # keeps track of prevous color for pairs by layer\nvar blockColors = preload(\"res:\/\/scripts\/PuzzleManager.gd\").blockColors\nvar id\n\nvar saveDir = OS.get_data_dir() + \"\/PuzzleSaves\"\n\nvar fd\nvar gui = [\n\t[\"status\", Label.new()], # plz keep me as first element, referenced as gui[0] later\n\t[\"save_pzl\", Button.new()],\n\t[\"load_pzl\", Button.new()],\n\t[\"remove_layer\", Button.new()],\n\t[\"random_layer\", Button.new()],\n\t# THESE SHOULD BE Options instead of left, label, right\n\t[\"class_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=[\"LZR\", \"WILD\", \"PAIR\", \"GOAL\"],\n\t\tvalue=\"PAIR\"\n\t}],\n\t[\"color_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=blockColors,\n\t\tvalue=\"Blue\"\n\t}],\n\t[\"action_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=[\"Add\", \"Remove\", \"Replace\"],\n\t\tvalue=\"Add\"\n\t}],\n\t[\"test_pzl\", Button.new()],\n]\nvar action_ix = gui.size() - 1 - 1\nvar color_ix = gui.size() - 1 - 2\nvar class_ix = gui.size() - 1 - 3\n\n# gross style, cannot , but clean enough\nfunc shouldAddNeighbor():\n\treturn gui[action_ix][1].value == \"Add\"\n\nfunc shouldReplaceSelf():\n\treturn gui[action_ix][1].value == \"Replace\"\n\nfunc shouldRemoveSelf():\n\treturn gui[action_ix][1].value == \"Remove\"\n\n# called in AbstractBlock to add a new block\nfunc addBlock(pos):\n\tvar curColor = gui[color_ix][1].value\n\tvar b = puzzleMan.PickledBlock.new() \\\n\t\t.setName(id) \\\n\t\t.setTextureName(curColor) \\\n\t\t.setBlockPos(pos)\n\tvar layer = puzzleMan.calcBlockLayerVec(pos)\n\tid += 1\n\n\tif layer == 0 and not gui[class_ix][1].value == \"GOAL\":\n\t\treturn\n\n\t# expand prevblocks index\n\twhile prevBlocks.size() <= layer:\n\t\tvar d = {}\n\t\tfor k in blockColors:\n\t\t\td[k] = null\n\t\tprevBlocks.append(d)\n\n\tvar pb = prevBlocks[layer][curColor]\n\n\tif pb != null:\n\t\tb.setPairName(pb.name)\n\t\tgridMan.get_node(pb.toNode().name).setPairName(b.name)\n\t\tprevBlocks[layer][curColor] = null\n\telse:\n\t\t# TODO SUPPORT GLYPHS HERE, SET PAIRWISE GLYPH\n\t\tprevBlocks[layer][curColor] = b\n\n\tgui[0][1].set_text(getPrevBlockErrors())\n\tvar block = gridMan.addPickledBlock(b)\n\tvar v = 0.01\n\tblock.set_scale(Vector3(v,v,v))\n\tblock.scaleTweenNode(1, 0.25, Tween.TRANS_QUART).start()\n\treturn b\n\nfunc getPrevBlockErrors():\n\t# hahaha, so bad\n\tvar missing = \"STATUS: \"\n\t# check every layer\n\tfor l in range(prevBlocks.size()):\n\t\t# check every color\n\t\tfor k in prevBlocks[l].keys():\n\t\t\tvar missed = false\n\t\t\tif prevBlocks[l][k] != null:\n\t\t\t\t# one message about the current layer\n\t\t\t\tif not missed:\n\t\t\t\t\tmissing += \" L\" + str(l) + \" \"\n\t\t\t\t\tmissed = true\n\t\t\t\tmissing += k.to_upper() + \" \" # bad way of constructing strings\n\tif missing == \"\":\n\t\tmissing += \"NOMINAL\"\n\treturn missing\n\nfunc changeValue(ix, togg):\n\ttogg.value = togg.values[ix]\n\nfunc _ready():\n\t# lights!\n\tget_tree().get_root().add_child(preload( \"res:\/\/puzzleView.scn\" ).instance())\n\tpuzzle = preload( \"res:\/\/puzzle.scn\" ).instance()\n\tpuzzle.mainPuzzle = false\n\n\t# hide and disable timer\n\tpuzzle.time.on = false;\n\tpuzzle.time.val = ''\n\tprint(puzzle.time)\n\n\tpuzzle.set_as_toplevel(true)\n\tget_tree().get_root().add_child(puzzle)\n\n\tgridMan = puzzle.get_node(\"GridView\/GridMan\")\n\tid = gridMan.puzzle.shape.size()\n\n\tpuzzleMan = puzzle.puzzleMan\n\n\tset_process_input(true)\n\n\tvar theme = preload(\"res:\/\/themes\/MainTheme.thm\")\n\tfd = initLoadSaveDialog(self, get_tree(), saveDir)\n\n\tvar y = 0\n\tfor control in gui:\n\t\ty += 45\n\t\tif control[0].rfind('_toggle') > 0:\n\t\t\tvar togg = control[1]\n\t\t\tvar e = togg.optionButt\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tadd_child(e)\n\n\t\t\t# index of items needed\n\t\t\te.connect(\"item_selected\", self, \"changeValue\", [togg])\n\t\t\tfor i in range(togg.values.size()):\n\t\t\t\te.add_item(togg.values[i], i)\n\t\t\t\t# e.add_icon_item(togg.values[i], i)\n\n\t\telse:\n\t\t\tvar e = control[1]\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tif e extends Button:\n\t\t\t\te.set_text(control[0])\n\t\t\tif control[0] == 'save_pzl' :\n\t\t\t\te.connect('pressed', self, 'showSaveDialog', [fd, self])\n\t\t\tif control[0] == 'load_pzl' :\n\t\t\t\te.connect('pressed', self, 'showLoadDialog', [fd, self])\n\t\t\tif control[0] == 'status':\n\t\t\t\tcontrol[1].set_text('STATUS: NOMINAL')\n\t\t\tadd_child(e)\n\n\nfunc puzzleSave():\n\tvar f = fd.get_current_path()\n\tif f == null or f == \"\":\n\t\treturn\n\tprint(\"SAVING TO \", f)\n\tDataMan.savePuzzle( f, gridMan.puzzle )\n\nfunc puzzleLoad():\n\tvar f = fd.get_current_path()\n\tif f == null or f == \"\":\n\t\treturn\n\tprint(\"LOADING FROM \", f)\n\tprevBlocks = []\n\tgridMan.set_puzzle(DataMan.loadPuzzle( f ))\n\nstatic func showLoadDialog(fileD, parent):\n\tif fileD.is_connected(\"confirmed\", parent, \"puzzleSave\"):\n\t\tfileD.disconnect(\"confirmed\", parent, \"puzzleSave\")\n\tfileD.connect(\"confirmed\", parent, \"puzzleLoad\")\n\tfileD.set_mode(FileDialog.MODE_OPEN_FILE)\n\n\tfileD.popup_centered()\n\nstatic func showSaveDialog(fileD, parent):\n\tif fileD.is_connected(\"confirmed\", parent, \"puzzleLoad\"):\n\t\tfileD.disconnect(\"confirmed\", parent, \"puzzleLoad\")\n\tfileD.connect(\"confirmed\", parent, \"puzzleSave\")\n\tfileD.set_mode(FileDialog.MODE_SAVE_FILE)\n\n\tfileD.popup_centered()\n\nstatic func initLoadSaveDialog(parent, tree, saveDir):\n\t# setup text in the file dialog\n\tvar fileDialog = load(\"res:\/\/fileDialog.scn\").instance()\n\tfileDialog.set_title(\"Select Puzzle Filename\")\n\tfileDialog.set_access(FileDialog.ACCESS_FILESYSTEM)\n\tfileDialog.add_filter(\"*.pzl ; Anttris Puzzle\")\n\n\tDirectory.new().make_dir_recursive(saveDir)\n\tfileDialog.set_current_dir(saveDir)\n\tprint(\"Saves in \", saveDir)\n\n\t# MainTheme leaks on bottom\n\tvar dialogTheme = Theme.new()\n\tdialogTheme.copy_default_theme()\n\tfileDialog.set_theme(dialogTheme)\n\n\t# work even if game is paused\n\tfileDialog.set_pause_mode(PAUSE_MODE_PROCESS)\n\n\t# unpause if user cancels\n\tfileDialog.connect(\"popup_hide\", tree, \"set_pause\", [false])\n\tfileDialog.connect(\"hide\", tree, \"set_pause\", [false])\n\tfileDialog.connect(\"about_to_show\", tree, \"set_pause\", [true])\n\tfileDialog.hide()\n\n\tparent.add_child(fileDialog)\n\tfileDialog.set_owner(parent)\n\treturn fileDialog\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"67f1491d049e5b74119716f7ade47eb942a6abb9","subject":"Boss appearance effect (Scales up)","message":"Boss appearance effect (Scales up)\n","repos":"BK-TN\/IncendiumGame","old_file":"incendium\/scripts\/BossPart.gd","new_file":"incendium\/scripts\/BossPart.gd","new_contents":"\nextends Node2D\n\n# Set by Boss\nvar enabled\nvar rot_speed\nvar color\nvar max_health\nvar bullet_size\nvar bullet_count\nvar bullet_speed\nvar shoot_interval\n# Health\nvar health\nvar health_fade = 0.0\n# Shooting\nvar bullet = preload(\"res:\/\/objects\/Bullet.tscn\")\nvar shoot_timer = 1\n# Misc\nvar last_pos\nvar velocity\nvar explosion = preload(\"res:\/\/objects\/Explosion.tscn\")\nvar scale = 0\n\nfunc _ready():\n\t# Called every time the node is added to the scene.\n\t# Initialization here\n\tset_process(true)\n\tif enabled:\n\t\tget_node(\"RegularPolygon\/Polygon2D\").set_color(color)\n\telse:\n\t\tget_node(\"RegularPolygon\/Polygon2D\").set_color(Color(0,0,0,0))\n\thealth = max_health\n\tlast_pos = get_global_pos()\n\t\nfunc _process(delta):\n\trotate(delta * rot_speed)\n\t\n\tif scale < 1:\n\t\tscale = min(1,lerp(scale,1,delta * 5))\n\t\tset_scale(Vector2(scale * scale, scale * scale))\n\t\n\tif health_fade > 0:\n\t\thealth_fade -= delta * 4\n\t\tif (health_fade < 0): health_fade = 0\n\t\tupdate()\n\t\n\tvelocity = get_global_pos() - last_pos\n\tlast_pos = get_global_pos()\n\t\n\tvar pos = get_global_pos()\n\t\n\tif enabled:\n\t\tshoot_timer -= delta\n\t\n\tif shoot_timer <= 0 and !any_active_child_parts():\n\t\tfor i in range(0,bullet_count):\n\t\t\tvar bullet_instance = bullet.instance()\n\t\t\t\n\t\t\t# Calculate bullet direction\n\t\t\tvar velocityAngle\n\t\t\tif velocity.x == 0 and velocity.y == 0:\n\t\t\t\t# Use rotation if no velocity\n\t\t\t\tvelocityAngle = get_rot() * 3\n\t\t\telse:\n\t\t\t\tvelocityAngle = atan2(velocity.y,velocity.x)\n\t\t\tvelocityAngle += (i \/ float(bullet_count)) * PI * 2\n\t\t\tvar bulletVelocity = Vector2(cos(velocityAngle),sin(velocityAngle)).normalized() * (bullet_speed)\n\t\t\t\n\t\t\tbullet_instance.velocity = bulletVelocity\n\t\t\tbullet_instance.get_node(\"RegularPolygon\/Polygon2D\").set_color(Color(1,1,1).linear_interpolate(color,0.4))\n\t\t\tbullet_instance.get_node(\"RegularPolygon\").size = bullet_size\n\t\t\tbullet_instance.get_node(\"RegularPolygon\").remove_from_group(\"damage_enemy\")\n\t\t\tbullet_instance.get_node(\"RegularPolygon\").add_to_group(\"damage_player\")\n\t\t\tbullet_instance.set_pos(get_global_pos())\n\t\t\tget_tree().get_root().add_child(bullet_instance)\n\t\t\t# var angle_towards_center = atan2(pos.x - 720\/2, pos.y - 720\/2)\n\t\t\tshoot_timer = shoot_interval # + (angle_towards_center * 0.4)\n\t\nfunc _on_RegularPolygon_area_enter(area):\n\tif area.get_groups().has(\"damage_enemy\") and !any_active_child_parts() and enabled:\n\t\tarea.get_parent().queue_free()\n\t\thealth -= 1\n\t\thealth_fade = 1.0\n\t\tif health <= 0:\n\t\t\tfor i in range(0,8):\n\t\t\t\tvar explosion_instance = explosion.instance()\n\t\t\t\texplosion_instance.get_node(\"RegularPolygon\").size = get_node(\"RegularPolygon\").size \/ 2\n\t\t\t\texplosion_instance.get_node(\"RegularPolygon\/Polygon2D\").set_color(color)\n\t\t\t\texplosion_instance.velocity = velocity * 100\n\t\t\t\tget_tree().get_root().add_child(explosion_instance)\n\t\t\t\texplosion_instance.set_global_pos(get_global_pos())\n\t\t\tqueue_free()\n\nfunc any_active_child_parts():\n\tfor child in get_children():\n\t\tif child.get(\"enabled\") == true:\n\t\t\treturn true\n\t\tif child.get(\"enabled\") == false:\n\t\t\tif child.any_active_child_parts():\n\t\t\t\treturn true\n\treturn false\n\nfunc _draw():\n\tif health_fade > 0:\n\t\tvar pgon = Vector2Array(get_node(\"RegularPolygon\/Polygon2D\").get_polygon())\n\t\tvar colors = Array()\n\t\tfor i in range(0,pgon.size()):\n\t\t\tpgon[i] = pgon[i] * (1.0 - float(health) \/ max_health)\n\t\t\tcolors.append(Color(1,1,1,health_fade))\n\t\tdraw_polygon(pgon,colors)","old_contents":"\nextends Node2D\n\n# Set by Boss\nvar enabled\nvar rot_speed\nvar color\nvar max_health\nvar bullet_size\nvar bullet_count\nvar bullet_speed\nvar shoot_interval\n# Health\nvar health\nvar health_fade = 0.0\n# Shooting\nvar bullet = preload(\"res:\/\/objects\/Bullet.tscn\")\nvar shoot_timer = 1\n# Misc\nvar last_pos\nvar velocity\nvar explosion = preload(\"res:\/\/objects\/Explosion.tscn\")\n\nfunc _ready():\n\t# Called every time the node is added to the scene.\n\t# Initialization here\n\tset_process(true)\n\tif enabled:\n\t\tget_node(\"RegularPolygon\/Polygon2D\").set_color(color)\n\telse:\n\t\tget_node(\"RegularPolygon\/Polygon2D\").set_color(Color(0,0,0,0))\n\thealth = max_health\n\tlast_pos = get_global_pos()\n\t\nfunc _process(delta):\n\trotate(delta * rot_speed)\n\t\n\tif (health_fade > 0):\n\t\thealth_fade -= delta * 4\n\t\tif (health_fade < 0): health_fade = 0\n\t\tupdate()\n\t\n\tvelocity = get_global_pos() - last_pos\n\tlast_pos = get_global_pos()\n\t\n\tvar pos = get_global_pos()\n\t\n\tif enabled:\n\t\tshoot_timer -= delta\n\t\n\tif shoot_timer <= 0 and !any_active_child_parts():\n\t\tfor i in range(0,bullet_count):\n\t\t\tvar bullet_instance = bullet.instance()\n\t\t\t\n\t\t\t# Calculate bullet direction\n\t\t\tvar velocityAngle\n\t\t\tif velocity.x == 0 and velocity.y == 0:\n\t\t\t\t# Use rotation if no velocity\n\t\t\t\tvelocityAngle = get_rot() * 3\n\t\t\telse:\n\t\t\t\tvelocityAngle = atan2(velocity.y,velocity.x)\n\t\t\tvelocityAngle += (i \/ float(bullet_count)) * PI * 2\n\t\t\tvar bulletVelocity = Vector2(cos(velocityAngle),sin(velocityAngle)).normalized() * (bullet_speed)\n\t\t\t\n\t\t\tbullet_instance.velocity = bulletVelocity\n\t\t\tbullet_instance.get_node(\"RegularPolygon\/Polygon2D\").set_color(Color(1,1,1).linear_interpolate(color,0.4))\n\t\t\tbullet_instance.get_node(\"RegularPolygon\").size = bullet_size\n\t\t\tbullet_instance.get_node(\"RegularPolygon\").remove_from_group(\"damage_enemy\")\n\t\t\tbullet_instance.get_node(\"RegularPolygon\").add_to_group(\"damage_player\")\n\t\t\tbullet_instance.set_pos(get_global_pos())\n\t\t\tget_tree().get_root().add_child(bullet_instance)\n\t\t\t# var angle_towards_center = atan2(pos.x - 720\/2, pos.y - 720\/2)\n\t\t\tshoot_timer = shoot_interval # + (angle_towards_center * 0.4)\n\t\nfunc _on_RegularPolygon_area_enter(area):\n\tif area.get_groups().has(\"damage_enemy\") and !any_active_child_parts() and enabled:\n\t\tarea.get_parent().queue_free()\n\t\thealth -= 1\n\t\thealth_fade = 1.0\n\t\tif health <= 0:\n\t\t\tfor i in range(0,8):\n\t\t\t\tvar explosion_instance = explosion.instance()\n\t\t\t\texplosion_instance.get_node(\"RegularPolygon\").size = get_node(\"RegularPolygon\").size \/ 2\n\t\t\t\texplosion_instance.get_node(\"RegularPolygon\/Polygon2D\").set_color(color)\n\t\t\t\texplosion_instance.velocity = velocity * 100\n\t\t\t\tget_tree().get_root().add_child(explosion_instance)\n\t\t\t\texplosion_instance.set_global_pos(get_global_pos())\n\t\t\tqueue_free()\n\nfunc any_active_child_parts():\n\tfor child in get_children():\n\t\tif child.get(\"enabled\") == true:\n\t\t\treturn true\n\t\tif child.get(\"enabled\") == false:\n\t\t\tif child.any_active_child_parts():\n\t\t\t\treturn true\n\treturn false\n\nfunc _draw():\n\tif health_fade > 0:\n\t\tvar pgon = Vector2Array(get_node(\"RegularPolygon\/Polygon2D\").get_polygon())\n\t\tvar colors = Array()\n\t\tfor i in range(0,pgon.size()):\n\t\t\tpgon[i] = pgon[i] * (1.0 - float(health) \/ max_health)\n\t\t\tcolors.append(Color(1,1,1,health_fade))\n\t\tdraw_polygon(pgon,colors)","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"56d7e0f38caa5526e09e76cdf34b7f821e594e1c","subject":"Remove debug print","message":"Remove debug print\n","repos":"vnen\/xna-rpg-godot,vnen\/xna-rpg-godot","old_file":"project\/menus\/main_menu.gd","new_file":"project\/menus\/main_menu.gd","new_contents":"# The MIT License (MIT)\n#\n# Copyright (c) 2016 George Marques\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in all\n# copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n# SOFTWARE.\n\nextends TextureFrame\n\nfunc _ready():\n\tget_node(\"Buttons\/NewGameButton\").call_deferred(\"grab_focus\")\n\tset_process_unhandled_input(true)\n\nfunc _unhandled_input(event):\n\tif event.is_pressed() and not event.is_echo() and event.is_action(\"ui_cancel\"):\n\t\taccept_event()\n\t\t_on_ExitButton_pressed()\n\nfunc _on_button_focused(description):\n\tget_node(\"DescriptionText\").set_text(description)\n\n# Button routines\n\nfunc _on_NewGameButton_pressed():\n\tvar loading_screen = load(\"res:\/\/menus\/loading_screen.tscn\").instance()\n\tadd_child(loading_screen)\n\tloading_screen.connect(\"exit_tree\", get_node(\"Buttons\/NewGameButton\"), \"grab_focus\")\n\nfunc _on_SaveGameButton_pressed():\n\tvar save_screen = load(\"res:\/\/menus\/save_load_screen.tscn\").instance()\n\tadd_child(save_screen)\n\tsave_screen.get_node(\"TitlePlank\/TitleText\").set_text(\"Save\")\n\tsave_screen.connect(\"exit_tree\", get_node(\"Buttons\/SaveGameButton\"), \"grab_focus\")\n\nfunc _on_LoadGameButton_pressed():\n\tvar load_screen = load(\"res:\/\/menus\/save_load_screen.tscn\").instance()\n\tadd_child(load_screen)\n\tload_screen.connect(\"exit_tree\", get_node(\"Buttons\/LoadGameButton\"), \"grab_focus\")\n\nfunc _on_ControlsButton_pressed():\n\tvar controls_screen = load(\"res:\/\/menus\/controls_screen.tscn\").instance()\n\tadd_child(controls_screen)\n\tcontrols_screen.connect(\"exit_tree\", get_node(\"Buttons\/ControlsButton\"), \"grab_focus\")\n\nfunc _on_HelpButton_pressed():\n\tvar help_screen = load(\"res:\/\/menus\/help_screen.tscn\").instance()\n\tadd_child(help_screen)\n\thelp_screen.connect(\"exit_tree\", get_node(\"Buttons\/HelpButton\"), \"grab_focus\")\n\nfunc _on_ExitButton_pressed():\n\tvar message_box = get_node(\"MessageBox\")\n\tmessage_box.popup()\n\tmessage_box.grab_focus()\n\n# Message Box\n\nfunc _on_MessageBox_canceled():\n\tget_node(\"MessageBox\").hide()\n\nfunc _on_MessageBox_confirmed():\n\tget_tree().quit()\n","old_contents":"# The MIT License (MIT)\n#\n# Copyright (c) 2016 George Marques\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in all\n# copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n# SOFTWARE.\n\nextends TextureFrame\n\nfunc _ready():\n\tget_node(\"Buttons\/NewGameButton\").call_deferred(\"grab_focus\")\n\tset_process_unhandled_input(true)\n\nfunc _unhandled_input(event):\n\tif event.is_pressed() and not event.is_echo() and event.is_action(\"ui_cancel\"):\n\t\taccept_event()\n\t\tprint(\"evet\")\n\t\t_on_ExitButton_pressed()\n\nfunc _on_button_focused(description):\n\tget_node(\"DescriptionText\").set_text(description)\n\n# Button routines\n\nfunc _on_NewGameButton_pressed():\n\tvar loading_screen = load(\"res:\/\/menus\/loading_screen.tscn\").instance()\n\tadd_child(loading_screen)\n\tloading_screen.connect(\"exit_tree\", get_node(\"Buttons\/NewGameButton\"), \"grab_focus\")\n\nfunc _on_SaveGameButton_pressed():\n\tvar save_screen = load(\"res:\/\/menus\/save_load_screen.tscn\").instance()\n\tadd_child(save_screen)\n\tsave_screen.get_node(\"TitlePlank\/TitleText\").set_text(\"Save\")\n\tsave_screen.connect(\"exit_tree\", get_node(\"Buttons\/SaveGameButton\"), \"grab_focus\")\n\nfunc _on_LoadGameButton_pressed():\n\tvar load_screen = load(\"res:\/\/menus\/save_load_screen.tscn\").instance()\n\tadd_child(load_screen)\n\tload_screen.connect(\"exit_tree\", get_node(\"Buttons\/LoadGameButton\"), \"grab_focus\")\n\nfunc _on_ControlsButton_pressed():\n\tvar controls_screen = load(\"res:\/\/menus\/controls_screen.tscn\").instance()\n\tadd_child(controls_screen)\n\tcontrols_screen.connect(\"exit_tree\", get_node(\"Buttons\/ControlsButton\"), \"grab_focus\")\n\nfunc _on_HelpButton_pressed():\n\tvar help_screen = load(\"res:\/\/menus\/help_screen.tscn\").instance()\n\tadd_child(help_screen)\n\thelp_screen.connect(\"exit_tree\", get_node(\"Buttons\/HelpButton\"), \"grab_focus\")\n\nfunc _on_ExitButton_pressed():\n\tvar message_box = get_node(\"MessageBox\")\n\tmessage_box.popup()\n\tmessage_box.grab_focus()\n\n# Message Box\n\nfunc _on_MessageBox_canceled():\n\tget_node(\"MessageBox\").hide()\n\nfunc _on_MessageBox_confirmed():\n\tget_tree().quit()\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"a5349bfee2f18a7db96729a194815dc592985d0f","subject":"moved camera setup to function. camera setup more robust. use puzzle.shape instead of copying","message":"moved camera setup to function. camera setup more robust. use puzzle.shape instead of copying\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/GridMan.gd","new_file":"src\/scripts\/GridMan.gd","new_contents":"extends Spatial\n\n# Is there a better way to do this?\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\n# Shape dictionary to access blocks quickly by position.\nvar puzzle.shape = {}\n\n# Block selection handling.\nvar offClick = false\nvar selectedBlocks = []\n\n# Puzzle vars.\nvar puzzle\nvar puzzleLoaded = false\n\n# Beam stuff.\nconst beamScn = preload( \"res:\/\/blocks\/block.scn\" )\nconst Beam = preload(\"res:\/\/scripts\/Blocks\/Beam.gd\")\n\n# sounds\nvar samplePlayer = SamplePlayer.new()\n\nfunc addPickledBlock(block):\n\tvar b = block.toNode()\n\n\tpuzzle.shape[b.blockPos] = b\n\n\t# TODO any special treatment for the wild blocks?\n\t# TODO keep track of puzzle.lasers ? How to?\n\n\tif puzzleLoaded:\n\t\t# keep pickled block\n\t\tpuzzle.blocks.append(block)\n\n\t\t# keep track of puzzle.pairCounts\n\t\tvar layer = calcBlockLayerVec(b.blockPos)\n\t\tif b.getBlockType() == 2:\n\t\t\twhile puzzle.pairCount.size() <= layer:\n\t\t\t\tpuzzle.pairCount.append(0)\n\t\t\tpuzzle.pairCount[layer] += 0.5\n\n\n\tadd_child(b)\n\treturn b\n\nfunc get_block(pos):\n\tif puzzle.shape.has(pos):\n\t\treturn puzzle.shape[pos]\n\telse:\n\t\treturn null\n\n# unused key argument needed for the tween_complete signal\nfunc remove_block(block_node, key=null):\n\tif block_node == null:\n\t\treturn\n\n\t# need better way\n\tfor i in range(puzzle.blocks.size()):\n\t\tif block_node.blockPos == puzzle.blocks[i].blockPos:\n\t\t\tpuzzle.blocks.remove(i)\n\n\tpuzzle.shape[block_node.blockPos] = null\n\tfor child in block_node.get_children():\n\t\tblock_node.remove_and_delete_child(child)\n\tremove_and_delete_child(block_node)\n\n# Sets the puzzle for this GridMan.\nfunc set_puzzle(puzz):\n\t# verify puzzle\n\tif puzz == null:\n\t\tprint(\"INVALID PUZZLE\")\n\t\treturn\n\n\t# delete all current nodes\n\tfor pos in puzzle.shape:\n\t\tremove_block(puzzle.shape[pos])\n\tpuzzleLoaded = false\n\n\t# Store the puzzle.\n\tpuzzle = puzz\n\n\t\t# # I can do my own counting!\n\t# needed for adding blocks in the editor\n\tfor block in puzzle.blocks:\n\t\t# Create a block node, add it to the tree\n\t\taddPickledBlock(block)\n\tpuzzleLoaded = true\n\n# Clears any selected blocks. WE SHOULD FIX THIS, THERE CAN ONLY BE ONE BLOCK SELECTED AT ANY ONE TIME, NO NEED FOR AN ARRAY!\nfunc clearSelection():\n\tfor bl in selectedBlocks:\n\t\tvar blo = get_node( bl )\n\t\tblo.setSelected(false)\n\t\tblo.scaleTweenNode(1.0).start()\n\tselectedBlocks = []\n\n# Add the selected block to the selected list. WE SHOULD FIX THIS, IT ONLY NEEDS TO STORE IT, NOT AN ARRAY!\nfunc addSelected(bl):\n\tselectedBlocks.append(bl)\n\n# Used for the multiplayer mode to force click a block on their side.\nfunc forceClickBlock( pos ):\n\tpuzzle.shape[pos].forceClick()\n\nfunc clickBlock( name ):\n\t#now check if that was the second block we picked. If it was, we want to\n\t#unselect the blocks again\n\tif (offClick):\n\t\toffClick = false\n\t\taddSelected(name)\n\t\tclearSelection()\n\telse:\n\t\toffClick = true;\n\t\taddSelected(name)\n\n# Calculates the layer that a block is on.\n# COPY OF FUNCTION IN PUZZLEMAN, IS THERE A BETTER WAY TO DO THIS?!\nfunc calcBlockLayer( x, y, z ):\n\treturn max( max( abs( x ), abs( y ) ), abs( z ) )\nfunc calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n# Handles keeping track of pairs being removed.\nfunc popPair( pos ):\n\tvar blayer = calcBlockLayerVec( pos )\n\tpuzzle.pairCount[blayer] -= 1\n\n\tif( puzzle.pairCount[blayer] == 0 ):\n\t\tprint(\"LAYER CLEARED\")\n\t\tif blayer == 1:\n\t\t\tprint( \"GAME OVER!\" )\n\t\t\tvar pauseMenu = get_tree().get_root().get_node( \"Spatial\" ).get_node( \"Camera\" ).pauseMenu\n\t\t\tpauseMenu.set_text(\"GAME OVER\\nSCORE:1,000,000\")\n\t\t\t# TODO set timeout!!!\n\t\t\tpauseMenu.popup_centered()\n\n\t\tfor b in puzzle.shape:\n\t\t\tif not ( puzzle.shape[b] == null ):\n\t\t\t\tif calcBlockLayerVec( b ) == blayer:\n\t\t\t\t\tif puzzle.shape[b].getBlockType() == BLOCK_LASER:\n\t\t\t\t\t\tpuzzle.shape[b].forceActivate()\n\n\t\t# Fire beams.\n\t\tvar beamNum = 0\n\t\tfor l in range( puzzle.lasers.size() ):\n\t\t\tif calcBlockLayerVec( puzzle.lasers[l][0] ) == blayer:\n\t\t\t\t# Firin mah lazerz!\n\t\t\t\tvar beam = beamScn.instance()\n\n\t\t\t\tbeam.set_name( str(blayer) + \"_beam_\" + str(beamNum) )\n\t\t\t\tbeamNum += 1\n\t\t\t\tbeam.set_script( Beam )\n\n\t\t\t\tadd_child( beam )\n\t\t\t\tbeam.fire( puzzle.lasers[l][0], puzzle.lasers[l][1] )\n\n\t\t\t\tsamplePlayer.play( \"soundslikewillem_hitting_slinky\" )\n\n\nfunc _init():\n\t# Load sound\n\tsamplePlayer.set_voice_count(10)\n\tsamplePlayer.set_sample_library(ResourceLoader.load(\"new_samplelibrary.xml\"))\n\tprint(\"GridMan initialized\")\n\nfunc _ready():\n\tsetupCam()\n\nfunc setupCam():\n\tvar cam = get_tree().get_root().get_node( \"Spatial\/Camera\" )\n\tif cam == null or puzzle == null:\n\t\treturn\n\tvar totalSize = ( puzzle.puzzleLayers * 2 + 1 )\n\tcam.distance.val = 4.5 * totalSize\n\tcam.distance.min_ = 3 * totalSize\n\tcam.distance.max_ = 10 * totalSize\n\tcam.recalculate_camera()\n\n\n","old_contents":"extends Spatial\n\n# Is there a better way to do this?\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\n# Shape dictionary to access blocks quickly by position.\nvar shape = {}\n\n# Block selection handling.\nvar offClick = false\nvar selectedBlocks = []\n\n# Puzzle vars.\nvar puzzle\nvar puzzleLoaded = false\n\n# Beam stuff.\nconst beamScn = preload( \"res:\/\/blocks\/block.scn\" )\nconst Beam = preload(\"res:\/\/scripts\/Blocks\/Beam.gd\")\n\n# sounds\nvar samplePlayer = SamplePlayer.new()\n\nfunc addPickledBlock(block):\n\t# TODO add to puzzle\n\tvar b = block.toNode()\n\n\tprint (\"ADDED\")\n\tshape[b.blockPos] = b\n\n\t# TODO any special treatment for the wild blocks?\n\t# TODO keep track of puzzle.lasers ? How to?\n\n\tif puzzleLoaded:\n\t\t# keep pickled block\n\t\tpuzzle.blocks.append(block)\n\n\t\t# keep track of puzzle.pairCounts\n\t\tvar layer = calcBlockLayerVec(b.blockPos)\n\t\tif b.getBlockType() == 2:\n\t\t\twhile puzzle.pairCount.size() <= layer:\n\t\t\t\tpuzzle.pairCount.append(0)\n\t\t\tpuzzle.pairCount[layer] += 0.5\n\n\n\tadd_child(b)\n\treturn b\n\nfunc get_block(pos):\n\tif shape.has(pos):\n\t\treturn shape[pos]\n\telse:\n\t\treturn null\n\n# unused key argument needed for the tween_complete signal\nfunc remove_block(block_node, key=null):\n\tif block_node == null:\n\t\treturn\n\tprint (\"REMOVED\")\n\n\tshape[block_node.blockPos] = null\n\tfor child in block_node.get_children():\n\t\tblock_node.remove_and_delete_child(child)\n\tremove_and_delete_child(block_node)\n\n# Sets the puzzle for this GridMan.\nfunc set_puzzle(puzz):\n\t# delete all current nodes\n\tfor pos in shape:\n\t\tremove_block(shape[pos])\n\tpuzzleLoaded = false\n\n\t# Store the puzzle.\n\tpuzzle = puzz\n\n\t# Set the camera range to be relative to the layer count.\n\tvar cam = get_tree().get_root().get_node( \"Spatial\" ).get_node( \"Camera\" )\n\tprint( cam )\n\tvar totalSize = ( puzzle.puzzleLayers * 2 + 1 )\n\tcam.distance.val = 4.5 * totalSize\n\tcam.distance.min_ = 3 * totalSize\n\tcam.distance.max_ = 10 * totalSize\n\tcam.recalculate_camera()\n\n\t\t# # I can do my own counting!\n\t# needed for adding blocks in the editor\n\tfor block in puzzle.blocks:\n\t\t# Create a block node, add it to the tree\n\t\taddPickledBlock(block)\n\tpuzzleLoaded = true\n\n# Clears any selected blocks. WE SHOULD FIX THIS, THERE CAN ONLY BE ONE BLOCK SELECTED AT ANY ONE TIME, NO NEED FOR AN ARRAY!\nfunc clearSelection():\n\tfor bl in selectedBlocks:\n\t\tvar blo = get_node( bl )\n\t\tblo.setSelected(false)\n\t\tblo.scaleTweenNode(1.0).start()\n\tselectedBlocks = []\n\n# Add the selected block to the selected list. WE SHOULD FIX THIS, IT ONLY NEEDS TO STORE IT, NOT AN ARRAY!\nfunc addSelected(bl):\n\tselectedBlocks.append(bl)\n\n# Used for the multiplayer mode to force click a block on their side.\nfunc forceClickBlock( pos ):\n\tshape[pos].forceClick()\n\nfunc clickBlock( name ):\n\t#now check if that was the second block we picked. If it was, we want to\n\t#unselect the blocks again\n\tif (offClick):\n\t\toffClick = false\n\t\taddSelected(name)\n\t\tclearSelection()\n\telse:\n\t\toffClick = true;\n\t\taddSelected(name)\n\n# Calculates the layer that a block is on.\n# COPY OF FUNCTION IN PUZZLEMAN, IS THERE A BETTER WAY TO DO THIS?!\nfunc calcBlockLayer( x, y, z ):\n\treturn max( max( abs( x ), abs( y ) ), abs( z ) )\nfunc calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n# Handles keeping track of pairs being removed.\nfunc popPair( pos ):\n\tvar blayer = calcBlockLayerVec( pos )\n\tpuzzle.pairCount[blayer] -= 1\n\n\tif( puzzle.pairCount[blayer] == 0 ):\n\t\tprint(\"LAYER CLEARED\")\n\t\tif blayer == 1:\n\t\t\tprint( \"GAME OVER!\" )\n\t\t\tvar pauseMenu = get_tree().get_root().get_node( \"Spatial\" ).get_node( \"Camera\" ).pauseMenu\n\t\t\tpauseMenu.set_text(\"GAME OVER\\nSCORE:1,000,000\")\n\t\t\t# TODO set timeout!!!\n\t\t\tpauseMenu.popup_centered()\n\n\t\tfor b in shape:\n\t\t\tif not ( shape[b] == null ):\n\t\t\t\tif calcBlockLayerVec( b ) == blayer:\n\t\t\t\t\tif shape[b].getBlockType() == BLOCK_LASER:\n\t\t\t\t\t\tshape[b].forceActivate()\n\n\t\t# Fire beams.\n\t\tvar beamNum = 0\n\t\tfor l in range( puzzle.lasers.size() ):\n\t\t\tif calcBlockLayerVec( puzzle.lasers[l][0] ) == blayer:\n\t\t\t\t# Firin mah lazerz!\n\t\t\t\tvar beam = beamScn.instance()\n\n\t\t\t\tbeam.set_name( str(blayer) + \"_beam_\" + str(beamNum) )\n\t\t\t\tbeamNum += 1\n\t\t\t\tbeam.set_script( Beam )\n\n\t\t\t\tadd_child( beam )\n\t\t\t\tbeam.fire( puzzle.lasers[l][0], puzzle.lasers[l][1] )\n\n\t\t\t\tsamplePlayer.play( \"soundslikewillem_hitting_slinky\" )\n\n\nfunc _init():\n\t# Load sound\n\tsamplePlayer.set_voice_count(10)\n\tsamplePlayer.set_sample_library(ResourceLoader.load(\"new_samplelibrary.xml\"))\n\tprint(\"GridMan initialized\")\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"691143862592e7638d1f890702ddf0ccf9d91869","subject":"Adjusts expected name for animation including disallowed animation name chars.","message":"Adjusts expected name for animation including disallowed animation name chars.\n","repos":"godotengine\/godot-tests,godotengine\/godot-tests","old_file":"tests\/blend_export\/test_45545.gd","new_file":"tests\/blend_export\/test_45545.gd","new_contents":"extends ColorRect\n\nconst GOLDEN_GLTF_SCENE: PackedScene = preload(\"res:\/\/gltf\/45545-relax-name-sanitization.gltf\")\n\n## These constants are the prefix part of the node names used in the golden glTF file.\n# Prefix for \"basic\" nodes, no import hints, no animation, etc...\nconst GLTF_PREFIX_BASIC: String = \"Basic_\"\n\n# Prefix for nodes that have an import hint.\nconst GLTF_PREFIX_HINTED: String = \"Hinted_\"\n\n# Prefix for nodes that have an associated animation.\nconst GLTF_PREFIX_ANIMATED: String = \"Animated_\"\n\n# The suffix for animations (all animations in the golden glTF file use the Blender default suffix\n# \"Action\" and the looping import hint \"-loop\".\nconst GLTF_SUFFIX_ANIMATION: String = \"Action-loop\"\n\n## These constants are the infix part of the node names used in the golden glTF file.\nconst GLTF_ALPHANUMERIC: String = \"Alphanumeric123\"\n# The last three symbols are:\n# https:\/\/en.wiktionary.org\/wiki\/%E3%82%B4#Japanese\n# https:\/\/en.wiktionary.org\/wiki\/%E3%83%89#Japanese\n# https:\/\/en.wiktionary.org\/wiki\/%E3%83%84#Japanese\nconst GLTF_KATAKANA: String = \"Katakana_\u30b4\u30c9\u30c4\"\n# The last two symbols are:\n# https:\/\/emojipedia.org\/grinning-face\n# https:\/\/emojipedia.org\/robot\/\nconst GLTF_EMOJI: String = \"Emoji_\ud83d\ude00\ud83e\udd16\"\nconst GLTF_ALLOWED_SYMBOLS: String = \"AllowedSymbols_!#$%^&*()-=[]{}';<>,~\"\nconst GLTF_DISALLOWED_NONCLASHING: String = \"Disallowed_Non-clashing_.:@\\\"\/\"\nconst GLTF_DISALLOWED_CLASHING_1: String = \"Disallowed_Clashing_.\"\nconst GLTF_DISALLOWED_CLASHING_2: String = \"Disallowed_Clashing_@\"\nconst GLTF_DISALLOWED_CLASHING_DEEP_TREE_1: String = \"Disallowed_Clashing_Deep_Tree_@\"\nconst GLTF_DISALLOWED_CLASHING_DEEP_TREE_2: String = \"Disallowed_Clashing_Deep_Tree_@@\"\nconst GLTF_DISALLOWED_CLASHING_DEEP_TREE_3: String = \"Disallowed_Clashing_Deep_Tree_@@@\"\n\nvar output: BoxContainer\nvar test_scene: Node\nvar test_animation_player: AnimationPlayer\n\n\nfunc _ready():\n\toutput = $ScrollContainer\/OutputWindow\n\ttest_scene = GOLDEN_GLTF_SCENE.instance()\n\ttest_animation_player = test_scene.get_node_or_null(\"AnimationPlayer\")\n\tif not test_animation_player:\n\t\t_add_line(\"ERROR: imported glTF scene has no AnimationPlayer node!\", Color.orangered)\n\t\tprint(\"FAIL: imported glTF scene has no AnimationPlayer so no tests will be run.\")\n\t\treturn\n\n\tvar passed_tests: Array = []\n\tvar failed_tests: Array = []\n\n\tfor method_name in _find_tests():\n\t\t_add_test_header(method_name)\n\t\tvar result: bool = self.call(method_name)\n\t\t_add_line(\" \")\n\t\tif result:\n\t\t\tpassed_tests.push_back(method_name)\n\t\telse:\n\t\t\tfailed_tests.push_back(method_name)\n\n\tif failed_tests:\n\t\tprint(\"FAIL: %d failed tests:\" % len(failed_tests))\n\t\tfor test in failed_tests:\n\t\t\tprint(\"\\t%s\" % test)\n\t\tprint(\"\")\n\t\tprint(\"Animations:\")\n\t\tfor animation_name in test_animation_player.get_animation_list():\n\t\t\tprint(\"\\t%s\" % animation_name)\n\telse:\n\t\tprint(\"PASS: Passed all %d tests\" % len(passed_tests))\n\n\nfunc _find_tests() -> Array:\n\tvar ret: Array = []\n\tfor method in get_method_list():\n\t\tvar method_name: String = method.get(\"name\")\n\t\tif method_name.begins_with(\"_test_\"):\n\t\t\tret.push_back(method_name)\n\tret.sort()\n\treturn ret\n\n\nfunc _add_test_header(method_name: String) -> void:\n\t_add_line(method_name, Color.royalblue)\n\n\nfunc _add_result(succeeded: bool, message: String) -> void:\n\tvar prefix: String = \" [OK] \" if succeeded else \" [FAIL] \"\n\t_add_line(prefix + message, Color.forestgreen if succeeded else Color.orangered)\n\n\nfunc _add_line(text: String, font_color: Color = Color.black) -> void:\n\tvar line: Label = Label.new()\n\tline.text = text\n\tline.add_theme_font_size_override(\"font_size\", 22)\n\tline.add_theme_color_override(\"font_color\", font_color)\n\toutput.add_child(line)\n\tprint(text)\n\n\nfunc _check_basic(original: String, expected: String) -> bool:\n\tvar node: Node = test_scene.get_node_or_null(expected)\n\tif not node:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Missing expected Godot node '%s' for glTF node '%s'\" % [expected, original])\n\t\treturn false\n\t_add_result(true, \"Found expected node '%s'\" % expected)\n\treturn true\n\n\nfunc _test_basic_alphanumeric_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_ALPHANUMERIC\n\tvar expected: String = original\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_allowed_symbols_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_ALLOWED_SYMBOLS\n\tvar expected: String = original\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_katakana_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_KATAKANA\n\tvar expected: String = original\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_emoji_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_EMOJI\n\tvar expected: String = original\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_disallowed_characters_are_stripped() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_NONCLASHING\n\tvar expected: String = GLTF_PREFIX_BASIC + \"Disallowed_Non-clashing_\"\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_disallowed_clashing_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_1\n\tvar expected: String = GLTF_PREFIX_BASIC + \"Disallowed_Clashing_\"\n\tif not _check_basic(original, expected):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_2\n\texpected = GLTF_PREFIX_BASIC + \"Disallowed_Clashing_2\"\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_disallowed_nested_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_DEEP_TREE_1\n\tvar expected_root: String = GLTF_PREFIX_BASIC + \"Disallowed_Clashing_Deep_Tree_\"\n\tif not _check_basic(original, expected_root):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_DEEP_TREE_2\n\tvar expected_mid = expected_root + \"\/\" + GLTF_PREFIX_BASIC + \"Disallowed_Clashing_Deep_Tree_2\"\n\tif not _check_basic(original, expected_mid):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_DEEP_TREE_3\n\tvar expected_leaf = expected_mid + \"\/\" + GLTF_PREFIX_BASIC + \"Disallowed_Clashing_Deep_Tree_3\"\n\treturn _check_basic(original, expected_leaf)\n\n\n# Verifies that a node exists with the expected name and that it has a StaticBody3D child.\nfunc _check_hinted_col(original: String, expected: String) -> bool:\n\tvar node: Node = test_scene.get_node_or_null(expected)\n\tif not node:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Missing expected Godot node '%s' for glTF node '%s'\" % [expected, original])\n\t\treturn false\n\n\tvar collision_body: StaticBody3D = node.get_node_or_null(\"static_collision\")\n\tif not collision_body:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Missing 'static_collision' child for Godot node '%s' (glTF '%s')\" % [\n\t\t\t\texpected, original])\n\t\treturn false\n\n\t# This test assumes that if the static_collision node was created the -col hint was properly\n\t# handled (as that behavior should be tested elsewhere).\n\t_add_result(true, \"Expected node '%s' contains a static_collision StaticBody3D\" % expected)\n\treturn true\n\n\nfunc _test_hinted_alphanumeric_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_ALPHANUMERIC\n\tvar expected: String = original\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_allowed_symbols_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_ALLOWED_SYMBOLS\n\tvar expected: String = original\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_katakana_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_KATAKANA\n\tvar expected: String = original\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_emoji_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_EMOJI\n\tvar expected: String = original\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_disallowed_characters_are_stripped() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_DISALLOWED_NONCLASHING\n\tvar expected: String = GLTF_PREFIX_HINTED + \"Disallowed_Non-clashing_\"\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_disallowed_clashing_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_DISALLOWED_CLASHING_1\n\tvar expected: String = GLTF_PREFIX_HINTED + \"Disallowed_Clashing_\"\n\tif not _check_hinted_col(original, expected):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_HINTED + GLTF_DISALLOWED_CLASHING_2\n\texpected = GLTF_PREFIX_HINTED + \"Disallowed_Clashing_2\"\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_disallowed_nested_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_DISALLOWED_CLASHING_DEEP_TREE_1\n\tvar expected_root: String = GLTF_PREFIX_HINTED + \"Disallowed_Clashing_Deep_Tree_\"\n\tif not _check_hinted_col(original, expected_root):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_HINTED + GLTF_DISALLOWED_CLASHING_DEEP_TREE_2\n\tvar expected_mid = expected_root + \"\/\" + GLTF_PREFIX_HINTED + \"Disallowed_Clashing_Deep_Tree_2\"\n\tif not _check_hinted_col(original, expected_mid):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_HINTED + GLTF_DISALLOWED_CLASHING_DEEP_TREE_3\n\tvar expected_leaf = expected_mid + \"\/\" + GLTF_PREFIX_HINTED + \"Disallowed_Clashing_Deep_Tree_3\"\n\treturn _check_hinted_col(original, expected_leaf)\n\n\n# Verifies that a node exists with the expected name and that an associated animation exists.\nfunc _check_animated(original: String, expected: String, expected_animation: String = \"\") -> bool:\n\tvar node: Node = test_scene.get_node_or_null(expected)\n\tif not node:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Missing expected Godot node '%s' for glTF node '%s'\" % [expected, original])\n\t\treturn false\n\n\tif expected_animation.is_empty():\n\t\texpected_animation = expected + GLTF_SUFFIX_ANIMATION\n\tvar animation: Animation = test_animation_player.get_animation(expected_animation)\n\tif not animation:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Missing expected animation '%s' for Godot node '%s' (glTF '%s')\" % [\n\t\t\t\texpected_animation, expected, original])\n\t\treturn false\n\n\tvar track_count: int = animation.get_track_count()\n\tif track_count != 1:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Track count %d != 1 on animation '%s' for Godot node '%s' (glTF '%s')\" % [\n\t\t\t\ttrack_count, expected_animation, expected, original])\n\t\treturn false\n\n\tvar track_type: int = animation.track_get_type(0)\n\tif track_type != Animation.TYPE_TRANSFORM:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Unexpected track type %d on animation '%s' for Godot node '%s' (glTF '%s')\" % [\n\t\t\t\ttrack_type, expected_animation, expected, original])\n\t\treturn false\n\n\tvar track_path: NodePath = animation.track_get_path(0)\n\tvar expected_track_path = NodePath(expected)\n\tif track_path != expected_track_path:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t(\"Incorrect track_path '%s' (expected '%s') on animation '%s' for Godot node '%s' \\\n\t\t\t\t (glTF '%s')\" % [\n\t\t\t\t\ttrack_path, expected_track_path, expected_animation, expected, original]))\n\t\treturn false\n\n\n\t# This test assumes that if the static_collision node was created the -col hint was properly\n\t# handled (as that behavior should be tested elsewhere).\n\t_add_result(true, \"Expected node '%s' has an associated animation\" % expected)\n\treturn true\n\n\nfunc _test_animated_alphanumeric_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_ALPHANUMERIC\n\tvar expected: String = original\n\treturn _check_animated(original, expected)\n\n\nfunc _test_animated_allowed_symbols_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_ALLOWED_SYMBOLS\n\tvar expected_node: String = original\n\tvar expected_animation: String = original.replace(\",\", \"\").replace(\"[\", \"\")\n\texpected_animation += GLTF_SUFFIX_ANIMATION\n\treturn _check_animated(original, expected_node, expected_animation)\n\n\nfunc _test_animated_katakana_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_KATAKANA\n\tvar expected: String = original\n\treturn _check_animated(original, expected)\n\n\nfunc _test_animated_emoji_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_EMOJI\n\tvar expected: String = original\n\treturn _check_animated(original, expected)\n\n\nfunc _test_animated_disallowed_characters_are_stripped() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_DISALLOWED_NONCLASHING\n\tvar expected: String = GLTF_PREFIX_ANIMATED + \"Disallowed_Non-clashing_\"\n\treturn _check_animated(original, expected)\n\n\nfunc _test_animated_disallowed_clashing_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_DISALLOWED_CLASHING_1\n\tvar expected: String = GLTF_PREFIX_ANIMATED + \"Disallowed_Clashing_\"\n\tif not _check_animated(original, expected):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_ANIMATED + GLTF_DISALLOWED_CLASHING_2\n\texpected = GLTF_PREFIX_ANIMATED + \"Disallowed_Clashing_2\"\n\treturn _check_animated(original, expected)\n\n\nfunc _test_animated_disallowed_nested_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_DISALLOWED_CLASHING_DEEP_TREE_1\n\tvar expected_root: String = GLTF_PREFIX_ANIMATED + \"Disallowed_Clashing_Deep_Tree_\"\n\tif not _check_animated(original, expected_root):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_ANIMATED + GLTF_DISALLOWED_CLASHING_DEEP_TREE_2\n\tvar expected_mid = (expected_root + \"\/\" +\n\t\tGLTF_PREFIX_ANIMATED + \"Disallowed_Clashing_Deep_Tree_2\")\n\tif not _check_animated(original, expected_mid):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_ANIMATED + GLTF_DISALLOWED_CLASHING_DEEP_TREE_3\n\tvar expected_leaf = (expected_mid + \"\/\" +\n\t\tGLTF_PREFIX_ANIMATED + \"Disallowed_Clashing_Deep_Tree_3\")\n\treturn _check_animated(original, expected_leaf)\n","old_contents":"extends ColorRect\n\nconst GOLDEN_GLTF_SCENE: PackedScene = preload(\"res:\/\/gltf\/45545-relax-name-sanitization.gltf\")\n\n## These constants are the prefix part of the node names used in the golden glTF file.\n# Prefix for \"basic\" nodes, no import hints, no animation, etc...\nconst GLTF_PREFIX_BASIC: String = \"Basic_\"\n\n# Prefix for nodes that have an import hint.\nconst GLTF_PREFIX_HINTED: String = \"Hinted_\"\n\n# Prefix for nodes that have an associated animation.\nconst GLTF_PREFIX_ANIMATED: String = \"Animated_\"\n\n# The suffix for animations (all animations in the golden glTF file use the Blender default suffix\n# \"Action\" and the looping import hint \"-loop\".\nconst GLTF_SUFFIX_ANIMATION: String = \"Action-loop\"\n\n## These constants are the infix part of the node names used in the golden glTF file.\nconst GLTF_ALPHANUMERIC: String = \"Alphanumeric123\"\n# The last three symbols are:\n# https:\/\/en.wiktionary.org\/wiki\/%E3%82%B4#Japanese\n# https:\/\/en.wiktionary.org\/wiki\/%E3%83%89#Japanese\n# https:\/\/en.wiktionary.org\/wiki\/%E3%83%84#Japanese\nconst GLTF_KATAKANA: String = \"Katakana_\u30b4\u30c9\u30c4\"\n# The last two symbols are:\n# https:\/\/emojipedia.org\/grinning-face\n# https:\/\/emojipedia.org\/robot\/\nconst GLTF_EMOJI: String = \"Emoji_\ud83d\ude00\ud83e\udd16\"\nconst GLTF_ALLOWED_SYMBOLS: String = \"AllowedSymbols_!#$%^&*()-=[]{}';<>,~\"\nconst GLTF_DISALLOWED_NONCLASHING: String = \"Disallowed_Non-clashing_.:@\\\"\/\"\nconst GLTF_DISALLOWED_CLASHING_1: String = \"Disallowed_Clashing_.\"\nconst GLTF_DISALLOWED_CLASHING_2: String = \"Disallowed_Clashing_@\"\nconst GLTF_DISALLOWED_CLASHING_DEEP_TREE_1: String = \"Disallowed_Clashing_Deep_Tree_@\"\nconst GLTF_DISALLOWED_CLASHING_DEEP_TREE_2: String = \"Disallowed_Clashing_Deep_Tree_@@\"\nconst GLTF_DISALLOWED_CLASHING_DEEP_TREE_3: String = \"Disallowed_Clashing_Deep_Tree_@@@\"\n\nvar output: BoxContainer\nvar test_scene: Node\nvar test_animation_player: AnimationPlayer\n\n\nfunc _ready():\n\toutput = $ScrollContainer\/OutputWindow\n\ttest_scene = GOLDEN_GLTF_SCENE.instance()\n\ttest_animation_player = test_scene.get_node_or_null(\"AnimationPlayer\")\n\tif not test_animation_player:\n\t\t_add_line(\"ERROR: imported glTF scene has no AnimationPlayer node!\", Color.orangered)\n\t\tprint(\"FAIL: imported glTF scene has no AnimationPlayer so no tests will be run.\")\n\t\treturn\n\n\tvar passed_tests: Array = []\n\tvar failed_tests: Array = []\n\n\tfor method_name in _find_tests():\n\t\t_add_test_header(method_name)\n\t\tvar result: bool = self.call(method_name)\n\t\t_add_line(\" \")\n\t\tif result:\n\t\t\tpassed_tests.push_back(method_name)\n\t\telse:\n\t\t\tfailed_tests.push_back(method_name)\n\n\tif failed_tests:\n\t\tprint(\"FAIL: %d failed tests:\" % len(failed_tests))\n\t\tfor test in failed_tests:\n\t\t\tprint(\"\\t%s\" % test)\n\t\tprint(\"\")\n\t\tprint(\"Animations:\")\n\t\tfor animation_name in test_animation_player.get_animation_list():\n\t\t\tprint(\"\\t%s\" % animation_name)\n\telse:\n\t\tprint(\"PASS: Passed all %d tests\" % len(passed_tests))\n\n\nfunc _find_tests() -> Array:\n\tvar ret: Array = []\n\tfor method in get_method_list():\n\t\tvar method_name: String = method.get(\"name\")\n\t\tif method_name.begins_with(\"_test_\"):\n\t\t\tret.push_back(method_name)\n\tret.sort()\n\treturn ret\n\n\nfunc _add_test_header(method_name: String) -> void:\n\t_add_line(method_name, Color.royalblue)\n\n\nfunc _add_result(succeeded: bool, message: String) -> void:\n\tvar prefix: String = \" [OK] \" if succeeded else \" [FAIL] \"\n\t_add_line(prefix + message, Color.forestgreen if succeeded else Color.orangered)\n\n\nfunc _add_line(text: String, font_color: Color = Color.black) -> void:\n\tvar line: Label = Label.new()\n\tline.text = text\n\tline.add_theme_font_size_override(\"font_size\", 22)\n\tline.add_theme_color_override(\"font_color\", font_color)\n\toutput.add_child(line)\n\n\nfunc _check_basic(original: String, expected: String) -> bool:\n\tvar node: Node = test_scene.get_node_or_null(expected)\n\tif not node:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Missing expected Godot node '%s' for glTF node '%s'\" % [expected, original])\n\t\treturn false\n\t_add_result(true, \"Found expected node '%s'\" % expected)\n\treturn true\n\n\nfunc _test_basic_alphanumeric_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_ALPHANUMERIC\n\tvar expected: String = original\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_allowed_symbols_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_ALLOWED_SYMBOLS\n\tvar expected: String = original\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_katakana_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_KATAKANA\n\tvar expected: String = original\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_emoji_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_EMOJI\n\tvar expected: String = original\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_disallowed_characters_are_stripped() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_NONCLASHING\n\tvar expected: String = GLTF_PREFIX_BASIC + \"Disallowed_Non-clashing_\"\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_disallowed_clashing_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_1\n\tvar expected: String = GLTF_PREFIX_BASIC + \"Disallowed_Clashing_\"\n\tif not _check_basic(original, expected):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_2\n\texpected = GLTF_PREFIX_BASIC + \"Disallowed_Clashing_2\"\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_disallowed_nested_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_DEEP_TREE_1\n\tvar expected_root: String = GLTF_PREFIX_BASIC + \"Disallowed_Clashing_Deep_Tree_\"\n\tif not _check_basic(original, expected_root):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_DEEP_TREE_2\n\tvar expected_mid = expected_root + \"\/\" + GLTF_PREFIX_BASIC + \"Disallowed_Clashing_Deep_Tree_2\"\n\tif not _check_basic(original, expected_mid):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_DEEP_TREE_3\n\tvar expected_leaf = expected_mid + \"\/\" + GLTF_PREFIX_BASIC + \"Disallowed_Clashing_Deep_Tree_3\"\n\treturn _check_basic(original, expected_leaf)\n\n\n# Verifies that a node exists with the expected name and that it has a StaticBody3D child.\nfunc _check_hinted_col(original: String, expected: String) -> bool:\n\tvar node: Node = test_scene.get_node_or_null(expected)\n\tif not node:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Missing expected Godot node '%s' for glTF node '%s'\" % [expected, original])\n\t\treturn false\n\n\tvar collision_body: StaticBody3D = node.get_node_or_null(\"static_collision\")\n\tif not collision_body:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Missing 'static_collision' child for Godot node '%s' (glTF '%s')\" % [\n\t\t\t\texpected, original])\n\t\treturn false\n\n\t# This test assumes that if the static_collision node was created the -col hint was properly\n\t# handled (as that behavior should be tested elsewhere).\n\t_add_result(true, \"Expected node '%s' contains a static_collision StaticBody3D\" % expected)\n\treturn true\n\n\nfunc _test_hinted_alphanumeric_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_ALPHANUMERIC\n\tvar expected: String = original\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_allowed_symbols_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_ALLOWED_SYMBOLS\n\tvar expected: String = original\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_katakana_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_KATAKANA\n\tvar expected: String = original\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_emoji_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_EMOJI\n\tvar expected: String = original\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_disallowed_characters_are_stripped() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_DISALLOWED_NONCLASHING\n\tvar expected: String = GLTF_PREFIX_HINTED + \"Disallowed_Non-clashing_\"\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_disallowed_clashing_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_DISALLOWED_CLASHING_1\n\tvar expected: String = GLTF_PREFIX_HINTED + \"Disallowed_Clashing_\"\n\tif not _check_hinted_col(original, expected):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_HINTED + GLTF_DISALLOWED_CLASHING_2\n\texpected = GLTF_PREFIX_HINTED + \"Disallowed_Clashing_2\"\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_disallowed_nested_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_DISALLOWED_CLASHING_DEEP_TREE_1\n\tvar expected_root: String = GLTF_PREFIX_HINTED + \"Disallowed_Clashing_Deep_Tree_\"\n\tif not _check_hinted_col(original, expected_root):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_HINTED + GLTF_DISALLOWED_CLASHING_DEEP_TREE_2\n\tvar expected_mid = expected_root + \"\/\" + GLTF_PREFIX_HINTED + \"Disallowed_Clashing_Deep_Tree_2\"\n\tif not _check_hinted_col(original, expected_mid):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_HINTED + GLTF_DISALLOWED_CLASHING_DEEP_TREE_3\n\tvar expected_leaf = expected_mid + \"\/\" + GLTF_PREFIX_HINTED + \"Disallowed_Clashing_Deep_Tree_3\"\n\treturn _check_hinted_col(original, expected_leaf)\n\n\n# Verifies that a node exists with the expected name and that an associated animation exists.\nfunc _check_animated(original: String, expected: String) -> bool:\n\tvar node: Node = test_scene.get_node_or_null(expected)\n\tif not node:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Missing expected Godot node '%s' for glTF node '%s'\" % [expected, original])\n\t\treturn false\n\n\tvar expected_animation: String = expected + GLTF_SUFFIX_ANIMATION\n\tvar animation: Animation = test_animation_player.get_animation(expected_animation)\n\tif not animation:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Missing expected animation '%s' for Godot node '%s' (glTF '%s')\" % [\n\t\t\t\texpected_animation, expected, original])\n\t\treturn false\n\n\tvar track_count: int = animation.get_track_count()\n\tif track_count != 1:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Track count %d != 1 on animation '%s' for Godot node '%s' (glTF '%s')\" % [\n\t\t\t\ttrack_count, expected_animation, expected, original])\n\t\treturn false\n\n\tvar track_type: int = animation.track_get_type(0)\n\tif track_type != Animation.TYPE_TRANSFORM:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Unexpected track type %d on animation '%s' for Godot node '%s' (glTF '%s')\" % [\n\t\t\t\ttrack_type, expected_animation, expected, original])\n\t\treturn false\n\n\tvar track_path: NodePath = animation.track_get_path(0)\n\tvar expected_track_path = NodePath(expected)\n\tif track_path != expected_track_path:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t(\"Incorrect track_path '%s' (expected '%s') on animation '%s' for Godot node '%s' \\\n\t\t\t\t (glTF '%s')\" % [\n\t\t\t\t\ttrack_path, expected_track_path, expected_animation, expected, original]))\n\t\treturn false\n\n\n\t# This test assumes that if the static_collision node was created the -col hint was properly\n\t# handled (as that behavior should be tested elsewhere).\n\t_add_result(true, \"Expected node '%s' has an associated animation\" % expected)\n\treturn true\n\n\nfunc _test_animated_alphanumeric_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_ALPHANUMERIC\n\tvar expected: String = original\n\treturn _check_animated(original, expected)\n\n\nfunc _test_animated_allowed_symbols_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_ALLOWED_SYMBOLS\n\tvar expected: String = original\n\treturn _check_animated(original, expected)\n\n\nfunc _test_animated_katakana_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_KATAKANA\n\tvar expected: String = original\n\treturn _check_animated(original, expected)\n\n\nfunc _test_animated_emoji_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_EMOJI\n\tvar expected: String = original\n\treturn _check_animated(original, expected)\n\n\nfunc _test_animated_disallowed_characters_are_stripped() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_DISALLOWED_NONCLASHING\n\tvar expected: String = GLTF_PREFIX_ANIMATED + \"Disallowed_Non-clashing_\"\n\treturn _check_animated(original, expected)\n\n\nfunc _test_animated_disallowed_clashing_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_DISALLOWED_CLASHING_1\n\tvar expected: String = GLTF_PREFIX_ANIMATED + \"Disallowed_Clashing_\"\n\tif not _check_animated(original, expected):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_ANIMATED + GLTF_DISALLOWED_CLASHING_2\n\texpected = GLTF_PREFIX_ANIMATED + \"Disallowed_Clashing_2\"\n\treturn _check_animated(original, expected)\n\n\nfunc _test_animated_disallowed_nested_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_DISALLOWED_CLASHING_DEEP_TREE_1\n\tvar expected_root: String = GLTF_PREFIX_ANIMATED + \"Disallowed_Clashing_Deep_Tree_\"\n\tif not _check_animated(original, expected_root):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_ANIMATED + GLTF_DISALLOWED_CLASHING_DEEP_TREE_2\n\tvar expected_mid = (expected_root + \"\/\" +\n\t\tGLTF_PREFIX_ANIMATED + \"Disallowed_Clashing_Deep_Tree_2\")\n\tif not _check_animated(original, expected_mid):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_ANIMATED + GLTF_DISALLOWED_CLASHING_DEEP_TREE_3\n\tvar expected_leaf = (expected_mid + \"\/\" +\n\t\tGLTF_PREFIX_ANIMATED + \"Disallowed_Clashing_Deep_Tree_3\")\n\treturn _check_animated(original, expected_leaf)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"051b06be63e42552005305f5cd24f8309d1053a1","subject":"use puzzle.shape","message":"use puzzle.shape\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Editor.gd","new_file":"src\/scripts\/Editor.gd","new_contents":"extends Spatial\n\nvar puzzle\nvar puzzleMan\nvar DataMan = preload(\"res:\/\/scripts\/DataManager.gd\")\n\nvar gridMan\nvar prevBlocks = [] # keeps track of prevous color for pairs by layer\nvar blockColors = preload(\"res:\/\/scripts\/PuzzleManager.gd\").blockColors\nvar id\n\nvar saveDir = OS.get_data_dir() + \"\/PuzzleSaves\"\n\nvar fd\nvar gui = [\n\t[\"status\", Label.new()], # plz keep me as first element, referenced as gui[0] later\n\t[\"save_pzl\", Button.new()],\n\t[\"load_pzl\", Button.new()],\n\t[\"remove_layer\", Button.new()],\n\t[\"random_layer\", Button.new()],\n\t# THESE SHOULD BE Options instead of left, label, right\n\t[\"class_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=[\"LZR\", \"WILD\", \"PAIR\", \"GOAL\"],\n\t\tvalue=\"PAIR\"\n\t}],\n\t[\"color_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=blockColors,\n\t\tvalue=\"Blue\"\n\t}],\n\t[\"action_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=[\"Add\", \"Remove\", \"Replace\"],\n\t\tvalue=\"Add\"\n\t}],\n\t[\"test_pzl\", Button.new()],\n]\nvar action_ix = gui.size() - 1 - 1\nvar color_ix = gui.size() - 1 - 2\nvar class_ix = gui.size() - 1 - 3\n\n# gross style, cannot , but clean enough\nfunc shouldAddNeighbor():\n\treturn gui[action_ix][1].value == \"Add\"\n\nfunc shouldReplaceSelf():\n\treturn gui[action_ix][1].value == \"Replace\"\n\nfunc shouldRemoveSelf():\n\treturn gui[action_ix][1].value == \"Remove\"\n\n# called in AbstractBlock to add a new block\nfunc addBlock(pos):\n\tvar curColor = gui[color_ix][1].value\n\tvar b = puzzleMan.PickledBlock.new() \\\n\t\t.setName(id) \\\n\t\t.setTextureName(curColor) \\\n\t\t.setBlockPos(pos)\n\tvar layer = puzzleMan.calcBlockLayerVec(pos)\n\tid += 1\n\n\tif layer == 0 and not gui[class_ix][1].value == \"GOAL\":\n\t\treturn\n\n\t# expand prevblocks index\n\twhile prevBlocks.size() <= layer:\n\t\tvar d = {}\n\t\tfor k in blockColors:\n\t\t\td[k] = null\n\t\tprevBlocks.append(d)\n\n\tvar pb = prevBlocks[layer][curColor]\n\n\tif pb != null:\n\t\tb.setPairName(pb.name)\n\t\tgridMan.get_node(pb.toNode().name).setPairName(b.name)\n\t\tprevBlocks[layer][curColor] = null\n\telse:\n\t\t# TODO SUPPORT GLYPHS HERE, SET PAIRWISE GLYPH\n\t\tprevBlocks[layer][curColor] = b\n\n\tgui[0][1].set_text(getPrevBlockErrors())\n\tvar block = gridMan.addPickledBlock(b)\n\tvar v = 0.01\n\tblock.set_scale(Vector3(v,v,v))\n\tblock.scaleTweenNode(1, 0.25, Tween.TRANS_QUART).start()\n\treturn b\n\nfunc getPrevBlockErrors():\n\t# hahaha, so bad\n\tvar missing = \"STATUS: \"\n\t# check every layer\n\tfor l in range(prevBlocks.size()):\n\t\t# check every color\n\t\tfor k in prevBlocks[l].keys():\n\t\t\tvar missed = false\n\t\t\tif prevBlocks[l][k] != null:\n\t\t\t\t# one message about the current layer\n\t\t\t\tif not missed:\n\t\t\t\t\tmissing += \" L\" + str(l) + \" \"\n\t\t\t\t\tmissed = true\n\t\t\t\tmissing += k.to_upper() + \" \" # bad way of constructing strings\n\tif missing == \"\":\n\t\tmissing += \"NOMINAL\"\n\treturn missing\n\nfunc changeValue(ix, togg):\n\ttogg.value = togg.values[ix]\n\nfunc _ready():\n\t# lights!\n\tget_tree().get_root().add_child(preload( \"res:\/\/puzzleView.scn\" ).instance())\n\tpuzzle = preload( \"res:\/\/puzzle.scn\" ).instance()\n\tpuzzle.mainPuzzle = false\n\n\t# hide and disable timer\n\tpuzzle.time.on = false;\n\tpuzzle.time.val = ''\n\tprint(puzzle.time)\n\n\tpuzzle.set_as_toplevel(true)\n\tget_tree().get_root().add_child(puzzle)\n\n\tgridMan = puzzle.get_node(\"GridView\/GridMan\")\n\tid = gridMan.puzzle.shape.size()\n\n\tpuzzleMan = puzzle.puzzleMan\n\n\tset_process_input(true)\n\n\tvar theme = preload(\"res:\/\/themes\/MainTheme.thm\")\n\tfd = initLoadSaveDialog(self, get_tree(), saveDir)\n\n\tvar y = 0\n\tfor control in gui:\n\t\ty += 45\n\t\tif control[0].rfind('_toggle') > 0:\n\t\t\tvar togg = control[1]\n\t\t\tvar e = togg.optionButt\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tadd_child(e)\n\n\t\t\t# index of items needed\n\t\t\te.connect(\"item_selected\", self, \"changeValue\", [togg])\n\t\t\tfor i in range(togg.values.size()):\n\t\t\t\te.add_item(togg.values[i], i)\n\t\t\t\t# e.add_icon_item(togg.values[i], i)\n\n\t\telse:\n\t\t\tvar e = control[1]\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tif e extends Button:\n\t\t\t\te.set_text(control[0])\n\t\t\tif control[0] == 'save_pzl' :\n\t\t\t\te.connect('pressed', self, 'showSaveDialog', [fd, self])\n\t\t\tif control[0] == 'load_pzl' :\n\t\t\t\te.connect('pressed', self, 'showLoadDialog', [fd, self])\n\t\t\tif control[0] == 'status':\n\t\t\t\tcontrol[1].set_text('STATUS: NOMINAL')\n\t\t\tadd_child(e)\n\n\nfunc puzzleSave():\n\tvar f = fd.get_current_path()\n\tif f == null or f == \"\":\n\t\treturn\n\tprint(\"SAVING TO \", f)\n\tDataMan.savePuzzle( f, gridMan.puzzle )\n\nfunc puzzleLoad():\n\tvar f = fd.get_current_path()\n\tif f == null or f == \"\":\n\t\treturn\n\tprint(\"LOADING FROM \", f)\n\tprevBlocks = []\n\tgridMan.set_puzzle(DataMan.loadPuzzle( f ))\n\nstatic func showLoadDialog(fileD, parent):\n\tif fileD.is_connected(\"confirmed\", parent, \"puzzleSave\"):\n\t\tfileD.disconnect(\"confirmed\", parent, \"puzzleSave\")\n\tfileD.connect(\"confirmed\", parent, \"puzzleLoad\")\n\tfileD.set_mode(FileDialog.MODE_OPEN_FILE)\n\n\tfileD.popup_centered()\n\nstatic func showSaveDialog(fileD, parent):\n\tif fileD.is_connected(\"confirmed\", parent, \"puzzleLoad\"):\n\t\tfileD.disconnect(\"confirmed\", parent, \"puzzleLoad\")\n\tfileD.connect(\"confirmed\", parent, \"puzzleSave\")\n\tfileD.set_mode(FileDialog.MODE_SAVE_FILE)\n\n\tfileD.popup_centered()\n\nstatic func initLoadSaveDialog(parent, tree, saveDir):\n\t# setup text in the file dialog\n\tvar fileDialog = load(\"res:\/\/fileDialog.scn\").instance()\n\tfileDialog.set_title(\"Select Puzzle Filename\")\n\tfileDialog.set_access(FileDialog.ACCESS_FILESYSTEM)\n\tfileDialog.add_filter(\"*.pzl ; Anttris Puzzle\")\n\n\tDirectory.new().make_dir_recursive(saveDir)\n\tfileDialog.set_current_dir(saveDir)\n\tprint(\"Saves in \", saveDir)\n\n\t# MainTheme leaks on bottom\n\tvar dialogTheme = Theme.new()\n\tdialogTheme.copy_default_theme()\n\tfileDialog.set_theme(dialogTheme)\n\n\t# work even if game is paused\n\tfileDialog.set_pause_mode(PAUSE_MODE_PROCESS)\n\n\t# unpause if user cancels\n\tfileDialog.connect(\"popup_hide\", tree, \"set_pause\", [false])\n\tfileDialog.connect(\"hide\", tree, \"set_pause\", [false])\n\tfileDialog.connect(\"about_to_show\", tree, \"set_pause\", [true])\n\tfileDialog.hide()\n\n\tparent.add_child(fileDialog)\n\tfileDialog.set_owner(parent)\n\treturn fileDialog\n","old_contents":"extends Spatial\n\nvar puzzle\nvar puzzleMan\nvar DataMan = preload(\"res:\/\/scripts\/DataManager.gd\")\n\nvar gridMan\nvar prevBlocks = [] # keeps track of prevous color for pairs by layer\nvar blockColors = preload(\"res:\/\/scripts\/PuzzleManager.gd\").blockColors\nvar id\n\nvar saveDir = OS.get_data_dir() + \"\/PuzzleSaves\"\n\nvar fd\nvar gui = [\n\t[\"status\", Label.new()], # plz keep me as first element, referenced as gui[0] later\n\t[\"save_pzl\", Button.new()],\n\t[\"load_pzl\", Button.new()],\n\t[\"remove_layer\", Button.new()],\n\t[\"random_layer\", Button.new()],\n\t# THESE SHOULD BE Options instead of left, label, right\n\t[\"class_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=[\"LZR\", \"WILD\", \"PAIR\", \"GOAL\"],\n\t\tvalue=\"PAIR\"\n\t}],\n\t[\"color_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=blockColors,\n\t\tvalue=\"Blue\"\n\t}],\n\t[\"action_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=[\"Add\", \"Remove\", \"Replace\"],\n\t\tvalue=\"Add\"\n\t}],\n\t[\"test_pzl\", Button.new()],\n]\nvar action_ix = gui.size() - 1 - 1\nvar color_ix = gui.size() - 1 - 2\nvar class_ix = gui.size() - 1 - 3\n\n# gross style, cannot , but clean enough\nfunc shouldAddNeighbor():\n\treturn gui[action_ix][1].value == \"Add\"\n\nfunc shouldReplaceSelf():\n\treturn gui[action_ix][1].value == \"Replace\"\n\nfunc shouldRemoveSelf():\n\treturn gui[action_ix][1].value == \"Remove\"\n\n# called in AbstractBlock to add a new block\nfunc addBlock(pos):\n\tvar curColor = gui[color_ix][1].value\n\tvar b = puzzleMan.PickledBlock.new() \\\n\t\t.setName(id) \\\n\t\t.setTextureName(curColor) \\\n\t\t.setBlockPos(pos)\n\tvar layer = puzzleMan.calcBlockLayerVec(pos)\n\tid += 1\n\n\tif layer == 0 and not gui[class_ix][1].value == \"GOAL\":\n\t\treturn\n\n\t# expand prevblocks index\n\twhile prevBlocks.size() <= layer:\n\t\tvar d = {}\n\t\tfor k in blockColors:\n\t\t\td[k] = null\n\t\tprevBlocks.append(d)\n\n\tvar pb = prevBlocks[layer][curColor]\n\n\tif pb != null:\n\t\tb.setPairName(pb.name)\n\t\tgridMan.get_node(pb.toNode().name).setPairName(b.name)\n\t\tprevBlocks[layer][curColor] = null\n\telse:\n\t\t# TODO SUPPORT GLYPHS HERE, SET PAIRWISE GLYPH\n\t\tprevBlocks[layer][curColor] = b\n\n\tgui[0][1].set_text(getPrevBlockErrors())\n\tvar block = gridMan.addPickledBlock(b)\n\tvar v = 0.01\n\tblock.set_scale(Vector3(v,v,v))\n\tblock.scaleTweenNode(1, 0.25, Tween.TRANS_QUART).start()\n\treturn b\n\nfunc getPrevBlockErrors():\n\t# hahaha, so bad\n\tvar missing = \"STATUS: \"\n\t# check every layer\n\tfor l in range(prevBlocks.size()):\n\t\t# check every color\n\t\tfor k in prevBlocks[l].keys():\n\t\t\tvar missed = false\n\t\t\tif prevBlocks[l][k] != null:\n\t\t\t\t# one message about the current layer\n\t\t\t\tif not missed:\n\t\t\t\t\tmissing += \" L\" + str(l) + \" \"\n\t\t\t\t\tmissed = true\n\t\t\t\tmissing += k.to_upper() + \" \" # bad way of constructing strings\n\tif missing == \"\":\n\t\tmissing += \"NOMINAL\"\n\treturn missing\n\nfunc changeValue(ix, togg):\n\ttogg.value = togg.values[ix]\n\nfunc _ready():\n\t# lights!\n\tget_tree().get_root().add_child(preload( \"res:\/\/puzzleView.scn\" ).instance())\n\tpuzzle = preload( \"res:\/\/puzzle.scn\" ).instance()\n\tpuzzle.mainPuzzle = false\n\n\t# hide and disable timer\n\tpuzzle.time.on = false;\n\tpuzzle.time.val = ''\n\tprint(puzzle.time)\n\n\tpuzzle.set_as_toplevel(true)\n\tget_tree().get_root().add_child(puzzle)\n\n\tgridMan = puzzle.get_node(\"GridView\/GridMan\")\n\tid = gridMan.shape.size()\n\n\tpuzzleMan = puzzle.puzzleMan\n\n\tset_process_input(true)\n\n\tvar theme = preload(\"res:\/\/themes\/MainTheme.thm\")\n\tfd = initLoadSaveDialog(self, get_tree(), saveDir)\n\n\tvar y = 0\n\tfor control in gui:\n\t\ty += 45\n\t\tif control[0].rfind('_toggle') > 0:\n\t\t\tvar togg = control[1]\n\t\t\tvar e = togg.optionButt\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tadd_child(e)\n\n\t\t\t# index of items needed\n\t\t\te.connect(\"item_selected\", self, \"changeValue\", [togg])\n\t\t\tfor i in range(togg.values.size()):\n\t\t\t\te.add_item(togg.values[i], i)\n\t\t\t\t# e.add_icon_item(togg.values[i], i)\n\n\t\telse:\n\t\t\tvar e = control[1]\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tif e extends Button:\n\t\t\t\te.set_text(control[0])\n\t\t\tif control[0] == 'save_pzl' :\n\t\t\t\te.connect('pressed', self, 'showSaveDialog', [fd, self])\n\t\t\tif control[0] == 'load_pzl' :\n\t\t\t\te.connect('pressed', self, 'showLoadDialog', [fd, self])\n\t\t\tif control[0] == 'status':\n\t\t\t\tcontrol[1].set_text('STATUS: NOMINAL')\n\t\t\tadd_child(e)\n\n\nfunc puzzleSave():\n\tvar f = fd.get_current_path()\n\tif f == null or f == \"\":\n\t\treturn\n\tprint(\"SAVING TO \", f)\n\tDataMan.savePuzzle( f, gridMan.puzzle )\n\nfunc puzzleLoad():\n\tvar f = fd.get_current_path()\n\tif f == null or f == \"\":\n\t\treturn\n\tprint(\"LOADING FROM \", f)\n\tprevBlocks = []\n\tgridMan.set_puzzle(DataMan.loadPuzzle( f ))\n\nstatic func showLoadDialog(fileD, parent):\n\tif fileD.is_connected(\"confirmed\", parent, \"puzzleSave\"):\n\t\tfileD.disconnect(\"confirmed\", parent, \"puzzleSave\")\n\tfileD.connect(\"confirmed\", parent, \"puzzleLoad\")\n\tfileD.set_mode(FileDialog.MODE_OPEN_FILE)\n\n\tfileD.popup_centered()\n\nstatic func showSaveDialog(fileD, parent):\n\tif fileD.is_connected(\"confirmed\", parent, \"puzzleLoad\"):\n\t\tfileD.disconnect(\"confirmed\", parent, \"puzzleLoad\")\n\tfileD.connect(\"confirmed\", parent, \"puzzleSave\")\n\tfileD.set_mode(FileDialog.MODE_SAVE_FILE)\n\n\tfileD.popup_centered()\n\nstatic func initLoadSaveDialog(parent, tree, saveDir):\n\t# setup text in the file dialog\n\tvar fileDialog = load(\"res:\/\/fileDialog.scn\").instance()\n\tfileDialog.set_title(\"Select Puzzle Filename\")\n\tfileDialog.set_access(FileDialog.ACCESS_FILESYSTEM)\n\tfileDialog.add_filter(\"*.pzl ; Anttris Puzzle\")\n\n\tDirectory.new().make_dir_recursive(saveDir)\n\tfileDialog.set_current_dir(saveDir)\n\tprint(\"Saves in \", saveDir)\n\n\t# MainTheme leaks on bottom\n\tvar dialogTheme = Theme.new()\n\tdialogTheme.copy_default_theme()\n\tfileDialog.set_theme(dialogTheme)\n\n\t# work even if game is paused\n\tfileDialog.set_pause_mode(PAUSE_MODE_PROCESS)\n\n\t# unpause if user cancels\n\tfileDialog.connect(\"popup_hide\", tree, \"set_pause\", [false])\n\tfileDialog.connect(\"hide\", tree, \"set_pause\", [false])\n\tfileDialog.connect(\"about_to_show\", tree, \"set_pause\", [true])\n\tfileDialog.hide()\n\n\tparent.add_child(fileDialog)\n\tfileDialog.set_owner(parent)\n\treturn fileDialog\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"fb81bc5f01f602db91162e611b35e020665d1526","subject":"Fixed Mask UI to not show any mask if player has none of mask.","message":"Fixed Mask UI to not show any mask if player has none of mask.\n","repos":"CSaratakij\/jam-2016-remake","old_file":"src\/ui\/ui_mask.gd","new_file":"src\/ui\/ui_mask.gd","new_contents":"\nextends HBoxContainer\n\nconst mask = preload(\"res:\/\/mask\/mask.gd\")\nconst types = mask.types\nconst type_textures = mask.type_textures\n\nvar current_mask = \"\"\nvar previous_mask = \"\"\n\nonready var tree = get_tree()\nonready var player = tree.get_nodes_in_group(\"player\")[0]\nonready var _sprite = get_node(\"Sprite\")\n\nfunc _ready():\n\tset_process(true)\n\nfunc _process(delta):\n\tif not player == null:\n\t\tcurrent_mask = player.get_current_mask()\n\t\tif current_mask != previous_mask:\n\t\t\tprevious_mask = current_mask\n\t\t\tif type_textures.has(current_mask):\n\t\t\t\t_sprite.set_texture(type_textures[ current_mask ])\n\t\t\telse:\n\t\t\t\t_sprite.set_texture(null)\n","old_contents":"\nextends HBoxContainer\n\nconst mask = preload(\"res:\/\/mask\/mask.gd\")\nconst types = mask.types\nconst type_textures = mask.type_textures\n\nvar current_mask = \"\"\nvar previous_mask = \"\"\n\nonready var tree = get_tree()\nonready var player = tree.get_nodes_in_group(\"player\")[0]\nonready var _sprite = get_node(\"Sprite\")\n\nfunc _ready():\n\tset_process(true)\n\nfunc _process(delta):\n\tif not player == null:\n\t\tcurrent_mask = player.get_current_mask()\n\t\tif current_mask != previous_mask:\n\t\t\tprevious_mask = current_mask\n\t\t\tif type_textures.has(current_mask):\n\t\t\t\t_sprite.set_texture(type_textures[ current_mask ])\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"1582061a0c38a1195d229e3f38f269d9cd457b3c","subject":"added replace and delete hooks for editor","message":"added replace and delete hooks for editor\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Blocks\/AbstractBlock.gd","new_file":"src\/scripts\/Blocks\/AbstractBlock.gd","new_contents":"\nextends RigidBody\n\nvar name_int\nvar name\nvar pairName\nvar selected = false\nvar blockPos\nvar blockLayer\nvar blockType\nconst far_away_corner = Vector3(110, 110, 110)\n\nvar editor\n\nstatic func nameToNodeName(n):\n\treturn \"block\" + str(n)\n\nfunc setName(n):\n\tname_int = n\n\tname = nameToNodeName(n)\n\tset_name(nameToNodeName(n))\n\treturn self\n\nfunc setPairName(n):\n\tpairName = nameToNodeName(n)\n\treturn self\n\nfunc setBlockLayer(n):\n\tblockLayer = n\n\treturn self\n\nfunc getBlockLayer():\n\treturn blockLayer\n\nfunc setBlockType( blockT ):\n\tblockType = blockT\n\treturn self\n\nfunc getBlockType():\n\treturn blockType\n\nfunc setSelected(sel):\n\tselected = sel\n\treturn self\n\nfunc forceClick():\n\tactivate()\n\tget_parent().clickBlock( name )\n\nfunc addNeighbor(editor, click_normal):\n\tvar t = get_parent().get_parent().get_transform().inverse()\n\tvar b = editor.newPickledBlock().setBlockPos(blockPos + t * click_normal)\n\tget_parent().add_block(b.toNode())\n\n\n# catch clicks\/taps\nfunc _input_event( camera, ev, click_pos, click_normal, shape_idx ):\n\tif ((ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT)\n\tor (ev.type==InputEvent.SCREEN_TOUCH)):\n\t\tif (get_parent().get_parent().active and ev.is_pressed()):\n\t\t\tprint(editor)\n\t\t\tif editor != null:\n\t\t\t\tif editor.shouldAddNeighbor():\n\t\t\t\t\taddNeighbor(editor, click_normal)\n\t\t\t\tif editor.shouldReplaceSelf():\n\t\t\t\t\taddNeighbor(editor, 0 * click_normal)\n\t\t\t\tif editor.shouldRemoveSelf():\n\t\t\t\t\tremove_with_pop(self, null)\n\t\t\telse:\n\t\t\t\tforceClick()\n\n# returns this block's pairNode or null\nfunc pairActivate():\n\tselected = true\n\n\t# is my pair Nil?\n\tif pairName == null or get_parent() == null or not get_parent().has_node(pairName):\n\t\tscaleTweenNode(0.9, 0.2, Tween.TRANS_EXPO).start()\n\t\treturn null\n\n\t# get my pair node\n\tvar pairNode = get_parent().get_node(pairName)\n\n\t# enlarge if the other guy's unselected\n\tif not pairNode.selected:\n\t\tscaleTweenNode(1.1, 0.2, Tween.TRANS_EXPO).start()\n\treturn pairNode\n\n\n# returns a tween node that uniformly changes the object's scale\n# call start() on the returned object\nfunc scaleTweenNode(scale, time=1, transType=Tween.TRANS_BOUNCE):\n\tvar tweenNode = newTweenNode()\n\ttweenNode.interpolate_method( self, \"set_scale\", \\\n\t\tself.get_scale(), Vector3(scale, scale, scale), \\\n\t\ttime, transType, Tween.EASE_OUT )\n\n\treturn tweenNode\n\n# adds a tween transition node to the tree\nfunc newTweenNode():\n\tvar tween = Tween.new()\n\tadd_child(tween)\n\treturn tween\n\nfunc remove_with_pop(node, key):\n\tget_parent().samplePlayer.play(\"deraj_pop_sound\")\n\tget_parent().remove_block(self)\n\nfunc _ready():\n\teditor = get_tree().get_root().get_node(\"EditorSpatial\")\n\tset_ray_pickable(true)\n","old_contents":"\nextends RigidBody\n\nvar name_int\nvar name\nvar pairName\nvar selected = false\nvar blockPos\nvar blockLayer\nvar blockType\nconst far_away_corner = Vector3(110, 110, 110)\n\nvar editor\n\nstatic func nameToNodeName(n):\n\treturn \"block\" + str(n)\n\nfunc setName(n):\n\tname_int = n\n\tname = nameToNodeName(n)\n\tset_name(nameToNodeName(n))\n\treturn self\n\nfunc setPairName(n):\n\tpairName = nameToNodeName(n)\n\treturn self\n\nfunc setBlockLayer(n):\n\tblockLayer = n\n\treturn self\n\nfunc getBlockLayer():\n\treturn blockLayer\n\nfunc setBlockType( blockT ):\n\tblockType = blockT\n\treturn self\n\nfunc getBlockType():\n\treturn blockType\n\nfunc setSelected(sel):\n\tselected = sel\n\treturn self\n\nfunc forceClick():\n\tactivate()\n\tget_parent().clickBlock( name )\n\nfunc addNeighbor(editor, click_normal):\n\tvar t = get_parent().get_parent().get_transform().inverse()\n\tvar b = editor.newPickledBlock().setBlockPos(blockPos + t * click_normal)\n\tget_parent().add_block(b.toNode())\n\n\n# catch clicks\/taps\nfunc _input_event( camera, ev, click_pos, click_normal, shape_idx ):\n\tif ((ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT)\n\tor (ev.type==InputEvent.SCREEN_TOUCH)):\n\t\tif (get_parent().get_parent().active and ev.is_pressed()):\n\t\t\tif editor != null and editor.shouldAddNeighbor():\n\t\t\t\taddNeighbor(editor, click_normal)\n\t\t\telse:\n\t\t\t\tforceClick()\n\n# returns this block's pairNode or null\nfunc pairActivate():\n\tselected = true\n\n\t# is my pair Nil?\n\tif pairName == null or get_parent() == null or not get_parent().has_node(pairName):\n\t\tscaleTweenNode(0.9, 0.2, Tween.TRANS_EXPO).start()\n\t\treturn null\n\n\t# get my pair node\n\tvar pairNode = get_parent().get_node(pairName)\n\n\t# enlarge if the other guy's unselected\n\tif not pairNode.selected:\n\t\tscaleTweenNode(1.1, 0.2, Tween.TRANS_EXPO).start()\n\treturn pairNode\n\n\n# returns a tween node that uniformly changes the object's scale\n# call start() on the returned object\nfunc scaleTweenNode(scale, time=1, transType=Tween.TRANS_BOUNCE):\n\tvar tweenNode = newTweenNode()\n\ttweenNode.interpolate_method( self, \"set_scale\", \\\n\t\tself.get_scale(), Vector3(scale, scale, scale), \\\n\t\ttime, transType, Tween.EASE_OUT )\n\n\treturn tweenNode\n\n# adds a tween transition node to the tree\nfunc newTweenNode():\n\tvar tween = Tween.new()\n\tadd_child(tween)\n\treturn tween\n\nfunc remove_with_pop(node, key):\n\tget_parent().samplePlayer.play(\"deraj_pop_sound\")\n\tget_parent().remove_block(self)\n\nfunc _ready():\n\teditor = get_tree().get_root().get_node(\"Editor\")\n\tset_ray_pickable(true)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"edef7b29a6a01030b68ced8da2fed9edf0d7417e","subject":"fix wrong default direction","message":"fix wrong default direction\n","repos":"AlexHolly\/captain-holetooth,AlexHolly\/captain-holetooth","old_file":"src\/actors\/player\/player.gd","new_file":"src\/actors\/player\/player.gd","new_contents":"\nextends RigidBody2D\n\n# Member variables\nvar anim = \"\"\nvar siding_left = false\nvar jumping = false\nvar shooting = false\n\nvar WALK_ACCEL = 2000.0 # Higher = Better control, Lower = Sluggish\nvar WALK_DEACCEL = 2000.0\nvar WALK_MAX_VELOCITY = 300.0\nvar AIR_ACCEL = 300.0 # It's over 9000! \nvar AIR_DEACCEL = 2900.0 # Make it higher to give the player better air control, or slower to make the game more \"realistic\"\nvar JUMP_VELOCITY = 438\nvar STOP_JUMP_FORCE = 2000.0\n\nvar MAX_FLOOR_AIRBORNE_TIME = 0.15\n\nvar DIR_LEFT = Vector2(-1,1)\nvar DIR_RIGHT = Vector2(1,1)\nvar CURR_DIR = Vector2(1,1)\nvar LAST_DIR = Vector2(0,0)\n\nvar airborne_time = 1e20\nvar shoot_time = 1e20\n\nvar MAX_SHOOT_POSE_TIME = 0.3\n\nvar bullet = preload(\"res:\/\/src\/actors\/player\/bullet.tscn\")\n\nvar floor_h_velocity = 0.0\nvar enemy\n\n#func beam_to(spawner):\n\t\n#\tvar spawnerpos = get_node(spawner).get_global_pos()\n#\tprint(\"Beam to active!\")\n#\tself.set_pos(spawnerpos)\n\n\nfunc _integrate_forces(s):\n\tvar linear_vel = s.get_linear_velocity()\n\tvar step = s.get_step()\n\t\n\tvar new_anim = anim\n\tvar new_siding_left = siding_left\n\t\n\t# Get the controls\n\tvar move_left = Input.is_action_pressed(\"move_left\")\n\tvar move_right = Input.is_action_pressed(\"move_right\")\n\tvar jump = Input.is_action_pressed(\"jump\")\n\tvar shoot = Input.is_action_pressed(\"shoot\")\n\tvar spawn = Input.is_action_pressed(\"spawn\")\n\t\n\t\n\tif spawn:\n\t\tvar e = enemy.instance()\n\t\tvar p = get_pos()\n\t\tp.y = p.y - 100\n\t\te.set_pos(p)\n\t\tget_parent().add_child(e)\n\t\n\t# Deapply prev floor velocity\n\tlinear_vel.x -= floor_h_velocity\n\tfloor_h_velocity = 0.0\n\t\n\t# Find the floor (a contact with upwards facing collision normal)\n\tvar found_floor = false\n\tvar floor_index = -1\n\t\n\tfor x in range(s.get_contact_count()):\n\t\tvar ci = s.get_contact_local_normal(x)\n\t\tif (ci.dot(Vector2(0, -1)) > 0.6):\n\t\t\tfound_floor = true\n\t\t\tfloor_index = x\n\t\n\t# Calculate air born time in order to control when to stop jump\n\t# from the user releasing jump or reaching max jump height\n\tif (found_floor):\n\t\tairborne_time = 0.0\n\telse:\n\t\tairborne_time += step # Time it spent in the air\n\t\n\tvar on_floor = airborne_time < MAX_FLOOR_AIRBORNE_TIME\n\n\t# Process jump\n\tif (jumping):\n\t\tif (linear_vel.y > 0):\n\t\t\t# Set off the jumping flag if going down\n\t\t\tjumping = false\n\n\t\tif (!jump):\n\t\t\tlinear_vel.y += STOP_JUMP_FORCE*step\n\t\n\tif (on_floor):\n\t\t# Process logic when character is on floor\n\t\tif (move_left and not move_right):\n\t\t\tCURR_DIR = DIR_LEFT\n\t\t\tif (linear_vel.x > -WALK_MAX_VELOCITY):\n\t\t\t\tlinear_vel.x -= WALK_ACCEL*step\n\t\t\t\t# Prevent player from exceeding max walk velocity\n\t\t\t\tif(linear_vel.x < -WALK_MAX_VELOCITY):\n\t\t\t\t\tlinear_vel.x = -WALK_MAX_VELOCITY\n\t\t\t\t\n\t\telif (move_right and not move_left):\n\t\t\tCURR_DIR = DIR_RIGHT\n\t\t\tif (linear_vel.x < WALK_MAX_VELOCITY):\n\t\t\t\tlinear_vel.x += WALK_ACCEL*step\n\t\t\t\t# Prevent player from exceeding max walk velocity\n\t\t\t\tif(linear_vel.x > WALK_MAX_VELOCITY):\n\t\t\t\t\tlinear_vel.x = WALK_MAX_VELOCITY\n\t\telse:\n\t\t\tvar xv = abs(linear_vel.x)\n\t\t\txv -= WALK_DEACCEL*step\n\t\t\tif (xv < 0):\n\t\t\t\txv = 0\n\t\t\tlinear_vel.x = sign(linear_vel.x)*xv\n\t\n\t\t# If we can, and want to JUMP - Jump!\n\t\tif (!jumping && jump):\n\t\t\t# Set velocity upwards \n\t\t\tlinear_vel.y = -JUMP_VELOCITY\n\t\t\t\n\t\t\t# Notify code that we are jumping\n\t\t\tjumping = true\n\t\t\t\n\t\t\t# Play the player's jump sound\n\t\t\tif !get_node(\"sfx\").is_active():\n\t\t\t\tget_node(\"sfx\").play(\"flupp\")\n\t\t\t# THIS IS FOR FUTURE USE - Its a statistics thing for players to see like \"Hey you only jumped 20 times during the whole game...\"\n\t\t\t# Whatever use it is, i think its a fun element to talk about :D\n\t\t\t# I don't care often about the \"use\" of things... just having it for fun is good enough ;)\n\t\t\tglobal.times_jumped = global.times_jumped +1\n\t\t\t# print(global.times_jumped)\n\t\t\t\n\t\t\t# Achievement for jumping 50 times - Increased jump height\n\t\t\tif (global.times_jumped > 50):\n\t\t\t\tJUMP_VELOCITY = 550\n\t\t\t\t# print(\"Yay! You can now jump higher\")\n\t\t\t\t# TODO: Print an achievement notification message to the player\n\t\t\n\t\t\n\t\t# Check jumping\n\t\tif (jumping):\n\t\t\t# Set the next animation\n\t\t\tnew_anim = \"jumping\"\n\t\t\n\t\t# Handling an idle player\n\t\telif (abs(linear_vel.x) < 0.1): # Using a 0.1 padding for when we consider the player to be idle\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"idle_weapon\"\n\t\t\telse:\n\t\t\t\tnew_anim = \"idle\"\n\t\t\n\t\t# The player is moving (not jumping)\n\t\telse:\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"run_weapon\"\n\t\t\telse:\n\t\t\t\tnew_anim = \"run\"\n\telse:\n\t\t# Process logic when the character is in the air\n\t\t# When we are only pressing LEFT movement\n\t\tif (move_left && !move_right):\n\t\t\tCURR_DIR = DIR_LEFT\n\t\t\tif (linear_vel.x > -WALK_MAX_VELOCITY):\n\t\t\t\t# linear_vel.x = -WALK_MAX_VELOCITY\n\t\t\t\tlinear_vel.x -= AIR_ACCEL*step\n\t\t\t\tif(linear_vel.x < -WALK_MAX_VELOCITY):\n\t\t\t\t\tlinear_vel.x = -WALK_MAX_VELOCITY\n\t\t\t\t\n\t\telif (move_right && !move_left):\n\t\t\tCURR_DIR = DIR_RIGHT\n\t\t\tif (linear_vel.x < WALK_MAX_VELOCITY):\n\t\t\t\t# linear_vel.x = WALK_MAX_VELOCITY\n\t\t\t\tlinear_vel.x += AIR_ACCEL*step\n\t\t\t\tif(linear_vel.x > WALK_MAX_VELOCITY):\n\t\t\t\t\tlinear_vel.x = WALK_MAX_VELOCITY\n\t\telse:\n\t\t\t# Deaccelerate air movement (quickly for a smooth gameplay experience)\n\t\t\tvar x_vel = abs(linear_vel.x)\n\t\t\tx_vel -= AIR_DEACCEL*step\n\t\t\tif (x_vel < 0):\n\t\t\t\tx_vel = 0\n\t\t\tlinear_vel.x = sign(linear_vel.x)*x_vel\n\t\t\n\t\tif (linear_vel.y < 0):\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"jumping_weapon\"\n\t\t\telse:\n\t\t\t\tnew_anim = \"jumping\"\n\t\telse:\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"falling_weapon\"\n\t\t\t\n\t\t\telse:\n\t\t\t\tnew_anim = \"falling\"\n\t\n\t# A good idea when impementing characters of all kinds,\n\t# compensates for physics imprecission, as well as human reaction delay.\n\tif (shoot and not shooting):\n\t\tshoot_time = 0\n\t\tvar bi = bullet.instance()\n\t\tvar ss\n\t\t#if (CURR_DIR==DIR_LEFT):\n\t\t#\tss = -1.0\n\t\t#else:\n\t\t#\tss = 1.0\n\t\tvar pos = get_pos() + get_node(\"bullet_shoot\").get_pos()*CURR_DIR\n\t\t\n\t\tbi.set_pos(pos)\n\t\tget_parent().add_child(bi)\n\t\t\n\t\tbi.set_linear_velocity(Vector2(800.0*CURR_DIR.x, -80))\n\t\tget_node(\"sprite\/smoke\").set_emitting(true)\n\t\tget_node(\"sfx\").play(\"schwuit\")\n\t\tPS2D.body_add_collision_exception(bi.get_rid(), get_rid()) # Make bullet and this not collide\n\telse:\n\t\tshoot_time += step\n\t# Check siding direction\n\t#if (linear_vel.x < 0 && move_left):\n\t#\tnew_siding_left = true\n\t#elif (linear_vel.x > 0 && move_right):\n\t#\tnew_siding_left = false\n\t\t\n\t# Update siding\n\tif (LAST_DIR!=CURR_DIR):\n\t\tif (move_left):\n\t\t\tget_node(\"sprite\").set_scale(DIR_LEFT)\n\t\t\tLAST_DIR = DIR_LEFT\n\t\telif(move_right):\n\t\t\tget_node(\"sprite\").set_scale(DIR_RIGHT)\n\t\t\tLAST_DIR = DIR_RIGHT\n\t\n\t# Change animation\n\tif (new_anim != anim):\n\t\tanim = new_anim\n\t\tget_node(\"anim\").play(anim)\n\t\n\tshooting = shoot\n\t\n\t# Apply floor velocity\n\tif (found_floor):\n\t\tfloor_h_velocity = s.get_contact_collider_velocity_at_pos(floor_index).x\n\t\tlinear_vel.x += floor_h_velocity\n\t\n\t# Finally, apply gravity and set back the linear velocity\n\tlinear_vel += s.get_total_gravity()*step\n\ts.set_linear_velocity(linear_vel)\n\t\n\n\nfunc _ready():\n\tset_process(true)\n\tenemy = ResourceLoader.load(\"res:\/\/scenes\/scn3-forest\/enemy.tscn\")\n\t# Update play time, has to go into a global function at some point\nfunc _process(delta):\n\tglobal.time_elapsed += delta\n\t#print(global.time_elapsed)\n\tif global.time_elapsed >= int(global.playtime_limit_seconds):\n\t\t#print(\"Time elpased!\")\n\t\t#show(Popup)\n\t\tglobal.time_elapsed = 0\n\n\n#\tif !Globals.has_singleton(\"Facebook\"):\n#\t\treturn\n#\tvar Facebook = Globals.get_singleton(\"Facebook\")\n#\tvar link = Globals.get(\"facebook\/link\")\n#\tvar icon = Globals.get(\"facebook\/icon\")\n#\tvar msg = \"I just sneezed on your wall! Beat my score and Stop the Running nose!\"\n#\tvar title = \"I just sneezed on your wall!\"\n#\tFacebook.post(\"feed\", msg, title, link, icon)\n","old_contents":"\nextends RigidBody2D\n\n# Member variables\nvar anim = \"\"\nvar siding_left = false\nvar jumping = false\nvar shooting = false\n\nvar WALK_ACCEL = 2000.0 # Higher = Better control, Lower = Sluggish\nvar WALK_DEACCEL = 2000.0\nvar WALK_MAX_VELOCITY = 300.0\nvar AIR_ACCEL = 300.0 # It's over 9000! \nvar AIR_DEACCEL = 2900.0 # Make it higher to give the player better air control, or slower to make the game more \"realistic\"\nvar JUMP_VELOCITY = 438\nvar STOP_JUMP_FORCE = 2000.0\n\nvar MAX_FLOOR_AIRBORNE_TIME = 0.15\n\nvar DIR_LEFT = Vector2(-1,1)\nvar DIR_RIGHT = Vector2(1,1)\nvar CURR_DIR = Vector2(-1,1)\nvar LAST_DIR = Vector2(0,0)\n\nvar airborne_time = 1e20\nvar shoot_time = 1e20\n\nvar MAX_SHOOT_POSE_TIME = 0.3\n\nvar bullet = preload(\"res:\/\/src\/actors\/player\/bullet.tscn\")\n\nvar floor_h_velocity = 0.0\nvar enemy\n\n#func beam_to(spawner):\n\t\n#\tvar spawnerpos = get_node(spawner).get_global_pos()\n#\tprint(\"Beam to active!\")\n#\tself.set_pos(spawnerpos)\n\n\nfunc _integrate_forces(s):\n\tvar linear_vel = s.get_linear_velocity()\n\tvar step = s.get_step()\n\t\n\tvar new_anim = anim\n\tvar new_siding_left = siding_left\n\t\n\t# Get the controls\n\tvar move_left = Input.is_action_pressed(\"move_left\")\n\tvar move_right = Input.is_action_pressed(\"move_right\")\n\tvar jump = Input.is_action_pressed(\"jump\")\n\tvar shoot = Input.is_action_pressed(\"shoot\")\n\tvar spawn = Input.is_action_pressed(\"spawn\")\n\t\n\t\n\tif spawn:\n\t\tvar e = enemy.instance()\n\t\tvar p = get_pos()\n\t\tp.y = p.y - 100\n\t\te.set_pos(p)\n\t\tget_parent().add_child(e)\n\t\n\t# Deapply prev floor velocity\n\tlinear_vel.x -= floor_h_velocity\n\tfloor_h_velocity = 0.0\n\t\n\t# Find the floor (a contact with upwards facing collision normal)\n\tvar found_floor = false\n\tvar floor_index = -1\n\t\n\tfor x in range(s.get_contact_count()):\n\t\tvar ci = s.get_contact_local_normal(x)\n\t\tif (ci.dot(Vector2(0, -1)) > 0.6):\n\t\t\tfound_floor = true\n\t\t\tfloor_index = x\n\t\n\t# Calculate air born time in order to control when to stop jump\n\t# from the user releasing jump or reaching max jump height\n\tif (found_floor):\n\t\tairborne_time = 0.0\n\telse:\n\t\tairborne_time += step # Time it spent in the air\n\t\n\tvar on_floor = airborne_time < MAX_FLOOR_AIRBORNE_TIME\n\n\t# Process jump\n\tif (jumping):\n\t\tif (linear_vel.y > 0):\n\t\t\t# Set off the jumping flag if going down\n\t\t\tjumping = false\n\n\t\tif (!jump):\n\t\t\tlinear_vel.y += STOP_JUMP_FORCE*step\n\t\n\tif (on_floor):\n\t\t# Process logic when character is on floor\n\t\tif (move_left and not move_right):\n\t\t\tCURR_DIR = DIR_LEFT\n\t\t\tif (linear_vel.x > -WALK_MAX_VELOCITY):\n\t\t\t\tlinear_vel.x -= WALK_ACCEL*step\n\t\t\t\t# Prevent player from exceeding max walk velocity\n\t\t\t\tif(linear_vel.x < -WALK_MAX_VELOCITY):\n\t\t\t\t\tlinear_vel.x = -WALK_MAX_VELOCITY\n\t\t\t\t\n\t\telif (move_right and not move_left):\n\t\t\tCURR_DIR = DIR_RIGHT\n\t\t\tif (linear_vel.x < WALK_MAX_VELOCITY):\n\t\t\t\tlinear_vel.x += WALK_ACCEL*step\n\t\t\t\t# Prevent player from exceeding max walk velocity\n\t\t\t\tif(linear_vel.x > WALK_MAX_VELOCITY):\n\t\t\t\t\tlinear_vel.x = WALK_MAX_VELOCITY\n\t\telse:\n\t\t\tvar xv = abs(linear_vel.x)\n\t\t\txv -= WALK_DEACCEL*step\n\t\t\tif (xv < 0):\n\t\t\t\txv = 0\n\t\t\tlinear_vel.x = sign(linear_vel.x)*xv\n\t\n\t\t# If we can, and want to JUMP - Jump!\n\t\tif (!jumping && jump):\n\t\t\t# Set velocity upwards \n\t\t\tlinear_vel.y = -JUMP_VELOCITY\n\t\t\t\n\t\t\t# Notify code that we are jumping\n\t\t\tjumping = true\n\t\t\t\n\t\t\t# Play the player's jump sound\n\t\t\tif !get_node(\"sfx\").is_active():\n\t\t\t\tget_node(\"sfx\").play(\"flupp\")\n\t\t\t# THIS IS FOR FUTURE USE - Its a statistics thing for players to see like \"Hey you only jumped 20 times during the whole game...\"\n\t\t\t# Whatever use it is, i think its a fun element to talk about :D\n\t\t\t# I don't care often about the \"use\" of things... just having it for fun is good enough ;)\n\t\t\tglobal.times_jumped = global.times_jumped +1\n\t\t\t# print(global.times_jumped)\n\t\t\t\n\t\t\t# Achievement for jumping 50 times - Increased jump height\n\t\t\tif (global.times_jumped > 50):\n\t\t\t\tJUMP_VELOCITY = 550\n\t\t\t\t# print(\"Yay! You can now jump higher\")\n\t\t\t\t# TODO: Print an achievement notification message to the player\n\t\t\n\t\t\n\t\t# Check jumping\n\t\tif (jumping):\n\t\t\t# Set the next animation\n\t\t\tnew_anim = \"jumping\"\n\t\t\n\t\t# Handling an idle player\n\t\telif (abs(linear_vel.x) < 0.1): # Using a 0.1 padding for when we consider the player to be idle\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"idle_weapon\"\n\t\t\telse:\n\t\t\t\tnew_anim = \"idle\"\n\t\t\n\t\t# The player is moving (not jumping)\n\t\telse:\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"run_weapon\"\n\t\t\telse:\n\t\t\t\tnew_anim = \"run\"\n\telse:\n\t\t# Process logic when the character is in the air\n\t\t# When we are only pressing LEFT movement\n\t\tif (move_left && !move_right):\n\t\t\tCURR_DIR = DIR_LEFT\n\t\t\tif (linear_vel.x > -WALK_MAX_VELOCITY):\n\t\t\t\t# linear_vel.x = -WALK_MAX_VELOCITY\n\t\t\t\tlinear_vel.x -= AIR_ACCEL*step\n\t\t\t\tif(linear_vel.x < -WALK_MAX_VELOCITY):\n\t\t\t\t\tlinear_vel.x = -WALK_MAX_VELOCITY\n\t\t\t\t\n\t\telif (move_right && !move_left):\n\t\t\tCURR_DIR = DIR_RIGHT\n\t\t\tif (linear_vel.x < WALK_MAX_VELOCITY):\n\t\t\t\t# linear_vel.x = WALK_MAX_VELOCITY\n\t\t\t\tlinear_vel.x += AIR_ACCEL*step\n\t\t\t\tif(linear_vel.x > WALK_MAX_VELOCITY):\n\t\t\t\t\tlinear_vel.x = WALK_MAX_VELOCITY\n\t\telse:\n\t\t\t# Deaccelerate air movement (quickly for a smooth gameplay experience)\n\t\t\tvar x_vel = abs(linear_vel.x)\n\t\t\tx_vel -= AIR_DEACCEL*step\n\t\t\tif (x_vel < 0):\n\t\t\t\tx_vel = 0\n\t\t\tlinear_vel.x = sign(linear_vel.x)*x_vel\n\t\t\n\t\tif (linear_vel.y < 0):\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"jumping_weapon\"\n\t\t\telse:\n\t\t\t\tnew_anim = \"jumping\"\n\t\telse:\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"falling_weapon\"\n\t\t\t\n\t\t\telse:\n\t\t\t\tnew_anim = \"falling\"\n\t\n\t# A good idea when impementing characters of all kinds,\n\t# compensates for physics imprecission, as well as human reaction delay.\n\tif (shoot and not shooting):\n\t\tshoot_time = 0\n\t\tvar bi = bullet.instance()\n\t\tvar ss\n\t\t#if (CURR_DIR==DIR_LEFT):\n\t\t#\tss = -1.0\n\t\t#else:\n\t\t#\tss = 1.0\n\t\tvar pos = get_pos() + get_node(\"bullet_shoot\").get_pos()*CURR_DIR\n\t\t\n\t\tbi.set_pos(pos)\n\t\tget_parent().add_child(bi)\n\t\t\n\t\tbi.set_linear_velocity(Vector2(800.0*CURR_DIR.x, -80))\n\t\tget_node(\"sprite\/smoke\").set_emitting(true)\n\t\tget_node(\"sfx\").play(\"schwuit\")\n\t\tPS2D.body_add_collision_exception(bi.get_rid(), get_rid()) # Make bullet and this not collide\n\telse:\n\t\tshoot_time += step\n\t# Check siding direction\n\t#if (linear_vel.x < 0 && move_left):\n\t#\tnew_siding_left = true\n\t#elif (linear_vel.x > 0 && move_right):\n\t#\tnew_siding_left = false\n\t\t\n\t# Update siding\n\tif (LAST_DIR!=CURR_DIR):\n\t\tif (move_left):\n\t\t\tget_node(\"sprite\").set_scale(DIR_LEFT)\n\t\t\tLAST_DIR = DIR_LEFT\n\t\telif(move_right):\n\t\t\tget_node(\"sprite\").set_scale(DIR_RIGHT)\n\t\t\tLAST_DIR = DIR_RIGHT\n\t\n\t# Change animation\n\tif (new_anim != anim):\n\t\tanim = new_anim\n\t\tget_node(\"anim\").play(anim)\n\t\n\tshooting = shoot\n\t\n\t# Apply floor velocity\n\tif (found_floor):\n\t\tfloor_h_velocity = s.get_contact_collider_velocity_at_pos(floor_index).x\n\t\tlinear_vel.x += floor_h_velocity\n\t\n\t# Finally, apply gravity and set back the linear velocity\n\tlinear_vel += s.get_total_gravity()*step\n\ts.set_linear_velocity(linear_vel)\n\t\n\n\nfunc _ready():\n\tset_process(true)\n\tenemy = ResourceLoader.load(\"res:\/\/scenes\/scn3-forest\/enemy.tscn\")\n\t# Update play time, has to go into a global function at some point\nfunc _process(delta):\n\tglobal.time_elapsed += delta\n\t#print(global.time_elapsed)\n\tif global.time_elapsed >= int(global.playtime_limit_seconds):\n\t\t#print(\"Time elpased!\")\n\t\t#show(Popup)\n\t\tglobal.time_elapsed = 0\n\n\n#\tif !Globals.has_singleton(\"Facebook\"):\n#\t\treturn\n#\tvar Facebook = Globals.get_singleton(\"Facebook\")\n#\tvar link = Globals.get(\"facebook\/link\")\n#\tvar icon = Globals.get(\"facebook\/icon\")\n#\tvar msg = \"I just sneezed on your wall! Beat my score and Stop the Running nose!\"\n#\tvar title = \"I just sneezed on your wall!\"\n#\tFacebook.post(\"feed\", msg, title, link, icon)\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"GDScript"} {"commit":"47b0cb88a8b6f56442c73f635e2d75c5f18e5758","subject":"Wall sliding","message":"Wall sliding\n","repos":"P1X-in\/rat-is-fat","old_file":"scripts\/moving_object.gd","new_file":"scripts\/moving_object.gd","new_contents":"extends \"res:\/\/scripts\/object.gd\"\n\nvar velocity\nvar movement_vector = [0, 0]\n\nvar AXIS_THRESHOLD = 0.15\n\nvar body_part_head\nvar body_part_body\nvar body_part_footer\n\nfunc _init(bag).(bag):\n self.bag = bag\n\nfunc spawn():\n .spawn()\n self.bag.processing.register(self)\n\nfunc despawn():\n self.bag.processing.remove(self)\n .despawn()\n\nfunc process(delta):\n self.modify_position(delta)\n\nfunc modify_position(delta):\n var x = self.apply_axis_threshold(self.movement_vector[0])\n var y = self.apply_axis_threshold(self.movement_vector[1])\n var motion = Vector2(x, y) * self.velocity * delta\n self.avatar.move(motion)\n if (self.avatar.is_colliding()):\n var n = self.avatar.get_collision_normal()\n motion = n.slide(motion)\n self.avatar.move(motion)\n self.flip(self.movement_vector[0])\n\nfunc apply_axis_threshold(axis_value):\n if abs(axis_value) < self.AXIS_THRESHOLD:\n return 0\n return axis_value\n\nfunc flip(direction):\n if direction == 0:\n return\n\n var flip_sprite = false\n if direction > 0:\n flip_sprite = true\n\n self.body_part_head.set_flip_h(flip_sprite)\n self.body_part_body.set_flip_h(flip_sprite)\n self.body_part_footer.set_flip_h(flip_sprite)\n\nfunc reset_movement():\n self.movement_vector = [0, 0]\n","old_contents":"extends \"res:\/\/scripts\/object.gd\"\n\nvar velocity\nvar movement_vector = [0, 0]\n\nvar AXIS_THRESHOLD = 0.15\n\nvar body_part_head\nvar body_part_body\nvar body_part_footer\n\nfunc _init(bag).(bag):\n self.bag = bag\n\nfunc spawn():\n .spawn()\n self.bag.processing.register(self)\n\nfunc despawn():\n self.bag.processing.remove(self)\n .despawn()\n\nfunc process(delta):\n self.modify_position(delta)\n\nfunc modify_position(delta):\n var x = self.apply_axis_threshold(self.movement_vector[0])\n var y = self.apply_axis_threshold(self.movement_vector[1])\n var motion = Vector2(x, y) * self.velocity * delta\n self.avatar.move(motion)\n self.flip(self.movement_vector[0])\n\nfunc apply_axis_threshold(axis_value):\n if abs(axis_value) < self.AXIS_THRESHOLD:\n return 0\n return axis_value\n\nfunc flip(direction):\n if direction == 0:\n return\n\n var flip_sprite = false\n if direction > 0:\n flip_sprite = true\n\n self.body_part_head.set_flip_h(flip_sprite)\n self.body_part_body.set_flip_h(flip_sprite)\n self.body_part_footer.set_flip_h(flip_sprite)\n\nfunc reset_movement():\n self.movement_vector = [0, 0]\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"f2a5162e325daaf4882f032cf8c7625566341f85","subject":"Prevented Grumpy adds from spamming tombstones","message":"Prevented Grumpy adds from spamming tombstones\n","repos":"P1X-in\/rat-is-fat","old_file":"scripts\/enemies\/grumpy_prime.gd","new_file":"scripts\/enemies\/grumpy_prime.gd","new_contents":"extends \"res:\/\/scripts\/enemies\/abstract_boss.gd\"\n\n\nconst THRASH_AMOUNT = 2\nvar THRASH_SPAWN_TIME = 5\nvar VULNERABLE_TIME = 3.5\nvar RAINBOW_DELAY = 5\nvar thrash_template = 'fat_rat'\n\n\nvar shield_points = [\n Vector2(17, 3),\n Vector2(17, 8),\n Vector2(2, 8),\n]\nvar shield_points_global = []\n\nvar shield\nvar angry_body = null\nvar rainbow_spawned = true\nvar rainbow = 'rainbow'\n\nfunc _init(bag).(bag):\n self.avatar = preload(\"res:\/\/scenes\/enemies\/grumpy_prime.xscn\").instance()\n self.body_part_head = self.avatar.get_node('body')\n self.body_part_body = self.avatar.get_node('body')\n self.body_part_footer = self.avatar.get_node('body')\n self.animations = self.avatar.get_node('body_animations')\n self.angry_body = self.avatar.get_node('angry')\n self.shield = self.avatar.get_node('shield')\n self.hit_particles = self.avatar.get_node('hitparticles')\n self.speech_bubble = self.avatar.get_node('speech')\n\n self.velocity = 25\n self.attack_range = 50\n self.attack_strength = 4\n self.attack_cooldown = 2\n self.max_hp = 200\n self.hp = 200\n self.score = 200\n self.is_invulnerable = true\n\n self.stun_duration = 0.4\n self.mass = 3\n\n self.phase_hp_thresholds = [\n [100, 2],\n ]\n\n for point in self.shield_points:\n self.shield_points_global.push_back(self.bag.room_loader.translate_position(point))\n\nfunc spawn(position):\n .spawn(position)\n self.randomize_movement()\n self.raise_shield()\n self.spawn_thrash()\n self.speak(\"NO\", 2, true)\n\nfunc phase2():\n self.body_part_body.hide()\n self.angry_body.show()\n self.THRASH_SPAWN_TIME = 2.5\n self.VULNERABLE_TIME = 2\n self.RAINBOW_DELAY = 2.5\n self.velocity = 50\n self.speak(\"I had fun once\", 2, true)\n\nfunc process_ai():\n var distance\n\n if self.target == null:\n for player in self.bag.players.players:\n if player.is_playing && player.is_alive:\n distance = self.calculate_distance_to_object(player)\n if distance < self.aggro_range:\n self.target = player\n break\n\n if self.target != null:\n distance = self.calculate_distance_to_object(self.target)\n if not self.target.is_alive || distance > self.aggro_range:\n self.target = null\n elif distance < self.attack_range and not self.is_attack_on_cooldown:\n self.attack()\n\n if not self.rainbow_spawned:\n self.rainbow_spawned = true\n self.bag.timers.set_timeout(self.RAINBOW_DELAY, self, 'spawn_rainbow')\n\nfunc randomize_movement():\n if self.hp < 1:\n return\n\n var direction\n\n var x = randi() % 18 + 1\n var y = randi() % 8 + 1\n\n direction = self.bag.room_loader.translate_position(Vector2(x, y))\n direction = self.cast_movement_vector(direction)\n\n self.movement_vector[0] = direction.x\n self.movement_vector[1] = direction.y\n\nfunc reset_movement():\n return\n\nfunc modify_position(delta):\n var x = self.movement_vector[0]\n var y = self.movement_vector[1]\n var motion = Vector2(x, y) * self.velocity * delta\n self.avatar.move(motion)\n self.flip(self.movement_vector[0])\n if (self.avatar.is_colliding()):\n var n = self.avatar.get_collision_normal()\n motion = n.slide(motion)\n self.avatar.move(motion)\n self.randomize_movement()\n\nfunc external_stun(duration=null):\n if self.is_invulnerable:\n return\n\n .external_stun(duration)\n\nfunc push_back(enemy):\n if self.is_invulnerable:\n return\n\n .push_back(enemy)\n\nfunc schedule_thrash_spawn():\n self.bag.timers.set_timeout(self.THRASH_SPAWN_TIME, self, 'spawn_thrash')\n\nfunc spawn_thrash():\n if self.hp < 1:\n return\n\n var position = self.avatar.get_global_pos()\n var new_guy\n\n for i in range(0, self.THRASH_AMOUNT):\n position = self.avatar.get_global_pos()\n position.x += pow(-1, i) * 30\n position.y += 30\n new_guy = self.bag.enemies.spawn_global(self.thrash_template, position)\n new_guy.is_attack_on_cooldown = true\n new_guy.has_tombstone = false\n new_guy.drop_chance = 0\n self.bag.timers.set_timeout(self.attack_cooldown, new_guy, \"attack_cooled_down\")\n new_guy.make_invulnerable(1)\n\n self.schedule_thrash_spawn()\n\nfunc disable_shield():\n self.is_invulnerable = false\n self.shield.hide()\n self.bag.timers.set_timeout(self.VULNERABLE_TIME, self, 'raise_shield')\n\nfunc raise_shield():\n self.animations.play('shield_on')\n self.bag.timers.set_timeout(0.5, self, 'raise_shield_anim_end')\n\nfunc raise_shield_anim_end():\n self.is_invulnerable = true\n self.rainbow_spawned = false\n self.shield.show()\n\nfunc spawn_rainbow():\n if self.hp < 1:\n return\n\n self.bag.enemies.spawn_global(self.rainbow, self.pick_next_point())\n\nfunc pick_next_point():\n return self.shield_points_global[randi() % self.shield_points_global.size()]\n\n\nfunc flip_body_parts(flip_flag):\n .flip_body_parts(flip_flag)\n self.angry_body.set_flip_h(flip_flag)\n","old_contents":"extends \"res:\/\/scripts\/enemies\/abstract_boss.gd\"\n\n\nconst THRASH_AMOUNT = 2\nvar THRASH_SPAWN_TIME = 5\nvar VULNERABLE_TIME = 3.5\nvar RAINBOW_DELAY = 5\nvar thrash_template = 'fat_rat'\n\n\nvar shield_points = [\n Vector2(17, 3),\n Vector2(17, 8),\n Vector2(2, 8),\n]\nvar shield_points_global = []\n\nvar shield\nvar angry_body = null\nvar rainbow_spawned = true\nvar rainbow = 'rainbow'\n\nfunc _init(bag).(bag):\n self.avatar = preload(\"res:\/\/scenes\/enemies\/grumpy_prime.xscn\").instance()\n self.body_part_head = self.avatar.get_node('body')\n self.body_part_body = self.avatar.get_node('body')\n self.body_part_footer = self.avatar.get_node('body')\n self.animations = self.avatar.get_node('body_animations')\n self.angry_body = self.avatar.get_node('angry')\n self.shield = self.avatar.get_node('shield')\n self.hit_particles = self.avatar.get_node('hitparticles')\n self.speech_bubble = self.avatar.get_node('speech')\n\n self.velocity = 25\n self.attack_range = 50\n self.attack_strength = 4\n self.attack_cooldown = 2\n self.max_hp = 200\n self.hp = 200\n self.score = 200\n self.is_invulnerable = true\n\n self.stun_duration = 0.4\n self.mass = 3\n\n self.phase_hp_thresholds = [\n [100, 2],\n ]\n\n for point in self.shield_points:\n self.shield_points_global.push_back(self.bag.room_loader.translate_position(point))\n\nfunc spawn(position):\n .spawn(position)\n self.randomize_movement()\n self.raise_shield()\n self.spawn_thrash()\n self.speak(\"NO\", 2, true)\n\nfunc phase2():\n self.body_part_body.hide()\n self.angry_body.show()\n self.THRASH_SPAWN_TIME = 2.5\n self.VULNERABLE_TIME = 2\n self.RAINBOW_DELAY = 2.5\n self.velocity = 50\n self.speak(\"I had fun once\", 2, true)\n\nfunc process_ai():\n var distance\n\n if self.target == null:\n for player in self.bag.players.players:\n if player.is_playing && player.is_alive:\n distance = self.calculate_distance_to_object(player)\n if distance < self.aggro_range:\n self.target = player\n break\n\n if self.target != null:\n distance = self.calculate_distance_to_object(self.target)\n if not self.target.is_alive || distance > self.aggro_range:\n self.target = null\n elif distance < self.attack_range and not self.is_attack_on_cooldown:\n self.attack()\n\n if not self.rainbow_spawned:\n self.rainbow_spawned = true\n self.bag.timers.set_timeout(self.RAINBOW_DELAY, self, 'spawn_rainbow')\n\nfunc randomize_movement():\n if self.hp < 1:\n return\n\n var direction\n\n var x = randi() % 18 + 1\n var y = randi() % 8 + 1\n\n direction = self.bag.room_loader.translate_position(Vector2(x, y))\n direction = self.cast_movement_vector(direction)\n\n self.movement_vector[0] = direction.x\n self.movement_vector[1] = direction.y\n\nfunc reset_movement():\n return\n\nfunc modify_position(delta):\n var x = self.movement_vector[0]\n var y = self.movement_vector[1]\n var motion = Vector2(x, y) * self.velocity * delta\n self.avatar.move(motion)\n self.flip(self.movement_vector[0])\n if (self.avatar.is_colliding()):\n var n = self.avatar.get_collision_normal()\n motion = n.slide(motion)\n self.avatar.move(motion)\n self.randomize_movement()\n\nfunc external_stun(duration=null):\n if self.is_invulnerable:\n return\n\n .external_stun(duration)\n\nfunc push_back(enemy):\n if self.is_invulnerable:\n return\n\n .push_back(enemy)\n\nfunc schedule_thrash_spawn():\n self.bag.timers.set_timeout(self.THRASH_SPAWN_TIME, self, 'spawn_thrash')\n\nfunc spawn_thrash():\n if self.hp < 1:\n return\n\n var position = self.avatar.get_global_pos()\n var new_guy\n\n for i in range(0, self.THRASH_AMOUNT):\n position = self.avatar.get_global_pos()\n position.x += pow(-1, i) * 30\n position.y += 30\n new_guy = self.bag.enemies.spawn_global(self.thrash_template, position)\n new_guy.is_attack_on_cooldown = true\n new_guy.drop_chance = 0\n self.bag.timers.set_timeout(self.attack_cooldown, new_guy, \"attack_cooled_down\")\n new_guy.make_invulnerable(1)\n\n self.schedule_thrash_spawn()\n\nfunc disable_shield():\n self.is_invulnerable = false\n self.shield.hide()\n self.bag.timers.set_timeout(self.VULNERABLE_TIME, self, 'raise_shield')\n\nfunc raise_shield():\n self.animations.play('shield_on')\n self.bag.timers.set_timeout(0.5, self, 'raise_shield_anim_end')\n\nfunc raise_shield_anim_end():\n self.is_invulnerable = true\n self.rainbow_spawned = false\n self.shield.show()\n\nfunc spawn_rainbow():\n if self.hp < 1:\n return\n\n self.bag.enemies.spawn_global(self.rainbow, self.pick_next_point())\n\nfunc pick_next_point():\n return self.shield_points_global[randi() % self.shield_points_global.size()]\n\n\nfunc flip_body_parts(flip_flag):\n .flip_body_parts(flip_flag)\n self.angry_body.set_flip_h(flip_flag)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"d5ece437504ba765bbd43432d9fdc8c79e937996","subject":"gd \"G\u00e0idhlig\" translation #15427. Author: GunChleoc. Added some translations.","message":"gd \"G\u00e0idhlig\" translation #15427. Author: GunChleoc. Added some translations.","repos":"clarkerubber\/lila,terokinnunen\/lila,clarkerubber\/lila,arex1337\/lila,JimmyMow\/lila,clarkerubber\/lila,terokinnunen\/lila,samuel-soubeyran\/lila,arex1337\/lila,luanlv\/lila,samuel-soubeyran\/lila,samuel-soubeyran\/lila,clarkerubber\/lila,terokinnunen\/lila,samuel-soubeyran\/lila,arex1337\/lila,samuel-soubeyran\/lila,luanlv\/lila,clarkerubber\/lila,terokinnunen\/lila,JimmyMow\/lila,luanlv\/lila,luanlv\/lila,JimmyMow\/lila,clarkerubber\/lila,clarkerubber\/lila,arex1337\/lila,samuel-soubeyran\/lila,terokinnunen\/lila,arex1337\/lila,luanlv\/lila,arex1337\/lila,terokinnunen\/lila,samuel-soubeyran\/lila,terokinnunen\/lila,JimmyMow\/lila,luanlv\/lila,JimmyMow\/lila,JimmyMow\/lila,luanlv\/lila,JimmyMow\/lila,arex1337\/lila","old_file":"conf\/messages.gd","new_file":"conf\/messages.gd","new_contents":"playWithAFriend=Cluich c\u00f2mhla ri caraid\nplayWithTheMachine=Cluich an aghaidh a' choimpiutair\ntoInviteSomeoneToPlayGiveThisUrl=Gus cuireadh a thoirt do chuideigin, thoir an url seo dha\ngameOver=Cr\u00ecoch a\u2019 gheama\nwaitingForOpponent=A\u2019 feitheamh air n\u00e0mhaid\nwaiting=A\u2019 feitheamh\nyourTurn=An turas agad\naiNameLevelAiLevel=%s inbhe %s\nlevel=Inbhe\ntoggleTheChat=Toglaich a\u2019 chabadaich\ntoggleSound=Toglaich fuaim\nchat=Cabadaich\nresign=G\u00e8ill\ncheckmate=Tul-chasg\nstalemate=Clos-cluiche\nwhite=Geal\nblack=Dubh\nrandomColor=Dath air thuaiream\ncreateAGame=Cruthaich geama\nwhiteIsVictorious=Bhuannaich geal\nblackIsVictorious=Bhuannaich dubh\nkingInTheCenter=R\u00ecgh sa mheadhan\nthreeChecks=Tr\u00ec caisg\nplayWithTheSameOpponentAgain=Cluich an aghaidh an aon n\u00e0mhaid a-rithist\nnewOpponent=N\u00e0mhaid \u00f9r\nplayWithAnotherOpponent=Cluich an aghaidh n\u00e0mhaid eile\nyourOpponentWantsToPlayANewGameWithYou=Tha an n\u00e0mhaid agad airson geama \u00f9r a chluich \u2019nad aghaidh\njoinTheGame=Thig a-steach dhan gheama\nwhitePlays=Tha geal a\u2019 cluich\nblackPlays=Tha dubh a\u2019 cluich\ntheOtherPlayerHasLeftTheGameYouCanForceResignationOrWaitForHim=Tha an cluicheadair eile air a' gheama fh\u00e0gail. Is urrainn dhut g\u00e8illeadh a chur air, geama ionnannach a ghairm, no feitheamh air a shon.\nmakeYourOpponentResign=Cuir g\u00e8illeadh air an n\u00e0mhaid agad\nforceResignation=Gairm buaidh\nforceDraw=Gairm geama ionnannach\ntalkInChat=D\u00e8an cabadaich\ntheFirstPersonToComeOnThisUrlWillPlayWithYou=Cluichidh a\u2019 chiad neach a thig a-steach air an url seo c\u00f2mhla riut.\nwhiteCreatesTheGame=Tha geal a\u2019 cruthachadh a\u2019 gheama\nblackCreatesTheGame=Tha dubh a\u2019 cruthachadh a\u2019 gheama\nwhiteJoinsTheGame=Th\u00e0inig geal a-steach dhan gheama\nblackJoinsTheGame=Th\u00e0inig dubh a-steach dhan gheama\nwhiteResigned=Gh\u00e8ill geal\nblackResigned=Gh\u00e8ill dubh\nwhiteLeftTheGame=Dh\u2019fh\u00e0g geal an geama\nblackLeftTheGame=Dh\u2019fh\u00e0g dubh an geama\nshareThisUrlToLetSpectatorsSeeTheGame=Co-roinn an url seo gus luchd-amhairc a leigeil a-steach dhan gheama\nreplayAndAnalyse=Ath-chluich is sgr\u00f9daich\ncomputerAnalysisInProgress=Tha anailis a\u2019 choimpiutair a\u2019 dol\ntheComputerAnalysisHasFailed=Dh\u2019fh\u00e0illig le anailis a\u2019 choimpiutair\nviewTheComputerAnalysis=Seall anailis a\u2019 choimpiutair\nrequestAComputerAnalysis=Iarr anailis air a\u2019 choimpiutair\ncomputerAnalysis=Anailis a\u2019 choimpiutair\nanalysis=B\u00f2rd sgr\u00f9daidh\nblunders=Tuislidhean\nmistakes=Mearachdan\ninaccuracies=Neo-eagnaidhean\nmoveTimes=\u00d9ine nan gluasadan\nflipBoard=D\u00e8an flip air a\u2019 bh\u00f2rd\nthreefoldRepetition=Treas ath-nochdadh\nclaimADraw=Gairm geama ionnannach\nofferDraw=Tairg geama ionnannach\ndraw=Geama ionnannach\nnbConnectedPlayers=%s cluicheadairean\ngamesBeingPlayedRightNow=Geamannan a tha \u2019gan cluich an-dr\u00e0sta fh\u00e8in\nviewAllNbGames=%s geamannan\nviewNbCheckmates=%s tul-chaisg\nnbBookmarks=%s comharran-l\u00ecn\nnbPopularGames=%s geamannan m\u00f2r-ch\u00f2rdte\nnbAnalysedGames=%s geamannan sgr\u00f9daichte\nbookmarkedByNbPlayers=Comharra-leabhair le %s cluicheadairean\nviewInFullSize=Seall sa mheud iomlan\nlogOut=Log a-mach\nsignIn=Log a-steach\nnewToLichess=\u00d9r air Lichess?\nyouNeedAnAccountToDoThat=Tha feum agad air cunntas gus sin a dh\u00e8anamh\nsignUp=Cl\u00e0raich\ngames=Geamannan\nforum=B\u00f2rd-brath\nxPostedInForumY=Sgr\u00ecobh %s san fh\u00f2ram %s\nlatestForumPosts=Na postaichean as \u00f9ire\nplayers=Cluicheadairean\nminutesPerSide=Mionaidean gach taobh\nvariant=Caochladh\ntimeControl=Smachd air an \u00f9ine\nrealTime=F\u00ecor-\u00f9ine\ndaysPerTurn=L\u00e0ithean gach cuairt\noneDay=Aon latha\nnbDays=%s l\u00e0(ithean)\nnbHours=%s uair(ean)\ntime=\u00d9ine\nrating=Rangachadh\nusername=Far-ainm\npassword=Facal-faire\nhaveAnAccount=A bheil cunntas agad?\nchangePassword=Atharraich am facal-faire\nchangeEmail=Atharraich am post-d\nemail=Post-d\nemailIsOptional=Tha am post-d roghainneil. cleachdaich Lichess an se\u00f2ladh puist-d agad gus am facal-faire agad ath-shuidheachadh ma dh\u00ecochuimhnicheas tu e.\npasswordReset=Ath-shuidheachadh an fhacail-fhaire\nforgotPassword=An do dh\u00ecochuimhnich thu am facal-faire?\nlearnMoreAboutLichess=Ionnsaich barrachd mu Lichess\nrank=Inbhe\ngamesPlayed=Geamannan air an cluich\nnbGamesWithYou=%s geamannan c\u00f2mhla riut\ndeclineInvitation=Di\u00f9lt cuireadh\ncancel=Sguir dheth\ntimeOut=Dh\u2019fhalbh an \u00f9ine\ndrawOfferSent=Chaidh tairgse airson geama ionnanach a chur\ndrawOfferDeclined=Dhi\u00f9ltadh do thairgse airson geama ionnanach\ndrawOfferAccepted=Ghabhadh ri do thairgse airson geama ionnanach\ndrawOfferCanceled=Sguireadh de do thairgse airson geama ionnanach\nwhiteOffersDraw=Tha geal a' tairgse geama ionnannach\nblackOffersDraw=Tha dubh a' tairgse geama ionnannach\nwhiteDeclinesDraw=Tha geal a' di\u00f9ltadh geama ionnannach\nblackDeclinesDraw=Tha dubh a' di\u00f9ltadh geama ionnannach\nyourOpponentOffersADraw=Tha an n\u00e0mhaid agad a\u2019 tairgse geama ionnanach\naccept=Gabh ris\ndecline=Di\u00f9lt\nplayingRightNow=A\u2019 cluich an-dr\u00e0sta fh\u00e8in\nfinished=Cr\u00ecochnaichte\nabortGame=Stad an geama\ngameAborted=Chaidh sgur dhen gheama\nstandard=Coitcheann\nunlimited=Gun chr\u00ecoch\nmode=Modh\ncasual=Gun rangachadh\nrated=Rangaichte\nthisGameIsRated=Tha an geama seo rangaichte\nrematch=Ath-mhaids\nrematchOfferSent=Chaidh tairgse airson ath-mhaids a chur\nrematchOfferAccepted=Ghabhadh ri do thairgse airson ath-mhaids\nrematchOfferCanceled=Chaidh sgur dhe thairgse ath-mhaids\nrematchOfferDeclined=Tairgse ath-mhaids air a di\u00f9ltadh\ncancelRematchOffer=Sguir dhe thairgse ath-mhaids\nviewRematch=Seall an ath-mhaids\nplay=Cluich\ninbox=Bogsa a-steach\nchatRoom=Se\u00f2mar cabadaich\nspectatorRoom=Se\u00f2mar an luchd-amhairc\ncomposeMessage=Sgr\u00ecobh teachdaireachd\nnoNewMessages=Gun teachdaireachd \u00f9r\nsubject=Cuspair\nrecipient=Faightear\nsend=Cuir\nincrementInSeconds=Ioncramaid ann an diogan\nfreeOnlineChess=T\u00e0ileasg air loidhne an-asgaidh\nspectators=Luchd-amhairc:\nnbWins=Bhuannaich %s\nnbLosses=Chaill %s\nnbDraws=Geama ionnanach le %s\nexportGames=\u00c0s-phortaich geamannan\nratingRange=Rainse an rangachaidh\ngiveNbSeconds=Thoir %s diogan\npremoveEnabledClickAnywhereToCancel=Ro-ghluasad an comas - briog \u00e0ite sam bith airson sgur dheth\nthisPlayerUsesChessComputerAssistance=Tha an cluicheadair seo a\u2019 cleachdadh taic coimpiutair taileisg\nopening=Fosgladh\ntakeback=Tarraing air ais\nproposeATakeback=Tairg tarraing air ais\ntakebackPropositionSent=Tairgse tarraing air ais air a cur\ntakebackPropositionDeclined=Tairgse tarraing air ais air a di\u00f9ltadh\ntakebackPropositionAccepted=Air gabhail ri tairgse tarraing air ais\ntakebackPropositionCanceled=Chaidh sgur dhe thairgse tarraing air ais\nyourOpponentProposesATakeback=Tha an n\u00e0mhaid a\u2019 tairgse tarraing air ais\nbookmarkThisGame=Cruthaich comharra-l\u00ecn airson a\u2019 gheama seo.\nsearch=Lorg\nadvancedSearch=Lorg adhartach\ntournament=F\u00e8ill-chluich\ntournaments=F\u00e8ill-chluichean\ntournamentPoints=Puingean f\u00e8ill-chluich\nviewTournament=Seall an fh\u00e8ill-chluich\nbackToTournament=Till dhan fh\u00e8ill-chluich\nbackToGame=Till dhan gheama\nfreeOnlineChessGamePlayChessNowInACleanInterfaceNoRegistrationNoAdsNoPluginRequiredPlayChessWithComputerFriendsOrRandomOpponents=T\u00e0ileasg air loidhne an-asgaidh. Cluich t\u00e0ileasg ann am pr\u00f2gram air a bheil dreach glan. Gun chl\u00e0radh, gun sanasachd, gun fheum air plugan. Cluich t\u00e0ileasg an aghaidh a\u2019 choimpiutair, charaidean no n\u00e0imhdean air thuaiream.\nteams=Sgiobaidhean\nnbMembers=%s ball\nallTeams=A h-uile sgioba\nnewTeam=Sgioba \u00f9r\nmyTeams=Na sgiobaidhean agam\nnoTeamFound=Cha deach sgioba a lorg\njoinTeam=Gabh p\u00e0irt san sgioba\nquitTeam=F\u00e0g an sgioba\nanyoneCanJoin=Faodaidh duine sam bith p\u00e0irt a ghabhail ann\naConfirmationIsRequiredToJoin=Tha feum air dearbhadh gus p\u00e0irt a ghabhail ann\njoiningPolicy=Poileasaidh na ballrachd\nteamLeader=Ceannard an sgioba\nteamBestPlayers=Na cluicheadairean as fhearr\nteamRecentMembers=Na buill as \u00f9ire\nxJoinedTeamY=Ghabh %s ballrachd san sgioba %s\nxCreatedTeamY=Chruthaich %s an sgioba %s\naverageElo=Rangachadh cuibheasach\nlocation=\u00c0ite\nsettings=Roghainnean\nfilterGames=Criathraich na geamannan\nreset=Ath-shuidhich\napply=Cuir an s\u00e0s\nleaderboard=Cl\u00e0r nan curaidh\npasteTheFenStringHere=Cuir a-steach an t-sreang FEN an-seo\npasteThePgnStringHere=Cuir a-steach an t-sreang PGN an-seo\nfromPosition=On t-suidheachadh\ncontinueFromHere=Lean air adhart on a sheo\nimportGame=Ion-phortaich geama\nnbImportedGames=%s geamannan air an ion-phortadh\nthisIsAChessCaptcha=Seo CAPTCHA t\u00e0ileisg.\nclickOnTheBoardToMakeYourMove=Briog air a\u2019 bh\u00f2rd airson gluasad \u2019s dearbhaich gur e duine a th\u2019 annad.\nnotACheckmate=Chan e tul-chasg a th\u2019 ann\ncolorPlaysCheckmateInOne=Tha %s a\u2019 cluich; tul-chasg an ceann gluasaid\nretry=Feuch ris a-rithist\nreconnecting=Ag ath-cheangal\nonlineFriends=Caraidean air loidhne\nnoFriendsOnline=Chan eil caraid air loidhne\nfindFriends=Lorg caraidean\nfavoriteOpponents=Na farpaisichean as annsa leat\nfollow=Lean air\nfollowing=A\u2019 leantainn air\nunfollow=Na lean air tuilleadh\nblock=Bac\nblocked=Bacte\nunblock=D\u00ec-bhac\nfollowsYou=\u2019Gad leantainn\nxStartedFollowingY=Th\u00f2isich %s a\u2019 leantainn air %s\nnbFollowers=%s luchd-leantainn\nnbFollowing=%s \u2019ga leantainn\nmore=Barrachd\nmemberSince=Ball o chionn\nlastLogin=An logadh a-steach mu dheireadh\nchallengeToPlay=Thoir d\u00f9bhlan cluiche dha\nplayer=Cluicheadair\nlist=Liosta\ngraph=Graf\nlessThanNbMinutes=Nas lugha na %s mionaidean\nxToYMinutes=%s gu %s mionaidean\ntextIsTooShort=Tha an teacsa ro ghoirid.\ntextIsTooLong=Tha an teacsa ro fhada.\nrequired=Riatanach.\nopenTournaments=F\u00e8ill-chluichean fosgailte\nduration=Faid\nwinner=Buannaiche\nstanding=A\u2019 seasamh\ncreateANewTournament=Cruthaich f\u00e8ill-chluich \u00f9r\njoin=Gabh p\u00e0irt ann\nwithdraw=C\u00f9laich\npoints=Puingean\nwins=Buaidhean\nlosses=Ruaigean\nwinStreak=Sreath de bhuaidhean\ncreatedBy=Air a chruthachadh le\ntournamentIsStarting=Tha an fh\u00e8ill-chluich gu bhith t\u00f2iseachadh\nmembersOnly=Buill a-mh\u00e0in\nboardEditor=Deasaiche a\u2019 bh\u00f9ird\nstartPosition=Suidheachadh an t\u00f2iseachaidh\nclearBoard=Falamhaich am b\u00f2rd\nsavePosition=S\u00e0bhail an suidheachadh\nloadPosition=Luchdaich suidheachadh\nisPrivate=Pr\u00ecobhaideach\nreportXToModerators=Cuir gearan mu %s dha na maoir\nprofile=Pr\u00f2ifil\neditProfile=Deasaich a\u2019 phr\u00f2ifil\nfirstName=Ainm\nlastName=Sloinneadh\nbiography=Eachdraidh-beatha\ncountry=D\u00f9thaich\npreferences=Roghainnean\nwatchLichessTV=Coimhead air TBh Lichess\npreviouslyOnLichessTV=Air Tbh Lichess roimhe\ntodaysLeaders=S\u00e0r-chluicheadairean an-diugh\nonlinePlayers=Cluicheadairean air loidhne\nprogressToday=Adhartas an-diugh\nprogressThisWeek=Adhartas an seachdain seo\nprogressThisMonth=Adhartas am m\u00ecos seo\nleaderboardThisWeek=S\u00e0r-chluicheadairean na seachdaine\nleaderboardThisMonth=S\u00e0r-chluicheadairean a\u2019 mh\u00ecosa\nactiveToday=Gn\u00ecomhach an-diugh\nactivePlayers=Cluicheadairean gn\u00ecomhach\nbewareTheGameIsRatedButHasNoClock=Thoir an aire, th\u00e8id an geama seo rangachadh ach chan eil uaireadair aige!\ntraining=Tr\u00e8anadh\nyourPuzzleRatingX=An rangachadh agad: %s\nfindTheBestMoveForWhite=Lorg an gluasad as fhearr airson geal.\nfindTheBestMoveForBlack=Lorg an gluasad as fhearr airson dubh.\ntoTrackYourProgress=Gus s\u00f9il a chumail air d\u2019 adhartas:\ntrainingSignupExplanation=Bheir Lichess t\u00f2imhseachain dhut a bhios freagarrach dhan chomas agad ach am faigh thu tr\u00e8anadh as iomchaidh.\nrecentlyPlayedPuzzles=T\u00f2imhseachain o chionn goirid\npuzzleId=T\u00f2imhseachan %s\npuzzleOfTheDay=T\u00f2imhseachan an latha\nclickToSolve=Briog an-seo airson fhuasgladh\ngoodMove=Seo gluasad math\nbutYouCanDoBetter=Ach tha gluasad nas fhearr ann.\nbestMove=Seo an gluasad as fhearr!\nkeepGoing=Cum ort...\npuzzleFailed=Cha deach leat\nbutYouCanKeepTrying=Ach faodaidh tu feuchainn a-rithist.\nvictory=Buaidh!\ngiveUp=Thoir g\u00e8ill\npuzzleSolvedInXSeconds=Rinn thu a\u2019 ch\u00f9is air an ceann %s diog.\nwasThisPuzzleAnyGood=An robh an t\u00f2imhseachan seo math?\npleaseVotePuzzle=Cuidich lichess \u2019s cuir bh\u00f2t ann leis an t-saighead suas no s\u00ecos:\nthankYou=M\u00f2ran taing!\nratingX=Rangachadh: %s\nplayedXTimes=Air a chluich %s turas\nfromGameLink=On gheama %s\nstartTraining=T\u00f2isich air an tr\u00e8anadh\ncontinueTraining=Lean air adhart leis an tr\u00e8anadh\nretryThisPuzzle=Feuch ris an t\u00f2imhseachan seo a-rithist\nthisPuzzleIsCorrect=Tha an t\u00f2imhseachan seo ceart is inntinneach\nthisPuzzleIsWrong=Tha an t\u00f2imhseachan seo cearr no d\u00f2rainneach\nyouHaveNbSecondsToMakeYourFirstMove=Tha %s diog(an) air fh\u00e0gail dhut airson a' chiad gluasaid agad!\nnbGamesInPlay=%s geama 'gan cluich\nopeningId=Fosgladh %s\nyourOpeningRatingX=An rangachadh fosglaidh agad: %s\nfindNbStrongMoves=Lorg %s gluasad(an) l\u00e0idir\nopeningFailed=Dh'fh\u00e0illig leis an fhosgladh\nopeningSolved=Chaidh am fosgladh fhuasgladh\nrecentlyPlayedOpenings=Fosglaidhean a chaidh a chluich o chionn goirid\npuzzles=T\u00f2imhseachain\nopenings=Fosglaidhean\nlatestUpdates=Na naidheachdan as \u00f9ire\ntournamentWinners=Feadhainn a bhuannaich f\u00e8ill-chluich\nname=Ainm\ndescription=Tuairisgeul\nno=Tha\nyes=Chan eil\nhelp=Cobhair:\ncreateANewTopic=Cruthaich cuspair \u00f9r\ntopics=Cuspairean\nposts=Postaichean\nlastPost=Am post mu dheireadh\nviews=Air a shealltainn\nreplies=Freagairtean\nreplyToThisTopic=Freagair dhan chuspair seo\nreply=Freagair\nmessage=Teachdaireachd\ncreateTheTopic=Cruthaich an cuspair\nreportAUser=D\u00e8an aithris air cleachdaiche\nuser=Cleachdaiche\nreason=Adhbhar\nwhatIsIheMatter=D\u00e8 an trioblaid?\ncheat=Cealgaireachd\ninsult=Mosach\ntroll=Troll\nother=Adhbhar eile\nby=le %s\nthisTopicIsNowClosed=Tha an cuspair seo d\u00f9inte a-nis.\nblog=Bloga\nmap=Mapa\nnotes=N\u00f2taichean\ncommunity=Coimhearsnachd\ntools=Goireasean\nwatch=Coimhead\n","old_contents":"playWithAFriend=Cluich c\u00f2mhla ri caraid\nplayWithTheMachine=Cluich an aghaidh a' choimpiutair\ntoInviteSomeoneToPlayGiveThisUrl=Gus cuireadh a thoirt do chuideigin, thoir an url seo dha\ngameOver=Cr\u00ecoch a\u2019 gheama\nwaitingForOpponent=A\u2019 feitheamh air n\u00e0mhaid\nwaiting=A\u2019 feitheamh\nyourTurn=An turas agad\naiNameLevelAiLevel=%s inbhe %s\nlevel=Inbhe\ntoggleTheChat=Toglaich a\u2019 chabadaich\ntoggleSound=Toglaich fuaim\nchat=Cabadaich\nresign=G\u00e8ill\ncheckmate=Tul-chasg\nstalemate=Clos-cluiche\nwhite=Geal\nblack=Dubh\nrandomColor=Dath air thuaiream\ncreateAGame=Cruthaich geama\nwhiteIsVictorious=Bhuannaich geal\nblackIsVictorious=Bhuannaich dubh\nplayWithTheSameOpponentAgain=Cluich an aghaidh an aon n\u00e0mhaid a-rithist\nnewOpponent=N\u00e0mhaid \u00f9r\nplayWithAnotherOpponent=Cluich an aghaidh n\u00e0mhaid eile\nyourOpponentWantsToPlayANewGameWithYou=Tha an n\u00e0mhaid agad airson geama \u00f9r a chluich \u2019nad aghaidh\njoinTheGame=Thig a-steach dhan gheama\nwhitePlays=Tha geal a\u2019 cluich\nblackPlays=Tha dubh a\u2019 cluich\ntheOtherPlayerHasLeftTheGameYouCanForceResignationOrWaitForHim=Tha an cluicheadair eile air a' gheama fh\u00e0gail. Is urrainn dhut g\u00e8illeadh a chur air, geama ionnannach a ghairm, no feitheamh air a shon.\nmakeYourOpponentResign=Cuir g\u00e8illeadh air an n\u00e0mhaid agad\nforceResignation=Gairm buaidh\nforceDraw=Gairm geama ionnannach\ntalkInChat=D\u00e8an cabadaich\ntheFirstPersonToComeOnThisUrlWillPlayWithYou=Cluichidh a\u2019 chiad neach a thig a-steach air an url seo c\u00f2mhla riut.\nwhiteCreatesTheGame=Tha geal a\u2019 cruthachadh a\u2019 gheama\nblackCreatesTheGame=Tha dubh a\u2019 cruthachadh a\u2019 gheama\nwhiteJoinsTheGame=Th\u00e0inig geal a-steach dhan gheama\nblackJoinsTheGame=Th\u00e0inig dubh a-steach dhan gheama\nwhiteResigned=Gh\u00e8ill geal\nblackResigned=Gh\u00e8ill dubh\nwhiteLeftTheGame=Dh\u2019fh\u00e0g geal an geama\nblackLeftTheGame=Dh\u2019fh\u00e0g dubh an geama\nshareThisUrlToLetSpectatorsSeeTheGame=Co-roinn an url seo gus luchd-amhairc a leigeil a-steach dhan gheama\nreplayAndAnalyse=Ath-chluich is sgr\u00f9daich\ncomputerAnalysisInProgress=Tha anailis a\u2019 choimpiutair a\u2019 dol\ntheComputerAnalysisHasFailed=Dh\u2019fh\u00e0illig le anailis a\u2019 choimpiutair\nviewTheComputerAnalysis=Seall anailis a\u2019 choimpiutair\nrequestAComputerAnalysis=Iarr anailis air a\u2019 choimpiutair\ncomputerAnalysis=Anailis a\u2019 choimpiutair\nblunders=Tuislidhean\nmistakes=Mearachdan\ninaccuracies=Neo-eagnaidhean\nmoveTimes=\u00d9ine nan gluasadan\nflipBoard=D\u00e8an flip air a\u2019 bh\u00f2rd\nthreefoldRepetition=Treas ath-nochdadh\nclaimADraw=Gairm geama ionnannach\nofferDraw=Tairg geama ionnannach\ndraw=Geama ionnannach\nnbConnectedPlayers=%s cluicheadairean\ngamesBeingPlayedRightNow=Geamannan a tha \u2019gan cluich an-dr\u00e0sta fh\u00e8in\nviewAllNbGames=%s geamannan\nviewNbCheckmates=%s tul-chaisg\nnbBookmarks=%s comharran-l\u00ecn\nnbPopularGames=%s geamannan m\u00f2r-ch\u00f2rdte\nnbAnalysedGames=%s geamannan sgr\u00f9daichte\nbookmarkedByNbPlayers=Comharra-leabhair le %s cluicheadairean\nviewInFullSize=Seall sa mheud iomlan\nlogOut=Log a-mach\nsignIn=Log a-steach\nnewToLichess=\u00d9r air Lichess?\nyouNeedAnAccountToDoThat=Tha feum agad air cunntas gus sin a dh\u00e8anamh\nsignUp=Cl\u00e0raich\ngames=Geamannan\nforum=B\u00f2rd-brath\nxPostedInForumY=Sgr\u00ecobh %s san fh\u00f2ram %s\nlatestForumPosts=Na postaichean as \u00f9ire\nplayers=Cluicheadairean\nminutesPerSide=Mionaidean gach taobh\nvariant=Caochladh\ntimeControl=Smachd air an \u00f9ine\ntime=\u00d9ine\nusername=Far-ainm\npassword=Facal-faire\nhaveAnAccount=A bheil cunntas agad?\nchangePassword=Atharraich am facal-faire\nlearnMoreAboutLichess=Ionnsaich barrachd mu Lichess\nrank=Inbhe\ngamesPlayed=Geamannan air an cluich\nnbGamesWithYou=%s geamannan c\u00f2mhla riut\ndeclineInvitation=Di\u00f9lt cuireadh\ncancel=Sguir dheth\ntimeOut=Dh\u2019fhalbh an \u00f9ine\ndrawOfferSent=Chaidh tairgse airson geama ionnanach a chur\ndrawOfferDeclined=Dhi\u00f9ltadh do thairgse airson geama ionnanach\ndrawOfferAccepted=Ghabhadh ri do thairgse airson geama ionnanach\ndrawOfferCanceled=Sguireadh de do thairgse airson geama ionnanach\nyourOpponentOffersADraw=Tha an n\u00e0mhaid agad a\u2019 tairgse geama ionnanach\naccept=Gabh ris\ndecline=Di\u00f9lt\nplayingRightNow=A\u2019 cluich an-dr\u00e0sta fh\u00e8in\nfinished=Cr\u00ecochnaichte\nabortGame=Stad an geama\ngameAborted=Chaidh sgur dhen gheama\nstandard=Coitcheann\nunlimited=Gun chr\u00ecoch\nmode=Modh\ncasual=Gun rangachadh\nrated=Rangaichte\nthisGameIsRated=Tha an geama seo rangaichte\nrematch=Ath-mhaids\nrematchOfferSent=Chaidh tairgse airson ath-mhaids a chur\nrematchOfferAccepted=Ghabhadh ri do thairgse airson ath-mhaids\nrematchOfferCanceled=Chaidh sgur dhe thairgse ath-mhaids\nrematchOfferDeclined=Tairgse ath-mhaids air a di\u00f9ltadh\ncancelRematchOffer=Sguir dhe thairgse ath-mhaids\nviewRematch=Seall an ath-mhaids\nplay=Cluich\ninbox=Bogsa a-steach\nchatRoom=Se\u00f2mar cabadaich\nspectatorRoom=Se\u00f2mar an luchd-amhairc\ncomposeMessage=Sgr\u00ecobh teachdaireachd\nnoNewMessages=Gun teachdaireachd \u00f9r\nsubject=Cuspair\nrecipient=Faightear\nsend=Cuir\nincrementInSeconds=Ioncramaid ann an diogan\nfreeOnlineChess=T\u00e0ileasg air loidhne an-asgaidh\nspectators=Luchd-amhairc:\nnbWins=Bhuannaich %s\nnbLosses=Chaill %s\nnbDraws=Geama ionnanach le %s\nexportGames=\u00c0s-phortaich geamannan\nratingRange=Rainse an rangachaidh\ngiveNbSeconds=Thoir %s diogan\npremoveEnabledClickAnywhereToCancel=Ro-ghluasad an comas - briog \u00e0ite sam bith airson sgur dheth\nthisPlayerUsesChessComputerAssistance=Tha an cluicheadair seo a\u2019 cleachdadh taic coimpiutair taileisg\nopening=Fosgladh\ntakeback=Tarraing air ais\nproposeATakeback=Tairg tarraing air ais\ntakebackPropositionSent=Tairgse tarraing air ais air a cur\ntakebackPropositionDeclined=Tairgse tarraing air ais air a di\u00f9ltadh\ntakebackPropositionAccepted=Air gabhail ri tairgse tarraing air ais\ntakebackPropositionCanceled=Chaidh sgur dhe thairgse tarraing air ais\nyourOpponentProposesATakeback=Tha an n\u00e0mhaid a\u2019 tairgse tarraing air ais\nbookmarkThisGame=Cruthaich comharra-l\u00ecn airson a\u2019 gheama seo.\nsearch=Lorg\nadvancedSearch=Lorg adhartach\ntournament=F\u00e8ill-chluich\ntournaments=F\u00e8ill-chluichean\ntournamentPoints=Puingean f\u00e8ill-chluich\nviewTournament=Seall an fh\u00e8ill-chluich\nbackToTournament=Till dhan fh\u00e8ill-chluich\nfreeOnlineChessGamePlayChessNowInACleanInterfaceNoRegistrationNoAdsNoPluginRequiredPlayChessWithComputerFriendsOrRandomOpponents=T\u00e0ileasg air loidhne an-asgaidh. Cluich t\u00e0ileasg ann am pr\u00f2gram air a bheil dreach glan. Gun chl\u00e0radh, gun sanasachd, gun fheum air plugan. Cluich t\u00e0ileasg an aghaidh a\u2019 choimpiutair, charaidean no n\u00e0imhdean air thuaiream.\nteams=Sgiobaidhean\nnbMembers=%s ball\nallTeams=A h-uile sgioba\nnewTeam=Sgioba \u00f9r\nmyTeams=Na sgiobaidhean agam\nnoTeamFound=Cha deach sgioba a lorg\njoinTeam=Gabh p\u00e0irt san sgioba\nquitTeam=F\u00e0g an sgioba\nanyoneCanJoin=Faodaidh duine sam bith p\u00e0irt a ghabhail ann\naConfirmationIsRequiredToJoin=Tha feum air dearbhadh gus p\u00e0irt a ghabhail ann\njoiningPolicy=Poileasaidh na ballrachd\nteamLeader=Ceannard an sgioba\nteamBestPlayers=Na cluicheadairean as fhearr\nteamRecentMembers=Na buill as \u00f9ire\nxJoinedTeamY=Ghabh %s ballrachd san sgioba %s\nxCreatedTeamY=Chruthaich %s an sgioba %s\naverageElo=Rangachadh cuibheasach\nlocation=\u00c0ite\nsettings=Roghainnean\nfilterGames=Criathraich na geamannan\nreset=Ath-shuidhich\napply=Cuir an s\u00e0s\nleaderboard=Cl\u00e0r nan curaidh\npasteTheFenStringHere=Cuir a-steach an t-sreang FEN an-seo\npasteThePgnStringHere=Cuir a-steach an t-sreang PGN an-seo\nfromPosition=On t-suidheachadh\ncontinueFromHere=Lean air adhart on a sheo\nimportGame=Ion-phortaich geama\nnbImportedGames=%s geamannan air an ion-phortadh\nthisIsAChessCaptcha=Seo CAPTCHA t\u00e0ileisg.\nclickOnTheBoardToMakeYourMove=Briog air a\u2019 bh\u00f2rd airson gluasad \u2019s dearbhaich gur e duine a th\u2019 annad.\nnotACheckmate=Chan e tul-chasg a th\u2019 ann\ncolorPlaysCheckmateInOne=Tha %s a\u2019 cluich; tul-chasg an ceann gluasaid\nretry=Feuch ris a-rithist\nreconnecting=Ag ath-cheangal\nonlineFriends=Caraidean air loidhne\nnoFriendsOnline=Chan eil caraid air loidhne\nfindFriends=Lorg caraidean\nfavoriteOpponents=Na farpaisichean as annsa leat\nfollow=Lean air\nfollowing=A\u2019 leantainn air\nunfollow=Na lean air tuilleadh\nblock=Bac\nblocked=Bacte\nunblock=D\u00ec-bhac\nfollowsYou=\u2019Gad leantainn\nxStartedFollowingY=Th\u00f2isich %s a\u2019 leantainn air %s\nnbFollowers=%s luchd-leantainn\nnbFollowing=%s \u2019ga leantainn\nmore=Barrachd\nmemberSince=Ball o chionn\nlastLogin=An logadh a-steach mu dheireadh\nchallengeToPlay=Thoir d\u00f9bhlan cluiche dha\nplayer=Cluicheadair\nlist=Liosta\ngraph=Graf\nlessThanNbMinutes=Nas lugha na %s mionaidean\nxToYMinutes=%s gu %s mionaidean\ntextIsTooShort=Tha an teacsa ro ghoirid.\ntextIsTooLong=Tha an teacsa ro fhada.\nrequired=Riatanach.\nopenTournaments=F\u00e8ill-chluichean fosgailte\nduration=Faid\nwinner=Buannaiche\nstanding=A\u2019 seasamh\ncreateANewTournament=Cruthaich f\u00e8ill-chluich \u00f9r\njoin=Gabh p\u00e0irt ann\nwithdraw=C\u00f9laich\npoints=Puingean\nwins=Buaidhean\nlosses=Ruaigean\nwinStreak=Sreath de bhuaidhean\ncreatedBy=Air a chruthachadh le\ntournamentIsStarting=Tha an fh\u00e8ill-chluich gu bhith t\u00f2iseachadh\nmembersOnly=Buill a-mh\u00e0in\nboardEditor=Deasaiche a\u2019 bh\u00f9ird\nstartPosition=Suidheachadh an t\u00f2iseachaidh\nclearBoard=Falamhaich am b\u00f2rd\nsavePosition=S\u00e0bhail an suidheachadh\nloadPosition=Luchdaich suidheachadh\nisPrivate=Pr\u00ecobhaideach\nreportXToModerators=Cuir gearan mu %s dha na maoir\nprofile=Pr\u00f2ifil\neditProfile=Deasaich a\u2019 phr\u00f2ifil\nfirstName=Ainm\nlastName=Sloinneadh\nbiography=Eachdraidh-beatha\ncountry=D\u00f9thaich\npreferences=Roghainnean\nwatchLichessTV=Coimhead air TBh Lichess\npreviouslyOnLichessTV=Air Tbh Lichess roimhe\ntodaysLeaders=S\u00e0r-chluicheadairean an-diugh\nonlinePlayers=Cluicheadairean air loidhne\nprogressToday=Adhartas an-diugh\nprogressThisWeek=Adhartas an seachdain seo\nprogressThisMonth=Adhartas am m\u00ecos seo\nleaderboardThisWeek=S\u00e0r-chluicheadairean na seachdaine\nleaderboardThisMonth=S\u00e0r-chluicheadairean a\u2019 mh\u00ecosa\nactiveToday=Gn\u00ecomhach an-diugh\nactivePlayers=Cluicheadairean gn\u00ecomhach\nbewareTheGameIsRatedButHasNoClock=Thoir an aire, th\u00e8id an geama seo rangachadh ach chan eil uaireadair aige!\ntraining=Tr\u00e8anadh\nyourPuzzleRatingX=An rangachadh agad: %s\nfindTheBestMoveForWhite=Lorg an gluasad as fhearr airson geal.\nfindTheBestMoveForBlack=Lorg an gluasad as fhearr airson dubh.\ntoTrackYourProgress=Gus s\u00f9il a chumail air d\u2019 adhartas:\ntrainingSignupExplanation=Bheir Lichess t\u00f2imhseachain dhut a bhios freagarrach dhan chomas agad ach am faigh thu tr\u00e8anadh as iomchaidh.\nrecentlyPlayedPuzzles=T\u00f2imhseachain o chionn goirid\npuzzleId=T\u00f2imhseachan %s\npuzzleOfTheDay=T\u00f2imhseachan an latha\nclickToSolve=Briog an-seo airson fhuasgladh\ngoodMove=Seo gluasad math\nbutYouCanDoBetter=Ach tha gluasad nas fhearr ann.\nbestMove=Seo an gluasad as fhearr!\nkeepGoing=Cum ort...\npuzzleFailed=Cha deach leat\nbutYouCanKeepTrying=Ach faodaidh tu feuchainn a-rithist.\nvictory=Buaidh!\ngiveUp=Thoir g\u00e8ill\npuzzleSolvedInXSeconds=Rinn thu a\u2019 ch\u00f9is air an ceann %s diog.\nwasThisPuzzleAnyGood=An robh an t\u00f2imhseachan seo math?\npleaseVotePuzzle=Cuidich lichess \u2019s cuir bh\u00f2t ann leis an t-saighead suas no s\u00ecos:\nthankYou=M\u00f2ran taing!\nratingX=Rangachadh: %s\nplayedXTimes=Air a chluich %s turas\nfromGameLink=On gheama %s\nstartTraining=T\u00f2isich air an tr\u00e8anadh\ncontinueTraining=Lean air adhart leis an tr\u00e8anadh\nretryThisPuzzle=Feuch ris an t\u00f2imhseachan seo a-rithist\nthisPuzzleIsCorrect=Tha an t\u00f2imhseachan seo ceart is inntinneach\nthisPuzzleIsWrong=Tha an t\u00f2imhseachan seo cearr no d\u00f2rainneach\ncommunity=Coimhearsnachd\ntools=Goireasean\nwatch=Coimhead\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"GDScript"} {"commit":"368a76707f67b714caeb992f6206727129b7d81e","subject":"Fixed crash due to inheritance of states.","message":"Fixed crash due to inheritance of states.\n","repos":"NiclasEriksen\/godot_rpg","old_file":"scripts\/player_control.gd","new_file":"scripts\/player_control.gd","new_contents":"\nextends Node2D\n\nvar jump_cd = false\nsignal moved(pos, rot)\nsignal stopped\nsignal jump\nsignal attack\nonready var stats = get_node(\"StatsModule\")\nonready var state = Idle.new(self)\nvar fireball = load(\"res:\/\/entities\/projectiles\/TripleFireBall.tscn\")\nvar roots = load(\"res:\/\/entities\/targeted_abilities\/Roots.tscn\")\nvar attacking = false\nvar sprinting = false\nvar last_pos = null\nvar moving = false\nvar vel = Vector2(0, 0)\nvar cur_vel = 0\nexport(int) var max_vel = 100\nvar sprint_factor = 1.5\nvar rot_spd = 3\nvar root = null\nvar anim = null\nvar already_stopped = false\n\nfunc _ready():\n\tset_process(true)\n\tset_process_input(true)\n\troot = get_tree().get_root().get_node(\"Game\")\n\tvar spawn = root.get_node(\"Nav\").get_node(\"Map\").get_node(\"SpawnPoint\")\n\tif spawn:\n\t\tself.set_pos(spawn.get_pos())\n\temit_signal(\"moved\", get_pos(), get_rot())\n\n\nfunc _input(event):\n\tif stats:\n\t\tmax_vel = stats.get_actual(\"movement_speed\")\n\tif event.is_action_pressed(\"MOVE_UP\"):\n\t\tvel.y = vel.y - max_vel\n\telif event.is_action_released(\"MOVE_UP\"):\n\t\tvel.y = vel.y + max_vel\n\tif event.is_action_pressed(\"MOVE_DOWN\"):\n\t\tvel.y = vel.y + max_vel\n\telif event.is_action_released(\"MOVE_DOWN\"):\n\t\tvel.y = vel.y - max_vel\n\tif event.is_action_pressed(\"MOVE_LEFT\"):\n\t\tvel.x = vel.x - max_vel\n\t\t# set_rot(get_rot() - 0.01)\n\telif event.is_action_released(\"MOVE_LEFT\"):\n\t\tvel.x = vel.x + max_vel\n\tif event.is_action_pressed(\"MOVE_RIGHT\"):\n\t\tvel.x = vel.x + max_vel\n\t\t# set_rot(get_rot() + 0.01)\n\telif event.is_action_released(\"MOVE_RIGHT\"):\n\t\tvel.x = vel.x - max_vel\n\tif event.type == InputEvent.MOUSE_BUTTON:\n\t\tif event.button_index == BUTTON_LEFT and event.pressed:\n\t\t\tevent = root.make_input_local(event)\n\t\t\tvar ol = root.get_node(\"ObjectLayer\")\n\t\t\tvar r = roots.instance()\n\t\t\t#r.set_pos(event.pos)\n\t\t\tr.set_pos(event.pos)\n\t\t\tol.add_child(r)\n\n\nfunc _process(delta):\n\t# var r = get_rot()\n\tif Input.is_action_pressed(\"ATTACK\"):\n\t\tif not attacking:\n\t\t\temit_signal(\"attack\")\n\t\t\tvar ol = root.get_node(\"ObjectLayer\")\n\t\t\tvar fbi = fireball.instance()\n\t\t\tfbi.set_rot(get_rot())\n\t\t\tfbi.set_pos(get_pos())\n\t\t\t#fbi.set_velocity(300)\n\t\t\tol.add_child(fbi)\n\n\t\t\t# get_node(\"StatsModule\").apply_effect([[\"mp\", -1]], null)\n\t\t\tattacking = true\n\telse:\n\t\tattacking = false\n\n\tif not stats.immobile:\n\t\tif vel.x or vel.y:\n\t\t\tif already_stopped:\n\t\t\t\tget_node(\"FSM (Finite state machine)\").setState(\"walking\")\n\t\t\talready_stopped = false\n\t\t\temit_signal(\"moved\", get_pos(), get_rot())\n\t\telif not already_stopped:\n\t\t\tget_node(\"FSM (Finite state machine)\").setState(\"idle\")\n\t\t\talready_stopped = true\n\t\t\temit_signal(\"stopped\")\n\n\t\tvar motion = vel * delta\n\t\tmotion = move(motion)\n\t\tif (is_colliding()):\n\t\t\tvar n = get_collision_normal()\n\t\t\tmotion = n.slide(motion)\n\t\t\t# vel = n.slide(vel)\n\t\t\tmove(motion)\n\n\t\tvar r = 0\n\t\tif root:\n\t\t\tr = get_angle_to(root.get_global_mouse_pos()) * (rot_spd * delta)\n\t\t\trotate(r)\n\telse:\n\t\tif not already_stopped:\n\t\t\talready_stopped = true\n\t\t\temit_signal(\"stopped\")\n\n\nfunc jump():\n\tself.emit_signal(\"jump\")\n\tself.emit_signal(\"moved\", get_pos(), get_rot())\n\n\nfunc _on_CanvasModulate_nightmode( state ):\n\tget_node(\"Light2D1\").set_hidden(not state)\n\n\nclass Idle:\n\tvar player\n\n\tfunc _init(player):\n\t\tself.player = player\n\n\tfunc update(delta):\n\t\tpass\n\n\tfunc input(event):\n\t\tpass\n\n\tfunc exit():\n\t\tpass\n\n\nclass Moving:\n\tvar player\n\n\tfunc _init(player):\n\t\tself.player = player\n\n\tfunc update(delta):\n\t\tpass\n\n\tfunc input(event):\n\t\tpass\n\n\tfunc exit():\n\t\tpass\n\n\nclass Immobile:\n\tvar player\n\n\tfunc _init(player):\n\t\tself.player = player\n\n\tfunc update(delta):\n\t\tpass\n\n\tfunc input(event):\n\t\tpass\n\n\tfunc exit():\n\t\tpass\n\n\nclass Stunned:\n\textends Immobile\n\n\tfunc _init(player):\n\t\tself.player = player\n\n\tfunc update(delta):\n\t\tpass\n\n\tfunc input(event):\n\t\tpass\n\n\tfunc exit():\n\t\tpass\n","old_contents":"\nextends Node2D\n\nvar jump_cd = false\nsignal moved(pos, rot)\nsignal stopped\nsignal jump\nsignal attack\nonready var stats = get_node(\"StatsModule\")\nonready var state = Idle.new()\nvar fireball = load(\"res:\/\/entities\/projectiles\/TripleFireBall.tscn\")\nvar roots = load(\"res:\/\/entities\/targeted_abilities\/Roots.tscn\")\nvar attacking = false\nvar sprinting = false\nvar last_pos = null\nvar moving = false\nvar vel = Vector2(0, 0)\nvar cur_vel = 0\nexport(int) var max_vel = 100\nvar sprint_factor = 1.5\nvar rot_spd = 3\nvar root = null\nvar anim = null\nvar already_stopped = false\n\nfunc _ready():\n\tset_process(true)\n\tset_process_input(true)\n\troot = get_tree().get_root().get_node(\"Game\")\n\tvar spawn = root.get_node(\"Nav\").get_node(\"Map\").get_node(\"SpawnPoint\")\n\tif spawn:\n\t\tself.set_pos(spawn.get_pos())\n\temit_signal(\"moved\", get_pos(), get_rot())\n\n\nfunc _input(event):\n\tif stats:\n\t\tmax_vel = stats.get_actual(\"movement_speed\")\n\tif event.is_action_pressed(\"MOVE_UP\"):\n\t\tvel.y = vel.y - max_vel\n\telif event.is_action_released(\"MOVE_UP\"):\n\t\tvel.y = vel.y + max_vel\n\tif event.is_action_pressed(\"MOVE_DOWN\"):\n\t\tvel.y = vel.y + max_vel\n\telif event.is_action_released(\"MOVE_DOWN\"):\n\t\tvel.y = vel.y - max_vel\n\tif event.is_action_pressed(\"MOVE_LEFT\"):\n\t\tvel.x = vel.x - max_vel\n\t\t# set_rot(get_rot() - 0.01)\n\telif event.is_action_released(\"MOVE_LEFT\"):\n\t\tvel.x = vel.x + max_vel\n\tif event.is_action_pressed(\"MOVE_RIGHT\"):\n\t\tvel.x = vel.x + max_vel\n\t\t# set_rot(get_rot() + 0.01)\n\telif event.is_action_released(\"MOVE_RIGHT\"):\n\t\tvel.x = vel.x - max_vel\n\tif event.type == InputEvent.MOUSE_BUTTON:\n\t\tif event.button_index == BUTTON_LEFT and event.pressed:\n\t\t\tevent = root.make_input_local(event)\n\t\t\tvar ol = root.get_node(\"ObjectLayer\")\n\t\t\tvar r = roots.instance()\n\t\t\t#r.set_pos(event.pos)\n\t\t\tr.set_pos(event.pos)\n\t\t\tol.add_child(r)\n\n\nfunc _process(delta):\n\t# var r = get_rot()\n\tif Input.is_action_pressed(\"ATTACK\"):\n\t\tif not attacking:\n\t\t\temit_signal(\"attack\")\n\t\t\tvar ol = root.get_node(\"ObjectLayer\")\n\t\t\tvar fbi = fireball.instance()\n\t\t\tfbi.set_rot(get_rot())\n\t\t\tfbi.set_pos(get_pos())\n\t\t\t#fbi.set_velocity(300)\n\t\t\tol.add_child(fbi)\n\n\t\t\t# get_node(\"StatsModule\").apply_effect([[\"mp\", -1]], null)\n\t\t\tattacking = true\n\telse:\n\t\tattacking = false\n\n\tif not stats.immobile:\n\t\tif vel.x or vel.y:\n\t\t\tif already_stopped:\n\t\t\t\tget_node(\"FSM (Finite state machine)\").setState(\"walking\")\n\t\t\talready_stopped = false\n\t\t\temit_signal(\"moved\", get_pos(), get_rot())\n\t\telif not already_stopped:\n\t\t\tget_node(\"FSM (Finite state machine)\").setState(\"idle\")\n\t\t\talready_stopped = true\n\t\t\temit_signal(\"stopped\")\n\n\t\tvar motion = vel * delta\n\t\tmotion = move(motion)\n\t\tif (is_colliding()):\n\t\t\tvar n = get_collision_normal()\n\t\t\tmotion = n.slide(motion)\n\t\t\t# vel = n.slide(vel)\n\t\t\tmove(motion)\n\n\t\tvar r = 0\n\t\tif root:\n\t\t\tr = get_angle_to(root.get_global_mouse_pos()) * (rot_spd * delta)\n\t\t\trotate(r)\n\telse:\n\t\tif not already_stopped:\n\t\t\talready_stopped = true\n\t\t\temit_signal(\"stopped\")\n\n\nfunc jump():\n\tself.emit_signal(\"jump\")\n\tself.emit_signal(\"moved\", get_pos(), get_rot())\n\n\nfunc _on_CanvasModulate_nightmode( state ):\n\tget_node(\"Light2D1\").set_hidden(not state)\n\n\nclass Idle:\n\tvar player\n\n\tfunc _init(player):\n\t\tself.player = player\n\n\tfunc update(delta):\n\t\tpass\n\n\tfunc input(event):\n\t\tpass\n\n\tfunc exit():\n\t\tpass\n\n\nclass Moving:\n\tvar player\n\n\tfunc _init(player):\n\t\tself.player = player\n\n\tfunc update(delta):\n\t\tpass\n\n\tfunc input(event):\n\t\tpass\n\n\tfunc exit():\n\t\tpass\n\n\nclass Immobile:\n\tvar player\n\n\tfunc _init(player):\n\t\tself.player = player\n\n\tfunc update(delta):\n\t\tpass\n\n\tfunc input(event):\n\t\tpass\n\n\tfunc exit():\n\t\tpass\n\n\nclass Stunned:\n\textends Immobile\n\tvar player\n\n\tfunc _init(player):\n\t\tself.player = player\n\n\tfunc update(delta):\n\t\tpass\n\n\tfunc input(event):\n\t\tpass\n\n\tfunc exit():\n\t\tpass\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"509d0b3ed257e93d2396c084b7c4b3b1caa47592","subject":"gd \"G\u00e0idhlig\" translation #479. Author: jmb.","message":"gd \"G\u00e0idhlig\" translation #479. Author: jmb.\n","repos":"clarkerubber\/lila,JimmyMow\/lila,terokinnunen\/lila,arex1337\/lila,elioair\/lila,elioair\/lila,pawank\/lila,pavelo65\/lila,JimmyMow\/lila,r0k3\/lila,samuel-soubeyran\/lila,pavelo65\/lila,danilovsergey\/i-bur,bjhaid\/lila,terokinnunen\/lila,Happy0\/lila,Happy0\/lila,luanlv\/lila,danilovsergey\/i-bur,arex1337\/lila,terokinnunen\/lila,TangentialAlan\/lila,Happy0\/lila,JimmyMow\/lila,clarkerubber\/lila,Unihedro\/lila,clarkerubber\/lila,pawank\/lila,clarkerubber\/lila,luanlv\/lila,Happy0\/lila,Enigmahack\/lila,samuel-soubeyran\/lila,systemovich\/lila,terokinnunen\/lila,samuel-soubeyran\/lila,abougouffa\/lila,systemovich\/lila,bjhaid\/lila,systemovich\/lila,bjhaid\/lila,elioair\/lila,arex1337\/lila,luanlv\/lila,abougouffa\/lila,JimmyMow\/lila,luanlv\/lila,elioair\/lila,samuel-soubeyran\/lila,r0k3\/lila,r0k3\/lila,clarkerubber\/lila,bjhaid\/lila,arex1337\/lila,Happy0\/lila,ccampo133\/lila,samuel-soubeyran\/lila,abougouffa\/lila,samuel-soubeyran\/lila,pawank\/lila,pawank\/lila,Enigmahack\/lila,TangentialAlan\/lila,danilovsergey\/i-bur,r0k3\/lila,Happy0\/lila,abougouffa\/lila,danilovsergey\/i-bur,abougouffa\/lila,pavelo65\/lila,luanlv\/lila,terokinnunen\/lila,TangentialAlan\/lila,r0k3\/lila,ccampo133\/lila,danilovsergey\/i-bur,ccampo133\/lila,JimmyMow\/lila,clarkerubber\/lila,arex1337\/lila,systemovich\/lila,ccampo133\/lila,Unihedro\/lila,samuel-soubeyran\/lila,arex1337\/lila,JimmyMow\/lila,TangentialAlan\/lila,bjhaid\/lila,pawank\/lila,pavelo65\/lila,Happy0\/lila,r0k3\/lila,Unihedro\/lila,systemovich\/lila,arex1337\/lila,luanlv\/lila,systemovich\/lila,elioair\/lila,pavelo65\/lila,JimmyMow\/lila,Enigmahack\/lila,Enigmahack\/lila,clarkerubber\/lila,Unihedro\/lila,luanlv\/lila,TangentialAlan\/lila,bjhaid\/lila,ccampo133\/lila,Enigmahack\/lila,Unihedro\/lila,pavelo65\/lila,pawank\/lila,elioair\/lila,terokinnunen\/lila,danilovsergey\/i-bur,Enigmahack\/lila,elioair\/lila,TangentialAlan\/lila,Enigmahack\/lila,ccampo133\/lila,Unihedro\/lila,pawank\/lila,abougouffa\/lila,terokinnunen\/lila,Unihedro\/lila,danilovsergey\/i-bur,systemovich\/lila,ccampo133\/lila,TangentialAlan\/lila,r0k3\/lila,bjhaid\/lila,abougouffa\/lila,pavelo65\/lila","old_file":"conf\/messages.gd","new_file":"conf\/messages.gd","new_contents":"playWithAFriend=Cluich c\u00f2mhla ri caraid\ninviteAFriendToPlayWithYou=Thoir cuireadh do charaid gus cluich c\u00f2mhla riut\nplayWithTheMachine=Cluich an aghaidh a' choimpiutair\nchallengeTheArtificialIntelligence=Thoir ionnsaigh air an inntinn fhuadain\ntoInviteSomeoneToPlayGiveThisUrl=Gus cuireadh a thoirt do chuideigin, thoir an url seo seachad\ngameOver=Cr\u00ecoch a\u2019 gheama\nwaitingForOpponent=A\u2019 feitheamh air n\u00e0mhaid\nwaiting=A\u2019 feitheamh\nyourTurn=An turas agad\naiNameLevelAiLevel=%s inbhe %s\nlevel=Inbhe\ntoggleTheChat=Toglaich a\u2019 chabadaich\nchat=Cabadaich\nresign=G\u00e8ill\ncheckmate=Tul-chasg\nstalemate=Clos-cluiche\nwhite=Geal\nblack=Dubh\ncreateAGame=Cruthaich geama\nnoGameAvailableRightNowCreateOne=Chan eil geama ri fhaighinn an-dr\u00e0sta, cruthaich fear \u00f9r!\nwhiteIsVictorious=Bhuannaich geal\nblackIsVictorious=Bhuannaich dubh\nplayWithTheSameOpponentAgain=Cluich an aghaidh an aon n\u00e0mhaid a-rithist\nnewOpponent=N\u00e0mhaid \u00f9r\nplayWithAnotherOpponent=Cluich an aghaidh n\u00e0mhaid eile\nyourOpponentWantsToPlayANewGameWithYou=Tha an n\u00e0mhaid agad airson geama \u00f9r a chluich c\u00f2mhla riut\njoinTheGame=Thig a-steach dhan gheama\nwhitePlays=Tha geal a\u2019 cluich\nblackPlays=Tha dubh a\u2019 cluich\ntheOtherPlayerHasLeftTheGameYouCanForceResignationOrWaitForHim=Tha an geamaiche eile air a' gheama fh\u00e0gail. Is urrainn dhut g\u00e8illeadh a chur air, no feitheamh air a shon.\nmakeYourOpponentResign=Cuir g\u00e8illeadh air an n\u00e0mhaid agad\nforceResignation=Cuir g\u00e8illeadh air an n\u00e0mhaid agad\ntalkInChat=D\u00e8an cabadaich\ntheFirstPersonToComeOnThisUrlWillPlayWithYou=Cluichidh a\u2019 chiad neach a thig a-steach air an url seo c\u00f2mhla riut.\nwhiteCreatesTheGame=Tha geal a\u2019 cruthachadh a\u2019 gheama\nblackCreatesTheGame=Tha dubh a\u2019 cruthachadh a\u2019 gheama\nwhiteJoinsTheGame=Th\u00e0inig geal a-steach dhan gheama\nblackJoinsTheGame=Th\u00e0inig dubh a-steach dhan gheama\nwhiteResigned=Gh\u00e8ill geal\nblackResigned=Gh\u00e8ill dubh\nwhiteLeftTheGame=Dh\u2019fh\u00e0g geal an geama\nblackLeftTheGame=Dh\u2019fh\u00e0g dubh an geama\nshareThisUrlToLetSpectatorsSeeTheGame=Co-roinn an url seo gus luchd-amhairc a leigeil a-steach dhan gheama\nyouAreViewingThisGameAsASpectator=Tha thu a\u2019 coimhead air a\u2019 gheama seo nad neach-amhairc\nreplayAndAnalyse=Ath-chluich is sgr\u00f9daich\nflipBoard=D\u00e8an flip air a\u2019 bh\u00f2rd\nthreefoldRepetition=Treas ath-nochdadh\nclaimADraw=Tagair geama ionnanach\nofferDraw=Tairg geama ionnanach\ndraw=Geama ionnanach\nnbConnectedPlayers=Tha %s geamaichean ceangailte\ntalkAboutChessAndDiscussLichessFeaturesInTheForum=Bruidhinn mu th\u00e0ileasg agus deasbad air na feartan aig lichess air a\u2019 bh\u00f2rd-bhrath\nseeTheGamesBeingPlayedInRealTime=Seall air na geamaichean a tha gan cluich ann am f\u00ecor-\u00f9ine\ngamesBeingPlayedRightNow=Geamaichean a tha gan cluich an-dr\u00e0sta fh\u00e8in\nviewAllNbGames=Seall air a h-uile %s de na geamaichean\nviewNbCheckmates=Seall na chur %s de thul-chasg\nnbBookmarks=%s Comharran-l\u00ecn\nviewInFullSize=Seall sa mheud iomlan\nlogOut=Log a-mach\nsignIn=Log a-steach\nsignUp=Cl\u00e0raich\npeople=Daoine\ngames=Geamannan\nforum=B\u00f2rd-brath\nchessPlayers=Geamaichean t\u00e0ileisg\nminutesPerSide=Mionaidean an taobh\nvariant=Caochladh\ntimeControl=Smachdadh-\u00f9ine\nstart=Toiseach\nusername=Far-ainm\npassword=Facal-faire\nhaveAnAccount=A bheil cunntas agad?\nallYouNeedIsAUsernameAndAPassword=Chan eil a dh\u00ecth ort ach far-ainm agus facal-faire\nlearnMoreAboutLichess=Ionnsaich barrachd mu lichess\nrank=Inbhe\ngamesPlayed=Geamannan air an cluich\ndeclineInvitation=Di\u00f9lt cuireadh\ncancel=Sguir dheth\ntimeOut=Dh\u2019fhalbh an \u00f9ine\ndrawOfferSent=Chaidh tairgse airson geama ionnanach a chur\ndrawOfferDeclined=Dhi\u00f9ltadh do thairgse airson geama ionnanach\ndrawOfferAccepted=Ghabhadh ri do thairgse airson geama ionnanach\ndrawOfferCanceled=Sguireadh de do thairgse airson geama ionnanach\nyourOpponentOffersADraw=Tha an n\u00e0mhaid agad a\u2019 tairgse geama ionnanach\naccept=Gabh ris\ndecline=Di\u00f9lt\nplayingRightNow=A\u2019 cluich an-dr\u00e0sta fh\u00e8in\nabortGame=Stad an geama\ngameAborted=Chaidh an geama a stad\nstandard=Coitcheann\nunlimited=Gun chr\u00ecoch\nmode=Modh\ncasual=Gun rangachadh\nrated=Rangaichte\nthisGameIsRated=Tha an geama seo rangaichte\nrematch=Ath-mhaids\nrematchOfferSent=Chaidh tairgse airson ath-chluich a chur\nrematchOfferAccepted=Ghabhadh ri do thairgse airson ath-chluich\nplay=Cluich\ninbox=Bogsa a-steach\nchatRoom=Se\u00f2mar cabadaich\ncomposeMessage=Sgr\u00ecobh teachdaireachd\nsentMessages=Teachdaireachdan air an cur\nincrementInSeconds=Ioncramaid ann an diogan\nfreeOnlineChess=T\u00e0ileasg air loidhne an asgaidh\nspectators=Luchd-amhairc:\nnbWins=Bhuannaich %s\nnbLosses=Chaill %s\nnbDraws=Geama ionnanach le %s\nexportGames=\u00c0s-phortaich geamannan\ncolor=dath\nbookmarkThisGame=Cruthaich comharra-l\u00ecn airson an geama seo.\nfreeOnlineChessGamePlayChessNowInACleanInterfaceNoRegistrationNoAdsNoPluginRequiredPlayChessWithComputerFriendsOrRandomOpponents=T\u00e0ileasg air loidhne an asgaidh. Cluich t\u00e0ileasg ann am pr\u00f2gram air a bheil dreach glan. Gun chl\u00e0radh, gun sanasachd, gun fheum air plugan. Cluich t\u00e0ileasg an aghaidh a\u2019 choimpiutair, charaidean no n\u00e0imhdean air thuaiream.\n","old_contents":"playWithAFriend=Cluich c\u00f2mhla ri caraid\ninviteAFriendToPlayWithYou=Thoir cuireadh do charaid gus cluich c\u00f2mhla riut\nplayWithTheMachine=Cluich an aghaidh a' choimpiutair\nchallengeTheArtificialIntelligence=Thoir ionnsaigh air an inntinn fhuadain\ntoInviteSomeoneToPlayGiveThisUrl=Gus cuireadh a thoirt do chuideigin, thoir an url seo seachad\ngameOver=Cr\u00ecoch a\u2019 gheama\nwaitingForOpponent=A\u2019 feitheamh air n\u00e0mhaid\nwaiting=A\u2019 feitheamh\nyourTurn=An turas agad\naiNameLevelAiLevel=%s inbhe %s\nlevel=Inbhe\ntoggleTheChat=Toglaich a\u2019 chabadaich\nchat=Cabadaich\nresign=G\u00e8ill\ncheckmate=Tul-chasg\nstalemate=Clos-cluiche\nwhite=Geal\nblack=Dubh\ncreateAGame=Cruthaich geama\nnoGameAvailableRightNowCreateOne=Chan eil geama ri fhaighinn an-dr\u00e0sta, cruthaich fear \u00f9r!\nwhiteIsVictorious=Bhuannaich geal\nblackIsVictorious=Bhuannaich dubh\nplayWithTheSameOpponentAgain=Cluich an aghaidh an aon n\u00e0mhaid a-rithist\nnewOpponent=N\u00e0mhaid \u00f9r\nplayWithAnotherOpponent=Cluich an aghaidh n\u00e0mhaid eile\nyourOpponentWantsToPlayANewGameWithYou=Tha an n\u00e0mhaid agad airson geama \u00f9r a chluich c\u00f2mhla riut\njoinTheGame=Thig a-steach dhan gheama\nwhitePlays=Tha geal a\u2019 cluich\nblackPlays=Tha dubh a\u2019 cluich\ntheOtherPlayerHasLeftTheGameYouCanForceResignationOrWaitForHim=Tha an geamaiche eile air a' gheama fh\u00e0gail. Is urrainn dhut g\u00e8illeadh a chur air, no feitheamh air a shon.\nmakeYourOpponentResign=Cuir g\u00e8illeadh air an n\u00e0mhaid agad\nforceResignation=Cuir g\u00e8illeadh air an n\u00e0mhaid agad\ntalkInChat=D\u00e8an cabadaich\ntheFirstPersonToComeOnThisUrlWillPlayWithYou=Cluichidh a\u2019 chiad neach a thig a-steach air an url seo c\u00f2mhla riut.\nwhiteCreatesTheGame=Tha geal a\u2019 cruthachadh a\u2019 gheama\nblackCreatesTheGame=Tha dubh a\u2019 cruthachadh a\u2019 gheama\nwhiteJoinsTheGame=Th\u00e0inig geal a-steach dhan gheama\nblackJoinsTheGame=Th\u00e0inig dubh a-steach dhan gheama\nwhiteResigned=Gh\u00e8ill geal\nblackResigned=Gh\u00e8ill dubh\nwhiteLeftTheGame=Dh\u2019fh\u00e0g geal an geama\nblackLeftTheGame=Dh\u2019fh\u00e0g dubh an geama\nshareThisUrlToLetSpectatorsSeeTheGame=Co-roinn an url seo gus luchd-amhairc a leigeil a-steach dhan gheama\nyouAreViewingThisGameAsASpectator=Tha thu a\u2019 coimhead air a\u2019 gheama seo nad neach-amhairc\nreplayAndAnalyse=Ath-chluich is sgr\u00f9daich\nflipBoard=D\u00e8an flip air a\u2019 bh\u00f2rd\nthreefoldRepetition=Treas ath-nochdadh\nclaimADraw=Tagair geama ionnanach\nofferDraw=Tairg geama ionnanach\ndraw=Geama ionnanach\nnbConnectedPlayers=Tha %s geamaichean ceangailte\ntalkAboutChessAndDiscussLichessFeaturesInTheForum=Bruidhinn mu th\u00e0ileasg agus deasbad air na feartan aig lichess air a\u2019 bh\u00f2rd-bhrath\nseeTheGamesBeingPlayedInRealTime=Seall air na geamaichean a tha gan cluich ann am f\u00ecor-\u00f9ine\ngamesBeingPlayedRightNow=Geamaichean a tha gan cluich an-dr\u00e0sta fh\u00e8in\nviewAllNbGames=Seall air a h-uile %s de na geamaichean\nviewNbCheckmates=Seall na chur %s de thul-chasg\nviewInFullSize=Seall sa mheud iomlan\nlogOut=Log a-mach\nsignIn=Log a-steach\nsignUp=Cl\u00e0raich\npeople=Daoine\ngames=Geamannan\nforum=B\u00f2rd-brath\nchessPlayers=Geamaichean t\u00e0ileisg\nminutesPerSide=Mionaidean an taobh\nvariant=Caochladh\ntimeControl=Smachdadh-\u00f9ine\nstart=Toiseach\nusername=Far-ainm\npassword=Facal-faire\nhaveAnAccount=A bheil cunntas agad?\nallYouNeedIsAUsernameAndAPassword=Chan eil a dh\u00ecth ort ach far-ainm agus facal-faire\nlearnMoreAboutLichess=Ionnsaich barrachd mu lichess\nrank=Inbhe\ngamesPlayed=Geamannan air an cluich\ndeclineInvitation=Di\u00f9lt cuireadh\ncancel=Sguir dheth\ntimeOut=Dh\u2019fhalbh an \u00f9ine\ndrawOfferSent=Chaidh tairgse airson geama ionnanach a chur\ndrawOfferDeclined=Dhi\u00f9ltadh do thairgse airson geama ionnanach\ndrawOfferAccepted=Ghabhadh ri do thairgse airson geama ionnanach\ndrawOfferCanceled=Sguireadh de do thairgse airson geama ionnanach\nyourOpponentOffersADraw=Tha an n\u00e0mhaid agad a\u2019 tairgse geama ionnanach\naccept=Gabh ris\ndecline=Di\u00f9lt\nplayingRightNow=A\u2019 cluich an-dr\u00e0sta fh\u00e8in\nabortGame=Stad an geama\ngameAborted=Chaidh an geama a stad\nstandard=Coitcheann\nunlimited=Gun chr\u00ecoch\nmode=Modh\ncasual=Gun rangachadh\nrated=Rangaichte\nthisGameIsRated=Tha an geama seo rangaichte\nrematch=Ath-mhaids\nrematchOfferSent=Chaidh tairgse airson ath-chluich a chur\nrematchOfferAccepted=Ghabhadh ri do thairgse airson ath-chluich\nplay=Cluich\ninbox=Bogsa a-steach\nchatRoom=Se\u00f2mar cabadaich\ncomposeMessage=Sgr\u00ecobh teachdaireachd\nsentMessages=Teachdaireachdan air an cur\nincrementInSeconds=Ioncramaid ann an diogan\nfreeOnlineChess=T\u00e0ileasg air loidhne an asgaidh\nspectators=Luchd-amhairc:\nnbWins=Bhuannaich %s\nnbLosses=Chaill %s\nnbDraws=Geama ionnanach le %s\nexportGames=\u00c0s-phortaich geamannan\nfreeOnlineChessGamePlayChessNowInACleanInterfaceNoRegistrationNoAdsNoPluginRequiredPlayChessWithComputerFriendsOrRandomOpponents=T\u00e0ileasg air loidhne an asgaidh. Cluich t\u00e0ileasg ann am pr\u00f2gram air a bheil dreach glan. Gun chl\u00e0radh, gun sanasachd, gun fheum air plugan. Cluich t\u00e0ileasg an aghaidh a\u2019 choimpiutair, charaidean no n\u00e0imhdean air thuaiream.\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"GDScript"} {"commit":"44bea57a86c5859cedf4a6888ebf1991407ba42b","subject":"Fixed argument names for documentation.","message":"Fixed argument names for documentation.\n","repos":"jesselansdown\/Gurobify,jesselansdown\/Gurobify","old_file":"gap\/Gurobify.gd","new_file":"gap\/Gurobify.gd","new_contents":"# Gurobify: Gurobify provides an interface to Gurobi from GAP.\n#\n# Copyright (c) 2017 Jesse Lansdown\n#\n# This Source Code Form is subject to the terms of the Mozilla\n# Public License, v. 2.0. If a copy of the MPL was not distributed\n# with this file, You can obtain one at https:\/\/mozilla.org\/MPL\/2.0\/.\n\n\n\n# Declarations\n#\n\n\nDeclareCategory( \"IsGurobiModel\", IsObject );\n\n\nGurobiObjectFamily := NewFamily( \"GurobiObjectFamily\" );\n\nBindGlobal(\"TheTypeGurobiModel\", NewType( GurobiObjectFamily, IsGurobiModel ));\n\n\nDeclareOperation( \"GurobiNewModel\",\n\t[IsList]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Deleting Constraints\n#! @Arguments Model, ConstraintName\n#! @Returns true\/false\n#! @Description\n#!\tDeletes all constraints with the name ConstraintName\nDeclareOperation(\"GurobiDeleteConstraintsWithName\",\n\t[IsGurobiModel, IsString]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Deleting Constraints\n#! @Arguments Model, ConstraintEquation, ConstraintSense, ConstraintRHSValue[, ConstraintName]\n#! @Returns true\n#! @Description\n#!\tSame as below, except that ConstraintRHS value takes an integer value.\nDeclareOperation( \"GurobiAddConstraint\",\n\t[ IsGurobiModel, IsList, IsString, IsInt, IsString]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Deleting Constraints\n#! @Arguments Model, ConstraintEquation, ConstraintSense, ConstraintRHSValue[, ConstraintName]\n#! @Returns true\n#! @Description\n#!\tAdds a constraint to a gurobi model. ConstraintEquation must be a list, \n#!\tsuch that each entry is the coefficient (including $0$ coefficents) of the corresponding variable\n#! \tin the constraint equation. The ConstraintSense must be one of \"<\", \">\" or \"=\",\n#!\twhere Gurobi interprets < as <= and > as >=. The ConstraintRHSValue is the value on the\n#!\tright hand side of the constraint. A constraint may optionally be given a name, which helps to identify\n#!\tthe constraint if it is to be deleted at some point. If no constraint name is given, then a constraint is\n#!\tsimply assigned the name \"UnNamedConstraint\".\n#!\tNote that a model must be updated or optimised before any additional constraints become effective.\nDeclareOperation( \"GurobiAddConstraint\",\n\t[ IsGurobiModel, IsList, IsString, IsFloat, IsString] );\n\nDeclareOperation( \"GurobiAddConstraint\",\n\t[ IsGurobiModel, IsList, IsString, IsFloat]);\n\nDeclareOperation( \"GurobiAddConstraint\",\n\t[ IsGurobiModel, IsList, IsString, IsInt]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Deleting Constraints\n#! @Arguments Model, ConstraintEquations, ConstraintSenses, ConstraintRHSValues[, ConstraintNames]\n#! @Returns true\n#! @Description\n#!\tAdd multiple constraints to a model at one time. The arguments (except Model)\n#!\tare lists, such that the i-th entries of each list determine a single constraint in\n#!\tthe same manner as for the operation GurobiAddConstraint. ConstraintNames is an optional argument,\n#!\tand must be given for all constraints, or not at all.\nDeclareOperation( \"GurobiAddMultipleConstraints\",\n\t[ IsGurobiModel, IsList, IsList, IsList, IsList] );\n\n#! @Chapter Using Gurobify\n#! @Section Optimising A Model\n#! @Arguments Model\n#! @Returns Solution\n#! @Description\n#!\tDisplay the solution found for a successfuly optimised model. Note that if a solution has not been optimised, is infeasible, or\n#!\tthe optimisation was not completed, then this will return an error. Thus it is advisable to first check the optimisation status.\nDeclareOperation( \"GurobiSolution\",\n\t[ IsGurobiModel] );\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, TimeLimit\n#! @Returns true\n#! @Description\n#!\tSet a time limit for a Gurobi model. Note that TimeLimit should be a float, however an integer value can be given\n#!\twhich will be automatically converted to a float.\nDeclareOperation( \"GurobiSetTimeLimit\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, BestObjectiveBoundStop\n#! @Returns true\n#! @Description\n#!\tOptimisation will terminate if a feasible solution is found with objective value at least as good as BestObjectiveBoundStop.\n#!\tNote that BestObjectiveBoundStop should be a float, however an integer value can be given\n#!\twhich will be automatically converted to a float.\nDeclareOperation( \"GurobiSetBestObjectiveBoundStop\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, CutOff\n#! @Returns true\n#! @Description\n#!\tOptimisation will terminate if the objective value is worse than CutOff.\n#!\tNote that CutOff should be a float, an integer value can be given\n#!\twhich will be automatically converted to a float.\nDeclareOperation( \"GurobiSetCutOff\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Modifying Objective Functions\n#! @Arguments Model\n#! @Returns true\n#! @Description\n#!\tSets the model sense to maximise. When the model is optimised, it will try to maximise the objective function.\nDeclareOperation(\"GurobiMaximiseModel\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Modifying Objective Functions\n#! @Arguments Model\n#! @Returns true\n#! @Description\n#!\tSets the model sense to minimise. When the model is optimised, it will try to minimise the objective function.\nDeclareOperation(\"GurobiMinimiseModel\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Modifying Objective Functions\n#! @Arguments Model, ObjectiveValues\n#! @Returns true\n#! @Description\n#!\tSet the objective function for a model. ObjectiveValues is a list of coefficients (including $0$ coefficeints)\n#!\tcorresponding to each of the variables\nDeclareOperation( \"GurobiSetObjectiveFunction\",\n\t[ IsGurobiModel, IsList] );\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Modifying Objective Functions\n#! @Arguments Model\n#! @Returns List of coefficients of the objective function\n#! @Description\n#!\tView the objective function for a model.\nDeclareOperation( \"GurobiObjectiveFunction\",\n\t[ IsGurobiModel] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns Number of variables\n#! @Description\n#!\tReturns the number of variables in the model.\nDeclareOperation(\"GurobiNumberOfVariables\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns Number of linear constraints\n#! @Description\n#!\tReturns the number of linear constraints in the model.\nDeclareOperation(\"GurobiNumberOfConstraints\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Optimising A Model\n#! @Arguments Model\n#! @Returns objective value\n#! @Description\n#!\tReturns the objective value of the current solution.\nDeclareOperation(\"GurobiObjectiveValue\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns objective bound\n#! @Description\n#!\tReturns the best known bound on the objective value of the model.\nDeclareOperation(\"GurobiObjectiveBound\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns run time of optimisation\n#! @Description\n#!\tReturns the wall clock runtime in seconds for the most recent optimisation.\nDeclareOperation(\"GurobiRunTime\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Optimising A Model\n#! @Arguments Model\n#! @Returns optimisation status code\n#! @Description\n#!\tReturns the optimisation status code of the most recent optimisation. Refer to the Gurobi documentation for more\n#!\ton the optimisation statuses, or alternatively refer to the Appendix of this manual.\nDeclareOperation(\"GurobiOptimisationStatus\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns numeric focus\n#! @Description\n#!\tReturns the numeric focus value of the model. The numeric focus is a value in the set [0,1,2,3]. A numeric focus of $0$ sets the\n#!\tnumeric focus automatically, preferancing speed. Values between 1 and 3 increase the care taken in computations \n#!\tas the value increases, but also take longer. The default value is 0.\nDeclareOperation(\"GurobiNumericFocus\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, NumericFocus\n#! @Returns true\n#! @Description\n#!\tSet the numeric focus for a model. Numeric focus must be in the set [0,1,2,3]. A numeric focus of $0$ sets the\n#!\tnumeric focus automatically, preferancing speed. Values between 1 and 3 increase the care taken in computations \n#!\tas the value increases, but also take longer. The default value is 0.\nDeclareOperation( \"GurobiSetNumericFocus\",\n\t[ IsGurobiModel, IsInt] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns time limit\n#! @Description\n#!\tReturns the time limit for the model. The default value is infinity.\nDeclareOperation(\"GurobiTimeLimit\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns cutoff value\n#! @Description\n#!\tReturns the cutoff value for the model. Optimisation will terminate if the objective value is worse than CutOff.\n#!\tThe default value is infinity for minimisation, and negative infinity for maximisation.\nDeclareOperation(\"GurobiCutOff\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns best objective bound limit value\n#! @Description\n#!\tReturns the best objective bound limit value for the model.\n#!\tOptimisation will terminate if a feasible solution is found with objective value at least as good as the best objective bound.\n#!\tThe default value is negative infinity.\nDeclareOperation(\"GurobiBestObjectiveBoundStop\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, MIPFocus\n#! @Returns true\n#! @Description\n#!\tSet the MIP focus for a model. The mip focus must be in the set [0,1,2,3], and the default value is 0.\n#!\tThe MIP focus alows you to prioritise finding solutions or proving their optimality. See the Gurobi \n#!\tdocumentation for more information.\nDeclareOperation( \"GurobiSetMIPFocus\",\n\t[ IsGurobiModel, IsInt] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns MIP focus\n#! @Description\n#!\tReturns the MIP focus value for the model. The mip focus must be in the set [0,1,2,3], and the default value is 0.\n#!\tThe MIP focus alows you to prioritise finding solutions or proving their optimality. See the Gurobi \n#!\tdocumentation for more information.\nDeclareOperation(\"GurobiMIPFocus\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, BestBdStop\n#! @Returns true\n#! @Description\n#!\tSet the best bound stopping value for a model. Terminates optimisation as soon as the value\n#!\tof the best bound is determined to be at least as good as the best bound stopping value. Default value is infinity.\nDeclareOperation( \"GurobiSetBestBoundStop\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns Best bound stopping value\n#! @Description\n#!\tReturns the best bound stopping value for the model. Optimisation terminates as soon as the value\n#!\tof the best bound is determined to be at least as good as the best bound stopping value. Default value is infinity.\nDeclareOperation(\"GurobiBestBoundStop\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, BestBdStop\n#! @Returns true\n#! @Description\n#!\tSet the limit for the maximum number of MIP solutions to find.\n#!\tDefault value is $2,000,000,000$.\nDeclareOperation( \"GurobiSetSolutionLimit\",\n\t[ IsGurobiModel, IsInt] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns solution limit value\n#! @Description\n#!\tReturns the solution limit value for the model. This value limits the maximum number of MIP solutions that will be found.\n#!\tDefault value is $2,000,000,000$.\nDeclareOperation(\"GurobiSolutionLimit\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, IterationLimit\n#! @Returns true\n#! @Description\n#!\tSet the limit for the maximum number of simplex iterations performed. Default value is infinity.\nDeclareOperation( \"GurobiSetIterationLimit\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns Iteration limit\n#! @Description\n#!\tReturns the iteration limit value for the model, which limits the number of simplex iterations performed during optimisation.\n#!\tDefault value is infinity.\nDeclareOperation(\"GurobiIterationLimit\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, NodeLimit\n#! @Returns true\n#! @Description\n#!\tSet the limit for the maximum number of MIP nodes explored.\n#!\tThe default value is infinity.\nDeclareOperation( \"GurobiSetNodeLimit\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns Node limit\n#! @Description\n#!\tReturns the node limit value for the model, which limits the number of MIP nodes explored during optimisation.\n#!\tThe default value is infinity.\nDeclareOperation(\"GurobiNodeLimit\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns \n#! @Description\n#!\tReturns the names of the variables in the model. This list acts as the index set for\n#!\tany lists of variable coefficients, such as in GurobiAddConstraint or GurobiSetObjectiveFunction.\nDeclareOperation(\"GurobiVariableNames\",\n\t[IsGurobiModel]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Creating Or Reading A Model\n#! @Arguments VariableTypes[, VariableNames]\n#! @Returns A Gurobi model\n#! @Description\n#! Creates a gurobi model with variables defined by VariableTypes. VariableTypes must be a list of strings, \n#!\twhere each entry is the type of the corresponding variable.\n#! Accepted variable types are \"CONTINUOUS\", \"BINARY\", \"INTEGER\", \"SEMICONT\", or \"SEMIINT\". The variable types are not case sensitive.\n#! Refer to the Gurobi documentation for more information on the variable types.\n#! Optionally takes the names of the variables as a list of strings.\nDeclareOperation( \"GurobiNewModel\",\n\t[IsList, IsList]);\n\n\n\n#! @Chapter Using Gurobify\n#! @Section Creating Or Reading A Model\n#! @Arguments Model, VariableNames\n#! @Returns true\n#! @Description\n#! Assigns each variable a new name from a list of names. The names must be strings. \nDeclareOperation(\"GurobiSetVariableNames\",\n\t\t[IsGurobiModel, IsList]);\n\n\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, Switch\n#! @Returns true\n#! @Description\n#! Turns console logging on or off. If Switch is true the output of Gurobi will be printed to the screen,\n#!\tand if it is false the output will be supressed. The default for Gurobify is to supress the output.\nDeclareOperation(\"GurobiSetLogToConsole\",\n\t\t[IsGurobiModel, IsBool]);\n\n\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns true\/false\n#! @Description\n#!\tReturns true if the Gurobi output is set to display to the screen, and false if the output is supressed.\n#!\tGurobify suppresses the output by default.\nDeclareOperation(\"GurobiLogToConsole\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Optimising A Model\n#! @Arguments Model\n#! @Returns Set of all solutions.\n#! @Description\n#!\tTakes a Gurobi model and repeatedly optimises it, each time adding the previous solution as a\n#!\tconstraint so that it isn't found again. This continues until all solutions are found, and\n#!\tthen they are returned as a set. During the process the number of found solutions is displayed.\nDeclareOperation(\"GurobiFindAllSolutions\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Optimising A Model\n#! @Arguments Model, Group\n#! @Returns Set of all solutions.\n#! @Description\n#!\tSame as above, except that it also takes a permutation group acting on the index set of variables.\n#!\tInstead of finding all solutions directly, the group is used to find the orbit of each new\n#!\tsolution, and these are then all returned at the end, and used as constraints until then.\n#!\tAn option value may also be given which will only return the representatives of each orbit of the\n#!\tsolutions. Hence it returns all the unique solutions up to equivalence under the group.\n#!\tThis saves on memory, and the remaing solutions may be refound by generating the\n#!\torbit under the group. To invoke this option place a colon after the group argument and then put\n#!\trepresentatives:=true so for example GurobiFindAllSolutions(model, gp : representatives:=true);\nDeclareOperation(\"GurobiFindAllSolutions\",\n\t[IsGurobiModel, IsGroup]);\n\n#! @Chapter Using Gurobify\n#! @Section Additional Functionality\n#! @Arguments IndexSet, NumberOfIndices\n#! @Returns Characterisitc vector\n#! @Description\n#!\tTakes a list of integers which form a subset of the set [1 .. n], where n is the second argument,\n#!\tand converts the set of indices to its characteristic vector. For example, if n = 5, the set\n#!\t[1,3] would be converted to [1, 0, 1, 0, 0]. It is useful to be able to convert between the two,\n#!\tsince Gurobify always takes the characteristic vector (for example when taking constraints),\n#!\tyet the set of indices is generally more helpful for the user.\nDeclareOperation(\"IndexSetToCharacteristicVector\",\n\t[IsList, IsPosInt]);\n\n#! @Chapter Using Gurobify\n#! @Section Additional Functionality\n#! @Arguments CharacteristicVector\n#! @Returns Characterisitc vector\n#! @Description\n#!\tTakes a characteristic vector and returns the set of indices corresponding to it. This reverses the\n#!\tprocess which occurs with IndexSetToCharacteristicVector. It is particularly useful to convert the\n#!\toutput of a Gurobi solution back in terms of the variables. For example, the characteristic vector\n#!\t[1, 0, 1, 0, 0] would return the index set [1,3]. Note that since the function expects a characteristic \n#!\tvector it doesn't account for any weightings, and is only interested in whether or not the corresponding \n#!\tindex is present, and as such it rounds each entry to the nearest integer and checks that it is non-zero.\n#!\tHence it is particularly suitable for use with binary variables. \nDeclareOperation(\"CharacteristicVectorToIndexSet\",\n\t[IsList]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Additional Functionality\n#! @Arguments Subset, FullSet\n#! @Returns Characterisitc vector\n#! @Description\n#!\tTakes a subset of some set, and returns the characteristic vector where the entries of the characteristic\n#!\tvector are indexed by the full set. For example, the subset [\"c\"] of [\"a\", \"c\", \"n\", \"q\"] would give the \n#!\tcharacteristic vector [0, 1, 0, 0]. This removes the need to first find the index set of the subset.\nDeclareOperation(\"SubsetToCharacteristicVector\",\n\t[IsList, IsList]);\n\n#! @Chapter Using Gurobify\n#! @Section Additional Functionality\n#! @Arguments CharacteristicVector\n#! @Returns Characterisitc vector\n#! @Description\n#!\tTakes a characteristic vector and some set which it takes to be indexing the entries of the characteristic \n#!\tvector. It then returns the subset of the full set corresponding to the non-zero entries of the characteristic \n#!\tvector. This is the reverse process to SubsetToCharacteristicVector. Note again that the characteristic vector \n#!\tis rounded to an integer before being compared to 0. As an example, the characteristic vector [0, 1, 0, 0] with \n#!\tthe set [\"a\", \"c\", \"n\", \"q\"] would return [\"c\"]. This removes the need to first return an index set before \n#!\tfinding the subset.\nDeclareOperation(\"CharacteristicVectorToSubset\",\n\t[IsList, IsList]);\n\n","old_contents":"# Gurobify: Gurobify provides an interface to Gurobi from GAP.\n#\n# Copyright (c) 2017 Jesse Lansdown\n#\n# This Source Code Form is subject to the terms of the Mozilla\n# Public License, v. 2.0. If a copy of the MPL was not distributed\n# with this file, You can obtain one at https:\/\/mozilla.org\/MPL\/2.0\/.\n\n\n\n# Declarations\n#\n\n\nDeclareCategory( \"IsGurobiModel\", IsObject );\n\n\nGurobiObjectFamily := NewFamily( \"GurobiObjectFamily\" );\n\nBindGlobal(\"TheTypeGurobiModel\", NewType( GurobiObjectFamily, IsGurobiModel ));\n\n\nDeclareOperation( \"GurobiNewModel\",\n\t[IsList]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Deleting Constraints\n#! @Arguments Model, ConstraintName\n#! @Returns true\/false\n#! @Description\n#!\tDeletes all constraints with the name ConstraintName\nDeclareOperation(\"GurobiDeleteConstraintsWithName\",\n\t[IsGurobiModel, IsString]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Deleting Constraints\n#! @Arguments Model, ConstraintEquation, ConstraintSense, ConstraintRHSValue[, ConstraintName]\n#! @Returns true\n#! @Description\n#!\tSame as below, except that ConstraintRHS value takes an integer value.\nDeclareOperation( \"GurobiAddConstraint\",\n\t[ IsGurobiModel, IsList, IsString, IsInt, IsString]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Deleting Constraints\n#! @Arguments Model, ConstraintEquation, ConstraintSense, ConstraintRHSValue[, ConstraintName]\n#! @Returns true\n#! @Description\n#!\tAdds a constraint to a gurobi model. ConstraintEquation must be a list, \n#!\tsuch that each entry is the coefficient (including $0$ coefficents) of the corresponding variable\n#! \tin the constraint equation. The ConstraintSense must be one of \"<\", \">\" or \"=\",\n#!\twhere Gurobi interprets < as <= and > as >=. The ConstraintRHSValue is the value on the\n#!\tright hand side of the constraint. A constraint may optionally be given a name, which helps to identify\n#!\tthe constraint if it is to be deleted at some point. If no constraint name is given, then a constraint is\n#!\tsimply assigned the name \"UnNamedConstraint\".\n#!\tNote that a model must be updated or optimised before any additional constraints become effective.\nDeclareOperation( \"GurobiAddConstraint\",\n\t[ IsGurobiModel, IsList, IsString, IsFloat, IsString] );\n\nDeclareOperation( \"GurobiAddConstraint\",\n\t[ IsGurobiModel, IsList, IsString, IsFloat]);\n\nDeclareOperation( \"GurobiAddConstraint\",\n\t[ IsGurobiModel, IsList, IsString, IsInt]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Deleting Constraints\n#! @Arguments Model, ConstraintEquations, ConstraintSenses, ConstraintRHSValues[, ConstraintNames]\n#! @Returns true\n#! @Description\n#!\tAdd multiple constraints to a model at one time. The arguments (except Model)\n#!\tare lists, such that the i-th entries of each list determine a single constraint in\n#!\tthe same manner as for the operation GurobiAddConstraint. ConstraintNames is an optional argument,\n#!\tand must be given for all constraints, or not at all.\nDeclareOperation( \"GurobiAddMultipleConstraints\",\n\t[ IsGurobiModel, IsList, IsList, IsList, IsList] );\n\n#! @Chapter Using Gurobify\n#! @Section Optimising A Model\n#! @Arguments Model\n#! @Returns Solution\n#! @Description\n#!\tDisplay the solution found for a successfuly optimised model. Note that if a solution has not been optimised, is infeasible, or\n#!\tthe optimisation was not completed, then this will return an error. Thus it is advisable to first check the optimisation status.\nDeclareOperation( \"GurobiSolution\",\n\t[ IsGurobiModel] );\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, TimeLimit\n#! @Returns true\n#! @Description\n#!\tSet a time limit for a Gurobi model. Note that TimeLimit should be a float, however an integer value can be given\n#!\twhich will be automatically converted to a float.\nDeclareOperation( \"GurobiSetTimeLimit\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, BestObjectiveBoundStop\n#! @Returns true\n#! @Description\n#!\tOptimisation will terminate if a feasible solution is found with objective value at least as good as BestObjectiveBoundStop.\n#!\tNote that BestObjectiveBoundStop should be a float, however an integer value can be given\n#!\twhich will be automatically converted to a float.\nDeclareOperation( \"GurobiSetBestObjectiveBoundStop\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, CutOff\n#! @Returns true\n#! @Description\n#!\tOptimisation will terminate if the objective value is worse than CutOff.\n#!\tNote that CutOff should be a float, an integer value can be given\n#!\twhich will be automatically converted to a float.\nDeclareOperation( \"GurobiSetCutOff\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Modifying Objective Functions\n#! @Arguments Model\n#! @Returns true\n#! @Description\n#!\tSets the model sense to maximise. When the model is optimised, it will try to maximise the objective function.\nDeclareOperation(\"GurobiMaximiseModel\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Modifying Objective Functions\n#! @Arguments Model\n#! @Returns true\n#! @Description\n#!\tSets the model sense to minimise. When the model is optimised, it will try to minimise the objective function.\nDeclareOperation(\"GurobiMinimiseModel\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Modifying Objective Functions\n#! @Arguments Model, ObjectiveValues\n#! @Returns true\n#! @Description\n#!\tSet the objective function for a model. ObjectiveValues is a list of coefficients (including $0$ coefficeints)\n#!\tcorresponding to each of the variables\nDeclareOperation( \"GurobiSetObjectiveFunction\",\n\t[ IsGurobiModel, IsList] );\n\n#! @Chapter Using Gurobify\n#! @Section Adding And Modifying Objective Functions\n#! @Arguments Model\n#! @Returns List of coefficients of the objective function\n#! @Description\n#!\tView the objective function for a model.\nDeclareOperation( \"GurobiObjectiveFunction\",\n\t[ IsGurobiModel] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns Number of variables\n#! @Description\n#!\tReturns the number of variables in the model.\nDeclareOperation(\"GurobiNumberOfVariables\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns Number of linear constraints\n#! @Description\n#!\tReturns the number of linear constraints in the model.\nDeclareOperation(\"GurobiNumberOfConstraints\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Optimising A Model\n#! @Arguments Model\n#! @Returns objective value\n#! @Description\n#!\tReturns the objective value of the current solution.\nDeclareOperation(\"GurobiObjectiveValue\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns objective bound\n#! @Description\n#!\tReturns the best known bound on the objective value of the model.\nDeclareOperation(\"GurobiObjectiveBound\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns run time of optimisation\n#! @Description\n#!\tReturns the wall clock runtime in seconds for the most recent optimisation.\nDeclareOperation(\"GurobiRunTime\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Optimising A Model\n#! @Arguments Model\n#! @Returns optimisation status code\n#! @Description\n#!\tReturns the optimisation status code of the most recent optimisation. Refer to the Gurobi documentation for more\n#!\ton the optimisation statuses, or alternatively refer to the Appendix of this manual.\nDeclareOperation(\"GurobiOptimisationStatus\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns numeric focus\n#! @Description\n#!\tReturns the numeric focus value of the model. The numeric focus is a value in the set [0,1,2,3]. A numeric focus of $0$ sets the\n#!\tnumeric focus automatically, preferancing speed. Values between 1 and 3 increase the care taken in computations \n#!\tas the value increases, but also take longer. The default value is 0.\nDeclareOperation(\"GurobiNumericFocus\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, NumericFocus\n#! @Returns true\n#! @Description\n#!\tSet the numeric focus for a model. Numeric focus must be in the set [0,1,2,3]. A numeric focus of $0$ sets the\n#!\tnumeric focus automatically, preferancing speed. Values between 1 and 3 increase the care taken in computations \n#!\tas the value increases, but also take longer. The default value is 0.\nDeclareOperation( \"GurobiSetNumericFocus\",\n\t[ IsGurobiModel, IsInt] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns time limit\n#! @Description\n#!\tReturns the time limit for the model. The default value is infinity.\nDeclareOperation(\"GurobiTimeLimit\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns cutoff value\n#! @Description\n#!\tReturns the cutoff value for the model. Optimisation will terminate if the objective value is worse than CutOff.\n#!\tThe default value is infinity for minimisation, and negative infinity for maximisation.\nDeclareOperation(\"GurobiCutOff\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns best objective bound limit value\n#! @Description\n#!\tReturns the best objective bound limit value for the model.\n#!\tOptimisation will terminate if a feasible solution is found with objective value at least as good as the best objective bound.\n#!\tThe default value is negative infinity.\nDeclareOperation(\"GurobiBestObjectiveBoundStop\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, MIPFocus\n#! @Returns true\n#! @Description\n#!\tSet the MIP focus for a model. The mip focus must be in the set [0,1,2,3], and the default value is 0.\n#!\tThe MIP focus alows you to prioritise finding solutions or proving their optimality. See the Gurobi \n#!\tdocumentation for more information.\nDeclareOperation( \"GurobiSetMIPFocus\",\n\t[ IsGurobiModel, IsInt] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns MIP focus\n#! @Description\n#!\tReturns the MIP focus value for the model. The mip focus must be in the set [0,1,2,3], and the default value is 0.\n#!\tThe MIP focus alows you to prioritise finding solutions or proving their optimality. See the Gurobi \n#!\tdocumentation for more information.\nDeclareOperation(\"GurobiMIPFocus\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, BestBdStop\n#! @Returns true\n#! @Description\n#!\tSet the best bound stopping value for a model. Terminates optimisation as soon as the value\n#!\tof the best bound is determined to be at least as good as the best bound stopping value. Default value is infinity.\nDeclareOperation( \"GurobiSetBestBoundStop\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns Best bound stopping value\n#! @Description\n#!\tReturns the best bound stopping value for the model. Optimisation terminates as soon as the value\n#!\tof the best bound is determined to be at least as good as the best bound stopping value. Default value is infinity.\nDeclareOperation(\"GurobiBestBoundStop\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, BestBdStop\n#! @Returns true\n#! @Description\n#!\tSet the limit for the maximum number of MIP solutions to find.\n#!\tDefault value is $2,000,000,000$.\nDeclareOperation( \"GurobiSetSolutionLimit\",\n\t[ IsGurobiModel, IsInt] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns solution limit value\n#! @Description\n#!\tReturns the solution limit value for the model. This value limits the maximum number of MIP solutions that will be found.\n#!\tDefault value is $2,000,000,000$.\nDeclareOperation(\"GurobiSolutionLimit\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, IterationLimit\n#! @Returns true\n#! @Description\n#!\tSet the limit for the maximum number of simplex iterations performed. Default value is infinity.\nDeclareOperation( \"GurobiSetIterationLimit\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns Iteration limit\n#! @Description\n#!\tReturns the iteration limit value for the model, which limits the number of simplex iterations performed during optimisation.\n#!\tDefault value is infinity.\nDeclareOperation(\"GurobiIterationLimit\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, NodeLimit\n#! @Returns true\n#! @Description\n#!\tSet the limit for the maximum number of MIP nodes explored.\n#!\tThe default value is infinity.\nDeclareOperation( \"GurobiSetNodeLimit\",\n\t[ IsGurobiModel, IsFloat] );\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns Node limit\n#! @Description\n#!\tReturns the node limit value for the model, which limits the number of MIP nodes explored during optimisation.\n#!\tThe default value is infinity.\nDeclareOperation(\"GurobiNodeLimit\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns \n#! @Description\n#!\tReturns the names of the variables in the model. This list acts as the index set for\n#!\tany lists of variable coefficients, such as in GurobiAddConstraint or GurobiSetObjectiveFunction.\nDeclareOperation(\"GurobiVariableNames\",\n\t[IsGurobiModel]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Creating Or Reading A Model\n#! @Arguments VariableTypes[, VariableNames]\n#! @Returns A Gurobi model\n#! @Description\n#! Creates a gurobi model with variables defined by VariableTypes. VariableTypes must be a list of strings, \n#!\twhere each entry is the type of the corresponding variable.\n#! Accepted variable types are \"CONTINUOUS\", \"BINARY\", \"INTEGER\", \"SEMICONT\", or \"SEMIINT\". The variable types are not case sensitive.\n#! Refer to the Gurobi documentation for more information on the variable types.\n#! Optionally takes the names of the variables as a list of strings.\nDeclareOperation( \"GurobiNewModel\",\n\t[IsList, IsList]);\n\n\n\n#! @Chapter Using Gurobify\n#! @Section Creating Or Reading A Model\n#! @Arguments Model, VariableNames\n#! @Returns true\n#! @Description\n#! Assigns each variable a new name from a list of names. The names must be strings. \nDeclareOperation(\"GurobiSetVariableNames\",\n\t\t[IsGurobiModel, IsList]);\n\n\n\n#! @Chapter Using Gurobify\n#! @Section Modifying Attributes And Parameters\n#! @Arguments Model, Switch\n#! @Returns true\n#! @Description\n#! Turns console logging on or off. If Switch is true the output of Gurobi will be printed to the screen,\n#!\tand if it is false the output will be supressed. The default for Gurobify is to supress the output.\nDeclareOperation(\"GurobiSetLogToConsole\",\n\t\t[IsGurobiModel, IsBool]);\n\n\n\n#! @Chapter Using Gurobify\n#! @Section Querying Attributes And Parameters\n#! @Arguments Model\n#! @Returns true\/false\n#! @Description\n#!\tReturns true if the Gurobi output is set to display to the screen, and false if the output is supressed.\n#!\tGurobify suppresses the output by default.\nDeclareOperation(\"GurobiLogToConsole\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Optimising A Model\n#! @Arguments Model\n#! @Returns Set of all solutions.\n#! @Description\n#!\tTakes a Gurobi model and repeatedly optimises it, each time adding the previous solution as a\n#!\tconstraint so that it isn't found again. This continues until all solutions are found, and\n#!\tthen they are returned as a set. During the process the number of found solutions is displayed.\nDeclareOperation(\"GurobiFindAllSolutions\",\n\t[IsGurobiModel]);\n\n#! @Chapter Using Gurobify\n#! @Section Optimising A Model\n#! @Arguments Model, Group\n#! @Returns Set of all solutions.\n#! @Description\n#!\tSame as above, except that it also takes a permutation group acting on the index set of variables.\n#!\tInstead of finding all solutions directly, the group is used to find the orbit of each new\n#!\tsolution, and these are then all returned at the end, and used as constraints until then.\n#!\tAn option value may also be given which will only return the representatives of each orbit of the\n#!\tsolutions. Hence it returns all the unique solutions up to equivalence under the group.\n#!\tThis saves on memory, and the remaing solutions may be refound by generating the\n#!\torbit under the group. To invoke this option place a colon after the group argument and then put\n#!\trepresentatives:=true so for example GurobiFindAllSolutions(model, gp : representatives:=true);\nDeclareOperation(\"GurobiFindAllSolutions\",\n\t[IsGurobiModel, IsGroup]);\n\n#! @Chapter Using Gurobify\n#! @Section Additional Functionality\n#! @Arguments Index set, number of indices\n#! @Returns Characterisitc vector\n#! @Description\n#!\tTakes a list of integers which form a subset of the set [1 .. n], where n is the second argument,\n#!\tand converts the set of indices to its characteristic vector. For example, if n = 5, the set\n#!\t[1,3] would be converted to [1, 0, 1, 0, 0]. It is useful to be able to convert between the two,\n#!\tsince Gurobify always takes the characteristic vector (for example when taking constraints),\n#!\tyet the set of indices is generally more helpful for the user.\nDeclareOperation(\"IndexSetToCharacteristicVector\",\n\t[IsList, IsPosInt]);\n\n#! @Chapter Using Gurobify\n#! @Section Additional Functionality\n#! @Arguments Characteristic vector\n#! @Returns Characterisitc vector\n#! @Description\n#!\tTakes a characteristic vector and returns the set of indices corresponding to it. This reverses the\n#!\tprocess which occurs with IndexSetToCharacteristicVector. It is particularly useful to convert the\n#!\toutput of a Gurobi solution back in terms of the variables. For example, the characteristic vector\n#!\t[1, 0, 1, 0, 0] would return the index set [1,3]. Note that since the function expects a characteristic \n#!\tvector it doesn't account for any weightings, and is only interested in whether or not the corresponding \n#!\tindex is present, and as such it rounds each entry to the nearest integer and checks that it is non-zero.\n#!\tHence it is particularly suitable for use with binary variables. \nDeclareOperation(\"CharacteristicVectorToIndexSet\",\n\t[IsList]);\n\n\n#! @Chapter Using Gurobify\n#! @Section Additional Functionality\n#! @Arguments Subset, full set\n#! @Returns Characterisitc vector\n#! @Description\n#!\tTakes a subset of some set, and returns the characteristic vector where the entries of the characteristic\n#!\tvector are indexed by the full set. For example, the subset [\"c\"] of [\"a\", \"c\", \"n\", \"q\"] would give the \n#!\tcharacteristic vector [0, 1, 0, 0]. This removes the need to first find the index set of the subset.\nDeclareOperation(\"SubsetToCharacteristicVector\",\n\t[IsList, IsList]);\n\n#! @Chapter Using Gurobify\n#! @Section Additional Functionality\n#! @Arguments Characteristic vector\n#! @Returns Characterisitc vector\n#! @Description\n#!\tTakes a characteristic vector and some set which it takes to be indexing the entries of the characteristic \n#!\tvector. It then returns the subset of the full set corresponding to the non-zero entries of the characteristic \n#!\tvector. This is the reverse process to SubsetToCharacteristicVector. Note again that the characteristic vector \n#!\tis rounded to an integer before being compared to 0. As an example, the characteristic vector [0, 1, 0, 0] with \n#!\tthe set [\"a\", \"c\", \"n\", \"q\"] would return [\"c\"]. This removes the need to first return an index set before \n#!\tfinding the subset.\nDeclareOperation(\"CharacteristicVectorToSubset\",\n\t[IsList, IsList]);\n\n","returncode":0,"stderr":"","license":"mpl-2.0","lang":"GDScript"} {"commit":"8643d11d03b11aad9258d3ffdc2bb345ccdf1f87","subject":"Create global variable Network to hold a reference to a network script. Moving away form autoload","message":"Create global variable Network to hold a reference to a network script.\nMoving away form autoload\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/GUIManager.gd","new_file":"src\/scripts\/GUIManager.gd","new_contents":"# This script manages all of the GUI elements.\n# It switches between the states of the GUI allowing\n# the user to start games, edit the options or connect\n# to a multiplayer game.\n\nextends Node\n\n# network variables\nvar network\n\n# State variables.\nvar menuOn\nvar splashTween\n\n# Timers.\nvar timer\nvar initialWait = .5\nvar splashTimer = 2.0\nvar warningTimer = 5.0\n\n# GUI pieces.\nvar Splash_Team5\nvar Splash_Warning\nvar Menu_Main\nvar Menu_Chooser\nvar Menu_MP\nvar Menu_HostGame\nvar Menu_JoinGame\nvar Menu_Options\n\n# Menu state values. Used to switch between them.\nvar MENU_INIT\t\t\t= 0\nvar MENU_SPLASHTEAM5\t= 1\nvar MENU_SPLASHWARNING\t= 2\nvar MENU_MAIN\t\t\t= 3\nvar MENU_CHOOSER\t\t= 4\nvar MENU_MP\t\t\t\t= 5\nvar MENU_HOSTGAME\t\t= 6\nvar MENU_JOINGAME\t\t= 7\nvar MENU_OPTIONS\t\t= 8\n\n# Function to be called once for setup.\nfunc _ready():\n\t# Initial setup.\n\tmenuOn = MENU_INIT\n\ttimer = 0.0\n\tset_process( true )\n\tset_process_input( true )\n\n\t# Setup the splash fader tween.\n\tsplashTween = Tween.new()\n\tget_node( \"SplashFader\" ).add_child( splashTween )\n\tsplashTween.interpolate_method( get_node( \"SplashFader\" ), \"set_opacity\", 1.0, 0.0, 1.0, Tween.TRANS_CUBIC, Tween.EASE_IN_OUT )\n\n\t# Gather all of the menus.\n\tSplash_Team5 = get_node( \"SplashTeam5\" )\n\tSplash_Warning = get_node( \"SplashWarning\" )\n\tMenu_Main = get_node( \"MainMenu\" )\n\tMenu_Chooser = get_node( \"ChooserMenu\" )\n\tMenu_MP = get_node( \"Multiplayer\" )\n\tMenu_HostGame = get_node( \"HostGame\" )\n\tMenu_JoinGame = get_node( \"JoinGame\" )\n\tMenu_Options = get_node( \"OptionsMenu\" )\n\t\n\tGlobals.set(\"Network\", load(\"res:\/\/scripts\/Network.gd\").new())\n\tnetwork = Globals.get(\"Network\")\n\n# Function to update the GUI.\nfunc _process( delta ):\n\t# Handle the initial wait.\n\tif( menuOn == MENU_INIT ):\n\t\tif( timer > initialWait ):\n\t\t\tmenuOn = MENU_SPLASHTEAM5\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiIn()\n\n\t# Handle the Team5 splash screen.\n\tif( menuOn == MENU_SPLASHTEAM5 ):\n\t\tif( timer > splashTimer ):\n\t\t\tmenuOn = MENU_SPLASHWARNING\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiOut()\n\t\t\tSplash_Warning.guiIn()\n\n\t# Handle the warning splash screen.\n\tif( menuOn == MENU_SPLASHWARNING ):\n\t\tif( timer > warningTimer ):\n\t\t\tmenuOn = MENU_MAIN\n\t\t\ttimer = 0.0\n\t\t\tSplash_Warning.guiOut()\n\t\t\tMenu_Main.guiIn()\n\t\t\tsplashTween.start()\n\n\t# Increase the timer each frame.\n\ttimer += delta\n\n# Handle the input events.\nfunc _input( ev ):\n\t# Handle skip splash screens.\n\tif( !ev.is_pressed() and ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT ):\n\t\tif( menuOn == MENU_SPLASHTEAM5 || menuOn == MENU_SPLASHWARNING ):\n\t\t\ttimer = 999.0;\n\n\t# Handle exit.\n\tif( ev.is_action( \"ui_cancel\" ) ):\n\t\texit()\n\nfunc exit():\n\tprint( \"Exiting\" )\n\tOS.get_main_loop().quit()\n\nfunc _on_Exit_pressed():\n\texit()\n\n# TODO save to ConfigFile, load this on beginning\nfunc _on_Options_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Options.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_OPTIONS\n\nfunc _on_Cancel_pressed():\n\tMenu_Options.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_SaveQuit_pressed():\n\t# Add save options here.\n\tvar field = get_tree().get_root().get_node(\"GUIManager\/OptionsMenu\/Panel\/PortField\/LineEdit\")\n\tget_node(\"\/root\/Network\").setPort(field.get_text())\n\t_on_Cancel_pressed()\n\nfunc _on_SP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Chooser.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_CHOOSER\n\nfunc _on_MainMenu_pressed():\n\tMenu_Chooser.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MainMenuMP_pressed():\n\tMenu_MP.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_MP.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MP\n\nfunc _on_MainMenuHG_pressed():\n\tMenu_HostGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\tvar network = get_node(\"\/root\/Network\")\n\tnetwork.disconnect()\n\nfunc _on_HostGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_HostGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_HOSTGAME\n\tvar network = get_node(\"\/root\/Network\")\n\t\n\tif !network.isHost and !network.isNetwork:\n\t\tprint(\"calling!\")\n\t\tnetwork.host(network.port)\n\t\tget_tree().get_root().get_node(\"GUIManager\/HostGame\/Panel\/Waiting\").set_text(\"Waiting for player to join on port \" + str(network.port) + \"...\")\n\nfunc _on_JoinGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_JoinGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_JOINGAME\n\nfunc _on_MainMenuJG_pressed():\n\tMenu_JoinGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_RandomPuzzle_pressed():\n\tvar root = get_tree().get_root()\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\troot.add_child( ResourceLoader.load( \"res:\/\/puzzle.scn\" ).instance() )\n\n\n\nfunc _on_Join_pressed():\n\tvar IPPanel = get_tree().get_root().get_node(\"GUIManager\/JoinGame\/Panel\/IPAddress\")\n\tvar ip = IPPanel.get_text();\n\t\n\tif (ip.empty()):\n\t\treturn\n\t\n\tvar network = get_node(\"\/root\/Network\")\n\tif !network.isClient:\n\t\tnetwork.connectTo(ip, network.port)","old_contents":"# This script manages all of the GUI elements.\n# It switches between the states of the GUI allowing\n# the user to start games, edit the options or connect\n# to a multiplayer game.\n\nextends Node\n\n# State variables.\nvar menuOn\nvar splashTween\n\n# Timers.\nvar timer\nvar initialWait = .5\nvar splashTimer = 2.0\nvar warningTimer = 5.0\n\n# GUI pieces.\nvar Splash_Team5\nvar Splash_Warning\nvar Menu_Main\nvar Menu_Chooser\nvar Menu_MP\nvar Menu_HostGame\nvar Menu_JoinGame\nvar Menu_Options\n\n# Menu state values. Used to switch between them.\nvar MENU_INIT\t\t\t= 0\nvar MENU_SPLASHTEAM5\t= 1\nvar MENU_SPLASHWARNING\t= 2\nvar MENU_MAIN\t\t\t= 3\nvar MENU_CHOOSER\t\t= 4\nvar MENU_MP\t\t\t\t= 5\nvar MENU_HOSTGAME\t\t= 6\nvar MENU_JOINGAME\t\t= 7\nvar MENU_OPTIONS\t\t= 8\n\n# Function to be called once for setup.\nfunc _ready():\n\t# Initial setup.\n\tmenuOn = MENU_INIT\n\ttimer = 0.0\n\tset_process( true )\n\tset_process_input( true )\n\n\t# Setup the splash fader tween.\n\tsplashTween = Tween.new()\n\tget_node( \"SplashFader\" ).add_child( splashTween )\n\tsplashTween.interpolate_method( get_node( \"SplashFader\" ), \"set_opacity\", 1.0, 0.0, 1.0, Tween.TRANS_CUBIC, Tween.EASE_IN_OUT )\n\n\t# Gather all of the menus.\n\tSplash_Team5 = get_node( \"SplashTeam5\" )\n\tSplash_Warning = get_node( \"SplashWarning\" )\n\tMenu_Main = get_node( \"MainMenu\" )\n\tMenu_Chooser = get_node( \"ChooserMenu\" )\n\tMenu_MP = get_node( \"Multiplayer\" )\n\tMenu_HostGame = get_node( \"HostGame\" )\n\tMenu_JoinGame = get_node( \"JoinGame\" )\n\tMenu_Options = get_node( \"OptionsMenu\" )\n\n# Function to update the GUI.\nfunc _process( delta ):\n\t# Handle the initial wait.\n\tif( menuOn == MENU_INIT ):\n\t\tif( timer > initialWait ):\n\t\t\tmenuOn = MENU_SPLASHTEAM5\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiIn()\n\n\t# Handle the Team5 splash screen.\n\tif( menuOn == MENU_SPLASHTEAM5 ):\n\t\tif( timer > splashTimer ):\n\t\t\tmenuOn = MENU_SPLASHWARNING\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiOut()\n\t\t\tSplash_Warning.guiIn()\n\n\t# Handle the warning splash screen.\n\tif( menuOn == MENU_SPLASHWARNING ):\n\t\tif( timer > warningTimer ):\n\t\t\tmenuOn = MENU_MAIN\n\t\t\ttimer = 0.0\n\t\t\tSplash_Warning.guiOut()\n\t\t\tMenu_Main.guiIn()\n\t\t\tsplashTween.start()\n\n\t# Increase the timer each frame.\n\ttimer += delta\n\n# Handle the input events.\nfunc _input( ev ):\n\t# Handle skip splash screens.\n\tif( !ev.is_pressed() and ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT ):\n\t\tif( menuOn == MENU_SPLASHTEAM5 || menuOn == MENU_SPLASHWARNING ):\n\t\t\ttimer = 999.0;\n\n\t# Handle exit.\n\tif( ev.is_action( \"ui_cancel\" ) ):\n\t\texit()\n\nfunc exit():\n\tprint( \"Exiting\" )\n\tOS.get_main_loop().quit()\n\nfunc _on_Exit_pressed():\n\texit()\n\n# TODO save to ConfigFile, load this on beginning\nfunc _on_Options_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Options.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_OPTIONS\n\nfunc _on_Cancel_pressed():\n\tMenu_Options.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_SaveQuit_pressed():\n\t# Add save options here.\n\tvar field = get_tree().get_root().get_node(\"GUIManager\/OptionsMenu\/Panel\/PortField\/LineEdit\")\n\tget_node(\"\/root\/Network\").setPort(field.get_text())\n\t_on_Cancel_pressed()\n\nfunc _on_SP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Chooser.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_CHOOSER\n\nfunc _on_MainMenu_pressed():\n\tMenu_Chooser.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MainMenuMP_pressed():\n\tMenu_MP.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_MP.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MP\n\nfunc _on_MainMenuHG_pressed():\n\tMenu_HostGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\tvar network = get_node(\"\/root\/Network\")\n\tnetwork.disconnect()\n\nfunc _on_HostGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_HostGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_HOSTGAME\n\tvar network = get_node(\"\/root\/Network\")\n\t\n\tif !network.isHost and !network.isNetwork:\n\t\tprint(\"calling!\")\n\t\tnetwork.host(network.port)\n\t\tget_tree().get_root().get_node(\"GUIManager\/HostGame\/Panel\/Waiting\").set_text(\"Waiting for player to join on port \" + str(network.port) + \"...\")\n\nfunc _on_JoinGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_JoinGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_JOINGAME\n\nfunc _on_MainMenuJG_pressed():\n\tMenu_JoinGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_RandomPuzzle_pressed():\n\tvar root = get_tree().get_root()\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\troot.add_child( ResourceLoader.load( \"res:\/\/puzzle.scn\" ).instance() )\n\n\n\nfunc _on_Join_pressed():\n\tvar IPPanel = get_tree().get_root().get_node(\"GUIManager\/JoinGame\/Panel\/IPAddress\")\n\tvar ip = IPPanel.get_text();\n\t\n\tif (ip.empty()):\n\t\treturn\n\t\n\tvar network = get_node(\"\/root\/Network\")\n\tif !network.isClient:\n\t\tnetwork.connectTo(ip, network.port)","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"17ebae520cb9062ca8ab6493c5cb5a4bc4d4d893","subject":"Updates nested object uniquification expectations based on Blender export ordering.","message":"Updates nested object uniquification expectations based on Blender export ordering.\n","repos":"godotengine\/godot-tests,godotengine\/godot-tests","old_file":"tests\/blend_export\/test_45545.gd","new_file":"tests\/blend_export\/test_45545.gd","new_contents":"extends ColorRect\n\nconst GOLDEN_GLTF_SCENE: PackedScene = preload(\"res:\/\/gltf\/45545-relax-name-sanitization.gltf\")\n\n## These constants are the prefix part of the node names used in the golden glTF file.\n# Prefix for \"basic\" nodes, no import hints, no animation, etc...\nconst GLTF_PREFIX_BASIC: String = \"Basic_\"\n\n# Prefix for nodes that have an import hint.\nconst GLTF_PREFIX_HINTED: String = \"Hinted_\"\n\n# Prefix for nodes that have an associated animation.\nconst GLTF_PREFIX_ANIMATED: String = \"Animated_\"\n\n# The suffix for animations (all animations in the golden glTF file use the Blender default suffix\n# \"Action\" and the looping import hint \"-loop\".\nconst GLTF_SUFFIX_ANIMATION: String = \"Action-loop\"\n\n## These constants are the infix part of the node names used in the golden glTF file.\nconst GLTF_ALPHANUMERIC: String = \"Alphanumeric123\"\n# The last three symbols are:\n# https:\/\/en.wiktionary.org\/wiki\/%E3%82%B4#Japanese\n# https:\/\/en.wiktionary.org\/wiki\/%E3%83%89#Japanese\n# https:\/\/en.wiktionary.org\/wiki\/%E3%83%84#Japanese\nconst GLTF_KATAKANA: String = \"Katakana_\u30b4\u30c9\u30c4\"\n# The last two symbols are:\n# https:\/\/emojipedia.org\/grinning-face\n# https:\/\/emojipedia.org\/robot\/\nconst GLTF_EMOJI: String = \"Emoji_\ud83d\ude00\ud83e\udd16\"\nconst GLTF_ALLOWED_SYMBOLS: String = \"AllowedSymbols_!#$%^&*()-=[]{}';<>,~\"\nconst GLTF_DISALLOWED_NONCLASHING: String = \"Disallowed_Non-clashing_.:@\\\"\/\"\nconst GLTF_DISALLOWED_CLASHING_1: String = \"Disallowed_Clashing_.\"\nconst GLTF_DISALLOWED_CLASHING_2: String = \"Disallowed_Clashing_@\"\nconst GLTF_DISALLOWED_CLASHING_DEEP_TREE_1: String = \"Disallowed_Clashing_Deep_Tree_@\"\nconst GLTF_DISALLOWED_CLASHING_DEEP_TREE_2: String = \"Disallowed_Clashing_Deep_Tree_@@\"\nconst GLTF_DISALLOWED_CLASHING_DEEP_TREE_3: String = \"Disallowed_Clashing_Deep_Tree_@@@\"\n\nvar output: BoxContainer\nvar test_scene: Node\nvar test_animation_player: AnimationPlayer\n\n\nfunc _ready():\n\toutput = $ScrollContainer\/OutputWindow\n\ttest_scene = GOLDEN_GLTF_SCENE.instance()\n\ttest_animation_player = test_scene.get_node_or_null(\"AnimationPlayer\")\n\tif not test_animation_player:\n\t\t_add_line(\"ERROR: imported glTF scene has no AnimationPlayer node!\", Color.orangered)\n\t\tprint(\"FAIL: imported glTF scene has no AnimationPlayer so no tests will be run.\")\n\t\treturn\n\n\tvar passed_tests: Array = []\n\tvar failed_tests: Array = []\n\n\tfor method_name in _find_tests():\n\t\t_add_test_header(method_name)\n\t\tvar result: bool = self.call(method_name)\n\t\t_add_line(\" \")\n\t\tif result:\n\t\t\tpassed_tests.push_back(method_name)\n\t\telse:\n\t\t\tfailed_tests.push_back(method_name)\n\n\tif failed_tests:\n\t\tprint(\"FAIL: %d failed tests:\" % len(failed_tests))\n\t\tfor test in failed_tests:\n\t\t\tprint(\"\\t%s\" % test)\n\t\tprint(\"\")\n\t\tprint(\"Animations:\")\n\t\tfor animation_name in test_animation_player.get_animation_list():\n\t\t\tprint(\"\\t%s\" % animation_name)\n\telse:\n\t\tprint(\"PASS: Passed all %d tests\" % len(passed_tests))\n\n\nfunc _find_tests() -> Array:\n\tvar ret: Array = []\n\tfor method in get_method_list():\n\t\tvar method_name: String = method.get(\"name\")\n\t\tif method_name.begins_with(\"_test_\"):\n\t\t\tret.push_back(method_name)\n\tret.sort()\n\treturn ret\n\n\nfunc _add_test_header(method_name: String) -> void:\n\t_add_line(method_name, Color.royalblue)\n\n\nfunc _add_result(succeeded: bool, message: String) -> void:\n\tvar prefix: String = \" [OK] \" if succeeded else \" [FAIL] \"\n\t_add_line(prefix + message, Color.forestgreen if succeeded else Color.orangered)\n\n\nfunc _add_line(text: String, font_color: Color = Color.black) -> void:\n\tvar line: Label = Label.new()\n\tline.text = text\n\tline.add_theme_font_size_override(\"font_size\", 22)\n\tline.add_theme_color_override(\"font_color\", font_color)\n\toutput.add_child(line)\n\tprint(text)\n\n\nfunc _check_basic(original: String, expected: String) -> bool:\n\tvar node: Node = test_scene.get_node_or_null(expected)\n\tif not node:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Missing expected Godot node '%s' for glTF node '%s'\" % [expected, original])\n\t\treturn false\n\t_add_result(true, \"Found expected node '%s'\" % expected)\n\treturn true\n\n\nfunc _test_basic_alphanumeric_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_ALPHANUMERIC\n\tvar expected: String = original\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_allowed_symbols_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_ALLOWED_SYMBOLS\n\tvar expected: String = original\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_katakana_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_KATAKANA\n\tvar expected: String = original\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_emoji_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_EMOJI\n\tvar expected: String = original\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_disallowed_characters_are_stripped() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_NONCLASHING\n\tvar expected: String = GLTF_PREFIX_BASIC + \"Disallowed_Non-clashing_\"\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_disallowed_clashing_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_1\n\tvar expected: String = GLTF_PREFIX_BASIC + \"Disallowed_Clashing_\"\n\tif not _check_basic(original, expected):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_2\n\texpected = GLTF_PREFIX_BASIC + \"Disallowed_Clashing_2\"\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_disallowed_nested_nodes_are_uniquified() -> bool:\n\t# Note: Blender 9.2 serializes in prefix order, so the leaf child will be named first.\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_DEEP_TREE_1\n\tvar expected_root: String = GLTF_PREFIX_BASIC + \"Disallowed_Clashing_Deep_Tree_3\"\n\tif not _check_basic(original, expected_root):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_DEEP_TREE_2\n\tvar expected_mid = expected_root + \"\/\" + GLTF_PREFIX_BASIC + \"Disallowed_Clashing_Deep_Tree_2\"\n\tif not _check_basic(original, expected_mid):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_DEEP_TREE_3\n\tvar expected_leaf = expected_mid + \"\/\" + GLTF_PREFIX_BASIC + \"Disallowed_Clashing_Deep_Tree_\"\n\treturn _check_basic(original, expected_leaf)\n\n\n# Verifies that a node exists with the expected name and that it has a StaticBody3D child.\nfunc _check_hinted_col(original: String, expected: String) -> bool:\n\tvar node: Node = test_scene.get_node_or_null(expected)\n\tif not node:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Missing expected Godot node '%s' for glTF node '%s'\" % [expected, original])\n\t\treturn false\n\n\tvar collision_body: StaticBody3D = node.get_node_or_null(\"static_collision\")\n\tif not collision_body:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Missing 'static_collision' child for Godot node '%s' (glTF '%s')\" % [\n\t\t\t\texpected, original])\n\t\treturn false\n\n\t# This test assumes that if the static_collision node was created the -col hint was properly\n\t# handled (as that behavior should be tested elsewhere).\n\t_add_result(true, \"Expected node '%s' contains a static_collision StaticBody3D\" % expected)\n\treturn true\n\n\nfunc _test_hinted_alphanumeric_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_ALPHANUMERIC\n\tvar expected: String = original\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_allowed_symbols_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_ALLOWED_SYMBOLS\n\tvar expected: String = original\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_katakana_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_KATAKANA\n\tvar expected: String = original\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_emoji_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_EMOJI\n\tvar expected: String = original\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_disallowed_characters_are_stripped() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_DISALLOWED_NONCLASHING\n\tvar expected: String = GLTF_PREFIX_HINTED + \"Disallowed_Non-clashing_\"\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_disallowed_clashing_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_DISALLOWED_CLASHING_1\n\tvar expected: String = GLTF_PREFIX_HINTED + \"Disallowed_Clashing_\"\n\tif not _check_hinted_col(original, expected):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_HINTED + GLTF_DISALLOWED_CLASHING_2\n\texpected = GLTF_PREFIX_HINTED + \"Disallowed_Clashing_2\"\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_disallowed_nested_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_DISALLOWED_CLASHING_DEEP_TREE_1\n\tvar expected_root: String = GLTF_PREFIX_HINTED + \"Disallowed_Clashing_Deep_Tree_3\"\n\tif not _check_hinted_col(original, expected_root):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_HINTED + GLTF_DISALLOWED_CLASHING_DEEP_TREE_2\n\tvar expected_mid = expected_root + \"\/\" + GLTF_PREFIX_HINTED + \"Disallowed_Clashing_Deep_Tree_2\"\n\tif not _check_hinted_col(original, expected_mid):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_HINTED + GLTF_DISALLOWED_CLASHING_DEEP_TREE_3\n\tvar expected_leaf = expected_mid + \"\/\" + GLTF_PREFIX_HINTED + \"Disallowed_Clashing_Deep_Tree_\"\n\treturn _check_hinted_col(original, expected_leaf)\n\n\n# Verifies that a node exists with the expected name and that an associated animation exists.\nfunc _check_animated(original: String, expected: String, expected_animation: String = \"\") -> bool:\n\tvar node: Node = test_scene.get_node_or_null(expected)\n\tif not node:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Missing expected Godot node '%s' for glTF node '%s'\" % [expected, original])\n\t\treturn false\n\n\tif expected_animation.is_empty():\n\t\texpected_animation = expected + GLTF_SUFFIX_ANIMATION\n\tvar animation: Animation = test_animation_player.get_animation(expected_animation)\n\tif not animation:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Missing expected animation '%s' for Godot node '%s' (glTF '%s')\" % [\n\t\t\t\texpected_animation, expected, original])\n\t\treturn false\n\n\tvar track_count: int = animation.get_track_count()\n\tif track_count != 1:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Track count %d != 1 on animation '%s' for Godot node '%s' (glTF '%s')\" % [\n\t\t\t\ttrack_count, expected_animation, expected, original])\n\t\treturn false\n\n\tvar track_type: int = animation.track_get_type(0)\n\tif track_type != Animation.TYPE_TRANSFORM:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Unexpected track type %d on animation '%s' for Godot node '%s' (glTF '%s')\" % [\n\t\t\t\ttrack_type, expected_animation, expected, original])\n\t\treturn false\n\n\tvar track_path: NodePath = animation.track_get_path(0)\n\tvar expected_track_path = NodePath(expected)\n\tif track_path != expected_track_path:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t(\"Incorrect track_path '%s' (expected '%s') on animation '%s' for Godot node '%s' \\\n\t\t\t\t (glTF '%s')\" % [\n\t\t\t\t\ttrack_path, expected_track_path, expected_animation, expected, original]))\n\t\treturn false\n\n\n\t# This test assumes that if the static_collision node was created the -col hint was properly\n\t# handled (as that behavior should be tested elsewhere).\n\t_add_result(true, \"Expected node '%s' has an associated animation\" % expected)\n\treturn true\n\n\nfunc _test_animated_alphanumeric_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_ALPHANUMERIC\n\tvar expected: String = original\n\treturn _check_animated(original, expected)\n\n\nfunc _test_animated_allowed_symbols_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_ALLOWED_SYMBOLS\n\tvar expected_node: String = original\n\tvar expected_animation: String = original.replace(\",\", \"\").replace(\"[\", \"\")\n\texpected_animation += GLTF_SUFFIX_ANIMATION\n\treturn _check_animated(original, expected_node, expected_animation)\n\n\nfunc _test_animated_katakana_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_KATAKANA\n\tvar expected: String = original\n\treturn _check_animated(original, expected)\n\n\nfunc _test_animated_emoji_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_EMOJI\n\tvar expected: String = original\n\treturn _check_animated(original, expected)\n\n\nfunc _test_animated_disallowed_characters_are_stripped() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_DISALLOWED_NONCLASHING\n\tvar expected: String = GLTF_PREFIX_ANIMATED + \"Disallowed_Non-clashing_\"\n\treturn _check_animated(original, expected)\n\n\nfunc _test_animated_disallowed_clashing_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_DISALLOWED_CLASHING_1\n\tvar expected: String = GLTF_PREFIX_ANIMATED + \"Disallowed_Clashing_\"\n\tif not _check_animated(original, expected):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_ANIMATED + GLTF_DISALLOWED_CLASHING_2\n\texpected = GLTF_PREFIX_ANIMATED + \"Disallowed_Clashing_2\"\n\treturn _check_animated(original, expected)\n\n\nfunc _test_animated_disallowed_nested_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_DISALLOWED_CLASHING_DEEP_TREE_1\n\tvar expected_root: String = GLTF_PREFIX_ANIMATED + \"Disallowed_Clashing_Deep_Tree_3\"\n\tif not _check_animated(original, expected_root):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_ANIMATED + GLTF_DISALLOWED_CLASHING_DEEP_TREE_2\n\tvar expected_mid = (expected_root + \"\/\" +\n\t\tGLTF_PREFIX_ANIMATED + \"Disallowed_Clashing_Deep_Tree_2\")\n\tif not _check_animated(original, expected_mid):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_ANIMATED + GLTF_DISALLOWED_CLASHING_DEEP_TREE_3\n\tvar expected_leaf = (expected_mid + \"\/\" +\n\t\tGLTF_PREFIX_ANIMATED + \"Disallowed_Clashing_Deep_Tree_\")\n\treturn _check_animated(original, expected_leaf)\n","old_contents":"extends ColorRect\n\nconst GOLDEN_GLTF_SCENE: PackedScene = preload(\"res:\/\/gltf\/45545-relax-name-sanitization.gltf\")\n\n## These constants are the prefix part of the node names used in the golden glTF file.\n# Prefix for \"basic\" nodes, no import hints, no animation, etc...\nconst GLTF_PREFIX_BASIC: String = \"Basic_\"\n\n# Prefix for nodes that have an import hint.\nconst GLTF_PREFIX_HINTED: String = \"Hinted_\"\n\n# Prefix for nodes that have an associated animation.\nconst GLTF_PREFIX_ANIMATED: String = \"Animated_\"\n\n# The suffix for animations (all animations in the golden glTF file use the Blender default suffix\n# \"Action\" and the looping import hint \"-loop\".\nconst GLTF_SUFFIX_ANIMATION: String = \"Action-loop\"\n\n## These constants are the infix part of the node names used in the golden glTF file.\nconst GLTF_ALPHANUMERIC: String = \"Alphanumeric123\"\n# The last three symbols are:\n# https:\/\/en.wiktionary.org\/wiki\/%E3%82%B4#Japanese\n# https:\/\/en.wiktionary.org\/wiki\/%E3%83%89#Japanese\n# https:\/\/en.wiktionary.org\/wiki\/%E3%83%84#Japanese\nconst GLTF_KATAKANA: String = \"Katakana_\u30b4\u30c9\u30c4\"\n# The last two symbols are:\n# https:\/\/emojipedia.org\/grinning-face\n# https:\/\/emojipedia.org\/robot\/\nconst GLTF_EMOJI: String = \"Emoji_\ud83d\ude00\ud83e\udd16\"\nconst GLTF_ALLOWED_SYMBOLS: String = \"AllowedSymbols_!#$%^&*()-=[]{}';<>,~\"\nconst GLTF_DISALLOWED_NONCLASHING: String = \"Disallowed_Non-clashing_.:@\\\"\/\"\nconst GLTF_DISALLOWED_CLASHING_1: String = \"Disallowed_Clashing_.\"\nconst GLTF_DISALLOWED_CLASHING_2: String = \"Disallowed_Clashing_@\"\nconst GLTF_DISALLOWED_CLASHING_DEEP_TREE_1: String = \"Disallowed_Clashing_Deep_Tree_@\"\nconst GLTF_DISALLOWED_CLASHING_DEEP_TREE_2: String = \"Disallowed_Clashing_Deep_Tree_@@\"\nconst GLTF_DISALLOWED_CLASHING_DEEP_TREE_3: String = \"Disallowed_Clashing_Deep_Tree_@@@\"\n\nvar output: BoxContainer\nvar test_scene: Node\nvar test_animation_player: AnimationPlayer\n\n\nfunc _ready():\n\toutput = $ScrollContainer\/OutputWindow\n\ttest_scene = GOLDEN_GLTF_SCENE.instance()\n\ttest_animation_player = test_scene.get_node_or_null(\"AnimationPlayer\")\n\tif not test_animation_player:\n\t\t_add_line(\"ERROR: imported glTF scene has no AnimationPlayer node!\", Color.orangered)\n\t\tprint(\"FAIL: imported glTF scene has no AnimationPlayer so no tests will be run.\")\n\t\treturn\n\n\tvar passed_tests: Array = []\n\tvar failed_tests: Array = []\n\n\tfor method_name in _find_tests():\n\t\t_add_test_header(method_name)\n\t\tvar result: bool = self.call(method_name)\n\t\t_add_line(\" \")\n\t\tif result:\n\t\t\tpassed_tests.push_back(method_name)\n\t\telse:\n\t\t\tfailed_tests.push_back(method_name)\n\n\tif failed_tests:\n\t\tprint(\"FAIL: %d failed tests:\" % len(failed_tests))\n\t\tfor test in failed_tests:\n\t\t\tprint(\"\\t%s\" % test)\n\t\tprint(\"\")\n\t\tprint(\"Animations:\")\n\t\tfor animation_name in test_animation_player.get_animation_list():\n\t\t\tprint(\"\\t%s\" % animation_name)\n\telse:\n\t\tprint(\"PASS: Passed all %d tests\" % len(passed_tests))\n\n\nfunc _find_tests() -> Array:\n\tvar ret: Array = []\n\tfor method in get_method_list():\n\t\tvar method_name: String = method.get(\"name\")\n\t\tif method_name.begins_with(\"_test_\"):\n\t\t\tret.push_back(method_name)\n\tret.sort()\n\treturn ret\n\n\nfunc _add_test_header(method_name: String) -> void:\n\t_add_line(method_name, Color.royalblue)\n\n\nfunc _add_result(succeeded: bool, message: String) -> void:\n\tvar prefix: String = \" [OK] \" if succeeded else \" [FAIL] \"\n\t_add_line(prefix + message, Color.forestgreen if succeeded else Color.orangered)\n\n\nfunc _add_line(text: String, font_color: Color = Color.black) -> void:\n\tvar line: Label = Label.new()\n\tline.text = text\n\tline.add_theme_font_size_override(\"font_size\", 22)\n\tline.add_theme_color_override(\"font_color\", font_color)\n\toutput.add_child(line)\n\tprint(text)\n\n\nfunc _check_basic(original: String, expected: String) -> bool:\n\tvar node: Node = test_scene.get_node_or_null(expected)\n\tif not node:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Missing expected Godot node '%s' for glTF node '%s'\" % [expected, original])\n\t\treturn false\n\t_add_result(true, \"Found expected node '%s'\" % expected)\n\treturn true\n\n\nfunc _test_basic_alphanumeric_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_ALPHANUMERIC\n\tvar expected: String = original\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_allowed_symbols_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_ALLOWED_SYMBOLS\n\tvar expected: String = original\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_katakana_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_KATAKANA\n\tvar expected: String = original\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_emoji_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_EMOJI\n\tvar expected: String = original\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_disallowed_characters_are_stripped() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_NONCLASHING\n\tvar expected: String = GLTF_PREFIX_BASIC + \"Disallowed_Non-clashing_\"\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_disallowed_clashing_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_1\n\tvar expected: String = GLTF_PREFIX_BASIC + \"Disallowed_Clashing_\"\n\tif not _check_basic(original, expected):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_2\n\texpected = GLTF_PREFIX_BASIC + \"Disallowed_Clashing_2\"\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_disallowed_nested_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_DEEP_TREE_1\n\tvar expected_root: String = GLTF_PREFIX_BASIC + \"Disallowed_Clashing_Deep_Tree_\"\n\tif not _check_basic(original, expected_root):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_DEEP_TREE_2\n\tvar expected_mid = expected_root + \"\/\" + GLTF_PREFIX_BASIC + \"Disallowed_Clashing_Deep_Tree_2\"\n\tif not _check_basic(original, expected_mid):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_DEEP_TREE_3\n\tvar expected_leaf = expected_mid + \"\/\" + GLTF_PREFIX_BASIC + \"Disallowed_Clashing_Deep_Tree_3\"\n\treturn _check_basic(original, expected_leaf)\n\n\n# Verifies that a node exists with the expected name and that it has a StaticBody3D child.\nfunc _check_hinted_col(original: String, expected: String) -> bool:\n\tvar node: Node = test_scene.get_node_or_null(expected)\n\tif not node:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Missing expected Godot node '%s' for glTF node '%s'\" % [expected, original])\n\t\treturn false\n\n\tvar collision_body: StaticBody3D = node.get_node_or_null(\"static_collision\")\n\tif not collision_body:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Missing 'static_collision' child for Godot node '%s' (glTF '%s')\" % [\n\t\t\t\texpected, original])\n\t\treturn false\n\n\t# This test assumes that if the static_collision node was created the -col hint was properly\n\t# handled (as that behavior should be tested elsewhere).\n\t_add_result(true, \"Expected node '%s' contains a static_collision StaticBody3D\" % expected)\n\treturn true\n\n\nfunc _test_hinted_alphanumeric_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_ALPHANUMERIC\n\tvar expected: String = original\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_allowed_symbols_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_ALLOWED_SYMBOLS\n\tvar expected: String = original\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_katakana_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_KATAKANA\n\tvar expected: String = original\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_emoji_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_EMOJI\n\tvar expected: String = original\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_disallowed_characters_are_stripped() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_DISALLOWED_NONCLASHING\n\tvar expected: String = GLTF_PREFIX_HINTED + \"Disallowed_Non-clashing_\"\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_disallowed_clashing_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_DISALLOWED_CLASHING_1\n\tvar expected: String = GLTF_PREFIX_HINTED + \"Disallowed_Clashing_\"\n\tif not _check_hinted_col(original, expected):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_HINTED + GLTF_DISALLOWED_CLASHING_2\n\texpected = GLTF_PREFIX_HINTED + \"Disallowed_Clashing_2\"\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_disallowed_nested_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_DISALLOWED_CLASHING_DEEP_TREE_1\n\tvar expected_root: String = GLTF_PREFIX_HINTED + \"Disallowed_Clashing_Deep_Tree_\"\n\tif not _check_hinted_col(original, expected_root):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_HINTED + GLTF_DISALLOWED_CLASHING_DEEP_TREE_2\n\tvar expected_mid = expected_root + \"\/\" + GLTF_PREFIX_HINTED + \"Disallowed_Clashing_Deep_Tree_2\"\n\tif not _check_hinted_col(original, expected_mid):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_HINTED + GLTF_DISALLOWED_CLASHING_DEEP_TREE_3\n\tvar expected_leaf = expected_mid + \"\/\" + GLTF_PREFIX_HINTED + \"Disallowed_Clashing_Deep_Tree_3\"\n\treturn _check_hinted_col(original, expected_leaf)\n\n\n# Verifies that a node exists with the expected name and that an associated animation exists.\nfunc _check_animated(original: String, expected: String, expected_animation: String = \"\") -> bool:\n\tvar node: Node = test_scene.get_node_or_null(expected)\n\tif not node:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Missing expected Godot node '%s' for glTF node '%s'\" % [expected, original])\n\t\treturn false\n\n\tif expected_animation.is_empty():\n\t\texpected_animation = expected + GLTF_SUFFIX_ANIMATION\n\tvar animation: Animation = test_animation_player.get_animation(expected_animation)\n\tif not animation:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Missing expected animation '%s' for Godot node '%s' (glTF '%s')\" % [\n\t\t\t\texpected_animation, expected, original])\n\t\treturn false\n\n\tvar track_count: int = animation.get_track_count()\n\tif track_count != 1:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Track count %d != 1 on animation '%s' for Godot node '%s' (glTF '%s')\" % [\n\t\t\t\ttrack_count, expected_animation, expected, original])\n\t\treturn false\n\n\tvar track_type: int = animation.track_get_type(0)\n\tif track_type != Animation.TYPE_TRANSFORM:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Unexpected track type %d on animation '%s' for Godot node '%s' (glTF '%s')\" % [\n\t\t\t\ttrack_type, expected_animation, expected, original])\n\t\treturn false\n\n\tvar track_path: NodePath = animation.track_get_path(0)\n\tvar expected_track_path = NodePath(expected)\n\tif track_path != expected_track_path:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t(\"Incorrect track_path '%s' (expected '%s') on animation '%s' for Godot node '%s' \\\n\t\t\t\t (glTF '%s')\" % [\n\t\t\t\t\ttrack_path, expected_track_path, expected_animation, expected, original]))\n\t\treturn false\n\n\n\t# This test assumes that if the static_collision node was created the -col hint was properly\n\t# handled (as that behavior should be tested elsewhere).\n\t_add_result(true, \"Expected node '%s' has an associated animation\" % expected)\n\treturn true\n\n\nfunc _test_animated_alphanumeric_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_ALPHANUMERIC\n\tvar expected: String = original\n\treturn _check_animated(original, expected)\n\n\nfunc _test_animated_allowed_symbols_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_ALLOWED_SYMBOLS\n\tvar expected_node: String = original\n\tvar expected_animation: String = original.replace(\",\", \"\").replace(\"[\", \"\")\n\texpected_animation += GLTF_SUFFIX_ANIMATION\n\treturn _check_animated(original, expected_node, expected_animation)\n\n\nfunc _test_animated_katakana_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_KATAKANA\n\tvar expected: String = original\n\treturn _check_animated(original, expected)\n\n\nfunc _test_animated_emoji_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_EMOJI\n\tvar expected: String = original\n\treturn _check_animated(original, expected)\n\n\nfunc _test_animated_disallowed_characters_are_stripped() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_DISALLOWED_NONCLASHING\n\tvar expected: String = GLTF_PREFIX_ANIMATED + \"Disallowed_Non-clashing_\"\n\treturn _check_animated(original, expected)\n\n\nfunc _test_animated_disallowed_clashing_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_DISALLOWED_CLASHING_1\n\tvar expected: String = GLTF_PREFIX_ANIMATED + \"Disallowed_Clashing_\"\n\tif not _check_animated(original, expected):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_ANIMATED + GLTF_DISALLOWED_CLASHING_2\n\texpected = GLTF_PREFIX_ANIMATED + \"Disallowed_Clashing_2\"\n\treturn _check_animated(original, expected)\n\n\nfunc _test_animated_disallowed_nested_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_DISALLOWED_CLASHING_DEEP_TREE_1\n\tvar expected_root: String = GLTF_PREFIX_ANIMATED + \"Disallowed_Clashing_Deep_Tree_\"\n\tif not _check_animated(original, expected_root):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_ANIMATED + GLTF_DISALLOWED_CLASHING_DEEP_TREE_2\n\tvar expected_mid = (expected_root + \"\/\" +\n\t\tGLTF_PREFIX_ANIMATED + \"Disallowed_Clashing_Deep_Tree_2\")\n\tif not _check_animated(original, expected_mid):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_ANIMATED + GLTF_DISALLOWED_CLASHING_DEEP_TREE_3\n\tvar expected_leaf = (expected_mid + \"\/\" +\n\t\tGLTF_PREFIX_ANIMATED + \"Disallowed_Clashing_Deep_Tree_3\")\n\treturn _check_animated(original, expected_leaf)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"27d1e86cc65f7b63a72dce5e868c838e4dccb9b8","subject":"basic add\/rm block functionality","message":"basic add\/rm block functionality\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Editor.gd","new_file":"src\/scripts\/Editor.gd","new_contents":"extends Spatial\n\n\n\nvar puzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar cursorScn = preload(\"res:\/\/cursor.scn\")\n\nvar cursorPos = Vector3(1,6,0)\nvar cursor\nvar puzzle = puzzleScn.instance()\nvar puzzleMan = puzzle.puzzleMan\nvar gridMan\nvar selectedBlock = null\n\nvar gui = {\n\tadd=Button.new(),\n\trm=Button.new(),\n\tsave_pzl=Button.new(),\n\tload_pzl=Button.new()\n}\nvar gui_text = {\n\tadd=\"Add Block\",\n\trm=\"Remove Block\",\n\tsave_pzl=\"Save\",\n\tload_pzl=\"Load\"\n}\n\n\nfunc cursor_move(dir):\n\tvar tween = Tween.new()\n\tvar N = 2\n\tadd_child(tween)\n\ttween.interpolate_method( cursor, \"set_global_transform\", \\\n\t\tcursor.get_global_transform(), cursor.get_global_transform().translated(dir * N), \\\n\t\t0.25, Tween.TRANS_EXPO, Tween.EASE_OUT )\n\ttween.start()\n\tcursorPos += dir\n\tselectedBlock = gridMan.get_block(cursorPos \/ 2)\n\nfunc _input(ev):\n\tif ev.type == InputEvent.KEY:\n\t\tif ev.is_pressed():\n\t\t\tif Input.is_action_pressed(\"ui_up\"):\n\t\t\t\tcursor_move(Vector3(0,1,0))\n\t\t\tif Input.is_action_pressed(\"ui_down\"):\n\t\t\t\tcursor_move(Vector3(0,-1,0))\n\t\t\tif Input.is_action_pressed(\"ui_left\"):\n\t\t\t\tcursor_move(Vector3(1,0,0))\n\t\t\tif Input.is_action_pressed(\"ui_right\"):\n\t\t\t\tcursor_move(Vector3(-1,0,0))\n\t\t\tif Input.is_action_pressed(\"ui_page_up\"):\n\t\t\t\tcursor_move(Vector3(0,0,1))\n\t\t\tif Input.is_action_pressed(\"ui_page_down\"):\n\t\t\t\tcursor_move(Vector3(0,0,-1))\n\t\t\tif Input.is_action_pressed(\"ui_accept\"):\n\t\t\t\tdelete_block()\n\nfunc delete_block():\n\tif not selectedBlock == null:\n\t\tgridMan.remove_block(selectedBlock)\n\tselectedBlock = null\n\nfunc cursor_action():\n\tif not selectedBlock == null:\n\t\tprint(\"CHILDREN:\",gridMan.get_child_count())\n\t\tprint(\"CHILDREN:\",gridMan.get_child_count())\n\t\tdelete_block()\n\t\tselectedBlock = null\n\nfunc add_block():\n\tif gridMan.get_block(cursorPos) != null:\n\t\treturn\n\n\tvar pickled = preload(\"PuzzleManager.gd\").PickledBlock.new()\n\tpickled.blockPos = cursorPos * 2\n\tpickled.name = 300\n\t\n\tpickled.setBlockClass( preload(\"PuzzleManager.gd\").BLOCK_PAIR) \\\n\t\t\t\t\t.setTextureName(\"Red\")\n\t\t\t\t\n\tvar n = pickled.toNode()\n\n\tgridMan.add_block(n)\n\tprint(n.name, gridMan.get_node(n.name))\n\tgridMan.print_tree()\n\tgridMan.get_node(n.name) \\\n\t\t\t.set_translation(pickled.blockPos)\n\n\nfunc _ready():\n\tgridMan = puzzle.get_node(\"GridView\/GridMan\")\n\tcursor = cursorScn.instance()\n\tpuzzle.mainPuzzle = false\n\tpuzzle.time.on = false\n\tpuzzle.set_as_toplevel(true)\n\n\tvar pos = Vector2(10, 10)\n\tfor k in gui.keys():\n\t\tpos.y += 45\n\t\tgui[k].set_theme(preload(\"res:\/\/themes\/MainTheme.thm\"))\n\t\tgui[k].set_text(gui_text[k])\n\t\tgui[k].set_pos(pos)\n\t\tadd_child(gui[k]);\n\tgui.add.connect(\"pressed\", self, \"add_block\")\n\tgui.rm.connect(\"pressed\", self, \"delete_block\")\n\t\n\tgridMan.add_child(cursor)\n\t\n\tadd_child(puzzle)\n\tcursor.set_owner(puzzle)\n\n\tset_process_input(true)\n\n\n","old_contents":"extends Spatial\n\nvar cursorPos = Vector3(1,0,0)\nvar cursor\nvar puzzleMan\nvar puzzle\nvar gridMan\nvar selectedBlock = null\n\nvar gui = {\n\tadd=Button.new(),\n\trm=Button.new(),\n\tsave_pzl=Button.new(),\n\tload_pzl=Button.new()\n}\nvar gui_text = {\n\tadd=\"Add Block\",\n\trm=\"Remove Block\",\n\tsave_pzl=\"Save\",\n\tload_pzl=\"Load\"\n}\n\n\nvar puzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar cursorScn = preload(\"res:\/\/cursor.scn\")\n\nfunc cursor_move(dir):\n\tvar tween = Tween.new()\n\tvar N = 2\n\tadd_child(tween)\n\ttween.interpolate_method( cursor, \"set_global_transform\", \\\n\t\tcursor.get_global_transform(), cursor.get_global_transform().translated(dir * N), \\\n\t\t0.25, Tween.TRANS_EXPO, Tween.EASE_OUT )\n\ttween.start()\n\tcursorPos += dir\n\tselectedBlock = gridMan.get_block(cursorPos)\n\nfunc _input(ev):\n\tif ev.type == InputEvent.KEY:\n\t\tif ev.is_pressed():\n\t\t\tif Input.is_action_pressed(\"ui_up\"):\n\t\t\t\tcursor_move(Vector3(0,1,0))\n\t\t\tif Input.is_action_pressed(\"ui_down\"):\n\t\t\t\tcursor_move(Vector3(0,-1,0))\n\t\t\tif Input.is_action_pressed(\"ui_left\"):\n\t\t\t\tcursor_move(Vector3(1,0,0))\n\t\t\tif Input.is_action_pressed(\"ui_right\"):\n\t\t\t\tcursor_move(Vector3(-1,0,0))\n\t\t\tif Input.is_action_pressed(\"ui_page_up\"):\n\t\t\t\tcursor_move(Vector3(0,0,1))\n\t\t\tif Input.is_action_pressed(\"ui_page_down\"):\n\t\t\t\tcursor_move(Vector3(0,0,-1))\n\t\t\tif Input.is_action_pressed(\"ui_accept\"):\n\t\t\t\tcursor_action()\n\nfunc cursor_action():\n\tif not selectedBlock == null:\n\t\tprint(\"CHILDREN:\",gridMan.get_child_count())\n\t\tgridMan.remove_block(selectedBlock)\n\t\tprint(\"CHILDREN:\",gridMan.get_child_count())\n\n\t\tselectedBlock = null\n\nfunc _ready():\n\tvar pMan = puzzleScn.instance()\n\tgridMan = pMan.get_node(\"GridView\/GridMan\")\n\tcursor = cursorScn.instance()\n\tpMan.mainPuzzle = false\n\tpMan.time.on = false\n\tpuzzleMan = pMan.puzzleMan\n\tpMan.set_as_toplevel(true)\n\n\tvar pos = Vector2(10, 10)\n\tfor k in gui.keys():\n\t\tpos.y += 45\n\t\tgui[k].set_theme(preload(\"res:\/\/themes\/MainTheme.thm\"))\n\t\tgui[k].set_text(gui_text[k])\n\t\tgui[k].set_pos(pos)\n\t\tadd_child(gui[k]);\n\n\tgridMan.add_child(cursor)\n\tadd_child(pMan)\n\tcursor.set_owner(pMan)\n\n\n\n\tset_process_input(true)\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"7203577a4b70c737f1502ecfd19b4138fbb7919d","subject":"Add reponsive section implementation","message":"Add reponsive section implementation\n","repos":"ruipsrosario\/godot-responsive-control","old_file":"source\/addons\/responsive_controls\/ResponsiveSection.gd","new_file":"source\/addons\/responsive_controls\/ResponsiveSection.gd","new_contents":"tool\nextends Control\n\nvar ResponsiveSizing = preload(\"ResponsiveSizing.gd\")\nvar sizingNodes = [ ]\nvar parentControl\n\nfunc _ready():\n\trefreshParent()\n\trefreshSizings()\n\tprocessParentResizing()\n\n# Function to refresh the parentControl with the parent Control node of the current node\n# NOTE - This function should be manually called if this node is either unparented \/ reparented\nfunc refreshParent():\n\tparentControl = get_parent()\n\tif parentControl != null && parentControl extends Control:\n\t\tparentControl.connect(\"resized\", self, \"processParentResizing\")\n\telse:\n\t\tparentControl = null\n\n# Dynamically chooses the Responsive Sizing node that better relates to the current size of the\n# parent Control and applies it\nfunc processParentResizing():\n\tif parentControl != null:\n\t\tvar parentSize = parentControl.get_size()\n\t\tfor sizingNode in sizingNodes:\n\t\t\tif sizingNode.isEligible(parentSize):\n\t\t\t\tsizingNode.applyTo(self)\n\t\t\t\tbreak\n\n# Function to refresh the sizingNodes array with all the Responsive Sizing children\n# NOTE - This function should be manually called if the children of the current node are changed\n# (e.g. add or remove Responsive Sizing children)\nfunc refreshSizings():\n\tsizingNodes.clear()\n\tfor child in get_children():\n\t\tif child extends ResponsiveSizing:\n\t\t\tsizingNodes.append(child)\n\tsizingNodes.sort_custom(self, \"sortSizingNodes\")\n\n# Sorts the Responsive Sizing children nodes from largest to smallest (prioritizing width)\nfunc sortSizingNodes(node1, node2):\n\tvar nodeSize1 = node1.get_size()\n\tvar nodeSize2 = node2.get_size()\n\tif nodeSize1.width != nodeSize2.width:\n\t\treturn nodeSize1.width > nodeSize2.width\n\treturn nodeSize1.height > nodeSize2.height\n","old_contents":"tool\nextends Control\n\nfunc _ready():\n\tpass\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"8f8ae9f0cfe72fed2734a88b1069564637d898af","subject":"comment on \"times_jumped\" variable","message":"comment on \"times_jumped\" variable\n","repos":"AlexHolly\/captain-holetooth,shelltitan\/captain-holetooth,shelltitan\/captain-holetooth,AlexHolly\/captain-holetooth","old_file":"src\/actors\/player\/player.gd","new_file":"src\/actors\/player\/player.gd","new_contents":"\nextends RigidBody2D\n\n# Character Demo, written by Juan Linietsky.\n#\n# Implementation of a 2D Character controller.\n# This implementation uses the physics engine for\n# controlling a character, in a very similar way\n# than a 3D character controller would be implemented.\n#\n# Using the physics engine for this has the main\n# advantages:\n# -Easy to write.\n# -Interaction with other physics-based objects is free\n# -Only have to deal with the object linear velocity, not position\n# -All collision\/area framework available\n# \n# But also has the following disadvantages:\n# \n# -Objects may bounce a little bit sometimes\n# -Going up ramps sends the chracter flying up, small hack is needed.\n# -A ray collider is needed to avoid sliding down on ramps and \n# undesiderd bumps, small steps and rare numerical precision errors.\n# (another alternative may be to turn on friction when the character is not moving).\n# -Friction cant be used, so floor velocity must be considered\n# for moving platforms.\n\n# Member variables\nvar anim = \"\"\nvar siding_left = false\nvar jumping = false\nvar stopping_jump = false\nvar shooting = false\n\nvar WALK_ACCEL = 800.0\nvar WALK_DEACCEL = 800.0\nvar WALK_MAX_VELOCITY = 200.0\nvar AIR_ACCEL = 200.0\nvar AIR_DEACCEL = 200.0\nvar JUMP_VELOCITY = 480\nvar STOP_JUMP_FORCE = 900.0\n\nvar MAX_FLOOR_AIRBORNE_TIME = 0.15\n\nvar airborne_time = 1e20\nvar shoot_time = 1e20\n\nvar MAX_SHOOT_POSE_TIME = 0.3\n\nvar bullet = preload(\"res:\/\/src\/actors\/player\/bullet.tscn\")\n\nvar floor_h_velocity = 0.0\nvar enemy\n\n#func beam_to(spawner):\n\t\n#\tvar spawnerpos = get_node(spawner).get_global_pos()\n#\tprint(\"Beam to active!\")\n#\tself.set_pos(spawnerpos)\n\n\nfunc _integrate_forces(s):\n\tvar lv = s.get_linear_velocity()\n\tvar step = s.get_step()\n\t\n\tvar new_anim = anim\n\tvar new_siding_left = siding_left\n\t\n\t# Get the controls\n\tvar move_left = Input.is_action_pressed(\"move_left\")\n\tvar move_right = Input.is_action_pressed(\"move_right\")\n\tvar jump = Input.is_action_pressed(\"jump\")\n\tvar shoot = Input.is_action_pressed(\"shoot\")\n\tvar spawn = Input.is_action_pressed(\"spawn\")\n\t\n\tif spawn:\n\t\tvar e = enemy.instance()\n\t\tvar p = get_pos()\n\t\tp.y = p.y - 100\n\t\te.set_pos(p)\n\t\tget_parent().add_child(e)\n\t\n\t# Deapply prev floor velocity\n\tlv.x -= floor_h_velocity\n\tfloor_h_velocity = 0.0\n\t\n\t# Find the floor (a contact with upwards facing collision normal)\n\tvar found_floor = false\n\tvar floor_index = -1\n\t\n\tfor x in range(s.get_contact_count()):\n\t\tvar ci = s.get_contact_local_normal(x)\n\t\tif (ci.dot(Vector2(0, -1)) > 0.6):\n\t\t\tfound_floor = true\n\t\t\tfloor_index = x\n\t\n\t# A good idea when impementing characters of all kinds,\n\t# compensates for physics imprecission, as well as human reaction delay.\n\tif (shoot and not shooting):\n\t\tshoot_time = 0\n\t\tvar bi = bullet.instance()\n\t\tvar ss\n\t\tif (siding_left):\n\t\t\tss = -1.0\n\t\telse:\n\t\t\tss = 1.0\n\t\tvar pos = get_pos() + get_node(\"bullet_shoot\").get_pos()*Vector2(ss, 1.0)\n\t\t\n\t\tbi.set_pos(pos)\n\t\tget_parent().add_child(bi)\n\t\t\n\t\tbi.set_linear_velocity(Vector2(800.0*ss, -80))\n\t\tget_node(\"sprite\/smoke\").set_emitting(true)\n\t\tget_node(\"sfx\").play(\"shoot\")\n\t\tPS2D.body_add_collision_exception(bi.get_rid(), get_rid()) # Make bullet and this not collide\n\telse:\n\t\tshoot_time += step\n\t\n\tif (found_floor):\n\t\tairborne_time = 0.0\n\telse:\n\t\tairborne_time += step # Time it spent in the air\n\t\n\tvar on_floor = airborne_time < MAX_FLOOR_AIRBORNE_TIME\n\n\t# Process jump\n\tif (jumping):\n\t\tif (lv.y > 0):\n\t\t\t# Set off the jumping flag if going down\n\t\t\tjumping = false\n\t\t\t\n\t\telif (not jump):\n\t\t\tstopping_jump = true\n\t\t\n\t\tif (stopping_jump):\n\t\t\tlv.y += STOP_JUMP_FORCE*step\n\t\t\t\n\t\t\t\n\t\n\tif (on_floor):\n\t\t# Process logic when character is on floor\n\t\tif (move_left and not move_right):\n\t\t\tif (lv.x > -WALK_MAX_VELOCITY):\n\t\t\t\tlv.x -= WALK_ACCEL*step\n\t\telif (move_right and not move_left):\n\t\t\tif (lv.x < WALK_MAX_VELOCITY):\n\t\t\t\tlv.x += WALK_ACCEL*step\n\t\telse:\n\t\t\tvar xv = abs(lv.x)\n\t\t\txv -= WALK_DEACCEL*step\n\t\t\tif (xv < 0):\n\t\t\t\txv = 0\n\t\t\tlv.x = sign(lv.x)*xv\n\n\t\t\n\t\t# Check jump\n\t\tif (not jumping and jump):\n\t\t\tlv.y = -JUMP_VELOCITY\n\t\t\tjumping = true\n\t\t\tstopping_jump = false\n\t\t\tget_node(\"sfx\").play(\"jump\")\n\t\t\t\n\t\t\t# THIS IS FOR FUTURE USE - Its a statistics thing for players to see like \"Hey you only jumped 20 times during the whole game...\"\n\t\t\t# Whatever use it is, i think its a fun element to talk about :D\n\t\t\t# I don't care often about the \"use\" of things... just having it for fun is good enough ;)\n\t\t\t\n\t\t\tglobal.times_jumped = global.times_jumped +1\n\t\t\tprint(global.times_jumped)\n\t\t\n\t\t# Check siding\n\t\tif (lv.x < 0 and move_left):\n\t\t\tnew_siding_left = true\n\t\telif (lv.x > 0 and move_right):\n\t\t\tnew_siding_left = false\n\t\tif (jumping):\n\t\t\tnew_anim = \"jumping\"\n\t\telif (abs(lv.x) < 0.1):\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"idle_weapon\"\n\t\t\telse:\n\t\t\t\tnew_anim = \"idle\"\n\t\telse:\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"run_weapon\"\n\t\t\telse:\n\t\t\t\tnew_anim = \"run\"\n\telse:\n\t\t# Process logic when the character is in the air\n\t\tif (move_left and not move_right):\n\t\t\tif (lv.x > -WALK_MAX_VELOCITY):\n\t\t\t\tlv.x -= AIR_ACCEL*step\n\t\telif (move_right and not move_left):\n\t\t\tif (lv.x < WALK_MAX_VELOCITY):\n\t\t\t\tlv.x += AIR_ACCEL*step\n\t\telse:\n\t\t\tvar xv = abs(lv.x)\n\t\t\txv -= AIR_DEACCEL*step\n\t\t\tif (xv < 0):\n\t\t\t\txv = 0\n\t\t\tlv.x = sign(lv.x)*xv\n\t\t\n\t\tif (lv.y < 0):\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"jumping_weapon\"\n\t\t\telse:\n\t\t\t\tnew_anim = \"jumping\"\n\t\telse:\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"falling_weapon\"\n\t\t\t\n\t\t\telse:\n\t\t\t\tnew_anim = \"falling\"\n\t\n\t# Update siding\n\tif (new_siding_left != siding_left):\n\t\tif (new_siding_left):\n\t\t\tget_node(\"sprite\").set_scale(Vector2(-1, 1))\n\t\telse:\n\t\t\tget_node(\"sprite\").set_scale(Vector2(1, 1))\n\t\t\n\t\tsiding_left = new_siding_left\n\t\n\t# Change animation\n\tif (new_anim != anim):\n\t\tanim = new_anim\n\t\tget_node(\"anim\").play(anim)\n\t\n\tshooting = shoot\n\t\n\t# Apply floor velocity\n\tif (found_floor):\n\t\tfloor_h_velocity = s.get_contact_collider_velocity_at_pos(floor_index).x\n\t\tlv.x += floor_h_velocity\n\t\n\t# Finally, apply gravity and set back the linear velocity\n\tlv += s.get_total_gravity()*step\n\ts.set_linear_velocity(lv)\n\n\nfunc _ready():\n\tenemy = ResourceLoader.load(\"res:\/\/scenes\/scn3-forest\/enemy.tscn\")\n\n\n#\tif !Globals.has_singleton(\"Facebook\"):\n#\t\treturn\n#\tvar Facebook = Globals.get_singleton(\"Facebook\")\n#\tvar link = Globals.get(\"facebook\/link\")\n#\tvar icon = Globals.get(\"facebook\/icon\")\n#\tvar msg = \"I just sneezed on your wall! Beat my score and Stop the Running nose!\"\n#\tvar title = \"I just sneezed on your wall!\"\n#\tFacebook.post(\"feed\", msg, title, link, icon)\n","old_contents":"\nextends RigidBody2D\n\n# Character Demo, written by Juan Linietsky.\n#\n# Implementation of a 2D Character controller.\n# This implementation uses the physics engine for\n# controlling a character, in a very similar way\n# than a 3D character controller would be implemented.\n#\n# Using the physics engine for this has the main\n# advantages:\n# -Easy to write.\n# -Interaction with other physics-based objects is free\n# -Only have to deal with the object linear velocity, not position\n# -All collision\/area framework available\n# \n# But also has the following disadvantages:\n# \n# -Objects may bounce a little bit sometimes\n# -Going up ramps sends the chracter flying up, small hack is needed.\n# -A ray collider is needed to avoid sliding down on ramps and \n# undesiderd bumps, small steps and rare numerical precision errors.\n# (another alternative may be to turn on friction when the character is not moving).\n# -Friction cant be used, so floor velocity must be considered\n# for moving platforms.\n\n# Member variables\nvar anim = \"\"\nvar siding_left = false\nvar jumping = false\nvar stopping_jump = false\nvar shooting = false\n\nvar WALK_ACCEL = 800.0\nvar WALK_DEACCEL = 800.0\nvar WALK_MAX_VELOCITY = 200.0\nvar AIR_ACCEL = 200.0\nvar AIR_DEACCEL = 200.0\nvar JUMP_VELOCITY = 480\nvar STOP_JUMP_FORCE = 900.0\n\nvar MAX_FLOOR_AIRBORNE_TIME = 0.15\n\nvar airborne_time = 1e20\nvar shoot_time = 1e20\n\nvar MAX_SHOOT_POSE_TIME = 0.3\n\nvar bullet = preload(\"res:\/\/src\/actors\/player\/bullet.tscn\")\n\nvar floor_h_velocity = 0.0\nvar enemy\n\n#func beam_to(spawner):\n\t\n#\tvar spawnerpos = get_node(spawner).get_global_pos()\n#\tprint(\"Beam to active!\")\n#\tself.set_pos(spawnerpos)\n\n\nfunc _integrate_forces(s):\n\tvar lv = s.get_linear_velocity()\n\tvar step = s.get_step()\n\t\n\tvar new_anim = anim\n\tvar new_siding_left = siding_left\n\t\n\t# Get the controls\n\tvar move_left = Input.is_action_pressed(\"move_left\")\n\tvar move_right = Input.is_action_pressed(\"move_right\")\n\tvar jump = Input.is_action_pressed(\"jump\")\n\tvar shoot = Input.is_action_pressed(\"shoot\")\n\tvar spawn = Input.is_action_pressed(\"spawn\")\n\t\n\tif spawn:\n\t\tvar e = enemy.instance()\n\t\tvar p = get_pos()\n\t\tp.y = p.y - 100\n\t\te.set_pos(p)\n\t\tget_parent().add_child(e)\n\t\n\t# Deapply prev floor velocity\n\tlv.x -= floor_h_velocity\n\tfloor_h_velocity = 0.0\n\t\n\t# Find the floor (a contact with upwards facing collision normal)\n\tvar found_floor = false\n\tvar floor_index = -1\n\t\n\tfor x in range(s.get_contact_count()):\n\t\tvar ci = s.get_contact_local_normal(x)\n\t\tif (ci.dot(Vector2(0, -1)) > 0.6):\n\t\t\tfound_floor = true\n\t\t\tfloor_index = x\n\t\n\t# A good idea when impementing characters of all kinds,\n\t# compensates for physics imprecission, as well as human reaction delay.\n\tif (shoot and not shooting):\n\t\tshoot_time = 0\n\t\tvar bi = bullet.instance()\n\t\tvar ss\n\t\tif (siding_left):\n\t\t\tss = -1.0\n\t\telse:\n\t\t\tss = 1.0\n\t\tvar pos = get_pos() + get_node(\"bullet_shoot\").get_pos()*Vector2(ss, 1.0)\n\t\t\n\t\tbi.set_pos(pos)\n\t\tget_parent().add_child(bi)\n\t\t\n\t\tbi.set_linear_velocity(Vector2(800.0*ss, -80))\n\t\tget_node(\"sprite\/smoke\").set_emitting(true)\n\t\tget_node(\"sfx\").play(\"shoot\")\n\t\tPS2D.body_add_collision_exception(bi.get_rid(), get_rid()) # Make bullet and this not collide\n\telse:\n\t\tshoot_time += step\n\t\n\tif (found_floor):\n\t\tairborne_time = 0.0\n\telse:\n\t\tairborne_time += step # Time it spent in the air\n\t\n\tvar on_floor = airborne_time < MAX_FLOOR_AIRBORNE_TIME\n\n\t# Process jump\n\tif (jumping):\n\t\tif (lv.y > 0):\n\t\t\t# Set off the jumping flag if going down\n\t\t\tjumping = false\n\t\t\t\n\t\telif (not jump):\n\t\t\tstopping_jump = true\n\t\t\n\t\tif (stopping_jump):\n\t\t\tlv.y += STOP_JUMP_FORCE*step\n\t\t\t\n\t\t\t\n\t\n\tif (on_floor):\n\t\t# Process logic when character is on floor\n\t\tif (move_left and not move_right):\n\t\t\tif (lv.x > -WALK_MAX_VELOCITY):\n\t\t\t\tlv.x -= WALK_ACCEL*step\n\t\telif (move_right and not move_left):\n\t\t\tif (lv.x < WALK_MAX_VELOCITY):\n\t\t\t\tlv.x += WALK_ACCEL*step\n\t\telse:\n\t\t\tvar xv = abs(lv.x)\n\t\t\txv -= WALK_DEACCEL*step\n\t\t\tif (xv < 0):\n\t\t\t\txv = 0\n\t\t\tlv.x = sign(lv.x)*xv\n\n\t\t\n\t\t# Check jump\n\t\tif (not jumping and jump):\n\t\t\tlv.y = -JUMP_VELOCITY\n\t\t\tjumping = true\n\t\t\tstopping_jump = false\n\t\t\tget_node(\"sfx\").play(\"jump\")\n\t\t\tglobal.times_jumped = global.times_jumped +1\n\t\t\tprint(global.times_jumped)\n\t\t\n\t\t# Check siding\n\t\tif (lv.x < 0 and move_left):\n\t\t\tnew_siding_left = true\n\t\telif (lv.x > 0 and move_right):\n\t\t\tnew_siding_left = false\n\t\tif (jumping):\n\t\t\tnew_anim = \"jumping\"\n\t\telif (abs(lv.x) < 0.1):\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"idle_weapon\"\n\t\t\telse:\n\t\t\t\tnew_anim = \"idle\"\n\t\telse:\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"run_weapon\"\n\t\t\telse:\n\t\t\t\tnew_anim = \"run\"\n\telse:\n\t\t# Process logic when the character is in the air\n\t\tif (move_left and not move_right):\n\t\t\tif (lv.x > -WALK_MAX_VELOCITY):\n\t\t\t\tlv.x -= AIR_ACCEL*step\n\t\telif (move_right and not move_left):\n\t\t\tif (lv.x < WALK_MAX_VELOCITY):\n\t\t\t\tlv.x += AIR_ACCEL*step\n\t\telse:\n\t\t\tvar xv = abs(lv.x)\n\t\t\txv -= AIR_DEACCEL*step\n\t\t\tif (xv < 0):\n\t\t\t\txv = 0\n\t\t\tlv.x = sign(lv.x)*xv\n\t\t\n\t\tif (lv.y < 0):\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"jumping_weapon\"\n\t\t\telse:\n\t\t\t\tnew_anim = \"jumping\"\n\t\telse:\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"falling_weapon\"\n\t\t\t\n\t\t\telse:\n\t\t\t\tnew_anim = \"falling\"\n\t\n\t# Update siding\n\tif (new_siding_left != siding_left):\n\t\tif (new_siding_left):\n\t\t\tget_node(\"sprite\").set_scale(Vector2(-1, 1))\n\t\telse:\n\t\t\tget_node(\"sprite\").set_scale(Vector2(1, 1))\n\t\t\n\t\tsiding_left = new_siding_left\n\t\n\t# Change animation\n\tif (new_anim != anim):\n\t\tanim = new_anim\n\t\tget_node(\"anim\").play(anim)\n\t\n\tshooting = shoot\n\t\n\t# Apply floor velocity\n\tif (found_floor):\n\t\tfloor_h_velocity = s.get_contact_collider_velocity_at_pos(floor_index).x\n\t\tlv.x += floor_h_velocity\n\t\n\t# Finally, apply gravity and set back the linear velocity\n\tlv += s.get_total_gravity()*step\n\ts.set_linear_velocity(lv)\n\n\nfunc _ready():\n\tenemy = ResourceLoader.load(\"res:\/\/scenes\/scn3-forest\/enemy.tscn\")\n\n\n#\tif !Globals.has_singleton(\"Facebook\"):\n#\t\treturn\n#\tvar Facebook = Globals.get_singleton(\"Facebook\")\n#\tvar link = Globals.get(\"facebook\/link\")\n#\tvar icon = Globals.get(\"facebook\/icon\")\n#\tvar msg = \"I just sneezed on your wall! Beat my score and Stop the Running nose!\"\n#\tvar title = \"I just sneezed on your wall!\"\n#\tFacebook.post(\"feed\", msg, title, link, icon)\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"GDScript"} {"commit":"51e34bb5832dbf89349082cd1b80e60201274115","subject":"Fix set window size on startup.","message":"Fix set window size on startup.\n","repos":"h4de5\/spiel4","old_file":"game\/main\/game.gd","new_file":"game\/main\/game.gd","new_contents":"# main node to start game with, holds background, does ship spawing\nextends Node2D\n\nfunc _ready():\n\tprint (\"reset everything - new game\")\n\n\t# set screen width\n\tOS.window_size = Vector2(settings.game['display_width'], settings.game['display_height'])\n\n\t# add camera\n\tvar camera_scn = load(global.scene_path_camera)\n\tvar camera_node = camera_scn.instance()\n\tadd_child(camera_node, true)\n\n\tcall_deferred(\"initialize\")\n\n\n\n\t# when client starts, clear the game\n\tnetwork_manager.connect(\"connected_as_client\", self , \"clear_game\")\n\n\t#get_node(global.scene_tree_game).clear_game()\n\nfunc initialize():\n\tfor i in range(1): spawn_enemy()\n\n\t#for i in range(1): spawn_tower()\n\n\t#for i in range(2): spawn_pickup()\n\n\tfor i in range(2): spawn_object(global.scene_path_asteroid, \"objects\")\n\tfor i in range(4): spawn_object(global.scene_path_comet, \"objects\")\n\n\n\n\t# Background node\n\t# player_manager node\n\n# client > spawn_player(input) > spawn_object > rpc spawn_player(network)\n#\t\t\t\t\t\t\t\t\t\t\t\t server spawn_object > rpc spawn_object\n#\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tclient spawn_object\n\n\nremote func spawn_player(processor, device_details):\n\tprint (\"game > spawn_player > \", processor)\n#\tif get_tree().has_meta(\"network_peer\") and processor == \"Network\" and device_details[0] == get_tree().get_network_unique_id():\n#\t\tprint(\"skip this? processor: \", processor , \" networkid: \", get_tree().get_network_unique_id())\n\n\tvar player_node = spawn_object(global.scene_path_player, \"ships\", \"\", processor != \"Network\")\n\n\tprint (\"playername \", player_node.get_name())\n\n\tplayer_node.get_node(\"processor_selector\").set_processor(processor)\n\tplayer_node.get_node(\"processor_selector\").set_processor_details(device_details)\n\n\n\tif get_tree().has_meta(\"network_peer\"):\n\t\t# only local players are net_work_masters\n\t\tif processor == 'Input':\n\t\t\tvar selfPeerID = get_tree().get_network_unique_id()\n\t\t\t#player_node.set_name(player_node.get_name() +\" \"+ str(selfPeerID))\n\t\t\tplayer_node.set_network_master(selfPeerID) # Will be explained later\n\t\t\tif !get_tree().is_network_server():\n\t\t\t\tprint (\"game > spawn_player > not master!\")\n\t\t\t\trpc(\"spawn_player\", \"Network\", [selfPeerID, player_node.get_name()])\n\t\telif processor == 'Network':\n\t\t\tplayer_node.set_network_master(device_details[0]) # Will be explained later\n\n\treturn player_node\n\nfunc spawn_enemy():\n\treturn spawn_object(global.scene_path_enemy, \"ships\")\n\nfunc spawn_tower():\n\treturn spawn_object(global.scene_path_tower, \"ships\")\n\nfunc spawn_pickup():\n\treturn spawn_object(global.scene_path_pickup, \"objects\")\n\n# spawns an object in to the game\n# can be path or packedScene\nremote func spawn_object(scn, group, name = \"\", propagate = true):\n\tprint (\"spawn_object \", scn, \" in \" , group)\n\tvar scn_instance\n\tvar scn_path\n#\tif not scn is PackedScene:\n\tscn_instance = load(scn)\n\tscn_path = scn\n#\n#\telse:\n#\t\tscn_instance = scn\n#\t\tscn_path = scn.resource_path\n\n\n\tvar node = scn_instance.instance()\n\t# name should only be set, when propagete is false\n\tif name != \"\":\n\t\tnode.set_name(name)\n\tget_node(\"set\/\" + group).add_child(node, true)\n\tnode.scene_path = scn_path\n\n\tif(propagate):\n\t\tif network_manager.is_server():\n\t\t\trpc(\"spawn_object\", scn_path, group, node.get_name())\n\n\treturn node\n\n\nfunc clear_game():\n\tfor group in object_locator.objects_registered:\n\t\tfor i in range(object_locator.objects_registered[group].size()-1, -1, -1):\n\t\t\tvar obj = object_locator.objects_registered[group][i]\n\t\t#for obj in object_locator.objects_registered[group]:\n\t\t\t#var obj = object_locator.objects_registered[group][o]\n\t\t\t#print (\"objects_registered - group: \", group, \" i \", i, \" val \", object_locator.objects_registered[group])\n\t\t\tvar destroyable = interface.is_destroyable(obj)\n\t\t\tobject_locator.free_object(obj)\n\t\t\tif destroyable :\n\t\t\t\tdestroyable.destroy(null, true)\n\t\t\telse:\n\t\t\t\tobj.queue_free()\n\n\n\t# http:\/\/www.gamefromscratch.com\/post\/2015\/02\/23\/Godot-Engine-Tutorial-Part-6-Multiple-Scenes-and-Global-Variables.aspx\n#\n#\tfunc _ready():\n#\t #On load set the current scene to the last scene available\n#\t currentScene = get_tree().get_root().get_child(get_tree().get_root().get_child_count() -1)\n#\t #Demonstrate setting a global variable.\n#\t Globals.set(\"MAX_POWER_LEVEL\",9000)\n#\n#\t# create a function to switch between scenes\n#\tfunc setScene(scene):\n#\t #clean up the current scene\n#\t currentScene.queue_free()\n#\t #load the file passed in as the param \"scene\"\n#\t var s = ResourceLoader.load(scene)\n#\t #create an instance of our scene\n#\t currentScene = s.instance()\n#\t # add scene to root\n#\t get_tree().get_root().add_child(currentScene)\n#","old_contents":"# main node to start game with, holds background, does ship spawing\nextends Node2D\n\nfunc _ready():\n\tprint (\"reset everything - new game\")\n\n\t# set screen width\n\t# this is strange\n\t# get_tree().get_root().size = Vector2(settings.game['display_width'], settings.game['display_height'])\n\n\t# add camera\n\tvar camera_scn = load(global.scene_path_camera)\n\tvar camera_node = camera_scn.instance()\n\tadd_child(camera_node, true)\n\n\tcall_deferred(\"initialize\")\n\n\n\n\t# when client starts, clear the game\n\tnetwork_manager.connect(\"connected_as_client\", self , \"clear_game\")\n\n\t#get_node(global.scene_tree_game).clear_game()\n\nfunc initialize():\n\tfor i in range(1): spawn_enemy()\n\n\t#for i in range(1): spawn_tower()\n\n\t#for i in range(2): spawn_pickup()\n\n\tfor i in range(2): spawn_object(global.scene_path_asteroid, \"objects\")\n\tfor i in range(4): spawn_object(global.scene_path_comet, \"objects\")\n\n\n\n\t# Background node\n\t# player_manager node\n\n# client > spawn_player(input) > spawn_object > rpc spawn_player(network)\n#\t\t\t\t\t\t\t\t\t\t\t\t server spawn_object > rpc spawn_object\n#\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tclient spawn_object\n\n\nremote func spawn_player(processor, device_details):\n\tprint (\"game > spawn_player > \", processor)\n#\tif get_tree().has_meta(\"network_peer\") and processor == \"Network\" and device_details[0] == get_tree().get_network_unique_id():\n#\t\tprint(\"skip this? processor: \", processor , \" networkid: \", get_tree().get_network_unique_id())\n\n\tvar player_node = spawn_object(global.scene_path_player, \"ships\", \"\", processor != \"Network\")\n\n\tprint (\"playername \", player_node.get_name())\n\n\tplayer_node.get_node(\"processor_selector\").set_processor(processor)\n\tplayer_node.get_node(\"processor_selector\").set_processor_details(device_details)\n\n\n\tif get_tree().has_meta(\"network_peer\"):\n\t\t# only local players are net_work_masters\n\t\tif processor == 'Input':\n\t\t\tvar selfPeerID = get_tree().get_network_unique_id()\n\t\t\t#player_node.set_name(player_node.get_name() +\" \"+ str(selfPeerID))\n\t\t\tplayer_node.set_network_master(selfPeerID) # Will be explained later\n\t\t\tif !get_tree().is_network_server():\n\t\t\t\tprint (\"game > spawn_player > not master!\")\n\t\t\t\trpc(\"spawn_player\", \"Network\", [selfPeerID, player_node.get_name()])\n\t\telif processor == 'Network':\n\t\t\tplayer_node.set_network_master(device_details[0]) # Will be explained later\n\n\treturn player_node\n\nfunc spawn_enemy():\n\treturn spawn_object(global.scene_path_enemy, \"ships\")\n\nfunc spawn_tower():\n\treturn spawn_object(global.scene_path_tower, \"ships\")\n\nfunc spawn_pickup():\n\treturn spawn_object(global.scene_path_pickup, \"objects\")\n\n# spawns an object in to the game\n# can be path or packedScene\nremote func spawn_object(scn, group, name = \"\", propagate = true):\n\tprint (\"spawn_object \", scn, \" in \" , group)\n\tvar scn_instance\n\tvar scn_path\n#\tif not scn is PackedScene:\n\tscn_instance = load(scn)\n\tscn_path = scn\n#\n#\telse:\n#\t\tscn_instance = scn\n#\t\tscn_path = scn.resource_path\n\n\n\tvar node = scn_instance.instance()\n\t# name should only be set, when propagete is false\n\tif name != \"\":\n\t\tnode.set_name(name)\n\tget_node(\"set\/\" + group).add_child(node, true)\n\tnode.scene_path = scn_path\n\n\tif(propagate):\n\t\tif network_manager.is_server():\n\t\t\trpc(\"spawn_object\", scn_path, group, node.get_name())\n\n\treturn node\n\n\nfunc clear_game():\n\tfor group in object_locator.objects_registered:\n\t\tfor i in range(object_locator.objects_registered[group].size()-1, -1, -1):\n\t\t\tvar obj = object_locator.objects_registered[group][i]\n\t\t#for obj in object_locator.objects_registered[group]:\n\t\t\t#var obj = object_locator.objects_registered[group][o]\n\t\t\t#print (\"objects_registered - group: \", group, \" i \", i, \" val \", object_locator.objects_registered[group])\n\t\t\tvar destroyable = interface.is_destroyable(obj)\n\t\t\tobject_locator.free_object(obj)\n\t\t\tif destroyable :\n\t\t\t\tdestroyable.destroy(null, true)\n\t\t\telse:\n\t\t\t\tobj.queue_free()\n\n\n\t# http:\/\/www.gamefromscratch.com\/post\/2015\/02\/23\/Godot-Engine-Tutorial-Part-6-Multiple-Scenes-and-Global-Variables.aspx\n#\n#\tfunc _ready():\n#\t #On load set the current scene to the last scene available\n#\t currentScene = get_tree().get_root().get_child(get_tree().get_root().get_child_count() -1)\n#\t #Demonstrate setting a global variable.\n#\t Globals.set(\"MAX_POWER_LEVEL\",9000)\n#\n#\t# create a function to switch between scenes\n#\tfunc setScene(scene):\n#\t #clean up the current scene\n#\t currentScene.queue_free()\n#\t #load the file passed in as the param \"scene\"\n#\t var s = ResourceLoader.load(scene)\n#\t #create an instance of our scene\n#\t currentScene = s.instance()\n#\t # add scene to root\n#\t get_tree().get_root().add_child(currentScene)\n#","returncode":0,"stderr":"","license":"apache-2.0","lang":"GDScript"} {"commit":"d09ef51edc25b4ef4d7692dfb28b0c60ac98f3af","subject":"Decreased level exit detection range","message":"Decreased level exit detection range\n","repos":"P1X-in\/rat-is-fat","old_file":"scripts\/player.gd","new_file":"scripts\/player.gd","new_contents":"extends \"res:\/\/scripts\/moving_object.gd\"\n\nvar player_id\nvar is_playing = false\nvar is_alive = true\nvar attack_range = 100\nvar attack_width = PI * 0.33\nvar attack_strength = 1\nvar attack_cooldown = 0.4\nvar is_attack_on_cooldown = false\nvar is_attacking = false\nvar blast\n\nvar target_cone\nvar target_cone_vector = [0, 0]\nvar target_cone_angle = 0.0\n\nvar panel\nvar hp_cap = 16\nvar attack_move_velocity = 20\nvar normal_velocity = 200\n\nvar EXIT_THRESHOLD = 35\nvar LEVEL_EXIT_THRESHOLD = 8\n\nfunc _init(bag, player_id).(bag):\n self.bag = bag\n self.player_id = player_id\n self.velocity = 200\n self.attack_move_velocity = 20\n self.normal_velocity = 200\n self.hp = 10\n self.max_hp = 10\n self.score = 0\n self.hit_protection = true\n self.invulnerability_period = 1\n self.avatar = preload(\"res:\/\/scenes\/player\/player.xscn\").instance()\n self.body_part_head = self.avatar.get_node('head')\n self.hat = self.body_part_head.get_node('hat')\n self.body_part_body = self.avatar.get_node('body')\n self.body_part_footer = self.avatar.get_node('footer')\n self.target_cone = self.avatar.get_node('attack_cone')\n self.animations = self.avatar.get_node('body_animations')\n self.hit_particles = self.avatar.get_node('hitparticles')\n self.blast = self.avatar.get_node('blast_animations')\n\n if not self.bag.input.arcade:\n self.bind_gamepad(player_id)\n else:\n self.bind_arcade(player_id)\n self.panel = self.bag.hud.bind_player_panel(player_id)\n self.hat.set_frame(player_id)\n self.update_bars()\n\n self.sounds['hit'] = 'player_hit'\n self.sounds['die'] = 'player_die'\n self.sounds['attack1'] = 'player_attack1'\n self.sounds['attack2'] = 'player_attack2'\n\nfunc bind_arcade(player):\n var arcade = self.bag.input.devices['arcade']\n if player == 0:\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_enter_game_arcade.gd\").new(self.bag, self, 14))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_enter_game_arcade.gd\").new(self.bag, self, 0))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_arcade.gd\").new(self.bag, self, 1, 13, -1))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_arcade.gd\").new(self.bag, self, 1, 12, 1))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_arcade.gd\").new(self.bag, self, 0, 11, -1))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_arcade.gd\").new(self.bag, self, 0, 10, 1))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_arcade.gd\").new(self.bag, self, 1, 13, -1))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_arcade.gd\").new(self.bag, self, 1, 12, 1))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_arcade.gd\").new(self.bag, self, 0, 11, -1))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_arcade.gd\").new(self.bag, self, 0, 10, 1))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_arcade.gd\").new(self.bag, self, 15))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_arcade.gd\").new(self.bag, self, 16))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_arcade.gd\").new(self.bag, self, 17))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_arcade.gd\").new(self.bag, self, 18))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_arcade.gd\").new(self.bag, self, 19))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_arcade.gd\").new(self.bag, self, 20))\n else:\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_enter_game_arcade.gd\").new(self.bag, self, 0))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_axis_arcade.gd\").new(self.bag, self, 0, 0))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_axis_arcade.gd\").new(self.bag, self, 1, 1))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_axis_arcade.gd\").new(self.bag, self, 0, 0))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_axis_arcade.gd\").new(self.bag, self, 1, 1))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_arcade.gd\").new(self.bag, self, 1))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_arcade.gd\").new(self.bag, self, 2))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_arcade.gd\").new(self.bag, self, 3))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_arcade.gd\").new(self.bag, self, 4))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_arcade.gd\").new(self.bag, self, 5))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_arcade.gd\").new(self.bag, self, 6))\n\nfunc bind_gamepad(id):\n var gamepad = self.bag.input.devices['pad' + str(id)]\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_enter_game_gamepad.gd\").new(self.bag, self))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_axis.gd\").new(self.bag, self, 0))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_axis.gd\").new(self.bag, self, 1))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_gamepad.gd\").new(self.bag, self, Globals.get(\"platform_input\/xbox_right_stick_x\"), 0))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_gamepad.gd\").new(self.bag, self, Globals.get(\"platform_input\/xbox_right_stick_y\"), 1))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_gamepad.gd\").new(self.bag, self))\n\nfunc bind_keyboard_and_mouse():\n var keyboard = self.bag.input.devices['keyboard']\n var mouse = self.bag.input.devices['mouse']\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_enter_game_keyboard.gd\").new(self.bag, self))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 1, KEY_W, -1))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 1, KEY_S, 1))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 0, KEY_A, -1))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 0, KEY_D, 1))\n mouse.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_mouse.gd\").new(self.bag, self))\n mouse.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_mouse.gd\").new(self.bag, self))\n\nfunc enter_game():\n self.is_playing = true\n self.spawn(self.bag.room_loader.get_spawn_position('initial' + str(self.player_id)))\n self.panel.show()\n\nfunc spawn(position):\n self.is_alive = true\n .spawn(position)\n\nfunc die():\n self.is_alive = false\n self.panel.hide()\n .die()\n if not self.bag.players.is_living_player_in_game():\n self.bag.sample_player.play('game_over')\n self.bag.action_controller.end_game()\n\nfunc remove_from_game():\n self.panel.hide()\n self.is_processing = false\n self.despawn()\n self.reset()\n\n\nfunc process(delta):\n self.adjust_attack_cone()\n .process(delta)\n self.check_doors()\n self.handle_items()\n self.process_attack()\n\nfunc process_attack():\n if self.is_attacking && not self.is_attack_on_cooldown:\n self.velocity = self.attack_move_velocity\n self.attack()\n\nfunc modify_position(delta):\n .modify_position(delta)\n self.flip(self.target_cone_vector[0])\n self.handle_animations()\n\nfunc handle_animations():\n if not self.animations.is_playing():\n if abs(self.movement_vector[0]) > self.AXIS_THRESHOLD || abs(self.movement_vector[1]) > self.AXIS_THRESHOLD:\n self.animations.play('run')\n else:\n self.animations.play('idle')\n else:\n if self.animations.get_current_animation() == 'idle' && (abs(self.movement_vector[0]) > self.AXIS_THRESHOLD || abs(self.movement_vector[1]) > self.AXIS_THRESHOLD):\n self.animations.play('run')\n elif self.animations.get_current_animation() == 'run' && abs(self.movement_vector[0]) < self.AXIS_THRESHOLD && abs(self.movement_vector[1]) < self.AXIS_THRESHOLD:\n self.animations.play('idle')\n\nfunc respawn():\n if self.is_alive || not self.is_playing:\n return\n self.panel.reset()\n self.reset()\n self.enter_game()\n\n\nfunc handle_items():\n var items = self.bag.items.get_items_near_object(self)\n for item in items:\n if item.power_up_type == 0:\n self.get_fat(item.power_up_amount)\n else:\n self.get_power(item.power_up_amount)\n self.score = self.score + item.score\n item.pick()\n self.update_bars()\n\n\nfunc adjust_attack_cone():\n #if abs(self.target_cone_vector[0]) < self.AXIS_THRESHOLD || abs(self.target_cone_vector[1]) < self.AXIS_THRESHOLD:\n # return\n if self.target_cone_vector[0] == 0 && self.target_cone_vector[1] == 0:\n self.target_cone.hide()\n return\n\n self.target_cone.show()\n\n self.target_cone_angle = -atan2(self.target_cone_vector[1], self.target_cone_vector[0]) - PI\/2\n self.target_cone.set_rot(self.target_cone_angle)\n\nfunc attack():\n if self.is_attack_on_cooldown:\n return\n\n var enemies\n var random_attack = 'attack'+ str(1 + randi() % 2)\n\n self.is_attack_on_cooldown = true\n\n if not self.animations.get_current_animation() == 'attack1' and not self.animations.get_current_animation() == 'attack2' :\n self.animations.play(random_attack)\n self.play_sound(random_attack)\n self.blast.play('blast')\n elif not self.animations.is_playing():\n if self.animations.get_current_animation() == 'attack1':\n self.animations.play('attack2')\n self.play_sound('attack2')\n else:\n self.animations.play('attack1')\n self.play_sound('attack1')\n self.blast.play('blast')\n\n enemies = self.bag.enemies.get_enemies_near_object(self, self.attack_range, self.target_cone_vector, self.attack_width)\n for enemy in enemies:\n if enemy.will_die(self.attack_strength):\n self.score += enemy.score\n self.update_bars()\n\n enemy.recieve_damage(self.attack_strength)\n enemy.push_back(self)\n self.bag.timers.set_timeout(self.attack_cooldown, self, \"attack_cooled_down\")\n\nfunc get_power(amount):\n self.get_pure_power(amount)\n\n self.hp -= amount\n self.max_hp -= amount\n self.update_bars()\n if self.hp <= 0:\n self.die()\n\nfunc get_pure_power(amount):\n self.attack_strength += amount\n if self.attack_strength >= 16:\n self.attack_strength = 16\n self.update_bars()\n\nfunc get_fat(amount):\n self.hp += amount\n self.max_hp += amount\n if self.max_hp > self.hp_cap:\n self.max_hp = self.hp_cap\n if self.hp > self.max_hp:\n self.hp = self.max_hp\n self.update_bars()\n\nfunc check_colisions():\n return\n\nfunc check_doors():\n if not self.bag.game_state.doors_open:\n return;\n\n var door_coords\n var new_coords = [0, 0]\n var cell = self.bag.game_state.current_cell\n if cell.north != null:\n door_coords = self.bag.room_loader.door_definitions['north'][1]\n new_coords[0] = door_coords[0] + 8 + self.bag.room_loader.side_offset\n new_coords[1] = door_coords[1] + 0 + self.bag.room_loader.top_offset\n if self.check_exit(new_coords, cell.north, Vector2(26, -15)):\n self.bag.players.move_to_entry_position('south')\n return\n if cell.south != null:\n door_coords = self.bag.room_loader.door_definitions['south'][1]\n new_coords[0] = door_coords[0] + 8 + self.bag.room_loader.side_offset\n new_coords[1] = door_coords[1] + 9 + self.bag.room_loader.top_offset\n if self.check_exit(new_coords, cell.south, Vector2(26, 40)):\n self.bag.players.move_to_entry_position('north')\n return\n if cell.east != null:\n door_coords = self.bag.room_loader.door_definitions['east'][1]\n new_coords[0] = door_coords[0] + 19 + self.bag.room_loader.side_offset\n new_coords[1] = door_coords[1] + 4 + self.bag.room_loader.top_offset\n if self.check_exit(new_coords, cell.east, Vector2(40, 0)):\n self.bag.players.move_to_entry_position('west')\n return\n if cell.west != null:\n door_coords = self.bag.room_loader.door_definitions['west'][1]\n new_coords[0] = door_coords[0] + 0 + self.bag.room_loader.side_offset\n new_coords[1] = door_coords[1] + 4 + self.bag.room_loader.top_offset\n if self.check_exit(new_coords, cell.west, Vector2(-10, 0)):\n self.bag.players.move_to_entry_position('east')\n return\n\n self.check_level_exit()\n\nfunc check_exit(door_coords, cell, door_offset):\n var exit_area = self.bag.room_loader.translate_position(Vector2(door_coords[0] + self.bag.room_loader.side_offset, door_coords[1]))\n exit_area = exit_area + door_offset\n var distance = self.calculate_distance(exit_area)\n if distance < self.EXIT_THRESHOLD:\n self.bag.map.switch_to_cell(cell)\n return true\n return false\n\nfunc check_level_exit():\n var exit_area\n var distance\n for exit in self.bag.game_state.current_room.exits:\n exit_area = self.bag.room_loader.translate_position(Vector2(exit[0] + self.bag.room_loader.side_offset, exit[1] + self.bag.room_loader.top_offset))\n distance = self.calculate_distance(exit_area)\n if distance < self.LEVEL_EXIT_THRESHOLD:\n self.bag.action_controller.next_level(exit[2])\n\nfunc move_to_entry_position(name):\n var entry_position_id = self.bag.players.get_first_free_entry_position_num(self.player_id)\n var entry_position\n entry_position = self.bag.room_loader.get_spawn_position(name + str(entry_position_id))\n self.avatar.set_pos(entry_position)\n\nfunc update_bars():\n self.panel.update_bar(self.panel.fat_bar, self.hp - 1, 0)\n self.panel.update_bar(self.panel.power_bar, self.attack_strength - 1, 3)\n self.panel.update_points(self.score)\n\nfunc set_hp(hp):\n .set_hp(hp)\n self.update_bars()\n\nfunc recieve_damage(damage):\n if self.is_invulnerable:\n return\n\n self.bag.camera.shake()\n .recieve_damage(damage)\n\nfunc reset():\n self.attack_strength = 1\n self.hp = 10\n self.max_hp = 10\n self.target_cone_vector = [0, 0]\n self.target_cone_angle = 0.0\n self.is_playing = false\n self.is_alive = true\n self.movement_vector = [0, 0]\n self.score = 0\n self.is_attack_on_cooldown = false\n self.is_attacking = false\n self.update_bars()\n\nfunc attack_cooled_down():\n self.is_attack_on_cooldown = false\n self.velocity = self.normal_velocity\n","old_contents":"extends \"res:\/\/scripts\/moving_object.gd\"\n\nvar player_id\nvar is_playing = false\nvar is_alive = true\nvar attack_range = 100\nvar attack_width = PI * 0.33\nvar attack_strength = 1\nvar attack_cooldown = 0.4\nvar is_attack_on_cooldown = false\nvar is_attacking = false\nvar blast\n\nvar target_cone\nvar target_cone_vector = [0, 0]\nvar target_cone_angle = 0.0\n\nvar panel\nvar hp_cap = 16\nvar attack_move_velocity = 20\nvar normal_velocity = 200\n\nvar EXIT_THRESHOLD = 35\n\nfunc _init(bag, player_id).(bag):\n self.bag = bag\n self.player_id = player_id\n self.velocity = 200\n self.attack_move_velocity = 20\n self.normal_velocity = 200\n self.hp = 10\n self.max_hp = 10\n self.score = 0\n self.hit_protection = true\n self.invulnerability_period = 1\n self.avatar = preload(\"res:\/\/scenes\/player\/player.xscn\").instance()\n self.body_part_head = self.avatar.get_node('head')\n self.hat = self.body_part_head.get_node('hat')\n self.body_part_body = self.avatar.get_node('body')\n self.body_part_footer = self.avatar.get_node('footer')\n self.target_cone = self.avatar.get_node('attack_cone')\n self.animations = self.avatar.get_node('body_animations')\n self.hit_particles = self.avatar.get_node('hitparticles')\n self.blast = self.avatar.get_node('blast_animations')\n\n if not self.bag.input.arcade:\n self.bind_gamepad(player_id)\n else:\n self.bind_arcade(player_id)\n self.panel = self.bag.hud.bind_player_panel(player_id)\n self.hat.set_frame(player_id)\n self.update_bars()\n\n self.sounds['hit'] = 'player_hit'\n self.sounds['die'] = 'player_die'\n self.sounds['attack1'] = 'player_attack1'\n self.sounds['attack2'] = 'player_attack2'\n\nfunc bind_arcade(player):\n var arcade = self.bag.input.devices['arcade']\n if player == 0:\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_enter_game_arcade.gd\").new(self.bag, self, 14))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_enter_game_arcade.gd\").new(self.bag, self, 0))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_arcade.gd\").new(self.bag, self, 1, 13, -1))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_arcade.gd\").new(self.bag, self, 1, 12, 1))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_arcade.gd\").new(self.bag, self, 0, 11, -1))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_arcade.gd\").new(self.bag, self, 0, 10, 1))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_arcade.gd\").new(self.bag, self, 1, 13, -1))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_arcade.gd\").new(self.bag, self, 1, 12, 1))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_arcade.gd\").new(self.bag, self, 0, 11, -1))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_arcade.gd\").new(self.bag, self, 0, 10, 1))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_arcade.gd\").new(self.bag, self, 15))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_arcade.gd\").new(self.bag, self, 16))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_arcade.gd\").new(self.bag, self, 17))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_arcade.gd\").new(self.bag, self, 18))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_arcade.gd\").new(self.bag, self, 19))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_arcade.gd\").new(self.bag, self, 20))\n else:\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_enter_game_arcade.gd\").new(self.bag, self, 0))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_axis_arcade.gd\").new(self.bag, self, 0, 0))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_axis_arcade.gd\").new(self.bag, self, 1, 1))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_axis_arcade.gd\").new(self.bag, self, 0, 0))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_axis_arcade.gd\").new(self.bag, self, 1, 1))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_arcade.gd\").new(self.bag, self, 1))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_arcade.gd\").new(self.bag, self, 2))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_arcade.gd\").new(self.bag, self, 3))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_arcade.gd\").new(self.bag, self, 4))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_arcade.gd\").new(self.bag, self, 5))\n arcade.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_arcade.gd\").new(self.bag, self, 6))\n\nfunc bind_gamepad(id):\n var gamepad = self.bag.input.devices['pad' + str(id)]\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_enter_game_gamepad.gd\").new(self.bag, self))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_axis.gd\").new(self.bag, self, 0))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_axis.gd\").new(self.bag, self, 1))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_gamepad.gd\").new(self.bag, self, Globals.get(\"platform_input\/xbox_right_stick_x\"), 0))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_gamepad.gd\").new(self.bag, self, Globals.get(\"platform_input\/xbox_right_stick_y\"), 1))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_gamepad.gd\").new(self.bag, self))\n\nfunc bind_keyboard_and_mouse():\n var keyboard = self.bag.input.devices['keyboard']\n var mouse = self.bag.input.devices['mouse']\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_enter_game_keyboard.gd\").new(self.bag, self))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 1, KEY_W, -1))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 1, KEY_S, 1))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 0, KEY_A, -1))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 0, KEY_D, 1))\n mouse.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_mouse.gd\").new(self.bag, self))\n mouse.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_mouse.gd\").new(self.bag, self))\n\nfunc enter_game():\n self.is_playing = true\n self.spawn(self.bag.room_loader.get_spawn_position('initial' + str(self.player_id)))\n self.panel.show()\n\nfunc spawn(position):\n self.is_alive = true\n .spawn(position)\n\nfunc die():\n self.is_alive = false\n self.panel.hide()\n .die()\n if not self.bag.players.is_living_player_in_game():\n self.bag.sample_player.play('game_over')\n self.bag.action_controller.end_game()\n\nfunc remove_from_game():\n self.panel.hide()\n self.is_processing = false\n self.despawn()\n self.reset()\n\n\nfunc process(delta):\n self.adjust_attack_cone()\n .process(delta)\n self.check_doors()\n self.handle_items()\n self.process_attack()\n\nfunc process_attack():\n if self.is_attacking && not self.is_attack_on_cooldown:\n self.velocity = self.attack_move_velocity\n self.attack()\n\nfunc modify_position(delta):\n .modify_position(delta)\n self.flip(self.target_cone_vector[0])\n self.handle_animations()\n\nfunc handle_animations():\n if not self.animations.is_playing():\n if abs(self.movement_vector[0]) > self.AXIS_THRESHOLD || abs(self.movement_vector[1]) > self.AXIS_THRESHOLD:\n self.animations.play('run')\n else:\n self.animations.play('idle')\n else:\n if self.animations.get_current_animation() == 'idle' && (abs(self.movement_vector[0]) > self.AXIS_THRESHOLD || abs(self.movement_vector[1]) > self.AXIS_THRESHOLD):\n self.animations.play('run')\n elif self.animations.get_current_animation() == 'run' && abs(self.movement_vector[0]) < self.AXIS_THRESHOLD && abs(self.movement_vector[1]) < self.AXIS_THRESHOLD:\n self.animations.play('idle')\n\nfunc respawn():\n if self.is_alive || not self.is_playing:\n return\n self.panel.reset()\n self.reset()\n self.enter_game()\n\n\nfunc handle_items():\n var items = self.bag.items.get_items_near_object(self)\n for item in items:\n if item.power_up_type == 0:\n self.get_fat(item.power_up_amount)\n else:\n self.get_power(item.power_up_amount)\n self.score = self.score + item.score\n item.pick()\n self.update_bars()\n\n\nfunc adjust_attack_cone():\n #if abs(self.target_cone_vector[0]) < self.AXIS_THRESHOLD || abs(self.target_cone_vector[1]) < self.AXIS_THRESHOLD:\n # return\n if self.target_cone_vector[0] == 0 && self.target_cone_vector[1] == 0:\n self.target_cone.hide()\n return\n\n self.target_cone.show()\n\n self.target_cone_angle = -atan2(self.target_cone_vector[1], self.target_cone_vector[0]) - PI\/2\n self.target_cone.set_rot(self.target_cone_angle)\n\nfunc attack():\n if self.is_attack_on_cooldown:\n return\n\n var enemies\n var random_attack = 'attack'+ str(1 + randi() % 2)\n\n self.is_attack_on_cooldown = true\n\n if not self.animations.get_current_animation() == 'attack1' and not self.animations.get_current_animation() == 'attack2' :\n self.animations.play(random_attack)\n self.play_sound(random_attack)\n self.blast.play('blast')\n elif not self.animations.is_playing():\n if self.animations.get_current_animation() == 'attack1':\n self.animations.play('attack2')\n self.play_sound('attack2')\n else:\n self.animations.play('attack1')\n self.play_sound('attack1')\n self.blast.play('blast')\n\n enemies = self.bag.enemies.get_enemies_near_object(self, self.attack_range, self.target_cone_vector, self.attack_width)\n for enemy in enemies:\n if enemy.will_die(self.attack_strength):\n self.score += enemy.score\n self.update_bars()\n\n enemy.recieve_damage(self.attack_strength)\n enemy.push_back(self)\n self.bag.timers.set_timeout(self.attack_cooldown, self, \"attack_cooled_down\")\n\nfunc get_power(amount):\n self.get_pure_power(amount)\n\n self.hp -= amount\n self.max_hp -= amount\n self.update_bars()\n if self.hp <= 0:\n self.die()\n\nfunc get_pure_power(amount):\n self.attack_strength += amount\n if self.attack_strength >= 16:\n self.attack_strength = 16\n self.update_bars()\n\nfunc get_fat(amount):\n self.hp += amount\n self.max_hp += amount\n if self.max_hp > self.hp_cap:\n self.max_hp = self.hp_cap\n if self.hp > self.max_hp:\n self.hp = self.max_hp\n self.update_bars()\n\nfunc check_colisions():\n return\n\nfunc check_doors():\n if not self.bag.game_state.doors_open:\n return;\n\n var door_coords\n var new_coords = [0, 0]\n var cell = self.bag.game_state.current_cell\n if cell.north != null:\n door_coords = self.bag.room_loader.door_definitions['north'][1]\n new_coords[0] = door_coords[0] + 8 + self.bag.room_loader.side_offset\n new_coords[1] = door_coords[1] + 0 + self.bag.room_loader.top_offset\n if self.check_exit(new_coords, cell.north, Vector2(26, -15)):\n self.bag.players.move_to_entry_position('south')\n return\n if cell.south != null:\n door_coords = self.bag.room_loader.door_definitions['south'][1]\n new_coords[0] = door_coords[0] + 8 + self.bag.room_loader.side_offset\n new_coords[1] = door_coords[1] + 9 + self.bag.room_loader.top_offset\n if self.check_exit(new_coords, cell.south, Vector2(26, 40)):\n self.bag.players.move_to_entry_position('north')\n return\n if cell.east != null:\n door_coords = self.bag.room_loader.door_definitions['east'][1]\n new_coords[0] = door_coords[0] + 19 + self.bag.room_loader.side_offset\n new_coords[1] = door_coords[1] + 4 + self.bag.room_loader.top_offset\n if self.check_exit(new_coords, cell.east, Vector2(40, 0)):\n self.bag.players.move_to_entry_position('west')\n return\n if cell.west != null:\n door_coords = self.bag.room_loader.door_definitions['west'][1]\n new_coords[0] = door_coords[0] + 0 + self.bag.room_loader.side_offset\n new_coords[1] = door_coords[1] + 4 + self.bag.room_loader.top_offset\n if self.check_exit(new_coords, cell.west, Vector2(-10, 0)):\n self.bag.players.move_to_entry_position('east')\n return\n\n self.check_level_exit()\n\nfunc check_exit(door_coords, cell, door_offset):\n var exit_area = self.bag.room_loader.translate_position(Vector2(door_coords[0] + self.bag.room_loader.side_offset, door_coords[1]))\n exit_area = exit_area + door_offset\n var distance = self.calculate_distance(exit_area)\n if distance < self.EXIT_THRESHOLD:\n self.bag.map.switch_to_cell(cell)\n return true\n return false\n\nfunc check_level_exit():\n var exit_area\n var distance\n for exit in self.bag.game_state.current_room.exits:\n exit_area = self.bag.room_loader.translate_position(Vector2(exit[0] + self.bag.room_loader.side_offset, exit[1] + self.bag.room_loader.top_offset))\n distance = self.calculate_distance(exit_area)\n if distance < self.EXIT_THRESHOLD:\n self.bag.action_controller.next_level(exit[2])\n\nfunc move_to_entry_position(name):\n var entry_position_id = self.bag.players.get_first_free_entry_position_num(self.player_id)\n var entry_position\n entry_position = self.bag.room_loader.get_spawn_position(name + str(entry_position_id))\n self.avatar.set_pos(entry_position)\n\nfunc update_bars():\n self.panel.update_bar(self.panel.fat_bar, self.hp - 1, 0)\n self.panel.update_bar(self.panel.power_bar, self.attack_strength - 1, 3)\n self.panel.update_points(self.score)\n\nfunc set_hp(hp):\n .set_hp(hp)\n self.update_bars()\n\nfunc recieve_damage(damage):\n if self.is_invulnerable:\n return\n\n self.bag.camera.shake()\n .recieve_damage(damage)\n\nfunc reset():\n self.attack_strength = 1\n self.hp = 10\n self.max_hp = 10\n self.target_cone_vector = [0, 0]\n self.target_cone_angle = 0.0\n self.is_playing = false\n self.is_alive = true\n self.movement_vector = [0, 0]\n self.score = 0\n self.is_attack_on_cooldown = false\n self.is_attacking = false\n self.update_bars()\n\nfunc attack_cooled_down():\n self.is_attack_on_cooldown = false\n self.velocity = self.normal_velocity\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"4766fc8c7458fded1947e104065b627b60d1a1d7","subject":"better layout","message":"better layout\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Editor.gd","new_file":"src\/scripts\/Editor.gd","new_contents":"extends Spatial\n\nconst NO_ERRORS = \"STATUS NOMINAL\"\n\nvar puzzle\nvar puzzleMan\nvar DataMan = preload(\"res:\/\/scripts\/DataManager.gd\")\n\nvar gridMan\nvar prevBlocks = [] # keeps track of prevous color for pairs by layer\nvar blockColors = preload(\"res:\/\/scripts\/PuzzleManager.gd\").blockColors\nvar id\n\nvar saveDir = OS.get_data_dir() + \"\/PuzzleSaves\"\n\nvar glyphIx = 0\n\nvar fd\nvar gui = [\n\t[\"save_pzl\", Button.new()],\n\t[\"load_pzl\", Button.new()],\n\t[\"remove_layer\", Button.new()],\n\t[\"random_layer\", Button.new()],\n\t[\"class_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=[\"WILD\", \"PAIR\"],\n\t\t# const BLOCK_LASER\t= 0\n\t\t# const BLOCK_WILD\t= 1\n\t\t# const BLOCK_PAIR\t= 2\n\t\t# const BLOCK_GOAL\t= 3\n\t\t# const BLOCK_BLOCK = 4\n\t\tvalue=\"PAIR\"\n\t}],\n\t[\"color_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=blockColors,\n\t\tvalue=\"Blue\"\n\t}],\n\t[\"action_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=[\"Add\", \"Remove\", \"Replace\"],\n\t\tvalue=\"Add\"\n\t}],\n\t[\"status\", Label.new()],\n\t[\"test_pzl\", Button.new()]\n]\nvar action_ix = gui.size() - 2 - 1\nvar color_ix = gui.size() - 2 - 2\nvar class_ix = gui.size() - 2 - 3\nvar status_ix = gui.size() - 2\n\n# gross style, cannot , but clean enough\nfunc shouldAddNeighbor():\n\treturn gui[action_ix][1].value == \"Add\"\n\nfunc shouldReplaceSelf():\n\treturn gui[action_ix][1].value == \"Replace\"\n\nfunc shouldRemoveSelf():\n\treturn gui[action_ix][1].value == \"Remove\"\n\n# called in AbstractBlock to add a new block\nfunc addBlock(pos):\n\tvar curColor = gui[color_ix][1].value\n\tvar selected = gui[class_ix][1].value\n\tvar b = puzzleMan.PickledBlock.new() \\\n\t\t.setName(id) \\\n\t\t.setBlockPos(pos) \\\n\t\t.setBlockClass(gui[class_ix][1].optionButt.get_selected() + 1)\n\t\t# VERY FRAGILE INDEX STUFF\n\tvar layer = puzzleMan.calcBlockLayerVec(pos)\n\tif layer == 0 and not selected == \"GOAL\":\n\t\treturn\n\n\tif selected == \"LZR\" or selected == \"GOAL\":\n\t\tprint(\"CANNOT MK \", str(selected))\n\t\treturn\n\n\tif selected == \"WILD\":\n\t\tb.setTextureName(curColor)\n\t# must be a paired block\n\n\telse:\n\t\tid += 1\n\n\t\t# expand prevblocks index\n\t\twhile prevBlocks.size() <= layer:\n\t\t\tvar d = {}\n\t\t\tfor k in blockColors:\n\t\t\t\td[k] = null\n\t\t\tprevBlocks.append(d)\n\n\t\tvar pb = prevBlocks[layer][curColor]\n\n\t\tif pb != null:\n\t\t\tvar prevName = pb.toNode().name\n\t\t\tvar pbNode = gridMan.get_node(prevName)\n\n\t\t\tb.setPairName(pb.name)\n\t\t\tpb.setPairName(b.name)\n\n\t\t\tb.setTextureName(pb.textureName)\n\n\t\t\tgridMan.remove_block(pb)\n\t\t\tgridMan.addPickledBlock(pb)\n\t\t\tprevBlocks[layer][curColor] = null\n\t\telse:\n\t\t\tprevBlocks[layer][curColor] = b\n\t\t\tglyphIx += 1\n\t\t\tglyphIx %= 3\n\t\t\tb.setTextureName(curColor + str(glyphIx + 1))\n\n\t\tgui[status_ix][1].set_text(getPrevBlockErrors())\n\n\tvar block = gridMan.addPickledBlock(b)\n\tvar v = 0.01\n\tblock.set_scale(Vector3(v,v,v))\n\tblock.scaleTweenNode(1, 0.25, Tween.TRANS_QUART).start()\n\treturn b\n\nfunc getPrevBlockErrors():\n\t# hahaha, so bad\n\tvar missing = \"STATUS: \"\n\t# check every layer\n\tfor l in range(prevBlocks.size()):\n\t\t# check every color\n\t\tfor k in prevBlocks[l].keys():\n\t\t\tvar missed = false\n\t\t\tif prevBlocks[l][k] != null:\n\t\t\t\t# one message about the current layer\n\t\t\t\tif not missed:\n\t\t\t\t\tmissing += \" L\" + str(l) + \" \"\n\t\t\t\t\tmissed = true\n\t\t\t\tmissing += k.to_upper() + \" \" # bad way of constructing strings\n\tif missing == \"\":\n\t\tmissing += \"NOMINAL\"\n\treturn missing\n\nfunc changeValue(ix, togg):\n\ttogg.value = togg.values[ix]\n\nfunc _ready():\n\t# lights!\n\tget_tree().get_root().add_child(preload( \"res:\/\/puzzleView.scn\" ).instance())\n\tpuzzle = preload( \"res:\/\/puzzle.scn\" ).instance()\n\tpuzzle.mainPuzzle = false\n\n\t# hide and disable timer\n\tpuzzle.time.on = false;\n\tpuzzle.time.val = ''\n\n\tpuzzle.set_as_toplevel(true)\n\tget_tree().get_root().add_child(puzzle)\n\n\tgridMan = puzzle.get_node(\"GridView\/GridMan\")\n\tid = gridMan.puzzle.shape.size()\n\n\tpuzzleMan = puzzle.puzzleMan\n\n\tset_process_input(true)\n\n\tvar theme = preload(\"res:\/\/themes\/MainTheme.thm\")\n\tfd = initLoadSaveDialog(self, get_tree(), saveDir)\n\n\tvar y = 0\n\tvar x = 60 # these are unrelated\n\tfor control in gui:\n\t\tif control[0].rfind('_toggle') > 0:\n\t\t\tx += 150\n\t\t\tvar togg = control[1]\n\t\t\tvar e = togg.optionButt\n\t\t\te.set_pos(Vector2(x, 45))\n\t\t\te.set_theme(theme)\n\t\t\tadd_child(e)\n\n\t\t\t# index of items needed\n\t\t\te.connect(\"item_selected\", self, \"changeValue\", [togg])\n\t\t\tfor i in range(togg.values.size()):\n\t\t\t\te.add_item(togg.values[i], i)\n\t\t\t\tif togg.value == togg.values[i]:\n\t\t\t\t\te.select(i)\n\t\t\t\t# e.add_icon_item(togg.values[i], i)\n\n\t\telse:\n\t\t\ty += 45\n\t\t\tvar e = control[1]\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tif e extends Button:\n\t\t\t\te.set_text(control[0])\n\t\t\tif control[0] == 'save_pzl' :\n\t\t\t\te.connect('pressed', self, 'showSaveDialog', [fd, self])\n\t\t\tif control[0] == 'load_pzl' :\n\t\t\t\te.connect('pressed', self, 'showLoadDialog', [fd, self])\n\t\t\tif control[0] == 'status':\n\t\t\t\tcontrol[1].set_text('STATUS: NOMINAL')\n\t\t\tadd_child(e)\n\n\nfunc puzzleSave():\n\tvar f = fd.get_current_path()\n\tif f == null or f == \"\":\n\t\treturn\n\tif getPrevBlockErrors() != NO_ERRORS:\n\t\tgui[status_ix][1].set_text(getPrevBlockErrors() + \" SAVING DISABLED! BANG HEAD ON KEYBOARD \")\n\t\treturn\n\tprint(\"SAVING TO \", f)\n\tDataMan.savePuzzle( f, gridMan.puzzle )\n\nfunc puzzleLoad():\n\tvar f = fd.get_current_path()\n\tif f == null or f == \"\":\n\t\treturn\n\tprint(\"LOADING FROM \", f)\n\tprevBlocks = []\n\tgridMan.set_puzzle(DataMan.loadPuzzle( f ))\n\nstatic func showLoadDialog(fileD, parent):\n\tif fileD.is_connected(\"confirmed\", parent, \"puzzleSave\"):\n\t\tfileD.disconnect(\"confirmed\", parent, \"puzzleSave\")\n\tfileD.connect(\"confirmed\", parent, \"puzzleLoad\")\n\tfileD.set_mode(FileDialog.MODE_OPEN_FILE)\n\n\tfileD.popup_centered()\n\nstatic func showSaveDialog(fileD, parent):\n\tif fileD.is_connected(\"confirmed\", parent, \"puzzleLoad\"):\n\t\tfileD.disconnect(\"confirmed\", parent, \"puzzleLoad\")\n\tfileD.connect(\"confirmed\", parent, \"puzzleSave\")\n\tfileD.set_mode(FileDialog.MODE_SAVE_FILE)\n\n\tfileD.popup_centered()\n\nstatic func initLoadSaveDialog(parent, tree, saveDir):\n\t# setup text in the file dialog\n\tvar fileDialog = load(\"res:\/\/fileDialog.scn\").instance()\n\tfileDialog.set_title(\"Select Puzzle Filename\")\n\tfileDialog.set_access(FileDialog.ACCESS_FILESYSTEM)\n\tfileDialog.add_filter(\"*.pzl ; Anttris Puzzle\")\n\n\tDirectory.new().make_dir_recursive(saveDir)\n\tfileDialog.set_current_dir(saveDir)\n\tprint(\"Saves in \", saveDir)\n\n\t# MainTheme leaks on bottom\n\tvar dialogTheme = Theme.new()\n\tdialogTheme.copy_default_theme()\n\tfileDialog.set_theme(dialogTheme)\n\n\t# work even if game is paused\n\tfileDialog.set_pause_mode(PAUSE_MODE_PROCESS)\n\n\t# unpause if user cancels\n\tfileDialog.connect(\"popup_hide\", tree, \"set_pause\", [false])\n\tfileDialog.connect(\"hide\", tree, \"set_pause\", [false])\n\tfileDialog.connect(\"about_to_show\", tree, \"set_pause\", [true])\n\tfileDialog.hide()\n\n\tparent.add_child(fileDialog)\n\tfileDialog.set_owner(parent)\n\treturn fileDialog\n","old_contents":"extends Spatial\n\nconst NO_ERRORS = \"STATUS NOMINAL\"\n\nvar puzzle\nvar puzzleMan\nvar DataMan = preload(\"res:\/\/scripts\/DataManager.gd\")\n\nvar gridMan\nvar prevBlocks = [] # keeps track of prevous color for pairs by layer\nvar blockColors = preload(\"res:\/\/scripts\/PuzzleManager.gd\").blockColors\nvar id\n\nvar saveDir = OS.get_data_dir() + \"\/PuzzleSaves\"\n\nvar glyphIx = 0\n\nvar fd\nvar gui = [\n\t[\"status\", Label.new()], # plz keep me as first element, referenced as gui[0] later\n\t[\"save_pzl\", Button.new()],\n\t[\"load_pzl\", Button.new()],\n\t[\"remove_layer\", Button.new()],\n\t[\"random_layer\", Button.new()],\n\t[\"class_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=[\"WILD\", \"PAIR\"],\n\t\t# const BLOCK_LASER\t= 0\n\t\t# const BLOCK_WILD\t= 1\n\t\t# const BLOCK_PAIR\t= 2\n\t\t# const BLOCK_GOAL\t= 3\n\t\t# const BLOCK_BLOCK = 4\n\t\tvalue=\"PAIR\"\n\t}],\n\t[\"color_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=blockColors,\n\t\tvalue=\"Blue\"\n\t}],\n\t[\"action_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=[\"Add\", \"Remove\", \"Replace\"],\n\t\tvalue=\"Add\"\n\t}],\n\t[\"test_pzl\", Button.new()],\n]\nvar action_ix = gui.size() - 1 - 1\nvar color_ix = gui.size() - 1 - 2\nvar class_ix = gui.size() - 1 - 3\n\n# gross style, cannot , but clean enough\nfunc shouldAddNeighbor():\n\treturn gui[action_ix][1].value == \"Add\"\n\nfunc shouldReplaceSelf():\n\treturn gui[action_ix][1].value == \"Replace\"\n\nfunc shouldRemoveSelf():\n\treturn gui[action_ix][1].value == \"Remove\"\n\n# called in AbstractBlock to add a new block\nfunc addBlock(pos):\n\tvar curColor = gui[color_ix][1].value\n\tvar selected = gui[class_ix][1].value\n\tvar b = puzzleMan.PickledBlock.new() \\\n\t\t.setName(id) \\\n\t\t.setBlockPos(pos) \\\n\t\t.setBlockClass(gui[class_ix][1].optionButt.get_selected() + 1)\n\t\t# VERY FRAGILE INDEX STUFF\n\tvar layer = puzzleMan.calcBlockLayerVec(pos)\n\tif layer == 0 and not selected == \"GOAL\":\n\t\treturn\n\n\tif selected == \"LZR\" or selected == \"GOAL\":\n\t\tprint(\"CANNOT MK \", str(selected))\n\t\treturn\n\n\tif selected == \"WILD\":\n\t\tb.setTextureName(curColor)\n\t# must be a paired block\n\n\telse:\n\t\tid += 1\n\n\t\t# expand prevblocks index\n\t\twhile prevBlocks.size() <= layer:\n\t\t\tvar d = {}\n\t\t\tfor k in blockColors:\n\t\t\t\td[k] = null\n\t\t\tprevBlocks.append(d)\n\n\t\tvar pb = prevBlocks[layer][curColor]\n\n\t\tif pb != null:\n\t\t\tvar prevName = pb.toNode().name\n\t\t\tvar pbNode = gridMan.get_node(prevName)\n\n\t\t\tb.setPairName(pb.name)\n\t\t\tpb.setPairName(b.name)\n\n\t\t\tb.setTextureName(pb.textureName)\n\n\t\t\tgridMan.remove_block(pb)\n\t\t\tgridMan.addPickledBlock(pb)\n\t\t\tprevBlocks[layer][curColor] = null\n\t\telse:\n\t\t\tprevBlocks[layer][curColor] = b\n\t\t\tglyphIx += 1\n\t\t\tglyphIx %= 3\n\t\t\tb.setTextureName(curColor + str(glyphIx + 1))\n\n\t\tgui[0][1].set_text(getPrevBlockErrors())\n\n\tvar block = gridMan.addPickledBlock(b)\n\tvar v = 0.01\n\tblock.set_scale(Vector3(v,v,v))\n\tblock.scaleTweenNode(1, 0.25, Tween.TRANS_QUART).start()\n\treturn b\n\nfunc getPrevBlockErrors():\n\t# hahaha, so bad\n\tvar missing = \"STATUS: \"\n\t# check every layer\n\tfor l in range(prevBlocks.size()):\n\t\t# check every color\n\t\tfor k in prevBlocks[l].keys():\n\t\t\tvar missed = false\n\t\t\tif prevBlocks[l][k] != null:\n\t\t\t\t# one message about the current layer\n\t\t\t\tif not missed:\n\t\t\t\t\tmissing += \" L\" + str(l) + \" \"\n\t\t\t\t\tmissed = true\n\t\t\t\tmissing += k.to_upper() + \" \" # bad way of constructing strings\n\tif missing == \"\":\n\t\tmissing += \"NOMINAL\"\n\treturn missing\n\nfunc changeValue(ix, togg):\n\ttogg.value = togg.values[ix]\n\nfunc _ready():\n\t# lights!\n\tget_tree().get_root().add_child(preload( \"res:\/\/puzzleView.scn\" ).instance())\n\tpuzzle = preload( \"res:\/\/puzzle.scn\" ).instance()\n\tpuzzle.mainPuzzle = false\n\n\t# hide and disable timer\n\tpuzzle.time.on = false;\n\tpuzzle.time.val = ''\n\n\tpuzzle.set_as_toplevel(true)\n\tget_tree().get_root().add_child(puzzle)\n\n\tgridMan = puzzle.get_node(\"GridView\/GridMan\")\n\tid = gridMan.puzzle.shape.size()\n\n\tpuzzleMan = puzzle.puzzleMan\n\n\tset_process_input(true)\n\n\tvar theme = preload(\"res:\/\/themes\/MainTheme.thm\")\n\tfd = initLoadSaveDialog(self, get_tree(), saveDir)\n\n\tvar y = 0\n\tfor control in gui:\n\t\ty += 45\n\t\tif control[0].rfind('_toggle') > 0:\n\t\t\tvar togg = control[1]\n\t\t\tvar e = togg.optionButt\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tadd_child(e)\n\n\t\t\t# index of items needed\n\t\t\te.connect(\"item_selected\", self, \"changeValue\", [togg])\n\t\t\tfor i in range(togg.values.size()):\n\t\t\t\te.add_item(togg.values[i], i)\n\t\t\t\tif togg.value == togg.values[i]:\n\t\t\t\t\te.select(i)\n\t\t\t\t# e.add_icon_item(togg.values[i], i)\n\n\t\telse:\n\t\t\tvar e = control[1]\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tif e extends Button:\n\t\t\t\te.set_text(control[0])\n\t\t\tif control[0] == 'save_pzl' :\n\t\t\t\te.connect('pressed', self, 'showSaveDialog', [fd, self])\n\t\t\tif control[0] == 'load_pzl' :\n\t\t\t\te.connect('pressed', self, 'showLoadDialog', [fd, self])\n\t\t\tif control[0] == 'status':\n\t\t\t\tcontrol[1].set_text('STATUS: NOMINAL')\n\t\t\tadd_child(e)\n\n\nfunc puzzleSave():\n\tvar f = fd.get_current_path()\n\tif f == null or f == \"\":\n\t\treturn\n\tif getPrevBlockErrors() != NO_ERRORS:\n\t\tgui[0][1].set_text(getPrevBlockErrors() + \" SAVING DISABLED! BANG HEAD ON KEYBOARD \")\n\t\treturn\n\tprint(\"SAVING TO \", f)\n\tDataMan.savePuzzle( f, gridMan.puzzle )\n\nfunc puzzleLoad():\n\tvar f = fd.get_current_path()\n\tif f == null or f == \"\":\n\t\treturn\n\tprint(\"LOADING FROM \", f)\n\tprevBlocks = []\n\tgridMan.set_puzzle(DataMan.loadPuzzle( f ))\n\nstatic func showLoadDialog(fileD, parent):\n\tif fileD.is_connected(\"confirmed\", parent, \"puzzleSave\"):\n\t\tfileD.disconnect(\"confirmed\", parent, \"puzzleSave\")\n\tfileD.connect(\"confirmed\", parent, \"puzzleLoad\")\n\tfileD.set_mode(FileDialog.MODE_OPEN_FILE)\n\n\tfileD.popup_centered()\n\nstatic func showSaveDialog(fileD, parent):\n\tif fileD.is_connected(\"confirmed\", parent, \"puzzleLoad\"):\n\t\tfileD.disconnect(\"confirmed\", parent, \"puzzleLoad\")\n\tfileD.connect(\"confirmed\", parent, \"puzzleSave\")\n\tfileD.set_mode(FileDialog.MODE_SAVE_FILE)\n\n\tfileD.popup_centered()\n\nstatic func initLoadSaveDialog(parent, tree, saveDir):\n\t# setup text in the file dialog\n\tvar fileDialog = load(\"res:\/\/fileDialog.scn\").instance()\n\tfileDialog.set_title(\"Select Puzzle Filename\")\n\tfileDialog.set_access(FileDialog.ACCESS_FILESYSTEM)\n\tfileDialog.add_filter(\"*.pzl ; Anttris Puzzle\")\n\n\tDirectory.new().make_dir_recursive(saveDir)\n\tfileDialog.set_current_dir(saveDir)\n\tprint(\"Saves in \", saveDir)\n\n\t# MainTheme leaks on bottom\n\tvar dialogTheme = Theme.new()\n\tdialogTheme.copy_default_theme()\n\tfileDialog.set_theme(dialogTheme)\n\n\t# work even if game is paused\n\tfileDialog.set_pause_mode(PAUSE_MODE_PROCESS)\n\n\t# unpause if user cancels\n\tfileDialog.connect(\"popup_hide\", tree, \"set_pause\", [false])\n\tfileDialog.connect(\"hide\", tree, \"set_pause\", [false])\n\tfileDialog.connect(\"about_to_show\", tree, \"set_pause\", [true])\n\tfileDialog.hide()\n\n\tparent.add_child(fileDialog)\n\tfileDialog.set_owner(parent)\n\treturn fileDialog\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"a728c447ec1e884b4372aa1454ca5bd7be9787af","subject":"clean-up","message":"clean-up\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/GridMan.gd","new_file":"src\/scripts\/GridMan.gd","new_contents":"extends Spatial\n\n# Is there a better way to do this?\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\n# Shape dictionary to access blocks quickly by position.\nvar shape = {}\n\n# Block selection handling.\nvar offClick = false\nvar selectedBlocks = []\n\n# Puzzle vars.\nvar puzzle\n\n# Beam stuff.\nconst beamScn = preload( \"res:\/\/blocks\/block.scn\" )\nconst Beam = preload(\"res:\/\/scripts\/Blocks\/Beam.gd\")\n\n# sounds\nvar samplePlayer = SamplePlayer.new()\n\nfunc add_block(b):\n\tprint (\"ADDED\")\n\tshape[b.blockPos] = b\n\n\t# TODO any special treatment for the wild blocks?\n\t# TODO keep track of puzzle.lasers ? How to?\n\n\t# keep track of puzzle.pairCounts\n\tvar layer = calcBlockLayerVec(b.blockPos)\n\tif b.getBlockType() == 2:\n\t\twhile puzzle.pairCount.size() <= layer:\n\t\t\tpuzzle.pairCount.append(0)\n\t\tpuzzle.pairCount[layer] += 0.5\n\n\tadd_child(b)\n\nfunc get_block(pos):\n\tif shape.has(pos):\n\t\treturn shape[pos]\n\telse:\n\t\treturn null\n\n# unused key argument needed for the tween_complete signal\nfunc remove_block(block_node, key=null):\n\tif block_node == null:\n\t\treturn\n\tprint (\"REMOVED\")\n\n\tshape[block_node.blockPos] = null\n\tfor child in block_node.get_children():\n\t\tblock_node.remove_and_delete_child(child)\n\tremove_and_delete_child(block_node)\n\n# Sets the puzzle for this GridMan.\nfunc set_puzzle(puzz):\n\t# delete all current nodes\n\tfor pos in shape:\n\t\tremove_block(shape[pos])\n\n\t# Store the puzzle.\n\tpuzzle = puzz\n\n\t# Set the camera range to be relative to the layer count.\n\tvar cam = get_parent().get_parent().get_node( \"Camera\" )\n\tvar totalSize = ( puzzle.puzzleLayers * 2 + 1 )\n\tcam.distance.val = 4.5 * totalSize\n\tcam.distance.min_ = 3 * totalSize\n\tcam.distance.max_ = 10 * totalSize\n\tcam.recalculate_camera()\n\n\t\t# # I can do my own counting!\n\t# needed for adding blocks in the editor\n\tpuzzle.pairCount = []\n\tfor block in puzzle.blocks:\n\t\t# Create a block node, add it to the tree\n\t\tadd_block(block.toNode())\n\n# Clears any selected blocks. WE SHOULD FIX THIS, THERE CAN ONLY BE ONE BLOCK SELECTED AT ANY ONE TIME, NO NEED FOR AN ARRAY!\nfunc clearSelection():\n\tfor bl in selectedBlocks:\n\t\tvar blo = get_node( bl )\n\t\tblo.setSelected(false)\n\t\tblo.scaleTweenNode(1.0).start()\n\tselectedBlocks = []\n\n# Add the selected block to the selected list. WE SHOULD FIX THIS, IT ONLY NEEDS TO STORE IT, NOT AN ARRAY!\nfunc addSelected(bl):\n\tselectedBlocks.append(bl)\n\n# Used for the multiplayer mode to force click a block on their side.\nfunc forceClickBlock( pos ):\n\tshape[pos].forceClick()\n\nfunc clickBlock( name ):\n\t#now check if that was the second block we picked. If it was, we want to\n\t#unselect the blocks again\n\tif (offClick):\n\t\toffClick = false\n\t\taddSelected(name)\n\t\tclearSelection()\n\telse:\n\t\toffClick = true;\n\t\taddSelected(name)\n\n# Calculates the layer that a block is on.\n# COPY OF FUNCTION IN PUZZLEMAN, IS THERE A BETTER WAY TO DO THIS?!\nfunc calcBlockLayer( x, y, z ):\n\treturn max( max( abs( x ), abs( y ) ), abs( z ) )\nfunc calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n# Handles keeping track of pairs being removed.\nfunc popPair( pos ):\n\tvar blayer = calcBlockLayerVec( pos )\n\tpuzzle.pairCount[blayer] -= 1\n\n\tif( puzzle.pairCount[blayer] == 0 ):\n\t\tprint(\"LAYER CLEARED\")\n\t\tif blayer == 1:\n\t\t\tprint( \"GAME OVER!\" )\n\n\t\tfor b in shape:\n\t\t\tif not ( shape[b] == null ):\n\t\t\t\tif calcBlockLayerVec( b ) == blayer:\n\t\t\t\t\tif shape[b].getBlockType() == BLOCK_LASER:\n\t\t\t\t\t\tshape[b].forceActivate()\n\n\t\t# Fire beams.\n\t\tvar beamNum = 0\n\t\tfor l in range( puzzle.lasers.size() ):\n\t\t\tif calcBlockLayerVec( puzzle.lasers[l][0] ) == blayer:\n\t\t\t\t# Firin mah lazerz!\n\t\t\t\tvar beam = beamScn.instance()\n\n\t\t\t\tbeam.set_name( str(blayer) + \"_beam_\" + str(beamNum) )\n\t\t\t\tbeamNum += 1\n\t\t\t\tbeam.set_script( Beam )\n\n\t\t\t\tadd_child( beam )\n\t\t\t\tbeam.fire( puzzle.lasers[l][0], puzzle.lasers[l][1] )\n\n\t\t\t\tsamplePlayer.play( \"soundslikewillem_hitting_slinky\" )\n\n\nfunc _init():\n\t# Load sound\n\tsamplePlayer.set_voice_count(10)\n\tsamplePlayer.set_sample_library(ResourceLoader.load(\"new_samplelibrary.xml\"))\n\tprint(\"GridMan initialized\")\n\n","old_contents":"extends Spatial\n\n# Is there a better way to do this?\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\n# Shape dictionary to access blocks quickly by position.\nvar shape = {}\n\n# Block selection handling.\nvar offClick = false\nvar selectedBlocks = []\n\n# Puzzle vars.\nvar puzzle\n\n# Beam stuff.\nconst beamScn = preload( \"res:\/\/blocks\/block.scn\" )\nconst Beam = preload(\"res:\/\/scripts\/Blocks\/Beam.gd\")\n\n# sounds\nvar samplePlayer = SamplePlayer.new()\n\nfunc add_block(b):\n\tprint (\"ADDED\")\n\tshape[b.blockPos] = b\n\n\t# TODO any special treatment for the wild blocks?\n\t# TODO keep track of puzzle.lasers ? How to?\n\n\t# keep track of puzzle.pairCounts\n\tvar layer = calcBlockLayerVec(b.blockPos)\n\tif b.getBlockType() == 2:\n\t\twhile puzzle.pairCount.size() <= layer:\n\t\t\tpuzzle.pairCount.append(0)\n\t\tpuzzle.pairCount[layer] += 0.5\n\n\tadd_child(b)\n\nfunc get_block(pos):\n\tif shape.has(pos):\n\t\treturn shape[pos]\n\telse:\n\t\treturn null\n\n# unused key argument needed for the tween_complete signal\nfunc remove_block(block_node, key=null):\n\tif block_node == null:\n\t\treturn\n\tprint (\"REMOVED\")\n\tif block_node.get_script() == preload(\"Blocks\/PairedBlock.gd\"):\n\t\tprint(\"PAIRED RM\")\n\tshape[block_node.blockPos] = null\n\tfor child in block_node.get_children():\n\t\tblock_node.remove_and_delete_child(child)\n\tremove_and_delete_child(block_node)\n\n# Sets the puzzle for this GridMan.\nfunc set_puzzle(puzz):\n\t# delete all current nodes\n\tfor pos in shape:\n\t\tremove_block(shape[pos])\n\n\t# Store the puzzle.\n\tpuzzle = puzz\n\n\t# Set the camera range to be relative to the layer count.\n\tvar cam = get_parent().get_parent().get_node( \"Camera\" )\n\tvar totalSize = ( puzzle.puzzleLayers * 2 + 1 )\n\tcam.distance.val = 4.5 * totalSize\n\tcam.distance.min_ = 3 * totalSize\n\tcam.distance.max_ = 10 * totalSize\n\tcam.recalculate_camera()\n\n\t\t# # I can do my own counting!\n\t# needed for adding blocks in the editor\n\tpuzzle.pairCount = []\n\tfor block in puzzle.blocks:\n\t\t# Create a block node, add it to the tree\n\t\tadd_block(block.toNode())\n\n# Clears any selected blocks. WE SHOULD FIX THIS, THERE CAN ONLY BE ONE BLOCK SELECTED AT ANY ONE TIME, NO NEED FOR AN ARRAY!\nfunc clearSelection():\n\tfor bl in selectedBlocks:\n\t\tvar blo = get_node( bl )\n\t\tblo.setSelected(false)\n\t\tblo.scaleTweenNode(1.0).start()\n\tselectedBlocks = []\n\n# Add the selected block to the selected list. WE SHOULD FIX THIS, IT ONLY NEEDS TO STORE IT, NOT AN ARRAY!\nfunc addSelected(bl):\n\tselectedBlocks.append(bl)\n\n# Used for the multiplayer mode to force click a block on their side.\nfunc forceClickBlock( pos ):\n\tshape[pos].forceClick()\n\nfunc clickBlock( name ):\n\t#now check if that was the second block we picked. If it was, we want to\n\t#unselect the blocks again\n\tif (offClick):\n\t\toffClick = false\n\t\taddSelected(name)\n\t\tclearSelection()\n\telse:\n\t\toffClick = true;\n\t\taddSelected(name)\n\n# Calculates the layer that a block is on.\n# COPY OF FUNCTION IN PUZZLEMAN, IS THERE A BETTER WAY TO DO THIS?!\nfunc calcBlockLayer( x, y, z ):\n\treturn max( max( abs( x ), abs( y ) ), abs( z ) )\nfunc calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n# Handles keeping track of pairs being removed.\nfunc popPair( pos ):\n\tvar blayer = calcBlockLayerVec( pos )\n\tpuzzle.pairCount[blayer] -= 1\n\n\tif( puzzle.pairCount[blayer] == 0 ):\n\t\tprint(\"LAYER CLEARED\")\n\t\tif blayer == 1:\n\t\t\tprint( \"GAME OVER!\" )\n\n\t\tfor b in shape:\n\t\t\tif not ( shape[b] == null ):\n\t\t\t\tif calcBlockLayerVec( b ) == blayer:\n\t\t\t\t\tif shape[b].getBlockType() == BLOCK_LASER:\n\t\t\t\t\t\tshape[b].forceActivate()\n\n\t\t# Fire beams.\n\t\tvar beamNum = 0\n\t\tfor l in range( puzzle.lasers.size() ):\n\t\t\tif calcBlockLayerVec( puzzle.lasers[l][0] ) == blayer:\n\t\t\t\t# Firin mah lazerz!\n\t\t\t\tvar beam = beamScn.instance()\n\n\t\t\t\tbeam.set_name( str(blayer) + \"_beam_\" + str(beamNum) )\n\t\t\t\tbeamNum += 1\n\t\t\t\tbeam.set_script( Beam )\n\n\t\t\t\tadd_child( beam )\n\t\t\t\tbeam.fire( puzzle.lasers[l][0], puzzle.lasers[l][1] )\n\n\t\t\t\tsamplePlayer.play( \"soundslikewillem_hitting_slinky\" )\n\n\nfunc _init():\n\t# Load sound\n\tsamplePlayer.set_voice_count(10)\n\tsamplePlayer.set_sample_library(ResourceLoader.load(\"new_samplelibrary.xml\"))\n\tprint(\"GridMan initialized\")\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"3ab8ca65d0a38f5a411ee26116ebcdd4a5c2462b","subject":"can now return to main menu from the host menu","message":"can now return to main menu from the host menu\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Network.gd","new_file":"src\/scripts\/Network.gd","new_contents":"# Core networking\n\nextends Node\n\nconst REMOTE_FINISH = 0\nconst REMOTE_START = 1\nconst REMOTE_QUIT = 2\nconst REMOTE_BLOCK = 4\nconst REMOTE_BLOCK_TRANSFORM = 5\nconst REMOTE_BLOCK_UPDATE = 6\n\nvar port = 54321\nvar root\nvar isNetwork\nvar isHost\nvar isClient = false\nvar server\nvar client\nvar connection\nvar proxy\n\nvar remotePuzzle\n\n#Store the peer stream used by both the lcient and server\nvar stream\n\nfunc _ready():\n\tisNetwork = false\n\tisHost = false\n\tvar label = get_tree().get_root().get_node(\"GUIManager\/OptionsMenu\/Panel\/PortField\/LineEdit\")\n\tif not label == null:\n\t\tlabel.set_text(str(port))\n\nfunc setPort(pt):\n\tport = pt;\n\nfunc connectTo(ip, pt):\n\tisClient = true #just to tell if it's doing something :S\n\tconnection = PacketPeerStream.new()\n\tstream = StreamPeerTCP.new()\n\tconnection.set_stream_peer(stream)\n\tstream.connect(ip, pt);\n\n\tif stream.get_status() == stream.STATUS_CONNECTED or stream.get_status() == stream.STATUS_CONNECTING:\n\t\tprint(\"Connecting to \" + ip + \":\" + str(port));\n\t\tproxy.set_process(true)\n\t\t#leave is_network as false to indicate we're still waiting for connection\n\n\nfunc host(pt):\n\tserver = TCP_Server.new()\n\t#connection = PacketPeerStream.new()\n\tisHost = true\n\tprint(\"Starting listening server on port \" + str(pt))\n\tif server.listen(pt) == 0:\n\t\tproxy.set_process(true)\n\t\tprint(\"Listening...\")\n\telse:\n\t\tprint(\"Failed to start server on port \" + str(pt));\n\nfunc _process(delta):\n\tif (isHost):\n\t\t#server processing stuff\n\t\t#use isNetwork to determine if we're still listening\n\t\tif !isNetwork:\n\t\t\tif server.is_connection_available():\n\t\t\t\tstream = server.take_connection()\n\t\t\t\tconnection = PacketPeerStream.new()\n\t\t\t\tconnection.set_stream_peer(stream)\n\t\t\t\tprint(\"Connecting with player...\")\n\t\t\t\tisNetwork = true\n\t\t\t\tserver.stop()\n\n\t\t\t\tgotoPuzzle()\n\n\t\t\t\tremotePuzzle = root.get_node(\"Puzzle\")\n\t\t\t\t#MAKE CALL TO PUZZLE SELECTER\n\t\telse: #not listening anymore, have a client\n\t\t\t#do quick check to make sure we're still\n\t\t\t#connected\n\t\t\tif !stream.is_connected():\n\t\t\t\tprint(\"Lost Connection!\");\n\t\t\t\tisNetwork = false\n\t\t\t\tproxy.set_process(false)\n\t\t\t\t#QUIT GAME\n\t\t\t\treturn\n\t\t\t#check if we have any data\n\t\t\tif connection.get_available_packet_count() > 0:\n\t\t\t\t#have to be careful about more than 1 packet per frame\n\t\t\t\tfor i in range(connection.get_available_packet_count()):\n\t\t\t\t\tvar dataArray = connection.get_var()\n\t\t\t\t\tProcessServerData(dataArray)\n\n\telse:\n\t\t#client processing stuff\n\t\tif !isNetwork:\n\t\t\t#Still waiting for connection confirmed\n\t\t\tif stream.get_status() == stream.STATUS_CONNECTED:\n\t\t\t\tprint(\"Connection established!\")\n\t\t\t\tisNetwork = true\n\n\t\t\t\tgotoPuzzle()\n\n\t\t\t\tremotePuzzle = root.get_node(\"Puzzle\")\n\t\t\t\treturn\n\t\t\tif stream.get_status() == stream.STATUS_NONE or stream.get_status() == stream.STATUS_ERROR:\n\t\t\t\tprint(\"Error establishing connection!\")\n\t\t\t\tproxy.set_process(false)\n\t\t\t\treturn\n\t\t\t\t#stop running process loop, cause we have no connection\n\t\telse:\n\t\t\t#connecton established and confirmed. Do regular data processing\n\t\t\t#check if we have any data\n\t\t\tif connection.get_available_packet_count() > 0:\n\t\t\t\tfor i in range(connection.get_available_packet_count()):\n\t\t\t\t\tvar dataArray = connection.get_var()\n\t\t\t\t\tProcessServerData(dataArray)\n\t\t\t\t\t#Call the server process script cuase it's peer to peer and we have the same functions!\n\n\nfunc disconnect():\n\t#need to do lots of things! If the server is open and listening, but has no connection just stop listening!\n\tif isHost and !isNetwork:\n\t\t#this means we're waiting for connection still\n\t\tserver.stop()\n\t\tprint(\"closing server listener!\")\n\telif isHost and isNetwork:\n\t\t#have connections. Need to send them stop packet, and close connection\n\t\tconnection.put_var([REMOTE_QUIT])\n\t\tstream.disconnect()\n\t\tprint(\"Closing connection to remote player...\")\n\t\tgotoMenu()\n\telif !isHost and !isNetwork:\n\t\tstream.disconnect()\n\t\tprint(\"Halting connection request...\")\n\telif !isHost and isNetwork:\n\t\t#connected to server already\n\t\tstream.disconnect()\n\t\tprint(\"Disconnecting from server...\")\n\t\tgotoMenu()\n\n\t#no matter where we wre before disconnect, set network to false and return to beginning screen!\n\tisNetwork = false;\n\tisHost = false;\n\tisClient = false;\n\n\tproxy.set_process(false)\n\n\n\nfunc ProcessServerData(dataArray):\n\t#have an array of data. First element should be identifying int\n\tvar ID = dataArray[0]\n\tprint(ID)\n\t#no switch statement. I'm crying right now while i type this. My fingers are bleeding\n\tif ID == REMOTE_START:\n\t\t#do start something or something whut\n\t\tprint(\"remote_stuff\")\n\telif ID == REMOTE_FINISH:\n\t\t#again, do ending stuff\n\t\tprint(\"remote_finish: \" + str(dataArray[1]))\n\telif ID == REMOTE_QUIT:\n\t\t#omg those jerks!\n\t\tprint(\"remote_quit\")\n\t\tdisconnect()\n\telif ID == REMOTE_BLOCK:\n\t\t#get their block ifnormation!\n\t\tprint(\"remote_block\")\n\telif ID == REMOTE_BLOCK_TRANSFORM:\n\t\t#sent block information\n\t\t#var scale = dataArray[1]\n\t\tvar translation = dataArray[1]\n\t\t#remotePuzzle.otherPuzzle.set_scale(scale)\n\t\tremotePuzzle.otherPuzzle.set_transform(Transform( translation ))\n\t\tremotePuzzle.otherPuzzle.set_translation(Vector3(20, 12, -40))\n\telif ID == REMOTE_BLOCK_UPDATE:\n\t\t#sent an updated block pair\n\t\tprint(\"block update\")\n\t\tvar puzzle = root.get_node( \"Puzzle\" )\n\t\tvar pos = dataArray[1]\n\t\tpuzzle.otherPuzzle.get_node(\"GridView\/GridMan\").forceClickBlock(pos)\n\nfunc sendStart():\n\tif !isNetwork:\n\t\tprint(\"Error sending start packet: not connected!\")\n\t\treturn\n\tvar er = connection.put_var([REMOTE_START])\n\tprint(\"Sending start and got [\" + str(er) + \"]\")\n\nfunc sendBlockUpdate(pos):\n\tif !isNetwork:\n\t\tprint(\"Error sending start packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_BLOCK_UPDATE, pos])\n\nfunc sendFinish(score):\n\tif !isNetwork:\n\t\tprint(\"Error sending finish packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_FINISH, score])\n\nfunc sendQuit():\n\tif !isNetwork:\n\t\tprint(\"Error sending finish packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_QUIT])\n\nfunc sendTransform(translation):\n\tif !isNetwork:\n\t\tprint(\"Cannot send transformation over an unitialized network!\")\n\t\treturn\n\tconnection.put_var([REMOTE_BLOCK_TRANSFORM, translation])\n\n\nfunc gotoMenu():\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\troot.add_child( load(\"res:\/\/menus.scn\") )\n\nfunc gotoPuzzle():\n\tvar guiMan = preload(\"GUIManager.gd\").new()\n\tguiMan.gotoPuzzleScene(root, true) # network = true\n","old_contents":"# Core networking\n\nextends Node\n\nconst REMOTE_FINISH = 0\nconst REMOTE_START = 1\nconst REMOTE_QUIT = 2\nconst REMOTE_BLOCK = 4\nconst REMOTE_BLOCK_TRANSFORM = 5\nconst REMOTE_BLOCK_UPDATE = 6\n\nvar port = 54321\nvar root\nvar isNetwork\nvar isHost\nvar isClient = false\nvar server\nvar client\nvar connection\nvar proxy\n\nvar remotePuzzle\n\n#Store the peer stream used by both the lcient and server\nvar stream\n\nfunc _ready():\n\tisNetwork = false\n\tisHost = false\n\tvar label = get_tree().get_root().get_node(\"GUIManager\/OptionsMenu\/Panel\/PortField\/LineEdit\")\n\tif not label == null:\n\t\tlabel.set_text(str(port))\n\nfunc setPort(pt):\n\tport = pt;\n\nfunc connectTo(ip, pt):\n\tisClient = true #just to tell if it's doing something :S\n\tconnection = PacketPeerStream.new()\n\tstream = StreamPeerTCP.new()\n\tconnection.set_stream_peer(stream)\n\tstream.connect(ip, pt);\n\n\tif stream.get_status() == stream.STATUS_CONNECTED or stream.get_status() == stream.STATUS_CONNECTING:\n\t\tprint(\"Connecting to \" + ip + \":\" + str(port));\n\t\tproxy.set_process(true)\n\t\t#leave is_network as false to indicate we're still waiting for connection\n\n\nfunc host(pt):\n\tserver = TCP_Server.new()\n\t#connection = PacketPeerStream.new()\n\tisHost = true\n\tprint(\"Starting listening server on port \" + str(pt))\n\tif server.listen(pt) == 0:\n\t\tproxy.set_process(true)\n\t\tprint(\"Listening...\")\n\telse:\n\t\tprint(\"Failed to start server on port \" + str(pt));\n\nfunc _process(delta):\n\tif (isHost):\n\t\t#server processing stuff\n\t\t#use isNetwork to determine if we're still listening\n\t\tif !isNetwork:\n\t\t\tif server.is_connection_available():\n\t\t\t\tstream = server.take_connection()\n\t\t\t\tconnection = PacketPeerStream.new()\n\t\t\t\tconnection.set_stream_peer(stream)\n\t\t\t\tprint(\"Connecting with player...\")\n\t\t\t\tisNetwork = true\n\t\t\t\tserver.stop()\n\n\t\t\t\tgotoPuzzle()\n\n\t\t\t\tremotePuzzle = root.get_node(\"Puzzle\")\n\t\t\t\t#MAKE CALL TO PUZZLE SELECTER\n\t\telse: #not listening anymore, have a client\n\t\t\t#do quick check to make sure we're still\n\t\t\t#connected\n\t\t\tif !stream.is_connected():\n\t\t\t\tprint(\"Lost Connection!\");\n\t\t\t\tisNetwork = false\n\t\t\t\tproxy.set_process(false)\n\t\t\t\t#QUIT GAME\n\t\t\t\treturn\n\t\t\t#check if we have any data\n\t\t\tif connection.get_available_packet_count() > 0:\n\t\t\t\t#have to be careful about more than 1 packet per frame\n\t\t\t\tfor i in range(connection.get_available_packet_count()):\n\t\t\t\t\tvar dataArray = connection.get_var()\n\t\t\t\t\tProcessServerData(dataArray)\n\n\telse:\n\t\t#client processing stuff\n\t\tif !isNetwork:\n\t\t\t#Still waiting for connection confirmed\n\t\t\tif stream.get_status() == stream.STATUS_CONNECTED:\n\t\t\t\tprint(\"Connection established!\")\n\t\t\t\tisNetwork = true\n\n\t\t\t\tgotoPuzzle()\n\n\t\t\t\tremotePuzzle = root.get_node(\"Puzzle\")\n\t\t\t\treturn\n\t\t\tif stream.get_status() == stream.STATUS_NONE or stream.get_status() == stream.STATUS_ERROR:\n\t\t\t\tprint(\"Error establishing connection!\")\n\t\t\t\tproxy.set_process(false)\n\t\t\t\treturn\n\t\t\t\t#stop running process loop, cause we have no connection\n\t\telse:\n\t\t\t#connecton established and confirmed. Do regular data processing\n\t\t\t#check if we have any data\n\t\t\tif connection.get_available_packet_count() > 0:\n\t\t\t\tfor i in range(connection.get_available_packet_count()):\n\t\t\t\t\tvar dataArray = connection.get_var()\n\t\t\t\t\tProcessServerData(dataArray)\n\t\t\t\t\t#Call the server process script cuase it's peer to peer and we have the same functions!\n\n\nfunc disconnect():\n\t#need to do lots of things! If the server is open and listening, but has no connection just stop listening!\n\tif isHost and !isNetwork:\n\t\t#this means we're waiting for connection still\n\t\tserver.stop()\n\t\tprint(\"closing server listener!\")\n\telif isHost and isNetwork:\n\t\t#have connections. Need to send them stop packet, and close connection\n\t\tconnection.put_var([REMOTE_QUIT])\n\t\tstream.disconnect()\n\t\tprint(\"Closing connection to remote player...\")\n\telif !isHost and !isNetwork:\n\t\tstream.disconnect()\n\t\tprint(\"Halting connection request...\")\n\telif !isHost and isNetwork:\n\t\t#connected to server already\n\t\tstream.disconnect()\n\t\tprint(\"Disconnecting from server...\")\n\n\t#no matter where we wre before disconnect, set network to false and return to beginning screen!\n\tisNetwork = false;\n\tisHost = false;\n\tisClient = false;\n\n\tproxy.set_process(false)\n\n\n\tgotoMenu()\n\n\nfunc ProcessServerData(dataArray):\n\t#have an array of data. First element should be identifying int\n\tvar ID = dataArray[0]\n\tprint(ID)\n\t#no switch statement. I'm crying right now while i type this. My fingers are bleeding\n\tif ID == REMOTE_START:\n\t\t#do start something or something whut\n\t\tprint(\"remote_stuff\")\n\telif ID == REMOTE_FINISH:\n\t\t#again, do ending stuff\n\t\tprint(\"remote_finish: \" + str(dataArray[1]))\n\telif ID == REMOTE_QUIT:\n\t\t#omg those jerks!\n\t\tprint(\"remote_quit\")\n\t\tdisconnect()\n\telif ID == REMOTE_BLOCK:\n\t\t#get their block ifnormation!\n\t\tprint(\"remote_block\")\n\telif ID == REMOTE_BLOCK_TRANSFORM:\n\t\t#sent block information\n\t\tprint(\"block TRANSFORM!!!!!!!!!!!\")\n\t\t#var scale = dataArray[1]\n\t\tvar translation = dataArray[1]\n\t\t#remotePuzzle.otherPuzzle.set_scale(scale)\n\t\tremotePuzzle.otherPuzzle.set_transform(Transform( translation ))\n\t\tremotePuzzle.otherPuzzle.set_translation(Vector3(20, 12, -40))\n\telif ID == REMOTE_BLOCK_UPDATE:\n\t\t#sent an updated block pair\n\t\tprint(\"block update\")\n\t\tvar puzzle = root.get_node( \"Puzzle\" )\n\t\tvar pos = dataArray[1]\n\t\tpuzzle.otherPuzzle.get_node(\"GridView\/GridMan\").forceClickBlock(pos)\n\nfunc sendStart():\n\tif !isNetwork:\n\t\tprint(\"Error sending start packet: not connected!\")\n\t\treturn\n\tvar er = connection.put_var([REMOTE_START])\n\tprint(\"Sending start and got [\" + str(er) + \"]\")\n\nfunc sendBlockUpdate(pos):\n\tif !isNetwork:\n\t\tprint(\"Error sending start packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_BLOCK_UPDATE, pos])\n\nfunc sendFinish(score):\n\tif !isNetwork:\n\t\tprint(\"Error sending finish packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_FINISH, score])\n\nfunc sendQuit():\n\tif !isNetwork:\n\t\tprint(\"Error sending finish packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_QUIT])\n\nfunc sendTransform(translation):\n\tif !isNetwork:\n\t\tprint(\"Cannot send transformation over an unitialized network!\")\n\t\treturn\n\tconnection.put_var([REMOTE_BLOCK_TRANSFORM, translation])\n\tprint(\"it got here\")\n\n\nfunc gotoMenu():\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\troot.add_child( load(\"res:\/\/menus.scn\") )\n\nfunc gotoPuzzle():\n\tvar guiMan = preload(\"GUIManager.gd\").new()\n\tguiMan.gotoPuzzleScene(root, true) # network = true\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"74b6b600ed12358cdea8b72b0787d4bc39dcce7c","subject":"add delay for falling and jumping behaviours","message":"add delay for falling and jumping behaviours\n","repos":"arnaudcoj\/godot_game_jam_2016,arnaudcoj\/godot_game_jam_2016","old_file":"sources\/scripts\/player\/player_controls.gd","new_file":"sources\/scripts\/player\/player_controls.gd","new_contents":"extends Node\n\nonready var climb_area = preload(\"res:\/\/sources\/scripts\/levels\/climb_area.gd\")\n\nonready var player_sprites = get_node(\"sprites\")\nonready var interaction_area = get_node(\"interaction_area\")\n\nconst WALK_SPEED = 200\nconst JUMP_SPEED = 300\nconst RUN_SPEED = 500\nconst CLIMB_SPEED = 100\nconst GROUND_FRICTION_MULTIPLIER = 0.7\nconst GROUND_ACCELERATION_MULTIPLIER = 0.2\nconst AIR_FRICTION_MULTIPLIER = 0.95\nconst AIR_DIRECTION_MULTIPLIER = 0.15\nconst JUMP_TIME_MAX = 0.2\nconst FALLING_JUMP_DELAY = 3\n\nvar jumping = false\nvar jump_time = 0\nvar falling_time = 0\n\nconst IDLE = 0\nconst WALKING = 1\nconst RUNNING = 2\nconst JUMPING = 3\nconst FALLING = 4\nconst CLIMBING = 5\nvar fsm = IDLE\n\nfunc _ready():\n\tset_process(true)\n\t\nfunc _integrate_forces(state):\n\tif fsm == IDLE:\n\t\tintegrate_idle(state)\n\telif fsm == WALKING:\n\t\tintegrate_walking(state)\n\telif fsm == RUNNING:\n\t\tintegrate_running(state)\n\telif fsm == JUMPING:\n\t\tintegrate_jumping(state)\n\telif fsm == FALLING:\n\t\tintegrate_falling(state)\n\telif fsm == CLIMBING:\n\t\tintegrate_climbing(state)\n\t\t\nfunc integrate_idle(state):\n\tplayer_sprites.play(\"stand\")\n\tvar velocity = state.get_linear_velocity()\n\tvelocity.x *= GROUND_FRICTION_MULTIPLIER\n\tstate.set_linear_velocity(velocity)\n\nfunc integrate_walking(state):\n\tplayer_sprites.play(\"walk\")\n\tvar velocity = state.get_linear_velocity()\n\t\n\tif abs(velocity.x) > WALK_SPEED:\n\t\tif Input.is_action_pressed(\"move_left\"):\n\t\t\tplayer_sprites.set_flip_h(true)\n\t\telif Input.is_action_pressed(\"move_right\"):\n\t\t\tplayer_sprites.set_flip_h(false)\n\t\tvelocity.x = clamp(velocity.x * (1 - GROUND_ACCELERATION_MULTIPLIER), -RUN_SPEED, RUN_SPEED)\n\telse:\n\t\tif Input.is_action_pressed(\"move_left\"):\n\t\t\tvelocity.x -= WALK_SPEED * GROUND_ACCELERATION_MULTIPLIER\n\t\t\tplayer_sprites.set_flip_h(true)\n\t\telif Input.is_action_pressed(\"move_right\"):\n\t\t\tvelocity.x += WALK_SPEED * GROUND_ACCELERATION_MULTIPLIER\n\t\t\tplayer_sprites.set_flip_h(false)\n\n\t\tvelocity.x = clamp(velocity.x, -WALK_SPEED, WALK_SPEED)\n\n\tstate.set_linear_velocity(velocity)\n\t\t\nfunc integrate_running(state):\n\tplayer_sprites.play(\"walk\")\n\tvar velocity = state.get_linear_velocity()\n\t\n\tif Input.is_action_pressed(\"move_left\"):\n\t\tvelocity.x -= RUN_SPEED * GROUND_ACCELERATION_MULTIPLIER\n\t\tplayer_sprites.set_flip_h(true)\n\telif Input.is_action_pressed(\"move_right\"):\n\t\tvelocity.x += RUN_SPEED * GROUND_ACCELERATION_MULTIPLIER\n\t\tplayer_sprites.set_flip_h(false)\n\t\t\n\tvelocity.x = clamp(velocity.x, -RUN_SPEED, RUN_SPEED)\n\t\n\tstate.set_linear_velocity(velocity)\n\t\t\nfunc integrate_falling(state):\n\tplayer_sprites.play(\"jump\")\n\tvar velocity = state.get_linear_velocity()\n\t\n\tif velocity.x > -WALK_SPEED && Input.is_action_pressed(\"move_left\"):\n\t\tplayer_sprites.set_flip_h(true)\n\t\tvelocity.x -= WALK_SPEED * AIR_DIRECTION_MULTIPLIER\n\telif velocity.x < WALK_SPEED && Input.is_action_pressed(\"move_right\"):\n\t\tplayer_sprites.set_flip_h(false)\n\t\tvelocity.x += WALK_SPEED * AIR_DIRECTION_MULTIPLIER\n\telif !Input.is_action_pressed(\"move_left\") && !Input.is_action_pressed(\"move_right\"):\n\t\tvelocity.x *= AIR_FRICTION_MULTIPLIER\n\t\t\n\tvelocity.x = clamp(velocity.x, -RUN_SPEED, RUN_SPEED)\n\tstate.set_linear_velocity(velocity)\n\t\nfunc integrate_jumping(state):\n\tplayer_sprites.play(\"jump\")\n\tstate.set_linear_velocity(Vector2(state.get_linear_velocity().x,-JUMP_SPEED))\n\nfunc integrate_climbing(state):\n\tplayer_sprites.play(\"jump\")\n\tvar velocity = state.get_linear_velocity()\n\t\n\tif Input.is_action_pressed(\"move_up\"):\n\t\tvelocity.y = -CLIMB_SPEED\n\telif Input.is_action_pressed(\"move_down\"):\n\t\tvelocity.y = CLIMB_SPEED\n\telse:\n\t\tvelocity.y = 0\n\t\n\tif Input.is_action_pressed(\"move_left\"):\n\t\tvelocity.x = - WALK_SPEED * GROUND_ACCELERATION_MULTIPLIER\n\t\tplayer_sprites.set_flip_h(true)\n\telif Input.is_action_pressed(\"move_right\"):\n\t\tvelocity.x = WALK_SPEED * GROUND_ACCELERATION_MULTIPLIER\n\t\tplayer_sprites.set_flip_h(false)\n\telse:\n\t\tvelocity.x = 0\n\t\n\tstate.set_linear_velocity(velocity)\n\nfunc _process(delta):\n\tvar can_climb = false\n\t\n\tvar overlapping_areas = interaction_area.get_overlapping_areas()\n\t\n\tfor area in overlapping_areas:\n\t\tif can_climb:\n\t\t\tbreak\n\t\tcan_climb = area extends climb_area\n\n\tif fsm == IDLE:\n\t\tif Input.is_action_pressed(\"jump\"):\n\t\t\tfsm = JUMPING\n\t\t\tprint(\"idle -> jump\")\n\t\telif Input.is_action_pressed(\"move_left\") || Input.is_action_pressed(\"move_right\"):\n\t\t\tfsm = WALKING\n\t\t\tprint(\"idle -> walk\")\n\t\telif can_climb && ((Input.is_action_pressed(\"move_up\") && !test_motion(Vector2(0,-5))) || (Input.is_action_pressed(\"move_down\") && !test_motion(Vector2(0,5)))):\n\t\t\t#check if can climb and if thera are obstacles where we want to climb\n\t\t\tfsm = CLIMBING\n\t\t\tprint(\"idle -> climb\")\n\t\telif !test_motion(Vector2(0,5)):\n\t\t\tfsm = FALLING\n\t\t\tprint(\"idle -> fall\")\n\t\t\t\n\telif fsm == WALKING:\n\t\tif !Input.is_action_pressed(\"move_left\") && !Input.is_action_pressed(\"move_right\"):\n\t\t\tfsm = IDLE\n\t\t\tprint(\"walk -> idle\")\n\t\telif Input.is_action_pressed(\"run\"):\n\t\t\tfsm = RUNNING\n\t\t\tprint(\"walk -> run\")\n\t\telif Input.is_action_pressed(\"jump\"):\n\t\t\tfsm = JUMPING\n\t\t\tprint(\"walk -> jump\")\n\t\telif can_climb && ((Input.is_action_pressed(\"move_up\") && !test_motion(Vector2(0,-5))) || (Input.is_action_pressed(\"move_down\") && !test_motion(Vector2(0,5)))):\n\t\t\tfsm = CLIMBING\n\t\t\tprint(\"walk -> climb\")\n\t\telif !test_motion(Vector2(0,5)):\n\t\t\tfsm = FALLING\n\t\t\tprint(\"walk -> fall\")\n\t\t\t\n\telif fsm == RUNNING:\n\t\tif !Input.is_action_pressed(\"run\"):\n\t\t\tfsm = WALKING\n\t\t\tprint(\"run -> walk\")\n\t\telif !Input.is_action_pressed(\"move_left\") && !Input.is_action_pressed(\"move_right\"):\n\t\t\tfsm = IDLE\n\t\t\tprint(\"run -> idle\")\n\t\telif Input.is_action_pressed(\"jump\"):\n\t\t\tfsm = JUMPING\n\t\t\tprint(\"run -> jump\")\n\t\telif can_climb && ((Input.is_action_pressed(\"move_up\") && !test_motion(Vector2(0,-5))) || (Input.is_action_pressed(\"move_down\") && !test_motion(Vector2(0,5)))):\n\t\t\t#check if can climb and if thera are obstacles where we want to climb\n\t\t\tfsm = CLIMBING\n\t\t\tprint(\"run -> climb\")\n\t\telif !test_motion(Vector2(0,5)):\n\t\t\tfsm = FALLING\n\t\t\tprint(\"run -> fall\")\n\t\t\t\n\telif fsm == CLIMBING:\n\t\tif !can_climb:\n\t\t\tfsm = FALLING\n\t\t\tprint(\"climb -> fall\")\n\t\telif Input.is_action_pressed(\"jump\"):\n\t\t\tfsm = JUMPING\n\t\t\tprint(\"climb -> jump\")\n\t\telif test_motion(Vector2(0,5)):\n\t\t\tfsm = IDLE\n\t\t\tprint(\"climb -> idle\")\n\t\t\t\n\telif fsm == FALLING:\n\t\tfalling_time += delta\n\t\tif can_climb && ((Input.is_action_pressed(\"move_up\") && !test_motion(Vector2(0,-5))) || (Input.is_action_pressed(\"move_down\") && !test_motion(Vector2(0,5)))):\n\t\t\t#check if can climb and if thera are obstacles where we want to climb\n\t\t\tfsm = CLIMBING\n\t\t\tfalling_time = 0\n\t\t\tprint(\"fall -> climb\")\n\t\telif test_motion(Vector2(0,5)):\n\t\t\tfsm = IDLE\n\t\t\tfalling_time = 0\n\t\t\tprint(\"fall -> idle\")\n\t\telif Input.is_action_pressed(\"jump\") && falling_time < FALLING_JUMP_DELAY:\n\t\t\tfsm = JUMPING\n\t\t\tprint(\"fall -> jump\")\n\t\t\t\n\telif fsm == JUMPING:\n\t\tjump_time += delta\n\t\tif !Input.is_action_pressed(\"jump\") || jump_time > JUMP_TIME_MAX:\n\t\t\tfsm = FALLING\n\t\t\tjump_time = 0\n\t\t\tfalling_time = FALLING_JUMP_DELAY\n\t\t\tprint(\"jump -> fall\")\n","old_contents":"extends Node\n\nonready var climb_area = preload(\"res:\/\/sources\/scripts\/levels\/climb_area.gd\")\n\nonready var player_sprites = get_node(\"sprites\")\nonready var interaction_area = get_node(\"interaction_area\")\n\nconst WALK_SPEED = 200\nconst JUMP_SPEED = 400\nconst RUN_SPEED = 500\nconst CLIMB_SPEED = 100\nconst GROUND_FRICTION_MULTIPLIER = 0.7\nconst GROUND_ACCELERATION_MULTIPLIER = 0.2\nconst AIR_FRICTION_MULTIPLIER = 0.95\nconst AIR_DIRECTION_MULTIPLIER = 0.15\n\nvar jumping = false\n\nconst IDLE = 0\nconst WALKING = 1\nconst RUNNING = 2\nconst JUMPING = 3\nconst FALLING = 4\nconst CLIMBING = 5\nvar fsm = IDLE\n\nfunc _ready():\n\tset_process(true)\n\t\nfunc _integrate_forces(state):\n\tif fsm == IDLE:\n\t\tintegrate_idle(state)\n\telif fsm == WALKING:\n\t\tintegrate_walking(state)\n\telif fsm == RUNNING:\n\t\tintegrate_running(state)\n\telif fsm == JUMPING:\n\t\tintegrate_jumping(state)\n\telif fsm == FALLING:\n\t\tintegrate_falling(state)\n\telif fsm == CLIMBING:\n\t\tintegrate_climbing(state)\n\t\t\nfunc integrate_idle(state):\n\tplayer_sprites.play(\"stand\")\n\tvar velocity = state.get_linear_velocity()\n\tvelocity.x *= GROUND_FRICTION_MULTIPLIER\n\tstate.set_linear_velocity(velocity)\n\nfunc integrate_walking(state):\n\tplayer_sprites.play(\"walk\")\n\tvar velocity = state.get_linear_velocity()\n\t\n\tif abs(velocity.x) > WALK_SPEED:\n\t\tif Input.is_action_pressed(\"move_left\"):\n\t\t\tplayer_sprites.set_flip_h(true)\n\t\telif Input.is_action_pressed(\"move_right\"):\n\t\t\tplayer_sprites.set_flip_h(false)\n\t\tvelocity.x = clamp(velocity.x * (1 - GROUND_ACCELERATION_MULTIPLIER), -RUN_SPEED, RUN_SPEED)\n\telse:\n\t\tif Input.is_action_pressed(\"move_left\"):\n\t\t\tvelocity.x -= WALK_SPEED * GROUND_ACCELERATION_MULTIPLIER\n\t\t\tplayer_sprites.set_flip_h(true)\n\t\telif Input.is_action_pressed(\"move_right\"):\n\t\t\tvelocity.x += WALK_SPEED * GROUND_ACCELERATION_MULTIPLIER\n\t\t\tplayer_sprites.set_flip_h(false)\n\n\t\tvelocity.x = clamp(velocity.x, -WALK_SPEED, WALK_SPEED)\n\n\tstate.set_linear_velocity(velocity)\n\t\t\nfunc integrate_running(state):\n\tplayer_sprites.play(\"walk\")\n\tvar velocity = state.get_linear_velocity()\n\t\n\tif Input.is_action_pressed(\"move_left\"):\n\t\tvelocity.x -= RUN_SPEED * GROUND_ACCELERATION_MULTIPLIER\n\t\tplayer_sprites.set_flip_h(true)\n\telif Input.is_action_pressed(\"move_right\"):\n\t\tvelocity.x += RUN_SPEED * GROUND_ACCELERATION_MULTIPLIER\n\t\tplayer_sprites.set_flip_h(false)\n\t\t\n\tvelocity.x = clamp(velocity.x, -RUN_SPEED, RUN_SPEED)\n\t\n\tstate.set_linear_velocity(velocity)\n\t\t\nfunc integrate_falling(state):\n\tplayer_sprites.play(\"jump\")\n\tvar velocity = state.get_linear_velocity()\n\t\n\tif velocity.x > -WALK_SPEED && Input.is_action_pressed(\"move_left\"):\n\t\tplayer_sprites.set_flip_h(true)\n\t\tvelocity.x -= WALK_SPEED * AIR_DIRECTION_MULTIPLIER\n\telif velocity.x < WALK_SPEED && Input.is_action_pressed(\"move_right\"):\n\t\tplayer_sprites.set_flip_h(false)\n\t\tvelocity.x += WALK_SPEED * AIR_DIRECTION_MULTIPLIER\n\telif !Input.is_action_pressed(\"move_left\") && !Input.is_action_pressed(\"move_right\"):\n\t\tvelocity.x *= AIR_FRICTION_MULTIPLIER\n\t\t\n\tvelocity.x = clamp(velocity.x, -RUN_SPEED, RUN_SPEED)\n\tstate.set_linear_velocity(velocity)\n\t\nfunc integrate_jumping(state):\n\tplayer_sprites.play(\"jump\")\n\tstate.set_linear_velocity(Vector2(state.get_linear_velocity().x,-JUMP_SPEED))\n\nfunc integrate_climbing(state):\n\tplayer_sprites.play(\"jump\")\n\tvar velocity = state.get_linear_velocity()\n\t\n\tif Input.is_action_pressed(\"move_up\"):\n\t\tvelocity.y = -CLIMB_SPEED\n\telif Input.is_action_pressed(\"move_down\"):\n\t\tvelocity.y = CLIMB_SPEED\n\telse:\n\t\tvelocity.y = 0\n\t\n\tif Input.is_action_pressed(\"move_left\"):\n\t\tvelocity.x = - WALK_SPEED * GROUND_ACCELERATION_MULTIPLIER\n\t\tplayer_sprites.set_flip_h(true)\n\telif Input.is_action_pressed(\"move_right\"):\n\t\tvelocity.x = WALK_SPEED * GROUND_ACCELERATION_MULTIPLIER\n\t\tplayer_sprites.set_flip_h(false)\n\telse:\n\t\tvelocity.x = 0\n\t\n\tstate.set_linear_velocity(velocity)\n\nfunc _process(delta):\n\tvar can_climb = false\n\t\n\tvar overlapping_areas = interaction_area.get_overlapping_areas()\n\t\n\tfor area in overlapping_areas:\n\t\tif can_climb:\n\t\t\tbreak\n\t\tcan_climb = area extends climb_area\n\n\tif fsm == IDLE:\n\t\tif Input.is_action_pressed(\"jump\"):\n\t\t\tfsm = JUMPING\n\t\t\tprint(\"idle -> jump\")\n\t\telif Input.is_action_pressed(\"move_left\") || Input.is_action_pressed(\"move_right\"):\n\t\t\tfsm = WALKING\n\t\t\tprint(\"idle -> walk\")\n\t\telif can_climb && ((Input.is_action_pressed(\"move_up\") && !test_motion(Vector2(0,-5))) || (Input.is_action_pressed(\"move_down\") && !test_motion(Vector2(0,5)))):\n\t\t\t#check if can climb and if thera are obstacles where we want to climb\n\t\t\tfsm = CLIMBING\n\t\t\tprint(\"idle -> climb\")\n\t\telif !test_motion(Vector2(0,5)):\n\t\t\tfsm = FALLING\n\t\t\tprint(\"idle -> fall\")\n\t\t\t\n\telif fsm == WALKING:\n\t\tif !Input.is_action_pressed(\"move_left\") && !Input.is_action_pressed(\"move_right\"):\n\t\t\tfsm = IDLE\n\t\t\tprint(\"walk -> idle\")\n\t\telif Input.is_action_pressed(\"run\"):\n\t\t\tfsm = RUNNING\n\t\t\tprint(\"walk -> run\")\n\t\telif Input.is_action_pressed(\"jump\"):\n\t\t\tfsm = JUMPING\n\t\t\tprint(\"walk -> jump\")\n\t\telif can_climb && ((Input.is_action_pressed(\"move_up\") && !test_motion(Vector2(0,-5))) || (Input.is_action_pressed(\"move_down\") && !test_motion(Vector2(0,5)))):\n\t\t\tfsm = CLIMBING\n\t\t\tprint(\"walk -> climb\")\n\t\telif !test_motion(Vector2(0,5)):\n\t\t\tfsm = FALLING\n\t\t\tprint(\"walk -> fall\")\n\t\t\t\n\telif fsm == RUNNING:\n\t\tif !Input.is_action_pressed(\"run\"):\n\t\t\tfsm = WALKING\n\t\t\tprint(\"run -> walk\")\n\t\telif !Input.is_action_pressed(\"move_left\") && !Input.is_action_pressed(\"move_right\"):\n\t\t\tfsm = IDLE\n\t\t\tprint(\"run -> idle\")\n\t\telif Input.is_action_pressed(\"jump\"):\n\t\t\tfsm = JUMPING\n\t\t\tprint(\"run -> jump\")\n\t\telif can_climb && ((Input.is_action_pressed(\"move_up\") && !test_motion(Vector2(0,-5))) || (Input.is_action_pressed(\"move_down\") && !test_motion(Vector2(0,5)))):\n\t\t\t#check if can climb and if thera are obstacles where we want to climb\n\t\t\tfsm = CLIMBING\n\t\t\tprint(\"run -> climb\")\n\t\telif !test_motion(Vector2(0,5)):\n\t\t\tfsm = FALLING\n\t\t\tprint(\"run -> fall\")\n\t\t\t\n\telif fsm == CLIMBING:\n\t\tif !can_climb:\n\t\t\tfsm = FALLING\n\t\t\tprint(\"climb -> fall\")\n\t\telif Input.is_action_pressed(\"jump\"):\n\t\t\tfsm = JUMPING\n\t\t\tprint(\"climb -> jump\")\n\t\telif test_motion(Vector2(0,5)):\n\t\t\tfsm = IDLE\n\t\t\tprint(\"climb -> idle\")\n\t\t\t\n\telif fsm == FALLING:\n\t\tif can_climb && ((Input.is_action_pressed(\"move_up\") && !test_motion(Vector2(0,-5))) || (Input.is_action_pressed(\"move_down\") && !test_motion(Vector2(0,5)))):\n\t\t\t#check if can climb and if thera are obstacles where we want to climb\n\t\t\tfsm = CLIMBING\n\t\t\tprint(\"fall -> climb\")\n\t\telif test_motion(Vector2(0,5)):\n\t\t\tfsm = IDLE\n\t\t\tprint(\"fall -> idle\")\n\t\t\t\n\telif fsm == JUMPING:\n\t\tif !Input.is_action_pressed(\"jump\"):\n\t\t\tfsm = FALLING\n\t\t\tprint(\"jump -> fall\")\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"e1ed016ff1d9145c4c6cdd06e227fdc108218e5b","subject":"Better ship movement indication on hud","message":"Better ship movement indication on hud\n","repos":"P1X-in\/boctok","old_file":"scripts\/ship.gd","new_file":"scripts\/ship.gd","new_contents":"extends RigidBody2D\n\nvar ROTATE_STEP = 6\nvar ROTATE_THRESHOLD = 6.28\n\nvar ACCELERATION = 300\nvar BOOST = 1500\nvar BOOST_FUEL = 6\n\nvar GRAVITY_FACTOR = 100000000000\nvar MAX_FUEL = 100\n\nvar rotation = 0\nvar current_acceleration = Vector2(0, 0)\nvar current_gravity = Vector2(0, 0)\n\nvar engines = []\n\nvar fuel = 100\n\nvar do_rotate = false\nvar rotate_factor = 1\nvar accelerate = false\nvar accelerate_factor = 1\nvar boost = false\n\nfunc _integrate_forces(s):\n var lv = s.get_linear_velocity()\n var step = s.get_step()\n self.current_acceleration = lv\n\n var engines_on = {\"Main\" : false, \"Left\": false, \"Right\" : false}\n\n if self.do_rotate:\n self.rotation = self.rotation + self.ROTATE_STEP * step * self.rotate_factor\n if self.rotation > self.ROTATE_THRESHOLD:\n self.rotation = self.rotation - self.ROTATE_THRESHOLD\n if self.rotation < 0:\n self.rotation = self.rotation + self.ROTATE_THRESHOLD\n if self.rotate_factor < 0:\n engines_on[\"Left\"] = true\n elif self.rotate_factor > 0:\n engines_on[\"Right\"] = true\n self.set_rot(self.rotation)\n\n var acceleration_vector = Vector2(0,-1).rotated(self.rotation)\n\n if self.accelerate and self.fuel > step * 10:\n lv = lv + acceleration_vector * self.ACCELERATION * step * self.accelerate_factor\n engines_on[\"Main\"] = true\n self.fuel = self.fuel - step * 10\n elif self.boost and self.fuel > step * 10 * self.BOOST_FUEL:\n lv = lv + acceleration_vector * self.BOOST * step\n engines_on[\"Main\"] = true\n engines_on[\"Left\"] = true\n engines_on[\"Right\"] = true\n self.fuel = self.fuel - step * 10 * self.BOOST_FUEL\n\n self.current_gravity = s.get_total_gravity() * step * self.GRAVITY_FACTOR\n lv += self.current_gravity\n self.__engines_start(engines_on)\n s.set_linear_velocity(lv)\n\nfunc __engines_start(engines):\n for engine in engines:\n if engines[engine] == true:\n self.engines[engine].set_emitting(true)\n\nfunc _ready():\n self.set_mode(self.MODE_CHARACTER)\n var engines = self.get_node(\"Engines\")\n self.engines = {\n \"Main\" : engines.get_node(\"Main\"),\n \"Left\" : engines.get_node(\"Left\"),\n \"Right\" : engines.get_node(\"Right\"),\n }\n","old_contents":"extends RigidBody2D\n\nvar ROTATE_STEP = 6\nvar ROTATE_THRESHOLD = 6.28\n\nvar ACCELERATION = 300\nvar BOOST = 1500\nvar BOOST_FUEL = 6\n\nvar GRAVITY_FACTOR = 100000000000\nvar MAX_FUEL = 100\n\nvar rotation = 0\nvar current_acceleration = Vector2(0, 0)\nvar current_gravity = Vector2(0, 0)\n\nvar engines = []\n\nvar fuel = 100\n\nvar do_rotate = false\nvar rotate_factor = 1\nvar accelerate = false\nvar accelerate_factor = 1\nvar boost = false\n\nfunc _integrate_forces(s):\n var lv = s.get_linear_velocity()\n var step = s.get_step()\n\n var engines_on = {\"Main\" : false, \"Left\": false, \"Right\" : false}\n\n if self.do_rotate:\n self.rotation = self.rotation + self.ROTATE_STEP * step * self.rotate_factor\n if self.rotation > self.ROTATE_THRESHOLD:\n self.rotation = self.rotation - self.ROTATE_THRESHOLD\n if self.rotation < 0:\n self.rotation = self.rotation + self.ROTATE_THRESHOLD\n if self.rotate_factor < 0:\n engines_on[\"Left\"] = true\n elif self.rotate_factor > 0:\n engines_on[\"Right\"] = true\n self.set_rot(self.rotation)\n\n var acceleration_vector = Vector2(0,-1).rotated(self.rotation)\n\n if self.accelerate and self.fuel > step * 10:\n lv = lv + acceleration_vector * self.ACCELERATION * step * self.accelerate_factor\n engines_on[\"Main\"] = true\n self.fuel = self.fuel - step * 10\n elif self.boost and self.fuel > step * 10 * self.BOOST_FUEL:\n lv = lv + acceleration_vector * self.BOOST * step\n engines_on[\"Main\"] = true\n engines_on[\"Left\"] = true\n engines_on[\"Right\"] = true\n self.fuel = self.fuel - step * 10 * self.BOOST_FUEL\n #elif self.fuel < 10:\n # self.fuel = self.fuel + step * 20\n # if self.fuel > 10:\n # self.fuel = 10\n\n self.current_gravity = s.get_total_gravity() * step * self.GRAVITY_FACTOR\n lv += self.current_gravity\n self.current_acceleration = lv\n self.__engines_start(engines_on)\n s.set_linear_velocity(lv)\n\nfunc __engines_start(engines):\n for engine in engines:\n if engines[engine] == true:\n self.engines[engine].set_emitting(true)\n\nfunc _ready():\n self.set_mode(self.MODE_CHARACTER)\n var engines = self.get_node(\"Engines\")\n self.engines = {\n \"Main\" : engines.get_node(\"Main\"),\n \"Left\" : engines.get_node(\"Left\"),\n \"Right\" : engines.get_node(\"Right\"),\n }\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"c1b74e3771595df981da14fd8a7e52fe46d438de","subject":"fixed node names","message":"fixed node names\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Network.gd","new_file":"src\/scripts\/Network.gd","new_contents":"# Core networking\n\nextends Node\n\nconst REMOTE_FINISH = 0\nconst REMOTE_START = 1\nconst REMOTE_QUIT = 2\nconst REMOTE_BLOCK = 4\nconst REMOTE_BLOCK_TRANSFORM = 5\nconst REMOTE_BLOCK_UPDATE = 6\n\nvar port = 54321\nvar root\nvar isNetwork\nvar isHost\nvar isClient = false\nvar server\nvar client\nvar connection\nvar proxy\n\nvar remotePuzzle\n\n#Store the peer stream used by both the lcient and server\nvar stream\n\nfunc _ready():\n\tisNetwork = false\n\tisHost = false\n\tvar label = get_tree().get_root().get_node(\"GUIManager\/OptionsMenu\/Panel\/PortField\/LineEdit\")\n\tif not label == null:\n\t\tlabel.set_text(str(port))\n\nfunc setPort(pt):\n\tport = pt;\n\nfunc connectTo(ip, pt):\n\tisClient = true #just to tell if it's doing something :S\n\tconnection = PacketPeerStream.new()\n\tstream = StreamPeerTCP.new()\n\tconnection.set_stream_peer(stream)\n\tstream.connect(ip, pt);\n\n\tif stream.get_status() == stream.STATUS_CONNECTED or stream.get_status() == stream.STATUS_CONNECTING:\n\t\tprint(\"Connecting to \" + ip + \":\" + str(port));\n\t\tproxy.set_process(true)\n\t\t#leave is_network as false to indicate we're still waiting for connection\n\n\nfunc host(pt):\n\tserver = TCP_Server.new()\n\t#connection = PacketPeerStream.new()\n\tisHost = true\n\tprint(\"Starting listening server on port \" + str(pt))\n\tif server.listen(pt) == 0:\n\t\tproxy.set_process(true)\n\t\tprint(\"Listening...\")\n\telse:\n\t\tprint(\"Failed to start server on port \" + str(pt));\n\nfunc _process(delta):\n\tif (isHost):\n\t\t#server processing stuff\n\t\t#use isNetwork to determine if we're still listening\n\t\tif !isNetwork:\n\t\t\tif server.is_connection_available():\n\t\t\t\tstream = server.take_connection()\n\t\t\t\tconnection = PacketPeerStream.new()\n\t\t\t\tconnection.set_stream_peer(stream)\n\t\t\t\tprint(\"Connecting with player...\")\n\t\t\t\tisNetwork = true\n\t\t\t\tserver.stop()\n\n\t\t\t\tgotoPuzzle()\n\n\t\t\t\tremotePuzzle = root.get_node(\"Puzzle\")\n\t\t\t\t#MAKE CALL TO PUZZLE SELECTER\n\t\telse: #not listening anymore, have a client\n\t\t\t#do quick check to make sure we're still\n\t\t\t#connected\n\t\t\tif !stream.is_connected():\n\t\t\t\tprint(\"Lost Connection!\");\n\t\t\t\tisNetwork = false\n\t\t\t\tproxy.set_process(false)\n\t\t\t\t#QUIT GAME\n\t\t\t\treturn\n\t\t\t#check if we have any data\n\t\t\tif connection.get_available_packet_count() > 0:\n\t\t\t\t#have to be careful about more than 1 packet per frame\n\t\t\t\tfor i in range(connection.get_available_packet_count()):\n\t\t\t\t\tvar dataArray = connection.get_var()\n\t\t\t\t\tProcessServerData(dataArray)\n\n\telse:\n\t\t#client processing stuff\n\t\tif !isNetwork:\n\t\t\t#Still waiting for connection confirmed\n\t\t\tif stream.get_status() == stream.STATUS_CONNECTED:\n\t\t\t\tprint(\"Connection established!\")\n\t\t\t\tisNetwork = true\n\n\t\t\t\tgotoPuzzle()\n\n\t\t\t\tremotePuzzle = root.get_node(\"Puzzle\")\n\t\t\t\treturn\n\t\t\tif stream.get_status() == stream.STATUS_NONE or stream.get_status() == stream.STATUS_ERROR:\n\t\t\t\tprint(\"Error establishing connection!\")\n\t\t\t\tproxy.set_process(false)\n\t\t\t\treturn\n\t\t\t\t#stop running process loop, cause we have no connection\n\t\telse:\n\t\t\t#connecton established and confirmed. Do regular data processing\n\t\t\t#check if we have any data\n\t\t\tif connection.get_available_packet_count() > 0:\n\t\t\t\tfor i in range(connection.get_available_packet_count()):\n\t\t\t\t\tvar dataArray = connection.get_var()\n\t\t\t\t\tProcessServerData(dataArray)\n\t\t\t\t\t#Call the server process script cuase it's peer to peer and we have the same functions!\n\n\nfunc disconnect():\n\t#need to do lots of things! If the server is open and listening, but has no connection just stop listening!\n\tif isHost and !isNetwork:\n\t\t#this means we're waiting for connection still\n\t\tserver.stop()\n\t\tprint(\"closing server listener!\")\n\telif isHost and isNetwork:\n\t\t#have connections. Need to send them stop packet, and close connection\n\t\tconnection.put_var([REMOTE_QUIT])\n\t\tstream.disconnect()\n\t\tprint(\"Closing connection to remote player...\")\n\telif !isHost and !isNetwork:\n\t\tstream.disconnect()\n\t\tprint(\"Halting connection request...\")\n\telif !isHost and isNetwork:\n\t\t#connected to server already\n\t\tstream.disconnect()\n\t\tprint(\"Disconnecting from server...\")\n\n\t#no matter where we wre before disconnect, set network to false and return to beginning screen!\n\tisNetwork = false;\n\tisHost = false;\n\tisClient = false;\n\n\tproxy.set_process(false)\n\n\n\tgotoMenu()\n\n\nfunc ProcessServerData(dataArray):\n\t#have an array of data. First element should be identifying int\n\tvar ID = dataArray[0]\n\tprint(ID)\n\t#no switch statement. I'm crying right now while i type this. My fingers are bleeding\n\tif ID == REMOTE_START:\n\t\t#do start something or something whut\n\t\tprint(\"remote_stuff\")\n\telif ID == REMOTE_FINISH:\n\t\t#again, do ending stuff\n\t\tprint(\"remote_finish: \" + str(dataArray[1]))\n\telif ID == REMOTE_QUIT:\n\t\t#omg those jerks!\n\t\tprint(\"remote_quit\")\n\t\tdisconnect()\n\telif ID == REMOTE_BLOCK:\n\t\t#get their block ifnormation!\n\t\tprint(\"remote_block\")\n\telif ID == REMOTE_BLOCK_TRANSFORM:\n\t\t#sent block information\n\t\tprint(\"block TRANSFORM!!!!!!!!!!!\")\n\t\t#var scale = dataArray[1]\n\t\tvar translation = dataArray[1]\n\t\t#remotePuzzle.otherPuzzle.set_scale(scale)\n\t\tremotePuzzle.otherPuzzle.set_transform(Transform( translation ))\n\t\tremotePuzzle.otherPuzzle.set_translation(Vector3(20, 12, -40))\n\telif ID == REMOTE_BLOCK_UPDATE:\n\t\t#sent an updated block pair\n\t\tprint(\"block update\")\n\t\tvar puzzle = root.get_node( \"Puzzle\" )\n\t\tvar pos = dataArray[1]\n\t\tpuzzle.otherPuzzle.get_node(\"GridView\/GridMan\").forceClickBlock(pos)\n\nfunc sendStart():\n\tif !isNetwork:\n\t\tprint(\"Error sending start packet: not connected!\")\n\t\treturn\n\tvar er = connection.put_var([REMOTE_START])\n\tprint(\"Sending start and got [\" + str(er) + \"]\")\n\nfunc sendBlockUpdate(pos):\n\tif !isNetwork:\n\t\tprint(\"Error sending start packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_BLOCK_UPDATE, pos])\n\nfunc sendFinish(score):\n\tif !isNetwork:\n\t\tprint(\"Error sending finish packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_FINISH, score])\n\nfunc sendQuit():\n\tif !isNetwork:\n\t\tprint(\"Error sending finish packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_QUIT])\n\nfunc sendTransform(translation):\n\tif !isNetwork:\n\t\tprint(\"Cannot send transformation over an unitialized network!\")\n\t\treturn\n\tconnection.put_var([REMOTE_BLOCK_TRANSFORM, translation])\n\tprint(\"it got here\")\n\n\nfunc gotoMenu():\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\troot.add_child( load(\"res:\/\/menus.scn\") )\n\nfunc gotoPuzzle():\n\tvar guiMan = preload(\"GUIManager.gd\").new()\n\tguiMan.gotoPuzzleScene(root, true) # network = true\n","old_contents":"# Core networking\n\nextends Node\n\nconst REMOTE_FINISH = 0\nconst REMOTE_START = 1\nconst REMOTE_QUIT = 2\nconst REMOTE_BLOCK = 4\nconst REMOTE_BLOCK_TRANSFORM = 5\nconst REMOTE_BLOCK_UPDATE = 6\n\nvar port = 54321\nvar root\nvar isNetwork\nvar isHost\nvar isClient = false\nvar server\nvar client\nvar connection\nvar proxy\n\nvar remotePuzzle\n\n#Store the peer stream used by both the lcient and server\nvar stream\n\nfunc _ready():\n\tisNetwork = false\n\tisHost = false\n\tvar label = get_tree().get_root().get_node(\"GUIManager\/OptionsMenu\/Panel\/PortField\/LineEdit\")\n\tif not label == null:\n\t\tlabel.set_text(str(port))\n\nfunc setPort(pt):\n\tport = pt;\n\nfunc connectTo(ip, pt):\n\tisClient = true #just to tell if it's doing something :S\n\tconnection = PacketPeerStream.new()\n\tstream = StreamPeerTCP.new()\n\tconnection.set_stream_peer(stream)\n\tstream.connect(ip, pt);\n\t\n\tif stream.get_status() == stream.STATUS_CONNECTED or stream.get_status() == stream.STATUS_CONNECTING:\n\t\tprint(\"Connecting to \" + ip + \":\" + str(port));\n\t\tproxy.set_process(true)\n\t\t#leave is_network as false to indicate we're still waiting for connection\n\t\n\t\nfunc host(pt):\n\tserver = TCP_Server.new()\n\t#connection = PacketPeerStream.new()\n\tisHost = true\n\tprint(\"Starting listening server on port \" + str(pt))\n\tif server.listen(pt) == 0:\n\t\tproxy.set_process(true)\n\t\tprint(\"Listening...\")\n\telse:\n\t\tprint(\"Failed to start server on port \" + str(pt));\n\nfunc _process(delta):\n\tif (isHost):\n\t\t#server processing stuff\n\t\t#use isNetwork to determine if we're still listening\n\t\tif !isNetwork:\n\t\t\tif server.is_connection_available():\n\t\t\t\tstream = server.take_connection()\n\t\t\t\tconnection = PacketPeerStream.new()\n\t\t\t\tconnection.set_stream_peer(stream)\n\t\t\t\tprint(\"Connecting with player...\")\n\t\t\t\tisNetwork = true\n\t\t\t\tserver.stop()\n\t\t\t\tchangeScene(\"res:\/\/puzzle.scn\")\n\t\t\t\tremotePuzzle = root.get_node(\"Spatial\")\n\t\t\t\t#MAKE CALL TO PUZZLE SELECTER\n\t\telse: #not listening anymore, have a client\n\t\t\t#do quick check to make sure we're still\n\t\t\t#connected\n\t\t\tif !stream.is_connected():\n\t\t\t\tprint(\"Lost Connection!\");\n\t\t\t\tisNetwork = false\n\t\t\t\tproxy.set_process(false)\n\t\t\t\t#QUIT GAME\n\t\t\t\treturn\n\t\t\t#check if we have any data\n\t\t\tif connection.get_available_packet_count() > 0:\n\t\t\t\t#have to be careful about more than 1 packet per frame\n\t\t\t\tfor i in range(connection.get_available_packet_count()):\n\t\t\t\t\tvar dataArray = connection.get_var()\n\t\t\t\t\tProcessServerData(dataArray)\n\t\t\t\t\t\n\telse:\n\t\t#client processing stuff\n\t\tif !isNetwork:\n\t\t\t#Still waiting for connection confirmed\n\t\t\tif stream.get_status() == stream.STATUS_CONNECTED:\n\t\t\t\tprint(\"Connection established!\")\n\t\t\t\tisNetwork = true\n\t\t\t\tchangeScene(\"res:\/\/puzzle.scn\")\n\t\t\t\tremotePuzzle = root.get_node(\"Spatial\")\n\t\t\t\treturn\n\t\t\tif stream.get_status() == stream.STATUS_NONE or stream.get_status() == stream.STATUS_ERROR:\n\t\t\t\tprint(\"Error establishing connection!\")\n\t\t\t\tproxy.set_process(false)\n\t\t\t\treturn\n\t\t\t\t#stop running process loop, cause we have no connection\n\t\telse:\n\t\t\t#connecton established and confirmed. Do regular data processing\n\t\t\t#check if we have any data\n\t\t\tif connection.get_available_packet_count() > 0:\n\t\t\t\tfor i in range(connection.get_available_packet_count()):\n\t\t\t\t\tvar dataArray = connection.get_var()\n\t\t\t\t\tProcessServerData(dataArray)\n\t\t\t\t\t#Call the server process script cuase it's peer to peer and we have the same functions!\n\n\nfunc disconnect():\n\t#need to do lots of things! If the server is open and listening, but has no connection just stop listening!\n\tif isHost and !isNetwork:\n\t\t#this means we're waiting for connection still\n\t\tserver.stop()\n\t\tprint(\"closing server listener!\")\n\telif isHost and isNetwork:\n\t\t#have connections. Need to send them stop packet, and close connection\n\t\tconnection.put_var([REMOTE_QUIT])\n\t\tstream.disconnect()\n\t\tprint(\"Closing connection to remote player...\")\n\telif !isHost and !isNetwork:\n\t\tstream.disconnect()\n\t\tprint(\"Halting connection request...\")\n\telif !isHost and isNetwork:\n\t\t#connected to server already\n\t\tstream.disconnect()\n\t\tprint(\"Disconnecting from server...\")\n\t\n\t#no matter where we wre before disconnect, set network to false and return to beginning screen!\n\tisNetwork = false;\n\tisHost = false;\n\tisClient = false;\n\t\n\tproxy.set_process(false)\n\t\n\tchangeScene(\"res:\/\/menus.scn\")\n\n\n\nfunc ProcessServerData(dataArray):\n\t#have an array of data. First element should be identifying int\n\tvar ID = dataArray[0]\n\tprint(ID)\n\t#no switch statement. I'm crying right now while i type this. My fingers are bleeding\n\tif ID == REMOTE_START:\n\t\t#do start something or something whut\n\t\tprint(\"remote_stuff\")\n\telif ID == REMOTE_FINISH:\n\t\t#again, do ending stuff\n\t\tprint(\"remote_finish: \" + str(dataArray[1]))\n\telif ID == REMOTE_QUIT:\n\t\t#omg those jerks!\n\t\tprint(\"remote_quit\")\n\t\tdisconnect()\n\telif ID == REMOTE_BLOCK:\n\t\t#get their block ifnormation!\n\t\tprint(\"remote_block\")\n\telif ID == REMOTE_BLOCK_TRANSFORM:\n\t\t#sent block information\n\t\tprint(\"block TRANSFORM!!!!!!!!!!!\")\n\t\t#var scale = dataArray[1]\n\t\tvar translation = dataArray[1]\n\t\t#remotePuzzle.otherPuzzle.set_scale(scale)\n\t\tremotePuzzle.otherPuzzle.set_transform(Transform( translation ))\n\t\tremotePuzzle.otherPuzzle.set_translation(Vector3(20, 12, -40))\n\telif ID == REMOTE_BLOCK_UPDATE:\n\t\t#sent an updated block pair\n\t\tprint(\"block update\")\n\t\tvar puzzle = root.get_node( \"Spatial\" )\n\t\tvar pos = dataArray[1]\n\t\tpuzzle.otherPuzzle.get_node(\"GridView\/GridMan\").forceClickBlock(pos)\n\nfunc sendStart():\n\tif !isNetwork:\n\t\tprint(\"Error sending start packet: not connected!\")\n\t\treturn\n\tvar er = connection.put_var([REMOTE_START])\n\tprint(\"Sending start and got [\" + str(er) + \"]\")\n\nfunc sendBlockUpdate(pos):\n\tif !isNetwork:\n\t\tprint(\"Error sending start packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_BLOCK_UPDATE, pos])\n\nfunc sendFinish(score):\n\tif !isNetwork:\n\t\tprint(\"Error sending finish packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_FINISH, score])\n\nfunc sendQuit():\n\tif !isNetwork:\n\t\tprint(\"Error sending finish packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_QUIT])\n\nfunc sendTransform(translation):\n\tif !isNetwork:\n\t\tprint(\"Cannot send transformation over an unitialized network!\")\n\t\treturn\n\tconnection.put_var([REMOTE_BLOCK_TRANSFORM, translation])\n\tprint(\"it got here\")\n\n\nfunc changeScene(scene):\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\troot.add_child( ResourceLoader.load( scene ).instance() )\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"9bf1cd289d51c428201061b56a4b7d2f808b765f","subject":"Removed print statement from Abstract Block","message":"Removed print statement from Abstract Block\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Blocks\/AbstractBlock.gd","new_file":"src\/scripts\/Blocks\/AbstractBlock.gd","new_contents":"\nextends RigidBody\n\nvar name_int\nvar name\nvar pairName\nvar selected = false\nvar blockPos\nvar blockLayer\nvar blockType\nconst far_away_corner = Vector3(110, 110, 110)\n\nvar editor\n\nstatic func nameToNodeName(n):\n\treturn \"block\" + str(n)\n\nfunc setName(n):\n\tname_int = n\n\tname = nameToNodeName(n)\n\tset_name(nameToNodeName(n))\n\treturn self\n\nfunc setPairName(n):\n\tpairName = nameToNodeName(n)\n\treturn self\n\nfunc setBlockLayer(n):\n\tblockLayer = n\n\treturn self\n\nfunc getBlockLayer():\n\treturn blockLayer\n\nfunc setBlockType( blockT ):\n\tblockType = blockT\n\treturn self\n\nfunc getBlockType():\n\treturn blockType\n\nfunc setSelected(sel):\n\tselected = sel\n\treturn self\n\nfunc forceClick(click_normal=null):\n\tvar network = Globals.get(\"Network\")\n\tif (not network == null and get_node(\"..\/..\/..\/..\/Puzzle\").mainPuzzle and network.isNetwork):\n\t\t\tnetwork.sendBlockUpdate(blockPos)\n\n\tif click_normal != null and editor != null:\n\t\tif editor.shouldAddNeighbor():\n\t\t\taddNeighbor(editor, click_normal)\n\t\t\treturn\n\t\tif editor.shouldReplaceSelf() or editor.shouldRemoveSelf():\n\t\t\t# lasers cannot be removed by the editor\n\t\t\tif blockType == get_parent().get_parent().get_parent().puzzleMan.BLOCK_LASER:\n\t\t\t\treturn\n\n\t\t\t# maybe replace self\n\t\t\tif editor.shouldReplaceSelf():\n\t\t\t\taddNeighbor(editor, 0 * click_normal)\n\t\t\tif pairName != null:\n\t\t\t\tvar pair = get_parent().get_node(pairName)\n\t\t\t\tif pair != null:\n\t\t\t\t\tpair.request_remove()\n\t\t\trequest_remove()\n\t\t\treturn\n\telse:\n\t\tactivate()\n\t\tget_parent().clickBlock( name )\n\nfunc addNeighbor(editor, click_normal):\n\tvar t = get_parent().get_parent().get_transform().inverse()\n\teditor.addBlock(blockPos + t * click_normal)\n\n\n# catch clicks\/taps\nfunc _input_event( camera, ev, click_pos, click_normal, shape_idx ):\n\tif ((ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT)\n\tor (ev.type==InputEvent.SCREEN_TOUCH)):\n\t\tif (get_parent().get_parent().active and ev.is_pressed()):\n\t\t\tforceClick(click_normal)\n\n# returns this block's pairNode or null\nfunc pairActivate():\n\tselected = true\n\n\t# is my pair Nil?\n\tif not get_parent().has_node(str(pairName)):\n\t\tscaleTweenNode(0.9, 0.2, Tween.TRANS_EXPO).start()\n\t\treturn null\n\n\t# get my pair node\n\tvar pairNode = get_parent().get_node(pairName)\n\n\t# enlarge if the other guy's unselected\n\tif not pairNode.selected:\n\t\tscaleTweenNode(1.1, 0.2, Tween.TRANS_EXPO).start()\n\treturn pairNode\n\n\n# returns a tween node that uniformly changes the object's scale\n# call start() on the returned object\nfunc scaleTweenNode(scale, time=1, transType=Tween.TRANS_BOUNCE):\n\tvar tweenNode = newTweenNode()\n\ttweenNode.interpolate_method( self, \"set_scale\", \\\n\t\tself.get_scale(), Vector3(scale, scale, scale), \\\n\t\ttime, transType, Tween.EASE_OUT )\n\n\treturn tweenNode\n\n# adds a tween transition node to the tree\nfunc newTweenNode():\n\tvar tween = Tween.new()\n\tadd_child(tween)\n\treturn tween\n\nfunc request_remove(node=null, key=null):\n\tvar n = scaleTweenNode(0.001, 0.25, Tween.TRANS_QUART)\n\tn.start()\n\tn.connect(\"tween_complete\", get_parent(), \"remove_block\", [self])\n\nfunc _ready():\n\tif get_tree().get_root().has_node(\"EditorSpatial\"):\n\t\teditor = get_tree().get_root().get_node(\"EditorSpatial\")\n\tset_ray_pickable(true)\n","old_contents":"\nextends RigidBody\n\nvar name_int\nvar name\nvar pairName\nvar selected = false\nvar blockPos\nvar blockLayer\nvar blockType\nconst far_away_corner = Vector3(110, 110, 110)\n\nvar editor\n\nstatic func nameToNodeName(n):\n\treturn \"block\" + str(n)\n\nfunc setName(n):\n\tname_int = n\n\tname = nameToNodeName(n)\n\tset_name(nameToNodeName(n))\n\treturn self\n\nfunc setPairName(n):\n\tpairName = nameToNodeName(n)\n\treturn self\n\nfunc setBlockLayer(n):\n\tblockLayer = n\n\treturn self\n\nfunc getBlockLayer():\n\treturn blockLayer\n\nfunc setBlockType( blockT ):\n\tblockType = blockT\n\treturn self\n\nfunc getBlockType():\n\treturn blockType\n\nfunc setSelected(sel):\n\tselected = sel\n\treturn self\n\nfunc forceClick(click_normal=null):\n\tvar network = Globals.get(\"Network\")\n\tif (not network == null and get_node(\"..\/..\/..\/..\/Puzzle\").mainPuzzle and network.isNetwork):\n\t\t\tnetwork.sendBlockUpdate(blockPos)\n\t\t\tprint(\"sending click!\")\n\n\tif click_normal != null and editor != null:\n\t\tif editor.shouldAddNeighbor():\n\t\t\taddNeighbor(editor, click_normal)\n\t\t\treturn\n\t\tif editor.shouldReplaceSelf() or editor.shouldRemoveSelf():\n\t\t\t# lasers cannot be removed by the editor\n\t\t\tif blockType == get_parent().get_parent().get_parent().puzzleMan.BLOCK_LASER:\n\t\t\t\treturn\n\n\t\t\t# maybe replace self\n\t\t\tif editor.shouldReplaceSelf():\n\t\t\t\taddNeighbor(editor, 0 * click_normal)\n\t\t\tif pairName != null:\n\t\t\t\tvar pair = get_parent().get_node(pairName)\n\t\t\t\tif pair != null:\n\t\t\t\t\tpair.request_remove()\n\t\t\trequest_remove()\n\t\t\treturn\n\telse:\n\t\tactivate()\n\t\tget_parent().clickBlock( name )\n\nfunc addNeighbor(editor, click_normal):\n\tvar t = get_parent().get_parent().get_transform().inverse()\n\teditor.addBlock(blockPos + t * click_normal)\n\n\n# catch clicks\/taps\nfunc _input_event( camera, ev, click_pos, click_normal, shape_idx ):\n\tif ((ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT)\n\tor (ev.type==InputEvent.SCREEN_TOUCH)):\n\t\tif (get_parent().get_parent().active and ev.is_pressed()):\n\t\t\tforceClick(click_normal)\n\n# returns this block's pairNode or null\nfunc pairActivate():\n\tselected = true\n\n\t# is my pair Nil?\n\tif not get_parent().has_node(str(pairName)):\n\t\tscaleTweenNode(0.9, 0.2, Tween.TRANS_EXPO).start()\n\t\treturn null\n\n\t# get my pair node\n\tvar pairNode = get_parent().get_node(pairName)\n\n\t# enlarge if the other guy's unselected\n\tif not pairNode.selected:\n\t\tscaleTweenNode(1.1, 0.2, Tween.TRANS_EXPO).start()\n\treturn pairNode\n\n\n# returns a tween node that uniformly changes the object's scale\n# call start() on the returned object\nfunc scaleTweenNode(scale, time=1, transType=Tween.TRANS_BOUNCE):\n\tvar tweenNode = newTweenNode()\n\ttweenNode.interpolate_method( self, \"set_scale\", \\\n\t\tself.get_scale(), Vector3(scale, scale, scale), \\\n\t\ttime, transType, Tween.EASE_OUT )\n\n\treturn tweenNode\n\n# adds a tween transition node to the tree\nfunc newTweenNode():\n\tvar tween = Tween.new()\n\tadd_child(tween)\n\treturn tween\n\nfunc request_remove(node=null, key=null):\n\tvar n = scaleTweenNode(0.001, 0.25, Tween.TRANS_QUART)\n\tn.start()\n\tn.connect(\"tween_complete\", get_parent(), \"remove_block\", [self])\n\nfunc _ready():\n\tif get_tree().get_root().has_node(\"EditorSpatial\"):\n\t\teditor = get_tree().get_root().get_node(\"EditorSpatial\")\n\tset_ray_pickable(true)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"8b4d78c3c6b182abeb3d3b617b596fc728ae892e","subject":"added failing test. commented out setup\/teardown functions","message":"added failing test. commented out setup\/teardown functions\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/sean_tests.gd","new_file":"src\/scripts\/sean_tests.gd","new_contents":"extends \"res:\/\/scripts\/gut.gd\".Test\n\nvar puzzleManScript = load(\"res:\/\/scripts\/PuzzleManager.gd\")\nvar abstractScript = load(\"res:\/\/scripts\/Blocks\/AbstractBlock.gd\")\n\n# func setup():\n# \tgut.p(\"ran setup\", 2)\n#\n# func teardown():\n# \tgut.p(\"ran teardown\")\n\nfunc test_unpickled_paired_block():\n\tvar pMan = puzzleManScript.new()\n\tvar pickle = pMan.PickledBlock.new()\n\tvar aB = abstractScript\n\tpickle.setName(1) \\\n\t\t.setBlockClass(pMan.BLOCK_PAIR) \\\n\t\t.setPairName(\"TestPickledBlock_BUDDY\") \\\n\t\t.setTextureName(\"Blue\")\n\tvar node = pickle.toNode()\n\tgut.assert_eq(node.name, aB.nameToNodeName(pickle.name), \"toName(Pickled name) = node name\")\n\tgut.assert_eq(node.pairName, aB.nameToNodeName(pickle.pairName), \"toName(Pickled pair name) = node pair name\")\n\tgut.assert_eq(node.textureName, pickle.textureName, \"Pickled texture = node texture\")\n\n\t# test AbstractBlock.pairActivate\n\tgut.assert_eq(node.selected, false, \"Abstract.activate starts as false\")\n\tvar pairNode = node.pairActivate(null, null, null)\n\tgut.assert_eq(pairNode, null, \"pairActivate returns null for invalid pair\")\n\tgut.assert_eq(node.selected, true, \"Abstract.activate is true after activation\")\n\nfunc test_unpickled_laser_block():\n\tvar pMan = puzzleManScript.new()\n\tvar pickle = pMan.PickledBlock.new()\n\tvar aB = abstractScript\n\tpickle.setName(0) \\\n\t\t.setBlockClass(pMan.BLOCK_LASER) \\\n\t\t.setPairName(\"TestPickledBlock_BUDDY\") \\\n\t\t.setLaserExtent(Vector3(1,1,1)) \\\n\t\t.setTextureName(\"Blue\")\n\tvar node = pickle.toNode()\n\tgut.assert_eq(node.name, aB.nameToNodeName(pickle.name), \"toName(Pickled name) = node name\")\n\tgut.assert_eq(node.pairName, aB.nameToNodeName(pickle.pairName), \"toName(Pickled pair name) = node pair name\")\n\tgut.assert_eq(node.laserExtent, pickle.laserExtent, \"Pickled laser extent = node laser extent\")\n\nfunc test_puzzleMan_generatePuzzle():\n\tvar pMan = puzzleManScript.new()\n\tfor layers in [0,1,2,5]:\n\t\tfor diff in [pMan.DIFF_HARD, pMan.DIFF_MEDIUM, pMan.DIFF_EASY]:\n\t\t\tvar puzzle = pMan.generatePuzzle(layers, diff)\n\t\t\tgut.assert_eq(puzzle.puzzleLayers, layers, \"puzzleMan layers = layers. difficulty=\" + str(diff))\n\t\t\tgut.assert_eq(float(puzzle.blocks.size()), pow(layers * 2 + 1,3) - 1, \"puzzleMan blocks.size = (layers*2 + 1)**3 - 1. difficulty=\" + str(diff))\n\t\t\tgut.assert_eq(puzzle.solvePuzzle(), true, \"Puzzle solveable\")\n\nfunc test_network():\n\t# test start\n\t# test transmit blocks\n\t# test end\n\tgut.assert_eq(false, true, \"should fail\")\n\tpass\n","old_contents":"extends \"res:\/\/scripts\/gut.gd\".Test\n\nvar puzzleManScript = load(\"res:\/\/scripts\/PuzzleManager.gd\")\nvar abstractScript = load(\"res:\/\/scripts\/Blocks\/AbstractBlock.gd\")\n\nfunc setup():\n\tgut.p(\"ran setup\", 2)\n\nfunc teardown():\n\tgut.p(\"ran teardown\")\n\nfunc test_unpickled_paired_block():\n\tvar pMan = puzzleManScript.new()\n\tvar pickle = pMan.PickledBlock.new()\n\tvar aB = abstractScript\n\tpickle.setName(1) \\\n\t\t.setBlockClass(pMan.BLOCK_PAIR) \\\n\t\t.setPairName(\"TestPickledBlock_BUDDY\") \\\n\t\t.setTextureName(\"Blue\")\n\tvar node = pickle.toNode()\n\tgut.assert_eq(node.name, aB.nameToNodeName(pickle.name), \"toName(Pickled name) = node name\")\n\tgut.assert_eq(node.pairName, aB.nameToNodeName(pickle.pairName), \"toName(Pickled pair name) = node pair name\")\n\tgut.assert_eq(node.textureName, pickle.textureName, \"Pickled texture = node texture\")\n\n\t# test AbstractBlock.pairActivate\n\tgut.assert_eq(node.selected, false, \"Abstract.activate starts as false\")\n\tvar pairNode = node.pairActivate(null, null, null)\n\tgut.assert_eq(pairNode, null, \"pairActivate returns null for invalid pair\")\n\tgut.assert_eq(node.selected, true, \"Abstract.activate is true after activation\")\n\nfunc test_unpickled_laser_block():\n\tvar pMan = puzzleManScript.new()\n\tvar pickle = pMan.PickledBlock.new()\n\tvar aB = abstractScript\n\tpickle.setName(0) \\\n\t\t.setBlockClass(pMan.BLOCK_LASER) \\\n\t\t.setPairName(\"TestPickledBlock_BUDDY\") \\\n\t\t.setLaserExtent(Vector3(1,1,1)) \\\n\t\t.setTextureName(\"Blue\")\n\tvar node = pickle.toNode()\n\tgut.assert_eq(node.name, aB.nameToNodeName(pickle.name), \"toName(Pickled name) = node name\")\n\tgut.assert_eq(node.pairName, aB.nameToNodeName(pickle.pairName), \"toName(Pickled pair name) = node pair name\")\n\tgut.assert_eq(node.laserExtent, pickle.laserExtent, \"Pickled laser extent = node laser extent\")\n\nfunc test_puzzleMan_generatePuzzle():\n\tvar pMan = puzzleManScript.new()\n\tfor layers in [0,1,2,5]:\n\t\tfor diff in [pMan.DIFF_HARD, pMan.DIFF_MEDIUM, pMan.DIFF_EASY]:\n\t\t\tvar puzzle = pMan.generatePuzzle(layers, diff)\n\t\t\tgut.assert_eq(puzzle.puzzleLayers, layers, \"puzzleMan layers = layers. difficulty=\" + str(diff))\n\t\t\tgut.assert_eq(float(puzzle.blocks.size()), pow(layers * 2 + 1,3) - 1, \"puzzleMan blocks.size = (layers*2 + 1)**3 - 1. difficulty=\" + str(diff))\n\t\t\tgut.assert_eq(puzzle.solvePuzzle(), true, \"Puzzle solveable\")\n\nfunc test_network():\n\t# test start\n\t# test transmit blocks\n\t# test end\n\tgut.assert_eq(true, true, \"TRUE\")\n\tpass\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"bac37c11041559abcc9a9864ad98af3b9f03435d","subject":"Avoid duplicate path of the samething.","message":"Avoid duplicate path of the samething.\n","repos":"CSaratakij\/jam-2016-remake","old_file":"src\/ui\/ui_mask.gd","new_file":"src\/ui\/ui_mask.gd","new_contents":"\nextends HBoxContainer\n\nconst mask = preload(\"res:\/\/mask\/mask.gd\")\nconst types = mask.types\nconst type_textures = mask.type_textures\n\nvar current_mask = \"\"\nvar previous_mask = \"\"\n\nonready var tree = get_tree()\nonready var player = tree.get_nodes_in_group(\"player\")[0]\nonready var _sprite = get_node(\"Sprite\")\n\nfunc _ready():\n\tset_process(true)\n\nfunc _process(delta):\n\tif not player == null:\n\t\tcurrent_mask = player.get_current_mask()\n\t\tif current_mask != previous_mask:\n\t\t\tprevious_mask = current_mask\n\t\t\tif type_textures.has(current_mask):\n\t\t\t\t_sprite.set_texture(type_textures[ current_mask ])\n","old_contents":"\nextends HBoxContainer\n\nconst types = preload(\"res:\/\/mask\/mask.gd\").types\nconst type_textures = preload(\"res:\/\/mask\/mask.gd\").type_textures\n\nvar current_mask = \"\"\nvar previous_mask = \"\"\n\nonready var tree = get_tree()\nonready var player = tree.get_nodes_in_group(\"player\")[0]\nonready var _sprite = get_node(\"Sprite\")\n\nfunc _ready():\n\tset_process(true)\n\nfunc _process(delta):\n\tif not player == null:\n\t\tcurrent_mask = player.get_current_mask()\n\t\tif current_mask != previous_mask:\n\t\t\tprevious_mask = current_mask\n\t\t\tif type_textures.has(current_mask):\n\t\t\t\t_sprite.set_texture(type_textures[ current_mask ])\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"94b1d3f9607ee99f7b3bdc9370a433fa7352522e","subject":"Donate Opens webpage instead.","message":"Donate Opens webpage instead.\n","repos":"DaddySmash\/GraphicsGame,DaddySmash\/GraphicsGame","old_file":"app\/code\/global.gd","new_file":"app\/code\/global.gd","new_contents":"extends Node\n\n#This is used by global.gd for changing scenes.\nvar currentScene = null\nvar currentDifficulty = 1\nvar currentName = \"RIP\"\nvar currentScore = \"0\"\nvar currentTime = \"12:00\"\nvar errorHighArray = false\nvar enteringOS = false\nvar enteringMenu = false\nvar enteringRound = false\nvar enteringDonate = false\n\n#Highscores that are saved to disk.\n# highArray[difficulty][rank][stat] = value\n# difficulty: range(SIZE_DIFFICULTY)\n# rank: range(SIZE_RANK)\n# stat: STAT_NAME, STAT_SCORE, STAT_TIME, STAT_NEW\nconst SIZE_DIFFICULTY = 4\nconst SIZE_RANK = 10\nconst SIZE_STAT = 4\n\nconst STAT_NAME = 0\nconst STAT_SCORE = 1\nconst STAT_TIME = 2\nconst STAT_NEW = 3\nvar highArray = []\n\nfunc _ready():\n\tget_scene().set_auto_accept_quit(false) #Enables: _notification(what) to recieve MainLoop.NOTIFICATION_WM_QUIT_REQUEST\n\trandomize()\n\tvar root = get_scene().get_root()\n\tcurrentScene = root.get_child(root.get_child_count() - 1)\n\tloadHighScore()\n\nfunc _notification(what):\n\tif (what==MainLoop.NOTIFICATION_WM_QUIT_REQUEST):\n\t\tget_scene().quit() #default behavior\n\nfunc loadHighScore():\n\t#this function is to load the high scores for viewing.\n\tvar f = File.new()\n\tif f.file_exists(\"user:\/\/highScores.zombie\"):\n\t\tvar err = f.open_encrypted_with_pass(\"user:\/\/highScores.zombie\", File.READ, OS.get_unique_ID())\n\t\tif err:\n\t\t\tprint(\"LOAD ERROR: \" + str(err))\n\t\t\terrorHighArray = true\n\t\telse:\n\t\t\thighArray = f.get_var()\n\telse:\n\t\tprint(\"LOAD ERROR: highScores.zombie does not exist.\")\n\t\terrorHighArray = true\n\tif (typeof(highArray) != TYPE_ARRAY):\n\t\tprint(\"LOAD ERROR: highScores.zombie is using an outdated or incorrect format. ID01\")\n\t\terrorHighArray = true\n\tif (highArray.size() + 1 == SIZE_DIFFICULTY):\n\t\tprint(\"LOAD ERROR: highScores.zombie is using an outdated or incorrect format. ID02\")\n\t\terrorHighArray = true\n\tif (typeof(highArray[0]) != TYPE_ARRAY):\n\t\tprint(\"LOAD ERROR: highScores.zombie is using an outdated or incorrect format. ID03\")\n\t\terrorHighArray = true\n\tif (highArray[0].size() + 1 == SIZE_RANK):\n\t\tprint(\"LOAD ERROR: highScores.zombie is using an outdated or incorrect format. ID04\")\n\t\terrorHighArray = true\n\tif (typeof(highArray[0][0]) != TYPE_ARRAY):\n\t\tprint(\"LOAD ERROR: highScores.zombie is using an outdated or incorrect format. ID05\")\n\t\terrorHighArray = true\n\tif (highArray[0][0].size() + 1 == SIZE_STAT):\n\t\tprint(\"LOAD ERROR: highScores.zombie is using an outdated or incorrect format. ID06\")\n\t\terrorHighArray = true\n\tif (typeof(highArray[0][0][STAT_NAME]) != TYPE_STRING):\n\t\tprint(\"LOAD ERROR: highScores.zombie is using an outdated or incorrect format. ID07\")\n\t\terrorHighArray = true\n\tif (typeof(highArray[0][0][STAT_SCORE]) != TYPE_STRING):\n\t\tprint(\"LOAD ERROR: highScores.zombie is using an outdated or incorrect format. ID08\")\n\t\terrorHighArray = true\n\tif (typeof(highArray[0][0][STAT_TIME]) != TYPE_STRING):\n\t\tprint(\"LOAD ERROR: highScores.zombie is using an outdated or incorrect format. ID09\")\n\t\terrorHighArray = true\n\tif (typeof(highArray[0][0][STAT_NEW]) != TYPE_BOOL):\n\t\tprint(\"LOAD ERROR: highScores.zombie is using an outdated or incorrect format. ID10\")\n\t\terrorHighArray = true\n\tif errorHighArray:\n\t\tclearHighScore()\n\tfor difficulty in range(SIZE_DIFFICULTY):\n\t\tfor rank in range(SIZE_RANK):\n\t\t\thighArray[difficulty][rank][STAT_NEW] = false\n\tf.close()\n\nfunc clearHighScore():\n\t#\n\t# TODO: Add prompt to delete all highscores and create empty list!\n\t#\n\t#Highscores that are saved to disk.\n\t# highArray[difficulty][rank][stat] = value\n\t# difficulty: range(SIZE_DIFFICULTY)\n\t# rank: range(SIZE_RANK)\n\t# stat: STAT_NAME, STAT_SCORE, STAT_TIME, STAT_NEW\n\thighArray = []\n\tfor difficulty in range(SIZE_DIFFICULTY):\n\t\thighArray.append([])\n\t\tfor rank in range(SIZE_RANK):\n\t\t\thighArray[difficulty].append([])\n\t\t\thighArray[difficulty][rank].append(\"RIP\")\n\t\t\thighArray[difficulty][rank].append(\"0\")\n\t\t\thighArray[difficulty][rank].append(\"12:00\")\n\t\t\thighArray[difficulty][rank].append(false)\n\t#highDifficulty.sort()\n\terrorHighArray = false\n\tsaveHighScore()\n\nfunc saveHighScore():\n\t#This function is to save the high scores.\n\tif !errorHighArray:\n\t\tvar f = File.new()\n\t\tvar err = f.open_encrypted_with_pass(\"user:\/\/highScores.zombie\", File.WRITE, OS.get_unique_ID())\n\t\tif err:\n\t\t\tprint(\"SAVE ERROR: \" + str(err))\n\t\t\t#\n\t\t\t# TODO: Add prompt to try and save again!\n\t\t\t#\n\t\telse:\n\t\t\tf.seek(0)\n\t\t\tf.store_var(highArray)\n\t\t\tprint(\"SAVE DONE\")\n\t\tf.close()\n\nfunc updateHighScore(score, time):\n\tfor difficultyTemp in range(SIZE_DIFFICULTY):\n\t\tfor rankTemp in range(SIZE_RANK):\n\t\t\thighArray[difficultyTemp][rankTemp][STAT_NEW] = false\n\t\n\tif score <= 0:\n\t\tenterHighScore()\n\telif time <= 0:\n\t\tenterHighScore()\n\telse:\n\t\tcurrentName = \"RIP\"\n\t\tcurrentScore = str(floor(score))\n\t\tcurrentTime = timeString(time)\n\t\tvar i = highArray[currentDifficulty]\n\t\ti[SIZE_RANK - 1][STAT_NAME] = currentName\n\t\ti[SIZE_RANK - 1][STAT_SCORE] = currentScore\n\t\ti[SIZE_RANK - 1][STAT_TIME] = currentTime\n\t\ti[SIZE_RANK - 1][STAT_NEW] = true\n\t\t\n\t\t#sorting highArray:\n\t\ti.sort_custom(get_node(\"\/root\/global\"), \"sortLogic\")\n\t\t\n\t\t#Only if the new score was sorted into the top 9!:\n\t\tif i[SIZE_RANK - 1][STAT_NEW] == false:\n\t\t\tenterGetName()\n\t\telse:\n\t\t\tenterHighScore()\n\nfunc updateHighScorePart2():\n\t#The last index of highArray is never displayed and is overridden with any new score before sorting.\n\t\n\t#Highscores that are saved to disk.\n\t# highArray[difficulty][rank][stat] = value\n\t# difficulty: range(SIZE_DIFFICULTY)\n\t# rank: range(SIZE_RANK)\n\t# stat: STAT_NAME, STAT_SCORE, STAT_TIME, STAT_NEW\n\t\n\t#highArray[currentDifficulty][SIZE_RANK - 1][STAT_NAME] = currentName WILL THROW AN ERROR MESSAGE OF \"INVALID GET INDREX '0' (on base: 'int')\" INCORRECTLY USING \"var i = highArray[currentDifficulty]\" as a workaround.\n\tprint(\"updateHighScorePart2 \" + currentTime + \" \" + currentName + \" \" + currentScore)\n\tfor rankTemp in range(SIZE_RANK):\n\t\tif highArray[currentDifficulty][rankTemp][STAT_NEW] == true:\n\t\t\thighArray[currentDifficulty][rankTemp][STAT_NAME] = currentName\n\tsaveHighScore()\n\tenterHighScore()\n\nfunc sortLogic(first, second):\n\tif second[STAT_SCORE] < first[STAT_SCORE]:\n\t\treturn true\n\telse:\n\t\treturn false\n\nfunc timeString(time):\n\ttime = floor(time)\n\tif time < 10:\n\t\treturn \"12:0\" + str(time)\n\telif time < 60:\n\t\treturn \"12:\" + str(time)\n\telif time % 60 < 10:\n\t\treturn str(floor(time \/ 60)) + \":0\" + str(time % 60)\n\telse:\n\t\treturn str(floor(time \/ 60)) + \":\" + str(time % 60)\n\nfunc enterOS():\n\tget_scene().quit()\n\nfunc enterGetName():\n\t#Make sure you call get_node(\"\/root\/global\").currentName = \"INITAlS\" AND get_node(\"\/root\/global\").updateHighScorePart2()\n\tif !errorHighArray:\n\t\tvar s = ResourceLoader.load(\"res:\/\/scene\/getName.xscn\")\n\t\tcurrentScene.queue_free()\n\t\tcurrentScene = s.instance()\n\t\tget_scene().get_root().add_child(currentScene)\n\nfunc enterHighScore():\n\t#Only display the top 9 of each difficulty.\n\tif !errorHighArray:\n\t\tvar s = ResourceLoader.load(\"res:\/\/scene\/highScore.xscn\")\n\t\tcurrentScene.queue_free()\n\t\tcurrentScene = s.instance()\n\t\tget_scene().get_root().add_child(currentScene)\n\nfunc enterDonate():\n\tOS.shell_open(\"http:\/\/www.google.com\")\n\t#var s = ResourceLoader.load(\"res:\/\/scene\/donate.xscn\")\n\t#currentScene.queue_free()\n\t#currentScene = s.instance()\n\t#get_scene().get_root().add_child(currentScene)\n\tenteringDonate = false\n\nfunc enterRound(difficulty):\n\tcurrentDifficulty = difficulty #currentDifficulty should be accessed by zombiesGo.gd\n\t\n\tvar s = ResourceLoader.load(\"res:\/\/scene\/zombiesGo.xscn\")\n\tcurrentScene.queue_free()\n\tcurrentScene = s.instance()\n\tget_scene().get_root().add_child(currentScene)\n\tenteringRound = false\n\nfunc enterMenu():\n\tvar s = ResourceLoader.load(\"res:\/\/scene\/menu.xscn\")\n\tcurrentScene.queue_free()\n\tcurrentScene = s.instance()\n\tget_scene().get_root().add_child(currentScene)\n\tenteringMenu = false","old_contents":"extends Node\n\n#This is used by global.gd for changing scenes.\nvar currentScene = null\nvar currentDifficulty = 1\nvar currentName = \"RIP\"\nvar currentScore = \"0\"\nvar currentTime = \"12:00\"\nvar errorHighArray = false\nvar enteringOS = false\nvar enteringMenu = false\nvar enteringRound = false\nvar enteringDonate = false\n\n#Highscores that are saved to disk.\n# highArray[difficulty][rank][stat] = value\n# difficulty: range(SIZE_DIFFICULTY)\n# rank: range(SIZE_RANK)\n# stat: STAT_NAME, STAT_SCORE, STAT_TIME, STAT_NEW\nconst SIZE_DIFFICULTY = 4\nconst SIZE_RANK = 10\nconst SIZE_STAT = 4\n\nconst STAT_NAME = 0\nconst STAT_SCORE = 1\nconst STAT_TIME = 2\nconst STAT_NEW = 3\nvar highArray = []\n\nfunc _ready():\n\tget_scene().set_auto_accept_quit(false) #Enables: _notification(what) to recieve MainLoop.NOTIFICATION_WM_QUIT_REQUEST\n\trandomize()\n\tvar root = get_scene().get_root()\n\tcurrentScene = root.get_child(root.get_child_count() - 1)\n\tloadHighScore()\n\nfunc _notification(what):\n\tif (what==MainLoop.NOTIFICATION_WM_QUIT_REQUEST):\n\t\tget_scene().quit() #default behavior\n\nfunc loadHighScore():\n\t#this function is to load the high scores for viewing.\n\tvar f = File.new()\n\tif f.file_exists(\"user:\/\/highScores.zombie\"):\n\t\tvar err = f.open_encrypted_with_pass(\"user:\/\/highScores.zombie\", File.READ, OS.get_unique_ID())\n\t\tif err:\n\t\t\tprint(\"LOAD ERROR: \" + str(err))\n\t\t\terrorHighArray = true\n\t\telse:\n\t\t\thighArray = f.get_var()\n\telse:\n\t\tprint(\"LOAD ERROR: highScores.zombie does not exist.\")\n\t\terrorHighArray = true\n\tif (typeof(highArray) != TYPE_ARRAY):\n\t\tprint(\"LOAD ERROR: highScores.zombie is using an outdated or incorrect format. ID01\")\n\t\terrorHighArray = true\n\tif (highArray.size() + 1 == SIZE_DIFFICULTY):\n\t\tprint(\"LOAD ERROR: highScores.zombie is using an outdated or incorrect format. ID02\")\n\t\terrorHighArray = true\n\tif (typeof(highArray[0]) != TYPE_ARRAY):\n\t\tprint(\"LOAD ERROR: highScores.zombie is using an outdated or incorrect format. ID03\")\n\t\terrorHighArray = true\n\tif (highArray[0].size() + 1 == SIZE_RANK):\n\t\tprint(\"LOAD ERROR: highScores.zombie is using an outdated or incorrect format. ID04\")\n\t\terrorHighArray = true\n\tif (typeof(highArray[0][0]) != TYPE_ARRAY):\n\t\tprint(\"LOAD ERROR: highScores.zombie is using an outdated or incorrect format. ID05\")\n\t\terrorHighArray = true\n\tif (highArray[0][0].size() + 1 == SIZE_STAT):\n\t\tprint(\"LOAD ERROR: highScores.zombie is using an outdated or incorrect format. ID06\")\n\t\terrorHighArray = true\n\tif (typeof(highArray[0][0][STAT_NAME]) != TYPE_STRING):\n\t\tprint(\"LOAD ERROR: highScores.zombie is using an outdated or incorrect format. ID07\")\n\t\terrorHighArray = true\n\tif (typeof(highArray[0][0][STAT_SCORE]) != TYPE_STRING):\n\t\tprint(\"LOAD ERROR: highScores.zombie is using an outdated or incorrect format. ID08\")\n\t\terrorHighArray = true\n\tif (typeof(highArray[0][0][STAT_TIME]) != TYPE_STRING):\n\t\tprint(\"LOAD ERROR: highScores.zombie is using an outdated or incorrect format. ID09\")\n\t\terrorHighArray = true\n\tif (typeof(highArray[0][0][STAT_NEW]) != TYPE_BOOL):\n\t\tprint(\"LOAD ERROR: highScores.zombie is using an outdated or incorrect format. ID10\")\n\t\terrorHighArray = true\n\tif errorHighArray:\n\t\tclearHighScore()\n\tfor difficulty in range(SIZE_DIFFICULTY):\n\t\tfor rank in range(SIZE_RANK):\n\t\t\thighArray[difficulty][rank][STAT_NEW] = false\n\tf.close()\n\nfunc clearHighScore():\n\t#\n\t# TODO: Add prompt to delete all highscores and create empty list!\n\t#\n\t#Highscores that are saved to disk.\n\t# highArray[difficulty][rank][stat] = value\n\t# difficulty: range(SIZE_DIFFICULTY)\n\t# rank: range(SIZE_RANK)\n\t# stat: STAT_NAME, STAT_SCORE, STAT_TIME, STAT_NEW\n\thighArray = []\n\tfor difficulty in range(SIZE_DIFFICULTY):\n\t\thighArray.append([])\n\t\tfor rank in range(SIZE_RANK):\n\t\t\thighArray[difficulty].append([])\n\t\t\thighArray[difficulty][rank].append(\"RIP\")\n\t\t\thighArray[difficulty][rank].append(\"0\")\n\t\t\thighArray[difficulty][rank].append(\"12:00\")\n\t\t\thighArray[difficulty][rank].append(false)\n\t#highDifficulty.sort()\n\terrorHighArray = false\n\tsaveHighScore()\n\nfunc saveHighScore():\n\t#This function is to save the high scores.\n\tif !errorHighArray:\n\t\tvar f = File.new()\n\t\tvar err = f.open_encrypted_with_pass(\"user:\/\/highScores.zombie\", File.WRITE, OS.get_unique_ID())\n\t\tif err:\n\t\t\tprint(\"SAVE ERROR: \" + str(err))\n\t\t\t#\n\t\t\t# TODO: Add prompt to try and save again!\n\t\t\t#\n\t\telse:\n\t\t\tf.seek(0)\n\t\t\tf.store_var(highArray)\n\t\t\tprint(\"SAVE DONE\")\n\t\tf.close()\n\nfunc updateHighScore(score, time):\n\tfor difficultyTemp in range(SIZE_DIFFICULTY):\n\t\tfor rankTemp in range(SIZE_RANK):\n\t\t\thighArray[difficultyTemp][rankTemp][STAT_NEW] = false\n\t\n\tif score <= 0:\n\t\tenterHighScore()\n\telif time <= 0:\n\t\tenterHighScore()\n\telse:\n\t\tcurrentName = \"RIP\"\n\t\tcurrentScore = str(floor(score))\n\t\tcurrentTime = timeString(time)\n\t\tvar i = highArray[currentDifficulty]\n\t\ti[SIZE_RANK - 1][STAT_NAME] = currentName\n\t\ti[SIZE_RANK - 1][STAT_SCORE] = currentScore\n\t\ti[SIZE_RANK - 1][STAT_TIME] = currentTime\n\t\ti[SIZE_RANK - 1][STAT_NEW] = true\n\t\t\n\t\t#sorting highArray:\n\t\ti.sort_custom(get_node(\"\/root\/global\"), \"sortLogic\")\n\t\t\n\t\t#Only if the new score was sorted into the top 9!:\n\t\tif i[SIZE_RANK - 1][STAT_NEW] == false:\n\t\t\tenterGetName()\n\t\telse:\n\t\t\tenterHighScore()\n\nfunc updateHighScorePart2():\n\t#The last index of highArray is never displayed and is overridden with any new score before sorting.\n\t\n\t#Highscores that are saved to disk.\n\t# highArray[difficulty][rank][stat] = value\n\t# difficulty: range(SIZE_DIFFICULTY)\n\t# rank: range(SIZE_RANK)\n\t# stat: STAT_NAME, STAT_SCORE, STAT_TIME, STAT_NEW\n\t\n\t#highArray[currentDifficulty][SIZE_RANK - 1][STAT_NAME] = currentName WILL THROW AN ERROR MESSAGE OF \"INVALID GET INDREX '0' (on base: 'int')\" INCORRECTLY USING \"var i = highArray[currentDifficulty]\" as a workaround.\n\tprint(\"updateHighScorePart2 \" + currentTime + \" \" + currentName + \" \" + currentScore)\n\tfor rankTemp in range(SIZE_RANK):\n\t\tif highArray[currentDifficulty][rankTemp][STAT_NEW] == true:\n\t\t\thighArray[currentDifficulty][rankTemp][STAT_NAME] = currentName\n\tsaveHighScore()\n\tenterHighScore()\n\nfunc sortLogic(first, second):\n\tif second[STAT_SCORE] < first[STAT_SCORE]:\n\t\treturn true\n\telse:\n\t\treturn false\n\nfunc timeString(time):\n\ttime = floor(time)\n\tif time < 10:\n\t\treturn \"12:0\" + str(time)\n\telif time < 60:\n\t\treturn \"12:\" + str(time)\n\telif time % 60 < 10:\n\t\treturn str(floor(time \/ 60)) + \":0\" + str(time % 60)\n\telse:\n\t\treturn str(floor(time \/ 60)) + \":\" + str(time % 60)\n\nfunc enterOS():\n\tget_scene().quit()\n\nfunc enterGetName():\n\t#Make sure you call get_node(\"\/root\/global\").currentName = \"INITAlS\" AND get_node(\"\/root\/global\").updateHighScorePart2()\n\tif !errorHighArray:\n\t\tvar s = ResourceLoader.load(\"res:\/\/scene\/getName.xscn\")\n\t\tcurrentScene.queue_free()\n\t\tcurrentScene = s.instance()\n\t\tget_scene().get_root().add_child(currentScene)\n\nfunc enterHighScore():\n\t#Only display the top 9 of each difficulty.\n\tif !errorHighArray:\n\t\tvar s = ResourceLoader.load(\"res:\/\/scene\/highScore.xscn\")\n\t\tcurrentScene.queue_free()\n\t\tcurrentScene = s.instance()\n\t\tget_scene().get_root().add_child(currentScene)\n\nfunc enterDonate():\n\tvar s = ResourceLoader.load(\"res:\/\/scene\/donate.xscn\")\n\tcurrentScene.queue_free()\n\tcurrentScene = s.instance()\n\tget_scene().get_root().add_child(currentScene)\n\tenteringDonate = false\n\nfunc enterRound(difficulty):\n\tcurrentDifficulty = difficulty #currentDifficulty should be accessed by zombiesGo.gd\n\t\n\tvar s = ResourceLoader.load(\"res:\/\/scene\/zombiesGo.xscn\")\n\tcurrentScene.queue_free()\n\tcurrentScene = s.instance()\n\tget_scene().get_root().add_child(currentScene)\n\tenteringRound = false\n\nfunc enterMenu():\n\tvar s = ResourceLoader.load(\"res:\/\/scene\/menu.xscn\")\n\tcurrentScene.queue_free()\n\tcurrentScene = s.instance()\n\tget_scene().get_root().add_child(currentScene)\n\tenteringMenu = false","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"d872654a49fc878b6570b4d1ca96a86e49d4964c","subject":"Convert radian to degree with exits method in Godot Engine","message":"Convert radian to degree with exits method in Godot Engine\n","repos":"CSaratakij\/jam-2016-remake","old_file":"src\/spawner\/particle_spawner.gd","new_file":"src\/spawner\/particle_spawner.gd","new_contents":"\nextends Node2D\n\nconst MAX_PARTICLE_POOLING = 6\nconst MASK_TYPES = preload(\"res:\/\/mask\/mask.gd\").types\nconst PARTICLES = {\n\t\"use_mask\" : preload(\"res:\/\/particles\/use_mask_particle.tscn\"),\n\t\"hit_totem\" : preload(\"res:\/\/particles\/hit_totem_particle.tscn\")\n}\n\nvar pooling_particles = {\n\t\"use_mask\" : [],\n\t\"hit_totem\" : []\n}\n\nonready var tree = get_tree()\nonready var root = tree.get_root()\nonready var players = tree.get_nodes_in_group(\"player\")\n\nfunc _ready():\n\t_initialize()\n\tset_process(true)\n\nfunc _process(delta):\n\tif not players.empty():\n\t\tif players[ 0 ].get_is_using_mask():\n\t\t\tif players[ 0 ].get_current_using_mask() == MASK_TYPES[ 0 ]:\n\t\t\t\tvar params = {\n\t\t\t\t\tParticles2D.PARAM_TANGENTIAL_ACCEL : players[ 0 ].get_move_direction().x * 30\n\t\t\t\t}\n\t\t\t\tspawn(\"use_mask\", players[ 0 ].get_global_pos(), params)\n\t\tif players[ 0 ].is_used_dig_mask:\n\t\t\tvar params = {\n\t\t\t\tParticles2D.PARAM_TANGENTIAL_ACCEL : players[ 0 ].get_move_direction().x * 30\n\t\t\t}\n\t\t\tspawn(\"use_mask\", players[ 0 ].get_using_mask_pos(), params)\n\t\t\tplayers[ 0 ].is_used_dig_mask = false\n\t\tif players[ 0 ].get_is_hit_totem():\n\t\t\tvar pos = players[ 0 ].get_player_to_hit_totem_pos().normalized()\n\t\t\tvar angle_radian = atan2(pos.x, pos.y)\n\t\t\tvar angle_degree = rad2deg(angle_radian)\n\t\t\tvar params = {\n\t\t\t\tParticles2D.PARAM_DIRECTION : angle_degree\n\t\t\t}\n\t\t\tspawn(\"hit_totem\", players[ 0 ].get_hit_totem_pos(), params)\n\t\t\tplayers[ 0 ].set_is_hit_totem(false)\n\nfunc _initialize():\n\tvar use_mask_instance = PARTICLES[ \"use_mask\" ].instance()\n\tvar hit_totem_instance = PARTICLES[ \"hit_totem\" ].instance()\n\tfor index in range(MAX_PARTICLE_POOLING):\n\t\tpooling_particles[ \"use_mask\" ].append(use_mask_instance.duplicate())\n\t\tpooling_particles[ \"hit_totem\" ].append(hit_totem_instance.duplicate())\n\t\tadd_child(pooling_particles[ \"use_mask\" ][ index ])\n\t\tadd_child(pooling_particles[ \"hit_totem\" ][ index ])\n\nfunc spawn(particle_name, emit_pos, params):\n\tif not players.empty():\n\t\tif pooling_particles.keys().has(particle_name):\n\t\t\tfor particle in pooling_particles[ particle_name ]:\n\t\t\t\tif not particle.is_emitting():\n\t\t\t\t\tfor index in range(params.keys().size()):\n\t\t\t\t\t\tparticle.set_param(params.keys()[ index ], params.values()[ index ])\n\t\t\t\t\tparticle.set_global_pos(emit_pos)\n\t\t\t\t\tparticle.set_emitting(true)\n\t\t\t\t\tbreak\n","old_contents":"\nextends Node2D\n\nconst MAX_PARTICLE_POOLING = 6\nconst MASK_TYPES = preload(\"res:\/\/mask\/mask.gd\").types\nconst PARTICLES = {\n\t\"use_mask\" : preload(\"res:\/\/particles\/use_mask_particle.tscn\"),\n\t\"hit_totem\" : preload(\"res:\/\/particles\/hit_totem_particle.tscn\")\n}\n\nvar pooling_particles = {\n\t\"use_mask\" : [],\n\t\"hit_totem\" : []\n}\n\nonready var tree = get_tree()\nonready var root = tree.get_root()\nonready var players = tree.get_nodes_in_group(\"player\")\n\nfunc _ready():\n\t_initialize()\n\tset_process(true)\n\nfunc _process(delta):\n\tif not players.empty():\n\t\tif players[ 0 ].get_is_using_mask():\n\t\t\tif players[ 0 ].get_current_using_mask() == MASK_TYPES[ 0 ]:\n\t\t\t\tvar params = {\n\t\t\t\t\tParticles2D.PARAM_TANGENTIAL_ACCEL : players[ 0 ].get_move_direction().x * 30\n\t\t\t\t}\n\t\t\t\tspawn(\"use_mask\", players[ 0 ].get_global_pos(), params)\n\t\tif players[ 0 ].is_used_dig_mask:\n\t\t\tvar params = {\n\t\t\t\tParticles2D.PARAM_TANGENTIAL_ACCEL : players[ 0 ].get_move_direction().x * 30\n\t\t\t}\n\t\t\tspawn(\"use_mask\", players[ 0 ].get_using_mask_pos(), params)\n\t\t\tplayers[ 0 ].is_used_dig_mask = false\n\t\tif players[ 0 ].get_is_hit_totem():\n\t\t\tvar pos = players[ 0 ].get_player_to_hit_totem_pos().normalized()\n\t\t\tvar angle_radian = atan2(pos.x, pos.y)\n\t\t\tvar angle_degree = (angle_radian * 180) \/ PI\n\t\t\tvar params = {\n\t\t\t\tParticles2D.PARAM_DIRECTION : angle_degree\n\t\t\t}\n\t\t\tspawn(\"hit_totem\", players[ 0 ].get_hit_totem_pos(), params)\n\t\t\tplayers[ 0 ].set_is_hit_totem(false)\n\nfunc _initialize():\n\tvar use_mask_instance = PARTICLES[ \"use_mask\" ].instance()\n\tvar hit_totem_instance = PARTICLES[ \"hit_totem\" ].instance()\n\tfor index in range(MAX_PARTICLE_POOLING):\n\t\tpooling_particles[ \"use_mask\" ].append(use_mask_instance.duplicate())\n\t\tpooling_particles[ \"hit_totem\" ].append(hit_totem_instance.duplicate())\n\t\tadd_child(pooling_particles[ \"use_mask\" ][ index ])\n\t\tadd_child(pooling_particles[ \"hit_totem\" ][ index ])\n\nfunc spawn(particle_name, emit_pos, params):\n\tif not players.empty():\n\t\tif pooling_particles.keys().has(particle_name):\n\t\t\tfor particle in pooling_particles[ particle_name ]:\n\t\t\t\tif not particle.is_emitting():\n\t\t\t\t\tfor index in range(params.keys().size()):\n\t\t\t\t\t\tparticle.set_param(params.keys()[ index ], params.values()[ index ])\n\t\t\t\t\tparticle.set_global_pos(emit_pos)\n\t\t\t\t\tparticle.set_emitting(true)\n\t\t\t\t\tbreak\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"3eacf2d489daf6acb23fc1fea4d83b7d84b5966c","subject":"Enemy update","message":"Enemy update\n\nEnemy destroys themself if player enters them then defeats them.\n","repos":"cypher31\/CRUNCH","old_file":"Scripts\/enemyRun.gd","new_file":"Scripts\/enemyRun.gd","new_contents":"extends KinematicBody2D\n\nfunc _ready():\n\tset_fixed_process(true)\n\tpass\n\nfunc _fixed_process(delta):\n\tif(get_node(\"\/root\/global\").currentRunEnemy == true):\n\t\tself.queue_free()\n\tpass\n\nfunc _on_playerCheck_body_enter( body ):\n\tif(body.is_in_group(\"playerRun\")):\n\t\tget_node(\"\/root\/global\").playerStartPosition = self.get_global_pos()\n\t\tget_node(\"\/root\/global\").currentRunEnemy = true\n\t\tget_node(\"\/root\/global\").setScene(\"res:\/\/Scenes\/Dungeon_Fight.tscn\")\n\tpass\n\n\n\n\n\n","old_contents":"extends KinematicBody2D\n\nfunc _ready():\n\tset_fixed_process(true)\n\tpass\n\nfunc _fixed_process(delta):\n\tpass\n\nfunc _on_playerCheck_body_enter( body ):\n\tif(body.is_in_group(\"playerRun\")):\n\t\tget_node(\"\/root\/global\").playerStartPosition = self.get_global_pos()\n#\t\tget_node(\"\/root\/global\").currentRunEnemy = self\n\t\tget_node(\"\/root\/global\").setScene(\"res:\/\/Scenes\/Dungeon_Fight.tscn\")\n\tpass\n\n\n\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"77cfba2fc1cb5b870bd3aafe3b479719c9d11ee3","subject":"Update Puzzle.gd","message":"Update Puzzle.gd","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Puzzle.gd","new_file":"src\/scripts\/Puzzle.gd","new_contents":"# Provides functionality for the puzzle itself\n\nextends Spatial\n\nvar DataMan = preload( \"res:\/\/scripts\/DataManager.gd\" ).new()\nvar PuzzleManScript = preload( \"res:\/\/scripts\/PuzzleManager.gd\" )\nvar PuzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar puzzleMan\nvar seed\nvar otherPuzzle\nvar generateRandom = true\nvar mainPuzzle = false\n\nvar time = {\n\t\ton = true,\n\t\tval = 0.0,\n\t\tlabel = Label.new(),\n\t\ttween = Tween.new() }\n\nfunc addTimer():\n\tadd_child(time.label)\n\tadd_child(time.tween)\n\ttime.label.set_pos(Vector2(15,15))\n\n\ttime.label.set_theme(load(\"res:\/\/themes\/MainTheme.thm\"))\n\ttime.tween.interpolate_method(time.label, \"set_pos\", \\\n\t\t\ttime.label.get_pos(), time.label.get_pos()*2, 0.5, \\\n\t\t\tTween.TRANS_BOUNCE, Tween.EASE_OUT)\n\ttime.tween.start()\n\ttime.label.set_text(str(time.val))\n\nstatic func formatTime(t):\n\tvar mins = floor(t \/ 60)\n\tvar secs = fmod(floor(t), 60)\n\tvar millis = floor((t - floor(t)) * 1000)\n\treturn str(mins) + \":\" + str(secs).pad_zeros(2) + \":\" + str(millis).pad_zeros(3)\n\nfunc _process(dTime):\n\t# start label tween on\n\ttime.val += dTime\n\ttime.label.set_text(formatTime(time.val))\n\tif fmod(time.val, 10) < 0.1:\n\t\ttime.tween.seek(0.0)\n\n# Called for initialization\nfunc _ready():\n\tif time.on:\n\t\tset_process(true) # needed for time keeping\n\taddTimer()\n\n\t#set up network stuffs\n\tadd_child(load(\"res:\/\/networkProxy.scn\").instance())\n\tvar Network = Globals.get(\"Network\")\n\tif Network != null:\n\t\tNetwork.proxy.set_process(Network.isClient or Network.isHost)\n\n\n\t# generate puzzle\n\tpuzzleMan = PuzzleManScript.new()\n\tvar puzzle\n\n\tif generateRandom:\n\t\tseed = OS.get_unix_time() # unix time\n\t\tseed *= OS.get_ticks_msec() # initial time\n\t\tseed *= 1 + OS.get_time().second\n\t\tseed *= 1 + OS.get_date().weekday\n\t\tseed = abs(seed) % 7919 # 1000th prime\n\n\t\trand_seed(seed)\n\n\t\tpuzzle = puzzleMan.generatePuzzle( 2, puzzleMan.DIFF_HARD )\n\t\tpuzzle.puzzleMan = puzzleMan\n\t\tvar steps = puzzle.solvePuzzleSteps()\n\t\tprint(\"Generated \", puzzle.shape.size(), \" blocks.\" )\n\t\tprint( \"PUZZLE IS SOLVEABLE?: \", steps.solveable )\n\n\t\tvar gridMan = get_node( \"GridView\/GridMan\" )\n\t\tDataMan.savePuzzle(\"test.pzl\", puzzle)\n\t\tvar pCopy = DataMan.loadPuzzle(\"test.pzl\")\n\t\tgridMan.set_puzzle(puzzle)\n\n\n\n\t# make a new puzzle, embed using Viewport\n\tif mainPuzzle:\n\t\tif (not Network == null and Network.isNetwork):\n\t\t\tprint(\"Sending puzzle\")\n\t\t\tNetwork.sendStart(puzzle)\n\n\t\tvar p = PuzzleScn.instance()\n\t\tp.get_node(\"GridView\").active = false\n\t\tp.get_node(\"GridView\/GridMan\").set_puzzle(puzzle)\n\t\tp.mainPuzzle = false\n\t\tp.set_scale(Vector3(0.5, 0.5, 0.5))\n\t\tp.set_translation(Vector3(10, 5, -20))\n\n\t\tvar v = Viewport.new()\n\t\tvar c = Control.new()\n\n\t\tv.set_world(p.get_world())\n\t\tv.set_render_target_to_screen_rect(Rect2(20,20,40,40))\n\t\tv.set_physics_object_picking(false)\n\t\tv.add_child(p)\n\t\tc.add_child(v)\n\t\tadd_child(c)\n\n\t\tp.get_node(\"GridView\").set_process_input(false)\n\n\t\totherPuzzle = p #for use with network\n\n\t#music attempt\n\tvar musicPlayer = Globals.get(\"StreamPlayer\")\n\tvar songs = [load(\"res:\/\/main_theme_antris.ogg\")]\n\tadd_child(StreamPlayer)\n\tadd_child(musicPlayer)\n\tmusicPlayer.set_stream(songs[0])\n\tmusicPlayer.play()\n","old_contents":"# Provides functionality for the puzzle itself\n\nextends Spatial\n\nvar DataMan = preload( \"res:\/\/scripts\/DataManager.gd\" ).new()\nvar PuzzleManScript = preload( \"res:\/\/scripts\/PuzzleManager.gd\" )\nvar PuzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar puzzleMan\nvar seed\nvar otherPuzzle\nvar generateRandom = true\nvar mainPuzzle = false\n\nvar time = {\n\t\ton = true,\n\t\tval = 0.0,\n\t\tlabel = Label.new(),\n\t\ttween = Tween.new() }\n\nfunc addTimer():\n\tadd_child(time.label)\n\tadd_child(time.tween)\n\ttime.label.set_pos(Vector2(15,15))\n\n\ttime.label.set_theme(load(\"res:\/\/themes\/MainTheme.thm\"))\n\ttime.tween.interpolate_method(time.label, \"set_pos\", \\\n\t\t\ttime.label.get_pos(), time.label.get_pos()*2, 0.5, \\\n\t\t\tTween.TRANS_BOUNCE, Tween.EASE_OUT)\n\ttime.tween.start()\n\ttime.label.set_text(str(time.val))\n\nstatic func formatTime(t):\n\tvar mins = floor(t \/ 60)\n\tvar secs = fmod(floor(t), 60)\n\tvar millis = floor((t - floor(t)) * 1000)\n\treturn str(mins) + \":\" + str(secs).pad_zeros(2) + \":\" + str(millis).pad_zeros(3)\n\nfunc _process(dTime):\n\t# start label tween on\n\ttime.val += dTime\n\ttime.label.set_text(formatTime(time.val))\n\tif fmod(time.val, 10) < 0.1:\n\t\ttime.tween.seek(0.0)\n\n# Called for initialization\nfunc _ready():\n\tif time.on:\n\t\tset_process(true) # needed for time keeping\n\taddTimer()\n\n\t#set up network stuffs\n\tadd_child(load(\"res:\/\/networkProxy.scn\").instance())\n\tvar Network = Globals.get(\"Network\")\n\tif Network != null:\n\t\tNetwork.proxy.set_process(Network.isClient or Network.isHost)\n\n\n\t# generate puzzle\n\tpuzzleMan = PuzzleManScript.new()\n\tvar puzzle\n\n\tif generateRandom:\n\t\tseed = OS.get_unix_time() # unix time\n\t\tseed *= OS.get_ticks_msec() # initial time\n\t\tseed *= 1 + OS.get_time().second\n\t\tseed *= 1 + OS.get_date().weekday\n\t\tseed = abs(seed) % 7919 # 1000th prime\n\n\t\trand_seed(seed)\n\n\t\tpuzzle = puzzleMan.generatePuzzle( 2, puzzleMan.DIFF_HARD )\n\t\tpuzzle.puzzleMan = puzzleMan\n\t\tvar steps = puzzle.solvePuzzleSteps()\n\t\tprint(\"Generated \", puzzle.shape.size(), \" blocks.\" )\n\t\tprint( \"PUZZLE IS SOLVEABLE?: \", steps.solveable )\n\n\t\tvar gridMan = get_node( \"GridView\/GridMan\" )\n\t\tDataMan.savePuzzle(\"test.pzl\", puzzle)\n\t\tvar pCopy = DataMan.loadPuzzle(\"test.pzl\")\n\t\tgridMan.set_puzzle(puzzle)\n\n\n\n\t# make a new puzzle, embed using Viewport\n\tif mainPuzzle:\n\t\tif (not Network == null and Network.isNetwork):\n\t\t\tprint(\"Sending puzzle\")\n\t\t\tNetwork.sendStart(puzzle)\n\n\t\tvar p = PuzzleScn.instance()\n\t\tp.get_node(\"GridView\").active = false\n\t\tp.get_node(\"GridView\/GridMan\").set_puzzle(puzzle)\n\t\tp.mainPuzzle = false\n\t\tp.set_scale(Vector3(0.5, 0.5, 0.5))\n\t\tp.set_translation(Vector3(10, 5, -20))\n\n\t\tvar v = Viewport.new()\n\t\tvar c = Control.new()\n\n\t\tv.set_world(p.get_world())\n\t\tv.set_render_target_to_screen_rect(Rect2(20,20,40,40))\n\t\tv.set_physics_object_picking(false)\n\t\tv.add_child(p)\n\t\tc.add_child(v)\n\t\tadd_child(c)\n\n\t\tp.get_node(\"GridView\").set_process_input(false)\n\n\t\totherPuzzle = p #for use with network\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"bc672d8959ad22584bc1805a6bd64462766cb235","subject":"Fix regex demo after godot commit e3e2f06","message":"Fix regex demo after godot commit e3e2f06\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"misc\/regex\/regex.gd","new_file":"misc\/regex\/regex.gd","new_contents":"extends VBoxContainer\n\n# Member variables\nvar regex = RegEx.new()\n\nfunc update_expression(text):\n\tregex.compile(text)\n\tupdate_text()\n\nfunc update_text():\n\tfor child in $List.get_children():\n\t\tchild.queue_free()\n\tif regex.is_valid():\n\t\tvar matches = regex.search($Text.get_text())\n\t\tfor result in matches.get_strings():\n\t\t\tvar label = Label.new()\n\t\t\tlabel.text = result\n\t\t\t$List.add_child(label)\n\nfunc _ready():\n\t$Text.set_text(\"They asked me \\\"What's going on \\\\\\\"in the manor\\\\\\\"?\\\"\")\n\tupdate_expression($Expression.text)\n","old_contents":"extends VBoxContainer\n\n# Member variables\nvar regex = RegEx.new()\n\nfunc update_expression(text):\n\tregex.compile(text)\n\tupdate_text()\n\nfunc update_text():\n\tfor child in $List.get_children():\n\t\tchild.queue_free()\n\tif regex.is_valid():\n\t\tvar matches = regex.search($Text.get_text())\n\t\tfor result in matches.get_group_array():\n\t\t\tvar label = Label.new()\n\t\t\tlabel.text = result\n\t\t\t$List.add_child(label)\n\nfunc _ready():\n\t$Text.set_text(\"They asked me \\\"What's going on \\\\\\\"in the manor\\\\\\\"?\\\"\")\n\tupdate_expression($Expression.text)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"88ca7ab89b9bec483f34aba6df43ba75328b0420","subject":"gd \"G\u00e0idhlig\" translation #16346. Author: bretasker.","message":"gd \"G\u00e0idhlig\" translation #16346. Author: bretasker.\n","repos":"arex1337\/lila,clarkerubber\/lila,clarkerubber\/lila,clarkerubber\/lila,luanlv\/lila,arex1337\/lila,luanlv\/lila,luanlv\/lila,luanlv\/lila,clarkerubber\/lila,arex1337\/lila,luanlv\/lila,arex1337\/lila,luanlv\/lila,arex1337\/lila,clarkerubber\/lila,arex1337\/lila,luanlv\/lila,clarkerubber\/lila,arex1337\/lila,clarkerubber\/lila","old_file":"modules\/i18n\/messages\/messages.gd","new_file":"modules\/i18n\/messages\/messages.gd","new_contents":"playWithAFriend=Cluich c\u00f2mhla ri caraid\nplayWithTheMachine=Cluich an aghaidh a' choimpiutair\ntoInviteSomeoneToPlayGiveThisUrl=Gus cuireadh a thoirt do chuideigin, thoir an url seo dha\ngameOver=Cr\u00ecoch a\u2019 gheama\nwaitingForOpponent=A\u2019 feitheamh air n\u00e0mhaid\nwaiting=A\u2019 feitheamh\nyourTurn=An turas agad\naiNameLevelAiLevel=%s inbhe %s\nlevel=Inbhe\ntoggleTheChat=Toglaich a\u2019 chabadaich\ntoggleSound=Toglaich fuaim\nchat=Cabadaich\nresign=G\u00e8ill\ncheckmate=Tul-chasg\nstalemate=Clos-cluiche\nwhite=Geal\nblack=Dubh\nrandomColor=Dath air thuaiream\ncreateAGame=Cruthaich geama\nwhiteIsVictorious=Bhuannaich geal\nblackIsVictorious=Bhuannaich dubh\nkingInTheCenter=R\u00ecgh sa mheadhan\nthreeChecks=Tr\u00ec caisg\nnewOpponent=N\u00e0mhaid \u00f9r\nyourOpponentWantsToPlayANewGameWithYou=Tha an n\u00e0mhaid agad airson geama \u00f9r a chluich \u2019nad aghaidh\njoinTheGame=Thig a-steach dhan gheama\nwhitePlays=Tha geal a\u2019 cluich\nblackPlays=Tha dubh a\u2019 cluich\ntheOtherPlayerHasLeftTheGameYouCanForceResignationOrWaitForHim=Tha an cluicheadair eile air a' gheama fh\u00e0gail. Is urrainn dhut g\u00e8illeadh a chur air, geama ionnannach a ghairm, no feitheamh air a shon.\nmakeYourOpponentResign=Cuir g\u00e8illeadh air an n\u00e0mhaid agad\nforceResignation=Gairm buaidh\nforceDraw=Gairm geama ionnannach\ntalkInChat=D\u00e8an cabadaich\ntheFirstPersonToComeOnThisUrlWillPlayWithYou=Cluichidh a\u2019 chiad neach a thig a-steach air an url seo c\u00f2mhla riut.\nwhiteResigned=Gh\u00e8ill geal\nblackResigned=Gh\u00e8ill dubh\nwhiteLeftTheGame=Dh\u2019fh\u00e0g geal an geama\nblackLeftTheGame=Dh\u2019fh\u00e0g dubh an geama\nshareThisUrlToLetSpectatorsSeeTheGame=Co-roinn an url seo gus luchd-amhairc a leigeil a-steach dhan gheama\ntheComputerAnalysisHasFailed=Dh\u2019fh\u00e0illig le anailis a\u2019 choimpiutair\nviewTheComputerAnalysis=Seall anailis a\u2019 choimpiutair\nrequestAComputerAnalysis=Iarr anailis air a\u2019 choimpiutair\ncomputerAnalysis=Anailis a\u2019 choimpiutair\nanalysis=B\u00f2rd sgr\u00f9daidh\nblunders=Tuislidhean\nmistakes=Mearachdan\ninaccuracies=Neo-eagnaidhean\nmoveTimes=\u00d9ine nan gluasadan\nflipBoard=D\u00e8an flip air a\u2019 bh\u00f2rd\nthreefoldRepetition=Treas ath-nochdadh\nclaimADraw=Gairm co-tharraing\nofferDraw=Tairg co-tharraing\ndraw=Co-tharraing\nnbConnectedPlayers=%s cluicheadairean\ngamesBeingPlayedRightNow=Geamannan a tha \u2019gan cluich an-dr\u00e0sta fh\u00e8in\nviewAllNbGames=%s geamannan\nviewNbCheckmates=%s tul-chaisg\nnbBookmarks=%s comharran-l\u00ecn\nnbPopularGames=%s geamannan m\u00f2r-ch\u00f2rdte\nnbAnalysedGames=%s geamannan sgr\u00f9daichte\nbookmarkedByNbPlayers=Comharra-leabhair le %s cluicheadairean\nviewInFullSize=Seall sa mheud iomlan\nlogOut=Log a-mach\nsignIn=Log a-steach\nnewToLichess=\u00d9r air Lichess?\nyouNeedAnAccountToDoThat=Tha feum agad air cunntas gus sin a dh\u00e8anamh\nsignUp=Cl\u00e0raich\ngames=Geamannan\nforum=B\u00f2rd-brath\nxPostedInForumY=Sgr\u00ecobh %s san fh\u00f2ram %s\nlatestForumPosts=Na postaichean as \u00f9ire\nplayers=Cluicheadairean\nminutesPerSide=Mionaidean gach taobh\nvariant=Caochladh\nvariants=Se\u00f2rsachan\ntimeControl=Smachd air an \u00f9ine\nrealTime=F\u00ecor-\u00f9ine\ndaysPerTurn=L\u00e0ithean gach cuairt\noneDay=Aon latha\nnbDays=%s l\u00e0(ithean)\nnbHours=%s uair(ean)\ntime=\u00d9ine\nrating=Rangachadh\nusername=Ainm-cleachdaidh\nusernameOrEmail=Far-ainm\npassword=Facal-faire\nhaveAnAccount=A bheil cunntas agad?\nchangePassword=Atharraich am facal-faire\nchangeEmail=Atharraich am post-d\nemail=Post-d\nemailIsOptional=Tha am post-d roghainneil. cleachdaich Lichess an se\u00f2ladh puist-d agad gus am facal-faire agad ath-shuidheachadh ma dh\u00ecochuimhnicheas tu e.\npasswordReset=Ath-shuidheachadh an fhacail-fhaire\nforgotPassword=An do dh\u00ecochuimhnich thu am facal-faire?\nrank=Inbhe\ngamesPlayed=Geamannan air an cluich\nnbGamesWithYou=%s geamannan c\u00f2mhla riut\ndeclineInvitation=Di\u00f9lt cuireadh\ncancel=Sguir dheth\ntimeOut=Dh\u2019fhalbh an \u00f9ine\ndrawOfferSent=Chaidh tairgse airson co-tharraing a chur\ndrawOfferDeclined=Dhi\u00f9ltadh do thairgse airson co-tharraing\ndrawOfferAccepted=Ghabhadh ri do thairgse airson co-tharraing\ndrawOfferCanceled=Sguireadh de do thairgse airson co-tharraing\nwhiteOffersDraw=Tha geal a' tairgse co-tharraing\nblackOffersDraw=Tha dubh a' tairgse co-tharraing\nwhiteDeclinesDraw=Tha geal a' di\u00f9ltadh co-tharraing\nblackDeclinesDraw=Tha dubh a' di\u00f9ltadh co-tharraing\nyourOpponentOffersADraw=Tha an n\u00e0mhaid agad a\u2019 tairgse co-tharraing\naccept=Gabh ris\ndecline=Di\u00f9lt\nplayingRightNow=A\u2019 cluich an-dr\u00e0sta fh\u00e8in\nfinished=Cr\u00ecochnaichte\nabortGame=Stad an geama\ngameAborted=Chaidh sgur dhen gheama\nstandard=Coitcheann\nunlimited=Gun chr\u00ecoch\nmode=Modh\ncasual=Gun rangachadh\nrated=Rangaichte\nthisGameIsRated=Tha an geama seo rangaichte\nrematch=Ath-mhaids\nrematchOfferSent=Chaidh tairgse airson ath-mhaids a chur\nrematchOfferAccepted=Ghabhadh ri do thairgse airson ath-mhaids\nrematchOfferCanceled=Chaidh sgur dhe thairgse ath-mhaids\nrematchOfferDeclined=Tairgse ath-mhaids air a di\u00f9ltadh\ncancelRematchOffer=Sguir dhe thairgse ath-mhaids\nviewRematch=Seall an ath-mhaids\nplay=Cluich\ninbox=Bogsa a-steach\nchatRoom=Se\u00f2mar cabadaich\nspectatorRoom=Se\u00f2mar an luchd-amhairc\ncomposeMessage=Sgr\u00ecobh teachdaireachd\nnoNewMessages=Gun teachdaireachd \u00f9r\nsubject=Cuspair\nrecipient=Faightear\nsend=Cuir\nincrementInSeconds=Ioncramaid ann an diogan\nfreeOnlineChess=T\u00e0ileasg air loidhne an-asgaidh\nspectators=Luchd-amhairc:\nnbWins=Bhuannaich %s\nnbLosses=Chaill %s\nnbDraws=Co-tharraing %s\nexportGames=\u00c0s-phortaich geamannan\nratingRange=Rainse an rangachaidh\ngiveNbSeconds=Thoir %s diogan\npremoveEnabledClickAnywhereToCancel=Ro-ghluasad an comas - briog \u00e0ite sam bith airson sgur dheth\nthisPlayerUsesChessComputerAssistance=Tha an cluicheadair seo a\u2019 cleachdadh taic coimpiutair taileisg\nopening=Fosgladh\nopeningExplorer=Rannsachair fosgladh\ntakeback=Tarraing air ais\nproposeATakeback=Tairg tarraing air ais\ntakebackPropositionSent=Tairgse tarraing air ais air a cur\ntakebackPropositionDeclined=Tairgse tarraing air ais air a di\u00f9ltadh\ntakebackPropositionAccepted=Air gabhail ri tairgse tarraing air ais\ntakebackPropositionCanceled=Chaidh sgur dhe thairgse tarraing air ais\nyourOpponentProposesATakeback=Tha an n\u00e0mhaid a\u2019 tairgse tarraing air ais\nbookmarkThisGame=Cruthaich comharra-l\u00ecn airson a\u2019 gheama seo.\nsearch=Lorg\nadvancedSearch=Lorg adhartach\ntournament=F\u00e8ill-chluich\ntournaments=F\u00e8illean-chluich\ntournamentPoints=Puingean f\u00e8ill-chluich\nviewTournament=Seall an fh\u00e8ill-chluich\nbackToTournament=Till dhan fh\u00e8ill-chluich\nbackToGame=Till dhan gheama\nfreeOnlineChessGamePlayChessNowInACleanInterfaceNoRegistrationNoAdsNoPluginRequiredPlayChessWithComputerFriendsOrRandomOpponents=T\u00e0ileasg air loidhne an-asgaidh. Cluich t\u00e0ileasg ann am pr\u00f2gram air a bheil dreach glan. Gun chl\u00e0radh, gun sanasachd, gun fheum air plugan. Cluich t\u00e0ileasg an aghaidh a\u2019 choimpiutair, charaidean no n\u00e0imhdean air thuaiream.\nteams=Sgiobaidhean\nnbMembers=%s ball\nallTeams=A h-uile sgioba\nnewTeam=Sgioba \u00f9r\nmyTeams=Na sgiobaidhean agam\nnoTeamFound=Cha deach sgioba a lorg\njoinTeam=Gabh p\u00e0irt san sgioba\nquitTeam=F\u00e0g an sgioba\nanyoneCanJoin=Faodaidh duine sam bith p\u00e0irt a ghabhail ann\naConfirmationIsRequiredToJoin=Tha feum air dearbhadh gus p\u00e0irt a ghabhail ann\njoiningPolicy=Poileasaidh na ballrachd\nteamLeader=Ceannard an sgioba\nteamBestPlayers=Na cluicheadairean as fhearr\nteamRecentMembers=Na buill as \u00f9ire\nxJoinedTeamY=Ghabh %s ballrachd san sgioba %s\nxCreatedTeamY=Chruthaich %s an sgioba %s\naverageElo=Rangachadh cuibheasach\nlocation=\u00c0ite\nsettings=Roghainnean\nfilterGames=Criathraich na geamannan\nreset=Ath-shuidhich\napply=Cuir an s\u00e0s\nleaderboard=Cl\u00e0r nan curaidh\npasteTheFenStringHere=Cuir a-steach an t-sreang FEN an-seo\npasteThePgnStringHere=Cuir a-steach an t-sreang PGN an-seo\nfromPosition=On t-suidheachadh\ncontinueFromHere=Lean air adhart on a sheo\nimportGame=Ion-phortaich geama\nnbImportedGames=%s geamannan air an ion-phortadh\nthisIsAChessCaptcha=Seo CAPTCHA t\u00e0ileisg.\nclickOnTheBoardToMakeYourMove=Briog air a\u2019 bh\u00f2rd airson gluasad \u2019s dearbhaich gur e duine a th\u2019 annad.\nnotACheckmate=Chan e tul-chasg a th\u2019 ann\ncolorPlaysCheckmateInOne=Tha %s a\u2019 cluich; tul-chasg an ceann gluasaid\nretry=Feuch ris a-rithist\nreconnecting=Ag ath-cheangal\nonlineFriends=Caraidean air loidhne\nnoFriendsOnline=Chan eil caraid air loidhne\nfindFriends=Lorg caraidean\nfavoriteOpponents=Na farpaisichean as annsa leat\nfollow=Lean\nfollowing=A\u2019 leantainn\nunfollow=Na lean an corr\nblock=Bac\nblocked=Bacte\nunblock=D\u00ec-bhac\nfollowsYou=\u2019Gad leantainn\nxStartedFollowingY=Th\u00f2isich %s a\u2019 leantainn %s\nnbFollowers=%s luchd-leantainn\nnbFollowing=%s a' leantainn\nmore=Barrachd\nmemberSince=Ball o chionn\nlastSeenActive=An logadh a-steach mu dheireadh %s\nchallengeToPlay=Thoir d\u00f9bhlan cluiche dha\nplayer=Cluicheadair\nlist=Liosta\ngraph=Graf\nlessThanNbMinutes=Nas lugha na %s mionaidean\nxToYMinutes=%s gu %s mionaidean\ntextIsTooShort=Tha an teacsa ro ghoirid.\ntextIsTooLong=Tha an teacsa ro fhada.\nrequired=Riatanach.\nopenTournaments=F\u00e8ill-chluichean fosgailte\nduration=Faid\nwinner=Buannaiche\nstanding=Suidheachadh\ncreateANewTournament=Cruthaich f\u00e8ill-chluich \u00f9r\njoin=Gabh p\u00e0irt ann\nwithdraw=C\u00f9laich\npoints=Puingean\nwins=Buaidhean\nlosses=Ruaigean\nwinStreak=Sreath de bhuaidhean\ncreatedBy=Air a chruthachadh le\ntournamentIsStarting=Tha an fh\u00e8ill-chluich gu bhith t\u00f2iseachadh\nmembersOnly=Buill a-mh\u00e0in\nboardEditor=Deasaiche a\u2019 bh\u00f9ird\nstartPosition=Suidheachadh an t\u00f2iseachaidh\nclearBoard=Falamhaich am b\u00f2rd\nsavePosition=S\u00e0bhail an suidheachadh\nloadPosition=Luchdaich suidheachadh\nisPrivate=Pr\u00ecobhaideach\nreportXToModerators=Cuir gearan mu %s dha na maoir\nprofile=Pr\u00f2ifil\neditProfile=Deasaich a\u2019 phr\u00f2ifil\nfirstName=Ainm\nlastName=Sloinneadh\nbiography=Eachdraidh-beatha\ncountry=D\u00f9thaich\npreferences=Roghainnean\nwatchLichessTV=Coimhead air tbh Lichess\npreviouslyOnLichessTV=Air tbh Lichess roimhe\nonlinePlayers=Cluicheadairean air loidhne\nactiveToday=Gn\u00ecomhach an-diugh\nactivePlayers=Cluicheadairean gn\u00ecomhach\nbewareTheGameIsRatedButHasNoClock=Thoir an aire, th\u00e8id an geama seo rangachadh ach chan eil uaireadair aige!\ntraining=Tr\u00e8anadh\nyourPuzzleRatingX=An rangachadh agad: %s\nfindTheBestMoveForWhite=Lorg an gluasad as fhearr airson geal.\nfindTheBestMoveForBlack=Lorg an gluasad as fhearr airson dubh.\ntoTrackYourProgress=Gus s\u00f9il a chumail air d\u2019 adhartas:\ntrainingSignupExplanation=Bheir Lichess t\u00f2imhseachain dhut a bhios freagarrach dhan chomas agad ach am faigh thu tr\u00e8anadh as iomchaidh.\nrecentlyPlayedPuzzles=T\u00f2imhseachain o chionn goirid\npuzzleId=T\u00f2imhseachan %s\npuzzleOfTheDay=T\u00f2imhseachan an latha\nclickToSolve=Briog an-seo airson fhuasgladh\ngoodMove=Seo gluasad math\nbutYouCanDoBetter=Ach tha gluasad nas fhearr ann.\nbestMove=Seo an gluasad as fhearr!\nkeepGoing=Cum ort...\npuzzleFailed=Cha deach leat\nbutYouCanKeepTrying=Ach faodaidh tu feuchainn a-rithist.\nvictory=Buaidh!\ngiveUp=Thoir g\u00e8ill\npuzzleSolvedInXSeconds=Rinn thu a\u2019 ch\u00f9is air an ceann %s diog.\nwasThisPuzzleAnyGood=An robh an t\u00f2imhseachan seo math?\npleaseVotePuzzle=Cuidich lichess \u2019s cuir bh\u00f2t ann leis an t-saighead suas no s\u00ecos:\nthankYou=M\u00f2ran taing!\nratingX=Rangachadh: %s\nplayedXTimes=Air a chluich %s turas\nfromGameLink=On gheama %s\nstartTraining=T\u00f2isich air an tr\u00e8anadh\ncontinueTraining=Lean air adhart leis an tr\u00e8anadh\nretryThisPuzzle=Feuch ris an t\u00f2imhseachan seo a-rithist\nthisPuzzleIsCorrect=Tha an t\u00f2imhseachan seo ceart is inntinneach\nthisPuzzleIsWrong=Tha an t\u00f2imhseachan seo cearr no d\u00f2rainneach\nyouHaveNbSecondsToMakeYourFirstMove=Tha %s diog(an) air fh\u00e0gail dhut airson a' chiad gluasaid agad!\nnbGamesInPlay=%s geama 'gan cluich\nopeningId=Fosgladh %s\nyourOpeningRatingX=An rangachadh fosglaidh agad: %s\nfindNbStrongMoves=Lorg %s gluasad(an) l\u00e0idir\nthisMoveGivesYourOpponentTheAdvantage=Tha an gluasad seo a' toirt buannachd dha do n\u00e0mhaid\nopeningFailed=Dh'fh\u00e0illig leis an fhosgladh\nopeningSolved=Chaidh am fosgladh fhuasgladh\nrecentlyPlayedOpenings=Fosglaidhean a chaidh a chluich o chionn goirid\npuzzles=T\u00f2imhseachain\ncoordinates=Co-chomharran\nopenings=Fosglaidhean\nlatestUpdates=Na naidheachdan as \u00f9ire\ntournamentWinners=Feadhainn a bhuannaich f\u00e8ill-chluich\nname=Ainm\ndescription=Tuairisgeul\nno=Chan eil\nyes=Tha\nhelp=Cobhair:\ncreateANewTopic=Cruthaich cuspair \u00f9r\ntopics=Cuspairean\nposts=Postaichean\nlastPost=Am post mu dheireadh\nviews=Air a shealltainn\nreplies=Freagairtean\nreplyToThisTopic=Freagair dhan chuspair seo\nreply=Freagair\nmessage=Teachdaireachd\ncreateTheTopic=Cruthaich an cuspair\nreportAUser=D\u00e8an aithris air cleachdaiche\nuser=Cleachdaiche\nreason=Adhbhar\nwhatIsIheMatter=D\u00e8 an trioblaid?\ncheat=Cealgaireachd\ninsult=Mosach\ntroll=Troll\nother=Adhbhar eile\nby=le %s\nthisTopicIsNowClosed=Tha an cuspair seo d\u00f9inte a-nis.\ntheming=\u00d9rlar\nblog=Bloga\nquestionsAndAnswers=Ceistean & Freagairtean\nnotes=N\u00f2taichean\ntypePrivateNotesHere=Sgr\u00ecobh notaichean pr\u00ecobhaideach an seo\nprivacy=Pr\u00ecobhaideachd\nsound=Fuaim\ndifficultyEasy=Furasta\ndifficultyNormal=Meadhanach\ndifficultyHard=Doirbh\nxCompetesInY=%s a' gabhail p\u00e0irt ann an %s\ntimeline=Loidhne-t\u00ecm\nseeAllTournaments=Faic na f\u00e8illean-cluich uile\nstarting=A' t\u00f2iseachadh:\nyourCityRegionOrDepartment=Do bhaile, do sg\u00ecre no do mh\u00f3r-roinn.\nbiographyDescription=Innis mu do dheidhinn, de 's toigh leat ann an t\u00e0ileasg, na fosglaidhean as fhearr leat, geamannan, cluicheadairean...\nmaximumNbCharacters=A' chuid as motha: %s caractarean.\nlearn=Ionnsaich\ncommunity=Coimhearsnachd\ntools=Goireasean\nincrement=Ioncramaid\nboard=B\u00f2rd\npieces=P\u00ecosan\nmenu=Cl\u00e0r-taice\nnbForumPosts=%s Puist air F\u00f2ram\ntpTimeSpentPlaying=\u00d9ine a' cluich: %s\nwhiteCastlingKingside=Geal O-O\nwhiteCastlingQueenside=Geal O-O-O\nblackCastlingKingside=Dubh O-O\nblackCastlingQueenside=Dubh O-O-O\nwatchGames=Coimhead geamannan\ntpTimeSpentOnTV=\u00d9ine air tbh: %s\nwatch=Coimhead\nvideoLibrary=Cruinneachadh bhidiothan\ncontact=Cuir fios\nlichessTournaments=F\u00e9illean-chluich Lichess\ntournamentOfficial=Oifigeil\ntimeBeforeTournamentStarts=\u00d9ine mus t\u00f2isich an fh\u00e9ill-chluich\naverageCentipawnLoss=Call cuibheas ciadap\u00e0n\nkeyboardShortcuts=Ath-ghoiridean cl\u00e0r-iuchrach\nyouAreBetterThanPercentOfPerfTypePlayers=Tha thu nas fhearr na %s de chluicheadairean %s.\nconfirmResignation=Cinntich an g\u00e8illeadh\n","old_contents":"playWithAFriend=Cluich c\u00f2mhla ri caraid\nplayWithTheMachine=Cluich an aghaidh a' choimpiutair\ntoInviteSomeoneToPlayGiveThisUrl=Gus cuireadh a thoirt do chuideigin, thoir an url seo dha\ngameOver=Cr\u00ecoch a\u2019 gheama\nwaitingForOpponent=A\u2019 feitheamh air n\u00e0mhaid\nwaiting=A\u2019 feitheamh\nyourTurn=An turas agad\naiNameLevelAiLevel=%s inbhe %s\nlevel=Inbhe\ntoggleTheChat=Toglaich a\u2019 chabadaich\ntoggleSound=Toglaich fuaim\nchat=Cabadaich\nresign=G\u00e8ill\ncheckmate=Tul-chasg\nstalemate=Clos-cluiche\nwhite=Geal\nblack=Dubh\nrandomColor=Dath air thuaiream\ncreateAGame=Cruthaich geama\nwhiteIsVictorious=Bhuannaich geal\nblackIsVictorious=Bhuannaich dubh\nkingInTheCenter=R\u00ecgh sa mheadhan\nthreeChecks=Tr\u00ec caisg\nraceFinished=R\u00e8is cr\u00ecochnaichte\nvariantEnding=Caisg den t-se\u00f2rsa seo\nnewOpponent=N\u00e0mhaid \u00f9r\nyourOpponentWantsToPlayANewGameWithYou=Tha an n\u00e0mhaid agad airson geama \u00f9r a chluich \u2019nad aghaidh\njoinTheGame=Thig a-steach dhan gheama\nwhitePlays=Tha geal a\u2019 cluich\nblackPlays=Tha dubh a\u2019 cluich\ntheOtherPlayerHasLeftTheGameYouCanForceResignationOrWaitForHim=Tha an cluicheadair eile air a' gheama fh\u00e0gail. Is urrainn dhut g\u00e8illeadh a chur air, geama ionnannach a ghairm, no feitheamh air a shon.\nmakeYourOpponentResign=Cuir g\u00e8illeadh air an n\u00e0mhaid agad\nforceResignation=Gairm buaidh\nforceDraw=Gairm geama ionnannach\ntalkInChat=D\u00e8an cabadaich\ntheFirstPersonToComeOnThisUrlWillPlayWithYou=Cluichidh a\u2019 chiad neach a thig a-steach air an url seo c\u00f2mhla riut.\nwhiteResigned=Gh\u00e8ill geal\nblackResigned=Gh\u00e8ill dubh\nwhiteLeftTheGame=Dh\u2019fh\u00e0g geal an geama\nblackLeftTheGame=Dh\u2019fh\u00e0g dubh an geama\nshareThisUrlToLetSpectatorsSeeTheGame=Co-roinn an url seo gus luchd-amhairc a leigeil a-steach dhan gheama\ntheComputerAnalysisHasFailed=Dh\u2019fh\u00e0illig le anailis a\u2019 choimpiutair\nviewTheComputerAnalysis=Seall anailis a\u2019 choimpiutair\nrequestAComputerAnalysis=Iarr anailis air a\u2019 choimpiutair\ncomputerAnalysis=Anailis a\u2019 choimpiutair\nanalysis=B\u00f2rd sgr\u00f9daidh\nblunders=Tuislidhean\nmistakes=Mearachdan\ninaccuracies=Neo-eagnaidhean\nmoveTimes=\u00d9ine nan gluasadan\nflipBoard=D\u00e8an flip air a\u2019 bh\u00f2rd\nthreefoldRepetition=Treas ath-nochdadh\nclaimADraw=Gairm co-tharraing\nofferDraw=Tairg co-tharraing\ndraw=Co-tharraing\nnbConnectedPlayers=%s cluicheadairean\ngamesBeingPlayedRightNow=Geamannan a tha \u2019gan cluich an-dr\u00e0sta fh\u00e8in\nviewAllNbGames=%s geamannan\nviewNbCheckmates=%s tul-chaisg\nnbBookmarks=%s comharran-l\u00ecn\nnbPopularGames=%s geamannan m\u00f2r-ch\u00f2rdte\nnbAnalysedGames=%s geamannan sgr\u00f9daichte\nbookmarkedByNbPlayers=Comharra-leabhair le %s cluicheadairean\nviewInFullSize=Seall sa mheud iomlan\nlogOut=Log a-mach\nsignIn=Log a-steach\nnewToLichess=\u00d9r air Lichess?\nyouNeedAnAccountToDoThat=Tha feum agad air cunntas gus sin a dh\u00e8anamh\nsignUp=Cl\u00e0raich\ngames=Geamannan\nforum=B\u00f2rd-brath\nxPostedInForumY=Sgr\u00ecobh %s san fh\u00f2ram %s\nlatestForumPosts=Na postaichean as \u00f9ire\nplayers=Cluicheadairean\nminutesPerSide=Mionaidean gach taobh\nvariant=Caochladh\nvariants=Se\u00f2rsachan\ntimeControl=Smachd air an \u00f9ine\nrealTime=F\u00ecor-\u00f9ine\ndaysPerTurn=L\u00e0ithean gach cuairt\noneDay=Aon latha\nnbDays=%s l\u00e0(ithean)\nnbHours=%s uair(ean)\ntime=\u00d9ine\nrating=Rangachadh\nusername=Ainm-cleachdaidh\nusernameOrEmail=Far-ainm\npassword=Facal-faire\nhaveAnAccount=A bheil cunntas agad?\nchangePassword=Atharraich am facal-faire\nchangeEmail=Atharraich am post-d\nemail=Post-d\nemailIsOptional=Tha am post-d roghainneil. cleachdaich Lichess an se\u00f2ladh puist-d agad gus am facal-faire agad ath-shuidheachadh ma dh\u00ecochuimhnicheas tu e.\npasswordReset=Ath-shuidheachadh an fhacail-fhaire\nforgotPassword=An do dh\u00ecochuimhnich thu am facal-faire?\nrank=Inbhe\ngamesPlayed=Geamannan air an cluich\nnbGamesWithYou=%s geamannan c\u00f2mhla riut\ndeclineInvitation=Di\u00f9lt cuireadh\ncancel=Sguir dheth\ntimeOut=Dh\u2019fhalbh an \u00f9ine\ndrawOfferSent=Chaidh tairgse airson co-tharraing a chur\ndrawOfferDeclined=Dhi\u00f9ltadh do thairgse airson co-tharraing\ndrawOfferAccepted=Ghabhadh ri do thairgse airson co-tharraing\ndrawOfferCanceled=Sguireadh de do thairgse airson co-tharraing\nwhiteOffersDraw=Tha geal a' tairgse co-tharraing\nblackOffersDraw=Tha dubh a' tairgse co-tharraing\nwhiteDeclinesDraw=Tha geal a' di\u00f9ltadh co-tharraing\nblackDeclinesDraw=Tha dubh a' di\u00f9ltadh co-tharraing\nyourOpponentOffersADraw=Tha an n\u00e0mhaid agad a\u2019 tairgse co-tharraing\naccept=Gabh ris\ndecline=Di\u00f9lt\nplayingRightNow=A\u2019 cluich an-dr\u00e0sta fh\u00e8in\nfinished=Cr\u00ecochnaichte\nabortGame=Stad an geama\ngameAborted=Chaidh sgur dhen gheama\nstandard=Coitcheann\nunlimited=Gun chr\u00ecoch\nmode=Modh\ncasual=Gun rangachadh\nrated=Rangaichte\nthisGameIsRated=Tha an geama seo rangaichte\nrematch=Ath-mhaids\nrematchOfferSent=Chaidh tairgse airson ath-mhaids a chur\nrematchOfferAccepted=Ghabhadh ri do thairgse airson ath-mhaids\nrematchOfferCanceled=Chaidh sgur dhe thairgse ath-mhaids\nrematchOfferDeclined=Tairgse ath-mhaids air a di\u00f9ltadh\ncancelRematchOffer=Sguir dhe thairgse ath-mhaids\nviewRematch=Seall an ath-mhaids\nplay=Cluich\ninbox=Bogsa a-steach\nchatRoom=Se\u00f2mar cabadaich\nspectatorRoom=Se\u00f2mar an luchd-amhairc\ncomposeMessage=Sgr\u00ecobh teachdaireachd\nnoNewMessages=Gun teachdaireachd \u00f9r\nsubject=Cuspair\nrecipient=Faightear\nsend=Cuir\nincrementInSeconds=Ioncramaid ann an diogan\nfreeOnlineChess=T\u00e0ileasg air loidhne an-asgaidh\nspectators=Luchd-amhairc:\nnbWins=Bhuannaich %s\nnbLosses=Chaill %s\nnbDraws=Co-tharraing %s\nexportGames=\u00c0s-phortaich geamannan\nratingRange=Rainse an rangachaidh\ngiveNbSeconds=Thoir %s diogan\npremoveEnabledClickAnywhereToCancel=Ro-ghluasad an comas - briog \u00e0ite sam bith airson sgur dheth\nthisPlayerUsesChessComputerAssistance=Tha an cluicheadair seo a\u2019 cleachdadh taic coimpiutair taileisg\nopening=Fosgladh\ntakeback=Tarraing air ais\nproposeATakeback=Tairg tarraing air ais\ntakebackPropositionSent=Tairgse tarraing air ais air a cur\ntakebackPropositionDeclined=Tairgse tarraing air ais air a di\u00f9ltadh\ntakebackPropositionAccepted=Air gabhail ri tairgse tarraing air ais\ntakebackPropositionCanceled=Chaidh sgur dhe thairgse tarraing air ais\nyourOpponentProposesATakeback=Tha an n\u00e0mhaid a\u2019 tairgse tarraing air ais\nbookmarkThisGame=Cruthaich comharra-l\u00ecn airson a\u2019 gheama seo.\nsearch=Lorg\nadvancedSearch=Lorg adhartach\ntournament=F\u00e8ill-chluich\ntournaments=F\u00e8illean-chluich\ntournamentPoints=Puingean f\u00e8ill-chluich\nviewTournament=Seall an fh\u00e8ill-chluich\nbackToTournament=Till dhan fh\u00e8ill-chluich\nbackToGame=Till dhan gheama\nfreeOnlineChessGamePlayChessNowInACleanInterfaceNoRegistrationNoAdsNoPluginRequiredPlayChessWithComputerFriendsOrRandomOpponents=T\u00e0ileasg air loidhne an-asgaidh. Cluich t\u00e0ileasg ann am pr\u00f2gram air a bheil dreach glan. Gun chl\u00e0radh, gun sanasachd, gun fheum air plugan. Cluich t\u00e0ileasg an aghaidh a\u2019 choimpiutair, charaidean no n\u00e0imhdean air thuaiream.\nteams=Sgiobaidhean\nnbMembers=%s ball\nallTeams=A h-uile sgioba\nnewTeam=Sgioba \u00f9r\nmyTeams=Na sgiobaidhean agam\nnoTeamFound=Cha deach sgioba a lorg\njoinTeam=Gabh p\u00e0irt san sgioba\nquitTeam=F\u00e0g an sgioba\nanyoneCanJoin=Faodaidh duine sam bith p\u00e0irt a ghabhail ann\naConfirmationIsRequiredToJoin=Tha feum air dearbhadh gus p\u00e0irt a ghabhail ann\njoiningPolicy=Poileasaidh na ballrachd\nteamLeader=Ceannard an sgioba\nteamBestPlayers=Na cluicheadairean as fhearr\nteamRecentMembers=Na buill as \u00f9ire\nxJoinedTeamY=Ghabh %s ballrachd san sgioba %s\nxCreatedTeamY=Chruthaich %s an sgioba %s\naverageElo=Rangachadh cuibheasach\nlocation=\u00c0ite\nsettings=Roghainnean\nfilterGames=Criathraich na geamannan\nreset=Ath-shuidhich\napply=Cuir an s\u00e0s\nleaderboard=Cl\u00e0r nan curaidh\npasteTheFenStringHere=Cuir a-steach an t-sreang FEN an-seo\npasteThePgnStringHere=Cuir a-steach an t-sreang PGN an-seo\nfromPosition=On t-suidheachadh\ncontinueFromHere=Lean air adhart on a sheo\nimportGame=Ion-phortaich geama\nnbImportedGames=%s geamannan air an ion-phortadh\nthisIsAChessCaptcha=Seo CAPTCHA t\u00e0ileisg.\nclickOnTheBoardToMakeYourMove=Briog air a\u2019 bh\u00f2rd airson gluasad \u2019s dearbhaich gur e duine a th\u2019 annad.\nnotACheckmate=Chan e tul-chasg a th\u2019 ann\ncolorPlaysCheckmateInOne=Tha %s a\u2019 cluich; tul-chasg an ceann gluasaid\nretry=Feuch ris a-rithist\nreconnecting=Ag ath-cheangal\nonlineFriends=Caraidean air loidhne\nnoFriendsOnline=Chan eil caraid air loidhne\nfindFriends=Lorg caraidean\nfavoriteOpponents=Na farpaisichean as annsa leat\nfollow=Lean\nfollowing=A\u2019 leantainn\nunfollow=Na lean an corr\nblock=Bac\nblocked=Bacte\nunblock=D\u00ec-bhac\nfollowsYou=\u2019Gad leantainn\nxStartedFollowingY=Th\u00f2isich %s a\u2019 leantainn %s\nnbFollowers=%s luchd-leantainn\nnbFollowing=%s a' leantainn\nmore=Barrachd\nmemberSince=Ball o chionn\nlastSeenActive=An logadh a-steach mu dheireadh %s\nchallengeToPlay=Thoir d\u00f9bhlan cluiche dha\nplayer=Cluicheadair\nlist=Liosta\ngraph=Graf\nlessThanNbMinutes=Nas lugha na %s mionaidean\nxToYMinutes=%s gu %s mionaidean\ntextIsTooShort=Tha an teacsa ro ghoirid.\ntextIsTooLong=Tha an teacsa ro fhada.\nrequired=Riatanach.\nopenTournaments=F\u00e8ill-chluichean fosgailte\nduration=Faid\nwinner=Buannaiche\nstanding=Suidheachadh\ncreateANewTournament=Cruthaich f\u00e8ill-chluich \u00f9r\njoin=Gabh p\u00e0irt ann\nwithdraw=C\u00f9laich\npoints=Puingean\nwins=Buaidhean\nlosses=Ruaigean\nwinStreak=Sreath de bhuaidhean\ncreatedBy=Air a chruthachadh le\ntournamentIsStarting=Tha an fh\u00e8ill-chluich gu bhith t\u00f2iseachadh\nmembersOnly=Buill a-mh\u00e0in\nboardEditor=Deasaiche a\u2019 bh\u00f9ird\nstartPosition=Suidheachadh an t\u00f2iseachaidh\nclearBoard=Falamhaich am b\u00f2rd\nsavePosition=S\u00e0bhail an suidheachadh\nloadPosition=Luchdaich suidheachadh\nisPrivate=Pr\u00ecobhaideach\nreportXToModerators=Cuir gearan mu %s dha na maoir\nprofile=Pr\u00f2ifil\neditProfile=Deasaich a\u2019 phr\u00f2ifil\nfirstName=Ainm\nlastName=Sloinneadh\nbiography=Eachdraidh-beatha\ncountry=D\u00f9thaich\npreferences=Roghainnean\nwatchLichessTV=Coimhead air tbh Lichess\npreviouslyOnLichessTV=Air tbh Lichess roimhe\nonlinePlayers=Cluicheadairean air loidhne\nactiveToday=Gn\u00ecomhach an-diugh\nactivePlayers=Cluicheadairean gn\u00ecomhach\nbewareTheGameIsRatedButHasNoClock=Thoir an aire, th\u00e8id an geama seo rangachadh ach chan eil uaireadair aige!\ntraining=Tr\u00e8anadh\nyourPuzzleRatingX=An rangachadh agad: %s\nfindTheBestMoveForWhite=Lorg an gluasad as fhearr airson geal.\nfindTheBestMoveForBlack=Lorg an gluasad as fhearr airson dubh.\ntoTrackYourProgress=Gus s\u00f9il a chumail air d\u2019 adhartas:\ntrainingSignupExplanation=Bheir Lichess t\u00f2imhseachain dhut a bhios freagarrach dhan chomas agad ach am faigh thu tr\u00e8anadh as iomchaidh.\nrecentlyPlayedPuzzles=T\u00f2imhseachain o chionn goirid\npuzzleId=T\u00f2imhseachan %s\npuzzleOfTheDay=T\u00f2imhseachan an latha\nclickToSolve=Briog an-seo airson fhuasgladh\ngoodMove=Seo gluasad math\nbutYouCanDoBetter=Ach tha gluasad nas fhearr ann.\nbestMove=Seo an gluasad as fhearr!\nkeepGoing=Cum ort...\npuzzleFailed=Cha deach leat\nbutYouCanKeepTrying=Ach faodaidh tu feuchainn a-rithist.\nvictory=Buaidh!\ngiveUp=Thoir g\u00e8ill\npuzzleSolvedInXSeconds=Rinn thu a\u2019 ch\u00f9is air an ceann %s diog.\nwasThisPuzzleAnyGood=An robh an t\u00f2imhseachan seo math?\npleaseVotePuzzle=Cuidich lichess \u2019s cuir bh\u00f2t ann leis an t-saighead suas no s\u00ecos:\nthankYou=M\u00f2ran taing!\nratingX=Rangachadh: %s\nplayedXTimes=Air a chluich %s turas\nfromGameLink=On gheama %s\nstartTraining=T\u00f2isich air an tr\u00e8anadh\ncontinueTraining=Lean air adhart leis an tr\u00e8anadh\nretryThisPuzzle=Feuch ris an t\u00f2imhseachan seo a-rithist\nthisPuzzleIsCorrect=Tha an t\u00f2imhseachan seo ceart is inntinneach\nthisPuzzleIsWrong=Tha an t\u00f2imhseachan seo cearr no d\u00f2rainneach\nyouHaveNbSecondsToMakeYourFirstMove=Tha %s diog(an) air fh\u00e0gail dhut airson a' chiad gluasaid agad!\nnbGamesInPlay=%s geama 'gan cluich\nopeningId=Fosgladh %s\nyourOpeningRatingX=An rangachadh fosglaidh agad: %s\nfindNbStrongMoves=Lorg %s gluasad(an) l\u00e0idir\nthisMoveGivesYourOpponentTheAdvantage=Tha an gluasad seo a' toirt buannachd dha do n\u00e0mhaid\nopeningFailed=Dh'fh\u00e0illig leis an fhosgladh\nopeningSolved=Chaidh am fosgladh fhuasgladh\nrecentlyPlayedOpenings=Fosglaidhean a chaidh a chluich o chionn goirid\npuzzles=T\u00f2imhseachain\ncoordinates=Co-chomharran\nopenings=Fosglaidhean\nlatestUpdates=Na naidheachdan as \u00f9ire\ntournamentWinners=Feadhainn a bhuannaich f\u00e8ill-chluich\nname=Ainm\ndescription=Tuairisgeul\nno=Chan eil\nyes=Tha\nhelp=Cobhair:\ncreateANewTopic=Cruthaich cuspair \u00f9r\ntopics=Cuspairean\nposts=Postaichean\nlastPost=Am post mu dheireadh\nviews=Air a shealltainn\nreplies=Freagairtean\nreplyToThisTopic=Freagair dhan chuspair seo\nreply=Freagair\nmessage=Teachdaireachd\ncreateTheTopic=Cruthaich an cuspair\nreportAUser=D\u00e8an aithris air cleachdaiche\nuser=Cleachdaiche\nreason=Adhbhar\nwhatIsIheMatter=D\u00e8 an trioblaid?\ncheat=Cealgaireachd\ninsult=Mosach\ntroll=Troll\nother=Adhbhar eile\nby=le %s\nthisTopicIsNowClosed=Tha an cuspair seo d\u00f9inte a-nis.\ntheming=\u00d9rlar\nblog=Bloga\nquestionsAndAnswers=Ceistean & Freagairtean\nnotes=N\u00f2taichean\ntypePrivateNotesHere=Sgr\u00ecobh notaichean pr\u00ecobhaideach an seo\nprivacy=Pr\u00ecobhaideachd\nsound=Fuaim\nnormal=Meadhanach\nalways=An c\u00f2mhnaidh\ndifficultyEasy=Furasta\ndifficultyNormal=Meadhanach\ndifficultyHard=Doirbh\nxCompetesInY=%s a' gabhail p\u00e0irt ann an %s\ntimeline=Loidhne-t\u00ecm\nseeAllTournaments=Faic na f\u00e8illean-cluich uile\nstarting=A' t\u00f2iseachadh:\nyourCityRegionOrDepartment=Do bhaile, do sg\u00ecre no do mh\u00f3r-roinn.\nbiographyDescription=Innis mu do dheidhinn, de 's toigh leat ann an t\u00e0ileasg, na fosglaidhean as fhearr leat, geamannan, cluicheadairean...\nmaximumNbCharacters=A' chuid as motha: %s caractarean.\nlearn=Ionnsaich\ncommunity=Coimhearsnachd\ntools=Goireasean\nincrement=Ioncramaid\nboard=B\u00f2rd\npieces=P\u00ecosan\nmenu=Cl\u00e0r-taice\nnbForumPosts=%s Puist air F\u00f2ram\ntpTimeSpentPlaying=\u00d9ine a' cluich: %s\nwatchGames=Coimhead geamannan\ntpTimeSpentOnTV=\u00d9ine air tbh: %s\nwatch=Coimhead\nvideoLibrary=Cruinneachadh bhidiothan\ncontact=Cuir fios\nlichessTournaments=F\u00e9illean-chluich Lichess\ntournamentOfficial=Oifigeil\ntimeBeforeTournamentStarts=\u00d9ine mus t\u00f2isich an fh\u00e9ill-chluich\nyouAreBetterThanPercentOfPerfTypePlayers=Tha thu nas fhearr na %s de chluicheadairean %s.\nconfirmResignation=Cinntich an g\u00e8illeadh\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"GDScript"} {"commit":"ec95d1e7893a309bc229e050c3474ab66dcd7a8c","subject":"More Bug Fixes -=-=-=-=-=-=-","message":"More Bug Fixes\n-=-=-=-=-=-=-\n\n-Fixed a few bugs in Mixer, now playback of chiptunes works great :)\n-Changed how visibility AABB generation from skeletons work, it's fully automatic and real-time now, generated from current skeleton pose for the frame.\n-Fixed camera in 3D kinematic character demo.\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"3d\/kinematic_char\/follow_camera.gd","new_file":"3d\/kinematic_char\/follow_camera.gd","new_contents":"\nextends Camera\n\n# member variables here, example:\n# var a=2\n# var b=\"textvar\"\n\nvar collision_exception=[]\nexport var min_distance=0.5\nexport var max_distance=4.0\nexport var angle_v_adjust=0.0\nexport var autoturn_ray_aperture=25\nexport var autoturn_speed=50\nvar max_height = 2.0\nvar min_height = 0\n\nfunc _fixed_process(dt):\n\tvar target = get_parent().get_global_transform().origin\n\tvar pos = get_global_transform().origin\n\tvar up = Vector3(0,1,0)\n\t\n\tvar delta = pos - target\n\t\n\t#regular delta follow\n\t\n\t#check ranges\n\t\n\tif (delta.length() < min_distance):\n\t\tdelta = delta.normalized() * min_distance\n\telif (delta.length() > max_distance):\n\t\tdelta = delta.normalized() * max_distance\n\t\n\t#check upper and lower height\n\tif ( delta.y > max_height):\n\t\tdelta.y = max_height\n\tif ( delta.y < min_height):\n\t\tdelta.y = min_height\n\t\t\n\t#check autoturn\n\t\n\tvar ds = PhysicsServer.space_get_direct_state( get_world().get_space() )\n\t\n\t\n\tvar col_left = ds.intersect_ray(target,target+Matrix3(up,deg2rad(autoturn_ray_aperture)).xform(delta),collision_exception)\n\tvar col = ds.intersect_ray(target,target,collision_exception)\n\tvar col_right = ds.intersect_ray(target,target+Matrix3(up,deg2rad(-autoturn_ray_aperture)).xform(delta),collision_exception)\n\t\n\tif (!col.empty()):\n\t\t#if main ray was occluded, get camera closer, this is the worst case scenario\n\t\tdelta = col.position - target\t\n\telif (!col_left.empty() and col_right.empty()):\n\t\t#if only left ray is occluded, turn the camera around to the right\n\t\tdelta = Matrix3(up,deg2rad(-dt*autoturn_speed)).xform(delta)\n\telif (col_left.empty() and !col_right.empty()):\n\t\t#if only right ray is occluded, turn the camera around to the left\n\t\tdelta = Matrix3(up,deg2rad(dt*autoturn_speed)).xform(delta)\n\telse:\n\t\t#do nothing otherwise, left and right are occluded but center is not, so do not autoturn\n\t\tpass\n\t\n\t#apply lookat\n\tpos = target + delta\n\t\n\tlook_at_from_pos(pos,target,up)\n\t\n\t#turn a little up or down\n\tvar t = get_transform()\n\tt.basis = Matrix3(t.basis[0],deg2rad(angle_v_adjust)) * t.basis\n\tset_transform(t)\n\t\n\t\n\nfunc _ready():\n\n#find collision exceptions for ray\n\tvar node = self\n\twhile(node):\n\t\tif (node extends RigidBody):\n\t\t\tcollision_exception.append(node.get_rid())\n\t\t\tbreak\n\t\telse:\n\t\t\tnode=node.get_parent()\n\t# Initalization here\n\tset_fixed_process(true)\n\t#this detaches the camera transform from the parent spatial node\n\tset_as_toplevel(true)\n\n\t\n\t\n\n\n\n","old_contents":"\nextends Camera\n\n# member variables here, example:\n# var a=2\n# var b=\"textvar\"\n\nvar collision_exception=[]\nexport var min_distance=0.5\nexport var max_distance=4.0\nexport var angle_v_adjust=0.0\nexport var autoturn_ray_aperture=25\nexport var autoturn_speed=50\nvar max_height = 2.0\nvar min_height = 0\n\nfunc _fixed_process(dt):\n\tvar target = get_parent().get_global_transform().origin\n\tvar pos = get_global_transform().origin\n\tvar up = Vector3(0,1,0)\n\t\n\tvar delta = pos - target\n\t\n\t#regular delta follow\n\t\n\t#check ranges\n\t\n\tif (delta.length() < min_distance):\n\t\tdelta = delta.normalized() * min_distance\n\telif (delta.length() > max_distance):\n\t\tdelta = delta.normalized() * max_distance\n\t\n\t#check upper and lower height\n\tif ( delta.y > max_height):\n\t\tdelta.y = max_height\n\tif ( delta.y < min_height):\n\t\tdelta.y = min_height\n\t\t\n\t#check autoturn\n\t\n\tvar ds = PhysicsServer.space_get_direct_state( get_world().get_space() )\n\t\n\t\n\tvar col_left = ds.intersect_ray(target,target+Matrix3(up,deg2rad(autoturn_ray_aperture)).xform(delta),collision_exception)\n\tvar col = ds.intersect_ray(target,target,collision_exception)\n\tvar col_right = ds.intersect_ray(target,target+Matrix3(up,deg2rad(-autoturn_ray_aperture)).xform(delta),collision_exception)\n\t\n\tif (col!=null):\n\t\t#if main ray was occluded, get camera closer, this is the worst case scenario\n\t\tdelta = col.position - target\t\n\telif (col_left!=null and col_right==null):\n\t\t#if only left ray is occluded, turn the camera around to the right\n\t\tdelta = Matrix3(up,deg2rad(-dt*autoturn_speed)).xform(delta)\n\telif (col_left==null and col_right!=null):\n\t\t#if only right ray is occluded, turn the camera around to the left\n\t\tdelta = Matrix3(up,deg2rad(dt*autoturn_speed)).xform(delta)\n\telse:\n\t\t#do nothing otherwise, left and right are occluded but center is not, so do not autoturn\n\t\tpass\n\t\n\t#apply lookat\n\tpos = target + delta\n\t\n\tlook_at_from_pos(pos,target,up)\n\t\n\t#turn a little up or down\n\tvar t = get_transform()\n\tt.basis = Matrix3(t.basis[0],deg2rad(angle_v_adjust)) * t.basis\n\tset_transform(t)\n\t\n\t\n\nfunc _ready():\n\n#find collision exceptions for ray\n\tvar node = self\n\twhile(node):\n\t\tif (node extends RigidBody):\n\t\t\tcollision_exception.append(node.get_rid())\n\t\t\tbreak\n\t\telse:\n\t\t\tnode=node.get_parent()\n\t# Initalization here\n\tset_fixed_process(true)\n\t#this detaches the camera transform from the parent spatial node\n\tset_as_toplevel(true)\n\n\t\n\t\n\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"cdbb53c1c2be6361ede1c9d68bfdfd4e3bc2979e","subject":"Fix division by zero error in platformer","message":"Fix division by zero error in platformer\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"3d\/platformer\/player.gd","new_file":"3d\/platformer\/player.gd","new_contents":"\nextends KinematicBody\n\n# Member variables\nconst ANIM_FLOOR = 0\nconst ANIM_AIR_UP = 1\nconst ANIM_AIR_DOWN = 2\n\nconst SHOOT_TIME = 1.5\nconst SHOOT_SCALE = 2\n\nconst CHAR_SCALE = Vector3(0.3, 0.3, 0.3)\n\nvar facing_dir = Vector3(1, 0, 0)\nvar movement_dir = Vector3()\n\nvar jumping = false\n\nvar turn_speed = 40\nvar keep_jump_inertia = true\nvar air_idle_deaccel = false\nvar accel = 19.0\nvar deaccel = 14.0\nvar sharp_turn_threshold = 140\n\nvar max_speed = 3.1\n\nvar prev_shoot = false\n\nvar linear_velocity=Vector3()\n\nvar shoot_blend = 0\n\nfunc adjust_facing(p_facing, p_target, p_step, p_adjust_rate, current_gn):\n\tvar n = p_target # Normal\n\tvar t = n.cross(current_gn).normalized()\n\t \n\tvar x = n.dot(p_facing)\n\tvar y = t.dot(p_facing)\n\t\n\tvar ang = atan2(y,x)\n\t\n\tif (abs(ang) < 0.001): # Too small\n\t\treturn p_facing\n\t\n\tvar s = sign(ang)\n\tang = ang*s\n\tvar turn = ang*p_adjust_rate*p_step\n\tvar a\n\tif (ang < turn):\n\t\ta = ang\n\telse:\n\t\ta = turn\n\tang = (ang - a)*s\n\t\n\treturn (n*cos(ang) + t*sin(ang))*p_facing.length()\n\n\nfunc _physics_process(delta):\n\t\n\tvar lv = linear_velocity\n\tvar g = Vector3(0,-9.8,0)\n\n#\tvar d = 1.0 - delta*state.get_total_density()\n#\tif (d < 0):\n#\t\td = 0\n\tlv += g*delta # Apply gravity\n\t\n\tvar anim = ANIM_FLOOR\n\t\n\tvar up = -g.normalized() # (up is against gravity)\n\tvar vv = up.dot(lv) # Vertical velocity\n\tvar hv = lv - up*vv # Horizontal velocity\n\t\n\tvar hdir = hv.normalized() # Horizontal direction\n\tvar hspeed = hv.length() # Horizontal speed\n\t\n\n\t\n\tvar dir = Vector3() # Where does the player intend to walk to\n\tvar cam_xform = get_node(\"target\/camera\").get_global_transform()\n\t\n\tif (Input.is_action_pressed(\"move_forward\")):\n\t\tdir += -cam_xform.basis[2]\n\tif (Input.is_action_pressed(\"move_backwards\")):\n\t\tdir += cam_xform.basis[2]\n\tif (Input.is_action_pressed(\"move_left\")):\n\t\tdir += -cam_xform.basis[0]\n\tif (Input.is_action_pressed(\"move_right\")):\n\t\tdir += cam_xform.basis[0]\n\t\n\tvar jump_attempt = Input.is_action_pressed(\"jump\")\n\tvar shoot_attempt = Input.is_action_pressed(\"shoot\")\n\t\n\tvar target_dir = (dir - up*dir.dot(up)).normalized()\n\t\n\tif (is_on_floor()):\n\t\tvar sharp_turn = hspeed > 0.1 and rad2deg(acos(target_dir.dot(hdir))) > sharp_turn_threshold\n\t\t\n\t\tif (dir.length() > 0.1 and !sharp_turn):\n\t\t\tif (hspeed > 0.001):\n\t\t\t\t#linear_dir = linear_h_velocity\/linear_vel\n\t\t\t\t#if (linear_vel > brake_velocity_limit and linear_dir.dot(ctarget_dir) < -cos(Math::deg2rad(brake_angular_limit)))\n\t\t\t\t#\tbrake = true\n\t\t\t\t#else\n\t\t\t\thdir = adjust_facing(hdir, target_dir, delta, 1.0\/hspeed*turn_speed, up)\n\t\t\t\tfacing_dir = hdir\n\t\t\telse:\n\t\t\t\thdir = target_dir\n\t\t\t\n\t\t\tif (hspeed < max_speed):\n\t\t\t\thspeed += accel*delta\n\t\telse:\n\t\t\thspeed -= deaccel*delta\n\t\t\tif (hspeed < 0):\n\t\t\t\thspeed = 0\n\t\t\n\t\thv = hdir*hspeed\n\t\t\n\t\tvar mesh_xform = get_node(\"Armature\").get_transform()\n\t\tvar facing_mesh = -mesh_xform.basis[0].normalized()\n\t\tfacing_mesh = (facing_mesh - up*facing_mesh.dot(up)).normalized()\n\t\t\n\t\tif (hspeed>0):\n\t\t\tfacing_mesh = adjust_facing(facing_mesh, target_dir, delta, 1.0\/hspeed*turn_speed, up)\n\t\tvar m3 = Basis(-facing_mesh, up, -facing_mesh.cross(up).normalized()).scaled(CHAR_SCALE)\n\t\t\n\t\tget_node(\"Armature\").set_transform(Transform(m3, mesh_xform.origin))\n\t\t\n\t\tif (not jumping and jump_attempt):\n\t\t\tvv = 7.0\n\t\t\tjumping = true\n\t\t\tget_node(\"sound_jump\").play()\n\telse:\n\t\tif (vv > 0):\n\t\t\tanim = ANIM_AIR_UP\n\t\telse:\n\t\t\tanim = ANIM_AIR_DOWN\n\t\t\n\t\tvar hs\n\t\tif (dir.length() > 0.1):\n\t\t\thv += target_dir*(accel*0.2)*delta\n\t\t\tif (hv.length() > max_speed):\n\t\t\t\thv = hv.normalized()*max_speed\n\t\telse:\n\t\t\tif (air_idle_deaccel):\n\t\t\t\thspeed = hspeed - (deaccel*0.2)*delta\n\t\t\t\tif (hspeed < 0):\n\t\t\t\t\thspeed = 0\n\t\t\t\t\n\t\t\t\thv = hdir*hspeed\n\t\n\tif (jumping and vv < 0):\n\t\tjumping = false\n\t\n\tlv = hv + up*vv\n\t\n\tif (is_on_floor()):\n\t\tmovement_dir = lv\n\t\t\n\tlinear_velocity = move_and_slide(lv,-g.normalized())\n\t\n\tif (shoot_blend > 0):\n\t\tshoot_blend -= delta*SHOOT_SCALE\n\t\tif (shoot_blend < 0):\n\t\t\tshoot_blend = 0\n\t\n\tif (shoot_attempt and not prev_shoot):\n\t\tshoot_blend = SHOOT_TIME\n\t\tvar bullet = preload(\"res:\/\/bullet.scn\").instance()\n\t\tbullet.set_transform(get_node(\"Armature\/bullet\").get_global_transform().orthonormalized())\n\t\tget_parent().add_child(bullet)\n\t\tbullet.set_linear_velocity(get_node(\"Armature\/bullet\").get_global_transform().basis[2].normalized()*20)\n\t\tbullet.add_collision_exception_with(self) # Add it to bullet\n\t\tget_node(\"sound_shoot\").play()\n\t\n\tprev_shoot = shoot_attempt\n\t\n\tif (is_on_floor()):\n\t\tget_node(\"AnimationTreePlayer\").blend2_node_set_amount(\"walk\", hspeed\/max_speed)\n\t\n\tget_node(\"AnimationTreePlayer\").transition_node_set_current(\"state\", anim)\n\tget_node(\"AnimationTreePlayer\").blend2_node_set_amount(\"gun\", min(shoot_blend, 1.0))\n#\tstate.set_angular_velocity(Vector3())\n\n\nfunc _ready():\n\tget_node(\"AnimationTreePlayer\").set_active(true)\n","old_contents":"\nextends KinematicBody\n\n# Member variables\nconst ANIM_FLOOR = 0\nconst ANIM_AIR_UP = 1\nconst ANIM_AIR_DOWN = 2\n\nconst SHOOT_TIME = 1.5\nconst SHOOT_SCALE = 2\n\nconst CHAR_SCALE = Vector3(0.3, 0.3, 0.3)\n\nvar facing_dir = Vector3(1, 0, 0)\nvar movement_dir = Vector3()\n\nvar jumping = false\n\nvar turn_speed = 40\nvar keep_jump_inertia = true\nvar air_idle_deaccel = false\nvar accel = 19.0\nvar deaccel = 14.0\nvar sharp_turn_threshold = 140\n\nvar max_speed = 3.1\n\nvar prev_shoot = false\n\nvar linear_velocity=Vector3()\n\nvar shoot_blend = 0\n\nfunc adjust_facing(p_facing, p_target, p_step, p_adjust_rate, current_gn):\n\tvar n = p_target # Normal\n\tvar t = n.cross(current_gn).normalized()\n\t \n\tvar x = n.dot(p_facing)\n\tvar y = t.dot(p_facing)\n\t\n\tvar ang = atan2(y,x)\n\t\n\tif (abs(ang) < 0.001): # Too small\n\t\treturn p_facing\n\t\n\tvar s = sign(ang)\n\tang = ang*s\n\tvar turn = ang*p_adjust_rate*p_step\n\tvar a\n\tif (ang < turn):\n\t\ta = ang\n\telse:\n\t\ta = turn\n\tang = (ang - a)*s\n\t\n\treturn (n*cos(ang) + t*sin(ang))*p_facing.length()\n\n\nfunc _physics_process(delta):\n\t\n\tvar lv = linear_velocity\n\tvar g = Vector3(0,-9.8,0)\n\n#\tvar d = 1.0 - delta*state.get_total_density()\n#\tif (d < 0):\n#\t\td = 0\n\tlv += g*delta # Apply gravity\n\t\n\tvar anim = ANIM_FLOOR\n\t\n\tvar up = -g.normalized() # (up is against gravity)\n\tvar vv = up.dot(lv) # Vertical velocity\n\tvar hv = lv - up*vv # Horizontal velocity\n\t\n\tvar hdir = hv.normalized() # Horizontal direction\n\tvar hspeed = hv.length() # Horizontal speed\n\t\n\n\t\n\tvar dir = Vector3() # Where does the player intend to walk to\n\tvar cam_xform = get_node(\"target\/camera\").get_global_transform()\n\t\n\tif (Input.is_action_pressed(\"move_forward\")):\n\t\tdir += -cam_xform.basis[2]\n\tif (Input.is_action_pressed(\"move_backwards\")):\n\t\tdir += cam_xform.basis[2]\n\tif (Input.is_action_pressed(\"move_left\")):\n\t\tdir += -cam_xform.basis[0]\n\tif (Input.is_action_pressed(\"move_right\")):\n\t\tdir += cam_xform.basis[0]\n\t\n\tvar jump_attempt = Input.is_action_pressed(\"jump\")\n\tvar shoot_attempt = Input.is_action_pressed(\"shoot\")\n\t\n\tvar target_dir = (dir - up*dir.dot(up)).normalized()\n\t\n\tif (is_on_floor()):\n\t\tvar sharp_turn = hspeed > 0.1 and rad2deg(acos(target_dir.dot(hdir))) > sharp_turn_threshold\n\t\t\n\t\tif (dir.length() > 0.1 and !sharp_turn):\n\t\t\tif (hspeed > 0.001):\n\t\t\t\t#linear_dir = linear_h_velocity\/linear_vel\n\t\t\t\t#if (linear_vel > brake_velocity_limit and linear_dir.dot(ctarget_dir) < -cos(Math::deg2rad(brake_angular_limit)))\n\t\t\t\t#\tbrake = true\n\t\t\t\t#else\n\t\t\t\thdir = adjust_facing(hdir, target_dir, delta, 1.0\/hspeed*turn_speed, up)\n\t\t\t\tfacing_dir = hdir\n\t\t\telse:\n\t\t\t\thdir = target_dir\n\t\t\t\n\t\t\tif (hspeed < max_speed):\n\t\t\t\thspeed += accel*delta\n\t\telse:\n\t\t\thspeed -= deaccel*delta\n\t\t\tif (hspeed < 0):\n\t\t\t\thspeed = 0\n\t\t\n\t\thv = hdir*hspeed\n\t\t\n\t\tvar mesh_xform = get_node(\"Armature\").get_transform()\n\t\tvar facing_mesh = -mesh_xform.basis[0].normalized()\n\t\tfacing_mesh = (facing_mesh - up*facing_mesh.dot(up)).normalized()\n\t\tfacing_mesh = adjust_facing(facing_mesh, target_dir, delta, 1.0\/hspeed*turn_speed, up)\n\t\tvar m3 = Basis(-facing_mesh, up, -facing_mesh.cross(up).normalized()).scaled(CHAR_SCALE)\n\t\t\n\t\tget_node(\"Armature\").set_transform(Transform(m3, mesh_xform.origin))\n\t\t\n\t\tif (not jumping and jump_attempt):\n\t\t\tvv = 7.0\n\t\t\tjumping = true\n\t\t\tget_node(\"sound_jump\").play()\n\telse:\n\t\tif (vv > 0):\n\t\t\tanim = ANIM_AIR_UP\n\t\telse:\n\t\t\tanim = ANIM_AIR_DOWN\n\t\t\n\t\tvar hs\n\t\tif (dir.length() > 0.1):\n\t\t\thv += target_dir*(accel*0.2)*delta\n\t\t\tif (hv.length() > max_speed):\n\t\t\t\thv = hv.normalized()*max_speed\n\t\telse:\n\t\t\tif (air_idle_deaccel):\n\t\t\t\thspeed = hspeed - (deaccel*0.2)*delta\n\t\t\t\tif (hspeed < 0):\n\t\t\t\t\thspeed = 0\n\t\t\t\t\n\t\t\t\thv = hdir*hspeed\n\t\n\tif (jumping and vv < 0):\n\t\tjumping = false\n\t\n\tlv = hv + up*vv\n\t\n\tif (is_on_floor()):\n\t\tmovement_dir = lv\n\t\t\n\tlinear_velocity = move_and_slide(lv,-g.normalized())\n\t\n\tif (shoot_blend > 0):\n\t\tshoot_blend -= delta*SHOOT_SCALE\n\t\tif (shoot_blend < 0):\n\t\t\tshoot_blend = 0\n\t\n\tif (shoot_attempt and not prev_shoot):\n\t\tshoot_blend = SHOOT_TIME\n\t\tvar bullet = preload(\"res:\/\/bullet.scn\").instance()\n\t\tbullet.set_transform(get_node(\"Armature\/bullet\").get_global_transform().orthonormalized())\n\t\tget_parent().add_child(bullet)\n\t\tbullet.set_linear_velocity(get_node(\"Armature\/bullet\").get_global_transform().basis[2].normalized()*20)\n\t\tbullet.add_collision_exception_with(self) # Add it to bullet\n\t\tget_node(\"sound_shoot\").play()\n\t\n\tprev_shoot = shoot_attempt\n\t\n\tif (is_on_floor()):\n\t\tget_node(\"AnimationTreePlayer\").blend2_node_set_amount(\"walk\", hspeed\/max_speed)\n\t\n\tget_node(\"AnimationTreePlayer\").transition_node_set_current(\"state\", anim)\n\tget_node(\"AnimationTreePlayer\").blend2_node_set_amount(\"gun\", min(shoot_blend, 1.0))\n#\tstate.set_angular_velocity(Vector3())\n\n\nfunc _ready():\n\tget_node(\"AnimationTreePlayer\").set_active(true)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"ac65f04516b97e44042d639913d26054a68a42b6","subject":"use puzzle.pairCount instead of copying it","message":"use puzzle.pairCount instead of copying it\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/GridMan.gd","new_file":"src\/scripts\/GridMan.gd","new_contents":"extends Spatial\n\n# Is there a better way to do this?\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\n# Shape dictionary to access blocks quickly by position.\nvar shape = {}\n\n# Block selection handling.\nvar offClick = false\nvar selectedBlocks = []\n\n# Puzzle vars.\nvar puzzle\n\n# Beam stuff.\nconst beamScn = preload( \"res:\/\/blocks\/block.scn\" )\nconst Beam = preload(\"res:\/\/scripts\/Blocks\/Beam.gd\")\n\n# sounds\nvar samplePlayer = SamplePlayer.new()\n\nfunc add_block(b):\n\tprint (\"ADDED\")\n\tshape[b.blockPos] = b\n\n\t# any special treatment for the wild blocks?\n\t# keep track of puzzle.lasers\n\t# keep track of puzzle.pairCounts\n\tif b.getBlockType() == 2:\n\t\tvar layer = calcBlockLayerVec(b.blockPos)\n\t\twhile puzzle.pairCount.size() <= layer:\n\t\t\t\tpuzzle.pairCount.append(0)\n\n\t\t# preload(\"res:\/\/trust\")\n\t\tpuzzle.pairCount[layer] += 0.5\n\n\tadd_child(b)\n\nfunc get_block(pos):\n\tif shape.has(pos):\n\t\treturn shape[pos]\n\telse:\n\t\treturn null\n\n# unused key argument needed for the tween_complete signal\nfunc remove_block(block_node, key=null):\n\tif block_node == null:\n\t\treturn\n\tprint (\"REMOVED\")\n\tif block_node.get_script() == preload(\"Blocks\/PairedBlock.gd\"):\n\t\tprint(\"PAIRED RM\")\n\tshape[block_node.blockPos] = null\n\tfor child in block_node.get_children():\n\t\tblock_node.remove_and_delete_child(child)\n\tremove_and_delete_child(block_node)\n\n# Sets the puzzle for this GridMan.\nfunc set_puzzle(puzz):\n\t# delete all current nodes\n\tfor pos in shape:\n\t\tremove_block(shape[pos])\n\tprint(shape)\n\n\t# Store the puzzle.\n\tpuzzle = puzz\n\n\t# Set the camera range to be relative to the layer count.\n\tvar cam = get_parent().get_parent().get_node( \"Camera\" )\n\tvar totalSize = ( puzzle.puzzleLayers * 2 + 1 )\n\tcam.distance.val = 4.5 * totalSize\n\tcam.distance.min_ = 3 * totalSize\n\tcam.distance.max_ = 10 * totalSize\n\tcam.recalculate_camera()\n\n\tfor block in puzzle.blocks:\n\t\t# Create a block node, add it to the tree\n\t\tadd_block(block.toNode())\n\n# Clears any selected blocks. WE SHOULD FIX THIS, THERE CAN ONLY BE ONE BLOCK SELECTED AT ANY ONE TIME, NO NEED FOR AN ARRAY!\nfunc clearSelection():\n\tfor bl in selectedBlocks:\n\t\tvar blo = get_node( bl )\n\t\tblo.setSelected(false)\n\t\tblo.scaleTweenNode(1.0).start()\n\tselectedBlocks = []\n\n# Add the selected block to the selected list. WE SHOULD FIX THIS, IT ONLY NEEDS TO STORE IT, NOT AN ARRAY!\nfunc addSelected(bl):\n\tselectedBlocks.append(bl)\n\n# Used for the multiplayer mode to force click a block on their side.\nfunc forceClickBlock( pos ):\n\tshape[pos].forceClick()\n\nfunc clickBlock( name ):\n\t#now check if that was the second block we picked. If it was, we want to\n\t#unselect the blocks again\n\tif (offClick):\n\t\toffClick = false\n\t\taddSelected(name)\n\t\tclearSelection()\n\telse:\n\t\toffClick = true;\n\t\taddSelected(name)\n\n# Calculates the layer that a block is on.\n# COPY OF FUNCTION IN PUZZLEMAN, IS THERE A BETTER WAY TO DO THIS?!\nfunc calcBlockLayer( x, y, z ):\n\treturn max( max( abs( x ), abs( y ) ), abs( z ) )\nfunc calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n# Handles keeping track of pairs being removed.\nfunc popPair( pos ):\n\tvar blayer = calcBlockLayerVec( pos )\n\tpuzzle.pairCount[blayer] -= 1\n\tprint(\"POP, \", puzzle.pairCount)\n\n\tif( puzzle.pairCount[blayer] == 0 ):\n\t\tprint(\"LAYER CLEARED\")\n\t\tif blayer == 1:\n\t\t\tprint( \"GAME OVER!\" )\n\n\t\tfor b in shape:\n\t\t\tif not ( shape[b] == null ):\n\t\t\t\tif calcBlockLayerVec( b ) == blayer:\n\t\t\t\t\tif shape[b].getBlockType() == BLOCK_LASER:\n\t\t\t\t\t\tshape[b].forceActivate()\n\n\t\t# Fire beams.\n\t\tvar beamNum = 0\n\t\tfor l in range( puzzle.lasers.size() ):\n\t\t\tif calcBlockLayerVec( puzzle.lasers[l][0] ) == blayer:\n\t\t\t\t# Firin mah lazerz!\n\t\t\t\tvar beam = beamScn.instance()\n\n\t\t\t\tbeam.set_name( str(blayer) + \"_beam_\" + str(beamNum) )\n\t\t\t\tbeamNum += 1\n\t\t\t\tbeam.set_script( Beam )\n\n\t\t\t\tadd_child( beam )\n\t\t\t\tbeam.fire( puzzle.lasers[l][0], puzzle.lasers[l][1] )\n\n\t\t\t\tsamplePlayer.play( \"soundslikewillem_hitting_slinky\" )\n\n\nfunc _init():\n\t# Load sound\n\tsamplePlayer.set_voice_count(10)\n\tsamplePlayer.set_sample_library(ResourceLoader.load(\"new_samplelibrary.xml\"))\n\tprint(\"GridMan initialized\")\n\n","old_contents":"extends Spatial\n\n# Is there a better way to do this?\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\n# Shape dictionary to access blocks quickly by position.\nvar shape = {}\n\n# Block selection handling.\nvar offClick = false\nvar selectedBlocks = []\n\n# Puzzle vars.\nvar puzzle\nvar pairCount = []\n\n# Beam stuff.\nconst beamScn = preload( \"res:\/\/blocks\/block.scn\" )\nconst Beam = preload(\"res:\/\/scripts\/Blocks\/Beam.gd\")\n\n# sounds\nvar samplePlayer = SamplePlayer.new()\n\nfunc add_block(b):\n\tshape[b.blockPos] = b\n\n\tif b.getBlockType() == 2:\n\t\tvar layer = calcBlockLayerVec(b.blockPos)\n\t\twhile pairCount.size() <= layer:\n\t\t\t\tpairCount.append(0)\n\t\n\t\t# preload(\"res:\/\/trust\")\n\t\tpairCount[layer] += 0.5\n\n\tadd_child(b)\n\nfunc get_block(pos):\n\tif shape.has(pos):\n\t\treturn shape[pos]\n\telse:\n\t\treturn null\n\nfunc remove_block(block_node):\n\tshape[block_node.blockPos] = null\n\t# TODO scan_layer, fire lasers if empty\n\tfor child in block_node.get_children():\n\t\tblock_node.remove_and_delete_child(child)\n\tremove_and_delete_child(block_node)\n\n# TODO wild block selected? can click any pair. can deselect wild block.\nvar wildBlockSelected = null\n\n# Sets the puzzle for this GridMan.\nfunc set_puzzle(puzz):\n\t# TODO delete current puzzle\n\t\n\t# Store the puzzle.\n\tpuzzle = puzz\n\n\t# Initalization here\n\tsamplePlayer.set_voice_count(puzzle.puzzleLayers * 2)\n\tsamplePlayer.set_sample_library(ResourceLoader.load(\"new_samplelibrary.xml\"))\n\n\t# Set the camera range to be relative to the layer count.\n\tvar cam = get_parent().get_parent().get_node( \"Camera\" )\n\tvar totalSize = ( puzzle.puzzleLayers * 2 + 1 )\n\tcam.distance.val = 4.5 * totalSize\n\tcam.distance.min_ = 3 * totalSize\n\tcam.distance.max_ = 10 * totalSize\n\tcam.recalculate_camera()\n\t\n\tfor block in puzzle.blocks:\n\t\t# Create a block node, add it to the tree\n\t\tadd_block(block.toNode())\n\n# Clears any selected blocks. WE SHOULD FIX THIS, THERE CAN ONLY BE ONE BLOCK SELECTED AT ANY ONE TIME, NO NEED FOR AN ARRAY!\nfunc clearSelection():\n\tfor bl in selectedBlocks:\n\t\tvar blo = get_node( bl )\n\t\tblo.setSelected(false)\n\t\tblo.scaleTweenNode(1.0).start()\n\tselectedBlocks = []\n\n# Add the selected block to the selected list. WE SHOULD FIX THIS, IT ONLY NEEDS TO STORE IT, NOT AN ARRAY!\nfunc addSelected(bl):\n\tselectedBlocks.append(bl)\n\n# Used for the multiplayer mode to force click a block on their side.\nfunc forceClickBlock( pos ):\n\tshape[pos].forceClick()\n\nfunc clickBlock( name ):\n\t#now check if that was the second block we picked. If it was, we want to\n\t#unselect the blocks again\n\tif (offClick):\n\t\toffClick = false\n\t\taddSelected(name)\n\t\tclearSelection()\n\telse:\n\t\toffClick = true;\n\t\taddSelected(name)\n\n# Calculates the layer that a block is on.\n# COPY OF FUNCTION IN PUZZLEMAN, IS THERE A BETTER WAY TO DO THIS?!\nfunc calcBlockLayer( x, y, z ):\n\treturn max( max( abs( x ), abs( y ) ), abs( z ) )\nfunc calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n# Handles keeping track of pairs being removed.\nfunc popPair( pos ):\n\tvar blayer = calcBlockLayerVec( pos )\n\tpairCount[blayer] -= 1\n\n\tif( pairCount[blayer] == 0 ):\n\t\tprint(\"LAYER CLEARED\")\n\t\tif blayer == 1:\n\t\t\tprint( \"GAME OVER!\" )\n\n\t\tfor b in shape:\n\t\t\tif not ( shape[b] == null ):\n\t\t\t\tif calcBlockLayerVec( b ) == blayer:\n\t\t\t\t\tif shape[b].getBlockType() == BLOCK_LASER:\n\t\t\t\t\t\tshape[b].forceActivate()\n\n\t\t# Fire beams.\n\t\tvar beamNum = 0\n\t\tfor l in range( puzzle.lasers.size() ):\n\t\t\tif calcBlockLayerVec( puzzle.lasers[l][0] ) == blayer:\n\t\t\t\t# Firin mah lazerz!\n\t\t\t\tvar beam = beamScn.instance()\n\n\t\t\t\tbeam.set_name( str(blayer) + \"_beam_\" + str(beamNum) )\n\t\t\t\tbeamNum += 1\n\t\t\t\tbeam.set_script( Beam )\n\n\t\t\t\tadd_child( beam )\n\t\t\t\tbeam.fire( puzzle.lasers[l][0], puzzle.lasers[l][1] )\n\n\t\t\t\tsamplePlayer.play( \"soundslikewillem_hitting_slinky\" )\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"202bdc8c41aecbd3636cb5015a0f553a53e23a33","subject":"can now return to menu if no one connects","message":"can now return to menu if no one connects\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Network.gd","new_file":"src\/scripts\/Network.gd","new_contents":"# Core networking\n\nextends Node\n\nconst REMOTE_FINISH = 0\nconst REMOTE_START = 1\nconst REMOTE_QUIT = 2\nconst REMOTE_BLOCK = 4\nconst REMOTE_PUZZLE_TRANSFORM = 5\nconst REMOTE_BLOCK_UPDATE = 6\n\nvar port = 54321\nvar root\nvar isNetwork\nvar isHost\nvar isClient = false\nvar server\nvar client\nvar connection\nvar proxy\n\nvar thisPuzzle\n\n#Store the peer stream used by both the lcient and server\nvar stream\n\nfunc _ready():\n\tprint( \"Making network.\" )\n\tisNetwork = false\n\tisHost = false\n\tvar label = get_tree().get_root().get_node(\"GUIManager\/OptionsMenu\/Panel\/PortField\/LineEdit\")\n\tif not label == null:\n\t\tlabel.set_text(str(port))\n\nfunc setPort(pt):\n\tport = pt;\n\nfunc connectTo(ip, pt):\n\tisClient = true #just to tell if it's doing something :S\n\tconnection = PacketPeerStream.new()\n\tstream = StreamPeerTCP.new()\n\tconnection.set_stream_peer(stream)\n\tstream.connect(ip, pt);\n\n\tif stream.get_status() == stream.STATUS_CONNECTED or stream.get_status() == stream.STATUS_CONNECTING:\n\t\tprint(\"Connecting to \" + ip + \":\" + str(port));\n\t\tproxy.set_process(true)\n\t\t#leave is_network as false to indicate we're still waiting for connection\n\n\nfunc host(pt):\n\tserver = TCP_Server.new()\n\t#connection = PacketPeerStream.new()\n\tisHost = true\n\tprint(\"Starting listening server on port \" + str(pt))\n\tif server.listen(pt) == 0:\n\t\tproxy.set_process(true)\n\t\tprint(\"Listening...\")\n\telse:\n\t\tprint(\"Failed to start server on port \" + str(pt));\n\nfunc _process(delta):\n\tif (isHost):\n\t\t#server processing stuff\n\t\t#use isNetwork to determine if we're still listening\n\t\tif !isNetwork:\n\t\t\tif server.is_connection_available():\n\t\t\t\tstream = server.take_connection()\n\t\t\t\tconnection = PacketPeerStream.new()\n\t\t\t\tconnection.set_stream_peer(stream)\n\t\t\t\tprint(\"Connecting with player...\")\n\t\t\t\tisNetwork = true\n\t\t\t\tserver.stop()\n\n\t\t\t\tgotoPuzzle()\n\n\t\t\t\tthisPuzzle = root.get_node(\"Puzzle\")\n\t\t\t\t#MAKE CALL TO PUZZLE SELECTER\n\t\telse: #not listening anymore, have a client\n\t\t\t#do quick check to make sure we're still\n\t\t\t#connected\n\t\t\tif !stream.is_connected():\n\t\t\t\tprint(\"Lost Connection!\");\n\t\t\t\tisNetwork = false\n\t\t\t\tproxy.set_process(false)\n\t\t\t\t#QUIT GAME\n\t\t\t\treturn\n\t\t\t#check if we have any data\n\t\t\tif connection.get_available_packet_count() > 0:\n\t\t\t\t#have to be careful about more than 1 packet per frame\n\t\t\t\tfor i in range(connection.get_available_packet_count()):\n\t\t\t\t\tvar dataArray = connection.get_var()\n\t\t\t\t\tProcessServerData(dataArray)\n\n\telse:\n\t\t#client processing stuff\n\t\tif !isNetwork:\n\t\t\t#Still waiting for connection confirmed\n\t\t\tif stream.get_status() == stream.STATUS_CONNECTED:\n\t\t\t\tprint(\"Connection established!\")\n\t\t\t\tisNetwork = true\n\n\t\t\t\tgotoPuzzle()\n\n\t\t\t\tthisPuzzle = root.get_node(\"Puzzle\")\n\t\t\t\treturn\n\t\t\tif stream.get_status() == stream.STATUS_NONE or stream.get_status() == stream.STATUS_ERROR:\n\t\t\t\tprint(\"Error establishing connection!\")\n\t\t\t\tproxy.set_process(false)\n\t\t\t\treturn\n\t\t\t\t#stop running process loop, cause we have no connection\n\t\telse:\n\t\t\t#connecton established and confirmed. Do regular data processing\n\t\t\t#check if we have any data\n\t\t\tif connection.get_available_packet_count() > 0:\n\t\t\t\tfor i in range(connection.get_available_packet_count()):\n\t\t\t\t\tvar dataArray = connection.get_var()\n\t\t\t\t\tProcessServerData(dataArray)\n\t\t\t\t\t#Call the server process script cuase it's peer to peer and we have the same functions!\n\n\nfunc disconnect():\n\t#need to do lots of things! If the server is open and listening, but has no connection just stop listening!\n\tif isHost and !isNetwork:\n\t\t#this means we're waiting for connection still\n\t\tserver.stop()\n\t\tprint(\"closing server listener!\")\n\telif isHost and isNetwork:\n\t\t#have connections. Need to send them stop packet, and close connection\n\t\tconnection.put_var([REMOTE_QUIT])\n\t\tstream.disconnect()\n\t\tprint(\"Closing connection to remote player...\")\n\t\tgotoMenu()\n\telif !isHost and !isNetwork:\n\t\tstream.disconnect()\n\t\tprint(\"Halting connection request...\")\n\telif !isHost and isNetwork:\n\t\t#connected to server already\n\t\tstream.disconnect()\n\t\tprint(\"Disconnecting from server...\")\n\t\tgotoMenu()\n\n\t#no matter where we wre before disconnect, set network to false and return to beginning screen!\n\tisNetwork = false;\n\tisHost = false;\n\tisClient = false;\n\n\tproxy.set_process(false)\n\n\n\nfunc ProcessServerData(dataArray):\n\t#have an array of data. First element should be identifying int\n\tvar ID = dataArray[0]\n\tvar puzzle = root.get_node( \"Puzzle\" )\n\tvar gridMan = puzzle.otherPuzzle.get_node(\"GridView\/GridMan\")\n\t#no switch statement. I'm crying right now while i type this. My fingers are bleeding\n\tif ID == REMOTE_START:\n\t\t#read other person's puzzle\n\t\tprint(\"remote_stuff\")\n\t\tgridMan.set_puzzle(dict2inst(dataArray[1]))\n\telif ID == REMOTE_FINISH:\n\t\t#again, do ending stuff\n\t\tprint(\"remote_finish: \" + str(dataArray[1]))\n\t\tgridMan.beatenWithScore(dataArray[1])\n\telif ID == REMOTE_QUIT:\n\t\t#omg those jerks!\n\t\tprint(\"remote_quit\")\n\t\tdisconnect()\n\telif ID == REMOTE_BLOCK:\n\t\t#get their block ifnormation!\n\t\tprint(\"remote_block\")\n\telif ID == REMOTE_PUZZLE_TRANSFORM:\n\t\t#sent block information\n\t\tvar translation = dataArray[1]\n\t\tthisPuzzle.otherPuzzle.set_transform(Transform( translation ))\n# better measurements!!!!\t\tthisPuzzle.otherPuzzle.set_translation(Vector3(20, 12, -40))\n##############3\n\t\tvar otherPosition = Vector3(20,0,10)\n\t\tvar tween = Tween.new()\n\t\ttween.interpolate_method(thisPuzzle.otherPuzzle, \"set_translation\", \\\n\t\tthisPuzzle.otherPuzzle.get_translation(), otherPosition, \\\n\t\t0.5, Tween.TRANS_SINE, Tween.EASE_OUT )\n\n\telif ID == REMOTE_BLOCK_UPDATE:\n\t\t#sent an updated block pair\n\t\tprint(\"block update\")\n\t\tgridMan.forceClickBlock(dataArray[1])\n\nfunc sendStart(puzzle):\n\tif !isNetwork:\n\t\tprint(\"Error sending start packet: not connected!\")\n\t\treturn\n\tvar er = connection.put_var([REMOTE_START, inst2dict(puzzle)])\n\tprint(\"sent: \")\n\tprint(puzzle)\n\nfunc sendBlockUpdate(pos):\n\tif !isNetwork:\n\t\tprint(\"Error sending start packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_BLOCK_UPDATE, pos])\n\nfunc sendFinish(score):\n\tif !isNetwork:\n\t\tprint(\"Error sending finish packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_FINISH, root.get_node(\"Puzzle\").time.val])\n\nfunc sendQuit():\n\tif !isNetwork:\n\t\tprint(\"Error sending finish packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_QUIT])\n\nfunc sendTransform(translation):\n\tif !isNetwork:\n\t\tprint(\"Cannot send transformation over an unitialized network!\")\n\t\treturn\n\tconnection.put_var([REMOTE_PUZZLE_TRANSFORM, translation])\n\n\nfunc gotoMenu():\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\troot.add_child( load(\"res:\/\/menus.scn\") )\n\nfunc gotoPuzzle():\n\tvar guiMan = preload(\"GUIManager.gd\").new()\n\tguiMan.gotoPuzzleScene(root, true) # network = true\n","old_contents":"# Core networking\n\nextends Node\n\nconst REMOTE_FINISH = 0\nconst REMOTE_START = 1\nconst REMOTE_QUIT = 2\nconst REMOTE_BLOCK = 4\nconst REMOTE_PUZZLE_TRANSFORM = 5\nconst REMOTE_BLOCK_UPDATE = 6\n\nvar port = 54321\nvar root\nvar isNetwork\nvar isHost\nvar isClient = false\nvar server\nvar client\nvar connection\nvar proxy\n\nvar thisPuzzle\n\n#Store the peer stream used by both the lcient and server\nvar stream\n\nfunc _ready():\n\tprint( \"Making network.\" )\n\tisNetwork = false\n\tisHost = false\n\tvar label = get_tree().get_root().get_node(\"GUIManager\/OptionsMenu\/Panel\/PortField\/LineEdit\")\n\tif not label == null:\n\t\tlabel.set_text(str(port))\n\nfunc setPort(pt):\n\tport = pt;\n\nfunc connectTo(ip, pt):\n\tisClient = true #just to tell if it's doing something :S\n\tconnection = PacketPeerStream.new()\n\tstream = StreamPeerTCP.new()\n\tconnection.set_stream_peer(stream)\n\tstream.connect(ip, pt);\n\n\tif stream.get_status() == stream.STATUS_CONNECTED or stream.get_status() == stream.STATUS_CONNECTING:\n\t\tprint(\"Connecting to \" + ip + \":\" + str(port));\n\t\tproxy.set_process(true)\n\t\t#leave is_network as false to indicate we're still waiting for connection\n\n\nfunc host(pt):\n\tserver = TCP_Server.new()\n\t#connection = PacketPeerStream.new()\n\tisHost = true\n\tprint(\"Starting listening server on port \" + str(pt))\n\tif server.listen(pt) == 0:\n\t\tproxy.set_process(true)\n\t\tprint(\"Listening...\")\n\telse:\n\t\tprint(\"Failed to start server on port \" + str(pt));\n\nfunc _process(delta):\n\tif (isHost):\n\t\t#server processing stuff\n\t\t#use isNetwork to determine if we're still listening\n\t\tif !isNetwork:\n\t\t\tif server.is_connection_available():\n\t\t\t\tstream = server.take_connection()\n\t\t\t\tconnection = PacketPeerStream.new()\n\t\t\t\tconnection.set_stream_peer(stream)\n\t\t\t\tprint(\"Connecting with player...\")\n\t\t\t\tisNetwork = true\n\t\t\t\tserver.stop()\n\n\t\t\t\tgotoPuzzle()\n\n\t\t\t\tthisPuzzle = root.get_node(\"Puzzle\")\n\t\t\t\t#MAKE CALL TO PUZZLE SELECTER\n\t\telse: #not listening anymore, have a client\n\t\t\t#do quick check to make sure we're still\n\t\t\t#connected\n\t\t\tif !stream.is_connected():\n\t\t\t\tprint(\"Lost Connection!\");\n\t\t\t\tisNetwork = false\n\t\t\t\tproxy.set_process(false)\n\t\t\t\t#QUIT GAME\n\t\t\t\treturn\n\t\t\t#check if we have any data\n\t\t\tif connection.get_available_packet_count() > 0:\n\t\t\t\t#have to be careful about more than 1 packet per frame\n\t\t\t\tfor i in range(connection.get_available_packet_count()):\n\t\t\t\t\tvar dataArray = connection.get_var()\n\t\t\t\t\tProcessServerData(dataArray)\n\n\telse:\n\t\t#client processing stuff\n\t\tif !isNetwork:\n\t\t\t#Still waiting for connection confirmed\n\t\t\tif stream.get_status() == stream.STATUS_CONNECTED:\n\t\t\t\tprint(\"Connection established!\")\n\t\t\t\tisNetwork = true\n\n\t\t\t\tgotoPuzzle()\n\n\t\t\t\tthisPuzzle = root.get_node(\"Puzzle\")\n\t\t\t\treturn\n\t\t\tif stream.get_status() == stream.STATUS_NONE or stream.get_status() == stream.STATUS_ERROR:\n\t\t\t\tprint(\"Error establishing connection!\")\n\t\t\t\tproxy.set_process(false)\n\t\t\t\treturn\n\t\t\t\t#stop running process loop, cause we have no connection\n\t\telse:\n\t\t\t#connecton established and confirmed. Do regular data processing\n\t\t\t#check if we have any data\n\t\t\tif connection.get_available_packet_count() > 0:\n\t\t\t\tfor i in range(connection.get_available_packet_count()):\n\t\t\t\t\tvar dataArray = connection.get_var()\n\t\t\t\t\tProcessServerData(dataArray)\n\t\t\t\t\t#Call the server process script cuase it's peer to peer and we have the same functions!\n\n\nfunc disconnect():\n\t#need to do lots of things! If the server is open and listening, but has no connection just stop listening!\n\tif isHost and !isNetwork:\n\t\t#this means we're waiting for connection still\n\t\tserver.stop()\n\t\tprint(\"closing server listener!\")\n\telif isHost and isNetwork:\n\t\t#have connections. Need to send them stop packet, and close connection\n\t\tconnection.put_var([REMOTE_QUIT])\n\t\tstream.disconnect()\n\t\tprint(\"Closing connection to remote player...\")\n\telif !isHost and !isNetwork:\n\t\tstream.disconnect()\n\t\tprint(\"Halting connection request...\")\n\telif !isHost and isNetwork:\n\t\t#connected to server already\n\t\tstream.disconnect()\n\t\tprint(\"Disconnecting from server...\")\n\n\t#no matter where we wre before disconnect, set network to false and return to beginning screen!\n\tisNetwork = false;\n\tisHost = false;\n\tisClient = false;\n\n\tproxy.set_process(false)\n\n\n\tgotoMenu()\n\n\nfunc ProcessServerData(dataArray):\n\t#have an array of data. First element should be identifying int\n\tvar ID = dataArray[0]\n\tvar puzzle = root.get_node( \"Puzzle\" )\n\tvar gridMan = puzzle.otherPuzzle.get_node(\"GridView\/GridMan\")\n\t#no switch statement. I'm crying right now while i type this. My fingers are bleeding\n\tif ID == REMOTE_START:\n\t\t#read other person's puzzle\n\t\tprint(\"remote_stuff\")\n\t\tgridMan.set_puzzle(dict2inst(dataArray[1]))\n\telif ID == REMOTE_FINISH:\n\t\t#again, do ending stuff\n\t\tprint(\"remote_finish: \" + str(dataArray[1]))\n\t\tgridMan.beatenWithScore(dataArray[1])\n\telif ID == REMOTE_QUIT:\n\t\t#omg those jerks!\n\t\tprint(\"remote_quit\")\n\t\tdisconnect()\n\telif ID == REMOTE_BLOCK:\n\t\t#get their block ifnormation!\n\t\tprint(\"remote_block\")\n\telif ID == REMOTE_PUZZLE_TRANSFORM:\n\t\t#sent block information\n\t\tvar translation = dataArray[1]\n\t\tthisPuzzle.otherPuzzle.set_transform(Transform( translation ))\n# better measurements!!!!\t\tthisPuzzle.otherPuzzle.set_translation(Vector3(20, 12, -40))\n##############3\n\t\tvar otherPosition = Vector3(20,0,10)\n\t\tvar tween = Tween.new()\n\t\ttween.interpolate_method(thisPuzzle.otherPuzzle, \"set_translation\", \\\n\t\tthisPuzzle.otherPuzzle.get_translation(), otherPosition, \\\n\t\t0.5, Tween.TRANS_SINE, Tween.EASE_OUT )\n\n\telif ID == REMOTE_BLOCK_UPDATE:\n\t\t#sent an updated block pair\n\t\tprint(\"block update\")\n\t\tgridMan.forceClickBlock(dataArray[1])\n\nfunc sendStart(puzzle):\n\tif !isNetwork:\n\t\tprint(\"Error sending start packet: not connected!\")\n\t\treturn\n\tvar er = connection.put_var([REMOTE_START, inst2dict(puzzle)])\n\tprint(\"sent: \")\n\tprint(puzzle)\n\nfunc sendBlockUpdate(pos):\n\tif !isNetwork:\n\t\tprint(\"Error sending start packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_BLOCK_UPDATE, pos])\n\nfunc sendFinish(score):\n\tif !isNetwork:\n\t\tprint(\"Error sending finish packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_FINISH, root.get_node(\"Puzzle\").time.val])\n\nfunc sendQuit():\n\tif !isNetwork:\n\t\tprint(\"Error sending finish packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_QUIT])\n\nfunc sendTransform(translation):\n\tif !isNetwork:\n\t\tprint(\"Cannot send transformation over an unitialized network!\")\n\t\treturn\n\tconnection.put_var([REMOTE_PUZZLE_TRANSFORM, translation])\n\n\nfunc gotoMenu():\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\troot.add_child( load(\"res:\/\/menus.scn\") )\n\nfunc gotoPuzzle():\n\tvar guiMan = preload(\"GUIManager.gd\").new()\n\tguiMan.gotoPuzzleScene(root, true) # network = true\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"f104425c98ea72b505ee7a642c51d32cb443123b","subject":"Rooms fix","message":"Rooms fix\n","repos":"P1X-in\/rat-is-fat","old_file":"scripts\/map\/room_loader.gd","new_file":"scripts\/map\/room_loader.gd","new_contents":"\n\nvar bag\nvar tilemap\nvar room_max_size = Vector2(20, 12)\nvar side_offset = 3\n\nvar spawns = {\n 'initial0' : Vector2(8, 5),\n 'initial1' : Vector2(9, 5),\n 'initial2' : Vector2(8, 6),\n 'initial3' : Vector2(9, 6),\n 'north0' : Vector2(8, 1),\n 'north1' : Vector2(9, 1),\n 'north2' : Vector2(8, 2),\n 'north3' : Vector2(9, 2),\n 'south0' : Vector2(8, 9),\n 'south1' : Vector2(9, 9),\n 'south2' : Vector2(8, 8),\n 'south3' : Vector2(9, 8),\n 'east0' : Vector2(15, 5),\n 'east1' : Vector2(14, 5),\n 'east2' : Vector2(15, 6),\n 'east3' : Vector2(14, 6),\n 'west0' : Vector2(1, 5),\n 'west1' : Vector2(2, 5),\n 'west2' : Vector2(1, 6),\n 'west3' : Vector2(2, 6),\n}\n\nvar room_templates = {\n 'start' : preload(\"res:\/\/scripts\/map\/rooms\/start_room.gd\"),\n 'easy1' : preload(\"res:\/\/scripts\/map\/rooms\/easy1_room.gd\"),\n 'easy2' : preload(\"res:\/\/scripts\/map\/rooms\/easy2_room.gd\"),\n 'easy3' : preload(\"res:\/\/scripts\/map\/rooms\/easy3_room.gd\"),\n 'easy4' : preload(\"res:\/\/scripts\/map\/rooms\/easy4_room.gd\"),\n 'easy5' : preload(\"res:\/\/scripts\/map\/rooms\/easy5_room.gd\"),\n 'easy6' : preload(\"res:\/\/scripts\/map\/rooms\/easy6_room.gd\"),\n}\n\nvar difficulty_templates = [\n ['start'],\n ['easy1', 'easy2', 'easy3', 'easy4', 'easy5', 'easy6'],\n]\n\n\nvar door_definitions = {\n 'north' : [\n [7, 0, 14],\n [8, 0, 0, 5],\n [9, 0, 13],\n ],\n 'south' : [\n [7, 10, 16],\n [8, 10, 0, 10],\n [9, 10, 15],\n ],\n 'east' : [\n [16, 4, 13],\n [16, 5, 0, 9],\n [16, 6, 15],\n ],\n 'west' : [\n [0, 4, 14],\n [0, 5, 0, 7],\n [0, 6, 16],\n ],\n}\n\nfunc _init_bag(bag):\n self.bag = bag\n self.tilemap = self.bag.action_controller.tilemap\n\nfunc load_room(cell):\n var template_name = cell.template_name\n var data\n self.clear_space()\n self.bag.game_state.current_room = self.room_templates[template_name].new()\n data = self.create_passages(self.bag.game_state.current_room.room, cell)\n self.apply_room_data(data)\n if self.bag.game_state.current_room.enemies.size() > 0 && not cell.clear:\n self.spawn_enemies(self.bag.game_state.current_room.enemies)\n self.close_doors()\n else:\n self.open_doors()\n self.bag.items.reset()\n if cell.items_loaded:\n self.load_previous_items(cell.items)\n else:\n self.spawn_items(self.bag.game_state.current_room.items, cell)\n cell.items_loaded = true\n\nfunc create_passages(data, cell):\n if cell.north != null:\n data = self.open_passage(data, self.door_definitions['north'])\n if cell.south != null:\n data = self.open_passage(data, self.door_definitions['south'])\n if cell.east != null:\n data = self.open_passage(data, self.door_definitions['east'])\n if cell.west != null:\n data = self.open_passage(data, self.door_definitions['west'])\n return data\n\nfunc open_passage(data, passage):\n for tile in passage:\n data[tile[1]][tile[0]] = tile[2]\n return data\n\nfunc close_doors():\n self.bag.game_state.doors_open = false\n self.switch_doors(3)\n\nfunc open_doors():\n self.bag.game_state.doors_open = true\n self.switch_doors(2)\n\nfunc switch_doors(tile_index):\n var door_coords\n var cell = self.bag.game_state.current_cell\n if cell.north != null:\n door_coords = self.door_definitions['north'][1]\n self.tilemap.set_cell(door_coords[0] + self.side_offset, door_coords[1], door_coords[tile_index])\n if cell.south != null:\n door_coords = self.door_definitions['south'][1]\n self.tilemap.set_cell(door_coords[0] + self.side_offset, door_coords[1], door_coords[tile_index])\n if cell.east != null:\n door_coords = self.door_definitions['east'][1]\n self.tilemap.set_cell(door_coords[0] + self.side_offset, door_coords[1], door_coords[tile_index])\n if cell.west != null:\n door_coords = self.door_definitions['west'][1]\n self.tilemap.set_cell(door_coords[0] + self.side_offset, door_coords[1], door_coords[tile_index])\n\nfunc clear_space():\n for x in range(self.room_max_size.x):\n for y in range(self.room_max_size.y):\n self.tilemap.set_cell(x, y, -1)\n\nfunc apply_room_data(data):\n var row\n for y in range(0, data.size()):\n row = data[y]\n for x in range(0, row.size()):\n self.tilemap.set_cell(x + self.side_offset, y, data[y][x])\n\nfunc spawn_enemies(enemies):\n var position = Vector2(0, 0)\n self.bag.enemies.reset()\n for enemy_data in enemies:\n position.x = enemy_data[0] + self.side_offset\n position.y = enemy_data[1]\n self.bag.enemies.spawn(enemy_data[2], position)\n\nfunc spawn_items(items, cell):\n var position = Vector2(0, 0)\n for item_data in items:\n position.x = item_data[0] + self.side_offset\n position.y = item_data[1]\n cell.add_item(self.bag.items.spawn(item_data[2], position))\n\nfunc load_previous_items(items):\n for item in items:\n items[item].attach()\n self.bag.items.add_item(items[item])\n\nfunc get_spawn_position(spawn_name):\n var position = self.bag.room_loader.spawns[spawn_name]\n position.x = position.x + self.side_offset\n return self.translate_position(position)\n\nfunc translate_position(position):\n return self.tilemap.map_to_world(position)","old_contents":"\n\nvar bag\nvar tilemap\nvar room_max_size = Vector2(20, 12)\nvar side_offset = 3\n\nvar spawns = {\n 'initial0' : Vector2(8, 5),\n 'initial1' : Vector2(9, 5),\n 'initial2' : Vector2(8, 6),\n 'initial3' : Vector2(9, 6),\n 'north0' : Vector2(8, 1),\n 'north1' : Vector2(9, 1),\n 'north2' : Vector2(8, 2),\n 'north3' : Vector2(9, 2),\n 'south0' : Vector2(8, 9),\n 'south1' : Vector2(9, 9),\n 'south2' : Vector2(8, 8),\n 'south3' : Vector2(9, 8),\n 'east0' : Vector2(15, 5),\n 'east1' : Vector2(14, 5),\n 'east2' : Vector2(15, 6),\n 'east3' : Vector2(14, 6),\n 'west0' : Vector2(1, 5),\n 'west1' : Vector2(2, 5),\n 'west2' : Vector2(1, 6),\n 'west3' : Vector2(2, 6),\n}\n\nvar room_templates = {\n 'start' : preload(\"res:\/\/scripts\/map\/rooms\/start_room.gd\"),\n 'easy1' : preload(\"res:\/\/scripts\/map\/rooms\/easy1_room.gd\"),\n 'easy2' : preload(\"res:\/\/scripts\/map\/rooms\/easy1_room.gd\"),\n 'easy3' : preload(\"res:\/\/scripts\/map\/rooms\/easy1_room.gd\"),\n 'easy4' : preload(\"res:\/\/scripts\/map\/rooms\/easy1_room.gd\"),\n 'easy5' : preload(\"res:\/\/scripts\/map\/rooms\/easy1_room.gd\"),\n 'easy6' : preload(\"res:\/\/scripts\/map\/rooms\/easy1_room.gd\"),\n}\n\nvar difficulty_templates = [\n ['start'],\n ['easy1', 'easy2', 'easy3', 'easy4', 'easy5', 'easy6'],\n]\n\n\nvar door_definitions = {\n 'north' : [\n [7, 0, 14],\n [8, 0, 0, 5],\n [9, 0, 13],\n ],\n 'south' : [\n [7, 10, 16],\n [8, 10, 0, 10],\n [9, 10, 15],\n ],\n 'east' : [\n [16, 4, 13],\n [16, 5, 0, 9],\n [16, 6, 15],\n ],\n 'west' : [\n [0, 4, 14],\n [0, 5, 0, 7],\n [0, 6, 16],\n ],\n}\n\nfunc _init_bag(bag):\n self.bag = bag\n self.tilemap = self.bag.action_controller.tilemap\n\nfunc load_room(cell):\n var template_name = cell.template_name\n var data\n self.clear_space()\n self.bag.game_state.current_room = self.room_templates[template_name].new()\n data = self.create_passages(self.bag.game_state.current_room.room, cell)\n self.apply_room_data(data)\n if self.bag.game_state.current_room.enemies.size() > 0 && not cell.clear:\n self.spawn_enemies(self.bag.game_state.current_room.enemies)\n self.close_doors()\n else:\n self.open_doors()\n self.bag.items.reset()\n if cell.items_loaded:\n self.load_previous_items(cell.items)\n else:\n self.spawn_items(self.bag.game_state.current_room.items, cell)\n cell.items_loaded = true\n\nfunc create_passages(data, cell):\n if cell.north != null:\n data = self.open_passage(data, self.door_definitions['north'])\n if cell.south != null:\n data = self.open_passage(data, self.door_definitions['south'])\n if cell.east != null:\n data = self.open_passage(data, self.door_definitions['east'])\n if cell.west != null:\n data = self.open_passage(data, self.door_definitions['west'])\n return data\n\nfunc open_passage(data, passage):\n for tile in passage:\n data[tile[1]][tile[0]] = tile[2]\n return data\n\nfunc close_doors():\n self.bag.game_state.doors_open = false\n self.switch_doors(3)\n\nfunc open_doors():\n self.bag.game_state.doors_open = true\n self.switch_doors(2)\n\nfunc switch_doors(tile_index):\n var door_coords\n var cell = self.bag.game_state.current_cell\n if cell.north != null:\n door_coords = self.door_definitions['north'][1]\n self.tilemap.set_cell(door_coords[0] + self.side_offset, door_coords[1], door_coords[tile_index])\n if cell.south != null:\n door_coords = self.door_definitions['south'][1]\n self.tilemap.set_cell(door_coords[0] + self.side_offset, door_coords[1], door_coords[tile_index])\n if cell.east != null:\n door_coords = self.door_definitions['east'][1]\n self.tilemap.set_cell(door_coords[0] + self.side_offset, door_coords[1], door_coords[tile_index])\n if cell.west != null:\n door_coords = self.door_definitions['west'][1]\n self.tilemap.set_cell(door_coords[0] + self.side_offset, door_coords[1], door_coords[tile_index])\n\nfunc clear_space():\n for x in range(self.room_max_size.x):\n for y in range(self.room_max_size.y):\n self.tilemap.set_cell(x, y, -1)\n\nfunc apply_room_data(data):\n var row\n for y in range(0, data.size()):\n row = data[y]\n for x in range(0, row.size()):\n self.tilemap.set_cell(x + self.side_offset, y, data[y][x])\n\nfunc spawn_enemies(enemies):\n var position = Vector2(0, 0)\n self.bag.enemies.reset()\n for enemy_data in enemies:\n position.x = enemy_data[0] + self.side_offset\n position.y = enemy_data[1]\n self.bag.enemies.spawn(enemy_data[2], position)\n\nfunc spawn_items(items, cell):\n var position = Vector2(0, 0)\n for item_data in items:\n position.x = item_data[0] + self.side_offset\n position.y = item_data[1]\n cell.add_item(self.bag.items.spawn(item_data[2], position))\n\nfunc load_previous_items(items):\n for item in items:\n items[item].attach()\n self.bag.items.add_item(items[item])\n\nfunc get_spawn_position(spawn_name):\n var position = self.bag.room_loader.spawns[spawn_name]\n position.x = position.x + self.side_offset\n return self.translate_position(position)\n\nfunc translate_position(position):\n return self.tilemap.map_to_world(position)","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"ad77386e89aa0b3ad9a0d14cd544d9e01a189daf","subject":"Reset position of the player after hit the totem.","message":"Reset position of the player after hit the totem.\n","repos":"CSaratakij\/jam-2016-remake","old_file":"src\/player\/player.gd","new_file":"src\/player\/player.gd","new_contents":"\nextends KinematicBody2D\n\nconst GRAVITY = 1000.0\nconst MOVE_SPEED = 260.0\nconst JUMP_FORCE = 230.0\nconst POINT = 1\nconst INIT_MOVE_DIRECTION = Vector2(1, 1)\n\nvar _velocity = Vector2()\nvar _motion = Vector2()\nvar is_grounded = false\nvar score = 0\nvar start_points = [\n\t\tMatrix32(0.0, Vector2(0, 80)),\n\t\tMatrix32(0.0, Vector2(715, 220)),\n\t\tMatrix32(0.0, Vector2(0, 360))\n\t]\n\nvar _move_direction = INIT_MOVE_DIRECTION\nvar current_floor = 1\n\nonready var tree = get_tree()\nonready var root = tree.get_root()\nonready var _sprite = get_node(\"Sprite\")\nonready var _raycast = get_node(\"RayCast2D\")\nonready var _health = get_node(\"health\")\nonready var global = root.get_node(\"\/root\/global\")\n\nfunc _ready():\n\tset_fixed_process(true)\n\nfunc _fixed_process(delta):\n\tis_grounded = _raycast.is_colliding()\n\t_velocity.y += _move_direction.y * GRAVITY * delta\n\t\n\tif not global.is_game_over():\n\t\t_velocity.x = _move_direction.x * MOVE_SPEED\n\telse:\n\t\t_velocity.x = 0.0\n\t\n\tif is_grounded:\n\t\tif Input.is_action_pressed(\"jump\"):\n\t\t\t_velocity.y = -JUMP_FORCE\n\t\n#\tif OS.has_touchscreen_ui_hint():\n#\t\tpass\n#\t\t#Jump by touch screen\n#\telse:\n#\t\tpass\n#\t\t#Jump by keyboard or mouse\n\t\n\t_motion = _velocity * delta\n\t_motion = move(_motion)\n\t\n\tif is_colliding():\n\t\tvar n = get_collision_normal()\n\t\t_motion = n.slide(_motion)\n\t\t_velocity = n.slide(_velocity)\n\t\tmove(_motion)\n\nfunc change_move_direction_h():\n\t_move_direction.x *= -1\n\nfunc reset_move_direction():\n\t_move_direction = INIT_MOVE_DIRECTION\n\nfunc _on_Area2D_area_enter( area ):\n\tif area.get_groups()[0] == \"switch_side_trigger\":\n\t\tglobal.add_score(POINT)\n\t\t\n\t\tif area.get_name() == \"floor1-2\":\n\t\t\tcurrent_floor = 2\n\t\t\tset_transform(start_points[current_floor - 1])\n\t\t\tchange_move_direction_h()\n\t\t\t_sprite.set_flip_h(true)\n\t\t\n\t\telif area.get_name() == \"floor2-3\":\n\t\t\tcurrent_floor = 3\n\t\t\tset_transform(start_points[current_floor - 1])\n\t\t\tchange_move_direction_h()\n\t\t\t_sprite.set_flip_h(false)\n\t\t\n\t\telif area.get_name() == \"floor3-1\":\n\t\t\tcurrent_floor = 1\n\t\t\tset_transform(start_points[current_floor - 1])\n\n\nfunc _on_Area2D_body_enter( body ):\n\tif body.get_groups()[0] == \"totem\":\n\t\t_health.remove(1)\n\t\tset_transform(start_points[current_floor - 1])","old_contents":"\nextends KinematicBody2D\n\nconst GRAVITY = 1000.0\nconst MOVE_SPEED = 260.0\nconst JUMP_FORCE = 230.0\nconst POINT = 1\nconst INIT_MOVE_DIRECTION = Vector2(1, 1)\n\nvar _velocity = Vector2()\nvar _motion = Vector2()\nvar is_grounded = false\nvar score = 0\nvar start_points = [\n\t\t\t\t\tVector2(0, 80),\n\t\t\t\t\tVector2(715, 220),\n\t\t\t\t\tVector2(0, 360)\n\t\t\t\t\t]\n\nonready var _move_direction = INIT_MOVE_DIRECTION\nonready var tree = get_tree()\nonready var root = tree.get_root()\nonready var _sprite = get_node(\"Sprite\")\nonready var _raycast = get_node(\"RayCast2D\")\nonready var _health = get_node(\"health\")\nonready var global = root.get_node(\"\/root\/global\")\n\nfunc _ready():\n\tset_fixed_process(true)\n\nfunc _fixed_process(delta):\n\tis_grounded = _raycast.is_colliding()\n\t_velocity.y += _move_direction.y * GRAVITY * delta\n\t\n\tif not global.is_game_over():\n\t\t_velocity.x = _move_direction.x * MOVE_SPEED\n\telse:\n\t\t_velocity.x = 0.0\n\t\n\tif is_grounded:\n\t\tif Input.is_action_pressed(\"jump\"):\n\t\t\t_velocity.y = -JUMP_FORCE\n\t\n#\tif OS.has_touchscreen_ui_hint():\n#\t\tpass\n#\t\t#Jump by touch screen\n#\telse:\n#\t\tpass\n#\t\t#Jump by keyboard or mouse\n\t\n\t_motion = _velocity * delta\n\t_motion = move(_motion)\n\t\n\tif is_colliding():\n\t\tvar n = get_collision_normal()\n\t\t_motion = n.slide(_motion)\n\t\t_velocity = n.slide(_velocity)\n\t\tmove(_motion)\n\nfunc change_move_direction_h():\n\t_move_direction.x *= -1\n\nfunc reset_move_direction():\n\t_move_direction = INIT_MOVE_DIRECTION\n\nfunc _on_Area2D_area_enter( area ):\n\tif area.get_groups()[0] == \"switch_side_trigger\":\n\t\tglobal.add_score(POINT)\n\t\t\n\t\tif area.get_name() == \"floor1-2\":\n\t\t\tset_transform(Matrix32(0.0, start_points[1]))\n\t\t\tchange_move_direction_h()\n\t\t\t_sprite.set_flip_h(true)\n\t\t\n\t\telif area.get_name() == \"floor2-3\":\n\t\t\tset_transform(Matrix32(0.0, start_points[2]))\n\t\t\tchange_move_direction_h()\n\t\t\t_sprite.set_flip_h(false)\n\t\t\n\t\telif area.get_name() == \"floor3-1\":\n\t\t\tset_transform(Matrix32(0.0, start_points[0]))\n\n\nfunc _on_Area2D_body_enter( body ):\n\tif body.get_groups()[0] == \"totem\":\n\t\t_health.remove(1)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"82e8f492fe421fccf360a40c37ac6c35d9a947de","subject":"3D Import Import & UDP -=-=-=-=-=-=-=-=-=-=-","message":"3D Import Import & UDP\n-=-=-=-=-=-=-=-=-=-=-\n\n-Animation Import filter support\n-Animation Clip import support\n-Animation Optimizer Fixes, Improvements and Visibile Options\n-Extremely Experimental UDP support.\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"2d\/shower_of_bullets\/bullets.gd","new_file":"2d\/shower_of_bullets\/bullets.gd","new_contents":"\nextends Node2D\n\n# This demo is an example of controling a high number of 2D objects with logic and collision without using scene nodes.\n# This technique is a lot more efficient than using instancing and nodes, but requires more programming and is less visual\n\nconst BULLET_COUNT = 500\nconst SPEED_MIN = 20\nconst SPEED_MAX = 50\n\nvar bullets=[]\nvar shape\n\nclass Bullet:\n\tvar pos = Vector2()\n\tvar speed = 1.0\n\tvar body = RID()\n\t\n\nfunc _draw():\n\n\tvar t = preload(\"res:\/\/bullet.png\")\n\tvar tofs = -t.get_size()*0.5\n\tfor b in bullets:\n\t\tdraw_texture(t,b.pos+tofs)\t\n\t\t\n\t\nfunc _process(delta):\n\tvar width = get_viewport_rect().size.x*2.0\n\tvar mat = Matrix32()\n\tfor b in bullets:\n\t\tb.pos.x-=b.speed*delta\n\t\tif (b.pos.x < -30):\n\t\t\tb.pos.x+=width\n\t\tmat.o=b.pos\t\t\n\t\t\n\t\tPhysics2DServer.body_set_state(b.body,Physics2DServer.BODY_STATE_TRANSFORM,mat)\n\t\t\n\tupdate()\n\t\t\n\t\t\t\nfunc _ready():\n\n\tshape = Physics2DServer.shape_create(Physics2DServer.SHAPE_CIRCLE)\n\tPhysics2DServer.shape_set_data(shape,8) #radius\n\n\tfor i in range(BULLET_COUNT):\n\t\tvar b = Bullet.new()\n\t\tb.speed=rand_range(SPEED_MIN,SPEED_MAX)\n\t\tb.body = Physics2DServer.body_create(Physics2DServer.BODY_MODE_KINEMATIC)\n\t\tPhysics2DServer.body_set_space(b.body,get_world_2d().get_space())\n\t\tPhysics2DServer.body_add_shape(b.body,shape)\n\t\t\n\t\tb.pos = Vector2( get_viewport_rect().size * Vector2(randf()*2.0,randf()) ) #twice as long\n\t\tb.pos.x += get_viewport_rect().size.x # start outside\n\t\tvar mat = Matrix32()\n\t\tmat.o=b.pos\n\t\tPhysics2DServer.body_set_state(b.body,Physics2DServer.BODY_STATE_TRANSFORM,mat)\n\t\t\n\t\tbullets.append(b)\n\t\t\n\t\t\n\tset_process(true)\n\t\t\n\t\nfunc _exit_tree():\n\tfor b in bullets:\n\t\tPhysics2DServer.free_rid(b.body)\n\t\n\tPhysics2DServer.free_rid(shape)\n\t# Initalization here\n\tbullets.clear()\n\t\n\tpass\n\n\n","old_contents":"\nextends Node2D\n\n# This demo is an example of controling a high number of 2D objects with logic and collision without using scene nodes.\n# This technique is a lot more efficient than using instancing and nodes, but requires more programming and is less visual\n\nconst BULLET_COUNT = 500\nconst SPEED_MIN = 20\nconst SPEED_MAX = 50\n\nvar bullets=[]\nvar shape\n\nclass Bullet:\n\tvar pos = Vector2()\n\tvar speed = 1.0\n\tvar body = RID()\n\t\n\nfunc _draw():\n\n\tvar t = preload(\"res:\/\/bullet.png\")\n\tvar tofs = -t.get_size()*0.5\n\tfor b in bullets:\n\t\tdraw_texture(t,b.pos+tofs)\t\n\t\t\n\t\nfunc _process(delta):\n\tvar width = get_viewport_rect().size.x*2.0\n\tvar mat = Matrix32()\n\tfor b in bullets:\n\t\tb.pos.x-=b.speed*delta\n\t\tif (b.pos.x < -30):\n\t\t\tb.pos.x+=width\n\t\tmat.o=b.pos\t\t\n\t\t\n\t\tPhysics2DServer.body_set_state(b.body,Physics2DServer.BODY_STATE_TRANSFORM,mat)\n\t\t\n\tupdate()\n\t\t\n\t\t\t\nfunc _ready():\n\n\tshape = Physics2DServer.shape_create(Physics2DServer.SHAPE_CIRCLE)\n\tPhysics2DServer.shape_set_data(shape,8) #radius\n\n\tfor i in range(BULLET_COUNT):\n\t\tvar b = Bullet.new()\n\t\tb.speed=rand_range(SPEED_MIN,SPEED_MAX)\n\t\tb.body = Physics2DServer.body_create(Physics2DServer.BODY_MODE_KINEMATIC)\n\t\tPhysics2DServer.body_set_space(b.body,get_world_2d().get_space())\n\t\tPhysics2DServer.body_add_shape(b.body,shape)\n\t\t\n\t\tb.pos = Vector2( get_viewport_rect().size * Vector2(randf()*2.0,randf()) ) #twice as long\n\t\tb.pos.x += get_viewport_rect().size.x # start outside\n\t\tvar mat = Matrix32()\n\t\tmat.o=b.pos\n\t\tPhysics2DServer.body_set_state(b.body,Physics2DServer.BODY_STATE_TRANSFORM,mat)\n\t\t\n\t\tbullets.append(b)\n\t\t\n\t\t\n\tset_process(true)\n\t\t\n\t\nfunc _exit_tree():\n\tfor b in bullets:\n\t\tPhysics2DServer.free(b.body)\n\t\n\tPhysics2DServer.free(shape)\n\t# Initalization here\n\tbullets.clear()\n\t\n\tpass\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"0d6f22d98350ec208c093277fc05e4df7e4ba2f1","subject":"Check that the network is connected before trying to send click information","message":"Check that the network is connected before trying to send click information\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Blocks\/PairedBlock.gd","new_file":"src\/scripts\/Blocks\/PairedBlock.gd","new_contents":"extends \"AbstractBlock.gd\"\n\n# Is there a better way to do this?\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\nvar textureName\n\nfunc setTexture(textureName=\"Red\"):\n\tvar img = Image()\n\tself.textureName = textureName\n\n\tvar mat = load(\"res:\/\/materials\/block_\" + textureName + \".mtl\")\n\n\tself.get_node(\"MeshInstance\").set_material_override(mat)\n\treturn self\n\n# Animate the removal of this block and its pair.\nfunc popBlock( pairNode, justFly=false ):\n\tget_parent().samplePlayer.play(\"deraj_pop_sound_low\")\n\t# fly away\n\tvar tweenNode = newTweenNode()\n\ttweenNode.interpolate_method( self, \"set_translation\", \\\n\t\tself.get_translation(), self.get_translation().normalized() * far_away_corner, \\\n\t\t1, Tween.TRANS_CIRC, Tween.EASE_IN_OUT )\n\n\t# remove on animation end\n\ttweenNode.connect(\"tween_complete\", self, \"request_remove\")\n\n\tvar network = Globals.get(\"Network\")\n\tif (not network == null and get_parent().get_parent().active and network.isNetwork):\n\t\t\tnetwork.sendBlockUpdate(blockPos)\n\n\ttweenNode.start()\n\t# just one call to activate...\n\tif not justFly:\n\t\tpairNode.activate(true)\n\t\tget_parent().popPair( blockPos )\n\n# THIS IS EVERYWHERE, ANY BETTER WAY TO HAVE FUNCTIONS BETWEEN SCRIPTS?\nfunc calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n# fly away only if self.pairName is selected\nfunc activate(justFly = false):\n\tvar gridMan = get_parent()\n\tif gridMan.selectedBlocks.size() > 0:\n\t\tvar selBlock = gridMan.get_node( gridMan.selectedBlocks[0] )\n\n\t\tif selBlock.getBlockType() == BLOCK_WILD:\n\t\t\tif selBlock.textureName == textureName:\n\t\t\t\tif calcBlockLayerVec( selBlock.blockPos ) == calcBlockLayerVec( blockPos ):\n\t\t\t\t\tgridMan.clearSelection()\n\t\t\t\t\tselBlock.popBlock()\n\t\t\t\t\tforceActivate()\n\n\t\t\t\t\treturn\n\n\tvar pairNode = pairActivate()\n\tif pairNode == null:\n\t\treturn\n\tif pairNode.selected:\n\t\tpopBlock( pairNode, justFly )\n\n\n# Force the pair to activate.\nfunc forceActivate():\n\tvar pairNode = pairActivate()\n\tif pairNode == null:\n\t\treturn\n\n\tpopBlock( pairNode )\n\n","old_contents":"extends \"AbstractBlock.gd\"\n\n# Is there a better way to do this?\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\nvar textureName\n\nfunc setTexture(textureName=\"Red\"):\n\tvar img = Image()\n\tself.textureName = textureName\n\n\tvar mat = load(\"res:\/\/materials\/block_\" + textureName + \".mtl\")\n\n\tself.get_node(\"MeshInstance\").set_material_override(mat)\n\treturn self\n\n# Animate the removal of this block and its pair.\nfunc popBlock( pairNode, justFly=false ):\n\tget_parent().samplePlayer.play(\"deraj_pop_sound_low\")\n\t# fly away\n\tvar tweenNode = newTweenNode()\n\ttweenNode.interpolate_method( self, \"set_translation\", \\\n\t\tself.get_translation(), self.get_translation().normalized() * far_away_corner, \\\n\t\t1, Tween.TRANS_CIRC, Tween.EASE_IN_OUT )\n\n\t# remove on animation end\n\ttweenNode.connect(\"tween_complete\", self, \"request_remove\")\n\n\tvar network = Globals.get(\"Network\")\n\tif (not network == null and get_parent().get_parent().active):\n\t\t\tnetwork.sendBlockUpdate(blockPos)\n\n\ttweenNode.start()\n\t# just one call to activate...\n\tif not justFly:\n\t\tpairNode.activate(true)\n\t\tget_parent().popPair( blockPos )\n\n# THIS IS EVERYWHERE, ANY BETTER WAY TO HAVE FUNCTIONS BETWEEN SCRIPTS?\nfunc calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n# fly away only if self.pairName is selected\nfunc activate(justFly = false):\n\tvar gridMan = get_parent()\n\tif gridMan.selectedBlocks.size() > 0:\n\t\tvar selBlock = gridMan.get_node( gridMan.selectedBlocks[0] )\n\n\t\tif selBlock.getBlockType() == BLOCK_WILD:\n\t\t\tif selBlock.textureName == textureName:\n\t\t\t\tif calcBlockLayerVec( selBlock.blockPos ) == calcBlockLayerVec( blockPos ):\n\t\t\t\t\tgridMan.clearSelection()\n\t\t\t\t\tselBlock.popBlock()\n\t\t\t\t\tforceActivate()\n\n\t\t\t\t\treturn\n\n\tvar pairNode = pairActivate()\n\tif pairNode == null:\n\t\treturn\n\tif pairNode.selected:\n\t\tpopBlock( pairNode, justFly )\n\n\n# Force the pair to activate.\nfunc forceActivate():\n\tvar pairNode = pairActivate()\n\tif pairNode == null:\n\t\treturn\n\n\tpopBlock( pairNode )\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"4f40b0940c29274fb7d45d21a2406128cae747f4","subject":"IAP: Use PoolStringArray for 3.0+","message":"IAP: Use PoolStringArray for 3.0+\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"misc\/android_iap\/iap.gd","new_file":"misc\/android_iap\/iap.gd","new_contents":"\nextends Node\n\nsignal purchase_success(item_name)\nsignal purchase_fail\nsignal purchase_cancel\nsignal purchase_owned(item_name)\n\nsignal has_purchased(item_name)\n\nsignal consume_success(item_name)\nsignal consume_fail\nsignal consume_not_required\n\nsignal sku_details_complete\nsignal sku_details_error\n\nonready var payment = Engine.get_singleton(\"GodotPayments\")\n\nfunc _ready():\n\tif payment:\n\t\t# set callback with this script instance\n\t\tpayment.setPurchaseCallbackId(get_instance_ID())\n\n# set consume purchased item automatically after purchase, defulat value is true\nfunc set_auto_consume(auto):\n\tif payment:\n\t\tpayment.setAutoConsume(auto)\n\n\n# request user owned item, callback : has_purchased\nfunc request_purchased():\n\tif payment:\n\t\tpayment.requestPurchased()\n\nfunc has_purchased(receipt, signature, sku):\n\tif sku == \"\":\n\t\tprint(\"has_purchased : nothing\")\n\t\temit_signal(\"has_purchased\", null)\n\telse:\n\t\tprint(\"has_purchased : \", sku)\n\t\temit_signal(\"has_purchased\", sku)\n\n\n# purchase item\n# callback : purchase_success, purchase_fail, purchase_cancel, purchase_owned\nfunc purchase(item_name):\n\tif payment:\n\t\t# transaction_id could be any string that used for validation internally in java\n\t\tpayment.purchase(item_name, \"transaction_id\")\n\nfunc purchase_success(receipt, signature, sku):\n\tprint(\"purchase_success : \", sku)\n\temit_signal(\"purchase_success\", sku)\n\nfunc purchase_fail():\n\tprint(\"purchase_fail\")\n\temit_signal(\"purchase_fail\")\n\nfunc purchase_cancel():\n\tprint(\"purchase_cancel\")\n\temit_signal(\"purchase_cancel\")\n\nfunc purchase_owned(sku):\n\tprint(\"purchase_owned : \", sku)\n\temit_signal(\"purchase_owned\", sku)\n\n\n# consume purchased item\n# callback : consume_success, consume_fail\nfunc consume(item_name):\n\tif payment:\n\t\tpayment.consume(item_name)\n\n# consume all purchased items\nfunc consume_all():\n\tif payment:\n\t\tpayment.consumeUnconsumedPurchases()\n\nfunc consume_success(receipt, signature, sku):\n\tprint(\"consume_success : \", sku)\n\temit_signal(\"consume_success\", sku)\n\n# if consume fail, need to call request_purchased() to get purchase token from google\n# then try to consume again\nfunc consume_fail():\n\temit_signal(\"consume_fail\")\n\n# no purchased item to consume\nfunc consume_not_required():\n\temit_signal(\"consume_not_required\")\n\n\n# detail info of IAP items\n# sku_details = {\n# product_id (String) : {\n# type (String),\n# product_id (String),\n# title (String),\n# description (String),\n# price (String), # this can be used to display price for each country with their own currency\n# price_currency_code (String),\n# price_amount (float)\n# },\n# ...\n# }\nvar sku_details = {}\n\n# query for details of IAP items\n# callback : sku_details_complete\nfunc sku_details_query(list):\n\tif payment:\n\t\tvar sku_list = PoolStringArray(list)\n\t\tpayment.querySkuDetails(sku_list)\n\nfunc sku_details_complete(result):\n\tprint(\"sku_details_complete : \", result)\n\tfor key in result.keys():\n\t\tsku_details[key] = result[key]\n\temit_signal(\"sku_details_complete\")\n\nfunc sku_details_error(error_message):\n\tprint(\"error_sku_details = \", error_message)\n\temit_signal(\"sku_details_error\")\n","old_contents":"\nextends Node\n\nsignal purchase_success(item_name)\nsignal purchase_fail\nsignal purchase_cancel\nsignal purchase_owned(item_name)\n\nsignal has_purchased(item_name)\n\nsignal consume_success(item_name)\nsignal consume_fail\nsignal consume_not_required\n\nsignal sku_details_complete\nsignal sku_details_error\n\nonready var payment = Engine.get_singleton(\"GodotPayments\")\n\nfunc _ready():\n\tif payment:\n\t\t# set callback with this script instance\n\t\tpayment.setPurchaseCallbackId(get_instance_ID())\n\n# set consume purchased item automatically after purchase, defulat value is true\nfunc set_auto_consume(auto):\n\tif payment:\n\t\tpayment.setAutoConsume(auto)\n\n\n# request user owned item, callback : has_purchased\nfunc request_purchased():\n\tif payment:\n\t\tpayment.requestPurchased()\n\nfunc has_purchased(receipt, signature, sku):\n\tif sku == \"\":\n\t\tprint(\"has_purchased : nothing\")\n\t\temit_signal(\"has_purchased\", null)\n\telse:\n\t\tprint(\"has_purchased : \", sku)\n\t\temit_signal(\"has_purchased\", sku)\n\n\n# purchase item\n# callback : purchase_success, purchase_fail, purchase_cancel, purchase_owned\nfunc purchase(item_name):\n\tif payment:\n\t\t# transaction_id could be any string that used for validation internally in java\n\t\tpayment.purchase(item_name, \"transaction_id\")\n\nfunc purchase_success(receipt, signature, sku):\n\tprint(\"purchase_success : \", sku)\n\temit_signal(\"purchase_success\", sku)\n\nfunc purchase_fail():\n\tprint(\"purchase_fail\")\n\temit_signal(\"purchase_fail\")\n\nfunc purchase_cancel():\n\tprint(\"purchase_cancel\")\n\temit_signal(\"purchase_cancel\")\n\nfunc purchase_owned(sku):\n\tprint(\"purchase_owned : \", sku)\n\temit_signal(\"purchase_owned\", sku)\n\n\n# consume purchased item\n# callback : consume_success, consume_fail\nfunc consume(item_name):\n\tif payment:\n\t\tpayment.consume(item_name)\n\n# consume all purchased items\nfunc consume_all():\n\tif payment:\n\t\tpayment.consumeUnconsumedPurchases()\n\nfunc consume_success(receipt, signature, sku):\n\tprint(\"consume_success : \", sku)\n\temit_signal(\"consume_success\", sku)\n\n# if consume fail, need to call request_purchased() to get purchase token from google\n# then try to consume again\nfunc consume_fail():\n\temit_signal(\"consume_fail\")\n\n# no purchased item to consume\nfunc consume_not_required():\n\temit_signal(\"consume_not_required\")\n\n\n# detail info of IAP items\n# sku_details = {\n# product_id (String) : {\n# type (String),\n# product_id (String),\n# title (String),\n# description (String),\n# price (String), # this can be used to display price for each country with their own currency\n# price_currency_code (String),\n# price_amount (float)\n# },\n# ...\n# }\nvar sku_details = {}\n\n# query for details of IAP items\n# callback : sku_details_complete\nfunc sku_details_query(list):\n\tif payment:\n\t\tvar sku_list = StringArray(list)\n\t\tpayment.querySkuDetails(sku_list)\n\nfunc sku_details_complete(result):\n\tprint(\"sku_details_complete : \", result)\n\tfor key in result.keys():\n\t\tsku_details[key] = result[key]\n\temit_signal(\"sku_details_complete\")\n\nfunc sku_details_error(error_message):\n\tprint(\"error_sku_details = \", error_message)\n\temit_signal(\"sku_details_error\")\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"34ef148507fc7de0afa57bd670fcb279182c2778","subject":"player init pos from db","message":"player init pos from db\n","repos":"alketii\/Trepca,alketii\/Trepca","old_file":"world.gd","new_file":"world.gd","new_contents":"extends Node2D\n\nvar block = preload(\"res:\/\/block.tscn\")\nvar player_p = preload(\"res:\/\/player.tscn\")\n\nonready var db = SQLite.new()\n\nconst BLOCK_SIZE = 128\n\nconst VIEW_SIZE = [14,6]\n\nvar level = 0\nvar type = 0\n\nfunc _ready():\n\tdb.open(\"user:\/\/data.sqlite\")\n\tget_tree().set_auto_accept_quit(false)\n\tgenerate_world()\n\t\nfunc generate_parts(direction,pos):\n\tif direction == global.RIGHT:\n\t\tfor tile in db.fetch_array(\"SELECT * FROM tiles WHERE pos_x = \"+str(pos.x\/BLOCK_SIZE+7)+\" AND pos_y > \"+str(pos.y\/BLOCK_SIZE-3)+\" and pos_y < \"+str(pos.y\/BLOCK_SIZE+3)):\n\t\t\tadd_block(tile[\"pos_x\"],tile[\"pos_y\"],tile[\"tile_type\"])\n\telif direction == global.LEFT:\n\t\tfor tile in db.fetch_array(\"SELECT * FROM tiles WHERE pos_x = \"+str(pos.x\/BLOCK_SIZE-7)+\" AND pos_y > \"+str(pos.y\/BLOCK_SIZE-3)+\" and pos_y < \"+str(pos.y\/BLOCK_SIZE+3)):\n\t\t\tadd_block(tile[\"pos_x\"],tile[\"pos_y\"],tile[\"tile_type\"])\n\telif direction == global.DOWN:\n\t\tfor tile in db.fetch_array(\"SELECT * FROM tiles WHERE pos_x > \"+str(pos.x\/BLOCK_SIZE-7)+\" AND pos_x < \"+str(pos.x\/BLOCK_SIZE+7)+\" and pos_y = \"+str(pos.y\/BLOCK_SIZE+3)):\n\t\t\tadd_block(tile[\"pos_x\"],tile[\"pos_y\"],tile[\"tile_type\"])\n\nfunc generate_world():\n\tvar player = get_node(\"player\")\n\tvar pos = db.fetch_array(\"SELECT * FROM player LIMIT 1;\")\n\tpos = pos[0]\n\tfor tile in db.fetch_array(\"SELECT * FROM tiles WHERE pos_x > \"+str(int(pos[\"pos_x\"])-6)+\" AND pos_x < \"+str(int(pos[\"pos_x\"])+6)+\" AND pos_y > \"+str(int(pos[\"pos_y\"])-3)+\" and pos_y < \"+str(int(pos[\"pos_y\"])+3)):\n\t\tadd_block(tile[\"pos_x\"],tile[\"pos_y\"],tile[\"tile_type\"])\n\tadd_player()\n\t\t\t\nfunc add_block(x,y,type):\n\tif type != global.EMPTY:\n\t\tvar block_new = block.instance()\n\t\tblock_new.set_pos(Vector2(x*BLOCK_SIZE,y*BLOCK_SIZE))\n\t\tblock_new.set_z(-1)\n\t\tblock_new.get_node(\"tiles\").set_frame(type)\n\t\tadd_child(block_new)\n\nfunc add_player():\n\tvar player = player_p.instance()\n\tvar pos = db.fetch_array(\"SELECT * FROM player LIMIT 1;\")\n\tpos = pos[0]\n\tplayer.set_pos(Vector2(int(pos[\"pos_x\"])*BLOCK_SIZE,int(pos[\"pos_y\"])*BLOCK_SIZE-BLOCK_SIZE))\n\tadd_child(player)\n\nfunc _notification(what):\n\tif (what == MainLoop.NOTIFICATION_WM_QUIT_REQUEST):\n\t\tvar player = get_node(\"player\")\n\t\tvar pos = player.get_pos() \/ Vector2(128,128)\n\t\tdb.query(\"UPDATE player SET pos_x=\"+str(ceil(pos.x))+\" , pos_y=\"+str(ceil(pos.y)))\n\t\tget_tree().quit()","old_contents":"extends Node2D\n\nvar block = preload(\"res:\/\/block.tscn\")\nvar player_p = preload(\"res:\/\/player.tscn\")\n\nonready var db = SQLite.new()\n\nconst BLOCK_SIZE = 128\n\nconst VIEW_SIZE = [14,6]\n\nvar level = 0\nvar type = 0\n\nfunc _ready():\n\tdb.open(\"user:\/\/data.sqlite\")\n\tget_tree().set_auto_accept_quit(false)\n\tgenerate_world()\n\t\nfunc generate_parts(direction,pos):\n\tif direction == global.RIGHT:\n\t\tfor tile in db.fetch_array(\"SELECT * FROM tiles WHERE pos_x = \"+str(pos.x\/BLOCK_SIZE+7)+\" AND pos_y > \"+str(pos.y\/BLOCK_SIZE-3)+\" and pos_y < \"+str(pos.y\/BLOCK_SIZE+3)):\n\t\t\tadd_block(tile[\"pos_x\"],tile[\"pos_y\"],tile[\"tile_type\"])\n\telif direction == global.LEFT:\n\t\tfor tile in db.fetch_array(\"SELECT * FROM tiles WHERE pos_x = \"+str(pos.x\/BLOCK_SIZE-7)+\" AND pos_y > \"+str(pos.y\/BLOCK_SIZE-3)+\" and pos_y < \"+str(pos.y\/BLOCK_SIZE+3)):\n\t\t\tadd_block(tile[\"pos_x\"],tile[\"pos_y\"],tile[\"tile_type\"])\n\telif direction == global.DOWN:\n\t\tfor tile in db.fetch_array(\"SELECT * FROM tiles WHERE pos_x > \"+str(pos.x\/BLOCK_SIZE-7)+\" AND pos_x < \"+str(pos.x\/BLOCK_SIZE+7)+\" and pos_y = \"+str(pos.y\/BLOCK_SIZE+3)):\n\t\t\tadd_block(tile[\"pos_x\"],tile[\"pos_y\"],tile[\"tile_type\"])\n\nfunc generate_world():\n\tfor tile in db.fetch_array(\"SELECT * FROM tiles WHERE pos_x > -10 AND pos_x < 10 AND pos_y > -10 and pos_y < 10\"):\n\t\tadd_block(tile[\"pos_x\"],tile[\"pos_y\"],tile[\"tile_type\"])\n\tadd_player()\n\t\t\t\nfunc add_block(x,y,type):\n\tif type != global.EMPTY:\n\t\tvar block_new = block.instance()\n\t\tblock_new.set_pos(Vector2(x*BLOCK_SIZE,y*BLOCK_SIZE))\n\t\tblock_new.set_z(-1)\n\t\tblock_new.get_node(\"tiles\").set_frame(type)\n\t\tadd_child(block_new)\n\t\t\nfunc add_player():\n\tvar player = player_p.instance()\n\tvar pos = db.fetch_array(\"SELECT * FROM player LIMIT 1;\")\n\tpos = pos[0]\n\tplayer.set_pos(Vector2(int(pos[\"pos_x\"])*BLOCK_SIZE,int(pos[\"pos_y\"])*BLOCK_SIZE-BLOCK_SIZE))\n\tadd_child(player)\n\nfunc _notification(what):\n\tif (what == MainLoop.NOTIFICATION_WM_QUIT_REQUEST):\n\t\tvar player = get_node(\"player\")\n\t\tvar pos = player.get_pos() \/ Vector2(128,128)\n\t\tdb.query(\"UPDATE player SET pos_x=\"+str(ceil(pos.x))+\" , pos_y=\"+str(ceil(pos.y)))\n\t\tget_tree().quit()","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"ea0513572f40c792e518bab693bb6077302d4ebc","subject":"delayed wall jumps","message":"delayed wall jumps\n","repos":"w84death\/mountain-of-hope","old_file":"scripts\/moving_object.gd","new_file":"scripts\/moving_object.gd","new_contents":"extends \"res:\/\/scripts\/object.gd\"\n\nvar velocity\nvar movement_vector = [0, 0]\nvar controller_vector = [0, 0]\n\nvar AXIS_THRESHOLD = 0.15\n\nvar body_part_head\nvar body_part_body\nvar body_part_footer\nvar animations\nvar hat = false\n\nvar stun_duration = 0.15\nvar stun_level = 0\n\nvar can_jump = true\nvar is_in_air = false\nvar is_on_wall = false\nvar wall_vector = Vector2(0, 0)\n\nvar tombstone_template #= preload(\"res:\/\/scenes\/particles\/thumbstone.xscn\")\n\nvar FLOOR_FRICTION = 25\nvar MOVEMENT_SPEED_CAP_LAND = 10\nvar MOVEMENT_SPEED_CAP_AIR = 12\nvar GRAVITY = 30\nvar COLLIDING_FALL = 0.1\nvar JUMP_SPEED = 20\nvar AIR_CONTROL = 0.8\n\nfunc _init(bag).(bag):\n self.bag = bag\n\nfunc spawn(position):\n .spawn(position)\n self.bag.processing.register(self)\n\nfunc despawn():\n self.bag.processing.remove(self)\n .despawn()\n\nfunc process(delta):\n self.modify_position(delta)\n\nfunc modify_position(delta):\n var x = self.apply_axis_threshold(self.controller_vector[0])\n var y = self.apply_axis_threshold(self.controller_vector[1])\n\n var current_motion = Vector2(self.movement_vector[0], self.movement_vector[1])\n var motion_delta = Vector2(x, y) * self.velocity * delta\n\n if self.is_in_air:\n motion_delta = motion_delta * self.AIR_CONTROL\n\n motion_delta.y = motion_delta.y + self.GRAVITY * delta\n\n current_motion = current_motion + motion_delta\n\n var speed_cap = self.MOVEMENT_SPEED_CAP_LAND\n if self.is_in_air:\n speed_cap = self.MOVEMENT_SPEED_CAP_AIR\n if abs(current_motion.x) > speed_cap:\n if current_motion.x < 0:\n current_motion.x = -speed_cap\n else:\n current_motion.x = speed_cap\n\n if abs(current_motion.y) > speed_cap:\n if current_motion.y < 0:\n current_motion.y = -speed_cap\n else:\n current_motion.y = speed_cap\n\n if current_motion == Vector2(0, 0) && not self.is_in_air:\n return\n\n if not self.is_in_air && self.is_jumping && self.can_jump:\n current_motion.y = -self.JUMP_SPEED\n\n if self.is_on_wall:\n current_motion.x = self.wall_vector.x * self.JUMP_SPEED\n self.can_jump = false\n self.bag.timers.set_timeout(1, self, 'enable_jump')\n\n current_motion = self.apply_friction(current_motion, delta)\n\n self.avatar.move(current_motion)\n if (self.avatar.is_colliding()):\n var normal = self.avatar.get_collision_normal()\n if (normal.x == 1 || normal.x == -1) && abs(normal.y) < 0.01:\n self.is_on_wall = true\n self.wall_vector = normal\n else:\n self.is_on_wall = false\n\n var n = self.avatar.get_collision_normal()\n current_motion = n.slide(current_motion)\n if not self.is_in_air:\n current_motion.y = self.COLLIDING_FALL\n self.is_in_air = false\n self.avatar.move(current_motion)\n self.handle_collision(self.avatar.get_collider())\n else:\n self.is_in_air = true\n self.is_on_wall = false\n self.flip(self.controller_vector[0])\n self.movement_vector[0] = current_motion.x\n self.movement_vector[1] = current_motion.y\n\nfunc handle_collision(collider):\n return\n\nfunc apply_friction(current_motion, delta):\n if abs(current_motion.x) < self.FLOOR_FRICTION * delta:\n current_motion.x = 0\n else:\n if current_motion.x > 0:\n current_motion.x = current_motion.x - self.FLOOR_FRICTION * delta\n else:\n current_motion.x = current_motion.x + self.FLOOR_FRICTION * delta\n\n return current_motion\n\nfunc apply_axis_threshold(axis_value):\n if abs(axis_value) < self.AXIS_THRESHOLD:\n return 0\n return axis_value\n\nfunc flip(direction):\n if direction == 0:\n return\n\n var flip_sprite = false\n if direction > 0:\n flip_sprite = true\n\n self.body_part_head.set_flip_h(flip_sprite)\n self.body_part_body.set_flip_h(flip_sprite)\n self.body_part_footer.set_flip_h(flip_sprite)\n if self.hat:\n self.hat.set_flip_h(flip_sprite)\n\nfunc reset_movement():\n self.movement_vector = [0, 0]\n #self.avatar.set_opacity(1)\n #self.animations.play('idle')\n\nfunc push_back(enemy):\n var enemy_position = enemy.get_pos()\n var object_position = self.get_pos()\n\n var position_delta_x = object_position.x - enemy_position.x\n var position_delta_y = object_position.y - enemy_position.y\n var force = pow(enemy.attack_strength, -1)\n\n var scale = force \/ self.calculate_distance(enemy_position) * 10\n\n self.avatar.move(Vector2(position_delta_x * scale, position_delta_y * scale))\n self.stun()\n\nfunc stun(duration=null):\n if duration == null:\n duration = self.stun_duration\n self.is_processing = false\n self.stun_level = stun_level + 1\n self.bag.timers.set_timeout(duration, self, \"remove_stun\")\n\nfunc remove_stun():\n self.stun_level = stun_level - 1\n if self.stun_level == 0:\n self.is_processing = true\n\nfunc die():\n self.spawn_tombstone()\n .die()\n\nfunc spawn_tombstone():\n var tombstone = self.tombstone_template.instance()\n self.bag.game_state.current_cell.add_persistent_object(tombstone, self.get_pos())\n\nfunc enable_jump():\n self.can_jump = true","old_contents":"extends \"res:\/\/scripts\/object.gd\"\n\nvar velocity\nvar movement_vector = [0, 0]\nvar controller_vector = [0, 0]\n\nvar AXIS_THRESHOLD = 0.15\n\nvar body_part_head\nvar body_part_body\nvar body_part_footer\nvar animations\nvar hat = false\n\nvar stun_duration = 0.15\nvar stun_level = 0\n\nvar is_in_air = false\nvar is_on_wall = false\nvar wall_vector = Vector2(0, 0)\n\nvar tombstone_template #= preload(\"res:\/\/scenes\/particles\/thumbstone.xscn\")\n\nvar FLOOR_FRICTION = 25\nvar MOVEMENT_SPEED_CAP_LAND = 10\nvar MOVEMENT_SPEED_CAP_AIR = 12\nvar GRAVITY = 30\nvar COLLIDING_FALL = 0.1\nvar JUMP_SPEED = 20\nvar AIR_CONTROL = 0.8\n\nfunc _init(bag).(bag):\n self.bag = bag\n\nfunc spawn(position):\n .spawn(position)\n self.bag.processing.register(self)\n\nfunc despawn():\n self.bag.processing.remove(self)\n .despawn()\n\nfunc process(delta):\n self.modify_position(delta)\n\nfunc modify_position(delta):\n var x = self.apply_axis_threshold(self.controller_vector[0])\n var y = self.apply_axis_threshold(self.controller_vector[1])\n\n var current_motion = Vector2(self.movement_vector[0], self.movement_vector[1])\n var motion_delta = Vector2(x, y) * self.velocity * delta\n\n if self.is_in_air:\n motion_delta = motion_delta * self.AIR_CONTROL\n\n motion_delta.y = motion_delta.y + self.GRAVITY * delta\n\n current_motion = current_motion + motion_delta\n\n var speed_cap = self.MOVEMENT_SPEED_CAP_LAND\n if self.is_in_air:\n speed_cap = self.MOVEMENT_SPEED_CAP_AIR\n if abs(current_motion.x) > speed_cap:\n if current_motion.x < 0:\n current_motion.x = -speed_cap\n else:\n current_motion.x = speed_cap\n\n if abs(current_motion.y) > speed_cap:\n if current_motion.y < 0:\n current_motion.y = -speed_cap\n else:\n current_motion.y = speed_cap\n\n if current_motion == Vector2(0, 0) && not self.is_in_air:\n return\n\n if not self.is_in_air && self.is_jumping:\n current_motion.y = -self.JUMP_SPEED\n\n if self.is_on_wall:\n current_motion.x = self.wall_vector.x * self.JUMP_SPEED\n\n current_motion = self.apply_friction(current_motion, delta)\n\n self.avatar.move(current_motion)\n if (self.avatar.is_colliding()):\n var normal = self.avatar.get_collision_normal()\n if (normal.x == 1 || normal.x == -1) && abs(normal.y) < 0.01:\n self.is_on_wall = true\n self.wall_vector = normal\n else:\n self.is_on_wall = false\n\n var n = self.avatar.get_collision_normal()\n current_motion = n.slide(current_motion)\n if not self.is_in_air:\n current_motion.y = self.COLLIDING_FALL\n self.is_in_air = false\n self.avatar.move(current_motion)\n self.handle_collision(self.avatar.get_collider())\n else:\n self.is_in_air = true\n self.is_on_wall = false\n self.flip(self.controller_vector[0])\n self.movement_vector[0] = current_motion.x\n self.movement_vector[1] = current_motion.y\n\nfunc handle_collision(collider):\n return\n\nfunc apply_friction(current_motion, delta):\n if abs(current_motion.x) < self.FLOOR_FRICTION * delta:\n current_motion.x = 0\n else:\n if current_motion.x > 0:\n current_motion.x = current_motion.x - self.FLOOR_FRICTION * delta\n else:\n current_motion.x = current_motion.x + self.FLOOR_FRICTION * delta\n\n return current_motion\n\nfunc apply_axis_threshold(axis_value):\n if abs(axis_value) < self.AXIS_THRESHOLD:\n return 0\n return axis_value\n\nfunc flip(direction):\n if direction == 0:\n return\n\n var flip_sprite = false\n if direction > 0:\n flip_sprite = true\n\n self.body_part_head.set_flip_h(flip_sprite)\n self.body_part_body.set_flip_h(flip_sprite)\n self.body_part_footer.set_flip_h(flip_sprite)\n if self.hat:\n self.hat.set_flip_h(flip_sprite)\n\nfunc reset_movement():\n self.movement_vector = [0, 0]\n #self.avatar.set_opacity(1)\n #self.animations.play('idle')\n\nfunc push_back(enemy):\n var enemy_position = enemy.get_pos()\n var object_position = self.get_pos()\n\n var position_delta_x = object_position.x - enemy_position.x\n var position_delta_y = object_position.y - enemy_position.y\n var force = pow(enemy.attack_strength, -1)\n\n var scale = force \/ self.calculate_distance(enemy_position) * 10\n\n self.avatar.move(Vector2(position_delta_x * scale, position_delta_y * scale))\n self.stun()\n\nfunc stun(duration=null):\n if duration == null:\n duration = self.stun_duration\n self.is_processing = false\n self.stun_level = stun_level + 1\n self.bag.timers.set_timeout(duration, self, \"remove_stun\")\n\nfunc remove_stun():\n self.stun_level = stun_level - 1\n if self.stun_level == 0:\n self.is_processing = true\n\nfunc die():\n self.spawn_tombstone()\n .die()\n\nfunc spawn_tombstone():\n var tombstone = self.tombstone_template.instance()\n self.bag.game_state.current_cell.add_persistent_object(tombstone, self.get_pos())","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"bded14a5068dc1e400eaa831eada10c4f27642ca","subject":"Automatic brake\/reverse","message":"Automatic brake\/reverse\n\nValue fwd_mps converts global velocity into a velocity vector which is rotated to cars local coordinate system (in this example x-axis).\r\nThen if key \"ui_down\" is pressed and the fwd_mps value is greater or equal to -1 (which seems to be very good spot and represents car still moving forward but nearly standing still) the car reverses (negative engine_force_value). If this condition isn't met (which means the car is moving forward) then the car brakes.\r\n\r\nTested and working on Godot 3.1 Beta 3.\r\n\r\nSuggestions:\r\nIn this case, if you want something more realistic, the -engine_force_value can be much lower because no car reverses in same speed as it goes forward but for the sake of demo project I left it as it is.\r\n\r\nCreated for my own project with help of user wombatstampede from godotdevelopers.org\/forum","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"3d\/truck_town\/vehicle.gd","new_file":"3d\/truck_town\/vehicle.gd","new_contents":"extends VehicleBody\n\n# Member variables\nconst STEER_SPEED = 1\nconst STEER_LIMIT = 0.4\n\nvar steer_angle = 0\nvar steer_target = 0\n\nexport var engine_force_value = 40\n\nfunc _physics_process(delta):\n\tvar fwd_mps = transform.basis.xform_inv(linear_velocity).x\n\t\n\tif Input.is_action_pressed(\"ui_left\"):\n\t\tsteer_target = STEER_LIMIT\n\telif Input.is_action_pressed(\"ui_right\"):\n\t\tsteer_target = -STEER_LIMIT\n\telse:\n\t\tsteer_target = 0\n\t\n\tif Input.is_action_pressed(\"ui_up\"):\n\t\tengine_force = engine_force_value\n\telse:\n\t\tengine_force = 0\n\t\n\tif Input.is_action_pressed(\"ui_down\"):\n\t\tif (fwd_mps >= -1):\n\t\t\tengine_force = -engine_force_value\n\t\telse:\n\t\t\tbrake = 1\n\telse:\n\t\tbrake = 0.0\n\t\n\tif steer_target < steer_angle:\n\t\tsteer_angle -= STEER_SPEED * delta\n\t\tif steer_target > steer_angle:\n\t\t\tsteer_angle = steer_target\n\telif steer_target > steer_angle:\n\t\tsteer_angle += STEER_SPEED * delta\n\t\tif steer_target < steer_angle:\n\t\t\tsteer_angle = steer_target\n\t\n\tsteering = steer_angle\n","old_contents":"extends VehicleBody\n\n# Member variables\nconst STEER_SPEED = 1\nconst STEER_LIMIT = 0.4\n\nvar steer_angle = 0\nvar steer_target = 0\n\nexport var engine_force_value = 40\n\nfunc _physics_process(delta):\n\tif Input.is_action_pressed(\"ui_left\"):\n\t\tsteer_target = STEER_LIMIT\n\telif Input.is_action_pressed(\"ui_right\"):\n\t\tsteer_target = -STEER_LIMIT\n\telse:\n\t\tsteer_target = 0\n\t\n\tif Input.is_action_pressed(\"ui_up\"):\n\t\tengine_force = engine_force_value\n\telse:\n\t\tengine_force = 0\n\t\n\tif Input.is_action_pressed(\"ui_down\"):\n\t\tbrake = 1\n\telse:\n\t\tbrake = 0.0\n\t\n\tif steer_target < steer_angle:\n\t\tsteer_angle -= STEER_SPEED * delta\n\t\tif steer_target > steer_angle:\n\t\t\tsteer_angle = steer_target\n\telif steer_target > steer_angle:\n\t\tsteer_angle += STEER_SPEED * delta\n\t\tif steer_target < steer_angle:\n\t\t\tsteer_angle = steer_target\n\t\n\tsteering = steer_angle\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"a0657abe1310d4e5732991e074888a5a408bec5b","subject":"rozwiazany problem z przekazywaniem gry jako parametr, poczatki gui w oknie gry","message":"rozwiazany problem z przekazywaniem gry jako parametr, poczatki gui w oknie gry\n","repos":"Xpressik\/Podstawy-Gier-Komputerowych,Xpressik\/Podstawy-Gier-Komputerowych","old_file":"Assets\/savedCells.gd","new_file":"Assets\/savedCells.gd","new_contents":"\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\f\u0002\u0000\u0000\u0000\u000fAssembly-CSharp\u0004\u0001\u0000\u0000\u0000xSystem.Collections.Generic.List`1[[HexCellInfo, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]\u0003\u0000\u0000\u0000\u0006_items\u0005_size\b_version\u0004\u0000\u0000\rHexCellInfo[]\u0002\u0000\u0000\u0000\b\b\t\u0003\u0000\u0000\u0000,\u0001\u0000\u0000,\u0001\u0000\u0000\u0007\u0003\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0004\u000bHexCellInfo\u0002\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\t\u0005\u0000\u0000\u0000\t\u0006\u0000\u0000\u0000\t\u0007\u0000\u0000\u0000\t\b\u0000\u0000\u0000\t\t\u0000\u0000\u0000\t\n\u0000\u0000\u0000\t\u000b\u0000\u0000\u0000\t\f\u0000\u0000\u0000\t\r\u0000\u0000\u0000\t\u000e\u0000\u0000\u0000\t\u000f\u0000\u0000\u0000\t\u0010\u0000\u0000\u0000\t\u0011\u0000\u0000\u0000\t\u0012\u0000\u0000\u0000\t\u0013\u0000\u0000\u0000\t\u0014\u0000\u0000\u0000\t\u0015\u0000\u0000\u0000\t\u0016\u0000\u0000\u0000\t\u0017\u0000\u0000\u0000\t\u0018\u0000\u0000\u0000\t\u0019\u0000\u0000\u0000\t\u001a\u0000\u0000\u0000\t\u001b\u0000\u0000\u0000\t\u001c\u0000\u0000\u0000\t\u001d\u0000\u0000\u0000\t\u001e\u0000\u0000\u0000\t\u001f\u0000\u0000\u0000\t \u0000\u0000\u0000\t!\u0000\u0000\u0000\t\"\u0000\u0000\u0000\t#\u0000\u0000\u0000\t$\u0000\u0000\u0000\t%\u0000\u0000\u0000\t&\u0000\u0000\u0000\t'\u0000\u0000\u0000\t(\u0000\u0000\u0000\t)\u0000\u0000\u0000\t*\u0000\u0000\u0000\t+\u0000\u0000\u0000\t,\u0000\u0000\u0000\t-\u0000\u0000\u0000\t.\u0000\u0000\u0000\t\/\u0000\u0000\u0000\t0\u0000\u0000\u0000\t1\u0000\u0000\u0000\t2\u0000\u0000\u0000\t3\u0000\u0000\u0000\t4\u0000\u0000\u0000\t5\u0000\u0000\u0000\t6\u0000\u0000\u0000\t7\u0000\u0000\u0000\t8\u0000\u0000\u0000\t9\u0000\u0000\u0000\t:\u0000\u0000\u0000\t;\u0000\u0000\u0000\t<\u0000\u0000\u0000\t=\u0000\u0000\u0000\t>\u0000\u0000\u0000\t?\u0000\u0000\u0000\t@\u0000\u0000\u0000\tA\u0000\u0000\u0000\tB\u0000\u0000\u0000\tC\u0000\u0000\u0000\tD\u0000\u0000\u0000\tE\u0000\u0000\u0000\tF\u0000\u0000\u0000\tG\u0000\u0000\u0000\tH\u0000\u0000\u0000\tI\u0000\u0000\u0000\tJ\u0000\u0000\u0000\tK\u0000\u0000\u0000\tL\u0000\u0000\u0000\tM\u0000\u0000\u0000\tN\u0000\u0000\u0000\tO\u0000\u0000\u0000\tP\u0000\u0000\u0000\tQ\u0000\u0000\u0000\tR\u0000\u0000\u0000\tS\u0000\u0000\u0000\tT\u0000\u0000\u0000\tU\u0000\u0000\u0000\tV\u0000\u0000\u0000\tW\u0000\u0000\u0000\tX\u0000\u0000\u0000\tY\u0000\u0000\u0000\tZ\u0000\u0000\u0000\t[\u0000\u0000\u0000\t\\\u0000\u0000\u0000\t]\u0000\u0000\u0000\t^\u0000\u0000\u0000\t_\u0000\u0000\u0000\t`\u0000\u0000\u0000\ta\u0000\u0000\u0000\tb\u0000\u0000\u0000\tc\u0000\u0000\u0000\td\u0000\u0000\u0000\te\u0000\u0000\u0000\tf\u0000\u0000\u0000\tg\u0000\u0000\u0000\th\u0000\u0000\u0000\ti\u0000\u0000\u0000\tj\u0000\u0000\u0000\tk\u0000\u0000\u0000\tl\u0000\u0000\u0000\tm\u0000\u0000\u0000\tn\u0000\u0000\u0000\to\u0000\u0000\u0000\tp\u0000\u0000\u0000\tq\u0000\u0000\u0000\tr\u0000\u0000\u0000\ts\u0000\u0000\u0000\tt\u0000\u0000\u0000\tu\u0000\u0000\u0000\tv\u0000\u0000\u0000\tw\u0000\u0000\u0000\tx\u0000\u0000\u0000\ty\u0000\u0000\u0000\tz\u0000\u0000\u0000\t{\u0000\u0000\u0000\t|\u0000\u0000\u0000\t}\u0000\u0000\u0000\t~\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0001\u0000\u0000\t\u0001\u0001\u0000\u0000\t\u0002\u0001\u0000\u0000\t\u0003\u0001\u0000\u0000\t\u0004\u0001\u0000\u0000\t\u0005\u0001\u0000\u0000\t\u0006\u0001\u0000\u0000\t\u0007\u0001\u0000\u0000\t\b\u0001\u0000\u0000\t\t\u0001\u0000\u0000\t\n\u0001\u0000\u0000\t\u000b\u0001\u0000\u0000\t\f\u0001\u0000\u0000\t\r\u0001\u0000\u0000\t\u000e\u0001\u0000\u0000\t\u000f\u0001\u0000\u0000\t\u0010\u0001\u0000\u0000\t\u0011\u0001\u0000\u0000\t\u0012\u0001\u0000\u0000\t\u0013\u0001\u0000\u0000\t\u0014\u0001\u0000\u0000\t\u0015\u0001\u0000\u0000\t\u0016\u0001\u0000\u0000\t\u0017\u0001\u0000\u0000\t\u0018\u0001\u0000\u0000\t\u0019\u0001\u0000\u0000\t\u001a\u0001\u0000\u0000\t\u001b\u0001\u0000\u0000\t\u001c\u0001\u0000\u0000\t\u001d\u0001\u0000\u0000\t\u001e\u0001\u0000\u0000\t\u001f\u0001\u0000\u0000\t \u0001\u0000\u0000\t!\u0001\u0000\u0000\t\"\u0001\u0000\u0000\t#\u0001\u0000\u0000\t$\u0001\u0000\u0000\t%\u0001\u0000\u0000\t&\u0001\u0000\u0000\t'\u0001\u0000\u0000\t(\u0001\u0000\u0000\t)\u0001\u0000\u0000\t*\u0001\u0000\u0000\t+\u0001\u0000\u0000\t,\u0001\u0000\u0000\t-\u0001\u0000\u0000\t.\u0001\u0000\u0000\t\/\u0001\u0000\u0000\r\u0005\u0004\u0000\u0000\u0000\u000bHexCellInfo\u0006\u0000\u0000\u0000\televation\b_myColor\u0010hasIncomingRiver\u0010hasOutgoingRiver\rincomingRiver\routgoingRiver\u0000\u0007\u0000\u0000\u0004\u0004\b\u000b\u0001\u0001\fHexDirection\u0002\u0000\u0000\u0000\fHexDirection\u0002\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t0\u0001\u0000\u0000\u0000\u0000\u00051\u0001\u0000\u0000\fHexDirection\u0001\u0000\u0000\u0000\u0007value__\u0000\b\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00012\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0005\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t3\u0001\u0000\u0000\u0000\u0000\u00014\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00015\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0006\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t6\u0001\u0000\u0000\u0000\u0000\u00017\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00018\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0007\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t9\u0001\u0000\u0000\u0000\u0000\u0001:\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001;\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\b\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t<\u0001\u0000\u0000\u0000\u0000\u0001=\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001>\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\t\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t?\u0001\u0000\u0000\u0000\u0000\u0001@\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001A\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\n\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tB\u0001\u0000\u0000\u0000\u0000\u0001C\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001D\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000b\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tE\u0001\u0000\u0000\u0000\u0000\u0001F\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001G\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\f\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tH\u0001\u0000\u0000\u0000\u0000\u0001I\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001J\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\r\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tK\u0001\u0000\u0000\u0000\u0000\u0001L\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001M\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000e\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tN\u0001\u0000\u0000\u0000\u0000\u0001O\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001P\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000f\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tQ\u0001\u0000\u0000\u0000\u0000\u0001R\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001S\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0010\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tT\u0001\u0000\u0000\u0000\u0000\u0001U\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001V\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0011\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tW\u0001\u0000\u0000\u0000\u0000\u0001X\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001Y\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0012\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tZ\u0001\u0000\u0000\u0000\u0000\u0001[\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\\\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0013\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t]\u0001\u0000\u0000\u0000\u0000\u0001^\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001_\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0014\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t`\u0001\u0000\u0000\u0000\u0000\u0001a\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001b\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0015\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tc\u0001\u0000\u0000\u0000\u0000\u0001d\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001e\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0016\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tf\u0001\u0000\u0000\u0000\u0000\u0001g\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001h\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0017\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\ti\u0001\u0000\u0000\u0000\u0000\u0001j\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001k\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0018\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tl\u0001\u0000\u0000\u0000\u0000\u0001m\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001n\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0019\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\to\u0001\u0000\u0000\u0000\u0000\u0001p\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001q\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001a\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tr\u0001\u0000\u0000\u0000\u0000\u0001s\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001t\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001b\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tu\u0001\u0000\u0000\u0000\u0000\u0001v\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001w\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001c\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tx\u0001\u0000\u0000\u0000\u0000\u0001y\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001z\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001d\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t{\u0001\u0000\u0000\u0000\u0000\u0001|\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001}\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001e\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t~\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001f\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001 \u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001!\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\"\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001#\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001$\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001%\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001&\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001'\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001(\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001)\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001*\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001+\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001,\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001-\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001.\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\/\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00010\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00011\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00012\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00013\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00014\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00015\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00016\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00017\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00018\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00019\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001:\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001;\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001<\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001=\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001>\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001?\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001@\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001A\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001B\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001C\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001D\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001E\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001F\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001G\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001H\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001I\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0000\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001J\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0002\u0000\u0000\u0000\u0000\u0001\u0003\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001K\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0005\u0002\u0000\u0000\u0000\u0000\u0001\u0006\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0007\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001L\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\b\u0002\u0000\u0000\u0000\u0000\u0001\t\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\n\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001M\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u000b\u0002\u0000\u0000\u0000\u0000\u0001\f\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\r\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001N\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u000e\u0002\u0000\u0000\u0000\u0000\u0001\u000f\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0010\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001O\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0011\u0002\u0000\u0000\u0000\u0000\u0001\u0012\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0013\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001P\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0014\u0002\u0000\u0000\u0000\u0000\u0001\u0015\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0016\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001Q\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0017\u0002\u0000\u0000\u0000\u0000\u0001\u0018\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0019\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001R\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u001a\u0002\u0000\u0000\u0000\u0000\u0001\u001b\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001c\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001S\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u001d\u0002\u0000\u0000\u0000\u0000\u0001\u001e\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001f\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001T\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0002\u0000\u0000\u0000\u0000\u0001!\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\"\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001U\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t#\u0002\u0000\u0000\u0000\u0000\u0001$\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001%\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001V\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t&\u0002\u0000\u0000\u0000\u0000\u0001'\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001(\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001W\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t)\u0002\u0000\u0000\u0000\u0000\u0001*\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001+\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001X\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t,\u0002\u0000\u0000\u0000\u0000\u0001-\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001.\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001Y\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\/\u0002\u0000\u0000\u0000\u0000\u00010\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00011\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001Z\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t2\u0002\u0000\u0000\u0000\u0000\u00013\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00014\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001[\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t5\u0002\u0000\u0000\u0000\u0000\u00016\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00017\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\\\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t8\u0002\u0000\u0000\u0000\u0000\u00019\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001:\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001]\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t;\u0002\u0000\u0000\u0000\u0000\u0001<\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001=\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001^\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t>\u0002\u0000\u0000\u0000\u0000\u0001?\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001@\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001_\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tA\u0002\u0000\u0000\u0000\u0000\u0001B\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001C\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001`\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tD\u0002\u0000\u0000\u0000\u0000\u0001E\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001F\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001a\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tG\u0002\u0000\u0000\u0000\u0000\u0001H\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001I\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001b\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tJ\u0002\u0000\u0000\u0000\u0000\u0001K\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001L\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001c\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tM\u0002\u0000\u0000\u0000\u0000\u0001N\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001O\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001d\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tP\u0002\u0000\u0000\u0000\u0000\u0001Q\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001R\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001e\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tS\u0002\u0000\u0000\u0000\u0000\u0001T\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001U\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001f\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tV\u0002\u0000\u0000\u0000\u0000\u0001W\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001X\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001g\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tY\u0002\u0000\u0000\u0000\u0000\u0001Z\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001[\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001h\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\\\u0002\u0000\u0000\u0000\u0000\u0001]\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001^\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001i\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t_\u0002\u0000\u0000\u0000\u0000\u0001`\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001a\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001j\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tb\u0002\u0000\u0000\u0000\u0000\u0001c\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001d\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001k\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\te\u0002\u0000\u0000\u0000\u0000\u0001f\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001g\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001l\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\th\u0002\u0000\u0000\u0000\u0000\u0001i\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001j\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001m\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tk\u0002\u0000\u0000\u0000\u0000\u0001l\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001m\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001n\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tn\u0002\u0000\u0000\u0000\u0000\u0001o\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001p\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001o\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tq\u0002\u0000\u0000\u0000\u0000\u0001r\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001s\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001p\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tt\u0002\u0000\u0000\u0000\u0000\u0001u\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001v\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001q\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tw\u0002\u0000\u0000\u0000\u0000\u0001x\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001y\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001r\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tz\u0002\u0000\u0000\u0000\u0000\u0001{\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001|\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001s\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t}\u0002\u0000\u0000\u0000\u0000\u0001~\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001t\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001u\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001v\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001w\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001x\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001y\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001z\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001{\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001|\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001}\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001~\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0003\u0000\u0000\u0000\u0000\u0001\u0002\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0003\u0000\u0000\u0000\u0000\u0001\u0005\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0006\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0007\u0003\u0000\u0000\u0000\u0000\u0001\b\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\t\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\n\u0003\u0000\u0000\u0000\u0000\u0001\u000b\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\f\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\r\u0003\u0000\u0000\u0000\u0000\u0001\u000e\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000f\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0010\u0003\u0000\u0000\u0000\u0000\u0001\u0011\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0012\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0013\u0003\u0000\u0000\u0000\u0000\u0001\u0014\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0015\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0016\u0003\u0000\u0000\u0000\u0000\u0001\u0017\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0018\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0019\u0003\u0000\u0000\u0000\u0000\u0001\u001a\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001b\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u001c\u0003\u0000\u0000\u0000\u0000\u0001\u001d\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001e\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u001f\u0003\u0000\u0000\u0000\u0000\u0001 \u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001!\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\"\u0003\u0000\u0000\u0000\u0000\u0001#\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001$\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t%\u0003\u0000\u0000\u0000\u0000\u0001&\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001'\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t(\u0003\u0000\u0000\u0000\u0000\u0001)\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001*\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t+\u0003\u0000\u0000\u0000\u0000\u0001,\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001-\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t.\u0003\u0000\u0000\u0000\u0000\u0001\/\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00010\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t1\u0003\u0000\u0000\u0000\u0000\u00012\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00013\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t4\u0003\u0000\u0000\u0000\u0000\u00015\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00016\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t7\u0003\u0000\u0000\u0000\u0000\u00018\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00019\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t:\u0003\u0000\u0000\u0000\u0000\u0001;\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001<\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t=\u0003\u0000\u0000\u0000\u0000\u0001>\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001?\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t@\u0003\u0000\u0000\u0000\u0000\u0001A\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001B\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tC\u0003\u0000\u0000\u0000\u0000\u0001D\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001E\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tF\u0003\u0000\u0000\u0000\u0000\u0001G\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001H\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tI\u0003\u0000\u0000\u0000\u0000\u0001J\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001K\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tL\u0003\u0000\u0000\u0000\u0000\u0001M\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001N\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tO\u0003\u0000\u0000\u0000\u0000\u0001P\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001Q\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tR\u0003\u0000\u0000\u0000\u0000\u0001S\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001T\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tU\u0003\u0000\u0000\u0000\u0000\u0001V\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001W\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tX\u0003\u0000\u0000\u0000\u0000\u0001Y\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001Z\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t[\u0003\u0000\u0000\u0000\u0000\u0001\\\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001]\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t^\u0003\u0000\u0000\u0000\u0000\u0001_\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001`\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\ta\u0003\u0000\u0000\u0000\u0000\u0001b\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001c\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\td\u0003\u0000\u0000\u0000\u0000\u0001e\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001f\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tg\u0003\u0000\u0000\u0000\u0000\u0001h\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001i\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tj\u0003\u0000\u0000\u0000\u0000\u0001k\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001l\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tm\u0003\u0000\u0000\u0000\u0000\u0001n\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001o\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tp\u0003\u0000\u0000\u0000\u0000\u0001q\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001r\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\ts\u0003\u0000\u0000\u0000\u0000\u0001t\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001u\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tv\u0003\u0000\u0000\u0000\u0000\u0001w\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001x\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\ty\u0003\u0000\u0000\u0000\u0000\u0001z\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001{\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t|\u0003\u0000\u0000\u0000\u0000\u0001}\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001~\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0000\u0004\u0000\u0000\u0000\u0000\u0001\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0005\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0006\u0004\u0000\u0000\u0000\u0000\u0001\u0007\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\b\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\t\u0004\u0000\u0000\u0000\u0000\u0001\n\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000b\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\f\u0004\u0000\u0000\u0000\u0000\u0001\r\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000e\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u000f\u0004\u0000\u0000\u0000\u0000\u0001\u0010\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0011\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0012\u0004\u0000\u0000\u0000\u0000\u0001\u0013\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0014\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0015\u0004\u0000\u0000\u0000\u0000\u0001\u0016\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0017\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0018\u0004\u0000\u0000\u0000\u0000\u0001\u0019\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001a\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u001b\u0004\u0000\u0000\u0000\u0000\u0001\u001c\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001d\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u001e\u0004\u0000\u0000\u0000\u0000\u0001\u001f\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001 \u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t!\u0004\u0000\u0000\u0000\u0000\u0001\"\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001#\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t$\u0004\u0000\u0000\u0000\u0000\u0001%\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001&\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t'\u0004\u0000\u0000\u0000\u0000\u0001(\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001)\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t*\u0004\u0000\u0000\u0000\u0000\u0001+\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001,\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t-\u0004\u0000\u0000\u0000\u0000\u0001.\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\/\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t0\u0004\u0000\u0000\u0000\u0000\u00011\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00012\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0005\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t3\u0004\u0000\u0000\u0000\u0000\u00014\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00015\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0006\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t6\u0004\u0000\u0000\u0000\u0000\u00017\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00018\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0007\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t9\u0004\u0000\u0000\u0000\u0000\u0001:\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001;\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\b\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t<\u0004\u0000\u0000\u0000\u0000\u0001=\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001>\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\t\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t?\u0004\u0000\u0000\u0000\u0000\u0001@\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001A\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\n\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tB\u0004\u0000\u0000\u0000\u0000\u0001C\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001D\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000b\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tE\u0004\u0000\u0000\u0000\u0000\u0001F\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001G\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tH\u0004\u0000\u0000\u0000\u0000\u0001I\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001J\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\r\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tK\u0004\u0000\u0000\u0000\u0000\u0001L\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001M\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000e\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tN\u0004\u0000\u0000\u0000\u0000\u0001O\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001P\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tQ\u0004\u0000\u0000\u0000\u0000\u0001R\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001S\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0010\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tT\u0004\u0000\u0000\u0000\u0000\u0001U\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001V\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0011\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tW\u0004\u0000\u0000\u0000\u0000\u0001X\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001Y\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0012\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tZ\u0004\u0000\u0000\u0000\u0000\u0001[\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\\\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0013\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t]\u0004\u0000\u0000\u0000\u0000\u0001^\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001_\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0014\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t`\u0004\u0000\u0000\u0000\u0000\u0001a\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001b\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0015\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tc\u0004\u0000\u0000\u0000\u0000\u0001d\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001e\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0016\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tf\u0004\u0000\u0000\u0000\u0000\u0001g\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001h\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0017\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\ti\u0004\u0000\u0000\u0000\u0000\u0001j\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001k\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0018\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tl\u0004\u0000\u0000\u0000\u0000\u0001m\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001n\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0019\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\to\u0004\u0000\u0000\u0000\u0000\u0001p\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001q\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001a\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tr\u0004\u0000\u0000\u0000\u0000\u0001s\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001t\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001b\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tu\u0004\u0000\u0000\u0000\u0000\u0001v\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001w\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001c\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tx\u0004\u0000\u0000\u0000\u0000\u0001y\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001z\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001d\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t{\u0004\u0000\u0000\u0000\u0000\u0001|\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001}\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001e\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t~\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001 \u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001!\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\"\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001#\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001$\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001%\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001&\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001'\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001(\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001)\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001*\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001+\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001,\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001-\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001.\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\/\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u000f0\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f3\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f6\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f9\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f<\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f?\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fB\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fE\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fH\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fK\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fN\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fQ\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fT\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fW\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fZ\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f]\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f`\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fc\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000ff\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fi\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fl\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fo\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fr\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fu\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fx\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f{\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f~\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0005\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\b\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u000b\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u000e\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0011\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0014\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0017\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u001a\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u001d\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f \u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f#\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f&\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f)\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f,\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\/\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f2\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f5\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f8\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f;\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f>\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fA\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fD\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fG\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fJ\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fM\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fP\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fS\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fV\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fY\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\\\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f_\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fb\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fe\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fh\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fk\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fn\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fq\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000ft\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fw\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fz\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f}\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0004\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0007\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\n\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\r\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0010\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0013\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0016\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0019\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u001c\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u001f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\"\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f%\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f(\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f+\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f.\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f1\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f4\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f7\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f:\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f=\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f@\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fC\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fF\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fI\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fL\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fO\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fR\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fU\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fX\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f[\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f^\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fa\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fd\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fg\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fj\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fm\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fp\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fs\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fv\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fy\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f|\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0000\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0006\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\t\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0012\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0015\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0018\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u001b\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u001e\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f!\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f$\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f'\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f*\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f-\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f0\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f3\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f6\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f9\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f<\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f?\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fB\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fE\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fH\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fK\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fN\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fQ\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fT\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fW\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fZ\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f]\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f`\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fc\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000ff\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fi\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fl\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fo\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fr\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fu\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fx\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f{\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f~\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000b","old_contents":"\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\f\u0002\u0000\u0000\u0000\u000fAssembly-CSharp\u0004\u0001\u0000\u0000\u0000xSystem.Collections.Generic.List`1[[HexCellInfo, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]\u0003\u0000\u0000\u0000\u0006_items\u0005_size\b_version\u0004\u0000\u0000\rHexCellInfo[]\u0002\u0000\u0000\u0000\b\b\t\u0003\u0000\u0000\u0000,\u0001\u0000\u0000,\u0001\u0000\u0000\u0007\u0003\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0004\u000bHexCellInfo\u0002\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\t\u0005\u0000\u0000\u0000\t\u0006\u0000\u0000\u0000\t\u0007\u0000\u0000\u0000\t\b\u0000\u0000\u0000\t\t\u0000\u0000\u0000\t\n\u0000\u0000\u0000\t\u000b\u0000\u0000\u0000\t\f\u0000\u0000\u0000\t\r\u0000\u0000\u0000\t\u000e\u0000\u0000\u0000\t\u000f\u0000\u0000\u0000\t\u0010\u0000\u0000\u0000\t\u0011\u0000\u0000\u0000\t\u0012\u0000\u0000\u0000\t\u0013\u0000\u0000\u0000\t\u0014\u0000\u0000\u0000\t\u0015\u0000\u0000\u0000\t\u0016\u0000\u0000\u0000\t\u0017\u0000\u0000\u0000\t\u0018\u0000\u0000\u0000\t\u0019\u0000\u0000\u0000\t\u001a\u0000\u0000\u0000\t\u001b\u0000\u0000\u0000\t\u001c\u0000\u0000\u0000\t\u001d\u0000\u0000\u0000\t\u001e\u0000\u0000\u0000\t\u001f\u0000\u0000\u0000\t \u0000\u0000\u0000\t!\u0000\u0000\u0000\t\"\u0000\u0000\u0000\t#\u0000\u0000\u0000\t$\u0000\u0000\u0000\t%\u0000\u0000\u0000\t&\u0000\u0000\u0000\t'\u0000\u0000\u0000\t(\u0000\u0000\u0000\t)\u0000\u0000\u0000\t*\u0000\u0000\u0000\t+\u0000\u0000\u0000\t,\u0000\u0000\u0000\t-\u0000\u0000\u0000\t.\u0000\u0000\u0000\t\/\u0000\u0000\u0000\t0\u0000\u0000\u0000\t1\u0000\u0000\u0000\t2\u0000\u0000\u0000\t3\u0000\u0000\u0000\t4\u0000\u0000\u0000\t5\u0000\u0000\u0000\t6\u0000\u0000\u0000\t7\u0000\u0000\u0000\t8\u0000\u0000\u0000\t9\u0000\u0000\u0000\t:\u0000\u0000\u0000\t;\u0000\u0000\u0000\t<\u0000\u0000\u0000\t=\u0000\u0000\u0000\t>\u0000\u0000\u0000\t?\u0000\u0000\u0000\t@\u0000\u0000\u0000\tA\u0000\u0000\u0000\tB\u0000\u0000\u0000\tC\u0000\u0000\u0000\tD\u0000\u0000\u0000\tE\u0000\u0000\u0000\tF\u0000\u0000\u0000\tG\u0000\u0000\u0000\tH\u0000\u0000\u0000\tI\u0000\u0000\u0000\tJ\u0000\u0000\u0000\tK\u0000\u0000\u0000\tL\u0000\u0000\u0000\tM\u0000\u0000\u0000\tN\u0000\u0000\u0000\tO\u0000\u0000\u0000\tP\u0000\u0000\u0000\tQ\u0000\u0000\u0000\tR\u0000\u0000\u0000\tS\u0000\u0000\u0000\tT\u0000\u0000\u0000\tU\u0000\u0000\u0000\tV\u0000\u0000\u0000\tW\u0000\u0000\u0000\tX\u0000\u0000\u0000\tY\u0000\u0000\u0000\tZ\u0000\u0000\u0000\t[\u0000\u0000\u0000\t\\\u0000\u0000\u0000\t]\u0000\u0000\u0000\t^\u0000\u0000\u0000\t_\u0000\u0000\u0000\t`\u0000\u0000\u0000\ta\u0000\u0000\u0000\tb\u0000\u0000\u0000\tc\u0000\u0000\u0000\td\u0000\u0000\u0000\te\u0000\u0000\u0000\tf\u0000\u0000\u0000\tg\u0000\u0000\u0000\th\u0000\u0000\u0000\ti\u0000\u0000\u0000\tj\u0000\u0000\u0000\tk\u0000\u0000\u0000\tl\u0000\u0000\u0000\tm\u0000\u0000\u0000\tn\u0000\u0000\u0000\to\u0000\u0000\u0000\tp\u0000\u0000\u0000\tq\u0000\u0000\u0000\tr\u0000\u0000\u0000\ts\u0000\u0000\u0000\tt\u0000\u0000\u0000\tu\u0000\u0000\u0000\tv\u0000\u0000\u0000\tw\u0000\u0000\u0000\tx\u0000\u0000\u0000\ty\u0000\u0000\u0000\tz\u0000\u0000\u0000\t{\u0000\u0000\u0000\t|\u0000\u0000\u0000\t}\u0000\u0000\u0000\t~\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0000\u0000\t\u0000\u0001\u0000\u0000\t\u0001\u0001\u0000\u0000\t\u0002\u0001\u0000\u0000\t\u0003\u0001\u0000\u0000\t\u0004\u0001\u0000\u0000\t\u0005\u0001\u0000\u0000\t\u0006\u0001\u0000\u0000\t\u0007\u0001\u0000\u0000\t\b\u0001\u0000\u0000\t\t\u0001\u0000\u0000\t\n\u0001\u0000\u0000\t\u000b\u0001\u0000\u0000\t\f\u0001\u0000\u0000\t\r\u0001\u0000\u0000\t\u000e\u0001\u0000\u0000\t\u000f\u0001\u0000\u0000\t\u0010\u0001\u0000\u0000\t\u0011\u0001\u0000\u0000\t\u0012\u0001\u0000\u0000\t\u0013\u0001\u0000\u0000\t\u0014\u0001\u0000\u0000\t\u0015\u0001\u0000\u0000\t\u0016\u0001\u0000\u0000\t\u0017\u0001\u0000\u0000\t\u0018\u0001\u0000\u0000\t\u0019\u0001\u0000\u0000\t\u001a\u0001\u0000\u0000\t\u001b\u0001\u0000\u0000\t\u001c\u0001\u0000\u0000\t\u001d\u0001\u0000\u0000\t\u001e\u0001\u0000\u0000\t\u001f\u0001\u0000\u0000\t \u0001\u0000\u0000\t!\u0001\u0000\u0000\t\"\u0001\u0000\u0000\t#\u0001\u0000\u0000\t$\u0001\u0000\u0000\t%\u0001\u0000\u0000\t&\u0001\u0000\u0000\t'\u0001\u0000\u0000\t(\u0001\u0000\u0000\t)\u0001\u0000\u0000\t*\u0001\u0000\u0000\t+\u0001\u0000\u0000\t,\u0001\u0000\u0000\t-\u0001\u0000\u0000\t.\u0001\u0000\u0000\t\/\u0001\u0000\u0000\r\u0005\u0004\u0000\u0000\u0000\u000bHexCellInfo\u0006\u0000\u0000\u0000\televation\b_myColor\u0010hasIncomingRiver\u0010hasOutgoingRiver\rincomingRiver\routgoingRiver\u0000\u0007\u0000\u0000\u0004\u0004\b\u000b\u0001\u0001\fHexDirection\u0002\u0000\u0000\u0000\fHexDirection\u0002\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t0\u0001\u0000\u0000\u0000\u0000\u00051\u0001\u0000\u0000\fHexDirection\u0001\u0000\u0000\u0000\u0007value__\u0000\b\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00012\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0005\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t3\u0001\u0000\u0000\u0000\u0000\u00014\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00015\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0006\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t6\u0001\u0000\u0000\u0000\u0000\u00017\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00018\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0007\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t9\u0001\u0000\u0000\u0000\u0000\u0001:\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001;\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\b\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t<\u0001\u0000\u0000\u0000\u0000\u0001=\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001>\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\t\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t?\u0001\u0000\u0000\u0000\u0000\u0001@\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001A\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\n\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tB\u0001\u0000\u0000\u0000\u0000\u0001C\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001D\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000b\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tE\u0001\u0000\u0000\u0000\u0000\u0001F\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001G\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\f\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tH\u0001\u0000\u0000\u0000\u0000\u0001I\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001J\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\r\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tK\u0001\u0000\u0000\u0000\u0000\u0001L\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001M\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000e\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tN\u0001\u0000\u0000\u0000\u0000\u0001O\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001P\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000f\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tQ\u0001\u0000\u0000\u0000\u0000\u0001R\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001S\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0010\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tT\u0001\u0000\u0000\u0000\u0000\u0001U\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001V\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0011\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tW\u0001\u0000\u0000\u0000\u0000\u0001X\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001Y\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0012\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tZ\u0001\u0000\u0000\u0000\u0000\u0001[\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\\\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0013\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t]\u0001\u0000\u0000\u0000\u0000\u0001^\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001_\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0014\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t`\u0001\u0000\u0000\u0000\u0000\u0001a\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001b\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0015\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tc\u0001\u0000\u0000\u0000\u0000\u0001d\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001e\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0016\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tf\u0001\u0000\u0000\u0000\u0000\u0001g\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001h\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0017\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\ti\u0001\u0000\u0000\u0000\u0000\u0001j\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001k\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0018\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tl\u0001\u0000\u0000\u0000\u0000\u0001m\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001n\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0019\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\to\u0001\u0000\u0000\u0000\u0000\u0001p\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001q\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001a\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tr\u0001\u0000\u0000\u0000\u0000\u0001s\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001t\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001b\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\tu\u0001\u0000\u0000\u0001\u0001\u0001v\u0001\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001w\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001c\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\tx\u0001\u0000\u0000\u0001\u0001\u0001y\u0001\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001z\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u001d\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\t{\u0001\u0000\u0000\u0001\u0001\u0001|\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001}\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u001e\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000\t~\u0001\u0000\u0000\u0001\u0001\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u001f\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0001\u0001\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001 \u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0001\u0001\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001!\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\"\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001#\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001$\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001%\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001&\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001'\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001(\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001)\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001*\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001+\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001,\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001-\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001.\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\/\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0001\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u00010\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\t\u0001\u0000\u0000\u0001\u0001\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u00011\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00012\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00013\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00014\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00015\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0001\u0001\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00016\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00017\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00018\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00019\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001:\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001;\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001<\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001=\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001>\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001?\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001@\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001A\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001B\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001C\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001D\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001E\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001F\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001G\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0001\u0001\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001H\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0001\u0001\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0001\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001I\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0002\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001J\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0002\u0000\u0000\u0000\u0000\u0001\u0003\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001K\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0005\u0002\u0000\u0000\u0000\u0000\u0001\u0006\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0007\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001L\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\b\u0002\u0000\u0000\u0000\u0000\u0001\t\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\n\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001M\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u000b\u0002\u0000\u0000\u0000\u0000\u0001\f\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\r\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001N\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u000e\u0002\u0000\u0000\u0000\u0000\u0001\u000f\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0010\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001O\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0011\u0002\u0000\u0000\u0000\u0000\u0001\u0012\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0013\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001P\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0014\u0002\u0000\u0000\u0000\u0000\u0001\u0015\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0016\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001Q\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0017\u0002\u0000\u0000\u0000\u0000\u0001\u0018\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0019\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001R\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u001a\u0002\u0000\u0000\u0000\u0000\u0001\u001b\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001c\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001S\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u001d\u0002\u0000\u0000\u0000\u0000\u0001\u001e\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001f\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001T\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0002\u0000\u0000\u0000\u0000\u0001!\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\"\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001U\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t#\u0002\u0000\u0000\u0000\u0000\u0001$\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001%\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001V\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t&\u0002\u0000\u0000\u0000\u0000\u0001'\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001(\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001W\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t)\u0002\u0000\u0000\u0000\u0000\u0001*\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001+\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001X\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t,\u0002\u0000\u0000\u0000\u0000\u0001-\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001.\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001Y\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\/\u0002\u0000\u0000\u0000\u0000\u00010\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00011\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001Z\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t2\u0002\u0000\u0000\u0000\u0000\u00013\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00014\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001[\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t5\u0002\u0000\u0000\u0000\u0000\u00016\u0002\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u00017\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\\\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t8\u0002\u0000\u0000\u0001\u0000\u00019\u0002\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0001:\u0002\u0000\u00001\u0001\u0000\u0000\u0003\u0000\u0000\u0000\u0001]\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t;\u0002\u0000\u0000\u0000\u0000\u0001<\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001=\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001^\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t>\u0002\u0000\u0000\u0000\u0000\u0001?\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001@\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001_\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tA\u0002\u0000\u0000\u0000\u0000\u0001B\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001C\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001`\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tD\u0002\u0000\u0000\u0000\u0000\u0001E\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001F\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001a\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tG\u0002\u0000\u0000\u0000\u0000\u0001H\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001I\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001b\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tJ\u0002\u0000\u0000\u0000\u0000\u0001K\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001L\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001c\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tM\u0002\u0000\u0000\u0000\u0000\u0001N\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001O\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001d\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tP\u0002\u0000\u0000\u0000\u0000\u0001Q\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001R\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001e\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tS\u0002\u0000\u0000\u0000\u0000\u0001T\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001U\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001f\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tV\u0002\u0000\u0000\u0000\u0000\u0001W\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001X\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001g\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tY\u0002\u0000\u0000\u0000\u0000\u0001Z\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001[\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001h\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\\\u0002\u0000\u0000\u0000\u0000\u0001]\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001^\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001i\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t_\u0002\u0000\u0000\u0000\u0000\u0001`\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001a\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001j\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tb\u0002\u0000\u0000\u0000\u0000\u0001c\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001d\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001k\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\te\u0002\u0000\u0000\u0000\u0000\u0001f\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001g\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001l\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\th\u0002\u0000\u0000\u0000\u0000\u0001i\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001j\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001m\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tk\u0002\u0000\u0000\u0000\u0000\u0001l\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001m\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001n\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tn\u0002\u0000\u0000\u0000\u0000\u0001o\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001p\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001o\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tq\u0002\u0000\u0000\u0000\u0000\u0001r\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001s\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001p\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tt\u0002\u0000\u0000\u0000\u0000\u0001u\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001v\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001q\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tw\u0002\u0000\u0000\u0000\u0000\u0001x\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001y\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001r\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tz\u0002\u0000\u0000\u0001\u0000\u0001{\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001|\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001s\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t}\u0002\u0000\u0000\u0001\u0000\u0001~\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001t\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0001\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001u\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001v\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001w\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001x\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001y\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001z\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001{\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001|\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001}\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001~\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0001\u0001\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0001\u0001\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0001\u0001\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0001\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0001\u0001\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0001\u0001\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0001\u0001\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0001\u0001\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0001\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0001\u0003\u0000\u0000\u0000\u0000\u0001\u0002\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0003\u0000\u0000\u0000\u0000\u0001\u0005\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0006\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0007\u0003\u0000\u0000\u0000\u0000\u0001\b\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\t\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\n\u0003\u0000\u0000\u0000\u0000\u0001\u000b\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\f\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\r\u0003\u0000\u0000\u0000\u0000\u0001\u000e\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000f\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0010\u0003\u0000\u0000\u0000\u0000\u0001\u0011\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0012\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0013\u0003\u0000\u0000\u0000\u0000\u0001\u0014\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0015\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0016\u0003\u0000\u0000\u0000\u0000\u0001\u0017\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0018\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0019\u0003\u0000\u0000\u0000\u0000\u0001\u001a\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001b\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u001c\u0003\u0000\u0000\u0000\u0000\u0001\u001d\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001e\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u001f\u0003\u0000\u0000\u0000\u0000\u0001 \u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001!\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\"\u0003\u0000\u0000\u0000\u0000\u0001#\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001$\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t%\u0003\u0000\u0000\u0000\u0000\u0001&\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001'\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t(\u0003\u0000\u0000\u0000\u0001\u0001)\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001*\u0003\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t+\u0003\u0000\u0000\u0001\u0001\u0001,\u0003\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001-\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t.\u0003\u0000\u0000\u0001\u0001\u0001\/\u0003\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u00010\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t1\u0003\u0000\u0000\u0001\u0001\u00012\u0003\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u00013\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t4\u0003\u0000\u0000\u0001\u0001\u00015\u0003\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u00016\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t7\u0003\u0000\u0000\u0001\u0001\u00018\u0003\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u00019\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t:\u0003\u0000\u0000\u0000\u0000\u0001;\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001<\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t=\u0003\u0000\u0000\u0000\u0000\u0001>\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001?\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t@\u0003\u0000\u0000\u0000\u0000\u0001A\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001B\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tC\u0003\u0000\u0000\u0000\u0000\u0001D\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001E\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tF\u0003\u0000\u0000\u0000\u0000\u0001G\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001H\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tI\u0003\u0000\u0000\u0000\u0000\u0001J\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001K\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tL\u0003\u0000\u0000\u0000\u0000\u0001M\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001N\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tO\u0003\u0000\u0000\u0000\u0000\u0001P\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001Q\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tR\u0003\u0000\u0000\u0000\u0000\u0001S\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001T\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tU\u0003\u0000\u0000\u0000\u0000\u0001V\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001W\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tX\u0003\u0000\u0000\u0000\u0000\u0001Y\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001Z\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t[\u0003\u0000\u0000\u0000\u0000\u0001\\\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001]\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t^\u0003\u0000\u0000\u0000\u0000\u0001_\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001`\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\ta\u0003\u0000\u0000\u0000\u0000\u0001b\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001c\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\td\u0003\u0000\u0000\u0000\u0001\u0001e\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001f\u0003\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tg\u0003\u0000\u0000\u0001\u0001\u0001h\u0003\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001i\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tj\u0003\u0000\u0000\u0001\u0001\u0001k\u0003\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001l\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tm\u0003\u0000\u0000\u0001\u0001\u0001n\u0003\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001o\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tp\u0003\u0000\u0000\u0001\u0001\u0001q\u0003\u0000\u00001\u0001\u0000\u0000\u0005\u0000\u0000\u0000\u0001r\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\ts\u0003\u0000\u0000\u0000\u0000\u0001t\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001u\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tv\u0003\u0000\u0000\u0000\u0000\u0001w\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001x\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\ty\u0003\u0000\u0000\u0000\u0000\u0001z\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001{\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t|\u0003\u0000\u0000\u0000\u0000\u0001}\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001~\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0001\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0001\u0001\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0001\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0001\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0000\u0004\u0000\u0000\u0000\u0000\u0001\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0003\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0005\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0006\u0004\u0000\u0000\u0000\u0000\u0001\u0007\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\b\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\t\u0004\u0000\u0000\u0000\u0000\u0001\n\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000b\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\f\u0004\u0000\u0000\u0000\u0000\u0001\r\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000e\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u000f\u0004\u0000\u0000\u0000\u0000\u0001\u0010\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0011\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0012\u0004\u0000\u0000\u0000\u0000\u0001\u0013\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0014\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0015\u0004\u0000\u0000\u0000\u0000\u0001\u0016\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0017\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0018\u0004\u0000\u0000\u0000\u0000\u0001\u0019\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001a\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u001b\u0004\u0000\u0000\u0000\u0000\u0001\u001c\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001d\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u001e\u0004\u0000\u0000\u0000\u0000\u0001\u001f\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001 \u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t!\u0004\u0000\u0000\u0000\u0000\u0001\"\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001#\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t$\u0004\u0000\u0000\u0000\u0000\u0001%\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001&\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t'\u0004\u0000\u0000\u0000\u0000\u0001(\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001)\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t*\u0004\u0000\u0000\u0000\u0000\u0001+\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001,\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t-\u0004\u0000\u0000\u0000\u0000\u0001.\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\/\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t0\u0004\u0000\u0000\u0000\u0000\u00011\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00012\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0005\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t3\u0004\u0000\u0000\u0000\u0000\u00014\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00015\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0006\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t6\u0004\u0000\u0000\u0000\u0000\u00017\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u00018\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0007\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t9\u0004\u0000\u0000\u0000\u0000\u0001:\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001;\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\b\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t<\u0004\u0000\u0000\u0000\u0000\u0001=\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001>\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\t\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t?\u0004\u0000\u0000\u0000\u0000\u0001@\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001A\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\n\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tB\u0004\u0000\u0000\u0000\u0000\u0001C\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001D\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000b\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tE\u0004\u0000\u0000\u0000\u0000\u0001F\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001G\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tH\u0004\u0000\u0000\u0000\u0000\u0001I\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001J\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\r\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tK\u0004\u0000\u0000\u0000\u0000\u0001L\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001M\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000e\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tN\u0004\u0000\u0000\u0000\u0000\u0001O\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001P\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tQ\u0004\u0000\u0000\u0000\u0000\u0001R\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001S\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0010\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tT\u0004\u0000\u0000\u0000\u0000\u0001U\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001V\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0011\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tW\u0004\u0000\u0000\u0000\u0000\u0001X\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001Y\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0012\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tZ\u0004\u0000\u0000\u0000\u0000\u0001[\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\\\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0013\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t]\u0004\u0000\u0000\u0000\u0000\u0001^\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001_\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0014\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t`\u0004\u0000\u0000\u0000\u0000\u0001a\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001b\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0015\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tc\u0004\u0000\u0000\u0000\u0000\u0001d\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001e\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0016\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tf\u0004\u0000\u0000\u0000\u0000\u0001g\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001h\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0017\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\ti\u0004\u0000\u0000\u0000\u0000\u0001j\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001k\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0018\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tl\u0004\u0000\u0000\u0000\u0000\u0001m\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001n\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0019\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\to\u0004\u0000\u0000\u0000\u0000\u0001p\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001q\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001a\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tr\u0004\u0000\u0000\u0000\u0000\u0001s\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001t\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001b\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tu\u0004\u0000\u0000\u0000\u0000\u0001v\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001w\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001c\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tx\u0004\u0000\u0000\u0000\u0000\u0001y\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001z\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001d\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t{\u0004\u0000\u0000\u0000\u0000\u0001|\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001}\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001e\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t~\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001 \u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001!\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\"\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001#\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001$\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001%\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001&\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001'\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001(\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001)\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001*\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001+\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001,\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001-\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001.\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\/\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u0004\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0004\u0000\u00001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u000f0\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f3\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f6\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f9\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f<\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f?\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fB\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fE\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fH\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fK\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fN\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fQ\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fT\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fW\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fZ\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f]\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f`\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fc\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000ff\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fi\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fl\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fo\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fr\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fu\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000fx\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f{\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f~\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\b\\?\u0000\u0000\u0000\u0000\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0001\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u00a4;\u000f\u000f\/?]\u0007\u0001=\u0000\u0000?\u000f\u0002\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0005\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\b\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u000b\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u000e\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0011\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0014\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0017\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u001a\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u001d\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f \u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f#\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f&\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f)\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f,\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\/\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f2\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f5\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f8\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b^y=_>V?\u0000\u0000?\u000f;\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f>\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fA\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fD\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fG\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fJ\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fM\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fP\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fS\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fV\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fY\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\\\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f_\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fb\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fe\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fh\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fk\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fn\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fq\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000ft\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fw\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fz\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f}\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0002\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0001\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0004\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0007\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\n\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\r\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0010\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0013\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0016\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0019\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u001c\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u001f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\"\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f%\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f(\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f+\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f.\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f1\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f4\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f7\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f:\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f=\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f@\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fC\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fF\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fI\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fL\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fO\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fR\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fU\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fX\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f[\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f^\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fa\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fd\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fg\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fj\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fm\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fp\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fs\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fv\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fy\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f|\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0000\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0003\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0006\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\t\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0012\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0015\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0018\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u001b\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u001e\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f!\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f$\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f'\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f*\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f-\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f0\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f3\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f6\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f9\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f<\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f?\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fB\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fE\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fH\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fK\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fN\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fQ\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fT\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fW\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fZ\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f]\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f`\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fc\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000ff\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fi\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fl\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fo\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fr\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fu\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000fx\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f{\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f~\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000f\u0004\u0000\u0000\u0004\u0000\u0000\u0000\u000b\u0000\u0000?\u0000\u0000?\u0000\u0000?\u0000\u0000?\u000b","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"5df5d33179acb22f145c9c77e7e30b2544dcdff1","subject":"Fix query.","message":"Fix query.\n","repos":"Bitiquinho\/Jogo-Educacional-Producao,Bitiquinho\/Jogo-Educacional-Producao,Bitiquinho\/Jogo-Educacional-Producao","old_file":"assets\/scripts\/quiz.gd","new_file":"assets\/scripts\/quiz.gd","new_contents":"extends Panel\n\nonready var content_text = get_node( \"content\/text\" )\nonready var content_image = get_node( \"content\/image\" )\nonready var option_buttons = get_node( \"option_buttons\" )\n\nvar pages_list = []\nconst MAX_PAGES_NUMBER = 5\nvar current_pages_count = 0\n\nvar right_option = -1\n\nfunc _input( event ):\n\tif event.type == InputEvent.KEY:\n\t\tif event.pressed and event.scancode == KEY_BACKSPACE:\n\t\t\tfinish()\n\nfunc start():\n\tInput.set_mouse_mode( Input.MOUSE_MODE_VISIBLE )\n\tget_tree().set_pause( true )\n\tshow()\n\tset_process_input( true )\n\tcurrent_pages_count = 0\n\trandomize()\n\tnext_page()\n\nfunc finish():\n\thide()\n\tget_tree().set_pause( false )\n\tInput.set_mouse_mode( Input.MOUSE_MODE_CAPTURED )\n\tset_process_input( false )\n\nfunc load_data( data_id ):\n\tpages_list.clear()\n\tvar database = PSQLDatabase.new()\n\tdatabase.connect_server( \"localhost\", \"gamedb\", \"postgres\", \"postgres\" )\n\tpages_list = database.select( \"public.pages\", \"id,text,options,image\", \\\n\t \"WHERE type = '\" + data_id + \"' ORDER BY id\" )\n\tprint( pages_list )\n\tvar image_file = File.new()\n\tfor page_idx in range( pages_list.size() ):\n\t\tif pages_list[ page_idx ].has( \"image\" ):\n\t\t\tvar image_buffer = pages_list[ page_idx ][ \"image\" ]\n\t\t\timage_file.open( \"cache.png\", File.WRITE )\n\t\t\timage_file.store_buffer( image_buffer )\n\t\t\timage_file.close()\n\t\t\tpages_list[ page_idx ][ \"image\" ] = ImageTexture.new()\n\t\t\tpages_list[ page_idx ][ \"image\" ].load( \"cache.png\" )\n\t\telse:\n\t\t\tpages_list[ page_idx ][ \"image\" ] = null\n\t\tprint( pages_list[ page_idx ] )\n\nfunc next_page():\n\tcurrent_pages_count += 1\n\tvar pages_number = min( pages_list.size(), MAX_PAGES_NUMBER )\n\tif current_pages_count > pages_number: \n\t\tfinish()\n\t\treturn\n\tvar page_idx = current_pages_count - 1\n\tvar page = pages_list[ page_idx ]\n\tprint( page )\n\tcontent_text.set_text( page[ \"text\" ] )\n\tcontent_image.set_texture( page[ \"image\" ] )\n\toption_buttons.clear()\n\tright_option = -1\n\tvar option_entries = page[ \"options\" ].split( \",\", false )\n\tfor entry_idx in range( option_entries.size() ):\n\t\tvar entry = option_entries[ entry_idx ]\n\t\tif entry.find( \"*\" ) == 0: \n\t\t right_option= entry_idx\n\t\t entry = entry.substr( 1, entry.length() - 1 )\n\t\toption_buttons.add_button( entry )\n\nfunc _on_buttons_button_selected( button_idx ):\n\tprint( \"selected button \" + str( button_idx ) + \": \" + str( button_idx == right_option ) )\n\nfunc _on_next_button_pressed():\n\tprint( \"next page\" )\n\tnext_page()\n","old_contents":"extends Panel\n\nonready var content_text = get_node( \"content\/text\" )\nonready var content_image = get_node( \"content\/image\" )\nonready var option_buttons = get_node( \"option_buttons\" )\n\nvar pages_list = []\nconst MAX_PAGES_NUMBER = 5\nvar current_pages_count = 0\n\nvar right_option = -1\n\nfunc _input( event ):\n\tif event.type == InputEvent.KEY:\n\t\tif event.pressed and event.scancode == KEY_BACKSPACE:\n\t\t\tfinish()\n\nfunc start():\n\tInput.set_mouse_mode( Input.MOUSE_MODE_VISIBLE )\n\tget_tree().set_pause( true )\n\tshow()\n\tset_process_input( true )\n\tcurrent_pages_count = 0\n\trandomize()\n\tnext_page()\n\nfunc finish():\n\thide()\n\tget_tree().set_pause( false )\n\tInput.set_mouse_mode( Input.MOUSE_MODE_CAPTURED )\n\tset_process_input( false )\n\nfunc load_data( data_id ):\n\tpages_list.clear()\n\tvar database = PSQLDatabase.new()\n\tdatabase.connect_server( \"localhost\", \"gamedb\", \"postgres\", \"postgres\" )\n\tpages_list = database.select( \"public.pages\", \"id,text,options,image\", \"type = '\" + data_id + \"' ORDER BY id\" )\n\tprint( pages_list )\n\tvar image_file = File.new()\n\tfor page_idx in range( pages_list.size() ):\n\t\tif pages_list[ page_idx ].has( \"image\" ):\n\t\t\tvar image_buffer = pages_list[ page_idx ][ \"image\" ]\n\t\t\timage_file.open( \"cache.png\", File.WRITE )\n\t\t\timage_file.store_buffer( image_buffer )\n\t\t\timage_file.close()\n\t\t\tpages_list[ page_idx ][ \"image\" ] = ImageTexture.new()\n\t\t\tpages_list[ page_idx ][ \"image\" ].load( \"cache.png\" )\n\t\telse:\n\t\t\tpages_list[ page_idx ][ \"image\" ] = null\n\t\tprint( pages_list[ page_idx ] )\n\nfunc next_page():\n\tcurrent_pages_count += 1\n\tvar pages_number = min( pages_list.size(), MAX_PAGES_NUMBER )\n\tif current_pages_count > pages_number: \n\t\tfinish()\n\t\treturn\n\tvar page_idx = current_pages_count - 1\n\tvar page = pages_list[ page_idx ]\n\tprint( page )\n\tcontent_text.set_text( page[ \"text\" ] )\n\tcontent_image.set_texture( page[ \"image\" ] )\n\toption_buttons.clear()\n\tright_option = -1\n\tvar option_entries = page[ \"options\" ].split( \",\", false )\n\tfor entry_idx in range( option_entries.size() ):\n\t\tvar entry = option_entries[ entry_idx ]\n\t\tif entry.find( \"*\" ) == 0: \n\t\t right_option= entry_idx\n\t\t entry = entry.substr( 1, entry.length() - 1 )\n\t\toption_buttons.add_button( entry )\n\nfunc _on_buttons_button_selected( button_idx ):\n\tprint( \"selected button \" + str( button_idx ) + \": \" + str( button_idx == right_option ) )\n\nfunc _on_next_button_pressed():\n\tprint( \"next page\" )\n\tnext_page()\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"97a7f686cbac994faee240be41c0f26bcacb212a","subject":"Backing up from join-game will now disconnect any join requests","message":"Backing up from join-game will now disconnect any join requests\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/GUIManager.gd","new_file":"src\/scripts\/GUIManager.gd","new_contents":"# This script manages all of the GUI elements.\n# It switches between the states of the GUI allowing\n# the user to start games, edit the options or connect\n# to a multiplayer game.\n\nextends Node\n\n# network variables\nvar network\n\n# State variables.\nvar menuOn\nvar splashTween\n\n# Timers.\nvar timer\nvar initialWait = .5\nvar splashTimer = 2.0\nvar warningTimer = 5.0\n\n# GUI pieces.\nvar Splash_Team5\nvar Splash_Warning\nvar Menu_Main\nvar Menu_Chooser\nvar Menu_MP\nvar Menu_HostGame\nvar Menu_JoinGame\nvar Menu_Options\n\n# Menu state values. Used to switch between them.\nvar MENU_INIT\t\t\t= 0\nvar MENU_SPLASHTEAM5\t= 1\nvar MENU_SPLASHWARNING\t= 2\nvar MENU_MAIN\t\t\t= 3\nvar MENU_CHOOSER\t\t= 4\nvar MENU_MP\t\t\t\t= 5\nvar MENU_HOSTGAME\t\t= 6\nvar MENU_JOINGAME\t\t= 7\nvar MENU_OPTIONS\t\t= 8\n\n# Function to be called once for setup.\nfunc _ready():\n\t# Initial setup.\n\tmenuOn = MENU_INIT\n\ttimer = 0.0\n\tset_process( true )\n\tset_process_input( true )\n\n\t# Setup the splash fader tween.\n\tsplashTween = Tween.new()\n\tget_node( \"SplashFader\" ).add_child( splashTween )\n\tsplashTween.interpolate_method( get_node( \"SplashFader\" ), \"set_opacity\", 1.0, 0.0, 1.0, Tween.TRANS_CUBIC, Tween.EASE_IN_OUT )\n\n\t# Gather all of the menus.\n\tSplash_Team5 = get_node( \"SplashTeam5\" )\n\tSplash_Warning = get_node( \"SplashWarning\" )\n\tMenu_Main = get_node( \"MainMenu\" )\n\tMenu_Chooser = get_node( \"ChooserMenu\" )\n\tMenu_MP = get_node( \"Multiplayer\" )\n\tMenu_HostGame = get_node( \"HostGame\" )\n\tMenu_JoinGame = get_node( \"JoinGame\" )\n\tMenu_Options = get_node( \"OptionsMenu\" )\n\t\n\tGlobals.set(\"Network\", load(\"res:\/\/scripts\/Network.gd\").new())\n\tnetwork = Globals.get(\"Network\")\n\t\n\t#get_tree().get_root().add_child(network)\n\tnetwork.root = get_tree().get_root()\n\n# Function to update the GUI.\nfunc _process( delta ):\n\t# Handle the initial wait.\n\tif( menuOn == MENU_INIT ):\n\t\tif( timer > initialWait ):\n\t\t\tmenuOn = MENU_SPLASHTEAM5\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiIn()\n\n\t# Handle the Team5 splash screen.\n\tif( menuOn == MENU_SPLASHTEAM5 ):\n\t\tif( timer > splashTimer ):\n\t\t\tmenuOn = MENU_SPLASHWARNING\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiOut()\n\t\t\tSplash_Warning.guiIn()\n\n\t# Handle the warning splash screen.\n\tif( menuOn == MENU_SPLASHWARNING ):\n\t\tif( timer > warningTimer ):\n\t\t\tmenuOn = MENU_MAIN\n\t\t\ttimer = 0.0\n\t\t\tSplash_Warning.guiOut()\n\t\t\tMenu_Main.guiIn()\n\t\t\tsplashTween.start()\n\n\t# Increase the timer each frame.\n\ttimer += delta\n\n# Handle the input events.\nfunc _input( ev ):\n\t# Handle skip splash screens.\n\tif( !ev.is_pressed() and ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT ):\n\t\tif( menuOn == MENU_SPLASHTEAM5 || menuOn == MENU_SPLASHWARNING ):\n\t\t\ttimer = 999.0;\n\n\t# Handle exit.\n\tif( ev.is_action( \"ui_cancel\" ) ):\n\t\texit()\n\nfunc exit():\n\tprint( \"Exiting\" )\n\tOS.get_main_loop().quit()\n\nfunc _on_Exit_pressed():\n\texit()\n\n# TODO save to ConfigFile, load this on beginning\nfunc _on_Options_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Options.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_OPTIONS\n\tget_tree().get_root().get_node(\"GUIManager\/OptionsMenu\/Panel\/PortField\/LineEdit\").set_text(str(network.port))\n\nfunc _on_Cancel_pressed():\n\tMenu_Options.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_SaveQuit_pressed():\n\t# Add save options here.\n\tvar field = get_tree().get_root().get_node(\"GUIManager\/OptionsMenu\/Panel\/PortField\/LineEdit\")\n\tget_node(\"\/root\/Network\").setPort(field.get_text())\n\tnetwork.setPort(field.get_text())\n\t_on_Cancel_pressed()\n\nfunc _on_SP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Chooser.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_CHOOSER\n\nfunc _on_MainMenu_pressed():\n\tMenu_Chooser.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MainMenuMP_pressed():\n\tMenu_MP.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_MP.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MP\n\nfunc _on_MainMenuHG_pressed():\n\tMenu_HostGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\tnetwork.disconnect()\n\nfunc _on_HostGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_HostGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_HOSTGAME\n\t\n\tif !network.isHost and !network.isNetwork:\n\t\tprint(\"calling!\")\n\t\tnetwork.host(network.port)\n\t\tget_tree().get_root().get_node(\"GUIManager\/HostGame\/Panel\/Waiting\").set_text(\"Waiting for player to join on port \" + str(network.port) + \"...\")\n\nfunc _on_JoinGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_JoinGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_JOINGAME\n\nfunc _on_MainMenuJG_pressed():\n\tMenu_JoinGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\tnetwork.disconnect()\n\nfunc _on_RandomPuzzle_pressed():\n\tvar root = get_tree().get_root()\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\troot.add_child( ResourceLoader.load( \"res:\/\/puzzle.scn\" ).instance() )\n\n\nfunc _on_Join_pressed():\n\tvar IPPanel = get_tree().get_root().get_node(\"GUIManager\/JoinGame\/Panel\/IPAddress\")\n\tvar ip = IPPanel.get_text();\n\t\n\tif (ip.empty()):\n\t\treturn\n\t\n\tif !network.isClient:\n\t\tnetwork.connectTo(ip, network.port)\n","old_contents":"# This script manages all of the GUI elements.\n# It switches between the states of the GUI allowing\n# the user to start games, edit the options or connect\n# to a multiplayer game.\n\nextends Node\n\n# network variables\nvar network\n\n# State variables.\nvar menuOn\nvar splashTween\n\n# Timers.\nvar timer\nvar initialWait = .5\nvar splashTimer = 2.0\nvar warningTimer = 5.0\n\n# GUI pieces.\nvar Splash_Team5\nvar Splash_Warning\nvar Menu_Main\nvar Menu_Chooser\nvar Menu_MP\nvar Menu_HostGame\nvar Menu_JoinGame\nvar Menu_Options\n\n# Menu state values. Used to switch between them.\nvar MENU_INIT\t\t\t= 0\nvar MENU_SPLASHTEAM5\t= 1\nvar MENU_SPLASHWARNING\t= 2\nvar MENU_MAIN\t\t\t= 3\nvar MENU_CHOOSER\t\t= 4\nvar MENU_MP\t\t\t\t= 5\nvar MENU_HOSTGAME\t\t= 6\nvar MENU_JOINGAME\t\t= 7\nvar MENU_OPTIONS\t\t= 8\n\n# Function to be called once for setup.\nfunc _ready():\n\t# Initial setup.\n\tmenuOn = MENU_INIT\n\ttimer = 0.0\n\tset_process( true )\n\tset_process_input( true )\n\n\t# Setup the splash fader tween.\n\tsplashTween = Tween.new()\n\tget_node( \"SplashFader\" ).add_child( splashTween )\n\tsplashTween.interpolate_method( get_node( \"SplashFader\" ), \"set_opacity\", 1.0, 0.0, 1.0, Tween.TRANS_CUBIC, Tween.EASE_IN_OUT )\n\n\t# Gather all of the menus.\n\tSplash_Team5 = get_node( \"SplashTeam5\" )\n\tSplash_Warning = get_node( \"SplashWarning\" )\n\tMenu_Main = get_node( \"MainMenu\" )\n\tMenu_Chooser = get_node( \"ChooserMenu\" )\n\tMenu_MP = get_node( \"Multiplayer\" )\n\tMenu_HostGame = get_node( \"HostGame\" )\n\tMenu_JoinGame = get_node( \"JoinGame\" )\n\tMenu_Options = get_node( \"OptionsMenu\" )\n\t\n\tGlobals.set(\"Network\", load(\"res:\/\/scripts\/Network.gd\").new())\n\tnetwork = Globals.get(\"Network\")\n\t\n\t#get_tree().get_root().add_child(network)\n\tnetwork.root = get_tree().get_root()\n\n# Function to update the GUI.\nfunc _process( delta ):\n\t# Handle the initial wait.\n\tif( menuOn == MENU_INIT ):\n\t\tif( timer > initialWait ):\n\t\t\tmenuOn = MENU_SPLASHTEAM5\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiIn()\n\n\t# Handle the Team5 splash screen.\n\tif( menuOn == MENU_SPLASHTEAM5 ):\n\t\tif( timer > splashTimer ):\n\t\t\tmenuOn = MENU_SPLASHWARNING\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiOut()\n\t\t\tSplash_Warning.guiIn()\n\n\t# Handle the warning splash screen.\n\tif( menuOn == MENU_SPLASHWARNING ):\n\t\tif( timer > warningTimer ):\n\t\t\tmenuOn = MENU_MAIN\n\t\t\ttimer = 0.0\n\t\t\tSplash_Warning.guiOut()\n\t\t\tMenu_Main.guiIn()\n\t\t\tsplashTween.start()\n\n\t# Increase the timer each frame.\n\ttimer += delta\n\n# Handle the input events.\nfunc _input( ev ):\n\t# Handle skip splash screens.\n\tif( !ev.is_pressed() and ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT ):\n\t\tif( menuOn == MENU_SPLASHTEAM5 || menuOn == MENU_SPLASHWARNING ):\n\t\t\ttimer = 999.0;\n\n\t# Handle exit.\n\tif( ev.is_action( \"ui_cancel\" ) ):\n\t\texit()\n\nfunc exit():\n\tprint( \"Exiting\" )\n\tOS.get_main_loop().quit()\n\nfunc _on_Exit_pressed():\n\texit()\n\n# TODO save to ConfigFile, load this on beginning\nfunc _on_Options_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Options.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_OPTIONS\n\tget_tree().get_root().get_node(\"GUIManager\/OptionsMenu\/Panel\/PortField\/LineEdit\").set_text(str(network.port))\n\nfunc _on_Cancel_pressed():\n\tMenu_Options.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_SaveQuit_pressed():\n\t# Add save options here.\n\tvar field = get_tree().get_root().get_node(\"GUIManager\/OptionsMenu\/Panel\/PortField\/LineEdit\")\n\tget_node(\"\/root\/Network\").setPort(field.get_text())\n\tnetwork.setPort(field.get_text())\n\t_on_Cancel_pressed()\n\nfunc _on_SP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Chooser.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_CHOOSER\n\nfunc _on_MainMenu_pressed():\n\tMenu_Chooser.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MainMenuMP_pressed():\n\tMenu_MP.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_MP.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MP\n\nfunc _on_MainMenuHG_pressed():\n\tMenu_HostGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\tnetwork.disconnect()\n\nfunc _on_HostGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_HostGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_HOSTGAME\n\t\n\tif !network.isHost and !network.isNetwork:\n\t\tprint(\"calling!\")\n\t\tnetwork.host(network.port)\n\t\tget_tree().get_root().get_node(\"GUIManager\/HostGame\/Panel\/Waiting\").set_text(\"Waiting for player to join on port \" + str(network.port) + \"...\")\n\nfunc _on_JoinGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_JoinGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_JOINGAME\n\nfunc _on_MainMenuJG_pressed():\n\tMenu_JoinGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_RandomPuzzle_pressed():\n\tvar root = get_tree().get_root()\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\troot.add_child( ResourceLoader.load( \"res:\/\/puzzle.scn\" ).instance() )\n\n\nfunc _on_Join_pressed():\n\tvar IPPanel = get_tree().get_root().get_node(\"GUIManager\/JoinGame\/Panel\/IPAddress\")\n\tvar ip = IPPanel.get_text();\n\t\n\tif (ip.empty()):\n\t\treturn\n\t\n\tif !network.isClient:\n\t\tnetwork.connectTo(ip, network.port)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"8f4b6ff870d8e608ff056fee8c7043716bdd48d8","subject":"Deleted unused variable","message":"Deleted unused variable\n\nDeleted the var GRAVITY because it is unused. The gravity is used at line 237, but it's gotten from the Physics2DDirectBodyState parameter.","repos":"davidalpha\/godot,pkowal1982\/godot,est31\/godot,vkbsb\/godot,kimsunzun\/godot,cpascal\/godot,Faless\/godot,mikica1986vee\/godot,lietu\/godot,xiaoyanit\/godot,sergicollado\/godot,Shockblast\/godot,MrMaidx\/godot,Paulloz\/godot,jackmakesthings\/godot,jjdicharry\/godot,FateAce\/godot,teamblubee\/godot,youprofit\/godot,serafinfernandez\/godot,OpenSocialGames\/godot,jejung\/godot,guilhermefelipecgs\/godot,marynate\/godot,DStomtom\/godot,zicklag\/godot,JoshuaGrams\/godot,Faless\/godot,pkowal1982\/godot,vastcharade\/godot,firefly2442\/godot,blackwc\/godot,azurvii\/godot,vkbsb\/godot,pixelpicosean\/my-godot-2.1,kimsunzun\/godot,torgartor21\/godot,BogusCurry\/godot,torgartor21\/godot,Faless\/godot,ex\/godot,rollenrolm\/godot,azurvii\/godot,DStomtom\/godot,crr0004\/godot,karolgotowala\/godot,lietu\/godot,ricpelo\/godot,xiaoyanit\/godot,jjdicharry\/godot,Max-Might\/godot,Shockblast\/godot,didier-v\/godot,vastcharade\/godot,ZuBsPaCe\/godot,honix\/godot,MrMaidx\/godot,ageazrael\/godot,akien-mga\/godot,sh95119\/godot,Paulloz\/godot,hitjim\/godot,marynate\/godot,exabon\/godot,dreamsxin\/godot,honix\/godot,NateWardawg\/godot,dreamsxin\/godot,NateWardawg\/godot,davidalpha\/godot,firefly2442\/godot,josempans\/godot,lietu\/godot,blackwc\/godot,quabug\/godot,tomreyn\/godot,ZuBsPaCe\/godot,NateWardawg\/godot,MarianoGnu\/godot,exabon\/godot,tomreyn\/godot,okamstudio\/godot,ianholing\/godot,ZuBsPaCe\/godot,Brickcaster\/godot,FateAce\/godot,OpenSocialGames\/godot,mikica1986vee\/Godot_android_tegra_fallback,crr0004\/godot,kimsunzun\/godot,josempans\/godot,ficoos\/godot,Marqin\/godot,BastiaanOlij\/godot,Paulloz\/godot,guilhermefelipecgs\/godot,ZuBsPaCe\/godot,hitjim\/godot,torgartor21\/godot,buckle2000\/godot,mamarilmanson\/godot,guilhermefelipecgs\/godot,Marqin\/godot,Marqin\/godot,teamblubee\/godot,honix\/godot,est31\/godot,okamstudio\/godot,BogusCurry\/godot,est31\/godot,marynate\/godot,quabug\/godot,MarianoGnu\/godot,morrow1nd\/godot,gcbeyond\/godot,n-pigeon\/godot,DmitriySalnikov\/godot,josempans\/godot,jjdicharry\/godot,pixelpicosean\/my-godot-2.1,didier-v\/godot,cpascal\/godot,Hodes\/godot,ZuBsPaCe\/godot,zj8487\/godot,torgartor21\/godot,vnen\/godot,ex\/godot,opmana\/godot,n-pigeon\/godot,wardw\/godot,mikica1986vee\/GodotArrayEditorStuff,azurvii\/godot,a12n\/godot,mamarilmanson\/godot,crr0004\/godot,ricpelo\/godot,BogusCurry\/godot,guilhermefelipecgs\/godot,sh95119\/godot,BoDonkey\/godot,azurvii\/godot,gcbeyond\/godot,jackmakesthings\/godot,RebelliousX\/Go_Dot,mikica1986vee\/Godot_android_tegra_fallback,DmitriySalnikov\/godot,godotengine\/godot,mcanders\/godot,Paulloz\/godot,ex\/godot,didier-v\/godot,cpascal\/godot,Zylann\/godot,TheHX\/godot,DStomtom\/godot,dreamsxin\/godot,BogusCurry\/godot,vastcharade\/godot,BogusCurry\/godot,a12n\/godot,agusbena\/godot,NateWardawg\/godot,groud\/godot,RandomShaper\/godot,DStomtom\/godot,akien-mga\/godot,Valentactive\/godot,jackmakesthings\/godot,liuyucoder\/godot,jackmakesthings\/godot,Shockblast\/godot,zicklag\/godot,sanikoyes\/godot,youprofit\/godot,kimsunzun\/godot,blackwc\/godot,exabon\/godot,MrMaidx\/godot,jackmakesthings\/godot,mikica1986vee\/GodotArrayEditorStuff,quabug\/godot,DmitriySalnikov\/godot,vnen\/godot,mikica1986vee\/godot,Zylann\/godot,ZuBsPaCe\/godot,serafinfernandez\/godot,Paulloz\/godot,cpascal\/godot,a12n\/godot,zj8487\/godot,OpenSocialGames\/godot,JoshuaGrams\/godot,agusbena\/godot,FullMeta\/godot,mrezai\/godot,josempans\/godot,Zylann\/godot,supriyantomaftuh\/godot,mikica1986vee\/Godot_android_tegra_fallback,iap-mutant\/godot,Faless\/godot,torgartor21\/godot,zj8487\/godot,pkowal1982\/godot,ageazrael\/godot,dreamsxin\/godot,sergicollado\/godot,HatiEth\/godot,BastiaanOlij\/godot,mikica1986vee\/Godot_android_tegra_fallback,Marqin\/godot,sh95119\/godot,mcanders\/godot,Brickcaster\/godot,kimsunzun\/godot,vastcharade\/godot,gcbeyond\/godot,BoDonkey\/godot,hitjim\/godot,pixelpicosean\/my-godot-2.1,OpenSocialGames\/godot,Shockblast\/godot,pkowal1982\/godot,TheBoyThePlay\/godot,crr0004\/godot,Valentactive\/godot,mikica1986vee\/Godot_android_tegra_fallback,DmitriySalnikov\/godot,cpascal\/godot,TheBoyThePlay\/godot,shackra\/godot,ficoos\/godot,TheHX\/godot,xiaoyanit\/godot,ficoos\/godot,TheBoyThePlay\/godot,vastcharade\/godot,vastcharade\/godot,mikica1986vee\/godot,davidalpha\/godot,mamarilmanson\/godot,Zylann\/godot,TheBoyThePlay\/godot,est31\/godot,honix\/godot,gcbeyond\/godot,shackra\/godot,ageazrael\/godot,agusbena\/godot,hitjim\/godot,mrezai\/godot,mikica1986vee\/Godot_android_tegra_fallback,vnen\/godot,karolgotowala\/godot,zj8487\/godot,supriyantomaftuh\/godot,vnen\/godot,Zylann\/godot,FullMeta\/godot,agusbena\/godot,pkowal1982\/godot,mikica1986vee\/GodotArrayEditorStuff,groud\/godot,morrow1nd\/godot,sh95119\/godot,BoDonkey\/godot,FateAce\/godot,zicklag\/godot,dreamsxin\/godot,gau-veldt\/godot,honix\/godot,vastcharade\/godot,mikica1986vee\/GodotArrayEditorStuff,marynate\/godot,vkbsb\/godot,hipgraphics\/godot,RebelliousX\/Go_Dot,blackwc\/godot,mikica1986vee\/GodotArrayEditorStuff,sanikoyes\/godot,serafinfernandez\/godot,hipgraphics\/godot,azurvii\/godot,karolgotowala\/godot,JoshuaGrams\/godot,ricpelo\/godot,ricpelo\/godot,HatiEth\/godot,hitjim\/godot,karolgotowala\/godot,mamarilmanson\/godot,sergicollado\/godot,guilhermefelipecgs\/godot,mikica1986vee\/GodotArrayEditorStuff,guilhermefelipecgs\/godot,firefly2442\/godot,vkbsb\/godot,mamarilmanson\/godot,okamstudio\/godot,RandomShaper\/godot,RandomShaper\/godot,godotengine\/godot,gau-veldt\/godot,Max-Might\/godot,kimsunzun\/godot,akien-mga\/godot,cpascal\/godot,Zylann\/godot,MarianoGnu\/godot,zj8487\/godot,crr0004\/godot,mamarilmanson\/godot,davidalpha\/godot,ianholing\/godot,groud\/godot,mikica1986vee\/godot,Brickcaster\/godot,Shockblast\/godot,crr0004\/godot,exabon\/godot,opmana\/godot,lietu\/godot,FullMeta\/godot,dreamsxin\/godot,youprofit\/godot,DStomtom\/godot,lietu\/godot,wardw\/godot,FullMeta\/godot,cpascal\/godot,teamblubee\/godot,DmitriySalnikov\/godot,blackwc\/godot,ageazrael\/godot,kimsunzun\/godot,pixelpicosean\/my-godot-2.1,karolgotowala\/godot,karolgotowala\/godot,RandomShaper\/godot,BastiaanOlij\/godot,BastiaanOlij\/godot,liuyucoder\/godot,zj8487\/godot,firefly2442\/godot,honix\/godot,firefly2442\/godot,vkbsb\/godot,HatiEth\/godot,morrow1nd\/godot,quabug\/godot,ficoos\/godot,hipgraphics\/godot,marynate\/godot,xiaoyanit\/godot,teamblubee\/godot,hitjim\/godot,crr0004\/godot,sergicollado\/godot,DStomtom\/godot,mrezai\/godot,iap-mutant\/godot,agusbena\/godot,xiaoyanit\/godot,xiaoyanit\/godot,BoDonkey\/godot,hipgraphics\/godot,jjdicharry\/godot,Max-Might\/godot,ricpelo\/godot,pkowal1982\/godot,iap-mutant\/godot,blackwc\/godot,josempans\/godot,a12n\/godot,a12n\/godot,cpascal\/godot,youprofit\/godot,godotengine\/godot,buckle2000\/godot,akien-mga\/godot,sh95119\/godot,groud\/godot,gau-veldt\/godot,jejung\/godot,mrezai\/godot,jackmakesthings\/godot,shackra\/godot,RandomShaper\/godot,didier-v\/godot,kimsunzun\/godot,jejung\/godot,morrow1nd\/godot,crr0004\/godot,Brickcaster\/godot,mamarilmanson\/godot,huziyizero\/godot,Marqin\/godot,ex\/godot,mikica1986vee\/GodotArrayEditorStuff,MarianoGnu\/godot,shackra\/godot,FullMeta\/godot,Faless\/godot,a12n\/godot,mikica1986vee\/Godot_android_tegra_fallback,JoshuaGrams\/godot,shackra\/godot,buckle2000\/godot,buckle2000\/godot,ex\/godot,mikica1986vee\/Godot_android_tegra_fallback,MrMaidx\/godot,mrezai\/godot,ficoos\/godot,Marqin\/godot,quabug\/godot,youprofit\/godot,gcbeyond\/godot,sh95119\/godot,vkbsb\/godot,godotengine\/godot,BoDonkey\/godot,FullMeta\/godot,serafinfernandez\/godot,JoshuaGrams\/godot,mikica1986vee\/godot,vkbsb\/godot,TheHX\/godot,vnen\/godot,quabug\/godot,davidalpha\/godot,n-pigeon\/godot,OpenSocialGames\/godot,n-pigeon\/godot,ianholing\/godot,ZuBsPaCe\/godot,TheBoyThePlay\/godot,ex\/godot,exabon\/godot,liuyucoder\/godot,TheBoyThePlay\/godot,BoDonkey\/godot,groud\/godot,liuyucoder\/godot,liuyucoder\/godot,liuyucoder\/godot,TheHX\/godot,mikica1986vee\/godot,xiaoyanit\/godot,ricpelo\/godot,teamblubee\/godot,iap-mutant\/godot,sanikoyes\/godot,tomreyn\/godot,teamblubee\/godot,jjdicharry\/godot,ianholing\/godot,mikica1986vee\/Godot_android_tegra_fallback,serafinfernandez\/godot,zicklag\/godot,morrow1nd\/godot,iap-mutant\/godot,DmitriySalnikov\/godot,buckle2000\/godot,jjdicharry\/godot,hipgraphics\/godot,kimsunzun\/godot,ageazrael\/godot,ricpelo\/godot,firefly2442\/godot,Valentactive\/godot,wardw\/godot,rollenrolm\/godot,tomreyn\/godot,youprofit\/godot,BoDonkey\/godot,marynate\/godot,n-pigeon\/godot,MrMaidx\/godot,Faless\/godot,gcbeyond\/godot,NateWardawg\/godot,godotengine\/godot,firefly2442\/godot,mrezai\/godot,serafinfernandez\/godot,Valentactive\/godot,lietu\/godot,OpenSocialGames\/godot,Max-Might\/godot,Valentactive\/godot,Shockblast\/godot,ex\/godot,DStomtom\/godot,blackwc\/godot,youprofit\/godot,vastcharade\/godot,jejung\/godot,okamstudio\/godot,Valentactive\/godot,supriyantomaftuh\/godot,RebelliousX\/Go_Dot,opmana\/godot,BastiaanOlij\/godot,azurvii\/godot,akien-mga\/godot,quabug\/godot,zicklag\/godot,lietu\/godot,youprofit\/godot,HatiEth\/godot,torgartor21\/godot,a12n\/godot,FateAce\/godot,iap-mutant\/godot,godotengine\/godot,mamarilmanson\/godot,iap-mutant\/godot,ricpelo\/godot,RebelliousX\/Go_Dot,NateWardawg\/godot,hitjim\/godot,ex\/godot,torgartor21\/godot,gau-veldt\/godot,MrMaidx\/godot,vnen\/godot,torgartor21\/godot,akien-mga\/godot,ficoos\/godot,sergicollado\/godot,TheBoyThePlay\/godot,NateWardawg\/godot,a12n\/godot,sanikoyes\/godot,wardw\/godot,Hodes\/godot,marynate\/godot,sanikoyes\/godot,vastcharade\/godot,Shockblast\/godot,iap-mutant\/godot,quabug\/godot,Faless\/godot,karolgotowala\/godot,iap-mutant\/godot,okamstudio\/godot,huziyizero\/godot,ageazrael\/godot,marynate\/godot,okamstudio\/godot,BastiaanOlij\/godot,FullMeta\/godot,NateWardawg\/godot,wardw\/godot,sh95119\/godot,youprofit\/godot,sergicollado\/godot,lietu\/godot,okamstudio\/godot,lietu\/godot,supriyantomaftuh\/godot,DStomtom\/godot,hipgraphics\/godot,teamblubee\/godot,Faless\/godot,jjdicharry\/godot,rollenrolm\/godot,hipgraphics\/godot,est31\/godot,sergicollado\/godot,mrezai\/godot,Hodes\/godot,dreamsxin\/godot,Zylann\/godot,Zylann\/godot,torgartor21\/godot,karolgotowala\/godot,MarianoGnu\/godot,BogusCurry\/godot,BogusCurry\/godot,liuyucoder\/godot,supriyantomaftuh\/godot,didier-v\/godot,akien-mga\/godot,wardw\/godot,mikica1986vee\/godot,BastiaanOlij\/godot,mcanders\/godot,crr0004\/godot,TheBoyThePlay\/godot,ricpelo\/godot,jjdicharry\/godot,ianholing\/godot,n-pigeon\/godot,ianholing\/godot,vastcharade\/godot,a12n\/godot,zj8487\/godot,zj8487\/godot,huziyizero\/godot,liuyucoder\/godot,sergicollado\/godot,jackmakesthings\/godot,DStomtom\/godot,Hodes\/godot,davidalpha\/godot,didier-v\/godot,iap-mutant\/godot,supriyantomaftuh\/godot,davidalpha\/godot,davidalpha\/godot,ricpelo\/godot,RandomShaper\/godot,sergicollado\/godot,mrezai\/godot,OpenSocialGames\/godot,Brickcaster\/godot,jackmakesthings\/godot,OpenSocialGames\/godot,wardw\/godot,mcanders\/godot,wardw\/godot,DmitriySalnikov\/godot,shackra\/godot,JoshuaGrams\/godot,didier-v\/godot,mikica1986vee\/GodotArrayEditorStuff,exabon\/godot,mamarilmanson\/godot,liuyucoder\/godot,godotengine\/godot,BogusCurry\/godot,agusbena\/godot,n-pigeon\/godot,BoDonkey\/godot,blackwc\/godot,supriyantomaftuh\/godot,BastiaanOlij\/godot,supriyantomaftuh\/godot,morrow1nd\/godot,didier-v\/godot,hitjim\/godot,Max-Might\/godot,pkowal1982\/godot,MarianoGnu\/godot,BoDonkey\/godot,vnen\/godot,xiaoyanit\/godot,blackwc\/godot,zj8487\/godot,RandomShaper\/godot,teamblubee\/godot,mikica1986vee\/godot,gcbeyond\/godot,liuyucoder\/godot,ageazrael\/godot,rollenrolm\/godot,didier-v\/godot,a12n\/godot,mcanders\/godot,ianholing\/godot,sergicollado\/godot,jackmakesthings\/godot,pixelpicosean\/my-godot-2.1,ZuBsPaCe\/godot,Valentactive\/godot,serafinfernandez\/godot,OpenSocialGames\/godot,kimsunzun\/godot,okamstudio\/godot,Paulloz\/godot,akien-mga\/godot,guilhermefelipecgs\/godot,FullMeta\/godot,TheBoyThePlay\/godot,Brickcaster\/godot,marynate\/godot,ianholing\/godot,shackra\/godot,blackwc\/godot,marynate\/godot,dreamsxin\/godot,guilhermefelipecgs\/godot,josempans\/godot,okamstudio\/godot,jjdicharry\/godot,cpascal\/godot,mikica1986vee\/GodotArrayEditorStuff,DStomtom\/godot,hipgraphics\/godot,Paulloz\/godot,MarianoGnu\/godot,sanikoyes\/godot,HatiEth\/godot,Valentactive\/godot,rollenrolm\/godot,BogusCurry\/godot,sh95119\/godot,Shockblast\/godot,josempans\/godot,youprofit\/godot,pkowal1982\/godot,mikica1986vee\/godot,sanikoyes\/godot,sh95119\/godot,jjdicharry\/godot,tomreyn\/godot,zicklag\/godot,MarianoGnu\/godot,TheBoyThePlay\/godot,Brickcaster\/godot,BoDonkey\/godot,xiaoyanit\/godot,wardw\/godot,BogusCurry\/godot,shackra\/godot,hitjim\/godot,mikica1986vee\/Godot_android_tegra_fallback,ianholing\/godot,TheHX\/godot,jejung\/godot,RebelliousX\/Go_Dot,godotengine\/godot,teamblubee\/godot,FateAce\/godot,gcbeyond\/godot,est31\/godot,shackra\/godot,supriyantomaftuh\/godot,mikica1986vee\/GodotArrayEditorStuff,opmana\/godot,NateWardawg\/godot,HatiEth\/godot,opmana\/godot,gau-veldt\/godot,hitjim\/godot,shackra\/godot,zj8487\/godot,quabug\/godot,serafinfernandez\/godot,groud\/godot,HatiEth\/godot,davidalpha\/godot,dreamsxin\/godot,crr0004\/godot,hipgraphics\/godot,didier-v\/godot,FullMeta\/godot,torgartor21\/godot,agusbena\/godot,OpenSocialGames\/godot,huziyizero\/godot,josempans\/godot,wardw\/godot,serafinfernandez\/godot,okamstudio\/godot,huziyizero\/godot,FullMeta\/godot,ianholing\/godot,HatiEth\/godot,Max-Might\/godot,Hodes\/godot,quabug\/godot,FateAce\/godot,karolgotowala\/godot,sh95119\/godot,mcanders\/godot,HatiEth\/godot,cpascal\/godot,sanikoyes\/godot,xiaoyanit\/godot,jackmakesthings\/godot,firefly2442\/godot,Hodes\/godot,mikica1986vee\/godot,supriyantomaftuh\/godot,RebelliousX\/Go_Dot,lietu\/godot,vnen\/godot,vkbsb\/godot,agusbena\/godot,gcbeyond\/godot,teamblubee\/godot,dreamsxin\/godot,gcbeyond\/godot,HatiEth\/godot,davidalpha\/godot,buckle2000\/godot,serafinfernandez\/godot,karolgotowala\/godot,mamarilmanson\/godot,hipgraphics\/godot,jejung\/godot","old_file":"demos\/2d\/platformer\/player.gd","new_file":"demos\/2d\/platformer\/player.gd","new_contents":"extends RigidBody2D\n\n# Character Demo, written by Juan Linietsky.\n#\n# Implementation of a 2D Character controller.\n# This implementation uses the physics engine for\n# controlling a character, in a very similar way\n# than a 3D character controller would be implemented.\n#\n# Using the physics engine for this has the main\n# advantages:\n# -Easy to write.\n# -Interaction with other physics-based objects is free\n# -Only have to deal with the object linear velocity, not position\n# -All collision\/area framework available\n# \n# But also has the following disadvantages:\n# \n# -Objects may bounce a little bit sometimes\n# -Going up ramps sends the chracter flying up, small hack is needed.\n# -A ray collider is needed to avoid sliding down on ramps and \n# undesiderd bumps, small steps and rare numerical precision errors.\n# (another alternative may be to turn on friction when the character is not moving).\n# -Friction cant be used, so floor velocity must be considered\n# for moving platforms.\n\nvar anim=\"\"\nvar siding_left=false\nvar jumping=false\nvar stopping_jump=false\nvar shooting=false\n\nvar WALK_ACCEL = 800.0\nvar WALK_DEACCEL= 800.0\nvar WALK_MAX_VELOCITY= 200.0\nvar AIR_ACCEL = 200.0\nvar AIR_DEACCEL= 200.0\nvar JUMP_VELOCITY=460\nvar STOP_JUMP_FORCE=900.0\n\nvar MAX_FLOOR_AIRBORNE_TIME = 0.15\n\nvar airborne_time=1e20\nvar shoot_time=1e20\n\nvar MAX_SHOOT_POSE_TIME = 0.3\n\nvar bullet = preload(\"res:\/\/bullet.xml\")\n\nvar floor_h_velocity=0.0\nvar enemy\n\nfunc _integrate_forces(s):\n\n\t\n\n\tvar lv = s.get_linear_velocity()\n\tvar step = s.get_step()\n\t\n\tvar new_anim=anim\n\tvar new_siding_left=siding_left\n\t\n\t\n\t# Get the controls\n\tvar move_left = Input.is_action_pressed(\"move_left\")\n\tvar move_right = Input.is_action_pressed(\"move_right\")\n\tvar jump = Input.is_action_pressed(\"jump\")\n\tvar shoot = Input.is_action_pressed(\"shoot\")\n\tvar spawn = Input.is_action_pressed(\"spawn\")\n\t\n\tif spawn:\n\t\tvar e = enemy.instance()\n\t\tvar p = get_pos()\n\t\tp.y = p.y - 100\n\t\te.set_pos(p)\n\t\tget_parent().add_child(e)\n\n\t\n\t#deapply prev floor velocity\n\tlv.x-=floor_h_velocity\n\tfloor_h_velocity=0.0\n\t\n\t\n\t# Find the floor (a contact with upwards facing collision normal)\n\tvar found_floor=false\n\tvar floor_index=-1\n\t\n\tfor x in range(s.get_contact_count()):\n\n\t\tvar ci = s.get_contact_local_normal(x)\n\t\tif (ci.dot(Vector2(0,-1))>0.6):\n\t\t\tfound_floor=true\n\t\t\tfloor_index=x\n\t\n\t# A good idea when impementing characters of all kinds,\n\t# Compensates for physics imprecission, as well as human\n\t# reaction delay.\n\t\n\tif (shoot and not shooting):\n\t\tshoot_time=0\n\t\tvar bi = bullet.instance()\n\t\tvar ss\n\t\tif (siding_left):\n\t\t\tss=-1.0\n\t\telse:\n\t\t\tss=1.0\n\t\tvar pos = get_pos() + get_node(\"bullet_shoot\").get_pos()*Vector2(ss,1.0)\n\n\t\tbi.set_pos(pos)\n\t\tget_parent().add_child(bi)\n\n\t\tbi.set_linear_velocity( Vector2(800.0*ss,-80) )\t\n\t\tget_node(\"sprite\/smoke\").set_emitting(true)\t\n\t\tget_node(\"sound\").play(\"shoot\")\n\t\tPS2D.body_add_collision_exception(bi.get_rid(),get_rid()) # make bullet and this not collide\n\n\n\telse:\n\t\tshoot_time+=step\n\t\t\n\t\n\tif (found_floor):\n\t\tairborne_time=0.0 \n\telse:\n\t\tairborne_time+=step #time it spent in the air\n\t\t\n\tvar on_floor = airborne_time < MAX_FLOOR_AIRBORNE_TIME\n\n\t# Process jump\t\t\n\tif (jumping):\n\t\tif (lv.y>0):\n\t\t\t#set off the jumping flag if going down\n\t\t\tjumping=false\n\t\telif (not jump):\n\t\t\tstopping_jump=true\n\t\t\t\n\t\tif (stopping_jump):\n\t\t\tlv.y+=STOP_JUMP_FORCE*step\n\t\t\n\tif (on_floor):\n\n\t\t# Process logic when character is on floor\n\t\t\t\n\t\tif (move_left and not move_right):\n\t\t\tif (lv.x > -WALK_MAX_VELOCITY):\n\t\t\t\tlv.x-=WALK_ACCEL*step\t\t\t\n\t\telif (move_right and not move_left):\n\t\t\tif (lv.x < WALK_MAX_VELOCITY):\n\t\t\t\tlv.x+=WALK_ACCEL*step\n\t\telse:\n\t\t\tvar xv = abs(lv.x)\n\t\t\txv-=WALK_DEACCEL*step\n\t\t\tif (xv<0):\n\t\t\t\txv=0\n\t\t\tlv.x=sign(lv.x)*xv\n\t\t\t\n\t\t#Check jump\n\t\tif (not jumping and jump):\n\t\t\tlv.y=-JUMP_VELOCITY\n\t\t\tjumping=true\n\t\t\tstopping_jump=false\n\t\t\tget_node(\"sound\").play(\"jump\")\n\t\t\t\n\t\t#check siding\n\t\t\n\t\tif (lv.x < 0 and move_left):\n\t\t\tnew_siding_left=true\n\t\telif (lv.x > 0 and move_right):\n\t\t\tnew_siding_left=false\n\t\tif (jumping):\n\t\t\tnew_anim=\"jumping\"\t\n\t\telif (abs(lv.x)<0.1):\n\t\t\tif (shoot_time -WALK_MAX_VELOCITY):\n\t\t\t\tlv.x-=AIR_ACCEL*step\t\t\t\n\t\telif (move_right and not move_left):\n\t\t\tif (lv.x < WALK_MAX_VELOCITY):\n\t\t\t\tlv.x+=AIR_ACCEL*step\n\t\telse:\n\t\t\tvar xv = abs(lv.x)\n\t\t\txv-=AIR_DEACCEL*step\n\t\t\tif (xv<0):\n\t\t\t\txv=0\n\t\t\tlv.x=sign(lv.x)*xv\n\t\t\t\n\t\tif (lv.y<0):\n\t\t\tif (shoot_time0.6):\n\t\t\tfound_floor=true\n\t\t\tfloor_index=x\n\t\n\t# A good idea when impementing characters of all kinds,\n\t# Compensates for physics imprecission, as well as human\n\t# reaction delay.\n\t\n\tif (shoot and not shooting):\n\t\tshoot_time=0\n\t\tvar bi = bullet.instance()\n\t\tvar ss\n\t\tif (siding_left):\n\t\t\tss=-1.0\n\t\telse:\n\t\t\tss=1.0\n\t\tvar pos = get_pos() + get_node(\"bullet_shoot\").get_pos()*Vector2(ss,1.0)\n\n\t\tbi.set_pos(pos)\n\t\tget_parent().add_child(bi)\n\n\t\tbi.set_linear_velocity( Vector2(800.0*ss,-80) )\t\n\t\tget_node(\"sprite\/smoke\").set_emitting(true)\t\n\t\tget_node(\"sound\").play(\"shoot\")\n\t\tPS2D.body_add_collision_exception(bi.get_rid(),get_rid()) # make bullet and this not collide\n\n\n\telse:\n\t\tshoot_time+=step\n\t\t\n\t\n\tif (found_floor):\n\t\tairborne_time=0.0 \n\telse:\n\t\tairborne_time+=step #time it spent in the air\n\t\t\n\tvar on_floor = airborne_time < MAX_FLOOR_AIRBORNE_TIME\n\n\t# Process jump\t\t\n\tif (jumping):\n\t\tif (lv.y>0):\n\t\t\t#set off the jumping flag if going down\n\t\t\tjumping=false\n\t\telif (not jump):\n\t\t\tstopping_jump=true\n\t\t\t\n\t\tif (stopping_jump):\n\t\t\tlv.y+=STOP_JUMP_FORCE*step\n\t\t\n\tif (on_floor):\n\n\t\t# Process logic when character is on floor\n\t\t\t\n\t\tif (move_left and not move_right):\n\t\t\tif (lv.x > -WALK_MAX_VELOCITY):\n\t\t\t\tlv.x-=WALK_ACCEL*step\t\t\t\n\t\telif (move_right and not move_left):\n\t\t\tif (lv.x < WALK_MAX_VELOCITY):\n\t\t\t\tlv.x+=WALK_ACCEL*step\n\t\telse:\n\t\t\tvar xv = abs(lv.x)\n\t\t\txv-=WALK_DEACCEL*step\n\t\t\tif (xv<0):\n\t\t\t\txv=0\n\t\t\tlv.x=sign(lv.x)*xv\n\t\t\t\n\t\t#Check jump\n\t\tif (not jumping and jump):\n\t\t\tlv.y=-JUMP_VELOCITY\n\t\t\tjumping=true\n\t\t\tstopping_jump=false\n\t\t\tget_node(\"sound\").play(\"jump\")\n\t\t\t\n\t\t#check siding\n\t\t\n\t\tif (lv.x < 0 and move_left):\n\t\t\tnew_siding_left=true\n\t\telif (lv.x > 0 and move_right):\n\t\t\tnew_siding_left=false\n\t\tif (jumping):\n\t\t\tnew_anim=\"jumping\"\t\n\t\telif (abs(lv.x)<0.1):\n\t\t\tif (shoot_time -WALK_MAX_VELOCITY):\n\t\t\t\tlv.x-=AIR_ACCEL*step\t\t\t\n\t\telif (move_right and not move_left):\n\t\t\tif (lv.x < WALK_MAX_VELOCITY):\n\t\t\t\tlv.x+=AIR_ACCEL*step\n\t\telse:\n\t\t\tvar xv = abs(lv.x)\n\t\t\txv-=AIR_DEACCEL*step\n\t\t\tif (xv<0):\n\t\t\t\txv=0\n\t\t\tlv.x=sign(lv.x)*xv\n\t\t\t\n\t\tif (lv.y<0):\n\t\t\tif (shoot_time initialWait ):\n\t\t\tmenuOn = MENU_SPLASHTEAM5\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiIn()\n\n\t# Handle the Team5 splash screen.\n\tif( menuOn == MENU_SPLASHTEAM5 ):\n\t\tif( timer > splashTimer ):\n\t\t\tmenuOn = MENU_SPLASHWARNING\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiOut()\n\t\t\tSplash_Warning.guiIn()\n\n\t# Handle the warning splash screen.\n\tif( menuOn == MENU_SPLASHWARNING ):\n\t\tif( timer > warningTimer ):\n\t\t\tmenuOn = MENU_MAIN\n\t\t\ttimer = 0.0\n\t\t\tSplash_Warning.guiOut()\n\t\t\tMenu_Main.guiIn()\n\t\t\tsplashTween.start()\n\n\t# Increase the timer each frame.\n\ttimer += delta\n\n# Handle the input events.\nfunc _input( ev ):\n\t# Handle skip splash screens.\n\tif( !ev.is_pressed() and ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT ):\n\t\tif( menuOn == MENU_SPLASHTEAM5 || menuOn == MENU_SPLASHWARNING ):\n\t\t\ttimer = 999.0;\n\n\t# Handle exit.\n\tif( ev.is_action( \"ui_cancel\" ) ):\n\t\texit()\n\nfunc exit():\n\tprint( \"Exiting\" )\n\tOS.get_main_loop().quit()\n\nfunc _on_Exit_pressed():\n\texit()\n\n# TODO save to ConfigFile, load this on beginning\nfunc _on_Options_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Options.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_OPTIONS\n\tget_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\").set_text(str(network.port))\n\nfunc _on_Cancel_pressed():\n\tMenu_Options.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_SaveQuit_pressed():\n\t# Save the options.\n\n\tvar config = { name = get_node(\"OptionsMenu\/Panel\/OnlineName\/LineEdit\").get_text()\n\t\t\t\t , soundvolume = get_node(\"OptionsMenu\/Panel\/SoundVolume\/SoundSlider\").get_value()\n\t\t\t\t , musicvolume = get_node(\"OptionsMenu\/Panel\/MusicVolume\/MusicSlider\").get_value()\n\t\t\t\t , portnumber = get_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\").get_text()\n\t\t\t\t }\n\n\tpreload( \"res:\/\/scripts\/DataManager.gd\" ).new().saveConfig( config )\n\n\tvar field = get_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\")\n\tnetwork.setPort(field.get_text())\n\tnetwork.setPort(field.get_text())\n\t_on_Cancel_pressed()\n\nfunc _on_SP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Chooser.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_CHOOSER\n\nfunc _on_MainMenu_pressed():\n\tMenu_Chooser.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MainMenuMP_pressed():\n\tMenu_MP.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_MP.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MP\n\nfunc _on_MainMenuHG_pressed():\n\tMenu_HostGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\tnetwork.disconnect()\n\nfunc _on_HostGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_HostGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_HOSTGAME\n\n\tif !network.isHost and !network.isNetwork:\n\t\tprint(\"calling!\")\n\t\tnetwork.host(network.port)\n\t\tget_node(\"HostGame\/Panel\/Waiting\").set_text(\"Waiting for player to join on port \" + str(network.port) + \"...\")\n\nfunc _on_JoinGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_JoinGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_JOINGAME\n\nfunc _on_MainMenuJG_pressed():\n\tMenu_JoinGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\tif (network.isClient):\n\t\tnetwork.disconnect()\n\nfunc _on_RandomPuzzle_pressed(puzzle):\n\tvar root = get_tree().get_root()\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\troot.add_child( ResourceLoader.load( \"res:\/\/puzzleView.scn\" ).instance() )\n\n\tvar p = ResourceLoader.load( \"res:\/\/puzzle.scn\" ).instance()\n\tp.generateRandom = false\n\tp.get_node(\"GridView\/GridMan\").set_puzzle(puzzle)\n\troot.add_child( p )\n\tp.get_node(\"GridView\/GridMan\").setupCam()\n\n\nfunc _on_Join_pressed():\n\tvar IPPanel = get_node(\"JoinGame\/Panel\/IPAddress\")\n\tvar ip = IPPanel.get_text();\n\n\tif (ip.empty()):\n\t\treturn\n\n\tif !network.isClient:\n\t\tnetwork.connectTo(ip, network.port)\n\n\nfunc _on_Editor_pressed():\n\tvar root = get_tree().get_root()\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\troot.add_child( ResourceLoader.load( \"res:\/\/editor.scn\" ).instance() )\n\n\nfunc _on_LoadPuzzle_pressed():\n\tpreload(\"Editor.gd\").showLoadDialog(fileDialog, self)\n\n# called by the fileDialog\nfunc puzzleLoad():\n\tvar f = fileDialog.get_current_path()\n\tif f == null or f == \"\":\n\t\treturn\n\tprint(\"LOADING FROM \", f)\n\t_on_RandomPuzzle_pressed(preload(\"DataManager.gd\").loadPuzzle( f ))\n","old_contents":"# This script manages all of the GUI elements.\n# It switches between the states of the GUI allowing\n# the user to start games, edit the options or connect\n# to a multiplayer game.\n\nextends Node\n\n# network variables\nvar network\n\n# State variables.\nvar menuOn\nvar splashTween\n\n# Timers.\nvar timer\nvar initialWait = 0.5\nvar splashTimer = 2.0\nvar warningTimer = 5.0\n\n# GUI pieces.\nvar Splash_Team5\nvar Splash_Warning\nvar Menu_Main\nvar Menu_Chooser\nvar Menu_MP\nvar Menu_HostGame\nvar Menu_JoinGame\nvar Menu_Options\n\n# Menu state values. Used to switch between them.\nvar MENU_INIT\t\t\t= 0\nvar MENU_SPLASHTEAM5\t= 1\nvar MENU_SPLASHWARNING\t= 2\nvar MENU_MAIN\t\t\t= 3\nvar MENU_CHOOSER\t\t= 4\nvar MENU_MP\t\t\t\t= 5\nvar MENU_HOSTGAME\t\t= 6\nvar MENU_JOINGAME\t\t= 7\nvar MENU_OPTIONS\t\t= 8\n\n# Main Menu Theme\nvar samplePlayer = StreamPlayer.new()\nvar songs = [load(\"res:\/\/main_theme_antris.ogg\")]\n\nfunc skipTitle(skip):\n\tif skip:\n\t\tinitialWait = 0.01\n\t\tsplashTimer = 0.01\n\t\twarningTimer = 0.01\n\n# Function to be called once for setup.\nfunc _ready():\n\t# Initial setup.\n\tmenuOn = MENU_INIT\n\ttimer = 0.0\n\tset_process( true )\n\tset_process_input( true )\n\n\t# Setup the splash fader tween.\n\tsplashTween = Tween.new()\n\tget_node( \"SplashFader\" ).add_child( splashTween )\n\tsplashTween.interpolate_method( get_node( \"SplashFader\" ), \"set_opacity\", 1.0, 0.0, 1.0, Tween.TRANS_CUBIC, Tween.EASE_IN_OUT )\n\n\t# Gather all of the menus.\n\tSplash_Team5 = get_node( \"SplashTeam5\" )\n\tSplash_Warning = get_node( \"SplashWarning\" )\n\tMenu_Main = get_node( \"MainMenu\" )\n\tMenu_Chooser = get_node( \"ChooserMenu\" )\n\tMenu_MP = get_node( \"Multiplayer\" )\n\tMenu_HostGame = get_node( \"HostGame\" )\n\tMenu_JoinGame = get_node( \"JoinGame\" )\n\tMenu_Options = get_node( \"OptionsMenu\" )\n\n\tGlobals.set(\"Network\", load(\"res:\/\/scripts\/Network.gd\").new())\n\tnetwork = Globals.get(\"Network\")\n\n\tvar scn = load(\"res:\/\/networkProxy.scn\")\n\tadd_child(scn.instance())\n\tnetwork.root = get_tree().get_root()\n\n\t# Load the config.\n\tvar config = preload( \"res:\/\/scripts\/DataManager.gd\" ).new().loadConfig()\n\n\tget_node(\"OptionsMenu\/Panel\/OnlineName\/LineEdit\").set_text( config.name )\n\tget_node(\"OptionsMenu\/Panel\/SoundVolume\/SoundSlider\").set_value( config.soundvolume )\n\tget_node(\"OptionsMenu\/Panel\/MusicVolume\/MusicSlider\").set_value( config.musicvolume )\n\n\tnetwork.port = config.portnumber\n\n\t# Main Menu Theme\n\tadd_child(samplePlayer)\n\tsamplePlayer.set_stream(songs[0])\n\tsamplePlayer.play()\n\n# Function to update the GUI.\nfunc _process( delta ):\n\t# Handle the initial wait.\n\tif( menuOn == MENU_INIT ):\n\t\tif( timer > initialWait ):\n\t\t\tmenuOn = MENU_SPLASHTEAM5\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiIn()\n\n\t# Handle the Team5 splash screen.\n\tif( menuOn == MENU_SPLASHTEAM5 ):\n\t\tif( timer > splashTimer ):\n\t\t\tmenuOn = MENU_SPLASHWARNING\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiOut()\n\t\t\tSplash_Warning.guiIn()\n\n\t# Handle the warning splash screen.\n\tif( menuOn == MENU_SPLASHWARNING ):\n\t\tif( timer > warningTimer ):\n\t\t\tmenuOn = MENU_MAIN\n\t\t\ttimer = 0.0\n\t\t\tSplash_Warning.guiOut()\n\t\t\tMenu_Main.guiIn()\n\t\t\tsplashTween.start()\n\n\t# Increase the timer each frame.\n\ttimer += delta\n\n# Handle the input events.\nfunc _input( ev ):\n\t# Handle skip splash screens.\n\tif( !ev.is_pressed() and ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT ):\n\t\tif( menuOn == MENU_SPLASHTEAM5 || menuOn == MENU_SPLASHWARNING ):\n\t\t\ttimer = 999.0;\n\n\t# Handle exit.\n\tif( ev.is_action( \"ui_cancel\" ) ):\n\t\texit()\n\nfunc exit():\n\tprint( \"Exiting\" )\n\tOS.get_main_loop().quit()\n\nfunc _on_Exit_pressed():\n\texit()\n\n# TODO save to ConfigFile, load this on beginning\nfunc _on_Options_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Options.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_OPTIONS\n\tget_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\").set_text(str(network.port))\n\nfunc _on_Cancel_pressed():\n\tMenu_Options.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_SaveQuit_pressed():\n\t# Save the options.\n\n\tvar config = { name = get_node(\"OptionsMenu\/Panel\/OnlineName\/LineEdit\").get_text()\n\t\t\t\t , soundvolume = get_node(\"OptionsMenu\/Panel\/SoundVolume\/SoundSlider\").get_value()\n\t\t\t\t , musicvolume = get_node(\"OptionsMenu\/Panel\/MusicVolume\/MusicSlider\").get_value()\n\t\t\t\t , portnumber = get_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\").get_text()\n\t\t\t\t }\n\n\tpreload( \"res:\/\/scripts\/DataManager.gd\" ).new().saveConfig( config )\n\n\tvar field = get_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\")\n\tnetwork.setPort(field.get_text())\n\tnetwork.setPort(field.get_text())\n\t_on_Cancel_pressed()\n\nfunc _on_SP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Chooser.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_CHOOSER\n\nfunc _on_MainMenu_pressed():\n\tMenu_Chooser.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MainMenuMP_pressed():\n\tMenu_MP.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_MP.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MP\n\nfunc _on_MainMenuHG_pressed():\n\tMenu_HostGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\tnetwork.disconnect()\n\nfunc _on_HostGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_HostGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_HOSTGAME\n\n\tif !network.isHost and !network.isNetwork:\n\t\tprint(\"calling!\")\n\t\tnetwork.host(network.port)\n\t\tget_node(\"HostGame\/Panel\/Waiting\").set_text(\"Waiting for player to join on port \" + str(network.port) + \"...\")\n\nfunc _on_JoinGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_JoinGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_JOINGAME\n\nfunc _on_MainMenuJG_pressed():\n\tMenu_JoinGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\tif (network.isClient):\n\t\tnetwork.disconnect()\n\nfunc _on_RandomPuzzle_pressed():\n\tvar root = get_tree().get_root()\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\troot.add_child( ResourceLoader.load( \"res:\/\/puzzleView.scn\" ).instance() )\n\troot.add_child( ResourceLoader.load( \"res:\/\/puzzle.scn\" ).instance() )\n\n\nfunc _on_Join_pressed():\n\tvar IPPanel = get_node(\"JoinGame\/Panel\/IPAddress\")\n\tvar ip = IPPanel.get_text();\n\n\tif (ip.empty()):\n\t\treturn\n\n\tif !network.isClient:\n\t\tnetwork.connectTo(ip, network.port)\n\n\nfunc _on_Editor_pressed():\n\tvar root = get_tree().get_root()\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\troot.add_child( ResourceLoader.load( \"res:\/\/editor.scn\" ).instance() )\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"ade3c2af608768448f408778b59506e975dc94b8","subject":"Add check against gridvie wnot being the acgive grid view","message":"Add check against gridvie wnot being the acgive grid view\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/GridView.gd","new_file":"src\/scripts\/GridView.gd","new_contents":"\n\n# global working variables\nvar turn = Vector2( 0.0, 0.0 ) # the amount the mouse has turned\nvar mouseposlast = Input.get_mouse_pos() # the mouses last position\n\n# global tweakable parameters\nvar orbitrate = 10 # the rate the camera orbits the target when the mouse is moved\nvar active = true\nvar offClick = false\nvar selectedBlocks = []\n\nfunc _ready():\n\t# Initalization here\n\tset_process_input(true) # process user input events here\n\n# called to handle a user input event\nfunc _input(ev):\n\tif (not active):\n\t\treturn\n\t# If the mouse has been moved\n\tif (ev.type==InputEvent.SCREEN_DRAG or (ev.type==InputEvent.MOUSE_MOTION and ev.button_mask == 1)):\n\t\t# calculate the delta change from the last mouse movement\n\t\tvar mousedelta = (mouseposlast - ev.pos)\n\t\t# scale the mouse delta to a useful value\n\t\tturn = mousedelta \/ orbitrate\n\t\t# perform the rotation\n\t\tvar currentTransform = get_transform().basis\n\t\tvar dtime = get_process_delta_time()\n\t\tcurrentTransform = Matrix3( Vector3(0, 1, 0), PI * turn.x * dtime ) * currentTransform\n\t\tcurrentTransform = Matrix3( Vector3(1, 0, 0), PI * turn.y * dtime ) * currentTransform\n\t\tset_transform( Transform( currentTransform ) )\n\n\t\t# record the last position of the mousedelta\n\n\tif (ev.type==InputEvent.SCREEN_DRAG or ev.type==InputEvent.MOUSE_MOTION or ev.type==InputEvent.JOYSTICK_MOTION or ev.type==InputEvent.SCREEN_TOUCH):\n\t\tmouseposlast = ev.pos\n\t# Android does not like this: Input.get_mouse_pos()\n\nfunc clearSelection():\n\tfor bl in selectedBlocks:\n\t\tvar blo = get_node(\"GridMan\/\" + bl)\n\t\tprint(\"this bothers Hugo\")\n\t\tblo.setSelected(false)\n\t\tblo.scaleTweenNode(1.0).start()\n\tselectedBlocks = []\n\t\nfunc addSelected(bl):\n\tselectedBlocks.append(bl)\n","old_contents":"\n\n# global working variables\nvar turn = Vector2( 0.0, 0.0 ) # the amount the mouse has turned\nvar mouseposlast = Input.get_mouse_pos() # the mouses last position\n\n# global tweakable parameters\nvar orbitrate = 10 # the rate the camera orbits the target when the mouse is moved\nvar active = true\nvar offClick = false\nvar selectedBlocks = []\n\nfunc _ready():\n\t# Initalization here\n\tset_process_input(true) # process user input events here\n\n# called to handle a user input event\nfunc _input(ev):\n\t# If the mouse has been moved\n\tif (ev.type==InputEvent.SCREEN_DRAG or (ev.type==InputEvent.MOUSE_MOTION and ev.button_mask == 1)):\n\t\t# calculate the delta change from the last mouse movement\n\t\tvar mousedelta = (mouseposlast - ev.pos)\n\t\t# scale the mouse delta to a useful value\n\t\tturn = mousedelta \/ orbitrate\n\t\t# perform the rotation\n\t\tvar currentTransform = get_transform().basis\n\t\tvar dtime = get_process_delta_time()\n\t\tcurrentTransform = Matrix3( Vector3(0, 1, 0), PI * turn.x * dtime ) * currentTransform\n\t\tcurrentTransform = Matrix3( Vector3(1, 0, 0), PI * turn.y * dtime ) * currentTransform\n\t\tset_transform( Transform( currentTransform ) )\n\n\t\t# record the last position of the mousedelta\n\n\tif (ev.type==InputEvent.SCREEN_DRAG or ev.type==InputEvent.MOUSE_MOTION or ev.type==InputEvent.JOYSTICK_MOTION or ev.type==InputEvent.SCREEN_TOUCH):\n\t\tmouseposlast = ev.pos\n\t# Android does not like this: Input.get_mouse_pos()\n\nfunc clearSelection():\n\tfor bl in selectedBlocks:\n\t\tvar blo = get_node(\"GridMan\/\" + bl)\n\t\tprint(\"this bothers Hugo\")\n\t\tblo.setSelected(false)\n\t\tblo.scaleTweenNode(1.0).start()\n\tselectedBlocks = []\n\t\nfunc addSelected(bl):\n\tselectedBlocks.append(bl)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"671683c3da270750753b4b151c087786f071400c","subject":"Minor fix.","message":"Minor fix.\n\nFix.\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/GUIManager.gd","new_file":"src\/scripts\/GUIManager.gd","new_contents":"# This script manages all of the GUI elements.\n# It switches between the states of the GUI allowing\n# the user to start games, edit the options or connect\n# to a multiplayer game.\n\nextends Node\n\n# network variables\nvar network\n\n# State variables.\nvar menuOn\nvar splashTween\n\n# Timers.\nvar timer\nvar initialWait = 0.5\nvar splashTimer = 2.0\nvar warningTimer = 5.0\n\n# GUI pieces.\nvar Splash_Team5\nvar Splash_Warning\nvar Menu_Main\nvar Menu_Chooser\nvar Menu_MP\nvar Menu_HostGame\nvar Menu_JoinGame\nvar Menu_Options\n\n# Menu state values. Used to switch between them.\nvar MENU_INIT\t\t\t= 0\nvar MENU_SPLASHTEAM5\t= 1\nvar MENU_SPLASHWARNING\t= 2\nvar MENU_MAIN\t\t\t= 3\nvar MENU_CHOOSER\t\t= 4\nvar MENU_MP\t\t\t\t= 5\nvar MENU_HOSTGAME\t\t= 6\nvar MENU_JOINGAME\t\t= 7\nvar MENU_OPTIONS\t\t= 8\n\n# Main Menu Theme\nvar samplePlayer = StreamPlayer.new()\nvar songs = [load(\"res:\/\/main_theme_antris.ogg\")]\n\n# Loader dialog\nvar saveDir\nvar fileDialog\n\nfunc skipTitle(skip):\n\tif skip:\n\t\tinitialWait = 0.01\n\t\tsplashTimer = 0.01\n\t\twarningTimer = 0.01\n\n# Function to be called once for setup.\nfunc _ready():\n\t# Initial setup.\n\tmenuOn = MENU_INIT\n\ttimer = 0.0\n\tset_process( true )\n\tset_process_input( true )\n\n\t# Setup the splash fader tween.\n\tsplashTween = Tween.new()\n\tget_node( \"SplashFader\" ).add_child( splashTween )\n\tsplashTween.interpolate_method( get_node( \"SplashFader\" ), \"set_opacity\", 1.0, 0.0, 1.0, Tween.TRANS_CUBIC, Tween.EASE_IN_OUT )\n\n\t# Gather all of the menus.\n\tSplash_Team5 = get_node( \"SplashTeam5\" )\n\tSplash_Warning = get_node( \"SplashWarning\" )\n\tMenu_Main = get_node( \"MainMenu\" )\n\tMenu_Chooser = get_node( \"ChooserMenu\" )\n\tMenu_MP = get_node( \"Multiplayer\" )\n\tMenu_HostGame = get_node( \"HostGame\" )\n\tMenu_JoinGame = get_node( \"JoinGame\" )\n\tMenu_Options = get_node( \"OptionsMenu\" )\n\n\tGlobals.set(\"Network\", load(\"res:\/\/scripts\/Network.gd\").new())\n\tnetwork = Globals.get(\"Network\")\n\n\tvar scn = load(\"res:\/\/networkProxy.scn\")\n\tadd_child(scn.instance())\n\tnetwork.root = get_tree().get_root()\n\n\t# Load the config.\n\tvar config = preload( \"res:\/\/scripts\/DataManager.gd\" ).new().loadConfig()\n\n\tget_node(\"OptionsMenu\/Panel\/OnlineName\/LineEdit\").set_text( config.name )\n\tget_node(\"OptionsMenu\/Panel\/SoundVolume\/SoundSlider\").set_value( config.soundvolume )\n\tget_node(\"OptionsMenu\/Panel\/MusicVolume\/MusicSlider\").set_value( config.musicvolume )\n\n\tnetwork.port = config.portnumber\n\n\t# Prepare puzzle loader dialog\n\tsaveDir = OS.get_data_dir() + \"\/PuzzleSaves\"\n\tfileDialog = preload(\"Editor.gd\").initLoadSaveDialog(self, get_tree(), saveDir)\n\n\t# Main Menu Theme\n\tGlobals.set(\"StreamPlayer\", samplePlayer)\n\tadd_child(samplePlayer)\n\tsamplePlayer.set_stream(songs[0])\n\tsamplePlayer.play()\n\n# Function to update the GUI.\nfunc _process( delta ):\n\t# Handle the initial wait.\n\tif( menuOn == MENU_INIT ):\n\t\tif( timer > initialWait ):\n\t\t\tmenuOn = MENU_SPLASHTEAM5\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiIn()\n\n\t# Handle the Team5 splash screen.\n\tif( menuOn == MENU_SPLASHTEAM5 ):\n\t\tif( timer > splashTimer ):\n\t\t\tmenuOn = MENU_SPLASHWARNING\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiOut()\n\t\t\tSplash_Warning.guiIn()\n\n\t# Handle the warning splash screen.\n\tif( menuOn == MENU_SPLASHWARNING ):\n\t\tif( timer > warningTimer ):\n\t\t\tmenuOn = MENU_MAIN\n\t\t\ttimer = 0.0\n\t\t\tSplash_Warning.guiOut()\n\t\t\tMenu_Main.guiIn()\n\t\t\tsplashTween.start()\n\n\t# Increase the timer each frame.\n\ttimer += delta\n\n# Handle the input events.\nfunc _input( ev ):\n\t# Handle skip splash screens.\n\tif( !ev.is_pressed() and ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT ):\n\t\tif( menuOn == MENU_SPLASHTEAM5 || menuOn == MENU_SPLASHWARNING ):\n\t\t\ttimer = 999.0;\n\n\t# Handle exit.\n\tif( ev.is_action( \"ui_cancel\" ) ):\n\t\texit()\n\nfunc exit():\n\tprint( \"Exiting\" )\n\tOS.get_main_loop().quit()\n\nfunc _on_Exit_pressed():\n\texit()\n\n# TODO save to ConfigFile, load this on beginning\nfunc _on_Options_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Options.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_OPTIONS\n\tget_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\").set_text(str(network.port))\n\nfunc _on_Cancel_pressed():\n\tMenu_Options.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_SaveQuit_pressed():\n\t# Save the options.\n\n\tvar config = { name = get_node(\"OptionsMenu\/Panel\/OnlineName\/LineEdit\").get_text()\n\t\t\t\t , soundvolume = get_node(\"OptionsMenu\/Panel\/SoundVolume\/SoundSlider\").get_value()\n\t\t\t\t , musicvolume = get_node(\"OptionsMenu\/Panel\/MusicVolume\/MusicSlider\").get_value()\n\t\t\t\t , portnumber = get_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\").get_text()\n\t\t\t\t }\n\n\tpreload( \"res:\/\/scripts\/DataManager.gd\" ).new().saveConfig( config )\n\n\tvar field = get_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\")\n\tnetwork.setPort(field.get_text())\n\tnetwork.setPort(field.get_text())\n\t_on_Cancel_pressed()\n\nfunc _on_SP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Chooser.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_CHOOSER\n\nfunc _on_MainMenu_pressed():\n\tMenu_Chooser.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MainMenuMP_pressed():\n\tMenu_MP.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_MP.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MP\n\nfunc _on_MainMenuHG_pressed():\n\tMenu_HostGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\tnetwork.disconnect()\n\nfunc _on_HostGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_HostGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_HOSTGAME\n\n\tif !network.isHost and !network.isNetwork:\n\t\tprint(\"calling!\")\n\t\tnetwork.host(network.port)\n\t\tget_node(\"HostGame\/Panel\/Waiting\").set_text(\"Waiting for player to join on port \" + str(network.port) + \"...\")\n\nfunc _on_JoinGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_JoinGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_JOINGAME\n\nfunc _on_MainMenuJG_pressed():\n\tMenu_JoinGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\tif (network.isClient):\n\t\tnetwork.disconnect()\n\nfunc _on_RandomPuzzle_pressed(puzzle=null):\n\tgotoPuzzleScene(get_tree().get_root(), false, puzzle)\n\nstatic func gotoPuzzleScene(root, networked=false, puzzle=null):\n\tvar p = load( \"res:\/\/puzzle.scn\" ).instance()\n\tp.mainPuzzle = networked\n\n\tif puzzle != null:\n\t\tp.generateRandom = false\n\t\tp.get_node(\"GridView\/GridMan\").set_puzzle(puzzle)\n\t\tp.get_node(\"GridView\/GridMan\").setupCam()\n\n\t# called on idle time\n\tgoto_scene(root.get_tree(), [load(\"res:\/\/puzzleView.scn\").instance(), p])\n\nstatic func goto_scene(tree, scenes, freeAll=false):\n\tvar root = tree.get_root()\n\n\tif freeAll:\n\t\tfor child in root.get_children():\n\t\t\tchild.queue_free()\n\telse:\n\t\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\tfor scn in scenes:\n\t\tscn.set_owner(root)\n\t\troot.call_deferred(\"add_child\", scn )\n\nfunc _on_Join_pressed():\n\tvar IPPanel = get_node(\"JoinGame\/Panel\/IPAddress\")\n\tvar ip = IPPanel.get_text();\n\n\tif (ip.empty()):\n\t\treturn\n\n\tif !network.isClient:\n\t\tnetwork.connectTo(ip, network.port)\n\n\nfunc _on_Editor_pressed():\n\t# called on idle time\n\tgoto_scene(get_tree(), [load(\"res:\/\/editor.scn\").instance()])\n\nfunc _on_LoadPuzzle_pressed():\n\tpreload(\"Editor.gd\").showLoadDialog(fileDialog, self)\n\n# called by the fileDialog\nfunc puzzleLoad():\n\tvar f = fileDialog.get_current_path()\n\tif f == null or f == \"\":\n\t\treturn\n\tprint(\"LOADING FROM \", f)\n\t_on_RandomPuzzle_pressed(preload(\"DataManager.gd\").loadPuzzle( f ))\n","old_contents":"# This script manages all of the GUI elements.\n# It switches between the states of the GUI allowing\n# the user to start games, edit the options or connect\n# to a multiplayer game.\n\nextends Node\n\n# network variables\nvar network\n\n# State variables.\nvar menuOn\nvar splashTween\n\n# Timers.\nvar timer\nvar initialWait = 0.5\nvar splashTimer = 2.0\nvar warningTimer = 5.0\n\n# GUI pieces.\nvar Splash_Team5\nvar Splash_Warning\nvar Menu_Main\nvar Menu_Chooser\nvar Menu_MP\nvar Menu_HostGame\nvar Menu_JoinGame\nvar Menu_Options\n\n# Menu state values. Used to switch between them.\nvar MENU_INIT\t\t\t= 0\nvar MENU_SPLASHTEAM5\t= 1\nvar MENU_SPLASHWARNING\t= 2\nvar MENU_MAIN\t\t\t= 3\nvar MENU_CHOOSER\t\t= 4\nvar MENU_MP\t\t\t\t= 5\nvar MENU_HOSTGAME\t\t= 6\nvar MENU_JOINGAME\t\t= 7\nvar MENU_OPTIONS\t\t= 8\n\n# Main Menu Theme\nvar samplePlayer = StreamPlayer.new()\nvar songs = [load(\"res:\/\/main_theme_antris.ogg\")]\n\n# Loader dialog\nvar saveDir\nvar fileDialog\n\nfunc skipTitle(skip):\n\tif skip:\n\t\tinitialWait = 0.01\n\t\tsplashTimer = 0.01\n\t\twarningTimer = 0.01\n\n# Function to be called once for setup.\nfunc _ready():\n\t# Initial setup.\n\tmenuOn = MENU_INIT\n\ttimer = 0.0\n\tset_process( true )\n\tset_process_input( true )\n\n\t# Setup the splash fader tween.\n\tsplashTween = Tween.new()\n\tget_node( \"SplashFader\" ).add_child( splashTween )\n\tsplashTween.interpolate_method( get_node( \"SplashFader\" ), \"set_opacity\", 1.0, 0.0, 1.0, Tween.TRANS_CUBIC, Tween.EASE_IN_OUT )\n\n\t# Gather all of the menus.\n\tSplash_Team5 = get_node( \"SplashTeam5\" )\n\tSplash_Warning = get_node( \"SplashWarning\" )\n\tMenu_Main = get_node( \"MainMenu\" )\n\tMenu_Chooser = get_node( \"ChooserMenu\" )\n\tMenu_MP = get_node( \"Multiplayer\" )\n\tMenu_HostGame = get_node( \"HostGame\" )\n\tMenu_JoinGame = get_node( \"JoinGame\" )\n\tMenu_Options = get_node( \"OptionsMenu\" )\n\n\tGlobals.set(\"Network\", load(\"res:\/\/scripts\/Network.gd\").new())\n\tnetwork = Globals.get(\"Network\")\n\n\tvar scn = load(\"res:\/\/networkProxy.scn\")\n\tadd_child(scn.instance())\n\tnetwork.root = get_tree().get_root()\n\n\t# Load the config.\n\tvar config = preload( \"res:\/\/scripts\/DataManager.gd\" ).new().loadConfig()\n\n\tget_node(\"OptionsMenu\/Panel\/OnlineName\/LineEdit\").set_text( config.name )\n\tget_node(\"OptionsMenu\/Panel\/SoundVolume\/SoundSlider\").set_value( config.soundvolume )\n\tget_node(\"OptionsMenu\/Panel\/MusicVolume\/MusicSlider\").set_value( config.musicvolume )\n\n\tnetwork.port = config.portnumber\n\n\t# Prepare puzzle loader dialog\n\tsaveDir = OS.get_data_dir() + \"\/PuzzleSaves\"\n\tfileDialog = preload(\"Editor.gd\").initLoadSaveDialog(self, get_tree(), saveDir)\n\n\t# Main Menu Theme\n\tGlobals.set(\"StreamPlayer\", samplePlayer)\n\tadd_child(samplePlayer)\n\tsamplePlayer.set_stream(songs[0])\n\tsamplePlayer.play()\n\n# Function to update the GUI.\nfunc _process( delta ):\n\t# Handle the initial wait.\n\tif( menuOn == MENU_INIT ):\n\t\tif( timer > initialWait ):\n\t\t\tmenuOn = MENU_SPLASHTEAM5\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiIn()\n\n\t# Handle the Team5 splash screen.\n\tif( menuOn == MENU_SPLASHTEAM5 ):\n\t\tif( timer > splashTimer ):\n\t\t\tmenuOn = MENU_SPLASHWARNING\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiOut()\n\t\t\tSplash_Warning.guiIn()\n\n\t# Handle the warning splash screen.\n\tif( menuOn == MENU_SPLASHWARNING ):\n\t\tif( timer > warningTimer ):\n\t\t\tmenuOn = MENU_MAIN\n\t\t\ttimer = 0.0\n\t\t\tSplash_Warning.guiOut()\n\t\t\tMenu_Main.guiIn()\n\t\t\tsplashTween.start()\n\n\t# Increase the timer each frame.\n\ttimer += delta\n\n# Handle the input events.\nfunc _input( ev ):\n\t# Handle skip splash screens.\n\tif( !ev.is_pressed() and ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT ):\n\t\tif( menuOn == MENU_SPLASHTEAM5 || menuOn == MENU_SPLASHWARNING ):\n\t\t\ttimer = 999.0;\n\n\t# Handle exit.\n\tif( ev.is_action( \"ui_cancel\" ) ):\n\t\texit()\n\nfunc exit():\n\tprint( \"Exiting\" )\n\tOS.get_main_loop().quit()\n\nfunc _on_Exit_pressed():\n\texit()\n\n# TODO save to ConfigFile, load this on beginning\nfunc _on_Options_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Options.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_OPTIONS\n\tget_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\").set_text(str(network.port))\n\nfunc _on_Cancel_pressed():\n\tMenu_Options.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_SaveQuit_pressed():\n\t# Save the options.\n\n\tvar config = { name = get_node(\"OptionsMenu\/Panel\/OnlineName\/LineEdit\").get_text()\n\t\t\t\t , soundvolume = get_node(\"OptionsMenu\/Panel\/SoundVolume\/SoundSlider\").get_value()\n\t\t\t\t , musicvolume = get_node(\"OptionsMenu\/Panel\/MusicVolume\/MusicSlider\").get_value()\n\t\t\t\t , portnumber = get_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\").get_text()\n\t\t\t\t }\n\n\tpreload( \"res:\/\/scripts\/DataManager.gd\" ).new().saveConfig( config )\n\n\tvar field = get_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\")\n\tnetwork.setPort(field.get_text())\n\tnetwork.setPort(field.get_text())\n\t_on_Cancel_pressed()\n\nfunc _on_SP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Chooser.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_CHOOSER\n\nfunc _on_MainMenu_pressed():\n\tMenu_Chooser.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MainMenuMP_pressed():\n\tMenu_MP.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_MP.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MP\n\nfunc _on_MainMenuHG_pressed():\n\tMenu_HostGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\tnetwork.disconnect()\n\nfunc _on_HostGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_HostGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_HOSTGAME\n\n\tif !network.isHost and !network.isNetwork:\n\t\tprint(\"calling!\")\n\t\tnetwork.host(network.port)\n\t\tget_node(\"HostGame\/Panel\/Waiting\").set_text(\"Waiting for player to join on port \" + str(network.port) + \"...\")\n\nfunc _on_JoinGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_JoinGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_JOINGAME\n\nfunc _on_MainMenuJG_pressed():\n\tMenu_JoinGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\tif (network.isClient):\n\t\tnetwork.disconnect()\n\nfunc _on_RandomPuzzle_pressed(puzzle=null):\n\tgotoPuzzleScene(get_tree().get_root(), false, puzzle)\n\nstatic func gotoPuzzleScene(root, networked=false, puzzle=null):\n\tvar p = load( \"res:\/\/puzzle.scn\" ).instance()\n\tp.mainPuzzle = networked\n\n\tif puzzle != null:\n\t\tp.generateRandom = false\n\t\tp.get_node(\"GridView\/GridMan\").set_puzzle(puzzle)\n\t\tp.get_node(\"GridView\/GridMan\").setupCam()\n\n\t# called on idle time\n\tgoto_scene(root.get_tree(), [load(\"res:\/\/puzzleView.scn\").instance(), p])\n\nstatic func goto_scene(tree, scenes, freeAll=false):\n\tvar root = tree.get_root()\n\troot.print_tree()\n\tif freeAll:\n\t\tfor child in root.get_children():\n\t\t\tchild.queue_free()\n\telse:\n\t\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\tfor scn in scenes:\n\t\tscn.set_owner(root)\n\t\troot.call_deferred(\"add_child\", scn )\n\nfunc _on_Join_pressed():\n\tvar IPPanel = get_node(\"JoinGame\/Panel\/IPAddress\")\n\tvar ip = IPPanel.get_text();\n\n\tif (ip.empty()):\n\t\treturn\n\n\tif !network.isClient:\n\t\tnetwork.connectTo(ip, network.port)\n\n\nfunc _on_Editor_pressed():\n\t# called on idle time\n\tgoto_scene(get_tree(), [load(\"res:\/\/editor.scn\").instance()])\n\nfunc _on_LoadPuzzle_pressed():\n\tpreload(\"Editor.gd\").showLoadDialog(fileDialog, self)\n\n# called by the fileDialog\nfunc puzzleLoad():\n\tvar f = fileDialog.get_current_path()\n\tif f == null or f == \"\":\n\t\treturn\n\tprint(\"LOADING FROM \", f)\n\t_on_RandomPuzzle_pressed(preload(\"DataManager.gd\").loadPuzzle( f ))\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"63c635cef5dfa5dd14fe7b25706fa33eca2c56d0","subject":"Fade black background too using alpha","message":"Fade black background too using alpha\n","repos":"mvr\/abyme","old_file":"Constants.gd","new_file":"Constants.gd","new_contents":"extends Node\n\n# Gameplay\n\nvar block_size = 5\n\n# Drawing\nvar background_fade = Color(0.5, 0.5, 0.5, 0.5)\nvar player_highlight = Color(0.5, 0, 0)\n\n# Animation\n\nvar camera_lerp = 1.5\nvar camera_zoom_lerp = 2.0\nvar move_duration = 0.5\n","old_contents":"extends Node\n\n# Gameplay\n\nvar block_size = 5\n\n# Drawing\nvar background_fade = Color(0.5, 0.5, 0.5)\nvar player_highlight = Color(0.5, 0, 0)\n\n# Animation\n\nvar camera_lerp = 1.5\nvar camera_zoom_lerp = 2.0\nvar move_duration = 0.5\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"GDScript"} {"commit":"3b9e2733e3d42bedb15b7e5e40df2c97ec8a362d","subject":"Adds animation tests.","message":"Adds animation tests.\n","repos":"godotengine\/godot-tests,godotengine\/godot-tests","old_file":"tests\/blend_export\/test_45545.gd","new_file":"tests\/blend_export\/test_45545.gd","new_contents":"extends ColorRect\n\nconst GOLDEN_GLTF_SCENE: PackedScene = preload(\"res:\/\/gltf\/45545-relax-name-sanitization.gltf\")\n\n## These constants are the prefix part of the node names used in the golden glTF file.\n# Prefix for \"basic\" nodes, no import hints, no animation, etc...\nconst GLTF_PREFIX_BASIC: String = \"Basic_\"\n\n# Prefix for nodes that have an import hint.\nconst GLTF_PREFIX_HINTED: String = \"Hinted_\"\n\n# Prefix for nodes that have an associated animation.\nconst GLTF_PREFIX_ANIMATED: String = \"Animated_\"\n\n# The suffix for animations (all animations in the golden glTF file use the Blender default suffix\n# \"Action\" and the looping import hint \"-loop\".\nconst GLTF_SUFFIX_ANIMATION: String = \"Action-loop\"\n\n## These constants are the infix part of the node names used in the golden glTF file.\nconst GLTF_ALPHANUMERIC: String = \"Alphanumeric123\"\n# The last three symbols are:\n# https:\/\/en.wiktionary.org\/wiki\/%E3%82%B4#Japanese\n# https:\/\/en.wiktionary.org\/wiki\/%E3%83%89#Japanese\n# https:\/\/en.wiktionary.org\/wiki\/%E3%83%84#Japanese\nconst GLTF_KATAKANA: String = \"Katakana_\u30b4\u30c9\u30c4\"\n# The last two symbols are:\n# https:\/\/emojipedia.org\/grinning-face\n# https:\/\/emojipedia.org\/robot\/\nconst GLTF_EMOJI: String = \"Emoji_\ud83d\ude00\ud83e\udd16\"\nconst GLTF_ALLOWED_SYMBOLS: String = \"AllowedSymbols_!#$%^&*()-=[]{}';<>,~\"\nconst GLTF_DISALLOWED_NONCLASHING: String = \"Disallowed_Non-clashing_.:@\\\"\/\"\nconst GLTF_DISALLOWED_CLASHING_1: String = \"Disallowed_Clashing_.\"\nconst GLTF_DISALLOWED_CLASHING_2: String = \"Disallowed_Clashing_@\"\nconst GLTF_DISALLOWED_CLASHING_DEEP_TREE_1: String = \"Disallowed_Clashing_Deep_Tree_@\"\nconst GLTF_DISALLOWED_CLASHING_DEEP_TREE_2: String = \"Disallowed_Clashing_Deep_Tree_@@\"\nconst GLTF_DISALLOWED_CLASHING_DEEP_TREE_3: String = \"Disallowed_Clashing_Deep_Tree_@@@\"\n\nvar output: BoxContainer\nvar test_scene: Node\nvar test_animation_player: AnimationPlayer\n\n\nfunc _ready():\n\toutput = $ScrollContainer\/OutputWindow\n\ttest_scene = GOLDEN_GLTF_SCENE.instance()\n\ttest_animation_player = test_scene.get_node_or_null(\"AnimationPlayer\")\n\tif not test_animation_player:\n\t\t_add_line(\"ERROR: imported glTF scene has no AnimationPlayer node!\", Color.orangered)\n\t\tprint(\"FAIL: imported glTF scene has no AnimationPlayer so no tests will be run.\")\n\t\treturn\n\n\tvar passed_tests: Array = []\n\tvar failed_tests: Array = []\n\n\tfor method_name in _find_tests():\n\t\t_add_test_header(method_name)\n\t\tvar result: bool = self.call(method_name)\n\t\t_add_line(\" \")\n\t\tif result:\n\t\t\tpassed_tests.push_back(method_name)\n\t\telse:\n\t\t\tfailed_tests.push_back(method_name)\n\n\tif failed_tests:\n\t\tprint(\"FAIL: %d failed tests:\" % len(failed_tests))\n\t\tfor test in failed_tests:\n\t\t\tprint(\"\\t%s\" % test)\n\t\tprint(\"\")\n\t\tprint(\"Animations:\")\n\t\tfor animation_name in test_animation_player.get_animation_list():\n\t\t\tprint(\"\\t%s\" % animation_name)\n\telse:\n\t\tprint(\"PASS: Passed all %d tests\" % len(passed_tests))\n\n\nfunc _find_tests() -> Array:\n\tvar ret: Array = []\n\tfor method in get_method_list():\n\t\tvar method_name: String = method.get(\"name\")\n\t\tif method_name.begins_with(\"_test_\"):\n\t\t\tret.push_back(method_name)\n\tret.sort()\n\treturn ret\n\n\nfunc _add_test_header(method_name: String) -> void:\n\t_add_line(method_name, Color.royalblue)\n\n\nfunc _add_result(succeeded: bool, message: String) -> void:\n\tvar prefix: String = \" [OK] \" if succeeded else \" [FAIL] \"\n\t_add_line(prefix + message, Color.forestgreen if succeeded else Color.orangered)\n\n\nfunc _add_line(text: String, font_color: Color = Color.black) -> void:\n\tvar line: Label = Label.new()\n\tline.text = text\n\tline.add_theme_font_size_override(\"font_size\", 22)\n\tline.add_theme_color_override(\"font_color\", font_color)\n\toutput.add_child(line)\n\n\nfunc _check_basic(original: String, expected: String) -> bool:\n\tvar node: Node = test_scene.get_node_or_null(expected)\n\tif not node:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Missing expected Godot node '%s' for glTF node '%s'\" % [expected, original])\n\t\treturn false\n\t_add_result(true, \"Found expected node '%s'\" % expected)\n\treturn true\n\n\nfunc _test_basic_alphanumeric_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_ALPHANUMERIC\n\tvar expected: String = original\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_allowed_symbols_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_ALLOWED_SYMBOLS\n\tvar expected: String = original\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_katakana_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_KATAKANA\n\tvar expected: String = original\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_emoji_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_EMOJI\n\tvar expected: String = original\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_disallowed_characters_are_stripped() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_NONCLASHING\n\tvar expected: String = GLTF_PREFIX_BASIC + \"Disallowed_Non-clashing_\"\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_disallowed_clashing_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_1\n\tvar expected: String = GLTF_PREFIX_BASIC + \"Disallowed_Clashing_\"\n\tif not _check_basic(original, expected):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_2\n\texpected = GLTF_PREFIX_BASIC + \"Disallowed_Clashing_2\"\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_disallowed_nested_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_DEEP_TREE_1\n\tvar expected_root: String = GLTF_PREFIX_BASIC + \"Disallowed_Clashing_Deep_Tree_\"\n\tif not _check_basic(original, expected_root):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_DEEP_TREE_2\n\tvar expected_mid = expected_root + \"\/\" + GLTF_PREFIX_BASIC + \"Disallowed_Clashing_Deep_Tree_2\"\n\tif not _check_basic(original, expected_mid):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_DEEP_TREE_3\n\tvar expected_leaf = expected_mid + \"\/\" + GLTF_PREFIX_BASIC + \"Disallowed_Clashing_Deep_Tree_3\"\n\treturn _check_basic(original, expected_leaf)\n\n\n# Verifies that a node exists with the expected name and that it has a StaticBody3D child.\nfunc _check_hinted_col(original: String, expected: String) -> bool:\n\tvar node: Node = test_scene.get_node_or_null(expected)\n\tif not node:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Missing expected Godot node '%s' for glTF node '%s'\" % [expected, original])\n\t\treturn false\n\n\tvar collision_body: StaticBody3D = node.get_node_or_null(\"static_collision\")\n\tif not collision_body:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Missing 'static_collision' child for Godot node '%s' (glTF '%s')\" % [\n\t\t\t\texpected, original])\n\t\treturn false\n\n\t# This test assumes that if the static_collision node was created the -col hint was properly\n\t# handled (as that behavior should be tested elsewhere).\n\t_add_result(true, \"Expected node '%s' contains a static_collision StaticBody3D\" % expected)\n\treturn true\n\n\nfunc _test_hinted_alphanumeric_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_ALPHANUMERIC\n\tvar expected: String = original\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_allowed_symbols_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_ALLOWED_SYMBOLS\n\tvar expected: String = original\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_katakana_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_KATAKANA\n\tvar expected: String = original\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_emoji_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_EMOJI\n\tvar expected: String = original\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_disallowed_characters_are_stripped() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_DISALLOWED_NONCLASHING\n\tvar expected: String = GLTF_PREFIX_HINTED + \"Disallowed_Non-clashing_\"\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_disallowed_clashing_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_DISALLOWED_CLASHING_1\n\tvar expected: String = GLTF_PREFIX_HINTED + \"Disallowed_Clashing_\"\n\tif not _check_hinted_col(original, expected):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_HINTED + GLTF_DISALLOWED_CLASHING_2\n\texpected = GLTF_PREFIX_HINTED + \"Disallowed_Clashing_2\"\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_disallowed_nested_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_HINTED + GLTF_DISALLOWED_CLASHING_DEEP_TREE_1\n\tvar expected_root: String = GLTF_PREFIX_HINTED + \"Disallowed_Clashing_Deep_Tree_\"\n\tif not _check_hinted_col(original, expected_root):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_HINTED + GLTF_DISALLOWED_CLASHING_DEEP_TREE_2\n\tvar expected_mid = expected_root + \"\/\" + GLTF_PREFIX_HINTED + \"Disallowed_Clashing_Deep_Tree_2\"\n\tif not _check_hinted_col(original, expected_mid):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_HINTED + GLTF_DISALLOWED_CLASHING_DEEP_TREE_3\n\tvar expected_leaf = expected_mid + \"\/\" + GLTF_PREFIX_HINTED + \"Disallowed_Clashing_Deep_Tree_3\"\n\treturn _check_hinted_col(original, expected_leaf)\n\n\n# Verifies that a node exists with the expected name and that an associated animation exists.\nfunc _check_animated(original: String, expected: String) -> bool:\n\tvar node: Node = test_scene.get_node_or_null(expected)\n\tif not node:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Missing expected Godot node '%s' for glTF node '%s'\" % [expected, original])\n\t\treturn false\n\n\tvar expected_animation: String = expected + GLTF_SUFFIX_ANIMATION\n\tvar animation: Animation = test_animation_player.get_animation(expected_animation)\n\tif not animation:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Missing expected animation '%s' for Godot node '%s' (glTF '%s')\" % [\n\t\t\t\texpected_animation, expected, original])\n\t\treturn false\n\n\tvar track_count: int = animation.get_track_count()\n\tif track_count != 1:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Track count %d != 1 on animation '%s' for Godot node '%s' (glTF '%s')\" % [\n\t\t\t\ttrack_count, expected_animation, expected, original])\n\t\treturn false\n\n\tvar track_type: int = animation.track_get_type(0)\n\tif track_type != Animation.TYPE_TRANSFORM:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Unexpected track type %d on animation '%s' for Godot node '%s' (glTF '%s')\" % [\n\t\t\t\ttrack_type, expected_animation, expected, original])\n\t\treturn false\n\n\tvar track_path: NodePath = animation.track_get_path(0)\n\tvar expected_track_path = NodePath(expected)\n\tif track_path != expected_track_path:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t(\"Incorrect track_path '%s' (expected '%s') on animation '%s' for Godot node '%s' \\\n\t\t\t\t (glTF '%s')\" % [\n\t\t\t\t\ttrack_path, expected_track_path, expected_animation, expected, original]))\n\t\treturn false\n\n\n\t# This test assumes that if the static_collision node was created the -col hint was properly\n\t# handled (as that behavior should be tested elsewhere).\n\t_add_result(true, \"Expected node '%s' has an associated animation\" % expected)\n\treturn true\n\n\nfunc _test_animated_alphanumeric_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_ALPHANUMERIC\n\tvar expected: String = original\n\treturn _check_animated(original, expected)\n\n\nfunc _test_animated_allowed_symbols_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_ALLOWED_SYMBOLS\n\tvar expected: String = original\n\treturn _check_animated(original, expected)\n\n\nfunc _test_animated_katakana_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_KATAKANA\n\tvar expected: String = original\n\treturn _check_animated(original, expected)\n\n\nfunc _test_animated_emoji_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_EMOJI\n\tvar expected: String = original\n\treturn _check_animated(original, expected)\n\n\nfunc _test_animated_disallowed_characters_are_stripped() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_DISALLOWED_NONCLASHING\n\tvar expected: String = GLTF_PREFIX_ANIMATED + \"Disallowed_Non-clashing_\"\n\treturn _check_animated(original, expected)\n\n\nfunc _test_animated_disallowed_clashing_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_DISALLOWED_CLASHING_1\n\tvar expected: String = GLTF_PREFIX_ANIMATED + \"Disallowed_Clashing_\"\n\tif not _check_animated(original, expected):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_ANIMATED + GLTF_DISALLOWED_CLASHING_2\n\texpected = GLTF_PREFIX_ANIMATED + \"Disallowed_Clashing_2\"\n\treturn _check_animated(original, expected)\n\n\nfunc _test_animated_disallowed_nested_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_ANIMATED + GLTF_DISALLOWED_CLASHING_DEEP_TREE_1\n\tvar expected_root: String = GLTF_PREFIX_ANIMATED + \"Disallowed_Clashing_Deep_Tree_\"\n\tif not _check_animated(original, expected_root):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_ANIMATED + GLTF_DISALLOWED_CLASHING_DEEP_TREE_2\n\tvar expected_mid = (expected_root + \"\/\" +\n\t\tGLTF_PREFIX_ANIMATED + \"Disallowed_Clashing_Deep_Tree_2\")\n\tif not _check_animated(original, expected_mid):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_ANIMATED + GLTF_DISALLOWED_CLASHING_DEEP_TREE_3\n\tvar expected_leaf = (expected_mid + \"\/\" +\n\t\tGLTF_PREFIX_ANIMATED + \"Disallowed_Clashing_Deep_Tree_3\")\n\treturn _check_animated(original, expected_leaf)\n","old_contents":"extends ColorRect\n\nconst GOLDEN_GLTF_SCENE: PackedScene = preload(\"res:\/\/gltf\/45545-relax-name-sanitization.gltf\")\n\n## These constants are the prefix part of the node names used in the golden glTF file.\n# Prefix for \"basic\" nodes, no import hints, no animation, etc...\nconst GLTF_PREFIX_BASIC: String = \"Basic_\"\n\n# Prefix for nodes that have an import hint.\nconst GLTF_PREFIX_HINTED: String = \"Hinted_\"\n\n# Prefix for nodes that have an associated animation.\nconst GLTF_PREFIX_ANIMATED: String = \"Animated_\"\n\n## These constants are the infix part of the node names used in the golden glTF file.\nconst GLTF_ALPHANUMERIC: String = \"Alphanumeric123\"\n# The last three symbols are:\n# https:\/\/en.wiktionary.org\/wiki\/%E3%82%B4#Japanese\n# https:\/\/en.wiktionary.org\/wiki\/%E3%83%89#Japanese\n# https:\/\/en.wiktionary.org\/wiki\/%E3%83%84#Japanese\nconst GLTF_KATAKANA: String = \"Katakana_\u30b4\u30c9\u30c4\"\n# The last two symbols are:\n# https:\/\/emojipedia.org\/grinning-face\n# https:\/\/emojipedia.org\/robot\/\nconst GLTF_EMOJI: String = \"Emoji_\ud83d\ude00\ud83e\udd16\"\nconst GLTF_ALLOWED_SYMBOLS: String = \"AllowedSymbols_!#$%^&*()-=[]{}';<>,~\"\nconst GLTF_DISALLOWED_NONCLASHING: String = \"Disallowed_Non-clashing_.:@\\\"\/\"\nconst GLTF_DISALLOWED_CLASHING_1: String = \"Disallowed_Clashing_.\"\nconst GLTF_DISALLOWED_CLASHING_2: String = \"Disallowed_Clashing_@\"\nconst GLTF_DISALLOWED_CLASHING_DEEP_TREE_1: String = \"Disallowed_Clashing_Deep_Tree_@\"\nconst GLTF_DISALLOWED_CLASHING_DEEP_TREE_2: String = \"Disallowed_Clashing_Deep_Tree_@@\"\nconst GLTF_DISALLOWED_CLASHING_DEEP_TREE_3: String = \"Disallowed_Clashing_Deep_Tree_@@@\"\n\nvar output: BoxContainer\nvar test_scene: Node\n\n\nfunc _ready():\n\toutput = $ScrollContainer\/OutputWindow\n\ttest_scene = GOLDEN_GLTF_SCENE.instance()\n\n\tvar passed_tests: Array = []\n\tvar failed_tests: Array = []\n\n\tfor method_name in _find_tests():\n\t\t_add_test_header(method_name)\n\t\tvar result: bool = self.call(method_name)\n\t\t_add_line(\" \")\n\t\tif result:\n\t\t\tpassed_tests.push_back(method_name)\n\t\telse:\n\t\t\tfailed_tests.push_back(method_name)\n\t\n\tif failed_tests:\n\t\tprint(\"%d failed tests:\" % len(failed_tests))\n\t\tfor test in failed_tests:\n\t\t\tprint(\"\\t%s\" % test)\n\telse:\n\t\tprint(\"Passed all %d tests\" % len(passed_tests))\n\n\nfunc _find_tests() -> Array:\n\tvar ret: Array = []\n\tfor method in get_method_list():\n\t\tvar method_name: String = method.get(\"name\")\n\t\tif method_name.begins_with(\"_test_\"):\n\t\t\tret.push_back(method_name)\n\tret.sort()\n\treturn ret\n\n\nfunc _add_test_header(method_name: String) -> void:\n\t_add_line(method_name, Color.royalblue)\n\n\nfunc _add_result(succeeded: bool, message: String) -> void:\n\tvar prefix: String = \" [OK] \" if succeeded else \" [FAIL] \"\n\t_add_line(prefix + message, Color.forestgreen if succeeded else Color.orangered)\n\n\nfunc _add_line(text: String, color: Color = Color.white) -> void:\n\tvar line: Label = Label.new()\n\tline.text = text\n\tline.add_theme_font_size_override(\"font_size\", 22)\n\tline.add_theme_color_override(\"font_color\", color)\n\toutput.add_child(line)\n\n\nfunc _check_basic(original: String, expected: String) -> bool:\n\tvar node: Node = test_scene.get_node_or_null(expected)\n\tif not node:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Missing expected Godot node '%s' for glTF node '%s'\" % [expected, original])\n\t\treturn false\n\t_add_result(true, \"Found expected node '%s'\" % expected)\n\treturn true\n\n\nfunc _test_basic_alphanumeric_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_ALPHANUMERIC\n\tvar expected: String = original\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_allowed_symbols_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_ALLOWED_SYMBOLS\n\tvar expected: String = original\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_katakana_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_KATAKANA\n\tvar expected: String = original\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_emoji_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_EMOJI\n\tvar expected: String = original\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_disallowed_characters_are_stripped() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_NONCLASHING\n\tvar expected: String = GLTF_PREFIX_BASIC + \"Disallowed_Non-clashing_\"\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_disallowed_clashing_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_1\n\tvar expected: String = GLTF_PREFIX_BASIC + \"Disallowed_Clashing_\"\n\tif not _check_basic(original, expected):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_2\n\texpected = GLTF_PREFIX_BASIC + \"Disallowed_Clashing_2\"\n\treturn _check_basic(original, expected)\n\n\nfunc _test_basic_disallowed_nested_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_DEEP_TREE_1\n\tvar expected_root: String = GLTF_PREFIX_BASIC + \"Disallowed_Clashing_Deep_Tree_\"\n\tif not _check_basic(original, expected_root):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_DEEP_TREE_2\n\tvar expected_mid = expected_root + \"\/\" + GLTF_PREFIX_BASIC + \"Disallowed_Clashing_Deep_Tree_2\"\n\tif not _check_basic(original, expected_mid):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_DEEP_TREE_3\n\tvar expected_leaf = expected_mid + \"\/\" + GLTF_PREFIX_BASIC + \"Disallowed_Clashing_Deep_Tree_3\"\n\treturn _check_basic(original, expected_leaf)\n\n\n# Verifies that a node exists with the expected name and that it has a StaticBody3D child.\nfunc _check_hinted_col(original: String, expected: String) -> bool:\n\tvar node: Node = test_scene.get_node_or_null(expected)\n\tif not node:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Missing expected Godot node '%s' for glTF node '%s'\" % [expected, original])\n\t\treturn false\n\t\t\n\tvar collision_body: StaticBody3D = node.get_node_or_null(\"static_collision\")\n\tif not collision_body:\n\t\t_add_result(\n\t\t\tfalse,\n\t\t\t\"Missing 'static_collision' child for Godot node '%s' (glTF '%s')\" % [\n\t\t\t\texpected, original])\n\t\treturn false\n\t\t\n\t# This test assumes that if the static_collision node was created the -col hint was properly\n\t# handled (as that behavior should be tested elsewhere).\n\t_add_result(true, \"Expected node '%s' contains a static_collision StaticBody3D\" % expected)\n\treturn true\n\n\nfunc _test_hinted_alphanumeric_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_ALPHANUMERIC\n\tvar expected: String = original\n\treturn _check_basic(original, expected)\n\n\nfunc _test_hinted_allowed_symbols_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_ALLOWED_SYMBOLS\n\tvar expected: String = original\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_katakana_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_KATAKANA\n\tvar expected: String = original\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_emoji_is_unchanged() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_EMOJI\n\tvar expected: String = original\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_disallowed_characters_are_stripped() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_NONCLASHING\n\tvar expected: String = GLTF_PREFIX_BASIC + \"Disallowed_Non-clashing_\"\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_disallowed_clashing_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_1\n\tvar expected: String = GLTF_PREFIX_BASIC + \"Disallowed_Clashing_\"\n\tif not _check_hinted_col(original, expected):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_2\n\texpected = GLTF_PREFIX_BASIC + \"Disallowed_Clashing_2\"\n\treturn _check_hinted_col(original, expected)\n\n\nfunc _test_hinted_disallowed_nested_nodes_are_uniquified() -> bool:\n\tvar original: String = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_DEEP_TREE_1\n\tvar expected_root: String = GLTF_PREFIX_BASIC + \"Disallowed_Clashing_Deep_Tree_\"\n\tif not _check_hinted_col(original, expected_root):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_DEEP_TREE_2\n\tvar expected_mid = expected_root + \"\/\" + GLTF_PREFIX_BASIC + \"Disallowed_Clashing_Deep_Tree_2\"\n\tif not _check_hinted_col(original, expected_mid):\n\t\treturn false\n\n\toriginal = GLTF_PREFIX_BASIC + GLTF_DISALLOWED_CLASHING_DEEP_TREE_3\n\tvar expected_leaf = expected_mid + \"\/\" + GLTF_PREFIX_BASIC + \"Disallowed_Clashing_Deep_Tree_3\"\n\treturn _check_hinted_col(original, expected_leaf)\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"2098873ad3ef6f7a6efc7abbcd718fdf2c67b6ba","subject":"Proper doors","message":"Proper doors\n","repos":"P1X-in\/rat-is-fat","old_file":"scripts\/map\/room_loader.gd","new_file":"scripts\/map\/room_loader.gd","new_contents":"\n\nvar bag\nvar tilemap\nvar room_max_size = Vector2(20, 12)\nvar side_offset = 3\n\nvar spawns = {\n 'initial0' : Vector2(8, 5),\n 'initial1' : Vector2(9, 5),\n 'initial2' : Vector2(8, 6),\n 'initial3' : Vector2(9, 6),\n 'north0' : Vector2(8, 1),\n 'north1' : Vector2(9, 1),\n 'north2' : Vector2(8, 2),\n 'north3' : Vector2(9, 2),\n 'south0' : Vector2(8, 9),\n 'south1' : Vector2(9, 9),\n 'south2' : Vector2(8, 8),\n 'south3' : Vector2(9, 8),\n 'east0' : Vector2(15, 5),\n 'east1' : Vector2(14, 5),\n 'east2' : Vector2(15, 6),\n 'east3' : Vector2(14, 6),\n 'west0' : Vector2(1, 5),\n 'west1' : Vector2(2, 5),\n 'west2' : Vector2(1, 6),\n 'west3' : Vector2(2, 6),\n}\n\nvar room_templates = {\n 'start' : preload(\"res:\/\/scripts\/map\/rooms\/start_room.gd\"),\n 'easy1' : preload(\"res:\/\/scripts\/map\/rooms\/easy1_room.gd\"),\n 'easy2' : preload(\"res:\/\/scripts\/map\/rooms\/easy2_room.gd\"),\n 'easy3' : preload(\"res:\/\/scripts\/map\/rooms\/easy3_room.gd\"),\n 'easy4' : preload(\"res:\/\/scripts\/map\/rooms\/easy4_room.gd\"),\n 'easy5' : preload(\"res:\/\/scripts\/map\/rooms\/easy5_room.gd\"),\n 'easy6' : preload(\"res:\/\/scripts\/map\/rooms\/easy6_room.gd\"),\n}\n\nvar difficulty_templates = [\n ['start'],\n ['easy1', 'easy2', 'easy3', 'easy4', 'easy5', 'easy6'],\n]\n\n\nvar door_definitions = {\n 'north' : [\n [7, 0, 14, 21],\n [8, 0, 0, 19],\n [9, 0, 13, 20],\n ],\n 'south' : [\n [7, 10, 16, 26],\n [8, 10, 0, 27],\n [9, 10, 15, 28],\n ],\n 'east' : [\n [16, 4, 13, 17],\n [16, 5, 0, 22],\n [16, 6, 15, 24],\n ],\n 'west' : [\n [0, 4, 14, 18],\n [0, 5, 0, 23],\n [0, 6, 16, 25],\n ],\n}\n\nfunc _init_bag(bag):\n self.bag = bag\n self.tilemap = self.bag.action_controller.tilemap\n\nfunc load_room(cell):\n var template_name = cell.template_name\n var data\n self.clear_space()\n self.bag.game_state.current_room = self.room_templates[template_name].new()\n data = self.create_passages(self.bag.game_state.current_room.room, cell)\n self.apply_room_data(data)\n if self.bag.game_state.current_room.enemies.size() > 0 && not cell.clear:\n self.spawn_enemies(self.bag.game_state.current_room.enemies)\n self.close_doors()\n else:\n self.open_doors()\n self.bag.items.reset()\n if cell.items_loaded:\n self.load_previous_items(cell.items)\n else:\n self.spawn_items(self.bag.game_state.current_room.items, cell)\n cell.items_loaded = true\n\nfunc create_passages(data, cell):\n if cell.north != null:\n data = self.open_passage(data, self.door_definitions['north'])\n if cell.south != null:\n data = self.open_passage(data, self.door_definitions['south'])\n if cell.east != null:\n data = self.open_passage(data, self.door_definitions['east'])\n if cell.west != null:\n data = self.open_passage(data, self.door_definitions['west'])\n return data\n\nfunc open_passage(data, passage):\n for tile in passage:\n data[tile[1]][tile[0]] = tile[2]\n return data\n\nfunc close_doors():\n self.bag.game_state.doors_open = false\n self.switch_doors(3)\n\nfunc open_doors():\n self.bag.game_state.doors_open = true\n self.switch_doors(2)\n\nfunc switch_doors(tile_index):\n var cell = self.bag.game_state.current_cell\n if cell.north != null:\n self.apply_door(self.door_definitions['north'], tile_index)\n if cell.south != null:\n self.apply_door(self.door_definitions['south'], tile_index)\n if cell.east != null:\n self.apply_door(self.door_definitions['east'], tile_index)\n if cell.west != null:\n self.apply_door(self.door_definitions['west'], tile_index)\n\nfunc apply_door(definition, tile_index):\n for tile in definition:\n self.tilemap.set_cell(tile[0] + self.side_offset, tile[1], tile[tile_index])\n\nfunc clear_space():\n for x in range(self.room_max_size.x):\n for y in range(self.room_max_size.y):\n self.tilemap.set_cell(x, y, -1)\n\nfunc apply_room_data(data):\n var row\n for y in range(0, data.size()):\n row = data[y]\n for x in range(0, row.size()):\n self.tilemap.set_cell(x + self.side_offset, y, data[y][x])\n\nfunc spawn_enemies(enemies):\n var position = Vector2(0, 0)\n self.bag.enemies.reset()\n for enemy_data in enemies:\n position.x = enemy_data[0] + self.side_offset\n position.y = enemy_data[1]\n self.bag.enemies.spawn(enemy_data[2], position)\n\nfunc spawn_items(items, cell):\n var position = Vector2(0, 0)\n for item_data in items:\n position.x = item_data[0] + self.side_offset\n position.y = item_data[1]\n cell.add_item(self.bag.items.spawn(item_data[2], position))\n\nfunc load_previous_items(items):\n for item in items:\n items[item].attach()\n self.bag.items.add_item(items[item])\n\nfunc get_spawn_position(spawn_name):\n var position = self.bag.room_loader.spawns[spawn_name]\n position.x = position.x + self.side_offset\n return self.translate_position(position)\n\nfunc translate_position(position):\n return self.tilemap.map_to_world(position)","old_contents":"\n\nvar bag\nvar tilemap\nvar room_max_size = Vector2(20, 12)\nvar side_offset = 3\n\nvar spawns = {\n 'initial0' : Vector2(8, 5),\n 'initial1' : Vector2(9, 5),\n 'initial2' : Vector2(8, 6),\n 'initial3' : Vector2(9, 6),\n 'north0' : Vector2(8, 1),\n 'north1' : Vector2(9, 1),\n 'north2' : Vector2(8, 2),\n 'north3' : Vector2(9, 2),\n 'south0' : Vector2(8, 9),\n 'south1' : Vector2(9, 9),\n 'south2' : Vector2(8, 8),\n 'south3' : Vector2(9, 8),\n 'east0' : Vector2(15, 5),\n 'east1' : Vector2(14, 5),\n 'east2' : Vector2(15, 6),\n 'east3' : Vector2(14, 6),\n 'west0' : Vector2(1, 5),\n 'west1' : Vector2(2, 5),\n 'west2' : Vector2(1, 6),\n 'west3' : Vector2(2, 6),\n}\n\nvar room_templates = {\n 'start' : preload(\"res:\/\/scripts\/map\/rooms\/start_room.gd\"),\n 'easy1' : preload(\"res:\/\/scripts\/map\/rooms\/easy1_room.gd\"),\n 'easy2' : preload(\"res:\/\/scripts\/map\/rooms\/easy2_room.gd\"),\n 'easy3' : preload(\"res:\/\/scripts\/map\/rooms\/easy3_room.gd\"),\n 'easy4' : preload(\"res:\/\/scripts\/map\/rooms\/easy4_room.gd\"),\n 'easy5' : preload(\"res:\/\/scripts\/map\/rooms\/easy5_room.gd\"),\n 'easy6' : preload(\"res:\/\/scripts\/map\/rooms\/easy6_room.gd\"),\n}\n\nvar difficulty_templates = [\n ['start'],\n ['easy1', 'easy2', 'easy3', 'easy4', 'easy5', 'easy6'],\n]\n\n\nvar door_definitions = {\n 'north' : [\n [7, 0, 14],\n [8, 0, 0, 5],\n [9, 0, 13],\n ],\n 'south' : [\n [7, 10, 16],\n [8, 10, 0, 10],\n [9, 10, 15],\n ],\n 'east' : [\n [16, 4, 13],\n [16, 5, 0, 9],\n [16, 6, 15],\n ],\n 'west' : [\n [0, 4, 14],\n [0, 5, 0, 7],\n [0, 6, 16],\n ],\n}\n\nfunc _init_bag(bag):\n self.bag = bag\n self.tilemap = self.bag.action_controller.tilemap\n\nfunc load_room(cell):\n var template_name = cell.template_name\n var data\n self.clear_space()\n self.bag.game_state.current_room = self.room_templates[template_name].new()\n data = self.create_passages(self.bag.game_state.current_room.room, cell)\n self.apply_room_data(data)\n if self.bag.game_state.current_room.enemies.size() > 0 && not cell.clear:\n self.spawn_enemies(self.bag.game_state.current_room.enemies)\n self.close_doors()\n else:\n self.open_doors()\n self.bag.items.reset()\n if cell.items_loaded:\n self.load_previous_items(cell.items)\n else:\n self.spawn_items(self.bag.game_state.current_room.items, cell)\n cell.items_loaded = true\n\nfunc create_passages(data, cell):\n if cell.north != null:\n data = self.open_passage(data, self.door_definitions['north'])\n if cell.south != null:\n data = self.open_passage(data, self.door_definitions['south'])\n if cell.east != null:\n data = self.open_passage(data, self.door_definitions['east'])\n if cell.west != null:\n data = self.open_passage(data, self.door_definitions['west'])\n return data\n\nfunc open_passage(data, passage):\n for tile in passage:\n data[tile[1]][tile[0]] = tile[2]\n return data\n\nfunc close_doors():\n self.bag.game_state.doors_open = false\n self.switch_doors(3)\n\nfunc open_doors():\n self.bag.game_state.doors_open = true\n self.switch_doors(2)\n\nfunc switch_doors(tile_index):\n var door_coords\n var cell = self.bag.game_state.current_cell\n if cell.north != null:\n door_coords = self.door_definitions['north'][1]\n self.tilemap.set_cell(door_coords[0] + self.side_offset, door_coords[1], door_coords[tile_index])\n if cell.south != null:\n door_coords = self.door_definitions['south'][1]\n self.tilemap.set_cell(door_coords[0] + self.side_offset, door_coords[1], door_coords[tile_index])\n if cell.east != null:\n door_coords = self.door_definitions['east'][1]\n self.tilemap.set_cell(door_coords[0] + self.side_offset, door_coords[1], door_coords[tile_index])\n if cell.west != null:\n door_coords = self.door_definitions['west'][1]\n self.tilemap.set_cell(door_coords[0] + self.side_offset, door_coords[1], door_coords[tile_index])\n\nfunc clear_space():\n for x in range(self.room_max_size.x):\n for y in range(self.room_max_size.y):\n self.tilemap.set_cell(x, y, -1)\n\nfunc apply_room_data(data):\n var row\n for y in range(0, data.size()):\n row = data[y]\n for x in range(0, row.size()):\n self.tilemap.set_cell(x + self.side_offset, y, data[y][x])\n\nfunc spawn_enemies(enemies):\n var position = Vector2(0, 0)\n self.bag.enemies.reset()\n for enemy_data in enemies:\n position.x = enemy_data[0] + self.side_offset\n position.y = enemy_data[1]\n self.bag.enemies.spawn(enemy_data[2], position)\n\nfunc spawn_items(items, cell):\n var position = Vector2(0, 0)\n for item_data in items:\n position.x = item_data[0] + self.side_offset\n position.y = item_data[1]\n cell.add_item(self.bag.items.spawn(item_data[2], position))\n\nfunc load_previous_items(items):\n for item in items:\n items[item].attach()\n self.bag.items.add_item(items[item])\n\nfunc get_spawn_position(spawn_name):\n var position = self.bag.room_loader.spawns[spawn_name]\n position.x = position.x + self.side_offset\n return self.translate_position(position)\n\nfunc translate_position(position):\n return self.tilemap.map_to_world(position)","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"7adabd0fbfbe500bf6389c20b16a3469eea55014","subject":"fixed block removal","message":"fixed block removal\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/GridMan.gd","new_file":"src\/scripts\/GridMan.gd","new_contents":"extends Spatial\n\n# Is there a better way to do this?\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\n# Block selection handling.\nvar offClick = false\nvar selectedBlocks = []\n\n# Puzzle vars.\nvar puzzle\nvar puzzleLoaded = false\nvar blockNodes = {}\n\nvar puzzleScn\n\n# Beam stuff.\nconst beamScn = preload( \"res:\/\/blocks\/block.scn\" )\nconst Beam = preload(\"res:\/\/scripts\/Blocks\/Beam.gd\")\n\n# sounds\nvar samplePlayer = SamplePlayer.new()\n\nfunc addPickledBlock(block):\n\tvar b = block.toNode()\n\n\t# TODO any special treatment for the wild blocks?\n\t# TODO keep track of puzzle.lasers ? How to?\n\tblockNodes[block.blockPos] = b\n\n\tif puzzleLoaded:\n\t\t# keep pickled block\n\t\tpuzzle.shape[block.blockPos] = block\n\n\t\t# keep track of puzzle.pairCounts\n\t\tvar layer = calcBlockLayerVec(b.blockPos)\n\t\tif b.getBlockType() == 2:\n\t\t\twhile puzzle.pairCount.size() <= layer:\n\t\t\t\tpuzzle.pairCount.append(0)\n\t\t\tpuzzle.puzzleLayers = puzzle.pairCount.size() - 1\n\t\t\tpuzzle.pairCount[layer] += 0.5\n\n\n\tadd_child(b)\n\treturn b\n\nfunc get_block(pos):\n\tif blockNodes.has(pos):\n\t\treturn blockNodes[pos]\n\telse:\n\t\treturn null\n\n# unused key argument needed for the tween_complete signal\nfunc remove_block(block=null, key=null):\n\tvar block_node = blockNodes[block.blockPos]\n\tpuzzle.shape[block_node.blockPos] = null\n\n\tif block_node == null:\n\t\treturn\n\n\tblockNodes[block_node.blockPos] = null\n\n\tfor child in block_node.get_children():\n\t\tblock_node.remove_and_delete_child(child)\n\tremove_and_delete_child(block_node)\n\n# Sets the puzzle for this GridMan.\nfunc set_puzzle(puzz):\n\t# verify puzzle\n\tif puzz == null:\n\t\tprint(\"INVALID PUZZLE\")\n\t\treturn\n\n\t# delete all current nodes\n\tif puzzle != null:\n\t\tfor pos in puzzle.shape:\n\t\t\tremove_block(puzzle.shape[pos])\n\tpuzzleLoaded = false\n\n\t# Store the puzzle.\n\tpuzzle = puzz\n\n\t\t# # I can do my own counting!\n\t# needed for adding blocks in the editor\n\tfor k in puzzle.shape:\n\t\t# Create a block node, add it to the tree\n\t\taddPickledBlock(puzzle.shape[k])\n\tpuzzleLoaded = true\n\n# Clears any selected blocks. WE SHOULD FIX THIS, THERE CAN ONLY BE ONE BLOCK SELECTED AT ANY ONE TIME, NO NEED FOR AN ARRAY!\nfunc clearSelection():\n\tfor bl in selectedBlocks:\n\t\tvar blo = get_node( bl )\n\t\tblo.setSelected(false)\n\t\tblo.scaleTweenNode(1.0).start()\n\tselectedBlocks = []\n\n# Add the selected block to the selected list. WE SHOULD FIX THIS, IT ONLY NEEDS TO STORE IT, NOT AN ARRAY!\nfunc addSelected(bl):\n\tselectedBlocks.append(bl)\n\n# Used for the multiplayer mode to force click a block on their side.\nfunc forceClickBlock( pos ):\n\tblockNodes[pos].forceClick()\n\nfunc clickBlock( name ):\n\t#now check if that was the second block we picked. If it was, we want to\n\t#unselect the blocks again\n\tif (offClick):\n\t\toffClick = false\n\t\taddSelected(name)\n\t\tclearSelection()\n\telse:\n\t\toffClick = true;\n\t\taddSelected(name)\n\n# Calculates the layer that a block is on.\n# COPY OF FUNCTION IN PUZZLEMAN, IS THERE A BETTER WAY TO DO THIS?!\nfunc calcBlockLayer( x, y, z ):\n\treturn max( max( abs( x ), abs( y ) ), abs( z ) )\nfunc calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\nfunc beatenWithScore(othersScore):\n\tprint( \"BEATEN!\" )\n\tvar pauseMenu = get_tree().get_root().get_node( \"Spatial\" ).get_node( \"Camera\" ).pauseMenu\n\tpauseMenu.set_text(\"GAME OVER\\nYou've been beaten with time: \" + puzzleScn.formatTime(othersScore))\n\tpauseMenu.popup_centered()\n\nfunc win():\n\tprint( \"GAME OVER!\" )\n\tvar pauseMenu = get_tree().get_root().get_node( \"Spatial\" ).get_node( \"Camera\" ).pauseMenu\n\tpauseMenu.set_text(\"GAME OVER\\nYou win with time: \" + puzzleScn.formatTime(get_parent().get_parent().time.val))\n\tpauseMenu.popup_centered()\n\n\n# Handles keeping track of pairs being removed.\nfunc popPair( pos ):\n\tvar blayer = calcBlockLayerVec( pos )\n\tpuzzle.pairCount[blayer] -= 1\n\n\tif( puzzle.pairCount[blayer] == 0 ):\n\t\tprint(\"LAYER CLEARED\")\n\t\tif blayer == 1:\n\t\t\twin()\n\n\t\tfor b in puzzle.shape:\n\t\t\tif not ( puzzle.shape[b] == null ):\n\t\t\t\tif calcBlockLayerVec( b ) == blayer:\n\t\t\t\t\tif blockNodes[b].getBlockType() == BLOCK_LASER:\n\t\t\t\t\t\tblockNodes[b].forceActivate()\n\n\t\t# Fire beams.\n\t\tvar beamNum = 0\n\t\tfor l in range( puzzle.lasers.size() ):\n\t\t\tif calcBlockLayerVec( puzzle.lasers[l][0] ) == blayer:\n\t\t\t\t# Firin mah lazerz!\n\t\t\t\tvar beam = beamScn.instance()\n\n\t\t\t\tbeam.set_name( str(blayer) + \"_beam_\" + str(beamNum) )\n\t\t\t\tbeamNum += 1\n\t\t\t\tbeam.set_script( Beam )\n\n\t\t\t\tadd_child( beam )\n\t\t\t\tbeam.fire( puzzle.lasers[l][0], puzzle.lasers[l][1] )\n\n\t\t\t\tsamplePlayer.play( \"soundslikewillem_hitting_slinky\" )\n\n\nfunc _init():\n\t# Load sound\n\tsamplePlayer.set_voice_count(10)\n\tsamplePlayer.set_sample_library(ResourceLoader.load(\"new_samplelibrary.xml\"))\n\tprint(\"GridMan initialized\")\n\nfunc _ready():\n\tsetupCam()\n\n\tpuzzleScn = get_parent().get_parent()\n\n\nfunc setupCam():\n\tvar cam = get_tree().get_root().get_node( \"Spatial\/Camera\" )\n\tif cam == null or puzzle == null:\n\t\treturn\n\tvar totalSize = ( puzzle.puzzleLayers * 2 + 1 )\n\tcam.distance.val = 4.5 * totalSize\n\tcam.distance.min_ = 3 * totalSize\n\tcam.distance.max_ = 10 * totalSize\n\tcam.recalculate_camera()\n\n\n","old_contents":"extends Spatial\n\n# Is there a better way to do this?\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\n# Block selection handling.\nvar offClick = false\nvar selectedBlocks = []\n\n# Puzzle vars.\nvar puzzle\nvar puzzleLoaded = false\nvar blockNodes = {}\n\nvar puzzleScn\n\n# Beam stuff.\nconst beamScn = preload( \"res:\/\/blocks\/block.scn\" )\nconst Beam = preload(\"res:\/\/scripts\/Blocks\/Beam.gd\")\n\n# sounds\nvar samplePlayer = SamplePlayer.new()\n\nfunc addPickledBlock(block):\n\tvar b = block.toNode()\n\n\t# TODO any special treatment for the wild blocks?\n\t# TODO keep track of puzzle.lasers ? How to?\n\tblockNodes[block.blockPos] = b\n\n\tif puzzleLoaded:\n\t\t# keep pickled block\n\t\tpuzzle.shape[block.blockPos] = block\n\n\t\t# keep track of puzzle.pairCounts\n\t\tvar layer = calcBlockLayerVec(b.blockPos)\n\t\tif b.getBlockType() == 2:\n\t\t\twhile puzzle.pairCount.size() <= layer:\n\t\t\t\tpuzzle.pairCount.append(0)\n\t\t\tpuzzle.puzzleLayers = puzzle.pairCount.size() - 1\n\t\t\tpuzzle.pairCount[layer] += 0.5\n\n\n\tadd_child(b)\n\treturn b\n\nfunc get_block(pos):\n\tif blockNodes.has(pos):\n\t\treturn blockNodes[pos]\n\telse:\n\t\treturn null\n\n# unused key argument needed for the tween_complete signal\nfunc remove_block(block, key=null):\n\tvar block_node = blockNodes[block.blockPos]\n\n\tpuzzle.shape[block_node.blockPos] = null\n\tblockNodes[block_node.blockPos] = null\n\n\tif block_node == null:\n\t\treturn\n\n\tfor child in block_node.get_children():\n\t\tblock_node.remove_and_delete_child(child)\n\tremove_and_delete_child(block_node)\n\n# Sets the puzzle for this GridMan.\nfunc set_puzzle(puzz):\n\t# verify puzzle\n\tif puzz == null:\n\t\tprint(\"INVALID PUZZLE\")\n\t\treturn\n\n\t# delete all current nodes\n\tif puzzle != null:\n\t\tfor pos in puzzle.shape:\n\t\t\tremove_block(puzzle.shape[pos])\n\tpuzzleLoaded = false\n\n\t# Store the puzzle.\n\tpuzzle = puzz\n\n\t\t# # I can do my own counting!\n\t# needed for adding blocks in the editor\n\tfor k in puzzle.shape:\n\t\t# Create a block node, add it to the tree\n\t\taddPickledBlock(puzzle.shape[k])\n\tpuzzleLoaded = true\n\n# Clears any selected blocks. WE SHOULD FIX THIS, THERE CAN ONLY BE ONE BLOCK SELECTED AT ANY ONE TIME, NO NEED FOR AN ARRAY!\nfunc clearSelection():\n\tfor bl in selectedBlocks:\n\t\tvar blo = get_node( bl )\n\t\tblo.setSelected(false)\n\t\tblo.scaleTweenNode(1.0).start()\n\tselectedBlocks = []\n\n# Add the selected block to the selected list. WE SHOULD FIX THIS, IT ONLY NEEDS TO STORE IT, NOT AN ARRAY!\nfunc addSelected(bl):\n\tselectedBlocks.append(bl)\n\n# Used for the multiplayer mode to force click a block on their side.\nfunc forceClickBlock( pos ):\n\tblockNodes[pos].forceClick()\n\nfunc clickBlock( name ):\n\t#now check if that was the second block we picked. If it was, we want to\n\t#unselect the blocks again\n\tif (offClick):\n\t\toffClick = false\n\t\taddSelected(name)\n\t\tclearSelection()\n\telse:\n\t\toffClick = true;\n\t\taddSelected(name)\n\n# Calculates the layer that a block is on.\n# COPY OF FUNCTION IN PUZZLEMAN, IS THERE A BETTER WAY TO DO THIS?!\nfunc calcBlockLayer( x, y, z ):\n\treturn max( max( abs( x ), abs( y ) ), abs( z ) )\nfunc calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\nfunc beatenWithScore(othersScore):\n\tprint( \"BEATEN!\" )\n\tvar pauseMenu = get_tree().get_root().get_node( \"Spatial\" ).get_node( \"Camera\" ).pauseMenu\n\tpauseMenu.set_text(\"GAME OVER\\nYou've been beaten with time: \" + puzzleScn.formatTime(othersScore))\n\tpauseMenu.popup_centered()\n\nfunc win():\n\tprint( \"GAME OVER!\" )\n\tvar pauseMenu = get_tree().get_root().get_node( \"Spatial\" ).get_node( \"Camera\" ).pauseMenu\n\tpauseMenu.set_text(\"GAME OVER\\nYou win with time: \" + puzzleScn.formatTime(get_parent().get_parent().time.val))\n\tpauseMenu.popup_centered()\n\n\n# Handles keeping track of pairs being removed.\nfunc popPair( pos ):\n\tvar blayer = calcBlockLayerVec( pos )\n\tpuzzle.pairCount[blayer] -= 1\n\n\tif( puzzle.pairCount[blayer] == 0 ):\n\t\tprint(\"LAYER CLEARED\")\n\t\tif blayer == 1:\n\t\t\twin()\n\n\t\tfor b in puzzle.shape:\n\t\t\tif not ( puzzle.shape[b] == null ):\n\t\t\t\tif calcBlockLayerVec( b ) == blayer:\n\t\t\t\t\tif blockNodes[b].getBlockType() == BLOCK_LASER:\n\t\t\t\t\t\tblockNodes[b].forceActivate()\n\n\t\t# Fire beams.\n\t\tvar beamNum = 0\n\t\tfor l in range( puzzle.lasers.size() ):\n\t\t\tif calcBlockLayerVec( puzzle.lasers[l][0] ) == blayer:\n\t\t\t\t# Firin mah lazerz!\n\t\t\t\tvar beam = beamScn.instance()\n\n\t\t\t\tbeam.set_name( str(blayer) + \"_beam_\" + str(beamNum) )\n\t\t\t\tbeamNum += 1\n\t\t\t\tbeam.set_script( Beam )\n\n\t\t\t\tadd_child( beam )\n\t\t\t\tbeam.fire( puzzle.lasers[l][0], puzzle.lasers[l][1] )\n\n\t\t\t\tsamplePlayer.play( \"soundslikewillem_hitting_slinky\" )\n\n\nfunc _init():\n\t# Load sound\n\tsamplePlayer.set_voice_count(10)\n\tsamplePlayer.set_sample_library(ResourceLoader.load(\"new_samplelibrary.xml\"))\n\tprint(\"GridMan initialized\")\n\nfunc _ready():\n\tsetupCam()\n\t\n\tpuzzleScn = get_parent().get_parent()\n\n\nfunc setupCam():\n\tvar cam = get_tree().get_root().get_node( \"Spatial\/Camera\" )\n\tif cam == null or puzzle == null:\n\t\treturn\n\tvar totalSize = ( puzzle.puzzleLayers * 2 + 1 )\n\tcam.distance.val = 4.5 * totalSize\n\tcam.distance.min_ = 3 * totalSize\n\tcam.distance.max_ = 10 * totalSize\n\tcam.recalculate_camera()\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"7176f2abe1ff6246b73010cc7c4372d70f07bb0b","subject":"Blocks that are not in the foreground (the local block) cannot be picked","message":"Blocks that are not in the foreground (the local block) cannot be picked\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Blocks\/AbstractBlock.gd","new_file":"src\/scripts\/Blocks\/AbstractBlock.gd","new_contents":"extends RigidBody\n\nvar name\nvar pairName\nvar selected = false\nvar blockPos\nconst far_away_corner = Vector3(80, 80, 80)\n\nfunc nameToNodeName(n):\n\treturn \"block\" + str(n)\n\nfunc setName(n):\n\tname = nameToNodeName(n)\n\tset_name(nameToNodeName(n))\n\treturn self\n\nfunc setPairName(n):\n\tpairName = nameToNodeName(n)\n\treturn self\n\n# catch clicks\/taps\nfunc _input_event( camera, ev, click_pos, click_normal, shape_idx ):\n\tif ((ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT)\n\tor (ev.type==InputEvent.SCREEN_TOUCH)):\n\t\tif (get_parent().get_parent().active):\n\t\t\tactivate(ev, click_pos, click_normal)\n\n# returns this block's pairNode or null\nfunc pairActivate(ev, click_pos, click_normal):\n\tselected = true\n\n\t# is my pair Nil?\n\tif pairName == null or get_parent() == null or not get_parent().has_node(str(pairName)):\n\t\tscaleTweenNode(0.9, 0.2, Tween.TRANS_EXPO).start()\n\t\treturn null\n\n\t# get my pair node\n\tvar pairNode = get_parent().get_node(pairName)\n\n\t# enlarge if the other guy's unselected\n\tif not pairNode.selected:\n\t\tscaleTweenNode(1.1, 0.2, Tween.TRANS_EXPO).start()\n\treturn pairNode\n\n\n# returns a tween node that uniformly changes the object's scale\n# call start() on the returned object\nfunc scaleTweenNode(scale, time=1, transType=Tween.TRANS_BOUNCE):\n\tvar tweenNode = newTweenNode()\n\ttweenNode.interpolate_method( self, \"set_scale\", \\\n\t\tself.get_scale(), Vector3(scale, scale, scale), \\\n\t\ttime, transType, Tween.EASE_OUT )\n\n\treturn tweenNode\n\n# adds a tween transition node to the tree\nfunc newTweenNode():\n\tvar tween = Tween.new()\n\tadd_child(tween)\n\treturn tween\n\nfunc remove_with_pop(node, key):\n\tget_parent().samplePlayer.play(\"deraj_pop_sound\")\n\tget_parent().remove_block(self)\n\nfunc _ready():\n\tset_ray_pickable(true)\n","old_contents":"extends RigidBody\n\nvar name\nvar pairName\nvar selected = false\nvar blockPos\nconst far_away_corner = Vector3(80, 80, 80)\n\nfunc nameToNodeName(n):\n\treturn \"block\" + str(n)\n\nfunc setName(n):\n\tname = nameToNodeName(n)\n\tset_name(nameToNodeName(n))\n\treturn self\n\nfunc setPairName(n):\n\tpairName = nameToNodeName(n)\n\treturn self\n\n# catch clicks\/taps\nfunc _input_event( camera, ev, click_pos, click_normal, shape_idx ):\n\tif ((ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT)\n\tor (ev.type==InputEvent.SCREEN_TOUCH)):\n\t\tactivate(ev, click_pos, click_normal)\n\n# returns this block's pairNode or null\nfunc pairActivate(ev, click_pos, click_normal):\n\tselected = true\n\n\t# is my pair Nil?\n\tif pairName == null or get_parent() == null or not get_parent().has_node(str(pairName)):\n\t\tscaleTweenNode(0.9, 0.2, Tween.TRANS_EXPO).start()\n\t\treturn null\n\n\t# get my pair node\n\tvar pairNode = get_parent().get_node(pairName)\n\n\t# enlarge if the other guy's unselected\n\tif not pairNode.selected:\n\t\tscaleTweenNode(1.1, 0.2, Tween.TRANS_EXPO).start()\n\treturn pairNode\n\n\n# returns a tween node that uniformly changes the object's scale\n# call start() on the returned object\nfunc scaleTweenNode(scale, time=1, transType=Tween.TRANS_BOUNCE):\n\tvar tweenNode = newTweenNode()\n\ttweenNode.interpolate_method( self, \"set_scale\", \\\n\t\tself.get_scale(), Vector3(scale, scale, scale), \\\n\t\ttime, transType, Tween.EASE_OUT )\n\n\treturn tweenNode\n\n# adds a tween transition node to the tree\nfunc newTweenNode():\n\tvar tween = Tween.new()\n\tadd_child(tween)\n\treturn tween\n\nfunc remove_with_pop(node, key):\n\tget_parent().samplePlayer.play(\"deraj_pop_sound\")\n\tget_parent().remove_block(self)\n\nfunc _ready():\n\tset_ray_pickable(true)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"54f47b56e9a83cc2e8115a4502e8d35e49de5cd3","subject":"Getting hit resets combo","message":"Getting hit resets combo\n\n","repos":"BK-TN\/IncendiumGame","old_file":"incendium\/scripts\/Player.gd","new_file":"incendium\/scripts\/Player.gd","new_contents":"# PLAYER class\n# Moves n shoots\n\nextends Node2D\n\nconst SPEED = 420 \/ 1.42\n\nexport var polar_controls = false\nvar angle = 0\nvar dist = 200\nvar shield_cooldown = 0\nvar fire_timer = 0\n\nconst MAX_HEALTH = 100\nvar health = MAX_HEALTH\n\nfunc _ready():\n\tset_process(true)\n\nfunc _process(delta):\n\tif Input.is_key_pressed(KEY_LEFT):\n\t\tif polar_controls:\n\t\t\tangle += (delta \/ dist) * SPEED\n\t\telse:\n\t\t\ttranslate(Vector2(-delta,0) * SPEED)\n\tif Input.is_key_pressed(KEY_RIGHT):\n\t\tif polar_controls:\n\t\t\tangle -= (delta \/ dist) * SPEED\n\t\telse:\n\t\t\ttranslate(Vector2(delta,0) * SPEED)\n\tif Input.is_key_pressed(KEY_UP):\n\t\tif polar_controls:\n\t\t\tdist -= delta * SPEED\n\t\t\tif dist < 0.1: dist = 0.1\n\t\telse:\n\t\t\ttranslate(Vector2(0,-delta) * SPEED)\n\tif Input.is_key_pressed(KEY_DOWN):\n\t\tif polar_controls:\n\t\t\tdist += delta * SPEED \n\t\telse:\n\t\t\ttranslate(Vector2(0,delta) * SPEED)\n\t\n\tvar center = Vector2(720\/2,720\/2)\n\t\n\tif polar_controls:\n\t\tset_pos(center + Vector2(cos(angle),sin(angle)) * dist)\n\n\tvar towards_center = (center - get_pos()).normalized()\n\t\n\tif fire_timer > 0:\n\t\tfire_timer -= delta\n\t\n\tif (Input.is_key_pressed(KEY_SPACE) or Input.is_key_pressed(KEY_F)) and fire_timer <= 0:\n\t\tvar bullet = preload(\"res:\/\/objects\/Bullet.tscn\").instance()\n\t\tbullet.set_pos(get_pos())\n\t\tget_tree().get_root().get_node(\"Game\/SFX\").set_default_pitch_scale(rand_range(0.9,1.1))\n\t\tget_tree().get_root().get_node(\"Game\/SFX\").play(\"Laser_Shoot14\")\n\t\t#bullet.get_node(\"RegularPolygon\").size = 1\n\t\tbullet.damage = 1\n\t\t\n\t\tvar dir = atan2(towards_center.y,towards_center.x)\n\t\tvar len = 600\n\t\t\n\t\tvar spread = 0.05\n\t\tvar rot = rand_range(-spread,spread)\n\t\tvar final = dir + rot\n\t\t\n\t\tbullet.velocity = Vector2(cos(final),sin(final)) * len\n\t\tget_tree().get_root().add_child(bullet,false)\n\t\tfire_timer = 0.05\n\t\t\n\tif shield_cooldown > 0:\n\t\tshield_cooldown -= delta\n\t\n\tif Input.is_key_pressed(KEY_D) and shield_cooldown <= 0:\n\t\tvar shield = preload(\"res:\/\/objects\/PlayerShield.tscn\").instance()\n\t\tshield.node_to_follow = get_path()\n\t\tget_tree().get_root().add_child(shield)\n\t\tshield.set_global_pos(get_global_pos())\n\t\tshield_cooldown = 6\n\n\tset_rot(atan2(towards_center.x,towards_center.y) - PI\/2)\n\t\n\t# Limit position to circle\n\tif center.distance_to(get_pos()) > 720\/2:\n\t\tset_pos((get_pos() - center).normalized() * 720\/2 + center)\n\nfunc _on_RegularPolygon_area_enter( area ):\n\tif area.get_groups().has(\"damage_player\"):\n\t\tvar bullet = area.get_parent()\n\t\tbullet.queue_free()\n\t\tvar dmgtotake = bullet.damage * 2\n\t\tlose_health(dmgtotake)\n\tif area.get_groups().has(\"damage_player_solid\") && area.get_parent().enabled:\n\t\tlose_health(100)\n\nfunc lose_health(hp):\n\thealth -= hp\n\tget_parent().score_mult = 1\n\tget_parent().score_mult_timer = 0\n\tif health <= 0:\n\t\tfor i in range(0,8):\n\t\t\tvar explosion_instance = preload(\"res:\/\/objects\/Explosion.tscn\").instance()\n\t\t\texplosion_instance.get_node(\"RegularPolygon\").size = get_node(\"RegularPolygon\").size\n\t\t\texplosion_instance.get_node(\"RegularPolygon\/Polygon2D\").set_color(get_node(\"RegularPolygon\/Polygon2D\").get_color())\n\t\t\t# explosion_instance.velocity = Vector2(0,0)\n\t\t\tget_tree().get_root().add_child(explosion_instance)\n\t\t\texplosion_instance.set_global_pos(get_global_pos())\n\t\tOS.set_time_scale(0.02)\n\t\tqueue_free()\n\nfunc _on_RegularPolygon_area_exit( area ):\n\tpass\n","old_contents":"# PLAYER class\n# Moves n shoots\n\nextends Node2D\n\nconst SPEED = 420 \/ 1.42\n\nexport var polar_controls = false\nvar angle = 0\nvar dist = 200\nvar shield_cooldown = 0\nvar fire_timer = 0\n\nconst MAX_HEALTH = 100\nvar health = MAX_HEALTH\n\nfunc _ready():\n\tset_process(true)\n\nfunc _process(delta):\n\tif Input.is_key_pressed(KEY_LEFT):\n\t\tif polar_controls:\n\t\t\tangle += (delta \/ dist) * SPEED\n\t\telse:\n\t\t\ttranslate(Vector2(-delta,0) * SPEED)\n\tif Input.is_key_pressed(KEY_RIGHT):\n\t\tif polar_controls:\n\t\t\tangle -= (delta \/ dist) * SPEED\n\t\telse:\n\t\t\ttranslate(Vector2(delta,0) * SPEED)\n\tif Input.is_key_pressed(KEY_UP):\n\t\tif polar_controls:\n\t\t\tdist -= delta * SPEED\n\t\t\tif dist < 0.1: dist = 0.1\n\t\telse:\n\t\t\ttranslate(Vector2(0,-delta) * SPEED)\n\tif Input.is_key_pressed(KEY_DOWN):\n\t\tif polar_controls:\n\t\t\tdist += delta * SPEED \n\t\telse:\n\t\t\ttranslate(Vector2(0,delta) * SPEED)\n\t\n\tvar center = Vector2(720\/2,720\/2)\n\t\n\tif polar_controls:\n\t\tset_pos(center + Vector2(cos(angle),sin(angle)) * dist)\n\n\tvar towards_center = (center - get_pos()).normalized()\n\t\n\tif fire_timer > 0:\n\t\tfire_timer -= delta\n\t\n\tif (Input.is_key_pressed(KEY_SPACE) or Input.is_key_pressed(KEY_F)) and fire_timer <= 0:\n\t\tvar bullet = preload(\"res:\/\/objects\/Bullet.tscn\").instance()\n\t\tbullet.set_pos(get_pos())\n\t\tget_tree().get_root().get_node(\"Game\/SFX\").set_default_pitch_scale(rand_range(0.9,1.1))\n\t\tget_tree().get_root().get_node(\"Game\/SFX\").play(\"Laser_Shoot14\")\n\t\t#bullet.get_node(\"RegularPolygon\").size = 1\n\t\tbullet.damage = 1\n\t\t\n\t\tvar dir = atan2(towards_center.y,towards_center.x)\n\t\tvar len = 600\n\t\t\n\t\tvar spread = 0.05\n\t\tvar rot = rand_range(-spread,spread)\n\t\tvar final = dir + rot\n\t\t\n\t\tbullet.velocity = Vector2(cos(final),sin(final)) * len\n\t\tget_tree().get_root().add_child(bullet,false)\n\t\tfire_timer = 0.05\n\t\t\n\tif shield_cooldown > 0:\n\t\tshield_cooldown -= delta\n\t\n\tif Input.is_key_pressed(KEY_D) and shield_cooldown <= 0:\n\t\tvar shield = preload(\"res:\/\/objects\/PlayerShield.tscn\").instance()\n\t\tshield.node_to_follow = get_path()\n\t\tget_tree().get_root().add_child(shield)\n\t\tshield.set_global_pos(get_global_pos())\n\t\tshield_cooldown = 6\n\n\tset_rot(atan2(towards_center.x,towards_center.y) - PI\/2)\n\t\n\t# Limit position to circle\n\tif center.distance_to(get_pos()) > 720\/2:\n\t\tset_pos((get_pos() - center).normalized() * 720\/2 + center)\n\nfunc _on_RegularPolygon_area_enter( area ):\n\tif area.get_groups().has(\"damage_player\"):\n\t\tvar bullet = area.get_parent()\n\t\tbullet.queue_free()\n\t\tvar dmgtotake = bullet.damage * 2\n\t\tlose_health(dmgtotake)\n\tif area.get_groups().has(\"damage_player_solid\") && area.get_parent().enabled:\n\t\tlose_health(100)\n\nfunc lose_health(hp):\n\thealth -= hp\n\tif health <= 0:\n\t\tfor i in range(0,8):\n\t\t\tvar explosion_instance = preload(\"res:\/\/objects\/Explosion.tscn\").instance()\n\t\t\texplosion_instance.get_node(\"RegularPolygon\").size = get_node(\"RegularPolygon\").size\n\t\t\texplosion_instance.get_node(\"RegularPolygon\/Polygon2D\").set_color(get_node(\"RegularPolygon\/Polygon2D\").get_color())\n\t\t\t# explosion_instance.velocity = Vector2(0,0)\n\t\t\tget_tree().get_root().add_child(explosion_instance)\n\t\t\texplosion_instance.set_global_pos(get_global_pos())\n\t\tOS.set_time_scale(0.02)\n\t\tqueue_free()\n\nfunc _on_RegularPolygon_area_exit( area ):\n\tpass\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"79658d621ad61e650a761bc79f7ff554d496ac9a","subject":"Changing zoom","message":"Changing zoom\n","repos":"P1X-in\/boctok","old_file":"scripts\/ship.gd","new_file":"scripts\/ship.gd","new_contents":"extends RigidBody2D\n\nvar camera\n\nvar ROTATE_STEP = 6\nvar ROTATE_THRESHOLD = 6.28\n\nvar ACCELERATION = 300\nvar BOOST = 1500\nvar BOOST_FUEL = 6\n\nvar GRAVITY_FACTOR = 100000000000\nvar MAX_FUEL = 100\nvar CAMERA_ZOOM_STEP = 0.2\n\nvar rotation = 0\nvar current_acceleration = Vector2(0, 0)\nvar current_gravity = Vector2(0, 0)\n\nvar engines = []\n\nvar fuel = 100\n\nvar do_rotate = false\nvar rotate_factor = 1\nvar accelerate = false\nvar accelerate_factor = 1\nvar boost = false\n\nvar reset_velocity = true\nvar camera_zoom = 1\n\nfunc _integrate_forces(s):\n if self.reset_velocity:\n self.reset_velocity = false\n s.set_linear_velocity(Vector2(0,0))\n return\n\n\n var lv = s.get_linear_velocity()\n var step = s.get_step()\n self.current_acceleration = lv\n\n var engines_on = {\"Main\" : false, \"Left\": false, \"Right\" : false}\n\n if self.do_rotate:\n self.rotation = self.rotation + self.ROTATE_STEP * step * self.rotate_factor\n if self.rotation > self.ROTATE_THRESHOLD:\n self.rotation = self.rotation - self.ROTATE_THRESHOLD\n if self.rotation < 0:\n self.rotation = self.rotation + self.ROTATE_THRESHOLD\n if self.rotate_factor < 0:\n engines_on[\"Left\"] = true\n elif self.rotate_factor > 0:\n engines_on[\"Right\"] = true\n self.set_rot(self.rotation)\n\n var acceleration_vector = Vector2(0,-1).rotated(self.rotation)\n\n if self.accelerate and self.fuel > step * 10:\n lv = lv + acceleration_vector * self.ACCELERATION * step * self.accelerate_factor\n engines_on[\"Main\"] = true\n self.fuel = self.fuel - step * 10\n elif self.boost and self.fuel > step * 10 * self.BOOST_FUEL:\n lv = lv + acceleration_vector * self.BOOST * step\n engines_on[\"Main\"] = true\n engines_on[\"Left\"] = true\n engines_on[\"Right\"] = true\n self.fuel = self.fuel - step * 10 * self.BOOST_FUEL\n\n if self.accelerate or self.boost:\n self.camera_zoom += self.CAMERA_ZOOM_STEP * step\n if self.camera_zoom > 2:\n self.camera_zoom = 2\n else:\n self.camera_zoom -= self.CAMERA_ZOOM_STEP * step\n if self.camera_zoom < 1:\n self.camera_zoom = 1\n self.camera.set_zoom(Vector2(self.camera_zoom, self.camera_zoom))\n\n self.current_gravity = s.get_total_gravity() * step * self.GRAVITY_FACTOR\n lv += self.current_gravity\n self.__engines_start(engines_on)\n s.set_linear_velocity(lv)\n\nfunc __engines_start(engines):\n for engine in engines:\n if engines[engine] == true:\n self.engines[engine].set_emitting(true)\n\nfunc _ready():\n self.set_mode(self.MODE_CHARACTER)\n var engines = self.get_node(\"Engines\")\n self.engines = {\n \"Main\" : engines.get_node(\"Main\"),\n \"Left\" : engines.get_node(\"Left\"),\n \"Right\" : engines.get_node(\"Right\"),\n }\n self.camera = self.get_node('camera')\n\nfunc reset():\n self.rotation = 0\n self.current_acceleration = Vector2(0, 0)\n self.current_gravity = Vector2(0, 0)\n self.fuel = 100\n self.do_rotate = false\n self.rotate_factor = 1\n self.accelerate = false\n self.accelerate_factor = 1\n self.boost = false\n self.reset_velocity = true\n","old_contents":"extends RigidBody2D\n\nvar ROTATE_STEP = 6\nvar ROTATE_THRESHOLD = 6.28\n\nvar ACCELERATION = 300\nvar BOOST = 1500\nvar BOOST_FUEL = 6\n\nvar GRAVITY_FACTOR = 100000000000\nvar MAX_FUEL = 100\n\nvar rotation = 0\nvar current_acceleration = Vector2(0, 0)\nvar current_gravity = Vector2(0, 0)\n\nvar engines = []\n\nvar fuel = 100\n\nvar do_rotate = false\nvar rotate_factor = 1\nvar accelerate = false\nvar accelerate_factor = 1\nvar boost = false\n\nvar reset_velocity = true\n\nfunc _integrate_forces(s):\n if self.reset_velocity:\n self.reset_velocity = false\n s.set_linear_velocity(Vector2(0,0))\n return\n\n\n var lv = s.get_linear_velocity()\n var step = s.get_step()\n self.current_acceleration = lv\n\n var engines_on = {\"Main\" : false, \"Left\": false, \"Right\" : false}\n\n if self.do_rotate:\n self.rotation = self.rotation + self.ROTATE_STEP * step * self.rotate_factor\n if self.rotation > self.ROTATE_THRESHOLD:\n self.rotation = self.rotation - self.ROTATE_THRESHOLD\n if self.rotation < 0:\n self.rotation = self.rotation + self.ROTATE_THRESHOLD\n if self.rotate_factor < 0:\n engines_on[\"Left\"] = true\n elif self.rotate_factor > 0:\n engines_on[\"Right\"] = true\n self.set_rot(self.rotation)\n\n var acceleration_vector = Vector2(0,-1).rotated(self.rotation)\n\n if self.accelerate and self.fuel > step * 10:\n lv = lv + acceleration_vector * self.ACCELERATION * step * self.accelerate_factor\n engines_on[\"Main\"] = true\n self.fuel = self.fuel - step * 10\n elif self.boost and self.fuel > step * 10 * self.BOOST_FUEL:\n lv = lv + acceleration_vector * self.BOOST * step\n engines_on[\"Main\"] = true\n engines_on[\"Left\"] = true\n engines_on[\"Right\"] = true\n self.fuel = self.fuel - step * 10 * self.BOOST_FUEL\n\n self.current_gravity = s.get_total_gravity() * step * self.GRAVITY_FACTOR\n lv += self.current_gravity\n self.__engines_start(engines_on)\n s.set_linear_velocity(lv)\n\nfunc __engines_start(engines):\n for engine in engines:\n if engines[engine] == true:\n self.engines[engine].set_emitting(true)\n\nfunc _ready():\n self.set_mode(self.MODE_CHARACTER)\n var engines = self.get_node(\"Engines\")\n self.engines = {\n \"Main\" : engines.get_node(\"Main\"),\n \"Left\" : engines.get_node(\"Left\"),\n \"Right\" : engines.get_node(\"Right\"),\n }\n\nfunc reset():\n self.rotation = 0\n self.current_acceleration = Vector2(0, 0)\n self.current_gravity = Vector2(0, 0)\n self.fuel = 100\n self.do_rotate = false\n self.rotate_factor = 1\n self.accelerate = false\n self.accelerate_factor = 1\n self.boost = false\n self.reset_velocity = true\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"29cbc9125360349e2a32be909dc0c9b3368b63c7","subject":"Some more door calibrations","message":"Some more door calibrations\n","repos":"P1X-in\/rat-is-fat","old_file":"scripts\/player.gd","new_file":"scripts\/player.gd","new_contents":"extends \"res:\/\/scripts\/moving_object.gd\"\n\nvar player_id\nvar is_playing = false\nvar is_alive = true\nvar attack_range = 100\nvar attack_width = PI * 0.33\nvar attack_strength = 1\nvar blast\n\nvar target_cone\nvar target_cone_vector = [0, 0]\nvar target_cone_angle = 0.0\n\nvar panel\n\nvar EXIT_THRESHOLD = 30\n\nfunc _init(bag, player_id).(bag):\n self.bag = bag\n self.player_id = player_id\n self.velocity = 200\n self.avatar = preload(\"res:\/\/scenes\/player\/player.xscn\").instance()\n self.body_part_head = self.avatar.get_node('head')\n self.hat = self.body_part_head.get_node('hat')\n self.body_part_body = self.avatar.get_node('body')\n self.body_part_footer = self.avatar.get_node('footer')\n self.target_cone = self.avatar.get_node('attack_cone')\n self.animations = self.avatar.get_node('body_animations')\n self.blast = self.avatar.get_node('blast_animations')\n\n self.bind_gamepad(player_id)\n self.panel = self.bag.hud.bind_player_panel(player_id)\n self.hat.set_frame(player_id)\n\nfunc bind_gamepad(id):\n var gamepad = self.bag.input.devices['pad' + str(id)]\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_enter_game_gamepad.gd\").new(self.bag, self))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_axis.gd\").new(self.bag, self, 0))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_axis.gd\").new(self.bag, self, 1))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_gamepad.gd\").new(self.bag, self, 2))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_gamepad.gd\").new(self.bag, self, 3))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_gamepad.gd\").new(self.bag, self))\n\nfunc bind_keyboard_and_mouse():\n var keyboard = self.bag.input.devices['keyboard']\n var mouse = self.bag.input.devices['mouse']\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_enter_game_keyboard.gd\").new(self.bag, self))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 1, KEY_W, -1))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 1, KEY_S, 1))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 0, KEY_A, -1))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 0, KEY_D, 1))\n mouse.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_mouse.gd\").new(self.bag, self))\n mouse.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_mouse.gd\").new(self.bag, self))\n\nfunc enter_game():\n self.is_playing = true\n self.spawn(self.bag.room_loader.get_spawn_position('initial' + str(self.player_id)))\n self.panel.show()\n\nfunc spawn(position):\n self.is_alive = true\n .spawn(position)\n\nfunc die():\n self.is_alive = false\n .die()\n\nfunc process(delta):\n self.adjust_attack_cone()\n .process(delta)\n self.check_doors()\n self.handle_items()\n\nfunc modify_position(delta):\n .modify_position(delta)\n self.flip(self.target_cone_vector[0])\n self.handle_animations()\n\nfunc handle_animations():\n if not self.animations.is_playing():\n if abs(self.movement_vector[0]) > self.AXIS_THRESHOLD || abs(self.movement_vector[1]) > self.AXIS_THRESHOLD:\n self.animations.play('run')\n else:\n self.animations.play('idle')\n else:\n if self.animations.get_current_animation() == 'idle' && (abs(self.movement_vector[0]) > self.AXIS_THRESHOLD || abs(self.movement_vector[1]) > self.AXIS_THRESHOLD):\n self.animations.play('run')\n elif self.animations.get_current_animation() == 'run' && abs(self.movement_vector[0]) < self.AXIS_THRESHOLD && abs(self.movement_vector[1]) < self.AXIS_THRESHOLD:\n self.animations.play('idle')\n\n\nfunc handle_items():\n var items = self.bag.items.get_items_near_object(self)\n for item in items:\n if item.power_up_type == 0:\n self.get_fat(item.power_up_amount)\n else:\n self.get_powert(item.power_up_amount)\n\n item.pick()\n\n\nfunc adjust_attack_cone():\n if abs(self.target_cone_vector[0]) < self.AXIS_THRESHOLD || abs(self.target_cone_vector[1]) < self.AXIS_THRESHOLD:\n return\n\n self.target_cone_angle = -atan2(self.target_cone_vector[1], self.target_cone_vector[0]) - PI\/2\n self.target_cone.set_rot(self.target_cone_angle)\n\nfunc attack():\n var enemies\n var random_attack = 'attack'+ str(1 + randi() % 2)\n\n if not self.animations.get_current_animation() == 'attack1' and not self.animations.get_current_animation() == 'attack2' :\n self.animations.play(random_attack);\n self.blast.play('blast')\n elif not self.animations.is_playing():\n if self.animations.get_current_animation() == 'attack1':\n self.animations.play('attack2')\n else:\n self.animations.play('attack1')\n self.blast.play('blast')\n\n enemies = self.bag.enemies.get_enemies_near_object(self, self.attack_range, self.target_cone_vector, self.attack_width)\n for enemy in enemies:\n enemy.recieve_damage(self.attack_strength)\n enemy.push_back(self)\n\nfunc get_power(amount):\n self.attack_strength += amount\n if self.attack_range >= 16:\n self.die();\n\n self.hp -= amount\n self.max_hp -= amount\n\nfunc get_fat(amount):\n self.hp += amount\n self.max_hp += amount\n\nfunc check_colisions():\n return\n\nfunc check_doors():\n if not self.bag.game_state.doors_open:\n return;\n\n var door_coords\n var cell = self.bag.game_state.current_cell\n if cell.north != null:\n door_coords = self.bag.room_loader.door_definitions['north'][1]\n if self.check_exit(door_coords, cell.north, Vector2(16, 0)):\n self.bag.players.move_to_entry_position('south')\n return\n if cell.south != null:\n door_coords = self.bag.room_loader.door_definitions['south'][1]\n if self.check_exit(door_coords, cell.south, Vector2(16, 40)):\n self.bag.players.move_to_entry_position('north')\n return\n if cell.east != null:\n door_coords = self.bag.room_loader.door_definitions['east'][1]\n if self.check_exit(door_coords, cell.east, Vector2(40, 0)):\n self.bag.players.move_to_entry_position('west')\n return\n if cell.west != null:\n door_coords = self.bag.room_loader.door_definitions['west'][1]\n if self.check_exit(door_coords, cell.west, Vector2(-10, 0)):\n self.bag.players.move_to_entry_position('east')\n return\n\nfunc check_exit(door_coords, cell, door_offset):\n var exit_area = self.bag.room_loader.translate_position(Vector2(door_coords[0] + self.bag.room_loader.side_offset, door_coords[1]))\n exit_area = exit_area + door_offset\n var distance = self.calculate_distance(exit_area)\n if distance < self.EXIT_THRESHOLD:\n self.bag.map.switch_to_cell(cell)\n return true\n return false\n\nfunc move_to_entry_position(name):\n var entry_position\n print(name, self.player_id)\n entry_position = self.bag.room_loader.get_spawn_position(name + str(self.player_id))\n self.avatar.set_pos(entry_position)\n\n","old_contents":"extends \"res:\/\/scripts\/moving_object.gd\"\n\nvar player_id\nvar is_playing = false\nvar is_alive = true\nvar attack_range = 100\nvar attack_width = PI * 0.33\nvar attack_strength = 1\nvar blast\n\nvar target_cone\nvar target_cone_vector = [0, 0]\nvar target_cone_angle = 0.0\n\nvar panel\n\nvar EXIT_THRESHOLD = 30\n\nfunc _init(bag, player_id).(bag):\n self.bag = bag\n self.player_id = player_id\n self.velocity = 200\n self.avatar = preload(\"res:\/\/scenes\/player\/player.xscn\").instance()\n self.body_part_head = self.avatar.get_node('head')\n self.hat = self.body_part_head.get_node('hat')\n self.body_part_body = self.avatar.get_node('body')\n self.body_part_footer = self.avatar.get_node('footer')\n self.target_cone = self.avatar.get_node('attack_cone')\n self.animations = self.avatar.get_node('body_animations')\n self.blast = self.avatar.get_node('blast_animations')\n\n self.bind_gamepad(player_id)\n self.panel = self.bag.hud.bind_player_panel(player_id)\n self.hat.set_frame(player_id)\n\nfunc bind_gamepad(id):\n var gamepad = self.bag.input.devices['pad' + str(id)]\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_enter_game_gamepad.gd\").new(self.bag, self))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_axis.gd\").new(self.bag, self, 0))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_axis.gd\").new(self.bag, self, 1))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_gamepad.gd\").new(self.bag, self, 2))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_gamepad.gd\").new(self.bag, self, 3))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_gamepad.gd\").new(self.bag, self))\n\nfunc bind_keyboard_and_mouse():\n var keyboard = self.bag.input.devices['keyboard']\n var mouse = self.bag.input.devices['mouse']\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_enter_game_keyboard.gd\").new(self.bag, self))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 1, KEY_W, -1))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 1, KEY_S, 1))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 0, KEY_A, -1))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 0, KEY_D, 1))\n mouse.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_mouse.gd\").new(self.bag, self))\n mouse.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_mouse.gd\").new(self.bag, self))\n\nfunc enter_game():\n self.is_playing = true\n self.spawn(self.bag.room_loader.get_spawn_position('initial' + str(self.player_id)))\n self.panel.show()\n\nfunc spawn(position):\n self.is_alive = true\n .spawn(position)\n\nfunc die():\n self.is_alive = false\n .die()\n\nfunc process(delta):\n self.adjust_attack_cone()\n .process(delta)\n self.check_doors()\n self.handle_items()\n\nfunc modify_position(delta):\n .modify_position(delta)\n self.flip(self.target_cone_vector[0])\n self.handle_animations()\n\nfunc handle_animations():\n if not self.animations.is_playing():\n if abs(self.movement_vector[0]) > self.AXIS_THRESHOLD || abs(self.movement_vector[1]) > self.AXIS_THRESHOLD:\n self.animations.play('run')\n else:\n self.animations.play('idle')\n else:\n if self.animations.get_current_animation() == 'idle' && (abs(self.movement_vector[0]) > self.AXIS_THRESHOLD || abs(self.movement_vector[1]) > self.AXIS_THRESHOLD):\n self.animations.play('run')\n elif self.animations.get_current_animation() == 'run' && abs(self.movement_vector[0]) < self.AXIS_THRESHOLD && abs(self.movement_vector[1]) < self.AXIS_THRESHOLD:\n self.animations.play('idle')\n\n\nfunc handle_items():\n var items = self.bag.items.get_items_near_object(self)\n for item in items:\n if item.power_up_type == 0:\n self.get_fat(item.power_up_amount)\n else:\n self.get_powert(item.power_up_amount)\n\n item.pick()\n\n\nfunc adjust_attack_cone():\n if abs(self.target_cone_vector[0]) < self.AXIS_THRESHOLD || abs(self.target_cone_vector[1]) < self.AXIS_THRESHOLD:\n return\n\n self.target_cone_angle = -atan2(self.target_cone_vector[1], self.target_cone_vector[0]) - PI\/2\n self.target_cone.set_rot(self.target_cone_angle)\n\nfunc attack():\n var enemies\n var random_attack = 'attack'+ str(1 + randi() % 2)\n\n if not self.animations.get_current_animation() == 'attack1' and not self.animations.get_current_animation() == 'attack2' :\n self.animations.play(random_attack);\n self.blast.play('blast')\n elif not self.animations.is_playing():\n if self.animations.get_current_animation() == 'attack1':\n self.animations.play('attack2')\n else:\n self.animations.play('attack1')\n self.blast.play('blast')\n\n enemies = self.bag.enemies.get_enemies_near_object(self, self.attack_range, self.target_cone_vector, self.attack_width)\n for enemy in enemies:\n enemy.recieve_damage(self.attack_strength)\n enemy.push_back(self)\n\nfunc get_power(amount):\n self.attack_strength += amount\n if self.attack_range >= 16:\n self.die();\n\n self.hp -= amount\n self.max_hp -= amount\n\nfunc get_fat(amount):\n self.hp += amount\n self.max_hp += amount\n\nfunc check_colisions():\n return\n\nfunc check_doors():\n if not self.bag.game_state.doors_open:\n return;\n\n var door_coords\n var cell = self.bag.game_state.current_cell\n if cell.north != null:\n door_coords = self.bag.room_loader.door_definitions['north'][1]\n if self.check_exit(door_coords, cell.north, Vector2(0, -10)):\n self.bag.players.move_to_entry_position('south')\n return\n if cell.south != null:\n door_coords = self.bag.room_loader.door_definitions['south'][1]\n if self.check_exit(door_coords, cell.south, Vector2(0, 40)):\n self.bag.players.move_to_entry_position('north')\n return\n if cell.east != null:\n door_coords = self.bag.room_loader.door_definitions['east'][1]\n if self.check_exit(door_coords, cell.east, Vector2(48, 0)):\n self.bag.players.move_to_entry_position('west')\n return\n if cell.west != null:\n door_coords = self.bag.room_loader.door_definitions['west'][1]\n if self.check_exit(door_coords, cell.west, Vector2(-28, 0)):\n self.bag.players.move_to_entry_position('east')\n return\n\nfunc check_exit(door_coords, cell, door_offset):\n var exit_area = self.bag.room_loader.translate_position(Vector2(door_coords[0] + self.bag.room_loader.side_offset, door_coords[1]))\n exit_area = exit_area + door_offset\n var distance = self.calculate_distance(exit_area)\n if distance < self.EXIT_THRESHOLD:\n self.bag.map.switch_to_cell(cell)\n return true\n return false\n\nfunc move_to_entry_position(name):\n var entry_position\n print(name, self.player_id)\n entry_position = self.bag.room_loader.get_spawn_position(name + str(self.player_id))\n self.avatar.set_pos(entry_position)\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"46291aebf6ef8e0ad611d0c27a040f394aa66bb3","subject":"fix a nil error at line 22","message":"fix a nil error at line 22","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"misc\/joypads\/joypads.gd","new_file":"misc\/joypads\/joypads.gd","new_contents":"extends Node2D\n\n# Joypads demo, written by Dana Olson \n#\n# This is a demo of joypad support, and doubles as a testing application\n# inspired by and similar to jstest-gtk.\n#\n# Licensed under the MIT license\n\n# Member variables\nvar joy_num\nvar cur_joy = -1\nvar axis_value\n\nconst DEADZONE = 0.2\n\nfunc _fixed_process(delta):\n\t# Get the joypad device number from the spinbox\n\tjoy_num = get_node(\"device_info\/joy_num\").get_value()\n\n\t# Display the name of the joypad if we haven't already\n\tif joy_num != cur_joy:\n\t\tcur_joy = joy_num\n\t\tget_node(\"device_info\/joy_name\").set_text(Input.get_joy_name(joy_num))\n\n\t# Loop through the axes and show their current values\n\tfor axis in range(JOY_AXIS_0, JOY_AXIS_MAX):\n\t\taxis_value = Input.get_joy_axis(joy_num, axis)\n\t\tget_node(\"axes\/axis_prog\" + str(axis)).set_value(100*axis_value)\n\t\tget_node(\"axes\/axis_val\" + str(axis)).set_text(str(axis_value))\n\t\t# Show joypad direction indicators\n\t\tif (axis <= JOY_ANALOG_RY):\n\t\t\tif (abs(axis_value) < DEADZONE):\n\t\t\t\tget_node(\"diagram\/axes\/\" + str(axis) + \"+\").hide()\n\t\t\t\tget_node(\"diagram\/axes\/\" + str(axis) + \"-\").hide()\n\t\t\telif (axis_value > 0):\n\t\t\t\tget_node(\"diagram\/axes\/\" + str(axis) + \"+\").show()\n\t\t\telse:\n\t\t\t\tget_node(\"diagram\/axes\/\" + str(axis) + \"-\").show()\n\n\t# Loop through the buttons and highlight the ones that are pressed\n\tfor btn in range(JOY_BUTTON_0, JOY_BUTTON_MAX):\n\t\tif (Input.is_joy_button_pressed(joy_num, btn)):\n\t\t\tget_node(\"buttons\/btn\" + str(btn)).add_color_override(\"font_color\", Color(1, 1, 1, 1))\n\t\t\tget_node(\"diagram\/buttons\/\" + str(btn)).show()\n\t\telse:\n\t\t\tget_node(\"buttons\/btn\" + str(btn)).add_color_override(\"font_color\", Color(0.2, 0.1, 0.3, 1))\n\t\t\tget_node(\"diagram\/buttons\/\" + str(btn)).hide()\n\nfunc _ready():\n\tset_fixed_process(true)\n\tInput.connect(\"joy_connection_changed\", self, \"_on_joy_connection_changed\")\n\n#Called whenever a joypad has been connected or disconnected.\nfunc _on_joy_connection_changed(device_id, connected):\n\tif device_id == cur_joy:\n\t\tif connected:\n\t\t\tget_node(\"device_info\/joy_name\").set_text(Input.get_joy_name(device_id))\n\t\telse:\n\t\t\tget_node(\"device_info\/joy_name\").set_text(\"\")\n\nfunc _on_start_vibration_pressed():\n\tvar weak = get_node(\"vibration\/vibration_weak_value\").get_value()\n\tvar strong = get_node(\"vibration\/vibration_strong_value\").get_value()\n\tvar duration = get_node(\"vibration\/vibration_duration_value\").get_value()\n\n\tInput.start_joy_vibration(cur_joy, weak, strong, duration)\n\nfunc _on_stop_vibration_pressed():\n\tInput.stop_joy_vibration(cur_joy)\n","old_contents":"extends Node2D\n\n# Joypads demo, written by Dana Olson \n#\n# This is a demo of joypad support, and doubles as a testing application\n# inspired by and similar to jstest-gtk.\n#\n# Licensed under the MIT license\n\n# Member variables\nvar joy_num\nvar cur_joy\nvar axis_value\n\nconst DEADZONE = 0.2\n\nfunc _fixed_process(delta):\n\t# Get the joypad device number from the spinbox\n\tjoy_num = get_node(\"device_info\/joy_num\").get_value()\n\n\t# Display the name of the joypad if we haven't already\n\tif joy_num != cur_joy:\n\t\tcur_joy = joy_num\n\t\tget_node(\"device_info\/joy_name\").set_text(Input.get_joy_name(joy_num))\n\n\t# Loop through the axes and show their current values\n\tfor axis in range(JOY_AXIS_0, JOY_AXIS_MAX):\n\t\taxis_value = Input.get_joy_axis(joy_num, axis)\n\t\tget_node(\"axes\/axis_prog\" + str(axis)).set_value(100*axis_value)\n\t\tget_node(\"axes\/axis_val\" + str(axis)).set_text(str(axis_value))\n\t\t# Show joypad direction indicators\n\t\tif (axis <= JOY_ANALOG_RY):\n\t\t\tif (abs(axis_value) < DEADZONE):\n\t\t\t\tget_node(\"diagram\/axes\/\" + str(axis) + \"+\").hide()\n\t\t\t\tget_node(\"diagram\/axes\/\" + str(axis) + \"-\").hide()\n\t\t\telif (axis_value > 0):\n\t\t\t\tget_node(\"diagram\/axes\/\" + str(axis) + \"+\").show()\n\t\t\telse:\n\t\t\t\tget_node(\"diagram\/axes\/\" + str(axis) + \"-\").show()\n\n\t# Loop through the buttons and highlight the ones that are pressed\n\tfor btn in range(JOY_BUTTON_0, JOY_BUTTON_MAX):\n\t\tif (Input.is_joy_button_pressed(joy_num, btn)):\n\t\t\tget_node(\"buttons\/btn\" + str(btn)).add_color_override(\"font_color\", Color(1, 1, 1, 1))\n\t\t\tget_node(\"diagram\/buttons\/\" + str(btn)).show()\n\t\telse:\n\t\t\tget_node(\"buttons\/btn\" + str(btn)).add_color_override(\"font_color\", Color(0.2, 0.1, 0.3, 1))\n\t\t\tget_node(\"diagram\/buttons\/\" + str(btn)).hide()\n\nfunc _ready():\n\tset_fixed_process(true)\n\tInput.connect(\"joy_connection_changed\", self, \"_on_joy_connection_changed\")\n\n#Called whenever a joypad has been connected or disconnected.\nfunc _on_joy_connection_changed(device_id, connected):\n\tif device_id == cur_joy:\n\t\tif connected:\n\t\t\tget_node(\"device_info\/joy_name\").set_text(Input.get_joy_name(device_id))\n\t\telse:\n\t\t\tget_node(\"device_info\/joy_name\").set_text(\"\")\n\nfunc _on_start_vibration_pressed():\n\tvar weak = get_node(\"vibration\/vibration_weak_value\").get_value()\n\tvar strong = get_node(\"vibration\/vibration_strong_value\").get_value()\n\tvar duration = get_node(\"vibration\/vibration_duration_value\").get_value()\n\n\tInput.start_joy_vibration(cur_joy, weak, strong, duration)\n\nfunc _on_stop_vibration_pressed():\n\tInput.stop_joy_vibration(cur_joy)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"9a3a831a3463629ee3a13a6009325156fa90a7cf","subject":"Update Android IAP demo to reflect recent changes","message":"Update Android IAP demo to reflect recent changes\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"misc\/android_iap\/iap_demo.gd","new_file":"misc\/android_iap\/iap_demo.gd","new_contents":"extends Control\n\nconst TEST_ITEM_SKU = \"my_in_app_purchase_sku\"\n\nonready var alert_dialog = $AlertDialog\nonready var label = $Label\n\nvar payment = null\nvar test_item_purchase_token = null\n\nfunc _ready():\n\tif Engine.has_singleton(\"GodotGooglePlayBilling\"):\n\t\tlabel.text += \"\\n\\n\\nTest item SKU: %s\" % TEST_ITEM_SKU\n\n\t\tpayment = Engine.get_singleton(\"GodotGooglePlayBilling\")\n\t\tpayment.connect(\"connected\", self, \"_on_connected\") # No params\n\t\tpayment.connect(\"disconnected\", self, \"_on_disconnected\") # No params\n\t\tpayment.connect(\"connect_error\", self, \"_on_connect_error\") # Response ID (int), Debug message (string)\n\t\tpayment.connect(\"purchases_updated\", self, \"_on_purchases_updated\") # Purchases (Dictionary[])\n\t\tpayment.connect(\"purchase_error\", self, \"_on_purchase_error\") # Response ID (int), Debug message (string)\n\t\tpayment.connect(\"sku_details_query_completed\", self, \"_on_sku_details_query_completed\") # SKUs (Dictionary[])\n\t\tpayment.connect(\"sku_details_query_error\", self, \"_on_sku_details_query_error\") # Response ID (int), Debug message (string), Queried SKUs (string[])\n\t\tpayment.connect(\"purchase_acknowledged\", self, \"_on_purchase_acknowledged\") # Purchase token (string)\n\t\tpayment.connect(\"purchase_acknowledgement_error\", self, \"_on_purchase_acknowledgement_error\") # Response ID (int), Debug message (string), Purchase token (string)\n\t\tpayment.connect(\"purchase_consumed\", self, \"_on_purchase_consumed\") # Purchase token (string)\n\t\tpayment.connect(\"purchase_consumption_error\", self, \"_on_purchase_consumption_error\") # Response ID (int), Debug message (string), Purchase token (string)\n\t\tpayment.startConnection()\n\telse:\n\t\tshow_alert(\"Android IAP support is not enabled. Make sure you have enabled 'Custom Build' and installed and enabled the GodotGooglePlayBilling plugin in your Android export settings! This application will not work.\")\n\n\nfunc show_alert(text):\n\talert_dialog.dialog_text = text\n\talert_dialog.popup_centered()\n\n\nfunc _on_connected():\n\tprint(\"PurchaseManager connected\")\n\n\t# We must acknowledge all puchases.\n\t# See https:\/\/developer.android.com\/google\/play\/billing\/integrate#process for more information\n\tvar query = payment.queryPurchases(\"inapp\") # Use \"subs\" for subscriptions\n\tvar purchase_token = null\n\tif query.status == OK:\n\t\tfor purchase in query.purchases:\n\t\t\tif !purchase.is_acknowledged:\n\t\t\t\tprint(\"Purchase \" + str(purchase.sku) + \" has not been acknowledged. Acknowledging...\")\n\t\t\t\tpayment.acknowledgePurchase(purchase.purchase_token)\n\telse:\n\t\tprint(\"Purchase query failed: %d\" % query.status)\n\n\nfunc _on_sku_details_query_completed(sku_details):\n\tfor available_sku in sku_details:\n\t\tshow_alert(to_json(available_sku))\n\n\nfunc _on_purchases_updated(purchases):\n\tprint(\"Purchases updated: %s\" % to_json(purchases))\n\n\t# See _on_connected\n\tfor purchase in purchases:\n\t\tif !purchase.is_acknowledged:\n\t\t\tprint(\"Purchase \" + str(purchase.sku) + \" has not been acknowledged. Acknowledging...\")\n\t\t\tpayment.acknowledgePurchase(purchase.purchase_token)\n\n\tif purchases.size() > 0:\n\t\ttest_item_purchase_token = purchases[purchases.size() - 1].purchase_token\n\n\nfunc _on_purchase_acknowledged(purchase_token):\n\tprint(\"Purchase acknowledged: %s\" % purchase_token)\n\n\nfunc _on_purchase_consumed(purchase_token):\n\tshow_alert(\"Purchase consumed successfully: %s\" % purchase_token)\n\n\nfunc _on_purchase_error(code, message):\n\tshow_alert(\"Purchase error %d: %s\" % [code, message])\n\n\nfunc _on_purchase_acknowledgement_error(code, message):\n\tshow_alert(\"Purchase acknowledgement error %d: %s\" % [code, message])\n\n\nfunc _on_purchase_consumption_error(code, message, purchase_token):\n\tshow_alert(\"Purchase consumption error %d: %s, purchase token: %s\" % [code, message, purchase_token])\n\n\nfunc _on_sku_details_query_error(code, message):\n\tshow_alert(\"SKU details query error %d: %s\" % [code, message])\n\n\nfunc _on_disconnected():\n\tshow_alert(\"GodotGooglePlayBilling disconnected. Will try to reconnect in 10s...\")\n\tyield(get_tree().create_timer(10), \"timeout\")\n\tpayment.startConnection()\n\n\n# GUI\nfunc _on_QuerySkuDetailsButton_pressed():\n\tpayment.querySkuDetails([TEST_ITEM_SKU], \"inapp\") # Use \"subs\" for subscriptions\n\n\nfunc _on_PurchaseButton_pressed():\n\tvar response = payment.purchase(TEST_ITEM_SKU)\n\tif response.status != OK:\n\t\tshow_alert(\"Purchase error %d: %s\" % [response.response_code, response.debug_message])\n\n\nfunc _on_ConsumeButton_pressed():\n\tif test_item_purchase_token == null:\n\t\tshow_alert(\"You need to set 'test_item_purchase_token' first! (either by hand or in code)\")\n\t\treturn\n\n\tpayment.consumePurchase(test_item_purchase_token)\n","old_contents":"extends Control\n\nconst TEST_ITEM_SKU = \"my_in_app_purchase_sku\"\n\nonready var alert_dialog = $AlertDialog\nonready var label = $Label\n\nvar payment = null\nvar test_item_purchase_token = null\n\nfunc _ready():\n\tif Engine.has_singleton(\"GodotPayment\"):\n\t\tlabel.text += \"\\n\\n\\nTest item SKU: %s\" % TEST_ITEM_SKU\n\n\t\tpayment = Engine.get_singleton(\"GodotPayment\")\n\t\tpayment.connect(\"connected\", self, \"_on_connected\") # No params\n\t\tpayment.connect(\"disconnected\", self, \"_on_disconnected\") # No params\n\t\tpayment.connect(\"connect_error\", self, \"_on_connect_error\") # Response ID (int), Debug message (string)\n\t\tpayment.connect(\"purchases_updated\", self, \"_on_purchases_updated\") # Purchases (Dictionary[])\n\t\tpayment.connect(\"purchase_error\", self, \"_on_purchase_error\") # Response ID (int), Debug message (string)\n\t\tpayment.connect(\"sku_details_query_completed\", self, \"_on_sku_details_query_completed\") # SKUs (Dictionary[])\n\t\tpayment.connect(\"sku_details_query_error\", self, \"_on_sku_details_query_error\") # Response ID (int), Debug message (string), Queried SKUs (string[])\n\t\tpayment.connect(\"purchase_acknowledged\", self, \"_on_purchase_acknowledged\") # Purchase token (string)\n\t\tpayment.connect(\"purchase_acknowledgement_error\", self, \"_on_purchase_acknowledgement_error\") # Response ID (int), Debug message (string), Purchase token (string)\n\t\tpayment.connect(\"purchase_consumed\", self, \"_on_purchase_consumed\") # Purchase token (string)\n\t\tpayment.connect(\"purchase_consumption_error\", self, \"_on_purchase_consumption_error\") # Response ID (int), Debug message (string), Purchase token (string)\n\t\tpayment.startConnection()\n\telse:\n\t\tshow_alert(\"Android IAP support is not enabled. Make sure you have enabled 'Custom Build' and the GodotPayment plugin in your Android export settings! This application will not work.\")\n\n\nfunc show_alert(text):\n\talert_dialog.dialog_text = text\n\talert_dialog.popup_centered()\n\n\nfunc _on_connected():\n\tprint(\"PurchaseManager connected\")\n\n\t# We must acknowledge all puchases.\n\t# See https:\/\/developer.android.com\/google\/play\/billing\/integrate#process for more information\n\tvar query = payment.queryPurchases(\"inapp\") # Use \"subs\" for subscriptions\n\tvar purchase_token = null\n\tif query.status == OK:\n\t\tfor purchase in query.purchases:\n\t\t\tif !purchase.is_acknowledged:\n\t\t\t\tprint(\"Purchase \" + str(purchase.sku) + \" has not been acknowledged. Acknowledging...\")\n\t\t\t\tpayment.acknowledgePurchase(purchase.purchase_token)\n\telse:\n\t\tprint(\"Purchase query failed: %d\" % query.status)\n\n\nfunc _on_sku_details_query_completed(sku_details):\n\tfor available_sku in sku_details:\n\t\tshow_alert(to_json(available_sku))\n\n\nfunc _on_purchases_updated(purchases):\n\tprint(\"Purchases updated: %s\" % to_json(purchases))\n\n\t# See _on_connected\n\tfor purchase in purchases:\n\t\tif !purchase.is_acknowledged:\n\t\t\tprint(\"Purchase \" + str(purchase.sku) + \" has not been acknowledged. Acknowledging...\")\n\t\t\tpayment.acknowledgePurchase(purchase.purchase_token)\n\n\tif purchases.size() > 0:\n\t\ttest_item_purchase_token = purchases[purchases.size() - 1].purchase_token\n\n\nfunc _on_purchase_acknowledged(purchase_token):\n\tprint(\"Purchase acknowledged: %s\" % purchase_token)\n\n\nfunc _on_purchase_consumed(purchase_token):\n\tshow_alert(\"Purchase consumed successfully: %s\" % purchase_token)\n\n\nfunc _on_purchase_error(code, message):\n\tshow_alert(\"Purchase error %d: %s\" % [code, message])\n\n\nfunc _on_purchase_acknowledgement_error(code, message):\n\tshow_alert(\"Purchase acknowledgement error %d: %s\" % [code, message])\n\n\nfunc _on_purchase_consumption_error(code, message, purchase_token):\n\tshow_alert(\"Purchase consumption error %d: %s, purchase token: %s\" % [code, message, purchase_token])\n\n\nfunc _on_sku_details_query_error(code, message):\n\tshow_alert(\"SKU details query error %d: %s\" % [code, message])\n\n\nfunc _on_disconnected():\n\tshow_alert(\"GodotPayment disconnected. Will try to reconnect in 10s...\")\n\tyield(get_tree().create_timer(10), \"timeout\")\n\tpayment.startConnection()\n\n\n# GUI\nfunc _on_QuerySkuDetailsButton_pressed():\n\tpayment.querySkuDetails([TEST_ITEM_SKU], \"inapp\") # Use \"subs\" for subscriptions\n\n\nfunc _on_PurchaseButton_pressed():\n\tvar response = payment.purchase(TEST_ITEM_SKU)\n\tif response.status != OK:\n\t\tshow_alert(\"Purchase error %d: %s\" % [response.response_code, response.debug_message])\n\n\nfunc _on_ConsumeButton_pressed():\n\tif test_item_purchase_token == null:\n\t\tshow_alert(\"You need to set 'test_item_purchase_token' first! (either by hand or in code)\")\n\t\treturn\n\n\tpayment.consumePurchase(test_item_purchase_token)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"00801a4e066383a460e0816c8d72d423ba022226","subject":"But i didn't change camera control?","message":"But i didn't change camera control?\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/CameraControl.gd","new_file":"src\/scripts\/CameraControl.gd","new_contents":"# Make this work on touch:\n# catch InputEventScreenDrag, InputEventScreenTouch\n# write two-finger zoom\n#\n#\n#\n# limit zooming?\n#\n#\n#\n# THANKS TO\n# Rook\n# http:\/\/www.godotengine.org\/forum\/viewtopic.php?f=11&t=1580\n\n# orbit camera function that uses the mouse, mouse wheel and mouse buttons to orbit around a\n# target point that starts at the origin.\n# credit to the forums and the documentation for various tips and pointers\nextends Camera\n\n\n# global working variables\nvar turn = Vector2( 0.0, 0.0 ) # the amount the mouse has turned\nvar mouseposlast = Input.get_mouse_pos() # the mouses last position\nvar pos = Vector3(0.0,0.0,0.0) # the position of the camera\nvar up = Vector3(0.0,1.0,0.0) # the normalized 'up' vector pointing vertically\nvar target = Vector3(0.0,0.0,0.0) # the look at target\n\n\n# global tweakable parameters\nvar distance = 30.0 # starting distance of the camera from the target\nvar zoom_rate = 100 # the rate at which the camera zooms in and out of the target\nvar orbitrate = 20 # the rate the camera orbits the target when the mouse is moved\nvar target_move_rate = 1.0 # the rate the target look at point moves\n\n\n# called once after node is setup\nfunc _ready():\n\tset_process_input(true) # process user input events here\n\t# Input.set_mouse_mode(2) # mouse mode captured\n\n\n# recalculates the camera position in orbiting the target and its orientation to look at the target\n# credit to Stephen Tierney (Game Development Discussions website)\nfunc recalculate_camera():\n # calculate the camera position as it orbits a sphere about the target\n\t#pos.x = distance * -sin(turn.x) * cos(turn.y)\n\t#pos.y = distance * -sin(turn.y)\n\t#pos.z = -distance * cos(turn.x) * cos(turn.y)\n\tpos = get_translation();\n\tpos.z = distance;\n # set the position of the camera in its orbit and point it at the target\n\tlook_at_from_pos(pos, target, up)\n\n\n# called to handle a user input event\nfunc _input(ev):\n\t# If the mouse has been moved\n\t#if (ev.type==InputEvent.MOUSE_MOTION and ev.button_mask == 1):\n # calculate the delta change from the last mouse movement\n\t\t#var mousedelta = (mouseposlast - ev.pos)\n # scale the mouse delta to a useful value\n\t\t#turn += mousedelta \/ orbitrate\n # record the last position of the mousedelta\n\t\t#mouseposlast = ev.pos\n # if the user spins the mouse wheel up move the camera closer\n\tif (ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_WHEEL_UP):\n\t\tdistance -= zoom_rate * get_process_delta_time()\n # if the user spins the mouse wheel down move the camera farther away\n\telif (ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_WHEEL_DOWN):\n\t\tdistance += zoom_rate * get_process_delta_time()\n # if a cancel action is input close the application\n\telif (ev.is_action(\"ui_cancel\")):\n\t\tOS.get_main_loop().quit()\n\telse:\n\t\treturn\n\t# must call method similar to this to prevent events from propagating\n\t# SceneTree.set_input_as_handled()\n\n # recalculate the camera position and direction\n\trecalculate_camera()\n\n","old_contents":"# Make this work on touch:\n# catch InputEventScreenDrag, InputEventScreenTouch\n# write two-finger zoom\n#\n#\n#\n# limit zooming?\n#\n#\n#\n# THANKS TO\n# Rook\n# http:\/\/www.godotengine.org\/forum\/viewtopic.php?f=11&t=1580\n\n# orbit camera function that uses the mouse, mouse wheel and mouse buttons to orbit around a\n# target point that starts at the origin.\n# credit to the forums and the documentation for various tips and pointers\nextends Camera\n\n\n# global working variables\nvar turn = Vector2( 0.0, 0.0 ) # the amount the mouse has turned\nvar mouseposlast = Input.get_mouse_pos() # the mouses last position\nvar pos = Vector3(0.0,0.0,0.0) # the position of the camera\nvar up = Vector3(0.0,1.0,0.0) # the normalized 'up' vector pointing vertically\nvar target = Vector3(0.0,0.0,0.0) # the look at target\n\n\n# global tweakable parameters\nvar distance = 30.0 # starting distance of the camera from the target\nvar zoom_rate = 100 # the rate at which the camera zooms in and out of the target\nvar orbitrate = 20 # the rate the camera orbits the target when the mouse is moved\nvar target_move_rate = 1.0 # the rate the target look at point moves\n\n\n# called once after node is setup\nfunc _ready():\n\tset_process_input(true) # process user input events here\n\t# Input.set_mouse_mode(2) # mouse mode captured\n\n\n# recalculates the camera position in orbiting the target and its orientation to look at the target\n# credit to Stephen Tierney (Game Development Discussions website)\nfunc recalculate_camera():\n # calculate the camera position as it orbits a sphere about the target\n\t#pos.x = distance * -sin(turn.x) * cos(turn.y)\n\t#pos.y = distance * -sin(turn.y)\n\t#pos.z = -distance * cos(turn.x) * cos(turn.y)\n\tpos = get_translation();\n\tpos.z = distance;\n # set the position of the camera in its orbit and point it at the target\n\tlook_at_from_pos(pos, target, up)\n\n\n# called to handle a user input event\nfunc _input(ev):\n\t# If the mouse has been moved\n\t#if (ev.type==InputEvent.MOUSE_MOTION and ev.button_mask == 1):\n # calculate the delta change from the last mouse movement\n\t\t#var mousedelta = (mouseposlast - ev.pos)\n # scale the mouse delta to a useful value\n\t\t#turn += mousedelta \/ orbitrate\n # record the last position of the mousedelta\n\t\t#mouseposlast = ev.pos\n # if the user spins the mouse wheel up move the camera closer\n\tif (ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_WHEEL_UP):\n\t\tdistance -= zoom_rate * get_process_delta_time()\n # if the user spins the mouse wheel down move the camera farther away\n\telif (ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_WHEEL_DOWN):\n\t\tdistance += zoom_rate * get_process_delta_time()\n # if a cancel action is input close the application\n\telif (ev.is_action(\"ui_cancel\")):\n\t\tOS.get_main_loop().quit()\n\telse:\n\t\treturn\n\t# must call method similar to this to prevent events from propagating\n\t# SceneTree.set_input_as_handled()\n\n # recalculate the camera position and direction\n\trecalculate_camera()\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"7ef8d42568d1efb1278b83204509a68d4fae18eb","subject":"gd \"G\u00e0idhlig\" translation #767. Author: GunChleoc.","message":"gd \"G\u00e0idhlig\" translation #767. Author: GunChleoc.\n","repos":"abougouffa\/lila,pavelo65\/lila,clarkerubber\/lila,ccampo133\/lila,arex1337\/lila,systemovich\/lila,elioair\/lila,luanlv\/lila,arex1337\/lila,ccampo133\/lila,pavelo65\/lila,TangentialAlan\/lila,terokinnunen\/lila,clarkerubber\/lila,pavelo65\/lila,luanlv\/lila,Happy0\/lila,arex1337\/lila,r0k3\/lila,TangentialAlan\/lila,JimmyMow\/lila,abougouffa\/lila,terokinnunen\/lila,systemovich\/lila,luanlv\/lila,terokinnunen\/lila,abougouffa\/lila,clarkerubber\/lila,bjhaid\/lila,TangentialAlan\/lila,systemovich\/lila,danilovsergey\/i-bur,Enigmahack\/lila,JimmyMow\/lila,pawank\/lila,Enigmahack\/lila,arex1337\/lila,Unihedro\/lila,Unihedro\/lila,Enigmahack\/lila,systemovich\/lila,terokinnunen\/lila,Enigmahack\/lila,elioair\/lila,Enigmahack\/lila,JimmyMow\/lila,luanlv\/lila,danilovsergey\/i-bur,abougouffa\/lila,pawank\/lila,Happy0\/lila,bjhaid\/lila,r0k3\/lila,luanlv\/lila,Enigmahack\/lila,abougouffa\/lila,JimmyMow\/lila,arex1337\/lila,danilovsergey\/i-bur,Happy0\/lila,abougouffa\/lila,TangentialAlan\/lila,samuel-soubeyran\/lila,elioair\/lila,terokinnunen\/lila,terokinnunen\/lila,r0k3\/lila,pawank\/lila,Unihedro\/lila,bjhaid\/lila,Unihedro\/lila,arex1337\/lila,clarkerubber\/lila,danilovsergey\/i-bur,elioair\/lila,systemovich\/lila,pawank\/lila,pawank\/lila,TangentialAlan\/lila,Happy0\/lila,elioair\/lila,Happy0\/lila,Unihedro\/lila,elioair\/lila,bjhaid\/lila,samuel-soubeyran\/lila,systemovich\/lila,ccampo133\/lila,r0k3\/lila,bjhaid\/lila,pawank\/lila,ccampo133\/lila,luanlv\/lila,arex1337\/lila,ccampo133\/lila,pavelo65\/lila,clarkerubber\/lila,danilovsergey\/i-bur,pavelo65\/lila,luanlv\/lila,bjhaid\/lila,TangentialAlan\/lila,pawank\/lila,danilovsergey\/i-bur,Happy0\/lila,bjhaid\/lila,ccampo133\/lila,terokinnunen\/lila,elioair\/lila,pavelo65\/lila,abougouffa\/lila,r0k3\/lila,JimmyMow\/lila,clarkerubber\/lila,pavelo65\/lila,clarkerubber\/lila,Unihedro\/lila,Unihedro\/lila,samuel-soubeyran\/lila,JimmyMow\/lila,r0k3\/lila,Enigmahack\/lila,samuel-soubeyran\/lila,danilovsergey\/i-bur,systemovich\/lila,samuel-soubeyran\/lila,r0k3\/lila,TangentialAlan\/lila,JimmyMow\/lila,samuel-soubeyran\/lila,Happy0\/lila,samuel-soubeyran\/lila,ccampo133\/lila","old_file":"conf\/messages.gd","new_file":"conf\/messages.gd","new_contents":"playWithAFriend=Cluich c\u00f2mhla ri caraid\ninviteAFriendToPlayWithYou=Thoir cuireadh do charaid gus cluich c\u00f2mhla riut\nplayWithTheMachine=Cluich an aghaidh a' choimpiutair\nchallengeTheArtificialIntelligence=Thoir ionnsaigh air an inntinn fhuadain\ntoInviteSomeoneToPlayGiveThisUrl=Gus cuireadh a thoirt do chuideigin, thoir an url seo seachad\ngameOver=Cr\u00ecoch a\u2019 gheama\nwaitingForOpponent=A\u2019 feitheamh air n\u00e0mhaid\nwaiting=A\u2019 feitheamh\nyourTurn=An turas agad\naiNameLevelAiLevel=%s inbhe %s\nlevel=Inbhe\ntoggleTheChat=Toglaich a\u2019 chabadaich\ntoggleSound=Toglaich fuaim\nchat=Cabadaich\nresign=G\u00e8ill\ncheckmate=Tul-chasg\nstalemate=Clos-cluiche\nwhite=Geal\nblack=Dubh\ncreateAGame=Cruthaich geama\nnoGameAvailableRightNowCreateOne=Chan eil geama ri fhaighinn an-dr\u00e0sta, cruthaich fear \u00f9r!\nwhiteIsVictorious=Bhuannaich geal\nblackIsVictorious=Bhuannaich dubh\nplayWithTheSameOpponentAgain=Cluich an aghaidh an aon n\u00e0mhaid a-rithist\nnewOpponent=N\u00e0mhaid \u00f9r\nplayWithAnotherOpponent=Cluich an aghaidh n\u00e0mhaid eile\nyourOpponentWantsToPlayANewGameWithYou=Tha an n\u00e0mhaid agad airson geama \u00f9r a chluich c\u00f2mhla riut\njoinTheGame=Thig a-steach dhan gheama\nwhitePlays=Tha geal a\u2019 cluich\nblackPlays=Tha dubh a\u2019 cluich\ntheOtherPlayerHasLeftTheGameYouCanForceResignationOrWaitForHim=Tha an geamaiche eile air a' gheama fh\u00e0gail. Is urrainn dhut g\u00e8illeadh a chur air, no feitheamh air a shon.\nmakeYourOpponentResign=Cuir g\u00e8illeadh air an n\u00e0mhaid agad\nforceResignation=Cuir g\u00e8illeadh air an n\u00e0mhaid agad\ntalkInChat=D\u00e8an cabadaich\ntheFirstPersonToComeOnThisUrlWillPlayWithYou=Cluichidh a\u2019 chiad neach a thig a-steach air an url seo c\u00f2mhla riut.\nwhiteCreatesTheGame=Tha geal a\u2019 cruthachadh a\u2019 gheama\nblackCreatesTheGame=Tha dubh a\u2019 cruthachadh a\u2019 gheama\nwhiteJoinsTheGame=Th\u00e0inig geal a-steach dhan gheama\nblackJoinsTheGame=Th\u00e0inig dubh a-steach dhan gheama\nwhiteResigned=Gh\u00e8ill geal\nblackResigned=Gh\u00e8ill dubh\nwhiteLeftTheGame=Dh\u2019fh\u00e0g geal an geama\nblackLeftTheGame=Dh\u2019fh\u00e0g dubh an geama\nshareThisUrlToLetSpectatorsSeeTheGame=Co-roinn an url seo gus luchd-amhairc a leigeil a-steach dhan gheama\nyouAreViewingThisGameAsASpectator=Tha thu a\u2019 coimhead air a\u2019 gheama seo nad neach-amhairc\nreplayAndAnalyse=Ath-chluich is sgr\u00f9daich\nviewGameStats=Faic stadastaig a\u2019 gheama\nflipBoard=D\u00e8an flip air a\u2019 bh\u00f2rd\nthreefoldRepetition=Treas ath-nochdadh\nclaimADraw=Tagair geama ionnanach\nofferDraw=Tairg geama ionnanach\ndraw=Geama ionnanach\nnbConnectedPlayers=Tha %s geamaichean ceangailte\ntalkAboutChessAndDiscussLichessFeaturesInTheForum=Bruidhinn mu th\u00e0ileasg agus deasbad air na feartan aig lichess air a\u2019 bh\u00f2rd-bhrath\nseeTheGamesBeingPlayedInRealTime=Seall air na geamaichean a tha gan cluich ann am f\u00ecor-\u00f9ine\ngamesBeingPlayedRightNow=Geamaichean a tha gan cluich an-dr\u00e0sta fh\u00e8in\nviewAllNbGames=Seall air a h-uile %s de na geamaichean\nviewNbCheckmates=Seall na chur %s de thul-chasg\nnbBookmarks=%s Comharran-l\u00ecn\nnbPopularGames=%s geamannan m\u00f2r-ch\u00f2rdte\nnbAnalysedGames=%s geamannan sgr\u00f9daichte\nbookmarkedByNbPlayers=Comharra-leabhair le %s cluicheadairean\nviewInFullSize=Seall sa mheud iomlan\nlogOut=Log a-mach\nsignIn=Log a-steach\nsignUp=Cl\u00e0raich\npeople=Daoine\ngames=Geamannan\nforum=B\u00f2rd-brath\nchessPlayers=Geamaichean t\u00e0ileisg\nminutesPerSide=Mionaidean an taobh\nvariant=Caochladh\ntimeControl=Smachdadh-\u00f9ine\nstart=Toiseach\nusername=Far-ainm\npassword=Facal-faire\nhaveAnAccount=A bheil cunntas agad?\nallYouNeedIsAUsernameAndAPassword=Chan eil a dh\u00ecth ort ach far-ainm agus facal-faire\nlearnMoreAboutLichess=Ionnsaich barrachd mu lichess\nrank=Inbhe\ngamesPlayed=Geamannan air an cluich\ndeclineInvitation=Di\u00f9lt cuireadh\ncancel=Sguir dheth\ntimeOut=Dh\u2019fhalbh an \u00f9ine\ndrawOfferSent=Chaidh tairgse airson geama ionnanach a chur\ndrawOfferDeclined=Dhi\u00f9ltadh do thairgse airson geama ionnanach\ndrawOfferAccepted=Ghabhadh ri do thairgse airson geama ionnanach\ndrawOfferCanceled=Sguireadh de do thairgse airson geama ionnanach\nyourOpponentOffersADraw=Tha an n\u00e0mhaid agad a\u2019 tairgse geama ionnanach\naccept=Gabh ris\ndecline=Di\u00f9lt\nplayingRightNow=A\u2019 cluich an-dr\u00e0sta fh\u00e8in\nabortGame=Stad an geama\ngameAborted=Chaidh an geama a stad\nstandard=Coitcheann\nunlimited=Gun chr\u00ecoch\nmode=Modh\ncasual=Gun rangachadh\nrated=Rangaichte\nthisGameIsRated=Tha an geama seo rangaichte\nrematch=Ath-mhaids\nrematchOfferSent=Chaidh tairgse airson ath-chluich a chur\nrematchOfferAccepted=Ghabhadh ri do thairgse airson ath-chluich\nrematchOfferCanceled=Chaidh sgur dhe thairgse ath-mhaids\nrematchOfferDeclined=Tairgse ath-mhaids air a di\u00f9ltadh\ncancelRematchOffer=Sguir dhe thairgse ath-mhaids\nviewRematch=Seall air ath-mhaids\nplay=Cluich\ninbox=Bogsa a-steach\nchatRoom=Se\u00f2mar cabadaich\nspectatorRoom=Se\u00f2mar amhairc\ncomposeMessage=Sgr\u00ecobh teachdaireachd\nsentMessages=Teachdaireachdan air an cur\nincrementInSeconds=Ioncramaid ann an diogan\nfreeOnlineChess=T\u00e0ileasg air loidhne an asgaidh\nspectators=Luchd-amhairc:\nnbWins=Bhuannaich %s\nnbLosses=Chaill %s\nnbDraws=Geama ionnanach le %s\nexportGames=\u00c0s-phortaich geamannan\ncolor=dath\neloRange=Rainse Elo\ngiveNbSeconds=Thoir %s diog(an)\nsearchAPlayer=Lorg cluicheadair\nwhoIsOnline=C\u00f2 tha air loidhne\nallPlayers=A h-uile cluicheadair\nnamedPlayers=Cluicheadairean ainmichte\npremoveEnabledClickAnywhereToCancel=Ro-ghluasad an comas - d\u00e8an briogadh \u00e0ite sam bith gus sgur dheth\nthisPlayerUsesChessComputerAssistance=Tha an cluicheadair seo a\u2019 cleachdadh taic coimpiutair taileisg\nopening=Fosgladh\ntakeback=Tarraing air ais\nproposeATakeback=Tairg tarraing air ais\ntakebackPropositionSent=Tairgse tarraing air ais air a cur\ntakebackPropositionDeclined=Tairgse tarraing air ais air a di\u00f9ltadh\ntakebackPropositionAccepted=Air gabhail ri tairgse tarraing air ais\ntakebackPropositionCanceled=Chaidh sgur dhe thairgse tarraing air ais\nyourOpponentProposesATakeback=Tha am farpaiseach a\u2019 tairgse tarraing air ais\nbookmarkThisGame=Cruthaich comharra-l\u00ecn airson an geama seo.\ntoggleBackground=Toglaich dath a\u2019 ch\u00f9laibh\nadvancedSearch=Lorg adhartach\ntournament=F\u00e8ill-chluich\nfreeOnlineChessGamePlayChessNowInACleanInterfaceNoRegistrationNoAdsNoPluginRequiredPlayChessWithComputerFriendsOrRandomOpponents=T\u00e0ileasg air loidhne an asgaidh. Cluich t\u00e0ileasg ann am pr\u00f2gram air a bheil dreach glan. Gun chl\u00e0radh, gun sanasachd, gun fheum air plugan. Cluich t\u00e0ileasg an aghaidh a\u2019 choimpiutair, charaidean no n\u00e0imhdean air thuaiream.\n","old_contents":"playWithAFriend=Cluich c\u00f2mhla ri caraid\ninviteAFriendToPlayWithYou=Thoir cuireadh do charaid gus cluich c\u00f2mhla riut\nplayWithTheMachine=Cluich an aghaidh a' choimpiutair\nchallengeTheArtificialIntelligence=Thoir ionnsaigh air an inntinn fhuadain\ntoInviteSomeoneToPlayGiveThisUrl=Gus cuireadh a thoirt do chuideigin, thoir an url seo seachad\ngameOver=Cr\u00ecoch a\u2019 gheama\nwaitingForOpponent=A\u2019 feitheamh air n\u00e0mhaid\nwaiting=A\u2019 feitheamh\nyourTurn=An turas agad\naiNameLevelAiLevel=%s inbhe %s\nlevel=Inbhe\ntoggleTheChat=Toglaich a\u2019 chabadaich\nchat=Cabadaich\nresign=G\u00e8ill\ncheckmate=Tul-chasg\nstalemate=Clos-cluiche\nwhite=Geal\nblack=Dubh\ncreateAGame=Cruthaich geama\nnoGameAvailableRightNowCreateOne=Chan eil geama ri fhaighinn an-dr\u00e0sta, cruthaich fear \u00f9r!\nwhiteIsVictorious=Bhuannaich geal\nblackIsVictorious=Bhuannaich dubh\nplayWithTheSameOpponentAgain=Cluich an aghaidh an aon n\u00e0mhaid a-rithist\nnewOpponent=N\u00e0mhaid \u00f9r\nplayWithAnotherOpponent=Cluich an aghaidh n\u00e0mhaid eile\nyourOpponentWantsToPlayANewGameWithYou=Tha an n\u00e0mhaid agad airson geama \u00f9r a chluich c\u00f2mhla riut\njoinTheGame=Thig a-steach dhan gheama\nwhitePlays=Tha geal a\u2019 cluich\nblackPlays=Tha dubh a\u2019 cluich\ntheOtherPlayerHasLeftTheGameYouCanForceResignationOrWaitForHim=Tha an geamaiche eile air a' gheama fh\u00e0gail. Is urrainn dhut g\u00e8illeadh a chur air, no feitheamh air a shon.\nmakeYourOpponentResign=Cuir g\u00e8illeadh air an n\u00e0mhaid agad\nforceResignation=Cuir g\u00e8illeadh air an n\u00e0mhaid agad\ntalkInChat=D\u00e8an cabadaich\ntheFirstPersonToComeOnThisUrlWillPlayWithYou=Cluichidh a\u2019 chiad neach a thig a-steach air an url seo c\u00f2mhla riut.\nwhiteCreatesTheGame=Tha geal a\u2019 cruthachadh a\u2019 gheama\nblackCreatesTheGame=Tha dubh a\u2019 cruthachadh a\u2019 gheama\nwhiteJoinsTheGame=Th\u00e0inig geal a-steach dhan gheama\nblackJoinsTheGame=Th\u00e0inig dubh a-steach dhan gheama\nwhiteResigned=Gh\u00e8ill geal\nblackResigned=Gh\u00e8ill dubh\nwhiteLeftTheGame=Dh\u2019fh\u00e0g geal an geama\nblackLeftTheGame=Dh\u2019fh\u00e0g dubh an geama\nshareThisUrlToLetSpectatorsSeeTheGame=Co-roinn an url seo gus luchd-amhairc a leigeil a-steach dhan gheama\nyouAreViewingThisGameAsASpectator=Tha thu a\u2019 coimhead air a\u2019 gheama seo nad neach-amhairc\nreplayAndAnalyse=Ath-chluich is sgr\u00f9daich\nflipBoard=D\u00e8an flip air a\u2019 bh\u00f2rd\nthreefoldRepetition=Treas ath-nochdadh\nclaimADraw=Tagair geama ionnanach\nofferDraw=Tairg geama ionnanach\ndraw=Geama ionnanach\nnbConnectedPlayers=Tha %s geamaichean ceangailte\ntalkAboutChessAndDiscussLichessFeaturesInTheForum=Bruidhinn mu th\u00e0ileasg agus deasbad air na feartan aig lichess air a\u2019 bh\u00f2rd-bhrath\nseeTheGamesBeingPlayedInRealTime=Seall air na geamaichean a tha gan cluich ann am f\u00ecor-\u00f9ine\ngamesBeingPlayedRightNow=Geamaichean a tha gan cluich an-dr\u00e0sta fh\u00e8in\nviewAllNbGames=Seall air a h-uile %s de na geamaichean\nviewNbCheckmates=Seall na chur %s de thul-chasg\nnbBookmarks=%s Comharran-l\u00ecn\nviewInFullSize=Seall sa mheud iomlan\nlogOut=Log a-mach\nsignIn=Log a-steach\nsignUp=Cl\u00e0raich\npeople=Daoine\ngames=Geamannan\nforum=B\u00f2rd-brath\nchessPlayers=Geamaichean t\u00e0ileisg\nminutesPerSide=Mionaidean an taobh\nvariant=Caochladh\ntimeControl=Smachdadh-\u00f9ine\nstart=Toiseach\nusername=Far-ainm\npassword=Facal-faire\nhaveAnAccount=A bheil cunntas agad?\nallYouNeedIsAUsernameAndAPassword=Chan eil a dh\u00ecth ort ach far-ainm agus facal-faire\nlearnMoreAboutLichess=Ionnsaich barrachd mu lichess\nrank=Inbhe\ngamesPlayed=Geamannan air an cluich\ndeclineInvitation=Di\u00f9lt cuireadh\ncancel=Sguir dheth\ntimeOut=Dh\u2019fhalbh an \u00f9ine\ndrawOfferSent=Chaidh tairgse airson geama ionnanach a chur\ndrawOfferDeclined=Dhi\u00f9ltadh do thairgse airson geama ionnanach\ndrawOfferAccepted=Ghabhadh ri do thairgse airson geama ionnanach\ndrawOfferCanceled=Sguireadh de do thairgse airson geama ionnanach\nyourOpponentOffersADraw=Tha an n\u00e0mhaid agad a\u2019 tairgse geama ionnanach\naccept=Gabh ris\ndecline=Di\u00f9lt\nplayingRightNow=A\u2019 cluich an-dr\u00e0sta fh\u00e8in\nabortGame=Stad an geama\ngameAborted=Chaidh an geama a stad\nstandard=Coitcheann\nunlimited=Gun chr\u00ecoch\nmode=Modh\ncasual=Gun rangachadh\nrated=Rangaichte\nthisGameIsRated=Tha an geama seo rangaichte\nrematch=Ath-mhaids\nrematchOfferSent=Chaidh tairgse airson ath-chluich a chur\nrematchOfferAccepted=Ghabhadh ri do thairgse airson ath-chluich\nplay=Cluich\ninbox=Bogsa a-steach\nchatRoom=Se\u00f2mar cabadaich\ncomposeMessage=Sgr\u00ecobh teachdaireachd\nsentMessages=Teachdaireachdan air an cur\nincrementInSeconds=Ioncramaid ann an diogan\nfreeOnlineChess=T\u00e0ileasg air loidhne an asgaidh\nspectators=Luchd-amhairc:\nnbWins=Bhuannaich %s\nnbLosses=Chaill %s\nnbDraws=Geama ionnanach le %s\nexportGames=\u00c0s-phortaich geamannan\ncolor=dath\nbookmarkThisGame=Cruthaich comharra-l\u00ecn airson an geama seo.\nfreeOnlineChessGamePlayChessNowInACleanInterfaceNoRegistrationNoAdsNoPluginRequiredPlayChessWithComputerFriendsOrRandomOpponents=T\u00e0ileasg air loidhne an asgaidh. Cluich t\u00e0ileasg ann am pr\u00f2gram air a bheil dreach glan. Gun chl\u00e0radh, gun sanasachd, gun fheum air plugan. Cluich t\u00e0ileasg an aghaidh a\u2019 choimpiutair, charaidean no n\u00e0imhdean air thuaiream.\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"da02de9983f4df6dafa7433577b8b92dc3765fbf","subject":"better style","message":"better style\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Blocks\/LaserBlock.gd","new_file":"src\/scripts\/Blocks\/LaserBlock.gd","new_contents":"extends \"AbstractBlock.gd\"\n\nvar mat\nvar laserExtent = Vector3()\n\n# color\nfunc setTexture(color=Color(0.5, 0, 0)):\n\tvar mat = load(\"res:\/\/materials\/block_Laser.mtl\")\n\tmat.set_parameter(FixedMaterial.PARAM_EMISSION, Color(0.2, 0.1, 0.1))\n\tself.get_node(\"MeshInstance\").set_material_override(mat)\n\n\treturn self\n\n# sets light emission color\nfunc setColor(col):\n\tmat.set_parameter(FixedMaterial.PARAM_EMISSION, col)\n\treturn self\n\nfunc setExtent(laserExtent):\n\tself.laserExtent = laserExtent\n\treturn self\n\n# Force a laser to set off at the end of a layer.\nfunc forceActivate():\n\tscaleTweenNode(0, 0.5, Tween.TRANS_ELASTIC).start()\n\n# Can't manually activate a laser.\nfunc activate():\n\treturn\n","old_contents":"extends \"AbstractBlock.gd\"\n\nvar mat\nvar laserExtent = Vector3()\n\n# color\nfunc setTexture(color=Color(0.5, 0, 0)):\n\tvar mat = load(\"res:\/\/materials\/block_Laser.mtl\")\n\tmat.set_parameter(FixedMaterial.PARAM_EMISSION, Color(0.2, 0.1, 0.1))\n\tself.get_node(\"MeshInstance\").set_material_override(mat)\n\n\treturn self\n\n# sets light emission color\nfunc setColor(col):\n\tmat.set_parameter(FixedMaterial.PARAM_EMISSION, col)\n\nfunc setExtent(laserExtent):\n\t self.laserExtent = laserExtent\n\n# Force a laser to set off at the end of a layer.\nfunc forceActivate():\n\tscaleTweenNode(0, 0.5, Tween.TRANS_ELASTIC).start()\n\n# Can't manually activate a laser.\nfunc activate():\n\treturn\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"3552e35563dc9ed50e1bf988479181b334988bcc","subject":"speed. quiet.","message":"speed. quiet.\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/GUIManager.gd","new_file":"src\/scripts\/GUIManager.gd","new_contents":"# This script manages all of the GUI elements.\n# It switches between the states of the GUI allowing\n# the user to start games, edit the options or connect\n# to a multiplayer game.\n\nextends Node\n\n# network variables\nvar network\n\n# State variables.\nvar menuOn\nvar splashTween\n\n# Timers.\nvar timer\nvar initialWait = 0.5\nvar splashTimer = 2.0\nvar warningTimer = 5.0\n\n# GUI pieces.\nvar Splash_Team5\nvar Splash_Warning\nvar Menu_Main\nvar Menu_Chooser\nvar Menu_MP\nvar Menu_HostGame\nvar Menu_JoinGame\nvar Menu_Options\n\n# Menu state values. Used to switch between them.\nvar MENU_INIT\t\t\t= 0\nvar MENU_SPLASHTEAM5\t= 1\nvar MENU_SPLASHWARNING\t= 2\nvar MENU_MAIN\t\t\t= 3\nvar MENU_CHOOSER\t\t= 4\nvar MENU_MP\t\t\t\t= 5\nvar MENU_HOSTGAME\t\t= 6\nvar MENU_JOINGAME\t\t= 7\nvar MENU_OPTIONS\t\t= 8\n\n# Main Menu Theme\nvar samplePlayer = StreamPlayer.new()\nvar songs = [load(\"res:\/\/main_theme_antris.ogg\")]\n\n# Loader dialog\nvar saveDir\nvar fileDialog\n\nfunc skipTitle(skip):\n\tif skip:\n\t\tinitialWait = 0.2\n\t\tsplashTimer = 0.2\n\t\twarningTimer = 0.2\n\n# Function to be called once for setup.\nfunc _ready():\n\t# Initial setup.\n\tmenuOn = MENU_INIT\n\ttimer = 0.0\n\tset_process( true )\n\tset_process_input( true )\n\n\t# Setup the splash fader tween.\n\tsplashTween = Tween.new()\n\tget_node( \"SplashFader\" ).add_child( splashTween )\n\tsplashTween.interpolate_method( get_node( \"SplashFader\" ), \"set_opacity\", 1.0, 0.0, 1.0, Tween.TRANS_CUBIC, Tween.EASE_IN_OUT )\n\n\t# Gather all of the menus.\n\tSplash_Team5 = get_node( \"SplashTeam5\" )\n\tSplash_Warning = get_node( \"SplashWarning\" )\n\tMenu_Main = get_node( \"MainMenu\" )\n\tMenu_Chooser = get_node( \"ChooserMenu\" )\n\tMenu_MP = get_node( \"Multiplayer\" )\n\tMenu_HostGame = get_node( \"HostGame\" )\n\tMenu_JoinGame = get_node( \"JoinGame\" )\n\tMenu_Options = get_node( \"OptionsMenu\" )\n\n\tGlobals.set(\"Network\", load(\"res:\/\/scripts\/Network.gd\").new())\n\tnetwork = Globals.get(\"Network\")\n\n\tvar scn = load(\"res:\/\/networkProxy.scn\")\n\tadd_child(scn.instance())\n\tnetwork.root = get_tree().get_root()\n\n\t# Load the config.\n\tvar config = preload( \"res:\/\/scripts\/DataManager.gd\" ).new().loadConfig()\n\n\tget_node(\"OptionsMenu\/Panel\/OnlineName\/LineEdit\").set_text( config.name )\n\tget_node(\"OptionsMenu\/Panel\/SoundVolume\/SoundSlider\").set_value( config.soundvolume )\n\tget_node(\"OptionsMenu\/Panel\/MusicVolume\/MusicSlider\").set_value( config.musicvolume )\n\n\tnetwork.port = config.portnumber\n\n\t# Prepare puzzle loader dialog\n\tsaveDir = OS.get_data_dir() + \"\/PuzzleSaves\"\n\tfileDialog = preload(\"Editor.gd\").initLoadSaveDialog(self, get_tree(), saveDir)\n\n\t# Main Menu Theme\n\tGlobals.set(\"StreamPlayer\", samplePlayer)\n\tadd_child(samplePlayer)\n\tsamplePlayer.set_stream(songs[0])\n\tsamplePlayer.play()\n\n# Function to update the GUI.\nfunc _process( delta ):\n\t# Handle the initial wait.\n\tif( menuOn == MENU_INIT ):\n\t\tif( timer > initialWait ):\n\t\t\tmenuOn = MENU_SPLASHTEAM5\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiIn()\n\n\t# Handle the Team5 splash screen.\n\tif( menuOn == MENU_SPLASHTEAM5 ):\n\t\tif( timer > splashTimer ):\n\t\t\tmenuOn = MENU_SPLASHWARNING\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiOut()\n\t\t\tSplash_Warning.guiIn()\n\n\t# Handle the warning splash screen.\n\tif( menuOn == MENU_SPLASHWARNING ):\n\t\tif( timer > warningTimer ):\n\t\t\tmenuOn = MENU_MAIN\n\t\t\ttimer = 0.0\n\t\t\tSplash_Warning.guiOut()\n\t\t\tMenu_Main.guiIn()\n\t\t\tsplashTween.start()\n\n\t# Increase the timer each frame.\n\ttimer += delta\n\n# Handle the input events.\nfunc _input( ev ):\n\t# Handle skip splash screens.\n\tif( !ev.is_pressed() and ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT ):\n\t\tif( menuOn == MENU_SPLASHTEAM5 || menuOn == MENU_SPLASHWARNING ):\n\t\t\ttimer = 999.0;\n\n\t# Handle exit.\n\tif( ev.is_action( \"ui_cancel\" ) ):\n\t\texit()\n\nfunc exit():\n\tprint( \"Exiting\" )\n\tOS.get_main_loop().quit()\n\nfunc _on_Exit_pressed():\n\texit()\n\n# TODO save to ConfigFile, load this on beginning\nfunc _on_Options_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Options.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_OPTIONS\n\tget_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\").set_text(str(network.port))\n\nfunc _on_Cancel_pressed():\n\tMenu_Options.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_SaveQuit_pressed():\n\t# Save the options.\n\n\tvar config = { name = get_node(\"OptionsMenu\/Panel\/OnlineName\/LineEdit\").get_text()\n\t\t\t\t , soundvolume = get_node(\"OptionsMenu\/Panel\/SoundVolume\/SoundSlider\").get_value()\n\t\t\t\t , musicvolume = get_node(\"OptionsMenu\/Panel\/MusicVolume\/MusicSlider\").get_value()\n\t\t\t\t , portnumber = get_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\").get_text()\n\t\t\t\t }\n\n\tpreload( \"res:\/\/scripts\/DataManager.gd\" ).new().saveConfig( config )\n\n\tvar field = get_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\")\n\tnetwork.setPort(field.get_text())\n\tnetwork.setPort(field.get_text())\n\t_on_Cancel_pressed()\n\nfunc _on_SP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Chooser.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_CHOOSER\n\nfunc _on_MainMenu_pressed():\n\tMenu_Chooser.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MainMenuMP_pressed():\n\tMenu_MP.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_MP.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MP\n\nfunc _on_MainMenuHG_pressed():\n\tMenu_HostGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\tnetwork.disconnect()\n\nfunc _on_HostGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_HostGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_HOSTGAME\n\n\tif !network.isHost and !network.isNetwork:\n\t\tprint(\"calling!\")\n\t\tnetwork.host(network.port)\n\t\tget_node(\"HostGame\/Panel\/Waiting\").set_text(\"Waiting for player to join on port \" + str(network.port) + \"...\")\n\nfunc _on_JoinGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_JoinGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_JOINGAME\n\nfunc _on_MainMenuJG_pressed():\n\tMenu_JoinGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\tif (network.isClient):\n\t\tnetwork.disconnect()\n\nfunc _on_RandomPuzzle_pressed(puzzle=null):\n\tgotoPuzzleScene(get_tree().get_root(), false, puzzle)\n\nstatic func gotoPuzzleScene(root, networked=false, puzzle=null):\n\tvar p = load( \"res:\/\/puzzle.scn\" ).instance()\n\tp.mainPuzzle = networked\n\n\tif puzzle != null:\n\t\tp.generateRandom = false\n\t\tp.get_node(\"GridView\/GridMan\").set_puzzle(puzzle)\n\t\tp.get_node(\"GridView\/GridMan\").setupCam()\n\n\t# called on idle time\n\tgoto_scene(root.get_tree(), [load(\"res:\/\/puzzleView.scn\").instance(), p])\n\nstatic func goto_scene(tree, scenes, freeAll=false):\n\tvar root = tree.get_root()\n\tif freeAll:\n\t\tfor child in root.get_children():\n\t\t\tchild.queue_free()\n\telse:\n\t\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\tfor scn in scenes:\n\t\tscn.set_owner(root)\n\t\troot.call_deferred(\"add_child\", scn )\n\nfunc _on_Join_pressed():\n\tvar IPPanel = get_node(\"JoinGame\/Panel\/IPAddress\")\n\tvar ip = IPPanel.get_text();\n\n\tif (ip.empty()):\n\t\treturn\n\n\tif !network.isClient:\n\t\tnetwork.connectTo(ip, network.port)\n\n\nfunc _on_Editor_pressed():\n\t# called on idle time\n\tgoto_scene(get_tree(), [load(\"res:\/\/editor.scn\").instance()])\n\nfunc _on_LoadPuzzle_pressed():\n\tpreload(\"Editor.gd\").showLoadDialog(fileDialog, self)\n\n# called by the fileDialog\nfunc puzzleLoad():\n\tvar f = fileDialog.get_current_path()\n\tif f == null or f == \"\":\n\t\treturn\n\tprint(\"LOADING FROM \", f)\n\t_on_RandomPuzzle_pressed(preload(\"DataManager.gd\").loadPuzzle( f ))\n","old_contents":"# This script manages all of the GUI elements.\n# It switches between the states of the GUI allowing\n# the user to start games, edit the options or connect\n# to a multiplayer game.\n\nextends Node\n\n# network variables\nvar network\n\n# State variables.\nvar menuOn\nvar splashTween\n\n# Timers.\nvar timer\nvar initialWait = 0.5\nvar splashTimer = 2.0\nvar warningTimer = 5.0\n\n# GUI pieces.\nvar Splash_Team5\nvar Splash_Warning\nvar Menu_Main\nvar Menu_Chooser\nvar Menu_MP\nvar Menu_HostGame\nvar Menu_JoinGame\nvar Menu_Options\n\n# Menu state values. Used to switch between them.\nvar MENU_INIT\t\t\t= 0\nvar MENU_SPLASHTEAM5\t= 1\nvar MENU_SPLASHWARNING\t= 2\nvar MENU_MAIN\t\t\t= 3\nvar MENU_CHOOSER\t\t= 4\nvar MENU_MP\t\t\t\t= 5\nvar MENU_HOSTGAME\t\t= 6\nvar MENU_JOINGAME\t\t= 7\nvar MENU_OPTIONS\t\t= 8\n\n# Main Menu Theme\nvar samplePlayer = StreamPlayer.new()\nvar songs = [load(\"res:\/\/main_theme_antris.ogg\")]\n\n# Loader dialog\nvar saveDir\nvar fileDialog\n\nfunc skipTitle(skip):\n\tif skip:\n\t\tinitialWait = 0.01\n\t\tsplashTimer = 0.01\n\t\twarningTimer = 0.01\n\n# Function to be called once for setup.\nfunc _ready():\n\t# Initial setup.\n\tmenuOn = MENU_INIT\n\ttimer = 0.0\n\tset_process( true )\n\tset_process_input( true )\n\n\t# Setup the splash fader tween.\n\tsplashTween = Tween.new()\n\tget_node( \"SplashFader\" ).add_child( splashTween )\n\tsplashTween.interpolate_method( get_node( \"SplashFader\" ), \"set_opacity\", 1.0, 0.0, 1.0, Tween.TRANS_CUBIC, Tween.EASE_IN_OUT )\n\n\t# Gather all of the menus.\n\tSplash_Team5 = get_node( \"SplashTeam5\" )\n\tSplash_Warning = get_node( \"SplashWarning\" )\n\tMenu_Main = get_node( \"MainMenu\" )\n\tMenu_Chooser = get_node( \"ChooserMenu\" )\n\tMenu_MP = get_node( \"Multiplayer\" )\n\tMenu_HostGame = get_node( \"HostGame\" )\n\tMenu_JoinGame = get_node( \"JoinGame\" )\n\tMenu_Options = get_node( \"OptionsMenu\" )\n\n\tGlobals.set(\"Network\", load(\"res:\/\/scripts\/Network.gd\").new())\n\tnetwork = Globals.get(\"Network\")\n\n\tvar scn = load(\"res:\/\/networkProxy.scn\")\n\tadd_child(scn.instance())\n\tnetwork.root = get_tree().get_root()\n\n\t# Load the config.\n\tvar config = preload( \"res:\/\/scripts\/DataManager.gd\" ).new().loadConfig()\n\n\tget_node(\"OptionsMenu\/Panel\/OnlineName\/LineEdit\").set_text( config.name )\n\tget_node(\"OptionsMenu\/Panel\/SoundVolume\/SoundSlider\").set_value( config.soundvolume )\n\tget_node(\"OptionsMenu\/Panel\/MusicVolume\/MusicSlider\").set_value( config.musicvolume )\n\n\tnetwork.port = config.portnumber\n\n\t# Prepare puzzle loader dialog\n\tsaveDir = OS.get_data_dir() + \"\/PuzzleSaves\"\n\tfileDialog = preload(\"Editor.gd\").initLoadSaveDialog(self, get_tree(), saveDir)\n\n\t# Main Menu Theme\n\tGlobals.set(\"StreamPlayer\", samplePlayer)\n\tadd_child(samplePlayer)\n\tsamplePlayer.set_stream(songs[0])\n\tsamplePlayer.play()\n\n# Function to update the GUI.\nfunc _process( delta ):\n\t# Handle the initial wait.\n\tif( menuOn == MENU_INIT ):\n\t\tif( timer > initialWait ):\n\t\t\tmenuOn = MENU_SPLASHTEAM5\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiIn()\n\n\t# Handle the Team5 splash screen.\n\tif( menuOn == MENU_SPLASHTEAM5 ):\n\t\tif( timer > splashTimer ):\n\t\t\tmenuOn = MENU_SPLASHWARNING\n\t\t\ttimer = 0.0\n\t\t\tSplash_Team5.guiOut()\n\t\t\tSplash_Warning.guiIn()\n\n\t# Handle the warning splash screen.\n\tif( menuOn == MENU_SPLASHWARNING ):\n\t\tif( timer > warningTimer ):\n\t\t\tmenuOn = MENU_MAIN\n\t\t\ttimer = 0.0\n\t\t\tSplash_Warning.guiOut()\n\t\t\tMenu_Main.guiIn()\n\t\t\tsplashTween.start()\n\n\t# Increase the timer each frame.\n\ttimer += delta\n\n# Handle the input events.\nfunc _input( ev ):\n\t# Handle skip splash screens.\n\tif( !ev.is_pressed() and ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT ):\n\t\tif( menuOn == MENU_SPLASHTEAM5 || menuOn == MENU_SPLASHWARNING ):\n\t\t\ttimer = 999.0;\n\n\t# Handle exit.\n\tif( ev.is_action( \"ui_cancel\" ) ):\n\t\texit()\n\nfunc exit():\n\tprint( \"Exiting\" )\n\tOS.get_main_loop().quit()\n\nfunc _on_Exit_pressed():\n\texit()\n\n# TODO save to ConfigFile, load this on beginning\nfunc _on_Options_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Options.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_OPTIONS\n\tget_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\").set_text(str(network.port))\n\nfunc _on_Cancel_pressed():\n\tMenu_Options.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_SaveQuit_pressed():\n\t# Save the options.\n\n\tvar config = { name = get_node(\"OptionsMenu\/Panel\/OnlineName\/LineEdit\").get_text()\n\t\t\t\t , soundvolume = get_node(\"OptionsMenu\/Panel\/SoundVolume\/SoundSlider\").get_value()\n\t\t\t\t , musicvolume = get_node(\"OptionsMenu\/Panel\/MusicVolume\/MusicSlider\").get_value()\n\t\t\t\t , portnumber = get_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\").get_text()\n\t\t\t\t }\n\n\tpreload( \"res:\/\/scripts\/DataManager.gd\" ).new().saveConfig( config )\n\n\tvar field = get_node(\"OptionsMenu\/Panel\/PortField\/LineEdit\")\n\tnetwork.setPort(field.get_text())\n\tnetwork.setPort(field.get_text())\n\t_on_Cancel_pressed()\n\nfunc _on_SP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_Chooser.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_CHOOSER\n\nfunc _on_MainMenu_pressed():\n\tMenu_Chooser.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MainMenuMP_pressed():\n\tMenu_MP.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\nfunc _on_MP_pressed():\n\tMenu_Main.guiOut()\n\tMenu_MP.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MP\n\nfunc _on_MainMenuHG_pressed():\n\tMenu_HostGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\tnetwork.disconnect()\n\nfunc _on_HostGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_HostGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_HOSTGAME\n\n\tif !network.isHost and !network.isNetwork:\n\t\tprint(\"calling!\")\n\t\tnetwork.host(network.port)\n\t\tget_node(\"HostGame\/Panel\/Waiting\").set_text(\"Waiting for player to join on port \" + str(network.port) + \"...\")\n\nfunc _on_JoinGame_pressed():\n\tMenu_MP.guiOut()\n\tMenu_JoinGame.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_JOINGAME\n\nfunc _on_MainMenuJG_pressed():\n\tMenu_JoinGame.guiOut()\n\tMenu_Main.guiIn()\n\ttimer = 0.0\n\tmenuOn = MENU_MAIN\n\tif (network.isClient):\n\t\tnetwork.disconnect()\n\nfunc _on_RandomPuzzle_pressed(puzzle=null):\n\tgotoPuzzleScene(get_tree().get_root(), false, puzzle)\n\nstatic func gotoPuzzleScene(root, networked=false, puzzle=null):\n\tvar p = load( \"res:\/\/puzzle.scn\" ).instance()\n\tp.mainPuzzle = networked\n\n\tif puzzle != null:\n\t\tp.generateRandom = false\n\t\tp.get_node(\"GridView\/GridMan\").set_puzzle(puzzle)\n\t\tp.get_node(\"GridView\/GridMan\").setupCam()\n\n\t# called on idle time\n\tgoto_scene(root.get_tree(), [load(\"res:\/\/puzzleView.scn\").instance(), p])\n\nstatic func goto_scene(tree, scenes, freeAll=false):\n\tvar root = tree.get_root()\n\troot.print_tree()\n\tif freeAll:\n\t\tfor child in root.get_children():\n\t\t\tchild.queue_free()\n\telse:\n\t\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\tfor scn in scenes:\n\t\tscn.set_owner(root)\n\t\troot.call_deferred(\"add_child\", scn )\n\nfunc _on_Join_pressed():\n\tvar IPPanel = get_node(\"JoinGame\/Panel\/IPAddress\")\n\tvar ip = IPPanel.get_text();\n\n\tif (ip.empty()):\n\t\treturn\n\n\tif !network.isClient:\n\t\tnetwork.connectTo(ip, network.port)\n\n\nfunc _on_Editor_pressed():\n\t# called on idle time\n\tgoto_scene(get_tree(), [load(\"res:\/\/editor.scn\").instance()])\n\nfunc _on_LoadPuzzle_pressed():\n\tpreload(\"Editor.gd\").showLoadDialog(fileDialog, self)\n\n# called by the fileDialog\nfunc puzzleLoad():\n\tvar f = fileDialog.get_current_path()\n\tif f == null or f == \"\":\n\t\treturn\n\tprint(\"LOADING FROM \", f)\n\t_on_RandomPuzzle_pressed(preload(\"DataManager.gd\").loadPuzzle( f ))\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"d09cc6af8b8ec9163d96917dddd70cd0414ababd","subject":"checking array length beforehand","message":"checking array length beforehand\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"2d\/navigation_astar\/character.gd","new_file":"2d\/navigation_astar\/character.gd","new_contents":"extends Position2D\n\nexport(float) var SPEED = 200.0\n\nenum STATES { IDLE, FOLLOW }\nvar _state = null\n\nvar path = []\nvar target_point_world = Vector2()\nvar target_position = Vector2()\n\nvar velocity = Vector2()\n\nfunc _ready():\n\t_change_state(IDLE)\n\n\nfunc _change_state(new_state):\n\tif new_state == FOLLOW:\n\t\tpath = get_parent().get_node('TileMap').get_path(position, target_position)\n\t\tif not path or len(path) == 1:\n\t\t\t_change_state(IDLE)\n\t\t\treturn\n\t\t# The index 0 is the starting cell\n\t\t# we don't want the character to move back to it in this example\n\t\ttarget_point_world = path[1]\n\t_state = new_state\n\n\nfunc _process(delta):\n\tif not _state == FOLLOW:\n\t\treturn\n\tvar arrived_to_next_point = move_to(target_point_world)\n\tif arrived_to_next_point:\n\t\tpath.remove(0)\n\t\tif len(path) == 0:\n\t\t\t_change_state(IDLE)\n\t\t\treturn\n\t\ttarget_point_world = path[0]\n\n\nfunc move_to(world_position):\n\tvar MASS = 10.0\n\tvar ARRIVE_DISTANCE = 10.0\n\n\tvar desired_velocity = (world_position - position).normalized() * SPEED\n\tvar steering = desired_velocity - velocity\n\tvelocity += steering \/ MASS\n\tposition += velocity * get_process_delta_time()\n\trotation = velocity.angle()\n\treturn position.distance_to(world_position) < ARRIVE_DISTANCE\n\n\nfunc _input(event):\n\tif event.is_action_pressed('click'):\n\t\tif Input.is_key_pressed(KEY_SHIFT):\n\t\t\tglobal_position = get_global_mouse_position()\n\t\telse:\n\t\t\ttarget_position = get_global_mouse_position()\n\t\t_change_state(FOLLOW)\n","old_contents":"extends Position2D\n\nexport(float) var SPEED = 200.0\n\nenum STATES { IDLE, FOLLOW }\nvar _state = null\n\nvar path = []\nvar target_point_world = Vector2()\nvar target_position = Vector2()\n\nvar velocity = Vector2()\n\nfunc _ready():\n\t_change_state(IDLE)\n\n\nfunc _change_state(new_state):\n\tif new_state == FOLLOW:\n\t\tpath = get_parent().get_node('TileMap').get_path(position, target_position)\n\t\tif not path:\n\t\t\t_change_state(IDLE)\n\t\t\treturn\n\t\t# The index 0 is the starting cell\n\t\t# we don't want the character to move back to it in this example\n\t\ttarget_point_world = path[1]\n\t_state = new_state\n\n\nfunc _process(delta):\n\tif not _state == FOLLOW:\n\t\treturn\n\tvar arrived_to_next_point = move_to(target_point_world)\n\tif arrived_to_next_point:\n\t\tpath.remove(0)\n\t\tif len(path) == 0:\n\t\t\t_change_state(IDLE)\n\t\t\treturn\n\t\ttarget_point_world = path[0]\n\n\nfunc move_to(world_position):\n\tvar MASS = 10.0\n\tvar ARRIVE_DISTANCE = 10.0\n\n\tvar desired_velocity = (world_position - position).normalized() * SPEED\n\tvar steering = desired_velocity - velocity\n\tvelocity += steering \/ MASS\n\tposition += velocity * get_process_delta_time()\n\trotation = velocity.angle()\n\treturn position.distance_to(world_position) < ARRIVE_DISTANCE\n\n\nfunc _input(event):\n\tif event.is_action_pressed('click'):\n\t\tif Input.is_key_pressed(KEY_SHIFT):\n\t\t\tglobal_position = get_global_mouse_position()\n\t\telse:\n\t\t\ttarget_position = get_global_mouse_position()\n\t\t_change_state(FOLLOW)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"51deab558b9efc369944b1ad989dde6de4754404","subject":"gd \"G\u00e0idhlig\" translation #16342. Author: bretasker. ","message":"gd \"G\u00e0idhlig\" translation #16342. Author: bretasker. ","repos":"luanlv\/lila,arex1337\/lila,luanlv\/lila,clarkerubber\/lila,arex1337\/lila,clarkerubber\/lila,clarkerubber\/lila,luanlv\/lila,luanlv\/lila,arex1337\/lila,arex1337\/lila,clarkerubber\/lila,arex1337\/lila,arex1337\/lila,clarkerubber\/lila,luanlv\/lila,luanlv\/lila,luanlv\/lila,arex1337\/lila,clarkerubber\/lila,clarkerubber\/lila","old_file":"modules\/i18n\/messages\/messages.gd","new_file":"modules\/i18n\/messages\/messages.gd","new_contents":"playWithAFriend=Cluich c\u00f2mhla ri caraid\nplayWithTheMachine=Cluich an aghaidh a' choimpiutair\ntoInviteSomeoneToPlayGiveThisUrl=Gus cuireadh a thoirt do chuideigin, thoir an url seo dha\ngameOver=Cr\u00ecoch a\u2019 gheama\nwaitingForOpponent=A\u2019 feitheamh air n\u00e0mhaid\nwaiting=A\u2019 feitheamh\nyourTurn=An turas agad\naiNameLevelAiLevel=%s inbhe %s\nlevel=Inbhe\ntoggleTheChat=Toglaich a\u2019 chabadaich\ntoggleSound=Toglaich fuaim\nchat=Cabadaich\nresign=G\u00e8ill\ncheckmate=Tul-chasg\nstalemate=Clos-cluiche\nwhite=Geal\nblack=Dubh\nrandomColor=Dath air thuaiream\ncreateAGame=Cruthaich geama\nwhiteIsVictorious=Bhuannaich geal\nblackIsVictorious=Bhuannaich dubh\nkingInTheCenter=R\u00ecgh sa mheadhan\nthreeChecks=Tr\u00ec caisg\nnewOpponent=N\u00e0mhaid \u00f9r\nyourOpponentWantsToPlayANewGameWithYou=Tha an n\u00e0mhaid agad airson geama \u00f9r a chluich \u2019nad aghaidh\njoinTheGame=Thig a-steach dhan gheama\nwhitePlays=Tha geal a\u2019 cluich\nblackPlays=Tha dubh a\u2019 cluich\ntheOtherPlayerHasLeftTheGameYouCanForceResignationOrWaitForHim=Tha an cluicheadair eile air a' gheama fh\u00e0gail. Is urrainn dhut g\u00e8illeadh a chur air, geama ionnannach a ghairm, no feitheamh air a shon.\nmakeYourOpponentResign=Cuir g\u00e8illeadh air an n\u00e0mhaid agad\nforceResignation=Gairm buaidh\nforceDraw=Gairm geama ionnannach\ntalkInChat=D\u00e8an cabadaich\ntheFirstPersonToComeOnThisUrlWillPlayWithYou=Cluichidh a\u2019 chiad neach a thig a-steach air an url seo c\u00f2mhla riut.\nwhiteResigned=Gh\u00e8ill geal\nblackResigned=Gh\u00e8ill dubh\nwhiteLeftTheGame=Dh\u2019fh\u00e0g geal an geama\nblackLeftTheGame=Dh\u2019fh\u00e0g dubh an geama\nshareThisUrlToLetSpectatorsSeeTheGame=Co-roinn an url seo gus luchd-amhairc a leigeil a-steach dhan gheama\ntheComputerAnalysisHasFailed=Dh\u2019fh\u00e0illig le anailis a\u2019 choimpiutair\nviewTheComputerAnalysis=Seall anailis a\u2019 choimpiutair\nrequestAComputerAnalysis=Iarr anailis air a\u2019 choimpiutair\ncomputerAnalysis=Anailis a\u2019 choimpiutair\nanalysis=B\u00f2rd sgr\u00f9daidh\nblunders=Tuislidhean\nmistakes=Mearachdan\ninaccuracies=Neo-eagnaidhean\nmoveTimes=\u00d9ine nan gluasadan\nflipBoard=D\u00e8an flip air a\u2019 bh\u00f2rd\nthreefoldRepetition=Treas ath-nochdadh\nclaimADraw=Gairm geama ionnannach\nofferDraw=Tairg geama ionnannach\ndraw=Geama ionnannach\nnbConnectedPlayers=%s cluicheadairean\ngamesBeingPlayedRightNow=Geamannan a tha \u2019gan cluich an-dr\u00e0sta fh\u00e8in\nviewAllNbGames=%s geamannan\nviewNbCheckmates=%s tul-chaisg\nnbBookmarks=%s comharran-l\u00ecn\nnbPopularGames=%s geamannan m\u00f2r-ch\u00f2rdte\nnbAnalysedGames=%s geamannan sgr\u00f9daichte\nbookmarkedByNbPlayers=Comharra-leabhair le %s cluicheadairean\nviewInFullSize=Seall sa mheud iomlan\nlogOut=Log a-mach\nsignIn=Log a-steach\nnewToLichess=\u00d9r air Lichess?\nyouNeedAnAccountToDoThat=Tha feum agad air cunntas gus sin a dh\u00e8anamh\nsignUp=Cl\u00e0raich\ngames=Geamannan\nforum=B\u00f2rd-brath\nxPostedInForumY=Sgr\u00ecobh %s san fh\u00f2ram %s\nlatestForumPosts=Na postaichean as \u00f9ire\nplayers=Cluicheadairean\nminutesPerSide=Mionaidean gach taobh\nvariant=Caochladh\nvariants=Se\u00f2rsachan\ntimeControl=Smachd air an \u00f9ine\nrealTime=F\u00ecor-\u00f9ine\ndaysPerTurn=L\u00e0ithean gach cuairt\noneDay=Aon latha\nnbDays=%s l\u00e0(ithean)\nnbHours=%s uair(ean)\ntime=\u00d9ine\nrating=Rangachadh\nusername=Ainm-cleachdaidh\nusernameOrEmail=Far-ainm\npassword=Facal-faire\nhaveAnAccount=A bheil cunntas agad?\nchangePassword=Atharraich am facal-faire\nchangeEmail=Atharraich am post-d\nemail=Post-d\nemailIsOptional=Tha am post-d roghainneil. cleachdaich Lichess an se\u00f2ladh puist-d agad gus am facal-faire agad ath-shuidheachadh ma dh\u00ecochuimhnicheas tu e.\npasswordReset=Ath-shuidheachadh an fhacail-fhaire\nforgotPassword=An do dh\u00ecochuimhnich thu am facal-faire?\nrank=Inbhe\ngamesPlayed=Geamannan air an cluich\nnbGamesWithYou=%s geamannan c\u00f2mhla riut\ndeclineInvitation=Di\u00f9lt cuireadh\ncancel=Sguir dheth\ntimeOut=Dh\u2019fhalbh an \u00f9ine\ndrawOfferSent=Chaidh tairgse airson geama ionnanach a chur\ndrawOfferDeclined=Dhi\u00f9ltadh do thairgse airson geama ionnanach\ndrawOfferAccepted=Ghabhadh ri do thairgse airson geama ionnanach\ndrawOfferCanceled=Sguireadh de do thairgse airson geama ionnanach\nwhiteOffersDraw=Tha geal a' tairgse geama ionnannach\nblackOffersDraw=Tha dubh a' tairgse geama ionnannach\nwhiteDeclinesDraw=Tha geal a' di\u00f9ltadh geama ionnannach\nblackDeclinesDraw=Tha dubh a' di\u00f9ltadh geama ionnannach\nyourOpponentOffersADraw=Tha an n\u00e0mhaid agad a\u2019 tairgse geama ionnanach\naccept=Gabh ris\ndecline=Di\u00f9lt\nplayingRightNow=A\u2019 cluich an-dr\u00e0sta fh\u00e8in\nfinished=Cr\u00ecochnaichte\nabortGame=Stad an geama\ngameAborted=Chaidh sgur dhen gheama\nstandard=Coitcheann\nunlimited=Gun chr\u00ecoch\nmode=Modh\ncasual=Gun rangachadh\nrated=Rangaichte\nthisGameIsRated=Tha an geama seo rangaichte\nrematch=Ath-mhaids\nrematchOfferSent=Chaidh tairgse airson ath-mhaids a chur\nrematchOfferAccepted=Ghabhadh ri do thairgse airson ath-mhaids\nrematchOfferCanceled=Chaidh sgur dhe thairgse ath-mhaids\nrematchOfferDeclined=Tairgse ath-mhaids air a di\u00f9ltadh\ncancelRematchOffer=Sguir dhe thairgse ath-mhaids\nviewRematch=Seall an ath-mhaids\nplay=Cluich\ninbox=Bogsa a-steach\nchatRoom=Se\u00f2mar cabadaich\nspectatorRoom=Se\u00f2mar an luchd-amhairc\ncomposeMessage=Sgr\u00ecobh teachdaireachd\nnoNewMessages=Gun teachdaireachd \u00f9r\nsubject=Cuspair\nrecipient=Faightear\nsend=Cuir\nincrementInSeconds=Ioncramaid ann an diogan\nfreeOnlineChess=T\u00e0ileasg air loidhne an-asgaidh\nspectators=Luchd-amhairc:\nnbWins=Bhuannaich %s\nnbLosses=Chaill %s\nnbDraws=Geama ionnanach le %s\nexportGames=\u00c0s-phortaich geamannan\nratingRange=Rainse an rangachaidh\ngiveNbSeconds=Thoir %s diogan\npremoveEnabledClickAnywhereToCancel=Ro-ghluasad an comas - briog \u00e0ite sam bith airson sgur dheth\nthisPlayerUsesChessComputerAssistance=Tha an cluicheadair seo a\u2019 cleachdadh taic coimpiutair taileisg\nopening=Fosgladh\ntakeback=Tarraing air ais\nproposeATakeback=Tairg tarraing air ais\ntakebackPropositionSent=Tairgse tarraing air ais air a cur\ntakebackPropositionDeclined=Tairgse tarraing air ais air a di\u00f9ltadh\ntakebackPropositionAccepted=Air gabhail ri tairgse tarraing air ais\ntakebackPropositionCanceled=Chaidh sgur dhe thairgse tarraing air ais\nyourOpponentProposesATakeback=Tha an n\u00e0mhaid a\u2019 tairgse tarraing air ais\nbookmarkThisGame=Cruthaich comharra-l\u00ecn airson a\u2019 gheama seo.\nsearch=Lorg\nadvancedSearch=Lorg adhartach\ntournament=F\u00e8ill-chluich\ntournaments=F\u00e8ill-chluichean\ntournamentPoints=Puingean f\u00e8ill-chluich\nviewTournament=Seall an fh\u00e8ill-chluich\nbackToTournament=Till dhan fh\u00e8ill-chluich\nbackToGame=Till dhan gheama\nfreeOnlineChessGamePlayChessNowInACleanInterfaceNoRegistrationNoAdsNoPluginRequiredPlayChessWithComputerFriendsOrRandomOpponents=T\u00e0ileasg air loidhne an-asgaidh. Cluich t\u00e0ileasg ann am pr\u00f2gram air a bheil dreach glan. Gun chl\u00e0radh, gun sanasachd, gun fheum air plugan. Cluich t\u00e0ileasg an aghaidh a\u2019 choimpiutair, charaidean no n\u00e0imhdean air thuaiream.\nteams=Sgiobaidhean\nnbMembers=%s ball\nallTeams=A h-uile sgioba\nnewTeam=Sgioba \u00f9r\nmyTeams=Na sgiobaidhean agam\nnoTeamFound=Cha deach sgioba a lorg\njoinTeam=Gabh p\u00e0irt san sgioba\nquitTeam=F\u00e0g an sgioba\nanyoneCanJoin=Faodaidh duine sam bith p\u00e0irt a ghabhail ann\naConfirmationIsRequiredToJoin=Tha feum air dearbhadh gus p\u00e0irt a ghabhail ann\njoiningPolicy=Poileasaidh na ballrachd\nteamLeader=Ceannard an sgioba\nteamBestPlayers=Na cluicheadairean as fhearr\nteamRecentMembers=Na buill as \u00f9ire\nxJoinedTeamY=Ghabh %s ballrachd san sgioba %s\nxCreatedTeamY=Chruthaich %s an sgioba %s\naverageElo=Rangachadh cuibheasach\nlocation=\u00c0ite\nsettings=Roghainnean\nfilterGames=Criathraich na geamannan\nreset=Ath-shuidhich\napply=Cuir an s\u00e0s\nleaderboard=Cl\u00e0r nan curaidh\npasteTheFenStringHere=Cuir a-steach an t-sreang FEN an-seo\npasteThePgnStringHere=Cuir a-steach an t-sreang PGN an-seo\nfromPosition=On t-suidheachadh\ncontinueFromHere=Lean air adhart on a sheo\nimportGame=Ion-phortaich geama\nnbImportedGames=%s geamannan air an ion-phortadh\nthisIsAChessCaptcha=Seo CAPTCHA t\u00e0ileisg.\nclickOnTheBoardToMakeYourMove=Briog air a\u2019 bh\u00f2rd airson gluasad \u2019s dearbhaich gur e duine a th\u2019 annad.\nnotACheckmate=Chan e tul-chasg a th\u2019 ann\ncolorPlaysCheckmateInOne=Tha %s a\u2019 cluich; tul-chasg an ceann gluasaid\nretry=Feuch ris a-rithist\nreconnecting=Ag ath-cheangal\nonlineFriends=Caraidean air loidhne\nnoFriendsOnline=Chan eil caraid air loidhne\nfindFriends=Lorg caraidean\nfavoriteOpponents=Na farpaisichean as annsa leat\nfollow=Lean air\nfollowing=A\u2019 leantainn air\nunfollow=Na lean air tuilleadh\nblock=Bac\nblocked=Bacte\nunblock=D\u00ec-bhac\nfollowsYou=\u2019Gad leantainn\nxStartedFollowingY=Th\u00f2isich %s a\u2019 leantainn air %s\nnbFollowers=%s luchd-leantainn\nnbFollowing=%s \u2019ga leantainn\nmore=Barrachd\nmemberSince=Ball o chionn\nlastSeenActive=An logadh a-steach mu dheireadh %s\nchallengeToPlay=Thoir d\u00f9bhlan cluiche dha\nplayer=Cluicheadair\nlist=Liosta\ngraph=Graf\nlessThanNbMinutes=Nas lugha na %s mionaidean\nxToYMinutes=%s gu %s mionaidean\ntextIsTooShort=Tha an teacsa ro ghoirid.\ntextIsTooLong=Tha an teacsa ro fhada.\nrequired=Riatanach.\nopenTournaments=F\u00e8ill-chluichean fosgailte\nduration=Faid\nwinner=Buannaiche\nstanding=A\u2019 seasamh\ncreateANewTournament=Cruthaich f\u00e8ill-chluich \u00f9r\njoin=Gabh p\u00e0irt ann\nwithdraw=C\u00f9laich\npoints=Puingean\nwins=Buaidhean\nlosses=Ruaigean\nwinStreak=Sreath de bhuaidhean\ncreatedBy=Air a chruthachadh le\ntournamentIsStarting=Tha an fh\u00e8ill-chluich gu bhith t\u00f2iseachadh\nmembersOnly=Buill a-mh\u00e0in\nboardEditor=Deasaiche a\u2019 bh\u00f9ird\nstartPosition=Suidheachadh an t\u00f2iseachaidh\nclearBoard=Falamhaich am b\u00f2rd\nsavePosition=S\u00e0bhail an suidheachadh\nloadPosition=Luchdaich suidheachadh\nisPrivate=Pr\u00ecobhaideach\nreportXToModerators=Cuir gearan mu %s dha na maoir\nprofile=Pr\u00f2ifil\neditProfile=Deasaich a\u2019 phr\u00f2ifil\nfirstName=Ainm\nlastName=Sloinneadh\nbiography=Eachdraidh-beatha\ncountry=D\u00f9thaich\npreferences=Roghainnean\nwatchLichessTV=Coimhead air TBh Lichess\npreviouslyOnLichessTV=Air Tbh Lichess roimhe\nonlinePlayers=Cluicheadairean air loidhne\nactiveToday=Gn\u00ecomhach an-diugh\nactivePlayers=Cluicheadairean gn\u00ecomhach\nbewareTheGameIsRatedButHasNoClock=Thoir an aire, th\u00e8id an geama seo rangachadh ach chan eil uaireadair aige!\ntraining=Tr\u00e8anadh\nyourPuzzleRatingX=An rangachadh agad: %s\nfindTheBestMoveForWhite=Lorg an gluasad as fhearr airson geal.\nfindTheBestMoveForBlack=Lorg an gluasad as fhearr airson dubh.\ntoTrackYourProgress=Gus s\u00f9il a chumail air d\u2019 adhartas:\ntrainingSignupExplanation=Bheir Lichess t\u00f2imhseachain dhut a bhios freagarrach dhan chomas agad ach am faigh thu tr\u00e8anadh as iomchaidh.\nrecentlyPlayedPuzzles=T\u00f2imhseachain o chionn goirid\npuzzleId=T\u00f2imhseachan %s\npuzzleOfTheDay=T\u00f2imhseachan an latha\nclickToSolve=Briog an-seo airson fhuasgladh\ngoodMove=Seo gluasad math\nbutYouCanDoBetter=Ach tha gluasad nas fhearr ann.\nbestMove=Seo an gluasad as fhearr!\nkeepGoing=Cum ort...\npuzzleFailed=Cha deach leat\nbutYouCanKeepTrying=Ach faodaidh tu feuchainn a-rithist.\nvictory=Buaidh!\ngiveUp=Thoir g\u00e8ill\npuzzleSolvedInXSeconds=Rinn thu a\u2019 ch\u00f9is air an ceann %s diog.\nwasThisPuzzleAnyGood=An robh an t\u00f2imhseachan seo math?\npleaseVotePuzzle=Cuidich lichess \u2019s cuir bh\u00f2t ann leis an t-saighead suas no s\u00ecos:\nthankYou=M\u00f2ran taing!\nratingX=Rangachadh: %s\nplayedXTimes=Air a chluich %s turas\nfromGameLink=On gheama %s\nstartTraining=T\u00f2isich air an tr\u00e8anadh\ncontinueTraining=Lean air adhart leis an tr\u00e8anadh\nretryThisPuzzle=Feuch ris an t\u00f2imhseachan seo a-rithist\nthisPuzzleIsCorrect=Tha an t\u00f2imhseachan seo ceart is inntinneach\nthisPuzzleIsWrong=Tha an t\u00f2imhseachan seo cearr no d\u00f2rainneach\nyouHaveNbSecondsToMakeYourFirstMove=Tha %s diog(an) air fh\u00e0gail dhut airson a' chiad gluasaid agad!\nnbGamesInPlay=%s geama 'gan cluich\nopeningId=Fosgladh %s\nyourOpeningRatingX=An rangachadh fosglaidh agad: %s\nfindNbStrongMoves=Lorg %s gluasad(an) l\u00e0idir\nopeningFailed=Dh'fh\u00e0illig leis an fhosgladh\nopeningSolved=Chaidh am fosgladh fhuasgladh\nrecentlyPlayedOpenings=Fosglaidhean a chaidh a chluich o chionn goirid\npuzzles=T\u00f2imhseachain\ncoordinates=Co-chomharran\nopenings=Fosglaidhean\nlatestUpdates=Na naidheachdan as \u00f9ire\ntournamentWinners=Feadhainn a bhuannaich f\u00e8ill-chluich\nname=Ainm\ndescription=Tuairisgeul\nno=Tha\nyes=Chan eil\nhelp=Cobhair:\ncreateANewTopic=Cruthaich cuspair \u00f9r\ntopics=Cuspairean\nposts=Postaichean\nlastPost=Am post mu dheireadh\nviews=Air a shealltainn\nreplies=Freagairtean\nreplyToThisTopic=Freagair dhan chuspair seo\nreply=Freagair\nmessage=Teachdaireachd\ncreateTheTopic=Cruthaich an cuspair\nreportAUser=D\u00e8an aithris air cleachdaiche\nuser=Cleachdaiche\nreason=Adhbhar\nwhatIsIheMatter=D\u00e8 an trioblaid?\ncheat=Cealgaireachd\ninsult=Mosach\ntroll=Troll\nother=Adhbhar eile\nby=le %s\nthisTopicIsNowClosed=Tha an cuspair seo d\u00f9inte a-nis.\ntheming=\u00d9rlar\nblog=Bloga\nquestionsAndAnswers=Ceistean & Freagairtean\nnotes=N\u00f2taichean\ntypePrivateNotesHere=Sgr\u00ecobh notaichean pr\u00ecobhaideach an seo\nprivacy=Pr\u00ecobhaideachd\nsound=Fuaim\ndifficultyEasy=Furasta\ndifficultyNormal=Meadhanach\ndifficultyHard=Doirbh\ntimeline=Loidhne-t\u00ecm\nseeAllTournaments=Faic na f\u00e8illean-cluich uile\nstarting=A' t\u00f2iseachadh\nyourCityRegionOrDepartment=Do bhaile, do sg\u00ecre no do mh\u00f3r-roinn.\ncommunity=Coimhearsnachd\ntools=Goireasean\nmenu=Cl\u00e0r-taice\nwatchGames=Coimhead geamannan\ntpTimeSpentOnTV=\u00d9ine air tbh: %s\nwatch=Coimhead\nvideoLibrary=Cruinneachadh bhidiothan\ncontact=Cuir fios\nlichessTournaments=F\u00e9illean-chluich Lichess\ntournamentOfficial=Oifigeil\ntimeBeforeTournamentStarts=\u00d9ine mus t\u00f2isich an fh\u00e9ill-chluich\nyouAreBetterThanPercentOfPerfTypePlayers=Tha thu nas fhearr na %s de chluicheadairean %s.\nconfirmResignation=Cinntich an g\u00e8illeadh\n","old_contents":"playWithAFriend=Cluich c\u00f2mhla ri caraid\nplayWithTheMachine=Cluich an aghaidh a' choimpiutair\ntoInviteSomeoneToPlayGiveThisUrl=Gus cuireadh a thoirt do chuideigin, thoir an url seo dha\ngameOver=Cr\u00ecoch a\u2019 gheama\nwaitingForOpponent=A\u2019 feitheamh air n\u00e0mhaid\nwaiting=A\u2019 feitheamh\nyourTurn=An turas agad\naiNameLevelAiLevel=%s inbhe %s\nlevel=Inbhe\ntoggleTheChat=Toglaich a\u2019 chabadaich\ntoggleSound=Toglaich fuaim\nchat=Cabadaich\nresign=G\u00e8ill\ncheckmate=Tul-chasg\nstalemate=Clos-cluiche\nwhite=Geal\nblack=Dubh\nrandomColor=Dath air thuaiream\ncreateAGame=Cruthaich geama\nwhiteIsVictorious=Bhuannaich geal\nblackIsVictorious=Bhuannaich dubh\nkingInTheCenter=R\u00ecgh sa mheadhan\nthreeChecks=Tr\u00ec caisg\nnewOpponent=N\u00e0mhaid \u00f9r\nyourOpponentWantsToPlayANewGameWithYou=Tha an n\u00e0mhaid agad airson geama \u00f9r a chluich \u2019nad aghaidh\njoinTheGame=Thig a-steach dhan gheama\nwhitePlays=Tha geal a\u2019 cluich\nblackPlays=Tha dubh a\u2019 cluich\ntheOtherPlayerHasLeftTheGameYouCanForceResignationOrWaitForHim=Tha an cluicheadair eile air a' gheama fh\u00e0gail. Is urrainn dhut g\u00e8illeadh a chur air, geama ionnannach a ghairm, no feitheamh air a shon.\nmakeYourOpponentResign=Cuir g\u00e8illeadh air an n\u00e0mhaid agad\nforceResignation=Gairm buaidh\nforceDraw=Gairm geama ionnannach\ntalkInChat=D\u00e8an cabadaich\ntheFirstPersonToComeOnThisUrlWillPlayWithYou=Cluichidh a\u2019 chiad neach a thig a-steach air an url seo c\u00f2mhla riut.\nwhiteResigned=Gh\u00e8ill geal\nblackResigned=Gh\u00e8ill dubh\nwhiteLeftTheGame=Dh\u2019fh\u00e0g geal an geama\nblackLeftTheGame=Dh\u2019fh\u00e0g dubh an geama\nshareThisUrlToLetSpectatorsSeeTheGame=Co-roinn an url seo gus luchd-amhairc a leigeil a-steach dhan gheama\ntheComputerAnalysisHasFailed=Dh\u2019fh\u00e0illig le anailis a\u2019 choimpiutair\nviewTheComputerAnalysis=Seall anailis a\u2019 choimpiutair\nrequestAComputerAnalysis=Iarr anailis air a\u2019 choimpiutair\ncomputerAnalysis=Anailis a\u2019 choimpiutair\nanalysis=B\u00f2rd sgr\u00f9daidh\nblunders=Tuislidhean\nmistakes=Mearachdan\ninaccuracies=Neo-eagnaidhean\nmoveTimes=\u00d9ine nan gluasadan\nflipBoard=D\u00e8an flip air a\u2019 bh\u00f2rd\nthreefoldRepetition=Treas ath-nochdadh\nclaimADraw=Gairm geama ionnannach\nofferDraw=Tairg geama ionnannach\ndraw=Geama ionnannach\nnbConnectedPlayers=%s cluicheadairean\ngamesBeingPlayedRightNow=Geamannan a tha \u2019gan cluich an-dr\u00e0sta fh\u00e8in\nviewAllNbGames=%s geamannan\nviewNbCheckmates=%s tul-chaisg\nnbBookmarks=%s comharran-l\u00ecn\nnbPopularGames=%s geamannan m\u00f2r-ch\u00f2rdte\nnbAnalysedGames=%s geamannan sgr\u00f9daichte\nbookmarkedByNbPlayers=Comharra-leabhair le %s cluicheadairean\nviewInFullSize=Seall sa mheud iomlan\nlogOut=Log a-mach\nsignIn=Log a-steach\nnewToLichess=\u00d9r air Lichess?\nyouNeedAnAccountToDoThat=Tha feum agad air cunntas gus sin a dh\u00e8anamh\nsignUp=Cl\u00e0raich\ngames=Geamannan\nforum=B\u00f2rd-brath\nxPostedInForumY=Sgr\u00ecobh %s san fh\u00f2ram %s\nlatestForumPosts=Na postaichean as \u00f9ire\nplayers=Cluicheadairean\nminutesPerSide=Mionaidean gach taobh\nvariant=Caochladh\ntimeControl=Smachd air an \u00f9ine\nrealTime=F\u00ecor-\u00f9ine\ndaysPerTurn=L\u00e0ithean gach cuairt\noneDay=Aon latha\nnbDays=%s l\u00e0(ithean)\nnbHours=%s uair(ean)\ntime=\u00d9ine\nrating=Rangachadh\nusernameOrEmail=Far-ainm\npassword=Facal-faire\nhaveAnAccount=A bheil cunntas agad?\nchangePassword=Atharraich am facal-faire\nchangeEmail=Atharraich am post-d\nemail=Post-d\nemailIsOptional=Tha am post-d roghainneil. cleachdaich Lichess an se\u00f2ladh puist-d agad gus am facal-faire agad ath-shuidheachadh ma dh\u00ecochuimhnicheas tu e.\npasswordReset=Ath-shuidheachadh an fhacail-fhaire\nforgotPassword=An do dh\u00ecochuimhnich thu am facal-faire?\nrank=Inbhe\ngamesPlayed=Geamannan air an cluich\nnbGamesWithYou=%s geamannan c\u00f2mhla riut\ndeclineInvitation=Di\u00f9lt cuireadh\ncancel=Sguir dheth\ntimeOut=Dh\u2019fhalbh an \u00f9ine\ndrawOfferSent=Chaidh tairgse airson geama ionnanach a chur\ndrawOfferDeclined=Dhi\u00f9ltadh do thairgse airson geama ionnanach\ndrawOfferAccepted=Ghabhadh ri do thairgse airson geama ionnanach\ndrawOfferCanceled=Sguireadh de do thairgse airson geama ionnanach\nwhiteOffersDraw=Tha geal a' tairgse geama ionnannach\nblackOffersDraw=Tha dubh a' tairgse geama ionnannach\nwhiteDeclinesDraw=Tha geal a' di\u00f9ltadh geama ionnannach\nblackDeclinesDraw=Tha dubh a' di\u00f9ltadh geama ionnannach\nyourOpponentOffersADraw=Tha an n\u00e0mhaid agad a\u2019 tairgse geama ionnanach\naccept=Gabh ris\ndecline=Di\u00f9lt\nplayingRightNow=A\u2019 cluich an-dr\u00e0sta fh\u00e8in\nfinished=Cr\u00ecochnaichte\nabortGame=Stad an geama\ngameAborted=Chaidh sgur dhen gheama\nstandard=Coitcheann\nunlimited=Gun chr\u00ecoch\nmode=Modh\ncasual=Gun rangachadh\nrated=Rangaichte\nthisGameIsRated=Tha an geama seo rangaichte\nrematch=Ath-mhaids\nrematchOfferSent=Chaidh tairgse airson ath-mhaids a chur\nrematchOfferAccepted=Ghabhadh ri do thairgse airson ath-mhaids\nrematchOfferCanceled=Chaidh sgur dhe thairgse ath-mhaids\nrematchOfferDeclined=Tairgse ath-mhaids air a di\u00f9ltadh\ncancelRematchOffer=Sguir dhe thairgse ath-mhaids\nviewRematch=Seall an ath-mhaids\nplay=Cluich\ninbox=Bogsa a-steach\nchatRoom=Se\u00f2mar cabadaich\nspectatorRoom=Se\u00f2mar an luchd-amhairc\ncomposeMessage=Sgr\u00ecobh teachdaireachd\nnoNewMessages=Gun teachdaireachd \u00f9r\nsubject=Cuspair\nrecipient=Faightear\nsend=Cuir\nincrementInSeconds=Ioncramaid ann an diogan\nfreeOnlineChess=T\u00e0ileasg air loidhne an-asgaidh\nspectators=Luchd-amhairc:\nnbWins=Bhuannaich %s\nnbLosses=Chaill %s\nnbDraws=Geama ionnanach le %s\nexportGames=\u00c0s-phortaich geamannan\nratingRange=Rainse an rangachaidh\ngiveNbSeconds=Thoir %s diogan\npremoveEnabledClickAnywhereToCancel=Ro-ghluasad an comas - briog \u00e0ite sam bith airson sgur dheth\nthisPlayerUsesChessComputerAssistance=Tha an cluicheadair seo a\u2019 cleachdadh taic coimpiutair taileisg\nopening=Fosgladh\ntakeback=Tarraing air ais\nproposeATakeback=Tairg tarraing air ais\ntakebackPropositionSent=Tairgse tarraing air ais air a cur\ntakebackPropositionDeclined=Tairgse tarraing air ais air a di\u00f9ltadh\ntakebackPropositionAccepted=Air gabhail ri tairgse tarraing air ais\ntakebackPropositionCanceled=Chaidh sgur dhe thairgse tarraing air ais\nyourOpponentProposesATakeback=Tha an n\u00e0mhaid a\u2019 tairgse tarraing air ais\nbookmarkThisGame=Cruthaich comharra-l\u00ecn airson a\u2019 gheama seo.\nsearch=Lorg\nadvancedSearch=Lorg adhartach\ntournament=F\u00e8ill-chluich\ntournaments=F\u00e8ill-chluichean\ntournamentPoints=Puingean f\u00e8ill-chluich\nviewTournament=Seall an fh\u00e8ill-chluich\nbackToTournament=Till dhan fh\u00e8ill-chluich\nbackToGame=Till dhan gheama\nfreeOnlineChessGamePlayChessNowInACleanInterfaceNoRegistrationNoAdsNoPluginRequiredPlayChessWithComputerFriendsOrRandomOpponents=T\u00e0ileasg air loidhne an-asgaidh. Cluich t\u00e0ileasg ann am pr\u00f2gram air a bheil dreach glan. Gun chl\u00e0radh, gun sanasachd, gun fheum air plugan. Cluich t\u00e0ileasg an aghaidh a\u2019 choimpiutair, charaidean no n\u00e0imhdean air thuaiream.\nteams=Sgiobaidhean\nnbMembers=%s ball\nallTeams=A h-uile sgioba\nnewTeam=Sgioba \u00f9r\nmyTeams=Na sgiobaidhean agam\nnoTeamFound=Cha deach sgioba a lorg\njoinTeam=Gabh p\u00e0irt san sgioba\nquitTeam=F\u00e0g an sgioba\nanyoneCanJoin=Faodaidh duine sam bith p\u00e0irt a ghabhail ann\naConfirmationIsRequiredToJoin=Tha feum air dearbhadh gus p\u00e0irt a ghabhail ann\njoiningPolicy=Poileasaidh na ballrachd\nteamLeader=Ceannard an sgioba\nteamBestPlayers=Na cluicheadairean as fhearr\nteamRecentMembers=Na buill as \u00f9ire\nxJoinedTeamY=Ghabh %s ballrachd san sgioba %s\nxCreatedTeamY=Chruthaich %s an sgioba %s\naverageElo=Rangachadh cuibheasach\nlocation=\u00c0ite\nsettings=Roghainnean\nfilterGames=Criathraich na geamannan\nreset=Ath-shuidhich\napply=Cuir an s\u00e0s\nleaderboard=Cl\u00e0r nan curaidh\npasteTheFenStringHere=Cuir a-steach an t-sreang FEN an-seo\npasteThePgnStringHere=Cuir a-steach an t-sreang PGN an-seo\nfromPosition=On t-suidheachadh\ncontinueFromHere=Lean air adhart on a sheo\nimportGame=Ion-phortaich geama\nnbImportedGames=%s geamannan air an ion-phortadh\nthisIsAChessCaptcha=Seo CAPTCHA t\u00e0ileisg.\nclickOnTheBoardToMakeYourMove=Briog air a\u2019 bh\u00f2rd airson gluasad \u2019s dearbhaich gur e duine a th\u2019 annad.\nnotACheckmate=Chan e tul-chasg a th\u2019 ann\ncolorPlaysCheckmateInOne=Tha %s a\u2019 cluich; tul-chasg an ceann gluasaid\nretry=Feuch ris a-rithist\nreconnecting=Ag ath-cheangal\nonlineFriends=Caraidean air loidhne\nnoFriendsOnline=Chan eil caraid air loidhne\nfindFriends=Lorg caraidean\nfavoriteOpponents=Na farpaisichean as annsa leat\nfollow=Lean air\nfollowing=A\u2019 leantainn air\nunfollow=Na lean air tuilleadh\nblock=Bac\nblocked=Bacte\nunblock=D\u00ec-bhac\nfollowsYou=\u2019Gad leantainn\nxStartedFollowingY=Th\u00f2isich %s a\u2019 leantainn air %s\nnbFollowers=%s luchd-leantainn\nnbFollowing=%s \u2019ga leantainn\nmore=Barrachd\nmemberSince=Ball o chionn\nlastSeenActive=An logadh a-steach mu dheireadh %s\nchallengeToPlay=Thoir d\u00f9bhlan cluiche dha\nplayer=Cluicheadair\nlist=Liosta\ngraph=Graf\nlessThanNbMinutes=Nas lugha na %s mionaidean\nxToYMinutes=%s gu %s mionaidean\ntextIsTooShort=Tha an teacsa ro ghoirid.\ntextIsTooLong=Tha an teacsa ro fhada.\nrequired=Riatanach.\nopenTournaments=F\u00e8ill-chluichean fosgailte\nduration=Faid\nwinner=Buannaiche\nstanding=A\u2019 seasamh\ncreateANewTournament=Cruthaich f\u00e8ill-chluich \u00f9r\njoin=Gabh p\u00e0irt ann\nwithdraw=C\u00f9laich\npoints=Puingean\nwins=Buaidhean\nlosses=Ruaigean\nwinStreak=Sreath de bhuaidhean\ncreatedBy=Air a chruthachadh le\ntournamentIsStarting=Tha an fh\u00e8ill-chluich gu bhith t\u00f2iseachadh\nmembersOnly=Buill a-mh\u00e0in\nboardEditor=Deasaiche a\u2019 bh\u00f9ird\nstartPosition=Suidheachadh an t\u00f2iseachaidh\nclearBoard=Falamhaich am b\u00f2rd\nsavePosition=S\u00e0bhail an suidheachadh\nloadPosition=Luchdaich suidheachadh\nisPrivate=Pr\u00ecobhaideach\nreportXToModerators=Cuir gearan mu %s dha na maoir\nprofile=Pr\u00f2ifil\neditProfile=Deasaich a\u2019 phr\u00f2ifil\nfirstName=Ainm\nlastName=Sloinneadh\nbiography=Eachdraidh-beatha\ncountry=D\u00f9thaich\npreferences=Roghainnean\nwatchLichessTV=Coimhead air TBh Lichess\npreviouslyOnLichessTV=Air Tbh Lichess roimhe\nonlinePlayers=Cluicheadairean air loidhne\nactiveToday=Gn\u00ecomhach an-diugh\nactivePlayers=Cluicheadairean gn\u00ecomhach\nbewareTheGameIsRatedButHasNoClock=Thoir an aire, th\u00e8id an geama seo rangachadh ach chan eil uaireadair aige!\ntraining=Tr\u00e8anadh\nyourPuzzleRatingX=An rangachadh agad: %s\nfindTheBestMoveForWhite=Lorg an gluasad as fhearr airson geal.\nfindTheBestMoveForBlack=Lorg an gluasad as fhearr airson dubh.\ntoTrackYourProgress=Gus s\u00f9il a chumail air d\u2019 adhartas:\ntrainingSignupExplanation=Bheir Lichess t\u00f2imhseachain dhut a bhios freagarrach dhan chomas agad ach am faigh thu tr\u00e8anadh as iomchaidh.\nrecentlyPlayedPuzzles=T\u00f2imhseachain o chionn goirid\npuzzleId=T\u00f2imhseachan %s\npuzzleOfTheDay=T\u00f2imhseachan an latha\nclickToSolve=Briog an-seo airson fhuasgladh\ngoodMove=Seo gluasad math\nbutYouCanDoBetter=Ach tha gluasad nas fhearr ann.\nbestMove=Seo an gluasad as fhearr!\nkeepGoing=Cum ort...\npuzzleFailed=Cha deach leat\nbutYouCanKeepTrying=Ach faodaidh tu feuchainn a-rithist.\nvictory=Buaidh!\ngiveUp=Thoir g\u00e8ill\npuzzleSolvedInXSeconds=Rinn thu a\u2019 ch\u00f9is air an ceann %s diog.\nwasThisPuzzleAnyGood=An robh an t\u00f2imhseachan seo math?\npleaseVotePuzzle=Cuidich lichess \u2019s cuir bh\u00f2t ann leis an t-saighead suas no s\u00ecos:\nthankYou=M\u00f2ran taing!\nratingX=Rangachadh: %s\nplayedXTimes=Air a chluich %s turas\nfromGameLink=On gheama %s\nstartTraining=T\u00f2isich air an tr\u00e8anadh\ncontinueTraining=Lean air adhart leis an tr\u00e8anadh\nretryThisPuzzle=Feuch ris an t\u00f2imhseachan seo a-rithist\nthisPuzzleIsCorrect=Tha an t\u00f2imhseachan seo ceart is inntinneach\nthisPuzzleIsWrong=Tha an t\u00f2imhseachan seo cearr no d\u00f2rainneach\nyouHaveNbSecondsToMakeYourFirstMove=Tha %s diog(an) air fh\u00e0gail dhut airson a' chiad gluasaid agad!\nnbGamesInPlay=%s geama 'gan cluich\nopeningId=Fosgladh %s\nyourOpeningRatingX=An rangachadh fosglaidh agad: %s\nfindNbStrongMoves=Lorg %s gluasad(an) l\u00e0idir\nopeningFailed=Dh'fh\u00e0illig leis an fhosgladh\nopeningSolved=Chaidh am fosgladh fhuasgladh\nrecentlyPlayedOpenings=Fosglaidhean a chaidh a chluich o chionn goirid\npuzzles=T\u00f2imhseachain\nopenings=Fosglaidhean\nlatestUpdates=Na naidheachdan as \u00f9ire\ntournamentWinners=Feadhainn a bhuannaich f\u00e8ill-chluich\nname=Ainm\ndescription=Tuairisgeul\nno=Tha\nyes=Chan eil\nhelp=Cobhair:\ncreateANewTopic=Cruthaich cuspair \u00f9r\ntopics=Cuspairean\nposts=Postaichean\nlastPost=Am post mu dheireadh\nviews=Air a shealltainn\nreplies=Freagairtean\nreplyToThisTopic=Freagair dhan chuspair seo\nreply=Freagair\nmessage=Teachdaireachd\ncreateTheTopic=Cruthaich an cuspair\nreportAUser=D\u00e8an aithris air cleachdaiche\nuser=Cleachdaiche\nreason=Adhbhar\nwhatIsIheMatter=D\u00e8 an trioblaid?\ncheat=Cealgaireachd\ninsult=Mosach\ntroll=Troll\nother=Adhbhar eile\nby=le %s\nthisTopicIsNowClosed=Tha an cuspair seo d\u00f9inte a-nis.\nblog=Bloga\nnotes=N\u00f2taichean\ncommunity=Coimhearsnachd\ntools=Goireasean\nwatch=Coimhead\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"GDScript"} {"commit":"26d8b5d9aee84fa40e2117f09d7ecd5440b32b25","subject":"Only accelerate if ship is directed towards user","message":"Only accelerate if ship is directed towards user\n","repos":"h4de5\/spiel4","old_file":"game\/processor\/ai.gd","new_file":"game\/processor\/ai.gd","new_contents":"# AI that controlls a ship by sending commands to moveable and shootable interface\n\nextends \"res:\/\/game\/processor\/processor.gd\"\n\nvar delta_count = 0\nvar delta_max = 0.2\nvar moveable = null\nvar shootable = null\nvar weapon = null\n\n# TODO: make different AI modes\n# follow: using minimal and maximal proximity\n# guard: fly around a given point or object\n# flee: try to flee from a predator object\n# make it possible to switch between those modes\n\nfunc _ready() :\n\tset_fixed_process(true)\n\nfunc set_parent(p) :\n\tparent = p\n\tcall_deferred(\"initialize\")\n\nfunc initialize():\n\tmoveable = interface.is_moveable(parent)\n\tshootable = interface.is_shootable(parent)\n\tif shootable :\n\t\t#weapon = parent.get_node(\"weapons_selector\").get_active_weapon()\n\t\tweapon = shootable.get_active_weapon()\n\nfunc _fixed_process(delta) :\n\tdelta_count += delta\n\tif delta_count > delta_max :\n\n\t\t# current object position\n\t\tvar ownpos = parent.get_pos();\n\t\tvar ownrot = parent.get_rot();\n\t\t# TODO check if this and targetangle def change have worked\n\t\tvar ownvec = Vector2(sin(ownrot), cos(ownrot))*-1\n\t\t# moving vector according to rotation\n\t\t#var ownvec = Vector2(sin(ownrot), cos(ownrot))\n\n\t\t# target position, rotation and vector\n\t\t# node\n\t\tvar target_moveto\n\t\t# node\n\t\tvar target_shootat\n\t\t# vector2\n\t\tvar targetpos\n\t\t# where should the current not be moved to\n\t\t# vector2\n\t\tvar moving_vector\n\n\t\tif moveable :\n\t\t\ttarget_moveto = find_target_moveto( ownpos, ownrot )\n\n\t\tif shootable:\n\t\t\ttarget_shootat = find_target_shootat( ownpos, ownrot )\n\n\t\tif target_moveto :\n\n\t\t\t# get target position\n\t\t\ttargetpos = target_moveto.get_pos()\n\t\t\t# own position to target vector2\n\t\t\t# if set,\n\t\t\tmoving_vector = (targetpos - ownpos).normalized()\n\n\t\t\t# moved after clearance check\n#\t\t\tif moving_vector != null :\n#\t\t\t\tmoveable.handle_action( global.actions.accelerate, true )\n#\t\t\telif moveable:\n#\t\t\t\tmoveable.handle_action( global.actions.accelerate, false )\n\n\t\t\t# where do i have to turn to?\n\t\t\tvar targetangle = moving_vector.angle_to(ownvec)\n\t\t\t#var targetangle = ownvec.angle_to(moving_vector)\n\n\t\t\t#print(\"ai movment angle\", angle)\n\t\t\tif (targetangle > parent.get_property(global.properties.clearance_rotation)) :\n\t\t\t\tmoveable.handle_action( global.actions.right, true )\n\t\t\telif (targetangle < -parent.get_property(global.properties.clearance_rotation)) :\n\t\t\t\tmoveable.handle_action( global.actions.left, true )\n\t\t\telse :\n\t\t\t\tmoveable.handle_action( global.actions.right, false )\n\t\t\t\tmoveable.handle_action( global.actions.left, false )\n\t\t\t\t# only accelerate if ship is directed towards user,\n\t\t\t\t# prevent never ending spiral\n\t\t\t\tmoveable.handle_action( global.actions.accelerate, true )\n\n\t\telif moveable:\n\t\t\tmoveable.handle_action( global.actions.accelerate, false )\n\t\t\tmoveable.handle_action( global.actions.back, false )\n\t\t\tmoveable.handle_action( global.actions.left, false )\n\t\t\tmoveable.handle_action( global.actions.right, false )\n\n\t\tif target_shootat :\n\n\t\t\tvar bulletrange = parent.get_property(global.properties.bullet_range)\n\n\t\t\t# get target position\n\t\t\ttargetpos = target_shootat.get_pos()\n\n\t\t\t# get projected position of player\n\t\t\t# add velocity\n\t\t\t#targetpos = targetpos + target_shootat.get_linear_velocity()\n\n\t\t\t# correcting distance and bullet speed\n\t\t\t# je weiter weg und je langsamer die kugel\n\t\t\t# desto h\u00f6her muss der anpassungsvector sein\n\t\t\tvar bulletspeed = parent.get_property(global.properties.bullet_speed)\n\t\t\tvar targetdistance = ownpos.distance_to(targetpos)\n\t\t\tvar adjustmentvec = target_shootat.get_linear_velocity()\n\t\t\tadjustmentvec = adjustmentvec * targetdistance \/ bulletspeed\n\t\t\ttargetpos = targetpos + adjustmentvec\n\t\t\t# make target visible\n\t\t\t#target_shootat.get_node(\"projected\").set_global_pos(targetpos)\n\n\t\t\t# own position to target vector2\n\t\t\tvar shooting_vector = (targetpos - ownpos).normalized()\n\n\t\t\t# HACK TODO - AI should not call handle_mousemove\n\t\t\tshootable.handle_mousemove(targetpos)\n\n\t\t\t# stop accelerating if AI is too close\n\t\t\t# only when moving and shooting target are the same\n\t\t\tif (moving_vector != null and\n\t\t\t\ttarget_moveto == target_shootat and\n\t\t\t\townpos.distance_to(targetpos) < bulletrange * 2\/3):\n\n\t\t\t\tmoving_vector = null\n\t\t\t\tmoveable.handle_action( global.actions.accelerate, false )\n\n\t\t\t#var weapon = parent.get_node(\"weapons_selector\").get_active_weapon()\n\n\t\t\tvar weaponrot = weapon.get_weapon_rotation()\n\n\t\t\tvar weaponvec = Vector2(sin(weaponrot), cos(weaponrot))*-1\n\t\t\tvar targetangle = shooting_vector.angle_to(weaponvec)\n\t\t\t#var weaponvec = Vector2(sin(weaponrot), cos(weaponrot))\n\t\t\t#var targetangle = weaponvec.angle_to(shooting_vector)\n\n\t\t\tvar shoot = false\n\n\t\t\t# weapon adjustment\n\t\t\tif (abs(targetangle) < parent.get_property(global.properties.clearance_rotation) and\n\t\t\t\townpos.distance_to(targetpos) < bulletrange) :\n\n\t\t\t\t# shoot only when there is no other enemy in between\n\t\t\t\t# In code, for 2D spacestate, this code must be used:\n\t\t\t\tvar space_state = parent.get_world_2d().get_direct_space_state()\n\t\t\t\t# use global coordinates, not local to node\n\t\t\t\tvar raycast_hits = space_state.intersect_ray( ownpos, targetpos, [parent])\n\t\t\t\tif not raycast_hits.empty():\n\t\t\t\t\t#print (\"raycast_hits \", raycast_hits.collider.get_name())\n\t\t\t\t\tif not raycast_hits.collider.is_in_group(global.groups.enemy) :\n\t\t\t\t\t\tshoot = true\n\t\t\t\telse:\n\t\t\t\t\tshoot = true\n\n\t\t\tif shoot :\n\t\t\t\tshootable.handle_action( global.actions.fire, true)\n\t\t\telse:\n\t\t\t\tshootable.handle_action( global.actions.fire, false )\n\n\t\telif shootable:\n\t\t\tshootable.handle_action( global.actions.target_left, false )\n\t\t\tshootable.handle_action( global.actions.target_right, false )\n\t\t\tshootable.handle_action( global.actions.fire, false )\n\n\n\n\nfunc find_target_moveto( ownpos, ownrot ):\n\tvar pickup\n\tpickup = object_locator.get_next_object( global.groups.pickup, ownpos, ownrot )\n\n\t# if there is a pickup nearby, go there\n\tif pickup and ownpos.distance_to(pickup.get_pos()) < 400:\n\t\treturn pickup\n\n\tvar player\n\t# only go for players in range\n\tplayer = object_locator.get_next_player( ownpos, ownrot )\n\tif player and ownpos.distance_to(player.get_pos()) < 2000:\n\t\treturn player\n\nfunc find_target_shootat( ownpos, ownrot ):\n\tvar player\n\t# only go for players in range\n\tplayer = object_locator.get_next_player( ownpos, ownrot )\n\tif player and ownpos.distance_to(player.get_pos()) < 1500:\n\t\treturn player","old_contents":"# AI that controlls a ship by sending commands to moveable and shootable interface\n\nextends \"res:\/\/game\/processor\/processor.gd\"\n\nvar delta_count = 0\nvar delta_max = 0.2\nvar moveable = null\nvar shootable = null\nvar weapon = null\n\n# TODO: make different AI modes\n# follow: using minimal and maximal proximity\n# guard: fly around a given point or object\n# flee: try to flee from a predator object\n# make it possible to switch between those modes\n\nfunc _ready() :\n\tset_fixed_process(true)\n\nfunc set_parent(p) :\n\tparent = p\n\tcall_deferred(\"initialize\")\n\nfunc initialize():\n\tmoveable = interface.is_moveable(parent)\n\tshootable = interface.is_shootable(parent)\n\tif shootable :\n\t\t#weapon = parent.get_node(\"weapons_selector\").get_active_weapon()\n\t\tweapon = shootable.get_active_weapon()\n\nfunc _fixed_process(delta) :\n\tdelta_count += delta\n\tif delta_count > delta_max :\n\n\t\t# current object position\n\t\tvar ownpos = parent.get_pos();\n\t\tvar ownrot = parent.get_rot();\n\t\t# TODO check if this and targetangle def change have worked\n\t\tvar ownvec = Vector2(sin(ownrot), cos(ownrot))*-1\n\t\t# moving vector according to rotation\n\t\t#var ownvec = Vector2(sin(ownrot), cos(ownrot))\n\n\t\t# target position, rotation and vector\n\t\t# node\n\t\tvar target_moveto\n\t\t# node\n\t\tvar target_shootat\n\t\t# vector2\n\t\tvar targetpos\n\t\t# where should the current not be moved to\n\t\t# vector2\n\t\tvar moving_vector\n\n\t\tif moveable :\n\t\t\ttarget_moveto = find_target_moveto( ownpos, ownrot )\n\n\t\tif shootable:\n\t\t\ttarget_shootat = find_target_shootat( ownpos, ownrot )\n\n\t\tif target_moveto :\n\n\t\t\t# get target position\n\t\t\ttargetpos = target_moveto.get_pos()\n\t\t\t# own position to target vector2\n\t\t\t# if set,\n\t\t\tmoving_vector = (targetpos - ownpos).normalized()\n\n\t\t\tif moving_vector != null :\n\t\t\t\tmoveable.handle_action( global.actions.accelerate, true )\n\t\t\telif moveable:\n\t\t\t\tmoveable.handle_action( global.actions.accelerate, false )\n\n\t\t\t# where do i have to turn to?\n\t\t\tvar targetangle = moving_vector.angle_to(ownvec)\n\t\t\t#var targetangle = ownvec.angle_to(moving_vector)\n\n\t\t\t#print(\"ai movment angle\", angle)\n\t\t\tif (targetangle > parent.get_property(global.properties.clearance_rotation)) :\n\t\t\t\tmoveable.handle_action( global.actions.right, true )\n\t\t\telif (targetangle < -parent.get_property(global.properties.clearance_rotation)) :\n\t\t\t\tmoveable.handle_action( global.actions.left, true )\n\t\t\telse :\n\t\t\t\tmoveable.handle_action( global.actions.right, false )\n\t\t\t\tmoveable.handle_action( global.actions.left, false )\n\n\t\telif moveable:\n\t\t\tmoveable.handle_action( global.actions.accelerate, false )\n\t\t\tmoveable.handle_action( global.actions.back, false )\n\t\t\tmoveable.handle_action( global.actions.left, false )\n\t\t\tmoveable.handle_action( global.actions.right, false )\n\n\t\tif target_shootat :\n\n\t\t\tvar bulletrange = parent.get_property(global.properties.bullet_range)\n\n\t\t\t# get target position\n\t\t\ttargetpos = target_shootat.get_pos()\n\n\t\t\t# get projected position of player\n\t\t\t# add velocity\n\t\t\t#targetpos = targetpos + target_shootat.get_linear_velocity()\n\n\t\t\t# correcting distance and bullet speed\n\t\t\t# je weiter weg und je langsamer die kugel\n\t\t\t# desto h\u00f6her muss der anpassungsvector sein\n\t\t\tvar bulletspeed = parent.get_property(global.properties.bullet_speed)\n\t\t\tvar targetdistance = ownpos.distance_to(targetpos)\n\t\t\tvar adjustmentvec = target_shootat.get_linear_velocity()\n\t\t\tadjustmentvec = adjustmentvec * targetdistance \/ bulletspeed\n\t\t\ttargetpos = targetpos + adjustmentvec\n\t\t\t# make target visible\n\t\t\t#target_shootat.get_node(\"projected\").set_global_pos(targetpos)\n\n\t\t\t# own position to target vector2\n\t\t\tvar shooting_vector = (targetpos - ownpos).normalized()\n\n\t\t\t# HACK TODO - AI should not call handle_mousemove\n\t\t\tshootable.handle_mousemove(targetpos)\n\n\t\t\t# stop accelerating if AI is too close\n\t\t\t# only when moving and shooting target are the same\n\t\t\tif (moving_vector != null and\n\t\t\t\ttarget_moveto == target_shootat and\n\t\t\t\townpos.distance_to(targetpos) < bulletrange * 2\/3):\n\n\t\t\t\tmoving_vector = null\n\t\t\t\tmoveable.handle_action( global.actions.accelerate, false )\n\n\t\t\t#var weapon = parent.get_node(\"weapons_selector\").get_active_weapon()\n\n\t\t\tvar weaponrot = weapon.get_weapon_rotation()\n\n\t\t\tvar weaponvec = Vector2(sin(weaponrot), cos(weaponrot))*-1\n\t\t\tvar targetangle = shooting_vector.angle_to(weaponvec)\n\t\t\t#var weaponvec = Vector2(sin(weaponrot), cos(weaponrot))\n\t\t\t#var targetangle = weaponvec.angle_to(shooting_vector)\n\n\t\t\tvar shoot = false\n\n\t\t\t# weapon adjustment\n\t\t\tif (abs(targetangle) < parent.get_property(global.properties.clearance_rotation) and\n\t\t\t\townpos.distance_to(targetpos) < bulletrange) :\n\n\t\t\t\t# shoot only when there is no other enemy in between\n\t\t\t\t# In code, for 2D spacestate, this code must be used:\n\t\t\t\tvar space_state = parent.get_world_2d().get_direct_space_state()\n\t\t\t\t# use global coordinates, not local to node\n\t\t\t\tvar raycast_hits = space_state.intersect_ray( ownpos, targetpos, [parent])\n\t\t\t\tif not raycast_hits.empty():\n\t\t\t\t\t#print (\"raycast_hits \", raycast_hits.collider.get_name())\n\t\t\t\t\tif not raycast_hits.collider.is_in_group(global.groups.enemy) :\n\t\t\t\t\t\tshoot = true\n\t\t\t\telse:\n\t\t\t\t\tshoot = true\n\n\t\t\tif shoot :\n\t\t\t\tshootable.handle_action( global.actions.fire, true)\n\t\t\telse:\n\t\t\t\tshootable.handle_action( global.actions.fire, false )\n\n\t\telif shootable:\n\t\t\tshootable.handle_action( global.actions.target_left, false )\n\t\t\tshootable.handle_action( global.actions.target_right, false )\n\t\t\tshootable.handle_action( global.actions.fire, false )\n\n\n\n\nfunc find_target_moveto( ownpos, ownrot ):\n\tvar pickup\n\tpickup = object_locator.get_next_object( global.groups.pickup, ownpos, ownrot )\n\n\t# if there is a pickup nearby, go there\n\tif pickup and ownpos.distance_to(pickup.get_pos()) < 400:\n\t\treturn pickup\n\n\tvar player\n\t# only go for players in range\n\tplayer = object_locator.get_next_player( ownpos, ownrot )\n\tif player and ownpos.distance_to(player.get_pos()) < 2000:\n\t\treturn player\n\nfunc find_target_shootat( ownpos, ownrot ):\n\tvar player\n\t# only go for players in range\n\tplayer = object_locator.get_next_player( ownpos, ownrot )\n\tif player and ownpos.distance_to(player.get_pos()) < 1500:\n\t\treturn player","returncode":0,"stderr":"","license":"apache-2.0","lang":"GDScript"} {"commit":"b6fe11c791a42a2f89dafeac204520aa394dc157","subject":"Hide the floor when starting passthrough","message":"Hide the floor when starting passthrough\n","repos":"m4gr3d\/GAST,m4gr3d\/GAST,m4gr3d\/GAST","old_file":"core\/src\/xrapp\/assets\/scripts\/main.gd","new_file":"core\/src\/xrapp\/assets\/scripts\/main.gd","new_contents":"extends Spatial\n\nvar openxr_config = load(\"res:\/\/addons\/godot-openxr\/config\/OpenXRConfig.gdns\").new()\nvar gast_loader = load(\"res:\/\/godot\/plugin\/v1\/gast\/GastLoader.gdns\")\nvar gast = null\n\nvar interface : ARVRInterface\nexport (NodePath) var viewport = null\n\nonready var floor_node = $Floor\n\nfunc _ready():\n\tif (_is_xr_enabled()):\n\t\t_initialise_openxr_interface()\n\telse:\n\t\tprint(\"Skipping OpenXR initialization\")\n\tgast = gast_loader.new()\n\tgast.initialize()\n\nfunc _is_xr_enabled():\n\tvar appPlugin = Engine.get_singleton(\"GastAppPlugin\")\n\tif (appPlugin):\n\t\treturn appPlugin.isXREnabled()\n\telse:\n\t\tprint(\"App plugin is not available\")\n\treturn true\n\nfunc _process(delta_t):\n\t_check_and_perform_runtime_config()\n\nfunc _physics_process(delta_t):\n\tgast.on_physics_process()\n\nfunc _initialise_openxr_interface() -> bool:\n\tif interface:\n\t\t# we are already initialised\n\t\treturn true\n\n\tinterface = ARVRServer.find_interface(\"OpenXR\")\n\tif interface and interface.initialize():\n\t\tprint(\"OpenXR Interface initialized\")\n\n\t\t# Find the viewport we're using to render our XR output\n\t\tvar vp : Viewport = _get_xr_viewport()\n\n\t\t# Connect to our plugin signals\n\t\t_connect_plugin_signals()\n\n\t\t# Change our viewport so it is tied to our ARVR interface and renders to our HMD\n\t\tvp.arvr = true\n\n\t\t# Our interface will tell us whether we should keep our render buffer in linear color space\n\t\tvp.keep_3d_linear = openxr_config.keep_3d_linear()\n\n\t\t# increase our physics engine update speed\n\t\tvar refresh_rate = openxr_config.get_refresh_rate()\n\t\tif refresh_rate == 0:\n\t\t\t# Only Facebook Reality Labs supports this at this time\n\t\t\tprint(\"No refresh rate given by XR runtime\")\n\n\t\t\t# Use something sufficiently high\n\t\t\tEngine.iterations_per_second = 144\n\t\telse:\n\t\t\tprint(\"HMD refresh rate is set to \" + str(refresh_rate))\n\n\t\t\t# Match our physics to our HMD\n\t\t\tEngine.iterations_per_second = refresh_rate\n\n\t\temit_signal(\"initialised\")\n\t\treturn true\n\telse:\n\t\temit_signal(\"failed_initialisation\")\n\t\treturn false\n\nfunc _get_xr_viewport() -> Viewport:\n\tif viewport:\n\t\tvar vp : Viewport = get_node(viewport)\n\t\treturn vp\n\telse:\n\t\treturn get_viewport()\n\nfunc _start_passthrough():\n\t# make sure our viewports background is transparent\n\t_get_xr_viewport().transparent_bg = true\n\n\t# Hide the floor\n\tfloor_node.visible = false\n\t\n\t# enable our passthrough\n\topenxr_config.start_passthrough()\n\nfunc _stop_passthrough():\n\t# Revert our viewports' background transparency\n\t_get_xr_viewport().transparent_bg = false\n\n\t# Disable passthrough\n\topenxr_config.stop_passthrough()\n\t\n\t# Show the floor\n\tfloor_node.visible = true\n\nfunc _connect_plugin_signals():\n\tvar appPlugin = Engine.get_singleton(\"GastAppPlugin\")\n\tif (appPlugin):\n\t\tappPlugin.connect(\"start_passthrough\", self, \"_start_passthrough\")\n\t\tappPlugin.connect(\"stop_passthrough\", self, \"_stop_passthrough\")\n\n# many settings should only be applied once when running; this variable\n# gets reset on application start or when it wakes up from sleep\nvar _performed_runtime_config = false\n\n# here we can react on the android specific notifications\n# reacting on NOTIFICATION_APP_RESUMED is necessary as the OVR context will get\n# recreated when the Android device wakes up from sleep and then all settings wil\n# need to be reapplied\nfunc _notification(what):\n\tif (what == NOTIFICATION_APP_RESUMED):\n\t\t_performed_runtime_config = false # redo runtime config\n\nfunc _check_and_perform_runtime_config():\n\tif _performed_runtime_config: return\n\n\t_performed_runtime_config = true\n","old_contents":"extends Spatial\n\nvar openxr_config = load(\"res:\/\/addons\/godot-openxr\/config\/OpenXRConfig.gdns\").new()\nvar gast_loader = load(\"res:\/\/godot\/plugin\/v1\/gast\/GastLoader.gdns\")\nvar gast = null\n\nvar interface : ARVRInterface\nexport (NodePath) var viewport = null\n\nfunc _ready():\n\tif (_is_xr_enabled()):\n\t\t_initialise_openxr_interface()\n\telse:\n\t\tprint(\"Skipping OpenXR initialization\")\n\tgast = gast_loader.new()\n\tgast.initialize()\n\nfunc _is_xr_enabled():\n\tvar appPlugin = Engine.get_singleton(\"GastAppPlugin\")\n\tif (appPlugin):\n\t\treturn appPlugin.isXREnabled()\n\telse:\n\t\tprint(\"App plugin is not available\")\n\treturn true\n\nfunc _process(delta_t):\n\t_check_and_perform_runtime_config()\n\nfunc _physics_process(delta_t):\n\tgast.on_physics_process()\n\nfunc _initialise_openxr_interface() -> bool:\n\tif interface:\n\t\t# we are already initialised\n\t\treturn true\n\n\tinterface = ARVRServer.find_interface(\"OpenXR\")\n\tif interface and interface.initialize():\n\t\tprint(\"OpenXR Interface initialized\")\n\n\t\t# Find the viewport we're using to render our XR output\n\t\tvar vp : Viewport = _get_xr_viewport()\n\n\t\t# Connect to our plugin signals\n\t\t_connect_plugin_signals()\n\n\t\t# Change our viewport so it is tied to our ARVR interface and renders to our HMD\n\t\tvp.arvr = true\n\n\t\t# Our interface will tell us whether we should keep our render buffer in linear color space\n\t\tvp.keep_3d_linear = openxr_config.keep_3d_linear()\n\n\t\t# increase our physics engine update speed\n\t\tvar refresh_rate = openxr_config.get_refresh_rate()\n\t\tif refresh_rate == 0:\n\t\t\t# Only Facebook Reality Labs supports this at this time\n\t\t\tprint(\"No refresh rate given by XR runtime\")\n\n\t\t\t# Use something sufficiently high\n\t\t\tEngine.iterations_per_second = 144\n\t\telse:\n\t\t\tprint(\"HMD refresh rate is set to \" + str(refresh_rate))\n\n\t\t\t# Match our physics to our HMD\n\t\t\tEngine.iterations_per_second = refresh_rate\n\n\t\temit_signal(\"initialised\")\n\t\treturn true\n\telse:\n\t\temit_signal(\"failed_initialisation\")\n\t\treturn false\n\nfunc _get_xr_viewport() -> Viewport:\n\tif viewport:\n\t\tvar vp : Viewport = get_node(viewport)\n\t\treturn vp\n\telse:\n\t\treturn get_viewport()\n\nfunc _start_passthrough():\n\t# make sure our viewports background is transparent\n\t_get_xr_viewport().transparent_bg = true\n\n\t# enable our passthrough\n\topenxr_config.start_passthrough()\n\nfunc _stop_passthrough():\n\t# Revert our viewports' background transparency\n\t_get_xr_viewport().transparent_bg = false\n\n\t# Disable passthrough\n\topenxr_config.stop_passthrough()\n\nfunc _connect_plugin_signals():\n\tvar appPlugin = Engine.get_singleton(\"GastAppPlugin\")\n\tif (appPlugin):\n\t\tappPlugin.connect(\"start_passthrough\", self, \"_start_passthrough\")\n\t\tappPlugin.connect(\"stop_passthrough\", self, \"_stop_passthrough\")\n\t\n\tARVRServer.connect(\"openxr_session_begun\", self, \"_on_openxr_session_begun\")\n\tARVRServer.connect(\"openxr_session_ending\", self, \"_on_openxr_session_ending\")\n\tARVRServer.connect(\"openxr_focused_state\", self, \"_on_openxr_focused_state\")\n\tARVRServer.connect(\"openxr_visible_state\", self, \"_on_openxr_visible_state\")\n\tARVRServer.connect(\"openxr_pose_recentered\", self, \"_on_openxr_pose_recentered\")\n\nfunc _on_openxr_session_begun():\n\tprint(\"OpenXR session begun\")\n\temit_signal(\"session_begun\")\n\nfunc _on_openxr_session_ending():\n\tprint(\"OpenXR session ending\")\n\temit_signal(\"session_ending\")\n\nfunc _on_openxr_focused_state():\n\tprint(\"OpenXR focused state\")\n\temit_signal(\"focused_state\")\n\nfunc _on_openxr_visible_state():\n\tprint(\"OpenXR visible state\")\n\temit_signal(\"visible_state\")\n\nfunc _on_openxr_pose_recentered():\n\tprint(\"OpenXR pose recentered\")\n\temit_signal(\"pose_recentered\")\n\n# many settings should only be applied once when running; this variable\n# gets reset on application start or when it wakes up from sleep\nvar _performed_runtime_config = false\n\n# here we can react on the android specific notifications\n# reacting on NOTIFICATION_APP_RESUMED is necessary as the OVR context will get\n# recreated when the Android device wakes up from sleep and then all settings wil\n# need to be reapplied\nfunc _notification(what):\n\tif (what == NOTIFICATION_APP_RESUMED):\n\t\t_performed_runtime_config = false # redo runtime config\n\nfunc _check_and_perform_runtime_config():\n\tif _performed_runtime_config: return\n\n\t_performed_runtime_config = true\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"ed5b93907720375e854ee67ae741145ab77e4d71","subject":"scene switcher demo changed to reflect tutorial, fixes #1673","message":"scene switcher demo changed to reflect tutorial, fixes #1673\n","repos":"teamblubee\/godot,MarianoGnu\/godot,jjdicharry\/godot,a12n\/godot,zj8487\/godot,mcanders\/godot,DStomtom\/godot,Shockblast\/godot,shackra\/godot,marynate\/godot,karolgotowala\/godot,vnen\/godot,OpenSocialGames\/godot,Faless\/godot,akien-mga\/godot,BogusCurry\/godot,karolgotowala\/godot,n-pigeon\/godot,pkowal1982\/godot,NateWardawg\/godot,wardw\/godot,zicklag\/godot,okamstudio\/godot,FateAce\/godot,hipgraphics\/godot,vnen\/godot,vkbsb\/godot,zj8487\/godot,HatiEth\/godot,jackmakesthings\/godot,shackra\/godot,ricpelo\/godot,lietu\/godot,torgartor21\/godot,youprofit\/godot,teamblubee\/godot,crr0004\/godot,sh95119\/godot,sergicollado\/godot,Zylann\/godot,TheHX\/godot,OpenSocialGames\/godot,gau-veldt\/godot,Valentactive\/godot,mikica1986vee\/Godot_android_tegra_fallback,mikica1986vee\/godot,mikica1986vee\/godot,guilhermefelipecgs\/godot,mcanders\/godot,tomreyn\/godot,FullMeta\/godot,honix\/godot,quabug\/godot,FateAce\/godot,davidalpha\/godot,pkowal1982\/godot,DStomtom\/godot,wardw\/godot,serafinfernandez\/godot,guilhermefelipecgs\/godot,TheHX\/godot,MrMaidx\/godot,didier-v\/godot,ianholing\/godot,TheBoyThePlay\/godot,OpenSocialGames\/godot,sanikoyes\/godot,karolgotowala\/godot,FullMeta\/godot,blackwc\/godot,OpenSocialGames\/godot,ianholing\/godot,HatiEth\/godot,kimsunzun\/godot,Brickcaster\/godot,vastcharade\/godot,iap-mutant\/godot,buckle2000\/godot,davidalpha\/godot,karolgotowala\/godot,BastiaanOlij\/godot,supriyantomaftuh\/godot,xiaoyanit\/godot,lietu\/godot,lietu\/godot,Faless\/godot,okamstudio\/godot,gcbeyond\/godot,dreamsxin\/godot,rollenrolm\/godot,teamblubee\/godot,TheHX\/godot,Brickcaster\/godot,a12n\/godot,zicklag\/godot,teamblubee\/godot,ageazrael\/godot,iap-mutant\/godot,a12n\/godot,torgartor21\/godot,MarianoGnu\/godot,groud\/godot,azurvii\/godot,exabon\/godot,jjdicharry\/godot,sh95119\/godot,youprofit\/godot,davidalpha\/godot,marynate\/godot,Brickcaster\/godot,MarianoGnu\/godot,Max-Might\/godot,wardw\/godot,azurvii\/godot,exabon\/godot,marynate\/godot,crr0004\/godot,mikica1986vee\/GodotArrayEditorStuff,ZuBsPaCe\/godot,JoshuaGrams\/godot,mikica1986vee\/godot,mikica1986vee\/Godot_android_tegra_fallback,zj8487\/godot,iap-mutant\/godot,youprofit\/godot,pkowal1982\/godot,okamstudio\/godot,dreamsxin\/godot,marynate\/godot,wardw\/godot,xiaoyanit\/godot,Faless\/godot,DmitriySalnikov\/godot,Paulloz\/godot,quabug\/godot,vastcharade\/godot,ficoos\/godot,OpenSocialGames\/godot,sergicollado\/godot,marynate\/godot,vastcharade\/godot,OpenSocialGames\/godot,didier-v\/godot,Marqin\/godot,Faless\/godot,a12n\/godot,RandomShaper\/godot,jejung\/godot,iap-mutant\/godot,jjdicharry\/godot,pixelpicosean\/my-godot-2.1,Paulloz\/godot,ricpelo\/godot,DmitriySalnikov\/godot,pixelpicosean\/my-godot-2.1,dreamsxin\/godot,NateWardawg\/godot,mikica1986vee\/GodotArrayEditorStuff,huziyizero\/godot,Paulloz\/godot,didier-v\/godot,MarianoGnu\/godot,hipgraphics\/godot,cpascal\/godot,gcbeyond\/godot,JoshuaGrams\/godot,NateWardawg\/godot,ricpelo\/godot,BoDonkey\/godot,OpenSocialGames\/godot,firefly2442\/godot,mamarilmanson\/godot,Faless\/godot,sh95119\/godot,est31\/godot,BoDonkey\/godot,supriyantomaftuh\/godot,lietu\/godot,mikica1986vee\/Godot_android_tegra_fallback,ianholing\/godot,vastcharade\/godot,ageazrael\/godot,sh95119\/godot,a12n\/godot,zicklag\/godot,Zylann\/godot,exabon\/godot,Valentactive\/godot,hitjim\/godot,sergicollado\/godot,mamarilmanson\/godot,sh95119\/godot,wardw\/godot,RebelliousX\/Go_Dot,kimsunzun\/godot,groud\/godot,mikica1986vee\/Godot_android_tegra_fallback,josempans\/godot,mamarilmanson\/godot,vastcharade\/godot,Brickcaster\/godot,iap-mutant\/godot,vkbsb\/godot,firefly2442\/godot,crr0004\/godot,rollenrolm\/godot,serafinfernandez\/godot,sanikoyes\/godot,Zylann\/godot,RebelliousX\/Go_Dot,RandomShaper\/godot,supriyantomaftuh\/godot,pkowal1982\/godot,kimsunzun\/godot,xiaoyanit\/godot,mikica1986vee\/godot,karolgotowala\/godot,HatiEth\/godot,Valentactive\/godot,BogusCurry\/godot,dreamsxin\/godot,RandomShaper\/godot,Valentactive\/godot,jackmakesthings\/godot,wardw\/godot,hitjim\/godot,quabug\/godot,josempans\/godot,gcbeyond\/godot,sanikoyes\/godot,dreamsxin\/godot,jejung\/godot,NateWardawg\/godot,Paulloz\/godot,BoDonkey\/godot,marynate\/godot,ricpelo\/godot,JoshuaGrams\/godot,pkowal1982\/godot,sanikoyes\/godot,josempans\/godot,liuyucoder\/godot,est31\/godot,BogusCurry\/godot,ZuBsPaCe\/godot,lietu\/godot,hitjim\/godot,TheBoyThePlay\/godot,FullMeta\/godot,kimsunzun\/godot,DStomtom\/godot,youprofit\/godot,hipgraphics\/godot,akien-mga\/godot,Shockblast\/godot,liuyucoder\/godot,hitjim\/godot,jackmakesthings\/godot,godotengine\/godot,mikica1986vee\/godot,HatiEth\/godot,serafinfernandez\/godot,FullMeta\/godot,cpascal\/godot,didier-v\/godot,karolgotowala\/godot,exabon\/godot,hipgraphics\/godot,liuyucoder\/godot,josempans\/godot,crr0004\/godot,sh95119\/godot,firefly2442\/godot,mrezai\/godot,davidalpha\/godot,FullMeta\/godot,OpenSocialGames\/godot,teamblubee\/godot,Hodes\/godot,didier-v\/godot,NateWardawg\/godot,NateWardawg\/godot,Brickcaster\/godot,jjdicharry\/godot,wardw\/godot,ricpelo\/godot,xiaoyanit\/godot,okamstudio\/godot,Max-Might\/godot,crr0004\/godot,mrezai\/godot,gcbeyond\/godot,mikica1986vee\/GodotArrayEditorStuff,mikica1986vee\/Godot_android_tegra_fallback,shackra\/godot,okamstudio\/godot,shackra\/godot,pkowal1982\/godot,liuyucoder\/godot,xiaoyanit\/godot,mrezai\/godot,sanikoyes\/godot,morrow1nd\/godot,mikica1986vee\/GodotArrayEditorStuff,vastcharade\/godot,pkowal1982\/godot,DStomtom\/godot,DmitriySalnikov\/godot,youprofit\/godot,BogusCurry\/godot,morrow1nd\/godot,Marqin\/godot,jjdicharry\/godot,Paulloz\/godot,jejung\/godot,honix\/godot,opmana\/godot,Marqin\/godot,TheBoyThePlay\/godot,TheBoyThePlay\/godot,opmana\/godot,mamarilmanson\/godot,BoDonkey\/godot,ZuBsPaCe\/godot,josempans\/godot,agusbena\/godot,serafinfernandez\/godot,MrMaidx\/godot,BogusCurry\/godot,mamarilmanson\/godot,BastiaanOlij\/godot,crr0004\/godot,wardw\/godot,jjdicharry\/godot,BoDonkey\/godot,godotengine\/godot,liuyucoder\/godot,mikica1986vee\/godot,xiaoyanit\/godot,sh95119\/godot,tomreyn\/godot,ianholing\/godot,jjdicharry\/godot,sergicollado\/godot,BogusCurry\/godot,akien-mga\/godot,mikica1986vee\/GodotArrayEditorStuff,FateAce\/godot,mikica1986vee\/godot,buckle2000\/godot,Hodes\/godot,lietu\/godot,didier-v\/godot,vastcharade\/godot,pixelpicosean\/my-godot-2.1,BoDonkey\/godot,vastcharade\/godot,ex\/godot,zicklag\/godot,RebelliousX\/Go_Dot,crr0004\/godot,serafinfernandez\/godot,supriyantomaftuh\/godot,mcanders\/godot,teamblubee\/godot,DStomtom\/godot,okamstudio\/godot,ex\/godot,liuyucoder\/godot,exabon\/godot,BastiaanOlij\/godot,cpascal\/godot,mikica1986vee\/Godot_android_tegra_fallback,huziyizero\/godot,DStomtom\/godot,okamstudio\/godot,NateWardawg\/godot,ageazrael\/godot,azurvii\/godot,FullMeta\/godot,teamblubee\/godot,buckle2000\/godot,okamstudio\/godot,Marqin\/godot,n-pigeon\/godot,firefly2442\/godot,didier-v\/godot,ex\/godot,shackra\/godot,FateAce\/godot,Hodes\/godot,davidalpha\/godot,honix\/godot,mikica1986vee\/godot,jjdicharry\/godot,dreamsxin\/godot,Zylann\/godot,karolgotowala\/godot,sh95119\/godot,jjdicharry\/godot,JoshuaGrams\/godot,firefly2442\/godot,serafinfernandez\/godot,honix\/godot,zj8487\/godot,shackra\/godot,ex\/godot,karolgotowala\/godot,hipgraphics\/godot,Paulloz\/godot,ex\/godot,serafinfernandez\/godot,vnen\/godot,lietu\/godot,groud\/godot,torgartor21\/godot,est31\/godot,akien-mga\/godot,blackwc\/godot,mcanders\/godot,blackwc\/godot,sergicollado\/godot,HatiEth\/godot,torgartor21\/godot,est31\/godot,FullMeta\/godot,gcbeyond\/godot,ianholing\/godot,FullMeta\/godot,MrMaidx\/godot,mcanders\/godot,lietu\/godot,mamarilmanson\/godot,davidalpha\/godot,davidalpha\/godot,xiaoyanit\/godot,mikica1986vee\/godot,agusbena\/godot,Marqin\/godot,BoDonkey\/godot,ex\/godot,azurvii\/godot,FullMeta\/godot,Shockblast\/godot,youprofit\/godot,akien-mga\/godot,jackmakesthings\/godot,TheBoyThePlay\/godot,DStomtom\/godot,serafinfernandez\/godot,ex\/godot,blackwc\/godot,davidalpha\/godot,a12n\/godot,gau-veldt\/godot,mikica1986vee\/GodotArrayEditorStuff,ZuBsPaCe\/godot,OpenSocialGames\/godot,TheHX\/godot,liuyucoder\/godot,Hodes\/godot,akien-mga\/godot,sergicollado\/godot,teamblubee\/godot,HatiEth\/godot,jejung\/godot,vastcharade\/godot,azurvii\/godot,n-pigeon\/godot,n-pigeon\/godot,est31\/godot,RandomShaper\/godot,blackwc\/godot,Valentactive\/godot,ZuBsPaCe\/godot,crr0004\/godot,teamblubee\/godot,kimsunzun\/godot,mamarilmanson\/godot,ianholing\/godot,guilhermefelipecgs\/godot,sergicollado\/godot,gcbeyond\/godot,est31\/godot,MarianoGnu\/godot,Zylann\/godot,okamstudio\/godot,vnen\/godot,rollenrolm\/godot,MarianoGnu\/godot,xiaoyanit\/godot,opmana\/godot,FullMeta\/godot,agusbena\/godot,azurvii\/godot,cpascal\/godot,HatiEth\/godot,n-pigeon\/godot,gcbeyond\/godot,hipgraphics\/godot,mamarilmanson\/godot,zj8487\/godot,mikica1986vee\/godot,BastiaanOlij\/godot,Paulloz\/godot,a12n\/godot,marynate\/godot,mikica1986vee\/Godot_android_tegra_fallback,morrow1nd\/godot,Hodes\/godot,BoDonkey\/godot,hitjim\/godot,Shockblast\/godot,Shockblast\/godot,zj8487\/godot,torgartor21\/godot,buckle2000\/godot,ageazrael\/godot,ficoos\/godot,ageazrael\/godot,crr0004\/godot,ficoos\/godot,mrezai\/godot,iap-mutant\/godot,BastiaanOlij\/godot,RebelliousX\/Go_Dot,mamarilmanson\/godot,ricpelo\/godot,akien-mga\/godot,vkbsb\/godot,ianholing\/godot,Zylann\/godot,firefly2442\/godot,serafinfernandez\/godot,BoDonkey\/godot,josempans\/godot,BogusCurry\/godot,NateWardawg\/godot,huziyizero\/godot,blackwc\/godot,buckle2000\/godot,josempans\/godot,morrow1nd\/godot,zj8487\/godot,agusbena\/godot,RandomShaper\/godot,marynate\/godot,vnen\/godot,ZuBsPaCe\/godot,liuyucoder\/godot,hitjim\/godot,morrow1nd\/godot,zicklag\/godot,torgartor21\/godot,kimsunzun\/godot,rollenrolm\/godot,torgartor21\/godot,pixelpicosean\/my-godot-2.1,jejung\/godot,shackra\/godot,sanikoyes\/godot,mikica1986vee\/GodotArrayEditorStuff,tomreyn\/godot,shackra\/godot,a12n\/godot,honix\/godot,mikica1986vee\/Godot_android_tegra_fallback,BastiaanOlij\/godot,mrezai\/godot,Faless\/godot,a12n\/godot,RebelliousX\/Go_Dot,supriyantomaftuh\/godot,Valentactive\/godot,TheBoyThePlay\/godot,quabug\/godot,ianholing\/godot,youprofit\/godot,agusbena\/godot,vnen\/godot,DmitriySalnikov\/godot,firefly2442\/godot,tomreyn\/godot,MarianoGnu\/godot,n-pigeon\/godot,supriyantomaftuh\/godot,tomreyn\/godot,Brickcaster\/godot,dreamsxin\/godot,ianholing\/godot,dreamsxin\/godot,iap-mutant\/godot,Zylann\/godot,karolgotowala\/godot,MrMaidx\/godot,godotengine\/godot,hitjim\/godot,BastiaanOlij\/godot,a12n\/godot,vnen\/godot,hipgraphics\/godot,Zylann\/godot,jackmakesthings\/godot,opmana\/godot,JoshuaGrams\/godot,mrezai\/godot,groud\/godot,josempans\/godot,ricpelo\/godot,guilhermefelipecgs\/godot,supriyantomaftuh\/godot,ficoos\/godot,TheBoyThePlay\/godot,HatiEth\/godot,okamstudio\/godot,mikica1986vee\/GodotArrayEditorStuff,lietu\/godot,torgartor21\/godot,liuyucoder\/godot,vkbsb\/godot,xiaoyanit\/godot,torgartor21\/godot,didier-v\/godot,DStomtom\/godot,sergicollado\/godot,honix\/godot,Faless\/godot,ricpelo\/godot,quabug\/godot,didier-v\/godot,guilhermefelipecgs\/godot,buckle2000\/godot,FateAce\/godot,agusbena\/godot,karolgotowala\/godot,ianholing\/godot,lietu\/godot,iap-mutant\/godot,sh95119\/godot,vnen\/godot,zj8487\/godot,cpascal\/godot,DmitriySalnikov\/godot,RebelliousX\/Go_Dot,marynate\/godot,godotengine\/godot,MrMaidx\/godot,youprofit\/godot,gau-veldt\/godot,BoDonkey\/godot,hitjim\/godot,jejung\/godot,Shockblast\/godot,godotengine\/godot,Shockblast\/godot,jjdicharry\/godot,quabug\/godot,supriyantomaftuh\/godot,Hodes\/godot,supriyantomaftuh\/godot,hipgraphics\/godot,ageazrael\/godot,JoshuaGrams\/godot,zj8487\/godot,MrMaidx\/godot,godotengine\/godot,vkbsb\/godot,sanikoyes\/godot,davidalpha\/godot,ficoos\/godot,TheBoyThePlay\/godot,kimsunzun\/godot,ricpelo\/godot,mrezai\/godot,zicklag\/godot,groud\/godot,gcbeyond\/godot,ex\/godot,firefly2442\/godot,pixelpicosean\/my-godot-2.1,jackmakesthings\/godot,NateWardawg\/godot,gau-veldt\/godot,quabug\/godot,Valentactive\/godot,cpascal\/godot,blackwc\/godot,jackmakesthings\/godot,opmana\/godot,ZuBsPaCe\/godot,TheBoyThePlay\/godot,hipgraphics\/godot,exabon\/godot,BogusCurry\/godot,ricpelo\/godot,liuyucoder\/godot,jackmakesthings\/godot,ficoos\/godot,blackwc\/godot,DmitriySalnikov\/godot,n-pigeon\/godot,Faless\/godot,mamarilmanson\/godot,Max-Might\/godot,cpascal\/godot,iap-mutant\/godot,cpascal\/godot,hitjim\/godot,MarianoGnu\/godot,TheHX\/godot,iap-mutant\/godot,kimsunzun\/godot,mikica1986vee\/Godot_android_tegra_fallback,gcbeyond\/godot,blackwc\/godot,serafinfernandez\/godot,ageazrael\/godot,godotengine\/godot,sergicollado\/godot,Brickcaster\/godot,jackmakesthings\/godot,Valentactive\/godot,Max-Might\/godot,mikica1986vee\/GodotArrayEditorStuff,Max-Might\/godot,sh95119\/godot,xiaoyanit\/godot,FateAce\/godot,torgartor21\/godot,quabug\/godot,shackra\/godot,huziyizero\/godot,zj8487\/godot,vkbsb\/godot,youprofit\/godot,Shockblast\/godot,hipgraphics\/godot,youprofit\/godot,guilhermefelipecgs\/godot,HatiEth\/godot,OpenSocialGames\/godot,pkowal1982\/godot,mikica1986vee\/Godot_android_tegra_fallback,TheBoyThePlay\/godot,shackra\/godot,Marqin\/godot,quabug\/godot,DStomtom\/godot,mikica1986vee\/GodotArrayEditorStuff,jackmakesthings\/godot,vkbsb\/godot,guilhermefelipecgs\/godot,cpascal\/godot,HatiEth\/godot,blackwc\/godot,dreamsxin\/godot,quabug\/godot,RandomShaper\/godot,DStomtom\/godot,crr0004\/godot,rollenrolm\/godot,dreamsxin\/godot,huziyizero\/godot,DmitriySalnikov\/godot,groud\/godot,mrezai\/godot,sanikoyes\/godot,godotengine\/godot,kimsunzun\/godot,agusbena\/godot,mcanders\/godot,morrow1nd\/godot,teamblubee\/godot,marynate\/godot,supriyantomaftuh\/godot,didier-v\/godot,wardw\/godot,vastcharade\/godot,sergicollado\/godot,guilhermefelipecgs\/godot,gcbeyond\/godot,ZuBsPaCe\/godot,agusbena\/godot,wardw\/godot,gau-veldt\/godot,akien-mga\/godot,cpascal\/godot,BogusCurry\/godot,BastiaanOlij\/godot,RandomShaper\/godot,Max-Might\/godot,davidalpha\/godot,kimsunzun\/godot,BogusCurry\/godot,hitjim\/godot,vkbsb\/godot","old_file":"demos\/misc\/autoload\/global.gd","new_file":"demos\/misc\/autoload\/global.gd","new_contents":"extends Node\n\n\nvar current_scene = null\n\nfunc _deferred_goto_scene(path):\n\n\t# Immediately free the current scene,\n # there is no risk here.\t\n\tcurrent_scene.free()\n\n\t# Load new scene\n\tvar s = ResourceLoader.load(path)\n\n\t# Instance the new scene\n\tcurrent_scene = s.instance()\n\n\t# Add it to the active scene, as child of root\n\tget_tree().get_root().add_child(current_scene)\n\nfunc goto_scene(path):\n\n\t# This function will usually be called from a signal callback,\n # or some other function from the running scene.\n\t# Deleting the current scene at this point might be\n # a bad idea, because it may be inside of a callback or function of it.\n\t# The worst case will be a crash or unexpected behavior.\n\n\t# The way around this is deferring the load to a later time, when\n # it is ensured that no code from the current scene is running:\n\n\tcall_deferred(\"_deferred_goto_scene\",path)\n\n\nfunc _ready():\n\t# Get the current scene, the first time.\n\t# it is always the last child of root,\n\t# after the autoloaded nodes.\n\n\tvar root = get_tree().get_root()\n\tcurrent_scene = root.get_child( root.get_child_count() -1 )\n","old_contents":"extends Node\n\n\nvar current_scene = null\n\n\nfunc goto_scene(scene):\n\t#load new scene\n\tvar s = ResourceLoader.load(scene)\n\t#queue erasing old (don't use free because that scene is calling this method)\n\tcurrent_scene.queue_free()\n\t#instance the new scene\n\tcurrent_scene = s.instance()\n\t#add it to the active scene, as child of root\n\tget_tree().get_root().add_child(current_scene)\n\n\nfunc _ready():\n\t# get the current scene\n\t# it is always the last child of root,\n\t# after the autoloaded nodes\n\tvar root = get_tree().get_root()\n\tcurrent_scene = root.get_child( root.get_child_count() -1 )\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"2e368a87c464cf8c9607ae48af355dcbe8b7eb36","subject":"Fix for tween: Fixed the rotation property (was set_rotation_in_degress, now it's set_rotation_degress)","message":"Fix for tween:\nFixed the rotation property (was set_rotation_in_degress, now it's set_rotation_degress)\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"misc\/tween\/main.gd","new_file":"misc\/tween\/main.gd","new_contents":"\nextends Control\n\n# Member variables\nvar trans = [\"linear\", \"sine\", \"quint\", \"quart\", \"quad\", \"expo\", \"elastic\", \"cubic\", \"circ\", \"bounce\", \"back\"]\nvar eases = [\"in\", \"out\", \"in_out\", \"out_in\"]\nvar modes = [\"move\", \"color\", \"scale\", \"rotate\", \"callback\", \"follow\", \"repeat\", \"pause\"]\n\nvar state = {\n\ttrans = Tween.TRANS_LINEAR,\n\teases = Tween.EASE_IN,\n}\n\n\nfunc _ready():\n\tfor index in range(trans.size()):\n\t\tvar name = trans[index]\n\t\tget_node(\"trans\/\" + name).connect(\"pressed\", self, \"on_trans_changed\", [name, index])\n\n\tfor index in range(eases.size()):\n\t\tvar name = eases[index]\n\t\tget_node(\"eases\/\" + name).connect(\"pressed\", self, \"on_eases_changed\", [name, index])\n\n\tfor index in range(modes.size()):\n\t\tvar name = modes[index]\n\t\tget_node(\"modes\/\" + name).connect(\"pressed\", self, \"on_modes_changed\", [name])\n\n\tget_node(\"colors\/color_from\/picker\").set_pick_color(Color(1, 0, 0, 1))\n\tget_node(\"colors\/color_from\/picker\").connect(\"color_changed\", self, \"on_color_changed\")\n\n\tget_node(\"colors\/color_to\/picker\").set_pick_color(Color(0, 1, 1, 1))\n\tget_node(\"colors\/color_to\/picker\").connect(\"color_changed\", self, \"on_color_changed\")\n\n\tget_node(\"trans\/linear\").set_pressed(true)\n\tget_node(\"eases\/in\").set_pressed(true)\n\tget_node(\"modes\/move\").set_pressed(true)\n\tget_node(\"modes\/repeat\").set_pressed(true)\n\n\treset_tween()\n\n\nfunc on_trans_changed(name, index):\n\tfor index in range(trans.size()):\n\t\tvar pressed = trans[index] == name\n\t\tvar btn = get_node(\"trans\/\" + trans[index])\n\n\t\tbtn.set_pressed(pressed)\n\t\tset_mouse_filter(Control.MOUSE_FILTER_IGNORE if pressed else Control.MOUSE_FILTER_PASS)\n\n\tstate.trans = index\n\treset_tween()\n\n\nfunc on_eases_changed(name, index):\n\tfor index in range(eases.size()):\n\t\tvar pressed = eases[index] == name\n\t\tvar btn = get_node(\"eases\/\" + eases[index])\n\n\t\tbtn.set_pressed(pressed)\n\t\tset_mouse_filter(Control.MOUSE_FILTER_IGNORE if pressed else Control.MOUSE_FILTER_PASS)\n\n\tstate.eases = index\n\treset_tween()\n\n\nfunc on_modes_changed(name):\n\tvar tween = get_node(\"tween\")\n\tif name == \"pause\":\n\t\tif get_node(\"modes\/pause\").is_pressed():\n\t\t\ttween.stop_all()\n\t\t\tget_node(\"timeline\").set_mouse_filter(Control.MOUSE_FILTER_PASS)\n\t\telse:\n\t\t\ttween.resume_all()\n\t\t\tget_node(\"timeline\").set_mouse_filter(Control.MOUSE_FILTER_IGNORE)\n\telse:\n\t\treset_tween()\n\n\nfunc on_color_changed(color):\n\treset_tween()\n\n\nfunc reset_tween():\n\tvar tween = get_node(\"tween\")\n\tvar pos = tween.tell()\n\ttween.reset_all()\n\ttween.remove_all()\n\n\tvar sprite = get_node(\"tween\/area\/sprite\")\n\tvar follow = get_node(\"tween\/area\/follow\")\n\tvar follow_2 = get_node(\"tween\/area\/follow_2\")\n\tvar size = get_node(\"tween\/area\").get_size()\n\n\tif get_node(\"modes\/move\").is_pressed():\n\t\ttween.interpolate_method(sprite, \"set_position\", Vector2(0, 0), Vector2(size.x, size.y), 2, state.trans, state.eases)\n\t\ttween.interpolate_property(sprite, \"position\", Vector2(size.x, size.y), Vector2(0, 0), 2, state.trans, state.eases, 2)\n\n\tif get_node(\"modes\/color\").is_pressed():\n\t\ttween.interpolate_method(sprite, \"set_modulate\", get_node(\"colors\/color_from\/picker\").get_pick_color(), get_node(\"colors\/color_to\/picker\").get_pick_color(), 2, state.trans, state.eases)\n\t\ttween.interpolate_property(sprite, \"modulate\", get_node(\"colors\/color_to\/picker\").get_pick_color(), get_node(\"colors\/color_from\/picker\").get_pick_color(), 2, state.trans, state.eases, 2)\n\telse:\n\t\tsprite.set_modulate(Color(1,1,1,1))\n\n\tif get_node(\"modes\/scale\").is_pressed():\n\t\ttween.interpolate_method(sprite, \"set_scale\", Vector2(0.5, 0.5), Vector2(1.5, 1.5), 2, state.trans, state.eases)\n\t\ttween.interpolate_property(sprite, \"scale\", Vector2(1.5, 1.5), Vector2(0.5, 0.5), 2, state.trans, state.eases, 2)\n\telse:\n\t\tsprite.set_scale(Vector2(1,1))\n\n\tif get_node(\"modes\/rotate\").is_pressed():\n\t\ttween.interpolate_method(sprite, \"set_rotation_degrees\", 0, 360, 2, state.trans, state.eases)\n\t\ttween.interpolate_property(sprite, \"rotation_degrees\", 360, 0, 2, state.trans, state.eases, 2)\n\n\tif get_node(\"modes\/callback\").is_pressed():\n\t\ttween.interpolate_callback(self, 0.5, \"on_callback\", \"0.5 second's after\")\n\t\ttween.interpolate_callback(self, 0.2, \"on_callback\", \"1.2 second's after\")\n\n\tif get_node(\"modes\/follow\").is_pressed():\n\t\tfollow.show()\n\t\tfollow_2.show()\n\n\t\ttween.follow_method(follow, \"set_position\", Vector2(0, size.y), sprite, \"get_position\", 2, state.trans, state.eases)\n\t\ttween.targeting_method(follow, \"set_position\", sprite, \"get_position\", Vector2(0, size.y), 2, state.trans, state.eases, 2)\n\n\t\ttween.targeting_property(follow_2, \"position\", sprite, \"position\", Vector2(size.x, 0), 2, state.trans, state.eases)\n\t\ttween.follow_property(follow_2, \"position\", Vector2(size.x, 0), sprite, \"position\", 2, state.trans, state.eases, 2)\n\telse:\n\t\tfollow.hide()\n\t\tfollow_2.hide()\n\n\ttween.set_repeat(get_node(\"modes\/repeat\").is_pressed())\n\ttween.start()\n\ttween.seek(pos)\n\n\tif get_node(\"modes\/pause\").is_pressed():\n\t\ttween.stop_all()\n\t\t#get_node(\"timeline\").set_ignore_mouse(false)\n\t\tget_node(\"timeline\").set_value(0)\n\telse:\n\t\ttween.resume_all()\n\t\t#get_node(\"timeline\").set_ignore_mouse(true)\n\n\nfunc _on_tween_step(object, key, elapsed, value):\n\tvar timeline = get_node(\"timeline\")\n\n\tvar tween = get_node(\"tween\")\n\tvar runtime = tween.get_runtime()\n\n\tvar ratio = 100*(elapsed\/runtime)\n\ttimeline.set_value(ratio)\n\n\nfunc _on_timeline_value_changed(value):\n\tif !get_node(\"modes\/pause\").is_pressed():\n\t\treturn\n\n\tvar tween = get_node(\"tween\")\n\tvar runtime = tween.get_runtime()\n\ttween.seek(runtime*value\/100)\n\n\nfunc on_callback(arg):\n\tvar label = get_node(\"tween\/area\/label\")\n\tlabel.add_text(\"on_callback -> \" + arg + \"\\n\")\n","old_contents":"\nextends Control\n\n# Member variables\nvar trans = [\"linear\", \"sine\", \"quint\", \"quart\", \"quad\", \"expo\", \"elastic\", \"cubic\", \"circ\", \"bounce\", \"back\"]\nvar eases = [\"in\", \"out\", \"in_out\", \"out_in\"]\nvar modes = [\"move\", \"color\", \"scale\", \"rotate\", \"callback\", \"follow\", \"repeat\", \"pause\"]\n\nvar state = {\n\ttrans = Tween.TRANS_LINEAR,\n\teases = Tween.EASE_IN,\n}\n\n\nfunc _ready():\n\tfor index in range(trans.size()):\n\t\tvar name = trans[index]\n\t\tget_node(\"trans\/\" + name).connect(\"pressed\", self, \"on_trans_changed\", [name, index])\n\n\tfor index in range(eases.size()):\n\t\tvar name = eases[index]\n\t\tget_node(\"eases\/\" + name).connect(\"pressed\", self, \"on_eases_changed\", [name, index])\n\n\tfor index in range(modes.size()):\n\t\tvar name = modes[index]\n\t\tget_node(\"modes\/\" + name).connect(\"pressed\", self, \"on_modes_changed\", [name])\n\n\tget_node(\"colors\/color_from\/picker\").set_pick_color(Color(1, 0, 0, 1))\n\tget_node(\"colors\/color_from\/picker\").connect(\"color_changed\", self, \"on_color_changed\")\n\n\tget_node(\"colors\/color_to\/picker\").set_pick_color(Color(0, 1, 1, 1))\n\tget_node(\"colors\/color_to\/picker\").connect(\"color_changed\", self, \"on_color_changed\")\n\n\tget_node(\"trans\/linear\").set_pressed(true)\n\tget_node(\"eases\/in\").set_pressed(true)\n\tget_node(\"modes\/move\").set_pressed(true)\n\tget_node(\"modes\/repeat\").set_pressed(true)\n\n\treset_tween()\n\n\nfunc on_trans_changed(name, index):\n\tfor index in range(trans.size()):\n\t\tvar pressed = trans[index] == name\n\t\tvar btn = get_node(\"trans\/\" + trans[index])\n\n\t\tbtn.set_pressed(pressed)\n\t\tset_mouse_filter(Control.MOUSE_FILTER_IGNORE if pressed else Control.MOUSE_FILTER_PASS)\n\n\tstate.trans = index\n\treset_tween()\n\n\nfunc on_eases_changed(name, index):\n\tfor index in range(eases.size()):\n\t\tvar pressed = eases[index] == name\n\t\tvar btn = get_node(\"eases\/\" + eases[index])\n\n\t\tbtn.set_pressed(pressed)\n\t\tset_mouse_filter(Control.MOUSE_FILTER_IGNORE if pressed else Control.MOUSE_FILTER_PASS)\n\n\tstate.eases = index\n\treset_tween()\n\n\nfunc on_modes_changed(name):\n\tvar tween = get_node(\"tween\")\n\tif name == \"pause\":\n\t\tif get_node(\"modes\/pause\").is_pressed():\n\t\t\ttween.stop_all()\n\t\t\tget_node(\"timeline\").set_mouse_filter(Control.MOUSE_FILTER_PASS)\n\t\telse:\n\t\t\ttween.resume_all()\n\t\t\tget_node(\"timeline\").set_mouse_filter(Control.MOUSE_FILTER_IGNORE)\n\telse:\n\t\treset_tween()\n\n\nfunc on_color_changed(color):\n\treset_tween()\n\n\nfunc reset_tween():\n\tvar tween = get_node(\"tween\")\n\tvar pos = tween.tell()\n\ttween.reset_all()\n\ttween.remove_all()\n\n\tvar sprite = get_node(\"tween\/area\/sprite\")\n\tvar follow = get_node(\"tween\/area\/follow\")\n\tvar follow_2 = get_node(\"tween\/area\/follow_2\")\n\tvar size = get_node(\"tween\/area\").get_size()\n\n\tif get_node(\"modes\/move\").is_pressed():\n\t\ttween.interpolate_method(sprite, \"set_position\", Vector2(0, 0), Vector2(size.x, size.y), 2, state.trans, state.eases)\n\t\ttween.interpolate_property(sprite, \"position\", Vector2(size.x, size.y), Vector2(0, 0), 2, state.trans, state.eases, 2)\n\n\tif get_node(\"modes\/color\").is_pressed():\n\t\ttween.interpolate_method(sprite, \"set_modulate\", get_node(\"colors\/color_from\/picker\").get_pick_color(), get_node(\"colors\/color_to\/picker\").get_pick_color(), 2, state.trans, state.eases)\n\t\ttween.interpolate_property(sprite, \"modulate\", get_node(\"colors\/color_to\/picker\").get_pick_color(), get_node(\"colors\/color_from\/picker\").get_pick_color(), 2, state.trans, state.eases, 2)\n\telse:\n\t\tsprite.set_modulate(Color(1,1,1,1))\n\n\tif get_node(\"modes\/scale\").is_pressed():\n\t\ttween.interpolate_method(sprite, \"set_scale\", Vector2(0.5, 0.5), Vector2(1.5, 1.5), 2, state.trans, state.eases)\n\t\ttween.interpolate_property(sprite, \"scale\", Vector2(1.5, 1.5), Vector2(0.5, 0.5), 2, state.trans, state.eases, 2)\n\telse:\n\t\tsprite.set_scale(Vector2(1,1))\n\n\tif get_node(\"modes\/rotate\").is_pressed():\n\t\ttween.interpolate_method(sprite, \"set_rotation_in_degrees\", 0, 360, 2, state.trans, state.eases)\n\t\ttween.interpolate_property(sprite, \"rotation_degrees\", 360, 0, 2, state.trans, state.eases, 2)\n\n\tif get_node(\"modes\/callback\").is_pressed():\n\t\ttween.interpolate_callback(self, 0.5, \"on_callback\", \"0.5 second's after\")\n\t\ttween.interpolate_callback(self, 0.2, \"on_callback\", \"1.2 second's after\")\n\n\tif get_node(\"modes\/follow\").is_pressed():\n\t\tfollow.show()\n\t\tfollow_2.show()\n\n\t\ttween.follow_method(follow, \"set_position\", Vector2(0, size.y), sprite, \"get_position\", 2, state.trans, state.eases)\n\t\ttween.targeting_method(follow, \"set_position\", sprite, \"get_position\", Vector2(0, size.y), 2, state.trans, state.eases, 2)\n\n\t\ttween.targeting_property(follow_2, \"position\", sprite, \"position\", Vector2(size.x, 0), 2, state.trans, state.eases)\n\t\ttween.follow_property(follow_2, \"position\", Vector2(size.x, 0), sprite, \"position\", 2, state.trans, state.eases, 2)\n\telse:\n\t\tfollow.hide()\n\t\tfollow_2.hide()\n\n\ttween.set_repeat(get_node(\"modes\/repeat\").is_pressed())\n\ttween.start()\n\ttween.seek(pos)\n\n\tif get_node(\"modes\/pause\").is_pressed():\n\t\ttween.stop_all()\n\t\t#get_node(\"timeline\").set_ignore_mouse(false)\n\t\tget_node(\"timeline\").set_value(0)\n\telse:\n\t\ttween.resume_all()\n\t\t#get_node(\"timeline\").set_ignore_mouse(true)\n\n\nfunc _on_tween_step(object, key, elapsed, value):\n\tvar timeline = get_node(\"timeline\")\n\n\tvar tween = get_node(\"tween\")\n\tvar runtime = tween.get_runtime()\n\n\tvar ratio = 100*(elapsed\/runtime)\n\ttimeline.set_value(ratio)\n\n\nfunc _on_timeline_value_changed(value):\n\tif !get_node(\"modes\/pause\").is_pressed():\n\t\treturn\n\n\tvar tween = get_node(\"tween\")\n\tvar runtime = tween.get_runtime()\n\ttween.seek(runtime*value\/100)\n\n\nfunc on_callback(arg):\n\tvar label = get_node(\"tween\/area\/label\")\n\tlabel.add_text(\"on_callback -> \" + arg + \"\\n\")\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"497be78ab0cea6267bbc52d577065d84ed148617","subject":"Fixed button pointing to wrong node.","message":"Fixed button pointing to wrong node.\n","repos":"NiclasEriksen\/godot_rpg","old_file":"scripts\/menu_control.gd","new_file":"scripts\/menu_control.gd","new_contents":"\nextends VBoxContainer\n\n\nfunc _ready():\n\tset_process_input(true)\n\tset_focus_mode(2)\n\tvar ml = get_node(\"MapList\")\n\tvar maps = get_maps()\n\tfor m in maps:\n\t\tml.add_item(m, null, true)\n\nfunc get_maps():\n\tvar dir = Directory.new()\n\tvar mapfiles = []\n\tif dir.open(\"maps\") == OK:\n\t\tdir.list_dir_begin()\n\t\tvar file_name = dir.get_next()\n\t\twhile (file_name != \"\"):\n\t\t\tif dir.current_is_dir():\n\t\t\t\tpass\n\t\t\telse:\n\t\t\t\tif file_name.ends_with(\".tscn\"):\n\t\t\t\t\tmapfiles.append(file_name)\n\n\t\t\tfile_name = dir.get_next()\n\telse:\n\t\tprint(\"An error occurred when trying to access the path.\")\n\n\treturn mapfiles\n\nfunc _input(event):\n\tif event.is_action(\"QUIT\"):\n\t\tget_tree().quit()\n\n\nfunc _on_MapList_item_selected(index):\n\tget_node(\"\/root\/globals\").set_map(get_node(\"MapList\").get_item_text(index))\n\nfunc _on_NewGame_released():\n\tget_node(\"\/root\/globals\").set_scene(\"res:\/\/TestScene.tscn\")\n\n\nfunc _on_TestScene_released():\n\tif get_node(\"\/root\/globals\").get_map():\n\t\tget_node(\"\/root\/globals\").set_scene(\"res:\/\/TestScene.tscn\")\n\telse:\n\t\tget_parent().get_node(\"Panel\").get_node(\"PopupDialog\").popup_centered()\n\n\nfunc _on_Quit_released():\n\tget_tree().quit()\n\n\nfunc _on_MapList_item_activated( index ):\n\tif get_node(\"\/root\/globals\").get_map():\n\t\tget_node(\"\/root\/globals\").set_scene(\"res:\/\/TestScene.tscn\")\n","old_contents":"\r\nextends VBoxContainer\r\n\r\n\r\nfunc _ready():\r\n\tset_process_input(true)\r\n\tset_focus_mode(2)\r\n\tvar ml = get_node(\"MapList\")\r\n\tvar maps = get_maps()\r\n\tfor m in maps:\r\n\t\tml.add_item(m, null, true)\r\n\r\nfunc get_maps():\r\n\tvar dir = Directory.new()\r\n\tvar mapfiles = []\r\n\tif dir.open(\"maps\") == OK:\r\n\t\tdir.list_dir_begin()\r\n\t\tvar file_name = dir.get_next()\r\n\t\twhile (file_name != \"\"):\r\n\t\t\tif dir.current_is_dir():\r\n\t\t\t\tpass\r\n\t\t\telse:\r\n\t\t\t\tif file_name.ends_with(\".tscn\"):\r\n\t\t\t\t\tmapfiles.append(file_name)\r\n\r\n\t\t\tfile_name = dir.get_next()\r\n\telse:\r\n\t\tprint(\"An error occurred when trying to access the path.\")\r\n\r\n\treturn mapfiles\r\n\r\nfunc _input(event):\r\n\tif event.is_action(\"QUIT\"):\r\n\t\tget_tree().quit()\r\n\r\n\r\nfunc _on_MapList_item_selected(index):\r\n\tget_node(\"\/root\/globals\").set_map(get_node(\"MapList\").get_item_text(index))\r\n\r\nfunc _on_NewGame_released():\r\n\tget_node(\"\/root\/globals\").set_scene(\"res:\/\/TestScene.tscn\")\r\n\r\n\r\nfunc _on_TestScene_released():\r\n\tif get_node(\"\/root\/globals\").get_map():\r\n\t\tget_node(\"\/root\/globals\").set_scene(\"res:\/\/TestScene.tscn\")\r\n\telse:\r\n\t\tget_parent().get_node(\"PopupDialog\").popup_centered()\r\n\r\n\r\nfunc _on_Quit_released():\r\n\tget_tree().quit()\r\n\r\n\r\nfunc _on_MapList_item_activated( index ):\r\n\tif get_node(\"\/root\/globals\").get_map():\r\n\t\tget_node(\"\/root\/globals\").set_scene(\"res:\/\/TestScene.tscn\")\r\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"b2bf7e1aad7b2a4f19bfb792a8f8473bdaff1088","subject":"Game now clears all observers on load to avoid crash when notifying freed observers.","message":"Game now clears all observers on load to avoid crash when notifying freed observers.\n","repos":"NiclasEriksen\/godot_rpg","old_file":"scripts\/thescript.gd","new_file":"scripts\/thescript.gd","new_contents":"extends Control\nvar globals = null\nvar map = null\n\nfunc _ready():\n\tset_process(true)\n\tglobals = get_node(\"\/root\/globals\")\n\tvar nc = get_node(\"\/root\/notifications\")\n\tnc.notifications.clear()\n\tif globals:\n\t\tif globals.get_map():\n\t\t\tmap = load(globals.get_map())\n\t\t\tget_node(\"Nav\").get_node(\"Map\").free()\n\t\t\tget_node(\"Nav\").add_child(map.instance())\n\telse:\n\t\tprint(\"Globals not loaded, PANICK!\")\n\nfunc _process(delta):\n\tpass\n\nfunc load_map():\n\tif globals.get_map():\n\t\tmap = load(globals.get_map())\n\t\tfor n in get_node(\"Nav\").get_children():\n\t\t\tn.free()\n\t\tget_node(\"Nav\").add_child(map.instance())\n\t\tfor c in get_node(\"Nav\").get_children():\n\t\t\tif get_node(\"Nav\").get_child_count() == 1:\n\t\t\t\tc.set_name(\"Map\")\n\t\t\telse:\n\t\t\t\tprint(\"More than one map loaded??!\")\n\telse:\n\t\tprint(\"No map specified in globals...\")\n\nfunc change_map(mapname):\n\tif globals.set_map(mapname):\n\t\tSceneTransition.connect(\"start_load\", self, \"load_map\", [])\n\t\tSceneTransition.fade_to_map()\n\telse:\n\t\tprint(\"Failed to set map: \", mapname)\n\nfunc _on_HUD_pause(pressed):\n\tget_tree().set_pause(pressed)\n\n\nfunc _on_MapChangeTrigger_change_map(body, name):\n\tif body.get_name() == \"Player_object\":\n\t\tchange_map(name)\n","old_contents":"extends Control\nvar globals = null\nvar map = null\n\nfunc _ready():\n\tset_process(true)\n\tglobals = get_node(\"\/root\/globals\")\n\tif globals:\n\t\tif globals.get_map():\n\t\t\tmap = load(globals.get_map())\n\t\t\tget_node(\"Nav\").get_node(\"Map\").free()\n\t\t\tget_node(\"Nav\").add_child(map.instance())\n\telse:\n\t\tprint(\"Globals not loaded, PANICK!\")\n\nfunc _process(delta):\n\tpass\n\nfunc load_map():\n\tif globals.get_map():\n\t\tmap = load(globals.get_map())\n\t\tfor n in get_node(\"Nav\").get_children():\n\t\t\tn.free()\n\t\tget_node(\"Nav\").add_child(map.instance())\n\t\tfor c in get_node(\"Nav\").get_children():\n\t\t\tif get_node(\"Nav\").get_child_count() == 1:\n\t\t\t\tc.set_name(\"Map\")\n\t\t\telse:\n\t\t\t\tprint(\"More than one map loaded??!\")\n\telse:\n\t\tprint(\"No map specified in globals...\")\n\nfunc change_map(mapname):\n\tif globals.set_map(mapname):\n\t\tSceneTransition.connect(\"start_load\", self, \"load_map\", [])\n\t\tSceneTransition.fade_to_map()\n\telse:\n\t\tprint(\"Failed to set map: \", mapname)\n\nfunc _on_HUD_pause(pressed):\n\tget_tree().set_pause(pressed)\n\n\nfunc _on_MapChangeTrigger_change_map(body, name):\n\tif body.get_name() == \"Player_object\":\n\t\tchange_map(name)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"df31ab5a9b5e0e96ae8c664eff5d75762650e249","subject":"Added weeds back in as a random force on grass. They spread too.","message":"Added weeds back in as a random force on grass. They spread too.\n","repos":"mralex\/ld38","old_file":"scripts\/Sim.gd","new_file":"scripts\/Sim.gd","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"mit","lang":"GDScript"} {"commit":"5df74b4b156434709cd93b8aa5655a1559cffd52","subject":"yan name check crashed when switching maps","message":"yan name check crashed when switching maps\n","repos":"AlexHolly\/captain-holetooth,shelltitan\/captain-holetooth,shelltitan\/captain-holetooth,AlexHolly\/captain-holetooth","old_file":"src\/screens\/hud\/hud.gd","new_file":"src\/screens\/hud\/hud.gd","new_contents":"extends CanvasLayer\n\nexport (NodePath) var collected_text #= get_node(\"hudframe\/items_label\/score_display\")\nexport (NodePath) var score_text #final_score_text = get_node(\"hudframe\/finalscore_label\/final_scoredisplay\")\nexport (NodePath) var highscore_text #= get_node(\"hudframe\/highscore_label\/highscore_display\")\nexport (NodePath) var sound_off_button #= get_node(\"hudframe\/sound_off\")\n\nonready var animations = get_node(\"animations\")\n\nfunc _on_met_yan():\n#\tget_node(\"sfx\").play(\"card_unlock\")\n\tanimations.play(\"yan_unlock_anim\")\n\nfunc _ready():\n\tvar yan = get_parent().find_node(\"Yan\")\n\tif yan:\n\t\tprint(\"Yan is present\")\n\t\tyan.connect(\"met_yan\", self,\"_on_met_yan\")\n\t\tanimations.play(\"yan_unlock_anim\")\n\t\tprint(\"working\")\n\t\n\tupdate_scores()\n\tgame.connect(\"scores_changed\", self, \"update_scores\")\n\tupdate_sound_hud()\n\n\n# Update scores\nfunc update_scores():\n\tget_node(collected_text).set_text(str(game.items_collected))\n\tget_node(score_text).set_text(str(game.score))\n\tget_node(highscore_text).set_text(str(game.high_score))\n\nfunc _on_go_to_menu_pressed():\n\ttransition.fade_to(\"res:\/\/src\/screens\/menu\/menu.tscn\")\n\n\n# Toggles music on\/off while keeping the stored volume that may have been set elsewhere\nfunc _on_sound_off_pressed():\n\t# Turns off music completely, or returns it back to normal\n\tif(global.music.enabled):\n\t\tAudioServer.set_stream_global_volume_scale(0)\n\telse:\n\t\tAudioServer.set_stream_global_volume_scale(global.music.volume)\n\t\n\t# Toggle bool\n\tglobal.music.enabled = !global.music.enabled\n\t\n\t# Update sound HUD\n\tupdate_sound_hud()\n\n\n# Updates sound HUD\nfunc update_sound_hud():\n\tif(global.music.enabled):\n\t\tget_node(sound_off_button).set_pressed(true) # res:\/\/src\/screens\/hud\/sound_on.png\n\telse:\n\t\tget_node(sound_off_button).set_pressed(false) # res:\/\/src\/screens\/hud\/sound_off.png","old_contents":"extends CanvasLayer\n\nexport (NodePath) var collected_text #= get_node(\"hudframe\/items_label\/score_display\")\nexport (NodePath) var score_text #final_score_text = get_node(\"hudframe\/finalscore_label\/final_scoredisplay\")\nexport (NodePath) var highscore_text #= get_node(\"hudframe\/highscore_label\/highscore_display\")\nexport (NodePath) var sound_off_button #= get_node(\"hudframe\/sound_off\")\n\nonready var animations = get_node(\"animations\")\n\nfunc _on_met_yan():\n#\tget_node(\"sfx\").play(\"card_unlock\")\n\tanimations.play(\"yan_unlock_anim\")\n\nfunc _ready():\n\tvar yan = get_parent().find_node(\"Yan\")\n\tprint (yan.get_name())\n\tif yan:\n\t\tprint(\"Yan is present\")\n\t\tyan.connect(\"met_yan\", self,\"_on_met_yan\")\n\t\tanimations.play(\"yan_unlock_anim\")\n\t\tprint(\"working\")\n\t\n\tupdate_scores()\n\tgame.connect(\"scores_changed\", self, \"update_scores\")\n\tupdate_sound_hud()\n\n\n# Update scores\nfunc update_scores():\n\tget_node(collected_text).set_text(str(game.items_collected))\n\tget_node(score_text).set_text(str(game.score))\n\tget_node(highscore_text).set_text(str(game.high_score))\n\nfunc _on_go_to_menu_pressed():\n\ttransition.fade_to(\"res:\/\/src\/screens\/menu\/menu.tscn\")\n\n\n# Toggles music on\/off while keeping the stored volume that may have been set elsewhere\nfunc _on_sound_off_pressed():\n\t# Turns off music completely, or returns it back to normal\n\tif(global.music.enabled):\n\t\tAudioServer.set_stream_global_volume_scale(0)\n\telse:\n\t\tAudioServer.set_stream_global_volume_scale(global.music.volume)\n\t\n\t# Toggle bool\n\tglobal.music.enabled = !global.music.enabled\n\t\n\t# Update sound HUD\n\tupdate_sound_hud()\n\n\n# Updates sound HUD\nfunc update_sound_hud():\n\tif(global.music.enabled):\n\t\tget_node(sound_off_button).set_pressed(true) # res:\/\/src\/screens\/hud\/sound_on.png\n\telse:\n\t\tget_node(sound_off_button).set_pressed(false) # res:\/\/src\/screens\/hud\/sound_off.png","returncode":0,"stderr":"","license":"apache-2.0","lang":"GDScript"} {"commit":"82d9684caf3e80d65b9b97055cf7e7fed29df9d9","subject":"Made changes to the gui in 3D demo based on suggestions by aaronfranke","message":"Made changes to the gui in 3D demo based on suggestions by aaronfranke\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"viewport\/gui_in_3d\/gui_3d.gd","new_file":"viewport\/gui_in_3d\/gui_3d.gd","new_contents":"extends Spatial\n# Member variables\n# The size of the quad mesh itself.\nvar quad_mesh_size\n# Indentify if the mouse is inside the Area\nvar is_mouse_inside = false\n# Identify if the mouse was pressed inside the Area\nvar is_mouse_held = false\n# The last non-empty mouse position. Used when dragging outside of the box.\nvar last_mouse_pos3D = null\n# The last processed input touch\/mouse event. To calculate relative movement.\nvar last_mouse_pos2D = null\n# Most used nodes\nonready var node_viewport = $Viewport\nonready var node_quad = $Quad\nonready var node_area = $Quad\/Area\n\n\nfunc _ready():\n\tnode_area.connect(\"mouse_entered\", self, \"_mouse_entered_area\")\n\t\n\t# If the material is NOT set to use billboard settings, then avoid running billboard specific code\n\tif node_quad.get_surface_material(0).params_billboard_mode == 0:\n\t\tset_process(false)\n\n\nfunc _process(_delta):\n\t#NOTE: Remove this function if you don't plan on using billboard settings.\n\trotate_area_to_billboard()\n\n\nfunc _mouse_entered_area():\n\tis_mouse_inside = true\n\n\nfunc _input(event):\n\t# Check if the event is a non-mouse\/non-touch event\n\tvar is_mouse_event = false\n\tfor mouse_event in [InputEventMouseButton, InputEventMouseMotion, InputEventScreenDrag, InputEventScreenTouch]:\n\t\tif event is mouse_event:\n\t\t\tis_mouse_event = true\n\t\t\tbreak\n\t\n\t# If the event is a mouse\/touch event and\/or the mouse is either held or inside the area, then\n\t# we need to do some additional processing in the handle_mouse function before passing the event to the viewport.\n\t# If the event is not a mouse\/touch event, then we can just pass the event directly to the viewport.\n\tif is_mouse_event and (is_mouse_inside or is_mouse_held):\n\t\thandle_mouse(event)\n\telif not is_mouse_event:\n\t\tnode_viewport.input(event)\n\n\n# Handle mouse events inside Area. (Area.input_event had many issues with dragging)\nfunc handle_mouse(event):\n\t#Get mesh size to detect edges and make conversions. This code only support PlaneMesh and QuadMesh.\n\tquad_mesh_size = node_quad.mesh.size\n\t\n\t#Detect mouse being held to mantain event while outside of bounds. Avoid orphan clicks\n\tif event is InputEventMouseButton or event is InputEventScreenTouch:\n\t\tis_mouse_held = event.pressed\n\t\n\t#Find mouse position in Area\n\tvar mouse_pos3D = find_mouse(event.global_position)\n\t\n\t# Check if the mouse is outside of bounds, use last position to avoid errors\n\t#NOTE: mouse_exited signal was unrealiable in this situation\n\tis_mouse_inside = mouse_pos3D != null\n\tif is_mouse_inside:\n\t\t# Convert click_pos from world coordinate space to a coordinate space relative to the Area node.\n\t\t# NOTE: affine_inverse accounts for the Area node's scale, rotation, and translation in the scene!\n\t\tmouse_pos3D = node_area.global_transform.affine_inverse() * mouse_pos3D\n\t\tlast_mouse_pos3D = mouse_pos3D\n\telse:\n\t\tmouse_pos3D = last_mouse_pos3D\n\t\n\t#TODO: adapt to bilboard mode or avoid completelly\n\t\n\t# convert the relative event position from 3D to 2D\n\tvar mouse_pos2D = Vector2(mouse_pos3D.x, -mouse_pos3D.y)\n\t\n\t# Right now the event position's range is the following: (-quad_size\/2) -> (quad_size\/2)\n\t# We need to convert it into the following range: 0 -> quad_size\n\tmouse_pos2D.x += quad_mesh_size.x \/ 2\n\tmouse_pos2D.y += quad_mesh_size.y \/ 2\n\t# Then we need to convert it into the following range: 0 -> 1\n\tmouse_pos2D.x = mouse_pos2D.x \/ quad_mesh_size.x\n\tmouse_pos2D.y = mouse_pos2D.y \/ quad_mesh_size.y\n\t\n\t# Finally, we convert the position to the following range: 0 -> viewport.size\n\tmouse_pos2D.x = mouse_pos2D.x * node_viewport.size.x\n\tmouse_pos2D.y = mouse_pos2D.y * node_viewport.size.y\n\t# We need to do these conversions so the event's position is in the viewport's coordinate system.\n\t\n\t# Set the event's position and global position.\n\tevent.position = mouse_pos2D\n\tevent.global_position = mouse_pos2D\n\t\n\t# If the event is a mouse motion event...\n\tif event is InputEventMouseMotion:\n\t\t# If there is not a stored previous position, then we'll assume there is no relative motion.\n\t\tif last_mouse_pos2D == null:\n\t\t\tevent.relative = Vector2(0, 0)\n\t\t# If there is a stored previous position, then we'll calculate the relative position by subtracting\n\t\t# the previous position from the new position. This will give us the distance the event traveled from prev_pos\n\t\telse:\n\t\t\tevent.relative = mouse_pos2D - last_mouse_pos2D\n\t# Update last_mouse_pos2D with the position we just calculated.\n\tlast_mouse_pos2D = mouse_pos2D\n\t\n\t# Finally, send the processed input event to the viewport.\n\tnode_viewport.input(event)\n\n\nfunc find_mouse(global_position):\n\tvar camera = get_viewport().get_camera()\n\t\n\t#from camera center to the mouse position in the Area\n\tvar from = camera.project_ray_origin(global_position)\n\tvar dist = find_further_distance_to(camera.transform.origin)\n\tvar to = from + camera.project_ray_normal(global_position) * dist\n\t\n\t\n\t#Manually raycasts the are to find the mouse position\n\tvar result = get_world().direct_space_state.intersect_ray(from, to, [], node_area.collision_layer,false,true) #for 3.1 changes\n\t\n\tif result.size() > 0:\n\t\treturn result.position\n\telse:\n\t\treturn null\n\n\nfunc find_further_distance_to(origin):\n\t#Find edges of collision and change to global positions\n\tvar edges = []\n\tedges.append(node_area.to_global(Vector3(quad_mesh_size.x \/ 2, quad_mesh_size.y \/ 2, 0)))\n\tedges.append(node_area.to_global(Vector3(quad_mesh_size.x \/ 2, -quad_mesh_size.y \/ 2, 0)))\n\tedges.append(node_area.to_global(Vector3(-quad_mesh_size.x \/ 2, quad_mesh_size.y \/ 2, 0)))\n\tedges.append(node_area.to_global(Vector3(-quad_mesh_size.x \/ 2, -quad_mesh_size.y \/ 2, 0)))\n\t\n\t#Get the furthest distance between the camera and collision to avoid raycasting too far or too short\n\tvar far_dist = 0\n\tvar temp_dist\n\tfor edge in edges:\n\t\ttemp_dist = origin.distance_to(edge)\n\t\tif temp_dist > far_dist:\n\t\t\tfar_dist = temp_dist\n\t\n\treturn far_dist\n\n\nfunc rotate_area_to_billboard():\n\tvar billboard_mode = node_quad.get_surface_material(0).params_billboard_mode\n\t\n\t#try to match the area with the material's billboard setting, if enabled\n\tif billboard_mode > 0:\n\t\t# Get the camera\n\t\tvar camera = get_viewport().get_camera()\n\t\t#Look in the same direction as the camera\n\t\tvar look = camera.to_global(Vector3(0, 0, -100)) - camera.global_transform.origin\n\t\tlook = node_area.translation + look\n\t\t\n\t\t# Y-Billboard: Lock Y rotation, but gives bad results if the camera is tilted.\n\t\tif billboard_mode == 2: \n\t\t\tlook = Vector3(look.x, 0, look.z)\n\t\t\n\t\tnode_area.look_at(look, Vector3.UP)\n\t\t\n\t\t#Ratate in the Z axis to compensate camera tilt\n\t\tnode_area.rotate_object_local(Vector3.BACK, camera.rotation.z)\n\n","old_contents":"extends Spatial\n# Member variables\n# The size of the quad mesh itself.\nvar quad_mesh_size\n# Indentify if the mouse is inside the Area\nvar mouse_inside = false\n# Identify if the mouse was pressed inside the Area\nvar mouse_held = false\n# The last non-empty mouse position. Used when dragging outside of the box.\nvar last_mouse_pos3D = null\n# The last processed input touch\/mouse event. To calculate relative movement.\nvar last_mouse_pos2D = null\n# Most used nodes\nonready var node_viewport = $Viewport\nonready var node_quad = $Quad\nonready var node_area = $Quad\/Area\n\n\nfunc _ready():\n\tnode_area.connect(\"mouse_entered\", self, \"_mouse_entered_area\")\n\t\n\t# If the material is NOT set to use billboard settings, then avoid running billboard specific code\n\tif node_quad.get_surface_material(0).params_billboard_mode == 0:\n\t\tset_process(false)\n\n\nfunc _process(delta):\n\t#NOTE: Remove this function if you don't plan on using billboard settings.\n\trotate_area_to_billboard()\n\n\nfunc _mouse_entered_area():\n\tmouse_inside = true\n\n\nfunc _input(event):\n\t# Check if the event is a non-mouse\/non-touch event\n\tvar is_mouse_event = false\n\tfor mouse_event in [InputEventMouseButton, InputEventMouseMotion, InputEventScreenDrag, InputEventScreenTouch]:\n\t\tif event is mouse_event:\n\t\t\tis_mouse_event = true\n\t\t\tbreak\n\t\n\t# If the event is a mouse\/touch event and\/or the mouse is either held or inside the area, then\n\t# we need to do some additional processing in the handle_mouse function before passing the event to the viewport.\n\t# If the event is not a mouse\/touch event, then we can just pass the event directly to the viewport.\n\tif is_mouse_event and (mouse_inside or mouse_held):\n\t\thandle_mouse(event)\n\telif not is_mouse_event:\n\t\tnode_viewport.input(event)\n\n\n# Handle mouse events inside Area. (Area.input_event had many issues with dragging)\nfunc handle_mouse(event):\n\t#Get mesh size to detect edges and make conversions. This code only support PlaneMesh and QuadMesh.\n\tquad_mesh_size = node_quad.mesh.size\n\t\n\t#Detect mouse being held to mantain event while outside of bounds. Avoid orphan clicks\n\tif event is InputEventMouseButton or event is InputEventScreenTouch:\n\t\tmouse_held = event.pressed\n\t\n\t#Find mouse position in Area\n\tvar mouse_pos3D = find_mouse(event.global_position)\n\t\n\t# Check if the mouse is outside of bounds, use last position to avoid errors\n\t#NOTE: mouse_exited signal was unrealiable in this situation\n\tmouse_inside = mouse_pos3D != null\n\tif mouse_inside:\n\t\t# Convert click_pos from world coordinate space to a coordinate space relative to the Area node.\n\t\t# NOTE: affine_inverse accounts for the Area node's scale, rotation, and translation in the scene!\n\t\tmouse_pos3D = node_area.global_transform.affine_inverse() * mouse_pos3D\n\t\tlast_mouse_pos3D = mouse_pos3D\n\telse:\n\t\tmouse_pos3D = last_mouse_pos3D\n\t\n\t#TODO: adapt to bilboard mode or avoid completelly\n\t\n\t# convert the relative event position from 3D to 2D\n\tvar mouse_pos2D = Vector2(mouse_pos3D.x, -mouse_pos3D.y)\n\t\n\t# Right now the event position's range is the following: (-quad_size\/2) -> (quad_size\/2)\n\t# We need to convert it into the following range: 0 -> quad_size\n\tmouse_pos2D.x += quad_mesh_size.x \/ 2\n\tmouse_pos2D.y += quad_mesh_size.y \/ 2\n\t# Then we need to convert it into the following range: 0 -> 1\n\tmouse_pos2D.x = mouse_pos2D.x \/ quad_mesh_size.x\n\tmouse_pos2D.y = mouse_pos2D.y \/ quad_mesh_size.y\n\t\n\t# Finally, we convert the position to the following range: 0 -> viewport.size\n\tmouse_pos2D.x = mouse_pos2D.x * node_viewport.size.x\n\tmouse_pos2D.y = mouse_pos2D.y * node_viewport.size.y\n\t# We need to do these conversions so the event's position is in the viewport's coordinate system.\n\t\n\t# Set the event's position and global position.\n\tevent.position = mouse_pos2D\n\tevent.global_position = mouse_pos2D\n\t\n\t# If the event is a mouse motion event...\n\tif event is InputEventMouseMotion:\n\t\t# If there is not a stored previous position, then we'll assume there is no relative motion.\n\t\tif last_mouse_pos2D == null:\n\t\t\tevent.relative = Vector2(0, 0)\n\t\t# If there is a stored previous position, then we'll calculate the relative position by subtracting\n\t\t# the previous position from the new position. This will give us the distance the event traveled from prev_pos\n\t\telse:\n\t\t\tevent.relative = mouse_pos2D - last_mouse_pos2D\n\t# Update last_mouse_pos2D with the position we just calculated.\n\tlast_mouse_pos2D = mouse_pos2D\n\t\n\t# Finally, send the processed input event to the viewport.\n\tnode_viewport.input(event)\n\n\nfunc find_mouse(global_position):\n\tvar camera = get_viewport().get_camera()\n\t\n\t#from camera center to the mouse position in the Area\n\tvar from = camera.project_ray_origin(global_position)\n\tvar dist = find_further_distance_to(camera.transform.origin)\n\tvar to = from + camera.project_ray_normal(global_position) * dist\n\t\n\t\n\t#Manually raycasts the are to find the mouse position\n\tvar result = get_world().direct_space_state.intersect_ray(from, to, [], node_area.collision_layer,false,true) #for 3.1 changes\n\t\n\tif result.size() > 0:\n\t\treturn result.position\n\telse:\n\t\treturn null\n\n\nfunc find_further_distance_to(origin):\n\t#Find edges of collision and change to global positions\n\tvar edges = []\n\tedges.append(node_area.to_global(Vector3(quad_mesh_size.x \/ 2, quad_mesh_size.y \/ 2, 0)))\n\tedges.append(node_area.to_global(Vector3(quad_mesh_size.x \/ 2, -quad_mesh_size.y \/ 2, 0)))\n\tedges.append(node_area.to_global(Vector3(-quad_mesh_size.x \/ 2, quad_mesh_size.y \/ 2, 0)))\n\tedges.append(node_area.to_global(Vector3(-quad_mesh_size.x \/ 2, -quad_mesh_size.y \/ 2, 0)))\n\t\n\t#Get the furthest distance between the camera and collision to avoid raycasting too far or too short\n\tvar far_dist = 0\n\tvar temp_dist\n\tfor edge in edges:\n\t\ttemp_dist = origin.distance_to(edge)\n\t\tif temp_dist > far_dist:\n\t\t\tfar_dist = temp_dist\n\t\n\treturn far_dist\n\n\nfunc rotate_area_to_billboard():\n\tvar billboard_mode = node_quad.get_surface_material(0).params_billboard_mode\n\t\n\t#try to match the area with the material's billboard setting, if enabled\n\tif billboard_mode > 0:\n\t\t#Look in the same direction as the camera\n\t\tvar look = get_viewport().get_camera().to_global(Vector3(0,0,-100)) - get_viewport().get_camera().global_transform.origin\n\t\tlook = node_area.translation + look\n\t\t\n\t\t# Y-Billboard: Lock Y rotation, but gives bad results if the camera is tilted.\n\t\tif billboard_mode == 2: \n\t\t\tlook = Vector3(look.x,0,look.z)\n\t\t\n\t\tnode_area.look_at(look, Vector3(0,1,0))\n\t\t\n\t\t#Ratate in the Z axis to compensate camera tilt\n\t\tnode_area.rotate_object_local(Vector3(0,0,1), get_viewport().get_camera().rotation.z)","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"459c1c31244382f47bbe7579897807d1c4741d64","subject":"added basic editor GUI","message":"added basic editor GUI\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Editor.gd","new_file":"src\/scripts\/Editor.gd","new_contents":"extends Spatial\n\nvar cursorPos = Vector3(1,0,0)\nvar cursor\nvar puzzleMan\nvar puzzle\nvar gridMan\nvar selectedBlock = null\n\nvar gui = {\n\tadd=Button.new(),\n\trm=Button.new(),\n\tsave_pzl=Button.new(),\n\tload_pzl=Button.new()\n}\nvar gui_text = {\n\tadd=\"Add Block\",\n\trm=\"Remove Block\",\n\tsave_pzl=\"Save\",\n\tload_pzl=\"Load\"\n}\n\n\nvar puzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar cursorScn = preload(\"res:\/\/cursor.scn\")\n\nfunc cursor_move(dir):\n\tvar tween = Tween.new()\n\tvar N = 2\n\tadd_child(tween)\n\ttween.interpolate_method( cursor, \"set_global_transform\", \\\n\t\tcursor.get_global_transform(), cursor.get_global_transform().translated(dir * N), \\\n\t\t0.25, Tween.TRANS_EXPO, Tween.EASE_OUT )\n\ttween.start()\n\tcursorPos += dir\n\tselectedBlock = gridMan.get_block(cursorPos)\n\nfunc _input(ev):\n\tif ev.type == InputEvent.KEY:\n\t\tif ev.is_pressed():\n\t\t\tif Input.is_action_pressed(\"ui_up\"):\n\t\t\t\tcursor_move(Vector3(0,1,0))\n\t\t\tif Input.is_action_pressed(\"ui_down\"):\n\t\t\t\tcursor_move(Vector3(0,-1,0))\n\t\t\tif Input.is_action_pressed(\"ui_left\"):\n\t\t\t\tcursor_move(Vector3(1,0,0))\n\t\t\tif Input.is_action_pressed(\"ui_right\"):\n\t\t\t\tcursor_move(Vector3(-1,0,0))\n\t\t\tif Input.is_action_pressed(\"ui_page_up\"):\n\t\t\t\tcursor_move(Vector3(0,0,1))\n\t\t\tif Input.is_action_pressed(\"ui_page_down\"):\n\t\t\t\tcursor_move(Vector3(0,0,-1))\n\t\t\tif Input.is_action_pressed(\"ui_accept\"):\n\t\t\t\tcursor_action()\n\nfunc cursor_action():\n\tif not selectedBlock == null:\n\t\tprint(\"CHILDREN:\",gridMan.get_child_count())\n\t\tgridMan.remove_block(selectedBlock)\n\t\tprint(\"CHILDREN:\",gridMan.get_child_count())\n\n\t\tselectedBlock = null\n\nfunc _ready():\n\tvar pMan = puzzleScn.instance()\n\tgridMan = pMan.get_node(\"GridView\/GridMan\")\n\tcursor = cursorScn.instance()\n\tpMan.mainPuzzle = false\n\tpMan.time.on = false\n\tpuzzleMan = pMan.puzzleMan\n\tpMan.set_as_toplevel(true)\n\n\tvar pos = Vector2(10, 10)\n\tfor k in gui.keys():\n\t\tpos.y += 45\n\t\tgui[k].set_theme(preload(\"res:\/\/themes\/MainTheme.thm\"))\n\t\tgui[k].set_text(gui_text[k])\n\t\tgui[k].set_pos(pos)\n\t\tadd_child(gui[k]);\n\n\tgridMan.add_child(cursor)\n\tadd_child(pMan)\n\tcursor.set_owner(pMan)\n\n\n\n\tset_process_input(true)\n\n\n","old_contents":"extends Spatial\n\nvar cursorPos = Vector3(1,0,0)\nvar cursor\nvar puzzleMan\nvar puzzle\nvar gridMan\nvar selectedBlock = null\n\nvar puzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar cursorScn = preload(\"res:\/\/cursor.scn\")\n\nfunc cursor_move(dir):\n\tvar tween = Tween.new()\n\tvar N = 2\n\tadd_child(tween)\n\ttween.interpolate_method( cursor, \"set_global_transform\", \\\n\t\tcursor.get_global_transform(), cursor.get_global_transform().translated(dir * N), \\\n\t\t0.25, Tween.TRANS_EXPO, Tween.EASE_OUT )\n\ttween.start()\n\tcursorPos += dir\n\tselectedBlock = gridMan.get_block(cursorPos)\n\t\nfunc _input(ev):\n\tif ev.type == InputEvent.KEY:\n\t\tif ev.is_pressed():\n\t\t\tif Input.is_action_pressed(\"ui_up\"):\n\t\t\t\tcursor_move(Vector3(0,1,0))\n\t\t\tif Input.is_action_pressed(\"ui_down\"):\n\t\t\t\tcursor_move(Vector3(0,-1,0))\n\t\t\tif Input.is_action_pressed(\"ui_left\"):\n\t\t\t\tcursor_move(Vector3(1,0,0))\n\t\t\tif Input.is_action_pressed(\"ui_right\"):\n\t\t\t\tcursor_move(Vector3(-1,0,0))\n\t\t\tif Input.is_action_pressed(\"ui_page_up\"):\n\t\t\t\tcursor_move(Vector3(0,0,1))\n\t\t\tif Input.is_action_pressed(\"ui_page_down\"):\n\t\t\t\tcursor_move(Vector3(0,0,-1))\n\t\t\tif Input.is_action_pressed(\"ui_accept\"):\n\t\t\t\tcursor_action()\n\nfunc cursor_action():\n\tif not selectedBlock == null:\n\t\tprint(\"CHILDREN:\",gridMan.get_child_count())\n\t\tgridMan.remove_block(selectedBlock)\n\t\tprint(\"CHILDREN:\",gridMan.get_child_count())\n\t\t\n\t\tselectedBlock = null\n\nfunc _ready():\n\tvar pMan = puzzleScn.instance()\n\tgridMan = pMan.get_node(\"GridView\/GridMan\")\n\tcursor = cursorScn.instance()\n\tpMan.mainPuzzle = false\n\tpMan.time.on = false\n\tpuzzleMan = pMan.puzzleMan\n\tpMan.set_as_toplevel(true)\n\t\n\tgridMan.add_child(cursor)\n\tadd_child(pMan)\n\tcursor.set_owner(pMan)\n\n\tset_process_input(true)\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"69a6ababb4001ae7ca20bcb9e86a2bb44bab8363","subject":"removed beta buttons","message":"removed beta buttons\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Editor.gd","new_file":"src\/scripts\/Editor.gd","new_contents":"extends Spatial\n\nconst NO_ERRORS = \"STATUS NOMINAL\"\n\nvar puzzle\nvar puzzleMan\nvar DataMan = load(\"res:\/\/scripts\/DataManager.gd\").new()\n\nvar gridMan\nvar prevBlocks = [] # keeps track of prevous color for pairs by layer\nvar blockColors = preload(\"res:\/\/scripts\/PuzzleManager.gd\").blockColors\nvar id\n\nvar glyphIx = 0\n\nvar fd\nvar gui = [\n\t[\"save_pzl\", Button.new()],\n\t[\"load_pzl\", Button.new()],\n\t# [\"remove_layer\", Button.new()],\n\t# [\"random_layer\", Button.new()],\n\t[\"class_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=[\"WILD\", \"PAIR\"],\n\t\t# const BLOCK_LASER\t= 0\n\t\t# const BLOCK_WILD\t= 1\n\t\t# const BLOCK_PAIR\t= 2\n\t\t# const BLOCK_GOAL\t= 3\n\t\t# const BLOCK_BLOCK = 4\n\t\tvalue=\"PAIR\"\n\t}],\n\t[\"color_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=blockColors,\n\t\tvalue=\"Blue\"\n\t}],\n\t[\"action_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=[\"Add\", \"Remove\", \"Replace\"],\n\t\tvalue=\"Add\"\n\t}],\n\t[\"status\", Label.new()],\n\t[\"test_pzl\", Button.new()]\n]\nvar action_ix = gui.size() - 2 - 1\nvar color_ix = gui.size() - 2 - 2\nvar class_ix = gui.size() - 2 - 3\nvar status_ix = gui.size() - 2\n\n# gross style, cannot , but clean enough\nfunc shouldAddNeighbor():\n\treturn gui[action_ix][1].value == \"Add\"\n\nfunc shouldReplaceSelf():\n\treturn gui[action_ix][1].value == \"Replace\"\n\nfunc shouldRemoveSelf():\n\treturn gui[action_ix][1].value == \"Remove\"\n\n# called in AbstractBlock to add a new block\nfunc addBlock(pos):\n\tvar curColor = gui[color_ix][1].value\n\tvar selected = gui[class_ix][1].value\n\tvar b = puzzleMan.PickledBlock.new() \\\n\t\t.setName(id) \\\n\t\t.setBlockPos(pos) \\\n\t\t.setBlockClass(gui[class_ix][1].optionButt.get_selected() + 1)\n\t\t# VERY FRAGILE INDEX STUFF\n\tvar layer = puzzleMan.calcBlockLayerVec(pos)\n\tif layer == 0 and not selected == \"GOAL\":\n\t\treturn\n\n\tif selected == \"LZR\" or selected == \"GOAL\":\n\t\tprint(\"CANNOT MK \", str(selected))\n\t\treturn\n\n\tif selected == \"WILD\":\n\t\tb.setTextureName(curColor)\n\t# must be a paired block\n\n\telse:\n\t\tid += 1\n\n\t\t# expand prevblocks index\n\t\twhile prevBlocks.size() <= layer:\n\t\t\tvar d = {}\n\t\t\tfor k in blockColors:\n\t\t\t\td[k] = null\n\t\t\tprevBlocks.append(d)\n\n\t\tvar pb = prevBlocks[layer][curColor]\n\n\t\tif pb != null:\n\t\t\tvar prevName = pb.toNode().name\n\t\t\tvar pbNode = gridMan.get_node(prevName)\n\n\t\t\tb.setPairName(pb.name)\n\t\t\tpb.setPairName(b.name)\n\n\t\t\tb.setTextureName(pb.textureName)\n\n\t\t\tgridMan.remove_block(pb)\n\t\t\tgridMan.addPickledBlock(pb)\n\t\t\tprevBlocks[layer][curColor] = null\n\t\telse:\n\t\t\tprevBlocks[layer][curColor] = b\n\t\t\tglyphIx += 1\n\t\t\tglyphIx %= 3\n\t\t\tb.setTextureName(curColor + str(glyphIx + 1))\n\n\t\tgui[status_ix][1].set_text(getPrevBlockErrors())\n\n\tvar block = gridMan.addPickledBlock(b)\n\tvar v = 0.01\n\tblock.set_scale(Vector3(v,v,v))\n\tblock.scaleTweenNode(1, 0.25, Tween.TRANS_QUART).start()\n\treturn b\n\nfunc getPrevBlockErrors():\n\t# hahaha, so bad\n\tvar missing = \"STATUS: \"\n\t# check every layer\n\tfor l in range(prevBlocks.size()):\n\t\t# check every color\n\t\tfor k in prevBlocks[l].keys():\n\t\t\tvar missed = false\n\t\t\tif prevBlocks[l][k] != null:\n\t\t\t\t# one message about the current layer\n\t\t\t\tif not missed:\n\t\t\t\t\tmissing += \" L\" + str(l) + \" \"\n\t\t\t\t\tmissed = true\n\t\t\t\tmissing += k.to_upper() + \" \" # bad way of constructing strings\n\tif missing == \"STATUS: \":\n\t\tmissing += \"NOMINAL\"\n\treturn missing\n\nfunc changeValue(ix, togg):\n\ttogg.value = togg.values[ix]\n\nfunc _ready():\n\t# lights!\n\tget_tree().get_root().add_child(preload( \"res:\/\/puzzleView.scn\" ).instance())\n\tpuzzle = preload( \"res:\/\/puzzle.scn\" ).instance()\n\tpuzzle.mainPuzzle = false\n\n\t# hide and disable timer\n\tpuzzle.time.on = false;\n\tpuzzle.time.val = ''\n\n\tpuzzle.set_as_toplevel(true)\n\tget_tree().get_root().add_child(puzzle)\n\n\tgridMan = puzzle.get_node(\"GridView\/GridMan\")\n\tid = gridMan.puzzle.shape.size()\n\n\tpuzzleMan = puzzle.puzzleMan\n\n\tset_process_input(true)\n\n\tvar theme = preload(\"res:\/\/themes\/MainTheme.thm\")\n\tfd = initLoadSaveDialog(self, get_tree(), DataMan.saveDir)\n\n\tvar y = 0\n\tvar x = 60 # these are unrelated\n\tfor control in gui:\n\t\tif control[0].rfind('_toggle') > 0:\n\t\t\tx += 150\n\t\t\tvar togg = control[1]\n\t\t\tvar e = togg.optionButt\n\t\t\te.set_pos(Vector2(x, 45))\n\t\t\te.set_theme(theme)\n\t\t\tadd_child(e)\n\n\t\t\t# index of items needed\n\t\t\te.connect(\"item_selected\", self, \"changeValue\", [togg])\n\t\t\tfor i in range(togg.values.size()):\n\t\t\t\te.add_item(togg.values[i], i)\n\t\t\t\tif togg.value == togg.values[i]:\n\t\t\t\t\te.select(i)\n\t\t\t\t# e.add_icon_item(togg.values[i], i)\n\n\t\telse:\n\t\t\ty += 45\n\t\t\tvar e = control[1]\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tif e extends Button:\n\t\t\t\te.set_text(control[0])\n\t\t\tif control[0] == 'save_pzl' :\n\t\t\t\te.connect('pressed', self, 'showSaveDialog', [fd, self])\n\t\t\tif control[0] == 'load_pzl' :\n\t\t\t\te.connect('pressed', self, 'showLoadDialog', [fd, self])\n\t\t\tif control[0] == 'status':\n\t\t\t\tcontrol[1].set_text('STATUS: NOMINAL')\n\t\t\tadd_child(e)\n\n\nfunc puzzleSave():\n\tvar f = fd.get_current_path()\n\tif f == null or f == \"\":\n\t\treturn\n\t# if getPrevBlockErrors() != NO_ERRORS:\n\t# \tgui[status_ix][1].set_text(getPrevBlockErrors() + \" SAVING DISABLED! BANG HEAD ON KEYBOARD \")\n\t# \treturn\n\tprint(\"SAVING TO \", f)\n\tDataMan.savePuzzle( f, gridMan.puzzle )\n\nfunc puzzleLoad():\n\tvar f = fd.get_current_path()\n\tif f == null or f == \"\":\n\t\treturn\n\tprint(\"LOADING FROM \", f)\n\tprevBlocks = []\n\tgridMan.set_puzzle(DataMan.loadPuzzle( f ))\n\nstatic func showLoadDialog(fileD, parent):\n\tif fileD.is_connected(\"confirmed\", parent, \"puzzleSave\"):\n\t\tfileD.disconnect(\"confirmed\", parent, \"puzzleSave\")\n\tfileD.connect(\"confirmed\", parent, \"puzzleLoad\")\n\tfileD.set_mode(FileDialog.MODE_OPEN_FILE)\n\n\tfileD.popup_centered()\n\nstatic func showSaveDialog(fileD, parent):\n\tif fileD.is_connected(\"confirmed\", parent, \"puzzleLoad\"):\n\t\tfileD.disconnect(\"confirmed\", parent, \"puzzleLoad\")\n\tfileD.connect(\"confirmed\", parent, \"puzzleSave\")\n\tfileD.set_mode(FileDialog.MODE_SAVE_FILE)\n\n\tfileD.popup_centered()\n\nstatic func initLoadSaveDialog(parent, tree, saveDir):\n\t# setup text in the file dialog\n\tvar fileDialog = load(\"res:\/\/fileDialog.scn\").instance()\n\tfileDialog.set_title(\"Select Puzzle Filename\")\n\tfileDialog.set_access(FileDialog.ACCESS_FILESYSTEM)\n\tfileDialog.add_filter(\"*.pzl ; Anttris Puzzle\")\n\n\tDirectory.new().make_dir_recursive(saveDir)\n\tfileDialog.set_current_dir(saveDir)\n\tprint(\"Saves in \", saveDir)\n\n\t# MainTheme leaks on bottom\n\tvar dialogTheme = Theme.new()\n\tdialogTheme.copy_default_theme()\n\tfileDialog.set_theme(dialogTheme)\n\n\t# work even if game is paused\n\tfileDialog.set_pause_mode(PAUSE_MODE_PROCESS)\n\n\t# unpause if user cancels\n\tfileDialog.connect(\"popup_hide\", tree, \"set_pause\", [false])\n\tfileDialog.connect(\"hide\", tree, \"set_pause\", [false])\n\tfileDialog.connect(\"about_to_show\", tree, \"set_pause\", [true])\n\tfileDialog.hide()\n\n\tparent.add_child(fileDialog)\n\tfileDialog.set_owner(parent)\n\treturn fileDialog\n","old_contents":"extends Spatial\n\nconst NO_ERRORS = \"STATUS NOMINAL\"\n\nvar puzzle\nvar puzzleMan\nvar DataMan = load(\"res:\/\/scripts\/DataManager.gd\").new()\n\nvar gridMan\nvar prevBlocks = [] # keeps track of prevous color for pairs by layer\nvar blockColors = preload(\"res:\/\/scripts\/PuzzleManager.gd\").blockColors\nvar id\n\nvar glyphIx = 0\n\nvar fd\nvar gui = [\n\t[\"save_pzl\", Button.new()],\n\t[\"load_pzl\", Button.new()],\n\t[\"remove_layer\", Button.new()],\n\t[\"random_layer\", Button.new()],\n\t[\"class_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=[\"WILD\", \"PAIR\"],\n\t\t# const BLOCK_LASER\t= 0\n\t\t# const BLOCK_WILD\t= 1\n\t\t# const BLOCK_PAIR\t= 2\n\t\t# const BLOCK_GOAL\t= 3\n\t\t# const BLOCK_BLOCK = 4\n\t\tvalue=\"PAIR\"\n\t}],\n\t[\"color_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=blockColors,\n\t\tvalue=\"Blue\"\n\t}],\n\t[\"action_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=[\"Add\", \"Remove\", \"Replace\"],\n\t\tvalue=\"Add\"\n\t}],\n\t[\"status\", Label.new()],\n\t[\"test_pzl\", Button.new()]\n]\nvar action_ix = gui.size() - 2 - 1\nvar color_ix = gui.size() - 2 - 2\nvar class_ix = gui.size() - 2 - 3\nvar status_ix = gui.size() - 2\n\n# gross style, cannot , but clean enough\nfunc shouldAddNeighbor():\n\treturn gui[action_ix][1].value == \"Add\"\n\nfunc shouldReplaceSelf():\n\treturn gui[action_ix][1].value == \"Replace\"\n\nfunc shouldRemoveSelf():\n\treturn gui[action_ix][1].value == \"Remove\"\n\n# called in AbstractBlock to add a new block\nfunc addBlock(pos):\n\tvar curColor = gui[color_ix][1].value\n\tvar selected = gui[class_ix][1].value\n\tvar b = puzzleMan.PickledBlock.new() \\\n\t\t.setName(id) \\\n\t\t.setBlockPos(pos) \\\n\t\t.setBlockClass(gui[class_ix][1].optionButt.get_selected() + 1)\n\t\t# VERY FRAGILE INDEX STUFF\n\tvar layer = puzzleMan.calcBlockLayerVec(pos)\n\tif layer == 0 and not selected == \"GOAL\":\n\t\treturn\n\n\tif selected == \"LZR\" or selected == \"GOAL\":\n\t\tprint(\"CANNOT MK \", str(selected))\n\t\treturn\n\n\tif selected == \"WILD\":\n\t\tb.setTextureName(curColor)\n\t# must be a paired block\n\n\telse:\n\t\tid += 1\n\n\t\t# expand prevblocks index\n\t\twhile prevBlocks.size() <= layer:\n\t\t\tvar d = {}\n\t\t\tfor k in blockColors:\n\t\t\t\td[k] = null\n\t\t\tprevBlocks.append(d)\n\n\t\tvar pb = prevBlocks[layer][curColor]\n\n\t\tif pb != null:\n\t\t\tvar prevName = pb.toNode().name\n\t\t\tvar pbNode = gridMan.get_node(prevName)\n\n\t\t\tb.setPairName(pb.name)\n\t\t\tpb.setPairName(b.name)\n\n\t\t\tb.setTextureName(pb.textureName)\n\n\t\t\tgridMan.remove_block(pb)\n\t\t\tgridMan.addPickledBlock(pb)\n\t\t\tprevBlocks[layer][curColor] = null\n\t\telse:\n\t\t\tprevBlocks[layer][curColor] = b\n\t\t\tglyphIx += 1\n\t\t\tglyphIx %= 3\n\t\t\tb.setTextureName(curColor + str(glyphIx + 1))\n\n\t\tgui[status_ix][1].set_text(getPrevBlockErrors())\n\n\tvar block = gridMan.addPickledBlock(b)\n\tvar v = 0.01\n\tblock.set_scale(Vector3(v,v,v))\n\tblock.scaleTweenNode(1, 0.25, Tween.TRANS_QUART).start()\n\treturn b\n\nfunc getPrevBlockErrors():\n\t# hahaha, so bad\n\tvar missing = \"STATUS: \"\n\t# check every layer\n\tfor l in range(prevBlocks.size()):\n\t\t# check every color\n\t\tfor k in prevBlocks[l].keys():\n\t\t\tvar missed = false\n\t\t\tif prevBlocks[l][k] != null:\n\t\t\t\t# one message about the current layer\n\t\t\t\tif not missed:\n\t\t\t\t\tmissing += \" L\" + str(l) + \" \"\n\t\t\t\t\tmissed = true\n\t\t\t\tmissing += k.to_upper() + \" \" # bad way of constructing strings\n\tif missing == \"STATUS: \":\n\t\tmissing += \"NOMINAL\"\n\treturn missing\n\nfunc changeValue(ix, togg):\n\ttogg.value = togg.values[ix]\n\nfunc _ready():\n\t# lights!\n\tget_tree().get_root().add_child(preload( \"res:\/\/puzzleView.scn\" ).instance())\n\tpuzzle = preload( \"res:\/\/puzzle.scn\" ).instance()\n\tpuzzle.mainPuzzle = false\n\n\t# hide and disable timer\n\tpuzzle.time.on = false;\n\tpuzzle.time.val = ''\n\n\tpuzzle.set_as_toplevel(true)\n\tget_tree().get_root().add_child(puzzle)\n\n\tgridMan = puzzle.get_node(\"GridView\/GridMan\")\n\tid = gridMan.puzzle.shape.size()\n\n\tpuzzleMan = puzzle.puzzleMan\n\n\tset_process_input(true)\n\n\tvar theme = preload(\"res:\/\/themes\/MainTheme.thm\")\n\tfd = initLoadSaveDialog(self, get_tree(), DataMan.saveDir)\n\n\tvar y = 0\n\tvar x = 60 # these are unrelated\n\tfor control in gui:\n\t\tif control[0].rfind('_toggle') > 0:\n\t\t\tx += 150\n\t\t\tvar togg = control[1]\n\t\t\tvar e = togg.optionButt\n\t\t\te.set_pos(Vector2(x, 45))\n\t\t\te.set_theme(theme)\n\t\t\tadd_child(e)\n\n\t\t\t# index of items needed\n\t\t\te.connect(\"item_selected\", self, \"changeValue\", [togg])\n\t\t\tfor i in range(togg.values.size()):\n\t\t\t\te.add_item(togg.values[i], i)\n\t\t\t\tif togg.value == togg.values[i]:\n\t\t\t\t\te.select(i)\n\t\t\t\t# e.add_icon_item(togg.values[i], i)\n\n\t\telse:\n\t\t\ty += 45\n\t\t\tvar e = control[1]\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tif e extends Button:\n\t\t\t\te.set_text(control[0])\n\t\t\tif control[0] == 'save_pzl' :\n\t\t\t\te.connect('pressed', self, 'showSaveDialog', [fd, self])\n\t\t\tif control[0] == 'load_pzl' :\n\t\t\t\te.connect('pressed', self, 'showLoadDialog', [fd, self])\n\t\t\tif control[0] == 'status':\n\t\t\t\tcontrol[1].set_text('STATUS: NOMINAL')\n\t\t\tadd_child(e)\n\n\nfunc puzzleSave():\n\tvar f = fd.get_current_path()\n\tif f == null or f == \"\":\n\t\treturn\n\t# if getPrevBlockErrors() != NO_ERRORS:\n\t# \tgui[status_ix][1].set_text(getPrevBlockErrors() + \" SAVING DISABLED! BANG HEAD ON KEYBOARD \")\n\t# \treturn\n\tprint(\"SAVING TO \", f)\n\tDataMan.savePuzzle( f, gridMan.puzzle )\n\nfunc puzzleLoad():\n\tvar f = fd.get_current_path()\n\tif f == null or f == \"\":\n\t\treturn\n\tprint(\"LOADING FROM \", f)\n\tprevBlocks = []\n\tgridMan.set_puzzle(DataMan.loadPuzzle( f ))\n\nstatic func showLoadDialog(fileD, parent):\n\tif fileD.is_connected(\"confirmed\", parent, \"puzzleSave\"):\n\t\tfileD.disconnect(\"confirmed\", parent, \"puzzleSave\")\n\tfileD.connect(\"confirmed\", parent, \"puzzleLoad\")\n\tfileD.set_mode(FileDialog.MODE_OPEN_FILE)\n\n\tfileD.popup_centered()\n\nstatic func showSaveDialog(fileD, parent):\n\tif fileD.is_connected(\"confirmed\", parent, \"puzzleLoad\"):\n\t\tfileD.disconnect(\"confirmed\", parent, \"puzzleLoad\")\n\tfileD.connect(\"confirmed\", parent, \"puzzleSave\")\n\tfileD.set_mode(FileDialog.MODE_SAVE_FILE)\n\n\tfileD.popup_centered()\n\nstatic func initLoadSaveDialog(parent, tree, saveDir):\n\t# setup text in the file dialog\n\tvar fileDialog = load(\"res:\/\/fileDialog.scn\").instance()\n\tfileDialog.set_title(\"Select Puzzle Filename\")\n\tfileDialog.set_access(FileDialog.ACCESS_FILESYSTEM)\n\tfileDialog.add_filter(\"*.pzl ; Anttris Puzzle\")\n\n\tDirectory.new().make_dir_recursive(saveDir)\n\tfileDialog.set_current_dir(saveDir)\n\tprint(\"Saves in \", saveDir)\n\n\t# MainTheme leaks on bottom\n\tvar dialogTheme = Theme.new()\n\tdialogTheme.copy_default_theme()\n\tfileDialog.set_theme(dialogTheme)\n\n\t# work even if game is paused\n\tfileDialog.set_pause_mode(PAUSE_MODE_PROCESS)\n\n\t# unpause if user cancels\n\tfileDialog.connect(\"popup_hide\", tree, \"set_pause\", [false])\n\tfileDialog.connect(\"hide\", tree, \"set_pause\", [false])\n\tfileDialog.connect(\"about_to_show\", tree, \"set_pause\", [true])\n\tfileDialog.hide()\n\n\tparent.add_child(fileDialog)\n\tfileDialog.set_owner(parent)\n\treturn fileDialog\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"a3aefa4eee3c2b185b31ccff5abbc60dec8ad950","subject":"scene switcher demo changed to reflect tutorial, fixes #1673","message":"scene switcher demo changed to reflect tutorial, fixes #1673\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"misc\/autoload\/global.gd","new_file":"misc\/autoload\/global.gd","new_contents":"extends Node\n\n\nvar current_scene = null\n\nfunc _deferred_goto_scene(path):\n\n\t# Immediately free the current scene,\n # there is no risk here.\t\n\tcurrent_scene.free()\n\n\t# Load new scene\n\tvar s = ResourceLoader.load(path)\n\n\t# Instance the new scene\n\tcurrent_scene = s.instance()\n\n\t# Add it to the active scene, as child of root\n\tget_tree().get_root().add_child(current_scene)\n\nfunc goto_scene(path):\n\n\t# This function will usually be called from a signal callback,\n # or some other function from the running scene.\n\t# Deleting the current scene at this point might be\n # a bad idea, because it may be inside of a callback or function of it.\n\t# The worst case will be a crash or unexpected behavior.\n\n\t# The way around this is deferring the load to a later time, when\n # it is ensured that no code from the current scene is running:\n\n\tcall_deferred(\"_deferred_goto_scene\",path)\n\n\nfunc _ready():\n\t# Get the current scene, the first time.\n\t# it is always the last child of root,\n\t# after the autoloaded nodes.\n\n\tvar root = get_tree().get_root()\n\tcurrent_scene = root.get_child( root.get_child_count() -1 )\n","old_contents":"extends Node\n\n\nvar current_scene = null\n\n\nfunc goto_scene(scene):\n\t#load new scene\n\tvar s = ResourceLoader.load(scene)\n\t#queue erasing old (don't use free because that scene is calling this method)\n\tcurrent_scene.queue_free()\n\t#instance the new scene\n\tcurrent_scene = s.instance()\n\t#add it to the active scene, as child of root\n\tget_tree().get_root().add_child(current_scene)\n\n\nfunc _ready():\n\t# get the current scene\n\t# it is always the last child of root,\n\t# after the autoloaded nodes\n\tvar root = get_tree().get_root()\n\tcurrent_scene = root.get_child( root.get_child_count() -1 )\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"1bf64d0592e680b9b67bf60b7c702307ac067ab7","subject":"Remove old code","message":"Remove old code\n","repos":"h4de5\/spiel4","old_file":"game\/autoloads\/interface.gd","new_file":"game\/autoloads\/interface.gd","new_contents":"# global autoload with functions to check if a node has an interface\nextends Node\n\n# goes through node and collects all get_property functions\nfunc collect_properties(node, properties = {}):\n\tif not node == null:\n\t\tif node.has_method(\"get_property\"):\n\t\t\tproperties = node.get_property(null)\n\n\t\tfor child in node.get_children():\n\t\t\tif child.has_method(\"get_property\"):\n\t\t\t\tmerge_dicts(properties, child.get_property(null))\n\t\t\telse:\n\t\t\t\tproperties = collect_properties(child, properties)\n\treturn properties\n\nstatic func merge_dicts(target, patch):\n\tfor key in patch:\n\t\ttarget[key] = patch[key]\n\treturn target\n\n# check if node has interface\n# can be shootable, adjustable, destroyable,\nfunc is_able(node, interface, recursive= true):\n\tif node == null:\n\t\treturn null\n\tif interface == null or interface == \"\":\n\t\treturn null\n\n\t# must have method and be an extendent to isable\n\tif (node extends load(\"res:\/\/game\/interfaces\/isable.gd\") and\n\t\tnode.has_method(\"is_\"+interface)):\n\t\treturn node.call(\"is_\"+interface)\n\n\t# only go down one level\n\tif recursive:\n\t\t# for each child in node\n\t\tfor child in node.get_children():\n\t\t\t# if has interface method, return result\n\t\t\tif (child extends load(\"res:\/\/game\/interfaces\/isable.gd\") and\n\t\t\t\tchild.has_method(\"is_\"+interface)):\n\t\t\t\treturn child.call(\"is_\"+ interface)\n\t\t\telse :\n\t\t\t\t# if not, go one level deeper\n\t\t\t\tvar isable = is_able(child, interface, false)\n\t\t\t\tif isable:\n\t\t\t\t\treturn isable\n\treturn null\n\nfunc is_adjustable(node, recursive= true):\n\treturn is_able(node, \"adjustable\")\n\nfunc is_shootable(node, recursive= true):\n\treturn is_able(node, \"shootable\")\n\nfunc is_moveable(node, recursive= true):\n\treturn is_able(node, \"moveable\")\n\nfunc is_destroyable(node, recursive= true):\n\treturn is_able(node, \"destroyable\")\n\nfunc is_collectable(node, recursive= true):\n\treturn is_able(node, \"collectable\")\n\n","old_contents":"# global autoload with functions to check if a node has an interface\nextends Node\n\n# goes through node and collects all get_property functions\nfunc collect_properties(node, properties = {}):\n\tif not node == null:\n\t\tif node.has_method(\"get_property\"):\n\t\t\tproperties = node.get_property(null)\n\n\t\tfor child in node.get_children():\n\t\t\tif child.has_method(\"get_property\"):\n\t\t\t\tmerge_dicts(properties, child.get_property(null))\n\t\t\telse:\n\t\t\t\tproperties = collect_properties(child, properties)\n\treturn properties\n\nstatic func merge_dicts(target, patch):\n\tfor key in patch:\n\t\ttarget[key] = patch[key]\n\treturn target\n\n# check if node has interface\n# can be shootable, adjustable, destroyable,\nfunc is_able(node, interface, recursive= true):\n\tif node == null:\n\t\treturn null\n\tif interface == null or interface == \"\":\n\t\treturn null\n\n\t# must have method and be an extendent to isable\n\tif node extends load(\"res:\/\/game\/interfaces\/isable.gd\") and node.has_method(\"is_\"+interface):\n\t\treturn node.call(\"is_\"+interface)\n\n\t# only go down one level\n\tif recursive:\n\t\t# for each child in node\n\t\tfor child in node.get_children():\n\t\t\t# if has interface method, return result\n\t\t\tif child extends load(\"res:\/\/game\/interfaces\/isable.gd\") and child.has_method(\"is_\"+interface):\n\t\t\t\treturn child.call(\"is_\"+ interface)\n\t\t\telse :\n\t\t\t\t# if not, go one level deeper\n\t\t\t\tvar isable = is_able(child, interface, false)\n\t\t\t\tif isable:\n\t\t\t\t\treturn isable\n\treturn null\n\nfunc is_adjustable(node, recursive= true):\n\treturn is_able(node, \"adjustable\")\n\nfunc is_shootable(node, recursive= true):\n\t\"\"\"\n\tif node == null:\n\t\treturn false\n\tif node.has_method(\"is_shootable\"):\n\t\tif node.is_shootable():\n\t\t\treturn node\n\tif recursive:\n\t\tfor child in node.get_children():\n\t\t\tif is_shootable(child, true) :\n\t\t\t\treturn child\n\treturn false\n\t\"\"\"\n\treturn is_able(node, \"shootable\")\n\nfunc is_moveable(node, recursive= true):\n\treturn is_able(node, \"moveable\")\n\t\"\"\"\n\tif node == null:\n\t\treturn false\n\tif node.has_method(\"is_moveable\"):\n\t\tif node.is_moveable():\n\t\t\treturn node\n\tif recursive:\n\t\tfor child in node.get_children():\n\t\t\tif is_moveable(child, false) :\n\t\t\t\treturn child\n\treturn false\n\t\"\"\"\n\nfunc is_destroyable(node, recursive= true):\n\treturn is_able(node, \"destroyable\")\n\t\"\"\"\n\tif node == null:\n\t\treturn false\n\tif node.has_method(\"is_destroyable\"):\n\t\tif node.is_destroyable():\n\t\t\treturn node\n\tif recursive:\n\t\tfor child in node.get_children():\n\t\t\tif is_destroyable(child, false) :\n\t\t\t\treturn child\n\treturn false\n\t\"\"\"\n\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"GDScript"} {"commit":"a36e43e9a929bda6950537454e188379f48fbe36","subject":"Fixed double input delay to depent on input type.","message":"Fixed double input delay to depent on input type.\n","repos":"CSaratakij\/jam-2016-remake","old_file":"src\/player\/player.gd","new_file":"src\/player\/player.gd","new_contents":"\nextends KinematicBody2D\n\nconst mask_types = preload(\"res:\/\/mask\/mask.gd\").types\nconst totem_minimum_interval = preload(\"res:\/\/spawner\/totem_spawner.gd\").MIN_STEP\nconst GRAVITY = 980.0\nconst MOVE_SPEED = 240.0\nconst DASH_SPEED = 900.0\nconst JUMP_FORCE = 230.0\nconst POINT = 1\nconst INIT_MOVE_DIRECTION = Vector2(1, 1)\nconst DOUBLE_KEY_DELAY = 0.36\nconst DOUBLE_TOUCH_DELAY = 0.18\n\nvar _velocity = Vector2()\nvar _motion = Vector2()\nvar is_can_jump = true\nvar is_grounded = false\nvar _move_direction = INIT_MOVE_DIRECTION\nvar current_floor = 1\nvar current_mask = \"\"\nvar current_using_mask = \"\"\nvar using_mask_pos = Vector2(0, 0)\nvar hit_totem_pos = Vector2(0, 0)\nvar player_to_hit_totem_pos = Vector2(0, 0)\nvar start_points = [\n\tVector2(0, 80),\n\tVector2(715, 220),\n\tVector2(0, 360)\n]\nvar max_height_floors = [\n\tVector2(0, 50),\n\tVector2(0, 180),\n\tVector2(0, 320)\n]\nvar is_activate_mask = false\nvar is_using_mask = false\nvar is_used_dig_mask = false\nvar is_hit_totem = false\n\nonready var tree = get_tree()\nonready var root = tree.get_root()\nonready var global = root.get_node(\"\/root\/global\")\nonready var _sprite = get_node(\"Sprite\")\nonready var _raycast = get_node(\"RayCast2D\")\nonready var _health = get_node(\"health\")\nonready var _sound_players = {\n\t\"player\" : get_node(\"SamplePlayer\/Player\"),\n\t\"item\" : get_node(\"SamplePlayer\/Item\")\n}\nonready var _timer = get_node(\"Timer\")\nonready var _particles = {\n\t\"have_mask\" : get_node(\"Particles\/have_mask_particle\")\n}\n\nfunc _ready():\n\tset_process(true)\n\tset_process_input(true)\n\tset_fixed_process(true)\n\nfunc _input(event):\n\tif event.type == InputEvent.MOUSE_BUTTON:\n\t\tis_activate_mask = event.doubleclick\n\telif event.type == InputEvent.SCREEN_TOUCH:\n\t\tif _timer.get_wait_time() != DOUBLE_TOUCH_DELAY:\n\t\t\t_timer.set_wait_time(DOUBLE_TOUCH_DELAY)\n\t\tif event.pressed and not event.is_echo():\n\t\t\tif _timer.get_time_left() == 0:\n\t\t\t\tis_activate_mask = false\n\t\t\t\t_timer.start()\n\t\t\telse:\n\t\t\t\tis_activate_mask = true\n\t\t\t\t_timer.stop()\n\telse:\n\t\tif _timer.get_wait_time() != DOUBLE_KEY_DELAY:\n\t\t\t_timer.set_wait_time(DOUBLE_KEY_DELAY)\n\t\tif event.is_action_pressed(\"jump\"):\n\t\t\tif _timer.get_time_left() == 0:\n\t\t\t\tis_activate_mask = false\n\t\t\t\t_timer.start()\n\t\t\telse:\n\t\t\t\tis_activate_mask = true\n\t\t\t\t_timer.stop()\n\nfunc _process(delta):\n\tif global.is_game_over():\n\t\t_sprite.hide()\n\t\t_particles[ \"have_mask\" ].hide()\n\telse:\n\t\t_sprite.show()\n\t\t_particles[ \"have_mask\" ].set_rotd((_move_direction.x * 90) * -1)\n\t\tif not current_mask == \"\":\n\t\t\t_particles[ \"have_mask\" ].show()\n\t\t\tif not is_grounded:\n\t\t\t\t_particles[ \"have_mask\" ].set_param(Particles2D.PARAM_TANGENTIAL_ACCEL, _move_direction.x * 60)\n\t\t\telse:\n\t\t\t\t_particles[ \"have_mask\" ].set_param(Particles2D.PARAM_TANGENTIAL_ACCEL, 0)\n\t\telse:\n\t\t\t_particles[ \"have_mask\" ].hide()\n\nfunc _fixed_process(delta):\n\tif _health.is_alive():\n\t\tif not global.is_game_over():\n\t\t\tif is_activate_mask:\n\t\t\t\tusing_mask_pos = get_global_pos()\n\t\t\t\tcurrent_using_mask = current_mask\n\t\t\t\tcurrent_mask = \"\"\n\t\t\t\tis_using_mask = true\n\t\t\t\tis_activate_mask = false\n\t\t\tif is_using_mask and not current_using_mask == \"\":\n\t\t\t\tif current_using_mask == mask_types[ 0 ]:\n\t\t\t\t\t_velocity.y = 0\n\t\t\t\t\t_velocity.x = DASH_SPEED * _move_direction.x\n\t\t\t\t\tif abs(get_global_pos().distance_to(using_mask_pos)) > totem_minimum_interval * 1.5:\n\t\t\t\t\t\tstop_using_mask()\n\t\t\t\telif current_using_mask == mask_types[ 1 ]:\n\t\t\t\t\tglobal.add_score(1)\n\t\t\t\t\tif current_floor == 3:\n\t\t\t\t\t\tchange_floor(1)\n\t\t\t\t\telse:\n\t\t\t\t\t\tchange_floor(current_floor + 1)\n\t\t\t\t\tset_global_pos(Vector2(get_global_pos().x, max_height_floors[ current_floor - 1].y))\n\t\t\t\t\tis_used_dig_mask = true\n\t\t\t\t\tstop_using_mask()\n\t\t\telse:\n\t\t\t\tis_grounded = _raycast.is_colliding()\n\t\t\t\t_velocity.y += _move_direction.y * GRAVITY * delta\n\t\t\t\t_velocity.x = _move_direction.x * MOVE_SPEED\n\t\t\t\tif is_grounded and is_can_jump:\n\t\t\t\t\tif Input.is_action_pressed(\"jump\"):\n\t\t\t\t\t\t_velocity.y = -JUMP_FORCE\n\t\t\t\t\t\t_sound_players[ \"player\" ].play(\"jump\")\n\t\telse:\n\t\t\t_velocity = Vector2(0, 0)\n\t\t\n\t\t_motion = _velocity * delta\n\t\t_motion = move(_motion)\n\t\n\t\tif is_colliding():\n\t\t\tvar n = get_collision_normal()\n\t\t\t_motion = n.slide(_motion)\n\t\t\t_velocity = n.slide(_velocity)\n\t\t\tmove(_motion)\n\nfunc set_is_can_jump(is_can):\n\tis_can_jump = is_can\n\nfunc set_is_hit_totem(is_hit):\n\tis_hit_totem = is_hit\n\nfunc get_is_hit_totem():\n\treturn is_hit_totem\n\nfunc get_is_can_jump():\n\treturn is_can_jump\n\nfunc get_is_using_mask():\n\treturn is_using_mask\n\nfunc get_current_floor():\n\treturn current_floor\n\nfunc get_current_mask():\n\treturn current_mask\n\nfunc get_current_using_mask():\n\treturn current_using_mask\n\nfunc get_using_mask_pos():\n\treturn using_mask_pos\n\nfunc get_hit_totem_pos():\n\treturn hit_totem_pos\n\nfunc get_player_to_hit_totem_pos():\n\treturn player_to_hit_totem_pos\n\nfunc get_move_direction():\n\treturn _move_direction\n\nfunc change_move_direction_h():\n\t_move_direction.x *= -1\n\nfunc change_floor(next_floor):\n\tcurrent_floor = next_floor\n\tif current_floor == 2:\n\t\tchange_move_direction_h()\n\t\t_sprite.set_flip_h(true)\n\telif current_floor == 3:\n\t\tchange_move_direction_h()\n\t\t_sprite.set_flip_h(false)\n\nfunc reset_move_direction():\n\t_move_direction = INIT_MOVE_DIRECTION\n\nfunc stop_using_mask():\n\tcurrent_using_mask = \"\"\n\tis_using_mask = false\n\nfunc _on_Area2D_area_enter( area ):\n\tvar areas = area.get_groups()\n\tif areas.has(\"switch_side_trigger\"):\n\t\tglobal.add_score(POINT)\n\t\tstop_using_mask()\n\t\tif area.get_name() == \"floor1-2\":\n\t\t\tchange_floor(2)\n\t\telif area.get_name() == \"floor2-3\":\n\t\t\tchange_floor(3)\n\t\telif area.get_name() == \"floor3-1\":\n\t\t\tchange_floor(1)\n\t\tset_global_pos(start_points[ current_floor - 1])\n\telif areas.has(\"health\"):\n\t\t_health.restore(1)\n\t\t_sound_players[ \"item\" ].play(\"item\")\n\t\tarea.hide()\n\t\tarea.set_global_pos(area.get_parent().get_global_pos())\n\t\t\n\telif areas.has(\"mask\"):\n\t\tcurrent_mask = area.get_type()\n\t\t_sound_players[ \"item\" ].play(\"bonus\")\n\t\tarea.hide()\n\t\tarea.set_global_pos(area.get_parent().get_global_pos())\n\nfunc _on_Area2D_body_enter( body ):\n\tvar groups = body.get_groups()\n\tif groups.has(\"totem\"):\n\t\tset_is_hit_totem(true)\n\t\thit_totem_pos = body.get_global_pos()\n\t\tif _move_direction.x > 0:\n\t\t\tplayer_to_hit_totem_pos = hit_totem_pos - get_global_pos()\n\t\telse:\n\t\t\tplayer_to_hit_totem_pos = get_global_pos() - hit_totem_pos\n\t\t_health.remove(1)\n\t\t_sound_players[ \"player\" ].play(\"hit\")\n\t\tset_global_pos(start_points[ current_floor - 1 ])\n","old_contents":"\nextends KinematicBody2D\n\nconst mask_types = preload(\"res:\/\/mask\/mask.gd\").types\nconst totem_minimum_interval = preload(\"res:\/\/spawner\/totem_spawner.gd\").MIN_STEP\nconst GRAVITY = 980.0\nconst MOVE_SPEED = 240.0\nconst DASH_SPEED = 900.0\nconst JUMP_FORCE = 230.0\nconst POINT = 1\nconst INIT_MOVE_DIRECTION = Vector2(1, 1)\n\nvar _velocity = Vector2()\nvar _motion = Vector2()\nvar is_can_jump = true\nvar is_grounded = false\nvar _move_direction = INIT_MOVE_DIRECTION\nvar current_floor = 1\nvar current_mask = \"\"\nvar current_using_mask = \"\"\nvar using_mask_pos = Vector2(0, 0)\nvar hit_totem_pos = Vector2(0, 0)\nvar player_to_hit_totem_pos = Vector2(0, 0)\nvar start_points = [\n\tVector2(0, 80),\n\tVector2(715, 220),\n\tVector2(0, 360)\n]\nvar max_height_floors = [\n\tVector2(0, 50),\n\tVector2(0, 180),\n\tVector2(0, 320)\n]\nvar is_activate_mask = false\nvar is_using_mask = false\nvar is_used_dig_mask = false\nvar is_hit_totem = false\n\nonready var tree = get_tree()\nonready var root = tree.get_root()\nonready var global = root.get_node(\"\/root\/global\")\nonready var _sprite = get_node(\"Sprite\")\nonready var _raycast = get_node(\"RayCast2D\")\nonready var _health = get_node(\"health\")\nonready var _sound_players = {\n\t\"player\" : get_node(\"SamplePlayer\/Player\"),\n\t\"item\" : get_node(\"SamplePlayer\/Item\")\n}\nonready var _timer = get_node(\"Timer\")\nonready var _particles = {\n\t\"have_mask\" : get_node(\"Particles\/have_mask_particle\")\n}\n\nfunc _ready():\n\tif OS.get_name() == \"Android\":\n\t\t_timer.set_wait_time(0.18)\n\tset_process(true)\n\tset_process_input(true)\n\tset_fixed_process(true)\n\nfunc _input(event):\n\tif event.type == InputEvent.MOUSE_BUTTON:\n\t\tis_activate_mask = event.doubleclick\n\telif event.type == InputEvent.SCREEN_TOUCH:\n\t\tif event.pressed and not event.is_echo():\n\t\t\tif _timer.get_time_left() == 0:\n\t\t\t\tis_activate_mask = false\n\t\t\t\t_timer.start()\n\t\t\telse:\n\t\t\t\tis_activate_mask = true\n\t\t\t\t_timer.stop()\n\telse:\n\t\tif event.is_action_pressed(\"jump\"):\n\t\t\tif _timer.get_time_left() == 0:\n\t\t\t\tis_activate_mask = false\n\t\t\t\t_timer.start()\n\t\t\telse:\n\t\t\t\tis_activate_mask = true\n\t\t\t\t_timer.stop()\n\nfunc _process(delta):\n\tif global.is_game_over():\n\t\t_sprite.hide()\n\t\t_particles[ \"have_mask\" ].hide()\n\telse:\n\t\t_sprite.show()\n\t\t_particles[ \"have_mask\" ].set_rotd((_move_direction.x * 90) * -1)\n\t\tif not current_mask == \"\":\n\t\t\t_particles[ \"have_mask\" ].show()\n\t\t\tif not is_grounded:\n\t\t\t\t_particles[ \"have_mask\" ].set_param(Particles2D.PARAM_TANGENTIAL_ACCEL, _move_direction.x * 60)\n\t\t\telse:\n\t\t\t\t_particles[ \"have_mask\" ].set_param(Particles2D.PARAM_TANGENTIAL_ACCEL, 0)\n\t\telse:\n\t\t\t_particles[ \"have_mask\" ].hide()\n\nfunc _fixed_process(delta):\n\tif _health.is_alive():\n\t\tif not global.is_game_over():\n\t\t\tif is_activate_mask:\n\t\t\t\tusing_mask_pos = get_global_pos()\n\t\t\t\tcurrent_using_mask = current_mask\n\t\t\t\tcurrent_mask = \"\"\n\t\t\t\tis_using_mask = true\n\t\t\t\tis_activate_mask = false\n\t\t\tif is_using_mask and not current_using_mask == \"\":\n\t\t\t\tif current_using_mask == mask_types[ 0 ]:\n\t\t\t\t\t_velocity.y = 0\n\t\t\t\t\t_velocity.x = DASH_SPEED * _move_direction.x\n\t\t\t\t\tif abs(get_global_pos().distance_to(using_mask_pos)) > totem_minimum_interval * 1.5:\n\t\t\t\t\t\tstop_using_mask()\n\t\t\t\telif current_using_mask == mask_types[ 1 ]:\n\t\t\t\t\tglobal.add_score(1)\n\t\t\t\t\tif current_floor == 3:\n\t\t\t\t\t\tchange_floor(1)\n\t\t\t\t\telse:\n\t\t\t\t\t\tchange_floor(current_floor + 1)\n\t\t\t\t\tset_global_pos(Vector2(get_global_pos().x, max_height_floors[ current_floor - 1].y))\n\t\t\t\t\tis_used_dig_mask = true\n\t\t\t\t\tstop_using_mask()\n\t\t\telse:\n\t\t\t\tis_grounded = _raycast.is_colliding()\n\t\t\t\t_velocity.y += _move_direction.y * GRAVITY * delta\n\t\t\t\t_velocity.x = _move_direction.x * MOVE_SPEED\n\t\t\t\tif is_grounded and is_can_jump:\n\t\t\t\t\tif Input.is_action_pressed(\"jump\"):\n\t\t\t\t\t\t_velocity.y = -JUMP_FORCE\n\t\t\t\t\t\t_sound_players[ \"player\" ].play(\"jump\")\n\t\telse:\n\t\t\t_velocity = Vector2(0, 0)\n\t\t\n\t\t_motion = _velocity * delta\n\t\t_motion = move(_motion)\n\t\n\t\tif is_colliding():\n\t\t\tvar n = get_collision_normal()\n\t\t\t_motion = n.slide(_motion)\n\t\t\t_velocity = n.slide(_velocity)\n\t\t\tmove(_motion)\n\nfunc set_is_can_jump(is_can):\n\tis_can_jump = is_can\n\nfunc set_is_hit_totem(is_hit):\n\tis_hit_totem = is_hit\n\nfunc get_is_hit_totem():\n\treturn is_hit_totem\n\nfunc get_is_can_jump():\n\treturn is_can_jump\n\nfunc get_is_using_mask():\n\treturn is_using_mask\n\nfunc get_current_floor():\n\treturn current_floor\n\nfunc get_current_mask():\n\treturn current_mask\n\nfunc get_current_using_mask():\n\treturn current_using_mask\n\nfunc get_using_mask_pos():\n\treturn using_mask_pos\n\nfunc get_hit_totem_pos():\n\treturn hit_totem_pos\n\nfunc get_player_to_hit_totem_pos():\n\treturn player_to_hit_totem_pos\n\nfunc get_move_direction():\n\treturn _move_direction\n\nfunc change_move_direction_h():\n\t_move_direction.x *= -1\n\nfunc change_floor(next_floor):\n\tcurrent_floor = next_floor\n\tif current_floor == 2:\n\t\tchange_move_direction_h()\n\t\t_sprite.set_flip_h(true)\n\telif current_floor == 3:\n\t\tchange_move_direction_h()\n\t\t_sprite.set_flip_h(false)\n\nfunc reset_move_direction():\n\t_move_direction = INIT_MOVE_DIRECTION\n\nfunc stop_using_mask():\n\tcurrent_using_mask = \"\"\n\tis_using_mask = false\n\nfunc _on_Area2D_area_enter( area ):\n\tvar areas = area.get_groups()\n\tif areas.has(\"switch_side_trigger\"):\n\t\tglobal.add_score(POINT)\n\t\tstop_using_mask()\n\t\tif area.get_name() == \"floor1-2\":\n\t\t\tchange_floor(2)\n\t\telif area.get_name() == \"floor2-3\":\n\t\t\tchange_floor(3)\n\t\telif area.get_name() == \"floor3-1\":\n\t\t\tchange_floor(1)\n\t\tset_global_pos(start_points[ current_floor - 1])\n\telif areas.has(\"health\"):\n\t\t_health.restore(1)\n\t\t_sound_players[ \"item\" ].play(\"item\")\n\t\tarea.hide()\n\t\tarea.set_global_pos(area.get_parent().get_global_pos())\n\t\t\n\telif areas.has(\"mask\"):\n\t\tcurrent_mask = area.get_type()\n\t\t_sound_players[ \"item\" ].play(\"bonus\")\n\t\tarea.hide()\n\t\tarea.set_global_pos(area.get_parent().get_global_pos())\n\nfunc _on_Area2D_body_enter( body ):\n\tvar groups = body.get_groups()\n\tif groups.has(\"totem\"):\n\t\tset_is_hit_totem(true)\n\t\thit_totem_pos = body.get_global_pos()\n\t\tif _move_direction.x > 0:\n\t\t\tplayer_to_hit_totem_pos = hit_totem_pos - get_global_pos()\n\t\telse:\n\t\t\tplayer_to_hit_totem_pos = get_global_pos() - hit_totem_pos\n\t\t_health.remove(1)\n\t\t_sound_players[ \"player\" ].play(\"hit\")\n\t\tset_global_pos(start_points[ current_floor - 1 ])\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"20b40770ae1f2538ca37040ec0c1532311f32a7e","subject":"Bullet explosions now bounce back","message":"Bullet explosions now bounce back\n","repos":"BK-TN\/IncendiumGame","old_file":"incendium\/scripts\/Bullet.gd","new_file":"incendium\/scripts\/Bullet.gd","new_contents":"\nextends Node2D\n\n# Bullet types\nconst BTYPE_COUNT = 2\n\nconst BTYPE_BASIC = 0\nconst BTYPE_ACCELERATING = 1\nconst BTYPE_CURVESHOT = 2\nconst BTYPE_SPLITTING = 3\n\nvar velocity = Vector2(1000,0)\nvar type = BTYPE_BASIC\nvar lifetime = 6\n\nvar actiontime = 2\n\nvar scale = 0\nvar explosion = preload(\"res:\/\/objects\/Explosion.tscn\")\n\nfunc _ready():\n\t# Called every time the node is added to the scene.\n\t# Initialization here\n\tset_scale(Vector2(0,0))\n\tset_process(true)\n\nfunc _process(delta):\n\tif type == BTYPE_ACCELERATING:\n\t\tvar length = velocity.length()\n\t\tlength += delta * 100\n\t\tvelocity = velocity.normalized() * length\n\tif type == BTYPE_CURVESHOT:\n\t\tvar angle = atan2(velocity.y,velocity.x)\n\t\tangle += delta * 0.3\n\t\tvar length = velocity.length()\n\t\tvelocity = Vector2(cos(angle),sin(angle)) * length\n\t\n\ttranslate(velocity * delta)\n\t\n\tif scale < 1:\n\t\tscale = min(1,lerp(scale,1,delta * 16))\n\t\tset_scale(Vector2(scale,scale))\n\t\n\tlifetime -= delta\n\t\n\tif actiontime > 0:\n\t\tactiontime -= delta\n\t\tif actiontime <= 0:\n\t\t\tif type == BTYPE_SPLITTING:\n\t\t\t\tfor i in range(0,3):\n\t\t\t\t\tvar bullet_instance = load(\"res:\/\/objects\/Bullet.tscn\").instance()\n\t\t\t\t\tbullet_instance.type = BTYPE_BASIC\n\t\t\t\t\tbullet_instance.get_node(\"RegularPolygon\").remove_from_group(\"damage_enemy\")\n\t\t\t\t\tbullet_instance.get_node(\"RegularPolygon\").add_to_group(\"damage_player\")\n\t\t\t\t\tbullet_instance.get_node(\"RegularPolygon\/Polygon2D\").set_color(get_node(\"RegularPolygon\/Polygon2D\").get_color())\n\t\t\t\t\tbullet_instance.get_node(\"RegularPolygon\").size = get_node(\"RegularPolygon\").size \/ 2.0\n\t\t\t\t\tvar angle = atan2(velocity.y,velocity.x) + (i \/ 3.0) * PI * 2\n\t\t\t\t\tbullet_instance.velocity = Vector2(cos(angle),sin(angle)) * velocity.length()\n\t\t\t\t\tget_tree().get_root().add_child(bullet_instance)\n\t\t\t\t\tbullet_instance.set_global_pos(get_global_pos())\n\t\t\t\tqueue_free()\n\t\n\tvar pos = get_pos()\n\t\n\tvar dist_to_center = pos.distance_to(Vector2(720\/2,720\/2))\n\t\n\tif dist_to_center > 720\/2 or lifetime <= 0:\n\t\tqueue_free()\n\t\t\nfunc _exit_tree():\n\tvar explosion_instance = explosion.instance()\n\texplosion_instance.velocity = -velocity * 0.5\n\texplosion_instance.get_node(\"RegularPolygon\").size = get_node(\"RegularPolygon\").size\n\texplosion_instance.get_node(\"RegularPolygon\/Polygon2D\").set_color(get_node(\"RegularPolygon\/Polygon2D\").get_color())\n\tget_tree().get_root().add_child(explosion_instance)\n\texplosion_instance.set_global_pos(get_global_pos())","old_contents":"\nextends Node2D\n\n# Bullet types\nconst BTYPE_COUNT = 2\n\nconst BTYPE_BASIC = 0\nconst BTYPE_ACCELERATING = 1\nconst BTYPE_CURVESHOT = 2\nconst BTYPE_SPLITTING = 3\n\nvar velocity = Vector2(1000,0)\nvar type = BTYPE_BASIC\nvar lifetime = 6\n\nvar actiontime = 2\n\nvar scale = 0\nvar explosion = preload(\"res:\/\/objects\/Explosion.tscn\")\n\nfunc _ready():\n\t# Called every time the node is added to the scene.\n\t# Initialization here\n\tset_scale(Vector2(0,0))\n\tset_process(true)\n\nfunc _process(delta):\n\tif type == BTYPE_ACCELERATING:\n\t\tvar length = velocity.length()\n\t\tlength += delta * 100\n\t\tvelocity = velocity.normalized() * length\n\tif type == BTYPE_CURVESHOT:\n\t\tvar angle = atan2(velocity.y,velocity.x)\n\t\tangle += delta * 0.3\n\t\tvar length = velocity.length()\n\t\tvelocity = Vector2(cos(angle),sin(angle)) * length\n\t\n\ttranslate(velocity * delta)\n\t\n\tif scale < 1:\n\t\tscale = min(1,lerp(scale,1,delta * 16))\n\t\tset_scale(Vector2(scale,scale))\n\t\n\tlifetime -= delta\n\t\n\tif actiontime > 0:\n\t\tactiontime -= delta\n\t\tif actiontime <= 0:\n\t\t\tif type == BTYPE_SPLITTING:\n\t\t\t\tfor i in range(0,3):\n\t\t\t\t\tvar bullet_instance = load(\"res:\/\/objects\/Bullet.tscn\").instance()\n\t\t\t\t\tbullet_instance.type = BTYPE_BASIC\n\t\t\t\t\tbullet_instance.get_node(\"RegularPolygon\").remove_from_group(\"damage_enemy\")\n\t\t\t\t\tbullet_instance.get_node(\"RegularPolygon\").add_to_group(\"damage_player\")\n\t\t\t\t\tbullet_instance.get_node(\"RegularPolygon\/Polygon2D\").set_color(get_node(\"RegularPolygon\/Polygon2D\").get_color())\n\t\t\t\t\tbullet_instance.get_node(\"RegularPolygon\").size = get_node(\"RegularPolygon\").size \/ 2.0\n\t\t\t\t\tvar angle = atan2(velocity.y,velocity.x) + (i \/ 3.0) * PI * 2\n\t\t\t\t\tbullet_instance.velocity = Vector2(cos(angle),sin(angle)) * velocity.length()\n\t\t\t\t\tget_tree().get_root().add_child(bullet_instance)\n\t\t\t\t\tbullet_instance.set_global_pos(get_global_pos())\n\t\t\t\tqueue_free()\n\t\n\tvar pos = get_pos()\n\t\n\tvar dist_to_center = pos.distance_to(Vector2(720\/2,720\/2))\n\t\n\tif dist_to_center > 720\/2 or lifetime <= 0:\n\t\tqueue_free()\n\t\t\nfunc _exit_tree():\n\tvar explosion_instance = explosion.instance()\n\texplosion_instance.get_node(\"RegularPolygon\").size = get_node(\"RegularPolygon\").size\n\texplosion_instance.get_node(\"RegularPolygon\/Polygon2D\").set_color(get_node(\"RegularPolygon\/Polygon2D\").get_color())\n\tget_tree().get_root().add_child(explosion_instance)\n\texplosion_instance.set_global_pos(get_global_pos())","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"0887b43c0e04a862214da5f89b51cffc644cdc3c","subject":"more swearing","message":"more swearing\n","repos":"P1X-in\/boctok","old_file":"scripts\/entities\/player.gd","new_file":"scripts\/entities\/player.gd","new_contents":"extends \"res:\/\/scripts\/entities\/object.gd\"\n\nvar camera\nvar hud\nvar newspaper\n\nvar player_id\nvar gamepad_id = null\nvar keyboard_use = null\n\nvar gamepad_handlers = []\nvar keyboard_handlers = []\n\nvar boctok_template = preload(\"res:\/\/scenes\/ships\/ship.tscn\")\nvar mercury_template = preload(\"res:\/\/scenes\/ships\/mercury.tscn\")\n\nvar rocket_template = preload(\"res:\/\/scenes\/ships\/rocket.tscn\")\nvar rocket_cooldown = false\nvar swear_cooldown = false\nvar rocket_firing = false\nvar ROCKET_COOLDOWN_TIME = 0.1\nvar SWEAR_COOLDOWN_TIME = 2\n\nvar score = 0\n\nfunc _init(bag, player_id).(bag):\n self.bag = bag\n self.player_id = player_id\n if player_id == 0:\n self.avatar = self.boctok_template.instance()\n else:\n self.avatar = self.mercury_template.instance()\n self.avatar.player_id = player_id\n self.camera = self.avatar.get_node('camera')\n\n self.gamepad_handlers = [\n preload(\"res:\/\/scripts\/input\/handlers\/player_rotate_axis.gd\").new(self.bag, self, 0),\n #preload(\"res:\/\/scripts\/input\/handlers\/player_accelerate_axis.gd\").new(self.bag, self, 1),\n #preload(\"res:\/\/scripts\/input\/handlers\/player_accelerate_axis.gd\").new(self.bag, self, 3),\n preload(\"res:\/\/scripts\/input\/handlers\/player_accelerate_button.gd\").new(self.bag, self, JOY_BUTTON_0),\n preload(\"res:\/\/scripts\/input\/handlers\/player_boost_button.gd\").new(self.bag, self, JOY_BUTTON_1),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_button.gd\").new(self.bag, self, JOY_BUTTON_2),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_trigger.gd\").new(self.bag, self, 4),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_trigger.gd\").new(self.bag, self, 5),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_trigger.gd\").new(self.bag, self, 6),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_trigger.gd\").new(self.bag, self, 7),\n preload(\"res:\/\/scripts\/input\/handlers\/swear_button.gd\").new(self.bag, self, JOY_BUTTON_3),\n\n ]\n\n self.keyboard_handlers = [\n preload(\"res:\/\/scripts\/input\/handlers\/player_rotate_key.gd\").new(self.bag, self, KEY_LEFT, 1),\n preload(\"res:\/\/scripts\/input\/handlers\/player_rotate_key.gd\").new(self.bag, self, KEY_RIGHT, -1),\n preload(\"res:\/\/scripts\/input\/handlers\/player_accelerate_key.gd\").new(self.bag, self, KEY_UP),\n preload(\"res:\/\/scripts\/input\/handlers\/player_boost_key.gd\").new(self.bag, self, KEY_DOWN),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_key.gd\").new(self.bag, self, KEY_SPACE),\n preload(\"res:\/\/scripts\/input\/handlers\/swear_key.gd\").new(self.bag, self, KEY_B),\n ]\n\nfunc spawn(initial_position):\n self.attach()\n self.avatar.set_pos(initial_position)\n\nfunc attach():\n self.bag.processing.register(self)\n self.newspaper.hide()\n self.hud.show()\n .attach()\n\nfunc detach():\n self.bag.processing.remove(self)\n self.hud.hide()\n .detach()\n\nfunc bind_keyboard():\n var keyboard = self.bag.input.schemes['game']['keyboard']\n self.keyboard_use = true\n for handler in self.keyboard_handlers:\n keyboard.register_handler(handler)\nfunc unbind_keyboard():\n if not self.keyboard_use:\n return\n\n var keyboard = self.bag.input.schemes['game']['keyboard']\n self.keyboard_use = false\n for handler in self.keyboard_handlers:\n keyboard.remove_handler(handler)\n\nfunc bind_gamepad(id):\n self.unbind_gamepad()\n self.gamepad_id = id\n var gamepad = self.bag.input.schemes['game']['pad' + str(id)]\n\n for handler in self.gamepad_handlers:\n gamepad.register_handler(handler)\n\nfunc unbind_gamepad():\n if self.gamepad_id == null:\n return\n\n var gamepad = self.bag.input.schemes['game']['pad' + str(self.gamepad_id)]\n\n for handler in self.gamepad_handlers:\n gamepad.remove_handler(handler)\n\n self.gamepad_id = null\n\nfunc reset():\n self.rocket_cooldown = false\n self.rocket_firing = false\n self.avatar.reset()\n\nfunc bind_camera(viewport):\n self.camera.set_custom_viewport(viewport)\n\nfunc bind_hud(hud):\n self.hud = hud\n\nfunc bind_newspaper(newspaper):\n self.newspaper = newspaper\n\nfunc show_fail():\n self.newspaper.show()\n if self.player_id == 0:\n self.newspaper.get_node('nyt').hide()\n self.newspaper.get_node('pravda').show()\n else:\n self.newspaper.get_node('nyt').show()\n self.newspaper.get_node('pravda').hide()\n\nfunc process(delta):\n hud.update_sun_indicator(self.avatar.get_pos())\n hud.update_fuel(self.avatar.fuel)\n hud.update_gravity(self.avatar.current_gravity)\n hud.update_ship_velocity(self.avatar.current_acceleration)\n hud.update_score(self.score)\n\n if hud.update_sun_warning(self):\n self.swear()\n\n if self.rocket_firing and not self.rocket_cooldown:\n self.fire_rocket()\n\n\nfunc fire_rocket():\n if self.rocket_cooldown:\n return\n\n var rocket = self.rocket_template.instance()\n var position = self.avatar.get_pos()\n var starting_vector = Vector2(0, -1)\n starting_vector.x = ((randi() % 101) - 50) \/ 900.0\n var rocket_offset = starting_vector.rotated(self.avatar.rotation)\n var rocket_position = position + rocket_offset * 60\n\n rocket.initial_velocity = self.avatar.current_acceleration + rocket_offset * 500\n\n self.bag.board.attach_object(rocket)\n rocket.set_pos(rocket_position)\n rocket.set_rot(rocket.initial_velocity.angle() + 3.14)\n\n self.rocket_cooldown = true\n self.bag.timers.set_timeout(self.ROCKET_COOLDOWN_TIME, self, \"rocket_cooldown_done\")\n\n rocket.owner = self.player_id\n self.bag.sound.play('rocket_launch')\n\nfunc rocket_cooldown_done():\n self.rocket_cooldown = false\n\nfunc swear_cooldown_done():\n self.swear_cooldown = false\n\nfunc swear():\n if self.swear_cooldown:\n return\n\n randomize()\n var suffix\n var item\n if self.player_id == 0:\n suffix = \"ru_\"\n else:\n suffix = \"en_\"\n item = 'swear_' + suffix + str(randi() % 8 + 1)\n\n self.bag.sound.play(item)\n\n self.swear_cooldown = true\n self.bag.timers.set_timeout(self.SWEAR_COOLDOWN_TIME, self, \"swear_cooldown_done\")\n\n","old_contents":"extends \"res:\/\/scripts\/entities\/object.gd\"\n\nvar camera\nvar hud\nvar newspaper\n\nvar player_id\nvar gamepad_id = null\nvar keyboard_use = null\n\nvar gamepad_handlers = []\nvar keyboard_handlers = []\n\nvar boctok_template = preload(\"res:\/\/scenes\/ships\/ship.tscn\")\nvar mercury_template = preload(\"res:\/\/scenes\/ships\/mercury.tscn\")\n\nvar rocket_template = preload(\"res:\/\/scenes\/ships\/rocket.tscn\")\nvar rocket_cooldown = false\nvar swear_cooldown = false\nvar rocket_firing = false\nvar ROCKET_COOLDOWN_TIME = 0.1\nvar SWEAR_COOLDOWN_TIME = 2\n\nvar score = 0\n\nfunc _init(bag, player_id).(bag):\n self.bag = bag\n self.player_id = player_id\n if player_id == 0:\n self.avatar = self.boctok_template.instance()\n else:\n self.avatar = self.mercury_template.instance()\n self.avatar.player_id = player_id\n self.camera = self.avatar.get_node('camera')\n\n self.gamepad_handlers = [\n preload(\"res:\/\/scripts\/input\/handlers\/player_rotate_axis.gd\").new(self.bag, self, 0),\n #preload(\"res:\/\/scripts\/input\/handlers\/player_accelerate_axis.gd\").new(self.bag, self, 1),\n #preload(\"res:\/\/scripts\/input\/handlers\/player_accelerate_axis.gd\").new(self.bag, self, 3),\n preload(\"res:\/\/scripts\/input\/handlers\/player_accelerate_button.gd\").new(self.bag, self, JOY_BUTTON_0),\n preload(\"res:\/\/scripts\/input\/handlers\/player_boost_button.gd\").new(self.bag, self, JOY_BUTTON_1),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_button.gd\").new(self.bag, self, JOY_BUTTON_2),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_trigger.gd\").new(self.bag, self, 4),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_trigger.gd\").new(self.bag, self, 5),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_trigger.gd\").new(self.bag, self, 6),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_trigger.gd\").new(self.bag, self, 7),\n preload(\"res:\/\/scripts\/input\/handlers\/swear_button.gd\").new(self.bag, self, JOY_BUTTON_3),\n\n ]\n\n self.keyboard_handlers = [\n preload(\"res:\/\/scripts\/input\/handlers\/player_rotate_key.gd\").new(self.bag, self, KEY_LEFT, 1),\n preload(\"res:\/\/scripts\/input\/handlers\/player_rotate_key.gd\").new(self.bag, self, KEY_RIGHT, -1),\n preload(\"res:\/\/scripts\/input\/handlers\/player_accelerate_key.gd\").new(self.bag, self, KEY_UP),\n preload(\"res:\/\/scripts\/input\/handlers\/player_boost_key.gd\").new(self.bag, self, KEY_DOWN),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_key.gd\").new(self.bag, self, KEY_SPACE),\n preload(\"res:\/\/scripts\/input\/handlers\/swear_key.gd\").new(self.bag, self, KEY_B),\n ]\n\nfunc spawn(initial_position):\n self.attach()\n self.avatar.set_pos(initial_position)\n\nfunc attach():\n self.bag.processing.register(self)\n self.newspaper.hide()\n self.hud.show()\n .attach()\n\nfunc detach():\n self.bag.processing.remove(self)\n self.hud.hide()\n .detach()\n\nfunc bind_keyboard():\n var keyboard = self.bag.input.schemes['game']['keyboard']\n self.keyboard_use = true\n for handler in self.keyboard_handlers:\n keyboard.register_handler(handler)\nfunc unbind_keyboard():\n if not self.keyboard_use:\n return\n\n var keyboard = self.bag.input.schemes['game']['keyboard']\n self.keyboard_use = false\n for handler in self.keyboard_handlers:\n keyboard.remove_handler(handler)\n\nfunc bind_gamepad(id):\n self.unbind_gamepad()\n self.gamepad_id = id\n var gamepad = self.bag.input.schemes['game']['pad' + str(id)]\n\n for handler in self.gamepad_handlers:\n gamepad.register_handler(handler)\n\nfunc unbind_gamepad():\n if self.gamepad_id == null:\n return\n\n var gamepad = self.bag.input.schemes['game']['pad' + str(self.gamepad_id)]\n\n for handler in self.gamepad_handlers:\n gamepad.remove_handler(handler)\n\n self.gamepad_id = null\n\nfunc reset():\n self.rocket_cooldown = false\n self.rocket_firing = false\n self.avatar.reset()\n\nfunc bind_camera(viewport):\n self.camera.set_custom_viewport(viewport)\n\nfunc bind_hud(hud):\n self.hud = hud\n\nfunc bind_newspaper(newspaper):\n self.newspaper = newspaper\n\nfunc show_fail():\n self.newspaper.show()\n if self.player_id == 0:\n self.newspaper.get_node('nyt').hide()\n self.newspaper.get_node('pravda').show()\n else:\n self.newspaper.get_node('nyt').show()\n self.newspaper.get_node('pravda').hide()\n\nfunc process(delta):\n hud.update_sun_indicator(self.avatar.get_pos())\n hud.update_fuel(self.avatar.fuel)\n hud.update_gravity(self.avatar.current_gravity)\n hud.update_ship_velocity(self.avatar.current_acceleration)\n hud.update_score(self.score)\n\n if hud.update_sun_warning(self):\n self.swear()\n\n if self.rocket_firing and not self.rocket_cooldown:\n self.fire_rocket()\n\n\nfunc fire_rocket():\n if self.rocket_cooldown:\n return\n\n var rocket = self.rocket_template.instance()\n var position = self.avatar.get_pos()\n var starting_vector = Vector2(0, -1)\n starting_vector.x = ((randi() % 101) - 50) \/ 900.0\n var rocket_offset = starting_vector.rotated(self.avatar.rotation)\n var rocket_position = position + rocket_offset * 60\n\n rocket.initial_velocity = self.avatar.current_acceleration + rocket_offset * 500\n\n self.bag.board.attach_object(rocket)\n rocket.set_pos(rocket_position)\n rocket.set_rot(rocket.initial_velocity.angle() + 3.14)\n\n self.rocket_cooldown = true\n self.bag.timers.set_timeout(self.ROCKET_COOLDOWN_TIME, self, \"rocket_cooldown_done\")\n\n rocket.owner = self.player_id\n self.bag.sound.play('rocket_launch')\n\nfunc rocket_cooldown_done():\n self.rocket_cooldown = false\n\nfunc swear_cooldown_done():\n self.swear_cooldown = false\n\nfunc swear():\n if self.swear_cooldown:\n return\n\n randomize()\n var suffix\n var item \n if self.player_id == 0:\n suffix = \"ru_\"\n else:\n suffix = \"en_\"\n item = 'swear_' + suffix + str(randi() % 8 + 1)\n if self.bag.sound.can_play_sound():\n self.bag.sound.play(item)\n\n self.swear_cooldown = true\n self.bag.timers.set_timeout(self.SWEAR_COOLDOWN_TIME, self, \"swear_cooldown_done\")\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"50a5f23ae8a03af383aac92447f9743c1155c882","subject":"Some walls calibration","message":"Some walls calibration\n","repos":"w84death\/mountain-of-hope","old_file":"scripts\/map\/map.gd","new_file":"scripts\/map\/map.gd","new_contents":"\nvar bag\n\nvar segments = []\nvar last_visited_segment = -1\n\nvar SCREEN_WIDTH = Globals.get(\"display\/width\")\nvar SCREEN_HEIGHT = Globals.get(\"display\/height\")\nvar SCREEN_MARGIN = 200\n\nvar SEGMENT_SIZE = 60\nvar SEGMENT_LINE_HEIGHT = 36\n\nvar WALL_HEIGHT = 39\nvar WALL_HALF_WIDTH = 20\n\nvar platforms = {\n 'grass' : [\n { 'width' : 100, 'template' : preload('res:\/\/scenes\/map\/platform_grass_big.xscn') },\n { 'width' : 100, 'template' : preload('res:\/\/scenes\/map\/platform_grass_medium.xscn') },\n { 'width' : 100, 'template' : preload('res:\/\/scenes\/map\/platform_grass_small.xscn') }\n ],\n 'ice' : [\n { 'width' : 100, 'template' : preload('res:\/\/scenes\/map\/platform_ice_big.xscn') },\n { 'width' : 100, 'template' : preload('res:\/\/scenes\/map\/platform_ice_medium.xscn') },\n { 'width' : 100, 'template' : preload('res:\/\/scenes\/map\/platform_ice_small.xscn') }\n ]\n}\n\n\nvar left_wall_template = preload('res:\/\/scenes\/map\/wall_left.xscn')\nvar right_wall_template = preload('res:\/\/scenes\/map\/wall_right.xscn')\nvar separator_template = preload('res:\/\/scenes\/map\/base_platform.xscn')\nvar playable_width = 0\n\n\nfunc _init_bag(bag):\n self.bag = bag\n self.SCREEN_MARGIN = int((self.SCREEN_WIDTH - 900) \/ 2)\n self.playable_width = self.SCREEN_WIDTH - (self.SCREEN_MARGIN * 2)\n self.reset_map()\n\nfunc reset_map():\n for segment in self.segments:\n self.destroy_unused_segment(segment)\n self.segments.clear()\n\n\nfunc generate_next_map_segment():\n var next_segment_index = self.segments.size()\n\n var new_segment = []\n\n new_segment = self.add_walls(new_segment)\n new_segment = self.add_separator(new_segment)\n new_segment = self.add_platforms(new_segment, next_segment_index)\n\n self.segments.append(new_segment)\n self.apply_segment(next_segment_index)\n self.destroy_unused_segment_by_id(next_segment_index - 3)\n\nfunc apply_segment(id):\n var segment_offset = id * self.SEGMENT_SIZE * self.SEGMENT_LINE_HEIGHT\n for object in self.segments[id]:\n self.bag.action_controller.attach_object(object.object)\n object.object.set_global_pos(Vector2(object.x, -object.y - segment_offset))\n\nfunc destroy_unused_segment_by_id(id):\n if id < 0:\n return\n\n self.destroy_unused_segment(self.segments[id])\n\nfunc destroy_unused_segment(segment):\n for object in segment:\n self.bag.action_controller.detach_object(object.object)\n object.object.queue_free()\n\n segment.clear()\n\nfunc add_segment_object(segment, x, y, object):\n segment.append({\n 'x' : x,\n 'y' : y,\n 'object' : object\n })\n\n return segment\n\nfunc add_separator(segment):\n var separator_platform = self.separator_template.instance()\n var vertical_position = self.SCREEN_WIDTH \/ 2 - 640\n segment = self.add_segment_object(segment, vertical_position, self.SEGMENT_LINE_HEIGHT, separator_platform)\n return segment\n\nfunc add_walls(segment):\n var height = 0\n var left_wall\n var right_wall\n var wall_offset\n var real_height\n\n while height < self.SEGMENT_SIZE:\n left_wall = self.left_wall_template.instance()\n right_wall = self.right_wall_template.instance()\n\n wall_offset = self.SCREEN_MARGIN + self.WALL_HALF_WIDTH\n real_height = (height + self.WALL_HEIGHT \/ 2) * self.SEGMENT_LINE_HEIGHT\n segment = self.add_segment_object(segment, wall_offset, real_height, left_wall)\n segment = self.add_segment_object(segment, wall_offset + self.playable_width + self.WALL_HALF_WIDTH * 2, real_height, right_wall)\n\n height = height + self.WALL_HEIGHT\n return segment\n\nfunc update_segments(player_height):\n var segment_height = self.SEGMENT_SIZE * self.SEGMENT_LINE_HEIGHT\n var overflow = player_height % segment_height\n\n var segment_num = (player_height - overflow) \/ segment_height\n\n if overflow > 100 && segment_num > self.last_visited_segment:\n self.last_visited_segment = segment_num\n self.generate_next_map_segment()\n\nfunc add_platforms(segment, index):\n var iterator = 2\n var last_iterator = 0\n\n var templates\n if index < 3:\n templates = self.platforms.grass\n else:\n templates = self.platforms.ice\n\n randomize()\n\n while iterator < self.SEGMENT_SIZE - 2:\n segment = self.generate_single_platform(segment, iterator, templates)\n\n last_iterator = iterator\n\n if randi() % 10 == 0:\n iterator = iterator + 5\n else:\n iterator = iterator + 4\n\n if last_iterator < self.SEGMENT_SIZE - 4:\n segment = self.generate_single_platform(segment, self.SEGMENT_SIZE - 2, templates)\n\n return segment\n\nfunc generate_single_platform(segment, iterator, templates):\n var template = templates[randi() % 2]\n var new_platform = template.template.instance()\n\n var horizontal_position = randi() % (self.playable_width - template.width)\n horizontal_position = horizontal_position + self.SCREEN_MARGIN + int(template.width \/ 2)\n\n segment = self.add_segment_object(segment, horizontal_position, (iterator + 1) * self.SEGMENT_LINE_HEIGHT, new_platform)\n\n var offset = self.SCREEN_WIDTH \/ 2 - horizontal_position\n if abs(offset) > 100 && (randi() % 2 == 0):\n new_platform = templates[2].template.instance()\n horizontal_position = self.SCREEN_WIDTH \/ 2 + offset\n\n segment = self.add_segment_object(segment, horizontal_position, (iterator + 1) * self.SEGMENT_LINE_HEIGHT, new_platform)\n\n return segment","old_contents":"\nvar bag\n\nvar segments = []\nvar last_visited_segment = -1\n\nvar SCREEN_WIDTH = Globals.get(\"display\/width\")\nvar SCREEN_HEIGHT = Globals.get(\"display\/height\")\nvar SCREEN_MARGIN = 200\n\nvar SEGMENT_SIZE = 60\nvar SEGMENT_LINE_HEIGHT = 36\n\nvar WALL_HEIGHT = 39\nvar WALL_HALF_WIDTH = 36\n\nvar platforms = {\n 'grass' : [\n { 'width' : 100, 'template' : preload('res:\/\/scenes\/map\/platform_grass_big.xscn') },\n { 'width' : 100, 'template' : preload('res:\/\/scenes\/map\/platform_grass_medium.xscn') },\n { 'width' : 100, 'template' : preload('res:\/\/scenes\/map\/platform_grass_small.xscn') }\n ],\n 'ice' : [\n { 'width' : 100, 'template' : preload('res:\/\/scenes\/map\/platform_ice_big.xscn') },\n { 'width' : 100, 'template' : preload('res:\/\/scenes\/map\/platform_ice_medium.xscn') },\n { 'width' : 100, 'template' : preload('res:\/\/scenes\/map\/platform_ice_small.xscn') }\n ]\n}\n\n\nvar left_wall_template = preload('res:\/\/scenes\/map\/wall_left.xscn')\nvar right_wall_template = preload('res:\/\/scenes\/map\/wall_right.xscn')\nvar separator_template = preload('res:\/\/scenes\/map\/base_platform.xscn')\nvar playable_width = 0\n\n\nfunc _init_bag(bag):\n self.bag = bag\n self.SCREEN_MARGIN = int((self.SCREEN_WIDTH - 900) \/ 2)\n self.playable_width = self.SCREEN_WIDTH - (self.SCREEN_MARGIN * 2)\n self.reset_map()\n\nfunc reset_map():\n for segment in self.segments:\n self.destroy_unused_segment(segment)\n self.segments.clear()\n\n\nfunc generate_next_map_segment():\n var next_segment_index = self.segments.size()\n\n var new_segment = []\n\n new_segment = self.add_walls(new_segment)\n new_segment = self.add_separator(new_segment)\n new_segment = self.add_platforms(new_segment, next_segment_index)\n\n self.segments.append(new_segment)\n self.apply_segment(next_segment_index)\n self.destroy_unused_segment_by_id(next_segment_index - 3)\n\nfunc apply_segment(id):\n var segment_offset = id * self.SEGMENT_SIZE * self.SEGMENT_LINE_HEIGHT\n for object in self.segments[id]:\n self.bag.action_controller.attach_object(object.object)\n object.object.set_global_pos(Vector2(object.x, -object.y - segment_offset))\n\nfunc destroy_unused_segment_by_id(id):\n if id < 0:\n return\n\n self.destroy_unused_segment(self.segments[id])\n\nfunc destroy_unused_segment(segment):\n for object in segment:\n self.bag.action_controller.detach_object(object.object)\n object.object.queue_free()\n\n segment.clear()\n\nfunc add_segment_object(segment, x, y, object):\n segment.append({\n 'x' : x,\n 'y' : y,\n 'object' : object\n })\n\n return segment\n\nfunc add_separator(segment):\n var separator_platform = self.separator_template.instance()\n var vertical_position = self.SCREEN_WIDTH \/ 2 - 640\n segment = self.add_segment_object(segment, vertical_position, self.SEGMENT_LINE_HEIGHT, separator_platform)\n return segment\n\nfunc add_walls(segment):\n var height = 0\n var left_wall\n var right_wall\n var wall_offset\n var real_height\n\n while height < self.SEGMENT_SIZE:\n left_wall = self.left_wall_template.instance()\n right_wall = self.right_wall_template.instance()\n\n wall_offset = self.SCREEN_MARGIN - self.WALL_HALF_WIDTH\n real_height = (height + self.WALL_HEIGHT \/ 2) * self.SEGMENT_LINE_HEIGHT\n segment = self.add_segment_object(segment, wall_offset, real_height, left_wall)\n segment = self.add_segment_object(segment, wall_offset + self.playable_width + self.WALL_HALF_WIDTH * 2, real_height, right_wall)\n\n height = height + self.WALL_HEIGHT\n return segment\n\nfunc update_segments(player_height):\n var segment_height = self.SEGMENT_SIZE * self.SEGMENT_LINE_HEIGHT\n var overflow = player_height % segment_height\n\n var segment_num = (player_height - overflow) \/ segment_height\n\n if overflow > 100 && segment_num > self.last_visited_segment:\n self.last_visited_segment = segment_num\n self.generate_next_map_segment()\n\nfunc add_platforms(segment, index):\n var iterator = 2\n var last_iterator = 0\n\n var templates\n if index < 3:\n templates = self.platforms.grass\n else:\n templates = self.platforms.ice\n\n randomize()\n\n while iterator < self.SEGMENT_SIZE - 2:\n segment = self.generate_single_platform(segment, iterator, templates)\n\n last_iterator = iterator\n\n if randi() % 10 == 0:\n iterator = iterator + 5\n else:\n iterator = iterator + 4\n\n if last_iterator < self.SEGMENT_SIZE - 4:\n segment = self.generate_single_platform(segment, self.SEGMENT_SIZE - 2, templates)\n\n return segment\n\nfunc generate_single_platform(segment, iterator, templates):\n var template = templates[randi() % 2]\n var new_platform = template.template.instance()\n\n var horizontal_position = randi() % (self.playable_width - template.width)\n horizontal_position = horizontal_position + self.SCREEN_MARGIN + int(template.width \/ 2)\n\n segment = self.add_segment_object(segment, horizontal_position, (iterator + 1) * self.SEGMENT_LINE_HEIGHT, new_platform)\n\n var offset = self.SCREEN_WIDTH \/ 2 - horizontal_position\n if abs(offset) > 100 && (randi() % 2 == 0):\n new_platform = templates[2].template.instance()\n horizontal_position = self.SCREEN_WIDTH \/ 2 + offset\n\n segment = self.add_segment_object(segment, horizontal_position, (iterator + 1) * self.SEGMENT_LINE_HEIGHT, new_platform)\n\n return segment","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"c1026665409b58c882b5686edb67b46775765b41","subject":"Randomized shot deviation","message":"Randomized shot deviation\n","repos":"P1X-in\/boctok","old_file":"scripts\/entities\/player.gd","new_file":"scripts\/entities\/player.gd","new_contents":"extends \"res:\/\/scripts\/entities\/object.gd\"\n\nvar camera\nvar hud\n\nvar player_id\nvar gamepad_id = null\nvar keyboard_use = null\n\nvar gamepad_handlers = []\nvar keyboard_handlers = []\n\nvar boctok_template = preload(\"res:\/\/scenes\/ships\/ship.tscn\")\nvar mercury_template = preload(\"res:\/\/scenes\/ships\/mercury.tscn\")\n\nvar rocket_template = preload(\"res:\/\/scenes\/ships\/rocket.tscn\")\nvar rocket_cooldown = false\nvar rocket_firing = false\nvar ROCKET_COOLDOWN_TIME = 0.1\n\nfunc _init(bag, player_id).(bag):\n self.bag = bag\n self.player_id = player_id\n if player_id == 0:\n self.avatar = self.boctok_template.instance()\n else:\n self.avatar = self.mercury_template.instance()\n self.camera = self.avatar.get_node('camera')\n\n self.gamepad_handlers = [\n preload(\"res:\/\/scripts\/input\/handlers\/player_rotate_axis.gd\").new(self.bag, self, 0),\n #preload(\"res:\/\/scripts\/input\/handlers\/player_accelerate_axis.gd\").new(self.bag, self, 1),\n #preload(\"res:\/\/scripts\/input\/handlers\/player_accelerate_axis.gd\").new(self.bag, self, 3),\n preload(\"res:\/\/scripts\/input\/handlers\/player_accelerate_button.gd\").new(self.bag, self, JOY_BUTTON_0),\n preload(\"res:\/\/scripts\/input\/handlers\/player_boost_button.gd\").new(self.bag, self, JOY_BUTTON_1),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_button.gd\").new(self.bag, self, JOY_BUTTON_2),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_trigger.gd\").new(self.bag, self, 4),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_trigger.gd\").new(self.bag, self, 5),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_trigger.gd\").new(self.bag, self, 6),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_trigger.gd\").new(self.bag, self, 7),\n ]\n\n self.keyboard_handlers = [\n preload(\"res:\/\/scripts\/input\/handlers\/player_rotate_key.gd\").new(self.bag, self, KEY_LEFT, 1),\n preload(\"res:\/\/scripts\/input\/handlers\/player_rotate_key.gd\").new(self.bag, self, KEY_RIGHT, -1),\n preload(\"res:\/\/scripts\/input\/handlers\/player_accelerate_key.gd\").new(self.bag, self, KEY_UP),\n preload(\"res:\/\/scripts\/input\/handlers\/player_boost_key.gd\").new(self.bag, self, KEY_DOWN),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_key.gd\").new(self.bag, self, KEY_SPACE),\n ]\n\nfunc spawn(initial_position):\n self.attach()\n self.avatar.set_pos(initial_position)\n\nfunc attach():\n self.bag.processing.register(self)\n .attach()\n\nfunc detach():\n self.bag.processing.remove(self)\n .detach()\n\nfunc bind_keyboard():\n var keyboard = self.bag.input.schemes['game']['keyboard']\n self.keyboard_use = true\n for handler in self.keyboard_handlers:\n keyboard.register_handler(handler)\nfunc unbind_keyboard():\n if not self.keyboard_use:\n return\n\n var keyboard = self.bag.input.schemes['game']['keyboard']\n self.keyboard_use = false\n for handler in self.keyboard_handlers:\n keyboard.remove_handler(handler)\n\nfunc bind_gamepad(id):\n self.unbind_gamepad()\n self.gamepad_id = id\n var gamepad = self.bag.input.schemes['game']['pad' + str(id)]\n\n for handler in self.gamepad_handlers:\n gamepad.register_handler(handler)\n\nfunc unbind_gamepad():\n if self.gamepad_id == null:\n return\n\n var gamepad = self.bag.input.schemes['game']['pad' + str(self.gamepad_id)]\n\n for handler in self.gamepad_handlers:\n gamepad.remove_handler(handler)\n\n self.gamepad_id = null\n\nfunc reset():\n self.rocket_cooldown = false\n self.rocket_firing = false\n self.avatar.reset()\n\nfunc bind_camera(viewport):\n self.camera.set_custom_viewport(viewport)\n\nfunc bind_hud(hud):\n self.hud = hud\n\nfunc process(delta):\n hud.update_sun_indicator(self.avatar.get_pos())\n hud.update_fuel(self.avatar.fuel)\n hud.update_gravity(self.avatar.current_gravity)\n hud.update_ship_velocity(self.avatar.current_acceleration)\n hud.update_sun_warning(self)\n\n if self.rocket_firing and not self.rocket_cooldown:\n self.fire_rocket()\n\n\nfunc fire_rocket():\n if self.rocket_cooldown:\n return\n\n var rocket = self.rocket_template.instance()\n var position = self.avatar.get_pos()\n var starting_vector = Vector2(0, -1)\n starting_vector.x = ((randi() % 101) - 50) \/ 900.0\n print(starting_vector)\n var rocket_offset = starting_vector.rotated(self.avatar.rotation)\n var rocket_position = position + rocket_offset * 60\n\n rocket.initial_velocity = self.avatar.current_acceleration + rocket_offset * 500\n\n self.bag.board.attach_object(rocket)\n rocket.set_pos(rocket_position)\n rocket.set_rot(rocket.initial_velocity.angle() + 3.14)\n\n self.rocket_cooldown = true\n self.bag.timers.set_timeout(self.ROCKET_COOLDOWN_TIME, self, \"rocket_cooldown_done\")\n\nfunc rocket_cooldown_done():\n self.rocket_cooldown = false\n","old_contents":"extends \"res:\/\/scripts\/entities\/object.gd\"\n\nvar camera\nvar hud\n\nvar player_id\nvar gamepad_id = null\nvar keyboard_use = null\n\nvar gamepad_handlers = []\nvar keyboard_handlers = []\n\nvar boctok_template = preload(\"res:\/\/scenes\/ships\/ship.tscn\")\nvar mercury_template = preload(\"res:\/\/scenes\/ships\/mercury.tscn\")\n\nvar rocket_template = preload(\"res:\/\/scenes\/ships\/rocket.tscn\")\nvar rocket_cooldown = false\nvar rocket_firing = false\nvar ROCKET_COOLDOWN_TIME = 0.1\n\nfunc _init(bag, player_id).(bag):\n self.bag = bag\n self.player_id = player_id\n if player_id == 0:\n self.avatar = self.boctok_template.instance()\n else:\n self.avatar = self.mercury_template.instance()\n self.camera = self.avatar.get_node('camera')\n\n self.gamepad_handlers = [\n preload(\"res:\/\/scripts\/input\/handlers\/player_rotate_axis.gd\").new(self.bag, self, 0),\n #preload(\"res:\/\/scripts\/input\/handlers\/player_accelerate_axis.gd\").new(self.bag, self, 1),\n #preload(\"res:\/\/scripts\/input\/handlers\/player_accelerate_axis.gd\").new(self.bag, self, 3),\n preload(\"res:\/\/scripts\/input\/handlers\/player_accelerate_button.gd\").new(self.bag, self, JOY_BUTTON_0),\n preload(\"res:\/\/scripts\/input\/handlers\/player_boost_button.gd\").new(self.bag, self, JOY_BUTTON_1),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_button.gd\").new(self.bag, self, JOY_BUTTON_2),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_trigger.gd\").new(self.bag, self, 4),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_trigger.gd\").new(self.bag, self, 5),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_trigger.gd\").new(self.bag, self, 6),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_trigger.gd\").new(self.bag, self, 7),\n ]\n\n self.keyboard_handlers = [\n preload(\"res:\/\/scripts\/input\/handlers\/player_rotate_key.gd\").new(self.bag, self, KEY_LEFT, 1),\n preload(\"res:\/\/scripts\/input\/handlers\/player_rotate_key.gd\").new(self.bag, self, KEY_RIGHT, -1),\n preload(\"res:\/\/scripts\/input\/handlers\/player_accelerate_key.gd\").new(self.bag, self, KEY_UP),\n preload(\"res:\/\/scripts\/input\/handlers\/player_boost_key.gd\").new(self.bag, self, KEY_DOWN),\n preload(\"res:\/\/scripts\/input\/handlers\/rocket_launch_key.gd\").new(self.bag, self, KEY_SPACE),\n ]\n\nfunc spawn(initial_position):\n self.attach()\n self.avatar.set_pos(initial_position)\n\nfunc attach():\n self.bag.processing.register(self)\n .attach()\n\nfunc detach():\n self.bag.processing.remove(self)\n .detach()\n\nfunc bind_keyboard():\n var keyboard = self.bag.input.schemes['game']['keyboard']\n self.keyboard_use = true\n for handler in self.keyboard_handlers:\n keyboard.register_handler(handler)\nfunc unbind_keyboard():\n if not self.keyboard_use:\n return\n\n var keyboard = self.bag.input.schemes['game']['keyboard']\n self.keyboard_use = false\n for handler in self.keyboard_handlers:\n keyboard.remove_handler(handler)\n\nfunc bind_gamepad(id):\n self.unbind_gamepad()\n self.gamepad_id = id\n var gamepad = self.bag.input.schemes['game']['pad' + str(id)]\n\n for handler in self.gamepad_handlers:\n gamepad.register_handler(handler)\n\nfunc unbind_gamepad():\n if self.gamepad_id == null:\n return\n\n var gamepad = self.bag.input.schemes['game']['pad' + str(self.gamepad_id)]\n\n for handler in self.gamepad_handlers:\n gamepad.remove_handler(handler)\n\n self.gamepad_id = null\n\nfunc reset():\n self.rocket_cooldown = false\n self.rocket_firing = false\n self.avatar.reset()\n\nfunc bind_camera(viewport):\n self.camera.set_custom_viewport(viewport)\n\nfunc bind_hud(hud):\n self.hud = hud\n\nfunc process(delta):\n hud.update_sun_indicator(self.avatar.get_pos())\n hud.update_fuel(self.avatar.fuel)\n hud.update_gravity(self.avatar.current_gravity)\n hud.update_ship_velocity(self.avatar.current_acceleration)\n hud.update_sun_warning(self)\n\n if self.rocket_firing and not self.rocket_cooldown:\n self.fire_rocket()\n\n\nfunc fire_rocket():\n if self.rocket_cooldown:\n return\n\n var rocket = self.rocket_template.instance()\n var position = self.avatar.get_pos()\n var rocket_offset = Vector2(0, -1).rotated(self.avatar.rotation)\n var rocket_position = position + rocket_offset * 60\n\n rocket.initial_velocity = self.avatar.current_acceleration + rocket_offset * 500\n\n self.bag.board.attach_object(rocket)\n rocket.set_pos(rocket_position)\n rocket.set_rot(rocket.initial_velocity.angle() + 3.14)\n\n self.rocket_cooldown = true\n self.bag.timers.set_timeout(self.ROCKET_COOLDOWN_TIME, self, \"rocket_cooldown_done\")\n\nfunc rocket_cooldown_done():\n self.rocket_cooldown = false\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"e2cea0fabefd3543011510977e47c7636702e7aa","subject":"Smaller vibrations","message":"Smaller vibrations\n","repos":"P1X-in\/boctok","old_file":"scripts\/entities\/rocket.gd","new_file":"scripts\/entities\/rocket.gd","new_contents":"extends RigidBody2D\n\nvar bag\nvar ship = preload(\"res:\/\/scripts\/ship.gd\")\n\nvar GRAVITY_FACTOR = 100000000000\n\nvar current_acceleration = Vector2(0, 0)\nvar current_gravity = Vector2(0, 0)\n\nvar initial_velocity = Vector2(0, 0)\nvar started = false\n\nvar engines = []\n\nvar owner\n\n\nfunc _integrate_forces(s):\n var pos = self.get_pos()\n\n if pos.distance_to(Vector2(5000, 5000)) > 3000:\n self.queue_free()\n\n var lv = s.get_linear_velocity()\n var step = s.get_step()\n\n var engines_on = {\"Main\" : true, \"Left\": false, \"Right\" : false}\n\n self.set_rot(lv.angle() + 3.14)\n\n self.current_gravity = s.get_total_gravity() * step * self.GRAVITY_FACTOR\n lv += self.current_gravity\n self.current_acceleration = lv\n\n if not self.started:\n lv += self.initial_velocity\n self.started = true\n\n s.set_linear_velocity(lv)\n self.__engines_start(engines_on)\n\nfunc _colliding_body(body):\n if body extends self.ship and body.player_id != self.owner:\n self.bag.players.players[self.owner].score += 10\n\n if body extends self.ship:\n var device_id = self.bag.players.players[body.player_id].gamepad_id\n Input.start_joy_vibration(device_id, 0.5, 0, 0.2)\n self.bag.players.players[body.player_id].swear()\n\n self.bag.sound.play('rocket_bang')\n self.bag.board.add_explosion(self.get_pos())\n self.queue_free()\n\nfunc __engines_start(engines):\n for engine in engines:\n if engines[engine] == true:\n self.engines[engine].set_emitting(true)\n\nfunc _ready():\n self.bag = self.get_node(\"\/root\/boctok\").bag\n set_fixed_process(true)\n var engines = self.get_node(\"Engines\")\n self.engines = {\n \"Main\" : engines.get_node(\"Main\"),\n \"Left\" : engines.get_node(\"Left\"),\n \"Right\" : engines.get_node(\"Right\"),\n }\n","old_contents":"extends RigidBody2D\n\nvar bag\nvar ship = preload(\"res:\/\/scripts\/ship.gd\")\n\nvar GRAVITY_FACTOR = 100000000000\n\nvar current_acceleration = Vector2(0, 0)\nvar current_gravity = Vector2(0, 0)\n\nvar initial_velocity = Vector2(0, 0)\nvar started = false\n\nvar engines = []\n\nvar owner\n\n\nfunc _integrate_forces(s):\n var pos = self.get_pos()\n\n if pos.distance_to(Vector2(5000, 5000)) > 3000:\n self.queue_free()\n\n var lv = s.get_linear_velocity()\n var step = s.get_step()\n\n var engines_on = {\"Main\" : true, \"Left\": false, \"Right\" : false}\n\n self.set_rot(lv.angle() + 3.14)\n\n self.current_gravity = s.get_total_gravity() * step * self.GRAVITY_FACTOR\n lv += self.current_gravity\n self.current_acceleration = lv\n\n if not self.started:\n lv += self.initial_velocity\n self.started = true\n\n s.set_linear_velocity(lv)\n self.__engines_start(engines_on)\n\nfunc _colliding_body(body):\n if body extends self.ship and body.player_id != self.owner:\n self.bag.players.players[self.owner].score += 10\n\n if body extends self.ship:\n var device_id = self.bag.players.players[body.player_id].gamepad_id\n Input.start_joy_vibration(device_id, 1, 0)\n self.bag.timers.set_timeout(0.2, Input, 'stop_joy_vibration', [device_id])\n self.bag.players.players[body.player_id].swear()\n\n self.bag.sound.play('rocket_bang')\n self.bag.board.add_explosion(self.get_pos())\n self.queue_free()\n\nfunc __engines_start(engines):\n for engine in engines:\n if engines[engine] == true:\n self.engines[engine].set_emitting(true)\n\nfunc _ready():\n self.bag = self.get_node(\"\/root\/boctok\").bag\n set_fixed_process(true)\n var engines = self.get_node(\"Engines\")\n self.engines = {\n \"Main\" : engines.get_node(\"Main\"),\n \"Left\" : engines.get_node(\"Left\"),\n \"Right\" : engines.get_node(\"Right\"),\n }\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"2516cbb96783d74111bcc234131cd276790e03fe","subject":"Hide the player sprite if the game is over and show after the game is start","message":"Hide the player sprite if the game is over and show after the game is start\n","repos":"CSaratakij\/jam-2016-remake","old_file":"src\/player\/player.gd","new_file":"src\/player\/player.gd","new_contents":"\nextends KinematicBody2D\n\nconst GRAVITY = 1000.0\nconst MOVE_SPEED = 260.0\nconst JUMP_FORCE = 230.0\nconst POINT = 1\nconst INIT_MOVE_DIRECTION = Vector2(1, 1)\n\nvar _velocity = Vector2()\nvar _motion = Vector2()\nvar is_grounded = false\nvar score = 0\nvar start_points = [\n\t\tMatrix32(0.0, Vector2(0, 80)),\n\t\tMatrix32(0.0, Vector2(715, 220)),\n\t\tMatrix32(0.0, Vector2(0, 360))\n\t]\n\nvar _move_direction = INIT_MOVE_DIRECTION\nvar current_floor = 1\n\nonready var tree = get_tree()\nonready var root = tree.get_root()\nonready var _sprite = get_node(\"Sprite\")\nonready var _raycast = get_node(\"RayCast2D\")\nonready var _health = get_node(\"health\")\nonready var global = root.get_node(\"\/root\/global\")\n\nfunc _ready():\n\tset_process(true)\n\tset_fixed_process(true)\n\nfunc _process(delta):\n\tif global.is_game_over():\n\t\t_sprite.hide()\n\telse:\n\t\t_sprite.show()\n\nfunc _fixed_process(delta):\n\tis_grounded = _raycast.is_colliding()\n\t_velocity.y += _move_direction.y * GRAVITY * delta\n\t\n\tif not global.is_game_over():\n\t\t_velocity.x = _move_direction.x * MOVE_SPEED\n\telse:\n\t\t_velocity.x = 0.0\n\t\n\tif is_grounded:\n\t\tif Input.is_action_pressed(\"jump\"):\n\t\t\t_velocity.y = -JUMP_FORCE\n\t\n#\tif OS.has_touchscreen_ui_hint():\n#\t\tpass\n#\t\t#Jump by touch screen\n#\telse:\n#\t\tpass\n#\t\t#Jump by keyboard or mouse\n\t\n\t_motion = _velocity * delta\n\t_motion = move(_motion)\n\t\n\tif is_colliding():\n\t\tvar n = get_collision_normal()\n\t\t_motion = n.slide(_motion)\n\t\t_velocity = n.slide(_velocity)\n\t\tmove(_motion)\n\nfunc change_move_direction_h():\n\t_move_direction.x *= -1\n\nfunc reset_move_direction():\n\t_move_direction = INIT_MOVE_DIRECTION\n\nfunc _on_Area2D_area_enter( area ):\n\tif area.get_groups()[0] == \"switch_side_trigger\":\n\t\tglobal.add_score(POINT)\n\t\t\n\t\tif area.get_name() == \"floor1-2\":\n\t\t\tcurrent_floor = 2\n\t\t\tset_transform(start_points[current_floor - 1])\n\t\t\tchange_move_direction_h()\n\t\t\t_sprite.set_flip_h(true)\n\t\t\n\t\telif area.get_name() == \"floor2-3\":\n\t\t\tcurrent_floor = 3\n\t\t\tset_transform(start_points[current_floor - 1])\n\t\t\tchange_move_direction_h()\n\t\t\t_sprite.set_flip_h(false)\n\t\t\n\t\telif area.get_name() == \"floor3-1\":\n\t\t\tcurrent_floor = 1\n\t\t\tset_transform(start_points[current_floor - 1])\n\n\nfunc _on_Area2D_body_enter( body ):\n\tif body.get_groups()[0] == \"totem\":\n\t\t_health.remove(1)\n\t\tset_transform(start_points[current_floor - 1])","old_contents":"\nextends KinematicBody2D\n\nconst GRAVITY = 1000.0\nconst MOVE_SPEED = 260.0\nconst JUMP_FORCE = 230.0\nconst POINT = 1\nconst INIT_MOVE_DIRECTION = Vector2(1, 1)\n\nvar _velocity = Vector2()\nvar _motion = Vector2()\nvar is_grounded = false\nvar score = 0\nvar start_points = [\n\t\tMatrix32(0.0, Vector2(0, 80)),\n\t\tMatrix32(0.0, Vector2(715, 220)),\n\t\tMatrix32(0.0, Vector2(0, 360))\n\t]\n\nvar _move_direction = INIT_MOVE_DIRECTION\nvar current_floor = 1\n\nonready var tree = get_tree()\nonready var root = tree.get_root()\nonready var _sprite = get_node(\"Sprite\")\nonready var _raycast = get_node(\"RayCast2D\")\nonready var _health = get_node(\"health\")\nonready var global = root.get_node(\"\/root\/global\")\n\nfunc _ready():\n\tset_fixed_process(true)\n\nfunc _fixed_process(delta):\n\tis_grounded = _raycast.is_colliding()\n\t_velocity.y += _move_direction.y * GRAVITY * delta\n\t\n\tif not global.is_game_over():\n\t\t_velocity.x = _move_direction.x * MOVE_SPEED\n\telse:\n\t\t_velocity.x = 0.0\n\t\n\tif is_grounded:\n\t\tif Input.is_action_pressed(\"jump\"):\n\t\t\t_velocity.y = -JUMP_FORCE\n\t\n#\tif OS.has_touchscreen_ui_hint():\n#\t\tpass\n#\t\t#Jump by touch screen\n#\telse:\n#\t\tpass\n#\t\t#Jump by keyboard or mouse\n\t\n\t_motion = _velocity * delta\n\t_motion = move(_motion)\n\t\n\tif is_colliding():\n\t\tvar n = get_collision_normal()\n\t\t_motion = n.slide(_motion)\n\t\t_velocity = n.slide(_velocity)\n\t\tmove(_motion)\n\nfunc change_move_direction_h():\n\t_move_direction.x *= -1\n\nfunc reset_move_direction():\n\t_move_direction = INIT_MOVE_DIRECTION\n\nfunc _on_Area2D_area_enter( area ):\n\tif area.get_groups()[0] == \"switch_side_trigger\":\n\t\tglobal.add_score(POINT)\n\t\t\n\t\tif area.get_name() == \"floor1-2\":\n\t\t\tcurrent_floor = 2\n\t\t\tset_transform(start_points[current_floor - 1])\n\t\t\tchange_move_direction_h()\n\t\t\t_sprite.set_flip_h(true)\n\t\t\n\t\telif area.get_name() == \"floor2-3\":\n\t\t\tcurrent_floor = 3\n\t\t\tset_transform(start_points[current_floor - 1])\n\t\t\tchange_move_direction_h()\n\t\t\t_sprite.set_flip_h(false)\n\t\t\n\t\telif area.get_name() == \"floor3-1\":\n\t\t\tcurrent_floor = 1\n\t\t\tset_transform(start_points[current_floor - 1])\n\n\nfunc _on_Area2D_body_enter( body ):\n\tif body.get_groups()[0] == \"totem\":\n\t\t_health.remove(1)\n\t\tset_transform(start_points[current_floor - 1])","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"583e49e6c67dd976080a0ada8e493cf12e56677c","subject":"Testing","message":"Testing\n","repos":"RedPandaStudio\/Experiment1","old_file":"Scripts\/Ball.gd","new_file":"Scripts\/Ball.gd","new_contents":"extends RigidBody2D\n\nexport var SPEEDUP = 4\nconst MAXSPEED = 800\n\nvar number_bricks = 0\n\nfunc _ready():\n\tset_fixed_process(true);\n\t\nfunc _fixed_process(delta):\n\tvar bodies = get_colliding_bodies()\n\t\n\tfor body in bodies:\n\t\tif body.is_in_group(\"Bricks\"):\n\t\t\tget_node(\"\/root\/World\").score += 420\n\t\t\tget_node(\"Horn\").play(\"horn\")\n\t\t\tbody.queue_free()\n\t\t\tnumber_bricks += 1\n\t\t\n\t\tif body.get_name() == \"Paddle\":\n\t\t\tvar speed = get_linear_velocity().length()\n\t\t\tvar direction = get_pos() - body.get_node(\"Anchor\").get_global_pos()\n\t\t\tvar velocity = direction.normalized()*min(speed + SPEEDUP, MAXSPEED)\n\t\t\tset_linear_velocity(velocity)\n\t\t\t\n\t\tif(number_bricks == 16):\n\t\t\tget_tree().change_scene(\"res:\/\/Worlds\/win_menu.tscn\")\n\t\t\t\n\tif get_pos().y > get_viewport_rect().end.y:\n\t\tget_tree().change_scene(\"res:\/\/Worlds\/death_menu.tscn\")\n\t\tqueue_free()\n","old_contents":"extends RigidBody2D\n\nexport var SPEEDUP = 4\nconst MAXSPEED = 800\n\nvar number_bricks = 0\n\nfunc _ready():\n\tset_fixed_process(true);\n\t\nfunc _fixed_process(delta):\n\tvar bodies = get_colliding_bodies()\n\t\n\tfor body in bodies:\n\t\tif body.is_in_group(\"Bricks\"):\n\t\t\tget_node(\"\/root\/World\").score += 5\n\t\t\tget_node(\"Horn\").play(\"horn\")\n\t\t\tbody.queue_free()\n\t\t\tnumber_bricks += 1\n\t\t\n\t\tif body.get_name() == \"Paddle\":\n\t\t\tvar speed = get_linear_velocity().length()\n\t\t\tvar direction = get_pos() - body.get_node(\"Anchor\").get_global_pos()\n\t\t\tvar velocity = direction.normalized()*min(speed + SPEEDUP, MAXSPEED)\n\t\t\tset_linear_velocity(velocity)\n\t\t\t\n\t\tif(number_bricks == 16):\n\t\t\tget_tree().change_scene(\"res:\/\/Worlds\/win_menu.tscn\")\n\t\t\t\n\tif get_pos().y > get_viewport_rect().end.y:\n\t\tget_tree().change_scene(\"res:\/\/Worlds\/death_menu.tscn\")\n\t\tqueue_free()\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"9e096b1c8925b0b5acac33302171f3d9a5c105c0","subject":"Dodge the Creeps: Set the physics parameters of the mob before adding it to the scene tree","message":"Dodge the Creeps: Set the physics parameters of the mob before adding it to the scene tree\n\nThis follows the recommendation from https:\/\/github.com\/godotengine\/godot\/issues\/45638\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"2d\/dodge_the_creeps\/Main.gd","new_file":"2d\/dodge_the_creeps\/Main.gd","new_contents":"extends Node\n\nexport(PackedScene) var mob_scene\nvar score\n\nfunc _ready():\n\trandomize()\n\n\nfunc game_over():\n\t$ScoreTimer.stop()\n\t$MobTimer.stop()\n\t$HUD.show_game_over()\n\t$Music.stop()\n\t$DeathSound.play()\n\n\nfunc new_game():\n\tget_tree().call_group(\"mobs\", \"queue_free\")\n\tscore = 0\n\t$Player.start($StartPosition.position)\n\t$StartTimer.start()\n\t$HUD.update_score(score)\n\t$HUD.show_message(\"Get Ready\")\n\t$Music.play()\n\n\nfunc _on_MobTimer_timeout():\n\t# Create a new instance of the Mob scene.\n\tvar mob = mob_scene.instance()\n\n\t# Choose a random location on Path2D.\n\tvar mob_spawn_location = get_node(\"MobPath\/MobSpawnLocation\")\n\tmob_spawn_location.offset = randi()\n\n\t# Set the mob's direction perpendicular to the path direction.\n\tvar direction = mob_spawn_location.rotation + PI \/ 2\n\n\t# Set the mob's position to a random location.\n\tmob.position = mob_spawn_location.position\n\n\t# Add some randomness to the direction.\n\tdirection += rand_range(-PI \/ 4, PI \/ 4)\n\tmob.rotation = direction\n\n\t# Choose the velocity for the mob.\n\tvar velocity = Vector2(rand_range(150.0, 250.0), 0.0)\n\tmob.linear_velocity = velocity.rotated(direction)\n\n\t# Spawn the mob by adding it to the Main scene.\n\tadd_child(mob)\n\nfunc _on_ScoreTimer_timeout():\n\tscore += 1\n\t$HUD.update_score(score)\n\n\nfunc _on_StartTimer_timeout():\n\t$MobTimer.start()\n\t$ScoreTimer.start()\n","old_contents":"extends Node\n\nexport(PackedScene) var mob_scene\nvar score\n\nfunc _ready():\n\trandomize()\n\n\nfunc game_over():\n\t$ScoreTimer.stop()\n\t$MobTimer.stop()\n\t$HUD.show_game_over()\n\t$Music.stop()\n\t$DeathSound.play()\n\n\nfunc new_game():\n\tget_tree().call_group(\"mobs\", \"queue_free\")\n\tscore = 0\n\t$Player.start($StartPosition.position)\n\t$StartTimer.start()\n\t$HUD.update_score(score)\n\t$HUD.show_message(\"Get Ready\")\n\t$Music.play()\n\n\nfunc _on_MobTimer_timeout():\n\t# Choose a random location on Path2D.\n\tvar mob_spawn_location = get_node(\"MobPath\/MobSpawnLocation\")\n\tmob_spawn_location.offset = randi()\n\n\t# Create a Mob instance and add it to the scene.\n\tvar mob = mob_scene.instance()\n\tadd_child(mob)\n\n\t# Set the mob's direction perpendicular to the path direction.\n\tvar direction = mob_spawn_location.rotation + PI \/ 2\n\n\t# Set the mob's position to a random location.\n\tmob.position = mob_spawn_location.position\n\n\t# Add some randomness to the direction.\n\tdirection += rand_range(-PI \/ 4, PI \/ 4)\n\tmob.rotation = direction\n\n\t# Choose the velocity for the mob.\n\tvar velocity = Vector2(rand_range(150.0, 250.0), 0.0)\n\tmob.linear_velocity = velocity.rotated(direction)\n\n\nfunc _on_ScoreTimer_timeout():\n\tscore += 1\n\t$HUD.update_score(score)\n\n\nfunc _on_StartTimer_timeout():\n\t$MobTimer.start()\n\t$ScoreTimer.start()\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"3ed2f27d877f02371afef647210b4359016d0041","subject":"load\/save dialogs convey proper info to user","message":"load\/save dialogs convey proper info to user\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Editor.gd","new_file":"src\/scripts\/Editor.gd","new_contents":"extends Spatial\n\nvar puzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar puzzle\nvar puzzleMan\n\nvar gridMan\nvar prevBlock = null\n\nvar fileDialog = load(\"res:\/\/fileDialog.scn\").instance()\nvar gui = [\n\t[\"status\", Label.new()], # plz keep me as first element, referenced as gui[0] later\n\t[\"save_pzl\", Button.new()],\n\t[\"load_pzl\", Button.new()],\n\t[\"remove_layer\", Button.new()],\n\t[\"random_layer\", Button.new()],\n\t# THESE SHOULD BE Options instead of left, label, right\n\t[\"class_toggle\", {\n\t\tleft=Button.new(),\n\t\tright=Button.new(),\n\t\tlabel=Label.new(),\n\t\tvalues=[\"LZR\", \"WILD\", \"PAIR\", \"GOAL\"],\n\t\tvalue=\"PAIR\"\n\t}],\n\t[\"color_toggle\", {\n\t\tleft=Button.new(),\n\t\tright=Button.new(),\n\t\tlabel=Label.new(),\n\t\tvalues=preload(\"res:\/\/scripts\/PuzzleManager.gd\").blockColors,\n\t\tvalue=\"Red\"\n\t}],\n\t[\"action_toggle\", {\n\t\tleft=Button.new(),\n\t\tright=Button.new(),\n\t\tlabel=Label.new(),\n\t\tvalues=[\"Add\", \"Remove\", \"Replace\"],\n\t\tvalue=\"Add\"\n\t}],\n\t[\"test_pzl\", Button.new()],\n]\n\nfunc shouldAddNeighbor():\n\treturn true\n\nfunc shouldReplaceSelf():\n\treturn false\n\nfunc shouldRemoveSelf():\n\treturn false\n\nfunc newPickledBlock():\n\tvar b = puzzleMan.PickledBlock.new()\\\n\t\t.setName(gridMan.shape.keys().size())\\\n\tif prevBlock != null:\n\t\tb.setPairName(prevBlock.name)\n\t\tgridMan.get_node(prevBlock.toNode().name).setPairName(b.name)\n\t\tprevBlock = null\n\t\tgui[0][1].set_text(\"STATUS: ERROR, ADD PAIR\")\n\telse:\n\t\tprevBlock = b\n\t\tgui[0][1].set_text(\"STATUS: NOMINAL\")\n\treturn b\n\nfunc updateToggle(togg, increase):\n\tif increase:\n\t\tvar next_ix = togg.values.find(togg.value) + 1\n\t\tif (next_ix >= togg.values.size()):\n\t\t\tnext_ix = 0\n\t\ttogg.value = togg.values[next_ix]\n\telse:\n\t\tvar next_ix = togg.values.find(togg.value) - 1\n\t\tif (next_ix < 0):\n\t\t\tnext_ix = togg.values.size() - 1\n\t\ttogg.value = togg.values[next_ix]\n\ttogg.label.set_text(togg.value)\n\nfunc showFileDialog(loadInstead=false):\n\tget_tree().set_pause(true)\n\n\tif loadInstead:\n\t\tfileDialog.connect(\"confirmed\", self, \"puzzleLoad\")\n\t\tfileDialog.set_mode(FileDialog.MODE_OPEN_FILE)\n\telse:\n\t\tfileDialog.connect(\"confirmed\", self, \"puzzleSave\")\n\t\tfileDialog.set_mode(FileDialog.MODE_SAVE_FILE)\n\t\t\n\tfileDialog.popup_centered()\n\t\nfunc puzzleSave():\n\tprint(\"SAVING TO \", fileDialog.get_current_file() )\n\tget_tree().set_pause(false)\n\nfunc puzzleLoad():\n\tprint(\"LOADING FROM \", fileDialog.get_current_file() )\n\tget_tree().set_pause(false)\n\nfunc _ready():\n\tpuzzle = puzzleScn.instance()\n\tgridMan = puzzle.get_node(\"GridView\/GridMan\")\n\tpuzzle.mainPuzzle = false\n\t\n\t# hide and disable timer\n\tpuzzle.time.on = false;\n\tpuzzle.time.val = ''\n\t\n\tpuzzle.set_as_toplevel(true)\n\n\tadd_child(puzzle)\n\t\n\tprint(puzzle.get_tree() == get_tree())\n\tpuzzleMan = puzzle.puzzleMan\n\n\tset_process_input(true)\n\n\tvar theme = preload(\"res:\/\/themes\/MainTheme.thm\")\n\t\n\n\tfileDialog.set_title(\"Select Puzzle Filename\")\n\tfileDialog.set_access(FileDialog.ACCESS_USERDATA)\n\tfileDialog.set_current_dir(\"PuzzleSaves\")\n\tfileDialog.add_filter(\"*.pzl ; Anttris Puzzle\")\n\t\n\t# MainTheme leaks on bottom\n\tvar dialogTheme = Theme.new()\n\tdialogTheme.copy_default_theme()\n\tfileDialog.set_theme(dialogTheme)\n\t\n\t# work even if game is paused\n\tfileDialog.set_pause_mode(PAUSE_MODE_PROCESS)\n\n\t# unpause if user cancels\n\tfileDialog.connect(\"popup_hide\", get_tree(), \"set_pause\", [false])\n\tfileDialog.hide()\n\tadd_child(fileDialog)\n\t\n\tvar y = 0\n\tfor control in gui:\n\t\ty += 45\n\t\tif control[0].rfind('_toggle') > 0:\n\t\t\tvar togg = control[1]\n\t\t\tfor cont in togg.keys():\n\t\t\t\tif not cont.begins_with('value'):\n\t\t\t\t\tvar e = togg[cont]\n\t\t\t\t\te.set_pos(Vector2(10, y))\n\t\t\t\t\te.set_theme(theme)\n\t\t\t\t\tadd_child(e)\n\n\t\t\ttogg.left.set_text(\"<\")\n\t\t\ttogg.left.connect('pressed', self, 'updateToggle', [togg, false])\n\n\t\t\ttogg.label.set_pos(Vector2(90, y + 4))\n\t\t\ttogg.label.set_text(togg.value)\n\n\t\t\ttogg.right.set_pos(Vector2(55, y))\n\t\t\ttogg.right.set_text(\">\")\n\t\t\ttogg.right.connect('pressed', self, 'updateToggle', [togg, true])\n\n\t\telse:\n\t\t\tvar e = control[1]\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tif e extends Button:\n\t\t\t\te.set_text(control[0])\n\t\t\tif control[0] == 'save_pzl' :\n\t\t\t\te.connect('pressed', self, 'showFileDialog')\n\t\t\tif control[0] == 'load_pzl' :\n\t\t\t\te.connect('pressed', self, 'showFileDialog', [true])\n\t\t\tif control[0] == 'status':\n\t\t\t\tcontrol[1].set_text('STATUS: NOMINAL')\n\t\t\tadd_child(e)\n\n\n","old_contents":"extends Spatial\n\nvar puzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar puzzle\nvar puzzleMan\n\nvar gridMan\nvar prevBlock = null\n\nvar fileDialog = load(\"res:\/\/fileDialog.scn\").instance()\nvar gui = [\n\t[\"status\", Label.new()], # plz keep me as first element, referenced as gui[0] later\n\t[\"save_pzl\", Button.new()],\n\t[\"load_pzl\", Button.new()],\n\t[\"remove_layer\", Button.new()],\n\t[\"random_layer\", Button.new()],\n\t# THESE SHOULD BE Options instead of left, label, right\n\t[\"class_toggle\", {\n\t\tleft=Button.new(),\n\t\tright=Button.new(),\n\t\tlabel=Label.new(),\n\t\tvalues=[\"LZR\", \"WILD\", \"PAIR\", \"GOAL\"],\n\t\tvalue=\"PAIR\"\n\t}],\n\t[\"color_toggle\", {\n\t\tleft=Button.new(),\n\t\tright=Button.new(),\n\t\tlabel=Label.new(),\n\t\tvalues=preload(\"res:\/\/scripts\/PuzzleManager.gd\").blockColors,\n\t\tvalue=\"Red\"\n\t}],\n\t[\"action_toggle\", {\n\t\tleft=Button.new(),\n\t\tright=Button.new(),\n\t\tlabel=Label.new(),\n\t\tvalues=[\"Add\", \"Remove\", \"Replace\"],\n\t\tvalue=\"Add\"\n\t}],\n\t[\"test_pzl\", Button.new()],\n]\n\nfunc shouldAddNeighbor():\n\treturn true\n\nfunc shouldReplaceSelf():\n\treturn false\n\nfunc shouldRemoveSelf():\n\treturn false\n\nfunc newPickledBlock():\n\tvar b = puzzleMan.PickledBlock.new()\\\n\t\t.setName(gridMan.shape.keys().size())\\\n\tif prevBlock != null:\n\t\tb.setPairName(prevBlock.name)\n\t\tgridMan.get_node(prevBlock.toNode().name).setPairName(b.name)\n\t\tprevBlock = null\n\t\tgui[0][1].set_text(\"STATUS: ERROR, ADD PAIR\")\n\telse:\n\t\tprevBlock = b\n\t\tgui[0][1].set_text(\"STATUS: NOMINAL\")\n\treturn b\n\nfunc updateToggle(togg, increase):\n\tif increase:\n\t\tvar next_ix = togg.values.find(togg.value) + 1\n\t\tif (next_ix >= togg.values.size()):\n\t\t\tnext_ix = 0\n\t\ttogg.value = togg.values[next_ix]\n\telse:\n\t\tvar next_ix = togg.values.find(togg.value) - 1\n\t\tif (next_ix < 0):\n\t\t\tnext_ix = togg.values.size() - 1\n\t\ttogg.value = togg.values[next_ix]\n\ttogg.label.set_text(togg.value)\n\nfunc showFileDialog(loadInstead=false):\n\tget_tree().set_pause(true)\n\tfileDialog.popup_centered()\n\t\n\tif loadInstead:\n\t\tfileDialog.connect(\"confirmed\", self, \"puzzleLoad\")\n\telse:\n\t\tfileDialog.connect(\"confirmed\", self, \"puzzleSave\")\n\t\nfunc puzzleSave():\n\tprint(\"SAVING TO \", fileDialog.get_current_file() )\n\tget_tree().set_pause(false)\n\nfunc puzzleLoad():\n\tprint(\"LOADING FROM \", fileDialog.get_current_file() )\n\tget_tree().set_pause(false)\n\nfunc _ready():\n\tpuzzle = puzzleScn.instance()\n\tgridMan = puzzle.get_node(\"GridView\/GridMan\")\n\tpuzzle.mainPuzzle = false\n\t\n\t# hide and disable timer\n\tpuzzle.time.on = false;\n\tpuzzle.time.val = ''\n\t\n\tpuzzle.set_as_toplevel(true)\n\n\tadd_child(puzzle)\n\t\n\tprint(puzzle.get_tree() == get_tree())\n\tpuzzleMan = puzzle.puzzleMan\n\n\tset_process_input(true)\n\n\tvar theme = preload(\"res:\/\/themes\/MainTheme.thm\")\n\t\n\n\tfileDialog.set_title(\"Select Puzzle Filename\")\n\tfileDialog.set_access(FileDialog.ACCESS_USERDATA)\n\t\n\t# MainTheme leaks on bottom\n\tvar dialogTheme = Theme.new()\n\tdialogTheme.copy_default_theme()\n\tfileDialog.set_theme(dialogTheme)\n\t\n\t# work even if game is paused\n\tfileDialog.set_pause_mode(PAUSE_MODE_PROCESS)\n\n\t# unpause if user cancels\n\tfileDialog.connect(\"popup_hide\", get_tree(), \"set_pause\", [false])\n\tfileDialog.hide()\n\tadd_child(fileDialog)\n\t\n\tvar y = 0\n\tfor control in gui:\n\t\ty += 45\n\t\tif control[0].rfind('_toggle') > 0:\n\t\t\tvar togg = control[1]\n\t\t\tfor cont in togg.keys():\n\t\t\t\tif not cont.begins_with('value'):\n\t\t\t\t\tvar e = togg[cont]\n\t\t\t\t\te.set_pos(Vector2(10, y))\n\t\t\t\t\te.set_theme(theme)\n\t\t\t\t\tadd_child(e)\n\n\t\t\ttogg.left.set_text(\"<\")\n\t\t\ttogg.left.connect('pressed', self, 'updateToggle', [togg, false])\n\n\t\t\ttogg.label.set_pos(Vector2(90, y + 4))\n\t\t\ttogg.label.set_text(togg.value)\n\n\t\t\ttogg.right.set_pos(Vector2(55, y))\n\t\t\ttogg.right.set_text(\">\")\n\t\t\ttogg.right.connect('pressed', self, 'updateToggle', [togg, true])\n\n\t\telse:\n\t\t\tvar e = control[1]\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tif e extends Button:\n\t\t\t\te.set_text(control[0])\n\t\t\tif control[0] == 'save_pzl' :\n\t\t\t\te.connect('pressed', self, 'showFileDialog')\n\t\t\tif control[0] == 'load_pzl' :\n\t\t\t\te.connect('pressed', self, 'showFileDialog', [true])\n\t\t\tif control[0] == 'status':\n\t\t\t\tcontrol[1].set_text('STATUS: NOMINAL')\n\t\t\tadd_child(e)\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"a5d5b440c962c034b12ae5ff99a7a20ed5ea30b2","subject":"added basic GUI, replace and delete functions","message":"added basic GUI, replace and delete functions\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Editor.gd","new_file":"src\/scripts\/Editor.gd","new_contents":"extends Spatial\n\nvar puzzleMan\nvar gridMan\nvar prevBlock = null\n\nvar fileDialog = FileDialog.new()\nvar gui = [\n\t[\"status\", Label.new()],\n\t[\"save_pzl\", Button.new()],\n\t[\"load_pzl\", Button.new()],\n\t[\"remove_layer\", Button.new()],\n\t[\"random_layer\", Button.new()],\n\t# THESE SHOULD BE Options instead of left, label, right\n\t[\"class_toggle\", {\n\t\tleft=Button.new(),\n\t\tright=Button.new(),\n\t\tlabel=Label.new(),\n\t\tvalues=[\"LZR\", \"WILD\", \"PAIR\", \"GOAL\"],\n\t\tvalue=\"PAIR\"\n\t}],\n\t[\"color_toggle\", {\n\t\tleft=Button.new(),\n\t\tright=Button.new(),\n\t\tlabel=Label.new(),\n\t\tvalues=preload(\"res:\/\/scripts\/PuzzleManager.gd\").blockColors,\n\t\tvalue=\"Red\"\n\t}],\n\t[\"action_toggle\", {\n\t\tleft=Button.new(),\n\t\tright=Button.new(),\n\t\tlabel=Label.new(),\n\t\tvalues=[\"Add\", \"Remove\", Replace\"],\n\t\tvalue=\"Add\"\n\t}],\n]\n\nvar puzzleScn = preload(\"res:\/\/puzzle.scn\")\n\nfunc shouldAddNeighbor():\n\treturn false\n\nfunc shouldReplaceSelf():\n\treturn true\n\nfunc shouldRemoveSelf():\n\treturn true\n\nfunc newPickledBlock():\n\tvar b = puzzleMan.PickledBlock.new()\\\n\t\t.setName(gridMan.shape.keys().size())\\\n\tif prevBlock != null:\n\t\tb.setPairName(prevBlock.name)\n\t\tgridMan.get_node(prevBlock.toNode().name).setPairName(b.name)\n\t\tprevBlock = null\n\telse:\n\t\tprevBlock = b\n\treturn b\n\nfunc updateToggle(togg, increase):\n\tprint(togg.values[0], togg.values.size())\n\tif increase:\n\t\tvar next_ix = togg.values.find(togg.value) + 1\n\t\tif (next_ix >= togg.values.size()):\n\t\t\tnext_ix = 0\n\t\ttogg.value = togg.values[next_ix]\n\telse:\n\t\tvar next_ix = togg.values.find(togg.value) - 1\n\t\tif (next_ix < 0):\n\t\t\tnext_ix = togg.values.size() - 1\n\t\ttogg.value = togg.values[next_ix]\n\ttogg.label.set_text(togg.value)\n\nfunc puzzleSave(loadInstead=false):\n\tfileDialog.popup_centered()\n\nfunc _ready():\n\tvar pMan = puzzleScn.instance()\n\tgridMan = pMan.get_node(\"GridView\/GridMan\")\n\tpMan.mainPuzzle = false\n\tpMan.time.on = false;\n\tpMan.time.val = ''\n\tpMan.set_as_toplevel(true)\n\n\tadd_child(pMan)\n\tpuzzleMan = pMan.puzzleMan\n\n\tset_process_input(true)\n\n\tfileDialog.set_title(\"Select Puzzle Filename\")\n\tfileDialog.set_access(FileDialog.ACCESS_USERDATA)\n\tfileDialog.set_theme(preload(\"res:\/\/themes\/MainTheme.thm\"))\n\tadd_child(fileDialog)\n\tvar y = 0\n\tfor control in gui:\n\t\ty += 45\n\t\tif control[0].rfind('_toggle') > 0:\n\t\t\tvar togg = control[1]\n\t\t\tfor cont in togg.keys():\n\t\t\t\tif not cont.begins_with('value'):\n\t\t\t\t\tvar e = togg[cont]\n\t\t\t\t\te.set_pos(Vector2(10, y))\n\t\t\t\t\te.set_theme(preload(\"res:\/\/themes\/MainTheme.thm\"))\n\t\t\t\t\tadd_child(e)\n\n\t\t\ttogg.left.set_text(\"<\")\n\t\t\ttogg.left.connect('pressed', self, 'updateToggle', [togg, false])\n\n\t\t\ttogg.label.set_pos(Vector2(90, y + 4))\n\t\t\ttogg.label.set_text(togg.value)\n\n\t\t\ttogg.right.set_pos(Vector2(55, y))\n\t\t\ttogg.right.set_text(\">\")\n\t\t\ttogg.right.connect('pressed', self, 'updateToggle', [togg, true])\n\n\t\telse:\n\t\t\tvar e = control[1]\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(load('res:\/\/themes\/MainTheme.thm'))\n\t\t\tif e extends Button:\n\t\t\t\te.set_text(control[0])\n\t\t\tif control[0] == 'save_pzl' :\n\t\t\t\te.connect('pressed', self, 'puzzleSave')\n\t\t\tif control[0] == 'load_pzl' :\n\t\t\t\te.connect('pressed', self, 'puzzleSave', [true])\n\t\t\tadd_child(e)\n\t\tif control[0] == 'status':\n\t\t\tcontrol[1].set_text('STATUS: NOMINAL')\n\n\n","old_contents":"extends Spatial\n\nvar puzzleMan\nvar gridMan\nvar prevBlock = null\n\nvar puzzleScn = preload(\"res:\/\/puzzle.scn\")\n\nfunc shouldAddNeighbor():\n\treturn not (gridMan.shape.keys().size() > 28)\n\nfunc newPickledBlock():\n\tvar b = puzzleMan.PickledBlock.new()\\\n\t\t.setName(gridMan.shape.keys().size())\\\n\tif prevBlock != null:\n\t\tb.setPairName(prevBlock.name)\n\t\tgridMan.get_node(prevBlock.toNode().name).setPairName(b.name)\n\t\tprevBlock = null\n\telse:\n\t\tprevBlock = b\n\treturn b\n\nfunc _ready():\n\tvar pMan = puzzleScn.instance()\n\tgridMan = pMan.get_node(\"GridView\/GridMan\")\n\tpMan.mainPuzzle = false\n\tpMan.time.on = false\n\tpMan.set_as_toplevel(true)\n\n\tadd_child(pMan)\n\tpuzzleMan = pMan.puzzleMan\n\n\tset_process_input(true)\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"c0029d79650abc8221ef671702d1ce6495448cd4","subject":"fixed bug in Android camera motion","message":"fixed bug in Android camera motion\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/GridView.gd","new_file":"src\/scripts\/GridView.gd","new_contents":"extends Spatial\n\n# global working variables\nvar turn = Vector2( 0.0, 0.0 ) # the amount the mouse has turned\nvar mouseposlast = Input.get_mouse_pos() # the mouses last position\n\n# global tweakable parameters\nvar orbitrate = 10 # the rate the camera orbits the target when the mouse is moved\n\n\nfunc _ready():\n\t# Initalization here\n\tset_process_input(true) # process user input events here\n\t\n# called to handle a user input event\nfunc _input(ev):\n\t# If the mouse has been moved\n\tif (ev.type==InputEvent.SCREEN_DRAG or (ev.type==InputEvent.MOUSE_MOTION and ev.button_mask == 1)):\n\t\t# calculate the delta change from the last mouse movement\n\t\tvar mousedelta = (mouseposlast - ev.pos)\n\t\t# scale the mouse delta to a useful value\n\t\tturn = mousedelta \/ orbitrate\n\t\t# perform the rotation\n\t\tvar currentTransform = get_transform().basis\n\t\tvar dtime = get_process_delta_time()\n\t\tcurrentTransform = Matrix3( Vector3(0, 1, 0), PI * turn.x * dtime ) * currentTransform\n\t\tcurrentTransform = Matrix3( Vector3(1, 0, 0), PI * turn.y * dtime ) * currentTransform\n\t\tset_transform( Transform( currentTransform ) )\n\t\t\n\t# record the last position of the mousedelta\n\tmouseposlast = ev.pos \n\t# Android does not like this: Input.get_mouse_pos()","old_contents":"\nextends Spatial\n\n# global working variables\nvar turn = Vector2( 0.0, 0.0 ) # the amount the mouse has turned\nvar mouseposlast = Input.get_mouse_pos() # the mouses last position\n\n# global tweakable parameters\nvar orbitrate = 10 # the rate the camera orbits the target when the mouse is moved\n\n\nfunc _ready():\n\t# Initalization here\n\tset_process_input(true) # process user input events here\n\t\n# called to handle a user input event\nfunc _input(ev):\n\t# If the mouse has been moved\n\tif (ev.type==InputEvent.MOUSE_MOTION and ev.button_mask == 1):\n\t\t# calculate the delta change from the last mouse movement\n\t\tvar mousedelta = (mouseposlast - ev.pos)\n\t\t# scale the mouse delta to a useful value\n\t\tturn = mousedelta \/ orbitrate\n\t\t# perform the rotation\n\t\tvar currentTransform = get_transform().basis\n\t\tvar dtime = get_process_delta_time()\n\t\tcurrentTransform = Matrix3( Vector3(0, 1, 0), PI * turn.x * dtime ) * currentTransform\n\t\tcurrentTransform = Matrix3( Vector3(1, 0, 0), PI * turn.y * dtime ) * currentTransform\n\t\tset_transform( Transform( currentTransform ) )\n\t\t\n\t# record the last position of the mousedelta\n\tmouseposlast = Input.get_mouse_pos()","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"071cfac4f6e7226e31ef869ac5f3a37ef8a2e5f2","subject":"Fix deep equality checking to use a \"near\" double comparison to allow for floating point errors.","message":"Fix deep equality checking to use a \"near\" double comparison to allow for floating point errors.\n","repos":"groboclown\/godot-bootstrap","old_file":"components\/unit_tests\/base.gd","new_file":"components\/unit_tests\/base.gd","new_contents":"# base test class\r\n\r\n#extends Object\r\n\r\nvar _tests = []\r\nvar filename = \"\"\r\nvar _results = null\r\n\r\nfunc _init():\r\n\tvar t\r\n\tfor t in get_method_list():\r\n\t\t# print(t.to_json())\r\n\t\tif t[\"name\"].begins_with(\"test_\") && t[\"args\"].size() <= 0:\r\n\t\t\tadd(t[\"name\"])\r\n\r\n\r\nfunc class_setup():\r\n\tpass\r\n\r\n\r\nfunc class_teardown():\r\n\tpass\r\n\r\n\r\nfunc setup():\r\n\tpass\r\n\r\n\r\nfunc teardown():\r\n\tpass\r\n\r\n\r\n# ------------------------------------------------------------------------\r\n\r\n\r\nfunc add(test_name):\r\n\tif test_name == null:\r\n\t\treturn\r\n\tif typeof(test_name) == TYPE_STRING:\r\n\t\tif not(test_name in _tests):\r\n\t\t\t_tests.append(test_name)\r\n\telse:\r\n\t\tvar t\r\n\t\tfor t in test_name:\r\n\t\t\tif t != null && not(t in _tests):\r\n\t\t\t\t_tests.append(t)\r\n\r\n\r\nfunc add_all(all_tests):\r\n\tadd(all_tests)\r\n\r\n\r\nfunc set_tests(test_names):\r\n\t_tests = []\r\n\tadd(test_names)\r\n\r\n\r\nfunc skip(test_name):\r\n\tif test_name == null:\r\n\t\treturn\r\n\tif typeof(test_name) == TYPE_STRING:\r\n\t\t_tests.erase(test_name)\r\n\telse:\r\n\t\tvar t\r\n\t\tfor t in test_name:\r\n\t\t\t_tests.erase(test_name)\r\n\r\n\r\n# ------------------------------------------------------------------------\r\n\r\n\r\nfunc check_true(text, bool_val):\r\n\tif ! bool_val:\r\n\t\tif _results != null:\r\n\t\t\t_results.add_error(text)\r\n\t\treturn false\r\n\treturn true\r\n\r\nfunc check_that(text, actual, matcher):\r\n\treturn check_true(text + \": \" + matcher.describe(actual), matcher.matches(actual))\r\n\r\nfunc check(text = \"\"):\r\n\treturn Checker.new(_results, text)\r\n\r\n\r\n\r\n\r\n# ------------------------------------------------------------------------\r\n\r\n# result_collector must implement these methods:\r\n# func start_suite(suite_name)\r\n# func end_suite()\r\n# func start_test(name)\r\n# func end_test()\r\n# func add_error(message)\r\n# func has_errors() (does the current suite have any errors?)\r\n\r\n\r\nfunc run(result_collector):\r\n\tself._results = result_collector\r\n\tresult_collector.start_suite(filename)\r\n\tclass_setup()\r\n\tif result_collector.has_error():\r\n\t\treturn\r\n\r\n\tvar t\r\n\tfor t in _tests:\r\n\t\tif has_method(t):\r\n\t\t\trun_test(t)\r\n\t\telse:\r\n\t\t\tresult_collector.add_error(\"Setup Error: requested function does not exist: \" + t)\r\n\r\n\tclass_teardown()\r\n\tresult_collector.end_suite()\r\n\r\n\r\nfunc run_test(name):\r\n\tif _results != null:\r\n\t\t_results.start_test(name)\r\n\tsetup()\r\n\tcall(name)\r\n\tteardown()\r\n\tif _results != null:\r\n\t\t_results.end_test()\r\n\r\n\r\n# -------------------------------------------------------------------------\r\n\r\n\r\nclass Matcher:\r\n\tfunc matches(value):\r\n\t\treturn false\r\n\tfunc describe(value):\r\n\t\treturn \"\"\r\n\tfunc _as_str(value):\r\n\t\tif value == null:\r\n\t\t\treturn \"\"\r\n\t\tif typeof(value) == TYPE_DICTIONARY:\r\n\t\t\treturn value.to_json()\r\n\t\treturn \"[\" + str(value) + \"]\"\r\n\tfunc _is_list(value):\r\n\t\t# return typeof(value) == TYPE_ARRAY || typeof(value) == TYPE_INT_ARRAY || typeof(value) == TYPE_REAL_ARRAY || typeof(value) == TYPE_STRING_ARRAY\r\n\t\t# All the arrays are in this specific range.\r\n\t\t# This needs to be checked against future versions of Godot.\r\n\t\tvar v = typeof(value)\r\n\t\treturn v >= TYPE_ARRAY && v <= TYPE_COLOR_ARRAY\r\n\r\n\r\nclass IsMatcher:\r\n\textends Matcher\r\n\tvar val\r\n\r\n\tfunc _init(v):\r\n\t\tval = v\r\n\r\n\tfunc matches(value):\r\n\t\treturn _inner_match(val, value, [])\r\n\r\n\tfunc _inner_match(v1, v2, seen):\r\n\t\tseen.append(v2)\r\n\t\t# Check lists the same way\r\n\t\tif _is_list(v1) && _is_list(v2):\r\n\t\t\tif v1.size() != v2.size():\r\n\t\t\t\treturn false\r\n\t\t\tvar i\r\n\t\t\tfor i in range(0, v1.size()):\r\n\t\t\t\tif v2[i] in seen:\r\n\t\t\t\t\t# This isn't a correct check; instead,\r\n\t\t\t\t\t# we need to ensure that the seen version of v2[i]\r\n\t\t\t\t\t# matches up with the corresponding seen version of v1[i]\r\n\t\t\t\t\tif v1[i] != v2[i]:\r\n\t\t\t\t\t\treturn false\r\n\t\t\t\t\t# Else prevent infinite loop by just\r\n\t\t\t\t\t# saying it's right.\r\n\t\t\t\telif ! _inner_match(v1[i], v2[i], seen):\r\n\t\t\t\t\treturn false\r\n\t\t\treturn true\r\n\t\t# Cannot perform a \"==\" if the types are different\r\n\t\tif typeof(v1) != typeof(v2):\r\n\t\t\treturn false\r\n\t\tif v1 == v2:\r\n\t\t\treturn true\r\n\t\tif typeof(v1) == TYPE_DICTIONARY:\r\n\t\t\tif v1.size() != v2.size():\r\n\t\t\t\treturn false\r\n\t\t\tvar k\r\n\t\t\tfor k in v1:\r\n\t\t\t\tif not (k in v2):\r\n\t\t\t\t\treturn false\r\n\t\t\t\tif v2[k] in seen:\r\n\t\t\t\t\t# This isn't a correct check; instead,\r\n\t\t\t\t\t# we need to ensure that the seen version of v2[i]\r\n\t\t\t\t\t# matches up with the corresponding seen version of v1[i]\r\n\t\t\t\t\tif v1[k] != v2[k]:\r\n\t\t\t\t\t\treturn false\r\n\t\t\t\telif ! _inner_match(v1[k], v2[k], seen):\r\n\t\t\t\t\treturn false\r\n\t\t\treturn true\r\n\t\tif typeof(v1) == TYPE_REAL:\r\n\t\t\t# Closeness\r\n\t\t\treturn abs(float(v1) - v2) <= 0.0000001\r\n\t\t# Any other type should have == match right.\r\n\t\treturn false\r\n\r\n\tfunc describe(value):\r\n\t\treturn \"expected \" + _as_str(val) + \", found \" + _as_str(value)\r\n\r\n\r\n\r\nstatic func is(value):\r\n\t# \"is\" can be used to make a clear English-like sentence.\r\n\t# So, if the value is a matcher, then just use that matcher instead of\r\n\t# adding another layer around \"is\".\r\n\tif typeof(value) == TYPE_OBJECT && value.has_method(\"matches\") && value.has_method(\"describe\"):\r\n\t\treturn value\r\n\t# Need to wrap the value in an is check.\r\n\treturn IsMatcher.new(value)\r\n\r\n\r\nstatic func equals(value):\r\n\treturn IsMatcher.new(value)\r\n\r\n\r\nclass NotMatcher:\r\n\tvar val\r\n\r\n\tfunc _init(v):\r\n\t\tif typeof(v) == TYPE_OBJECT && v extends Matcher:\r\n\t\t\tval = v\r\n\t\telse:\r\n\t\t\tval = IsMatcher.new(v)\r\n\r\n\tfunc matches(value):\r\n\t\treturn ! val.matches(value)\r\n\r\n\tfunc describe(value):\r\n\t\treturn \"expected not: \" + val.describe(value)\r\n\r\n\r\n\r\nstatic func is_not(value):\r\n\treturn NotMatcher.new(value)\r\n\r\n\r\n\r\nclass BetweenMatcher:\r\n\tvar lo\r\n\tvar hi\r\n\r\n\tfunc _init(l, h):\r\n\t\tlo = float(l)\r\n\t\thi = float(h)\r\n\r\n\tfunc matches(value):\r\n\t\treturn value != null && float(value) >= lo && float(value) <= hi\r\n\r\n\tfunc describe(value):\r\n\t\treturn \"expected [\" + str(lo) + \", \" + str(hi) + \"], found \" + str(value)\r\n\r\n\r\n\r\nstatic func between(lo, hi):\r\n\treturn BetweenMatcher.new(lo, hi)\r\n\r\n\r\nclass NearMatcher:\r\n\tvar _epsilon\r\n\tvar _val\r\n\r\n\tfunc _init(val, epsilon = 0.00001):\r\n\t\t_epsilon = float(epsilon)\r\n\t\t_val = float(val)\r\n\r\n\tfunc matches(value):\r\n\t\treturn abs(float(value) - _val) <= _epsilon\r\n\r\n\tfunc describe(value):\r\n\t\treturn \"expected \" + str(_val) + \" within \" + str(_epsilon) + \", found \" + str(value)\r\n\r\n\r\nstatic func near(val, epsilon = 0.00001):\r\n\treturn NearMatcher.new(val, epsilon)\r\n\r\n\r\nclass ContainsMatcher:\r\n\textends Matcher\r\n\tvar _val\r\n\r\n\tfunc _init(val):\r\n\t\t_val = val\r\n\r\n\tfunc matches(actual):\r\n\t\tif actual == null:\r\n\t\t\treturn false\r\n\t\tif typeof(actual) == TYPE_STRING:\r\n\t\t\t# Expect a string to contain a sub-string\r\n\t\t\treturn actual.find(_val) >= 0\r\n\t\tif _is_list(actual):\r\n\t\t\tif _is_list(_val):\r\n\t\t\t\t# each \"val\" must be in the actual list\r\n\t\t\t\tvar v\r\n\t\t\t\tfor v in _val:\r\n\t\t\t\t\tif ! (v in actual):\r\n\t\t\t\t\t\treturn false\r\n\t\t\t\treturn true\r\n\t\t\treturn _val in actual\r\n\t\tif typeof(actual) == TYPE_RECT2:\r\n\t\t\tif typeof(_val) == TYPE_RECT2:\r\n\t\t\t\treturn actual.encloses(_val)\r\n\t\t\tif typeof(_val) == TYPE_VECTOR2:\r\n\t\t\t\treturn actual.has_point(_val)\r\n\t\t\treturn false\r\n\t\tif typeof(actual) == TYPE_PLANE:\r\n\t\t\tif typeof(_val) == TYPE_VECTOR3:\r\n\t\t\t\treturn actual.has_point(_val)\r\n\t\t\treturn false\r\n\t\tif typeof(actual) == TYPE_DICTIONARY:\r\n\t\t\tif _is_list(_val):\r\n\t\t\t\treturn actual.has_all(_val)\r\n\t\t \treturn actual.has(_val)\r\n\r\n\r\n\t\t# These don't really make sense.\r\n\r\n\t\t# Object values should just be checked for equality.\r\n\t\t#if typeof(actual) == TYPE_OBJECT:\r\n\t\t#\treturn actual.get(_val) != null\r\n\r\n\t\treturn false\r\n\r\n\tfunc describe(actual):\r\n\t\treturn \"expected \" + _as_str(actual) + \" to contain \" + _as_str(_val)\r\n\r\nstatic func contains(val):\r\n\treturn ContainsMatcher.new(val)\r\n\r\n\r\nclass EmptyMatcher:\r\n\textends Matcher\r\n\r\n\tfunc matches(actual):\r\n\t\tif _is_list(actual):\r\n\t\t\treturn actual.size() <= 0\r\n\t\tif typeof(actual) == TYPE_DICTIONARY:\r\n\t\t\treturn actual.keys().size() <= 0\r\n\t\treturn false\r\n\r\n\tfunc describe(actual):\r\n\t\tif _is_list(actual):\r\n\t\t\treturn \"expected \" + _as_str(actual) + \" to be an empty list\"\r\n\t\tif typeof(actual) == TYPE_DICTIONARY:\r\n\t\t\treturn \"expected \" + _as_str(actual) + \" to be an empty dictionary\"\r\n\t\treturn \"expected \" + _as_str(actual) + \" to be an empty list or dictionary\"\r\n\r\nstatic func empty():\r\n\treturn EmptyMatcher.new()\r\n\r\n\r\n# ---------------------------------------------------------------------------\r\n\r\nclass Checker:\r\n\tvar _text\r\n\tvar _results\r\n\r\n\tfunc _init(results, text):\r\n\t\t_results = results\r\n\t\t_text = text\r\n\r\n\tfunc that(actual, matcher):\r\n\t\tvar res\r\n\t\tvar msg\r\n\t\tif typeof(matcher) == TYPE_BOOL:\r\n\t\t\tres = matcher\r\n\t\t\tmsg = _text\r\n\t\telse:\r\n\t\t\tres = matcher.matches(actual)\r\n\t\t\tmsg = _text + \": \" + matcher.describe(actual)\r\n\t\tif ! res:\r\n\t\t\tif _results != null:\r\n\t\t\t\t_results.add_error(msg)\r\n\t\t\treturn false\r\n\t\treturn true\r\n","old_contents":"# base test class\r\n\r\n#extends Object\r\n\r\nvar _tests = []\r\nvar filename = \"\"\r\nvar _results = null\r\n\r\nfunc _init():\r\n\tvar t\r\n\tfor t in get_method_list():\r\n\t\t# print(t.to_json())\r\n\t\tif t[\"name\"].begins_with(\"test_\") && t[\"args\"].size() <= 0:\r\n\t\t\tadd(t[\"name\"])\r\n\r\n\r\nfunc class_setup():\r\n\tpass\r\n\r\n\r\nfunc class_teardown():\r\n\tpass\r\n\r\n\r\nfunc setup():\r\n\tpass\r\n\r\n\r\nfunc teardown():\r\n\tpass\r\n\r\n\r\n# ------------------------------------------------------------------------\r\n\r\n\r\nfunc add(test_name):\r\n\tif test_name == null:\r\n\t\treturn\r\n\tif typeof(test_name) == TYPE_STRING:\r\n\t\tif not(test_name in _tests):\r\n\t\t\t_tests.append(test_name)\r\n\telse:\r\n\t\tvar t\r\n\t\tfor t in test_name:\r\n\t\t\tif t != null && not(t in _tests):\r\n\t\t\t\t_tests.append(t)\r\n\r\n\r\nfunc add_all(all_tests):\r\n\tadd(all_tests)\r\n\r\n\r\nfunc set_tests(test_names):\r\n\t_tests = []\r\n\tadd(test_names)\r\n\r\n\r\nfunc skip(test_name):\r\n\tif test_name == null:\r\n\t\treturn\r\n\tif typeof(test_name) == TYPE_STRING:\r\n\t\t_tests.erase(test_name)\r\n\telse:\r\n\t\tvar t\r\n\t\tfor t in test_name:\r\n\t\t\t_tests.erase(test_name)\r\n\r\n\r\n# ------------------------------------------------------------------------\r\n\r\n\r\nfunc check_true(text, bool_val):\r\n\tif ! bool_val:\r\n\t\tif _results != null:\r\n\t\t\t_results.add_error(text)\r\n\t\treturn false\r\n\treturn true\r\n\r\nfunc check_that(text, actual, matcher):\r\n\treturn check_true(text + \": \" + matcher.describe(actual), matcher.matches(actual))\r\n\r\nfunc check(text = \"\"):\r\n\treturn Checker.new(_results, text)\r\n\r\n\r\n\r\n\r\n# ------------------------------------------------------------------------\r\n\r\n# result_collector must implement these methods:\r\n# func start_suite(suite_name)\r\n# func end_suite()\r\n# func start_test(name)\r\n# func end_test()\r\n# func add_error(message)\r\n# func has_errors() (does the current suite have any errors?)\r\n\r\n\r\nfunc run(result_collector):\r\n\tself._results = result_collector\r\n\tresult_collector.start_suite(filename)\r\n\tclass_setup()\r\n\tif result_collector.has_error():\r\n\t\treturn\r\n\r\n\tvar t\r\n\tfor t in _tests:\r\n\t\tif has_method(t):\r\n\t\t\trun_test(t)\r\n\t\telse:\r\n\t\t\tresult_collector.add_error(\"Setup Error: requested function does not exist: \" + t)\r\n\r\n\tclass_teardown()\r\n\tresult_collector.end_suite()\r\n\r\n\r\nfunc run_test(name):\r\n\tif _results != null:\r\n\t\t_results.start_test(name)\r\n\tsetup()\r\n\tcall(name)\r\n\tteardown()\r\n\tif _results != null:\r\n\t\t_results.end_test()\r\n\r\n\r\n# -------------------------------------------------------------------------\r\n\r\n\r\nclass Matcher:\r\n\tfunc matches(value):\r\n\t\treturn false\r\n\tfunc describe(value):\r\n\t\treturn \"\"\r\n\tfunc _as_str(value):\r\n\t\tif value == null:\r\n\t\t\treturn \"\"\r\n\t\tif typeof(value) == TYPE_DICTIONARY:\r\n\t\t\treturn value.to_json()\r\n\t\treturn \"[\" + str(value) + \"]\"\r\n\tfunc _is_list(value):\r\n\t\t# return typeof(value) == TYPE_ARRAY || typeof(value) == TYPE_INT_ARRAY || typeof(value) == TYPE_REAL_ARRAY || typeof(value) == TYPE_STRING_ARRAY\r\n\t\t# All the arrays are in this specific range.\r\n\t\t# This needs to be checked against future versions of Godot.\r\n\t\tvar v = typeof(value)\r\n\t\treturn v >= TYPE_ARRAY && v <= TYPE_COLOR_ARRAY\r\n\r\n\r\nclass IsMatcher:\r\n\textends Matcher\r\n\tvar val\r\n\r\n\tfunc _init(v):\r\n\t\tval = v\r\n\r\n\tfunc matches(value):\r\n\t\treturn _inner_match(val, value, [])\r\n\r\n\tfunc _inner_match(v1, v2, seen):\r\n\t\tseen.append(v2)\r\n\t\t# Check lists the same way\r\n\t\tif _is_list(v1) && _is_list(v2):\r\n\t\t\tif v1.size() != v2.size():\r\n\t\t\t\treturn false\r\n\t\t\tvar i\r\n\t\t\tfor i in range(0, v1.size()):\r\n\t\t\t\tif v2[i] in seen:\r\n\t\t\t\t\t# This isn't a correct check; instead,\r\n\t\t\t\t\t# we need to ensure that the seen version of v2[i]\r\n\t\t\t\t\t# matches up with the corresponding seen version of v1[i]\r\n\t\t\t\t\tif v1[i] != v2[i]:\r\n\t\t\t\t\t\treturn false\r\n\t\t\t\t\t# Else prevent infinite loop by just\r\n\t\t\t\t\t# saying it's right.\r\n\t\t\t\telif ! _inner_match(v1[i], v2[i], seen):\r\n\t\t\t\t\treturn false\r\n\t\t\treturn true\r\n\t\t# Cannot perform a \"==\" if the types are different\r\n\t\tif typeof(v1) != typeof(v2):\r\n\t\t\treturn false\r\n\t\tif v1 == v2:\r\n\t\t\treturn true\r\n\t\tif typeof(v1) == TYPE_DICTIONARY:\r\n\t\t\tif v1.size() != v2.size():\r\n\t\t\t\treturn false\r\n\t\t\tvar k\r\n\t\t\tfor k in v1:\r\n\t\t\t\tif not (k in v2):\r\n\t\t\t\t\treturn false\r\n\t\t\t\tif v2[k] in seen:\r\n\t\t\t\t\t# This isn't a correct check; instead,\r\n\t\t\t\t\t# we need to ensure that the seen version of v2[i]\r\n\t\t\t\t\t# matches up with the corresponding seen version of v1[i]\r\n\t\t\t\t\tif v1[k] != v2[k]:\r\n\t\t\t\t\t\treturn false\r\n\t\t\t\telif ! _inner_match(v1[k], v2[k], seen):\r\n\t\t\t\t\treturn false\r\n\t\t\treturn true\r\n\t\t# Any other type should have == match right.\r\n\t\treturn false\r\n\r\n\tfunc describe(value):\r\n\t\treturn \"expected \" + _as_str(val) + \", found \" + _as_str(value)\r\n\r\n\r\n\r\nstatic func is(value):\r\n\t# \"is\" can be used to make a clear English-like sentence.\r\n\t# So, if the value is a matcher, then just use that matcher instead of\r\n\t# adding another layer around \"is\".\r\n\tif typeof(value) == TYPE_OBJECT && value.has_method(\"matches\") && value.has_method(\"describe\"):\r\n\t\treturn value\r\n\t# Need to wrap the value in an is check.\r\n\treturn IsMatcher.new(value)\r\n\r\n\r\nstatic func equals(value):\r\n\treturn IsMatcher.new(value)\r\n\r\n\r\nclass NotMatcher:\r\n\tvar val\r\n\r\n\tfunc _init(v):\r\n\t\tif typeof(v) == TYPE_OBJECT && v extends Matcher:\r\n\t\t\tval = v\r\n\t\telse:\r\n\t\t\tval = IsMatcher.new(v)\r\n\r\n\tfunc matches(value):\r\n\t\treturn ! val.matches(value)\r\n\r\n\tfunc describe(value):\r\n\t\treturn \"expected not: \" + val.describe(value)\r\n\r\n\r\n\r\nstatic func is_not(value):\r\n\treturn NotMatcher.new(value)\r\n\r\n\r\n\r\nclass BetweenMatcher:\r\n\tvar lo\r\n\tvar hi\r\n\r\n\tfunc _init(l, h):\r\n\t\tlo = float(l)\r\n\t\thi = float(h)\r\n\r\n\tfunc matches(value):\r\n\t\treturn value != null && float(value) >= lo && float(value) <= hi\r\n\r\n\tfunc describe(value):\r\n\t\treturn \"expected [\" + str(lo) + \", \" + str(hi) + \"], found \" + str(value)\r\n\r\n\r\n\r\nstatic func between(lo, hi):\r\n\treturn BetweenMatcher.new(lo, hi)\r\n\r\n\r\nclass NearMatcher:\r\n\tvar _epsilon\r\n\tvar _val\r\n\r\n\tfunc _init(val, epsilon = 0.00001):\r\n\t\t_epsilon = float(epsilon)\r\n\t\t_val = float(val)\r\n\r\n\tfunc matches(value):\r\n\t\treturn abs(float(value) - _val) <= _epsilon\r\n\r\n\tfunc describe(value):\r\n\t\treturn \"expected \" + str(_val) + \" within \" + str(_epsilon) + \", found \" + str(value)\r\n\r\n\r\nstatic func near(val, epsilon = 0.00001):\r\n\treturn NearMatcher.new(val, epsilon)\r\n\r\n\r\nclass ContainsMatcher:\r\n\textends Matcher\r\n\tvar _val\r\n\r\n\tfunc _init(val):\r\n\t\t_val = val\r\n\r\n\tfunc matches(actual):\r\n\t\tif actual == null:\r\n\t\t\treturn false\r\n\t\tif typeof(actual) == TYPE_STRING:\r\n\t\t\t# Expect a string to contain a sub-string\r\n\t\t\treturn actual.find(_val) >= 0\r\n\t\tif _is_list(actual):\r\n\t\t\tif _is_list(_val):\r\n\t\t\t\t# each \"val\" must be in the actual list\r\n\t\t\t\tvar v\r\n\t\t\t\tfor v in _val:\r\n\t\t\t\t\tif ! (v in actual):\r\n\t\t\t\t\t\treturn false\r\n\t\t\t\treturn true\r\n\t\t\treturn _val in actual\r\n\t\tif typeof(actual) == TYPE_RECT2:\r\n\t\t\tif typeof(_val) == TYPE_RECT2:\r\n\t\t\t\treturn actual.encloses(_val)\r\n\t\t\tif typeof(_val) == TYPE_VECTOR2:\r\n\t\t\t\treturn actual.has_point(_val)\r\n\t\t\treturn false\r\n\t\tif typeof(actual) == TYPE_PLANE:\r\n\t\t\tif typeof(_val) == TYPE_VECTOR3:\r\n\t\t\t\treturn actual.has_point(_val)\r\n\t\t\treturn false\r\n\t\tif typeof(actual) == TYPE_DICTIONARY:\r\n\t\t\tif _is_list(_val):\r\n\t\t\t\treturn actual.has_all(_val)\r\n\t\t \treturn actual.has(_val)\r\n\r\n\r\n\t\t# These don't really make sense.\r\n\r\n\t\t# Object values should just be checked for equality.\r\n\t\t#if typeof(actual) == TYPE_OBJECT:\r\n\t\t#\treturn actual.get(_val) != null\r\n\r\n\t\treturn false\r\n\r\n\tfunc describe(actual):\r\n\t\treturn \"expected \" + _as_str(actual) + \" to contain \" + _as_str(_val)\r\n\r\nstatic func contains(val):\r\n\treturn ContainsMatcher.new(val)\r\n\r\n\r\nclass EmptyMatcher:\r\n\textends Matcher\r\n\r\n\tfunc matches(actual):\r\n\t\tif _is_list(actual):\r\n\t\t\treturn actual.size() <= 0\r\n\t\tif typeof(actual) == TYPE_DICTIONARY:\r\n\t\t\treturn actual.keys().size() <= 0\r\n\t\treturn false\r\n\r\n\tfunc describe(actual):\r\n\t\tif _is_list(actual):\r\n\t\t\treturn \"expected \" + _as_str(actual) + \" to be an empty list\"\r\n\t\tif typeof(actual) == TYPE_DICTIONARY:\r\n\t\t\treturn \"expected \" + _as_str(actual) + \" to be an empty dictionary\"\r\n\t\treturn \"expected \" + _as_str(actual) + \" to be an empty list or dictionary\"\r\n\r\nstatic func empty():\r\n\treturn EmptyMatcher.new()\r\n\r\n\r\n# ---------------------------------------------------------------------------\r\n\r\nclass Checker:\r\n\tvar _text\r\n\tvar _results\r\n\r\n\tfunc _init(results, text):\r\n\t\t_results = results\r\n\t\t_text = text\r\n\r\n\tfunc that(actual, matcher):\r\n\t\tvar res\r\n\t\tvar msg\r\n\t\tif typeof(matcher) == TYPE_BOOL:\r\n\t\t\tres = matcher\r\n\t\t\tmsg = _text\r\n\t\telse:\r\n\t\t\tres = matcher.matches(actual)\r\n\t\t\tmsg = _text + \": \" + matcher.describe(actual)\r\n\t\tif ! res:\r\n\t\t\tif _results != null:\r\n\t\t\t\t_results.add_error(msg)\r\n\t\t\treturn false\r\n\t\treturn true\r\n","returncode":0,"stderr":"","license":"cc0-1.0","lang":"GDScript"} {"commit":"23c4072ee9b26aebe39315596aeb7641671be01e","subject":"damager of enemy now removed","message":"damager of enemy now removed\n","repos":"BK-TN\/IncendiumGame","old_file":"incendium\/scripts\/BossPart.gd","new_file":"incendium\/scripts\/BossPart.gd","new_contents":"\nextends Node2D\n\n# member variables here, example:\n# var a=2\n# var b=\"textvar\"\n\nconst max_health = 40\nvar health = max_health\nvar health_fade = 0.0\n\nfunc _ready():\n\t# Called every time the node is added to the scene.\n\t# Initialization here\n\tset_process(true)\n\tget_node(\"RegularPolygon\/Polygon2D\").set_color(Color(1,0,0))\n\tpass\n\t\nfunc _process(delta):\n\trotate(delta)\n\t\n\tif (health_fade > 0):\n\t\thealth_fade -= delta * 4\n\t\tif (health_fade < 0): health_fade = 0\n\t\tupdate()\n\t\nfunc _on_RegularPolygon_area_enter( area ):\n\tarea.queue_free()\n\thealth -= 1\n\thealth_fade = 1.0\n\tif health <= 0:\n\t\tqueue_free()\n\nfunc _draw():\n\tvar pgon = Vector2Array(get_node(\"RegularPolygon\/Polygon2D\").get_polygon())\n\tvar colors = Array()\n\tfor i in range(0,pgon.size()):\n\t\tpgon[i] = pgon[i] * (1.0 - float(health) \/ max_health)\n\t\tcolors.append(Color(1,1,1,health_fade))\n\tdraw_polygon(pgon,colors)","old_contents":"\nextends Node2D\n\n# member variables here, example:\n# var a=2\n# var b=\"textvar\"\n\nconst max_health = 20\nvar health = max_health\nvar health_fade = 0.0\n\nfunc _ready():\n\t# Called every time the node is added to the scene.\n\t# Initialization here\n\tset_process(true)\n\tget_node(\"RegularPolygon\/Polygon2D\").set_color(Color(1,0,0))\n\tpass\n\t\nfunc _process(delta):\n\trotate(delta)\n\t\n\tif (health_fade > 0):\n\t\thealth_fade -= delta * 4\n\t\tif (health_fade < 0): health_fade = 0\n\t\tupdate()\n\t\nfunc _on_RegularPolygon_area_enter( area ):\n\thealth -= 1\n\thealth_fade = 1.0\n\tif health <= 0:\n\t\tqueue_free()\n\nfunc _draw():\n\tvar pgon = Vector2Array(get_node(\"RegularPolygon\/Polygon2D\").get_polygon())\n\tvar colors = Array()\n\tfor i in range(0,pgon.size()):\n\t\tpgon[i] = pgon[i] * (1.0 - float(health) \/ max_health)\n\t\tprint(health \/ max_health)\n\t\tcolors.append(Color(1,1,1,health_fade))\n\tdraw_polygon(pgon,colors)","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"9390adbb6b3055f58db2f0ac938a687127a4482a","subject":"Moved Doge Prime in his room","message":"Moved Doge Prime in his room\n","repos":"P1X-in\/rat-is-fat","old_file":"scripts\/map\/rooms\/boss1_room.gd","new_file":"scripts\/map\/rooms\/boss1_room.gd","new_contents":"extends \"res:\/\/scripts\/map\/rooms\/abstract_room.gd\"\n\nfunc _init():\n self.room = [\n [ 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6],\n [ 7, 1, 2, 107, 0, 106, 2, 107, 106, 107, 107, 2, 107, 106, 107, 1, 2, 107, 2, 9],\n [ 7, 106, 2, 2, 107, 106, 2, 2, 107, 2, 107, 1, 106, 106, 2, 107, 107, 106, 107, 9],\n [ 7, 0, 106, 106, 2, 106, 107, 106, 107, 106, 1, 106, 106, 2, 107, 106, 2, 0, 3, 9],\n [ 7, 107, 107, 107, 106, 0, 2, 106, 2, 29, 0, 106, 2, 107, 1, 107, 107, 106, 107, 9],\n [ 7, 2, 0, 8, 106, 107, 107, 106, 2, 106, 107, 0, 2, 107, 2, 107, 2, 106, 106, 9],\n [ 7, 107, 106, 1, 107, 107, 2, 8, 107, 0, 106, 106, 107, 107, 107, 2, 106, 1, 2, 9],\n [ 7, 106, 0, 106, 1, 2, 2, 106, 2, 106, 1, 106, 3, 2, 107, 106, 106, 106, 106, 9],\n [ 7, 106, 107, 107, 107, 106, 2, 107, 1, 2, 2, 1, 107, 1, 106, 2, 0, 107, 107, 9],\n [ 12, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11],\n\n ]\n\n self.enemies = [\n [9, 5, 'doge_prime'],\n ]\n\n self.doors = [\n [9, 4, 'trapdoor'],\n ]\n\n self.exits = [\n [9, 4, 'next']\n ]\n","old_contents":"extends \"res:\/\/scripts\/map\/rooms\/abstract_room.gd\"\n\nfunc _init():\n self.room = [\n [ 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6],\n [ 7, 1, 2, 107, 0, 106, 2, 107, 106, 107, 107, 2, 107, 106, 107, 1, 2, 107, 2, 9],\n [ 7, 106, 2, 2, 107, 106, 2, 2, 107, 2, 107, 1, 106, 106, 2, 29, 107, 106, 107, 9],\n [ 7, 0, 106, 106, 2, 106, 107, 106, 107, 106, 1, 106, 106, 2, 107, 106, 2, 0, 3, 9],\n [ 7, 107, 107, 107, 106, 0, 2, 106, 2, 107, 0, 106, 2, 107, 1, 107, 107, 106, 107, 9],\n [ 7, 2, 0, 8, 106, 107, 107, 106, 2, 106, 107, 0, 2, 107, 2, 107, 2, 106, 106, 9],\n [ 7, 107, 106, 1, 107, 107, 2, 8, 107, 0, 106, 106, 107, 107, 107, 2, 106, 1, 2, 9],\n [ 7, 106, 0, 106, 1, 2, 2, 106, 2, 106, 1, 106, 3, 2, 107, 106, 106, 106, 106, 9],\n [ 7, 106, 107, 107, 107, 106, 2, 107, 1, 2, 2, 1, 107, 1, 106, 2, 0, 107, 107, 9],\n [ 12, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11],\n\n ]\n\n self.enemies = [\n [15, 3, 'doge_prime'],\n ]\n\n self.doors = [\n [15, 2, 'trapdoor'],\n ]\n\n self.exits = [\n [15, 2, 'next']\n ]\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"1fb5703231900a2c5d12982525758f55d7ca7b66","subject":"room3 easy","message":"room3 easy\n","repos":"P1X-in\/rat-is-fat","old_file":"scripts\/map\/rooms\/easy3_room.gd","new_file":"scripts\/map\/rooms\/easy3_room.gd","new_contents":"extends \"res:\/\/scripts\/map\/rooms\/abstract_room.gd\"\n\nfunc _init():\n self.room = [\n [ 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6],\n [ 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9],\n [ 7, 0, 0, 15, 10, 10, 10, 10, 10, 10, 10, 10, 10, 16, 0, 0, 9],\n [ 7, 0, 0, 9, 4, 5, 5, 5, 5, 5, 5, 5, 6, 7, 0, 0, 9],\n [ 7, 0, 0, 9, 7, 0, 0, 0, 0, 0, 0, 0, 9, 7, 0, 0, 9],\n [ 7, 0, 0, 9, 7, 0, 0, 0, 0, 0, 0, 0, 9, 7, 0, 0, 9],\n [ 7, 0, 0, 9, 7, 0, 0, 0, 0, 0, 0, 0, 9, 7, 0, 0, 9],\n [ 7, 0, 0, 9, 12, 10, 10, 10, 10, 10, 10, 10, 11, 7, 0, 0, 9],\n [ 7, 0, 0, 13, 5, 5, 5, 5, 5, 5, 5, 5, 5, 14, 0, 0, 9],\n [ 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9],\n [12, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11],\n ]\n\n self.enemies = [\n [3, 3, null, 1],\n [14, 3, null, 1],\n [3, 8, null, 1],\n [14, 8, null, 1],\n ]\n\n self.items = [\n [7, 5, 'cheese']\n ]","old_contents":"extends \"res:\/\/scripts\/map\/rooms\/abstract_room.gd\"\n\nfunc _init():\n self.room = [\n [ 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6],\n [ 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9],\n [ 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9],\n [ 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9],\n [ 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9],\n [ 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9],\n [ 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9],\n [ 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9],\n [ 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9],\n [ 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9],\n [12, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11],\n ]\n\n self.enemies = [\n [3, 3, null, 1],\n [14, 3, null, 1],\n [3, 8, null, 1],\n [14, 8, null, 1],\n ]\n\n self.items = [\n [7, 5, 'cheese']\n ]","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"de93c0792c7236a8b4335b26ce34b120090284c7","subject":"Balancing change","message":"Balancing change\n","repos":"Sir-Meeseeks\/WizarDos","old_file":"scripts\/fireballArea.gd","new_file":"scripts\/fireballArea.gd","new_contents":"extends Area2D\n\nvar damage = null\n\nfunc solveBodyCollision(body):\n\tif (body.has_method(\"amIWizard\")):\n\t\tif (body.amIWizard() != get_parent().get_parent().property):\n\t\t\tbody.damage(damage,\"fire\")\n\t\t\tbody.burn()\n\t\t\tget_parent().get_parent().queue_free()\n\telse:\n\t\tget_parent().get_parent().queue_free()\n\nfunc _ready():\n\tdamage = 10\n\tconnect('body_enter',self,'solveBodyCollision')","old_contents":"extends Area2D\n\nvar damage = null\n\nfunc solveBodyCollision(body):\n\tif (body.has_method(\"amIWizard\")):\n\t\tif (body.amIWizard() != get_parent().get_parent().property):\n\t\t\tbody.damage(damage,\"fire\")\n\t\t\tbody.burn()\n\t\t\tget_parent().get_parent().queue_free()\n\telse:\n\t\tget_parent().get_parent().queue_free()\n\nfunc _ready():\n\tdamage = 100\n\tconnect('body_enter',self,'solveBodyCollision')","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"8bdf0a75eaed2c151c4ffb4f6c4cf74e807112ca","subject":"Fix zylann benchmark by renaming IntArray -> PoolIntArray","message":"Fix zylann benchmark by renaming IntArray -> PoolIntArray\n","repos":"godotengine\/godot-tests,godotengine\/godot-tests","old_file":"benchmarks\/zylann\/gdscript_microtests.gd","new_file":"benchmarks\/zylann\/gdscript_microtests.gd","new_contents":"# This script prints how much time GDScript takes to performs specific instructions.\n\n# Times values are in arbitrary units but share the same scale,\n# so for example if test A prints 100 and test B prints 200,\n# we can say that test A is 2x faster than test B.\n\n# All tests run a very long loop containing the code to profile,\n# in order to obtain a reasonable time information.\n# The cost of the loop itself is then subtracted to all tests.\n# Iteration count is the same for all tests.\n# There shouldn't be race conditions between loops.\n\n# Results will be approximate and vary between executions and CPU speed,\n# but the error margin should be low enough to make conclusions on most tests.\n# If not, please set the ITERATIONS constant to higher values to reduce the margin.\n\n\n# TODO Output results in a JSON file so we can reload and compare them afterwards\n# TODO Add tests for complete algorithms such as primes, fibonacci etc\n# TODO Add tests on strings\n\ntool\nextends SceneTree\n\n# How many times test loops are ran. Higher is slower, but gives better average.\nconst ITERATIONS = 500000\n\n# Per case:\n# True: print time for 1 loop\n# False: print time for all loops\nconst PRINT_PER_TEST_TIME = false\n\nvar _time_before = 0\nvar _for_time = 0\nvar _test_name = \"\"\nvar _test_results = []\n\n# ---------\n# Members used by tests\nvar _test_a = 1\n# ---------\n\n\nfunc _init():\n\t_ready()\n\tquit()\n\n\nfunc _ready():\n\tprint(\"-------------------\")\n\t\n\t_time_before = OS.get_ticks_msec()\n\t\n\tstart()\n\t\n\tfor i in range(0,ITERATIONS):\n\t\tpass\n\t\n\t_for_time = stop()\n\tprint(\"For time: \" + str(_for_time))\n\t\n\tprint(\"\")\n\tif PRINT_PER_TEST_TIME:\n\t\tprint(\"The following times are in microseconds taken for 1 test.\")\n\telse:\n\t \tprint(\"The following times are in seconds for the whole test.\")\n\tprint(\"\")\n\n\t#-------------------------------------------------------\n\ttest_empty_func()\n\ttest_increment()\n\ttest_increment_x5()\n\ttest_increment_with_member_var()\n\ttest_increment_with_local_outside_loop()\n\ttest_increment_with_local_inside_loop()\n\ttest_increment_vector2()\n\ttest_increment_vector3()\n\ttest_increment_vector3_constant()\n\ttest_increment_vector3_individual_xyz()\n\ttest_unused_local()\n\ttest_divide()\n\ttest_increment_with_dictionary_member()\n\ttest_increment_with_array_member()\n\ttest_while_time()\n\ttest_if_true()\n\ttest_if_true_else()\n\ttest_variant_array_resize()\n\ttest_variant_array_assign()\n\ttest_int_array_resize()\n\ttest_int_array_assign()\n\n\tprint(\"-------------------\")\n\tprint(\"Done.\")\n\n\nfunc start(name=\"\"):\n\t_test_name = name\n\t_time_before = OS.get_ticks_msec()\n\n\nfunc stop():\n\tvar time = OS.get_ticks_msec() - _time_before\n\tif _test_name.length() != 0:\n\t\tvar test_time = time - _for_time\n\t\t\n\t\tif PRINT_PER_TEST_TIME:\n\t\t\t# Time taken for 1 test\n\t\t\tvar k = 1000000.0 \/ ITERATIONS\n\t\t\ttest_time = k * test_time\n\t\t\n\t\tprint(_test_name + \": \" + str(test_time))# + \" (with for: \" + str(time) + \")\")\n\t\t_test_results.append({\n\t\t\tname = _test_name,\n\t\t\ttime = test_time\n\t\t})\n\treturn time\n\n\n#-------------------------------------------------------------------------------\nfunc test_empty_func():\n\tstart(\"Empty func (void function call cost)\")\n\t\n\tfor i in range(0,ITERATIONS):\n\t\tempty_func()\n\t\n\tstop()\n\nfunc empty_func():\n\tpass\n\n#-------------------------------------------------------------------------------\nfunc test_increment():\n\tvar a = 0\n\t\n\tstart(\"Increment\")\n\t\n\tfor i in range(0,ITERATIONS):\n\t\ta += 1\n\t\n\tstop()\n\n#-------------------------------------------------------------------------------\nfunc test_increment_x5():\n\tvar a = 0\n\t\n\tstart(\"Increment x5\")\n\t\n\tfor i in range(0,ITERATIONS):\n\t\ta += 1\n\t\ta += 1\n\t\ta += 1\n\t\ta += 1\n\t\ta += 1\n\t\n\tstop()\n\n#-------------------------------------------------------------------------------\nfunc test_increment_with_member_var():\n\tvar a = 0\n\t\n\tstart(\"Increment with member var\")\n\t\n\tfor i in range(0,ITERATIONS):\n\t\ta += _test_a\n\t\n\tstop()\n\n#-------------------------------------------------------------------------------\nfunc test_increment_with_local_outside_loop():\n\tvar a = 0\n\tvar b = 1\n\t\n\tstart(\"Increment with local (outside loop)\")\n\t\n\tfor i in range(0,ITERATIONS):\n\t\ta += b\n\t\n\tstop()\n\n#-------------------------------------------------------------------------------\nfunc test_increment_with_local_inside_loop():\n\tvar a = 0\n\t\n\tstart(\"Increment with local (inside loop)\")\n\t\n\tfor i in range(0,ITERATIONS):\n\t\tvar b = 1\n\t\ta += b\n\t\n\tstop()\n\n#-------------------------------------------------------------------------------\nfunc test_increment_vector2():\n\tvar a = Vector2(0,0)\n\tvar b = Vector2(1,1)\n\t\n\tstart(\"Increment Vector2\")\n\t\n\tfor i in range(0, ITERATIONS):\n\t\ta += b\n\t\n\tstop()\n\n#-------------------------------------------------------------------------------\nfunc test_increment_vector3():\n\tvar a = Vector3(0,0,0)\n\tvar b = Vector3(1,1,1)\n\t\n\tstart(\"Increment Vector3\")\n\t\n\tfor i in range(0, ITERATIONS):\n\t\ta += b\n\t\n\tstop()\n\n#-------------------------------------------------------------------------------\nfunc test_increment_vector3_constant():\n\tvar a = Vector3(0,0,0)\n\t\n\tstart(\"Increment Vector3 with constant\")\n\t\n\tfor i in range(0, ITERATIONS):\n\t\ta += Vector3(1,1,1)\n\t\n\tstop()\n\n#-------------------------------------------------------------------------------\nfunc test_increment_vector3_individual_xyz():\n\tvar a = Vector3(0,0,0)\n\tvar b = Vector3(1,1,1)\n\t\n\tstart(\"Increment Vector3 coordinate by coordinate\")\n\t\n\tfor i in range(0, ITERATIONS):\n\t\ta.x += b.x\n\t\ta.y += b.y\n\t\ta.z += b.z\n\t\n\tstop()\n\t\n#-------------------------------------------------------------------------------\nfunc test_unused_local():\n\tstart(\"Unused local (declaration cost)\")\n\t\n\tfor i in range(0,ITERATIONS):\n\t\tvar b = 1\n\t\n\tstop()\n\n#-------------------------------------------------------------------------------\nfunc test_divide():\n\tstart(\"Divide\")\n\t\n\tvar a = 9999\n\tfor i in range(0,ITERATIONS):\n\t\ta \/= 1.01\n\t\n\tstop()\n\n#-------------------------------------------------------------------------------\nfunc test_increment_with_dictionary_member():\n\tstart(\"Increment with dictionary member\")\n\t\n\tvar a = 0\n\tvar dic = {b = 1}\n\tfor i in range(0,ITERATIONS):\n\t\ta += dic.b\n\t\n\tstop()\n\n#-------------------------------------------------------------------------------\nfunc test_increment_with_array_member():\n\tstart(\"Increment with array member\")\n\t\n\tvar a = 0\n\tvar arr = [1]\n\tfor i in range(0,ITERATIONS):\n\t\ta += arr[0]\n\t\n\tstop()\n\n#-------------------------------------------------------------------------------\nfunc test_while_time():\n\tstart(\"While time\")\n\t\n\tvar i = 0\n\twhile i < ITERATIONS:\n\t\ti += 1\n\t\t\n\tprint(\"While time (for equivalent with manual increment): \" + str(OS.get_ticks_msec() - _time_before))\n\n#-------------------------------------------------------------------------------\nfunc test_if_true():\n\tstart(\"if(true) time\")\n\tfor i in range(0,ITERATIONS):\n\t\tif true:\n\t\t\tpass\n\t\n\tstop()\n\n#-------------------------------------------------------------------------------\nfunc test_if_true_else():\n\tstart(\"if(true)else time\")\n\tfor i in range(0,ITERATIONS):\n\t\tif true:\n\t\t\tpass\n\t\telse:\n\t\t\tpass\n\t\n\tstop()\n\n#-------------------------------------------------------------------------------\nfunc test_variant_array_resize():\n\tstart(\"VariantArray resize\")\n\tfor i in range(0,ITERATIONS):\n\t\tvar line = []\n\t\tline.resize(1000)\n\t\n\tstop()\n\n#-------------------------------------------------------\nfunc test_variant_array_assign():\n\tvar v_array = []\n\tv_array.resize(100)\n\t\n\tstart(\"VariantArray set element\")\n\tfor i in range(0, ITERATIONS):\n\t\tv_array[42] = 0\n\t\n\tstop()\n\n#-------------------------------------------------------\nfunc test_int_array_resize():\n\tstart(\"PoolIntArray resize\")\n\tfor i in range(0,ITERATIONS):\n\t\tvar line = PoolIntArray()\n\t\tline.resize(1000)\n\t\n\tstop()\n\t\t\n#-------------------------------------------------------\nfunc test_int_array_assign():\n\tvar i_array = PoolIntArray()\n\ti_array.resize(100)\n\n\tstart(\"PoolIntArray set element\")\n\tfor i in range(0, ITERATIONS):\n\t\ti_array[42] = 0\n\t\n\tstop()\n","old_contents":"# This script prints how much time GDScript takes to performs specific instructions.\n\n# Times values are in arbitrary units but share the same scale,\n# so for example if test A prints 100 and test B prints 200,\n# we can say that test A is 2x faster than test B.\n\n# All tests run a very long loop containing the code to profile,\n# in order to obtain a reasonable time information.\n# The cost of the loop itself is then subtracted to all tests.\n# Iteration count is the same for all tests.\n# There shouldn't be race conditions between loops.\n\n# Results will be approximate and vary between executions and CPU speed,\n# but the error margin should be low enough to make conclusions on most tests.\n# If not, please set the ITERATIONS constant to higher values to reduce the margin.\n\n\n# TODO Output results in a JSON file so we can reload and compare them afterwards\n# TODO Add tests for complete algorithms such as primes, fibonacci etc\n# TODO Add tests on strings\n\ntool\nextends SceneTree\n\n# How many times test loops are ran. Higher is slower, but gives better average.\nconst ITERATIONS = 500000\n\n# Per case:\n# True: print time for 1 loop\n# False: print time for all loops\nconst PRINT_PER_TEST_TIME = false\n\nvar _time_before = 0\nvar _for_time = 0\nvar _test_name = \"\"\nvar _test_results = []\n\n# ---------\n# Members used by tests\nvar _test_a = 1\n# ---------\n\n\nfunc _init():\n\t_ready()\n\tquit()\n\n\nfunc _ready():\n\tprint(\"-------------------\")\n\t\n\t_time_before = OS.get_ticks_msec()\n\t\n\tstart()\n\t\n\tfor i in range(0,ITERATIONS):\n\t\tpass\n\t\n\t_for_time = stop()\n\tprint(\"For time: \" + str(_for_time))\n\t\n\tprint(\"\")\n\tif PRINT_PER_TEST_TIME:\n\t\tprint(\"The following times are in microseconds taken for 1 test.\")\n\telse:\n\t \tprint(\"The following times are in seconds for the whole test.\")\n\tprint(\"\")\n\n\t#-------------------------------------------------------\n\ttest_empty_func()\n\ttest_increment()\n\ttest_increment_x5()\n\ttest_increment_with_member_var()\n\ttest_increment_with_local_outside_loop()\n\ttest_increment_with_local_inside_loop()\n\ttest_increment_vector2()\n\ttest_increment_vector3()\n\ttest_increment_vector3_constant()\n\ttest_increment_vector3_individual_xyz()\n\ttest_unused_local()\n\ttest_divide()\n\ttest_increment_with_dictionary_member()\n\ttest_increment_with_array_member()\n\ttest_while_time()\n\ttest_if_true()\n\ttest_if_true_else()\n\ttest_variant_array_resize()\n\ttest_variant_array_assign()\n\ttest_int_array_resize()\n\ttest_int_array_assign()\n\n\tprint(\"-------------------\")\n\tprint(\"Done.\")\n\n\nfunc start(name=\"\"):\n\t_test_name = name\n\t_time_before = OS.get_ticks_msec()\n\n\nfunc stop():\n\tvar time = OS.get_ticks_msec() - _time_before\n\tif _test_name.length() != 0:\n\t\tvar test_time = time - _for_time\n\t\t\n\t\tif PRINT_PER_TEST_TIME:\n\t\t\t# Time taken for 1 test\n\t\t\tvar k = 1000000.0 \/ ITERATIONS\n\t\t\ttest_time = k * test_time\n\t\t\n\t\tprint(_test_name + \": \" + str(test_time))# + \" (with for: \" + str(time) + \")\")\n\t\t_test_results.append({\n\t\t\tname = _test_name,\n\t\t\ttime = test_time\n\t\t})\n\treturn time\n\n\n#-------------------------------------------------------------------------------\nfunc test_empty_func():\n\tstart(\"Empty func (void function call cost)\")\n\t\n\tfor i in range(0,ITERATIONS):\n\t\tempty_func()\n\t\n\tstop()\n\nfunc empty_func():\n\tpass\n\n#-------------------------------------------------------------------------------\nfunc test_increment():\n\tvar a = 0\n\t\n\tstart(\"Increment\")\n\t\n\tfor i in range(0,ITERATIONS):\n\t\ta += 1\n\t\n\tstop()\n\n#-------------------------------------------------------------------------------\nfunc test_increment_x5():\n\tvar a = 0\n\t\n\tstart(\"Increment x5\")\n\t\n\tfor i in range(0,ITERATIONS):\n\t\ta += 1\n\t\ta += 1\n\t\ta += 1\n\t\ta += 1\n\t\ta += 1\n\t\n\tstop()\n\n#-------------------------------------------------------------------------------\nfunc test_increment_with_member_var():\n\tvar a = 0\n\t\n\tstart(\"Increment with member var\")\n\t\n\tfor i in range(0,ITERATIONS):\n\t\ta += _test_a\n\t\n\tstop()\n\n#-------------------------------------------------------------------------------\nfunc test_increment_with_local_outside_loop():\n\tvar a = 0\n\tvar b = 1\n\t\n\tstart(\"Increment with local (outside loop)\")\n\t\n\tfor i in range(0,ITERATIONS):\n\t\ta += b\n\t\n\tstop()\n\n#-------------------------------------------------------------------------------\nfunc test_increment_with_local_inside_loop():\n\tvar a = 0\n\t\n\tstart(\"Increment with local (inside loop)\")\n\t\n\tfor i in range(0,ITERATIONS):\n\t\tvar b = 1\n\t\ta += b\n\t\n\tstop()\n\n#-------------------------------------------------------------------------------\nfunc test_increment_vector2():\n\tvar a = Vector2(0,0)\n\tvar b = Vector2(1,1)\n\t\n\tstart(\"Increment Vector2\")\n\t\n\tfor i in range(0, ITERATIONS):\n\t\ta += b\n\t\n\tstop()\n\n#-------------------------------------------------------------------------------\nfunc test_increment_vector3():\n\tvar a = Vector3(0,0,0)\n\tvar b = Vector3(1,1,1)\n\t\n\tstart(\"Increment Vector3\")\n\t\n\tfor i in range(0, ITERATIONS):\n\t\ta += b\n\t\n\tstop()\n\n#-------------------------------------------------------------------------------\nfunc test_increment_vector3_constant():\n\tvar a = Vector3(0,0,0)\n\t\n\tstart(\"Increment Vector3 with constant\")\n\t\n\tfor i in range(0, ITERATIONS):\n\t\ta += Vector3(1,1,1)\n\t\n\tstop()\n\n#-------------------------------------------------------------------------------\nfunc test_increment_vector3_individual_xyz():\n\tvar a = Vector3(0,0,0)\n\tvar b = Vector3(1,1,1)\n\t\n\tstart(\"Increment Vector3 coordinate by coordinate\")\n\t\n\tfor i in range(0, ITERATIONS):\n\t\ta.x += b.x\n\t\ta.y += b.y\n\t\ta.z += b.z\n\t\n\tstop()\n\t\n#-------------------------------------------------------------------------------\nfunc test_unused_local():\n\tstart(\"Unused local (declaration cost)\")\n\t\n\tfor i in range(0,ITERATIONS):\n\t\tvar b = 1\n\t\n\tstop()\n\n#-------------------------------------------------------------------------------\nfunc test_divide():\n\tstart(\"Divide\")\n\t\n\tvar a = 9999\n\tfor i in range(0,ITERATIONS):\n\t\ta \/= 1.01\n\t\n\tstop()\n\n#-------------------------------------------------------------------------------\nfunc test_increment_with_dictionary_member():\n\tstart(\"Increment with dictionary member\")\n\t\n\tvar a = 0\n\tvar dic = {b = 1}\n\tfor i in range(0,ITERATIONS):\n\t\ta += dic.b\n\t\n\tstop()\n\n#-------------------------------------------------------------------------------\nfunc test_increment_with_array_member():\n\tstart(\"Increment with array member\")\n\t\n\tvar a = 0\n\tvar arr = [1]\n\tfor i in range(0,ITERATIONS):\n\t\ta += arr[0]\n\t\n\tstop()\n\n#-------------------------------------------------------------------------------\nfunc test_while_time():\n\tstart(\"While time\")\n\t\n\tvar i = 0\n\twhile i < ITERATIONS:\n\t\ti += 1\n\t\t\n\tprint(\"While time (for equivalent with manual increment): \" + str(OS.get_ticks_msec() - _time_before))\n\n#-------------------------------------------------------------------------------\nfunc test_if_true():\n\tstart(\"if(true) time\")\n\tfor i in range(0,ITERATIONS):\n\t\tif true:\n\t\t\tpass\n\t\n\tstop()\n\n#-------------------------------------------------------------------------------\nfunc test_if_true_else():\n\tstart(\"if(true)else time\")\n\tfor i in range(0,ITERATIONS):\n\t\tif true:\n\t\t\tpass\n\t\telse:\n\t\t\tpass\n\t\n\tstop()\n\n#-------------------------------------------------------------------------------\nfunc test_variant_array_resize():\n\tstart(\"VariantArray resize\")\n\tfor i in range(0,ITERATIONS):\n\t\tvar line = []\n\t\tline.resize(1000)\n\t\n\tstop()\n\n#-------------------------------------------------------\nfunc test_variant_array_assign():\n\tvar v_array = []\n\tv_array.resize(100)\n\t\n\tstart(\"VariantArray set element\")\n\tfor i in range(0, ITERATIONS):\n\t\tv_array[42] = 0\n\t\n\tstop()\n\n#-------------------------------------------------------\nfunc test_int_array_resize():\n\tstart(\"IntArray resize\")\n\tfor i in range(0,ITERATIONS):\n\t\tvar line = IntArray()\n\t\tline.resize(1000)\n\t\n\tstop()\n\t\t\n#-------------------------------------------------------\nfunc test_int_array_assign():\n\tvar i_array = IntArray()\n\ti_array.resize(100)\n\n\tstart(\"IntArray set element\")\n\tfor i in range(0, ITERATIONS):\n\t\ti_array[42] = 0\n\t\n\tstop()\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"2136c996723016ac2ae3e6f4d8e1c41c3d5b14b0","subject":"Fixed up LookAt IK code so it better follows the style guide. Touched up a bunch of the comments","message":"Fixed up LookAt IK code so it better follows the style guide. Touched up a bunch of the comments\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"3d\/ik\/addons\/sade\/ik_look_at.gd","new_file":"3d\/ik\/addons\/sade\/ik_look_at.gd","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"mit","lang":"GDScript"} {"commit":"51ac3450403b6d5cc7d9c122c2f86ad391ba9411","subject":"Fix the weekday comparison; based upon experiments from the gregarian \"cal\" program.","message":"Fix the weekday comparison; based upon experiments from the gregarian \"cal\" program.\n","repos":"groboclown\/godot-bootstrap","old_file":"components\/datetime\/datetime.gd","new_file":"components\/datetime\/datetime.gd","new_contents":"\r\n# Date and time utilities\r\n# Note: due to limitations of GDScript (static functions cannot reference the\r\n# original script), this must be instantiated to be used.\r\n\r\n# OS.get_time() returns: {\r\n# 'hour': int, 'minute': int, 'second': int\r\n# }\r\n# OS.get_date() returns: {\r\n# 'day': int, 'dst': boolean, 'month': int, 'weekday': int, 'year': int\r\n# }\r\n\r\n# Conforms to many of the Standard C (1989 version) datetime string format\r\n# parameters.\r\n# The name translations (weekday name, month name) must be provided, or the\r\n# en_US version will be returned.\r\n\r\n# Date calculations are based upon Gregorian Calendar.\r\n\r\n\r\n\r\nstatic func date_to_str(format, date_obj=null):\r\n\tif date_obj == null:\r\n\t\tdate_obj = OS.get_date()\r\n\treturn preload(\"stringfunc.gd\").format(format, preload(\"datetime\/formats.gd\").date_values({}, date_obj))\r\n\r\n\r\nstatic func time_to_str(format, time_obj=null):\r\n\tif time_obj == null:\r\n\t\ttime_obj = OS.get_time()\r\n\treturn preload(\"stringfunc.gd\").format(format, preload(\"datetime\/formats.gd\").time_values({}, time_obj))\r\n\r\n\r\nstatic func datetime_to_str(format, date_obj=null, time_obj=null):\r\n\tif date_obj == null:\r\n\t\tdate_obj = OS.get_date()\r\n\tif time_obj == null:\r\n\t\ttime_obj = OS.get_time()\r\n\tvar formats = preload(\"datetime\/formats.gd\")\r\n\tvar vals = formats.date_values({}, date_obj)\r\n\tvals = formats.time_values(vals, time_obj)\r\n\treturn preload(\"stringfunc.gd\").format(format, vals)\r\n\r\n\r\nconst _DAYS_IN_MONTH = [-1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]\r\n\r\n# number of days in 400 years\r\n# y = 401, y*365 + y\/4 - y\/100 + y\/400\r\nconst _DAYS_IN_400Y = 146097\r\n# number of days in 100 years\r\n# y = 101, y*365 + y\/4 - y\/100 + y\/400\r\nconst _DAYS_IN_100Y = 36524\r\n# number of days in 4 years\r\n# y = 5, y*365 + y\/4 - y\/100 + y\/400\r\nconst _DAYS_IN_4Y = 1461\r\n\r\nstatic func date_add(date_obj, days):\r\n\t# Adds the date delta (which is a get_date() structure, but only the\r\n\t# Month, day, and year matter).\r\n\r\n\treturn _ord_to_date(_date_to_ord(date_obj) + days)\r\n\r\n\r\n\r\n\r\nstatic func _is_leapyear(year):\r\n\treturn year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)\r\n\r\nstatic func _date_to_ord(date_obj):\r\n\t# Converts a valid date object to days since Jan 1, year 1 (which is day 0).\r\n\tvar month = int(date_obj[\"month\"])\r\n\tvar year = int(date_obj[\"year\"])\r\n\tvar day = int(date_obj[\"day\"])\r\n\tassert(month >= 1 && month <= 12)\r\n\r\n\tvar days_in_month\r\n\tif month == 2 and _is_leapyear(year):\r\n\t\tdays_in_month = 29\r\n\telse:\r\n\t\tdays_in_month = _DAYS_IN_MONTH[date_obj[\"month\"]]\r\n\tassert(day >= 1 && day <= days_in_month)\r\n\r\n\t# Day 0 == Jan 1, so subtract a day\r\n\tday -= 1\r\n\r\n\t# Days before year:\r\n\tvar y = year - 1\r\n\tday += y*365 + y\/4 - y\/100 + y\/400\r\n\r\n\t# Days before month, for this year\r\n\tvar i\r\n\tfor i in range(1, month):\r\n\t\tif i == 2 and _is_leapyear(year):\r\n\t\t\tday += 29\r\n\t\telse:\r\n\t\t\tday += _DAYS_IN_MONTH[i]\r\n\r\n\treturn day\r\n\r\n\r\nstatic func _ord_to_date(ord):\r\n\t# Converts days since Jan 1, year 1, to a date object.\r\n\t# Note that day 0 is a Sunday. We're not caring about the\r\n\t# Julian \/ Gegorian calendar changes.\r\n\r\n\tvar ret = {\r\n\t\t\"year\": 0,\r\n\t\t\"day\": 0,\r\n\t\t\"month\": 0,\r\n\t\t\"dst\": false,\r\n\t\t# + 1 here because that's just how the calendar lines up once we're\r\n\t\t# in the modern era.\r\n\t\t\"weekday\": (ord + 1) % 7\r\n\t}\r\n\r\n\tvar n400 = ord \/ _DAYS_IN_400Y\r\n\tvar n = ord % _DAYS_IN_400Y\r\n\tvar year = n400 * 400 + 1\r\n\r\n\tvar n100 = n \/ _DAYS_IN_100Y\r\n\tn = n % _DAYS_IN_100Y\r\n\r\n\tvar n4 = n \/ _DAYS_IN_4Y\r\n\tn = n % _DAYS_IN_4Y\r\n\r\n\tvar n1 = n \/ 365\r\n\tn = n % 365\r\n\r\n\tyear += n100 * 100 + n4 * 4 + n1\r\n\tif n1 == 4 or n100 == 4:\r\n\t\tassert(n != 0)\r\n\t\tret[\"year\"] = year - 1\r\n\t\tret[\"month\"] = 12\r\n\t\tret[\"day\"] = 31\r\n\t\treturn ret\r\n\tret[\"year\"] = year\r\n\r\n\tvar is_leapyear = _is_leapyear(year)\r\n\tvar month = 1\r\n\t# n is base 0, so do >= comparison\r\n\twhile n >= _DAYS_IN_MONTH[month]:\r\n\t\tn -= _DAYS_IN_MONTH[month]\r\n\t\tmonth += 1\r\n\t\tassert(month <= 12)\r\n\tret[\"day\"] = n + 1\r\n\tret[\"month\"] = month\r\n\treturn ret\r\n","old_contents":"\r\n# Date and time utilities\r\n# Note: due to limitations of GDScript (static functions cannot reference the\r\n# original script), this must be instantiated to be used.\r\n\r\n# OS.get_time() returns: {\r\n# 'hour': int, 'minute': int, 'second': int\r\n# }\r\n# OS.get_date() returns: {\r\n# 'day': int, 'dst': boolean, 'month': int, 'weekday': int, 'year': int\r\n# }\r\n\r\n# Conforms to many of the Standard C (1989 version) datetime string format\r\n# parameters.\r\n# The name translations (weekday name, month name) must be provided, or the\r\n# en_US version will be returned.\r\n\r\n# Date calculations are based upon Gregorian Calendar.\r\n\r\n\r\n\r\nstatic func date_to_str(format, date_obj=null):\r\n\tif date_obj == null:\r\n\t\tdate_obj = OS.get_date()\r\n\treturn preload(\"stringfunc.gd\").format(format, preload(\"datetime\/formats.gd\").date_values({}, date_obj))\r\n\r\n\r\nstatic func time_to_str(format, time_obj=null):\r\n\tif time_obj == null:\r\n\t\ttime_obj = OS.get_time()\r\n\treturn preload(\"stringfunc.gd\").format(format, preload(\"datetime\/formats.gd\").time_values({}, time_obj))\r\n\r\n\r\nstatic func datetime_to_str(format, date_obj=null, time_obj=null):\r\n\tif date_obj == null:\r\n\t\tdate_obj = OS.get_date()\r\n\tif time_obj == null:\r\n\t\ttime_obj = OS.get_time()\r\n\tvar formats = preload(\"datetime\/formats.gd\")\r\n\tvar vals = formats.date_values({}, date_obj)\r\n\tvals = formats.time_values(vals, time_obj)\r\n\treturn preload(\"stringfunc.gd\").format(format, vals)\r\n\r\n\r\nconst _DAYS_IN_MONTH = [-1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]\r\n\r\n# number of days in 400 years\r\n# y = 401, y*365 + y\/4 - y\/100 + y\/400\r\nconst _DAYS_IN_400Y = 146097\r\n# number of days in 100 years\r\n# y = 101, y*365 + y\/4 - y\/100 + y\/400\r\nconst _DAYS_IN_100Y = 36524\r\n# number of days in 4 years\r\n# y = 5, y*365 + y\/4 - y\/100 + y\/400\r\nconst _DAYS_IN_4Y = 1461\r\n\r\nstatic func date_add(date_obj, days):\r\n\t# Adds the date delta (which is a get_date() structure, but only the\r\n\t# Month, day, and year matter).\r\n\r\n\treturn _ord_to_date(_date_to_ord(date_obj) + days)\r\n\r\n\r\n\r\n\r\nstatic func _is_leapyear(year):\r\n\treturn year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)\r\n\r\nstatic func _date_to_ord(date_obj):\r\n\t# Converts a valid date object to days since Jan 1, year 1 (which is day 0).\r\n\tvar month = int(date_obj[\"month\"])\r\n\tvar year = int(date_obj[\"year\"])\r\n\tvar day = int(date_obj[\"day\"])\r\n\tassert(month >= 1 && month <= 12)\r\n\r\n\tvar days_in_month\r\n\tif month == 2 and _is_leapyear(year):\r\n\t\tdays_in_month = 29\r\n\telse:\r\n\t\tdays_in_month = _DAYS_IN_MONTH[date_obj[\"month\"]]\r\n\tassert(day >= 1 && day <= days_in_month)\r\n\r\n\t# Day 0 == Jan 1, so subtract a day\r\n\tday -= 1\r\n\r\n\t# Days before year:\r\n\tvar y = year - 1\r\n\tday += y*365 + y\/4 - y\/100 + y\/400\r\n\r\n\t# Days before month, for this year\r\n\tvar i\r\n\tfor i in range(1, month):\r\n\t\tif i == 2 and _is_leapyear(year):\r\n\t\t\tday += 29\r\n\t\telse:\r\n\t\t\tday += _DAYS_IN_MONTH[i]\r\n\r\n\treturn day\r\n\r\n\r\nstatic func _ord_to_date(ord):\r\n\t# Converts days since Jan 1, year 1, to a date object.\r\n\t# Note that day 0 is a Sunday. We're not caring about the\r\n\t# Julian \/ Gegorian calendar changes.\r\n\r\n\tvar ret = {\r\n\t\t\"year\": 0,\r\n\t\t\"day\": 0,\r\n\t\t\"month\": 0,\r\n\t\t\"dst\": false,\r\n\t\t\"weekday\": ord % 7\r\n\t}\r\n\r\n\tvar n400 = ord \/ _DAYS_IN_400Y\r\n\tvar n = ord % _DAYS_IN_400Y\r\n\tvar year = n400 * 400 + 1\r\n\r\n\tvar n100 = n \/ _DAYS_IN_100Y\r\n\tn = n % _DAYS_IN_100Y\r\n\r\n\tvar n4 = n \/ _DAYS_IN_4Y\r\n\tn = n % _DAYS_IN_4Y\r\n\r\n\tvar n1 = n \/ 365\r\n\tn = n % 365\r\n\r\n\tyear += n100 * 100 + n4 * 4 + n1\r\n\tif n1 == 4 or n100 == 4:\r\n\t\tassert(n != 0)\r\n\t\tret[\"year\"] = year - 1\r\n\t\tret[\"month\"] = 12\r\n\t\tret[\"day\"] = 31\r\n\t\treturn ret\r\n\tret[\"year\"] = year\r\n\r\n\tvar is_leapyear = _is_leapyear(year)\r\n\tvar month = 1\r\n\t# n is base 0, so do >= comparison\r\n\twhile n >= _DAYS_IN_MONTH[month]:\r\n\t\tn -= _DAYS_IN_MONTH[month]\r\n\t\tmonth += 1\r\n\t\tassert(month <= 12)\r\n\tret[\"day\"] = n + 1\r\n\tret[\"month\"] = month\r\n\treturn ret\r\n","returncode":0,"stderr":"","license":"cc0-1.0","lang":"GDScript"} {"commit":"fae6715162cf38063ce68d6d12f204873c2e8107","subject":"Fixed wild blocks going in the other direction.","message":"Fixed wild blocks going in the other direction.\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Blocks\/WildBlock.gd","new_file":"src\/scripts\/Blocks\/WildBlock.gd","new_contents":"extends \"AbstractBlock.gd\"\n\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\nvar textureName\n\nfunc setTexture(textureName=\"Red\"):\n\tvar img = Image()\n\tself.textureName = textureName\n\t#var text = ImageTexture.new()\n\n\t# TODO preload\n\tvar mat = load(\"res:\/\/materials\/block_Wild\" + textureName + \".mtl\")\n\t#img.load(\"res:\/\/textures\/Block_\" + textureName + \".png\")\n\n\t#text.create_from_image(img)\n\t#mat.set_texture(FixedMaterial.PARAM_DIFFUSE, text)\n\t# TODO color the texture: mat.set_parameter(FixedMaterial.PARAM_DIFFUSE, Color(0.5, 0.5, 0))\n\n\tself.get_node(\"MeshInstance\").set_material_override(mat)\n\treturn self\n\nfunc popBlock():\n\tget_parent().samplePlayer.play(\"deraj_pop_sound_wild\")\n\t# fly away\n\tvar tweenNode = newTweenNode()\n\ttweenNode.interpolate_method( self, \"set_translation\", \\\n\t\tself.get_translation(), self.get_translation().normalized() * far_away_corner, \\\n\t\t1, Tween.TRANS_CIRC, Tween.EASE_IN_OUT )\n\n\ttweenNode.start()\n\n# fly away only if self.pairName is selected\nfunc activate(ev, click_pos, click_normal, justFly=false):\n\tvar gridView = get_parent().get_parent()\n\n\tif gridView.selectedBlocks.size() > 0:\n\t\tvar selBlock = gridView.get_node( \"GridMan\" ).get_node( gridView.selectedBlocks[0] )\n\t\t\n\t\tif selBlock.getBlockType() == BLOCK_PAIR:\n\t\t\tif selBlock.textureName == textureName:\n\t\t\t\tgridView.clearSelection()\n\t\t\t\tpopBlock()\n\t\t\t\tselBlock.forceActivate()\n\t\t\t\treturn\n\n","old_contents":"extends \"AbstractBlock.gd\"\n\nvar textureName\n\nfunc setTexture(textureName=\"Red\"):\n\tvar img = Image()\n\tself.textureName = textureName\n\t#var text = ImageTexture.new()\n\n\t# TODO preload\n\tvar mat = load(\"res:\/\/materials\/block_Wild\" + textureName + \".mtl\")\n\t#img.load(\"res:\/\/textures\/Block_\" + textureName + \".png\")\n\n\t#text.create_from_image(img)\n\t#mat.set_texture(FixedMaterial.PARAM_DIFFUSE, text)\n\t# TODO color the texture: mat.set_parameter(FixedMaterial.PARAM_DIFFUSE, Color(0.5, 0.5, 0))\n\n\tself.get_node(\"MeshInstance\").set_material_override(mat)\n\treturn self\n\nfunc popBlock():\n\tget_parent().samplePlayer.play(\"deraj_pop_sound_wild\")\n\t# fly away\n\tvar tweenNode = newTweenNode()\n\ttweenNode.interpolate_method( self, \"set_translation\", \\\n\t\tself.get_translation(), self.get_translation().normalized() * far_away_corner, \\\n\t\t1, Tween.TRANS_CIRC, Tween.EASE_IN_OUT )\n\n\ttweenNode.start()\n\n# fly away only if self.pairName is selected\nfunc activate(ev, click_pos, click_normal, justFly=false):\n\tpass\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"b0fcafa119f8577bd2dbd16729a2a1b865b467a6","subject":"fix attempt","message":"fix attempt\n","repos":"alketii\/Trepca,alketii\/Trepca","old_file":"global.gd","new_file":"global.gd","new_contents":"extends Node\n\nconst DOWN = 0\nconst LEFT = 1\nconst UP = 2\nconst RIGHT = 3\n\nconst EMPTY = -1\nconst GRASS = 0\nconst DIRT = 1\nconst STONE = 2\n\nfunc _ready():\n\tpass","old_contents":"extends Node\n\nconst DOWN = 0\nconst LEFT = 1\nconst UP = 2\nconst RIGHT = 3\n\nconst EMPTY = -1\nconst GRASS = 0\nconst DIRT = 1\nconst STONE = 2\n\nonready var root = get_node(\"\/root\/world\")\n\nfunc _ready():\n\tpass","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"5bac6a3915086b9a9bff97f42feb661dd2e80524","subject":"Update score after enemy dies","message":"Update score after enemy dies\n","repos":"P1X-in\/rat-is-fat","old_file":"scripts\/player.gd","new_file":"scripts\/player.gd","new_contents":"extends \"res:\/\/scripts\/moving_object.gd\"\n\nvar player_id\nvar is_playing = false\nvar is_alive = true\nvar attack_range = 100\nvar attack_width = PI * 0.33\nvar attack_strength = 1\nvar blast\n\nvar target_cone\nvar target_cone_vector = [0, 0]\nvar target_cone_angle = 0.0\n\nvar panel\nvar hp_cap = 16\n\nvar EXIT_THRESHOLD = 30\n\nfunc _init(bag, player_id).(bag):\n self.bag = bag\n self.player_id = player_id\n self.velocity = 200\n self.hp = 10\n self.max_hp = 10\n self.score = 0\n self.avatar = preload(\"res:\/\/scenes\/player\/player.xscn\").instance()\n self.body_part_head = self.avatar.get_node('head')\n self.hat = self.body_part_head.get_node('hat')\n self.body_part_body = self.avatar.get_node('body')\n self.body_part_footer = self.avatar.get_node('footer')\n self.target_cone = self.avatar.get_node('attack_cone')\n self.animations = self.avatar.get_node('body_animations')\n self.blast = self.avatar.get_node('blast_animations')\n\n self.bind_gamepad(player_id)\n self.panel = self.bag.hud.bind_player_panel(player_id)\n self.hat.set_frame(player_id)\n self.update_bars()\n\nfunc bind_gamepad(id):\n var gamepad = self.bag.input.devices['pad' + str(id)]\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_enter_game_gamepad.gd\").new(self.bag, self))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_axis.gd\").new(self.bag, self, 0))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_axis.gd\").new(self.bag, self, 1))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_gamepad.gd\").new(self.bag, self, 2))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_gamepad.gd\").new(self.bag, self, 3))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_gamepad.gd\").new(self.bag, self))\n\nfunc bind_keyboard_and_mouse():\n var keyboard = self.bag.input.devices['keyboard']\n var mouse = self.bag.input.devices['mouse']\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_enter_game_keyboard.gd\").new(self.bag, self))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 1, KEY_W, -1))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 1, KEY_S, 1))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 0, KEY_A, -1))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 0, KEY_D, 1))\n mouse.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_mouse.gd\").new(self.bag, self))\n mouse.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_mouse.gd\").new(self.bag, self))\n\nfunc enter_game():\n self.is_playing = true\n self.spawn(self.bag.room_loader.get_spawn_position('initial' + str(self.player_id)))\n self.panel.show()\n\nfunc spawn(position):\n self.is_alive = true\n .spawn(position)\n\nfunc die():\n self.is_alive = false\n self.panel.hide()\n .die()\n if not self.bag.players.is_living_player_in_game():\n self.bag.action_controller.end_game()\n\nfunc process(delta):\n self.adjust_attack_cone()\n .process(delta)\n self.check_doors()\n self.handle_items()\n\nfunc modify_position(delta):\n .modify_position(delta)\n self.flip(self.target_cone_vector[0])\n self.handle_animations()\n\nfunc handle_animations():\n if not self.animations.is_playing():\n if abs(self.movement_vector[0]) > self.AXIS_THRESHOLD || abs(self.movement_vector[1]) > self.AXIS_THRESHOLD:\n self.animations.play('run')\n else:\n self.animations.play('idle')\n else:\n if self.animations.get_current_animation() == 'idle' && (abs(self.movement_vector[0]) > self.AXIS_THRESHOLD || abs(self.movement_vector[1]) > self.AXIS_THRESHOLD):\n self.animations.play('run')\n elif self.animations.get_current_animation() == 'run' && abs(self.movement_vector[0]) < self.AXIS_THRESHOLD && abs(self.movement_vector[1]) < self.AXIS_THRESHOLD:\n self.animations.play('idle')\n\n\nfunc handle_items():\n var items = self.bag.items.get_items_near_object(self)\n for item in items:\n if item.power_up_type == 0:\n self.get_fat(item.power_up_amount)\n else:\n self.get_powert(item.power_up_amount)\n self.score = self.score + item.score\n item.pick()\n self.update_bars()\n\n\nfunc adjust_attack_cone():\n if abs(self.target_cone_vector[0]) < self.AXIS_THRESHOLD || abs(self.target_cone_vector[1]) < self.AXIS_THRESHOLD:\n return\n\n self.target_cone_angle = -atan2(self.target_cone_vector[1], self.target_cone_vector[0]) - PI\/2\n self.target_cone.set_rot(self.target_cone_angle)\n\nfunc attack():\n var enemies\n var random_attack = 'attack'+ str(1 + randi() % 2)\n\n if not self.animations.get_current_animation() == 'attack1' and not self.animations.get_current_animation() == 'attack2' :\n self.animations.play(random_attack);\n self.blast.play('blast')\n elif not self.animations.is_playing():\n if self.animations.get_current_animation() == 'attack1':\n self.animations.play('attack2')\n else:\n self.animations.play('attack1')\n self.blast.play('blast')\n\n enemies = self.bag.enemies.get_enemies_near_object(self, self.attack_range, self.target_cone_vector, self.attack_width)\n for enemy in enemies:\n enemy.push_back(self)\n if enemy.will_die(self.attack_strength):\n self.score += enemy.score\n self.update_bars()\n enemy.recieve_damage(self.attack_strength)\n\nfunc get_power(amount):\n self.attack_strength += amount\n if self.attack_strength >= 16:\n self.die();\n\n self.hp -= amount\n self.max_hp -= amount\n self.update_bars()\n\nfunc get_fat(amount):\n self.hp += amount\n self.max_hp += amount\n if self.max_hp > self.hp_cap:\n self.max_hp = self.hp_cap\n if self.hp > self.max_hp:\n self.hp = self.max_hp\n self.update_bars()\n\nfunc check_colisions():\n return\n\nfunc check_doors():\n if not self.bag.game_state.doors_open:\n return;\n\n var door_coords\n var cell = self.bag.game_state.current_cell\n if cell.north != null:\n door_coords = self.bag.room_loader.door_definitions['north'][1]\n if self.check_exit(door_coords, cell.north, Vector2(16, 0)):\n self.bag.players.move_to_entry_position('south')\n return\n if cell.south != null:\n door_coords = self.bag.room_loader.door_definitions['south'][1]\n if self.check_exit(door_coords, cell.south, Vector2(16, 40)):\n self.bag.players.move_to_entry_position('north')\n return\n if cell.east != null:\n door_coords = self.bag.room_loader.door_definitions['east'][1]\n if self.check_exit(door_coords, cell.east, Vector2(40, 0)):\n self.bag.players.move_to_entry_position('west')\n return\n if cell.west != null:\n door_coords = self.bag.room_loader.door_definitions['west'][1]\n if self.check_exit(door_coords, cell.west, Vector2(-10, 0)):\n self.bag.players.move_to_entry_position('east')\n return\n\nfunc check_exit(door_coords, cell, door_offset):\n var exit_area = self.bag.room_loader.translate_position(Vector2(door_coords[0] + self.bag.room_loader.side_offset, door_coords[1]))\n exit_area = exit_area + door_offset\n var distance = self.calculate_distance(exit_area)\n if distance < self.EXIT_THRESHOLD:\n self.bag.map.switch_to_cell(cell)\n return true\n return false\n\nfunc move_to_entry_position(name):\n var entry_position\n print(name, self.player_id)\n entry_position = self.bag.room_loader.get_spawn_position(name + str(self.player_id))\n self.avatar.set_pos(entry_position)\n\nfunc update_bars():\n self.panel.update_bar(self.panel.fat_bar, self.hp - 1, 0)\n self.panel.update_bar(self.panel.power_bar, self.attack_strength - 1, 3)\n self.panel.update_points(self.score)\n\nfunc set_hp(hp):\n .set_hp(hp)\n self.update_bars()\n\nfunc reset():\n self.attack_strength = 1\n self.hp = 10\n self.max_hp = 10\n self.target_cone_vector = [0, 0]\n self.target_cone_angle = 0.0\n self.is_playing = false\n self.is_alive = true\n self.movement_vector = [0, 0]\n self.score = 0\n","old_contents":"extends \"res:\/\/scripts\/moving_object.gd\"\n\nvar player_id\nvar is_playing = false\nvar is_alive = true\nvar attack_range = 100\nvar attack_width = PI * 0.33\nvar attack_strength = 1\nvar blast\n\nvar target_cone\nvar target_cone_vector = [0, 0]\nvar target_cone_angle = 0.0\n\nvar panel\nvar hp_cap = 16\n\nvar EXIT_THRESHOLD = 30\n\nfunc _init(bag, player_id).(bag):\n self.bag = bag\n self.player_id = player_id\n self.velocity = 200\n self.hp = 10\n self.max_hp = 10\n self.score = 0\n self.avatar = preload(\"res:\/\/scenes\/player\/player.xscn\").instance()\n self.body_part_head = self.avatar.get_node('head')\n self.hat = self.body_part_head.get_node('hat')\n self.body_part_body = self.avatar.get_node('body')\n self.body_part_footer = self.avatar.get_node('footer')\n self.target_cone = self.avatar.get_node('attack_cone')\n self.animations = self.avatar.get_node('body_animations')\n self.blast = self.avatar.get_node('blast_animations')\n\n self.bind_gamepad(player_id)\n self.panel = self.bag.hud.bind_player_panel(player_id)\n self.hat.set_frame(player_id)\n self.update_bars()\n\nfunc bind_gamepad(id):\n var gamepad = self.bag.input.devices['pad' + str(id)]\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_enter_game_gamepad.gd\").new(self.bag, self))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_axis.gd\").new(self.bag, self, 0))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_axis.gd\").new(self.bag, self, 1))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_gamepad.gd\").new(self.bag, self, 2))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_gamepad.gd\").new(self.bag, self, 3))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_gamepad.gd\").new(self.bag, self))\n\nfunc bind_keyboard_and_mouse():\n var keyboard = self.bag.input.devices['keyboard']\n var mouse = self.bag.input.devices['mouse']\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_enter_game_keyboard.gd\").new(self.bag, self))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 1, KEY_W, -1))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 1, KEY_S, 1))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 0, KEY_A, -1))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 0, KEY_D, 1))\n mouse.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_mouse.gd\").new(self.bag, self))\n mouse.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_mouse.gd\").new(self.bag, self))\n\nfunc enter_game():\n self.is_playing = true\n self.spawn(self.bag.room_loader.get_spawn_position('initial' + str(self.player_id)))\n self.panel.show()\n\nfunc spawn(position):\n self.is_alive = true\n .spawn(position)\n\nfunc die():\n self.is_alive = false\n self.panel.hide()\n .die()\n if not self.bag.players.is_living_player_in_game():\n self.bag.action_controller.end_game()\n\nfunc process(delta):\n self.adjust_attack_cone()\n .process(delta)\n self.check_doors()\n self.handle_items()\n\nfunc modify_position(delta):\n .modify_position(delta)\n self.flip(self.target_cone_vector[0])\n self.handle_animations()\n\nfunc handle_animations():\n if not self.animations.is_playing():\n if abs(self.movement_vector[0]) > self.AXIS_THRESHOLD || abs(self.movement_vector[1]) > self.AXIS_THRESHOLD:\n self.animations.play('run')\n else:\n self.animations.play('idle')\n else:\n if self.animations.get_current_animation() == 'idle' && (abs(self.movement_vector[0]) > self.AXIS_THRESHOLD || abs(self.movement_vector[1]) > self.AXIS_THRESHOLD):\n self.animations.play('run')\n elif self.animations.get_current_animation() == 'run' && abs(self.movement_vector[0]) < self.AXIS_THRESHOLD && abs(self.movement_vector[1]) < self.AXIS_THRESHOLD:\n self.animations.play('idle')\n\n\nfunc handle_items():\n var items = self.bag.items.get_items_near_object(self)\n for item in items:\n if item.power_up_type == 0:\n self.get_fat(item.power_up_amount)\n else:\n self.get_powert(item.power_up_amount)\n self.score = self.score + item.score\n item.pick()\n self.update_bars()\n\n\nfunc adjust_attack_cone():\n if abs(self.target_cone_vector[0]) < self.AXIS_THRESHOLD || abs(self.target_cone_vector[1]) < self.AXIS_THRESHOLD:\n return\n\n self.target_cone_angle = -atan2(self.target_cone_vector[1], self.target_cone_vector[0]) - PI\/2\n self.target_cone.set_rot(self.target_cone_angle)\n\nfunc attack():\n var enemies\n var random_attack = 'attack'+ str(1 + randi() % 2)\n\n if not self.animations.get_current_animation() == 'attack1' and not self.animations.get_current_animation() == 'attack2' :\n self.animations.play(random_attack);\n self.blast.play('blast')\n elif not self.animations.is_playing():\n if self.animations.get_current_animation() == 'attack1':\n self.animations.play('attack2')\n else:\n self.animations.play('attack1')\n self.blast.play('blast')\n\n enemies = self.bag.enemies.get_enemies_near_object(self, self.attack_range, self.target_cone_vector, self.attack_width)\n for enemy in enemies:\n enemy.push_back(self)\n if enemy.will_die(self.attack_strength):\n self.score += enemy.score\n enemy.recieve_damage(self.attack_strength)\n\nfunc get_power(amount):\n self.attack_strength += amount\n if self.attack_strength >= 16:\n self.die();\n\n self.hp -= amount\n self.max_hp -= amount\n self.update_bars()\n\nfunc get_fat(amount):\n self.hp += amount\n self.max_hp += amount\n if self.max_hp > self.hp_cap:\n self.max_hp = self.hp_cap\n if self.hp > self.max_hp:\n self.hp = self.max_hp\n self.update_bars()\n\nfunc check_colisions():\n return\n\nfunc check_doors():\n if not self.bag.game_state.doors_open:\n return;\n\n var door_coords\n var cell = self.bag.game_state.current_cell\n if cell.north != null:\n door_coords = self.bag.room_loader.door_definitions['north'][1]\n if self.check_exit(door_coords, cell.north, Vector2(16, 0)):\n self.bag.players.move_to_entry_position('south')\n return\n if cell.south != null:\n door_coords = self.bag.room_loader.door_definitions['south'][1]\n if self.check_exit(door_coords, cell.south, Vector2(16, 40)):\n self.bag.players.move_to_entry_position('north')\n return\n if cell.east != null:\n door_coords = self.bag.room_loader.door_definitions['east'][1]\n if self.check_exit(door_coords, cell.east, Vector2(40, 0)):\n self.bag.players.move_to_entry_position('west')\n return\n if cell.west != null:\n door_coords = self.bag.room_loader.door_definitions['west'][1]\n if self.check_exit(door_coords, cell.west, Vector2(-10, 0)):\n self.bag.players.move_to_entry_position('east')\n return\n\nfunc check_exit(door_coords, cell, door_offset):\n var exit_area = self.bag.room_loader.translate_position(Vector2(door_coords[0] + self.bag.room_loader.side_offset, door_coords[1]))\n exit_area = exit_area + door_offset\n var distance = self.calculate_distance(exit_area)\n if distance < self.EXIT_THRESHOLD:\n self.bag.map.switch_to_cell(cell)\n return true\n return false\n\nfunc move_to_entry_position(name):\n var entry_position\n print(name, self.player_id)\n entry_position = self.bag.room_loader.get_spawn_position(name + str(self.player_id))\n self.avatar.set_pos(entry_position)\n\nfunc update_bars():\n self.panel.update_bar(self.panel.fat_bar, self.hp - 1, 0)\n self.panel.update_bar(self.panel.power_bar, self.attack_strength - 1, 3)\n self.panel.update_points(self.score)\n\nfunc set_hp(hp):\n .set_hp(hp)\n self.update_bars()\n\nfunc reset():\n self.attack_strength = 1\n self.hp = 10\n self.max_hp = 10\n self.target_cone_vector = [0, 0]\n self.target_cone_angle = 0.0\n self.is_playing = false\n self.is_alive = true\n self.movement_vector = [0, 0]\n self.score = 0\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"21dc72a19cb728139c554669a4a5f9fdee6a82d9","subject":"feat(scenes): play attack animations","message":"feat(scenes): play attack animations\n\nadd scripted attack animations downwards and to the right\n","repos":"qtux\/ldjam37","old_file":"game\/scenes\/enemy\/enemy.gd","new_file":"game\/scenes\/enemy\/enemy.gd","new_contents":"extends KinematicBody2D\n\n# class member variables go here, for example:\n# var a = 2\n# var b = \"textvar\"\nvar initDist = 64\nvar offset = 16\nvar facing\nvar attackRange = 2\nvar animationNode\nvar animationPlayer\n\nfunc _ready():\n\t# Called every time the node is added to the scene.\n\t# Initialization here\n\tanimationNode = get_node(\"AnimatedSprite\")\n\tanimationPlayer = get_node(\"AnimationPlayer\")\n\tset_fixed_process(true)\n\nfunc keepDistance(fixpoint):\n\tvar diff = get_global_pos()-fixpoint\n\tvar currentDist = get_global_pos().distance_to(fixpoint)\n\tif currentDist > initDist + offset:\n\t\tif abs(diff.x) > abs(diff.y):\n\t\t\tset_global_pos(Vector2(fixpoint.x, get_global_pos().y))\n\t\t\tif diff.y >= 0:\n\t\t\t\tfacing = Vector2(0,-1)\n\t\t\t\tanimationNode.play(\"idle_up\")\n\t\t\telse:\n\t\t\t\tfacing = Vector2(0,1)\n\t\t\t\tanimationNode.play(\"idle_down\")\n\t\telse:\n\t\t\tset_global_pos(Vector2(get_global_pos().x, fixpoint.y))\n\t\t\tif diff.x >= 0:\n\t\t\t\tfacing = Vector2(-1,0)\n\t\t\t\tanimationNode.play(\"idle_left\")\n\t\t\telse:\n\t\t\t\tfacing = Vector2(1,0)\n\t\t\t\tanimationNode.play(\"idle_right\")\n\t\tanimationNode.set_hidden(false);\n\t\tget_node(\"AttackVertical\").set_hidden(true);\n\t\tget_node(\"AttackHorizontal\").set_hidden(true);\n\nfunc attack(fixpoint):\n\tif get_global_pos().y > fixpoint.y-attackRange and get_global_pos().y < fixpoint.y+attackRange:\n\t\tif facing == Vector2(1,0):\n\t\t\tanimationPlayer.play(\"StabRight\")\n\t\tif facing == Vector2(-1,0):\n\t\t\tpass#get_node(\"AnimationPlayer\").play(\"StabRight\")\n\tif get_global_pos().x > fixpoint.x-attackRange and get_global_pos().x < fixpoint.x+attackRange:\n\t\tif facing == Vector2(0,1):\n\t\t\tanimationPlayer.play(\"StabDown\")\n\t\tif facing == Vector2(0,-1):\n\t\t\tpass#get_node(\"AnimationPlayer\").play(\"StabUp\")\n\nfunc _fixed_process(delta):\n\tvar fixpoint = get_parent().get_node(\"Hero\").get_pos()\n\tkeepDistance(fixpoint)\n\tattack(fixpoint)","old_contents":"extends KinematicBody2D\n\n# class member variables go here, for example:\n# var a = 2\n# var b = \"textvar\"\nvar initDist = 64\nvar offset = 16\n\nfunc _ready():\n\t# Called every time the node is added to the scene.\n\t# Initialization here\n\tset_fixed_process(true)\n\nfunc keepDistance(fixpoint):\n\tvar diff = get_global_pos()-fixpoint\n\tvar currentDist = get_global_pos().distance_to(fixpoint)\n\tif (currentDist > initDist + offset):\n\t\tif (abs(diff.x) > abs(diff.y)):\n\t\t\tset_global_pos(Vector2(fixpoint.x, get_global_pos().y))\n\t\telse:\n\t\t\tset_global_pos(Vector2(get_global_pos().x, fixpoint.y))\n\nfunc attack(fixpoint):\n\tpass\n\nfunc _fixed_process(delta):\n\tvar fixpoint = get_parent().get_node(\"Hero\").get_pos()\n\tkeepDistance(fixpoint)","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"caf2400baaece1f36822b74076ec6ccb7285a0b6","subject":"made static utility function in GUIManager for scene switching","message":"made static utility function in GUIManager for scene switching\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/CameraControl.gd","new_file":"src\/scripts\/CameraControl.gd","new_contents":"# Make this work on touch:\n# catch InputEventScreenDrag, InputEventScreenTouch\n# write two-finger zoom\n\n\n# camera function that uses the mouse wheel to zoom\nextends Camera\n\n\n# global working variables\nvar turn = Vector2( 0.0, 0.0 ) # the amount the mouse has turned\nvar mouseposlast = Input.get_mouse_pos() # the mouses last position\nvar pos = Vector3(0.0,0.0,0.0) # the position of the camera\nvar up = Vector3(0.0,1.0,0.0) # the normalized 'up' vector pointing vertically\nvar target = Vector3(0.0,0.0,0.0) # the look at target\n\n\n# global tweakable parameters\nvar distance = { val = 16.0, max_ = 50, min_ = 15 }\nvar zoom_rate = 100 # the rate at which the camera zooms in and out of the target\nvar orbitrate = 20 # the rate the camera orbits the target when the mouse is moved\nvar target_move_rate = 1.0 # the rate the target look at point moves\n\n# Pause menu GUI item.\nvar pauseMenu\n\nfunc toMenu():\n\tvar menus = load( \"res:\/\/menus.scn\" ).instance()\n\tmenus.skipTitle(true)\n\tload(\"res:\/\/scripts\/GUIManager.gd\").goto_scene(get_tree(), [menus], true)\n\n\n# called once after node is setup\nfunc _ready():\n\tset_process_input(true) # process user input events here\n\t# Input.set_mouse_mode(2) # mouse mode captured\n\n\t# Setup the pause menu.\n\tpauseMenu = preload( \"res:\/\/dialog.scn\" ).instance()\n\tget_tree().get_root().add_child( pauseMenu )\n\tpauseMenu.hide()\n\n\tpauseMenu.set_pause_mode(PAUSE_MODE_PROCESS)\n\tpauseMenu.set_text(\"PAUSE\")\n\n\tpauseMenu.get_ok().connect(\"pressed\", self, \"toMenu\")\n\tpauseMenu.get_cancel().connect(\"pressed\", pauseMenu, \"hide\")\n\n\tpauseMenu.get_ok().set_text(\"Menu\")\n\tpauseMenu.get_cancel().set_text(\"Return to game\")\n\n\tpauseMenu.get_ok().set_pause_mode(PAUSE_MODE_PROCESS)\n\tpauseMenu.get_cancel().set_pause_mode(PAUSE_MODE_PROCESS)\n\n\t# pause when shown\n\tpauseMenu.connect(\"about_to_show\", get_tree(), \"set_pause\", [true])\n\t# unpause when gone\n\tpauseMenu.connect(\"popup_hide\", get_tree(), \"set_pause\", [false])\n\tpauseMenu.connect(\"hide\", get_tree(), \"set_pause\", [false])\n\n\n# Repositions the camera based on the zoom level.\nfunc recalculate_camera():\n\tpos = get_translation();\n\tpos.z = distance.val;\n\tset_translation( pos )\n\n\n# called to handle a user input event\nfunc _input(ev):\n # if the user spins the mouse wheel up move the camera closer\n\tif (ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_WHEEL_UP):\n\t\tif (distance.val > distance.min_):\n\t\t\tdistance.val -= zoom_rate * get_process_delta_time()\n # if the user spins the mouse wheel down move the camera farther away\n\telif (ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_WHEEL_DOWN):\n\t\tif (distance.val < distance.max_):\n\t\t\tdistance.val += zoom_rate * get_process_delta_time()\n # if a cancel action is input close the application\n\telif (ev.is_action(\"ui_cancel\")):\n\t\t#OS.get_main_loop().quit()\n\t\tpauseMenu.popup_centered()\n\telse:\n\t\treturn\n\n\trecalculate_camera()\n","old_contents":"# Make this work on touch:\n# catch InputEventScreenDrag, InputEventScreenTouch\n# write two-finger zoom\n\n\n# camera function that uses the mouse wheel to zoom\nextends Camera\n\n\n# global working variables\nvar turn = Vector2( 0.0, 0.0 ) # the amount the mouse has turned\nvar mouseposlast = Input.get_mouse_pos() # the mouses last position\nvar pos = Vector3(0.0,0.0,0.0) # the position of the camera\nvar up = Vector3(0.0,1.0,0.0) # the normalized 'up' vector pointing vertically\nvar target = Vector3(0.0,0.0,0.0) # the look at target\n\n\n# global tweakable parameters\nvar distance = { val = 16.0, max_ = 50, min_ = 15 }\nvar zoom_rate = 100 # the rate at which the camera zooms in and out of the target\nvar orbitrate = 20 # the rate the camera orbits the target when the mouse is moved\nvar target_move_rate = 1.0 # the rate the target look at point moves\n\n# Pause menu GUI item.\nvar pauseMenu\n\nfunc toMenu():\n\tvar root = get_tree().get_root()\n\tvar menus = preload( \"res:\/\/menus.scn\" ).instance()\n\tmenus.skipTitle(true)\n\tfor child in root.get_children():\n\t\tchild.queue_free()\n\troot.add_child(menus)\n\n# called once after node is setup\nfunc _ready():\n\tset_process_input(true) # process user input events here\n\t# Input.set_mouse_mode(2) # mouse mode captured\n\n\t# Setup the pause menu.\n\tpauseMenu = preload( \"res:\/\/dialog.scn\" ).instance()\n\tget_tree().get_root().add_child( pauseMenu )\n\tpauseMenu.hide()\n\n\tpauseMenu.set_pause_mode(PAUSE_MODE_PROCESS)\n\tpauseMenu.set_text(\"PAUSE\")\n\n\tpauseMenu.get_ok().connect(\"pressed\", self, \"toMenu\")\n\tpauseMenu.get_cancel().connect(\"pressed\", pauseMenu, \"hide\")\n\n\tpauseMenu.get_ok().set_text(\"Menu\")\n\tpauseMenu.get_cancel().set_text(\"Return to game\")\n\n\tpauseMenu.get_ok().set_pause_mode(PAUSE_MODE_PROCESS)\n\tpauseMenu.get_cancel().set_pause_mode(PAUSE_MODE_PROCESS)\n\n\t# pause when shown\n\tpauseMenu.connect(\"about_to_show\", get_tree(), \"set_pause\", [true])\n\t# unpause when gone\n\tpauseMenu.connect(\"popup_hide\", get_tree(), \"set_pause\", [false])\n\tpauseMenu.connect(\"hide\", get_tree(), \"set_pause\", [false])\n\n\n# Repositions the camera based on the zoom level.\nfunc recalculate_camera():\n\tpos = get_translation();\n\tpos.z = distance.val;\n\tset_translation( pos )\n\n\n# called to handle a user input event\nfunc _input(ev):\n # if the user spins the mouse wheel up move the camera closer\n\tif (ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_WHEEL_UP):\n\t\tif (distance.val > distance.min_):\n\t\t\tdistance.val -= zoom_rate * get_process_delta_time()\n # if the user spins the mouse wheel down move the camera farther away\n\telif (ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_WHEEL_DOWN):\n\t\tif (distance.val < distance.max_):\n\t\t\tdistance.val += zoom_rate * get_process_delta_time()\n # if a cancel action is input close the application\n\telif (ev.is_action(\"ui_cancel\")):\n\t\t#OS.get_main_loop().quit()\n\t\tpauseMenu.popup_centered()\n\telse:\n\t\treturn\n\n\trecalculate_camera()\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"8c29312ccb66efd4530d8305fe6459b559ed6216","subject":"gd \"G\u00e0idhlig\" translation #17153. Author: GunChleoc. Translated some new strings.","message":"gd \"G\u00e0idhlig\" translation #17153. Author: GunChleoc. Translated some new strings.","repos":"luanlv\/lila,luanlv\/lila,arex1337\/lila,arex1337\/lila,arex1337\/lila,luanlv\/lila,arex1337\/lila,luanlv\/lila,arex1337\/lila,luanlv\/lila,arex1337\/lila,luanlv\/lila,luanlv\/lila,arex1337\/lila","old_file":"modules\/i18n\/messages\/messages.gd","new_file":"modules\/i18n\/messages\/messages.gd","new_contents":"playWithAFriend=Cluich c\u00f2mhla ri caraid\nplayWithTheMachine=Cluich an aghaidh a' choimpiutair\ntoInviteSomeoneToPlayGiveThisUrl=Gus cuireadh a thoirt do chuideigin, thoir an url seo dha\ngameOver=Cr\u00ecoch a\u2019 gheama\nwaitingForOpponent=A\u2019 feitheamh air n\u00e0mhaid\nwaiting=A\u2019 feitheamh\nyourTurn=An turas agad\naiNameLevelAiLevel=%s inbhe %s\nlevel=Inbhe\ntoggleTheChat=Toglaich a\u2019 chabadaich\ntoggleSound=Toglaich fuaim\nchat=Cabadaich\nresign=G\u00e8ill\ncheckmate=Tul-chasg\nstalemate=Clos-cluiche\nwhite=Geal\nblack=Dubh\nrandomColor=Dath air thuaiream\ncreateAGame=Cruthaich geama\nwhiteIsVictorious=Bhuannaich geal\nblackIsVictorious=Bhuannaich dubh\nkingInTheCenter=R\u00ecgh sa mheadhan\nthreeChecks=Tr\u00ec caisg\nraceFinished=Cr\u00ecoch an r\u00e8is\nnewOpponent=N\u00e0mhaid \u00f9r\nyourOpponentWantsToPlayANewGameWithYou=Tha an n\u00e0mhaid agad airson geama \u00f9r a chluich \u2019nad aghaidh\njoinTheGame=Thig a-steach dhan gheama\nwhitePlays=Tha geal a\u2019 cluich\nblackPlays=Tha dubh a\u2019 cluich\ntheOtherPlayerHasLeftTheGameYouCanForceResignationOrWaitForHim=Tha an cluicheadair eile air a' gheama fh\u00e0gail. Is urrainn dhut g\u00e8illeadh a chur air, geama ionnannach a ghairm, no feitheamh air a shon.\nmakeYourOpponentResign=Cuir g\u00e8illeadh air an n\u00e0mhaid agad\nforceResignation=Gairm buaidh\nforceDraw=Gairm geama ionnannach\ntalkInChat=D\u00e8an cabadaich\ntheFirstPersonToComeOnThisUrlWillPlayWithYou=Cluichidh a\u2019 chiad neach a thig a-steach air an url seo c\u00f2mhla riut.\nwhiteResigned=Gh\u00e8ill geal\nblackResigned=Gh\u00e8ill dubh\nwhiteLeftTheGame=Dh\u2019fh\u00e0g geal an geama\nblackLeftTheGame=Dh\u2019fh\u00e0g dubh an geama\nshareThisUrlToLetSpectatorsSeeTheGame=Co-roinn an url seo gus luchd-amhairc a leigeil a-steach dhan gheama\ntheComputerAnalysisHasFailed=Dh\u2019fh\u00e0illig le anailis a\u2019 choimpiutair\nviewTheComputerAnalysis=Seall anailis a\u2019 choimpiutair\nrequestAComputerAnalysis=Iarr anailis air a\u2019 choimpiutair\ncomputerAnalysis=Anailis a\u2019 choimpiutair\nanalysis=B\u00f2rd sgr\u00f9daidh\nblunders=Tuislidhean\nmistakes=Mearachdan\ninaccuracies=Neo-eagnaidhean\nmoveTimes=\u00d9ine nan gluasadan\nflipBoard=D\u00e8an flip air a\u2019 bh\u00f2rd\nthreefoldRepetition=Treas ath-nochdadh\nclaimADraw=Gairm co-tharraing\nofferDraw=Tairg co-tharraing\ndraw=Co-tharraing\nnbConnectedPlayers=%s cluicheadairean\ngamesBeingPlayedRightNow=Geamannan a tha \u2019gan cluich an-dr\u00e0sta fh\u00e8in\nviewAllNbGames=%s geamannan\nviewNbCheckmates=%s tul-chaisg\nnbBookmarks=%s comharran-l\u00ecn\nnbPopularGames=%s geamannan m\u00f2r-ch\u00f2rdte\nnbAnalysedGames=%s geamannan sgr\u00f9daichte\nviewInFullSize=Seall sa mheud iomlan\nlogOut=Log a-mach\nsignIn=Log a-steach\nnewToLichess=\u00d9r air Lichess?\nyouNeedAnAccountToDoThat=Tha feum agad air cunntas gus sin a dh\u00e8anamh\nsignUp=Cl\u00e0raich\ngames=Geamannan\nforum=B\u00f2rd-brath\nxPostedInForumY=Sgr\u00ecobh %s san fh\u00f2ram %s\nlatestForumPosts=Na postaichean as \u00f9ire\nplayers=Cluicheadairean\nminutesPerSide=Mionaidean gach taobh\nvariant=Caochladh\nvariants=Se\u00f2rsachan\ntimeControl=Smachd air an \u00f9ine\nrealTime=F\u00ecor-\u00f9ine\ncorrespondence=Co-sgr\u00ecobhadh\ndaysPerTurn=L\u00e0ithean gach cuairt\noneDay=Aon latha\nnbDays=%s l\u00e0(ithean)\nnbHours=%s uair(ean)\ntime=\u00d9ine\nrating=Rangachadh\nratingStats=Rangachaidhean\nusername=Ainm-cleachdaidh\nusernameOrEmail=Far-ainm\npassword=Facal-faire\nhaveAnAccount=A bheil cunntas agad?\nchangePassword=Atharraich am facal-faire\nchangeEmail=Atharraich am post-d\nemail=Post-d\nemailIsOptional=Tha am post-d roghainneil. cleachdaich Lichess an se\u00f2ladh puist-d agad gus am facal-faire agad ath-shuidheachadh ma dh\u00ecochuimhnicheas tu e.\npasswordReset=Ath-shuidheachadh an fhacail-fhaire\nforgotPassword=An do dh\u00ecochuimhnich thu am facal-faire?\nrank=Inbhe\ngamesPlayed=Geamannan air an cluich\nnbGamesWithYou=%s geamannan c\u00f2mhla riut\ndeclineInvitation=Di\u00f9lt cuireadh\ncancel=Sguir dheth\ntimeOut=Dh\u2019fhalbh an \u00f9ine\ndrawOfferSent=Chaidh tairgse airson co-tharraing a chur\ndrawOfferDeclined=Dhi\u00f9ltadh do thairgse airson co-tharraing\ndrawOfferAccepted=Ghabhadh ri do thairgse airson co-tharraing\ndrawOfferCanceled=Sguireadh de do thairgse airson co-tharraing\nwhiteOffersDraw=Tha geal a' tairgse co-tharraing\nblackOffersDraw=Tha dubh a' tairgse co-tharraing\nwhiteDeclinesDraw=Tha geal a' di\u00f9ltadh co-tharraing\nblackDeclinesDraw=Tha dubh a' di\u00f9ltadh co-tharraing\nyourOpponentOffersADraw=Tha an n\u00e0mhaid agad a\u2019 tairgse co-tharraing\naccept=Gabh ris\ndecline=Di\u00f9lt\nplayingRightNow=A\u2019 cluich an-dr\u00e0sta fh\u00e8in\nfinished=Cr\u00ecochnaichte\nabortGame=Stad an geama\ngameAborted=Chaidh sgur dhen gheama\nstandard=Coitcheann\nunlimited=Gun chr\u00ecoch\nmode=Modh\ncasual=Gun rangachadh\nrated=Rangaichte\nthisGameIsRated=Tha an geama seo rangaichte\nrematch=Ath-mhaids\nrematchOfferSent=Chaidh tairgse airson ath-mhaids a chur\nrematchOfferAccepted=Ghabhadh ri do thairgse airson ath-mhaids\nrematchOfferCanceled=Chaidh sgur dhe thairgse ath-mhaids\nrematchOfferDeclined=Tairgse ath-mhaids air a di\u00f9ltadh\ncancelRematchOffer=Sguir dhe thairgse ath-mhaids\nviewRematch=Seall an ath-mhaids\nplay=Cluich\ninbox=Bogsa a-steach\nchatRoom=Se\u00f2mar cabadaich\nspectatorRoom=Se\u00f2mar an luchd-amhairc\ncomposeMessage=Sgr\u00ecobh teachdaireachd\nnoNewMessages=Gun teachdaireachd \u00f9r\nsubject=Cuspair\nrecipient=Faightear\nsend=Cuir\nincrementInSeconds=Ioncramaid ann an diogan\nfreeOnlineChess=T\u00e0ileasg air loidhne an-asgaidh\nspectators=Luchd-amhairc:\nnbWins=Bhuannaich %s\nnbLosses=Chaill %s\nnbDraws=Co-tharraing %s\nexportGames=\u00c0s-phortaich geamannan\nratingRange=Rainse an rangachaidh\ngiveNbSeconds=Thoir %s diogan\npremoveEnabledClickAnywhereToCancel=Ro-ghluasad an comas - briog \u00e0ite sam bith airson sgur dheth\nthisPlayerUsesChessComputerAssistance=Tha an cluicheadair seo a\u2019 cleachdadh taic coimpiutair taileisg\nthisPlayerArtificiallyIncreasesTheirRating=Dh'\u00ecslich\/Mheudaich an cluicheadair seo an rangachadh aca le breug\ntakeback=Tarraing air ais\nproposeATakeback=Tairg tarraing air ais\ntakebackPropositionSent=Tairgse tarraing air ais air a cur\ntakebackPropositionDeclined=Tairgse tarraing air ais air a di\u00f9ltadh\ntakebackPropositionAccepted=Air gabhail ri tairgse tarraing air ais\ntakebackPropositionCanceled=Chaidh sgur dhe thairgse tarraing air ais\nyourOpponentProposesATakeback=Tha an n\u00e0mhaid a\u2019 tairgse tarraing air ais\nbookmarkThisGame=Cruthaich comharra-l\u00ecn airson a\u2019 gheama seo.\nsearch=Lorg\nadvancedSearch=Lorg adhartach\ntournament=F\u00e8ill-chluich\ntournaments=F\u00e8illean-chluich\ntournamentPoints=Puingean f\u00e8ill-chluich\nviewTournament=Seall an fh\u00e8ill-chluich\nbackToTournament=Till dhan fh\u00e8ill-chluich\nbackToGame=Till dhan gheama\nfreeOnlineChessGamePlayChessNowInACleanInterfaceNoRegistrationNoAdsNoPluginRequiredPlayChessWithComputerFriendsOrRandomOpponents=T\u00e0ileasg air loidhne an-asgaidh. Cluich t\u00e0ileasg ann am pr\u00f2gram air a bheil dreach glan. Gun chl\u00e0radh, gun sanasachd, gun fheum air plugan. Cluich t\u00e0ileasg an aghaidh a\u2019 choimpiutair, charaidean no n\u00e0imhdean air thuaiream.\nteams=Sgiobaidhean\nnbMembers=%s ball\nallTeams=A h-uile sgioba\nnewTeam=Sgioba \u00f9r\nmyTeams=Na sgiobaidhean agam\nnoTeamFound=Cha deach sgioba a lorg\njoinTeam=Gabh p\u00e0irt san sgioba\nquitTeam=F\u00e0g an sgioba\nanyoneCanJoin=Faodaidh duine sam bith p\u00e0irt a ghabhail ann\naConfirmationIsRequiredToJoin=Tha feum air dearbhadh gus p\u00e0irt a ghabhail ann\njoiningPolicy=Poileasaidh na ballrachd\nteamLeader=Ceannard an sgioba\nteamBestPlayers=Na cluicheadairean as fhearr\nteamRecentMembers=Na buill as \u00f9ire\nxJoinedTeamY=Ghabh %s ballrachd san sgioba %s\nxCreatedTeamY=Chruthaich %s an sgioba %s\naverageElo=Rangachadh cuibheasach\nlocation=\u00c0ite\nsettings=Roghainnean\nfilterGames=Criathraich na geamannan\nreset=Ath-shuidhich\napply=Cuir an s\u00e0s\nleaderboard=Cl\u00e0r nan curaidh\npasteTheFenStringHere=Cuir a-steach an t-sreang FEN an-seo\npasteThePgnStringHere=Cuir a-steach an t-sreang PGN an-seo\nfromPosition=On t-suidheachadh\ncontinueFromHere=Lean air adhart on a sheo\nimportGame=Ion-phortaich geama\nnbImportedGames=%s geamannan air an ion-phortadh\nthisIsAChessCaptcha=Seo CAPTCHA t\u00e0ileisg.\nclickOnTheBoardToMakeYourMove=Briog air a\u2019 bh\u00f2rd airson gluasad \u2019s dearbhaich gur e duine a th\u2019 annad.\nnotACheckmate=Chan e tul-chasg a th\u2019 ann\ncolorPlaysCheckmateInOne=Tha %s a\u2019 cluich; tul-chasg an ceann gluasaid\nretry=Feuch ris a-rithist\nreconnecting=Ag ath-cheangal\nonlineFriends=Caraidean air loidhne\nnoFriendsOnline=Chan eil caraid air loidhne\nfindFriends=Lorg caraidean\nfavoriteOpponents=Na farpaisichean as annsa leat\nfollow=Lean\nfollowing=A\u2019 leantainn\nunfollow=Na lean an corr\nblock=Bac\nblocked=Bacte\nunblock=D\u00ec-bhac\nfollowsYou=\u2019Gad leantainn\nxStartedFollowingY=Th\u00f2isich %s a\u2019 leantainn %s\nnbFollowers=%s luchd-leantainn\nnbFollowing=%s a' leantainn\nmore=Barrachd\nmemberSince=Ball o chionn\nlastSeenActive=An logadh a-steach mu dheireadh %s\nchallengeToPlay=Thoir d\u00f9bhlan cluiche dha\nplayer=Cluicheadair\nlist=Liosta\ngraph=Graf\nlessThanNbMinutes=Nas lugha na %s mionaidean\nxToYMinutes=%s gu %s mionaidean\ntextIsTooShort=Tha an teacsa ro ghoirid.\ntextIsTooLong=Tha an teacsa ro fhada.\nrequired=Riatanach.\nopenTournaments=F\u00e8ill-chluichean fosgailte\nduration=Faid\nwinner=Buannaiche\nstanding=Suidheachadh\ncreateANewTournament=Cruthaich f\u00e8ill-chluich \u00f9r\njoin=Gabh p\u00e0irt ann\nwithdraw=C\u00f9laich\npoints=Puingean\nwins=Buaidhean\nlosses=Ruaigean\nwinStreak=Sreath de bhuaidhean\ncreatedBy=Air a chruthachadh le\ntournamentIsStarting=Tha an fh\u00e8ill-chluich gu bhith t\u00f2iseachadh\nmembersOnly=Buill a-mh\u00e0in\nboardEditor=Deasaiche a\u2019 bh\u00f9ird\nstartPosition=Suidheachadh an t\u00f2iseachaidh\nclearBoard=Falamhaich am b\u00f2rd\nsavePosition=S\u00e0bhail an suidheachadh\nloadPosition=Luchdaich suidheachadh\nisPrivate=Pr\u00ecobhaideach\nreportXToModerators=Cuir gearan mu %s dha na maoir\nprofile=Pr\u00f2ifil\neditProfile=Deasaich a\u2019 phr\u00f2ifil\nfirstName=Ainm\nlastName=Sloinneadh\nbiography=Eachdraidh-beatha\ncountry=D\u00f9thaich\npreferences=Roghainnean\nwatchLichessTV=Coimhead air tbh Lichess\npreviouslyOnLichessTV=Air tbh Lichess roimhe\nonlinePlayers=Cluicheadairean air loidhne\nactiveToday=Gn\u00ecomhach an-diugh\nactivePlayers=Cluicheadairean gn\u00ecomhach\nbewareTheGameIsRatedButHasNoClock=Thoir an aire, th\u00e8id an geama seo rangachadh ach chan eil uaireadair aige!\ntraining=Tr\u00e8anadh\nyourPuzzleRatingX=An rangachadh agad: %s\nfindTheBestMoveForWhite=Lorg an gluasad as fhearr airson geal.\nfindTheBestMoveForBlack=Lorg an gluasad as fhearr airson dubh.\ntoTrackYourProgress=Gus s\u00f9il a chumail air d\u2019 adhartas:\ntrainingSignupExplanation=Bheir Lichess t\u00f2imhseachain dhut a bhios freagarrach dhan chomas agad ach am faigh thu tr\u00e8anadh as iomchaidh.\npuzzleId=T\u00f2imhseachan %s\npuzzleOfTheDay=T\u00f2imhseachan an latha\nclickToSolve=Briog an-seo airson fhuasgladh\ngoodMove=Seo gluasad math\nbutYouCanDoBetter=Ach tha gluasad nas fhearr ann.\nbestMove=Seo an gluasad as fhearr!\nkeepGoing=Cum ort...\npuzzleFailed=Cha deach leat\nbutYouCanKeepTrying=Ach faodaidh tu feuchainn a-rithist.\nvictory=Buaidh!\nwasThisPuzzleAnyGood=An robh an t\u00f2imhseachan seo math?\npleaseVotePuzzle=Cuidich lichess \u2019s cuir bh\u00f2t ann leis an t-saighead suas no s\u00ecos:\nthankYou=M\u00f2ran taing!\nratingX=Rangachadh: %s\nplayedXTimes=Air a chluich %s turas\nfromGameLink=On gheama %s\nstartTraining=T\u00f2isich air an tr\u00e8anadh\ncontinueTraining=Lean air adhart leis an tr\u00e8anadh\nretryThisPuzzle=Feuch ris an t\u00f2imhseachan seo a-rithist\nthisPuzzleIsCorrect=Tha an t\u00f2imhseachan seo ceart is inntinneach\nthisPuzzleIsWrong=Tha an t\u00f2imhseachan seo cearr no d\u00f2rainneach\nyouHaveNbSecondsToMakeYourFirstMove=Tha %s diog(an) air fh\u00e0gail dhut airson a' chiad gluasaid agad!\nnbGamesInPlay=%s geama 'gan cluich\nautomaticallyProceedToNextGameAfterMoving=Rach dhan ath-gheama gu f\u00e8in-obrachail \u00e0s d\u00e8idh gluasad\nautoSwitch=Gearr leum gu f\u00e8in-obrachail\npuzzles=T\u00f2imhseachain\ncoordinates=Co-chomharran\nlatestUpdates=Na naidheachdan as \u00f9ire\ntournamentWinners=Feadhainn a bhuannaich f\u00e8ill-chluich\nname=Ainm\ndescription=Tuairisgeul\nno=Chan eil\nyes=Tha\nhelp=Cobhair:\ncreateANewTopic=Cruthaich cuspair \u00f9r\ntopics=Cuspairean\nposts=Postaichean\nlastPost=Am post mu dheireadh\nviews=Air a shealltainn\nreplies=Freagairtean\nreplyToThisTopic=Freagair dhan chuspair seo\nreply=Freagair\nmessage=Teachdaireachd\ncreateTheTopic=Cruthaich an cuspair\nreportAUser=D\u00e8an aithris air cleachdaiche\nuser=Cleachdaiche\nreason=Adhbhar\nwhatIsIheMatter=D\u00e8 an trioblaid?\ncheat=Cealgaireachd\ninsult=Mosach\ntroll=Troll\nother=Adhbhar eile\nby=le %s\nthisTopicIsNowClosed=Tha an cuspair seo d\u00f9inte a-nis.\ntheming=\u00d9rlar\ndonate=Thoir t\u00ecodhlac dhuinn\nblog=Bloga\nquestionsAndAnswers=Ceistean & Freagairtean\nnotes=N\u00f2taichean\ntypePrivateNotesHere=Sgr\u00ecobh notaichean pr\u00ecobhaideach an seo\ngameDisplay=Dealbhachd na geama\npieceAnimation=Gluasachd nam p\u00ecosan\nmaterialDifference=Eadar-dhealachadh de stuth\ncloseAccount=D\u00f9in an cunntas\ncloseYourAccount=D\u00f9in an cunntas agad\nchangedMindDoNotCloseAccount=Chuir mi an caochladh romhamh, na d\u00f9inibh an cunntas agam\ncloseAccountExplanation=A bheil thu cinnteach gu bheil thu airson an cunntas agad a dh\u00f9nadh? 'S e co-dh\u00f9nadh buan a th' ann gun d\u00f9in thu an cunntas agad. Chan urrainn dhut cl\u00e0radh a-steach tuilleadh agus cha bhi an duilleag agad ri faighinn tuilleadh.\nthisAccountIsClosed=Chaidh an cunntas a dh\u00f9nadh.\ninvalidUsernameOrPassword=Ainm-cleachdaiche no facal-faire m\u00ec-dhligheach\nemailMeALink=Cuir ceangal thugam air a' phost-d\ncurrentPassword=Am facal-faire l\u00e0ithreach\nnewPassword=Am facal-faire \u00f9r\nnewPasswordAgain=Am facal-faire \u00f9r (a-rithist)\nboardHighlights=Soillseachadh am b\u00f2rd (an gluasachd mu dheireadh agus caisg)\npieceDestinations=Ceann-uidhe nam p\u00ecosan (gluasachdan dligheach agus ro-ghluasachdan)\nboardCoordinates=Co-chomharran na b\u00f9ird (A-H, 1-8)\nmoveListWhilePlaying=Liosta na gluasachdan fhad 's a tha thu a' cluich\nchessClock=Uaireadair t\u00e0ileisg\ntenthsOfSeconds=Deicheamhan de dhiogan\nnever=Chan ann idir\nwhenTimeRemainingLessThanTenSeconds=Nuair a bhios < 10 diogan a th\u00ecde air fh\u00e0gail\nhorizontalGreenProgressBars=B\u00e0raichean adhartais air a' ch\u00f2mhnard\nsoundWhenTimeGetsCritical=Seirm nuair a tha an \u00f9ine gu bhith falbh orm\ngameBehavior=Gi\u00f9lan a' gheama\npromoteToQueenAutomatically=\u00c0rdaich gu b\u00e0nrigh gu f\u00e8in-obrachail\nprivacy=Pr\u00ecobhaideachd\nletOtherPlayersFollowYou=Leig le cluicheadairean eile leantainn ort\nletOtherPlayersChallengeYou=Leig le cluicheadairean eile d\u00f9bhlan a thoirt ort\nsound=Fuaim\nyourPreferencesHaveBeenSaved=Chaidh na roghainnean agad a sh\u00e0bhaladh.\nnone=Na seall\nfast=Luath\nnormal=Meadhanach\nslow=Slaodach\ninsideTheBoard=Taobh a-staigh den bh\u00f2rd\noutsideTheBoard=Taobh a-muigh den bh\u00f2rd\nonSlowGames=Air geamannan slaodach\nalways=An-c\u00f2mhnaidh\nwhenTimeRemainingLessThanThirtySeconds=Nuair a bhios < 30 diog a th\u00ecde air fh\u00e0gail\ndifficultyEasy=Furasta\ndifficultyNormal=Meadhanach\ndifficultyHard=Doirbh\nxCompetesInY=%s a' gabhail p\u00e0irt ann an %s\ntimeline=Loidhne-t\u00ecm\nseeAllTournaments=Faic na f\u00e8illean-cluich uile\nstarting=A' t\u00f2iseachadh:\nallInformationIsPublicAndOptional=tha gach fiosrachadh poblach is roghainneil.\nyourCityRegionOrDepartment=Do bhaile, do sg\u00ecre no do mh\u00f3r-roinn.\nbiographyDescription=Innis mu do dheidhinn, de 's toigh leat ann an t\u00e0ileasg, na fosglaidhean as fhearr leat, geamannan, cluicheadairean...\nmaximumNbCharacters=A' chuid as motha: %s caractarean.\nblocks=%s air a bhacadh\nlistBlockedPlayers=Seall na cluicheadairean a bhac thu\nhuman=Daonna\ncomputer=Coimpiutair\nside=Taobh\nclock=Uaireadair\nconnectedToLichess=Tha thu ceangailte ri lichess.org a-nis\nsignedOut=Chaidh do chl\u00e0radh a-mach\nloginSuccessful=Chaidh do chl\u00e0radh a-steach\nplayOfflineComputer=Coimpiutair\nopponent=Neach-d\u00f9bhlain\nlearn=Ionnsaich\ncommunity=Coimhearsnachd\ntools=Goireasean\nincrement=Ioncramaid\nboard=B\u00f2rd\npieces=P\u00ecosan\nplayOnline=Cluich air loidhne\nplayOffline=Cluich far loidhne\nallowAnalytics=Ceadaich stadastaieachd gun urra\nshareGameURL=Co-roinn URL a' gheama\nerror.required=Tha an raon seo riatanach\nerror.email=Chan eil an se\u00f2ladh puist-d seo dligheach\nerror.email_acceptable=Cha ghabh sinn ris an t-se\u00f2ladh puist-d seo\nerror.email_unique=Cha an se\u00f2ladh puist-d seo ann mar-th\u00e0\nmoveConfirmation=Dearbhadh a' ghluasaid\ninCorrespondenceGames=Geamannan co-sgr\u00ecobhaidh\nifRatingIsPlusMinusX=Ma tha an rangachadh \u00b1 %s\nonlyFriends=Caraidean a-mh\u00e0in\nmenu=Cl\u00e0r-taice\nwhiteCastlingKingside=Geal O-O\nwhiteCastlingQueenside=Geal O-O-O\nblackCastlingKingside=Dubh O-O\nblackCastlingQueenside=Dubh O-O-O\nnbForumPosts=%s Puist air F\u00f2ram\ntpTimeSpentPlaying=\u00d9ine a' cluich: %s\nwatchGames=Coimhead geamannan\ntpTimeSpentOnTV=\u00d9ine air tbh: %s\nwatch=Coimhead\ninternationalEvents=Tachartasan eadar-n\u00e0iseanta\nvideoLibrary=Cruinneachadh bhidiothan\nmobileApp=Aplacaid mobile\nwebmasters=Maighstirean-l\u00ecn\ncontribute=Rach an s\u00e0s ann\ncontact=Cuir fios\ntermsOfService=Teirmichean na seirbheise\nsourceCode=Bun-t\u00f9s\nhost=\u00d2stair\ncreate=Cruthaich\nlichessTournaments=F\u00e9illean-chluich Lichess\ntournamentOfficial=Oifigeil\ntimeBeforeTournamentStarts=\u00d9ine mus t\u00f2isich an fh\u00e9ill-chluich\nkeyboardShortcuts=Ath-ghoiridean a' mheur-chl\u00e0ir\nkeyMoveBackwardOrForward=gluais air ais\/air adhart\nkeyGoToStartOrEnd=rach dhan toiseach\/deireadh\nkeyShowOrHideComments=seall\/falaich na beachdan\nyouAreBetterThanPercentOfPerfTypePlayers=Tha thu nas fhearr na %s de chluicheadairean %s.\ncheckYourEmail=Thoir s\u00f9il air a' phost-d agad\nweHaveSentYouAnEmailClickTheLink=Tha sinn air post-d a chur thugad. Briog air a' cheangal sa phost-d gus an cunntas agad a ghn\u00ecomhachadh.\nifYouDoNotSeeTheEmailCheckOtherPlaces=Mura faic thu am post-d, thoir s\u00f9il air ionadan eile far a bheil e ma dh'fhaoidte, can pasgan a' phuist-truilleis, spama, s\u00f2isealta no pasgan sam bith eile.\nareYouSureYouEvenRegisteredYourEmailOnLichess=A bheil thu cinnteach gun do chl\u00e0raich thu am post-d agad air lichess?\nitWasNotRequiredForYourRegistration=Cha robh e riatanach airson a' chl\u00e0raidh agad.\nweHaveSentYouAnEmailTo=Tha sinn air post-d a chur gu %s. Briog air a' cheangal sa phost-d gus am facal-faire agad ath-shuidheachadh.\nbyRegisteringYouAgreeToBeBoundByOur=Nuair a chl\u00e0raicheas tu, aontaichidh tu gum bi thu fo bhuaidh %s.\nconfirmResignation=Cinntich an g\u00e8illeadh\nkidMode=Modh cloinne\nplayChessEverywhere=Cluich t\u00e0ileasg \u00e0ite sam bith\nasFreeAsLichess=Ch saor 's a tha lichess\n","old_contents":"playWithAFriend=Cluich c\u00f2mhla ri caraid\nplayWithTheMachine=Cluich an aghaidh a' choimpiutair\ntoInviteSomeoneToPlayGiveThisUrl=Gus cuireadh a thoirt do chuideigin, thoir an url seo dha\ngameOver=Cr\u00ecoch a\u2019 gheama\nwaitingForOpponent=A\u2019 feitheamh air n\u00e0mhaid\nwaiting=A\u2019 feitheamh\nyourTurn=An turas agad\naiNameLevelAiLevel=%s inbhe %s\nlevel=Inbhe\ntoggleTheChat=Toglaich a\u2019 chabadaich\ntoggleSound=Toglaich fuaim\nchat=Cabadaich\nresign=G\u00e8ill\ncheckmate=Tul-chasg\nstalemate=Clos-cluiche\nwhite=Geal\nblack=Dubh\nrandomColor=Dath air thuaiream\ncreateAGame=Cruthaich geama\nwhiteIsVictorious=Bhuannaich geal\nblackIsVictorious=Bhuannaich dubh\nkingInTheCenter=R\u00ecgh sa mheadhan\nthreeChecks=Tr\u00ec caisg\nnewOpponent=N\u00e0mhaid \u00f9r\nyourOpponentWantsToPlayANewGameWithYou=Tha an n\u00e0mhaid agad airson geama \u00f9r a chluich \u2019nad aghaidh\njoinTheGame=Thig a-steach dhan gheama\nwhitePlays=Tha geal a\u2019 cluich\nblackPlays=Tha dubh a\u2019 cluich\ntheOtherPlayerHasLeftTheGameYouCanForceResignationOrWaitForHim=Tha an cluicheadair eile air a' gheama fh\u00e0gail. Is urrainn dhut g\u00e8illeadh a chur air, geama ionnannach a ghairm, no feitheamh air a shon.\nmakeYourOpponentResign=Cuir g\u00e8illeadh air an n\u00e0mhaid agad\nforceResignation=Gairm buaidh\nforceDraw=Gairm geama ionnannach\ntalkInChat=D\u00e8an cabadaich\ntheFirstPersonToComeOnThisUrlWillPlayWithYou=Cluichidh a\u2019 chiad neach a thig a-steach air an url seo c\u00f2mhla riut.\nwhiteResigned=Gh\u00e8ill geal\nblackResigned=Gh\u00e8ill dubh\nwhiteLeftTheGame=Dh\u2019fh\u00e0g geal an geama\nblackLeftTheGame=Dh\u2019fh\u00e0g dubh an geama\nshareThisUrlToLetSpectatorsSeeTheGame=Co-roinn an url seo gus luchd-amhairc a leigeil a-steach dhan gheama\ntheComputerAnalysisHasFailed=Dh\u2019fh\u00e0illig le anailis a\u2019 choimpiutair\nviewTheComputerAnalysis=Seall anailis a\u2019 choimpiutair\nrequestAComputerAnalysis=Iarr anailis air a\u2019 choimpiutair\ncomputerAnalysis=Anailis a\u2019 choimpiutair\nanalysis=B\u00f2rd sgr\u00f9daidh\nblunders=Tuislidhean\nmistakes=Mearachdan\ninaccuracies=Neo-eagnaidhean\nmoveTimes=\u00d9ine nan gluasadan\nflipBoard=D\u00e8an flip air a\u2019 bh\u00f2rd\nthreefoldRepetition=Treas ath-nochdadh\nclaimADraw=Gairm co-tharraing\nofferDraw=Tairg co-tharraing\ndraw=Co-tharraing\nnbConnectedPlayers=%s cluicheadairean\ngamesBeingPlayedRightNow=Geamannan a tha \u2019gan cluich an-dr\u00e0sta fh\u00e8in\nviewAllNbGames=%s geamannan\nviewNbCheckmates=%s tul-chaisg\nnbBookmarks=%s comharran-l\u00ecn\nnbPopularGames=%s geamannan m\u00f2r-ch\u00f2rdte\nnbAnalysedGames=%s geamannan sgr\u00f9daichte\nviewInFullSize=Seall sa mheud iomlan\nlogOut=Log a-mach\nsignIn=Log a-steach\nnewToLichess=\u00d9r air Lichess?\nyouNeedAnAccountToDoThat=Tha feum agad air cunntas gus sin a dh\u00e8anamh\nsignUp=Cl\u00e0raich\ngames=Geamannan\nforum=B\u00f2rd-brath\nxPostedInForumY=Sgr\u00ecobh %s san fh\u00f2ram %s\nlatestForumPosts=Na postaichean as \u00f9ire\nplayers=Cluicheadairean\nminutesPerSide=Mionaidean gach taobh\nvariant=Caochladh\nvariants=Se\u00f2rsachan\ntimeControl=Smachd air an \u00f9ine\nrealTime=F\u00ecor-\u00f9ine\ndaysPerTurn=L\u00e0ithean gach cuairt\noneDay=Aon latha\nnbDays=%s l\u00e0(ithean)\nnbHours=%s uair(ean)\ntime=\u00d9ine\nrating=Rangachadh\nusername=Ainm-cleachdaidh\nusernameOrEmail=Far-ainm\npassword=Facal-faire\nhaveAnAccount=A bheil cunntas agad?\nchangePassword=Atharraich am facal-faire\nchangeEmail=Atharraich am post-d\nemail=Post-d\nemailIsOptional=Tha am post-d roghainneil. cleachdaich Lichess an se\u00f2ladh puist-d agad gus am facal-faire agad ath-shuidheachadh ma dh\u00ecochuimhnicheas tu e.\npasswordReset=Ath-shuidheachadh an fhacail-fhaire\nforgotPassword=An do dh\u00ecochuimhnich thu am facal-faire?\nrank=Inbhe\ngamesPlayed=Geamannan air an cluich\nnbGamesWithYou=%s geamannan c\u00f2mhla riut\ndeclineInvitation=Di\u00f9lt cuireadh\ncancel=Sguir dheth\ntimeOut=Dh\u2019fhalbh an \u00f9ine\ndrawOfferSent=Chaidh tairgse airson co-tharraing a chur\ndrawOfferDeclined=Dhi\u00f9ltadh do thairgse airson co-tharraing\ndrawOfferAccepted=Ghabhadh ri do thairgse airson co-tharraing\ndrawOfferCanceled=Sguireadh de do thairgse airson co-tharraing\nwhiteOffersDraw=Tha geal a' tairgse co-tharraing\nblackOffersDraw=Tha dubh a' tairgse co-tharraing\nwhiteDeclinesDraw=Tha geal a' di\u00f9ltadh co-tharraing\nblackDeclinesDraw=Tha dubh a' di\u00f9ltadh co-tharraing\nyourOpponentOffersADraw=Tha an n\u00e0mhaid agad a\u2019 tairgse co-tharraing\naccept=Gabh ris\ndecline=Di\u00f9lt\nplayingRightNow=A\u2019 cluich an-dr\u00e0sta fh\u00e8in\nfinished=Cr\u00ecochnaichte\nabortGame=Stad an geama\ngameAborted=Chaidh sgur dhen gheama\nstandard=Coitcheann\nunlimited=Gun chr\u00ecoch\nmode=Modh\ncasual=Gun rangachadh\nrated=Rangaichte\nthisGameIsRated=Tha an geama seo rangaichte\nrematch=Ath-mhaids\nrematchOfferSent=Chaidh tairgse airson ath-mhaids a chur\nrematchOfferAccepted=Ghabhadh ri do thairgse airson ath-mhaids\nrematchOfferCanceled=Chaidh sgur dhe thairgse ath-mhaids\nrematchOfferDeclined=Tairgse ath-mhaids air a di\u00f9ltadh\ncancelRematchOffer=Sguir dhe thairgse ath-mhaids\nviewRematch=Seall an ath-mhaids\nplay=Cluich\ninbox=Bogsa a-steach\nchatRoom=Se\u00f2mar cabadaich\nspectatorRoom=Se\u00f2mar an luchd-amhairc\ncomposeMessage=Sgr\u00ecobh teachdaireachd\nnoNewMessages=Gun teachdaireachd \u00f9r\nsubject=Cuspair\nrecipient=Faightear\nsend=Cuir\nincrementInSeconds=Ioncramaid ann an diogan\nfreeOnlineChess=T\u00e0ileasg air loidhne an-asgaidh\nspectators=Luchd-amhairc:\nnbWins=Bhuannaich %s\nnbLosses=Chaill %s\nnbDraws=Co-tharraing %s\nexportGames=\u00c0s-phortaich geamannan\nratingRange=Rainse an rangachaidh\ngiveNbSeconds=Thoir %s diogan\npremoveEnabledClickAnywhereToCancel=Ro-ghluasad an comas - briog \u00e0ite sam bith airson sgur dheth\nthisPlayerUsesChessComputerAssistance=Tha an cluicheadair seo a\u2019 cleachdadh taic coimpiutair taileisg\ntakeback=Tarraing air ais\nproposeATakeback=Tairg tarraing air ais\ntakebackPropositionSent=Tairgse tarraing air ais air a cur\ntakebackPropositionDeclined=Tairgse tarraing air ais air a di\u00f9ltadh\ntakebackPropositionAccepted=Air gabhail ri tairgse tarraing air ais\ntakebackPropositionCanceled=Chaidh sgur dhe thairgse tarraing air ais\nyourOpponentProposesATakeback=Tha an n\u00e0mhaid a\u2019 tairgse tarraing air ais\nbookmarkThisGame=Cruthaich comharra-l\u00ecn airson a\u2019 gheama seo.\nsearch=Lorg\nadvancedSearch=Lorg adhartach\ntournament=F\u00e8ill-chluich\ntournaments=F\u00e8illean-chluich\ntournamentPoints=Puingean f\u00e8ill-chluich\nviewTournament=Seall an fh\u00e8ill-chluich\nbackToTournament=Till dhan fh\u00e8ill-chluich\nbackToGame=Till dhan gheama\nfreeOnlineChessGamePlayChessNowInACleanInterfaceNoRegistrationNoAdsNoPluginRequiredPlayChessWithComputerFriendsOrRandomOpponents=T\u00e0ileasg air loidhne an-asgaidh. Cluich t\u00e0ileasg ann am pr\u00f2gram air a bheil dreach glan. Gun chl\u00e0radh, gun sanasachd, gun fheum air plugan. Cluich t\u00e0ileasg an aghaidh a\u2019 choimpiutair, charaidean no n\u00e0imhdean air thuaiream.\nteams=Sgiobaidhean\nnbMembers=%s ball\nallTeams=A h-uile sgioba\nnewTeam=Sgioba \u00f9r\nmyTeams=Na sgiobaidhean agam\nnoTeamFound=Cha deach sgioba a lorg\njoinTeam=Gabh p\u00e0irt san sgioba\nquitTeam=F\u00e0g an sgioba\nanyoneCanJoin=Faodaidh duine sam bith p\u00e0irt a ghabhail ann\naConfirmationIsRequiredToJoin=Tha feum air dearbhadh gus p\u00e0irt a ghabhail ann\njoiningPolicy=Poileasaidh na ballrachd\nteamLeader=Ceannard an sgioba\nteamBestPlayers=Na cluicheadairean as fhearr\nteamRecentMembers=Na buill as \u00f9ire\nxJoinedTeamY=Ghabh %s ballrachd san sgioba %s\nxCreatedTeamY=Chruthaich %s an sgioba %s\naverageElo=Rangachadh cuibheasach\nlocation=\u00c0ite\nsettings=Roghainnean\nfilterGames=Criathraich na geamannan\nreset=Ath-shuidhich\napply=Cuir an s\u00e0s\nleaderboard=Cl\u00e0r nan curaidh\npasteTheFenStringHere=Cuir a-steach an t-sreang FEN an-seo\npasteThePgnStringHere=Cuir a-steach an t-sreang PGN an-seo\nfromPosition=On t-suidheachadh\ncontinueFromHere=Lean air adhart on a sheo\nimportGame=Ion-phortaich geama\nnbImportedGames=%s geamannan air an ion-phortadh\nthisIsAChessCaptcha=Seo CAPTCHA t\u00e0ileisg.\nclickOnTheBoardToMakeYourMove=Briog air a\u2019 bh\u00f2rd airson gluasad \u2019s dearbhaich gur e duine a th\u2019 annad.\nnotACheckmate=Chan e tul-chasg a th\u2019 ann\ncolorPlaysCheckmateInOne=Tha %s a\u2019 cluich; tul-chasg an ceann gluasaid\nretry=Feuch ris a-rithist\nreconnecting=Ag ath-cheangal\nonlineFriends=Caraidean air loidhne\nnoFriendsOnline=Chan eil caraid air loidhne\nfindFriends=Lorg caraidean\nfavoriteOpponents=Na farpaisichean as annsa leat\nfollow=Lean\nfollowing=A\u2019 leantainn\nunfollow=Na lean an corr\nblock=Bac\nblocked=Bacte\nunblock=D\u00ec-bhac\nfollowsYou=\u2019Gad leantainn\nxStartedFollowingY=Th\u00f2isich %s a\u2019 leantainn %s\nnbFollowers=%s luchd-leantainn\nnbFollowing=%s a' leantainn\nmore=Barrachd\nmemberSince=Ball o chionn\nlastSeenActive=An logadh a-steach mu dheireadh %s\nchallengeToPlay=Thoir d\u00f9bhlan cluiche dha\nplayer=Cluicheadair\nlist=Liosta\ngraph=Graf\nlessThanNbMinutes=Nas lugha na %s mionaidean\nxToYMinutes=%s gu %s mionaidean\ntextIsTooShort=Tha an teacsa ro ghoirid.\ntextIsTooLong=Tha an teacsa ro fhada.\nrequired=Riatanach.\nopenTournaments=F\u00e8ill-chluichean fosgailte\nduration=Faid\nwinner=Buannaiche\nstanding=Suidheachadh\ncreateANewTournament=Cruthaich f\u00e8ill-chluich \u00f9r\njoin=Gabh p\u00e0irt ann\nwithdraw=C\u00f9laich\npoints=Puingean\nwins=Buaidhean\nlosses=Ruaigean\nwinStreak=Sreath de bhuaidhean\ncreatedBy=Air a chruthachadh le\ntournamentIsStarting=Tha an fh\u00e8ill-chluich gu bhith t\u00f2iseachadh\nmembersOnly=Buill a-mh\u00e0in\nboardEditor=Deasaiche a\u2019 bh\u00f9ird\nstartPosition=Suidheachadh an t\u00f2iseachaidh\nclearBoard=Falamhaich am b\u00f2rd\nsavePosition=S\u00e0bhail an suidheachadh\nloadPosition=Luchdaich suidheachadh\nisPrivate=Pr\u00ecobhaideach\nreportXToModerators=Cuir gearan mu %s dha na maoir\nprofile=Pr\u00f2ifil\neditProfile=Deasaich a\u2019 phr\u00f2ifil\nfirstName=Ainm\nlastName=Sloinneadh\nbiography=Eachdraidh-beatha\ncountry=D\u00f9thaich\npreferences=Roghainnean\nwatchLichessTV=Coimhead air tbh Lichess\npreviouslyOnLichessTV=Air tbh Lichess roimhe\nonlinePlayers=Cluicheadairean air loidhne\nactiveToday=Gn\u00ecomhach an-diugh\nactivePlayers=Cluicheadairean gn\u00ecomhach\nbewareTheGameIsRatedButHasNoClock=Thoir an aire, th\u00e8id an geama seo rangachadh ach chan eil uaireadair aige!\ntraining=Tr\u00e8anadh\nyourPuzzleRatingX=An rangachadh agad: %s\nfindTheBestMoveForWhite=Lorg an gluasad as fhearr airson geal.\nfindTheBestMoveForBlack=Lorg an gluasad as fhearr airson dubh.\ntoTrackYourProgress=Gus s\u00f9il a chumail air d\u2019 adhartas:\ntrainingSignupExplanation=Bheir Lichess t\u00f2imhseachain dhut a bhios freagarrach dhan chomas agad ach am faigh thu tr\u00e8anadh as iomchaidh.\npuzzleId=T\u00f2imhseachan %s\npuzzleOfTheDay=T\u00f2imhseachan an latha\nclickToSolve=Briog an-seo airson fhuasgladh\ngoodMove=Seo gluasad math\nbutYouCanDoBetter=Ach tha gluasad nas fhearr ann.\nbestMove=Seo an gluasad as fhearr!\nkeepGoing=Cum ort...\npuzzleFailed=Cha deach leat\nbutYouCanKeepTrying=Ach faodaidh tu feuchainn a-rithist.\nvictory=Buaidh!\nwasThisPuzzleAnyGood=An robh an t\u00f2imhseachan seo math?\npleaseVotePuzzle=Cuidich lichess \u2019s cuir bh\u00f2t ann leis an t-saighead suas no s\u00ecos:\nthankYou=M\u00f2ran taing!\nratingX=Rangachadh: %s\nplayedXTimes=Air a chluich %s turas\nfromGameLink=On gheama %s\nstartTraining=T\u00f2isich air an tr\u00e8anadh\ncontinueTraining=Lean air adhart leis an tr\u00e8anadh\nretryThisPuzzle=Feuch ris an t\u00f2imhseachan seo a-rithist\nthisPuzzleIsCorrect=Tha an t\u00f2imhseachan seo ceart is inntinneach\nthisPuzzleIsWrong=Tha an t\u00f2imhseachan seo cearr no d\u00f2rainneach\nyouHaveNbSecondsToMakeYourFirstMove=Tha %s diog(an) air fh\u00e0gail dhut airson a' chiad gluasaid agad!\nnbGamesInPlay=%s geama 'gan cluich\npuzzles=T\u00f2imhseachain\ncoordinates=Co-chomharran\nlatestUpdates=Na naidheachdan as \u00f9ire\ntournamentWinners=Feadhainn a bhuannaich f\u00e8ill-chluich\nname=Ainm\ndescription=Tuairisgeul\nno=Chan eil\nyes=Tha\nhelp=Cobhair:\ncreateANewTopic=Cruthaich cuspair \u00f9r\ntopics=Cuspairean\nposts=Postaichean\nlastPost=Am post mu dheireadh\nviews=Air a shealltainn\nreplies=Freagairtean\nreplyToThisTopic=Freagair dhan chuspair seo\nreply=Freagair\nmessage=Teachdaireachd\ncreateTheTopic=Cruthaich an cuspair\nreportAUser=D\u00e8an aithris air cleachdaiche\nuser=Cleachdaiche\nreason=Adhbhar\nwhatIsIheMatter=D\u00e8 an trioblaid?\ncheat=Cealgaireachd\ninsult=Mosach\ntroll=Troll\nother=Adhbhar eile\nby=le %s\nthisTopicIsNowClosed=Tha an cuspair seo d\u00f9inte a-nis.\ntheming=\u00d9rlar\nblog=Bloga\nquestionsAndAnswers=Ceistean & Freagairtean\nnotes=N\u00f2taichean\ntypePrivateNotesHere=Sgr\u00ecobh notaichean pr\u00ecobhaideach an seo\ngameDisplay=Dealbhachd na geama\npieceAnimation=Gluasachd nam p\u00ecosan\nmaterialDifference=Eadar-dhealachadh de stuth\nboardHighlights=Soillseachadh am b\u00f2rd (an gluasachd mu dheireadh agus caisg)\npieceDestinations=Ceann-uidhe nam p\u00ecosan (gluasachdan dligheach agus ro-ghluasachdan)\nboardCoordinates=Co-chomharran na b\u00f9ird (A-H, 1-8)\nmoveListWhilePlaying=Liosta na gluasachdan fhad 's a tha thu a' cluich\ntenthsOfSeconds=Deicheamhan de dhiogan\nprivacy=Pr\u00ecobhaideachd\nsound=Fuaim\nnone=Na seall\nfast=Luath\nnormal=Meadhanach\nslow=Slaodach\ninsideTheBoard=Taobh a-staigh den bh\u00f2rd\noutsideTheBoard=Taobh a-muigh den bh\u00f2rd\nonSlowGames=Air geamannan slaodach\nalways=An-c\u00f2mhnaidh\ndifficultyEasy=Furasta\ndifficultyNormal=Meadhanach\ndifficultyHard=Doirbh\nxCompetesInY=%s a' gabhail p\u00e0irt ann an %s\ntimeline=Loidhne-t\u00ecm\nseeAllTournaments=Faic na f\u00e8illean-cluich uile\nstarting=A' t\u00f2iseachadh:\nyourCityRegionOrDepartment=Do bhaile, do sg\u00ecre no do mh\u00f3r-roinn.\nbiographyDescription=Innis mu do dheidhinn, de 's toigh leat ann an t\u00e0ileasg, na fosglaidhean as fhearr leat, geamannan, cluicheadairean...\nmaximumNbCharacters=A' chuid as motha: %s caractarean.\nlearn=Ionnsaich\ncommunity=Coimhearsnachd\ntools=Goireasean\nincrement=Ioncramaid\nboard=B\u00f2rd\npieces=P\u00ecosan\nmenu=Cl\u00e0r-taice\nwhiteCastlingKingside=Geal O-O\nwhiteCastlingQueenside=Geal O-O-O\nblackCastlingKingside=Dubh O-O\nblackCastlingQueenside=Dubh O-O-O\nnbForumPosts=%s Puist air F\u00f2ram\ntpTimeSpentPlaying=\u00d9ine a' cluich: %s\nwatchGames=Coimhead geamannan\ntpTimeSpentOnTV=\u00d9ine air tbh: %s\nwatch=Coimhead\nvideoLibrary=Cruinneachadh bhidiothan\ncontact=Cuir fios\nlichessTournaments=F\u00e9illean-chluich Lichess\ntournamentOfficial=Oifigeil\ntimeBeforeTournamentStarts=\u00d9ine mus t\u00f2isich an fh\u00e9ill-chluich\nyouAreBetterThanPercentOfPerfTypePlayers=Tha thu nas fhearr na %s de chluicheadairean %s.\nconfirmResignation=Cinntich an g\u00e8illeadh\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"GDScript"} {"commit":"4d22502b6f6c65e24b1252156404395714ae8679","subject":"Normalized player to hit totem vector when calculate the direction for hit totem particle.","message":"Normalized player to hit totem vector when calculate the direction for hit totem particle.\n","repos":"CSaratakij\/jam-2016-remake","old_file":"src\/spawner\/particle_spawner.gd","new_file":"src\/spawner\/particle_spawner.gd","new_contents":"\nextends Node2D\n\nconst MAX_PARTICLE_POOLING = 6\nconst MASK_TYPES = preload(\"res:\/\/mask\/mask.gd\").types\nconst PARTICLES = {\n\t\"use_mask\" : preload(\"res:\/\/particles\/use_mask_particle.tscn\"),\n\t\"hit_totem\" : preload(\"res:\/\/particles\/hit_totem_particle.tscn\")\n}\n\nvar pooling_particles = {\n\t\"use_mask\" : [],\n\t\"hit_totem\" : []\n}\n\nonready var tree = get_tree()\nonready var root = tree.get_root()\nonready var players = tree.get_nodes_in_group(\"player\")\n\nfunc _ready():\n\t_initialize()\n\tset_process(true)\n\nfunc _process(delta):\n\tif not players.empty():\n\t\tif players[ 0 ].get_is_using_mask():\n\t\t\tif players[ 0 ].get_current_using_mask() == MASK_TYPES[ 0 ]:\n\t\t\t\tvar params = {\n\t\t\t\t\tParticles2D.PARAM_TANGENTIAL_ACCEL : players[ 0 ].get_move_direction().x * 30\n\t\t\t\t}\n\t\t\t\tspawn(\"use_mask\", players[ 0 ].get_global_pos(), params)\n\t\tif players[ 0 ].is_used_dig_mask:\n\t\t\tvar params = {\n\t\t\t\tParticles2D.PARAM_TANGENTIAL_ACCEL : players[ 0 ].get_move_direction().x * 30\n\t\t\t}\n\t\t\tspawn(\"use_mask\", players[ 0 ].get_using_mask_pos(), params)\n\t\t\tplayers[ 0 ].is_used_dig_mask = false\n\t\tif players[ 0 ].get_is_hit_totem():\n\t\t\tvar pos = players[ 0 ].get_player_to_hit_totem_pos().normalized()\n\t\t\tvar slope = pos.y \/ pos.x\n\t\t\tvar angle_radian = atan(slope)\n\t\t\tvar angle_degree = angle_radian * 180 \/ PI\n\t\t\tangle_degree += 180\n\t\t\tvar params = {\n\t\t\t\tParticles2D.PARAM_DIRECTION : angle_degree\n\t\t\t}\n\t\t\tspawn(\"hit_totem\", players[ 0 ].get_hit_totem_pos(), params)\n\t\t\tplayers[ 0 ].set_is_hit_totem(false)\n\nfunc _initialize():\n\tvar use_mask_instance = PARTICLES[ \"use_mask\" ].instance()\n\tvar hit_totem_instance = PARTICLES[ \"hit_totem\" ].instance()\n\tfor index in range(MAX_PARTICLE_POOLING):\n\t\tpooling_particles[ \"use_mask\" ].append(use_mask_instance.duplicate())\n\t\tpooling_particles[ \"hit_totem\" ].append(hit_totem_instance.duplicate())\n\t\tadd_child(pooling_particles[ \"use_mask\" ][ index ])\n\t\tadd_child(pooling_particles[ \"hit_totem\" ][ index ])\n\nfunc spawn(particle_name, emit_pos, params):\n\tif not players.empty():\n\t\tif pooling_particles.keys().has(particle_name):\n\t\t\tfor particle in pooling_particles[ particle_name ]:\n\t\t\t\tif not particle.is_emitting():\n\t\t\t\t\tfor index in range(params.keys().size()):\n\t\t\t\t\t\tparticle.set_param(params.keys()[ index ], params.values()[ index ])\n\t\t\t\t\tparticle.set_global_pos(emit_pos)\n\t\t\t\t\tparticle.set_emitting(true)\n\t\t\t\t\tbreak\n","old_contents":"\nextends Node2D\n\nconst MAX_PARTICLE_POOLING = 6\nconst MASK_TYPES = preload(\"res:\/\/mask\/mask.gd\").types\nconst PARTICLES = {\n\t\"use_mask\" : preload(\"res:\/\/particles\/use_mask_particle.tscn\"),\n\t\"hit_totem\" : preload(\"res:\/\/particles\/hit_totem_particle.tscn\")\n}\n\nvar pooling_particles = {\n\t\"use_mask\" : [],\n\t\"hit_totem\" : []\n}\n\nonready var tree = get_tree()\nonready var root = tree.get_root()\nonready var players = tree.get_nodes_in_group(\"player\")\n\nfunc _ready():\n\t_initialize()\n\tset_process(true)\n\nfunc _process(delta):\n\tif not players.empty():\n\t\tif players[ 0 ].get_is_using_mask():\n\t\t\tif players[ 0 ].get_current_using_mask() == MASK_TYPES[ 0 ]:\n\t\t\t\tvar params = {\n\t\t\t\t\tParticles2D.PARAM_TANGENTIAL_ACCEL : players[ 0 ].get_move_direction().x * 30\n\t\t\t\t}\n\t\t\t\tspawn(\"use_mask\", players[ 0 ].get_global_pos(), params)\n\t\tif players[ 0 ].is_used_dig_mask:\n\t\t\tvar params = {\n\t\t\t\tParticles2D.PARAM_TANGENTIAL_ACCEL : players[ 0 ].get_move_direction().x * 30\n\t\t\t}\n\t\t\tspawn(\"use_mask\", players[ 0 ].get_using_mask_pos(), params)\n\t\t\tplayers[ 0 ].is_used_dig_mask = false\n\t\tif players[ 0 ].get_is_hit_totem():\n\t\t\tvar pos = players[ 0 ].get_player_to_hit_totem_pos()\n\t\t\tvar slope = pos.y \/ pos.x\n\t\t\tvar angle_radian = atan(slope)\n\t\t\tvar angle_degree = angle_radian * 180 \/ PI\n\t\t\tangle_degree += 180\n\t\t\tvar params = {\n\t\t\t\tParticles2D.PARAM_DIRECTION : angle_degree\n\t\t\t}\n\t\t\tspawn(\"hit_totem\", players[ 0 ].get_hit_totem_pos(), params)\n\t\t\tplayers[ 0 ].set_is_hit_totem(false)\n\nfunc _initialize():\n\tvar use_mask_instance = PARTICLES[ \"use_mask\" ].instance()\n\tvar hit_totem_instance = PARTICLES[ \"hit_totem\" ].instance()\n\tfor index in range(MAX_PARTICLE_POOLING):\n\t\tpooling_particles[ \"use_mask\" ].append(use_mask_instance.duplicate())\n\t\tpooling_particles[ \"hit_totem\" ].append(hit_totem_instance.duplicate())\n\t\tadd_child(pooling_particles[ \"use_mask\" ][ index ])\n\t\tadd_child(pooling_particles[ \"hit_totem\" ][ index ])\n\nfunc spawn(particle_name, emit_pos, params):\n\tif not players.empty():\n\t\tif pooling_particles.keys().has(particle_name):\n\t\t\tfor particle in pooling_particles[ particle_name ]:\n\t\t\t\tif not particle.is_emitting():\n\t\t\t\t\tfor index in range(params.keys().size()):\n\t\t\t\t\t\tparticle.set_param(params.keys()[ index ], params.values()[ index ])\n\t\t\t\t\tparticle.set_global_pos(emit_pos)\n\t\t\t\t\tparticle.set_emitting(true)\n\t\t\t\t\tbreak\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"b7882cab925bfb505e18b1bb0cd02421af2ba891","subject":"Fixed hit totem particle won't emmit after change totems collision type to trigger.","message":"Fixed hit totem particle won't emmit after change totems collision type to trigger.\n","repos":"CSaratakij\/jam-2016-remake","old_file":"src\/player\/player.gd","new_file":"src\/player\/player.gd","new_contents":"\nextends KinematicBody2D\n\nconst mask_types = preload(\"res:\/\/mask\/mask.gd\").types\nconst totem_minimum_interval = preload(\"res:\/\/spawner\/totem_spawner.gd\").MIN_STEP\nconst GRAVITY = 980.0\nconst MOVE_SPEED = 240.0\nconst DASH_SPEED = 900.0\nconst JUMP_FORCE = 230.0\nconst POINT = 1\nconst INIT_MOVE_DIRECTION = Vector2(1, 1)\n\nvar _velocity = Vector2()\nvar _motion = Vector2()\nvar is_can_jump = true\nvar is_grounded = false\nvar _move_direction = INIT_MOVE_DIRECTION\nvar current_floor = 1\nvar current_mask = \"\"\nvar current_using_mask = \"\"\nvar using_mask_pos = Vector2(0, 0)\nvar hit_totem_pos = Vector2(0, 0)\nvar player_to_hit_totem_pos = Vector2(0, 0)\nvar start_points = [\n\tVector2(0, 80),\n\tVector2(715, 220),\n\tVector2(0, 360)\n]\nvar max_height_floors = [\n\tVector2(0, 50),\n\tVector2(0, 180),\n\tVector2(0, 320)\n]\nvar is_activate_mask = false\nvar is_using_mask = false\nvar is_used_dig_mask = false\nvar is_hit_totem = false\n\nonready var tree = get_tree()\nonready var root = tree.get_root()\nonready var global = root.get_node(\"\/root\/global\")\nonready var _sprite = get_node(\"Sprite\")\nonready var _raycast = get_node(\"RayCast2D\")\nonready var _health = get_node(\"health\")\nonready var _sound_players = {\n\t\"player\" : get_node(\"SamplePlayer\/Player\"),\n\t\"item\" : get_node(\"SamplePlayer\/Item\")\n}\nonready var _timer = get_node(\"Timer\")\nonready var _particles = {\n\t\"have_mask\" : get_node(\"Particles\/have_mask_particle\")\n}\n\nfunc _ready():\n\tif OS.get_name() == \"Android\":\n\t\t_timer.set_wait_time(0.18)\n\tset_process(true)\n\tset_process_input(true)\n\tset_fixed_process(true)\n\nfunc _input(event):\n\tif event.type == InputEvent.MOUSE_BUTTON:\n\t\tis_activate_mask = event.doubleclick\n\telif event.type == InputEvent.SCREEN_TOUCH:\n\t\tif event.pressed and not event.is_echo():\n\t\t\tif _timer.get_time_left() == 0:\n\t\t\t\tis_activate_mask = false\n\t\t\t\t_timer.start()\n\t\t\telse:\n\t\t\t\tis_activate_mask = true\n\t\t\t\t_timer.stop()\n\telse:\n\t\tif event.is_action_pressed(\"jump\"):\n\t\t\tif _timer.get_time_left() == 0:\n\t\t\t\tis_activate_mask = false\n\t\t\t\t_timer.start()\n\t\t\telse:\n\t\t\t\tis_activate_mask = true\n\t\t\t\t_timer.stop()\n\nfunc _process(delta):\n\tif global.is_game_over():\n\t\t_sprite.hide()\n\t\t_particles[ \"have_mask\" ].hide()\n\telse:\n\t\t_sprite.show()\n\t\t_particles[ \"have_mask\" ].set_rotd((_move_direction.x * 90) * -1)\n\t\tif not current_mask == \"\":\n\t\t\t_particles[ \"have_mask\" ].show()\n\t\t\tif not is_grounded:\n\t\t\t\t_particles[ \"have_mask\" ].set_param(Particles2D.PARAM_TANGENTIAL_ACCEL, _move_direction.x * 60)\n\t\t\telse:\n\t\t\t\t_particles[ \"have_mask\" ].set_param(Particles2D.PARAM_TANGENTIAL_ACCEL, 0)\n\t\telse:\n\t\t\t_particles[ \"have_mask\" ].hide()\n\nfunc _fixed_process(delta):\n\tif _health.is_alive():\n\t\tif not global.is_game_over():\n\t\t\tif is_activate_mask:\n\t\t\t\tusing_mask_pos = get_global_pos()\n\t\t\t\tcurrent_using_mask = current_mask\n\t\t\t\tcurrent_mask = \"\"\n\t\t\t\tis_using_mask = true\n\t\t\t\tis_activate_mask = false\n\t\t\tif is_using_mask and not current_using_mask == \"\":\n\t\t\t\tif current_using_mask == mask_types[ 0 ]:\n\t\t\t\t\t_velocity.y = 0\n\t\t\t\t\t_velocity.x = DASH_SPEED * _move_direction.x\n\t\t\t\t\tif abs(get_global_pos().distance_to(using_mask_pos)) > totem_minimum_interval * 1.5:\n\t\t\t\t\t\tstop_using_mask()\n\t\t\t\telif current_using_mask == mask_types[ 1 ]:\n\t\t\t\t\tglobal.add_score(1)\n\t\t\t\t\tif current_floor == 3:\n\t\t\t\t\t\tchange_floor(1)\n\t\t\t\t\telse:\n\t\t\t\t\t\tchange_floor(current_floor + 1)\n\t\t\t\t\tset_global_pos(Vector2(get_global_pos().x, max_height_floors[ current_floor - 1].y))\n\t\t\t\t\tis_used_dig_mask = true\n\t\t\t\t\tstop_using_mask()\n\t\t\telse:\n\t\t\t\tis_grounded = _raycast.is_colliding()\n\t\t\t\t_velocity.y += _move_direction.y * GRAVITY * delta\n\t\t\t\t_velocity.x = _move_direction.x * MOVE_SPEED\n\t\t\t\tif is_grounded and is_can_jump:\n\t\t\t\t\tif Input.is_action_pressed(\"jump\"):\n\t\t\t\t\t\t_velocity.y = -JUMP_FORCE\n\t\t\t\t\t\t_sound_players[ \"player\" ].play(\"jump\")\n\t\telse:\n\t\t\t_velocity = Vector2(0, 0)\n\t\t\n\t\t_motion = _velocity * delta\n\t\t_motion = move(_motion)\n\t\n\t\tif is_colliding():\n\t\t\tvar n = get_collision_normal()\n\t\t\t_motion = n.slide(_motion)\n\t\t\t_velocity = n.slide(_velocity)\n\t\t\tmove(_motion)\n\nfunc set_is_can_jump(is_can):\n\tis_can_jump = is_can\n\nfunc set_is_hit_totem(is_hit):\n\tis_hit_totem = is_hit\n\nfunc get_is_hit_totem():\n\treturn is_hit_totem\n\nfunc get_is_can_jump():\n\treturn is_can_jump\n\nfunc get_is_using_mask():\n\treturn is_using_mask\n\nfunc get_current_floor():\n\treturn current_floor\n\nfunc get_current_mask():\n\treturn current_mask\n\nfunc get_current_using_mask():\n\treturn current_using_mask\n\nfunc get_using_mask_pos():\n\treturn using_mask_pos\n\nfunc get_hit_totem_pos():\n\treturn hit_totem_pos\n\nfunc get_player_to_hit_totem_pos():\n\treturn player_to_hit_totem_pos\n\nfunc get_move_direction():\n\treturn _move_direction\n\nfunc change_move_direction_h():\n\t_move_direction.x *= -1\n\nfunc change_floor(next_floor):\n\tcurrent_floor = next_floor\n\tif current_floor == 2:\n\t\tchange_move_direction_h()\n\t\t_sprite.set_flip_h(true)\n\telif current_floor == 3:\n\t\tchange_move_direction_h()\n\t\t_sprite.set_flip_h(false)\n\nfunc reset_move_direction():\n\t_move_direction = INIT_MOVE_DIRECTION\n\nfunc stop_using_mask():\n\tcurrent_using_mask = \"\"\n\tis_using_mask = false\n\nfunc _on_Area2D_area_enter( area ):\n\tvar areas = area.get_groups()\n\tif areas.has(\"switch_side_trigger\"):\n\t\tglobal.add_score(POINT)\n\t\tstop_using_mask()\n\t\tif area.get_name() == \"floor1-2\":\n\t\t\tchange_floor(2)\n\t\telif area.get_name() == \"floor2-3\":\n\t\t\tchange_floor(3)\n\t\telif area.get_name() == \"floor3-1\":\n\t\t\tchange_floor(1)\n\t\tset_global_pos(start_points[ current_floor - 1])\n\telif areas.has(\"health\"):\n\t\t_health.restore(1)\n\t\t_sound_players[ \"item\" ].play(\"item\")\n\t\tarea.hide()\n\t\tarea.set_global_pos(area.get_parent().get_global_pos())\n\t\t\n\telif areas.has(\"mask\"):\n\t\tcurrent_mask = area.get_type()\n\t\t_sound_players[ \"item\" ].play(\"bonus\")\n\t\tarea.hide()\n\t\tarea.set_global_pos(area.get_parent().get_global_pos())\n\nfunc _on_Area2D_body_enter( body ):\n\tvar groups = body.get_groups()\n\tif groups.has(\"totem\"):\n\t\tset_is_hit_totem(true)\n\t\thit_totem_pos = body.get_global_pos()\n\t\tif _move_direction.x > 0:\n\t\t\tplayer_to_hit_totem_pos = hit_totem_pos - get_global_pos()\n\t\telse:\n\t\t\tplayer_to_hit_totem_pos = get_global_pos() - hit_totem_pos\n\t\t_health.remove(1)\n\t\t_sound_players[ \"player\" ].play(\"hit\")\n\t\tset_global_pos(start_points[ current_floor - 1 ])\n","old_contents":"\nextends KinematicBody2D\n\nconst mask_types = preload(\"res:\/\/mask\/mask.gd\").types\nconst totem_minimum_interval = preload(\"res:\/\/spawner\/totem_spawner.gd\").MIN_STEP\nconst GRAVITY = 980.0\nconst MOVE_SPEED = 240.0\nconst DASH_SPEED = 900.0\nconst JUMP_FORCE = 230.0\nconst POINT = 1\nconst INIT_MOVE_DIRECTION = Vector2(1, 1)\n\nvar _velocity = Vector2()\nvar _motion = Vector2()\nvar is_can_jump = true\nvar is_grounded = false\nvar _move_direction = INIT_MOVE_DIRECTION\nvar current_floor = 1\nvar current_mask = \"\"\nvar current_using_mask = \"\"\nvar using_mask_pos = Vector2(0, 0)\nvar hit_totem_pos = Vector2(0, 0)\nvar player_to_hit_totem_pos = Vector2(0, 0)\nvar start_points = [\n\tVector2(0, 80),\n\tVector2(715, 220),\n\tVector2(0, 360)\n]\nvar max_height_floors = [\n\tVector2(0, 50),\n\tVector2(0, 180),\n\tVector2(0, 320)\n]\nvar is_activate_mask = false\nvar is_using_mask = false\nvar is_used_dig_mask = false\nvar is_hit_totem = false\n\nonready var tree = get_tree()\nonready var root = tree.get_root()\nonready var global = root.get_node(\"\/root\/global\")\nonready var _sprite = get_node(\"Sprite\")\nonready var _raycast = get_node(\"RayCast2D\")\nonready var _health = get_node(\"health\")\nonready var _sound_players = {\n\t\"player\" : get_node(\"SamplePlayer\/Player\"),\n\t\"item\" : get_node(\"SamplePlayer\/Item\")\n}\nonready var _timer = get_node(\"Timer\")\nonready var _particles = {\n\t\"have_mask\" : get_node(\"Particles\/have_mask_particle\")\n}\n\nfunc _ready():\n\tif OS.get_name() == \"Android\":\n\t\t_timer.set_wait_time(0.18)\n\tset_process(true)\n\tset_process_input(true)\n\tset_fixed_process(true)\n\nfunc _input(event):\n\tif event.type == InputEvent.MOUSE_BUTTON:\n\t\tis_activate_mask = event.doubleclick\n\telif event.type == InputEvent.SCREEN_TOUCH:\n\t\tif event.pressed and not event.is_echo():\n\t\t\tif _timer.get_time_left() == 0:\n\t\t\t\tis_activate_mask = false\n\t\t\t\t_timer.start()\n\t\t\telse:\n\t\t\t\tis_activate_mask = true\n\t\t\t\t_timer.stop()\n\telse:\n\t\tif event.is_action_pressed(\"jump\"):\n\t\t\tif _timer.get_time_left() == 0:\n\t\t\t\tis_activate_mask = false\n\t\t\t\t_timer.start()\n\t\t\telse:\n\t\t\t\tis_activate_mask = true\n\t\t\t\t_timer.stop()\n\nfunc _process(delta):\n\tif global.is_game_over():\n\t\t_sprite.hide()\n\t\t_particles[ \"have_mask\" ].hide()\n\telse:\n\t\t_sprite.show()\n\t\t_particles[ \"have_mask\" ].set_rotd((_move_direction.x * 90) * -1)\n\t\tif not current_mask == \"\":\n\t\t\t_particles[ \"have_mask\" ].show()\n\t\t\tif not is_grounded:\n\t\t\t\t_particles[ \"have_mask\" ].set_param(Particles2D.PARAM_TANGENTIAL_ACCEL, _move_direction.x * 60)\n\t\t\telse:\n\t\t\t\t_particles[ \"have_mask\" ].set_param(Particles2D.PARAM_TANGENTIAL_ACCEL, 0)\n\t\telse:\n\t\t\t_particles[ \"have_mask\" ].hide()\n\nfunc _fixed_process(delta):\n\tif _health.is_alive():\n\t\tif not global.is_game_over():\n\t\t\tif is_activate_mask:\n\t\t\t\tusing_mask_pos = get_global_pos()\n\t\t\t\tcurrent_using_mask = current_mask\n\t\t\t\tcurrent_mask = \"\"\n\t\t\t\tis_using_mask = true\n\t\t\t\tis_activate_mask = false\n\t\t\tif is_using_mask and not current_using_mask == \"\":\n\t\t\t\tif current_using_mask == mask_types[ 0 ]:\n\t\t\t\t\t_velocity.y = 0\n\t\t\t\t\t_velocity.x = DASH_SPEED * _move_direction.x\n\t\t\t\t\tif abs(get_global_pos().distance_to(using_mask_pos)) > totem_minimum_interval * 1.5:\n\t\t\t\t\t\tstop_using_mask()\n\t\t\t\telif current_using_mask == mask_types[ 1 ]:\n\t\t\t\t\tglobal.add_score(1)\n\t\t\t\t\tif current_floor == 3:\n\t\t\t\t\t\tchange_floor(1)\n\t\t\t\t\telse:\n\t\t\t\t\t\tchange_floor(current_floor + 1)\n\t\t\t\t\tset_global_pos(Vector2(get_global_pos().x, max_height_floors[ current_floor - 1].y))\n\t\t\t\t\tis_used_dig_mask = true\n\t\t\t\t\tstop_using_mask()\n\t\t\telse:\n\t\t\t\tis_grounded = _raycast.is_colliding()\n\t\t\t\t_velocity.y += _move_direction.y * GRAVITY * delta\n\t\t\t\t_velocity.x = _move_direction.x * MOVE_SPEED\n\t\t\t\tif is_grounded and is_can_jump:\n\t\t\t\t\tif Input.is_action_pressed(\"jump\"):\n\t\t\t\t\t\t_velocity.y = -JUMP_FORCE\n\t\t\t\t\t\t_sound_players[ \"player\" ].play(\"jump\")\n\t\telse:\n\t\t\t_velocity = Vector2(0, 0)\n\t\t\n\t\t_motion = _velocity * delta\n\t\t_motion = move(_motion)\n\t\n\t\tif is_colliding():\n\t\t\tvar n = get_collision_normal()\n\t\t\t_motion = n.slide(_motion)\n\t\t\t_velocity = n.slide(_velocity)\n\t\t\tmove(_motion)\n\nfunc set_is_can_jump(is_can):\n\tis_can_jump = is_can\n\nfunc set_is_hit_totem(is_hit):\n\tis_hit_totem = is_hit\n\nfunc get_is_hit_totem():\n\treturn is_hit_totem\n\nfunc get_is_can_jump():\n\treturn is_can_jump\n\nfunc get_is_using_mask():\n\treturn is_using_mask\n\nfunc get_current_floor():\n\treturn current_floor\n\nfunc get_current_mask():\n\treturn current_mask\n\nfunc get_current_using_mask():\n\treturn current_using_mask\n\nfunc get_using_mask_pos():\n\treturn using_mask_pos\n\nfunc get_hit_totem_pos():\n\treturn hit_totem_pos\n\nfunc get_player_to_hit_totem_pos():\n\treturn player_to_hit_totem_pos\n\nfunc get_move_direction():\n\treturn _move_direction\n\nfunc change_move_direction_h():\n\t_move_direction.x *= -1\n\nfunc change_floor(next_floor):\n\tcurrent_floor = next_floor\n\tif current_floor == 2:\n\t\tchange_move_direction_h()\n\t\t_sprite.set_flip_h(true)\n\telif current_floor == 3:\n\t\tchange_move_direction_h()\n\t\t_sprite.set_flip_h(false)\n\nfunc reset_move_direction():\n\t_move_direction = INIT_MOVE_DIRECTION\n\nfunc stop_using_mask():\n\tcurrent_using_mask = \"\"\n\tis_using_mask = false\n\nfunc _on_Area2D_area_enter( area ):\n\tvar areas = area.get_groups()\n\tif areas.has(\"switch_side_trigger\"):\n\t\tglobal.add_score(POINT)\n\t\tstop_using_mask()\n\t\tif area.get_name() == \"floor1-2\":\n\t\t\tchange_floor(2)\n\t\telif area.get_name() == \"floor2-3\":\n\t\t\tchange_floor(3)\n\t\telif area.get_name() == \"floor3-1\":\n\t\t\tchange_floor(1)\n\t\tset_global_pos(start_points[ current_floor - 1])\n\telif areas.has(\"health\"):\n\t\t_health.restore(1)\n\t\t_sound_players[ \"item\" ].play(\"item\")\n\t\tarea.hide()\n\t\tarea.set_global_pos(area.get_parent().get_global_pos())\n\t\t\n\telif areas.has(\"mask\"):\n\t\tcurrent_mask = area.get_type()\n\t\t_sound_players[ \"item\" ].play(\"bonus\")\n\t\tarea.hide()\n\t\tarea.set_global_pos(area.get_parent().get_global_pos())\n\nfunc _on_Area2D_body_enter( body ):\n\tvar groups = body.get_groups()\n\tif groups.has(\"totem\"):\n\t\tif body.is_colliding():\n\t\t\tset_is_hit_totem(true)\n\t\t\thit_totem_pos = body.get_global_pos()\n\t\t\tif _move_direction.x > 0:\n\t\t\t\tplayer_to_hit_totem_pos = hit_totem_pos - get_global_pos()\n\t\t\telse:\n\t\t\t\tplayer_to_hit_totem_pos = get_global_pos() - hit_totem_pos\n\t\t_health.remove(1)\n\t\t_sound_players[ \"player\" ].play(\"hit\")\n\t\tset_global_pos(start_points[ current_floor - 1 ])\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"0ab2e161346d2ed333f9794054c57e981b3091bb","subject":"Change player highlight colour","message":"Change player highlight colour\n","repos":"mvr\/abyme","old_file":"Constants.gd","new_file":"Constants.gd","new_contents":"extends Node\n\n# Gameplay\n\nvar block_size = 5\n\n# Drawing\nvar background_fade = Color(0.5, 0.5, 0.5, 0.5)\nvar player_highlight = Color(0.7, 0.1, 0.1)\n\n# Animation\n\nvar camera_lerp = 1.5\nvar camera_zoom_lerp = 2.0\nvar move_duration = 0.5\n","old_contents":"extends Node\n\n# Gameplay\n\nvar block_size = 5\n\n# Drawing\nvar background_fade = Color(0.5, 0.5, 0.5, 0.5)\nvar player_highlight = Color(0.5, 0, 0)\n\n# Animation\n\nvar camera_lerp = 1.5\nvar camera_zoom_lerp = 2.0\nvar move_duration = 0.5\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"GDScript"} {"commit":"10d15356f37c5063554e666194d1c301c078b5eb","subject":"Enabled support for path in url","message":"Enabled support for path in url\n","repos":"marcosbitetti\/Godot-Websocket","old_file":"websocket.gd","new_file":"websocket.gd","new_contents":"\nextends StreamPeerTCP\n\nconst MAGIC_STRING = \"258EAFA5-E914-47DA-95CA-C5AB0DC85B11\"\nconst USER_AGENT = \"Godot-client\"\n\n\nconst MESSAGE_RECIEVED = \"msg_recieved\"\nconst BINARY_RECIEVED = \"binary_recieved\"\n\nvar thread = Thread.new()\nvar host = '127.0.0.1'\nvar host_only = host\nvar path = null\nvar port = 80\nvar TIMEOUT = 30\nvar error = ''\nvar messages = []\nvar reciever = null\nvar reciever_f = null\nvar reciever_binary = null\nvar reciever_binary_f = null\n\nvar close_listener = Node.new()\nvar dispatcher = Reference.new()\n\nfunc _run(_self):\n\t###\n\t# Handshake\n\t###\n\tvar tm = 0.0\n\t\n\t# connect\n\twhile true:\n\t\tif get_status()==STATUS_ERROR:\n\t\t\terror = 'Connection fail'\n\t\t\treturn\n\t\tif get_status()==STATUS_CONNECTED:\n\t\t\tbreak\n\t\ttm += 0.1\n\t\tif tm>TIMEOUT:\n\t\t\terror = 'Connection timeout'\n\t\t\treturn\n\t\tOS.delay_msec(100)\n\t\n\tvar _host = self.host\n\tif self.port != 80:\n\t\t_host += ':' + str(self.port)\n\tvar header = ''\n\tvar data = ''\n\t\n\t\n\theader = \"GET \/\"+self.path+\" HTTP\/1.1\\r\\n\"\n\theader += \"Host: \"+self.host_only+\"\\r\\n\"\n\theader += \"Connection: Upgrade\\r\\n\"\n\theader += \"Pragma: no-cache\\r\\n\"\n\theader += \"Cache-Control: no-cache\\r\\n\"\n\theader += \"Upgrade: websocket\\r\\n\"\n\t#header += \"Origin: http:\/\/127.0.0.1:3001\\r\\n\"\n\theader += \"Sec-WebSocket-Version: 13\\r\\n\"\n\theader += \"User-Agent: \"+USER_AGENT+\"\\r\\n\"\n\theader += \"Accept-Encoding: gzip, deflate, sdch\\r\\n\"\n\theader += \"Accept-Language: \"+str(OS.get_locale())+\";q=0.8,en-US;q=0.6,en;q=0.4\\r\\n\"\n\t#header += \"Sec-WebSocket-Key: \"+send_secure+\"\\r\\n\"\n\theader += \"Sec-WebSocket-Key: 6Aw8vTgcG5EvXdQywVvbh_3fMxvd4Q7dcL2caAHAFjV\\r\\n\"\n\theader += \"Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits\\r\\n\"\n\theader += \"\\r\\n\"\n\tprint(header)\n\t\n\tif OK!=put_data( header.to_ascii() ):\n\t\tprint('erro ao enviar headers de handshake')\n\t\treturn\n\n\tdata = ''\n\ttm = 0.0\n\tvar start_read = false\n\twhile true:\n\t\tif get_available_bytes()>0 and not start_read:\n\t\t\tdata += get_string(get_available_bytes())\n\t\t\tstart_read = true\n\t\telif get_available_bytes()==0 and start_read:\n\t\t\tbreak\n\t\t\n\t\tOS.delay_msec(100)\n\t\ttm += 0.1\n\t\tif tm>TIMEOUT:\n\t\t\tprint('timeout')\n\t\t\treturn\n\t#print(data)\n\n\tvar connection_ok = false\n\tfor lin in data.split(\"\\n\"):\n\t\tif lin.find(\"HTTP\/1.1 101\")>-1:\n\t\t\tconnection_ok = true\n\t\t# other headers can by cheched here\n\t\n\tif not connection_ok:\n\t\tprint(data)\n\t\tprint(\"Not connection ok\")\n\t\treturn\n\t\n\tdata = ''\n\tvar is_reading_frame = false\n\tvar size = 0\n\tvar byte = 0\n\tvar fin = 0\n\tvar opcode = 0\n\twhile is_connected():\n\t\tif get_available_bytes()>0:\n\t\t\tif not is_reading_frame:\n\t\t\t\t# frame\n\t\t\t\tbyte = get_8()\n\t\t\t\tfin = byte & 0x80\n\t\t\t\topcode = byte & 0x0F\n\t\t\t\tbyte = get_8()\n\t\t\t\tvar mskd = byte & 0x80\n\t\t\t\tvar payload = byte & 0x7F\n\t\t\t\t#printt('length', get_available_bytes())\n\t\t\t\t#printt(fin,mskd,opcode,payload)\n\t\t\t\t#if fin:\n\t\t\t\t#data += get_string(get_available_bytes())\n\t\t\t\tif payload<126:\n\t\t\t\t\t# size of data = payload\n\t\t\t\t\tdata += get_string(payload)\n\t\t\t\t\tif fin:\n\t\t\t\t\t\tif reciever:\n\t\t\t\t\t\t\tdispatcher.emit_signal(MESSAGE_RECIEVED, data)\n\t\t\t\t\t\tdata = ''\n\t\t\t\telse:\n\t\t\t\t\tsize = 0\n\t\t\t\t\tif payload==126:\n\t\t\t\t\t\t# 16-bit size\n\t\t\t\t\t\tsize = get_u16()\n\t\t\t\t\t\t#printt(size,'of data')\n\t\t\t\t\tif get_available_bytes()0:\n\t\t\tvar msg = messages[0]\n\t\t\tmessages.pop_front()\n\t\t\t\n\t\t\t# mount frame\n\t\t\tvar byte = 0x80 # fin\n\t\t\tbyte = byte | 0x01 # text frame\n\t\t\tput_8(byte)\n\t\t\t# no mask\n\t\t\tbyte = msg.length() # payload size\n\t\t\tput_u8(byte)\n\t\t\tfor i in range(msg.length()):\n\t\t\t\tput_u8(msg.ord_at(i))\n\t\t\tprint(msg)\n\t\t\t\n\t\tOS.delay_msec(3)\n\t\n\nfunc send(msg):\n\tmessages.append(msg)\n\n\nfunc start(host,port,path=null):\n\tself.host_only = host\n\tif path == null:\n\t\tself.host = host\n\telse:\n\t\tself.host = host+\"\/\"+path\n\tself.path = path\n\tself.port = port\n\tset_big_endian(true)\n\tprint(IP.get_local_addresses())\n\tif OK==connect(IP.resolve_hostname(host),port):\n\t\tthread.start(self,'_run', self)\n\telse:\n\t\tprint('no')\n\nfunc set_reciever(o,f):\n\tif reciever:\n\t\tunset_reciever()\n\treciever = o\n\treciever_f = f\n\tdispatcher.connect( MESSAGE_RECIEVED, reciever, reciever_f)\n\nfunc set_binary_reciever(o,f):\n\tif reciever_binary:\n\t\tunset_binary_reciever()\n\treciever_binary = o\n\treciever_binary_f = f\n\tdispatcher.connect( MESSAGE_RECIEVED, reciever_binary, reciever_binary_f)\n\nfunc unset_reciever():\n\tdispatcher.disconnect( MESSAGE_RECIEVED, reciever, reciever_f)\n\treciever = null\n\treciever_f = null\n\nfunc unset_binary_reciever():\n\tdispatcher.disconnect( MESSAGE_RECIEVED, reciever_binary, reciever_binary_f)\n\treciever_binary = null\n\treciever_binary_f = null\n\n\n\t\nfunc _init(reference).():\n\tdispatcher.add_user_signal(MESSAGE_RECIEVED)\n\tdispatcher.add_user_signal(BINARY_RECIEVED)\n\n\n","old_contents":"\nextends StreamPeerTCP\n\nconst MAGIC_STRING = \"258EAFA5-E914-47DA-95CA-C5AB0DC85B11\"\nconst USER_AGENT = \"Godot-client\"\n\n\nconst MESSAGE_RECIEVED = \"msg_recieved\"\nconst BINARY_RECIEVED = \"binary_recieved\"\n\nvar thread = Thread.new()\nvar host = '127.0.0.1'\nvar port = 80\nvar TIMEOUT = 30\nvar error = ''\nvar messages = []\nvar reciever = null\nvar reciever_f = null\nvar reciever_binary = null\nvar reciever_binary_f = null\n\nvar close_listener = Node.new()\nvar dispatcher = Reference.new()\n\nfunc _run(_self):\n\t###\n\t# Handshake\n\t###\n\tvar tm = 0.0\n\t\n\t# connect\n\twhile true:\n\t\tif get_status()==STATUS_ERROR:\n\t\t\terror = 'Connection fail'\n\t\t\treturn\n\t\tif get_status()==STATUS_CONNECTED:\n\t\t\tbreak\n\t\ttm += 0.1\n\t\tif tm>TIMEOUT:\n\t\t\terror = 'Connection timeout'\n\t\t\treturn\n\t\tOS.delay_msec(100)\n\t\n\tvar _host = self.host\n\tif self.port != 80:\n\t\t_host += ':' + str(self.port)\n\tvar header = ''\n\tvar data = ''\n\t\n\t\n\theader = \"GET ws:\/\/\"+_host+\"\/ HTTP\/1.1\\r\\n\"\n\theader += \"Host: \"+_host+\"\\r\\n\"\n\theader += \"Connection: Upgrade\\r\\n\"\n\theader += \"Pragma: no-cache\\r\\n\"\n\theader += \"Cache-Control: no-cache\\r\\n\"\n\theader += \"Upgrade: websocket\\r\\n\"\n\t#header += \"Origin: http:\/\/127.0.0.1:3001\\r\\n\"\n\theader += \"Sec-WebSocket-Version: 13\\r\\n\"\n\theader += \"User-Agent: \"+USER_AGENT+\"\\r\\n\"\n\theader += \"Accept-Encoding: gzip, deflate, sdch\\r\\n\"\n\theader += \"Accept-Language: \"+str(OS.get_locale())+\";q=0.8,en-US;q=0.6,en;q=0.4\\r\\n\"\n\t#header += \"Sec-WebSocket-Key: \"+send_secure+\"\\r\\n\"\n\theader += \"Sec-WebSocket-Key: 6Aw8vTgcG5EvXdQywVvbh_3fMxvd4Q7dcL2caAHAFjV\\r\\n\"\n\theader += \"Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits\\r\\n\"\n\theader += \"\\r\\n\"\n\t#print(header)\n\t\n\tif OK!=put_data( header.to_ascii() ):\n\t\tprint('erro ao enviar headers de handshake')\n\t\treturn\n\n\tdata = ''\n\ttm = 0.0\n\tvar start_read = false\n\twhile true:\n\t\tif get_available_bytes()>0 and not start_read:\n\t\t\tdata += get_string(get_available_bytes())\n\t\t\tstart_read = true\n\t\telif get_available_bytes()==0 and start_read:\n\t\t\tbreak\n\t\t\n\t\tOS.delay_msec(100)\n\t\ttm += 0.1\n\t\tif tm>TIMEOUT:\n\t\t\tprint('timeout')\n\t\t\treturn\n\t#print(data)\n\n\tvar connection_ok = false\n\tfor lin in data.split(\"\\n\"):\n\t\tif lin.find(\"HTTP\/1.1 101\")>-1:\n\t\t\tconnection_ok = true\n\t\t# other headers can by cheched here\n\t\n\tif not connection_ok:\n\t\tprint(data)\n\t\treturn\n\t\n\tdata = ''\n\tvar is_reading_frame = false\n\tvar size = 0\n\tvar byte = 0\n\tvar fin = 0\n\tvar opcode = 0\n\twhile is_connected():\n\t\tif get_available_bytes()>0:\n\t\t\tif not is_reading_frame:\n\t\t\t\t# frame\n\t\t\t\tbyte = get_8()\n\t\t\t\tfin = byte & 0x80\n\t\t\t\topcode = byte & 0x0F\n\t\t\t\tbyte = get_8()\n\t\t\t\tvar mskd = byte & 0x80\n\t\t\t\tvar payload = byte & 0x7F\n\t\t\t\t#printt('length', get_available_bytes())\n\t\t\t\t#printt(fin,mskd,opcode,payload)\n\t\t\t\t#if fin:\n\t\t\t\t#data += get_string(get_available_bytes())\n\t\t\t\tif payload<126:\n\t\t\t\t\t# size of data = payload\n\t\t\t\t\tdata += get_string(payload)\n\t\t\t\t\tif fin:\n\t\t\t\t\t\tif reciever:\n\t\t\t\t\t\t\tdispatcher.emit_signal(MESSAGE_RECIEVED, data)\n\t\t\t\t\t\tdata = ''\n\t\t\t\telse:\n\t\t\t\t\tsize = 0\n\t\t\t\t\tif payload==126:\n\t\t\t\t\t\t# 16-bit size\n\t\t\t\t\t\tsize = get_u16()\n\t\t\t\t\t\t#printt(size,'of data')\n\t\t\t\t\tif get_available_bytes()0:\n\t\t\tvar msg = messages[0]\n\t\t\tmessages.pop_front()\n\t\t\t\n\t\t\t# mount frame\n\t\t\tvar byte = 0x80 # fin\n\t\t\tbyte = byte | 0x01 # text frame\n\t\t\tput_8(byte)\n\t\t\t# no mask\n\t\t\tbyte = msg.length() # payload size\n\t\t\tput_u8(byte)\n\t\t\tfor i in range(msg.length()):\n\t\t\t\tput_u8(msg.ord_at(i))\n\t\t\tprint(msg)\n\t\t\t\n\t\tOS.delay_msec(3)\n\t\n\nfunc send(msg):\n\tmessages.append(msg)\n\n\nfunc start(host,port):\n\tself.host = host\n\tself.port = port\n\tset_big_endian(true)\n\tprint(IP.get_local_addresses())\n\tif OK==connect(IP.resolve_hostname(host),port):\n\t\tthread.start(self,'_run', self)\n\telse:\n\t\tprint('no')\n\nfunc set_reciever(o,f):\n\tif reciever:\n\t\tunset_reciever()\n\treciever = o\n\treciever_f = f\n\tdispatcher.connect( MESSAGE_RECIEVED, reciever, reciever_f)\n\nfunc set_binary_reciever(o,f):\n\tif reciever_binary:\n\t\tunset_binary_reciever()\n\treciever_binary = o\n\treciever_binary_f = f\n\tdispatcher.connect( MESSAGE_RECIEVED, reciever_binary, reciever_binary_f)\n\nfunc unset_reciever():\n\tdispatcher.disconnect( MESSAGE_RECIEVED, reciever, reciever_f)\n\treciever = null\n\treciever_f = null\n\nfunc unset_binary_reciever():\n\tdispatcher.disconnect( MESSAGE_RECIEVED, reciever_binary, reciever_binary_f)\n\treciever_binary = null\n\treciever_binary_f = null\n\n\n\t\nfunc _init(reference).():\n\tdispatcher.add_user_signal(MESSAGE_RECIEVED)\n\tdispatcher.add_user_signal(BINARY_RECIEVED)\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"ef02ef28675b02e9e8fb1e09ccc6acb1dd018b95","subject":"fix demo 3d mousepick test","message":"fix demo 3d mousepick test\n\nadd the missing camera parameter to the _input_event()\n","repos":"guilhermefelipecgs\/godot,DmitriySalnikov\/godot,HatiEth\/godot,vkbsb\/godot,kimsunzun\/godot,josempans\/godot,TheBoyThePlay\/godot,exabon\/godot,BogusCurry\/godot,serafinfernandez\/godot,MrMaidx\/godot,shackra\/godot,ageazrael\/godot,buckle2000\/godot,Faless\/godot,torgartor21\/godot,mikica1986vee\/Godot_VideoModeStuff,DustinTriplett\/godot,karolgotowala\/godot,ageazrael\/godot,xiaoyanit\/godot,lietu\/godot,gau-veldt\/godot,supriyantomaftuh\/godot,youprofit\/godot,blackwc\/godot,iap-mutant\/godot,hitjim\/godot,gcbeyond\/godot,rollenrolm\/godot,teamblubee\/godot,Marqin\/godot,zj8487\/godot,shackra\/godot,blackwc\/godot,Shockblast\/godot,OpenSocialGames\/godot,jjdicharry\/godot,okamstudio\/godot,OpenSocialGames\/godot,quabug\/godot,sanikoyes\/godot,ZuBsPaCe\/godot,Zylann\/godot,DStomtom\/godot,FullMeta\/godot,teamblubee\/godot,crr0004\/godot,sanikoyes\/godot,mikica1986vee\/GodotArrayEditorStuff,davidalpha\/godot,karolgotowala\/godot,ex\/godot,okamstudio\/godot,xiaoyanit\/godot,torgartor21\/godot,lietu\/godot,JoshuaGrams\/godot,zicklag\/godot,morrow1nd\/godot,marynate\/godot,quabug\/godot,serafinfernandez\/godot,jackmakesthings\/godot,pixelpicosean\/my-godot-2.1,ageazrael\/godot,Max-Might\/godot,hipgraphics\/godot,ZuBsPaCe\/godot,BoDonkey\/godot,ZuBsPaCe\/godot,zicklag\/godot,BogusCurry\/godot,hitjim\/godot,MarianoGnu\/godot,zicklag\/godot,Shockblast\/godot,supriyantomaftuh\/godot,youprofit\/godot,Valentactive\/godot,NateWardawg\/godot,dreamsxin\/godot,teamblubee\/godot,BastiaanOlij\/godot,JoshuaGrams\/godot,a12n\/godot,sergicollado\/godot,pixelpicosean\/my-godot-2.1,zj8487\/godot,vastcharade\/godot,n-pigeon\/godot,MarianoGnu\/godot,DStomtom\/godot,Max-Might\/godot,ricpelo\/godot,mamarilmanson\/godot,NateWardawg\/godot,zj8487\/godot,ficoos\/godot,mikica1986vee\/GodotArrayEditorStuff,Max-Might\/godot,mrezai\/godot,Shockblast\/godot,azurvii\/godot,RebelliousX\/Go_Dot,supriyantomaftuh\/godot,gau-veldt\/godot,MrMaidx\/godot,DmitriySalnikov\/godot,mikica1986vee\/Godot_android_tegra_fallback,crr0004\/godot,liuyucoder\/godot,BoDonkey\/godot,karolgotowala\/godot,Valentactive\/godot,dreamsxin\/godot,mamarilmanson\/godot,hipgraphics\/godot,HatiEth\/godot,ricpelo\/godot,sanikoyes\/godot,TheBoyThePlay\/godot,DmitriySalnikov\/godot,n-pigeon\/godot,DustinTriplett\/godot,pkowal1982\/godot,buckle2000\/godot,ficoos\/godot,dreamsxin\/godot,DStomtom\/godot,BoDonkey\/godot,okamstudio\/godot,FullMeta\/godot,groud\/godot,mcanders\/godot,gokudomatic\/godot,huziyizero\/godot,NateWardawg\/godot,FullMeta\/godot,crr0004\/godot,ianholing\/godot,Max-Might\/godot,JoshuaGrams\/godot,Paulloz\/godot,ianholing\/godot,quabug\/godot,sergicollado\/godot,vkbsb\/godot,quabug\/godot,BoDonkey\/godot,ianholing\/godot,groud\/godot,hitjim\/godot,exabon\/godot,FateAce\/godot,akien-mga\/godot,jackmakesthings\/godot,akien-mga\/godot,dreamsxin\/godot,Brickcaster\/godot,est31\/godot,pkowal1982\/godot,mcanders\/godot,ZuBsPaCe\/godot,jackmakesthings\/godot,exabon\/godot,lietu\/godot,torgartor21\/godot,quabug\/godot,teamblubee\/godot,youprofit\/godot,youprofit\/godot,teamblubee\/godot,mikica1986vee\/GodotArrayEditorStuff,karolgotowala\/godot,huziyizero\/godot,Hodes\/godot,vkbsb\/godot,davidalpha\/godot,teamblubee\/godot,davidalpha\/godot,vastcharade\/godot,Paulloz\/godot,davidalpha\/godot,mikica1986vee\/godot,Brickcaster\/godot,agusbena\/godot,marynate\/godot,iap-mutant\/godot,didier-v\/godot,gcbeyond\/godot,azurvii\/godot,mikica1986vee\/Godot_android_tegra_fallback,didier-v\/godot,BastiaanOlij\/godot,rollenrolm\/godot,RebelliousX\/Go_Dot,OpenSocialGames\/godot,liuyucoder\/godot,blackwc\/godot,Zylann\/godot,sh95119\/godot,a12n\/godot,JoshuaGrams\/godot,quabug\/godot,Shockblast\/godot,exabon\/godot,davidalpha\/godot,josempans\/godot,Hodes\/godot,FateAce\/godot,mamarilmanson\/godot,jjdicharry\/godot,NateWardawg\/godot,liuyucoder\/godot,BogusCurry\/godot,MrMaidx\/godot,mikica1986vee\/GodotArrayEditorStuff,BogusCurry\/godot,serafinfernandez\/godot,gcbeyond\/godot,cpascal\/godot,OpenSocialGames\/godot,Max-Might\/godot,MarianoGnu\/godot,HatiEth\/godot,youprofit\/godot,hipgraphics\/godot,agusbena\/godot,MarianoGnu\/godot,gokudomatic\/godot,guilhermefelipecgs\/godot,Marqin\/godot,xiaoyanit\/godot,vnen\/godot,mrezai\/godot,firefly2442\/godot,FullMeta\/godot,a12n\/godot,mikica1986vee\/GodotArrayEditorStuff,vastcharade\/godot,TheBoyThePlay\/godot,MarianoGnu\/godot,vkbsb\/godot,ex\/godot,Valentactive\/godot,OpenSocialGames\/godot,wardw\/godot,jjdicharry\/godot,zicklag\/godot,quabug\/godot,firefly2442\/godot,wardw\/godot,mikica1986vee\/Godot_VideoModeStuff,a12n\/godot,lietu\/godot,akien-mga\/godot,liuyucoder\/godot,DmitriySalnikov\/godot,pkowal1982\/godot,HatiEth\/godot,vnen\/godot,rollenrolm\/godot,buckle2000\/godot,youprofit\/godot,lietu\/godot,wardw\/godot,firefly2442\/godot,gokudomatic\/godot,opmana\/godot,hitjim\/godot,BastiaanOlij\/godot,jejung\/godot,mrezai\/godot,mikica1986vee\/GodotArrayEditorStuff,DStomtom\/godot,azurvii\/godot,morrow1nd\/godot,FullMeta\/godot,blackwc\/godot,n-pigeon\/godot,sh95119\/godot,rollenrolm\/godot,ricpelo\/godot,jjdicharry\/godot,hipgraphics\/godot,xiaoyanit\/godot,est31\/godot,a12n\/godot,ZuBsPaCe\/godot,serafinfernandez\/godot,quabug\/godot,a12n\/godot,tomreyn\/godot,sh95119\/godot,godotengine\/godot,jackmakesthings\/godot,didier-v\/godot,wardw\/godot,RandomShaper\/godot,mikica1986vee\/Godot_android_tegra_fallback,Faless\/godot,iap-mutant\/godot,n-pigeon\/godot,zj8487\/godot,agusbena\/godot,wardw\/godot,RebelliousX\/Go_Dot,ex\/godot,tomreyn\/godot,HatiEth\/godot,pkowal1982\/godot,RebelliousX\/Go_Dot,gokudomatic\/godot,OpenSocialGames\/godot,FateAce\/godot,mrezai\/godot,ZuBsPaCe\/godot,marynate\/godot,vastcharade\/godot,est31\/godot,NateWardawg\/godot,ricpelo\/godot,groud\/godot,huziyizero\/godot,shackra\/godot,didier-v\/godot,davidalpha\/godot,Zylann\/godot,sergicollado\/godot,wardw\/godot,torgartor21\/godot,ficoos\/godot,groud\/godot,ficoos\/godot,Shockblast\/godot,honix\/godot,okamstudio\/godot,xiaoyanit\/godot,ricpelo\/godot,wardw\/godot,gokudomatic\/godot,mikica1986vee\/Godot_android_tegra_fallback,supriyantomaftuh\/godot,n-pigeon\/godot,Valentactive\/godot,Hodes\/godot,mikica1986vee\/godot,jjdicharry\/godot,youprofit\/godot,zicklag\/godot,RandomShaper\/godot,TheBoyThePlay\/godot,hitjim\/godot,josempans\/godot,blackwc\/godot,ianholing\/godot,exabon\/godot,firefly2442\/godot,godotengine\/godot,serafinfernandez\/godot,vkbsb\/godot,dreamsxin\/godot,didier-v\/godot,zj8487\/godot,TheBoyThePlay\/godot,guilhermefelipecgs\/godot,akien-mga\/godot,okamstudio\/godot,n-pigeon\/godot,mikica1986vee\/Godot_android_tegra_fallback,mikica1986vee\/GodotArrayEditorStuff,firefly2442\/godot,godotengine\/godot,BastiaanOlij\/godot,ageazrael\/godot,ZuBsPaCe\/godot,Zylann\/godot,marynate\/godot,mikica1986vee\/godot,HatiEth\/godot,azurvii\/godot,Shockblast\/godot,mikica1986vee\/Godot_android_tegra_fallback,ianholing\/godot,ricpelo\/godot,okamstudio\/godot,Valentactive\/godot,Hodes\/godot,marynate\/godot,opmana\/godot,gau-veldt\/godot,crr0004\/godot,mikica1986vee\/Godot_VideoModeStuff,josempans\/godot,agusbena\/godot,huziyizero\/godot,vastcharade\/godot,OpenSocialGames\/godot,ageazrael\/godot,iap-mutant\/godot,MrMaidx\/godot,supriyantomaftuh\/godot,liuyucoder\/godot,sanikoyes\/godot,shackra\/godot,mikica1986vee\/godot,okamstudio\/godot,FateAce\/godot,firefly2442\/godot,FullMeta\/godot,Faless\/godot,DStomtom\/godot,hitjim\/godot,morrow1nd\/godot,BastiaanOlij\/godot,wardw\/godot,mikica1986vee\/Godot_android_tegra_fallback,RandomShaper\/godot,mcanders\/godot,shackra\/godot,zj8487\/godot,Marqin\/godot,DmitriySalnikov\/godot,sergicollado\/godot,karolgotowala\/godot,ex\/godot,zj8487\/godot,TheBoyThePlay\/godot,cpascal\/godot,agusbena\/godot,ianholing\/godot,dreamsxin\/godot,karolgotowala\/godot,RandomShaper\/godot,crr0004\/godot,didier-v\/godot,josempans\/godot,Marqin\/godot,cpascal\/godot,mikica1986vee\/Godot_VideoModeStuff,FullMeta\/godot,mikica1986vee\/GodotArrayEditorStuff,youprofit\/godot,supriyantomaftuh\/godot,lietu\/godot,gcbeyond\/godot,DmitriySalnikov\/godot,mrezai\/godot,sergicollado\/godot,FullMeta\/godot,pkowal1982\/godot,youprofit\/godot,groud\/godot,DStomtom\/godot,Paulloz\/godot,pixelpicosean\/my-godot-2.1,cpascal\/godot,mrezai\/godot,mrezai\/godot,RandomShaper\/godot,mikica1986vee\/Godot_android_tegra_fallback,mikica1986vee\/godot,vastcharade\/godot,RandomShaper\/godot,godotengine\/godot,Marqin\/godot,vastcharade\/godot,jejung\/godot,vnen\/godot,rollenrolm\/godot,marynate\/godot,jackmakesthings\/godot,karolgotowala\/godot,Zylann\/godot,blackwc\/godot,tomreyn\/godot,JoshuaGrams\/godot,youprofit\/godot,BoDonkey\/godot,Zylann\/godot,vastcharade\/godot,a12n\/godot,DStomtom\/godot,wardw\/godot,crr0004\/godot,TheHX\/godot,torgartor21\/godot,gokudomatic\/godot,ex\/godot,sanikoyes\/godot,okamstudio\/godot,lietu\/godot,buckle2000\/godot,marynate\/godot,NateWardawg\/godot,ianholing\/godot,godotengine\/godot,vkbsb\/godot,blackwc\/godot,gokudomatic\/godot,teamblubee\/godot,HatiEth\/godot,TheBoyThePlay\/godot,a12n\/godot,Brickcaster\/godot,godotengine\/godot,mikica1986vee\/godot,crr0004\/godot,teamblubee\/godot,TheHX\/godot,vnen\/godot,mamarilmanson\/godot,est31\/godot,a12n\/godot,dreamsxin\/godot,MrMaidx\/godot,sh95119\/godot,akien-mga\/godot,sergicollado\/godot,HatiEth\/godot,mamarilmanson\/godot,gcbeyond\/godot,gcbeyond\/godot,est31\/godot,quabug\/godot,vnen\/godot,ageazrael\/godot,mcanders\/godot,Shockblast\/godot,josempans\/godot,n-pigeon\/godot,guilhermefelipecgs\/godot,DustinTriplett\/godot,akien-mga\/godot,DustinTriplett\/godot,cpascal\/godot,Brickcaster\/godot,jjdicharry\/godot,kimsunzun\/godot,Max-Might\/godot,Brickcaster\/godot,Faless\/godot,pkowal1982\/godot,BogusCurry\/godot,lietu\/godot,josempans\/godot,sergicollado\/godot,honix\/godot,Valentactive\/godot,HatiEth\/godot,DustinTriplett\/godot,serafinfernandez\/godot,firefly2442\/godot,sergicollado\/godot,didier-v\/godot,Paulloz\/godot,sergicollado\/godot,supriyantomaftuh\/godot,kimsunzun\/godot,jjdicharry\/godot,mamarilmanson\/godot,OpenSocialGames\/godot,shackra\/godot,davidalpha\/godot,teamblubee\/godot,DStomtom\/godot,opmana\/godot,dreamsxin\/godot,kimsunzun\/godot,gokudomatic\/godot,BogusCurry\/godot,honix\/godot,teamblubee\/godot,marynate\/godot,blackwc\/godot,okamstudio\/godot,BoDonkey\/godot,NateWardawg\/godot,hipgraphics\/godot,jackmakesthings\/godot,blackwc\/godot,sh95119\/godot,cpascal\/godot,iap-mutant\/godot,liuyucoder\/godot,Marqin\/godot,lietu\/godot,agusbena\/godot,mamarilmanson\/godot,NateWardawg\/godot,hipgraphics\/godot,kimsunzun\/godot,torgartor21\/godot,Brickcaster\/godot,RebelliousX\/Go_Dot,Faless\/godot,BogusCurry\/godot,DStomtom\/godot,DustinTriplett\/godot,gcbeyond\/godot,marynate\/godot,karolgotowala\/godot,ex\/godot,iap-mutant\/godot,vkbsb\/godot,xiaoyanit\/godot,sh95119\/godot,kimsunzun\/godot,sanikoyes\/godot,crr0004\/godot,mikica1986vee\/Godot_android_tegra_fallback,DustinTriplett\/godot,gcbeyond\/godot,Paulloz\/godot,torgartor21\/godot,crr0004\/godot,buckle2000\/godot,didier-v\/godot,TheBoyThePlay\/godot,guilhermefelipecgs\/godot,morrow1nd\/godot,liuyucoder\/godot,est31\/godot,xiaoyanit\/godot,mikica1986vee\/GodotArrayEditorStuff,guilhermefelipecgs\/godot,shackra\/godot,vnen\/godot,shackra\/godot,zj8487\/godot,ricpelo\/godot,liuyucoder\/godot,Zylann\/godot,agusbena\/godot,sh95119\/godot,morrow1nd\/godot,xiaoyanit\/godot,gokudomatic\/godot,jejung\/godot,jackmakesthings\/godot,FullMeta\/godot,okamstudio\/godot,marynate\/godot,iap-mutant\/godot,didier-v\/godot,josempans\/godot,honix\/godot,serafinfernandez\/godot,MarianoGnu\/godot,TheBoyThePlay\/godot,honix\/godot,MrMaidx\/godot,ricpelo\/godot,ficoos\/godot,didier-v\/godot,TheHX\/godot,gau-veldt\/godot,ianholing\/godot,sh95119\/godot,mikica1986vee\/godot,karolgotowala\/godot,sh95119\/godot,jejung\/godot,davidalpha\/godot,zj8487\/godot,zj8487\/godot,agusbena\/godot,serafinfernandez\/godot,guilhermefelipecgs\/godot,tomreyn\/godot,JoshuaGrams\/godot,azurvii\/godot,Zylann\/godot,DStomtom\/godot,godotengine\/godot,supriyantomaftuh\/godot,xiaoyanit\/godot,vastcharade\/godot,pixelpicosean\/my-godot-2.1,exabon\/godot,OpenSocialGames\/godot,jackmakesthings\/godot,mamarilmanson\/godot,BastiaanOlij\/godot,ianholing\/godot,jjdicharry\/godot,akien-mga\/godot,davidalpha\/godot,Valentactive\/godot,ex\/godot,MarianoGnu\/godot,FateAce\/godot,hitjim\/godot,DustinTriplett\/godot,ZuBsPaCe\/godot,HatiEth\/godot,BogusCurry\/godot,BoDonkey\/godot,supriyantomaftuh\/godot,iap-mutant\/godot,pkowal1982\/godot,Faless\/godot,TheBoyThePlay\/godot,kimsunzun\/godot,hitjim\/godot,Faless\/godot,FateAce\/godot,Hodes\/godot,vnen\/godot,Paulloz\/godot,supriyantomaftuh\/godot,jejung\/godot,ricpelo\/godot,iap-mutant\/godot,TheHX\/godot,sanikoyes\/godot,quabug\/godot,jackmakesthings\/godot,karolgotowala\/godot,dreamsxin\/godot,honix\/godot,TheHX\/godot,kimsunzun\/godot,BastiaanOlij\/godot,kimsunzun\/godot,gcbeyond\/godot,jjdicharry\/godot,cpascal\/godot,RebelliousX\/Go_Dot,opmana\/godot,cpascal\/godot,godotengine\/godot,MarianoGnu\/godot,serafinfernandez\/godot,jjdicharry\/godot,pkowal1982\/godot,jackmakesthings\/godot,mikica1986vee\/Godot_VideoModeStuff,mikica1986vee\/godot,BogusCurry\/godot,liuyucoder\/godot,blackwc\/godot,mikica1986vee\/Godot_VideoModeStuff,gcbeyond\/godot,BoDonkey\/godot,vastcharade\/godot,gau-veldt\/godot,akien-mga\/godot,mamarilmanson\/godot,mcanders\/godot,mikica1986vee\/godot,vnen\/godot,lietu\/godot,a12n\/godot,Valentactive\/godot,mamarilmanson\/godot,vkbsb\/godot,torgartor21\/godot,huziyizero\/godot,firefly2442\/godot,Paulloz\/godot,cpascal\/godot,sergicollado\/godot,ageazrael\/godot,mikica1986vee\/GodotArrayEditorStuff,Faless\/godot,serafinfernandez\/godot,Shockblast\/godot,ricpelo\/godot,mikica1986vee\/Godot_android_tegra_fallback,NateWardawg\/godot,mikica1986vee\/godot,shackra\/godot,crr0004\/godot,hipgraphics\/godot,cpascal\/godot,BoDonkey\/godot,kimsunzun\/godot,RandomShaper\/godot,jejung\/godot,ianholing\/godot,tomreyn\/godot,hipgraphics\/godot,azurvii\/godot,dreamsxin\/godot,hipgraphics\/godot,sanikoyes\/godot,zicklag\/godot,Hodes\/godot,ficoos\/godot,FullMeta\/godot,buckle2000\/godot,wardw\/godot,torgartor21\/godot,sh95119\/godot,mrezai\/godot,hitjim\/godot,morrow1nd\/godot,BastiaanOlij\/godot,shackra\/godot,torgartor21\/godot,Brickcaster\/godot,groud\/godot,pixelpicosean\/my-godot-2.1,xiaoyanit\/godot,ex\/godot,liuyucoder\/godot,BogusCurry\/godot,gokudomatic\/godot,hipgraphics\/godot,BoDonkey\/godot,davidalpha\/godot,DmitriySalnikov\/godot,OpenSocialGames\/godot,hitjim\/godot,opmana\/godot,mcanders\/godot,mikica1986vee\/Godot_VideoModeStuff,iap-mutant\/godot,guilhermefelipecgs\/godot,mikica1986vee\/Godot_VideoModeStuff","old_file":"demos\/3d\/mousepick_test\/mousepick.gd","new_file":"demos\/3d\/mousepick_test\/mousepick.gd","new_contents":"\nextends RigidBody\n\n# member variables here, example:\n# var a=2\n# var b=\"textvar\"\n\nvar gray_mat = FixedMaterial.new()\n\nvar selected=false\n\nfunc _input_event(camera,event,pos,normal,shape):\n\tif (event.type==InputEvent.MOUSE_BUTTON and event.pressed):\n\t\tif (not selected):\n\t\t\tget_node(\"mesh\").set_material_override(gray_mat)\n\t\telse:\n\t\t\tget_node(\"mesh\").set_material_override(null)\n\t\t\n\t\tselected = not selected\n\t\t\n\nfunc _mouse_enter():\n\tget_node(\"mesh\").set_scale( Vector3(1.1,1.1,1.1) )\n\nfunc _mouse_exit():\n\tget_node(\"mesh\").set_scale( Vector3(1,1,1) )\n\nfunc _ready():\n\t# Initalization here\n\tpass\n\n\n","old_contents":"\nextends RigidBody\n\n# member variables here, example:\n# var a=2\n# var b=\"textvar\"\n\nvar gray_mat = FixedMaterial.new()\n\nvar selected=false\n\nfunc _input_event(event,pos,normal,shape):\n\tif (event.type==InputEvent.MOUSE_BUTTON and event.pressed):\n\t\tif (not selected):\n\t\t\tget_node(\"mesh\").set_material_override(gray_mat)\n\t\telse:\n\t\t\tget_node(\"mesh\").set_material_override(null)\n\t\t\n\t\tselected = not selected\n\t\t\n\nfunc _mouse_enter():\n\tget_node(\"mesh\").set_scale( Vector3(1.1,1.1,1.1) )\n\nfunc _mouse_exit():\n\tget_node(\"mesh\").set_scale( Vector3(1,1,1) )\n\nfunc _ready():\n\t# Initalization here\n\tpass\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"943d534acc149f47f7bcd197f9d9118e43ccb20f","subject":"Jumping XP","message":"Jumping XP\n","repos":"shelltitan\/captain-holetooth,shelltitan\/captain-holetooth,AlexHolly\/captain-holetooth,AlexHolly\/captain-holetooth","old_file":"src\/actors\/player\/player.gd","new_file":"src\/actors\/player\/player.gd","new_contents":"\nextends RigidBody2D\n\n# Character Demo, written by Juan Linietsky.\n#\n# Implementation of a 2D Character controller.\n# This implementation uses the physics engine for\n# controlling a character, in a very similar way\n# than a 3D character controller would be implemented.\n#\n# Using the physics engine for this has the main\n# advantages:\n# -Easy to write.\n# -Interaction with other physics-based objects is free\n# -Only have to deal with the object linear velocity, not position\n# -All collision\/area framework available\n# \n# But also has the following disadvantages:\n# \n# -Objects may bounce a little bit sometimes\n# -Going up ramps sends the chracter flying up, small hack is needed.\n# -A ray collider is needed to avoid sliding down on ramps and \n# undesiderd bumps, small steps and rare numerical precision errors.\n# (another alternative may be to turn on friction when the character is not moving).\n# -Friction cant be used, so floor velocity must be considered\n# for moving platforms.\n\n# Member variables\nvar anim = \"\"\nvar siding_left = false\nvar jumping = false\nvar stopping_jump = false\nvar shooting = false\n\nvar WALK_ACCEL = 800.0\nvar WALK_DEACCEL = 800.0\nvar WALK_MAX_VELOCITY = 200.0\nvar AIR_ACCEL = 200.0\nvar AIR_DEACCEL = 200.0\nvar JUMP_VELOCITY = 480\nvar STOP_JUMP_FORCE = 900.0\n\nvar MAX_FLOOR_AIRBORNE_TIME = 0.15\n\nvar airborne_time = 1e20\nvar shoot_time = 1e20\n\nvar MAX_SHOOT_POSE_TIME = 0.3\n\nvar bullet = preload(\"res:\/\/src\/actors\/player\/bullet.tscn\")\n\nvar floor_h_velocity = 0.0\nvar enemy\n\n#func beam_to(spawner):\n\t\n#\tvar spawnerpos = get_node(spawner).get_global_pos()\n#\tprint(\"Beam to active!\")\n#\tself.set_pos(spawnerpos)\n\n\nfunc _integrate_forces(s):\n\tvar lv = s.get_linear_velocity()\n\tvar step = s.get_step()\n\t\n\tvar new_anim = anim\n\tvar new_siding_left = siding_left\n\t\n\t# Get the controls\n\tvar move_left = Input.is_action_pressed(\"move_left\")\n\tvar move_right = Input.is_action_pressed(\"move_right\")\n\tvar jump = Input.is_action_pressed(\"jump\")\n\tvar shoot = Input.is_action_pressed(\"shoot\")\n\tvar spawn = Input.is_action_pressed(\"spawn\")\n\t\n\tif spawn:\n\t\tvar e = enemy.instance()\n\t\tvar p = get_pos()\n\t\tp.y = p.y - 100\n\t\te.set_pos(p)\n\t\tget_parent().add_child(e)\n\t\n\t# Deapply prev floor velocity\n\tlv.x -= floor_h_velocity\n\tfloor_h_velocity = 0.0\n\t\n\t# Find the floor (a contact with upwards facing collision normal)\n\tvar found_floor = false\n\tvar floor_index = -1\n\t\n\tfor x in range(s.get_contact_count()):\n\t\tvar ci = s.get_contact_local_normal(x)\n\t\tif (ci.dot(Vector2(0, -1)) > 0.6):\n\t\t\tfound_floor = true\n\t\t\tfloor_index = x\n\t\n\t# A good idea when impementing characters of all kinds,\n\t# compensates for physics imprecission, as well as human reaction delay.\n\tif (shoot and not shooting):\n\t\tshoot_time = 0\n\t\tvar bi = bullet.instance()\n\t\tvar ss\n\t\tif (siding_left):\n\t\t\tss = -1.0\n\t\telse:\n\t\t\tss = 1.0\n\t\tvar pos = get_pos() + get_node(\"bullet_shoot\").get_pos()*Vector2(ss, 1.0)\n\t\t\n\t\tbi.set_pos(pos)\n\t\tget_parent().add_child(bi)\n\t\t\n\t\tbi.set_linear_velocity(Vector2(800.0*ss, -80))\n\t\tget_node(\"sprite\/smoke\").set_emitting(true)\n\t\tget_node(\"sfx\").play(\"shoot\")\n\t\tPS2D.body_add_collision_exception(bi.get_rid(), get_rid()) # Make bullet and this not collide\n\telse:\n\t\tshoot_time += step\n\t\n\tif (found_floor):\n\t\tairborne_time = 0.0\n\telse:\n\t\tairborne_time += step # Time it spent in the air\n\t\n\tvar on_floor = airborne_time < MAX_FLOOR_AIRBORNE_TIME\n\n\t# Process jump\n\tif (jumping):\n\t\tif (lv.y > 0):\n\t\t\t# Set off the jumping flag if going down\n\t\t\tjumping = false\n\t\t\t\n\t\telif (not jump):\n\t\t\tstopping_jump = true\n\t\t\n\t\tif (stopping_jump):\n\t\t\tlv.y += STOP_JUMP_FORCE*step\n\t\t\t\n\t\t\t\n\t\n\tif (on_floor):\n\t\t# Process logic when character is on floor\n\t\tif (move_left and not move_right):\n\t\t\tif (lv.x > -WALK_MAX_VELOCITY):\n\t\t\t\tlv.x -= WALK_ACCEL*step\n\t\telif (move_right and not move_left):\n\t\t\tif (lv.x < WALK_MAX_VELOCITY):\n\t\t\t\tlv.x += WALK_ACCEL*step\n\t\telse:\n\t\t\tvar xv = abs(lv.x)\n\t\t\txv -= WALK_DEACCEL*step\n\t\t\tif (xv < 0):\n\t\t\t\txv = 0\n\t\t\tlv.x = sign(lv.x)*xv\n\n\t\t\n\t\t# Check jump\n\t\tif (not jumping and jump):\n\t\t\tlv.y = -JUMP_VELOCITY\n\t\t\tjumping = true\n\t\t\tstopping_jump = false\n\t\t\tget_node(\"sfx\").play(\"jump\")\n\t\t\t\n\t\t\t# THIS IS FOR FUTURE USE - Its a statistics thing for players to see like \"Hey you only jumped 20 times during the whole game...\"\n\t\t\t# Whatever use it is, i think its a fun element to talk about :D\n\t\t\t# I don't care often about the \"use\" of things... just having it for fun is good enough ;)\n\t\t\t\n\t\t\tglobal.times_jumped = global.times_jumped +1\n\t\t\tprint(global.times_jumped)\n\t\t\tif (global.times_jumped > 100):\n\t\t\t\tJUMP_VELOCITY = 550\n\t\t\t\tprint(\"Yay! You can now jump higher\")\n\t\t\n\t\t# Check siding\n\t\tif (lv.x < 0 and move_left):\n\t\t\tnew_siding_left = true\n\t\telif (lv.x > 0 and move_right):\n\t\t\tnew_siding_left = false\n\t\tif (jumping):\n\t\t\tnew_anim = \"jumping\"\n\t\telif (abs(lv.x) < 0.1):\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"idle_weapon\"\n\t\t\telse:\n\t\t\t\tnew_anim = \"idle\"\n\t\telse:\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"run_weapon\"\n\t\t\telse:\n\t\t\t\tnew_anim = \"run\"\n\telse:\n\t\t# Process logic when the character is in the air\n\t\tif (move_left and not move_right):\n\t\t\tif (lv.x > -WALK_MAX_VELOCITY):\n\t\t\t\tlv.x -= AIR_ACCEL*step\n\t\telif (move_right and not move_left):\n\t\t\tif (lv.x < WALK_MAX_VELOCITY):\n\t\t\t\tlv.x += AIR_ACCEL*step\n\t\telse:\n\t\t\tvar xv = abs(lv.x)\n\t\t\txv -= AIR_DEACCEL*step\n\t\t\tif (xv < 0):\n\t\t\t\txv = 0\n\t\t\tlv.x = sign(lv.x)*xv\n\t\t\n\t\tif (lv.y < 0):\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"jumping_weapon\"\n\t\t\telse:\n\t\t\t\tnew_anim = \"jumping\"\n\t\telse:\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"falling_weapon\"\n\t\t\t\n\t\t\telse:\n\t\t\t\tnew_anim = \"falling\"\n\t\n\t# Update siding\n\tif (new_siding_left != siding_left):\n\t\tif (new_siding_left):\n\t\t\tget_node(\"sprite\").set_scale(Vector2(-1, 1))\n\t\telse:\n\t\t\tget_node(\"sprite\").set_scale(Vector2(1, 1))\n\t\t\n\t\tsiding_left = new_siding_left\n\t\n\t# Change animation\n\tif (new_anim != anim):\n\t\tanim = new_anim\n\t\tget_node(\"anim\").play(anim)\n\t\n\tshooting = shoot\n\t\n\t# Apply floor velocity\n\tif (found_floor):\n\t\tfloor_h_velocity = s.get_contact_collider_velocity_at_pos(floor_index).x\n\t\tlv.x += floor_h_velocity\n\t\n\t# Finally, apply gravity and set back the linear velocity\n\tlv += s.get_total_gravity()*step\n\ts.set_linear_velocity(lv)\n\n\nfunc _ready():\n\tenemy = ResourceLoader.load(\"res:\/\/scenes\/scn3-forest\/enemy.tscn\")\n\n\n#\tif !Globals.has_singleton(\"Facebook\"):\n#\t\treturn\n#\tvar Facebook = Globals.get_singleton(\"Facebook\")\n#\tvar link = Globals.get(\"facebook\/link\")\n#\tvar icon = Globals.get(\"facebook\/icon\")\n#\tvar msg = \"I just sneezed on your wall! Beat my score and Stop the Running nose!\"\n#\tvar title = \"I just sneezed on your wall!\"\n#\tFacebook.post(\"feed\", msg, title, link, icon)\n","old_contents":"\nextends RigidBody2D\n\n# Character Demo, written by Juan Linietsky.\n#\n# Implementation of a 2D Character controller.\n# This implementation uses the physics engine for\n# controlling a character, in a very similar way\n# than a 3D character controller would be implemented.\n#\n# Using the physics engine for this has the main\n# advantages:\n# -Easy to write.\n# -Interaction with other physics-based objects is free\n# -Only have to deal with the object linear velocity, not position\n# -All collision\/area framework available\n# \n# But also has the following disadvantages:\n# \n# -Objects may bounce a little bit sometimes\n# -Going up ramps sends the chracter flying up, small hack is needed.\n# -A ray collider is needed to avoid sliding down on ramps and \n# undesiderd bumps, small steps and rare numerical precision errors.\n# (another alternative may be to turn on friction when the character is not moving).\n# -Friction cant be used, so floor velocity must be considered\n# for moving platforms.\n\n# Member variables\nvar anim = \"\"\nvar siding_left = false\nvar jumping = false\nvar stopping_jump = false\nvar shooting = false\n\nvar WALK_ACCEL = 800.0\nvar WALK_DEACCEL = 800.0\nvar WALK_MAX_VELOCITY = 200.0\nvar AIR_ACCEL = 200.0\nvar AIR_DEACCEL = 200.0\nvar JUMP_VELOCITY = 480\nvar STOP_JUMP_FORCE = 900.0\n\nvar MAX_FLOOR_AIRBORNE_TIME = 0.15\n\nvar airborne_time = 1e20\nvar shoot_time = 1e20\n\nvar MAX_SHOOT_POSE_TIME = 0.3\n\nvar bullet = preload(\"res:\/\/src\/actors\/player\/bullet.tscn\")\n\nvar floor_h_velocity = 0.0\nvar enemy\n\n#func beam_to(spawner):\n\t\n#\tvar spawnerpos = get_node(spawner).get_global_pos()\n#\tprint(\"Beam to active!\")\n#\tself.set_pos(spawnerpos)\n\n\nfunc _integrate_forces(s):\n\tvar lv = s.get_linear_velocity()\n\tvar step = s.get_step()\n\t\n\tvar new_anim = anim\n\tvar new_siding_left = siding_left\n\t\n\t# Get the controls\n\tvar move_left = Input.is_action_pressed(\"move_left\")\n\tvar move_right = Input.is_action_pressed(\"move_right\")\n\tvar jump = Input.is_action_pressed(\"jump\")\n\tvar shoot = Input.is_action_pressed(\"shoot\")\n\tvar spawn = Input.is_action_pressed(\"spawn\")\n\t\n\tif spawn:\n\t\tvar e = enemy.instance()\n\t\tvar p = get_pos()\n\t\tp.y = p.y - 100\n\t\te.set_pos(p)\n\t\tget_parent().add_child(e)\n\t\n\t# Deapply prev floor velocity\n\tlv.x -= floor_h_velocity\n\tfloor_h_velocity = 0.0\n\t\n\t# Find the floor (a contact with upwards facing collision normal)\n\tvar found_floor = false\n\tvar floor_index = -1\n\t\n\tfor x in range(s.get_contact_count()):\n\t\tvar ci = s.get_contact_local_normal(x)\n\t\tif (ci.dot(Vector2(0, -1)) > 0.6):\n\t\t\tfound_floor = true\n\t\t\tfloor_index = x\n\t\n\t# A good idea when impementing characters of all kinds,\n\t# compensates for physics imprecission, as well as human reaction delay.\n\tif (shoot and not shooting):\n\t\tshoot_time = 0\n\t\tvar bi = bullet.instance()\n\t\tvar ss\n\t\tif (siding_left):\n\t\t\tss = -1.0\n\t\telse:\n\t\t\tss = 1.0\n\t\tvar pos = get_pos() + get_node(\"bullet_shoot\").get_pos()*Vector2(ss, 1.0)\n\t\t\n\t\tbi.set_pos(pos)\n\t\tget_parent().add_child(bi)\n\t\t\n\t\tbi.set_linear_velocity(Vector2(800.0*ss, -80))\n\t\tget_node(\"sprite\/smoke\").set_emitting(true)\n\t\tget_node(\"sfx\").play(\"shoot\")\n\t\tPS2D.body_add_collision_exception(bi.get_rid(), get_rid()) # Make bullet and this not collide\n\telse:\n\t\tshoot_time += step\n\t\n\tif (found_floor):\n\t\tairborne_time = 0.0\n\telse:\n\t\tairborne_time += step # Time it spent in the air\n\t\n\tvar on_floor = airborne_time < MAX_FLOOR_AIRBORNE_TIME\n\n\t# Process jump\n\tif (jumping):\n\t\tif (lv.y > 0):\n\t\t\t# Set off the jumping flag if going down\n\t\t\tjumping = false\n\t\t\t\n\t\telif (not jump):\n\t\t\tstopping_jump = true\n\t\t\n\t\tif (stopping_jump):\n\t\t\tlv.y += STOP_JUMP_FORCE*step\n\t\t\t\n\t\t\t\n\t\n\tif (on_floor):\n\t\t# Process logic when character is on floor\n\t\tif (move_left and not move_right):\n\t\t\tif (lv.x > -WALK_MAX_VELOCITY):\n\t\t\t\tlv.x -= WALK_ACCEL*step\n\t\telif (move_right and not move_left):\n\t\t\tif (lv.x < WALK_MAX_VELOCITY):\n\t\t\t\tlv.x += WALK_ACCEL*step\n\t\telse:\n\t\t\tvar xv = abs(lv.x)\n\t\t\txv -= WALK_DEACCEL*step\n\t\t\tif (xv < 0):\n\t\t\t\txv = 0\n\t\t\tlv.x = sign(lv.x)*xv\n\n\t\t\n\t\t# Check jump\n\t\tif (not jumping and jump):\n\t\t\tlv.y = -JUMP_VELOCITY\n\t\t\tjumping = true\n\t\t\tstopping_jump = false\n\t\t\tget_node(\"sfx\").play(\"jump\")\n\t\t\t\n\t\t\t# THIS IS FOR FUTURE USE - Its a statistics thing for players to see like \"Hey you only jumped 20 times during the whole game...\"\n\t\t\t# Whatever use it is, i think its a fun element to talk about :D\n\t\t\t# I don't care often about the \"use\" of things... just having it for fun is good enough ;)\n\t\t\t\n\t\t\tglobal.times_jumped = global.times_jumped +1\n\t\t\tprint(global.times_jumped)\n\t\t\n\t\t# Check siding\n\t\tif (lv.x < 0 and move_left):\n\t\t\tnew_siding_left = true\n\t\telif (lv.x > 0 and move_right):\n\t\t\tnew_siding_left = false\n\t\tif (jumping):\n\t\t\tnew_anim = \"jumping\"\n\t\telif (abs(lv.x) < 0.1):\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"idle_weapon\"\n\t\t\telse:\n\t\t\t\tnew_anim = \"idle\"\n\t\telse:\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"run_weapon\"\n\t\t\telse:\n\t\t\t\tnew_anim = \"run\"\n\telse:\n\t\t# Process logic when the character is in the air\n\t\tif (move_left and not move_right):\n\t\t\tif (lv.x > -WALK_MAX_VELOCITY):\n\t\t\t\tlv.x -= AIR_ACCEL*step\n\t\telif (move_right and not move_left):\n\t\t\tif (lv.x < WALK_MAX_VELOCITY):\n\t\t\t\tlv.x += AIR_ACCEL*step\n\t\telse:\n\t\t\tvar xv = abs(lv.x)\n\t\t\txv -= AIR_DEACCEL*step\n\t\t\tif (xv < 0):\n\t\t\t\txv = 0\n\t\t\tlv.x = sign(lv.x)*xv\n\t\t\n\t\tif (lv.y < 0):\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"jumping_weapon\"\n\t\t\telse:\n\t\t\t\tnew_anim = \"jumping\"\n\t\telse:\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"falling_weapon\"\n\t\t\t\n\t\t\telse:\n\t\t\t\tnew_anim = \"falling\"\n\t\n\t# Update siding\n\tif (new_siding_left != siding_left):\n\t\tif (new_siding_left):\n\t\t\tget_node(\"sprite\").set_scale(Vector2(-1, 1))\n\t\telse:\n\t\t\tget_node(\"sprite\").set_scale(Vector2(1, 1))\n\t\t\n\t\tsiding_left = new_siding_left\n\t\n\t# Change animation\n\tif (new_anim != anim):\n\t\tanim = new_anim\n\t\tget_node(\"anim\").play(anim)\n\t\n\tshooting = shoot\n\t\n\t# Apply floor velocity\n\tif (found_floor):\n\t\tfloor_h_velocity = s.get_contact_collider_velocity_at_pos(floor_index).x\n\t\tlv.x += floor_h_velocity\n\t\n\t# Finally, apply gravity and set back the linear velocity\n\tlv += s.get_total_gravity()*step\n\ts.set_linear_velocity(lv)\n\n\nfunc _ready():\n\tenemy = ResourceLoader.load(\"res:\/\/scenes\/scn3-forest\/enemy.tscn\")\n\n\n#\tif !Globals.has_singleton(\"Facebook\"):\n#\t\treturn\n#\tvar Facebook = Globals.get_singleton(\"Facebook\")\n#\tvar link = Globals.get(\"facebook\/link\")\n#\tvar icon = Globals.get(\"facebook\/icon\")\n#\tvar msg = \"I just sneezed on your wall! Beat my score and Stop the Running nose!\"\n#\tvar title = \"I just sneezed on your wall!\"\n#\tFacebook.post(\"feed\", msg, title, link, icon)\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"GDScript"} {"commit":"1d0a274bd9ba4560ea7419128a7406e4ee2eb4c7","subject":"BLOCK -> PUZZLE for clarity","message":"BLOCK -> PUZZLE for clarity\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Network.gd","new_file":"src\/scripts\/Network.gd","new_contents":"# Core networking\n\nextends Node\n\nconst REMOTE_FINISH = 0\nconst REMOTE_START = 1\nconst REMOTE_QUIT = 2\nconst REMOTE_BLOCK = 4\nconst REMOTE_PUZZLE_TRANSFORM = 5\nconst REMOTE_BLOCK_UPDATE = 6\n\nvar port = 54321\nvar root\nvar isNetwork\nvar isHost\nvar isClient = false\nvar server\nvar client\nvar connection\nvar proxy\n\nvar thisPuzzle\n\n#Store the peer stream used by both the lcient and server\nvar stream\n\nfunc _ready():\n\tprint( \"Making network.\" )\n\tisNetwork = false\n\tisHost = false\n\tvar label = get_tree().get_root().get_node(\"GUIManager\/OptionsMenu\/Panel\/PortField\/LineEdit\")\n\tif not label == null:\n\t\tlabel.set_text(str(port))\n\nfunc setPort(pt):\n\tport = pt;\n\nfunc connectTo(ip, pt):\n\tisClient = true #just to tell if it's doing something :S\n\tconnection = PacketPeerStream.new()\n\tstream = StreamPeerTCP.new()\n\tconnection.set_stream_peer(stream)\n\tstream.connect(ip, pt);\n\n\tif stream.get_status() == stream.STATUS_CONNECTED or stream.get_status() == stream.STATUS_CONNECTING:\n\t\tprint(\"Connecting to \" + ip + \":\" + str(port));\n\t\tproxy.set_process(true)\n\t\t#leave is_network as false to indicate we're still waiting for connection\n\n\nfunc host(pt):\n\tserver = TCP_Server.new()\n\t#connection = PacketPeerStream.new()\n\tisHost = true\n\tprint(\"Starting listening server on port \" + str(pt))\n\tif server.listen(pt) == 0:\n\t\tproxy.set_process(true)\n\t\tprint(\"Listening...\")\n\telse:\n\t\tprint(\"Failed to start server on port \" + str(pt));\n\nfunc _process(delta):\n\tif (isHost):\n\t\t#server processing stuff\n\t\t#use isNetwork to determine if we're still listening\n\t\tif !isNetwork:\n\t\t\tif server.is_connection_available():\n\t\t\t\tstream = server.take_connection()\n\t\t\t\tconnection = PacketPeerStream.new()\n\t\t\t\tconnection.set_stream_peer(stream)\n\t\t\t\tprint(\"Connecting with player...\")\n\t\t\t\tisNetwork = true\n\t\t\t\tserver.stop()\n\n\t\t\t\tgotoPuzzle()\n\n\t\t\t\tthisPuzzle = root.get_node(\"Puzzle\")\n\t\t\t\t#MAKE CALL TO PUZZLE SELECTER\n\t\telse: #not listening anymore, have a client\n\t\t\t#do quick check to make sure we're still\n\t\t\t#connected\n\t\t\tif !stream.is_connected():\n\t\t\t\tprint(\"Lost Connection!\");\n\t\t\t\tisNetwork = false\n\t\t\t\tproxy.set_process(false)\n\t\t\t\t#QUIT GAME\n\t\t\t\treturn\n\t\t\t#check if we have any data\n\t\t\tif connection.get_available_packet_count() > 0:\n\t\t\t\t#have to be careful about more than 1 packet per frame\n\t\t\t\tfor i in range(connection.get_available_packet_count()):\n\t\t\t\t\tvar dataArray = connection.get_var()\n\t\t\t\t\tProcessServerData(dataArray)\n\n\telse:\n\t\t#client processing stuff\n\t\tif !isNetwork:\n\t\t\t#Still waiting for connection confirmed\n\t\t\tif stream.get_status() == stream.STATUS_CONNECTED:\n\t\t\t\tprint(\"Connection established!\")\n\t\t\t\tisNetwork = true\n\n\t\t\t\tgotoPuzzle()\n\n\t\t\t\tthisPuzzle = root.get_node(\"Puzzle\")\n\t\t\t\treturn\n\t\t\tif stream.get_status() == stream.STATUS_NONE or stream.get_status() == stream.STATUS_ERROR:\n\t\t\t\tprint(\"Error establishing connection!\")\n\t\t\t\tproxy.set_process(false)\n\t\t\t\treturn\n\t\t\t\t#stop running process loop, cause we have no connection\n\t\telse:\n\t\t\t#connecton established and confirmed. Do regular data processing\n\t\t\t#check if we have any data\n\t\t\tif connection.get_available_packet_count() > 0:\n\t\t\t\tfor i in range(connection.get_available_packet_count()):\n\t\t\t\t\tvar dataArray = connection.get_var()\n\t\t\t\t\tProcessServerData(dataArray)\n\t\t\t\t\t#Call the server process script cuase it's peer to peer and we have the same functions!\n\n\nfunc disconnect():\n\t#need to do lots of things! If the server is open and listening, but has no connection just stop listening!\n\tif isHost and !isNetwork:\n\t\t#this means we're waiting for connection still\n\t\tserver.stop()\n\t\tprint(\"closing server listener!\")\n\telif isHost and isNetwork:\n\t\t#have connections. Need to send them stop packet, and close connection\n\t\tconnection.put_var([REMOTE_QUIT])\n\t\tstream.disconnect()\n\t\tprint(\"Closing connection to remote player...\")\n\t\tgotoMenu()\n\telif !isHost and !isNetwork:\n\t\tstream.disconnect()\n\t\tprint(\"Halting connection request...\")\n\telif !isHost and isNetwork:\n\t\t#connected to server already\n\t\tstream.disconnect()\n\t\tprint(\"Disconnecting from server...\")\n\t\tgotoMenu()\n\n\t#no matter where we wre before disconnect, set network to false and return to beginning screen!\n\tisNetwork = false;\n\tisHost = false;\n\tisClient = false;\n\n\tproxy.set_process(false)\n\n\n\nfunc ProcessServerData(dataArray):\n\t#have an array of data. First element should be identifying int\n\tvar ID = dataArray[0]\n\tvar puzzle = root.get_node( \"Puzzle\" )\n\tvar gridMan = puzzle.otherPuzzle.get_node(\"GridView\/GridMan\")\n\t#no switch statement. I'm crying right now while i type this. My fingers are bleeding\n\tif ID == REMOTE_START:\n\t\t#read other person's puzzle\n\t\tprint(\"remote_stuff\")\n\t\tgridMan.set_puzzle(dataArray[1])\n\telif ID == REMOTE_FINISH:\n\t\t#again, do ending stuff\n\t\tprint(\"remote_finish: \" + str(dataArray[1]))\n\t\tgridMan.beatenWithScore(dataArray[1])\n\telif ID == REMOTE_QUIT:\n\t\t#omg those jerks!\n\t\tprint(\"remote_quit\")\n\t\tdisconnect()\n\telif ID == REMOTE_BLOCK:\n\t\t#get their block ifnormation!\n\t\tprint(\"remote_block\")\n\telif ID == REMOTE_PUZZLE_TRANSFORM:\n\t\t#sent block information\n\t\t#var scale = dataArray[1]\n\t\tvar translation = dataArray[1]\n\t\tthisPuzzle.otherPuzzle.set_transform(Transform( translation ))\n# better measurements!!!!\t\tthisPuzzle.otherPuzzle.set_translation(Vector3(20, 12, -40))\n##############3\n\t\tvar otherPosition = Vector3(20,0,10)\n\t\tvar tween = Tween.new()\n\t\ttween.interpolate_method(thisPuzzle.otherPuzzle, \"set_translation\", \\\n\t\tthisPuzzle.otherPuzzle.get_translation(), otherPosition, \\\n\t\t0.5, Tween.TRANS_SINE, Tween.EASE_OUT )\n\n\telif ID == REMOTE_BLOCK_UPDATE:\n\t\t#sent an updated block pair\n\t\tprint(\"block update\")\n\t\tgridMan.forceClickBlock(dataArray[1])\n\nfunc sendStart(puzzle):\n\tif !isNetwork:\n\t\tprint(\"Error sending start packet: not connected!\")\n\t\treturn\n\tvar er = connection.put_var([REMOTE_START, puzzle])\n\nfunc sendBlockUpdate(pos):\n\tif !isNetwork:\n\t\tprint(\"Error sending start packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_BLOCK_UPDATE, pos])\n\nfunc sendFinish(score):\n\tif !isNetwork:\n\t\tprint(\"Error sending finish packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_FINISH, root.get_node(\"Puzzle\").time.val])\n\nfunc sendQuit():\n\tif !isNetwork:\n\t\tprint(\"Error sending finish packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_QUIT])\n\nfunc sendTransform(translation):\n\tif !isNetwork:\n\t\tprint(\"Cannot send transformation over an unitialized network!\")\n\t\treturn\n\tconnection.put_var([REMOTE_PUZZLE_TRANSFORM, translation])\n\n\nfunc gotoMenu():\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\troot.add_child( load(\"res:\/\/menus.scn\") )\n\nfunc gotoPuzzle():\n\tvar guiMan = preload(\"GUIManager.gd\").new()\n\tguiMan.gotoPuzzleScene(root, true) # network = true\n","old_contents":"# Core networking\n\nextends Node\n\nconst REMOTE_FINISH = 0\nconst REMOTE_START = 1\nconst REMOTE_QUIT = 2\nconst REMOTE_BLOCK = 4\nconst REMOTE_PUZZLE_TRANSFORM = 5\nconst REMOTE_BLOCK_UPDATE = 6\n\nvar port = 54321\nvar root\nvar isNetwork\nvar isHost\nvar isClient = false\nvar server\nvar client\nvar connection\nvar proxy\n\nvar thisPuzzle\n\n#Store the peer stream used by both the lcient and server\nvar stream\n\nfunc _ready():\n\tprint( \"Making network.\" )\n\tisNetwork = false\n\tisHost = false\n\tvar label = get_tree().get_root().get_node(\"GUIManager\/OptionsMenu\/Panel\/PortField\/LineEdit\")\n\tif not label == null:\n\t\tlabel.set_text(str(port))\n\nfunc setPort(pt):\n\tport = pt;\n\nfunc connectTo(ip, pt):\n\tisClient = true #just to tell if it's doing something :S\n\tconnection = PacketPeerStream.new()\n\tstream = StreamPeerTCP.new()\n\tconnection.set_stream_peer(stream)\n\tstream.connect(ip, pt);\n\n\tif stream.get_status() == stream.STATUS_CONNECTED or stream.get_status() == stream.STATUS_CONNECTING:\n\t\tprint(\"Connecting to \" + ip + \":\" + str(port));\n\t\tproxy.set_process(true)\n\t\t#leave is_network as false to indicate we're still waiting for connection\n\n\nfunc host(pt):\n\tserver = TCP_Server.new()\n\t#connection = PacketPeerStream.new()\n\tisHost = true\n\tprint(\"Starting listening server on port \" + str(pt))\n\tif server.listen(pt) == 0:\n\t\tproxy.set_process(true)\n\t\tprint(\"Listening...\")\n\telse:\n\t\tprint(\"Failed to start server on port \" + str(pt));\n\nfunc _process(delta):\n\tif (isHost):\n\t\t#server processing stuff\n\t\t#use isNetwork to determine if we're still listening\n\t\tif !isNetwork:\n\t\t\tif server.is_connection_available():\n\t\t\t\tstream = server.take_connection()\n\t\t\t\tconnection = PacketPeerStream.new()\n\t\t\t\tconnection.set_stream_peer(stream)\n\t\t\t\tprint(\"Connecting with player...\")\n\t\t\t\tisNetwork = true\n\t\t\t\tserver.stop()\n\n\t\t\t\tgotoPuzzle()\n\n\t\t\t\tthisPuzzle = root.get_node(\"Puzzle\")\n\t\t\t\t#MAKE CALL TO PUZZLE SELECTER\n\t\telse: #not listening anymore, have a client\n\t\t\t#do quick check to make sure we're still\n\t\t\t#connected\n\t\t\tif !stream.is_connected():\n\t\t\t\tprint(\"Lost Connection!\");\n\t\t\t\tisNetwork = false\n\t\t\t\tproxy.set_process(false)\n\t\t\t\t#QUIT GAME\n\t\t\t\treturn\n\t\t\t#check if we have any data\n\t\t\tif connection.get_available_packet_count() > 0:\n\t\t\t\t#have to be careful about more than 1 packet per frame\n\t\t\t\tfor i in range(connection.get_available_packet_count()):\n\t\t\t\t\tvar dataArray = connection.get_var()\n\t\t\t\t\tProcessServerData(dataArray)\n\n\telse:\n\t\t#client processing stuff\n\t\tif !isNetwork:\n\t\t\t#Still waiting for connection confirmed\n\t\t\tif stream.get_status() == stream.STATUS_CONNECTED:\n\t\t\t\tprint(\"Connection established!\")\n\t\t\t\tisNetwork = true\n\n\t\t\t\tgotoPuzzle()\n\n\t\t\t\tthisPuzzle = root.get_node(\"Puzzle\")\n\t\t\t\treturn\n\t\t\tif stream.get_status() == stream.STATUS_NONE or stream.get_status() == stream.STATUS_ERROR:\n\t\t\t\tprint(\"Error establishing connection!\")\n\t\t\t\tproxy.set_process(false)\n\t\t\t\treturn\n\t\t\t\t#stop running process loop, cause we have no connection\n\t\telse:\n\t\t\t#connecton established and confirmed. Do regular data processing\n\t\t\t#check if we have any data\n\t\t\tif connection.get_available_packet_count() > 0:\n\t\t\t\tfor i in range(connection.get_available_packet_count()):\n\t\t\t\t\tvar dataArray = connection.get_var()\n\t\t\t\t\tProcessServerData(dataArray)\n\t\t\t\t\t#Call the server process script cuase it's peer to peer and we have the same functions!\n\n\nfunc disconnect():\n\t#need to do lots of things! If the server is open and listening, but has no connection just stop listening!\n\tif isHost and !isNetwork:\n\t\t#this means we're waiting for connection still\n\t\tserver.stop()\n\t\tprint(\"closing server listener!\")\n\telif isHost and isNetwork:\n\t\t#have connections. Need to send them stop packet, and close connection\n\t\tconnection.put_var([REMOTE_QUIT])\n\t\tstream.disconnect()\n\t\tprint(\"Closing connection to remote player...\")\n\t\tgotoMenu()\n\telif !isHost and !isNetwork:\n\t\tstream.disconnect()\n\t\tprint(\"Halting connection request...\")\n\telif !isHost and isNetwork:\n\t\t#connected to server already\n\t\tstream.disconnect()\n\t\tprint(\"Disconnecting from server...\")\n\t\tgotoMenu()\n\n\t#no matter where we wre before disconnect, set network to false and return to beginning screen!\n\tisNetwork = false;\n\tisHost = false;\n\tisClient = false;\n\n\tproxy.set_process(false)\n\n\n\nfunc ProcessServerData(dataArray):\n\t#have an array of data. First element should be identifying int\n\tvar ID = dataArray[0]\n\tvar puzzle = root.get_node( \"Puzzle\" )\n\tvar gridMan = puzzle.otherPuzzle.get_node(\"GridView\/GridMan\")\n\t#no switch statement. I'm crying right now while i type this. My fingers are bleeding\n\tif ID == REMOTE_START:\n\t\t#read other person's puzzle\n\t\tprint(\"remote_stuff\")\n\t\tgridMan.set_puzzle(dataArray[1])\n\telif ID == REMOTE_FINISH:\n\t\t#again, do ending stuff\n\t\tprint(\"remote_finish: \" + str(dataArray[1]))\n\t\tgridMan.beatenWithScore(dataArray[1])\n\telif ID == REMOTE_QUIT:\n\t\t#omg those jerks!\n\t\tprint(\"remote_quit\")\n\t\tdisconnect()\n\telif ID == REMOTE_BLOCK:\n\t\t#get their block ifnormation!\n\t\tprint(\"remote_block\")\n\telif ID == REMOTE_PUZZLE_TRANSFORM:\n\t\t#sent block information\n\t\t#var scale = dataArray[1]\n\t\tvar translation = dataArray[1]\n\t\tthisPuzzle.otherPuzzle.set_transform(Transform( translation ))\n# better measurements!!!!\t\tthisPuzzle.otherPuzzle.set_translation(Vector3(20, 12, -40))\n##############3\n\t\tvar otherPosition = Vector3(20,0,10)\n\t\tvar tween = Tween.new()\n\t\ttween.interpolate_method(thisPuzzle.otherPuzzle, \"set_translation\", \\\n\t\tthisPuzzle.otherPuzzle.get_translation(), otherPosition, \\\n\t\t0.5, Tween.TRANS_SINE, Tween.EASE_OUT )\n\n\telif ID == REMOTE_BLOCK_UPDATE:\n\t\t#sent an updated block pair\n\t\tprint(\"block update\")\n\t\tgridMan.forceClickBlock(dataArray[1])\n\nfunc sendStart(puzzle):\n\tif !isNetwork:\n\t\tprint(\"Error sending start packet: not connected!\")\n\t\treturn\n\tvar er = connection.put_var([REMOTE_START, puzzle])\n\nfunc sendBlockUpdate(pos):\n\tif !isNetwork:\n\t\tprint(\"Error sending start packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_BLOCK_UPDATE, pos])\n\nfunc sendFinish(score):\n\tif !isNetwork:\n\t\tprint(\"Error sending finish packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_FINISH, root.get_node(\"Puzzle\").time.val])\n\nfunc sendQuit():\n\tif !isNetwork:\n\t\tprint(\"Error sending finish packet: not connected!\")\n\t\treturn\n\tconnection.put_var([REMOTE_QUIT])\n\nfunc sendTransform(translation):\n\tif !isNetwork:\n\t\tprint(\"Cannot send transformation over an unitialized network!\")\n\t\treturn\n\tconnection.put_var([REMOTE_BLOCK_TRANSFORM, translation])\n\n\nfunc gotoMenu():\n\troot.get_child( root.get_child_count() - 1 ).queue_free()\n\troot.add_child( load(\"res:\/\/menus.scn\") )\n\nfunc gotoPuzzle():\n\tvar guiMan = preload(\"GUIManager.gd\").new()\n\tguiMan.gotoPuzzleScene(root, true) # network = true\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"15ec89ffe335970d60684fac35ba181a88f2aa1f","subject":"Small Fixes -=-=-=-=-=-","message":"Small Fixes\n-=-=-=-=-=-\n\n-Bug in navmesh demo fixed\n-Bug in variant\n-Better Collada Exporter supports proper names of exported shapekeys\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"3d\/navmesh\/navmesh.gd","new_file":"3d\/navmesh\/navmesh.gd","new_contents":"\nextends Navigation\n\n# member variables here, example:\n# var a=2\n# var b=\"textvar\"\n\nconst SPEED=4.0\n\nvar camrot=0.0\n\nvar begin=Vector3()\nvar end=Vector3()\nvar m = FixedMaterial.new()\n\nvar path=[]\n\nfunc _process(delta):\n\n\n\tif (path.size()>1):\n\t\n\t\tvar to_walk = delta*SPEED\n\t\tvar to_watch = Vector3(0,1,0)\n\t\twhile(to_walk>0 and path.size()>=2):\n\t\t\tvar pfrom = path[path.size()-1]\n\t\t\tvar pto = path[path.size()-2]\n\t\t\tto_watch = (pto - pfrom).normalized()\n\t\t\tvar d = pfrom.distance_to(pto)\n\t\t\tif (d<=to_walk):\n\t\t\t\tpath.remove(path.size()-1)\n\t\t\t\tto_walk-=d\n\t\t\telse:\n\t\t\t\tpath[path.size()-1] = pfrom.linear_interpolate(pto,to_walk\/d)\n\t\t\t\tto_walk=0\n\t\t\t\t\n\t\tvar atpos = path[path.size()-1]\n\t\tvar atdir = to_watch\n\t\tatdir.y=0\n\t\t\n\t\tvar t = Transform()\n\t\tt.origin=atpos\n\t\tt=t.looking_at(atpos+atdir,Vector3(0,1,0))\n\t\tget_node(\"robot_base\").set_transform(t)\n\t\t\n\t\tif (path.size()<2):\n\t\t\tpath=[]\n\t\t\tset_process(false)\n\t\t\t\t\n\telse:\n\t\tset_process(false)\n\nvar draw_path=false\n\nfunc _update_path():\n\n\tvar p = get_simple_path(begin,end,true)\n\tpath=Array(p) # Vector3array to complex to use, convert to regular array\n\tpath.invert()\n\tset_process(true)\n\n\tif (draw_path):\n\t\tvar im = get_node(\"draw\")\n\t\tim.set_material_override(m)\n\t\tim.clear()\n\t\tim.begin(Mesh.PRIMITIVE_POINTS,null)\n\t\tim.add_vertex(begin)\n\t\tim.add_vertex(end)\n\t\tim.end()\n\t\tim.begin(Mesh.PRIMITIVE_LINE_STRIP,null)\n\t\tfor x in p:\n\t\t\tim.add_vertex(x)\n\t\tim.end()\n\nfunc _input(ev):\n\n\tif (ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT and ev.pressed):\n \n\t\tvar from = get_node(\"cambase\/Camera\").project_ray_origin(ev.pos)\n\t\tvar to = from+get_node(\"cambase\/Camera\").project_ray_normal(ev.pos)*100\n\t\tvar p = get_closest_point_to_segment(from,to)\n\t\n\t\tbegin=get_closest_point(get_node(\"robot_base\").get_translation())\n\t\tend=p\n\n\t\t_update_path()\n\t\t\n\tif (ev.type==InputEvent.MOUSE_MOTION):\n\t\tif (ev.button_mask&BUTTON_MASK_MIDDLE):\n\t\t\t\n\t\t\tcamrot+=ev.relative_x*0.005\n\t\t\tget_node(\"cambase\").set_rotation(Vector3(0,camrot,0))\n\t\t\tprint(\"camrot \", camrot)\n\n\t\t\n\nfunc _ready():\n\t# Initalization here\n\tset_process_input(true)\n\tm.set_line_width(3)\n\tm.set_point_size(3)\n\tm.set_fixed_flag(FixedMaterial.FLAG_USE_POINT_SIZE,true)\n\tm.set_flag(Material.FLAG_UNSHADED,true)\n\t#begin = get_closest_point(get_node(\"start\").get_translation())\n\t#end = get_closest_point(get_node(\"end\").get_translation())\n\t#call_deferred(\"_update_path\")\n\n\tpass\n\n\n","old_contents":"\nextends Navigation\n\n# member variables here, example:\n# var a=2\n# var b=\"textvar\"\n\nconst SPEED=4.0\n\nvar camrot=0.0\n\nvar begin=Vector3()\nvar end=Vector3()\nvar m = FixedMaterial.new()\n\nvar path=[]\n\nfunc _process(delta):\n\n\n\tif (path.size()>1):\n\t\n\t\tvar to_walk = delta*SPEED\n\t\tvar to_watch = Vector3(0,1,0)\n\t\twhile(to_walk>0 and path.size()>=2):\n\t\t\tvar pfrom = path[path.size()-1]\n\t\t\tvar pto = path[path.size()-2]\n\t\t\tto_watch = (pto - pfrom).normalized()\n\t\t\tvar d = pfrom.distance_to(pto)\n\t\t\tif (d<=to_walk):\n\t\t\t\tpath.remove(path.size()-1)\n\t\t\t\tto_walk-=d\n\t\t\telse:\n\t\t\t\tpath[path.size()-1] = pfrom.linear_interpolate(pto,to_walk\/d)\n\t\t\t\tto_walk=0\n\t\t\t\t\n\t\tvar atpos = path[path.size()-1]\n\t\tvar atdir = to_watch\n\t\tatdir.y=0\n\t\t\n\t\tvar t = Transform()\n\t\tt.origin=atpos\n\t\tt=t.looking_at(atpos+atdir,Vector3(0,1,0))\n\t\tget_node(\"robot_base\").set_transform(t)\n\t\t\n\t\tif (path.size()<2):\n\t\t\tpath=[]\n\t\t\tset_process(false)\n\t\t\t\t\n\telse:\n\t\tset_process(false)\n\nvar draw_path=false\n\nfunc _update_path():\n\n\tvar p = get_simple_path(begin,end,true)\n\tpath=Array(p) # Vector3array to complex to use, convert to regular array\n\tpath.invert()\n\tset_process(true)\n\n\tif (draw_path):\n\t\tvar im = get_node(\"draw\")\n\t\tim.set_material_override(m)\n\t\tim.clear()\n\t\tim.begin(Mesh.PRIMITIVE_POINTS,null)\n\t\tim.add_vertex(begin)\n\t\tim.add_vertex(end)\n\t\tim.end()\n\t\tim.begin(Mesh.PRIMITIVE_LINE_STRIP,null)\n\t\tfor x in p:\n\t\t\tim.add_vertex(x)\n\t\tim.end()\n\nfunc _input(ev):\n\n\tif (ev.type==InputEvent.MOUSE_BUTTON and ev.button_index==BUTTON_LEFT and ev.pressed):\n \n\t\tvar from = get_node(\"cambase\/Camera\").project_position(ev.pos)\n\t\tvar to = from+get_node(\"cambase\/Camera\").project_ray_normal(ev.pos)*100\n\t\tvar p = get_closest_point_to_segment(from,to)\n\t\n\t\tbegin=get_closest_point(get_node(\"robot_base\").get_translation())\n\t\tend=p\n\n\t\t_update_path()\n\t\t\n\tif (ev.type==InputEvent.MOUSE_MOTION):\n\t\tif (ev.button_mask&BUTTON_MASK_MIDDLE):\n\t\t\t\n\t\t\tcamrot+=ev.relative_x*0.005\n\t\t\tget_node(\"cambase\").set_rotation(Vector3(0,camrot,0))\n\t\t\tprint(\"camrot \", camrot)\n\n\t\t\n\nfunc _ready():\n\t# Initalization here\n\tset_process_input(true)\n\tm.set_line_width(3)\n\tm.set_point_size(3)\n\tm.set_fixed_flag(FixedMaterial.FLAG_USE_POINT_SIZE,true)\n\tm.set_flag(Material.FLAG_UNSHADED,true)\n\t#begin = get_closest_point(get_node(\"start\").get_translation())\n\t#end = get_closest_point(get_node(\"end\").get_translation())\n\t#call_deferred(\"_update_path\")\n\n\tpass\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"b46a8233421ade84aff07cb0d6fde9e45c81a8a3","subject":"2d platformer gun cooldown fix (#686)","message":"2d platformer gun cooldown fix (#686)\n\nRestart cooldown timer when gun has fired","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"2d\/platformer\/src\/Actors\/Gun.gd","new_file":"2d\/platformer\/src\/Actors\/Gun.gd","new_contents":"class_name Gun\nextends Position2D\n# Represents a weapon that spawns and shoots bullets.\n# The Cooldown timer controls the cooldown duration between shots.\n\n\nconst BULLET_VELOCITY = 500.0\nconst Bullet = preload(\"res:\/\/src\/Objects\/Bullet.tscn\")\n\nonready var sound_shoot = $Shoot\nonready var timer = $Cooldown\n\n\n# This method is only called by Player.gd.\nfunc shoot(direction = 1):\n\tif not timer.is_stopped():\n\t\treturn false\n\tvar bullet = Bullet.instance()\n\tbullet.global_position = global_position\n\tbullet.linear_velocity = Vector2(direction * BULLET_VELOCITY, 0)\n\n\tbullet.set_as_toplevel(true)\n\tadd_child(bullet)\n\tsound_shoot.play()\n\ttimer.start()\n\treturn true\n","old_contents":"class_name Gun\nextends Position2D\n# Represents a weapon that spawns and shoots bullets.\n# The Cooldown timer controls the cooldown duration between shots.\n\n\nconst BULLET_VELOCITY = 500.0\nconst Bullet = preload(\"res:\/\/src\/Objects\/Bullet.tscn\")\n\nonready var sound_shoot = $Shoot\nonready var timer = $Cooldown\n\n\n# This method is only called by Player.gd.\nfunc shoot(direction = 1):\n\tif not timer.is_stopped():\n\t\treturn false\n\tvar bullet = Bullet.instance()\n\tbullet.global_position = global_position\n\tbullet.linear_velocity = Vector2(direction * BULLET_VELOCITY, 0)\n\n\tbullet.set_as_toplevel(true)\n\tadd_child(bullet)\n\tsound_shoot.play()\n\treturn true\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"073fa753760a7a7a4da7ad9c6993192b6e58b10f","subject":"Use get_current_scene() instead of hack","message":"Use get_current_scene() instead of hack\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"misc\/autoload\/global.gd","new_file":"misc\/autoload\/global.gd","new_contents":"extends Node\n\n# Member variables\nvar current_scene = null\n\n\nfunc goto_scene(path):\n\t# This function will usually be called from a signal callback,\n\t# or some other function from the running scene.\n\t# Deleting the current scene at this point might be\n\t# a bad idea, because it may be inside of a callback or function of it.\n\t# The worst case will be a crash or unexpected behavior.\n\t\n\t# The way around this is deferring the load to a later time, when\n\t# it is ensured that no code from the current scene is running:\n\t\n\tcall_deferred(\"_deferred_goto_scene\",path)\n\n\nfunc _deferred_goto_scene(path):\n\t# Immediately free the current scene,\n\t# there is no risk here.\n\tcurrent_scene.free()\n\t\n\t# Load new scene\n\tvar s = ResourceLoader.load(path)\n\t\n\t# Instance the new scene\n\tcurrent_scene = s.instance()\n\t\n\t# Add it to the active scene, as child of root\n\tget_tree().get_root().add_child(current_scene)\n\n\nfunc _ready():\n\t# Get the current scene at the time of initialization\n\tcurrent_scene = get_tree().get_current_scene()\n","old_contents":"extends Node\n\n# Member variables\nvar current_scene = null\n\n\nfunc goto_scene(path):\n\t# This function will usually be called from a signal callback,\n\t# or some other function from the running scene.\n\t# Deleting the current scene at this point might be\n\t# a bad idea, because it may be inside of a callback or function of it.\n\t# The worst case will be a crash or unexpected behavior.\n\t\n\t# The way around this is deferring the load to a later time, when\n\t# it is ensured that no code from the current scene is running:\n\t\n\tcall_deferred(\"_deferred_goto_scene\",path)\n\n\nfunc _deferred_goto_scene(path):\n\t# Immediately free the current scene,\n\t# there is no risk here.\n\tcurrent_scene.free()\n\t\n\t# Load new scene\n\tvar s = ResourceLoader.load(path)\n\t\n\t# Instance the new scene\n\tcurrent_scene = s.instance()\n\t\n\t# Add it to the active scene, as child of root\n\tget_tree().get_root().add_child(current_scene)\n\n\nfunc _ready():\n\t# Get the current scene, the first time.\n\t# It is always the last child of root,\n\t# after the autoloaded nodes.\n\t\n\tvar root = get_tree().get_root()\n\tcurrent_scene = root.get_child(root.get_child_count() - 1)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"4d21951b7197a3f2874b5435188e34c65f8a3bad","subject":"Fix hack to draw shapes in 3D physics tests","message":"Fix hack to draw shapes in 3D physics tests\n\nUsing Shape::get_debug_mesh instead of the previous hack to draw a mesh\ninstance based on a collision shape.\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"3d\/physics_tests\/test.gd","new_file":"3d\/physics_tests\/test.gd","new_contents":"class_name Test\nextends Node\n\n\nsignal wait_done()\n\nexport var _enable_debug_collision = true\n\nvar _timer\nvar _timer_started = false\n\nvar _wait_physics_ticks_counter = 0\n\nvar _drawn_nodes = []\n\n\nfunc _enter_tree():\n\tif not _enable_debug_collision:\n\t\tget_tree().debug_collisions_hint = false\n\n\nfunc _physics_process(_delta):\n\tif _wait_physics_ticks_counter > 0:\n\t\t_wait_physics_ticks_counter -= 1\n\t\tif _wait_physics_ticks_counter == 0:\n\t\t\temit_signal(\"wait_done\")\n\n\nfunc add_sphere(pos, radius, color):\n\tvar sphere = MeshInstance.new()\n\n\tvar sphere_mesh = SphereMesh.new()\n\tsphere_mesh.radius = radius\n\tsphere_mesh.height = radius * 2.0\n\tsphere.mesh = sphere_mesh\n\n\tvar material = SpatialMaterial.new()\n\tmaterial.flags_unshaded = true\n\tmaterial.albedo_color = color\n\tsphere.material_override = material\n\n\t_drawn_nodes.push_back(sphere)\n\tadd_child(sphere)\n\n\tsphere.global_transform.origin = pos\n\n\nfunc add_shape(shape, transform, color):\n\tvar debug_mesh = shape.get_debug_mesh()\n\n\tvar mesh_instance = MeshInstance.new()\n\tmesh_instance.transform = transform\n\tmesh_instance.mesh = debug_mesh\n\n\tvar material = SpatialMaterial.new()\n\tmaterial.flags_unshaded = true\n\tmaterial.albedo_color = color\n\tmesh_instance.material_override = material\n\n\tadd_child(mesh_instance)\n\t_drawn_nodes.push_back(mesh_instance)\n\n\nfunc clear_drawn_nodes():\n\tfor node in _drawn_nodes:\n\t\tremove_child(node)\n\t\tnode.queue_free()\n\t_drawn_nodes.clear()\n\n\nfunc create_rigidbody(shape, pickable = false, transform = Transform.IDENTITY):\n\tvar collision = CollisionShape.new()\n\tcollision.shape = shape\n\tcollision.transform = transform\n\n\tvar body = RigidBody.new()\n\tbody.add_child(collision)\n\n\tif pickable:\n\t\tvar script = load(\"res:\/\/utils\/rigidbody_pick.gd\")\n\t\tbody.set_script(script)\n\n\treturn body\n\n\nfunc create_rigidbody_box(size, pickable = false, transform = Transform.IDENTITY):\n\tvar shape = BoxShape.new()\n\tshape.extents = 0.5 * size\n\n\treturn create_rigidbody(shape, pickable, transform)\n\n\nfunc start_timer(timeout):\n\tif _timer == null:\n\t\t_timer = Timer.new()\n\t\t_timer.one_shot = true\n\t\tadd_child(_timer)\n\t\t_timer.connect(\"timeout\", self, \"_on_timer_done\")\n\telse:\n\t\tcancel_timer()\n\n\t_timer.start(timeout)\n\t_timer_started = true\n\n\treturn _timer\n\n\nfunc cancel_timer():\n\tif _timer_started:\n\t\t_timer.paused = true\n\t\t_timer.emit_signal(\"timeout\")\n\t\t_timer.paused = false\n\n\nfunc is_timer_canceled():\n\treturn _timer.paused\n\n\nfunc wait_for_physics_ticks(tick_count):\n\t_wait_physics_ticks_counter = tick_count\n\treturn self\n\n\nfunc _on_timer_done():\n\t_timer_started = false\n","old_contents":"class_name Test\nextends Node\n\n\nsignal wait_done()\n\nexport var _enable_debug_collision = true\n\nvar _timer\nvar _timer_started = false\n\nvar _wait_physics_ticks_counter = 0\n\nvar _drawn_nodes = []\n\n\nfunc _enter_tree():\n\tif not _enable_debug_collision:\n\t\tget_tree().debug_collisions_hint = false\n\n\nfunc _physics_process(_delta):\n\tif _wait_physics_ticks_counter > 0:\n\t\t_wait_physics_ticks_counter -= 1\n\t\tif _wait_physics_ticks_counter == 0:\n\t\t\temit_signal(\"wait_done\")\n\n\nfunc add_sphere(pos, radius, color):\n\tvar sphere = MeshInstance.new()\n\n\tvar sphere_mesh = SphereMesh.new()\n\tsphere_mesh.radius = radius\n\tsphere_mesh.height = radius * 2.0\n\tsphere.mesh = sphere_mesh\n\n\tvar material = SpatialMaterial.new()\n\tmaterial.flags_unshaded = true\n\tmaterial.albedo_color = color\n\tsphere.material_override = material\n\n\t_drawn_nodes.push_back(sphere)\n\tadd_child(sphere)\n\n\tsphere.global_transform.origin = pos\n\n\nfunc add_shape(shape, transform, color):\n\tvar body = StaticBody.new()\n\tbody.collision_layer = 0\n\tbody.collision_mask = 0\n\n\tvar collision = CollisionShape.new()\n\tcollision.transform = transform\n\tcollision.shape = shape\n\n\tbody.add_child(collision)\n\n\tadd_child(body)\n\t_drawn_nodes.push_back(body)\n\n\tcall_deferred(\"initialize_shape_material\", body, color)\n\n\nfunc initialize_shape_material(body, color):\n\tvar mesh_instance = body.get_child(1)\n\tvar material = SpatialMaterial.new()\n\tmaterial.flags_unshaded = true\n\tmaterial.albedo_color = color\n\tmesh_instance.material_override = material\n\n\nfunc clear_drawn_nodes():\n\tfor node in _drawn_nodes:\n\t\tremove_child(node)\n\t\tnode.queue_free()\n\t_drawn_nodes.clear()\n\n\nfunc create_rigidbody(shape, pickable = false, transform = Transform.IDENTITY):\n\tvar collision = CollisionShape.new()\n\tcollision.shape = shape\n\tcollision.transform = transform\n\n\tvar body = RigidBody.new()\n\tbody.add_child(collision)\n\n\tif pickable:\n\t\tvar script = load(\"res:\/\/utils\/rigidbody_pick.gd\")\n\t\tbody.set_script(script)\n\n\treturn body\n\n\nfunc create_rigidbody_box(size, pickable = false, transform = Transform.IDENTITY):\n\tvar shape = BoxShape.new()\n\tshape.extents = 0.5 * size\n\n\treturn create_rigidbody(shape, pickable, transform)\n\n\nfunc start_timer(timeout):\n\tif _timer == null:\n\t\t_timer = Timer.new()\n\t\t_timer.one_shot = true\n\t\tadd_child(_timer)\n\t\t_timer.connect(\"timeout\", self, \"_on_timer_done\")\n\telse:\n\t\tcancel_timer()\n\n\t_timer.start(timeout)\n\t_timer_started = true\n\n\treturn _timer\n\n\nfunc cancel_timer():\n\tif _timer_started:\n\t\t_timer.paused = true\n\t\t_timer.emit_signal(\"timeout\")\n\t\t_timer.paused = false\n\n\nfunc is_timer_canceled():\n\treturn _timer.paused\n\n\nfunc wait_for_physics_ticks(tick_count):\n\t_wait_physics_ticks_counter = tick_count\n\treturn self\n\n\nfunc _on_timer_done():\n\t_timer_started = false\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"589baedd151103c19fe7eef5cc43a74628682a5d","subject":"animation on block addition","message":"animation on block addition\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Editor.gd","new_file":"src\/scripts\/Editor.gd","new_contents":"extends Spatial\n\nvar puzzle\nvar puzzleMan\n\nvar gridMan\nvar prevBlock = [] # keeps track of prevous color for pairs by layer\nvar blockColors = preload(\"res:\/\/scripts\/PuzzleManager.gd\").blockColors\nvar id\n\nvar fd\nvar gui = [\n\t[\"status\", Label.new()], # plz keep me as first element, referenced as gui[0] later\n\t[\"save_pzl\", Button.new()],\n\t[\"load_pzl\", Button.new()],\n\t[\"remove_layer\", Button.new()],\n\t[\"random_layer\", Button.new()],\n\t# THESE SHOULD BE Options instead of left, label, right\n\t[\"class_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=[\"LZR\", \"WILD\", \"PAIR\", \"GOAL\"],\n\t\tvalue=\"PAIR\"\n\t}],\n\t[\"color_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=blockColors,\n\t\tvalue=\"Blue\"\n\t}],\n\t[\"action_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=[\"Add\", \"Remove\", \"Replace\"],\n\t\tvalue=\"Add\"\n\t}],\n\t[\"test_pzl\", Button.new()],\n]\nvar action_ix = gui.size() - 1 - 1\nvar color_ix = gui.size() - 1 - 2\nvar class_ix = gui.size() - 1 - 3\n\n# gross style, cannot , but clean enough\nfunc shouldAddNeighbor():\n\treturn gui[action_ix][1].value == \"Add\"\n\nfunc shouldReplaceSelf():\n\treturn gui[action_ix][1].value == \"Replace\"\n\nfunc shouldRemoveSelf():\n\treturn gui[action_ix][1].value == \"Remove\"\n\n# called in AbstractBlock to add a new block\nfunc addBlock(pos):\n\tvar curColor = gui[color_ix][1].value\n\tvar b = puzzleMan.PickledBlock.new() \\\n\t\t.setName(id) \\\n\t\t.setTextureName(curColor) \\\n\t\t.setBlockPos(pos)\n\tvar layer = puzzleMan.calcBlockLayerVec(pos)\n\tid += 1\n\n\t# expand prevblocks index\n\twhile prevBlock.size() <= layer:\n\t\tvar d = {}\n\t\tfor k in blockColors:\n\t\t\td[k] = null\n\t\tprevBlock.append(d)\n\n\tvar pb = prevBlock[layer][curColor]\n\n\tif pb != null:\n\t\tb.setPairName(pb.name)\n\t\tgridMan.get_node(pb.toNode().name).setPairName(b.name)\n\t\tprevBlock[layer][curColor] = null\n\telse:\n\t\t# TODO SUPPORT GLYPHS HERE, SET PAIRWISE GLYPH\n\t\tprevBlock[layer][curColor] = b\n\n\tgui[0][1].set_text(getPrevBlockErrors())\n\tvar block = gridMan.addPickledBlock(b)\n\tvar v = 0.01\n\tblock.set_scale(Vector3(v,v,v))\n\tblock.scaleTweenNode(1, 0.25, Tween.TRANS_QUART).start()\n\treturn b\n\nfunc getPrevBlockErrors():\n\t# hahaha, so bad\n\tvar missing = \"STATUS: \"\n\t# check every layer\n\tfor l in range(prevBlock.size()):\n\t\t# check every color\n\t\tfor k in prevBlock[l].keys():\n\t\t\tvar missed = false\n\t\t\tif prevBlock[l][k] != null:\n\t\t\t\t# one message about the current layer\n\t\t\t\tif not missed:\n\t\t\t\t\tmissing += \" L\" + str(l) + \" \"\n\t\t\t\t\tmissed = true\n\t\t\t\tmissing += k.to_upper() + \" \" # bad way of constructing strings\n\tif missing == \"\":\n\t\tmissing += \"NOMINAL\"\n\treturn missing\n\nfunc changeValue(ix, togg):\n\ttogg.value = togg.values[ix]\n\nfunc _ready():\n\t# lights!\n\tget_tree().get_root().add_child(preload( \"res:\/\/puzzleView.scn\" ).instance())\n\tpuzzle = preload( \"res:\/\/puzzle.scn\" ).instance()\n\tpuzzle.mainPuzzle = false\n\n\t# hide and disable timer\n\tpuzzle.time.on = false;\n\tpuzzle.time.val = ''\n\tprint(puzzle.time)\n\n\tpuzzle.set_as_toplevel(true)\n\tget_tree().get_root().add_child(puzzle)\n\n\tgridMan = puzzle.get_node(\"GridView\/GridMan\")\n\tid = gridMan.shape.size()\n\n\tpuzzleMan = puzzle.puzzleMan\n\n\tset_process_input(true)\n\n\tvar theme = preload(\"res:\/\/themes\/MainTheme.thm\")\n\tinitLoadSaveDialog(self)\n\n\tvar y = 0\n\tfor control in gui:\n\t\ty += 45\n\t\tif control[0].rfind('_toggle') > 0:\n\t\t\tvar togg = control[1]\n\t\t\tvar e = togg.optionButt\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tadd_child(e)\n\n\t\t\t# index of items needed\n\t\t\te.connect(\"item_selected\", self, \"changeValue\", [togg])\n\t\t\tfor i in range(togg.values.size()):\n\t\t\t\te.add_item(togg.values[i], i)\n\t\t\t\t# e.add_icon_item(togg.values[i], i)\n\n\t\telse:\n\t\t\tvar e = control[1]\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tif e extends Button:\n\t\t\t\te.set_text(control[0])\n\t\t\tif control[0] == 'save_pzl' :\n\t\t\t\te.connect('pressed', self, 'showSaveDialog')\n\t\t\tif control[0] == 'load_pzl' :\n\t\t\t\te.connect('pressed', self, 'showLoadDialog')\n\t\t\tif control[0] == 'status':\n\t\t\t\tcontrol[1].set_text('STATUS: NOMINAL')\n\t\t\tadd_child(e)\n\n\nfunc puzzleSave():\n\tprint(\"SAVING TO \", fd.get_current_file() )\n\nfunc puzzleLoad():\n\tprint(\"LOADING FROM \", fd.get_current_file() )\n\nfunc showLoadDialog():\n\tshowSaveDialog(true)\n\nfunc showSaveDialog(loadInstead=false):\n\tif loadInstead:\n\t\tif fd.is_connected(\"confirmed\", self, \"puzzleSave\"):\n\t\t\tfd.disconnect(\"confirmed\", self, \"puzzleSave\")\n\t\tfd.connect(\"confirmed\", self, \"puzzleLoad\")\n\t\tfd.set_mode(FileDialog.MODE_OPEN_FILE)\n\telse:\n\t\tif fd.is_connected(\"confirmed\", self, \"puzzleLoad\"):\n\t\t\tfd.disconnect(\"confirmed\", self, \"puzzleLoad\")\n\t\tfd.connect(\"confirmed\", self, \"puzzleSave\")\n\t\tfd.set_mode(FileDialog.MODE_SAVE_FILE)\n\n\tfd.popup_centered()\n\nfunc initLoadSaveDialog(parent):\n\t# setup text in the file dialog\n\tparent.fd = load(\"res:\/\/fileDialog.scn\").instance()\n\tparent.fd.set_title(\"Select Puzzle Filename\")\n\tparent.fd.set_access(FileDialog.ACCESS_USERDATA)\n\tparent.fd.set_current_dir(\"PuzzleSaves\")\n\tparent.fd.add_filter(\"*.pzl ; Anttris Puzzle\")\n\n\t# MainTheme leaks on bottom\n\tvar dialogTheme = Theme.new()\n\tdialogTheme.copy_default_theme()\n\tparent.fd.set_theme(dialogTheme)\n\n\t# work even if game is paused\n\tparent.fd.set_pause_mode(PAUSE_MODE_PROCESS)\n\n\t# unpause if user cancels\n\tparent.fd.connect(\"popup_hide\", get_tree(), \"set_pause\", [false])\n\tparent.fd.connect(\"hide\", get_tree(), \"set_pause\", [false])\n\tparent.fd.connect(\"about_to_show\", get_tree(), \"set_pause\", [true])\n\tparent.fd.hide()\n\n\tparent.add_child(fd)\n\tfd.set_owner(parent)\n","old_contents":"extends Spatial\n\nvar puzzle\nvar puzzleMan\n\nvar gridMan\nvar prevBlock = [] # keeps track of prevous color for pairs by layer\nvar blockColors = preload(\"res:\/\/scripts\/PuzzleManager.gd\").blockColors\nvar id\n\nvar fd\nvar gui = [\n\t[\"status\", Label.new()], # plz keep me as first element, referenced as gui[0] later\n\t[\"save_pzl\", Button.new()],\n\t[\"load_pzl\", Button.new()],\n\t[\"remove_layer\", Button.new()],\n\t[\"random_layer\", Button.new()],\n\t# THESE SHOULD BE Options instead of left, label, right\n\t[\"class_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=[\"LZR\", \"WILD\", \"PAIR\", \"GOAL\"],\n\t\tvalue=\"PAIR\"\n\t}],\n\t[\"color_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=blockColors,\n\t\tvalue=\"Blue\"\n\t}],\n\t[\"action_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=[\"Add\", \"Remove\", \"Replace\"],\n\t\tvalue=\"Add\"\n\t}],\n\t[\"test_pzl\", Button.new()],\n]\nvar action_ix = gui.size() - 1 - 1\nvar color_ix = gui.size() - 1 - 2\nvar class_ix = gui.size() - 1 - 3\n\n# gross style, cannot , but clean enough\nfunc shouldAddNeighbor():\n\treturn gui[action_ix][1].value == \"Add\"\n\nfunc shouldReplaceSelf():\n\treturn gui[action_ix][1].value == \"Replace\"\n\nfunc shouldRemoveSelf():\n\treturn gui[action_ix][1].value == \"Remove\"\n\n# called in AbstractBlock to add a new block\nfunc addBlock(pos):\n\tvar curColor = gui[color_ix][1].value\n\tvar b = puzzleMan.PickledBlock.new() \\\n\t\t.setName(id) \\\n\t\t.setTextureName(curColor) \\\n\t\t.setBlockPos(pos)\n\tvar layer = puzzleMan.calcBlockLayerVec(pos)\n\tid += 1\n\n\t# expand prevblocks index\n\twhile prevBlock.size() <= layer:\n\t\tvar d = {}\n\t\tfor k in blockColors:\n\t\t\td[k] = null\n\t\tprevBlock.append(d)\n\n\tvar pb = prevBlock[layer][curColor]\n\n\tif pb != null:\n\t\tb.setPairName(pb.name)\n\t\tgridMan.get_node(pb.toNode().name).setPairName(b.name)\n\t\tprevBlock[layer][curColor] = null\n\telse:\n\t\t# TODO SUPPORT GLYPHS HERE, SET PAIRWISE GLYPH\n\t\tprevBlock[layer][curColor] = b\n\n\tgui[0][1].set_text(getPrevBlockErrors())\n\tgridMan.addPickledBlock(b)\n\treturn b\n\nfunc getPrevBlockErrors():\n\t# hahaha, so bad\n\tvar missing = \"STATUS: \"\n\t# check every layer\n\tfor l in range(prevBlock.size()):\n\t\t# check every color\n\t\tfor k in prevBlock[l].keys():\n\t\t\tvar missed = false\n\t\t\tif prevBlock[l][k] != null:\n\t\t\t\t# one message about the current layer\n\t\t\t\tif not missed:\n\t\t\t\t\tmissing += \" L\" + str(l) + \" \"\n\t\t\t\t\tmissed = true\n\t\t\t\tmissing += k.to_upper() + \" \" # bad way of constructing strings\n\tif missing == \"\":\n\t\tmissing += \"NOMINAL\"\n\treturn missing\n\nfunc changeValue(ix, togg):\n\ttogg.value = togg.values[ix]\n\nfunc _ready():\n\t# lights!\n\tget_tree().get_root().add_child(preload( \"res:\/\/puzzleView.scn\" ).instance())\n\tpuzzle = preload( \"res:\/\/puzzle.scn\" ).instance()\n\tpuzzle.mainPuzzle = false\n\n\t# hide and disable timer\n\tpuzzle.time.on = false;\n\tpuzzle.time.val = ''\n\tprint(puzzle.time)\n\n\tpuzzle.set_as_toplevel(true)\n\tget_tree().get_root().add_child(puzzle)\n\n\tgridMan = puzzle.get_node(\"GridView\/GridMan\")\n\tid = gridMan.shape.size()\n\n\tpuzzleMan = puzzle.puzzleMan\n\n\tset_process_input(true)\n\n\tvar theme = preload(\"res:\/\/themes\/MainTheme.thm\")\n\tinitLoadSaveDialog(self)\n\n\tvar y = 0\n\tfor control in gui:\n\t\ty += 45\n\t\tif control[0].rfind('_toggle') > 0:\n\t\t\tvar togg = control[1]\n\t\t\tvar e = togg.optionButt\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tadd_child(e)\n\n\t\t\t# index of items needed\n\t\t\te.connect(\"item_selected\", self, \"changeValue\", [togg])\n\t\t\tfor i in range(togg.values.size()):\n\t\t\t\te.add_item(togg.values[i], i)\n\t\t\t\t# e.add_icon_item(togg.values[i], i)\n\n\t\telse:\n\t\t\tvar e = control[1]\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tif e extends Button:\n\t\t\t\te.set_text(control[0])\n\t\t\tif control[0] == 'save_pzl' :\n\t\t\t\te.connect('pressed', self, 'showSaveDialog')\n\t\t\tif control[0] == 'load_pzl' :\n\t\t\t\te.connect('pressed', self, 'showLoadDialog')\n\t\t\tif control[0] == 'status':\n\t\t\t\tcontrol[1].set_text('STATUS: NOMINAL')\n\t\t\tadd_child(e)\n\n\nfunc puzzleSave():\n\tprint(\"SAVING TO \", fd.get_current_file() )\n\nfunc puzzleLoad():\n\tprint(\"LOADING FROM \", fd.get_current_file() )\n\nfunc showLoadDialog():\n\tshowSaveDialog(true)\n\nfunc showSaveDialog(loadInstead=false):\n\tif loadInstead:\n\t\tif fd.is_connected(\"confirmed\", self, \"puzzleSave\"):\n\t\t\tfd.disconnect(\"confirmed\", self, \"puzzleSave\")\n\t\tfd.connect(\"confirmed\", self, \"puzzleLoad\")\n\t\tfd.set_mode(FileDialog.MODE_OPEN_FILE)\n\telse:\n\t\tif fd.is_connected(\"confirmed\", self, \"puzzleLoad\"):\n\t\t\tfd.disconnect(\"confirmed\", self, \"puzzleLoad\")\n\t\tfd.connect(\"confirmed\", self, \"puzzleSave\")\n\t\tfd.set_mode(FileDialog.MODE_SAVE_FILE)\n\n\tfd.popup_centered()\n\nfunc initLoadSaveDialog(parent):\n\t# setup text in the file dialog\n\tparent.fd = load(\"res:\/\/fileDialog.scn\").instance()\n\tparent.fd.set_title(\"Select Puzzle Filename\")\n\tparent.fd.set_access(FileDialog.ACCESS_USERDATA)\n\tparent.fd.set_current_dir(\"PuzzleSaves\")\n\tparent.fd.add_filter(\"*.pzl ; Anttris Puzzle\")\n\n\t# MainTheme leaks on bottom\n\tvar dialogTheme = Theme.new()\n\tdialogTheme.copy_default_theme()\n\tparent.fd.set_theme(dialogTheme)\n\n\t# work even if game is paused\n\tparent.fd.set_pause_mode(PAUSE_MODE_PROCESS)\n\n\t# unpause if user cancels\n\tparent.fd.connect(\"popup_hide\", get_tree(), \"set_pause\", [false])\n\tparent.fd.connect(\"hide\", get_tree(), \"set_pause\", [false])\n\tparent.fd.connect(\"about_to_show\", get_tree(), \"set_pause\", [true])\n\tparent.fd.hide()\n\n\tparent.add_child(fd)\n\tfd.set_owner(parent)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"1a36c3bb92f1ef82e8cca4cb09ac32d98bf53a17","subject":"Rotation APIs: Better exposure for degrees methods","message":"Rotation APIs: Better exposure for degrees methods\n\nMade public the various set\/getters for rotations in degrees.\nFor consistency, renamed the exposed method names to remove the leading\nunderscore, and kept the old names with a deprecation warning.\n\nFixes #4511.\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"misc\/tween\/main.gd","new_file":"misc\/tween\/main.gd","new_contents":"\nextends Control\n\n# Member variables\nvar trans = [\"linear\", \"sine\", \"quint\", \"quart\", \"quad\", \"expo\", \"elastic\", \"cubic\", \"circ\", \"bounce\", \"back\"]\nvar eases = [\"in\", \"out\", \"in_out\", \"out_in\"]\nvar modes = [\"move\", \"color\", \"scale\", \"rotate\", \"callback\", \"follow\", \"repeat\", \"pause\"]\n\nvar state = {\n\ttrans = Tween.TRANS_LINEAR,\n\teases = Tween.EASE_IN,\n}\n\n\nfunc _ready():\n\tfor index in range(trans.size()):\n\t\tvar name = trans[index]\n\t\tget_node(\"trans\/\" + name).connect(\"pressed\", self, \"on_trans_changed\", [name, index])\n\t\n\tfor index in range(eases.size()):\n\t\tvar name = eases[index]\n\t\tget_node(\"eases\/\" + name).connect(\"pressed\", self, \"on_eases_changed\", [name, index])\n\t\n\tfor index in range(modes.size()):\n\t\tvar name = modes[index]\n\t\tget_node(\"modes\/\" + name).connect(\"pressed\", self, \"on_modes_changed\", [name])\n\t\n\tget_node(\"color\/color_from\").set_color(Color(1, 0, 0, 1))\n\tget_node(\"color\/color_from\").connect(\"color_changed\", self, \"on_color_changed\")\n\t\n\tget_node(\"color\/color_to\").set_color(Color(0, 1, 1, 1))\n\tget_node(\"color\/color_to\").connect(\"color_changed\", self, \"on_color_changed\")\n\t\n\tget_node(\"trans\/linear\").set_pressed(true)\n\tget_node(\"eases\/in\").set_pressed(true)\n\tget_node(\"modes\/move\").set_pressed(true)\n\tget_node(\"modes\/repeat\").set_pressed(true)\n\t\n\treset_tween()\n\n\nfunc on_trans_changed(name, index):\n\tfor index in range(trans.size()):\n\t\tvar pressed = trans[index] == name\n\t\tvar btn = get_node(\"trans\/\" + trans[index])\n\t\t\n\t\tbtn.set_pressed(pressed)\n\t\tbtn.set_ignore_mouse(pressed)\n\t\n\tstate.trans = index\n\treset_tween()\n\n\nfunc on_eases_changed(name, index):\n\tfor index in range(eases.size()):\n\t\tvar pressed = eases[index] == name\n\t\tvar btn = get_node(\"eases\/\" + eases[index])\n\t\t\n\t\tbtn.set_pressed(pressed)\n\t\tbtn.set_ignore_mouse(pressed)\n\t\n\tstate.eases = index\n\treset_tween()\n\n\nfunc on_modes_changed(name):\n\tvar tween = get_node(\"tween\")\n\tif name == \"pause\":\n\t\tif get_node(\"modes\/pause\").is_pressed():\n\t\t\ttween.stop_all()\n\t\t\tget_node(\"timeline\").set_ignore_mouse(false)\n\t\telse:\n\t\t\ttween.resume_all()\n\t\t\tget_node(\"timeline\").set_ignore_mouse(true)\n\telse:\n\t\treset_tween()\n\n\nfunc on_color_changed(color):\n\treset_tween()\n\n\nfunc reset_tween():\n\tvar tween = get_node(\"tween\")\n\tvar pos = tween.tell()\n\ttween.reset_all()\n\ttween.remove_all()\n\t\n\tvar sprite = get_node(\"tween\/area\/sprite\")\n\tvar follow = get_node(\"tween\/area\/follow\")\n\tvar follow_2 = get_node(\"tween\/area\/follow_2\")\n\tvar size = get_node(\"tween\/area\").get_size()\n\n\tif get_node(\"modes\/move\").is_pressed():\n\t\ttween.interpolate_method(sprite, \"set_pos\", Vector2(0, 0), Vector2(size.width, size.height), 2, state.trans, state.eases)\n\t\ttween.interpolate_property(sprite, \"transform\/pos\", Vector2(size.width, size.height), Vector2(0, 0), 2, state.trans, state.eases, 2)\n\t\n\tif get_node(\"modes\/color\").is_pressed():\n\t\ttween.interpolate_method(sprite, \"set_modulate\", get_node(\"color\/color_from\").get_color(), get_node(\"color\/color_to\").get_color(), 2, state.trans, state.eases)\n\t\ttween.interpolate_property(sprite, \"modulate\", get_node(\"color\/color_to\").get_color(), get_node(\"color\/color_from\").get_color(), 2, state.trans, state.eases, 2)\n\telse:\n\t\tsprite.set_modulate(Color(1,1,1,1))\n\t\n\tif get_node(\"modes\/scale\").is_pressed():\n\t\ttween.interpolate_method(sprite, \"set_scale\", Vector2(0.5, 0.5), Vector2(1.5, 1.5), 2, state.trans, state.eases)\n\t\ttween.interpolate_property(sprite, \"transform\/scale\", Vector2(1.5, 1.5), Vector2(0.5, 0.5), 2, state.trans, state.eases, 2)\n\telse:\n\t\tsprite.set_scale(Vector2(1,1))\n\t\n\tif get_node(\"modes\/rotate\").is_pressed():\n\t\ttween.interpolate_method(sprite, \"set_rotd\", 0, 360, 2, state.trans, state.eases)\n\t\ttween.interpolate_property(sprite, \"transform\/rot\", 360, 0, 2, state.trans, state.eases, 2)\n\t\n\tif get_node(\"modes\/callback\").is_pressed():\n\t\ttween.interpolate_callback(self, 0.5, \"on_callback\", \"0.5 second's after\")\n\t\ttween.interpolate_callback(self, 0.2, \"on_callback\", \"1.2 second's after\")\n\t\n\tif get_node(\"modes\/follow\").is_pressed():\n\t\tfollow.show()\n\t\tfollow_2.show()\n\t\t\n\t\ttween.follow_method(follow, \"set_pos\", Vector2(0, size.height), sprite, \"get_pos\", 2, state.trans, state.eases)\n\t\ttween.targeting_method(follow, \"set_pos\", sprite, \"get_pos\", Vector2(0, size.height), 2, state.trans, state.eases, 2)\n\t\t\n\t\ttween.targeting_property(follow_2, \"transform\/pos\", sprite, \"transform\/pos\", Vector2(size.width, 0), 2, state.trans, state.eases)\n\t\ttween.follow_property(follow_2, \"transform\/pos\", Vector2(size.width, 0), sprite, \"transform\/pos\", 2, state.trans, state.eases, 2)\n\telse:\n\t\tfollow.hide()\n\t\tfollow_2.hide()\n\t\n\ttween.set_repeat(get_node(\"modes\/repeat\").is_pressed())\n\ttween.start()\n\ttween.seek(pos)\n\t\n\tif get_node(\"modes\/pause\").is_pressed():\n\t\ttween.stop_all()\n\t\tget_node(\"timeline\").set_ignore_mouse(false)\n\t\tget_node(\"timeline\").set_value(0)\n\telse:\n\t\ttween.resume_all()\n\t\tget_node(\"timeline\").set_ignore_mouse(true)\n\n\nfunc _on_tween_step(object, key, elapsed, value):\n\tvar timeline = get_node(\"timeline\")\n\t\n\tvar tween = get_node(\"tween\")\n\tvar runtime = tween.get_runtime()\n\t\n\tvar ratio = 100*(elapsed\/runtime)\n\ttimeline.set_value(ratio)\n\n\nfunc _on_timeline_value_changed(value):\n\tif !get_node(\"modes\/pause\").is_pressed():\n\t\treturn\n\t\n\tvar tween = get_node(\"tween\")\n\tvar runtime = tween.get_runtime()\n\ttween.seek(runtime*value\/100)\n\n\nfunc on_callback(arg):\n\tvar label = get_node(\"tween\/area\/label\")\n\tlabel.add_text(\"on_callback -> \" + arg + \"\\n\")\n","old_contents":"\nextends Control\n\n# Member variables\nvar trans = [\"linear\", \"sine\", \"quint\", \"quart\", \"quad\", \"expo\", \"elastic\", \"cubic\", \"circ\", \"bounce\", \"back\"]\nvar eases = [\"in\", \"out\", \"in_out\", \"out_in\"]\nvar modes = [\"move\", \"color\", \"scale\", \"rotate\", \"callback\", \"follow\", \"repeat\", \"pause\"]\n\nvar state = {\n\ttrans = Tween.TRANS_LINEAR,\n\teases = Tween.EASE_IN,\n}\n\n\nfunc _ready():\n\tfor index in range(trans.size()):\n\t\tvar name = trans[index]\n\t\tget_node(\"trans\/\" + name).connect(\"pressed\", self, \"on_trans_changed\", [name, index])\n\t\n\tfor index in range(eases.size()):\n\t\tvar name = eases[index]\n\t\tget_node(\"eases\/\" + name).connect(\"pressed\", self, \"on_eases_changed\", [name, index])\n\t\n\tfor index in range(modes.size()):\n\t\tvar name = modes[index]\n\t\tget_node(\"modes\/\" + name).connect(\"pressed\", self, \"on_modes_changed\", [name])\n\t\n\tget_node(\"color\/color_from\").set_color(Color(1, 0, 0, 1))\n\tget_node(\"color\/color_from\").connect(\"color_changed\", self, \"on_color_changed\")\n\t\n\tget_node(\"color\/color_to\").set_color(Color(0, 1, 1, 1))\n\tget_node(\"color\/color_to\").connect(\"color_changed\", self, \"on_color_changed\")\n\t\n\tget_node(\"trans\/linear\").set_pressed(true)\n\tget_node(\"eases\/in\").set_pressed(true)\n\tget_node(\"modes\/move\").set_pressed(true)\n\tget_node(\"modes\/repeat\").set_pressed(true)\n\t\n\treset_tween()\n\n\nfunc on_trans_changed(name, index):\n\tfor index in range(trans.size()):\n\t\tvar pressed = trans[index] == name\n\t\tvar btn = get_node(\"trans\/\" + trans[index])\n\t\t\n\t\tbtn.set_pressed(pressed)\n\t\tbtn.set_ignore_mouse(pressed)\n\t\n\tstate.trans = index\n\treset_tween()\n\n\nfunc on_eases_changed(name, index):\n\tfor index in range(eases.size()):\n\t\tvar pressed = eases[index] == name\n\t\tvar btn = get_node(\"eases\/\" + eases[index])\n\t\t\n\t\tbtn.set_pressed(pressed)\n\t\tbtn.set_ignore_mouse(pressed)\n\t\n\tstate.eases = index\n\treset_tween()\n\n\nfunc on_modes_changed(name):\n\tvar tween = get_node(\"tween\")\n\tif name == \"pause\":\n\t\tif get_node(\"modes\/pause\").is_pressed():\n\t\t\ttween.stop_all()\n\t\t\tget_node(\"timeline\").set_ignore_mouse(false)\n\t\telse:\n\t\t\ttween.resume_all()\n\t\t\tget_node(\"timeline\").set_ignore_mouse(true)\n\telse:\n\t\treset_tween()\n\n\nfunc on_color_changed(color):\n\treset_tween()\n\n\nfunc reset_tween():\n\tvar tween = get_node(\"tween\")\n\tvar pos = tween.tell()\n\ttween.reset_all()\n\ttween.remove_all()\n\t\n\tvar sprite = get_node(\"tween\/area\/sprite\")\n\tvar follow = get_node(\"tween\/area\/follow\")\n\tvar follow_2 = get_node(\"tween\/area\/follow_2\")\n\tvar size = get_node(\"tween\/area\").get_size()\n\n\tif get_node(\"modes\/move\").is_pressed():\n\t\ttween.interpolate_method(sprite, \"set_pos\", Vector2(0, 0), Vector2(size.width, size.height), 2, state.trans, state.eases)\n\t\ttween.interpolate_property(sprite, \"transform\/pos\", Vector2(size.width, size.height), Vector2(0, 0), 2, state.trans, state.eases, 2)\n\t\n\tif get_node(\"modes\/color\").is_pressed():\n\t\ttween.interpolate_method(sprite, \"set_modulate\", get_node(\"color\/color_from\").get_color(), get_node(\"color\/color_to\").get_color(), 2, state.trans, state.eases)\n\t\ttween.interpolate_property(sprite, \"modulate\", get_node(\"color\/color_to\").get_color(), get_node(\"color\/color_from\").get_color(), 2, state.trans, state.eases, 2)\n\telse:\n\t\tsprite.set_modulate(Color(1,1,1,1))\n\t\n\tif get_node(\"modes\/scale\").is_pressed():\n\t\ttween.interpolate_method(sprite, \"set_scale\", Vector2(0.5, 0.5), Vector2(1.5, 1.5), 2, state.trans, state.eases)\n\t\ttween.interpolate_property(sprite, \"transform\/scale\", Vector2(1.5, 1.5), Vector2(0.5, 0.5), 2, state.trans, state.eases, 2)\n\telse:\n\t\tsprite.set_scale(Vector2(1,1))\n\t\n\tif get_node(\"modes\/rotate\").is_pressed():\n\t\ttween.interpolate_method(sprite, \"_set_rotd\", 0, 360, 2, state.trans, state.eases)\n\t\ttween.interpolate_property(sprite, \"transform\/rot\", 360, 0, 2, state.trans, state.eases, 2)\n\t\n\tif get_node(\"modes\/callback\").is_pressed():\n\t\ttween.interpolate_callback(self, 0.5, \"on_callback\", \"0.5 second's after\")\n\t\ttween.interpolate_callback(self, 0.2, \"on_callback\", \"1.2 second's after\")\n\t\n\tif get_node(\"modes\/follow\").is_pressed():\n\t\tfollow.show()\n\t\tfollow_2.show()\n\t\t\n\t\ttween.follow_method(follow, \"set_pos\", Vector2(0, size.height), sprite, \"get_pos\", 2, state.trans, state.eases)\n\t\ttween.targeting_method(follow, \"set_pos\", sprite, \"get_pos\", Vector2(0, size.height), 2, state.trans, state.eases, 2)\n\t\t\n\t\ttween.targeting_property(follow_2, \"transform\/pos\", sprite, \"transform\/pos\", Vector2(size.width, 0), 2, state.trans, state.eases)\n\t\ttween.follow_property(follow_2, \"transform\/pos\", Vector2(size.width, 0), sprite, \"transform\/pos\", 2, state.trans, state.eases, 2)\n\telse:\n\t\tfollow.hide()\n\t\tfollow_2.hide()\n\t\n\ttween.set_repeat(get_node(\"modes\/repeat\").is_pressed())\n\ttween.start()\n\ttween.seek(pos)\n\t\n\tif get_node(\"modes\/pause\").is_pressed():\n\t\ttween.stop_all()\n\t\tget_node(\"timeline\").set_ignore_mouse(false)\n\t\tget_node(\"timeline\").set_value(0)\n\telse:\n\t\ttween.resume_all()\n\t\tget_node(\"timeline\").set_ignore_mouse(true)\n\n\nfunc _on_tween_step(object, key, elapsed, value):\n\tvar timeline = get_node(\"timeline\")\n\t\n\tvar tween = get_node(\"tween\")\n\tvar runtime = tween.get_runtime()\n\t\n\tvar ratio = 100*(elapsed\/runtime)\n\ttimeline.set_value(ratio)\n\n\nfunc _on_timeline_value_changed(value):\n\tif !get_node(\"modes\/pause\").is_pressed():\n\t\treturn\n\t\n\tvar tween = get_node(\"tween\")\n\tvar runtime = tween.get_runtime()\n\ttween.seek(runtime*value\/100)\n\n\nfunc on_callback(arg):\n\tvar label = get_node(\"tween\/area\/label\")\n\tlabel.add_text(\"on_callback -> \" + arg + \"\\n\")\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"97cc6cabb39f18b1a8405cd1afdc42605e636900","subject":"Fixed \"node not found\" when player is dead","message":"Fixed \"node not found\" when player is dead\n\n","repos":"BK-TN\/IncendiumGame","old_file":"incendium\/scripts\/Game.gd","new_file":"incendium\/scripts\/Game.gd","new_contents":"\nextends Node\n\nvar last_boss\nvar last_boss_wr\n\nvar bgcol = Color(0,0,0)\nvar target_bgcol = Color(0,0,0)\nvar fgcol = Color(0,0,0)\nvar target_fgcol = Color(0,0,0)\n\nvar bossnum = 0\nvar bossdepth = 2\n\nvar score = 0\n\nfunc _ready():\n\tset_process_input(true)\n\tset_process(true)\n\tgen_boss()\n\t\nfunc _input(event):\n\tif event.type == InputEvent.KEY:\n\t\tif event.scancode == KEY_R and event.pressed == true:\n\t\t\tif last_boss != null:\n\t\t\t\tlast_boss.queue_free()\n\nfunc _process(delta):\n\tbgcol = bgcol.linear_interpolate(target_bgcol,delta * 3)\n\tfgcol = fgcol.linear_interpolate(target_fgcol,delta * 0.5)\n\tget_node(\"Background\/Polygon2D\").set_color(bgcol)\n\t#tag(\"Smoke\").set_modulate(bgcol)\n\t\n\tif (!has_node(\"Player\")):\n\t\tOS.set_time_scale(min(OS.get_time_scale() + delta, 1))\n\t\tif OS.get_time_scale() >= 1:\n\t\t\tvar p = preload(\"res:\/\/objects\/Player.tscn\").instance()\n\t\t\tadd_child(p)\n\t\t\tp.set_global_pos(Vector2(360,600))\n\t\n\tif !last_boss_wr.get_ref():\n\t\t#No boss, spawn a new one\n\t\tif bossdepth < 4:\n\t\t\tbossdepth += 1\n\t\tgen_boss()\n\t\t#also increase player health\n\t\tvar player = get_node(\"Player\")\n\t\tif player != null:\n\t\t\tplayer.health = floor(lerp(player.health,player.MAX_HEALTH,0.5))\n\t\t\tget_node(\"Label\").set_text(\"HP: \" + str(player.health) + \"\/\" + str(player.MAX_HEALTH))\n\nfunc add_score(amount):\n\tscore += amount\n\tget_node(\"Score\").set_text(\"Score: \" + str(floor(score)))\n\nfunc gen_boss():\n\tvar boss_instance = preload(\"res:\/\/objects\/Boss.tscn\").instance()\n\tlast_boss = boss_instance\n\tlast_boss_wr = weakref(boss_instance)\n\t\n\trandomize() # Randomize random seed\n\t\n\tvar layer_count = bossdepth # floor(rand_range(3,5))\n\t\n\tvar layers = []\n\tvar bullettypes = []\n\tfor i in range(0,layer_count):\n\t\tlayers.append(floor(rand_range(3,6)))\n\t\tbullettypes.append(floor(rand_range(0,4)))\n\t\t#bullettypes.append(2)\n\tboss_instance.layers = layers\n\tboss_instance.bullettypes = bullettypes\n\t\n\tprint(\"generating regex\")\n\t# boss_instance.regex = gen_regex(layer_count - 1, layers)\n\tprint(boss_instance.regex)\n\t\n\tboss_instance.base_size = 100\n\tboss_instance.size_dropoff = 0.5\n\t\n\tboss_instance.base_health = 20 + (10 * bossnum)\n\t#TODO: Health and health dropoff (Should be based on difficulty, and probably affected by the total amount of boss parts)\n\t\n\tvar neg_base_rot_speed = randi() % 2 == 0\n\tboss_instance.base_rot_speed = rand_range(0.2,0.8)\n\tif neg_base_rot_speed:\n\t\tboss_instance.base_rot_speed = -boss_instance.base_rot_speed\n\t\n\tvar neg_rot_inc = randi() % 2 == 0\n\tboss_instance.rot_speed_inc = boss_instance.base_rot_speed + rand_range(0.1,0.2) * PI\n\tif neg_rot_inc:\n\t\tboss_instance.rot_speed_inc = -boss_instance.rot_speed_inc\n\t\n\tvar boss_start_col = Color(rand_range(0,1),rand_range(0,1),rand_range(0,1))\n\tvar boss_end_col = Color(rand_range(0,1),rand_range(0,1),rand_range(0,1))\n\t\n\tboss_instance.start_color = boss_start_col\n\tboss_instance.end_color = boss_end_col\n\t\n\ttarget_bgcol = boss_start_col.linear_interpolate(Color(0,0,0), 0.5)\n\ttarget_fgcol = boss_end_col.linear_interpolate(Color(0,0,0), 0)\n\t\n\tadd_child(boss_instance)\n\tboss_instance.set_pos(Vector2(360,360))\n\t\n\tbossnum += 1\n\tget_node(\"Label1\").set_text(\"Boss \" + str(bossnum))\n\nfunc gen_regex(depth, layers):\n\tprint(depth)\n\tif depth == 0:\n\t\treturn str(floor(rand_range(0, layers[depth])))\n\t\t\n\tvar option = floor(rand_range(0,3))\n\tif option == 0:\n\t\treturn \"(\" + gen_regex(depth - 1, layers) + \")*\"\n\tif option == 1:\n\t\treturn \"(\" + gen_regex(depth - 1, layers) + \")+(\" + gen_regex(depth - 1, layers) + \")\"\n\tif option == 2:\n\t\treturn \"(\" + gen_regex(depth - 1, layers) + \")(\" + gen_regex(depth - 1, layers) + \")\"\n\n","old_contents":"\nextends Node\n\nvar last_boss\nvar last_boss_wr\n\nvar bgcol = Color(0,0,0)\nvar target_bgcol = Color(0,0,0)\nvar fgcol = Color(0,0,0)\nvar target_fgcol = Color(0,0,0)\n\nvar bossnum = 0\nvar bossdepth = 2\n\nvar score = 0\n\nfunc _ready():\n\tset_process_input(true)\n\tset_process(true)\n\tgen_boss()\n\t\nfunc _input(event):\n\tif event.type == InputEvent.KEY:\n\t\tif event.scancode == KEY_R and event.pressed == true:\n\t\t\tif last_boss != null:\n\t\t\t\tlast_boss.queue_free()\n\nfunc _process(delta):\n\tbgcol = bgcol.linear_interpolate(target_bgcol,delta * 3)\n\tfgcol = fgcol.linear_interpolate(target_fgcol,delta * 0.5)\n\tget_node(\"Background\/Polygon2D\").set_color(bgcol)\n\t#tag(\"Smoke\").set_modulate(bgcol)\n\t\n\tvar player = get_node(\"Player\")\n\tif player == null:\n\t\tOS.set_time_scale(min(OS.get_time_scale() + delta, 1))\n\t\tif OS.get_time_scale() >= 1:\n\t\t\tvar p = preload(\"res:\/\/objects\/Player.tscn\").instance()\n\t\t\tadd_child(p)\n\t\t\tp.set_global_pos(Vector2(360,600))\n\t\n\tif !last_boss_wr.get_ref():\n\t\t#No boss, spawn a new one\n\t\tif bossdepth < 4:\n\t\t\tbossdepth += 1\n\t\tgen_boss()\n\t\t#also increase player health\n\t\tvar player = get_node(\"Player\")\n\t\tif player != null:\n\t\t\tplayer.health = floor(lerp(player.health,player.MAX_HEALTH,0.5))\n\t\t\tget_node(\"Label\").set_text(\"HP: \" + str(player.health) + \"\/\" + str(player.MAX_HEALTH))\n\nfunc add_score(amount):\n\tscore += amount\n\tget_node(\"Score\").set_text(\"Score: \" + str(floor(score)))\n\nfunc gen_boss():\n\tvar boss_instance = preload(\"res:\/\/objects\/Boss.tscn\").instance()\n\tlast_boss = boss_instance\n\tlast_boss_wr = weakref(boss_instance)\n\t\n\trandomize() # Randomize random seed\n\t\n\tvar layer_count = bossdepth # floor(rand_range(3,5))\n\t\n\tvar layers = []\n\tvar bullettypes = []\n\tfor i in range(0,layer_count):\n\t\tlayers.append(floor(rand_range(3,6)))\n\t\tbullettypes.append(floor(rand_range(0,4)))\n\t\t#bullettypes.append(2)\n\tboss_instance.layers = layers\n\tboss_instance.bullettypes = bullettypes\n\t\n\tprint(\"generating regex\")\n\t# boss_instance.regex = gen_regex(layer_count - 1, layers)\n\tprint(boss_instance.regex)\n\t\n\tboss_instance.base_size = 100\n\tboss_instance.size_dropoff = 0.5\n\t\n\tboss_instance.base_health = 20 + (10 * bossnum)\n\t#TODO: Health and health dropoff (Should be based on difficulty, and probably affected by the total amount of boss parts)\n\t\n\tvar neg_base_rot_speed = randi() % 2 == 0\n\tboss_instance.base_rot_speed = rand_range(0.2,0.8)\n\tif neg_base_rot_speed:\n\t\tboss_instance.base_rot_speed = -boss_instance.base_rot_speed\n\t\n\tvar neg_rot_inc = randi() % 2 == 0\n\tboss_instance.rot_speed_inc = boss_instance.base_rot_speed + rand_range(0.1,0.2) * PI\n\tif neg_rot_inc:\n\t\tboss_instance.rot_speed_inc = -boss_instance.rot_speed_inc\n\t\n\tvar boss_start_col = Color(rand_range(0,1),rand_range(0,1),rand_range(0,1))\n\tvar boss_end_col = Color(rand_range(0,1),rand_range(0,1),rand_range(0,1))\n\t\n\tboss_instance.start_color = boss_start_col\n\tboss_instance.end_color = boss_end_col\n\t\n\ttarget_bgcol = boss_start_col.linear_interpolate(Color(0,0,0), 0.5)\n\ttarget_fgcol = boss_end_col.linear_interpolate(Color(0,0,0), 0)\n\t\n\tadd_child(boss_instance)\n\tboss_instance.set_pos(Vector2(360,360))\n\t\n\tbossnum += 1\n\tget_node(\"Label1\").set_text(\"Boss \" + str(bossnum))\n\nfunc gen_regex(depth, layers):\n\tprint(depth)\n\tif depth == 0:\n\t\treturn str(floor(rand_range(0, layers[depth])))\n\t\t\n\tvar option = floor(rand_range(0,3))\n\tif option == 0:\n\t\treturn \"(\" + gen_regex(depth - 1, layers) + \")*\"\n\tif option == 1:\n\t\treturn \"(\" + gen_regex(depth - 1, layers) + \")+(\" + gen_regex(depth - 1, layers) + \")\"\n\tif option == 2:\n\t\treturn \"(\" + gen_regex(depth - 1, layers) + \")(\" + gen_regex(depth - 1, layers) + \")\"\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"c41df824ae20f19ca29e7e1ab473f02d1cc74dd3","subject":"Small update","message":"Small update\n","repos":"cypher31\/CRUNCH","old_file":"Scripts\/enemyFight.gd","new_file":"Scripts\/enemyFight.gd","new_contents":"extends KinematicBody2D\n\nvar time\n\nvar playerStartPosition\nvar enemyKilled = false\nvar coinSpawn = true\nvar coinCount = 0\n\n#Enemy variables\nvar position\n\n#tween variables\nvar t\nvar distance = -500 #Should be same distance as player\nvar duration = .5\n\nonready var coin = preload(\"res:\/\/Scenes\/CoinFight.tscn\")\nonready var loot = preload(\"res:\/\/Scenes\/lootSpawn.tscn\")\n\nfunc _ready():\n\ttime = 0\n\tposition = self.get_pos()\n\tget_node(\"\/root\/global\").enemyArmor = 1\n\tset_fixed_process(true)\n\tpass\n\nfunc _fixed_process(delta):\n\ttime -= delta\n\tget_node(\"\/root\/global\").coinsToMultiply = coinCount\n\t\n\tif(get_node(\"\/root\/global\").currentButtonPrompt == \"block\"):\n\t\tget_parent().get_node(\"Timers\/attackTimer\").set_wait_time(.5) #should turn this into a global later\n\t\tget_parent().get_node(\"Timers\/attackTimer\").start()\n\t\tget_node(\"\/root\/global\").stopButtonPrompts = true\n\t\t\n\tpass\n\nfunc _on_playerCheck_body_enter( body ):\n\tif(get_node(\"\/root\/global\").enemyHealth <= 0):\n\t\tenemyDead()\n\t\n\tif(body.is_in_group(\"playerFight\") && get_node(\"\/root\/global\").enemyHealth > 0 && !get_node(\"\/root\/global\").enemyAttack == true):\n\t\tget_node(\"\/root\/global\").enemyHealth -= get_node(\"\/root\/global\").playerAttackDmg \/ get_node(\"\/root\/global\").enemyArmor\n\t\n\tif(body.is_in_group(\"playerFight\") && get_node(\"\/root\/global\").enemyAttack == true && get_node(\"\/root\/global\").playerBlocking == false):\n\t\tprint(\"true\")\n\t\tget_node(\"\/root\/global\").playerCurrentHealth -= 25 #change to enemy attack variable\n\t\tget_node(\"\/root\/global\").playerCurrentCombo = 0\n\t\n\tif(body.is_in_group(\"playerFight\") && get_node(\"\/root\/global\").enemyHealth > 0 && get_node(\"\/root\/global\").playerBlocking == true):\n\t\tget_node(\"\/root\/global\").enemyHealth -= (get_node(\"\/root\/global\").playerAttackDmg * .25) \/ get_node(\"\/root\/global\").enemyArmor\n\t\n\tif(get_node(\"\/root\/global\").enemyHealth <= 0 && coinSpawn == true):\n\t\tget_node(\"\/root\/global\").playerRestart = true\n\t\tget_parent().get_node(\"Timers\/Timer\").start()\n\t\t\n\t\tcoinSpawn()\n\t\t\n\t\tlootSpawn()\n\t\t\n\t\tget_node(\"Sprite\").hide()\n\t\tget_node(\"SpriteDead\").set_opacity(1)\n\t\t\n\t\tget_node(\"\/root\/global\").stopButtonPrompts = true\n\t\t\n\tpass\n\t\nfunc _on_Timer_timeout():\n\tget_node(\"\/root\/global\").timer = false\n\tpass # replace with function body\n\t\nfunc coinSpawn():\n\tfor i in range(rand_range(1,100)):\n\t\tvar gold_coin = coin.instance()\n\t\tget_parent().get_node(\"KinematicBody2D\/itemHolder\").add_child(gold_coin)\n\t\tcoinCount = get_parent().get_node(\"KinematicBody2D\/itemHolder\").get_child_count()\n\n\tget_node(\"\/root\/global\").playerScore += coinCount * get_node(\"\/root\/global\").coin_gold_points\n\tcoinSpawn = false\n\t\n\nfunc lootSpawn():\n\tvar lootSpawn = loot.instance()\n\tget_parent().get_node(\"KinematicBody2D\/itemHolder\").add_child(lootSpawn)\n\t\n#enemy attack function on timeout\nfunc _on_attackTimer_timeout():\n\tif(get_node(\"\/root\/global\").enemyHealth > 0):\n\t\tget_node(\"\/root\/global\").enemyAttack = true\n\t\t#animate enemy\n\t\tt = Tween.new()\n\t\tadd_child(t)\n\t\n\t\tt.interpolate_property(self, \"transform\/pos\", Vector2(0,0), Vector2(distance,0), duration, Tween.TRANS_LINEAR, Tween.EASE_OUT)\n\t\tt.interpolate_callback(self, duration, \"reset_enemy\")\n\t\tt.start()\n\t\tpass # replace with function body\n\nfunc reset_enemy():\n\tself.set_pos(position)\n\tget_node(\"\/root\/global\").stopButtonPrompts = false #restart button prompts\n\tget_node(\"\/root\/global\").playerBlocking = false\n\tget_node(\"\/root\/global\").enemyAttack = false\n\tt.queue_free()\n\t\nfunc enemyDead():\n\t#stop button prompts from showing up for player\n\tget_node(\"\/root\/global\").stopButtonPrompts = true\n","old_contents":"extends KinematicBody2D\n\nvar time\n\nvar playerStartPosition\nvar enemyKilled = false\nvar coinSpawn = true\nvar coinCount = 0\n\n#Enemy variables\nvar position\n\n#tween variables\nvar t\nvar distance = -500 #Should be same distance as player\nvar duration = .5\n\nonready var coin = preload(\"res:\/\/Scenes\/CoinFight.tscn\")\nonready var loot = preload(\"res:\/\/Scenes\/lootSpawn.tscn\")\n\nfunc _ready():\n\ttime = 0\n\tposition = self.get_pos()\n\tget_node(\"\/root\/global\").enemyArmor = 1\n\tset_fixed_process(true)\n\tpass\n\nfunc _fixed_process(delta):\n\ttime -= delta\n\tget_node(\"\/root\/global\").coinsToMultiply = coinCount\n\t\n\tif(get_node(\"\/root\/global\").currentButtonPrompt == \"block\"):\n\t\tget_parent().get_node(\"Timers\/attackTimer\").set_wait_time(.5) #should turn this into a global later\n\t\tget_parent().get_node(\"Timers\/attackTimer\").start()\n\t\tget_node(\"\/root\/global\").stopButtonPrompts = true\n\t\t\n\tpass\n\nfunc _on_playerCheck_body_enter( body ):\n\tif(body.is_in_group(\"playerFight\") && get_node(\"\/root\/global\").enemyHealth > 0 && !get_node(\"\/root\/global\").enemyAttack == true):\n\t\tget_node(\"\/root\/global\").enemyHealth -= get_node(\"\/root\/global\").playerAttackDmg \/ get_node(\"\/root\/global\").enemyArmor\n\t\n\tif(body.is_in_group(\"playerFight\") && get_node(\"\/root\/global\").enemyAttack == true && get_node(\"\/root\/global\").playerBlocking == false):\n\t\tprint(\"true\")\n\t\tget_node(\"\/root\/global\").playerCurrentHealth -= 25 #change to enemy attack variable\n\t\tget_node(\"\/root\/global\").playerCurrentCombo = 0\n\t\n\tif(body.is_in_group(\"playerFight\") && get_node(\"\/root\/global\").enemyHealth > 0 && get_node(\"\/root\/global\").playerBlocking == true):\n\t\tget_node(\"\/root\/global\").enemyHealth -= (get_node(\"\/root\/global\").playerAttackDmg * .25) \/ get_node(\"\/root\/global\").enemyArmor\n\t\n\tif(get_node(\"\/root\/global\").enemyHealth <= 0 && coinSpawn == true):\n\t\tget_node(\"\/root\/global\").playerRestart = true\n\t\tget_parent().get_node(\"Timers\/Timer\").start()\n\t\t\n\t\tcoinSpawn()\n\t\t\n\t\tlootSpawn()\n\t\t\n\t\tget_node(\"Sprite\").hide()\n\t\tget_node(\"SpriteDead\").set_opacity(1)\n\t\t\n\t\tget_node(\"\/root\/global\").stopButtonPrompts = true\n\t\t\n\tpass\n\t\nfunc _on_Timer_timeout():\n\tget_node(\"\/root\/global\").timer = false\n\tpass # replace with function body\n\t\nfunc coinSpawn():\n\tfor i in range(rand_range(1,100)):\n\t\tvar gold_coin = coin.instance()\n\t\tget_parent().get_node(\"KinematicBody2D\/itemHolder\").add_child(gold_coin)\n\t\tcoinCount = get_parent().get_node(\"KinematicBody2D\/itemHolder\").get_child_count()\n\n\tget_node(\"\/root\/global\").playerScore += coinCount * get_node(\"\/root\/global\").coin_gold_points\n\tcoinSpawn = false\n\t\n\nfunc lootSpawn():\n\tvar lootSpawn = loot.instance()\n\tget_parent().get_node(\"KinematicBody2D\/itemHolder\").add_child(lootSpawn)\n\t\n#enemy attack function on timeout\nfunc _on_attackTimer_timeout():\n\tif(get_node(\"\/root\/global\").enemyHealth > 0):\n\t\tget_node(\"\/root\/global\").enemyAttack = true\n\t\t#animate enemy\n\t\tt = Tween.new()\n\t\tadd_child(t)\n\t\n\t\tt.interpolate_property(self, \"transform\/pos\", Vector2(0,0), Vector2(distance,0), duration, Tween.TRANS_LINEAR, Tween.EASE_OUT)\n\t\tt.interpolate_callback(self, duration, \"reset_enemy\")\n\t\tt.start()\n\t\tpass # replace with function body\n\nfunc reset_enemy():\n\tself.set_pos(position)\n\tget_node(\"\/root\/global\").stopButtonPrompts = false #restart button prompts\n\tget_node(\"\/root\/global\").playerBlocking = false\n\tget_node(\"\/root\/global\").enemyAttack = false\n\tt.queue_free()\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"4521b6b8798544e1cbf6ebb137649b92f2e038c5","subject":"fix demo 3d mousepick test","message":"fix demo 3d mousepick test\n\nadd the missing camera parameter to the _input_event()\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"3d\/mousepick_test\/mousepick.gd","new_file":"3d\/mousepick_test\/mousepick.gd","new_contents":"\nextends RigidBody\n\n# member variables here, example:\n# var a=2\n# var b=\"textvar\"\n\nvar gray_mat = FixedMaterial.new()\n\nvar selected=false\n\nfunc _input_event(camera,event,pos,normal,shape):\n\tif (event.type==InputEvent.MOUSE_BUTTON and event.pressed):\n\t\tif (not selected):\n\t\t\tget_node(\"mesh\").set_material_override(gray_mat)\n\t\telse:\n\t\t\tget_node(\"mesh\").set_material_override(null)\n\t\t\n\t\tselected = not selected\n\t\t\n\nfunc _mouse_enter():\n\tget_node(\"mesh\").set_scale( Vector3(1.1,1.1,1.1) )\n\nfunc _mouse_exit():\n\tget_node(\"mesh\").set_scale( Vector3(1,1,1) )\n\nfunc _ready():\n\t# Initalization here\n\tpass\n\n\n","old_contents":"\nextends RigidBody\n\n# member variables here, example:\n# var a=2\n# var b=\"textvar\"\n\nvar gray_mat = FixedMaterial.new()\n\nvar selected=false\n\nfunc _input_event(event,pos,normal,shape):\n\tif (event.type==InputEvent.MOUSE_BUTTON and event.pressed):\n\t\tif (not selected):\n\t\t\tget_node(\"mesh\").set_material_override(gray_mat)\n\t\telse:\n\t\t\tget_node(\"mesh\").set_material_override(null)\n\t\t\n\t\tselected = not selected\n\t\t\n\nfunc _mouse_enter():\n\tget_node(\"mesh\").set_scale( Vector3(1.1,1.1,1.1) )\n\nfunc _mouse_exit():\n\tget_node(\"mesh\").set_scale( Vector3(1,1,1) )\n\nfunc _ready():\n\t# Initalization here\n\tpass\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"8ff2aec4f160f055b5433dcc1f0bf7c166c9c125","subject":"Allow changing player facing side while in the air","message":"Allow changing player facing side while in the air\n\n* As soon as the user wants to change direction while in the air, change\n the character's facing side.\n* This allows for example shooting left then right while in the air and\n gives a better feeling.\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"2d\/platformer\/player.gd","new_file":"2d\/platformer\/player.gd","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"mit","lang":"GDScript"} {"commit":"039a51a8224675ce2cb549ecb1b7debe857a2e56","subject":"Bug fixes to the long text display.","message":"Bug fixes to the long text display.\n","repos":"groboclown\/godot-bootstrap","old_file":"components\/long_text\/long_text.gd","new_file":"components\/long_text\/long_text.gd","new_contents":"\n\n# A text label that scrolls on and on.\n\nextends Container\n\n\nexport(int, 0, 1000) var indent_pixels = 20 setget indent_spaces_changed\nexport(float, 0, 10) var paragraph_separation = 1.8 setget paragraph_separation_changed\nexport(float, 0, 10) var line_height = 1.5 setget line_height_changed\nexport(Color, RGBA) var color\nexport(Font) var font setget font_changed\nexport(String) var text setget text_changed\n\nvar _trtext\nvar _line_pos = []\nvar _height = 0\nvar _changed = false\n\nvar _actual_width\nvar _minimum_width\n\nconst CH_SPACE = 32\nconst CH_TAB = 9\nconst CH_LF = 13\nconst CH_CR = 10\nconst CH_BACKSLASH = 92\nconst CH_N = 110\nconst CH_T = 116\n\nfunc _init():\n\tconnect(\"resized\", self, \"_on_resized\")\n\tconnect(\"minimum_size_changed\", self, \"_on_minimum_changed\")\n\tconnect(\"size_flags_changed\", self, \"_on_resized\")\n\tconnect(\"item_rect_changed\", self, \"_on_resized\")\n\n\nfunc _ready():\n\tif get_parent() extends ScrollContainer:\n\t\tget_parent().connect(\"resized\", self, \"recalculate\")\n\tif _changed:\n\t\trecalculate()\n\tif _actual_width == null:\n\t\t_actual_width = get_minimum_size().x\n\n\t\t\nfunc _on_minimum_changed():\n\tvar size = get_minimum_size()\n\tif _minimum_width == null || size.x != _actual_width:\n\t\t# it hasn't been called, or was explicitly changed outside\n\t\t# of the below method.\n\t\t_minimum_width = size.x\n\t\tif _minimum_width > _actual_width:\n\t\t\t_actual_width = _minimum_width\n\t\t\t_changed = true\n\t\t\n\nfunc _on_resized():\n\t# Prevents the explicit setting of the minimum size below from messing with\n\t# the actual size.\n\tvar new_width = max(get_minimum_size().x, get_size().x)\n\tif _actual_width != new_width:\n\t\t_actual_width = new_width\n\t\t_changed = true\n\t\n\nfunc _draw():\n\tif _changed:\n\t\trecalculate()\n\tvar fnt = get_text_font()\n\tvar c = color\n\tif c == null:\n\t\tc = get_color(\"font_color\", \"Label\")\n\tfor line in _line_pos:\n\t\tdraw_string(fnt, line[1], line[0], c)\n\nfunc indent_spaces_changed(newval):\n\t_changed = true\n\nfunc paragraph_separation_changed(newval):\n\t_changed = true\n\nfunc line_height_changed(newval):\n\t_changed = true\n\nfunc font_changed(newval):\n\t_changed = true\n\nfunc text_changed(newval):\n\t_changed = true\n\t_trtext = []\n\tvar t = null\n\tif newval != null:\n\t\tt = tr(newval)\n\tif t == null:\n\t\treturn\n\t# escape the text\n\tvar esc = false\n\tvar txt = \"\"\n\tvar first = 0\n\tvar i\n\tfor i in range(0, t.length()):\n\t\tvar ch = t.ord_at(i)\n\t\tif esc:\n\t\t\tesc = false\n\t\t\tif ch == CH_N:\n\t\t\t\ttxt = txt.strip_edges()\n\t\t\t\tif txt.length() > 0:\n\t\t\t\t\t_trtext.append(txt)\n\t\t\t\ttxt = \"\"\n\t\t\t\tfirst = i + 1\n\t\t\telif ch == CH_T:\n\t\t\t\t# change to a space\n\t\t\t\tif i - 1 > first:\n\t\t\t\t\ttxt += t.substr(first, i - 1)\n\t\t\t\ttxt += ' '\n\t\t\t\tfirst = i + 1\n\t\t\telse:\n\t\t\t\t# Just use the un-escaped value\n\t\t\t\tfirst = i\n\t\telif ch == CH_BACKSLASH:\n\t\t\tif i > first:\n\t\t\t\ttxt += t.substr(first, i - first)\n\t\t\tesc = true\n\t\telif (ch == CH_CR || ch == CH_LF):\n\t\t\tif i > first:\n\t\t\t\ttxt += t.substr(first, i - first)\n\t\t\ttxt = txt.strip_edges()\n\t\t\tif txt.length() > 0:\n\t\t\t\t_trtext.append(txt)\n\t\t\ttxt = \"\"\n\t\t\tfirst = i + 1\n\t\telif ch == CH_TAB:\n\t\t\tif i > first:\n\t\t\t\ttxt += t.substr(first, i - first)\n\t\t\ttxt += ' '\n\t\t\tfirst = i + 1\n\t\t# else ch is a normal character; it is just added to the\n\t\t# pending substring\n\tif t.length() > first:\n\t\ttxt += t.right(first)\n\t\ttxt = txt.strip_edges()\n\t\tif txt.length() > 0:\n\t\t\t_trtext.append(txt)\n\n\nfunc get_text_font():\n\tif font == null:\n\t\treturn get_font(\"font\", \"Label\")\n\treturn font\n\n\nfunc recalculate():\n\t_changed = false\n\t\n\tvar widget_width = _actual_width\n\tif widget_width == null || widget_width <= 0:\n\t\tif _minimum_width == null:\n\t\t\t_minimum_width = get_minimum_size().x\n\t\twidget_width = max(get_size().x, _minimum_width)\n\tif get_parent() != null && get_parent() extends ScrollContainer:\n\t\tvar pw = get_parent().get_size().x\n\t\tif pw > 0:\n\t\t\tvar k = get_parent().get_node(\"_v_scroll\")\n\t\t\tif k != null:\n\t\t\t\tpw -= max(k.get_size().x, 10)\n\t\t\tif pw < widget_width:\n\t\t\t\twidget_width = pw\n\t\n\tvar start_x = 0\n\tvar fnt = get_text_font()\n\tvar font_height = float(fnt.get_height())\n\tvar psep = int(paragraph_separation * font_height)\n\tvar lsep = int(line_height * font_height)\n\t_line_pos = []\n\t# We start drawing strings at the bottom of the string.\n\tvar y_pos = -psep + lsep\n\tfor txt in _trtext:\n\t\t# start of an explicit new line\n\t\ty_pos += psep\n\t\tvar tlen = txt.length() - 1\n\t\tvar tpos\n\t\t# We trim the lines, so that they start with non-whitespace\n\t\t# Therefore, the first character of a line is the start of the word.\n\t\tvar linestart_pos = 0\n\t\tvar wordstart_pos = 0\n\t\tvar word_width = 0\n\t\tvar wordend_pos = -1\n\t\tvar on_space = false\n\t\tvar x_pos = indent_pixels + start_x\n\t\tvar width = indent_pixels\n\t\tfor tpos in range(0, tlen + 1):\n\t\t\tvar ch = txt.ord_at(tpos)\n\t\t\tif ch == CH_SPACE:\n\t\t\t\tif not on_space:\n\t\t\t\t\ton_space = true\n\t\t\t\t\twordend_pos = tpos\n\t\t\t\t\twordstart_pos = -1\n\t\t\t\t\tword_width = 0\n\t\t\telse:\n\t\t\t\tif linestart_pos < 0:\n\t\t\t\t\tlinestart_pos = tpos\n\t\t\t\tif wordstart_pos < 0:\n\t\t\t\t\twordstart_pos = tpos\n\t\t\t\t\tword_width = 0\n\t\t\t\ton_space = false\n\t\t\tvar cn = 0\n\t\t\tif tpos + 1 <= tlen:\n\t\t\t\tcn = txt.ord_at(tpos + 1)\n\t\t\tvar cw = fnt.get_char_size(ch, cn).x\n\t\t\twidth += cw\n\t\t\tword_width += cw\n\t\t\tif tpos >= tlen:\n\t\t\t\t# end of the line; stick everything into the end.\n\t\t\t\t# We trim the text, so the last character is non-whitespace.\n\t\t\t\t_line_pos.append([\n\t\t\t\t\t# text\n\t\t\t\t\ttxt.right(linestart_pos),\n\t\t\t\t\t\n\t\t\t\t\t# draw position\n\t\t\t\t\tVector2(x_pos, y_pos)\n\t\t\t\t])\n\t\t\t\t# No need to change x_pos or the other loop variables\n\t\t\t\ty_pos += lsep\n\t\t\telif width >= widget_width:\n\t\t\t\t# Soft end of line\n\t\t\t\tvar next_linestart = wordstart_pos\n\t\t\t\tvar next_wordstart = -1\n\t\t\t\tvar next_word_width = word_width - width\n\t\t\t\tif wordend_pos < 0:\n\t\t\t\t\t# in the middle of the word.\n\t\t\t\t\tif wordstart_pos < 0:\n\t\t\t\t\t\t# No word in the line. Just skip it\n\t\t\t\t\t\twidth = 0\n\t\t\t\t\t\tx_pos = start_x\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t# only one word; cut this one at the break.\n\t\t\t\t\t# TODO add a hyphen\n\t\t\t\t\twordend_pos = tpos\n\t\t\t\t\tnext_linestart = tpos\n\t\t\t\t\tnext_wordstart = tpos\n\t\t\t\t\tword_width = cw\n\t\t\t\t\tnext_word_width = cw\n\t\t\t\t\n\t\t\t\t# soft end of line\n\t\t\t\t_line_pos.append([\n\t\t\t\t\t# text\n\t\t\t\t\ttxt.substr(linestart_pos, wordend_pos - linestart_pos),\n\t\t\t\t\t\n\t\t\t\t\t# draw position\n\t\t\t\t\tVector2(x_pos, y_pos)\n\t\t\t\t])\n\t\t\t\t\n\t\t\t\tx_pos = start_x\n\t\t\t\twidth = word_width\n\t\t\t\tword_width = next_word_width\n\t\t\t\ty_pos += lsep\n\t\t\t\twordstart_pos = next_wordstart\n\t\t\t\twordend_pos = -1\n\t\t\t\tlinestart_pos = next_linestart\n\t\t\t\t\n\tset_custom_minimum_size(Vector2(widget_width, y_pos))\n\t\n\n","old_contents":"\n\n# A text label that scrolls on and on.\n\nextends Container\n\n\nexport(int, 0, 1000) var indent_pixels = 20 setget indent_spaces_changed\nexport(float, 0, 10) var paragraph_separation = 1.8 setget paragraph_separation_changed\nexport(float, 0, 10) var line_height = 1.5 setget line_height_changed\nexport(Color, RGBA) var color\nexport(Font) var font setget font_changed\nexport(String) var text setget text_changed\n\nvar _trtext\nvar _line_pos = []\nvar _height = 0\nvar _changed = false\n\nvar _actual_width\nvar _minimum_width\n\nconst CH_SPACE = 32\nconst CH_TAB = 9\nconst CH_LF = 13\nconst CH_CR = 10\nconst CH_BACKSLASH = 92\nconst CH_N = 110\nconst CH_T = 116\n\nfunc _init():\n\tconnect(\"resized\", self, \"_on_resized\")\n\tconnect(\"minimum_size_changed\", self, \"_on_minimum_changed\")\n\tconnect(\"size_flags_changed\", self, \"_on_resized\")\n\tconnect(\"item_rect_changed\", self, \"_on_resized\")\n\n\nfunc _ready():\n\tif get_parent() extends ScrollContainer:\n\t\tget_parent().connect(\"resized\", self, \"recalculate\")\n\tif _changed:\n\t\trecalculate()\n\tif _actual_width == null:\n\t\t_actual_width = get_minimum_size().x\n\n\t\t\nfunc _on_minimum_changed():\n\tvar size = get_minimum_size()\n\tif _minimum_width == null || size.x != _actual_width:\n\t\t# it hasn't been called, or was explicitly changed outside\n\t\t# of the below method.\n\t\t_minimum_width = size.x\n\t\tif _minimum_width > _actual_width:\n\t\t\t_actual_width = _minimum_width\n\t\t\t_changed = true\n\t\t\n\nfunc _on_resized():\n\t# Prevents the explicit setting of the minimum size below from messing with\n\t# the actual size.\n\tvar new_width = max(get_minimum_size().x, get_size().x)\n\tif _actual_width != new_width:\n\t\t_actual_width = new_width\n\t\t_changed = true\n\t\n\nfunc _draw():\n\tif _changed:\n\t\trecalculate()\n\tvar fnt = get_text_font()\n\tvar c = color\n\tif c == null:\n\t\tc = get_color(\"font_color\", \"Label\")\n\tfor line in _line_pos:\n\t\tdraw_string(fnt, line[1], line[0], c)\n\nfunc indent_spaces_changed(newval):\n\t_changed = true\n\nfunc paragraph_separation_changed(newval):\n\t_changed = true\n\nfunc line_height_changed(newval):\n\t_changed = true\n\nfunc font_changed(newval):\n\t_changed = true\n\nfunc text_changed(newval):\n\t_changed = true\n\t_trtext = []\n\tvar t = null\n\tif newval != null:\n\t\tt = tr(newval)\n\tif t == null:\n\t\treturn\n\t# escape the text\n\tvar esc = false\n\tvar txt = \"\"\n\tvar first = 0\n\tvar i\n\tfor i in range(0, t.length()):\n\t\tvar ch = t.ord_at(i)\n\t\tif esc:\n\t\t\tesc = false\n\t\t\tif ch == CH_N:\n\t\t\t\ttxt = txt.strip_edges()\n\t\t\t\tif txt.length() > 0:\n\t\t\t\t\t_trtext.append(txt)\n\t\t\t\ttxt = \"\"\n\t\t\t\tfirst = i + 1\n\t\t\telif ch == CH_T:\n\t\t\t\t# change to a space\n\t\t\t\tif i - 1 > first:\n\t\t\t\t\ttxt += t.substr(first, i - 1)\n\t\t\t\ttxt += ' '\n\t\t\t\tfirst = i + 1\n\t\t\telse:\n\t\t\t\t# Just use the un-escaped value\n\t\t\t\tfirst = i\n\t\telif ch == CH_BACKSLASH:\n\t\t\tif i > first:\n\t\t\t\ttxt += t.substr(first, i - first)\n\t\t\tesc = true\n\t\telif (ch == CH_CR || ch == CH_LF):\n\t\t\tif i > first:\n\t\t\t\ttxt += t.substr(first, i - first)\n\t\t\ttxt = txt.strip_edges()\n\t\t\tif txt.length() > 0:\n\t\t\t\t_trtext.append(txt)\n\t\t\ttxt = \"\"\n\t\t\tfirst = i + 1\n\t\telif ch == CH_TAB:\n\t\t\tif i > first:\n\t\t\t\ttxt += t.substr(first, i - first)\n\t\t\ttxt += ' '\n\t\t\tfirst = i + 1\n\t\t# else ch is a normal character; it is just added to the\n\t\t# pending substring\n\tif t.length() > first:\n\t\ttxt += t.right(first)\n\t\ttxt = txt.strip_edges()\n\t\tif txt.length() > 0:\n\t\t\t_trtext.append(txt)\n\n\nfunc get_text_font():\n\tif font == null:\n\t\treturn get_font(\"font\", \"Label\")\n\treturn font\n\n\nfunc recalculate():\n\t_changed = false\n\t\n\tvar widget_width = _actual_width\n\tif widget_width == null || widget_width <= 0:\n\t\tif _minimum_width == null:\n\t\t\t_minimum_width = get_minimum_size().x\n\t\twidget_width = max(get_size().x, _minimum_width)\n\tif get_parent() != null && get_parent() extends ScrollContainer:\n\t\tvar pw = get_parent().get_size().x\n\t\tif pw > 0:\n\t\t\tvar k = get_parent().get_node(\"_v_scroll\")\n\t\t\tif k != null:\n\t\t\t\tpw -= max(k.get_size().x, 10)\n\t\t\tif pw < widget_width:\n\t\t\t\twidget_width = pw\n\tprint(\"width: \" + str(widget_width))\n\t\n\tvar start_x = 0\n\tvar fnt = get_text_font()\n\tvar font_height = float(fnt.get_height())\n\tvar psep = int(paragraph_separation * font_height)\n\tvar lsep = int(line_height * font_height)\n\t_line_pos = []\n\t# We start drawing strings at the bottom of the string.\n\tvar y_pos = -psep + lsep\n\tfor txt in _trtext:\n\t\t# start of an explicit new line\n\t\ty_pos += psep\n\t\tvar tlen = txt.length() - 1\n\t\tvar tpos\n\t\t# We trim the lines, so that they start with non-whitespace\n\t\t# Therefore, the first character of a line is the start of the word.\n\t\tvar linestart_pos = 0\n\t\tvar wordstart_pos = 0\n\t\tvar word_width = 0\n\t\tvar wordend_pos = -1\n\t\tvar on_space = false\n\t\tvar x_pos = indent_pixels + start_x\n\t\tvar width = indent_pixels\n\t\tfor tpos in range(0, tlen + 1):\n\t\t\tvar ch = txt.ord_at(tpos)\n\t\t\tif ch == CH_SPACE:\n\t\t\t\tif not on_space:\n\t\t\t\t\ton_space = true\n\t\t\t\t\twordend_pos = tpos\n\t\t\t\t\twordstart_pos = -1\n\t\t\t\t\tword_width = 0\n\t\t\telse:\n\t\t\t\tif linestart_pos < 0:\n\t\t\t\t\tlinestart_pos = tpos\n\t\t\t\tif wordstart_pos < 0:\n\t\t\t\t\twordstart_pos = tpos\n\t\t\t\t\tword_width = 0\n\t\t\t\ton_space = false\n\t\t\tvar cn = 0\n\t\t\tif tpos + 1 <= tlen:\n\t\t\t\tcn = txt.ord_at(tpos + 1)\n\t\t\tvar cw = fnt.get_char_size(ch, cn).x\n\t\t\twidth += cw\n\t\t\tword_width += cw\n\t\t\tif tpos >= tlen:\n\t\t\t\t# end of the line; stick everything into the end.\n\t\t\t\t# We trim the text, so the last character is non-whitespace.\n\t\t\t\t_line_pos.append([\n\t\t\t\t\t# text\n\t\t\t\t\ttxt.right(linestart_pos),\n\t\t\t\t\t\n\t\t\t\t\t# draw position\n\t\t\t\t\tVector2(x_pos, y_pos)\n\t\t\t\t])\n\t\t\t\t# No need to change x_pos or the other loop variables\n\t\t\t\ty_pos += lsep\n\t\t\telif width >= widget_width:\n\t\t\t\t# Soft end of line\n\t\t\t\tvar next_linestart = wordstart_pos\n\t\t\t\tvar next_wordstart = -1\n\t\t\t\tvar next_word_width = word_width - width\n\t\t\t\tif wordend_pos < 0:\n\t\t\t\t\t# in the middle of the word.\n\t\t\t\t\tif wordstart_pos < 0:\n\t\t\t\t\t\t# No word in the line. Just skip it\n\t\t\t\t\t\twidth = 0\n\t\t\t\t\t\tx_pos = start_x\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t# only one word; cut this one at the break.\n\t\t\t\t\t# TODO add a hyphen\n\t\t\t\t\twordend_pos = tpos\n\t\t\t\t\tnext_linestart = tpos\n\t\t\t\t\tnext_wordstart = tpos\n\t\t\t\t\tword_width = cw\n\t\t\t\t\tnext_word_width = cw\n\t\t\t\t\n\t\t\t\t# soft end of line\n\t\t\t\t_line_pos.append([\n\t\t\t\t\t# text\n\t\t\t\t\ttxt.substr(linestart_pos, wordend_pos - linestart_pos),\n\t\t\t\t\t\n\t\t\t\t\t# draw position\n\t\t\t\t\tVector2(x_pos, y_pos)\n\t\t\t\t])\n\t\t\t\t\n\t\t\t\tx_pos = start_x\n\t\t\t\twidth = word_width\n\t\t\t\tword_width = next_word_width\n\t\t\t\ty_pos += lsep\n\t\t\t\twordstart_pos = next_wordstart\n\t\t\t\twordend_pos = -1\n\t\t\t\tlinestart_pos = next_linestart\n\t\t\t\t\n\tset_custom_minimum_size(Vector2(widget_width, y_pos))\n\t\n\n","returncode":0,"stderr":"","license":"cc0-1.0","lang":"GDScript"} {"commit":"f64fcd01645c13be05bf41753e35e2a6068bb7e6","subject":"renamed prevBlock to prevBlokcs. saving and loading work. file dialog initilization made static.","message":"renamed prevBlock to prevBlokcs. saving and loading work. file dialog initilization made static.\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Editor.gd","new_file":"src\/scripts\/Editor.gd","new_contents":"extends Spatial\n\nvar puzzle\nvar puzzleMan\nvar DataMan = preload(\"res:\/\/scripts\/DataManager.gd\")\n\nvar gridMan\nvar prevBlocks = [] # keeps track of prevous color for pairs by layer\nvar blockColors = preload(\"res:\/\/scripts\/PuzzleManager.gd\").blockColors\nvar id\n\nvar saveDir = OS.get_data_dir() + \"\/PuzzleSaves\"\n\nvar fd\nvar gui = [\n\t[\"status\", Label.new()], # plz keep me as first element, referenced as gui[0] later\n\t[\"save_pzl\", Button.new()],\n\t[\"load_pzl\", Button.new()],\n\t[\"remove_layer\", Button.new()],\n\t[\"random_layer\", Button.new()],\n\t# THESE SHOULD BE Options instead of left, label, right\n\t[\"class_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=[\"LZR\", \"WILD\", \"PAIR\", \"GOAL\"],\n\t\tvalue=\"PAIR\"\n\t}],\n\t[\"color_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=blockColors,\n\t\tvalue=\"Blue\"\n\t}],\n\t[\"action_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=[\"Add\", \"Remove\", \"Replace\"],\n\t\tvalue=\"Add\"\n\t}],\n\t[\"test_pzl\", Button.new()],\n]\nvar action_ix = gui.size() - 1 - 1\nvar color_ix = gui.size() - 1 - 2\nvar class_ix = gui.size() - 1 - 3\n\n# gross style, cannot , but clean enough\nfunc shouldAddNeighbor():\n\treturn gui[action_ix][1].value == \"Add\"\n\nfunc shouldReplaceSelf():\n\treturn gui[action_ix][1].value == \"Replace\"\n\nfunc shouldRemoveSelf():\n\treturn gui[action_ix][1].value == \"Remove\"\n\n# called in AbstractBlock to add a new block\nfunc addBlock(pos):\n\tvar curColor = gui[color_ix][1].value\n\tvar b = puzzleMan.PickledBlock.new() \\\n\t\t.setName(id) \\\n\t\t.setTextureName(curColor) \\\n\t\t.setBlockPos(pos)\n\tvar layer = puzzleMan.calcBlockLayerVec(pos)\n\tid += 1\n\n\tif layer == 0 and not gui[class_ix][1].value == \"GOAL\":\n\t\treturn\n\n\t# expand prevblocks index\n\twhile prevBlocks.size() <= layer:\n\t\tvar d = {}\n\t\tfor k in blockColors:\n\t\t\td[k] = null\n\t\tprevBlocks.append(d)\n\n\tvar pb = prevBlocks[layer][curColor]\n\n\tif pb != null:\n\t\tb.setPairName(pb.name)\n\t\tgridMan.get_node(pb.toNode().name).setPairName(b.name)\n\t\tprevBlocks[layer][curColor] = null\n\telse:\n\t\t# TODO SUPPORT GLYPHS HERE, SET PAIRWISE GLYPH\n\t\tprevBlocks[layer][curColor] = b\n\n\tgui[0][1].set_text(getPrevBlockErrors())\n\tvar block = gridMan.addPickledBlock(b)\n\tvar v = 0.01\n\tblock.set_scale(Vector3(v,v,v))\n\tblock.scaleTweenNode(1, 0.25, Tween.TRANS_QUART).start()\n\treturn b\n\nfunc getPrevBlockErrors():\n\t# hahaha, so bad\n\tvar missing = \"STATUS: \"\n\t# check every layer\n\tfor l in range(prevBlocks.size()):\n\t\t# check every color\n\t\tfor k in prevBlocks[l].keys():\n\t\t\tvar missed = false\n\t\t\tif prevBlocks[l][k] != null:\n\t\t\t\t# one message about the current layer\n\t\t\t\tif not missed:\n\t\t\t\t\tmissing += \" L\" + str(l) + \" \"\n\t\t\t\t\tmissed = true\n\t\t\t\tmissing += k.to_upper() + \" \" # bad way of constructing strings\n\tif missing == \"\":\n\t\tmissing += \"NOMINAL\"\n\treturn missing\n\nfunc changeValue(ix, togg):\n\ttogg.value = togg.values[ix]\n\nfunc _ready():\n\t# lights!\n\tget_tree().get_root().add_child(preload( \"res:\/\/puzzleView.scn\" ).instance())\n\tpuzzle = preload( \"res:\/\/puzzle.scn\" ).instance()\n\tpuzzle.mainPuzzle = false\n\n\t# hide and disable timer\n\tpuzzle.time.on = false;\n\tpuzzle.time.val = ''\n\tprint(puzzle.time)\n\n\tpuzzle.set_as_toplevel(true)\n\tget_tree().get_root().add_child(puzzle)\n\n\tgridMan = puzzle.get_node(\"GridView\/GridMan\")\n\tid = gridMan.shape.size()\n\n\tpuzzleMan = puzzle.puzzleMan\n\n\tset_process_input(true)\n\n\tvar theme = preload(\"res:\/\/themes\/MainTheme.thm\")\n\tfd = initLoadSaveDialog(self, get_tree(), saveDir)\n\n\tvar y = 0\n\tfor control in gui:\n\t\ty += 45\n\t\tif control[0].rfind('_toggle') > 0:\n\t\t\tvar togg = control[1]\n\t\t\tvar e = togg.optionButt\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tadd_child(e)\n\n\t\t\t# index of items needed\n\t\t\te.connect(\"item_selected\", self, \"changeValue\", [togg])\n\t\t\tfor i in range(togg.values.size()):\n\t\t\t\te.add_item(togg.values[i], i)\n\t\t\t\t# e.add_icon_item(togg.values[i], i)\n\n\t\telse:\n\t\t\tvar e = control[1]\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tif e extends Button:\n\t\t\t\te.set_text(control[0])\n\t\t\tif control[0] == 'save_pzl' :\n\t\t\t\te.connect('pressed', self, 'showSaveDialog', [fd, self])\n\t\t\tif control[0] == 'load_pzl' :\n\t\t\t\te.connect('pressed', self, 'showLoadDialog', [fd, self])\n\t\t\tif control[0] == 'status':\n\t\t\t\tcontrol[1].set_text('STATUS: NOMINAL')\n\t\t\tadd_child(e)\n\n\nfunc puzzleSave():\n\tvar f = fd.get_current_path()\n\tif f == null or f == \"\":\n\t\treturn\n\tprint(\"SAVING TO \", f)\n\tDataMan.savePuzzle( f, gridMan.puzzle )\n\nfunc puzzleLoad():\n\tvar f = fd.get_current_path()\n\tif f == null or f == \"\":\n\t\treturn\n\tprint(\"LOADING FROM \", f)\n\tprevBlocks = []\n\tgridMan.set_puzzle(DataMan.loadPuzzle( f ))\n\nstatic func showLoadDialog(fileD, parent):\n\tif fileD.is_connected(\"confirmed\", parent, \"puzzleSave\"):\n\t\tfileD.disconnect(\"confirmed\", parent, \"puzzleSave\")\n\tfileD.connect(\"confirmed\", parent, \"puzzleLoad\")\n\tfileD.set_mode(FileDialog.MODE_OPEN_FILE)\n\n\tfileD.popup_centered()\n\nstatic func showSaveDialog(fileD, parent):\n\tif fileD.is_connected(\"confirmed\", parent, \"puzzleLoad\"):\n\t\tfileD.disconnect(\"confirmed\", parent, \"puzzleLoad\")\n\tfileD.connect(\"confirmed\", parent, \"puzzleSave\")\n\tfileD.set_mode(FileDialog.MODE_SAVE_FILE)\n\n\tfileD.popup_centered()\n\nstatic func initLoadSaveDialog(parent, tree, saveDir):\n\t# setup text in the file dialog\n\tvar fileDialog = load(\"res:\/\/fileDialog.scn\").instance()\n\tfileDialog.set_title(\"Select Puzzle Filename\")\n\tfileDialog.set_access(FileDialog.ACCESS_FILESYSTEM)\n\tfileDialog.add_filter(\"*.pzl ; Anttris Puzzle\")\n\n\tDirectory.new().make_dir_recursive(saveDir)\n\tfileDialog.set_current_dir(saveDir)\n\tprint(\"Saves in \", saveDir)\n\n\t# MainTheme leaks on bottom\n\tvar dialogTheme = Theme.new()\n\tdialogTheme.copy_default_theme()\n\tfileDialog.set_theme(dialogTheme)\n\n\t# work even if game is paused\n\tfileDialog.set_pause_mode(PAUSE_MODE_PROCESS)\n\n\t# unpause if user cancels\n\tfileDialog.connect(\"popup_hide\", tree, \"set_pause\", [false])\n\tfileDialog.connect(\"hide\", tree, \"set_pause\", [false])\n\tfileDialog.connect(\"about_to_show\", tree, \"set_pause\", [true])\n\tfileDialog.hide()\n\n\tparent.add_child(fileDialog)\n\tfileDialog.set_owner(parent)\n\treturn fileDialog\n","old_contents":"extends Spatial\n\nvar puzzle\nvar puzzleMan\n\nvar gridMan\nvar prevBlock = [] # keeps track of prevous color for pairs by layer\nvar blockColors = preload(\"res:\/\/scripts\/PuzzleManager.gd\").blockColors\nvar id\n\nvar fd\nvar gui = [\n\t[\"status\", Label.new()], # plz keep me as first element, referenced as gui[0] later\n\t[\"save_pzl\", Button.new()],\n\t[\"load_pzl\", Button.new()],\n\t[\"remove_layer\", Button.new()],\n\t[\"random_layer\", Button.new()],\n\t# THESE SHOULD BE Options instead of left, label, right\n\t[\"class_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=[\"LZR\", \"WILD\", \"PAIR\", \"GOAL\"],\n\t\tvalue=\"PAIR\"\n\t}],\n\t[\"color_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=blockColors,\n\t\tvalue=\"Blue\"\n\t}],\n\t[\"action_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=[\"Add\", \"Remove\", \"Replace\"],\n\t\tvalue=\"Add\"\n\t}],\n\t[\"test_pzl\", Button.new()],\n]\nvar action_ix = gui.size() - 1 - 1\nvar color_ix = gui.size() - 1 - 2\nvar class_ix = gui.size() - 1 - 3\n\n# gross style, cannot , but clean enough\nfunc shouldAddNeighbor():\n\treturn gui[action_ix][1].value == \"Add\"\n\nfunc shouldReplaceSelf():\n\treturn gui[action_ix][1].value == \"Replace\"\n\nfunc shouldRemoveSelf():\n\treturn gui[action_ix][1].value == \"Remove\"\n\n# called in AbstractBlock to add a new block\nfunc addBlock(pos):\n\tvar curColor = gui[color_ix][1].value\n\tvar b = puzzleMan.PickledBlock.new() \\\n\t\t.setName(id) \\\n\t\t.setTextureName(curColor) \\\n\t\t.setBlockPos(pos)\n\tvar layer = puzzleMan.calcBlockLayerVec(pos)\n\tid += 1\n\n\t# expand prevblocks index\n\twhile prevBlock.size() <= layer:\n\t\tvar d = {}\n\t\tfor k in blockColors:\n\t\t\td[k] = null\n\t\tprevBlock.append(d)\n\n\tvar pb = prevBlock[layer][curColor]\n\n\tif pb != null:\n\t\tb.setPairName(pb.name)\n\t\tgridMan.get_node(pb.toNode().name).setPairName(b.name)\n\t\tprevBlock[layer][curColor] = null\n\telse:\n\t\t# TODO SUPPORT GLYPHS HERE, SET PAIRWISE GLYPH\n\t\tprevBlock[layer][curColor] = b\n\n\tgui[0][1].set_text(getPrevBlockErrors())\n\tvar block = gridMan.addPickledBlock(b)\n\tvar v = 0.01\n\tblock.set_scale(Vector3(v,v,v))\n\tblock.scaleTweenNode(1, 0.25, Tween.TRANS_QUART).start()\n\treturn b\n\nfunc getPrevBlockErrors():\n\t# hahaha, so bad\n\tvar missing = \"STATUS: \"\n\t# check every layer\n\tfor l in range(prevBlock.size()):\n\t\t# check every color\n\t\tfor k in prevBlock[l].keys():\n\t\t\tvar missed = false\n\t\t\tif prevBlock[l][k] != null:\n\t\t\t\t# one message about the current layer\n\t\t\t\tif not missed:\n\t\t\t\t\tmissing += \" L\" + str(l) + \" \"\n\t\t\t\t\tmissed = true\n\t\t\t\tmissing += k.to_upper() + \" \" # bad way of constructing strings\n\tif missing == \"\":\n\t\tmissing += \"NOMINAL\"\n\treturn missing\n\nfunc changeValue(ix, togg):\n\ttogg.value = togg.values[ix]\n\nfunc _ready():\n\t# lights!\n\tget_tree().get_root().add_child(preload( \"res:\/\/puzzleView.scn\" ).instance())\n\tpuzzle = preload( \"res:\/\/puzzle.scn\" ).instance()\n\tpuzzle.mainPuzzle = false\n\n\t# hide and disable timer\n\tpuzzle.time.on = false;\n\tpuzzle.time.val = ''\n\tprint(puzzle.time)\n\n\tpuzzle.set_as_toplevel(true)\n\tget_tree().get_root().add_child(puzzle)\n\n\tgridMan = puzzle.get_node(\"GridView\/GridMan\")\n\tid = gridMan.shape.size()\n\n\tpuzzleMan = puzzle.puzzleMan\n\n\tset_process_input(true)\n\n\tvar theme = preload(\"res:\/\/themes\/MainTheme.thm\")\n\tinitLoadSaveDialog(self)\n\n\tvar y = 0\n\tfor control in gui:\n\t\ty += 45\n\t\tif control[0].rfind('_toggle') > 0:\n\t\t\tvar togg = control[1]\n\t\t\tvar e = togg.optionButt\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tadd_child(e)\n\n\t\t\t# index of items needed\n\t\t\te.connect(\"item_selected\", self, \"changeValue\", [togg])\n\t\t\tfor i in range(togg.values.size()):\n\t\t\t\te.add_item(togg.values[i], i)\n\t\t\t\t# e.add_icon_item(togg.values[i], i)\n\n\t\telse:\n\t\t\tvar e = control[1]\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tif e extends Button:\n\t\t\t\te.set_text(control[0])\n\t\t\tif control[0] == 'save_pzl' :\n\t\t\t\te.connect('pressed', self, 'showSaveDialog')\n\t\t\tif control[0] == 'load_pzl' :\n\t\t\t\te.connect('pressed', self, 'showLoadDialog')\n\t\t\tif control[0] == 'status':\n\t\t\t\tcontrol[1].set_text('STATUS: NOMINAL')\n\t\t\tadd_child(e)\n\n\nfunc puzzleSave():\n\tprint(\"SAVING TO \", fd.get_current_file() )\n\nfunc puzzleLoad():\n\tprint(\"LOADING FROM \", fd.get_current_file() )\n\nfunc showLoadDialog():\n\tshowSaveDialog(true)\n\nfunc showSaveDialog(loadInstead=false):\n\tif loadInstead:\n\t\tif fd.is_connected(\"confirmed\", self, \"puzzleSave\"):\n\t\t\tfd.disconnect(\"confirmed\", self, \"puzzleSave\")\n\t\tfd.connect(\"confirmed\", self, \"puzzleLoad\")\n\t\tfd.set_mode(FileDialog.MODE_OPEN_FILE)\n\telse:\n\t\tif fd.is_connected(\"confirmed\", self, \"puzzleLoad\"):\n\t\t\tfd.disconnect(\"confirmed\", self, \"puzzleLoad\")\n\t\tfd.connect(\"confirmed\", self, \"puzzleSave\")\n\t\tfd.set_mode(FileDialog.MODE_SAVE_FILE)\n\n\tfd.popup_centered()\n\nfunc initLoadSaveDialog(parent):\n\t# setup text in the file dialog\n\tparent.fd = load(\"res:\/\/fileDialog.scn\").instance()\n\tparent.fd.set_title(\"Select Puzzle Filename\")\n\tparent.fd.set_access(FileDialog.ACCESS_USERDATA)\n\tparent.fd.set_current_dir(\"PuzzleSaves\")\n\tparent.fd.add_filter(\"*.pzl ; Anttris Puzzle\")\n\n\t# MainTheme leaks on bottom\n\tvar dialogTheme = Theme.new()\n\tdialogTheme.copy_default_theme()\n\tparent.fd.set_theme(dialogTheme)\n\n\t# work even if game is paused\n\tparent.fd.set_pause_mode(PAUSE_MODE_PROCESS)\n\n\t# unpause if user cancels\n\tparent.fd.connect(\"popup_hide\", get_tree(), \"set_pause\", [false])\n\tparent.fd.connect(\"hide\", get_tree(), \"set_pause\", [false])\n\tparent.fd.connect(\"about_to_show\", get_tree(), \"set_pause\", [true])\n\tparent.fd.hide()\n\n\tparent.add_child(fd)\n\tfd.set_owner(parent)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"0bdf03fb7fdaaadbea6580a984ed99d871f7c469","subject":"Changed first border to yellow","message":"Changed first border to yellow\n","repos":"P1X-in\/boctok","old_file":"scripts\/space.gd","new_file":"scripts\/space.gd","new_contents":"extends Control\n\nfunc _draw():\n var center = Vector2(5000,5000)\n var radius = 1500\n var angle_from = 0\n var angle_to = 360\n var color = Color(1.0, 1.0, 0.0)\n draw_circle_arc( center, radius, angle_from, angle_to, color )\n color = Color(1.0, 0.0, 0.0)\n draw_circle_arc( center, 2000, angle_from, angle_to, color )\n color = Color(0.34, 0.32, 0.52)\n draw_circle_arc( center, 730, angle_from, angle_to, color )\n draw_circle_arc( center, 610, angle_from, angle_to, color )\n draw_circle_arc( center, 950, angle_from, angle_to, color )\n draw_circle_arc( center, 455, angle_from, angle_to, color )\n draw_circle_arc( center, 1225, angle_from, angle_to, color )\n\nfunc draw_circle_arc( center, radius, angle_from, angle_to, color ):\n var nb_points = 360\n var points_arc = Vector2Array()\n\n for i in range(nb_points+1):\n var angle_point = angle_from + i*(angle_to-angle_from)\/nb_points - 90\n var point = center + Vector2( cos(deg2rad(angle_point)), sin(deg2rad(angle_point)) ) * radius\n points_arc.push_back( point )\n\n for indexPoint in range(nb_points):\n draw_line(points_arc[indexPoint], points_arc[indexPoint+1], color)","old_contents":"extends Control\n\nfunc _draw():\n var center = Vector2(5000,5000)\n var radius = 1500\n var angle_from = 0\n var angle_to = 360\n var color = Color(1.0, 0.0, 0.0)\n draw_circle_arc( center, radius, angle_from, angle_to, color )\n draw_circle_arc( center, 2000, angle_from, angle_to, color )\n color = Color(0.34, 0.32, 0.52)\n draw_circle_arc( center, 730, angle_from, angle_to, color )\n draw_circle_arc( center, 610, angle_from, angle_to, color )\n draw_circle_arc( center, 950, angle_from, angle_to, color )\n draw_circle_arc( center, 455, angle_from, angle_to, color )\n draw_circle_arc( center, 1225, angle_from, angle_to, color )\n\nfunc draw_circle_arc( center, radius, angle_from, angle_to, color ):\n var nb_points = 360\n var points_arc = Vector2Array()\n\n for i in range(nb_points+1):\n var angle_point = angle_from + i*(angle_to-angle_from)\/nb_points - 90\n var point = center + Vector2( cos(deg2rad(angle_point)), sin(deg2rad(angle_point)) ) * radius\n points_arc.push_back( point )\n\n for indexPoint in range(nb_points):\n draw_line(points_arc[indexPoint], points_arc[indexPoint+1], color)","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"88d384369c2633cf9a5d2de69004d662b283bf93","subject":"Refactoring totem script to remove repeation statement and misleading variable name.","message":"Refactoring totem script to remove repeation statement and misleading variable name.\n","repos":"CSaratakij\/jam-2016-remake","old_file":"src\/totems\/totem.gd","new_file":"src\/totems\/totem.gd","new_contents":"\nextends KinematicBody2D\n\nconst GRAVITY = 180\n\nexport var type_id = 0\n\nvar is_active = false\nvar velocity = Vector2()\nvar motion = Vector2()\n\nvar totem_textures = [\n\tpreload(\"res:\/\/totems\/totem1.png\"),\n\tpreload(\"res:\/\/totems\/totem2.png\"),\n\tpreload(\"res:\/\/totems\/totem3.png\")\n\t]\n\nonready var _sprite = get_node(\"Sprite\")\nonready var _collision = get_node(\"CollisionShape2D\")\n\nfunc _ready():\n\tset_fixed_process(true)\n\tset_type(type_id)\n\nfunc _fixed_process(delta):\n\t_collision.set_trigger(not is_active)\n\tif is_active:\n\t\tvelocity.y += GRAVITY * delta\n\t\tmotion = velocity * delta\n\t\tmove(motion)\n\nfunc set_active(active):\n\tis_active = active\n\nfunc set_type(index):\n\ttype_id = index\n\t_sprite.set_texture(totem_textures[ index ])\n\nfunc max_type():\n\treturn totem_textures.size()\n","old_contents":"\nextends KinematicBody2D\n\nconst GRAVITY = 180\n\nexport var type_id = 0\n\nvar is_active = false\nvar velocity = Vector2()\nvar motion = Vector2()\n\nvar totem_sprites = [\n\tpreload(\"res:\/\/totems\/totem1.png\"),\n\tpreload(\"res:\/\/totems\/totem2.png\"),\n\tpreload(\"res:\/\/totems\/totem3.png\")\n\t]\n\nonready var _sprite = get_node(\"Sprite\")\nonready var _collision = get_node(\"CollisionShape2D\")\n\nfunc _ready():\n\tset_fixed_process(true)\n\t_sprite.set_texture(totem_sprites[ type_id ])\n\nfunc _fixed_process(delta):\n\t_collision.set_trigger(not is_active)\n\tif is_active:\n\t\tvelocity.y += GRAVITY * delta\n\t\tmotion = velocity * delta\n\t\tmove(motion)\n\nfunc set_active(active):\n\tis_active = active\n\nfunc set_type(index):\n\ttype_id = index\n\t_sprite.set_texture(totem_sprites[ index ])\n\nfunc max_type():\n\treturn totem_sprites.size()\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"3e9e2079a748b38dfa13626d4d14bd875dae513a","subject":"Fix stall when playing recorded audio","message":"Fix stall when playing recorded audio\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"audio\/mic_record\/MicRecord.gd","new_file":"audio\/mic_record\/MicRecord.gd","new_contents":"extends Control\n\nvar effect\nvar recording\n\nfunc _ready():\n\tvar idx = AudioServer.get_bus_index(\"Record\")\n\teffect = AudioServer.get_bus_effect(idx, 0)\n\n\nfunc _on_RecordButton_pressed():\n\tif effect.is_recording_active():\n\t\trecording = effect.get_recording()\n\t\t$PlayButton.disabled = false\n\t\t$SaveButton.disabled = false\n\t\teffect.set_recording_active(false)\n\t\t$RecordButton.text = \"Record\"\n\t\t$Status.text = \"\"\n\telse:\n\t\t$PlayButton.disabled = true\n\t\t$SaveButton.disabled = true\n\t\teffect.set_recording_active(true)\n\t\t$RecordButton.text = \"Stop\"\n\t\t$Status.text = \"Recording...\"\n\n\nfunc _on_PlayButton_pressed():\n\tprint(recording)\n\tprint(recording.format)\n\tprint(recording.mix_rate)\n\tprint(recording.stereo)\n\tvar data = recording.get_data()\n\tprint(data.size())\n\t$AudioStreamPlayer.stream = recording\n\t$AudioStreamPlayer.play()\n\n\nfunc _on_Play_Music_pressed():\n\tif $AudioStreamPlayer2.playing:\n\t\t$AudioStreamPlayer2.stop()\n\t\t$PlayMusic.text = \"Play Music\"\n\telse:\n\t\t$AudioStreamPlayer2.play()\n\t\t$PlayMusic.text = \"Stop Music\"\n\n\nfunc _on_SaveButton_pressed():\n\tvar save_path = $SaveButton\/Filename.text\n\trecording.save_to_wav(save_path)\n\t$Status.text = \"Saved WAV file to: %s\\n(%s)\" % [save_path, ProjectSettings.globalize_path(save_path)]\n","old_contents":"extends Control\n\nvar effect\nvar recording\n\nfunc _ready():\n\tvar idx = AudioServer.get_bus_index(\"Record\")\n\teffect = AudioServer.get_bus_effect(idx, 0)\n\n\nfunc _on_RecordButton_pressed():\n\tif effect.is_recording_active():\n\t\trecording = effect.get_recording()\n\t\t$PlayButton.disabled = false\n\t\t$SaveButton.disabled = false\n\t\teffect.set_recording_active(false)\n\t\t$RecordButton.text = \"Record\"\n\t\t$Status.text = \"\"\n\telse:\n\t\t$PlayButton.disabled = true\n\t\t$SaveButton.disabled = true\n\t\teffect.set_recording_active(true)\n\t\t$RecordButton.text = \"Stop\"\n\t\t$Status.text = \"Recording...\"\n\n\nfunc _on_PlayButton_pressed():\n\tprint(recording)\n\tprint(recording.format)\n\tprint(recording.mix_rate)\n\tprint(recording.stereo)\n\tvar data = recording.get_data()\n\tprint(data)\n\tprint(data.size())\n\t$AudioStreamPlayer.stream = recording\n\t$AudioStreamPlayer.play()\n\n\nfunc _on_Play_Music_pressed():\n\tif $AudioStreamPlayer2.playing:\n\t\t$AudioStreamPlayer2.stop()\n\t\t$PlayMusic.text = \"Play Music\"\n\telse:\n\t\t$AudioStreamPlayer2.play()\n\t\t$PlayMusic.text = \"Stop Music\"\n\n\nfunc _on_SaveButton_pressed():\n\tvar save_path = $SaveButton\/Filename.text\n\trecording.save_to_wav(save_path)\n\t$Status.text = \"Saved WAV file to: %s\\n(%s)\" % [save_path, ProjectSettings.globalize_path(save_path)]\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"3afde22eac51b2b01cedcb5e7fcbd021384db707","subject":"added timer","message":"added timer\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Puzzle.gd","new_file":"src\/scripts\/Puzzle.gd","new_contents":"extends Spatial\n\n# proposed script manager:\n# var PuzzleManScript = get_node(\"Globals\").get(\"PuzzleManScript\")\n\nvar PuzzleManScript = preload( \"res:\/\/scripts\/PuzzleManager.gd\" )\nvar PuzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar puzzleMan\nvar mainPuzzle = true\n\nvar time = {\n\t\tval = 0.0,\n\t\tlabel = null,\n\t\ttween = null }\n\nfunc addTimer():\n\ttime.label = Label.new()\n\ttime.tween = Tween.new()\n\tadd_child(time.label)\n\tadd_child(time.tween)\n\ttime.label.set_pos(Vector2(15,15))\n\n\ttime.label.set_theme(load(\"res:\/\/themes\/MainTheme.thm\"))\n\ttime.tween.interpolate_method(time.label, \"set_pos\", \\\n\t\t\ttime.label.get_pos(), time.label.get_pos()*2, 0.5, \\\n\t\t\tTween.TRANS_BOUNCE, Tween.EASE_OUT)\n\ttime.tween.start()\n\ttime.label.set_text(str(time.val))\n\nfunc _process(dTime):\n\t# start label tween on\n\ttime.val += dTime\n\ttime.label.set_text(str(time.val))\n\tif fmod(time.val, 3) < 0.1:\n\t\ttime.tween.seek(0.0)\n\n# Called for initialization\nfunc _ready():\n\tset_process(true) # needed for time keeping\n\tpuzzleMan = PuzzleManScript.new()\n\tvar puzzle = puzzleMan.generatePuzzle( 2, puzzleMan.DIFF_EASY )\n\n\tprint(\"Generated \", puzzle.blocks.size(), \" blocks.\" )\n\n\taddTimer()\n\n\t# Place the blocks in the puzzle.\n\tvar gridMan = get_node( \"GridView\/GridMan\" )\n\tgridMan.shape = puzzleMan.shape\n\tgridMan.set_puzzle(puzzle)\n\tfor block in puzzle.blocks:\n\t\t# Create a block node, add it to the tree\n\t\tvar b = block.toNode()\n\t\tgridMan.add_block(b)\n\t\tgridMan.get_child(block.name) \\\n\t\t\t.set_translation(block.blockPos * 2 )\n\n\t# make a new puzzle, embed using Viewport\n\tif mainPuzzle:\n\t\tvar p = PuzzleScn.instance()\n\t\tp.mainPuzzle = false\n\t\tp.set_scale(Vector3(0.5, 0.5, 0.5))\n\t\tp.set_translation(Vector3(20, 0, 0))\n\n\t\tvar v = Viewport.new()\n\t\t# ?\n\t\tv.set_as_render_target(true)\n\n\t\tv.set_world(p.get_world())\n\t\tv.set_rect(Rect2(0, 0, 100, 100))\n\t\tv.set_physics_object_picking(false)\n\t\tv.add_child(p)\n\t\tadd_child(v)\n# child of control? easier input\n\n\n","old_contents":"extends Spatial\n\n# proposed script manager:\n# var PuzzleManScript = get_node(\"Globals\").get(\"PuzzleManScript\")\n\nvar PuzzleManScript = preload( \"res:\/\/scripts\/PuzzleManager.gd\" )\nvar PuzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar puzzleMan\nvar mainPuzzle = true\n\n# Called for initialization\nfunc _ready():\n\tpuzzleMan = PuzzleManScript.new()\n\tvar puzzle = puzzleMan.generatePuzzle( 2, puzzleMan.DIFF_EASY )\n\n\tprint(\"Generated \", puzzle.blocks.size(), \" blocks.\" )\n\n\t# Place the blocks in the puzzle.\n\tvar gridMan = get_node( \"GridView\/GridMan\" )\n\tgridMan.shape = puzzleMan.shape\n\tgridMan.set_puzzle(puzzle)\n\tfor block in puzzle.blocks:\n\t\t# Create a block node, add it to the tree\n\t\tvar b = block.toNode()\n\t\tgridMan.shape[b.blockPos] = b\n\t\tgridMan.add_block(b)\n\t\tgridMan.get_child(block.name) \\\n\t\t\t.set_translation(block.blockPos * 2 )\n\t\n\tif mainPuzzle:\n\t\tvar p = PuzzleScn.instance()\n\t\tp.mainPuzzle = false\n\t\tp.set_scale(Vector3(0.5, 0.5, 0.5))\n\t\tp.set_translation(Vector3(20, 0, 0))\n\t\t\n\t\tvar v = Viewport.new()\n\t\tv.set_as_render_target(true)\n\t\tv.set_world(p.get_world())\n\t\tv.set_rect(Rect2(0, 0, 100, 100))\n\t\tv.set_physics_object_picking(false)\n\t\tv.add_child(p)\n\t\tadd_child(v)\n\t\t\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"0446421934b5152f502e3d665f039a2272e2303e","subject":"fix db","message":"fix db\n","repos":"shelltitan\/captain-holetooth,AlexHolly\/captain-holetooth,shelltitan\/captain-holetooth,AlexHolly\/captain-holetooth","old_file":"src\/game.gd","new_file":"src\/game.gd","new_contents":"extends Node\n\nsignal scores_changed\n\n# Game prefs\nconst SAVE = \"user:\/\/savegame.json\"\nconst MAX_SCORE_PER_ITEM = 0 # 0 is infinity\nconst MAX_ITEMS = 120\n\n# HUD and scoring\nvar score = 0\nvar score_per_item = 1\nvar high_score = 0\nvar items_collected = 0\n\n# Scene related\nvar currentScene = null\nvar opened_scenes = []\n\nvar db = {}\n\nfunc _enter_tree():\n\tset_process_input(true)\n\tload_game()\n\t\nfunc _input(e):\n\tif e.is_action_pressed(\"reload\") && global.debug_mode:\n\t\tscore = 0\n\t\tif db.size():\n\t\t\tdb = {\"high_score\":db[\"high_score\"]} # save only high_score on reload\n\t\telse:\n\t\t\tdb = {\"high_score\": 0}\n\t\tsave_game()\n\t\tload_game()\n\t\temit_signal(\"scores_changed\")\n\t\tget_tree().reload_current_scene()\n\nfunc _exit_tree():\n\tsave_game()\n\nfunc save_key(key, value):\n\tdb[key] = value\n\nfunc load_key(key, default=null):\n\tif db.has(key):\n\t\treturn db[key]\n\telse:\n\t\treturn default\n\t\nfunc load_game():\n\tvar save = File.new()\n\tif !save.file_exists(SAVE):\n\t\tprint(\"No saved game found\")\n\t\treturn\n\n\tvar err = save.open(SAVE,File.READ)\n\tif (err):\n\t\tprint(\"Error opening save file: \" + str(err))\n\t\treturn\n\t\n\tvar text = save.get_as_text()\n\tif text:\n\t\tdb.parse_json(text)\n\t\t\n\titems_collected = load_key(\"items_collected\", 0)\n\thigh_score = load_key(\"high_score\", 0)\n\topened_scenes = load_key(\"opened_scenes\", [])\n\nfunc save_game():\n\tvar save = File.new()\n\tsave.open(SAVE, File.WRITE)\n\tsave.store_string(db.to_json())\n\tprint(\"Game saved to \" + SAVE)\n\t\nfunc remove_save():\n\tvar save = File.new()\n\tsave.open(SAVE, File.WRITE)\n\tsave.store_string(\"\")\n\t\nfunc _notification(what):\n\tif what == MainLoop.NOTIFICATION_WM_QUIT_REQUEST:\n\t\tsave_game()\n\t\tget_tree().quit()\n\t\t\n\t\t\nfunc collect_item():\n\titems_collected += 1\n\tsave_key(\"items_collected\", items_collected)\n\t\n\tscore += score_per_item\n\tif score > high_score:\n\t\tsave_key(\"high_score\", score)\n\t\thigh_score = score\n\n\temit_signal(\"scores_changed\")\n\tif MAX_SCORE_PER_ITEM == 0 || score_per_item <= MAX_SCORE_PER_ITEM:\n\t\tscore_per_item += 1\n\nfunc reset_bonus_score():\n\tscore_per_item = 1\n\nfunc open_scene(name):\n\tif !is_scene_opened(name):\n\t\topened_scenes.append(name)\n\t\tsave_key(\"opened_scenes\", opened_scenes)\n\nfunc is_scene_opened(name):\n\treturn opened_scenes.find(name) >= 0\n\n\n# returns timer you can wait for, eg:\n# yield(game.timer(0.5), \"timeout\") # wait for 0.5 sec\nfunc timer(time):\n\tvar t = Timer.new()\n\tt.set_wait_time(time)\n\tadd_child(t)\n\tt.start()\n\tt.connect(\"timeout\", t, \"queue_free\")\n\treturn t\n","old_contents":"extends Node\n\nsignal scores_changed\n\n# Game prefs\nconst SAVE = \"user:\/\/savegame.json\"\nconst MAX_SCORE_PER_ITEM = 0 # 0 is infinity\nconst MAX_ITEMS = 120\n\n# HUD and scoring\nvar score = 0\nvar score_per_item = 1\nvar high_score = 0\nvar items_collected = 0\n\n# Scene related\nvar currentScene = null\nvar opened_scenes = []\n\nvar db = {}\n\nfunc _enter_tree():\n\tset_process_input(true)\n\tload_game()\n\t\nfunc _input(e):\n\tif e.is_action_pressed(\"reload\") && global.debug_mode:\n\t\tscore = 0\n\t\tdb = {\"high_score\":db[\"high_score\"]} # save only high_score on reload\t\t\n\t\tsave_game()\n\t\tload_game()\n\t\temit_signal(\"scores_changed\")\n\t\tget_tree().reload_current_scene()\n\nfunc _exit_tree():\n\tsave_game()\n\nfunc save_key(key, value):\n\tdb[key] = value\n\nfunc load_key(key, default=null):\n\tif db.has(key):\n\t\treturn db[key]\n\telse:\n\t\treturn default\n\t\nfunc load_game():\n\tvar save = File.new()\n\tif !save.file_exists(SAVE):\n\t\tprint(\"No saved game found\")\n\t\treturn\n\n\tvar err = save.open(SAVE,File.READ)\n\tif (err):\n\t\tprint(\"Error opening save file: \" + str(err))\n\t\treturn\n\t\n\tvar text = save.get_as_text()\n\tif text:\n\t\tdb.parse_json(text)\n\t\t\n\titems_collected = load_key(\"items_collected\", 0)\n\thigh_score = load_key(\"high_score\", 0)\n\topened_scenes = load_key(\"opened_scenes\", [])\n\nfunc save_game():\n\tvar save = File.new()\n\tsave.open(SAVE, File.WRITE)\n\tsave.store_string(db.to_json())\n\tprint(\"Game saved to \" + SAVE)\n\t\nfunc remove_save():\n\tvar save = File.new()\n\tsave.open(SAVE, File.WRITE)\n\tsave.store_string(\"\")\n\t\nfunc _notification(what):\n\tif what == MainLoop.NOTIFICATION_WM_QUIT_REQUEST:\n\t\tsave_game()\n\t\tget_tree().quit()\n\t\t\n\t\t\nfunc collect_item():\n\titems_collected += 1\n\tsave_key(\"items_collected\", items_collected)\n\t\n\tscore += score_per_item\n\tif score > high_score:\n\t\tsave_key(\"high_score\", score)\n\t\thigh_score = score\n\n\temit_signal(\"scores_changed\")\n\tif MAX_SCORE_PER_ITEM == 0 || score_per_item <= MAX_SCORE_PER_ITEM:\n\t\tscore_per_item += 1\n\nfunc reset_bonus_score():\n\tscore_per_item = 1\n\nfunc open_scene(name):\n\tif !is_scene_opened(name):\n\t\topened_scenes.append(name)\n\t\tsave_key(\"opened_scenes\", opened_scenes)\n\nfunc is_scene_opened(name):\n\treturn opened_scenes.find(name) >= 0\n\n\n# returns timer you can wait for, eg:\n# yield(game.timer(0.5), \"timeout\") # wait for 0.5 sec\nfunc timer(time):\n\tvar t = Timer.new()\n\tt.set_wait_time(time)\n\tadd_child(t)\n\tt.start()\n\tt.connect(\"timeout\", t, \"queue_free\")\n\treturn t\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"GDScript"} {"commit":"64bb953c368dd967d4671d566080489b788b7725","subject":"Use XMLParser.is_empty() instead of guessing empty tag","message":"Use XMLParser.is_empty() instead of guessing empty tag\n","repos":"vnen\/xna-rpg-godot,vnen\/xna-rpg-godot","old_file":"project\/addons\/xml_tools\/xml_parser.gd","new_file":"project\/addons\/xml_tools\/xml_parser.gd","new_contents":"# The MIT License (MIT)\n#\n# Copyright (c) 2016 George Marques\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in all\n# copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n# SOFTWARE.\n\n################################################################################\n\n# XMLParser tool. This is a helper to add functions to the built-in XMLParser\n# class. It's meant to help building specific importers for the XNA content\n# files, since they're similar to some extent.\n\ntool\nextends XMLParser\n\n# Move the cursor to the next element node. It can also expect a certain\n# element name.\nfunc next_element(element = null, do_read = true):\n\tvar err = _next(NODE_ELEMENT, do_read)\n\tif err != OK or element == null:\n\t\treturn err\n\tif element != get_node_name():\n\t\treturn ERR_INVALID_DATA\n\treturn OK\n\n# Move the cursor to the next ending element. It can also expect a certain\n# element name.\nfunc next_element_end(element = null):\n\tvar err = _next(NODE_ELEMENT_END)\n\tif err != OK or element == null:\n\t\treturn err\n\tif element != get_node_name():\n\t\treturn ERR_INVALID_DATA\n\treturn OK\n\n# Move the cursor to the next text node.\nfunc next_text():\n\treturn _next(NODE_TEXT)\n\n# Move the cursor to the next ending node.\nfunc next_end(element = null):\n\tvar err = _next(NODE_ELEMENT_END)\n\tif err != OK or element == null:\n\t\treturn err\n\tif element != get_node_name():\n\t\treturn ERR_INVALID_DATA\n\n# Check if the cursor is in an element node. Can check if it's a certain element.\nfunc is_element(element = null):\n\tif get_node_type() != NODE_ELEMENT:\n\t\treturn false\n\tif element == null or get_node_name() == element:\n\t\treturn true\n\treturn false\n\n# Expect the element to end now and have no further content.\n# If the element argument is null, check for the end of any tag.\nfunc expect_end(element = null):\n\tvar err = _skip(false)\n\tif err == OK and get_node_type() != NODE_ELEMENT_END:\n\t\treturn ERR_INVALID_DATA\n\tif element != null and get_node_name() != element:\n\t\treturn ERR_INVALID_DATA\n\treturn err\n\n# Get the content of the next element, with optional tag name.\n# If the element has sub-elements this will return an error code.\nfunc get_element_content(element = null):\n\tvar err = next_element(element)\n\tif err != OK:\n\t\treturn err\n\n\terr = read()\n\tif err != OK:\n\t\treturn err\n\n\tif get_node_type() != NODE_TEXT:\n\t\treturn ERR_INVALID_DATA\n\n\tvar content = get_node_data()\n\n\texpect_end(element)\n\n\treturn content\n\n################################################################################\n# Content Parsers #\n################################################################################\n\n# Parser a Vector2 from a text. Returns an error if the text is invalid.\nfunc parse_vector2(element):\n\tvar content = get_element_content(element)\n\tif typeof(content) == TYPE_INT:\n\t\t# Errored\n\t\treturn content\n\tvar values = content.strip_edges().split_floats(\" \", false)\n\tif values.size() != 2:\n\t\treturn ERR_INVALID_DATA\n\treturn Vector2(values[0], values[1])\n\n# Parse an array of ints from a text\nfunc parse_int_array(element):\n\tvar content = get_element_content(element)\n\tvar values = content.strip_edges().replace(\"\\n\", \" \").replace(\"\\r\", \" \").split(\" \", false)\n\tvar arr = IntArray()\n\tfor val in values:\n\t\tarr.push_back(int(val))\n\treturn arr\n\n# Parse an array of objects with a specific parser for each item.\n# The item parser must be a FuncRef referencing a function that receives a\n# this XMLParser and returns the generated object.\nfunc parse_obj_array(element, item_parser):\n\tif typeof(item_parser) != TYPE_OBJECT or not item_parser extends FuncRef:\n\t\treturn ERR_INVALID_PARAMETER\n\n\tvar err = next_element(element)\n\tif err != OK:\n\t\treturn err\n\n\tif is_empty():\n\t\t# The element is empty, move on\n\t\treturn []\n\n\tvar arr = []\n\n\terr = next_element(\"Item\")\n\tif err != OK:\n\t\treturn err\n\n\twhile true:\n\t\tvar ret = item_parser.call_func(self)\n\t\tif typeof(ret) == TYPE_INT:\n\t\t\t# If it returns an int then it should be an error\n\t\t\treturn ret\n\n\t\tarr.push_back(ret)\n\n\t\t# Go to next item ending\n\t\terr = next_element_end(\"Item\")\n\t\tif err != OK:\n\t\t\treturn err\n\n\t\t# Skip the element ending\n\t\terr = read()\n\t\tif err != OK:\n\t\t\treturn err\n\n\t\t_skip(true)\n\t\tif expect_end(element) == OK:\n\t\t\t# Reached the end of the array\n\t\t\tbreak\n\n\t\t# Check if it's an item\n\t\tvar is_item = is_element(\"Item\")\n\t\tif not is_item:\n\t\t\treturn ERR_INVALID_DATA\n\n\t# Skip the ending element\n\terr = read()\n\tif err != OK:\n\t\treturn err\n\n\treturn arr\n\n################################################################################\n# Inner functions #\n################################################################################\n\n# Inner helper function to move to a next type of node.\nfunc _next(node_type, do_read = true):\n\tvar err = OK\n\tif do_read:\n\t\terr = read()\n\twhile get_node_type() != node_type:\n\t\terr = read()\n\n\t\tif err != OK:\n\t\t\treturn err\n\treturn err\n\n# Skip blank space\nfunc _skip(text=true):\n\tvar err = OK\n\tvar blanks = [NODE_UNKNOWN,NODE_CDATA,NODE_COMMENT]\n\tif text:\n\t\tblanks.push_back(NODE_TEXT)\n\twhile err == OK and get_node_type() in blanks:\n\t\terr = read()\n\treturn err\n","old_contents":"# The MIT License (MIT)\n#\n# Copyright (c) 2016 George Marques\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in all\n# copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n# SOFTWARE.\n\n################################################################################\n\n# XMLParser tool. This is a helper to add functions to the built-in XMLParser\n# class. It's meant to help building specific importers for the XNA content\n# files, since they're similar to some extent.\n\ntool\nextends XMLParser\n\n# Move the cursor to the next element node. It can also expect a certain\n# element name.\nfunc next_element(element = null, do_read = true):\n\tvar err = _next(NODE_ELEMENT, do_read)\n\tif err != OK or element == null:\n\t\treturn err\n\tif element != get_node_name():\n\t\treturn ERR_INVALID_DATA\n\treturn OK\n\n# Move the cursor to the next ending element. It can also expect a certain\n# element name.\nfunc next_element_end(element = null):\n\tvar err = _next(NODE_ELEMENT_END)\n\tif err != OK or element == null:\n\t\treturn err\n\tif element != get_node_name():\n\t\treturn ERR_INVALID_DATA\n\treturn OK\n\n# Move the cursor to the next text node.\nfunc next_text():\n\treturn _next(NODE_TEXT)\n\n# Move the cursor to the next ending node.\nfunc next_end(element = null):\n\tvar err = _next(NODE_ELEMENT_END)\n\tif err != OK or element == null:\n\t\treturn err\n\tif element != get_node_name():\n\t\treturn ERR_INVALID_DATA\n\n# Check if the cursor is in an element node. Can check if it's a certain element.\nfunc is_element(element = null):\n\tif get_node_type() != NODE_ELEMENT:\n\t\treturn false\n\tif element == null or get_node_name() == element:\n\t\treturn true\n\treturn false\n\n# Expect the element to end now and have no further content.\n# If the element argument is null, check for the end of any tag.\nfunc expect_end(element = null):\n\tvar err = _skip(false)\n\tif err == OK and get_node_type() != NODE_ELEMENT_END:\n\t\treturn ERR_INVALID_DATA\n\tif element != null and get_node_name() != element:\n\t\treturn ERR_INVALID_DATA\n\treturn err\n\n# Get the content of the next element, with optional tag name.\n# If the element has sub-elements this will return an error code.\nfunc get_element_content(element = null):\n\tvar err = next_element(element)\n\tif err != OK:\n\t\treturn err\n\n\terr = read()\n\tif err != OK:\n\t\treturn err\n\n\tif get_node_type() != NODE_TEXT:\n\t\treturn ERR_INVALID_DATA\n\n\tvar content = get_node_data()\n\n\texpect_end(element)\n\n\treturn content\n\n################################################################################\n# Content Parsers #\n################################################################################\n\n# Parser a Vector2 from a text. Returns an error if the text is invalid.\nfunc parse_vector2(element):\n\tvar content = get_element_content(element)\n\tif typeof(content) == TYPE_INT:\n\t\t# Errored\n\t\treturn content\n\tvar values = content.strip_edges().split_floats(\" \", false)\n\tif values.size() != 2:\n\t\treturn ERR_INVALID_DATA\n\treturn Vector2(values[0], values[1])\n\n# Parse an array of ints from a text\nfunc parse_int_array(element):\n\tvar content = get_element_content(element)\n\tvar values = content.strip_edges().replace(\"\\n\", \" \").replace(\"\\r\", \" \").split(\" \", false)\n\tvar arr = IntArray()\n\tfor val in values:\n\t\tarr.push_back(int(val))\n\treturn arr\n\n# Parse an array of objects with a specific parser for each item.\n# The item parser must be a FuncRef referencing a function that receives a\n# this XMLParser and returns the generated object.\nfunc parse_obj_array(element, item_parser):\n\tif typeof(item_parser) != TYPE_OBJECT or not item_parser extends FuncRef:\n\t\treturn ERR_INVALID_PARAMETER\n\n\tvar err = next_element(element)\n\tif err != OK:\n\t\treturn err\n\n\tvar arr = []\n\n\t# Save the file offset to go back if needed\n\tvar offset = get_node_offset()\n\terr = next_element(\"Item\")\n\tif err != OK:\n\t\t# Likely the array is empty, but got back first\n\t\tseek(offset)\n\t\treturn arr\n\n\twhile true:\n\t\tvar ret = item_parser.call_func(self)\n\t\tif typeof(ret) == TYPE_INT:\n\t\t\t# If it returns an int then it should be an error\n\t\t\treturn ret\n\n\t\tarr.push_back(ret)\n\n\t\t# Go to next item ending\n\t\terr = next_element_end(\"Item\")\n\t\tif err != OK:\n\t\t\treturn err\n\t\t\n\t\t# Skip the element ending\n\t\terr = read()\n\t\tif err != OK:\n\t\t\treturn err\n\t\t\n\t\t_skip(true)\n\t\tif expect_end(element) == OK:\n\t\t\t# Reached the end of the array\n\t\t\tbreak\n\n\t\t# Check if it's an item\n\t\tvar is_item = is_element(\"Item\")\n\t\tif not is_item:\n\t\t\treturn ERR_INVALID_DATA\n\n\t# Skip the ending element\n\terr = read()\n\tif err != OK:\n\t\treturn err\n\t\n\treturn arr\n\n################################################################################\n# Inner functions #\n################################################################################\n\n# Inner helper function to move to a next type of node.\nfunc _next(node_type, do_read = true):\n\tvar err = OK\n\tif do_read:\n\t\terr = read()\n\twhile get_node_type() != node_type:\n\t\terr = read()\n\n\t\tif err != OK:\n\t\t\treturn err\n\treturn err\n\n# Skip blank space\nfunc _skip(text=true):\n\tvar err = OK\n\tvar blanks = [NODE_UNKNOWN,NODE_CDATA,NODE_COMMENT]\n\tif text:\n\t\tblanks.push_back(NODE_TEXT)\n\twhile err == OK and get_node_type() in blanks:\n\t\terr = read()\n\treturn err\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"10a0aeaf2d22722a1171780c8b15cbaf9e3ab015","subject":"Added exitGame() function in global script","message":"Added exitGame() function in global script\n","repos":"DaddySmash\/GraphicsGame,DaddySmash\/GraphicsGame","old_file":"app\/code\/global.gd","new_file":"app\/code\/global.gd","new_contents":"extends Node\n\n#This is used by global.gd for changing scenes.\nvar current_scene = null\n\n#These need saved to disk.\nvar savedHighScore = null\nvar savedHighTime = null\nvar savedHighDifficulty = null\nvar savedHighName = null\n\n#Time based variables.\nvar eclipseRatio = null\n\n#Player stuff.\nvar playerScore = null\nvar playerTime = null\nvar playerDifficulty = null\nvar playerHealth = null\n#var specialAbilityAmmo\n\nfunc _ready():\n get_scene().set_auto_accept_quit(false)\n loadHighScore()\n playerScore = 0\n savedHighScore = [0, 1, 2]\n savedHighTime = [0, 1, 2]\n savedHighDifficulty = [0, 1, 2]\n savedHighName = [0, 1, 2]\n var root = get_scene().get_root()\n current_scene = root.get_child( root.get_child_count() -1 )\n\nfunc _notification(what):\n if (what==MainLoop.NOTIFICATION_WM_QUIT_REQUEST):\n get_scene().quit() #default behavior\n\nfunc start_round(settings):\n var s = ResourceLoader.load(\"res:\/\/scene\/zombiesGo.xscn\")\n current_scene.queue_free()\n current_scene = s.instance()\n get_scene().get_root().add_child(current_scene)\n #Init settings for round.\n\nfunc end_round():\n var s = ResourceLoader.load(\"res:\/\/scene\/intro.xscn\")\n current_scene.queue_free()\n current_scene = s.instance()\n get_scene().get_root().add_child(current_scene)\n\nfunc sortHighScore():\n #This function is to sort the high scores before a save.\n pass\n\nfunc saveHighScore():\n #This function is to save the high scores.\n var f = File.new()\n var err = f.open_encrypted_with_pass(\"user:\/\/highScores.zombie\", File.WRITE, OS.get_unique_ID())\n if err:\n print(\"SAVE ERROR: \" + str(err))\n else:\n f.store_var(savedHighScore)\n f.store_var(savedHighTime)\n f.store_var(savedHighDifficulty)\n f.store_var(savedHighName)\n f.close()\n\nfunc loadHighScore():\n #this function is to load the high scores for viewing.\n var f = File.new()\n if f.file_exists(\"user:\/\/highScores.zombie\"):\n var err = f.open_encrypted_with_pass(\"user:\/\/highScores.zombie\", File.READ, OS.get_unique_ID())\n if err:\n print(\"LOAD ERROR: \" + str(err))\n else:\n savedHighScore = f.get_var()\n savedHighTime = f.get_var()\n savedHighDifficulty = f.get_var()\n savedHighName = f.get_var()\n else:\n print(\"LOAD ERROR: highScores.zombie does not exist.\")\n f.close()\n\nfunc newHighScore(savedHighScore, savedHighTime, savedHighDifficulty, savedHighName):\n #This needs to called at the end of the game.\n #Check to see if the player is in the top 10 high scores. If so, then add to high score.\n \n sortHighScore()\n \n # Trim any high scores past the tenth entry.\n\nfunc getSavedHighScore():\n return savedHighScore\n\nfunc exitGame():\n\tget_scene().quit()\n\t","old_contents":"extends Node\n\n#This is used by global.gd for changing scenes.\nvar current_scene = null\n\n#These need saved to disk.\nvar savedHighScore = null\nvar savedHighTime = null\nvar savedHighDifficulty = null\nvar savedHighName = null\n\n#Time based variables.\nvar eclipseRatio = null\n\n#Player stuff.\nvar playerScore = null\nvar playerTime = null\nvar playerDifficulty = null\nvar playerHealth = null\n#var specialAbilityAmmo\n\nfunc _ready():\n get_scene().set_auto_accept_quit(false)\n loadHighScore()\n playerScore = 0\n savedHighScore = [0, 1, 2]\n savedHighTime = [0, 1, 2]\n savedHighDifficulty = [0, 1, 2]\n savedHighName = [0, 1, 2]\n var root = get_scene().get_root()\n current_scene = root.get_child( root.get_child_count() -1 )\n\nfunc _notification(what):\n if (what==MainLoop.NOTIFICATION_WM_QUIT_REQUEST):\n get_scene().quit() #default behavior\n\nfunc start_round(settings):\n var s = ResourceLoader.load(\"res:\/\/scene\/zombiesGo.xscn\")\n current_scene.queue_free()\n current_scene = s.instance()\n get_scene().get_root().add_child(current_scene)\n #Init settings for round.\n\nfunc end_round():\n var s = ResourceLoader.load(\"res:\/\/scene\/intro.xscn\")\n current_scene.queue_free()\n current_scene = s.instance()\n get_scene().get_root().add_child(current_scene)\n\nfunc sortHighScore():\n #This function is to sort the high scores before a save.\n pass\n\nfunc saveHighScore():\n #This function is to save the high scores.\n var f = File.new()\n var err = f.open_encrypted_with_pass(\"user:\/\/highScores.zombie\", File.WRITE, OS.get_unique_ID())\n if err:\n print(\"SAVE ERROR: \" + str(err))\n else:\n f.store_var(savedHighScore)\n f.store_var(savedHighTime)\n f.store_var(savedHighDifficulty)\n f.store_var(savedHighName)\n f.close()\n\nfunc loadHighScore():\n #this function is to load the high scores for viewing.\n var f = File.new()\n if f.file_exists(\"user:\/\/highScores.zombie\"):\n var err = f.open_encrypted_with_pass(\"user:\/\/highScores.zombie\", File.READ, OS.get_unique_ID())\n if err:\n print(\"LOAD ERROR: \" + str(err))\n else:\n savedHighScore = f.get_var()\n savedHighTime = f.get_var()\n savedHighDifficulty = f.get_var()\n savedHighName = f.get_var()\n else:\n print(\"LOAD ERROR: highScores.zombie does not exist.\")\n f.close()\n\nfunc newHighScore(savedHighScore, savedHighTime, savedHighDifficulty, savedHighName):\n #This needs to called at the end of the game.\n #Check to see if the player is in the top 10 high scores. If so, then add to high score.\n \n sortHighScore()\n \n # Trim any high scores past the tenth entry.\n\nfunc getSavedHighScore():\n return savedHighScore\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"cf7e4b31f4fbee912533e099a8d8ec1f124f1883","subject":"Small improvement for Bullet Shower Demo","message":"Small improvement for Bullet Shower Demo\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"2d\/bullet_shower\/bullets.gd","new_file":"2d\/bullet_shower\/bullets.gd","new_contents":"extends Node2D\n# This demo is an example of controling a high number of 2D objects with logic\n# and collision without using nodes in the scene. This technique is a lot more\n# efficient than using instancing and nodes, but requires more programming and\n# is less visual. Bullets are managed together in the `bullets.gd` script.\n\nconst BULLET_COUNT = 500\nconst SPEED_MIN = 20\nconst SPEED_MAX = 80\n\nconst bullet_image = preload(\"res:\/\/bullet.png\")\n\nvar bullets = []\nvar shape\n\n\nclass Bullet:\n\tvar position = Vector2()\n\tvar speed = 1.0\n\t# The body is stored as a RID, which is an \"opaque\" way to access resources.\n\t# With large amounts of objects (thousands or more), it can be significantly\n\t# faster to use RIDs compared to a high-level approach.\n\tvar body = RID()\n\n\nfunc _ready():\n\trandomize()\n\n\tshape = Physics2DServer.circle_shape_create()\n\t# Set the collision shape's radius for each bullet in pixels.\n\tPhysics2DServer.shape_set_data(shape, 8)\n\n\tfor _i in BULLET_COUNT:\n\t\tvar bullet = Bullet.new()\n\t\t# Give each bullet its own speed.\n\t\tbullet.speed = rand_range(SPEED_MIN, SPEED_MAX)\n\t\tbullet.body = Physics2DServer.body_create()\n\n\t\tPhysics2DServer.body_set_space(bullet.body, get_world_2d().get_space())\n\t\tPhysics2DServer.body_add_shape(bullet.body, shape)\n\n\t\t# Place bullets randomly on the viewport and move bullets outside the\n\t\t# play area so that they fade in nicely.\n\t\tbullet.position = Vector2(\n\t\t\trand_range(0, get_viewport_rect().size.x) + get_viewport_rect().size.x,\n\t\t\trand_range(0, get_viewport_rect().size.y)\n\t\t)\n\t\tvar transform2d = Transform2D()\n\t\ttransform2d.origin = bullet.position\n\t\tPhysics2DServer.body_set_state(bullet.body, Physics2DServer.BODY_STATE_TRANSFORM, transform2d)\n\n\t\tbullets.push_back(bullet)\n\n\nfunc _process(_delta):\n\t# Order the CanvasItem to update every frame.\n\tupdate()\n\n\nfunc _physics_process(delta):\n\tvar transform2d = Transform2D()\n\tvar offset = get_viewport_rect().size.x + 16\n\tfor bullet in bullets:\n\t\tbullet.position.x -= bullet.speed * delta\n\n\t\tif bullet.position.x < -16:\n\t\t\t# The bullet has left the screen; move it back to the right.\n\t\t\tbullet.position.x = offset\n\n\t\ttransform2d.origin = bullet.position\n\n\t\tPhysics2DServer.body_set_state(bullet.body, Physics2DServer.BODY_STATE_TRANSFORM, transform2d)\n\n\n# Instead of drawing each bullet individually in a script attached to each bullet,\n# we are drawing *all* the bullets at once here.\nfunc _draw():\n\tvar offset = -bullet_image.get_size() * 0.5\n\tfor bullet in bullets:\n\t\tdraw_texture(bullet_image, bullet.position + offset)\n\n\n# Perform cleanup operations (required to exit without error messages in the console).\nfunc _exit_tree():\n\tfor bullet in bullets:\n\t\tPhysics2DServer.free_rid(bullet.body)\n\n\tPhysics2DServer.free_rid(shape)\n\tbullets.clear()\n","old_contents":"extends Node2D\n# This demo is an example of controling a high number of 2D objects with logic\n# and collision without using nodes in the scene. This technique is a lot more\n# efficient than using instancing and nodes, but requires more programming and\n# is less visual. Bullets are managed together in the `bullets.gd` script.\n\nconst BULLET_COUNT = 500\nconst SPEED_MIN = 20\nconst SPEED_MAX = 80\n\nconst bullet_image = preload(\"res:\/\/bullet.png\")\n\nvar bullets = []\nvar shape\n\n\nclass Bullet:\n\tvar position = Vector2()\n\tvar speed = 1.0\n\t# The body is stored as a RID, which is an \"opaque\" way to access resources.\n\t# With large amounts of objects (thousands or more), it can be significantly\n\t# faster to use RIDs compared to a high-level approach.\n\tvar body = RID()\n\n\nfunc _ready():\n\trandomize()\n\n\tshape = Physics2DServer.circle_shape_create()\n\t# Set the collision shape's radius for each bullet in pixels.\n\tPhysics2DServer.shape_set_data(shape, 8)\n\n\tfor _i in BULLET_COUNT:\n\t\tvar bullet = Bullet.new()\n\t\t# Give each bullet its own speed.\n\t\tbullet.speed = rand_range(SPEED_MIN, SPEED_MAX)\n\t\tbullet.body = Physics2DServer.body_create()\n\n\t\tPhysics2DServer.body_set_space(bullet.body, get_world_2d().get_space())\n\t\tPhysics2DServer.body_add_shape(bullet.body, shape)\n\n\t\t# Place bullets randomly on the viewport and move bullets outside the\n\t\t# play area so that they fade in nicely.\n\t\tbullet.position = Vector2(\n\t\t\trand_range(0, get_viewport_rect().size.x) + get_viewport_rect().size.x,\n\t\t\trand_range(0, get_viewport_rect().size.y)\n\t\t)\n\t\tvar transform2d = Transform2D()\n\t\ttransform2d.origin = bullet.position\n\t\tPhysics2DServer.body_set_state(bullet.body, Physics2DServer.BODY_STATE_TRANSFORM, transform2d)\n\n\t\tbullets.push_back(bullet)\n\n\nfunc _process(delta):\n\tvar transform2d = Transform2D()\n\tfor bullet in bullets:\n\t\tbullet.position.x -= bullet.speed * delta\n\n\t\tif bullet.position.x < -16:\n\t\t\t# The bullet has left the screen; move it back to the right.\n\t\t\tbullet.position.x = get_viewport_rect().size.x + 16\n\n\t\ttransform2d.origin = bullet.position\n\n\t\tPhysics2DServer.body_set_state(bullet.body, Physics2DServer.BODY_STATE_TRANSFORM, transform2d)\n\n\t# Order the CanvasItem to update since bullets are moving every frame.\n\tupdate()\n\n\n# Instead of drawing each bullet individually in a script attached to each bullet,\n# we are drawing *all* the bullets at once here.\nfunc _draw():\n\tvar offset = -bullet_image.get_size() * 0.5\n\tfor bullet in bullets:\n\t\tdraw_texture(bullet_image, bullet.position + offset)\n\n\n# Perform cleanup operations (required to exit without error messages in the console).\nfunc _exit_tree():\n\tfor bullet in bullets:\n\t\tPhysics2DServer.free_rid(bullet.body)\n\n\tPhysics2DServer.free_rid(shape)\n\tbullets.clear()\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"8e297c27e06585ec89c04418e0945805798aa0e4","subject":"color selection works. error messages now detect missing colors","message":"color selection works. error messages now detect missing colors\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Editor.gd","new_file":"src\/scripts\/Editor.gd","new_contents":"extends Spatial\n\nvar puzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar puzzle\nvar puzzleMan\n\nvar gridMan\nvar prevBlockByColor = {} # keeps track of prevous color for pairs\nvar blockColors = preload(\"res:\/\/scripts\/PuzzleManager.gd\").blockColors\n\nvar fileDialog = load(\"res:\/\/fileDialog.scn\").instance()\nvar gui = [\n\t[\"status\", Label.new()], # plz keep me as first element, referenced as gui[0] later\n\t[\"save_pzl\", Button.new()],\n\t[\"load_pzl\", Button.new()],\n\t[\"remove_layer\", Button.new()],\n\t[\"random_layer\", Button.new()],\n\t# THESE SHOULD BE Options instead of left, label, right\n\t[\"class_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=[\"LZR\", \"WILD\", \"PAIR\", \"GOAL\"],\n\t\tvalue=\"PAIR\"\n\t}],\n\t[\"color_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=blockColors,\n\t\tvalue=\"Blue\"\n\t}],\n\t[\"action_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=[\"Add\", \"Remove\", \"Replace\"],\n\t\tvalue=\"Add\"\n\t}],\n\t[\"test_pzl\", Button.new()],\n]\nvar action_ix = gui.size() - 1 - 1\nvar color_ix = gui.size() - 1 - 2\nvar class_ix = gui.size() - 1 - 3\n\n# gross style, cannot , but clean enough\nfunc shouldAddNeighbor():\n\treturn gui[action_ix][1].value == \"Add\"\n\nfunc shouldReplaceSelf():\n\treturn gui[action_ix][1].value == \"Replace\"\n\nfunc shouldRemoveSelf():\n\treturn gui[action_ix][1].value == \"Remove\"\n\nfunc newPickledBlock():\n\tvar curColor = gui[color_ix][1].value\n\tvar b = puzzleMan.PickledBlock.new() \\\n\t\t.setName(gridMan.shape.keys().size()) \\\n\t\t.setTextureName(curColor)\n\tvar pb = prevBlockByColor[curColor]\n\t\t\n\tif pb != null:\n\t\tb.setPairName(pb.name)\n\t\tgridMan.get_node(pb.toNode().name).setPairName(b.name)\n\t\tprevBlockByColor[curColor] = null\n\t\tgui[0][1].set_text(\"STATUS: NOMINAL\")\n\telse:\n\t\t# TODO SUPPORT GLYPHS HERE, SET PAIRWISE GLYPH\n\t\tprevBlockByColor[curColor] = b\n\t\tvar missing = \"\"\n\t\tfor k in prevBlockByColor.keys():\n\t\t\tif prevBlockByColor[k] != null:\n\t\t\t\tmissing += k.to_upper() + \" \" # bad way of constructing strings\n\t\tgui[0][1].set_text(\"STATUS: ERROR, ADD PAIR \" + missing)\n\treturn b\n\nfunc showFileDialog(loadInstead=false):\n\tget_tree().set_pause(true)\n\n\tif loadInstead:\n\t\tfileDialog.connect(\"confirmed\", self, \"puzzleLoad\")\n\t\tfileDialog.set_mode(FileDialog.MODE_OPEN_FILE)\n\telse:\n\t\tfileDialog.connect(\"confirmed\", self, \"puzzleSave\")\n\t\tfileDialog.set_mode(FileDialog.MODE_SAVE_FILE)\n\n\tfileDialog.popup_centered()\n\nfunc puzzleSave():\n\tprint(\"SAVING TO \", fileDialog.get_current_file() )\n\tget_tree().set_pause(false)\n\nfunc puzzleLoad():\n\tprint(\"LOADING FROM \", fileDialog.get_current_file() )\n\tget_tree().set_pause(false)\n\nfunc changeValue(ix, togg):\n\ttogg.value = togg.values[ix]\n\nfunc _ready():\n\tfor k in blockColors:\n\t\tprevBlockByColor[k] = null\n\n\tpuzzle = puzzleScn.instance()\n\tgridMan = puzzle.get_node(\"GridView\/GridMan\")\n\tpuzzle.mainPuzzle = false\n\n\t# hide and disable timer\n\tpuzzle.time.on = false;\n\tpuzzle.time.val = ''\n\n\tpuzzle.set_as_toplevel(true)\n\n\tadd_child(puzzle)\n\n\tprint(puzzle.get_tree() == get_tree())\n\tpuzzleMan = puzzle.puzzleMan\n\n\tset_process_input(true)\n\n\tvar theme = preload(\"res:\/\/themes\/MainTheme.thm\")\n\n\n\tfileDialog.set_title(\"Select Puzzle Filename\")\n\tfileDialog.set_access(FileDialog.ACCESS_USERDATA)\n\tfileDialog.set_current_dir(\"PuzzleSaves\")\n\tfileDialog.add_filter(\"*.pzl ; Anttris Puzzle\")\n\n\t# MainTheme leaks on bottom\n\tvar dialogTheme = Theme.new()\n\tdialogTheme.copy_default_theme()\n\tfileDialog.set_theme(dialogTheme)\n\n\t# work even if game is paused\n\tfileDialog.set_pause_mode(PAUSE_MODE_PROCESS)\n\n\t# unpause if user cancels\n\tfileDialog.connect(\"popup_hide\", get_tree(), \"set_pause\", [false])\n\tfileDialog.hide()\n\tadd_child(fileDialog)\n\n\tvar y = 0\n\tfor control in gui:\n\t\ty += 45\n\t\tif control[0].rfind('_toggle') > 0:\n\t\t\tvar togg = control[1]\n\t\t\tvar e = togg.optionButt\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tadd_child(e)\n\n\t\t\t# index of items needed\n\t\t\tfor i in range(togg.values.size()):\n\t\t\t\te.add_item(togg.values[i], i)\n\t\t\t\te.connect(\"item_selected\", self, \"changeValue\", [togg])\n\t\t\t\t# e.add_icon_item(togg.values[i], i)\n\n\t\telse:\n\t\t\tvar e = control[1]\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tif e extends Button:\n\t\t\t\te.set_text(control[0])\n\t\t\tif control[0] == 'save_pzl' :\n\t\t\t\te.connect('pressed', self, 'showFileDialog')\n\t\t\tif control[0] == 'load_pzl' :\n\t\t\t\te.connect('pressed', self, 'showFileDialog', [true])\n\t\t\tif control[0] == 'status':\n\t\t\t\tcontrol[1].set_text('STATUS: NOMINAL')\n\t\t\tadd_child(e)\n\n\n","old_contents":"extends Spatial\n\nvar puzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar puzzle\nvar puzzleMan\n\nvar gridMan\nvar prevBlock = null\n\nvar fileDialog = load(\"res:\/\/fileDialog.scn\").instance()\nvar gui = [\n\t[\"status\", Label.new()], # plz keep me as first element, referenced as gui[0] later\n\t[\"save_pzl\", Button.new()],\n\t[\"load_pzl\", Button.new()],\n\t[\"remove_layer\", Button.new()],\n\t[\"random_layer\", Button.new()],\n\t# THESE SHOULD BE Options instead of left, label, right\n\t[\"class_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=[\"LZR\", \"WILD\", \"PAIR\", \"GOAL\"],\n\t\tvalue=\"PAIR\"\n\t}],\n\t[\"color_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=preload(\"res:\/\/scripts\/PuzzleManager.gd\").blockColors,\n\t\tvalue=\"Red\"\n\t}],\n\t[\"action_toggle\", {\n\t\toptionButt=OptionButton.new(),\n\t\tvalues=[\"Add\", \"Remove\", \"Replace\"],\n\t\tvalue=\"Add\"\n\t}],\n\t[\"test_pzl\", Button.new()],\n]\nvar action_ix = gui.size() - 1 - 1\nvar color_ix = gui.size() - 1 - 2\nvar class_ix = gui.size() - 1 - 3\n\nfunc shouldAddNeighbor():\n\treturn gui[action_ix][1].value == \"Add\"\n\nfunc shouldReplaceSelf():\n\treturn gui[action_ix][1].value == \"Replace\"\n\nfunc shouldRemoveSelf():\n\treturn gui[action_ix][1].value == \"Remove\"\n\nfunc newPickledBlock():\n\tvar b = puzzleMan.PickledBlock.new()\\\n\t\t.setName(gridMan.shape.keys().size())\\\n\tif prevBlock != null:\n\t\tb.setPairName(prevBlock.name)\n\t\tgridMan.get_node(prevBlock.toNode().name).setPairName(b.name)\n\t\tprevBlock = null\n\t\tgui[0][1].set_text(\"STATUS: ERROR, ADD PAIR\")\n\telse:\n\t\tprevBlock = b\n\t\tgui[0][1].set_text(\"STATUS: NOMINAL\")\n\treturn b\n\nfunc showFileDialog(loadInstead=false):\n\tget_tree().set_pause(true)\n\n\tif loadInstead:\n\t\tfileDialog.connect(\"confirmed\", self, \"puzzleLoad\")\n\t\tfileDialog.set_mode(FileDialog.MODE_OPEN_FILE)\n\telse:\n\t\tfileDialog.connect(\"confirmed\", self, \"puzzleSave\")\n\t\tfileDialog.set_mode(FileDialog.MODE_SAVE_FILE)\n\n\tfileDialog.popup_centered()\n\nfunc puzzleSave():\n\tprint(\"SAVING TO \", fileDialog.get_current_file() )\n\tget_tree().set_pause(false)\n\nfunc puzzleLoad():\n\tprint(\"LOADING FROM \", fileDialog.get_current_file() )\n\tget_tree().set_pause(false)\n\nfunc changeValue(ix, togg):\n\ttogg.value = togg.values[ix]\n\nfunc _ready():\n\tpuzzle = puzzleScn.instance()\n\tgridMan = puzzle.get_node(\"GridView\/GridMan\")\n\tpuzzle.mainPuzzle = false\n\n\t# hide and disable timer\n\tpuzzle.time.on = false;\n\tpuzzle.time.val = ''\n\n\tpuzzle.set_as_toplevel(true)\n\n\tadd_child(puzzle)\n\n\tprint(puzzle.get_tree() == get_tree())\n\tpuzzleMan = puzzle.puzzleMan\n\n\tset_process_input(true)\n\n\tvar theme = preload(\"res:\/\/themes\/MainTheme.thm\")\n\n\n\tfileDialog.set_title(\"Select Puzzle Filename\")\n\tfileDialog.set_access(FileDialog.ACCESS_USERDATA)\n\tfileDialog.set_current_dir(\"PuzzleSaves\")\n\tfileDialog.add_filter(\"*.pzl ; Anttris Puzzle\")\n\n\t# MainTheme leaks on bottom\n\tvar dialogTheme = Theme.new()\n\tdialogTheme.copy_default_theme()\n\tfileDialog.set_theme(dialogTheme)\n\n\t# work even if game is paused\n\tfileDialog.set_pause_mode(PAUSE_MODE_PROCESS)\n\n\t# unpause if user cancels\n\tfileDialog.connect(\"popup_hide\", get_tree(), \"set_pause\", [false])\n\tfileDialog.hide()\n\tadd_child(fileDialog)\n\n\tvar y = 0\n\tfor control in gui:\n\t\ty += 45\n\t\tif control[0].rfind('_toggle') > 0:\n\t\t\tvar togg = control[1]\n\t\t\tvar e = togg.optionButt\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tadd_child(e)\n\n\t\t\t# index of items needed\n\t\t\tfor i in range(togg.values.size()):\n\t\t\t\te.add_item(togg.values[i], i)\n\t\t\t\te.connect(\"item_selected\", self, \"changeValue\", [togg])\n\t\t\t\t# e.add_icon_item(togg.values[i], i)\n\n\t\telse:\n\t\t\tvar e = control[1]\n\t\t\te.set_pos(Vector2(10, y))\n\t\t\te.set_theme(theme)\n\t\t\tif e extends Button:\n\t\t\t\te.set_text(control[0])\n\t\t\tif control[0] == 'save_pzl' :\n\t\t\t\te.connect('pressed', self, 'showFileDialog')\n\t\t\tif control[0] == 'load_pzl' :\n\t\t\t\te.connect('pressed', self, 'showFileDialog', [true])\n\t\t\tif control[0] == 'status':\n\t\t\t\tcontrol[1].set_text('STATUS: NOMINAL')\n\t\t\tadd_child(e)\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"697f572c550f557dc8f47e2b6c06d47b6c728c9a","subject":"Add responsive sizing implementation","message":"Add responsive sizing implementation\n","repos":"ruipsrosario\/godot-responsive-control","old_file":"source\/addons\/responsive_controls\/ResponsiveSizing.gd","new_file":"source\/addons\/responsive_controls\/ResponsiveSizing.gd","new_contents":"tool\nextends Control\n\n# Minimum size the parent Control must have in order to trigger this Responsive Sizing\nexport(Vector2) var minimumParentSize\n\n# Whether or not this Responsive Sizing is visible in the set size\nexport(bool) var isVisible\n\n# Checks if this Responsive Sizing is eligible under the specified size\nfunc isEligible(size):\n\treturn size.width >= minimumParentSize.width && size.height >= minimumParentSize.height\n\n# Applies this Responsive Sizing to the specified Control\nfunc applyTo(control):\n\tcontrol.set_h_size_flags(get_h_size_flags())\n\tcontrol.set_v_size_flags(get_v_size_flags())\n\tcontrol.set_scale(get_scale())\n\tfor margin in [ MARGIN_BOTTOM, MARGIN_TOP, MARGIN_RIGHT, MARGIN_LEFT ]:\n\t\tcontrol.set_anchor(margin, get_anchor(margin))\n\t\tcontrol.set_margin(margin, get_marginr(margin))\n","old_contents":"tool\nextends Control\n\nfunc _ready():\n\tpass\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"aeeb2a08bcf3ab61394957763fd56780264a1e1f","subject":"mainPuzzle off by default. seed random number gen. save puzzles by seed into SavedPuzzles\/. GridMan in charge of its own shape.","message":"mainPuzzle off by default. seed random number gen. save puzzles by seed into SavedPuzzles\/. GridMan in charge of its own shape.\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Puzzle.gd","new_file":"src\/scripts\/Puzzle.gd","new_contents":"# Provides functionality for the puzzle itself\n\nextends Spatial\n\nvar DataMan = preload( \"res:\/\/scripts\/DataManager.gd\" ).new()\nvar PuzzleManScript = preload( \"res:\/\/scripts\/PuzzleManager.gd\" )\nvar PuzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar puzzleMan\nvar seed\nvar otherPuzzle\nvar mainPuzzle = false\n\nvar time = {\n\t\ton = true,\n\t\tval = 0.0,\n\t\tlabel = Label.new(),\n\t\ttween = Tween.new() }\n\nfunc addTimer():\n\tadd_child(time.label)\n\tadd_child(time.tween)\n\ttime.label.set_pos(Vector2(15,15))\n\n\ttime.label.set_theme(load(\"res:\/\/themes\/MainTheme.thm\"))\n\ttime.tween.interpolate_method(time.label, \"set_pos\", \\\n\t\t\ttime.label.get_pos(), time.label.get_pos()*2, 0.5, \\\n\t\t\tTween.TRANS_BOUNCE, Tween.EASE_OUT)\n\ttime.tween.start()\n\ttime.label.set_text(str(time.val))\n\nfunc formatTime(t):\n\tvar mins = floor(t \/ 60)\n\tvar secs = fmod(floor(t), 60)\n\tvar millis = floor((t - floor(t)) * 1000)\n\treturn str(mins) + \":\" + str(secs).pad_zeros(2) + \":\" + str(millis).pad_zeros(3)\n\nfunc _process(dTime):\n\t# start label tween on\n\ttime.val += dTime\n\ttime.label.set_text(formatTime(time.val))\n\tif fmod(time.val, 10) < 0.1:\n\t\ttime.tween.seek(0.0)\n\n# Called for initialization\nfunc _ready():\n\tseed = OS.get_unix_time() # unix time\n\tseed *= OS.get_ticks_msec() # initial time\n\tseed *= 1 + OS.get_time().second\n\tseed *= 1 + OS.get_date().weekday\n\tseed = abs(seed) % 7919 # 1000th prime\n\n\tif time.on:\n\t\tset_process(true) # needed for time keeping\n\n\t# generate puzzle\n\tpuzzleMan = PuzzleManScript.new()\n\tvar puzzle = puzzleMan.generatePuzzle( 1, puzzleMan.DIFF_EASY )\n\tpuzzle.puzzleMan = puzzleMan\n\n\t#set up network stuffs\n\tadd_child(load(\"res:\/\/networkProxy.scn\").instance())\n\tvar Network = Globals.get(\"Network\")\n\tif Network != null:\n\t\tNetwork.proxy.set_process(Network.isClient or Network.isHost)\n\n\tprint(\"Generated \", puzzle.blocks.size(), \" blocks.\" )\n\n\tprint( \"Saving seed \" + str(seed) + \"...\" )\n\tDataMan.savePuzzle( \"SavedPuzzles\/RandomPuzzle\" + str(seed) + \".pzl\", puzzle )\n\n\tpuzzle = 0\n\n\tpuzzle = DataMan.loadPuzzle( \"SavedPuzzles\/RandomPuzzle\" + str(seed) + \".pzl\" )\n\n\tvar steps = puzzle.solvePuzzleSteps()\n\tprint( \"PUZZLE IS SOLVEABLE?: \", steps.solveable )\n\n\taddTimer()\n\n\t# Place the blocks in the puzzle.\n\tvar gridMan = get_node( \"GridView\/GridMan\" )\n\tgridMan.set_puzzle(puzzle)\n\n\t# make a new puzzle, embed using Viewport\n\tif mainPuzzle:\n\t\tvar p = PuzzleScn.instance()\n\t\t#p.remove_and_delete_child(p.get_node(\"Lights\"))\n\t\t#.remove_and_delete_child(p.get_node(\"Camera\"))\n\t\tp.get_node(\"GridView\").active = false\n\t\tp.mainPuzzle = false\n\t\tp.set_scale(Vector3(0.5, 0.5, 0.5))\n\t\tp.set_translation(Vector3(10, 5, -20))\n\n\t\tvar v = Viewport.new()\n\t\tvar c = Control.new()\n\n\t\tv.set_world(p.get_world())\n\t\tv.set_rect(Rect2(0, 0, 100, 100))\n\t\tv.set_physics_object_picking(false)\n\t\tget_tree().get_root().get_node( \"Spatial\" ).get_node( \"Camera\" ).add_child(p)\n\t\tv.add_child(p)\n\t\tadd_child(c)\n\t\tc.add_child(v)\n\t\totherPuzzle = p #for use with network\n# child of control? easier input\n\n\n","old_contents":"# Provides functionality for the puzzle itself\n\nextends Spatial\n\nvar DataMan = preload( \"res:\/\/scripts\/DataManager.gd\" ).new()\nvar PuzzleManScript = preload( \"res:\/\/scripts\/PuzzleManager.gd\" )\nvar PuzzleScn = preload(\"res:\/\/puzzle.scn\")\nvar puzzleMan\nvar otherPuzzle\nvar mainPuzzle = true\n\nvar time = {\n\t\ton = true,\n\t\tval = 0.0,\n\t\tlabel = Label.new(),\n\t\ttween = Tween.new() }\n\nfunc addTimer():\n\tadd_child(time.label)\n\tadd_child(time.tween)\n\ttime.label.set_pos(Vector2(15,15))\n\n\ttime.label.set_theme(load(\"res:\/\/themes\/MainTheme.thm\"))\n\ttime.tween.interpolate_method(time.label, \"set_pos\", \\\n\t\t\ttime.label.get_pos(), time.label.get_pos()*2, 0.5, \\\n\t\t\tTween.TRANS_BOUNCE, Tween.EASE_OUT)\n\ttime.tween.start()\n\ttime.label.set_text(str(time.val))\n\nfunc formatTime(t):\n\tvar mins = floor(t \/ 60)\n\tvar secs = fmod(floor(t), 60)\n\tvar millis = floor((t - floor(t)) * 1000)\n\treturn str(mins) + \":\" + str(secs).pad_zeros(2) + \":\" + str(millis).pad_zeros(3)\n\nfunc _process(dTime):\n\t# start label tween on\n\ttime.val += dTime\n\ttime.label.set_text(formatTime(time.val))\n\tif fmod(time.val, 10) < 0.1:\n\t\ttime.tween.seek(0.0)\n\n# Called for initialization\nfunc _ready():\n\tif time.on:\n\t\tset_process(true) # needed for time keeping\n\tpuzzleMan = PuzzleManScript.new()\n\tvar puzzle = puzzleMan.generatePuzzle( 2, puzzleMan.DIFF_EASY )\n\tpuzzle.puzzleMan = puzzleMan\n\t\n\t#set up network stuffs\n\tadd_child(load(\"res:\/\/networkProxy.scn\").instance())\n\tvar Network = Globals.get(\"Network\")\n\tif Network != null:\n\t\tNetwork.proxy.set_process(Network.isClient or Network.isHost)\n\n\tprint(\"Generated \", puzzle.blocks.size(), \" blocks.\" )\n\n\tprint( \"Saving...\" )\n\tDataMan.savePuzzle( \"TestPuzzle.pzl\", puzzle )\n\n\tpuzzle = 0\n\n\tpuzzle = DataMan.loadPuzzle( \"TestPuzzle.pzl\" )\n\n\tvar steps = puzzle.solvePuzzleSteps()\n\tprint( \"PUZZLE IS SOLVEABLE?: \", steps.solveable )\n\n\taddTimer()\n\n\t# Place the blocks in the puzzle.\n\tvar gridMan = get_node( \"GridView\/GridMan\" )\n\tgridMan.shape = puzzleMan.shape\n\tgridMan.set_puzzle(puzzle)\n\n\t# make a new puzzle, embed using Viewport\n\tif mainPuzzle:\n\t\tvar p = PuzzleScn.instance()\n\t\t#p.remove_and_delete_child(p.get_node(\"Lights\"))\n\t\t#.remove_and_delete_child(p.get_node(\"Camera\"))\n\t\tp.get_node(\"GridView\").active = false\n\t\tp.mainPuzzle = false\n\t\tp.set_scale(Vector3(0.5, 0.5, 0.5))\n\t\tp.set_translation(Vector3(10, 5, -20))\n\n\t\tvar v = Viewport.new()\n\t\tvar c = Control.new()\n\n\t\tv.set_world(p.get_world())\n\t\tv.set_rect(Rect2(0, 0, 100, 100))\n\t\tv.set_physics_object_picking(false)\n\t\tget_tree().get_root().get_node( \"Spatial\" ).get_node( \"Camera\" ).add_child(p)\n\t\tv.add_child(p)\n\t\tadd_child(c)\n\t\tc.add_child(v)\n\t\totherPuzzle = p #for use with network\n# child of control? easier input\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"07d6c311d7619a8890f4f913af416acf3a0db8d0","subject":"Added alpha effect to joypad axis indicators","message":"Added alpha effect to joypad axis indicators\n\nAdded alpha effect to joypad demo's axis and analog trigger indicators via the CanvasItem's self modulate property.","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"misc\/joypads\/joypads.gd","new_file":"misc\/joypads\/joypads.gd","new_contents":"extends Control\n\n# Joypads demo, written by Dana Olson \n#\n# This is a demo of joypad support, and doubles as a testing application\n# inspired by and similar to jstest-gtk.\n#\n# Licensed under the MIT license\n\nconst DEADZONE = 0.2\n\nvar joy_num\nvar cur_joy = -1\nvar axis_value\n\nonready var axes = $Axes\nonready var button_grid = $Buttons\/ButtonGrid\nonready var joypad_axes = $JoypadDiagram\/Axes\nonready var joypad_buttons = $JoypadDiagram\/Buttons\nonready var joypad_name = $DeviceInfo\/JoyName\nonready var joypad_number = $DeviceInfo\/JoyNumber\n\nfunc _ready():\n\tset_physics_process(true)\n\tInput.connect(\"joy_connection_changed\", self, \"_on_joy_connection_changed\")\n\t# Guide button, not supported <= 3.2.3, so manually hide to account for that case.\n\tjoypad_buttons.get_child(16).hide()\n\n\nfunc _process(_delta):\n\t# Get the joypad device number from the spinbox.\n\tjoy_num = joypad_number.get_value()\n\n\t# Display the name of the joypad if we haven't already.\n\tif joy_num != cur_joy:\n\t\tcur_joy = joy_num\n\t\tjoypad_name.set_text(Input.get_joy_name(joy_num) + \"\\n\" + Input.get_joy_guid(joy_num))\n\n\t# Loop through the axes and show their current values.\n\tfor axis in range(JOY_AXIS_MAX):\n\t\taxis_value = Input.get_joy_axis(joy_num, axis)\n\t\taxes.get_node(\"Axis\" + str(axis) + \"\/ProgressBar\").set_value(100 * axis_value)\n\t\taxes.get_node(\"Axis\" + str(axis) + \"\/ProgressBar\/Value\").set_text(str(axis_value))\n\t\t# Scaled value used for alpha channel using valid range rather than including unusable deadzone values.\n\t\tvar scaled_alpha_value = (abs(axis_value) - DEADZONE) \/ (1.0 - DEADZONE)\n\t\t# Show joypad direction indicators\n\t\tif axis <= JOY_ANALOG_RY:\n\t\t\tif abs(axis_value) < DEADZONE:\n\t\t\t\tjoypad_axes.get_node(str(axis) + \"+\").hide()\n\t\t\t\tjoypad_axes.get_node(str(axis) + \"-\").hide()\n\t\t\telif axis_value > 0:\n\t\t\t\tjoypad_axes.get_node(str(axis) + \"+\").show()\n\t\t\t\tjoypad_axes.get_node(str(axis) + \"-\").hide()\n\t\t\t\t# Transparent white modulate, non-alpha color channels are not changed here.\n\t\t\t\tjoypad_axes.get_node(str(axis) + \"+\").self_modulate.a = scaled_alpha_value\n\t\t\telse:\n\t\t\t\tjoypad_axes.get_node(str(axis) + \"+\").hide()\n\t\t\t\tjoypad_axes.get_node(str(axis) + \"-\").show()\n\t\t\t\t# Transparent white modulate, non-alpha color channels are not changed here.\n\t\t\t\tjoypad_axes.get_node(str(axis) + \"-\").self_modulate.a = scaled_alpha_value\n\t\telif axis == JOY_ANALOG_L2:\n\t\t\tif axis_value <= DEADZONE:\n\t\t\t\tjoypad_buttons.get_child(JOY_ANALOG_L2).hide()\n\t\t\telse:\n\t\t\t\tjoypad_buttons.get_child(JOY_ANALOG_L2).show()\n\t\t\t\t# Transparent white modulate, non-alpha color channels are not changed here.\n\t\t\t\tjoypad_buttons.get_child(JOY_ANALOG_L2).self_modulate.a = scaled_alpha_value\n\t\telif axis == JOY_ANALOG_R2:\n\t\t\tif axis_value <= DEADZONE:\n\t\t\t\tjoypad_buttons.get_child(JOY_ANALOG_R2).hide()\n\t\t\telse:\n\t\t\t\tjoypad_buttons.get_child(JOY_ANALOG_R2).show()\n\t\t\t\t# Transparent white modulate, non-alpha color channels are not changed here.\n\t\t\t\tjoypad_buttons.get_child(JOY_ANALOG_R2).self_modulate.a = scaled_alpha_value\n\n\t# Loop through the buttons and highlight the ones that are pressed.\n\tfor btn in range(JOY_BUTTON_0, int(min(JOY_BUTTON_MAX, 24))):\n\t\tif Input.is_joy_button_pressed(joy_num, btn):\n\t\t\tbutton_grid.get_child(btn).add_color_override(\"font_color\", Color.white)\n\t\t\tif btn < 17 and btn != JOY_ANALOG_L2 and btn != JOY_ANALOG_R2:\n\t\t\t\tjoypad_buttons.get_child(btn).show()\n\t\telse:\n\t\t\tbutton_grid.get_child(btn).add_color_override(\"font_color\", Color(0.2, 0.1, 0.3, 1))\n\t\t\tif btn < 17 and btn != JOY_ANALOG_L2 and btn != JOY_ANALOG_R2:\n\t\t\t\tjoypad_buttons.get_child(btn).hide()\n\n\n# Called whenever a joypad has been connected or disconnected.\nfunc _on_joy_connection_changed(device_id, connected):\n\tif device_id == cur_joy:\n\t\tif connected:\n\t\t\tjoypad_name.set_text(Input.get_joy_name(device_id) + \"\\n\" + Input.get_joy_guid(device_id))\n\t\telse:\n\t\t\tjoypad_name.set_text(\"\")\n\n\nfunc _on_start_vibration_pressed():\n\tvar weak = $Vibration\/Weak\/Value.get_value()\n\tvar strong = $Vibration\/Strong\/Value.get_value()\n\tvar duration = $Vibration\/Duration\/Value.get_value()\n\tInput.start_joy_vibration(cur_joy, weak, strong, duration)\n\n\nfunc _on_stop_vibration_pressed():\n\tInput.stop_joy_vibration(cur_joy)\n\n\nfunc _on_Remap_pressed():\n\t$RemapWizard.start(cur_joy)\n\n\nfunc _on_Clear_pressed():\n\tvar guid = Input.get_joy_guid(cur_joy)\n\tif guid.empty():\n\t\tprinterr(\"No gamepad selected\")\n\t\treturn\n\tInput.remove_joy_mapping(guid)\n\n\nfunc _on_Show_pressed():\n\t$RemapWizard.show_map()\n","old_contents":"extends Control\n\n# Joypads demo, written by Dana Olson \n#\n# This is a demo of joypad support, and doubles as a testing application\n# inspired by and similar to jstest-gtk.\n#\n# Licensed under the MIT license\n\nconst DEADZONE = 0.2\n\nvar joy_num\nvar cur_joy = -1\nvar axis_value\n\nonready var axes = $Axes\nonready var button_grid = $Buttons\/ButtonGrid\nonready var joypad_axes = $JoypadDiagram\/Axes\nonready var joypad_buttons = $JoypadDiagram\/Buttons\nonready var joypad_name = $DeviceInfo\/JoyName\nonready var joypad_number = $DeviceInfo\/JoyNumber\n\nfunc _ready():\n\tset_physics_process(true)\n\tInput.connect(\"joy_connection_changed\", self, \"_on_joy_connection_changed\")\n\t# Guide button, not supported <= 3.2.3, so manually hide to account for that case.\n\tjoypad_buttons.get_child(16).hide()\n\n\nfunc _process(_delta):\n\t# Get the joypad device number from the spinbox.\n\tjoy_num = joypad_number.get_value()\n\n\t# Display the name of the joypad if we haven't already.\n\tif joy_num != cur_joy:\n\t\tcur_joy = joy_num\n\t\tjoypad_name.set_text(Input.get_joy_name(joy_num) + \"\\n\" + Input.get_joy_guid(joy_num))\n\n\t# Loop through the axes and show their current values.\n\tfor axis in range(JOY_AXIS_MAX):\n\t\taxis_value = Input.get_joy_axis(joy_num, axis)\n\t\taxes.get_node(\"Axis\" + str(axis) + \"\/ProgressBar\").set_value(100 * axis_value)\n\t\taxes.get_node(\"Axis\" + str(axis) + \"\/ProgressBar\/Value\").set_text(str(axis_value))\n\t\t# Show joypad direction indicators\n\t\tif axis <= JOY_ANALOG_RY:\n\t\t\tif abs(axis_value) < DEADZONE:\n\t\t\t\tjoypad_axes.get_node(str(axis) + \"+\").hide()\n\t\t\t\tjoypad_axes.get_node(str(axis) + \"-\").hide()\n\t\t\telif axis_value > 0:\n\t\t\t\tjoypad_axes.get_node(str(axis) + \"+\").show()\n\t\t\t\tjoypad_axes.get_node(str(axis) + \"-\").hide()\n\t\t\telse:\n\t\t\t\tjoypad_axes.get_node(str(axis) + \"+\").hide()\n\t\t\t\tjoypad_axes.get_node(str(axis) + \"-\").show()\n\n\t# Loop through the buttons and highlight the ones that are pressed.\n\tfor btn in range(JOY_BUTTON_0, int(min(JOY_BUTTON_MAX, 24))):\n\t\tif Input.is_joy_button_pressed(joy_num, btn):\n\t\t\tbutton_grid.get_child(btn).add_color_override(\"font_color\", Color.white)\n\t\t\tif btn < 17:\n\t\t\t\tjoypad_buttons.get_child(btn).show()\n\t\telse:\n\t\t\tbutton_grid.get_child(btn).add_color_override(\"font_color\", Color(0.2, 0.1, 0.3, 1))\n\t\t\tif btn < 17:\n\t\t\t\tjoypad_buttons.get_child(btn).hide()\n\n\n# Called whenever a joypad has been connected or disconnected.\nfunc _on_joy_connection_changed(device_id, connected):\n\tif device_id == cur_joy:\n\t\tif connected:\n\t\t\tjoypad_name.set_text(Input.get_joy_name(device_id) + \"\\n\" + Input.get_joy_guid(device_id))\n\t\telse:\n\t\t\tjoypad_name.set_text(\"\")\n\n\nfunc _on_start_vibration_pressed():\n\tvar weak = $Vibration\/Weak\/Value.get_value()\n\tvar strong = $Vibration\/Strong\/Value.get_value()\n\tvar duration = $Vibration\/Duration\/Value.get_value()\n\tInput.start_joy_vibration(cur_joy, weak, strong, duration)\n\n\nfunc _on_stop_vibration_pressed():\n\tInput.stop_joy_vibration(cur_joy)\n\n\nfunc _on_Remap_pressed():\n\t$RemapWizard.start(cur_joy)\n\n\nfunc _on_Clear_pressed():\n\tvar guid = Input.get_joy_guid(cur_joy)\n\tif guid.empty():\n\t\tprinterr(\"No gamepad selected\")\n\t\treturn\n\tInput.remove_joy_mapping(guid)\n\n\nfunc _on_Show_pressed():\n\t$RemapWizard.show_map()\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"1997223d8e87e288be9a63ec1f6e4ac3a57635c4","subject":"Drink fix","message":"Drink fix\n","repos":"w84death\/mountain-of-hope","old_file":"scripts\/player.gd","new_file":"scripts\/player.gd","new_contents":"extends \"res:\/\/scripts\/moving_object.gd\"\n\nvar player_id\nvar is_playing = false\nvar is_alive = true\nvar attack_range = 100\nvar attack_width = PI * 0.33\nvar attack_strength = 1\nvar attack_cooldown = 0.25\nvar is_attack_on_cooldown = false\nvar blast\n\nvar panel\nvar hp_cap = 16\nvar top_height = 0\n\nvar is_jumping = false\n\nvar EXIT_THRESHOLD = 30\n\nfunc _init(bag, player_id).(bag):\n self.bag = bag\n self.player_id = player_id\n self.velocity = 50\n self.hp = 10\n self.max_hp = 10\n self.score = 0\n self.avatar = preload(\"res:\/\/scenes\/player\/player.xscn\").instance()\n self.animations = self.avatar.get_node('animations')\n self.body = self.avatar.get_node('body')\n\n\n #self.bind_gamepad(player_id)\n #self.panel = self.bag.hud.bind_player_panel(player_id)\n self.update_bars()\n\n self.sounds['hit'] = 'player_hit'\n self.sounds['die'] = 'player_die'\n self.sounds['attack1'] = 'player_attack1'\n self.sounds['attack2'] = 'player_attack2'\n\nfunc bind_gamepad(id):\n var gamepad = self.bag.input.devices['pad' + str(id)]\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_enter_game_gamepad.gd\").new(self.bag, self))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_axis.gd\").new(self.bag, self, 0))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_axis.gd\").new(self.bag, self, 1))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_gamepad.gd\").new(self.bag, self, 2))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_gamepad.gd\").new(self.bag, self, 3))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_gamepad.gd\").new(self.bag, self))\n\nfunc bind_keyboard_and_mouse():\n var keyboard = self.bag.input.devices['keyboard']\n var mouse = self.bag.input.devices['mouse']\n #keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_enter_game_keyboard.gd\").new(self.bag, self))\n #keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 1, KEY_W, -1))\n #keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 1, KEY_S, 1))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_jump_key.gd\").new(self.bag, self, KEY_SPACE))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 0, KEY_A, -1))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 0, KEY_D, 1))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_drink_key.gd\").new(self.bag, self, KEY_W))\n #mouse.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_mouse.gd\").new(self.bag, self))\n\nfunc enter_game():\n self.is_playing = true\n self.spawn(Vector2(640, -60))\n\nfunc spawn(position):\n self.is_alive = true\n .spawn(position)\n\nfunc die():\n self.is_alive = false\n self.panel.hide()\n .die()\n if not self.bag.players.is_living_player_in_game():\n self.bag.sample_player.play('game_over')\n self.bag.action_controller.end_game()\n\nfunc process(delta):\n .process(delta)\n self.handle_items()\n self.check_map_segment()\n\nfunc check_map_segment():\n var height = -1 * int(self.avatar.get_pos().y)\n if height > self.top_height:\n self.top_height = height\n self.bag.hud.set_score(height)\n self.bag.map.update_segments(height)\n\nfunc modify_position(delta):\n .modify_position(delta)\n self.handle_animations()\n\nfunc jump(jumping_flag):\n\n self.is_jumping = jumping_flag\n\nfunc handle_collision(collider):\n return\n\nfunc handle_animations():\n if not self.animations.is_playing():\n if abs(self.movement_vector[0]) > self.AXIS_THRESHOLD || abs(self.movement_vector[1]) > self.AXIS_THRESHOLD:\n self.animations.play('run')\n #print('run?')\n else:\n self.animations.play('idle')\n #print('idle?')\n else:\n if self.animations.get_current_animation() == 'idle' && (abs(self.movement_vector[0]) > self.AXIS_THRESHOLD || abs(self.movement_vector[1]) > self.AXIS_THRESHOLD):\n self.animations.play('run')\n elif self.animations.get_current_animation() == 'run' && abs(self.movement_vector[0]) < self.AXIS_THRESHOLD && abs(self.movement_vector[1]) < self.AXIS_THRESHOLD:\n self.animations.play('idle')\n\nfunc drink():\n if not self.is_in_air && not self.is_on_wall:\n self.animations.play('drink')\n self.bag.timers.set_timeout(1, self, 'stop_drink')\n\nfunc stop_drink():\n self.animations.play('idle')\n\n\nfunc handle_items():\n var items = self.bag.items.get_items_near_object(self)\n for item in items:\n if item.power_up_type == 0:\n self.get_fat(item.power_up_amount)\n else:\n self.get_power(item.power_up_amount)\n self.score = self.score + item.score\n item.pick()\n self.update_bars()\n\nfunc handle_jump():\n self.bag.sound_controller.play('jump_normal')\n\nfunc attack():\n if self.is_attack_on_cooldown:\n return\n\n var enemies\n var random_attack = 'attack'+ str(1 + randi() % 2)\n\n if not self.animations.get_current_animation() == 'attack1' and not self.animations.get_current_animation() == 'attack2' :\n self.animations.play(random_attack)\n self.play_sound(random_attack)\n #self.blast.play('blast')\n elif not self.animations.is_playing():\n if self.animations.get_current_animation() == 'attack1':\n self.animations.play('attack2')\n self.play_sound('attack2')\n else:\n self.animations.play('attack1')\n self.play_sound('attack1')\n self.blast.play('blast')\n\n enemies = [] #self.bag.enemies.get_enemies_near_object(self, self.attack_range, self.target_cone_vector, self.attack_width)\n for enemy in enemies:\n if enemy.will_die(self.attack_strength):\n self.score += enemy.score\n self.update_bars()\n\n enemy.recieve_damage(self.attack_strength)\n enemy.push_back(self)\n self.bag.timers.set_timeout(self.attack_cooldown, self, \"attack_cooled_down\")\n\nfunc get_power(amount):\n self.attack_strength += amount\n if self.attack_strength >= 16:\n self.die();\n\n self.hp -= amount\n self.max_hp -= amount\n self.update_bars()\n\nfunc get_fat(amount):\n self.hp += amount\n self.max_hp += amount\n if self.max_hp > self.hp_cap:\n self.max_hp = self.hp_cap\n if self.hp > self.max_hp:\n self.hp = self.max_hp\n self.update_bars()\n\nfunc check_colisions():\n return\n\nfunc update_bars():\n #self.panel.update_bar(self.panel.fat_bar, self.hp - 1, 0)\n #self.panel.update_bar(self.panel.power_bar, self.attack_strength - 1, 3)\n #self.panel.update_points(self.score)\n return\n\nfunc set_hp(hp):\n .set_hp(hp)\n self.update_bars()\n\nfunc recieve_damage(damage):\n self.bag.camera.shake()\n .recieve_damage(damage)\n\nfunc reset():\n self.attack_strength = 1\n self.hp = 10\n self.max_hp = 10\n self.is_playing = false\n self.is_alive = true\n self.movement_vector = [0, 0]\n self.controller_vector = [0, 0]\n self.score = 0\n self.is_attack_on_cooldown = false\n self.top_height = 0\n\nfunc attack_cooled_down():\n self.is_attack_on_cooldown = false\n","old_contents":"extends \"res:\/\/scripts\/moving_object.gd\"\n\nvar player_id\nvar is_playing = false\nvar is_alive = true\nvar attack_range = 100\nvar attack_width = PI * 0.33\nvar attack_strength = 1\nvar attack_cooldown = 0.25\nvar is_attack_on_cooldown = false\nvar blast\n\nvar panel\nvar hp_cap = 16\nvar top_height = 0\n\nvar is_jumping = false\n\nvar EXIT_THRESHOLD = 30\n\nfunc _init(bag, player_id).(bag):\n self.bag = bag\n self.player_id = player_id\n self.velocity = 50\n self.hp = 10\n self.max_hp = 10\n self.score = 0\n self.avatar = preload(\"res:\/\/scenes\/player\/player.xscn\").instance()\n self.animations = self.avatar.get_node('animations')\n self.body = self.avatar.get_node('body')\n\n\n #self.bind_gamepad(player_id)\n #self.panel = self.bag.hud.bind_player_panel(player_id)\n self.update_bars()\n\n self.sounds['hit'] = 'player_hit'\n self.sounds['die'] = 'player_die'\n self.sounds['attack1'] = 'player_attack1'\n self.sounds['attack2'] = 'player_attack2'\n\nfunc bind_gamepad(id):\n var gamepad = self.bag.input.devices['pad' + str(id)]\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_enter_game_gamepad.gd\").new(self.bag, self))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_axis.gd\").new(self.bag, self, 0))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_axis.gd\").new(self.bag, self, 1))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_gamepad.gd\").new(self.bag, self, 2))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_gamepad.gd\").new(self.bag, self, 3))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_gamepad.gd\").new(self.bag, self))\n\nfunc bind_keyboard_and_mouse():\n var keyboard = self.bag.input.devices['keyboard']\n var mouse = self.bag.input.devices['mouse']\n #keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_enter_game_keyboard.gd\").new(self.bag, self))\n #keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 1, KEY_W, -1))\n #keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 1, KEY_S, 1))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_jump_key.gd\").new(self.bag, self, KEY_SPACE))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 0, KEY_A, -1))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 0, KEY_D, 1))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_drink_key.gd\").new(self.bag, self, 0, KEY_w, 1))\n #mouse.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_mouse.gd\").new(self.bag, self))\n\nfunc enter_game():\n self.is_playing = true\n self.spawn(Vector2(640, -60))\n\nfunc spawn(position):\n self.is_alive = true\n .spawn(position)\n\nfunc die():\n self.is_alive = false\n self.panel.hide()\n .die()\n if not self.bag.players.is_living_player_in_game():\n self.bag.sample_player.play('game_over')\n self.bag.action_controller.end_game()\n\nfunc process(delta):\n .process(delta)\n self.handle_items()\n self.check_map_segment()\n\nfunc check_map_segment():\n var height = -1 * int(self.avatar.get_pos().y)\n if height > self.top_height:\n self.top_height = height\n self.bag.hud.set_score(height)\n self.bag.map.update_segments(height)\n\nfunc modify_position(delta):\n .modify_position(delta)\n self.handle_animations()\n\nfunc jump(jumping_flag):\n\n self.is_jumping = jumping_flag\n\nfunc handle_collision(collider):\n return\n\nfunc handle_animations():\n if not self.animations.is_playing():\n if abs(self.movement_vector[0]) > self.AXIS_THRESHOLD || abs(self.movement_vector[1]) > self.AXIS_THRESHOLD:\n self.animations.play('run')\n #print('run?')\n else:\n self.animations.play('idle')\n #print('idle?')\n else:\n if self.animations.get_current_animation() == 'idle' && (abs(self.movement_vector[0]) > self.AXIS_THRESHOLD || abs(self.movement_vector[1]) > self.AXIS_THRESHOLD):\n self.animations.play('run')\n elif self.animations.get_current_animation() == 'run' && abs(self.movement_vector[0]) < self.AXIS_THRESHOLD && abs(self.movement_vector[1]) < self.AXIS_THRESHOLD:\n self.animations.play('idle')\n\nfunc drink():\n if not self.is_in_air && not self.is_on_wall:\n self.animations.play('drink')\n\n\nfunc handle_items():\n var items = self.bag.items.get_items_near_object(self)\n for item in items:\n if item.power_up_type == 0:\n self.get_fat(item.power_up_amount)\n else:\n self.get_power(item.power_up_amount)\n self.score = self.score + item.score\n item.pick()\n self.update_bars()\n\nfunc handle_jump():\n self.bag.sound_controller.play('jump_normal')\n\nfunc attack():\n if self.is_attack_on_cooldown:\n return\n\n var enemies\n var random_attack = 'attack'+ str(1 + randi() % 2)\n\n if not self.animations.get_current_animation() == 'attack1' and not self.animations.get_current_animation() == 'attack2' :\n self.animations.play(random_attack)\n self.play_sound(random_attack)\n #self.blast.play('blast')\n elif not self.animations.is_playing():\n if self.animations.get_current_animation() == 'attack1':\n self.animations.play('attack2')\n self.play_sound('attack2')\n else:\n self.animations.play('attack1')\n self.play_sound('attack1')\n self.blast.play('blast')\n\n enemies = [] #self.bag.enemies.get_enemies_near_object(self, self.attack_range, self.target_cone_vector, self.attack_width)\n for enemy in enemies:\n if enemy.will_die(self.attack_strength):\n self.score += enemy.score\n self.update_bars()\n\n enemy.recieve_damage(self.attack_strength)\n enemy.push_back(self)\n self.bag.timers.set_timeout(self.attack_cooldown, self, \"attack_cooled_down\")\n\nfunc get_power(amount):\n self.attack_strength += amount\n if self.attack_strength >= 16:\n self.die();\n\n self.hp -= amount\n self.max_hp -= amount\n self.update_bars()\n\nfunc get_fat(amount):\n self.hp += amount\n self.max_hp += amount\n if self.max_hp > self.hp_cap:\n self.max_hp = self.hp_cap\n if self.hp > self.max_hp:\n self.hp = self.max_hp\n self.update_bars()\n\nfunc check_colisions():\n return\n\nfunc update_bars():\n #self.panel.update_bar(self.panel.fat_bar, self.hp - 1, 0)\n #self.panel.update_bar(self.panel.power_bar, self.attack_strength - 1, 3)\n #self.panel.update_points(self.score)\n return\n\nfunc set_hp(hp):\n .set_hp(hp)\n self.update_bars()\n\nfunc recieve_damage(damage):\n self.bag.camera.shake()\n .recieve_damage(damage)\n\nfunc reset():\n self.attack_strength = 1\n self.hp = 10\n self.max_hp = 10\n self.is_playing = false\n self.is_alive = true\n self.movement_vector = [0, 0]\n self.controller_vector = [0, 0]\n self.score = 0\n self.is_attack_on_cooldown = false\n self.top_height = 0\n\nfunc attack_cooled_down():\n self.is_attack_on_cooldown = false\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"fcb4434bd02ec29b4e4c1a861a53b8f1e55ac349","subject":"Commented function not compatible with Godot stable 2.1","message":"Commented function not compatible with Godot stable 2.1\n","repos":"AlexHolly\/captain-holetooth,shelltitan\/captain-holetooth,AlexHolly\/captain-holetooth,shelltitan\/captain-holetooth","old_file":"src\/actors\/player\/ship\/ship.gd","new_file":"src\/actors\/player\/ship\/ship.gd","new_contents":"extends Area2D\n\n# Max Speed\nconst MAX_SPEED = 250\n\n# Time in Seconds the speed boost lasts\nconst SPEED_BOOST_TIME = 5 # seconds\nconst SPEED_BOOST_MULTIPLIER = 2 # 2x speed multiplier\nvar speed_boost = 1 # This changes to the multipler when boost is enabled\n\nconst ACC_BOOST_TIME = 5 # seconds\nconst ACC_BOOST_MULTIPLIER = 7.5 # 7.5x more ship control!\nvar acc_boost = 1\n\n# Acceleration\nconst ACCELERATION = 950 # Higher acceleration gives the player quicker control over the ship\n\n# Animation player\nexport (NodePath) var anim_player_path\nonready var anim_player = get_node(anim_player_path)\n\n# Screen Size is used to determine where the player can fly\nvar screen_size\nvar prev_shooting = false\nvar killed = false\nvar speed = Vector2(0, 0)\n\n# animated from anim when hited\nvar motion_factor = Vector2(1, 1) # multiplies base motion\nvar root_motion = Vector2(0, 0) # applyed to base motion\n\n# Coin\nconst coin_type = preload(\"res:\/\/src\/objects\/rewards\/reward.gd\")\n\n# Processing\nfunc _process(delta):\n\t# Player motion\n\tvar motion = Vector2()\n\t\n\t# Input: MOVE UP\n\tif(Input.is_action_pressed(\"move_up\")):\n\t\tmotion += Vector2(0, -1)\n\t# Input: MOVE DOWN\n\tif(Input.is_action_pressed(\"move_down\")):\n\t\tmotion += Vector2(0, 1)\n\t# Input: MOVE LEFT\n\tif(Input.is_action_pressed(\"move_left\")):\n\t\tmotion += Vector2(-1, 0)\n\t# Input: MOVE RIGHT\n\tif(Input.is_action_pressed(\"move_right\")):\n\t\tmotion += Vector2(1, 0)\n\t# Input: SHOOT\n\t# REMOVED FOR 2.1 Stable: if(Input.is_action_just_pressed(\"shoot\")):\n\tif(Input.is_action_pressed(\"shoot\")):\n\t\t# Create a new shot instance\n\t\tvar shot = preload(\"shot.tscn\").instance()\n\t\t\n\t\t# Use the Position2D as spawn coordinate for our new shot\n\t\tshot.set_pos( get_node(\"shootfrom\").get_global_pos() )\n\t\t\n\t\t# Put it two parents above, so it is not moved by us\n\t\tget_node(\"..\/..\").add_child(shot)\n\t\t\n\t\t# Play shooting sound\n\t\tget_node(\"sfx\").play(\"shoot\")\n\t\n\t# If we are pressing any movement keys, increase speed\n\tif(motion.x || motion.y):\n\t\tspeed += acc_boost * ACCELERATION * motion.normalized() * delta\n\t\n\t# If we are NOT pressing any movement keys, and we have some speed, deaccelerate to a full stop\n\telif(speed.x || speed.y):\n\t\tspeed -= acc_boost * ACCELERATION * speed.normalized() * delta\n\t\n\t# Prevents ship speed from going faster than MAX_SPEED\n\tif(speed.length() > MAX_SPEED):\n\t\tspeed = speed.normalized() * MAX_SPEED\n\t\n\t# Move player\n\tvar pos = get_pos()\n\t\n\t# Celculate position to where we are moving\n\tpos += delta * (speed_boost * speed * motion_factor + root_motion)\n\t\n\t# Prevent ship from going outside the screen\n\tpos.x = clamp(pos.x, 0, screen_size.x)\n\tpos.y = clamp(pos.y, 0, screen_size.y)\n\t\n\t# Set new player position\n\tset_pos(pos)\n\n\n# Start\nfunc _ready():\n\t# Screen size is used to calculate whether or not the player is inside it\n\tscreen_size = get_viewport().get_rect().size\n\t\n\t# Enable process\n\tset_process(true)\n\n\n# SPEED BOOST\n# Used by certain pickup items to give the player a speed boost\nvar speed_timer = null\nfunc speed_boost():\n\t# If it is not already running\n\tif(speed_boost == 1):\n\t\t# If this is the first time running, create timer\n\t\tif(speed_timer == null):\n\t\t\tspeed_timer = Timer.new()\n\t\t\tspeed_timer.set_wait_time(SPEED_BOOST_TIME)\n\t\t\tspeed_timer.set_one_shot(true)\n\t\t\tadd_child(speed_timer)\n\t\t\n\t\t# Set speed boost\n\t\tspeed_boost = SPEED_BOOST_MULTIPLIER\n\t\n\t\t# Start timer\n\t\tspeed_timer.start()\n\t\t\n\t\t# Wait for timeout\n\t\tyield(speed_timer, \"timeout\")\n\t\t\n\t\t# Disable speed boost\n\t\tspeed_boost = 1 # back to 1\n\n\n# ACCELERATION BOOST\n# Used by certain pickup items to give the player more ship control\nvar acc_timer = null\nfunc acc_boost():\n\t# If it is not already running\n\tif(acc_boost == 1):\n\t\t# If this is the first time running, create timer\n\t\tif(acc_timer == null):\n\t\t\tacc_timer = Timer.new()\n\t\t\tacc_timer.set_wait_time(ACC_BOOST_TIME)\n\t\t\tacc_timer.set_one_shot(true)\n\t\t\tadd_child(acc_timer)\n\t\t\n\t\t# Set speed boost\n\t\tacc_boost = ACC_BOOST_MULTIPLIER\n\t\n\t\t# Start timer\n\t\tacc_timer.start()\n\t\t\n\t\t# Wait for timeout\n\t\tyield(acc_timer, \"timeout\")\n\t\t\n\t\t# Disable speed boost\n\t\tacc_boost = 1 # back to 1\n\n# On area enter the player\nfunc _on_player_area_enter( area ):\n\tvar groups = area.get_groups()\n\t\n\tif(groups.has(\"enemy\") || groups.has(\"enemy_shot\")):\n\t\t# Play ship 'hit' animation\n\t\tanim_player.play(\"hit\")\n\t\t\n\t\t# Wait for the animation to complete\n\t\tyield(anim_player, \"finished\")\n\t\t\n\t\t# Go back to the 'flying' animation (default)\n\t\tanim_player.play(\"flying\")","old_contents":"extends Area2D\n\n# Max Speed\nconst MAX_SPEED = 250\n\n# Time in Seconds the speed boost lasts\nconst SPEED_BOOST_TIME = 5 # seconds\nconst SPEED_BOOST_MULTIPLIER = 2 # 2x speed multiplier\nvar speed_boost = 1 # This changes to the multipler when boost is enabled\n\nconst ACC_BOOST_TIME = 5 # seconds\nconst ACC_BOOST_MULTIPLIER = 7.5 # 7.5x more ship control!\nvar acc_boost = 1\n\n# Acceleration\nconst ACCELERATION = 950 # Higher acceleration gives the player quicker control over the ship\n\n# Animation player\nexport (NodePath) var anim_player_path\nonready var anim_player = get_node(anim_player_path)\n\n# Screen Size is used to determine where the player can fly\nvar screen_size\nvar prev_shooting = false\nvar killed = false\nvar speed = Vector2(0, 0)\n\n# animated from anim when hited\nvar motion_factor = Vector2(1, 1) # multiplies base motion\nvar root_motion = Vector2(0, 0) # applyed to base motion\n\n# Coin\nconst coin_type = preload(\"res:\/\/src\/objects\/rewards\/reward.gd\")\n\n# Processing\nfunc _process(delta):\n\t# Player motion\n\tvar motion = Vector2()\n\t\n\t# Input: MOVE UP\n\tif(Input.is_action_pressed(\"move_up\")):\n\t\tmotion += Vector2(0, -1)\n\t# Input: MOVE DOWN\n\tif(Input.is_action_pressed(\"move_down\")):\n\t\tmotion += Vector2(0, 1)\n\t# Input: MOVE LEFT\n\tif(Input.is_action_pressed(\"move_left\")):\n\t\tmotion += Vector2(-1, 0)\n\t# Input: MOVE RIGHT\n\tif(Input.is_action_pressed(\"move_right\")):\n\t\tmotion += Vector2(1, 0)\n\t# Input: SHOOT\n\tif(Input.is_action_just_pressed(\"shoot\")):\n\t\t# Create a new shot instance\n\t\tvar shot = preload(\"shot.tscn\").instance()\n\t\t\n\t\t# Use the Position2D as spawn coordinate for our new shot\n\t\tshot.set_pos( get_node(\"shootfrom\").get_global_pos() )\n\t\t\n\t\t# Put it two parents above, so it is not moved by us\n\t\tget_node(\"..\/..\").add_child(shot)\n\t\t\n\t\t# Play shooting sound\n\t\tget_node(\"sfx\").play(\"shoot\")\n\t\n\t# If we are pressing any movement keys, increase speed\n\tif(motion.x || motion.y):\n\t\tspeed += acc_boost * ACCELERATION * motion.normalized() * delta\n\t\n\t# If we are NOT pressing any movement keys, and we have some speed, deaccelerate to a full stop\n\telif(speed.x || speed.y):\n\t\tspeed -= acc_boost * ACCELERATION * speed.normalized() * delta\n\t\n\t# Prevents ship speed from going faster than MAX_SPEED\n\tif(speed.length() > MAX_SPEED):\n\t\tspeed = speed.normalized() * MAX_SPEED\n\t\n\t# Move player\n\tvar pos = get_pos()\n\t\n\t# Celculate position to where we are moving\n\tpos += delta * (speed_boost * speed * motion_factor + root_motion)\n\t\n\t# Prevent ship from going outside the screen\n\tpos.x = clamp(pos.x, 0, screen_size.x)\n\tpos.y = clamp(pos.y, 0, screen_size.y)\n\t\n\t# Set new player position\n\tset_pos(pos)\n\n\n# Start\nfunc _ready():\n\t# Screen size is used to calculate whether or not the player is inside it\n\tscreen_size = get_viewport().get_rect().size\n\t\n\t# Enable process\n\tset_process(true)\n\n\n# SPEED BOOST\n# Used by certain pickup items to give the player a speed boost\nvar speed_timer = null\nfunc speed_boost():\n\t# If it is not already running\n\tif(speed_boost == 1):\n\t\t# If this is the first time running, create timer\n\t\tif(speed_timer == null):\n\t\t\tspeed_timer = Timer.new()\n\t\t\tspeed_timer.set_wait_time(SPEED_BOOST_TIME)\n\t\t\tspeed_timer.set_one_shot(true)\n\t\t\tadd_child(speed_timer)\n\t\t\n\t\t# Set speed boost\n\t\tspeed_boost = SPEED_BOOST_MULTIPLIER\n\t\n\t\t# Start timer\n\t\tspeed_timer.start()\n\t\t\n\t\t# Wait for timeout\n\t\tyield(speed_timer, \"timeout\")\n\t\t\n\t\t# Disable speed boost\n\t\tspeed_boost = 1 # back to 1\n\n\n# ACCELERATION BOOST\n# Used by certain pickup items to give the player more ship control\nvar acc_timer = null\nfunc acc_boost():\n\t# If it is not already running\n\tif(acc_boost == 1):\n\t\t# If this is the first time running, create timer\n\t\tif(acc_timer == null):\n\t\t\tacc_timer = Timer.new()\n\t\t\tacc_timer.set_wait_time(ACC_BOOST_TIME)\n\t\t\tacc_timer.set_one_shot(true)\n\t\t\tadd_child(acc_timer)\n\t\t\n\t\t# Set speed boost\n\t\tacc_boost = ACC_BOOST_MULTIPLIER\n\t\n\t\t# Start timer\n\t\tacc_timer.start()\n\t\t\n\t\t# Wait for timeout\n\t\tyield(acc_timer, \"timeout\")\n\t\t\n\t\t# Disable speed boost\n\t\tacc_boost = 1 # back to 1\n\n# On area enter the player\nfunc _on_player_area_enter( area ):\n\tvar groups = area.get_groups()\n\t\n\tif(groups.has(\"enemy\") || groups.has(\"enemy_shot\")):\n\t\t# Play ship 'hit' animation\n\t\tanim_player.play(\"hit\")\n\t\t\n\t\t# Wait for the animation to complete\n\t\tyield(anim_player, \"finished\")\n\t\t\n\t\t# Go back to the 'flying' animation (default)\n\t\tanim_player.play(\"flying\")","returncode":0,"stderr":"","license":"apache-2.0","lang":"GDScript"} {"commit":"f953ae32803d1f68a9c433a9bb503ba5a5f50b1c","subject":"better formatting","message":"better formatting\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/GridMan.gd","new_file":"src\/scripts\/GridMan.gd","new_contents":"extends Spatial\n\n# Is there a better way to do this?\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\n# Block selection handling.\nvar offClick = false\nvar selectedBlocks = []\n\n# Puzzle vars.\nvar puzzle\nvar puzzleLoaded = false\nvar blockNodes = {}\n\nvar puzzleScn\n\n# Beam stuff.\nconst beamScn = preload( \"res:\/\/blocks\/block.scn\" )\nconst Beam = preload(\"res:\/\/scripts\/Blocks\/Beam.gd\")\n\n# sounds\nvar samplePlayer = SamplePlayer.new()\n\nfunc addPickledBlock(block):\n\tvar b = block.toNode()\n\n\t# TODO any special treatment for the wild blocks?\n\t# TODO keep track of puzzle.lasers ? How to?\n\tblockNodes[block.blockPos] = b\n\n\tif puzzleLoaded:\n\t\t# keep pickled block\n\t\tpuzzle.shape[block.blockPos] = block\n\n\t\t# keep track of puzzle.pairCounts\n\t\tvar layer = calcBlockLayerVec(b.blockPos)\n\t\tif b.getBlockType() == 2:\n\t\t\twhile puzzle.pairCount.size() <= layer:\n\t\t\t\tpuzzle.pairCount.append(0)\n\t\t\tpuzzle.puzzleLayers = puzzle.pairCount.size() - 1\n\t\t\tpuzzle.pairCount[layer] += 0.5\n\n\n\tadd_child(b)\n\treturn b\n\nfunc get_block(pos):\n\tif blockNodes.has(pos):\n\t\treturn blockNodes[pos]\n\telse:\n\t\treturn null\n\n# unused key argument needed for the tween_complete signal\nfunc remove_block(block, key=null):\n\tvar block_node = blockNodes[block.blockPos]\n\n\tpuzzle.shape[block_node.blockPos] = null\n\tblockNodes[block_node.blockPos] = null\n\n\tif block_node == null:\n\t\treturn\n\n\tfor child in block_node.get_children():\n\t\tblock_node.remove_and_delete_child(child)\n\tremove_and_delete_child(block_node)\n\n# Sets the puzzle for this GridMan.\nfunc set_puzzle(puzz):\n\t# verify puzzle\n\tif puzz == null:\n\t\tprint(\"INVALID PUZZLE\")\n\t\treturn\n\n\t# delete all current nodes\n\tif puzzle != null:\n\t\tfor pos in puzzle.shape:\n\t\t\tremove_block(puzzle.shape[pos])\n\tpuzzleLoaded = false\n\n\t# Store the puzzle.\n\tpuzzle = puzz\n\n\t\t# # I can do my own counting!\n\t# needed for adding blocks in the editor\n\tfor k in puzzle.shape:\n\t\t# Create a block node, add it to the tree\n\t\taddPickledBlock(puzzle.shape[k])\n\tpuzzleLoaded = true\n\n# Clears any selected blocks. WE SHOULD FIX THIS, THERE CAN ONLY BE ONE BLOCK SELECTED AT ANY ONE TIME, NO NEED FOR AN ARRAY!\nfunc clearSelection():\n\tfor bl in selectedBlocks:\n\t\tvar blo = get_node( bl )\n\t\tblo.setSelected(false)\n\t\tblo.scaleTweenNode(1.0).start()\n\tselectedBlocks = []\n\n# Add the selected block to the selected list. WE SHOULD FIX THIS, IT ONLY NEEDS TO STORE IT, NOT AN ARRAY!\nfunc addSelected(bl):\n\tselectedBlocks.append(bl)\n\n# Used for the multiplayer mode to force click a block on their side.\nfunc forceClickBlock( pos ):\n\tblockNodes[pos].forceClick()\n\nfunc clickBlock( name ):\n\t#now check if that was the second block we picked. If it was, we want to\n\t#unselect the blocks again\n\tif (offClick):\n\t\toffClick = false\n\t\taddSelected(name)\n\t\tclearSelection()\n\telse:\n\t\toffClick = true;\n\t\taddSelected(name)\n\n# Calculates the layer that a block is on.\n# COPY OF FUNCTION IN PUZZLEMAN, IS THERE A BETTER WAY TO DO THIS?!\nfunc calcBlockLayer( x, y, z ):\n\treturn max( max( abs( x ), abs( y ) ), abs( z ) )\nfunc calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\nfunc beatenWithScore(othersScore):\n\tprint( \"BEATEN!\" )\n\tvar pauseMenu = get_tree().get_root().get_node( \"Spatial\" ).get_node( \"Camera\" ).pauseMenu\n\tpauseMenu.set_text(\"GAME OVER\\nYou've been beaten with time: \" + puzzleScn.formatTime(othersScore))\n\tpauseMenu.popup_centered()\n\nfunc win():\n\tprint( \"GAME OVER!\" )\n\tvar pauseMenu = get_tree().get_root().get_node( \"Spatial\" ).get_node( \"Camera\" ).pauseMenu\n\tpauseMenu.set_text(\"GAME OVER\\nYou win with time: \" + puzzleScn.formatTime(get_parent().get_parent().time.val))\n\tpauseMenu.popup_centered()\n\n\n# Handles keeping track of pairs being removed.\nfunc popPair( pos ):\n\tvar blayer = calcBlockLayerVec( pos )\n\tpuzzle.pairCount[blayer] -= 1\n\n\tif( puzzle.pairCount[blayer] == 0 ):\n\t\tprint(\"LAYER CLEARED\")\n\t\tif blayer == 1:\n\t\t\twin()\n\n\t\tfor b in puzzle.shape:\n\t\t\tif not ( puzzle.shape[b] == null ):\n\t\t\t\tif calcBlockLayerVec( b ) == blayer:\n\t\t\t\t\tif blockNodes[b].getBlockType() == BLOCK_LASER:\n\t\t\t\t\t\tblockNodes[b].forceActivate()\n\n\t\t# Fire beams.\n\t\tvar beamNum = 0\n\t\tfor l in range( puzzle.lasers.size() ):\n\t\t\tif calcBlockLayerVec( puzzle.lasers[l][0] ) == blayer:\n\t\t\t\t# Firin mah lazerz!\n\t\t\t\tvar beam = beamScn.instance()\n\n\t\t\t\tbeam.set_name( str(blayer) + \"_beam_\" + str(beamNum) )\n\t\t\t\tbeamNum += 1\n\t\t\t\tbeam.set_script( Beam )\n\n\t\t\t\tadd_child( beam )\n\t\t\t\tbeam.fire( puzzle.lasers[l][0], puzzle.lasers[l][1] )\n\n\t\t\t\tsamplePlayer.play( \"soundslikewillem_hitting_slinky\" )\n\n\nfunc _init():\n\t# Load sound\n\tsamplePlayer.set_voice_count(10)\n\tsamplePlayer.set_sample_library(ResourceLoader.load(\"new_samplelibrary.xml\"))\n\tprint(\"GridMan initialized\")\n\nfunc _ready():\n\tsetupCam()\n\t\n\tpuzzleScn = get_parent().get_parent()\n\n\nfunc setupCam():\n\tvar cam = get_tree().get_root().get_node( \"Spatial\/Camera\" )\n\tif cam == null or puzzle == null:\n\t\treturn\n\tvar totalSize = ( puzzle.puzzleLayers * 2 + 1 )\n\tcam.distance.val = 4.5 * totalSize\n\tcam.distance.min_ = 3 * totalSize\n\tcam.distance.max_ = 10 * totalSize\n\tcam.recalculate_camera()\n\n\n","old_contents":"extends Spatial\n\n# Is there a better way to do this?\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\n# Block selection handling.\nvar offClick = false\nvar selectedBlocks = []\n\n# Puzzle vars.\nvar puzzle\nvar puzzleLoaded = false\nvar blockNodes = {}\n\n# Beam stuff.\nconst beamScn = preload( \"res:\/\/blocks\/block.scn\" )\nconst Beam = preload(\"res:\/\/scripts\/Blocks\/Beam.gd\")\n\n# sounds\nvar samplePlayer = SamplePlayer.new()\n\nfunc addPickledBlock(block):\n\tvar b = block.toNode()\n\n\t# TODO any special treatment for the wild blocks?\n\t# TODO keep track of puzzle.lasers ? How to?\n\tblockNodes[block.blockPos] = b\n\n\tif puzzleLoaded:\n\t\t# keep pickled block\n\t\tpuzzle.shape[block.blockPos] = block\n\n\t\t# keep track of puzzle.pairCounts\n\t\tvar layer = calcBlockLayerVec(b.blockPos)\n\t\tif b.getBlockType() == 2:\n\t\t\twhile puzzle.pairCount.size() <= layer:\n\t\t\t\tpuzzle.pairCount.append(0)\n\t\t\tpuzzle.puzzleLayers = puzzle.pairCount.size() - 1\n\t\t\tpuzzle.pairCount[layer] += 0.5\n\n\n\tadd_child(b)\n\treturn b\n\nfunc get_block(pos):\n\tif blockNodes.has(pos):\n\t\treturn blockNodes[pos]\n\telse:\n\t\treturn null\n\n# unused key argument needed for the tween_complete signal\nfunc remove_block(block, key=null):\n\tvar block_node = blockNodes[block.blockPos]\n\n\tpuzzle.shape[block_node.blockPos] = null\n\tblockNodes[block_node.blockPos] = null\n\n\tif block_node == null:\n\t\treturn\n\n\tfor child in block_node.get_children():\n\t\tblock_node.remove_and_delete_child(child)\n\tremove_and_delete_child(block_node)\n\n# Sets the puzzle for this GridMan.\nfunc set_puzzle(puzz):\n\t# verify puzzle\n\tif puzz == null:\n\t\tprint(\"INVALID PUZZLE\")\n\t\treturn\n\n\t# delete all current nodes\n\tif puzzle != null:\n\t\tfor pos in puzzle.shape:\n\t\t\tremove_block(puzzle.shape[pos])\n\tpuzzleLoaded = false\n\n\t# Store the puzzle.\n\tpuzzle = puzz\n\n\t\t# # I can do my own counting!\n\t# needed for adding blocks in the editor\n\tfor k in puzzle.shape:\n\t\t# Create a block node, add it to the tree\n\t\taddPickledBlock(puzzle.shape[k])\n\tpuzzleLoaded = true\n\n# Clears any selected blocks. WE SHOULD FIX THIS, THERE CAN ONLY BE ONE BLOCK SELECTED AT ANY ONE TIME, NO NEED FOR AN ARRAY!\nfunc clearSelection():\n\tfor bl in selectedBlocks:\n\t\tvar blo = get_node( bl )\n\t\tblo.setSelected(false)\n\t\tblo.scaleTweenNode(1.0).start()\n\tselectedBlocks = []\n\n# Add the selected block to the selected list. WE SHOULD FIX THIS, IT ONLY NEEDS TO STORE IT, NOT AN ARRAY!\nfunc addSelected(bl):\n\tselectedBlocks.append(bl)\n\n# Used for the multiplayer mode to force click a block on their side.\nfunc forceClickBlock( pos ):\n\tblockNodes[pos].forceClick()\n\nfunc clickBlock( name ):\n\t#now check if that was the second block we picked. If it was, we want to\n\t#unselect the blocks again\n\tif (offClick):\n\t\toffClick = false\n\t\taddSelected(name)\n\t\tclearSelection()\n\telse:\n\t\toffClick = true;\n\t\taddSelected(name)\n\n# Calculates the layer that a block is on.\n# COPY OF FUNCTION IN PUZZLEMAN, IS THERE A BETTER WAY TO DO THIS?!\nfunc calcBlockLayer( x, y, z ):\n\treturn max( max( abs( x ), abs( y ) ), abs( z ) )\nfunc calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\nfunc beatenWithScore(othersScore):\n\tprint( \"BEATEN!\" )\n\tvar pauseMenu = get_tree().get_root().get_node( \"Spatial\" ).get_node( \"Camera\" ).pauseMenu\n\tpauseMenu.set_text(\"GAME OVER\\nYou've been beaten with time: \" + othersScore)\n\tpauseMenu.popup_centered()\n\nfunc win():\n\tprint( \"GAME OVER!\" )\n\tvar pauseMenu = get_tree().get_root().get_node( \"Spatial\" ).get_node( \"Camera\" ).pauseMenu\n\tpauseMenu.set_text(\"GAME OVER\\nYou win with time: \" + get_parent().get_parent().time.val)\n\tpauseMenu.popup_centered()\n\n\n# Handles keeping track of pairs being removed.\nfunc popPair( pos ):\n\tvar blayer = calcBlockLayerVec( pos )\n\tpuzzle.pairCount[blayer] -= 1\n\n\tif( puzzle.pairCount[blayer] == 0 ):\n\t\tprint(\"LAYER CLEARED\")\n\t\tif blayer == 1:\n\t\t\twin()\n\n\t\tfor b in puzzle.shape:\n\t\t\tif not ( puzzle.shape[b] == null ):\n\t\t\t\tif calcBlockLayerVec( b ) == blayer:\n\t\t\t\t\tif blockNodes[b].getBlockType() == BLOCK_LASER:\n\t\t\t\t\t\tblockNodes[b].forceActivate()\n\n\t\t# Fire beams.\n\t\tvar beamNum = 0\n\t\tfor l in range( puzzle.lasers.size() ):\n\t\t\tif calcBlockLayerVec( puzzle.lasers[l][0] ) == blayer:\n\t\t\t\t# Firin mah lazerz!\n\t\t\t\tvar beam = beamScn.instance()\n\n\t\t\t\tbeam.set_name( str(blayer) + \"_beam_\" + str(beamNum) )\n\t\t\t\tbeamNum += 1\n\t\t\t\tbeam.set_script( Beam )\n\n\t\t\t\tadd_child( beam )\n\t\t\t\tbeam.fire( puzzle.lasers[l][0], puzzle.lasers[l][1] )\n\n\t\t\t\tsamplePlayer.play( \"soundslikewillem_hitting_slinky\" )\n\n\nfunc _init():\n\t# Load sound\n\tsamplePlayer.set_voice_count(10)\n\tsamplePlayer.set_sample_library(ResourceLoader.load(\"new_samplelibrary.xml\"))\n\tprint(\"GridMan initialized\")\n\nfunc _ready():\n\tsetupCam()\n\nfunc setupCam():\n\tvar cam = get_tree().get_root().get_node( \"Spatial\/Camera\" )\n\tif cam == null or puzzle == null:\n\t\treturn\n\tvar totalSize = ( puzzle.puzzleLayers * 2 + 1 )\n\tcam.distance.val = 4.5 * totalSize\n\tcam.distance.min_ = 3 * totalSize\n\tcam.distance.max_ = 10 * totalSize\n\tcam.recalculate_camera()\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"cc6918b75fb25e19b1804d3fcaceb8e8d1df0ba1","subject":"Increased jump power","message":"Increased jump power\n","repos":"shelltitan\/captain-holetooth,shelltitan\/captain-holetooth,AlexHolly\/captain-holetooth,AlexHolly\/captain-holetooth","old_file":"scenes\/player\/player.gd","new_file":"scenes\/player\/player.gd","new_contents":"\nextends RigidBody2D\n\n# Character Demo, written by Juan Linietsky.\n#\n# Implementation of a 2D Character controller.\n# This implementation uses the physics engine for\n# controlling a character, in a very similar way\n# than a 3D character controller would be implemented.\n#\n# Using the physics engine for this has the main\n# advantages:\n# -Easy to write.\n# -Interaction with other physics-based objects is free\n# -Only have to deal with the object linear velocity, not position\n# -All collision\/area framework available\n# \n# But also has the following disadvantages:\n# \n# -Objects may bounce a little bit sometimes\n# -Going up ramps sends the chracter flying up, small hack is needed.\n# -A ray collider is needed to avoid sliding down on ramps and \n# undesiderd bumps, small steps and rare numerical precision errors.\n# (another alternative may be to turn on friction when the character is not moving).\n# -Friction cant be used, so floor velocity must be considered\n# for moving platforms.\n\n# Member variables\nvar anim = \"\"\nvar siding_left = false\nvar jumping = false\nvar stopping_jump = false\nvar shooting = false\n\nvar WALK_ACCEL = 800.0\nvar WALK_DEACCEL = 800.0\nvar WALK_MAX_VELOCITY = 200.0\nvar AIR_ACCEL = 200.0\nvar AIR_DEACCEL = 200.0\nvar JUMP_VELOCITY = 480\nvar STOP_JUMP_FORCE = 900.0\n\nvar MAX_FLOOR_AIRBORNE_TIME = 0.15\n\nvar airborne_time = 1e20\nvar shoot_time = 1e20\n\nvar MAX_SHOOT_POSE_TIME = 0.3\n\nvar bullet = preload(\"res:\/\/scenes\/player\/bullet.tscn\")\n\nvar floor_h_velocity = 0.0\nvar enemy\n\n#func beam_to(spawner):\n\t\n#\tvar spawnerpos = get_node(spawner).get_global_pos()\n#\tprint(\"Beam to active!\")\n#\tself.set_pos(spawnerpos)\n\n\nfunc _integrate_forces(s):\n\tvar lv = s.get_linear_velocity()\n\tvar step = s.get_step()\n\t\n\tvar new_anim = anim\n\tvar new_siding_left = siding_left\n\t\n\t# Get the controls\n\tvar move_left = Input.is_action_pressed(\"move_left\")\n\tvar move_right = Input.is_action_pressed(\"move_right\")\n\tvar jump = Input.is_action_pressed(\"jump\")\n\tvar shoot = Input.is_action_pressed(\"shoot\")\n\tvar spawn = Input.is_action_pressed(\"spawn\")\n\t\n\tif spawn:\n\t\tvar e = enemy.instance()\n\t\tvar p = get_pos()\n\t\tp.y = p.y - 100\n\t\te.set_pos(p)\n\t\tget_parent().add_child(e)\n\t\n\t# Deapply prev floor velocity\n\tlv.x -= floor_h_velocity\n\tfloor_h_velocity = 0.0\n\t\n\t# Find the floor (a contact with upwards facing collision normal)\n\tvar found_floor = false\n\tvar floor_index = -1\n\t\n\tfor x in range(s.get_contact_count()):\n\t\tvar ci = s.get_contact_local_normal(x)\n\t\tif (ci.dot(Vector2(0, -1)) > 0.6):\n\t\t\tfound_floor = true\n\t\t\tfloor_index = x\n\t\n\t# A good idea when impementing characters of all kinds,\n\t# compensates for physics imprecission, as well as human reaction delay.\n\tif (shoot and not shooting):\n\t\tshoot_time = 0\n\t\tvar bi = bullet.instance()\n\t\tvar ss\n\t\tif (siding_left):\n\t\t\tss = -1.0\n\t\telse:\n\t\t\tss = 1.0\n\t\tvar pos = get_pos() + get_node(\"bullet_shoot\").get_pos()*Vector2(ss, 1.0)\n\t\t\n\t\tbi.set_pos(pos)\n\t\tget_parent().add_child(bi)\n\t\t\n\t\tbi.set_linear_velocity(Vector2(800.0*ss, -80))\n\t\tget_node(\"sprite\/smoke\").set_emitting(true)\n\t\tget_node(\"sfx\").play(\"shoot\")\n\t\tPS2D.body_add_collision_exception(bi.get_rid(), get_rid()) # Make bullet and this not collide\n\telse:\n\t\tshoot_time += step\n\t\n\tif (found_floor):\n\t\tairborne_time = 0.0\n\telse:\n\t\tairborne_time += step # Time it spent in the air\n\t\n\tvar on_floor = airborne_time < MAX_FLOOR_AIRBORNE_TIME\n\n\t# Process jump\n\tif (jumping):\n\t\tif (lv.y > 0):\n\t\t\t# Set off the jumping flag if going down\n\t\t\tjumping = false\n\t\t\t\n\t\telif (not jump):\n\t\t\tstopping_jump = true\n\t\t\n\t\tif (stopping_jump):\n\t\t\tlv.y += STOP_JUMP_FORCE*step\n\t\t\t\n\t\t\t\n\t\n\tif (on_floor):\n\t\t# Process logic when character is on floor\n\t\tif (move_left and not move_right):\n\t\t\tif (lv.x > -WALK_MAX_VELOCITY):\n\t\t\t\tlv.x -= WALK_ACCEL*step\n\t\telif (move_right and not move_left):\n\t\t\tif (lv.x < WALK_MAX_VELOCITY):\n\t\t\t\tlv.x += WALK_ACCEL*step\n\t\telse:\n\t\t\tvar xv = abs(lv.x)\n\t\t\txv -= WALK_DEACCEL*step\n\t\t\tif (xv < 0):\n\t\t\t\txv = 0\n\t\t\tlv.x = sign(lv.x)*xv\n\n\t\t\n\t\t# Check jump\n\t\tif (not jumping and jump):\n\t\t\tlv.y = -JUMP_VELOCITY\n\t\t\tjumping = true\n\t\t\tstopping_jump = false\n\t\t\tget_node(\"sfx\").play(\"jump\")\n\t\t\tglobal.times_jumped = global.times_jumped +1\n\t\t\tprint(global.times_jumped)\n\t\t\n\t\t# Check siding\n\t\tif (lv.x < 0 and move_left):\n\t\t\tnew_siding_left = true\n\t\telif (lv.x > 0 and move_right):\n\t\t\tnew_siding_left = false\n\t\tif (jumping):\n\t\t\tnew_anim = \"jumping\"\n\t\telif (abs(lv.x) < 0.1):\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"idle_weapon\"\n\t\t\telse:\n\t\t\t\tnew_anim = \"idle\"\n\t\telse:\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"run_weapon\"\n\t\t\telse:\n\t\t\t\tnew_anim = \"run\"\n\telse:\n\t\t# Process logic when the character is in the air\n\t\tif (move_left and not move_right):\n\t\t\tif (lv.x > -WALK_MAX_VELOCITY):\n\t\t\t\tlv.x -= AIR_ACCEL*step\n\t\telif (move_right and not move_left):\n\t\t\tif (lv.x < WALK_MAX_VELOCITY):\n\t\t\t\tlv.x += AIR_ACCEL*step\n\t\telse:\n\t\t\tvar xv = abs(lv.x)\n\t\t\txv -= AIR_DEACCEL*step\n\t\t\tif (xv < 0):\n\t\t\t\txv = 0\n\t\t\tlv.x = sign(lv.x)*xv\n\t\t\n\t\tif (lv.y < 0):\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"jumping_weapon\"\n\t\t\telse:\n\t\t\t\tnew_anim = \"jumping\"\n\t\telse:\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"falling_weapon\"\n\t\t\t\n\t\t\telse:\n\t\t\t\tnew_anim = \"falling\"\n\t\n\t# Update siding\n\tif (new_siding_left != siding_left):\n\t\tif (new_siding_left):\n\t\t\tget_node(\"sprite\").set_scale(Vector2(-1, 1))\n\t\telse:\n\t\t\tget_node(\"sprite\").set_scale(Vector2(1, 1))\n\t\t\n\t\tsiding_left = new_siding_left\n\t\n\t# Change animation\n\tif (new_anim != anim):\n\t\tanim = new_anim\n\t\tget_node(\"anim\").play(anim)\n\t\n\tshooting = shoot\n\t\n\t# Apply floor velocity\n\tif (found_floor):\n\t\tfloor_h_velocity = s.get_contact_collider_velocity_at_pos(floor_index).x\n\t\tlv.x += floor_h_velocity\n\t\n\t# Finally, apply gravity and set back the linear velocity\n\tlv += s.get_total_gravity()*step\n\ts.set_linear_velocity(lv)\n\n\nfunc _ready():\n\tenemy = ResourceLoader.load(\"res:\/\/scenes\/scn3-forest\/enemy.tscn\")\n\n\n#\tif !Globals.has_singleton(\"Facebook\"):\n#\t\treturn\n#\tvar Facebook = Globals.get_singleton(\"Facebook\")\n#\tvar link = Globals.get(\"facebook\/link\")\n#\tvar icon = Globals.get(\"facebook\/icon\")\n#\tvar msg = \"I just sneezed on your wall! Beat my score and Stop the Running nose!\"\n#\tvar title = \"I just sneezed on your wall!\"\n#\tFacebook.post(\"feed\", msg, title, link, icon)\n","old_contents":"\nextends RigidBody2D\n\n# Character Demo, written by Juan Linietsky.\n#\n# Implementation of a 2D Character controller.\n# This implementation uses the physics engine for\n# controlling a character, in a very similar way\n# than a 3D character controller would be implemented.\n#\n# Using the physics engine for this has the main\n# advantages:\n# -Easy to write.\n# -Interaction with other physics-based objects is free\n# -Only have to deal with the object linear velocity, not position\n# -All collision\/area framework available\n# \n# But also has the following disadvantages:\n# \n# -Objects may bounce a little bit sometimes\n# -Going up ramps sends the chracter flying up, small hack is needed.\n# -A ray collider is needed to avoid sliding down on ramps and \n# undesiderd bumps, small steps and rare numerical precision errors.\n# (another alternative may be to turn on friction when the character is not moving).\n# -Friction cant be used, so floor velocity must be considered\n# for moving platforms.\n\n# Member variables\nvar anim = \"\"\nvar siding_left = false\nvar jumping = false\nvar stopping_jump = false\nvar shooting = false\n\nvar WALK_ACCEL = 800.0\nvar WALK_DEACCEL = 800.0\nvar WALK_MAX_VELOCITY = 200.0\nvar AIR_ACCEL = 200.0\nvar AIR_DEACCEL = 200.0\nvar JUMP_VELOCITY = 460\nvar STOP_JUMP_FORCE = 900.0\n\nvar MAX_FLOOR_AIRBORNE_TIME = 0.15\n\nvar airborne_time = 1e20\nvar shoot_time = 1e20\n\nvar MAX_SHOOT_POSE_TIME = 0.3\n\nvar bullet = preload(\"res:\/\/scenes\/player\/bullet.tscn\")\n\nvar floor_h_velocity = 0.0\nvar enemy\n\n#func beam_to(spawner):\n\t\n#\tvar spawnerpos = get_node(spawner).get_global_pos()\n#\tprint(\"Beam to active!\")\n#\tself.set_pos(spawnerpos)\n\n\nfunc _integrate_forces(s):\n\tvar lv = s.get_linear_velocity()\n\tvar step = s.get_step()\n\t\n\tvar new_anim = anim\n\tvar new_siding_left = siding_left\n\t\n\t# Get the controls\n\tvar move_left = Input.is_action_pressed(\"move_left\")\n\tvar move_right = Input.is_action_pressed(\"move_right\")\n\tvar jump = Input.is_action_pressed(\"jump\")\n\tvar shoot = Input.is_action_pressed(\"shoot\")\n\tvar spawn = Input.is_action_pressed(\"spawn\")\n\t\n\tif spawn:\n\t\tvar e = enemy.instance()\n\t\tvar p = get_pos()\n\t\tp.y = p.y - 100\n\t\te.set_pos(p)\n\t\tget_parent().add_child(e)\n\t\n\t# Deapply prev floor velocity\n\tlv.x -= floor_h_velocity\n\tfloor_h_velocity = 0.0\n\t\n\t# Find the floor (a contact with upwards facing collision normal)\n\tvar found_floor = false\n\tvar floor_index = -1\n\t\n\tfor x in range(s.get_contact_count()):\n\t\tvar ci = s.get_contact_local_normal(x)\n\t\tif (ci.dot(Vector2(0, -1)) > 0.6):\n\t\t\tfound_floor = true\n\t\t\tfloor_index = x\n\t\n\t# A good idea when impementing characters of all kinds,\n\t# compensates for physics imprecission, as well as human reaction delay.\n\tif (shoot and not shooting):\n\t\tshoot_time = 0\n\t\tvar bi = bullet.instance()\n\t\tvar ss\n\t\tif (siding_left):\n\t\t\tss = -1.0\n\t\telse:\n\t\t\tss = 1.0\n\t\tvar pos = get_pos() + get_node(\"bullet_shoot\").get_pos()*Vector2(ss, 1.0)\n\t\t\n\t\tbi.set_pos(pos)\n\t\tget_parent().add_child(bi)\n\t\t\n\t\tbi.set_linear_velocity(Vector2(800.0*ss, -80))\n\t\tget_node(\"sprite\/smoke\").set_emitting(true)\n\t\tget_node(\"sfx\").play(\"shoot\")\n\t\tPS2D.body_add_collision_exception(bi.get_rid(), get_rid()) # Make bullet and this not collide\n\telse:\n\t\tshoot_time += step\n\t\n\tif (found_floor):\n\t\tairborne_time = 0.0\n\telse:\n\t\tairborne_time += step # Time it spent in the air\n\t\n\tvar on_floor = airborne_time < MAX_FLOOR_AIRBORNE_TIME\n\n\t# Process jump\n\tif (jumping):\n\t\tif (lv.y > 0):\n\t\t\t# Set off the jumping flag if going down\n\t\t\tjumping = false\n\t\t\t\n\t\telif (not jump):\n\t\t\tstopping_jump = true\n\t\t\n\t\tif (stopping_jump):\n\t\t\tlv.y += STOP_JUMP_FORCE*step\n\t\t\t\n\t\t\t\n\t\n\tif (on_floor):\n\t\t# Process logic when character is on floor\n\t\tif (move_left and not move_right):\n\t\t\tif (lv.x > -WALK_MAX_VELOCITY):\n\t\t\t\tlv.x -= WALK_ACCEL*step\n\t\telif (move_right and not move_left):\n\t\t\tif (lv.x < WALK_MAX_VELOCITY):\n\t\t\t\tlv.x += WALK_ACCEL*step\n\t\telse:\n\t\t\tvar xv = abs(lv.x)\n\t\t\txv -= WALK_DEACCEL*step\n\t\t\tif (xv < 0):\n\t\t\t\txv = 0\n\t\t\tlv.x = sign(lv.x)*xv\n\n\t\t\n\t\t# Check jump\n\t\tif (not jumping and jump):\n\t\t\tlv.y = -JUMP_VELOCITY\n\t\t\tjumping = true\n\t\t\tstopping_jump = false\n\t\t\tget_node(\"sfx\").play(\"jump\")\n\t\t\tglobal.times_jumped = global.times_jumped +1\n\t\t\tprint(globals.times_jumped)\n\t\t\n\t\t# Check siding\n\t\tif (lv.x < 0 and move_left):\n\t\t\tnew_siding_left = true\n\t\telif (lv.x > 0 and move_right):\n\t\t\tnew_siding_left = false\n\t\tif (jumping):\n\t\t\tnew_anim = \"jumping\"\n\t\telif (abs(lv.x) < 0.1):\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"idle_weapon\"\n\t\t\telse:\n\t\t\t\tnew_anim = \"idle\"\n\t\telse:\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"run_weapon\"\n\t\t\telse:\n\t\t\t\tnew_anim = \"run\"\n\telse:\n\t\t# Process logic when the character is in the air\n\t\tif (move_left and not move_right):\n\t\t\tif (lv.x > -WALK_MAX_VELOCITY):\n\t\t\t\tlv.x -= AIR_ACCEL*step\n\t\telif (move_right and not move_left):\n\t\t\tif (lv.x < WALK_MAX_VELOCITY):\n\t\t\t\tlv.x += AIR_ACCEL*step\n\t\telse:\n\t\t\tvar xv = abs(lv.x)\n\t\t\txv -= AIR_DEACCEL*step\n\t\t\tif (xv < 0):\n\t\t\t\txv = 0\n\t\t\tlv.x = sign(lv.x)*xv\n\t\t\n\t\tif (lv.y < 0):\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"jumping_weapon\"\n\t\t\telse:\n\t\t\t\tnew_anim = \"jumping\"\n\t\telse:\n\t\t\tif (shoot_time < MAX_SHOOT_POSE_TIME):\n\t\t\t\tnew_anim = \"falling_weapon\"\n\t\t\t\n\t\t\telse:\n\t\t\t\tnew_anim = \"falling\"\n\t\n\t# Update siding\n\tif (new_siding_left != siding_left):\n\t\tif (new_siding_left):\n\t\t\tget_node(\"sprite\").set_scale(Vector2(-1, 1))\n\t\telse:\n\t\t\tget_node(\"sprite\").set_scale(Vector2(1, 1))\n\t\t\n\t\tsiding_left = new_siding_left\n\t\n\t# Change animation\n\tif (new_anim != anim):\n\t\tanim = new_anim\n\t\tget_node(\"anim\").play(anim)\n\t\n\tshooting = shoot\n\t\n\t# Apply floor velocity\n\tif (found_floor):\n\t\tfloor_h_velocity = s.get_contact_collider_velocity_at_pos(floor_index).x\n\t\tlv.x += floor_h_velocity\n\t\n\t# Finally, apply gravity and set back the linear velocity\n\tlv += s.get_total_gravity()*step\n\ts.set_linear_velocity(lv)\n\n\nfunc _ready():\n\tenemy = ResourceLoader.load(\"res:\/\/scenes\/scn3-forest\/enemy.tscn\")\n\n\n#\tif !Globals.has_singleton(\"Facebook\"):\n#\t\treturn\n#\tvar Facebook = Globals.get_singleton(\"Facebook\")\n#\tvar link = Globals.get(\"facebook\/link\")\n#\tvar icon = Globals.get(\"facebook\/icon\")\n#\tvar msg = \"I just sneezed on your wall! Beat my score and Stop the Running nose!\"\n#\tvar title = \"I just sneezed on your wall!\"\n#\tFacebook.post(\"feed\", msg, title, link, icon)\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"GDScript"} {"commit":"baa08b9bbeeec7e2817304fe5bdb118b4c4e93d5","subject":"add fat add power","message":"add fat add power\n","repos":"P1X-in\/rat-is-fat","old_file":"scripts\/player.gd","new_file":"scripts\/player.gd","new_contents":"extends \"res:\/\/scripts\/moving_object.gd\"\n\nvar is_playing = false\nvar is_alive = true\nvar attack_range = 100\nvar attack_width = PI * 0.33\nvar attack_strength = 1\n\nvar target_cone\nvar target_cone_vector = [0, 0]\nvar target_cone_angle = 0.0\n\nfunc _init(bag).(bag):\n self.bag = bag\n self.velocity = 200\n self.avatar = preload(\"res:\/\/scenes\/player\/player.xscn\").instance()\n self.initial_position = Vector2(100, 100)\n self.body_part_head = self.avatar.get_node('head')\n self.body_part_body = self.avatar.get_node('body')\n self.body_part_footer = self.avatar.get_node('footer')\n self.target_cone = self.avatar.get_node('attack_cone')\n\nfunc bind_gamepad(id):\n var gamepad = self.bag.input.devices['pad' + str(id)]\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_enter_game_gamepad.gd\").new(self.bag, self))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_axis.gd\").new(self.bag, self, 0))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_axis.gd\").new(self.bag, self, 1))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_gamepad.gd\").new(self.bag, self, 2))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_gamepad.gd\").new(self.bag, self, 3))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_gamepad.gd\").new(self.bag, self))\n\nfunc bind_keyboard_and_mouse():\n var keyboard = self.bag.input.devices['keyboard']\n var mouse = self.bag.input.devices['mouse']\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_enter_game_keyboard.gd\").new(self.bag, self))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 1, KEY_W, -1))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 1, KEY_S, 1))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 0, KEY_A, -1))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 0, KEY_D, 1))\n mouse.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_mouse.gd\").new(self.bag, self))\n mouse.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_mouse.gd\").new(self.bag, self))\n\nfunc enter_game():\n self.is_playing = true\n self.spawn()\n\nfunc spawn():\n self.is_alive = true\n .spawn()\n\nfunc die():\n self.is_alive = false\n .die()\n\nfunc process(delta):\n self.adjust_attack_cone()\n .process(delta)\n\nfunc modify_position(delta):\n .modify_position(delta)\n self.flip(self.target_cone_vector[0])\n\nfunc adjust_attack_cone():\n if abs(self.target_cone_vector[0]) < self.AXIS_THRESHOLD || abs(self.target_cone_vector[1]) < self.AXIS_THRESHOLD:\n return\n\n self.target_cone_angle = -atan2(self.target_cone_vector[1], self.target_cone_vector[0]) - PI\/2\n self.target_cone.set_rot(self.target_cone_angle)\n\nfunc attack():\n var enemies\n enemies = self.bag.enemies.get_enemies_near_object(self, self.attack_range, self.target_cone_vector, self.attack_width)\n for enemy in enemies:\n enemy.recieve_damage(self.attack_strength)\n enemy.push_back(self)\n\nfunc get_power(amount):\n self.attack_strength += amount\n if self.attack_range >= 16:\n self.die();\n \n self.hp -= amount\n self.max_hp -= amount\n\nfunc get_fat(amount):\n self.hp += amount\n self.max_hp += amount\n\n\n","old_contents":"extends \"res:\/\/scripts\/moving_object.gd\"\n\nvar is_playing = false\nvar is_alive = true\nvar attack_range = 100\nvar attack_width = PI * 0.33\nvar attack_strength = 1\n\nvar target_cone\nvar target_cone_vector = [0, 0]\nvar target_cone_angle = 0.0\n\nfunc _init(bag).(bag):\n self.bag = bag\n self.velocity = 200\n self.avatar = preload(\"res:\/\/scenes\/player\/player.xscn\").instance()\n self.initial_position = Vector2(100, 100)\n self.body_part_head = self.avatar.get_node('head')\n self.body_part_body = self.avatar.get_node('body')\n self.body_part_footer = self.avatar.get_node('footer')\n self.target_cone = self.avatar.get_node('attack_cone')\n\nfunc bind_gamepad(id):\n var gamepad = self.bag.input.devices['pad' + str(id)]\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_enter_game_gamepad.gd\").new(self.bag, self))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_axis.gd\").new(self.bag, self, 0))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_axis.gd\").new(self.bag, self, 1))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_gamepad.gd\").new(self.bag, self, 2))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_gamepad.gd\").new(self.bag, self, 3))\n gamepad.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_gamepad.gd\").new(self.bag, self))\n\nfunc bind_keyboard_and_mouse():\n var keyboard = self.bag.input.devices['keyboard']\n var mouse = self.bag.input.devices['mouse']\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_enter_game_keyboard.gd\").new(self.bag, self))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 1, KEY_W, -1))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 1, KEY_S, 1))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 0, KEY_A, -1))\n keyboard.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_move_key.gd\").new(self.bag, self, 0, KEY_D, 1))\n mouse.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_cone_mouse.gd\").new(self.bag, self))\n mouse.register_handler(preload(\"res:\/\/scripts\/input\/handlers\/player_attack_mouse.gd\").new(self.bag, self))\n\nfunc enter_game():\n self.is_playing = true\n self.spawn()\n\nfunc spawn():\n self.is_alive = true\n .spawn()\n\nfunc die():\n self.is_alive = false\n .die()\n\nfunc process(delta):\n self.adjust_attack_cone()\n .process(delta)\n\nfunc modify_position(delta):\n .modify_position(delta)\n self.flip(self.target_cone_vector[0])\n\nfunc adjust_attack_cone():\n if abs(self.target_cone_vector[0]) < self.AXIS_THRESHOLD || abs(self.target_cone_vector[1]) < self.AXIS_THRESHOLD:\n return\n\n self.target_cone_angle = -atan2(self.target_cone_vector[1], self.target_cone_vector[0]) - PI\/2\n self.target_cone.set_rot(self.target_cone_angle)\n\nfunc attack():\n var enemies\n enemies = self.bag.enemies.get_enemies_near_object(self, self.attack_range, self.target_cone_vector, self.attack_width)\n for enemy in enemies:\n enemy.recieve_damage(self.attack_strength)\n enemy.push_back(self)\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"dfb9b0ad894281cef19db3d891a7b470db645f36","subject":"Fix typos","message":"Fix typos\n","repos":"groboclown\/godot-bootstrap","old_file":"components\/unit_tests\/base.gd","new_file":"components\/unit_tests\/base.gd","new_contents":"# base test class\r\n\r\n#extends Object\r\n\r\nvar _tests = []\r\nvar filename = \"\"\r\nvar _results = null\r\n\r\nfunc _init():\r\n\tvar t\r\n\tfor t in get_method_list():\r\n\t\t# print(t.to_json())\r\n\t\tif t[\"name\"].begins_with(\"test_\") && t[\"args\"].size() <= 0:\r\n\t\t\tadd(t[\"name\"])\r\n\r\n\r\nfunc class_setup():\r\n\tpass\r\n\r\n\r\nfunc class_teardown():\r\n\tpass\r\n\r\n\r\nfunc setup():\r\n\tpass\r\n\r\n\r\nfunc teardown():\r\n\tpass\r\n\r\n\r\n# ------------------------------------------------------------------------\r\n\r\n\r\nfunc add(test_name):\r\n\tif test_name == null:\r\n\t\treturn\r\n\tif typeof(test_name) == TYPE_STRING:\r\n\t\tif not(test_name in _tests):\r\n\t\t\t_tests.append(test_name)\r\n\telse:\r\n\t\tvar t\r\n\t\tfor t in test_name:\r\n\t\t\tif t != null && not(t in _tests):\r\n\t\t\t\t_tests.append(t)\r\n\r\n\r\nfunc add_all(all_tests):\r\n\tadd(all_tests)\r\n\r\n\r\nfunc set_tests(test_names):\r\n\t_tests = []\r\n\tadd(test_names)\r\n\r\n\r\nfunc skip(test_name):\r\n\tif test_name == null:\r\n\t\treturn\r\n\tif typeof(test_name) == TYPE_STRING:\r\n\t\t_tests.erase(test_name)\r\n\telse:\r\n\t\tvar t\r\n\t\tfor t in test_name:\r\n\t\t\t_tests.erase(test_name)\r\n\r\n\r\n# ------------------------------------------------------------------------\r\n\r\n\r\nfunc check_true(text, bool_val):\r\n\tif ! bool_val:\r\n\t\tif _results != null:\r\n\t\t\t_results.add_error(text)\r\n\t\treturn false\r\n\treturn true\r\n\r\nfunc check_that(text, actual, matcher):\r\n\treturn check_true(text + \": \" + matcher.describe(actual), matcher.matches(actual))\r\n\r\nfunc check(text = \"\"):\r\n\treturn Checker.new(_results, text)\r\n\r\n\r\n\r\n\r\n# ------------------------------------------------------------------------\r\n\r\n# result_collector must implement these methods:\r\n# func start_suite(suite_name)\r\n# func end_suite()\r\n# func start_test(name)\r\n# func end_test()\r\n# func add_error(message)\r\n# func has_errors() (does the current suite have any errors?)\r\n\r\n\r\nfunc run(result_collector):\r\n\tself._results = result_collector\r\n\tresult_collector.start_suite(filename)\r\n\tclass_setup()\r\n\tif result_collector.has_error():\r\n\t\treturn\r\n\r\n\tvar t\r\n\tfor t in _tests:\r\n\t\tif has_method(t):\r\n\t\t\trun_test(t)\r\n\t\telse:\r\n\t\t\tresult_collector.add_error(\"Setup Error: requested function does not exist: \" + t)\r\n\r\n\tclass_teardown()\r\n\tresult_collector.end_suite()\r\n\r\n\r\nfunc run_test(name):\r\n\tif _results != null:\r\n\t\t_results.start_test(name)\r\n\tsetup()\r\n\tcall(name)\r\n\tteardown()\r\n\tif _results != null:\r\n\t\t_results.end_test()\r\n\r\n\r\n# -------------------------------------------------------------------------\r\n\r\n\r\nclass Matcher:\r\n\tfunc matches(value):\r\n\t\treturn false\r\n\tfunc describe(value):\r\n\t\treturn \"\"\r\n\tfunc _as_str(value):\r\n\t\tif value == null:\r\n\t\t\treturn \"\"\r\n\t\tif typeof(value) == TYPE_DICTIONARY:\r\n\t\t\treturn value.to_json()\r\n\t\treturn \"[\" + str(value) + \"]\"\r\n\tfunc _is_list(value):\r\n\t\t# return typeof(value) == TYPE_ARRAY || typeof(value) == TYPE_INT_ARRAY || typeof(value) == TYPE_REAL_ARRAY || typeof(value) == TYPE_STRING_ARRAY\r\n\t\t# All the arrays are in this specific range.\r\n\t\t# This needs to be checked against future versions of Godot.\r\n\t\tvar v = typeof(value)\r\n\t\treturn v >= TYPE_ARRAY && v <= TYPE_COLOR_ARRAY\r\n\r\n\r\nclass IsMatcher:\r\n\textends Matcher\r\n\tvar val\r\n\r\n\tfunc _init(v):\r\n\t\tval = v\r\n\r\n\tfunc matches(value):\r\n\t\treturn _inner_match(val, value, [])\r\n\r\n\tfunc _inner_match(v1, v2, seen):\r\n\t\tseen.append(v2)\r\n\t\t# Check lists the same way\r\n\t\tif _is_list(v1) && _is_list(v2):\r\n\t\t\tif v1.size() != v2.size():\r\n\t\t\t\treturn false\r\n\t\t\tvar i\r\n\t\t\tfor i in range(0, v1.size()):\r\n\t\t\t\tif v2[i] in seen:\r\n\t\t\t\t\t# This isn't a correct check; instead,\r\n\t\t\t\t\t# we need to ensure that the seen version of v2[i]\r\n\t\t\t\t\t# matches up with the corresponding seen version of v1[i]\r\n\t\t\t\t\tif v1[i] != v2[i]:\r\n\t\t\t\t\t\treturn false\r\n\t\t\t\t\t# Else prevent infinite loop by just\r\n\t\t\t\t\t# saying it's right.\r\n\t\t\t\telif ! _inner_match(v1[i], v2[i], seen):\r\n\t\t\t\t\treturn false\r\n\t\t\treturn true\r\n\t\t# Cannot perform a \"==\" if the types are different\r\n\t\tif typeof(v1) != typeof(v2):\r\n\t\t\treturn false\r\n\t\tif v1 == v2:\r\n\t\t\treturn true\r\n\t\tif typeof(v1) == TYPE_DICTIONARY:\r\n\t\t\tif v1.size() != v2.size():\r\n\t\t\t\treturn false\r\n\t\t\tvar k\r\n\t\t\tfor k in v1:\r\n\t\t\t\tif not (k in v2):\r\n\t\t\t\t\treturn false\r\n\t\t\t\tif v2[k] in seen:\r\n\t\t\t\t\t# This isn't a correct check; instead,\r\n\t\t\t\t\t# we need to ensure that the seen version of v2[i]\r\n\t\t\t\t\t# matches up with the corresponding seen version of v1[i]\r\n\t\t\t\t\tif v1[k] != v2[k]:\r\n\t\t\t\t\t\treturn false\r\n\t\t\t\telif ! _inner_match(v1[k], v2[k], seen):\r\n\t\t\t\t\treturn false\r\n\t\t\treturn true\r\n\t\t# Any other type should have == match right.\r\n\t\treturn false\r\n\r\n\tfunc describe(value):\r\n\t\treturn \"expected \" + _as_str(val) + \", found \" + _as_str(value)\r\n\r\n\r\n\r\nstatic func is(value):\r\n\t# \"is\" can be used to make a clear English-like sentence.\r\n\t# So, if the value is a matcher, then just use that matcher instead of\r\n\t# adding another layer around \"is\".\r\n\tif typeof(value) == TYPE_OBJECT && value.has_method(\"matches\") && value.has_method(\"describe\"):\r\n\t\treturn value\r\n\t# Need to wrap the value in an is check.\r\n\treturn IsMatcher.new(value)\r\n\r\n\r\nstatic func equals(value):\r\n\treturn IsMatcher.new(value)\r\n\r\n\r\nclass NotMatcher:\r\n\tvar val\r\n\r\n\tfunc _init(v):\r\n\t\tif typeof(v) == TYPE_OBJECT && v extends Matcher:\r\n\t\t\tval = v\r\n\t\telse:\r\n\t\t\tval = IsMatcher.new(v)\r\n\r\n\tfunc matches(value):\r\n\t\treturn ! val.matches(value)\r\n\r\n\tfunc describe(value):\r\n\t\treturn \"expected not: \" + val.describe(value)\r\n\r\n\r\n\r\nstatic func is_not(value):\r\n\treturn NotMatcher.new(value)\r\n\r\n\r\n\r\nclass BetweenMatcher:\r\n\tvar lo\r\n\tvar hi\r\n\r\n\tfunc _init(l, h):\r\n\t\tlo = float(l)\r\n\t\thi = float(h)\r\n\r\n\tfunc matches(value):\r\n\t\treturn value != null && float(value) >= lo && float(value) <= hi\r\n\r\n\tfunc describe(value):\r\n\t\treturn \"expected [\" + str(lo) + \", \" + str(hi) + \"], found \" + str(value)\r\n\r\n\r\n\r\nstatic func between(lo, hi):\r\n\treturn BetweenMatcher.new(lo, hi)\r\n\r\n\r\nclass NearMatcher:\r\n\tvar _epsilon\r\n\tvar _val\r\n\r\n\tfunc _init(val, epsilon = 0.00001):\r\n\t\t_epsilon = float(epsilon)\r\n\t\t_val = float(val)\r\n\r\n\tfunc matches(value):\r\n\t\treturn abs(float(value) - _val) <= _epsilon\r\n\r\n\tfunc describe(value):\r\n\t\treturn \"expected \" + str(_val) + \" within \" + str(_epsilon) + \", found \" + str(value)\r\n\r\n\r\nstatic func near(val, epsilon = 0.00001):\r\n\treturn NearMatcher.new(val, epsilon)\r\n\r\n\r\nclass ContainsMatcher:\r\n\textends Matcher\r\n\tvar _val\r\n\r\n\tfunc _init(val):\r\n\t\t_val = val\r\n\r\n\tfunc matches(actual):\r\n\t\tif actual == null:\r\n\t\t\treturn false\r\n\t\tif typeof(actual) == TYPE_STRING:\r\n\t\t\t# Expect a string to contain a sub-string\r\n\t\t\treturn actual.find(_val) >= 0\r\n\t\tif _is_list(actual):\r\n\t\t\tif _is_list(_val):\r\n\t\t\t\t# each \"val\" must be in the actual list\r\n\t\t\t\tvar v\r\n\t\t\t\tfor v in _val:\r\n\t\t\t\t\tif ! (v in actual):\r\n\t\t\t\t\t\treturn false\r\n\t\t\t\treturn true\r\n\t\t\treturn _val in actual\r\n\t\tif typeof(actual) == TYPE_RECT2:\r\n\t\t\tif typeof(_val) == TYPE_RECT2:\r\n\t\t\t\treturn actual.encloses(_val)\r\n\t\t\tif typeof(_val) == TYPE_VECTOR2:\r\n\t\t\t\treturn actual.has_point(_val)\r\n\t\t\treturn false\r\n\t\tif typeof(actual) == TYPE_PLANE:\r\n\t\t\tif typeof(_val) == TYPE_VECTOR3:\r\n\t\t\t\treturn actual.has_point(_val)\r\n\t\t\treturn false\r\n\t\tif typeof(actual) == TYPE_DICTIONARY:\r\n\t\t\tif _is_list(_val):\r\n\t\t\t\treturn actual.has_all(_val)\r\n\t\t \treturn actual.has(_val)\r\n\r\n\r\n\t\t# These don't really make sense.\r\n\r\n\t\t# Object values should just be checked for equality.\r\n\t\t#if typeof(actual) == TYPE_OBJECT:\r\n\t\t#\treturn actual.get(_val) != null\r\n\r\n\t\treturn false\r\n\r\n\tfunc describe(actual):\r\n\t\treturn \"expected \" + _as_str(actual) + \" to contain \" + _as_str(_val)\r\n\r\nstatic func contains(val):\r\n\treturn ContainsMatcher.new(val)\r\n\r\n\r\nclass EmptyMatcher:\r\n\textends Matcher\r\n\r\n\tfunc matches(actual):\r\n\t\tif _is_list(actual):\r\n\t\t\treturn actual.size() <= 0\r\n\t\tif typeof(actual) == TYPE_DICTIONARY:\r\n\t\t\treturn actual.keys().size() <= 0\r\n\t\treturn false\r\n\r\n\tfunc describe(actual):\r\n\t\tif _is_list(actual):\r\n\t\t\treturn \"expected \" + _as_str(actual) + \" to be an empty list\"\r\n\t\tif typeof(actual) == TYPE_DICTIONARY:\r\n\t\t\treturn \"expected \" + _as_str(actual) + \" to be an empty dictionary\"\r\n\t\treturn \"expected \" + _as_str(actual) + \" to be an empty list or dictionary\"\r\n\r\nstatic func empty():\r\n\treturn EmptyMatcher.new()\r\n\r\n\r\n# ---------------------------------------------------------------------------\r\n\r\nclass Checker:\r\n\tvar _text\r\n\tvar _results\r\n\r\n\tfunc _init(results, text):\r\n\t\t_results = results\r\n\t\t_text = text\r\n\r\n\tfunc that(actual, matcher):\r\n\t\tvar res\r\n\t\tvar msg\r\n\t\tif typeof(matcher) == TYPE_BOOL:\r\n\t\t\tres = matcher\r\n\t\t\tmsg = _text\r\n\t\telse:\r\n\t\t\tres = matcher.matches(actual)\r\n\t\t\tmsg = _text + \": \" + matcher.describe(actual)\r\n\t\tif ! res:\r\n\t\t\tif _results != null:\r\n\t\t\t\t_results.add_error(msg)\r\n\t\t\treturn false\r\n\t\treturn true\r\n","old_contents":"# base test class\r\n\r\n#extends Object\r\n\r\nvar _tests = []\r\nvar filename = \"\"\r\nvar _results = null\r\n\r\nfunc _init():\r\n\tvar t\r\n\tfor t in get_method_list():\r\n\t\t# print(t.to_json())\r\n\t\tif t[\"name\"].begins_with(\"test_\") && t[\"args\"].size() <= 0:\r\n\t\t\tadd(t[\"name\"])\r\n\r\n\r\nfunc class_setup():\r\n\tpass\r\n\r\n\r\nfunc class_teardown():\r\n\tpass\r\n\r\n\r\nfunc setup():\r\n\tpass\r\n\r\n\r\nfunc teardown():\r\n\tpass\r\n\r\n\r\n# ------------------------------------------------------------------------\r\n\r\n\r\nfunc add(test_name):\r\n\tif test_name == null:\r\n\t\treturn\r\n\tif typeof(test_name) == TYPE_STRING:\r\n\t\tif not(test_name in _tests):\r\n\t\t\t_tests.append(test_name)\r\n\telse:\r\n\t\tvar t\r\n\t\tfor t in test_name:\r\n\t\t\tif t != null && not(t in _tests):\r\n\t\t\t\t_tests.append(t)\r\n\r\n\r\nfunc add_all(all_tests):\r\n\tadd(all_tests)\r\n\r\n\r\nfunc set_tests(test_names):\r\n\t_tests = []\r\n\tadd(test_names)\r\n\r\n\r\nfunc skip(test_name):\r\n\tif test_name == null:\r\n\t\treturn\r\n\tif typeof(test_name) == TYPE_STRING:\r\n\t\t_tests.erase(test_name)\r\n\telse:\r\n\t\tvar t\r\n\t\tfor t in test_name:\r\n\t\t\t_tests.erase(test_name)\r\n\r\n\r\n# ------------------------------------------------------------------------\r\n\r\n\r\nfunc check_true(text, bool_val):\r\n\tif ! bool_val:\r\n\t\tif _results != null:\r\n\t\t\t_results.add_error(text)\r\n\t\treturn false\r\n\treturn true\r\n\r\nfunc check_that(text, actual, matcher):\r\n\treturn check_true(text + \": \" + matcher.describe(actual), matcher.matches(actual))\r\n\r\nfunc check(text = \"\"):\r\n\treturn Checker.new(_results, text)\r\n\r\n\r\n\r\n\r\n# ------------------------------------------------------------------------\r\n\r\n# result_collector must implement these methods:\r\n# func start_suite(suite_name)\r\n# func end_suite()\r\n# func start_test(name)\r\n# func end_test()\r\n# func add_error(message)\r\n# func has_errors() (does the current suite have any errors?)\r\n\r\n\r\nfunc run(result_collector):\r\n\tself._results = result_collector\r\n\tresult_collector.start_suite(filename)\r\n\tclass_setup()\r\n\tif result_collector.has_error():\r\n\t\treturn\r\n\r\n\tvar t\r\n\tfor t in _tests:\r\n\t\tif has_method(t):\r\n\t\t\trun_test(t)\r\n\t\telse:\r\n\t\t\tresult_collector.add_error(\"Setup Error: requested function does not exist: \" + t)\r\n\r\n\tclass_teardown()\r\n\tresult_collector.end_suite()\r\n\r\n\r\nfunc run_test(name):\r\n\tif _results != null:\r\n\t\t_results.start_test(name)\r\n\tsetup()\r\n\tcall(name)\r\n\tteardown()\r\n\tif _results != null:\r\n\t\t_results.end_test()\r\n\r\n\r\n# -------------------------------------------------------------------------\r\n\r\n\r\nclass Matcher:\r\n\tfunc matches(value):\r\n\t\treturn false\r\n\tfunc describe(value):\r\n\t\treturn \"\"\r\n\tfunc _as_str(value):\r\n\t\tif value == null:\r\n\t\t\treturn \"\"\r\n\t\tif typeof(value) == TYPE_DICTIONARY:\r\n\t\t\treturn value.to_json()\r\n\t\treturn \"[\" + str(value) + \"]\"\r\n\tfunc _is_list(value):\r\n\t\t# return typeof(value) == TYPE_ARRAY || typeof(value) == TYPE_INT_ARRAY || typeof(value) == TYPE_REAL_ARRAY || typeof(value) == TYPE_STRING_ARRAY\r\n\t\t# All the arrays are in this specific range.\r\n\t\t# This needs to be checked against future versions of Godot.\r\n\t\tvar v = typeof(value)\r\n\t\treturn v >= TYPE_ARRAY && v <= TYPE_COLOR_ARRAY\r\n\r\n\r\nclass IsMatcher:\r\n\textends Matcher\r\n\tvar val\r\n\r\n\tfunc _init(v):\r\n\t\tval = v\r\n\r\n\tfunc matches(value):\r\n\t\treturn _inner_match(val, value, [])\r\n\r\n\tfunc _inner_match(v1, v2, seen):\r\n\t\tseen.append(v2)\r\n\t\t# Check lists the same way\r\n\t\tif _is_list(v1) && _is_list(v2):\r\n\t\t\tif v1.size() != v2.size():\r\n\t\t\t\treturn false\r\n\t\t\tvar i\r\n\t\t\tfor i in range(0, v1.size()):\r\n\t\t\t\tif v2[i] in seen:\r\n\t\t\t\t\t# This isn't a correct check; instead,\r\n\t\t\t\t\t# we need to ensure that the seen version of v2[i]\r\n\t\t\t\t\t# matches up with the corresponding seen version of v1[i]\r\n\t\t\t\t\tif v1[i] != v2[i]:\r\n\t\t\t\t\t\treturn false\r\n\t\t\t\t\t# Else prevent infinite loop by just\r\n\t\t\t\t\t# saying it's right.\r\n\t\t\t\telif ! _inner_match(v1[i], v2[i], seen):\r\n\t\t\t\t\treturn false\r\n\t\t\treturn true\r\n\t\t# Cannot perform a \"==\" if the types are different\r\n\t\tif typeof(v1) != typeof(v2):\r\n\t\t\treturn false\r\n\t\tif v1 == v2:\r\n\t\t\treturn true\r\n\t\tif typeof(v1) == TYPE_DICTIONARY:\r\n\t\t\tif v1.size() != v2.size():\r\n\t\t\t\treturn false\r\n\t\t\tvar k\r\n\t\t\tfor k in v1:\r\n\t\t\t\tif not (k in v2):\r\n\t\t\t\t\treturn false\r\n\t\t\t\tif v2[k] in seen:\r\n\t\t\t\t\t# This isn't a correct check; instead,\r\n\t\t\t\t\t# we need to ensure that the seen version of v2[i]\r\n\t\t\t\t\t# matches up with the corresponding seen version of v1[i]\r\n\t\t\t\t\tif v1[k] != v2[k]:\r\n\t\t\t\t\t\treturn false\r\n\t\t\t\telif ! _inner_match(v1[k], v2[k], seen):\r\n\t\t\t\t\treturn false\r\n\t\t\treturn true\r\n\t\t# Any other type should have == match right.\r\n\t\treturn false\r\n\r\n\tfunc describe(value):\r\n\t\treturn \"expected \" + _as_str(val) + \", found \" + _as_str(value)\r\n\r\n\r\n\r\nstatic func is(value):\r\n\t# \"is\" can be used to make a clear English-like sentence.\r\n\t# So, if the value is a matcher, then just use that matcher instead of\r\n\t# adding another layer around \"is\".\r\n\tif typeof(value) == TYPE_OBJECT && value.has_method(\"matches\") && value.has_method(\"describe\"):\r\n\t\treturn value\r\n\t# Need to wrap the value in an is check.\r\n\treturn IsMatcher.new(value)\r\n\r\n\r\nstatic func equals(value):\r\n\treturn IsMatcher.new(value)\r\n\r\n\r\nclass NotMatcher:\r\n\tvar val\r\n\r\n\tfunc _init(v):\r\n\t\tif typeof(v) == TYPE_OBJECT && v extends Matcher:\r\n\t\t\tval = v\r\n\t\telse:\r\n\t\t\tval = IsMatcher.new(v)\r\n\r\n\tfunc matches(value):\r\n\t\treturn ! val.matches(value)\r\n\r\n\tfunc describe(value):\r\n\t\treturn \"expected not: \" + val.describe(value)\r\n\r\n\r\n\r\nstatic func is_not(value):\r\n\treturn NotMatcher.new(value)\r\n\r\n\r\n\r\nclass BetweenMatcher:\r\n\tvar lo\r\n\tvar hi\r\n\r\n\tfunc _init(l, h):\r\n\t\tlo = float(l)\r\n\t\thi = float(h)\r\n\r\n\tfunc matches(value):\r\n\t\treturn value != null && float(value) >= lo && float(value) <= hi\r\n\r\n\tfunc describe(value):\r\n\t\treturn \"expected [\" + str(lo) + \", \" + str(hi) + \"], found \" + str(value)\r\n\r\n\r\n\r\nstatic func between(lo, hi):\r\n\treturn BetweenMatcher.new(lo, hi)\r\n\r\n\r\nclass NearMatcher:\r\n\tvar _epsilon\r\n\tvar _val\r\n\r\n\tfunc _init(val, epsilon = 0.00001):\r\n\t\t_epsilon = float(epsilon)\r\n\t\t_val = float(val)\r\n\r\n\tfunc matches(value):\r\n\t\treturn abs(float(value) - _val) <= _epsilon\r\n\r\n\tfunc describe(value):\r\n\t\treturn \"expected \" + str(_val) + \" within \" + str(_epsilon) + \", found \" + str(value)\r\n\r\n\r\nstatic func near(val, epsilon = 0.00001):\r\n\treturn NearMatcher.new(val, epsilon)\r\n\r\n\r\nclass ContainsMatcher:\r\n\textends Matcher\r\n\tvar _val\r\n\r\n\tfunc _init(val):\r\n\t\t_val = val\r\n\r\n\tfunc matches(actual):\r\n\t\tif actual == null:\r\n\t\t\treturn false\r\n\t\tif typeof(actual) == TYPE_STRING:\r\n\t\t\t# Expect a string to contain a sub-string\r\n\t\t\treturn actual.find(_val) >= 0\r\n\t\tif _is_list(actual):\r\n\t\t\tif _is_list(_val):\r\n\t\t\t\t# each \"val\" must be in the actual list\r\n\t\t\t\tvar v\r\n\t\t\t\tfor v in _val:\r\n\t\t\t\t\tif ! (v in actual):\r\n\t\t\t\t\t\treturn false\r\n\t\t\t\treturn true\r\n\t\t\treturn _val in actual\r\n\t\tif typeof(actual) == TYPE_RECT2:\r\n\t\t\tif typeof(_val) == TYPE_RECT2:\r\n\t\t\t\treturn actual.encloses(_val)\r\n\t\t\tif typeof(_val) == TYPE_VECTOR2:\r\n\t\t\t\treturn actual.has_point(_val)\r\n\t\t\treturn false\r\n\t\tif typeof(actual) == TYPE_PLANE:\r\n\t\t\tif typeof(_val) == TYPE_VECTOR3:\r\n\t\t\t\treturn actual.has_point(_val)\r\n\t\t\treturn false\r\n\t\tif typeof(actual) == TYPE_DICTIONARY:\r\n\t\t\tif _is_list(_val):\r\n\t\t\t\treturn actual.has_all(_val)\r\n\t\t \treturn actual.has(_val)\r\n\r\n\r\n\t\t# These don't really make sense.\r\n\r\n\t\t# Object values should just be checked for equality.\r\n\t\t#if typeof(actual) == TYPE_OBJECT:\r\n\t\t#\treturn actual.get(_val) != null\r\n\r\n\t\treturn false\r\n\r\n\tfunc describe(actual):\r\n\t\treturn \"expected \" + _as_str(actual) + \" to contain \" + _as_str(_val)\r\n\r\nstatic func contains(val):\r\n\treturn ContainsMatcher.new(val)\r\n\r\n\r\nclass EmptyMatcher:\r\n\textends Matcher\r\n\r\n\tfunc matches(actual):\r\n\t\tif _is_list(actual):\r\n\t\t\treturn actual.size() <= 0\r\n\t\tif typeof(actual) == TYPE_DICTIONARY:\r\n\t\t\treturn actual.keys().size() <= 0\r\n\t\treturn false\r\n\r\n\tfunc describe(actual):\r\n\t\tif _is_list(actual):\r\n\t\t\treturn \"expected \" + _as_str(actual) + \" to be an empty list\"\r\n\t\tif typeof(expected) == TYPE_DICTIONARY:\r\n\t\t\treturn \"expected \" + _as_str(actual) + \" to be an empty dictionary\"\r\n\t\treturn \"expected \" + _as_str(actual) + \" to be an empty list or dictionary\"\r\n\r\nstatic func empty():\r\n\treturn EmptyMatcher.new()\r\n\r\n\r\n# ---------------------------------------------------------------------------\r\n\r\nclass Checker:\r\n\tvar _text\r\n\tvar _results\r\n\r\n\tfunc _init(results, text):\r\n\t\t_results = results\r\n\t\t_text = text\r\n\r\n\tfunc that(actual, matcher):\r\n\t\tvar res\r\n\t\tvar msg\r\n\t\tif typeof(matcher) == TYPE_BOOL:\r\n\t\t\tres = matcher\r\n\t\t\tmsg = _text\r\n\t\telse:\r\n\t\t\tres = matcher.matches(actual)\r\n\t\t\tmsg = _text + \": \" + matcher.describe(actual)\r\n\t\tif ! res:\r\n\t\t\tif _results != null:\r\n\t\t\t\t_results.add_error(msg)\r\n\t\t\treturn false\r\n\t\treturn true\r\n","returncode":0,"stderr":"","license":"cc0-1.0","lang":"GDScript"} {"commit":"862b9a50f70f3275b2972bc8d340daed821aae8f","subject":"Remove focus from restart button, fixes #1850","message":"Remove focus from restart button, fixes #1850\n\nFixes a problem where the restart button would keep focus after being pressed, making the tetris' pieces impossible to rotate without activating the button again.","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"2d\/tetris\/grid.gd","new_file":"2d\/tetris\/grid.gd","new_contents":"\n\nextends Control\n\n# Simple Tetris-like demo, (c) 2012 Juan Linietsky\n# Implemented by using a regular Control and drawing on it during the _draw() callback.\n# The drawing surface is updated only when changes happen (by calling update())\n\n\nvar score = 0\nvar score_label=null\n\nconst MAX_SHAPES = 7\n\nvar block = preload(\"block.png\")\n\nvar block_colors=[\n\tColor(1,0.5,0.5),\n\tColor(0.5,1,0.5),\n\tColor(0.5,0.5,1),\n\tColor(0.8,0.4,0.8),\n\tColor(0.8,0.8,0.4),\n\tColor(0.4,0.8,0.8),\n\tColor(0.7,0.7,0.7)]\n\nvar\tblock_shapes=[\n\t[ Vector2(0,-1),Vector2(0,0),Vector2(0,1),Vector2(0,2) ], # I\n\t[ Vector2(0,0),Vector2(1,0),Vector2(1,1),Vector2(0,1) ], # O\n\t[ Vector2(-1,1),Vector2(0,1),Vector2(0,0),Vector2(1,0) ], # S\n\t[ Vector2(1,1),Vector2(0,1),Vector2(0,0),Vector2(-1,0) ], # Z\n\t[ Vector2(-1,1),Vector2(-1,0),Vector2(0,0),Vector2(1,0) ], # L\n\t[ Vector2(1,1),Vector2(1,0),Vector2(0,0),Vector2(-1,0) ], # J\n\t[ Vector2(0,1),Vector2(1,0),Vector2(0,0),Vector2(-1,0) ]] # T\n\t\n\nvar block_rotations=[\n\tMatrix32( Vector2(1,0),Vector2(0,1), Vector2() ),\n\tMatrix32( Vector2(0,1),Vector2(-1,0), Vector2() ),\n\tMatrix32( Vector2(-1,0),Vector2(0,-1), Vector2() ),\n\tMatrix32( Vector2(0,-1),Vector2(1,0), Vector2() )\n]\n\t\n\nvar width=0\nvar height=0\n\nvar cells={}\n\nvar piece_active=false\nvar piece_shape=0\nvar piece_pos=Vector2()\nvar piece_rot=0\n\n\nfunc piece_cell_xform(p,er=0):\n\tvar r = (4+er+piece_rot)%4\n\treturn piece_pos+block_rotations[r].xform(p)\n\nfunc _draw():\n\n\tvar sb = get_stylebox(\"bg\",\"Tree\") # use line edit bg\n\tdraw_style_box(sb,Rect2(Vector2(),get_size()).grow(3))\n\t\n\tvar bs = block.get_size()\n\tfor y in range(height):\n\t\tfor x in range(width):\n\t\t\tif (Vector2(x,y) in cells):\n\t\t\t\tdraw_texture_rect(block,Rect2(Vector2(x,y)*bs,bs),false,block_colors[cells[Vector2(x,y)]])\n\t\t\t\t\n\tif (piece_active):\n\t\t\n\t\tfor c in block_shapes[piece_shape]:\n\t\t\tdraw_texture_rect(block,Rect2(piece_cell_xform(c)*bs,bs),false,block_colors[piece_shape])\n\t\t\t\n\nfunc piece_check_fit(ofs,er=0):\n\n\tfor c in block_shapes[piece_shape]:\n\t\tvar pos = piece_cell_xform(c,er)+ofs\n\t\tif (pos.x < 0):\n\t\t\treturn false\n\t\tif (pos.y < 0):\n\t\t\treturn false\n\t\tif (pos.x >= width):\n\t\t\treturn false\n\t\tif (pos.y >= height):\n\t\t\treturn false\n\t\tif (pos in cells):\n\t\t\treturn false\n\t\n\treturn true\t\n\nfunc new_piece():\n\n\tpiece_shape = randi() % MAX_SHAPES\t\n\tpiece_pos = Vector2(width\/2,0)\n\tpiece_active=true\n\tpiece_rot=0\n\tif (piece_shape==0):\n\t\tpiece_pos.y+=1\n\t\t\n\tif (not piece_check_fit(Vector2())):\n\t\t#game over\n\t\t#print(\"GAME OVER!\")\n\t\tgame_over()\n\t\t\n\tupdate()\n\t\t\n\t\nfunc test_collapse_rows():\n\tvar accum_down=0\n\tfor i in range(height):\n\t\tvar y = height - i - 1\n\t\tvar collapse = true\n\t\tfor x in range(width):\n\t\t\tif (Vector2(x,y) in cells):\n\t\t\t\tif (accum_down):\n\t\t\t\t\tcells[ Vector2(x,y+accum_down) ] = cells[Vector2(x,y)]\n\t\t\telse:\n\t\t\t\tcollapse=false\n\t\t\t\tif (accum_down):\n\t\t\t\t\tcells.erase( Vector2(x,y+accum_down) )\n\t\t\t\t\t\t\n\t\tif (collapse):\n\t\t\taccum_down+=1\n\t\t\n\t\t\t\n\tscore+=accum_down*100\n\tscore_label.set_text(str(score))\n\t\t\t\n\t\t\nfunc game_over():\n\n\t\tpiece_active=false\n\t\tget_node(\"gameover\").set_text(\"Game Over\")\t\t\n\t\tupdate()\n\t\t\t\t\n\t\t\nfunc restart_pressed():\n\n\t\tscore=0\n\t\tscore_label.set_text(\"0\")\n\t\tcells.clear()\n\t\tget_node(\"gameover\").set_text(\"\")\t\t\n\t\tpiece_active=true\n\t\tget_node(\"..\/restart\").release_focus()\n\t\tupdate()\n\t\t\n\t\t\n\nfunc piece_move_down():\n\n\tif (!piece_active):\n\t\treturn\n\tif (piece_check_fit(Vector2(0,1))):\n\t\tpiece_pos.y+=1\n\t\tupdate()\t\t\n\telse:\n\n\t\tfor c in block_shapes[piece_shape]:\n\t\t\tvar pos = piece_cell_xform(c)\n\t\t\tcells[pos]=piece_shape\n\t\ttest_collapse_rows()\n\t\tnew_piece()\n\t\t\n\nfunc piece_rotate():\n\n\tvar adv = 1\n\tif (not piece_check_fit(Vector2(),1)):\n\t\treturn\n\tpiece_rot = (piece_rot + adv) % 4\n\tupdate()\n\t\n\t\n\nfunc _input(ie):\n\n\n\tif (not piece_active):\n\t\treturn\n\tif (!ie.is_pressed()):\n\t\treturn\n\n\tif (ie.is_action(\"move_left\")):\n\t\tif (piece_check_fit(Vector2(-1,0))):\n\t\t\tpiece_pos.x-=1\n\t\t\tupdate()\n\telif (ie.is_action(\"move_right\")):\n\t\tif (piece_check_fit(Vector2(1,0))):\n\t\t\tpiece_pos.x+=1\n\t\t\tupdate()\n\telif (ie.is_action(\"move_down\")):\n\t\tpiece_move_down()\n\telif (ie.is_action(\"rotate\")):\n\t\tpiece_rotate()\n\t\t\n\t\t\nfunc setup(w,h):\n\twidth=w\n\theight=h\n\tset_size( Vector2(w,h)*block.get_size() )\n\tnew_piece()\n\tget_node(\"timer\").start()\n\t\n\nfunc _ready():\n\t# Initalization here\n\n\tsetup(10,20)\n\tscore_label = get_node(\"..\/score\")\n\n\tset_process_input(true)\n\n\n\n\n","old_contents":"\n\nextends Control\n\n# Simple Tetris-like demo, (c) 2012 Juan Linietsky\n# Implemented by using a regular Control and drawing on it during the _draw() callback.\n# The drawing surface is updated only when changes happen (by calling update())\n\n\nvar score = 0\nvar score_label=null\n\nconst MAX_SHAPES = 7\n\nvar block = preload(\"block.png\")\n\nvar block_colors=[\n\tColor(1,0.5,0.5),\n\tColor(0.5,1,0.5),\n\tColor(0.5,0.5,1),\n\tColor(0.8,0.4,0.8),\n\tColor(0.8,0.8,0.4),\n\tColor(0.4,0.8,0.8),\n\tColor(0.7,0.7,0.7)]\n\nvar\tblock_shapes=[\n\t[ Vector2(0,-1),Vector2(0,0),Vector2(0,1),Vector2(0,2) ], # I\n\t[ Vector2(0,0),Vector2(1,0),Vector2(1,1),Vector2(0,1) ], # O\n\t[ Vector2(-1,1),Vector2(0,1),Vector2(0,0),Vector2(1,0) ], # S\n\t[ Vector2(1,1),Vector2(0,1),Vector2(0,0),Vector2(-1,0) ], # Z\n\t[ Vector2(-1,1),Vector2(-1,0),Vector2(0,0),Vector2(1,0) ], # L\n\t[ Vector2(1,1),Vector2(1,0),Vector2(0,0),Vector2(-1,0) ], # J\n\t[ Vector2(0,1),Vector2(1,0),Vector2(0,0),Vector2(-1,0) ]] # T\n\t\n\nvar block_rotations=[\n\tMatrix32( Vector2(1,0),Vector2(0,1), Vector2() ),\n\tMatrix32( Vector2(0,1),Vector2(-1,0), Vector2() ),\n\tMatrix32( Vector2(-1,0),Vector2(0,-1), Vector2() ),\n\tMatrix32( Vector2(0,-1),Vector2(1,0), Vector2() )\n]\n\t\n\nvar width=0\nvar height=0\n\nvar cells={}\n\nvar piece_active=false\nvar piece_shape=0\nvar piece_pos=Vector2()\nvar piece_rot=0\n\n\nfunc piece_cell_xform(p,er=0):\n\tvar r = (4+er+piece_rot)%4\n\treturn piece_pos+block_rotations[r].xform(p)\n\nfunc _draw():\n\n\tvar sb = get_stylebox(\"bg\",\"Tree\") # use line edit bg\n\tdraw_style_box(sb,Rect2(Vector2(),get_size()).grow(3))\n\t\n\tvar bs = block.get_size()\n\tfor y in range(height):\n\t\tfor x in range(width):\n\t\t\tif (Vector2(x,y) in cells):\n\t\t\t\tdraw_texture_rect(block,Rect2(Vector2(x,y)*bs,bs),false,block_colors[cells[Vector2(x,y)]])\n\t\t\t\t\n\tif (piece_active):\n\t\t\n\t\tfor c in block_shapes[piece_shape]:\n\t\t\tdraw_texture_rect(block,Rect2(piece_cell_xform(c)*bs,bs),false,block_colors[piece_shape])\n\t\t\t\n\nfunc piece_check_fit(ofs,er=0):\n\n\tfor c in block_shapes[piece_shape]:\n\t\tvar pos = piece_cell_xform(c,er)+ofs\n\t\tif (pos.x < 0):\n\t\t\treturn false\n\t\tif (pos.y < 0):\n\t\t\treturn false\n\t\tif (pos.x >= width):\n\t\t\treturn false\n\t\tif (pos.y >= height):\n\t\t\treturn false\n\t\tif (pos in cells):\n\t\t\treturn false\n\t\n\treturn true\t\n\nfunc new_piece():\n\n\tpiece_shape = randi() % MAX_SHAPES\t\n\tpiece_pos = Vector2(width\/2,0)\n\tpiece_active=true\n\tpiece_rot=0\n\tif (piece_shape==0):\n\t\tpiece_pos.y+=1\n\t\t\n\tif (not piece_check_fit(Vector2())):\n\t\t#game over\n\t\t#print(\"GAME OVER!\")\n\t\tgame_over()\n\t\t\n\tupdate()\n\t\t\n\t\nfunc test_collapse_rows():\n\tvar accum_down=0\n\tfor i in range(height):\n\t\tvar y = height - i - 1\n\t\tvar collapse = true\n\t\tfor x in range(width):\n\t\t\tif (Vector2(x,y) in cells):\n\t\t\t\tif (accum_down):\n\t\t\t\t\tcells[ Vector2(x,y+accum_down) ] = cells[Vector2(x,y)]\n\t\t\telse:\n\t\t\t\tcollapse=false\n\t\t\t\tif (accum_down):\n\t\t\t\t\tcells.erase( Vector2(x,y+accum_down) )\n\t\t\t\t\t\t\n\t\tif (collapse):\n\t\t\taccum_down+=1\n\t\t\n\t\t\t\n\tscore+=accum_down*100\n\tscore_label.set_text(str(score))\n\t\t\t\n\t\t\nfunc game_over():\n\n\t\tpiece_active=false\n\t\tget_node(\"gameover\").set_text(\"Game Over\")\t\t\n\t\tupdate()\n\t\t\t\t\n\t\t\nfunc restart_pressed():\n\n\t\tscore=0\n\t\tscore_label.set_text(\"0\")\n\t\tcells.clear()\n\t\tget_node(\"gameover\").set_text(\"\")\t\t\n\t\tpiece_active=true\n\t\tupdate()\n\t\t\n\t\t\n\nfunc piece_move_down():\n\n\tif (!piece_active):\n\t\treturn\n\tif (piece_check_fit(Vector2(0,1))):\n\t\tpiece_pos.y+=1\n\t\tupdate()\t\t\n\telse:\n\n\t\tfor c in block_shapes[piece_shape]:\n\t\t\tvar pos = piece_cell_xform(c)\n\t\t\tcells[pos]=piece_shape\n\t\ttest_collapse_rows()\n\t\tnew_piece()\n\t\t\n\nfunc piece_rotate():\n\n\tvar adv = 1\n\tif (not piece_check_fit(Vector2(),1)):\n\t\treturn\n\tpiece_rot = (piece_rot + adv) % 4\n\tupdate()\n\t\n\t\n\nfunc _input(ie):\n\n\n\tif (not piece_active):\n\t\treturn\n\tif (!ie.is_pressed()):\n\t\treturn\n\n\tif (ie.is_action(\"move_left\")):\n\t\tif (piece_check_fit(Vector2(-1,0))):\n\t\t\tpiece_pos.x-=1\n\t\t\tupdate()\n\telif (ie.is_action(\"move_right\")):\n\t\tif (piece_check_fit(Vector2(1,0))):\n\t\t\tpiece_pos.x+=1\n\t\t\tupdate()\n\telif (ie.is_action(\"move_down\")):\n\t\tpiece_move_down()\n\telif (ie.is_action(\"rotate\")):\n\t\tpiece_rotate()\n\t\t\n\t\t\nfunc setup(w,h):\n\twidth=w\n\theight=h\n\tset_size( Vector2(w,h)*block.get_size() )\n\tnew_piece()\n\tget_node(\"timer\").start()\n\t\n\nfunc _ready():\n\t# Initalization here\n\n\tsetup(10,20)\n\tscore_label = get_node(\"..\/score\")\n\n\tset_process_input(true)\n\n\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"3bd14ba980c307e77fadcab87bada30e81653c72","subject":"Avoid pause game on event quit on another platform except Android.","message":"Avoid pause game on event quit on another platform except Android.\n","repos":"CSaratakij\/jam-2016-remake","old_file":"src\/menu\/game_menu.gd","new_file":"src\/menu\/game_menu.gd","new_contents":"\nextends Control\n\nonready var tree = get_tree()\nonready var root = tree.get_root()\nonready var global = root.get_node(\"\/root\/global\")\nonready var _lblGamePause = get_node(\"lblGamePause\")\nonready var _animation_player = get_node(\"AnimationPlayer\")\nonready var btnRestart = get_node(\"ControlButton\/btnRestart\")\nonready var btnPause = get_node(\"ControlButton\/btnPause\")\n\nfunc _ready():\n\tset_process(true)\n\tset_process_input(true)\n\t_lblGamePause.hide()\n\nfunc _notification(what):\n\tif what == MainLoop.NOTIFICATION_WM_QUIT_REQUEST:\n\t\tif OS.get_name() == \"Android\":\n\t\t\t_pause_game()\n\nfunc _input(event):\n\tif event.is_action_pressed(\"play\"):\n\t\t_restart_game()\n\telif event.is_action_pressed(\"pause\"):\n\t\t_pause_game()\n\nfunc _process(delta):\n\tif global.is_game_over():\n\t\tbtnRestart.hide()\n\t\tbtnPause.hide()\n\telse:\n\t\tbtnRestart.show()\n\t\tbtnPause.show()\n\nfunc _restart_game():\n\tif not tree.is_paused():\n\t\tglobal.reset_score()\n\t\tglobal.game_start()\n\t\ttree.reload_current_scene()\n\nfunc _pause_game():\n\tif not global.is_game_over():\n\t\tif not tree.is_paused():\n\t\t\ttree.set_pause(true)\n\t\t\t_lblGamePause.show()\n\t\t\t_animation_player.play(\"btnRestart_dissapear\")\n\t\telse:\n\t\t\ttree.set_pause(false)\n\t\t\t_lblGamePause.hide()\n\t\t\t_animation_player.play(\"btnRestart_reapear\")\n\nfunc _on_btnRestart_pressed():\n\t_restart_game()\n\nfunc _on_btnPause_pressed():\n\t_pause_game()\n","old_contents":"\nextends Control\n\nonready var tree = get_tree()\nonready var root = tree.get_root()\nonready var global = root.get_node(\"\/root\/global\")\nonready var _lblGamePause = get_node(\"lblGamePause\")\nonready var _animation_player = get_node(\"AnimationPlayer\")\nonready var btnRestart = get_node(\"ControlButton\/btnRestart\")\nonready var btnPause = get_node(\"ControlButton\/btnPause\")\n\nfunc _ready():\n\tset_process(true)\n\tset_process_input(true)\n\t_lblGamePause.hide()\n\nfunc _notification(what):\n\tif what == MainLoop.NOTIFICATION_WM_QUIT_REQUEST:\n\t\t_pause_game()\n\nfunc _input(event):\n\tif event.is_action_pressed(\"play\"):\n\t\t_restart_game()\n\telif event.is_action_pressed(\"pause\"):\n\t\t_pause_game()\n\nfunc _process(delta):\n\tif global.is_game_over():\n\t\tbtnRestart.hide()\n\t\tbtnPause.hide()\n\telse:\n\t\tbtnRestart.show()\n\t\tbtnPause.show()\n\nfunc _restart_game():\n\tif not tree.is_paused():\n\t\tglobal.reset_score()\n\t\tglobal.game_start()\n\t\ttree.reload_current_scene()\n\nfunc _pause_game():\n\tif not global.is_game_over():\n\t\tif not tree.is_paused():\n\t\t\ttree.set_pause(true)\n\t\t\t_lblGamePause.show()\n\t\t\t_animation_player.play(\"btnRestart_dissapear\")\n\t\telse:\n\t\t\ttree.set_pause(false)\n\t\t\t_lblGamePause.hide()\n\t\t\t_animation_player.play(\"btnRestart_reapear\")\n\nfunc _on_btnRestart_pressed():\n\t_restart_game()\n\nfunc _on_btnPause_pressed():\n\t_pause_game()\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"1269d565c6b85b0625167077dbe41073c000b9fd","subject":"gd \"G\u00e0idhlig\" translation #1813. Author: GunChleoc. String 172 needs proper plural handling, if possible. In any case, thanks for supporting localization! http:\/\/translate.sourceforge.net\/wiki\/l10n\/pluralforms#g","message":"gd \"G\u00e0idhlig\" translation #1813. Author: GunChleoc. String 172 needs proper plural handling, if possible. In any case, thanks for supporting localization! http:\/\/translate.sourceforge.net\/wiki\/l10n\/pluralforms#g\n","repos":"arex1337\/lila,TangentialAlan\/lila,r0k3\/lila,abougouffa\/lila,bjhaid\/lila,Unihedro\/lila,terokinnunen\/lila,clarkerubber\/lila,pawank\/lila,abougouffa\/lila,pawank\/lila,r0k3\/lila,pavelo65\/lila,clarkerubber\/lila,r0k3\/lila,elioair\/lila,bjhaid\/lila,ccampo133\/lila,arex1337\/lila,Happy0\/lila,elioair\/lila,abougouffa\/lila,JimmyMow\/lila,systemovich\/lila,systemovich\/lila,Happy0\/lila,JimmyMow\/lila,danilovsergey\/i-bur,pawank\/lila,terokinnunen\/lila,luanlv\/lila,terokinnunen\/lila,terokinnunen\/lila,r0k3\/lila,Happy0\/lila,clarkerubber\/lila,danilovsergey\/i-bur,Unihedro\/lila,bjhaid\/lila,abougouffa\/lila,TangentialAlan\/lila,ccampo133\/lila,ccampo133\/lila,abougouffa\/lila,pavelo65\/lila,Happy0\/lila,pawank\/lila,JimmyMow\/lila,r0k3\/lila,ccampo133\/lila,JimmyMow\/lila,systemovich\/lila,luanlv\/lila,danilovsergey\/i-bur,danilovsergey\/i-bur,elioair\/lila,arex1337\/lila,JimmyMow\/lila,Enigmahack\/lila,pavelo65\/lila,samuel-soubeyran\/lila,Enigmahack\/lila,arex1337\/lila,ccampo133\/lila,Unihedro\/lila,elioair\/lila,r0k3\/lila,samuel-soubeyran\/lila,Enigmahack\/lila,ccampo133\/lila,TangentialAlan\/lila,systemovich\/lila,pawank\/lila,danilovsergey\/i-bur,TangentialAlan\/lila,pavelo65\/lila,bjhaid\/lila,luanlv\/lila,systemovich\/lila,Unihedro\/lila,arex1337\/lila,TangentialAlan\/lila,elioair\/lila,terokinnunen\/lila,elioair\/lila,arex1337\/lila,pavelo65\/lila,abougouffa\/lila,luanlv\/lila,bjhaid\/lila,elioair\/lila,pavelo65\/lila,Happy0\/lila,ccampo133\/lila,TangentialAlan\/lila,clarkerubber\/lila,samuel-soubeyran\/lila,JimmyMow\/lila,luanlv\/lila,r0k3\/lila,Happy0\/lila,terokinnunen\/lila,samuel-soubeyran\/lila,samuel-soubeyran\/lila,terokinnunen\/lila,clarkerubber\/lila,abougouffa\/lila,systemovich\/lila,danilovsergey\/i-bur,luanlv\/lila,TangentialAlan\/lila,bjhaid\/lila,bjhaid\/lila,clarkerubber\/lila,systemovich\/lila,pavelo65\/lila,Unihedro\/lila,luanlv\/lila,pawank\/lila,Enigmahack\/lila,Enigmahack\/lila,pawank\/lila,samuel-soubeyran\/lila,Unihedro\/lila,Happy0\/lila,arex1337\/lila,JimmyMow\/lila,Enigmahack\/lila,Enigmahack\/lila,samuel-soubeyran\/lila,Unihedro\/lila,clarkerubber\/lila,danilovsergey\/i-bur","old_file":"conf\/messages.gd","new_file":"conf\/messages.gd","new_contents":"playWithAFriend=Cluich c\u00f2mhla ri caraid\ninviteAFriendToPlayWithYou=Thoir cuireadh do charaid gus cluich c\u00f2mhla riut\nplayWithTheMachine=Cluich an aghaidh a' choimpiutair\nchallengeTheArtificialIntelligence=Thoir ionnsaigh air an inntinn fhuadain\ntoInviteSomeoneToPlayGiveThisUrl=Gus cuireadh a thoirt do chuideigin, thoir an url seo seachad\ngameOver=Cr\u00ecoch a\u2019 gheama\nwaitingForOpponent=A\u2019 feitheamh air n\u00e0mhaid\nwaiting=A\u2019 feitheamh\nyourTurn=An turas agad\naiNameLevelAiLevel=%s inbhe %s\nlevel=Inbhe\ntoggleTheChat=Toglaich a\u2019 chabadaich\ntoggleSound=Toglaich fuaim\nchat=Cabadaich\nresign=G\u00e8ill\ncheckmate=Tul-chasg\nstalemate=Clos-cluiche\nwhite=Geal\nblack=Dubh\ncreateAGame=Cruthaich geama\nnoGameAvailableRightNowCreateOne=Chan eil geama ri fhaighinn an-dr\u00e0sta, cruthaich fear \u00f9r!\nwhiteIsVictorious=Bhuannaich geal\nblackIsVictorious=Bhuannaich dubh\nplayWithTheSameOpponentAgain=Cluich an aghaidh an aon n\u00e0mhaid a-rithist\nnewOpponent=N\u00e0mhaid \u00f9r\nplayWithAnotherOpponent=Cluich an aghaidh n\u00e0mhaid eile\nyourOpponentWantsToPlayANewGameWithYou=Tha an n\u00e0mhaid agad airson geama \u00f9r a chluich c\u00f2mhla riut\njoinTheGame=Thig a-steach dhan gheama\nwhitePlays=Tha geal a\u2019 cluich\nblackPlays=Tha dubh a\u2019 cluich\ntheOtherPlayerHasLeftTheGameYouCanForceResignationOrWaitForHim=Tha an geamaiche eile air a' gheama fh\u00e0gail. Is urrainn dhut g\u00e8illeadh a chur air, no feitheamh air a shon.\nmakeYourOpponentResign=Cuir g\u00e8illeadh air an n\u00e0mhaid agad\nforceResignation=Cuir g\u00e8illeadh air an n\u00e0mhaid agad\ntalkInChat=D\u00e8an cabadaich\ntheFirstPersonToComeOnThisUrlWillPlayWithYou=Cluichidh a\u2019 chiad neach a thig a-steach air an url seo c\u00f2mhla riut.\nwhiteCreatesTheGame=Tha geal a\u2019 cruthachadh a\u2019 gheama\nblackCreatesTheGame=Tha dubh a\u2019 cruthachadh a\u2019 gheama\nwhiteJoinsTheGame=Th\u00e0inig geal a-steach dhan gheama\nblackJoinsTheGame=Th\u00e0inig dubh a-steach dhan gheama\nwhiteResigned=Gh\u00e8ill geal\nblackResigned=Gh\u00e8ill dubh\nwhiteLeftTheGame=Dh\u2019fh\u00e0g geal an geama\nblackLeftTheGame=Dh\u2019fh\u00e0g dubh an geama\nshareThisUrlToLetSpectatorsSeeTheGame=Co-roinn an url seo gus luchd-amhairc a leigeil a-steach dhan gheama\nyouAreViewingThisGameAsASpectator=Tha thu a\u2019 coimhead air a\u2019 gheama seo nad neach-amhairc\nreplayAndAnalyse=Ath-chluich is sgr\u00f9daich\nviewGameStats=Faic stadastaig a\u2019 gheama\nflipBoard=D\u00e8an flip air a\u2019 bh\u00f2rd\nthreefoldRepetition=Treas ath-nochdadh\nclaimADraw=Tagair geama ionnanach\nofferDraw=Tairg geama ionnanach\ndraw=Geama ionnanach\nnbConnectedPlayers=Tha %s geamaichean ceangailte\ntalkAboutChessAndDiscussLichessFeaturesInTheForum=Bruidhinn mu th\u00e0ileasg agus deasbad air na feartan aig lichess air a\u2019 bh\u00f2rd-bhrath\nseeTheGamesBeingPlayedInRealTime=Seall air na geamaichean a tha gan cluich ann am f\u00ecor-\u00f9ine\ngamesBeingPlayedRightNow=Geamaichean a tha gan cluich an-dr\u00e0sta fh\u00e8in\nviewAllNbGames=Seall air a h-uile %s de na geamaichean\nviewNbCheckmates=Seall na chur %s de thul-chasg\nnbBookmarks=%s Comharran-l\u00ecn\nnbPopularGames=%s geamannan m\u00f2r-ch\u00f2rdte\nnbAnalysedGames=%s geamannan sgr\u00f9daichte\nbookmarkedByNbPlayers=Comharra-leabhair le %s cluicheadairean\nviewInFullSize=Seall sa mheud iomlan\nlogOut=Log a-mach\nsignIn=Log a-steach\nsignUp=Cl\u00e0raich\npeople=Daoine\ngames=Geamannan\nforum=B\u00f2rd-brath\nsearchInForum=Lorg sa bh\u00f2rd-bhrath\nchessPlayers=Geamaichean t\u00e0ileisg\nminutesPerSide=Mionaidean an taobh\nvariant=Caochladh\ntimeControl=Smachdadh-\u00f9ine\nstart=Toiseach\nusername=Far-ainm\npassword=Facal-faire\nhaveAnAccount=A bheil cunntas agad?\nallYouNeedIsAUsernameAndAPassword=Chan eil a dh\u00ecth ort ach far-ainm agus facal-faire\nlearnMoreAboutLichess=Ionnsaich barrachd mu lichess\nrank=Inbhe\ngamesPlayed=Geamannan air an cluich\ndeclineInvitation=Di\u00f9lt cuireadh\ncancel=Sguir dheth\ntimeOut=Dh\u2019fhalbh an \u00f9ine\ndrawOfferSent=Chaidh tairgse airson geama ionnanach a chur\ndrawOfferDeclined=Dhi\u00f9ltadh do thairgse airson geama ionnanach\ndrawOfferAccepted=Ghabhadh ri do thairgse airson geama ionnanach\ndrawOfferCanceled=Sguireadh de do thairgse airson geama ionnanach\nyourOpponentOffersADraw=Tha an n\u00e0mhaid agad a\u2019 tairgse geama ionnanach\naccept=Gabh ris\ndecline=Di\u00f9lt\nplayingRightNow=A\u2019 cluich an-dr\u00e0sta fh\u00e8in\nabortGame=Stad an geama\ngameAborted=Chaidh an geama a stad\nstandard=Coitcheann\nunlimited=Gun chr\u00ecoch\nmode=Modh\ncasual=Gun rangachadh\nrated=Rangaichte\nthisGameIsRated=Tha an geama seo rangaichte\nrematch=Ath-mhaids\nrematchOfferSent=Chaidh tairgse airson ath-chluich a chur\nrematchOfferAccepted=Ghabhadh ri do thairgse airson ath-chluich\nrematchOfferCanceled=Chaidh sgur dhe thairgse ath-mhaids\nrematchOfferDeclined=Tairgse ath-mhaids air a di\u00f9ltadh\ncancelRematchOffer=Sguir dhe thairgse ath-mhaids\nviewRematch=Seall air ath-mhaids\nplay=Cluich\ninbox=Bogsa a-steach\nchatRoom=Se\u00f2mar cabadaich\nspectatorRoom=Se\u00f2mar amhairc\ncomposeMessage=Sgr\u00ecobh teachdaireachd\nsentMessages=Teachdaireachdan air an cur\nincrementInSeconds=Ioncramaid ann an diogan\nfreeOnlineChess=T\u00e0ileasg air loidhne an asgaidh\nspectators=Luchd-amhairc:\nnbWins=Bhuannaich %s\nnbLosses=Chaill %s\nnbDraws=Geama ionnanach le %s\nexportGames=\u00c0s-phortaich geamannan\ncolor=dath\neloRange=Rainse Elo\ngiveNbSeconds=Thoir %s diog(an)\nsearchAPlayer=Lorg cluicheadair\nwhoIsOnline=C\u00f2 tha air loidhne\nallPlayers=A h-uile cluicheadair\npremoveEnabledClickAnywhereToCancel=Ro-ghluasad an comas - d\u00e8an briogadh \u00e0ite sam bith gus sgur dheth\nthisPlayerUsesChessComputerAssistance=Tha an cluicheadair seo a\u2019 cleachdadh taic coimpiutair taileisg\nopening=Fosgladh\ntakeback=Tarraing air ais\nproposeATakeback=Tairg tarraing air ais\ntakebackPropositionSent=Tairgse tarraing air ais air a cur\ntakebackPropositionDeclined=Tairgse tarraing air ais air a di\u00f9ltadh\ntakebackPropositionAccepted=Air gabhail ri tairgse tarraing air ais\ntakebackPropositionCanceled=Chaidh sgur dhe thairgse tarraing air ais\nyourOpponentProposesATakeback=Tha am farpaiseach a\u2019 tairgse tarraing air ais\nbookmarkThisGame=Cruthaich comharra-l\u00ecn airson an geama seo.\ntoggleBackground=Toglaich dath a\u2019 ch\u00f9laibh\nadvancedSearch=Lorg adhartach\ntournament=F\u00e8ill-chluich\ntournamentPoints=Puingean f\u00e8ill-chluich\nviewTournament=Seall an fh\u00e8ill-chluich\nfreeOnlineChessGamePlayChessNowInACleanInterfaceNoRegistrationNoAdsNoPluginRequiredPlayChessWithComputerFriendsOrRandomOpponents=T\u00e0ileasg air loidhne an asgaidh. Cluich t\u00e0ileasg ann am pr\u00f2gram air a bheil dreach glan. Gun chl\u00e0radh, gun sanasachd, gun fheum air plugan. Cluich t\u00e0ileasg an aghaidh a\u2019 choimpiutair, charaidean no n\u00e0imhdean air thuaiream.\nteams=Sgiobaidhean\nnbMembers=%s ball\nallTeams=A h-uile sgioba\nnewTeam=Sgioba \u00f9r\nmyTeams=Na sgiobaidhean agam\nnoTeamFound=Cha deach sgioba a lorg\njoinTeam=Gabh sa sgioba\nquitTeam=F\u00e0g an sgioba\nanyoneCanJoin=Faodaidh duine sam bith a ghabhail ann\naConfirmationIsRequiredToJoin=Tha dearbhadh a dh\u00ecth gus gabhail ann\njoiningPolicy=Poileasaidh gabhail ann\nteamLeader=Ceannard an sgioba\nteamBestPlayers=Ar cluicheadairean as fhearr\nteamRecentMembers=Ar buill as \u00f9ire\nsearchATeam=Lorg sgioba\naverageElo=ELO cuibheasach\nlocation=\u00c0ite\nsettings=Roghainnean\nfilterGames=Criathraich na geamannan\nreset=Ath-shuidhich\napply=Cuir an s\u00e0s\nleaderboard=Cl\u00e0r na l\u00ecge\npasteTheFenStringHere=Cuir a-steach an t-sreang FEN an-seo\npasteThePgnStringHere=Cuir a-steach an t-sreang PGN an-seo\nfromPosition=On ionad\ncontinueFromHere=Lean air adhart on a sheo\nimportGame=Ion-phortaich geama\nnbImportedGames=%s geama(ichean) air ion-phortadh\n","old_contents":"playWithAFriend=Cluich c\u00f2mhla ri caraid\ninviteAFriendToPlayWithYou=Thoir cuireadh do charaid gus cluich c\u00f2mhla riut\nplayWithTheMachine=Cluich an aghaidh a' choimpiutair\nchallengeTheArtificialIntelligence=Thoir ionnsaigh air an inntinn fhuadain\ntoInviteSomeoneToPlayGiveThisUrl=Gus cuireadh a thoirt do chuideigin, thoir an url seo seachad\ngameOver=Cr\u00ecoch a\u2019 gheama\nwaitingForOpponent=A\u2019 feitheamh air n\u00e0mhaid\nwaiting=A\u2019 feitheamh\nyourTurn=An turas agad\naiNameLevelAiLevel=%s inbhe %s\nlevel=Inbhe\ntoggleTheChat=Toglaich a\u2019 chabadaich\ntoggleSound=Toglaich fuaim\nchat=Cabadaich\nresign=G\u00e8ill\ncheckmate=Tul-chasg\nstalemate=Clos-cluiche\nwhite=Geal\nblack=Dubh\ncreateAGame=Cruthaich geama\nnoGameAvailableRightNowCreateOne=Chan eil geama ri fhaighinn an-dr\u00e0sta, cruthaich fear \u00f9r!\nwhiteIsVictorious=Bhuannaich geal\nblackIsVictorious=Bhuannaich dubh\nplayWithTheSameOpponentAgain=Cluich an aghaidh an aon n\u00e0mhaid a-rithist\nnewOpponent=N\u00e0mhaid \u00f9r\nplayWithAnotherOpponent=Cluich an aghaidh n\u00e0mhaid eile\nyourOpponentWantsToPlayANewGameWithYou=Tha an n\u00e0mhaid agad airson geama \u00f9r a chluich c\u00f2mhla riut\njoinTheGame=Thig a-steach dhan gheama\nwhitePlays=Tha geal a\u2019 cluich\nblackPlays=Tha dubh a\u2019 cluich\ntheOtherPlayerHasLeftTheGameYouCanForceResignationOrWaitForHim=Tha an geamaiche eile air a' gheama fh\u00e0gail. Is urrainn dhut g\u00e8illeadh a chur air, no feitheamh air a shon.\nmakeYourOpponentResign=Cuir g\u00e8illeadh air an n\u00e0mhaid agad\nforceResignation=Cuir g\u00e8illeadh air an n\u00e0mhaid agad\ntalkInChat=D\u00e8an cabadaich\ntheFirstPersonToComeOnThisUrlWillPlayWithYou=Cluichidh a\u2019 chiad neach a thig a-steach air an url seo c\u00f2mhla riut.\nwhiteCreatesTheGame=Tha geal a\u2019 cruthachadh a\u2019 gheama\nblackCreatesTheGame=Tha dubh a\u2019 cruthachadh a\u2019 gheama\nwhiteJoinsTheGame=Th\u00e0inig geal a-steach dhan gheama\nblackJoinsTheGame=Th\u00e0inig dubh a-steach dhan gheama\nwhiteResigned=Gh\u00e8ill geal\nblackResigned=Gh\u00e8ill dubh\nwhiteLeftTheGame=Dh\u2019fh\u00e0g geal an geama\nblackLeftTheGame=Dh\u2019fh\u00e0g dubh an geama\nshareThisUrlToLetSpectatorsSeeTheGame=Co-roinn an url seo gus luchd-amhairc a leigeil a-steach dhan gheama\nyouAreViewingThisGameAsASpectator=Tha thu a\u2019 coimhead air a\u2019 gheama seo nad neach-amhairc\nreplayAndAnalyse=Ath-chluich is sgr\u00f9daich\nviewGameStats=Faic stadastaig a\u2019 gheama\nflipBoard=D\u00e8an flip air a\u2019 bh\u00f2rd\nthreefoldRepetition=Treas ath-nochdadh\nclaimADraw=Tagair geama ionnanach\nofferDraw=Tairg geama ionnanach\ndraw=Geama ionnanach\nnbConnectedPlayers=Tha %s geamaichean ceangailte\ntalkAboutChessAndDiscussLichessFeaturesInTheForum=Bruidhinn mu th\u00e0ileasg agus deasbad air na feartan aig lichess air a\u2019 bh\u00f2rd-bhrath\nseeTheGamesBeingPlayedInRealTime=Seall air na geamaichean a tha gan cluich ann am f\u00ecor-\u00f9ine\ngamesBeingPlayedRightNow=Geamaichean a tha gan cluich an-dr\u00e0sta fh\u00e8in\nviewAllNbGames=Seall air a h-uile %s de na geamaichean\nviewNbCheckmates=Seall na chur %s de thul-chasg\nnbBookmarks=%s Comharran-l\u00ecn\nnbPopularGames=%s geamannan m\u00f2r-ch\u00f2rdte\nnbAnalysedGames=%s geamannan sgr\u00f9daichte\nbookmarkedByNbPlayers=Comharra-leabhair le %s cluicheadairean\nviewInFullSize=Seall sa mheud iomlan\nlogOut=Log a-mach\nsignIn=Log a-steach\nsignUp=Cl\u00e0raich\npeople=Daoine\ngames=Geamannan\nforum=B\u00f2rd-brath\nchessPlayers=Geamaichean t\u00e0ileisg\nminutesPerSide=Mionaidean an taobh\nvariant=Caochladh\ntimeControl=Smachdadh-\u00f9ine\nstart=Toiseach\nusername=Far-ainm\npassword=Facal-faire\nhaveAnAccount=A bheil cunntas agad?\nallYouNeedIsAUsernameAndAPassword=Chan eil a dh\u00ecth ort ach far-ainm agus facal-faire\nlearnMoreAboutLichess=Ionnsaich barrachd mu lichess\nrank=Inbhe\ngamesPlayed=Geamannan air an cluich\ndeclineInvitation=Di\u00f9lt cuireadh\ncancel=Sguir dheth\ntimeOut=Dh\u2019fhalbh an \u00f9ine\ndrawOfferSent=Chaidh tairgse airson geama ionnanach a chur\ndrawOfferDeclined=Dhi\u00f9ltadh do thairgse airson geama ionnanach\ndrawOfferAccepted=Ghabhadh ri do thairgse airson geama ionnanach\ndrawOfferCanceled=Sguireadh de do thairgse airson geama ionnanach\nyourOpponentOffersADraw=Tha an n\u00e0mhaid agad a\u2019 tairgse geama ionnanach\naccept=Gabh ris\ndecline=Di\u00f9lt\nplayingRightNow=A\u2019 cluich an-dr\u00e0sta fh\u00e8in\nabortGame=Stad an geama\ngameAborted=Chaidh an geama a stad\nstandard=Coitcheann\nunlimited=Gun chr\u00ecoch\nmode=Modh\ncasual=Gun rangachadh\nrated=Rangaichte\nthisGameIsRated=Tha an geama seo rangaichte\nrematch=Ath-mhaids\nrematchOfferSent=Chaidh tairgse airson ath-chluich a chur\nrematchOfferAccepted=Ghabhadh ri do thairgse airson ath-chluich\nrematchOfferCanceled=Chaidh sgur dhe thairgse ath-mhaids\nrematchOfferDeclined=Tairgse ath-mhaids air a di\u00f9ltadh\ncancelRematchOffer=Sguir dhe thairgse ath-mhaids\nviewRematch=Seall air ath-mhaids\nplay=Cluich\ninbox=Bogsa a-steach\nchatRoom=Se\u00f2mar cabadaich\nspectatorRoom=Se\u00f2mar amhairc\ncomposeMessage=Sgr\u00ecobh teachdaireachd\nsentMessages=Teachdaireachdan air an cur\nincrementInSeconds=Ioncramaid ann an diogan\nfreeOnlineChess=T\u00e0ileasg air loidhne an asgaidh\nspectators=Luchd-amhairc:\nnbWins=Bhuannaich %s\nnbLosses=Chaill %s\nnbDraws=Geama ionnanach le %s\nexportGames=\u00c0s-phortaich geamannan\ncolor=dath\neloRange=Rainse Elo\ngiveNbSeconds=Thoir %s diog(an)\nsearchAPlayer=Lorg cluicheadair\nwhoIsOnline=C\u00f2 tha air loidhne\nallPlayers=A h-uile cluicheadair\npremoveEnabledClickAnywhereToCancel=Ro-ghluasad an comas - d\u00e8an briogadh \u00e0ite sam bith gus sgur dheth\nthisPlayerUsesChessComputerAssistance=Tha an cluicheadair seo a\u2019 cleachdadh taic coimpiutair taileisg\nopening=Fosgladh\ntakeback=Tarraing air ais\nproposeATakeback=Tairg tarraing air ais\ntakebackPropositionSent=Tairgse tarraing air ais air a cur\ntakebackPropositionDeclined=Tairgse tarraing air ais air a di\u00f9ltadh\ntakebackPropositionAccepted=Air gabhail ri tairgse tarraing air ais\ntakebackPropositionCanceled=Chaidh sgur dhe thairgse tarraing air ais\nyourOpponentProposesATakeback=Tha am farpaiseach a\u2019 tairgse tarraing air ais\nbookmarkThisGame=Cruthaich comharra-l\u00ecn airson an geama seo.\ntoggleBackground=Toglaich dath a\u2019 ch\u00f9laibh\nadvancedSearch=Lorg adhartach\ntournament=F\u00e8ill-chluich\ntournamentPoints=Puingean f\u00e8ill-chluich\nfreeOnlineChessGamePlayChessNowInACleanInterfaceNoRegistrationNoAdsNoPluginRequiredPlayChessWithComputerFriendsOrRandomOpponents=T\u00e0ileasg air loidhne an asgaidh. Cluich t\u00e0ileasg ann am pr\u00f2gram air a bheil dreach glan. Gun chl\u00e0radh, gun sanasachd, gun fheum air plugan. Cluich t\u00e0ileasg an aghaidh a\u2019 choimpiutair, charaidean no n\u00e0imhdean air thuaiream.\nteams=Sgiobaidhean\nnbMembers=%s ball\nallTeams=A h-uile sgioba\nnewTeam=Sgioba \u00f9r\nmyTeams=Na sgiobaidhean agam\nnoTeamFound=Cha deach sgioba a lorg\njoinTeam=Gabh sa sgioba\nquitTeam=F\u00e0g an sgioba\nanyoneCanJoin=Faodaidh duine sam bith a ghabhail ann\naConfirmationIsRequiredToJoin=Tha dearbhadh a dh\u00ecth gus gabhail ann\njoiningPolicy=Poileasaidh gabhail ann\nteamLeader=Ceannard an sgioba\nteamBestPlayers=Ar cluicheadairean as fhearr\nteamRecentMembers=Ar buill as \u00f9ire\naverageElo=ELO cuibheasach\nlocation=\u00c0ite\nsettings=Roghainnean\nfilterGames=Criathraich na geamannan\nreset=Ath-shuidhich\napply=Cuir an s\u00e0s\nleaderboard=Cl\u00e0r na l\u00ecge\npasteTheFenStringHere=Cuir an sreang FEN ann an-seo\npasteThePgnStringHere=Cuir an sreang PGN ann an-seo\nfromPosition=On ionad\ncontinueFromHere=Lean air adhart on a sheo\nimportGame=Ion-phortaich geama\nnbImportedGames=%s geamannan air ion-phortadh\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"GDScript"} {"commit":"bd05e88ce04ad74162f8dd48a06b40154ca9fec0","subject":"Add memory usage to the Voxel demo","message":"Add memory usage to the Voxel demo\n\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"3d\/voxel\/menu\/debug.gd","new_file":"3d\/voxel\/menu\/debug.gd","new_contents":"extends Label\n# Displays some useful debug information in a Label.\n\nonready var player = $\"..\/Player\"\nonready var voxel_world = $\"..\/VoxelWorld\"\n\n\nfunc _process(_delta):\n\tif Input.is_action_just_pressed(\"debug\"):\n\t\tvisible = !visible\n\t\n\ttext = \"Position: \" + _vector_to_string_appropriate_digits(player.transform.origin)\n\ttext += \"\\nEffective render distance: \" + str(voxel_world.effective_render_distance)\n\ttext += \"\\nLooking: \" + _cardinal_string_from_radians(player.transform.basis.get_euler().y)\n\ttext += \"\\nMemory: \" + \"%3.0f\" % (OS.get_static_memory_usage() \/ 1048576.0) + \" MiB\"\n\ttext += \"\\nFPS: \" + str(Engine.get_frames_per_second())\n\n\n# Avoids the problem of showing more digits than needed or available.\nfunc _vector_to_string_appropriate_digits(vector):\n\tvar factors = [1000, 1000, 1000]\n\tfor i in range(3):\n\t\tif abs(vector[i]) > 4096:\n\t\t\tfactors[i] = factors[i] \/ 10\n\t\t\tif abs(vector[i]) > 65536:\n\t\t\t\tfactors[i] = factors[i] \/ 10\n\t\t\t\tif abs(vector[i]) > 524288:\n\t\t\t\t\tfactors[i] = factors[i] \/ 10\n\t\n\treturn \"(\" + \\\n\t\t\tstr(round(vector.x * factors[0]) \/ factors[0]) + \", \" + \\\n\t\t\tstr(round(vector.y * factors[1]) \/ factors[1]) + \", \" + \\\n\t\t\tstr(round(vector.z * factors[2]) \/ factors[2]) + \")\"\n\n\n# Expects a rotation where 0 is North, on the range -PI to PI.\nfunc _cardinal_string_from_radians(angle):\n\tif angle > TAU * 3 \/ 8:\n\t\treturn \"South\"\n\tif angle < -TAU * 3 \/ 8:\n\t\treturn \"South\"\n\tif angle > TAU * 1 \/ 8:\n\t\treturn \"West\"\n\tif angle < -TAU * 1 \/ 8:\n\t\treturn \"East\"\n\treturn \"North\"\n","old_contents":"extends Label\n# Displays some useful debug information in a Label.\n\nonready var player = $\"..\/Player\"\nonready var voxel_world = $\"..\/VoxelWorld\"\n\n\nfunc _process(_delta):\n\tif Input.is_action_just_pressed(\"debug\"):\n\t\tvisible = !visible\n\t\n\ttext = \"Position: \" + _vector_to_string_appropriate_digits(player.transform.origin)\n\ttext += \"\\nEffective render distance: \" + str(voxel_world.effective_render_distance)\n\ttext += \"\\nLooking: \" + _cardinal_string_from_radians(player.transform.basis.get_euler().y)\n\ttext += \"\\nFPS: \" + str(Engine.get_frames_per_second())\n\n\n# Avoids the problem of showing more digits than needed or available.\nfunc _vector_to_string_appropriate_digits(vector):\n\tvar factors = [1000, 1000, 1000]\n\tfor i in range(3):\n\t\tif abs(vector[i]) > 4096:\n\t\t\tfactors[i] = factors[i] \/ 10\n\t\t\tif abs(vector[i]) > 65536:\n\t\t\t\tfactors[i] = factors[i] \/ 10\n\t\t\t\tif abs(vector[i]) > 524288:\n\t\t\t\t\tfactors[i] = factors[i] \/ 10\n\t\n\treturn \"(\" + \\\n\t\t\tstr(round(vector.x * factors[0]) \/ factors[0]) + \", \" + \\\n\t\t\tstr(round(vector.y * factors[1]) \/ factors[1]) + \", \" + \\\n\t\t\tstr(round(vector.z * factors[2]) \/ factors[2]) + \")\"\n\n\n# Expects a rotation where 0 is North, on the range -PI to PI.\nfunc _cardinal_string_from_radians(angle):\n\tif angle > TAU * 3 \/ 8:\n\t\treturn \"South\"\n\tif angle < -TAU * 3 \/ 8:\n\t\treturn \"South\"\n\tif angle > TAU * 1 \/ 8:\n\t\treturn \"West\"\n\tif angle < -TAU * 1 \/ 8:\n\t\treturn \"East\"\n\treturn \"North\"\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"cd83e01a511ea4890bc4184b5e84e457c9c7de7e","subject":"small warning to all who dare enter","message":"small warning to all who dare enter\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/PuzzleManager.gd","new_file":"src\/scripts\/PuzzleManager.gd","new_contents":"const DIFF_EASY\t\t= 0\nconst DIFF_MEDIUM\t= 1\nconst DIFF_HARD\t\t= 2\n\n# this order is important\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\nconst SOLVER_ERROR_NONE\t\t\t\t= 0\nconst SOLVER_ERROR_MISSING_PAIR\t\t= 1\n\nconst blockColors = [\"Blue\", \"Orange\", \"Red\", \"Yellow\", \"Purple\", \"Green\"]\n\n# Preload paired blocks\nconst blockScn = preload( \"res:\/\/blocks\/block.scn\" )\nconst blockScripts = [ preload( \"Blocks\/LaserBlock.gd\" )\n\t\t\t \t , preload( \"Blocks\/WildBlock.gd\" )\n\t\t\t \t , preload( \"Blocks\/PairedBlock.gd\" )\n\t\t\t \t , preload( \"Blocks\/LaserBlock.gd\" )\n\t\t\t \t ]\n\n# Hash map of all possible positions\nvar shape = {}\n\n# Calculates the layer that a block is on.\nfunc calcBlockLayer( x, y, z ):\n\treturn max( max( abs( x ), abs( y ) ), abs( z ) )\n# THIS IS EVERYWHERE, ANY BETTER WAY TO HAVE FUNCTIONS BETWEEN SCRIPTS?\nfunc calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n# Stores a puzzle in a convenient class.\nclass Puzzle:\n\n\tvar puzzleName\t\t\t# The name of the puzzle.\n\tvar puzzleLayers\t\t# The amount of layers the puzzle has.\n\tvar pairCount = []\t\t# The amount of pair blocks on each layer.\n\tvar blocks = []\t\t\t# Information on all of the blocks in the puzzle.\n\tvar lasers = []\t\t\t# Laser connections.\n\tvar puzzleMan\t\t\t# Stores the puzzle manager for making pickled blocks.\n\n\t# Converts a puzzle to a dictionary.\n\tfunc toDict():\n\t\tvar blockArr = []\n\t\tfor b in range( blocks.size() ):\n\t\t\tblockArr.append( blocks[b].toDict() )\n\n\t\tvar di = { pN = puzzleName\n\t\t \t , pL = puzzleLayers\n\t\t\t\t , bL = blockArr\n\t\t\t\t , pC = pairCount\n\t\t\t\t , lS = lasers\n\t\t\t }\n\t\treturn di\n\n\t# Converts a dictionary to a puzzle.\n\tfunc fromDict( di ):\n\t\tpuzzleName = di.pN\n\t\tpuzzleLayers = di.pL\n\t\tpairCount = di.pC\n\t\tlasers = di.lS\n\n\t\tfor b in range( di.bL.size() ):\n\t\t\tvar nb = puzzleMan.PickledBlock.new()\n\t\t\tnb.fromDict( di.bL[b] )\n\t\t\tblocks.append( nb )\n\t\treturn\n\n\t# Class that stores a solution or the errors in a puzzle.\n\tclass PuzzleSteps:\n\t\tvar solveable = false\n\t\tvar error = SOLVER_ERROR_NONE\n\t\tvar errorBlock = null\n\t\tvar solveSteps = []\n\n\t# THIS IS EVERYWHERE, ANY BETTER WAY TO HAVE FUNCTIONS BETWEEN SCRIPTS?\n\t# duplicate of the global definition above? Either way godot is chill and\n\t# doesn't complain\n\tfunc calcBlockLayerVec( pos ):\n\t\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n\t# Determines if a puzzle is solveable.\n\tfunc solvePuzzle():\n\t\t# Simply use the solvePuzzleSteps function and return the solveable part.\n\t\tvar ps = self.solvePuzzleSteps()\n\t\treturn ps.solveable\n\n\t# Determines if a puzzle is solveable and returns the steps needed to solve it.\n\tfunc solvePuzzleSteps():\n\t\tvar puzzleSteps = PuzzleSteps.new()\n\n\t\tvar pairs = []\n\n\t\t# Add new dictionary for each later.\n\t\tfor l in range( puzzleLayers + 1 ):\n\t\t\tpairs.append( {} )\n\n\t\t# Gather paired blocks from the puzzle.\n\t\tfor b in blocks:\n\t\t\tif b.blockClass == BLOCK_PAIR:\n\t\t\t\tb.solverFlag = false\n\t\t\t\tpairs[calcBlockLayerVec(b.blockPos)][b.name] = b\n\n\t\t# Make sure each pair block has a valid pair on the same layer.\n\t\tfor l in pairs:\n\t\t\tfor p in l:\n\t\t\t\tif l.has( l[p].pairName ):\n\t\t\t\t\tif( not l[p].solverFlag ):\n\t\t\t\t\t\tl[p].solverFlag = true\n\t\t\t\t\t\tl[l[p].pairName].solverFlag = true\n\t\t\t\t\t\tpuzzleSteps.solveSteps.append( [ l[p].blockPos, l[l[p].pairName].blockPos ] )\n\t\t\t\telse:\n\t\t\t\t\tpuzzleSteps.error = SOLVER_ERROR_MISSING_PAIR\n\t\t\t\t\tpuzzleSteps.errorBlock = l[p]\n\t\t\t\t\treturn puzzleSteps\n\n\t\tpuzzleSteps.solveable = true\n\t\treturn puzzleSteps\n\n# Randomly shuffle an array.\nfunc shuffleArray( arr ):\n\tfor i in range( arr.size() - 1, 1, -1 ):\n\t\tvar swapVal = randi() % (i + 1)\n\t\tvar temp = arr[swapVal]\n\t\tarr[swapVal] = arr[i]\n\t\tarr[i] = temp\n\n# Determines the block type based on puzzle size and difficulty.\nfunc getBlockType( difficulty, pos ):\n\t# Determine if this is the goal block.\n\tif pos.x == 0 and pos.y == 0 and pos.z == 0:\n\t\treturn BLOCK_GOAL\n\n\t# Determine the layer this block is on.\n\tvar layer = calcBlockLayerVec( pos )\n\n\t# Determine how many blocks are on the outer part of the layer.\n\tvar layerCount = 0\n\tif abs( pos.x ) == layer:\n\t\tlayerCount += 1\n\tif abs( pos.y ) == layer:\n\t\tlayerCount += 1\n\tif abs( pos.z ) == layer:\n\t\tlayerCount += 1\n\n\t# Determine if this block is a laser.\n\tif difficulty == DIFF_EASY or difficulty == DIFF_MEDIUM:\n\t\tif layerCount == 3:\n\t\t\treturn BLOCK_LASER\n\n\tif difficulty == DIFF_HARD:\n\t\tif abs( pos.x ) == abs( pos.z ) and pos.y == 0:\n\t\t\treturn BLOCK_LASER\n\n\t# Determine if this block is a wild block.\n\tif difficulty == DIFF_EASY:\n\t\tif layerCount == 2:\n\t\t\treturn BLOCK_WILD\n\n\tif difficulty == DIFF_MEDIUM:\n\t\tif layerCount == 2:\n\t\t\tif pos.y == layer || pos.y == -layer:\n\t\t\t\treturn BLOCK_WILD\n\n\tif difficulty == DIFF_HARD:\n\t\tif layerCount == 1:\n\t\t\tif pos.y == 0:\n\t\t\t\treturn BLOCK_WILD\n\n\t# Otherwise it's a normal block.\n\treturn BLOCK_PAIR\n\n# Generates a solveable puzzle.\nfunc generatePuzzle( layers, difficulty ):\n\tvar blockID = 0\n\tvar puzzle = Puzzle.new()\n\tpuzzle.puzzleName = \"RANDOM PUZZLE\"\n\tpuzzle.puzzleLayers = layers\n\n\t# Create all possible positions.\n\tvar layeredblocks = []\n\tfor l in range( 0, layers + 1 ):\n\t\tlayeredblocks.append( [] )\n\t\tpuzzle.pairCount.append( 0 )\n\tfor x in range( -layers, layers + 1 ):\n\t\tfor y in range( -layers, layers + 1 ):\n\t\t\tfor z in range( -layers, layers + 1 ):\n\t\t\t\tlayeredblocks[calcBlockLayer( x, y, z )].append(Vector3(x,y,z))\n\t\t\t\tshape[Vector3(x,y,z)] = null\n\n\t# Generate laser lines.\n\tfor l in range( 1, layers + 1 ):\n\t\tif difficulty == DIFF_MEDIUM or difficulty == DIFF_EASY:\n\t\t\tfor lx in [ -l, l ]:\n\t\t\t\tfor ly in [ -l, l ]:\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, ly, lx ), Vector3( lx*-1, ly, lx )] )\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, ly, lx ), Vector3( lx, ly, lx*-1 )] )\n\n\t\tif difficulty == DIFF_EASY:\n\t\t\tfor lx in [ -l, l ]:\n\t\t\t\tfor lz in [ -l, l ]:\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, l, lz ), Vector3( lx, -l, lz )] )\n\n\t\tif difficulty == DIFF_HARD:\n\t\t\tfor lx in [ -l, l ]:\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, 0, lx ), Vector3( lx*-1, 0, lx )] )\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, 0, lx ), Vector3( lx, 0, lx*-1 )] )\n\n\t# Assign block types based on position.\n\tfor l in range( 0, layers + 1 ):\n\t\t# Randomize the pairs.\n\t\tshuffleArray( layeredblocks[l] )\n\t\t# print( \"NUM \", layeredblocks[l].size() )\n\t\tvar prevBlock = null\n\t\tvar even = false\n\t\tfor pos in layeredblocks[l]:\n\t\t\tvar x = pos.x\n\t\t\tvar y = pos.y\n\t\t\tvar z = pos.z\n\n\t\t\tvar t = getBlockType( difficulty, pos )\n\n\t\t\tif t == BLOCK_GOAL:\n\t\t\t\tcontinue\n\n\t\t\tvar b = PickledBlock.new()\n\t\t\tb.blockPos = pos\n\t\t\tb.name = blockID\n\n\t\t\tblockID += 1\n\t\t\tpuzzle.blocks.append( b )\n\n\t\t\tif t == BLOCK_LASER:\n\t\t\t\tb.setBlockClass(BLOCK_LASER)\\\n\t\t\t\t\t.setLaserExtent( Vector3( 0, 1, 0 ) )\n\t\t\t\tcontinue\n\n\t\t\tif t == BLOCK_WILD:\n\t\t\t\tb.setBlockClass(BLOCK_WILD) \\\n\t\t\t\t\t.setTextureName(blockColors[randi() % blockColors.size()])\n\t\t\t\tcontinue\n\n\t\t\tif even:\n\t\t\t\t# Count this pair.\n\t\t\t\tpuzzle.pairCount[l] += 1\n\n\t\t\t\tvar randColor = blockColors[randi() % blockColors.size()]\n\t\t\t\tb.setBlockClass(BLOCK_PAIR) \\\n\t\t\t\t\t.setPairName(prevBlock.name) \\\n\t\t\t\t\t.setTextureName(randColor)\n\n\t\t\t\tprevBlock.setBlockClass(BLOCK_PAIR) \\\n\t\t\t\t\t.setPairName(b.name) \\\n\t\t\t\t\t.setTextureName(randColor)\n\t\t\teven = not even\n\t\t\tprevBlock = b\n\n\treturn puzzle\n\n# Storage class for blocks in a puzzle.\nclass PickledBlock:\n\tvar name\n\tvar blockClass = BLOCK_PAIR\n\tvar pairName\n\tvar textureName = \"Red\"\n\tvar blockPos\n\tvar laserExtent\n\tvar solverFlag\t\t# Keeps track of this block, only user for the solver.\n\n\tfunc setName(n):\n\t\tname = n\n\t\treturn self\n\n\tfunc setPairName(n):\n\t\tpairName = n\n\t\treturn self\n\n\tfunc setLaserExtent(n):\n\t\tlaserExtent = n\n\t\treturn self\n\n\tfunc setBlockPos(n):\n\t\tblockPos = n\n\t\treturn self\n\n\tfunc setBlockClass(c):\n\t\tblockClass = c\n\t\treturn self\n\n\tfunc setTextureName(t):\n\t\ttextureName = t\n\t\treturn self\n\n\tfunc toString():\n\t\treturn str(name) + \": \" + str(blockClass) + \" @ \" + str(blockPos)\n\n\tfunc toNode():\n\t\t# instantiate a block scene, assign the appropriate script to it\n\t\tvar n = blockScn.instance()\n\t\tn.set_script(blockScripts[blockClass])\n\n\t\tn.set_translation(blockPos * 2)\n\t\tn.blockPos = blockPos\n\n\t\tn.setName(str(name)).setTexture()\n\n\t\tn.setBlockType( blockClass )\n\n\t\tif blockClass == BLOCK_PAIR:\n\t\t\tn.setPairName(pairName).setTexture(textureName)\n\n\t\tif blockClass == BLOCK_WILD:\n\t\t\tn.setTexture(textureName)\n\n\t\tif blockClass == BLOCK_LASER:\n\t\t\tn.setPairName(pairName).setExtent(laserExtent)\n\t\treturn n\n\n\t# test me plz\n\tfunc fromNode(n):\n\t\tblockPos = n.blockPos\n\n\t\tname = n.name_int\n\n\t\tblockClass = n.getBlockType()\n\n\t\tif blockClass == BLOCK_PAIR:\n\t\t\tpairName = n.pairName\n\t\t\ttextureName = n.textureName\n\n\t\tif blockClass == BLOCK_WILD:\n\t\t\ttextureName = n.textureName\n\n\t\tif blockClass == BLOCK_LASER:\n\t\t\tpairName = n.pairName\n\n\t# Convert this object to a dictionary.\n\tfunc toDict():\n\t\tvar di = { n = name\n\t\t \t , bC = blockClass\n\t\t\t , pN = pairName\n\t\t\t , tN = textureName\n\t\t\t , bP = blockPos\n\t\t\t , lE = laserExtent\n\t\t\t }\n\t\treturn di\n\n\t# Make this object from a dictionary.\n\tfunc fromDict( di ):\n\t\tname = di.n\n\t\tblockClass = di.bC\n\t\tpairName = di.pN\n\t\ttextureName = di.tN\n\t\tblockPos = di.bP\n\t\tlaserExtent = di.lE\n\n","old_contents":"const DIFF_EASY\t\t= 0\nconst DIFF_MEDIUM\t= 1\nconst DIFF_HARD\t\t= 2\n\nconst BLOCK_LASER\t= 0\nconst BLOCK_WILD\t= 1\nconst BLOCK_PAIR\t= 2\nconst BLOCK_GOAL\t= 3\nconst BLOCK_BLOCK = 4\n\nconst SOLVER_ERROR_NONE\t\t\t\t= 0\nconst SOLVER_ERROR_MISSING_PAIR\t\t= 1\n\nconst blockColors = [\"Blue\", \"Orange\", \"Red\", \"Yellow\", \"Purple\", \"Green\"]\n\n# Preload paired blocks\nconst blockScn = preload( \"res:\/\/blocks\/block.scn\" )\nconst blockScripts = [ preload( \"Blocks\/LaserBlock.gd\" )\n\t\t\t \t , preload( \"Blocks\/WildBlock.gd\" )\n\t\t\t \t , preload( \"Blocks\/PairedBlock.gd\" )\n\t\t\t \t , preload( \"Blocks\/LaserBlock.gd\" )\n\t\t\t \t ]\n\n# Hash map of all possible positions\nvar shape = {}\n\n# Calculates the layer that a block is on.\nfunc calcBlockLayer( x, y, z ):\n\treturn max( max( abs( x ), abs( y ) ), abs( z ) )\n# THIS IS EVERYWHERE, ANY BETTER WAY TO HAVE FUNCTIONS BETWEEN SCRIPTS?\nfunc calcBlockLayerVec( pos ):\n\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n# Stores a puzzle in a convenient class.\nclass Puzzle:\n\n\tvar puzzleName\t\t\t# The name of the puzzle.\n\tvar puzzleLayers\t\t# The amount of layers the puzzle has.\n\tvar pairCount = []\t\t# The amount of pair blocks on each layer.\n\tvar blocks = []\t\t\t# Information on all of the blocks in the puzzle.\n\tvar lasers = []\t\t\t# Laser connections.\n\tvar puzzleMan\t\t\t# Stores the puzzle manager for making pickled blocks.\n\n\t# Converts a puzzle to a dictionary.\n\tfunc toDict():\n\t\tvar blockArr = []\n\t\tfor b in range( blocks.size() ):\n\t\t\tblockArr.append( blocks[b].toDict() )\n\n\t\tvar di = { pN = puzzleName\n\t\t \t , pL = puzzleLayers\n\t\t\t\t , bL = blockArr\n\t\t\t\t , pC = pairCount\n\t\t\t\t , lS = lasers\n\t\t\t }\n\t\treturn di\n\n\t# Converts a dictionary to a puzzle.\n\tfunc fromDict( di ):\n\t\tpuzzleName = di.pN\n\t\tpuzzleLayers = di.pL\n\t\tpairCount = di.pC\n\t\tlasers = di.lS\n\n\t\tfor b in range( di.bL.size() ):\n\t\t\tvar nb = puzzleMan.PickledBlock.new()\n\t\t\tnb.fromDict( di.bL[b] )\n\t\t\tblocks.append( nb )\n\t\treturn\n\n\t# Class that stores a solution or the errors in a puzzle.\n\tclass PuzzleSteps:\n\t\tvar solveable = false\n\t\tvar error = SOLVER_ERROR_NONE\n\t\tvar errorBlock = null\n\t\tvar solveSteps = []\n\n\t# THIS IS EVERYWHERE, ANY BETTER WAY TO HAVE FUNCTIONS BETWEEN SCRIPTS?\n\t# duplicate of the global definition above? Either way godot is chill and\n\t# doesn't complain\n\tfunc calcBlockLayerVec( pos ):\n\t\treturn max( max( abs( pos.x ), abs( pos.y ) ), abs( pos.z ) )\n\n\t# Determines if a puzzle is solveable.\n\tfunc solvePuzzle():\n\t\t# Simply use the solvePuzzleSteps function and return the solveable part.\n\t\tvar ps = self.solvePuzzleSteps()\n\t\treturn ps.solveable\n\n\t# Determines if a puzzle is solveable and returns the steps needed to solve it.\n\tfunc solvePuzzleSteps():\n\t\tvar puzzleSteps = PuzzleSteps.new()\n\n\t\tvar pairs = []\n\n\t\t# Add new dictionary for each later.\n\t\tfor l in range( puzzleLayers + 1 ):\n\t\t\tpairs.append( {} )\n\n\t\t# Gather paired blocks from the puzzle.\n\t\tfor b in blocks:\n\t\t\tif b.blockClass == BLOCK_PAIR:\n\t\t\t\tb.solverFlag = false\n\t\t\t\tpairs[calcBlockLayerVec(b.blockPos)][b.name] = b\n\n\t\t# Make sure each pair block has a valid pair on the same layer.\n\t\tfor l in pairs:\n\t\t\tfor p in l:\n\t\t\t\tif l.has( l[p].pairName ):\n\t\t\t\t\tif( not l[p].solverFlag ):\n\t\t\t\t\t\tl[p].solverFlag = true\n\t\t\t\t\t\tl[l[p].pairName].solverFlag = true\n\t\t\t\t\t\tpuzzleSteps.solveSteps.append( [ l[p].blockPos, l[l[p].pairName].blockPos ] )\n\t\t\t\telse:\n\t\t\t\t\tpuzzleSteps.error = SOLVER_ERROR_MISSING_PAIR\n\t\t\t\t\tpuzzleSteps.errorBlock = l[p]\n\t\t\t\t\treturn puzzleSteps\n\n\t\tpuzzleSteps.solveable = true\n\t\treturn puzzleSteps\n\n# Randomly shuffle an array.\nfunc shuffleArray( arr ):\n\tfor i in range( arr.size() - 1, 1, -1 ):\n\t\tvar swapVal = randi() % (i + 1)\n\t\tvar temp = arr[swapVal]\n\t\tarr[swapVal] = arr[i]\n\t\tarr[i] = temp\n\n# Determines the block type based on puzzle size and difficulty.\nfunc getBlockType( difficulty, pos ):\n\t# Determine if this is the goal block.\n\tif pos.x == 0 and pos.y == 0 and pos.z == 0:\n\t\treturn BLOCK_GOAL\n\n\t# Determine the layer this block is on.\n\tvar layer = calcBlockLayerVec( pos )\n\n\t# Determine how many blocks are on the outer part of the layer.\n\tvar layerCount = 0\n\tif abs( pos.x ) == layer:\n\t\tlayerCount += 1\n\tif abs( pos.y ) == layer:\n\t\tlayerCount += 1\n\tif abs( pos.z ) == layer:\n\t\tlayerCount += 1\n\n\t# Determine if this block is a laser.\n\tif difficulty == DIFF_EASY or difficulty == DIFF_MEDIUM:\n\t\tif layerCount == 3:\n\t\t\treturn BLOCK_LASER\n\n\tif difficulty == DIFF_HARD:\n\t\tif abs( pos.x ) == abs( pos.z ) and pos.y == 0:\n\t\t\treturn BLOCK_LASER\n\n\t# Determine if this block is a wild block.\n\tif difficulty == DIFF_EASY:\n\t\tif layerCount == 2:\n\t\t\treturn BLOCK_WILD\n\n\tif difficulty == DIFF_MEDIUM:\n\t\tif layerCount == 2:\n\t\t\tif pos.y == layer || pos.y == -layer:\n\t\t\t\treturn BLOCK_WILD\n\n\tif difficulty == DIFF_HARD:\n\t\tif layerCount == 1:\n\t\t\tif pos.y == 0:\n\t\t\t\treturn BLOCK_WILD\n\n\t# Otherwise it's a normal block.\n\treturn BLOCK_PAIR\n\n# Generates a solveable puzzle.\nfunc generatePuzzle( layers, difficulty ):\n\tvar blockID = 0\n\tvar puzzle = Puzzle.new()\n\tpuzzle.puzzleName = \"RANDOM PUZZLE\"\n\tpuzzle.puzzleLayers = layers\n\n\t# Create all possible positions.\n\tvar layeredblocks = []\n\tfor l in range( 0, layers + 1 ):\n\t\tlayeredblocks.append( [] )\n\t\tpuzzle.pairCount.append( 0 )\n\tfor x in range( -layers, layers + 1 ):\n\t\tfor y in range( -layers, layers + 1 ):\n\t\t\tfor z in range( -layers, layers + 1 ):\n\t\t\t\tlayeredblocks[calcBlockLayer( x, y, z )].append(Vector3(x,y,z))\n\t\t\t\tshape[Vector3(x,y,z)] = null\n\n\t# Generate laser lines.\n\tfor l in range( 1, layers + 1 ):\n\t\tif difficulty == DIFF_MEDIUM or difficulty == DIFF_EASY:\n\t\t\tfor lx in [ -l, l ]:\n\t\t\t\tfor ly in [ -l, l ]:\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, ly, lx ), Vector3( lx*-1, ly, lx )] )\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, ly, lx ), Vector3( lx, ly, lx*-1 )] )\n\n\t\tif difficulty == DIFF_EASY:\n\t\t\tfor lx in [ -l, l ]:\n\t\t\t\tfor lz in [ -l, l ]:\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, l, lz ), Vector3( lx, -l, lz )] )\n\n\t\tif difficulty == DIFF_HARD:\n\t\t\tfor lx in [ -l, l ]:\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, 0, lx ), Vector3( lx*-1, 0, lx )] )\n\t\t\t\t\tpuzzle.lasers.append( [Vector3( lx, 0, lx ), Vector3( lx, 0, lx*-1 )] )\n\n\t# Assign block types based on position.\n\tfor l in range( 0, layers + 1 ):\n\t\t# Randomize the pairs.\n\t\tshuffleArray( layeredblocks[l] )\n\t\t# print( \"NUM \", layeredblocks[l].size() )\n\t\tvar prevBlock = null\n\t\tvar even = false\n\t\tfor pos in layeredblocks[l]:\n\t\t\tvar x = pos.x\n\t\t\tvar y = pos.y\n\t\t\tvar z = pos.z\n\n\t\t\tvar t = getBlockType( difficulty, pos )\n\n\t\t\tif t == BLOCK_GOAL:\n\t\t\t\tcontinue\n\n\t\t\tvar b = PickledBlock.new()\n\t\t\tb.blockPos = pos\n\t\t\tb.name = blockID\n\n\t\t\tblockID += 1\n\t\t\tpuzzle.blocks.append( b )\n\n\t\t\tif t == BLOCK_LASER:\n\t\t\t\tb.setBlockClass(BLOCK_LASER)\\\n\t\t\t\t\t.setLaserExtent( Vector3( 0, 1, 0 ) )\n\t\t\t\tcontinue\n\n\t\t\tif t == BLOCK_WILD:\n\t\t\t\tb.setBlockClass(BLOCK_WILD) \\\n\t\t\t\t\t.setTextureName(blockColors[randi() % blockColors.size()])\n\t\t\t\tcontinue\n\n\t\t\tif even:\n\t\t\t\t# Count this pair.\n\t\t\t\tpuzzle.pairCount[l] += 1\n\n\t\t\t\tvar randColor = blockColors[randi() % blockColors.size()]\n\t\t\t\tb.setBlockClass(BLOCK_PAIR) \\\n\t\t\t\t\t.setPairName(prevBlock.name) \\\n\t\t\t\t\t.setTextureName(randColor)\n\n\t\t\t\tprevBlock.setBlockClass(BLOCK_PAIR) \\\n\t\t\t\t\t.setPairName(b.name) \\\n\t\t\t\t\t.setTextureName(randColor)\n\t\t\teven = not even\n\t\t\tprevBlock = b\n\n\treturn puzzle\n\n# Storage class for blocks in a puzzle.\nclass PickledBlock:\n\tvar name\n\tvar blockClass = BLOCK_PAIR\n\tvar pairName\n\tvar textureName = \"Red\"\n\tvar blockPos\n\tvar laserExtent\n\tvar solverFlag\t\t# Keeps track of this block, only user for the solver.\n\n\tfunc setName(n):\n\t\tname = n\n\t\treturn self\n\n\tfunc setPairName(n):\n\t\tpairName = n\n\t\treturn self\n\n\tfunc setLaserExtent(n):\n\t\tlaserExtent = n\n\t\treturn self\n\n\tfunc setBlockPos(n):\n\t\tblockPos = n\n\t\treturn self\n\n\tfunc setBlockClass(c):\n\t\tblockClass = c\n\t\treturn self\n\n\tfunc setTextureName(t):\n\t\ttextureName = t\n\t\treturn self\n\n\tfunc toString():\n\t\treturn str(name) + \": \" + str(blockClass) + \" @ \" + str(blockPos)\n\n\tfunc toNode():\n\t\t# instantiate a block scene, assign the appropriate script to it\n\t\tvar n = blockScn.instance()\n\t\tn.set_script(blockScripts[blockClass])\n\n\t\tn.set_translation(blockPos * 2)\n\t\tn.blockPos = blockPos\n\n\t\tn.setName(str(name)).setTexture()\n\n\t\tn.setBlockType( blockClass )\n\n\t\tif blockClass == BLOCK_PAIR:\n\t\t\tn.setPairName(pairName).setTexture(textureName)\n\n\t\tif blockClass == BLOCK_WILD:\n\t\t\tn.setTexture(textureName)\n\n\t\tif blockClass == BLOCK_LASER:\n\t\t\tn.setPairName(pairName).setExtent(laserExtent)\n\t\treturn n\n\n\t# test me plz\n\tfunc fromNode(n):\n\t\tblockPos = n.blockPos\n\n\t\tname = n.name_int\n\n\t\tblockClass = n.getBlockType()\n\n\t\tif blockClass == BLOCK_PAIR:\n\t\t\tpairName = n.pairName\n\t\t\ttextureName = n.textureName\n\n\t\tif blockClass == BLOCK_WILD:\n\t\t\ttextureName = n.textureName\n\n\t\tif blockClass == BLOCK_LASER:\n\t\t\tpairName = n.pairName\n\n\t# Convert this object to a dictionary.\n\tfunc toDict():\n\t\tvar di = { n = name\n\t\t \t , bC = blockClass\n\t\t\t , pN = pairName\n\t\t\t , tN = textureName\n\t\t\t , bP = blockPos\n\t\t\t , lE = laserExtent\n\t\t\t }\n\t\treturn di\n\n\t# Make this object from a dictionary.\n\tfunc fromDict( di ):\n\t\tname = di.n\n\t\tblockClass = di.bC\n\t\tpairName = di.pN\n\t\ttextureName = di.tN\n\t\tblockPos = di.bP\n\t\tlaserExtent = di.lE\n\n","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"005f743c21f29be86007e3e96fe56bc904e29d85","subject":"fix reload abuse","message":"fix reload abuse\n","repos":"Paulb23\/ludum_dare_37","old_file":"endless\/scripts\/endless.gd","new_file":"endless\/scripts\/endless.gd","new_contents":"extends Node2D\n\nvar levels = [\n\tpreload(\"res:\/\/scenes\/levels\/blank.tscn\"),\n\tpreload(\"res:\/\/scenes\/levels\/level_2.tscn\"),\n\tpreload(\"res:\/\/scenes\/levels\/level_3.tscn\")\n]\n\nvar player_start = Vector2(288, 480)\n\nvar level = 1;\nvar start_game = true\nvar loading = false;\nvar playing = true\n\nfunc _ready():\n\tset_fixed_process(true);\n\tget_node(\"door\").close();\n\tget_node(\"edoor\").close();\n\treload()\n\tplay_next()\n\tpass\n\nfunc _fixed_process(delta):\n\tpass\n\nfunc load_next():\n\tif not loading:\n\t\tget_node(\"the_room\/level\").free()\n\t\tget_node(\"the_room\").add_child(levels[level].instance())\n\t\tget_node(\"door\").close();\n\t\tget_node(\"edoor\").open();\n\t\tloading = true\n\t\tplaying = false\n\t\tlevel+=1;\n\nfunc play_next():\n\tif loading and not playing:\n\t\tget_node(\"edoor\").close();\n\t\tloading = false\n\t\tplaying = true\n\nfunc reload():\n\tif playing:\n\t\tget_node(\"the_room\/level\").free()\n\t\tget_node(\"the_room\").add_child(levels[level].instance())\n\t\tget_node(\"door\").close();\n\t\tget_node(\"edoor\").open();\n\t\tget_node(\"player\").moving = false;\n\t\tget_node(\"player\").set_pos(player_start);\n\nfunc open_door():\n\tget_node(\"door\").open()\n\nfunc close_door():\n\tget_node(\"door\").close()","old_contents":"extends Node2D\n\nvar levels = [\n\tpreload(\"res:\/\/scenes\/levels\/blank.tscn\"),\n\tpreload(\"res:\/\/scenes\/levels\/level_2.tscn\"),\n\tpreload(\"res:\/\/scenes\/levels\/level_3.tscn\")\n]\n\nvar player_start = Vector2(288, 480)\n\nvar level = 1;\nvar start_game = true\nvar loading = false;\nvar playing = true\n\nfunc _ready():\n\tset_fixed_process(true);\n\tget_node(\"door\").close();\n\tget_node(\"edoor\").close();\n\treload()\n\tplay_next()\n\tpass\n\nfunc _fixed_process(delta):\n\tpass\n\nfunc load_next():\n\tif not loading:\n\t\tget_node(\"the_room\/level\").free()\n\t\tget_node(\"the_room\").add_child(levels[level].instance())\n\t\tget_node(\"door\").close();\n\t\tget_node(\"edoor\").open();\n\t\tloading = true\n\t\tplaying = false\n\t\tlevel+=1;\n\nfunc play_next():\n\tif loading and not playing:\n\t\tget_node(\"edoor\").close();\n\t\tloading = false\n\t\tplaying = true\n\nfunc reload():\n\tget_node(\"the_room\/level\").free()\n\tget_node(\"the_room\").add_child(levels[level].instance())\n\tget_node(\"door\").close();\n\tget_node(\"edoor\").open();\n\tget_node(\"player\").moving = false;\n\tget_node(\"player\").set_pos(player_start);\n\nfunc open_door():\n\tget_node(\"door\").open()\n\nfunc close_door():\n\tget_node(\"door\").close()","returncode":0,"stderr":"","license":"mit","lang":"GDScript"} {"commit":"ab751646845577d4a390749a446ff7fad276b79d","subject":"czas na level","message":"czas na level\n","repos":"SirCallidus\/bomberman","old_file":"scripts\/global.gd","new_file":"scripts\/global.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/SirCallidus\/bomberman.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"771c3d1507d7ffcd9b1af6234ffda7b981017e66","subject":"Add input_manager with default input map","message":"Add input_manager with default input map\n","repos":"h4de5\/spiel4","old_file":"game\/autoloads\/input_manager.gd","new_file":"game\/autoloads\/input_manager.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/h4de5\/spiel4.git\/': The requested URL returned error: 403\n","license":"apache-2.0","lang":"GDScript"} {"commit":"b6a046e93587a4f100f633a9cfffa0eba28ea24a","subject":"usuni\u0119cie spacji","message":"usuni\u0119cie spacji\n","repos":"SirCallidus\/bomberman","old_file":"scripts\/global.gd","new_file":"scripts\/global.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/SirCallidus\/bomberman.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"4553e28943783742cc0e86b62b3170de9167be13","subject":"Will be moved under 'scenes'","message":"Will be moved under 'scenes'\n\nDeleted for now as it isn't used","repos":"agameraaron\/grail-adventure","old_file":"scripts\/spawner.gd","new_file":"scripts\/spawner.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/agameraaron\/grail-adventure.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"2580c02d8ba064178ffc75d177452a2b3c06b6b2","subject":"Revert \"ups :v\"","message":"Revert \"ups :v\"\n\nThis reverts commit ece943042248e7f44ba63e6406badffccc6be444.\n","repos":"SirCallidus\/bomberman","old_file":"scripts\/global.gd","new_file":"scripts\/global.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/SirCallidus\/bomberman.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"d21d0b10f1d8240f0c534a4011090bdcaecc083f","subject":"Revert \"Dostosowanie\"","message":"Revert \"Dostosowanie\"\n\nThis reverts commit 4c35cdbc905ed0283615ea3ec768697a94b9fea7.\n","repos":"SirCallidus\/bomberman","old_file":"scripts\/global.gd","new_file":"scripts\/global.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/SirCallidus\/bomberman.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"6e90aa40f97a7f20c52ad7393df9b17fbc4b888d","subject":"Add starting XML parser helper","message":"Add starting XML parser helper\n\nNo testing so far.\n","repos":"vnen\/xna-rpg-godot,vnen\/xna-rpg-godot","old_file":"project\/tools\/xml_parser.gd","new_file":"project\/tools\/xml_parser.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/vnen\/xna-rpg-godot.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"d56692b7569c90a2276cd6d5416831eca8ae70ce","subject":"poprawiony speed i czas","message":"poprawiony speed i czas\n","repos":"SirCallidus\/bomberman","old_file":"scripts\/global.gd","new_file":"scripts\/global.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/SirCallidus\/bomberman.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"44ff3639baa61667b5381fca9b6bc36fea3692a1","subject":"Create localconf.gd","message":"Create localconf.gd","repos":"Guilddrive\/iseqdkp,Guilddrive\/iseqdkp,Guilddrive\/iseqdkp","old_file":"localconf.gd","new_file":"localconf.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/Guilddrive\/iseqdkp.git\/': The requested URL returned error: 403\n","license":"agpl-3.0","lang":"GDScript"} {"commit":"67a276860701f68906113603450097fd31fcb6ca","subject":"Added an example script","message":"Added an example script\n\nAdded a small script to show the methods I implemented in use.\n","repos":"a-watson\/godot-resource-bar,a-watson\/godot-resource-bar,a-watson\/godot-resource-bar","old_file":"example.gd","new_file":"example.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/a-watson\/godot-resource-bar.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"3664da95921d1967f87e4f764a69632b9773fb73","subject":"Why wasn't this added? This belongs here now.","message":"Why wasn't this added? This belongs here now.\n\nShould have reflected the directory structure I uploaded...","repos":"agameraaron\/grail-adventure","old_file":"scenes\/program manager.gd","new_file":"scenes\/program manager.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/agameraaron\/grail-adventure.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"164092d1c03424952c118bb1f0cc0c53efd42b57","subject":"Added nwe lock script","message":"Added nwe lock script\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/WildBlock.gd","new_file":"src\/scripts\/WildBlock.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/GameWizards\/anttris.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"f54a7330e8ed27c43464f7e90492eb70291e6446","subject":"jump animation preparation","message":"jump animation preparation\n","repos":"DeRobyJ\/Herbi","old_file":"scripts\/player.gd","new_file":"scripts\/player.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/DeRobyJ\/Herbi.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"0c23bcb0f88f2a788946344c9e4b3f52e7b511ef","subject":"Gear Moving Correctly","message":"Gear Moving Correctly\n","repos":"mrfigueiredo\/SelfSteam","old_file":"Scripts\/GearAnimation.gd","new_file":"Scripts\/GearAnimation.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/mrfigueiredo\/SelfSteam.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"ece943042248e7f44ba63e6406badffccc6be444","subject":"ups :v","message":"ups :v\n","repos":"SirCallidus\/bomberman","old_file":"scripts\/global.gd","new_file":"scripts\/global.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/SirCallidus\/bomberman.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"74e8af99c1808f3ce2898af22b90a7b774702bad","subject":"level 4 i 5 global","message":"level 4 i 5 global\n","repos":"SirCallidus\/bomberman","old_file":"scripts\/global.gd","new_file":"scripts\/global.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/SirCallidus\/bomberman.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"1b719445f5c5dbf2827081197ab1fd3b85035e42","subject":"Fix typo","message":"Fix typo\n","repos":"Paulb23\/ludum_dare_39","old_file":"Power Defence\/GUI\/gui.gd","new_file":"Power Defence\/GUI\/gui.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/Paulb23\/ludum_dare_39.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"31aa18da053888ce0c2627c08caa38e800caf33c","subject":"Fix monkey enemy, closes #5","message":"Fix monkey enemy, closes #5\n","repos":"KOBUGE-Games\/Herbi,alketii\/LongTimeAgo,KOBUGE-Games\/Herbi,DeRobyJ\/Herbi","old_file":"scripts\/enemy_2.gd","new_file":"scripts\/enemy_2.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/DeRobyJ\/Herbi.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"d2d6a8fbd173c52a30d2136a8add213d1141e1af","subject":"Update 0.1.13","message":"Update 0.1.13\n\n*textures random noise\n","repos":"HGRussian\/roguelike","old_file":"Scripts\/terrain.gd","new_file":"Scripts\/terrain.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/HGRussian\/roguelike.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"6038c51afff712dd009aa345c47c0757740915cf","subject":"adding forgotten file","message":"adding forgotten file\n","repos":"Anatolij-Grigorjev\/GodotExperimentBeatIt","old_file":"game\/characters\/hit_effects\/hit_effect_regular.gd","new_file":"game\/characters\/hit_effects\/hit_effect_regular.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/Anatolij-Grigorjev\/GodotExperimentBeatIt.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"3e6ee6531f17140f1a0967d2d01e9788877bbe9b","subject":"liczba wrog\u00f3w na levelach","message":"liczba wrog\u00f3w na levelach\n","repos":"SirCallidus\/bomberman","old_file":"scripts\/global.gd","new_file":"scripts\/global.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/SirCallidus\/bomberman.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"d3cbabba3dc4b26b3ed959be852439f0a94c4438","subject":"missing file for bbcode demo","message":"missing file for bbcode demo\n","repos":"mikica1986vee\/Godot_android_tegra_fallback,ex\/godot,RebelliousX\/Go_Dot,DmitriySalnikov\/godot,ex\/godot,okamstudio\/godot,didier-v\/godot,buckle2000\/godot,crr0004\/godot,marynate\/godot,exabon\/godot,FullMeta\/godot,FullMeta\/godot,cpascal\/godot,cpascal\/godot,gcbeyond\/godot,OpenSocialGames\/godot,gau-veldt\/godot,youprofit\/godot,liuyucoder\/godot,zj8487\/godot,RandomShaper\/godot,jjdicharry\/godot,huziyizero\/godot,mikica1986vee\/GodotArrayEditorStuff,NateWardawg\/godot,HatiEth\/godot,gcbeyond\/godot,guilhermefelipecgs\/godot,guilhermefelipecgs\/godot,ficoos\/godot,firefly2442\/godot,quabug\/godot,Brickcaster\/godot,MrMaidx\/godot,azurvii\/godot,blackwc\/godot,JoshuaGrams\/godot,morrow1nd\/godot,mamarilmanson\/godot,n-pigeon\/godot,torgartor21\/godot,kimsunzun\/godot,HatiEth\/godot,lietu\/godot,Faless\/godot,buckle2000\/godot,mcanders\/godot,xiaoyanit\/godot,ageazrael\/godot,supriyantomaftuh\/godot,MarianoGnu\/godot,NateWardawg\/godot,vastcharade\/godot,dreamsxin\/godot,mrezai\/godot,lietu\/godot,mikica1986vee\/Godot_android_tegra_fallback,Brickcaster\/godot,quabug\/godot,hitjim\/godot,honix\/godot,torgartor21\/godot,ricpelo\/godot,okamstudio\/godot,HatiEth\/godot,karolgotowala\/godot,hipgraphics\/godot,cpascal\/godot,supriyantomaftuh\/godot,BogusCurry\/godot,karolgotowala\/godot,marynate\/godot,jejung\/godot,morrow1nd\/godot,agusbena\/godot,iap-mutant\/godot,hitjim\/godot,davidalpha\/godot,jjdicharry\/godot,vnen\/godot,wardw\/godot,ianholing\/godot,pkowal1982\/godot,xiaoyanit\/godot,a12n\/godot,Valentactive\/godot,DStomtom\/godot,jackmakesthings\/godot,sanikoyes\/godot,cpascal\/godot,opmana\/godot,groud\/godot,OpenSocialGames\/godot,FateAce\/godot,tomreyn\/godot,Paulloz\/godot,BastiaanOlij\/godot,josempans\/godot,ZuBsPaCe\/godot,josempans\/godot,crr0004\/godot,RandomShaper\/godot,iap-mutant\/godot,gau-veldt\/godot,TheHX\/godot,mikica1986vee\/Godot_android_tegra_fallback,mikica1986vee\/godot,youprofit\/godot,Hodes\/godot,TheBoyThePlay\/godot,BastiaanOlij\/godot,guilhermefelipecgs\/godot,ZuBsPaCe\/godot,JoshuaGrams\/godot,FullMeta\/godot,sergicollado\/godot,gcbeyond\/godot,pkowal1982\/godot,lietu\/godot,hipgraphics\/godot,wardw\/godot,BoDonkey\/godot,mikica1986vee\/GodotArrayEditorStuff,azurvii\/godot,Zylann\/godot,n-pigeon\/godot,crr0004\/godot,lietu\/godot,davidalpha\/godot,BogusCurry\/godot,dreamsxin\/godot,ZuBsPaCe\/godot,sanikoyes\/godot,didier-v\/godot,n-pigeon\/godot,gcbeyond\/godot,TheHX\/godot,blackwc\/godot,teamblubee\/godot,Hodes\/godot,pixelpicosean\/my-godot-2.1,RandomShaper\/godot,serafinfernandez\/godot,Shockblast\/godot,JoshuaGrams\/godot,FullMeta\/godot,karolgotowala\/godot,BogusCurry\/godot,jjdicharry\/godot,FateAce\/godot,Faless\/godot,dreamsxin\/godot,hipgraphics\/godot,blackwc\/godot,vkbsb\/godot,guilhermefelipecgs\/godot,akien-mga\/godot,RandomShaper\/godot,HatiEth\/godot,dreamsxin\/godot,mikica1986vee\/Godot_android_tegra_fallback,mikica1986vee\/GodotArrayEditorStuff,marynate\/godot,Marqin\/godot,Valentactive\/godot,Zylann\/godot,serafinfernandez\/godot,mcanders\/godot,liuyucoder\/godot,pixelpicosean\/my-godot-2.1,RandomShaper\/godot,mamarilmanson\/godot,FullMeta\/godot,akien-mga\/godot,jejung\/godot,ficoos\/godot,supriyantomaftuh\/godot,blackwc\/godot,Shockblast\/godot,vnen\/godot,vnen\/godot,mamarilmanson\/godot,Paulloz\/godot,crr0004\/godot,blackwc\/godot,TheBoyThePlay\/godot,n-pigeon\/godot,OpenSocialGames\/godot,mikica1986vee\/godot,mikica1986vee\/GodotArrayEditorStuff,gcbeyond\/godot,honix\/godot,shackra\/godot,groud\/godot,youprofit\/godot,okamstudio\/godot,Brickcaster\/godot,hipgraphics\/godot,supriyantomaftuh\/godot,marynate\/godot,TheBoyThePlay\/godot,jejung\/godot,teamblubee\/godot,Faless\/godot,kimsunzun\/godot,vkbsb\/godot,mamarilmanson\/godot,firefly2442\/godot,BogusCurry\/godot,honix\/godot,shackra\/godot,morrow1nd\/godot,zicklag\/godot,hipgraphics\/godot,vastcharade\/godot,TheHX\/godot,vastcharade\/godot,blackwc\/godot,ianholing\/godot,a12n\/godot,josempans\/godot,ianholing\/godot,marynate\/godot,lietu\/godot,quabug\/godot,pkowal1982\/godot,MrMaidx\/godot,DmitriySalnikov\/godot,Marqin\/godot,Shockblast\/godot,teamblubee\/godot,est31\/godot,quabug\/godot,ricpelo\/godot,huziyizero\/godot,godotengine\/godot,quabug\/godot,DmitriySalnikov\/godot,Marqin\/godot,liuyucoder\/godot,Valentactive\/godot,gcbeyond\/godot,sanikoyes\/godot,rollenrolm\/godot,agusbena\/godot,OpenSocialGames\/godot,wardw\/godot,serafinfernandez\/godot,lietu\/godot,ricpelo\/godot,guilhermefelipecgs\/godot,Hodes\/godot,kimsunzun\/godot,wardw\/godot,sergicollado\/godot,mamarilmanson\/godot,mikica1986vee\/GodotArrayEditorStuff,jjdicharry\/godot,ZuBsPaCe\/godot,Faless\/godot,xiaoyanit\/godot,dreamsxin\/godot,Brickcaster\/godot,ricpelo\/godot,ricpelo\/godot,vastcharade\/godot,josempans\/godot,agusbena\/godot,ricpelo\/godot,xiaoyanit\/godot,MrMaidx\/godot,MarianoGnu\/godot,OpenSocialGames\/godot,BogusCurry\/godot,supriyantomaftuh\/godot,opmana\/godot,agusbena\/godot,shackra\/godot,exabon\/godot,RebelliousX\/Go_Dot,BogusCurry\/godot,crr0004\/godot,firefly2442\/godot,Zylann\/godot,opmana\/godot,DStomtom\/godot,xiaoyanit\/godot,FullMeta\/godot,MrMaidx\/godot,lietu\/godot,quabug\/godot,iap-mutant\/godot,serafinfernandez\/godot,sergicollado\/godot,ianholing\/godot,liuyucoder\/godot,sh95119\/godot,shackra\/godot,pkowal1982\/godot,a12n\/godot,ricpelo\/godot,sergicollado\/godot,JoshuaGrams\/godot,karolgotowala\/godot,pkowal1982\/godot,Paulloz\/godot,jjdicharry\/godot,mikica1986vee\/godot,mrezai\/godot,didier-v\/godot,Zylann\/godot,DStomtom\/godot,ianholing\/godot,crr0004\/godot,mamarilmanson\/godot,wardw\/godot,BastiaanOlij\/godot,hitjim\/godot,Valentactive\/godot,FullMeta\/godot,guilhermefelipecgs\/godot,iap-mutant\/godot,Hodes\/godot,mrezai\/godot,Valentactive\/godot,kimsunzun\/godot,didier-v\/godot,HatiEth\/godot,cpascal\/godot,sh95119\/godot,marynate\/godot,davidalpha\/godot,cpascal\/godot,sanikoyes\/godot,mamarilmanson\/godot,Max-Might\/godot,gcbeyond\/godot,RebelliousX\/Go_Dot,cpascal\/godot,OpenSocialGames\/godot,azurvii\/godot,Shockblast\/godot,vnen\/godot,ex\/godot,est31\/godot,torgartor21\/godot,Marqin\/godot,sh95119\/godot,karolgotowala\/godot,liuyucoder\/godot,sh95119\/godot,jackmakesthings\/godot,lietu\/godot,zicklag\/godot,iap-mutant\/godot,cpascal\/godot,mamarilmanson\/godot,godotengine\/godot,vkbsb\/godot,xiaoyanit\/godot,NateWardawg\/godot,Shockblast\/godot,mrezai\/godot,xiaoyanit\/godot,MarianoGnu\/godot,DmitriySalnikov\/godot,Hodes\/godot,zj8487\/godot,agusbena\/godot,TheBoyThePlay\/godot,ex\/godot,sergicollado\/godot,teamblubee\/godot,vastcharade\/godot,hipgraphics\/godot,liuyucoder\/godot,Paulloz\/godot,Brickcaster\/godot,HatiEth\/godot,ex\/godot,RebelliousX\/Go_Dot,buckle2000\/godot,OpenSocialGames\/godot,morrow1nd\/godot,vastcharade\/godot,akien-mga\/godot,ficoos\/godot,firefly2442\/godot,youprofit\/godot,mrezai\/godot,quabug\/godot,sergicollado\/godot,sanikoyes\/godot,jackmakesthings\/godot,azurvii\/godot,Valentactive\/godot,BoDonkey\/godot,ageazrael\/godot,huziyizero\/godot,BogusCurry\/godot,DStomtom\/godot,a12n\/godot,wardw\/godot,ficoos\/godot,sh95119\/godot,Zylann\/godot,karolgotowala\/godot,NateWardawg\/godot,serafinfernandez\/godot,HatiEth\/godot,mikica1986vee\/godot,agusbena\/godot,TheBoyThePlay\/godot,JoshuaGrams\/godot,zicklag\/godot,marynate\/godot,BoDonkey\/godot,n-pigeon\/godot,FateAce\/godot,liuyucoder\/godot,ageazrael\/godot,blackwc\/godot,teamblubee\/godot,mamarilmanson\/godot,ex\/godot,hitjim\/godot,FateAce\/godot,akien-mga\/godot,DStomtom\/godot,jjdicharry\/godot,quabug\/godot,BoDonkey\/godot,Paulloz\/godot,exabon\/godot,a12n\/godot,jackmakesthings\/godot,JoshuaGrams\/godot,firefly2442\/godot,mikica1986vee\/Godot_android_tegra_fallback,zj8487\/godot,torgartor21\/godot,RandomShaper\/godot,jejung\/godot,xiaoyanit\/godot,DmitriySalnikov\/godot,shackra\/godot,mikica1986vee\/Godot_android_tegra_fallback,iap-mutant\/godot,jackmakesthings\/godot,Shockblast\/godot,didier-v\/godot,liuyucoder\/godot,hitjim\/godot,godotengine\/godot,zj8487\/godot,okamstudio\/godot,serafinfernandez\/godot,Max-Might\/godot,honix\/godot,mcanders\/godot,gau-veldt\/godot,TheBoyThePlay\/godot,cpascal\/godot,dreamsxin\/godot,kimsunzun\/godot,gcbeyond\/godot,iap-mutant\/godot,TheBoyThePlay\/godot,liuyucoder\/godot,MarianoGnu\/godot,groud\/godot,mikica1986vee\/Godot_android_tegra_fallback,ricpelo\/godot,sh95119\/godot,NateWardawg\/godot,iap-mutant\/godot,quabug\/godot,godotengine\/godot,vastcharade\/godot,okamstudio\/godot,dreamsxin\/godot,mikica1986vee\/GodotArrayEditorStuff,mikica1986vee\/Godot_android_tegra_fallback,davidalpha\/godot,BoDonkey\/godot,ZuBsPaCe\/godot,TheHX\/godot,torgartor21\/godot,torgartor21\/godot,mikica1986vee\/godot,shackra\/godot,marynate\/godot,Zylann\/godot,guilhermefelipecgs\/godot,jackmakesthings\/godot,buckle2000\/godot,ageazrael\/godot,FullMeta\/godot,DStomtom\/godot,shackra\/godot,est31\/godot,josempans\/godot,ageazrael\/godot,akien-mga\/godot,exabon\/godot,zj8487\/godot,dreamsxin\/godot,josempans\/godot,ex\/godot,crr0004\/godot,NateWardawg\/godot,serafinfernandez\/godot,rollenrolm\/godot,Shockblast\/godot,teamblubee\/godot,MrMaidx\/godot,youprofit\/godot,ZuBsPaCe\/godot,Marqin\/godot,TheBoyThePlay\/godot,DStomtom\/godot,RandomShaper\/godot,vkbsb\/godot,zicklag\/godot,teamblubee\/godot,serafinfernandez\/godot,kimsunzun\/godot,vnen\/godot,firefly2442\/godot,youprofit\/godot,MarianoGnu\/godot,vastcharade\/godot,tomreyn\/godot,OpenSocialGames\/godot,godotengine\/godot,davidalpha\/godot,BastiaanOlij\/godot,buckle2000\/godot,vastcharade\/godot,cpascal\/godot,sh95119\/godot,zicklag\/godot,OpenSocialGames\/godot,vastcharade\/godot,josempans\/godot,Max-Might\/godot,wardw\/godot,FateAce\/godot,hitjim\/godot,est31\/godot,lietu\/godot,didier-v\/godot,davidalpha\/godot,vnen\/godot,mikica1986vee\/Godot_android_tegra_fallback,mcanders\/godot,gcbeyond\/godot,kimsunzun\/godot,pkowal1982\/godot,okamstudio\/godot,mcanders\/godot,rollenrolm\/godot,BoDonkey\/godot,liuyucoder\/godot,a12n\/godot,jjdicharry\/godot,jjdicharry\/godot,groud\/godot,youprofit\/godot,karolgotowala\/godot,sh95119\/godot,supriyantomaftuh\/godot,kimsunzun\/godot,Max-Might\/godot,BastiaanOlij\/godot,tomreyn\/godot,ficoos\/godot,youprofit\/godot,n-pigeon\/godot,pixelpicosean\/my-godot-2.1,BastiaanOlij\/godot,BoDonkey\/godot,BoDonkey\/godot,youprofit\/godot,Paulloz\/godot,dreamsxin\/godot,hitjim\/godot,morrow1nd\/godot,mamarilmanson\/godot,didier-v\/godot,torgartor21\/godot,davidalpha\/godot,akien-mga\/godot,hipgraphics\/godot,wardw\/godot,vkbsb\/godot,firefly2442\/godot,BastiaanOlij\/godot,BogusCurry\/godot,DStomtom\/godot,okamstudio\/godot,vkbsb\/godot,sergicollado\/godot,honix\/godot,TheBoyThePlay\/godot,lietu\/godot,mikica1986vee\/GodotArrayEditorStuff,mikica1986vee\/godot,Brickcaster\/godot,supriyantomaftuh\/godot,HatiEth\/godot,Max-Might\/godot,teamblubee\/godot,supriyantomaftuh\/godot,a12n\/godot,huziyizero\/godot,mrezai\/godot,karolgotowala\/godot,BoDonkey\/godot,DmitriySalnikov\/godot,mikica1986vee\/GodotArrayEditorStuff,DStomtom\/godot,godotengine\/godot,pkowal1982\/godot,mrezai\/godot,gau-veldt\/godot,okamstudio\/godot,Valentactive\/godot,supriyantomaftuh\/godot,zj8487\/godot,iap-mutant\/godot,ficoos\/godot,davidalpha\/godot,HatiEth\/godot,morrow1nd\/godot,godotengine\/godot,BastiaanOlij\/godot,vkbsb\/godot,Faless\/godot,MarianoGnu\/godot,agusbena\/godot,xiaoyanit\/godot,jackmakesthings\/godot,mikica1986vee\/godot,HatiEth\/godot,vnen\/godot,blackwc\/godot,exabon\/godot,sergicollado\/godot,RebelliousX\/Go_Dot,MarianoGnu\/godot,FullMeta\/godot,iap-mutant\/godot,hitjim\/godot,kimsunzun\/godot,kimsunzun\/godot,a12n\/godot,sanikoyes\/godot,azurvii\/godot,exabon\/godot,FateAce\/godot,buckle2000\/godot,youprofit\/godot,quabug\/godot,karolgotowala\/godot,serafinfernandez\/godot,marynate\/godot,ex\/godot,davidalpha\/godot,crr0004\/godot,ricpelo\/godot,ageazrael\/godot,vkbsb\/godot,mikica1986vee\/GodotArrayEditorStuff,mcanders\/godot,DmitriySalnikov\/godot,DStomtom\/godot,sh95119\/godot,blackwc\/godot,sanikoyes\/godot,honix\/godot,mikica1986vee\/godot,opmana\/godot,dreamsxin\/godot,jackmakesthings\/godot,BogusCurry\/godot,Hodes\/godot,torgartor21\/godot,ianholing\/godot,groud\/godot,jjdicharry\/godot,firefly2442\/godot,Max-Might\/godot,zj8487\/godot,opmana\/godot,ageazrael\/godot,shackra\/godot,ricpelo\/godot,BoDonkey\/godot,okamstudio\/godot,hitjim\/godot,teamblubee\/godot,davidalpha\/godot,zicklag\/godot,Valentactive\/godot,groud\/godot,sergicollado\/godot,hipgraphics\/godot,ZuBsPaCe\/godot,wardw\/godot,jejung\/godot,n-pigeon\/godot,mikica1986vee\/godot,Zylann\/godot,josempans\/godot,ianholing\/godot,hitjim\/godot,gau-veldt\/godot,zj8487\/godot,hipgraphics\/godot,huziyizero\/godot,mikica1986vee\/Godot_android_tegra_fallback,agusbena\/godot,blackwc\/godot,BogusCurry\/godot,Faless\/godot,TheHX\/godot,Shockblast\/godot,gcbeyond\/godot,a12n\/godot,OpenSocialGames\/godot,MrMaidx\/godot,pixelpicosean\/my-godot-2.1,tomreyn\/godot,Faless\/godot,FullMeta\/godot,teamblubee\/godot,rollenrolm\/godot,azurvii\/godot,NateWardawg\/godot,zj8487\/godot,Paulloz\/godot,NateWardawg\/godot,ianholing\/godot,pixelpicosean\/my-godot-2.1,vnen\/godot,ianholing\/godot,jackmakesthings\/godot,RebelliousX\/Go_Dot,akien-mga\/godot,ianholing\/godot,wardw\/godot,mrezai\/godot,MarianoGnu\/godot,Faless\/godot,tomreyn\/godot,TheBoyThePlay\/godot,serafinfernandez\/godot,Marqin\/godot,pkowal1982\/godot,godotengine\/godot,supriyantomaftuh\/godot,shackra\/godot,jejung\/godot,didier-v\/godot,a12n\/godot,Zylann\/godot,okamstudio\/godot,rollenrolm\/godot,torgartor21\/godot,hipgraphics\/godot,ZuBsPaCe\/godot,shackra\/godot,sergicollado\/godot,est31\/godot,sh95119\/godot,marynate\/godot,NateWardawg\/godot,jjdicharry\/godot,crr0004\/godot,akien-mga\/godot,didier-v\/godot,Brickcaster\/godot,karolgotowala\/godot,mikica1986vee\/godot,jackmakesthings\/godot,crr0004\/godot,sanikoyes\/godot,xiaoyanit\/godot,guilhermefelipecgs\/godot,torgartor21\/godot,est31\/godot,didier-v\/godot,zj8487\/godot,mikica1986vee\/GodotArrayEditorStuff","old_file":"demos\/gui\/rich_text_bbcode\/rich_text_bbcode.gd","new_file":"demos\/gui\/rich_text_bbcode\/rich_text_bbcode.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/didier-v\/godot.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"a50e186251cfd03b2ff1e33b1cce60ddfbab3369","subject":"increase tank health","message":"increase tank health\n","repos":"Paulb23\/ludum_dare_39","old_file":"Power Defence\/Targets\/basic_tank.gd","new_file":"Power Defence\/Targets\/basic_tank.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/Paulb23\/ludum_dare_39.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"b8f735c3b4c73b8d50e774225ea8eda9f642507c","subject":"Obsolesced","message":"Obsolesced","repos":"agameraaron\/grail-adventure","old_file":"scenes\/brains\/dragon.gd","new_file":"scenes\/brains\/dragon.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/agameraaron\/grail-adventure.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"4df56f7a79510925a7aacecd2e6b275de6fcd0b5","subject":"Create MasterServer.gd","message":"Create MasterServer.gd","repos":"lorenzobeccaro\/godot-masterserver","old_file":"client-side\/MasterServer.gd","new_file":"client-side\/MasterServer.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/lorenzobeccaro\/godot-masterserver.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"50b4be13466da7e4f98e55e2cd5034738df4b437","subject":"Obsolesced.","message":"Obsolesced.","repos":"agameraaron\/grail-adventure","old_file":"scripts\/game manager.gd","new_file":"scripts\/game manager.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/agameraaron\/grail-adventure.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"fc42761de349be31eee8fdbdf26920dcc0de4978","subject":"Revert \"ddd\"","message":"Revert \"ddd\"\n\nThis reverts commit d0362455420bbf42d8efed45926eb7ceef7c230e.\n","repos":"SirCallidus\/bomberman","old_file":"scripts\/global.gd","new_file":"scripts\/global.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/SirCallidus\/bomberman.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"7c5816103a3aaf23e0e8c93f33ad14b8ea3d3856","subject":"split burst pattern","message":"split burst pattern\n","repos":"BK-TN\/IncendiumGame","old_file":"incendium\/bulletstuff\/patterns\/PtrnSplitBurst.gd","new_file":"incendium\/bulletstuff\/patterns\/PtrnSplitBurst.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/BK-TN\/IncendiumGame.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"6d257435fcf8dcdbcd0bbe9e01e4180a4f263e28","subject":"poprawka d\u017awi\u0119ku you_win","message":"poprawka d\u017awi\u0119ku you_win\n","repos":"SirCallidus\/bomberman","old_file":"main.gd","new_file":"main.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/SirCallidus\/bomberman.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"f20c3cbae20186bac36d5100e6bce9335c1e675f","subject":"Misplaced. Real one is under 'brains'.","message":"Misplaced. Real one is under 'brains'.","repos":"agameraaron\/grail-adventure","old_file":"scripts\/player.gd","new_file":"scripts\/player.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/agameraaron\/grail-adventure.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"8770bbc0ceed63c0b59bc3332d80d1cf9748ea99","subject":"Add gut unit testing framework","message":"Add gut unit testing framework\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/gut.gd","new_file":"src\/scripts\/gut.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/GameWizards\/anttris.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"ed2c696810b841fefd8e5c512efb586eb1ad9697","subject":"Fix : add 5 levels in global.gd Please squash commits if you can :s","message":"Fix : add 5 levels in global.gd\nPlease squash commits if you can :s\n","repos":"KOBUGE-Games\/Herbi,DeRobyJ\/Herbi,KOBUGE-Games\/Herbi,alketii\/LongTimeAgo","old_file":"scripts\/global.gd","new_file":"scripts\/global.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/DeRobyJ\/Herbi.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"4c35cdbc905ed0283615ea3ec768697a94b9fea7","subject":"Dostosowanie","message":"Dostosowanie\n","repos":"SirCallidus\/bomberman","old_file":"scripts\/global.gd","new_file":"scripts\/global.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/SirCallidus\/bomberman.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"d0e947529c49f73e00679f3b724c1d176c582c2d","subject":"v0.41a - Merge conflict resolved.","message":"v0.41a - Merge conflict resolved.\n","repos":"agameraaron\/grail-adventure","old_file":"scripts\/program manager.gd","new_file":"scripts\/program manager.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/agameraaron\/grail-adventure.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"bd1a2eba74d8b40a4eedb6d52d967fa19f19fbe2","subject":"Added GDScript microtests","message":"Added GDScript microtests\n","repos":"godotengine\/godot-tests,godotengine\/godot-tests","old_file":"benchmarks\/zylann\/gdscript_microtests.gd","new_file":"benchmarks\/zylann\/gdscript_microtests.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/godotengine\/godot-tests.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"462ec79b54b66b53a991ff4476e75d882494f2a6","subject":"zmniejszenie trwania wybuchu","message":"zmniejszenie trwania wybuchu\n","repos":"SirCallidus\/bomberman","old_file":"scripts\/global.gd","new_file":"scripts\/global.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/SirCallidus\/bomberman.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"c9abd8db52e86c8e4235001099c9600222a49fc8","subject":"Added sample solution backup for recommendation resource implementation of graceful degradation","message":"Added sample solution backup for recommendation resource implementation of graceful degradation\n","repos":"ufried\/resilience-tutorial,ufried\/resilience-tutorial","old_file":"recommendationService\/src\/main\/java\/de\/codecentric\/recommendationService\/resources\/RecommendationResource.java.5.gd","new_file":"recommendationService\/src\/main\/java\/de\/codecentric\/recommendationService\/resources\/RecommendationResource.java.5.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/ufried\/resilience-tutorial.git\/': The requested URL returned error: 403\n","license":"apache-2.0","lang":"GDScript"} {"commit":"33938c9c84d1862f643eee2ec4d304f8cca0d72a","subject":"removed fixed portal position","message":"removed fixed portal position\n","repos":"SirCallidus\/bomberman","old_file":"main.gd","new_file":"main.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/SirCallidus\/bomberman.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"f607f24edf98d0a005e62e3244c2e6b0b986c179","subject":"Better game over","message":"Better game over\n","repos":"Paulb23\/ludum_dare_39","old_file":"Power Defence\/Scripts\/game_manager.gd","new_file":"Power Defence\/Scripts\/game_manager.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/Paulb23\/ludum_dare_39.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"1c454e54804ab707fbd42916c2655db8f774a8ae","subject":"Start working on a new godot prototype","message":"Start working on a new godot prototype\n","repos":"mvr\/abyme","old_file":"abyme\/Shape.gd","new_file":"abyme\/Shape.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/mvr\/abyme.git\/': The requested URL returned error: 403\n","license":"bsd-3-clause","lang":"GDScript"} {"commit":"b35ecdf3e7df9037c40778055ebda9efec3e610f","subject":"Err, I mean moved","message":"Err, I mean moved\n\nthat game manager.gd was moved too, ehehe","repos":"agameraaron\/grail-adventure","old_file":"scripts\/program manager.gd","new_file":"scripts\/program manager.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/agameraaron\/grail-adventure.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"92a041a048399f10f0db22b6d62b2e894faee1d2","subject":"Revert \"zmniejszenie trwania wybuchu\"","message":"Revert \"zmniejszenie trwania wybuchu\"\n\nThis reverts commit 462ec79b54b66b53a991ff4476e75d882494f2a6.\n","repos":"SirCallidus\/bomberman","old_file":"scripts\/global.gd","new_file":"scripts\/global.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/SirCallidus\/bomberman.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"21edd84219c1cc547f930fd8923a1ea3f950f096","subject":"Restored one tile on starter room","message":"Restored one tile on starter room\n","repos":"P1X-in\/rat-is-fat","old_file":"scripts\/map\/rooms\/start_room.gd","new_file":"scripts\/map\/rooms\/start_room.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/P1X-in\/rat-is-fat.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"dd21dee62722c1d6fc608999c7ef1235ab57161c","subject":"Added script run by the node in the proxy scene","message":"Added script run by the node in the proxy scene\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/networkProxy.gd","new_file":"src\/scripts\/networkProxy.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/GameWizards\/anttris.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"4c85adc97d7ef7f3922869108bfc1112cc44ca30","subject":"Create example.gd","message":"Create example.gd\n\nHow to use it in godot","repos":"lorenzobeccaro\/godot-masterserver","old_file":"example.gd","new_file":"example.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/lorenzobeccaro\/godot-masterserver.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"2f2cb3897c339f0ea2c50a235e2df46689a28078","subject":"Obsolesced","message":"Obsolesced","repos":"agameraaron\/grail-adventure","old_file":"scripts\/spawner.gd","new_file":"scripts\/spawner.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/agameraaron\/grail-adventure.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"10d1a712574eeae8b18804e0e4506ad2df55bc67","subject":"items handlin","message":"items handlin\n","repos":"P1X-in\/rat-is-fat","old_file":"scenes\/items\/cheese.gd","new_file":"scenes\/items\/cheese.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/P1X-in\/rat-is-fat.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"2bf9e1e2d0eae1802b55dc42e56c29d51a9503b8","subject":"ilo\u015b\u0107 bomb na raz","message":"ilo\u015b\u0107 bomb na raz\n","repos":"SirCallidus\/bomberman","old_file":"scripts\/global.gd","new_file":"scripts\/global.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/SirCallidus\/bomberman.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"c5e5b03393136b690922bd89386fe76bc5bc8ce9","subject":"Moved.","message":"Moved.","repos":"agameraaron\/grail-adventure","old_file":"scenes\/maps\/yellow gate.gd","new_file":"scenes\/maps\/yellow gate.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/agameraaron\/grail-adventure.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"6085f1507eb5606072c37de381146e36b7dfcb58","subject":"missing file for bbcode demo","message":"missing file for bbcode demo\n","repos":"godotengine\/godot-demo-projects,godotengine\/godot-demo-projects,godotengine\/godot-demo-projects","old_file":"gui\/rich_text_bbcode\/rich_text_bbcode.gd","new_file":"gui\/rich_text_bbcode\/rich_text_bbcode.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/godotengine\/godot-demo-projects.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"a61ff96f8cc6df8d855e2094688318a8051b1cc9","subject":"initial commit","message":"initial commit\n","repos":"GameWizards\/anttris,GameWizards\/anttris,GameWizards\/anttris","old_file":"src\/scripts\/Editor.gd","new_file":"src\/scripts\/Editor.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/GameWizards\/anttris.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"} {"commit":"5e23dc5ba98facaa2c3faf4681fb0e58424ef9bb","subject":"Moved to \/scenes\/triggers","message":"Moved to \/scenes\/triggers","repos":"agameraaron\/grail-adventure","old_file":"scripts\/room switch.gd","new_file":"scripts\/room switch.gd","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/agameraaron\/grail-adventure.git\/': The requested URL returned error: 403\n","license":"mit","lang":"GDScript"}