完善宠物系统

This commit is contained in:
2025-07-26 22:41:15 +08:00
parent 02a7e29e52
commit 048600e95d
135 changed files with 10204 additions and 5859 deletions

368
Scene/NewPet/BulletBase.gd Normal file
View File

@@ -0,0 +1,368 @@
extends Area2D
class_name BulletBase
# 简化子弹系统 - 辅助攻击用
# 基础功能:移动、碰撞检测、伤害
signal bullet_hit(bullet: BulletBase, target: NewPetBase)
@onready var sprite: Sprite2D = $Sprite
@onready var collision_shape: CollisionShape2D = $CollisionShape2D
const bullet = {
"小蓝弹":{
"图片":"res://assets/子弹图片/01.png",
"函数":"create_blue_bullet"
},
"小红弹":{
"图片":"res://assets/子弹图片/02.png",
"函数":"create_red_bullet"
},
"小粉弹":{
"图片":"res://assets/子弹图片/03.png",
"函数":"create_pink_bullet"
},
"小紫弹":{
"图片":"res://assets/子弹图片/04.png",
"函数":"create_purple_bullet"
},
"长橙弹":{
"图片":"res://assets/子弹图片/21.png",
"函数":"create_long_orange_bullet"
},
"长紫弹":{
"图片":"res://assets/子弹图片/22.png",
"函数":"create_long_purple_bullet"
},
"长绿弹":{
"图片":"res://assets/子弹图片/25.png",
"函数":"create_long_green_bullet"
},
"黄色闪电":{
"图片":"res://assets/子弹图片/36.png",
"函数":"create_yellow_lightning_bullet"
},
"绿色闪电":{
"图片":"res://assets/子弹图片/35.png",
"函数":"create_green_lightning_bullet"
},
"红色闪电":{
"图片":"res://assets/子弹图片/33.png",
"函数":"create_red_lightning_bullet"
},
"紫色闪电":{
"图片":"res://assets/子弹图片/32.png",
"函数":"create_purple_lightning_bullet"
},
}
# 基础子弹属性
var direction: Vector2 = Vector2.RIGHT
var speed: float = 300.0
var damage: float = 25.0
var owner_pet: NewPetBase = null
var max_distance: float = 800.0
var traveled_distance: float = 0.0
var is_active: bool = true
# 生存时间
var lifetime: float = 3.0
var current_lifetime: float = 0.0
#==================基础函数=========================
func _ready():
# 连接碰撞信号
area_entered.connect(_on_area_entered)
# 设置碰撞层
collision_layer = 4 # 子弹层
collision_mask = 1 # 只检测宠物层
# 添加到子弹组
add_to_group("bullets")
func _physics_process(delta):
if not is_active:
return
# 更新生存时间
current_lifetime += delta
if current_lifetime >= lifetime:
call_deferred("destroy_bullet")
return
# 检查长紫弹分裂计时
if has_meta("bullet_type") and get_meta("bullet_type") == "长紫弹":
var current_split_time = get_meta("current_split_time", 0.0)
var split_timer = get_meta("split_timer", 2.0)
current_split_time += delta
set_meta("current_split_time", current_split_time)
if current_split_time >= split_timer:
# 时间到了,分裂并销毁
call_deferred("create_split_bullets", global_position)
call_deferred("destroy_bullet")
return
# 移动子弹
var movement = direction * speed * delta
position += movement
traveled_distance += movement.length()
# 检查最大距离
if traveled_distance >= max_distance:
call_deferred("destroy_bullet")
return
# 检查是否超出屏幕边界
var viewport_rect = get_viewport().get_visible_rect()
if not viewport_rect.has_point(global_position):
call_deferred("destroy_bullet")
#==================基础函数=========================
#=============================每个子弹单独效果============================
# 小蓝弹
func create_blue_bullet():
sprite.texture = load(bullet["小蓝弹"]["图片"])
speed = 250.0
damage = 20.0
lifetime = 2.5
sprite.modulate = Color(0.5, 0.8, 1.0, 1.0) # 蓝色调
# 小红弹
func create_red_bullet():
sprite.texture = load(bullet["小红弹"]["图片"])
speed = 300.0
damage = 25.0
lifetime = 3.0
sprite.modulate = Color(1.0, 0.5, 0.5, 1.0) # 红色调
# 小粉弹
func create_pink_bullet():
sprite.texture = load(bullet["小粉弹"]["图片"])
speed = 280.0
damage = 22.0
lifetime = 2.8
sprite.modulate = Color(1.0, 0.7, 0.9, 1.0) # 粉色调
# 小紫弹
func create_purple_bullet():
sprite.texture = load(bullet["小紫弹"]["图片"])
speed = 320.0
damage = 28.0
lifetime = 3.2
sprite.modulate = Color(0.8, 0.5, 1.0, 1.0) # 紫色调
# 长橙弹
func create_long_orange_bullet():
sprite.texture = load(bullet["长橙弹"]["图片"])
speed = 350.0
damage = 35.0
lifetime = 4.0
max_distance = 1000.0
sprite.modulate = Color(1.0, 0.7, 0.3, 1.0) # 橙色调
# 长紫弹
func create_long_purple_bullet():
sprite.texture = load(bullet["长紫弹"]["图片"])
speed = 330.0
damage = 32.0
lifetime = 3.8
max_distance = 950.0
sprite.modulate = Color(0.9, 0.4, 1.0, 1.0) # 深紫色调
# 标记为长紫弹2秒后自动分裂
set_meta("bullet_type", "长紫弹")
set_meta("split_timer", 2.0) # 2秒后分裂
set_meta("current_split_time", 0.0) # 当前计时
# 创建分裂子弹长紫弹2秒后的效果
func create_split_bullets(hit_position: Vector2):
"""在指定位置生成4个小弹向四周发射"""
var bullet_types = ["小蓝弹", "小红弹", "小粉弹", "小紫弹"]
var bullet_scene = preload("res://Scene/NewPet/BulletBase.tscn")
# 生成4个方向的子弹
for i in range(4):
# 计算方向角度每90度一个方向
var angle = i * PI / 2.0
var direction_vector = Vector2(cos(angle), sin(angle))
# 选择子弹类型每种类型1个
var bullet_type = bullet_types[i]
# 创建子弹实例
var new_bullet = bullet_scene.instantiate()
get_parent().add_child(new_bullet)
# 设置子弹位置
new_bullet.global_position = hit_position
# 设置子弹属性5个参数方向、速度、伤害、所有者、子弹类型
new_bullet.setup(direction_vector, 200.0, 15.0, owner_pet, bullet_type)
# 分裂子弹生成完成
# 长绿弹
func create_long_green_bullet():
sprite.texture = load(bullet["长绿弹"]["图片"])
speed = 310.0
damage = 30.0
lifetime = 3.5
max_distance = 900.0
sprite.modulate = Color(0.4, 1.0, 0.5, 1.0) # 绿色调
# 黄色闪电
func create_yellow_lightning_bullet():
sprite.texture = load(bullet["黄色闪电"]["图片"])
speed = 400.0
damage = 40.0
lifetime = 2.0
max_distance = 600.0
sprite.modulate = Color(1.0, 1.0, 0.3, 1.0) # 黄色闪电
# 绿色闪电
func create_green_lightning_bullet():
sprite.texture = load(bullet["绿色闪电"]["图片"])
speed = 380.0
damage = 38.0
lifetime = 2.2
max_distance = 650.0
sprite.modulate = Color(0.3, 1.0, 0.3, 1.0) # 绿色闪电
# 红色闪电
func create_red_lightning_bullet():
sprite.texture = load(bullet["红色闪电"]["图片"])
speed = 420.0
damage = 45.0
lifetime = 1.8
max_distance = 550.0
sprite.modulate = Color(1.0, 0.3, 0.3, 1.0) # 红色闪电
# 紫色闪电
func create_purple_lightning_bullet():
sprite.texture = load(bullet["紫色闪电"]["图片"])
speed = 450.0
damage = 50.0
lifetime = 1.5
max_distance = 500.0
sprite.modulate = Color(0.8, 0.3, 1.0, 1.0) # 紫色闪电
#=============================每个子弹单独效果============================
#=========================通用子弹函数==============================
# 通用子弹创建函数
func create_bullet_by_name(bullet_name: String):
"""根据子弹名称创建对应类型的子弹"""
if not bullet.has(bullet_name):
return
var bullet_data = bullet[bullet_name]
var function_name = bullet_data.get("函数", "")
if function_name != "":
call(function_name)
# 获取子弹图标
func get_bullet_icon(bullet_name: String) -> Texture2D:
if bullet.has(bullet_name) and bullet[bullet_name].has("图片"):
return load(bullet[bullet_name]["图片"])
else:
return null
# 获取所有子弹名称列表
func get_all_bullet_names() -> Array:
return bullet.keys()
# 创建击中特效
func create_hit_effect(pos: Vector2):
pass
#销毁子弹
func destroy_bullet():
"""销毁子弹"""
is_active = false
remove_from_group("bullets")
queue_free()
#初始化子弹
func setup(dir: Vector2, spd: float, dmg: float, owner: NewPetBase, bullet_type: String = ""):
"""初始化子弹"""
direction = dir.normalized()
owner_pet = owner
# 如果指定了子弹类型,使用对应的创建函数
if bullet_type != "" and bullet.has(bullet_type):
create_bullet_by_name(bullet_type)
else:
# 使用传入的参数作为默认值
speed = spd
damage = dmg
# 简单的视觉效果
sprite.modulate = Color.YELLOW
# 设置子弹旋转
rotation = direction.angle()
#碰撞检测
func _on_area_entered(area: Area2D):
"""碰撞检测"""
if not is_active:
return
# 检查是否是宠物
if not area is NewPetBase:
return
var pet_target = area as NewPetBase
# 检查是否是有效目标
if not is_valid_target(pet_target):
return
# 造成伤害并延迟销毁子弹(避免在物理查询期间修改状态)
hit_target(pet_target)
call_deferred("destroy_bullet")
#检查是否是有效攻击目标
func is_valid_target(target: NewPetBase) -> bool:
"""检查是否是有效攻击目标"""
# 检查owner_pet是否有效
if not is_instance_valid(owner_pet):
owner_pet = null
# 不能攻击自己的主人
if target == owner_pet:
return false
# 不能攻击同队伍
if owner_pet != null and target.pet_team == owner_pet.pet_team:
return false
# 不能攻击已死亡的宠物
if not target.is_alive:
return false
return true
#击中目标
func hit_target(target: NewPetBase):
"""击中目标"""
# 检查owner_pet是否有效防止已释放对象错误
if not is_instance_valid(owner_pet):
owner_pet = null
# 造成伤害
target.take_damage(damage, owner_pet)
# 发射信号
bullet_hit.emit(self, target)
# 创建击中特效
create_hit_effect(target.global_position)
#=========================通用子弹函数==============================

