mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
feat(武器): 添加大激光武器并更新武器卡组件
实现大激光武器功能,包括攻击逻辑和属性配置 将武器卡的选择按钮重命名为更新按钮以更准确反映功能 调整武器卡描述文本居中显示并更新能量消耗数值
This commit is contained in:
@@ -34,7 +34,7 @@ layout_mode = 2
|
||||
theme_override_constants/separation = 10
|
||||
alignment = 1
|
||||
|
||||
[node name="selectBtn" type="Button" parent="container"]
|
||||
[node name="updateBtn" type="Button" parent="container"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
theme = ExtResource("2_fwkd3")
|
||||
@@ -82,7 +82,7 @@ quality = 1
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
bbcode_enabled = true
|
||||
text = "造成[color=cyan]10.0[/color]点伤害。"
|
||||
text = "[center]造成[color=cyan]10.0[/color]点伤害。[/center]"
|
||||
fit_content = true
|
||||
|
||||
[node name="costs" type="GridContainer" parent="container"]
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://cxabqjo7skxev"]
|
||||
[gd_scene load_steps=4 format=3 uid="uid://cxabqjo7skxev"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://ckq2cq6m23hq3" path="res://components/Abstracts/WeaponCardBase.tscn" id="1_wrvv5"]
|
||||
[ext_resource type="Script" path="res://scripts/Contents/Weapons/BigLaser.gd" id="2_gmch0"]
|
||||
[ext_resource type="Texture2D" uid="uid://dy4op6n6vxef3" path="res://resources/bullets/laser-circle/circle.svg" id="2_qe8gb"]
|
||||
|
||||
[node name="BigLaser" instance=ExtResource("1_wrvv5")]
|
||||
script = ExtResource("2_gmch0")
|
||||
avatarTexture = ExtResource("2_qe8gb")
|
||||
displayName = "湮灭激光"
|
||||
quality = 2
|
||||
@@ -16,12 +18,13 @@ store = {
|
||||
}
|
||||
descriptionTemplate = "每$time秒造成$atk点伤害。"
|
||||
needEnergy = 100.0
|
||||
cooldown = 6000.0
|
||||
|
||||
[node name="avatar" parent="container/info" index="0"]
|
||||
texture = ExtResource("2_qe8gb")
|
||||
|
||||
[node name="energy" parent="container/info/energyInfo" index="1"]
|
||||
text = "50.0"
|
||||
text = "100.0"
|
||||
|
||||
[node name="name" parent="container/info" index="2"]
|
||||
displayName = "湮灭激光"
|
||||
@@ -29,4 +32,4 @@ quality = 2
|
||||
typeTopic = 1
|
||||
|
||||
[node name="description" parent="container" index="2"]
|
||||
text = "每[color=cyan]0.1[/color]秒造成[color=cyan]35.0[/color]点伤害。"
|
||||
text = "[center]每[color=cyan]0.1[/color]秒造成[color=cyan]35.0[/color]点伤害。[/center]"
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
extends Weapon
|
||||
class_name BigLaserWeapon
|
||||
|
||||
func update(to: int, origin: Dictionary, _entity: EntityBase):
|
||||
origin["atk"] += 5 * to
|
||||
origin["time"] /= 1.1
|
||||
return origin
|
||||
func attack(entity: EntityBase):
|
||||
var weaponPos = entity.findWeaponAnchor("normal")
|
||||
BulletBase.generate(preload("res://components/Bullets/BigLaser.tscn"), entity, weaponPos, (get_global_mouse_position() - weaponPos).angle())
|
||||
return true
|
||||
@@ -22,12 +22,12 @@ signal selected(applied: bool)
|
||||
@onready var energyLabel: Label = $"%energy"
|
||||
@onready var descriptionLabel: RichTextLabel = $"%description"
|
||||
@onready var costsBox: GridContainer = $"%costs"
|
||||
@onready var selectButton: Button = $"%selectBtn"
|
||||
@onready var updateButton: Button = $"%updateBtn"
|
||||
|
||||
var cooldownTimer = CooldownTimer.new()
|
||||
|
||||
func _ready():
|
||||
selectButton.pressed.connect(
|
||||
updateButton.pressed.connect(
|
||||
func():
|
||||
apply(UIState.player)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user