Merge remote-tracking branch 'origin/main'

This commit is contained in:
2025-10-05 12:12:55 +02:00
37 changed files with 954 additions and 64 deletions

View File

@@ -19,11 +19,9 @@ func activate(world, activator):
for behavior in $Behaviors.get_children():
behavior.activate(world, activator)
func discard(world, activator):
func discard(world, activator, do_ability):
for behavior in $Behaviors.get_children():
behavior.discard(world, activator)
if "ammo" in behavior: # Wtf?
behavior.ammo = behavior.max_ammo
behavior.discard(world, activator, do_ability)
func get_ammo():
for behavior in $Behaviors.get_children():

View File

@@ -7,7 +7,9 @@
size = Vector2(226, 168)
[node name="CursorBullet" type="Area2D"]
scale = Vector2(0.1, 0.1)
script = ExtResource("1_ln2dr")
speed = 2000
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("1_g08wh")

View File

@@ -1,23 +1,54 @@
extends Node
@export var CursorBullet: PackedScene = preload("res://CardInjects/CursorGun/cursor_bullet.tscn")
@export var max_range = 50
@export var min_range = 50
@export var max_ammo = 30
@export var cast_time = 0.05
@export var cooldown_time = 0.1
var ammo = max_ammo
var cast_timer: Timer = Timer.new()
var cooldown_timer: Timer = Timer.new()
func _ready():
add_child(cast_timer)
cast_timer.wait_time = cast_time
cast_timer.one_shot = true
add_child(cooldown_timer)
cooldown_timer.wait_time = cooldown_time
cooldown_timer.one_shot = true
func activate(world, activator):
var target: Vector2 = activator.get_target_pos()
if cooldown_timer.time_left:
return
var target = activator.get_target_pos()
var position = activator.position
position += position.direction_to(target) \
* clamp(position.distance_to(target), min_range, max_range)
cast_timer.timeout.connect(_activate.bind(world, activator, position), CONNECT_ONE_SHOT)
cast_timer.start()
cooldown_timer.start()
func _activate(world, activator, position):
var bullet = CursorBullet.instantiate()
world.add_child(bullet)
bullet.position = activator.position
bullet.look_at(target)
bullet.position = position
bullet.look_at(activator.get_target_pos())
if activator.get_collision_layer_value(1): # player object
bullet.set_collision_layer_value (1, false)
bullet.set_collision_layer_value(2, true)
ammo -= 1
elif activator.get_collision_layer_value(2): # enemy object
bullet.set_collision_layer_value(1, true)
bullet.set_collision_layer_value(2, false)
else:
assert(false, "who are you, activator?")
func discard(world, activator):
pass
func discard(world, activator, do_ability):
ammo = max_ammo
func get_ammo():
return ammo

View File

@@ -4,17 +4,41 @@ extends Node
@export var max_range = 70
@export var min_range = 50
@export var max_ammo = 5
@export var cast_time = 0.1
@export var cooldown_time = 0.3
var ammo = max_ammo
var cast_timer: Timer = Timer.new()
var cooldown_timer: Timer = Timer.new()
func _ready():
add_child(cast_timer)
cast_timer.wait_time = cast_time
cast_timer.one_shot = true
add_child(cooldown_timer)
cooldown_timer.wait_time = cooldown_time
cooldown_timer.one_shot = true
func activate(world, activator):
var firewall = FireWall.instantiate()
if not Input.is_action_just_pressed("play_card") or cooldown_timer.time_left:
return
var target = activator.get_target_pos()
firewall.position = activator.position
firewall.position += firewall.position.direction_to(target) \
* clamp(firewall.position.distance_to(target), min_range, max_range)
var position = activator.position
position += position.direction_to(target) \
* clamp(position.distance_to(target), min_range, max_range)
cast_timer.timeout.connect(_activate.bind(world, activator, position), CONNECT_ONE_SHOT)
cast_timer.start()
cooldown_timer.start()
func _activate(world, activator, position):
var firewall = FireWall.instantiate()
firewall.position = position
if activator.get_collision_layer_value(1): # player object
firewall.get_node("Area2D").set_collision_layer_value(1, false)
firewall.get_node("Area2D").set_collision_layer_value(2, true)
ammo -= 1
elif activator.get_collision_layer_value(2): # enemy object
firewall.get_node("Area2D").set_collision_layer_value(1, true)
firewall.get_node("Area2D").set_collision_layer_value(2, false)
@@ -23,5 +47,9 @@ func activate(world, activator):
world.add_child(firewall)
func discard(world, activator):
pass
func discard(world, activator, do_ability):
ammo = max_ammo
func get_ammo():
return ammo

