diff --git a/components/Bullets/OxygenFire.tscn b/components/Bullets/OxygenFire.tscn index bca37d0..a6ec9f1 100644 --- a/components/Bullets/OxygenFire.tscn +++ b/components/Bullets/OxygenFire.tscn @@ -146,7 +146,6 @@ penerate = 1.0 lifeTime = 1000.0 autoSpawnAnimation = true freeAfterSpawn = true -knockback = 10.0 [node name="animator" parent="texture" index="0"] libraries = { diff --git a/components/Characters/Rooster.tscn b/components/Characters/Rooster.tscn index 1851d1c..65b6568 100644 --- a/components/Characters/Rooster.tscn +++ b/components/Characters/Rooster.tscn @@ -1,7 +1,8 @@ -[gd_scene load_steps=20 format=3 uid="uid://dky8574uqc18r"] +[gd_scene load_steps=21 format=3 uid="uid://dky8574uqc18r"] [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://b5ebx8duvgtt5" path="res://components/Weapons/Oxygener.tscn" id="3_0omr3"] [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="PackedScene" uid="uid://cxabqjo7skxev" path="res://components/Weapons/BigLaser.tscn" id="5_joj4g"] @@ -101,7 +102,11 @@ process_material = SubResource("ParticleProcessMaterial_joj4g") [node name="weaponStore" parent="." index="2"] process_mode = 4 -[node name="BigLaser" parent="weaponStore" index="0" instance=ExtResource("5_joj4g")] +[node name="Oxygener" parent="weaponStore" index="0" instance=ExtResource("3_0omr3")] +offset_bottom = 446.0 +debugRebuild = false + +[node name="BigLaser" parent="weaponStore" index="1" instance=ExtResource("5_joj4g")] [node name="sprint" parent="sounds" index="0"] stream = ExtResource("4_66s6c") diff --git a/components/Weapons/Oxygener.tscn b/components/Weapons/Oxygener.tscn index bc40a5f..a1c91a2 100644 --- a/components/Weapons/Oxygener.tscn +++ b/components/Weapons/Oxygener.tscn @@ -11,18 +11,20 @@ displayName = "氧化加农炮" quality = 0 typeTopic = 2 store = { -"atk": 3.0, -"fireatk": 1.0, +"atk": 10.0, +"count": 1, +"fireatk": 5.0, "max-n": 7.0, -"min-n": 3.0 +"min-n": 2.0 } storeType = { "atk": 0, +"count": 1, "fireatk": 0, "max-n": 1, "min-n": 1 } -descriptionTemplate = "高速喷出[b]火焰[/b],造成$fireatk点伤害。小概率喷出[b]硝化火[/b],召唤$min-n~$max-n滴[b]浓硝酸[/b]围绕在火焰旁,每滴造成$atk点伤害。[b]火焰[/b]具有高额击退效果,[b]浓硝酸[/b]液滴的射程较短。" +descriptionTemplate = "高速喷出[b]火焰[/b],造成$fireatk点伤害。小概率喷出[b]硝化火[/b],召唤$min-n~$max-n滴[b]浓硝酸[/b]围绕在火焰旁,每滴造成$atk点伤害。[b]火焰[/b]具有高额击退效果,[b]浓硝酸[/b]液滴的射程较短,每发射$count次火焰会消耗[color=yellow]1[/color]个[b]篮球[/b]。" cooldown = 50.0 debugRebuild = true @@ -35,4 +37,4 @@ quality = 0 typeTopic = 2 [node name="description" parent="container" index="2"] -text = "[center]高速喷出[b]火焰[/b],造成[color=cyan]1.00[/color]点伤害。小概率喷出[b]硝化火[/b],召唤[color=cyan]3[/color]~[color=cyan]7[/color]滴[b]浓硝酸[/b]围绕在火焰旁,每滴造成[color=cyan]3.00[/color]点伤害。[b]火焰[/b]具有高额击退效果,[b]浓硝酸[/b]液滴的射程较短。[/center]" +text = "[center]高速喷出[b]火焰[/b],造成[color=cyan]5.00[/color]点伤害。小概率喷出[b]硝化火[/b],召唤[color=cyan]2[/color]~[color=cyan]7[/color]滴[b]浓硝酸[/b]围绕在火焰旁,每滴造成[color=cyan]10.00[/color]点伤害。[b]火焰[/b]具有高额击退效果,[b]浓硝酸[/b]液滴的射程较短,每发射[color=cyan]1[/color]次火焰会消耗[color=yellow]1[/color]个[b]篮球[/b]。[/center]" diff --git a/scripts/Contents/Bullets/OxygenFire.gd b/scripts/Contents/Bullets/OxygenFire.gd index 1f4dffb..b760008 100644 --- a/scripts/Contents/Bullets/OxygenFire.gd +++ b/scripts/Contents/Bullets/OxygenFire.gd @@ -2,4 +2,4 @@ extends BulletBase class_name OxygenFire func ai(): - PresetBulletAI.forward(self, rotation) + PresetBulletAI.forward(self, rotation) diff --git a/scripts/Contents/Weapons/Oxygener.gd b/scripts/Contents/Weapons/Oxygener.gd index dd48217..ac19c0e 100644 --- a/scripts/Contents/Weapons/Oxygener.gd +++ b/scripts/Contents/Weapons/Oxygener.gd @@ -4,8 +4,11 @@ extends Weapon func update(to: int, origin: Dictionary, _entity: EntityBase): origin["atk"] += 1 * to * soulLevel origin["fireatk"] += 0.5 * to * soulLevel - origin["max-n"] += 2 * soulLevel + origin["max-n"] += 2 * (soulLevel - 1) + origin["count"] *= soulLevel return origin +func checkAttack(entity: EntityBase) -> bool: + return entity.useItem({ItemStore.ItemType.BASKETBALL: 1.0 / readStore("count")}) func attack(entity: EntityBase): for bullet in BulletBase.generate( ComponentManager.getBullet("OxygenFire"), diff --git a/scripts/Structs/Weapon.gd b/scripts/Structs/Weapon.gd index 9b1ef90..f18be06 100644 --- a/scripts/Structs/Weapon.gd +++ b/scripts/Structs/Weapon.gd @@ -169,7 +169,7 @@ func playSound(sound: String): cloned.queue_free() func canAttackBy(entity: EntityBase): cooldownTimer.speedScale = entity.fields.get(FieldStore.Entity.ATTACK_SPEED) * attackSpeed - return cooldownTimer.isCooldowned() and entity.isEnergyEnough(needEnergy) + return cooldownTimer.isCooldowned() and entity.isEnergyEnough(needEnergy) and checkAttack(entity) func tryAttack(entity: EntityBase): if canAttackBy(entity): var result = await attack(entity) @@ -183,5 +183,7 @@ func charged(base: float, percent: float): # 抽象 func update(_to: int, origin: Dictionary, _entity: EntityBase): return origin +func checkAttack(_entity: EntityBase) -> bool: + return true func attack(_entity: EntityBase): pass