diff --git a/scripts/Contents/Bullets/Parrier.gd b/scripts/Contents/Bullets/Parrier.gd index dc7f90d..0b96dba 100644 --- a/scripts/Contents/Bullets/Parrier.gd +++ b/scripts/Contents/Bullets/Parrier.gd @@ -29,7 +29,7 @@ func hitBullet(bullet: BulletBase): # 当前子弹与其他子弹相撞 eff.rotation = position.angle_to_point(bullet.position) eff.shot() CameraManager.shake(200, 250) - launcher.position -= (bullet.position - position).normalized() * 50 + launcher.impluse((position - bullet.position).normalized() * sqrt(bullet.speed) * 500) # 摧毁其他子弹 bullet.tryDestroy() var cycler = launcher.getOrCreateCycleTimer("parry", 2000, 100) diff --git a/scripts/Contents/Wave.gd b/scripts/Contents/Wave.gd index 9b79214..b3b5ef9 100644 --- a/scripts/Contents/Wave.gd +++ b/scripts/Contents/Wave.gd @@ -50,7 +50,7 @@ static var WAVE_JUSTJOKE = [ Wave.create("Kernyr", 0, 0, true, 0, INF, 1), ] static var WAVE_EMPTY = [] -static var data = WAVE_NORMAL if WorldManager.isRelease() else WAVE_NORMAL +static var data = WAVE_NORMAL if WorldManager.isRelease() else WAVE_TESTBOSS_KUKE static func create( entity_: String, diff --git a/scripts/Statemachine/EntityBase.gd b/scripts/Statemachine/EntityBase.gd index 37a39b2..5047abe 100644 --- a/scripts/Statemachine/EntityBase.gd +++ b/scripts/Statemachine/EntityBase.gd @@ -113,6 +113,7 @@ var canRunAi: bool = true var currentStage: int = 0 var spawnTime: float = 0 var cycleTimers: Dictionary = {} +var inertia: Vector2 = Vector2.ZERO func _ready(): if useStatic: @@ -197,6 +198,8 @@ func _physics_process(_delta: float) -> void: ai() elif isSummon(): ai() + velocity += inertia + inertia *= 0.9 move_and_slide() storeEnergy(randf_range(0.01, 0.05 + fields.get(FieldStore.Entity.ENERGY_REGENERATION) - 1), true) trailParticle.emitting = trailing @@ -205,6 +208,8 @@ func _physics_process(_delta: float) -> void: cycler.apply() # 通用方法 +func impluse(force: Vector2): + inertia += force func getOrCreateCycleTimer(timerName: String, period: float = 1000, distance: float = 200, start: bool = true) -> CycleTimer: if !cycleTimers.has(timerName): var newTimer = CycleTimer.new()