mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-29 23:41:54 +08:00
feat(武器): 重做链式机枪并添加音效
重构链式机枪的子弹生成逻辑,降低散射衰减系数 添加射击音效资源及导入配置 调整武器属性描述和数值 移除测试用的调试代码
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
[gd_scene load_steps=12 format=3 uid="uid://bm7ymrri6pykb"]
|
||||
[gd_scene load_steps=13 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="PackedScene" uid="uid://c0n3igy4hucrg" path="res://components/Weapons/PurpleCrystal.tscn" id="3_s7kxe"]
|
||||
[ext_resource type="PackedScene" uid="uid://dlaks67h2osms" path="res://components/Weapons/ChainGun.tscn" id="3_s7kxe"]
|
||||
[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"]
|
||||
[ext_resource type="AudioStream" uid="uid://dmxh3bpk8vyy5" path="res://resources/sounds/effect/Coin.mp3" id="5_xnbhq"]
|
||||
[ext_resource type="AudioStream" uid="uid://4wuuf1osk0yv" path="res://resources/sounds/effect/Low Boing.wav" id="6_m5px1"]
|
||||
[ext_resource type="Texture2D" uid="uid://x7ic6wm22jv4" path="res://resources/characters/cock/rooster.png" id="11_joj4g"]
|
||||
[ext_resource type="Texture2D" uid="uid://fn8qx72clh38" path="res://resources/characters/cock/rooster-a.svg" id="8_da2ca"]
|
||||
[ext_resource type="Texture2D" uid="uid://ci2ik43ce82uy" path="res://resources/characters/cock/rooster-b.svg" id="9_0omr3"]
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_4v2ol"]
|
||||
animations = [{
|
||||
@@ -26,7 +27,7 @@ animations = [{
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("11_joj4g")
|
||||
"texture": ExtResource("8_da2ca")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"idle",
|
||||
@@ -34,7 +35,10 @@ animations = [{
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("11_joj4g")
|
||||
"texture": ExtResource("8_da2ca")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("9_0omr3")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"walk",
|
||||
@@ -54,7 +58,7 @@ metadata/_edit_vertical_guides_ = [71.0]
|
||||
[node name="weaponStore" parent="." index="1"]
|
||||
process_mode = 4
|
||||
|
||||
[node name="PurpleCrystal" parent="weaponStore" index="0" instance=ExtResource("3_s7kxe")]
|
||||
[node name="ChainGun" parent="weaponStore" index="0" instance=ExtResource("3_s7kxe")]
|
||||
debugRebuild = false
|
||||
|
||||
[node name="sprint" parent="sounds" index="0"]
|
||||
@@ -70,15 +74,14 @@ stream = ExtResource("5_xnbhq")
|
||||
stream = ExtResource("6_m5px1")
|
||||
|
||||
[node name="texture" parent="." index="3"]
|
||||
position = Vector2(0, -70)
|
||||
position = Vector2(0, -47)
|
||||
sprite_frames = SubResource("SpriteFrames_4v2ol")
|
||||
animation = &"walk"
|
||||
|
||||
[node name="staticAnimation" parent="texture" index="1"]
|
||||
position = Vector2(0, -24)
|
||||
scale = Vector2(0.32309517, 0.32309517)
|
||||
sprite_frames = SubResource("SpriteFrames_jluqw")
|
||||
animation = &"walk"
|
||||
animation = &"idle"
|
||||
|
||||
[node name="hitbox" parent="texture/hurtbox" index="0"]
|
||||
position = Vector2(8, -28)
|
||||
@@ -88,5 +91,5 @@ shape = SubResource("CircleShape2D_h1v0q")
|
||||
position = Vector2(54, -45)
|
||||
|
||||
[node name="statebar" parent="." index="4" node_paths=PackedStringArray("entity")]
|
||||
position = Vector2(0, -202)
|
||||
position = Vector2(0, -150)
|
||||
entity = NodePath("..")
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://dlaks67h2osms"]
|
||||
[gd_scene load_steps=5 format=3 uid="uid://dlaks67h2osms"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://ckq2cq6m23hq3" path="res://components/Abstracts/WeaponCardBase.tscn" id="1_x1nyl"]
|
||||
[ext_resource type="Texture2D" uid="uid://ccxdfsg5071t4" path="res://resources/bullets/chain-gun/Chain_Gun.webp" id="2_ghn43"]
|
||||
[ext_resource type="Script" uid="uid://dev0urlc13rxc" path="res://scripts/Contents/Weapons/ChainGun.gd" id="2_ponmu"]
|
||||
[ext_resource type="AudioStream" uid="uid://bdcyao3e6xs63" path="res://resources/sounds/effect/chainshoot.wav" id="4_g38si"]
|
||||
|
||||
[node name="ChainGun" instance=ExtResource("1_x1nyl")]
|
||||
script = ExtResource("2_ponmu")
|
||||
@@ -12,22 +13,26 @@ costBeachball = 400
|
||||
store = {
|
||||
"atk": 3,
|
||||
"count": 1,
|
||||
"split": 30
|
||||
"split": 15
|
||||
}
|
||||
storeType = {
|
||||
"atk": 1,
|
||||
"count": 1,
|
||||
"split": 1
|
||||
"split": 3
|
||||
}
|
||||
descriptionTemplate = "以$split单位的间隔发射$count个[b]微型水晶[/b],可造成$atk点伤害。"
|
||||
needEnergy = 1.0
|
||||
cooldown = 50.0
|
||||
descriptionTemplate = "超高速发射$count个[b]微型水晶[/b],可造成$atk点伤害,散射+$split。"
|
||||
needEnergy = 0.75
|
||||
cooldown = 66.0
|
||||
debugRebuild = true
|
||||
|
||||
[node name="attack" parent="sounds" index="0"]
|
||||
stream = ExtResource("4_g38si")
|
||||
|
||||
[node name="avatar" parent="container/info" index="0"]
|
||||
texture = ExtResource("2_ghn43")
|
||||
|
||||
[node name="energy" parent="container/info/infos/energyInfo" index="1"]
|
||||
text = "1.0"
|
||||
text = "0.8"
|
||||
|
||||
[node name="beachball" parent="container/info/infos" index="1"]
|
||||
count = 400
|
||||
@@ -36,4 +41,4 @@ count = 400
|
||||
displayName = "链式机枪"
|
||||
|
||||
[node name="description" parent="container" index="2"]
|
||||
text = "[center]以[color=cyan]30[/color]单位的间隔发射[color=cyan]1[/color]个[b]微型水晶[/b],可造成[color=cyan]3[/color]点伤害。[/center]"
|
||||
text = "[center]超高速发射[color=cyan]1[/color]个[b]微型水晶[/b],可造成[color=cyan]3[/color]点伤害,散射+[color=cyan]15.0°[/color]。[/center]"
|
||||
|
||||
@@ -19,6 +19,7 @@ config/icon="res://icon.svg"
|
||||
|
||||
window/size/viewport_width=1280
|
||||
window/size/viewport_height=720
|
||||
window/size/mode=2
|
||||
|
||||
[dotnet]
|
||||
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,24 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://bdcyao3e6xs63"
|
||||
path="res://.godot/imported/chainshoot.wav-a0d7629f12757fe65a40d82f1ed87019.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://resources/sounds/effect/chainshoot.wav"
|
||||
dest_files=["res://.godot/imported/chainshoot.wav-a0d7629f12757fe65a40d82f1ed87019.sample"]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=false
|
||||
edit/normalize=false
|
||||
edit/loop_mode=0
|
||||
edit/loop_begin=0
|
||||
edit/loop_end=-1
|
||||
compress/mode=2
|
||||
@@ -1,16 +1,21 @@
|
||||
extends BulletBase
|
||||
|
||||
var count: int = 1
|
||||
var splits: float = 10.0
|
||||
var count: int = 0
|
||||
var splits: float = 0
|
||||
|
||||
@onready var anchor: Node2D = $"%anchor"
|
||||
|
||||
func spawn():
|
||||
for j in count:
|
||||
for i in BulletBase.generate(ComponentManager.getBullet("PurpleCrystalSmall"), launcher, anchor.global_position, rotation):
|
||||
for i in BulletBase.generate(
|
||||
ComponentManager.getBullet("PurpleCrystalSmall"),
|
||||
launcher,
|
||||
anchor.global_position,
|
||||
rotation + deg_to_rad(splits * randf_range(-1, 1))
|
||||
):
|
||||
if i is BulletBase:
|
||||
var dir = Vector2.from_angle(i.rotation).rotated(deg_to_rad(-90))
|
||||
i.baseDamage = baseDamage
|
||||
i.position += dir * (count - j * 2) * splits / 2
|
||||
i.position += dir * (count - j * 2) * 10 / 2
|
||||
func ai():
|
||||
PresetBulletAI.lockLauncher(self, launcher, true)
|
||||
|
||||
@@ -27,7 +27,8 @@ func generateShadow():
|
||||
launcher,
|
||||
position,
|
||||
startAngle + i * deg_to_rad(splitAngle),
|
||||
false, false, true, true
|
||||
true,
|
||||
true
|
||||
):
|
||||
if bullet is VolcanoShadow:
|
||||
bullet.baseDamage = baseDamage * dmg5
|
||||
|
||||
@@ -11,8 +11,10 @@ func register():
|
||||
elif bullet is FoxZhua:
|
||||
EffectController.create(ComponentManager.getEffect("BloodFall"), texture.global_position).shot()
|
||||
)
|
||||
if !WorldManager.isRelease():
|
||||
fields[FieldStore.Entity.BULLET_REFRACTION] = 3
|
||||
# if !WorldManager.isRelease():
|
||||
# fields[FieldStore.Entity.BULLET_REFRACTION] = 3
|
||||
# fields[FieldStore.Entity.BULLET_SPLIT] = 3
|
||||
# fields[FieldStore.Entity.EXTRA_BULLET_COUNT] = 3
|
||||
func ai():
|
||||
texture.play("walk")
|
||||
var direction = Vector2(
|
||||
|
||||
@@ -4,7 +4,7 @@ extends Weapon
|
||||
func update(to, origin, _entity):
|
||||
origin["atk"] += 2 * to * soulLevel
|
||||
origin["count"] = 1 * soulLevel
|
||||
origin["split"] /= 1 + 0.05 * to * soulLevel
|
||||
origin["split"] /= 1 + 0.005 * to * soulLevel
|
||||
return origin
|
||||
func attack(entity: EntityBase):
|
||||
for i in BulletBase.generate(ComponentManager.getBullet("ChainGun"), entity, entity.texture.global_position, (get_global_mouse_position() - entity.texture.global_position).angle()):
|
||||
@@ -12,3 +12,4 @@ func attack(entity: EntityBase):
|
||||
i.baseDamage = readStore("atk")
|
||||
i.count = floor(readStore("count"))
|
||||
i.splits = readStore("split")
|
||||
return true
|
||||
|
||||
@@ -16,7 +16,7 @@ func attack(entity: EntityBase):
|
||||
ComponentManager.getBullet("Volcano"),
|
||||
entity,
|
||||
entity.findWeaponAnchor("normal"),
|
||||
entity.position.angle_to_point(entity.get_global_mouse_position()), false, false, true, true
|
||||
entity.position.angle_to_point(entity.get_global_mouse_position()), true, true
|
||||
):
|
||||
var bullet: Volcano = j
|
||||
bullet.baseDamage = readStore("atk")
|
||||
|
||||
@@ -30,8 +30,7 @@ var parent: BulletBase = null
|
||||
var spawnInWhen: float = 0
|
||||
var spawnInWhere: Vector2 = Vector2.ZERO
|
||||
var destroying: bool = false
|
||||
var isChildSplit: bool = false
|
||||
var isChildRefract: bool = false
|
||||
var canDuplicateSelf: bool = true
|
||||
var initialSpeed: float = 0
|
||||
var initialDamage: float = 0
|
||||
var speedScale: float = 1
|
||||
@@ -144,19 +143,19 @@ func tryDestroy(becauseMap: bool = false):
|
||||
await animator.animation_finished
|
||||
queue_free()
|
||||
func trySplit():
|
||||
if is_instance_valid(launcher) and !isChildSplit:
|
||||
if is_instance_valid(launcher) and canDuplicateSelf:
|
||||
var value = launcher.fields.get(FieldStore.Entity.BULLET_SPLIT)
|
||||
var total = MathTool.shrimpRate(value)
|
||||
var last = value - floor(value)
|
||||
for i in total:
|
||||
var cloned = duplicate() as BulletBase
|
||||
cloned.rotation = deg_to_rad(360.0 / total * i)
|
||||
cloned.isChildSplit = true
|
||||
cloned.rotation += deg_to_rad(360.0 / total * i + 180)
|
||||
cloned.canDuplicateSelf = false
|
||||
cloned.launcher = launcher
|
||||
cloned.parent = parent
|
||||
get_parent().add_child.call_deferred(split(cloned, i, total, last))
|
||||
func tryRefract():
|
||||
if is_instance_valid(launcher) and !isChildRefract:
|
||||
if is_instance_valid(launcher) and canDuplicateSelf:
|
||||
var value = launcher.fields.get(FieldStore.Entity.BULLET_REFRACTION)
|
||||
var total = MathTool.shrimpRate(value)
|
||||
var last = value - floor(value)
|
||||
@@ -172,7 +171,7 @@ func tryRefract():
|
||||
aimed.append(entity)
|
||||
var cloned = duplicate() as BulletBase
|
||||
cloned.look_at(entity.position)
|
||||
cloned.isChildRefract = true
|
||||
cloned.canDuplicateSelf = false
|
||||
cloned.launcher = launcher
|
||||
cloned.parent = parent
|
||||
get_parent().add_child.call_deferred(refract(cloned, entity, i, total, last))
|
||||
@@ -202,8 +201,6 @@ static func generate(
|
||||
launchBy: EntityBase,
|
||||
spawnPosition: Vector2,
|
||||
spawnRotation: float,
|
||||
asChildSplit: bool = false,
|
||||
asChildRefract: bool = false,
|
||||
addToWorld: bool = true,
|
||||
ignoreOffset: bool = false
|
||||
):
|
||||
@@ -212,8 +209,6 @@ static func generate(
|
||||
var instances = []
|
||||
for i in range(count):
|
||||
var instance: BulletBase = bullet.instantiate()
|
||||
instance.isChildSplit = asChildSplit
|
||||
instance.isChildRefract = asChildRefract
|
||||
instance.launcher = launchBy
|
||||
instance.position = spawnPosition
|
||||
instance.rotation = spawnRotation + deg_to_rad(launchBy.fields.get(FieldStore.Entity.OFFSET_SHOOT) * randf_range(-1, 1) * int(!ignoreOffset))
|
||||
|
||||
@@ -338,7 +338,7 @@ func tryDie(by: BulletBase = null):
|
||||
var item = drops[drop]
|
||||
var count = ceil(randf_range(dropCounts[drop].x, dropCounts[drop].y))
|
||||
for i in range(count):
|
||||
ItemDropped.generate(item, randi_range(1, 3 * round(sqrt(GameRule.difficulty - GameRule.difficultyRange.x + 1))), position + MathTool.randomVector2In(GameRule.itemDroppedSpawnOffset))
|
||||
ItemDropped.generate(item, randi_range(1, round(2.5 * sqrt(GameRule.difficulty - GameRule.difficultyRange.x + 1))), position + MathTool.randomVector2In(GameRule.itemDroppedSpawnOffset))
|
||||
if MathTool.rate(
|
||||
GameRule.appleDropRate +
|
||||
by.launcher.fields.get(FieldStore.Entity.DROP_APPLE_RATE) +
|
||||
|
||||
Reference in New Issue
Block a user