View File

@@ -0,0 +1 @@
uid://bt57qac8hmg1u

View File

@@ -0,0 +1,29 @@
[gd_scene load_steps=4 format=3 uid="uid://cqtv1dob3dm8b"]
[ext_resource type="Script" uid="uid://bt57qac8hmg1u" path="res://Scene/NewPet/BulletBase.gd" id="1_guena"]
[ext_resource type="Texture2D" uid="uid://by01joyt7e4qh" path="res://assets/子弹图片/01.png" id="2_2q4gn"]
[sub_resource type="CircleShape2D" id="CircleShape2D_1"]
radius = 8.0
[node name="BulletBase" type="Area2D"]
script = ExtResource("1_guena")
[node name="Sprite" type="Sprite2D" parent="."]
modulate = Color(1, 1, 0, 0.8)
scale = Vector2(0.5, 0.5)
texture = ExtResource("2_2q4gn")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_1")
[node name="Trail" type="Line2D" parent="."]
width = 2.0
default_color = Color(1, 1, 0, 0.5)
[node name="HitEffect" type="Node2D" parent="."]
[node name="LifeTimer" type="Timer" parent="."]
wait_time = 5.0
one_shot = true
autostart = true

1198
Scene/NewPet/NewPetBase.gd Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1 @@
uid://cn6a0803t1bmu

View File

@@ -0,0 +1,146 @@
[gd_scene load_steps=8 format=3 uid="uid://cfwj8rnm2j8s3"]
[ext_resource type="Script" uid="uid://cn6a0803t1bmu" path="res://Scene/NewPet/NewPetBase.gd" id="1_bfbjx"]
[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="2_gnd2w"]
[ext_resource type="Texture2D" uid="uid://dciakkwnchcga" path="res://assets/我的世界图片/武器工具/木剑.png" id="3_bfbjx"]
[sub_resource type="AtlasTexture" id="AtlasTexture_h4hw6"]
atlas = ExtResource("2_gnd2w")
region = Rect2(0, 0, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_51c25"]
atlas = ExtResource("2_gnd2w")
region = Rect2(24, 0, 24, 24)
[sub_resource type="SpriteFrames" id="SpriteFrames_wmdx5"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_h4hw6")
}],
"loop": true,
"name": &"idle",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_h4hw6")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_51c25")
}],
"loop": true,
"name": &"walk",
"speed": 8.0
}]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_h4hw6"]
size = Vector2(79, 92)
[node name="PetBase" type="Area2D"]
script = ExtResource("1_bfbjx")
[node name="PetImage" type="AnimatedSprite2D" parent="."]
scale = Vector2(4, 4)
sprite_frames = SubResource("SpriteFrames_wmdx5")
animation = &"walk"
autoplay = "walk"
[node name="LeftToolImage" type="Sprite2D" parent="PetImage"]
z_index = 5
position = Vector2(-10.5, 3)
texture = ExtResource("3_bfbjx")
flip_h = true
[node name="RightToolImage" type="Sprite2D" parent="PetImage"]
show_behind_parent = true
position = Vector2(-7.5, -6.25)
texture = ExtResource("3_bfbjx")
flip_h = true
[node name="VolumeCollision" type="CollisionShape2D" parent="."]
position = Vector2(0.5, 2)
shape = SubResource("RectangleShape2D_h4hw6")
[node name="PetInformVBox" type="VBoxContainer" parent="."]
offset_left = -72.0
offset_top = -261.0
offset_right = 430.0
offset_bottom = 453.0
scale = Vector2(0.3, 0.3)
alignment = 2
[node name="PetNameRichText" type="RichTextLabel" parent="PetInformVBox"]
layout_mode = 2
size_flags_vertical = 3
theme_override_font_sizes/normal_font_size = 40
bbcode_enabled = true
text = "萌芽小绿人"
horizontal_alignment = 1
vertical_alignment = 2
[node name="ArmorBar" type="ProgressBar" parent="PetInformVBox"]
modulate = Color(0.758192, 0.758192, 0.758192, 1)
custom_minimum_size = Vector2(0, 60)
layout_mode = 2
show_percentage = false
[node name="ArmorLabel" type="Label" parent="PetInformVBox/ArmorBar"]
layout_mode = 0
offset_right = 502.0
offset_bottom = 60.0
theme_override_font_sizes/font_size = 30
text = "盔甲值:100/100"
horizontal_alignment = 1
vertical_alignment = 1
[node name="ShieldBar" type="ProgressBar" parent="PetInformVBox"]
modulate = Color(0, 1, 1, 1)
custom_minimum_size = Vector2(0, 60)
layout_mode = 2
show_percentage = false
[node name="ShieldLabel" type="Label" parent="PetInformVBox/ShieldBar"]
layout_mode = 0
offset_right = 502.0
offset_bottom = 60.0
theme_override_font_sizes/font_size = 30
text = "护盾值:100/100"
horizontal_alignment = 1
vertical_alignment = 1
[node name="HealthBar" type="ProgressBar" parent="PetInformVBox"]
modulate = Color(0, 1, 0, 1)
custom_minimum_size = Vector2(0, 60)
layout_mode = 2
show_percentage = false
[node name="HealthLabel" type="Label" parent="PetInformVBox/HealthBar"]
layout_mode = 0
offset_right = 502.0
offset_bottom = 60.0
theme_override_font_sizes/font_size = 30
text = "生命值:100/100"
horizontal_alignment = 1
vertical_alignment = 1
[node name="StatusEffects" type="HBoxContainer" parent="."]
offset_left = -30.0
offset_top = -65.0
offset_right = 30.0
offset_bottom = -55.0
[node name="AttackTimer" type="Timer" parent="."]
[node name="MoveTimer" type="Timer" parent="."]
wait_time = 0.1
autostart = true
[node name="StatusTimer" type="Timer" parent="."]
autostart = true
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
[node name="HitEffect" type="Node2D" parent="."]
[node name="DeathEffect" type="Node2D" parent="."]

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1 @@
uid://bt06n5cxip4kr

View File

