怪物设计迭代 monster03 skill01

master
chendian 1 year ago
parent 8529c378f7
commit b63fa26966

@ -11,12 +11,12 @@ damage_type = 1
is_floating = true
is_hit_down = false
is_rebound = false
is_stop_self = true
is_stop_self = false
is_throw_check = false
is_throw_end = false
hit_back_speed = 8.0
hit_back_speed = 10.0
hit_up_speed = 2.0
hit_back_duration = 0.1
hit_up_duration = 0.05
pause_time = 0.2
pause_time = 0.3
is_force_pause = true

@ -12,6 +12,8 @@ is_floating = true
is_hit_down = false
is_rebound = false
is_stop_self = true
is_throw_check = false
is_throw_end = false
hit_back_speed = 8.0
hit_up_speed = 4.0
hit_back_duration = 0.05

@ -9,3 +9,4 @@ height = 0.25
script = ExtResource("1_gwkwy")
shape = SubResource("CylinderShape3D_pmh6g")
offset = Vector2(0, 0.5)
is_throw = false

@ -0,0 +1,22 @@
[gd_resource type="Resource" script_class="CharacterCfg" load_steps=7 format=3 uid="uid://c4v710n3f6pb3"]
[ext_resource type="Resource" uid="uid://dx54fjf5t0uu8" path="res://config/character_move/normal.tres" id="1_ol2gy"]
[ext_resource type="Resource" uid="uid://dpajmgrlaytah" path="res://config/character_mp/normal.tres" id="2_kkpsf"]
[ext_resource type="Script" path="res://script/config/character_cfg.gd" id="3_0gem5"]
[ext_resource type="Resource" uid="uid://h1curvk64vm3" path="res://config/character_shield/none.tres" id="4_tuve4"]
[ext_resource type="SpriteFrames" uid="uid://bvcrc6bbufwqv" path="res://resource/animation/character/monster03_move.aseprite" id="5_4dnud"]
[ext_resource type="Resource" uid="uid://cac6mk6g078vn" path="res://config/character_stun/normal.tres" id="6_ar00t"]
[resource]
script = ExtResource("3_0gem5")
name = "monster02"
type = 1
sprite_frames = ExtResource("5_4dnud")
sprite_harf_height = 26
sprite_width = 16
move = ExtResource("1_ol2gy")
shield = ExtResource("4_tuve4")
stun = ExtResource("6_ar00t")
mp = ExtResource("2_kkpsf")
hp_max = 100.0
attack = 10.0

@ -0,0 +1,8 @@
[gd_resource type="Resource" script_class="CoreCfg" load_steps=2 format=3 uid="uid://dewpurp65pxqe"]
[ext_resource type="Script" path="res://script/config/core_cfg.gd" id="1_gjabn"]
[resource]
script = ExtResource("1_gjabn")
name = ""
type = 2

@ -0,0 +1,25 @@
[gd_resource type="Resource" script_class="SkillCfg" load_steps=6 format=3 uid="uid://b62nw6qww2qxq"]
[ext_resource type="Resource" uid="uid://bv4uoey1liqoq" path="res://config/attack/sharp_heavy_hit_blow.tres" id="1_idhfy"]
[ext_resource type="Resource" uid="uid://bnfnjdw0tms3h" path="res://config/attack_box/box_large.tres" id="2_k02dw"]
[ext_resource type="Script" path="res://script/config/skill_cfg.gd" id="3_qlpem"]
[ext_resource type="Animation" uid="uid://dyyt3nsvoye62" path="res://resource/skill_animation/monster03_slash01.tres" id="4_xr54j"]
[ext_resource type="SpriteFrames" uid="uid://bac4ype7w4wr7" path="res://resource/animation/character/monster03_skill.aseprite" id="5_30t6c"]
[resource]
script = ExtResource("3_qlpem")
name = ""
skill_animation = ExtResource("4_xr54j")
range = 1.0
free_lock = false
ignore_push = false
attack1 = ExtResource("1_idhfy")
attack1_box = ExtResource("2_k02dw")
stance_from = 100
stance_to = 0
break_level = 3
is_charging = false
mp_cost = 0
refresh_animation = false
sprite_frames = ExtResource("5_30t6c")
animation_name = "skill01"

