├── .gitignore ├── icon.png ├── cards ├── a.png ├── b.png ├── flo.png ├── flosC.png ├── mana_blue.png ├── mana_red.png ├── mana_green.png ├── mana_blue.gd ├── mana_red.gd ├── mana_green.gd ├── flosC.gd ├── flo.gd ├── b.gd ├── a.gd ├── a.png.import ├── b.png.import ├── flo.png.import ├── flosC.png.import ├── mana_red.png.import ├── mana_blue.png.import └── mana_green.png.import ├── Font └── Arial.ttf ├── theme ├── card.theme └── table.theme ├── mana_template.xcf ├── resources ├── mana.png ├── GreenMana.png ├── magic_card.png ├── mana.png.import ├── GreenMana.png.import └── magic_card.png.import ├── Autoload ├── CardLocation.gd ├── ManaType.gd ├── Dpi.gd ├── TableLocation.gd └── Global.gd ├── card_class ├── card_types │ ├── card_basic_mana.gd │ ├── card_creature.gd │ └── creature_template.gd ├── Label.gd ├── autoloads │ ├── card_cache.gd │ └── card_renderer.gd ├── card_creation │ ├── card_populate.gd │ └── card.tscn ├── test_card_renderer.tscn ├── holder.tscn ├── card_base.gd └── holder.gd ├── TextureRect.gd ├── resize.gd ├── game_table ├── mana_control.tscn ├── game_table.tscn ├── mana_control.gd ├── game_table.gd ├── player_side.gd └── player_side.tscn ├── icon.png.import ├── default_env.tres ├── test_font.tscn ├── project.godot └── export_presets.cfg /.gitignore: -------------------------------------------------------------------------------- 1 | .import -------------------------------------------------------------------------------- /icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toger5/OpenCardGame/HEAD/icon.png -------------------------------------------------------------------------------- /cards/a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toger5/OpenCardGame/HEAD/cards/a.png -------------------------------------------------------------------------------- /cards/b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toger5/OpenCardGame/HEAD/cards/b.png -------------------------------------------------------------------------------- /Font/Arial.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toger5/OpenCardGame/HEAD/Font/Arial.ttf -------------------------------------------------------------------------------- /cards/flo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toger5/OpenCardGame/HEAD/cards/flo.png -------------------------------------------------------------------------------- /cards/flosC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toger5/OpenCardGame/HEAD/cards/flosC.png -------------------------------------------------------------------------------- /theme/card.theme: -------------------------------------------------------------------------------- 1 | [gd_resource type="Theme" format=2] 2 | 3 | [resource] 4 | 5 | 6 | -------------------------------------------------------------------------------- /cards/mana_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toger5/OpenCardGame/HEAD/cards/mana_blue.png -------------------------------------------------------------------------------- /cards/mana_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toger5/OpenCardGame/HEAD/cards/mana_red.png -------------------------------------------------------------------------------- /mana_template.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toger5/OpenCardGame/HEAD/mana_template.xcf -------------------------------------------------------------------------------- /resources/mana.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toger5/OpenCardGame/HEAD/resources/mana.png -------------------------------------------------------------------------------- /theme/table.theme: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toger5/OpenCardGame/HEAD/theme/table.theme -------------------------------------------------------------------------------- /cards/mana_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toger5/OpenCardGame/HEAD/cards/mana_green.png -------------------------------------------------------------------------------- /resources/GreenMana.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toger5/OpenCardGame/HEAD/resources/GreenMana.png -------------------------------------------------------------------------------- /resources/magic_card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toger5/OpenCardGame/HEAD/resources/magic_card.png -------------------------------------------------------------------------------- /Autoload/CardLocation.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | enum CardLocation {DECK, HAND, GRAVEYARD, BATTLEFIELD, MANA, ATTACK} -------------------------------------------------------------------------------- /cards/mana_blue.gd: -------------------------------------------------------------------------------- 1 | extends "res://card_class/card_types/card_basic_mana.gd" 2 | 3 | func _init(): 4 | mana_type = ManaType.BLUE -------------------------------------------------------------------------------- /cards/mana_red.gd: -------------------------------------------------------------------------------- 1 | extends "res://card_class/card_types/card_basic_mana.gd" 2 | 3 | func _init(): 4 | mana_type = ManaType.RED -------------------------------------------------------------------------------- /cards/mana_green.gd: -------------------------------------------------------------------------------- 1 | extends "res://card_class/card_types/card_basic_mana.gd" 2 | 3 | func _init(): 4 | mana_type = ManaType.GREEN -------------------------------------------------------------------------------- /card_class/card_types/card_basic_mana.gd: -------------------------------------------------------------------------------- 1 | extends "res://card_class/card_base.gd" 2 | 3 | var mana_type 4 | 5 | func _init(): 6 | type = CardType.LAND 7 | 8 | func _cast(): 9 | print("mana_casted") 10 | ._cast() -------------------------------------------------------------------------------- /TextureRect.gd: -------------------------------------------------------------------------------- 1 | extends TextureRect 2 | 3 | var c = load("res://cards/a.gd").new() 4 | func _ready(): 5 | c.render_on(self) 6 | 7 | func _on_Button_pressed(): 8 | if texture: 9 | texture = null 10 | else: 11 | c.update_tex() 12 | -------------------------------------------------------------------------------- /cards/flosC.gd: -------------------------------------------------------------------------------- 1 | extends "res://card_class/card_base.gd" 2 | 3 | func _init(): 4 | name = "Da INSTNAT Stadt die freude macht" 5 | text = "spilen dann sind die mosnter gluecklicj und machen mehr damage und das is echt wichtig!!" 6 | type = CardType.INSTANT -------------------------------------------------------------------------------- /cards/flo.gd: -------------------------------------------------------------------------------- 1 | extends "res://card_class/card_types/card_creature.gd" 2 | 3 | func _init(): 4 | name = "Its Flo The moster" 5 | text = "nothing to worry becuase i think i can carry. (Also: I'm not too certain if the picture is correct...)" 6 | type = CardType.CREATURE -------------------------------------------------------------------------------- /cards/b.gd: -------------------------------------------------------------------------------- 1 | extends "res://card_class/card_types/card_creature.gd" 2 | 3 | func _init(): 4 | name = "This is a different Monster" 5 | text = "Its just different... noone knows how." 6 | type = CardType.CREATURE 7 | max_lives = 1 8 | max_attack = 1 9 | mana_cost[ManaType.RED] = 2 -------------------------------------------------------------------------------- /cards/a.gd: -------------------------------------------------------------------------------- 1 | extends "res://card_class/card_base.gd" 2 | 3 | func _init(): 4 | name = "ANice instant" 5 | text = "the first and beautiful instant. It actually looks really fcking good" 6 | type = CardType.INSTANT 7 | 8 | mana_cost[ManaType.RED] = 1 9 | mana_cost[ManaType.BLUE] = 2 10 | -------------------------------------------------------------------------------- /resize.gd: -------------------------------------------------------------------------------- 1 | tool 2 | extends EditorScript 3 | 4 | func _run(): 5 | print("I LIVE") 6 | var t = load("res://cards/flo.png").get_data() 7 | var ratio = t.get_size().x / t.get_size().y 8 | print(t) 9 | t.resize(640, 640 / ratio) 10 | print(t.save_png("res://cards/flossss.png")) 11 | get_editor_interface().get_resource_filesystem().scan() -------------------------------------------------------------------------------- /Autoload/ManaType.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | enum {WHITE, BLUE, BLACK, RED, GREEN, COLORLESS} #this order should always be used ex. in mana costs (its the original mtg order) 4 | 5 | var list = [WHITE, BLUE, BLACK, RED, GREEN, COLORLESS] 6 | 7 | func color(type): 8 | match(type): 9 | RED: return Color(0.8, 0.2, 0.2) 10 | BLUE: return Color(0.2, 0.2, 0.8) 11 | GREEN: return Color(0.2, 0.8, 0.2) 12 | print("ManaType color not found") 13 | return Color(1,0,0) -------------------------------------------------------------------------------- /card_class/Label.gd: -------------------------------------------------------------------------------- 1 | extends Label 2 | 3 | # class member variables go here, for example: 4 | # var a = 2 5 | # var b = "textvar" 6 | 7 | func _ready(): 8 | $Timer.connect("timeout", self, "t") 9 | # Called when the node is added to the scene for the first time. 10 | # Initialization here. 11 | pass 12 | func t(): 13 | autowrap = true 14 | text += "i " 15 | rect_position.y += 4 16 | #func _process(delta): 17 | # # Called every frame. Delta is time since last frame. 18 | # # Update game logic here. 19 | # pass 20 | -------------------------------------------------------------------------------- /card_class/card_types/card_creature.gd: -------------------------------------------------------------------------------- 1 | extends "res://card_class/card_base.gd" 2 | 3 | var max_lives = 0 4 | var max_attack = 0 5 | 6 | #events 7 | func _can_attack(): 8 | #trys to attack only if it returns true the attack can be executed 9 | return true 10 | 11 | func _attack(target): 12 | #called 13 | pass 14 | func _can_block(target): 15 | #TODO standart rules 16 | return true 17 | func _block_target(): 18 | pass 19 | 20 | func _can_cast_tab_spell(): 21 | return true 22 | func _cast_tap_spell(): 23 | print("tap_spell casted from: "+name) 24 | 25 | # handler 26 | func _action_on_card(card): 27 | _attack(card) -------------------------------------------------------------------------------- /game_table/mana_control.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=2 format=2] 2 | 3 | [ext_resource path="res://game_table/mana_control.gd" type="Script" id=1] 4 | 5 | [node name="mana_control" type="VBoxContainer" index="0"] 6 | anchor_left = 0.0 7 | anchor_top = 0.0 8 | anchor_right = 0.0 9 | anchor_bottom = 0.0 10 | margin_right = 60.0 11 | margin_bottom = 400.0 12 | rect_pivot_offset = Vector2( 0, 0 ) 13 | rect_clip_content = false 14 | mouse_filter = 1 15 | mouse_default_cursor_shape = 0 16 | size_flags_horizontal = 1 17 | size_flags_vertical = 1 18 | alignment = 0 19 | script = ExtResource( 1 ) 20 | _sections_unfolded = [ "Rect" ] 21 | show_children = true 22 | 23 | -------------------------------------------------------------------------------- /cards/a.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/a.png-d85ca99b0bd081968ead87ce791d8eb4.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://cards/a.png" 10 | dest_files=[ "res://.import/a.png-d85ca99b0bd081968ead87ce791d8eb4.stex" ] 11 | 12 | [params] 13 | 14 | compress/mode=0 15 | compress/lossy_quality=0.7 16 | compress/hdr_mode=0 17 | compress/normal_map=0 18 | flags/repeat=0 19 | flags/filter=true 20 | flags/mipmaps=false 21 | flags/anisotropic=false 22 | flags/srgb=2 23 | process/fix_alpha_border=true 24 | process/premult_alpha=false 25 | process/HDR_as_SRGB=false 26 | stream=false 27 | size_limit=0 28 | detect_3d=true 29 | svg/scale=1.0 30 | -------------------------------------------------------------------------------- /cards/b.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/b.png-17348e76d5eb2d9803700fe9321e6f63.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://cards/b.png" 10 | dest_files=[ "res://.import/b.png-17348e76d5eb2d9803700fe9321e6f63.stex" ] 11 | 12 | [params] 13 | 14 | compress/mode=0 15 | compress/lossy_quality=0.7 16 | compress/hdr_mode=0 17 | compress/normal_map=0 18 | flags/repeat=0 19 | flags/filter=true 20 | flags/mipmaps=false 21 | flags/anisotropic=false 22 | flags/srgb=2 23 | process/fix_alpha_border=true 24 | process/premult_alpha=false 25 | process/HDR_as_SRGB=false 26 | stream=false 27 | size_limit=0 28 | detect_3d=true 29 | svg/scale=1.0 30 | -------------------------------------------------------------------------------- /icon.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://icon.png" 10 | dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ] 11 | 12 | [params] 13 | 14 | compress/mode=0 15 | compress/lossy_quality=0.7 16 | compress/hdr_mode=0 17 | compress/normal_map=0 18 | flags/repeat=0 19 | flags/filter=true 20 | flags/mipmaps=false 21 | flags/anisotropic=false 22 | flags/srgb=2 23 | process/fix_alpha_border=true 24 | process/premult_alpha=false 25 | process/HDR_as_SRGB=false 26 | stream=false 27 | size_limit=0 28 | detect_3d=true 29 | svg/scale=1.0 30 | -------------------------------------------------------------------------------- /cards/flo.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/flo.png-630be1be5696fb221b8e5ee6774be2a6.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://cards/flo.png" 10 | dest_files=[ "res://.import/flo.png-630be1be5696fb221b8e5ee6774be2a6.stex" ] 11 | 12 | [params] 13 | 14 | compress/mode=0 15 | compress/lossy_quality=0.7 16 | compress/hdr_mode=0 17 | compress/normal_map=0 18 | flags/repeat=0 19 | flags/filter=true 20 | flags/mipmaps=false 21 | flags/anisotropic=false 22 | flags/srgb=2 23 | process/fix_alpha_border=true 24 | process/premult_alpha=false 25 | process/HDR_as_SRGB=false 26 | stream=false 27 | size_limit=0 28 | detect_3d=true 29 | svg/scale=1.0 30 | -------------------------------------------------------------------------------- /cards/flosC.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/flosC.png-0883a28e2bf8efb58aef65d628d73158.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://cards/flosC.png" 10 | dest_files=[ "res://.import/flosC.png-0883a28e2bf8efb58aef65d628d73158.stex" ] 11 | 12 | [params] 13 | 14 | compress/mode=0 15 | compress/lossy_quality=0.7 16 | compress/hdr_mode=0 17 | compress/normal_map=0 18 | flags/repeat=0 19 | flags/filter=true 20 | flags/mipmaps=false 21 | flags/anisotropic=false 22 | flags/srgb=2 23 | process/fix_alpha_border=true 24 | process/premult_alpha=false 25 | process/HDR_as_SRGB=false 26 | stream=false 27 | size_limit=0 28 | detect_3d=true 29 | svg/scale=1.0 30 | -------------------------------------------------------------------------------- /resources/mana.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/mana.png-fbeddf043aad9eb974ca684ead916c37.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://resources/mana.png" 10 | dest_files=[ "res://.import/mana.png-fbeddf043aad9eb974ca684ead916c37.stex" ] 11 | 12 | [params] 13 | 14 | compress/mode=0 15 | compress/lossy_quality=0.7 16 | compress/hdr_mode=0 17 | compress/normal_map=0 18 | flags/repeat=0 19 | flags/filter=true 20 | flags/mipmaps=false 21 | flags/anisotropic=false 22 | flags/srgb=2 23 | process/fix_alpha_border=true 24 | process/premult_alpha=false 25 | process/HDR_as_SRGB=false 26 | stream=false 27 | size_limit=0 28 | detect_3d=true 29 | svg/scale=1.0 30 | -------------------------------------------------------------------------------- /cards/mana_red.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/mana_red.png-218ba3031084b75fa0b50236aa7f4658.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://cards/mana_red.png" 10 | dest_files=[ "res://.import/mana_red.png-218ba3031084b75fa0b50236aa7f4658.stex" ] 11 | 12 | [params] 13 | 14 | compress/mode=0 15 | compress/lossy_quality=0.7 16 | compress/hdr_mode=0 17 | compress/normal_map=0 18 | flags/repeat=0 19 | flags/filter=true 20 | flags/mipmaps=false 21 | flags/anisotropic=false 22 | flags/srgb=2 23 | process/fix_alpha_border=true 24 | process/premult_alpha=false 25 | process/HDR_as_SRGB=false 26 | stream=false 27 | size_limit=0 28 | detect_3d=true 29 | svg/scale=1.0 30 | -------------------------------------------------------------------------------- /cards/mana_blue.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/mana_blue.png-4b638f98aa67f4f8436ff4b0ec8aa922.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://cards/mana_blue.png" 10 | dest_files=[ "res://.import/mana_blue.png-4b638f98aa67f4f8436ff4b0ec8aa922.stex" ] 11 | 12 | [params] 13 | 14 | compress/mode=0 15 | compress/lossy_quality=0.7 16 | compress/hdr_mode=0 17 | compress/normal_map=0 18 | flags/repeat=0 19 | flags/filter=true 20 | flags/mipmaps=false 21 | flags/anisotropic=false 22 | flags/srgb=2 23 | process/fix_alpha_border=true 24 | process/premult_alpha=false 25 | process/HDR_as_SRGB=false 26 | stream=false 27 | size_limit=0 28 | detect_3d=true 29 | svg/scale=1.0 30 | -------------------------------------------------------------------------------- /cards/mana_green.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/mana_green.png-63a516eb5626780de1209295e974c84d.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://cards/mana_green.png" 10 | dest_files=[ "res://.import/mana_green.png-63a516eb5626780de1209295e974c84d.stex" ] 11 | 12 | [params] 13 | 14 | compress/mode=0 15 | compress/lossy_quality=0.7 16 | compress/hdr_mode=0 17 | compress/normal_map=0 18 | flags/repeat=0 19 | flags/filter=true 20 | flags/mipmaps=false 21 | flags/anisotropic=false 22 | flags/srgb=2 23 | process/fix_alpha_border=true 24 | process/premult_alpha=false 25 | process/HDR_as_SRGB=false 26 | stream=false 27 | size_limit=0 28 | detect_3d=true 29 | svg/scale=1.0 30 | -------------------------------------------------------------------------------- /resources/GreenMana.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/GreenMana.png-3a1c3a27389fa27c7f4014dda9f7246a.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://resources/GreenMana.png" 10 | dest_files=[ "res://.import/GreenMana.png-3a1c3a27389fa27c7f4014dda9f7246a.stex" ] 11 | 12 | [params] 13 | 14 | compress/mode=0 15 | compress/lossy_quality=0.7 16 | compress/hdr_mode=0 17 | compress/normal_map=0 18 | flags/repeat=0 19 | flags/filter=true 20 | flags/mipmaps=false 21 | flags/anisotropic=false 22 | flags/srgb=2 23 | process/fix_alpha_border=true 24 | process/premult_alpha=false 25 | process/HDR_as_SRGB=false 26 | stream=false 27 | size_limit=0 28 | detect_3d=true 29 | svg/scale=1.0 30 | -------------------------------------------------------------------------------- /resources/magic_card.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/magic_card.png-e12ae5e2cdd41e4a840363acb39bc1fe.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://resources/magic_card.png" 10 | dest_files=[ "res://.import/magic_card.png-e12ae5e2cdd41e4a840363acb39bc1fe.stex" ] 11 | 12 | [params] 13 | 14 | compress/mode=0 15 | compress/lossy_quality=0.7 16 | compress/hdr_mode=0 17 | compress/normal_map=0 18 | flags/repeat=0 19 | flags/filter=true 20 | flags/mipmaps=false 21 | flags/anisotropic=false 22 | flags/srgb=2 23 | process/fix_alpha_border=true 24 | process/premult_alpha=false 25 | process/HDR_as_SRGB=false 26 | stream=false 27 | size_limit=0 28 | detect_3d=true 29 | svg/scale=1.0 30 | -------------------------------------------------------------------------------- /card_class/autoloads/card_cache.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | var cache = {} 4 | func _ready(): 5 | pass 6 | 7 | func card(card_file_name): 8 | if not cache.has(card_file_name): 9 | cache[card_file_name] = load("res://cards/"+card_file_name+".gd") 10 | print("created cache entry: "+ card_file_name) 11 | return cache[card_file_name].new() 12 | 13 | func card_by_id(id): 14 | print("not yet implemented") 15 | 16 | func get_all_card_names(): 17 | var d = Directory.new() 18 | var card_names = [] 19 | if d.open("res://cards/") == OK: 20 | d.list_dir_begin() 21 | var dir_el_name = d.get_next() 22 | while dir_el_name != "": 23 | if dir_el_name.ends_with(".gd"): 24 | card_names.append(dir_el_name.split(".")[0]) 25 | dir_el_name = d.get_next() 26 | return card_names -------------------------------------------------------------------------------- /card_class/card_types/creature_template.gd: -------------------------------------------------------------------------------- 1 | extends "res://card_class/card_base.gd" 2 | 3 | #enum CardType = {INSTANT, CREATURE} 4 | #enum ManaType = {RED, BLUE} 5 | #enum CardLocation = {DECK, HAND, GRAVEYARD, BATTLEFIELD} 6 | 7 | #props 8 | var name = "[Define Name]" 9 | var text = "[Define text]" 10 | var type = null 11 | var img_path = "empty" #automtically searches for the a file with same name than .gd 12 | var mana_cost #saved as a dict with keys of ManaType 13 | 14 | var max_lives 15 | var max_attack 16 | 17 | #events 18 | 19 | #func _init(): 20 | 21 | #func _cast(): 22 | # ._cast() 23 | 24 | #func _can_attack(): 25 | 26 | #func _attack(target): 27 | 28 | #func _can_block(target): #-> bool 29 | 30 | #func _block_target(): 31 | 32 | #func _can_cast_tab_spell(): #-> bool 33 | 34 | #func _cast_tab_spell(): 35 | -------------------------------------------------------------------------------- /Autoload/Dpi.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | var font_size_cm = 0.4 4 | var screen_dpi = OS.get_screen_dpi(0) 5 | func _ready(): 6 | var theme = load("res://theme/table.theme") 7 | theme.default_font.size = cm_to_pixel(font_size_cm) 8 | 9 | func cm_to_pixel(cm): 10 | return screen_dpi * cm/2.5 11 | 12 | 13 | var screen_size setget ,_get_screen_size 14 | var player_size setget ,_get_player_size 15 | func _get_screen_size(): return get_tree().get_root().size 16 | func _get_player_size(): return Vector2(_get_screen_size().x, _get_screen_size().y/2) 17 | 18 | 19 | #SIZE CONSTANTS 20 | var ATTACK_INDICATE_HEIGHT setget ,_get_attack_indicate_height 21 | func _get_attack_indicate_height(): return (_get_player_size().y) / 8 22 | 23 | var ATTACK_SPACER_HEIGHT setget ,_get_attack_spacer_height 24 | func _get_attack_spacer_height(): return (_get_player_size().y) / 4 25 | 26 | var HAND_HEIGHT setget ,_get_hand_height 27 | func _get_hand_height(): return _get_player_size().y / 3 28 | 29 | var GAP_SIZE setget ,_get_gap_size 30 | func _get_gap_size(): return cm_to_pixel(0.2) 31 | 32 | -------------------------------------------------------------------------------- /Autoload/TableLocation.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | enum {BOTTOM_BF, BOTTOM_HAND, GRAVEYARD, DECK, TOP_HAND, TOP_BF, ATTACK_SPACE} 4 | 5 | func mouse_pos(): 6 | var mo 7 | var mp = Global.game_table.get_global_mouse_position() 8 | if Global.game_table.player.hand_node.get_global_rect().has_point(mp): 9 | mo = TableLocation.BOTTOM_HAND 10 | elif Global.game_table.player.bf_node.get_global_rect().has_point(mp): 11 | mo = TableLocation.BOTTOM_BF 12 | elif Global.game_table.opponent.hand_node.get_global_rect().has_point(mp): 13 | mo = TableLocation.TOP_HAND 14 | elif Global.game_table.opponent.bf_node.get_global_rect().has_point(mp): 15 | mo = TableLocation.TOP_BF 16 | elif Global.game_table.player.attack_phase_spacer.get_global_rect().has_point(mp) or Global.game_table.opponent.attack_phase_spacer.get_global_rect().has_point(mp): 17 | mo = TableLocation.ATTACK_SPACE 18 | return mo 19 | 20 | func mouse_over_cast_area(): 21 | var mo = mouse_pos() 22 | return mo == TOP_BF or mo == BOTTOM_BF 23 | 24 | func opponent_bf(player): 25 | if player.table_side == player.TableSide.TOP: 26 | return TableLocation.BOTTOM_BF 27 | else: 28 | return TableLocation.TOP_BF -------------------------------------------------------------------------------- /card_class/autoloads/card_renderer.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | var card_scn = preload("res://card_class/card_creation/card.tscn") 4 | 5 | var card_size = Vector2()# setget card_size_checked 6 | var card_viewports = {} 7 | func add_card_vp(card): 8 | var render_vp = Viewport.new() 9 | var card_node = card_scn.instance() 10 | card_viewports[card] = render_vp 11 | add_child(render_vp) 12 | render_vp.render_target_v_flip = true 13 | render_vp.transparent_bg = true 14 | render_vp.add_child(card_node) 15 | render_vp.render_target_update_mode = Viewport.UPDATE_ONCE 16 | render_vp.size = card_node.rect_size 17 | card_size = render_vp.size 18 | render_vp.usage = Viewport.USAGE_2D 19 | 20 | print("add_card_vp, there are "+str(card_viewports.size()) + " viewports") 21 | return render_vp 22 | 23 | func remove_card_vp(card): 24 | var render_vp = card_viewports[card] 25 | card_viewports.erase(card) 26 | render_vp.queue_free() 27 | print("remove_card_vp, there are "+str(card_viewports.size()) + " viewports") 28 | return render_vp 29 | 30 | func get_card_texture(card): 31 | var render_vp 32 | if not card_viewports.has(card): 33 | render_vp = add_card_vp(card) 34 | else: 35 | render_vp = card_viewports[card] 36 | 37 | var card_node = render_vp.get_children()[0] 38 | render_vp.render_target_update_mode = Viewport.UPDATE_ONCE 39 | card_node.populate_with(card) 40 | return card_viewports[card].get_texture() 41 | -------------------------------------------------------------------------------- /card_class/card_creation/card_populate.gd: -------------------------------------------------------------------------------- 1 | extends Control 2 | 3 | onready var name_lbl = $"Panel/VBoxContainer/Name" 4 | onready var texture_rect = $"Panel/VBoxContainer/TextureRect" 5 | onready var text_rtl = $"Panel/VBoxContainer/rich_text_label" 6 | onready var type = $"Panel/VBoxContainer/Type" 7 | onready var attack_and_lives = $"Panel/VBoxContainer/rich_text_label/AttackAndHealth" 8 | onready var time_debug = $"Panel/VBoxContainer/Label2" 9 | onready var mana_lbl = $"Panel/VBoxContainer/Name/HBoxContainer" 10 | 11 | 12 | var t = 0 13 | func populate_with(card): 14 | texture_rect.texture = load(card.img_path) 15 | name_lbl.text = card.name 16 | text_rtl.text = card.text 17 | var text_color = null 18 | 19 | mana_cost(card) 20 | 21 | match card.type: 22 | card.CardType.INSTANT: 23 | text_color = Color(0.1,0.4,0.6) 24 | attack_and_lives.hide() 25 | card.CardType.CREATURE: 26 | text_color = Color(0.7,0.2,0.1) 27 | attack_and_lives.text = str(card.max_attack) + "/" + str(card.max_lives) 28 | if text_color: 29 | text_rtl.add_stylebox_override("normal", text_rtl.get_stylebox("normal").duplicate()) 30 | text_rtl.get_stylebox("normal").bg_color = text_color 31 | time_debug.text = str(OS.get_datetime()["hour"]) + ":"+ str(OS.get_datetime()["minute"])+":"+str(OS.get_datetime()["second"]) 32 | 33 | func mana_cost(card): 34 | for mana in ManaType.list: 35 | for i in range(card.mana_cost[mana]): 36 | var tr = TextureRect.new() 37 | tr.texture = load("res://resources/GreenMana.png") 38 | tr.modulate = ManaType.color(mana) 39 | mana_lbl.add_child(tr) -------------------------------------------------------------------------------- /card_class/test_card_renderer.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=4 format=2] 2 | 3 | [ext_resource path="res://icon.png" type="Texture" id=1] 4 | [ext_resource path="res://TextureRect.gd" type="Script" id=2] 5 | 6 | [sub_resource type="Theme" id=1] 7 | 8 | Fonts/fonts/large = null 9 | Fonts/fonts/normal = null 10 | _sections_unfolded = [ "Fonts" ] 11 | 12 | [node name="Panel" type="Panel" index="0"] 13 | anchor_left = 0.0 14 | anchor_top = 0.0 15 | anchor_right = 1.0 16 | anchor_bottom = 1.0 17 | rect_pivot_offset = Vector2( 0, 0 ) 18 | rect_clip_content = false 19 | mouse_filter = 0 20 | mouse_default_cursor_shape = 0 21 | size_flags_horizontal = 1 22 | size_flags_vertical = 1 23 | theme = SubResource( 1 ) 24 | _sections_unfolded = [ "Rect", "Theme", "theme" ] 25 | __meta__ = { 26 | "_edit_horizontal_guides_": [ ], 27 | "_edit_vertical_guides_": [ ] 28 | } 29 | 30 | [node name="TextureRect" type="TextureRect" parent="." index="0"] 31 | anchor_left = 0.0 32 | anchor_top = 0.0 33 | anchor_right = 0.0 34 | anchor_bottom = 0.0 35 | margin_left = 39.0 36 | margin_top = 102.0 37 | margin_right = 311.0 38 | margin_bottom = 499.0 39 | rect_pivot_offset = Vector2( 0, 0 ) 40 | rect_clip_content = false 41 | mouse_filter = 1 42 | mouse_default_cursor_shape = 0 43 | size_flags_horizontal = 1 44 | size_flags_vertical = 1 45 | texture = ExtResource( 1 ) 46 | expand = true 47 | stretch_mode = 5 48 | script = ExtResource( 2 ) 49 | _sections_unfolded = [ "Rect" ] 50 | 51 | [node name="Button" type="Button" parent="." index="1"] 52 | anchor_left = 0.0 53 | anchor_top = 0.0 54 | anchor_right = 0.0 55 | anchor_bottom = 0.0 56 | margin_left = 34.0 57 | margin_top = 25.0 58 | margin_right = 341.0 59 | margin_bottom = 95.0 60 | rect_pivot_offset = Vector2( 0, 0 ) 61 | rect_clip_content = false 62 | focus_mode = 2 63 | mouse_filter = 0 64 | mouse_default_cursor_shape = 0 65 | size_flags_horizontal = 1 66 | size_flags_vertical = 1 67 | toggle_mode = false 68 | enabled_focus_mode = 2 69 | shortcut = null 70 | group = null 71 | text = "update" 72 | flat = false 73 | align = 1 74 | 75 | [connection signal="pressed" from="Button" to="TextureRect" method="_on_Button_pressed"] 76 | -------------------------------------------------------------------------------- /game_table/game_table.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=4 format=2] 2 | 3 | [ext_resource path="res://theme/table.theme" type="Theme" id=1] 4 | [ext_resource path="res://game_table/game_table.gd" type="Script" id=2] 5 | [ext_resource path="res://game_table/player_side.tscn" type="PackedScene" id=3] 6 | 7 | [node name="Control" type="Control" index="0"] 8 | anchor_left = 0.0 9 | anchor_top = 0.0 10 | anchor_right = 1.0 11 | anchor_bottom = 1.0 12 | rect_pivot_offset = Vector2( 927.366, 551.655 ) 13 | rect_clip_content = false 14 | mouse_filter = 0 15 | mouse_default_cursor_shape = 0 16 | size_flags_horizontal = 1 17 | size_flags_vertical = 1 18 | theme = ExtResource( 1 ) 19 | _sections_unfolded = [ "Rect", "Theme", "theme" ] 20 | __meta__ = { 21 | "_edit_horizontal_guides_": [ ], 22 | "_edit_vertical_guides_": [ ] 23 | } 24 | 25 | [node name="table" type="VBoxContainer" parent="." index="0"] 26 | anchor_left = 0.0 27 | anchor_top = 0.0 28 | anchor_right = 1.0 29 | anchor_bottom = 1.0 30 | rect_pivot_offset = Vector2( 0, 0 ) 31 | rect_clip_content = false 32 | mouse_filter = 1 33 | mouse_default_cursor_shape = 0 34 | size_flags_horizontal = 1 35 | size_flags_vertical = 1 36 | alignment = 0 37 | script = ExtResource( 2 ) 38 | 39 | [node name="opp" parent="table" index="0" instance=ExtResource( 3 )] 40 | margin_left = 0.0 41 | margin_right = 1280.0 42 | margin_bottom = 356.0 43 | table_side = 0 44 | cast_wait_time = 4.0 45 | 46 | [node name="player" parent="table" index="1" instance=ExtResource( 3 )] 47 | margin_left = 0.0 48 | margin_top = 364.0 49 | margin_right = 1280.0 50 | margin_bottom = 720.0 51 | cast_wait_time = 1.0 52 | 53 | [node name="TextureRect" type="TextureRect" parent="." index="1"] 54 | anchor_left = 1.0 55 | anchor_top = 0.0 56 | anchor_right = 1.0 57 | anchor_bottom = 0.0 58 | margin_left = -435.0 59 | margin_top = 10.0 60 | margin_right = -10.0 61 | margin_bottom = 386.0 62 | rect_pivot_offset = Vector2( 0, 0 ) 63 | rect_clip_content = false 64 | mouse_filter = 2 65 | mouse_default_cursor_shape = 0 66 | size_flags_horizontal = 1 67 | size_flags_vertical = 1 68 | stretch_mode = 0 69 | _sections_unfolded = [ "Margin", "Mouse" ] 70 | 71 | -------------------------------------------------------------------------------- /game_table/mana_control.gd: -------------------------------------------------------------------------------- 1 | tool 2 | extends VBoxContainer 3 | export var show_children = false setget _show_children 4 | var tw = Tween.new() 5 | onready var this_player = get_parent().get_parent() 6 | 7 | func _ready(): 8 | if not Engine.editor_hint: 9 | this_player.connect("mana_changed", self, "mana_update") 10 | add_child(tw) 11 | 12 | func mana_update(mana): 13 | var index = 0 14 | for t in ManaType.list: 15 | if mana.has(t): 16 | var lbl = get_child(index) 17 | if lbl.text != str(mana[t]): 18 | var sb = lbl.get_stylebox("normal") 19 | tw.interpolate_property(sb, "bg_color", Color(1,0,0), sb.bg_color, 2, Tween.TRANS_EXPO, Tween.EASE_OUT) 20 | # tw.interpolate_property(lbl, "modulate", sb.bg_color.lightened(0.4), Color(1,1,1), 2, Tween.TRANS_EXPO, Tween.EASE_OUT) 21 | tw.start() 22 | lbl.text = str(mana[t]) 23 | if lbl.text != "0": 24 | lbl.visible = true 25 | index += 1 26 | 27 | func _show_children(new_val): 28 | show_children = new_val 29 | for c in get_children(): 30 | remove_child(c) 31 | 32 | if Engine.editor_hint: 33 | editor_mana_update() 34 | return 35 | 36 | if show_children: 37 | for t in ManaType.list: 38 | var lbl = Label.new() 39 | lbl.align = ALIGN_CENTER 40 | lbl.valign = ALIGN_CENTER 41 | lbl.add_color_override("font_color", Color(1,1,1)) 42 | lbl.rect_min_size = Vector2(60,60) 43 | var sb = StyleBoxFlat.new() 44 | sb.set_corner_radius_all(100) 45 | sb.bg_color = ManaType.color(t) 46 | lbl.add_stylebox_override("normal", sb) 47 | lbl.text = "0" 48 | lbl.visible = false 49 | sb.connect("changed", lbl, "update") 50 | add_child(lbl) 51 | 52 | #only editor 53 | func editor_mana_update(): 54 | var MTClass = load("res://Autoload/ManaType.gd") 55 | var MT = MTClass.new() 56 | if show_children: 57 | for t in MT.list: 58 | var lbl = Label.new() 59 | lbl.align = ALIGN_CENTER 60 | lbl.valign = ALIGN_CENTER 61 | lbl.add_color_override("font_color", Color(1,1,1)) 62 | lbl.rect_min_size = Vector2(60,60) 63 | var sb = StyleBoxFlat.new() 64 | sb.set_corner_radius_all(100) 65 | sb.bg_color = MT.color(t) 66 | lbl.add_stylebox_override("normal", sb) 67 | lbl.text = "0" 68 | add_child(lbl) -------------------------------------------------------------------------------- /default_env.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Environment" format=2] 2 | 3 | [resource] 4 | 5 | background_mode = 0 6 | background_sky_custom_fov = 0.0 7 | background_color = Color( 0, 0, 0, 1 ) 8 | background_energy = 1.0 9 | background_canvas_max_layer = 0 10 | ambient_light_color = Color( 0, 0, 0, 1 ) 11 | ambient_light_energy = 1.0 12 | ambient_light_sky_contribution = 1.0 13 | fog_enabled = false 14 | fog_color = Color( 0.5, 0.6, 0.7, 1 ) 15 | fog_sun_color = Color( 1, 0.9, 0.7, 1 ) 16 | fog_sun_amount = 0.0 17 | fog_depth_enabled = true 18 | fog_depth_begin = 10.0 19 | fog_depth_curve = 1.0 20 | fog_transmit_enabled = false 21 | fog_transmit_curve = 1.0 22 | fog_height_enabled = false 23 | fog_height_min = 0.0 24 | fog_height_max = 100.0 25 | fog_height_curve = 1.0 26 | tonemap_mode = 0 27 | tonemap_exposure = 1.0 28 | tonemap_white = 1.0 29 | auto_exposure_enabled = false 30 | auto_exposure_scale = 0.4 31 | auto_exposure_min_luma = 0.05 32 | auto_exposure_max_luma = 8.0 33 | auto_exposure_speed = 0.5 34 | ss_reflections_enabled = false 35 | ss_reflections_max_steps = 64 36 | ss_reflections_fade_in = 0.15 37 | ss_reflections_fade_out = 2.0 38 | ss_reflections_depth_tolerance = 0.2 39 | ss_reflections_roughness = true 40 | ssao_enabled = false 41 | ssao_radius = 1.0 42 | ssao_intensity = 1.0 43 | ssao_radius2 = 0.0 44 | ssao_intensity2 = 1.0 45 | ssao_bias = 0.01 46 | ssao_light_affect = 0.0 47 | ssao_color = Color( 0, 0, 0, 1 ) 48 | ssao_quality = 0 49 | ssao_blur = 3 50 | ssao_edge_sharpness = 4.0 51 | dof_blur_far_enabled = false 52 | dof_blur_far_distance = 10.0 53 | dof_blur_far_transition = 5.0 54 | dof_blur_far_amount = 0.1 55 | dof_blur_far_quality = 1 56 | dof_blur_near_enabled = false 57 | dof_blur_near_distance = 2.0 58 | dof_blur_near_transition = 1.0 59 | dof_blur_near_amount = 0.1 60 | dof_blur_near_quality = 1 61 | glow_enabled = false 62 | glow_levels/1 = false 63 | glow_levels/2 = false 64 | glow_levels/3 = true 65 | glow_levels/4 = false 66 | glow_levels/5 = true 67 | glow_levels/6 = false 68 | glow_levels/7 = false 69 | glow_intensity = 0.8 70 | glow_strength = 1.0 71 | glow_bloom = 0.0 72 | glow_blend_mode = 2 73 | glow_hdr_threshold = 1.0 74 | glow_hdr_scale = 2.0 75 | glow_bicubic_upscale = false 76 | adjustment_enabled = false 77 | adjustment_brightness = 1.0 78 | adjustment_contrast = 1.0 79 | adjustment_saturation = 1.0 80 | _sections_unfolded = [ "Resource" ] 81 | 82 | -------------------------------------------------------------------------------- /card_class/holder.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=2] 2 | 3 | [ext_resource path="res://card_class/holder.gd" type="Script" id=1] 4 | 5 | [sub_resource type="StyleBoxFlat" id=1] 6 | 7 | content_margin_left = -1.0 8 | content_margin_right = -1.0 9 | content_margin_top = -1.0 10 | content_margin_bottom = -1.0 11 | bg_color = Color( 0.6, 0.6, 0.6, 1 ) 12 | draw_center = true 13 | border_width_left = 0 14 | border_width_top = 0 15 | border_width_right = 0 16 | border_width_bottom = 0 17 | border_color = Color( 0.8, 0.8, 0.8, 1 ) 18 | border_blend = false 19 | corner_radius_top_left = 0 20 | corner_radius_top_right = 0 21 | corner_radius_bottom_right = 0 22 | corner_radius_bottom_left = 0 23 | corner_detail = 8 24 | expand_margin_left = 0.0 25 | expand_margin_right = 0.0 26 | expand_margin_top = 0.0 27 | expand_margin_bottom = 0.0 28 | shadow_color = Color( 0, 0, 0, 0.6 ) 29 | shadow_size = 0 30 | anti_aliasing = true 31 | anti_aliasing_size = 1 32 | 33 | [node name="Control" type="Panel" index="0"] 34 | anchor_left = 0.0 35 | anchor_top = 0.0 36 | anchor_right = 0.0 37 | anchor_bottom = 0.0 38 | margin_right = 147.0 39 | margin_bottom = 80.0 40 | rect_pivot_offset = Vector2( 0, 0 ) 41 | rect_clip_content = false 42 | mouse_filter = 0 43 | mouse_default_cursor_shape = 0 44 | size_flags_horizontal = 1 45 | size_flags_vertical = 3 46 | custom_styles/panel = SubResource( 1 ) 47 | script = ExtResource( 1 ) 48 | _sections_unfolded = [ "Custom Styles", "Rect", "Size Flags", "Theme", "Visibility" ] 49 | 50 | [node name="TextureRect" type="TextureRect" parent="." index="0"] 51 | anchor_left = 0.0 52 | anchor_top = 0.0 53 | anchor_right = 1.0 54 | anchor_bottom = 1.0 55 | margin_right = 364.0 56 | margin_bottom = 298.0 57 | rect_pivot_offset = Vector2( 0, 0 ) 58 | rect_clip_content = false 59 | mouse_filter = 2 60 | mouse_default_cursor_shape = 0 61 | size_flags_horizontal = 1 62 | size_flags_vertical = 1 63 | expand = true 64 | stretch_mode = 6 65 | _sections_unfolded = [ "Margin", "Mouse" ] 66 | 67 | [node name="ProgressBar" type="ProgressBar" parent="TextureRect" index="0"] 68 | pause_mode = 1 69 | visible = false 70 | anchor_left = 0.5 71 | anchor_top = 1.0 72 | anchor_right = 0.5 73 | anchor_bottom = 1.0 74 | margin_left = -100.0 75 | margin_top = 10.0 76 | margin_right = 100.0 77 | margin_bottom = 10.0 78 | rect_min_size = Vector2( 200, 30 ) 79 | rect_pivot_offset = Vector2( 0, 0 ) 80 | rect_clip_content = false 81 | mouse_filter = 0 82 | mouse_default_cursor_shape = 0 83 | size_flags_horizontal = 1 84 | size_flags_vertical = 0 85 | min_value = 0.0 86 | max_value = 1.0 87 | step = 0.05 88 | page = 0.0 89 | value = 0.0 90 | exp_edit = false 91 | rounded = false 92 | allow_greater = false 93 | allow_lesser = false 94 | percent_visible = false 95 | _sections_unfolded = [ "Margin", "Pause", "Rect" ] 96 | 97 | [node name="ColorRect" type="ColorRect" parent="TextureRect" index="1"] 98 | anchor_left = 0.0 99 | anchor_top = 0.0 100 | anchor_right = 1.0 101 | anchor_bottom = 1.0 102 | rect_pivot_offset = Vector2( 0, 0 ) 103 | rect_clip_content = false 104 | mouse_filter = 2 105 | mouse_default_cursor_shape = 0 106 | size_flags_horizontal = 1 107 | size_flags_vertical = 1 108 | color = Color( 1, 0, 0, 0.305882 ) 109 | _sections_unfolded = [ "Mouse" ] 110 | 111 | [node name="Tween" type="Tween" parent="." index="1"] 112 | repeat = false 113 | playback_process_mode = 1 114 | playback_speed = 1.0 115 | playback/active = false 116 | playback/repeat = false 117 | playback/speed = 1.0 118 | 119 | -------------------------------------------------------------------------------- /test_font.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=4 format=2] 2 | 3 | [ext_resource path="res://Font/Arial.ttf" type="DynamicFontData" id=1] 4 | 5 | [sub_resource type="DynamicFont" id=1] 6 | 7 | size = 20 8 | outline_size = 0 9 | outline_color = Color( 1, 1, 1, 1 ) 10 | use_mipmaps = false 11 | use_filter = false 12 | font_data = ExtResource( 1 ) 13 | _sections_unfolded = [ "Font", "Settings" ] 14 | 15 | [sub_resource type="GDScript" id=2] 16 | 17 | script/source = "extends Label 18 | #export var font = 1 setget anim_text 19 | var size = 0 20 | #func _process(delta): 21 | # print(delta) 22 | ## print(has_font_override(\"font\")) 23 | ## print(get_font(\"font\")) 24 | # get_font(\"font\").size = get_global_mouse_position().x /100 25 | func _ready(): 26 | size = get_font(\"font\").size 27 | func _input(ev): 28 | if ev is InputEventMagnifyGesture: 29 | size *= ev.factor 30 | print(size) 31 | get_font(\"font\").size = size 32 | if ev is InputEventPanGesture: 33 | print(\"pasnned\", ev.delta) 34 | if ev is InputEventMouseButton: 35 | print(\"index\", ev.button_index, \" BUTTON_WHEEL_UP: \", BUTTON_WHEEL_UP) 36 | print(\"index\", ev.button_index, \" BUTTON_WHEEL_DOWN: \", BUTTON_WHEEL_DOWN)" 37 | 38 | [node name="Label" type="Label" index="0"] 39 | anchor_left = 0.0 40 | anchor_top = 0.0 41 | anchor_right = 0.0 42 | anchor_bottom = 0.0 43 | margin_left = -1.0 44 | margin_top = -1.0 45 | margin_right = 2075.0 46 | margin_bottom = 857.0 47 | rect_pivot_offset = Vector2( 0, 0 ) 48 | rect_clip_content = false 49 | mouse_filter = 2 50 | mouse_default_cursor_shape = 0 51 | size_flags_horizontal = 1 52 | size_flags_vertical = 4 53 | custom_fonts/font = SubResource( 1 ) 54 | custom_colors/font_color = Color( 0, 0, 0, 1 ) 55 | text = "ups there is not textups there is not textups there is not text 56 | ups there is not textups there is not textups there is not textups there is not textups there is not textups there is not text 57 | ups there is not textups there is not textups there is not textups there is not textups there is not textups there is not text 58 | ups there is not textups there is not textups there is not textups there is not textups there is not textups there is not text 59 | ups there is not textups there is not textups there is not textups there is not textups there is not textups there is not text 60 | ups there is not textups there is not textups there is not textups there is not textups there is not textups there is not text 61 | ups there is not textups there is not textups there is not textups there is not textups there is not textups there is not text 62 | ups there is not textups there is not textups there is not textups there is not textups there is not textups there is not text 63 | ups there is not textups there is not textups there is not textups there is not textups there is not textups there is not text 64 | ups there is not textups there is not textups there is not textups there is not textups there is not textups there is not text 65 | ups there is not textups there is not textups there is not textups there is not textups there is not textups there is not text 66 | ups there is not textups there is not textups there is not textups there is not textups there is not textups there is not text 67 | ups there is not textups there is not textups there is not textups there is not textups there is not textups there is not text 68 | ups there is not textups there is not textups there is not text" 69 | percent_visible = 1.0 70 | lines_skipped = 0 71 | max_lines_visible = -1 72 | script = SubResource( 2 ) 73 | _sections_unfolded = [ "Custom Colors", "Custom Fonts", "Custom Styles", "custom_fonts/font" ] 74 | 75 | [node name="Tween" type="Tween" parent="." index="0"] 76 | repeat = false 77 | playback_process_mode = 1 78 | playback_speed = 1.0 79 | playback/active = false 80 | playback/repeat = false 81 | playback/speed = 1.0 82 | 83 | -------------------------------------------------------------------------------- /Autoload/Global.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | var game_table 4 | 5 | #Tweens 6 | 7 | #enum position_for_tween{current_position, current_rotation}#since the positions are passed by value, this serves as a bridge to gain the up to date position 8 | var tween_array = [] 9 | 10 | 11 | func _ready(): 12 | game_table = get_tree().get_root().get_node("Control/table") 13 | print(game_table) 14 | 15 | 16 | #tween queue------------------------------------------------------------------------------------------------------------------ 17 | #This function is NOT used for every tween. It should be used for chains of tweens, but not for small single standing tween 18 | #tween chains this is already used for: when attack phase starts, Maybe Todo: when card animates to holder and other tweens at the same time 19 | func add_tween_to_queue(object, property, modification_type_for_values, value, duration = 1, trans_type = Tween.TRANS_LINEAR, ease_type = Tween.EASE_OUT, initial_val = null, final_val = null): 20 | var tween = Tween.new() 21 | # var argument_array = [object, property, modification_type_for_values, value, duration, trans_type, ease_type] 22 | # var i = 0 23 | var tween_dict = { 24 | "tween": tween, 25 | "object": object, 26 | "property": property, 27 | "modification_type_for_values": modification_type_for_values, 28 | "value": value, 29 | "duration": duration, 30 | "trans_type": trans_type, 31 | "ease_type": ease_type, 32 | "initial_val": initial_val, 33 | "final_val": final_val} 34 | # for k in tween_dict.keys(): 35 | # tween_dict[k] = argument_array[i] 36 | # i += 1 37 | if tween_array.empty(): 38 | tween_array.append(tween_dict) 39 | init_tween() 40 | else: 41 | tween_array.append(tween_dict) 42 | return(tween) 43 | func init_tween(): 44 | if tween_array.empty(): 45 | return 46 | var tw = tween_array[0] 47 | modify_tween(tw) 48 | print("object:", tw["object"],"property:", tw["property"],"initial_val:", tw["initial_val"],"final_val:", tw["final_val"], "duration:", tw["duration"], "trans_type:", tw["trans_type"], "ease_type:", tw["ease_type"]) 49 | tw["tween"].interpolate_property(tw["object"], tw["property"], tw["initial_val"], tw["final_val"], tw["duration"], tw["trans_type"], tw["ease_type"]) 50 | tw["tween"].start() 51 | yield(tw["tween"], "tween_completed") 52 | tween_array.pop_front() 53 | init_tween() 54 | func modify_tween(tw): 55 | if tw["modification_type_for_values"] != null: 56 | match tw["modification_type_for_values"]: 57 | "current_absolute": #from current value to an absolute value, value must be a variable of type: current_value 58 | tw["initial_val"] = tw["object"].get(tw["property"]) 59 | tw["final_val"] = tw["value"] 60 | 61 | "relative": #from current_value to current_value + someValue, value must be a variable of type: current_value 62 | tw["initial_val"] = tw["object"].get(tw["property"]) 63 | tw["final_val"] = tw["initial_val"] + tw["value"] 64 | 65 | "relative_with_new_object": #value must be an array with [object, property] 66 | tw["inital_val"] = tw["object"].get(tw["property"]) 67 | tw["final_val"] = tw["value"][0].get(tw["value"][1]) 68 | 69 | "different_properties": #In case that a different property of the node than "tw[property]" is used, value must be array of: [first_property (initial_val), second_property (final_val)] 70 | tw["initial_val"] = tw["object"].get(tw["value"][0]) 71 | tw["final_val"] = tw["object"].get(tw["value"][1]) 72 | 73 | "different_property_absolute":#doesnt use the property that will be changed, but another property's val and an abolute val, both given as array 74 | tw["initial_val"] = tw["object"].get(tw["value"][0]) 75 | tw["final_val"] = tw["value"][1] 76 | # if tw["initial_val"] == "current_position": 77 | # tw["initial_val"] = tw["object"].rect_global_position 78 | # tw["final_val"] += tw["object"].rect_global_position 79 | # elif tw["initial_val"] == "current_rotation": 80 | # tw["initial_val"] = tw["object"].rect_rotation 81 | # tw["final_val"] += tw["object"].rect_rotation 82 | 83 | 84 | -------------------------------------------------------------------------------- /card_class/card_base.gd: -------------------------------------------------------------------------------- 1 | extends Object 2 | 3 | enum CardType {INSTANT, SORCERY, CREATURE, LAND, ENCHANTMENT, ARTIFACT, PLANESWALKER} 4 | 5 | #signals 6 | signal tapped_changed 7 | signal casted(card) 8 | signal location_changed(card) 9 | 10 | var HolderClass = preload("res://card_class/holder.tscn") 11 | 12 | #props 13 | var name = "[Define Name]" setget update_tex 14 | var text = "[Define text]" 15 | var type = [] 16 | var img_path = "should get set in init to path of the gd script" 17 | var mana_cost = {}#saved as a dict with keys of ManaType 18 | var is_reaction = false 19 | 20 | #staus 21 | var location = null setget _location_changed#CardLocation 22 | var tapped = false setget _tapped_changed 23 | var casted = false 24 | var casting = false 25 | 26 | #environment variables 27 | var texture_node 28 | var holder_node setget ,_holder_node_get 29 | var player #is added in player_side.gd 30 | var opponent 31 | var table 32 | 33 | 34 | #hleper variables 35 | var timer = Timer.new() 36 | 37 | 38 | 39 | #events 40 | func _init(): 41 | img_path = get_script().resource_path.replace(".gd",".png") 42 | table = Global.game_table 43 | for t in ManaType.list: 44 | mana_cost[t] = 0 45 | 46 | func _action_on_card(card): 47 | print("action on card: "+ str(card.name)) 48 | pass 49 | func _action_on_opponent(): 50 | print("action on opponent with: "+ str(name)) 51 | pass 52 | func _tapped_changed(new_tap_status): 53 | if not new_tap_status == tapped: 54 | tapped = new_tap_status 55 | emit_signal("tapped_changed") 56 | 57 | func _holder_node_get(): 58 | if not holder_node: 59 | new_holder_node(player.hand_h_box.rect_size.y) 60 | return holder_node 61 | #internal events 62 | func _location_changed(new_val): 63 | location = new_val 64 | print("location cahnged") 65 | emit_signal("location_changed", self) 66 | 67 | #helper functions 68 | #card creation process starts here after holder_node_get 69 | 70 | #The texture is created here. populate, renderer, and card tscn are made for this purpose 71 | func new_holder_node(height): 72 | if holder_node: 73 | return 74 | holder_node = HolderClass.instance() 75 | holder_node.card = self 76 | texture_node = holder_node.get_node("TextureRect") 77 | update_tex() 78 | # holder_node.connect("drag_start", self, "_on_drag") 79 | # holder_node.connect("dropped", self, "_on_drop") 80 | return holder_node 81 | func update_tex(): 82 | texture_node.texture = card_renderer.get_card_texture(self) 83 | func render_on(tex): 84 | tex = card_renderer.get_card_texture(self) 85 | 86 | #TODO move to some global class 87 | func hover_card_hand_size(): 88 | var y = holder_node.get_tree().root.size.y 89 | var screen_factor = 0.4 90 | return Vector2(y*screen_factor*card_renderer.card_size.aspect(), y*screen_factor) 91 | func hover_card_top_right_size(): 92 | var screen_factor = 0.5 93 | var y = holder_node.get_tree().root.size.y 94 | return Vector2(y*screen_factor*card_renderer.card_size.aspect(), y*screen_factor) 95 | 96 | # card methods 97 | func can_cast(): 98 | return true 99 | func cast(): 100 | casted = true 101 | print("card got casted") 102 | emit_signal("casted", self) 103 | func start_cast_timer(wait_time): 104 | VisualServer.canvas_item_set_z_index(texture_node.get_canvas_item(),2) 105 | casting = true 106 | if not timer.get_parent(): 107 | holder_node.add_child(timer) 108 | timer.wait_time = wait_time 109 | holder_node.timer = timer 110 | timer.start() 111 | yield(timer, "timeout") 112 | casting = false 113 | VisualServer.canvas_item_set_z_index(texture_node.get_canvas_item(),0) 114 | 115 | func move_to(h_box, new_location): 116 | var tex_global_rect = texture_node.get_global_rect() 117 | holder_node.get_parent().remove_child(holder_node) 118 | h_box.add_child(holder_node) 119 | yield(h_box, "sort_children") 120 | texture_node.rect_global_position = tex_global_rect.position 121 | texture_node.rect_size = tex_global_rect.size 122 | holder_node.animate_to_holder() 123 | yield(holder_node, "animate_to_holder_completed") 124 | self.location = new_location 125 | #Comment to the yields: instead of adding all those yields the "add_to_tween_queue" function 126 | # in globals might help, although it doesnt work for now. This is, therefore, temporary and a solution to handle all tweens after one another still might have to be found 127 | 128 | -------------------------------------------------------------------------------- /game_table/game_table.gd: -------------------------------------------------------------------------------- 1 | extends Control 2 | 3 | enum location {BOTTOM_BF, BOTTOM_HAND, GRAVEYARD, DECK, TOP_HAND, TOP_BF} 4 | 5 | onready var player = $player 6 | onready var opponent = $opp 7 | 8 | onready var card_preview_tr = get_node("../TextureRect") 9 | onready var deck = $player/left_area/deck 10 | 11 | var tw = Tween.new() 12 | 13 | #var dragged_card = null 14 | var drag_offset = Vector2() 15 | var drag_offset_factor = 1 16 | #var hovered_card = null 17 | 18 | var cast_queue = [] 19 | func is_casting(): return not cast_queue.empty() 20 | enum GamePhase {DEFAULT, DEFALT, ATTACK, DEFEND, NO_INTERACTION} #NO_INTERACTION is used for mana reload phase + attack execute phase (they should still be short and with fast animations) 21 | var phase = GamePhase.DEFAULT 22 | var attack_phase = false 23 | 24 | #sgnals 25 | signal attack_phase_started 26 | signal attack_phase_ended 27 | 28 | func _ready(): 29 | add_child(tw) 30 | setup_game() 31 | for p in [player, opponent]: 32 | p.connect("turn_finished", self, "_turn_finished") 33 | p.connect("card_added", self, "_card_added") 34 | 35 | player.is_playing = true 36 | opponent.is_playing = false 37 | card_preview_tr.rect_size.y = card_preview_tr.rect_size.x / card_renderer.card_size.aspect() 38 | 39 | 40 | #Temporary, for game testing 41 | func setup_game(): 42 | player.cardnames_deck = ["a", "b", "mana_red", "mana_blue", "mana_blue", "flo"] 43 | opponent.cardnames_deck = [ "mana_blue", "flo","a", "b", "mana_red", "mana_blue"] 44 | 45 | func show_card_preview(card): 46 | card_preview_tr.texture = card.texture_node.texture 47 | tw.interpolate_property(card_preview_tr, "modulate:a", card_preview_tr.modulate.a, 1,0.2, Tween.TRANS_LINEAR, Tween.EASE_IN) 48 | tw.start() 49 | 50 | func hide_card_preview(card): 51 | tw.interpolate_property(card_preview_tr, "modulate:a",card_preview_tr.modulate.a, 0, 0.2,Tween.TRANS_LINEAR, Tween.EASE_OUT) 52 | tw.start() 53 | 54 | #Attack Phase 55 | func indicate_attack_phase(indicate, label_stage = 0): 56 | if attack_phase: 57 | return 58 | var attack_indicate_height = Dpi.ATTACK_INDICATE_HEIGHT 59 | if not indicate: 60 | attack_indicate_height = 0 61 | for p in [opponent, player]: 62 | var spacer = p.attack_phase_spacer 63 | var d = 0.17 64 | # Global.add_tween_to_queue(spacer, "rect_min_size:y", "different_property_absolute", ["rect_size.y", attack_indicate_height], d, Tween.TRANS_EXPO, Tween.EASE_OUT) 65 | tw.interpolate_property(spacer, "rect_min_size:y", spacer.rect_size.y, attack_indicate_height, d, Tween.TRANS_EXPO, Tween.EASE_OUT) 66 | 67 | var bg_opacity = 0 68 | var lbl_opacity = 0 69 | if indicate: 70 | match label_stage: 71 | 1: 72 | lbl_opacity = 0.2 73 | bg_opacity = 0.3 74 | 2: 75 | lbl_opacity = 0.6 76 | bg_opacity = 0.4 77 | inactive_player().show_attack_indicate_label(lbl_opacity, bg_opacity) 78 | 79 | func start_attack_phase(): 80 | if phase == GamePhase.ATTACK: 81 | return 82 | indicate_attack_phase(false,0) 83 | phase = GamePhase.ATTACK 84 | for p in [opponent, player]: 85 | p.animate_attack(true) 86 | yield(player, "attack_anim_complete") 87 | emit_signal("attack_phase_started") 88 | 89 | func end_attack_phase(): 90 | if phase != GamePhase.ATTACK: #and phase != GamePhase.NO_INTERACTION: #(I think this is not needed) 91 | return 92 | phase = GamePhase.DEFAULT 93 | for p in [opponent, player]: 94 | p.animate_attack(false) 95 | yield(player, "attack_anim_complete") 96 | emit_signal("attack_phase_ended") 97 | 98 | #functions to control turns 99 | func _turn_finished(): 100 | opponent.is_playing = not opponent.is_playing 101 | player.is_playing = not player.is_playing 102 | func active_player(): 103 | if opponent.is_playing: 104 | return opponent 105 | elif player.is_playing: 106 | return player 107 | func inactive_player(): 108 | if opponent.is_playing: 109 | return player 110 | elif player.is_playing: 111 | return opponent 112 | 113 | #this is only debugging 114 | func _input(event): 115 | if event is InputEventKey: 116 | var card_to_add = card_cache.card(card_cache.get_all_card_names()[randi() % card_cache.get_all_card_names().size()]) 117 | if event.scancode == KEY_F and event.pressed: 118 | player.add_card_to_hand(card_cache.card("flo")) 119 | if event.scancode == KEY_W and event.pressed: 120 | player.add_card_to_hand(card_to_add) 121 | if event.scancode == KEY_Q and event.pressed: 122 | opponent.add_card_to_hand(card_to_add) 123 | if event.scancode == KEY_R and event.pressed: 124 | tw.interpolate_property(player.bf_h_box, "margin_bottom", 0, -100, 4,Tween.TRANS_LINEAR,Tween.EASE_OUT) 125 | 126 | -------------------------------------------------------------------------------- /project.godot: -------------------------------------------------------------------------------- 1 | ; Engine configuration file. 2 | ; It's best edited using the editor UI and not directly, 3 | ; since the parameters that go here are not all obvious. 4 | ; 5 | ; Format: 6 | ; [section] ; section goes between [] 7 | ; param=value ; assign values to parameters 8 | 9 | config_version=4 10 | 11 | [application] 12 | 13 | config/name="OpenCardGame" 14 | run/main_scene="res://game_table/game_table.tscn" 15 | boot_splash/image="res://cards/flosC.png" 16 | boot_splash/fullsize=false 17 | config/icon="res://cards/a.png" 18 | 19 | [autoload] 20 | 21 | card_cache="*res://card_class/autoloads/card_cache.gd" 22 | card_renderer="*res://card_class/autoloads/card_renderer.gd" 23 | Global="*res://Autoload/Global.gd" 24 | ManaType="*res://Autoload/ManaType.gd" 25 | CardLocation="*res://Autoload/CardLocation.gd" 26 | Dpi="*res://Autoload/Dpi.gd" 27 | TableLocation="*res://Autoload/TableLocation.gd" 28 | 29 | [debug] 30 | 31 | settings/fps/force_fps=30 32 | 33 | [display] 34 | 35 | window/size/width=1280 36 | window/size/height=720 37 | window/dpi/allow_hidpi=true 38 | 39 | [gui] 40 | 41 | theme/use_hidpi=true 42 | 43 | [input] 44 | 45 | ui_accept={ 46 | "deadzone": 0.5, 47 | "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777221,"unicode":0,"echo":false,"script":null) 48 | , Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777222,"unicode":0,"echo":false,"script":null) 49 | , Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"unicode":0,"echo":false,"script":null) 50 | , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":0,"pressure":0.0,"pressed":false,"script":null) 51 | ] 52 | } 53 | ui_select={ 54 | "deadzone": 0.5, 55 | "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"unicode":0,"echo":false,"script":null) 56 | , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":3,"pressure":0.0,"pressed":false,"script":null) 57 | ] 58 | } 59 | ui_cancel={ 60 | "deadzone": 0.5, 61 | "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777217,"unicode":0,"echo":false,"script":null) 62 | , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":1,"pressure":0.0,"pressed":false,"script":null) 63 | ] 64 | } 65 | ui_focus_next={ 66 | "deadzone": 0.5, 67 | "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777218,"unicode":0,"echo":false,"script":null) 68 | ] 69 | } 70 | ui_focus_prev={ 71 | "deadzone": 0.5, 72 | "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":true,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777218,"unicode":0,"echo":false,"script":null) 73 | ] 74 | } 75 | ui_left={ 76 | "deadzone": 0.5, 77 | "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"unicode":0,"echo":false,"script":null) 78 | , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":14,"pressure":0.0,"pressed":false,"script":null) 79 | ] 80 | } 81 | ui_right={ 82 | "deadzone": 0.5, 83 | "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"unicode":0,"echo":false,"script":null) 84 | , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":15,"pressure":0.0,"pressed":false,"script":null) 85 | ] 86 | } 87 | ui_up={ 88 | "deadzone": 0.5, 89 | "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"unicode":0,"echo":false,"script":null) 90 | , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":12,"pressure":0.0,"pressed":false,"script":null) 91 | ] 92 | } 93 | ui_down={ 94 | "deadzone": 0.5, 95 | "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"unicode":0,"echo":false,"script":null) 96 | , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":13,"pressure":0.0,"pressed":false,"script":null) 97 | ] 98 | } 99 | ui_page_up={ 100 | "deadzone": 0.5, 101 | "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777235,"unicode":0,"echo":false,"script":null) 102 | ] 103 | } 104 | ui_page_down={ 105 | "deadzone": 0.5, 106 | "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777236,"unicode":0,"echo":false,"script":null) 107 | ] 108 | } 109 | ui_home={ 110 | "deadzone": 0.5, 111 | "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777229,"unicode":0,"echo":false,"script":null) 112 | ] 113 | } 114 | ui_end={ 115 | "deadzone": 0.5, 116 | "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777230,"unicode":0,"echo":false,"script":null) 117 | ] 118 | } 119 | 120 | [rendering] 121 | 122 | environment/default_clear_color=Color( 0.882353, 0.882353, 0.882353, 1 ) 123 | environment/default_environment="res://default_env.tres" 124 | -------------------------------------------------------------------------------- /card_class/holder.gd: -------------------------------------------------------------------------------- 1 | extends Control 2 | 3 | enum InteractionState {NONE, HOVER, DRAG} 4 | 5 | onready var progress = $TextureRect/ProgressBar 6 | onready var tex_node = $TextureRect 7 | onready var tween = $Tween 8 | 9 | var timer setget set_timer 10 | var card 11 | var drag_offset = Vector2() 12 | var drag_offset_factor = 1 13 | 14 | #state and helper vars 15 | var interaction_state = InteractionState.NONE 16 | var is_indication_label_shown = false 17 | var process_for_drag = false 18 | var process_for_progressbar = false 19 | signal dropped(card) 20 | signal drag_start(card) 21 | signal animate_to_holder_completed 22 | 23 | func _ready(): 24 | set_process(false) 25 | connect("mouse_entered", self, "_mouse_entered") 26 | connect("mouse_exited", self, "_mouse_exited") 27 | card.connect("tapped_changed", self, "animate_tapping") 28 | 29 | #DO NOT DELETE! for now it just overflows debugger 30 | # Global.opponent.bf_node.connect("mouse_entered", self, "_mouse_entered_opponent_bf") 31 | # Global.opponent.bf_node.connect("mouse_exited", self, "_mouse_exited_opponent_bf") 32 | 33 | func _process(delta): 34 | # print("process of card_node aka: the all mighty \"holder\"...") 35 | if timer: 36 | progress.value = 1 - timer.time_left / timer.wait_time 37 | if interaction_state == InteractionState.DRAG: 38 | drag_offset_factor = max(0,(drag_offset_factor * 0.8) - delta) 39 | tex_node.rect_global_position = (get_global_mouse_position() - tex_node.rect_size/2) + drag_offset * drag_offset_factor 40 | # tex_node.rect_global_position = tex_node.rect_global_position 41 | if card.location == CardLocation.BATTLEFIELD: 42 | #check if over opponent area 43 | var current_table_loc = TableLocation.mouse_pos() 44 | var OPPONENT_BF = TableLocation.opponent_bf(card.player) 45 | 46 | if current_table_loc == OPPONENT_BF and not is_indication_label_shown: 47 | Global.game_table.indicate_attack_phase(true, 2) #true: indicate with gap, 2: with high contrast label 48 | is_indication_label_shown = true 49 | elif current_table_loc != OPPONENT_BF and is_indication_label_shown: 50 | Global.game_table.indicate_attack_phase(true, 1) #true: indicate with gap, 1: for low contrast lable 51 | is_indication_label_shown = false 52 | 53 | func _enter_tree(): 54 | get_parent().connect("resized", self, "update_holder_size") 55 | update_holder_size() 56 | func _exit_tree(): 57 | get_parent().disconnect("resized", self, "update_holder_size") 58 | 59 | func set_timer(new_val): 60 | timer = new_val 61 | progress.visible = true 62 | set_process(true) 63 | process_for_progressbar = true 64 | update_set_process() 65 | if not timer.is_connected("timeout", self, "_timeout"): 66 | timer.connect("timeout", self, "_timeout") 67 | 68 | func _timeout(): 69 | set_process(false) 70 | process_for_progressbar = false 71 | update_set_process() 72 | progress.visible = false 73 | 74 | func _gui_input(event): 75 | if event is InputEventMouseButton: 76 | if event.pressed and event.button_index == BUTTON_RIGHT: 77 | if card.location == CardLocation.BATTLEFIELD or card.location == CardLocation.ATTACK: 78 | card.tapped = not card.tapped 79 | return 80 | 81 | if event.pressed and event.button_index == BUTTON_LEFT: 82 | interaction_state = InteractionState.DRAG 83 | process_for_drag = true 84 | update_set_process() 85 | VisualServer.canvas_item_set_z_index(tex_node.get_canvas_item(),2) 86 | drag_offset = tex_node.rect_global_position - (get_global_mouse_position() - (tex_node.rect_size /2)) 87 | drag_offset_factor = 1 88 | animate_card_big_for_dragging() 89 | Global.game_table.hide_card_preview(card) 90 | 91 | func _input(event): 92 | if event is InputEventMouseButton: 93 | if not event.pressed and event.button_index == BUTTON_LEFT: 94 | if interaction_state == InteractionState.DRAG: 95 | process_for_drag = false 96 | interaction_state == InteractionState.NONE 97 | update_set_process() 98 | emit_signal("dropped", card) 99 | 100 | func _mouse_entered(): 101 | interaction_state = InteractionState.HOVER 102 | if card.location == CardLocation.HAND and not card.casting: 103 | animate_card_big() 104 | if card.location == CardLocation.BATTLEFIELD or card.location == CardLocation.ATTACK: 105 | Global.game_table.show_card_preview(card) 106 | 107 | func _mouse_exited(): 108 | interaction_state = InteractionState.NONE 109 | if card.location == CardLocation.HAND and not card.casting: 110 | animate_to_holder() 111 | if card.location == CardLocation.BATTLEFIELD or card.location == CardLocation.ATTACK: 112 | Global.game_table.hide_card_preview(card) 113 | 114 | func animate_card_big_for_dragging(): 115 | tween.stop(tex_node) 116 | print(tex_node.rect_size) 117 | # if card.tapped == false: 118 | tween.interpolate_property(tex_node, "rect_size", tex_node.rect_size, Vector2(tex_node.texture.get_height(), tex_node.texture.get_height())*card.player.DRAG_SIZE_HIGHT/tex_node.texture.get_height(), 0.8, Tween.TRANS_LINEAR, Tween.EASE_IN) 119 | # else: 120 | # tex_node.rect_size = Vector2(tex_node.texture.get_width(), tex_node.texture.get_height()) 121 | # tween.interpolate_property(tex_node, "rect_size", tex_node.rect_size, Vector2(tex_node.texture.get_height(), tex_node.texture.get_width())*card.player.DRAG_SIZE_HIGHT/tex_node.texture.get_width(), 0.8, Tween.TRANS_LINEAR, Tween.EASE_IN) 122 | func animate_card_big(): 123 | var t_trans = Tween.TRANS_EXPO 124 | var t_ease = Tween.EASE_OUT 125 | var d = 2 126 | var ct = tex_node 127 | VisualServer.canvas_item_set_z_index(ct.get_canvas_item(), 4) 128 | tween.stop_all() 129 | var si = card.hover_card_hand_size() 130 | # for p in card.player.get_property_list(): 131 | # print(p["name"]) 132 | var m_top = rect_size.y/2 - si.y 133 | var m_bottom = -rect_size.y/2 134 | if card.player.table_side == card.player.TableSide.TOP: 135 | var margin_temp = m_top 136 | m_top = -m_bottom 137 | m_bottom = -margin_temp 138 | 139 | tween.interpolate_property(ct, "margin_top", 0, m_top , d,t_trans,t_ease) 140 | tween.interpolate_property(ct, "margin_bottom", 0, m_bottom, d,t_trans,t_ease) 141 | tween.interpolate_property(ct, "margin_left", 0, -(si.x +rect_size.x)/2, d,t_trans,t_ease) 142 | tween.interpolate_property(ct, "margin_right", 0, (si.x +rect_size.x)/2, d,t_trans,t_ease) 143 | tween.start() 144 | 145 | func animate_to_holder(): 146 | var ct = tex_node 147 | VisualServer.canvas_item_set_z_index(ct.get_canvas_item(),3) 148 | tween.stop_all() 149 | # tween.resume(self, "update_tap_status") 150 | var t_trans = Tween.TRANS_BOUNCE 151 | var t_ease = Tween.EASE_OUT 152 | var d = 0.6 153 | # print(ct.margin_top) 154 | tween.interpolate_property(ct, "margin_top" , ct.margin_top ,0, d,t_trans,t_ease) 155 | tween.interpolate_property(ct, "margin_left" , ct.margin_left ,0, d,t_trans,t_ease) 156 | tween.interpolate_property(ct, "margin_right" , ct.margin_right ,0, d,t_trans,t_ease) 157 | tween.interpolate_property(ct, "margin_bottom", ct.margin_bottom,0, d,t_trans,t_ease) 158 | tween.start() 159 | # yield(player.get_tree().create_timer(d*2), "timeout") 160 | yield(tween, "tween_completed") 161 | VisualServer.canvas_item_set_z_index(ct.get_canvas_item(),0) 162 | emit_signal("animate_to_holder_completed") 163 | 164 | func update_holder_size(): 165 | if get_parent() is HBoxContainer: 166 | if card.tapped: 167 | rect_min_size.x = get_parent_control().rect_size.y 168 | else: 169 | rect_min_size.x = get_parent_control().rect_size.y * card_renderer.card_size.aspect() 170 | 171 | func animate_tapping(): 172 | # rect_min_size.x += 10 173 | # tween.stop_all() 174 | var t = 0.5 175 | if card.tapped: 176 | print("tapping: ", rect_min_size.x,",", tex_node.rect_size.y) 177 | tween.interpolate_property(self, "rect_min_size:x", rect_min_size.x, tex_node.rect_size.y, t, Tween.TRANS_ELASTIC, Tween.EASE_OUT) 178 | yield(tween, "tween_completed") 179 | tex_node.set_pivot_offset(rect_size/2) 180 | tween.interpolate_property(tex_node, "rect_rotation", 0, 90, t, Tween.TRANS_EXPO, Tween.EASE_OUT) 181 | if not card.tapped: 182 | tween.interpolate_property(tex_node, "rect_rotation", 90, 0, t, Tween.TRANS_EXPO, Tween.EASE_OUT) 183 | yield(tween, "tween_completed") 184 | var old_x = rect_size.x 185 | update_holder_size() 186 | tween.interpolate_property(self, "rect_min_size:x", rect_size.x, rect_min_size.x, t, Tween.TRANS_BOUNCE, Tween.EASE_OUT) 187 | tween.start() 188 | 189 | func update_set_process(): 190 | set_process(process_for_drag or process_for_progressbar) 191 | # set_process(true) 192 | -------------------------------------------------------------------------------- /game_table/player_side.gd: -------------------------------------------------------------------------------- 1 | extends HBoxContainer 2 | 3 | enum TableSide {TOP, BOTTOM} 4 | #export (bool) onready var is_player 5 | export (TableSide) var table_side = TableSide.TOP 6 | onready var bf_node = $right_area/bf 7 | onready var hand_node = $right_area/hand 8 | onready var bf_h_box = $right_area/bf/HBoxContainer 9 | onready var hand_h_box = $right_area/hand/HBoxContainer 10 | onready var v_box = $right_area 11 | onready var name_label = $left_area/Label 12 | onready var attack_phase_spacer = $right_area/attack_phase_spacer 13 | onready var attack_h_box = $right_area/bf/attack_h_box 14 | onready var attack_overlay = $right_area/bf/attack_overlay 15 | onready var attack_overlay_bg = $right_area/bf/attack_overlay/attack_overlay_bg 16 | var BF_CARD_HEIGHT = 350 17 | var DRAG_SIZE_HIGHT = 300 18 | 19 | signal mana_changed(mana) 20 | signal card_added(card) 21 | signal turn_finished 22 | signal cast_finished 23 | signal attack_anim_complete 24 | 25 | export var cast_wait_time = 0.5 26 | var is_playing setget _turn_changed 27 | var mana_temp = {} 28 | var cardnames_deck = [] 29 | var cards_in_game = [] 30 | var cast_queue = [] 31 | 32 | 33 | func _ready(): 34 | update_tableside() 35 | get_tree().get_root().connect("size_changed", self, "update_tableside") 36 | attack_overlay.get_font("font").size = Dpi.cm_to_pixel(0.6) 37 | for t in ManaType.list: 38 | mana_temp[t] = 0 39 | #Mana 40 | func get_available_mana(): 41 | var av_mana = {} 42 | for mt in ManaType.list: 43 | av_mana[mt] = 0 44 | 45 | for c in get_cards_mana_array(): 46 | if not c.tapped: 47 | av_mana[c.mana_type] += 1 48 | return av_mana 49 | func tap_mana(mana): 50 | var m = mana 51 | for c in get_cards_mana_array(): 52 | if m[c.mana_type] > 0: 53 | c.tapped = true 54 | m[c.mana_type] -= 1 55 | emit_signal("mana_changed", get_available_mana()) 56 | 57 | func update_tableside(): 58 | #set up of the bf and hand order for TOP or BOTTOM player_side 59 | var end_pos = $right_area.get_child_count() - 1 60 | match table_side: 61 | TableSide.TOP: 62 | #player on TOP side of table so order is: hand_node, bf_node, attack_phase_spacer (from top to bottmo) 63 | $right_area.move_child(hand_node, end_pos) 64 | $right_area.move_child(bf_node, end_pos) 65 | $right_area.move_child(attack_phase_spacer, end_pos) 66 | $left_area/Label.text = "Player2" 67 | attack_h_box.set_anchors_and_margins_preset(Control.PRESET_BOTTOM_WIDE) 68 | TableSide.BOTTOM: 69 | #player on BOTTOM side of table so order is: attack_phase_spacer, bf_node, hand_node (from top to bottmo) 70 | $right_area.move_child(attack_phase_spacer, end_pos) 71 | $right_area.move_child(bf_node, end_pos) 72 | $right_area.move_child(hand_node, end_pos) 73 | $left_area/Label.text = "Player1" 74 | attack_h_box.set_anchors_and_margins_preset(Control.PRESET_TOP_WIDE) 75 | attack_h_box.margin_top = -Dpi.ATTACK_SPACER_HEIGHT 76 | attack_h_box.margin_bottom = Dpi.ATTACK_SPACER_HEIGHT / 3 77 | VisualServer.canvas_item_set_z_index(attack_h_box.get_canvas_item(),10) 78 | hand_node.rect_min_size.y = get_tree().get_root().size.y / 2 / 3 79 | 80 | 81 | #DRAW CARD 82 | func _on_deck_gui_input(event): 83 | if event is InputEventMouseButton: 84 | if event.pressed and event.button_index == BUTTON_LEFT and is_playing: 85 | draw_card() 86 | 87 | #drawing a card 88 | func draw_card(): 89 | if not cardnames_deck.empty(): 90 | add_card_to_hand(card_cache.card(cardnames_deck.pop_front()) ) 91 | else: 92 | print("There are no cards left (in Deck)") 93 | 94 | func add_card_to_hand(card): 95 | card.player = self 96 | card.opponent = get_parent().get_child(abs(get_index() - 1)) 97 | cards_in_game.append(card) 98 | hand_h_box.add_child(card.holder_node) 99 | hand_h_box.move_child(card.holder_node, 0) 100 | card.location = CardLocation.HAND 101 | var initial_rect = Global.game_table.deck.get_global_rect() 102 | yield(hand_h_box, "sort_children") 103 | card.texture_node.rect_global_position = initial_rect.position 104 | card.texture_node.rect_size = initial_rect.size 105 | # card.move_to(hand_h_box, CardLocation.HAND) 106 | 107 | # emit_signal("card_added", card) 108 | 109 | card.holder_node.animate_to_holder() 110 | 111 | card.connect("location_changed", self, "_card_location_changed") 112 | card.holder_node.connect("dropped", self, "_card_dropped") 113 | 114 | ##ATTACK ui-anim's 115 | func animate_attack(to_attack): 116 | var d = 0.2 117 | var attack_spacer_height = Dpi.ATTACK_SPACER_HEIGHT 118 | if not to_attack: 119 | attack_spacer_height = 0 120 | # Global.add_tween_to_queue(attack_phase_spacer, "rect_min_size:y", "different_property_absolute", ["rect_size.y", attack_spacer_height], d, Tween.TRANS_EXPO, Tween.EASE_IN) 121 | Global.game_table.tw.interpolate_property(attack_phase_spacer, "rect_min_size:y", attack_phase_spacer.rect_size.y, attack_spacer_height, d, 122 | Tween.TRANS_EXPO, Tween.EASE_IN) 123 | yield(Global.game_table.tw, "tween_completed") 124 | emit_signal("attack_anim_complete") 125 | 126 | func show_attack_indicate_label(opacity_lbl, opcity_bg): 127 | Global.game_table.tw.interpolate_property(attack_overlay, "self_modulate:a", 128 | attack_overlay.self_modulate.a, opacity_lbl, 129 | 0.2, Tween.EASE_IN, Tween.TRANS_LINEAR) 130 | Global.game_table.tw.interpolate_property(attack_overlay_bg, "self_modulate:a", 131 | attack_overlay_bg.self_modulate.a, opcity_bg, 132 | 0.2, Tween.EASE_IN, Tween.TRANS_LINEAR) 133 | 134 | 135 | #Handle Card Actions 136 | func _card_dropped(card): 137 | match card.location: 138 | CardLocation.HAND: 139 | #cast 140 | # if (Global.game_table.is_casting() and can_cast_phase(card)) or is_playing: #you can always cast a card to react to another one 141 | if can_cast_phase(card) or is_playing: #you can always cast a card to react to another one 142 | if TableLocation.mouse_over_cast_area() and card.can_cast() and can_cast_enough_mana(card): 143 | tap_mana(card.mana_cost) 144 | queue_cast_card(card) 145 | else: 146 | card.holder_node.animate_to_holder() 147 | else: 148 | card.holder_node.animate_to_holder() 149 | 150 | CardLocation.ATTACK: 151 | if TableLocation.mouse_pos() == TableLocation.ATTACK_SPACE: 152 | card.move_to(attack_h_box, CardLocation.ATTACK) #This does not really do anything. Right now, when dropping here, the indication is shown again which should not be the case 153 | else: 154 | card.move_to(bf_h_box, CardLocation.BATTLEFIELD) 155 | yield(card, "location_changed") 156 | Global.game_table.end_attack_phase() 157 | yield(Global.game_table, "attack_phase_ended") 158 | card.tapped = false 159 | CardLocation.BATTLEFIELD: 160 | if is_playing: 161 | if TableLocation.mouse_pos() == TableLocation.opponent_bf(self): 162 | card.move_to(attack_h_box, CardLocation.ATTACK) 163 | yield(card, "location_changed") 164 | Global.game_table.start_attack_phase() 165 | yield(Global.game_table, "attack_phase_started") 166 | card.tapped = true 167 | else: 168 | card.holder_node.animate_to_holder() 169 | Global.game_table.indicate_attack_phase(false, 0) # #false: indicate with gap, false: for without label 170 | else: #deafault phase but not playing 171 | card.holder_node.animate_to_holder() 172 | 173 | func can_cast_enough_mana(card): 174 | var mana = get_available_mana() 175 | for t in ManaType.list: 176 | if card.mana_cost[t] > mana[t]: 177 | return false 178 | return true 179 | func can_cast_phase(card): 180 | if card.type == card.CardType.INSTANT: #TODO maybe we need to add more types here? 181 | return true 182 | return false 183 | func queue_cast_card(card): 184 | if cast_queue.empty() or card.type == card.CardType.INSTANT: 185 | pass 186 | else: 187 | return 188 | if not cast_queue.empty(): 189 | cast_queue.front().timer.paused = true 190 | 191 | cast_queue.push_front(card) 192 | card.start_cast_timer(cast_wait_time) 193 | yield(card.timer, "timeout") 194 | 195 | card.cast() 196 | cast_queue.pop_front() 197 | if not cast_queue.empty(): 198 | cast_queue.front().timer.paused = false 199 | else: 200 | card.holder_node.animate_to_holder() 201 | emit_signal("cast_finished") 202 | 203 | match card.type: 204 | card.CardType.LAND: 205 | hand_h_box.remove_child(card.holder_node) 206 | card.location = CardLocation.MANA 207 | card.CardType.CREATURE: 208 | card.move_to(bf_h_box, CardLocation.BATTLEFIELD) 209 | card.CardType.INSTANT: 210 | hand_h_box.remove_child(card.holder_node) 211 | card.location = CardLocation.GRAVEYARD 212 | # if move_to_h_box: 213 | # var tex_global_rect = card.texture_node.get_global_rect() 214 | # card.holder_node.get_parent().remove_child(card.holder_node) 215 | # bf_h_box.add_child(card.holder_node) 216 | # yield(bf_h_box, "sort_children") 217 | # card.texture_node.rect_global_position = tex_global_rect.position 218 | # card.texture_node.rect_size = tex_global_rect.size 219 | # card.holder_node.animate_to_holder() 220 | 221 | #Events 222 | func _card_location_changed(card): 223 | if card.location == CardLocation.MANA: 224 | print("mana added") 225 | emit_signal("mana_changed", get_available_mana()) 226 | func _on_FinishTurnButton_pressed(): 227 | emit_signal("turn_finished") 228 | func _turn_changed(new_val): 229 | is_playing = new_val 230 | $left_area/FinishTurnButton.disabled = not is_playing 231 | 232 | #Helper 233 | func get_opponent(): 234 | if Global.game_table.player == self: 235 | return Global.game_table.opponent 236 | else: 237 | return Global.game_table.player 238 | #get cards from different locations 239 | func get_cards_hand(): 240 | return get_cards_in(CardLocation.HAND) 241 | func get_cards_mana_array(): 242 | return get_cards_in(CardLocation.MANA) 243 | func get_cards_graveyard(): 244 | return get_cards_in(CardLocation.GRAVEYARD) 245 | func get_cards_battlefield(): 246 | return get_cards_in(CardLocation.BATTLEFIELD) 247 | 248 | func get_cards_in(location): 249 | var cards_found = [] 250 | for c in cards_in_game: 251 | if c.location == location: 252 | cards_found.append(c) 253 | return cards_found 254 | -------------------------------------------------------------------------------- /export_presets.cfg: -------------------------------------------------------------------------------- 1 | [preset.0] 2 | 3 | name="Mac OSX" 4 | platform="Mac OSX" 5 | runnable=true 6 | custom_features="" 7 | export_filter="all_resources" 8 | include_filter="" 9 | exclude_filter="" 10 | patch_list=PoolStringArray( ) 11 | 12 | [preset.0.options] 13 | 14 | custom_package/debug="" 15 | custom_package/release="" 16 | application/name="" 17 | application/info="Made with Godot Engine" 18 | application/icon="" 19 | application/identifier="org.godotengine.macgame" 20 | application/signature="godotmacgame" 21 | application/short_version="1.0" 22 | application/version="1.0" 23 | application/copyright="" 24 | display/high_res=false 25 | codesign/identity="" 26 | codesign/entitlements="" 27 | texture_format/s3tc=true 28 | texture_format/etc=false 29 | texture_format/etc2=false 30 | 31 | [preset.1] 32 | 33 | name="Android" 34 | platform="Android" 35 | runnable=true 36 | custom_features="" 37 | export_filter="all_resources" 38 | include_filter="" 39 | exclude_filter="" 40 | patch_list=PoolStringArray( ) 41 | 42 | [preset.1.options] 43 | 44 | graphics/32_bits_framebuffer=true 45 | one_click_deploy/clear_previous_install=true 46 | custom_package/debug="" 47 | custom_package/release="" 48 | command_line/extra_args="" 49 | version/code=1 50 | version/name="1.0" 51 | package/unique_name="org.godotengine.$genname" 52 | package/name="" 53 | package/signed=true 54 | screen/immersive_mode=true 55 | screen/orientation=0 56 | screen/support_small=true 57 | screen/support_normal=true 58 | screen/support_large=true 59 | screen/support_xlarge=true 60 | launcher_icons/xxxhdpi_192x192="" 61 | launcher_icons/xxhdpi_144x144="" 62 | launcher_icons/xhdpi_96x96="" 63 | launcher_icons/hdpi_72x72="" 64 | launcher_icons/mdpi_48x48="" 65 | keystore/release="" 66 | keystore/release_user="" 67 | keystore/release_password="" 68 | apk_expansion/enable=false 69 | apk_expansion/SALT="" 70 | apk_expansion/public_key="" 71 | architectures/armeabi-v7a=true 72 | architectures/arm64-v8a=false 73 | architectures/x86=false 74 | architectures/x86_64=false 75 | permissions/access_checkin_properties=false 76 | permissions/access_coarse_location=false 77 | permissions/access_fine_location=false 78 | permissions/access_location_extra_commands=false 79 | permissions/access_mock_location=false 80 | permissions/access_network_state=false 81 | permissions/access_surface_flinger=false 82 | permissions/access_wifi_state=false 83 | permissions/account_manager=false 84 | permissions/add_voicemail=false 85 | permissions/authenticate_accounts=false 86 | permissions/battery_stats=false 87 | permissions/bind_accessibility_service=false 88 | permissions/bind_appwidget=false 89 | permissions/bind_device_admin=false 90 | permissions/bind_input_method=false 91 | permissions/bind_nfc_service=false 92 | permissions/bind_notification_listener_service=false 93 | permissions/bind_print_service=false 94 | permissions/bind_remoteviews=false 95 | permissions/bind_text_service=false 96 | permissions/bind_vpn_service=false 97 | permissions/bind_wallpaper=false 98 | permissions/bluetooth=false 99 | permissions/bluetooth_admin=false 100 | permissions/bluetooth_privileged=false 101 | permissions/brick=false 102 | permissions/broadcast_package_removed=false 103 | permissions/broadcast_sms=false 104 | permissions/broadcast_sticky=false 105 | permissions/broadcast_wap_push=false 106 | permissions/call_phone=false 107 | permissions/call_privileged=false 108 | permissions/camera=false 109 | permissions/capture_audio_output=false 110 | permissions/capture_secure_video_output=false 111 | permissions/capture_video_output=false 112 | permissions/change_component_enabled_state=false 113 | permissions/change_configuration=false 114 | permissions/change_network_state=false 115 | permissions/change_wifi_multicast_state=false 116 | permissions/change_wifi_state=false 117 | permissions/clear_app_cache=false 118 | permissions/clear_app_user_data=false 119 | permissions/control_location_updates=false 120 | permissions/delete_cache_files=false 121 | permissions/delete_packages=false 122 | permissions/device_power=false 123 | permissions/diagnostic=false 124 | permissions/disable_keyguard=false 125 | permissions/dump=false 126 | permissions/expand_status_bar=false 127 | permissions/factory_test=false 128 | permissions/flashlight=false 129 | permissions/force_back=false 130 | permissions/get_accounts=false 131 | permissions/get_package_size=false 132 | permissions/get_tasks=false 133 | permissions/get_top_activity_info=false 134 | permissions/global_search=false 135 | permissions/hardware_test=false 136 | permissions/inject_events=false 137 | permissions/install_location_provider=false 138 | permissions/install_packages=false 139 | permissions/install_shortcut=false 140 | permissions/internal_system_window=false 141 | permissions/internet=false 142 | permissions/kill_background_processes=false 143 | permissions/location_hardware=false 144 | permissions/manage_accounts=false 145 | permissions/manage_app_tokens=false 146 | permissions/manage_documents=false 147 | permissions/master_clear=false 148 | permissions/media_content_control=false 149 | permissions/modify_audio_settings=false 150 | permissions/modify_phone_state=false 151 | permissions/mount_format_filesystems=false 152 | permissions/mount_unmount_filesystems=false 153 | permissions/nfc=false 154 | permissions/persistent_activity=false 155 | permissions/process_outgoing_calls=false 156 | permissions/read_calendar=false 157 | permissions/read_call_log=false 158 | permissions/read_contacts=false 159 | permissions/read_external_storage=false 160 | permissions/read_frame_buffer=false 161 | permissions/read_history_bookmarks=false 162 | permissions/read_input_state=false 163 | permissions/read_logs=false 164 | permissions/read_phone_state=false 165 | permissions/read_profile=false 166 | permissions/read_sms=false 167 | permissions/read_social_stream=false 168 | permissions/read_sync_settings=false 169 | permissions/read_sync_stats=false 170 | permissions/read_user_dictionary=false 171 | permissions/reboot=false 172 | permissions/receive_boot_completed=false 173 | permissions/receive_mms=false 174 | permissions/receive_sms=false 175 | permissions/receive_wap_push=false 176 | permissions/record_audio=false 177 | permissions/reorder_tasks=false 178 | permissions/restart_packages=false 179 | permissions/send_respond_via_message=false 180 | permissions/send_sms=false 181 | permissions/set_activity_watcher=false 182 | permissions/set_alarm=false 183 | permissions/set_always_finish=false 184 | permissions/set_animation_scale=false 185 | permissions/set_debug_app=false 186 | permissions/set_orientation=false 187 | permissions/set_pointer_speed=false 188 | permissions/set_preferred_applications=false 189 | permissions/set_process_limit=false 190 | permissions/set_time=false 191 | permissions/set_time_zone=false 192 | permissions/set_wallpaper=false 193 | permissions/set_wallpaper_hints=false 194 | permissions/signal_persistent_processes=false 195 | permissions/status_bar=false 196 | permissions/subscribed_feeds_read=false 197 | permissions/subscribed_feeds_write=false 198 | permissions/system_alert_window=false 199 | permissions/transmit_ir=false 200 | permissions/uninstall_shortcut=false 201 | permissions/update_device_stats=false 202 | permissions/use_credentials=false 203 | permissions/use_sip=false 204 | permissions/vibrate=false 205 | permissions/wake_lock=false 206 | permissions/write_apn_settings=false 207 | permissions/write_calendar=false 208 | permissions/write_call_log=false 209 | permissions/write_contacts=false 210 | permissions/write_external_storage=false 211 | permissions/write_gservices=false 212 | permissions/write_history_bookmarks=false 213 | permissions/write_profile=false 214 | permissions/write_secure_settings=false 215 | permissions/write_settings=false 216 | permissions/write_sms=false 217 | permissions/write_social_stream=false 218 | permissions/write_sync_settings=false 219 | permissions/write_user_dictionary=false 220 | user_permissions/0=false 221 | user_permissions/1=false 222 | user_permissions/2=false 223 | user_permissions/3=false 224 | user_permissions/4=false 225 | user_permissions/5=false 226 | user_permissions/6=false 227 | user_permissions/7=false 228 | user_permissions/8=false 229 | user_permissions/9=false 230 | user_permissions/10=false 231 | user_permissions/11=false 232 | user_permissions/12=false 233 | user_permissions/13=false 234 | user_permissions/14=false 235 | user_permissions/15=false 236 | user_permissions/16=false 237 | user_permissions/17=false 238 | user_permissions/18=false 239 | user_permissions/19=false 240 | 241 | [preset.2] 242 | 243 | name="iOS" 244 | platform="iOS" 245 | runnable=true 246 | custom_features="" 247 | export_filter="all_resources" 248 | include_filter="" 249 | exclude_filter="" 250 | patch_list=PoolStringArray( ) 251 | 252 | [preset.2.options] 253 | 254 | custom_package/debug="" 255 | custom_package/release="" 256 | application/app_store_team_id="" 257 | application/provisioning_profile_uuid_debug="" 258 | application/code_sign_identity_debug="iPhone Developer" 259 | application/export_method_debug=1 260 | application/provisioning_profile_uuid_release="" 261 | application/code_sign_identity_release="iPhone Distribution" 262 | application/export_method_release=0 263 | application/name="" 264 | application/info="Made with Godot Engine" 265 | application/identifier="org.godotengine.iosgame" 266 | application/signature="????" 267 | application/short_version="1.0" 268 | application/version="1.0" 269 | application/copyright="" 270 | required_icons/iphone_120x120="" 271 | required_icons/ipad_76x76="" 272 | required_icons/app_store_1024x1024="" 273 | optional_icons/iphone_180x180="" 274 | optional_icons/ipad_152x152="" 275 | optional_icons/ipad_167x167="" 276 | optional_icons/spotlight_40x40="" 277 | optional_icons/spotlight_80x80="" 278 | landscape_launch_screens/iphone_2436x1125="" 279 | landscape_launch_screens/iphone_2208x1242="" 280 | landscape_launch_screens/ipad_1024x768="" 281 | landscape_launch_screens/ipad_2048x1536="" 282 | portrait_launch_screens/iphone_640x960="" 283 | portrait_launch_screens/iphone_640x1136="" 284 | portrait_launch_screens/iphone_750x1334="" 285 | portrait_launch_screens/iphone_1125x2436="" 286 | portrait_launch_screens/ipad_768x1024="" 287 | portrait_launch_screens/ipad_1536x2048="" 288 | portrait_launch_screens/iphone_1242x2208="" 289 | texture_format/s3tc=false 290 | texture_format/etc=false 291 | texture_format/etc2=true 292 | architectures/armv7=true 293 | architectures/arm64=true 294 | -------------------------------------------------------------------------------- /game_table/player_side.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=6 format=2] 2 | 3 | [ext_resource path="res://game_table/player_side.gd" type="Script" id=1] 4 | [ext_resource path="res://game_table/mana_control.tscn" type="PackedScene" id=2] 5 | [ext_resource path="res://Font/Arial.ttf" type="DynamicFontData" id=3] 6 | 7 | [sub_resource type="StyleBoxFlat" id=1] 8 | 9 | content_margin_left = -1.0 10 | content_margin_right = -1.0 11 | content_margin_top = -1.0 12 | content_margin_bottom = -1.0 13 | bg_color = Color( 1, 1, 1, 1 ) 14 | draw_center = true 15 | border_width_left = 10 16 | border_width_top = 10 17 | border_width_right = 10 18 | border_width_bottom = 10 19 | border_color = Color( 0.8, 0.8, 0.8, 1 ) 20 | border_blend = false 21 | corner_radius_top_left = 22 22 | corner_radius_top_right = 22 23 | corner_radius_bottom_right = 22 24 | corner_radius_bottom_left = 22 25 | corner_detail = 8 26 | expand_margin_left = 0.0 27 | expand_margin_right = 0.0 28 | expand_margin_top = 0.0 29 | expand_margin_bottom = 0.0 30 | shadow_color = Color( 0, 0, 0, 0.0391765 ) 31 | shadow_size = 12 32 | anti_aliasing = true 33 | anti_aliasing_size = 1 34 | _sections_unfolded = [ "Border", "Border Width", "Corner Radius", "Shadow" ] 35 | 36 | [sub_resource type="DynamicFont" id=2] 37 | 38 | size = 80 39 | outline_size = 0 40 | outline_color = Color( 1, 1, 1, 1 ) 41 | use_mipmaps = false 42 | use_filter = false 43 | font_data = ExtResource( 3 ) 44 | 45 | [node name="Player" type="HBoxContainer" index="0"] 46 | anchor_left = 0.0 47 | anchor_top = 0.0 48 | anchor_right = 0.0 49 | anchor_bottom = 0.0 50 | margin_left = -1.0 51 | margin_right = 1919.0 52 | margin_bottom = 516.0 53 | rect_pivot_offset = Vector2( 0, 0 ) 54 | rect_clip_content = false 55 | mouse_filter = 1 56 | mouse_default_cursor_shape = 0 57 | size_flags_horizontal = 3 58 | size_flags_vertical = 3 59 | size_flags_stretch_ratio = 3.5 60 | alignment = 0 61 | script = ExtResource( 1 ) 62 | _sections_unfolded = [ "Size Flags" ] 63 | table_side = 1 64 | cast_wait_time = 3.0 65 | 66 | [node name="left_area" type="Control" parent="." index="0"] 67 | anchor_left = 0.0 68 | anchor_top = 0.0 69 | anchor_right = 0.0 70 | anchor_bottom = 0.0 71 | margin_right = 382.0 72 | margin_bottom = 516.0 73 | rect_pivot_offset = Vector2( 0, 0 ) 74 | rect_clip_content = false 75 | mouse_filter = 0 76 | mouse_default_cursor_shape = 0 77 | size_flags_horizontal = 3 78 | size_flags_vertical = 1 79 | _sections_unfolded = [ "Size Flags" ] 80 | 81 | [node name="deck" type="Panel" parent="left_area" index="0"] 82 | anchor_left = 0.6 83 | anchor_top = 0.6 84 | anchor_right = 1.0 85 | anchor_bottom = 1.0 86 | margin_right = -10.0 87 | margin_bottom = -10.0 88 | rect_pivot_offset = Vector2( 0, 0 ) 89 | rect_clip_content = false 90 | mouse_filter = 0 91 | mouse_default_cursor_shape = 0 92 | size_flags_horizontal = 1 93 | size_flags_vertical = 1 94 | custom_styles/panel = SubResource( 1 ) 95 | _sections_unfolded = [ "Anchor", "Custom Styles", "Margin", "custom_styles/panel" ] 96 | 97 | [node name="Label" type="Label" parent="left_area/deck" index="0"] 98 | anchor_left = 0.0 99 | anchor_top = 0.0 100 | anchor_right = 1.0 101 | anchor_bottom = 1.0 102 | rect_pivot_offset = Vector2( 0, 0 ) 103 | rect_clip_content = false 104 | mouse_filter = 2 105 | mouse_default_cursor_shape = 0 106 | size_flags_horizontal = 1 107 | size_flags_vertical = 4 108 | text = "Deck" 109 | align = 1 110 | valign = 1 111 | percent_visible = 1.0 112 | lines_skipped = 0 113 | max_lines_visible = -1 114 | 115 | [node name="Label" type="Label" parent="left_area" index="1"] 116 | anchor_left = 0.0 117 | anchor_top = 0.0 118 | anchor_right = 1.0 119 | anchor_bottom = 0.0 120 | margin_bottom = 35.0 121 | rect_pivot_offset = Vector2( 0, 0 ) 122 | rect_clip_content = false 123 | mouse_filter = 2 124 | mouse_default_cursor_shape = 0 125 | size_flags_horizontal = 1 126 | size_flags_vertical = 4 127 | text = "Opponent" 128 | align = 1 129 | percent_visible = 1.0 130 | lines_skipped = 0 131 | max_lines_visible = -1 132 | _sections_unfolded = [ "Custom Styles" ] 133 | 134 | [node name="VBoxContainer" type="VBoxContainer" parent="left_area" index="2"] 135 | anchor_left = 0.0 136 | anchor_top = 0.0 137 | anchor_right = 0.0 138 | anchor_bottom = 0.0 139 | margin_right = 40.0 140 | margin_bottom = 40.0 141 | rect_pivot_offset = Vector2( 0, 0 ) 142 | rect_clip_content = false 143 | mouse_filter = 1 144 | mouse_default_cursor_shape = 0 145 | size_flags_horizontal = 1 146 | size_flags_vertical = 1 147 | alignment = 0 148 | 149 | [node name="mana_control" parent="left_area" index="3" instance=ExtResource( 2 )] 150 | margin_left = 18.0 151 | margin_top = 113.0 152 | margin_right = 78.0 153 | margin_bottom = 513.0 154 | 155 | [node name="FinishTurnButton" type="Button" parent="left_area" index="4"] 156 | anchor_left = 0.0 157 | anchor_top = 0.0 158 | anchor_right = 0.0 159 | anchor_bottom = 0.0 160 | margin_left = 115.0 161 | margin_top = 61.0 162 | margin_right = 279.0 163 | margin_bottom = 98.0 164 | rect_pivot_offset = Vector2( 0, 0 ) 165 | rect_clip_content = false 166 | focus_mode = 2 167 | mouse_filter = 0 168 | mouse_default_cursor_shape = 0 169 | size_flags_horizontal = 1 170 | size_flags_vertical = 1 171 | toggle_mode = false 172 | enabled_focus_mode = 2 173 | shortcut = null 174 | group = null 175 | text = "finish turn" 176 | flat = false 177 | align = 1 178 | 179 | [node name="right_area" type="VBoxContainer" parent="." index="1"] 180 | anchor_left = 0.0 181 | anchor_top = 0.0 182 | anchor_right = 0.0 183 | anchor_bottom = 0.0 184 | margin_left = 390.0 185 | margin_right = 1920.0 186 | margin_bottom = 516.0 187 | rect_pivot_offset = Vector2( 0, 0 ) 188 | rect_clip_content = false 189 | mouse_filter = 1 190 | mouse_default_cursor_shape = 0 191 | size_flags_horizontal = 3 192 | size_flags_vertical = 1 193 | size_flags_stretch_ratio = 4.0 194 | alignment = 0 195 | _sections_unfolded = [ "Size Flags" ] 196 | 197 | [node name="attack_phase_spacer" type="Control" parent="right_area" index="0"] 198 | anchor_left = 0.0 199 | anchor_top = 0.0 200 | anchor_right = 0.0 201 | anchor_bottom = 0.0 202 | margin_right = 1530.0 203 | rect_pivot_offset = Vector2( 0, 0 ) 204 | rect_clip_content = false 205 | mouse_filter = 2 206 | mouse_default_cursor_shape = 0 207 | size_flags_horizontal = 1 208 | size_flags_vertical = 1 209 | _sections_unfolded = [ "Mouse" ] 210 | 211 | [node name="hand" type="Panel" parent="right_area" index="1"] 212 | anchor_left = 0.0 213 | anchor_top = 0.0 214 | anchor_right = 0.0 215 | anchor_bottom = 0.0 216 | margin_top = 8.0 217 | margin_right = 1530.0 218 | margin_bottom = 228.0 219 | rect_min_size = Vector2( 0, 220 ) 220 | rect_pivot_offset = Vector2( 0, 0 ) 221 | rect_clip_content = false 222 | mouse_filter = 0 223 | mouse_default_cursor_shape = 0 224 | size_flags_horizontal = 1 225 | size_flags_vertical = 1 226 | _sections_unfolded = [ "Rect", "Size Flags", "Visibility" ] 227 | 228 | [node name="HBoxContainer" type="HBoxContainer" parent="right_area/hand" index="0"] 229 | anchor_left = 0.0 230 | anchor_top = 0.0 231 | anchor_right = 1.0 232 | anchor_bottom = 1.0 233 | margin_left = 20.0 234 | margin_top = 10.0 235 | margin_right = -20.0 236 | margin_bottom = -10.0 237 | grow_horizontal = 2 238 | rect_pivot_offset = Vector2( 0, 0 ) 239 | rect_clip_content = false 240 | mouse_filter = 1 241 | mouse_default_cursor_shape = 0 242 | size_flags_horizontal = 1 243 | size_flags_vertical = 1 244 | custom_constants/separation = 13 245 | alignment = 1 246 | _sections_unfolded = [ "Anchor", "Custom Constants", "Grow Direction", "Margin", "Rect", "Size Flags" ] 247 | 248 | [node name="bf" type="Panel" parent="right_area" index="2"] 249 | anchor_left = 0.0 250 | anchor_top = 0.0 251 | anchor_right = 0.0 252 | anchor_bottom = 0.0 253 | margin_top = 236.0 254 | margin_right = 1530.0 255 | margin_bottom = 516.0 256 | rect_pivot_offset = Vector2( 0, 0 ) 257 | rect_clip_content = false 258 | mouse_filter = 0 259 | mouse_default_cursor_shape = 0 260 | size_flags_horizontal = 1 261 | size_flags_vertical = 3 262 | _sections_unfolded = [ "Size Flags" ] 263 | 264 | [node name="HBoxContainer" type="HBoxContainer" parent="right_area/bf" index="0"] 265 | anchor_left = 0.0 266 | anchor_top = 0.0 267 | anchor_right = 1.0 268 | anchor_bottom = 1.0 269 | margin_left = 20.0 270 | margin_top = 10.0 271 | margin_right = -20.0 272 | margin_bottom = -10.0 273 | grow_horizontal = 2 274 | grow_vertical = 0 275 | rect_pivot_offset = Vector2( 0, 0 ) 276 | rect_clip_content = false 277 | mouse_filter = 1 278 | mouse_default_cursor_shape = 0 279 | size_flags_horizontal = 1 280 | size_flags_vertical = 1 281 | alignment = 1 282 | _sections_unfolded = [ "Anchor", "Grow Direction", "Margin", "Rect" ] 283 | 284 | [node name="attack_overlay" type="Label" parent="right_area/bf" index="1"] 285 | editor/display_folded = true 286 | self_modulate = Color( 1, 1, 1, 0 ) 287 | anchor_left = 0.0 288 | anchor_top = 0.0 289 | anchor_right = 1.0 290 | anchor_bottom = 1.0 291 | rect_pivot_offset = Vector2( 0, 0 ) 292 | rect_clip_content = false 293 | mouse_filter = 2 294 | mouse_default_cursor_shape = 0 295 | size_flags_horizontal = 1 296 | size_flags_vertical = 4 297 | custom_fonts/font = SubResource( 2 ) 298 | custom_colors/font_color = Color( 0, 0, 0, 1 ) 299 | text = "Start Attack Phase" 300 | align = 1 301 | valign = 1 302 | percent_visible = 1.0 303 | lines_skipped = 0 304 | max_lines_visible = -1 305 | _sections_unfolded = [ "Custom Colors", "Custom Constants", "Mouse", "Visibility", "custom_fonts/font" ] 306 | 307 | [node name="attack_overlay_bg" type="ColorRect" parent="right_area/bf/attack_overlay" index="0"] 308 | self_modulate = Color( 1, 1, 1, 0 ) 309 | show_behind_parent = true 310 | anchor_left = 0.0 311 | anchor_top = 0.0 312 | anchor_right = 1.0 313 | anchor_bottom = 1.0 314 | rect_pivot_offset = Vector2( 0, 0 ) 315 | rect_clip_content = false 316 | mouse_filter = 2 317 | mouse_default_cursor_shape = 0 318 | size_flags_horizontal = 1 319 | size_flags_vertical = 1 320 | color = Color( 1, 1, 1, 1 ) 321 | _sections_unfolded = [ "Mouse", "Visibility" ] 322 | 323 | [node name="attack_h_box" type="HBoxContainer" parent="right_area/bf" index="2"] 324 | anchor_left = 0.0 325 | anchor_top = 1.0 326 | anchor_right = 1.0 327 | anchor_bottom = 1.0 328 | rect_pivot_offset = Vector2( 0, 0 ) 329 | rect_clip_content = false 330 | mouse_filter = 2 331 | mouse_default_cursor_shape = 0 332 | size_flags_horizontal = 1 333 | size_flags_vertical = 1 334 | alignment = 1 335 | _sections_unfolded = [ "Mouse" ] 336 | 337 | [connection signal="gui_input" from="left_area/deck" to="." method="_on_deck_gui_input"] 338 | [connection signal="pressed" from="left_area/FinishTurnButton" to="." method="_on_FinishTurnButton_pressed"] 339 | -------------------------------------------------------------------------------- /card_class/card_creation/card.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=13 format=2] 2 | 3 | [ext_resource path="res://Font/Arial.ttf" type="DynamicFontData" id=1] 4 | [ext_resource path="res://card_class/card_creation/card_populate.gd" type="Script" id=2] 5 | [ext_resource path="res://resources/GreenMana.png" type="Texture" id=3] 6 | [ext_resource path="res://icon.png" type="Texture" id=4] 7 | [ext_resource path="res://resources/magic_card.png" type="Texture" id=5] 8 | 9 | [sub_resource type="DynamicFont" id=1] 10 | 11 | size = 30 12 | outline_size = 0 13 | outline_color = Color( 1, 1, 1, 1 ) 14 | use_mipmaps = false 15 | use_filter = false 16 | font_data = ExtResource( 1 ) 17 | _sections_unfolded = [ "Font" ] 18 | 19 | [sub_resource type="Theme" id=2] 20 | 21 | default_font = SubResource( 1 ) 22 | _sections_unfolded = [ "default_font" ] 23 | 24 | [sub_resource type="StyleBoxFlat" id=3] 25 | 26 | content_margin_left = 20.0 27 | content_margin_right = -1.0 28 | content_margin_top = 0.0 29 | content_margin_bottom = 0.0 30 | bg_color = Color( 0.384314, 0.360784, 0.360784, 1 ) 31 | draw_center = true 32 | border_width_left = 0 33 | border_width_top = 0 34 | border_width_right = 0 35 | border_width_bottom = 0 36 | border_color = Color( 0.8, 0.8, 0.8, 1 ) 37 | border_blend = false 38 | corner_radius_top_left = 16 39 | corner_radius_top_right = 16 40 | corner_radius_bottom_right = 0 41 | corner_radius_bottom_left = 0 42 | corner_detail = 8 43 | expand_margin_left = 0.0 44 | expand_margin_right = 0.0 45 | expand_margin_top = 0.0 46 | expand_margin_bottom = 0.0 47 | shadow_color = Color( 0, 0, 0, 0.6 ) 48 | shadow_size = 0 49 | anti_aliasing = true 50 | anti_aliasing_size = 1 51 | _sections_unfolded = [ "Content Margin", "Corner Radius" ] 52 | 53 | [sub_resource type="DynamicFont" id=4] 54 | 55 | size = 20 56 | outline_size = 0 57 | outline_color = Color( 1, 1, 1, 1 ) 58 | use_mipmaps = false 59 | use_filter = false 60 | font_data = ExtResource( 1 ) 61 | _sections_unfolded = [ "Font", "Settings" ] 62 | 63 | [sub_resource type="StyleBoxFlat" id=5] 64 | 65 | content_margin_left = -1.0 66 | content_margin_right = -1.0 67 | content_margin_top = -1.0 68 | content_margin_bottom = -1.0 69 | bg_color = Color( 0.6, 0.6, 0.6, 1 ) 70 | draw_center = true 71 | border_width_left = 0 72 | border_width_top = 0 73 | border_width_right = 0 74 | border_width_bottom = 0 75 | border_color = Color( 0.8, 0.8, 0.8, 1 ) 76 | border_blend = false 77 | corner_radius_top_left = 0 78 | corner_radius_top_right = 0 79 | corner_radius_bottom_right = 0 80 | corner_radius_bottom_left = 0 81 | corner_detail = 8 82 | expand_margin_left = 0.0 83 | expand_margin_right = 0.0 84 | expand_margin_top = 0.0 85 | expand_margin_bottom = 0.0 86 | shadow_color = Color( 0, 0, 0, 0.6 ) 87 | shadow_size = 0 88 | anti_aliasing = true 89 | anti_aliasing_size = 1 90 | 91 | [sub_resource type="DynamicFont" id=6] 92 | 93 | size = 20 94 | outline_size = 0 95 | outline_color = Color( 1, 1, 1, 1 ) 96 | use_mipmaps = false 97 | use_filter = false 98 | font_data = ExtResource( 1 ) 99 | _sections_unfolded = [ "Font", "Settings", "font_data" ] 100 | 101 | [sub_resource type="StyleBoxFlat" id=7] 102 | 103 | content_margin_left = -1.0 104 | content_margin_right = -1.0 105 | content_margin_top = -1.0 106 | content_margin_bottom = -1.0 107 | bg_color = Color( 0.513726, 0.0666667, 0.0666667, 1 ) 108 | draw_center = true 109 | border_width_left = 0 110 | border_width_top = 0 111 | border_width_right = 0 112 | border_width_bottom = 0 113 | border_color = Color( 0.8, 0.8, 0.8, 1 ) 114 | border_blend = false 115 | corner_radius_top_left = 0 116 | corner_radius_top_right = 0 117 | corner_radius_bottom_right = 16 118 | corner_radius_bottom_left = 16 119 | corner_detail = 8 120 | expand_margin_left = 0.0 121 | expand_margin_right = 0.0 122 | expand_margin_top = 0.0 123 | expand_margin_bottom = 0.0 124 | shadow_color = Color( 0, 0, 0, 0.6 ) 125 | shadow_size = 0 126 | anti_aliasing = true 127 | anti_aliasing_size = 1 128 | _sections_unfolded = [ "Corner Radius" ] 129 | 130 | [node name="Card" type="Control" index="0"] 131 | anchor_left = 0.0 132 | anchor_top = 0.0 133 | anchor_right = 0.0 134 | anchor_bottom = 0.0 135 | margin_right = 388.0 136 | margin_bottom = 583.0 137 | rect_pivot_offset = Vector2( 0, 0 ) 138 | rect_clip_content = false 139 | mouse_filter = 0 140 | mouse_default_cursor_shape = 0 141 | size_flags_horizontal = 1 142 | size_flags_vertical = 1 143 | theme = SubResource( 2 ) 144 | script = ExtResource( 2 ) 145 | _sections_unfolded = [ "Rect", "Theme", "script" ] 146 | 147 | [node name="Panel" type="Panel" parent="." index="0"] 148 | editor/display_folded = true 149 | anchor_left = 0.0 150 | anchor_top = 0.0 151 | anchor_right = 1.0 152 | anchor_bottom = 1.0 153 | rect_pivot_offset = Vector2( 0, 0 ) 154 | rect_clip_content = false 155 | mouse_filter = 0 156 | mouse_default_cursor_shape = 0 157 | size_flags_horizontal = 1 158 | size_flags_vertical = 1 159 | _sections_unfolded = [ "Custom Styles", "Theme", "custom_styles/panel" ] 160 | 161 | [node name="VBoxContainer" type="VBoxContainer" parent="Panel" index="0"] 162 | anchor_left = 0.0 163 | anchor_top = 0.0 164 | anchor_right = 1.0 165 | anchor_bottom = 1.0 166 | margin_left = 27.0 167 | margin_top = 28.0 168 | margin_right = -24.0 169 | margin_bottom = -46.0 170 | rect_pivot_offset = Vector2( 0, 0 ) 171 | rect_clip_content = false 172 | mouse_filter = 1 173 | mouse_default_cursor_shape = 0 174 | size_flags_horizontal = 1 175 | size_flags_vertical = 1 176 | custom_constants/separation = 4 177 | alignment = 0 178 | _sections_unfolded = [ "Custom Constants", "Margin" ] 179 | 180 | [node name="Name" type="Label" parent="Panel/VBoxContainer" index="0"] 181 | anchor_left = 0.0 182 | anchor_top = 0.0 183 | anchor_right = 0.0 184 | anchor_bottom = 0.0 185 | margin_right = 337.0 186 | margin_bottom = 76.0 187 | rect_pivot_offset = Vector2( 0, 0 ) 188 | rect_clip_content = false 189 | mouse_filter = 2 190 | mouse_default_cursor_shape = 0 191 | size_flags_horizontal = 1 192 | size_flags_vertical = 4 193 | custom_styles/normal = SubResource( 3 ) 194 | text = "tttttttttttttttttttttttttttttttt 195 | " 196 | clip_text = true 197 | percent_visible = 1.0 198 | lines_skipped = 0 199 | max_lines_visible = -1 200 | _sections_unfolded = [ "Custom Styles", "Margin", "Rect", "custom_styles/normal" ] 201 | 202 | [node name="HBoxContainer" type="HBoxContainer" parent="Panel/VBoxContainer/Name" index="0"] 203 | anchor_left = 0.0 204 | anchor_top = 0.0 205 | anchor_right = 1.0 206 | anchor_bottom = 1.0 207 | rect_pivot_offset = Vector2( 0, 0 ) 208 | rect_clip_content = false 209 | mouse_filter = 1 210 | mouse_default_cursor_shape = 0 211 | size_flags_horizontal = 1 212 | size_flags_vertical = 1 213 | alignment = 2 214 | 215 | [node name="TextureRect" type="TextureRect" parent="Panel/VBoxContainer/Name/HBoxContainer" index="0"] 216 | visible = false 217 | modulate = Color( 0.0784314, 0.0784314, 0.588235, 1 ) 218 | anchor_left = 0.0 219 | anchor_top = 0.0 220 | anchor_right = 0.0 221 | anchor_bottom = 0.0 222 | margin_left = 287.0 223 | margin_right = 337.0 224 | margin_bottom = 162.0 225 | rect_pivot_offset = Vector2( 0, 0 ) 226 | rect_clip_content = false 227 | mouse_filter = 1 228 | mouse_default_cursor_shape = 0 229 | size_flags_horizontal = 1 230 | size_flags_vertical = 1 231 | texture = ExtResource( 3 ) 232 | stretch_mode = 0 233 | _sections_unfolded = [ "Focus", "Visibility" ] 234 | 235 | [node name="Label2" type="Label" parent="Panel/VBoxContainer" index="1"] 236 | visible = false 237 | anchor_left = 0.0 238 | anchor_top = 0.0 239 | anchor_right = 0.0 240 | anchor_bottom = 0.0 241 | margin_top = 69.0 242 | margin_right = 334.0 243 | margin_bottom = 93.0 244 | rect_pivot_offset = Vector2( 0, 0 ) 245 | rect_clip_content = false 246 | mouse_filter = 2 247 | mouse_default_cursor_shape = 0 248 | size_flags_horizontal = 1 249 | size_flags_vertical = 4 250 | custom_fonts/font = SubResource( 4 ) 251 | percent_visible = 1.0 252 | lines_skipped = 0 253 | max_lines_visible = -1 254 | _sections_unfolded = [ "Custom Fonts", "custom_fonts/font" ] 255 | 256 | [node name="TextureRect" type="TextureRect" parent="Panel/VBoxContainer" index="2"] 257 | anchor_left = 0.0 258 | anchor_top = 0.0 259 | anchor_right = 0.0 260 | anchor_bottom = 0.0 261 | margin_top = 80.0 262 | margin_right = 337.0 263 | margin_bottom = 310.0 264 | rect_min_size = Vector2( 0, 230 ) 265 | rect_pivot_offset = Vector2( 0, 0 ) 266 | rect_clip_content = false 267 | mouse_filter = 1 268 | mouse_default_cursor_shape = 0 269 | size_flags_horizontal = 1 270 | size_flags_vertical = 1 271 | texture = ExtResource( 4 ) 272 | expand = true 273 | stretch_mode = 7 274 | _sections_unfolded = [ "Rect" ] 275 | 276 | [node name="Type" type="Label" parent="Panel/VBoxContainer" index="3"] 277 | anchor_left = 0.0 278 | anchor_top = 0.0 279 | anchor_right = 0.0 280 | anchor_bottom = 0.0 281 | margin_top = 314.0 282 | margin_right = 337.0 283 | margin_bottom = 338.0 284 | rect_pivot_offset = Vector2( 0, 0 ) 285 | rect_clip_content = false 286 | mouse_filter = 2 287 | mouse_default_cursor_shape = 0 288 | size_flags_horizontal = 1 289 | size_flags_vertical = 4 290 | custom_styles/normal = SubResource( 5 ) 291 | custom_fonts/font = SubResource( 6 ) 292 | percent_visible = 1.0 293 | lines_skipped = 0 294 | max_lines_visible = -1 295 | _sections_unfolded = [ "Custom Fonts", "Custom Styles", "Margin", "custom_fonts/font", "custom_styles/normal" ] 296 | 297 | [node name="rich_text_label" type="Label" parent="Panel/VBoxContainer" index="4"] 298 | editor/display_folded = true 299 | anchor_left = 0.0 300 | anchor_top = 0.0 301 | anchor_right = 0.0 302 | anchor_bottom = 0.0 303 | margin_top = 342.0 304 | margin_right = 337.0 305 | margin_bottom = 509.0 306 | rect_pivot_offset = Vector2( 0, 0 ) 307 | rect_clip_content = false 308 | mouse_filter = 2 309 | mouse_default_cursor_shape = 0 310 | size_flags_horizontal = 1 311 | size_flags_vertical = 3 312 | custom_styles/normal = SubResource( 7 ) 313 | autowrap = true 314 | percent_visible = 1.0 315 | lines_skipped = 0 316 | max_lines_visible = -1 317 | _sections_unfolded = [ "Custom Styles", "Size Flags", "custom_styles/normal" ] 318 | 319 | [node name="AttackAndHealth" type="Label" parent="Panel/VBoxContainer/rich_text_label" index="0"] 320 | anchor_left = 1.0 321 | anchor_top = 1.0 322 | anchor_right = 1.0 323 | anchor_bottom = 1.0 324 | margin_left = -40.0 325 | margin_top = -35.0 326 | rect_pivot_offset = Vector2( 0, 0 ) 327 | rect_clip_content = false 328 | mouse_filter = 2 329 | mouse_default_cursor_shape = 0 330 | size_flags_horizontal = 1 331 | size_flags_vertical = 4 332 | percent_visible = 1.0 333 | lines_skipped = 0 334 | max_lines_visible = -1 335 | 336 | [node name="TextureRect" type="TextureRect" parent="." index="1"] 337 | visible = false 338 | modulate = Color( 1, 1, 1, 0.329412 ) 339 | anchor_left = 0.0 340 | anchor_top = 0.0 341 | anchor_right = 1.0 342 | anchor_bottom = 1.0 343 | rect_pivot_offset = Vector2( 0, 0 ) 344 | rect_clip_content = false 345 | mouse_filter = 1 346 | mouse_default_cursor_shape = 0 347 | size_flags_horizontal = 1 348 | size_flags_vertical = 1 349 | texture = ExtResource( 5 ) 350 | stretch_mode = 5 351 | _sections_unfolded = [ "Focus", "Visibility" ] 352 | 353 | --------------------------------------------------------------------------------