added dof blur on time slowdown
This commit is contained in:
@@ -18,7 +18,7 @@ const STAMINA_DRAIN = 20
|
||||
const HEAD_TILT_AMT = .06
|
||||
const BOB_FREQ = 1.7
|
||||
const BOB_AMP = 0.1
|
||||
const ADS_POS = Vector3(0,-.05,-.45)
|
||||
const ADS_POS = Vector3(0,-.05,-.3)
|
||||
|
||||
#JOYSTICK SETTINGS
|
||||
const JOYSTICK_SENSITIVITY = .06
|
||||
@@ -463,6 +463,7 @@ func _physics_process(delta):
|
||||
if level_control.health <= 0:
|
||||
level_control.die()
|
||||
|
||||
focus_on_target()
|
||||
joypad_look(delta)
|
||||
aim_down_sights(delta)
|
||||
flashlight_toggle()
|
||||
@@ -545,7 +546,9 @@ func aim_down_sights(delta):
|
||||
gun.position = lerp(gun.position,ADS_POS,delta * 10 / Engine.time_scale)
|
||||
else:
|
||||
gun.position = lerp(gun.position, weapon_start_pos,delta * 2)
|
||||
camera.fov = lerp(camera.fov,BASE_FOV - float(gun.fov_zoom_amt),(delta * 5)/Engine.time_scale)
|
||||
camera.fov = lerp(camera.fov,BASE_FOV - float(gun.fov_zoom_amt),(delta * 4)/Engine.time_scale)
|
||||
else:
|
||||
gun.position = lerp(gun.position, weapon_start_pos,delta * 10)
|
||||
|
||||
func grab_moveable(body):
|
||||
holster_gun(true)
|
||||
@@ -656,6 +659,16 @@ func pickup_apply(type,ammo_type,value):
|
||||
level_control.money += value
|
||||
|
||||
|
||||
func focus_on_target():
|
||||
if Engine.time_scale < 1:
|
||||
const BLUR_AMOUNT = .1
|
||||
camera.attributes.dof_blur_far_enabled = false
|
||||
camera.attributes.dof_blur_near_enabled = true
|
||||
camera.attributes.dof_blur_amount = lerp(0.0,BLUR_AMOUNT,1.0 - Engine.time_scale)
|
||||
else:
|
||||
camera.attributes.dof_blur_far_enabled = false
|
||||
camera.attributes.dof_blur_near_enabled = false
|
||||
|
||||
func weapon_tilt(input_x, delta):
|
||||
if !ads:
|
||||
if weapon_holder:
|
||||
|
||||
Reference in New Issue
Block a user