View File

@@ -4,18 +4,45 @@ extends Node
@export var max_range = 50
@export var min_range = 50
@export var max_ammo = 20
@export var cast_time = 0.2
@export var cooldown_time = 0.5
var ammo = max_ammo
var cast_timer: Timer = Timer.new()
var cooldown_timer: Timer = Timer.new()
func _ready():
add_child(cast_timer)
cast_timer.wait_time = cast_time
cast_timer.one_shot = true
add_child(cooldown_timer)
cooldown_timer.wait_time = cooldown_time
cooldown_timer.one_shot = true
func activate(world, activator):
if cooldown_timer.time_left:
return
var target = activator.get_target_pos()
var position = activator.position
position = position.direction_to(target) \
* clamp(position.distance_to(target), min_range, max_range)
cast_timer.timeout.connect(_activate.bind(world, activator, position), CONNECT_ONE_SHOT)
cast_timer.start()
cooldown_timer.start()
func _activate(world, activator, position):
var katana = KatanaSlash.instantiate()
var target = activator.get_target_pos()
katana.position = activator.position
katana.position += katana.position.direction_to(target) \
* clamp(katana.position.distance_to(target), min_range, max_range)
activator.add_child(katana) # KatanaSlash might have to be detached later?
katana.position = position
katana.look_at(target)
if activator.get_collision_layer_value(1): # player object
katana.get_node("Area2D").set_collision_layer_value(1, false)
katana.get_node("Area2D").set_collision_layer_value(2, true)
ammo -= 1
elif activator.get_collision_layer_value(2): # enemy object
katana.get_node("Area2D").set_collision_layer_value(1, true)
katana.get_node("Area2D").set_collision_layer_value(2, false)
@@ -23,6 +50,8 @@ func activate(world, activator):
assert(false, "who are you, activator?")
world.add_child(katana)
func discard(world, activator, do_ability):
ammo = max_ammo
func discard(world, activator):
pass
func get_ammo():
return ammo

View File

