diff --git a/HEADS b/HEADS index f221ae4..d51357a 100644 --- a/HEADS +++ b/HEADS @@ -1 +1 @@ -{"engine": {"3.2": "64a9e86c5c20bd4bd5833f0563457d0126617489", "3.x": "a5c62edc144255b1f5ee504440b8184f63d06843"}, "world_generator": {"master": "260c430f11b0b591eaf4714516419aa327d2842c"}, "entity_spell_system": {"master": "378ebcff23e5ab0a04c0e92119d26391de4be139"}, "ui_extensions": {"master": "f82273f54cb1ab87d458c91af9554acec5c10831"}, "texture_packer": {"master": "dbf3c59a9c52f155f0d98b567d571708e8b3f253"}, "fastnoise": {"master": "d447fd5364e9ab5a6b14184483eab23cd3fe820b"}, "thread_pool": {"master": "b2e8c815392052947e7386f722913a12eea543a4"}} \ No newline at end of file +{"engine": {"3.2": "64a9e86c5c20bd4bd5833f0563457d0126617489", "3.x": "095dea7b71c4ba858710e8ecbd80ee28cf9877c8"}, "world_generator": {"master": "260c430f11b0b591eaf4714516419aa327d2842c"}, "entity_spell_system": {"master": "cc9dc30b8377552df79ee4d53e1ed6d51cb87408"}, "ui_extensions": {"master": "f82273f54cb1ab87d458c91af9554acec5c10831"}, "texture_packer": {"master": "a0786956813a85b5a82093a081b90c2f8a000e6c"}, "fastnoise": {"master": "d447fd5364e9ab5a6b14184483eab23cd3fe820b"}, "thread_pool": {"master": "b2e8c815392052947e7386f722913a12eea543a4"}} \ No newline at end of file diff --git a/game/characters/SheetCharacter.tscn b/game/characters/SheetCharacter.tscn index 535982d..f992dc6 100644 --- a/game/characters/SheetCharacter.tscn +++ b/game/characters/SheetCharacter.tscn @@ -5,6 +5,19 @@ [ext_resource path="res://characters/SheetCharacter.gd" type="Script" id=3] [node name="SheetCharacter" type="CharacterSkeleton2D"] +entity_type = 1 +attach_point_paths/0_left_hand = NodePath("") +attach_point_paths/1_right_hand = NodePath("") +attach_point_paths/2_torso = NodePath("") +attach_point_paths/3_root = NodePath("") +attach_point_paths/4_right_hip = NodePath("") +attach_point_paths/5_left_hip = NodePath("") +attach_point_paths/6_spine_2 = NodePath("") +attach_point_paths/7_weapon_left = NodePath("") +attach_point_paths/8_weapon_right = NodePath("") +attach_point_paths/9_weapon_left_back = NodePath("") +attach_point_paths/10_weapon_right_back = NodePath("") +attach_point_paths/11_weapon_shield_left = NodePath("") script = ExtResource( 3 ) sprite_path = NodePath("CharacterSprite") diff --git a/game/player/Body.gd b/game/player/Body.gd index be7415c..ba6b82a 100644 --- a/game/player/Body.gd +++ b/game/player/Body.gd @@ -85,6 +85,8 @@ var character_skeleton : CharacterSkeleton2D var visibility_update_timer : float = 0 +var _nameplate : Node = null + func _enter_tree() -> void: world = get_node(world_path) as Node2D camera = get_node_or_null("Camera") as Camera2D @@ -94,10 +96,10 @@ func _enter_tree() -> void: entity.set_character_skeleton(character_skeleton) # entity.connect("notification_ccast", self, "on_notification_ccast") entity.connect("diesd", self, "on_diesd") - entity.connect("isc_controlled_changed", self, "on_c_controlled_changed") + entity.connect("onc_entity_controller_changed", self, "on_c_controlled_changed") owner = entity - on_c_controlled_changed(entity.c_is_controlled) + on_c_controlled_changed() transform = entity.get_transform_2d(true) @@ -142,7 +144,7 @@ func _physics_process(delta : float) -> void: if dead: return - if entity.c_is_controlled: + if entity.getc_is_controlled(): process_input(delta) process_movement_player(delta) else: @@ -472,11 +474,14 @@ func analog_force_change(vector, touchpad): # anim_node_state_machine.travel("run-loop") -func on_c_controlled_changed(val): +func on_c_controlled_changed(): #create camera and pivot if true - _controlled = val + _controlled = entity.getc_is_controlled() - if val: + if _controlled: + if _nameplate: + _nameplate.queue_free() + camera = Camera2D.new() camera.zoom = Vector2(0.8, 0.8) add_child(camera) @@ -498,10 +503,19 @@ func on_c_controlled_changed(val): set_process_input(false) set_process_unhandled_input(false) var nameplatescn : PackedScene = ResourceLoader.load("res://ui/nameplates/NamePlate.tscn") - var nameplate = nameplatescn.instance() - get_parent().add_child(nameplate) - + _nameplate = nameplatescn.instance() + get_parent().add_child(_nameplate) +func on_diesd(entity): + if dead: + return + + dead = true + + #anim_node_state_machine.travel("dead") + + #set_physics_process(false) + remote func sset_position(pposition : Vector2) -> void: if multiplayer.network_peer and multiplayer.is_network_server():