diff --git a/components/Bullets/Volcano.tscn b/components/Bullets/Volcano.tscn index fe50839..e2236ad 100644 --- a/components/Bullets/Volcano.tscn +++ b/components/Bullets/Volcano.tscn @@ -1,8 +1,11 @@ -[gd_scene load_steps=20 format=3 uid="uid://8uepi7uql314"] +[gd_scene load_steps=23 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"] +[ext_resource type="AudioStream" uid="uid://cer3lxbxqw5pq" path="res://resources/sounds/effect/sword1.mp3" id="3_6sp0s"] +[ext_resource type="AudioStream" uid="uid://cfwu55dfgs4bl" path="res://resources/sounds/effect/sword2.mp3" id="4_1sgli"] +[ext_resource type="AudioStream" uid="uid://bm2o8hu7nyqh1" path="res://resources/sounds/effect/sword3.mp3" id="5_b5nxd"] [sub_resource type="Animation" id="Animation_w1utg"] length = 0.001 @@ -97,6 +100,18 @@ tracks/7/keys = { "points": PackedFloat32Array(1, -0.25, 0, 0.25, 0), "times": PackedFloat32Array(0) } +tracks/8/type = "value" +tracks/8/imported = false +tracks/8/enabled = true +tracks/8/path = NodePath("%texture/..:usingDamageMultiplier") +tracks/8/interp = 1 +tracks/8/loop_wrap = true +tracks/8/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [0] +} [sub_resource type="Animation" id="Animation_oinqg"] resource_name = "destroy" @@ -218,6 +233,41 @@ tracks/8/keys = { "method": &"generateShadow" }] } +tracks/9/type = "value" +tracks/9/imported = false +tracks/9/enabled = true +tracks/9/path = NodePath("%texture/..:usingDamageMultiplier") +tracks/9/interp = 1 +tracks/9/loop_wrap = true +tracks/9/keys = { +"times": PackedFloat32Array(0, 0.6, 1.2), +"transitions": PackedFloat32Array(1, 1, 1), +"update": 1, +"values": [0, 1, 2] +} +tracks/10/type = "audio" +tracks/10/imported = false +tracks/10/enabled = true +tracks/10/path = NodePath("%textureSword/audio") +tracks/10/interp = 1 +tracks/10/loop_wrap = true +tracks/10/keys = { +"clips": [{ +"end_offset": 0.0, +"start_offset": 0.0, +"stream": ExtResource("3_6sp0s") +}, { +"end_offset": 0.0, +"start_offset": 0.0, +"stream": ExtResource("4_1sgli") +}, { +"end_offset": 0.0, +"start_offset": 0.0, +"stream": ExtResource("5_b5nxd") +}], +"times": PackedFloat32Array(0, 0.6, 1.2) +} +tracks/10/use_blend = true [sub_resource type="AnimationLibrary" id="AnimationLibrary_w1utg"] _data = { @@ -308,6 +358,8 @@ scale = Vector2(0.9999999, 0.9999999) amount = 200 process_material = SubResource("ParticleProcessMaterial_xrrxo") +[node name="audio" type="AudioStreamPlayer2D" parent="texture/anchor/textureSword" index="1"] + [node name="hitbox" parent="." index="1"] position = Vector2(245.25, 0) shape = SubResource("RectangleShape2D_w1utg") diff --git a/components/Weapons/Volcano.tscn b/components/Weapons/Volcano.tscn index 6feef0f..828f525 100644 --- a/components/Weapons/Volcano.tscn +++ b/components/Weapons/Volcano.tscn @@ -15,9 +15,9 @@ costBeachball = 300 store = { "atk": 15.0, "dmg1": 1.0, -"dmg2": 0.5, -"dmg3": 2.0, -"rotate": 0.1 +"dmg2": 0.75, +"dmg3": 3.0, +"rotate": 0.05 } storeType = { "atk": 1, @@ -45,4 +45,4 @@ quality = 4 typeTopic = 2 [node name="description" parent="container" index="2"] -text = "[center]召唤1支[b]火山[/b],以[color=cyan]10%[/color]的效率跟随鼠标指向,进行3段攻击。基础接触伤害为[color=cyan]15[/color],三段造成的伤害分别为[color=cyan]100%[/color],[color=cyan]50%[/color],[color=cyan]200%[/color]。[/center]" +text = "[center]召唤1支[b]火山[/b],以[color=cyan]5%[/color]的效率跟随鼠标指向,进行3段攻击。基础接触伤害为[color=cyan]15[/color],三段造成的伤害分别为[color=cyan]100%[/color],[color=cyan]75%[/color],[color=cyan]300%[/color]。[/center]" diff --git a/resources/sounds/effect/sword1.mp3 b/resources/sounds/effect/sword1.mp3 new file mode 100644 index 0000000..c8fc3a9 Binary files /dev/null and b/resources/sounds/effect/sword1.mp3 differ diff --git a/resources/sounds/effect/sword1.mp3.import b/resources/sounds/effect/sword1.mp3.import new file mode 100644 index 0000000..612af41 --- /dev/null +++ b/resources/sounds/effect/sword1.mp3.import @@ -0,0 +1,19 @@ +[remap] + +importer="mp3" +type="AudioStreamMP3" +uid="uid://cer3lxbxqw5pq" +path="res://.godot/imported/sword1.mp3-348dbff4d27421d2476a13d63c45effb.mp3str" + +[deps] + +source_file="res://resources/sounds/effect/sword1.mp3" +dest_files=["res://.godot/imported/sword1.mp3-348dbff4d27421d2476a13d63c45effb.mp3str"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/resources/sounds/effect/sword2.mp3 b/resources/sounds/effect/sword2.mp3 new file mode 100644 index 0000000..f23ff26 Binary files /dev/null and b/resources/sounds/effect/sword2.mp3 differ diff --git a/resources/sounds/effect/sword2.mp3.import b/resources/sounds/effect/sword2.mp3.import new file mode 100644 index 0000000..a6891f9 --- /dev/null +++ b/resources/sounds/effect/sword2.mp3.import @@ -0,0 +1,19 @@ +[remap] + +importer="mp3" +type="AudioStreamMP3" +uid="uid://cfwu55dfgs4bl" +path="res://.godot/imported/sword2.mp3-768d8bd5124ad729116b92c691ace04c.mp3str" + +[deps] + +source_file="res://resources/sounds/effect/sword2.mp3" +dest_files=["res://.godot/imported/sword2.mp3-768d8bd5124ad729116b92c691ace04c.mp3str"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/resources/sounds/effect/sword3.mp3 b/resources/sounds/effect/sword3.mp3 new file mode 100644 index 0000000..9fb4d43 Binary files /dev/null and b/resources/sounds/effect/sword3.mp3 differ diff --git a/resources/sounds/effect/sword3.mp3.import b/resources/sounds/effect/sword3.mp3.import new file mode 100644 index 0000000..fdfcc49 --- /dev/null +++ b/resources/sounds/effect/sword3.mp3.import @@ -0,0 +1,19 @@ +[remap] + +importer="mp3" +type="AudioStreamMP3" +uid="uid://bm2o8hu7nyqh1" +path="res://.godot/imported/sword3.mp3-9a333562648f03db1b1227875cf2428b.mp3str" + +[deps] + +source_file="res://resources/sounds/effect/sword3.mp3" +dest_files=["res://.godot/imported/sword3.mp3-9a333562648f03db1b1227875cf2428b.mp3str"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/scripts/Contents/Bullets/Arrow.gd b/scripts/Contents/Bullets/Arrow.gd index b4fab87..ee92807 100644 --- a/scripts/Contents/Bullets/Arrow.gd +++ b/scripts/Contents/Bullets/Arrow.gd @@ -18,7 +18,7 @@ func ai(): trail.emitting = true hitbox.disabled = false speed = (1 - lifeDistancePercent()) * initialSpeed - damage = speed * atk + baseDamage = speed * atk PresetBulletAI.forward(self, rotation) if speed < 1: tryDestroy() diff --git a/scripts/Contents/Bullets/BigLaser.gd b/scripts/Contents/Bullets/BigLaser.gd index f0fb79a..5e4c278 100644 --- a/scripts/Contents/Bullets/BigLaser.gd +++ b/scripts/Contents/Bullets/BigLaser.gd @@ -9,7 +9,7 @@ func register(): func spawn(): CameraManager.shake(5000, 100) # 激光会运行5秒(5000毫秒),期间震屏超高强度 CameraManager.playAnimation("bigLaser") - damage *= launcher.fields[FieldStore.Entity.ATTACK_SPEED] + baseDamage *= launcher.fields[FieldStore.Entity.ATTACK_SPEED] func ai(): rotation = lerp_angle(rotation, ((get_global_mouse_position() - position).angle()), 0.1) position = launcher.texture.global_position diff --git a/scripts/Contents/Bullets/BossAttack/Bear/ArrowSeven.gd b/scripts/Contents/Bullets/BossAttack/Bear/ArrowSeven.gd index c65a727..f7043a3 100644 --- a/scripts/Contents/Bullets/BossAttack/Bear/ArrowSeven.gd +++ b/scripts/Contents/Bullets/BossAttack/Bear/ArrowSeven.gd @@ -13,7 +13,7 @@ var forwarded: bool = false func register(): speed = 1 - damage = 1 + baseDamage = 1 func spawn(): myColor = allColor.gradient.sample(randf()) superlight.material = superlight.material.duplicate() diff --git a/scripts/Contents/Bullets/BossAttack/Bear/ForeverRainbow.gd b/scripts/Contents/Bullets/BossAttack/Bear/ForeverRainbow.gd index f676322..06b5dab 100644 --- a/scripts/Contents/Bullets/BossAttack/Bear/ForeverRainbow.gd +++ b/scripts/Contents/Bullets/BossAttack/Bear/ForeverRainbow.gd @@ -5,7 +5,7 @@ extends BulletBase var myColor: Color func register(): - damage = 1 + baseDamage = 1 penerate = 1 func spawn(): myColor = allColor.gradient.sample(randf()) diff --git a/scripts/Contents/Bullets/BossAttack/Bear/LightGun.gd b/scripts/Contents/Bullets/BossAttack/Bear/LightGun.gd index 45fd942..9baf3cd 100644 --- a/scripts/Contents/Bullets/BossAttack/Bear/LightGun.gd +++ b/scripts/Contents/Bullets/BossAttack/Bear/LightGun.gd @@ -10,7 +10,7 @@ extends BulletBase var myColor: Color func register(): speed = 1 - damage = 1 + baseDamage = 1 penerate = 1 func spawn(): myColor = allColor.gradient.sample(randf()) diff --git a/scripts/Contents/Bullets/BossAttack/Bear/SunDance.gd b/scripts/Contents/Bullets/BossAttack/Bear/SunDance.gd index 2f1d8a4..1a538ee 100644 --- a/scripts/Contents/Bullets/BossAttack/Bear/SunDance.gd +++ b/scripts/Contents/Bullets/BossAttack/Bear/SunDance.gd @@ -11,7 +11,7 @@ var myColor: Color func register(): speed = 0 - damage = 1 + baseDamage = 1 penerate = 1 func spawn(): myColor = allColor.gradient.sample(randf()) diff --git a/scripts/Contents/Bullets/BossAttack/KukeMC/HeavyCrystal.gd b/scripts/Contents/Bullets/BossAttack/KukeMC/HeavyCrystal.gd index 30eb496..599e355 100644 --- a/scripts/Contents/Bullets/BossAttack/KukeMC/HeavyCrystal.gd +++ b/scripts/Contents/Bullets/BossAttack/KukeMC/HeavyCrystal.gd @@ -15,5 +15,5 @@ func ai(): track.visible = false hitbox.disabled = false PresetBulletAI.forward(self, rotation) - damage = speed / 5 + baseDamage = speed / 5 speed *= 1.15 diff --git a/scripts/Contents/Bullets/ChainGun.gd b/scripts/Contents/Bullets/ChainGun.gd index 445a144..3b4b537 100644 --- a/scripts/Contents/Bullets/ChainGun.gd +++ b/scripts/Contents/Bullets/ChainGun.gd @@ -8,7 +8,7 @@ var splits: float = 10.0 func spawn(): for j in count: for i in BulletBase.generate(ComponentManager.getBullet("PurpleCrystalSmall"), launcher, anchor.global_position, rotation): - i.damage = damage + i.damage = baseDamage var dir = Vector2.from_angle(i.rotation).rotated(deg_to_rad(-90)) i.global_position += dir * (count - j * 2) * splits / 2 func ai(): diff --git a/scripts/Contents/Bullets/ChickSprint.gd b/scripts/Contents/Bullets/ChickSprint.gd index b33e210..076890f 100644 --- a/scripts/Contents/Bullets/ChickSprint.gd +++ b/scripts/Contents/Bullets/ChickSprint.gd @@ -7,7 +7,7 @@ func register(): speed = 0 penerate = 1 func ai(): - damage = launcher.velocity.length() / 500 * atk + baseDamage = launcher.velocity.length() / 500 * atk PresetBulletAI.lockLauncher(self, launcher, true) if !launcher.sprinting: tryDestroy() diff --git a/scripts/Contents/Bullets/Diamond.gd b/scripts/Contents/Bullets/Diamond.gd index d8c11a1..03f35a6 100644 --- a/scripts/Contents/Bullets/Diamond.gd +++ b/scripts/Contents/Bullets/Diamond.gd @@ -4,7 +4,7 @@ class_name Diamond const traceTime = 1500 func register(): - damage = 2 + baseDamage = 2 func ai(): PresetBulletAI.forward(self, rotation) if timeLived() < traceTime: diff --git a/scripts/Contents/Bullets/Pencil.gd b/scripts/Contents/Bullets/Pencil.gd index ff5dc02..159560b 100644 --- a/scripts/Contents/Bullets/Pencil.gd +++ b/scripts/Contents/Bullets/Pencil.gd @@ -2,7 +2,7 @@ extends BulletBase class_name Pencil func register(): - damage = 20 + baseDamage = 20 func spawn(): await TickTool.millseconds(1000) hitbox.disabled = false diff --git a/scripts/Contents/Bullets/SevenSoul.gd b/scripts/Contents/Bullets/SevenSoul.gd index 5b1ad8d..e431e02 100644 --- a/scripts/Contents/Bullets/SevenSoul.gd +++ b/scripts/Contents/Bullets/SevenSoul.gd @@ -20,7 +20,7 @@ func register(): func(area): var bullet = BulletTool.fromArea(area) if bullet and BulletTool.canDamage(bullet, launcher): - launcher.storeEnergy(damage * 2) + launcher.storeEnergy(baseDamage * 2) ) func spawn(): modulate = Color(colors[index % colors.size()]) diff --git a/scripts/Contents/Bullets/Star.gd b/scripts/Contents/Bullets/Star.gd index d50bd5d..9a99081 100644 --- a/scripts/Contents/Bullets/Star.gd +++ b/scripts/Contents/Bullets/Star.gd @@ -2,6 +2,6 @@ extends BulletBase class_name Star func register(): - damage = 1 + baseDamage = 1 func ai(): PresetBulletAI.forward(self, rotation) diff --git a/scripts/Contents/Bullets/Volcano.gd b/scripts/Contents/Bullets/Volcano.gd index c02c413..5b47ad6 100644 --- a/scripts/Contents/Bullets/Volcano.gd +++ b/scripts/Contents/Bullets/Volcano.gd @@ -25,4 +25,4 @@ func generateShadow(): false, false, true, true ): if i is VolcanoShadow: - i.damage = damage + i.baseDamage = baseDamage diff --git a/scripts/Contents/Weapons/BigLaser.gd b/scripts/Contents/Weapons/BigLaser.gd index 5c34ad5..d43fa9a 100644 --- a/scripts/Contents/Weapons/BigLaser.gd +++ b/scripts/Contents/Weapons/BigLaser.gd @@ -11,5 +11,5 @@ func attack(entity: EntityBase): for bullet in BulletBase.generate(ComponentManager.getBullet("BigLaser"), entity, weaponPos, (get_global_mouse_position() - weaponPos).angle()): var bigLaser: BigLaser = bullet bigLaser.dotTime = readStore("time") * 1000 - bigLaser.damage = readStore("atk") + bigLaser.baseDamage = readStore("atk") return true diff --git a/scripts/Contents/Weapons/MushroomPickaxe.gd b/scripts/Contents/Weapons/MushroomPickaxe.gd index e79625b..49d9d44 100644 --- a/scripts/Contents/Weapons/MushroomPickaxe.gd +++ b/scripts/Contents/Weapons/MushroomPickaxe.gd @@ -10,7 +10,7 @@ func attack(entity: EntityBase): var weaponPos = entity.findWeaponAnchor("normal") for j in BulletBase.generate(ComponentManager.getBullet("MushroomPickaxe"), entity, entity.texture.global_position, weaponPos.angle_to_point(get_global_mouse_position())): var bullet: MushroomPickaxe = j - bullet.damage = readStore("atk") + bullet.baseDamage = readStore("atk") bullet.rate = readStore("rate") bullet.count = readStore("count") return true diff --git a/scripts/Contents/Weapons/NuclearBomb.gd b/scripts/Contents/Weapons/NuclearBomb.gd index a28751e..e127c15 100644 --- a/scripts/Contents/Weapons/NuclearBomb.gd +++ b/scripts/Contents/Weapons/NuclearBomb.gd @@ -9,6 +9,6 @@ func attack(entity: EntityBase): var weaponPos = entity.findWeaponAnchor("normal") for j in BulletBase.generate(ComponentManager.getBullet("NuclearBomb"), entity, weaponPos, weaponPos.angle_to_point(get_global_mouse_position())): var bullet: NuclearBomb = j - bullet.damage = readStore("atk") + bullet.baseDamage = readStore("atk") bullet.radius = readStore("radius") return true diff --git a/scripts/Contents/Weapons/VectorStarWeapon.gd b/scripts/Contents/Weapons/VectorStarWeapon.gd index 243d7ed..b51cc56 100644 --- a/scripts/Contents/Weapons/VectorStarWeapon.gd +++ b/scripts/Contents/Weapons/VectorStarWeapon.gd @@ -13,7 +13,7 @@ func attack(entity: EntityBase): for i in range(int(randi_range(readStore("mincount"), readStore("maxcount")))): for j in BulletBase.generate(ComponentManager.getBullet("VectorStar"), entity, weaponPos, deg_to_rad(randf_range(0, 360))): var bullet: VectorStar = j - bullet.damage = readStore("atk") + bullet.baseDamage = readStore("atk") bullet.tracer = EntityTool.findClosetEntity(get_global_mouse_position(), get_tree(), !entity.isPlayer(), entity.isPlayer()) bullet.forwardTime = readStore("forwardtime") * 1000 return true diff --git a/scripts/Contents/Weapons/Volcano.gd b/scripts/Contents/Weapons/Volcano.gd index 43932b7..3c30c28 100644 --- a/scripts/Contents/Weapons/Volcano.gd +++ b/scripts/Contents/Weapons/Volcano.gd @@ -2,7 +2,11 @@ extends Weapon func update(to: int, origin: Dictionary, _entity: EntityBase): - origin["rotate"] += 0.015 * to * soulLevel + origin["rotate"] += 0.005 * to * soulLevel + origin["dmg1"] += 0.03 * to * soulLevel + origin["dmg2"] += 0.03 * to * soulLevel + origin["dmg3"] += 0.03 * to * soulLevel + origin["atk"] += 1 * to * soulLevel return origin func attack(entity: EntityBase): for j in BulletBase.generate( @@ -12,5 +16,6 @@ func attack(entity: EntityBase): entity.position.angle_to_point(entity.get_global_mouse_position()), false, false, true, true ): var bullet: Volcano = j - bullet.damage = readStore("atk") + bullet.baseDamage = readStore("atk") bullet.rotates = readStore("rotate") + bullet.damageMultipliers = [readStore("dmg1"), readStore("dmg2"), readStore("dmg3")] diff --git a/scripts/Statemachine/BulletBase.gd b/scripts/Statemachine/BulletBase.gd index 908f15a..b660c6d 100644 --- a/scripts/Statemachine/BulletBase.gd +++ b/scripts/Statemachine/BulletBase.gd @@ -3,7 +3,9 @@ class_name BulletBase @export var displayName: String = "未知子弹" @export var speed: float = 10.0 -@export var damage: float = 10.0 +@export var baseDamage: float = 10.0 +@export var damageMultipliers: Array[float] = [1.0] +@export var usingDamageMultiplier: int = 0 @export var penerate: float = 0.0 @export var penerateDamageReduction: float = 0.0 @export var lifeDistance: float = -1 # -1表示无限距离 @@ -31,12 +33,10 @@ var isChildSplit: bool = false var isChildRefract: bool = false var initialSpeed: float = 0 var originalDamage: float = 0 -var damageMultiplier: Array[float] = [1.0] -var usingDamageMultiplier: int = 0 func _ready(): initialSpeed = speed - originalDamage = damage + originalDamage = baseDamage if launcher.isSummon(): launcherSummoned = launcher launcher = launcher.myMaster @@ -87,7 +87,7 @@ func _physics_process(_delta: float) -> void: tryDestroy() func getDamage(): - return originalDamage * damageMultiplier[usingDamageMultiplier] + return originalDamage * damageMultipliers[usingDamageMultiplier] func hit(target: Node): var entity: EntityBase = EntityTool.fromHurtbox(target) if !entity || !launcher: return @@ -96,7 +96,7 @@ func hit(target: Node): succeedToHit(resultDamage, entity) if MathTool.rate(fullPenerate()): penerate -= entity.fields[FieldStore.Entity.PENARATION_RESISTANCE] - damage *= 1.0 - penerateDamageReduction + baseDamage *= 1.0 - penerateDamageReduction else: tryDestroy() func forward(direction: Vector2):