mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-07-06 18:22:12 +08:00
feat(武器系统): 为红水晶武器添加水晶碎片弹射效果
新增水晶碎片子弹类型,当红水晶爆炸时会向随机方向发射碎片 修改红水晶武器配置,添加碎片数量和伤害百分比属性 更新武器描述以反映新功能
This commit is contained in:
@@ -0,0 +1,26 @@
|
|||||||
|
[gd_scene load_steps=5 format=3 uid="uid://b3anl1y0phmdv"]
|
||||||
|
|
||||||
|
[ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_wqonw"]
|
||||||
|
[ext_resource type="Script" uid="uid://2fv75mmhvjuc" path="res://scripts/Contents/Bullets/CrystalBlock.gd" id="2_42ni1"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://c7hyatbuieaj" path="res://resources/bullets/purple-crystal/frames/0.svg" id="3_ktit7"]
|
||||||
|
|
||||||
|
[sub_resource type="SpriteFrames" id="SpriteFrames_1xf7i"]
|
||||||
|
animations = [{
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("3_ktit7")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"default",
|
||||||
|
"speed": 5.0
|
||||||
|
}]
|
||||||
|
|
||||||
|
[node name="CrystalBlock" instance=ExtResource("1_wqonw")]
|
||||||
|
script = ExtResource("2_42ni1")
|
||||||
|
displayName = "水晶碎块"
|
||||||
|
lifeTime = 1000.0
|
||||||
|
|
||||||
|
[node name="texture" parent="." index="0"]
|
||||||
|
modulate = Color(1.2888849, 0.4489804, 0.4489804, 0.5)
|
||||||
|
scale = Vector2(0.7, 0.7)
|
||||||
|
sprite_frames = SubResource("SpriteFrames_1xf7i")
|
||||||
@@ -12,14 +12,19 @@ displayName = "红水晶簇"
|
|||||||
typeTopic = 1
|
typeTopic = 1
|
||||||
store = {
|
store = {
|
||||||
"atk": 45,
|
"atk": 45,
|
||||||
|
"count": 1,
|
||||||
|
"percent": 0.5,
|
||||||
"radius": 150.0
|
"radius": 150.0
|
||||||
}
|
}
|
||||||
storeType = {
|
storeType = {
|
||||||
"atk": 1,
|
"atk": 1,
|
||||||
|
"count": 1,
|
||||||
|
"percent": 2,
|
||||||
"radius": 1
|
"radius": 1
|
||||||
}
|
}
|
||||||
descriptionTemplate = "发射[b]红水晶[/b],在3秒后以$radius的半径爆炸,造成$atk点伤害。"
|
descriptionTemplate = "发射[b]红水晶[/b],在3秒后以$radius的半径爆炸,造成$atk点伤害并向随机方向发射$count个[b]水晶碎片[/b],造成$percent基础伤害。"
|
||||||
cooldown = 1000.0
|
cooldown = 1000.0
|
||||||
|
debugRebuild = true
|
||||||
|
|
||||||
[node name="attack" parent="sounds" index="0"]
|
[node name="attack" parent="sounds" index="0"]
|
||||||
stream = ExtResource("4_qt0vq")
|
stream = ExtResource("4_qt0vq")
|
||||||
@@ -32,4 +37,4 @@ displayName = "红水晶簇"
|
|||||||
typeTopic = 1
|
typeTopic = 1
|
||||||
|
|
||||||
[node name="description" parent="container" index="2"]
|
[node name="description" parent="container" index="2"]
|
||||||
text = "[center]发射[b]红水晶[/b],在3秒后以[color=cyan]150[/color]的半径爆炸,造成[color=cyan]60[/color]点伤害。[/center]"
|
text = "[center]发射[b]红水晶[/b],在3秒后以[color=cyan]150[/color]的半径爆炸,造成[color=cyan]45[/color]点伤害并向随机方向发射[color=cyan]1[/color]个[b]水晶碎片[/b],造成[color=cyan]50%[/color]基础伤害。[/center]"
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
extends BulletBase
|
||||||
|
class_name CrystalBlockBullet
|
||||||
|
|
||||||
|
func ai():
|
||||||
|
PresetBulletAI.forward(self, rotation)
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
uid://2fv75mmhvjuc
|
||||||
@@ -2,6 +2,7 @@ extends BulletBase
|
|||||||
class_name RedCrystalBullet
|
class_name RedCrystalBullet
|
||||||
|
|
||||||
var radius: float = 0
|
var radius: float = 0
|
||||||
|
var percent: float = 0
|
||||||
|
|
||||||
func register():
|
func register():
|
||||||
hitbox.shape = hitbox.shape.duplicate()
|
hitbox.shape = hitbox.shape.duplicate()
|
||||||
@@ -11,4 +12,7 @@ func ai():
|
|||||||
func destroy(_beacuseMap: bool):
|
func destroy(_beacuseMap: bool):
|
||||||
hitbox.shape.radius = radius
|
hitbox.shape.radius = radius
|
||||||
EffectController.create(ComponentManager.getEffect("RedCrystalExplosion"), global_position).shot()
|
EffectController.create(ComponentManager.getEffect("RedCrystalExplosion"), global_position).shot()
|
||||||
|
for bullet in BulletBase.generate(ComponentManager.getBullet("CrystalBlock"), launcher, position, deg_to_rad(randf_range(0, 360))):
|
||||||
|
if bullet is CrystalBlockBullet:
|
||||||
|
bullet.baseDamage = baseDamage * percent
|
||||||
await TickTool.millseconds(100)
|
await TickTool.millseconds(100)
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ class_name RedCrystalWeapon
|
|||||||
func update(to: int, origin: Dictionary, _entity: EntityBase):
|
func update(to: int, origin: Dictionary, _entity: EntityBase):
|
||||||
origin["atk"] += 5 * to * soulLevel
|
origin["atk"] += 5 * to * soulLevel
|
||||||
origin["radius"] += 1 * to * soulLevel
|
origin["radius"] += 1 * to * soulLevel
|
||||||
|
origin["count"] = 1 * soulLevel
|
||||||
|
origin["percent"] += 0.02 * to * soulLevel
|
||||||
return origin
|
return origin
|
||||||
func attack(entity: EntityBase):
|
func attack(entity: EntityBase):
|
||||||
var weaponPos = entity.findWeaponAnchor("normal")
|
var weaponPos = entity.findWeaponAnchor("normal")
|
||||||
|
|||||||
Reference in New Issue
Block a user