@ -22,7 +22,7 @@ attack1_box = ExtResource("2_j2c3s")
attack2 = ExtResource("3_ymalh")
attack2_box = ExtResource("2_j2c3s")
stance_from = 99
stance_to = 2
stance_to = 0
break_level = 3
is_charging = false
mp_cost = 1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 19 KiB

@ -2,13 +2,13 @@
importer="Aseprite SpriteFrames Import"
type="SpriteFrames"
uid="uid://bs74u0yvluhky"
path="res://.godot/imported/monster01_attack.aseprite-dd014f1e66d1f3348ec25c8c6b714f27.res"
uid="uid://b26r4ls7v1c5h"
path="res://.godot/imported/monster01_skill.aseprite-cf1d7630ab49627da8225d81a6b6fe89.res"
[deps]
source_file="res://resource/animation/character/monster01_attack.aseprite"
dest_files=["res://.godot/imported/monster01_attack.aseprite-dd014f1e66d1f3348ec25c8c6b714f27.res"]
source_file="res://resource/animation/character/monster01_skill.aseprite"
dest_files=["res://.godot/imported/monster01_skill.aseprite-cf1d7630ab49627da8225d81a6b6fe89.res"]
[params]

Before

Width:  |  Height:  |  Size: 981 B

After

Width:  |  Height:  |  Size: 981 B

