From 11b972d7e152c6862b09cb698345432ea988de32 Mon Sep 17 00:00:00 2001 From: TsubakiLoL <2789646812@qq.com> Date: Wed, 25 Sep 2024 18:04:02 +0800 Subject: [PATCH] =?UTF-8?q?9.25=E4=B8=8B=E5=8D=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- autoload/global/script/global.gd | 24 +++++++- json/card.json | 7 ++- res/ui/ui_026_1_arrow/tuceng355.png | Bin 0 -> 13308 bytes res/ui/ui_026_1_arrow/tuceng355.png.import | 34 +++++++++++ res/ui/ui_026_1_arrow/tuceng356.png | Bin 0 -> 2335 bytes res/ui/ui_026_1_arrow/tuceng356.png.import | 34 +++++++++++ scene/card.gd | 36 +++++++++-- scene/card.tscn | 1 + scene/card_state_machine/arrow.gd | 12 ++++ scene/card_state_machine/arrow.tscn | 30 +++------ scene/card_state_machine/card_machine.gd | 53 +++++++++++++--- scene/card_state_machine/discard.gd | 23 +++++++ scene/card_state_machine/exe.gd | 22 +++++++ scene/card_state_machine/focus.gd | 1 - scene/card_state_machine/getting.gd | 3 + scene/card_state_machine/queue.gd | 17 ++++++ scene/card_state_machine/select_target.gd | 10 ++- scene/card_state_machine/selected.gd | 11 +++- scene/fight.gd | 47 +++++++++++--- scene/fight.tscn | 68 ++++++++++++++++++++- scene/fight_character_card.gd | 12 +++- scene/fight_character_card.tscn | 20 +++++- scene/fight_enermy_card.gd | 20 ++++++ scene/fight_enermy_card.tscn | 24 +++++++- scene/game_flow_touch.gd | 1 - 25 files changed, 451 insertions(+), 59 deletions(-) create mode 100644 res/ui/ui_026_1_arrow/tuceng355.png create mode 100644 res/ui/ui_026_1_arrow/tuceng355.png.import create mode 100644 res/ui/ui_026_1_arrow/tuceng356.png create mode 100644 res/ui/ui_026_1_arrow/tuceng356.png.import create mode 100644 scene/fight_enermy_card.gd diff --git a/autoload/global/script/global.gd b/autoload/global/script/global.gd index 7af4d60..1338c07 100644 --- a/autoload/global/script/global.gd +++ b/autoload/global/script/global.gd @@ -42,8 +42,30 @@ var now_game_data:Dictionary={ "spirit":999, "map":"map_01", "move_ability":1, - "time_unix":0 + "time_unix":0, + "card_in_bag":["card_03","card_03","card_02","card_02","card_01","card_01","card_01","card_01"] } +#当前战斗场景 +var now_fight_scene:FightScene +#向卡组中添加卡牌 +func add_card(card_id:String): + now_game_data["card_in_bag"].append(card_id) +#从卡组中删除卡牌 +func delete_card(card_id:String)->bool: + var now_arr:Array= now_game_data["card_in_bag"] + var ind=now_arr.find(card_id) + if ind==-1: + return false + else: + now_game_data["card_in_bag"].pop_at(ind) + return true +#使用卡牌 +func use_card(card_data:Dictionary,target=null): + print("执行了卡牌:\n"+str(card_data)+"\n目标"+str(target)) + + pass +func get_all_card()->Array: + return now_game_data["card_in_bag"].duplicate() func get_move_ability(): return now_game_data["move_ability"] func get_time_dictionary(): diff --git a/json/card.json b/json/card.json index 8e9d05b..8cdb5fd 100644 --- a/json/card.json +++ b/json/card.json @@ -2,16 +2,19 @@ "card_01":{ "name":"测试卡01(友方目标)", "icon":"?", - "target_queue":0 + "target_queue":0, + "cost":0 }, "card_02":{ "name":"测试卡02(不需要目标)", "icon":"?", + "cost":1 }, "card_03":{ "name":"测试卡03(敌方目标)", "icon":"?", - "target_queue":1 + "target_queue":1, + "cost":2 }, } diff --git a/res/ui/ui_026_1_arrow/tuceng355.png b/res/ui/ui_026_1_arrow/tuceng355.png new file mode 100644 index 0000000000000000000000000000000000000000..b8aea742c2ac5aaf9177099c2d5733f3a537d1fc GIT binary patch literal 13308 zcmVPyA07*naRCr$PeFu0IRr>yWW^PNpEtP~M1PHx138>gmSljA~1?&wKD@YN9s2~Ip z%Uaj&%Bt|QuLZl(1VK845=gJN=BC^-bI#vyV)(ObAqh8$z~1NK*?r8tGiT0u=R03{ zzxOcw?{jDdx&g*cHd{iO%T=`>2>fqq8fSq0Zz39JfB=$cvt0m&OCj)frOWlf|A6v8 zkQ{nHh5-5qoB2Wx%ohS(C5C(kc}|1N_5LOx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fucK2RUT7P82Yr+m;g0^D^m zG)B;L4Vp1Rx38n!>ENo<6BY|1ZYcQPa{Tgy?H=r^n;RQ}&m-aR2S&ic<1(vECKDJ# z1Koj+W~+_XWe0`fk@=NvPjuvXL8SjX)=sQ z2HM>|sFovVR@01YX z6PZ$BldqnA>#nUm2+P^Bzb7ldA)GN7#t6+;6XjY1y0L&u6H6xtH;ZTAd}qWStVW+4 z9f|$jM}G*H2P!L{nq~lRNm=T3=$e#;%SI83;#2s<`5(cOTr(5YH>&^u002ovPDHLk FV1koicM$*p literal 0 HcmV?d00001 diff --git a/res/ui/ui_026_1_arrow/tuceng356.png.import b/res/ui/ui_026_1_arrow/tuceng356.png.import new file mode 100644 index 0000000..f801c45 --- /dev/null +++ b/res/ui/ui_026_1_arrow/tuceng356.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://6hve0s4ensqw" +path="res://.godot/imported/tuceng356.png-60b2888e93551ccfe2ff81bc502cb8d9.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://res/ui/ui_026_1_arrow/tuceng356.png" +dest_files=["res://.godot/imported/tuceng356.png-60b2888e93551ccfe2ff81bc502cb8d9.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/scene/card.gd b/scene/card.gd index 0eeb1a4..9409e42 100644 --- a/scene/card.gd +++ b/scene/card.gd @@ -5,6 +5,7 @@ class_name Card @onready var arrow: card_arrow = $arrow var target_queue:int=-1 var scale_multiple:float=1.1 +signal queue func _ready() -> void: state_machine.launch() @@ -22,12 +23,12 @@ var data:Dictionary ##设置卡牌信息 func set_data(id:String): var d=Global.get_card_data(id) - print(d) if d!=null: data=d fight_card.set_data(d) if data.has("target_queue"): target_queue=data["target_queue"] + arrow.set_select_queue(target_queue) pass ##该卡牌是否需要选择目标 func need_target(): @@ -44,10 +45,11 @@ func move_to(from_pos:Vector2,to_pos:Vector2,time:float=0.5): tween.set_trans(Tween.TRANS_QUAD) tween.tween_property(self,"position",to_pos,time) tween.tween_callback(move_finished) - last_move_tween=tween +signal move_finished_sig func move_finished(): state_machine.send_message("move_finished") + move_finished_sig.emit() pass func up(): z_index=1 @@ -56,6 +58,10 @@ func up(): func down(): z_index=0 scale_to(1) + +func show_big(): + z_index=1 + scale_to(1.5) var last_scale_tween:Tween func scale_to(sc:float): if last_scale_tween!=null: @@ -65,8 +71,11 @@ func scale_to(sc:float): func get_machine()->CardMachine: return get_parent() func get_self_index_position(): - return get_machine().get_index_position(get_index()) - + return get_machine().get_index_position(get_machine().get_card_index(self)) +func get_queue_position(): + return get_machine().get_queue_pos() +func get_exe_position(): + return get_machine().get_exe_position() func request_resize(): state_machine.send_message("resize") func open_arrow(): @@ -75,3 +84,22 @@ func close_arrow(): arrow.stop() func set_arrow_queue(q:int): arrow.set_select_queue(q) + +func get_select_result(): + return arrow.get_target() +func clear(): + state_machine.change_state("discard",0) +#执行目标 +var target +func exe(): + print("exe") + move_to(self.position,get_exe_position()) + await move_finished_sig + show_big() + await get_tree().create_timer(0.2).timeout + Global.use_card(data,target) + await get_tree().create_timer(0.2).timeout + down() + print("执行完毕") + state_machine.change_state("discard",0) + return 0 diff --git a/scene/card.tscn b/scene/card.tscn index fee40fe..62ff223 100644 --- a/scene/card.tscn +++ b/scene/card.tscn @@ -63,6 +63,7 @@ script = ExtResource("9_40m88") script = ExtResource("12_sl7jh") [node name="arrow" parent="." instance=ExtResource("11_gjfgy")] +texture_num = 20 [connection signal="mouse_entered" from="fight_card" to="." method="_on_fight_card_mouse_entered"] [connection signal="mouse_exited" from="fight_card" to="." method="_on_fight_card_mouse_exited"] diff --git a/scene/card_state_machine/arrow.gd b/scene/card_state_machine/arrow.gd index c8f9ecf..30ce53e 100644 --- a/scene/card_state_machine/arrow.gd +++ b/scene/card_state_machine/arrow.gd @@ -49,6 +49,7 @@ func replace_texture(): var mouse_pos=(get_global_mouse_position()-self.global_position) area.global_position=get_global_mouse_position() texture_array[0].rotation=texture_array[1].rotation + texture_array[0].scale=Vector2(0.1,0.1) for i in range(1,texture_array.size()): var t=logWithBase(float(i)/(texture_array.size()-1)+1,2) var res=get_bezier_position(self.position,mouse_pos,t) @@ -83,3 +84,14 @@ func stop(): is_start=false area.monitoring=false area.monitorable=false +func get_target(): + var group=area.get_overlapping_areas() + if group.size()<=0: + return null + else: + var character=group[0].get_parent() + if character is FightCharacterCard or character is FightEnermyCard: + return character + else: + return null + pass diff --git a/scene/card_state_machine/arrow.tscn b/scene/card_state_machine/arrow.tscn index 54111af..50c1422 100644 --- a/scene/card_state_machine/arrow.tscn +++ b/scene/card_state_machine/arrow.tscn @@ -1,28 +1,12 @@ -[gd_scene load_steps=9 format=3 uid="uid://c7vtcaeg4nkbu"] +[gd_scene load_steps=7 format=3 uid="uid://c7vtcaeg4nkbu"] [ext_resource type="Script" path="res://scene/card_state_machine/arrow.gd" id="1_oqukl"] [ext_resource type="PackedScene" uid="uid://dg27pietgq7qd" path="res://scene/card_state_machine/arrowImg.tscn" id="2_ba6kg"] - -[sub_resource type="Gradient" id="Gradient_7pfi1"] -offsets = PackedFloat32Array(0, 0.466667, 0.509804) -colors = PackedColorArray(0, 0.463205, 0.823238, 1, 0, 0.462745, 0.823529, 1, 1, 1, 1, 0) - -[sub_resource type="GradientTexture2D" id="GradientTexture2D_qscu6"] -gradient = SubResource("Gradient_7pfi1") -fill = 1 -fill_from = Vector2(0.5, 0.5) - -[sub_resource type="Gradient" id="Gradient_8a280"] -offsets = PackedFloat32Array(0, 0.278431, 0.305882) -colors = PackedColorArray(0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0) - -[sub_resource type="GradientTexture2D" id="GradientTexture2D_t54e3"] -gradient = SubResource("Gradient_8a280") -fill = 2 -fill_from = Vector2(0.517094, 1) +[ext_resource type="Texture2D" uid="uid://6hve0s4ensqw" path="res://res/ui/ui_026_1_arrow/tuceng356.png" id="2_hhxo0"] +[ext_resource type="Texture2D" uid="uid://bncj5637mf3b" path="res://res/ui/ui_026_1_arrow/tuceng355.png" id="3_rp6eo"] [sub_resource type="Curve" id="Curve_035f2"] -_data = [Vector2(0, 0.600293), 0.0, 0.0, 0, 0, Vector2(1e-05, 0.581259), 0.0, 0.0, 0, 0, Vector2(1, 1), 0.0, 0.0, 0, 0] +_data = [Vector2(0, 0.600293), 0.0, 0.0, 0, 0, Vector2(1e-05, 0.200586), 0.0, 0.0, 0, 0, Vector2(1, 0.210102), 0.0, 0.0, 0, 0] point_count = 3 [sub_resource type="CircleShape2D" id="CircleShape2D_cys1g"] @@ -32,9 +16,9 @@ radius = 11.1803 layout_mode = 3 anchors_preset = 0 script = ExtResource("1_oqukl") -texture_circle = SubResource("GradientTexture2D_qscu6") -texture_arrow = SubResource("GradientTexture2D_t54e3") -texture_num = 20 +texture_circle = ExtResource("2_hhxo0") +texture_arrow = ExtResource("3_rp6eo") +texture_num = 10 arrowImageScene = ExtResource("2_ba6kg") curve = SubResource("Curve_035f2") max_scale = 1.0 diff --git a/scene/card_state_machine/card_machine.gd b/scene/card_state_machine/card_machine.gd index 49324dd..4e3f4cc 100644 --- a/scene/card_state_machine/card_machine.gd +++ b/scene/card_state_machine/card_machine.gd @@ -6,39 +6,72 @@ var rand_release:float=20 var distance:float=100 var card_arr:Array[Card]=[] var queue_card:Array[Card]=[] +var energy_start:int=3 +var energy:int=0 func get_index_position(index:int)->Vector2: var center=size/2 var left=center-Vector2(distance*card_arr.size()/2,0) var rand_y=randf_range(-10,10) return left+Vector2(distance*index,rand_y) -func _ready() -> void: - add_card("xxx",4) + func get_put_pos(): return size/2 - -func add_card(card_id:String,num:int): +func get_discard_pos()->Vector2: + return size + + pass +func add_card(card_id:String,num:int=1): for i in num: var new_card=CARD.instantiate() as Card add_child(new_card) new_card.set_data(card_id) card_arr.append(new_card) + new_card.queue.connect(card_queue.bind(new_card)) for j in card_arr: j.request_resize() + + pass +func get_card_index(card:Card): + if card in card_arr: + return card_arr.find(card) + else: + return 0 +func card_queue(card:Card): + queue_card.append(card) pass #获取释放位置 -func get_release_pos()->Vector2: +func get_queue_pos()->Vector2: var pos:Vector2 if release_card_pos!=null: - pos=release_card_pos.position + pos=release_card_pos.global_position -self.global_position + else: + pos=Vector2.ZERO + var rand:Vector2=Vector2(randf_range(-rand_release,rand_release),randf_range(-rand_release,rand_release)) + return pos+rand +@export var exe_card_pos:Control +func get_exe_position(): + var pos:Vector2 + if release_card_pos!=null: + pos=exe_card_pos.global_position -self.global_position else: pos=Vector2.ZERO var rand:Vector2=Vector2(randf_range(-rand_release,rand_release),randf_range(-rand_release,rand_release)) return pos+rand -func add_to_queue(card:Card): +func clear_card(): + for i in card_arr: + if not i in queue_card: + i.clear() + card_arr.clear() - if queue_card.size()==0: - queue_card.append(card) - card.send("your_turn") + pass +func exe_queue(): + var i:int=0 + while itarget_y and not need_target: + change_to_state("queue",null) + return + else: + change_to_state("selected_back") + return if Input.is_action_just_pressed("mouse_right"): change_to_state("selected_back") return - var change_y=(init_position-get_player().get_parent().get_local_mouse_position()).y if need_target and change_y>target_y: change_to_state("select_target",init_position) return + pass func update_state_phy(delta): pass diff --git a/scene/fight.gd b/scene/fight.gd index 8986054..6861e5b 100644 --- a/scene/fight.gd +++ b/scene/fight.gd @@ -1,18 +1,51 @@ extends Control +class_name FightScene +##角色节点的引用队列 - +var character_arr:Array[FightCharacterCard]=[] +var enermy_arr:Array[FightEnermyCard]=[] +var extract_card_arr:Array=[] +var hand_card_arr:Array=[] +var left_card_arr:Array=[] +var extract_num:int=5 # Called when the node enters the scene tree for the first time. func _ready() -> void: + extract_card_arr=Global.get_all_card() + extract_card(extract_num) pass # Replace with function body. - - +func extract_card(num:int): + if extract_card_arr.size() void: pass - +func start_turn(): + left_card_arr.append_array(hand_card_arr.duplicate()) + hand_card_arr.clear() + + await %card_machine.exe_queue() + + extract_card(extract_num) + %end_select.show() + pass func _on_tool_button_pressed() -> void: - %card_machine.add_card("card_01",1) - %card_machine.add_card("card_02",1) - %card_machine.add_card("card_03",1) + pass # Replace with function body. + +func _on_end_select_pressed() -> void: + %card_machine.clear_card() + %end_select.hide() + start_turn() pass # Replace with function body. diff --git a/scene/fight.tscn b/scene/fight.tscn index fb07dcf..b1fc38c 100644 --- a/scene/fight.tscn +++ b/scene/fight.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=10 format=3 uid="uid://sn3v7t7xjr1o"] +[gd_scene load_steps=14 format=3 uid="uid://sn3v7t7xjr1o"] [ext_resource type="Script" path="res://scene/fight.gd" id="1_1e3ie"] [ext_resource type="Texture2D" uid="uid://b1wfklbrwhh3y" path="res://res/ui/ui_025_adventure_mode/tuceng349.png" id="1_08haj"] @@ -7,8 +7,45 @@ [ext_resource type="PackedScene" uid="uid://b6t1mn3dd73ox" path="res://scene/card_state_machine/card_machine.tscn" id="4_i7vc5"] [ext_resource type="PackedScene" uid="uid://bdlo2wn4qnygv" path="res://scene/tool/tool_button.tscn" id="5_cxbtq"] [ext_resource type="PackedScene" uid="uid://braadtw2q0x6u" path="res://scene/fight_character_card.tscn" id="6_5ixhk"] +[ext_resource type="Shader" path="res://res/shader/stroke.gdshader" id="6_no4k5"] [ext_resource type="PackedScene" uid="uid://dd4387syao6lj" path="res://scene/fight_enermy_card.tscn" id="7_fjnhq"] +[sub_resource type="ShaderMaterial" id="ShaderMaterial_hr0jf"] +resource_local_to_scene = true +shader = ExtResource("6_no4k5") +shader_parameter/color = Color(0, 0, 0, 0.996078) +shader_parameter/width = 0.0 +shader_parameter/pattern = 0 +shader_parameter/inside = false +shader_parameter/add_margins = true +shader_parameter/number_of_images = Vector2(1, 1) +shader_parameter/open_flashing = false +shader_parameter/flashing_color = Color(0.851769, 0.851769, 0.851769, 1) + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_ey3i6"] +resource_local_to_scene = true +shader = ExtResource("6_no4k5") +shader_parameter/color = Color(0, 0, 0, 0.996078) +shader_parameter/width = 0.0 +shader_parameter/pattern = 0 +shader_parameter/inside = false +shader_parameter/add_margins = true +shader_parameter/number_of_images = Vector2(1, 1) +shader_parameter/open_flashing = false +shader_parameter/flashing_color = Color(0.851769, 0.851769, 0.851769, 1) + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_n2ued"] +resource_local_to_scene = true +shader = ExtResource("6_no4k5") +shader_parameter/color = Color(0, 0, 0, 1) +shader_parameter/width = 0.0 +shader_parameter/pattern = 0 +shader_parameter/inside = false +shader_parameter/add_margins = true +shader_parameter/number_of_images = Vector2(1, 1) +shader_parameter/open_flashing = null +shader_parameter/flashing_color = Color(1, 1, 1, 1) + [sub_resource type="StyleBoxTexture" id="StyleBoxTexture_246ik"] texture = ExtResource("1_yh6pq") texture_margin_left = 49.247 @@ -47,7 +84,8 @@ offset_bottom = -67.0 texture = ExtResource("4_3x8hl") metadata/_edit_use_anchors_ = true -[node name="ToolButton" parent="TextureRect" instance=ExtResource("5_cxbtq")] +[node name="end_select" parent="TextureRect" instance=ExtResource("5_cxbtq")] +unique_name_in_owner = true layout_mode = 1 [node name="character_card_add_pos" type="HBoxContainer" parent="."] @@ -61,9 +99,11 @@ theme_override_constants/separation = 20 metadata/_edit_use_anchors_ = true [node name="fight_character_card" parent="character_card_add_pos" instance=ExtResource("6_5ixhk")] +material = SubResource("ShaderMaterial_hr0jf") layout_mode = 2 [node name="fight_character_card2" parent="character_card_add_pos" instance=ExtResource("6_5ixhk")] +material = SubResource("ShaderMaterial_ey3i6") layout_mode = 2 [node name="enermy_card_add_pos" type="HBoxContainer" parent="."] @@ -77,6 +117,7 @@ alignment = 2 metadata/_edit_use_anchors_ = true [node name="fight_enermy_card" parent="enermy_card_add_pos" instance=ExtResource("7_fjnhq")] +material = SubResource("ShaderMaterial_n2ued") layout_mode = 2 [node name="Panel" type="Panel" parent="."] @@ -89,9 +130,11 @@ anchor_bottom = 0.960185 theme_override_styles/panel = SubResource("StyleBoxTexture_246ik") metadata/_edit_use_anchors_ = true -[node name="card_machine" parent="Panel" instance=ExtResource("4_i7vc5")] +[node name="card_machine" parent="Panel" node_paths=PackedStringArray("release_card_pos", "exe_card_pos") instance=ExtResource("4_i7vc5")] unique_name_in_owner = true layout_mode = 1 +release_card_pos = NodePath("../../release_mark") +exe_card_pos = NodePath("../../exe_mark") [node name="Label" type="Label" parent="."] layout_mode = 0 @@ -104,4 +147,23 @@ vertical_alignment = 1 [node name="ToolButton" parent="Label" instance=ExtResource("5_cxbtq")] layout_mode = 1 +[node name="release_mark" type="Control" parent="."] +layout_mode = 1 +anchor_left = 0.059375 +anchor_top = 0.337037 +anchor_right = 0.0802083 +anchor_bottom = 0.374074 +grow_vertical = 2 +metadata/_edit_use_anchors_ = true + +[node name="exe_mark" type="Control" parent="."] +layout_mode = 1 +anchor_left = 0.755208 +anchor_top = 0.39537 +anchor_right = 0.776042 +anchor_bottom = 0.432407 +grow_vertical = 2 +metadata/_edit_use_anchors_ = true + +[connection signal="pressed" from="TextureRect/end_select" to="." method="_on_end_select_pressed"] [connection signal="pressed" from="Label/ToolButton" to="." method="_on_tool_button_pressed"] diff --git a/scene/fight_character_card.gd b/scene/fight_character_card.gd index 9fdfbae..ebe84de 100644 --- a/scene/fight_character_card.gd +++ b/scene/fight_character_card.gd @@ -1,4 +1,14 @@ extends TextureRect - +class_name FightCharacterCard @onready var n: Label = $TextureRect/n @onready var icon: TextureRect = $TextureRect/TextureRect2/icon + + +func _on_area_2d_area_entered(area: Area2D) -> void: + material.set_shader_parameter("width",10) + pass # Replace with function body. + + +func _on_area_2d_area_exited(area: Area2D) -> void: + material.set_shader_parameter("width",0) + pass # Replace with function body. diff --git a/scene/fight_character_card.tscn b/scene/fight_character_card.tscn index fcb8ccb..246bb49 100644 --- a/scene/fight_character_card.tscn +++ b/scene/fight_character_card.tscn @@ -1,5 +1,6 @@ -[gd_scene load_steps=10 format=3 uid="uid://braadtw2q0x6u"] +[gd_scene load_steps=12 format=3 uid="uid://braadtw2q0x6u"] +[ext_resource type="Shader" path="res://res/shader/stroke.gdshader" id="1_7tjg7"] [ext_resource type="Texture2D" uid="uid://cn2q8k4s3bxiu" path="res://res/ui/ui_026_fight/juxing744_1.png" id="1_oi31c"] [ext_resource type="Script" path="res://scene/fight_character_card.gd" id="2_berqc"] [ext_resource type="Texture2D" uid="uid://by6vl56taeyd2" path="res://res/ui/ui_026_fight/tuceng285_2.png" id="2_evh5s"] @@ -9,10 +10,23 @@ [ext_resource type="Texture2D" uid="uid://deecs52usa3ie" path="res://res/ui/ui_026_fight/juxing768_1.png" id="6_j0vci"] [ext_resource type="Texture2D" uid="uid://dupfisl50axgw" path="res://res/ui/ui_026_fight/juxing768_2.png" id="7_wx32q"] +[sub_resource type="ShaderMaterial" id="ShaderMaterial_tpy32"] +resource_local_to_scene = true +shader = ExtResource("1_7tjg7") +shader_parameter/color = Color(0, 0, 0, 0.996078) +shader_parameter/width = 0.0 +shader_parameter/pattern = 0 +shader_parameter/inside = false +shader_parameter/add_margins = true +shader_parameter/number_of_images = Vector2(1, 1) +shader_parameter/open_flashing = false +shader_parameter/flashing_color = Color(0.851769, 0.851769, 0.851769, 1) + [sub_resource type="RectangleShape2D" id="RectangleShape2D_oitb8"] size = Vector2(457, 252) [node name="fight_character_card" type="TextureRect"] +material = SubResource("ShaderMaterial_tpy32") offset_right = 450.0 offset_bottom = 250.0 size_flags_horizontal = 0 @@ -22,6 +36,7 @@ expand_mode = 3 script = ExtResource("2_berqc") [node name="TextureRect" type="TextureRect" parent="."] +use_parent_material = true layout_mode = 1 anchors_preset = -1 anchor_right = 0.42 @@ -174,3 +189,6 @@ vertical_alignment = 1 [node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"] position = Vector2(224.5, 124) shape = SubResource("RectangleShape2D_oitb8") + +[connection signal="area_entered" from="Area2D" to="." method="_on_area_2d_area_entered"] +[connection signal="area_exited" from="Area2D" to="." method="_on_area_2d_area_exited"] diff --git a/scene/fight_enermy_card.gd b/scene/fight_enermy_card.gd new file mode 100644 index 0000000..dd31d92 --- /dev/null +++ b/scene/fight_enermy_card.gd @@ -0,0 +1,20 @@ +extends TextureRect + +class_name FightEnermyCard +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta: float) -> void: + pass + +func _on_area_2d_area_entered(area: Area2D) -> void: + material.set_shader_parameter("width",10) + pass # Replace with function body. + + +func _on_area_2d_area_exited(area: Area2D) -> void: + material.set_shader_parameter("width",0) + pass # Replace with function body. diff --git a/scene/fight_enermy_card.tscn b/scene/fight_enermy_card.tscn index 43e66d1..2f8e774 100644 --- a/scene/fight_enermy_card.tscn +++ b/scene/fight_enermy_card.tscn @@ -1,25 +1,42 @@ -[gd_scene load_steps=9 format=3 uid="uid://dd4387syao6lj"] +[gd_scene load_steps=12 format=3 uid="uid://dd4387syao6lj"] [ext_resource type="Texture2D" uid="uid://clmrqr17vnoda" path="res://res/ui/ui_026_fight/juxing804.png" id="1_c6q2o"] +[ext_resource type="Shader" path="res://res/shader/stroke.gdshader" id="1_r723e"] [ext_resource type="Texture2D" uid="uid://lipjl5h1d776" path="res://res/ui/ui_026_fight/tuceng285_1.png" id="2_ac0qe"] +[ext_resource type="Script" path="res://scene/fight_enermy_card.gd" id="2_lqjer"] [ext_resource type="Texture2D" uid="uid://d4geq35efgqon" path="res://res/ui/ui_026_fight/tuceng286.png" id="3_s8rrj"] [ext_resource type="Texture2D" uid="uid://li8e5ntlgcpg" path="res://res/ui/ui_003_select/test.png" id="4_u7od8"] [ext_resource type="Texture2D" uid="uid://bvhrxkcpq3lco" path="res://res/ui/ui_026_fight/juxing768.png" id="5_0j5x7"] [ext_resource type="Texture2D" uid="uid://deecs52usa3ie" path="res://res/ui/ui_026_fight/juxing768_1.png" id="6_x31v6"] [ext_resource type="Texture2D" uid="uid://dupfisl50axgw" path="res://res/ui/ui_026_fight/juxing768_2.png" id="7_4wsqq"] +[sub_resource type="ShaderMaterial" id="ShaderMaterial_4ic87"] +resource_local_to_scene = true +shader = ExtResource("1_r723e") +shader_parameter/color = Color(0, 0, 0, 1) +shader_parameter/width = 0.0 +shader_parameter/pattern = 0 +shader_parameter/inside = false +shader_parameter/add_margins = true +shader_parameter/number_of_images = Vector2(1, 1) +shader_parameter/open_flashing = null +shader_parameter/flashing_color = Color(1, 1, 1, 1) + [sub_resource type="RectangleShape2D" id="RectangleShape2D_ut4q5"] size = Vector2(453, 249) [node name="fight_enermy_card" type="TextureRect"] +material = SubResource("ShaderMaterial_4ic87") offset_right = 450.0 offset_bottom = 250.0 size_flags_horizontal = 8 size_flags_vertical = 3 texture = ExtResource("1_c6q2o") expand_mode = 3 +script = ExtResource("2_lqjer") [node name="TextureRect" type="TextureRect" parent="."] +use_parent_material = true layout_mode = 1 anchors_preset = -1 anchor_left = 0.573333 @@ -170,7 +187,12 @@ horizontal_alignment = 1 vertical_alignment = 1 [node name="Area2D" type="Area2D" parent="."] +collision_layer = 2 +collision_mask = 2 [node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"] position = Vector2(226.5, 125.5) shape = SubResource("RectangleShape2D_ut4q5") + +[connection signal="area_entered" from="Area2D" to="." method="_on_area_2d_area_entered"] +[connection signal="area_exited" from="Area2D" to="." method="_on_area_2d_area_exited"] diff --git a/scene/game_flow_touch.gd b/scene/game_flow_touch.gd index f1f9f39..484cfaa 100644 --- a/scene/game_flow_touch.gd +++ b/scene/game_flow_touch.gd @@ -31,7 +31,6 @@ func judge(): self.show() else: self.hide() - print(data["name"]+"判定结果:"+str(res)) func _on_tool_button_pressed() -> void: pass # Replace with function body.