@@ -0,0 +1,318 @@
[gd_scene load_steps=3 format=3 uid="uid://diwbnwhnq026"]
[ext_resource type="Script" uid="uid://bt06n5cxip4kr" path="res://Scene/NewPet/PetBattlePanel.gd" id="1_0uw4q"]
[ext_resource type="Texture2D" uid="uid://dh0dsw3jr0gra" path="res://assets/宠物对战背景图片/背景2.webp" id="2_c80tv"]
[node name="PetBattlePanel" type="Panel"]
offset_right = 1400.0
offset_bottom = 720.0
script = ExtResource("1_0uw4q")
[node name="MapBackGround" type="TextureRect" parent="."]
layout_mode = 0
offset_right = 1557.0
offset_bottom = 867.0
scale = Vector2(0.9, 0.9)
texture = ExtResource("2_c80tv")
[node name="TeamB" type="Node2D" parent="."]
position = Vector2(1239, 421)
[node name="Pos1" type="Marker2D" parent="TeamB"]
position = Vector2(17, -166)
[node name="Pos2" type="Marker2D" parent="TeamB"]
position = Vector2(42, 160)
[node name="Pos3" type="Marker2D" parent="TeamB"]
position = Vector2(42, -38)
[node name="Pos4" type="Marker2D" parent="TeamB"]
position = Vector2(21, -315)
[node name="Pos5" type="Marker2D" parent="TeamB"]
position = Vector2(42, -102)
[node name="Pos6" type="Marker2D" parent="TeamB"]
position = Vector2(42, 96)
[node name="Pos7" type="Marker2D" parent="TeamB"]
position = Vector2(42, 32)
[node name="Pos8" type="Marker2D" parent="TeamB"]
position = Vector2(21, -251)
[node name="Pos9" type="Marker2D" parent="TeamB"]
position = Vector2(42, -230)
[node name="Pos10" type="Marker2D" parent="TeamB"]
position = Vector2(42, 224)
[node name="TeamA" type="Node2D" parent="."]
position = Vector2(138, 134)
[node name="Pos1" type="Marker2D" parent="TeamA"]
position = Vector2(-37, 408)
[node name="Pos2" type="Marker2D" parent="TeamA"]
position = Vector2(-41, 93)
[node name="Pos3" type="Marker2D" parent="TeamA"]
position = Vector2(-38, 313)
[node name="Pos4" type="Marker2D" parent="TeamA"]
position = Vector2(-38, 223)
[node name="Pos5" type="Marker2D" parent="TeamA"]
position = Vector2(-38, 133)
[node name="Pos6" type="Marker2D" parent="TeamA"]
position = Vector2(-38, 43)
[node name="Pos7" type="Marker2D" parent="TeamA"]
position = Vector2(-38, 358)
[node name="Pos8" type="Marker2D" parent="TeamA"]
position = Vector2(-38, 268)
[node name="Pos9" type="Marker2D" parent="TeamA"]
position = Vector2(-38, 178)
[node name="Pos10" type="Marker2D" parent="TeamA"]
position = Vector2(-38, 453)
[node name="PlayerSkillPanel" type="Panel" parent="."]
layout_mode = 0
offset_left = 1143.0
offset_right = 1400.0
offset_bottom = 720.0
[node name="Title" type="Label" parent="PlayerSkillPanel"]
self_modulate = Color(0, 1, 0, 1)
layout_mode = 0
offset_right = 257.0
offset_bottom = 40.0
theme_override_font_sizes/font_size = 25
text = "辅助功能"
horizontal_alignment = 1
vertical_alignment = 1
[node name="TeamASkills" type="VBoxContainer" parent="PlayerSkillPanel"]
layout_mode = 0
offset_top = 50.0
offset_right = 257.0
offset_bottom = 300.0
[node name="TeamAHeal" type="Button" parent="PlayerSkillPanel/TeamASkills"]
layout_mode = 2
theme_override_font_sizes/font_size = 18
text = "团队治疗"
[node name="TeamARage" type="Button" parent="PlayerSkillPanel/TeamASkills"]
layout_mode = 2
theme_override_font_sizes/font_size = 18
text = "团队狂暴"
[node name="TeamAShield" type="Button" parent="PlayerSkillPanel/TeamASkills"]
layout_mode = 2
theme_override_font_sizes/font_size = 18
text = "团队护盾"
[node name="test" type="Button" parent="PlayerSkillPanel/TeamASkills"]
layout_mode = 2
theme_override_font_sizes/font_size = 18
disabled = true
text = "测试"
[node name="test2" type="Button" parent="PlayerSkillPanel/TeamASkills"]
layout_mode = 2
theme_override_font_sizes/font_size = 18
disabled = true
text = "测试"
[node name="test3" type="Button" parent="PlayerSkillPanel/TeamASkills"]
layout_mode = 2
theme_override_font_sizes/font_size = 18
disabled = true
text = "测试"
[node name="test4" type="Button" parent="PlayerSkillPanel/TeamASkills"]
layout_mode = 2
theme_override_font_sizes/font_size = 18
disabled = true
text = "测试"
[node name="test5" type="Button" parent="PlayerSkillPanel/TeamASkills"]
layout_mode = 2
theme_override_font_sizes/font_size = 18
disabled = true
text = "测试"
[node name="test6" type="Button" parent="PlayerSkillPanel/TeamASkills"]
layout_mode = 2
theme_override_font_sizes/font_size = 18
disabled = true
text = "测试"
[node name="test7" type="Button" parent="PlayerSkillPanel/TeamASkills"]
layout_mode = 2
theme_override_font_sizes/font_size = 18
disabled = true
text = "测试"
[node name="test8" type="Button" parent="PlayerSkillPanel/TeamASkills"]
layout_mode = 2
theme_override_font_sizes/font_size = 18
disabled = true
text = "测试"
[node name="test9" type="Button" parent="PlayerSkillPanel/TeamASkills"]
layout_mode = 2
theme_override_font_sizes/font_size = 18
disabled = true
text = "测试"
[node name="test10" type="Button" parent="PlayerSkillPanel/TeamASkills"]
layout_mode = 2
theme_override_font_sizes/font_size = 18
disabled = true
text = "测试"
[node name="test11" type="Button" parent="PlayerSkillPanel/TeamASkills"]
layout_mode = 2
theme_override_font_sizes/font_size = 18
disabled = true
text = "测试"
[node name="BattleControls" type="VBoxContainer" parent="PlayerSkillPanel"]
layout_mode = 0
offset_top = 580.0
offset_right = 257.0
offset_bottom = 720.0
[node name="StartBattleButton" type="Button" parent="PlayerSkillPanel/BattleControls"]
visible = false
layout_mode = 2
theme_override_colors/font_color = Color(0, 1, 0, 1)
theme_override_font_sizes/font_size = 20
text = "开始战斗"
[node name="StopBattleButton" type="Button" parent="PlayerSkillPanel/BattleControls"]
layout_mode = 2
theme_override_colors/font_color = Color(1, 0, 0, 1)
theme_override_font_sizes/font_size = 20
text = "逃跑"
[node name="BattleEndPanel" type="Panel" parent="."]
visible = false
top_level = true
layout_mode = 0
offset_left = 294.0
offset_right = 1071.0
offset_bottom = 720.0
[node name="Title" type="Label" parent="BattleEndPanel"]
layout_mode = 0
offset_right = 777.0
offset_bottom = 104.0
theme_override_colors/font_color = Color(0.991435, 0.798103, 0.357309, 1)
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/shadow_offset_x = 5
theme_override_constants/shadow_offset_y = 5
theme_override_constants/outline_size = 20
theme_override_constants/shadow_outline_size = 20
theme_override_font_sizes/font_size = 60
text = "战斗结束"
horizontal_alignment = 1
vertical_alignment = 1
[node name="Contents" type="RichTextLabel" parent="BattleEndPanel"]
layout_mode = 0
offset_top = 104.0
offset_right = 777.0
offset_bottom = 567.0
theme_override_font_sizes/normal_font_size = 30
bbcode_enabled = true
text = "[宠物名字]获得300经验
增加200亲密度"
horizontal_alignment = 1
[node name="ReturnFarmButton" type="Button" parent="BattleEndPanel"]
layout_mode = 0
offset_left = 294.0
offset_top = 567.0
offset_right = 502.0
offset_bottom = 644.0
theme_override_font_sizes/font_size = 50
text = "返回农场"
[node name="Title" type="Label" parent="."]
layout_mode = 0
offset_right = 1400.0
offset_bottom = 55.0
theme_override_colors/font_color = Color(0.623819, 1, 0.593898, 1)
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/shadow_offset_x = 5
theme_override_constants/shadow_offset_y = 5
theme_override_constants/outline_size = 20
theme_override_constants/shadow_outline_size = 10
theme_override_font_sizes/font_size = 50
text = "宠物对战"
horizontal_alignment = 1
vertical_alignment = 1
[node name="Time" type="Label" parent="."]
layout_mode = 0
offset_left = 574.0
offset_top = 60.0
offset_right = 813.0
offset_bottom = 129.0
theme_override_colors/font_color = Color(0.623529, 1, 1, 1)
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/shadow_offset_x = 5
theme_override_constants/shadow_offset_y = 5
theme_override_constants/outline_size = 20
theme_override_constants/shadow_outline_size = 10
theme_override_font_sizes/font_size = 35
text = "[05:00]"
horizontal_alignment = 1
vertical_alignment = 1
[node name="PetBattleDetailsPanel" type="Panel" parent="."]
layout_mode = 0
offset_right = 257.0
offset_bottom = 720.0
[node name="Title" type="Label" parent="PetBattleDetailsPanel"]
layout_mode = 0
offset_right = 257.0
offset_bottom = 23.0
theme_override_font_sizes/font_size = 30
text = "战斗细节"
horizontal_alignment = 1
vertical_alignment = 1
[node name="BattleDetails" type="RichTextLabel" parent="PetBattleDetailsPanel"]
layout_mode = 0
offset_top = 42.0
offset_right = 257.0
offset_bottom = 720.0
bbcode_enabled = true
[node name="ConfirmDialog" type="ConfirmationDialog" parent="."]
title = "弹窗标题"
initial_position = 1
size = Vector2i(400, 300)
unresizable = true
ok_button_text = "确认"
dialog_text = "弹窗内容"
dialog_autowrap = true
cancel_button_text = "取消"
[connection signal="pressed" from="PlayerSkillPanel/TeamASkills/TeamAHeal" to="." method="_on_team_a_heal_pressed"]
[connection signal="pressed" from="PlayerSkillPanel/TeamASkills/TeamARage" to="." method="_on_team_a_rage_pressed"]
[connection signal="pressed" from="PlayerSkillPanel/TeamASkills/TeamAShield" to="." method="_on_team_a_shield_pressed"]
[connection signal="pressed" from="PlayerSkillPanel/BattleControls/StopBattleButton" to="." method="_on_stop_battle_button_pressed"]

396
Scene/NewPet/PetConfig.gd Normal file
View File