@ -2,33 +2,33 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://dr8lo68lr6tvi"
path="res://.godot/imported/monster02_attack.png-969f091f6c09e07323313d0870468a8a.ctex"
uid="uid://cap65nehvsevv"
path="res://.godot/imported/monster01_skill.png-b53c0d9e23f404a5cd80967af360a1a4.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resource/animation/character/monster02_attack.png"
dest_files=["res://.godot/imported/monster02_attack.png-969f091f6c09e07323313d0870468a8a.ctex"]
source_file="res://resource/animation/character/monster01_skill.png"
dest_files=["res://.godot/imported/monster01_skill.png-b53c0d9e23f404a5cd80967af360a1a4.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=0
compress/normal_map=2
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=false
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=0
detect_3d/compress_to=1

@ -2,13 +2,13 @@
importer="Aseprite SpriteFrames Import"
type="SpriteFrames"
uid="uid://dqtgib0fob3ii"
path="res://.godot/imported/monster02_attack.aseprite-3f0d5b696d62dafb11684ef9bd3eb3e9.res"
uid="uid://b7l00tlgjai8a"
path="res://.godot/imported/monster02_skill.aseprite-dd97afcc7c02411e2f30125ac42ff687.res"
[deps]
source_file="res://resource/animation/character/monster02_attack.aseprite"
dest_files=["res://.godot/imported/monster02_attack.aseprite-3f0d5b696d62dafb11684ef9bd3eb3e9.res"]
source_file="res://resource/animation/character/monster02_skill.aseprite"
dest_files=["res://.godot/imported/monster02_skill.aseprite-dd97afcc7c02411e2f30125ac42ff687.res"]
[params]

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

@ -2,33 +2,33 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://dofgbtb0v7vow"
path="res://.godot/imported/monster01_attack.png-73b9bb69c759d9069f8dec1a585280e4.ctex"
uid="uid://1ib0x2cxoilb"
path="res://.godot/imported/monster02_skill.png-4695d42552e226d17d6afb255b1dd3d3.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resource/animation/character/monster01_attack.png"
dest_files=["res://.godot/imported/monster01_attack.png-73b9bb69c759d9069f8dec1a585280e4.ctex"]
source_file="res://resource/animation/character/monster02_skill.png"
dest_files=["res://.godot/imported/monster02_skill.png-4695d42552e226d17d6afb255b1dd3d3.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=0
compress/normal_map=2
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=false
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=0
detect_3d/compress_to=1

@ -2,7 +2,7 @@
importer="Aseprite SpriteFrames Import"
type="SpriteFrames"
uid="uid://dn2da3442jjxw"
uid="uid://cg3twvacxd26o"
path="res://.godot/imported/monster03_attack.aseprite-486cdb2e2a290d5c6371318b5f8eb425.res"
[deps]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

@ -2,7 +2,7 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://blv4qpoo1fgdw"
uid="uid://be1fxnbtsgk2c"
path="res://.godot/imported/monster03_attack.png-1b78c6ba5dd8743dcd750a166dc978c3.ctex"
metadata={
"vram_texture": false
@ -18,17 +18,17 @@ dest_files=["res://.godot/imported/monster03_attack.png-1b78c6ba5dd8743dcd750a16
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=0
compress/normal_map=2
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=false
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=0
detect_3d/compress_to=1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

@ -0,0 +1,25 @@
[remap]
importer="Aseprite SpriteFrames Import"
type="SpriteFrames"
uid="uid://bac4ype7w4wr7"
path="res://.godot/imported/monster03_skill.aseprite-a94739b28a4279155f1cd3b7b906ab28.res"
[deps]
source_file="res://resource/animation/character/monster03_skill.aseprite"
dest_files=["res://.godot/imported/monster03_skill.aseprite-a94739b28a4279155f1cd3b7b906ab28.res"]
[params]
spritesheet/layout=0
spritesheet/fixed_rows_count=1
spritesheet/fixed_columns_count=1
spritesheet/border_type=0
spritesheet/trim=false
spritesheet/ignore_empty=false
spritesheet/merge_duplicates=false
animation/default/name="default"
animation/default/direction=0
animation/default/repeat_count=0
animation/autoplay=""

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://3mrkcfby5yo5"
path.s3tc="res://.godot/imported/monster03_skill.png-abfdaa1bcb9654328d4a0d26e140cd3a.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://resource/animation/character/monster03_skill.png"
dest_files=["res://.godot/imported/monster03_skill.png-abfdaa1bcb9654328d4a0d26e140cd3a.s3tc.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
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=0

@ -1,43 +0,0 @@
[gd_resource type="Animation" load_steps=2 format=3 uid="uid://b8ypa7uw0uam5"]
[ext_resource type="SpriteFrames" uid="uid://bs74u0yvluhky" path="res://resource/animation/character/monster01_attack.aseprite" id="1_7ykbn"]
[resource]
resource_name = "monster01_attack01"
length = 0.8
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("View:sprite_frames")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [ExtResource("1_7ykbn")]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("View:animation")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": ["attack01"]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("View:frame")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1),
"update": 1,
"values": [0, 1, 2, 3, 4, 5, 6, 7]
}

@ -0,0 +1,108 @@
[gd_resource type="Animation" load_steps=2 format=3 uid="uid://dyyt3nsvoye62"]
[ext_resource type="SpriteFrames" uid="uid://bac4ype7w4wr7" path="res://resource/animation/character/monster03_skill.aseprite" id="1_f5myu"]
[resource]
resource_name = "monster03_slash01"
length = 1.9
step = 0.1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("View:sprite_frames")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [ExtResource("1_f5myu")]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("View:animation")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": ["skill01"]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Status:break_level")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0, 1.1, 1.3),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 1,
"values": [0, 3, 4]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("Status:speed_up_rate")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0.1, 0.7),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [-0.5, -1.0]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("Status:skill_move_speed")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0.7, 0.9),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [3.0, 0.0]
}
tracks/5/type = "method"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath("Battle")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
"times": PackedFloat32Array(0.9),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
"method": &"attack1"
}]
}
tracks/6/type = "method"
tracks/6/imported = false
tracks/6/enabled = true
tracks/6/path = NodePath("Effect")
tracks/6/interp = 1
tracks/6/loop_wrap = true
tracks/6/keys = {
"times": PackedFloat32Array(0.8),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
"method": &"cast_attack_particle1"
}]
}
tracks/7/type = "value"
tracks/7/imported = false
tracks/7/enabled = true
tracks/7/path = NodePath("View:frame")
tracks/7/interp = 1
tracks/7/loop_wrap = true
tracks/7/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
"update": 1,
"values": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18]
}

