diff --git a/components/Weapons/ChainGun.tscn b/components/Weapons/ChainGun.tscn index 5763536..cf994f1 100644 --- a/components/Weapons/ChainGun.tscn +++ b/components/Weapons/ChainGun.tscn @@ -10,8 +10,14 @@ avatarTexture = ExtResource("2_ghn43") displayName = "链式机枪" costBeachball = 400 store = { -"atk": 5 +"atk": 5, +"count": 1 } +storeType = { +"atk": 1, +"count": 1 +} +descriptionTemplate = "发射$count个[b]微型水晶[/b],可造成$atk点伤害。" needEnergy = 1.0 cooldown = 66.0 @@ -28,4 +34,4 @@ text = "400" displayName = "链式机枪" [node name="description" parent="container" index="2"] -text = "[center]造成[color=cyan]4[/color]→[color=yellow]6[/color]点伤害。[/center]" +text = "[center]发射[color=cyan]2[/color]→[color=yellow]2[/color]个[b]微型水晶[/b],可造成[color=cyan]5[/color]→[color=yellow]7[/color]点伤害。[/center]" diff --git a/scripts/Contents/Bullets/ChainGun.gd b/scripts/Contents/Bullets/ChainGun.gd index 9d4b646..a30c2db 100644 --- a/scripts/Contents/Bullets/ChainGun.gd +++ b/scripts/Contents/Bullets/ChainGun.gd @@ -1,9 +1,14 @@ extends BulletBase +var count: int = 1 + @onready var anchor: Node2D = $"%anchor" func spawn(): - for i in BulletBase.generate(ComponentManager.getBullet("PurpleCrystalSmall"), launcher, anchor.global_position, rotation): - i.damage = damage + for j in count: + for i in BulletBase.generate(ComponentManager.getBullet("PurpleCrystalSmall"), launcher, anchor.global_position, rotation): + i.damage = damage + var dir = Vector2.from_angle(i.rotation).rotated(deg_to_rad(-90)) + i.global_position += dir * (count - j * 2) * 20 / 2 func ai(): - PresetBulletAI.lockLauncher(self, launcher, true) \ No newline at end of file + PresetBulletAI.lockLauncher(self, launcher, true) diff --git a/scripts/Contents/Weapons/ChainGun.gd b/scripts/Contents/Weapons/ChainGun.gd index 2322881..7fdb5b2 100644 --- a/scripts/Contents/Weapons/ChainGun.gd +++ b/scripts/Contents/Weapons/ChainGun.gd @@ -3,7 +3,9 @@ extends Weapon func update(to, origin, _entity): origin["atk"] += 2 * to * soulLevel + origin["count"] += 0.25 * 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()): i.damage = readStore("atk") + i.count = floor(readStore("count"))