@@ -4,17 +4,41 @@ extends Node
@export var max_range = 1500
@export var min_range = 15
@export var max_ammo = 5
@export var cast_time = 0.5
@export var cooldown_time = 1.0
var ammo = max_ammo
var cast_timer: Timer = Timer.new()
var cooldown_timer: Timer = Timer.new()
func _ready():
add_child(cast_timer)
cast_timer.wait_time = cast_time
cast_timer.one_shot = true
add_child(cooldown_timer)
cooldown_timer.wait_time = cooldown_time
cooldown_timer.one_shot = true
func activate(world, activator):
var mine = Mine.instantiate()
if not Input.is_action_just_pressed("play_card") or cooldown_timer.time_left:
return
var target = activator.get_target_pos()
mine.position = activator.position
mine.position += mine.position.direction_to(target) \
* clamp(mine.position.distance_to(target), min_range, max_range)
var position = activator.position
position += position.direction_to(target) \
* clamp(position.distance_to(target), min_range, max_range)
cast_timer.timeout.connect(_activate.bind(world, activator, position), CONNECT_ONE_SHOT)
cast_timer.start()
cooldown_timer.start()
func _activate(world, activator, position):
var mine = Mine.instantiate()
mine.position = position
if activator.get_collision_layer_value(1): # player object
mine.get_node("Area2D").set_collision_layer_value(1, false)
mine.get_node("Area2D").set_collision_layer_value(2, true)
ammo -= 1
elif activator.get_collision_layer_value(2): # enemy object
mine.get_node("Area2D").set_collision_layer_value(1, true)
mine.get_node("Area2D").set_collision_layer_value(2, false)
@@ -22,5 +46,8 @@ func activate(world, activator):
assert(false, "who are you, activator?")
world.add_child(mine)
func discard(world, activator):
pass
func discard(world, activator, do_ability):
ammo = max_ammo
func get_ammo():
return ammo

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://mbey3bjcno10"
path="res://.godot/imported/Grow 1.png-c2f421c12b35e6d8c39179dd89b92bfd.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/animations/Enemy_1_MERGED/Grow 1.png"
dest_files=["res://.godot/imported/Grow 1.png-c2f421c12b35e6d8c39179dd89b92bfd.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://vjktyvv2qjr5"
path="res://.godot/imported/Grow 2.png-30558b0622cfa6d35d6fa1478e3a172a.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/animations/Enemy_1_MERGED/Grow 2.png"
dest_files=["res://.godot/imported/Grow 2.png-30558b0622cfa6d35d6fa1478e3a172a.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cfqb26he3sx4v"
path="res://.godot/imported/Idle 1.png-8b2e8d9d2581234c1d4276b79bf7ee17.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/animations/Enemy_1_MERGED/Idle 1.png"
dest_files=["res://.godot/imported/Idle 1.png-8b2e8d9d2581234c1d4276b79bf7ee17.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cjl3c06iybish"
path="res://.godot/imported/Idle 2.png-ec0619ccbe782c0ba4e92ec96eaf71c8.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/animations/Enemy_1_MERGED/Idle 2.png"
dest_files=["res://.godot/imported/Idle 2.png-ec0619ccbe782c0ba4e92ec96eaf71c8.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dxe6fxpe2inih"
path="res://.godot/imported/Idle 3.png-23c5e3a4bb0078af0bcbae9aee2ceb0e.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/animations/Enemy_1_MERGED/Idle 3.png"
dest_files=["res://.godot/imported/Idle 3.png-23c5e3a4bb0078af0bcbae9aee2ceb0e.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://ck70wlmlqhiky"
path="res://.godot/imported/Idle 4.png-e0e09d829a66890a4fbb242d3250f09a.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/animations/Enemy_1_MERGED/Idle 4.png"
dest_files=["res://.godot/imported/Idle 4.png-e0e09d829a66890a4fbb242d3250f09a.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bvr7wbue0jgjn"
path="res://.godot/imported/Idle 5.png-c46cea74de5cbc0c53325c32d75e7b52.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/animations/Enemy_1_MERGED/Idle 5.png"
dest_files=["res://.godot/imported/Idle 5.png-c46cea74de5cbc0c53325c32d75e7b52.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bf10p0wvs6khl"
path="res://.godot/imported/Processing 1.png-c24078a417d126dd46d95521b95a4842.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/animations/Enemy_1_MERGED/Processing 1.png"
dest_files=["res://.godot/imported/Processing 1.png-c24078a417d126dd46d95521b95a4842.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bag32nbg15y1y"
path="res://.godot/imported/Processing 2.png-0fdb2e98acaf5e89947c407aad5c8941.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/animations/Enemy_1_MERGED/Processing 2.png"
dest_files=["res://.godot/imported/Processing 2.png-0fdb2e98acaf5e89947c407aad5c8941.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://xj67msthi65b"
path="res://.godot/imported/Spawn 1.png-8b7f84023a7701e49a7d1c2447a351da.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/animations/Enemy_1_MERGED/Spawn 1.png"
dest_files=["res://.godot/imported/Spawn 1.png-8b7f84023a7701e49a7d1c2447a351da.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://f8vha6371gkh"
path="res://.godot/imported/Spawn 2.png-6c976441cd331c988b58deba1705790a.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/animations/Enemy_1_MERGED/Spawn 2.png"
dest_files=["res://.godot/imported/Spawn 2.png-6c976441cd331c988b58deba1705790a.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dv807t1pnq2sq"
path="res://.godot/imported/Spawn 3.png-f7ce311963e32f6653d54d72ba6fd5ef.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/animations/Enemy_1_MERGED/Spawn 3.png"
dest_files=["res://.godot/imported/Spawn 3.png-f7ce311963e32f6653d54d72ba6fd5ef.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cv5si8ahe2ata"
path="res://.godot/imported/Spawn 4.png-b55a010efed7c0f2b11fd8fd72b61be1.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/animations/Enemy_1_MERGED/Spawn 4.png"
dest_files=["res://.godot/imported/Spawn 4.png-b55a010efed7c0f2b11fd8fd72b61be1.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dw5x58lgbmpid"
path="res://.godot/imported/Spawn 5.png-2b105e724565e7fde30d091c97044dcf.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/animations/Enemy_1_MERGED/Spawn 5.png"
dest_files=["res://.godot/imported/Spawn 5.png-2b105e724565e7fde30d091c97044dcf.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

@@ -8,7 +8,7 @@ extends Control
# preload("res://Cards/FirewallCard.tscn").instantiate(),
preload("res://Cards/CursorGunCard.tscn").instantiate(),
# preload("res://Cards/CursorGunCard.tscn").instantiate(),
preload("res://Cards/DashCard.tscn").instantiate(),
# preload("res://Cards/DashCard.tscn").instantiate(),
# preload("res://Cards/DashCard.tscn").instantiate(),
preload("res://Cards/MineCard.tscn").instantiate(),
# preload("res://Cards/MineCard.tscn").instantiate(),
@@ -16,6 +16,8 @@ extends Control
#preload("res://Cards/ShieldCard.tscn").instantiate(),
#preload("res://Cards/OverclockCard.tscn").instantiate(),
#preload("res://Cards/OverclockCard.tscn").instantiate(),
preload("res://Cards/KatanaCard.tscn").instantiate(),
# preload("res://Cards/KatanaCard.tscn").instantiate(),
]
var active_card_index = 0
@@ -24,7 +26,7 @@ var discard_pile = [];
func _ready() -> void:
drawpile.shuffle();
for i in range(hand_size - get_cards().size()):
for i in range(hand_size - get_held_cards().size()):
draw_card()
func _process(_delta):
@@ -40,31 +42,46 @@ func play_card():
if active_card_index >= 0 and active_card_index < slots.size():
var card = slots[active_card_index].get_node("Card")
card.activate(get_node(world), get_node(player));
print_debug("Played card %s with %s ammo remaining" % [card.title, card.get_ammo()])
# Auto-discard if out of ammo
if card.get_ammo() <= 0:
discard(false);
func discard(do_ability = true):
print_debug("Discarding card at index %s with name %s" % [active_card_index, get_cards().get(active_card_index).title])
var cards = get_cards();
if active_card_index >= 0 and active_card_index < cards.size():
var card = cards[active_card_index]
if do_ability:
card.discard(get_node(world), get_node(player))
card.discard(get_node(world), get_node(player), do_ability)
discard_pile.append(card)
card.get_parent().remove_child(card)
#active_card_index = min(active_card_index, hand.size() - 1);
draw_card();
func cycle_card(index_shift):
var t = get_cards().size()
if t > 0:
active_card_index = (active_card_index + index_shift) % t
highlight_card(active_card_index)
else:
draw_card();
var active_card_indices = get_held_cards().map(func(card): return card.get_parent().get_index())
print_debug("Active card indices: %s" % [active_card_indices])
if active_card_indices.size() > 0:
var result_index = active_card_index + index_shift
# Wrap around the result index within the hand size
if result_index < 0:
result_index += hand_size
elif result_index >= hand_size:
result_index -= hand_size
if result_index in active_card_indices:
active_card_index = result_index
else:
active_card_index = active_card_indices[0]
else:
push_warning("No active cards to cycle through!")
print_debug("Current active card index: %s" % [active_card_index])
highlight_card(active_card_index)
func highlight_card(n):
var t = get_cards().size()
@@ -84,27 +101,19 @@ func set_inactive(n):
func get_slot(n):
return get_children()[n]
func draw_card():
var held_card_count = get_cards().size()
var held_card_count = get_held_cards().size()
if held_card_count == 0:
shuffle_deck();
if drawpile.size() > 0 and held_card_count < hand_size:
for i in range(hand_size - held_card_count):
var card = drawpile.pop_back();
if active_card_index == -1:
active_card_index = 0;
var empty_slots = get_card_container().get_children().filter(func(slot): return not slot.has_method("get_node") or slot.get_node_or_null("Card") == null)
if empty_slots.size() > 0:
empty_slots[0].add_child(card)
else:
var first_filled_slot_index = -1
var slots = get_card_container().get_children()
for i in range(slots.size()):
if slots[i].has_method("get_node") and slots[i].get_node_or_null("Card") != null:
first_filled_slot_index = i
break
active_card_index = first_filled_slot_index
cycle_card(-1)
# TODO: Reboot mechanics
func shuffle_deck():
@@ -114,10 +123,13 @@ func shuffle_deck():
active_card_index = 0;
func get_cards() -> Array:
return get_card_container().get_children().map(func(c): return c.get_node_or_null("Card")).filter(func(c): return c != null)
return get_card_container().get_children().map(func(c): return c.get_node_or_null("Card"))
func get_held_cards() -> Array:
return get_cards().filter(func(c): return c != null)
func get_card_container():
return $"."
func get_active_card():
return get_cards().get(active_card_index).get_node("Card")
return get_cards().get(active_card_index).get_node_or_null("Card")

View File

@@ -18,6 +18,7 @@ var targets = [] # who the virus will attack
func _ready():
self.spawning_state = SpawningState.Spawning
self.action_state = ActionState.Waiting
$AnimationTree.set("parameters/transition/transition_request", "processing")
func _process(delta):
if self.spawning_state != SpawningState.Spawned:
@@ -48,5 +49,8 @@ func attack(target):
# do attack, block until timer
self.action_state = ActionState.Blocked
func _on_mature():
spawning_state = SpawningState.Spawned
func set_spawning():
self.spawning_state = SpawningState.Spawning
func set_spawned():
self.spawning_state = SpawningState.Spawned

View File

@@ -1,7 +1,146 @@
[gd_scene load_steps=7 format=3 uid="uid://bsv3h2lpv7h77"]
[gd_scene load_steps=29 format=3 uid="uid://bsv3h2lpv7h77"]
[ext_resource type="Script" uid="uid://bwhxwf77egesx" path="res://virus.gd" id="1_5nuwd"]
[ext_resource type="Texture2D" uid="uid://c764pu231ki6l" path="res://icon.svg" id="2_ifgnm"]
[ext_resource type="Texture2D" uid="uid://mbey3bjcno10" path="res://assets/animations/Enemy_1_MERGED/Grow 1.png" id="2_2g5hr"]
[ext_resource type="Texture2D" uid="uid://vjktyvv2qjr5" path="res://assets/animations/Enemy_1_MERGED/Grow 2.png" id="3_8stpa"]
[ext_resource type="Texture2D" uid="uid://cfqb26he3sx4v" path="res://assets/animations/Enemy_1_MERGED/Idle 1.png" id="4_7ae1t"]
[ext_resource type="Texture2D" uid="uid://cjl3c06iybish" path="res://assets/animations/Enemy_1_MERGED/Idle 2.png" id="5_lk7jo"]
[ext_resource type="Texture2D" uid="uid://dxe6fxpe2inih" path="res://assets/animations/Enemy_1_MERGED/Idle 3.png" id="6_ob56v"]
[ext_resource type="Texture2D" uid="uid://ck70wlmlqhiky" path="res://assets/animations/Enemy_1_MERGED/Idle 4.png" id="7_vvfls"]
[ext_resource type="Texture2D" uid="uid://bvr7wbue0jgjn" path="res://assets/animations/Enemy_1_MERGED/Idle 5.png" id="8_t8qsc"]
[ext_resource type="Texture2D" uid="uid://bf10p0wvs6khl" path="res://assets/animations/Enemy_1_MERGED/Processing 1.png" id="9_7ae1t"]
[ext_resource type="Texture2D" uid="uid://xj67msthi65b" path="res://assets/animations/Enemy_1_MERGED/Spawn 1.png" id="9_ku2y3"]
[ext_resource type="Texture2D" uid="uid://f8vha6371gkh" path="res://assets/animations/Enemy_1_MERGED/Spawn 2.png" id="10_lgldr"]
[ext_resource type="Texture2D" uid="uid://bag32nbg15y1y" path="res://assets/animations/Enemy_1_MERGED/Processing 2.png" id="10_lk7jo"]
[ext_resource type="Texture2D" uid="uid://dv807t1pnq2sq" path="res://assets/animations/Enemy_1_MERGED/Spawn 3.png" id="11_6n17y"]
[ext_resource type="Texture2D" uid="uid://cv5si8ahe2ata" path="res://assets/animations/Enemy_1_MERGED/Spawn 4.png" id="12_w17xr"]
[ext_resource type="Texture2D" uid="uid://dw5x58lgbmpid" path="res://assets/animations/Enemy_1_MERGED/Spawn 5.png" id="13_6dvfq"]
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_lk7jo"]
animation = &"virus_spawning"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_ob56v"]
animation = &"virus_idle"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_7ae1t"]
animation = &"virus_processing"
[sub_resource type="AnimationNodeTransition" id="AnimationNodeTransition_7ae1t"]
input_0/name = "processing"
input_0/auto_advance = true
input_0/break_loop_at_end = true
input_0/reset = true
input_1/name = "spawning"
input_1/auto_advance = true
input_1/break_loop_at_end = true
input_1/reset = true
input_2/name = "idle"
input_2/auto_advance = false
input_2/break_loop_at_end = false
input_2/reset = true
[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_lk7jo"]
graph_offset = Vector2(-232.38345, 122.08092)
nodes/output/position = Vector2(580, 300)
nodes/Animation/node = SubResource("AnimationNodeAnimation_7ae1t")
nodes/Animation/position = Vector2(80, 140)
"nodes/Animation 3/node" = SubResource("AnimationNodeAnimation_ob56v")
"nodes/Animation 3/position" = Vector2(80, 580)
nodes/transition/node = SubResource("AnimationNodeTransition_7ae1t")
nodes/transition/position = Vector2(360, 300)
"nodes/Animation 2/node" = SubResource("AnimationNodeAnimation_lk7jo")
"nodes/Animation 2/position" = Vector2(80, 360)
node_connections = [&"output", 0, &"transition", &"transition", 0, &"Animation", &"transition", 1, &"Animation 2", &"transition", 2, &"Animation 3"]
[sub_resource type="Animation" id="Animation_7ae1t"]
resource_name = "virus_processing"
length = 3.7875
loop_mode = 1
tracks/0/type = "method"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("../AnimatedSprite2D")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [&"processing", 1.0, false],
"method": &"play"
}]
}
tracks/1/type = "method"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("..")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
"method": &"set_spawning"
}]
}
[sub_resource type="Animation" id="Animation_lk7jo"]
resource_name = "virus_spawning"
length = 0.16667001
tracks/0/type = "method"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("../AnimatedSprite2D")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [&"spawn", 1.0, false],
"method": &"play"
}]
}
[sub_resource type="Animation" id="Animation_ob56v"]
resource_name = "virus_idle"
loop_mode = 1
tracks/0/type = "method"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("../AnimatedSprite2D")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [&"idle", 1.0, false],
"method": &"play"
}]
}
tracks/1/type = "method"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("..")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
"method": &"set_spawned"
}]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_lk7jo"]
_data = {
&"virus_idle": SubResource("Animation_ob56v"),
&"virus_processing": SubResource("Animation_7ae1t"),
&"virus_spawning": SubResource("Animation_lk7jo")
}
[sub_resource type="Shader" id="Shader_8v58v"]
code = "shader_type canvas_item;
@@ -27,10 +166,64 @@ shader = SubResource("Shader_8v58v")
animations = [{
"frames": [{
"duration": 1.0,
"texture": ExtResource("2_ifgnm")
"texture": ExtResource("2_2g5hr")
}, {
"duration": 1.0,
"texture": ExtResource("3_8stpa")
}],
"loop": false,
"name": &"grow",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": ExtResource("4_7ae1t")
}, {
"duration": 1.0,
"texture": ExtResource("5_lk7jo")
}, {
"duration": 1.0,
"texture": ExtResource("6_ob56v")
}, {
"duration": 1.0,
"texture": ExtResource("7_vvfls")
}, {
"duration": 1.0,
"texture": ExtResource("8_t8qsc")
}],
"loop": true,
"name": &"default",
"name": &"idle",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": ExtResource("9_7ae1t")
}, {
"duration": 1.0,
"texture": ExtResource("10_lk7jo")
}],
"loop": true,
"name": &"processing",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": ExtResource("9_ku2y3")
}, {
"duration": 1.0,
"texture": ExtResource("10_lgldr")
}, {
"duration": 1.0,
"texture": ExtResource("11_6n17y")
}, {
"duration": 1.0,
"texture": ExtResource("12_w17xr")
}, {
"duration": 1.0,
"texture": ExtResource("13_6dvfq")
}],
"loop": false,
"name": &"spawn",
"speed": 5.0
}]
@@ -40,20 +233,26 @@ size = Vector2(128, 128)
[node name="Virus" type="Node2D"]
script = ExtResource("1_5nuwd")
[node name="AnimationTree" type="AnimationTree" parent="."]
root_node = NodePath(".")
tree_root = SubResource("AnimationNodeBlendTree_lk7jo")
anim_player = NodePath("AnimationPlayer")
parameters/transition/current_state = "idle"
parameters/transition/transition_request = ""
parameters/transition/current_index = 2
[node name="AnimationPlayer" type="AnimationPlayer" parent="AnimationTree"]
libraries = {
&"": SubResource("AnimationLibrary_lk7jo")
}
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
material = SubResource("ShaderMaterial_8fg0l")
sprite_frames = SubResource("SpriteFrames_1xnis")
animation = &"spawn"
autoplay = "grow"
[node name="Area2D" type="Area2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
shape = SubResource("RectangleShape2D_ifgnm")
[node name="RayCast2D" type="RayCast2D" parent="."]
[node name="SpawningTime" type="Timer" parent="."]
editor_description = "How long to mature from Spawning to Spawned"
one_shot = true
autostart = true
[connection signal="timeout" from="SpawningTime" to="." method="_on_mature"]