技能轮盘
parent
80057356e7
commit
8b28016aec
@ -0,0 +1,8 @@
|
||||
[gd_resource type="Resource" script_class="CoreCfg" load_steps=2 format=3 uid="uid://dtxe3pgt6xnom"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://coj1fx00rq7ad" path="res://script/config/core_cfg.gd" id="1_8tyeo"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_8tyeo")
|
||||
name = "飞刀"
|
||||
type = 0
|
||||
@ -1,8 +1,8 @@
|
||||
[gd_resource type="Resource" script_class="CoreCfg" load_steps=2 format=3 uid="uid://djwu1qw3irbmj"]
|
||||
|
||||
[ext_resource type="Script" path="res://script/config/core_cfg.gd" id="2_glcvn"]
|
||||
[ext_resource type="Script" uid="uid://coj1fx00rq7ad" path="res://script/config/core_cfg.gd" id="2_glcvn"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("2_glcvn")
|
||||
name = ""
|
||||
type = 2
|
||||
name = "幽冥前斩"
|
||||
type = 0
|
||||
|
||||
@ -1,8 +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"]
|
||||
[ext_resource type="Script" uid="uid://coj1fx00rq7ad" path="res://script/config/core_cfg.gd" id="1_gjabn"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_gjabn")
|
||||
name = ""
|
||||
type = 2
|
||||
type = 0
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
[gd_resource type="Resource" script_class="CoreCfg" load_steps=2 format=3 uid="uid://duhgn52hssk87"]
|
||||
|
||||
[ext_resource type="Script" path="res://script/config/core_cfg.gd" id="1_e8a6y"]
|
||||
[ext_resource type="Script" uid="uid://coj1fx00rq7ad" path="res://script/config/core_cfg.gd" id="1_e8a6y"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_e8a6y")
|
||||
name = ""
|
||||
type = 2
|
||||
type = 0
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
[gd_resource type="Resource" script_class="CoreCfg" load_steps=2 format=3 uid="uid://b63634fi2nms7"]
|
||||
|
||||
[ext_resource type="Script" path="res://script/config/core_cfg.gd" id="1_grj3e"]
|
||||
[ext_resource type="Script" uid="uid://coj1fx00rq7ad" path="res://script/config/core_cfg.gd" id="1_grj3e"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_grj3e")
|
||||
name = ""
|
||||
type = 2
|
||||
type = 0
|
||||
|
||||
@ -0,0 +1,26 @@
|
||||
[gd_resource type="Resource" script_class="SkillCfg" load_steps=3 format=3 uid="uid://cu7gfnnd8tnr5"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://ch4gg7uuu2e2t" path="res://script/config/skill_cfg.gd" id="1_lqrjn"]
|
||||
[ext_resource type="Resource" uid="uid://d3mafsovw1mko" path="res://config/character/bullet_hero01_soul_hit01.tres" id="2_kbhp2"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_lqrjn")
|
||||
name = ""
|
||||
sub_character = ExtResource("2_kbhp2")
|
||||
sub_character_count = 5
|
||||
stance_from = 102
|
||||
stance_to = 10
|
||||
break_level = 3
|
||||
is_charging = false
|
||||
attack1_with_stop = false
|
||||
attack2_with_stop = false
|
||||
mp_cost = 0
|
||||
mp_sub_cost = false
|
||||
free_lock = false
|
||||
ignore_push = false
|
||||
is_lock_x = true
|
||||
is_lock_x_move = false
|
||||
range = 0.0
|
||||
warn_type = 0
|
||||
animation_name = "none"
|
||||
metadata/_custom_type_script = "uid://ch4gg7uuu2e2t"
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 298 B |
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://0put8pscss6d"
|
||||
path="res://.godot/imported/skill_name.png-15df19a8efce6cb164432127956234b7.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://resource/ui/hud/skill_name.png"
|
||||
dest_files=["res://.godot/imported/skill_name.png-15df19a8efce6cb164432127956234b7.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
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bu2p3a8yq81u5"
|
||||
path="res://.godot/imported/input_map.png-8f073892bafd2b49ac15ed7f5abb24e6.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://resource/ui/icon/input/input_map.png"
|
||||
dest_files=["res://.godot/imported/input_map.png-8f073892bafd2b49ac15ed7f5abb24e6.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
|
||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,12 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://cvx8f4p2kkp8c"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://bu2p3a8yq81u5" path="res://resource/ui/icon/input/input_map.png" id="1_qs2yt"]
|
||||
[ext_resource type="Script" uid="uid://dbpn6lf5gryog" path="res://script/ui/hud/input_item.gd" id="2_xmd72"]
|
||||
|
||||
[node name="InputItem" type="Sprite2D"]
|
||||
modulate = Color(1, 1, 1, 0)
|
||||
texture = ExtResource("1_qs2yt")
|
||||
hframes = 12
|
||||
vframes = 7
|
||||
script = ExtResource("2_xmd72")
|
||||
metadata/_custom_type_script = "uid://dbpn6lf5gryog"
|
||||
@ -1,29 +1,80 @@
|
||||
@tool
|
||||
extends Control
|
||||
|
||||
@onready var core_item_list: Array[Variant] = [
|
||||
@onready var core_item_list: Array[CoreItemSub] = [
|
||||
$CoreItemFree/Up, $CoreItemFree/Left, $CoreItemFree/Down, $CoreItemFree/Right,
|
||||
$CoreItemLock/Up, $CoreItemLock/Left, $CoreItemLock/Down, $CoreItemLock/Right,
|
||||
]
|
||||
@onready var core_item_input_list: Array[InputItem] = [
|
||||
$CoreItemInput/Up, $CoreItemInput/Left, $CoreItemInput/Down, $CoreItemInput/Right,
|
||||
]
|
||||
|
||||
@onready var core_item_free: Control = $CoreItemFree
|
||||
@onready var core_item_lock: Control = $CoreItemLock
|
||||
|
||||
@export var is_switch: bool:
|
||||
set(value):
|
||||
is_switch = value
|
||||
is_switch_animation = true
|
||||
|
||||
@export var is_lock: bool:
|
||||
set(value):
|
||||
is_lock = value
|
||||
core_item_free.visible = not is_lock
|
||||
core_item_lock.visible = is_lock
|
||||
|
||||
@export var switch_animation_time_max: float = 0.1
|
||||
var switch_animation_time: float = 0.0
|
||||
var is_switch_animation: bool
|
||||
|
||||
@export var switch_center_pos1 = Vector2(560, 300)
|
||||
@export var switch_center_pos2 = Vector2(480, 280)
|
||||
var switch_item_pos1 = [
|
||||
Vector2(0, -16), Vector2(-24, 0), Vector2(0, 16), Vector2(24, 0),
|
||||
Vector2(0, -16), Vector2(-24, 0), Vector2(0, 16), Vector2(24, 0),
|
||||
]
|
||||
var switch_item_pos2 = [
|
||||
Vector2(0, -32), Vector2(-32, 0), Vector2(0, 32), Vector2(32, 0),
|
||||
Vector2(0, -32), Vector2(-32, 0), Vector2(0, 32), Vector2(32, 0),
|
||||
]
|
||||
var core_item_input_pos1 = Vector2(0, 0)
|
||||
var core_item_input_pos2 = [
|
||||
Vector2(0, -16), Vector2(-16, 0), Vector2(0, 16), Vector2(16, 0),
|
||||
]
|
||||
|
||||
func _process(delta):
|
||||
if not is_switch_animation:
|
||||
return
|
||||
switch_animation_time += delta if is_switch else -delta
|
||||
switch_animation_time = max(0, min(switch_animation_time, switch_animation_time_max))
|
||||
var rate = switch_animation_time / switch_animation_time_max
|
||||
animation_lerp(rate)
|
||||
|
||||
if switch_animation_time == switch_animation_time_max or switch_animation_time == 0:
|
||||
is_switch_animation = false
|
||||
|
||||
|
||||
func on_core_active_list_changed(core_list: Array[CoreCfg]):
|
||||
for i in range(len(core_list)):
|
||||
var cfg: CoreCfg = core_list[i]
|
||||
var cfg: CoreCfg = core_list[i]
|
||||
var item: CoreItemSub = core_item_list[i] as CoreItemSub
|
||||
if cfg:
|
||||
item.set_icon(cfg.get_icon())
|
||||
else:
|
||||
item.set_icon(null)
|
||||
item.set_info(cfg)
|
||||
|
||||
|
||||
func on_is_switch_changed(value: bool):
|
||||
visible = value
|
||||
is_switch = value
|
||||
|
||||
|
||||
func on_is_lock_changed(isLock: bool):
|
||||
core_item_free.visible = !isLock
|
||||
core_item_lock.visible = isLock
|
||||
func on_is_lock_changed(value: bool):
|
||||
is_lock = value
|
||||
|
||||
func animation_lerp(rate: float):
|
||||
position = lerp(switch_center_pos1, switch_center_pos2, rate)
|
||||
for i in len(core_item_list):
|
||||
var item: CoreItemSub = core_item_list[i] as CoreItemSub
|
||||
item.position = lerp(switch_item_pos1[i], switch_item_pos2[i], rate)
|
||||
item.detail_rate = rate
|
||||
for i in len(core_item_input_list):
|
||||
var item: InputItem = core_item_input_list[i] as InputItem
|
||||
item.position = lerp(core_item_input_pos1, core_item_input_pos2[i], rate)
|
||||
item.detail_rate = rate
|
||||
|
||||
@ -1,13 +1,63 @@
|
||||
@tool
|
||||
extends Control
|
||||
class_name CoreItemSub
|
||||
|
||||
@onready var mp_scene: PackedScene = preload("res://scene/ui/item/mp_item.tscn")
|
||||
|
||||
@export var is_right: bool:
|
||||
set(value):
|
||||
is_right = value
|
||||
$CoreNameLeft.visible = not value
|
||||
$CoreNameRight.visible = value
|
||||
|
||||
@export var detail_rate: float:
|
||||
set(value):
|
||||
detail_rate = value
|
||||
var panel_left = $CoreNameLeft/CoreNamePanelLeft as TextureRect
|
||||
var panel_right = $CoreNameRight/CoreNamePanelRight as TextureRect
|
||||
var label_left = $CoreNameLeft/CoreNameLabelLeft as Label
|
||||
var label_right = $CoreNameRight/CoreNameLabelRight as Label
|
||||
var mp_list_left = $CoreNameLeft/CoreMpCostLeft as HBoxContainer
|
||||
var mp_list_right = $CoreNameRight/CoreMpCostRight as HBoxContainer
|
||||
panel_left.modulate.a = value
|
||||
panel_right.modulate.a = value
|
||||
label_left.modulate.a = value
|
||||
label_right.modulate.a = value
|
||||
mp_list_left.modulate.a = value
|
||||
mp_list_right.modulate.a = value
|
||||
|
||||
@onready var icon: TextureRect = $CoreIcon as TextureRect
|
||||
@onready var slot: TextureRect = $CoreSlot as TextureRect
|
||||
@onready var icon_empty: Texture2D = load("res://resource/ui/icon/core/empty.png") as Texture2D
|
||||
|
||||
|
||||
func set_icon(value: Texture2D):
|
||||
if value:
|
||||
icon.texture = value
|
||||
else:
|
||||
func set_info(cfg: CoreCfg):
|
||||
var label_left = $CoreNameLeft/CoreNameLabelLeft as Label
|
||||
var label_right = $CoreNameRight/CoreNameLabelRight as Label
|
||||
var mp_list_left = $CoreNameLeft/CoreMpCostLeft as HBoxContainer
|
||||
var mp_list_right = $CoreNameRight/CoreMpCostRight as HBoxContainer
|
||||
if not cfg:
|
||||
icon.texture = icon_empty
|
||||
label_left.text = "-"
|
||||
label_right.text = "-"
|
||||
set_mp_cost(mp_list_left, 0)
|
||||
set_mp_cost(mp_list_right, 0)
|
||||
else:
|
||||
icon.texture = cfg.get_icon()
|
||||
label_left.text = cfg.name
|
||||
label_right.text = cfg.name
|
||||
set_mp_cost(mp_list_left, cfg.get_mp_cost())
|
||||
set_mp_cost(mp_list_right, cfg.get_mp_cost())
|
||||
|
||||
|
||||
func set_mp_cost(mp_list: HBoxContainer, value: int):
|
||||
for child in mp_list.get_children():
|
||||
child.queue_free()
|
||||
if value == 0:
|
||||
var mp_item: MpItemSub = mp_scene.instantiate() as MpItemSub
|
||||
mp_list.add_child(mp_item)
|
||||
mp_item.set_active(false)
|
||||
else:
|
||||
for i in range(value):
|
||||
var mp_item: MpItemSub = mp_scene.instantiate() as MpItemSub
|
||||
mp_list.add_child(mp_item)
|
||||
|
||||
@ -0,0 +1,9 @@
|
||||
@tool
|
||||
extends Sprite2D
|
||||
class_name InputItem
|
||||
|
||||
|
||||
@export var detail_rate: float:
|
||||
set(value):
|
||||
detail_rate = value
|
||||
modulate.a = value
|
||||
@ -0,0 +1 @@
|
||||
uid://dbpn6lf5gryog
|
||||
Loading…
Reference in New Issue