怪物核心系统 初版

master
chendian 2 years ago
parent ac7bd2aa40
commit a1e321d180

@ -0,0 +1,14 @@
[gd_resource type="Resource" script_class="CoreCfg" load_steps=6 format=3 uid="uid://chx14f0ty3usd"]
[ext_resource type="Texture2D" uid="uid://bsafgg7cbtusa" path="res://resource/ui/icon/core/default.png" id="1_by0g3"]
[ext_resource type="Script" path="res://script/config/core_cfg.gd" id="1_v24ds"]
[ext_resource type="Resource" uid="uid://cuwtxibg84nno" path="res://config/skill_player_common/hero01_common_skill0101.tres" id="3_oj1qu"]
[ext_resource type="Resource" uid="uid://lr1iguojoyk" path="res://config/skill_player_common/hero01_common_skill0102.tres" id="4_we7wm"]
[ext_resource type="Resource" uid="uid://b8b1afegmabx6" path="res://config/skill_player_common/hero01_common_skill0103.tres" id="5_1xn4f"]
[resource]
script = ExtResource("1_v24ds")
name = ""
icon = ExtResource("1_by0g3")
type = 0
skill_list = Array[Resource("res://script/config/player_skill_cfg.gd")]([ExtResource("3_oj1qu"), ExtResource("4_we7wm"), ExtResource("5_1xn4f")])

@ -0,0 +1,20 @@
[gd_resource type="Resource" script_class="SkillPlayerCfg" load_steps=4 format=3 uid="uid://cuwtxibg84nno"]
[ext_resource type="Script" path="res://script/config/player_skill_cfg.gd" id="1_702bi"]
[ext_resource type="Animation" uid="uid://dokxns0q44rux" path="res://resource/skill_animation/hero01_common_skill0101.tres" id="2_o71rh"]
[ext_resource type="SpriteFrames" uid="uid://ce83cuqwgwwi4" path="res://resource/animation/character/hero01_long_attack.aseprite" id="3_ppacp"]
[resource]
script = ExtResource("1_702bi")
stance_from = 100
stance_to = 2
break_level = 3
action = "none"
name = ""
skill_animation = ExtResource("2_o71rh")
attack_list = Array[Resource("res://script/config/attack_cfg.gd")]([])
sub_character_list = Array[Resource("res://script/config/character_cfg.gd")]([])
free_lock = false
refresh_animation = false
sprite_frames = ExtResource("3_ppacp")
animation_name = "long_attack01"

@ -0,0 +1,20 @@
[gd_resource type="Resource" script_class="SkillPlayerCfg" load_steps=4 format=3 uid="uid://lr1iguojoyk"]
[ext_resource type="Script" path="res://script/config/player_skill_cfg.gd" id="1_42tyl"]
[ext_resource type="Animation" uid="uid://d0rn5wwwnu4oh" path="res://resource/skill_animation/hero01_common_skill0102.tres" id="2_ar1pk"]
[ext_resource type="SpriteFrames" uid="uid://ce83cuqwgwwi4" path="res://resource/animation/character/hero01_long_attack.aseprite" id="3_11afq"]
[resource]
script = ExtResource("1_42tyl")
stance_from = 100
stance_to = 3
break_level = 1
action = "none"
name = ""
skill_animation = ExtResource("2_ar1pk")
attack_list = Array[Resource("res://script/config/attack_cfg.gd")]([])
sub_character_list = Array[Resource("res://script/config/character_cfg.gd")]([])
free_lock = false
refresh_animation = false
sprite_frames = ExtResource("3_11afq")
animation_name = "long_attack02"

