pellet spread, bulletholes and balance fixes
This commit is contained in:
parent
eabc137ce8
commit
74e37f8a18
17 changed files with 261 additions and 72 deletions
BIN
weapons/gun/pellet_spread/icon.png
Normal file
BIN
weapons/gun/pellet_spread/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
40
weapons/gun/pellet_spread/icon.png.import
Normal file
40
weapons/gun/pellet_spread/icon.png.import
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cs1dapnsaw2vw"
|
||||
path="res://.godot/imported/icon.png-0bb35b0bcb159408ed12f260c09d8538.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://weapons/gun/pellet_spread/icon.png"
|
||||
dest_files=["res://.godot/imported/icon.png-0bb35b0bcb159408ed12f260c09d8538.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
13
weapons/gun/pellet_spread/pellet_spread.gd
Normal file
13
weapons/gun/pellet_spread/pellet_spread.gd
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
@icon("res://weapons/gun/pellet_spread/icon.png")
|
||||
class_name PelletSpread extends Path2D
|
||||
|
||||
func get_dots() -> PackedVector2Array:
|
||||
var result: PackedVector2Array
|
||||
|
||||
for i in curve.point_count:
|
||||
result.append(curve.get_point_position(i))
|
||||
|
||||
for i in range(len(result)):
|
||||
result[i] += get_viewport_rect().size/2.0
|
||||
|
||||
return result
|
||||
1
weapons/gun/pellet_spread/pellet_spread.gd.uid
Normal file
1
weapons/gun/pellet_spread/pellet_spread.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://ryxe3lxtvpk4
|
||||
22
weapons/gun/pellet_spread/pellet_spread_random.gd
Normal file
22
weapons/gun/pellet_spread/pellet_spread_random.gd
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
@tool
|
||||
extends PelletSpread
|
||||
|
||||
class_name PelletSpreadRandom
|
||||
|
||||
const ASPECT = 1.7777777777777777
|
||||
|
||||
@export var random_amount: int
|
||||
@export_range(0,89,0.1,"radians_as_degrees") var radius: float
|
||||
@export var aspect_ratio: float = 1.7777777777777777
|
||||
|
||||
@export_tool_button("Randomize points") var randomize_button = randomize_points
|
||||
|
||||
func randomize_points() -> void:
|
||||
curve.clear_points()
|
||||
var viewport_aspect_trasformation = Vector2(ASPECT,1)
|
||||
var custom_aspect_transformation = Vector2(aspect_ratio,1./aspect_ratio)
|
||||
var transformation_vector = get_viewport_rect().size / viewport_aspect_trasformation /PI
|
||||
for i in range(random_amount):
|
||||
var unscaled_position = Vector2(randf_range(-radius,radius),randf_range(-radius,radius))
|
||||
var scaled_position = unscaled_position*transformation_vector
|
||||
curve.add_point(scaled_position)
|
||||
1
weapons/gun/pellet_spread/pellet_spread_random.gd.uid
Normal file
1
weapons/gun/pellet_spread/pellet_spread_random.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://b3cvfkvvc5c3g
|
||||
Loading…
Add table
Add a link
Reference in a new issue