@@ -0,0 +1,396 @@
extends Node
class_name PetConfig
# 每一种宠物的配置数据 方便导出JSON数据放到MongoDB数据库上
# 攻击类型枚举(简化为仅近战)
enum AttackType {
MELEE # 近战攻击
}
enum ElementType {
NONE, METAL, WOOD, WATER, FIRE, EARTH, THUNDER
}
enum PetState {
IDLE, # 待机
MOVING, # 移动
ATTACKING, # 攻击中
SKILL_CASTING, # 释放技能
DEAD # 死亡
}
#==========================以下是导出数据可以被修改的=========================================
# 基本属性
var pet_name: String = "萌芽小绿" # 宠物名称
var pet_id: String = "0001" # 宠物唯一编号
var pet_type: String = "小绿" # 宠物种类
var pet_level: int = 1 # 宠物等级
var pet_experience: int = 0 # 宠物经验值
#性格 出生日期 爱好 个人介绍
var pet_temperament: String = "温顺" # 性格
var pet_birthday: String = "2023-01-01" # 出生日期
var pet_hobby: String = "喜欢吃pet" # 爱好
var pet_introduction: String = "我是一个小绿" # 个人介绍
# 生命与防御
var max_health: float = 200.0 # 最大生命值
var enable_health_regen: bool = true # 是否开启生命恢复
var health_regen: float = 1.0 # 每秒生命恢复大小
var enable_shield_regen: bool = true # 是否开启护盾恢复
var max_shield: float = 100.0 # 最大护盾值
var shield_regen: float = 1.0 # 每秒护盾恢复大小
var max_armor: float = 100.0 # 最大护甲值
# 攻击属性
var base_attack_damage: float = 25.0 # 基础攻击力
var crit_rate: float = 0.1 # 暴击几率0~1
var crit_damage: float = 1.5 # 暴击伤害倍率1.5 = 150%伤害)
var armor_penetration: float = 0.0 # 护甲穿透值(直接减少对方护甲值)
#======================以后有新技能在这里添加==============================
# 技能-多发射击
var enable_multi_projectile_skill: bool = false
var multi_projectile_delay: float = 2.0 # 多发射击延迟时间(秒)
# 技能-狂暴模式
var enable_berserker_skill: bool = false
var berserker_bonus: float = 1.5 # 狂暴伤害加成
var berserker_duration: float = 5.0 # 狂暴持续时间(秒)
#技能-自爆
var enable_self_destruct_skill: bool = false
var self_destruct_damage: float = 50.0 # 自爆伤害值
#技能-召唤小弟
var enable_summon_pet_skill: bool = false
var summon_count: int = 1 # 召唤小弟数量
var summon_scale: float = 0.1 # 召唤小弟属性缩放比例10%
#技能-死亡重生
var enable_death_respawn_skill: bool = false
var respawn_health_percentage: float = 0.3 # 重生时恢复的血量百分比30%
#======================以后有新技能在这里添加==============================
# 移动属性
var move_speed: float = 150.0 # 移动速度(像素/秒)
var dodge_rate: float = 0.05 # 闪避概率0~1
# 元素属性
var element_type: ElementType = ElementType.NONE # 元素类型(例如火、水、雷等)
var element_damage_bonus: float = 50.0 # 元素伤害加成(额外元素伤害)
# 武器系统
var left_weapon: String = "" # 左手武器名称
var right_weapon: String = "" # 右手武器名称
# 宠物配置字典 - 用于导出到MongoDB数据库
var pet_configs: Dictionary = {
"烈焰鸟": {
"pet_name": "树萌芽の烈焰鸟",
"can_purchase": true,
"cost": 1000,
"pet_image": "res://Scene/NewPet/PetType/flying_bird.tscn",
"pet_id": "0001",
"pet_type": "烈焰鸟",
"pet_level": 1,
"pet_experience": 500,
"pet_temperament": "勇猛",
"pet_birthday": "2023-03-15",
"pet_hobby": "喜欢战斗和烈火",
"pet_introduction": "我爱吃虫子",
"max_health": 300,
"enable_health_regen": true,
"health_regen": 2,
"enable_shield_regen": true,
"max_shield": 150,
"shield_regen": 1.5,
"max_armor": 120,
"base_attack_damage": 40,
"crit_rate": 0.15,
"crit_damage": 2,
"armor_penetration": 10,
"enable_multi_projectile_skill": true,
"multi_projectile_delay": 2,
"enable_berserker_skill": true,
"berserker_bonus": 1.8,
"berserker_duration": 6,
"enable_self_destruct_skill": false,
"enable_summon_pet_skill": false,
"enable_death_respawn_skill": true,
"respawn_health_percentage": 0.4,
"move_speed": 180,
"dodge_rate": 0.08,
"element_type": "FIRE",
"element_damage_bonus": 75,
"left_weapon": "钻石剑",
"right_weapon": "钻石剑"
},
"大蓝虫": {
"pet_name": "树萌芽の大蓝虫",
"can_purchase": true,
"cost": 1000,
"pet_image": "res://Scene/NewPet/PetType/big_beetle.tscn",
"pet_id": "0002",
"pet_type": "大蓝虫",
"pet_level": 8,
"pet_experience": 320,
"pet_temperament": "冷静",
"pet_birthday": "2023-06-20",
"pet_hobby": "喜欢和小甲壳虫玩",
"pet_introduction": "我是大蓝虫,不是大懒虫!",
"max_health": 180,
"enable_health_regen": true,
"health_regen": 1.2,
"enable_shield_regen": true,
"max_shield": 200,
"shield_regen": 2.5,
"max_armor": 80,
"base_attack_damage": 35,
"crit_rate": 0.12,
"crit_damage": 1.8,
"armor_penetration": 15,
"enable_multi_projectile_skill": true,
"multi_projectile_delay": 1.5,
"enable_berserker_skill": false,
"enable_self_destruct_skill": false,
"enable_summon_pet_skill": true,
"summon_count": 2,
"summon_scale": 0.15,
"enable_death_respawn_skill": false,
"move_speed": 120,
"dodge_rate": 0.12,
"element_type": "WATER",
"element_damage_bonus": 100,
"left_weapon": "钻石剑",
"right_weapon": "钻石剑"
},
"小蓝虫": {
"pet_name": "树萌芽の小蓝虫",
"can_purchase": true,
"cost": 1000,
"pet_image": "res://Scene/NewPet/PetType/small_beetle.tscn",
"pet_id": "0002",
"pet_type": "小蓝虫",
"pet_level": 1,
"pet_experience": 0,
"pet_temperament": "冷静",
"pet_birthday": "2023-06-20",
"pet_hobby": "喜欢和大蓝虫玩",
"pet_introduction": "我是小蓝虫,不是小懒虫!",
"max_health": 90,
"enable_health_regen": true,
"health_regen": 1.2,
"enable_shield_regen": true,
"max_shield": 200,
"shield_regen": 2.5,
"max_armor": 80,
"base_attack_damage": 35,
"crit_rate": 0.12,
"crit_damage": 1.8,
"armor_penetration": 15,
"enable_multi_projectile_skill": true,
"multi_projectile_delay": 1.5,
"enable_berserker_skill": false,
"enable_self_destruct_skill": false,
"enable_summon_pet_skill": true,
"summon_count": 2,
"summon_scale": 0.15,
"enable_death_respawn_skill": false,
"move_speed": 120,
"dodge_rate": 0.12,
"element_type": "WATER",
"element_damage_bonus": 100,
"left_weapon": "钻石剑",
"right_weapon": "钻石剑"
},
"小蓝": {
"pet_name": "树萌芽の小蓝",
"can_purchase": true,
"cost": 1000,
"pet_image": "res://Scene/NewPet/PetType/small_blue.tscn",
"pet_id": "0002",
"pet_type": "小蓝",
"pet_level": 1,
"pet_experience": 0,
"pet_temperament": "冷静",
"pet_birthday": "2023-06-20",
"pet_hobby": "喜欢和小黄一起玩",
"pet_introduction": "我是小黄!",
"max_health": 120,
"enable_health_regen": true,
"health_regen": 1.2,
"enable_shield_regen": true,
"max_shield": 200,
"shield_regen": 2.5,
"max_armor": 80,
"base_attack_damage": 35,
"crit_rate": 0.12,
"crit_damage": 1.8,
"armor_penetration": 15,
"enable_multi_projectile_skill": true,
"multi_projectile_delay": 1.5,
"enable_berserker_skill": false,
"enable_self_destruct_skill": false,
"enable_summon_pet_skill": true,
"summon_count": 2,
"summon_scale": 0.15,
"enable_death_respawn_skill": false,
"move_speed": 120,
"dodge_rate": 0.12,
"element_type": "WATER",
"element_damage_bonus": 100,
"left_weapon": "钻石剑",
"right_weapon": "钻石剑"
}
}
# 初始化函数
func _ready():
"""节点准备就绪时自动加载JSON配置"""
load_configs_from_json()
# 手动初始化配置的函数
func initialize_configs():
"""手动初始化宠物配置优先从JSON加载"""
if not load_configs_from_json():
print("JSON加载失败使用默认配置")
# 如果JSON加载失败保持使用代码中的默认配置
# 获取宠物配置的函数
func get_pet_config(pet_key: String) -> Dictionary:
"""根据宠物键值获取配置"""
if pet_configs.has(pet_key):
return pet_configs[pet_key]
else:
print("未找到宠物配置: ", pet_key, ",使用默认配置")
return get_default_config()
# 获取所有宠物配置键值的函数
func get_all_pet_keys() -> Array:
"""获取所有可用的宠物配置键值"""
return pet_configs.keys()
# 检查宠物配置是否存在的函数
func has_pet_config(pet_key: String) -> bool:
"""检查指定的宠物配置是否存在"""
return pet_configs.has(pet_key)
# 获取默认配置的函数
func get_default_config() -> Dictionary:
"""获取默认宠物配置"""
return {
"pet_name": pet_name,
"pet_id": pet_id,
"pet_type": pet_type,
"pet_level": pet_level,
"pet_experience": pet_experience,
"pet_temperament": pet_temperament,
"pet_birthday": pet_birthday,
"pet_hobby": pet_hobby,
"pet_introduction": pet_introduction,
"max_health": max_health,
"enable_health_regen": enable_health_regen,
"health_regen": health_regen,
"enable_shield_regen": enable_shield_regen,
"max_shield": max_shield,
"shield_regen": shield_regen,
"max_armor": max_armor,
"base_attack_damage": base_attack_damage,
"crit_rate": crit_rate,
"crit_damage": crit_damage,
"armor_penetration": armor_penetration,
"enable_multi_projectile_skill": enable_multi_projectile_skill,
"multi_projectile_delay": multi_projectile_delay,
"enable_berserker_skill": enable_berserker_skill,
"berserker_bonus": berserker_bonus,
"berserker_duration": berserker_duration,
"enable_self_destruct_skill": enable_self_destruct_skill,
"self_destruct_damage": self_destruct_damage,
"enable_summon_pet_skill": enable_summon_pet_skill,
"summon_count": summon_count,
"summon_scale": summon_scale,
"enable_death_respawn_skill": enable_death_respawn_skill,
"respawn_health_percentage": respawn_health_percentage,
"move_speed": move_speed,
"dodge_rate": dodge_rate,
"element_type": element_type,
"element_damage_bonus": element_damage_bonus,
"left_weapon": left_weapon,
"right_weapon": right_weapon
}
# 字符串转换为ElementType枚举的函数
func string_to_element_type(element_str: String) -> ElementType:
"""将字符串转换为ElementType枚举"""
match element_str.to_upper():
"NONE":#没有元素类型
return ElementType.NONE
"METAL":#金元素
return ElementType.METAL
"WOOD":#木元素
return ElementType.WOOD
"WATER":#水元素
return ElementType.WATER
"FIRE": #火元素
return ElementType.FIRE
"EARTH":#土元素
return ElementType.EARTH
"THUNDER":#雷元素
return ElementType.THUNDER
_:
return ElementType.NONE
# 从JSON文件加载宠物配置的函数
func load_configs_from_json(file_path: String = "res://Scene/NewPet/Pet_data.json") -> bool:
"""从JSON文件加载宠物配置"""
if not FileAccess.file_exists(file_path):
print("宠物配置文件不存在: ", file_path)
return false
var file = FileAccess.open(file_path, FileAccess.READ)
if file == null:
print("无法打开宠物配置文件: ", file_path)
return false
var json_string = file.get_as_text()
file.close()
var json = JSON.new()
var parse_result = json.parse(json_string)
if parse_result != OK:
print("JSON解析失败: ", json.error_string)
return false
var loaded_configs = json.data
if typeof(loaded_configs) != TYPE_DICTIONARY:
print("JSON格式错误期望字典类型")
return false
# 清空现有配置并加载新配置
pet_configs.clear()
# 遍历加载的配置
for pet_key in loaded_configs.keys():
var config = loaded_configs[pet_key]
if typeof(config) != TYPE_DICTIONARY:
print("跳过无效的宠物配置: ", pet_key)
continue
# 处理element_type字符串转换为枚举
if config.has("element_type") and typeof(config["element_type"]) == TYPE_STRING:
config["element_type"] = string_to_element_type(config["element_type"])
# 添加到配置字典
pet_configs[pet_key] = config
print("成功从JSON加载了 ", pet_configs.size(), " 个宠物配置")
return true
# 导出配置到JSON的函数
func export_configs_to_json() -> String:
"""将宠物配置导出为JSON字符串用于保存到MongoDB"""
return JSON.stringify(pet_configs)