@ -34,7 +34,6 @@
[ext_resource type="Animation" uid="uid://xfuwfwtw4cna" path="res://resource/skill_animation/hero01_short_attack02.tres" id="11_h2vlt"]
[ext_resource type="Animation" uid="uid://bdyjvq185tdk6" path="res://resource/skill_animation/hero01_short_attack03.tres" id="11_kejyu"]
[ext_resource type="Animation" uid="uid://bkre61dn64j2f" path="res://resource/skill_animation/hero01_short_attack01.tres" id="11_n0dhn"]
[ext_resource type="Animation" uid="uid://b8ypa7uw0uam5" path="res://resource/skill_animation/monster01_attack01.tres" id="11_q5gn4"]
[ext_resource type="Animation" uid="uid://j1o3tdfew2qw" path="res://resource/skill_animation/hero01_flash.tres" id="16_ctotk"]
[ext_resource type="Animation" uid="uid://uxuayi0qf3b7" path="res://resource/skill_animation/hero01_long_air_skill01.tres" id="20_0ey8y"]
[ext_resource type="Animation" uid="uid://batvpnk7jfc2a" path="res://resource/skill_animation/hero01_fist_skill02.tres" id="20_dv6vj"]
@ -44,6 +43,7 @@
[ext_resource type="Animation" uid="uid://bbq4e0a0eyrke" path="res://resource/skill_animation/hero01_fist_skill_charging02.tres" id="24_j0oqq"]
[ext_resource type="Animation" uid="uid://h8hm3kbecdx8" path="res://resource/skill_animation/hero01_remote01.tres" id="33_7i37k"]
[ext_resource type="Animation" uid="uid://q7qlw0a7hfjt" path="res://resource/skill_animation/hero01_slash01.tres" id="38_lyels"]
[ext_resource type="Animation" uid="uid://dyyt3nsvoye62" path="res://resource/skill_animation/monster03_slash01.tres" id="45_s1ue4"]
[resource]
_data = {
@ -91,5 +91,5 @@ _data = {
"hero01_short_attack03": ExtResource("11_kejyu"),
"hero01_short_attack04": ExtResource("11_bxi8a"),
"hero01_slash01": ExtResource("38_lyels"),
"monster01_attack01": ExtResource("11_q5gn4")
"monster03_slash01": ExtResource("45_s1ue4")
}

@ -0,0 +1,19 @@
[gd_scene load_steps=5 format=3 uid="uid://bk74u53bkeckp"]
[ext_resource type="Script" path="res://addons/beehave/nodes/beehave_tree.gd" id="1_tkdjh"]
[ext_resource type="Script" path="res://addons/beehave/nodes/composites/sequence.gd" id="2_mxprp"]
[ext_resource type="Script" path="res://script/ai/action/action_find_target.gd" id="3_wmb22"]
[ext_resource type="Script" path="res://script/ai/action_with_target/action_move_to_target.gd" id="4_8dx07"]
[node name="BeehaveTree" type="Node" node_paths=PackedStringArray("blackboard")]
script = ExtResource("1_tkdjh")
blackboard = NodePath("@Node@79226")
[node name="SequenceComposite" type="Node" parent="."]
script = ExtResource("2_mxprp")
[node name="ActionFindTarget" type="Node" parent="SequenceComposite"]
script = ExtResource("3_wmb22")
[node name="ActionMoveToTarget" type="Node" parent="SequenceComposite"]
script = ExtResource("4_8dx07")

@ -0,0 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://ce6frscc11gge"]
[ext_resource type="PackedScene" uid="uid://b2h4pcmlii7dg" path="res://scene/effect/particle/_particle_slash1.tscn" id="1_6kw22"]
[node name="Particle" instance=ExtResource("1_6kw22")]
transform = Transform3D(1.6, 0, 0, 0, 0.707107, -0.353553, 0, 0.707107, 0.353553, 0, 0, 0)

@ -18,7 +18,7 @@
[ext_resource type="PackedScene" uid="uid://0uonhojhfgi" path="res://scene/ui/menu_screen.tscn" id="10_sky2n"]
[ext_resource type="Script" path="res://script/manager/input_manager.gd" id="12_vfqm4"]
[ext_resource type="Script" path="res://script/character/status.gd" id="18_nr8sb"]
[ext_resource type="SpriteFrames" uid="uid://cajgs8smbkjan" path="res://resource/animation/character/hero01_fist_skill01.aseprite" id="19_ds2c6"]
[ext_resource type="SpriteFrames" uid="uid://bac4ype7w4wr7" path="res://resource/animation/character/monster03_skill.aseprite" id="19_6w5yx"]
[ext_resource type="SpriteFrames" uid="uid://2cb8lknel0ih" path="res://resource/animation/character/basic_move.aseprite" id="20_4ni1a"]
[ext_resource type="AnimationLibrary" uid="uid://croik07a1qko5" path="res://resource/skill_animation_library/animation_library.tres" id="22_qyapv"]
[ext_resource type="Script" path="res://script/character/skill.gd" id="23_783eu"]
@ -191,6 +191,7 @@ script = ExtResource("5_n3qhi")
unique_name_in_owner = true
script = ExtResource("18_nr8sb")
speed_up_rate = -1.0
skill_float_speed = 0.1
[node name="View" type="AnimatedSprite3D" parent="EditorTool/Character"]
unique_name_in_owner = true
@ -202,13 +203,12 @@ pixel_size = 0.02
double_sided = false
alpha_cut = 2
texture_filter = 0
sprite_frames = ExtResource("19_ds2c6")
animation = &"fist_air_skill01"
frame = 8
sprite_frames = ExtResource("19_6w5yx")
animation = &"skill01"
[node name="Throw" type="AnimatedSprite3D" parent="EditorTool/Character"]
unique_name_in_owner = true
transform = Transform3D(-1, 0, 0, 0, -1, 1.50996e-07, 0, -1.50996e-07, -1, 0, 0, 0)
transform = Transform3D(1, 0, 0, 0, 1, -1.50996e-07, 0, 1.50996e-07, 1, 0, 0, 0)
pixel_size = 0.02
sprite_frames = ExtResource("20_4ni1a")
animation = &"idle_loop"

@ -17,23 +17,12 @@ func init(id: int, cfg: CharacterCfg, team: Enum.ETeam, owner_id: int):
status.owner_id = owner_id
status.team = team
status.cfg = cfg
var half_height: float = Setting.pixel_size * cfg.sprite_harf_height
var height: float = half_height * 2
var width: float = Setting.pixel_size * cfg.sprite_width
var body_scale: Vector3 = Vector3(width, height, width)
collision.position = Vector3(0, half_height, 0)
collision.scale = body_scale
pushbox.position = Vector3(0, half_height, 0)
pushbox.scale = body_scale
status.basic_offset = Vector3(0, half_height, 0)
status.ui_offset = Vector3(0, height*1.1, 0)
status.ui_center_offset = Vector3(0, half_height, 0)
status.radius = width
status.height = height
view.init(cfg.sprite_frames)
skill.init()
effect.init(cfg.type, body_scale)
effect.init(cfg.type)
effect.cast_self_particle()
set_body_scale(cfg)
func init_after():
@ -50,6 +39,27 @@ func init_after():
set_status("mp_sub", 0)
func set_body_scale(cfg: CharacterCfg) -> void:
if not cfg:
cfg = status.cfg
if not cfg:
return
var half_height: float = Setting.pixel_size * cfg.sprite_harf_height
var height: float = half_height * 2
var width: float = Setting.pixel_size * cfg.sprite_width
var body_scale: Vector3 = Vector3(width, height, width)
collision.position = Vector3(0, half_height, 0)
collision.scale = body_scale
pushbox.position = Vector3(0, half_height, 0)
pushbox.scale = body_scale
status.basic_offset = Vector3(0, half_height, 0)
status.ui_offset = Vector3(0, height*1.1, 0)
status.ui_center_offset = Vector3(0, half_height, 0)
status.radius = width
status.height = height
effect.set_body_scale(body_scale)
func set_material(material: ShaderMaterial, material_sub: ShaderMaterial):
view.material_override = material
view.material_override.next_pass = material_sub

@ -24,16 +24,20 @@ func particle_list() -> Array[Variant]:
return ret
func init(type: Enum.ECharacterType, body_scale: Vector3):
func init(type: Enum.ECharacterType):
match type:
Enum.ECharacterType.Player: rediness = readiness_hero.instantiate()
Enum.ECharacterType.Monster: rediness = readiness_monster.instantiate()
Enum.ECharacterType.Bullet: rediness = readiness_bullet.instantiate()
if rediness:
add_child(rediness)
func set_body_scale(body_scale: Vector3):
if rediness:
rediness.scale = body_scale *2.2
rediness.scale.y = 10
rediness.position = Vector3.DOWN * 4
add_child(rediness)
func _process(delta):
@ -87,6 +91,7 @@ func cast_attack_particle2(): _cast_attack_particle(2, true)
func cast_attack_particle2_release(): _cast_attack_particle(2, false)
func cast_self_particle() -> void:
if !status.cfg:
return
@ -95,6 +100,7 @@ func cast_self_particle() -> void:
return
_cast_particle(particle, true, Vector3.ZERO, Vector3.ZERO)
func _cast_attack_particle(index: int, is_attach: bool) -> void:
if !status.skill_cfg:
return

@ -24,6 +24,7 @@ func _ready():
add_weapon(load("res://config/weapon/fist.tres") as WeaponCfg)
core.set_active_core(0, load("res://config/core/hero01_remote01.tres") as CoreCfg)
core.set_active_core(1, load("res://config/core/monster03_slash01.tres") as CoreCfg)
func _process(delta):

@ -46,7 +46,6 @@ func cast_skill_by_name(name: String, cast_dir: Vector2):
func cast_skill(cfg: SkillCfg, cast_dir: Vector2, action_key: String = "") -> void:
break_skill()
if cast_dir.length() == 0:
cast_dir = Vector2.RIGHT if status.is_right else Vector2.LEFT
if !cfg.free_lock and status.target:
@ -64,6 +63,7 @@ func cast_skill(cfg: SkillCfg, cast_dir: Vector2, action_key: String = "") -> vo
print("mp不足")
return
break_skill()
character.cost_mp(cfg.mp_cost)
status.speed_up_rate = -1
status.is_free_control = false
@ -75,6 +75,7 @@ func cast_skill(cfg: SkillCfg, cast_dir: Vector2, action_key: String = "") -> vo
status.stance = cfg.stance_to
status.is_charging = cfg.is_charging
status.skill_action_key = action_key
character.set_body_scale(cfg.get_owner())
if cfg.is_charging:
buff.add_buff("charging", -1)
if cast_dir.x != 0: status.is_right = cast_dir.x > 0
@ -107,11 +108,13 @@ func break_skill():
func cancel_skill():
break_skill()
character.set_body_scale(status.cfg)
view.reset()
func on_attack_miss():
# 攻击未命中时跳帧
print("on_attack_miss")
_frame_forward()

@ -23,6 +23,8 @@ class_name SkillCfg
set(value): if Engine.is_editor_hint(): check_animation()
var attack_particle: Dictionary = {}
var owner: CharacterCfg
func check_animation() -> bool:
var res_name: String = get_res_name()
@ -70,3 +72,12 @@ func get_attack_particle(index: int)->Resource:
if index in attack_particle:
return attack_particle[index]
return null
func get_owner() -> CharacterCfg:
if not owner:
var owner_name: String = get_res_name().split("_")[0]
var path: String = "res://config/character/%s.tres" % owner_name
if ResourceLoader.exists(path):
owner = load(path) as CharacterCfg
return owner

@ -17,7 +17,7 @@ var particle_debug_cylinder: PackedScene = load("res://scene/effect/particl
#==config==
#character
var cfg_character_player: CharacterCfg = load("res://config/character/hero01.tres") as CharacterCfg
var cfg_character_monster_test: CharacterCfg = load("res://config/character/monster02.tres") as CharacterCfg
var cfg_character_monster_test: CharacterCfg = load("res://config/character/monster03.tres") as CharacterCfg
#attack
var cfg_attack_normal: AttackCfg = load("res://config/attack/sharp_normal_hit.tres") as AttackCfg
var cfg_attack_box_normal: AttackCfg = load("res://config/attack_box/circle_normal.tres") as AttackCfg

Loading…
Cancel
Save