1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-27 22:41:56 +08:00

feat(武器): 添加火山武器及其子弹逻辑

实现火山武器系统,包括:
1. 添加火山武器场景和脚本,支持旋转子弹和伤害计算
2. 新增子弹自旋转AI预设
3. 为公鸡角色添加火山武器配置
4. 实现武器升级效果随灵魂等级提升
This commit is contained in:
2025-11-15 19:33:10 +08:00
parent b8031d31d9
commit 5570cc97a2
8 changed files with 104 additions and 5 deletions
+25
View File
@@ -0,0 +1,25 @@
[gd_scene load_steps=5 format=3 uid="uid://8uepi7uql314"]
[ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_gd3m7"]
[ext_resource type="Script" uid="uid://ci5hswfhck5as" path="res://scripts/Contents/Bullets/Volcano.gd" id="2_w1utg"]
[ext_resource type="Texture2D" uid="uid://ctmxadaowx5ps" path="res://resources/weapons/Volcano.webp" id="2_wwxm2"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_w1utg"]
size = Vector2(113, 34)
[node name="Volcano" instance=ExtResource("1_gd3m7")]
script = ExtResource("2_w1utg")
penerate = 1.0
lifeTime = 6000.0
[node name="anchor" type="Node2D" parent="texture" index="1"]
[node name="texture" type="Sprite2D" parent="texture/anchor" index="0"]
position = Vector2(150, 0)
rotation = 0.7853982
scale = Vector2(1.5, 1.5)
texture = ExtResource("2_wwxm2")
[node name="hitbox" parent="." index="1"]
position = Vector2(167.5, 0)
shape = SubResource("RectangleShape2D_w1utg")
+12 -5
View File
@@ -1,10 +1,11 @@
[gd_scene load_steps=14 format=3 uid="uid://bm7ymrri6pykb"]
[gd_scene load_steps=15 format=3 uid="uid://bm7ymrri6pykb"]
[ext_resource type="PackedScene" uid="uid://cvogxi7mktumf" path="res://components/Abstracts/EntityBase.tscn" id="1_e5pl8"]
[ext_resource type="Script" uid="uid://cthtupc6dtbav" path="res://scripts/Contents/Characters/Rooster.gd" id="2_oqdqd"]
[ext_resource type="Texture2D" uid="uid://fn8qx72clh38" path="res://resources/characters/cock/rooster-a.svg" id="2_q0j6j"]
[ext_resource type="AudioStream" uid="uid://dclinyhu256xi" path="res://resources/sounds/effect/Low Whoosh.mp3" id="3_4syso"]
[ext_resource type="Texture2D" uid="uid://ci2ik43ce82uy" path="res://resources/characters/cock/rooster-b.svg" id="3_b0fgx"]
[ext_resource type="PackedScene" uid="uid://u0djqwuuysp8" path="res://components/Weapons/Volcano.tscn" id="3_fkh3f"]
[ext_resource type="PackedScene" uid="uid://c0n3igy4hucrg" path="res://components/Weapons/PurpleCrystal.tscn" id="3_jluqw"]
[ext_resource type="AudioStream" uid="uid://cdrevrq7n6yqa" path="res://resources/sounds/effect/Boing.mp3" id="4_66s6c"]
[ext_resource type="AudioStream" uid="uid://benyec5bqni0b" path="res://resources/sounds/effect/Chomp.wav" id="4_k0yme"]
@@ -40,11 +41,17 @@ radius = 41.0122
[node name="Rooster" instance=ExtResource("1_e5pl8")]
script = ExtResource("2_oqdqd")
displayName = "公鸡"
metadata/_edit_horizontal_guides_ = [-139.0]
metadata/_edit_vertical_guides_ = [58.0]
[node name="weaponStore" parent="." index="0"]
[node name="weaponStore" parent="." index="1"]
process_mode = 4
[node name="PurpleCrystal" parent="weaponStore" index="0" instance=ExtResource("3_jluqw")]
[node name="Volcano" parent="weaponStore" index="0" instance=ExtResource("3_fkh3f")]
offset_bottom = 374.0
debugRebuild = false
[node name="PurpleCrystal" parent="weaponStore" index="1" instance=ExtResource("3_jluqw")]
offset_bottom = 350.0
debugRebuild = false
@@ -66,7 +73,7 @@ stream = ExtResource("8_7dhim")
[node name="attack0" parent="sounds" index="6"]
stream = ExtResource("3_4syso")
[node name="texture" parent="." index="2"]
[node name="texture" parent="." index="3"]
position = Vector2(0, -70)
sprite_frames = SubResource("SpriteFrames_4v2ol")
animation = &"walk"
@@ -78,6 +85,6 @@ shape = SubResource("CircleShape2D_h1v0q")
[node name="normal" type="Node2D" parent="texture/weapons" index="0"]
position = Vector2(54, -45)
[node name="statebar" parent="." index="3" node_paths=PackedStringArray("entity")]
[node name="statebar" parent="." index="4" node_paths=PackedStringArray("entity")]
position = Vector2(0, -151)
entity = NodePath("..")
+41
View File
@@ -0,0 +1,41 @@
[gd_scene load_steps=4 format=3 uid="uid://u0djqwuuysp8"]
[ext_resource type="PackedScene" uid="uid://ckq2cq6m23hq3" path="res://components/Abstracts/WeaponCardBase.tscn" id="1_3uhfa"]
[ext_resource type="Texture2D" uid="uid://ctmxadaowx5ps" path="res://resources/weapons/Volcano.webp" id="2_hh01t"]
[ext_resource type="Script" uid="uid://cbihum34xs8ev" path="res://scripts/Contents/Weapons/Volcano.gd" id="2_ihngx"]
[node name="Volcano" instance=ExtResource("1_3uhfa")]
script = ExtResource("2_ihngx")
avatarTexture = ExtResource("2_hh01t")
displayName = "火山"
quality = 3
typeTopic = 2
store = {
"atk": 20,
"count": 2.0,
"rotate": 2.0
}
storeType = {
"atk": 1,
"count": 1,
"rotate": 3
}
descriptionTemplate = "召唤$count支[b]火山[/b],以$rotate的速度旋转,接触时造成$atk点伤害。"
cooldown = 7000.0
[node name="avatar" parent="container/info" index="0"]
texture = ExtResource("2_hh01t")
[node name="beachball" parent="container/info/infos" index="1"]
count = 500
[node name="soul" parent="container/info/infos" index="2"]
count = 1
[node name="name" parent="container/info" index="2"]
displayName = "火山"
quality = 3
typeTopic = 2
[node name="description" parent="container" index="2"]
text = "[center]召唤[color=cyan]2[/color]支[b]火山[/b],以[color=cyan]1.0°[/color]的速度旋转,接触时造成[color=cyan]15[/color]点伤害。[/center]"
+2
View File
@@ -15,3 +15,5 @@ static func trace(bullet: BulletBase, target: Vector2, speed: float):
)
static func faceToMouse(bullet: BulletBase):
bullet.rotation = bullet.position.angle_to_point(bullet.get_global_mouse_position())
static func selfRotate(bullet: BulletBase, speed: float):
bullet.rotation += deg_to_rad(speed)
+8
View File
@@ -0,0 +1,8 @@
extends BulletBase
class_name Volcano
var rotates: float = 0
func ai():
PresetBulletAI.selfRotate(self, rotates)
PresetBulletAI.lockLauncher(self, launcher, true)
+1
View File
@@ -0,0 +1 @@
uid://ci5hswfhck5as
+14
View File
@@ -0,0 +1,14 @@
@tool
extends Weapon
func update(to: int, origin: Dictionary, _entity: EntityBase):
origin["atk"] += 5 * to * soulLevel
origin["count"] += 1 * soulLevel
origin["rotate"] += 0.25 * to * soulLevel
return origin
func attack(entity: EntityBase):
for i in readStore("count"):
for j in BulletBase.generate(ComponentManager.getBullet("Volcano"), entity, entity.findWeaponAnchor("normal"), deg_to_rad(360.0 / readStore("count") * i)):
var bullet: Volcano = j
bullet.damage = readStore("atk")
bullet.rotates = readStore("rotate")
+1
View File
@@ -0,0 +1 @@
uid://cbihum34xs8ev