@ -0,0 +1,20 @@
[gd_resource type="Resource" script_class="SkillPlayerCfg" load_steps=4 format=3 uid="uid://b8b1afegmabx6"]
[ext_resource type="Script" path="res://script/config/player_skill_cfg.gd" id="1_uhj5t"]
[ext_resource type="Animation" uid="uid://cm4c0rwh0mqn4" path="res://resource/skill_animation/hero01_common_skill0103.tres" id="2_breja"]
[ext_resource type="SpriteFrames" uid="uid://ce83cuqwgwwi4" path="res://resource/animation/character/hero01_long_attack.aseprite" id="3_2hchk"]
[resource]
script = ExtResource("1_uhj5t")
stance_from = 100
stance_to = 4
break_level = 1
action = "none"
name = ""
skill_animation = ExtResource("2_breja")
attack_list = Array[Resource("res://script/config/attack_cfg.gd")]([])
sub_character_list = Array[Resource("res://script/config/character_cfg.gd")]([])
free_lock = false
refresh_animation = false
sprite_frames = ExtResource("3_2hchk")
animation_name = "long_attack03"

@ -184,6 +184,12 @@ switch={
"events": [Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":9,"pressure":0.0,"pressed":true,"script":null) "events": [Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":9,"pressure":0.0,"pressed":true,"script":null)
] ]
} }
interact={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":85,"key_label":0,"unicode":117,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":1,"pressure":0.0,"pressed":true,"script":null)
]
}
test_1={ test_1={
"deadzone": 0.5, "deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":49,"key_label":0,"unicode":49,"echo":false,"script":null) "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":49,"key_label":0,"unicode":49,"echo":false,"script":null)

@ -0,0 +1,25 @@
[remap]
importer="Aseprite SpriteFrames Import"
type="SpriteFrames"
uid="uid://cl4tfb2auoa13"
path="res://.godot/imported/hero01_common_skill01.aseprite-bfba05e484edc594e4b3facf65316244.res"
[deps]
source_file="res://resource/animation/character/hero01_common_skill01.aseprite"
dest_files=["res://.godot/imported/hero01_common_skill01.aseprite-bfba05e484edc594e4b3facf65316244.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: 8.5 KiB

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dg702ysrfu4ip"
path="res://.godot/imported/hero01_common_skill01.png-def4dfcfc6697b4296d7a3324ec8e6f6.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resource/animation/character/hero01_common_skill01.png"
dest_files=["res://.godot/imported/hero01_common_skill01.png-def4dfcfc6697b4296d7a3324ec8e6f6.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 24 KiB

File diff suppressed because one or more lines are too long

@ -0,0 +1,42 @@
[gd_resource type="Animation" load_steps=2 format=3 uid="uid://dokxns0q44rux"]
[ext_resource type="SpriteFrames" uid="uid://ce83cuqwgwwi4" path="res://resource/animation/character/hero01_long_attack.aseprite" id="1_yt37s"]
[resource]
resource_name = "hero01_common_skill0101"
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_yt37s")]
}
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": ["long_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, 0.8, 0.9),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
"update": 1,
"values": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
}

@ -0,0 +1,42 @@
[gd_resource type="Animation" load_steps=2 format=3 uid="uid://d0rn5wwwnu4oh"]
[ext_resource type="SpriteFrames" uid="uid://ce83cuqwgwwi4" path="res://resource/animation/character/hero01_long_attack.aseprite" id="1_qhsjf"]
[resource]
resource_name = "hero01_common_skill0102"
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_qhsjf")]
}
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": ["long_attack02"]
}
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, 0.8, 0.9),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
"update": 1,
"values": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
}

@ -0,0 +1,43 @@
[gd_resource type="Animation" load_steps=2 format=3 uid="uid://cm4c0rwh0mqn4"]
[ext_resource type="SpriteFrames" uid="uid://ce83cuqwgwwi4" path="res://resource/animation/character/hero01_long_attack.aseprite" id="1_voh4c"]
[resource]
resource_name = "hero01_common_skill0103"
length = 1.4
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_voh4c")]
}
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": ["long_attack03"]
}
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, 0.8, 0.9, 1, 1.1, 1.2, 1.3),
"transitions": PackedFloat32Array(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]
}