View File

@@ -0,0 +1 @@
uid://l31ap5jcuyfl

View File

@@ -0,0 +1,68 @@
[gd_scene load_steps=8 format=3 uid="uid://ba85asiwug57i"]
[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="1_4f76q"]
[ext_resource type="Texture2D" uid="uid://dciakkwnchcga" path="res://assets/我的世界图片/武器工具/木剑.png" id="2_vbyii"]
[sub_resource type="AtlasTexture" id="AtlasTexture_op7i3"]
atlas = ExtResource("1_4f76q")
region = Rect2(72, 48, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_c36rm"]
atlas = ExtResource("1_4f76q")
region = Rect2(120, 48, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_mjdfm"]
atlas = ExtResource("1_4f76q")
region = Rect2(72, 48, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_q454c"]
atlas = ExtResource("1_4f76q")
region = Rect2(96, 48, 24, 24)
[sub_resource type="SpriteFrames" id="SpriteFrames_b73qu"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_op7i3")
}],
"loop": true,
"name": &"idle",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_c36rm")
}],
"loop": true,
"name": &"sleep",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_mjdfm")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_q454c")
}],
"loop": true,
"name": &"walk",
"speed": 5.0
}]
[node name="PetImage" type="AnimatedSprite2D"]
scale = Vector2(4, 4)
sprite_frames = SubResource("SpriteFrames_b73qu")
animation = &"walk"
autoplay = "walk"
[node name="LeftToolImage" type="Sprite2D" parent="."]
z_index = 5
position = Vector2(-10.5, 3)
texture = ExtResource("2_vbyii")
flip_h = true
[node name="RightToolImage" type="Sprite2D" parent="."]
show_behind_parent = true
position = Vector2(-7.5, -6.25)
texture = ExtResource("2_vbyii")
flip_h = true

View File

@@ -0,0 +1,64 @@
[gd_scene load_steps=8 format=3 uid="uid://bpkq40vvq3cxy"]
[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="1_lxn61"]
[ext_resource type="Texture2D" uid="uid://dciakkwnchcga" path="res://assets/我的世界图片/武器工具/木剑.png" id="2_wrr70"]
[sub_resource type="AtlasTexture" id="AtlasTexture_lgi35"]
atlas = ExtResource("1_lxn61")
region = Rect2(192, 48, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_wn6km"]
atlas = ExtResource("1_lxn61")
region = Rect2(144, 48, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_qmpjj"]
atlas = ExtResource("1_lxn61")
region = Rect2(168, 48, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_1mpkc"]
atlas = ExtResource("1_lxn61")
region = Rect2(192, 48, 24, 24)
[sub_resource type="SpriteFrames" id="SpriteFrames_b73qu"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_lgi35")
}],
"loop": true,
"name": &"idle",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_wn6km")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_qmpjj")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_1mpkc")
}],
"loop": true,
"name": &"walk",
"speed": 10.0
}]
[node name="PetImage" type="AnimatedSprite2D"]
scale = Vector2(4, 4)
sprite_frames = SubResource("SpriteFrames_b73qu")
animation = &"walk"
autoplay = "walk"
frame_progress = 0.111287
[node name="LeftToolImage" type="Sprite2D" parent="."]
z_index = 5
position = Vector2(-10.5, 3)
texture = ExtResource("2_wrr70")
flip_h = true
[node name="RightToolImage" type="Sprite2D" parent="."]
show_behind_parent = true
position = Vector2(-7.5, -6.25)
texture = ExtResource("2_wrr70")
flip_h = true

View File

@@ -0,0 +1,103 @@
[gd_scene load_steps=13 format=3 uid="uid://dvkix032ikul3"]
[ext_resource type="Texture2D" uid="uid://b75oytao5cgjo" path="res://assets/宠物图片/绿色史莱姆.png" id="1_m1ura"]
[ext_resource type="Texture2D" uid="uid://dciakkwnchcga" path="res://assets/我的世界图片/武器工具/木剑.png" id="2_58kah"]
[sub_resource type="AtlasTexture" id="AtlasTexture_ou315"]
atlas = ExtResource("1_m1ura")
region = Rect2(0, 24, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_saxlb"]
atlas = ExtResource("1_m1ura")
region = Rect2(72, 0, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_bxslx"]
atlas = ExtResource("1_m1ura")
region = Rect2(48, 0, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_dvhl1"]
atlas = ExtResource("1_m1ura")
region = Rect2(24, 0, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_0t1ns"]
atlas = ExtResource("1_m1ura")
region = Rect2(0, 0, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_sbjn0"]
atlas = ExtResource("1_m1ura")
region = Rect2(72, 24, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_qvnbx"]
atlas = ExtResource("1_m1ura")
region = Rect2(48, 24, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_n0kjo"]
atlas = ExtResource("1_m1ura")
region = Rect2(24, 24, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_obu0n"]
atlas = ExtResource("1_m1ura")
region = Rect2(0, 24, 24, 24)
[sub_resource type="SpriteFrames" id="SpriteFrames_yhcbw"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_ou315")
}],
"loop": true,
"name": &"idle",
"speed": 8.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_saxlb")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_bxslx")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_dvhl1")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_0t1ns")
}],
"loop": false,
"name": &"wake",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_sbjn0")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_qvnbx")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_n0kjo")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_obu0n")
}],
"loop": true,
"name": &"walk",
"speed": 8.0
}]
[node name="PetImage" type="AnimatedSprite2D"]
scale = Vector2(4, 4)
sprite_frames = SubResource("SpriteFrames_yhcbw")
animation = &"idle"
autoplay = "walk"
[node name="LeftToolImage" type="Sprite2D" parent="."]
z_index = 5
position = Vector2(-10.5, 3)
texture = ExtResource("2_58kah")
flip_h = true
[node name="RightToolImage" type="Sprite2D" parent="."]
show_behind_parent = true
position = Vector2(-7.5, -6.25)
texture = ExtResource("2_58kah")
flip_h = true

View File

