Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic Battle Scene/System #4

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions LineCodeCounter.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
@tool
extends EditorScript

func _run() -> void:
var total_lines: int = 0
var blanks : int = 0
var comments: int = 0
var codes: int = 0
var script_files: Array[String] = []

var dir: DirAccess = DirAccess.open("res://")
if dir:
script_files = Get_script_files(dir)

for script_file : String in script_files:
var file: FileAccess = FileAccess.open(script_file, FileAccess.READ)
if file:
while not file.eof_reached():
total_lines += 1
var text : String = file.get_line()
if text == "":
blanks += 1
continue
if text.begins_with("#"):
comments += 1
continue
codes += 1
file.close()

print("Script count: ", script_files.size())
print("Codes: ", codes)
print("Blanks: ", blanks)
print("Comments: ", comments)
print("Total lines: ", total_lines)

func Get_script_files(dir: DirAccess) -> Array[String]:
var script_files: Array[String] = []
dir.list_dir_begin()
var file_name: String = dir.get_next()

while file_name != "":
var current: String = dir.get_current_dir() + "/" + file_name

if dir.current_is_dir() and file_name != "." and file_name != "..":
var subdir: DirAccess = DirAccess.open(current)
if subdir:
script_files += Get_script_files(subdir)
elif file_name.ends_with(".gd"):
script_files.append(current)

file_name = dir.get_next()

dir.list_dir_end()
return script_files
Binary file added art/04B_11__.TTF
Binary file not shown.
40 changes: 40 additions & 0 deletions art/04B_11__.TTF.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[remap]

importer="font_data_dynamic"
type="FontFile"
uid="uid://c56rtacbksa5q"
path="res://.godot/imported/04B_11__.TTF-62df5a227b65b571c60713c427f06d4f.fontdata"

[deps]

source_file="res://art/04B_11__.TTF"
dest_files=["res://.godot/imported/04B_11__.TTF-62df5a227b65b571c60713c427f06d4f.fontdata"]

[params]

Rendering=null
antialiasing=0
generate_mipmaps=false
disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=1
oversampling=4.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=false
preload=[{
"chars": [],
"glyphs": [],
"name": "New Configuration",
"size": Vector2i(16, 0),
"variation_embolden": 0.0
}]
language_support={}
script_support={}
opentype_features={}
Binary file added art/characters/skeddles/skeddles.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://bxsbc7vc6xsxi"
path="res://.godot/imported/skeddles.png-a814d90c741a030df7cd48a4094a5a1c.ctex"
path="res://.godot/imported/skeddles.png-4ca274f35083a7c24744fe91c97ab653.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://characters/skeddles/skeddles.png"
dest_files=["res://.godot/imported/skeddles.png-a814d90c741a030df7cd48a4094a5a1c.ctex"]
source_file="res://art/characters/skeddles/skeddles.png"
dest_files=["res://.godot/imported/skeddles.png-4ca274f35083a7c24744fe91c97ab653.ctex"]

[params]

Expand Down
Binary file added art/characters/skeddles/smiley.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://dxllgjcrdt3e6"
path="res://.godot/imported/smiley.png-1b8cfda880f18dcdaaaa669e7c2b5396.ctex"
path="res://.godot/imported/smiley.png-a038f6df6cdc66480ced0fb459704fda.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://characters/skeddles/smiley.png"
dest_files=["res://.godot/imported/smiley.png-1b8cfda880f18dcdaaaa669e7c2b5396.ctex"]
source_file="res://art/characters/skeddles/smiley.png"
dest_files=["res://.godot/imported/smiley.png-a038f6df6cdc66480ced0fb459704fda.ctex"]

[params]

Expand Down
Binary file added art/image (1).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions art/image (1).png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://db0nefci05mgl"
path="res://.godot/imported/image (1).png-fe3e3dee28d53e05330c00b7a41e6001.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://art/image (1).png"
dest_files=["res://.godot/imported/image (1).png-fe3e3dee28d53e05330c00b7a41e6001.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
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/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 added art/rip_v1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions art/rip_v1.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://c81c6mcak0iba"
path="res://.godot/imported/rip_v1.png-f39a29d66f2b1b97d9ee18cacbd77ce4.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://art/rip_v1.png"
dest_files=["res://.godot/imported/rip_v1.png-f39a29d66f2b1b97d9ee18cacbd77ce4.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
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/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 added art/rip_v2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions art/rip_v2.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://dmyyahkb03171"
path="res://.godot/imported/rip_v2.png-1da59cac4a6b0e5f2d82ba3c655682b4.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://art/rip_v2.png"
dest_files=["res://.godot/imported/rip_v2.png-1da59cac4a6b0e5f2d82ba3c655682b4.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
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/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 added art/select_that.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions art/select_that.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://c4qk80jxsktq2"
path="res://.godot/imported/select_that.png-d87110de11bb6a2c5213ff883f22abd4.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://art/select_that.png"
dest_files=["res://.godot/imported/select_that.png-d87110de11bb6a2c5213ff883f22abd4.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
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/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 added art/that.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions art/that.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://6ebkwyjw5gd3"
path="res://.godot/imported/that.png-b547b379c5d59ac88dc1b6da8d3d9b5c.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://art/that.png"
dest_files=["res://.godot/imported/that.png-b547b379c5d59ac88dc1b6da8d3d9b5c.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
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/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
17 changes: 17 additions & 0 deletions autoloads/AudioManager.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
extends AudioStreamPlayer

func PlayMusic(music : AudioStream, replay : bool = false) -> void:
if stream == music && !replay:
return
stream = music
play()

func PlaySFX(sfx : AudioStream) -> void:
var sfx_player : AudioStreamPlayer = AudioStreamPlayer.new()
sfx_player.stream = sfx
sfx_player.bus = "Sfx"
add_child(sfx_player)
sfx_player.play()
await sfx_player.finished

sfx_player.queue_free()
6 changes: 6 additions & 0 deletions autoloads/AudioManager.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://beajgdgp7qt10"]

[ext_resource type="Script" path="res://autoloads/AudioManager.gd" id="1_u2pm7"]

[node name="AudioManager" type="AudioStreamPlayer"]
script = ExtResource("1_u2pm7")
21 changes: 21 additions & 0 deletions autoloads/Globals.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
extends Node

var player : Player
var battle_manager : BattleManager
var player_party : Array[CharacterSheet] = []
var player_inv : Array[Item]


var money : int

@warning_ignore("unused_signal")
signal battle
@warning_ignore("unused_signal")
signal game_world


func _ready() -> void:
battle_manager = load("res://scenes/battle_scene/battle_manager.tscn").instantiate()
add_child(battle_manager)
battle_manager.visible = false

Loading