From 94589131fa667d337ee009260f3faa17f6727bf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=A8=E8=90=BD=E5=9F=BA=E5=9B=B4=E8=99=BE?= <3161880837@qq.com> Date: Sun, 7 Sep 2025 09:25:51 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=AD=A6=E5=99=A8=E7=B3=BB=E7=BB=9F):=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=83=E5=BD=A9=E7=9F=A2=E6=AD=A6=E5=99=A8?= =?UTF-8?q?=E5=8F=8A=E5=85=B6=E7=9B=B8=E5=85=B3=E8=B5=84=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加新的七彩矢武器系统,包括武器脚本、子弹特效、着色器和动画资源 为Rooster角色添加新武器选项 实现光效追踪和颜色渐变效果 调整窗口模式为2(全屏) --- .../Bullets/BossAttack/Bear/ArrowSeven.tscn | 161 ++++++++++++++++++ components/Characters/Rooster.tscn | 10 +- components/Weapons/Arrow7.tscn | 30 ++++ project.godot | 1 + .../bullets/light-express/Ethereal_Lance.webp | Bin 0 -> 198 bytes .../light-express/Ethereal_Lance.webp.import | 34 ++++ .../light-express/Everlasting_Rainbow.png | Bin 0 -> 1615 bytes .../Everlasting_Rainbow.png.import | 34 ++++ .../bullets/light-express/Prismatic_Bolt.webp | Bin 0 -> 1424 bytes .../light-express/Prismatic_Bolt.webp.import | 34 ++++ .../bullets/light-express/Sun_Dance.webp | Bin 0 -> 434 bytes .../light-express/Sun_Dance.webp.import | 34 ++++ .../Bullets/BossAttack/Bear/ArrowSeven.gd | 42 +++++ scripts/Contents/Characters/Bear.gd | 8 +- scripts/Contents/Weapons/Arrow7.gd | 15 ++ scripts/Statemachine/ShaderStage.gd | 10 ++ shaders/Light.gdshader | 8 + shaders/SuperLight.gdshader | 26 +++ 18 files changed, 445 insertions(+), 2 deletions(-) create mode 100644 components/Bullets/BossAttack/Bear/ArrowSeven.tscn create mode 100644 components/Weapons/Arrow7.tscn create mode 100644 resources/bullets/light-express/Ethereal_Lance.webp create mode 100644 resources/bullets/light-express/Ethereal_Lance.webp.import create mode 100644 resources/bullets/light-express/Everlasting_Rainbow.png create mode 100644 resources/bullets/light-express/Everlasting_Rainbow.png.import create mode 100644 resources/bullets/light-express/Prismatic_Bolt.webp create mode 100644 resources/bullets/light-express/Prismatic_Bolt.webp.import create mode 100644 resources/bullets/light-express/Sun_Dance.webp create mode 100644 resources/bullets/light-express/Sun_Dance.webp.import create mode 100644 scripts/Contents/Bullets/BossAttack/Bear/ArrowSeven.gd create mode 100644 scripts/Contents/Weapons/Arrow7.gd create mode 100644 scripts/Statemachine/ShaderStage.gd create mode 100644 shaders/Light.gdshader create mode 100644 shaders/SuperLight.gdshader diff --git a/components/Bullets/BossAttack/Bear/ArrowSeven.tscn b/components/Bullets/BossAttack/Bear/ArrowSeven.tscn new file mode 100644 index 0000000..e22aedd --- /dev/null +++ b/components/Bullets/BossAttack/Bear/ArrowSeven.tscn @@ -0,0 +1,161 @@ +[gd_scene load_steps=24 format=3 uid="uid://bjskq2m1rrlks"] + +[ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_dvf35"] +[ext_resource type="Script" path="res://scripts/Contents/Bullets/BossAttack/Bear/ArrowSeven.gd" id="2_uqsop"] +[ext_resource type="Shader" path="res://shaders/Light.gdshader" id="3_j0g0m"] +[ext_resource type="Texture2D" uid="uid://chq2rnqi00nbj" path="res://resources/bullets/light-express/Prismatic_Bolt.webp" id="3_tmrnu"] +[ext_resource type="Shader" path="res://shaders/SuperLight.gdshader" id="5_lyybq"] +[ext_resource type="Script" path="res://scripts/Statemachine/ShaderStage.gd" id="5_ppdpf"] + +[sub_resource type="Gradient" id="Gradient_wd04q"] +offsets = PackedFloat32Array(0, 0.16, 0.32, 0.48, 0.64, 0.8, 1) +colors = PackedColorArray(1, 0, 0, 1, 1, 0.447059, 0, 1, 1, 0.890625, 0, 1, 0, 0.820313, 0.128174, 1, 0, 1, 0.859375, 1, 0, 0.53125, 1, 1, 0.429688, 0, 1, 1) + +[sub_resource type="GradientTexture1D" id="GradientTexture1D_e0qv5"] +gradient = SubResource("Gradient_wd04q") + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_1nfgk"] +shader = ExtResource("3_j0g0m") +shader_parameter/color = Color(1, 1, 1, 1) + +[sub_resource type="SpriteFrames" id="SpriteFrames_q4xus"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": ExtResource("3_tmrnu") +}], +"loop": true, +"name": &"default", +"speed": 5.0 +}] + +[sub_resource type="Animation" id="Animation_usqjd"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("superlight:scale") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector2(1, 1)] +} + +[sub_resource type="Animation" id="Animation_oinqg"] +resource_name = "destroy" +length = 0.5 +step = 0.1 + +[sub_resource type="Animation" id="Animation_ynxlt"] +resource_name = "loop" +length = 0.2 +loop_mode = 1 +step = 0.05 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("superlight:scale") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 0.1, 0.2), +"transitions": PackedFloat32Array(1, 1, 1), +"update": 0, +"values": [Vector2(1, 1), Vector2(0.8, 0.8), Vector2(1, 1)] +} + +[sub_resource type="Animation" id="Animation_kmogx"] +resource_name = "spawn" + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_f7cx6"] +_data = { +"RESET": SubResource("Animation_usqjd"), +"destroy": SubResource("Animation_oinqg"), +"loop": SubResource("Animation_ynxlt"), +"spawn": SubResource("Animation_kmogx") +} + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_7e3fr"] +shader = ExtResource("5_lyybq") +shader_parameter/k = -0.223 +shader_parameter/color = Color(1, 1, 1, 1) +shader_parameter/scale = 10.0 + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_w3sk0"] +shader = ExtResource("3_j0g0m") +shader_parameter/color = Color(1, 1, 1, 1) + +[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_yjmap"] +radius = 5.0 +height = 42.0 + +[sub_resource type="Curve" id="Curve_n2t6r"] +_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0] +point_count = 2 + +[sub_resource type="CurveTexture" id="CurveTexture_wjo54"] +curve = SubResource("Curve_n2t6r") + +[sub_resource type="Curve" id="Curve_uxwl3"] +_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0] +point_count = 2 + +[sub_resource type="CurveTexture" id="CurveTexture_i5kg3"] +curve = SubResource("Curve_uxwl3") + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_7osnr"] +particle_flag_disable_z = true +direction = Vector3(-1, 0, 0) +spread = 180.0 +initial_velocity_min = 30.0 +initial_velocity_max = 60.0 +gravity = Vector3(0, 0, 0) +scale_min = 10.0 +scale_max = 10.0 +scale_curve = SubResource("CurveTexture_i5kg3") +alpha_curve = SubResource("CurveTexture_wjo54") + +[node name="ArrowSeven" instance=ExtResource("1_dvf35")] +position = Vector2(-34, -24) +script = ExtResource("2_uqsop") +allColor = SubResource("GradientTexture1D_e0qv5") +autoLoopAnimation = true + +[node name="texture" parent="." index="0"] +material = SubResource("ShaderMaterial_1nfgk") +rotation = 1.5708 +sprite_frames = SubResource("SpriteFrames_q4xus") + +[node name="animator" parent="texture" index="0"] +libraries = { +"": SubResource("AnimationLibrary_f7cx6") +} + +[node name="superlight" type="Node2D" parent="texture" index="1"] +unique_name_in_owner = true +z_index = -1 +material = SubResource("ShaderMaterial_7e3fr") +script = ExtResource("5_ppdpf") +size = Vector2(100, 200) + +[node name="frontlight" type="Node2D" parent="texture" index="2"] +unique_name_in_owner = true +material = SubResource("ShaderMaterial_w3sk0") +scale = Vector2(0.968786, 0.968786) +script = ExtResource("5_ppdpf") +size = Vector2(40, 40) +color = Color(1, 1, 1, 0) + +[node name="hitbox" parent="." index="1"] +visible = false +rotation = 1.5708 +shape = SubResource("CapsuleShape2D_yjmap") + +[node name="trail" type="GPUParticles2D" parent="." index="2"] +unique_name_in_owner = true +z_index = -1 +amount = 100 +process_material = SubResource("ParticleProcessMaterial_7osnr") diff --git a/components/Characters/Rooster.tscn b/components/Characters/Rooster.tscn index 6125f03..317242d 100644 --- a/components/Characters/Rooster.tscn +++ b/components/Characters/Rooster.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=17 format=3 uid="uid://bm7ymrri6pykb"] +[gd_scene load_steps=18 format=3 uid="uid://bm7ymrri6pykb"] [ext_resource type="PackedScene" uid="uid://cvogxi7mktumf" path="res://components/Abstracts/EntityBase.tscn" id="1_e5pl8"] [ext_resource type="Script" path="res://scripts/Contents/Characters/Rooster.gd" id="2_oqdqd"] @@ -13,6 +13,7 @@ [ext_resource type="AudioStream" uid="uid://dmxh3bpk8vyy5" path="res://resources/sounds/effect/Coin.mp3" id="5_xnbhq"] [ext_resource type="PackedScene" uid="uid://bb1uh8k7gkhr7" path="res://components/Weapons/VectorStar.tscn" id="6_fvy5n"] [ext_resource type="AudioStream" uid="uid://4wuuf1osk0yv" path="res://resources/sounds/effect/Low Boing.wav" id="6_m5px1"] +[ext_resource type="PackedScene" uid="uid://ct2p0fbd5ktof" path="res://components/Weapons/Arrow7.tscn" id="7_jguvd"] [ext_resource type="AudioStream" uid="uid://b10u6iir6uvqn" path="res://resources/sounds/effect/BigLaser.wav" id="8_7dhim"] [sub_resource type="SpriteFrames" id="SpriteFrames_4v2ol"] @@ -47,12 +48,19 @@ script = ExtResource("2_oqdqd") process_mode = 4 [node name="PurpleCrystal" parent="weaponStore" index="0" instance=ExtResource("3_ms5sq")] +debugRebuild = false [node name="VectorStar" parent="weaponStore" index="1" instance=ExtResource("6_fvy5n")] +debugRebuild = false [node name="LGBT" parent="weaponStore" index="2" instance=ExtResource("4_pb8qn")] +debugRebuild = false [node name="BigLaser" parent="weaponStore" index="3" instance=ExtResource("4_plqwu")] +debugRebuild = false + +[node name="WeaponCard" parent="weaponStore" index="4" instance=ExtResource("7_jguvd")] +debugRebuild = false [node name="sprint" parent="sounds" index="0"] stream = ExtResource("4_66s6c") diff --git a/components/Weapons/Arrow7.tscn b/components/Weapons/Arrow7.tscn new file mode 100644 index 0000000..16f2f2e --- /dev/null +++ b/components/Weapons/Arrow7.tscn @@ -0,0 +1,30 @@ +[gd_scene load_steps=4 format=3 uid="uid://ct2p0fbd5ktof"] + +[ext_resource type="PackedScene" uid="uid://ckq2cq6m23hq3" path="res://components/Abstracts/WeaponCardBase.tscn" id="1_ra1fw"] +[ext_resource type="Script" path="res://scripts/Contents/Weapons/Arrow7.gd" id="2_a7w7h"] +[ext_resource type="Texture2D" uid="uid://chq2rnqi00nbj" path="res://resources/bullets/light-express/Prismatic_Bolt.webp" id="2_vwdyb"] + +[node name="Arrow7" instance=ExtResource("1_ra1fw")] +script = ExtResource("2_a7w7h") +avatarTexture = ExtResource("2_vwdyb") +displayName = "七彩矢" +typeTopic = 3 +store = { +"atk": 10, +"count": 20 +} +storeType = { +"atk": 1, +"count": 1 +} +descriptionTemplate = "发射$count支七彩矢,每支造成$atk点伤害。" + +[node name="avatar" parent="container/info" index="0"] +texture = ExtResource("2_vwdyb") + +[node name="name" parent="container/info" index="2"] +displayName = "七彩矢" +typeTopic = 3 + +[node name="description" parent="container" index="2"] +text = "[center]发射[color=cyan]20[/color]支七彩矢,每支造成[color=cyan]10[/color]点伤害。[/center]" diff --git a/project.godot b/project.godot index 8290d30..7ea03f3 100644 --- a/project.godot +++ b/project.godot @@ -19,6 +19,7 @@ config/icon="res://icon.svg" window/size/viewport_width=1280 window/size/viewport_height=720 +window/size/mode=2 [dotnet] diff --git a/resources/bullets/light-express/Ethereal_Lance.webp b/resources/bullets/light-express/Ethereal_Lance.webp new file mode 100644 index 0000000000000000000000000000000000000000..786a7cbb78052d092d41952ee76366dadb274fd5 GIT binary patch literal 198 zcmV;%06G6sNk&G#00012MM6+kP&iDn0000lcfbV@AE1zJ1nB(PexlP*khTFc|JuHy zDM;IZnSX6x(dIt@_iajF=?Qh;qtYHue?m9T;iHIOR5Og6TapQ|52mu%IwMam8kpaO6 zx)VeYVRj@&^#rG9)G=P3N&BqDk!Zuc};CnZdrl`COg zs0Uc@_V^;{crI4%fs2*J)tdPtXaudv7xys{^kC8;R%V`d-QK!m4<>0M(ebSsZU=wt zZU`+9NmfL7fl?VjDzhX~^Da!ne+a;G@qTsB*1 zQ^rJ?=a-eXG#LTKq%Jd+MT(kwCAt?#l`S3uu|!X`vc#TBlIYoSKQS>eZH{?Skcg^Y zLmp9LiVD-`{sdmV z2_z@Y5&aRj*J}uAC4qV8gN|&NfVOLU)J}T`(%?WUylLTg85J2I%HwL$3?`2Ki#K~X zbjoAvrayZo5D~8Z&wdW9KLiXeR}>f(r!SbzYqtXV$Oy5yBCR8OBYI8nDomAJX}8*v z26{0)J}$!{wl@OIjs(CfN${S1dn3oF$T%l>^L+b$M?$QhE+Qxg0X+RFuyGO?4uMDB z2krrYuYvOqTE8cMFuRKYd{(b1(!HjAM1*urBJKBVf6VY&9b}>N%Hm$xrVAcqtHY762^2h9DcP`yRj>hXJn^UGZ;C zMD#|KkxA3ryW@K1+ci_GR|hSgd9U%cpPnCkb<_JTFV6C;H#?)IIag%C^Ou5F1w{Cr zaAw~nlLGi<9l#6b^_wm8$7-PA-6QrLML55S0EMKxuRSB8?d~Z(yAjLJ(jsx$xh55& zreWSpG8pZ!+!hh}c+FsSOito*lL~6pDv^dvIDbF@aU`@$%F@;j2sEs6eh8YB+;AgM zjHl}dQjbJLuSCsTIR`kQ?z(#_jo6-fu3kw3WB*VWdpA6(XjvD~L+RD57uJyksS?XZ zAm@TisHcPokkxYtiRg@)iihKQz$l=wZ0!fX0WQMi%Kg7!-L&_?f8dT`tpYv&@n_!w&=4Qfdx%mvdtwXf{0E#yr*M|!T7KaP?D zdj4!-8;@E4+2}ZNb6Q#VO4KPyKy!u5NG7!VwiurjFy4=^|D+?>s#=+Cmb8xdXAwav zSSNA4c=n%>f~nn-n$7|}DkMXg;D!Cx^4q;!C3jIUpA6D*?ouM6SK@SKF^RA~jQ}U6 zrJg5zO$fDjEmYX~H01aDb}~m$E`YKLnAo?>9ekrV;7cy#MKdN>P8j=?d zh~*hIITsD|Oxe1B-a3KOfA2x;6U(F z4CiRyB}HLr<#7(kS~Lh8fRBy=SN;M9S8Nale*@z|l~UBy8_}`=CIzXe%I<%7_tm%D zeHH&NiI@N@frd?(tbsJF1|o*rz<3CZ20)$zlRWKf>YccGztG8o{X&;z)~>X}GUq6U z)uejvGZ2TK=Wo(Ll_wFbv-~@E+5|n?GHv^t5)r)-x7%GD(n?21@^N&P3L2aqMrBw_~c1o>k=>yi?&lgn$79k zfP9#UNV~zW=WcM#%)ZeV0Lj1t;%7K~hMDrzhqep6gi(M>2O^&P!uGw6hhT&>Fgo7+ z6*zIArXdlrxKEXqjfkl)PYkhtQWp2kinwk5I>M3_z}0qcbWEz0$4?9uc}zoDqO2X8P-&qwr2{s9hx?duS8{+j>* N002ovPDHLkV1lmV{_Ow& literal 0 HcmV?d00001 diff --git a/resources/bullets/light-express/Everlasting_Rainbow.png.import b/resources/bullets/light-express/Everlasting_Rainbow.png.import new file mode 100644 index 0000000..ea5987c --- /dev/null +++ b/resources/bullets/light-express/Everlasting_Rainbow.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bkiaaucejquik" +path="res://.godot/imported/Everlasting_Rainbow.png-e1d35de17a7261a88419c468ef630bba.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resources/bullets/light-express/Everlasting_Rainbow.png" +dest_files=["res://.godot/imported/Everlasting_Rainbow.png-e1d35de17a7261a88419c468ef630bba.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/resources/bullets/light-express/Prismatic_Bolt.webp b/resources/bullets/light-express/Prismatic_Bolt.webp new file mode 100644 index 0000000000000000000000000000000000000000..39c9ab1511b560d41c8b7b850138b50a273d7e80 GIT binary patch literal 1424 zcmV;B1#kLNNk&G91pok7MM6+kP&iC`1pojqN5ByfSECS;Bxm=M$YZ@f$VCPPZQHP+ zejcV7he)IqDZI%>U-uCWNI|Fswwv9=WGwd&H8yOjPMA|4@U-SK+ z;NElZhvLt3BKq&hZ5v5aCD^Oy(o1Tdu=OXnwts}Z8tc2&^sOI8@%z?xh_qVGhjc8H z*_P_=&aSXD95lHD)b_+BmY|rau(mH*FkxC!a%~}VKx6^yfCy2`F~Ju)_Ib@pWJ4q( z;w9inHkqQVpJ!}nM+d1$WJeoXMMn@*6nb`t(?xDn(M{wehn+d_GG;(TU>ERQZjYCI zq#}{mgKigeWP(Oi@S*4R`7xlNiV6n&NYD|5bR$;xfI6JqQ-a|LMpdLpI1~){eO|Yd zB@gxuZIJG;Fm-vD7m7sVi4>_w$wWLF2`PRrOA2BPSmo;V2SSl}GL_D%U}Y(lh=qfG zpGOcw5Rpuka4eb1=8I)WxtPnO646k=&&2{oH&88t##5O>x!P!{_%|W8>XlMHos5MQ zCU&dkK$1djhzK;Op$lcB5Lzq+;QK&+W8}J=(f0vv#M)7vNf|w~q$n z31l+rcU!e$HWdpo0V!Q$CM@)N57pEamqKWh2-e zZl4lOX3I^c$CtNH&sF>%RiuZT^Yv`lZIm*J2s9$71-xfj%rsH+0va01xn>Fv`i-u*xF=9drGCyPhWqb8?-CAWJF;F zD=3g|SS83R_3n6icKiI@7a5=5KD#+t3_Dd;&;qqNu-F0VV&iDMI=_4I;oH9m`G>x| zdwzSm7#-F?qhzBILUF*-L^Q7@4T?hW{;Mqbq7jIYk(Qv|mQSxAuaD=0PL;KogHMU3 za@EdYwz+zE`9XG}_b=`)*3(`~b|GCYlIO_b@&zLB{$HKnK6@kM)zi)CVtmv9_djG; zM+-FYIRcIK!{K~$dH4Ly2lza`fA#G4d_5cRN=$qnCFs})8(COs^~Q^ntNUj!Aupb8 zFE@+PQKOtqMs(b^dP186JlGj#29xE<J-`q#{u=5sQWuFy`2;7U3t14NQVKT)+v1 zqcKvE_yDH_gt5!AFCUkTip}A4dAxoMC_z$@Na0hUhqc)(1ZU-Kqd*}rB*V!RRrK?W z+vNmpz&AK4Lm@D=%f@Ywif-f?vRO$s-5NtaadQXl4kD+D^Q`v#Z+PYwP7-7j z773o9hCz+Gen8N+ZDZGy zbO_qEZR~oI&S28Eu|bkfZQ2G5UY&BsdhhoC005{0sHRd)l`2)LZcEi|A9MHJHg|u# z|3#{9yRTGJsRF11000;u*tVNCDhx9-Lz(x#I!Axdv82JTi2gfl+sKi`j~5Eq-McHG zQ4^hK@B|*ggU~RruF#R*9eEG#z^!DzdQz8}6gS`+T+vANrC$DlOK_1Gqd}!#-@rLI zOZ0BY0a=>BDL4s5x3GwT<3zDWL$b7?BkHq-EPCKjk6&6OmH(GE@t{)b#-UMQKPl~& z&@HeRrQD)sV3(z8QqefD!-6#BBtrebcGUY^!4`qKHIod}mQau85i=_lu^Ey3zA#o` zBgw8s%ncV<7c%)}$jCLYDtyY@v_-6dWw6BezRewIgI4n5+x~&3@V$`_HrxI*%a3!c zKL_B0`7tNV9Xn!O#Sd$aeprw9!nG=1xQ@#U*Ess&`d>F(8}EnvM*MJ3l^gCibi=*4 cKDbZa{?Bl*{_{<2|LmVHwdZ0v;0FSEMQ2+n{ literal 0 HcmV?d00001 diff --git a/resources/bullets/light-express/Sun_Dance.webp.import b/resources/bullets/light-express/Sun_Dance.webp.import new file mode 100644 index 0000000..cff88fc --- /dev/null +++ b/resources/bullets/light-express/Sun_Dance.webp.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://0w8sebsqjb7a" +path="res://.godot/imported/Sun_Dance.webp-a2f97cb60ab8eed183860f5e649ba3ad.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resources/bullets/light-express/Sun_Dance.webp" +dest_files=["res://.godot/imported/Sun_Dance.webp-a2f97cb60ab8eed183860f5e649ba3ad.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/scripts/Contents/Bullets/BossAttack/Bear/ArrowSeven.gd b/scripts/Contents/Bullets/BossAttack/Bear/ArrowSeven.gd new file mode 100644 index 0000000..64b1848 --- /dev/null +++ b/scripts/Contents/Bullets/BossAttack/Bear/ArrowSeven.gd @@ -0,0 +1,42 @@ +extends BulletBase + +@export var allColor: GradientTexture1D = null + +@onready var superlight: Node2D = $"%superlight" +@onready var trail: GPUParticles2D = $"%trail" + +var myColor: Color +var tracer: EntityBase = null +var forwardTime: float = 500 +var forwarded: bool = false + +func register(): + speed = 1 + damage = 5 + penerate = 1 +func spawn(): + myColor = allColor.gradient.sample(randf()) + superlight.material = superlight.material.duplicate() + trail.process_material = trail.process_material.duplicate() + setColor(myColor) + + +func ai(): + superlight.global_rotation_degrees = 90 + PresetBulletAI.forward(self, rotation) + if timeLived() <= forwardTime: + speed = 10 * ((forwardTime - timeLived()) / forwardTime) + elif forwarded: + if timeLived() < forwardTime + 1000: + speed = clamp((timeLived() - forwardTime) / 75, 0, 30) + if is_instance_valid(tracer): + PresetBulletAI.trace(self, tracer.position, 0.1) + else: + forwarded = true + + +func setColor(color: Color): + texture.self_modulate = color + var mat: ParticleProcessMaterial = trail.process_material + mat.color = color + superlight.material.set_shader_parameter("color", color) diff --git a/scripts/Contents/Characters/Bear.gd b/scripts/Contents/Characters/Bear.gd index 4372dbf..2f0c1e1 100644 --- a/scripts/Contents/Characters/Bear.gd +++ b/scripts/Contents/Characters/Bear.gd @@ -1,2 +1,8 @@ extends EntityBase -class_name Bear +class_name Bear # 攻击方式模仿泰拉瑞亚光之女皇 + +func ai(): + pass +func attack(type): + if type == 0: + pass diff --git a/scripts/Contents/Weapons/Arrow7.gd b/scripts/Contents/Weapons/Arrow7.gd new file mode 100644 index 0000000..1fee0f7 --- /dev/null +++ b/scripts/Contents/Weapons/Arrow7.gd @@ -0,0 +1,15 @@ +@tool +extends Weapon +class_name Arrow7Weapon + +func update(to: int, origin: Dictionary, _entity: EntityBase): + origin["atk"] += 5 * to + origin["count"] += 1 * to + return origin +func attack(entity: EntityBase): + var weaponPos = entity.findWeaponAnchor("normal") + for i in range(readStore("count")): + for bullet in BulletBase.generate(preload("res://components/Bullets/BossAttack/Bear/ArrowSeven.tscn"), entity, weaponPos, deg_to_rad(randf_range(0, 360))): + bullet.damage = readStore("atk") + bullet.tracer = EntityTool.findClosetEntity(entity.position, get_tree(), false, true) + return true diff --git a/scripts/Statemachine/ShaderStage.gd b/scripts/Statemachine/ShaderStage.gd new file mode 100644 index 0000000..917b4ea --- /dev/null +++ b/scripts/Statemachine/ShaderStage.gd @@ -0,0 +1,10 @@ +@tool +extends CanvasItem + +@export var size: Vector2 = Vector2.ONE * 100 +@export var color: Color = Color.WHITE + +func _draw(): + draw_rect(Rect2(size / -2, size), color) +func _process(_delta): + queue_redraw() diff --git a/shaders/Light.gdshader b/shaders/Light.gdshader new file mode 100644 index 0000000..5b77856 --- /dev/null +++ b/shaders/Light.gdshader @@ -0,0 +1,8 @@ +shader_type canvas_item; +uniform vec4 color:source_color; +void fragment() { + float maxDistance=0.5; + float dist=distance(UV,vec2(0.5)); + vec4 mixed=vec4(color.rgb,smoothstep(0,1,(maxDistance-dist)/maxDistance)); + COLOR=mix(COLOR,mixed,0.5); +} \ No newline at end of file diff --git a/shaders/SuperLight.gdshader b/shaders/SuperLight.gdshader new file mode 100644 index 0000000..3d3ced4 --- /dev/null +++ b/shaders/SuperLight.gdshader @@ -0,0 +1,26 @@ +shader_type canvas_item; +uniform float k : hint_range(-10.0, 10.0) = 1.0; +uniform vec4 color : source_color = vec4(1.0); +uniform float scale : hint_range(10.0, 500.0) = 100.0; +void fragment() { + vec2 pos = (UV - 0.5) * scale; + float y1 = k / pos.x; + float y2 = -k / pos.x; + bool in_region = false; + if (pos.x > 0.0) { + if ((pos.y > y2 && pos.y < y1) || (pos.y < y2 && pos.y > y1)) { + in_region = true; + } + } + else if (pos.x < 0.0) { + if ((pos.y > y1 && pos.y < y2) || (pos.y < y1 && pos.y > y2)) { + in_region = true; + } + } + if (in_region) { + COLOR = color; + } else { + COLOR = vec4(0.0); + } + COLOR.a*=(0.5-distance(UV,vec2(0.5)))/0.5; +}