@ -1,14 +1,17 @@
[gd_resource type="AnimationLibrary" load_steps=21 format=3 uid="uid://croik07a1qko5"] [gd_resource type="AnimationLibrary" load_steps=24 format=3 uid="uid://croik07a1qko5"]
[ext_resource type="Animation" uid="uid://t01a4jvp8srr" path="res://resource/skill_animation/hero01_fist_attack01.tres" id="1_4bwwm"] [ext_resource type="Animation" uid="uid://t01a4jvp8srr" path="res://resource/skill_animation/hero01_fist_attack01.tres" id="1_4bwwm"]
[ext_resource type="Animation" uid="uid://p8l0puqxrkwh" path="res://resource/skill_animation/hero01_long_air_attack01.tres" id="1_b46g3"] [ext_resource type="Animation" uid="uid://p8l0puqxrkwh" path="res://resource/skill_animation/hero01_long_air_attack01.tres" id="1_b46g3"]
[ext_resource type="Animation" uid="uid://daopmieibx3b7" path="res://resource/skill_animation/hero01_long_attack01.tres" id="1_nwjtl"] [ext_resource type="Animation" uid="uid://daopmieibx3b7" path="res://resource/skill_animation/hero01_long_attack01.tres" id="1_nwjtl"]
[ext_resource type="Animation" uid="uid://dokxns0q44rux" path="res://resource/skill_animation/hero01_common_skill0101.tres" id="1_vt4qf"]
[ext_resource type="Animation" uid="uid://d0rn5wwwnu4oh" path="res://resource/skill_animation/hero01_common_skill0102.tres" id="2_8l02x"]
[ext_resource type="Animation" uid="uid://cjfy6ia1ukyiu" path="res://resource/skill_animation/hero01_long_air_attack02.tres" id="2_8wtap"] [ext_resource type="Animation" uid="uid://cjfy6ia1ukyiu" path="res://resource/skill_animation/hero01_long_air_attack02.tres" id="2_8wtap"]
[ext_resource type="Animation" uid="uid://bf6jaraltouun" path="res://resource/skill_animation/hero01_long_attack02.tres" id="2_klfcs"] [ext_resource type="Animation" uid="uid://bf6jaraltouun" path="res://resource/skill_animation/hero01_long_attack02.tres" id="2_klfcs"]
[ext_resource type="Animation" uid="uid://bh5s2t3cbobpp" path="res://resource/skill_animation/hero01_long_air_attack03.tres" id="2_nqaew"] [ext_resource type="Animation" uid="uid://bh5s2t3cbobpp" path="res://resource/skill_animation/hero01_long_air_attack03.tres" id="2_nqaew"]
[ext_resource type="Animation" uid="uid://cyu0yin1rpiak" path="res://resource/skill_animation/hero01_fist_attack02.tres" id="2_vx7p1"] [ext_resource type="Animation" uid="uid://cyu0yin1rpiak" path="res://resource/skill_animation/hero01_fist_attack02.tres" id="2_vx7p1"]
[ext_resource type="Animation" uid="uid://b2xdmgnem1h4g" path="res://resource/skill_animation/hero01_fist_attack05.tres" id="2_y7w3h"] [ext_resource type="Animation" uid="uid://b2xdmgnem1h4g" path="res://resource/skill_animation/hero01_fist_attack05.tres" id="2_y7w3h"]
[ext_resource type="Animation" uid="uid://c8yueqe7rjn60" path="res://resource/skill_animation/hero01_long_attack03.tres" id="3_g8q4d"] [ext_resource type="Animation" uid="uid://c8yueqe7rjn60" path="res://resource/skill_animation/hero01_long_attack03.tres" id="3_g8q4d"]
[ext_resource type="Animation" uid="uid://cm4c0rwh0mqn4" path="res://resource/skill_animation/hero01_common_skill0103.tres" id="3_ily05"]
[ext_resource type="Animation" uid="uid://c6mk8tfdpniys" path="res://resource/skill_animation/hero01_fist_attack03.tres" id="3_lo6yb"] [ext_resource type="Animation" uid="uid://c6mk8tfdpniys" path="res://resource/skill_animation/hero01_fist_attack03.tres" id="3_lo6yb"]
[ext_resource type="Animation" uid="uid://dk1o3gqhjmuvh" path="res://resource/skill_animation/hero01_long_attack04.tres" id="4_36e6x"] [ext_resource type="Animation" uid="uid://dk1o3gqhjmuvh" path="res://resource/skill_animation/hero01_long_attack04.tres" id="4_36e6x"]
[ext_resource type="Animation" uid="uid://6u3dhxly760l" path="res://resource/skill_animation/hero01_fist_attack04.tres" id="4_087em"] [ext_resource type="Animation" uid="uid://6u3dhxly760l" path="res://resource/skill_animation/hero01_fist_attack04.tres" id="4_087em"]
@ -23,6 +26,9 @@
[resource] [resource]
_data = { _data = {
"hero01_common_skill0101": ExtResource("1_vt4qf"),
"hero01_common_skill0102": ExtResource("2_8l02x"),
"hero01_common_skill0103": ExtResource("3_ily05"),
"hero01_fist_attack01": ExtResource("1_4bwwm"), "hero01_fist_attack01": ExtResource("1_4bwwm"),
"hero01_fist_attack02": ExtResource("2_vx7p1"), "hero01_fist_attack02": ExtResource("2_vx7p1"),
"hero01_fist_attack03": ExtResource("3_lo6yb"), "hero01_fist_attack03": ExtResource("3_lo6yb"),

Binary file not shown.

After

Width:  |  Height:  |  Size: 300 B

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bsafgg7cbtusa"
path="res://.godot/imported/default.png-cec70224a968b6e360e2daaba99ff112.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resource/ui/icon/core/default.png"
dest_files=["res://.godot/imported/default.png-cec70224a968b6e360e2daaba99ff112.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=0
compress/normal_map=2
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=false
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,8 +1,9 @@
[gd_scene load_steps=6 format=3 uid="uid://ba7pkdaq5y8nl"] [gd_scene load_steps=7 format=3 uid="uid://ba7pkdaq5y8nl"]
[ext_resource type="PackedScene" uid="uid://8rcvw1vnjcf7" path="res://scene/character/character.tscn" id="1_pot50"] [ext_resource type="PackedScene" uid="uid://8rcvw1vnjcf7" path="res://scene/character/character.tscn" id="1_pot50"]
[ext_resource type="Script" path="res://script/character/player/combo.gd" id="2_i44w8"] [ext_resource type="Script" path="res://script/character/player/combo.gd" id="2_i44w8"]
[ext_resource type="Script" path="res://script/character/player/player_input.gd" id="3_n07go"] [ext_resource type="Script" path="res://script/character/player/player_input.gd" id="3_n07go"]
[ext_resource type="Script" path="res://script/character/player/core.gd" id="3_rxdse"]
[ext_resource type="Script" path="res://script/character/player/player_info.gd" id="4_mi1lk"] [ext_resource type="Script" path="res://script/character/player/player_info.gd" id="4_mi1lk"]
[ext_resource type="Script" path="res://script/character/player/player_action.gd" id="5_gum7v"] [ext_resource type="Script" path="res://script/character/player/player_action.gd" id="5_gum7v"]
@ -15,13 +16,17 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.693056, 0)
unique_name_in_owner = true unique_name_in_owner = true
script = ExtResource("2_i44w8") script = ExtResource("2_i44w8")
[node name="PlayerInput" type="Node3D" parent="." index="9"] [node name="Core" type="Node3D" parent="." index="9"]
unique_name_in_owner = true
script = ExtResource("3_rxdse")
[node name="PlayerInput" type="Node3D" parent="." index="10"]
unique_name_in_owner = true unique_name_in_owner = true
script = ExtResource("3_n07go") script = ExtResource("3_n07go")
[node name="PlayerAction" type="Node3D" parent="." index="10"] [node name="PlayerAction" type="Node3D" parent="." index="11"]
unique_name_in_owner = true unique_name_in_owner = true
script = ExtResource("5_gum7v") script = ExtResource("5_gum7v")
[node name="PlayerInfo" type="Node3D" parent="." index="11"] [node name="PlayerInfo" type="Node3D" parent="." index="12"]
script = ExtResource("4_mi1lk") script = ExtResource("4_mi1lk")

@ -11,3 +11,4 @@ enum EStance {
Any = 100, Any = 100,
} }
enum EBreakLevel {None, Cancel, Jump, Break, Walk} #不可打断 取消技打断 跳跃打断 连招打断 行走打断 enum EBreakLevel {None, Cancel, Jump, Break, Walk} #不可打断 取消技打断 跳跃打断 连招打断 行走打断
enum ECoreType {Free ,Lock, Passive}

@ -109,6 +109,11 @@ func add_skill(action:String,skillCfg:SkillPlayerCfg):
skill_map[action] = [] skill_map[action] = []
skill_map[action].append(skillCfg) skill_map[action].append(skillCfg)
func remove_skill(action:String,skillCfg:SkillPlayerCfg):
if not action in skill_map:
return
skill_map[action].filter(func(cfg): return cfg != skillCfg)
func add_weapon(weapon:WeaponCfg): func add_weapon(weapon:WeaponCfg):
status.weapon_list.append(weapon) status.weapon_list.append(weapon)
for skill_player_weapon_res in Util.get_skill_player_weapon_by_weapon(weapon): for skill_player_weapon_res in Util.get_skill_player_weapon_by_weapon(weapon):

@ -0,0 +1,60 @@
extends Node3D
class_name Core
@onready var character = (get_owner() as Character)
@onready var status = (%Status as Status)
@onready var skill = (%Skill as Skill)
@onready var move = (%Move as Move)
@onready var combo = (%Combo as Combo)
var active_core_action_list = [
"free_attack_heavy","free_attack_light","free_jump","free_interact",
"lock_attack_heavy","lock_attack_light","lock_jump","lock_interact",
]
func _ready():
# test
for i in range(8):
status.core_active_list.append(null)
set_active_core(0,load("res://config/core/free01.tres"))
func _process(delta):
pass
func set_active_core(index:int,core:CoreCfg):
match core.type:
Enum.ECoreType.Free:pass
Enum.ECoreType.Lock:index+=4
Enum.ECoreType.Passive:return
if index<0 or index>=8:
return
var core_pre = status.core_active_list[index]
if core_pre:
on_remove_active_core(index,core_pre)
status.core_active_list[index] = core
on_add_active_core(index,core)
status.emit_status("core_active_list")
func on_add_active_core(index:int,core:CoreCfg):
for skill in core.skill_list:
var action = active_core_action_list[index]
combo.add_skill(action,skill)
func on_remove_active_core(index:int,core:CoreCfg):
for skill in core.skill_list:
var action = active_core_action_list[index]
combo.remove_skill(action,skill)
func add_passive_core(core:CoreCfg):
match core.type:
Enum.ECoreType.Free:return
Enum.ECoreType.Lock:return
status.core_passive_list.append(core)
status.emit_status("core_passive_list")
func remove_passive_core(core:CoreCfg):
match core.type:
Enum.ECoreType.Free:return
Enum.ECoreType.Lock:return
status.core_passive_list.filter(func(c):return c!=core)
status.emit_status("core_passive_list")

@ -12,6 +12,7 @@ func check_action(key:String,is_pressed:bool) -> bool:
return true return true
match key: match key:
"lock":lock(is_pressed) "lock":lock(is_pressed)
"switch":switch(is_pressed)
_:return false _:return false
return true return true
@ -35,3 +36,5 @@ func lock(is_pressed:bool):
else: else:
character.set_target(0) character.set_target(0)
func switch(is_pressed:bool):
character.set_status("is_switch",is_pressed)

@ -6,6 +6,7 @@ class_name PlayerInput
@onready var action = (%PlayerAction as PlayerAction) @onready var action = (%PlayerAction as PlayerAction)
var action_map = {} var action_map = {}
var switch_action_list = ["attack_heavy","attack_light","jump","interact"]
func _ready(): func _ready():
SignalManager.connect("input_action_pressed",on_input_action_pressed) SignalManager.connect("input_action_pressed",on_input_action_pressed)
@ -13,11 +14,11 @@ func _ready():
SignalManager.connect("input_action_move",on_input_action_move) SignalManager.connect("input_action_move",on_input_action_move)
func on_input_action_pressed(action_name:String): func on_input_action_pressed(action_name:String):
if not action_name in action_map: if action_name in action_map:
action_map[action_name] = true
else:
return return
action_map[action_name] = true
action_name = get_switch_action(action_name)
Global.ui_mgr.input_action(action_name,true) Global.ui_mgr.input_action(action_name,true)
if Global.is_control_pause: if Global.is_control_pause:
return return
@ -29,6 +30,7 @@ func on_input_action_released(action_name:String):
return return
action_map.erase(action_name) action_map.erase(action_name)
action_name = get_switch_action(action_name)
Global.ui_mgr.input_action(action_name,false) Global.ui_mgr.input_action(action_name,false)
if Global.is_control_pause: if Global.is_control_pause:
return return
@ -39,3 +41,14 @@ func on_input_action_move(input_dir):
if Global.is_control_pause: if Global.is_control_pause:
return return
status.input_dir = input_dir status.input_dir = input_dir
func get_switch_action(action_name:String)->String:
if not action_name in switch_action_list:
return action_name
if not status.is_switch:
return action_name
if status.target:
return "lock_%s"%action_name
else:
return "free_%s"%action_name

@ -74,6 +74,10 @@ class_name Status
@export var weapon_index : int #当前武器下标 @export var weapon_index : int #当前武器下标
@export var weapon_index_change_dir : int #武器下标操作变化方向 @export var weapon_index_change_dir : int #武器下标操作变化方向
@export var weapon_index_change_rate : float #武器下标操作变化进度 @export var weapon_index_change_rate : float #武器下标操作变化进度
@export var core_active_list = [] #主动核心列表 4free 4lock
@export var core_passive_list = [] #被动核心列表
@export var is_switch : bool #是否切换到核心释放模式
@export_category("动画触发器") @export_category("动画触发器")
@export var trigger_jump : bool #跳跃 @export var trigger_jump : bool #跳跃

@ -0,0 +1,8 @@
extends Resource
class_name CoreCfg
@export var name : String
@export var icon : Texture2D
@export var type : Enum.ECoreType
@export var skill_list : Array[SkillPlayerCfg]

@ -4,7 +4,7 @@ extends SkillCfg
class_name SkillPlayerCfg class_name SkillPlayerCfg
@export var weapon : WeaponCfg @export var weapon : WeaponCfg
@export var stance_from : Enum.EStance @export var stance_from : Enum.EStance = Enum.EStance.Any
@export var stance_to : Enum.EStance @export var stance_to : Enum.EStance
@export var break_level : Enum.EBreakLevel = Enum.EBreakLevel.Break @export var break_level : Enum.EBreakLevel = Enum.EBreakLevel.Break
@export_enum("attack_light","attack_heavy","flash") var action : String = "attack_light" @export_enum("none","attack_light","attack_heavy","flash") var action : String = "none"

@ -20,8 +20,6 @@ func _ready():
func input_action(key:String,is_pressed:bool): func input_action(key:String,is_pressed:bool):
if top_ui_screen: if top_ui_screen:
top_ui_screen.call("input_action",key,is_pressed) top_ui_screen.call("input_action",key,is_pressed)
else:
print("?")
func input_dir(dir:Vector2): func input_dir(dir:Vector2):
if top_ui_screen: if top_ui_screen:

@ -29,3 +29,6 @@ func on_mp_changed(value:int):
for i in range(mp_list.get_child_count()): for i in range(mp_list.get_child_count()):
var mp_item = mp_list.get_child(i) as MpItemSub var mp_item = mp_list.get_child(i) as MpItemSub
mp_item.set_active(i<value) mp_item.set_active(i<value)
func on_is_switch_changed(value:bool):
print(value)

@ -1,7 +1,6 @@
extends Control extends Control
func input_action_pressed(key:String): func input_action_pressed(key:String):
print("?")
match key: match key:
"status": "status":
Global.ui_mgr.pause_close("status") Global.ui_mgr.pause_close("status")

Loading…
Cancel
Save