Many changes
Handle it
This commit is contained in:
parent
bf09402bc5
commit
214e0aa5e0
366 changed files with 24353 additions and 2096 deletions
13
player/modifiers/fire_rate_additive.gd
Normal file
13
player/modifiers/fire_rate_additive.gd
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
class_name FireRateAdditive extends Modifier
|
||||
|
||||
@export var fire_rate_bonus: float = 1.0 # +1 shot per second
|
||||
|
||||
func _init():
|
||||
id = "fire_rate_additive"
|
||||
display_name = "Rapid Fire"
|
||||
description = "Increases fire rate by %0.1f shots per second" % fire_rate_bonus
|
||||
modifier_type = ModifierType.ADDITIVE
|
||||
|
||||
func apply_stats_modification(final_stats: Dictionary, base_stats: Dictionary) -> void:
|
||||
if final_stats.has("fire_rate"):
|
||||
final_stats.fire_rate += fire_rate_bonus
|
||||
1
player/modifiers/fire_rate_additive.gd.uid
Normal file
1
player/modifiers/fire_rate_additive.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://cqamoc42g8sam
|
||||
13
player/modifiers/fire_rate_multiplicative.gd
Normal file
13
player/modifiers/fire_rate_multiplicative.gd
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
class_name FireRateMultiplicative extends Modifier
|
||||
|
||||
@export var fire_rate_multiplier: float = 1.2 # 20% faster firing
|
||||
|
||||
func _init():
|
||||
id = "fire_rate_multiplicative"
|
||||
display_name = "Frenzy"
|
||||
description = "Increases fire rate by %d%%" % ((fire_rate_multiplier - 1.0) * 100)
|
||||
modifier_type = ModifierType.MULTIPLICATIVE
|
||||
|
||||
func apply_stats_modification(final_stats: Dictionary, base_stats: Dictionary) -> void:
|
||||
if final_stats.has("fire_rate"):
|
||||
final_stats.fire_rate *= fire_rate_multiplier
|
||||
1
player/modifiers/fire_rate_multiplicative.gd.uid
Normal file
1
player/modifiers/fire_rate_multiplicative.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://bbqp2rhogkicu
|
||||
31
player/modifiers/modifier.gd
Normal file
31
player/modifiers/modifier.gd
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
class_name Modifier extends Resource
|
||||
|
||||
enum ModifierType {
|
||||
ADDITIVE, # Simply adds values (e.g., +5 damage)
|
||||
MULTIPLICATIVE, # Multiplies by a percentage (e.g., 20% more damage)
|
||||
OVERRIDE, # Completely replaces the value
|
||||
CONDITIONAL # Applies under certain conditions
|
||||
}
|
||||
|
||||
@export var id: String
|
||||
@export var display_name: String
|
||||
@export var description: String
|
||||
@export var icon: Texture
|
||||
@export var rarity: int
|
||||
@export var modifier_type: ModifierType = ModifierType.ADDITIVE
|
||||
@export var priority: int = 0 # Higher priority modifiers apply first
|
||||
|
||||
# Called when the modifier is added to a weapon or ability
|
||||
func on_equip(_owner) -> void:
|
||||
pass
|
||||
|
||||
# Called when the modifier is removed
|
||||
func on_unequip(_owner) -> void:
|
||||
pass
|
||||
|
||||
# Override in child classes for specific modification logic
|
||||
func modify_projectile(_projectile) -> void:
|
||||
pass
|
||||
|
||||
func modify_ability(_ability) -> void:
|
||||
pass
|
||||
1
player/modifiers/modifier.gd.uid
Normal file
1
player/modifiers/modifier.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://c2vpdeqk0vvrg
|
||||
18
player/modifiers/piercing.gd
Normal file
18
player/modifiers/piercing.gd
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
class_name PiercingModifier extends Modifier
|
||||
|
||||
@export var pierce_count: int = 2
|
||||
|
||||
func _init():
|
||||
id = "piercing"
|
||||
display_name = "Piercing Shot"
|
||||
description = "Projectiles pass through %d enemies" % pierce_count
|
||||
|
||||
func modify_projectile(projectile):
|
||||
projectile.pierce_count = pierce_count
|
||||
projectile.connect("on_hit", _on_projectile_hit)
|
||||
|
||||
func _on_projectile_hit(projectile, _target):
|
||||
projectile.pierce_count -= 1
|
||||
if projectile.pierce_count <= 0:
|
||||
projectile.pierce_count = 0
|
||||
projectile.set_piercing(false)
|
||||
1
player/modifiers/piercing.gd.uid
Normal file
1
player/modifiers/piercing.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://b60nonvh7ml2o
|
||||
25
player/modifiers/projectile_size_additive.gd
Normal file
25
player/modifiers/projectile_size_additive.gd
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
class_name ProjectileSizeAdditive extends Modifier
|
||||
|
||||
@export var size_increase: float = 0.5 # +50% bigger
|
||||
|
||||
func _init():
|
||||
id = "size_additive"
|
||||
display_name = "Enlarged Projectiles"
|
||||
description = "Increases projectile size by %d%%" % (size_increase * 100)
|
||||
modifier_type = ModifierType.ADDITIVE
|
||||
|
||||
func apply_stats_modification(final_stats: Dictionary, base_stats: Dictionary) -> void:
|
||||
if final_stats.has("projectile_size"):
|
||||
final_stats.projectile_size += size_increase
|
||||
|
||||
func modify_projectile(projectile) -> void:
|
||||
# This will be called when the projectile is created
|
||||
# Scale is often handled in the recalculate_stats method, but we can also add visual effects here
|
||||
projectile.connect("on_spawned", _on_projectile_spawned)
|
||||
|
||||
func _on_projectile_spawned(projectile):
|
||||
# Add a trail effect for larger projectiles
|
||||
if projectile.scale.x > 1.2:
|
||||
pass
|
||||
#var trail = preload("res://scenes/projectile_trail.tscn").instantiate()
|
||||
#projectile.add_child(trail)
|
||||
1
player/modifiers/projectile_size_additive.gd.uid
Normal file
1
player/modifiers/projectile_size_additive.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://hsl3es4bcvqf
|
||||
14
player/modifiers/projectile_size_multiplicative.gd
Normal file
14
player/modifiers/projectile_size_multiplicative.gd
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
class_name ProjectileSizeMultiplicative extends Modifier
|
||||
|
||||
@export var size_multiplier: float = 1.5 # 50% bigger
|
||||
|
||||
func _init():
|
||||
id = "size_multiplicative"
|
||||
display_name = "Giant Projectiles"
|
||||
description = "Multiplies projectile size by %0.1fx" % size_multiplier
|
||||
modifier_type = ModifierType.MULTIPLICATIVE
|
||||
priority = 10 # Higher priority than the additive version
|
||||
|
||||
func apply_stats_modification(final_stats: Dictionary, base_stats: Dictionary) -> void:
|
||||
if final_stats.has("projectile_size"):
|
||||
final_stats.projectile_size *= size_multiplier
|
||||
1
player/modifiers/projectile_size_multiplicative.gd.uid
Normal file
1
player/modifiers/projectile_size_multiplicative.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://bvfir8srnaraa
|
||||
Loading…
Add table
Add a link
Reference in a new issue