diff --git a/Scenes/client_card.tscn b/Scenes/client_card.tscn index 914012e..208842a 100644 --- a/Scenes/client_card.tscn +++ b/Scenes/client_card.tscn @@ -225,8 +225,9 @@ texture = ExtResource("4_tye4g") [node name="watch" type="TextureRect" parent="."] visible = false +offset_top = -136.0 offset_right = 350.0 -offset_bottom = 250.0 +offset_bottom = 114.0 texture = ExtResource("9_uqpfx") [node name="time1" type="TextureRect" parent="watch"] diff --git a/Scenes/human_player.tscn b/Scenes/human_player.tscn index a388083..fca9001 100644 --- a/Scenes/human_player.tscn +++ b/Scenes/human_player.tscn @@ -236,8 +236,9 @@ layout_mode = 2 layout_mode = 0 offset_right = 40.0 offset_bottom = 23.0 -text = "0 / 100 Reputation" +text = "0 / 60 Reputation" [connection signal="pressed" from="CanvasLayer/UI/Confirm" to="." method="_on_confirm_pressed"] [connection signal="pressed" from="CanvasLayer/UI/HBoxContainer/LobbyReadyButton" to="." method="_on_lobby_ready_button_pressed"] +[connection signal="pressed" from="CanvasLayer/UI/Hire" to="." method="_on_hire_pressed"] [connection signal="text_submitted" from="CanvasLayer/UI/VBoxContainer/LineEdit" to="." method="_on_line_edit_text_submitted"] diff --git a/Scenes/player_board.tscn b/Scenes/player_board.tscn index 86de59a..a9b75e0 100644 --- a/Scenes/player_board.tscn +++ b/Scenes/player_board.tscn @@ -5,13 +5,14 @@ [ext_resource type="PackedScene" uid="uid://y2i3u6n1oowh" path="res://Scenes/deck.tscn" id="3_ypq4b"] [ext_resource type="PackedScene" uid="uid://baoec8cqmedf6" path="res://Scenes/worker_slot.tscn" id="4_o73ea"] -[node name="PlayerBoard" type="Node2D" node_paths=PackedStringArray("poor_deck", "good_deck", "great_deck", "shift_deck", "slots")] +[node name="PlayerBoard" type="Node2D" node_paths=PackedStringArray("poor_deck", "good_deck", "great_deck", "shift_deck", "slots", "client_view_position")] script = ExtResource("1_dj0oi") poor_deck = NodePath("PoorDeck") good_deck = NodePath("GoodDeck") great_deck = NodePath("GreatDeck") shift_deck = NodePath("ShiftDeck") slots = [NodePath("Slot1"), NodePath("Slot2"), NodePath("Slot3"), NodePath("Slot4")] +client_view_position = NodePath("ClientViewPosition") [node name="Sprite2D" type="Sprite2D" parent="."] texture = ExtResource("2_rx76r") @@ -43,3 +44,6 @@ position = Vector2(255, 235) [node name="Slot4" parent="." instance=ExtResource("4_o73ea")] position = Vector2(785, 235) + +[node name="ClientViewPosition" type="Node2D" parent="."] +position = Vector2(296, -194) diff --git a/Scripts/PlayerBoard.gd b/Scripts/PlayerBoard.gd index 79d57de..411050f 100644 --- a/Scripts/PlayerBoard.gd +++ b/Scripts/PlayerBoard.gd @@ -1,15 +1,18 @@ class_name PlayerBoard extends Node2D +signal clients_discarded(cards: Array[NodePath]) + var player_info = {} var workers = [] var roster = [] -signal clients_discarded(cards: Array[NodePath]) + @export var poor_deck: Deck @export var good_deck: Deck @export var great_deck: Deck @export var shift_deck: Deck @export var slots: Array[Workspace] = [] +@export var client_view_position: Node2D func add_to_roster(node_paths): @@ -22,6 +25,14 @@ func add_to_roster(node_paths): slots[x].add_worker(roster[x]) +func empty_slots() -> int: + var x = 0 + for i in slots: + if i.worker == null: + x += 1 + return x + + func draw_client(): var card = shift_deck.draw_card() card.slide_to_position(position.x, position.y, 0.0, 0.3) diff --git a/Scripts/client.gd b/Scripts/client.gd index 188f1d9..956bffd 100644 --- a/Scripts/client.gd +++ b/Scripts/client.gd @@ -39,10 +39,6 @@ func setup(_title, _initial_stress, _time_slots, _services): for x in time_button_sprites.size(): if time_slots[x] == true: time_button_sprites[x].visible = true - $front/Slice1.visible = false - $front/Slice2.visible = false - $front/Slice3.visible = false - $front/Slice4.visible = false if time_slots[0] == true: $front/Slice1.visible = true if time_slots[1] == true: @@ -58,7 +54,7 @@ func setup(_title, _initial_stress, _time_slots, _services): continue icon_list[x - 1].set_service(services[x]) icon_list[x - 1].visible = true - good_threshold = 10 - (5 - services.size()) + good_threshold = 10 - (6 - services.size()) medium_threshold = 4 if time_slots[3] == false: good_threshold -= 1 diff --git a/Scripts/game.gd b/Scripts/game.gd index 16a57cf..94410d5 100644 --- a/Scripts/game.gd +++ b/Scripts/game.gd @@ -36,6 +36,7 @@ var _player_scene = preload("res://Scenes/player_board.tscn") var _human_scene = preload("res://Scenes/human_player.tscn") var _bot_scene = preload("res://Scenes/bot_player.tscn") + func _ready() -> void: _load_workers() _load_clients() @@ -107,6 +108,7 @@ func add_player(id: int, username: String, type: PlayerType) -> void: controller.chat_message_submitted.connect(message) controller.workers_discarded.connect(discard_workers) controller.workers_kept.connect(board.add_to_roster) + controller.hire_pressed.connect(hire) var player_info = {} player_info["id"] = id player_info["username"] = username @@ -214,7 +216,6 @@ func start_round(): player.rpc("update_ready_label", readied_players.size(), players.size()) for player in players: rpc("draft_clients", player.player_info["username"]) - #await clients_drafted rpc("start_turn") @@ -242,6 +243,11 @@ func send_client_order(node_paths): shuffle_sync_recieved.emit() +func hire(player): + if is_multiplayer_authority(): + rpc("draft_workers", player, 4, 1) + + @rpc("call_local", "reliable") func draft_workers(player, draw_amount, pick_amount): var cards = [] @@ -266,9 +272,9 @@ func draft_clients(player): if player_controller.player_info["username"] == player: controller = player_controller var cards_to_draw = 4 - if controller.reputation_points >= 30: + if controller.reputation_points >= 20: cards_to_draw += 4 - if controller.reputation_points >= 60: + if controller.reputation_points >= 40: cards_to_draw += 4 for x in cards_to_draw - controller.board.shift_deck.cards.size(): if client_deck.cards.size() == 0: diff --git a/Scripts/human_controller.gd b/Scripts/human_controller.gd index a9b1a9d..ad4b2f6 100644 --- a/Scripts/human_controller.gd +++ b/Scripts/human_controller.gd @@ -99,6 +99,8 @@ func turn_away_client(): func start_turn(): super() + $CanvasLayer/UI/Hire.visible = false + $CanvasLayer/UI/Label.visible = false @rpc("call_local", "reliable") @@ -109,10 +111,12 @@ func end_turn(): func end_of_round(): super() - $CanvasLayer/UI/Reputation.text = str(reputation_points) + " / 100 Reputation" + $CanvasLayer/UI/Reputation.text = str(reputation_points) + " / 60 Reputation" game_started = 1 ready_button.visible = true ready_label.visible = true + $CanvasLayer/UI/Hire.visible = true + $CanvasLayer/UI/Label.visible = true func update_money(): @@ -141,3 +145,9 @@ func select_workspace(workspace): func confirm_draft(): super() ready_button.visible = true + + +func _on_hire_pressed() -> void: + print("hire button pushed") + rpc("attempt_hire") + update_money() diff --git a/Scripts/player_controller.gd b/Scripts/player_controller.gd index 36bad24..a715ed4 100644 --- a/Scripts/player_controller.gd +++ b/Scripts/player_controller.gd @@ -5,6 +5,7 @@ signal workers_discarded signal workers_kept signal turn_finished signal round_finished(int) +signal hire_pressed(String) var player_info @export var hand_position: Node2D @@ -58,7 +59,7 @@ func networked_select_card(add, card_path): func select_workspace(workspace): if not is_multiplayer_authority(): return false - if current_client == null or workspace.worker == null: + if current_client == null or workspace.worker == null or workspace.worker.stress >= workspace.worker.capacity: return false if workspace == current_workspace or workspace.client != null: return false @@ -113,7 +114,10 @@ func confirm_draft(): func start_turn(): current_client = board.shift_deck.draw_card() - current_client.slide_to_position(board.global_position.x, board.global_position.y, 0.0, 0.3) + var pos: Vector2 + pos.x = board.client_view_position.global_position.x + pos.y = board.client_view_position.global_position.y + current_client.slide_to_position(pos.x, pos.y, 0.0, 0.3) current_client.turn_front() @@ -137,3 +141,12 @@ func end_turn(): if board.shift_deck.cards.size() == 0: end_of_round() turn_finished.emit() + + +@rpc("call_local", "reliable") +func attempt_hire(): + if board.empty_slots() < 1 or money < 50: + return + print("attempt hire didnt fail") + money -= 50 + hire_pressed.emit(player_info["username"]) diff --git a/Scripts/worker.gd b/Scripts/worker.gd index 24f7679..4117578 100644 --- a/Scripts/worker.gd +++ b/Scripts/worker.gd @@ -1,21 +1,23 @@ class_name Worker extends Card +signal card_clicked(card) + var title = "New Card" -var max_supers = 2 var capacity = 8 var stress = 0 -signal card_clicked(card) +var in_hand = false +var hand_ratio +var hand_position = Vector2(0, 0) +var hovered = false + @export var spread_curve : Curve @export var height_curve : Curve @export var rotation_curve : Curve @export var hand_width : float @export var hand_height : float @export var hand_rotation : float -var in_hand = false -var hand_ratio -var hand_position = Vector2(0, 0) -var hovered = false + func _process(delta): if sliding: @@ -29,6 +31,7 @@ func _process(delta): position.x = hand_position.x + spread_curve.sample(hand_ratio) * (hand_width + (hand_width * 0.2)) rotation = rotation_curve.sample(hand_ratio) * (hand_rotation + (hand_rotation * 0.2)) + func get_icon(x): var y = 32 if x > 8: @@ -37,6 +40,7 @@ func get_icon(x): y += x * 32 return y + func setup(_title, _capacity, _services): if _title != "": title = _title @@ -91,11 +95,13 @@ func _on_area_2d_input_event(_viewport, event, _shape_idx): if event is InputEventMouseButton and event.pressed: emit_signal("card_clicked", self) + func increase_stress(amount) -> bool: stress += amount $Label.text = str(stress) return stress > capacity + func decrease_stress(amount): stress -= amount if stress < 0: diff --git a/Scripts/workspace.gd b/Scripts/workspace.gd index a55ad33..6894c22 100644 --- a/Scripts/workspace.gd +++ b/Scripts/workspace.gd @@ -54,16 +54,23 @@ func evaluate_match(): func time_step(skip_ahead: bool): - if worker == null or client == null: - return null - client.turns_left -= 1 - if skip_ahead: - client.turns_left = 0 - client.update_counter() - if client.turns_left > 0: + if worker == null and client == null: return null + elif worker != null and client == null: + worker.decrease_stress(1) else: - return remove_client() + if skip_ahead: + worker.decrease_stress(client.turns_left) + client.turns_left = 0 + else: + worker.increase_stress(1) + client.turns_left -= 1 + client.update_counter() + if client.turns_left > 0: + return null + else: + return remove_client() + return null func _on_area2d_input_event(_viewport: Node, event: InputEvent, _shape_idx: int) -> void: diff --git a/export_presets.cfg b/export_presets.cfg index 02b05fa..ae70894 100644 --- a/export_presets.cfg +++ b/export_presets.cfg @@ -13,14 +13,13 @@ encryption_include_filters="" encryption_exclude_filters="" encrypt_pck=false encrypt_directory=false -script_encryption_key="" [preset.0.options] custom_template/debug="" custom_template/release="" -debug/export_console_script=0 -binary_format/embed_pck=false +debug/export_console_wrapper=1 +binary_format/embed_pck=true texture_format/bptc=true texture_format/s3tc=true texture_format/etc=false @@ -54,23 +53,19 @@ encryption_include_filters="" encryption_exclude_filters="" encrypt_pck=false encrypt_directory=false -script_encryption_key="" [preset.1.options] custom_template/debug="" custom_template/release="" -debug/export_console_script=1 -binary_format/embed_pck=false +debug/export_console_wrapper=1 +binary_format/embed_pck=true texture_format/bptc=true texture_format/s3tc=true texture_format/etc=false texture_format/etc2=false binary_format/architecture="x86_64" codesign/enable=false -codesign/identity_type=0 -codesign/identity="" -codesign/password="" codesign/timestamp=true codesign/timestamp_server_url="" codesign/digest_algorithm=1 @@ -82,8 +77,8 @@ application/console_wrapper_icon="" application/icon_interpolation=4 application/file_version="" application/product_version="" -application/company_name="" -application/product_name="" +application/company_name="soweli jan pona" +application/product_name="bordello" application/file_description="" application/copyright="" application/trademarks="" @@ -120,14 +115,14 @@ encryption_include_filters="" encryption_exclude_filters="" encrypt_pck=false encrypt_directory=false -script_encryption_key="" [preset.2.options] +export/distribution_type=1 binary_format/architecture="universal" custom_template/debug="" custom_template/release="" -debug/export_console_script=1 +debug/export_console_wrapper=1 application/icon="" application/icon_interpolation=4 application/bundle_identifier="com.sowelijanpona.bordello" @@ -137,11 +132,18 @@ application/short_version="1.0" application/version="1.0" application/copyright="" application/copyright_localized={} +application/min_macos_version="10.12" display/high_res=true +xcode/platform_build="14C18" +xcode/sdk_version="13.1" +xcode/sdk_build="22C55" +xcode/sdk_name="macosx13.1" +xcode/xcode_version="1420" +xcode/xcode_build="14C18" codesign/codesign=1 +codesign/installer_identity="" +codesign/apple_team_id="" codesign/identity="" -codesign/certificate_file="" -codesign/certificate_password="" codesign/entitlements/custom_file="" codesign/entitlements/allow_jit_code_execution=false codesign/entitlements/allow_unsigned_executable_memory=false @@ -167,12 +169,6 @@ codesign/entitlements/app_sandbox/files_movies=0 codesign/entitlements/app_sandbox/helper_executables=[] codesign/custom_options=PackedStringArray() notarization/notarization=0 -notarization/apple_id_name="" -notarization/apple_id_password="" -notarization/apple_team_id="" -notarization/api_uuid="" -notarization/api_key="" -notarization/api_key_id="" privacy/microphone_usage_description="" privacy/microphone_usage_description_localized={} privacy/camera_usage_description=""