fixed jump pad, started work on machete
This commit is contained in:
53
scripts/melee_weapon.gd
Normal file
53
scripts/melee_weapon.gd
Normal file
@@ -0,0 +1,53 @@
|
||||
extends Node3D
|
||||
|
||||
|
||||
@export_group("Gun Feel")
|
||||
@export var gun_name : String
|
||||
@export var gun_icon : Texture2D
|
||||
@export_enum("Light", "Medium", "Heavy", "Shotgun", "Rocket","Melee") var ammo_type: int
|
||||
@export var fov_zoom_amt = 0
|
||||
@export var ads : bool = false
|
||||
@export var recoil_amount : Vector3 = Vector3(0,.2,.2)
|
||||
@export var bullet_damage = 1
|
||||
@export_group("Gun Assets")
|
||||
@export_subgroup("Main Assets")
|
||||
@export var anim_player : Node
|
||||
@export_subgroup("Audio Clips")
|
||||
@export var audio_fire : Node
|
||||
|
||||
@onready var player = get_tree().current_scene.player
|
||||
@onready var level_control = get_tree().current_scene
|
||||
@onready var muzzle_smoke = preload("res://assets/muzzle_smoke.tscn")
|
||||
|
||||
var max_ammo = 0
|
||||
var start_mags = 0
|
||||
var start_position
|
||||
var start_rotation
|
||||
var random_spread_start
|
||||
var cycle_count_start
|
||||
var cycle_count
|
||||
var rng = RandomNumberGenerator.new()
|
||||
var gun_index
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
pass
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(_delta):
|
||||
pass
|
||||
|
||||
func shoot(delta):
|
||||
if !anim_player.is_playing():
|
||||
#audio and anims
|
||||
anim_player.play("shoot")
|
||||
vibration()
|
||||
player.recoil.add_recoil(Vector3(0,recoil_amount.y,recoil_amount.z),10,10)
|
||||
player.recoil.add_gun_recoil(recoil_amount.x)
|
||||
SignalBus.emit_signal("shot_fired")
|
||||
|
||||
func swapped_out():
|
||||
queue_free()
|
||||
|
||||
func vibration():
|
||||
Input.start_joy_vibration(0,.1,.5,.1)
|
||||
Reference in New Issue
Block a user