Adding loads of icons and starting refactor of weapons and mods
This commit is contained in:
parent
1a959fbc0c
commit
f97521decc
4411 changed files with 74792 additions and 42 deletions
6
combat/modifiers/ModifierManager.tscn
Normal file
6
combat/modifiers/ModifierManager.tscn
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://dxk87qi05ffqy"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cwtajnv8go4a" path="res://combat/modifiers/_scripts/modifier_manager.gd" id="1_jn4l3"]
|
||||
|
||||
[node name="ModifierManager" type="Node2D"]
|
||||
script = ExtResource("1_jn4l3")
|
||||
6
combat/modifiers/_scripts/modifier_manager.gd
Normal file
6
combat/modifiers/_scripts/modifier_manager.gd
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
@icon("res://assets/editor/64x64/fc1098.png")
|
||||
extends Node2D
|
||||
class_name ModifierManagerTwo
|
||||
|
||||
func _init() -> void:
|
||||
Log.pr("ModifierManagerTwo initialized")
|
||||
1
combat/modifiers/_scripts/modifier_manager.gd.uid
Normal file
1
combat/modifiers/_scripts/modifier_manager.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://cwtajnv8go4a
|
||||
17
combat/projectiles/_scripts/projectile_base.gd
Normal file
17
combat/projectiles/_scripts/projectile_base.gd
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
extends Area2D
|
||||
class_name ProjectileBaseTwo
|
||||
|
||||
var lifetime_timer: Timer
|
||||
|
||||
var stats = {
|
||||
"speed": 500.0,
|
||||
"damage": 10.0,
|
||||
"lifetime": 2,
|
||||
}
|
||||
|
||||
func destroy():
|
||||
emit_signal("on_destroyed", self)
|
||||
queue_free()
|
||||
|
||||
func _on_lifetime_timeout():
|
||||
destroy()
|
||||
1
combat/projectiles/_scripts/projectile_base.gd.uid
Normal file
1
combat/projectiles/_scripts/projectile_base.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://bkyout6vd2xer
|
||||
12
combat/projectiles/rock/RockProjectile.tscn
Normal file
12
combat/projectiles/rock/RockProjectile.tscn
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://xil4f66wokxb"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cv3jv78k0qqvc" path="res://combat/projectiles/rock/scripts/rock_projectile.gd" id="1_8myby"]
|
||||
|
||||
[node name="RockProjectile" type="Node2D"]
|
||||
script = ExtResource("1_8myby")
|
||||
speed = null
|
||||
damage = null
|
||||
lifetime = null
|
||||
direction = null
|
||||
target_position = null
|
||||
is_friendly = null
|
||||
19
combat/projectiles/rock/scripts/rock_projectile.gd
Normal file
19
combat/projectiles/rock/scripts/rock_projectile.gd
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
class_name RockProjectile
|
||||
extends ProjectileBaseTwo
|
||||
|
||||
func _ready():
|
||||
lifetime_timer = Timer.new()
|
||||
add_child(lifetime_timer)
|
||||
lifetime_timer.one_shot = true
|
||||
lifetime_timer.wait_time = lifetime
|
||||
lifetime_timer.connect("timeout", _on_lifetime_timeout)
|
||||
lifetime_timer.start()
|
||||
|
||||
emit_signal("on_spawned", self)
|
||||
connect("body_entered", _on_body_entered)
|
||||
|
||||
func _physics_process(delta):
|
||||
position += direction * speed * delta
|
||||
|
||||
func _on_lifetime_timeout():
|
||||
super._on_lifetime_timeout()
|
||||
1
combat/projectiles/rock/scripts/rock_projectile.gd.uid
Normal file
1
combat/projectiles/rock/scripts/rock_projectile.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://cv3jv78k0qqvc
|
||||
6
combat/weapons/MeleeWeaponComponent.tscn
Normal file
6
combat/weapons/MeleeWeaponComponent.tscn
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://dqful6et42ok8"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bvoe382ee3088" path="res://combat/weapons/_scripts/melee_weapon_component.gd" id="1_jtxhn"]
|
||||
|
||||
[node name="MeleeWeaponComponent" type="Node2D"]
|
||||
script = ExtResource("1_jtxhn")
|
||||
9
combat/weapons/RangedWeaponComponent.tscn
Normal file
9
combat/weapons/RangedWeaponComponent.tscn
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://dud7c465danl4"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://du7wmboxaiavv" path="res://combat/weapons/_scripts/ranged_weapon_component.gd" id="1_ag7i1"]
|
||||
[ext_resource type="PackedScene" uid="uid://dxk87qi05ffqy" path="res://combat/modifiers/ModifierManager.tscn" id="2_n81mi"]
|
||||
|
||||
[node name="RangedWeaponComponent" type="Node2D"]
|
||||
script = ExtResource("1_ag7i1")
|
||||
|
||||
[node name="ModifierManager" parent="." instance=ExtResource("2_n81mi")]
|
||||
18
combat/weapons/_scripts/melee_weapon_component.gd
Normal file
18
combat/weapons/_scripts/melee_weapon_component.gd
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
@icon("res://assets/editor/64x64/fc728.png")
|
||||
extends WeaponComponent
|
||||
class_name MeleeWeaponComponent
|
||||
|
||||
var stats = {
|
||||
"piercing": 3,
|
||||
}
|
||||
var combined_stats = {}
|
||||
|
||||
func _init() -> void:
|
||||
Log.pr("MeleeWeaponComponent initialized")
|
||||
super._init()
|
||||
|
||||
# Combine the base stats with the stats from the parent class
|
||||
combined_stats = base_stats.duplicate()
|
||||
combined_stats.merge(stats)
|
||||
|
||||
Log.pr("Combined stats: ", combined_stats)
|
||||
1
combat/weapons/_scripts/melee_weapon_component.gd.uid
Normal file
1
combat/weapons/_scripts/melee_weapon_component.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://bvoe382ee3088
|
||||
25
combat/weapons/_scripts/ranged_weapon_component.gd
Normal file
25
combat/weapons/_scripts/ranged_weapon_component.gd
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
@icon("res://assets/editor/64x64/fc1515.png")
|
||||
extends WeaponComponent
|
||||
class_name RangedWeaponComponent
|
||||
|
||||
var stats = {
|
||||
"projectile_speed": 500.0,
|
||||
"projectile_size": 1.0,
|
||||
"projectile_lifetime": 1.0,
|
||||
"projectile_quantity": 1,
|
||||
"projectile_spread": 33,
|
||||
"max_pierce": 0
|
||||
}
|
||||
var combined_stats = {}
|
||||
|
||||
func _init() -> void:
|
||||
Log.pr("RangedWeaponComponent initialized")
|
||||
super._init()
|
||||
|
||||
# Combine the base stats with the stats from the parent class
|
||||
combined_stats = base_stats.duplicate()
|
||||
combined_stats.merge(stats)
|
||||
|
||||
Log.pr("Combined stats: ", combined_stats)
|
||||
|
||||
Log.pr("ModifierManager: ", modifier_manager)
|
||||
1
combat/weapons/_scripts/ranged_weapon_component.gd.uid
Normal file
1
combat/weapons/_scripts/ranged_weapon_component.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://du7wmboxaiavv
|
||||
18
combat/weapons/_scripts/weapon_component.gd
Normal file
18
combat/weapons/_scripts/weapon_component.gd
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
@icon("res://assets/editor/64x64/fc729.png")
|
||||
extends Node2D
|
||||
class_name WeaponComponent
|
||||
|
||||
var modifier_manager
|
||||
|
||||
var base_stats = {
|
||||
"damage": 10.0,
|
||||
"attack_rate": 3.0
|
||||
}
|
||||
|
||||
func _init() -> void:
|
||||
Log.pr("WeaponComponent initialized")
|
||||
|
||||
func _ready() -> void:
|
||||
await get_tree().process_frame
|
||||
modifier_manager = $ModifierManager
|
||||
Log.pr("ModifierManager: ", modifier_manager)
|
||||
1
combat/weapons/_scripts/weapon_component.gd.uid
Normal file
1
combat/weapons/_scripts/weapon_component.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://dl3kvbu0rwxky
|
||||
Loading…
Add table
Add a link
Reference in a new issue