Add modified weapon models
This commit is contained in:
@@ -2,6 +2,7 @@ extends Node3D
|
||||
|
||||
const CONFIG_PATH = "user://weapons.scoom"
|
||||
const REVOLVER = 0
|
||||
const UZI = 1
|
||||
|
||||
|
||||
const REST = 0
|
||||
@@ -32,6 +33,26 @@ var file_data = {
|
||||
"RELOAD_MOMENTUM": Vector3(-5, -9, 7),
|
||||
"RELOAD_ANGULAR_MOMENTUM": Vector3(deg_to_rad(600), deg_to_rad(-800), deg_to_rad(-1000)),
|
||||
"RELOAD_TIME": 0.35,
|
||||
"FIREMODE": 0,
|
||||
"HITSCAN": true
|
||||
},
|
||||
UZI:
|
||||
{
|
||||
"HAND_POS": Vector3(0.4,-0.45,-1),
|
||||
"HAND_ROT": Vector3(0,PI,0),
|
||||
"MODEL": "Uzi",
|
||||
"MAX_CLIP": 30,
|
||||
"DAMAGE": 25,
|
||||
"MOMENTUM": Vector2(0.05, -0.15),
|
||||
"ANGULAR_MOMENTUM": Vector3(-4, 1, 2),
|
||||
"RECOIL_COOLDOWN": 0.35,
|
||||
"RPM": 600,
|
||||
"DRAW_POS": Vector3(0,-0.5,-0.3),
|
||||
"DRAW_ROT": Vector3(1.3, 0, 0),
|
||||
"RELOAD_MOMENTUM": Vector3(-7, -9, 7),
|
||||
"RELOAD_ANGULAR_MOMENTUM": Vector3(deg_to_rad(600), deg_to_rad(-800), deg_to_rad(-1000)),
|
||||
"RELOAD_TIME": 0.35,
|
||||
"FIREMODE": 1,
|
||||
"HITSCAN": true
|
||||
}
|
||||
}
|
||||
@@ -72,6 +93,7 @@ func _ready():
|
||||
root.DRAW_POS = file_data[i].DRAW_POS
|
||||
root.DRAW_ROT = file_data[i].DRAW_ROT
|
||||
root.HITSCAN = file_data[i].HITSCAN
|
||||
root.FIREMODE = file_data[i].FIREMODE
|
||||
if(not root.HITSCAN):
|
||||
print("Projectile stats")
|
||||
|
||||
@@ -97,7 +119,7 @@ func _unhandled_input(_event):
|
||||
|
||||
func ChangeWeapon(i):
|
||||
weapons[current_weapon].hide()
|
||||
current_weapon = (i)
|
||||
current_weapon = i
|
||||
weapons[current_weapon].init()
|
||||
raycast.target_position.z = -weapons[current_weapon].RAY_LEN
|
||||
|
||||
@@ -119,7 +141,7 @@ func _process(delta):
|
||||
mouse_mov = Vector3.ZERO
|
||||
else:
|
||||
weapons[current_weapon].MODEL.rotation = weapons[current_weapon].MODEL.rotation.lerp(Vector3.ZERO, sway_lerp * delta)
|
||||
|
||||
|
||||
#BOB
|
||||
if player_root.velocity.length() > 0:
|
||||
time += delta
|
||||
@@ -132,7 +154,11 @@ func _process(delta):
|
||||
func HitScan():
|
||||
if(raycast.is_colliding()):
|
||||
var target = raycast.get_collider()
|
||||
print("Hit target ", target.name)
|
||||
print_debug("Hit target ", target.name, " with ", weapons[current_weapon].MODEL.name, " ",current_weapon, ". Dealt damage ", weapons[current_weapon].DAMAGE)
|
||||
if(raycast.get_collision_mask_value(10)):
|
||||
if(target is Hitable):
|
||||
target.Hit()
|
||||
|
||||
|
||||
func Projectile():
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user