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

feat(武器): 为齿轮武器添加升华选项和增强效果

- 在Cogwheel.gd中添加5个升华选项,提供不同属性增强
- 修改齿轮子弹逻辑,支持旋转加速、重力吸附等新效果
- 调整MuyangDog的初始武器配置,将齿轮作为主武器
- 修复箭头武器的生命偷取值归零
- 初始化钻石库存为10个
This commit is contained in:
2026-05-10 16:34:45 +08:00
parent dd586e89c7
commit a05a288612
5 changed files with 67 additions and 9 deletions
+5 -1
View File
@@ -2,10 +2,14 @@
[ext_resource type="PackedScene" uid="uid://bs863g2s8r770" path="res://components/Abstracts/PlayerBase.tscn" id="1_y3l4w"]
[ext_resource type="Script" uid="uid://bbmb572iba42l" path="res://scripts/Contents/Characters/MuyangDog.gd" id="2_mr6nm"]
[ext_resource type="PackedScene" uid="uid://dqywctcj4y2xi" path="res://components/Weapons/Cogwheel.tscn" id="3_im5m5"]
[ext_resource type="PackedScene" uid="uid://cx7nogfnv7s8t" path="res://components/Weapons/Tree.tscn" id="4_im5m5"]
[node name="MuyangDog" unique_id=1711205167 instance=ExtResource("1_y3l4w")]
script = ExtResource("2_mr6nm")
displayName = "牧羊犬"
[node name="Tree" parent="weaponStore" parent_id_path=PackedInt32Array(1319091445) index="0" unique_id=185228402 instance=ExtResource("4_im5m5")]
[node name="Cogwheel" parent="weaponStore" parent_id_path=PackedInt32Array(1319091445) index="0" unique_id=89158644 instance=ExtResource("3_im5m5")]
offset_bottom = 688.0
[node name="Tree" parent="weaponStore" parent_id_path=PackedInt32Array(1319091445) index="1" unique_id=185228402 instance=ExtResource("4_im5m5")]
+1 -1
View File
@@ -6,7 +6,7 @@ class_name Arrow
var atk: float = 0
var waitTime: float = 0
var offsetRotation: float = 0
var lifesteal: float = 0.2
var lifesteal: float = 0
func register():
trail.emitting = false
+14 -5
View File
@@ -5,23 +5,29 @@ var initialRotate: float = 0
var rotateSpeed: float = 0
var dotTime: float = 0
var slow: float = 0.2
var rotateExtra: float = 0
var atkSpeeddown: float = 0
var gravityForce: float = 0
func spawn():
slow *= initialRotate / 15.0
func ai():
PresetBulletAI.forward(self, rotation)
PresetBulletAI.forward(self , rotation)
texture.rotation_degrees += rotateSpeed
if rotateSpeed < 0:
speed += slow
PresetBulletAI.trace(self, launcher.position, 0.1)
PresetBulletAI.trace(self , launcher.position, 0.1)
if position.distance_to(launcher.position) < 100:
tryDestroy()
else:
speed = initialSpeed * (rotateSpeed / initialRotate)
if rotateSpeed >= 0 and rotateSpeed / slow <= 0:
slow = 0.5
dotTime = 1000 / (rotateSpeed)
rotateSpeed -= slow
slow = 0.4
dotTime = 1000 / rotateSpeed
if rotateSpeed < 0:
rotateSpeed -= slow * (1 + rotateExtra)
else:
rotateSpeed -= slow
func applyDot():
hitbox.disabled = true
await TickTool.frame()
@@ -29,6 +35,9 @@ func applyDot():
await TickTool.millseconds(dotTime / launcher.fields[FieldStore.Entity.ATTACK_SPEED])
await TickTool.frame() # 等至少一帧,防止跳帧导致没检测到伤害
return true
func succeedToHit(_dmg: float, entity: EntityBase):
entity.impluse((position - entity.getTrackingAnchor()).normalized() * gravityForce)
entity.fields[FieldStore.Entity.ATTACK_SPEED] *= 0.98 ** atkSpeeddown
func refract(newBullet: BulletBase, _entity: EntityBase, _index: int, _total: int, _lastBullet: float):
if newBullet is CogwheelBullet:
+46 -1
View File
@@ -1,6 +1,49 @@
@tool
extends Weapon
func sublimateOptions() -> Array[SublimateOption]:
return [
SublimateOption.new(
"锋利齿轮",
"锋利度+4",
func(w: Weapon, _e):
w.addStoreExtra("atk", 4),
2,
CategoryStore.Quality.COMMON
),
SublimateOption.new(
"回旋风暴",
"齿轮回旋时转速额外+15%",
func(w: Weapon, _e):
w.addStoreExtra("rotateExtra", 0.15),
1,
CategoryStore.Quality.EPIC
),
SublimateOption.new(
"顺手牵羊",
"齿轮命中敌人时降低其2%攻击速度",
func(w: Weapon, _e):
w.addStoreExtra("atkspeed", 1),
1,
CategoryStore.Quality.COMMON
),
SublimateOption.new(
"离心甩臂",
"伤害+5%",
func(w: Weapon, _e):
w.addStoreExtra("dmg", 0.05),
1,
CategoryStore.Quality.WASTE
),
SublimateOption.new(
"撕裂锯齿",
"齿轮回旋时可吸附敌人,吸力+15",
func(w: Weapon, _e):
w.addStoreExtra("gravity", 15),
1,
CategoryStore.Quality.COMMON
),
]
func update(to: int, origin: Dictionary, _entity: EntityBase):
origin["atk"] += 1 * to * soulLevel
origin["rotate"] += 0.5 * to * soulLevel
@@ -16,5 +59,7 @@ func attack(entity: EntityBase):
if bullet is CogwheelBullet:
bullet.initialRotate = readStore("rotate")
bullet.rotateSpeed = readStore("rotate")
bullet.baseDamage = readStore("atk")
bullet.baseDamage = readStore("atk") * (1 + readStoreExtra("dmg"))
bullet.rotateExtra = readStoreExtra("rotateExtra")
bullet.gravityForce = readStoreExtra("gravity")
return true
+1 -1
View File
@@ -69,7 +69,7 @@ var inventory = {
ItemStore.ItemType.BEACHBALL: 0,
ItemStore.ItemType.SOUL: 0,
ItemStore.ItemType.CRYSTAL: 0,
ItemStore.ItemType.DIAMOND: 0
ItemStore.ItemType.DIAMOND: 10
}
var inventoryMax = {
ItemStore.ItemType.BASEBALL: INF, # 无限