@@ -0,0 +1,176 @@
[gd_scene load_steps=24 format=3 uid="uid://dwdoine3llw30"]
[ext_resource type="Texture2D" uid="uid://bal78ts2eq4yu" path="res://assets/宠物图片/护卫.png" id="1_4imwo"]
[ext_resource type="Texture2D" uid="uid://dciakkwnchcga" path="res://assets/我的世界图片/武器工具/木剑.png" id="2_ywvjf"]
[sub_resource type="AtlasTexture" id="AtlasTexture_rjt8u"]
atlas = ExtResource("1_4imwo")
region = Rect2(224, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_81r1q"]
atlas = ExtResource("1_4imwo")
region = Rect2(192, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_nliwy"]
atlas = ExtResource("1_4imwo")
region = Rect2(160, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_kbr5d"]
atlas = ExtResource("1_4imwo")
region = Rect2(128, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_yhrjc"]
atlas = ExtResource("1_4imwo")
region = Rect2(224, 64, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_2dbgw"]
atlas = ExtResource("1_4imwo")
region = Rect2(192, 64, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_h0n46"]
atlas = ExtResource("1_4imwo")
region = Rect2(160, 64, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_1tk7r"]
atlas = ExtResource("1_4imwo")
region = Rect2(128, 64, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_ogy1e"]
atlas = ExtResource("1_4imwo")
region = Rect2(96, 64, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_mygjj"]
atlas = ExtResource("1_4imwo")
region = Rect2(64, 64, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_rkj0j"]
atlas = ExtResource("1_4imwo")
region = Rect2(32, 64, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_j7anc"]
atlas = ExtResource("1_4imwo")
region = Rect2(0, 64, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_cxgnv"]
atlas = ExtResource("1_4imwo")
region = Rect2(224, 96, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_2itrd"]
atlas = ExtResource("1_4imwo")
region = Rect2(192, 96, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_c7ofb"]
atlas = ExtResource("1_4imwo")
region = Rect2(160, 96, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_aa4e4"]
atlas = ExtResource("1_4imwo")
region = Rect2(128, 96, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_jx5oo"]
atlas = ExtResource("1_4imwo")
region = Rect2(96, 96, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_umo24"]
atlas = ExtResource("1_4imwo")
region = Rect2(64, 96, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_853s8"]
atlas = ExtResource("1_4imwo")
region = Rect2(32, 96, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_6x5xm"]
atlas = ExtResource("1_4imwo")
region = Rect2(0, 96, 32, 32)
[sub_resource type="SpriteFrames" id="SpriteFrames_yhcbw"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_rjt8u")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_81r1q")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_nliwy")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_kbr5d")
}],
"loop": true,
"name": &"idle",
"speed": 8.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_yhrjc")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_2dbgw")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_h0n46")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_1tk7r")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ogy1e")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_mygjj")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_rkj0j")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_j7anc")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_cxgnv")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_2itrd")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_c7ofb")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_aa4e4")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_jx5oo")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_umo24")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_853s8")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_6x5xm")
}],
"loop": true,
"name": &"walk",
"speed": 8.0
}]
[node name="PetImage" type="AnimatedSprite2D"]
scale = Vector2(4, 4)
sprite_frames = SubResource("SpriteFrames_yhcbw")
animation = &"walk"
autoplay = "walk"
frame_progress = 0.272604
[node name="LeftToolImage" type="Sprite2D" parent="."]
z_index = 5
position = Vector2(-10.5, 3)
texture = ExtResource("2_ywvjf")
flip_h = true
[node name="RightToolImage" type="Sprite2D" parent="."]
show_behind_parent = true
position = Vector2(-7.5, -6.25)
texture = ExtResource("2_ywvjf")
flip_h = true

View File

@@ -0,0 +1,104 @@
[gd_scene load_steps=13 format=3 uid="uid://c8siga6au2vqh"]
[ext_resource type="Texture2D" uid="uid://cvpsjlje7q3to" path="res://assets/宠物图片/红色史莱姆.png" id="1_2d2gf"]
[ext_resource type="Texture2D" uid="uid://dciakkwnchcga" path="res://assets/我的世界图片/武器工具/木剑.png" id="2_ni2i3"]
[sub_resource type="AtlasTexture" id="AtlasTexture_s7ip1"]
atlas = ExtResource("1_2d2gf")
region = Rect2(0, 24, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_ff7pm"]
atlas = ExtResource("1_2d2gf")
region = Rect2(72, 0, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_53j2r"]
atlas = ExtResource("1_2d2gf")
region = Rect2(48, 0, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_0ij01"]
atlas = ExtResource("1_2d2gf")
region = Rect2(24, 0, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_20513"]
atlas = ExtResource("1_2d2gf")
region = Rect2(0, 0, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_3f8fr"]
atlas = ExtResource("1_2d2gf")
region = Rect2(72, 24, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_kbexh"]
atlas = ExtResource("1_2d2gf")
region = Rect2(48, 24, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_njkpw"]
atlas = ExtResource("1_2d2gf")
region = Rect2(24, 24, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_xbspe"]
atlas = ExtResource("1_2d2gf")
region = Rect2(0, 24, 24, 24)
[sub_resource type="SpriteFrames" id="SpriteFrames_yhcbw"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_s7ip1")
}],
"loop": true,
"name": &"idle",
"speed": 8.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_ff7pm")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_53j2r")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_0ij01")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_20513")
}],
"loop": false,
"name": &"wake",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_3f8fr")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_kbexh")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_njkpw")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_xbspe")
}],
"loop": true,
"name": &"walk",
"speed": 8.0
}]
[node name="PetImage" type="AnimatedSprite2D"]
scale = Vector2(4, 4)
sprite_frames = SubResource("SpriteFrames_yhcbw")
animation = &"walk"
autoplay = "walk"
frame_progress = 0.528863
[node name="LeftToolImage" type="Sprite2D" parent="."]
z_index = 5
position = Vector2(-10.5, 3)
texture = ExtResource("2_ni2i3")
flip_h = true
[node name="RightToolImage" type="Sprite2D" parent="."]
show_behind_parent = true
position = Vector2(-7.5, -6.25)
texture = ExtResource("2_ni2i3")
flip_h = true

View File

@@ -0,0 +1,64 @@
[gd_scene load_steps=7 format=3 uid="uid://bk5di5uq6bo04"]
[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="1_rph6q"]
[ext_resource type="Texture2D" uid="uid://dciakkwnchcga" path="res://assets/我的世界图片/武器工具/木剑.png" id="2_bks4n"]
[sub_resource type="AtlasTexture" id="AtlasTexture_nswws"]
atlas = ExtResource("1_rph6q")
region = Rect2(0, 48, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_mjdfm"]
atlas = ExtResource("1_rph6q")
region = Rect2(48, 48, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_1eo38"]
atlas = ExtResource("1_rph6q")
region = Rect2(24, 48, 24, 24)
[sub_resource type="SpriteFrames" id="SpriteFrames_b73qu"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_nswws")
}],
"loop": true,
"name": &"idle",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_mjdfm")
}],
"loop": true,
"name": &"sleep",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_nswws")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_1eo38")
}],
"loop": true,
"name": &"walk",
"speed": 5.0
}]
[node name="PetImage" type="AnimatedSprite2D"]
scale = Vector2(4, 4)
sprite_frames = SubResource("SpriteFrames_b73qu")
animation = &"walk"
autoplay = "walk"
[node name="LeftToolImage" type="Sprite2D" parent="."]
z_index = 5
position = Vector2(-10.5, 3)
texture = ExtResource("2_bks4n")
flip_h = true
[node name="RightToolImage" type="Sprite2D" parent="."]
show_behind_parent = true
position = Vector2(-7.5, -6.25)
texture = ExtResource("2_bks4n")
flip_h = true

View File

@@ -0,0 +1,52 @@
[gd_scene load_steps=6 format=3 uid="uid://d1sj6wl3mfpo3"]
[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="1_6fty5"]
[ext_resource type="Texture2D" uid="uid://dciakkwnchcga" path="res://assets/我的世界图片/武器工具/木剑.png" id="2_4lqxb"]
[sub_resource type="AtlasTexture" id="AtlasTexture_stamd"]
atlas = ExtResource("1_6fty5")
region = Rect2(48, 0, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_v0b4v"]
atlas = ExtResource("1_6fty5")
region = Rect2(72, 0, 24, 24)
[sub_resource type="SpriteFrames" id="SpriteFrames_b2ss3"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_stamd")
}],
"loop": true,
"name": &"idle",
"speed": 8.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_stamd")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_v0b4v")
}],
"loop": true,
"name": &"walk",
"speed": 8.0
}]
[node name="PetImage" type="AnimatedSprite2D"]
scale = Vector2(4, 4)
sprite_frames = SubResource("SpriteFrames_b2ss3")
animation = &"walk"
autoplay = "walk"
[node name="LeftToolImage" type="Sprite2D" parent="."]
z_index = 5
position = Vector2(-10.5, 3)
texture = ExtResource("2_4lqxb")
flip_h = true
[node name="RightToolImage" type="Sprite2D" parent="."]
show_behind_parent = true
position = Vector2(-7.5, -6.25)
texture = ExtResource("2_4lqxb")
flip_h = true

View File

@@ -0,0 +1,64 @@
[gd_scene load_steps=7 format=3 uid="uid://dkvo63yforem7"]
[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="1_x37sh"]
[ext_resource type="Texture2D" uid="uid://dciakkwnchcga" path="res://assets/我的世界图片/武器工具/木剑.png" id="2_w6fwq"]
[sub_resource type="AtlasTexture" id="AtlasTexture_j2fq3"]
atlas = ExtResource("1_x37sh")
region = Rect2(144, 24, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_6q1oc"]
atlas = ExtResource("1_x37sh")
region = Rect2(192, 24, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_xvdwk"]
atlas = ExtResource("1_x37sh")
region = Rect2(168, 24, 24, 24)
[sub_resource type="SpriteFrames" id="SpriteFrames_6q1oc"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_j2fq3")
}],
"loop": true,
"name": &"idle",
"speed": 8.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_6q1oc")
}],
"loop": true,
"name": &"sleep",
"speed": 8.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_j2fq3")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_xvdwk")
}],
"loop": true,
"name": &"walk",
"speed": 8.0
}]
[node name="PetImage" type="AnimatedSprite2D"]
scale = Vector2(4, 4)
sprite_frames = SubResource("SpriteFrames_6q1oc")
animation = &"walk"
autoplay = "walk"
[node name="LeftToolImage" type="Sprite2D" parent="."]
z_index = 5
position = Vector2(-10.5, 3)
texture = ExtResource("2_w6fwq")
flip_h = true
[node name="RightToolImage" type="Sprite2D" parent="."]
show_behind_parent = true
position = Vector2(-7.5, -6.25)
texture = ExtResource("2_w6fwq")
flip_h = true

