pellet spread, bulletholes and balance fixes

This commit is contained in:
Rendo 2025-12-14 14:54:35 +05:00
commit 74e37f8a18
17 changed files with 261 additions and 72 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View 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

View 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

View file

@ -0,0 +1 @@
uid://ryxe3lxtvpk4

View 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)

View file

@ -0,0 +1 @@
uid://b3cvfkvvc5c3g