Weapons folder, barrel placeholder and base class for fire modes
This commit is contained in:
parent
97a92fd86b
commit
a67a5329b6
4 changed files with 32 additions and 0 deletions
6
base/scripts/weapons/barrel.gd
Normal file
6
base/scripts/weapons/barrel.gd
Normal file
|
@ -0,0 +1,6 @@
|
|||
extends Node3D
|
||||
|
||||
class_name Barrel
|
||||
|
||||
func can_fire() -> bool:
|
||||
return true
|
1
base/scripts/weapons/barrel.gd.uid
Normal file
1
base/scripts/weapons/barrel.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://bvurg687pt06s
|
24
base/scripts/weapons/fire_mode/base_fire_mode.gd
Normal file
24
base/scripts/weapons/fire_mode/base_fire_mode.gd
Normal file
|
@ -0,0 +1,24 @@
|
|||
extends Resource
|
||||
|
||||
## Base class for all fire modes
|
||||
class_name BaseFireMode
|
||||
|
||||
## Assigned barrel to shoot out of
|
||||
var barrel : Barrel
|
||||
|
||||
|
||||
## Fires projectile out of barrel [br]
|
||||
## Returns [color=green]true[/color] if barrel can shoot,[br]
|
||||
## Returns [color=red]false[/color] if barrel cannot shoot
|
||||
func _fire() -> bool:
|
||||
return true
|
||||
|
||||
|
||||
## Invoked when fire button is just pressed or reload ended while fire button is still pressed
|
||||
func _on_fire_begin() -> void:
|
||||
pass
|
||||
|
||||
|
||||
## Invoked when fire button is just released or reload started while fire button is still pressed
|
||||
func _on_fire_end() -> void:
|
||||
pass
|
1
base/scripts/weapons/fire_mode/base_fire_mode.gd.uid
Normal file
1
base/scripts/weapons/fire_mode/base_fire_mode.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://icsatakb034w
|
Loading…
Add table
Add a link
Reference in a new issue