View File

@@ -0,0 +1,56 @@
[gd_scene load_steps=7 format=3 uid="uid://bpsoc04xlvhqa"]
[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="1_i7yg5"]
[ext_resource type="Texture2D" uid="uid://dciakkwnchcga" path="res://assets/我的世界图片/武器工具/木剑.png" id="2_wo7be"]
[sub_resource type="AtlasTexture" id="AtlasTexture_5gxwu"]
atlas = ExtResource("1_i7yg5")
region = Rect2(0, 0, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_pxsqn"]
atlas = ExtResource("1_i7yg5")
region = Rect2(0, 0, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_xxlll"]
atlas = ExtResource("1_i7yg5")
region = Rect2(24, 0, 24, 24)
[sub_resource type="SpriteFrames" id="SpriteFrames_k25pl"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_5gxwu")
}],
"loop": true,
"name": &"idle",
"speed": 8.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_pxsqn")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_xxlll")
}],
"loop": true,
"name": &"walk",
"speed": 8.0
}]
[node name="PetImage" type="AnimatedSprite2D"]
scale = Vector2(4, 4)
sprite_frames = SubResource("SpriteFrames_k25pl")
animation = &"idle"
autoplay = "walk"
[node name="LeftToolImage" type="Sprite2D" parent="."]
z_index = 5
position = Vector2(-10.5, 3)
texture = ExtResource("2_wo7be")
flip_h = true
[node name="RightToolImage" type="Sprite2D" parent="."]
show_behind_parent = true
position = Vector2(-7.5, -6.25)
texture = ExtResource("2_wo7be")
flip_h = true

View File

@@ -0,0 +1,52 @@
[gd_scene load_steps=6 format=3 uid="uid://bk7wkksxa7150"]
[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="1_4x5tv"]
[ext_resource type="Texture2D" uid="uid://dciakkwnchcga" path="res://assets/我的世界图片/武器工具/木剑.png" id="2_iom1h"]
[sub_resource type="AtlasTexture" id="AtlasTexture_tdtxh"]
atlas = ExtResource("1_4x5tv")
region = Rect2(0, 24, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_5rxf3"]
atlas = ExtResource("1_4x5tv")
region = Rect2(24, 24, 24, 24)
[sub_resource type="SpriteFrames" id="SpriteFrames_ujsmd"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_tdtxh")
}],
"loop": true,
"name": &"idle",
"speed": 8.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_tdtxh")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_5rxf3")
}],
"loop": true,
"name": &"walk",
"speed": 8.0
}]
[node name="PetImage" type="AnimatedSprite2D"]
scale = Vector2(4, 4)
sprite_frames = SubResource("SpriteFrames_ujsmd")
animation = &"walk"
autoplay = "walk"
[node name="LeftToolImage" type="Sprite2D" parent="."]
z_index = 5
position = Vector2(-10.5, 3)
texture = ExtResource("2_iom1h")
flip_h = true
[node name="RightToolImage" type="Sprite2D" parent="."]
show_behind_parent = true
position = Vector2(-7.5, -6.25)
texture = ExtResource("2_iom1h")
flip_h = true

View File

@@ -0,0 +1,56 @@
[gd_scene load_steps=7 format=3 uid="uid://cxj61dijvapdt"]
[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="1_wkxhn"]
[ext_resource type="Texture2D" uid="uid://dciakkwnchcga" path="res://assets/我的世界图片/武器工具/木剑.png" id="2_xic1v"]
[sub_resource type="AtlasTexture" id="AtlasTexture_cxnqb"]
atlas = ExtResource("1_wkxhn")
region = Rect2(96, 0, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_auciw"]
atlas = ExtResource("1_wkxhn")
region = Rect2(96, 0, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_nrp4g"]
atlas = ExtResource("1_wkxhn")
region = Rect2(120, 0, 24, 24)
[sub_resource type="SpriteFrames" id="SpriteFrames_b2ss3"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_cxnqb")
}],
"loop": true,
"name": &"idle",
"speed": 8.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_auciw")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_nrp4g")
}],
"loop": true,
"name": &"walk",
"speed": 8.0
}]
[node name="PetImage" type="AnimatedSprite2D"]
scale = Vector2(4, 4)
sprite_frames = SubResource("SpriteFrames_b2ss3")
animation = &"idle"
autoplay = "walk"
[node name="LeftToolImage" type="Sprite2D" parent="."]
z_index = 5
position = Vector2(-10.5, 3)
texture = ExtResource("2_xic1v")
flip_h = true
[node name="RightToolImage" type="Sprite2D" parent="."]
show_behind_parent = true
position = Vector2(-7.5, -6.25)
texture = ExtResource("2_xic1v")
flip_h = true

View File

@@ -0,0 +1,52 @@
[gd_scene load_steps=6 format=3 uid="uid://is5klrhiktg4"]
[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="1_qrx6w"]
[ext_resource type="Texture2D" uid="uid://dciakkwnchcga" path="res://assets/我的世界图片/武器工具/木剑.png" id="2_dkex0"]
[sub_resource type="AtlasTexture" id="AtlasTexture_trhvc"]
atlas = ExtResource("1_qrx6w")
region = Rect2(144, 0, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_k5jn7"]
atlas = ExtResource("1_qrx6w")
region = Rect2(168, 0, 24, 24)
[sub_resource type="SpriteFrames" id="SpriteFrames_yhcbw"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_trhvc")
}],
"loop": true,
"name": &"idle",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_trhvc")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_k5jn7")
}],
"loop": true,
"name": &"walk",
"speed": 8.0
}]
[node name="PetImage" type="AnimatedSprite2D"]
scale = Vector2(4, 4)
sprite_frames = SubResource("SpriteFrames_yhcbw")
animation = &"walk"
autoplay = "walk"
[node name="LeftToolImage" type="Sprite2D" parent="."]
z_index = 5
position = Vector2(-10.5, 3)
texture = ExtResource("2_dkex0")
flip_h = true
[node name="RightToolImage" type="Sprite2D" parent="."]
show_behind_parent = true
position = Vector2(-7.5, -6.25)
texture = ExtResource("2_dkex0")
flip_h = true

81
Scene/NewPet/Pet_bag.json Normal file
View File

@@ -0,0 +1,81 @@
{
"宠物仓库":{
"烈焰鸟": {
"pet_name": "树萌芽の烈焰鸟",
"pet_image":"res://Scene/NewPet/PetType/flying_bird.tscn",
"pet_id": "wea1212w12",
"pet_type": "烈焰鸟",
"pet_level": 1,
"pet_experience": 500,
"pet_temperament": "勇猛",
"pet_birthday": "2025-07-25",
"pet_hobby": "喜欢战斗和烈火",
"pet_introduction": "我爱吃虫子",
"max_health": 300.0,
"enable_health_regen": true,
"health_regen": 2.0,
"enable_shield_regen": true,
"max_shield": 150.0,
"shield_regen": 1.5,
"max_armor": 120.0,
"base_attack_damage": 40.0,
"crit_rate": 0.15,
"crit_damage": 2.0,
"armor_penetration": 10.0,
"enable_multi_projectile_skill": true,
"multi_projectile_delay": 2.0,
"enable_berserker_skill": true,
"berserker_bonus": 1.8,
"berserker_duration": 6.0,
"enable_self_destruct_skill": false,
"enable_summon_pet_skill": false,
"enable_death_respawn_skill": true,
"respawn_health_percentage": 0.4,
"move_speed": 180.0,
"dodge_rate": 0.08,
"element_type": "FIRE",
"element_damage_bonus": 75.0,
"left_weapon": "钻石剑",
"right_weapon": "钻石剑"
},
"大蓝虫": {
"pet_name": "树萌芽の大蓝虫",
"pet_image":"res://Scene/NewPet/PetType/big_beetle.tscn",
"pet_id": "dlc123123",
"pet_type": "大甲壳虫",
"pet_level": 8,
"pet_experience": 320,
"pet_temperament": "冷静",
"pet_birthday": "2023-06-20",
"pet_hobby": "喜欢和小甲壳虫玩",
"pet_introduction": "我是大蓝虫,不是大懒虫!",
"max_health": 180.0,
"enable_health_regen": true,
"health_regen": 1.2,
"enable_shield_regen": true,
"max_shield": 200.0,
"shield_regen": 2.5,
"max_armor": 80.0,
"base_attack_damage": 35.0,
"crit_rate": 0.12,
"crit_damage": 1.8,
"armor_penetration": 15.0,
"enable_multi_projectile_skill": true,
"multi_projectile_delay": 1.5,
"enable_berserker_skill": false,
"enable_self_destruct_skill": false,
"enable_summon_pet_skill": true,
"summon_count": 2,
"summon_scale": 0.15,
"enable_death_respawn_skill": false,
"move_speed": 120.0,
"dodge_rate": 0.12,
"element_type": "WATER",
"element_damage_bonus": 100.0,
"left_weapon": "钻石剑",
"right_weapon": "钻石剑"
}
},
"巡逻宠物":["wea1212w12"],
"出战宠物":["dlc123123"]
}

