mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-06-07 20:27:13 +08:00
feat: 添加音元护盾武器和召唤物功能
实现音元护盾武器系统,包含以下内容: - 新增护盾武器资源及脚本 - 添加护盾召唤物逻辑 - 实现护盾AI跟随主人功能 - 更新公鸡角色默认武器为护盾
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://cvogxi7mktumf" path="res://components/Abstracts/EntityBase.tscn" id="1_e5pl8"]
|
||||
[ext_resource type="Script" uid="uid://cthtupc6dtbav" path="res://scripts/Contents/Characters/Rooster.gd" id="2_oqdqd"]
|
||||
[ext_resource type="PackedScene" uid="uid://c0n3igy4hucrg" path="res://components/Weapons/PurpleCrystal.tscn" id="3_0omr3"]
|
||||
[ext_resource type="PackedScene" uid="uid://sp8f50c5mxyc" path="res://components/Weapons/Shield.tscn" id="3_0omr3"]
|
||||
[ext_resource type="AudioStream" uid="uid://dclinyhu256xi" path="res://resources/sounds/effect/Low Whoosh.mp3" id="3_4syso"]
|
||||
[ext_resource type="AudioStream" uid="uid://cdrevrq7n6yqa" path="res://resources/sounds/effect/Boing.mp3" id="4_66s6c"]
|
||||
[ext_resource type="AudioStream" uid="uid://benyec5bqni0b" path="res://resources/sounds/effect/Chomp.wav" id="4_k0yme"]
|
||||
@@ -56,8 +56,7 @@ metadata/_edit_vertical_guides_ = [71.0]
|
||||
[node name="weaponStore" parent="." index="1"]
|
||||
process_mode = 4
|
||||
|
||||
[node name="PurpleCrystal" parent="weaponStore" index="0" instance=ExtResource("3_0omr3")]
|
||||
debugRebuild = false
|
||||
[node name="Shield" parent="weaponStore" index="0" instance=ExtResource("3_0omr3")]
|
||||
|
||||
[node name="sprint" parent="sounds" index="0"]
|
||||
stream = ExtResource("4_66s6c")
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://bjuf0n8y5fxw4"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://cvogxi7mktumf" path="res://components/Abstracts/EntityBase.tscn" id="1_xnsmi"]
|
||||
[ext_resource type="Script" uid="uid://fc3pppnguup" path="res://scripts/Contents/Summons/Shield.gd" id="2_1x6ja"]
|
||||
[ext_resource type="Shader" uid="uid://cnc1n2042ntv5" path="res://shaders/Ring.gdshader" id="3_ddbxg"]
|
||||
[ext_resource type="Script" uid="uid://cgb01lelfg73p" path="res://scripts/Statemachine/ShaderStage.gd" id="4_cg4js"]
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_1x6ja"]
|
||||
animations = [{
|
||||
"frames": [],
|
||||
"loop": true,
|
||||
"name": &"idle",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [],
|
||||
"loop": true,
|
||||
"name": &"walk",
|
||||
"speed": 5.0
|
||||
}]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_ddbxg"]
|
||||
shader = ExtResource("3_ddbxg")
|
||||
shader_parameter/inner = 0.9499999787656
|
||||
shader_parameter/outer = 0.999999977648
|
||||
shader_parameter/alpha = 1.0
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_cg4js"]
|
||||
shader = ExtResource("3_ddbxg")
|
||||
shader_parameter/inner = 0.0
|
||||
shader_parameter/outer = 0.999999977648
|
||||
shader_parameter/alpha = 0.2999999932944
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_ddbxg"]
|
||||
radius = 150.0
|
||||
|
||||
[node name="Sheild" instance=ExtResource("1_xnsmi")]
|
||||
script = ExtResource("2_1x6ja")
|
||||
attraction = 0.0
|
||||
|
||||
[node name="texture" parent="." index="3"]
|
||||
sprite_frames = SubResource("SpriteFrames_1x6ja")
|
||||
|
||||
[node name="circle" type="Node2D" parent="texture/staticBackground" index="0"]
|
||||
material = SubResource("ShaderMaterial_ddbxg")
|
||||
script = ExtResource("4_cg4js")
|
||||
size = Vector2(300, 300)
|
||||
color = Color(1, 0.76694965, 0, 1)
|
||||
metadata/_custom_type_script = "uid://cgb01lelfg73p"
|
||||
|
||||
[node name="circle2" type="Node2D" parent="texture/staticBackground" index="1"]
|
||||
material = SubResource("ShaderMaterial_cg4js")
|
||||
script = ExtResource("4_cg4js")
|
||||
size = Vector2(300, 300)
|
||||
color = Color(1, 0.76694965, 0, 1)
|
||||
metadata/_custom_type_script = "uid://cgb01lelfg73p"
|
||||
|
||||
[node name="hitbox" parent="texture/hurtbox" index="0"]
|
||||
shape = SubResource("CircleShape2D_ddbxg")
|
||||
|
||||
[node name="statebar" parent="." index="4"]
|
||||
position = Vector2(-1, -217)
|
||||
@@ -0,0 +1,30 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://sp8f50c5mxyc"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://ckq2cq6m23hq3" path="res://components/Abstracts/WeaponCardBase.tscn" id="1_rax6s"]
|
||||
[ext_resource type="Texture2D" uid="uid://b6tr2k13qog0j" path="res://resources/weapons/shield.png" id="2_gcjwh"]
|
||||
[ext_resource type="Script" uid="uid://dcacy48pcfci3" path="res://scripts/Contents/Weapons/Shield.gd" id="2_s74sn"]
|
||||
|
||||
[node name="Shield" instance=ExtResource("1_rax6s")]
|
||||
script = ExtResource("2_s74sn")
|
||||
avatarTexture = ExtResource("2_gcjwh")
|
||||
displayName = "音元水晶"
|
||||
store = {
|
||||
"atk": 200
|
||||
}
|
||||
descriptionTemplate = "召唤一个可抵挡$atk点伤害的[b]音元护盾[/b]。"
|
||||
debugRebuild = true
|
||||
|
||||
[node name="avatar" parent="container/info" index="0"]
|
||||
texture = ExtResource("2_gcjwh")
|
||||
|
||||
[node name="beachball" parent="container/info/infos" index="1"]
|
||||
count = 500
|
||||
|
||||
[node name="soul" parent="container/info/infos" index="2"]
|
||||
count = 1
|
||||
|
||||
[node name="name" parent="container/info" index="2"]
|
||||
displayName = "音元水晶"
|
||||
|
||||
[node name="description" parent="container" index="2"]
|
||||
text = "[center]召唤一个可抵挡[color=cyan]200[/color]点伤害的[b]音元护盾[/b]。[/center]"
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 82 KiB |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://b6tr2k13qog0j"
|
||||
path="res://.godot/imported/shield.png-03d91a01225020f1df846d8ad3b19364.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://resources/weapons/shield.png"
|
||||
dest_files=["res://.godot/imported/shield.png-03d91a01225020f1df846d8ad3b19364.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
|
||||
@@ -0,0 +1,7 @@
|
||||
class_name PresetSummonAI
|
||||
|
||||
static func lockMaster(summon: SummonBase, myMaster: EntityBase, onTexture: bool = false) -> void:
|
||||
if onTexture:
|
||||
summon.position = myMaster.texture.global_position
|
||||
else:
|
||||
summon.position = myMaster.position
|
||||
@@ -0,0 +1 @@
|
||||
uid://ds0dbvm0r34nv
|
||||
@@ -0,0 +1,7 @@
|
||||
extends SummonBase
|
||||
class_name ShieldSummon
|
||||
|
||||
func register():
|
||||
fields[FieldStore.Entity.PENARATION_RESISTANCE] = 1.0
|
||||
func ai():
|
||||
PresetSummonAI.lockMaster(self, myMaster, true)
|
||||
@@ -0,0 +1 @@
|
||||
uid://fc3pppnguup
|
||||
@@ -0,0 +1,13 @@
|
||||
@tool
|
||||
extends Weapon
|
||||
class_name ShieldWeapon
|
||||
|
||||
func update(to: int, origin: Dictionary, _entity: EntityBase):
|
||||
origin["atk"] += 2 * to * soulLevel
|
||||
return origin
|
||||
func attack(entity: EntityBase):
|
||||
var summon = entity.summon(ComponentManager.getSummon("Shield"))
|
||||
if !summon: return true
|
||||
summon.fields[FieldStore.Entity.MAX_HEALTH] = readStore("atk")
|
||||
summon.health = summon.fields[FieldStore.Entity.MAX_HEALTH]
|
||||
return true
|
||||
@@ -0,0 +1 @@
|
||||
uid://dcacy48pcfci3
|
||||
Reference in New Issue
Block a user