165
Scene/NewPet/Pet_data.json Normal file
View File

@@ -0,0 +1,165 @@
{
"_id": {
"$oid": "687cf59b8e77ba00a7414bab"
},
"updated_at": {
"$date": "2025-07-20T22:13:38.521Z"
},
"烈焰鸟": {
"pet_name": "树萌芽の烈焰鸟",
"can_purchase": true,
"cost": 1000,
"pet_image": "res://Scene/NewPet/PetType/flying_bird.tscn",
"pet_id": "0001",
"pet_type": "烈焰鸟",
"pet_level": 1,
"pet_experience": 500,
"pet_temperament": "勇猛",
"pet_birthday": "2023-03-15",
"pet_hobby": "喜欢战斗和烈火",
"pet_introduction": "我爱吃虫子",
"max_health": 300,
"enable_health_regen": true,
"health_regen": 2,
"enable_shield_regen": true,
"max_shield": 150,
"shield_regen": 1.5,
"max_armor": 120,
"base_attack_damage": 40,
"crit_rate": 0.15,
"crit_damage": 2,
"armor_penetration": 10,
"enable_multi_projectile_skill": true,
"multi_projectile_delay": 2,
"enable_berserker_skill": true,
"berserker_bonus": 1.8,
"berserker_duration": 6,
"enable_self_destruct_skill": false,
"enable_summon_pet_skill": false,
"enable_death_respawn_skill": true,
"respawn_health_percentage": 0.4,
"move_speed": 180,
"dodge_rate": 0.08,
"element_type": "FIRE",
"element_damage_bonus": 75,
"left_weapon": "钻石剑",
"right_weapon": "钻石剑"
},
"大蓝虫": {
"pet_name": "树萌芽の大蓝虫",
"can_purchase": true,
"cost": 1000,
"pet_image": "res://Scene/NewPet/PetType/big_beetle.tscn",
"pet_id": "0002",
"pet_type": "大蓝虫",
"pet_level": 8,
"pet_experience": 320,
"pet_temperament": "冷静",
"pet_birthday": "2023-06-20",
"pet_hobby": "喜欢和小甲壳虫玩",
"pet_introduction": "我是大蓝虫,不是大懒虫!",
"max_health": 180,
"enable_health_regen": true,
"health_regen": 1.2,
"enable_shield_regen": true,
"max_shield": 200,
"shield_regen": 2.5,
"max_armor": 80,
"base_attack_damage": 35,
"crit_rate": 0.12,
"crit_damage": 1.8,
"armor_penetration": 15,
"enable_multi_projectile_skill": true,
"multi_projectile_delay": 1.5,
"enable_berserker_skill": false,
"enable_self_destruct_skill": false,
"enable_summon_pet_skill": true,
"summon_count": 2,
"summon_scale": 0.15,
"enable_death_respawn_skill": false,
"move_speed": 120,
"dodge_rate": 0.12,
"element_type": "WATER",
"element_damage_bonus": 100,
"left_weapon": "钻石剑",
"right_weapon": "钻石剑"
},
"小蓝虫": {
"pet_name": "树萌芽の小蓝虫",
"can_purchase": true,
"cost": 1000,
"pet_image": "res://Scene/NewPet/PetType/small_beetle.tscn",
"pet_id": "0002",
"pet_type": "小蓝虫",
"pet_level": 1,
"pet_experience": 0,
"pet_temperament": "冷静",
"pet_birthday": "2023-06-20",
"pet_hobby": "喜欢和大蓝虫玩",
"pet_introduction": "我是小蓝虫,不是小懒虫!",
"max_health": 90,
"enable_health_regen": true,
"health_regen": 1.2,
"enable_shield_regen": true,
"max_shield": 200,
"shield_regen": 2.5,
"max_armor": 80,
"base_attack_damage": 35,
"crit_rate": 0.12,
"crit_damage": 1.8,
"armor_penetration": 15,
"enable_multi_projectile_skill": true,
"multi_projectile_delay": 1.5,
"enable_berserker_skill": false,
"enable_self_destruct_skill": false,
"enable_summon_pet_skill": true,
"summon_count": 2,
"summon_scale": 0.15,
"enable_death_respawn_skill": false,
"move_speed": 120,
"dodge_rate": 0.12,
"element_type": "WATER",
"element_damage_bonus": 100,
"left_weapon": "钻石剑",
"right_weapon": "钻石剑"
},
"小蓝": {
"pet_name": "树萌芽の小蓝",
"can_purchase": true,
"cost": 1000,
"pet_image": "res://Scene/NewPet/PetType/small_blue.tscn",
"pet_id": "0002",
"pet_type": "小蓝",
"pet_level": 1,
"pet_experience": 0,
"pet_temperament": "冷静",
"pet_birthday": "2023-06-20",
"pet_hobby": "喜欢和小黄一起玩",
"pet_introduction": "我是小黄!",
"max_health": 120,
"enable_health_regen": true,
"health_regen": 1.2,
"enable_shield_regen": true,
"max_shield": 200,
"shield_regen": 2.5,
"max_armor": 80,
"base_attack_damage": 35,
"crit_rate": 0.12,
"crit_damage": 1.8,
"armor_penetration": 15,
"enable_multi_projectile_skill": true,
"multi_projectile_delay": 1.5,
"enable_berserker_skill": false,
"enable_self_destruct_skill": false,
"enable_summon_pet_skill": true,
"summon_count": 2,
"summon_scale": 0.15,
"enable_death_respawn_skill": false,
"move_speed": 120,
"dodge_rate": 0.12,
"element_type": "WATER",
"element_damage_bonus": 100,
"left_weapon": "钻石剑",
"right_weapon": "钻石剑"
}
}

128
Scene/NewPet/WeaponBase.gd Normal file
View File

@@ -0,0 +1,128 @@
extends Node
class_name WeaponBase
#武器系统
var weapon_data = {
"钻石剑": {
"icon": 'res://assets/我的世界图片/武器工具/钻石剑.png',
"function": "apply_diamond_sword_effect"
},
"铁剑": {
"icon": 'res://assets/我的世界图片/武器工具/铁剑.png',
"function": "apply_iron_sword_effect"
},
"钻石斧": {
"icon": 'res://assets/我的世界图片/武器工具/钻石斧.png',
"function": "apply_diamond_axe_effect"
},
"铁镐": {
"icon": 'res://assets/我的世界图片/武器工具/铁镐.png',
"function": "apply_iron_pickaxe_effect"
}
}
# 武器效果函数 - 每种武器单独一个函数
#================钻石剑效果========================
# 钻石剑效果
func apply_diamond_sword_effect(pet):
pet.base_attack_damage += 15.0
pet.crit_rate += 0.1
pet.attack_speed += 0.2
# 钻石剑效果已应用
# 移除钻石剑效果
func remove_diamond_sword_effect(pet):
pet.base_attack_damage -= 15.0
pet.crit_rate -= 0.1
pet.attack_speed -= 0.2
# 钻石剑效果已移除
#================钻石剑效果========================
#================铁剑效果========================
# 铁剑效果
func apply_iron_sword_effect(pet):
pet.base_attack_damage += 10.0
pet.crit_rate += 0.05
pet.attack_speed += 0.1
# 铁剑效果已应用
# 移除铁剑效果
func remove_iron_sword_effect(pet):
pet.base_attack_damage -= 10.0
pet.crit_rate -= 0.05
pet.attack_speed -= 0.1
# 铁剑效果已移除
#================铁剑效果========================
#================钻石斧效果========================
# 钻石斧效果
func apply_diamond_axe_effect(pet):
pet.base_attack_damage += 20.0
pet.armor_penetration += 0.2
pet.knockback_force += 100.0
# 钻石斧效果已应用
# 移除钻石斧效果
func remove_diamond_axe_effect(pet):
pet.base_attack_damage -= 20.0
pet.armor_penetration -= 0.2
pet.knockback_force -= 100.0
# 钻石斧效果已移除
#================钻石斧效果========================
#================铁镐效果========================
# 铁镐效果
func apply_iron_pickaxe_effect(pet):
pet.base_attack_damage += 8.0
pet.armor_penetration += 0.3
pet.attack_range += 20.0
# 铁镐效果已应用
# 移除铁镐效果
func remove_iron_pickaxe_effect(pet):
pet.base_attack_damage -= 8.0
pet.armor_penetration -= 0.3
pet.attack_range -= 20.0
# 铁镐效果已移除
#================铁镐效果========================
#======================武器系统通用函数==========================
# 应用武器效果的主函数
func apply_weapon_effect(pet, weapon_name: String):
if not weapon_data.has(weapon_name):
return
var weapon = weapon_data[weapon_name]
var function_name = weapon.get("function", "")
if function_name != "":
call(function_name, pet)
# 移除武器效果的函数
func remove_weapon_effect(pet, weapon_name: String):
if not weapon_data.has(weapon_name):
return
var weapon = weapon_data[weapon_name]
var function_name = weapon.get("function", "")
if function_name != "":
# 将apply替换为remove来调用移除函数
var remove_function_name = function_name.replace("apply_", "remove_")
call(remove_function_name, pet)
# 获取武器图标路径
func get_weapon_icon(weapon_name: String) -> String:
if weapon_data.has(weapon_name):
return weapon_data[weapon_name].get("icon", "")
return ""
# 获取所有武器名称列表
func get_all_weapon_names() -> Array:
return weapon_data.keys()
#======================武器系统通用函数==========================

View File

@@ -0,0 +1 @@
uid://bpa6hp1mm6sj1